From vda@port.imtp.ilyichevsk.odessa.ua Thu Apr 1 03:10:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 03:10:47 -0800 (PST) Received: from port.imtp.ilyichevsk.odessa.ua (168.imtp.Ilyichevsk.Odessa.UA [195.66.192.168] (may be forged)) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31B9oKO018503 for ; Thu, 1 Apr 2004 03:10:26 -0800 Received: (qmail 20803 invoked by alias); 1 Apr 2004 11:09:38 -0000 Received: from unknown (HELO vda) (172.16.42.177) by 0 (172.16.22.3) with ESMTP; 01 Apr 2004 11:09:38 -0000 Content-Type: text/plain; charset="iso-8859-1" From: Denis Vlasenko To: Francois Romieu , Jeff Garzik Subject: Re: fealnx oopses (with [PATCH]) Date: Thu, 1 Apr 2004 14:09:37 +0300 X-Mailer: KMail [version 1.4] Cc: netdev@oss.sgi.com, Andreas Henriksson , Denis Vlasenko References: <200403261214.58127.vda@port.imtp.ilyichevsk.odessa.ua> <406B2FB5.9080302@pobox.com> <20040401002325.A9022@electric-eye.fr.zoreil.com> In-Reply-To: <20040401002325.A9022@electric-eye.fr.zoreil.com> MIME-Version: 1.0 Message-Id: <200404011409.37628.vda@port.imtp.ilyichevsk.odessa.ua> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i31B9oKO018503 X-archive-position: 4421 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vda@port.imtp.ilyichevsk.odessa.ua Precedence: bulk X-list: netdev On Thursday 01 April 2004 01:23, Francois Romieu wrote: > Jeff Garzik : > > FYI to those involved, I sent the TX patch upstream. > > > > When there is a minimal RX patch people are happy with, let me know... > > further changes are fine, but I would like to split up the changes as > > much as is reasonable. > > Attached is the patch tested by Andreas which fixes single allocation > failures but will not protect against excessive work in irq handler nor > complete depletion of the Rx ring. > > It applies on top of the Tx patch (as seen on bk-commit). > > Earth-shattering, anyone ? Yes, this thing improved life for me (from oopses to uninterruptible excessive work in interrupt). My RX coding was on top of it, so I think this should be applied. Jeff? -- vda From mludvig@suse.cz Thu Apr 1 04:23:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 04:23:52 -0800 (PST) Received: from kerberos.suse.cz (ns.suse.cz [82.208.2.84]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31CNKKO023960 for ; Thu, 1 Apr 2004 04:23:22 -0800 Received: from chimera.suse.cz (chimera.suse.cz [10.20.0.2]) by kerberos.suse.cz (SuSE CR ESMTP Mailer) with ESMTP id 235394FB53 for ; Thu, 1 Apr 2004 14:23:14 +0200 (MEST) Received: by chimera.suse.cz (Postfix, from userid 503) id CADAB4825; Thu, 1 Apr 2004 14:23:13 +0200 (CEST) Received: from suse.cz (ozzy.suse.cz [10.20.1.72]) by chimera.suse.cz (Postfix) with ESMTP id BB0554824; Thu, 1 Apr 2004 14:23:12 +0200 (CEST) Message-ID: <406C09AE.1030407@suse.cz> Date: Thu, 01 Apr 2004 14:23:10 +0200 From: Michal Ludvig Organization: SuSE CR, s.r.o. User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: cs, cz, en MIME-Version: 1.0 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] pfkey_send_new_mapping() Content-Type: multipart/mixed; boundary="------------010900040305060608070900" X-DCC-neonova-Metrics: chimera 1127; Body=1 Fuz1=1 Fuz2=1 X-archive-position: 4422 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mludvig@suse.cz Precedence: bulk X-list: netdev This is a multi-part message in MIME format. --------------010900040305060608070900 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi, this is a fix for an obvious typo in $SUBJ. Please apply. Michal Ludvig -- SUSE Labs mludvig@suse.cz | Cray is the only computer (+420) 296.545.373 http://www.suse.cz | that runs an endless loop Personal homepage http://www.logix.cz/michal | in just four hours. --------------010900040305060608070900 Content-Type: text/plain; name="kernel-newmap-dst.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kernel-newmap-dst.diff" diff -rup linux-2.6.4/net/key/af_key.c linux-2.6.4/net/key/af_key.c --- linux-2.6.4/net/key/af_key.c 2004-04-01 10:00:32.000000000 +0200 +++ linux-2.6.4/net/key/af_key.c 2004-04-01 10:08:57.000000000 +0200 @@ -2636,7 +2636,7 @@ static int pfkey_send_new_mapping(struct addr->sadb_address_len = (sizeof(struct sadb_address)+sockaddr_size)/ sizeof(uint64_t); - addr->sadb_address_exttype = SADB_EXT_ADDRESS_SRC; + addr->sadb_address_exttype = SADB_EXT_ADDRESS_DST; addr->sadb_address_proto = 0; addr->sadb_address_reserved = 0; if (x->props.family == AF_INET) { --------------010900040305060608070900-- From romieu@fr.zoreil.com Thu Apr 1 04:30:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 04:30:34 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31CURKO024563 for ; Thu, 1 Apr 2004 04:30:28 -0800 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 i31CSxgf021273; Thu, 1 Apr 2004 14:28:59 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i31CSvqc021272; Thu, 1 Apr 2004 14:28:57 +0200 Date: Thu, 1 Apr 2004 14:28:57 +0200 From: Francois Romieu To: Denis Vlasenko Cc: Jeff Garzik , netdev@oss.sgi.com, Andreas Henriksson Subject: Re: fealnx oopses (with [PATCH]) Message-ID: <20040401142857.A21268@electric-eye.fr.zoreil.com> References: <200403261214.58127.vda@port.imtp.ilyichevsk.odessa.ua> <406B2FB5.9080302@pobox.com> <20040401002325.A9022@electric-eye.fr.zoreil.com> <200404011409.37628.vda@port.imtp.ilyichevsk.odessa.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200404011409.37628.vda@port.imtp.ilyichevsk.odessa.ua>; from vda@port.imtp.ilyichevsk.odessa.ua on Thu, Apr 01, 2004 at 02:09:37PM +0300 X-Organisation: Land of Sunshine Inc. X-archive-position: 4423 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 Denis Vlasenko : [...] > Yes, this thing improved life for me (from oopses > to uninterruptible excessive work in interrupt). > My RX coding was on top of it, so I think this should > be applied. The patch includes an unneeded 'return' removal which will choke (it is already done in the Tx patch sent by Jeff). Should I rediff and send directly to Jeff ? -- Ueimor From andrea@suse.de Thu Apr 1 05:17:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 05:17:15 -0800 (PST) Received: from dualathlon.random (ppp-217-133-42-200.cust-adsl.tiscali.it [217.133.42.200]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31DH2KO026205 for ; Thu, 1 Apr 2004 05:17:05 -0800 Received: by dualathlon.random (Postfix, from userid 500) id D47884A6C; Thu, 1 Apr 2004 15:16:57 +0200 (CEST) Date: Thu, 1 Apr 2004 15:16:57 +0200 From: Andrea Arcangeli To: kuznet@ms2.inr.ac.ru Cc: Robert Olsson , Dipankar Sarma , "David S. Miller" , linux-kernel@vger.kernel.org, netdev@oss.sgi.com, paulmck@us.ibm.com, akpm@osdl.org Subject: Re: route cache DoS testing and softirqs Message-ID: <20040401131657.GB18585@dualathlon.random> References: <20040331225259.GT2143@dualathlon.random> <200404010643.KAA08190@yakov.inr.ac.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200404010643.KAA08190@yakov.inr.ac.ru> User-Agent: Mutt/1.4.1i X-GPG-Key: 1024D/68B9CB43 13D9 8355 295F 4823 7C49 C012 DFA1 686E 68B9 CB43 X-PGP-Key: 1024R/CB4660B9 CC A0 71 81 F4 A0 63 AC C0 4B 81 1D 8C 15 C8 E5 X-archive-position: 4424 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: andrea@suse.de Precedence: bulk X-list: netdev On Thu, Apr 01, 2004 at 10:43:45AM +0400, kuznet@ms2.inr.ac.ru wrote: > What's about some accounting do_softirq() in some way as a starting point? > F.e. one way is to account all timer ticks happened while do_softirq() > to ksoftirqd instead of current process (I am not sure that this is even > possible without race conditions). Or something like that. This sounds reasonable. However as a start I was thinking at having hardirq run only the softirq they posted actively, and local_bh_enable run only the softirq that have been posted by the critical section (not from hardirqs happening on top of it). And leave everything else for ksoftirqd. this will complicate the bitmask setting and bitmask management but it sounds doable. This will still leave some unfariness under an irq driven flood (partly a feature to provide as usual the lowest possible latency for stuff like not busy routers where NAPI isn't needed) but at least it avoids hardirq to overload excessively the task that happens to run with bh disabled most of the time, and it will^Wshould allow NAPI to offload the softirq to ksoftirqd completely. comments? From Robert.Olsson@data.slu.se Thu Apr 1 06:17:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 06:17:52 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31EHfKO028259 for ; Thu, 1 Apr 2004 06:17:42 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id i31DivnC009513; Thu, 1 Apr 2004 15:44:58 +0200 Received: by robur.slu.se (Postfix, from userid 1000) id D58FB903D5; Thu, 1 Apr 2004 15:44:57 +0200 (CEST) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16492.7385.765579.771428@robur.slu.se> Date: Thu, 1 Apr 2004 15:44:57 +0200 To: Andrea Arcangeli Cc: Robert Olsson , Dipankar Sarma , "David S. Miller" , kuznet@ms2.inr.ac.ru, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, paulmck@us.ibm.com, akpm@osdl.org Subject: Re: route cache DoS testing and softirqs In-Reply-To: <20040331225259.GT2143@dualathlon.random> References: <20040329222926.GF3808@dualathlon.random> <200403302005.AAA00466@yakov.inr.ac.ru> <20040330211450.GI3808@dualathlon.random> <20040330133000.098761e2.davem@redhat.com> <20040330213742.GL3808@dualathlon.random> <20040331171023.GA4543@in.ibm.com> <16491.4593.718724.277551@robur.slu.se> <20040331203750.GB4543@in.ibm.com> <20040331212817.GQ2143@dualathlon.random> <16491.18384.536778.338660@robur.slu.se> <20040331225259.GT2143@dualathlon.random> X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 4425 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Andrea Arcangeli writes: > But I feel like we should change the softirq code so that the irqexit > runs only the softirq setup by the current (or nested) irq handler. This > way the timer irq will stop executing the softirqs posted by the network > stack and it may very well fix the problem completely. This definitely > will help fairness too. How would softirq's scheduled be softirq's be run? For a definitive solution a think Alexey analysis make sense: "All of them happening outside of ksoftirqd are equally bad, unaccountable, uncontrollable and will show up in some situation." FYI. I did some more experiments: Simple sycall test: user app = ank-time-loop (does gettimeofday in a loop) ========================================================================= Before total droppped tsquz throttl bh_enbl ksoftird irqexit other 00000099 00000000 00000000 00000000 0000005d 00000005 000163a2 00000000 00000008 00000000 00000000 00000000 00000009 00000000 000162f6 00000000 ank-time-loop After 10 sec. 000000c0 00000000 00000000 00000000 0000005d 00000005 0001c3d2 00000000 00000008 00000000 00000000 00000000 00000009 00000000 0001c2f3 00000000 So syscalls "in this context" seems to do_softirq() via irqexit. Route DoS while BGP tables are loading. ank-time-loop is running. ================================================================ total droppped tsquz throttl bh_enbl ksoftird irqexit other 000000c2 00000000 00000000 00000000 00000042 00000005 0001aef8 00000000 00000008 00000000 00000000 00000000 00000017 00000001 0001adba 00000000 After run: 000b3a10 00000000 00000eda 00000000 000006f6 0000052e 00041c06 00000000 000b0500 00000000 00000ec1 00000000 0000075e 00000197 000419f2 00000000 Most softirq's are run from irqexit but we see local_bh_enable is running softirq's too. And only a minority of softirq's is running under scheduler control. As discussed we before with 100Hz timer we would expect lower rates from irqexit. Cheers. --ro From mashirle@us.ibm.com Thu Apr 1 10:28:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 10:29:02 -0800 (PST) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.132]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31ISpKO006319 for ; Thu, 1 Apr 2004 10:28:57 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e34.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i31ISO9x429846; Thu, 1 Apr 2004 13:28:24 -0500 Received: from DYN318388BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i31ISDFY352906; Thu, 1 Apr 2004 11:28:14 -0700 From: Shirley Ma To: Shirley Ma , YOSHIFUJI Hideaki / =?utf-8?q?=E5=90=89=E8=97=A4=E8=8B=B1=E6=98=8E?= Subject: Re: [PATCH]dump interface IPv6 multicast/anycast addresses through netlink Date: Thu, 1 Apr 2004 10:28:12 -0800 User-Agent: KMail/1.5 Cc: davem@redhat.com, netdev@oss.sgi.com, "Hideaki YOSHIFUJI" , yoshfuji@linux-ipv6.org References: In-Reply-To: MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_88FbAl5YLjSg82h" Message-Id: <200404011028.13048.mashirle@us.ibm.com> X-archive-position: 4427 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mashirle@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 6025 Lines: 201 --Boundary-00=_88FbAl5YLjSg82h Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Here is the new patch. It has been tested against linux 2.6.4 kernel. Thanks Shirley Ma IBM Linux Technology Center --Boundary-00=_88FbAl5YLjSg82h Content-Type: text/x-diff; charset="iso-8859-1"; name="linux-2.6.4-ipv6mib.patch.new1" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="linux-2.6.4-ipv6mib.patch.new1" diff -urN linux-2.6.4/include/linux/rtnetlink.h linux-2.6.4-ipv6mib/include/linux/rtnetlink.h --- linux-2.6.4/include/linux/rtnetlink.h 2004-03-10 18:55:42.000000000 -0800 +++ linux-2.6.4-ipv6mib/include/linux/rtnetlink.h 2004-04-01 09:18:16.165353048 -0800 @@ -47,7 +47,11 @@ #define RTM_NEWPREFIX (RTM_BASE+36) #define RTM_GETPREFIX (RTM_BASE+38) -#define RTM_MAX (RTM_BASE+39) +#define RTM_GETMULTICAST (RTM_BASE+42) + +#define RTM_GETANYCAST (RTM_BASE+46) + +#define RTM_MAX (RTM_BASE+47) /* Generic structure for encapsulation of optional route information. @@ -340,7 +344,8 @@ IFA_LABEL, IFA_BROADCAST, IFA_ANYCAST, - IFA_CACHEINFO + IFA_CACHEINFO, + IFA_MULTICAST }; #define IFA_MAX IFA_CACHEINFO diff -urN linux-2.6.4/net/ipv6/addrconf.c linux-2.6.4-ipv6mib/net/ipv6/addrconf.c --- linux-2.6.4/net/ipv6/addrconf.c 2004-03-10 18:55:44.000000000 -0800 +++ linux-2.6.4-ipv6mib/net/ipv6/addrconf.c 2004-04-01 09:56:16.340713704 -0800 @@ -2571,7 +2571,7 @@ if (ipv6_addr_scope(&ifmca->mca_addr)&IFA_SITE) ifm->ifa_scope = RT_SCOPE_SITE; ifm->ifa_index = ifmca->idev->dev->ifindex; - RTA_PUT(skb, IFA_ADDRESS, 16, &ifmca->mca_addr); + RTA_PUT(skb, IFA_MULTICAST, 16, &ifmca->mca_addr); ci.cstamp = (__u32)(TIME_DELTA(ifmca->mca_cstamp, INITIAL_JIFFIES) / HZ * 100 + TIME_DELTA(ifmca->mca_cstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); @@ -2608,7 +2608,7 @@ if (ipv6_addr_scope(&ifaca->aca_addr)&IFA_SITE) ifm->ifa_scope = RT_SCOPE_SITE; ifm->ifa_index = ifaca->aca_idev->dev->ifindex; - RTA_PUT(skb, IFA_ADDRESS, 16, &ifaca->aca_addr); + RTA_PUT(skb, IFA_ANYCAST, 16, &ifaca->aca_addr); ci.cstamp = (__u32)(TIME_DELTA(ifaca->aca_cstamp, INITIAL_JIFFIES) / HZ * 100 + TIME_DELTA(ifaca->aca_cstamp, INITIAL_JIFFIES) % HZ * 100 / HZ); @@ -2627,7 +2627,14 @@ return -1; } -static int inet6_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) +enum addr_type_t +{ + UNICAST_ADDR, + MULTICAST_ADDR, + ANYCAST_ADDR, +}; +static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb, + enum addr_type_t type) { int idx, ip_idx; int s_idx, s_ip_idx; @@ -2651,28 +2658,58 @@ if ((idev = in6_dev_get(dev)) == NULL) continue; read_lock_bh(&idev->lock); - /* unicast address */ - for (ifa = idev->addr_list; ifa; - ifa = ifa->if_next, ip_idx++) { - if (ip_idx < s_ip_idx) - continue; - if ((err = inet6_fill_ifaddr(skb, ifa, - NETLINK_CB(cb->skb).pid, - cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) - goto done; - } - /* temp addr */ + switch (type) { + case UNICAST_ADDR: + /* unicast address */ + for (ifa = idev->addr_list; ifa; + ifa = ifa->if_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifaddr(skb, ifa, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } + /* temp addr */ #ifdef CONFIG_IPV6_PRIVACY - for (ifa = idev->tempaddr_list; ifa; - ifa = ifa->tmp_next, ip_idx++) { - if (ip_idx < s_ip_idx) - continue; - if ((err = inet6_fill_ifaddr(skb, ifa, - NETLINK_CB(cb->skb).pid, - cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) - goto done; - } + for (ifa = idev->tempaddr_list; ifa; + ifa = ifa->tmp_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifaddr(skb, ifa, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } #endif + break; + case MULTICAST_ADDR: + /* multicast address */ + for (ifmca = idev->mc_list; ifmca; + ifmca = ifmca->next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifmcaddr(skb, ifmca, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_GETMULTICAST)) <= 0) + goto done; + } + break; + case ANYCAST_ADDR: + /* anycast address */ + for (ifaca = idev->ac_list; ifaca; + ifaca = ifaca->aca_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifacaddr(skb, ifaca, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_GETANYCAST)) <= 0) + goto done; + } + break; + default: + break; + } read_unlock_bh(&idev->lock); in6_dev_put(idev); } @@ -2687,6 +2724,25 @@ return skb->len; } +static int inet6_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) +{ + enum addr_type_t type = UNICAST_ADDR; + return inet6_dump_addr(skb, cb, type); +} + +static int inet6_dump_ifmcaddr(struct sk_buff *skb, struct netlink_callback *cb) +{ + enum addr_type_t type = MULTICAST_ADDR; + return inet6_dump_addr(skb, cb, type); +} + + +static int inet6_dump_ifacaddr(struct sk_buff *skb, struct netlink_callback *cb) +{ + enum addr_type_t type = ANYCAST_ADDR; + return inet6_dump_addr(skb, cb, type); +} + static void inet6_ifa_notify(int event, struct inet6_ifaddr *ifa) { struct sk_buff *skb; @@ -2911,6 +2967,8 @@ [RTM_NEWADDR - RTM_BASE] = { .doit = inet6_rtm_newaddr, }, [RTM_DELADDR - RTM_BASE] = { .doit = inet6_rtm_deladdr, }, [RTM_GETADDR - RTM_BASE] = { .dumpit = inet6_dump_ifaddr, }, + [RTM_GETMULTICAST - RTM_BASE] = { .dumpit = inet6_dump_ifmcaddr, }, + [RTM_GETANYCAST - RTM_BASE] = { .dumpit = inet6_dump_ifacaddr, }, [RTM_NEWROUTE - RTM_BASE] = { .doit = inet6_rtm_newroute, }, [RTM_DELROUTE - RTM_BASE] = { .doit = inet6_rtm_delroute, }, [RTM_GETROUTE - RTM_BASE] = { .doit = inet6_rtm_getroute, --Boundary-00=_88FbAl5YLjSg82h-- From jgarzik@pobox.com Thu Apr 1 10:32:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 10:32:59 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31IWsKO006736 for ; Thu, 1 Apr 2004 10:32:55 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1B96zi-0003m1-Uy; Thu, 01 Apr 2004 19:32:51 +0100 Message-ID: <406C6046.6080106@pobox.com> Date: Thu, 01 Apr 2004 13:32:38 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Don Fry CC: tsbogend@alpha.franken.de, netdev@oss.sgi.com Subject: Re: [PATCH 2.4.26-rc1] pcnet32.c References: <200403302217.i2UMHYY12182@DYN318364BLD.beaverton.ibm.com> In-Reply-To: <200403302217.i2UMHYY12182@DYN318364BLD.beaverton.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 4428 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 10 Lines: 3 applied From davem@redhat.com Thu Apr 1 10:39:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 10:40:10 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31IdnKO007183 for ; Thu, 1 Apr 2004 10:39:51 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i31Idmjj019403; Thu, 1 Apr 2004 13:39:48 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i31Idmj00350; Thu, 1 Apr 2004 13:39:48 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i31IdP1n014385; Thu, 1 Apr 2004 13:39:26 -0500 Date: Thu, 1 Apr 2004 10:39:04 -0800 From: "David S. Miller" To: Michal Ludvig Cc: netdev@oss.sgi.com Subject: Re: [PATCH] pfkey_send_new_mapping() Message-Id: <20040401103904.5692a892.davem@redhat.com> In-Reply-To: <406C09AE.1030407@suse.cz> References: <406C09AE.1030407@suse.cz> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4429 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 160 Lines: 6 On Thu, 01 Apr 2004 14:23:10 +0200 Michal Ludvig wrote: > this is a fix for an obvious typo in $SUBJ. Please apply. Applied, thanks Michal. From Robert.Olsson@data.slu.se Thu Apr 1 10:53:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 10:54:08 -0800 (PST) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31IrtKO007879 for ; Thu, 1 Apr 2004 10:53:56 -0800 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id i2UMXBnC020477; Wed, 31 Mar 2004 00:33:12 +0200 Received: by robur.slu.se (Postfix, from userid 1000) id 6D0C6903D5; Wed, 31 Mar 2004 00:33:11 +0200 (CEST) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <16489.62887.320005.806119@robur.slu.se> Date: Wed, 31 Mar 2004 00:33:11 +0200 To: Andrea Arcangeli Cc: "David S. Miller" , kuznet@ms2.inr.ac.ru, dipankar@in.ibm.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, Robert.Olsson@data.slu.se, paulmck@us.ibm.com, akpm@osdl.org Subject: Re: route cache DoS testing and softirqs In-Reply-To: <20040330213742.GL3808@dualathlon.random> References: <20040329222926.GF3808@dualathlon.random> <200403302005.AAA00466@yakov.inr.ac.ru> <20040330211450.GI3808@dualathlon.random> <20040330133000.098761e2.davem@redhat.com> <20040330213742.GL3808@dualathlon.random> X-Mailer: VM 7.17 under Emacs 21.3.1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i31IrtKO007879 X-archive-position: 4430 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 1451 Lines: 47 Andrea Arcangeli writes: > He posted these numbers: > > softirq_count, ksoftirqd_count and other_softirq_count shows - > > CPU 0 : 638240 554 637686 > CPU 1 : 102316 1 102315 > CPU 2 : 675696 557 675139 > CPU 3 : 102305 0 102305 > > that means nothing runs in ksoftirqd for Dipankar, so he cannot be using > NAPI. > > Either that or I'm misreading his numbers, or his stats results are wrong. Well we have to ask Dipankar... But I'll buy a beer if it's not on. :) Anyway w. NAPI enabled. 2 * 304 kpps DoS flows into eth0, eth2. Flows are 2 * 10 Millions 64 byte pkts. 32 k buckets routehash. Full Internet routing means ~130 k routes. Linux 2.6.4 2*2.66 MHz XEON. 26: 896 0 IO-APIC-level eth0 27: 25197 0 IO-APIC-level eth1 28: 8 579 IO-APIC-level eth2 29: 10 26112 IO-APIC-level eth3 T-put is seen on output dev. eth1, eth3. So about 16% of incoming load, eth0 1500 0 1577468 9631270 9631270 8422828 237 0 0 0 BRU eth1 1500 0 42 0 0 0 1573355 0 0 0 BRU eth2 1500 0 1636154 9603432 9603432 8363849 41 0 0 0 BRU eth3 1500 0 54 0 0 0 1632274 0 0 0 BRU And lots of . . printk: 1898 messages suppressed. dst cache overflow printk: 829 messages suppressed. dst cache overflow Cheers. --ro From dlstevens@us.ibm.com Thu Apr 1 11:39:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 11:39:26 -0800 (PST) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31JdMKO009569 for ; Thu, 1 Apr 2004 11:39:22 -0800 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i31JdB5U572444 for ; Thu, 1 Apr 2004 14:39:11 -0500 Received: from d03nm121.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i31Jd9xt099798 for ; Thu, 1 Apr 2004 12:39:11 -0700 Subject: [PATCH] fix IGMP version number and timer printing for /proc/net/igmp To: davem@redhat.com, netdev@oss.sgi.com X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Thu, 1 Apr 2004 12:39:09 -0700 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.0.2CF2HF168 | December 5, 2003) at 04/01/2004 12:39:11 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=07BBE4FADFF8272D8f9e8a93df938690918c07BBE4FADFF8272D" X-archive-position: 4431 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dlstevens@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 6366 Lines: 142 --0__=07BBE4FADFF8272D8f9e8a93df938690918c07BBE4FADFF8272D Content-type: multipart/alternative; Boundary="1__=07BBE4FADFF8272D8f9e8a93df938690918c07BBE4FADFF8272D" --1__=07BBE4FADFF8272D8f9e8a93df938690918c07BBE4FADFF8272D Content-type: text/plain; charset=US-ASCII Below are 2.4.x and 2.6.x patches that correctly print the IGMP version number and print "0" for the timer value when a timer is not running. 2.6.x in-line for viewing; both variants attached. +-DLS diff -ruN linux-2.6.5-rc3/net/ipv4/igmp.c linux-2.6.5-rc3F2/net/ipv4/igmp.c --- linux-2.6.5-rc3/net/ipv4/igmp.c 2004-03-30 12:27:30.000000000 -0800 +++ linux-2.6.5-rc3F2/net/ipv4/igmp.c 2004-03-31 23:04:49.000000000 -0800 @@ -2225,7 +2225,9 @@ struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq); char *querier; #ifdef CONFIG_IP_MULTICAST - querier = IGMP_V1_SEEN(state->in_dev) ? "V1" : "V2"; + querier = IGMP_V1_SEEN(state->in_dev) ? "V1" : + IGMP_V2_SEEN(state->in_dev) ? "V2" : + "V3"; #else querier = "NONE"; #endif @@ -2238,7 +2240,9 @@ seq_printf(seq, "\t\t\t\t%08lX %5d %d:%08lX\t\t%d\n", im->multiaddr, im->users, - im->tm_running, jiffies_to_clock_t(im->timer.expires-jiffies), im->reporter); + im->tm_running, im->tm_running ? + jiffies_to_clock_t(im->timer.expires-jiffies) : 0, + im->reporter); } return 0; } (See attached file: 2.4.26rc1-igmpprint.patch) (See attached file: 2.6.5rc3-igmpprint.patch) --1__=07BBE4FADFF8272D8f9e8a93df938690918c07BBE4FADFF8272D Content-type: text/html; charset=US-ASCII Content-Disposition: inline

Below are 2.4.x and 2.6.x patches that correctly print the IGMP
version number and print "0" for the timer value when a timer
is not running.

2.6.x in-line for viewing; both variants attached.

+-DLS

diff -ruN linux-2.6.5-rc3/net/ipv4/igmp.c linux-2.6.5-rc3F2/net/ipv4/igmp.c
--- linux-2.6.5-rc3/net/ipv4/igmp.c 2004-03-30 12:27:30.000000000 -0800
+++ linux-2.6.5-rc3F2/net/ipv4/igmp.c 2004-03-31 23:04:49.000000000 -0800
@@ -2225,7 +2225,9 @@
struct igmp_mc_iter_state *state = igmp_mc_seq_private(seq);
char *querier;
#ifdef CONFIG_IP_MULTICAST
- querier = IGMP_V1_SEEN(state->in_dev) ? "V1" : "V2";
+ querier = IGMP_V1_SEEN(state->in_dev) ? "V1" :
+ IGMP_V2_SEEN(state->in_dev) ? "V2" :
+ "V3";
#else
querier = "NONE";
#endif
@@ -2238,7 +2240,9 @@
seq_printf(seq,
"\t\t\t\t%08lX %5d %d:%08lX\t\t%d\n",
im->multiaddr, im->users,
- im->tm_running, jiffies_to_clock_t(im->timer.expires-jiffies), im->reporter);
+ im->tm_running, im->tm_running ?
+ jiffies_to_clock_t(im->timer.expires-jiffies) : 0,
+ im->reporter);
}
return 0;
}

(See attached file: 2.4.26rc1-igmpprint.patch)
(See attached file: 2.6.5rc3-igmpprint.patch)
--1__=07BBE4FADFF8272D8f9e8a93df938690918c07BBE4FADFF8272D-- --0__=07BBE4FADFF8272D8f9e8a93df938690918c07BBE4FADFF8272D Content-type: application/octet-stream; name="2.4.26rc1-igmpprint.patch" Content-Disposition: attachment; filename="2.4.26rc1-igmpprint.patch" Content-ID: <10__=07BBE4FADFF8272D8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 ZGlmZiAtcnVOIGxpbnV4LTIuNC4yNi1yYzEvbmV0L2lwdjQvaWdtcC5jIGxpbnV4LTIuNC4yNi1y YzFGMi9uZXQvaXB2NC9pZ21wLmMKLS0tIGxpbnV4LTIuNC4yNi1yYzEvbmV0L2lwdjQvaWdtcC5j CTIwMDQtMDMtMzAgMTY6Mjg6MzkuMDAwMDAwMDAwIC0wODAwCisrKyBsaW51eC0yLjQuMjYtcmMx RjIvbmV0L2lwdjQvaWdtcC5jCTIwMDQtMDMtMzEgMjI6NDI6MzMuMDAwMDAwMDAwIC0wODAwCkBA IC0yMTI4LDcgKzIxMjgsOCBAQAogCQkJY29udGludWU7CiAKICNpZmRlZiBDT05GSUdfSVBfTVVM VElDQVNUCi0JCXF1ZXJpZXIgPSBJR01QX1YxX1NFRU4oaW5fZGV2KSA/ICJWMSIgOiAiVjIiOwor CQlxdWVyaWVyID0gSUdNUF9WMV9TRUVOKGluX2RldikgPyAiVjEiIDogSUdNUF9WMl9TRUVOKGlu X2RldikgPworCQkJIlYyIiA6ICJWMyI7CiAjZW5kaWYKIAogCQlsZW4rPXNwcmludGYoYnVmZmVy K2xlbiwiJWRcdCUtMTBzOiAlNWQgJTdzXG4iLApAQCAtMjEzOSw3ICsyMTQwLDkgQEAKIAkJCWxl bis9c3ByaW50ZihidWZmZXIrbGVuLAogCQkJCSAgICAgIlx0XHRcdFx0JTA4bFggJTVkICVkOiUw OGxYXHRcdCVkXG4iLAogCQkJCSAgICAgaW0tPm11bHRpYWRkciwgaW0tPnVzZXJzLAotCQkJCSAg ICAgaW0tPnRtX3J1bm5pbmcsIGltLT50aW1lci5leHBpcmVzLWppZmZpZXMsIGltLT5yZXBvcnRl cik7CisJCQkJICAgICBpbS0+dG1fcnVubmluZywgaW0tPnRtX3J1bm5pbmcgPworCQkJCSAgICAg aW0tPnRpbWVyLmV4cGlyZXMtamlmZmllcyA6IDAsCisJCQkJICAgICBpbS0+cmVwb3J0ZXIpOwog CiAJCQlwb3M9YmVnaW4rbGVuOwogCQkJaWYocG9zPG9mZnNldCkK --0__=07BBE4FADFF8272D8f9e8a93df938690918c07BBE4FADFF8272D Content-type: application/octet-stream; name="2.6.5rc3-igmpprint.patch" Content-Disposition: attachment; filename="2.6.5rc3-igmpprint.patch" Content-ID: <20__=07BBE4FADFF8272D8f9e8a93df938@us.ibm.com> Content-transfer-encoding: base64 ZGlmZiAtcnVOIGxpbnV4LTIuNi41LXJjMy9uZXQvaXB2NC9pZ21wLmMgbGludXgtMi42LjUtcmMz RjIvbmV0L2lwdjQvaWdtcC5jCi0tLSBsaW51eC0yLjYuNS1yYzMvbmV0L2lwdjQvaWdtcC5jCTIw MDQtMDMtMzAgMTI6Mjc6MzAuMDAwMDAwMDAwIC0wODAwCisrKyBsaW51eC0yLjYuNS1yYzNGMi9u ZXQvaXB2NC9pZ21wLmMJMjAwNC0wMy0zMSAyMzowNDo0OS4wMDAwMDAwMDAgLTA4MDAKQEAgLTIy MjUsNyArMjIyNSw5IEBACiAJCXN0cnVjdCBpZ21wX21jX2l0ZXJfc3RhdGUgKnN0YXRlID0gaWdt cF9tY19zZXFfcHJpdmF0ZShzZXEpOwogCQljaGFyICAgKnF1ZXJpZXI7CiAjaWZkZWYgQ09ORklH X0lQX01VTFRJQ0FTVAotCQlxdWVyaWVyID0gSUdNUF9WMV9TRUVOKHN0YXRlLT5pbl9kZXYpID8g IlYxIiA6ICJWMiI7CisJCXF1ZXJpZXIgPSBJR01QX1YxX1NFRU4oc3RhdGUtPmluX2RldikgPyAi VjEiIDoKKwkJCSAgSUdNUF9WMl9TRUVOKHN0YXRlLT5pbl9kZXYpID8gIlYyIiA6CisJCQkgICJW MyI7CiAjZWxzZQogCQlxdWVyaWVyID0gIk5PTkUiOwogI2VuZGlmCkBAIC0yMjM4LDcgKzIyNDAs OSBAQAogCQlzZXFfcHJpbnRmKHNlcSwKIAkJCSAgICJcdFx0XHRcdCUwOGxYICU1ZCAlZDolMDhs WFx0XHQlZFxuIiwKIAkJCSAgIGltLT5tdWx0aWFkZHIsIGltLT51c2VycywKLQkJCSAgIGltLT50 bV9ydW5uaW5nLCBqaWZmaWVzX3RvX2Nsb2NrX3QoaW0tPnRpbWVyLmV4cGlyZXMtamlmZmllcyks IGltLT5yZXBvcnRlcik7CisJCQkgICBpbS0+dG1fcnVubmluZywgaW0tPnRtX3J1bm5pbmcgPwor CQkJICAgamlmZmllc190b19jbG9ja190KGltLT50aW1lci5leHBpcmVzLWppZmZpZXMpIDogMCwK KwkJCSAgIGltLT5yZXBvcnRlcik7CiAJfQogCXJldHVybiAwOwogfQo= --0__=07BBE4FADFF8272D8f9e8a93df938690918c07BBE4FADFF8272D-- From davem@redhat.com Thu Apr 1 11:51:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 11:51:07 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31Jp3KO010221 for ; Thu, 1 Apr 2004 11:51:03 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i31Jp2jj012069; Thu, 1 Apr 2004 14:51:02 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i31Jp2j23353; Thu, 1 Apr 2004 14:51:02 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i31Joe1n019347; Thu, 1 Apr 2004 14:50:40 -0500 Date: Thu, 1 Apr 2004 11:50:17 -0800 From: "David S. Miller" To: David Stevens Cc: netdev@oss.sgi.com Subject: Re: [PATCH] fix IGMP version number and timer printing for /proc/net/igmp Message-Id: <20040401115017.073ae1cc.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4432 X-ecartis-version: Ecartis v1.0.0 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: 24 Lines: 2 Applied, thanks David. From daniel.ritz@gmx.ch Thu Apr 1 13:17:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 13:17:32 -0800 (PST) Received: from ritz.dnsalias.org (80-218-57-148.dclient.hispeed.ch [80.218.57.148]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31LHRKO021468 for ; Thu, 1 Apr 2004 13:17:28 -0800 Received: from toshba.local (toshba.local [192.168.100.12]) by ritz.dnsalias.org (Postfix) with ESMTP id 8CEE14FBB4; Thu, 1 Apr 2004 23:17:25 +0200 (CEST) From: Daniel Ritz Reply-To: daniel.ritz@gmx.ch To: Jeff Garzik Subject: [PATCH] fix arm/etherh.c Date: Thu, 1 Apr 2004 23:17:23 +0200 User-Agent: KMail/1.5.2 Cc: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200404012317.23719.daniel.ritz@gmx.ch> X-archive-position: 4433 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: daniel.ritz@gmx.ch Precedence: bulk X-list: netdev Content-Length: 1774 Lines: 76 arm/etherh.c was broken when converted to alloc_ei_dev(). fix is the same as in pcnet_cs.c. also kfree()ing ec->irqdata is wrong since it's already freed by free_netdev(). against 2.6.5-rc3-bk. untested. --- 1.21/drivers/net/arm/etherh.c Wed Mar 3 00:15:42 2004 +++ edited/drivers/net/arm/etherh.c Sat Mar 27 21:53:49 2004 @@ -59,7 +59,6 @@ static unsigned int net_debug = NET_DEBUG; struct etherh_priv { - struct ei_device eidev; unsigned int id; unsigned int ctrl_port; unsigned int ctrl; @@ -99,6 +98,12 @@ /* ------------------------------------------------------------------------ */ +static inline struct etherh_priv *PRIV(struct net_device *dev) +{ + char *p = netdev_priv(dev); + return (struct etherh_priv *)(p + sizeof(struct ei_device)); +} + static inline void etherh_set_ctrl(struct etherh_priv *eh, unsigned int mask) { eh->ctrl |= mask; @@ -144,8 +149,7 @@ static void etherh_setif(struct net_device *dev) { - struct etherh_priv *eh = netdev_priv(dev); - struct ei_device *ei_local = &eh->eidev; + struct etherh_priv *eh = PRIV(dev); unsigned long addr, flags; local_irq_save(flags); @@ -188,8 +192,7 @@ static int etherh_getifstat(struct net_device *dev) { - struct etherh_priv *eh = netdev_priv(dev); - struct ei_device *ei_local = &eh->eidev; + struct etherh_priv *eh = PRIV(dev); int stat = 0; switch (eh->id) { @@ -551,13 +554,13 @@ etherh_banner(); - dev = alloc_ei_netdev(); + dev = __alloc_ei_netdev(sizeof(struct etherh_priv)); if (!dev) { ret = -ENOMEM; goto out; } - eh = netdev_priv(dev); + eh = PRIV(dev); spin_lock_init(&eh->eidev.page_lock); @@ -712,7 +715,6 @@ free_netdev(dev); ec->ops = NULL; - kfree(ec->irq_data); } static const struct ecard_id etherh_ids[] = { From shemminger@osdl.org Thu Apr 1 13:36:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 13:36:32 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31LaSKO026630 for ; Thu, 1 Apr 2004 13:36:29 -0800 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 i31LaH205838; Thu, 1 Apr 2004 13:36:17 -0800 Date: Thu, 1 Apr 2004 13:36:17 -0800 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com, bridge@osdl.org Subject: [PATCH] bridge (2.6.5) - allow non-root get ioctl's Message-Id: <20040401133617.3f30f39d@dell_ss3.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4434 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 4675 Lines: 185 This patch allows non-root users to inspect the status of a bridge. It moves the permission check for the ioctl from the top level down to where the set type commands are. diff -Nru a/net/bridge/br_device.c b/net/bridge/br_device.c --- a/net/bridge/br_device.c Thu Apr 1 12:50:06 2004 +++ b/net/bridge/br_device.c Thu Apr 1 12:50:06 2004 @@ -32,7 +32,7 @@ if (copy_from_user(args, data, 4*sizeof(unsigned long))) return -EFAULT; - return br_ioctl(dev->priv, args[0], args[1], args[2], args[3]); + return br_ioctl_device(dev->priv, args[0], args[1], args[2], args[3]); } static struct net_device_stats *br_dev_get_stats(struct net_device *dev) diff -Nru a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c --- a/net/bridge/br_ioctl.c Thu Apr 1 12:50:06 2004 +++ b/net/bridge/br_ioctl.c Thu Apr 1 12:50:06 2004 @@ -38,11 +38,8 @@ ? (timer->expires - jiffies) : 0); } -static int br_ioctl_device(struct net_bridge *br, - unsigned int cmd, - unsigned long arg0, - unsigned long arg1, - unsigned long arg2) +int br_ioctl_device(struct net_bridge *br, unsigned int cmd, + unsigned long arg0, unsigned long arg1, unsigned long arg2) { if (br == NULL) return -EINVAL; @@ -55,6 +52,9 @@ struct net_device *dev; int ret; + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + dev = dev_get_by_index(arg0); if (dev == NULL) return -EINVAL; @@ -121,6 +121,9 @@ } case BRCTL_SET_BRIDGE_FORWARD_DELAY: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + spin_lock_bh(&br->lock); br->bridge_forward_delay = user_to_ticks(arg0); if (br_is_root_bridge(br)) @@ -129,6 +132,9 @@ return 0; case BRCTL_SET_BRIDGE_HELLO_TIME: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + spin_lock_bh(&br->lock); br->bridge_hello_time = user_to_ticks(arg0); if (br_is_root_bridge(br)) @@ -137,6 +143,9 @@ return 0; case BRCTL_SET_BRIDGE_MAX_AGE: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + spin_lock_bh(&br->lock); br->bridge_max_age = user_to_ticks(arg0); if (br_is_root_bridge(br)) @@ -145,10 +154,10 @@ return 0; case BRCTL_SET_AGEING_TIME: - br->ageing_time = user_to_ticks(arg0); - return 0; + if (!capable(CAP_NET_ADMIN)) + return -EPERM; - case BRCTL_SET_GC_INTERVAL: /* no longer used */ + br->ageing_time = user_to_ticks(arg0); return 0; case BRCTL_GET_PORT_INFO: @@ -185,10 +194,16 @@ } case BRCTL_SET_BRIDGE_STP_STATE: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + br->stp_enabled = arg0?1:0; return 0; case BRCTL_SET_BRIDGE_PRIORITY: + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + spin_lock_bh(&br->lock); br_stp_set_bridge_priority(br, arg0); spin_unlock_bh(&br->lock); @@ -199,6 +214,9 @@ struct net_bridge_port *p; int ret = 0; + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + spin_lock_bh(&br->lock); if ((p = br_get_port(br, arg0)) == NULL) ret = -EINVAL; @@ -213,6 +231,9 @@ struct net_bridge_port *p; int ret = 0; + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + spin_lock_bh(&br->lock); if ((p = br_get_port(br, arg0)) == NULL) ret = -EINVAL; @@ -265,6 +286,9 @@ { char buf[IFNAMSIZ]; + if (!capable(CAP_NET_ADMIN)) + return -EPERM; + if (copy_from_user(buf, (void *)arg0, IFNAMSIZ)) return -EFAULT; @@ -285,25 +309,8 @@ { unsigned long i[3]; - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - if (copy_from_user(i, (void *)arg, 3*sizeof(unsigned long))) return -EFAULT; return br_ioctl_deviceless(i[0], i[1], i[2]); -} - -int br_ioctl(struct net_bridge *br, unsigned int cmd, unsigned long arg0, unsigned long arg1, unsigned long arg2) -{ - int err; - - if (!capable(CAP_NET_ADMIN)) - return -EPERM; - - err = br_ioctl_deviceless(cmd, arg0, arg1); - if (err == -EOPNOTSUPP) - err = br_ioctl_device(br, cmd, arg0, arg1, arg2); - - return err; } diff -Nru a/net/bridge/br_private.h b/net/bridge/br_private.h --- a/net/bridge/br_private.h Thu Apr 1 12:50:06 2004 +++ b/net/bridge/br_private.h Thu Apr 1 12:50:06 2004 @@ -174,11 +174,11 @@ extern int br_handle_frame(struct sk_buff *skb); /* br_ioctl.c */ -extern int br_ioctl(struct net_bridge *br, - unsigned int cmd, - unsigned long arg0, - unsigned long arg1, - unsigned long arg2); +extern int br_ioctl_device(struct net_bridge *br, + unsigned int cmd, + unsigned long arg0, + unsigned long arg1, + unsigned long arg2); extern int br_ioctl_deviceless_stub(unsigned long arg); /* br_netfilter.c */ -- Stephen Hemminger mailto:shemminger@osdl.org Open Source Development Lab http://developer.osdl.org/shemminger From davem@redhat.com Thu Apr 1 13:39:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 13:39:19 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31LdHKO027023 for ; Thu, 1 Apr 2004 13:39:17 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i31LdEjj017388; Thu, 1 Apr 2004 16:39:14 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i31LdEj27454; Thu, 1 Apr 2004 16:39:14 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i31Lcp1n015306; Thu, 1 Apr 2004 16:38:52 -0500 Date: Thu, 1 Apr 2004 13:38:22 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com, bridge@osdl.org Subject: Re: [PATCH] bridge (2.6.5) - allow non-root get ioctl's Message-Id: <20040401133822.37e699fa.davem@redhat.com> In-Reply-To: <20040401133617.3f30f39d@dell_ss3.pdx.osdl.net> References: <20040401133617.3f30f39d@dell_ss3.pdx.osdl.net> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4435 X-ecartis-version: Ecartis v1.0.0 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: 97 Lines: 5 Ok, do we want a 2.4.x variant as well? If so, please prepare and I'll apply. Thanks Stephen. From shemminger@osdl.org Thu Apr 1 13:42:03 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 13:42:05 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31Lg2KO027412 for ; Thu, 1 Apr 2004 13:42:03 -0800 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 i31Lfp206862; Thu, 1 Apr 2004 13:41:51 -0800 Date: Thu, 1 Apr 2004 13:41:51 -0800 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com, bridge@osdl.org Subject: [PATCH] bridge (2.6.5) - lift ioctl limits on number of bridges/ports. Message-Id: <20040401134151.79ffe512@dell_ss3.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4436 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 2386 Lines: 79 Get rid of some arbitrary API restrictions that limit the kernel to 64 bridges and 256 ports. Retain compatibility in GET_PORT_LIST, the existing bridge API passes 0 for the third argument, and expects 256 entries. Note: there still is limit of 256 ports due to STP, but this shouldn't show up in the API, it needs to be handled by the "add port to bridge ioctl". diff -Nru a/net/bridge/br_if.c b/net/bridge/br_if.c --- a/net/bridge/br_if.c Thu Apr 1 12:50:36 2004 +++ b/net/bridge/br_if.c Thu Apr 1 12:50:36 2004 @@ -262,13 +262,14 @@ return i; } -void br_get_port_ifindices(struct net_bridge *br, int *ifindices) +void br_get_port_ifindices(struct net_bridge *br, int *ifindices, int num) { struct net_bridge_port *p; rcu_read_lock(); list_for_each_entry_rcu(p, &br->port_list, list) { - ifindices[p->port_no] = p->dev->ifindex; + if (p->port_no < num) + ifindices[p->port_no] = p->dev->ifindex; } rcu_read_unlock(); } diff -Nru a/net/bridge/br_ioctl.c b/net/bridge/br_ioctl.c --- a/net/bridge/br_ioctl.c Thu Apr 1 12:50:36 2004 +++ b/net/bridge/br_ioctl.c Thu Apr 1 12:50:36 2004 @@ -104,17 +104,18 @@ case BRCTL_GET_PORT_LIST: { - int *indices; + int num = arg1 ? arg1 : 256; /* compatiablity */ int ret = 0; + int *indices; - indices = kmalloc(256*sizeof(int), GFP_KERNEL); + indices = kmalloc(num*sizeof(int), GFP_KERNEL); if (indices == NULL) return -ENOMEM; - memset(indices, 0, 256*sizeof(int)); + memset(indices, 0, num*sizeof(int)); - br_get_port_ifindices(br, indices); - if (copy_to_user((void *)arg0, indices, 256*sizeof(int))) + br_get_port_ifindices(br, indices, num); + if (copy_to_user((void *)arg0, indices, num*sizeof(int))) ret = -EFAULT; kfree(indices); return ret; @@ -263,9 +264,6 @@ { int *indices; int ret = 0; - - if (arg1 > 64) - arg1 = 64; indices = kmalloc(arg1*sizeof(int), GFP_KERNEL); if (indices == NULL) diff -Nru a/net/bridge/br_private.h b/net/bridge/br_private.h --- a/net/bridge/br_private.h Thu Apr 1 12:50:36 2004 +++ b/net/bridge/br_private.h Thu Apr 1 12:50:36 2004 @@ -167,7 +167,7 @@ extern int br_get_bridge_ifindices(int *indices, int num); extern void br_get_port_ifindices(struct net_bridge *br, - int *ifindices); + int *ifindices, int num); /* br_input.c */ extern int br_handle_frame_finish(struct sk_buff *skb); From davem@redhat.com Thu Apr 1 13:50:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 13:51:00 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31LowKO027840 for ; Thu, 1 Apr 2004 13:50:59 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i31Lotjj022257; Thu, 1 Apr 2004 16:50:55 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i31Lotj32185; Thu, 1 Apr 2004 16:50:55 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i31LoW1n022788; Thu, 1 Apr 2004 16:50:32 -0500 Date: Thu, 1 Apr 2004 13:50:09 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: netdev@oss.sgi.com, bridge@osdl.org Subject: Re: [PATCH] bridge (2.6.5) - lift ioctl limits on number of bridges/ports. Message-Id: <20040401135009.1256aef4.davem@redhat.com> In-Reply-To: <20040401134151.79ffe512@dell_ss3.pdx.osdl.net> References: <20040401134151.79ffe512@dell_ss3.pdx.osdl.net> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4437 X-ecartis-version: Ecartis v1.0.0 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: 77 Lines: 6 Applied, thanks Stephen. Again, send 2.4.x variant if applicable. Thanks. From shemminger@osdl.org Thu Apr 1 13:58:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 13:58:10 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31Lw7KO028327 for ; Thu, 1 Apr 2004 13:58:07 -0800 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 i31Lvk210566; Thu, 1 Apr 2004 13:57:46 -0800 Date: Thu, 1 Apr 2004 13:57:46 -0800 From: Stephen Hemminger To: "David S. Miller" Cc: Miika Keskinen , bridge@osdl.org, netdev@oss.sgi.com Subject: [PATCH] bridge (2.6.5) -- correctl handle up to 256 ports per bridge Message-Id: <20040401135746.0f985897@dell_ss3.pdx.osdl.net> In-Reply-To: <406CA0D7.6020500@usr.fi> References: <406B251B.9050907@usr.fi> <20040401093618.49cca9fa@dell_ss3.pdx.osdl.net> <406CA0D7.6020500@usr.fi> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.9claws (GTK+ 1.2.10; i386-redhat-linux-gnu) X-Face: &@E+xe?c%:&e4D{>f1O<&U>2qwRREG5!}7R4;D<"NO^UI2mJ[eEOA2*3>(`Th.yP,VDPo9$ /`~cw![cmj~~jWe?AHY7D1S+\}5brN0k*NE?pPh_'_d>6;XGG[\KDRViCfumZT3@[ Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4438 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shemminger@osdl.org Precedence: bulk X-list: netdev Content-Length: 2837 Lines: 120 Bridge code is limited to 256 ports per bridge because the Spanning Tree Protocol has limit of one octet for port number. This code fixes: * bogus unlock in error path when port list is full. * passes different error status for out of memory, vs port list full. * O(n) vs O(n^2) lookup for free port number * since port and priority are both limited to one byte don't store them as int's * makes limit explicit in code diff -Nru a/net/bridge/br_if.c b/net/bridge/br_if.c --- a/net/bridge/br_if.c Thu Apr 1 12:55:31 2004 +++ b/net/bridge/br_if.c Thu Apr 1 12:55:31 2004 @@ -24,6 +24,9 @@ #include #include "br_private.h" +/* Limited to 256 ports because of STP protocol pdu */ +#define BR_MAX_PORTS 256 + static int br_initial_port_cost(struct net_device *dev) { if (!strncmp(dev->name, "lec", 3)) @@ -126,34 +129,46 @@ return br; } +static int free_port(struct net_bridge *br) +{ + int index; + struct net_bridge_port *p; + long inuse[BR_MAX_PORTS/(sizeof(long)*8)]; + + /* find free port number */ + memset(inuse, 0, sizeof(inuse)); + list_for_each_entry(p, &br->port_list, list) { + set_bit(p->port_no, inuse); + } + + index = find_first_zero_bit(inuse, BR_MAX_PORTS); + if (index >= BR_MAX_PORTS) + return -EXFULL; + + return index; +} + /* called under bridge lock */ static struct net_bridge_port *new_nbp(struct net_bridge *br, struct net_device *dev) { - int i; + int index; struct net_bridge_port *p; + + index = free_port(br); + if (index < 0) + return ERR_PTR(index); p = kmalloc(sizeof(*p), GFP_ATOMIC); if (p == NULL) - return p; + return ERR_PTR(-ENOMEM); memset(p, 0, sizeof(*p)); p->br = br; p->dev = dev; p->path_cost = br_initial_port_cost(dev); p->priority = 0x80; - - for (i=1;i<255;i++) - if (br_get_port(br, i) == NULL) - break; - - if (i == 255) { - kfree(p); - return NULL; - } - dev->br_port = p; - - p->port_no = i; + p->port_no = index; br_init_port(p); p->state = BR_STATE_DISABLED; @@ -218,10 +233,10 @@ return -ELOOP; dev_hold(dev); - if ((p = new_nbp(br, dev)) == NULL) { - spin_unlock_bh(&br->lock); + p = new_nbp(br, dev); + if (IS_ERR(p)) { dev_put(dev); - return -EXFULL; + return PTR_ERR(p); } dev_set_promiscuity(dev, 1); diff -Nru a/net/bridge/br_private.h b/net/bridge/br_private.h --- a/net/bridge/br_private.h Thu Apr 1 12:55:31 2004 +++ b/net/bridge/br_private.h Thu Apr 1 12:55:31 2004 @@ -57,7 +57,8 @@ struct net_bridge *br; struct net_device *dev; struct list_head list; - int port_no; + __u8 port_no; + __u8 priority; /* STP */ port_id port_id; @@ -69,7 +70,6 @@ port_id designated_port; unsigned topology_change_ack:1; unsigned config_pending:1; - int priority; struct timer_list forward_delay_timer; struct timer_list hold_timer; From davem@redhat.com Thu Apr 1 14:14:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 14:14:37 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31MEZKO029012 for ; Thu, 1 Apr 2004 14:14:35 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i31MEWjj029880; Thu, 1 Apr 2004 17:14:32 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i31MEWj07990; Thu, 1 Apr 2004 17:14:32 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i31ME91n003744; Thu, 1 Apr 2004 17:14:10 -0500 Date: Thu, 1 Apr 2004 14:13:46 -0800 From: "David S. Miller" To: Stephen Hemminger Cc: weeti@usr.fi, bridge@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH] bridge (2.6.5) -- correctl handle up to 256 ports per bridge Message-Id: <20040401141346.69236947.davem@redhat.com> In-Reply-To: <20040401135746.0f985897@dell_ss3.pdx.osdl.net> References: <406B251B.9050907@usr.fi> <20040401093618.49cca9fa@dell_ss3.pdx.osdl.net> <406CA0D7.6020500@usr.fi> <20040401135746.0f985897@dell_ss3.pdx.osdl.net> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4439 X-ecartis-version: Ecartis v1.0.0 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: 559 Lines: 15 On Thu, 1 Apr 2004 13:57:46 -0800 Stephen Hemminger wrote: > Bridge code is limited to 256 ports per bridge because the Spanning > Tree Protocol has limit of one octet for port number. This code > fixes: > * bogus unlock in error path when port list is full. > * passes different error status for out of memory, vs > port list full. > * O(n) vs O(n^2) lookup for free port number > * since port and priority are both limited to one byte > don't store them as int's > * makes limit explicit in code Applied, thanks Stephen. From davem@redhat.com Thu Apr 1 14:26:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 14:26:03 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31MQ0KO029665 for ; Thu, 1 Apr 2004 14:26:00 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i31MPxjj001605; Thu, 1 Apr 2004 17:25:59 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i31MPxj12300; Thu, 1 Apr 2004 17:25:59 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i31MPa1n008889; Thu, 1 Apr 2004 17:25:37 -0500 Date: Thu, 1 Apr 2004 14:25:13 -0800 From: "David S. Miller" To: linux-net@vger.kernel.org Cc: netdev@oss.sgi.com Subject: [TIGON3]: Driver test update Message-Id: <20040401142513.7a4e7390.davem@redhat.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Thu__1_Apr_2004_14_25_13_-0800_9IDNYzGP+w3u_eb6" X-archive-position: 4440 X-ecartis-version: Ecartis v1.0.0 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: 31078 Lines: 428 This is a multi-part message in MIME format. --Multipart=_Thu__1_Apr_2004_14_25_13_-0800_9IDNYzGP+w3u_eb6 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit I'm trying to kill the remaining link detection problems that seem to linger in just about every ethernet driver ever written. :-) Enclosed are patches against current 2.4.x and 2.6.x vanilla kernel tg3 driver sources, give it a go and let me know how it goes. If you're going to report a failure or a "it didn't work before now it does", please include full 'dmesg' output. Thanks. --Multipart=_Thu__1_Apr_2004_14_25_13_-0800_9IDNYzGP+w3u_eb6 Content-Type: application/octet-stream; name="diff24" Content-Disposition: attachment; filename="diff24" Content-Transfer-Encoding: base64 LS0tIG1hcmNlbG8tMi40L2RyaXZlcnMvbmV0L3RnMy5jCTIwMDQtMDQtMDEgMTQ6MjA6NDAuNTY5 NTY4MDAwIC0wODAwCisrKyB0ZzMtM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UlJX0FEVkVS VElTRSwgYWR2X3JlZyk7CisJCWlmICghKHRwLT50ZzNfZmxhZ3MgJiBURzNfRkxBR18xMF8xMDBf T05MWSkpCisJCQl0ZzNfd3JpdGVwaHkodHAsIE1JSV9URzNfQ1RSTCwgdGczX2N0cmwpOworCX0K Kworc2tpcF9waHlfcmVzZXQ6CisJaWYgKCh0cC0+cGh5X2lkICYgUEhZX0lEX01BU0spID09IFBI WV9JRF9CQ001NDAxKSB7CisJCWVyciA9IHRnM19pbml0XzU0MDFwaHlfZHNwKHRwKTsKKwkJaWYg KGVycikKKwkJCXJldHVybiBlcnI7CiAJfQogCiAJaWYgKEdFVF9BU0lDX1JFVih0cC0+cGNpX2No aXBfcmV2X2lkKSA9PSBBU0lDX1JFVl81NzAzKSB7Ci0JCXRnM193cml0ZXBoeSh0cCwgTUlJX1RH M19BVVhfQ1RSTCwgMHgwYzAwKTsKKwkJdGczX3dyaXRlcGh5KHRwLCBNSUlfVEczX0FVWF9DVFJM LCAweDRjMDApOwogCQl0ZzNfd3JpdGVwaHkodHAsIE1JSV9URzNfRFNQX0FERFJFU1MsIDB4MjAx Zik7CiAJCXRnM193cml0ZXBoeSh0cCwgTUlJX1RHM19EU1BfUldfUE9SVCwgMHgyYWFhKTsKIAl9 Cg== --Multipart=_Thu__1_Apr_2004_14_25_13_-0800_9IDNYzGP+w3u_eb6 Content-Type: application/octet-stream; name="diff26" Content-Disposition: attachment; filename="diff26" Content-Transfer-Encoding: base64 LS0tIGxpbnVzLTIuNi9kcml2ZXJzL25ldC90ZzMuYwkyMDA0LTAzLTMxIDE1OjE0OjU1LjAwMDAw MDAwMCAtMDgwMAorKysgdGczLTIuNi9kcml2ZXJzL25ldC90ZzMuYwkyMDA0LTA0LTAxIDE0OjIx OjQxLjA4OTU2ODAwMCAtMDgwMApAQCAtNTYsOCArNTYsOCBAQAogCiAjZGVmaW5lIERSVl9NT0RV TEVfTkFNRQkJInRnMyIKICNkZWZpbmUgUEZYIERSVl9NT0RV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EczX0NUUkwsIHRnM19jdHJsKTsKKwl9CisK K3NraXBfcGh5X3Jlc2V0OgorCWlmICgodHAtPnBoeV9pZCAmIFBIWV9JRF9NQVNLKSA9PSBQSFlf SURfQkNNNTQwMSkgeworCQllcnIgPSB0ZzNfaW5pdF81NDAxcGh5X2RzcCh0cCk7CisJCWlmIChl cnIpCisJCQlyZXR1cm4gZXJyOwogCX0KIAogCWlmIChHRVRfQVNJQ19SRVYodHAtPnBjaV9jaGlw X3Jldl9pZCkgPT0gQVNJQ19SRVZfNTcwMykgewotCQl0ZzNfd3JpdGVwaHkodHAsIE1JSV9URzNf QVVYX0NUUkwsIDB4MGMwMCk7CisJCXRnM193cml0ZXBoeSh0cCwgTUlJX1RHM19BVVhfQ1RSTCwg MHg0YzAwKTsKIAkJdGczX3dyaXRlcGh5KHRwLCBNSUlfVEczX0RTUF9BRERSRVNTLCAweDIwMWYp OwogCQl0ZzNfd3JpdGVwaHkodHAsIE1JSV9URzNfRFNQX1JXX1BPUlQsIDB4MmFhYSk7CiAJfQo= --Multipart=_Thu__1_Apr_2004_14_25_13_-0800_9IDNYzGP+w3u_eb6-- From romieu@fr.zoreil.com Thu Apr 1 15:05:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 15:05:29 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i31N5NKO031337 for ; Thu, 1 Apr 2004 15:05:24 -0800 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 i31N3pgf031195; Fri, 2 Apr 2004 01:03:51 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i31N3pCK031194; Fri, 2 Apr 2004 01:03:51 +0200 Date: Fri, 2 Apr 2004 01:03:51 +0200 From: Francois Romieu To: Maciek Moskal Cc: netdev@oss.sgi.com Subject: Re: Problem witch Your patch to kernel 2.4.26-pre2 ? Message-ID: <20040402010351.A29887@electric-eye.fr.zoreil.com> References: <1080777461.4358.58.camel@b6.kei.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <1080777461.4358.58.camel@b6.kei.pl>; from maciek@kei.pl on Thu, Apr 01, 2004 at 01:57:43AM +0200 X-Organisation: Land of Sunshine Inc. X-archive-position: 4441 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 200 Lines: 10 Maciek Moskal : [bad experience with r8169 driver in 2.4.26-pre2] You may try: http://www.fr.zoreil.com/linux/kernel/2.4.x/2.4.26-rc1/r8169-mammoth-attack.patch Please keep netdev Cc:ed. -- Ueimor From christopherc@team.outblaze.com Thu Apr 1 16:55:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 16:56:01 -0800 (PST) Received: from corpmail.outblaze.com (corpmail.outblaze.com [203.86.166.82]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i320twKO011344 for ; Thu, 1 Apr 2004 16:55:59 -0800 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by corpmail.outblaze.com (Postfix) with ESMTP id B880E37AF0 for ; Fri, 2 Apr 2004 00:55:58 +0000 (GMT) Received: from smtp1.hk1.outblaze.com (smtp1.hk1.outblaze.com [203.86.166.80]) by corpmail.outblaze.com (Postfix) with SMTP id 6BC4316DD85 for ; Fri, 2 Apr 2004 00:55:58 +0000 (GMT) Received: (qmail 1864 invoked from network); 2 Apr 2004 00:55:52 -0000 Received: from unknown (HELO outblaze.com) (christopherc@team.outblaze.com@210.177.227.130) by smtp1.hk1.outblaze.com with SMTP; 2 Apr 2004 00:55:52 -0000 Message-ID: <406CBA60.50103@outblaze.com> Date: Fri, 02 Apr 2004 08:57:05 +0800 From: Christopher Chan User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Cc: Yusuf Goolamabbas Subject: High number of concurrent connections causes 2.6.4 to go berserk Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiVirus: checked by Vexira MailArmor (version: 2.0.1.11; VAE: 6.24.0.7; VDF: 6.24.0.79; host: corpmail.outblaze.com) X-archive-position: 4442 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cchan@outblaze.com Precedence: bulk X-list: netdev Content-Length: 695 Lines: 22 KERNEL: assertion (flags & MSG_PEEK) failed a[t net/ipv4/tcp.c (1571) KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at net/ipv4/tcp.c (1635) These are repeated in the logs during kernel berserk period postfix is running on this box. It is set to spawn max 750 smtpd processes to handle incoming smtp sessions. When tcp_max_syn_backlog is set to 4096 and route.max_size = 131072 route.gc_thresh = 65536 the box goes berserk almost immediately after bootup due to a bounce flood hitting the box. The below values seem to workaround whatever problem the kernel has. tcp_max_syn_backlog = 2048 route.max_size = 1048576 route.gc_thresh = 65536 From niv@us.ibm.com Thu Apr 1 19:31:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 19:31:54 -0800 (PST) Received: from e4.ny.us.ibm.com (e4.ny.us.ibm.com [32.97.182.104]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i323VfKO020027 for ; Thu, 1 Apr 2004 19:31:47 -0800 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e4.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i323VZG9650132; Thu, 1 Apr 2004 22:31:35 -0500 Received: from us.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i323VTGC109444; Thu, 1 Apr 2004 22:31:33 -0500 Message-ID: <406CDDF5.4070500@us.ibm.com> Date: Thu, 01 Apr 2004 19:28:53 -0800 From: Nivedita Singhvi User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Christopher Chan CC: netdev@oss.sgi.com, Yusuf Goolamabbas Subject: Re: High number of concurrent connections causes 2.6.4 to go berserk References: <406CBA60.50103@outblaze.com> In-Reply-To: <406CBA60.50103@outblaze.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 4443 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: niv@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 543 Lines: 24 Christopher Chan wrote: > When tcp_max_syn_backlog is set to 4096 and > route.max_size = 131072 > route.gc_thresh = 65536 > > the box goes berserk almost immediately after bootup due to a bounce > flood hitting the box. > The below values seem to workaround whatever problem the kernel has. > > tcp_max_syn_backlog = 2048 > route.max_size = 1048576 > route.gc_thresh = 65536 Did you try just one of the first two and see which one actually made a difference? I'm assuming the first, but that might not be the case.. thanks, Nivedita From cchan@outblaze.com Thu Apr 1 20:00:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 01 Apr 2004 20:01:02 -0800 (PST) Received: from 192-246.netfront.net (246-192.netfront.net [202.81.246.192]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i3240hKO021422 for ; Thu, 1 Apr 2004 20:00:44 -0800 Received: from outblaze.com (localhost [127.0.0.1]) by 192-246.netfront.net (Postfix) with ESMTP id 341DFEAE70; Fri, 2 Apr 2004 12:00:36 +0800 (HKT) Message-ID: <406CE563.5090105@outblaze.com> Date: Fri, 02 Apr 2004 12:00:35 +0800 From: Christopher Chan User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nivedita Singhvi Cc: netdev@oss.sgi.com, Yusuf Goolamabbas Subject: Re: High number of concurrent connections causes 2.6.4 to go berserk References: <406CBA60.50103@outblaze.com> <406CDDF5.4070500@us.ibm.com> In-Reply-To: <406CDDF5.4070500@us.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 4444 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cchan@outblaze.com Precedence: bulk X-list: netdev Content-Length: 879 Lines: 40 Nivedita Singhvi wrote: > Christopher Chan wrote: > >> When tcp_max_syn_backlog is set to 4096 and >> route.max_size = 131072 >> route.gc_thresh = 65536 >> >> the box goes berserk almost immediately after bootup due to a bounce >> flood hitting the box. > > >> The below values seem to workaround whatever problem the kernel has. >> >> tcp_max_syn_backlog = 2048 >> route.max_size = 1048576 >> route.gc_thresh = 65536 > > > Did you try just one of the first two and see which > one actually made a difference? I'm assuming the first, > but that might not be the case.. Another box that has less traffic but sometimes gets ddosed by bounces has default settings tcp_max_syn_backlog = 1024 route.max_size = 131072 route.gc_thresh = 8192 This box's 2.6.4 also went berserk during the ddos. I'll try your suggestion and get back to you. > > thanks, > Nivedita > > > From christopherc@team.outblaze.com Fri Apr 2 08:36:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 02 Apr 2004 08:36:28 -0800 (PST) Received: from corpmail.outblaze.com (corpmail.outblaze.com [203.86.166.82]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i32GaEKO012208 for ; Fri, 2 Apr 2004 08:36:15 -0800 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by corpmail.outblaze.com (Postfix) with ESMTP id 57AA837B0E for ; Fri, 2 Apr 2004 16:36:15 +0000 (GMT) Received: from smtp1.hk1.outblaze.com (smtp1.hk1.outblaze.com [203.86.166.80]) by corpmail.outblaze.com (Postfix) with SMTP id C0F3116DD94 for ; Fri, 2 Apr 2004 16:36:14 +0000 (GMT) Received: (qmail 12048 invoked from network); 2 Apr 2004 16:36:08 -0000 Received: from unknown (HELO outblaze.com) (christopherc@team.outblaze.com@210.177.227.130) by smtp1.hk1.outblaze.com with SMTP; 2 Apr 2004 16:36:08 -0000 Message-ID: <406D96C1.2000901@outblaze.com> Date: Sat, 03 Apr 2004 00:37:21 +0800 From: Christopher Chan User-Agent: Mozilla Thunderbird 0.5 (X11/20040208) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nivedita Singhvi Cc: netdev@oss.sgi.com, Yusuf Goolamabbas Subject: Re: High number of concurrent connections causes 2.6.4 to go berserk References: <406CBA60.50103@outblaze.com> <406CDDF5.4070500@us.ibm.com> In-Reply-To: <406CDDF5.4070500@us.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiVirus: checked by Vexira MailArmor (version: 2.0.1.11; VAE: 6.24.0.7; VDF: 6.24.0.83; host: corpmail.outblaze.com) X-archive-position: 4445 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cchan@outblaze.com Precedence: bulk X-list: netdev Content-Length: 1180 Lines: 34 >> The below values seem to workaround whatever problem the kernel has. >> >> tcp_max_syn_backlog = 2048 >> route.max_size = 1048576 >> route.gc_thresh = 65536 I take that back. Under peak hours, the kernel starts spewing its stuff onto serial console and network connectivity is lost. What it spews is not human readable anymore. eg: 3->g:asag6A &| rKEt d n SE1PERUELnet p-15 ( t bL:(D3laEED1 f))sspv/ipi 3->g:asag6A &| <3leaititv4d_>r<3_npiti (q G__TRNtd (c p. =msRN||E1(f_P33KNC: t/ne>c7116p-ug ala7gsK 2 a) sev4ipie<6) : ssgsA & M3>ediliocp/tsre3>nxieio(M E_PTRNE na(t (.c==sgNE| 1DflPE3D)C) a/ietco1)63->g:asag6A | ai fer4/pved6> cvcses s MMS>Kd leonp.tceqc>KxtedonMSE1PERUELnet p(1c = g EL (D3laEED1 f)asipt/op) 3->g:asag6A | ai fer4/pved6> cvcoes s MMS>Kd leonp.tceqc>KxtedonMSE1PERUELnet p-1c = g EL (D3laEED1 f))sipt/op) 3->g:asag6A &| r<3_npiti eqSGG_ERatd (ccpq vmER | E (G_D3EKNC:et n->57(1tpbu: fl37gsK12fa) sev4ipie<6) c csesA & M3>ediliocp/tseec>nxieio(M E_PTRNE nattp(.c==sgNE| 1DflPE3D) ))asietco1)63->g:asag6A &| r<3_npiti eqSGG_ERatd (c p. =msRN| E (G_D3EKNC: t/ne>c711tpbu: fl37gsK 2 a) sev4ipi From tmattox@seahawk.ecc.engr.uky.edu Fri Apr 2 12:34:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 02 Apr 2004 12:34:06 -0800 (PST) Received: from seahawk.ecc.engr.uky.edu (seahawk.ecc.engr.uky.edu [128.163.144.83]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i32KY0KO022225 for ; Fri, 2 Apr 2004 12:34:01 -0800 Received: from tmattox (helo=localhost) by seahawk.ecc.engr.uky.edu with local-esmtp (Exim 4.30) id 1B9VBO-0001B4-3N; Fri, 02 Apr 2004 15:22:30 -0500 Date: Fri, 2 Apr 2004 15:22:30 -0500 (EST) From: Timothy I Mattox X-X-Sender: tmattox@seahawk To: jgarzik@pobox.com cc: tulip-users@lists.sourceforge.net, Subject: [PATCH] tulip, kernel 2.4.26-rc1 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 4446 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tmattox@engr.uky.edu Precedence: bulk X-list: netdev Content-Length: 2921 Lines: 67 Here is a patch for the tulip driver found in kernel 2.4.26-rc1 This adds MII functionality to the ADMtek Comet flavor of the tulip, specifically, the ability to detect and report the link status with MII. I've tested on several Linksys LNE100TX v4.1 PCI cards, as well as on an HP Pavilion N5475 laptop with a built-in NIC that is detected as this same model of chip. This patch was modeled after Donald Becker's tulip.c:v0.98 1/8/2004, but the specific bits from his driver have been there for about two years. Please apply to 2.4 mainline. If this is accepted, I will convert & test it for the 2.6 kernel series as well. -- Tim Mattox - tmattox at engr.uky.edu - http://homepage.mac.com/tmattox/ http://aggregate.org/KAOS/ - http://advogato.org/person/tmattox/ diff -Naur -p linux-2.4.26-rc1/drivers/net/tulip/ChangeLog linux-2.4.26-rc1-comet/drivers/net/tulip/ChangeLog --- linux-2.4.26-rc1/drivers/net/tulip/ChangeLog Fri Jun 13 10:51:35 2003 +++ linux-2.4.26-rc1-comet/drivers/net/tulip/ChangeLog Fri Apr 2 14:58:31 2004 @@ -1,3 +1,11 @@ +2004-04-02 Tim Mattox + + Add MII support for ADMtek Comet (Linksys LNE100TX v4.1 & others): + * tulip_core.c: add HAS_MII flag to COMET entry in tulip_tbl[] + * timer.c (comet_timer): add missing call to tulip_check_duplex() + and replace inl() calls with tulip_mdio_read() calls + Changes modeled after Donald Becker's tulip.c:v0.98 1/8/2004 + 2002-09-18 Ryan Bradetich tulip hppa support: diff -Naur -p linux-2.4.26-rc1/drivers/net/tulip/timer.c linux-2.4.26-rc1-comet/drivers/net/tulip/timer.c --- linux-2.4.26-rc1/drivers/net/tulip/timer.c Fri Jun 13 10:51:35 2003 +++ linux-2.4.26-rc1-comet/drivers/net/tulip/timer.c Fri Apr 2 14:36:51 2004 @@ -211,10 +211,16 @@ void comet_timer(unsigned long data) if (tulip_debug > 1) printk(KERN_DEBUG "%s: Comet link status %4.4x partner capability " "%4.4x.\n", - dev->name, inl(ioaddr + 0xB8), inl(ioaddr + 0xC8)); + dev->name, + tulip_mdio_read(dev, tp->phys[0], 1), + tulip_mdio_read(dev, tp->phys[0], 5)); /* mod_timer synchronizes us with potential add_timer calls * from interrupts. */ + if (tulip_check_duplex(dev) < 0) + { /* netif_carrier_off(dev); */ } + else + { /* netif_carrier_on(dev); */ } mod_timer(&tp->timer, RUN_AT(next_tick)); } diff -Naur -p linux-2.4.26-rc1/drivers/net/tulip/tulip_core.c linux-2.4.26-rc1-comet/drivers/net/tulip/tulip_core.c --- linux-2.4.26-rc1/drivers/net/tulip/tulip_core.c Fri Apr 2 14:31:27 2004 +++ linux-2.4.26-rc1-comet/drivers/net/tulip/tulip_core.c Fri Apr 2 14:36:38 2004 @@ -176,7 +176,7 @@ struct tulip_chip_table tulip_tbl[] = { /* COMET */ { "ADMtek Comet", 256, 0x0001abef, - MC_HASH_ONLY | COMET_MAC_ADDR, comet_timer }, + HAS_MII | MC_HASH_ONLY | COMET_MAC_ADDR, comet_timer }, /* COMPEX9881 */ { "Compex 9881 PMAC", 128, 0x0001ebef, From romieu@fr.zoreil.com Fri Apr 2 15:01:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 02 Apr 2004 15:01:34 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i32N1RKO026157 for ; Fri, 2 Apr 2004 15:01:28 -0800 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 i32N0ngf014197; Sat, 3 Apr 2004 01:00:49 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i32N0jpU014196; Sat, 3 Apr 2004 01:00:45 +0200 Date: Sat, 3 Apr 2004 01:00:45 +0200 From: Francois Romieu To: Andi Kleen Cc: jgarzik@pobox.com, netdev@oss.sgi.com, Srihari Vijayaraghavan Subject: [patch] 2.6.5-rc2 - r8169 DAC Message-ID: <20040403010045.A12904@electric-eye.fr.zoreil.com> References: <20040329193604.A4744@electric-eye.fr.zoreil.com> <20040329144034.3d943d12.ak@suse.de> <20040329223513.C4744@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="FL5UXtIhxfXey3p5" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040329223513.C4744@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Mon, Mar 29, 2004 at 10:35:13PM +0200 X-Organisation: Land of Sunshine Inc. X-archive-position: 4447 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 7177 Lines: 246 --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline By popular request, patch for DAC on r8169 is available at: http://www.fr.zoreil.com/people/francois/misc/20040403-2.6.5-rc2-r8169.c-test.patch It applies against 2.6.5-rc2 (i.e. anything 2.6.5-rcX I guess). The incremental patches against the latest serie of r8169 patches posted on netdev is attached. A tester on a x86-32 and a tester on something-64 bits would be _really_ welcome. -- Ueimor --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-dac-00.patch" DMA_{32/64}BIT_MASK for all. include/linux/dma-mapping.h | 3 +++ 1 files changed, 3 insertions(+) diff -puN include/linux/dma-mapping.h~r8169-dac-00 include/linux/dma-mapping.h --- linux-2.6.5-rc2/include/linux/dma-mapping.h~r8169-dac-00 2004-04-03 00:29:17.000000000 +0200 +++ linux-2.6.5-rc2-fr/include/linux/dma-mapping.h 2004-04-03 00:29:17.000000000 +0200 @@ -10,6 +10,9 @@ enum dma_data_direction { DMA_NONE = 3, }; +#define DMA_64BIT_MASK 0xffffffffffffffffULL +#define DMA_32BIT_MASK 0x00000000ffffffffULL + #include /* Backwards compat, remove in 2.7.x */ _ --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="r8169-dac-10.patch" DAC experience: - Rx and Tx descriptors rings handled on 64 bit; - enable DAC through use of CPlusCmd register (reserved bits apart, this is similar to the 8139cp driver); - use the higher 32 bits of addresses for the Rx/Tx buffers. linux/dma-mapping.h | 0 drivers/net/r8169.c | 66 ++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 46 insertions(+), 20 deletions(-) diff -puN drivers/net/r8169.c~r8169-dac-10 drivers/net/r8169.c --- linux-2.6.5-rc2/drivers/net/r8169.c~r8169-dac-10 2004-04-03 00:29:35.000000000 +0200 +++ linux-2.6.5-rc2-fr/drivers/net/r8169.c 2004-04-03 00:29:35.000000000 +0200 @@ -152,8 +152,10 @@ static int rx_copybreak = 200; enum RTL8169_registers { MAC0 = 0, /* Ethernet hardware address. */ MAR0 = 8, /* Multicast filter. */ - TxDescStartAddr = 0x20, - TxHDescStartAddr = 0x28, + TxDescStartAddrLow = 0x20, + TxDescStartAddrHigh = 0x24, + TxHDescStartAddrLow = 0x28, + TxHDescStartAddrHigh = 0x2c, FLASH = 0x30, ERSR = 0x36, ChipCmd = 0x37, @@ -178,7 +180,8 @@ enum RTL8169_registers { PHYstatus = 0x6C, RxMaxSize = 0xDA, CPlusCmd = 0xE0, - RxDescStartAddr = 0xE4, + RxDescAddrLow = 0xE4, + RxDescAddrHigh = 0xE8, EarlyTxThres = 0xEC, FuncEvent = 0xF0, FuncEventMask = 0xF4, @@ -230,7 +233,13 @@ enum RTL8169_register_content { /*TxConfigBits */ TxInterFrameGapShift = 24, - TxDMAShift = 8, /* DMA burst value (0-7) is shift this many bits */ + TxDMAShift = 8, /* DMA burst value (0-7) is shift this many bits */ + + /* CPlusCmd p.31 */ + RxVlan = (1 << 6), + RxChkSum = (1 << 5), + PCIDAC = (1 << 4), + PCIMulRW = (1 << 3), /*rtl8169_PHYstatus */ TBI_Enable = 0x80, @@ -289,15 +298,13 @@ enum _DescStatusBit { struct TxDesc { u32 status; u32 vlan_tag; - u32 buf_addr; - u32 buf_Haddr; + u64 addr; }; struct RxDesc { u32 status; u32 vlan_tag; - u32 buf_addr; - u32 buf_Haddr; + u64 addr; }; struct rtl8169_private { @@ -320,6 +327,7 @@ struct rtl8169_private { struct sk_buff *Tx_skbuff[NUM_TX_DESC]; /* Index of Transmit data buffer */ struct timer_list timer; unsigned long phy_link_down_cnt; + u16 cp_cmd; }; MODULE_AUTHOR("Realtek"); @@ -716,6 +724,20 @@ rtl8169_init_board(struct pci_dev *pdev, goto err_out_disable; } + tp->cp_cmd = PCIMulRW | RxChkSum; + + if ((sizeof(dma_addr_t) > 32) && + !pci_set_dma_mask(pdev, DMA_64BIT_MASK)) + tp->cp_cmd |= PCIDAC; + else { + rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); + if (rc < 0) { + printk(KERN_ERR PFX "DMA configuration failed.\n"); + goto err_out_free_res; + } + } + + // enable PCI bus-mastering pci_set_master(pdev); @@ -1102,17 +1124,21 @@ rtl8169_hw_start(struct net_device *dev) RTL_W32(TxConfig, (TX_DMA_BURST << TxDMAShift) | (InterFrameGap << TxInterFrameGapShift)); - RTL_W16(CPlusCmd, RTL_R16(CPlusCmd)); + tp->cp_cmd |= RTL_R16(CPlusCmd); + RTL_W16(CPlusCmd, tp->cp_cmd); if (tp->mac_version == RTL_GIGA_MAC_VER_D) { dprintk(KERN_INFO PFX "Set MAC Reg C+CR Offset 0xE0: bit-3 and bit-14 MUST be 1\n"); - RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) | (1 << 14) | (1 << 3)); + tp->cp_cmd |= (1 << 14) | PCIMulRW; + RTL_W16(CPlusCmd, tp->cp_cmd); } tp->cur_rx = 0; - RTL_W32(TxDescStartAddr, tp->TxPhyAddr); - RTL_W32(RxDescStartAddr, tp->RxPhyAddr); + RTL_W32(TxDescStartAddrLow, ((u64) tp->TxPhyAddr & DMA_32BIT_MASK)); + RTL_W32(TxDescStartAddrHigh, ((u64) tp->TxPhyAddr >> 32)); + RTL_W32(RxDescAddrLow, ((u64) tp->RxPhyAddr & DMA_32BIT_MASK)); + RTL_W32(RxDescAddrHigh, ((u64) tp->RxPhyAddr >> 32)); RTL_W8(Cfg9346, Cfg9346_Lock); udelay(10); @@ -1132,14 +1158,14 @@ rtl8169_hw_start(struct net_device *dev) static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc) { - desc->buf_addr = 0xdeadbeef; + desc->addr = 0x0badbadbadbadbad; desc->status &= ~cpu_to_le32(OWNbit | RsvdMask); } static void rtl8169_free_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff, struct RxDesc *desc) { - pci_unmap_single(pdev, le32_to_cpu(desc->buf_addr), RX_BUF_SIZE, + pci_unmap_single(pdev, le64_to_cpu(desc->addr), RX_BUF_SIZE, PCI_DMA_FROMDEVICE); dev_kfree_skb(*sk_buff); *sk_buff = NULL; @@ -1153,7 +1179,7 @@ static inline void rtl8169_return_to_asi static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t mapping) { - desc->buf_addr = cpu_to_le32(mapping); + desc->addr = cpu_to_le64(mapping); desc->status |= cpu_to_le32(OWNbit + RX_BUF_SIZE); } @@ -1251,9 +1277,9 @@ static void rtl8169_unmap_tx_skb(struct { u32 len = sk_buff[0]->len; - pci_unmap_single(pdev, le32_to_cpu(desc->buf_addr), + pci_unmap_single(pdev, le64_to_cpu(desc->addr), len < ETH_ZLEN ? ETH_ZLEN : len, PCI_DMA_TODEVICE); - desc->buf_addr = 0x00; + desc->addr = 0x00; *sk_buff = NULL; } @@ -1325,7 +1351,7 @@ rtl8169_start_xmit(struct sk_buff *skb, PCI_DMA_TODEVICE); tp->Tx_skbuff[entry] = skb; - tp->TxDescArray[entry].buf_addr = cpu_to_le32(mapping); + tp->TxDescArray[entry].addr = cpu_to_le64(mapping); tp->TxDescArray[entry].status = cpu_to_le32(OWNbit | FSbit | LSbit | len | (EORbit * !((entry + 1) % NUM_TX_DESC))); @@ -1452,7 +1478,7 @@ rtl8169_rx_interrupt(struct net_device * pci_dma_sync_single_for_cpu(tp->pci_dev, - le32_to_cpu(desc->buf_addr), RX_BUF_SIZE, + le64_to_cpu(desc->addr), RX_BUF_SIZE, PCI_DMA_FROMDEVICE); if (rtl8169_try_rx_copy(&skb, pkt_size, desc, dev)) { @@ -1460,7 +1486,7 @@ rtl8169_rx_interrupt(struct net_device * tp->Rx_skbuff[entry] = NULL; } - pci_action(tp->pci_dev, le32_to_cpu(desc->buf_addr), + pci_action(tp->pci_dev, le64_to_cpu(desc->addr), RX_BUF_SIZE, PCI_DMA_FROMDEVICE); skb_put(skb, pkt_size); diff -puN include/linux/dma-mapping.h~r8169-dac-10 include/linux/dma-mapping.h _ --FL5UXtIhxfXey3p5-- From akpm@osdl.org Fri Apr 2 15:34:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 02 Apr 2004 15:34:29 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i32NYRKO027773 for ; Fri, 2 Apr 2004 15:34:27 -0800 Received: from akpm.pao.digeo.com (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i32NYD226046; Fri, 2 Apr 2004 15:34:14 -0800 Date: Fri, 2 Apr 2004 15:36:28 -0800 From: Andrew Morton To: Marco Fais Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: kernel BUG at page_alloc.c:98 -- compiling with distcc Message-Id: <20040402153628.4a09d979.akpm@osdl.org> In-Reply-To: <406D3E8F.20902@abbeynet.it> References: <406D3E8F.20902@abbeynet.it> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i586-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4448 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 1963 Lines: 56 (linux-2.4.25) Marco Fais wrote: > > kernel BUG at page_alloc.c:98! > uh-oh. > > > >EIP; c01372ae <__free_pages_ok+26e/280> <===== > > > >ebx; c14b3f00 <_end+116e728/204d48a8> > > >ecx; c14b3f00 <_end+116e728/204d48a8> > > >edi; dec11340 <_end+1e8cbb68/204d48a8> > > >ebp; c02f1d04 > > >esp; c02f1cd4 > > Trace; c0135a76 > Trace; c021667b > Trace; c02166b4 > Trace; c0216816 <__kfree_skb+106/160> > Trace; c023be39 > Trace; c023c385 > Trace; c023f51c > Trace; c02465a9 > Trace; c0246a76 > Trace; c022dad0 > Trace; c022dc25 > Trace; c0222780 > Trace; c022dad0 > Trace; c022d88f > Trace; c022dad0 > Trace; c022de3a > Trace; e08d7eab <[8139too]rtl8139_rx_interrupt+6b/3b0> > Trace; c021ad14 > Trace; c021ae3f > Trace; c021af5a > Trace; c0121cd7 > Trace; c010a66d distcc uses sendfile(). The 8139too hardware and driver are zerocopy-capable so the kernel uses zerocopy direct-from-user-pages for sendfile(). The bug is that the networking layer is releasing the final ref to user pages from softirq context. Those pages are still on the page LRU so __free_pages_ok() will take them off. Problem is, removing these pages from the LRU requires that the pagemap_lru_lock be taken, and that lock may not be taken from interrupt context. So we go BUG instead. This was all discussed fairly extensively a couple of years back and I thought it ended up being fixed. From harisri@bigpond.com Fri Apr 2 18:07:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 02 Apr 2004 18:07:52 -0800 (PST) Received: from gizmo10bw.bigpond.com (gizmo10bw.bigpond.com [144.140.70.20]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i3327kKO002756 for ; Fri, 2 Apr 2004 18:07:47 -0800 Received: (qmail 22303 invoked from network); 3 Apr 2004 02:03:30 -0000 Received: from unknown (HELO bwmam02.bigpond.com) (144.135.24.72) by gizmo10bw.bigpond.com with SMTP; 3 Apr 2004 02:03:30 -0000 Received: from bzpp-p-144-138-166-105.prem.tmns.net.au ([144.138.166.105]) by bwmam02.bigpond.com(MAM REL_3_4_2 11/34929230) with SMTP id 34929230; Sat, 03 Apr 2004 12:07:38 +1000 From: Srihari Vijayaraghavan To: Francois Romieu Subject: Re: [patch] 2.6.5-rc2 - r8169 DAC Date: Sat, 3 Apr 2004 12:08:16 +1000 User-Agent: KMail/1.5.4 Cc: jgarzik@pobox.com, netdev@oss.sgi.com, Andi Kleen References: <20040329193604.A4744@electric-eye.fr.zoreil.com> <20040329223513.C4744@electric-eye.fr.zoreil.com> <20040403010045.A12904@electric-eye.fr.zoreil.com> In-Reply-To: <20040403010045.A12904@electric-eye.fr.zoreil.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200404031208.17066.harisri@bigpond.com> X-archive-position: 4449 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: harisri@bigpond.com Precedence: bulk X-list: netdev Content-Length: 1322 Lines: 36 Hello Francois, On Saturday 03 April 2004 09:00, Francois Romieu wrote: > By popular request, patch for DAC on r8169 is available at: > http://www.fr.zoreil.com/people/francois/misc/20040403-2.6.5-rc2-r8169.c-te >st.patch > > It applies against 2.6.5-rc2 (i.e. anything 2.6.5-rcX I guess). Yes it does apply cleanly on both 2.6.5-rc2 and 2.6.5-rc3. > A tester on a x86-32 and a tester on something-64 bits would be _really_ > welcome. I can test your patch on x86-64, but it does not compile. Here is the error message (same error message on both 2.6.5-rc2 and 2.6.5-rc3): CC [M] drivers/net/r8169.o drivers/net/r8169.c: In function `rtl8169_init_board': drivers/net/r8169.c:730: error: `DMA_64BIT_MASK' undeclared (first use in this function) drivers/net/r8169.c:730: error: (Each undeclared identifier is reported only once drivers/net/r8169.c:730: error: for each function it appears in.) drivers/net/r8169.c:733: error: `DMA_32BIT_MASK' undeclared (first use in this function) drivers/net/r8169.c: In function `rtl8169_hw_start': drivers/net/r8169.c:1138: error: `DMA_32BIT_MASK' undeclared (first use in this function) make[2]: *** [drivers/net/r8169.o] Error 1 make[1]: *** [drivers/net] Error 2 make: *** [drivers] Error 2 CC net/core/dev.o make: *** Waiting for unfinished jobs.... Thanks Hari From jgarzik@pobox.com Fri Apr 2 18:25:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 02 Apr 2004 18:26:15 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i332PrKO003491 for ; Fri, 2 Apr 2004 18:25:56 -0800 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1B8LJb-0006xN-ET; Tue, 30 Mar 2004 16:38:11 +0100 Message-ID: <40699457.1020304@pobox.com> Date: Tue, 30 Mar 2004 10:37:59 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Francois Romieu CC: netdev@oss.sgi.com Subject: Re: [patch 0/4] 2.6.5-rc2-mm5 - r8169 queue References: <20040329193604.A4744@electric-eye.fr.zoreil.com> <4068656D.2080103@pobox.com> <20040329211441.B4744@electric-eye.fr.zoreil.com> In-Reply-To: <20040329211441.B4744@electric-eye.fr.zoreil.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 4450 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: 770 Lines: 29 Francois Romieu wrote: > Jeff Garzik : > [...] > >>I am pondering taking your latest version of r8169, and moving the >>phy-related code from there to 8139cp.c. Then just add >> MODULE_ALIAS("r8169"); >>and deleting r8169.c. >> >>The rationale is, 8169 is _exactly_ the same as 8139C+, except the phy >>code and one or two bits in the chip registers. I would rather have >>just one codebase, supporting one MAC (i.e. the RX/TX part) and multiple >>phys. > > > It seems appealing. Do you have a specific schedule in mind ? schedules are an anathema to me ;-) I was thinking about getting your initial patches into 2.6.x upstream so that r8169 users at least have something usable while the phy code gets moved over to 8139cp.c. Jeff From romieu@fr.zoreil.com Sat Apr 3 00:21:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 03 Apr 2004 00:22:21 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i338LRKO018234 for ; Sat, 3 Apr 2004 00:21:30 -0800 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 i338Jugf018871; Sat, 3 Apr 2004 10:19:57 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i338JsaB018870; Sat, 3 Apr 2004 10:19:54 +0200 Date: Sat, 3 Apr 2004 10:19:54 +0200 From: Francois Romieu To: Srihari Vijayaraghavan Cc: jgarzik@pobox.com, netdev@oss.sgi.com, Andi Kleen Subject: Re: [patch] 2.6.5-rc2 - r8169 DAC Message-ID: <20040403101954.A18810@electric-eye.fr.zoreil.com> References: <20040329193604.A4744@electric-eye.fr.zoreil.com> <20040329223513.C4744@electric-eye.fr.zoreil.com> <20040403010045.A12904@electric-eye.fr.zoreil.com> <200404031208.17066.harisri@bigpond.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: <200404031208.17066.harisri@bigpond.com>; from harisri@bigpond.com on Sat, Apr 03, 2004 at 12:08:16PM +1000 X-Organisation: Land of Sunshine Inc. X-archive-position: 4451 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 678 Lines: 25 Srihari Vijayaraghavan : [compile error message] DMA_{32/64}BIT_MASK for all. include/linux/dma-mapping.h | 3 +++ 1 files changed, 3 insertions(+) diff -puN include/linux/dma-mapping.h~r8169-dac-00 include/linux/dma-mapping.h --- linux-2.6.5-rc2/include/linux/dma-mapping.h~r8169-dac-00 2004-04-03 00:29:17.000000000 +0200 +++ linux-2.6.5-rc2-fr/include/linux/dma-mapping.h 2004-04-03 00:29:17.000000000 +0200 @@ -10,6 +10,9 @@ enum dma_data_direction { DMA_NONE = 3, }; +#define DMA_64BIT_MASK 0xffffffffffffffffULL +#define DMA_32BIT_MASK 0x00000000ffffffffULL + #include /* Backwards compat, remove in 2.7.x */ _ From cranium2003@yahoo.com Sat Apr 3 07:07:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 03 Apr 2004 07:07:17 -0800 (PST) Received: from web41414.mail.yahoo.com (web41414.mail.yahoo.com [66.218.93.80]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i33F7GKO004402 for ; Sat, 3 Apr 2004 07:07:16 -0800 Message-ID: <20040403150711.81930.qmail@web41414.mail.yahoo.com> Received: from [61.11.18.134] by web41414.mail.yahoo.com via HTTP; Sat, 03 Apr 2004 07:07:11 PST Date: Sat, 3 Apr 2004 07:07:11 -0800 (PST) From: Parag Nemade Subject: kernel development netwrok protocol modification To: netdev@oss.sgi.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 4452 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cranium2003@yahoo.com Precedence: bulk X-list: netdev Content-Length: 819 Lines: 25 hello friends, I want to add my own routine to network protocol stack. What i want to do i will explain you. For each and every packet that outgoes from kernel i want to attach a 8 byte of my own checksum to data part in packet. This ensures that data is to be transmitted correctly across computers. Can anybody help me where i have to insert my code in kernel source tree cause there are 3 programs to be included in which one exchanges keys adjecent computers. second calculates checksum on basis of that key. and third checks packet replay. I wish to be personally CC'ed the answers/comments posted to the list in response to my posting. regards, Parag. __________________________________ Do you Yahoo!? Yahoo! Small Business $15K Web Design Giveaway http://promotions.yahoo.com/design_giveaway/ From manfred@colorfullife.com Sat Apr 3 11:43:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 03 Apr 2004 11:43:05 -0800 (PST) Received: from dbl.q-ag.de (dbl.q-ag.de [213.172.117.3] (may be forged)) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i33JgvKO015703 for ; Sat, 3 Apr 2004 11:42:58 -0800 Received: from colorfullife.com (dbl [127.0.0.1]) by dbl.q-ag.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i33JgP06017587; Sat, 3 Apr 2004 21:42:27 +0200 Message-ID: <406F13A1.4030201@colorfullife.com> Date: Sat, 03 Apr 2004 21:42:25 +0200 From: Manfred Spraul User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.4.1) Gecko/20031114 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com, linux-kernel@vger.kernel.org CC: Michal Wronski , Krzysztof Benedyczak Subject: [RFC, PATCH] netlink based mq_notify(SIGEV_THREAD) Content-Type: multipart/mixed; boundary="------------020509080401080507010703" X-archive-position: 4453 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: manfred@colorfullife.com Precedence: bulk X-list: netdev Content-Length: 17972 Lines: 637 This is a multi-part message in MIME format. --------------020509080401080507010703 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit mq_notify(SIGEV_THREAD) must be implemented in user space. If an event is triggered, the kernel must send a notification to user space, and then glibc must create the thread with the requested attributes for the notification callback. The current implementation in Andrew's -mm tree uses single shot file descriptor - it works, but it's resource hungry. Attached is a new proposal: - split netlink_unicast into separate substeps - use an AF_NETLINK socket for the message queue notification What do you think? -- Manfred --------------020509080401080507010703 Content-Type: text/plain; name="patch-mqueue-netlink" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-mqueue-netlink" // $Header$ // Kernel Version: // VERSION = 2 // PATCHLEVEL = 6 // SUBLEVEL = 5 // EXTRAVERSION =-rc3-mm1 --- 2.6/include/linux/netlink.h 2004-04-03 14:29:26.000000000 +0200 +++ build-2.6/include/linux/netlink.h 2004-04-03 21:05:11.525685846 +0200 @@ -120,6 +120,13 @@ extern int netlink_register_notifier(struct notifier_block *nb); extern int netlink_unregister_notifier(struct notifier_block *nb); +/* finegrained unicast helpers: */ +struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid); +struct sock *netlink_getsockbyfilp(struct file *filp); +int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long timeo); +void netlink_detachskb(struct sock *sk, struct sk_buff *skb); +int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol); + /* * skb should fit one page. This choice is good for headerless malloc. * --- 2.6/net/netlink/af_netlink.c 2004-03-31 18:36:32.000000000 +0200 +++ build-2.6/net/netlink/af_netlink.c 2004-04-03 21:30:26.147554044 +0200 @@ -415,38 +415,66 @@ } } -int netlink_unicast(struct sock *ssk, struct sk_buff *skb, u32 pid, int nonblock) +struct sock *netlink_getsockbypid(struct sock *ssk, u32 pid) { - struct sock *sk; - struct netlink_opt *nlk; - int len = skb->len; int protocol = ssk->sk_protocol; - long timeo; - DECLARE_WAITQUEUE(wait, current); - - timeo = sock_sndtimeo(ssk, nonblock); + struct sock *sock; + struct netlink_opt *nlk; -retry: - sk = netlink_lookup(protocol, pid); - if (sk == NULL) - goto no_dst; - nlk = nlk_sk(sk); + sock = netlink_lookup(protocol, pid); + if (!sock) + return ERR_PTR(-ECONNREFUSED); /* Don't bother queuing skb if kernel socket has no input function */ - if (nlk->pid == 0 && !nlk->data_ready) - goto no_dst; + nlk = nlk_sk(sock); + if (nlk->pid == 0 && !nlk->data_ready) { + sock_put(sock); + return ERR_PTR(-ECONNREFUSED); + } + return sock; +} + +struct sock *netlink_getsockbyfilp(struct file *filp) +{ + struct inode *inode = filp->f_dentry->d_inode; + struct socket *socket; + struct sock *sock; + + if (!inode->i_sock || !(socket = SOCKET_I(inode))) + return ERR_PTR(-ENOTSOCK); + + sock = socket->sk; + if (sock->sk_family != AF_NETLINK) + return ERR_PTR(-EINVAL); + + sock_hold(sock); + return sock; +} + +/* + * Attach a skb to a netlink socket. + * The caller must hold a reference to the destination socket. On error, the + * reference is dropped. The skb is not send to the destination, just all + * all error checks are performed and memory in the queue is reserved. + * Return values: + * < 0: error. skb freed, reference to sock dropped. + * 0: continue + * 1: repeat lookup - reference dropped while waiting for socket memory. + */ +int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, long timeo) +{ + struct netlink_opt *nlk; + + nlk = nlk_sk(sk); #ifdef NL_EMULATE_DEV - if (nlk->handler) { - skb_orphan(skb); - len = nlk->handler(protocol, skb); - sock_put(sk); - return len; - } + if (nlk->handler) + return 0; #endif if (atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf || test_bit(0, &nlk->state)) { + DECLARE_WAITQUEUE(wait, current); if (!timeo) { if (!nlk->pid) netlink_overrun(sk); @@ -471,19 +499,62 @@ kfree_skb(skb); return sock_intr_errno(timeo); } - goto retry; + return 1; } - skb_orphan(skb); skb_set_owner_r(skb, sk); + return 0; + +} + +int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol) +{ + struct netlink_opt *nlk; + int len = skb->len; + + nlk = nlk_sk(sk); +#ifdef NL_EMULATE_DEV + if (nlk->handler) { + skb_orphan(skb); + len = nlk->handler(protocol, skb); + sock_put(sk); + return len; + } +#endif + skb_queue_tail(&sk->sk_receive_queue, skb); sk->sk_data_ready(sk, len); sock_put(sk); return len; +} -no_dst: +void netlink_detachskb(struct sock *sk, struct sk_buff *skb) +{ kfree_skb(skb); - return -ECONNREFUSED; + sock_put(sk); +} + +int netlink_unicast(struct sock *ssk, struct sk_buff *skb, u32 pid, int nonblock) +{ + struct sock *sk; + int err; + long timeo; + + timeo = sock_sndtimeo(ssk, nonblock); + +retry: + sk = netlink_getsockbypid(ssk, pid); + if (IS_ERR(sk)) { + kfree_skb(skb); + return PTR_ERR(skb); + } + err = netlink_attachskb(sk, skb, nonblock, timeo); + if (err == 1) + goto retry; + if (err) + return err; + + return netlink_sendskb(sk, skb, ssk->sk_protocol); } static __inline__ int netlink_broadcast_deliver(struct sock *sk, struct sk_buff *skb) --- 2.6/include/linux/mqueue.h 2004-04-03 14:29:26.000000000 +0200 +++ build-2.6/include/linux/mqueue.h 2004-04-03 21:32:34.006794932 +0200 @@ -30,8 +30,24 @@ long __reserved[4]; /* ignored for input, zeroed for output */ }; +/* + * SIGEV_THREAD implementation: + * SIGEV_THREAD must be implemented in user space. If SIGEV_THREAD is passed + * to mq_notify, then + * - sigev_signo must be the file descriptor of an AF_NETLINK socket. It's not + * necessary that the socket is bound. + * - sigev_value.sival_ptr must point to a cookie that is NOTIFY_COOKIE_LEN + * bytes long. + * If the notification is triggered, then the cookie is sent to the netlink + * socket. The first byte of the cookie is replaced with the NOTIFY_?? codes: + * NOTIFY_WOKENUP if the notification got triggered, NOTIFY_REMOVED if it was + * removed, either due to a close() on the message queue fd or due to a + * mq_notify() that removed the notification. + */ #define NOTIFY_NONE 0 #define NOTIFY_WOKENUP 1 #define NOTIFY_REMOVED 2 +#define NOTIFY_COOKIE_LEN 32 + #endif --- 2.6/ipc/mqueue.c 2004-04-03 14:29:27.000000000 +0200 +++ build-2.6/ipc/mqueue.c 2004-04-03 20:30:07.207197313 +0200 @@ -20,6 +20,9 @@ #include #include #include +#include +#include +#include #include "util.h" #define MQUEUE_MAGIC 0x19800202 @@ -33,9 +36,6 @@ #define STATE_PENDING 1 #define STATE_READY 2 -#define NP_NONE ((void*)NOTIFY_NONE) -#define NP_WOKENUP ((void*)NOTIFY_WOKENUP) -#define NP_REMOVED ((void*)NOTIFY_REMOVED) /* used by sysctl */ #define FS_MQUEUE 1 #define CTL_QUEUESMAX 2 @@ -48,6 +48,8 @@ #define HARD_MSGMAX (131072/sizeof(void*)) #define DFLT_MSGSIZEMAX 16384 /* max message size */ +#define NOTIFY_COOKIE_LEN 32 + struct ext_wait_queue { /* queue of sleeping tasks */ struct task_struct *task; struct list_head list; @@ -56,25 +58,26 @@ }; struct mqueue_inode_info { - struct mq_attr attr; + spinlock_t lock; + struct inode vfs_inode; + wait_queue_head_t wait_q; + struct msg_msg **messages; + struct mq_attr attr; - pid_t notify_owner; /* != 0 means notification registered */ - struct sigevent notify; - struct file *notify_filp; + struct sigevent notify; /* notify.sigev_notify == SIGEV_NONE means */ + pid_t notify_owner; /* no notification registered */ + struct sock *notify_sock; + struct sk_buff *notify_cookie; /* for tasks waiting for free space and messages, respectively */ struct ext_wait_queue e_wait_q[2]; - wait_queue_head_t wait_q; unsigned long qsize; /* size of queue in memory (sum of all msgs) */ - spinlock_t lock; - struct inode vfs_inode; }; static struct inode_operations mqueue_dir_inode_operations; static struct file_operations mqueue_file_operations; -static struct file_operations mqueue_notify_fops; static struct super_operations mqueue_super_ops; static void remove_notification(struct mqueue_inode_info *info); @@ -119,7 +122,7 @@ init_waitqueue_head(&info->wait_q); INIT_LIST_HEAD(&info->e_wait_q[0].list); INIT_LIST_HEAD(&info->e_wait_q[1].list); - info->notify_owner = 0; + info->notify.sigev_notify = SIGEV_NONE; info->qsize = 0; memset(&info->attr, 0, sizeof(info->attr)); info->attr.mq_maxmsg = DFLT_MSGMAX; @@ -283,10 +286,11 @@ snprintf(buffer, sizeof(buffer), "QSIZE:%-10lu NOTIFY:%-5d SIGNO:%-5d NOTIFY_PID:%-6d\n", info->qsize, - info->notify_owner ? info->notify.sigev_notify : SIGEV_NONE, - (info->notify_owner && info->notify.sigev_notify == SIGEV_SIGNAL ) ? + info->notify.sigev_notify, + (info->notify.sigev_notify == SIGEV_SIGNAL ) ? info->notify.sigev_signo : 0, - info->notify_owner); + (info->notify.sigev_notify != SIGEV_NONE) ? + info->notify_owner : 0); spin_unlock(&info->lock); buffer[sizeof(buffer)-1] = '\0'; slen = strlen(buffer)+1; @@ -299,7 +303,7 @@ count = slen - o; if (copy_to_user(u_data, buffer + o, count)) - return -EFAULT; + return -EFAULT; *off = o + count; filp->f_dentry->d_inode->i_atime = filp->f_dentry->d_inode->i_ctime = CURRENT_TIME; @@ -311,7 +315,8 @@ struct mqueue_inode_info *info = MQUEUE_I(filp->f_dentry->d_inode); spin_lock(&info->lock); - if (current->tgid == info->notify_owner) + if (info->notify.sigev_notify != SIGEV_NONE && + current->tgid == info->notify_owner) remove_notification(info); spin_unlock(&info->lock); @@ -445,7 +450,8 @@ * waiting synchronously for message AND state of queue changed from * empty to not empty. Here we are sure that no one is waiting * synchronously. */ - if (info->notify_owner && info->attr.mq_curmsgs == 1) { + if (info->notify.sigev_notify != SIGEV_NONE && + info->attr.mq_curmsgs == 1) { /* sends signal */ if (info->notify.sigev_notify == SIGEV_SIGNAL) { struct siginfo sig_i; @@ -460,10 +466,11 @@ kill_proc_info(info->notify.sigev_signo, &sig_i, info->notify_owner); } else if (info->notify.sigev_notify == SIGEV_THREAD) { - info->notify_filp->private_data = (void*)NP_WOKENUP; + *(char*)info->notify_cookie->data = NOTIFY_WOKENUP; + netlink_sendskb(info->notify_sock, info->notify_cookie, 0); } /* after notification unregisters process */ - info->notify_owner = 0; + info->notify.sigev_notify = SIGEV_NONE; } wake_up(&info->wait_q); } @@ -499,90 +506,13 @@ return timeout; } -/* - * File descriptor based notification, intended to be used to implement - * SIGEV_THREAD: - * SIGEV_THREAD means that a notification function should be called in the - * context of a new thread. The kernel can't do that. Therefore mq_notify - * calls with SIGEV_THREAD return a new file descriptor. A user space helper - * must create a new thread and then read from the given file descriptor. - * The read always returns one byte. If it's NOTIFY_WOKENUP, then it must - * call the notification function. If it's NOTIFY_REMOVED, then the - * notification was removed. The file descriptor supports poll, thus one - * supervisor thread can manage multiple message queue notifications. - * - * The implementation must support multiple outstanding notifications: - * It's possible that a new notification is added and signaled before user - * space calls mqueue_notify_read for the previous notification. - * Therefore the notification state is stored in the private_data field of - * the file descriptor. - */ -static unsigned int mqueue_notify_poll(struct file *filp, - struct poll_table_struct *poll_tab) -{ - struct mqueue_inode_info *info = MQUEUE_I(filp->f_dentry->d_inode); - int retval; - - poll_wait(filp, &info->wait_q, poll_tab); - - if (filp->private_data == NP_NONE) - retval = 0; - else - retval = POLLIN | POLLRDNORM; - return retval; -} - -static ssize_t mqueue_notify_read(struct file *filp, char __user *buf, - size_t count, loff_t *ppos) -{ - struct mqueue_inode_info *info = MQUEUE_I(filp->f_dentry->d_inode); - char result; - - if (!count) - return 0; - if (*ppos != 0) - return 0; - spin_lock(&info->lock); - while (filp->private_data == NP_NONE) { - DEFINE_WAIT(wait); - if (filp->f_flags & O_NONBLOCK) { - spin_unlock(&info->lock); - return -EAGAIN; - } - prepare_to_wait(&info->wait_q, &wait, TASK_INTERRUPTIBLE); - spin_unlock(&info->lock); - schedule(); - finish_wait(&info->wait_q, &wait); - spin_lock(&info->lock); - } - spin_unlock(&info->lock); - result = (char)(unsigned long)filp->private_data; - if (put_user(result, buf)) - return -EFAULT; - *ppos = 1; - return 1; -} - -static int mqueue_notify_release(struct inode *inode, struct file *filp) -{ - struct mqueue_inode_info *info = MQUEUE_I(filp->f_dentry->d_inode); - - spin_lock(&info->lock); - if (info->notify_owner && info->notify_filp == filp) - info->notify_owner = 0; - filp->private_data = NP_REMOVED; - spin_unlock(&info->lock); - - return 0; -} - static void remove_notification(struct mqueue_inode_info *info) { if (info->notify.sigev_notify == SIGEV_THREAD) { - info->notify_filp->private_data = NP_REMOVED; - wake_up(&info->wait_q); + *(char*)info->notify_cookie->data = NOTIFY_REMOVED; + netlink_sendskb(info->notify_sock, info->notify_cookie, 0); } - info->notify_owner = 0; + info->notify.sigev_notify = SIGEV_NONE; } /* @@ -780,7 +710,8 @@ */ /* pipelined_send() - send a message directly to the task waiting in - * sys_mq_timedreceive() (without inserting message into a queue). */ + * sys_mq_timedreceive() (without inserting message into a queue). + */ static inline void pipelined_send(struct mqueue_inode_info *info, struct msg_msg *message, struct ext_wait_queue *receiver) @@ -974,12 +905,16 @@ asmlinkage long sys_mq_notify(mqd_t mqdes, const struct sigevent __user *u_notification) { - int ret, fd; - struct file *filp, *nfilp; + int ret; + struct file *filp; + struct sock *sock; struct inode *inode; struct sigevent notification; struct mqueue_inode_info *info; + struct sk_buff *nc; + nc = NULL; + sock = NULL; if (u_notification == NULL) { notification.sigev_notify = SIGEV_NONE; } else { @@ -996,6 +931,44 @@ notification.sigev_signo > _NSIG)) { return -EINVAL; } + if (notification.sigev_notify == SIGEV_THREAD) { + /* create the notify skb */ + nc = alloc_skb(NOTIFY_COOKIE_LEN, GFP_KERNEL); + ret = -ENOMEM; + if (!nc) + goto out; + ret = -EFAULT; + if (copy_from_user(nc->data, + notification.sigev_value.sival_ptr, + NOTIFY_COOKIE_LEN)) { + goto out; + } + + /* TODO: add a header? */ + skb_put(nc, NOTIFY_COOKIE_LEN); + /* and attach it to the socket */ +retry: + filp = fget(notification.sigev_signo); + ret = -EBADF; + if (!filp) + goto out; + sock = netlink_getsockbyfilp(filp); + fput(filp); + if (IS_ERR(sock)) { + ret = PTR_ERR(sock); + sock = NULL; + goto out; + } + + ret = netlink_attachskb(sock, nc, 0, MAX_SCHEDULE_TIMEOUT); + if (ret == 1) + goto retry; + if (ret) { + sock = NULL; + nc = NULL; + goto out; + } + } } ret = -EBADF; @@ -1009,47 +982,33 @@ info = MQUEUE_I(inode); ret = 0; - if (notification.sigev_notify == SIGEV_THREAD) { - ret = get_unused_fd(); - if (ret < 0) - goto out_fput; - fd = ret; - nfilp = get_empty_filp(); - if (!nfilp) { - ret = -ENFILE; - goto out_dropfd; - } - nfilp->private_data = NP_NONE; - nfilp->f_op = &mqueue_notify_fops; - nfilp->f_vfsmnt = mntget(mqueue_mnt); - nfilp->f_dentry = dget(filp->f_dentry); - nfilp->f_mapping = filp->f_dentry->d_inode->i_mapping; - nfilp->f_flags = O_RDONLY; - nfilp->f_mode = FMODE_READ; - } else { - nfilp = NULL; - fd = -1; - } - spin_lock(&info->lock); - - if (notification.sigev_notify == SIGEV_NONE) { - if (info->notify_owner == current->tgid) { + switch (notification.sigev_notify) { + case SIGEV_NONE: + if (info->notify.sigev_notify != SIGEV_NONE && + info->notify_owner == current->tgid) { remove_notification(info); inode->i_atime = inode->i_ctime = CURRENT_TIME; } - } else if (info->notify_owner) { - ret = -EBUSY; - } else if (notification.sigev_notify == SIGEV_THREAD) { - info->notify_filp = nfilp; - fd_install(fd, nfilp); - ret = fd; - fd = -1; - nfilp = NULL; + break; + case SIGEV_THREAD: + if (info->notify.sigev_notify != SIGEV_NONE) { + ret = -EBUSY; + break; + } + info->notify_sock = sock; + info->notify_cookie = nc; + sock = NULL; + nc = NULL; info->notify.sigev_notify = SIGEV_THREAD; info->notify_owner = current->tgid; inode->i_atime = inode->i_ctime = CURRENT_TIME; - } else { + break; + case SIGEV_SIGNAL: + if (info->notify.sigev_notify != SIGEV_NONE) { + ret = -EBUSY; + break; + } info->notify.sigev_signo = notification.sigev_signo; info->notify.sigev_value = notification.sigev_value; info->notify.sigev_notify = SIGEV_SIGNAL; @@ -1057,12 +1016,14 @@ inode->i_atime = inode->i_ctime = CURRENT_TIME; } spin_unlock(&info->lock); -out_dropfd: - if (fd != -1) - put_unused_fd(fd); out_fput: fput(filp); out: + if (sock) { + netlink_detachskb(sock, nc); + } else if (nc) { + dev_kfree_skb(nc); + } return ret; } @@ -1131,13 +1092,6 @@ .read = mqueue_read_file, }; -static struct file_operations mqueue_notify_fops = { - .poll = mqueue_notify_poll, - .read = mqueue_notify_read, - .release = mqueue_notify_release, -}; - - static struct super_operations mqueue_super_ops = { .alloc_inode = mqueue_alloc_inode, .destroy_inode = mqueue_destroy_inode, --------------020509080401080507010703-- From hadi@cyberus.ca Sat Apr 3 12:18:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 03 Apr 2004 12:18:54 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i33KIqKO016816 for ; Sat, 3 Apr 2004 12:18:52 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.20) id 1B9rbj-0005aH-KV for netdev@oss.sgi.com; Sat, 03 Apr 2004 15:19:11 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1B9rbI-0007Dn-Sz; Sat, 03 Apr 2004 15:18:45 -0500 Subject: Re: [RFC, PATCH] netlink based mq_notify(SIGEV_THREAD) From: jamal Reply-To: hadi@cyberus.ca To: Manfred Spraul Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, Michal Wronski , Krzysztof Benedyczak In-Reply-To: <406F13A1.4030201@colorfullife.com> References: <406F13A1.4030201@colorfullife.com> Content-Type: text/plain Organization: jamalopolis Message-Id: <1081023487.2037.19.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Apr 2004 15:18:07 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 4454 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 1402 Lines: 38 On Sat, 2004-04-03 at 14:42, Manfred Spraul wrote: > mq_notify(SIGEV_THREAD) must be implemented in user space. If an event > is triggered, the kernel must send a notification to user space, and > then glibc must create the thread with the requested attributes for the > notification callback. I am ignorant about SIGEV_THREAD but from what i gathered above: - something (from user space??) attempts to create a thread in the kernel - the kernel sends notification to user space when said thread is created or done doing something it was asked - something (in glibc/userspace??) is signalled by the kernel to do something with the result Is the above correct? > The current implementation in Andrew's -mm tree > uses single shot file descriptor - it works, but it's resource hungry. Essentially you attempt to open only a single fd via netlink as opposed to open/close behavior you are alluding to, is that correct? then all events are unicast to this fd. I am assuming you dont need to have more than one listener to these events? example, could one process create such a event which multiple processes may be interested in? > Attached is a new proposal: > - split netlink_unicast into separate substeps > - use an AF_NETLINK socket for the message queue notification I am trying to frob why you mucked around with AF_NETLINK; maybe your response will shed some light. cheers, jamal From manfred@colorfullife.com Sat Apr 3 12:43:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 03 Apr 2004 12:43:57 -0800 (PST) Received: from dbl.q-ag.de (dbl.q-ag.de [213.172.117.3]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i33KhpKO020732 for ; Sat, 3 Apr 2004 12:43:54 -0800 Received: from colorfullife.com (dbl [127.0.0.1]) by dbl.q-ag.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i33Khd06018014; Sat, 3 Apr 2004 22:43:41 +0200 Message-ID: <406F21FB.4010502@colorfullife.com> Date: Sat, 03 Apr 2004 22:43:39 +0200 From: Manfred Spraul User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.4.1) Gecko/20031114 X-Accept-Language: en-us, en MIME-Version: 1.0 To: hadi@cyberus.ca CC: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, Michal Wronski , Krzysztof Benedyczak Subject: Re: [RFC, PATCH] netlink based mq_notify(SIGEV_THREAD) References: <406F13A1.4030201@colorfullife.com> <1081023487.2037.19.camel@jzny.localdomain> In-Reply-To: <1081023487.2037.19.camel@jzny.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 4455 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: manfred@colorfullife.com Precedence: bulk X-list: netdev Content-Length: 2710 Lines: 79 jamal wrote: >On Sat, 2004-04-03 at 14:42, Manfred Spraul wrote: > > >>mq_notify(SIGEV_THREAD) must be implemented in user space. If an event >>is triggered, the kernel must send a notification to user space, and >>then glibc must create the thread with the requested attributes for the >>notification callback. >> >> > >I am ignorant about SIGEV_THREAD but from what i gathered above: > >- something (from user space??) attempts to create a thread in the >kernel >- the kernel sends notification to user space when said thread is >created or done doing something it was asked > No - this part is wrong. >- something (in glibc/userspace??) is signalled by the kernel to do >something with the result > > This is correct. mq_notify is a function from the posix message queue interface: It allows user space to request that a notification should be sent if a new message is waiting in the message queue. There are two options for the notification: a signal or a callback that should be called in the context of a new thread. Signals are trivial, but calling a function in the context of a new thread is tricky: the kernel can't create new user space threads. Thus the kernel interface for mq_notify with sigev_notify==SIGEV_THREAD is an asynchroneous interface: the initial syscall just registers something and if a message arrives in the queue, then a notice is sent to user space. glibc must then create a SuS compatible interface on top of that. The problem is how should I sent the information that a message is waiting to user space? >> The current implementation in Andrew's -mm tree >>uses single shot file descriptor - it works, but it's resource hungry. >> >> > >Essentially you attempt to open only a single fd via netlink as opposed >to open/close behavior you are alluding to, is that correct? > Yes. >then all events are unicast to this fd. I am assuming you dont need to >have more than one listener to these events? example, could one process >create such a event which multiple processes may be interested in? > > Correct, always only one process interested in the notification. >>Attached is a new proposal: >>- split netlink_unicast into separate substeps >>- use an AF_NETLINK socket for the message queue notification >> >> > >I am trying to frob why you mucked around with AF_NETLINK; maybe your >response will shed some light. > > I'm looking for the simplest interface to send 32 byte cookies from kernel to user space. The final send must be non-blocking, setup can block. Someone recommended that I should look at netlink. netlink_unicast was nearly perfect, except that I had to split setup and sending into two functions. -- Manfred From hadi@cyberus.ca Sat Apr 3 14:01:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 03 Apr 2004 14:02:00 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i33M1uKO023117 for ; Sat, 3 Apr 2004 14:01:57 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1B9tDU-0003rR-VS for netdev@oss.sgi.com; Sat, 03 Apr 2004 17:02:16 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1B9tD2-0005d8-Qc; Sat, 03 Apr 2004 17:01:49 -0500 Subject: Re: [RFC, PATCH] netlink based mq_notify(SIGEV_THREAD) From: jamal Reply-To: hadi@cyberus.ca To: Manfred Spraul Cc: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, Michal Wronski , Krzysztof Benedyczak In-Reply-To: <406F21FB.4010502@colorfullife.com> References: <406F13A1.4030201@colorfullife.com> <1081023487.2037.19.camel@jzny.localdomain> <406F21FB.4010502@colorfullife.com> Content-Type: text/plain Organization: jamalopolis Message-Id: <1081029667.2037.55.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Apr 2004 17:01:07 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 4456 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 1326 Lines: 33 On Sat, 2004-04-03 at 15:43, Manfred Spraul wrote: > Thus the kernel interface for mq_notify with sigev_notify==SIGEV_THREAD > is an asynchroneous interface: the initial syscall just registers > something and if a message arrives in the queue, then a notice is sent > to user space. glibc must then create a SuS compatible interface on top > of that. The above is a good description of the challenge i think. [..] > I'm looking for the simplest interface to send 32 byte cookies from > kernel to user space. The final send must be non-blocking, setup can > block. Someone recommended that I should look at netlink. > netlink_unicast was nearly perfect, except that I had to split setup and > sending into two functions. Your split of netlink_unicast seems fine ; I guess the bigger question is whether this interface could be a speacilized netlink protocol instead? It doesnt seem too nasty as is right now, just tending towards cleanliness. It seems that user space must first open a netlink socket for this to work but somehow the result skb is passed back to userspace using the mq_notify and not via the socket interface opened? Why should user space even bother doing this? The kernel could on its behalf, no? Are you sure there will always be one and only one message outstanding always? cheers, jamal From davem@redhat.com Sat Apr 3 14:31:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 03 Apr 2004 14:32:07 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i33MVuKO024077 for ; Sat, 3 Apr 2004 14:31:57 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i33MVrjj001217; Sat, 3 Apr 2004 17:31:53 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i33MVrj25009; Sat, 3 Apr 2004 17:31:53 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i33MVF1n022358; Sat, 3 Apr 2004 17:31:29 -0500 Date: Sat, 3 Apr 2004 14:30:37 -0800 From: "David S. Miller" To: Shirley Ma Cc: netdev@oss.sgi.com, yoshfuji@linux-ipv6.org, xma@us.ibm.com Subject: Re: [PATCH]Add IPv6 MIBs counters in MLD (mcast.c) Message-Id: <20040403143037.61530b25.davem@redhat.com> In-Reply-To: <200403311326.43647.mashirle@us.ibm.com> References: <200403311326.43647.mashirle@us.ibm.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4457 X-ecartis-version: Ecartis v1.0.0 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: 174 Lines: 6 On Wed, 31 Mar 2004 13:26:43 -0800 Shirley Ma wrote: > Here is the patch against linux 2.6.4 kernel. Please review it. Patch applied, thanks Shirley. From davem@redhat.com Sat Apr 3 14:47:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 03 Apr 2004 14:47:10 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i33Ml8KO024777 for ; Sat, 3 Apr 2004 14:47:08 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i33Mkujj004182; Sat, 3 Apr 2004 17:46:56 -0500 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i33Mkuj27664; Sat, 3 Apr 2004 17:46:56 -0500 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i33MkI1n026567; Sat, 3 Apr 2004 17:46:32 -0500 Date: Sat, 3 Apr 2004 14:45:40 -0800 From: "David S. Miller" To: Shirley Ma Cc: xma@us.ibm.com, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com, yoshfuji@cerberus.hongo.wide.ad.jp Subject: Re: [PATCH]dump interface IPv6 multicast/anycast addresses through netlink Message-Id: <20040403144540.7f201bc1.davem@redhat.com> In-Reply-To: <200404011028.13048.mashirle@us.ibm.com> References: <200404011028.13048.mashirle@us.ibm.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4458 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 299 Lines: 11 On Thu, 1 Apr 2004 10:28:12 -0800 Shirley Ma wrote: > Here is the new patch. It has been tested against linux 2.6.4 kernel. I'm Ok with this patch and I believe Yoshfuji et al. are too. But this patch will not apply cleanly to current 2.6.x sources, please rediff. Thanks. From hadi@cyberus.ca Sat Apr 3 16:51:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 03 Apr 2004 16:51:32 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i340pTKO000957 for ; Sat, 3 Apr 2004 16:51:29 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.20) id 1B9uAV-0006fu-WD for netdev@oss.sgi.com; Sat, 03 Apr 2004 18:03:15 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1B9uA5-0007HW-SI; Sat, 03 Apr 2004 18:02:50 -0500 Subject: Re: Luca Deri's paper: Improving Passive Packet Capture: Beyond Device Polling From: jamal Reply-To: hadi@cyberus.ca To: Yusuf Goolamabbas Cc: netdev@oss.sgi.com In-Reply-To: <20040330142354.GA17671@outblaze.com> References: <20040330142354.GA17671@outblaze.com> Content-Type: text/plain Organization: jamalopolis Message-Id: <1081033332.2037.61.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Apr 2004 18:02:12 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 4459 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 722 Lines: 22 On Tue, 2004-03-30 at 09:23, Yusuf Goolamabbas wrote: > Maybe this might be of interest to netdev hackers > > Luca Deri's paper > Improving Passive Packet Capture: Beyond Device Polling > > http://www.net-security.org/dl/articles/Ring.pdf > Thanks for posting this. I am a little suprised at some of the results especially with NAPI + packet mmap. I have had no problem at all handling wire rate 100mbps with tulip-NAPI in 2.4.x using packet mmap on a p3 or maybe it was a p2; This is zero drops at 148.8Kpps. Jason Lunz actually seemed to have been doing more work on this and e1000 - he could provide better perfomance numbers. It should also be noted that infact packet mmap already uses rings. cheers, jamal From manfred@colorfullife.com Sat Apr 3 23:11:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Sat, 03 Apr 2004 23:11:50 -0800 (PST) Received: from dbl.q-ag.de (dbl.q-ag.de [213.172.117.3]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i347BdKO016099 for ; Sat, 3 Apr 2004 23:11:40 -0800 Received: from colorfullife.com (dbl [127.0.0.1]) by dbl.q-ag.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id i347BQ06026046; Sun, 4 Apr 2004 09:11:28 +0200 Message-ID: <406FB51E.3090001@colorfullife.com> Date: Sun, 04 Apr 2004 09:11:26 +0200 From: Manfred Spraul User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr-FR; rv:1.4.1) Gecko/20031114 X-Accept-Language: en-us, en MIME-Version: 1.0 To: hadi@cyberus.ca CC: netdev@oss.sgi.com, linux-kernel@vger.kernel.org, Michal Wronski , Krzysztof Benedyczak Subject: Re: [RFC, PATCH] netlink based mq_notify(SIGEV_THREAD) References: <406F13A1.4030201@colorfullife.com> <1081023487.2037.19.camel@jzny.localdomain> <406F21FB.4010502@colorfullife.com> <1081029667.2037.55.camel@jzny.localdomain> In-Reply-To: <1081029667.2037.55.camel@jzny.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 4460 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: manfred@colorfullife.com Precedence: bulk X-list: netdev Content-Length: 945 Lines: 26 jamal wrote: >Your split of netlink_unicast seems fine ; >I guess the bigger question is whether this interface could be a >speacilized netlink protocol instead? It doesnt seem too nasty as is >right now, just tending towards cleanliness. >It seems that user space must first open a netlink socket for this to >work but somehow the result skb is passed back to userspace using the >mq_notify and not via the socket interface opened? > No, the result is returned via the socket fd. It's just created due to the mq_notify call. > Why should user space >even bother doing this? The kernel could on its behalf, no? Are you sure >there will always be one and only one message outstanding always? > > There can be multiple messages outstanding. Each sucessful mq_notify call generates exactly one message, but a process could create multiple message queues and then there can be multiple messages in the notification socket. -- Manfred From shawn.starr@rogers.com Sun Apr 4 13:58:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 04 Apr 2004 13:58:48 -0700 (PDT) Received: from fep02-mail.bloor.is.net.cable.rogers.com (fep02-mail.bloor.is.net.cable.rogers.com [66.185.86.72]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i34KwfKO028434 for ; Sun, 4 Apr 2004 13:58:41 -0700 Received: from panic ([67.60.40.239]) by fep02-mail.bloor.is.net.cable.rogers.com (InterMail vM.5.01.05.12 201-253-122-126-112-20020820) with ESMTP id <20040404205720.VLRH39251.fep02-mail.bloor.is.net.cable.rogers.com@panic> for ; Sun, 4 Apr 2004 16:57:20 -0400 From: "Shawn Starr" To: Subject: [BUG][2.6.5 final][e100] NETDEV_WATCHDOG Timeout - Was not a problem with 2.6.5-rc3 Date: Sun, 4 Apr 2004 16:58:35 -0400 Message-ID: <000201c41a87$98897970$0200080a@panic> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Authentication-Info: Submitted using SMTP AUTH LOGIN at fep02-mail.bloor.is.net.cable.rogers.com from [67.60.40.239] using ID at Sun, 4 Apr 2004 16:57:20 -0400 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i34KwfKO028434 X-archive-position: 4461 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: shawn.starr@rogers.com Precedence: bulk X-list: netdev Content-Length: 11339 Lines: 248 I've been told this sould be directed here :-) -----Original Message----- From: Shawn Starr [mailto:shawn.starr@rogers.com] Sent: Sunday, April 04, 2004 04:51 PM To: 'linux-kernel@vger.kernel.org' Subject: [BUG][2.6.5 final][e100] NETDEV_WATCHDOG Timeout - Was not a problem with 2.6.5-rc3 Dmesg: Linux version 2.6.5 (root@coredump) (gcc version 3.3.4 20040313 (prerelease)) #2 Sun Apr 4 04:18:23 EDT 2004 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009fc00 (usable) BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved) BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 0000000023ffd9c0 (usable) BIOS-e820: 0000000023ffd9c0 - 0000000024000000 (ACPI data) BIOS-e820: 00000000fec00000 - 00000000fec01000 (reserved) BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved) BIOS-e820: 00000000fffc0000 - 0000000100000000 (reserved) 575MB LOWMEM available. On node 0 totalpages: 147453 DMA zone: 4096 pages, LIFO batch:1 Normal zone: 143357 pages, LIFO batch:16 HighMem zone: 0 pages, LIFO batch:1 DMI 2.1 present. IBM machine detected. Enabling interrupts during APM calls. IBM machine detected. Disabling SMBus accesses. ACPI: RSDP (v000 IBM ) @ 0x000fdfe0 ACPI: RSDT (v001 IBM CDTPWSNV 0x00001010 IBM 0x00000000) @ 0x23ffff80 ACPI: FADT (v001 IBM CDTPWSNV 0x00001010 IBM 0x00000000) @ 0x23ffff00 ACPI: DSDT (v001 IBM CDTPWSNV 0x00001000 MSFT 0x01000007) @ 0x00000000 ACPI: PM-Timer IO Port: 0xfd08 Built 1 zonelists Kernel command line: BOOT_IMAGE=linux ro root=301 console=tty0 psmouse_rate=60 psmouse_resolution=200 nmi_watchdog=2 atkbd.softrepeat=1 Parameter psmouse_rate= is obsolete, ignored Parameter psmouse_resolution= is obsolete, ignored Local APIC disabled by BIOS -- reenabling. Found and enabled local APIC! Initializing CPU#0 PID hash table entries: 4096 (order 12: 32768 bytes) Detected 547.805 MHz processor. Using pmtmr for high-res timesource Console: colour VGA+ 80x25 Memory: 578720k/589812k available (2453k kernel code, 10304k reserved, 688k data, 364k init, 0k highmem) Checking if this processor honours the WP bit even in supervisor mode... Ok. Calibrating delay loop... 1085.44 BogoMIPS Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) CPU: After generic identify, caps: 0383fbff 00000000 00000000 00000000 CPU: After vendor identify, caps: 0383fbff 00000000 00000000 00000000 CPU: L1 I cache: 16K, L1 D cache: 16K CPU: L2 cache: 512K CPU: After all inits, caps: 0383fbf7 00000000 00000000 00000040 Intel machine check architecture supported. Intel machine check reporting enabled on CPU#0. CPU: Intel Pentium III (Katmai) stepping 03 Enabling fast FPU save and restore... done. Enabling unmasked SIMD FPU exception support... done. Checking 'hlt' instruction... OK. POSIX conformance testing by UNIFIX enabled ExtINT on CPU#0 ESR value before enabling vector: 00000000 ESR value after enabling vector: 00000000 testing NMI watchdog ... OK. Using local APIC timer interrupts. calibrating APIC timer ... ..... CPU clock speed is 547.0532 MHz. ..... host bus clock speed is 99.0551 MHz. NET: Registered protocol family 16 PCI: PCI BIOS revision 2.10 entry at 0xfd83c, last bus=1 PCI: Using configuration type 1 mtrr: v2.0 (20020519) ACPI: Subsystem revision 20040326 ACPI: IRQ9 SCI: Level Trigger. ACPI-0179: *** Warning: The ACPI AML in your computer contains errors, please nag the manufacturer to correct it. ACPI-0182: *** Warning: Allowing relaxed access to fields; turn on CONFIG_ACPI_DEBUG for details. ACPI: Interpreter enabled ACPI: Using PIC for interrupt routing ACPI: PCI Root Bridge [PCI0] (00:00) PCI: Probing PCI hardware (bus 00) ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT] ACPI: PCI Interrupt Link [PIN1] (IRQs 3 4 5 6 7 9 10 11 12 14 15) ACPI: PCI Interrupt Link [PIN2] (IRQs 3 4 *5 6 7 9 10 11 12 14 15) ACPI: PCI Interrupt Link [PIN3] (IRQs 3 4 5 6 7 *9 10 11 12 14 15) ACPI: PCI Interrupt Link [PIN4] (IRQs 3 4 5 6 7 9 10 *11 12 14 15) Linux Plug and Play Support v0.97 (c) Adam Belay pnp: the driver 'system' has been registered PnPBIOS: Scanning system for PnP BIOS support... PnPBIOS: Found PnP BIOS installation structure at 0xc00fde50 PnPBIOS: PnP BIOS version 1.0, entry 0xf0000:0x587a, dseg 0xf0000 pnp: match found with the PnP device '00:09' and the driver 'system' pnp: match found with the PnP device '00:0a' and the driver 'system' pnp: match found with the PnP device '00:0c' and the driver 'system' pnp: match found with the PnP device '00:0d' and the driver 'system' pnp: match found with the PnP device '00:0e' and the driver 'system' pnp: 00:0e: ioport range 0x370-0x371 has been reserved pnp: 00:0e: ioport range 0x4d0-0x4d1 has been reserved pnp: match found with the PnP device '00:0f' and the driver 'system' pnp: 00:0f: ioport range 0x290-0x297 has been reserved pnp: match found with the PnP device '00:10' and the driver 'system' pnp: 00:10: ioport range 0xfd00-0xfd3f has been reserved pnp: 00:10: ioport range 0xfe00-0xfe0f has been reserved pnp: match found with the PnP device '00:15' and the driver 'system' PnPBIOS: 21 nodes reported by PnP BIOS; 21 recorded by driver SCSI subsystem initialized drivers/usb/core/usb.c: registered new driver usbfs drivers/usb/core/usb.c: registered new driver hub ACPI: PCI Interrupt Link [PIN4] enabled at IRQ 11 ACPI: PCI Interrupt Link [PIN3] enabled at IRQ 9 ACPI: PCI Interrupt Link [PIN2] enabled at IRQ 5 PCI: Using ACPI for IRQ routing PCI: if you experience problems, try using option 'pci=noacpi' or even 'acpi=off' IA-32 Microcode Update Driver: v1.13 Limiting direct PCI/PCI transfers. ACPI: Power Button (FF) [PWRF] ACPI: Processor [CPU0] (supports C1) isapnp: Scanning for PnP cards... pnp: Calling quirk for 01:01.00 pnp: SB audio device quirk - increasing port range pnp: Calling quirk for 01:01.02 pnp: AWE32 quirk - adding two ports isapnp: Card 'Creative SB32 PnP' isapnp: Card 'U.S. Robotics Sportster 33600 FAX/Voice Int' isapnp: 2 Plug & Play cards detected total lp: driver loaded but no devices found Real Time Clock Driver v1.12 Hangcheck: starting hangcheck timer 0.5.0 (tick is 180 seconds, margin is 60 seconds). Serial: 8250/16550 driver $Revision: 1.90 $ 7 ports, IRQ sharing disabled ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A pnp: the driver 'serial' has been registered pnp: match found with the PnP device '00:12' and the driver 'serial' pnp: match found with the PnP device '00:13' and the driver 'serial' pnp: match found with the PnP device '01:02.00' and the driver 'serial' pnp: Unable to assign resources to device 01:02.00. serial: probe of 01:02.00 failed with error -16 pnp: the driver 'parport_pc' has been registered pnp: match found with the PnP device '00:14' and the driver 'parport_pc' parport: PnPBIOS parport detected. parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE,EPP] lp0: using parport0 (interrupt-driven). Using anticipatory io scheduler Floppy drive(s): fd0 is 1.44M FDC 0 is a post-1991 82077 e100: Intel(R) PRO/100 Network Driver, 3.0.17 e100: Copyright(c) 1999-2004 Intel Corporation e100: eth0: e100_probe: addr 0xf3cff000, irq 11, MAC addr 00:06:29:CE:07:04 e100: eth1: e100_probe: addr 0xf3dff000, irq 5, MAC addr 00:D0:B7:4E:F0:7D netconsole: not configured, aborting Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx PIIX4: IDE controller at PCI slot 0000:00:02.1 PIIX4: chipset revision 1 PIIX4: not 100%% native mode: will probe irqs later ide0: BM-DMA at 0xfff0-0xfff7, BIOS settings: hda:DMA, hdb:pio ide1: BM-DMA at 0xfff8-0xffff, BIOS settings: hdc:pio, hdd:pio hda: MAXTOR 6L040L2, ATA DISK drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 hdc: CRD-8400B, ATAPI CD/DVD-ROM drive hdc: Disabling (U)DMA for CRD-8400B (blacklisted) ide1 at 0x170-0x177,0x376 on irq 15 hda: max request size: 128KiB hda: 78177792 sectors (40027 MB) w/1819KiB Cache, CHS=65535/16/63, UDMA(33) hda: hda1 hda2 hdc: ATAPI 40X CD-ROM drive, 128kB Cache Uniform CD-ROM driver Revision: 3.20 scsi0 : Adaptec AIC7XXX EISA/VLB/PCI SCSI HBA DRIVER, Rev 6.2.36 aic7850: Single Channel A, SCSI Id=7, 3/253 SCBs Vendor: HP Model: T4000s Rev: 1.10 Type: Sequential-Access ANSI SCSI revision: 02 ohci_hcd: 2004 Feb 02 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI) ohci_hcd: block sizes: ed 64 td 64 USB Universal Host Controller Interface driver v2.2 PCI: Enabling device 0000:00:02.2 (0000 -> 0001) uhci_hcd 0000:00:02.2: Intel Corp. 82371AB/EB/MB PIIX4 USB uhci_hcd 0000:00:02.2: irq 11, io base 00001000 uhci_hcd 0000:00:02.2: new USB bus registered, assigned bus number 1 hub 1-0:1.0: USB hub found hub 1-0:1.0: 2 ports detected mice: PS/2 mouse device common for all mice input: PC Speaker serio: i8042 AUX port at 0x60,0x64 irq 12 input: ImExPS/2 Generic Explorer Mouse on isa0060/serio1 serio: i8042 KBD port at 0x60,0x64 irq 1 input: AT Translated Set 2 keyboard on isa0060/serio0 i2c /dev entries driver i2c-core: driver dev_driver registered. sb: Init: Starting Probe... pnp: the driver 'OSS SndBlstr' has been registered pnp: match found with the PnP device '01:01.00' and the driver 'OSS SndBlstr' pnp: Device 01:01.00 activated. sb: PnP: Found Card Named = "Creative SB32 PnP", Card PnP id = CTL0048, Device PnP id =CTL0031 sb: PnP: Detected at: io=0x220, irq=10, dma=1, dma16=5 at 0x220 irq 10 dma 1,5 sb: Turning on MPU at 0x300 irq 10 sb: Init: Done AWE32: Probing for WaveTable... pnp: the driver 'AWE32' has been registered pnp: match found with the PnP device '01:01.02' and the driver 'AWE32' pnp: Device 01:01.02 activated. AWE32: A PnP Wave Table was detected at IO's 0x620,0xa20,0xe20 .<6> NET: Registered protocol family 2 IP: routing cache hash table of 1024 buckets, 32Kbytes TCP: Hash tables configured (established 262144 bind 37449) NET: Registered protocol family 1 NET: Registered protocol family 17 kjournald starting. Commit interval 5 seconds EXT3-fs: mounted filesystem with ordered data mode. VFS: Mounted root (ext3 filesystem) readonly. Freeing unused kernel memory: 364k freed Adding 72284k swap on /dev/hda2. Priority:1 extents:1 EXT3 FS on hda1, internal journal e100: eth0: e100_watchdog: link up, 100Mbps, full-duplex e100: eth1: e100_watchdog: link up, 100Mbps, full-duplex When I try to access the eth0 device I get: Apr 4 15:39:01 coredump kernel: NETDEV WATCHDOG: eth0: transmit timed out Apr 4 16:22:12 coredump kernel: NETDEV WATCHDOG: eth0: transmit timed out And then the eth0 device stops responding to traffic until I shut down and cut power fo the machine by removing the power cable. Can someone confirm problems with the changes from 2.6.5-rc3 -> 2.6.5 final? Thanks Shawn. From bhartin@straus-frank.com Sun Apr 4 14:06:01 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 04 Apr 2004 14:06:02 -0700 (PDT) Received: from kkuy210.securesites.net (kkuy210.securesites.net [204.2.109.192]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i34L5xKO028987 for ; Sun, 4 Apr 2004 14:05:59 -0700 Received: from edp12 (209-99-2-226.sat.texas.net [209.99.2.226] (may be forged)) by kkuy210.securesites.net (8.12.6p3/8.12.6) with ESMTP id i34L5pkH016045; Sun, 4 Apr 2004 21:05:51 GMT (envelope-from bhartin@straus-frank.com) Date: Sun, 4 Apr 2004 16:05:39 -0500 (CDT) From: bhartin@straus-frank.com X-X-Sender: bhartin@edp12.straus-frank.int To: Francois Romieu cc: netdev@oss.sgi.com Subject: Re: r8169, 2.6.2-rc2, Sager 4780 laptop In-Reply-To: <20040126235559.A3832@electric-eye.fr.zoreil.com> Message-ID: References: <20040126235559.A3832@electric-eye.fr.zoreil.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 4462 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bhartin@straus-frank.com Precedence: bulk X-list: netdev Content-Length: 2669 Lines: 71 Francois: I don't remember if I ever did reply to you last time concerning this. Since I emailed you, I've tried many, many versions of the 2.6.x series kernels and superpatch variants. The only change was with today's release of 2.6.5. I now get the message "eth0: Too much work at interrupt!" prior to the interface locking up. I still have absolutely no problems with the 2.4.x kernels with respect to the networking (I have video/AGP issues with it though, but that's another story). Trying the same kernel with SMP and ACPI disabled: Rather than the interface locking up (the NIC failing to transmit or receive), the entire system locks up hard. All of these tests are done on a 100Mbit network, both on an unmanaged Linksys switch and on a Cisco 2948G, with the same results. The test is done by doing an scp to copy a remote file to the local filesystem. The lockups occur anywhere from 45MBytes to 95MBytes transferred. I haven't tried your latest set of patches because I haven't been able to find the URL for them again (I got carried away cleaning up my bookmarks recently). Let me know if there are any newer ones you'd like for me to try. Bradley Hartin - bhartin@straus-frank.com Communications and Network Administrator Straus-Frank Company Thanks, On Mon, 26 Jan 2004, Francois Romieu wrote: > bhartin@straus-frank.com : > [...] > > Attached is a tar.gz containing the outputs you request in your README, > > plus 'lspci -v' output and my .config for the kernel. This data was > > collected from a fresh 2.6.2-rc2 bootup, using your full set of 2.6.2-rc1 > > patches, manually doing a 'modprobe r8169' once booted up. The system is > > running a P4 with HT enabled, with an SMP kernel. > > There has been report of non-regression on non-SMP kernel with the following > patches applied (2.6.2-rc1 serie): > r8169-tx-index-overflow.patch > r8169-dma-api-tx.patch > r8169-dma-api-rx-buffers.patch > r8169-dma-api-tx-buffers.patch > r8169-rx_copybreak.patch > r8169-mac-phy-version.patch > r8169-init_one.patch > r8169-timer.patch > r8169-hw_start.patch > r8169-intr_mask.patch > r8169-suspend.patch > r8169-endianness.patch > r8169-getstats.patch > > Can you confirm that the driver behaves the same as the standard driver > with a non-SMP enabled kernel ? > > Does it make a difference if you give an 'acpi=off' option at boot time ? > > r8169-addr-high.patch is not doing its job on amd64 so it is not suggested > to use it at all. > > There is something broken wrt SMP and the r8169 patches: do not use both at > the same time. I still have to find what happens here. > > -- > Ueimor From romieu@fr.zoreil.com Sun Apr 4 15:21:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 04 Apr 2004 15:21:26 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i34MLNKO031398 for ; Sun, 4 Apr 2004 15:21: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 i34MKSgf008746; Mon, 5 Apr 2004 00:20:28 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i34MKSqw008745; Mon, 5 Apr 2004 00:20:28 +0200 Date: Mon, 5 Apr 2004 00:20:28 +0200 From: Francois Romieu To: bhartin@straus-frank.com Cc: netdev@oss.sgi.com Subject: Re: r8169, 2.6.2-rc2, Sager 4780 laptop Message-ID: <20040405002028.A8125@electric-eye.fr.zoreil.com> References: <20040126235559.A3832@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from bhartin@straus-frank.com on Sun, Apr 04, 2004 at 04:05:39PM -0500 X-Organisation: Land of Sunshine Inc. X-archive-position: 4463 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 504 Lines: 14 bhartin@straus-frank.com : [...] > I haven't tried your latest set of patches because I haven't been able to > find the URL for them again (I got carried away cleaning up my bookmarks > recently). Let me know if there are any newer ones you'd like for me to > try. http://www.fr.zoreil.com/people/francois/misc/20040329-2.6.5-rc2-r8169.c-test.patch It removes a possible loop in the Tx irq handler and should save some cpu cycles as well. Apply against 2.6.5. -- Ueimor From harisri@bigpond.com Sun Apr 4 16:43:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 04 Apr 2004 16:43:17 -0700 (PDT) Received: from mta04ps.bigpond.com (mta04ps.bigpond.com [144.135.25.158]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i34NhEKO003928 for ; Sun, 4 Apr 2004 16:43:15 -0700 Received: from lerc-daemon.mta04ps.email.bigpond.com by mta04ps.email.bigpond.com (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) id <0HVO00L2W70T0W@mta04ps.email.bigpond.com> for netdev@oss.sgi.com; Mon, 05 Apr 2004 09:38:53 +1000 (EST) Received: from email.bigpond.com ([172.26.103.15]) by mta04ps.email.bigpond.com (iPlanet Messaging Server 5.2 HotFix 1.14 (built Mar 18 2003)) with ESMTP id <0HVO00CLI70MZ0@mta04ps.email.bigpond.com>; Mon, 05 Apr 2004 09:38:46 +1000 (EST) Received: from [192.168.115.141] by mailms6aps.email.bigpond.com (mshttpd) ; Mon, 05 Apr 2004 09:38:46 +1000 Date: Mon, 05 Apr 2004 09:38:46 +1000 From: Srihari Vijayaraghavan Subject: Re: [patch] 2.6.5-rc2 - r8169 DAC To: romieu@fr.zoreil.com Cc: jgarzik@pobox.com, netdev@oss.sgi.com, ak@suse.de Message-id: <253ea2a8f4.2a8f4253ea@email.bigpond.com> MIME-version: 1.0 X-Mailer: iPlanet Messenger Express 5.2 HotFix 1.14 (built Oct 29 2003) Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7BIT Content-disposition: inline X-Accept-Language: en Priority: normal X-archive-position: 4464 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: harisri@telstra.com Precedence: bulk X-list: netdev Content-Length: 784 Lines: 22 Hello Francois, > DMA_{32/64}BIT_MASK for all. > > > include/linux/dma-mapping.h | 3 +++ > 1 files changed, 3 insertions(+) > > diff -puN include/linux/dma-mapping.h~r8169-dac-00 > include/linux/dma-mapping.h With that patch 2.6.5-rc2 + r8169 DAC compiles and works fine. There is one problem however: If I unplug and plug the cable it does not come back to online (even the LED on the card does not glow). I did not try reloading the driver, but a reboot does fix it :-( (later today I shall try reloading the driver). OTOH the vanilla 2.6.5-rc2 (or rc3) does not show this behaviour. As for as the stability, I have stress tested it for couple of hours and it seems to work just fine. Thanks Hari From bhartin@straus-frank.com Sun Apr 4 16:57:37 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 04 Apr 2004 16:57:39 -0700 (PDT) Received: from kkuy210.securesites.net (kkuy210.securesites.net [204.2.109.192]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i34NvaKO004888 for ; Sun, 4 Apr 2004 16:57:37 -0700 Received: from edp12 (209-99-2-226.sat.texas.net [209.99.2.226] (may be forged)) by kkuy210.securesites.net (8.12.6p3/8.12.6) with ESMTP id i34NvYkH050911; Sun, 4 Apr 2004 23:57:34 GMT (envelope-from bhartin@straus-frank.com) Date: Sun, 4 Apr 2004 18:57:20 -0500 (CDT) From: bhartin@straus-frank.com X-X-Sender: bhartin@edp12.straus-frank.int To: Francois Romieu cc: netdev@oss.sgi.com Subject: Re: r8169, 2.6.2-rc2, Sager 4780 laptop In-Reply-To: <20040405002028.A8125@electric-eye.fr.zoreil.com> Message-ID: References: <20040126235559.A3832@electric-eye.fr.zoreil.com> <20040405002028.A8125@electric-eye.fr.zoreil.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 4465 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bhartin@straus-frank.com Precedence: bulk X-list: netdev Content-Length: 1383 Lines: 43 Here are the results using this new patch: No SMP, no ACPI: Appears to work well--transferred about 8 gigs okay With SMP, with ACPI: Interface locks up after a few MB With SMP, no ACPI: Interface locks up after a few MB No SMP, with ACPI: Appears to work well--transferred about 8 gigs okay My laptop is *finally* reaching full usability! Thanks! I can live without SMP--this is just a single P4/HT, so I'm not losing much. Thanks again. If there is any debugging info you need towards fixing the SMP compatibility issue, just let me know, but I'm not in a hurry for it. Bradley Hartin - bhartin@straus-frank.com Communications and Network Administrator Straus-Frank Company Thanks, On Mon, 5 Apr 2004, Francois Romieu wrote: > bhartin@straus-frank.com : > [...] > > I haven't tried your latest set of patches because I haven't been able to > > find the URL for them again (I got carried away cleaning up my bookmarks > > recently). Let me know if there are any newer ones you'd like for me to > > try. > > http://www.fr.zoreil.com/people/francois/misc/20040329-2.6.5-rc2-r8169.c-test.patch > > It removes a possible loop in the Tx irq handler and should save some cpu > cycles as well. Apply against 2.6.5. > > -- > Ueimor > Bradley Hartin - bhartin@straus-frank.com Communications and Network Administrator Straus-Frank Company From rddunlap@osdl.org Sun Apr 4 20:10:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Sun, 04 Apr 2004 20:10:32 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i353ALKO010466 for ; Sun, 4 Apr 2004 20:10:22 -0700 Received: from midway.verizon.net (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i353AE210825; Sun, 4 Apr 2004 20:10:15 -0700 Date: Sun, 4 Apr 2004 20:03:54 -0700 From: "Randy.Dunlap" To: netdev@oss.sgi.com Cc: davem@redhat.com, benh@kernel.crashing.org Subject: [PATCH] update networking config menu (v3) Message-Id: <20040404200354.50e5dd74.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.8a (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: 4466 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 11339 Lines: 359 Hi, This is a modified version of the patch that I posted about 3 weeks ago. It no longer puts "Networking support" in the top-level menu because it makes more sense to me to keep it close to the Network drivers and other protocols, so basically this patch mostly moves some menu items around to have a better logical grouping (IMO of course). Comments/suggestions? Thanks, -- ~Randy // linux-2.6.5 // Networking support/options and Networking drivers have been, uhm, // messy to navigate for some time now. BenH mentioned this // and I was already looking into options to clean it up. // This is a cleanup of Networking support/options and Networking Drivers. // It presents a more consistent interface and lists similar driver // groups and protocol groups closer together. // It also moves the IBMVETH driver so that it no longer breaks the // dependency tree, allowing other drivers (nearby in Kconfig file) // to be presented in a more linear manner. diffstat:= drivers/net/Kconfig | 53 ++++++++++----------- net/Kconfig | 123 +++++++++++++++++++++++++------------------------- net/ax25/Kconfig | 7 -- net/bluetooth/Kconfig | 6 -- net/irda/Kconfig | 8 --- 5 files changed, 93 insertions(+), 104 deletions(-) diff -Naurp ./drivers/net/Kconfig.orig ./drivers/net/Kconfig --- ./drivers/net/Kconfig.orig 2004-04-03 19:38:10.000000000 -0800 +++ ./drivers/net/Kconfig 2004-04-04 17:31:22.000000000 -0700 @@ -21,10 +21,6 @@ config NETDEVICES If unsure, say Y. -if NETDEVICES - source "drivers/net/arcnet/Kconfig" -endif - config DUMMY tristate "Dummy net driver support" depends on NETDEVICES @@ -155,6 +151,10 @@ config NET_SB1000 If you don't have this card, of course say N. +if NETDEVICES + source "drivers/net/arcnet/Kconfig" +endif + # # Ethernet # @@ -1178,6 +1178,17 @@ config IBMLANA boards with this driver should be possible, but has not been tested up to now due to lack of hardware. +config IBMVETH + tristate "IBM LAN Virtual Ethernet support" + depends on NETDEVICES && NET_ETHERNET && PPC_PSERIES + ---help--- + This driver supports virtual ethernet adapters on newer IBM iSeries + and pSeries systems. + + To compile this driver as a module, choose M here and read + . The module will + be called ibmveth. + config NET_PCI bool "EISA, VLB, PCI and on board controllers" depends on NET_ETHERNET && (ISA || EISA || PCI) @@ -2103,6 +2114,17 @@ config IXGB_NAPI endmenu +source "drivers/net/tokenring/Kconfig" + +source "drivers/net/wireless/Kconfig" + +source "drivers/net/pcmcia/Kconfig" + +source "drivers/net/wan/Kconfig" + +source "drivers/atm/Kconfig" + +source "drivers/s390/net/Kconfig" config VETH tristate "iSeries Virtual Ethernet driver support" @@ -2170,17 +2192,6 @@ config HIPPI under Linux, say Y here (you must also remember to enable the driver for your HIPPI card below). Most people will say N here. -config IBMVETH - tristate "IBM LAN Virtual Ethernet support" - depends on NETDEVICES && NET_ETHERNET && PPC_PSERIES - ---help--- - This driver supports virtual ethernet adapters on newer IBM iSeries - and pSeries systems. - - To compile this driver as a module, choose M here and read - . The module will - be called ibmveth. - config ROADRUNNER tristate "Essential RoadRunner HIPPI PCI adapter support (EXPERIMENTAL)" depends on HIPPI && PCI @@ -2438,10 +2449,6 @@ config SLIP_MODE_SLIP6 end of the link as well. It's good enough, for example, to run IP over the async ports of a Camtec JNT Pad. If unsure, say N. -source "drivers/net/wireless/Kconfig" - -source "drivers/net/tokenring/Kconfig" - config NET_FC bool "Fibre Channel driver support" depends on NETDEVICES && SCSI && PCI @@ -2501,11 +2508,3 @@ config NETCONSOLE ---help--- If you want to log kernel messages over the network, enable this. See Documentation/networking/netconsole.txt for details. - -source "drivers/net/wan/Kconfig" - -source "drivers/net/pcmcia/Kconfig" - -source "drivers/atm/Kconfig" - -source "drivers/s390/net/Kconfig" diff -Naurp ./net/bluetooth/Kconfig.orig ./net/bluetooth/Kconfig --- ./net/bluetooth/Kconfig.orig 2004-04-03 19:38:12.000000000 -0800 +++ ./net/bluetooth/Kconfig 2004-04-03 22:30:19.000000000 -0800 @@ -2,10 +2,8 @@ # Bluetooth subsystem configuration # -menu "Bluetooth support" +menuconfig BT depends on NET - -config BT tristate "Bluetooth subsystem support" help Bluetooth is low-cost, low-power, short-range wireless technology. @@ -62,5 +60,3 @@ source "net/bluetooth/cmtp/Kconfig" source "drivers/bluetooth/Kconfig" -endmenu - diff -Naurp ./net/irda/Kconfig.orig ./net/irda/Kconfig --- ./net/irda/Kconfig.orig 2004-04-03 19:37:07.000000000 -0800 +++ ./net/irda/Kconfig 2004-04-03 22:30:19.000000000 -0800 @@ -2,11 +2,9 @@ # IrDA protocol configuration # -menu "IrDA (infrared) support" +menuconfig IRDA depends on NET - -config IRDA - tristate "IrDA subsystem support" + tristate "IrDA (infrared) subsystem support" ---help--- Say Y here if you want to build support for the IrDA (TM) protocols. The Infrared Data Associations (tm) specifies standards for wireless @@ -95,5 +93,3 @@ config IRDA_DEBUG source "drivers/net/irda/Kconfig" -endmenu - diff -Naurp ./net/ax25/Kconfig.orig ./net/ax25/Kconfig --- ./net/ax25/Kconfig.orig 2004-04-03 19:38:13.000000000 -0800 +++ ./net/ax25/Kconfig 2004-04-03 22:30:19.000000000 -0800 @@ -6,9 +6,8 @@ # Joerg Reuter DL1BKE # 19980129 Moved to net/ax25/Config.in, sourcing device drivers. -menu "Amateur Radio support" - -config HAMRADIO +menuconfig HAMRADIO + depends on NET bool "Amateur Radio support" help If you want to connect your Linux box to an amateur radio, answer Y @@ -109,5 +108,3 @@ source "drivers/net/hamradio/Kconfig" endmenu -endmenu - diff -Naurp ./net/Kconfig.orig ./net/Kconfig --- ./net/Kconfig.orig 2004-04-03 19:36:16.000000000 -0800 +++ ./net/Kconfig 2004-04-04 19:44:42.000000000 -0700 @@ -129,59 +129,6 @@ config IPV6 source "net/ipv6/Kconfig" -config DECNET - tristate "DECnet Support" - ---help--- - The DECnet networking protocol was used in many products made by - Digital (now Compaq). It provides reliable stream and sequenced - packet communications over which run a variety of services similar - to those which run over TCP/IP. - - To find some tools to use with the kernel layer support, please - look at Patrick Caulfield's web site: - . - - More detailed documentation is available in - . - - Be sure to say Y to "/proc file system support" and "Sysctl support" - below when using DECnet, since you will need sysctl support to aid - in configuration at run time. - - The DECnet code is also available as a module ( = code which can be - inserted in and removed from the running kernel whenever you want). - The module is called decnet. - -source "net/decnet/Kconfig" - -config BRIDGE - tristate "802.1d Ethernet Bridging" - ---help--- - If you say Y here, then your Linux box will be able to act as an - Ethernet bridge, which means that the different Ethernet segments it - is connected to will appear as one Ethernet to the participants. - Several such bridges can work together to create even larger - networks of Ethernets using the IEEE 802.1 spanning tree algorithm. - As this is a standard, Linux bridges will cooperate properly with - other third party bridge products. - - In order to use the Ethernet bridge, you'll need the bridge - configuration tools; see - for location. Please read the Bridge mini-HOWTO for more - information. - - If you enable iptables support along with the bridge support then you - turn your bridge into a bridging IP firewall. - iptables will then see the IP packets being bridged, so you need to - take this into account when setting up your firewall rules. - Enabling arptables support when bridging will let arptables see - bridged ARP traffic in the arptables FORWARD chain. - - To compile this code as a module, choose M here: the module - will be called bridge. - - If unsure, say N. - menuconfig NETFILTER bool "Network packet filtering (replaces ipchains)" ---help--- @@ -345,9 +292,62 @@ config ATM_BR2684_IPFILTER large number of IP-only vcc's. Do not enable this unless you are sure you know what you are doing. +config BRIDGE + tristate "802.1d Ethernet Bridging" + ---help--- + If you say Y here, then your Linux box will be able to act as an + Ethernet bridge, which means that the different Ethernet segments it + is connected to will appear as one Ethernet to the participants. + Several such bridges can work together to create even larger + networks of Ethernets using the IEEE 802.1 spanning tree algorithm. + As this is a standard, Linux bridges will cooperate properly with + other third party bridge products. + + In order to use the Ethernet bridge, you'll need the bridge + configuration tools; see + for location. Please read the Bridge mini-HOWTO for more + information. + + If you enable iptables support along with the bridge support then you + turn your bridge into a bridging IP firewall. + iptables will then see the IP packets being bridged, so you need to + take this into account when setting up your firewall rules. + Enabling arptables support when bridging will let arptables see + bridged ARP traffic in the arptables FORWARD chain. + + To compile this code as a module, choose M here: the module + will be called bridge. + + If unsure, say N. + config VLAN_8021Q tristate "802.1Q VLAN Support" +config DECNET + tristate "DECnet Support" + ---help--- + The DECnet networking protocol was used in many products made by + Digital (now Compaq). It provides reliable stream and sequenced + packet communications over which run a variety of services similar + to those which run over TCP/IP. + + To find some tools to use with the kernel layer support, please + look at Patrick Caulfield's web site: + . + + More detailed documentation is available in + . + + Be sure to say Y to "/proc file system support" and "Sysctl support" + below when using DECnet, since you will need sysctl support to aid + in configuration at run time. + + The DECnet code is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module is called decnet. + +source "net/decnet/Kconfig" + source "net/llc/Kconfig" config IPX @@ -650,14 +650,6 @@ endmenu endmenu -source "drivers/net/Kconfig" - -source "net/ax25/Kconfig" - -source "net/irda/Kconfig" - -source "net/bluetooth/Kconfig" - config NETPOLL def_bool NETCONSOLE @@ -674,4 +666,13 @@ config NETPOLL_TRAP config NET_POLL_CONTROLLER def_bool NETPOLL +source "net/ax25/Kconfig" + +source "net/irda/Kconfig" + +source "net/bluetooth/Kconfig" + +source "drivers/net/Kconfig" + endmenu + From kazunori@miyazawa.org Mon Apr 5 00:09:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 00:11:32 -0700 (PDT) Received: from miyazawa.org (usen-221x116x13x66.ap-US01.usen.ad.jp [221.116.13.66]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i3579uKO021698 for ; Mon, 5 Apr 2004 00:09:57 -0700 Received: from 2001:200:1b0:2032:20c:29ff:febb:6598 ([2001:200:1b0:2032:20c:29ff:febb:6598]) (AUTH: PLAIN kazunori, SSL: TLSv1/SSLv3,128bits,RC4-MD5) by miyazawa.org with esmtp; Mon, 05 Apr 2004 16:03:34 +0900 From: Kazunori Miyazawa To: netdev@oss.sgi.com Subject: [PATCH 2.6][IPSEC] conforming to rfc2406 Date: Mon, 5 Apr 2004 15:38:35 +0900 User-Agent: KMail/1.5.4 Cc: kazunori@miyazawa.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200404051538.35608.kazunori@miyazawa.org> X-archive-position: 4467 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kazunori@miyazawa.org Precedence: bulk X-list: netdev Content-Length: 8253 Lines: 311 Hello, I send patches to make 2.6 IPsec conform to rfc2406. In section 3.4.3, RFC saids All ESP implementations MUST support the anti-replay service, though its use may be enabled or disabled by the receiver on a per-SA basis. This service MUST NOT be enabled unless the authentication service also is enabled for the SA, since otherwise the Sequence Number field has not been integrity protected. Original code checks sequence number unless integrity check. I moved sequence number checking and advancing from xfrm[46]_input.c to each ah[64].c and esp[64].c. Best regards, --Kazunori Miyazawa ===== include/net/xfrm.h 1.54 vs edited ===== --- 1.54/include/net/xfrm.h Sat Mar 20 12:35:32 2004 +++ edited/include/net/xfrm.h Mon Apr 5 12:24:10 2004 @@ -869,7 +869,7 @@ extern void km_policy_expired(struct xfrm_policy *pol, int dir, int hard); extern void xfrm_input_init(void); -extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi, u32 *seq); +extern int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi); extern void xfrm_probe_algs(void); extern int xfrm_count_auth_supported(void); ===== net/ipv4/ah4.c 1.29 vs edited ===== --- 1.29/net/ipv4/ah4.c Sun Jan 25 03:08:48 2004 +++ edited/net/ipv4/ah4.c Mon Apr 5 12:11:32 2004 @@ -166,6 +166,8 @@ goto out; ah = (struct ip_auth_hdr*)skb->data; + if (x->props.replay_window && xfrm_replay_check(x, ah->seq_no)) + goto out; ahp = x->data; ah_hlen = (ah->hdrlen + 2) << 2; @@ -209,6 +211,8 @@ goto out; } } + if (x->props.replay_window) + xfrm_replay_advance(x, ah->seq_no); ((struct iphdr*)work_buf)->protocol = ah->nexthdr; skb->nh.raw = skb_pull(skb, ah_hlen); memcpy(skb->nh.raw, work_buf, iph->ihl*4); ===== net/ipv4/esp4.c 1.36 vs edited ===== --- 1.36/net/ipv4/esp4.c Wed Mar 10 08:21:50 2004 +++ edited/net/ipv4/esp4.c Mon Apr 5 12:14:10 2004 @@ -227,6 +227,7 @@ if (!pskb_may_pull(skb, sizeof(struct ip_esp_hdr))) goto out; + esph = (struct ip_esp_hdr*)skb->data; if (elen <= 0 || (elen & (blksize-1))) goto out; @@ -236,6 +237,8 @@ u8 sum[esp->auth.icv_full_len]; u8 sum1[alen]; + if (x->props.replay_window && xfrm_replay_check(x, esp->seq_no)) + goto out; esp->auth.icv(esp, skb, 0, skb->len-alen, sum); if (skb_copy_bits(skb, skb->len-alen, sum1, alen)) @@ -245,6 +248,9 @@ x->stats.integrity_failed++; goto out; } + + if (x->props.replay_winodw) + xfrm_replay_advance(x, esph->seq_no); } if ((nfrags = skb_cow_data(skb, 0, &trailer)) < 0) @@ -252,7 +258,6 @@ skb->ip_summed = CHECKSUM_NONE; - esph = (struct ip_esp_hdr*)skb->data; iph = skb->nh.iph; /* Get ivec. This can be wrong, check against another impls. */ ===== net/ipv4/xfrm4_input.c 1.10 vs edited ===== --- 1.10/net/ipv4/xfrm4_input.c Sat Feb 14 16:06:45 2004 +++ edited/net/ipv4/xfrm4_input.c Mon Apr 5 12:15:31 2004 @@ -29,30 +29,29 @@ IP_ECN_set_ce(inner_iph); } -static int xfrm4_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi, u32 *seq) +static int xfrm4_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi) { switch (nexthdr) { case IPPROTO_IPIP: if (!pskb_may_pull(skb, sizeof(struct iphdr))) return -EINVAL; *spi = skb->nh.iph->saddr; - *seq = 0; return 0; } - return xfrm_parse_spi(skb, nexthdr, spi, seq); + return xfrm_parse_spi(skb, nexthdr, spi); } int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type) { int err; - u32 spi, seq; + u32 spi; struct sec_decap_state xfrm_vec[XFRM_MAX_DEPTH]; struct xfrm_state *x; int xfrm_nr = 0; int decaps = 0; - if ((err = xfrm4_parse_spi(skb, skb->nh.iph->protocol, &spi, &seq)) != 0) + if ((err = xfrm4_parse_spi(skb, skb->nh.iph->protocol, &spi)) != 0) goto drop; do { @@ -69,9 +68,6 @@ if (unlikely(x->km.state != XFRM_STATE_VALID)) goto drop_unlock; - if (x->props.replay_window && xfrm_replay_check(x, seq)) - goto drop_unlock; - if (xfrm_state_check_expire(x)) goto drop_unlock; @@ -82,9 +78,6 @@ /* only the first xfrm gets the encap type */ encap_type = 0; - if (x->props.replay_window) - xfrm_replay_advance(x, seq); - x->curlft.bytes += skb->len; x->curlft.packets++; @@ -112,7 +105,7 @@ break; } - if ((err = xfrm_parse_spi(skb, skb->nh.iph->protocol, &spi, &seq)) < 0) + if ((err = xfrm_parse_spi(skb, skb->nh.iph->protocol, &spi)) < 0) goto drop; } while (!err); ===== net/ipv6/ah6.c 1.26 vs edited ===== --- 1.26/net/ipv6/ah6.c Sun Jan 25 03:08:48 2004 +++ edited/net/ipv6/ah6.c Mon Apr 5 12:21:22 2004 @@ -286,6 +286,8 @@ hdr_len = skb->data - skb->nh.raw; cleared_hlen = hdr_len; ah = (struct ipv6_auth_hdr*)skb->data; + if (x->props.replay_window && xfrm_replay_check(x, ah->seq_no)) + goto out; ahp = x->data; nexthdr = ah->nexthdr; ah_hlen = (ah->hdrlen + 2) << 2; @@ -329,6 +331,8 @@ } } + if (x->props.replay_window) + xfrm_replay_advance(x, ah->seq_no); skb->nh.raw = skb_pull(skb, ah_hlen); memcpy(skb->nh.raw, tmp_hdr, hdr_len); if (nexthdr == NEXTHDR_DEST) { ===== net/ipv6/esp6.c 1.24 vs edited ===== --- 1.24/net/ipv6/esp6.c Wed Mar 10 08:21:50 2004 +++ edited/net/ipv6/esp6.c Mon Apr 5 12:22:39 2004 @@ -210,6 +210,7 @@ ret = -EINVAL; goto out_nofree; } + esph = (struct ipv6_esp_hdr*)skb->data; if (elen <= 0 || (elen & (blksize-1))) { ret = -EINVAL; @@ -228,6 +229,10 @@ u8 sum[esp->auth.icv_full_len]; u8 sum1[alen]; + if (x->props.replay_window && xfrm_replay_check(x, esph->seq_no)) { + ret = -EINVAL; + goto out; + } esp->auth.icv(esp, skb, 0, skb->len-alen, sum); if (skb_copy_bits(skb, skb->len-alen, sum1, alen)) @@ -238,6 +243,9 @@ ret = -EINVAL; goto out; } + + if (x->props.replay_window) + xfrm_replay_advance(x, esph->seq_no); } if ((nfrags = skb_cow_data(skb, 0, &trailer)) < 0) { @@ -247,7 +255,6 @@ skb->ip_summed = CHECKSUM_NONE; - esph = (struct ipv6_esp_hdr*)skb->data; iph = skb->nh.ipv6h; /* Get ivec. This can be wrong, check against another impls. */ ===== net/ipv6/xfrm6_input.c 1.15 vs edited ===== --- 1.15/net/ipv6/xfrm6_input.c Sat Feb 14 16:06:45 2004 +++ edited/net/ipv6/xfrm6_input.c Mon Apr 5 12:23:15 2004 @@ -29,7 +29,7 @@ { struct sk_buff *skb = *pskb; int err; - u32 spi, seq; + u32 spi; struct sec_decap_state xfrm_vec[XFRM_MAX_DEPTH]; struct xfrm_state *x; int xfrm_nr = 0; @@ -41,7 +41,7 @@ nexthdr = *prevhdr; *nhoffp = prevhdr - skb->nh.raw; - if ((err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) != 0) + if ((err = xfrm_parse_spi(skb, nexthdr, &spi)) != 0) goto drop; do { @@ -57,9 +57,6 @@ if (unlikely(x->km.state != XFRM_STATE_VALID)) goto drop_unlock; - if (x->props.replay_window && xfrm_replay_check(x, seq)) - goto drop_unlock; - if (xfrm_state_check_expire(x)) goto drop_unlock; @@ -67,9 +64,6 @@ if (nexthdr <= 0) goto drop_unlock; - if (x->props.replay_window) - xfrm_replay_advance(x, seq); - x->curlft.bytes += skb->len; x->curlft.packets++; @@ -94,7 +88,7 @@ break; } - if ((err = xfrm_parse_spi(skb, nexthdr, &spi, &seq)) < 0) + if ((err = xfrm_parse_spi(skb, nexthdr, &spi)) < 0) goto drop; } while (!err); ===== net/xfrm/xfrm_input.c 1.13 vs edited ===== --- 1.13/net/xfrm/xfrm_input.c Mon Jul 28 11:22:27 2003 +++ edited/net/xfrm/xfrm_input.c Mon Apr 5 12:20:23 2004 @@ -43,24 +43,21 @@ /* Fetch spi and seq from ipsec header */ -int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi, u32 *seq) +int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi) { - int offset, offset_seq; + int offset; switch (nexthdr) { case IPPROTO_AH: offset = offsetof(struct ip_auth_hdr, spi); - offset_seq = offsetof(struct ip_auth_hdr, seq_no); break; case IPPROTO_ESP: offset = offsetof(struct ip_esp_hdr, spi); - offset_seq = offsetof(struct ip_esp_hdr, seq_no); break; case IPPROTO_COMP: if (!pskb_may_pull(skb, sizeof(struct ip_comp_hdr))) return -EINVAL; *spi = ntohl(ntohs(*(u16*)(skb->h.raw + 2))); - *seq = 0; return 0; default: return 1; @@ -70,7 +67,6 @@ return -EINVAL; *spi = *(u32*)(skb->h.raw + offset); - *seq = *(u32*)(skb->h.raw + offset_seq); return 0; } From marco.fais@abbeynet.it Mon Apr 5 03:47:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 03:47:53 -0700 (PDT) Received: from abbeynet.it ([151.39.82.11]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35AllKO008753 for ; Mon, 5 Apr 2004 03:47:48 -0700 Received: (qmail 19775 invoked from network); 5 Apr 2004 10:47:41 -0000 Received: from localhost (HELO localhost.localdomain) (127.0.0.1) by 0 with SMTP; 5 Apr 2004 10:47:41 -0000 Received: from abbeynet.it (localhost.localdomain [127.0.0.1]) by localhost.localdomain (VaMailArmor-2.0.1.16) id 19755-2565FFF6; Mon, 05 Apr 2004 12:47:39 +0200 Received: (qmail 19748 invoked from network); 5 Apr 2004 10:47:38 -0000 Received: from neutrix.localnet (HELO abbeynet.it) (192.168.0.205) by 0 with SMTP; 5 Apr 2004 10:47:38 -0000 Message-ID: <4071394A.1060007@abbeynet.it> Date: Mon, 05 Apr 2004 12:47:38 +0200 From: Marco Fais User-Agent: Mozilla/5.0 (X11; U; Linux i686; it-IT; rv:1.4.2) Gecko/20040308 X-Accept-Language: it, en, en-us MIME-Version: 1.0 To: Andrew Morton CC: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: kernel BUG at page_alloc.c:98 -- compiling with distcc References: <406D3E8F.20902@abbeynet.it> <20040402153628.4a09d979.akpm@osdl.org> In-Reply-To: <20040402153628.4a09d979.akpm@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiVirus: checked by Vexira MailArmor (version: 2.0.1.16; VAE: 6.24.0.7; VDF: 6.24.0.85; host: abbeynet.it) X-archive-position: 4468 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: marco.fais@abbeynet.it Precedence: bulk X-list: netdev Content-Length: 638 Lines: 23 Andrew Morton ha scritto: >>kernel BUG at page_alloc.c:98! > uh-oh. That was the same thing that I've said when I saw all the leds blinking in *all* the keyboards ... :) > distcc uses sendfile(). The 8139too hardware and driver are > zerocopy-capable so the kernel uses zerocopy direct-from-user-pages for > sendfile(). Ok. Other servers with e100 driver doesn't show the problem. This means that they're not "zerocopy-capable"? > This was all discussed fairly extensively a couple of years back and I > thought it ended up being fixed. There are any workarounds for this, until the problem is corrected? Thank you very much. From akpm@osdl.org Mon Apr 5 03:56:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 03:56:25 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35AuOKO009274 for ; Mon, 5 Apr 2004 03:56:24 -0700 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id i35AuD203059; Mon, 5 Apr 2004 03:56:13 -0700 Date: Mon, 5 Apr 2004 03:56:06 -0700 From: Andrew Morton To: Marco Fais Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: kernel BUG at page_alloc.c:98 -- compiling with distcc Message-Id: <20040405035606.0b470efb.akpm@osdl.org> In-Reply-To: <4071394A.1060007@abbeynet.it> References: <406D3E8F.20902@abbeynet.it> <20040402153628.4a09d979.akpm@osdl.org> <4071394A.1060007@abbeynet.it> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4469 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: akpm@osdl.org Precedence: bulk X-list: netdev Content-Length: 1205 Lines: 38 Marco Fais wrote: > > Andrew Morton ha scritto: > > >>kernel BUG at page_alloc.c:98! > > uh-oh. > > That was the same thing that I've said when I saw all the leds blinking > in *all* the keyboards ... :) > > > distcc uses sendfile(). The 8139too hardware and driver are > > zerocopy-capable so the kernel uses zerocopy direct-from-user-pages for > > sendfile(). > > Ok. Other servers with e100 driver doesn't show the problem. This means > that they're not "zerocopy-capable"? They are. It could be a timing thing. > > This was all discussed fairly extensively a couple of years back and I > > thought it ended up being fixed. > > There are any workarounds for this, until the problem is corrected? This will probably make it go away. --- linux-2.4.26-rc1/drivers/net/8139too.c 2004-03-27 22:06:18.000000000 -0800 +++ 24/drivers/net/8139too.c 2004-04-05 03:54:50.478692968 -0700 @@ -983,7 +983,7 @@ static int __devinit rtl8139_init_one (s * through the use of skb_copy_and_csum_dev we enable these * features */ - dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA; + dev->features |= NETIF_F_SG | NETIF_F_HIGHDMA; dev->irq = pdev->irq; From marco.fais@abbeynet.it Mon Apr 5 06:58:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 06:58:36 -0700 (PDT) Received: from abbeynet.it ([151.39.82.11]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35DwUKO018903 for ; Mon, 5 Apr 2004 06:58:33 -0700 Received: (qmail 13553 invoked from network); 5 Apr 2004 13:58:24 -0000 Received: from localhost (HELO localhost.localdomain) (127.0.0.1) by 0 with SMTP; 5 Apr 2004 13:58:24 -0000 Received: from abbeynet.it (localhost.localdomain [127.0.0.1]) by localhost.localdomain (VaMailArmor-2.0.1.16) id 13534-7D6B87E5; Mon, 05 Apr 2004 15:58:23 +0200 Received: (qmail 13528 invoked from network); 5 Apr 2004 13:58:23 -0000 Received: from neutrix.localnet (HELO abbeynet.it) (192.168.0.205) by 0 with SMTP; 5 Apr 2004 13:58:23 -0000 Message-ID: <407165FF.903@abbeynet.it> Date: Mon, 05 Apr 2004 15:58:23 +0200 From: Marco Fais User-Agent: Mozilla/5.0 (X11; U; Linux i686; it-IT; rv:1.4.2) Gecko/20040308 X-Accept-Language: it, en, en-us MIME-Version: 1.0 To: Andrew Morton CC: linux-kernel@vger.kernel.org, netdev@oss.sgi.com Subject: Re: kernel BUG at page_alloc.c:98 -- compiling with distcc References: <406D3E8F.20902@abbeynet.it> <20040402153628.4a09d979.akpm@osdl.org> <4071394A.1060007@abbeynet.it> <20040405035606.0b470efb.akpm@osdl.org> In-Reply-To: <20040405035606.0b470efb.akpm@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiVirus: checked by Vexira MailArmor (version: 2.0.1.16; VAE: 6.24.0.7; VDF: 6.24.0.86; host: abbeynet.it) X-archive-position: 4470 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: marco.fais@abbeynet.it Precedence: bulk X-list: netdev Content-Length: 921 Lines: 27 Hola Andrew! Andrew Morton ha scritto: >>There are any workarounds for this, until the problem is corrected? > This will probably make it go away. > > --- linux-2.4.26-rc1/drivers/net/8139too.c 2004-03-27 22:06:18.000000000 -0800 > +++ 24/drivers/net/8139too.c 2004-04-05 03:54:50.478692968 -0700 > @@ -983,7 +983,7 @@ static int __devinit rtl8139_init_one (s > * through the use of skb_copy_and_csum_dev we enable these > * features > */ > - dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA; > + dev->features |= NETIF_F_SG | NETIF_F_HIGHDMA; > > dev->irq = pdev->irq; Unfortunately, this doesn't solve the problem. Seems that the panic it's triggered a little later (1-2 minutes instead of a few seconds), but anyway I have a kernel panic every time, also with this patch. The oops tracing looks very similar to the one I've posted on the linux-kernel list. Thank you Andrew, bye! From okir@suse.de Mon Apr 5 08:40:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 08:40:30 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35FeHKO024415 for ; Mon, 5 Apr 2004 08:40:18 -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 686253F0E08 for ; Mon, 5 Apr 2004 17:03:12 +0200 (CEST) Date: Mon, 5 Apr 2004 17:03:12 +0200 From: Olaf Kirch To: netdev@oss.sgi.com Subject: [PATCH] eliminate divert_blk message Message-ID: <20040405150312.GS11477@suse.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="hHWLQfXTYDoKhP50" Content-Disposition: inline User-Agent: Mutt/1.4i X-archive-position: 4471 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: okir@suse.de Precedence: bulk X-list: netdev Content-Length: 871 Lines: 34 --hHWLQfXTYDoKhP50 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Every time a non-ethernet device is configured (e.g. when using PPP) the kernel logs a message saying "not allocating divert_blk for non-ethernet device". This patch disables the message. Cheers, Olaf -- Olaf Kirch | The Hardware Gods hate me. okir@suse.de | ---------------+ --hHWLQfXTYDoKhP50 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: attachment; filename=divert_blk-shutup --- linux-2.6.4/net/core/dv.c.quiet 2004-02-04 04:43:45.000000000 +0100 +++ linux-2.6.4/net/core/dv.c 2004-04-05 16:50:06.000000000 +0200 @@ -67,9 +67,6 @@ } dev_hold(dev); } else { - printk(KERN_DEBUG "divert: not allocating divert_blk for non-ethernet device %s\n", - dev->name); - dev->divert = NULL; } return 0; --hHWLQfXTYDoKhP50-- From ak@muc.de Mon Apr 5 08:53:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 08:53:16 -0700 (PDT) Received: from zero.aec.at (Hannibal_Hunsiker@zero.aec.at [193.170.194.10]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35FrCKO024987 for ; Mon, 5 Apr 2004 08:53:13 -0700 Received: from averell.firstfloor.org.muc.de (Orrin_Goof@localhost.localdomain [127.0.0.1]) by zero.aec.at (8.11.6/8.11.2) with ESMTP id i35Fr9D28039 for ; Mon, 5 Apr 2004 17:53:10 +0200 To: netdev@oss.sgi.com Subject: [PATCH] Force IPv6 garbage collection on device down From: Andi Kleen Date: Mon, 05 Apr 2004 17:53:09 +0200 Message-ID: User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-archive-position: 4472 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@muc.de Precedence: bulk X-list: netdev Content-Length: 638 Lines: 24 We had some problems with devices occasionally hanging with non zero reference count on device destroy until the next time the IPv6 garbage collection timer ran (upto 10s). To avoid that this patch forces an IPv6 FIB garbage collection on device down. -Andi diff -u linux-2.6.5/net/ipv6/ndisc.c-N linux-2.6.5/net/ipv6/ndisc.c --- linux-2.6.5/net/ipv6/ndisc.c-N 1970-01-01 01:12:51.000000000 +0100 +++ linux-2.6.5/net/ipv6/ndisc.c 2004-04-05 17:50:52.000000000 +0200 @@ -1403,6 +1403,9 @@ neigh_changeaddr(&nd_tbl, dev); fib6_run_gc(0); break; + case NETDEV_UNREGISTER: + fib6_run_gc(0); + break; default: break; } From linux-netdev@gmane.org Mon Apr 5 09:03:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 09:03:34 -0700 (PDT) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35G3FKO025518 for ; Mon, 5 Apr 2004 09:03:16 -0700 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BAWZ7-00022E-00 for ; Mon, 05 Apr 2004 18:03:13 +0200 Received: from finn.gmane.org ([80.91.224.251]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Apr 2004 18:03:13 +0200 Received: from lunz by finn.gmane.org with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 05 Apr 2004 18:03:13 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: netdev@oss.sgi.com From: Jason Lunz Subject: Re: Luca Deri's paper: Improving Passive Packet Capture: Beyond Device Polling Date: Mon, 5 Apr 2004 16:03:11 +0000 (UTC) Organization: PBR Streetgang Message-ID: References: <20040330142354.GA17671@outblaze.com> <1081033332.2037.61.camel@jzny.localdomain> X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: finn.gmane.org User-Agent: slrn/0.9.8.0 (Linux) X-archive-position: 4473 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lunz@falooley.org Precedence: bulk X-list: netdev Content-Length: 1627 Lines: 36 hadi@cyberus.ca said: > Jason Lunz actually seemed to have been doing more work on this and > e1000 - he could provide better perfomance numbers. Well, not really. What I have is still available at: http://gtf.org/lunz/linux/net/perf/ ...but those are mainly measurements of very outdated versions of the e1000 napi driver backported to 2.4, running on 1.8Ghz Xeon systems. That work hasn't really been kept up to date, I'm afraid. > It should also be noted that infact packet mmap already uses rings. Yes, I read the paper (but not his code). What stood out to me is that the description of his custom socket implementation matches exactly what packet-mmap already is. I noticed he only mentioned testing of libpcap-mmap, but did not use mmap packet sockets directly -- maybe there's something about libpcap that limits performance? I haven't looked. What I can say for sure is that the napi + packet-mmap performance with many small packets is almost surely limited by problems with irq/softirq load. There was an excellent thread last week about this with Andrea Arcangeli, Robert Olsson and others about the balancing of softirq and userspace load; they eventually were beginning to agree that running softirqs on return from hardirq and bh was a bigger load than expected when there was lots of napi work to do. So despite NAPI, too much kernel time is spent handling (soft)irq load with many small packets. It appears this problem became worse in 2.6 with HZ=1000, because now the napi rx softirq work is being done 10X as much on return from the timer interrupt. I'm not sure if a solution was reached. Jason From ak@suse.de Mon Apr 5 09:19:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 09:19:37 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35GJXKO026256 for ; Mon, 5 Apr 2004 09:19:33 -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 0DABA3F141E for ; Mon, 5 Apr 2004 18:19:27 +0200 (CEST) Date: Mon, 5 Apr 2004 18:19:25 +0200 From: Andi Kleen To: Olaf Kirch Cc: netdev@oss.sgi.com Subject: Re: [PATCH] eliminate divert_blk message Message-Id: <20040405181925.70897aac.ak@suse.de> In-Reply-To: <20040405150312.GS11477@suse.de> References: <20040405150312.GS11477@suse.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4474 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev Content-Length: 475 Lines: 12 On Mon, 5 Apr 2004 17:03:12 +0200 Olaf Kirch wrote: > Every time a non-ethernet device is configured (e.g. when using PPP) the > kernel logs a message saying "not allocating divert_blk for non-ethernet > device". This patch disables the message. Are you sure? All our kernels have CONFIG_NET_DIVERT disabled. I don't see how you could get this message unless you enabled it on your own. If you did that just disable it, it's imho an useless option. -Andi From ak@suse.de Mon Apr 5 10:06:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 10:06:03 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35H5nKO028274 for ; Mon, 5 Apr 2004 10:05:49 -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 A7C973F181E for ; Mon, 5 Apr 2004 18:20:16 +0200 (CEST) Date: Mon, 5 Apr 2004 18:20:15 +0200 From: Andi Kleen To: Andi Kleen Cc: okir@suse.de, netdev@oss.sgi.com Subject: Re: [PATCH] eliminate divert_blk message Message-Id: <20040405182015.261e2d5d.ak@suse.de> In-Reply-To: <20040405181925.70897aac.ak@suse.de> References: <20040405150312.GS11477@suse.de> <20040405181925.70897aac.ak@suse.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4475 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev Content-Length: 631 Lines: 18 On Mon, 5 Apr 2004 18:19:25 +0200 Andi Kleen wrote: > On Mon, 5 Apr 2004 17:03:12 +0200 > Olaf Kirch wrote: > > > Every time a non-ethernet device is configured (e.g. when using PPP) the > > kernel logs a message saying "not allocating divert_blk for non-ethernet > > device". This patch disables the message. > > Are you sure? All our kernels have CONFIG_NET_DIVERT disabled. I don't see > how you could get this message unless you enabled it on your own. > If you did that just disable it, it's imho an useless option. Oops, that should have gone to Olaf privately. Sorry for the noise. -Andi From Robert.Olsson@data.slu.se Mon Apr 5 10:12:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 10:12:12 -0700 (PDT) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35HC8KO028702 for ; Mon, 5 Apr 2004 10:12:09 -0700 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id i35HBqNv030049; Mon, 5 Apr 2004 19:11:54 +0200 Received: by robur.slu.se (Postfix, from userid 1000) id 9C04F903D5; Mon, 5 Apr 2004 19:11:52 +0200 (CEST) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16497.37720.607342.193544@robur.slu.se> Date: Mon, 5 Apr 2004 19:11:52 +0200 To: dipankar@in.ibm.com Cc: Andrea Arcangeli , Robert Olsson , "David S. Miller" , kuznet@ms2.inr.ac.ru, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, paulmck@us.ibm.com, akpm@osdl.org Subject: Re: route cache DoS testing and softirqs In-Reply-To: <20040331214342.GD4543@in.ibm.com> References: <20040329222926.GF3808@dualathlon.random> <200403302005.AAA00466@yakov.inr.ac.ru> <20040330211450.GI3808@dualathlon.random> <20040330133000.098761e2.davem@redhat.com> <20040330213742.GL3808@dualathlon.random> <20040331171023.GA4543@in.ibm.com> <16491.4593.718724.277551@robur.slu.se> <20040331203750.GB4543@in.ibm.com> <20040331212817.GQ2143@dualathlon.random> <20040331214342.GD4543@in.ibm.com> X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 4476 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 2468 Lines: 57 Dipankar Sarma writes: > Robert, btw, this rcu-softirq patch is slightly different > from the earlier one in the sense that now every softirq > handler completion is a quiescent point. Earlier each iteration > of softirqs was a quiescent point. So this has more quiescent > points. Hello! Yes it seems reduce RCU latency in our setup as well. It does not eliminate overflows but reduces with ~50% and increases the throughput a bit. dst cache overflow depends on RCU-delay + gc_min_interval and the number of entries freed per sec so this means RCU has improved. Also the user app doing gettimeofday seems to be better scheduled. The worst starvation improved from ~7.5 to ~4.4 sec. Cheers. --ro Setup as described before. Without patch ============= 2 * 283 kpps (eth0, eth2) 32768 flows and 10 pkts flow Kernel Interface table Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flags eth0 1500 0 5419435 8802471 8802471 4580569 44 0 0 0 BRU eth1 1500 0 45 0 0 0 5417465 0 0 0 BRU eth2 1500 0 5372943 8849348 8849348 4627060 44 0 0 0 BRU eth3 1500 0 46 0 0 0 5371007 0 0 0 BRU /proc/net/rt_cache_stat (3:rd last is ovfr) 000034d0 0046284e 000c8986 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000bf952 000bf173 000007b8 000007b3 0081b228 00000000 000034d0 004559f4 000ca247 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000c369c 000c2edf 00000799 00000792 008057a4 00000000 User app max delay 7.5 Sec WIth RCU patch =============== 2 * 284 kpps 32768 flows and 10 pkts flow Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flags eth0 1500 0 5838522 8704663 8704663 4161481 44 0 0 0 BRU eth1 1500 0 45 0 0 0 5837586 0 0 0 BRU eth2 1500 0 5957987 8643714 8643714 4042016 44 0 0 0 BRU eth3 1500 0 46 0 0 0 5957051 0 0 0 BRU /proc/net/rt_cache_stat 0002dcb5 004b6add 000dac08 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000d029a 000cfec3 000003aa 000003a9 008c80b2 00000000 0002dcb5 004d2db5 000dbbda 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000cfa51 000cf67e 000003b1 000003aa 008eb195 00000000 User app max delay 4.4 Sec From romieu@fr.zoreil.com Mon Apr 5 10:41:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 10:41:28 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35HfPKO029669 for ; Mon, 5 Apr 2004 10:41:26 -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 i35Hclgf019725; Mon, 5 Apr 2004 19:38:47 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i35HcjNL019724; Mon, 5 Apr 2004 19:38:45 +0200 Date: Mon, 5 Apr 2004 19:38:45 +0200 From: Francois Romieu To: Srihari Vijayaraghavan Cc: jgarzik@pobox.com, netdev@oss.sgi.com, ak@suse.de Subject: Re: [patch] 2.6.5-rc2 - r8169 DAC Message-ID: <20040405193845.A19650@electric-eye.fr.zoreil.com> References: <253ea2a8f4.2a8f4253ea@email.bigpond.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: <253ea2a8f4.2a8f4253ea@email.bigpond.com>; from harisri@telstra.com on Mon, Apr 05, 2004 at 09:38:46AM +1000 X-Organisation: Land of Sunshine Inc. X-archive-position: 4477 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 642 Lines: 18 Srihari Vijayaraghavan : [...] > With that patch 2.6.5-rc2 + r8169 DAC compiles and works fine. Nice. > There is one problem however: If I unplug and plug the cable it does not > come back to online (even the LED on the card does not glow). I did not try > reloading the driver, but a reboot does fix it :-( (later today I shall try > reloading the driver). OTOH the vanilla 2.6.5-rc2 (or rc3) does not show > this behaviour. Reloading the driver is known to bring the device online again.The issue is known but I had not understood it as a regression against vanilla kernel :o( I'll see what can be done. -- Ueimor From vda@port.imtp.ilyichevsk.odessa.ua Mon Apr 5 13:07:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 13:07:35 -0700 (PDT) Received: from port.imtp.ilyichevsk.odessa.ua (168.imtp.Ilyichevsk.Odessa.UA [195.66.192.168] (may be forged)) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35K6uKO022515 for ; Mon, 5 Apr 2004 13:07:06 -0700 Received: (qmail 16182 invoked by alias); 5 Apr 2004 19:18:11 -0000 Received: from unknown (1.0.3.9) by 0 (195.66.192.168) with ESMTP; 05 Apr 2004 19:18:11 -0000 From: Denis Vlasenko To: Jeff Garzik , Francois Romieu , andreas@fjortis.info Subject: [PATCH] 2.4, 2.6 patchset for fealnx.c Date: Mon, 5 Apr 2004 22:18:06 +0300 User-Agent: KMail/1.5.4 Cc: netdev@oss.sgi.com, Denis Vlasenko MIME-Version: 1.0 Message-Id: <200404052217.35883.vda@port.imtp.ilyichevsk.odessa.ua> Content-Type: Multipart/Mixed; boundary="Boundary-00=_uDbcA5rEVIjmlkt" X-archive-position: 4478 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: vda@port.imtp.ilyichevsk.odessa.ua Precedence: bulk X-list: netdev Content-Length: 25979 Lines: 401 --Boundary-00=_uDbcA5rEVIjmlkt Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline I almost emptied my TODO. Hurray ;) 2.4 patches are stress-tested. As before, I used UDP flood in extremely memory constrained box (kernel OOM killed several processes while I ran test). Looks ok. 2.6.5 kernel have console-related slab corruption issues on test machine, can't stress-test patches. Compile and boot tested only. Pings work. 24/* patches against 2.4.25 26/* patches against 2.6.5 fealnx.0.diff replace dev->base_addr with ioaddr 2.4 only: sync with 2.6 fealnx.1.diff replace magic constants with enums fealnx.2.diff add 'static' fix wrapped comment fealnx.3.diff fix pointer substraction bug fealnx.4.diff stop doing stop_nic_rx()/writel(np->crvalue, ioaddr+TCRRCR) in rest_rx_descriptors(), this can inadvertently (re)enable tx and/or rx. fealnx.5.diff introduce stop_nic_rxtx(), use it where makes sense fealnx.6.diff Francois' fixes for low memory handling remove free_one_rx_descriptor(), not used anymore fealnx.7.diff Garzik fix (AFAIR): add locking to tx_timeout fealnx.8.diff Move reset code from tx_timeout into two separate routines: reset_and_disable_rxtx() and enable_rxtx() New function reset_tx_descriptors(): clean up tx ring after tx_timeout. tx_timeout now does: reset_and_disable_rxtx() reset_tx_descriptors() enable_rxtx() netif_wake_queue() Absense of netif_wake_queue() call was probably the cause of tx_timeout() stalling all future tx. Add reset timer, fire it 1/2 sec after 'Too much work in interrupt' It cleans up rx ring and resets device a-la tx_timeout() Remove stop_nic_tx(), not used anymore fealnx.9.diff set_rx_mode() can be called by core code, needs locking. __set_rx_mode() is a 'dont lock' variant fealnx.10.diff replace local delay functions with udelay fealnx.11.diff beautify some code a bit make driver coding style uniform fix bug in dead code -- vda --Boundary-00=_uDbcA5rEVIjmlkt Content-Type: application/x-tgz; name="fealnx.tar.gz" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="fealnx.tar.gz" H4sIAICwcUACA+w8aXfjNpL9Vf0rkM4bRzIlmZcuO+7EhzytF19Lq485Mnw0RVlcS6SWpNrypju/ fasK4KXbHvexu1Y6FgUWgEKhUBcK6DvW0JvuvPiSH1nW5UatBt/0mf2mZ0WWNV1T6w0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Y+Hy4GkSSxeLwYuBjuwzOFHRZd6matFKtjgbXXDhgi9iBFlisI47X8+W qpYd1uJ3Yo9IID3CH869a75BjTA7/NifQUoaVa8Z1oNiCx+3H7Zcn8FLJ0jV2fpClXfC8mhjmfgg AnVoXfVJdiixIeCAWJ9PNpC5cctLtSbinPnU8eajCZ9aK8Lm7gVulVwDWJ+ckE8w5rGuOtgKOwjq qD9Z8wGMnoD5HdaQg3HFp6kbwPBeuUBBMF+6qpl22MwRn8Rj31s+ghFyyYMIeWvE+kB9lw+CeGMz n0/ojDBQfmOwAuKiG81vePXwhp3whr+Mgr97V3C3fXyZsOmgduBr7jxVsRtWfDaZyEhxOJzzbcwL 8DmtJzZkJxJ4iEdRo5M3D3UOmjAn8AzU0Bgo/dB8ouEMUcdZffF5m2C15FtWwH/mS3K5L0Yh1fdT xQWpO3doIrxxv6isUunG+uo+onvAvC8N/jTV8XnCntX1Xs75O5r40KcsZ1T1Qbofiv8e7WXSLUQ9 f3aGswbCc5MlUEFgX0bL0AaM0KHRGmuIOazcs1VQqUijgHrna66dgbOgjgUHNLF0RFXebOppy1RT Rqq4qs5Id6Hg7TGqMvwikQ0s5Wyj20Z1mSrsJSP2aOLz4wiUe0SeDE2eWCkCESKepgI3LN+zEGJr /DWsrQk/NI155zcEwMd5OILUnHgRliybcOWIv35+iWTQDRf567nH1+dMCTQuu2CCTyAxLrTx4N4g df/v/t/9v3/3f/8PaxEx9gBoAQA= --Boundary-00=_uDbcA5rEVIjmlkt-- From mashirle@us.ibm.com Mon Apr 5 13:51:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 13:51:58 -0700 (PDT) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.105]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35KpkKO023443 for ; Mon, 5 Apr 2004 13:51:54 -0700 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e5.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i35KpD67457010; Mon, 5 Apr 2004 16:51:16 -0400 Received: from DYN318388BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i35KpWrU086518; Mon, 5 Apr 2004 16:51:33 -0400 From: Shirley Ma To: "David S. Miller" Subject: Re: [PATCH]dump interface IPv6 multicast/anycast addresses through netlink Date: Mon, 5 Apr 2004 13:51:09 -0700 User-Agent: KMail/1.5 Cc: xma@us.ibm.com, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com, yoshfuji@cerberus.hongo.wide.ad.jp References: <200404011028.13048.mashirle@us.ibm.com> <20040403144540.7f201bc1.davem@redhat.com> In-Reply-To: <20040403144540.7f201bc1.davem@redhat.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_9accA6m7DJZzaxc" Message-Id: <200404051351.09740.mashirle@us.ibm.com> X-archive-position: 4479 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mashirle@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 8004 Lines: 268 --Boundary-00=_9accA6m7DJZzaxc Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Dumping multicast/anycast api was removed in Linux 2.6.5 kernel, so it couldn't be applied cleanly. I recreated the patch. This patch has been tested against linux-2.6.5 kernel. --Boundary-00=_9accA6m7DJZzaxc Content-Type: text/x-diff; charset="iso-8859-1"; name="linux-2.6.5-ipv6mib.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="linux-2.6.5-ipv6mib.patch" diff -urN linux-2.6.5/include/linux/rtnetlink.h linux-2.6.5-ipv6mib/include/linux/rtnetlink.h --- linux-2.6.5/include/linux/rtnetlink.h 2004-04-03 19:37:42.000000000 -0800 +++ linux-2.6.5-ipv6mib/include/linux/rtnetlink.h 2004-04-05 13:13:27.000000000 -0700 @@ -47,7 +47,11 @@ #define RTM_NEWPREFIX (RTM_BASE+36) #define RTM_GETPREFIX (RTM_BASE+38) -#define RTM_MAX (RTM_BASE+39) +#define RTM_GETMULTICAST (RTM_BASE+42) + +#define RTM_GETANYCAST (RTM_BASE+46) + +#define RTM_MAX (RTM_BASE+47) /* Generic structure for encapsulation of optional route information. @@ -340,7 +344,8 @@ IFA_LABEL, IFA_BROADCAST, IFA_ANYCAST, - IFA_CACHEINFO + IFA_CACHEINFO, + IFA_MULTICAST }; #define IFA_MAX IFA_CACHEINFO diff -urN linux-2.6.5/net/ipv6/addrconf.c linux-2.6.5-ipv6mib/net/ipv6/addrconf.c --- linux-2.6.5/net/ipv6/addrconf.c 2004-04-03 19:38:17.000000000 -0800 +++ linux-2.6.5-ipv6mib/net/ipv6/addrconf.c 2004-04-05 13:20:34.194635432 -0700 @@ -2553,7 +2553,89 @@ return -1; } -static int inet6_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) +static int inet6_fill_ifmcaddr(struct sk_buff *skb, struct ifmcaddr6 *ifmca, + u32 pid, u32 seq, int event) +{ + struct ifaddrmsg *ifm; + struct nlmsghdr *nlh; + struct ifa_cacheinfo ci; + unsigned char *b = skb->tail; + + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ifm)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + ifm = NLMSG_DATA(nlh); + ifm->ifa_family = AF_INET6; + ifm->ifa_prefixlen = 128; + ifm->ifa_flags = IFA_F_PERMANENT; + ifm->ifa_scope = RT_SCOPE_UNIVERSE; + if (ipv6_addr_scope(&ifmca->mca_addr)&IFA_SITE) + ifm->ifa_scope = RT_SCOPE_SITE; + ifm->ifa_index = ifmca->idev->dev->ifindex; + RTA_PUT(skb, IFA_MULTICAST, 16, &ifmca->mca_addr); + ci.cstamp = (__u32)(TIME_DELTA(ifmca->mca_cstamp, INITIAL_JIFFIES) / HZ + * 100 + TIME_DELTA(ifmca->mca_cstamp, INITIAL_JIFFIES) % HZ + * 100 / HZ); + ci.tstamp = (__u32)(TIME_DELTA(ifmca->mca_tstamp, INITIAL_JIFFIES) / HZ + * 100 + TIME_DELTA(ifmca->mca_tstamp, INITIAL_JIFFIES) % HZ + * 100 / HZ); + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + nlh->nlmsg_len = skb->tail - b; + return skb->len; + +nlmsg_failure: +rtattr_failure: + skb_trim(skb, b - skb->data); + return -1; +} + +static int inet6_fill_ifacaddr(struct sk_buff *skb, struct ifacaddr6 *ifaca, + u32 pid, u32 seq, int event) +{ + struct ifaddrmsg *ifm; + struct nlmsghdr *nlh; + struct ifa_cacheinfo ci; + unsigned char *b = skb->tail; + + nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*ifm)); + if (pid) nlh->nlmsg_flags |= NLM_F_MULTI; + ifm = NLMSG_DATA(nlh); + ifm->ifa_family = AF_INET6; + ifm->ifa_prefixlen = 128; + ifm->ifa_flags = IFA_F_PERMANENT; + ifm->ifa_scope = RT_SCOPE_UNIVERSE; + if (ipv6_addr_scope(&ifaca->aca_addr)&IFA_SITE) + ifm->ifa_scope = RT_SCOPE_SITE; + ifm->ifa_index = ifaca->aca_idev->dev->ifindex; + RTA_PUT(skb, IFA_ANYCAST, 16, &ifaca->aca_addr); + ci.cstamp = (__u32)(TIME_DELTA(ifaca->aca_cstamp, INITIAL_JIFFIES) / HZ + * 100 + TIME_DELTA(ifaca->aca_cstamp, INITIAL_JIFFIES) % HZ + * 100 / HZ); + ci.tstamp = (__u32)(TIME_DELTA(ifaca->aca_tstamp, INITIAL_JIFFIES) / HZ + * 100 + TIME_DELTA(ifaca->aca_tstamp, INITIAL_JIFFIES) % HZ + * 100 / HZ); + ci.ifa_prefered = INFINITY_LIFE_TIME; + ci.ifa_valid = INFINITY_LIFE_TIME; + RTA_PUT(skb, IFA_CACHEINFO, sizeof(ci), &ci); + nlh->nlmsg_len = skb->tail - b; + return skb->len; + +nlmsg_failure: +rtattr_failure: + skb_trim(skb, b - skb->data); + return -1; +} + +enum addr_type_t +{ + UNICAST_ADDR, + MULTICAST_ADDR, + ANYCAST_ADDR, +}; + +static int inet6_dump_addr(struct sk_buff *skb, struct netlink_callback *cb, + enum addr_type_t type) { int idx, ip_idx; int s_idx, s_ip_idx; @@ -2561,7 +2643,9 @@ struct net_device *dev; struct inet6_dev *idev = NULL; struct inet6_ifaddr *ifa; - + struct ifmcaddr6 *ifmca; + struct ifacaddr6 *ifaca; + s_idx = cb->args[0]; s_ip_idx = ip_idx = cb->args[1]; read_lock(&dev_base_lock); @@ -2575,28 +2659,58 @@ if ((idev = in6_dev_get(dev)) == NULL) continue; read_lock_bh(&idev->lock); - /* unicast address */ - for (ifa = idev->addr_list; ifa; - ifa = ifa->if_next, ip_idx++) { - if (ip_idx < s_ip_idx) - continue; - if ((err = inet6_fill_ifaddr(skb, ifa, - NETLINK_CB(cb->skb).pid, - cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) - goto done; - } - /* temp addr */ + switch (type) { + case UNICAST_ADDR: + /* unicast address */ + for (ifa = idev->addr_list; ifa; + ifa = ifa->if_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifaddr(skb, ifa, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } + /* temp addr */ #ifdef CONFIG_IPV6_PRIVACY - for (ifa = idev->tempaddr_list; ifa; - ifa = ifa->tmp_next, ip_idx++) { - if (ip_idx < s_ip_idx) - continue; - if ((err = inet6_fill_ifaddr(skb, ifa, - NETLINK_CB(cb->skb).pid, - cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) - goto done; - } + for (ifa = idev->tempaddr_list; ifa; + ifa = ifa->tmp_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifaddr(skb, ifa, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_NEWADDR)) <= 0) + goto done; + } #endif + break; + case MULTICAST_ADDR: + /* multicast address */ + for (ifmca = idev->mc_list; ifmca; + ifmca = ifmca->next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifmcaddr(skb, ifmca, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_GETMULTICAST)) <= 0) + goto done; + } + break; + case ANYCAST_ADDR: + /* anycast address */ + for (ifaca = idev->ac_list; ifaca; + ifaca = ifaca->aca_next, ip_idx++) { + if (ip_idx < s_ip_idx) + continue; + if ((err = inet6_fill_ifacaddr(skb, ifaca, + NETLINK_CB(cb->skb).pid, + cb->nlh->nlmsg_seq, RTM_GETANYCAST)) <= 0) + goto done; + } + break; + default: + break; + } read_unlock_bh(&idev->lock); in6_dev_put(idev); } @@ -2611,6 +2725,25 @@ return skb->len; } +static int inet6_dump_ifaddr(struct sk_buff *skb, struct netlink_callback *cb) +{ + enum addr_type_t type = UNICAST_ADDR; + return inet6_dump_addr(skb, cb, type); +} + +static int inet6_dump_ifmcaddr(struct sk_buff *skb, struct netlink_callback *cb) +{ + enum addr_type_t type = MULTICAST_ADDR; + return inet6_dump_addr(skb, cb, type); +} + + +static int inet6_dump_ifacaddr(struct sk_buff *skb, struct netlink_callback *cb) +{ + enum addr_type_t type = ANYCAST_ADDR; + return inet6_dump_addr(skb, cb, type); +} + static void inet6_ifa_notify(int event, struct inet6_ifaddr *ifa) { struct sk_buff *skb; @@ -2835,6 +2968,8 @@ [RTM_NEWADDR - RTM_BASE] = { .doit = inet6_rtm_newaddr, }, [RTM_DELADDR - RTM_BASE] = { .doit = inet6_rtm_deladdr, }, [RTM_GETADDR - RTM_BASE] = { .dumpit = inet6_dump_ifaddr, }, + [RTM_GETMULTICAST - RTM_BASE] = { .dumpit = inet6_dump_ifmcaddr, }, + [RTM_GETANYCAST - RTM_BASE] = { .dumpit = inet6_dump_ifacaddr, }, [RTM_NEWROUTE - RTM_BASE] = { .doit = inet6_rtm_newroute, }, [RTM_DELROUTE - RTM_BASE] = { .doit = inet6_rtm_delroute, }, [RTM_GETROUTE - RTM_BASE] = { .doit = inet6_rtm_getroute, --Boundary-00=_9accA6m7DJZzaxc-- From brazilnut@us.ibm.com Mon Apr 5 14:26:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 14:27:02 -0700 (PDT) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.130]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35LQlKO024864 for ; Mon, 5 Apr 2004 14:26:47 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i35LQdih563458; Mon, 5 Apr 2004 17:26:39 -0400 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i35LQbKe330746; Mon, 5 Apr 2004 15:26:38 -0600 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i35LQWc10992; Mon, 5 Apr 2004 14:26:32 -0700 From: Don Fry Message-Id: <200404052126.i35LQWc10992@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.6.5 2/4] pcnet32 all printk under netif_msg To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Mon, 5 Apr 2004 14:26:32 -0700 (PDT) X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 4482 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brazilnut@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 14393 Lines: 439 Please apply the following patch to 2.6.5. All printk's are now done under netif_msg debug level tests. --- linux-2.6.5/drivers/net/add.pcnet32.c Mon Apr 5 11:40:57 2004 +++ linux-2.6.5/drivers/net/pcnet32.c Mon Apr 5 13:37:56 2004 @@ -22,8 +22,8 @@ *************************************************************************/ #define DRV_NAME "pcnet32" -#define DRV_VERSION "1.28" -#define DRV_RELDATE "02.20.2004" +#define DRV_VERSION "1.29" +#define DRV_RELDATE "04.06.2004" #define PFX DRV_NAME ": " static const char *version = @@ -484,11 +484,11 @@ #ifdef CONFIG_NET_POLL_CONTROLLER static void pcnet32_poll_controller(struct net_device *dev) -{ +{ disable_irq(dev->irq); pcnet32_interrupt(0, dev, NULL); enable_irq(dev->irq); -} +} #endif @@ -611,7 +611,7 @@ test->flags |= ETH_TEST_FL_FAILED; } else if (netif_msg_hw(lp)) printk(KERN_DEBUG "%s: Loopback test passed.\n", dev->name); - } else + } else if (netif_msg_hw(lp)) printk(KERN_DEBUG "%s: No tests to run (specify 'Offline' on ethtool).", dev->name); } /* end pcnet32_ethtool_test */ @@ -793,23 +793,27 @@ err = pci_enable_device(pdev); if (err < 0) { - printk(KERN_ERR PFX "failed to enable device -- err=%d\n", err); + if (pcnet32_debug & NETIF_MSG_PROBE) + printk(KERN_ERR PFX "failed to enable device -- err=%d\n", err); return err; } pci_set_master(pdev); ioaddr = pci_resource_start (pdev, 0); if (!ioaddr) { - printk (KERN_ERR PFX "card has no PCI IO resources, aborting\n"); + if (pcnet32_debug & NETIF_MSG_PROBE) + printk (KERN_ERR PFX "card has no PCI IO resources, aborting\n"); return -ENODEV; } if (!pci_dma_supported(pdev, PCNET32_DMA_MASK)) { - printk(KERN_ERR PFX "architecture does not support 32bit PCI busmaster DMA\n"); + if (pcnet32_debug & NETIF_MSG_PROBE) + printk(KERN_ERR PFX "architecture does not support 32bit PCI busmaster DMA\n"); return -ENODEV; } if (request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci") == NULL) { - printk(KERN_ERR PFX "io address range already allocated\n"); + if (pcnet32_debug & NETIF_MSG_PROBE) + printk(KERN_ERR PFX "io address range already allocated\n"); return -EBUSY; } @@ -847,14 +851,15 @@ if (pcnet32_dwio_read_csr(ioaddr, 0) == 4 && pcnet32_dwio_check(ioaddr)) { a = &pcnet32_dwio; } else - goto err_release_region; + goto err_release_region; } chip_version = a->read_csr(ioaddr, 88) | (a->read_csr(ioaddr,89) << 16); - if (pcnet32_debug & NETIF_MSG_PROBE) + if ((pcnet32_debug & NETIF_MSG_PROBE) && (pcnet32_debug & NETIF_MSG_HW)) printk(KERN_INFO " PCnet chip version is %#x.\n", chip_version); if ((chip_version & 0xfff) != 0x003) { - printk(KERN_INFO PFX "Unsupported chip version.\n"); + if (pcnet32_debug & NETIF_MSG_PROBE) + printk(KERN_INFO PFX "Unsupported chip version.\n"); goto err_release_region; } @@ -914,8 +919,9 @@ fdx = 1; mii = 1; break; default: - printk(KERN_INFO PFX "PCnet version %#x, no PCnet32 chip.\n", - chip_version); + if (pcnet32_debug & NETIF_MSG_PROBE) + printk(KERN_INFO PFX "PCnet version %#x, no PCnet32 chip.\n", + chip_version); goto err_release_region; } @@ -935,13 +941,15 @@ dev = alloc_etherdev(0); if (!dev) { - printk(KERN_ERR PFX "Memory allocation failed.\n"); + if (pcnet32_debug & NETIF_MSG_PROBE) + printk(KERN_ERR PFX "Memory allocation failed.\n"); ret = -ENOMEM; goto err_release_region; } SET_NETDEV_DEV(dev, &pdev->dev); - printk(KERN_INFO PFX "%s at %#3lx,", chipname, ioaddr); + if (pcnet32_debug & NETIF_MSG_PROBE) + printk(KERN_INFO PFX "%s at %#3lx,", chipname, ioaddr); /* In most chips, after a chip reset, the ethernet address is read from the * station address PROM at the base address and programmed into the @@ -970,8 +978,10 @@ if (!is_valid_ether_addr(dev->dev_addr) && is_valid_ether_addr(promaddr)) { #endif - printk(" warning: CSR address invalid,\n"); - printk(KERN_INFO " using instead PROM address of"); + if (pcnet32_debug & NETIF_MSG_PROBE) { + printk(" warning: CSR address invalid,\n"); + printk(KERN_INFO " using instead PROM address of"); + } memcpy(dev->dev_addr, promaddr, 6); } } @@ -980,36 +990,40 @@ if (!is_valid_ether_addr(dev->dev_addr)) memset(dev->dev_addr, 0, sizeof(dev->dev_addr)); - for (i = 0; i < 6; i++) - printk(" %2.2x", dev->dev_addr[i] ); - - if (((chip_version + 1) & 0xfffe) == 0x2624) { /* Version 0x2623 - 0x2624 */ - i = a->read_csr(ioaddr, 80) & 0x0C00; /* Check tx_start_pt */ - printk("\n" KERN_INFO " tx_start_pt(0x%04x):",i); - switch(i>>10) { - case 0: printk(" 20 bytes,"); break; - case 1: printk(" 64 bytes,"); break; - case 2: printk(" 128 bytes,"); break; - case 3: printk("~220 bytes,"); break; + if (pcnet32_debug & NETIF_MSG_PROBE) { + for (i = 0; i < 6; i++) + printk(" %2.2x", dev->dev_addr[i] ); + + /* Version 0x2623 and 0x2624 */ + if (((chip_version + 1) & 0xfffe) == 0x2624) { + i = a->read_csr(ioaddr, 80) & 0x0C00; /* Check tx_start_pt */ + printk("\n" KERN_INFO " tx_start_pt(0x%04x):",i); + switch(i>>10) { + case 0: printk(" 20 bytes,"); break; + case 1: printk(" 64 bytes,"); break; + case 2: printk(" 128 bytes,"); break; + case 3: printk("~220 bytes,"); break; + } + i = a->read_bcr(ioaddr, 18); /* Check Burst/Bus control */ + printk(" BCR18(%x):",i&0xffff); + if (i & (1<<5)) printk("BurstWrEn "); + if (i & (1<<6)) printk("BurstRdEn "); + if (i & (1<<7)) printk("DWordIO "); + if (i & (1<<11)) printk("NoUFlow "); + i = a->read_bcr(ioaddr, 25); + printk("\n" KERN_INFO " SRAMSIZE=0x%04x,",i<<8); + i = a->read_bcr(ioaddr, 26); + printk(" SRAM_BND=0x%04x,",i<<8); + i = a->read_bcr(ioaddr, 27); + if (i & (1<<14)) printk("LowLatRx"); } - i = a->read_bcr(ioaddr, 18); /* Check Burst/Bus control */ - printk(" BCR18(%x):",i&0xffff); - if (i & (1<<5)) printk("BurstWrEn "); - if (i & (1<<6)) printk("BurstRdEn "); - if (i & (1<<7)) printk("DWordIO "); - if (i & (1<<11)) printk("NoUFlow "); - i = a->read_bcr(ioaddr, 25); - printk("\n" KERN_INFO " SRAMSIZE=0x%04x,",i<<8); - i = a->read_bcr(ioaddr, 26); - printk(" SRAM_BND=0x%04x,",i<<8); - i = a->read_bcr(ioaddr, 27); - if (i & (1<<14)) printk("LowLatRx"); } dev->base_addr = ioaddr; /* pci_alloc_consistent returns page-aligned memory, so we do not have to check the alignment */ if ((lp = pci_alloc_consistent(pdev, sizeof(*lp), &lp_dma_addr)) == NULL) { - printk(KERN_ERR PFX "Consistent memory allocation failed.\n"); + if (pcnet32_debug & NETIF_MSG_PROBE) + printk(KERN_ERR PFX "Consistent memory allocation failed.\n"); ret = -ENOMEM; goto err_free_netdev; } @@ -1045,7 +1059,8 @@ lp->options |= PCNET32_PORT_FD; if (!a) { - printk(KERN_ERR PFX "No access methods\n"); + if (pcnet32_debug & NETIF_MSG_PROBE) + printk(KERN_ERR PFX "No access methods\n"); ret = -ENODEV; goto err_free_consistent; } @@ -1079,9 +1094,10 @@ dev->irq = irq_line; } - if (dev->irq >= 2) - printk(" assigned IRQ %d.\n", dev->irq); - else { + if (dev->irq >= 2) { + if (pcnet32_debug & NETIF_MSG_PROBE) + printk(" assigned IRQ %d.\n", dev->irq); + } else { unsigned long irq_mask = probe_irq_on(); /* @@ -1095,11 +1111,13 @@ dev->irq = probe_irq_off (irq_mask); if (!dev->irq) { - printk(", failed to detect IRQ line.\n"); + if (pcnet32_debug & NETIF_MSG_PROBE) + printk(", failed to detect IRQ line.\n"); ret = -ENODEV; goto err_free_consistent; } - printk(", probed IRQ %d.\n", dev->irq); + if (pcnet32_debug & NETIF_MSG_PROBE) + printk(", probed IRQ %d.\n", dev->irq); } /* Set the mii phy_id so that we can query the link state */ @@ -1123,7 +1141,7 @@ #ifdef CONFIG_NET_POLL_CONTROLLER dev->poll_controller = pcnet32_poll_controller; -#endif +#endif /* Fill in the generic fields of the device structure. */ if (register_netdev(dev)) @@ -1136,7 +1154,8 @@ pcnet32_dev = dev; } - printk(KERN_INFO "%s: registered as %s\n",dev->name, lp->name); + if (pcnet32_debug & NETIF_MSG_PROBE) + printk(KERN_INFO "%s: registered as %s\n", dev->name, lp->name); cards_found++; return 0; @@ -1265,7 +1284,7 @@ /* If we have mii, print the link status and start the watchdog */ if (lp->mii) { - mii_check_media (&lp->mii_if, 1, 1); + mii_check_media (&lp->mii_if, netif_msg_link(lp), 1); mod_timer (&(lp->watchdog_timer), PCNET32_WATCHDOG_TIMEOUT); } @@ -1358,8 +1377,9 @@ if (rx_skbuff == NULL) { if (!(rx_skbuff = lp->rx_skbuff[i] = dev_alloc_skb (PKT_BUF_SZ))) { /* there is not much, we can do at this point */ - printk(KERN_ERR "%s: pcnet32_init_ring dev_alloc_skb failed.\n", - dev->name); + if (pcnet32_debug & NETIF_MSG_DRV) + printk(KERN_ERR "%s: pcnet32_init_ring dev_alloc_skb failed.\n", + dev->name); return -1; } skb_reserve (rx_skbuff, 2); @@ -1421,8 +1441,9 @@ spin_lock_irqsave(&lp->lock, flags); /* Transmitter timeout, serious problems. */ - printk(KERN_ERR "%s: transmit timed out, status %4.4x, resetting.\n", - dev->name, lp->a.read_csr(ioaddr, 0)); + if (pcnet32_debug & NETIF_MSG_DRV) + printk(KERN_ERR "%s: transmit timed out, status %4.4x, resetting.\n", + dev->name, lp->a.read_csr(ioaddr, 0)); lp->a.write_csr (ioaddr, 0, 0x0004); lp->stats.tx_errors++; if (netif_msg_tx_err(lp)) { @@ -1530,7 +1551,8 @@ int must_restart; if (!dev) { - printk (KERN_DEBUG "%s(): irq %d for unknown device\n", + if (pcnet32_debug & NETIF_MSG_INTR) + printk (KERN_DEBUG "%s(): irq %d for unknown device\n", __FUNCTION__, irq); return IRQ_NONE; } @@ -1582,8 +1604,9 @@ lp->stats.tx_fifo_errors++; /* Ackk! On FIFO errors the Tx unit is turned off! */ /* Remove this verbosity later! */ - printk(KERN_ERR "%s: Tx FIFO error! CSR0=%4.4x\n", - dev->name, csr0); + if (netif_msg_tx_err(lp)) + printk(KERN_ERR "%s: Tx FIFO error! CSR0=%4.4x\n", + dev->name, csr0); must_restart = 1; } #else @@ -1592,8 +1615,9 @@ if (! lp->dxsuflo) { /* If controller doesn't recover ... */ /* Ackk! On FIFO errors the Tx unit is turned off! */ /* Remove this verbosity later! */ - printk(KERN_ERR "%s: Tx FIFO error! CSR0=%4.4x\n", - dev->name, csr0); + if (netif_msg_tx_err(lp)) + printk(KERN_ERR "%s: Tx FIFO error! CSR0=%4.4x\n", + dev->name, csr0); must_restart = 1; } } @@ -1617,8 +1641,9 @@ delta = (lp->cur_tx - dirty_tx) & (TX_RING_MOD_MASK + TX_RING_SIZE); if (delta >= TX_RING_SIZE) { - printk(KERN_ERR "%s: out-of-sync dirty pointer, %d vs. %d, full=%d.\n", - dev->name, dirty_tx, lp->cur_tx, lp->tx_full); + if (netif_msg_drv(lp)) + printk(KERN_ERR "%s: out-of-sync dirty pointer, %d vs. %d, full=%d.\n", + dev->name, dirty_tx, lp->cur_tx, lp->tx_full); dirty_tx += TX_RING_SIZE; delta -= TX_RING_SIZE; } @@ -1650,8 +1675,9 @@ lp->stats.rx_errors++; /* Missed a Rx frame. */ } if (csr0 & 0x0800) { - printk(KERN_ERR "%s: Bus master arbitration failure, status %4.4x.\n", - dev->name, csr0); + if (netif_msg_drv(lp)) + printk(KERN_ERR "%s: Bus master arbitration failure, status %4.4x.\n", + dev->name, csr0); /* unlike for the lance, there is no restart needed */ } @@ -1668,7 +1694,7 @@ if (netif_msg_intr(lp)) printk(KERN_DEBUG "%s: exiting interrupt, csr0=%#4.4x.\n", - dev->name, lp->a.read_csr (ioaddr, 0)); + dev->name, lp->a.read_csr (ioaddr, 0)); spin_unlock(&lp->lock); @@ -1705,7 +1731,8 @@ struct sk_buff *skb; if (pkt_len < 60) { - printk(KERN_ERR "%s: Runt packet!\n",dev->name); + if (netif_msg_rx_err(lp)) + printk(KERN_ERR "%s: Runt packet!\n", dev->name); lp->stats.rx_errors++; } else { int rx_in_place = 0; @@ -1734,8 +1761,9 @@ if (skb == NULL) { int i; - printk(KERN_ERR "%s: Memory squeeze, deferring packet.\n", - dev->name); + if (netif_msg_drv(lp)) + printk(KERN_ERR "%s: Memory squeeze, deferring packet.\n", + dev->name); for (i = 0; i < RX_RING_SIZE; i++) if ((short)le16_to_cpu(lp->rx_ring[(entry+i) & RX_RING_MOD_MASK].status) < 0) @@ -1904,7 +1932,8 @@ spin_lock_irqsave(&lp->lock, flags); if (dev->flags&IFF_PROMISC) { /* Log any net taps. */ - printk(KERN_INFO "%s: Promiscuous mode enabled.\n", dev->name); + if (netif_msg_hw(lp)) + printk(KERN_INFO "%s: Promiscuous mode enabled.\n", dev->name); lp->init_block.mode = le16_to_cpu(0x8000 | (lp->options & PCNET32_PORT_PORTSEL) << 7); } else { lp->init_block.mode = le16_to_cpu((lp->options & PCNET32_PORT_PORTSEL) << 7); @@ -1979,7 +2008,7 @@ /* Print the link status if it has changed */ if (lp->mii) { spin_lock_irqsave(&lp->lock, flags); - mii_check_media (&lp->mii_if, 1, 0); + mii_check_media (&lp->mii_if, netif_msg_link(lp), 0); spin_unlock_irqrestore(&lp->lock, flags); } @@ -2027,6 +2056,8 @@ MODULE_DESCRIPTION("Driver for PCnet32 and PCnetPCI based ethercards"); MODULE_LICENSE("GPL"); +#define PCNET32_MSG_DEFAULT (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK) + /* An additional parameter that may be passed in... */ static int debug = -1; static int tx_start_pt = -1; @@ -2036,8 +2067,7 @@ { printk(KERN_INFO "%s", version); - if (debug >= 0 && debug < (sizeof(int) - 1)) - pcnet32_debug = 1 << debug; + pcnet32_debug = netif_msg_init(debug, PCNET32_MSG_DEFAULT); if ((tx_start_pt >= 0) && (tx_start_pt <= 3)) tx_start = tx_start_pt; @@ -2050,7 +2080,7 @@ if (pcnet32vlb) pcnet32_probe_vlbus(); - if (cards_found) + if (cards_found && (pcnet32_debug & NETIF_MSG_PROBE)) printk(KERN_INFO PFX "%d cards_found.\n", cards_found); return (pcnet32_have_pci + cards_found) ? 0 : -ENODEV; @@ -2079,7 +2109,6 @@ /* * Local variables: - * compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c pcnet32.c" * c-indent-level: 4 * tab-width: 8 * End: -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Mon Apr 5 14:25:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 14:25:14 -0700 (PDT) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35LPBKO024540 for ; Mon, 5 Apr 2004 14:25:12 -0700 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e1.ny.us.ibm.com (8.12.10/NS PXFA) with ESMTP id i35LP2Fe471494; Mon, 5 Apr 2004 17:25:02 -0400 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i35LPMrU109268; Mon, 5 Apr 2004 17:25:22 -0400 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i35LOrD10981; Mon, 5 Apr 2004 14:24:53 -0700 From: Don Fry Message-Id: <200404052124.i35LOrD10981@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.6.5 1/4] pcnet32.c add support for 79C976 To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Mon, 5 Apr 2004 14:24:53 -0700 (PDT) X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 4480 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brazilnut@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 531 Lines: 20 Please include this patch to add support for the 79C976 device to the pcnet32 driver. --- linux-2.6.5/drivers/net/orig.pcnet32.c Sat Apr 3 19:36:53 2004 +++ linux-2.6.5/drivers/net/pcnet32.c Mon Apr 5 11:40:57 2004 @@ -909,6 +909,10 @@ chipname = "PCnet/FAST III 79C975"; /* PCI */ fdx = 1; mii = 1; break; + case 0x2628: + chipname = "PCnet/FAST III 79C976"; + fdx = 1; mii = 1; + break; default: printk(KERN_INFO PFX "PCnet version %#x, no PCnet32 chip.\n", chip_version); -- Don Fry brazilnut@us.ibm.com From dipankar@in.ibm.com Mon Apr 5 14:25:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 14:25:16 -0700 (PDT) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.131]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35LP3KO024528 for ; Mon, 5 Apr 2004 14:25:04 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e33.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i35LO90o238280; Mon, 5 Apr 2004 17:24:09 -0400 Received: from soprano.in.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i35LNsKe325000; Mon, 5 Apr 2004 15:24:06 -0600 Received: by soprano.in.ibm.com (Postfix, from userid 500) id B463A7C52A; Tue, 6 Apr 2004 02:52:20 +0530 (IST) Date: Tue, 6 Apr 2004 02:52:20 +0530 From: Dipankar Sarma To: Robert Olsson Cc: Andrea Arcangeli , "David S. Miller" , kuznet@ms2.inr.ac.ru, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, paulmck@us.ibm.com, akpm@osdl.org Subject: Re: route cache DoS testing and softirqs Message-ID: <20040405212220.GH4003@in.ibm.com> Reply-To: dipankar@in.ibm.com References: <200403302005.AAA00466@yakov.inr.ac.ru> <20040330211450.GI3808@dualathlon.random> <20040330133000.098761e2.davem@redhat.com> <20040330213742.GL3808@dualathlon.random> <20040331171023.GA4543@in.ibm.com> <16491.4593.718724.277551@robur.slu.se> <20040331203750.GB4543@in.ibm.com> <20040331212817.GQ2143@dualathlon.random> <20040331214342.GD4543@in.ibm.com> <16497.37720.607342.193544@robur.slu.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16497.37720.607342.193544@robur.slu.se> User-Agent: Mutt/1.4.1i X-archive-position: 4481 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dipankar@in.ibm.com Precedence: bulk X-list: netdev Content-Length: 8494 Lines: 247 On Mon, Apr 05, 2004 at 07:11:52PM +0200, Robert Olsson wrote: > > Dipankar Sarma writes: > > > Robert, btw, this rcu-softirq patch is slightly different > > from the earlier one in the sense that now every softirq > > handler completion is a quiescent point. Earlier each iteration > > of softirqs was a quiescent point. So this has more quiescent > > points. > > Hello! > > Yes it seems reduce RCU latency in our setup as well. It does not eliminate > overflows but reduces with ~50% and increases the throughput a bit. dst cache > overflow depends on RCU-delay + gc_min_interval and the number of entries > freed per sec so this means RCU has improved. Also the user app doing gettimeofday > seems to be better scheduled. The worst starvation improved from ~7.5 to ~4.4 sec. Looks better atleast. Can you apply the following patch (rs-throttle-rcu) on top of rcu-softirq.patch in your tree and see if helps a little bit more ? Please make sure to set the kernel paramenters rcupdate.maxbatch to 4 and rcupdate.plugticks to 0. You can make sure of those parameters by looking at dmesg (rcu prints them out during boot). I just merged it, but have not tested this patch yet. Thanks Dipankar Throttle rcu by forcing a limit on how many callbacks per softirq and also implement a configurable plug. Applies on top of the rcu-softirq (hence rs-) patch. include/linux/list.h | 21 +++++++++++++++++++++ include/linux/rcupdate.h | 7 ++++++- kernel/rcupdate.c | 33 +++++++++++++++++++++++++-------- kernel/sched.c | 2 ++ 4 files changed, 54 insertions(+), 9 deletions(-) diff -puN include/linux/list.h~rs-throttle-rcu include/linux/list.h --- linux-2.6.4-rcu/include/linux/list.h~rs-throttle-rcu 2004-04-06 02:05:13.000000000 +0530 +++ linux-2.6.4-rcu-dipankar/include/linux/list.h 2004-04-06 02:05:13.000000000 +0530 @@ -251,6 +251,27 @@ static inline void list_splice(struct li __list_splice(list, head); } +static inline void __list_splice_tail(struct list_head *list, + struct list_head *head) +{ + struct list_head *first = list->next; + struct list_head *last = list->prev; + struct list_head *at = head->prev; + + first->prev = at; + at->next = first; + head->prev = last; + last->next = head; +} + + +static inline void list_splice_tail(struct list_head *list, + struct list_head *head) +{ + if (!list_empty(list)) + __list_splice_tail(list, head); +} + /** * list_splice_init - join two lists and reinitialise the emptied list. * @list: the new list to add. diff -puN include/linux/rcupdate.h~rs-throttle-rcu include/linux/rcupdate.h --- linux-2.6.4-rcu/include/linux/rcupdate.h~rs-throttle-rcu 2004-04-06 02:05:13.000000000 +0530 +++ linux-2.6.4-rcu-dipankar/include/linux/rcupdate.h 2004-04-06 02:27:29.000000000 +0530 @@ -96,10 +96,12 @@ struct rcu_data { long batch; /* Batch # for current RCU batch */ struct list_head nxtlist; struct list_head curlist; + struct list_head donelist; }; DECLARE_PER_CPU(struct rcu_data, rcu_data); DECLARE_PER_CPU(struct rcu_data, rcu_bh_data); +DECLARE_PER_CPU(int, rcu_plugticks); extern struct rcu_ctrlblk rcu_ctrlblk; extern struct rcu_ctrlblk rcu_bh_ctrlblk; @@ -107,6 +109,8 @@ extern struct rcu_ctrlblk rcu_bh_ctrlblk #define RCU_nxtlist(cpu) (per_cpu(rcu_data, (cpu)).nxtlist) #define RCU_bh_qsctr(cpu) (per_cpu(rcu_bh_data, (cpu)).qsctr) #define RCU_bh_nxtlist(cpu) (per_cpu(rcu_bh_data, (cpu)).nxtlist) + +#define RCU_plugticks(cpu) (per_cpu(rcu_plugticks, (cpu))) #define RCU_QSCTR_INVALID 0 @@ -117,7 +121,8 @@ static inline int __rcu_pending(int cpu, rcu_batch_before(rdp->batch, rcp->curbatch)) || (list_empty(&rdp->curlist) && !list_empty(&rdp->nxtlist)) || - cpu_isset(cpu, rcp->rcu_cpu_mask)) + cpu_isset(cpu, rcp->rcu_cpu_mask) || + (!list_empty(&rdp->donelist) && RCU_plugticks(cpu) == 0)) return 1; else return 0; diff -puN kernel/rcupdate.c~rs-throttle-rcu kernel/rcupdate.c --- linux-2.6.4-rcu/kernel/rcupdate.c~rs-throttle-rcu 2004-04-06 02:05:13.000000000 +0530 +++ linux-2.6.4-rcu-dipankar/kernel/rcupdate.c 2004-04-06 02:47:10.000000000 +0530 @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,10 @@ DEFINE_PER_CPU(struct rcu_data, rcu_bh_d /* Fake initialization required by compiler */ static DEFINE_PER_CPU(struct tasklet_struct, rcu_tasklet) = {NULL}; #define RCU_tasklet(cpu) (per_cpu(rcu_tasklet, cpu)) +DEFINE_PER_CPU(int, rcu_plugticks) = 0; + +static int maxbatch = 1000000; +static int plugticks = 4; /** * call_rcu - Queue an RCU update request. @@ -112,16 +117,23 @@ void call_rcu_bh(struct rcu_head *head, * Invoke the completed RCU callbacks. They are expected to be in * a per-cpu list. */ -static void rcu_do_batch(struct list_head *list) +static void rcu_do_batch(int cpu, struct list_head *list) { struct list_head *entry; struct rcu_head *head; + int count = 0; while (!list_empty(list)) { entry = list->next; list_del(entry); head = list_entry(entry, struct rcu_head, list); head->func(head->arg); + if (++count >= maxbatch) { + RCU_plugticks(cpu) = plugticks; + if (!RCU_plugticks(cpu)) + tasklet_hi_schedule(&RCU_tasklet(cpu)); + break; + } } } @@ -178,7 +190,7 @@ out_unlock: spin_unlock(&rcp->mutex); } -static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp, +static void __rcu_process_callbacks(int cpu, struct rcu_ctrlblk *rcp, struct rcu_data *rdp) { LIST_HEAD(list); @@ -186,6 +198,7 @@ static void __rcu_process_callbacks(stru if (!list_empty(&rdp->curlist) && rcu_batch_after(rcp->curbatch, rdp->batch)) { list_splice(&rdp->curlist, &list); + list_splice_tail(&rdp->curlist, &rdp->donelist); INIT_LIST_HEAD(&rdp->curlist); } @@ -206,13 +219,13 @@ static void __rcu_process_callbacks(stru local_irq_enable(); } rcu_check_quiescent_state(rcp, rdp); - if (!list_empty(&list)) - rcu_do_batch(&list); + if (!list_empty(&rdp->donelist) && !RCU_plugticks(cpu)) + rcu_do_batch(cpu, &rdp->donelist); } void rcu_process_callbacks_bh(int cpu) { - __rcu_process_callbacks(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu)); + __rcu_process_callbacks(cpu, &rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu)); } /* @@ -221,8 +234,8 @@ void rcu_process_callbacks_bh(int cpu) static void rcu_process_callbacks(unsigned long unused) { int cpu = smp_processor_id(); - __rcu_process_callbacks(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)); - __rcu_process_callbacks(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu)); + __rcu_process_callbacks(cpu, &rcu_ctrlblk, &per_cpu(rcu_data, cpu)); + __rcu_process_callbacks(cpu, &rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu)); } void rcu_check_callbacks(int cpu, int user) @@ -234,7 +247,7 @@ void rcu_check_callbacks(int cpu, int us RCU_bh_qsctr(cpu)++; } else if (!in_softirq()) RCU_bh_qsctr(cpu)++; - tasklet_schedule(&RCU_tasklet(cpu)); + tasklet_hi_schedule(&RCU_tasklet(cpu)); } static void __devinit rcu_online_cpu(struct rcu_data *rdp) @@ -242,6 +255,7 @@ static void __devinit rcu_online_cpu(str memset(rdp, 0, sizeof(*rdp)); INIT_LIST_HEAD(&rdp->nxtlist); INIT_LIST_HEAD(&rdp->curlist); + INIT_LIST_HEAD(&rdp->donelist); } static int __devinit rcu_cpu_notify(struct notifier_block *self, @@ -277,6 +291,7 @@ void __init rcu_init(void) (void *)(long)smp_processor_id()); /* Register notifier for non-boot CPUs */ register_cpu_notifier(&rcu_nb); + printk("RCU: maxbatch = %d, plugticks = %d\n", maxbatch, plugticks); } @@ -302,6 +317,8 @@ void synchronize_kernel(void) wait_for_completion(&completion); } +module_param(maxbatch, int, 0); +module_param(plugticks, int, 0); EXPORT_SYMBOL(call_rcu); EXPORT_SYMBOL(call_rcu_bh); diff -puN kernel/sched.c~rs-throttle-rcu kernel/sched.c --- linux-2.6.4-rcu/kernel/sched.c~rs-throttle-rcu 2004-04-06 02:05:13.000000000 +0530 +++ linux-2.6.4-rcu-dipankar/kernel/sched.c 2004-04-06 02:05:13.000000000 +0530 @@ -1486,6 +1486,8 @@ void scheduler_tick(int user_ticks, int if (rcu_pending(cpu)) rcu_check_callbacks(cpu, user_ticks); + if (RCU_plugticks(cpu)) + RCU_plugticks(cpu)--; /* note: this timer irq context must be accounted for as well */ if (hardirq_count() - HARDIRQ_OFFSET) { _ From brazilnut@us.ibm.com Mon Apr 5 14:28:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 14:28:17 -0700 (PDT) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.130]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35LSDKO025531 for ; Mon, 5 Apr 2004 14:28:13 -0700 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e32.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i35LS6ih700038; Mon, 5 Apr 2004 17:28:06 -0400 Received: from DYN318364BLD.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i35LS4ZA076454; Mon, 5 Apr 2004 15:28:05 -0600 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i35LRxW11003; Mon, 5 Apr 2004 14:27:59 -0700 From: Don Fry Message-Id: <200404052127.i35LRxW11003@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.6.5 3/4] pcnet32 correct name display To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Mon, 5 Apr 2004 14:27:59 -0700 (PDT) X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 4483 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brazilnut@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 522 Lines: 18 This displays the device name (eth%d) instead of the device type when registering the interrupt handler. --- linux-2.6.5/drivers/net/print.pcnet32.c Mon Apr 5 11:48:47 2004 +++ linux-2.6.5/drivers/net/pcnet32.c Mon Apr 5 11:48:56 2004 @@ -1180,7 +1180,7 @@ if (dev->irq == 0 || request_irq(dev->irq, &pcnet32_interrupt, - lp->shared_irq ? SA_SHIRQ : 0, lp->name, (void *)dev)) { + lp->shared_irq ? SA_SHIRQ : 0, dev->name, (void *)dev)) { return -EAGAIN; } -- Don Fry brazilnut@us.ibm.com From brazilnut@us.ibm.com Mon Apr 5 14:29:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 14:29:27 -0700 (PDT) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.101]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35LTOKO025877 for ; Mon, 5 Apr 2004 14:29:24 -0700 Received: from northrelay04.pok.ibm.com (northrelay04.pok.ibm.com [9.56.224.206]) by e1.ny.us.ibm.com (8.12.10/NS PXFA) with ESMTP id i35LTHFe416386; Mon, 5 Apr 2004 17:29:17 -0400 Received: from DYN318364BLD.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i35LTbrU103564; Mon, 5 Apr 2004 17:29:38 -0400 Received: (from donf@localhost) by DYN318364BLD.beaverton.ibm.com (8.11.6/8.11.6) id i35LTBY11014; Mon, 5 Apr 2004 14:29:11 -0700 From: Don Fry Message-Id: <200404052129.i35LTBY11014@DYN318364BLD.beaverton.ibm.com> Subject: [PATCH 2.6.5 4/4] pcnet32 add led blink capability To: tsbogend@alpha.franken.de, jgarzik@pobox.com, netdev@oss.sgi.com Date: Mon, 5 Apr 2004 14:29:11 -0700 (PDT) X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 4484 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: brazilnut@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 3825 Lines: 125 Please apply this patch to 2.6.5 to include the capability of blinking the LED's for device identification. Ethtool -p support. --- linux-2.6.5/drivers/net/mac.pcnet32.c Mon Apr 5 13:37:22 2004 +++ linux-2.6.5/drivers/net/pcnet32.c Mon Apr 5 13:37:44 2004 @@ -102,6 +102,7 @@ #define PCNET32_DMA_MASK 0xffffffff #define PCNET32_WATCHDOG_TIMEOUT (jiffies + (2 * HZ)) +#define PCNET32_BLINK_TIMEOUT (jiffies + (HZ/4)) /* * table to translate option values from tulip @@ -232,6 +233,8 @@ * length errors, and transmit hangs. Cleans up after errors in open. * Jim Lewis added ethernet loopback test. * Thomas Munck Steenholdt non-mii ioctl corrections. + * v1.29 6 Apr 2004 Jim Lewis added physical + * identification code (blink led's). */ @@ -342,6 +345,7 @@ struct net_device *next; struct mii_if_info mii_if; struct timer_list watchdog_timer; + struct timer_list blink_timer; u32 msg_enable; /* debug message level */ }; @@ -365,6 +369,8 @@ static void pcnet32_ethtool_test(struct net_device *dev, struct ethtool_test *eth_test, u64 *data); static int pcnet32_loopback_test(struct net_device *dev, uint64_t *data1); +static int pcnet32_phys_id(struct net_device *dev, u32 data); +static void pcnet32_led_blink_callback(struct net_device *dev); enum pci_flags_bit { PCI_USES_IO=1, PCI_USES_MEM=2, PCI_USES_MASTER=4, @@ -746,6 +752,63 @@ return(rc); } /* end pcnet32_loopback_test */ +static void pcnet32_led_blink_callback(struct net_device *dev) +{ + struct pcnet32_private *lp = dev->priv; + struct pcnet32_access *a = &lp->a; + ulong ioaddr = dev->base_addr; + unsigned long flags; + int i; + + spin_lock_irqsave(&lp->lock, flags); + for (i=4; i<8; i++) { + a->write_bcr(ioaddr, i, a->read_bcr(ioaddr, i) ^ 0x4000); + } + spin_unlock_irqrestore(&lp->lock, flags); + + mod_timer(&lp->blink_timer, PCNET32_BLINK_TIMEOUT); +} + +static int pcnet32_phys_id(struct net_device *dev, u32 data) +{ + struct pcnet32_private *lp = dev->priv; + struct pcnet32_access *a = &lp->a; + ulong ioaddr = dev->base_addr; + unsigned long flags; + int i, regs[4]; + + if (!lp->blink_timer.function) { + init_timer(&lp->blink_timer); + lp->blink_timer.function = (void *) pcnet32_led_blink_callback; + lp->blink_timer.data = (unsigned long) dev; + } + + /* Save the current value of the bcrs */ + spin_lock_irqsave(&lp->lock, flags); + for (i=4; i<8; i++) { + regs[i-4] = a->read_bcr(ioaddr, i); + } + spin_unlock_irqrestore(&lp->lock, flags); + + mod_timer(&lp->blink_timer, jiffies); + set_current_state(TASK_INTERRUPTIBLE); + + if ((!data) || (data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))) + data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); + + schedule_timeout(data * HZ); + del_timer_sync(&lp->blink_timer); + + /* Restore the original value of the bcrs */ + spin_lock_irqsave(&lp->lock, flags); + for (i=4; i<8; i++) { + a->write_bcr(ioaddr, i, regs[i-4]); + } + spin_unlock_irqrestore(&lp->lock, flags); + + return 0; +} + static struct ethtool_ops pcnet32_ethtool_ops = { .get_settings = pcnet32_get_settings, .set_settings = pcnet32_set_settings, @@ -761,6 +824,7 @@ .get_strings = pcnet32_get_strings, .self_test_count = pcnet32_self_test_count, .self_test = pcnet32_ethtool_test, + .phys_id = pcnet32_phys_id, }; /* only probes for non-PCI devices, the rest are handled by @@ -1152,6 +1216,9 @@ if (pcnet32_debug & NETIF_MSG_PROBE) printk(KERN_INFO "%s: registered as %s\n", dev->name, lp->name); cards_found++; + + a->write_bcr(ioaddr, 2, 0x1002); /* enable LED writes */ + return 0; err_free_consistent: -- Don Fry brazilnut@us.ibm.com From davem@redhat.com Mon Apr 5 14:43:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 14:43:55 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35LhoKO026447 for ; Mon, 5 Apr 2004 14:43:53 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i35Lhi5D002158; Mon, 5 Apr 2004 17:43:44 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i35Lhij07492; Mon, 5 Apr 2004 17:43:44 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i35Lh51n007308; Mon, 5 Apr 2004 17:43:20 -0400 Date: Mon, 5 Apr 2004 14:42:13 -0700 From: "David S. Miller" To: Shirley Ma Cc: xma@us.ibm.com, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com, yoshfuji@cerberus.hongo.wide.ad.jp Subject: Re: [PATCH]dump interface IPv6 multicast/anycast addresses through netlink Message-Id: <20040405144213.198f76ea.davem@redhat.com> In-Reply-To: <200404051351.09740.mashirle@us.ibm.com> References: <200404011028.13048.mashirle@us.ibm.com> <20040403144540.7f201bc1.davem@redhat.com> <200404051351.09740.mashirle@us.ibm.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4485 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@redhat.com Precedence: bulk X-list: netdev Content-Length: 280 Lines: 8 On Mon, 5 Apr 2004 13:51:09 -0700 Shirley Ma wrote: > Dumping multicast/anycast api was removed in Linux 2.6.5 kernel, so it > couldn't be applied cleanly. > I recreated the patch. This patch has been tested against linux-2.6.5 kernel. Applied, thank you. From romieu@fr.zoreil.com Mon Apr 5 14:57:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 14:57:30 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35LvPKO027044 for ; Mon, 5 Apr 2004 14:57:26 -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 i35Ltjgf023435; Mon, 5 Apr 2004 23:55:45 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i35LtjfR023434; Mon, 5 Apr 2004 23:55:45 +0200 Date: Mon, 5 Apr 2004 23:55:45 +0200 From: Francois Romieu To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [patch 0/7] 2.6.5-bk-netdev - r8169 queue Message-ID: <20040405235545.A20805@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Organisation: Land of Sunshine Inc. X-archive-position: 4487 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 935 Lines: 34 No ack for previous patches. Try #2. The following serie of patches applies against 2.6.5 + bk-netdev (as found in 2.6.5-mm1 for instance). It contains: - r8169-dma-api-resync.patch resync with the recent DMA api changes (pci_dma_sync_single_for_{cpu/device}) - r8169-ethtool-introduction.patch lightweight ethtool support - r8169-missing-static.patch missing 'static' qualifiers - r8169-barrier.patch safety rmb() - r8169-kill-potential-busy-loop.patch A similar patch exists in -mm. I like mine better. - r8169-dac-00.patch DMA_{32/64}_BIT_MASK thing against include/linux/dma-mapping.h - r8169-dac-10.patch DAC changes for (as of now even more) happy owners of x86-64. It seems to work. An update of the patch against 2.6.5 is available for testers at: http://www.fr.zoreil.com/people/francois/misc/20040405-2.6.5-r8169.c-stable.patch The link loss issue when cable is unplugged is on the TODO. -- Ueimor From romieu@fr.zoreil.com Mon Apr 5 14:57:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 14:57:29 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35LvPKO027045 for ; Mon, 5 Apr 2004 14:57:26 -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 i35Lumgf023441; Mon, 5 Apr 2004 23:56:48 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i35LumoV023440; Mon, 5 Apr 2004 23:56:48 +0200 Date: Mon, 5 Apr 2004 23:56:48 +0200 From: Francois Romieu To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [patch 1/7] 2.6.5-bk-netdev - r8169 queue Message-ID: <20040405235648.A23436@electric-eye.fr.zoreil.com> References: <20040405235545.A20805@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040405235545.A20805@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Mon, Apr 05, 2004 at 11:55:45PM +0200 X-Organisation: Land of Sunshine Inc. X-archive-position: 4486 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 1370 Lines: 42 DMA api resync. drivers/net/r8169.c | 17 ++++++++++------- 1 files changed, 10 insertions(+), 7 deletions(-) diff -puN drivers/net/r8169.c~r8169-dma-api-resync drivers/net/r8169.c --- linux-2.6.5/drivers/net/r8169.c~r8169-dma-api-resync 2004-04-05 23:05:27.000000000 +0200 +++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-05 23:05:27.000000000 +0200 @@ -1429,19 +1429,22 @@ rtl8169_rx_interrupt(struct net_device * struct RxDesc *desc = tp->RxDescArray + entry; struct sk_buff *skb = tp->Rx_skbuff[entry]; int pkt_size = (status & 0x00001FFF) - 4; + void (*pci_action)(struct pci_dev *, dma_addr_t, + size_t, int) = pci_dma_sync_single_for_device; - pci_dma_sync_single(tp->pci_dev, - le32_to_cpu(desc->buf_addr), - RX_BUF_SIZE, PCI_DMA_FROMDEVICE); + + pci_dma_sync_single_for_cpu(tp->pci_dev, + le32_to_cpu(desc->buf_addr), RX_BUF_SIZE, + PCI_DMA_FROMDEVICE); if (rtl8169_try_rx_copy(&skb, pkt_size, desc, dev)) { - pci_unmap_single(tp->pci_dev, - le32_to_cpu(desc->buf_addr), - RX_BUF_SIZE, - PCI_DMA_FROMDEVICE); + pci_action = pci_unmap_single; tp->Rx_skbuff[entry] = NULL; } + pci_action(tp->pci_dev, le32_to_cpu(desc->buf_addr), + RX_BUF_SIZE, PCI_DMA_FROMDEVICE); + skb_put(skb, pkt_size); skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); _ From romieu@fr.zoreil.com Mon Apr 5 15:01:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 15:01:34 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35M1RKO027763 for ; Mon, 5 Apr 2004 15:01:28 -0700 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.8/8.12.1) with ESMTP id i35Lxxgf023508; Mon, 5 Apr 2004 23:59:59 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i35LxxOW023507; Mon, 5 Apr 2004 23:59:59 +0200 Date: Mon, 5 Apr 2004 23:59:59 +0200 From: Francois Romieu To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [patch 6/7] 2.6.5-bk-netdev - r8169 queue Message-ID: <20040405235959.F23436@electric-eye.fr.zoreil.com> References: <20040405235545.A20805@electric-eye.fr.zoreil.com> <20040405235648.A23436@electric-eye.fr.zoreil.com> <20040405235726.B23436@electric-eye.fr.zoreil.com> <20040405235802.C23436@electric-eye.fr.zoreil.com> <20040405235844.D23436@electric-eye.fr.zoreil.com> <20040405235929.E23436@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040405235929.E23436@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Mon, Apr 05, 2004 at 11:59:29PM +0200 X-Organisation: Land of Sunshine Inc. X-archive-position: 4491 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 598 Lines: 22 DMA_{32/64}BIT_MASK for all. include/linux/dma-mapping.h | 3 +++ 1 files changed, 3 insertions(+) diff -puN include/linux/dma-mapping.h~r8169-dac-00 include/linux/dma-mapping.h --- linux-2.6.5/include/linux/dma-mapping.h~r8169-dac-00 2004-04-05 23:06:28.000000000 +0200 +++ linux-2.6.5-fr/include/linux/dma-mapping.h 2004-04-05 23:06:28.000000000 +0200 @@ -10,6 +10,9 @@ enum dma_data_direction { DMA_NONE = 3, }; +#define DMA_64BIT_MASK 0xffffffffffffffffULL +#define DMA_32BIT_MASK 0x00000000ffffffffULL + #include /* Backwards compat, remove in 2.7.x */ _ From romieu@fr.zoreil.com Mon Apr 5 15:01:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 15:01:34 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35M1RKO027764 for ; Mon, 5 Apr 2004 15:01:28 -0700 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.8/8.12.1) with ESMTP id i35M0qgf023534; Tue, 6 Apr 2004 00:00:52 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i35M0q36023533; Tue, 6 Apr 2004 00:00:52 +0200 Date: Tue, 6 Apr 2004 00:00:52 +0200 From: Francois Romieu To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [patch 7/7] 2.6.5-bk-netdev - r8169 queue Message-ID: <20040406000052.G23436@electric-eye.fr.zoreil.com> References: <20040405235545.A20805@electric-eye.fr.zoreil.com> <20040405235648.A23436@electric-eye.fr.zoreil.com> <20040405235726.B23436@electric-eye.fr.zoreil.com> <20040405235802.C23436@electric-eye.fr.zoreil.com> <20040405235844.D23436@electric-eye.fr.zoreil.com> <20040405235929.E23436@electric-eye.fr.zoreil.com> <20040405235959.F23436@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040405235959.F23436@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Mon, Apr 05, 2004 at 11:59:59PM +0200 X-Organisation: Land of Sunshine Inc. X-archive-position: 4492 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 5792 Lines: 194 DAC changes: - Rx and Tx descriptors rings handled on 64 bit; - enable DAC through use of CPlusCmd register (reserved bits apart, this is similar to the 8139cp driver); - use the higher 32 bits of addresses for the Rx/Tx buffers. linux/dma-mapping.h | 0 drivers/net/r8169.c | 66 ++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 46 insertions(+), 20 deletions(-) diff -puN drivers/net/r8169.c~r8169-dac-10 drivers/net/r8169.c --- linux-2.6.5/drivers/net/r8169.c~r8169-dac-10 2004-04-05 23:06:48.000000000 +0200 +++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-05 23:06:48.000000000 +0200 @@ -149,8 +149,10 @@ static int rx_copybreak = 200; enum RTL8169_registers { MAC0 = 0, /* Ethernet hardware address. */ MAR0 = 8, /* Multicast filter. */ - TxDescStartAddr = 0x20, - TxHDescStartAddr = 0x28, + TxDescStartAddrLow = 0x20, + TxDescStartAddrHigh = 0x24, + TxHDescStartAddrLow = 0x28, + TxHDescStartAddrHigh = 0x2c, FLASH = 0x30, ERSR = 0x36, ChipCmd = 0x37, @@ -175,7 +177,8 @@ enum RTL8169_registers { PHYstatus = 0x6C, RxMaxSize = 0xDA, CPlusCmd = 0xE0, - RxDescStartAddr = 0xE4, + RxDescAddrLow = 0xE4, + RxDescAddrHigh = 0xE8, EarlyTxThres = 0xEC, FuncEvent = 0xF0, FuncEventMask = 0xF4, @@ -227,7 +230,13 @@ enum RTL8169_register_content { /*TxConfigBits */ TxInterFrameGapShift = 24, - TxDMAShift = 8, /* DMA burst value (0-7) is shift this many bits */ + TxDMAShift = 8, /* DMA burst value (0-7) is shift this many bits */ + + /* CPlusCmd p.31 */ + RxVlan = (1 << 6), + RxChkSum = (1 << 5), + PCIDAC = (1 << 4), + PCIMulRW = (1 << 3), /*rtl8169_PHYstatus */ TBI_Enable = 0x80, @@ -286,15 +295,13 @@ enum _DescStatusBit { struct TxDesc { u32 status; u32 vlan_tag; - u32 buf_addr; - u32 buf_Haddr; + u64 addr; }; struct RxDesc { u32 status; u32 vlan_tag; - u32 buf_addr; - u32 buf_Haddr; + u64 addr; }; struct rtl8169_private { @@ -317,6 +324,7 @@ struct rtl8169_private { struct sk_buff *Tx_skbuff[NUM_TX_DESC]; /* Index of Transmit data buffer */ struct timer_list timer; unsigned long phy_link_down_cnt; + u16 cp_cmd; }; MODULE_AUTHOR("Realtek"); @@ -713,6 +721,20 @@ rtl8169_init_board(struct pci_dev *pdev, goto err_out_disable; } + tp->cp_cmd = PCIMulRW | RxChkSum; + + if ((sizeof(dma_addr_t) > 32) && + !pci_set_dma_mask(pdev, DMA_64BIT_MASK)) + tp->cp_cmd |= PCIDAC; + else { + rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); + if (rc < 0) { + printk(KERN_ERR PFX "DMA configuration failed.\n"); + goto err_out_free_res; + } + } + + // enable PCI bus-mastering pci_set_master(pdev); @@ -1099,17 +1121,21 @@ rtl8169_hw_start(struct net_device *dev) RTL_W32(TxConfig, (TX_DMA_BURST << TxDMAShift) | (InterFrameGap << TxInterFrameGapShift)); - RTL_W16(CPlusCmd, RTL_R16(CPlusCmd)); + tp->cp_cmd |= RTL_R16(CPlusCmd); + RTL_W16(CPlusCmd, tp->cp_cmd); if (tp->mac_version == RTL_GIGA_MAC_VER_D) { dprintk(KERN_INFO PFX "Set MAC Reg C+CR Offset 0xE0: bit-3 and bit-14 MUST be 1\n"); - RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) | (1 << 14) | (1 << 3)); + tp->cp_cmd |= (1 << 14) | PCIMulRW; + RTL_W16(CPlusCmd, tp->cp_cmd); } tp->cur_rx = 0; - RTL_W32(TxDescStartAddr, tp->TxPhyAddr); - RTL_W32(RxDescStartAddr, tp->RxPhyAddr); + RTL_W32(TxDescStartAddrLow, ((u64) tp->TxPhyAddr & DMA_32BIT_MASK)); + RTL_W32(TxDescStartAddrHigh, ((u64) tp->TxPhyAddr >> 32)); + RTL_W32(RxDescAddrLow, ((u64) tp->RxPhyAddr & DMA_32BIT_MASK)); + RTL_W32(RxDescAddrHigh, ((u64) tp->RxPhyAddr >> 32)); RTL_W8(Cfg9346, Cfg9346_Lock); udelay(10); @@ -1129,14 +1155,14 @@ rtl8169_hw_start(struct net_device *dev) static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc) { - desc->buf_addr = 0xdeadbeef; + desc->addr = 0x0badbadbadbadbad; desc->status &= ~cpu_to_le32(OWNbit | RsvdMask); } static void rtl8169_free_rx_skb(struct pci_dev *pdev, struct sk_buff **sk_buff, struct RxDesc *desc) { - pci_unmap_single(pdev, le32_to_cpu(desc->buf_addr), RX_BUF_SIZE, + pci_unmap_single(pdev, le64_to_cpu(desc->addr), RX_BUF_SIZE, PCI_DMA_FROMDEVICE); dev_kfree_skb(*sk_buff); *sk_buff = NULL; @@ -1150,7 +1176,7 @@ static inline void rtl8169_return_to_asi static inline void rtl8169_give_to_asic(struct RxDesc *desc, dma_addr_t mapping) { - desc->buf_addr = cpu_to_le32(mapping); + desc->addr = cpu_to_le64(mapping); desc->status |= cpu_to_le32(OWNbit + RX_BUF_SIZE); } @@ -1248,9 +1274,9 @@ static void rtl8169_unmap_tx_skb(struct { u32 len = sk_buff[0]->len; - pci_unmap_single(pdev, le32_to_cpu(desc->buf_addr), + pci_unmap_single(pdev, le64_to_cpu(desc->addr), len < ETH_ZLEN ? ETH_ZLEN : len, PCI_DMA_TODEVICE); - desc->buf_addr = 0x00; + desc->addr = 0x00; *sk_buff = NULL; } @@ -1322,7 +1348,7 @@ rtl8169_start_xmit(struct sk_buff *skb, PCI_DMA_TODEVICE); tp->Tx_skbuff[entry] = skb; - tp->TxDescArray[entry].buf_addr = cpu_to_le32(mapping); + tp->TxDescArray[entry].addr = cpu_to_le64(mapping); tp->TxDescArray[entry].status = cpu_to_le32(OWNbit | FSbit | LSbit | len | (EORbit * !((entry + 1) % NUM_TX_DESC))); @@ -1454,7 +1480,7 @@ rtl8169_rx_interrupt(struct net_device * pci_dma_sync_single_for_cpu(tp->pci_dev, - le32_to_cpu(desc->buf_addr), RX_BUF_SIZE, + le64_to_cpu(desc->addr), RX_BUF_SIZE, PCI_DMA_FROMDEVICE); if (rtl8169_try_rx_copy(&skb, pkt_size, desc, dev)) { @@ -1462,7 +1488,7 @@ rtl8169_rx_interrupt(struct net_device * tp->Rx_skbuff[entry] = NULL; } - pci_action(tp->pci_dev, le32_to_cpu(desc->buf_addr), + pci_action(tp->pci_dev, le64_to_cpu(desc->addr), RX_BUF_SIZE, PCI_DMA_FROMDEVICE); skb_put(skb, pkt_size); diff -puN include/linux/dma-mapping.h~r8169-dac-10 include/linux/dma-mapping.h _ From romieu@fr.zoreil.com Mon Apr 5 15:01:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 15:01:33 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35M1QKO027759 for ; Mon, 5 Apr 2004 15:01:27 -0700 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.8/8.12.1) with ESMTP id i35Lwigf023499; Mon, 5 Apr 2004 23:58:44 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i35Lwiq5023498; Mon, 5 Apr 2004 23:58:44 +0200 Date: Mon, 5 Apr 2004 23:58:44 +0200 From: Francois Romieu To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [patch 4/7] 2.6.5-bk-netdev - r8169 queue Message-ID: <20040405235844.D23436@electric-eye.fr.zoreil.com> References: <20040405235545.A20805@electric-eye.fr.zoreil.com> <20040405235648.A23436@electric-eye.fr.zoreil.com> <20040405235726.B23436@electric-eye.fr.zoreil.com> <20040405235802.C23436@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040405235802.C23436@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Mon, Apr 05, 2004 at 11:58:02PM +0200 X-Organisation: Land of Sunshine Inc. X-archive-position: 4489 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 915 Lines: 32 Barrier against compiler optimization. drivers/net/r8169.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletion(-) diff -puN drivers/net/r8169.c~r8169-barrier drivers/net/r8169.c --- linux-2.6.5/drivers/net/r8169.c~r8169-barrier 2004-04-05 23:06:04.000000000 +0200 +++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-05 23:06:04.000000000 +0200 @@ -1367,6 +1367,7 @@ rtl8169_tx_interrupt(struct net_device * while (tx_left > 0) { int entry = dirty_tx % NUM_TX_DESC; + rmb(); if (!(le32_to_cpu(tp->TxDescArray[entry].status) & OWNbit)) { struct sk_buff *skb = tp->Tx_skbuff[entry]; @@ -1428,7 +1429,10 @@ rtl8169_rx_interrupt(struct net_device * while (rx_left > 0) { int entry = cur_rx % NUM_RX_DESC; - u32 status = le32_to_cpu(tp->RxDescArray[entry].status); + u32 status; + + rmb(); + status = le32_to_cpu(tp->RxDescArray[entry].status); if (status & OWNbit) break; _ From romieu@fr.zoreil.com Mon Apr 5 15:01:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 15:01:34 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35M1QKO027762 for ; Mon, 5 Apr 2004 15:01:27 -0700 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.8/8.12.1) with ESMTP id i35LxTgf023503; Mon, 5 Apr 2004 23:59:29 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i35LxT4X023502; Mon, 5 Apr 2004 23:59:29 +0200 Date: Mon, 5 Apr 2004 23:59:29 +0200 From: Francois Romieu To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [patch 5/7] 2.6.5-bk-netdev - r8169 queue Message-ID: <20040405235929.E23436@electric-eye.fr.zoreil.com> References: <20040405235545.A20805@electric-eye.fr.zoreil.com> <20040405235648.A23436@electric-eye.fr.zoreil.com> <20040405235726.B23436@electric-eye.fr.zoreil.com> <20040405235802.C23436@electric-eye.fr.zoreil.com> <20040405235844.D23436@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040405235844.D23436@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Mon, Apr 05, 2004 at 11:58:44PM +0200 X-Organisation: Land of Sunshine Inc. X-archive-position: 4490 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 1765 Lines: 53 If a few packets have been scheduled for Tx, it is possible to keep looping in the Tx irq handler as soon as the irq for the first packet has been received until the descriptor of the last packet has been sent (with interrupts disabled btw). drivers/net/r8169.c | 28 +++++++++++++++------------- 1 files changed, 15 insertions(+), 13 deletions(-) diff -puN drivers/net/r8169.c~r8169-kill-potential-busy-loop drivers/net/r8169.c --- linux-2.6.5/drivers/net/r8169.c~r8169-kill-potential-busy-loop 2004-04-05 23:06:15.000000000 +0200 +++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-05 23:06:15.000000000 +0200 @@ -1366,22 +1366,24 @@ rtl8169_tx_interrupt(struct net_device * while (tx_left > 0) { int entry = dirty_tx % NUM_TX_DESC; + struct sk_buff *skb = tp->Tx_skbuff[entry]; + u32 status; rmb(); - if (!(le32_to_cpu(tp->TxDescArray[entry].status) & OWNbit)) { - struct sk_buff *skb = tp->Tx_skbuff[entry]; + status = le32_to_cpu(tp->TxDescArray[entry].status); + if (status & OWNbit) + break; - /* FIXME: is it really accurate for TxErr ? */ - tp->stats.tx_bytes += skb->len >= ETH_ZLEN ? - skb->len : ETH_ZLEN; - tp->stats.tx_packets++; - rtl8169_unmap_tx_skb(tp->pci_dev, tp->Tx_skbuff + entry, - tp->TxDescArray + entry); - dev_kfree_skb_irq(skb); - tp->Tx_skbuff[entry] = NULL; - dirty_tx++; - tx_left--; - } + /* FIXME: is it really accurate for TxErr ? */ + tp->stats.tx_bytes += skb->len >= ETH_ZLEN ? + skb->len : ETH_ZLEN; + tp->stats.tx_packets++; + rtl8169_unmap_tx_skb(tp->pci_dev, tp->Tx_skbuff + entry, + tp->TxDescArray + entry); + dev_kfree_skb_irq(skb); + tp->Tx_skbuff[entry] = NULL; + dirty_tx++; + tx_left--; } if (tp->dirty_tx != dirty_tx) { _ From romieu@fr.zoreil.com Mon Apr 5 15:01:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 15:01:32 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35M1QKO027761 for ; Mon, 5 Apr 2004 15:01:27 -0700 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.8/8.12.1) with ESMTP id i35Lw2gf023466; Mon, 5 Apr 2004 23:58:02 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i35Lw24I023465; Mon, 5 Apr 2004 23:58:02 +0200 Date: Mon, 5 Apr 2004 23:58:02 +0200 From: Francois Romieu To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [patch 3/7] 2.6.5-bk-netdev - r8169 queue Message-ID: <20040405235802.C23436@electric-eye.fr.zoreil.com> References: <20040405235545.A20805@electric-eye.fr.zoreil.com> <20040405235648.A23436@electric-eye.fr.zoreil.com> <20040405235726.B23436@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040405235726.B23436@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Mon, Apr 05, 2004 at 11:57:26PM +0200 X-Organisation: Land of Sunshine Inc. X-archive-position: 4488 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 1246 Lines: 42 Missing 'static' qualifier for functions. drivers/net/r8169.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff -puN drivers/net/r8169.c~r8169-missing-static drivers/net/r8169.c --- linux-2.6.5/drivers/net/r8169.c~r8169-missing-static 2004-04-05 23:05:53.000000000 +0200 +++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-05 23:05:53.000000000 +0200 @@ -346,8 +346,7 @@ static const unsigned int rtl8169_rx_con #define PHY_Cap_100_Half_Or_Less PHY_Cap_100_Half | PHY_Cap_10_Full_Or_Less #define PHY_Cap_100_Full_Or_Less PHY_Cap_100_Full | PHY_Cap_100_Half_Or_Less -void -mdio_write(void *ioaddr, int RegAddr, int value) +static void mdio_write(void *ioaddr, int RegAddr, int value) { int i; @@ -364,8 +363,7 @@ mdio_write(void *ioaddr, int RegAddr, in } } -int -mdio_read(void *ioaddr, int RegAddr) +static int mdio_read(void *ioaddr, int RegAddr) { int i, value = -1; @@ -1642,8 +1640,7 @@ rtl8169_set_rx_mode(struct net_device *d * * Get TX/RX statistics for rtl8169 */ -struct net_device_stats * -rtl8169_get_stats(struct net_device *dev) +static struct net_device_stats *rtl8169_get_stats(struct net_device *dev) { struct rtl8169_private *tp = dev->priv; void *ioaddr = tp->mmio_addr; _ From romieu@fr.zoreil.com Mon Apr 5 15:01:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 15:01:36 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35M1QKO027760 for ; Mon, 5 Apr 2004 15:01:27 -0700 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.8/8.12.1) with ESMTP id i35LvRgf023462; Mon, 5 Apr 2004 23:57:27 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i35LvR0r023461; Mon, 5 Apr 2004 23:57:27 +0200 Date: Mon, 5 Apr 2004 23:57:26 +0200 From: Francois Romieu To: Jeff Garzik Cc: netdev@oss.sgi.com Subject: [patch 2/7] 2.6.5-bk-netdev - r8169 queue Message-ID: <20040405235726.B23436@electric-eye.fr.zoreil.com> References: <20040405235545.A20805@electric-eye.fr.zoreil.com> <20040405235648.A23436@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040405235648.A23436@electric-eye.fr.zoreil.com>; from romieu@fr.zoreil.com on Mon, Apr 05, 2004 at 11:56:48PM +0200 X-Organisation: Land of Sunshine Inc. X-archive-position: 4493 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 1511 Lines: 50 ethtool driver info (Krishnakumar R. ). drivers/net/r8169.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) diff -puN drivers/net/r8169.c~r8169-ethtool-introduction drivers/net/r8169.c --- linux-2.6.5/drivers/net/r8169.c~r8169-ethtool-introduction 2004-04-05 23:05:42.000000000 +0200 +++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-05 23:05:42.000000000 +0200 @@ -40,6 +40,7 @@ VERSION 1.2 <2002/11/30> #include #include #include +#include #include #include @@ -382,6 +383,20 @@ mdio_read(void *ioaddr, int RegAddr) return value; } +static void rtl8169_get_drvinfo(struct net_device *dev, + struct ethtool_drvinfo *info) +{ + struct rtl8169_private *tp = dev->priv; + + strcpy(info->driver, RTL8169_DRIVER_NAME); + strcpy(info->version, RTL8169_VERSION ); + strcpy(info->bus_info, pci_name(tp->pci_dev)); +} + +static struct ethtool_ops rtl8169_ethtool_ops = { + .get_drvinfo = rtl8169_get_drvinfo, +}; + static void rtl8169_write_gmii_reg_bit(void *ioaddr, int reg, int bitnum, int bitval) { @@ -793,6 +808,7 @@ rtl8169_init_one(struct pci_dev *pdev, c dev->open = rtl8169_open; dev->hard_start_xmit = rtl8169_start_xmit; dev->get_stats = rtl8169_get_stats; + dev->ethtool_ops = &rtl8169_ethtool_ops; dev->stop = rtl8169_close; dev->tx_timeout = rtl8169_tx_timeout; dev->set_multicast_list = rtl8169_set_rx_mode; _ From davem@redhat.com Mon Apr 5 15:24:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 15:24:50 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35MOmKO030052 for ; Mon, 5 Apr 2004 15:24:48 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i35MOg5D017835; Mon, 5 Apr 2004 18:24:42 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i35MOgj29124; Mon, 5 Apr 2004 18:24:42 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i35MOH1n001914; Mon, 5 Apr 2004 18:24:18 -0400 Date: Mon, 5 Apr 2004 15:23:25 -0700 From: "David S. Miller" To: "Randy.Dunlap" Cc: netdev@oss.sgi.com, benh@kernel.crashing.org Subject: Re: [PATCH] update networking config menu (v3) Message-Id: <20040405152325.658503fe.davem@redhat.com> In-Reply-To: <20040404200354.50e5dd74.rddunlap@osdl.org> References: <20040404200354.50e5dd74.rddunlap@osdl.org> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4494 X-ecartis-version: Ecartis v1.0.0 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: 41 Lines: 2 Looks good to me Randy, applied thanks. From rddunlap@osdl.org Mon Apr 5 16:00:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 16:00:49 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35N0jKO031509 for ; Mon, 5 Apr 2004 16:00:47 -0700 Received: from dragon.pdx.osdl.net (dragon.pdx.osdl.net [172.20.1.27]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id i35N0d203151; Mon, 5 Apr 2004 16:00:39 -0700 Date: Mon, 5 Apr 2004 15:56:54 -0700 From: "Randy.Dunlap" To: netdev Cc: jgarzik Subject: [PATCH] remove magic '31' for netdev priv. alignment Message-Id: <20040405155654.69a9bb4b.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.10 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4495 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 1875 Lines: 60 [resend/rediff] // linux-2.6.5 // remove magic number of '31' from net_device and private alignment; diffstat:= drivers/net/net_init.c | 8 +++++--- include/linux/netdevice.h | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff -Naurp ./drivers/net/net_init.c.orig ./drivers/net/net_init.c --- ./drivers/net/net_init.c.orig 2004-04-03 19:36:16.000000000 -0800 +++ ./drivers/net/net_init.c 2004-04-05 15:46:26.000000000 -0700 @@ -79,8 +79,9 @@ struct net_device *alloc_netdev(int size /* ensure 32-byte alignment of both the device and private area */ - alloc_size = (sizeof(struct net_device) + 31) & ~31; - alloc_size += sizeof_priv + 31; + alloc_size = (sizeof(struct net_device) + NETDEV_ALIGN_CONST) + & ~NETDEV_ALIGN_CONST; + alloc_size += sizeof_priv + NETDEV_ALIGN_CONST; p = kmalloc (alloc_size, GFP_KERNEL); if (!p) { @@ -90,7 +91,8 @@ struct net_device *alloc_netdev(int size memset(p, 0, alloc_size); - dev = (struct net_device *)(((long)p + 31) & ~31); + dev = (struct net_device *)(((long)p + NETDEV_ALIGN_CONST) + & ~NETDEV_ALIGN_CONST); dev->padded = (char *)dev - (char *)p; if (sizeof_priv) diff -Naurp ./include/linux/netdevice.h.orig ./include/linux/netdevice.h --- ./include/linux/netdevice.h.orig 2004-04-03 19:38:18.000000000 -0800 +++ ./include/linux/netdevice.h 2004-04-05 15:46:26.000000000 -0700 @@ -484,9 +484,14 @@ struct net_device int padded; }; +#define NETDEV_ALIGN 32 +#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) + static inline void *netdev_priv(struct net_device *dev) { - return (char *)dev + ((sizeof(struct net_device) + 31) & ~31); + return (char *)dev + ((sizeof(struct net_device) + + NETDEV_ALIGN_CONST) + & ~NETDEV_ALIGN_CONST); } #define SET_MODULE_OWNER(dev) do { } while (0) -- ~Randy "We have met the enemy and he is us." -- Pogo (by Walt Kelly) From rddunlap@osdl.org Mon Apr 5 16:36:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 16:36:33 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35NaUKO003011 for ; Mon, 5 Apr 2004 16:36:30 -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 i35NaP211122; Mon, 5 Apr 2004 16:36:25 -0700 Date: Mon, 5 Apr 2004 16:27:53 -0700 From: "Randy.Dunlap" To: netdev Cc: jgarzik Subject: [janitor] dgrs: add missing iounmaps Message-Id: <20040405162753.7c0c5257.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.10 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4496 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 1262 Lines: 53 [resend] Insert missing iounmap's. From: Leana Ogasawara --- linux-265-kj1-rddunlap/drivers/net/dgrs.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletion(-) diff -puN drivers/net/dgrs.c~dgrs_iounmap drivers/net/dgrs.c --- linux-265-kj1/drivers/net/dgrs.c~dgrs_iounmap 2004-04-05 13:08:11.000000000 -0700 +++ linux-265-kj1-rddunlap/drivers/net/dgrs.c 2004-04-05 13:08:11.000000000 -0700 @@ -327,8 +327,10 @@ check_board_dma(struct net_device *dev0) */ priv0->vplxdma[PLX_DMA0_MODE/4] = 0xFFFFFFFF; x = priv0->vplxdma[PLX_DMA0_MODE/4]; - if (x != 0x00001FFF) + if (x != 0x00001FFF) { + iounmap((void *)priv0->vplxdma); return (0); + } return (1); } @@ -1020,6 +1022,8 @@ dgrs_download(struct net_device *dev0) if (!is) { printk("%s: Illegal IRQ %d\n", dev0->name, dev0->irq); + iounmap(priv0->vmem); + priv0->vmem = NULL; return -ENXIO; } OUTB(dev0->base_addr + ES4H_AS_31_24, @@ -1101,6 +1105,8 @@ dgrs_download(struct net_device *dev0) if (priv0->bcomm->bc_status < BC_RUN) { printk("%s: board not operating\n", dev0->name); + iounmap(priv0->vmem); + priv0->vmem = NULL; return -ENXIO; } _ -- ~Randy "We have met the enemy and he is us." -- Pogo (by Walt Kelly) From rddunlap@osdl.org Mon Apr 5 16:36:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 16:36:35 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i35NaUKO003012 for ; Mon, 5 Apr 2004 16:36:30 -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 i35NaP211126; Mon, 5 Apr 2004 16:36:25 -0700 Date: Mon, 5 Apr 2004 16:29:08 -0700 From: "Randy.Dunlap" To: netdev Cc: jgarzik Subject: [PATCH] lmc header file not needed Message-Id: <20040405162908.68e5aff4.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.10 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4497 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 1073 Lines: 36 From: Domen Puncer --- linux-265-kj1-rddunlap/drivers/net/wan/lmc/lmc_proto.c | 1 - linux-265-kj1/drivers/net/wan/lmc/lmc_proto_raw.h | 4 ---- 2 files changed, 5 deletions(-) diff -puN drivers/net/wan/lmc/lmc_proto.c~lmc_proto_raw_h_rm drivers/net/wan/lmc/lmc_proto.c --- linux-265-kj1/drivers/net/wan/lmc/lmc_proto.c~lmc_proto_raw_h_rm 2004-04-05 13:06:33.000000000 -0700 +++ linux-265-kj1-rddunlap/drivers/net/wan/lmc/lmc_proto.c 2004-04-05 13:06:33.000000000 -0700 @@ -50,7 +50,6 @@ #include "lmc_debug.h" #include "lmc_ioctl.h" #include "lmc_proto.h" -//#include "lmc_proto_raw.h" /* * The compile-time variable SPPPSTUP causes the module to be diff -puN -L drivers/net/wan/lmc/lmc_proto_raw.h drivers/net/wan/lmc/lmc_proto_raw.h~lmc_proto_raw_h_rm /dev/null --- linux-265-kj1/drivers/net/wan/lmc/lmc_proto_raw.h +++ /dev/null 2003-05-01 16:55:24.000000000 -0700 @@ -1,4 +0,0 @@ -#ifndef _LMC_PROTO_RAW_H_ -#define _LMC_PROTO_RAW_H_ - -#endif _ -- ~Randy "We have met the enemy and he is us." -- Pogo (by Walt Kelly) From mashirle@us.ibm.com Mon Apr 5 17:12:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 05 Apr 2004 17:12:36 -0700 (PDT) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.131]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i360CNKO004582 for ; Mon, 5 Apr 2004 17:12:29 -0700 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e33.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i360BX0o039608; Mon, 5 Apr 2004 20:11:33 -0400 Received: from IBM-KHXOIC5VFKN.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i360BRZA088870; Mon, 5 Apr 2004 18:11:28 -0600 From: Shirley Ma To: "David S. Miller" Subject: Fix IPv6 MIBs counters in 2.6.5 kernel Date: Mon, 5 Apr 2004 17:11:27 -0700 User-Agent: KMail/1.5 Cc: xma@us.ibm.com, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com, yoshfuji@cerberus.hongo.wide.ad.jp References: <200404051351.09740.mashirle@us.ibm.com> <20040405144213.198f76ea.davem@redhat.com> In-Reply-To: <20040405144213.198f76ea.davem@redhat.com> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_vWfcAXd3ZEjun88" Message-Id: <200404051711.27188.mashirle@us.ibm.com> X-archive-position: 4498 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mashirle@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 10351 Lines: 362 --Boundary-00=_vWfcAXd3ZEjun88 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline I have fixed IPv6 MIBs counters which don't increase under some cases in linux-2.6.5 kernel. Please review it. -- Thanks Shirley Ma IBM Linux Technology Center --Boundary-00=_vWfcAXd3ZEjun88 Content-Type: text/x-diff; charset="iso-8859-1"; name="linux-2.6.5-oldmibs.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="linux-2.6.5-oldmibs.patch" diff -urN linux-2.6.5/net/ipv6/exthdrs.c linux-2.6.5-oldmibs/net/ipv6/exthdrs.c --- linux-2.6.5/net/ipv6/exthdrs.c 2004-04-03 19:36:15.000000000 -0800 +++ linux-2.6.5-oldmibs/net/ipv6/exthdrs.c 2004-04-05 15:34:44.325848720 -0700 @@ -159,6 +159,7 @@ if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8) || !pskb_may_pull(skb, (skb->h.raw-skb->data)+((skb->h.raw[1]+1)<<3))) { + IP6_INC_STATS_BH(Ip6InHdrErrors); kfree_skb(skb); return -1; } @@ -171,6 +172,7 @@ return 1; } + IP6_INC_STATS_BH(Ip6InHdrErrors); return -1; } @@ -234,6 +236,7 @@ if (ipv6_addr_is_multicast(&skb->nh.ipv6h->daddr) || skb->pkt_type != PACKET_HOST) { + IP6_INC_STATS_BH(Ip6InAddrErrors); kfree_skb(skb); return -1; } @@ -249,11 +252,13 @@ } if (hdr->type != IPV6_SRCRT_TYPE_0) { + IP6_INC_STATS_BH(Ip6InHdrErrors); icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->type) - skb->nh.raw); return -1; } if (hdr->hdrlen & 0x01) { + IP6_INC_STATS_BH(Ip6InHdrErrors); icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->hdrlen) - skb->nh.raw); return -1; } @@ -266,6 +271,7 @@ n = hdr->hdrlen >> 1; if (hdr->segments_left > n) { + IP6_INC_STATS_BH(Ip6InHdrErrors); icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->segments_left) - skb->nh.raw); return -1; } @@ -276,8 +282,11 @@ if (skb_cloned(skb)) { struct sk_buff *skb2 = skb_copy(skb, GFP_ATOMIC); kfree_skb(skb); - if (skb2 == NULL) + /* the copy is a forwarded packet */ + if (skb2 == NULL) { + IP6_INC_STATS_BH(Ip6OutDiscards); return -1; + } *skbp = skb = skb2; opt = (struct inet6_skb_parm *)skb2->cb; hdr = (struct ipv6_rt_hdr *) skb2->h.raw; @@ -293,6 +302,7 @@ addr += i - 1; if (ipv6_addr_is_multicast(addr)) { + IP6_INC_STATS_BH(Ip6InAddrErrors); kfree_skb(skb); return -1; } @@ -309,6 +319,7 @@ } if (skb->dst->dev->flags&IFF_LOOPBACK) { if (skb->nh.ipv6h->hop_limit <= 1) { + IP6_INC_STATS_BH(Ip6InHdrErrors); icmpv6_send(skb, ICMPV6_TIME_EXCEED, ICMPV6_EXC_HOPLIMIT, 0, skb->dev); kfree_skb(skb); @@ -425,15 +436,18 @@ if (skb->nh.raw[optoff+1] != 4 || (optoff&3) != 2) { if (net_ratelimit()) printk(KERN_DEBUG "ipv6_hop_jumbo: wrong jumbo opt length/alignment %d\n", skb->nh.raw[optoff+1]); + IP6_INC_STATS_BH(Ip6InHdrErrors); goto drop; } pkt_len = ntohl(*(u32*)(skb->nh.raw+optoff+2)); if (pkt_len <= IPV6_MAXPLEN) { + IP6_INC_STATS_BH(Ip6InHdrErrors); icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2); return 0; } if (skb->nh.ipv6h->payload_len) { + IP6_INC_STATS_BH(Ip6InHdrErrors); icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff); return 0; } diff -urN linux-2.6.5/net/ipv6/ip6_input.c linux-2.6.5-oldmibs/net/ipv6/ip6_input.c --- linux-2.6.5/net/ipv6/ip6_input.c 2004-04-03 19:37:38.000000000 -0800 +++ linux-2.6.5-oldmibs/net/ipv6/ip6_input.c 2004-04-05 15:09:55.000000000 -0700 @@ -79,8 +79,10 @@ if (skb->len < sizeof(struct ipv6hdr)) goto err; - if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) + if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) { + IP6_INC_STATS_BH(Ip6InHdrErrors); goto drop; + } hdr = skb->nh.ipv6h; @@ -94,8 +96,10 @@ if (pkt_len + sizeof(struct ipv6hdr) > skb->len) goto truncated; if (pkt_len + sizeof(struct ipv6hdr) < skb->len) { - if (__pskb_trim(skb, pkt_len + sizeof(struct ipv6hdr))) + if (__pskb_trim(skb, pkt_len + sizeof(struct ipv6hdr))){ + IP6_INC_STATS_BH(Ip6InHdrErrors); goto drop; + } hdr = skb->nh.ipv6h; if (skb->ip_summed == CHECKSUM_HW) skb->ip_summed = CHECKSUM_NONE; @@ -206,6 +210,7 @@ return 0; discard: + IP6_INC_STATS_BH(Ip6InDiscards); rcu_read_unlock(); kfree_skb(skb); return 0; diff -urN linux-2.6.5/net/ipv6/ip6_output.c linux-2.6.5-oldmibs/net/ipv6/ip6_output.c --- linux-2.6.5/net/ipv6/ip6_output.c 2004-04-03 19:36:16.000000000 -0800 +++ linux-2.6.5-oldmibs/net/ipv6/ip6_output.c 2004-04-05 15:09:55.000000000 -0700 @@ -87,6 +87,7 @@ } else if (dst->neighbour) return dst->neighbour->output(skb); + IP6_INC_STATS_BH(Ip6OutNoRoutes); kfree_skb(skb); return -EINVAL; @@ -131,6 +132,7 @@ ip6_dev_loopback_xmit); if (skb->nh.ipv6h->hop_limit == 0) { + IP6_INC_STATS(Ip6OutDiscards); kfree_skb(skb); return 0; } @@ -167,6 +169,7 @@ dst = ip6_route_output(skb->sk, &fl); if (dst->error) { + IP6_INC_STATS(Ip6OutNoRoutes); if (net_ratelimit()) printk(KERN_DEBUG "ip6_route_me_harder: No more route.\n"); dst_release(dst); @@ -224,8 +227,10 @@ struct sk_buff *skb2 = skb_realloc_headroom(skb, head_room); kfree_skb(skb); skb = skb2; - if (skb == NULL) + if (skb == NULL) { + IP6_INC_STATS(Ip6OutDiscards); return -ENOBUFS; + } if (sk) skb_set_owner_w(skb, sk); } @@ -265,6 +270,7 @@ printk(KERN_DEBUG "IPv6: sending pkt_too_big to self\n"); skb->dev = dst->dev; icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev); + IP6_INC_STATS(Ip6FragFails); kfree_skb(skb); return -EMSGSIZE; } @@ -345,8 +351,10 @@ if (ipv6_devconf.forwarding == 0) goto error; - if (!xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb)) + if (!xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb)) { + IP6_INC_STATS(Ip6InDiscards); goto drop; + } skb->ip_summed = CHECKSUM_NONE; @@ -382,8 +390,10 @@ return -ETIMEDOUT; } - if (!xfrm6_route_forward(skb)) + if (!xfrm6_route_forward(skb)) { + IP6_INC_STATS(Ip6InDiscards); goto drop; + } /* IPv6 specs say nothing about it, but it is clear that we cannot send redirects to source routed frames. @@ -420,12 +430,15 @@ skb->dev = dst->dev; icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, dst_pmtu(dst), skb->dev); IP6_INC_STATS_BH(Ip6InTooBigErrors); + IP6_INC_STATS_BH(Ip6FragFails); kfree_skb(skb); return -EMSGSIZE; } - if (skb_cow(skb, dst->dev->hard_header_len)) + if (skb_cow(skb, dst->dev->hard_header_len)) { + IP6_INC_STATS(Ip6OutDiscards); goto drop; + } hdr = skb->nh.ipv6h; @@ -648,6 +661,7 @@ if ((frag = alloc_skb(len+hlen+sizeof(struct frag_hdr)+LL_RESERVED_SPACE(rt->u.dst.dev), GFP_ATOMIC)) == NULL) { NETDEBUG(printk(KERN_INFO "IPv6: frag: no memory for new fragment!\n")); + IP6_INC_STATS(Ip6FragFails); err = -ENOMEM; goto fail; } @@ -1062,6 +1076,7 @@ ipv6_addr_copy(&hdr->daddr, final_dst); skb->dst = dst_clone(&rt->u.dst); + IP6_INC_STATS(Ip6OutRequests); err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, skb->dst->dev, dst_output); if (err) { if (err > 0) @@ -1092,8 +1107,10 @@ struct ipv6_pinfo *np = inet6_sk(sk); struct sk_buff *skb; - while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) + while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) { + IP6_INC_STATS(Ip6OutDiscards); kfree_skb(skb); + } inet->cork.flags &= ~IPCORK_OPT; diff -urN linux-2.6.5/net/ipv6/ndisc.c linux-2.6.5-oldmibs/net/ipv6/ndisc.c --- linux-2.6.5/net/ipv6/ndisc.c 2004-04-03 19:37:23.000000000 -0800 +++ linux-2.6.5-oldmibs/net/ipv6/ndisc.c 2004-04-05 15:09:55.000000000 -0700 @@ -452,6 +452,7 @@ skb->dst = dst; idev = in6_dev_get(dst->dev); + IP6_INC_STATS(Ip6OutRequests); err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output); if (!err) { ICMP6_INC_STATS(idev, Icmp6OutNeighborAdvertisements); @@ -535,6 +536,7 @@ /* send it! */ skb->dst = dst; idev = in6_dev_get(dst->dev); + IP6_INC_STATS(Ip6OutRequests); err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output); if (!err) { ICMP6_INC_STATS(idev, Icmp6OutNeighborSolicits); @@ -607,6 +609,7 @@ /* send it! */ skb->dst = dst; idev = in6_dev_get(dst->dev); + IP6_INC_STATS(Ip6OutRequests); err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output); if (!err) { ICMP6_INC_STATS(idev, Icmp6OutRouterSolicits); @@ -1332,6 +1335,7 @@ buff->dst = dst; idev = in6_dev_get(dst->dev); + IP6_INC_STATS(Ip6OutRequests); err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, buff, NULL, dst->dev, dst_output); if (!err) { ICMP6_INC_STATS(idev, Icmp6OutRedirects); diff -urN linux-2.6.5/net/ipv6/raw.c linux-2.6.5-oldmibs/net/ipv6/raw.c --- linux-2.6.5/net/ipv6/raw.c 2004-04-03 19:36:56.000000000 -0800 +++ linux-2.6.5-oldmibs/net/ipv6/raw.c 2004-04-05 15:09:55.000000000 -0700 @@ -526,6 +526,7 @@ if (err) goto error_fault; + IP6_INC_STATS(Ip6OutRequests); err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, rt->u.dst.dev, dst_output); if (err > 0) diff -urN linux-2.6.5/net/ipv6/reassembly.c linux-2.6.5-oldmibs/net/ipv6/reassembly.c --- linux-2.6.5/net/ipv6/reassembly.c 2004-04-03 19:36:55.000000000 -0800 +++ linux-2.6.5-oldmibs/net/ipv6/reassembly.c 2004-04-05 15:09:55.000000000 -0700 @@ -426,6 +426,7 @@ ((u8 *) (fhdr + 1) - (u8 *) (skb->nh.ipv6h + 1))); if ((unsigned int)end > IPV6_MAXPLEN) { + IP6_INC_STATS_BH(Ip6InHdrErrors); icmpv6_param_prob(skb,ICMPV6_HDR_FIELD, (u8*)&fhdr->frag_off - skb->nh.raw); return; } @@ -452,6 +453,7 @@ /* RFC2460 says always send parameter problem in * this case. -DaveM */ + IP6_INC_STATS_BH(Ip6InHdrErrors); icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, offsetof(struct ipv6hdr, payload_len)); return; @@ -570,6 +572,7 @@ return; err: + IP6_INC_STATS(Ip6ReasmFails); kfree_skb(skb); } @@ -694,10 +697,12 @@ /* Jumbo payload inhibits frag. header */ if (hdr->payload_len==0) { + IP6_INC_STATS(Ip6InHdrErrors); icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw); return -1; } if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+sizeof(struct frag_hdr))) { + IP6_INC_STATS(Ip6InHdrErrors); icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw); return -1; } --Boundary-00=_vWfcAXd3ZEjun88-- From romieu@fr.zoreil.com Tue Apr 6 00:49:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 00:49:38 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i367nXKO004257 for ; Tue, 6 Apr 2004 00:49:34 -0700 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.8/8.12.1) with ESMTP id i367l9gf030165; Tue, 6 Apr 2004 09:47:09 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i367l7uI030164; Tue, 6 Apr 2004 09:47:07 +0200 Date: Tue, 6 Apr 2004 09:47:07 +0200 From: Francois Romieu To: =?unknown-8bit?Q?Dieter_N=FCtzel?= Cc: Linux-Kernel List , Andrew Morton , Manfred Spraul , netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH] Fix kernel lockup in RTL-8169 gigabit ethernet driver Message-ID: <20040406094707.A29666@electric-eye.fr.zoreil.com> References: <200404060108.19488.Dieter.Nuetzel@hamburg.de> Mime-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200404060108.19488.Dieter.Nuetzel@hamburg.de>; from Dieter.Nuetzel@hamburg.de on Tue, Apr 06, 2004 at 01:08:19AM +0200 X-Organisation: Land of Sunshine Inc. X-MIME-Autoconverted: from 8bit to quoted-printable by fr.zoreil.com id i367l9gf030165 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i367nXKO004257 X-archive-position: 4500 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 618 Lines: 19 Dieter Nützel : [...] > Isn't the "current" RTL8169s (32/64) driver much outdated? > > I got a version # 1.6 with all my cards. This version has been merged in -mm since late 2003. Complete history is available on the netdev mailing list. From memory, there should be a Tx descriptor overflow bug in # 1.6 (see tx_interrupt). You may want to change some bits in your #1.6 version. There is a regression related to link removal in the current -mm/jg-netdev version (-mm stands behind jg-netdev where I hope to push what is posted on the netdev mailing list). Stay tuned. :o) -- Ueimor From cfs@nova.es Tue Apr 6 02:25:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 02:25:46 -0700 (PDT) Received: from fulanito.nisupu.com (qmailr@66.Red-80-38-104.pooles.rima-tde.net [80.38.104.66]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i369PZKO009191 for ; Tue, 6 Apr 2004 02:25:39 -0700 Received: (qmail 9983 invoked from network); 6 Apr 2004 09:25:32 -0000 Received: from hush.nisupu.com (HELO HUSH) (192.168.20.5) by fulanito.nisupu.com with SMTP; 6 Apr 2004 09:25:32 -0000 Message-ID: <000e01c41bb9$536600b0$1530a8c0@HUSH> From: "Carlos Fernandez Sanz" To: , Subject: vortex problems in 2.6? Date: Tue, 6 Apr 2004 11:27:05 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000B_01C41BCA.16BCC430" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-archive-position: 4501 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: cfs@nova.es Precedence: bulk X-list: netdev Content-Length: 24431 Lines: 578 This is a multi-part message in MIME format. ------=_NextPart_000_000B_01C41BCA.16BCC430 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I'm trying to track down my problems with my NIC in 2.6.5 (worked fine = in 2.4.22). The network "works" but very very slow, and ifconfig shows = almost the same count in the Tx packet and carrier count: TX packets:23818 errors:0 dropped:0 overruns:0 carrier:23817 dmesg for 2.4.22 and 2.6.5 are almost identical, except for the last = lines in 2.4.22 (vortex_up, etc). There are no (apparently important) = different in vortex-diag. mii-diag, however, fails to run in 2.6.5 while it works in 2.4.22. Dumps follow, in case someone can shed light. (BTW: lsmod in 2.4.22 shows the module as busy (used twice, because I = have two identical NICs, while in 2.6.5 it seems to be unused - I can unload = the module with both interfaces up, but obviously as soon as I do that they dissapear - I assume this is the intended 2.6 behaviour). ***** dmesg ***** 2.4.22: PCI: Found IRQ 9 for device 02:0b.0 PCI: Sharing IRQ 9 with 00:1f.4 3c59x: Donald Becker and others. www.scyld.com/network/vortex.html See Documentation/networking/vortex.txt 02:0b.0: 3Com PCI 3c905C Tornado at 0xd800. Vers LK1.1.18-ac 00:01:03:27:81:75, IRQ 9 product code 4a45 rev 00.12 date 10-15-00 Internal config register is 1800000, transceivers 0xa. 8K byte-wide RAM 5:3 Rx:Tx split, autoselect/Autonegotiate interface. MII transceiver found at address 24, status 786d. Enabling bus-master transmits and whole-frame receives. 02:0b.0: scatter/gather enabled. h/w checksums enabled divert: allocating divert_blk for eth0 eth0: using NWAY device table, not 8 eth0: Initial media type Autonegotiate. eth0: MII #24 status 786d, link partner capability 45e1, info1 0010, = setting full-duplex. eth0: vortex_up() InternalConfig 01800000. eth0: vortex_up() irq 9 media status 8880. 2.6.5: PCI: Found IRQ 9 for device 0000:02:0b.0 PCI: Sharing IRQ 9 with 0000:00:1f.4 3c59x: Donald Becker and others. www.scyld.com/network/vortex.html See Documentation/networking/vortex.txt 0000:02:0b.0: 3Com PCI 3c905C Tornado at 0xd800. Vers LK1.1.19 00:01:03:27:81:75, IRQ 9 product code 4a45 rev 00.12 date 10-15-00 Internal config register is 1800000, transceivers 0xa. 8K byte-wide RAM 5:3 Rx:Tx split, autoselect/Autonegotiate interface. MII transceiver found at address 24, status 786d. Enabling bus-master transmits and whole-frame receives. 0000:02:0b.0: scatter/gather enabled. h/w checksums enabled ********* vortex-diag ********* 2.4.22: Index #1: Found a 3c920 Series NIC adapter at 0xd800. Station address 00:01:03:27:81:75. Receive mode is 0x07: Normal unicast and all multicast. The Vortex chip may be active, so FIFO registers will not be read. To see all register values use the '-f' flag. Initial window 7, registers values by window: Window 0: 0000 0000 d93f 0000 e3e3 00bf ffff 0000. Window 1: FIFO FIFO 0700 0000 0000 007e 0000 2000. Window 2: 0100 2703 7581 0000 0000 0000 0042 4000. Window 3: 0000 0180 05ea 0020 000a 0800 0800 6000. Window 4: 0000 0000 0000 0cd8 0001 8880 0000 8000. Window 5: 1ffc 0000 0000 0600 0807 06ce 06c6 a000. Window 6: 0000 0000 0000 0a00 0000 02e2 0000 c000. Window 7: 0000 0000 0000 0000 0000 0000 0000 e000. Vortex chip registers at 0xd800 0xD810: **FIFO** 00000000 0000000a *STATUS* 0xD820: 00000020 00000000 00080000 00000004 0xD830: 00000000 44aebb52 03f58180 00080004 0xD840: 003eb253 00000000 000000b7 00000000 0xD850: 00000000 00000000 00000000 00000000 0xD860: 00000000 00000000 00000000 00000000 0xD870: 00009800 00000000 01600000 00000000 DMA control register is 00000020. Tx list starts at 00000000. Tx FIFO thresholds: min. burst 256 bytes, priority with 128 bytes to = empty. Rx FIFO thresholds: min. burst 256 bytes, priority with 128 bytes to = full. Poll period Tx 00 ns., Rx 0 ns. Maximum burst recorded Tx 0, Rx 352. Indication enable is 06c6, interrupt enable is 06ce. No interrupt sources are pending. Transceiver/media interfaces available: 100baseTx 10baseT. Transceiver type in use: Autonegotiate. MAC settings: full-duplex. Station address set to 00:01:03:27:81:75. Configuration options 0042. EEPROM format 64x16, configuration table at offset 0: 00: 0001 0327 8175 9200 014f 0048 454a 6d50 0x08: 2940 0800 0001 0327 8175 0010 0000 00aa 0x10: 72a2 0000 0000 0180 0000 0000 0429 10b7 0x18: 1000 000a 0002 6300 ffb7 b7b7 0000 0000 0x20: 00ba 1234 5600 0000 0000 0000 0000 0000 0x28: 0000 0000 0000 0000 0000 0000 0000 0000 0x30: ffff ffff ffff ffff ffff ffff ffff ffff ... The word-wide EEPROM checksum is 0x9dc7. Saved EEPROM settings of a 3Com Vortex/Boomerang: 3Com Node Address 00:01:03:27:81:75 (used as a unique ID only). OEM Station address 00:01:03:27:81:75 (used as the ethernet address). Device ID 9200, Manufacturer ID 6d50. Manufacture date (MM/DD/YYYY) 10/15/2000, division H, product JE. A BIOS ROM of size 0Kx8 is expected. Transceiver selection: Autonegotiate. Options: negotiated duplex, link beat required. PCI bus requested settings -- minimum grant 10, maximum latency 10 = (250ns units). PCI Subsystem IDs: Vendor 10b7 Device 1000. 100baseTx 10baseT. Vortex format checksum is incorrect (2c vs. 10b7). Cyclone format checksum is incorrect (0xbc vs. 0xba). Hurricane format checksum is incorrect (0x95 vs. 0xba). MII PHY found at address 24, status 786d. MII PHY 0 at #24 transceiver registers: 3000 786d 0180 7750 05e1 45e1 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0238 0087 0000 0000 0000 0000 c4c8 0300 0100 0438 2010 2000 0000 0000 0000 0000. 2.6.5: Index #1: Found a 3c920 Series NIC adapter at 0xd800. Station address 00:01:03:27:81:75. Receive mode is 0x07: Normal unicast and all multicast. The Vortex chip may be active, so FIFO registers will not be read. To see all register values use the '-f' flag. Initial window 7, registers values by window: Window 0: 0000 0000 d93f 0000 e3e3 00bf ffff 0000. Window 1: FIFO FIFO 0700 0000 0000 007e 0000 2000. Window 2: 0100 2703 7581 0000 0000 0000 0042 4000. Window 3: 0000 0180 05ea 0000 000a 0800 0800 6000. Window 4: 0000 0000 0000 0cd8 0001 8c80 0000 8000. Window 5: 1ffc 0000 0000 0600 0807 06ce 06c6 a000. Window 6: 0000 0000 0000 0600 0000 0569 018c c000. Window 7: 0000 0000 0000 0000 0000 0000 0000 e000. Vortex chip registers at 0xd800 0xD810: **FIFO** 00000000 0000002a *STATUS* 0xD820: 00000020 00000000 00080000 00000004 0xD830: 00000000 d03a2fc6 1ce260c0 00080004 0xD840: 00bb915d 00000000 000000b7 00000000 0xD850: 00000000 00000000 00000000 00000000 0xD860: 00000000 00000000 00000000 00000000 0xD870: 00009800 00000000 01600160 00000000 DMA control register is 00000020. Tx list starts at 00000000. Tx FIFO thresholds: min. burst 256 bytes, priority with 128 bytes to empty. Rx FIFO thresholds: min. burst 256 bytes, priority with 128 bytes to full. Poll period Tx 00 ns., Rx 0 ns. Maximum burst recorded Tx 352, Rx 352. Indication enable is 06c6, interrupt enable is 06ce. No interrupt sources are pending. Transceiver/media interfaces available: 100baseTx 10baseT. Transceiver type in use: Autonegotiate. MAC settings: half-duplex. Station address set to 00:01:03:27:81:75. Configuration options 0042. EEPROM format 64x16, configuration table at offset 0: 00: 0001 0327 8175 9200 014f 0048 454a 6d50 0x08: 2940 0800 0001 0327 8175 0010 0000 00aa 0x10: 72a2 0000 0000 0180 0000 0000 0429 10b7 0x18: 1000 000a 0002 6300 ffb7 b7b7 0000 0000 0x20: 00ba 1234 5600 0000 0000 0000 0000 0000 0x28: 0000 0000 0000 0000 0000 0000 0000 0000 0x30: ffff ffff ffff ffff ffff ffff ffff ffff ... The word-wide EEPROM checksum is 0x9dc7. Saved EEPROM settings of a 3Com Vortex/Boomerang: 3Com Node Address 00:01:03:27:81:75 (used as a unique ID only). OEM Station address 00:01:03:27:81:75 (used as the ethernet address). Device ID 9200, Manufacturer ID 6d50. Manufacture date (MM/DD/YYYY) 10/15/2000, division H, product JE. A BIOS ROM of size 0Kx8 is expected. Transceiver selection: Autonegotiate. Options: negotiated duplex, link beat required. PCI bus requested settings -- minimum grant 10, maximum latency 10 (250ns units). PCI Subsystem IDs: Vendor 10b7 Device 1000. 100baseTx 10baseT. Vortex format checksum is incorrect (2c vs. 10b7). Cyclone format checksum is incorrect (0xbc vs. 0xba). Hurricane format checksum is incorrect (0x95 vs. 0xba). MII PHY found at address 24, status 786d. MII PHY 0 at #24 transceiver registers: 3000 786d 0180 7750 05e1 45e1 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0238 0087 0000 0000 0000 0000 c4c8 0300 0100 0438 2010 2000 8000 0000 0000 0000. ****** mii-diag ****** 2.4.22: mii-diag.c:v2.09 9/06/2003 Donald Becker (becker@scyld.com) http://www.scyld.com/diag/index.html Using the new SIOCGMIIPHY value on PHY 24 (BMCR 0x3000). The autonegotiated capability is 01e0. The autonegotiated media type is 100baseTx-FD. Basic mode control register 0x3000: Auto-negotiation enabled. You have link beat, and everything is working OK. This transceiver is capable of 100baseTx-FD 100baseTx 10baseT-FD = 10baseT. Able to perform Auto-negotiation, negotiation complete. Your link partner advertised 45e1: Flow-control 100baseTx-FD 100baseTx 10baseT-FD 10baseT, w/ 802.3X flow control. End of basic transceiver information. libmii.c:v2.10 4/22/2003 Donald Becker (becker@scyld.com) http://www.scyld.com/diag/index.html MII PHY #24 transceiver registers: 3000 786d 0180 7750 05e1 45e1 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000 0238 0087 0000 0000 0000 0000 c4c8 0300 0100 0438 2010 2000 0000 0000 0000 0000. Basic mode control register 0x3000: Auto-negotiation enabled. Basic mode status register 0x786d ... 786d. Link status: established. Capable of 100baseTx-FD 100baseTx 10baseT-FD 10baseT. Able to perform Auto-negotiation, negotiation complete. Vendor ID is 00:60:1d:--:--:--, model 53 rev. 0. No specific information is known about this transceiver type. I'm advertising 05e1: Flow-control 100baseTx-FD 100baseTx 10baseT-FD = 10baseT Advertising no additional info pages. IEEE 802.3 CSMA/CD protocol. Link partner capability is 45e1: Flow-control 100baseTx-FD 100baseTx 10baseT-FD 10baseT. Negotiation completed. 2.6.5: root@fulanito root]# mii-diag --force Using the default interface 'eth0'. Basic registers of MII PHY #24: 0000 0000 0000 0000 0000 0000 0000 = 0000. No MII transceiver present!. Basic mode control register 0x0000: Auto-negotiation disabled, with Speed fixed at 10 mbps, half-duplex. Basic mode status register 0x0000 ... 0000. Link status: not established. Link partner information is not exchanged when in fixed speed mode. End of basic transceiver information. Thanks. ------=_NextPart_000_000B_01C41BCA.16BCC430 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

<Please CC: me in the reply as I = don't subscribe=20 to this list. Thanks>
 
I'm trying to track down my problems with my NIC in 2.6.5 (worked = fine=20 in
2.4.22). The network "works" but very very slow, and ifconfig = shows=20 almost
the same count in the Tx packet and carrier count:

TX=20 packets:23818 errors:0 dropped:0 overruns:0 carrier:23817

dmesg = for=20 2.4.22 and 2.6.5 are almost identical, except for the last lines
in = 2.4.22=20 (vortex_up, etc). There are no (apparently important) different=20 in
vortex-diag. mii-diag, however, fails to run in 2.6.5 while it = works=20 in
2.4.22.

 Dumps follow, in case someone can shed=20 light.

(BTW: lsmod in 2.4.22 shows the module as busy (used = twice,=20 because I have
two identical NICs, while in 2.6.5 it seems to be = unused - I=20 can unload the
module with both interfaces up, but obviously as soon = as I do=20 that they
dissapear - I assume this is the intended 2.6=20 behaviour).

*****
dmesg
*****
2.4.22:
PCI: Found IRQ = 9 for=20 device 02:0b.0
PCI: Sharing IRQ 9 with 00:1f.4
3c59x: Donald = Becker and=20 others. www.scyld.com/network/v= ortex.html
See=20 Documentation/networking/vortex.txt
02:0b.0: 3Com PCI 3c905C Tornado = at=20 0xd800. Vers LK1.1.18-ac
00:01:03:27:81:75, IRQ 9
product code = 4a45 rev=20 00.12 date 10-15-00
Internal config register is 1800000, transceivers = 0xa.
8K byte-wide RAM 5:3 Rx:Tx split, autoselect/Autonegotiate=20 interface.
MII transceiver found at address 24, status = 786d.
Enabling=20 bus-master transmits and whole-frame receives.
02:0b.0: = scatter/gather=20 enabled. h/w checksums enabled
divert: allocating divert_blk for=20 eth0
eth0: using NWAY device table, not 8
eth0: Initial media type = Autonegotiate.
eth0: MII #24 status 786d, link partner capability = 45e1, info1=20 0010, setting
full-duplex.
eth0: vortex_up() InternalConfig=20 01800000.
eth0: vortex_up() irq 9 media status = 8880.

2.6.5:
PCI:=20 Found IRQ 9 for device 0000:02:0b.0
PCI: Sharing IRQ 9 with=20 0000:00:1f.4
3c59x: Donald Becker and others. www.scyld.com/network/v= ortex.html
See=20 Documentation/networking/vortex.txt
0000:02:0b.0: 3Com PCI 3c905C = Tornado at=20 0xd800. Vers LK1.1.19
00:01:03:27:81:75, IRQ 9
product code 4a45 = rev 00.12=20 date 10-15-00
Internal config register is 1800000, transceivers = 0xa.
8K=20 byte-wide RAM 5:3 Rx:Tx split, autoselect/Autonegotiate = interface.
MII=20 transceiver found at address 24, status 786d.
Enabling bus-master = transmits=20 and whole-frame receives.
0000:02:0b.0: scatter/gather enabled. h/w = checksums=20 enabled
*********
vortex-diag
*********

2.4.22:
Index = #1:=20 Found a 3c920 Series NIC adapter at 0xd800.
Station address=20 00:01:03:27:81:75.
Receive mode is 0x07: Normal unicast and all=20 multicast.
The Vortex chip may be active, so FIFO registers will not = be=20 read.
To see all register values use the '-f' flag.
Initial window = 7,=20 registers values by window:
Window 0: 0000 0000 d93f 0000 e3e3 00bf = ffff=20 0000.
Window 1: FIFO FIFO 0700 0000 0000 007e 0000 2000.
Window 2: = 0100=20 2703 7581 0000 0000 0000 0042 4000.
Window 3: 0000 0180 05ea 0020 = 000a 0800=20 0800 6000.
Window 4: 0000 0000 0000 0cd8 0001 8880 0000 = 8000.
Window 5:=20 1ffc 0000 0000 0600 0807 06ce 06c6 a000.
Window 6: 0000 0000 0000 = 0a00 0000=20 02e2 0000 c000.
Window 7: 0000 0000 0000 0000 0000 0000 0000 = e000.
Vortex=20 chip registers at 0xd800
0xD810: **FIFO** 00000000 0000000a=20 *STATUS*
0xD820: 00000020 00000000 00080000 00000004
0xD830: = 00000000=20 44aebb52 03f58180 00080004
0xD840: 003eb253 00000000 000000b7=20 00000000
0xD850: 00000000 00000000 00000000 00000000
0xD860: = 00000000=20 00000000 00000000 00000000
0xD870: 00009800 00000000 01600000 = 00000000
DMA=20 control register is 00000020.
Tx list starts at 00000000.
Tx FIFO=20 thresholds: min. burst 256 bytes, priority with 128 bytes to = empty.
Rx FIFO=20 thresholds: min. burst 256 bytes, priority with 128 bytes to = full.
Poll=20 period Tx 00 ns., Rx 0 ns.
Maximum burst recorded Tx 0, Rx = 352.
Indication=20 enable is 06c6, interrupt enable is 06ce.
No interrupt sources are=20 pending.
Transceiver/media interfaces available: 100baseTx=20 10baseT.
Transceiver type in use: Autonegotiate.
MAC settings:=20 full-duplex.
Station address set to = 00:01:03:27:81:75.
Configuration=20 options 0042.
EEPROM format 64x16, configuration table at offset = 0:
00:=20 0001 0327 8175 9200 014f 0048 454a 6d50
0x08: 2940 0800 0001 0327 = 8175 0010=20 0000 00aa
0x10: 72a2 0000 0000 0180 0000 0000 0429 10b7
0x18: 1000 = 000a=20 0002 6300 ffb7 b7b7 0000 0000
0x20: 00ba 1234 5600 0000 0000 0000 = 0000=20 0000
0x28: 0000 0000 0000 0000 0000 0000 0000 0000
0x30: ffff ffff = ffff=20 ffff ffff ffff ffff ffff
...
The word-wide EEPROM checksum is=20 0x9dc7.
Saved EEPROM settings of a 3Com Vortex/Boomerang:
3Com = Node=20 Address 00:01:03:27:81:75 (used as a unique ID only).
OEM Station = address=20 00:01:03:27:81:75 (used as the ethernet address).
Device ID 9200,=20 Manufacturer ID 6d50.
Manufacture date (MM/DD/YYYY) 10/15/2000, = division H,=20 product JE.
A BIOS ROM of size 0Kx8 is expected.
Transceiver = selection:=20 Autonegotiate.
Options: negotiated duplex, link beat required.
PCI = bus=20 requested settings -- minimum grant 10, maximum latency 10=20 (250ns
units).
PCI Subsystem IDs: Vendor 10b7 Device = 1000.
100baseTx=20 10baseT.
Vortex format checksum is incorrect (2c vs. = 10b7).
Cyclone format=20 checksum is incorrect (0xbc vs. 0xba).
Hurricane format checksum is = incorrect=20 (0x95 vs. 0xba).
MII PHY found at address 24, status 786d.
MII PHY = 0 at=20 #24 transceiver registers:
3000 786d 0180 7750 05e1 45e1 0001 = 0000
0000=20 0000 0000 0000 0000 0000 0000 0000
0238 0087 0000 0000 0000 0000 c4c8 = 0300
0100 0438 2010 2000 0000 0000 0000 0000.

2.6.5:
Index = #1:=20 Found a 3c920 Series NIC adapter at 0xd800.
 Station address=20 00:01:03:27:81:75.
  Receive mode is 0x07: Normal unicast and = all=20 multicast.
The Vortex chip may be active, so FIFO registers will not = be=20 read.
To see all register values use the '-f' flag.
Initial window = 7,=20 registers values by window:
  Window 0: 0000 0000 d93f 0000 e3e3 = 00bf=20 ffff 0000.
  Window 1: FIFO FIFO 0700 0000 0000 007e 0000=20 2000.
  Window 2: 0100 2703 7581 0000 0000 0000 0042 = 4000.
 =20 Window 3: 0000 0180 05ea 0000 000a 0800 0800 6000.
  Window 4: = 0000 0000=20 0000 0cd8 0001 8c80 0000 8000.
  Window 5: 1ffc 0000 0000 0600 = 0807 06ce=20 06c6 a000.
  Window 6: 0000 0000 0000 0600 0000 0569 018c=20 c000.
  Window 7: 0000 0000 0000 0000 0000 0000 0000 = e000.
Vortex=20 chip registers at 0xd800
  0xD810: **FIFO** 00000000 0000002a=20 *STATUS*
  0xD820: 00000020 00000000 00080000 00000004
  = 0xD830:=20 00000000 d03a2fc6 1ce260c0 00080004
  0xD840: 00bb915d 00000000 = 000000b7=20 00000000
  0xD850: 00000000 00000000 00000000 00000000
  = 0xD860:=20 00000000 00000000 00000000 00000000
  0xD870: 00009800 00000000 = 01600160=20 00000000
  DMA control register is 00000020.
   Tx = list=20 starts at 00000000.
   Tx FIFO thresholds: min. burst 256 = bytes,=20 priority with 128 bytes to
empty.
   Rx FIFO thresholds: = min.=20 burst 256 bytes, priority with 128 bytes to
full.
   = Poll period=20 Tx 00 ns.,  Rx 0 ns.
   Maximum burst recorded Tx = 352, =20 Rx 352.
 Indication enable is 06c6, interrupt enable is=20 06ce.
 No interrupt sources are = pending.
 Transceiver/media=20 interfaces available:  100baseTx 10baseT.
Transceiver type in = use: =20 Autonegotiate.
 MAC settings: half-duplex.
 Station = address set=20 to 00:01:03:27:81:75.
 Configuration options 0042.
EEPROM = format=20 64x16, configuration table at offset 0:
    00: 0001 = 0327 8175=20 9200 014f 0048 454a 6d50
  0x08: 2940 0800 0001 0327 8175 0010 = 0000=20 00aa
  0x10: 72a2 0000 0000 0180 0000 0000 0429 10b7
  = 0x18:=20 1000 000a 0002 6300 ffb7 b7b7 0000 0000
  0x20: 00ba 1234 5600 = 0000 0000=20 0000 0000 0000
  0x28: 0000 0000 0000 0000 0000 0000 0000 = 0000
 =20 0x30: ffff ffff ffff ffff ffff ffff ffff = ffff
     =20 ...
 The word-wide EEPROM checksum is 0x9dc7.
Saved EEPROM = settings=20 of a 3Com Vortex/Boomerang:
 3Com Node Address 00:01:03:27:81:75 = (used=20 as a unique ID only).
 OEM Station address 00:01:03:27:81:75 = (used as=20 the ethernet address).
  Device ID 9200,  Manufacturer ID=20 6d50.
  Manufacture date (MM/DD/YYYY) 10/15/2000, division H, = product=20 JE.
  A BIOS ROM of size 0Kx8 is expected.
 Transceiver=20 selection: Autonegotiate.
   Options: negotiated duplex, = link beat=20 required.
   PCI bus requested settings --  minimum = grant 10,=20 maximum latency 10
(250ns units).
 PCI Subsystem IDs: Vendor = 10b7=20 Device 1000.
 100baseTx 10baseT.
  Vortex format = checksum is=20 incorrect (2c vs. 10b7).
  Cyclone format checksum is incorrect = (0xbc=20 vs. 0xba).
  Hurricane format checksum is incorrect (0x95 vs.=20 0xba).
 MII PHY found at address 24, status 786d.
 MII = PHY 0 at=20 #24 transceiver registers:
   3000 786d 0180 7750 05e1 45e1 = 0001=20 0000
   0000 0000 0000 0000 0000 0000 0000 = 0000
  =20 0238 0087 0000 0000 0000 0000 c4c8 0300
   0100 0438 2010 = 2000 8000=20 0000 0000=20 0000.

******
mii-diag
******
2.4.22:
mii-diag.c:v2.09 = 9/06/2003 Donald Becker (becker@scyld.com)
http://www.scyld.com/diag/i= ndex.html
Using=20 the new SIOCGMIIPHY value on PHY 24 (BMCR 0x3000).
The autonegotiated = capability is 01e0.
The autonegotiated media type is = 100baseTx-FD.
Basic=20 mode control register 0x3000: Auto-negotiation enabled.
You have link = beat,=20 and everything is working OK.
This transceiver is capable of = 100baseTx-FD=20 100baseTx 10baseT-FD 10baseT.
Able to perform Auto-negotiation, = negotiation=20 complete.
Your link partner advertised 45e1: Flow-control = 100baseTx-FD=20 100baseTx
10baseT-FD 10baseT, w/ 802.3X flow control.
End of basic = transceiver information.
libmii.c:v2.10 4/22/2003 Donald Becker (becker@scyld.com)
http://www.scyld.com/diag/i= ndex.html
MII=20 PHY #24 transceiver registers:
3000 786d 0180 7750 05e1 45e1 0001=20 0000
0000 0000 0000 0000 0000 0000 0000 0000
0238 0087 0000 0000 = 0000 0000=20 c4c8 0300
0100 0438 2010 2000 0000 0000 0000 0000.
Basic mode = control=20 register 0x3000: Auto-negotiation enabled.
Basic mode status register = 0x786d=20 ... 786d.
Link status: established.
Capable of 100baseTx-FD = 100baseTx=20 10baseT-FD 10baseT.
Able to perform Auto-negotiation, negotiation=20 complete.
Vendor ID is 00:60:1d:--:--:--, model 53 rev. 0.
No = specific=20 information is known about this transceiver type.
I'm advertising = 05e1:=20 Flow-control 100baseTx-FD 100baseTx 10baseT-FD 10baseT
Advertising no = additional info pages.
IEEE 802.3 CSMA/CD protocol.
Link partner=20 capability is 45e1: Flow-control 100baseTx-FD 100baseTx
10baseT-FD=20 10baseT.
Negotiation completed.

2.6.5:
root@fulanito root]# mii-diag = --force
Using=20 the default interface 'eth0'.
Basic registers of MII PHY #24:  = 0000 0000=20 0000 0000 0000 0000 0000 0000.
  No MII transceiver=20 present!.
 Basic mode control register 0x0000: Auto-negotiation=20 disabled, with
 Speed fixed at 10 mbps, = half-duplex.
 Basic mode=20 status register 0x0000 ... 0000.
   Link status: not=20 established.
 Link partner information is not exchanged when in = fixed=20 speed mode.
   End of basic transceiver=20 information.

Thanks.
 
 
------=_NextPart_000_000B_01C41BCA.16BCC430-- From P@draigBrady.com Tue Apr 6 03:31:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 03:31:52 -0700 (PDT) Received: from corvil.com (gate.corvil.net [213.94.219.177]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36AVVKO014718 for ; Tue, 6 Apr 2004 03:31:32 -0700 Received: from draigBrady.com (pixelbeat.local.corvil.com [172.18.1.170]) by corvil.com (8.12.9/8.12.5) with ESMTP id i36AUJhr096614; Tue, 6 Apr 2004 11:30:20 +0100 (IST) (envelope-from P@draigBrady.com) Message-ID: <407286BB.8080107@draigBrady.com> Date: Tue, 06 Apr 2004 11:30:19 +0100 From: P@draigBrady.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040124 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jason Lunz CC: netdev@oss.sgi.com, cpw@lanl.gov, luca.deri@netikos.com Subject: Re: Luca Deri's paper: Improving Passive Packet Capture: Beyond Device Polling References: <20040330142354.GA17671@outblaze.com> <1081033332.2037.61.camel@jzny.localdomain> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-MIME-Autoconverted: from 8bit to quoted-printable by corvil.com id i36AUJhr096614 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i36AVVKO014718 X-archive-position: 4502 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: P@draigBrady.com Precedence: bulk X-list: netdev Content-Length: 2262 Lines: 56 Jason Lunz wrote: > hadi@cyberus.ca said: > >>Jason Lunz actually seemed to have been doing more work on this and >>e1000 - he could provide better perfomance numbers. > > > Well, not really. What I have is still available at: > > http://gtf.org/lunz/linux/net/perf/ > > ...but those are mainly measurements of very outdated versions of the > e1000 napi driver backported to 2.4, running on 1.8Ghz Xeon systems. > That work hasn't really been kept up to date, I'm afraid. > > >>It should also be noted that infact packet mmap already uses rings. > > > Yes, I read the paper (but not his code). What stood out to me is that > the description of his custom socket implementation matches exactly what > packet-mmap already is. > > I noticed he only mentioned testing of libpcap-mmap, but did not use > mmap packet sockets directly -- maybe there's something about libpcap > that limits performance? I haven't looked. That's my experience. I'm thinking of redoing libpcap-mmap completely as it has huge amounts of statistics messing in the fast path. Also the ring gets corrupted if packets are being received while the ring buffer is being setup. I've a patch for http://public.lanl.gov/cpw/libpcap-0.8.030808.tar.gz here: http://www.pixelbeat.org/patches/libpcap-0.8.030808-pb.diff (you need to compile with PB defined) Note this only addresses the speed issue. Also there are newer versions of libpcap-mmap available which I haven't looked at yet. > What I can say for sure is that the napi + packet-mmap performance with > many small packets is almost surely limited by problems with irq/softirq > load. There was an excellent thread last week about this with Andrea > Arcangeli, Robert Olsson and others about the balancing of softirq and > userspace load; they eventually were beginning to agree that running > softirqs on return from hardirq and bh was a bigger load than expected > when there was lots of napi work to do. So despite NAPI, too much kernel > time is spent handling (soft)irq load with many small packets. agreed. > It appears this problem became worse in 2.6 with HZ=1000, because now > the napi rx softirq work is being done 10X as much on return from the > timer interrupt. I'm not sure if a solution was reached. Pádraig. From jgarzik@pobox.com Tue Apr 6 04:58:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 04:58:20 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36BwBKO023658 for ; Tue, 6 Apr 2004 04:58:12 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1BApDW-0002T4-0S; Tue, 06 Apr 2004 12:58:10 +0100 Message-ID: <40729B41.4040403@pobox.com> Date: Tue, 06 Apr 2004 07:57:53 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Don Fry CC: tsbogend@alpha.franken.de, netdev@oss.sgi.com Subject: Re: [PATCH 2.6.5 1/4] pcnet32.c add support for 79C976 References: <200404052124.i35LOrD10981@DYN318364BLD.beaverton.ibm.com> In-Reply-To: <200404052124.i35LOrD10981@DYN318364BLD.beaverton.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 4503 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: 45 Lines: 3 all four patches applied to 2.6.x, thanks. From jgarzik@pobox.com Tue Apr 6 05:16:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 05:16:35 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36CGLKO026261 for ; Tue, 6 Apr 2004 05:16:22 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1BApV6-0002fs-Nj; Tue, 06 Apr 2004 13:16:20 +0100 Message-ID: <40729F88.4060300@pobox.com> Date: Tue, 06 Apr 2004 08:16:08 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Randy.Dunlap" CC: netdev Subject: Re: [janitor] dgrs: add missing iounmaps References: <20040405162753.7c0c5257.rddunlap@osdl.org> In-Reply-To: <20040405162753.7c0c5257.rddunlap@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 4504 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 10 Lines: 3 applied From jgarzik@pobox.com Tue Apr 6 05:18:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 05:18:29 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36CIRKO026655 for ; Tue, 6 Apr 2004 05:18:28 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1BApX9-0002hF-0x; Tue, 06 Apr 2004 13:18:27 +0100 Message-ID: <4072A007.6010409@pobox.com> Date: Tue, 06 Apr 2004 08:18:15 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Randy.Dunlap" CC: netdev Subject: Re: [PATCH] lmc header file not needed References: <20040405162908.68e5aff4.rddunlap@osdl.org> In-Reply-To: <20040405162908.68e5aff4.rddunlap@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 4505 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 9 Lines: 2 applied From deri@ntop.org Tue Apr 6 05:26:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 05:27:13 -0700 (PDT) Received: from localhost.localdomain (host114-228.pool82187.interbusiness.it [82.187.228.114]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36CQlKO027272 for ; Tue, 6 Apr 2004 05:26:49 -0700 Received: from ntop.org (athlon [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id i36CPnBv026985; Tue, 6 Apr 2004 14:25:59 +0200 Message-ID: <4072A1CD.8070905@ntop.org> Date: Tue, 06 Apr 2004 14:25:49 +0200 From: Luca Deri Organization: ntop.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7a) Gecko/20040218 X-Accept-Language: en-us, en MIME-Version: 1.0 To: P@draigBrady.com CC: Jason Lunz , netdev@oss.sgi.com, cpw@lanl.gov, ntop-misc@fuji.unipi.it Subject: Re: Luca Deri's paper: Improving Passive Packet Capture: Beyond Device Polling References: <20040330142354.GA17671@outblaze.com> <1081033332.2037.61.camel@jzny.localdomain> <407286BB.8080107@draigBrady.com> In-Reply-To: <407286BB.8080107@draigBrady.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-MIME-Autoconverted: from 8bit to quoted-printable by localhost.localdomain id i36CPnBv026985 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id i36CQlKO027272 X-archive-position: 4506 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: deri@ntop.org Precedence: bulk X-list: netdev Content-Length: 4000 Lines: 104 Hi all, the problem with libpcap-mmap is that: - it does not reduce the journey of the packet from NIC to userland beside the last part of it (syscall replaced with mmap). This has a negative impact on the overall performance. - it does not feature things like kernel packet sampling that pushes people to fetch all the packets out of a NIC then discard most of them (i.e. CPU cycles not very well spent). Somehow this is a limitation of pcap that does not feature a pcap_sample call. In addition if you do care about performance, I believe you're willing to turn off packet transmission and only do packet receive. Unfortunately I have no access to a "real" traffic generator (I use a PC as traffic generator). However if you read my paper you can see that with a Pentium IV 1.7 you can capture over 500'000 pkt/sec, so in your setup (Xeon + Spirent) you can have better figures. IRQ: Linux has far too much latency, in particular at high speeds. I'm not the right person who can say "this is the way to go", however I believe that we need some sort of interrupt prioritization like RTIRQ does. FYI, I've just polished the code and added kernel packet filtering to PF_RING. As soon as I have completed my tests I will release a new version. Finally It would be nice to have in the standard Linux core some packet capture improvements. It could either be based on my work or on somebody else's work. It doesn't really matter as long as Linux gets faster. Cheers, Luca P@draigBrady.com wrote: > Jason Lunz wrote: > >> hadi@cyberus.ca said: >> >>> Jason Lunz actually seemed to have been doing more work on this and >>> e1000 - he could provide better perfomance numbers. >> >> >> >> Well, not really. What I have is still available at: >> >> http://gtf.org/lunz/linux/net/perf/ >> >> ...but those are mainly measurements of very outdated versions of the >> e1000 napi driver backported to 2.4, running on 1.8Ghz Xeon systems. >> That work hasn't really been kept up to date, I'm afraid. >> >> >>> It should also be noted that infact packet mmap already uses rings. >> >> >> >> Yes, I read the paper (but not his code). What stood out to me is that >> the description of his custom socket implementation matches exactly what >> packet-mmap already is. >> >> I noticed he only mentioned testing of libpcap-mmap, but did not use >> mmap packet sockets directly -- maybe there's something about libpcap >> that limits performance? I haven't looked. > > > That's my experience. I'm thinking of redoing libpcap-mmap completely > as it has huge amounts of statistics messing in the fast path. > Also the ring gets corrupted if packets are being received while > the ring buffer is being setup. > > I've a patch for http://public.lanl.gov/cpw/libpcap-0.8.030808.tar.gz > here: http://www.pixelbeat.org/patches/libpcap-0.8.030808-pb.diff > (you need to compile with PB defined) > Note this only addresses the speed issue. > Also there are newer versions of libpcap-mmap available which I > haven't looked at yet. > >> What I can say for sure is that the napi + packet-mmap performance with >> many small packets is almost surely limited by problems with irq/softirq >> load. There was an excellent thread last week about this with Andrea >> Arcangeli, Robert Olsson and others about the balancing of softirq and >> userspace load; they eventually were beginning to agree that running >> softirqs on return from hardirq and bh was a bigger load than expected >> when there was lots of napi work to do. So despite NAPI, too much kernel >> time is spent handling (soft)irq load with many small packets. > > > agreed. > >> It appears this problem became worse in 2.6 with HZ=1000, because now >> the napi rx softirq work is being done 10X as much on return from the >> timer interrupt. I'm not sure if a solution was reached. > > > Pádraig > . -- Luca Deri http://luca.ntop.org/ Hacker: someone who loves to program and enjoys being clever about it - Richard Stallman From jgarzik@pobox.com Tue Apr 6 05:29:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 05:29: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.10/8.12.9) with SMTP id i36CTXKO027689 for ; Tue, 6 Apr 2004 05:29:34 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1BAphs-0002qv-SO; Tue, 06 Apr 2004 13:29:33 +0100 Message-ID: <4072A2A1.7060104@pobox.com> Date: Tue, 06 Apr 2004 08:29:21 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Randy.Dunlap" CC: netdev Subject: Re: [PATCH] remove magic '31' for netdev priv. alignment References: <20040405155654.69a9bb4b.rddunlap@osdl.org> In-Reply-To: <20040405155654.69a9bb4b.rddunlap@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 4507 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 10 Lines: 3 applied From Robert.Olsson@data.slu.se Tue Apr 6 05:55:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 05:55:43 -0700 (PDT) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36CtWKO028753 for ; Tue, 6 Apr 2004 05:55:33 -0700 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id i36CtJNv030320; Tue, 6 Apr 2004 14:55:21 +0200 Received: by robur.slu.se (Postfix, from userid 1000) id BB52E903D5; Tue, 6 Apr 2004 14:55:19 +0200 (CEST) From: Robert Olsson MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="5cX1WWKSdC" Content-Transfer-Encoding: 7bit Message-ID: <16498.43191.733850.18276@robur.slu.se> Date: Tue, 6 Apr 2004 14:55:19 +0200 To: dipankar@in.ibm.com Cc: Robert Olsson , Andrea Arcangeli , "David S. Miller" , kuznet@ms2.inr.ac.ru, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, paulmck@us.ibm.com, akpm@osdl.org Subject: Re: route cache DoS testing and softirqs In-Reply-To: <20040405212220.GH4003@in.ibm.com> References: <200403302005.AAA00466@yakov.inr.ac.ru> <20040330211450.GI3808@dualathlon.random> <20040330133000.098761e2.davem@redhat.com> <20040330213742.GL3808@dualathlon.random> <20040331171023.GA4543@in.ibm.com> <16491.4593.718724.277551@robur.slu.se> <20040331203750.GB4543@in.ibm.com> <20040331212817.GQ2143@dualathlon.random> <20040331214342.GD4543@in.ibm.com> <16497.37720.607342.193544@robur.slu.se> <20040405212220.GH4003@in.ibm.com> X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 4508 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 3413 Lines: 72 --5cX1WWKSdC Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit Dipankar Sarma writes: > Looks better atleast. Can you apply the following patch (rs-throttle-rcu) > on top of rcu-softirq.patch in your tree and see if helps a little bit more ? > Please make sure to set the kernel paramenters rcupdate.maxbatch to 4 > and rcupdate.plugticks to 0. You can make sure of those parameters > by looking at dmesg (rcu prints them out during boot). I just merged > it, but have not tested this patch yet. OK! Well not tested yet but I don't think we will get rid overflow totally in my setup. I've done a little experimental patch so *all* softirq's are run via ksoftirqd. total droppped tsquz throttl bh_enbl ksoftird irqexit other 009bee0c 00000000 00004aa7 00000000 00000000 0336a637 00000078 00000000 0054d381 00000000 00004ca0 00000000 00000000 032f8e48 00000000 00000000 I still see dst overflows. But the priority of the ksoftird's can now control the user apps behavior even during softirq DoS. --5cX1WWKSdC Content-Type: application/octet-stream Content-Disposition: attachment; filename="softirq_limit-040405.pat" Content-Transfer-Encoding: base64 LS0tIGtlcm5lbC9zb2Z0aXJxLmMub3JpZwkyMDA0LTAzLTExIDAzOjU1OjI0LjAwMDAwMDAwMCAr MDEwMAorKysga2VybmVsL3NvZnRpcnEuYwkyMDA0LTA0LTA1IDEyOjUyOjQwLjAwMDAwMDAwMCAr MDIwMApAQCAtNTgsNiArNTgsMTQgQEAKIAkJd2FrZV91cF9wcm9jZXNzKHRzayk7CiB9CiAKK3N0 YXRpYyBpbmxpbmUgaW50IGNhbl9ydW5fa3NvZnRpcnFkKHZvaWQpCit7CisgICAgICAgLyogSW50 ZXJydXB0cyBhcmUgZGlzYWJsZWQ6IG5vIG5lZWQgdG8gc3RvcCBwcmVlbXB0aW9uICovCisgICAg ICAgc3RydWN0IHRhc2tfc3RydWN0ICp0c2sgPSBfX2dldF9jcHVfdmFyKGtzb2Z0aXJxZCk7CisK KyAgICAgICByZXR1cm4gdHNrICYmICEodHNrLT5zdGF0ZSAmICAoVEFTS19ERUFEIHwgVEFTS19a T01CSUUpKTsKK30KKwogLyoKICAqIFdlIHJ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ZCkgCit7CisJX19kb19zb2Z0aXJxKDApOwkK K30KKwogRVhQT1JUX1NZTUJPTChkb19zb2Z0aXJxKTsKIAogdm9pZCBsb2NhbF9iaF9lbmFibGUo dm9pZCkKQEAgLTMyNCw3ICszNDEsNyBAQAogCQlfX3NldF9jdXJyZW50X3N0YXRlKFRBU0tfUlVO TklORyk7CiAKIAkJd2hpbGUgKGxvY2FsX3NvZnRpcnFfcGVuZGluZygpKSB7Ci0JCQlkb19zb2Z0 aXJxKCk7CisJCQlfX2RvX3NvZnRpcnEoMSk7CQogCQkJY29uZF9yZXNjaGVkKCk7CiAJCX0KIAo= --5cX1WWKSdC Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit Cheers. --ro --5cX1WWKSdC-- From hadi@cyberus.ca Tue Apr 6 07:19:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 07:19:24 -0700 (PDT) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36EJ5KO032014 for ; Tue, 6 Apr 2004 07:19:06 -0700 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.20) id 1BArQB-0001l6-Qn for netdev@oss.sgi.com; Tue, 06 Apr 2004 10:19:23 -0400 Received: from [216.209.86.2] (helo=[10.0.0.21]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1BArPl-0005KJ-OE; Tue, 06 Apr 2004 10:18:57 -0400 Subject: Re: Luca Deri's paper: Improving Passive Packet Capture: Beyond Device Polling From: jamal Reply-To: hadi@cyberus.ca To: Jason Lunz Cc: netdev@oss.sgi.com, Luca Deri , Robert Olsson In-Reply-To: References: <20040330142354.GA17671@outblaze.com> <1081033332.2037.61.camel@jzny.localdomain> Content-Type: text/plain Organization: jamalopolis Message-Id: <1081261126.1047.6.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 06 Apr 2004 10:18:46 -0400 Content-Transfer-Encoding: 7bit X-archive-position: 4509 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@cyberus.ca Precedence: bulk X-list: netdev Content-Length: 1628 Lines: 39 On Mon, 2004-04-05 at 12:03, Jason Lunz wrote: > Yes, I read the paper (but not his code). What stood out to me is that > the description of his custom socket implementation matches exactly what > packet-mmap already is. The problem is when you first glance at the paper you think its something new. So that piece is a little misleading. > I noticed he only mentioned testing of libpcap-mmap, but did not use > mmap packet sockets directly -- maybe there's something about libpcap > that limits performance? I haven't looked. More than likely turbo packet was used from some of Alexeys old patches- now obsoleted > What I can say for sure is that the napi + packet-mmap performance with > many small packets is almost surely limited by problems with irq/softirq > load. There was an excellent thread last week about this with Andrea > Arcangeli, Robert Olsson and others about the balancing of softirq and > userspace load; they eventually were beginning to agree that running > softirqs on return from hardirq and bh was a bigger load than expected > when there was lots of napi work to do. So despite NAPI, too much kernel > time is spent handling (soft)irq load with many small packets. I didnt follow that discussion; archived for later entertaining reading. My take on it was it is 2.6.x related and in particular the misbehavior observed has to do with use of rcu in the route cache. > It appears this problem became worse in 2.6 with HZ=1000, because now > the napi rx softirq work is being done 10X as much on return from the > timer interrupt. I'm not sure if a solution was reached. Robert? cheers, jamal From klaus@rechert.de Tue Apr 6 07:23:06 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 07:23:09 -0700 (PDT) Received: from mail.pyramid.de (mail.pyramid.de [213.164.67.210]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36EN4KO032403 for ; Tue, 6 Apr 2004 07:23:05 -0700 Received: from [192.168.0.14] (helo=exch02.intern.pyramid.de) by mail.pyramid.de with esmtp (Exim 4.22) id 1BArTi-0008Vp-4d for netdev@oss.sgi.com; Tue, 06 Apr 2004 16:23:02 +0200 Received: from rechert.de ([192.168.9.21]) by exch02.intern.pyramid.de with Microsoft SMTPSVC(5.0.2195.6713); Tue, 6 Apr 2004 16:23:02 +0200 Message-ID: <4072BD45.6050907@rechert.de> Date: Tue, 06 Apr 2004 16:23:01 +0200 From: Klaus Rechert User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040119 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: 8139too problems Content-Type: multipart/mixed; boundary="------------080706000502090501090600" X-OriginalArrivalTime: 06 Apr 2004 14:23:02.0201 (UTC) FILETIME=[AB32D290:01C41BE2] X-Scan-Signature: c1aeffcbefa68e69990b35ab4369a76e X-archive-position: 4510 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: klaus@rechert.de Precedence: bulk X-list: netdev Content-Length: 5750 Lines: 123 This is a multi-part message in MIME format. --------------080706000502090501090600 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi, i have problems with my 8139c card on a toshiba tecra 8000 since linux-2.6. lspci -vvv attached. Call Trace: [] kobject_register+0x5b/0x60 [] bus_add_driver+0x4a/0xb0 [] driver_register+0x2f/0x40 [] pci_register_driver+0x5c/0x90 [] rtl8139_init_module+0x1b/0x27 [8139too] [] sys_init_module+0x119/0x230 [] syscall_call+0x7/0xb Cheers Klaus --------------080706000502090501090600 Content-Type: text/plain; name="lspci" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="lspci" 00:00.0 Host bridge: Intel Corp. 440BX/ZX/DX - 82443BX/ZX/DX Host bridge (AGP disabled) (rev 03) Subsystem: Toshiba America Info Systems: Unknown device 0001 Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- 00:05.0 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 02) Control: I/O+ Mem+ BusMaster+ SpecCycle+ MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- TAbort- SERR- Reset- 16bInt+ PostWrite+ 16-bit legacy interface ports at 0001 00:0b.1 CardBus bridge: Toshiba America Info Systems ToPIC97 (rev 05) Subsystem: Toshiba America Info Systems: Unknown device 0001 Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=slow >TAbort- SERR- Reset- 16bInt- PostWrite+ 16-bit legacy interface ports at 0001 05:00.0 Ethernet controller: Abocom Systems Inc RTL8139 [FE2000VX] CardBus Fast Ethernet Attached Port Adapter (rev 10) Subsystem: Abocom Systems Inc RTL8139 [FE2000VX] CardBus Fast Ethernet Attached Port Adapter Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- --------------080706000502090501090600-- From Robert.Olsson@data.slu.se Tue Apr 6 08:31:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 08:31:34 -0700 (PDT) Received: from mail1.slu.se (mail1.slu.se [130.238.96.11]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36FVUKO006033 for ; Tue, 6 Apr 2004 08:31:31 -0700 Received: from robur.slu.se (robur.slu.se [130.238.98.12]) by mail1.slu.se (8.12.10/8.12.10) with ESMTP id i36FVJNv015504; Tue, 6 Apr 2004 17:31:20 +0200 Received: by robur.slu.se (Postfix, from userid 1000) id BA275903D5; Tue, 6 Apr 2004 17:31:19 +0200 (CEST) From: Robert Olsson MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16498.52551.712261.214192@robur.slu.se> Date: Tue, 6 Apr 2004 17:31:19 +0200 To: hadi@cyberus.ca Cc: Jason Lunz , netdev@oss.sgi.com, Luca Deri , Robert Olsson Subject: Re: Luca Deri's paper: Improving Passive Packet Capture: Beyond Device Polling In-Reply-To: <1081261126.1047.6.camel@jzny.localdomain> References: <20040330142354.GA17671@outblaze.com> <1081033332.2037.61.camel@jzny.localdomain> <1081261126.1047.6.camel@jzny.localdomain> X-Mailer: VM 7.17 under Emacs 21.3.1 X-archive-position: 4512 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Robert.Olsson@data.slu.se Precedence: bulk X-list: netdev Content-Length: 1499 Lines: 36 jamal writes: > I didnt follow that discussion; archived for later entertaining reading. > My take on it was it is 2.6.x related and in particular the misbehavior > observed has to do with use of rcu in the route cache. > > > It appears this problem became worse in 2.6 with HZ=1000, because now > > the napi rx softirq work is being done 10X as much on return from the > > timer interrupt. I'm not sure if a solution was reached. > > Robert? Well it's a general problem controlling softirq/user and the RCU locking put this on our agenda as the dst hash was among the first applications to use the RCU locking. Which in turn had problem doing progress in hard softirq environment which happens during route cache DoS. NAPI is a part of RX_SOFTIRQ which is well-behaved. NAPI addresses only irq/sofirq problem and is totally innocent for do_sofirq() run from other parts of kernel causing userland starvation. Under normal hi-load conditions RX_SOFTIRQ schedules itself when the netdev_max_backlog is done. do_softirq sees this and defers execution to ksoftirqd and things get under (scheduler) control. During route DoS, code that does a lot do_softirq() is run for hash and fib-lookup, GC etc. The effect is that ksoftirqd is more or less bypassed. Again it's a general problem... We are just the unlucky guys getting into this. I don't know if packet capture tests done by Luca ran into this problems. A profile could have helped... Cheers. --ro From jgarzik@pobox.com Tue Apr 6 08:30:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 08:30:31 -0700 (PDT) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36FUNKO005857 for ; Tue, 6 Apr 2004 08:30:26 -0700 Received: from rdu74-153-143.nc.rr.com ([24.74.153.143] helo=pobox.com) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1BAsWs-0007n3-8o; Tue, 06 Apr 2004 16:30:22 +0100 Message-ID: <4072CD01.6070408@pobox.com> Date: Tue, 06 Apr 2004 11:30:09 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030703 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Netdev CC: Linux Kernel , Andrew Morton Subject: [NET] net driver updates Content-Type: multipart/mixed; boundary="------------080600040902090101010001" X-archive-position: 4511 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: 4579 Lines: 131 This is a multi-part message in MIME format. --------------080600040902090101010001 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit With upstream 2.6.x having been frozen for a while (and will be until end of week or so), a bunch of net driver updates have accumulated. Even though the shortlog output is attached, here's an even shorter summary: * acenic converted to PCI API (yay!). Please test. * new 10gige driver, s2io * Francois work on r8169, epic100, sis190: PCI DMA, NAPI, other minor fixes and cleanups * 8139cp, pcnet32 updates * other minor stuff BK repository: http://gkernel.bkbits.net/netdev-2.6 Patch: ftp://ftp.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.5-netdev2.patch.bz2 --------------080600040902090101010001 Content-Type: text/plain; name="changelog.txt" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename="changelog.txt" Andrew Morton: o s2io.h: gcc-3.5 build fix Christoph Hellwig: o convert acenic to pci_driver API o kill acient compat cruft from acenic Daniel Ritz: o netdev_priv for xirc2ps_cs, nmclan_cs Domen Puncer: o lmc header file not needed Don Fry: o pcnet32 add led blink capability o pcnet32 correct name display o pcnet32 all printk under netif_msg o pcnet32.c add support for 79C976 François Romieu: o [netdrvr r8169] TX irq handler looping fix o [netdrvr r8169] DAC changes o [netdrvr r8169] Barrier against compiler optimization o [netdrvr r8169] ethtool driver info o [netdrvr r8169] DMA api resync o [netdrvr sis190] more RX path work o [netdrvr sis190] don't use one huge buffer for all RX skb's o [netdrvr sis190] add dirty_rx to private structure o [netdrvr sis190] separate out RX skb alloc, fill o [netdrvr sis190] add helpers o [netdrvr sis190] sis190_open() fixes/updates o [netdrvr sis190] add pci-disable-device o [netdrvr sis190] fix endianness issues o [netdrvr epic100] napi fixes o [netdrvr epic100] napi 3/3 - transmit path o [netdrvr epic100] napi 2/3 - receive path o [netdrvr epic100] napi 1/3 - just shuffle some code around o [netdrvr epic100] minor cleanups o [netdrvr r8169] Rx wrap bug o [netdrvr r8169] fix TX race o [netdrvr r8169] fix phy initialization loop init o [netdrvr r8169] fix rx counter masking bug o [netdrvr r8169] fix oops by removing __devinitdata marker o 2.6.1-rc1-mm1 - typo of death in the r8169 driver o [netdrvr r8169] Stats fix (Fernando Alencar Marótica ) o [netdrvr r8169] Endianness update (original idea from Alexandra N. Kossovsky) o [netdrvr r8169] fix RX o [netdrvr r8169] Suspend/resume code (Fernando Alencar Marótica) o [netdrvr r8169] Modification of the interrupt mask (RealTek) o [netdrvr r8169] Driver forgot to update the transmitted bytes counter o [netdrvr r8169] Merge of changes from Realtek o [netdrvr r8169] Merge of timer related changes from Realtek o [netdrvr r8169] Merge of changes done by Realtek to rtl8169_init_one() o [netdrvr r8169] Add {mac/phy}_version o [netdrvr r8169] Rx copybreak for small packets o [netdrvr r8169] Conversion of Tx data buffers to PCI DMA o [netdrvr r8169] rtl8169_start_xmit fixes o [netdrvr r8169] Conversion of Rx data buffers to PCI DMA o [netdrvr r8169] Conversion of Rx/Tx descriptors to consistent DMA Hirofumi Ogawa: o 8139too: more useful debug info for tx_timeout Jeff Garzik: o [netdrvr natsemi] correct DP83816 IntrHoldoff register offset o [netdrvr 8139cp] better dev->close() handling, and misc related stuff o [netdrvr 8139cp] complete 64-bit DMA (PCI DAC) support o [netdrvr 8139cp] use netdev_priv() o [netdrvr 8139cp] minor cleanups o [NET] define HAVE_NETDEV_PRIV back-compat hook o [netdrvr 8139cp] locking cleanups o [netdrvr s2io] NAPI build fixes o [netdrvr 8139cp] rearrange priv struct, add cacheline-align markers o [net/fc iph5526] s/rx_dropped/tx_dropped/ in TX routines o [netdrvr s2io] correct an incorrect cleanup I made o [netdrvr] Add S2IO 10gige network driver o Remove unused compatibility-defines include wan/lmc/lmc_ver.h o Manually merge with upstream Jeff Muizelaar: o tc35815 cleanup Leana Ogasawara: o dgrs: add missing iounmaps Luiz Fernando N. Capitulino: o com20020-isa.c warning fix Pavel Machek: o Support newer revisions of broadcoms in b44.c Randy Dunlap: o remove magic '31' for netdev priv. alignment Scott Feldman: o Update MAINTAINERS with new e100/e1000/ixgb maintainers --------------080600040902090101010001-- From linux-netdev@gmane.org Tue Apr 6 09:01:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 09:01:29 -0700 (PDT) Received: from main.gmane.org (main.gmane.org [80.91.224.249]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36G1OKO007650 for ; Tue, 6 Apr 2004 09:01:26 -0700 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1BAt0u-00020w-00 for ; Tue, 06 Apr 2004 18:01:24 +0200 Received: from finn.gmane.org ([80.91.224.251]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Apr 2004 18:01:23 +0200 Received: from lunz by finn.gmane.org with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 06 Apr 2004 18:01:23 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: netdev@oss.sgi.com From: Jason Lunz Subject: Re: Luca Deri's paper: Improving Passive Packet Capture: Beyond Device Polling Date: Tue, 6 Apr 2004 16:01:20 +0000 (UTC) Organization: PBR Streetgang Message-ID: References: <20040330142354.GA17671@outblaze.com> <1081033332.2037.61.camel@jzny.localdomain> <407286BB.8080107@draigBrady.com> <4072A1CD.8070905@ntop.org> X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: finn.gmane.org User-Agent: slrn/0.9.8.0 (Linux) X-archive-position: 4513 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: lunz@falooley.org Precedence: bulk X-list: netdev Content-Length: 2257 Lines: 51 deri@ntop.org said: > In addition if you do care about performance, I believe you're willing > to turn off packet transmission and only do packet receive. I don't understand what you mean by this. packet-mmap works perfectly well on an UP|PROMISC interface with no addresses bound to it. As long as no packets are injected through a packet socket, the tx path never gets involved. > IRQ: Linux has far too much latency, in particular at high speeds. I'm > not the right person who can say "this is the way to go", however I > believe that we need some sort of interrupt prioritization like RTIRQ > does. I don't think this is the problem, since small-packet performance is bad even with a fully-polling e1000 in NAPI mode. As Robert Olsson has demonstrated, a highly-loaded napi e1000 only generates a few hundred interrupts per second. So the vast majority of packets recieved are coming in without a hardware interrupt occurring at all. Could it be that each time an hw irq _is_ generated, it causes many packets to be lost? That's a possibility. Can you explain in more detail how you measured the effect of interrupt latency on recieve efficiency? > Finally It would be nice to have in the standard Linux core some > packet capture improvements. It could either be based on my work or on > somebody else's work. It doesn't really matter as long as Linux gets > faster. I agree. I think a good place to start would be reading and understanding this thread: http://thread.gmane.org/gmane.linux.kernel/193758 There's some disagreement for a while about where all this softirq load is coming from. It looks like an interaction of softirqs and RCU, but the first patch doesn't help. Finally Olsson pointed out: http://article.gmane.org/gmane.linux.kernel/194412 that the majority of softirq's are being run from hardirq exit. Even with NAPI. At this point, I think, it's clear that the problem exists regardless of rcu, and indeed, Linux is bad at doing packet-mmap RX of a small-packet gigabit flood on both 2.4 and 2.6 (my old 2.4 measurements earlier in this thread show this). I'm particularly interested in trying Andrea's suggestion from http://article.gmane.org/gmane.linux.kernel/194486 , but I won't have the time anytime soon. Jason From ak@suse.de Tue Apr 6 09:29:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 09:29:54 -0700 (PDT) Received: from Cantor.suse.de (ns.suse.de [195.135.220.2]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36GTlKO009059 for ; Tue, 6 Apr 2004 09:29:48 -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 E28FC3FDE48 for ; Tue, 6 Apr 2004 18:29:41 +0200 (CEST) Date: Tue, 6 Apr 2004 18:29:41 +0200 From: Andi Kleen To: netdev@oss.sgi.com Subject: [PATCH] New version of net timestamp optimization Message-Id: <20040406182941.7e759f4c.ak@suse.de> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4514 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ak@suse.de Precedence: bulk X-list: netdev Content-Length: 17222 Lines: 533 New version of the network packet timestamp optimization. Avoid calling gettimeofday in the network fast path when not needed. This version addresses the proxy ARP problems pointed out by Ville. I ended with just using a magic value (-2) to mark these packets instead of 0. Otherwise no changes. Testing/Feedback/Benchmark results appreciated. -Andi diff -u linux-2.6.5rc3-averell/include/net/sock.h-T linux-2.6.5rc3-averell/include/net/sock.h --- linux-2.6.5rc3-averell/include/net/sock.h-T 2004-03-21 21:11:55.000000000 +0100 +++ linux-2.6.5rc3-averell/include/net/sock.h 2004-03-31 09:44:02.000000000 +0200 @@ -382,6 +382,7 @@ SOCK_LINGER, SOCK_DESTROY, SOCK_BROADCAST, + SOCK_TIMESTAMP, }; static inline void sock_set_flag(struct sock *sk, enum sock_flags flag) @@ -1023,11 +1024,33 @@ static __inline__ void sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) { - if (sk->sk_rcvtstamp) - put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMP, sizeof(skb->stamp), &skb->stamp); - else - sk->sk_stamp = skb->stamp; -} + struct timeval *stamp = &skb->stamp; + if (sk->sk_rcvtstamp) { + /* Race occurred between timestamp enabling and packet + receiving. Fill in the current time for now. */ + if (stamp->tv_sec == 0) + do_gettimeofday(stamp); + put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMP, sizeof(struct timeval), + stamp); + } else + sk->sk_stamp = *stamp; +} + +extern atomic_t netstamp_needed; +extern void sock_enable_timestamp(struct sock *sk); +extern void sock_disable_timestamp(struct sock *sk); + +static inline void net_timestamp(struct timeval *stamp) +{ + if (atomic_read(&netstamp_needed)) + do_gettimeofday(stamp); + else { + stamp->tv_sec = 0; + stamp->tv_usec = 0; + } +} + +extern int sock_get_timestamp(struct sock *, struct timeval *); /* * Enable debug/info messages diff -u linux-2.6.5rc3-averell/include/net/neighbour.h-T linux-2.6.5rc3-averell/include/net/neighbour.h --- linux-2.6.5rc3-averell/include/net/neighbour.h-T 2004-03-21 21:11:55.000000000 +0100 +++ linux-2.6.5rc3-averell/include/net/neighbour.h 2004-04-01 23:50:41.000000000 +0200 @@ -281,6 +281,8 @@ return neigh_create(tbl, pkey, dev); } +#define LOCALLY_ENQUEUED -2 + #endif #endif diff -u linux-2.6.5rc3-averell/net/core/sock.c-T linux-2.6.5rc3-averell/net/core/sock.c --- linux-2.6.5rc3-averell/net/core/sock.c-T 1970-01-01 01:12:51.000000000 +0100 +++ linux-2.6.5rc3-averell/net/core/sock.c 2004-03-31 13:45:57.000000000 +0200 @@ -328,6 +328,8 @@ case SO_TIMESTAMP: sk->sk_rcvtstamp = valbool; + if (valbool) + sock_enable_timestamp(sk); break; case SO_RCVLOWAT: @@ -642,6 +644,8 @@ sk->sk_filter = NULL; } + sock_disable_timestamp(sk); + if (atomic_read(&sk->sk_omem_alloc)) printk(KERN_DEBUG "%s: optmem leakage (%d bytes) detected.\n", __FUNCTION__, atomic_read(&sk->sk_omem_alloc)); @@ -1135,6 +1139,9 @@ sk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT; sk->sk_owner = NULL; + sk->sk_stamp.tv_sec = -1L; + sk->sk_stamp.tv_usec = -1L; + atomic_set(&sk->sk_refcnt, 1); } @@ -1160,9 +1167,42 @@ wake_up(&(sk->sk_lock.wq)); spin_unlock_bh(&(sk->sk_lock.slock)); } - EXPORT_SYMBOL(release_sock); +/* When > 0 there are consumers of rx skb time stamps */ +atomic_t netstamp_needed = ATOMIC_INIT(0); + +int sock_get_timestamp(struct sock *sk, struct timeval *userstamp) +{ + if (!sock_flag(sk, SOCK_TIMESTAMP)) + sock_enable_timestamp(sk); + if (sk->sk_stamp.tv_sec == -1) + return -ENOENT; + if (sk->sk_stamp.tv_sec == 0) + do_gettimeofday(&sk->sk_stamp); + return copy_to_user(userstamp, &sk->sk_stamp, sizeof(struct timeval)) ? + -EFAULT : 0; +} +EXPORT_SYMBOL(sock_get_timestamp); + +void sock_enable_timestamp(struct sock *sk) +{ + if (!sock_flag(sk, SOCK_TIMESTAMP)) { + sock_set_flag(sk, SOCK_TIMESTAMP); + atomic_inc(&netstamp_needed); + } +} +EXPORT_SYMBOL(sock_enable_timestamp); + +void sock_disable_timestamp(struct sock *sk) +{ + if (sock_flag(sk, SOCK_TIMESTAMP)) { + sock_reset_flag(sk, SOCK_TIMESTAMP); + atomic_dec(&netstamp_needed); + } +} +EXPORT_SYMBOL(sock_disable_timestamp); + EXPORT_SYMBOL(__lock_sock); EXPORT_SYMBOL(__release_sock); EXPORT_SYMBOL(sk_alloc); diff -u linux-2.6.5rc3-averell/net/core/dev.c-T linux-2.6.5rc3-averell/net/core/dev.c --- linux-2.6.5rc3-averell/net/core/dev.c-T 2004-03-22 01:28:39.000000000 +0100 +++ linux-2.6.5rc3-averell/net/core/dev.c 2004-03-31 09:44:02.000000000 +0200 @@ -1125,7 +1125,7 @@ void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) { struct packet_type *ptype; - do_gettimeofday(&skb->stamp); + net_timestamp(&skb->stamp); rcu_read_lock(); list_for_each_entry_rcu(ptype, &ptype_all, list) { @@ -1546,9 +1546,9 @@ return NET_RX_DROP; } #endif - + if (!skb->stamp.tv_sec) - do_gettimeofday(&skb->stamp); + net_timestamp(&skb->stamp); /* * The code is rearranged so that the path is the most @@ -1710,7 +1710,7 @@ #endif if (!skb->stamp.tv_sec) - do_gettimeofday(&skb->stamp); + net_timestamp(&skb->stamp); skb_bond(skb); diff -u linux-2.6.5rc3-averell/net/core/neighbour.c-T linux-2.6.5rc3-averell/net/core/neighbour.c --- linux-2.6.5rc3-averell/net/core/neighbour.c-T 1970-01-01 01:12:51.000000000 +0100 +++ linux-2.6.5rc3-averell/net/core/neighbour.c 2004-04-01 23:49:23.000000000 +0200 @@ -1094,7 +1094,7 @@ kfree_skb(skb); return; } - skb->stamp.tv_sec = 0; + skb->stamp.tv_sec = LOCALLY_ENQUEUED; skb->stamp.tv_usec = now + sched_next; spin_lock(&tbl->proxy_queue.lock); diff -u linux-2.6.5rc3-averell/net/ipv4/af_inet.c-T linux-2.6.5rc3-averell/net/ipv4/af_inet.c --- linux-2.6.5rc3-averell/net/ipv4/af_inet.c-T 1970-01-01 01:12:51.000000000 +0100 +++ linux-2.6.5rc3-averell/net/ipv4/af_inet.c 2004-03-31 09:44:02.000000000 +0200 @@ -843,11 +843,7 @@ switch (cmd) { case SIOCGSTAMP: - if (!sk->sk_stamp.tv_sec) - err = -ENOENT; - else if (copy_to_user((void *)arg, &sk->sk_stamp, - sizeof(struct timeval))) - err = -EFAULT; + err = sock_get_timestamp(sk, (struct timeval *)arg); break; case SIOCADDRT: case SIOCDELRT: diff -u linux-2.6.5rc3-averell/net/ipv4/arp.c-T linux-2.6.5rc3-averell/net/ipv4/arp.c --- linux-2.6.5rc3-averell/net/ipv4/arp.c-T 1970-01-01 01:12:51.000000000 +0100 +++ linux-2.6.5rc3-averell/net/ipv4/arp.c 2004-04-01 23:49:08.000000000 +0200 @@ -860,7 +860,7 @@ if (n) neigh_release(n); - if (skb->stamp.tv_sec == 0 || + if (skb->stamp.tv_sec == LOCALLY_ENQUEUED || skb->pkt_type == PACKET_HOST || in_dev->arp_parms->proxy_delay == 0) { arp_send(ARPOP_REPLY,ETH_P_ARP,sip,dev,tip,sha,dev->dev_addr,sha); diff -u linux-2.6.5rc3-averell/net/sunrpc/svcsock.c-T linux-2.6.5rc3-averell/net/sunrpc/svcsock.c --- linux-2.6.5rc3-averell/net/sunrpc/svcsock.c-T 2004-03-21 21:12:00.000000000 +0100 +++ linux-2.6.5rc3-averell/net/sunrpc/svcsock.c 2004-03-31 09:44:02.000000000 +0200 @@ -591,6 +591,12 @@ /* possibly an icmp error */ dprintk("svc: recvfrom returned error %d\n", -err); } + if (skb->stamp.tv_sec == 0) { + skb->stamp.tv_sec = xtime.tv_sec; + skb->stamp.tv_usec = xtime.tv_nsec * 1000; + /* Don't enable netstamp, sunrpc doesn't + need that much accuracy */ + } svsk->sk_sk->sk_stamp = skb->stamp; set_bit(SK_DATA, &svsk->sk_flags); /* there may be more data... */ diff -u linux-2.6.5rc3-averell/net/rose/af_rose.c-T linux-2.6.5rc3-averell/net/rose/af_rose.c --- linux-2.6.5rc3-averell/net/rose/af_rose.c-T 2004-03-21 21:12:00.000000000 +0100 +++ linux-2.6.5rc3-averell/net/rose/af_rose.c 2004-03-31 09:44:02.000000000 +0200 @@ -1269,12 +1269,8 @@ } case SIOCGSTAMP: - if (sk != NULL) { - if (!sk->sk_stamp.tv_sec) - return -ENOENT; - return copy_to_user((void *)arg, &sk->sk_stamp, - sizeof(struct timeval)) ? -EFAULT : 0; - } + if (sk != NULL) + return sock_get_timestamp(sk, (struct timeval *)arg); return -EINVAL; case SIOCGIFADDR: diff -u linux-2.6.5rc3-averell/net/irda/af_irda.c-T linux-2.6.5rc3-averell/net/irda/af_irda.c --- linux-2.6.5rc3-averell/net/irda/af_irda.c-T 2004-03-21 21:12:00.000000000 +0100 +++ linux-2.6.5rc3-averell/net/irda/af_irda.c 2004-03-31 09:44:02.000000000 +0200 @@ -1796,14 +1796,8 @@ } case SIOCGSTAMP: - if (sk != NULL) { - if (!sk->sk_stamp.tv_sec) - return -ENOENT; - if (copy_to_user((void *)arg, &sk->sk_stamp, - sizeof(struct timeval))) - return -EFAULT; - return 0; - } + if (sk != NULL) + return sock_get_timestamp(sk, (struct timeval *)arg); return -EINVAL; case SIOCGIFADDR: diff -u linux-2.6.5rc3-averell/net/ipx/af_ipx.c-T linux-2.6.5rc3-averell/net/ipx/af_ipx.c --- linux-2.6.5rc3-averell/net/ipx/af_ipx.c-T 2004-03-21 21:12:00.000000000 +0100 +++ linux-2.6.5rc3-averell/net/ipx/af_ipx.c 2004-03-31 09:44:02.000000000 +0200 @@ -1797,7 +1797,8 @@ copied); if (rc) goto out_free; - sk->sk_stamp = skb->stamp; + if (skb->stamp.tv_sec) + sk->sk_stamp = skb->stamp; msg->msg_namelen = sizeof(*sipx); @@ -1870,15 +1871,8 @@ break; case SIOCGSTAMP: rc = -EINVAL; - if (sk) { - rc = -ENOENT; - if (!sk->sk_stamp.tv_sec) - break; - rc = -EFAULT; - if (!copy_to_user((void *)arg, &sk->sk_stamp, - sizeof(struct timeval))) - rc = 0; - } + if (sk) + rc = sock_get_timestamp(sk, (struct timeval *)arg); break; case SIOCGIFDSTADDR: case SIOCSIFDSTADDR: diff -u linux-2.6.5rc3-averell/net/atm/ioctl.c-T linux-2.6.5rc3-averell/net/atm/ioctl.c --- linux-2.6.5rc3-averell/net/atm/ioctl.c-T 2004-03-21 21:12:00.000000000 +0100 +++ linux-2.6.5rc3-averell/net/atm/ioctl.c 2004-03-31 09:44:02.000000000 +0200 @@ -76,12 +76,8 @@ goto done; } case SIOCGSTAMP: /* borrowed from IP */ - if (!vcc->sk->sk_stamp.tv_sec) { - error = -ENOENT; - goto done; - } - error = copy_to_user((void *)arg, &vcc->sk->sk_stamp, - sizeof(struct timeval)) ? -EFAULT : 0; + error = sock_get_timestamp(vcc->sk, (struct timeval *) + arg); goto done; case ATM_SETSC: printk(KERN_WARNING "ATM_SETSC is obsolete\n"); diff -u linux-2.6.5rc3-averell/net/ax25/af_ax25.c-T linux-2.6.5rc3-averell/net/ax25/af_ax25.c --- linux-2.6.5rc3-averell/net/ax25/af_ax25.c-T 2004-03-21 21:12:00.000000000 +0100 +++ linux-2.6.5rc3-averell/net/ax25/af_ax25.c 2004-03-31 09:44:02.000000000 +0200 @@ -1694,12 +1694,7 @@ case SIOCGSTAMP: if (sk != NULL) { - if (!sk->sk_stamp.tv_sec) { - res = -ENOENT; - break; - } - res = copy_to_user((void *)arg, &sk->sk_stamp, - sizeof(struct timeval)) ? -EFAULT : 0; + res = sock_get_timestamp(sk, (struct timeval *)arg); break; } res = -EINVAL; diff -u linux-2.6.5rc3-averell/net/ipv6/af_inet6.c-T linux-2.6.5rc3-averell/net/ipv6/af_inet6.c --- linux-2.6.5rc3-averell/net/ipv6/af_inet6.c-T 1970-01-01 01:12:51.000000000 +0100 +++ linux-2.6.5rc3-averell/net/ipv6/af_inet6.c 2004-03-31 09:44:02.000000000 +0200 @@ -474,13 +474,7 @@ switch(cmd) { case SIOCGSTAMP: - if (!sk->sk_stamp.tv_sec) - return -ENOENT; - err = copy_to_user((void *)arg, &sk->sk_stamp, - sizeof(struct timeval)); - if (err) - return -EFAULT; - return 0; + return sock_get_timestamp(sk, (struct timeval *)arg); case SIOCADDRT: case SIOCDELRT: diff -u linux-2.6.5rc3-averell/net/ipv6/ndisc.c-T linux-2.6.5rc3-averell/net/ipv6/ndisc.c --- linux-2.6.5rc3-averell/net/ipv6/ndisc.c-T 1970-01-01 01:12:51.000000000 +0100 +++ linux-2.6.5rc3-averell/net/ipv6/ndisc.c 2004-04-01 23:50:23.000000000 +0200 @@ -761,7 +761,7 @@ if (ipv6_chk_acast_addr(dev, &msg->target) || (idev->cnf.forwarding && pneigh_lookup(&nd_tbl, &msg->target, dev, 0))) { - if (skb->stamp.tv_sec != 0 && + if (skb->stamp.tv_sec != LOCALLY_ENQUEUED && skb->pkt_type != PACKET_HOST && inc != 0 && idev->nd_parms->proxy_delay != 0) { diff -u linux-2.6.5rc3-averell/net/rxrpc/transport.c-T linux-2.6.5rc3-averell/net/rxrpc/transport.c --- linux-2.6.5rc3-averell/net/rxrpc/transport.c-T 2004-03-21 21:12:00.000000000 +0100 +++ linux-2.6.5rc3-averell/net/rxrpc/transport.c 2004-03-31 09:44:02.000000000 +0200 @@ -341,6 +341,11 @@ msg->trans = trans; msg->state = RXRPC_MSG_RECEIVED; msg->stamp = pkt->stamp; + if (msg->stamp.tv_sec == 0) { + do_gettimeofday(&msg->stamp); + if (skb->sk) + sock_enable_netstamp(skb->sk); + } msg->seq = ntohl(msg->hdr.seq); /* attach the packet */ diff -u linux-2.6.5rc3-averell/net/sctp/input.c-T linux-2.6.5rc3-averell/net/sctp/input.c --- linux-2.6.5rc3-averell/net/sctp/input.c-T 2004-03-21 21:12:00.000000000 +0100 +++ linux-2.6.5rc3-averell/net/sctp/input.c 2004-03-31 09:44:02.000000000 +0200 @@ -175,6 +175,12 @@ rcvr = asoc ? &asoc->base : &ep->base; sk = rcvr->sk; + /* SCTP seems to always need a timestamp right now (FIXME) */ + if (skb->stamp.tv_sec == 0) { + do_gettimeofday(&skb->stamp); + sock_enable_timestamp(sk); + } + if (!xfrm_policy_check(sk, XFRM_POLICY_IN, skb, family)) goto discard_release; diff -u linux-2.6.5rc3-averell/net/x25/af_x25.c-T linux-2.6.5rc3-averell/net/x25/af_x25.c --- linux-2.6.5rc3-averell/net/x25/af_x25.c-T 2004-03-21 21:12:00.000000000 +0100 +++ linux-2.6.5rc3-averell/net/x25/af_x25.c 2004-03-31 09:44:02.000000000 +0200 @@ -1206,14 +1206,10 @@ } case SIOCGSTAMP: - if (sk) { - rc = -ENOENT; - if (!sk->sk_stamp.tv_sec) - break; - rc = copy_to_user((void *)arg, &sk->sk_stamp, - sizeof(struct timeval)) ? -EFAULT : 0; - } rc = -EINVAL; + if (sk) + rc = sock_get_timestamp(sk, + (struct timeval *)arg); break; case SIOCGIFADDR: case SIOCSIFADDR: diff -u linux-2.6.5rc3-averell/net/wanrouter/af_wanpipe.c-T linux-2.6.5rc3-averell/net/wanrouter/af_wanpipe.c --- linux-2.6.5rc3-averell/net/wanrouter/af_wanpipe.c-T 2004-03-21 21:12:00.000000000 +0100 +++ linux-2.6.5rc3-averell/net/wanrouter/af_wanpipe.c 2004-03-31 09:44:02.000000000 +0200 @@ -1765,13 +1765,7 @@ switch(cmd) { case SIOCGSTAMP: - if (!sk->sk_stamp.tv_sec) - return -ENOENT; - err = -EFAULT; - if (!copy_to_user((void *)arg, &sk->sk_stamp, - sizeof(struct timeval))) - err = 0; - return err; + return sock_get_timestamp(sk, (struct timeval *)arg); case SIOC_WANPIPE_CHECK_TX: diff -u linux-2.6.5rc3-averell/net/packet/af_packet.c-T linux-2.6.5rc3-averell/net/packet/af_packet.c --- linux-2.6.5rc3-averell/net/packet/af_packet.c-T 2004-03-21 21:12:00.000000000 +0100 +++ linux-2.6.5rc3-averell/net/packet/af_packet.c 2004-03-31 09:44:02.000000000 +0200 @@ -606,6 +606,10 @@ h->tp_snaplen = snaplen; h->tp_mac = macoff; h->tp_net = netoff; + if (skb->stamp.tv_sec == 0) { + do_gettimeofday(&skb->stamp); + sock_enable_timestamp(sk); + } h->tp_sec = skb->stamp.tv_sec; h->tp_usec = skb->stamp.tv_usec; @@ -1442,13 +1446,8 @@ return put_user(amount, (int *)arg); } case SIOCGSTAMP: - if (!sk->sk_stamp.tv_sec) - return -ENOENT; - if (copy_to_user((void *)arg, &sk->sk_stamp, - sizeof(struct timeval))) - return -EFAULT; - break; - + return sock_get_timestamp(sk, (struct timeval *)arg); + #ifdef CONFIG_INET case SIOCADDRT: case SIOCDELRT: diff -u linux-2.6.5rc3-averell/net/netrom/af_netrom.c-T linux-2.6.5rc3-averell/net/netrom/af_netrom.c --- linux-2.6.5rc3-averell/net/netrom/af_netrom.c-T 2004-03-21 21:12:00.000000000 +0100 +++ linux-2.6.5rc3-averell/net/netrom/af_netrom.c 2004-03-31 09:44:02.000000000 +0200 @@ -1200,17 +1200,11 @@ } case SIOCGSTAMP: - if (sk != NULL) { - if (!sk->sk_stamp.tv_sec) { - release_sock(sk); - return -ENOENT; - } - ret = copy_to_user((void *)arg, &sk->sk_stamp, sizeof(struct timeval)) ? -EFAULT : 0; - release_sock(sk); - return ret; - } + ret = -EINVAL; + if (sk != NULL) + ret = sock_get_timestamp(sk, (struct timeval *)arg); release_sock(sk); - return -EINVAL; + return ret; case SIOCGIFADDR: case SIOCSIFADDR: diff -u linux-2.6.5rc3-averell/net/appletalk/ddp.c-T linux-2.6.5rc3-averell/net/appletalk/ddp.c --- linux-2.6.5rc3-averell/net/appletalk/ddp.c-T 1970-01-01 01:12:51.000000000 +0100 +++ linux-2.6.5rc3-averell/net/appletalk/ddp.c 2004-03-31 09:44:02.000000000 +0200 @@ -1795,13 +1795,7 @@ break; } case SIOCGSTAMP: - if (!sk) - break; - rc = -ENOENT; - if (!sk->sk_stamp.tv_sec) - break; - rc = copy_to_user((void *)arg, &sk->sk_stamp, - sizeof(struct timeval)) ? -EFAULT : 0; + rc = sock_get_timestamp(sk, (struct timeval *)arg); break; /* Routing */ case SIOCADDRT: diff -u linux-2.6.5rc3-averell/net/econet/af_econet.c-T linux-2.6.5rc3-averell/net/econet/af_econet.c --- linux-2.6.5rc3-averell/net/econet/af_econet.c-T 2004-03-21 21:12:01.000000000 +0100 +++ linux-2.6.5rc3-averell/net/econet/af_econet.c 2004-03-31 09:44:02.000000000 +0200 @@ -665,10 +665,8 @@ switch(cmd) { case SIOCGSTAMP: - if (!sk->sk_stamp.tv_sec) - return -ENOENT; - return copy_to_user((void *)arg, &sk->sk_stamp, - sizeof(struct timeval)) ? -EFAULT : 0; + return sock_get_timestamp(sk,(struct timeval *)arg); + case SIOCSIFADDR: case SIOCGIFADDR: return ec_dev_ioctl(sock, cmd, (void *)arg); From sri@us.ibm.com Tue Apr 6 10:29:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 10:29:19 -0700 (PDT) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36HT3KO011740 for ; Tue, 6 Apr 2004 10:29:13 -0700 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e35.co.us.ibm.com (8.12.10/8.12.2) with ESMTP id i36HSa1v482098; Tue, 6 Apr 2004 13:28:37 -0400 Received: from w-sridhar.beaverton.ibm.com (d03av02.boulder.ibm.com [9.17.193.82]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i36HSYpD372214; Tue, 6 Apr 2004 11:28:35 -0600 Date: Tue, 6 Apr 2004 10:28:36 -0700 (PDT) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: davem@redhat.com cc: netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: [BK PATCH] 2.6 SCTP updates. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 4515 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 25249 Lines: 809 Hi Dave, Please do a bk pull http://linux-lksctp.bkbits.net/lksctp-2.5.work to get the following updates to SCTP on top of linux 2.6.5 Thanks Sridhar # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/04/06 07:32:30-07:00 sri@us.ibm.com # [SCTP] Use id to ptr translation service in lib/idr.c to assign and # validate ids of associations. # # This patch avoids the use of virt_addr_valid() to validate the address # of associations passed by the user. Currently the address of an # association is used as its id. virt_addr_valid doesn't work as # expected when PAGEALLOC debugging is enabled. # # net/sctp/socket.c # net/sctp/sm_make_chunk.c # net/sctp/protocol.c # net/sctp/associola.c # include/net/sctp/structs.h # include/net/sctp/sctp.h # ChangeSet # 2004/04/06 07:24:04-07:00 sri@us.ibm.com # [SCTP] Update sctp_ulpevent structure to include assoc pointer and # only the receive specific fields of sctp_sndrcvinfo. # # net/sctp/ulpqueue.c # net/sctp/ulpevent.c # net/sctp/socket.c # net/sctp/protocol.c # net/sctp/ipv6.c # include/net/sctp/ulpevent.h # # ChangeSet # 2004/04/06 00:28:31-07:00 sri@us.ibm.com # [SCTP] Fix typo in entry name of the remove_proc_entry() call. # # net/sctp/objcnt.c # diff -Nru a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h --- a/include/net/sctp/sctp.h Tue Apr 6 07:35:28 2004 +++ b/include/net/sctp/sctp.h Tue Apr 6 07:35:28 2004 @@ -1,5 +1,5 @@ /* SCTP kernel reference Implementation - * (C) Copyright IBM Corp. 2001, 2003 + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001-2003 Intel Corp. @@ -78,6 +78,7 @@ #include #include #include +#include #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) #include @@ -223,24 +224,6 @@ #define SCTP_INC_STATS_USER(field) SNMP_INC_STATS_USER(sctp_statistics, field) #define SCTP_DEC_STATS(field) SNMP_DEC_STATS(sctp_statistics, field) -/* Determine if this is a valid kernel address. */ -static inline int sctp_is_valid_kaddr(unsigned long addr) -{ - struct page *page; - - /* Make sure the address is not in the user address space. */ - if (addr < PAGE_OFFSET) - return 0; - - page = virt_to_page(addr); - - /* Is this page valid? */ - if (!virt_addr_valid(addr) || PageReserved(page)) - return 0; - - return 1; -} - #endif /* !TEST_FRAME */ @@ -357,7 +340,7 @@ /* Map an association to an assoc_id. */ static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc) { - return (sctp_assoc_t) asoc; + return (asoc?asoc->assoc_id:NULL); } /* Look up the association by its id. */ @@ -518,6 +501,9 @@ extern struct proto sctp_prot; extern struct proc_dir_entry *proc_net_sctp; void sctp_put_port(struct sock *sk); + +extern struct idr sctp_assocs_id; +extern spinlock_t sctp_assocs_id_lock; /* Static inline functions. */ diff -Nru a/include/net/sctp/structs.h b/include/net/sctp/structs.h --- a/include/net/sctp/structs.h Tue Apr 6 07:35:28 2004 +++ b/include/net/sctp/structs.h Tue Apr 6 07:35:28 2004 @@ -1,5 +1,5 @@ /* SCTP kernel reference Implementation - * (C) Copyright IBM Corp. 2001, 2003 + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001 Intel Corp. @@ -1282,11 +1282,8 @@ /* Associations on the same socket. */ struct list_head asocs; - /* This is a signature that lets us know that this is a - * struct sctp_association data structure. Used for mapping an - * association id to an association. - */ - __u32 eyecatcher; + /* association id. */ + sctp_assoc_t assoc_id; /* This is our parent endpoint. */ struct sctp_endpoint *ep; diff -Nru a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h --- a/include/net/sctp/ulpevent.h Tue Apr 6 07:35:27 2004 +++ b/include/net/sctp/ulpevent.h Tue Apr 6 07:35:27 2004 @@ -1,7 +1,7 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. - * Copyright (c) 2001 International Business Machines, Corp. * Copyright (c) 2001 Intel Corp. * Copyright (c) 2001 Nokia, Inc. * Copyright (c) 2001 La Monte H.P. Yarroll @@ -54,7 +54,13 @@ * growing this structure as it is at the maximum limit now. */ struct sctp_ulpevent { - struct sctp_sndrcvinfo sndrcvinfo; + struct sctp_association *asoc; + __u16 stream; + __u16 ssn; + __u16 flags; + __u32 ppid; + __u32 tsn; + __u32 cumtsn; int msg_flags; int iif; }; diff -Nru a/net/sctp/associola.c b/net/sctp/associola.c --- a/net/sctp/associola.c Tue Apr 6 07:35:27 2004 +++ b/net/sctp/associola.c Tue Apr 6 07:35:27 2004 @@ -1,5 +1,5 @@ /* SCTP kernel reference Implementation - * (C) Copyright IBM Corp. 2001, 2003 + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001 Intel Corp. @@ -276,7 +276,7 @@ asoc->need_ecne = 0; - asoc->eyecatcher = SCTP_ASSOC_EYECATCHER; + asoc->assoc_id = (sctp_assoc_t)-1; /* Assume that peer would support both address types unless we are * told otherwise. @@ -360,8 +360,6 @@ sctp_transport_free(transport); } - asoc->eyecatcher = 0; - /* Free any cached ASCONF_ACK chunk. */ if (asoc->addip_last_asconf_ack) sctp_chunk_free(asoc->addip_last_asconf_ack); @@ -381,6 +379,12 @@ sctp_endpoint_put(asoc->ep); sock_put(asoc->base.sk); + if ((int)asoc->assoc_id != -1) { + spin_lock_bh(&sctp_assocs_id_lock); + idr_remove(&sctp_assocs_id, (int)asoc->assoc_id); + spin_unlock_bh(&sctp_assocs_id_lock); + } + if (asoc->base.malloced) { kfree(asoc); SCTP_DBG_OBJCNT_DEC(assoc); @@ -856,26 +860,6 @@ return transport; } -/* Is this a live association structure. */ -int sctp_assoc_valid(struct sock *sk, struct sctp_association *asoc) -{ - - /* First, verify that this is a kernel address. */ - if (!sctp_is_valid_kaddr((unsigned long) asoc)) - return 0; - - /* Verify that this _is_ an sctp_association - * data structure and if so, that the socket matches. - */ - if (SCTP_ASSOC_EYECATCHER != asoc->eyecatcher) - return 0; - if (asoc->base.sk != sk) - return 0; - - /* The association is valid. */ - return 1; -} - /* Do delayed input processing. This is scheduled by sctp_rcv(). */ static void sctp_assoc_bh_rcv(struct sctp_association *asoc) { @@ -891,6 +875,7 @@ sk = asoc->base.sk; inqueue = &asoc->base.inqueue; + sctp_association_hold(asoc); while (NULL != (chunk = sctp_inq_pop(inqueue))) { state = asoc->state; subtype = chunk->chunk_hdr->type; @@ -913,14 +898,14 @@ /* Check to see if the association is freed in response to * the incoming chunk. If so, get out of the while loop. */ - if (!sctp_assoc_valid(sk, asoc)) + if (asoc->base.dead) break; /* If there is an error on chunk, discard this packet. */ if (error && chunk) chunk->pdiscard = 1; } - + sctp_association_put(asoc); } /* This routine moves an association from its old sk to a new sk. */ diff -Nru a/net/sctp/ipv6.c b/net/sctp/ipv6.c --- a/net/sctp/ipv6.c Tue Apr 6 07:35:28 2004 +++ b/net/sctp/ipv6.c Tue Apr 6 07:35:28 2004 @@ -1,7 +1,7 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2002, 2004 * Copyright (c) 2001 Nokia, Inc. * Copyright (c) 2001 La Monte H.P. Yarroll - * Copyright (c) 2002-2003 International Business Machines, Corp. * Copyright (c) 2002-2003 Intel Corp. * * This file is part of the SCTP kernel reference Implementation @@ -698,7 +698,7 @@ union sctp_addr *addr; struct sctp_association *asoc; - asoc = event->sndrcvinfo.sinfo_assoc_id; + asoc = event->asoc; sctp_inet6_msgname(msgname, addrlen); sin6 = (struct sockaddr_in6 *)msgname; sin6->sin6_port = htons(asoc->peer.port); diff -Nru a/net/sctp/objcnt.c b/net/sctp/objcnt.c --- a/net/sctp/objcnt.c Tue Apr 6 07:35:27 2004 +++ b/net/sctp/objcnt.c Tue Apr 6 07:35:27 2004 @@ -1,5 +1,5 @@ /* SCTP kernel reference Implementation - * Copyright (c) 2001 International Business Machines Corp. + * (C) Copyright IBM Corp. 2001, 2004 * * This file is part of the SCTP kernel reference Implementation * @@ -134,7 +134,7 @@ /* Cleanup the objcount entry in the proc filesystem. */ void sctp_dbg_objcnt_exit(void) { - remove_proc_entry("sctp_dbg_objcount", proc_net_sctp); + remove_proc_entry("sctp_dbg_objcnt", proc_net_sctp); } diff -Nru a/net/sctp/protocol.c b/net/sctp/protocol.c --- a/net/sctp/protocol.c Tue Apr 6 07:35:28 2004 +++ b/net/sctp/protocol.c Tue Apr 6 07:35:28 2004 @@ -64,6 +64,9 @@ struct proc_dir_entry *proc_net_sctp; DEFINE_SNMP_STAT(struct sctp_mib, sctp_statistics); +struct idr sctp_assocs_id; +spinlock_t sctp_assocs_id_lock = SPIN_LOCK_UNLOCKED; + /* This is the global socket data structure used for responding to * the Out-of-the-blue (OOTB) packets. A control sock will be created * for this socket at the initialization time. @@ -721,7 +724,7 @@ if (msgname) { struct sctp_association *asoc; - asoc = event->sndrcvinfo.sinfo_assoc_id; + asoc = event->asoc; sctp_inet_msgname(msgname, addr_len); sin = (struct sockaddr_in *)msgname; sinfrom = &asoc->peer.primary_addr.v4; @@ -1048,6 +1051,9 @@ /* Initialize default stream count setup information. */ sctp_max_instreams = SCTP_DEFAULT_INSTREAMS; sctp_max_outstreams = SCTP_DEFAULT_OUTSTREAMS; + + /* Initialize handle used for association ids. */ + idr_init(&sctp_assocs_id); /* Size and allocate the association hash table. * The methodology is similar to that of the tcp hash tables. diff -Nru a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c --- a/net/sctp/sm_make_chunk.c Tue Apr 6 07:35:28 2004 +++ b/net/sctp/sm_make_chunk.c Tue Apr 6 07:35:28 2004 @@ -1,5 +1,5 @@ /* SCTP kernel reference Implementation - * (C) Copyright IBM Corp. 2001, 2003 + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. * Copyright (c) 2001-2002 Intel Corp. @@ -1817,10 +1817,23 @@ /* Allocate storage for the negotiated streams if it is not a temporary * association. */ if (!asoc->temp) { + sctp_assoc_t assoc_id; + asoc->ssnmap = sctp_ssnmap_new(asoc->c.sinit_max_instreams, asoc->c.sinit_num_ostreams, gfp); if (!asoc->ssnmap) - goto nomem_ssnmap; + goto clean_up; + + do { + if (unlikely(!idr_pre_get(&sctp_assocs_id, gfp))) + goto clean_up; + spin_lock_bh(&sctp_assocs_id_lock); + assoc_id = (sctp_assoc_t)idr_get_new(&sctp_assocs_id, + (void *)asoc); + spin_unlock_bh(&sctp_assocs_id_lock); + } while (unlikely((int)assoc_id == -1)); + + asoc->assoc_id = assoc_id; } /* ADDIP Section 4.1 ASCONF Chunk Procedures @@ -1836,7 +1849,6 @@ asoc->peer.addip_serial = asoc->peer.i.initial_tsn - 1; return 1; -nomem_ssnmap: clean_up: /* Release the transport structures. */ list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { diff -Nru a/net/sctp/socket.c b/net/sctp/socket.c --- a/net/sctp/socket.c Tue Apr 6 07:35:28 2004 +++ b/net/sctp/socket.c Tue Apr 6 07:35:28 2004 @@ -135,8 +135,14 @@ } /* Otherwise this is a UDP-style socket. */ - asoc = (struct sctp_association *)id; - if (!sctp_assoc_valid(sk, asoc)) + if (!id || (id == (sctp_assoc_t)-1)) + return NULL; + + spin_lock_bh(&sctp_assocs_id_lock); + asoc = (struct sctp_association *)idr_find(&sctp_assocs_id, (int)id); + spin_unlock_bh(&sctp_assocs_id_lock); + + if (!asoc || (asoc->base.sk != sk) || asoc->base.dead) return NULL; return asoc; @@ -1498,8 +1504,7 @@ * rwnd by that amount. If all the data in the skb is read, * rwnd is updated when the event is freed. */ - sctp_assoc_rwnd_increase(event->sndrcvinfo.sinfo_assoc_id, - copied); + sctp_assoc_rwnd_increase(event->asoc, copied); goto out; } else if ((event->msg_flags & MSG_NOTIFICATION) || (event->msg_flags & MSG_EOR)) @@ -4477,7 +4482,7 @@ */ sctp_skb_for_each(skb, &oldsk->sk_receive_queue, tmp) { event = sctp_skb2event(skb); - if (event->sndrcvinfo.sinfo_assoc_id == assoc) { + if (event->asoc == assoc) { __skb_unlink(skb, skb->list); __skb_queue_tail(&newsk->sk_receive_queue, skb); } @@ -4506,7 +4511,7 @@ */ sctp_skb_for_each(skb, &oldsp->pd_lobby, tmp) { event = sctp_skb2event(skb); - if (event->sndrcvinfo.sinfo_assoc_id == assoc) { + if (event->asoc == assoc) { __skb_unlink(skb, skb->list); __skb_queue_tail(queue, skb); } diff -Nru a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c --- a/net/sctp/ulpevent.c Tue Apr 6 07:35:28 2004 +++ b/net/sctp/ulpevent.c Tue Apr 6 07:35:28 2004 @@ -1,7 +1,7 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. - * Copyright (c) 2001 International Business Machines, Corp. * Copyright (c) 2001 Intel Corp. * Copyright (c) 2001 Nokia, Inc. * Copyright (c) 2001 La Monte H.P. Yarroll @@ -590,8 +590,7 @@ struct sctp_chunk *chunk, int gfp) { - struct sctp_ulpevent *event; - struct sctp_sndrcvinfo *info; + struct sctp_ulpevent *event = NULL; struct sk_buff *skb; size_t padding, len; @@ -624,101 +623,21 @@ /* Initialize event with flags 0. */ sctp_ulpevent_init(event, 0); - event->iif = sctp_chunk_iif(chunk); - sctp_ulpevent_receive_data(event, asoc); - info = (struct sctp_sndrcvinfo *) &event->sndrcvinfo; - - /* Sockets API Extensions for SCTP - * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) - * - * sinfo_stream: 16 bits (unsigned integer) - * - * For recvmsg() the SCTP stack places the message's stream number in - * this value. - */ - info->sinfo_stream = ntohs(chunk->subh.data_hdr->stream); - - /* Sockets API Extensions for SCTP - * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) - * - * sinfo_ssn: 16 bits (unsigned integer) - * - * For recvmsg() this value contains the stream sequence number that - * the remote endpoint placed in the DATA chunk. For fragmented - * messages this is the same number for all deliveries of the message - * (if more than one recvmsg() is needed to read the message). - */ - info->sinfo_ssn = ntohs(chunk->subh.data_hdr->ssn); - - /* Sockets API Extensions for SCTP - * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) - * - * sinfo_ppid: 32 bits (unsigned integer) - * - * In recvmsg() this value is - * the same information that was passed by the upper layer in the peer - * application. Please note that byte order issues are NOT accounted - * for and this information is passed opaquely by the SCTP stack from - * one end to the other. - */ - info->sinfo_ppid = chunk->subh.data_hdr->ppid; - - /* Sockets API Extensions for SCTP - * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) - * - * sinfo_flags: 16 bits (unsigned integer) - * - * This field may contain any of the following flags and is composed of - * a bitwise OR of these values. - * - * recvmsg() flags: - * - * MSG_UNORDERED - This flag is present when the message was sent - * non-ordered. - */ + event->stream = ntohs(chunk->subh.data_hdr->stream); + event->ssn = ntohs(chunk->subh.data_hdr->ssn); + event->ppid = chunk->subh.data_hdr->ppid; if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) { - info->sinfo_flags |= MSG_UNORDERED; - - /* sinfo_cumtsn: 32 bit (unsigned integer) - * - * This field will hold the current cumulative TSN as - * known by the underlying SCTP layer. Note this field is - * ignored when sending and only valid for a receive - * operation when sinfo_flags are set to MSG_UNORDERED. - */ - info->sinfo_cumtsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); + event->flags |= MSG_UNORDERED; + event->cumtsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); } - - /* Note: For reassembly, we need to have the fragmentation bits. - * For now, merge these into the msg_flags, since those bit - * possitions are not used. - */ + event->tsn = ntohl(chunk->subh.data_hdr->tsn); event->msg_flags |= chunk->chunk_hdr->flags; - - /* With 04 draft, tsn moves into sndrcvinfo. */ - info->sinfo_tsn = ntohl(chunk->subh.data_hdr->tsn); - - /* Context is not used on receive. */ - info->sinfo_context = 0; - - /* Sockets API Extensions for SCTP - * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) - * - * sinfo_assoc_id: sizeof (sctp_assoc_t) - * - * The association handle field, sinfo_assoc_id, holds the identifier - * for the association announced in the COMMUNICATION_UP notification. - * All notifications for a given association have the same identifier. - * Ignored for TCP-style sockets. - */ - info->sinfo_assoc_id = sctp_assoc2id(asoc); - - return event; + event->iif = sctp_chunk_iif(chunk); fail: - return NULL; + return event; } /* Create a partial delivery related event. @@ -797,11 +716,77 @@ void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, struct msghdr *msghdr) { - if (!sctp_ulpevent_is_notification(event)) { - put_cmsg(msghdr, IPPROTO_SCTP, SCTP_SNDRCV, - sizeof(struct sctp_sndrcvinfo), - (void *) &event->sndrcvinfo); - } + struct sctp_sndrcvinfo sinfo; + + if (sctp_ulpevent_is_notification(event)) + return; + + /* Sockets API Extensions for SCTP + * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) + * + * sinfo_stream: 16 bits (unsigned integer) + * + * For recvmsg() the SCTP stack places the message's stream number in + * this value. + */ + sinfo.sinfo_stream = event->stream; + /* sinfo_ssn: 16 bits (unsigned integer) + * + * For recvmsg() this value contains the stream sequence number that + * the remote endpoint placed in the DATA chunk. For fragmented + * messages this is the same number for all deliveries of the message + * (if more than one recvmsg() is needed to read the message). + */ + sinfo.sinfo_ssn = event->ssn; + /* sinfo_ppid: 32 bits (unsigned integer) + * + * In recvmsg() this value is + * the same information that was passed by the upper layer in the peer + * application. Please note that byte order issues are NOT accounted + * for and this information is passed opaquely by the SCTP stack from + * one end to the other. + */ + sinfo.sinfo_ppid = event->ppid; + /* sinfo_flags: 16 bits (unsigned integer) + * + * This field may contain any of the following flags and is composed of + * a bitwise OR of these values. + * + * recvmsg() flags: + * + * MSG_UNORDERED - This flag is present when the message was sent + * non-ordered. + */ + sinfo.sinfo_flags = event->flags; + /* sinfo_tsn: 32 bit (unsigned integer) + * + * For the receiving side, this field holds a TSN that was + * assigned to one of the SCTP Data Chunks. + */ + sinfo.sinfo_tsn = event->tsn; + /* sinfo_cumtsn: 32 bit (unsigned integer) + * + * This field will hold the current cumulative TSN as + * known by the underlying SCTP layer. Note this field is + * ignored when sending and only valid for a receive + * operation when sinfo_flags are set to MSG_UNORDERED. + */ + sinfo.sinfo_cumtsn = event->cumtsn; + /* sinfo_assoc_id: sizeof (sctp_assoc_t) + * + * The association handle field, sinfo_assoc_id, holds the identifier + * for the association announced in the COMMUNICATION_UP notification. + * All notifications for a given association have the same identifier. + * Ignored for one-to-one style sockets. + */ + sinfo.sinfo_assoc_id = sctp_assoc2id(event->asoc); + + /* These fields are not used while receiving. */ + sinfo.sinfo_context = 0; + sinfo.sinfo_timetolive = 0; + + put_cmsg(msghdr, IPPROTO_SCTP, SCTP_SNDRCV, + sizeof(struct sctp_sndrcvinfo), (void *)&sinfo); } /* Stub skb destructor. */ @@ -831,14 +816,14 @@ sctp_association_hold((struct sctp_association *)asoc); skb = sctp_event2skb(event); skb->sk = asoc->base.sk; - event->sndrcvinfo.sinfo_assoc_id = sctp_assoc2id(asoc); + event->asoc = (struct sctp_association *)asoc; skb->destructor = sctp_stub_rfree; } /* A simple destructor to give up the reference to the association. */ static inline void sctp_ulpevent_release_owner(struct sctp_ulpevent *event) { - sctp_association_put(event->sndrcvinfo.sinfo_assoc_id); + sctp_association_put(event->asoc); } /* Do accounting for bytes received and hold a reference to the association @@ -880,8 +865,7 @@ */ skb = sctp_event2skb(event); - sctp_assoc_rwnd_increase(event->sndrcvinfo.sinfo_assoc_id, - skb_headlen(skb)); + sctp_assoc_rwnd_increase(event->asoc, skb_headlen(skb)); /* Don't forget the fragments. */ for (frag = skb_shinfo(skb)->frag_list; frag; frag = frag->next) { diff -Nru a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c --- a/net/sctp/ulpqueue.c Tue Apr 6 07:35:28 2004 +++ b/net/sctp/ulpqueue.c Tue Apr 6 07:35:28 2004 @@ -1,7 +1,7 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. - * Copyright (c) 2001-2003 International Business Machines, Corp. * Copyright (c) 2001 Intel Corp. * Copyright (c) 2001 Nokia, Inc. * Copyright (c) 2001 La Monte H.P. Yarroll @@ -251,7 +251,7 @@ struct sctp_ulpevent *cevent; __u32 tsn, ctsn; - tsn = event->sndrcvinfo.sinfo_tsn; + tsn = event->tsn; /* See if it belongs at the end. */ pos = skb_peek_tail(&ulpq->reasm); @@ -262,7 +262,7 @@ /* Short circuit just dropping it at the end. */ cevent = sctp_skb2event(pos); - ctsn = cevent->sndrcvinfo.sinfo_tsn; + ctsn = cevent->tsn; if (TSN_lt(ctsn, tsn)) { __skb_queue_tail(&ulpq->reasm, sctp_event2skb(event)); return; @@ -271,7 +271,7 @@ /* Find the right place in this list. We store them by TSN. */ skb_queue_walk(&ulpq->reasm, pos) { cevent = sctp_skb2event(pos); - ctsn = cevent->sndrcvinfo.sinfo_tsn; + ctsn = cevent->tsn; if (TSN_lt(tsn, ctsn)) break; @@ -368,7 +368,7 @@ */ skb_queue_walk(&ulpq->reasm, pos) { cevent = sctp_skb2event(pos); - ctsn = cevent->sndrcvinfo.sinfo_tsn; + ctsn = cevent->tsn; switch (cevent->msg_flags & SCTP_DATA_FRAG_MASK) { case SCTP_DATA_FIRST_FRAG: @@ -425,7 +425,7 @@ skb_queue_walk(&ulpq->reasm, pos) { cevent = sctp_skb2event(pos); - ctsn = cevent->sndrcvinfo.sinfo_tsn; + ctsn = cevent->tsn; switch (cevent->msg_flags & SCTP_DATA_FRAG_MASK) { case SCTP_DATA_MIDDLE_FRAG: @@ -486,7 +486,7 @@ /* Do not even bother unless this is the next tsn to * be delivered. */ - ctsn = event->sndrcvinfo.sinfo_tsn; + ctsn = event->tsn; ctsnap = sctp_tsnmap_get_ctsn(&ulpq->asoc->peer.tsn_map); if (TSN_lte(ctsn, ctsnap)) retval = sctp_ulpq_retrieve_partial(ulpq); @@ -517,7 +517,7 @@ skb_queue_walk(&ulpq->reasm, pos) { cevent = sctp_skb2event(pos); - ctsn = cevent->sndrcvinfo.sinfo_tsn; + ctsn = cevent->tsn; switch (cevent->msg_flags & SCTP_DATA_FRAG_MASK) { case SCTP_DATA_FIRST_FRAG: @@ -563,15 +563,15 @@ __u16 sid, csid; __u16 ssn, cssn; - sid = event->sndrcvinfo.sinfo_stream; - ssn = event->sndrcvinfo.sinfo_ssn; + sid = event->stream; + ssn = event->ssn; in = &ulpq->asoc->ssnmap->in; /* We are holding the chunks by stream, by SSN. */ sctp_skb_for_each(pos, &ulpq->lobby, tmp) { cevent = (struct sctp_ulpevent *) pos->cb; - csid = cevent->sndrcvinfo.sinfo_stream; - cssn = cevent->sndrcvinfo.sinfo_ssn; + csid = cevent->stream; + cssn = cevent->ssn; /* Have we gone too far? */ if (csid > sid) @@ -609,12 +609,12 @@ return; } - sid = event->sndrcvinfo.sinfo_stream; - ssn = event->sndrcvinfo.sinfo_ssn; + sid = event->stream; + ssn = event->ssn; cevent = (struct sctp_ulpevent *) pos->cb; - csid = cevent->sndrcvinfo.sinfo_stream; - cssn = cevent->sndrcvinfo.sinfo_ssn; + csid = cevent->stream; + cssn = cevent->ssn; if (sid > csid) { __skb_queue_tail(&ulpq->lobby, sctp_event2skb(event)); return; @@ -630,8 +630,8 @@ */ skb_queue_walk(&ulpq->lobby, pos) { cevent = (struct sctp_ulpevent *) pos->cb; - csid = cevent->sndrcvinfo.sinfo_stream; - cssn = cevent->sndrcvinfo.sinfo_ssn; + csid = cevent->stream; + cssn = cevent->ssn; if (csid > sid) break; @@ -656,8 +656,8 @@ return event; /* Note: The stream ID must be verified before this routine. */ - sid = event->sndrcvinfo.sinfo_stream; - ssn = event->sndrcvinfo.sinfo_ssn; + sid = event->stream; + ssn = event->ssn; in = &ulpq->asoc->ssnmap->in; /* Is this the expected SSN for this stream ID? */ @@ -694,7 +694,7 @@ while ((skb = __skb_dequeue_tail(&ulpq->lobby))) { freed += skb_headlen(skb); event = sctp_skb2event(skb); - tsn = event->sndrcvinfo.sinfo_tsn; + tsn = event->tsn; sctp_ulpevent_free(event); sctp_tsnmap_renege(tsnmap, tsn); @@ -720,7 +720,7 @@ while ((skb = __skb_dequeue_tail(&ulpq->reasm))) { freed += skb_headlen(skb); event = sctp_skb2event(skb); - tsn = event->sndrcvinfo.sinfo_tsn; + tsn = event->tsn; sctp_ulpevent_free(event); sctp_tsnmap_renege(tsnmap, tsn); From greearb@candelatech.com Tue Apr 6 11:40:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 11:40:54 -0700 (PDT) Received: from ns1.wanfear.com (ns1.wanfear.com [207.212.57.1]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36IelKO014480 for ; Tue, 6 Apr 2004 11:40:49 -0700 Received: from candelatech.com (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) (authenticated bits=0) by ns1.wanfear.com (8.12.10/8.12.10) with ESMTP id i36IeiPR029094; Tue, 6 Apr 2004 11:40:45 -0700 Message-ID: <4072F9AC.7010307@candelatech.com> Date: Tue, 06 Apr 2004 11:40:44 -0700 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jason Lunz CC: netdev@oss.sgi.com Subject: Re: Luca Deri's paper: Improving Passive Packet Capture: Beyond Device Polling References: <20040330142354.GA17671@outblaze.com> <1081033332.2037.61.camel@jzny.localdomain> <407286BB.8080107@draigBrady.com> <4072A1CD.8070905@ntop.org> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 4516 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: greearb@candelatech.com Precedence: bulk X-list: netdev Content-Length: 1293 Lines: 37 Jason Lunz wrote: > deri@ntop.org said: > >>In addition if you do care about performance, I believe you're willing >>to turn off packet transmission and only do packet receive. > > > I don't understand what you mean by this. packet-mmap works perfectly > well on an UP|PROMISC interface with no addresses bound to it. As long > as no packets are injected through a packet socket, the tx path never > gets involved. > > >>IRQ: Linux has far too much latency, in particular at high speeds. I'm >>not the right person who can say "this is the way to go", however I >>believe that we need some sort of interrupt prioritization like RTIRQ >>does. > > > I don't think this is the problem, since small-packet performance is bad > even with a fully-polling e1000 in NAPI mode. As Robert Olsson has > demonstrated, a highly-loaded napi e1000 only generates a few hundred > interrupts per second. So the vast majority of packets recieved are > coming in without a hardware interrupt occurring at all. If the polling is delayed, then you get plenty of latency. With something like e1000, you can have up to 4096 rx buffers too, which can also increase latency, but you do drop fewer packets. Ben -- Ben Greear Candela Technologies Inc http://www.candelatech.com From sri@us.ibm.com Tue Apr 6 12:09:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 12:09:52 -0700 (PDT) Received: from e4.ny.us.ibm.com (e4.ny.us.ibm.com [32.97.182.104]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36J9eKO015788 for ; Tue, 6 Apr 2004 12:09:47 -0700 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e4.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i36J9QAL436114; Tue, 6 Apr 2004 15:09:26 -0400 Received: from w-sridhar.beaverton.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i36J9OFe122524; Tue, 6 Apr 2004 15:09:25 -0400 Date: Tue, 6 Apr 2004 12:09:26 -0700 (PDT) From: Sridhar Samudrala X-X-Sender: sridhar@localhost.localdomain To: davem@redhat.com cc: netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: [BK PATCH] 2.4 SCTP updates Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 4517 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: sri@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 17103 Lines: 534 Hi Dave Please do a bk pull http://linux-lksctp.bkbits.net/lksctp-2.4.work to get the following updates to SCTP on top of linux 2.4.26-rc2 This includes 2 of the 3 patches i submitted for 2.6. lib/idr.c is not present in 2.4 and hence i could not remove the use of address of association as its id and virt_addr_valid(). I guess it should be OK for now as PAGEALLOC debugging is not available with 2.4. may be we should backport idr.c to 2.4 or come up with a similar service. Thanks Sridhar # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/04/06 09:28:32-07:00 sri@us.ibm.com # [SCTP] Update sctp_ulpevent structure to include assoc pointer and # only the receive specific fields of sctp_sndrcvinfo. # # net/sctp/ulpqueue.c # net/sctp/ulpevent.c # net/sctp/socket.c # net/sctp/protocol.c # net/sctp/ipv6.c # include/net/sctp/ulpevent.h # # ChangeSet # 2004/04/06 07:54:05-07:00 sri@us.ibm.com # [SCTP] Fix typo in entry name of the remove_proc_entry() call. # # net/sctp/objcnt.c # diff -Nru a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h --- a/include/net/sctp/ulpevent.h Tue Apr 6 11:54:30 2004 +++ b/include/net/sctp/ulpevent.h Tue Apr 6 11:54:30 2004 @@ -1,7 +1,7 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. - * Copyright (c) 2001 International Business Machines, Corp. * Copyright (c) 2001 Intel Corp. * Copyright (c) 2001 Nokia, Inc. * Copyright (c) 2001 La Monte H.P. Yarroll @@ -54,7 +54,13 @@ * growing this structure as it is at the maximum limit now. */ struct sctp_ulpevent { - struct sctp_sndrcvinfo sndrcvinfo; + struct sctp_association *asoc; + __u16 stream; + __u16 ssn; + __u16 flags; + __u32 ppid; + __u32 tsn; + __u32 cumtsn; int msg_flags; int iif; }; diff -Nru a/net/sctp/ipv6.c b/net/sctp/ipv6.c --- a/net/sctp/ipv6.c Tue Apr 6 11:54:30 2004 +++ b/net/sctp/ipv6.c Tue Apr 6 11:54:30 2004 @@ -1,7 +1,7 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2002, 2004 * Copyright (c) 2001 Nokia, Inc. * Copyright (c) 2001 La Monte H.P. Yarroll - * Copyright (c) 2002-2003 International Business Machines, Corp. * Copyright (c) 2002-2003 Intel Corp. * * This file is part of the SCTP kernel reference Implementation @@ -703,7 +703,7 @@ union sctp_addr *addr; struct sctp_association *asoc; - asoc = event->sndrcvinfo.sinfo_assoc_id; + asoc = event->asoc; sctp_inet6_msgname(msgname, addrlen); sin6 = (struct sockaddr_in6 *)msgname; sin6->sin6_port = htons(asoc->peer.port); diff -Nru a/net/sctp/objcnt.c b/net/sctp/objcnt.c --- a/net/sctp/objcnt.c Tue Apr 6 11:54:30 2004 +++ b/net/sctp/objcnt.c Tue Apr 6 11:54:30 2004 @@ -132,7 +132,7 @@ /* Cleanup the objcount entry in the proc filesystem. */ void sctp_dbg_objcnt_exit(void) { - remove_proc_entry("sctp_dbg_objcount", proc_net_sctp); + remove_proc_entry("sctp_dbg_objcnt", proc_net_sctp); } diff -Nru a/net/sctp/protocol.c b/net/sctp/protocol.c --- a/net/sctp/protocol.c Tue Apr 6 11:54:30 2004 +++ b/net/sctp/protocol.c Tue Apr 6 11:54:30 2004 @@ -719,7 +719,7 @@ if (msgname) { struct sctp_association *asoc; - asoc = event->sndrcvinfo.sinfo_assoc_id; + asoc = event->asoc; sctp_inet_msgname(msgname, addr_len); sin = (struct sockaddr_in *)msgname; sinfrom = &asoc->peer.primary_addr.v4; diff -Nru a/net/sctp/socket.c b/net/sctp/socket.c --- a/net/sctp/socket.c Tue Apr 6 11:54:30 2004 +++ b/net/sctp/socket.c Tue Apr 6 11:54:30 2004 @@ -1495,8 +1495,7 @@ * rwnd by that amount. If all the data in the skb is read, * rwnd is updated when the event is freed. */ - sctp_assoc_rwnd_increase(event->sndrcvinfo.sinfo_assoc_id, - copied); + sctp_assoc_rwnd_increase(event->asoc, copied); goto out; } else if ((event->msg_flags & MSG_NOTIFICATION) || (event->msg_flags & MSG_EOR)) @@ -4486,7 +4485,7 @@ */ sctp_skb_for_each(skb, &oldsk->sk_receive_queue, tmp) { event = sctp_skb2event(skb); - if (event->sndrcvinfo.sinfo_assoc_id == assoc) { + if (event->asoc == assoc) { __skb_unlink(skb, skb->list); __skb_queue_tail(&newsk->sk_receive_queue, skb); } @@ -4515,7 +4514,7 @@ */ sctp_skb_for_each(skb, &oldsp->pd_lobby, tmp) { event = sctp_skb2event(skb); - if (event->sndrcvinfo.sinfo_assoc_id == assoc) { + if (event->asoc == assoc) { __skb_unlink(skb, skb->list); __skb_queue_tail(queue, skb); } diff -Nru a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c --- a/net/sctp/ulpevent.c Tue Apr 6 11:54:30 2004 +++ b/net/sctp/ulpevent.c Tue Apr 6 11:54:30 2004 @@ -1,7 +1,7 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. - * Copyright (c) 2001 International Business Machines, Corp. * Copyright (c) 2001 Intel Corp. * Copyright (c) 2001 Nokia, Inc. * Copyright (c) 2001 La Monte H.P. Yarroll @@ -590,8 +590,7 @@ struct sctp_chunk *chunk, int gfp) { - struct sctp_ulpevent *event; - struct sctp_sndrcvinfo *info; + struct sctp_ulpevent *event = NULL; struct sk_buff *skb; size_t padding, len; @@ -624,101 +623,21 @@ /* Initialize event with flags 0. */ sctp_ulpevent_init(event, 0); - event->iif = sctp_chunk_iif(chunk); - sctp_ulpevent_receive_data(event, asoc); - info = (struct sctp_sndrcvinfo *) &event->sndrcvinfo; - - /* Sockets API Extensions for SCTP - * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) - * - * sinfo_stream: 16 bits (unsigned integer) - * - * For recvmsg() the SCTP stack places the message's stream number in - * this value. - */ - info->sinfo_stream = ntohs(chunk->subh.data_hdr->stream); - - /* Sockets API Extensions for SCTP - * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) - * - * sinfo_ssn: 16 bits (unsigned integer) - * - * For recvmsg() this value contains the stream sequence number that - * the remote endpoint placed in the DATA chunk. For fragmented - * messages this is the same number for all deliveries of the message - * (if more than one recvmsg() is needed to read the message). - */ - info->sinfo_ssn = ntohs(chunk->subh.data_hdr->ssn); - - /* Sockets API Extensions for SCTP - * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) - * - * sinfo_ppid: 32 bits (unsigned integer) - * - * In recvmsg() this value is - * the same information that was passed by the upper layer in the peer - * application. Please note that byte order issues are NOT accounted - * for and this information is passed opaquely by the SCTP stack from - * one end to the other. - */ - info->sinfo_ppid = chunk->subh.data_hdr->ppid; - - /* Sockets API Extensions for SCTP - * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) - * - * sinfo_flags: 16 bits (unsigned integer) - * - * This field may contain any of the following flags and is composed of - * a bitwise OR of these values. - * - * recvmsg() flags: - * - * MSG_UNORDERED - This flag is present when the message was sent - * non-ordered. - */ + event->stream = ntohs(chunk->subh.data_hdr->stream); + event->ssn = ntohs(chunk->subh.data_hdr->ssn); + event->ppid = chunk->subh.data_hdr->ppid; if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) { - info->sinfo_flags |= MSG_UNORDERED; - - /* sinfo_cumtsn: 32 bit (unsigned integer) - * - * This field will hold the current cumulative TSN as - * known by the underlying SCTP layer. Note this field is - * ignored when sending and only valid for a receive - * operation when sinfo_flags are set to MSG_UNORDERED. - */ - info->sinfo_cumtsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); + event->flags |= MSG_UNORDERED; + event->cumtsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map); } - - /* Note: For reassembly, we need to have the fragmentation bits. - * For now, merge these into the msg_flags, since those bit - * possitions are not used. - */ + event->tsn = ntohl(chunk->subh.data_hdr->tsn); event->msg_flags |= chunk->chunk_hdr->flags; - - /* With 04 draft, tsn moves into sndrcvinfo. */ - info->sinfo_tsn = ntohl(chunk->subh.data_hdr->tsn); - - /* Context is not used on receive. */ - info->sinfo_context = 0; - - /* Sockets API Extensions for SCTP - * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) - * - * sinfo_assoc_id: sizeof (sctp_assoc_t) - * - * The association handle field, sinfo_assoc_id, holds the identifier - * for the association announced in the COMMUNICATION_UP notification. - * All notifications for a given association have the same identifier. - * Ignored for TCP-style sockets. - */ - info->sinfo_assoc_id = sctp_assoc2id(asoc); - - return event; + event->iif = sctp_chunk_iif(chunk); fail: - return NULL; + return event; } /* Create a partial delivery related event. @@ -797,11 +716,77 @@ void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, struct msghdr *msghdr) { - if (!sctp_ulpevent_is_notification(event)) { - put_cmsg(msghdr, IPPROTO_SCTP, SCTP_SNDRCV, - sizeof(struct sctp_sndrcvinfo), - (void *) &event->sndrcvinfo); - } + struct sctp_sndrcvinfo sinfo; + + if (sctp_ulpevent_is_notification(event)) + return; + + /* Sockets API Extensions for SCTP + * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) + * + * sinfo_stream: 16 bits (unsigned integer) + * + * For recvmsg() the SCTP stack places the message's stream number in + * this value. + */ + sinfo.sinfo_stream = event->stream; + /* sinfo_ssn: 16 bits (unsigned integer) + * + * For recvmsg() this value contains the stream sequence number that + * the remote endpoint placed in the DATA chunk. For fragmented + * messages this is the same number for all deliveries of the message + * (if more than one recvmsg() is needed to read the message). + */ + sinfo.sinfo_ssn = event->ssn; + /* sinfo_ppid: 32 bits (unsigned integer) + * + * In recvmsg() this value is + * the same information that was passed by the upper layer in the peer + * application. Please note that byte order issues are NOT accounted + * for and this information is passed opaquely by the SCTP stack from + * one end to the other. + */ + sinfo.sinfo_ppid = event->ppid; + /* sinfo_flags: 16 bits (unsigned integer) + * + * This field may contain any of the following flags and is composed of + * a bitwise OR of these values. + * + * recvmsg() flags: + * + * MSG_UNORDERED - This flag is present when the message was sent + * non-ordered. + */ + sinfo.sinfo_flags = event->flags; + /* sinfo_tsn: 32 bit (unsigned integer) + * + * For the receiving side, this field holds a TSN that was + * assigned to one of the SCTP Data Chunks. + */ + sinfo.sinfo_tsn = event->tsn; + /* sinfo_cumtsn: 32 bit (unsigned integer) + * + * This field will hold the current cumulative TSN as + * known by the underlying SCTP layer. Note this field is + * ignored when sending and only valid for a receive + * operation when sinfo_flags are set to MSG_UNORDERED. + */ + sinfo.sinfo_cumtsn = event->cumtsn; + /* sinfo_assoc_id: sizeof (sctp_assoc_t) + * + * The association handle field, sinfo_assoc_id, holds the identifier + * for the association announced in the COMMUNICATION_UP notification. + * All notifications for a given association have the same identifier. + * Ignored for one-to-one style sockets. + */ + sinfo.sinfo_assoc_id = sctp_assoc2id(event->asoc); + + /* These fields are not used while receiving. */ + sinfo.sinfo_context = 0; + sinfo.sinfo_timetolive = 0; + + put_cmsg(msghdr, IPPROTO_SCTP, SCTP_SNDRCV, + sizeof(struct sctp_sndrcvinfo), (void *)&sinfo); } /* Stub skb destructor. */ @@ -831,14 +816,14 @@ sctp_association_hold((struct sctp_association *)asoc); skb = sctp_event2skb(event); skb->sk = asoc->base.sk; - event->sndrcvinfo.sinfo_assoc_id = sctp_assoc2id(asoc); + event->asoc = (struct sctp_association *)asoc; skb->destructor = sctp_stub_rfree; } /* A simple destructor to give up the reference to the association. */ static inline void sctp_ulpevent_release_owner(struct sctp_ulpevent *event) { - sctp_association_put(event->sndrcvinfo.sinfo_assoc_id); + sctp_association_put(event->asoc); } /* Do accounting for bytes received and hold a reference to the association @@ -880,8 +865,7 @@ */ skb = sctp_event2skb(event); - sctp_assoc_rwnd_increase(event->sndrcvinfo.sinfo_assoc_id, - skb_headlen(skb)); + sctp_assoc_rwnd_increase(event->asoc, skb_headlen(skb)); /* Don't forget the fragments. */ for (frag = skb_shinfo(skb)->frag_list; frag; frag = frag->next) { diff -Nru a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c --- a/net/sctp/ulpqueue.c Tue Apr 6 11:54:30 2004 +++ b/net/sctp/ulpqueue.c Tue Apr 6 11:54:30 2004 @@ -1,7 +1,7 @@ /* SCTP kernel reference Implementation + * (C) Copyright IBM Corp. 2001, 2004 * Copyright (c) 1999-2000 Cisco, Inc. * Copyright (c) 1999-2001 Motorola, Inc. - * Copyright (c) 2001-2003 International Business Machines, Corp. * Copyright (c) 2001 Intel Corp. * Copyright (c) 2001 Nokia, Inc. * Copyright (c) 2001 La Monte H.P. Yarroll @@ -251,7 +251,7 @@ struct sctp_ulpevent *cevent; __u32 tsn, ctsn; - tsn = event->sndrcvinfo.sinfo_tsn; + tsn = event->tsn; /* See if it belongs at the end. */ pos = skb_peek_tail(&ulpq->reasm); @@ -262,7 +262,7 @@ /* Short circuit just dropping it at the end. */ cevent = sctp_skb2event(pos); - ctsn = cevent->sndrcvinfo.sinfo_tsn; + ctsn = cevent->tsn; if (TSN_lt(ctsn, tsn)) { __skb_queue_tail(&ulpq->reasm, sctp_event2skb(event)); return; @@ -271,7 +271,7 @@ /* Find the right place in this list. We store them by TSN. */ skb_queue_walk(&ulpq->reasm, pos) { cevent = sctp_skb2event(pos); - ctsn = cevent->sndrcvinfo.sinfo_tsn; + ctsn = cevent->tsn; if (TSN_lt(tsn, ctsn)) break; @@ -368,7 +368,7 @@ */ skb_queue_walk(&ulpq->reasm, pos) { cevent = sctp_skb2event(pos); - ctsn = cevent->sndrcvinfo.sinfo_tsn; + ctsn = cevent->tsn; switch (cevent->msg_flags & SCTP_DATA_FRAG_MASK) { case SCTP_DATA_FIRST_FRAG: @@ -425,7 +425,7 @@ skb_queue_walk(&ulpq->reasm, pos) { cevent = sctp_skb2event(pos); - ctsn = cevent->sndrcvinfo.sinfo_tsn; + ctsn = cevent->tsn; switch (cevent->msg_flags & SCTP_DATA_FRAG_MASK) { case SCTP_DATA_MIDDLE_FRAG: @@ -486,7 +486,7 @@ /* Do not even bother unless this is the next tsn to * be delivered. */ - ctsn = event->sndrcvinfo.sinfo_tsn; + ctsn = event->tsn; ctsnap = sctp_tsnmap_get_ctsn(&ulpq->asoc->peer.tsn_map); if (TSN_lte(ctsn, ctsnap)) retval = sctp_ulpq_retrieve_partial(ulpq); @@ -517,7 +517,7 @@ skb_queue_walk(&ulpq->reasm, pos) { cevent = sctp_skb2event(pos); - ctsn = cevent->sndrcvinfo.sinfo_tsn; + ctsn = cevent->tsn; switch (cevent->msg_flags & SCTP_DATA_FRAG_MASK) { case SCTP_DATA_FIRST_FRAG: @@ -563,15 +563,15 @@ __u16 sid, csid; __u16 ssn, cssn; - sid = event->sndrcvinfo.sinfo_stream; - ssn = event->sndrcvinfo.sinfo_ssn; + sid = event->stream; + ssn = event->ssn; in = &ulpq->asoc->ssnmap->in; /* We are holding the chunks by stream, by SSN. */ sctp_skb_for_each(pos, &ulpq->lobby, tmp) { cevent = (struct sctp_ulpevent *) pos->cb; - csid = cevent->sndrcvinfo.sinfo_stream; - cssn = cevent->sndrcvinfo.sinfo_ssn; + csid = cevent->stream; + cssn = cevent->ssn; /* Have we gone too far? */ if (csid > sid) @@ -609,12 +609,12 @@ return; } - sid = event->sndrcvinfo.sinfo_stream; - ssn = event->sndrcvinfo.sinfo_ssn; + sid = event->stream; + ssn = event->ssn; cevent = (struct sctp_ulpevent *) pos->cb; - csid = cevent->sndrcvinfo.sinfo_stream; - cssn = cevent->sndrcvinfo.sinfo_ssn; + csid = cevent->stream; + cssn = cevent->ssn; if (sid > csid) { __skb_queue_tail(&ulpq->lobby, sctp_event2skb(event)); return; @@ -630,8 +630,8 @@ */ skb_queue_walk(&ulpq->lobby, pos) { cevent = (struct sctp_ulpevent *) pos->cb; - csid = cevent->sndrcvinfo.sinfo_stream; - cssn = cevent->sndrcvinfo.sinfo_ssn; + csid = cevent->stream; + cssn = cevent->ssn; if (csid > sid) break; @@ -656,8 +656,8 @@ return event; /* Note: The stream ID must be verified before this routine. */ - sid = event->sndrcvinfo.sinfo_stream; - ssn = event->sndrcvinfo.sinfo_ssn; + sid = event->stream; + ssn = event->ssn; in = &ulpq->asoc->ssnmap->in; /* Is this the expected SSN for this stream ID? */ @@ -694,7 +694,7 @@ while ((skb = __skb_dequeue_tail(&ulpq->lobby))) { freed += skb_headlen(skb); event = sctp_skb2event(skb); - tsn = event->sndrcvinfo.sinfo_tsn; + tsn = event->tsn; sctp_ulpevent_free(event); sctp_tsnmap_renege(tsnmap, tsn); @@ -720,7 +720,7 @@ while ((skb = __skb_dequeue_tail(&ulpq->reasm))) { freed += skb_headlen(skb); event = sctp_skb2event(skb); - tsn = event->sndrcvinfo.sinfo_tsn; + tsn = event->tsn; sctp_ulpevent_free(event); sctp_tsnmap_renege(tsnmap, tsn); From dipankar@in.ibm.com Tue Apr 6 12:55:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 12:55:51 -0700 (PDT) Received: from e6.ny.us.ibm.com (e6.ny.us.ibm.com [32.97.182.106]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36JtmKO021322 for ; Tue, 6 Apr 2004 12:55:49 -0700 Received: from northrelay02.pok.ibm.com (northrelay02.pok.ibm.com [9.56.224.150]) by e6.ny.us.ibm.com (8.12.10/8.12.2) with ESMTP id i36JsmBs615104; Tue, 6 Apr 2004 15:54:48 -0400 Received: from soprano.in.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by northrelay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id i36JsOFd132542; Tue, 6 Apr 2004 15:54:46 -0400 Received: by soprano.in.ibm.com (Postfix, from userid 500) id 441A17C52A; Wed, 7 Apr 2004 01:22:50 +0530 (IST) Date: Wed, 7 Apr 2004 01:22:49 +0530 From: Dipankar Sarma To: Robert Olsson Cc: Andrea Arcangeli , "David S. Miller" , kuznet@ms2.inr.ac.ru, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, paulmck@us.ibm.com, akpm@osdl.org Subject: Re: route cache DoS testing and softirqs Message-ID: <20040406195249.GA4581@in.ibm.com> Reply-To: dipankar@in.ibm.com References: <20040330133000.098761e2.davem@redhat.com> <20040330213742.GL3808@dualathlon.random> <20040331171023.GA4543@in.ibm.com> <16491.4593.718724.277551@robur.slu.se> <20040331203750.GB4543@in.ibm.com> <20040331212817.GQ2143@dualathlon.random> <20040331214342.GD4543@in.ibm.com> <16497.37720.607342.193544@robur.slu.se> <20040405212220.GH4003@in.ibm.com> <16498.43191.733850.18276@robur.slu.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16498.43191.733850.18276@robur.slu.se> User-Agent: Mutt/1.4.1i X-archive-position: 4518 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: dipankar@in.ibm.com Precedence: bulk X-list: netdev Content-Length: 1136 Lines: 25 On Tue, Apr 06, 2004 at 02:55:19PM +0200, Robert Olsson wrote: Content-Description: message body text > Dipankar Sarma writes: > > Looks better atleast. Can you apply the following patch (rs-throttle-rcu) > > on top of rcu-softirq.patch in your tree and see if helps a little bit more ? > > Please make sure to set the kernel paramenters rcupdate.maxbatch to 4 > > and rcupdate.plugticks to 0. You can make sure of those parameters > > by looking at dmesg (rcu prints them out during boot). I just merged > > it, but have not tested this patch yet. > > OK! > > Well not tested yet but I don't think we will get rid overflow totally in my > setup. I've done a little experimental patch so *all* softirq's are run via > ksoftirqd. Robert, you should try out rs-throttle-rcu.patch. The idea is that we don't run too many callbacks in a single rcu. In my setup, at 100kpps, I see as many as 30000 rcu callbacks in a single tasklet handler. That is likely hurting even the softirq-only RCU grace periods. Setting rcupdate.maxbatch=4 will do only 4 per tasklet thus providing more quiescent points to the system. Thanks Dipankar From davem@redhat.com Tue Apr 6 13:54:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 13:54:12 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36Ks3KO023683 for ; Tue, 6 Apr 2004 13:54:04 -0700 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i36Kru5D009755; Tue, 6 Apr 2004 16:53:56 -0400 Received: from devserv.devel.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i36Kruj19198; Tue, 6 Apr 2004 16:53:56 -0400 Received: from cheetah.davemloft.net (localhost.localdomain [127.0.0.1]) by devserv.devel.redhat.com (8.12.10/8.12.10) with SMTP id i36KrV1n032255; Tue, 6 Apr 2004 16:53:31 -0400 Date: Tue, 6 Apr 2004 13:52:31 -0700 From: "David S. Miller" To: Sridhar Samudrala Cc: netdev@oss.sgi.com, lksctp-developers@lists.sourceforge.net Subject: Re: [BK PATCH] 2.4 SCTP updates Message-Id: <20040406135231.63608955.davem@redhat.com> In-Reply-To: References: X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4519 X-ecartis-version: Ecartis v1.0.0 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: 110 Lines: 4 Both 2.4.x and 2.6.x trees pulled, thanks Sridhar. Don't worry about the pagealloc debugging issue in 2.4.x From rddunlap@osdl.org Tue Apr 6 14:50:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 14:50:45 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36LoeKO025379 for ; Tue, 6 Apr 2004 14:50:41 -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 i36LoY223666; Tue, 6 Apr 2004 14:50:34 -0700 Date: Tue, 6 Apr 2004 14:45:56 -0700 From: "Randy.Dunlap" To: netdev Cc: jgarzik Subject: [janitor] remove concat. with __FUNCTION__ (drivers/net/) Message-Id: <20040406144556.78c971a2.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.10 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4520 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 3932 Lines: 82 From: Tony Breeds "concatenation of string literals with __FUNCTION__ is deprecated" --- drivers/net/gt96100eth.c | 2 +- drivers/net/irda/smsc-ircc2.c | 6 +++--- drivers/net/irda/via-ircc.c | 2 +- drivers/net/wireless/orinoco.h | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff -puN drivers/net/gt96100eth.c~remove_concat_FUNCTION_drivers drivers/net/gt96100eth.c --- linux-265-kj1/drivers/net/gt96100eth.c~remove_concat_FUNCTION_drivers 2004-04-05 13:31:23.000000000 -0700 +++ linux-265-kj1-rddunlap/drivers/net/gt96100eth.c 2004-04-05 13:31:23.000000000 -0700 @@ -1212,7 +1212,7 @@ gt96100_rx(struct net_device *dev, u32 s cmdstat, nextOut); if (cmdstat & (u32)rxOwn) { - //err(__FUNCTION__ ": device owns descriptor!\n"); + //err("%s: device owns descriptor!\n", __FUNCTION__); // DMA is not finished updating descriptor??? // Leave and come back later to pick-up where // we left off. diff -puN drivers/net/irda/smsc-ircc2.c~remove_concat_FUNCTION_drivers drivers/net/irda/smsc-ircc2.c --- linux-265-kj1/drivers/net/irda/smsc-ircc2.c~remove_concat_FUNCTION_drivers 2004-04-05 13:31:23.000000000 -0700 +++ linux-265-kj1-rddunlap/drivers/net/irda/smsc-ircc2.c 2004-04-05 13:31:23.000000000 -0700 @@ -1429,7 +1429,7 @@ static irqreturn_t smsc_ircc_interrupt(i } if (iir & IRCC_IIR_ACTIVE_FRAME) { - /*printk(KERN_WARNING __FUNCTION__ "(): Active Frame\n");*/ + /*printk(KERN_WARNING "%s(): Active Frame\n", __FUNCTION__);*/ } /* Enable interrupts again */ @@ -1995,7 +1995,7 @@ static int __init smsc_ircc_look_for_chi while(address->cfg_base){ cfg_base = address->cfg_base; - /*printk(KERN_WARNING __FUNCTION__ "(): probing: 0x%02x for: 0x%02x\n", cfg_base, address->type);*/ + /*printk(KERN_WARNING "%s(): probing: 0x%02x for: 0x%02x\n", __FUNCTION__, cfg_base, address->type);*/ if( address->type & SMSCSIO_TYPE_FDC){ type = "FDC"; @@ -2040,7 +2040,7 @@ static int __init smsc_superio_flat(cons outb(SMSCSIOFLAT_UARTMODE0C_REG, cfgbase); mode = inb(cfgbase+1); - /*printk(KERN_WARNING __FUNCTION__ "(): mode: 0x%02x\n", mode);*/ + /*printk(KERN_WARNING "%s(): mode: 0x%02x\n", __FUNCTION__, mode);*/ if(!(mode & SMSCSIOFLAT_UART2MODE_VAL_IRDA)) WARNING("%s(): IrDA not enabled\n", __FUNCTION__); diff -puN drivers/net/irda/via-ircc.c~remove_concat_FUNCTION_drivers drivers/net/irda/via-ircc.c --- linux-265-kj1/drivers/net/irda/via-ircc.c~remove_concat_FUNCTION_drivers 2004-04-05 13:31:23.000000000 -0700 +++ linux-265-kj1-rddunlap/drivers/net/irda/via-ircc.c 2004-04-05 13:31:23.000000000 -0700 @@ -360,7 +360,7 @@ static __devinit int via_ircc_open(int i /* Reserve the ioports that we need */ if (!request_region(self->io.fir_base, self->io.fir_ext, driver_name)) { -// WARNING(__FUNCTION__ "(), can't get iobase of 0x%03x\n",self->io.fir_base); +// WARNING("%s(), can't get iobase of 0x%03x\n", __FUNCTION__, self->io.fir_base); err = -ENODEV; goto err_out1; } diff -puN drivers/net/wireless/orinoco.h~remove_concat_FUNCTION_drivers drivers/net/wireless/orinoco.h --- linux-265-kj1/drivers/net/wireless/orinoco.h~remove_concat_FUNCTION_drivers 2004-04-05 13:31:23.000000000 -0700 +++ linux-265-kj1-rddunlap/drivers/net/wireless/orinoco.h 2004-04-05 13:31:23.000000000 -0700 @@ -125,8 +125,8 @@ extern int orinoco_debug; #define DEBUG(n, args...) do { } while (0) #endif /* ORINOCO_DEBUG */ -#define TRACE_ENTER(devname) DEBUG(2, "%s: -> " __FUNCTION__ "()\n", devname); -#define TRACE_EXIT(devname) DEBUG(2, "%s: <- " __FUNCTION__ "()\n", devname); +#define TRACE_ENTER(devname) DEBUG(2, "%s: -> %s()\n", __FUNCTION__, devname); +#define TRACE_EXIT(devname) DEBUG(2, "%s: <- %s()\n", __FUNCTION__, devname); extern struct net_device *alloc_orinocodev(int sizeof_card, int (*hard_reset)(struct orinoco_private *)); From rddunlap@osdl.org Tue Apr 6 14:50:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 14:50:46 -0700 (PDT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36LoeKO025380 for ; Tue, 6 Apr 2004 14:50:41 -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 i36LoY223670; Tue, 6 Apr 2004 14:50:34 -0700 Date: Tue, 6 Apr 2004 14:46:10 -0700 From: "Randy.Dunlap" To: netdev Cc: davem Subject: [janitor] remove concat. with __FUNCTION__ (net/) Message-Id: <20040406144610.2471dcf7.rddunlap@osdl.org> Organization: OSDL X-Mailer: Sylpheed version 0.9.10 (GTK+ 1.2.10; i686-pc-linux-gnu) X-Face: +5V?h'hZQPB9kW Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 4521 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: rddunlap@osdl.org Precedence: bulk X-list: netdev Content-Length: 4960 Lines: 107 From: Tony Breeds "concatenation of string literals with __FUNCTION__ is deprecated" --- linux-265-kj1-rddunlap/net/8021q/vlan.h | 4 ++-- linux-265-kj1-rddunlap/net/8021q/vlanproc.c | 2 +- linux-265-kj1-rddunlap/net/ipv4/netfilter/ip_conntrack_irc.c | 4 ++-- linux-265-kj1-rddunlap/net/ipv4/netfilter/ip_conntrack_tftp.c | 4 ++-- linux-265-kj1-rddunlap/net/ipv4/netfilter/ip_nat_tftp.c | 4 ++-- linux-265-kj1-rddunlap/net/ipv4/netfilter/ipt_ULOG.c | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff -puN net/8021q/vlan.h~remove_concat_FUNCTION_net net/8021q/vlan.h --- linux-265-kj1/net/8021q/vlan.h~remove_concat_FUNCTION_net 2004-04-05 13:31:51.000000000 -0700 +++ linux-265-kj1-rddunlap/net/8021q/vlan.h 2004-04-05 13:31:51.000000000 -0700 @@ -19,8 +19,8 @@ I never found it..and the problem seems I'll bet they might prove useful again... --Ben -#define VLAN_MEM_DBG(x, y, z) printk(VLAN_DBG __FUNCTION__ ": " x, y, z); -#define VLAN_FMEM_DBG(x, y) printk(VLAN_DBG __FUNCTION__ ": " x, y); +#define VLAN_MEM_DBG(x, y, z) printk(VLAN_DBG "%s: " x, __FUNCTION__, y, z); +#define VLAN_FMEM_DBG(x, y) printk(VLAN_DBG "%s: " x, __FUNCTION__, y); */ /* This way they don't do anything! */ diff -puN net/8021q/vlanproc.c~remove_concat_FUNCTION_net net/8021q/vlanproc.c --- linux-265-kj1/net/8021q/vlanproc.c~remove_concat_FUNCTION_net 2004-04-05 13:31:51.000000000 -0700 +++ linux-265-kj1-rddunlap/net/8021q/vlanproc.c 2004-04-05 13:31:51.000000000 -0700 @@ -220,7 +220,7 @@ int vlan_proc_rem_dev(struct net_device } #ifdef VLAN_DEBUG - printk(VLAN_DBG __FUNCTION__ ": dev: %p\n", vlandev); + printk(VLAN_DBG "%s: dev: %p\n", __FUNCTION__, vlandev); #endif /** NOTE: This will consume the memory pointed to by dent, it seems. */ diff -puN net/ipv4/netfilter/ip_conntrack_irc.c~remove_concat_FUNCTION_net net/ipv4/netfilter/ip_conntrack_irc.c --- linux-265-kj1/net/ipv4/netfilter/ip_conntrack_irc.c~remove_concat_FUNCTION_net 2004-04-05 13:31:51.000000000 -0700 +++ linux-265-kj1-rddunlap/net/ipv4/netfilter/ip_conntrack_irc.c 2004-04-05 13:31:51.000000000 -0700 @@ -60,8 +60,8 @@ DECLARE_LOCK(ip_irc_lock); struct module *ip_conntrack_irc = THIS_MODULE; #if 0 -#define DEBUGP(format, args...) printk(KERN_DEBUG __FILE__ ":" __FUNCTION__ \ - ":" format, ## args) +#define DEBUGP(format, args...) printk(KERN_DEBUG "%s:%s:" format, \ + __FILE__, __FUNCTION__ , ## args) #else #define DEBUGP(format, args...) #endif diff -puN net/ipv4/netfilter/ip_conntrack_tftp.c~remove_concat_FUNCTION_net net/ipv4/netfilter/ip_conntrack_tftp.c --- linux-265-kj1/net/ipv4/netfilter/ip_conntrack_tftp.c~remove_concat_FUNCTION_net 2004-04-05 13:31:51.000000000 -0700 +++ linux-265-kj1-rddunlap/net/ipv4/netfilter/ip_conntrack_tftp.c 2004-04-05 13:31:51.000000000 -0700 @@ -33,8 +33,8 @@ MODULE_PARM_DESC(ports, "port numbers of #endif #if 0 -#define DEBUGP(format, args...) printk(__FILE__ ":" __FUNCTION__ ": " \ - format, ## args) +#define DEBUGP(format, args...) printk("%s:%s:" format, \ + __FILE__, __FUNCTION__ , ## args) #else #define DEBUGP(format, args...) #endif diff -puN net/ipv4/netfilter/ip_nat_tftp.c~remove_concat_FUNCTION_net net/ipv4/netfilter/ip_nat_tftp.c --- linux-265-kj1/net/ipv4/netfilter/ip_nat_tftp.c~remove_concat_FUNCTION_net 2004-04-05 13:31:51.000000000 -0700 +++ linux-265-kj1-rddunlap/net/ipv4/netfilter/ip_nat_tftp.c 2004-04-05 13:31:51.000000000 -0700 @@ -47,8 +47,8 @@ MODULE_PARM_DESC(ports, "port numbers of #endif #if 0 -#define DEBUGP(format, args...) printk(__FILE__ ":" __FUNCTION__ ": " \ - format, ## args) +#define DEBUGP(format, args...) printk("%s:%s:" format, \ + __FILE__, __FUNCTION__ , ## args) #else #define DEBUGP(format, args...) #endif diff -puN net/ipv4/netfilter/ipt_ULOG.c~remove_concat_FUNCTION_net net/ipv4/netfilter/ipt_ULOG.c --- linux-265-kj1/net/ipv4/netfilter/ipt_ULOG.c~remove_concat_FUNCTION_net 2004-04-05 13:31:51.000000000 -0700 +++ linux-265-kj1-rddunlap/net/ipv4/netfilter/ipt_ULOG.c 2004-04-05 13:31:51.000000000 -0700 @@ -64,13 +64,13 @@ MODULE_DESCRIPTION("iptables userspace l #define ULOG_MAXNLGROUPS 32 /* numer of nlgroups */ #if 0 -#define DEBUGP(format, args...) printk(__FILE__ ":" __FUNCTION__ ":" \ - format, ## args) +#define DEBUGP(format, args...) printk("%s:%s:" format, \ + __FILE__, __FUNCTION__ , ## args) #else #define DEBUGP(format, args...) #endif -#define PRINTR(format, args...) do { if (net_ratelimit()) printk(format, ## args); } while (0) +#define PRINTR(format, args...) do { if (net_ratelimit()) printk(format , ## args); } while (0) static unsigned int nlbufsiz = 4096; MODULE_PARM(nlbufsiz, "i"); _ From bhartin@straus-frank.com Tue Apr 6 16:03:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 16:03:23 -0700 (PDT) Received: from kkuy210.securesites.net (kkuy210.securesites.net [204.2.109.192]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36N3JKO027941 for ; Tue, 6 Apr 2004 16:03:21 -0700 Received: from edp12 (209-99-2-226.sat.texas.net [209.99.2.226] (may be forged)) by kkuy210.securesites.net (8.12.6p3/8.12.6) with ESMTP id i36N3GkH051794; Tue, 6 Apr 2004 23:03:16 GMT (envelope-from bhartin@straus-frank.com) Date: Tue, 6 Apr 2004 18:03:03 -0500 (CDT) From: bhartin@straus-frank.com X-X-Sender: bhartin@edp12.straus-frank.int To: Francois Romieu cc: netdev@oss.sgi.com Subject: Re: r8169, 2.6.2-rc2, Sager 4780 laptop In-Reply-To: <20040407001815.C7833@electric-eye.fr.zoreil.com> Message-ID: References: <20040126235559.A3832@electric-eye.fr.zoreil.com> <20040405002028.A8125@electric-eye.fr.zoreil.com> <20040407001815.C7833@electric-eye.fr.zoreil.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 4522 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: bhartin@straus-frank.com Precedence: bulk X-list: netdev Content-Length: 1078 Lines: 33 On Wed, 7 Apr 2004, Francois Romieu wrote: > Hmmm... Something like "no PHY Reset ack. Giving up." I guess. Ok, I'll > add it to the queue, the locking between the phy_timer() and the irq handler > looks strange. I got my laptop back up and found the messages logged: kernel: r8169: eth0: Reset RTL8169s PHY I didn't see exactly at what point this started happening during the shutdown, but the message repeated about 500 times before the system logger was stopped. Again, I've had no issues so far during normal use. There are no abnormal timeouts, and transfer rates appear within normal ranges. (I've only used it on 100bT switches so far, no 10bT or gigabit.) > As a general note, do not hesitate to post on/Cc: netdev as it can be of > interest to other people as well. I meant to, but must have hit no when Pine asked about replying to all recipients. > Thanks for the report. Not a problem at all. I'm just glad to finally get this thing working! Bradley Hartin - bhartin@straus-frank.com Communications and Network Administrator Straus-Frank Company From romieu@fr.zoreil.com Tue Apr 6 16:41:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 16:41:31 -0700 (PDT) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i36NfQKO032143 for ; Tue, 6 Apr 2004 16:41:29 -0700 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.8/8.12.1) with ESMTP id i36Ncfgf011055; Wed, 7 Apr 2004 01:38:41 +0200 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.8/8.12.1) id i36Ncfa6011054; Wed, 7 Apr 2004 01:38:41 +0200 Date: Wed, 7 Apr 2004 01:38:41 +0200 From: Francois Romieu To: bhartin@straus-frank.com Cc: netdev@oss.sgi.com Subject: Re: r8169, 2.6.2-rc2, Sager 4780 laptop Message-ID: <20040407013841.A7978@electric-eye.fr.zoreil.com> References: <20040126235559.A3832@electric-eye.fr.zoreil.com> <20040405002028.A8125@electric-eye.fr.zoreil.com> <20040407001815.C7833@electric-eye.fr.zoreil.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: ; from bhartin@straus-frank.com on Tue, Apr 06, 2004 at 06:03:03PM -0500 X-Organisation: Land of Sunshine Inc. X-archive-position: 4523 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: romieu@fr.zoreil.com Precedence: bulk X-list: netdev Content-Length: 1044 Lines: 38 bhartin@straus-frank.com : [...] > I got my laptop back up and found the messages logged: > > kernel: r8169: eth0: Reset RTL8169s PHY > > I didn't see exactly at what point this started happening during the > shutdown, but the message repeated about 500 times before the system > logger was stopped. It implies a minimum of 6000 invocations of rtl8169_phy_timer(). *doh* Please apply patch below. mod_timer() expects an absolute time, not a relative offset. drivers/net/r8169.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) diff -puN drivers/net/r8169.c~r8169-mod_timer drivers/net/r8169.c --- linux-2.6.5/drivers/net/r8169.c~r8169-mod_timer 2004-04-07 01:30:14.000000000 +0200 +++ linux-2.6.5-fr/drivers/net/r8169.c 2004-04-07 01:32:53.000000000 +0200 @@ -617,7 +617,7 @@ static void rtl8169_phy_timer(unsigned l } } - mod_timer(timer, RTL8169_PHY_TIMEOUT); + mod_timer(timer, jiffies + RTL8169_PHY_TIMEOUT); } static inline void rtl8169_delete_timer(struct net_device *dev) _ From bhartin@straus-frank.com Tue Apr 6 22:15:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 06 Apr 2004 22:15:50 -0700 (PDT) Received: from kkuy210.securesites.net (kkuy210.securesites.net [204.2.109.192]) by oss.sgi.com (8.12.10/8.12.9) with SMTP id i375FlKO013469 for ; Tue,