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