From michael.vittrup.larsen@ericsson.com Mon Nov 1 01:58:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 01:59:00 -0800 (PST) Received: from albatross.ericsson.se (albatross.ericsson.se [193.180.251.49]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA19wpFT004323 for ; Mon, 1 Nov 2004 01:58:52 -0800 Received: from esealmw143.al.sw.ericsson.se ([153.88.254.118]) by albatross.ericsson.se (8.12.10/8.12.10/WIREfire-1.8b) with ESMTP id iA19wYWR004513 for ; Mon, 1 Nov 2004 10:58:34 +0100 (MET) Received: from esealnt613.al.sw.ericsson.se ([153.88.254.125]) by esealmw143.al.sw.ericsson.se with Microsoft SMTPSVC(6.0.3790.211); Mon, 1 Nov 2004 10:58:33 +0100 Received: from unixmail.ted.dk.eu.ericsson.se (knud.ted.dk.eu.ericsson.se [213.159.188.246]) by esealnt613.al.sw.ericsson.se with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id WB1YZ71Q; Mon, 1 Nov 2004 10:58:33 +0100 Received: from diadem.ted.dk.eu.ericsson.se (diadem.ted.dk.eu.ericsson.se [213.159.189.76]) by unixmail.ted.dk.eu.ericsson.se (8.10.1/8.10.1/TEDmain-1.0) with ESMTP id iA19wR321026; Mon, 1 Nov 2004 10:58:31 +0100 (MET) X-Sybari-Trust: ac4731ec 8cefd49f cf62e456 00000138 From: Michael Vittrup Larsen Organization: Ericsson To: Stephen Hemminger Subject: Re: [PATCH] tcp: efficient port randomisation Date: Mon, 1 Nov 2004 11:58:23 +0200 User-Agent: KMail/1.7 Cc: "David S. Miller" , netdev@oss.sgi.com References: <20041027092531.78fe438c@guest-251-240.pdx.osdl.net> <200410291048.01955.michael.vittrup.larsen@ericsson.com> <20041029102828.123502e7@zqx3.pdx.osdl.net> In-Reply-To: <20041029102828.123502e7@zqx3.pdx.osdl.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200411011058.23141.michael.vittrup.larsen@ericsson.com> X-OriginalArrivalTime: 01 Nov 2004 09:58:33.0685 (UTC) FILETIME=[59293050:01C4BFF9] X-archive-position: 11274 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: michael.vittrup.larsen@ericsson.com Precedence: bulk X-list: netdev Content-Length: 850 Lines: 21 On Friday 29 October 2004 19:28, Stephen Hemminger wrote: > Provide port randomization for incoming connections using variation of > existing sequence number hash. Replace tcp_portalloc_lock and > tcp_port_rover with atomic operation to allow better parallelism. > > This is based on > http://www.ietf.org/internet-drafts/draft-larsen-tsvwg-port-randomisation-0 >0.txt (with confirmation of of no IPR issues). I have looked through this, and have a few comments: * It is probably a good strategy to set 'tcp_rover_next' such that the next search is resumed from the previous port found to be free. (similar to the old algorithm). I don't see this in your patch, but of course I could have missed it. * connect_port_offset() does not (at least from an algorithm point of view) need to return an u32, an u16 is sufficient. Michael Larsen From kas@fi.muni.cz Mon Nov 1 03:23:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 03:23:55 -0800 (PST) Received: from anor.ics.muni.cz (root@anor.ics.muni.cz [147.251.4.35]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1BNfQ2009259 for ; Mon, 1 Nov 2004 03:23:42 -0800 Received: from anxur.fi.muni.cz (IDENT:0@anxur.fi.muni.cz [147.251.48.3]) by anor.ics.muni.cz (8.12.1/8.12.1) with ESMTP id iA1BNK4k013917; Mon, 1 Nov 2004 12:23:20 +0100 Received: from anxur.fi.muni.cz (IDENT:11561@localhost [127.0.0.1]) by anxur.fi.muni.cz (8.12.10/8.12.8) with ESMTP id iA1BNJc4007145; Mon, 1 Nov 2004 12:23:19 +0100 (MET) Received: (from kas@localhost) by anxur.fi.muni.cz (8.12.10/8.12.8/Submit) id iA1BNEHT007136; Mon, 1 Nov 2004 12:23:14 +0100 (MET) Date: Mon, 1 Nov 2004 12:23:14 +0100 From: Jan Kasprzak To: Jeff Garzik Cc: janitor@sternwelten.at, netdev@oss.sgi.com, nacc@us.ibm.com Subject: Re: [patch 06/18] net/cosa: replace schedule_timeout() with msleep_interruptible() Message-ID: <20041101112313.GD12416@fi.muni.cz> References: <4184C79F.3090602@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4184C79F.3090602@pobox.com> User-Agent: Mutt/1.4.2i X-Muni-Spam-TestIP: 147.251.48.3 X-Muni-Virus-Test: Clean X-archive-position: 11275 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kas@fi.muni.cz Precedence: bulk X-list: netdev Content-Length: 686 Lines: 16 Jeff Garzik wrote: : why add all the memory barriers and such associated with : set_current_state() ? : This is not time-critical - COSA is an ISA-only device, and the driver is not tested on SMP (I have tried to make it SMP-aware, but at the time I had no SMP machine with ISA slot). -Yenya -- | Jan "Yenya" Kasprzak | | GPG: ID 1024/D3498839 Fingerprint 0D99A7FB206605D7 8B35FCDE05B18A5E | | http://www.fi.muni.cz/~kas/ Czech Linux Homepage: http://www.linux.cz/ | > Whatever the Java applications and desktop dances may lead to, Unix will < > still be pushing the packets around for a quite a while. --Rob Pike < From hch@lst.de Mon Nov 1 03:46:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 03:46:32 -0800 (PST) Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1BkNkX010666 for ; Mon, 1 Nov 2004 03:46:24 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id iA1Bk5la007538 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 1 Nov 2004 12:46:05 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id iA1Bk5WH007536; Mon, 1 Nov 2004 12:46:05 +0100 Date: Mon, 1 Nov 2004 12:46:05 +0100 From: Christoph Hellwig To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: [PATCH] remove dead exports from net/core/dev.c Message-ID: <20041101114605.GA7507@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-archive-position: 11276 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev Content-Length: 5873 Lines: 196 this also allows to kill some competely dead code, e.g. many of the non-locked __foo routines. Signed-off-by: Christoph Hellwig --- 1.91/include/linux/netdevice.h 2004-10-26 18:09:33 +02:00 +++ edited/include/linux/netdevice.h 2004-10-30 21:04:33 +02:00 @@ -526,20 +526,13 @@ extern int netdev_boot_setup_check(struct net_device *dev); extern unsigned long netdev_boot_base(const char *prefix, int unit); extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr); -extern struct net_device *__dev_getfirstbyhwtype(unsigned short type); extern struct net_device *dev_getfirstbyhwtype(unsigned short type); extern void dev_add_pack(struct packet_type *pt); extern void dev_remove_pack(struct packet_type *pt); extern void __dev_remove_pack(struct packet_type *pt); -extern int __dev_get(const char *name); -static inline int __deprecated dev_get(const char *name) -{ - return __dev_get(name); -} + extern struct net_device *dev_get_by_flags(unsigned short flags, unsigned short mask); -extern struct net_device *__dev_get_by_flags(unsigned short flags, - unsigned short mask); extern struct net_device *dev_get_by_name(const char *name); extern struct net_device *__dev_get_by_name(const char *name); extern int dev_alloc_name(struct net_device *dev, const char *name); @@ -553,7 +546,6 @@ extern int register_netdevice_notifier(struct notifier_block *nb); extern int unregister_netdevice_notifier(struct notifier_block *nb); extern int call_netdevice_notifiers(unsigned long val, void *v); -extern int dev_new_index(void); extern struct net_device *dev_get_by_index(int ifindex); extern struct net_device *__dev_get_by_index(int ifindex); extern int dev_restart(struct net_device *dev); @@ -910,7 +902,6 @@ /* These functions live elsewhere (drivers/net/net_init.c, but related) */ extern void ether_setup(struct net_device *dev); -extern void fddi_setup(struct net_device *dev); extern void tr_setup(struct net_device *dev); extern void fc_setup(struct net_device *dev); extern void fc_freedev(struct net_device *dev); --- 1.169/net/core/dev.c 2004-10-26 18:09:33 +02:00 +++ edited/net/core/dev.c 2004-10-30 23:17:56 +02:00 @@ -520,35 +520,6 @@ return dev; } -/* - Return value is changed to int to prevent illegal usage in future. - It is still legal to use to check for device existence. - - User should understand, that the result returned by this function - is meaningless, if it was not issued under rtnl semaphore. - */ - -/** - * dev_get - test if a device exists - * @name: name to test for - * - * Test if a name exists. Returns true if the name is found. In order - * to be sure the name is not allocated or removed during the test the - * caller must hold the rtnl semaphore. - * - * This function exists only for back compatibility with older - * drivers. - */ -int __dev_get(const char *name) -{ - struct net_device *dev; - - read_lock(&dev_base_lock); - dev = __dev_get_by_name(name); - read_unlock(&dev_base_lock); - return dev != NULL; -} - /** * __dev_get_by_index - find a device by its ifindex * @ifindex: index of device @@ -623,26 +594,17 @@ return dev; } -struct net_device *__dev_getfirstbyhwtype(unsigned short type) -{ - struct net_device *dev; - - for (dev = dev_base; dev; dev = dev->next) - if (dev->type == type) - break; - return dev; -} - -EXPORT_SYMBOL(__dev_getfirstbyhwtype); - struct net_device *dev_getfirstbyhwtype(unsigned short type) { struct net_device *dev; rtnl_lock(); - dev = __dev_getfirstbyhwtype(type); - if (dev) - dev_hold(dev); + for (dev = dev_base; dev; dev = dev->next) { + if (dev->type == type) { + dev_hold(dev); + break; + } + } rtnl_unlock(); return dev; } @@ -665,32 +627,14 @@ struct net_device *dev; read_lock(&dev_base_lock); - dev = __dev_get_by_flags(if_flags, mask); - if (dev) - dev_hold(dev); - read_unlock(&dev_base_lock); - return dev; -} - -/** - * __dev_get_by_flags - find any device with given flags - * @if_flags: IFF_* values - * @mask: bitmask of bits in if_flags to check - * - * Search for any interface with the given flags. Returns NULL if a device - * is not found or a pointer to the device. The caller must hold either - * the RTNL semaphore or @dev_base_lock. - */ - -struct net_device *__dev_get_by_flags(unsigned short if_flags, unsigned short mask) -{ - struct net_device *dev; - for (dev = dev_base; dev != NULL; dev = dev->next) { - if (((dev->flags ^ if_flags) & mask) == 0) - return dev; + if (((dev->flags ^ if_flags) & mask) == 0) { + dev_hold(dev); + break; + } } - return NULL; + read_unlock(&dev_base_lock); + return dev; } /** @@ -2696,7 +2640,7 @@ * number. The caller must hold the rtnl semaphore or the * dev_base_lock to be sure it remains unique. */ -int dev_new_index(void) +static int dev_new_index(void) { static int ifindex; for (;;) { @@ -3236,30 +3180,23 @@ subsys_initcall(net_dev_init); -EXPORT_SYMBOL(__dev_get); -EXPORT_SYMBOL(__dev_get_by_flags); EXPORT_SYMBOL(__dev_get_by_index); EXPORT_SYMBOL(__dev_get_by_name); EXPORT_SYMBOL(__dev_remove_pack); EXPORT_SYMBOL(__skb_linearize); -EXPORT_SYMBOL(call_netdevice_notifiers); EXPORT_SYMBOL(dev_add_pack); EXPORT_SYMBOL(dev_alloc_name); EXPORT_SYMBOL(dev_close); EXPORT_SYMBOL(dev_get_by_flags); EXPORT_SYMBOL(dev_get_by_index); EXPORT_SYMBOL(dev_get_by_name); -EXPORT_SYMBOL(dev_getbyhwaddr); EXPORT_SYMBOL(dev_ioctl); -EXPORT_SYMBOL(dev_new_index); EXPORT_SYMBOL(dev_open); EXPORT_SYMBOL(dev_queue_xmit); -EXPORT_SYMBOL(dev_queue_xmit_nit); EXPORT_SYMBOL(dev_remove_pack); EXPORT_SYMBOL(dev_set_allmulti); EXPORT_SYMBOL(dev_set_promiscuity); EXPORT_SYMBOL(dev_change_flags); -EXPORT_SYMBOL(dev_change_name); EXPORT_SYMBOL(dev_set_mtu); EXPORT_SYMBOL(free_netdev); EXPORT_SYMBOL(netdev_boot_setup_check); From hch@lst.de Mon Nov 1 03:57:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 03:57:17 -0800 (PST) Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1BvBam011317 for ; Mon, 1 Nov 2004 03:57:11 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id iA1Burla007725 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 1 Nov 2004 12:56:53 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id iA1BurxK007723; Mon, 1 Nov 2004 12:56:53 +0100 Date: Mon, 1 Nov 2004 12:56:53 +0100 From: Christoph Hellwig To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: [PATCH] remove dead skb_iter* functions Message-ID: <20041101115653.GA7714@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-archive-position: 11277 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev Content-Length: 4363 Lines: 160 Signed-off-by: Christoph Hellwig --- 1.56/include/linux/skbuff.h 2004-10-05 23:51:01 +02:00 +++ edited/include/linux/skbuff.h 2004-10-30 21:04:33 +02:00 @@ -592,7 +592,6 @@ /* * Insert a packet on a list. */ -extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk); static inline void __skb_insert(struct sk_buff *newsk, struct sk_buff *prev, struct sk_buff *next, struct sk_buff_head *list) @@ -1120,22 +1119,6 @@ extern void skb_init(void); extern void skb_add_mtu(int mtu); - -struct skb_iter { - /* Iteration functions set these */ - unsigned char *data; - unsigned int len; - - /* Private to iteration */ - unsigned int nextfrag; - struct sk_buff *fraglist; -}; - -/* Keep iterating until skb_iter_next returns false. */ -extern void skb_iter_first(const struct sk_buff *skb, struct skb_iter *i); -extern int skb_iter_next(const struct sk_buff *skb, struct skb_iter *i); -/* Call this if aborting loop before !skb_iter_next */ -extern void skb_iter_abort(const struct sk_buff *skb, struct skb_iter *i); #ifdef CONFIG_NETFILTER static inline void nf_conntrack_put(struct nf_conntrack *nfct) --- 1.39/net/core/skbuff.c 2004-10-20 06:56:24 +02:00 +++ edited/net/core/skbuff.c 2004-10-30 21:04:33 +02:00 @@ -929,72 +929,7 @@ return -EFAULT; } -/* Keep iterating until skb_iter_next returns false. */ -void skb_iter_first(const struct sk_buff *skb, struct skb_iter *i) -{ - i->len = skb_headlen(skb); - i->data = (unsigned char *)skb->data; - i->nextfrag = 0; - i->fraglist = NULL; -} - -int skb_iter_next(const struct sk_buff *skb, struct skb_iter *i) -{ - /* Unmap previous, if not head fragment. */ - if (i->nextfrag) - kunmap_skb_frag(i->data); - - if (i->fraglist) { - fraglist: - /* We're iterating through fraglist. */ - if (i->nextfrag < skb_shinfo(i->fraglist)->nr_frags) { - i->data = kmap_skb_frag(&skb_shinfo(i->fraglist) - ->frags[i->nextfrag]); - i->len = skb_shinfo(i->fraglist)->frags[i->nextfrag] - .size; - i->nextfrag++; - return 1; - } - /* Fragments with fragments? Too hard! */ - BUG_ON(skb_shinfo(i->fraglist)->frag_list); - i->fraglist = i->fraglist->next; - if (!i->fraglist) - goto end; - - i->len = skb_headlen(i->fraglist); - i->data = i->fraglist->data; - i->nextfrag = 0; - return 1; - } - - if (i->nextfrag < skb_shinfo(skb)->nr_frags) { - i->data = kmap_skb_frag(&skb_shinfo(skb)->frags[i->nextfrag]); - i->len = skb_shinfo(skb)->frags[i->nextfrag].size; - i->nextfrag++; - return 1; - } - - i->fraglist = skb_shinfo(skb)->frag_list; - if (i->fraglist) - goto fraglist; - -end: - /* Bug trap for callers */ - i->data = NULL; - return 0; -} - -void skb_iter_abort(const struct sk_buff *skb, struct skb_iter *i) -{ - /* Unmap previous, if not head fragment. */ - if (i->data && i->nextfrag) - kunmap_skb_frag(i->data); - /* Bug trap for callers */ - i->data = NULL; -} - /* Checksum skb data. */ - unsigned int skb_checksum(const struct sk_buff *skb, int offset, int len, unsigned int csum) { @@ -1318,25 +1253,6 @@ } -/** - * skb_insert - insert a buffer - * @old: buffer to insert before - * @newsk: buffer to insert - * - * Place a packet before a given packet in a list. The list locks are taken - * and this function is atomic with respect to other list locked calls - * A buffer cannot be placed on two lists at the same time. - */ - -void skb_insert(struct sk_buff *old, struct sk_buff *newsk) -{ - unsigned long flags; - - spin_lock_irqsave(&old->list->lock, flags); - __skb_insert(newsk, old->prev, old, old->list); - spin_unlock_irqrestore(&old->list->lock, flags); -} - #if 0 /* * Tune the memory allocator for a new MTU size. @@ -1444,7 +1360,6 @@ EXPORT_SYMBOL(pskb_expand_head); EXPORT_SYMBOL(skb_checksum); EXPORT_SYMBOL(skb_clone); -EXPORT_SYMBOL(skb_clone_fraglist); EXPORT_SYMBOL(skb_copy); EXPORT_SYMBOL(skb_copy_and_csum_bits); EXPORT_SYMBOL(skb_copy_and_csum_dev); @@ -1456,13 +1371,8 @@ EXPORT_SYMBOL(skb_under_panic); EXPORT_SYMBOL(skb_dequeue); EXPORT_SYMBOL(skb_dequeue_tail); -EXPORT_SYMBOL(skb_insert); EXPORT_SYMBOL(skb_queue_purge); EXPORT_SYMBOL(skb_queue_head); EXPORT_SYMBOL(skb_queue_tail); EXPORT_SYMBOL(skb_unlink); EXPORT_SYMBOL(skb_append); -EXPORT_SYMBOL(skb_split); -EXPORT_SYMBOL(skb_iter_first); -EXPORT_SYMBOL(skb_iter_next); -EXPORT_SYMBOL(skb_iter_abort); From hch@lst.de Mon Nov 1 05:02:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 05:02:13 -0800 (PST) Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1D22nV016986 for ; Mon, 1 Nov 2004 05:02:03 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id iA1D1ila008754 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 1 Nov 2004 14:01:45 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id iA1D1isb008752; Mon, 1 Nov 2004 14:01:44 +0100 Date: Mon, 1 Nov 2004 14:01:44 +0100 From: Christoph Hellwig To: davem@redhat.com Cc: netdev@oss.sgi.com Subject: [PATCH] remove net_init.c ifdef clutter Message-ID: <20041101130144.GA8727@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-archive-position: 11278 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev Content-Length: 20351 Lines: 727 Move the devicetype-specific functions from net_init.c to the devicetype-specific files under net/. --- 1.24/drivers/net/net_init.c 2004-04-06 00:46:26 +02:00 +++ edited/drivers/net/net_init.c 2004-11-01 13:20:45 +01:00 @@ -105,260 +105,6 @@ } EXPORT_SYMBOL(alloc_netdev); -/** - * alloc_etherdev - Allocates and sets up an ethernet device - * @sizeof_priv: Size of additional driver-private structure to be allocated - * for this ethernet device - * - * Fill in the fields of the device structure with ethernet-generic - * values. Basically does everything except registering the device. - * - * Constructs a new net device, complete with a private data area of - * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for - * this private data area. - */ - -struct net_device *alloc_etherdev(int sizeof_priv) -{ - return alloc_netdev(sizeof_priv, "eth%d", ether_setup); -} - -EXPORT_SYMBOL(alloc_etherdev); - -static int eth_mac_addr(struct net_device *dev, void *p) -{ - struct sockaddr *addr=p; - if (netif_running(dev)) - return -EBUSY; - memcpy(dev->dev_addr, addr->sa_data,dev->addr_len); - return 0; -} - -static int eth_change_mtu(struct net_device *dev, int new_mtu) -{ - if ((new_mtu < 68) || (new_mtu > 1500)) - return -EINVAL; - dev->mtu = new_mtu; - return 0; -} - -#ifdef CONFIG_FDDI - -/** - * alloc_fddidev - Register FDDI device - * @sizeof_priv: Size of additional driver-private structure to be allocated - * for this FDDI device - * - * Fill in the fields of the device structure with FDDI-generic values. - * - * Constructs a new net device, complete with a private data area of - * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for - * this private data area. - */ - -struct net_device *alloc_fddidev(int sizeof_priv) -{ - return alloc_netdev(sizeof_priv, "fddi%d", fddi_setup); -} - -EXPORT_SYMBOL(alloc_fddidev); - -static int fddi_change_mtu(struct net_device *dev, int new_mtu) -{ - if ((new_mtu < FDDI_K_SNAP_HLEN) || (new_mtu > FDDI_K_SNAP_DLEN)) - return(-EINVAL); - dev->mtu = new_mtu; - return(0); -} - -#endif /* CONFIG_FDDI */ - -#ifdef CONFIG_HIPPI - -static int hippi_change_mtu(struct net_device *dev, int new_mtu) -{ - /* - * HIPPI's got these nice large MTUs. - */ - if ((new_mtu < 68) || (new_mtu > 65280)) - return -EINVAL; - dev->mtu = new_mtu; - return(0); -} - - -/* - * For HIPPI we will actually use the lower 4 bytes of the hardware - * address as the I-FIELD rather than the actual hardware address. - */ -static int hippi_mac_addr(struct net_device *dev, void *p) -{ - struct sockaddr *addr = p; - if (netif_running(dev)) - return -EBUSY; - memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); - return 0; -} - -static int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p) -{ - /* Never send broadcast/multicast ARP messages */ - p->mcast_probes = 0; - - /* In IPv6 unicast probes are valid even on NBMA, - * because they are encapsulated in normal IPv6 protocol. - * Should be a generic flag. - */ - if (p->tbl->family != AF_INET6) - p->ucast_probes = 0; - return 0; -} - -static void hippi_setup(struct net_device *dev) -{ - dev->set_multicast_list = NULL; - dev->change_mtu = hippi_change_mtu; - dev->hard_header = hippi_header; - dev->rebuild_header = hippi_rebuild_header; - dev->set_mac_address = hippi_mac_addr; - dev->hard_header_parse = NULL; - dev->hard_header_cache = NULL; - dev->header_cache_update = NULL; - dev->neigh_setup = hippi_neigh_setup_dev; - - /* - * We don't support HIPPI `ARP' for the time being, and probably - * never will unless someone else implements it. However we - * still need a fake ARPHRD to make ifconfig and friends play ball. - */ - dev->type = ARPHRD_HIPPI; - dev->hard_header_len = HIPPI_HLEN; - dev->mtu = 65280; - dev->addr_len = HIPPI_ALEN; - dev->tx_queue_len = 25 /* 5 */; - memset(dev->broadcast, 0xFF, HIPPI_ALEN); - - - /* - * HIPPI doesn't support broadcast+multicast and we only use - * static ARP tables. ARP is disabled by hippi_neigh_setup_dev. - */ - dev->flags = 0; -} - -/** - * alloc_hippi_dev - Register HIPPI device - * @sizeof_priv: Size of additional driver-private structure to be allocated - * for this HIPPI device - * - * Fill in the fields of the device structure with HIPPI-generic values. - * - * Constructs a new net device, complete with a private data area of - * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for - * this private data area. - */ - -struct net_device *alloc_hippi_dev(int sizeof_priv) -{ - return alloc_netdev(sizeof_priv, "hip%d", hippi_setup); -} - -EXPORT_SYMBOL(alloc_hippi_dev); - -#endif /* CONFIG_HIPPI */ - -void ether_setup(struct net_device *dev) -{ - /* Fill in the fields of the device structure with ethernet-generic values. - This should be in a common file instead of per-driver. */ - - dev->change_mtu = eth_change_mtu; - dev->hard_header = eth_header; - dev->rebuild_header = eth_rebuild_header; - dev->set_mac_address = eth_mac_addr; - dev->hard_header_cache = eth_header_cache; - dev->header_cache_update= eth_header_cache_update; - dev->hard_header_parse = eth_header_parse; - - dev->type = ARPHRD_ETHER; - dev->hard_header_len = ETH_HLEN; - dev->mtu = 1500; /* eth_mtu */ - dev->addr_len = ETH_ALEN; - dev->tx_queue_len = 1000; /* Ethernet wants good queues */ - - memset(dev->broadcast,0xFF, ETH_ALEN); - - /* New-style flags. */ - dev->flags = IFF_BROADCAST|IFF_MULTICAST; -} -EXPORT_SYMBOL(ether_setup); - -#ifdef CONFIG_FDDI - -void fddi_setup(struct net_device *dev) -{ - /* - * Fill in the fields of the device structure with FDDI-generic values. - * This should be in a common file instead of per-driver. - */ - - dev->change_mtu = fddi_change_mtu; - dev->hard_header = fddi_header; - dev->rebuild_header = fddi_rebuild_header; - - dev->type = ARPHRD_FDDI; - dev->hard_header_len = FDDI_K_SNAP_HLEN+3; /* Assume 802.2 SNAP hdr len + 3 pad bytes */ - dev->mtu = FDDI_K_SNAP_DLEN; /* Assume max payload of 802.2 SNAP frame */ - dev->addr_len = FDDI_K_ALEN; - dev->tx_queue_len = 100; /* Long queues on FDDI */ - - memset(dev->broadcast, 0xFF, FDDI_K_ALEN); - - /* New-style flags */ - dev->flags = IFF_BROADCAST | IFF_MULTICAST; -} -EXPORT_SYMBOL(fddi_setup); - -#endif /* CONFIG_FDDI */ - -#if defined(CONFIG_ATALK) || defined(CONFIG_ATALK_MODULE) - -static int ltalk_change_mtu(struct net_device *dev, int mtu) -{ - return -EINVAL; -} - -static int ltalk_mac_addr(struct net_device *dev, void *addr) -{ - return -EINVAL; -} - - -void ltalk_setup(struct net_device *dev) -{ - /* Fill in the fields of the device structure with localtalk-generic values. */ - - dev->change_mtu = ltalk_change_mtu; - dev->hard_header = NULL; - dev->rebuild_header = NULL; - dev->set_mac_address = ltalk_mac_addr; - dev->hard_header_cache = NULL; - dev->header_cache_update= NULL; - - dev->type = ARPHRD_LOCALTLK; - dev->hard_header_len = LTALK_HLEN; - dev->mtu = LTALK_MTU; - dev->addr_len = LTALK_ALEN; - dev->tx_queue_len = 10; - - dev->broadcast[0] = 0xFF; - - dev->flags = IFF_BROADCAST|IFF_MULTICAST|IFF_NOARP; -} -EXPORT_SYMBOL(ltalk_setup); - -#endif /* CONFIG_ATALK || CONFIG_ATALK_MODULE */ - int register_netdev(struct net_device *dev) { int err; @@ -404,90 +150,3 @@ EXPORT_SYMBOL(register_netdev); EXPORT_SYMBOL(unregister_netdev); - -#ifdef CONFIG_TR - -void tr_setup(struct net_device *dev) -{ - /* - * Configure and register - */ - - dev->hard_header = tr_header; - dev->rebuild_header = tr_rebuild_header; - - dev->type = ARPHRD_IEEE802_TR; - dev->hard_header_len = TR_HLEN; - dev->mtu = 2000; - dev->addr_len = TR_ALEN; - dev->tx_queue_len = 100; /* Long queues on tr */ - - memset(dev->broadcast,0xFF, TR_ALEN); - - /* New-style flags. */ - dev->flags = IFF_BROADCAST | IFF_MULTICAST ; -} - -/** - * alloc_trdev - Register token ring device - * @sizeof_priv: Size of additional driver-private structure to be allocated - * for this token ring device - * - * Fill in the fields of the device structure with token ring-generic values. - * - * Constructs a new net device, complete with a private data area of - * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for - * this private data area. - */ - -struct net_device *alloc_trdev(int sizeof_priv) -{ - return alloc_netdev(sizeof_priv, "tr%d", tr_setup); -} - -EXPORT_SYMBOL(tr_setup); -EXPORT_SYMBOL(alloc_trdev); - -#endif /* CONFIG_TR */ - -#ifdef CONFIG_NET_FC - -void fc_setup(struct net_device *dev) -{ - dev->hard_header = fc_header; - dev->rebuild_header = fc_rebuild_header; - - dev->type = ARPHRD_IEEE802; - dev->hard_header_len = FC_HLEN; - dev->mtu = 2024; - dev->addr_len = FC_ALEN; - dev->tx_queue_len = 100; /* Long queues on fc */ - - memset(dev->broadcast,0xFF, FC_ALEN); - - /* New-style flags. */ - dev->flags = IFF_BROADCAST; -} - -/** - * alloc_fcdev - Register fibre channel device - * @sizeof_priv: Size of additional driver-private structure to be allocated - * for this fibre channel device - * - * Fill in the fields of the device structure with fibre channel-generic values. - * - * Constructs a new net device, complete with a private data area of - * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for - * this private data area. - */ - -struct net_device *alloc_fcdev(int sizeof_priv) -{ - return alloc_netdev(sizeof_priv, "fc%d", fc_setup); -} - -EXPORT_SYMBOL(fc_setup); -EXPORT_SYMBOL(alloc_fcdev); - -#endif /* CONFIG_NET_FC */ - --- 1.91/include/linux/netdevice.h 2004-10-26 18:09:33 +02:00 +++ edited/include/linux/netdevice.h 2004-11-01 13:13:07 +01:00 @@ -910,10 +910,7 @@ /* These functions live elsewhere (drivers/net/net_init.c, but related) */ extern void ether_setup(struct net_device *dev); -extern void fddi_setup(struct net_device *dev); -extern void tr_setup(struct net_device *dev); -extern void fc_setup(struct net_device *dev); -extern void fc_freedev(struct net_device *dev); + /* Support for loadable net-drivers */ extern struct net_device *alloc_netdev(int sizeof_priv, const char *name, void (*setup)(struct net_device *)); ===== net/802/fc.c 1.3 vs edited ===== --- 1.3/net/802/fc.c 2004-06-24 21:37:35 +02:00 +++ edited/net/802/fc.c 2004-11-01 13:52:59 +01:00 @@ -129,3 +129,35 @@ return ntohs(ETH_P_802_2); } + +static void fc_setup(struct net_device *dev) +{ + dev->hard_header = fc_header; + dev->rebuild_header = fc_rebuild_header; + + dev->type = ARPHRD_IEEE802; + dev->hard_header_len = FC_HLEN; + dev->mtu = 2024; + dev->addr_len = FC_ALEN; + dev->tx_queue_len = 100; /* Long queues on fc */ + dev->flags = IFF_BROADCAST; + + memset(dev->broadcast, 0xFF, FC_ALEN); +} + +/** + * alloc_fcdev - Register fibre channel device + * @sizeof_priv: Size of additional driver-private structure to be allocated + * for this fibre channel device + * + * Fill in the fields of the device structure with fibre channel-generic values. + * + * Constructs a new net device, complete with a private data area of + * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for + * this private data area. + */ +struct net_device *alloc_fcdev(int sizeof_priv) +{ + return alloc_netdev(sizeof_priv, "fc%d", fc_setup); +} +EXPORT_SYMBOL(alloc_fcdev); --- 1.3/net/802/fddi.c 2003-09-29 04:23:30 +02:00 +++ edited/net/802/fddi.c 2004-11-01 13:12:14 +01:00 @@ -166,3 +166,44 @@ } EXPORT_SYMBOL(fddi_type_trans); + +static int fddi_change_mtu(struct net_device *dev, int new_mtu) +{ + if ((new_mtu < FDDI_K_SNAP_HLEN) || (new_mtu > FDDI_K_SNAP_DLEN)) + return(-EINVAL); + dev->mtu = new_mtu; + return(0); +} + +static void fddi_setup(struct net_device *dev) +{ + dev->change_mtu = fddi_change_mtu; + dev->hard_header = fddi_header; + dev->rebuild_header = fddi_rebuild_header; + + dev->type = ARPHRD_FDDI; + dev->hard_header_len = FDDI_K_SNAP_HLEN+3; /* Assume 802.2 SNAP hdr len + 3 pad bytes */ + dev->mtu = FDDI_K_SNAP_DLEN; /* Assume max payload of 802.2 SNAP frame */ + dev->addr_len = FDDI_K_ALEN; + dev->tx_queue_len = 100; /* Long queues on FDDI */ + dev->flags = IFF_BROADCAST | IFF_MULTICAST; + + memset(dev->broadcast, 0xFF, FDDI_K_ALEN); +} + +/** + * alloc_fddidev - Register FDDI device + * @sizeof_priv: Size of additional driver-private structure to be allocated + * for this FDDI device + * + * Fill in the fields of the device structure with FDDI-generic values. + * + * Constructs a new net device, complete with a private data area of + * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for + * this private data area. + */ +struct net_device *alloc_fddidev(int sizeof_priv) +{ + return alloc_netdev(sizeof_priv, "fddi%d", fddi_setup); +} +EXPORT_SYMBOL(alloc_fddidev); --- 1.4/net/802/hippi.c 2003-09-29 04:23:30 +02:00 +++ edited/net/802/hippi.c 2004-11-01 13:53:31 +01:00 @@ -154,3 +154,92 @@ } EXPORT_SYMBOL(hippi_type_trans); + +static int hippi_change_mtu(struct net_device *dev, int new_mtu) +{ + /* + * HIPPI's got these nice large MTUs. + */ + if ((new_mtu < 68) || (new_mtu > 65280)) + return -EINVAL; + dev->mtu = new_mtu; + return(0); +} + +/* + * For HIPPI we will actually use the lower 4 bytes of the hardware + * address as the I-FIELD rather than the actual hardware address. + */ +static int hippi_mac_addr(struct net_device *dev, void *p) +{ + struct sockaddr *addr = p; + if (netif_running(dev)) + return -EBUSY; + memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); + return 0; +} + +static int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p) +{ + /* Never send broadcast/multicast ARP messages */ + p->mcast_probes = 0; + + /* In IPv6 unicast probes are valid even on NBMA, + * because they are encapsulated in normal IPv6 protocol. + * Should be a generic flag. + */ + if (p->tbl->family != AF_INET6) + p->ucast_probes = 0; + return 0; +} + +static void hippi_setup(struct net_device *dev) +{ + dev->set_multicast_list = NULL; + dev->change_mtu = hippi_change_mtu; + dev->hard_header = hippi_header; + dev->rebuild_header = hippi_rebuild_header; + dev->set_mac_address = hippi_mac_addr; + dev->hard_header_parse = NULL; + dev->hard_header_cache = NULL; + dev->header_cache_update = NULL; + dev->neigh_setup = hippi_neigh_setup_dev; + + /* + * We don't support HIPPI `ARP' for the time being, and probably + * never will unless someone else implements it. However we + * still need a fake ARPHRD to make ifconfig and friends play ball. + */ + dev->type = ARPHRD_HIPPI; + dev->hard_header_len = HIPPI_HLEN; + dev->mtu = 65280; + dev->addr_len = HIPPI_ALEN; + dev->tx_queue_len = 25 /* 5 */; + memset(dev->broadcast, 0xFF, HIPPI_ALEN); + + + /* + * HIPPI doesn't support broadcast+multicast and we only use + * static ARP tables. ARP is disabled by hippi_neigh_setup_dev. + */ + dev->flags = 0; +} + +/** + * alloc_hippi_dev - Register HIPPI device + * @sizeof_priv: Size of additional driver-private structure to be allocated + * for this HIPPI device + * + * Fill in the fields of the device structure with HIPPI-generic values. + * + * Constructs a new net device, complete with a private data area of + * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for + * this private data area. + */ + +struct net_device *alloc_hippi_dev(int sizeof_priv) +{ + return alloc_netdev(sizeof_priv, "hip%d", hippi_setup); +} + +EXPORT_SYMBOL(alloc_hippi_dev); --- 1.17/net/802/tr.c 2004-06-24 21:36:53 +02:00 +++ edited/net/802/tr.c 2004-11-01 13:14:02 +01:00 @@ -583,6 +583,43 @@ #endif +static void tr_setup(struct net_device *dev) +{ + /* + * Configure and register + */ + + dev->hard_header = tr_header; + dev->rebuild_header = tr_rebuild_header; + + dev->type = ARPHRD_IEEE802_TR; + dev->hard_header_len = TR_HLEN; + dev->mtu = 2000; + dev->addr_len = TR_ALEN; + dev->tx_queue_len = 100; /* Long queues on tr */ + + memset(dev->broadcast,0xFF, TR_ALEN); + + /* New-style flags. */ + dev->flags = IFF_BROADCAST | IFF_MULTICAST ; +} + +/** + * alloc_trdev - Register token ring device + * @sizeof_priv: Size of additional driver-private structure to be allocated + * for this token ring device + * + * Fill in the fields of the device structure with token ring-generic values. + * + * Constructs a new net device, complete with a private data area of + * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for + * this private data area. + */ +struct net_device *alloc_trdev(int sizeof_priv) +{ + return alloc_netdev(sizeof_priv, "tr%d", tr_setup); +} + /* * Called during bootup. We don't actually have to initialise * too much for this. @@ -604,3 +641,4 @@ EXPORT_SYMBOL(tr_source_route); EXPORT_SYMBOL(tr_type_trans); +EXPORT_SYMBOL(alloc_trdev); --- 1.8/net/appletalk/Makefile 2004-08-18 23:35:04 +02:00 +++ edited/net/appletalk/Makefile 2004-11-01 13:22:42 +01:00 @@ -4,6 +4,6 @@ obj-$(CONFIG_ATALK) += appletalk.o -appletalk-y := aarp.o ddp.o +appletalk-y := aarp.o ddp.o dev.o appletalk-$(CONFIG_PROC_FS) += atalk_proc.o appletalk-$(CONFIG_SYSCTL) += sysctl_net_atalk.o --- 1.9/net/ethernet/eth.c 2004-10-05 23:51:01 +02:00 +++ edited/net/ethernet/eth.c 2004-11-01 13:54:23 +01:00 @@ -245,3 +245,64 @@ } EXPORT_SYMBOL(eth_type_trans); + +static int eth_mac_addr(struct net_device *dev, void *p) +{ + struct sockaddr *addr=p; + if (netif_running(dev)) + return -EBUSY; + memcpy(dev->dev_addr, addr->sa_data,dev->addr_len); + return 0; +} + +static int eth_change_mtu(struct net_device *dev, int new_mtu) +{ + if ((new_mtu < 68) || (new_mtu > 1500)) + return -EINVAL; + dev->mtu = new_mtu; + return 0; +} + +/* + * Fill in the fields of the device structure with ethernet-generic values. + */ +void ether_setup(struct net_device *dev) +{ + dev->change_mtu = eth_change_mtu; + dev->hard_header = eth_header; + dev->rebuild_header = eth_rebuild_header; + dev->set_mac_address = eth_mac_addr; + dev->hard_header_cache = eth_header_cache; + dev->header_cache_update= eth_header_cache_update; + dev->hard_header_parse = eth_header_parse; + + dev->type = ARPHRD_ETHER; + dev->hard_header_len = ETH_HLEN; + dev->mtu = 1500; /* eth_mtu */ + dev->addr_len = ETH_ALEN; + dev->tx_queue_len = 1000; /* Ethernet wants good queues */ + dev->flags = IFF_BROADCAST|IFF_MULTICAST; + + memset(dev->broadcast,0xFF, ETH_ALEN); + +} +EXPORT_SYMBOL(ether_setup); + +/** + * alloc_etherdev - Allocates and sets up an ethernet device + * @sizeof_priv: Size of additional driver-private structure to be allocated + * for this ethernet device + * + * Fill in the fields of the device structure with ethernet-generic + * values. Basically does everything except registering the device. + * + * Constructs a new net device, complete with a private data area of + * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for + * this private data area. + */ + +struct net_device *alloc_etherdev(int sizeof_priv) +{ + return alloc_netdev(sizeof_priv, "eth%d", ether_setup); +} +EXPORT_SYMBOL(alloc_etherdev); --- /dev/null 2004-08-20 00:05:11.000000000 +0200 +++ b/net/appletalk/dev.c 2004-11-01 13:49:02.111094544 +0100 @@ -0,0 +1,43 @@ +/* + * Moved here from drivers/net/net_init.c, which is: + * Written 1993,1994,1995 by Donald Becker. + */ + +#include +#include +#include +#include +#include + +static int ltalk_change_mtu(struct net_device *dev, int mtu) +{ + return -EINVAL; +} + +static int ltalk_mac_addr(struct net_device *dev, void *addr) +{ + return -EINVAL; +} + +void ltalk_setup(struct net_device *dev) +{ + /* Fill in the fields of the device structure with localtalk-generic values. */ + + dev->change_mtu = ltalk_change_mtu; + dev->hard_header = NULL; + dev->rebuild_header = NULL; + dev->set_mac_address = ltalk_mac_addr; + dev->hard_header_cache = NULL; + dev->header_cache_update= NULL; + + dev->type = ARPHRD_LOCALTLK; + dev->hard_header_len = LTALK_HLEN; + dev->mtu = LTALK_MTU; + dev->addr_len = LTALK_ALEN; + dev->tx_queue_len = 10; + + dev->broadcast[0] = 0xFF; + + dev->flags = IFF_BROADCAST|IFF_MULTICAST|IFF_NOARP; +} +EXPORT_SYMBOL(ltalk_setup); From SRS0+637e20ab50b9227e3014+435+infradead.org+hch@phoenix.srs.infradead.org Mon Nov 1 05:03:57 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 05:04:05 -0800 (PST) Received: from phoenix.infradead.org (phoenix.infradead.org [81.187.226.98]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1D3tVP017241 for ; Mon, 1 Nov 2004 05:03:56 -0800 Received: from hch by phoenix.infradead.org with local (Exim 4.42 #1 (Red Hat Linux)) id 1CObqO-00079U-BF; Mon, 01 Nov 2004 13:03:32 +0000 Date: Mon, 1 Nov 2004 13:03:32 +0000 From: Christoph Hellwig To: Christoph Hellwig Cc: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] remove net_init.c ifdef clutter Message-ID: <20041101130331.GA27476@infradead.org> References: <20041101130144.GA8727@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041101130144.GA8727@lst.de> User-Agent: Mutt/1.4.1i X-SRS-Rewrite: SMTP reverse-path rewritten from by phoenix.infradead.org See http://www.infradead.org/rpr.html X-archive-position: 11279 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: netdev Content-Length: 21942 Lines: 732 On Mon, Nov 01, 2004 at 02:01:44PM +0100, Christoph Hellwig wrote: > Move the devicetype-specific functions from net_init.c to the > devicetype-specific files under net/. Signed-off-by: Christoph Hellwig > > --- 1.24/drivers/net/net_init.c 2004-04-06 00:46:26 +02:00 > +++ edited/drivers/net/net_init.c 2004-11-01 13:20:45 +01:00 > @@ -105,260 +105,6 @@ > } > EXPORT_SYMBOL(alloc_netdev); > > -/** > - * alloc_etherdev - Allocates and sets up an ethernet device > - * @sizeof_priv: Size of additional driver-private structure to be allocated > - * for this ethernet device > - * > - * Fill in the fields of the device structure with ethernet-generic > - * values. Basically does everything except registering the device. > - * > - * Constructs a new net device, complete with a private data area of > - * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for > - * this private data area. > - */ > - > -struct net_device *alloc_etherdev(int sizeof_priv) > -{ > - return alloc_netdev(sizeof_priv, "eth%d", ether_setup); > -} > - > -EXPORT_SYMBOL(alloc_etherdev); > - > -static int eth_mac_addr(struct net_device *dev, void *p) > -{ > - struct sockaddr *addr=p; > - if (netif_running(dev)) > - return -EBUSY; > - memcpy(dev->dev_addr, addr->sa_data,dev->addr_len); > - return 0; > -} > - > -static int eth_change_mtu(struct net_device *dev, int new_mtu) > -{ > - if ((new_mtu < 68) || (new_mtu > 1500)) > - return -EINVAL; > - dev->mtu = new_mtu; > - return 0; > -} > - > -#ifdef CONFIG_FDDI > - > -/** > - * alloc_fddidev - Register FDDI device > - * @sizeof_priv: Size of additional driver-private structure to be allocated > - * for this FDDI device > - * > - * Fill in the fields of the device structure with FDDI-generic values. > - * > - * Constructs a new net device, complete with a private data area of > - * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for > - * this private data area. > - */ > - > -struct net_device *alloc_fddidev(int sizeof_priv) > -{ > - return alloc_netdev(sizeof_priv, "fddi%d", fddi_setup); > -} > - > -EXPORT_SYMBOL(alloc_fddidev); > - > -static int fddi_change_mtu(struct net_device *dev, int new_mtu) > -{ > - if ((new_mtu < FDDI_K_SNAP_HLEN) || (new_mtu > FDDI_K_SNAP_DLEN)) > - return(-EINVAL); > - dev->mtu = new_mtu; > - return(0); > -} > - > -#endif /* CONFIG_FDDI */ > - > -#ifdef CONFIG_HIPPI > - > -static int hippi_change_mtu(struct net_device *dev, int new_mtu) > -{ > - /* > - * HIPPI's got these nice large MTUs. > - */ > - if ((new_mtu < 68) || (new_mtu > 65280)) > - return -EINVAL; > - dev->mtu = new_mtu; > - return(0); > -} > - > - > -/* > - * For HIPPI we will actually use the lower 4 bytes of the hardware > - * address as the I-FIELD rather than the actual hardware address. > - */ > -static int hippi_mac_addr(struct net_device *dev, void *p) > -{ > - struct sockaddr *addr = p; > - if (netif_running(dev)) > - return -EBUSY; > - memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); > - return 0; > -} > - > -static int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p) > -{ > - /* Never send broadcast/multicast ARP messages */ > - p->mcast_probes = 0; > - > - /* In IPv6 unicast probes are valid even on NBMA, > - * because they are encapsulated in normal IPv6 protocol. > - * Should be a generic flag. > - */ > - if (p->tbl->family != AF_INET6) > - p->ucast_probes = 0; > - return 0; > -} > - > -static void hippi_setup(struct net_device *dev) > -{ > - dev->set_multicast_list = NULL; > - dev->change_mtu = hippi_change_mtu; > - dev->hard_header = hippi_header; > - dev->rebuild_header = hippi_rebuild_header; > - dev->set_mac_address = hippi_mac_addr; > - dev->hard_header_parse = NULL; > - dev->hard_header_cache = NULL; > - dev->header_cache_update = NULL; > - dev->neigh_setup = hippi_neigh_setup_dev; > - > - /* > - * We don't support HIPPI `ARP' for the time being, and probably > - * never will unless someone else implements it. However we > - * still need a fake ARPHRD to make ifconfig and friends play ball. > - */ > - dev->type = ARPHRD_HIPPI; > - dev->hard_header_len = HIPPI_HLEN; > - dev->mtu = 65280; > - dev->addr_len = HIPPI_ALEN; > - dev->tx_queue_len = 25 /* 5 */; > - memset(dev->broadcast, 0xFF, HIPPI_ALEN); > - > - > - /* > - * HIPPI doesn't support broadcast+multicast and we only use > - * static ARP tables. ARP is disabled by hippi_neigh_setup_dev. > - */ > - dev->flags = 0; > -} > - > -/** > - * alloc_hippi_dev - Register HIPPI device > - * @sizeof_priv: Size of additional driver-private structure to be allocated > - * for this HIPPI device > - * > - * Fill in the fields of the device structure with HIPPI-generic values. > - * > - * Constructs a new net device, complete with a private data area of > - * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for > - * this private data area. > - */ > - > -struct net_device *alloc_hippi_dev(int sizeof_priv) > -{ > - return alloc_netdev(sizeof_priv, "hip%d", hippi_setup); > -} > - > -EXPORT_SYMBOL(alloc_hippi_dev); > - > -#endif /* CONFIG_HIPPI */ > - > -void ether_setup(struct net_device *dev) > -{ > - /* Fill in the fields of the device structure with ethernet-generic values. > - This should be in a common file instead of per-driver. */ > - > - dev->change_mtu = eth_change_mtu; > - dev->hard_header = eth_header; > - dev->rebuild_header = eth_rebuild_header; > - dev->set_mac_address = eth_mac_addr; > - dev->hard_header_cache = eth_header_cache; > - dev->header_cache_update= eth_header_cache_update; > - dev->hard_header_parse = eth_header_parse; > - > - dev->type = ARPHRD_ETHER; > - dev->hard_header_len = ETH_HLEN; > - dev->mtu = 1500; /* eth_mtu */ > - dev->addr_len = ETH_ALEN; > - dev->tx_queue_len = 1000; /* Ethernet wants good queues */ > - > - memset(dev->broadcast,0xFF, ETH_ALEN); > - > - /* New-style flags. */ > - dev->flags = IFF_BROADCAST|IFF_MULTICAST; > -} > -EXPORT_SYMBOL(ether_setup); > - > -#ifdef CONFIG_FDDI > - > -void fddi_setup(struct net_device *dev) > -{ > - /* > - * Fill in the fields of the device structure with FDDI-generic values. > - * This should be in a common file instead of per-driver. > - */ > - > - dev->change_mtu = fddi_change_mtu; > - dev->hard_header = fddi_header; > - dev->rebuild_header = fddi_rebuild_header; > - > - dev->type = ARPHRD_FDDI; > - dev->hard_header_len = FDDI_K_SNAP_HLEN+3; /* Assume 802.2 SNAP hdr len + 3 pad bytes */ > - dev->mtu = FDDI_K_SNAP_DLEN; /* Assume max payload of 802.2 SNAP frame */ > - dev->addr_len = FDDI_K_ALEN; > - dev->tx_queue_len = 100; /* Long queues on FDDI */ > - > - memset(dev->broadcast, 0xFF, FDDI_K_ALEN); > - > - /* New-style flags */ > - dev->flags = IFF_BROADCAST | IFF_MULTICAST; > -} > -EXPORT_SYMBOL(fddi_setup); > - > -#endif /* CONFIG_FDDI */ > - > -#if defined(CONFIG_ATALK) || defined(CONFIG_ATALK_MODULE) > - > -static int ltalk_change_mtu(struct net_device *dev, int mtu) > -{ > - return -EINVAL; > -} > - > -static int ltalk_mac_addr(struct net_device *dev, void *addr) > -{ > - return -EINVAL; > -} > - > - > -void ltalk_setup(struct net_device *dev) > -{ > - /* Fill in the fields of the device structure with localtalk-generic values. */ > - > - dev->change_mtu = ltalk_change_mtu; > - dev->hard_header = NULL; > - dev->rebuild_header = NULL; > - dev->set_mac_address = ltalk_mac_addr; > - dev->hard_header_cache = NULL; > - dev->header_cache_update= NULL; > - > - dev->type = ARPHRD_LOCALTLK; > - dev->hard_header_len = LTALK_HLEN; > - dev->mtu = LTALK_MTU; > - dev->addr_len = LTALK_ALEN; > - dev->tx_queue_len = 10; > - > - dev->broadcast[0] = 0xFF; > - > - dev->flags = IFF_BROADCAST|IFF_MULTICAST|IFF_NOARP; > -} > -EXPORT_SYMBOL(ltalk_setup); > - > -#endif /* CONFIG_ATALK || CONFIG_ATALK_MODULE */ > - > int register_netdev(struct net_device *dev) > { > int err; > @@ -404,90 +150,3 @@ > > EXPORT_SYMBOL(register_netdev); > EXPORT_SYMBOL(unregister_netdev); > - > -#ifdef CONFIG_TR > - > -void tr_setup(struct net_device *dev) > -{ > - /* > - * Configure and register > - */ > - > - dev->hard_header = tr_header; > - dev->rebuild_header = tr_rebuild_header; > - > - dev->type = ARPHRD_IEEE802_TR; > - dev->hard_header_len = TR_HLEN; > - dev->mtu = 2000; > - dev->addr_len = TR_ALEN; > - dev->tx_queue_len = 100; /* Long queues on tr */ > - > - memset(dev->broadcast,0xFF, TR_ALEN); > - > - /* New-style flags. */ > - dev->flags = IFF_BROADCAST | IFF_MULTICAST ; > -} > - > -/** > - * alloc_trdev - Register token ring device > - * @sizeof_priv: Size of additional driver-private structure to be allocated > - * for this token ring device > - * > - * Fill in the fields of the device structure with token ring-generic values. > - * > - * Constructs a new net device, complete with a private data area of > - * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for > - * this private data area. > - */ > - > -struct net_device *alloc_trdev(int sizeof_priv) > -{ > - return alloc_netdev(sizeof_priv, "tr%d", tr_setup); > -} > - > -EXPORT_SYMBOL(tr_setup); > -EXPORT_SYMBOL(alloc_trdev); > - > -#endif /* CONFIG_TR */ > - > -#ifdef CONFIG_NET_FC > - > -void fc_setup(struct net_device *dev) > -{ > - dev->hard_header = fc_header; > - dev->rebuild_header = fc_rebuild_header; > - > - dev->type = ARPHRD_IEEE802; > - dev->hard_header_len = FC_HLEN; > - dev->mtu = 2024; > - dev->addr_len = FC_ALEN; > - dev->tx_queue_len = 100; /* Long queues on fc */ > - > - memset(dev->broadcast,0xFF, FC_ALEN); > - > - /* New-style flags. */ > - dev->flags = IFF_BROADCAST; > -} > - > -/** > - * alloc_fcdev - Register fibre channel device > - * @sizeof_priv: Size of additional driver-private structure to be allocated > - * for this fibre channel device > - * > - * Fill in the fields of the device structure with fibre channel-generic values. > - * > - * Constructs a new net device, complete with a private data area of > - * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for > - * this private data area. > - */ > - > -struct net_device *alloc_fcdev(int sizeof_priv) > -{ > - return alloc_netdev(sizeof_priv, "fc%d", fc_setup); > -} > - > -EXPORT_SYMBOL(fc_setup); > -EXPORT_SYMBOL(alloc_fcdev); > - > -#endif /* CONFIG_NET_FC */ > - > --- 1.91/include/linux/netdevice.h 2004-10-26 18:09:33 +02:00 > +++ edited/include/linux/netdevice.h 2004-11-01 13:13:07 +01:00 > @@ -910,10 +910,7 @@ > /* These functions live elsewhere (drivers/net/net_init.c, but related) */ > > extern void ether_setup(struct net_device *dev); > -extern void fddi_setup(struct net_device *dev); > -extern void tr_setup(struct net_device *dev); > -extern void fc_setup(struct net_device *dev); > -extern void fc_freedev(struct net_device *dev); > + > /* Support for loadable net-drivers */ > extern struct net_device *alloc_netdev(int sizeof_priv, const char *name, > void (*setup)(struct net_device *)); > ===== net/802/fc.c 1.3 vs edited ===== > --- 1.3/net/802/fc.c 2004-06-24 21:37:35 +02:00 > +++ edited/net/802/fc.c 2004-11-01 13:52:59 +01:00 > @@ -129,3 +129,35 @@ > > return ntohs(ETH_P_802_2); > } > + > +static void fc_setup(struct net_device *dev) > +{ > + dev->hard_header = fc_header; > + dev->rebuild_header = fc_rebuild_header; > + > + dev->type = ARPHRD_IEEE802; > + dev->hard_header_len = FC_HLEN; > + dev->mtu = 2024; > + dev->addr_len = FC_ALEN; > + dev->tx_queue_len = 100; /* Long queues on fc */ > + dev->flags = IFF_BROADCAST; > + > + memset(dev->broadcast, 0xFF, FC_ALEN); > +} > + > +/** > + * alloc_fcdev - Register fibre channel device > + * @sizeof_priv: Size of additional driver-private structure to be allocated > + * for this fibre channel device > + * > + * Fill in the fields of the device structure with fibre channel-generic values. > + * > + * Constructs a new net device, complete with a private data area of > + * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for > + * this private data area. > + */ > +struct net_device *alloc_fcdev(int sizeof_priv) > +{ > + return alloc_netdev(sizeof_priv, "fc%d", fc_setup); > +} > +EXPORT_SYMBOL(alloc_fcdev); > --- 1.3/net/802/fddi.c 2003-09-29 04:23:30 +02:00 > +++ edited/net/802/fddi.c 2004-11-01 13:12:14 +01:00 > @@ -166,3 +166,44 @@ > } > > EXPORT_SYMBOL(fddi_type_trans); > + > +static int fddi_change_mtu(struct net_device *dev, int new_mtu) > +{ > + if ((new_mtu < FDDI_K_SNAP_HLEN) || (new_mtu > FDDI_K_SNAP_DLEN)) > + return(-EINVAL); > + dev->mtu = new_mtu; > + return(0); > +} > + > +static void fddi_setup(struct net_device *dev) > +{ > + dev->change_mtu = fddi_change_mtu; > + dev->hard_header = fddi_header; > + dev->rebuild_header = fddi_rebuild_header; > + > + dev->type = ARPHRD_FDDI; > + dev->hard_header_len = FDDI_K_SNAP_HLEN+3; /* Assume 802.2 SNAP hdr len + 3 pad bytes */ > + dev->mtu = FDDI_K_SNAP_DLEN; /* Assume max payload of 802.2 SNAP frame */ > + dev->addr_len = FDDI_K_ALEN; > + dev->tx_queue_len = 100; /* Long queues on FDDI */ > + dev->flags = IFF_BROADCAST | IFF_MULTICAST; > + > + memset(dev->broadcast, 0xFF, FDDI_K_ALEN); > +} > + > +/** > + * alloc_fddidev - Register FDDI device > + * @sizeof_priv: Size of additional driver-private structure to be allocated > + * for this FDDI device > + * > + * Fill in the fields of the device structure with FDDI-generic values. > + * > + * Constructs a new net device, complete with a private data area of > + * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for > + * this private data area. > + */ > +struct net_device *alloc_fddidev(int sizeof_priv) > +{ > + return alloc_netdev(sizeof_priv, "fddi%d", fddi_setup); > +} > +EXPORT_SYMBOL(alloc_fddidev); > --- 1.4/net/802/hippi.c 2003-09-29 04:23:30 +02:00 > +++ edited/net/802/hippi.c 2004-11-01 13:53:31 +01:00 > @@ -154,3 +154,92 @@ > } > > EXPORT_SYMBOL(hippi_type_trans); > + > +static int hippi_change_mtu(struct net_device *dev, int new_mtu) > +{ > + /* > + * HIPPI's got these nice large MTUs. > + */ > + if ((new_mtu < 68) || (new_mtu > 65280)) > + return -EINVAL; > + dev->mtu = new_mtu; > + return(0); > +} > + > +/* > + * For HIPPI we will actually use the lower 4 bytes of the hardware > + * address as the I-FIELD rather than the actual hardware address. > + */ > +static int hippi_mac_addr(struct net_device *dev, void *p) > +{ > + struct sockaddr *addr = p; > + if (netif_running(dev)) > + return -EBUSY; > + memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); > + return 0; > +} > + > +static int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p) > +{ > + /* Never send broadcast/multicast ARP messages */ > + p->mcast_probes = 0; > + > + /* In IPv6 unicast probes are valid even on NBMA, > + * because they are encapsulated in normal IPv6 protocol. > + * Should be a generic flag. > + */ > + if (p->tbl->family != AF_INET6) > + p->ucast_probes = 0; > + return 0; > +} > + > +static void hippi_setup(struct net_device *dev) > +{ > + dev->set_multicast_list = NULL; > + dev->change_mtu = hippi_change_mtu; > + dev->hard_header = hippi_header; > + dev->rebuild_header = hippi_rebuild_header; > + dev->set_mac_address = hippi_mac_addr; > + dev->hard_header_parse = NULL; > + dev->hard_header_cache = NULL; > + dev->header_cache_update = NULL; > + dev->neigh_setup = hippi_neigh_setup_dev; > + > + /* > + * We don't support HIPPI `ARP' for the time being, and probably > + * never will unless someone else implements it. However we > + * still need a fake ARPHRD to make ifconfig and friends play ball. > + */ > + dev->type = ARPHRD_HIPPI; > + dev->hard_header_len = HIPPI_HLEN; > + dev->mtu = 65280; > + dev->addr_len = HIPPI_ALEN; > + dev->tx_queue_len = 25 /* 5 */; > + memset(dev->broadcast, 0xFF, HIPPI_ALEN); > + > + > + /* > + * HIPPI doesn't support broadcast+multicast and we only use > + * static ARP tables. ARP is disabled by hippi_neigh_setup_dev. > + */ > + dev->flags = 0; > +} > + > +/** > + * alloc_hippi_dev - Register HIPPI device > + * @sizeof_priv: Size of additional driver-private structure to be allocated > + * for this HIPPI device > + * > + * Fill in the fields of the device structure with HIPPI-generic values. > + * > + * Constructs a new net device, complete with a private data area of > + * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for > + * this private data area. > + */ > + > +struct net_device *alloc_hippi_dev(int sizeof_priv) > +{ > + return alloc_netdev(sizeof_priv, "hip%d", hippi_setup); > +} > + > +EXPORT_SYMBOL(alloc_hippi_dev); > --- 1.17/net/802/tr.c 2004-06-24 21:36:53 +02:00 > +++ edited/net/802/tr.c 2004-11-01 13:14:02 +01:00 > @@ -583,6 +583,43 @@ > > #endif > > +static void tr_setup(struct net_device *dev) > +{ > + /* > + * Configure and register > + */ > + > + dev->hard_header = tr_header; > + dev->rebuild_header = tr_rebuild_header; > + > + dev->type = ARPHRD_IEEE802_TR; > + dev->hard_header_len = TR_HLEN; > + dev->mtu = 2000; > + dev->addr_len = TR_ALEN; > + dev->tx_queue_len = 100; /* Long queues on tr */ > + > + memset(dev->broadcast,0xFF, TR_ALEN); > + > + /* New-style flags. */ > + dev->flags = IFF_BROADCAST | IFF_MULTICAST ; > +} > + > +/** > + * alloc_trdev - Register token ring device > + * @sizeof_priv: Size of additional driver-private structure to be allocated > + * for this token ring device > + * > + * Fill in the fields of the device structure with token ring-generic values. > + * > + * Constructs a new net device, complete with a private data area of > + * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for > + * this private data area. > + */ > +struct net_device *alloc_trdev(int sizeof_priv) > +{ > + return alloc_netdev(sizeof_priv, "tr%d", tr_setup); > +} > + > /* > * Called during bootup. We don't actually have to initialise > * too much for this. > @@ -604,3 +641,4 @@ > > EXPORT_SYMBOL(tr_source_route); > EXPORT_SYMBOL(tr_type_trans); > +EXPORT_SYMBOL(alloc_trdev); > --- 1.8/net/appletalk/Makefile 2004-08-18 23:35:04 +02:00 > +++ edited/net/appletalk/Makefile 2004-11-01 13:22:42 +01:00 > @@ -4,6 +4,6 @@ > > obj-$(CONFIG_ATALK) += appletalk.o > > -appletalk-y := aarp.o ddp.o > +appletalk-y := aarp.o ddp.o dev.o > appletalk-$(CONFIG_PROC_FS) += atalk_proc.o > appletalk-$(CONFIG_SYSCTL) += sysctl_net_atalk.o > --- 1.9/net/ethernet/eth.c 2004-10-05 23:51:01 +02:00 > +++ edited/net/ethernet/eth.c 2004-11-01 13:54:23 +01:00 > @@ -245,3 +245,64 @@ > } > > EXPORT_SYMBOL(eth_type_trans); > + > +static int eth_mac_addr(struct net_device *dev, void *p) > +{ > + struct sockaddr *addr=p; > + if (netif_running(dev)) > + return -EBUSY; > + memcpy(dev->dev_addr, addr->sa_data,dev->addr_len); > + return 0; > +} > + > +static int eth_change_mtu(struct net_device *dev, int new_mtu) > +{ > + if ((new_mtu < 68) || (new_mtu > 1500)) > + return -EINVAL; > + dev->mtu = new_mtu; > + return 0; > +} > + > +/* > + * Fill in the fields of the device structure with ethernet-generic values. > + */ > +void ether_setup(struct net_device *dev) > +{ > + dev->change_mtu = eth_change_mtu; > + dev->hard_header = eth_header; > + dev->rebuild_header = eth_rebuild_header; > + dev->set_mac_address = eth_mac_addr; > + dev->hard_header_cache = eth_header_cache; > + dev->header_cache_update= eth_header_cache_update; > + dev->hard_header_parse = eth_header_parse; > + > + dev->type = ARPHRD_ETHER; > + dev->hard_header_len = ETH_HLEN; > + dev->mtu = 1500; /* eth_mtu */ > + dev->addr_len = ETH_ALEN; > + dev->tx_queue_len = 1000; /* Ethernet wants good queues */ > + dev->flags = IFF_BROADCAST|IFF_MULTICAST; > + > + memset(dev->broadcast,0xFF, ETH_ALEN); > + > +} > +EXPORT_SYMBOL(ether_setup); > + > +/** > + * alloc_etherdev - Allocates and sets up an ethernet device > + * @sizeof_priv: Size of additional driver-private structure to be allocated > + * for this ethernet device > + * > + * Fill in the fields of the device structure with ethernet-generic > + * values. Basically does everything except registering the device. > + * > + * Constructs a new net device, complete with a private data area of > + * size @sizeof_priv. A 32-byte (not bit) alignment is enforced for > + * this private data area. > + */ > + > +struct net_device *alloc_etherdev(int sizeof_priv) > +{ > + return alloc_netdev(sizeof_priv, "eth%d", ether_setup); > +} > +EXPORT_SYMBOL(alloc_etherdev); > --- /dev/null 2004-08-20 00:05:11.000000000 +0200 > +++ b/net/appletalk/dev.c 2004-11-01 13:49:02.111094544 +0100 > @@ -0,0 +1,43 @@ > +/* > + * Moved here from drivers/net/net_init.c, which is: > + * Written 1993,1994,1995 by Donald Becker. > + */ > + > +#include > +#include > +#include > +#include > +#include > + > +static int ltalk_change_mtu(struct net_device *dev, int mtu) > +{ > + return -EINVAL; > +} > + > +static int ltalk_mac_addr(struct net_device *dev, void *addr) > +{ > + return -EINVAL; > +} > + > +void ltalk_setup(struct net_device *dev) > +{ > + /* Fill in the fields of the device structure with localtalk-generic values. */ > + > + dev->change_mtu = ltalk_change_mtu; > + dev->hard_header = NULL; > + dev->rebuild_header = NULL; > + dev->set_mac_address = ltalk_mac_addr; > + dev->hard_header_cache = NULL; > + dev->header_cache_update= NULL; > + > + dev->type = ARPHRD_LOCALTLK; > + dev->hard_header_len = LTALK_HLEN; > + dev->mtu = LTALK_MTU; > + dev->addr_len = LTALK_ALEN; > + dev->tx_queue_len = 10; > + > + dev->broadcast[0] = 0xFF; > + > + dev->flags = IFF_BROADCAST|IFF_MULTICAST|IFF_NOARP; > +} > +EXPORT_SYMBOL(ltalk_setup); > ---end quoted text--- From penberg@cs.helsinki.fi Mon Nov 1 06:29:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 06:29:19 -0800 (PST) Received: from mail.cs.helsinki.fi (courier.cs.helsinki.fi [128.214.9.1]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1ET3MK020656 for ; Mon, 1 Nov 2004 06:29:04 -0800 Received: from cs181096176.pp.htv.fi (cs181096176.pp.htv.fi [82.181.96.176]) (AUTH: LOGIN penberg, SSL: TLSv1/SSLv3,128bits,RC4-MD5) by mail.cs.helsinki.fi with esmtp; Mon, 01 Nov 2004 16:26:32 +0200 id 000741CF.41864798.00002A8C Subject: Re: net: generic netdev_ioaddr From: Pekka Enberg To: Krzysztof Halasa Cc: Al Viro , davem@davemloft.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org In-Reply-To: References: <1099044244.9566.0.camel@localhost> <20041029131607.GU24336@parcelfarce.linux.theplanet.co.uk> <20041029193827.GV24336@parcelfarce.linux.theplanet.co.uk> <1099129946.10961.9.camel@localhost> <1099206669.9571.10.camel@localhost> Date: Mon, 01 Nov 2004 16:27:47 +0200 Message-Id: <1099319267.9550.3.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Mailer: Evolution 2.0.2 X-archive-position: 11281 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: penberg@cs.helsinki.fi Precedence: bulk X-list: netdev Content-Length: 23942 Lines: 829 Hi, On Mon, 2004-11-01 at 00:14 +0100, Krzysztof Halasa wrote: > IMHO partially: base_addr etc should go from the core (to driver's > local structs if needed). I think no general netdev-setup thing is > needed, we have module parameters and library functions. > > No ioctl for such things is needed either. > /sbin/ifconfig shouldn't mess with hardware data such as I/O address, > IRQ etc. - it should be a configuration tool for software protocols, > not for hardware (i.e. as /sbin/ip is). > > My opinion of course. FWIW I am running this patch on my box. ifconfig doesn't mind but I am not sure about the rtnetlink part. I can start stabbing other drivers if the maintainers are interested in this cleanup... Pekka --- drivers/net/Space.c | 23 ++----- drivers/net/natsemi.c | 134 +++++++++++++++++++++---------------------- include/linux/netdevice.h | 12 --- net/core/dev.c | 141 ---------------------------------------------- net/core/rtnetlink.c | 12 --- net/ethernet/eth.c | 4 - 6 files changed, 74 insertions(+), 252 deletions(-) Index: 2.6.10-rc1-mm1/drivers/net/Space.c =================================================================== --- 2.6.10-rc1-mm1.orig/drivers/net/Space.c 2004-11-01 16:11:34.682350032 +0200 +++ 2.6.10-rc1-mm1/drivers/net/Space.c 2004-11-01 16:12:31.554704120 +0200 @@ -322,17 +322,12 @@ static void __init ethif_probe2(int unit) { - unsigned long base_addr = netdev_boot_base("eth", unit); - - if (base_addr == 1) - return; - - (void)( probe_list2(unit, m68k_probes, base_addr == 0) && - probe_list2(unit, mips_probes, base_addr == 0) && - probe_list2(unit, eisa_probes, base_addr == 0) && - probe_list2(unit, mca_probes, base_addr == 0) && - probe_list2(unit, isa_probes, base_addr == 0) && - probe_list2(unit, parport_probes, base_addr == 0)); + (void)( probe_list2(unit, m68k_probes, 1) && + probe_list2(unit, mips_probes, 1) && + probe_list2(unit, eisa_probes, 1) && + probe_list2(unit, mca_probes, 1) && + probe_list2(unit, isa_probes, 1) && + probe_list2(unit, parport_probes, 1)); } #ifdef CONFIG_TR @@ -374,11 +369,7 @@ static void __init trif_probe2(int unit) { - unsigned long base_addr = netdev_boot_base("tr", unit); - - if (base_addr == 1) - return; - probe_list2(unit, tr_probes2, base_addr == 0); + probe_list2(unit, tr_probes2, 1); } #endif Index: 2.6.10-rc1-mm1/drivers/net/natsemi.c =================================================================== --- 2.6.10-rc1-mm1.orig/drivers/net/natsemi.c 2004-11-01 16:11:33.217572712 +0200 +++ 2.6.10-rc1-mm1/drivers/net/natsemi.c 2004-11-01 16:12:31.700681928 +0200 @@ -327,7 +327,7 @@ is set, then access is permitted under spin_lock_irq(&np->lock). Thus configuration functions that want to access everything must call - disable_irq(dev->irq); + disable_irq(np->irq); spin_lock_bh(dev->xmit_lock); spin_lock_irq(&np->lock); @@ -349,7 +349,7 @@ -enum pcistuff { +enum { PCI_USES_IO = 0x01, PCI_USES_MEM = 0x02, PCI_USES_MASTER = 0x04, @@ -668,6 +668,8 @@ }; struct netdev_private { + void __iomem *mmioaddr; + unsigned int irq; /* Descriptor rings first for alignment */ dma_addr_t ring_dma; struct netdev_desc *rx_ring; @@ -770,15 +772,10 @@ static int netdev_get_eeprom(struct net_device *dev, u8 *buf); static struct ethtool_ops ethtool_ops; -static inline void __iomem *ns_ioaddr(struct net_device *dev) -{ - return (void __iomem *) dev->base_addr; -} - static void move_int_phy(struct net_device *dev, int addr) { struct netdev_private *np = netdev_priv(dev); - void __iomem *ioaddr = ns_ioaddr(dev); + void __iomem *ioaddr = np->mmioaddr; int target = 31; /* @@ -867,11 +864,11 @@ prev_eedata = eedata; } - dev->base_addr = (unsigned long __force) ioaddr; - dev->irq = irq; np = netdev_priv(dev); + np->mmioaddr = ioaddr; + np->irq = irq; np->pci_dev = pdev; pci_set_drvdata(pdev, dev); np->iosize = iosize; @@ -906,8 +903,6 @@ } option = find_cnt < MAX_UNITS ? options[find_cnt] : 0; - if (dev->mem_start) - option = dev->mem_start; /* The lower four bits are the media type. */ if (option) { @@ -1073,7 +1068,8 @@ static int mii_getbit (struct net_device *dev) { int data; - void __iomem *ioaddr = ns_ioaddr(dev); + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->mmioaddr; writel(MII_ShiftClk, ioaddr + EECtrl); data = readl(ioaddr + EECtrl); @@ -1085,7 +1081,8 @@ static void mii_send_bits (struct net_device *dev, u32 data, int len) { u32 i; - void __iomem *ioaddr = ns_ioaddr(dev); + struct netdev_private *np = netdev_priv(dev); + void __iomem *ioaddr = np->mmioaddr; for (i = (1 << (len-1)); i; i >>= 1) { @@ -1141,7 +1138,7 @@ static int mdio_read(struct net_device *dev, int reg) { struct netdev_private *np = netdev_priv(dev); - void __iomem *ioaddr = ns_ioaddr(dev); + void __iomem *ioaddr = np->mmioaddr; /* The 83815 series has two ports: * - an internal transceiver @@ -1156,7 +1153,7 @@ static void mdio_write(struct net_device *dev, int reg, u16 data) { struct netdev_private *np = netdev_priv(dev); - void __iomem *ioaddr = ns_ioaddr(dev); + void __iomem *ioaddr = np->mmioaddr; /* The 83815 series has an internal transceiver; handle separately */ if (dev->if_port == PORT_TP) @@ -1168,7 +1165,7 @@ static void init_phy_fixup(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - void __iomem *ioaddr = ns_ioaddr(dev); + void __iomem *ioaddr = np->mmioaddr; int i; u32 cfg; u16 tmp; @@ -1280,7 +1277,7 @@ static int switch_port_external(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - void __iomem *ioaddr = ns_ioaddr(dev); + void __iomem *ioaddr = np->mmioaddr; u32 cfg; cfg = readl(ioaddr + ChipConfig); @@ -1313,7 +1310,7 @@ static int switch_port_internal(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - void __iomem *ioaddr = ns_ioaddr(dev); + void __iomem *ioaddr = np->mmioaddr; int i; u32 cfg; u16 bmcr; @@ -1414,7 +1411,7 @@ u16 pmatch[3]; u16 sopass[3]; struct netdev_private *np = netdev_priv(dev); - void __iomem *ioaddr = ns_ioaddr(dev); + void __iomem *ioaddr = np->mmioaddr; /* * Resetting the chip causes some registers to be lost. @@ -1485,7 +1482,7 @@ static void natsemi_reload_eeprom(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - void __iomem *ioaddr = ns_ioaddr(dev); + void __iomem *ioaddr = np->mmioaddr; int i; writel(EepromReload, ioaddr + PCIBusCfg); @@ -1505,8 +1502,8 @@ static void natsemi_stop_rxtx(struct net_device *dev) { - void __iomem * ioaddr = ns_ioaddr(dev); struct netdev_private *np = netdev_priv(dev); + void __iomem * ioaddr = np->mmioaddr; int i; writel(RxOff | TxOff, ioaddr + ChipCmd); @@ -1527,21 +1524,21 @@ static int netdev_open(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; int i; /* Reset the chip, just in case. */ natsemi_reset(dev); - i = request_irq(dev->irq, &intr_handler, SA_SHIRQ, dev->name, dev); + i = request_irq(np->irq, &intr_handler, SA_SHIRQ, dev->name, dev); if (i) return i; if (netif_msg_ifup(np)) printk(KERN_DEBUG "%s: netdev_open() irq %d.\n", - dev->name, dev->irq); + dev->name, np->irq); i = alloc_ring(dev); if (i < 0) { - free_irq(dev->irq, dev); + free_irq(np->irq, dev); return i; } init_ring(dev); @@ -1576,7 +1573,7 @@ static void do_cable_magic(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - void __iomem *ioaddr = ns_ioaddr(dev); + void __iomem *ioaddr = np->mmioaddr; if (dev->if_port != PORT_TP) return; @@ -1621,7 +1618,7 @@ { u16 data; struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; if (dev->if_port != PORT_TP) return; @@ -1640,7 +1637,7 @@ static void check_link(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; int duplex; u16 bmsr; @@ -1701,7 +1698,7 @@ static void init_registers(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; init_phy_fixup(dev); @@ -1780,7 +1777,7 @@ { struct net_device *dev = (struct net_device *)data; struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; int next_tick = 5*HZ; if (netif_msg_timer(np)) { @@ -1805,14 +1802,14 @@ if (netif_msg_hw(np)) printk(KERN_NOTICE "%s: possible phy reset: " "re-initializing\n", dev->name); - disable_irq(dev->irq); + disable_irq(np->irq); spin_lock_irq(&np->lock); natsemi_stop_rxtx(dev); dump_ring(dev); reinit_ring(dev); init_registers(dev); spin_unlock_irq(&np->lock); - enable_irq(dev->irq); + enable_irq(np->irq); } else { /* hurry back */ next_tick = HZ; @@ -1829,10 +1826,10 @@ spin_unlock_irq(&np->lock); } if (np->oom) { - disable_irq(dev->irq); + disable_irq(np->irq); np->oom = 0; refill_rx(dev); - enable_irq(dev->irq); + enable_irq(np->irq); if (!np->oom) { writel(RxOn, ioaddr + ChipCmd); } else { @@ -1868,9 +1865,9 @@ static void tx_timeout(struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; - disable_irq(dev->irq); + disable_irq(np->irq); spin_lock_irq(&np->lock); if (!np->hands_off) { if (netif_msg_tx_err(np)) @@ -1889,7 +1886,7 @@ dev->name); } spin_unlock_irq(&np->lock); - enable_irq(dev->irq); + enable_irq(np->irq); dev->trans_start = jiffies; np->stats.tx_errors++; @@ -2068,7 +2065,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev) { struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; unsigned entry; /* Note: Ordering is important here, set the field with the @@ -2162,7 +2159,7 @@ { struct net_device *dev = dev_instance; struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; int boguscnt = max_interrupt_work; unsigned int handled = 0; @@ -2224,7 +2221,7 @@ int boguscnt = np->dirty_rx + RX_RING_SIZE - np->cur_rx; s32 desc_status = le32_to_cpu(np->rx_head_desc->cmd_status); unsigned int buflen = np->rx_buf_sz; - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; /* If the driver owns the next entry it's a new packet. Send it up. */ while (desc_status < 0) { /* e.g. & DescOwn */ @@ -2312,7 +2309,7 @@ static void netdev_error(struct net_device *dev, int intr_status) { struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; spin_lock(&np->lock); if (intr_status & LinkChange) { @@ -2371,8 +2368,8 @@ static void __get_stats(struct net_device *dev) { - void __iomem * ioaddr = ns_ioaddr(dev); struct netdev_private *np = netdev_priv(dev); + void __iomem * ioaddr = np->mmioaddr; /* The chip only need report frame silently dropped. */ np->stats.rx_crc_errors += readl(ioaddr + RxCRCErrs); @@ -2395,17 +2392,17 @@ #ifdef CONFIG_NET_POLL_CONTROLLER static void natsemi_poll_controller(struct net_device *dev) { - disable_irq(dev->irq); - intr_handler(dev->irq, dev, NULL); - enable_irq(dev->irq); + disable_irq(np->irq); + intr_handler(np->irq, dev, NULL); + enable_irq(np->irq); } #endif #define HASH_TABLE 0x200 static void __set_rx_mode(struct net_device *dev) { - void __iomem * ioaddr = ns_ioaddr(dev); struct netdev_private *np = netdev_priv(dev); + void __iomem * ioaddr = np->mmioaddr; u8 mc_filter[64]; /* Multicast hash filter */ u32 rx_mode; @@ -2450,9 +2447,9 @@ /* synchronized against open : rtnl_lock() held by caller */ if (netif_running(dev)) { struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; - disable_irq(dev->irq); + disable_irq(np->irq); spin_lock(&np->lock); /* stop engines */ natsemi_stop_rxtx(dev); @@ -2465,7 +2462,7 @@ /* restart engines */ writel(RxOn | TxOn, ioaddr + ChipCmd); spin_unlock(&np->lock); - enable_irq(dev->irq); + enable_irq(np->irq); } return 0; } @@ -2612,7 +2609,7 @@ static int netdev_set_wol(struct net_device *dev, u32 newval) { struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; u32 data = readl(ioaddr + WOLCmd) & ~WakeOptsSummary; /* translate to bitmasks this chip understands */ @@ -2642,7 +2639,7 @@ static int netdev_get_wol(struct net_device *dev, u32 *supported, u32 *cur) { struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; u32 regval = readl(ioaddr + WOLCmd); *supported = (WAKE_PHY | WAKE_UCAST | WAKE_MCAST | WAKE_BCAST @@ -2678,7 +2675,7 @@ static int netdev_set_sopass(struct net_device *dev, u8 *newval) { struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; u16 *sval = (u16 *)newval; u32 addr; @@ -2710,7 +2707,7 @@ static int netdev_get_sopass(struct net_device *dev, u8 *data) { struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; u16 *sval = (u16 *)data; u32 addr; @@ -2894,7 +2891,8 @@ int j; u32 rfcr; u32 *rbuf = (u32 *)buf; - void __iomem * ioaddr = ns_ioaddr(dev); + struct netdev_private *np = netdev_priv(dev); + void __iomem * ioaddr = np->mmioaddr; /* read non-mii page 0 of registers */ for (i = 0; i < NATSEMI_PG0_NREGS/2; i++) { @@ -2944,7 +2942,8 @@ { int i; u16 *ebuf = (u16 *)buf; - void __iomem * ioaddr = ns_ioaddr(dev); + struct netdev_private *np = netdev_priv(dev); + void __iomem * ioaddr = np->mmioaddr; /* eeprom_read reads 16 bits, and indexes by 16 bits */ for (i = 0; i < NATSEMI_EEPROM_SIZE/2; i++) { @@ -3016,8 +3015,8 @@ static void enable_wol_mode(struct net_device *dev, int enable_intr) { - void __iomem * ioaddr = ns_ioaddr(dev); struct netdev_private *np = netdev_priv(dev); + void __iomem * ioaddr = np->mmioaddr; if (netif_msg_wol(np)) printk(KERN_INFO "%s: remaining active for wake-on-lan\n", @@ -3049,8 +3048,8 @@ static int netdev_close(struct net_device *dev) { - void __iomem * ioaddr = ns_ioaddr(dev); struct netdev_private *np = netdev_priv(dev); + void __iomem * ioaddr = np->mmioaddr; if (netif_msg_ifdown(np)) printk(KERN_DEBUG @@ -3070,16 +3069,16 @@ */ del_timer_sync(&np->timer); - disable_irq(dev->irq); + disable_irq(np->irq); spin_lock_irq(&np->lock); /* Disable interrupts, and flush posted writes */ writel(0, ioaddr + IntrEnable); readl(ioaddr + IntrEnable); np->hands_off = 1; spin_unlock_irq(&np->lock); - enable_irq(dev->irq); + enable_irq(np->irq); - free_irq(dev->irq, dev); + free_irq(np->irq, dev); /* Interrupt disabled, interrupt handler released, * queue stopped, timer deleted, rtnl_lock held @@ -3126,7 +3125,8 @@ static void __devexit natsemi_remove1 (struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); - void __iomem * ioaddr = ns_ioaddr(dev); + struct netdev_private *np = netdev_priv(dev); + void __iomem * ioaddr = np->mmioaddr; unregister_netdev (dev); pci_release_regions (pdev); @@ -3164,13 +3164,13 @@ { struct net_device *dev = pci_get_drvdata (pdev); struct netdev_private *np = netdev_priv(dev); - void __iomem * ioaddr = ns_ioaddr(dev); + void __iomem * ioaddr = np->mmioaddr; rtnl_lock(); if (netif_running (dev)) { del_timer_sync(&np->timer); - disable_irq(dev->irq); + disable_irq(np->irq); spin_lock_irq(&np->lock); writel(0, ioaddr + IntrEnable); @@ -3179,7 +3179,7 @@ netif_stop_queue(dev); spin_unlock_irq(&np->lock); - enable_irq(dev->irq); + enable_irq(np->irq); /* Update the error counts. */ __get_stats(dev); @@ -3222,13 +3222,13 @@ natsemi_reset(dev); init_ring(dev); - disable_irq(dev->irq); + disable_irq(np->irq); spin_lock_irq(&np->lock); np->hands_off = 0; init_registers(dev); netif_device_attach(dev); spin_unlock_irq(&np->lock); - enable_irq(dev->irq); + enable_irq(np->irq); mod_timer(&np->timer, jiffies + 1*HZ); } Index: 2.6.10-rc1-mm1/include/linux/netdevice.h =================================================================== --- 2.6.10-rc1-mm1.orig/include/linux/netdevice.h 2004-11-01 16:11:34.683349880 +0200 +++ 2.6.10-rc1-mm1/include/linux/netdevice.h 2004-11-01 16:12:31.625693328 +0200 @@ -272,15 +272,6 @@ char name[IFNAMSIZ]; /* - * I/O specific fields - * FIXME: Merge these and struct ifmap into one - */ - unsigned long mem_end; /* shared mem end */ - unsigned long mem_start; /* shared mem start */ - unsigned long base_addr; /* device I/O address */ - unsigned int irq; /* device IRQ number */ - - /* * Some hardware also needs these fields, but they are not * part of the usual set specified in Space.c. */ @@ -522,9 +513,6 @@ extern struct net_device *dev_base; /* All devices */ extern rwlock_t dev_base_lock; /* Device list lock */ -extern int netdev_boot_setup_add(char *name, struct ifmap *map); -extern int netdev_boot_setup_check(struct net_device *dev); -extern unsigned long netdev_boot_base(const char *prefix, int unit); extern struct net_device *dev_getbyhwaddr(unsigned short type, char *hwaddr); extern struct net_device *__dev_getfirstbyhwtype(unsigned short type); extern struct net_device *dev_getfirstbyhwtype(unsigned short type); Index: 2.6.10-rc1-mm1/net/core/dev.c =================================================================== --- 2.6.10-rc1-mm1.orig/net/core/dev.c 2004-11-01 16:11:35.376244544 +0200 +++ 2.6.10-rc1-mm1/net/core/dev.c 2004-11-01 16:12:31.559703360 +0200 @@ -343,129 +343,6 @@ synchronize_net(); } -/****************************************************************************** - - Device Boot-time Settings Routines - -*******************************************************************************/ - -/* Boot time configuration table */ -static struct netdev_boot_setup dev_boot_setup[NETDEV_BOOT_SETUP_MAX]; - -/** - * netdev_boot_setup_add - add new setup entry - * @name: name of the device - * @map: configured settings for the device - * - * Adds new setup entry to the dev_boot_setup list. The function - * returns 0 on error and 1 on success. This is a generic routine to - * all netdevices. - */ -int netdev_boot_setup_add(char *name, struct ifmap *map) -{ - struct netdev_boot_setup *s; - int i; - - s = dev_boot_setup; - for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) { - if (s[i].name[0] == '\0' || s[i].name[0] == ' ') { - memset(s[i].name, 0, sizeof(s[i].name)); - strcpy(s[i].name, name); - memcpy(&s[i].map, map, sizeof(s[i].map)); - break; - } - } - - return i >= NETDEV_BOOT_SETUP_MAX ? 0 : 1; -} - -/** - * netdev_boot_setup_check - check boot time settings - * @dev: the netdevice - * - * Check boot time settings for the device. - * The found settings are set for the device to be used - * later in the device probing. - * Returns 0 if no settings found, 1 if they are. - */ -int netdev_boot_setup_check(struct net_device *dev) -{ - struct netdev_boot_setup *s = dev_boot_setup; - int i; - - for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) { - if (s[i].name[0] != '\0' && s[i].name[0] != ' ' && - !strncmp(dev->name, s[i].name, strlen(s[i].name))) { - dev->irq = s[i].map.irq; - dev->base_addr = s[i].map.base_addr; - dev->mem_start = s[i].map.mem_start; - dev->mem_end = s[i].map.mem_end; - return 1; - } - } - return 0; -} - - -/** - * netdev_boot_base - get address from boot time settings - * @prefix: prefix for network device - * @unit: id for network device - * - * Check boot time settings for the base address of device. - * The found settings are set for the device to be used - * later in the device probing. - * Returns 0 if no settings found. - */ -unsigned long netdev_boot_base(const char *prefix, int unit) -{ - const struct netdev_boot_setup *s = dev_boot_setup; - char name[IFNAMSIZ]; - int i; - - sprintf(name, "%s%d", prefix, unit); - - /* - * If device already registered then return base of 1 - * to indicate not to probe for this interface - */ - if (__dev_get_by_name(name)) - return 1; - - for (i = 0; i < NETDEV_BOOT_SETUP_MAX; i++) - if (!strcmp(name, s[i].name)) - return s[i].map.base_addr; - return 0; -} - -/* - * Saves at boot time configured settings for any netdevice. - */ -int __init netdev_boot_setup(char *str) -{ - int ints[5]; - struct ifmap map; - - str = get_options(str, ARRAY_SIZE(ints), ints); - if (!str || !*str) - return 0; - - /* Save settings */ - memset(&map, 0, sizeof(map)); - if (ints[0] > 0) - map.irq = ints[1]; - if (ints[0] > 1) - map.base_addr = ints[2]; - if (ints[0] > 2) - map.mem_start = ints[3]; - if (ints[0] > 3) - map.mem_end = ints[4]; - - /* Add new entry to the list */ - return netdev_boot_setup_add(str, &map); -} - -__setup("netdev=", netdev_boot_setup); /******************************************************************************* @@ -2404,23 +2281,6 @@ NETDEV_CHANGEADDR, dev); return 0; - case SIOCGIFMAP: - ifr->ifr_map.mem_start = dev->mem_start; - ifr->ifr_map.mem_end = dev->mem_end; - ifr->ifr_map.base_addr = dev->base_addr; - ifr->ifr_map.irq = dev->irq; - ifr->ifr_map.dma = dev->dma; - ifr->ifr_map.port = dev->if_port; - return 0; - - case SIOCSIFMAP: - if (dev->set_config) { - if (!netif_device_present(dev)) - return -ENODEV; - return dev->set_config(dev, &ifr->ifr_map); - } - return -EOPNOTSUPP; - case SIOCADDMULTI: if (!dev->set_multicast_list || ifr->ifr_hwaddr.sa_family != AF_UNSPEC) @@ -3264,7 +3124,6 @@ EXPORT_SYMBOL(dev_change_name); EXPORT_SYMBOL(dev_set_mtu); EXPORT_SYMBOL(free_netdev); -EXPORT_SYMBOL(netdev_boot_setup_check); EXPORT_SYMBOL(netdev_set_master); EXPORT_SYMBOL(netdev_state_change); EXPORT_SYMBOL(netif_receive_skb); Index: 2.6.10-rc1-mm1/net/core/rtnetlink.c =================================================================== --- 2.6.10-rc1-mm1.orig/net/core/rtnetlink.c 2004-11-01 16:11:32.428692640 +0200 +++ 2.6.10-rc1-mm1/net/core/rtnetlink.c 2004-11-01 16:12:31.755673568 +0200 @@ -181,18 +181,6 @@ RTA_PUT(skb, IFLA_WEIGHT, sizeof(weight), &weight); } - if (1) { - struct rtnl_link_ifmap map = { - .mem_start = dev->mem_start, - .mem_end = dev->mem_end, - .base_addr = dev->base_addr, - .irq = dev->irq, - .dma = dev->dma, - .port = dev->if_port, - }; - RTA_PUT(skb, IFLA_MAP, sizeof(map), &map); - } - if (dev->addr_len) { RTA_PUT(skb, IFLA_ADDRESS, dev->addr_len, dev->dev_addr); RTA_PUT(skb, IFLA_BROADCAST, dev->addr_len, dev->broadcast); Index: 2.6.10-rc1-mm1/net/ethernet/eth.c =================================================================== --- 2.6.10-rc1-mm1.orig/net/ethernet/eth.c 2004-11-01 16:11:34.687349272 +0200 +++ 2.6.10-rc1-mm1/net/ethernet/eth.c 2004-11-01 16:12:31.560703208 +0200 @@ -62,10 +62,6 @@ #include #include -extern int __init netdev_boot_setup(char *str); - -__setup("ether=", netdev_boot_setup); - /* * Create the Ethernet MAC header for an arbitrary protocol layer * From zaitcev@redhat.com Mon Nov 1 08:28:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 08:28:25 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1GSK9O028509 for ; Mon, 1 Nov 2004 08:28:20 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id iA1GS3FP018297 for ; Mon, 1 Nov 2004 11:28:03 -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 iA1GS3r30546 for ; Mon, 1 Nov 2004 11:28:03 -0500 Received: from lembas.zaitcev.lan (vpn50-9.rdu.redhat.com [172.16.50.9]) by devserv.devel.redhat.com (8.12.11/8.12.10) with SMTP id iA1GRxap016581; Mon, 1 Nov 2004 11:27:59 -0500 Date: Mon, 1 Nov 2004 08:27:57 -0800 From: Pete Zaitcev To: netdev@oss.sgi.com Cc: jgarzik@redhat.com, zaitcev@redhat.com Subject: The boot time failure in tulip Message-ID: <20041101082757.64583eb2@lembas.zaitcev.lan> Organization: Red Hat, Inc. X-Mailer: Sylpheed-Claws 0.9.12cvs126.2 (GTK+ 2.4.13; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-archive-position: 11282 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: zaitcev@redhat.com Precedence: bulk X-list: netdev Content-Length: 1448 Lines: 39 I have finally figured how the failure develops. I poked Jeff about it before, but nothing could be done because it looked impossible to reproduce without reboots. Just asking for negotiation with mii-tool would always yield a working link. Also, this only happens with a dumb hub (tried several), but works dandy when talking to a switch. So, here's the deal. The Fedora startup has a segment which works like this: ip link set dev $1 up >/dev/null 2>&1 timeout=0 while [ $timeout -le 10 ]; do check_mii_tool $1 m=$? check_ethtool $1 e=$? if [ $m -eq 1 ] || [ $e -eq 1 ] ; then return 1 fi if [ $m -eq 2 ] && [ $e -eq 2 ] ; then return 1 fi usleep 500000 timeout=$((timeout+1)) done It appears that the negotiation will not happen after "ip link set ... up" if we keep beating the interface with mii-tool (despite the 0.5s delay). Weird, huh? It's enough to fix things if a 3s delay is inserted after the ip ... up. I think the bug here is that polling with mii-tool disrupts the autonegotiation. It is ok to return failure after a reset, but eventually this has to resolve itself despite the polling. I suspect that 3c59x has the same failure as well. But I haven't played with it much. -- Pete From shemminger@osdl.org Mon Nov 1 09:19:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 09:19:10 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1HJ3Pj030004 for ; Mon, 1 Nov 2004 09:19:04 -0800 Received: from zqx3.pdx.osdl.net (fw.osdl.org [65.172.181.6]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id iA1HIbPE007190 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 1 Nov 2004 09:18:37 -0800 Date: Mon, 1 Nov 2004 09:20:27 -0800 From: Stephen Hemminger To: Michael Vittrup Larsen Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] tcp: efficient port randomisation Message-Id: <20041101092027.2a741e82@zqx3.pdx.osdl.net> In-Reply-To: <200411011058.23141.michael.vittrup.larsen@ericsson.com> References: <20041027092531.78fe438c@guest-251-240.pdx.osdl.net> <200410291048.01955.michael.vittrup.larsen@ericsson.com> <20041029102828.123502e7@zqx3.pdx.osdl.net> <200411011058.23141.michael.vittrup.larsen@ericsson.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i686-suse-linux) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: osdl$Revision: 1.93 $ X-Scanned-By: MIMEDefang 2.36 X-archive-position: 11283 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: 1346 Lines: 31 On Mon, 1 Nov 2004 11:58:23 +0200 Michael Vittrup Larsen wrote: > On Friday 29 October 2004 19:28, Stephen Hemminger wrote: > > Provide port randomization for incoming connections using variation of > > existing sequence number hash. Replace tcp_portalloc_lock and > > tcp_port_rover with atomic operation to allow better parallelism. > > > > This is based on > > http://www.ietf.org/internet-drafts/draft-larsen-tsvwg-port-randomisation-0 > >0.txt (with confirmation of of no IPR issues). > > I have looked through this, and have a few comments: > > * It is probably a good strategy to set 'tcp_rover_next' such that > the next search is resumed from the previous port found to be free. > (similar to the old algorithm). I don't see this in your patch, > but of course I could have missed it. It was intentional since it would require holding a lock around the search. The tradeoff is better SMP performance in the sparsely filled port space (more typical) vs. better UP performance in the case of a mostly full port space. > * connect_port_offset() does not (at least from an algorithm point > of view) need to return an u32, an u16 is sufficient. If it is truncated to u16, then compiler has to take extra effort to truncate is unnecessary given later modulo operation. > Michael Larsen From nacc@us.ibm.com Mon Nov 1 09:31:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 09:31:24 -0800 (PST) Received: from e3.ny.us.ibm.com (e3.ny.us.ibm.com [32.97.182.103]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1HVD0P030602 for ; Mon, 1 Nov 2004 09:31:20 -0800 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e3.ny.us.ibm.com (8.12.10/8.12.9) with ESMTP id iA1HUpPJ733244; Mon, 1 Nov 2004 12:30:51 -0500 Received: from localhost.localdomain (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA1HUnU5222144; Mon, 1 Nov 2004 12:30:50 -0500 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.11/8.12.11/Debian-5) with ESMTP id iA1IVIEd001786; Mon, 1 Nov 2004 10:31:19 -0800 Received: (from nacc@localhost) by localhost.localdomain (8.12.11/8.12.11/Debian-5) id iA1IVI5M001783; Mon, 1 Nov 2004 10:31:18 -0800 X-Authentication-Warning: localhost.localdomain: nacc set sender to nacc@us.ibm.com using -f Date: Mon, 1 Nov 2004 10:31:18 -0800 From: Nishanth Aravamudan To: Jeff Garzik Cc: janitor@sternwelten.at, netdev@oss.sgi.com Subject: Re: [patch 05/18] net/s2io: replace schedule_timeout() with msleep() Message-ID: <20041101183118.GA1730@us.ibm.com> References: <4184C7EE.5070107@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4184C7EE.5070107@pobox.com> X-Operating-System: Linux 2.6.9 (i686) User-Agent: Mutt/1.5.6+20040722i X-archive-position: 11284 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 657 Lines: 20 On Sun, Oct 31, 2004 at 06:09:34AM -0500, Jeff Garzik wrote: > janitor@sternwelten.at wrote: > >@@ -2846,11 +2838,10 @@ static int s2io_ethtool_idnic(struct net > > sp->id_timer.data = (unsigned long) sp; > > } > > mod_timer(&sp->id_timer, jiffies); > >- set_current_state(TASK_INTERRUPTIBLE); > > if (data) > >- schedule_timeout(data * HZ); > >+ msleep_interruptible(data * 1000); > > > clearly wants ssleep() here Even though ssleep() is in TASK_UNINTERRUPTIBLE? In cases where the existing code used TASK_INTERRUPTIBLE, but was sleeping in terms of seconds, I left it as msleep_interruptible, since ssleep_interruptible() doesn't exist. -Nish From rddunlap@osdl.org Mon Nov 1 09:33:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 09:33:09 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1HX3k2030836 for ; Mon, 1 Nov 2004 09:33:03 -0800 Received: from [172.20.1.27] (fw.osdl.org [65.172.181.6]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id iA1HWWPE008900 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Mon, 1 Nov 2004 09:32:32 -0800 Message-ID: <418670AC.7010801@osdl.org> Date: Mon, 01 Nov 2004 09:21:48 -0800 From: "Randy.Dunlap" Organization: OSDL User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jeff Garzik CC: netdev@oss.sgi.com, rl@hellgate.ch Subject: [PATCH] via-rhine: references __init code during resume References: <4179543F.1020407@osdl.org> <418390F2.7080901@pobox.com> In-Reply-To: <418390F2.7080901@pobox.com> Content-Type: multipart/mixed; boundary="------------060901020707080309020307" X-MIMEDefang-Filter: osdl$Revision: 1.93 $ X-Scanned-By: MIMEDefang 2.36 X-archive-position: 11285 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: 1310 Lines: 44 This is a multi-part message in MIME format. --------------060901020707080309020307 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit [Does it work if the patch description is inline & the patch is attached?] Fix __init section usage: rhine_resume calls enable_mmio, so latter cannot be __devinit; Error: ./drivers/net/via-rhine.o .text refers to 0000000000000925 R_X86_64_PC32 .init.text+0xfffffffffffffffc Signed-off-by: Randy Dunlap diffstat:= drivers/net/via-rhine.c | 2 +- 1 files changed, 1 insertion(+), 1 deletion(-) -- ~Randy --------------060901020707080309020307 Content-Type: text/x-patch; name="via_rhine_mmio.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="via_rhine_mmio.patch" diff -Naurp ./drivers/net/via-rhine.c~via_rhine_mmio ./drivers/net/via-rhine.c --- ./drivers/net/via-rhine.c~via_rhine_mmio 2004-10-18 14:55:28.000000000 -0700 +++ ./drivers/net/via-rhine.c 2004-10-22 10:10:58.928311448 -0700 @@ -627,7 +627,7 @@ static void rhine_chip_reset(struct net_ } #ifdef USE_MMIO -static void __devinit enable_mmio(long pioaddr, u32 quirks) +static void enable_mmio(long pioaddr, u32 quirks) { int n; if (quirks & rqRhineI) { --------------060901020707080309020307-- From mdomsch@lists.us.dell.com Mon Nov 1 09:35:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 09:35:15 -0800 (PST) Received: from lists.us.dell.com (linux.us.dell.com [143.166.224.162]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1HZ8n6031326 for ; Mon, 1 Nov 2004 09:35:09 -0800 Received: from lists.us.dell.com (localhost.localdomain [127.0.0.1]) by lists.us.dell.com (8.12.10/8.12.10/Dell.IT.3.31.03) with ESMTP id iA1HYZMU012622; Mon, 1 Nov 2004 11:34:35 -0600 Received: (from mdomsch@localhost) by lists.us.dell.com (8.12.10/8.12.10/Submit) id iA1HYYIX012620; Mon, 1 Nov 2004 11:34:34 -0600 Date: Mon, 1 Nov 2004 11:34:34 -0600 From: Matt Domsch To: netdev@oss.sgi.com Cc: jamal , Herbert Xu Subject: Re: [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len Message-ID: <20041101173434.GA12437@lists.us.dell.com> References: <20041030013700.GA21540@lists.us.dell.com> <20041030030936.GA25102@lists.us.dell.com> <1099163419.1039.97.camel@jzny.localdomain> <20041101044433.GA18772@lists.us.dell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041101044433.GA18772@lists.us.dell.com> User-Agent: Mutt/1.4.1i X-archive-position: 11286 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Matt_Domsch@dell.com Precedence: bulk X-list: netdev Content-Length: 2011 Lines: 52 On Sun, Oct 31, 2004 at 10:44:33PM -0600, Matt Domsch wrote: > I think -EOVERFLOW would be appropriate return for dev->addr_len > > sizeof sa_data, yes? > > I'd prefer though, that an "obsolete" function, be marked as such > somehow (perhaps print a net_ratelimit()ed KERN_DEBUG message when > it's called telling apps to move to rtnetlink), and that the behaviour > for everything except overflow be consistent with the prior > implementation, at least until such a time that all the apps in the > distros are converted to rtnetlink. How's this look? This makes ioctl(SIOCIFHWADDR) behavior in 2.6 consistent with that of previous kernels wherever possible. It returns -EOVERFLOW if it can't represent the address, zeros the data if dev->addr_len is zero, and prints a KERN_DEBUG message telling people to fix their applications to use rtnetlink. Compiles on x86 and x86-64 cleanly. Signed-off-by: Matt Domsch -- Matt Domsch Sr. Software Engineer, Lead Engineer Dell Linux Solutions linux.dell.com & www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com ===== net/core/dev.c 1.169 vs edited ===== --- 1.169/net/core/dev.c 2004-10-26 11:09:33 -05:00 +++ edited/net/core/dev.c 2004-11-01 11:20:25 -06:00 @@ -2375,8 +2375,16 @@ return dev_set_mtu(dev, ifr->ifr_mtu); case SIOCGIFHWADDR: - memcpy(ifr->ifr_hwaddr.sa_data, dev->dev_addr, - min(sizeof ifr->ifr_hwaddr.sa_data, (size_t) dev->addr_len)); + if (net_ratelimit()) + printk(KERN_DEBUG "Warning: %s uses obsolete ioctl(SIOCGIFHWADDR), please convert it to rtnetlink(3,7)\n", current->comm); + + if ((size_t) dev->addr_len > sizeof ifr->ifr_hwaddr.sa_data) + return -EOVERFLOW; + else if (!dev->addr_len) + memset(ifr->ifr_hwaddr.sa_data, 0, sizeof ifr->ifr_hwaddr.sa_data); + else + memcpy(ifr->ifr_hwaddr.sa_data, dev->dev_addr, + min(sizeof ifr->ifr_hwaddr.sa_data, (size_t) dev->addr_len)); ifr->ifr_hwaddr.sa_family = dev->type; return 0; From jgarzik@pobox.com Mon Nov 1 10:03:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 10:03:57 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1I3iML032379 for ; Mon, 1 Nov 2004 10:03:46 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1COgWb-00077m-Rp; Mon, 01 Nov 2004 18:03:25 +0000 Message-ID: <41867A5E.4040301@pobox.com> Date: Mon, 01 Nov 2004 13:03:10 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nishanth Aravamudan CC: janitor@sternwelten.at, netdev@oss.sgi.com Subject: Re: [patch 05/18] net/s2io: replace schedule_timeout() with msleep() References: <4184C7EE.5070107@pobox.com> <20041101183118.GA1730@us.ibm.com> In-Reply-To: <20041101183118.GA1730@us.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11287 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: 747 Lines: 29 Nishanth Aravamudan wrote: > On Sun, Oct 31, 2004 at 06:09:34AM -0500, Jeff Garzik wrote: > >>janitor@sternwelten.at wrote: >> >>>@@ -2846,11 +2838,10 @@ static int s2io_ethtool_idnic(struct net >>> sp->id_timer.data = (unsigned long) sp; >>> } >>> mod_timer(&sp->id_timer, jiffies); >>>- set_current_state(TASK_INTERRUPTIBLE); >>> if (data) >>>- schedule_timeout(data * HZ); >>>+ msleep_interruptible(data * 1000); >> >> >>clearly wants ssleep() here > > > Even though ssleep() is in TASK_UNINTERRUPTIBLE? In cases where the > existing code used TASK_INTERRUPTIBLE, but was sleeping in terms of > seconds, I left it as msleep_interruptible, since ssleep_interruptible() > doesn't exist. Right: create ssleep_interruptible() :) Jeff From nacc@us.ibm.com Mon Nov 1 10:08:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 10:09:03 -0800 (PST) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1I8xoo000382 for ; Mon, 1 Nov 2004 10:08:59 -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.9) with ESMTP id iA1I8M8m606240 for ; Mon, 1 Nov 2004 13:08:23 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA1I8EBb134230 for ; Mon, 1 Nov 2004 11:08:16 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1I8D0K012010 for ; Mon, 1 Nov 2004 11:08:14 -0700 Received: from localhost.localdomain (DYN318967BLD.beaverton.ibm.com [9.47.21.82]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1I8D4k011957; Mon, 1 Nov 2004 11:08:13 -0700 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.11/8.12.11/Debian-5) with ESMTP id iA1J8gDN001969; Mon, 1 Nov 2004 11:08:42 -0800 Received: (from nacc@localhost) by localhost.localdomain (8.12.11/8.12.11/Debian-5) id iA1J8fVk001966; Mon, 1 Nov 2004 11:08:41 -0800 X-Authentication-Warning: localhost.localdomain: nacc set sender to nacc@us.ibm.com using -f Date: Mon, 1 Nov 2004 11:08:41 -0800 From: Nishanth Aravamudan To: Jeff Garzik Cc: netdev@oss.sgi.com, kernel-janitors@lists.osdl.org Subject: [PATCH] net/gt96100eth: replace gt96100_delay() with msleep_interruptible() Message-ID: <20041101190841.GB1730@us.ibm.com> References: <4184C72F.8000905@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4184C72F.8000905@pobox.com> X-Operating-System: Linux 2.6.9 (i686) User-Agent: Mutt/1.5.6+20040722i X-archive-position: 11288 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 3015 Lines: 90 On Sun, Oct 31, 2004 at 06:06:23AM -0500, Jeff Garzik wrote: > janitor@sternwelten.at wrote: > >@@ -528,7 +517,7 @@ abort(struct net_device *dev, u32 abort_ > > // wait for abort to complete > > while (GT96100ETH_READ(gp, GT96100_ETH_SDMA_COMM) & abort_bits) { > > // snooze for 20 msec and check again > >- gt96100_delay(1); > >+ msleep_interruptible(20); > > > > if (--timedout == 0) { > > > don't change the behavior of the driver, even if it disagrees with the > comment. Ok, please find the corrected patch below. Description: Uses msleep_interruptible() instead of gt96100_delay() to guarantee the task delays as expected. Removes prototype and definition of now unused gt96100_delay() function. Corrects one comment to correspond to the code. Signed-off-by: Nishanth Aravamudan --- 2.6.10-rc1-vanilla/drivers/net/gt96100eth.c 2004-10-30 15:33:30.000000000 -0700 +++ 2.6.10-rc1/drivers/net/gt96100eth.c 2004-11-01 11:05:37.000000000 -0800 @@ -59,7 +59,6 @@ // prototypes static void* dmaalloc(size_t size, dma_addr_t *dma_handle); static void dmafree(size_t size, void *vaddr); -static void gt96100_delay(int msec); static int gt96100_add_hash_entry(struct net_device *dev, unsigned char* addr); static void read_mib_counters(struct gt96100_private *gp); @@ -183,16 +182,6 @@ static void dmafree(size_t size, void *v free_pages((unsigned long)vaddr, get_order(size)); } -static void gt96100_delay(int ms) -{ - if (in_interrupt()) - return; - else { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(ms*HZ/1000); - } -} - static int parse_mac_addr(struct net_device *dev, char* macstr) { @@ -238,7 +227,7 @@ read_MII(int phy_addr, u32 reg) // wait for last operation to complete while (GT96100_READ(GT96100_ETH_SMI_REG) & smirBusy) { // snooze for 1 msec and check again - gt96100_delay(1); + msleep_interruptible(1); if (--timedout == 0) { printk(KERN_ERR "%s: busy timeout!!\n", __FUNCTION__); @@ -252,7 +241,7 @@ read_MII(int phy_addr, u32 reg) // wait for read to complete while (!((smir = GT96100_READ(GT96100_ETH_SMI_REG)) & smirReadValid)) { // snooze for 1 msec and check again - gt96100_delay(1); + msleep_interruptible(1); if (--timedout == 0) { printk(KERN_ERR "%s: timeout!!\n", __FUNCTION__); @@ -304,7 +293,7 @@ write_MII(int phy_addr, u32 reg, u16 dat // wait for last operation to complete while (GT96100_READ(GT96100_ETH_SMI_REG) & smirBusy) { // snooze for 1 msec and check again - gt96100_delay(1); + msleep_interruptible(1); if (--timedout == 0) { printk(KERN_ERR "%s: busy timeout!!\n", __FUNCTION__); @@ -527,8 +516,8 @@ abort(struct net_device *dev, u32 abort_ // wait for abort to complete while (GT96100ETH_READ(gp, GT96100_ETH_SDMA_COMM) & abort_bits) { - // snooze for 20 msec and check again - gt96100_delay(1); + // snooze for 1 msec and check again + msleep_interruptible(1); if (--timedout == 0) { err("%s: timeout!!\n", __FUNCTION__); From nacc@us.ibm.com Mon Nov 1 10:14:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 10:14:51 -0800 (PST) Received: from e4.ny.us.ibm.com (e4.ny.us.ibm.com [32.97.182.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1IEiUM000855 for ; Mon, 1 Nov 2004 10:14:47 -0800 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e4.ny.us.ibm.com (8.12.10/8.12.9) with ESMTP id iA1IENCE396636; Mon, 1 Nov 2004 13:14:23 -0500 Received: from localhost.localdomain (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA1IELDC231800; Mon, 1 Nov 2004 13:14:22 -0500 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.11/8.12.11/Debian-5) with ESMTP id iA1JEosC002023; Mon, 1 Nov 2004 11:14:51 -0800 Received: (from nacc@localhost) by localhost.localdomain (8.12.11/8.12.11/Debian-5) id iA1JEoMC002020; Mon, 1 Nov 2004 11:14:50 -0800 X-Authentication-Warning: localhost.localdomain: nacc set sender to nacc@us.ibm.com using -f Date: Mon, 1 Nov 2004 11:14:50 -0800 From: Nishanth Aravamudan To: Jeff Garzik Cc: janitor@sternwelten.at, netdev@oss.sgi.com Subject: Re: [patch 05/18] net/s2io: replace schedule_timeout() with msleep() Message-ID: <20041101191450.GC1730@us.ibm.com> References: <4184C7EE.5070107@pobox.com> <20041101183118.GA1730@us.ibm.com> <41867A5E.4040301@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41867A5E.4040301@pobox.com> X-Operating-System: Linux 2.6.9 (i686) User-Agent: Mutt/1.5.6+20040722i X-archive-position: 11289 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 985 Lines: 30 On Mon, Nov 01, 2004 at 01:03:10PM -0500, Jeff Garzik wrote: > Nishanth Aravamudan wrote: > >On Sun, Oct 31, 2004 at 06:09:34AM -0500, Jeff Garzik wrote: > > > >>janitor@sternwelten.at wrote: > >> > >>>@@ -2846,11 +2838,10 @@ static int s2io_ethtool_idnic(struct net > >>> sp->id_timer.data = (unsigned long) sp; > >>> } > >>> mod_timer(&sp->id_timer, jiffies); > >>>- set_current_state(TASK_INTERRUPTIBLE); > >>> if (data) > >>>- schedule_timeout(data * HZ); > >>>+ msleep_interruptible(data * 1000); > >> > >> > >>clearly wants ssleep() here > > > > > >Even though ssleep() is in TASK_UNINTERRUPTIBLE? In cases where the > >existing code used TASK_INTERRUPTIBLE, but was sleeping in terms of > >seconds, I left it as msleep_interruptible, since ssleep_interruptible() > >doesn't exist. > > Right: create ssleep_interruptible() :) Ok, will do :) I wasn't sure by your e-mail whether you meant to use ssleep() or create ssleep_interruptible(). Patch will follow shortly. -Nish From nacc@us.ibm.com Mon Nov 1 10:22:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 10:22:33 -0800 (PST) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.132]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1IMSgX001381 for ; Mon, 1 Nov 2004 10:22:28 -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.9) with ESMTP id iA1IM6J8342880 for ; Mon, 1 Nov 2004 13:22:06 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA1IM5PM182682 for ; Mon, 1 Nov 2004 11:22:05 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1ILhIa017360 for ; Mon, 1 Nov 2004 11:21:43 -0700 Received: from localhost.localdomain (DYN318967BLD.beaverton.ibm.com [9.47.21.82]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1ILggo017305; Mon, 1 Nov 2004 11:21:43 -0700 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.11/8.12.11/Debian-5) with ESMTP id iA1JMBrf002099; Mon, 1 Nov 2004 11:22:11 -0800 Received: (from nacc@localhost) by localhost.localdomain (8.12.11/8.12.11/Debian-5) id iA1JMA98002096; Mon, 1 Nov 2004 11:22:10 -0800 X-Authentication-Warning: localhost.localdomain: nacc set sender to nacc@us.ibm.com using -f Date: Mon, 1 Nov 2004 11:22:10 -0800 From: Nishanth Aravamudan To: Jeff Garzik Cc: kernel-janitors@lists.osdl.org, netdev@oss.sgi.com Subject: [PATCH] linux/ibmtr.h: add constants for appropriate delays Message-ID: <20041101192210.GD1730@us.ibm.com> References: <4184C66B.8040501@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4184C66B.8040501@pobox.com> X-Operating-System: Linux 2.6.9 (i686) User-Agent: Mutt/1.5.6+20040722i X-archive-position: 11290 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 2280 Lines: 63 On Sun, Oct 31, 2004 at 06:03:07AM -0500, Jeff Garzik wrote: > janitor@sternwelten.at wrote: > >Any comments would be appreciated. > > > >Description: Use msleep() / msleep_interruptible() [as appropriate] > >instead of schedule_timeout() to guarantee the task delays as expected. > > > >Signed-off-by: Nishanth Aravamudan > >Signed-off-by: Maximilian Attems > > > >--- > > > > linux-2.6.10-rc1-max/drivers/net/tokenring/ibmtr.c | 11 +++++------ > > 1 files changed, 5 insertions(+), 6 deletions(-) > >- schedule_timeout(TR_RST_TIME); /* wait 50ms */ > >+ msleep(jiffies_to_msecs(TR_RST_TIME)); /* wait 50ms */ > >- current->state=TASK_UNINTERRUPTIBLE; > >- schedule_timeout(TR_RST_TIME); /* wait 50ms */ > >+ msleep(jiffies_to_msecs(TR_RST_TIME)); /* wait 50ms */ > >- current->state=TASK_INTERRUPTIBLE; > >- i=schedule_timeout(TR_RETRY_INTERVAL); /* wait 30 seconds */ > >- if(i!=0) break; /*prob. a signal, like the i>24*HZ case > >above */ > >+ if(msleep_interruptible(jiffies_to_msecs(TR_RETRY_INTERVAL))) > >+ break; /*prob. a signal, like the i>24*HZ case above > It makes more sense to convert the constants to msecs in the source > code, instead of converting them at runtime. This required changing both the .h and .c files, the first of which is attached below. Description: Adds constant definitions for timeout variables in terms of milliseconds to avoid run-time constant conversion. Signed-off-by: Nishanth Aravamudan --- 2.6.10-rc1-vanilla/include/linux/ibmtr.h 2004-10-30 15:34:03.000000000 -0700 +++ 2.6.10-rc1/include/linux/ibmtr.h 2004-11-01 11:13:41.000000000 -0800 @@ -6,8 +6,10 @@ /* ported to the Alpha architecture 02/20/96 (just used the HZ macro) */ -#define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s */ -#define TR_RST_TIME (HZ/20) /* 5 on PC = 50 ms */ +#define TR_RETRY_INTERVAL (30*HZ) /* 500 on PC = 5 s (in jiffies) */ +#define TR_RETRY_INTERVAL (30000) /* 500 on PC = 5 s */ +#define TR_RST_TIME (HZ/20) /* 5 on PC = 50 ms (in jiffies) */ +#define TR_RST_TIME_MS (50) /* 5 on PC = 50 ms */ #define TR_BUSY_INTERVAL (HZ/5) /* 5 on PC = 200 ms */ #define TR_SPIN_INTERVAL (3*HZ) /* 3 seconds before init timeout */ From nacc@us.ibm.com Mon Nov 1 10:27:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 10:27:37 -0800 (PST) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.132]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1IRXX8001796 for ; Mon, 1 Nov 2004 10:27:33 -0800 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e34.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id iA1IRBJ8466992 for ; Mon, 1 Nov 2004 13:27:11 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA1IRBBb121298 for ; Mon, 1 Nov 2004 11:27:11 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1IRA7I012089 for ; Mon, 1 Nov 2004 11:27:11 -0700 Received: from localhost.localdomain (DYN318967BLD.beaverton.ibm.com [9.47.21.82]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1IRAHj012053; Mon, 1 Nov 2004 11:27:10 -0700 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.11/8.12.11/Debian-5) with ESMTP id iA1JRdlU002121; Mon, 1 Nov 2004 11:27:39 -0800 Received: (from nacc@localhost) by localhost.localdomain (8.12.11/8.12.11/Debian-5) id iA1JRc61002118; Mon, 1 Nov 2004 11:27:38 -0800 X-Authentication-Warning: localhost.localdomain: nacc set sender to nacc@us.ibm.com using -f Date: Mon, 1 Nov 2004 11:27:38 -0800 From: Nishanth Aravamudan To: Jeff Garzik Cc: kernel-janitors@lists.osdl.org, netdev@oss.sgi.com Subject: [PATCH] net/ibmtr: replace schedule_timeout() with msleep()/msleep_interruptible() Message-ID: <20041101192738.GE1730@us.ibm.com> References: <4184C66B.8040501@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4184C66B.8040501@pobox.com> X-Operating-System: Linux 2.6.9 (i686) User-Agent: Mutt/1.5.6+20040722i X-archive-position: 11291 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 3086 Lines: 88 On Sun, Oct 31, 2004 at 06:03:07AM -0500, Jeff Garzik wrote: > janitor@sternwelten.at wrote: > >Any comments would be appreciated. > > > >Description: Use msleep() / msleep_interruptible() [as appropriate] > >instead of schedule_timeout() to guarantee the task delays as expected. > > > >Signed-off-by: Nishanth Aravamudan > >Signed-off-by: Maximilian Attems > > > >--- > > > > linux-2.6.10-rc1-max/drivers/net/tokenring/ibmtr.c | 11 +++++------ > > 1 files changed, 5 insertions(+), 6 deletions(-) > > > >- schedule_timeout(TR_RST_TIME); /* wait 50ms */ > >+ msleep(jiffies_to_msecs(TR_RST_TIME)); /* wait 50ms */ > >- current->state=TASK_UNINTERRUPTIBLE; > >- schedule_timeout(TR_RST_TIME); /* wait 50ms */ > >+ msleep(jiffies_to_msecs(TR_RST_TIME)); /* wait 50ms */ > >- current->state=TASK_INTERRUPTIBLE; > >- i=schedule_timeout(TR_RETRY_INTERVAL); /* wait 30 seconds */ > >- if(i!=0) break; /*prob. a signal, like the i>24*HZ case > >above */ > >+ if(msleep_interruptible(jiffies_to_msecs(TR_RETRY_INTERVAL))) > >+ break; /*prob. a signal, like the i>24*HZ case above > It makes more sense to convert the constants to msecs in the source > code, instead of converting them at runtime. Here is the patch to ibmtr.c which completes these changes... Description: Uses msleep()/msleep_interruptible() [as appropriate] to guarantee the task delays as expected. This patch depends on the corresponding addition of the millisecond-unit constants to ibmtr.h. Signed-off-by: Nishanth Aravamudan --- 2.6.10-rc1-vanilla/drivers/net/tokenring/ibmtr.c 2004-10-30 15:33:28.000000000 -0700 +++ 2.6.10-rc1/drivers/net/tokenring/ibmtr.c 2004-11-01 11:18:10.000000000 -0800 @@ -130,6 +130,7 @@ in the event that chatty debug messages #include #include #include +#include #include @@ -317,7 +318,7 @@ static void ibmtr_cleanup_card(struct ne if (dev->base_addr) { outb(0,dev->base_addr+ADAPTRESET); - schedule_timeout(TR_RST_TIME); /* wait 50ms */ + msleep(TR_RST_TIME_MS); outb(0,dev->base_addr+ADAPTRESETREL); } @@ -858,8 +859,7 @@ static int tok_init_card(struct net_devi writeb(~INT_ENABLE, ti->mmio + ACA_OFFSET + ACA_RESET + ISRP_EVEN); outb(0, PIOaddr + ADAPTRESET); - current->state=TASK_UNINTERRUPTIBLE; - schedule_timeout(TR_RST_TIME); /* wait 50ms */ + msleep(TR_RST_TIME_MS); outb(0, PIOaddr + ADAPTRESETREL); #ifdef ENABLE_PAGING @@ -912,9 +912,8 @@ static int tok_open(struct net_device *d DPRINTK("Adapter is up and running\n"); return 0; } - current->state=TASK_INTERRUPTIBLE; - i=schedule_timeout(TR_RETRY_INTERVAL); /* wait 30 seconds */ - if(i!=0) break; /*prob. a signal, like the i>24*HZ case above */ + if(msleep_interruptible(TR_RETRY_INTERVAL_MS)) break; + /*prob. a signal, like the i>24*HZ case above */ } outb(0, dev->base_addr + ADAPTRESET);/* kill pending interrupts*/ DPRINTK("TERMINATED via signal\n"); /*BMS useful */ From kaber@trash.net Mon Nov 1 10:41:21 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 10:41:27 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1IfKcn002523 for ; Mon, 1 Nov 2004 10:41:21 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1COh6p-0008Tv-VX; Mon, 01 Nov 2004 19:40:52 +0100 Message-ID: <41868333.7050602@trash.net> Date: Mon, 01 Nov 2004 19:40:51 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: Christoph Hellwig CC: davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] remove dead skb_iter* functions References: <20041101115653.GA7714@lst.de> In-Reply-To: <20041101115653.GA7714@lst.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11292 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 4710 Lines: 173 Harald is working on code for pattern-matching inside non-linear skbs for conntrack helpers. This code needs the skb_iter* functions. Regards Patrick Christoph Hellwig wrote: >Signed-off-by: Christoph Hellwig > > > >--- 1.56/include/linux/skbuff.h 2004-10-05 23:51:01 +02:00 >+++ edited/include/linux/skbuff.h 2004-10-30 21:04:33 +02:00 >@@ -592,7 +592,6 @@ > /* > * Insert a packet on a list. > */ >-extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk); > static inline void __skb_insert(struct sk_buff *newsk, > struct sk_buff *prev, struct sk_buff *next, > struct sk_buff_head *list) >@@ -1120,22 +1119,6 @@ > > extern void skb_init(void); > extern void skb_add_mtu(int mtu); >- >-struct skb_iter { >- /* Iteration functions set these */ >- unsigned char *data; >- unsigned int len; >- >- /* Private to iteration */ >- unsigned int nextfrag; >- struct sk_buff *fraglist; >-}; >- >-/* Keep iterating until skb_iter_next returns false. */ >-extern void skb_iter_first(const struct sk_buff *skb, struct skb_iter *i); >-extern int skb_iter_next(const struct sk_buff *skb, struct skb_iter *i); >-/* Call this if aborting loop before !skb_iter_next */ >-extern void skb_iter_abort(const struct sk_buff *skb, struct skb_iter *i); > > #ifdef CONFIG_NETFILTER > static inline void nf_conntrack_put(struct nf_conntrack *nfct) >--- 1.39/net/core/skbuff.c 2004-10-20 06:56:24 +02:00 >+++ edited/net/core/skbuff.c 2004-10-30 21:04:33 +02:00 >@@ -929,72 +929,7 @@ > return -EFAULT; > } > >-/* Keep iterating until skb_iter_next returns false. */ >-void skb_iter_first(const struct sk_buff *skb, struct skb_iter *i) >-{ >- i->len = skb_headlen(skb); >- i->data = (unsigned char *)skb->data; >- i->nextfrag = 0; >- i->fraglist = NULL; >-} >- >-int skb_iter_next(const struct sk_buff *skb, struct skb_iter *i) >-{ >- /* Unmap previous, if not head fragment. */ >- if (i->nextfrag) >- kunmap_skb_frag(i->data); >- >- if (i->fraglist) { >- fraglist: >- /* We're iterating through fraglist. */ >- if (i->nextfrag < skb_shinfo(i->fraglist)->nr_frags) { >- i->data = kmap_skb_frag(&skb_shinfo(i->fraglist) >- ->frags[i->nextfrag]); >- i->len = skb_shinfo(i->fraglist)->frags[i->nextfrag] >- .size; >- i->nextfrag++; >- return 1; >- } >- /* Fragments with fragments? Too hard! */ >- BUG_ON(skb_shinfo(i->fraglist)->frag_list); >- i->fraglist = i->fraglist->next; >- if (!i->fraglist) >- goto end; >- >- i->len = skb_headlen(i->fraglist); >- i->data = i->fraglist->data; >- i->nextfrag = 0; >- return 1; >- } >- >- if (i->nextfrag < skb_shinfo(skb)->nr_frags) { >- i->data = kmap_skb_frag(&skb_shinfo(skb)->frags[i->nextfrag]); >- i->len = skb_shinfo(skb)->frags[i->nextfrag].size; >- i->nextfrag++; >- return 1; >- } >- >- i->fraglist = skb_shinfo(skb)->frag_list; >- if (i->fraglist) >- goto fraglist; >- >-end: >- /* Bug trap for callers */ >- i->data = NULL; >- return 0; >-} >- >-void skb_iter_abort(const struct sk_buff *skb, struct skb_iter *i) >-{ >- /* Unmap previous, if not head fragment. */ >- if (i->data && i->nextfrag) >- kunmap_skb_frag(i->data); >- /* Bug trap for callers */ >- i->data = NULL; >-} >- > /* Checksum skb data. */ >- > unsigned int skb_checksum(const struct sk_buff *skb, int offset, > int len, unsigned int csum) > { >@@ -1318,25 +1253,6 @@ > } > > >-/** >- * skb_insert - insert a buffer >- * @old: buffer to insert before >- * @newsk: buffer to insert >- * >- * Place a packet before a given packet in a list. The list locks are taken >- * and this function is atomic with respect to other list locked calls >- * A buffer cannot be placed on two lists at the same time. >- */ >- >-void skb_insert(struct sk_buff *old, struct sk_buff *newsk) >-{ >- unsigned long flags; >- >- spin_lock_irqsave(&old->list->lock, flags); >- __skb_insert(newsk, old->prev, old, old->list); >- spin_unlock_irqrestore(&old->list->lock, flags); >-} >- > #if 0 > /* > * Tune the memory allocator for a new MTU size. >@@ -1444,7 +1360,6 @@ > EXPORT_SYMBOL(pskb_expand_head); > EXPORT_SYMBOL(skb_checksum); > EXPORT_SYMBOL(skb_clone); >-EXPORT_SYMBOL(skb_clone_fraglist); > EXPORT_SYMBOL(skb_copy); > EXPORT_SYMBOL(skb_copy_and_csum_bits); > EXPORT_SYMBOL(skb_copy_and_csum_dev); >@@ -1456,13 +1371,8 @@ > EXPORT_SYMBOL(skb_under_panic); > EXPORT_SYMBOL(skb_dequeue); > EXPORT_SYMBOL(skb_dequeue_tail); >-EXPORT_SYMBOL(skb_insert); > EXPORT_SYMBOL(skb_queue_purge); > EXPORT_SYMBOL(skb_queue_head); > EXPORT_SYMBOL(skb_queue_tail); > EXPORT_SYMBOL(skb_unlink); > EXPORT_SYMBOL(skb_append); >-EXPORT_SYMBOL(skb_split); >-EXPORT_SYMBOL(skb_iter_first); >-EXPORT_SYMBOL(skb_iter_next); >-EXPORT_SYMBOL(skb_iter_abort); > > > From greearb@candelatech.com Mon Nov 1 10:59:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 10:59:28 -0800 (PST) Received: from www.lanforge.com (ns1.lanforge.com [66.165.47.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1IxL4l003308 for ; Mon, 1 Nov 2004 10:59:22 -0800 Received: from [4.35.49.74] (evrtwa1-ar2-4-35-049-074.evrtwa1.dsl-verizon.net [4.35.49.74]) (authenticated bits=0) by www.lanforge.com (8.12.8/8.12.8) with ESMTP id iA1J6vLH013685; Mon, 1 Nov 2004 11:06:57 -0800 Message-ID: <4186876E.5040204@candelatech.com> Date: Mon, 01 Nov 2004 10:58:54 -0800 From: Ben Greear Organization: Candela Technologies User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tommy Christensen CC: "'netdev@oss.sgi.com'" , "Linux 802.1Q VLAN" , Francois Romieu , "David S. Miller" Subject: Re: [PATCH] 802.1Q VLAN References: <41797696.9070905@candelatech.com> <20041022214611.GA4948@electric-eye.fr.zoreil.com> <41798506.1030909@candelatech.com> <417D675F.3000909@candelatech.com> <4181838B.6040002@tpack.net> <41818D99.9020300@candelatech.com> <1099038566.1813.99.camel@cyan.cph.tpack.net> <418281C1.9080707@candelatech.com> <4182D44E.7070507@tpack.net> <4182DABE.7000502@candelatech.com> <4182E0C6.6090205@tpack.net> In-Reply-To: <4182E0C6.6090205@tpack.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11293 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: 2733 Lines: 90 How does this look? I think it should fix the problem with having a new skb created in the __vlan_put_tag() method. int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) { struct net_device_stats *stats = vlan_dev_get_stats(dev); struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data); /* Please note, dev_queue_xmit consumes the pkt regardless of the * return value. So, will copy the skb first and free if successful. */ struct sk_buff* skb2 = skb_get(skb); /* Handle non-VLAN frames if they are sent to us, for example by DHCP. * * NOTE: THIS ASSUMES DIX ETHERNET, SPECIFICALLY NOT SUPPORTING * OTHER THINGS LIKE FDDI/TokenRing/802.3 SNAPs... */ if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) { int orig_headroom = skb_headroom(skb); unsigned short veth_TCI; /* This is not a VLAN frame...but we can fix that! */ VLAN_DEV_INFO(dev)->cnt_encap_on_xmit++; #ifdef VLAN_DEBUG printk(VLAN_DBG "%s: proto to encap: 0x%hx (hbo)\n", __FUNCTION__, htons(veth->h_vlan_proto)); #endif /* Construct the second two bytes. This field looks something * like: * usr_priority: 3 bits (high bits) * CFI 1 bit * VLAN ID 12 bits (low bits) */ veth_TCI = VLAN_DEV_INFO(dev)->vlan_id; veth_TCI |= vlan_dev_get_egress_qos_mask(dev, skb); skb = __vlan_put_tag(skb, veth_TCI); if (!skb) { stats->tx_dropped++; /* Free the extra copy, assuming this is a non-recoverable * issue and we don't want calling code to retry. */ kfree_skb(skb2); return 0; } if (orig_headroom < VLAN_HLEN) { VLAN_DEV_INFO(dev)->cnt_inc_headroom_on_tx++; } } #ifdef VLAN_DEBUG printk(VLAN_DBG "%s: about to send skb: %p to dev: %s\n", __FUNCTION__, skb, skb->dev->name); printk(VLAN_DBG " %2hx.%2hx.%2hx.%2xh.%2hx.%2hx %2hx.%2hx.%2hx.%2hx.%2hx.%2hx %4hx %4hx %4hx\n", veth->h_dest[0], veth->h_dest[1], veth->h_dest[2], veth->h_dest[3], veth->h_dest[4], veth->h_dest[5], veth->h_source[0], veth->h_source[1], veth->h_source[2], veth->h_source[3], veth->h_source[4], veth->h_source[5], veth->h_vlan_proto, veth->h_vlan_TCI, veth->h_vlan_encapsulated_proto); #endif skb->dev = VLAN_DEV_INFO(dev)->real_dev; { int rv = dev_queue_xmit(skb); if (rv == 0) { /* Was success, need to free the skb reference since * we bumped up the user count above. If there was an * error instead, then the skb2 will not be freed, and so * the calling code will be able to re-send it. */ stats->tx_packets++; /* for statics only */ stats->tx_bytes += skb2->len; kfree_skb(skb2); } return rv; } } -- Ben Greear Candela Technologies Inc http://www.candelatech.com From nacc@us.ibm.com Mon Nov 1 11:07:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 11:07:52 -0800 (PST) Received: from e5.ny.us.ibm.com (e5.ny.us.ibm.com [32.97.182.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1J7jGY003882 for ; Mon, 1 Nov 2004 11:07:48 -0800 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e5.ny.us.ibm.com (8.12.10/8.12.9) with ESMTP id iA1J7NpA210034; Mon, 1 Nov 2004 14:07:23 -0500 Received: from localhost.localdomain (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA1J7MDC266204; Mon, 1 Nov 2004 14:07:22 -0500 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.11/8.12.11/Debian-5) with ESMTP id iA1K7oMv003246; Mon, 1 Nov 2004 12:07:50 -0800 Received: (from nacc@localhost) by localhost.localdomain (8.12.11/8.12.11/Debian-5) id iA1K7nCd003243; Mon, 1 Nov 2004 12:07:49 -0800 X-Authentication-Warning: localhost.localdomain: nacc set sender to nacc@us.ibm.com using -f Date: Mon, 1 Nov 2004 12:07:49 -0800 From: Nishanth Aravamudan To: janitor@sternwelten.at Cc: netdev@oss.sgi.com, jgarzik@pobox.com, linux-kernel@vger.kernel.org, kernel-janitors@lists.osdl.org Subject: [PATCH] Add ssleep_interruptible() Message-ID: <20041101200749.GF1730@us.ibm.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6+20040722i X-archive-position: 11294 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 886 Lines: 21 Description: Adds ssleep_interruptible() to allow longer delays to occur in TASK_INTERRUPTIBLE, similarly to ssleep(). To be consistent with msleep_interruptible(), ssleep_interruptible() returns the remaining time left in the delay in terms of seconds. This required dividing the return value of msleep_interruptible() by 1000, thus a cast to (unsigned long) to prevent any floating point issues. Signed-off-by: Nishanth Aravamudan --- 2.6.10-rc1-vanilla/include/linux/delay.h 2004-10-30 15:34:03.000000000 -0700 +++ 2.6.10-rc1/include/linux/delay.h 2004-11-01 12:06:11.000000000 -0800 @@ -46,4 +46,9 @@ static inline void ssleep(unsigned int s msleep(seconds * 1000); } +static inline unsigned long ssleep_interruptible(unsigned int seconds) +{ + return (unsigned long)(msleep_interruptible(seconds * 1000) / 1000); +} + #endif /* defined(_LINUX_DELAY_H) */ From latten@austin.ibm.com Mon Nov 1 11:12:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 11:12:57 -0800 (PST) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1JCpYa004307 for ; Mon, 1 Nov 2004 11:12:51 -0800 Received: from westrelay05.boulder.ibm.com (westrelay05.boulder.ibm.com [9.17.193.33]) by e33.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id iA1JCS1p711836 for ; Mon, 1 Nov 2004 14:12:28 -0500 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by westrelay05.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA1JCSwp089792 for ; Mon, 1 Nov 2004 12:12:28 -0700 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1JCRQZ013468 for ; Mon, 1 Nov 2004 12:12:27 -0700 Received: from austin.ibm.com (netmail2.austin.ibm.com [9.41.248.176]) by d03av03.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1JCR0E013460 for ; Mon, 1 Nov 2004 12:12:27 -0700 Received: from faith.austin.ibm.com (faith.austin.ibm.com [9.41.94.16]) by austin.ibm.com (8.12.10/8.12.10) with ESMTP id iA1JCOqI038910 for ; Mon, 1 Nov 2004 13:12:25 -0600 Received: from faith.austin.ibm.com (localhost.localdomain [127.0.0.1]) by faith.austin.ibm.com (8.12.10/8.12.8) with ESMTP id iA34Xn2A017837 for ; Tue, 2 Nov 2004 22:33:50 -0600 Received: (from jml@localhost) by faith.austin.ibm.com (8.12.10/8.12.10/Submit) id iA34Xnou017836 for netdev@oss.sgi.com; Tue, 2 Nov 2004 22:33:49 -0600 Date: Tue, 2 Nov 2004 22:33:49 -0600 From: Joy Latten Message-Id: <200411030433.iA34Xnou017836@faith.austin.ibm.com> To: netdev@oss.sgi.com Subject: IPSecv6 tunnel mode beahviour X-archive-position: 11295 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: latten@austin.ibm.com Precedence: bulk X-list: netdev Content-Length: 1717 Lines: 55 I am using 2.6.9 + 2.6.10-rc1 + 2.6.10-rc1-bk5 kernel. I also recall seeing this before 2.6.9... I am running IPSecv6 in tunnelmode and am noticing what I think is odd behaviour. First, I have a simple config where packets go from one subnet to another through my ipsec tunnel. I noticed TCPv6 packets are being fragmented at the tunnel. I did not see this using similar configuration with ipv4. Although the packets are received ok, sniffer output looks odd to me, it appears Fragment header was not removed at tunnel endpoint because I still see it after packet was forwarded on subnet to receiving machine. Sniffer on receiving machine's interface shows... Frame 15... Ethernet II... Internet Protocol Version 6 Fragmentation Header Next Header TCP Offset: 0 More fragments: No Identification: 0x00000000 Transmission Protocol.. I see odd behaviour in ICMPv6 too if I send packet larger than mtu of sender. Packet is fragmented twice, once at sender and then again at tunnel entry point. My ping works fine, but, what is odd, is that again Fragment Header is not removed, such that after packet is forwarded onto receiving subnet and reaches receiving machine, there are 2 fragment headers. sniffer output on receiver... Frame 1... Ethernet II... Internet Protocol Version 6 Fragment Header Next header: IPv6 fragment(0x2c) Offset: 0 More fragments: No Identification: 0x00000000 Fragment Header Next header: ICMPv6 (0x3a) Offset: 0 More fragments: Yes Identification: 0x1300000 Internet Control Message Protocol v6 What is the correct behaviour? Who should be removing Fragment Header... tunnel endpoint... or should it even be there in TCPv6 case? Joy Latten From nacc@us.ibm.com Mon Nov 1 11:20:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 11:20:56 -0800 (PST) Received: from e2.ny.us.ibm.com (e2.ny.us.ibm.com [32.97.182.102]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1JKooq004820 for ; Mon, 1 Nov 2004 11:20:51 -0800 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e2.ny.us.ibm.com (8.12.10/8.12.9) with ESMTP id iA1JKKBF116010; Mon, 1 Nov 2004 14:20:20 -0500 Received: from localhost.localdomain (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA1JKJDC258730; Mon, 1 Nov 2004 14:20:20 -0500 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.11/8.12.11/Debian-5) with ESMTP id iA1KKmLH003307; Mon, 1 Nov 2004 12:20:48 -0800 Received: (from nacc@localhost) by localhost.localdomain (8.12.11/8.12.11/Debian-5) id iA1KKlEG003304; Mon, 1 Nov 2004 12:20:47 -0800 X-Authentication-Warning: localhost.localdomain: nacc set sender to nacc@us.ibm.com using -f Date: Mon, 1 Nov 2004 12:20:47 -0800 From: Nishanth Aravamudan To: Jeff Garzik Cc: kernel-janitors@lists.osdl.org, netdev@oss.sgi.com Subject: [PATCH] net/s2io: replace schedule_timeout() with msleep()/ssleep_interruptible() Message-ID: <20041101202047.GG1730@us.ibm.com> References: <4184C7EE.5070107@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4184C7EE.5070107@pobox.com> X-Operating-System: Linux 2.6.9 (i686) User-Agent: Mutt/1.5.6+20040722i X-archive-position: 11296 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 5472 Lines: 193 On Sun, Oct 31, 2004 at 06:09:34AM -0500, Jeff Garzik wrote: > janitor@sternwelten.at wrote: > >@@ -2846,11 +2838,10 @@ static int s2io_ethtool_idnic(struct net > > sp->id_timer.data = (unsigned long) sp; > > } > > mod_timer(&sp->id_timer, jiffies); > >- set_current_state(TASK_INTERRUPTIBLE); > > if (data) > >- schedule_timeout(data * HZ); > >+ msleep_interruptible(data * 1000); > > > clearly wants ssleep() here Here is this patch. Depends, of course, on the patch sent just now to lkml/kj which adds ssleep_interruptible to linux/delay.h. Description: Uses msleep()/msleep_interruptible()/ssleep_interruptible() [as appropriate] to guarantee the task delays as expected. I decided to leave the MAX_SCHEDULE_TIMEOUT as is, since the overhead of converting to seconds/msecs and then back again within the corresponding sleep() function seemed unnecessary. Signed-off-by: Nishanth Aravamudan --- 2.6.10-rc1-vanilla/drivers/net/s2io.c 2004-10-30 15:33:29.000000000 -0700 +++ 2.6.10-rc1/drivers/net/s2io.c 2004-11-01 12:19:22.000000000 -0800 @@ -555,8 +555,7 @@ static int initNic(struct s2io_nic *nic) val64 = 0; writeq(val64, &bar0->sw_reset); val64 = readq(&bar0->sw_reset); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 2); + msleep(500); /* Enable Receiving broadcasts */ val64 = readq(&bar0->mac_cfg); @@ -803,8 +802,7 @@ static int initNic(struct s2io_nic *nic) dev->name); return -1; } - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 20); + msleep(50); time++; } @@ -838,8 +836,7 @@ static int initNic(struct s2io_nic *nic) return -1; } time++; - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 20); + msleep(50); } /* Initializing proper values as Pause threshold into all @@ -1182,8 +1179,7 @@ static int startNic(struct s2io_nic *nic writeq(val64, &bar0->mc_rldram_mrs); val64 = readq(&bar0->mc_rldram_mrs); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 10); /* Delay by around 100 ms. */ + msleep(100); /* Delay by around 100 ms. */ /* Enabling ECC Protection. */ val64 = readq(&bar0->adapter_control); @@ -1891,8 +1887,7 @@ int waitForCmdComplete(nic_t * sp) ret = SUCCESS; break; } - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 20); + msleep(50); if (cnt++ > 10) break; } @@ -1931,15 +1926,13 @@ void s2io_reset(nic_t * sp) * As of now I'am just giving a 250ms delay and hoping that the * PCI write to sw_reset register is done by this time. */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 4); + msleep(250); /* Restore the PCI state saved during initializarion. */ pci_restore_state(sp->pdev); s2io_init_pci(sp); - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 4); + msleep(250); /* SXE-002: Configure link and activity LED to turn it off */ subid = sp->pdev->subsystem_device; @@ -2157,8 +2150,7 @@ int s2io_close(struct net_device *dev) /* If the device tasklet is running, wait till its done before killing it */ while (atomic_read(&(sp->tasklet_status))) { - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 10); + msleep(100); } tasklet_kill(&sp->task); @@ -2169,8 +2161,7 @@ int s2io_close(struct net_device *dev) break; } - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 20); + msleep(50); cnt++; if (cnt == 10) { DBG_PRINT(ERR_DBG, @@ -2846,11 +2837,12 @@ static int s2io_ethtool_idnic(struct net sp->id_timer.data = (unsigned long) sp; } mod_timer(&sp->id_timer, jiffies); - set_current_state(TASK_INTERRUPTIBLE); - if (data) - schedule_timeout(data * HZ); - else + if (data) { + ssleep_interruptible(data); + } else { + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(MAX_SCHEDULE_TIMEOUT); + } del_timer_sync(&sp->id_timer); return 0; @@ -2943,8 +2935,7 @@ static u32 readEeprom(nic_t * sp, int of data = I2C_CONTROL_GET_DATA(val64); break; } - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 20); + msleep(50); exit_cnt++; } @@ -2983,8 +2974,7 @@ static int writeEeprom(nic_t * sp, int o ret = 0; break; } - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 20); + msleep(50); exit_cnt++; } @@ -3256,8 +3246,7 @@ static int s2io_bistTest(nic_t * sp, uin ret = 0; break; } - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 10); + msleep(100); cnt++; } @@ -3356,8 +3345,7 @@ static int s2io_rldramTest(nic_t * sp, u val64 = readq(&bar0->mc_rldram_test_ctrl); if (val64 & MC_RLDRAM_TEST_DONE) break; - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 5); + msleep(200); } if (cnt == 5) @@ -3373,8 +3361,7 @@ static int s2io_rldramTest(nic_t * sp, u val64 = readq(&bar0->mc_rldram_test_ctrl); if (val64 & MC_RLDRAM_TEST_DONE) break; - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 2); + msleep(500); } if (cnt == 5) @@ -3711,8 +3698,7 @@ static void s2io_set_link(unsigned long /* Allow a small delay for the NICs self initiated * cleanup to complete. */ - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ / 10); + msleep(100); val64 = readq(&bar0->adapter_status); if (verify_xena_quiescence(val64, nic->device_enabled_once)) { From nacc@us.ibm.com Mon Nov 1 11:24:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 11:24:47 -0800 (PST) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.129]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1JOfbo005227 for ; Mon, 1 Nov 2004 11:24:41 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id iA1JOJLv211376 for ; Mon, 1 Nov 2004 14:24:19 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA1JOIPM170784 for ; Mon, 1 Nov 2004 12:24:19 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1JOHo8014557 for ; Mon, 1 Nov 2004 12:24:18 -0700 Received: from localhost.localdomain (DYN318967BLD.beaverton.ibm.com [9.47.21.82]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1JOHHm014485; Mon, 1 Nov 2004 12:24:17 -0700 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.11/8.12.11/Debian-5) with ESMTP id iA1KOjdF003347; Mon, 1 Nov 2004 12:24:46 -0800 Received: (from nacc@localhost) by localhost.localdomain (8.12.11/8.12.11/Debian-5) id iA1KOjkt003344; Mon, 1 Nov 2004 12:24:45 -0800 X-Authentication-Warning: localhost.localdomain: nacc set sender to nacc@us.ibm.com using -f Date: Mon, 1 Nov 2004 12:24:45 -0800 From: Nishanth Aravamudan To: Jeff Garzik Cc: kernel-janitors@lists.osdl.org, netdev@oss.sgi.com Subject: [PATCH] net/sb1000: replace nicedelay() with ssleep_interruptible() Message-ID: <20041101202445.GH1730@us.ibm.com> References: <4184C6EB.1000700@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4184C6EB.1000700@pobox.com> X-Operating-System: Linux 2.6.9 (i686) User-Agent: Mutt/1.5.6+20040722i X-archive-position: 11297 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 3040 Lines: 79 On Sun, Oct 31, 2004 at 06:05:15AM -0500, Jeff Garzik wrote: > janitor@sternwelten.at wrote: > >Any comments would be appreciated. > > > >Description: Use msleep_interruptible() instead of nicedelay() > >to guarantee the task delays as expected. Remove the prototype and > >definition of nicedelay(). This is a very weird function, because it is > >called to sleep in terms of usecs, but always sleeps for 1 second, > >completely ignoring the parameter. I have gone ahead and followed suit, > >just sleeping for a second in all cases, but maybe someone with the > >hardware could tell me if perhaps the paramter *should* matter. > >Also remove a random "^L" character. > > use ssleep() here too Done, please fine patch below: Description: Use ssleep_interruptible() instead of nicedelay() to guarantee the task delays as expected. Remove the prototype and definition of nicedelay(). This is a very weird function, because it is called to sleep in terms of usecs, but always sleeps for 1 second, completely ignoring the parameter. I have gone ahead and followed suit, just sleeping for a second in all cases, but maybe someone with the hardware could tell me if perhaps the paramter *should* matter. escription. Signed-off-by: Nishanth Aravamudan --- 2.6.10-rc1-vanilla/drivers/net/sb1000.c 2004-10-30 15:33:28.000000000 -0700 +++ 2.6.10-rc1/drivers/net/sb1000.c 2004-11-01 12:22:26.000000000 -0800 @@ -90,7 +90,6 @@ static int sb1000_close(struct net_devic /* SB1000 hardware routines to be used during open/configuration phases */ -static inline void nicedelay(unsigned long usecs); static inline int card_wait_for_busy_clear(const int ioaddr[], const char* name); static inline int card_wait_for_ready(const int ioaddr[], const char* name, @@ -254,13 +253,6 @@ static struct pnp_driver sb1000_driver = const int TimeOutJiffies = (875 * HZ) / 100; -static inline void nicedelay(unsigned long usecs) -{ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ); - return; -} - /* Card Wait For Busy Clear (cannot be used during an interrupt) */ static inline int card_wait_for_busy_clear(const int ioaddr[], const char* name) @@ -475,7 +467,7 @@ sb1000_reset(const int ioaddr[], const c udelay(1000); outb(0x0, port); inb(port); - nicedelay(60000); + ssleep_interruptible(1); outb(0x4, port); inb(port); udelay(1000); @@ -537,7 +529,7 @@ sb1000_activate(const int ioaddr[], cons const unsigned char Command0[6] = {0x80, 0x11, 0x00, 0x00, 0x00, 0x00}; const unsigned char Command1[6] = {0x80, 0x16, 0x00, 0x00, 0x00, 0x00}; - nicedelay(50000); + ssleep_interruptible(1); if ((status = card_send_command(ioaddr, name, Command0, st))) return status; if ((status = card_send_command(ioaddr, name, Command1, st))) @@ -944,7 +936,7 @@ sb1000_open(struct net_device *dev) /* initialize sb1000 */ if ((status = sb1000_reset(ioaddr, name))) return status; - nicedelay(200000); + ssleep_interruptible(1); if ((status = sb1000_check_CRC(ioaddr, name))) return status; From nacc@us.ibm.com Mon Nov 1 11:49:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 11:49:25 -0800 (PST) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1JnJan006303 for ; Mon, 1 Nov 2004 11:49:19 -0800 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.9) with ESMTP id iA1Jmv1p487020 for ; Mon, 1 Nov 2004 14:48:57 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA1JmvPM183000 for ; Mon, 1 Nov 2004 12:48:57 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1JmZJV007678 for ; Mon, 1 Nov 2004 12:48:36 -0700 Received: from localhost.localdomain (DYN318967BLD.beaverton.ibm.com [9.47.21.82]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1JmZ42007608; Mon, 1 Nov 2004 12:48:35 -0700 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.11/8.12.11/Debian-5) with ESMTP id iA1JmYkg003965; Mon, 1 Nov 2004 11:48:34 -0800 Received: (from nacc@localhost) by localhost.localdomain (8.12.11/8.12.11/Debian-5) id iA1JmXHA003962; Mon, 1 Nov 2004 11:48:33 -0800 X-Authentication-Warning: localhost.localdomain: nacc set sender to nacc@us.ibm.com using -f Date: Mon, 1 Nov 2004 11:48:33 -0800 From: Nishanth Aravamudan To: Jeff Garzik Cc: kernel-janitors@lists.osdl.org, netdev@oss.sgi.com, acme@conectiva.com.br Subject: [PATCH] net/cycx_drv: replace delay_cycx() with ssleep_interruptible() Message-ID: <20041101194833.GA3391@us.ibm.com> References: <4184C6A7.7060400@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4184C6A7.7060400@pobox.com> X-Operating-System: Linux 2.6.9 (i686) User-Agent: Mutt/1.5.6+20040722i X-archive-position: 11298 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 2638 Lines: 97 On Sun, Oct 31, 2004 at 06:04:07AM -0500, Jeff Garzik wrote: > janitor@sternwelten.at wrote: > >-/* Delay */ > >-static void delay_cycx(int sec) > >-{ > >- set_current_state(TASK_INTERRUPTIBLE); > >- schedule_timeout(sec * HZ); > >-} > > > this _clearly_ wants an ssleep() derivative, not msleep() Fixed, see patch below. Description: Use ssleep_interruptible() instead of delay_cycx() to guarantee the task delays as expected. Remove the prototype and definition of delay_cycx(). Signed-off-by: Nishanth Aravamudan --- 2.6.10-rc1-vanilla/drivers/net/wan/cycx_drv.c 2004-10-30 15:33:28.000000000 -0700 +++ 2.6.10-rc1/drivers/net/wan/cycx_drv.c 2004-11-01 11:46:08.000000000 -0800 @@ -74,7 +74,6 @@ static int reset_cyc2x(void __iomem *add static int detect_cyc2x(void __iomem *addr); /* Miscellaneous functions */ -static void delay_cycx(int sec); static int get_option_index(long *optlist, long optval); static u16 checksum(u8 *buf, u32 len); @@ -259,7 +258,7 @@ static int memory_exists(void __iomem *a if (readw(addr + 0x10) == TEST_PATTERN) return 1; - delay_cycx(1); + ssleep_interruptible(1); } return 0; @@ -316,7 +315,7 @@ static void cycx_reset_boot(void __iomem /* 80186 was in hold, go */ writeb(0, addr + START_CPU); - delay_cycx(1); + ssleep_interruptible(1); } /* Load data.bin file through boot (reset) interface. */ @@ -462,13 +461,13 @@ static int load_cyc2x(struct cycx_hw *hw cycx_reset_boot(hw->dpmbase, reset_image, img_hdr->reset_size); /* reset is waiting for boot */ writew(GEN_POWER_ON, pt_cycld); - delay_cycx(1); + ssleep_interruptible(1); for (j = 0 ; j < 3 ; j++) if (!readw(pt_cycld)) goto reset_loaded; else - delay_cycx(1); + ssleep_interruptible(1); } printk(KERN_ERR "%s: reset not started.\n", modname); @@ -495,7 +494,7 @@ reset_loaded: /* Arthur Ganzert's tip: wait a while after the firmware loading... seg abr 26 17:17:12 EST 1999 - acme */ - delay_cycx(7); + ssleep_interruptible(7); printk(KERN_INFO "%s: firmware loaded!\n", modname); /* enable interrupts */ @@ -547,20 +546,13 @@ static int get_option_index(long *optlis static int reset_cyc2x(void __iomem *addr) { writeb(0, addr + RST_ENABLE); - delay_cycx(2); + ssleep_interruptible(2); writeb(0, addr + RST_DISABLE); - delay_cycx(2); + ssleep_interruptible(2); return memory_exists(addr); } -/* Delay */ -static void delay_cycx(int sec) -{ - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(sec * HZ); -} - /* Calculate 16-bit CRC using CCITT polynomial. */ static u16 checksum(u8 *buf, u32 len) { From jmorris@redhat.com Mon Nov 1 12:03:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 12:03:26 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1K3LFS007020 for ; Mon, 1 Nov 2004 12:03:22 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id iA1K32Rb020509; Mon, 1 Nov 2004 15:03:02 -0500 Received: from mail.boston.redhat.com (mail.boston.redhat.com [172.16.76.12]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id iA1K31r02302; Mon, 1 Nov 2004 15:03:01 -0500 Received: from thoron.boston.redhat.com (thoron.boston.redhat.com [172.16.80.63]) by mail.boston.redhat.com (8.12.8/8.12.8) with ESMTP id iA1K30FF026679; Mon, 1 Nov 2004 15:03:00 -0500 Date: Mon, 1 Nov 2004 15:03:01 -0500 (EST) From: James Morris X-X-Sender: jmorris@thoron.boston.redhat.com To: Patrick McHardy cc: Christoph Hellwig , , Subject: Re: [PATCH] remove dead skb_iter* functions In-Reply-To: <41868333.7050602@trash.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 11299 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jmorris@redhat.com Precedence: bulk X-list: netdev Content-Length: 309 Lines: 15 On Mon, 1 Nov 2004, Patrick McHardy wrote: > Harald is working on code for pattern-matching inside > non-linear skbs for conntrack helpers. This code needs > the skb_iter* functions. Perhaps put it back when the pattern matching code is submitted upstream. - James -- James Morris From herbert@gondor.apana.org.au Mon Nov 1 12:28:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 12:28:38 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1KST74011225 for ; Mon, 1 Nov 2004 12:28:30 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1COimZ-0005lp-00; Tue, 02 Nov 2004 07:28:03 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1COimQ-00061s-00; Tue, 02 Nov 2004 07:27:54 +1100 Date: Tue, 2 Nov 2004 07:27:54 +1100 To: Matt Domsch Cc: netdev@oss.sgi.com, jamal Subject: Re: [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len Message-ID: <20041101202754.GA23149@gondor.apana.org.au> References: <20041030013700.GA21540@lists.us.dell.com> <20041030030936.GA25102@lists.us.dell.com> <1099163419.1039.97.camel@jzny.localdomain> <20041101044433.GA18772@lists.us.dell.com> <20041101173434.GA12437@lists.us.dell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041101173434.GA12437@lists.us.dell.com> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11300 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 692 Lines: 16 On Mon, Nov 01, 2004 at 11:34:34AM -0600, Matt Domsch wrote: > > + else if (!dev->addr_len) > + memset(ifr->ifr_hwaddr.sa_data, 0, sizeof ifr->ifr_hwaddr.sa_data); > + else > + memcpy(ifr->ifr_hwaddr.sa_data, dev->dev_addr, > + min(sizeof ifr->ifr_hwaddr.sa_data, (size_t) dev->addr_len)); Same problem as before. If dev->addr_len is greater than zero but less than sizeof ifr->ifr_hwaddr.sa_data, then you've got garbage in there. Zero is not a special case. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From mdomsch@lists.us.dell.com Mon Nov 1 12:38:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 12:38:57 -0800 (PST) Received: from lists.us.dell.com (lists.us.dell.com [143.166.224.162]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1Kcpji011746 for ; Mon, 1 Nov 2004 12:38:51 -0800 Received: from lists.us.dell.com (localhost.localdomain [127.0.0.1]) by lists.us.dell.com (8.12.10/8.12.10/Dell.IT.3.31.03) with ESMTP id iA1KcLMU017123; Mon, 1 Nov 2004 14:38:21 -0600 Received: (from mdomsch@localhost) by lists.us.dell.com (8.12.10/8.12.10/Submit) id iA1KcLbS017121; Mon, 1 Nov 2004 14:38:21 -0600 Date: Mon, 1 Nov 2004 14:38:21 -0600 From: Matt Domsch To: Herbert Xu Cc: netdev@oss.sgi.com, jamal Subject: Re: [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len Message-ID: <20041101203821.GA15086@lists.us.dell.com> References: <20041030013700.GA21540@lists.us.dell.com> <20041030030936.GA25102@lists.us.dell.com> <1099163419.1039.97.camel@jzny.localdomain> <20041101044433.GA18772@lists.us.dell.com> <20041101173434.GA12437@lists.us.dell.com> <20041101202754.GA23149@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041101202754.GA23149@gondor.apana.org.au> User-Agent: Mutt/1.4.1i X-archive-position: 11301 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Matt_Domsch@dell.com Precedence: bulk X-list: netdev Content-Length: 1236 Lines: 31 On Tue, Nov 02, 2004 at 07:27:54AM +1100, Herbert Xu wrote: > Same problem as before. If dev->addr_len is greater than zero but less > than sizeof ifr->ifr_hwaddr.sa_data, then you've got garbage in there. > Zero is not a special case. OK, I'll unconditionally clear it all first. How's this? Signed-off-by: Matt Domsch -- Matt Domsch Sr. Software Engineer, Lead Engineer Dell Linux Solutions linux.dell.com & www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com ===== net/core/dev.c 1.169 vs edited ===== --- 1.169/net/core/dev.c 2004-10-26 11:09:33 -05:00 +++ edited/net/core/dev.c 2004-11-01 14:35:02 -06:00 @@ -2375,6 +2375,12 @@ return dev_set_mtu(dev, ifr->ifr_mtu); case SIOCGIFHWADDR: + if (net_ratelimit()) + printk(KERN_DEBUG "Warning: %s uses obsolete ioctl(SIOCGIFHWADDR), please convert it to rtnetlink(3,7)\n", current->comm); + + if ((size_t) dev->addr_len > sizeof ifr->ifr_hwaddr.sa_data) + return -EOVERFLOW; + memset(ifr->ifr_hwaddr.sa_data, 0, sizeof ifr->ifr_hwaddr.sa_data); memcpy(ifr->ifr_hwaddr.sa_data, dev->dev_addr, min(sizeof ifr->ifr_hwaddr.sa_data, (size_t) dev->addr_len)); ifr->ifr_hwaddr.sa_family = dev->type; From herbert@gondor.apana.org.au Mon Nov 1 12:42:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 12:42:12 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1Kg3LD012130 for ; Mon, 1 Nov 2004 12:42:05 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1COizk-0005sd-00; Tue, 02 Nov 2004 07:41:40 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1COizb-00063q-00; Tue, 02 Nov 2004 07:41:31 +1100 Date: Tue, 2 Nov 2004 07:41:31 +1100 To: Matt Domsch Cc: netdev@oss.sgi.com, jamal Subject: Re: [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len Message-ID: <20041101204131.GA23277@gondor.apana.org.au> References: <20041030013700.GA21540@lists.us.dell.com> <20041030030936.GA25102@lists.us.dell.com> <1099163419.1039.97.camel@jzny.localdomain> <20041101044433.GA18772@lists.us.dell.com> <20041101173434.GA12437@lists.us.dell.com> <20041101202754.GA23149@gondor.apana.org.au> <20041101203821.GA15086@lists.us.dell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041101203821.GA15086@lists.us.dell.com> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11302 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 785 Lines: 21 On Mon, Nov 01, 2004 at 02:38:21PM -0600, Matt Domsch wrote: > > OK, I'll unconditionally clear it all first. How's this? It's nearly there :) > + if ((size_t) dev->addr_len > sizeof ifr->ifr_hwaddr.sa_data) > + return -EOVERFLOW; > + memset(ifr->ifr_hwaddr.sa_data, 0, sizeof ifr->ifr_hwaddr.sa_data); > memcpy(ifr->ifr_hwaddr.sa_data, dev->dev_addr, > min(sizeof ifr->ifr_hwaddr.sa_data, (size_t) dev->addr_len)); You don't need the min anymore since you've checked that dev->addr_len is not greater than sizeof ifr->ifr_hwaddr.sa_data. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From mdomsch@lists.us.dell.com Mon Nov 1 12:46:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 12:46:28 -0800 (PST) Received: from lists.us.dell.com (linux.us.dell.com [143.166.224.162]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1KkG2g012539 for ; Mon, 1 Nov 2004 12:46:17 -0800 Received: from lists.us.dell.com (localhost.localdomain [127.0.0.1]) by lists.us.dell.com (8.12.10/8.12.10/Dell.IT.3.31.03) with ESMTP id iA1KjYMU017293; Mon, 1 Nov 2004 14:45:34 -0600 Received: (from mdomsch@localhost) by lists.us.dell.com (8.12.10/8.12.10/Submit) id iA1KjXLn017291; Mon, 1 Nov 2004 14:45:33 -0600 Date: Mon, 1 Nov 2004 14:45:33 -0600 From: Matt Domsch To: Herbert Xu Cc: netdev@oss.sgi.com, jamal Subject: Re: [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len Message-ID: <20041101204533.GA17279@lists.us.dell.com> References: <20041030013700.GA21540@lists.us.dell.com> <20041030030936.GA25102@lists.us.dell.com> <1099163419.1039.97.camel@jzny.localdomain> <20041101044433.GA18772@lists.us.dell.com> <20041101173434.GA12437@lists.us.dell.com> <20041101202754.GA23149@gondor.apana.org.au> <20041101203821.GA15086@lists.us.dell.com> <20041101204131.GA23277@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041101204131.GA23277@gondor.apana.org.au> User-Agent: Mutt/1.4.1i X-archive-position: 11303 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Matt_Domsch@dell.com Precedence: bulk X-list: netdev Content-Length: 1223 Lines: 33 On Tue, Nov 02, 2004 at 07:41:31AM +1100, Herbert Xu wrote: > You don't need the min anymore since you've checked that dev->addr_len > is not greater than sizeof ifr->ifr_hwaddr.sa_data. Good catch. Signed-off-by: Matt Domsch -- Matt Domsch Sr. Software Engineer, Lead Engineer Dell Linux Solutions linux.dell.com & www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com ===== net/core/dev.c 1.169 vs edited ===== --- 1.169/net/core/dev.c 2004-10-26 11:09:33 -05:00 +++ edited/net/core/dev.c 2004-11-01 14:42:59 -06:00 @@ -2375,8 +2375,13 @@ return dev_set_mtu(dev, ifr->ifr_mtu); case SIOCGIFHWADDR: - memcpy(ifr->ifr_hwaddr.sa_data, dev->dev_addr, - min(sizeof ifr->ifr_hwaddr.sa_data, (size_t) dev->addr_len)); + if (net_ratelimit()) + printk(KERN_DEBUG "Warning: %s uses obsolete ioctl(SIOCGIFHWADDR), please convert it to rtnetlink(3,7)\n", current->comm); + + if ((size_t) dev->addr_len > sizeof ifr->ifr_hwaddr.sa_data) + return -EOVERFLOW; + memset(ifr->ifr_hwaddr.sa_data, 0, sizeof ifr->ifr_hwaddr.sa_data); + memcpy(ifr->ifr_hwaddr.sa_data, dev->dev_addr, dev->addr_len); ifr->ifr_hwaddr.sa_family = dev->type; return 0; From dlstevens@us.ibm.com Mon Nov 1 13:49:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 13:49:55 -0800 (PST) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1Lni8d014631 for ; Mon, 1 Nov 2004 13:49:50 -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.9) with ESMTP id iA1LnL8m449306 for ; Mon, 1 Nov 2004 16:49:21 -0500 Received: from d03av04.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 iA1LnL5Y141138 for ; Mon, 1 Nov 2004 14:49:21 -0700 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1LnKwk015022 for ; Mon, 1 Nov 2004 14:49:20 -0700 Received: from d03nm121.boulder.ibm.com (d03nm121.boulder.ibm.com [9.17.195.147]) by d03av04.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1LnKwH015015; Mon, 1 Nov 2004 14:49:20 -0700 In-Reply-To: To: Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com MIME-Version: 1.0 Subject: Re: Small Help required!!! X-Mailer: Lotus Notes Release 6.0.2CF1 June 9, 2003 Message-ID: From: David Stevens Date: Mon, 1 Nov 2004 13:49:17 -0800 X-MIMETrack: Serialize by Router on D03NM121/03/M/IBM(Release 6.51HF338 | June 21, 2004) at 11/01/2004 14:49:20, Serialize complete at 11/01/2004 14:49:20 Content-Type: text/plain; charset="US-ASCII" X-archive-position: 11304 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: 773 Lines: 22 netdev-bounce@oss.sgi.com wrote on 10/30/2004 08:32:55 AM: > hi, > I needed some information about how to proceed with implementing a Name > Switch Server plugin that > allows to resolve multicast DNS names using normal libc calls(such as > gethostbyname()). > If someone has knowledge in this regard,please mail me back. I think this will already work as-is. All you should need to do is register the multicast address in the DNS server. Have you tried it? Some well-known multicast addresses (like NTP's) are commonly registered with root servers already. I haven't tried using "gethostbyame()" on a multicast address that is registered, but I'm not aware of any checks on the class of the address in any of the code. +-DLS From hadi@cyberus.ca Mon Nov 1 13:51:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 13:51:28 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1LpMDr014845 for ; Mon, 1 Nov 2004 13:51:22 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1COk4u-00014o-6j for netdev@oss.sgi.com; Mon, 01 Nov 2004 16:51:04 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1COk4l-0003P2-0g; Mon, 01 Nov 2004 16:50:55 -0500 Subject: Re: [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len From: jamal Reply-To: hadi@cyberus.ca To: Matt Domsch Cc: Herbert Xu , netdev@oss.sgi.com In-Reply-To: <20041101204533.GA17279@lists.us.dell.com> References: <20041030013700.GA21540@lists.us.dell.com> <20041030030936.GA25102@lists.us.dell.com> <1099163419.1039.97.camel@jzny.localdomain> <20041101044433.GA18772@lists.us.dell.com> <20041101173434.GA12437@lists.us.dell.com> <20041101202754.GA23149@gondor.apana.org.au> <20041101203821.GA15086@lists.us.dell.com> <20041101204131.GA23277@gondor.apana.org.au> <20041101204533.GA17279@lists.us.dell.com> Content-Type: text/plain Organization: jamalopolous Message-Id: <1099345849.1073.1.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 01 Nov 2004 16:50:49 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 11305 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: 526 Lines: 17 My onluy comment is on use of -EOVERFLOW which i have seen only being used in the context of floating point computation (same as -EUNDERFLOW). I dont know what the right thing to return would be. cheers, jamal On Mon, 2004-11-01 at 15:45, Matt Domsch wrote: > On Tue, Nov 02, 2004 at 07:41:31AM +1100, Herbert Xu wrote: > > You don't need the min anymore since you've checked that dev->addr_len > > is not greater than sizeof ifr->ifr_hwaddr.sa_data. > > Good catch. > > Signed-off-by: Matt Domsch From hch@lst.de Mon Nov 1 13:54:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 13:54:46 -0800 (PST) Received: from mail.lst.de (verein.lst.de [213.95.11.210]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1Lse3r015466 for ; Mon, 1 Nov 2004 13:54:41 -0800 Received: from verein.lst.de (localhost [127.0.0.1]) by mail.lst.de (8.12.3/8.12.3/Debian-6.6) with ESMTP id iA1LsNla017108 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 1 Nov 2004 22:54:23 +0100 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id iA1LsNC9017106; Mon, 1 Nov 2004 22:54:23 +0100 Date: Mon, 1 Nov 2004 22:54:23 +0100 From: Christoph Hellwig To: James Morris Cc: Patrick McHardy , davem@redhat.com, netdev@oss.sgi.com Subject: Re: [PATCH] remove dead skb_iter* functions Message-ID: <20041101215423.GA17080@lst.de> References: <41868333.7050602@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-archive-position: 11306 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: netdev Content-Length: 418 Lines: 12 On Mon, Nov 01, 2004 at 03:03:01PM -0500, James Morris wrote: > On Mon, 1 Nov 2004, Patrick McHardy wrote: > > > Harald is working on code for pattern-matching inside > > non-linear skbs for conntrack helpers. This code needs > > the skb_iter* functions. > > Perhaps put it back when the pattern matching code is submitted upstream. And especially put it into some netfilter module instead of bloating the kernel. From nacc@us.ibm.com Mon Nov 1 14:00:33 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 14:00:38 -0800 (PST) Received: from e4.ny.us.ibm.com (e4.ny.us.ibm.com [32.97.182.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1M0WuW016057 for ; Mon, 1 Nov 2004 14:00:33 -0800 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e4.ny.us.ibm.com (8.12.10/8.12.9) with ESMTP id iA1M0ACE884158; Mon, 1 Nov 2004 17:00:10 -0500 Received: from localhost.localdomain (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA1M09su230828; Mon, 1 Nov 2004 17:00:10 -0500 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.11/8.12.11/Debian-5) with ESMTP id iA1M084v004292; Mon, 1 Nov 2004 14:00:09 -0800 Received: (from nacc@localhost) by localhost.localdomain (8.12.11/8.12.11/Debian-5) id iA1M088j004289; Mon, 1 Nov 2004 14:00:08 -0800 X-Authentication-Warning: localhost.localdomain: nacc set sender to nacc@us.ibm.com using -f Date: Mon, 1 Nov 2004 14:00:07 -0800 From: Nishanth Aravamudan To: Jan Kasprzak Cc: Jeff Garzik , janitor@sternwelten.at, netdev@oss.sgi.com Subject: Re: [patch 06/18] net/cosa: replace schedule_timeout() with msleep_interruptible() Message-ID: <20041101220007.GA4255@us.ibm.com> References: <4184C79F.3090602@pobox.com> <20041101112313.GD12416@fi.muni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041101112313.GD12416@fi.muni.cz> X-Operating-System: Linux 2.6.9 (i686) User-Agent: Mutt/1.5.6+20040722i X-archive-position: 11308 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 480 Lines: 13 On Mon, Nov 01, 2004 at 12:23:14PM +0100, Jan Kasprzak wrote: > Jeff Garzik wrote: > : why add all the memory barriers and such associated with > : set_current_state() ? > : > This is not time-critical - COSA is an ISA-only device, > and the driver is not tested on SMP (I have tried to make it SMP-aware, > but at the time I had no SMP machine with ISA slot). Just to make it clear, then, the current patch is ok? Or would you prefer I had used __set_current_state()? -Nish From mdomsch@lists.us.dell.com Mon Nov 1 14:00:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 14:00:22 -0800 (PST) Received: from lists.us.dell.com (linux.us.dell.com [143.166.224.162]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1M0Hff016041 for ; Mon, 1 Nov 2004 14:00:17 -0800 Received: from lists.us.dell.com (localhost.localdomain [127.0.0.1]) by lists.us.dell.com (8.12.10/8.12.10/Dell.IT.3.31.03) with ESMTP id iA1LxiMU018418; Mon, 1 Nov 2004 15:59:44 -0600 Received: (from mdomsch@localhost) by lists.us.dell.com (8.12.10/8.12.10/Submit) id iA1LxinM018416; Mon, 1 Nov 2004 15:59:44 -0600 Date: Mon, 1 Nov 2004 15:59:44 -0600 From: Matt Domsch To: jamal Cc: Herbert Xu , netdev@oss.sgi.com Subject: Re: [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len Message-ID: <20041101215944.GB17279@lists.us.dell.com> References: <20041030030936.GA25102@lists.us.dell.com> <1099163419.1039.97.camel@jzny.localdomain> <20041101044433.GA18772@lists.us.dell.com> <20041101173434.GA12437@lists.us.dell.com> <20041101202754.GA23149@gondor.apana.org.au> <20041101203821.GA15086@lists.us.dell.com> <20041101204131.GA23277@gondor.apana.org.au> <20041101204533.GA17279@lists.us.dell.com> <1099345849.1073.1.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1099345849.1073.1.camel@jzny.localdomain> User-Agent: Mutt/1.4.1i X-archive-position: 11307 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Matt_Domsch@dell.com Precedence: bulk X-list: netdev Content-Length: 831 Lines: 26 On Mon, Nov 01, 2004 at 04:50:49PM -0500, jamal wrote: > My onluy comment is on use of -EOVERFLOW which i have seen only > being used in the context of floating point computation > (same as -EUNDERFLOW). I dont know what the right thing to return would > be. Actually, -EOVERFLOW appears throughout the kernel. A couple examples: drivers/net/ppp_generic.:ppp_read() uses it to indicate skb->len > sizeof buffer to put the data into. fs/stat.c:cp_new_stat() and friends if (stat->size > MAX_NON_LFS) return -EOVERFLOW; indicates that the file size is larger than can be represented by the app. I believe our use would be consistent. Thanks, Matt -- Matt Domsch Sr. Software Engineer, Lead Engineer Dell Linux Solutions linux.dell.com & www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com From herbert@gondor.apana.org.au Mon Nov 1 14:04:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 14:04:18 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1M48tQ016768 for ; Mon, 1 Nov 2004 14:04:09 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1COkH7-0006Ul-00; Tue, 02 Nov 2004 09:03:41 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1COkH0-0006CE-00; Tue, 02 Nov 2004 09:03:34 +1100 Date: Tue, 2 Nov 2004 09:03:34 +1100 To: jamal Cc: Matt Domsch , netdev@oss.sgi.com Subject: Re: [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len Message-ID: <20041101220334.GA23809@gondor.apana.org.au> References: <20041030030936.GA25102@lists.us.dell.com> <1099163419.1039.97.camel@jzny.localdomain> <20041101044433.GA18772@lists.us.dell.com> <20041101173434.GA12437@lists.us.dell.com> <20041101202754.GA23149@gondor.apana.org.au> <20041101203821.GA15086@lists.us.dell.com> <20041101204131.GA23277@gondor.apana.org.au> <20041101204533.GA17279@lists.us.dell.com> <1099345849.1073.1.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1099345849.1073.1.camel@jzny.localdomain> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11309 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 507 Lines: 12 On Mon, Nov 01, 2004 at 04:50:49PM -0500, jamal wrote: > My onluy comment is on use of -EOVERFLOW which i have seen only > being used in the context of floating point computation > (same as -EUNDERFLOW). I dont know what the right thing to return would > be. How about ERANGE? getcwd(3) uses it. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From herbert@gondor.apana.org.au Mon Nov 1 14:07:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 14:07:20 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1M7DoF017202 for ; Mon, 1 Nov 2004 14:07:14 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1COkK8-0006WE-00; Tue, 02 Nov 2004 09:06:48 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1COkK4-0006Dk-00; Tue, 02 Nov 2004 09:06:44 +1100 Date: Tue, 2 Nov 2004 09:06:44 +1100 To: Matt Domsch Cc: jamal , netdev@oss.sgi.com Subject: Re: [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len Message-ID: <20041101220644.GA23903@gondor.apana.org.au> References: <20041030030936.GA25102@lists.us.dell.com> <1099163419.1039.97.camel@jzny.localdomain> <20041101044433.GA18772@lists.us.dell.com> <20041101173434.GA12437@lists.us.dell.com> <20041101202754.GA23149@gondor.apana.org.au> <20041101203821.GA15086@lists.us.dell.com> <20041101204131.GA23277@gondor.apana.org.au> <20041101204533.GA17279@lists.us.dell.com> <1099345849.1073.1.camel@jzny.localdomain> <20041101215944.GB17279@lists.us.dell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041101215944.GB17279@lists.us.dell.com> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11310 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 398 Lines: 10 On Mon, Nov 01, 2004 at 03:59:44PM -0600, Matt Domsch wrote: > > Actually, -EOVERFLOW appears throughout the kernel. A couple examples: I agree. Please disregard my comment re ERANGE. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From nacc@us.ibm.com Mon Nov 1 14:11:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 14:11:23 -0800 (PST) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.130]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1MB9fx017614 for ; Mon, 1 Nov 2004 14:11:16 -0800 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.9) with ESMTP id iA1MAiAd311986 for ; Mon, 1 Nov 2004 17:10:44 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA1MAibN170534 for ; Mon, 1 Nov 2004 15:10:44 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1MAhga008788 for ; Mon, 1 Nov 2004 15:10:44 -0700 Received: from localhost.localdomain (DYN318967BLD.beaverton.ibm.com [9.47.21.82]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA1MAhZv008748; Mon, 1 Nov 2004 15:10:43 -0700 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.11/8.12.11/Debian-5) with ESMTP id iA1MAgc6004332; Mon, 1 Nov 2004 14:10:42 -0800 Received: (from nacc@localhost) by localhost.localdomain (8.12.11/8.12.11/Debian-5) id iA1MAfjR004329; Mon, 1 Nov 2004 14:10:41 -0800 X-Authentication-Warning: localhost.localdomain: nacc set sender to nacc@us.ibm.com using -f Date: Mon, 1 Nov 2004 14:10:41 -0800 From: Nishanth Aravamudan To: Jeff Garzik Cc: kernel-janitors@lists.osdl.org, netdev@oss.sgi.com Subject: [PATCH] net/pcnet32: replace schedule_timeout() with ssleep_interruptible() Message-ID: <20041101221041.GB4255@us.ibm.com> References: <4184C701.5030103@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4184C701.5030103@pobox.com> X-Operating-System: Linux 2.6.9 (i686) User-Agent: Mutt/1.5.6+20040722i X-archive-position: 11311 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1399 Lines: 38 On Sun, Oct 31, 2004 at 06:05:37AM -0500, Jeff Garzik wrote: > janitor@sternwelten.at wrote: > >diff -puN drivers/net/pcnet32.c~msleep_interruptible-drivers_net_pcnet32 > >drivers/net/pcnet32.c > >--- > >linux-2.6.10-rc1/drivers/net/pcnet32.c~msleep_interruptible-drivers_net_pcnet32 2004-10-24 17:05:14.000000000 +0200 > >+++ linux-2.6.10-rc1-max/drivers/net/pcnet32.c 2004-10-24 > >17:05:14.000000000 +0200 > >@@ -847,7 +847,7 @@ static int pcnet32_phys_id(struct net_de > > if ((!data) || (data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))) > > data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); > > > >- schedule_timeout(data * HZ); > >+ msleep_interruptible(data * 1000); > > > clearly and obviously ssleep() Here is the corrected patch. Description: Use ssleep_interruptible() instead of schedule_timeout() to guarantee the task delays as expected. Signed-off-by: Nishanth Aravamudan --- 2.6.10-rc1-vanilla/drivers/net/pcnet32.c 2004-10-30 15:33:28.000000000 -0700 +++ 2.6.10-rc1/drivers/net/pcnet32.c 2004-11-01 14:08:10.000000000 -0800 @@ -847,7 +847,7 @@ static int pcnet32_phys_id(struct net_de if ((!data) || (data > (u32)(MAX_SCHEDULE_TIMEOUT / HZ))) data = (u32)(MAX_SCHEDULE_TIMEOUT / HZ); - schedule_timeout(data * HZ); + ssleep_interruptible(data); del_timer_sync(&lp->blink_timer); /* Restore the original value of the bcrs */ From nacc@us.ibm.com Mon Nov 1 14:20:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 14:20:47 -0800 (PST) Received: from e1.ny.us.ibm.com (e1.ny.us.ibm.com [32.97.182.101]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1MKe9M018237 for ; Mon, 1 Nov 2004 14:20:41 -0800 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e1.ny.us.ibm.com (8.12.10/NS PXFA) with ESMTP id iA1MK8eG166784; Mon, 1 Nov 2004 17:20:08 -0500 Received: from localhost.localdomain (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA1MK7su288192; Mon, 1 Nov 2004 17:20:08 -0500 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.11/8.12.11/Debian-5) with ESMTP id iA1MK7Ia004393; Mon, 1 Nov 2004 14:20:07 -0800 Received: (from nacc@localhost) by localhost.localdomain (8.12.11/8.12.11/Debian-5) id iA1MK6FI004390; Mon, 1 Nov 2004 14:20:06 -0800 X-Authentication-Warning: localhost.localdomain: nacc set sender to nacc@us.ibm.com using -f Date: Mon, 1 Nov 2004 14:20:06 -0800 From: Nishanth Aravamudan To: Jeff Garzik Cc: kernel-janitors@lists.osdl.org, netdev@oss.sgi.com Subject: [PATCH] net/airo: replace schedule_timeout() with *sleep() variants Message-ID: <20041101222006.GC4255@us.ibm.com> References: <4184C61F.2080906@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4184C61F.2080906@pobox.com> X-Operating-System: Linux 2.6.9 (i686) User-Agent: Mutt/1.5.6+20040722i X-archive-position: 11312 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nacc@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 4983 Lines: 154 On Sun, Oct 31, 2004 at 06:01:51AM -0500, Jeff Garzik wrote: > janitor@sternwelten.at wrote: > >Any comments would be appreciated. > > > >Description: Use msleep()/msleep_interruptible() [as appropriate] > >instead of schedule_timeout() to guarantee the task delays as > >expected. Also uses set_current_state() instead of direct assignment of > >current->state in one place. > > > >Signed-off-by: Nishanth Aravamudan > >Signed-off-by: Maximilian Attems > > > >--- > > > > linux-2.6.10-rc1-max/drivers/net/wireless/airo.c | 27 > > ++++++++--------------- > > 1 files changed, 10 insertions(+), 17 deletions(-) > > > >diff -puN > >drivers/net/wireless/airo.c~msleep+msleep_interruptible-drivers_net_wireless_airo drivers/net/wireless/airo.c > >--- > >linux-2.6.10-rc1/drivers/net/wireless/airo.c~msleep+msleep_interruptible-drivers_net_wireless_airo 2004-10-24 17:05:35.000000000 +0200 > >+++ linux-2.6.10-rc1-max/drivers/net/wireless/airo.c 2004-10-24 > >17:05:35.000000000 +0200 > >@@ -1699,9 +1699,8 @@ static int readBSSListRid(struct airo_in > > issuecommand(ai, &cmd, &rsp); > > up(&ai->sem); > > /* Let the command take effect */ > >- set_current_state (TASK_INTERRUPTIBLE); > > ai->task = current; > >- schedule_timeout (3*HZ); > >+ msleep_interruptible(3*1000); > > ai->task = NULL; > > } > > rc = PC4500_readrid(ai, first ? RID_BSSLISTFIRST : RID_BSSLISTNEXT, > > use ssleep() here > > > >@@ -2950,7 +2947,7 @@ static int airo_thread(void *data) { > > } > > break; > > } > >- current->state = TASK_RUNNING; > >+ set_current_state(TASK_RUNNING); > > remove_wait_queue(&ai->thr_wait, &wait); > > locked = 1; > > } > > why are you adding barriers? Fixed both issues in the following patch: Description: Use msleep()/msleep_interruptible()/ssleep()/ ssleep_interruptible() [as appropriate] instead of schedule_timeout() to guarantee the task delays as expected. Also uses __set_current_state() instead of direct assignment of current->state. Also fixes tabbing in one line. Signed-off-by: Nishanth Aravamudan --- 2.6.10-rc1-vanilla/drivers/net/wireless/airo.c 2004-10-30 15:33:27.000000000 -0700 +++ 2.6.10-rc1/drivers/net/wireless/airo.c 2004-11-01 14:17:52.000000000 -0800 @@ -1699,9 +1699,8 @@ static int readBSSListRid(struct airo_in issuecommand(ai, &cmd, &rsp); up(&ai->sem); /* Let the command take effect */ - set_current_state (TASK_INTERRUPTIBLE); ai->task = current; - schedule_timeout (3*HZ); + ssleep_interruptible(3); ai->task = NULL; } rc = PC4500_readrid(ai, first ? RID_BSSLISTFIRST : RID_BSSLISTNEXT, @@ -2686,11 +2685,9 @@ int reset_card( struct net_device *dev , return -1; waitbusy (ai); OUT4500(ai,COMMAND,CMD_SOFTRESET); - set_current_state (TASK_UNINTERRUPTIBLE); - schedule_timeout (HZ/5); + msleep(200); waitbusy (ai); - set_current_state (TASK_UNINTERRUPTIBLE); - schedule_timeout (HZ/5); + msleep(200); if (lock) up(&ai->sem); return 0; @@ -2950,7 +2947,7 @@ static int airo_thread(void *data) { } break; } - current->state = TASK_RUNNING; + __set_current_state(TASK_RUNNING); remove_wait_queue(&ai->thr_wait, &wait); locked = 1; } @@ -5518,12 +5515,12 @@ static int airo_pci_resume(struct pci_de } else { OUT4500(ai, EVACK, EV_AWAKEN); OUT4500(ai, EVACK, EV_AWAKEN); - schedule_timeout(HZ/10); + msleep_interruptible(100); } set_bit (FLAG_COMMIT, &ai->flags); disable_MAC(ai, 0); - schedule_timeout (HZ/5); + msleep_interruptible(200); if (ai->SSID) { writeSsidRid(ai, ai->SSID, 0); kfree(ai->SSID); @@ -7472,8 +7469,7 @@ int cmdreset(struct airo_info *ai) { OUT4500(ai,COMMAND,CMD_SOFTRESET); - set_current_state (TASK_UNINTERRUPTIBLE); - schedule_timeout (HZ); /* WAS 600 12/7/00 */ + ssleep(1); /* WAS 600 12/7/00 */ if(!waitbusy (ai)){ printk(KERN_INFO "Waitbusy hang AFTER RESET\n"); @@ -7500,8 +7496,7 @@ int setflashmode (struct airo_info *ai) OUT4500(ai, SWS3, FLASH_COMMAND); OUT4500(ai, COMMAND,0); } - set_current_state (TASK_UNINTERRUPTIBLE); - schedule_timeout (HZ/2); /* 500ms delay */ + msleep(500); /* 500ms delay */ if(!waitbusy(ai)) { clear_bit (FLAG_FLASHING, &ai->flags); @@ -7611,8 +7606,7 @@ int flashputbuf(struct airo_info *ai){ int flashrestart(struct airo_info *ai,struct net_device *dev){ int i,status; - set_current_state (TASK_UNINTERRUPTIBLE); - schedule_timeout (HZ); /* Added 12/7/00 */ + ssleep(1); /* Added 12/7/00 */ clear_bit (FLAG_FLASHING, &ai->flags); if (test_bit(FLAG_MPI, &ai->flags)) { status = mpi_init_descriptors(ai); @@ -7627,8 +7621,7 @@ int flashrestart(struct airo_info *ai,st ( ai, 2312, i >= MAX_FIDS / 2 ); } - set_current_state (TASK_UNINTERRUPTIBLE); - schedule_timeout (HZ); /* Added 12/7/00 */ + ssleep(1); /* Added 12/7/00 */ return status; } #endif /* CISCO_EXT */ From jt@bougret.hpl.hp.com Mon Nov 1 14:58:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 14:58:47 -0800 (PST) Received: from palrel11.hp.com (palrel11.hp.com [156.153.255.246]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA1MwfvV020406 for ; Mon, 1 Nov 2004 14:58:41 -0800 Received: from tomil.hpl.hp.com (tomil.hpl.hp.com [15.0.152.100]) by palrel11.hp.com (Postfix) with ESMTP id 77FA918CB4; Mon, 1 Nov 2004 14:58:24 -0800 (PST) Received: from bougret.hpl.hp.com (bougret.hpl.hp.com [15.4.92.227]) by tomil.hpl.hp.com (8.9.3 (PHNE_29774)/8.9.3 HPLabs Timeshare Server) with ESMTP id PAA23985; Mon, 1 Nov 2004 15:03:08 -0800 (PST) Received: from jt by bougret.hpl.hp.com with local (Exim 3.35 #1 (Debian)) id 1COl84-0004Qu-00; Mon, 01 Nov 2004 14:58:24 -0800 Date: Mon, 1 Nov 2004 14:58:24 -0800 To: Jeff Garzik , Linux kernel mailing list , netdev@oss.sgi.com Subject: [PATCH 2.6] Wireless Extension dropped patchlet Message-ID: <20041101225823.GA16560@bougret.hpl.hp.com> Reply-To: jt@hpl.hp.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i Organisation: HP Labs Palo Alto Address: HP Labs, 1U-17, 1501 Page Mill road, Palo Alto, CA 94304, USA. E-mail: jt@hpl.hp.com From: Jean Tourrilhes X-archive-position: 11313 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jt@bougret.hpl.hp.com Precedence: bulk X-list: netdev Content-Length: 3258 Lines: 77 Hi Jeff, This tiny bit of the last WE-17 patch was lost between me and you. I initially decided to wait to resubmit, but Chris Wedgwood reported that the MadWifi driver needs it. Sorry for not having pushed harder. I recreated this patch, and tested with 2.6.10-rc1, and Chris tested it with MadWifi. Would you mind pushing that up to Linus ? Thanks in advance... Jean Changelog : o remove unneeded const o spelling + comments Signed-off-by: Jean Tourrilhes --------------------------------------------------------------- diff -u -p linux-2.6.10-rc1/include/linux/wireless.h linux-2.6.9/include/linux/wireless.h --- linux-2.6.10-rc1/include/net/iw_handler.h Mon Nov 1 11:14:46 2004 +++ linux-2.6.9/include/net/iw_handler.h Mon Nov 1 11:14:50 2004 @@ -311,10 +311,10 @@ struct iw_handler_def { /* Number of handlers defined (more precisely, index of the * last defined handler + 1) */ - const __u16 num_standard; - const __u16 num_private; + __u16 num_standard; + __u16 num_private; /* Number of private arg description */ - const __u16 num_private_args; + __u16 num_private_args; /* Array of handlers for standard ioctls * We will call dev->wireless_handlers->standard[ioctl - SIOCSIWNAME] @@ -332,7 +332,7 @@ struct iw_handler_def const struct iw_priv_args * private_args; /* This field will be *removed* in the next version of WE */ - const long spy_offset; /* DO NOT USE */ + long spy_offset; /* DO NOT USE */ /* New location of get_wireless_stats, to de-bloat struct net_device. * The old pointer in struct net_device will be gradually phased diff -u -p linux-2.6.10-rc1/include/net/iw_handler.h linux-2.6.9/include/net/iw_handler.h --- linux-2.6.10-rc1/net/core/wireless.c Mon Nov 1 11:14:48 2004 +++ linux-2.6.9/net/core/wireless.c Mon Nov 1 11:24:32 2004 @@ -52,7 +52,8 @@ * v6 - 18.06.04 - Jean II * o Change get_spydata() method for added safety * o Remove spy #ifdef, they are always on -> cleaner code - * o Allow any size GET request is user specifies length > max + * o Allow any size GET request if user specifies length > max + * and if request has IW_DESCR_FLAG_NOMAX flag or is SIOCGIWPRIV * o Start migrating get_wireless_stats to struct iw_handler_def * o Add wmb() in iw_handler_set_spy() for non-coherent archs/cpus * Based on patch from Pavel Roskin : @@ -690,6 +691,10 @@ static inline int ioctl_standard_call(st * we can support any size GET requests. * There is still a limit : -ENOMEM. */ extra_size = user_length * descr->token_size; + /* Note : user_length is originally a __u16, + * and token_size is controlled by us, + * so extra_size won't get negative and + * won't overflow... */ } } @@ -1227,7 +1232,7 @@ int iw_handler_set_spy(struct net_device /* We want to operate without locking, because wireless_spy_update() * most likely will happen in the interrupt handler, and therefore - * have it own locking constraints and needs performance. + * have its own locking constraints and needs performance. * The rtnl_lock() make sure we don't race with the other iw_handlers. * This make sure wireless_spy_update() "see" that the spy list * is temporarily disabled. */ From tommy.christensen@tpack.net Mon Nov 1 15:09:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 15:09:29 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id iA1N9NNv022126 for ; Mon, 1 Nov 2004 15:09:24 -0800 Received: (qmail 7916 invoked from network); 1 Nov 2004 23:09:00 -0000 Received: from dhcp-174.cph.tpack.net (HELO ?172.17.159.11?) (192.168.0.174) by 0 with SMTP; 1 Nov 2004 23:09:00 -0000 Message-ID: <4186C201.5030004@tpack.net> Date: Tue, 02 Nov 2004 00:08:49 +0100 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ben Greear CC: "'netdev@oss.sgi.com'" , "Linux 802.1Q VLAN" , Francois Romieu , "David S. Miller" Subject: Re: [PATCH] 802.1Q VLAN References: <41797696.9070905@candelatech.com> <20041022214611.GA4948@electric-eye.fr.zoreil.com> <41798506.1030909@candelatech.com> <417D675F.3000909@candelatech.com> <4181838B.6040002@tpack.net> <41818D99.9020300@candelatech.com> <1099038566.1813.99.camel@cyan.cph.tpack.net> <418281C1.9080707@candelatech.com> <4182D44E.7070507@tpack.net> <4182DABE.7000502@candelatech.com> <4182E0C6.6090205@tpack.net> <4186876E.5040204@candelatech.com> In-Reply-To: <4186876E.5040204@candelatech.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11314 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev Content-Length: 1203 Lines: 43 Ben Greear wrote: > How does this look? I think it should fix the problem with > having a new skb created in the __vlan_put_tag() method. Yes, this seems to be handled correctly now. Two nitpickings: - veth should be reassigned after calling __vlan_put_tag - sample skb->len before calling dev_queue_xmit and use that to update stats->tx_bytes (it can be different from skb2->len) And then there's the return values ... This is a hard_start_xmit() method, so we should try to be consistent with real device drivers. The only defined return values are: NETDEV_TX_OK and NETDEV_TX_BUSY. (There is also Andi's NETDEV_TX_LOCKED, which we can ignore here). Furthermore transmission shouldn't be retried in case of failure, only on congestion does this make sense. So my suggestion for the last part of the function is: len = skb->len; rv = dev_queue_xmit(skb); if (rv < 0) { stats->tx_dropped++; kfree_skb(skb2); ret = NETDEV_TX_OK; } else if (rv == NET_XMIT_SUCCESS || rv == NET_XMIT_CN) { stats->tx_packets++; stats->tx_bytes += len; kfree_skb(skb2); ret = NETDEV_TX_OK; } else { /* The device below us is congested */ ret = NETDEV_TX_BUSY; } return ret; -Tommy From davem@davemloft.net Mon Nov 1 16:41:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 16:42:00 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA20fsjV029668 for ; Mon, 1 Nov 2004 16:41:54 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1COmXN-0003vM-00; Mon, 01 Nov 2004 16:28:37 -0800 Date: Mon, 1 Nov 2004 16:28:37 -0800 From: "David S. Miller" To: Adrian Bunk Cc: acme@conectiva.com.br, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [2.6 patch] appletalk: remove an unused function Message-Id: <20041101162837.33fd343e.davem@davemloft.net> In-Reply-To: <20041029001439.GC29142@stusta.de> References: <20041028221046.GI3207@stusta.de> <20041029001439.GC29142@stusta.de> X-Mailer: Sylpheed version 0.9.99 (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: 11315 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 166 Lines: 6 On Fri, 29 Oct 2004 02:14:39 +0200 Adrian Bunk wrote: > The patch below removes an unsed function from net/appletalk/ddp.c Applied, thanks Adrian. From davem@davemloft.net Mon Nov 1 16:43:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 16:43:11 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA20h7lT029818 for ; Mon, 1 Nov 2004 16:43:07 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1COmYU-0003wp-00; Mon, 01 Nov 2004 16:29:46 -0800 Date: Mon, 1 Nov 2004 16:29:46 -0800 From: "David S. Miller" To: Adrian Bunk Cc: ralf@linux-mips.org, linux-hams@vger.kernel.org, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [2.6 patch] ax25_route.c: remove an unused function Message-Id: <20041101162946.19b3869e.davem@davemloft.net> In-Reply-To: <20041029002045.GO29142@stusta.de> References: <20041028230032.GU3207@stusta.de> <20041029002045.GO29142@stusta.de> X-Mailer: Sylpheed version 0.9.99 (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: 11316 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 169 Lines: 6 On Fri, 29 Oct 2004 02:20:45 +0200 Adrian Bunk wrote: > The patch below removes an unused function from net/ax25/ax25_route.c Applied, thanks Adrian. From davem@davemloft.net Mon Nov 1 16:44:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 16:44:39 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA20iZTp030446 for ; Mon, 1 Nov 2004 16:44:36 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1COmZh-0003xG-00; Mon, 01 Nov 2004 16:31:01 -0800 Date: Mon, 1 Nov 2004 16:31:00 -0800 From: "David S. Miller" To: Adrian Bunk Cc: coreteam@netfilter.org, marc@mbsi.ca, netfilter-devel@lists.netfilter.org, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [2.6 patch] netfilter/ipt_tcpmss.c: remove an unused function Message-Id: <20041101163100.60e737ff.davem@davemloft.net> In-Reply-To: <20041029002113.GP29142@stusta.de> References: <20041028230202.GV3207@stusta.de> <20041029002113.GP29142@stusta.de> X-Mailer: Sylpheed version 0.9.99 (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: 11317 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 304 Lines: 9 On Fri, 29 Oct 2004 02:21:13 +0200 Adrian Bunk wrote: > The patch below removes an unused function from > net/ipv4/netfilter/ipt_tcpmss.c Applied, thanks Adrian. This one is probably due to cut&paste from ipt_TCPMSS.c where this inline is also implemented and also actually used :-) From davem@davemloft.net Mon Nov 1 16:49:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 16:49:08 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA20n4sb030908 for ; Mon, 1 Nov 2004 16:49:04 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1COmXu-0003vc-00; Mon, 01 Nov 2004 16:29:10 -0800 Date: Mon, 1 Nov 2004 16:29:09 -0800 From: "David S. Miller" To: Adrian Bunk Cc: dagb@cs.uit.no, jt@hpl.hp.com, irda-users@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [2.6 patch] irda/qos.c: remove an unused function Message-Id: <20041101162909.4af0ebbd.davem@davemloft.net> In-Reply-To: <20041029001809.GJ29142@stusta.de> References: <20041028222238.GP3207@stusta.de> <20041029001809.GJ29142@stusta.de> X-Mailer: Sylpheed version 0.9.99 (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: 11318 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 162 Lines: 6 On Fri, 29 Oct 2004 02:18:09 +0200 Adrian Bunk wrote: > The patch below removes an unused function from net/irda/qos.c Applied, thanks Adrian. From davem@davemloft.net Mon Nov 1 16:49:09 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 16:49:14 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA20n9dd030919 for ; Mon, 1 Nov 2004 16:49:09 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1COmhR-00042e-00; Mon, 01 Nov 2004 16:39:01 -0800 Date: Mon, 1 Nov 2004 16:39:01 -0800 From: "David S. Miller" To: Thomas Graf Cc: netdev@oss.sgi.com, hadi@cyberus.ca Subject: Re: [PATCH 7/6] cls_fw: CONFIG_NET_CLS_IND is not dependant on CONFIG_NET_CLS_ACT Message-Id: <20041101163901.2b4449d3.davem@davemloft.net> In-Reply-To: <20041029102620.GH12289@postel.suug.ch> References: <20041029002113.GY12289@postel.suug.ch> <20041029102620.GH12289@postel.suug.ch> X-Mailer: Sylpheed version 0.9.99 (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: 11319 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 100 Lines: 4 All 7 (of 6!) patches applied, thanks Thomas :-) I'll add Jamal's IPT action patch right now too. From davem@davemloft.net Mon Nov 1 17:08:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 17:08:29 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA218NVW032216 for ; Mon, 1 Nov 2004 17:08:24 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1COn08-0004Ce-00; Mon, 01 Nov 2004 16:58:20 -0800 Date: Mon, 1 Nov 2004 16:58:20 -0800 From: "David S. Miller" To: Thomas Graf Cc: netdev@oss.sgi.com Subject: Re: [PATCH 2.4] PKT_SCHED: break is not enough to stop walking Message-Id: <20041101165820.75159f20.davem@davemloft.net> In-Reply-To: <20041029002958.GF12289@postel.suug.ch> References: <20041029002958.GF12289@postel.suug.ch> X-Mailer: Sylpheed version 0.9.99 (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: 11320 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 298 Lines: 9 On Fri, 29 Oct 2004 02:29:58 +0200 Thomas Graf wrote: > break is not enough to escape from the walking loops, since > multiple encapsulated loops are used to traverse the hash tables. > > Signed-off-by: Thomas Graf Applied, thanks for doing this backport Thomas. From davem@davemloft.net Mon Nov 1 17:09:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 17:09:24 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA219IYg032432 for ; Mon, 1 Nov 2004 17:09:18 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1COn0x-0004Cx-00; Mon, 01 Nov 2004 16:59:11 -0800 Date: Mon, 1 Nov 2004 16:59:10 -0800 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: [XFRM] Move xfrm4_rcv export to its site Message-Id: <20041101165910.138a0f94.davem@davemloft.net> In-Reply-To: <20041029021352.GA22550@gondor.apana.org.au> References: <20041029021352.GA22550@gondor.apana.org.au> X-Mailer: Sylpheed version 0.9.99 (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: 11321 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 315 Lines: 10 On Fri, 29 Oct 2004 12:13:52 +1000 Herbert Xu wrote: > Here is a trivial patch that moves xfrm4_rcv's export to the > site of its definition. Currently it lives in net/xfrm which > is miles away. > > Signed-off-by: Herbert Xu Applied, thanks Herbert. From davem@davemloft.net Mon Nov 1 17:10:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 17:10:07 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA21A2Ao000430 for ; Mon, 1 Nov 2004 17:10:02 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1COn1j-0004DJ-00; Mon, 01 Nov 2004 16:59:59 -0800 Date: Mon, 1 Nov 2004 16:59:58 -0800 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: [IPSEC] Make ah4/esp4/ipcomp depend on INET Message-Id: <20041101165958.674c0485.davem@davemloft.net> In-Reply-To: <20041029033900.GA23206@gondor.apana.org.au> References: <20041029033900.GA23206@gondor.apana.org.au> X-Mailer: Sylpheed version 0.9.99 (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: 11322 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 307 Lines: 9 On Fri, 29 Oct 2004 13:39:00 +1000 Herbert Xu wrote: > As it is someone could disable INET and still enable ah4/esp4/ipcomp. > This patch adds the dependency on INET to prevent this. > > Signed-off-by: Herbert Xu Applied, thanks a lot Herbert. From davem@davemloft.net Mon Nov 1 17:10:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 17:10:41 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA21AZp3000704 for ; Mon, 1 Nov 2004 17:10:35 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1COmzB-0004C1-00; Mon, 01 Nov 2004 16:57:21 -0800 Date: Mon, 1 Nov 2004 16:57:21 -0800 From: "David S. Miller" To: Adrian Bunk Cc: sri@us.ibm.com, lksctp-developers@lists.sourceforge.net, netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [2.6 patch] sctp/outqueue.c: remove an unused function Message-Id: <20041101165721.777295fc.davem@davemloft.net> In-Reply-To: <20041029002201.GQ29142@stusta.de> References: <20041028230353.GW3207@stusta.de> <20041029002201.GQ29142@stusta.de> X-Mailer: Sylpheed version 0.9.99 (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: 11323 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 167 Lines: 6 On Fri, 29 Oct 2004 02:22:01 +0200 Adrian Bunk wrote: > The patch below removes an unused function from net/sctp/outqueue.c Applied, thanks Adrian. From davem@davemloft.net Mon Nov 1 17:11:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 17:11:55 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA21Bov9001195 for ; Mon, 1 Nov 2004 17:11:50 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1COn3R-0004Dh-00; Mon, 01 Nov 2004 17:01:45 -0800 Date: Mon, 1 Nov 2004 17:01:45 -0800 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: [TCP] Modularise tcpdiag Message-Id: <20041101170145.52185904.davem@davemloft.net> In-Reply-To: <20041029043858.GA27907@gondor.apana.org.au> References: <20041029043858.GA27907@gondor.apana.org.au> X-Mailer: Sylpheed version 0.9.99 (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: 11324 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 333 Lines: 11 On Fri, 29 Oct 2004 14:38:58 +1000 Herbert Xu wrote: > This is the first step in fixing the tcpdiag/modular ipv6 issue. > We modularise tcpdiag in the obvious way. > > Next we can move out the IPv6-specific stuff. > > Signed-off-by: Herbert Xu Applied, thanks Herbert. From davem@davemloft.net Mon Nov 1 17:16:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 17:16:22 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA21GIBX001663 for ; Mon, 1 Nov 2004 17:16:18 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1COn7o-0004Ev-00; Mon, 01 Nov 2004 17:06:16 -0800 Date: Mon, 1 Nov 2004 17:06:16 -0800 From: "David S. Miller" To: Thomas Graf Cc: netdev@oss.sgi.com, hadi@cyberus.ca Subject: Re: [PATCHSET 0/4] PKT_SCHED: More classifier cleanups Message-Id: <20041101170616.588da57d.davem@davemloft.net> In-Reply-To: <20041029140612.GO12289@postel.suug.ch> References: <20041029140612.GO12289@postel.suug.ch> X-Mailer: Sylpheed version 0.9.99 (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: 11325 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 325 Lines: 11 On Fri, 29 Oct 2004 16:06:12 +0200 Thomas Graf wrote: > Cleans up route,rsvp,tcindex, and u32 classifier to > use the generic classifier routines. > > All trivial changes not changing any behaviour. > > Relative to patchset "Generic classifier routines / cls_fw cleanup" All applied, thanks a lot Thomas. From davem@davemloft.net Mon Nov 1 17:37:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 17:37:16 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA21bBZO002598 for ; Mon, 1 Nov 2004 17:37:11 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1COnS4-0004J2-00; Mon, 01 Nov 2004 17:27:12 -0800 Date: Mon, 1 Nov 2004 17:27:12 -0800 From: "David S. Miller" To: Mike Waychison Cc: Brian.Somers@Sun.COM, netdev@oss.sgi.com Subject: Re: [PATCH] TG3: fiber hw autoneg bounces Message-Id: <20041101172712.55e97846.davem@davemloft.net> In-Reply-To: <4182B6A7.90700@sun.com> References: <4182B6A7.90700@sun.com> X-Mailer: Sylpheed version 0.9.99 (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: 11326 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 633 Lines: 16 On Fri, 29 Oct 2004 17:31:19 -0400 Mike Waychison wrote: > I've traced it to be caused by the tg3_timer 1 second work noticing that > MAC_STATUS_LNKSTATE_CHANGED was set, which driver would see as the link > going down. > > Upon further inspection, it appears that we don't wait long enough > between setting SG_DIG_CTRL and reading the SG_DIG_STATUS for the result. How come the bcm5700 Broadcom driver gets away without this incredibly huge delay? The touching of the device is absolutely identical in the tg3 driver to what Broadcom's bcm5700 code is doing. I'll apply the patch for now though... From davem@davemloft.net Mon Nov 1 18:15:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 18:15:59 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA22Fo1W004465 for ; Mon, 1 Nov 2004 18:15:50 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1COo3M-0004Qv-00; Mon, 01 Nov 2004 18:05:44 -0800 Date: Mon, 1 Nov 2004 18:05:44 -0800 From: "David S. Miller" To: "chas williams (contractor)" Cc: netdev@oss.sgi.com, rddunlap@osdl.org, myxie@debian.org, gprocida@madge.com, linux-atm-general@lists.sourceforge.net Subject: Re: [PATCH][ATM]: [ambassador] fix type and printk warning (from Randy Dunlap ) Message-Id: <20041101180544.1b94222c.davem@davemloft.net> In-Reply-To: <200410311552.i9VFq5XQ017682@ginger.cmf.nrl.navy.mil> References: <416AD8B9.9000901@osdl.org> <200410311552.i9VFq5XQ017682@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.99 (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: 11327 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 365 Lines: 10 On Sun, 31 Oct 2004 10:52:06 -0500 "chas williams (contractor)" wrote: > # This is a BitKeeper generated diff -Nru style patch. > # > # ChangeSet > # 2004/10/31 10:49:16-05:00 chas@relax.cmf.nrl.navy.mil > # [ATM]: [ambassador] fix type and printk warning (from Randy Dunlap ) Applied, thanks Chas and Randy. From davem@davemloft.net Mon Nov 1 18:16:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 18:16:46 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA22GgSn004523 for ; Mon, 1 Nov 2004 18:16:42 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1COo4D-0004RQ-00; Mon, 01 Nov 2004 18:06:37 -0800 Date: Mon, 1 Nov 2004 18:06:37 -0800 From: "David S. Miller" To: "chas williams (contractor)" Cc: netdev@oss.sgi.com, davem@redhat.com, adam@yggdrasil.com Subject: Re: [PATCH][ATM]: [drivers] add missing pci_tbl exports (pointed out by "Adam J. Richter" ) Message-Id: <20041101180637.078c7779.davem@davemloft.net> In-Reply-To: <200410311628.i9VGSNma017970@ginger.cmf.nrl.navy.mil> References: <200410311628.i9VGSNma017970@ginger.cmf.nrl.navy.mil> X-Mailer: Sylpheed version 0.9.99 (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: 11328 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 361 Lines: 10 On Sun, 31 Oct 2004 11:28:24 -0500 "chas williams (contractor)" wrote: > # This is a BitKeeper generated diff -Nru style patch. > # > # ChangeSet > # 2004/10/31 11:26:23-05:00 chas@relax.cmf.nrl.navy.mil > # [ATM]: [drivers] add missing pci_tbl exports (pointed out by "Adam J. Richter" Applied, thanks Chas. From rddunlap@osdl.org Mon Nov 1 20:29:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 20:30:04 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA24TxH6029774 for ; Mon, 1 Nov 2004 20:29:59 -0800 Received: from [127.0.0.1] (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id iA24Ta903407; Mon, 1 Nov 2004 20:29:36 -0800 Message-ID: <41870BF9.6060207@osdl.org> Date: Mon, 01 Nov 2004 20:24:25 -0800 From: "Randy.Dunlap" User-Agent: Mozilla Thunderbird 0.8 (X11/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: ganesh.venkatesan@intel.com, jesse.brandeburg@intel.com, netdev@oss.sgi.com Subject: e100 badness (2.6.10-rc1-mm2) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11330 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: 845 Lines: 28 Hi Ganesh, Jesse -- I see this in 2.6.10-rc1-mm2: Badness in enable_irq at kernel/irq/manage.c:112 [] dump_stack+0x1e/0x20 [] enable_irq+0xaa/0x114 [] e100_up+0x130/0x23f [] e100_open+0x26/0x6e [] dev_open+0x6e/0x7c [] dev_change_flags+0x56/0x126 [] devinet_ioctl+0x60b/0x6cd [] inet_ioctl+0x81/0xae [] sock_ioctl+0x1d3/0x2d6 [] sys_ioctl+0x179/0x21d [] sysenter_past_esp+0x52/0x71 I think that it happens because (in e100_up()), disable_irq() is called before request_irq() is called. If there are no other interrupt handlers on the same irq, then desc->depth is cleared to 0 by setup_irq() [called from request_irq()]. Then the following enable_irq() is confused by desc->depth == 0. -- ~Randy From ganesh.venkatesan@intel.com Mon Nov 1 21:07:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 21:07:18 -0800 (PST) Received: from caduceus.jf.intel.com (fmr06.intel.com [134.134.136.7]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA257C7o030964 for ; Mon, 1 Nov 2004 21:07:12 -0800 Received: from talaria.jf.intel.com (talaria.jf.intel.com [10.7.209.7]) by caduceus.jf.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.15 2004/01/30 18:16:28 root Exp $) with ESMTP id iA256UxN018686; Tue, 2 Nov 2004 05:06:30 GMT Received: from orsmsxvs041.jf.intel.com (orsmsxvs041.jf.intel.com [192.168.65.54]) by talaria.jf.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.11 2004/07/29 22:51:53 root Exp $) with SMTP id iA24xc5r030910; Tue, 2 Nov 2004 04:59:43 GMT Received: from orsmsx331.amr.corp.intel.com ([192.168.65.56]) by orsmsxvs041.jf.intel.com (SAVSMTP 3.1.2.35) with SMTP id M2004110121064132245 ; Mon, 01 Nov 2004 21:06:44 -0800 Received: from orsmsx408.amr.corp.intel.com ([192.168.65.52]) by orsmsx331.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.0); Mon, 1 Nov 2004 21:05:54 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: e100 badness (2.6.10-rc1-mm2) Date: Mon, 1 Nov 2004 21:05:52 -0800 Message-ID: <468F3FDA28AA87429AD807992E22D07E031BAB39@orsmsx408> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: e100 badness (2.6.10-rc1-mm2) Thread-Index: AcTAlJEUFYqeMQePSiyXxbUBGyc6nAABLWfw From: "Venkatesan, Ganesh" To: "Randy.Dunlap" , "Brandeburg, Jesse" , Cc: "Chilakala, Mallikarjuna" X-OriginalArrivalTime: 02 Nov 2004 05:05:54.0878 (UTC) FILETIME=[A1B59DE0:01C4C099] X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id iA257C7o030964 X-archive-position: 11331 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: ganesh.venkatesan@intel.com Precedence: bulk X-list: netdev Content-Length: 1296 Lines: 44 Randy: Thanks for the information. We are aware of this (from a previous conversation between Scott Feldman, Andrew Morton and Jeremy Fitzhardinge). We are working on a fix for this. Thanks, Ganesh. >-----Original Message----- >From: Randy.Dunlap [mailto:rddunlap@osdl.org] >Sent: Monday, November 01, 2004 8:24 PM >To: Venkatesan, Ganesh; Brandeburg, Jesse; netdev@oss.sgi.com >Subject: e100 badness (2.6.10-rc1-mm2) > >Hi Ganesh, Jesse -- > >I see this in 2.6.10-rc1-mm2: > >Badness in enable_irq at kernel/irq/manage.c:112 > [] dump_stack+0x1e/0x20 > [] enable_irq+0xaa/0x114 > [] e100_up+0x130/0x23f > [] e100_open+0x26/0x6e > [] dev_open+0x6e/0x7c > [] dev_change_flags+0x56/0x126 > [] devinet_ioctl+0x60b/0x6cd > [] inet_ioctl+0x81/0xae > [] sock_ioctl+0x1d3/0x2d6 > [] sys_ioctl+0x179/0x21d > [] sysenter_past_esp+0x52/0x71 > > >I think that it happens because (in e100_up()), >disable_irq() is called before request_irq() is called. >If there are no other interrupt handlers on the same irq, >then desc->depth is cleared to 0 by setup_irq() [called >from request_irq()]. >Then the following enable_irq() is confused by >desc->depth == 0. > >-- >~Randy From michael.vittrup.larsen@ericsson.com Mon Nov 1 23:55:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Mon, 01 Nov 2004 23:55:19 -0800 (PST) Received: from eagle.ericsson.se (eagle.ericsson.se [193.180.251.53]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA27tCkw004604 for ; Mon, 1 Nov 2004 23:55:13 -0800 Received: from esealmw143.al.sw.ericsson.se ([153.88.254.118]) by eagle.ericsson.se (8.12.10/8.12.10/WIREfire-1.8b) with ESMTP id iA27ssR2020434 for ; Tue, 2 Nov 2004 08:54:55 +0100 Received: from esealnt613.al.sw.ericsson.se ([153.88.254.125]) by esealmw143.al.sw.ericsson.se with Microsoft SMTPSVC(6.0.3790.211); Tue, 2 Nov 2004 08:54:54 +0100 Received: from unixmail.ted.dk.eu.ericsson.se (knud.ted.dk.eu.ericsson.se [213.159.188.246]) by esealnt613.al.sw.ericsson.se with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id WB1ZD7FQ; Tue, 2 Nov 2004 08:54:54 +0100 Received: from diadem.ted.dk.eu.ericsson.se (diadem.ted.dk.eu.ericsson.se [213.159.189.76]) by unixmail.ted.dk.eu.ericsson.se (8.10.1/8.10.1/TEDmain-1.0) with ESMTP id iA27sj321903; Tue, 2 Nov 2004 08:54:52 +0100 (MET) X-Sybari-Trust: dc62f736 8cefd49f 03c8e4c8 00000138 From: Michael Vittrup Larsen Organization: Ericsson To: Stephen Hemminger Subject: Re: [PATCH] tcp: efficient port randomisation Date: Tue, 2 Nov 2004 09:54:44 +0200 User-Agent: KMail/1.7 Cc: "David S. Miller" , netdev@oss.sgi.com References: <20041027092531.78fe438c@guest-251-240.pdx.osdl.net> <200411011058.23141.michael.vittrup.larsen@ericsson.com> <20041101092027.2a741e82@zqx3.pdx.osdl.net> In-Reply-To: <20041101092027.2a741e82@zqx3.pdx.osdl.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Message-Id: <200411020854.44745.michael.vittrup.larsen@ericsson.com> X-OriginalArrivalTime: 02 Nov 2004 07:54:54.0939 (UTC) FILETIME=[3DA822B0:01C4C0B1] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id iA27tCkw004604 X-archive-position: 11337 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: michael.vittrup.larsen@ericsson.com Precedence: bulk X-list: netdev Content-Length: 2741 Lines: 55 On Monday 01 November 2004 18:20, Stephen Hemminger wrote: > > * It is probably a good strategy to set 'tcp_rover_next' such that > >   the next search is resumed from the previous port found to be free. > >   (similar to the old algorithm).  I don't see this in your patch, > >   but of course I could have missed it. > > It was intentional since it would require holding a lock around the search. > The tradeoff is better SMP performance in the sparsely filled port space > (more typical) vs. better UP performance in the case of a mostly full port > space. I think a typical scenario is many short-lived (e.g. minutes) TCP connections, few long-lived (e.g. hours) connections and an ephemeral port wrap-around probably also in hours - at least a long time compared to the life-time of the short-lived connections. This would result in a closely spaced 'group' of ports being occupied somewhere in the ephemeral port range, and 'tcp_rover_next' would point at the uppermost extreme of this group and thus always guarantee a free port on first try (collisions will only happen with long-lived connections). If you don't update 'tcp_rover_next', and this somehow gets to lag behind this 'group' of ports (say point at the lower extreme) you will need to search through this group first before you enter the unoccupied port space. Your scheme works initially because you do not lag behind the free port space, but eventually you will, and I think this will result in less optimal performance compared to the old behaviour. Since updating the 'tcp_rover_next' practically always result in a free port on first try, I think SMP performance will not suffer even though the lock was held all through the port search (except when the port space is very crowded). And yes, I do use Linux exclusively, so I do care :-)) From a statistically point of view, if the connection life-times are uniformly distributed from zero to infinite (theoretical scenario), it does not matter what starting point you use. However, soon as life-times are not uniformly distributed, this kind of search algorithm will benefit from good starting point defining where the probability of used vs. unused port drop from high to low. The BSD solution with a pure random rover suffers similarly, especially when the port space becomes crowded. > > * connect_port_offset() does not (at least from an algorithm point > >   of view) need to return an u32, an u16 is sufficient. > > If it is truncated to u16, then compiler has to take extra effort to > truncate is unnecessary given later  modulo operation. I agree (in fact thats what I argued in the draft) - it probably depends on your platform - you are assuming a 32-bit platform I guess. From cchan@outblaze.com Tue Nov 2 00:14:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 00:14:48 -0800 (PST) Received: from corpmail.outblaze.com (corpmail.outblaze.com [203.86.166.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA28Ef2O005383 for ; Tue, 2 Nov 2004 00:14:42 -0800 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by corpmail.outblaze.com (Postfix) with ESMTP id EDE8A37BB4; Tue, 2 Nov 2004 08:14:19 +0000 (GMT) Received: from [192.168.2.119] (210-177-227-130.outblaze.com [210.177.227.130]) by corpmail.outblaze.com (Postfix) with ESMTP id 57F0716DD86; Tue, 2 Nov 2004 08:14:17 +0000 (GMT) Message-ID: <418741EB.3080701@outblaze.com> Date: Tue, 02 Nov 2004 16:14:35 +0800 From: Christopher Chan User-Agent: Mozilla Thunderbird 0.8 (X11/20040908) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Cc: Andrew Morton Subject: linux 2.6.9 still having network code problems Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiVirus: checked by Vexira MailArmor (version: 2.0.2-8; VAE: 6.28.0.12; VDF: 6.28.0.47; host: corpmail.outblaze.com) X-archive-position: 11338 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: 4021 Lines: 80 Mr. Morton, I'm ccing you due to the oom-killer stuff. Previously with 2.6.7 I had to use this values in sysctl to be able to continue to access the box: net.ipv4.tcp_max_syn_backlog = 2048 net.ipv4.route.gc_thresh = 65536 net.ipv4.route.max_size = 1048576 2.6.9 without this values gave me similar problems with 2.6.7 without the above values. Sample log lines below: There are multiple oom-killer lines (different pid for smtpd process) and the network related messages repeated until the box was rebooted about 45 mins later. Nov 1 03:15:58 spf5-3 kernel: oom-killer: gfp_mask=0x1d2 Nov 1 03:15:58 spf5-3 kernel: DMA per-cpu: Nov 1 03:15:58 spf5-3 kernel: cpu 0 hot: low 2, high 6, batch 1 Nov 1 03:15:58 spf5-3 kernel: cpu 0 cold: low 0, high 2, batch 1 Nov 1 03:15:58 spf5-3 kernel: cpu 1 hot: low 2, high 6, batch 1 Nov 1 03:15:58 spf5-3 kernel: cpu 1 cold: low 0, high 2, batch 1 Nov 1 03:15:58 spf5-3 kernel: Normal per-cpu: Nov 1 03:15:58 spf5-3 kernel: cpu 0 hot: low 32, high 96, batch 16 Nov 1 03:15:58 spf5-3 kernel: cpu 0 cold: low 0, high 32, batch 16 Nov 1 03:15:58 spf5-3 kernel: cpu 1 hot: low 32, high 96, batch 16 Nov 1 03:15:58 spf5-3 kernel: cpu 1 cold: low 0, high 32, batch 16 Nov 1 03:15:58 spf5-3 kernel: HighMem per-cpu: Nov 1 03:15:58 spf5-3 kernel: cpu 0 hot: low 16, high 48, batch 8 Nov 1 03:15:58 spf5-3 kernel: cpu 0 cold: low 0, high 16, batch 8 Nov 1 03:15:58 spf5-3 kernel: cpu 1 hot: low 16, high 48, batch 8 Nov 1 03:15:58 spf5-3 kernel: cpu 1 cold: low 0, high 16, batch 8 Nov 1 03:15:58 spf5-3 kernel: Nov 1 03:15:58 spf5-3 kernel: Free pages: 1264kB (128kB HighMem) Nov 1 03:15:58 spf5-3 kernel: Active:204122 inactive:68 dirty:0 writeback:0 unstable:0 free:316 slab:27673 mapped:204956 pagetables:22623 Nov 1 03:15:58 spf5-3 kernel: DMA free:16kB min:16kB low:32kB high:48kB active:10544kB inactive:0kB present:16384kB Nov 1 03:15:59 spf5-3 kernel: protections[]: 0 0 0 Nov 1 03:15:59 spf5-3 kernel: Normal free:1120kB min:936kB low:1872kB high:2808kB active:693760kB inactive:556kB present:901120kB Nov 1 03:15:59 spf5-3 kernel: protections[]: 0 0 0 Nov 1 03:15:59 spf5-3 kernel: HighMem free:128kB min:128kB low:256kB high:384kB active:112132kB inactive:152kB present:131072kB Nov 1 03:15:59 spf5-3 kernel: protections[]: 0 0 0 Nov 1 03:15:59 spf5-3 kernel: DMA: 0*4kB 0*8kB 1*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 16kB Nov 1 03:15:59 spf5-3 kernel: Normal: 104*4kB 4*8kB 0*16kB 1*32kB 0*64kB 0*128kB 1*256kB 1*512kB 0*1024kB 0*2048kB 0*4096kB = 1248kB Nov 1 03:15:59 spf5-3 kernel: HighMem: 0*4kB 0*8kB 0*16kB 2*32kB 1*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 128kB Nov 1 03:15:59 spf5-3 kernel: Swap cache: add 0, delete 0, find 0/0, race 0+0 Nov 1 03:16:00 spf5-3 kernel: Out of Memory: Killed process 21861 (smtpd). Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at net/ipv4/tcp.c (1348) Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at net/ipv4/tcp.c (1348) Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at net/ipv4/tcp.c (1348) From akpm@osdl.org Tue Nov 2 00:21:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 00:21:41 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA28LWpJ009120 for ; Tue, 2 Nov 2004 00:21:33 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id iA28L3903210; Tue, 2 Nov 2004 00:21:03 -0800 Date: Tue, 2 Nov 2004 01:19:18 -0800 From: Andrew Morton To: Christopher Chan Cc: netdev@oss.sgi.com Subject: Re: linux 2.6.9 still having network code problems Message-Id: <20041102011918.2b453e21.akpm@osdl.org> In-Reply-To: <418741EB.3080701@outblaze.com> References: <418741EB.3080701@outblaze.com> 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: 11339 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: 4394 Lines: 97 Christopher Chan wrote: > > Mr. Morton, > > I'm ccing you due to the oom-killer stuff. > gee thanks ;) > Previously with 2.6.7 I had to use this values in sysctl to be able to > continue to access the box: > > net.ipv4.tcp_max_syn_backlog = 2048 > net.ipv4.route.gc_thresh = 65536 > net.ipv4.route.max_size = 1048576 Why? > 2.6.9 without this values gave me similar problems with 2.6.7 without > the above values. What problems? > Sample log lines below: > > There are multiple oom-killer lines (different pid for smtpd process) > and the network related messages repeated until the box was rebooted > about 45 mins later. > > Nov 1 03:15:58 spf5-3 kernel: oom-killer: gfp_mask=0x1d2 > Nov 1 03:15:58 spf5-3 kernel: DMA per-cpu: > Nov 1 03:15:58 spf5-3 kernel: cpu 0 hot: low 2, high 6, batch 1 > Nov 1 03:15:58 spf5-3 kernel: cpu 0 cold: low 0, high 2, batch 1 > Nov 1 03:15:58 spf5-3 kernel: cpu 1 hot: low 2, high 6, batch 1 > Nov 1 03:15:58 spf5-3 kernel: cpu 1 cold: low 0, high 2, batch 1 > Nov 1 03:15:58 spf5-3 kernel: Normal per-cpu: > Nov 1 03:15:58 spf5-3 kernel: cpu 0 hot: low 32, high 96, batch 16 > Nov 1 03:15:58 spf5-3 kernel: cpu 0 cold: low 0, high 32, batch 16 > Nov 1 03:15:58 spf5-3 kernel: cpu 1 hot: low 32, high 96, batch 16 > Nov 1 03:15:58 spf5-3 kernel: cpu 1 cold: low 0, high 32, batch 16 > Nov 1 03:15:58 spf5-3 kernel: HighMem per-cpu: > Nov 1 03:15:58 spf5-3 kernel: cpu 0 hot: low 16, high 48, batch 8 > Nov 1 03:15:58 spf5-3 kernel: cpu 0 cold: low 0, high 16, batch 8 > Nov 1 03:15:58 spf5-3 kernel: cpu 1 hot: low 16, high 48, batch 8 > Nov 1 03:15:58 spf5-3 kernel: cpu 1 cold: low 0, high 16, batch 8 > Nov 1 03:15:58 spf5-3 kernel: > Nov 1 03:15:58 spf5-3 kernel: Free pages: 1264kB (128kB HighMem) > Nov 1 03:15:58 spf5-3 kernel: Active:204122 inactive:68 dirty:0 > writeback:0 unstable:0 free:316 slab:27673 mapped:204956 pagetables:22623 You ran out of memory. All your memory is in use by userspace processes. > Nov 1 03:15:58 spf5-3 kernel: DMA free:16kB min:16kB low:32kB high:48kB > active:10544kB inactive:0kB present:16384kB > Nov 1 03:15:59 spf5-3 kernel: protections[]: 0 0 0 > Nov 1 03:15:59 spf5-3 kernel: Normal free:1120kB min:936kB low:1872kB > high:2808kB active:693760kB inactive:556kB present:901120kB > Nov 1 03:15:59 spf5-3 kernel: protections[]: 0 0 0 > Nov 1 03:15:59 spf5-3 kernel: HighMem free:128kB min:128kB low:256kB > high:384kB active:112132kB inactive:152kB present:131072kB > Nov 1 03:15:59 spf5-3 kernel: protections[]: 0 0 0 > Nov 1 03:15:59 spf5-3 kernel: DMA: 0*4kB 0*8kB 1*16kB 0*32kB 0*64kB > 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 16kB > Nov 1 03:15:59 spf5-3 kernel: Normal: 104*4kB 4*8kB 0*16kB 1*32kB > 0*64kB 0*128kB 1*256kB 1*512kB 0*1024kB 0*2048kB 0*4096kB = 1248kB > Nov 1 03:15:59 spf5-3 kernel: HighMem: 0*4kB 0*8kB 0*16kB 2*32kB 1*64kB > 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 128kB > Nov 1 03:15:59 spf5-3 kernel: Swap cache: add 0, delete 0, find 0/0, > race 0+0 Try mounting some swapspace. > Nov 1 03:16:00 spf5-3 kernel: Out of Memory: Killed process 21861 (smtpd). > Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) > failed at net/ipv4/tcp.c (1284) > Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 > Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) > failed at net/ipv4/tcp.c (1284) > Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 > Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (tp->copied_seq == > tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at > net/ipv4/tcp.c (1348) > Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) > failed at net/ipv4/tcp.c (1284) > Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 > Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (tp->copied_seq == > tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at > net/ipv4/tcp.c (1348) > Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) > failed at net/ipv4/tcp.c (1284) > Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 > Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (tp->copied_seq == > tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at > net/ipv4/tcp.c (1348) This is a networking bug. From cchan@outblaze.com Tue Nov 2 00:38:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 00:38:40 -0800 (PST) Received: from corpmail.outblaze.com (corpmail.outblaze.com [203.86.166.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA28cYnY010010 for ; Tue, 2 Nov 2004 00:38:35 -0800 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by corpmail.outblaze.com (Postfix) with ESMTP id 694E037B0C; Tue, 2 Nov 2004 08:38:17 +0000 (GMT) Received: from [192.168.2.119] (210-177-227-130.outblaze.com [210.177.227.130]) by corpmail.outblaze.com (Postfix) with ESMTP id D127516DD83; Tue, 2 Nov 2004 08:38:16 +0000 (GMT) Message-ID: <4187478A.1040002@outblaze.com> Date: Tue, 02 Nov 2004 16:38:34 +0800 From: Christopher Chan User-Agent: Mozilla Thunderbird 0.8 (X11/20040908) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Morton Cc: netdev@oss.sgi.com Subject: Re: linux 2.6.9 still having network code problems References: <418741EB.3080701@outblaze.com> <20041102011918.2b453e21.akpm@osdl.org> In-Reply-To: <20041102011918.2b453e21.akpm@osdl.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiVirus: checked by Vexira MailArmor (version: 2.0.2-8; VAE: 6.28.0.12; VDF: 6.28.0.47; host: corpmail.outblaze.com) X-archive-position: 11340 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: 2422 Lines: 71 >>Previously with 2.6.7 I had to use this values in sysctl to be able to >>continue to access the box: >> >>net.ipv4.tcp_max_syn_backlog = 2048 >>net.ipv4.route.gc_thresh = 65536 >>net.ipv4.route.max_size = 1048576 > > > Why? without these, i get dst cache overflow errors and the similar networking error messages and the box is inaccessible via the network and unusable via serial console. > > >>2.6.9 without this values gave me similar problems with 2.6.7 without >>the above values. > > > What problems? See above. > > > You ran out of memory. All your memory is in use by userspace processes. DOH. the kernel swapped the controller order on me...fstab entries referred to the wrong device names... > > > > Try mounting some swapspace. swapon -a issued :P > > >>Nov 1 03:16:00 spf5-3 kernel: Out of Memory: Killed process 21861 (smtpd). >>Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) >>failed at net/ipv4/tcp.c (1284) >>Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 >>Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) >>failed at net/ipv4/tcp.c (1284) >>Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 >>Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (tp->copied_seq == >>tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at >>net/ipv4/tcp.c (1348) >>Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) >>failed at net/ipv4/tcp.c (1284) >>Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 >>Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (tp->copied_seq == >>tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at >>net/ipv4/tcp.c (1348) >>Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) >>failed at net/ipv4/tcp.c (1284) >>Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 >>Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (tp->copied_seq == >>tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at >>net/ipv4/tcp.c (1348) > > > This is a networking bug. > Yes...it's the same one that won't allow me to use the e100 driver with NAPI enabled with or without them sysctl tweaks and the same one that forces me to use the tweaks without NAPI enabled for the e100 driver. With NAPI enabled, I see the problem when under pressure. FYI, the 2.6.9 kernel is running with NAPI enabled. From akpm@osdl.org Tue Nov 2 00:43:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 00:43:34 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA28hSaJ010664 for ; Tue, 2 Nov 2004 00:43:29 -0800 Received: from bix (build.pdx.osdl.net [172.20.1.2]) by mail.osdl.org (8.11.6/8.11.6) with SMTP id iA28h3905812; Tue, 2 Nov 2004 00:43:03 -0800 Date: Tue, 2 Nov 2004 01:41:19 -0800 From: Andrew Morton To: Christopher Chan Cc: netdev@oss.sgi.com Subject: Re: linux 2.6.9 still having network code problems Message-Id: <20041102014119.1a6096cc.akpm@osdl.org> In-Reply-To: <4187478A.1040002@outblaze.com> References: <418741EB.3080701@outblaze.com> <20041102011918.2b453e21.akpm@osdl.org> <4187478A.1040002@outblaze.com> 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: 11341 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: 364 Lines: 11 Christopher Chan wrote: > > DOH. the kernel swapped the controller order on me...fstab entries > referred to the wrong device names... Eh? That shouldn't happen. Could you please generate a full report of this, send it to the appropriate list and cc myself? Although if that's the 2.6.9 behaviour it's probably a bit late to fix it up. From herbert@gondor.apana.org.au Tue Nov 2 03:27:19 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 03:27:27 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2BRH4J021552 for ; Tue, 2 Nov 2004 03:27:18 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1COwoR-00031W-00; Tue, 02 Nov 2004 22:26:55 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1COwoN-0002IO-00; Tue, 02 Nov 2004 22:26:51 +1100 Date: Tue, 2 Nov 2004 22:26:51 +1100 To: "David S. Miller" , netdev@oss.sgi.com Subject: [NET] Fix neighbour tbl->entries race Message-ID: <20041102112651.GA8633@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="OgqxwSJOaUobr8KG" Content-Disposition: inline User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11342 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 3348 Lines: 122 --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Dave: This patch turns neigh_table's entries counter into an atomic_t. This is needed since tbl->entries is updated with no locks held. This is no big deal in practice since it'll be off by a few entries at most which is way less than any of the neighbour thresholds. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== include/net/neighbour.h 1.24 vs edited ===== --- 1.24/include/net/neighbour.h 2004-10-22 14:51:12 +10:00 +++ edited/include/net/neighbour.h 2004-11-02 22:21:41 +11:00 @@ -189,7 +189,7 @@ struct timer_list gc_timer; struct timer_list proxy_timer; struct sk_buff_head proxy_queue; - int entries; + atomic_t entries; rwlock_t lock; unsigned long last_rand; struct neigh_parms *parms_list; ===== net/core/neighbour.c 1.54 vs edited ===== --- 1.54/net/core/neighbour.c 2004-10-06 04:37:37 +10:00 +++ edited/net/core/neighbour.c 2004-11-02 22:23:18 +11:00 @@ -254,18 +254,20 @@ { struct neighbour *n = NULL; unsigned long now = jiffies; + int entries; - if (tbl->entries > tbl->gc_thresh3 || - (tbl->entries > tbl->gc_thresh2 && + entries = atomic_inc_return(&tbl->entries) - 1; + if (entries >= tbl->gc_thresh3 || + (entries >= tbl->gc_thresh2 && time_after(now, tbl->last_flush + 5 * HZ))) { - if (!neigh_forced_gc(tbl) && - tbl->entries > tbl->gc_thresh3) - goto out; + neigh_forced_gc(tbl); + if (atomic_read(&tbl->entries) > tbl->gc_thresh3) + goto out_entries; } n = kmem_cache_alloc(tbl->kmem_cachep, SLAB_ATOMIC); if (!n) - goto out; + goto out_entries; memset(n, 0, tbl->entry_size); @@ -281,12 +283,15 @@ NEIGH_CACHE_STAT_INC(tbl, allocs); neigh_glbl_allocs++; - tbl->entries++; n->tbl = tbl; atomic_set(&n->refcnt, 1); n->dead = 1; out: return n; + +out_entries: + atomic_dec(&tbl->entries); + goto out; } static struct neighbour **neigh_hash_alloc(unsigned int entries) @@ -427,7 +432,7 @@ write_lock_bh(&tbl->lock); - if (tbl->entries > (tbl->hash_mask + 1)) + if (atomic_read(&tbl->entries) > (tbl->hash_mask + 1)) neigh_hash_grow(tbl, (tbl->hash_mask + 1) << 1); hash_val = tbl->hash(pkey, dev) & tbl->hash_mask; @@ -608,7 +613,7 @@ NEIGH_PRINTK2("neigh %p is destroyed.\n", neigh); neigh_glbl_allocs--; - neigh->tbl->entries--; + atomic_dec(&neigh->tbl->entries); kmem_cache_free(neigh->tbl->kmem_cachep, neigh); } @@ -1394,7 +1399,7 @@ del_timer_sync(&tbl->proxy_timer); pneigh_queue_purge(&tbl->proxy_queue); neigh_ifdown(tbl, NULL); - if (tbl->entries) + if (atomic_read(&tbl->entries)) printk(KERN_CRIT "neighbour leakage\n"); write_lock(&neigh_tbl_lock); for (tp = &neigh_tables; *tp; tp = &(*tp)->next) { @@ -1951,7 +1956,7 @@ seq_printf(seq, "%08x %08lx %08lx %08lx %08lx %08lx %08lx " "%08lx %08lx %08lx %08lx\n", - tbl->entries, + atomic_read(&tbl->entries), st->allocs, st->destroys, --OgqxwSJOaUobr8KG-- From jgarzik@pobox.com Tue Nov 2 04:48:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 04:48:28 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2CmJwR026913 for ; Tue, 2 Nov 2004 04:48:20 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1COy4u-0003TB-2d; Tue, 02 Nov 2004 12:48:00 +0000 Message-ID: <418781EF.7020100@pobox.com> Date: Tue, 02 Nov 2004 07:47:43 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Linux Kernel , Netdev CC: YOSHIFUJI Hideaki , Andrew Morton , "David S. Miller" Subject: IPv6 dead in -bk11 Content-Type: multipart/mixed; boundary="------------090906050700040108000402" X-archive-position: 11343 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: 24377 Lines: 468 This is a multi-part message in MIME format. --------------090906050700040108000402 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit IPv6 works 100% for my workstations in 2.6.10-rc2-bk2, but fails in 2.6.10-rc2-bk11: [jgarzik@sata g]$ ping6 www.kame.net connect: Network is unreachable 100% reproducible on multiple machines (x86, x86-64). Fedora Core 2 userland. The only difference is the kernel, no configuration differences account for this. dmesg and config are attached, but IMO are unlikely to be helpful. Did someone break the IPv6 routing code or something, perhaps? I'll narrow down which -bk snapshot broke IPv6 later on today... Jeff --------------090906050700040108000402 Content-Type: text/plain; name="dmesg.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dmesg.txt" Linux version 2.6.10-rc1-bk11 (jgarzik@sata.yyz.us) (gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)) #1 SMP Tue Nov 2 07:35:27 EST 2004 BIOS-provided physical RAM map: BIOS-e820: 0000000000000000 - 000000000009e000 (usable) BIOS-e820: 000000000009e000 - 00000000000a0000 (reserved) BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 000000003fff0000 (usable) BIOS-e820: 000000003fff0000 - 0000000040000000 (reserved) BIOS-e820: 00000000fec00000 - 0000000100000000 (reserved) Warning only 896MB will be used. Use a HIGHMEM enabled kernel. 896MB LOWMEM available. found SMP MP-table at 000f8d90 On node 0 totalpages: 229376 DMA zone: 4096 pages, LIFO batch:1 Normal zone: 225280 pages, LIFO batch:16 HighMem zone: 0 pages, LIFO batch:1 DMI 2.3 present. ACPI: RSDP (v000 COMPAQ ) @ 0x000e9e10 ACPI: RSDT (v001 COMPAQ CPQ0063 0x20031217 0x00000000) @ 0x000e5640 ACPI: FADT (v001 COMPAQ CANTERW 0x00000001 0x00000000) @ 0x000e56ec ACPI: SSDT (v001 COMPAQ PROJECT 0x00000001 MSFT 0x0100000e) @ 0x000e6579 ACPI: MADT (v001 COMPAQ CANTERW 0x00000001 0x00000000) @ 0x000e5760 ACPI: ASF! (v016 COMPAQ CANTERW 0x00000001 0x00000000) @ 0x000e57c8 ACPI: DSDT (v001 COMPAQ DSDT 0x00000001 MSFT 0x0100000e) @ 0x00000000 ACPI: PM-Timer IO Port: 0xf808 ACPI: Local APIC address 0xfee00000 ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled) Processor #0 15:2 APIC version 20 ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled) Processor #1 15:2 APIC version 20 ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1]) ACPI: LAPIC_NMI (acpi_id[0x02] high edge lint[0x1]) ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0]) IOAPIC[0]: apic_id 1 already used, trying 2 IOAPIC[0]: apic_id 2, version 32, address 0xfec00000, GSI 0-23 ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) ACPI: IRQ0 used by override. ACPI: IRQ2 used by override. ACPI: IRQ9 used by override. Enabling APIC mode: Flat. Using 1 I/O APICs Using ACPI (MADT) for SMP configuration information Built 1 zonelists Kernel command line: ro root=LABEL=/ nogui Initializing CPU#0 PID hash table entries: 4096 (order: 12, 65536 bytes) Detected 2395.070 MHz processor. Using pmtmr for high-res timesource Console: colour VGA+ 80x25 Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) Memory: 904796k/917504k available (2535k kernel code, 12164k reserved, 804k data, 192k init, 0k highmem) Checking if this processor honours the WP bit even in supervisor mode... Ok. Calibrating delay loop... 4734.97 BogoMIPS (lpj=2367488) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) CPU: After generic identify, caps: bfebfbff 00000000 00000000 00000000 CPU: After vendor identify, caps: bfebfbff 00000000 00000000 00000000 CPU: Trace cache: 12K uops, L1 D cache: 8K CPU: L2 cache: 512K CPU: Physical Processor ID: 0 CPU: After all inits, caps: bfebfbff 00000000 00000000 00000080 Intel machine check architecture supported. Intel machine check reporting enabled on CPU#0. CPU0: Intel P4/Xeon Extended MCE MSRs (12) available CPU0: Thermal monitoring enabled Enabling fast FPU save and restore... done. Enabling unmasked SIMD FPU exception support... done. Checking 'hlt' instruction... OK. CPU0: Intel(R) Pentium(R) 4 CPU 2.80GHz stepping 09 per-CPU timeslice cutoff: 1462.31 usecs. task migration cache decay timeout: 2 msecs. Booting processor 1/1 eip 3000 Initializing CPU#1 Calibrating delay loop... 4784.12 BogoMIPS (lpj=2392064) CPU: After generic identify, caps: bfebfbff 00000000 00000000 00000000 CPU: After vendor identify, caps: bfebfbff 00000000 00000000 00000000 CPU: Trace cache: 12K uops, L1 D cache: 8K CPU: L2 cache: 512K CPU: Physical Processor ID: 0 CPU: After all inits, caps: bfebfbff 00000000 00000000 00000080 Intel machine check architecture supported. Intel machine check reporting enabled on CPU#1. CPU1: Intel P4/Xeon Extended MCE MSRs (12) available CPU1: Thermal monitoring enabled CPU1: Intel(R) Pentium(R) 4 CPU 2.80GHz stepping 09 Total of 2 processors activated (9519.10 BogoMIPS). ENABLING IO-APIC IRQs ..TIMER: vector=0x31 pin1=2 pin2=-1 checking TSC synchronization across 2 CPUs: passed. Brought up 2 CPUs CPU0: domain 0: span 3 groups: 1 2 domain 1: span 3 groups: 3 CPU1: domain 0: span 3 groups: 2 1 domain 1: span 3 groups: 3 checking if image is initramfs...it isn't (no cpio magic); looks like an initrd Freeing initrd memory: 137k freed NET: Registered protocol family 16 PCI: Using configuration type 1 mtrr: v2.0 (20020519) ACPI: Subsystem revision 20040816 ACPI: Interpreter enabled ACPI: Using IOAPIC for interrupt routing ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 *11 14 15) ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 *5 6 7 10 11 14 15) ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 *10 11 14 15) ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 10 *11 14 15) ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 7 10 *11 14 15) ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 *5 6 7 10 11 14 15) ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 6 7 10 11 14 15) *0, disabled. ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 6 7 10 *11 14 15) ACPI: PCI Root Bridge [PCI0] (00:00) PCI: Probing PCI hardware (bus 00) PCI: Ignoring BAR0-3 of IDE controller 0000:00:1f.1 PCI: Transparent bridge - 0000:00:1e.0 ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.HUB_._PRT] SCSI subsystem initialized usbcore: registered new driver usbfs usbcore: registered new driver hub PCI: Using ACPI for IRQ routing ACPI: PCI interrupt 0000:00:1d.0[A] -> GSI 16 (level, low) -> IRQ 169 ACPI: PCI interrupt 0000:00:1d.1[B] -> GSI 19 (level, low) -> IRQ 177 ACPI: PCI interrupt 0000:00:1d.2[C] -> GSI 18 (level, low) -> IRQ 185 ACPI: PCI interrupt 0000:00:1d.7[D] -> GSI 23 (level, low) -> IRQ 193 ACPI: PCI interrupt 0000:00:1f.1[A] -> GSI 18 (level, low) -> IRQ 185 ACPI: PCI interrupt 0000:00:1f.2[A] -> GSI 18 (level, low) -> IRQ 185 ACPI: PCI interrupt 0000:00:1f.5[B] -> GSI 17 (level, low) -> IRQ 201 ACPI: PCI interrupt 0000:01:00.0[A] -> GSI 20 (level, low) -> IRQ 209 ACPI: PCI interrupt 0000:05:02.0[A] -> GSI 17 (level, low) -> IRQ 201 ACPI: PCI interrupt 0000:05:0a.0[A] -> GSI 21 (level, low) -> IRQ 217 Machine check exception polling timer started. Initializing Cryptographic API ACPI: Power Button (FF) [PWRF] ACPI: Processor [CPU0] (supports C1, 8 throttling states) ACPI: Processor [CPU1] (supports C1, 8 throttling states) Real Time Clock Driver v1.12 Linux agpgart interface v0.100 (c) Dave Jones agpgart: Detected an Intel i875 Chipset. agpgart: Maximum main memory to use for agp memory: 816M agpgart: AGP aperture is 256M @ 0xe0000000 serio: i8042 AUX port at 0x60,0x64 irq 12 serio: i8042 KBD port at 0x60,0x64 irq 1 Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing enabled ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered elevator: using anticipatory as default io scheduler Floppy drive(s): fd0 is 1.44M FDC 0 is a post-1991 82077 RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize Universal TUN/TAP device driver 1.5 (C)1999-2002 Maxim Krasnyansky Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx ICH5: IDE controller at PCI slot 0000:00:1f.1 PCI: Enabling device 0000:00:1f.1 (0005 -> 0007) ACPI: PCI interrupt 0000:00:1f.1[A] -> GSI 18 (level, low) -> IRQ 185 ICH5: chipset revision 2 ICH5: not 100% native mode: will probe irqs later ide0: BM-DMA at 0x24c0-0x24c7, BIOS settings: hda:DMA, hdb:pio ide1: BM-DMA at 0x24c8-0x24cf, BIOS settings: hdc:DMA, hdd:pio Probing IDE interface ide0... hda: MAXTOR 6L080J4, ATA DISK drive ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 Probing IDE interface ide1... hdc: HL-DT-ST CD-ROM GCR-8480B, ATAPI CD/DVD-ROM drive ide1 at 0x170-0x177,0x376 on irq 15 hda: max request size: 128KiB hda: 156301488 sectors (80026 MB) w/1819KiB Cache, CHS=65535/16/63, UDMA(100) hda: cache flushes supported hda: hda1 hda2 hda3 hda4 < hda5 hda6 > hdc: ATAPI 48X CD-ROM drive, 128kB Cache, DMA Uniform CD-ROM driver Revision: 3.20 ACPI: PCI interrupt 0000:00:1d.7[D] -> GSI 23 (level, low) -> IRQ 193 ehci_hcd 0000:00:1d.7: EHCI Host Controller PCI: Setting latency timer of device 0000:00:1d.7 to 64 ehci_hcd 0000:00:1d.7: irq 193, pci mem 0xf0500000 ehci_hcd 0000:00:1d.7: new USB bus registered, assigned bus number 1 PCI: cache line size of 128 is not supported by device 0000:00:1d.7 ehci_hcd 0000:00:1d.7: USB 2.0 enabled, EHCI 1.00, driver 2004-May-10 hub 1-0:1.0: USB hub found hub 1-0:1.0: 8 ports detected USB Universal Host Controller Interface driver v2.2 hub 1-0:1.0: over-current change on port 7 ACPI: PCI interrupt 0000:00:1d.0[A] -> GSI 16 (level, low) -> IRQ 169 uhci_hcd 0000:00:1d.0: UHCI Host Controller PCI: Setting latency timer of device 0000:00:1d.0 to 64 uhci_hcd 0000:00:1d.0: irq 169, io base 0x2440 uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 2 hub 2-0:1.0: USB hub found hub 2-0:1.0: 2 ports detected ACPI: PCI interrupt 0000:00:1d.1[B] -> GSI 19 (level, low) -> IRQ 177 uhci_hcd 0000:00:1d.1: UHCI Host Controller PCI: Setting latency timer of device 0000:00:1d.1 to 64 uhci_hcd 0000:00:1d.1: irq 177, io base 0x2460 uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 3 hub 3-0:1.0: USB hub found hub 3-0:1.0: 2 ports detected ACPI: PCI interrupt 0000:00:1d.2[C] -> GSI 18 (level, low) -> IRQ 185 uhci_hcd 0000:00:1d.2: UHCI Host Controller PCI: Setting latency timer of device 0000:00:1d.2 to 64 uhci_hcd 0000:00:1d.2: irq 185, io base 0x2480 uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 4 hub 4-0:1.0: USB hub found hub 4-0:1.0: 2 ports detected Initializing USB Mass Storage driver... usbcore: registered new driver usb-storage USB Mass Storage support registered. mice: PS/2 mouse device common for all mice input: AT Translated Set 2 keyboard on isa0060/serio0 input: ImPS/2 Generic Wheel Mouse on isa0060/serio1 input: PC Speaker NET: Registered protocol family 26 NET: Registered protocol family 2 IP: routing cache hash table of 8192 buckets, 64Kbytes TCP: Hash tables configured (established 262144 bind 65536) Initializing IPsec netlink socket NET: Registered protocol family 1 NET: Registered protocol family 10 IPv6 over IPv4 tunneling driver NET: Registered protocol family 17 NET: Registered protocol family 15 p4-clockmod: P4/Xeon(TM) CPU On-Demand Clock Modulation available ACPI: (supports S0 S1 S3 S4 S5) ACPI wakeup devices: PCI0 HUB COM1 COM2 USB1 USB2 USB3 USB4 EUSB PBTN BIOS EDD facility v0.16 2004-Jun-25, 3 devices found RAMDISK: Compressed image found at block 0 VFS: Mounted root (ext2 filesystem). libata version 1.02 loaded. ata_piix version 1.02 ACPI: PCI interrupt 0000:00:1f.2[A] -> GSI 18 (level, low) -> IRQ 185 PCI: Setting latency timer of device 0000:00:1f.2 to 64 ata1: SATA max UDMA/133 cmd 0x24F0 ctl 0x280A bmdma 0x24D0 irq 185 ata2: SATA max UDMA/133 cmd 0x24F8 ctl 0x280E bmdma 0x24D8 irq 185 ata1: dev 0 cfg 49:2f00 82:74eb 83:7fea 84:4023 85:74e9 86:3c02 87:4023 88:203f ata1: dev 0 ATA, max UDMA/100, 160836480 sectors: lba48 ata1: dev 0 configured for UDMA/100 scsi0 : ata_piix ata2: SATA port has no device. scsi1 : ata_piix Vendor: ATA Model: HDS722580VLSA80 Rev: V32O Type: Direct-Access ANSI SCSI revision: 05 SCSI device sda: 160836480 512-byte hdwr sectors (82348 MB) SCSI device sda: drive cache: write back sda: sda1 Attached scsi disk sda at scsi0, channel 0, id 0, lun 0 Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0, type 0 sata_sil version 0.54 ACPI: PCI interrupt 0000:05:0a.0[A] -> GSI 21 (level, low) -> IRQ 217 ata3: SATA max UDMA/100 cmd 0xF8848080 ctl 0xF884808A bmdma 0xF8848000 irq 217 ata4: SATA max UDMA/100 cmd 0xF88480C0 ctl 0xF88480CA bmdma 0xF8848008 irq 217 ata3: dev 0 cfg 49:2f00 82:7c6b 83:7f09 84:4003 85:7c69 86:3e01 87:4003 88:407f ata3: dev 0 ATA, max UDMA/133, 488281250 sectors: lba48 ata3: dev 0 configured for UDMA/100 scsi2 : sata_sil ata4: no device found (phy stat 00000000) scsi3 : sata_sil Vendor: ATA Model: Maxtor 6Y250M0 Rev: YAR5 Type: Direct-Access ANSI SCSI revision: 05 SCSI device sdb: 488281250 512-byte hdwr sectors (250000 MB) SCSI device sdb: drive cache: write back sdb: sdb1 Attached scsi disk sdb at scsi2, channel 0, id 0, lun 0 Attached scsi generic sg1 at scsi2, channel 0, id 0, lun 0, type 0 kjournald starting. Commit interval 5 seconds EXT3-fs: mounted filesystem with ordered data mode. Freeing unused kernel memory: 192k freed EXT3 FS on hda5, internal journal Adding 1020592k swap on /dev/hda2. Priority:-1 extents:1 kjournald starting. Commit interval 5 seconds EXT3 FS on sda1, internal journal EXT3-fs: mounted filesystem with ordered data mode. kjournald starting. Commit interval 5 seconds EXT3 FS on hda3, internal journal EXT3-fs: mounted filesystem with ordered data mode. ip_tables: (C) 2000-2002 Netfilter core team Disabled Privacy Extensions on device c03f5880(lo) tg3.c:v3.11 (October 20, 2004) ACPI: PCI interrupt 0000:05:02.0[A] -> GSI 17 (level, low) -> IRQ 201 eth0: Tigon3 [partno(BCM95700A6) rev 3002 PHY(5705)] (PCI:33MHz:32-bit) 10/100/1000BaseT Ethernet 00:30:6e:4c:04:ac eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] Split[0] WireSpeed[0] TSOcap[1] ip_tables: (C) 2000-2002 Netfilter core team tg3: eth0: Link is up at 1000 Mbps, full duplex. tg3: eth0: Flow control is on for TX and on for RX. Intel 810 + AC97 Audio, version 1.01, 07:31:33 Nov 2 2004 ACPI: PCI interrupt 0000:00:1f.5[B] -> GSI 17 (level, low) -> IRQ 201 PCI: Setting latency timer of device 0000:00:1f.5 to 64 i810: Intel ICH5 found at IO 0x2400 and 0x2000, MEM 0xf0500400 and 0xf0500600, IRQ 201 i810: Intel ICH5 mmio at 0xf8852400 and 0xf8860600 i810_audio: Primary codec has ID 0 i810_audio: Audio Controller supports 6 channels. i810_audio: Defaulting to base 2 channel mode. i810_audio: Resetting connection 0 i810_audio: Connection 0 with codec id 0 ac97_codec: AC97 Audio codec, id: ADS116 (Unknown) i810_audio: AC'97 codec 0 supports AMAP, total channels = 2 --------------090906050700040108000402 Content-Type: application/x-bzip2; name="config.txt.bz2" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="config.txt.bz2" QlpoOTFBWSZTWelTgiIAB2vfgEAQWOf/8j////C////gYB68AAC7dyQOvTNgPqnhPd0k6ZPg AJ7sQqq7G1sXo5HPbo9A8gdSBSlCkpGgd02bPa3l6bBpffd9nvru9zVPJ3a8NCAJlNiBMQQm 1TaCnqb1TZTT0MmJGmmQaaEaAQQmminppJ6QaAAaB6gAANNBJop4TNKnpqfqn6RBo0AaGgAH qDQBJpJIaETI1NR6eqeU9Jpk9QyZGQZD0Iaepkw0RTwRT1PKPU0PRBkxANDym0nig02hNkmE iIEAmSMhNEyjSaBoNAAAAHX5tv/+5E+5qoViil3srHz6whiKiVlRREUYog6tVKJWHuF5wxnb mmVL7msR+P/m/DZn2cDEH2sKiw3JJC022qhgziav/dGbaxxWo/ZvmMX0p2wMO3amZSpUFhUU KMKkxhjFHLRkMSoLjVVRrRiqTGVFiMTKVVYy0GJREStQotlKWnrZcSmkY4iZVi1nfqkM1YKK sUKwLlFmRmJiEKyVvrdRMVqtS2FEJpAlZDGGOMYiJLlmJJiTwcNWC1q2xaMUFhGyk0mMRVcY KsRitCBUkD0oQo4VNbUhkdabkObLlqJtHMKlZdhMwMbiqVGoUHwaplKsFClGnBC7ACzWSlZj UBQgoGIGYtcUHLKypcTGpbccbjiOb5VFMrS0Vqa3vDbWbONHIFzNYZgVaiXTw1RFZq2zWYoi 4VEuNIoJllGGJfwSlj9+EVj1Nz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t4Ho1n/BaTLZEIGvPzv kg9N/3oj9Yo4+yQHf+fj3YAQAGKsS1JWN/Uu/rmv9x1L0Igji21iIErNAYMRIiLqbQjNrPPo MaGHZpNtPDIt3mPn8/5Oa7o/V+3Cl6Jv98mwu7xJ+P0NtJjbXAqvEI/Lr2M33qK7IMgD2crm fB4z3tqxTzsoonke3XXLs8C40zL460Oharfx8d1OwAgA/D2XPIzKe1kiADp9O2dzXMiNc2df IETkIXiYaQBkITEISMMBCgyzWSpDpx+2DWySQAQVeFRYao85Yc3AHuOazStbA/rSKlJVDAWI 5QCVmy8GmcmbunwWEBfhIXjrG9vcf8ioz/rmG/eB0piUpdjBmCbG2wbQbolV0svwfHsFa18+ yj7dl49R+7APLkWREHWMvRQFv/swv5+PWLvMiBERaTv7ujTNWa9FjmzfUgE/8XckU4UJDpU4 IiA= --------------090906050700040108000402-- From yoshfuji@linux-ipv6.org Tue Nov 2 05:53:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 05:53:15 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2Dr7h5029323 for ; Tue, 2 Nov 2004 05:53:07 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id B5C1E33CE5; Tue, 2 Nov 2004 22:53:45 +0900 (JST) Date: Tue, 02 Nov 2004 22:53:43 +0900 (JST) Message-Id: <20041102.225343.06193184.yoshfuji@linux-ipv6.org> To: jgarzik@pobox.com Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, akpm@osdl.org, davem@davemloft.net, yoshfuji@linux-ipv6.org Subject: Re: IPv6 dead in -bk11 From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <418781EF.7020100@pobox.com> References: <418781EF.7020100@pobox.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 11344 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 447 Lines: 19 In article <418781EF.7020100@pobox.com> (at Tue, 02 Nov 2004 07:47:43 -0500), Jeff Garzik says: > > IPv6 works 100% for my workstations in 2.6.10-rc2-bk2, but fails in > 2.6.10-rc2-bk11: > > [jgarzik@sata g]$ ping6 www.kame.net > connect: Network is unreachable Please send me: % ifconfig -a % netstat -nr --inet6 % ip -6 addr % ip -6 route % ip -6 neigh Thanks. --yoshfuji @ still trying to debug refcnt etc.... From yoshfuji@linux-ipv6.org Tue Nov 2 06:01:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 06:01:24 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2E1He2029922 for ; Tue, 2 Nov 2004 06:01:18 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id C23C933CE5; Tue, 2 Nov 2004 23:01:56 +0900 (JST) Date: Tue, 02 Nov 2004 23:01:56 +0900 (JST) Message-Id: <20041102.230156.71928163.yoshfuji@linux-ipv6.org> To: jgarzik@pobox.com Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, akpm@osdl.org, davem@davemloft.net, yoshfuji@linux-ipv6.org Subject: Re: IPv6 dead in -bk11 From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20041102.225343.06193184.yoshfuji@linux-ipv6.org> References: <418781EF.7020100@pobox.com> <20041102.225343.06193184.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-archive-position: 11345 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 644 Lines: 24 In article <20041102.225343.06193184.yoshfuji@linux-ipv6.org> (at Tue, 02 Nov 2004 22:53:43 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > In article <418781EF.7020100@pobox.com> (at Tue, 02 Nov 2004 07:47:43 -0500), Jeff Garzik says: > > > > > IPv6 works 100% for my workstations in 2.6.10-rc2-bk2, but fails in > > 2.6.10-rc2-bk11: > > > > [jgarzik@sata g]$ ping6 www.kame.net > > connect: Network is unreachable > > Please send me: > % ifconfig -a > % netstat -nr --inet6 > % ip -6 addr > % ip -6 route > % ip -6 neigh and, % grep 6_ /proc/slabinfo Thanks. --yoshfuji From hadi@cyberus.ca Tue Nov 2 06:14:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 06:14:14 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2EE80U030575 for ; Tue, 2 Nov 2004 06:14:08 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1COzPx-0002Go-0H for netdev@oss.sgi.com; Tue, 02 Nov 2004 09:13:49 -0500 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1COzPt-00050Q-Oi; Tue, 02 Nov 2004 09:13:45 -0500 Subject: Re: [NET] Fix neighbour tbl->entries race From: jamal Reply-To: hadi@cyberus.ca To: Herbert Xu Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <20041102112651.GA8633@gondor.apana.org.au> References: <20041102112651.GA8633@gondor.apana.org.au> Content-Type: text/plain Organization: jamalopolous Message-Id: <1099404823.1021.15.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 02 Nov 2004 09:13:43 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 11346 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: 823 Lines: 29 On Tue, 2004-11-02 at 06:26, Herbert Xu wrote: > Hi Dave: > > This patch turns neigh_table's entries counter into an atomic_t. This > is needed since tbl->entries is updated with no locks held. This is > no big deal in practice since it'll be off by a few entries at most > which is way less than any of the neighbour thresholds. > Is this still the same logic: ------------- - if (!neigh_forced_gc(tbl) && - tbl->entries > tbl->gc_thresh3) - goto out; + neigh_forced_gc(tbl); + if (atomic_read(&tbl->entries) > tbl->gc_thresh3) + goto out_entries; ------- In previous code it seems you should short-circuit if neigh_forced_gc(tbl) returns non-zero. why do you have to break that if statement? cheers, jamal From jgarzik@pobox.com Tue Nov 2 07:17:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 07:17:35 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2FHSfu000354 for ; Tue, 2 Nov 2004 07:17:28 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CP0PF-0007Tv-O4; Tue, 02 Nov 2004 15:17:10 +0000 Message-ID: <4187A4E3.8010600@pobox.com> Date: Tue, 02 Nov 2004 10:16:51 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: YOSHIFUJI Hideaki CC: jgarzik@pobox.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, akpm@osdl.org, davem@davemloft.net Subject: Re: IPv6 dead in -bk11 References: <418781EF.7020100@pobox.com> <20041102.225343.06193184.yoshfuji@linux-ipv6.org> In-Reply-To: <20041102.225343.06193184.yoshfuji@linux-ipv6.org> Content-Type: multipart/mixed; boundary="------------040207000109040401090605" X-archive-position: 11347 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: 6128 Lines: 112 This is a multi-part message in MIME format. --------------040207000109040401090605 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit YOSHIFUJI Hideaki / å‰è—¤è‹±æ˜Ž wrote: > In article <418781EF.7020100@pobox.com> (at Tue, 02 Nov 2004 07:47:43 -0500), Jeff Garzik says: > > >>IPv6 works 100% for my workstations in 2.6.10-rc2-bk2, but fails in >>2.6.10-rc2-bk11: >> >> [jgarzik@sata g]$ ping6 www.kame.net >> connect: Network is unreachable > > > Please send me: > % ifconfig -a > % netstat -nr --inet6 > % ip -6 addr > % ip -6 route > % ip -6 neigh > > Thanks. > > --yoshfuji @ still trying to debug refcnt etc.... Done, see attached. ipv6/working/* is 2.6.10-rc1-bk2, and ipv6/dead/* is 2.6.10-rc1-BK-current. Jeff --------------040207000109040401090605 Content-Type: application/x-bzip2; name="ipv6-output.tar.bz2" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="ipv6-output.tar.bz2" QlpoOTFBWSZTWVsMlwUAI1N/3P//wjb8Z//1P//fyP////gEAAACIAACBgAIYBJ+e+0WeJEQ ndJBbLdveecWrXZvTruvYztd7uvdu9Vdj3nuqklUTvbTmmpSQCSmqeRomptT0ZTyRqNPUGgD QGQbUAAAABoADyglAmgRNEJ6pk0aAAZAANA0AAAB6Q0AAcDQNANA0NABoZDTQA00A0AAZDEA BoJCQRJlJ+hNNJ6mmjRo0A0ADINAAAAAAACKQRoCJkATVP0p+mST8kQDR+pGEaB6nqAepptR 6nqaABgVJE0IBDIk/QIk1D9U9R6mPUTMpoA0GgZPUBo9QYIB858iuf9AeykHaB3sBMqQ3KxI CAAi8EF6VIAO/u7oi0pxPviRS4AqDiwK18xX2yoZqS98iSSstLX5DWXVTCAEUJJgkB9JuSWV BURQFRESXqCVVUVUBAhBAwQgSgBZMIsoVMvYaFKnpLY+ZophZ9KkuoZJknc6LJkUf5Mew5tr NwUW3msSZs2RdSiOCiPu0iypHSgYSVGqGYUiCG1k5OLiw0GBRV0VhAEThPeLiaoohVSZYLiG HGQ8sooN20jhI735caSvMxjo5l4YsYyXto4zLxWIXY1WXVXq1K1OJ3ip03StArD3UlyiS1Vc Uqyt6J9GILOxcVWHHAyWy+Fri0WzhgxIuCbLZsYrS9JpkWwqqiioqQDKKKYwvG2KZWapUQlJ GcVCg85ml9L3uzSo23EucEAvY0oPxEWjewjY2SSOEajI2QQRxjkRGARDUZBtuMiHHExsza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JubPDaudij2J83 d05z9J0XTeDUHAnsnqbBNhCgurF4MXcnB7xGpvUNFPfKkaSJ7xgmGY3wPRwRrPvLnadH4Sw+ VUH7TZnnOr2hdNp+Wu5tbZqlRmfOpYuTl8FLmZtM3q7lipuHyKT68yyPEO2RBC/6FenylGxH akTJfSOpBzRJaUI4KKBJqUsYMq+PTcHUdKgZUHgmPcZ3nIZPtCvDZX17RDwa8QPKBiZusrnV S7BkYugljELmDck8UEUi0Zf5n0Z92H9v6NqTyyb5ciwUTX3pWbD5HJCxpL/yvGcgeUVvDsRg bwkQZvgeVoLouDd1ly6qIERsmrHYuhAEP9O73YZvaEado1FQlWdwNy/DfsMRvcyZAwOhAp+w 8xj9TPvdx5tsomc1OLcvteGE9VGCWwvQaIu0yKkpLGQsk5cGev3mqtUttyrYv6NY8VLwfKwt NCob6RTnYU2b3swDRK5/ccZm6uo3UR7PbBkFbcO+9+GPppGHONI5TeByHMK6uoQVA1fxs2Cb 9wON+I+/JkTZq8m/KNPgsnBO4na4rviTTO8t8VNCXdnTLVpKJxJi3Tf1s8PtORxFnpS/AHUa Tklx0EK7TYXce05CLGpXPUlznJOTkRvMkoUlFrS3LclTljTd3kZmg0Mt40OBsBiVUC8dt9Vz czVaag3gBJdQ0yay4LxkMKpiDAZuAsUFZiWtZf1tISc4Sjmo7kwTQsS9qilKTh8cRhdU4E37 R2+g+H1/H4RKdRy6CXFDpkPdM44EeCySi41FV7+06QbjfI7UHEJ4HQGHSrylTWVn7SeZ3Vks p1Mlj3Lis3RgwTR7Xpi5bLMBwbsB22syunFrTV+oTYJn+N3Y4liptKpGBwF+CgWaRIW83ouo qtzaQ+wHBF8ZyuRwOQHeJVmZtS8VWcEC8xAWB2QaSPnVgeHNF+QeNQ8pMNPmG4vGgkA7jPLx INTZdh0rnfMrizMNsYNRCB29Nszl4QclG4V6lV+gXckU4UJBbDJcFA== --------------040207000109040401090605-- From johnpol@2ka.mipt.ru Tue Nov 2 07:56:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 07:56:35 -0800 (PST) Received: from mailer.campus.mipt.ru (mailer.campus.mipt.ru [194.85.82.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2FuPW4003233 for ; Tue, 2 Nov 2004 07:56:25 -0800 Received: from ffke-campus-gw.mipt.ru (2ka [194.85.82.65]) by mailer.campus.mipt.ru (8.13.1/8.13.1) with ESMTP id iA2Fu4IV032013; Tue, 2 Nov 2004 18:56:04 +0300 Received: from zanzibar.2ka.mipt.ru (zanzibar.2ka.mipt.ru [194.85.82.77]) by ffke-campus-gw.mipt.ru (8.12.11/8.12.11) with SMTP id iA2FIPj1009177; Tue, 2 Nov 2004 18:18:25 +0300 Date: Tue, 2 Nov 2004 18:24:15 +0300 From: Evgeniy Polyakov To: jamal , James Morris , Michal Ludvig Cc: netdev@oss.sgi.com, cryptoapi@lists.logix.cz Subject: Re: Asynchronous crypto layer. Message-ID: <20041102182415.61f5e8a4@zanzibar.2ka.mipt.ru> In-Reply-To: <1099030958.4944.148.camel@uganda> References: <1099030958.4944.148.camel@uganda> Organization: MIPT X-Mailer: Sylpheed-Claws 0.9.12b (GTK+ 1.2.10; i386-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Tue__2_Nov_2004_18_24_15_+0300_SHM75zEMLqjdT6mC" X-archive-position: 11349 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnpol@2ka.mipt.ru Precedence: bulk X-list: netdev Content-Length: 20610 Lines: 831 This is a multi-part message in MIME format. --Multipart=_Tue__2_Nov_2004_18_24_15_+0300_SHM75zEMLqjdT6mC Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Here we go. Numbers. Actually nothing excitement: since ecryption/decryption was made in a one thread (please see dirty hack in sync_provider.c:89 to allow crypto_cipher_{en,de}crypt() work in _bh context, BUG() in crypto_yeld() can be reproduced by removing hack). UP with HT badly broken Xeon(800 mhz) 2 parallel running scripts: rnd=$RANDOM file=/mnt/$rnd for ((i=0; i<20; ++i)); do echo -en "." dd if=/dev/zero of=$file bs=1M count=40 > /dev/null 2>&1 rm -f $file done echo Pure sync mode: 0.07user 14.87system 0:16.49elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+6840minor)pagefaults 0swaps Pseudo async mode(data ecnryption/decryption is done synchronous thread, only pre/post processing is asynchronous): 0.08user 11.66system 0:17.03elapsed 68%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (0major+6870minor)pagefaults 0swaps Attached synchronous and asynchronous crypto providers and purely in-memory block device. Usage: Async mode: cd crypto sudo ./i cd ../block sudo ./i term1$ sudo time ./start term2$ sudo time ./start Sync mode: cd block sudo ./r cd ../crypto sudo ./r cd ../block sudo ./i 1 term1$ sudo time ./start term2$ sudo time ./start I will send updated asynchronous crypto patch in a next e-mail. Evgeniy Polyakov Only failure makes us experts. -- Theo de Raadt --Multipart=_Tue__2_Nov_2004_18_24_15_+0300_SHM75zEMLqjdT6mC Content-Type: text/x-csrc; name="async_provider.c" Content-Disposition: attachment; filename="async_provider.c" Content-Transfer-Encoding: 7bit /* * async_provider.c * * Copyright (c) 2004 Evgeniy Polyakov * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include "../crypto/acrypto.h" #include "../crypto/crypto_stat.h" #include "../crypto/crypto_def.h" static void prov_data_ready(struct crypto_device *); static void async_callback(struct crypto_session_initializer *, struct crypto_data *); static struct crypto_capability prov_caps[] = { {CRYPTO_OP_ENCRYPT, CRYPTO_TYPE_AES_128, CRYPTO_MODE_ECB, 10000}, {CRYPTO_OP_DECRYPT, CRYPTO_TYPE_AES_128, CRYPTO_MODE_ECB, 10000}, }; static int prov_cap_number = sizeof(prov_caps)/sizeof(prov_caps[0]); static struct completion thread_exited; static DECLARE_WAIT_QUEUE_HEAD(async_wait_queue); static int need_exit; static struct crypto_tfm *tfm; static char async_algo[] = "aes"; static char async_key[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}; static struct crypto_session_initializer ci = { .operation = CRYPTO_OP_ENCRYPT, .mode = CRYPTO_MODE_ECB, .type = CRYPTO_TYPE_AES_128, .callback = async_callback, }; static struct crypto_device pdev = { .name = "async_provider", .data_ready = prov_data_ready, .cap = &prov_caps[0], }; static void async_callback(struct crypto_session_initializer *ci, struct crypto_data *data) { struct request *req = data->priv; dprintk("%s: req=%p, req->q=%p.\n", __func__, req, req->q); (unsigned long)req->special--; if ((unsigned long)req->special == 0 && req->q) { spinlock_t *l = req->q->queue_lock; dprintk("Finishing request for req=%p [%lu].\n", req, (unsigned long)req->special); spin_lock_irq(l); (unsigned long)req->special = 0; if (!end_that_request_first(req, 1, req->nr_sectors)); end_that_request_last(req); spin_unlock_irq(l); } } static __inline__ void async_prepare(struct crypto_data *data, void *src, void *dst, unsigned long size, void *priv) { struct request *req = priv; (unsigned long)req->special++; dprintk("%s: req=%p, refcnt=%lu.\n", __func__, req, (unsigned long)req->special); data->sg_src.page = virt_to_page(src); data->sg_src.offset = offset_in_page(src); data->sg_src.length = size; data->sg_dst.page = virt_to_page(dst); data->sg_dst.offset = offset_in_page(dst); data->sg_dst.length = size; data->sg_key.page = virt_to_page(async_key); data->sg_key.offset = offset_in_page(async_key); data->sg_key.length = sizeof(async_key); data->priv = priv; data->priv_size = 0; } void bd_encrypt(void *src, void *dst, u64 size, void *priv) { struct crypto_data data; struct crypto_session *sp; async_prepare(&data, src, dst, size, priv); ci.operation = CRYPTO_OP_ENCRYPT; sp = crypto_session_alloc(&ci, &data); BUG_ON(!sp); wake_up_interruptible(&async_wait_queue); } void bd_decrypt(void *src, void *dst, u64 size, void *priv) { struct crypto_data data; struct crypto_session *sp; async_prepare(&data, src, dst, size, priv); ci.operation = CRYPTO_OP_DECRYPT; sp = crypto_session_alloc(&ci, &data); BUG_ON(!sp); wake_up_interruptible(&async_wait_queue); } static void prov_data_ready(struct crypto_device *dev) { wake_up_interruptible(&async_wait_queue); } static int async_thread(void *data) { struct crypto_device *dev = (struct crypto_device *)data; struct crypto_session *s, *n; daemonize("%s", dev->name); allow_signal(SIGTERM); while (!need_exit) { int num, pnum; interruptible_sleep_on_timeout(&async_wait_queue, 100); if (need_exit) break; num = pnum = 0; list_for_each_entry_safe(s, n, &dev->session_list, dev_queue_entry) { num++; if (session_completed(s)) continue; pnum++; start_process_session(s); if (s->ci.operation == CRYPTO_OP_ENCRYPT) crypto_cipher_encrypt(tfm, &s->data.sg_dst, &s->data.sg_src, s->data.sg_src.length); else crypto_cipher_decrypt(tfm, &s->data.sg_dst, &s->data.sg_src, s->data.sg_src.length); dprintk("%lu: Completing session %llu [%llu] in %s.\n", jiffies, s->ci.id, s->ci.dev_id, pdev.name); crypto_stat_complete_inc(s); complete_session(s); stop_process_session(s); } dprintk("%lu: %s: %d sessions, %d processed.\n", jiffies, dev->name, num, pnum); } complete_and_exit(&thread_exited, 0); } int prov_init(void) { int err, pid; tfm = crypto_alloc_tfm(async_algo, 0); if (!tfm) { dprintk(KERN_ERR "Failed to allocate %s tfm.\n", async_algo); return -EINVAL; } err = crypto_cipher_setkey(tfm, async_key, sizeof(async_key)); if (err) { dprintk("Failed to set key [keylen=%d]: err=%d.\n", sizeof(async_key), err); goto err_out_free_tfm; } init_completion(&thread_exited); pid = kernel_thread(async_thread, &pdev, CLONE_FS | CLONE_FILES); if (IS_ERR((void *)pid)) { err = -EINVAL; dprintk(KERN_ERR "Failed to create kernel load balancing thread.\n"); goto err_out_free_tfm; } pdev.cap_number = prov_cap_number; err = crypto_device_add(&pdev); if (err) goto err_out_remove_thread; dprintk(KERN_INFO "Test crypto provider module %s is loaded.\n", pdev.name); return 0; err_out_remove_thread: need_exit = 1; wake_up(&async_wait_queue); wait_for_completion(&thread_exited); err_out_free_tfm: crypto_free_tfm(tfm); return err; } void prov_fini(void) { need_exit = 1; wake_up(&async_wait_queue); wait_for_completion(&thread_exited); crypto_device_remove(&pdev); crypto_free_tfm(tfm); dprintk(KERN_INFO "Test crypto provider module %s is unloaded.\n", pdev.name); } module_init(prov_init); module_exit(prov_fini); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Evgeniy Polyakov "); MODULE_DESCRIPTION("Test crypto module provider."); EXPORT_SYMBOL(bd_encrypt); EXPORT_SYMBOL(bd_decrypt); --Multipart=_Tue__2_Nov_2004_18_24_15_+0300_SHM75zEMLqjdT6mC Content-Type: application/octet-stream; name="Makefile" Content-Disposition: attachment; filename="Makefile" Content-Transfer-Encoding: base64 b2JqLW0JCTo9IGJkLm8KCktESVIJOj0gL2xpYi9tb2R1bGVzLyQoc2hlbGwgdW5hbWUgLXIpL2J1 aWxkCiNLRElSCTo9IC91c3IvbG9jYWwvc3JjL2xpbnV4LTIuNi9saW51eC0yLjYKUFdECTo9ICQo c2hlbGwgcHdkKQoKZGVmYXVsdDoKCSQoTUFLRSkgLUMgJChLRElSKSBTVUJESVJTPSQoUFdEKSBt b2R1bGVzCgpjbGVhbjoKCXJtIC1mICoubyAqLmtvICoubW9kLiogLiouY21kICp+CglybSAtcmYg LnRtcF92ZXJzaW9ucwo= --Multipart=_Tue__2_Nov_2004_18_24_15_+0300_SHM75zEMLqjdT6mC Content-Type: text/x-csrc; name="bd.c" Content-Disposition: attachment; filename="bd.c" Content-Transfer-Encoding: 7bit /* * bd.c * * Copyright (c) 2004 Evgeniy Polyakov * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include //#define BD_DEBUG #ifdef BD_DEBUG #define dprintk(f, a...) printk(KERN_EMERG f, ##a) #else #define dprintk(f, a...) do {} while(0) #endif #define BD_READ 0 #define BD_WRITE 1 static char bd_name[] = "bd"; static unsigned int bd_major = 123; module_param(bd_major, uint, 0); static unsigned int bd_sector_size = 512; module_param(bd_sector_size, uint, 0); static unsigned int bd_max_request_size = 1024*1024*50; module_param(bd_max_request_size, uint, 0); static int sync_mode = 0; module_param(sync_mode, uint, 0); static void *bd_request_data; static spinlock_t bd_lock = SPIN_LOCK_UNLOCKED; static struct gendisk *bd_disk; static unsigned long req_counter = 1; extern void bd_encrypt(void *src, void *dst, u64 size, void *priv); extern void bd_decrypt(void *src, void *dst, u64 size, void *priv); static int bd_ioctl(struct inode *, struct file *, unsigned int, unsigned long); static struct block_device_operations bd_fops = { .owner = THIS_MODULE, .ioctl = bd_ioctl, }; static int bd_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { dprintk("%s: cmd=%u, arg=%ld.\n", __func__, cmd, arg); return 0; } static int bd_process_data(int cmd, void *buf, u64 off, u64 size, void *priv) { if (size > bd_max_request_size) { dprintk("Too big size %llu, setting to %u.\n", size, bd_max_request_size); size = bd_max_request_size; } if (off + size > bd_max_request_size) { dprintk("Too big size %llu or offset %llu, exiting.\n", size, off); size = bd_max_request_size; } switch (cmd) { case BD_READ: bd_decrypt(((char *)bd_request_data) + off, buf, size, priv); break; case BD_WRITE: bd_encrypt(buf, ((char *)bd_request_data) + off, size, priv); break; } dprintk("%s finished cmd=%s, size=%llu, off=%llu.\n", __func__, (cmd == BD_WRITE)?"WRITE":"READ", size, off); return 0; } static __inline__ int bd_process_bvec(int cmd, struct bio_vec *bvec, u64 off, void *priv) { int err; char *kaddr; void *buf; u64 size; kaddr = page_address(bvec->bv_page); buf = kaddr + bvec->bv_offset; size = bvec->bv_len; err = bd_process_data(cmd, buf, off, size, priv); return err; } static void bd_request(request_queue_t * q) { struct request *req; u64 size, off; int err, cmd, bad_bio; struct bio *bio; while ((req = elv_next_request(q)) != NULL) { blkdev_dequeue_request(req); (unsigned long)req->special = 0; off = req->sector * bd_sector_size; size = req->nr_sectors * bd_sector_size; cmd = (rq_data_dir(req) == 1)?BD_WRITE:BD_READ; dprintk("%s: TRANSFER: req=%p [%lu], cmd=%s, off=%llu [sector=%llu], size=%llu [nr_sectors=%lu], flags=%lx.\n", bd_name, req, (unsigned long)req->special, (cmd == BD_WRITE)?"WRITE":"READ", off, req->sector, size, req->nr_sectors, req->flags); bad_bio = 0; if (!(req->flags & REQ_CMD)) { dprintk("%s: wrong command.\n", bd_name); goto err_out_wrong_command; } rq_for_each_bio(bio, req) { struct bio_vec *bvec; int i; dprintk("BIO: bi_size=%u, bvec=%p.\n", bio->bi_size, bio->bi_io_vec); if (!bio->bi_size || !bio->bi_io_vec) { bad_bio = 1; continue; } bio_for_each_segment(bvec, bio, i) { dprintk("%s: i=%d, req=%p, size=%d.\n", bd_disk->disk_name, i, req, bvec->bv_len); err = bd_process_bvec(cmd, bvec, off, req); if (err) { bad_bio = 1; continue; } off += bvec->bv_len; size -= bvec->bv_len; } /* * bio->bi_end_io = NULL; * bio_endio(bio, bio->bi_size, (bad_bio)?-EIO:0); */ } dprintk("cmd=%s has been processed: err=%d\n", (cmd == BD_WRITE)?"WRITE":"READ", req->errors); err_out_wrong_command: if (sync_mode) { if (!end_that_request_first(req, (bad_bio)?0:1, req->nr_sectors)); end_that_request_last(req); } } } static void bd_setup(struct gendisk *d) { request_queue_t *q; d->major = bd_major; d->first_minor = 0; d->fops = &bd_fops; d->private_data = NULL; d->flags = GENHD_FL_SUPPRESS_PARTITION_INFO; sprintf(d->disk_name, "%s%d", bd_name, 0); q = d->queue; blk_queue_hardsect_size(q, bd_sector_size); set_capacity(d, bd_max_request_size/bd_sector_size); add_disk(d); } int __devinit bd_init(void) { int err; bd_request_data = vmalloc(bd_max_request_size); if (!bd_request_data) { dprintk("Failed to allocate %d bytes for %s requests.\n", bd_max_request_size, bd_name); return -ENOMEM; } err = register_blkdev(bd_major, bd_name); if (err) { dprintk("Failed to register blkdev with major %u: err=%d.\n", bd_major, err); return err; } bd_disk = alloc_disk(1); if (!bd_disk) { dprintk("Failed to allocate a disk.\n"); goto err_out_unregister_blkdev; } bd_disk->queue = blk_init_queue(bd_request, &bd_lock); if (!bd_disk->queue) { dprintk("Failed to initialize blk queue: err=%d.\n", err); goto err_out_free_disk; } bd_setup(bd_disk); dprintk("%s has beed successfully added.\n", bd_name); return 0; err_out_free_disk: put_disk(bd_disk); err_out_unregister_blkdev: unregister_blkdev(bd_major, "bd"); vfree(bd_request_data); return -EINVAL; } void __devexit bd_fini(void) { del_gendisk(bd_disk); blk_cleanup_queue(bd_disk->queue); put_disk(bd_disk); unregister_blkdev(bd_major, "bd"); vfree(bd_request_data); dprintk("%s has beed successfully removed.\n", bd_name); } module_init(bd_init); module_exit(bd_fini); MODULE_AUTHOR("Evgeniy Polyakov "); MODULE_LICENSE("GPL"); --Multipart=_Tue__2_Nov_2004_18_24_15_+0300_SHM75zEMLqjdT6mC Content-Type: application/octet-stream; name="i" Content-Disposition: attachment; filename="i" Content-Transfer-Encoding: base64 IyEvYmluL3NoCgpudW09JCMKCmRldl9maWxlPS9kZXYvYmQwCnN5bmNfbW9kZT0wOwoKaWYgWyAk bnVtICE9IDAgXTsgdGhlbgoJc3luY19tb2RlPSQxCmZpCgppZiBbICRzeW5jX21vZGUgIT0gMCBd OyB0aGVuCglpbnNtb2QgLi9zeW5jX3Byb3ZpZGVyLmtvCmVsc2UKCWluc21vZCAuL2FzeW5jX3By b3ZpZGVyLmtvCmZpCmluc21vZCAuL2JkLmtvIHN5bmNfbW9kZT0kc3luY19tb2RlCgppZiBbICEg LWYgJGRldl9maWxlIF07IHRoZW4KCW1rbm9kICRkZXZfZmlsZSBiIDEyMyAwCmZpCgpta2ZzLmV4 dDIgJGRldl9maWxlCm1vdW50ICRkZXZfZmlsZSAvbW50Cg== --Multipart=_Tue__2_Nov_2004_18_24_15_+0300_SHM75zEMLqjdT6mC Content-Type: application/octet-stream; name="r" Content-Disposition: attachment; filename="r" Content-Transfer-Encoding: base64 ZGV2X2ZpbGU9L2Rldi9iZDAKCnVtb3VudCAvbW50CnJtbW9kIGJkCnJtbW9kIGFzeW5jX3Byb3Zp ZGVyCnJtbW9kIHN5bmNfcHJvdmlkZXIK --Multipart=_Tue__2_Nov_2004_18_24_15_+0300_SHM75zEMLqjdT6mC Content-Type: text/x-csrc; name="sync_provider.c" Content-Disposition: attachment; filename="sync_provider.c" Content-Transfer-Encoding: 7bit /* * sync_provider.c * * Copyright (c) 2004 Evgeniy Polyakov * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include #include //#define SYNC_DEBUG #ifdef SYNC_DEBUG #define dprintk(f, a...) printk(KERN_EMERG f, ##a) #else #define dprintk(f, a...) do {} while(0) #endif #define OP_ENCRYPT 0 #define OP_DECRYPT 1 static char sync_algo[] = "aes"; static char sync_key[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}; static struct crypto_tfm *tfm; void bd_encrypt(void *src, void *dst, u64 size, void *priv) { struct scatterlist s, d; s.page = virt_to_page(src); s.offset = offset_in_page(src); s.length = size; d.page = virt_to_page(dst); d.offset = offset_in_page(dst); d.length = size; /* * A hack to fool crypto layer - it thinks that we can sleep here... * Sigh. * * preempt_count() |= SOFTIRQ_MASK; */ preempt_count() |= SOFTIRQ_MASK; crypto_cipher_encrypt(tfm, &d, &s, size); preempt_count() &= ~SOFTIRQ_MASK; } void bd_decrypt(void *src, void *dst, u64 size, void *priv) { struct scatterlist s, d; s.page = virt_to_page(src); s.offset = offset_in_page(src); s.length = size; d.page = virt_to_page(dst); d.offset = offset_in_page(dst); d.length = size; /* * A hack to fool crypto layer - it thinks that we can sleep here... * Sigh. * * preempt_count() |= SOFTIRQ_MASK; */ preempt_count() |= SOFTIRQ_MASK; crypto_cipher_decrypt(tfm, &d, &s, size); preempt_count() &= ~SOFTIRQ_MASK; } int __devinit sync_init(void) { int err; err = -ENODEV; tfm = crypto_alloc_tfm(sync_algo, 0); if (!tfm) { dprintk("Failed to allocate %s tfm.\n", sync_algo); goto err_out_exit; } err = crypto_cipher_setkey(tfm, sync_key, sizeof(sync_key)); if (err) { dprintk("Failed to set key [keylen=%d]: err=%d.\n", sizeof(sync_key), err); goto err_out_free_tfm; } return 0; err_out_free_tfm: crypto_free_tfm(tfm); err_out_exit: return err; } void __devexit sync_fini(void) { crypto_free_tfm(tfm); } module_init(sync_init); module_exit(sync_fini); MODULE_AUTHOR("Evgeniy Polyakov "); MODULE_LICENSE("GPL"); EXPORT_SYMBOL(bd_encrypt); EXPORT_SYMBOL(bd_decrypt); --Multipart=_Tue__2_Nov_2004_18_24_15_+0300_SHM75zEMLqjdT6mC Content-Type: application/octet-stream; name="start" Content-Disposition: attachment; filename="start" Content-Transfer-Encoding: base64 cm5kPSRSQU5ET00KZmlsZT0vbW50LyRybmQKCmZvciAoKGk9MDsgaTwyMDsgKytpKSk7IGRvCgll Y2hvIC1lbiAiLiIKCWRkIGlmPS9kZXYvemVybyBvZj0kZmlsZSBicz0xTSBjb3VudD00MCA+IC9k ZXYvbnVsbCAyPiYxCglybSAtZiAkZmlsZQpkb25lCmVjaG8K --Multipart=_Tue__2_Nov_2004_18_24_15_+0300_SHM75zEMLqjdT6mC-- From johnpol@2ka.mipt.ru Tue Nov 2 07:56:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 07:56:32 -0800 (PST) Received: from mailer.campus.mipt.ru (mailer.campus.mipt.ru [194.85.82.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2FuMv3003229 for ; Tue, 2 Nov 2004 07:56:24 -0800 Received: from ffke-campus-gw.mipt.ru (2ka [194.85.82.65]) by mailer.campus.mipt.ru (8.13.1/8.13.1) with ESMTP id iA2Fu6Dn032017; Tue, 2 Nov 2004 18:56:06 +0300 Received: from zanzibar.2ka.mipt.ru (zanzibar.2ka.mipt.ru [194.85.82.77]) by ffke-campus-gw.mipt.ru (8.12.11/8.12.11) with SMTP id iA2FIZ2u009318; Tue, 2 Nov 2004 18:18:35 +0300 Date: Tue, 2 Nov 2004 19:12:35 +0300 From: Evgeniy Polyakov To: jamal , James Morris , Michal Ludvig Cc: netdev@oss.sgi.com, cryptoapi@lists.logix.cz Subject: Re: Asynchronous crypto layer. Message-ID: <20041102191235.609efde6@zanzibar.2ka.mipt.ru> In-Reply-To: <1099030958.4944.148.camel@uganda> References: <1099030958.4944.148.camel@uganda> Organization: MIPT X-Mailer: Sylpheed-Claws 0.9.12b (GTK+ 1.2.10; i386-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Tue__2_Nov_2004_19_12_35_+0300_L9m.J=UR4DueZh+G" X-archive-position: 11348 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: johnpol@2ka.mipt.ru Precedence: bulk X-list: netdev Content-Length: 126797 Lines: 1667 This is a multi-part message in MIME format. --Multipart=_Tue__2_Nov_2004_19_12_35_+0300_L9m.J=UR4DueZh+G Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit This patch implements several features discussed previously: - crypto_session_alloc() split. I did not change crypto_session_alloc() name, but added struct crypto_session *crypto_session_create( struct crypto_initizlier *, struct crypto_data *) and void crypto_session_add(struct crypto_session *s); Thus now we have timeslice for crypto routing manipulations. - Added per crypto_initializer ptime and scomp fields. The former is total time sessions with given crypto_initializer being processed, it is in jifies. The latter is total number of session with given crypto_initializer already have been processed. Sum of all scomp above is equal to dev->stat.scompleted - total number io completed sessions in given device. - Added crypto_wake_lb() call - this function is called when device finishes session processing(by calling stop_process_session()). It wakes crypto_lb_thread() which efficiently reduces latancies. - Added struct crypto_data * parameter into crypto_lb_find_device(). Load balancer now has ability to select device based not only on device's capabilities, but on packet's characteristics too. - If none crypto load balancer registered yet, then just return NULL from crypto_session_{create,alloc}(), not BUG_ON(). Evgeniy Polyakov Only failure makes us experts. -- Theo de Raadt --Multipart=_Tue__2_Nov_2004_19_12_35_+0300_L9m.J=UR4DueZh+G Content-Type: application/octet-stream; name="crypto.patch" Content-Disposition: attachment; filename="crypto.patch" Content-Transfer-Encoding: base64 ZGlmZiAtTnJ1IC90bXAvZW1wdHkvS2NvbmZpZyBsaW51eC0yLjYvZHJpdmVycy9hY3J5cHRvL0tj b25maWcKLS0tIC90bXAvZW1wdHkvS2NvbmZpZwkxOTcwLTAxLTAxIDAzOjAwOjAwLjAwMDAwMDAw MCArMDMwMAorKysgbGludXgtMi42L2RyaXZlcnMvYWNyeXB0by9LY29uZmlnCTIwMDQtMTAtMzAg MTI6MzI6NTMuMDAwMDAwMDAwICswNDAwCkBAIC0wLDAgKzEsMTUgQEAKK21lbnUgIkFzeW5jaHJv bm91cyBjcnlwdG8gbGF5ZXIiCisKK2NvbmZpZyBBQ1JZUFRPCisJdHJpc3RhdGUgIkFzeW5jaHJv bm91cy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3RhYlsyNTZd Oworc3RhdGljIHU4IHNieF90YWJbMjU2XTsKK3N0YXRpYyB1OCBpc2JfdGFiWzI1Nl07CitzdGF0 aWMgdTMyIHJjb190YWJbMTBdOworc3RhdGljIHUzMiBmdF90YWJbNF1bMjU2XTsKK3N0YXRpYyB1 MzIgaXRfdGFiWzRdWzI1Nl07CisKK3N0YXRpYyB1MzIgZmxfdGFiWzRdWzI1Nl07CitzdGF0aWMg dTMyIGlsX3RhYls0XVsyNTZdOworCitzdGF0aWMgaW5saW5lIHU4CitmX211bHQgKHU4IGEsIHU4 IGIpCit7CisJdTggYWEgPSBsb2dfdGFiW2FdLCBjYyA9IGFhICsgbG9nX3RhYltiXTsKKworCXJl dHVybiBwb3dfdGFiW2NjICsgKGNjIDwgYWEgPyAxIDogMCldOworfQorCisjZGVmaW5lIGZmX211 bHQoYSxiKSAgICAoYSAmJiBiID8gZl9tdWx0KGEsIGIpIDogMCkKKworI2RlZmluZSBmX3JuKGJv LCBiaSwgbiwgaykJCQkJCVwKKyAgICBib1tuXSA9ICBmdF90YWJbMF1bYnl0ZShiaVtuXSwwKV0g XgkJCQlcCisgICAgICAgICAgICAgZnRfdGFiWzFdW2J5dGUoYmlbKG4gKyAxKSAmIDNdLDEpXSBe CQlcCisgICAgICAgICAgICAgZnRfdGFiWzJdW2J5dGUoYmlbKG4gKyAyKSAmIDNdLDIpXSBeCQlc CisgICAgICAgICAgICAgZnRfdGFiWzNdW2J5dGUoYmlbKG4gKyAzKSAmIDNdLDMpXSBeICooayAr IG4pCisKKyNkZWZpbmUgaV9ybihibywgYmksIG4sIGspCQkJCQlcCisgICAgYm9bbl0gPSAgaXRf dGFiWzBdW2J5dGUoYmlbbl0sMCldIF4JCQkJXAorICAgICAgICAgICAgIGl0X3RhYlsxXVtieXRl KGJpWyhuICsgMykgJiAzXSwxKV0gXgkJXAorICAgICAgICAgICAgIGl0X3RhYlsyXVtieXRlKGJp WyhuICsgMikgJiAzXSwyKV0gXgkJXAorICAgICAgICAgICAgIGl0X3RhYlszXVtieXRlKGJpWyhu ICsgMSkgJiAzXSwzKV0gXiAqKGsgKyBuKQorCisjZGVmaW5lIGxzX2JveCh4KQkJCQlcCisgICAg KCBmbF90YWJbMF1bYnl0ZSh4LCAwKV0gXgkJCVwKKyAgICAgIGZsX3RhYlsxXVtieXRlKHgsIDEp XSBeCQkJXAorICAgICAgZmxfdGFiWzJdW2J5dGUoeCwgMildIF4JCQlcCisgICAgICBmbF90YWJb M11bYnl0ZSh4LCAzKV0gKQorCisjZGVmaW5lIGZfcmwoYm8sIGJpLCBuLCBrKQkJCQkJXAorICAg IGJvW25dID0gIGZsX3RhYlswXVtieXRlKGJpW25dLDApXSBeCQkJCVwKKyAgICAgICAgICAgICBm bF90YWJbMV1bYnl0ZShiaVsobiArIDEpICYgM10sMSldIF4JCVwKKyAgICAgICAgICAgICBmbF90 YWJbMl1bYnl0ZShiaVsobiArIDIpICYgM10sMildIF4JCVwKKyAgICAgICAgICAgICBmbF90YWJb M11bYnl0ZShiaVsobiArIDMpICYgM10sMyldIF4gKihrICsgbikKKworI2RlZmluZSBpX3JsKGJv LCBiaSwgbiwgaykJCQkJCVwKKyAgICBib1tuXSA9ICBpbF90YWJbMF1bYnl0ZShiaVtuXSwwKV0g XgkJCQlcCisgICAgICAgICAgICAgaWxfdGFiWzFdW2J5dGUoYmlbKG4gKyAzKSAmIDNdLDEpXSBe CQlcCisgICAgICAgICAgICAgaWxfdGFiWzJdW2J5dGUoYmlbKG4gKyAyKSAmIDNdLDIpXSBeCQlc CisgICAgICAgICAgICAgaWxfdGFiWzNdW2J5dGUoYmlbKG4gKyAxKSAmIDNdLDMpXSBeICooayAr IG4pCisKK3N0YXRpYyB2b2lkCitnZW5fdGFicyAodm9pZCkKK3sKKwl1MzIgaSwgdDsKKwl1OCBw LCBxOworCisJLyogbG9nIGFuZCBwb3dlciB0YWJsZXMgZm9yIEdGKDIqKjgpIGZpbml0ZSBmaWVs ZCB3aXRoCisJICAgMHgwMT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odTMyKSBwIDw8 IDE2KSB8ICgodTMyKSBmZl9tdWx0ICgzLCBwKSA8PCAyNCk7CisKKwkJZnRfdGFiWzBdW2ldID0g dDsKKwkJZnRfdGFiWzFdW2ldID0gcm90bCAodCwgOCk7CisJCWZ0X3RhYlsyXVtpXSA9IHJvdGwg KHQsIDE2KTsKKwkJZnRfdGFiWzNdW2ldID0gcm90bCAodCwgMjQpOworCisJCXAgPSBpc2JfdGFi W2ldOworCisJCXQgPSBwOworCQlpbF90YWJbMF1baV0gPSB0OworCQlpbF90YWJbMV1baV0gPSBy b3RsICh0LCA4KTsKKwkJaWxfdGFiWzJdW2ldID0gcm90bCAodCwgMTYpOworCQlpbF90YWJbM11b aV0gPSByb3RsICh0LCAyNCk7CisKKwkJdCA9ICgodTMyKSBmZl9tdWx0ICgxNCwgcCkpIHwKKwkJ ICAgICgodTMyKSBmZl9tdWx0ICg5LCBwKSA8PCA4KSB8CisJCSAgICAoKHUzMikgZmZfbXVsdCAo MTMsIHApIDw8IDE2KSB8CisJCSAgICAoKHUzMikgZmZfbXVsdCAoMTEsIHApIDw8IDI0KTsKKwor CQlpdF90YWJbMF1baV0gPSB0OworCQlpdF90YWJbMV1baV0gPSByb3RsICh0LCA4KTsKKwkJaXRf dGFiWzJdW2ldID0gcm90bCAodCwgMTYpOworCQlpdF90YWJbM11baV0gPSByb3RsICh0LCAyNCk7 CisJfQorfQorCisjZGVmaW5lIHN0YXJfeCh4KSAoKCh4KSAmIDB4N2Y3ZjdmN2YpIDw8IDEpIF4g KCgoKHgpICYgMHg4MDgwODA4MCkgPj4gNykgKiAweDFiKQorCisjZGVmaW5lIGltaXhfY29sKHks eCkgICAgICAgXAorICAgIHUgICA9IHN0YXJfeCh4KTsgICAgICAgIFwKKyAgICB2ICAgPSBzdGFy X3godSk7ICAgICAgICBcCisgICAgdyAgID0gc3Rhcl94KHYpOyAgICAgICAgXAorICAgIHQgICA9 IHcgXiAoeCk7ICAgICAgICAgIFwKKyAgICh5KSAgPSB1IF4gdiBeIHc7ICAgICAgICBcCisgICAo eSkgXj0gcm90cih1IF4gdCwgIDgpIF4gXAorICAgICAgICAgIHJvdHIodiBeIHQsIDE2KSBeIFwK KyAgICAgICAgICByb3RyKHQsMjQpCisKKy8qIGluaXRpYWxpc2UgdGhlIGtleSBzY2hlZHVsZSBm cm9tIHRoZSB1c2VyIHN1cHBsaWVkIGtleSAqLworCisjZGVmaW5lIGxvb3A0KGkpICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgXAoreyAgIHQgPSByb3RyKHQsICA4KTsgdCA9IGxz X2JveCh0KSBeIHJjb190YWJbaV07ICAgIFwKKyAgICB0IF49IEVfS0VZWzQgKiBpXTsgICAgIEVf S0VZWzQgKiBpICsgNF0gPSB0OyAgICBcCisgICAgdCBePSBFX0tFWVs0ICogaSArIDFdOyBFX0tF WVs0ICogaSArIDVdID0gdDsgICAgXAorICAgIHQgXj0gRV9LRVlbNCAqIGkgKyAyXTsgRV9LRVlb NCAqIGkgKyA2XSA9IHQ7ICAgIFwKKyAgICB0IF49IEVfS0VZWzQgKiBpICsgM107IEVfS0VZWzQg KiBpICsgN10gPSB0OyAgICBcCit9CisKKyNkZWZpbmUgbG9vcDYoaSkgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBcCit7ICAgdCA9IHJvdHIodCwgIDgpOyB0ID0gbHNfYm94KHQp IF4gcmNvX3RhYltpXTsgICAgXAorICAgIHQgXj0gRV9LRVlbNiAqIGldOyAgICAgRV9LRVlbNiAq IGkgKyA2XSA9IHQ7ICAgIFwKKyAgICB0IF49IEVfS0VZWzYgKiBpICsgMV07IEVfS0VZWzYgKiBp ICsgN10gPSB0OyAgICBcCisgICAgdCBePSBFX0tFWVs2ICogaSArIDJdOyBFX0tFWVs2ICogaSAr IDhdID0gdDsgICAgXAorICAgIHQgXj0gRV9LRVlbNiAqIGkgKyAzXTsgRV9LRVlbNiAqIGkgKyA5 XSA9IHQ7ICAgIFwKKyAgICB0IF49IEVfS0VZWzYgKiBpICsgNF07IEVfS0VZWzYgKiBpICsgMTBd ID0gdDsgICBcCisgICAgdCBePSBFX0tFWVs2ICogaSArIDVdOyBFX0tFWVs2ICogaSArIDExXSA9 IHQ7ICAgXAorfQorCisjZGVmaW5lIGxvb3A4KGkpICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgXAoreyAgIHQgPSByb3RyKHQsICA4KTsgOyB0ID0gbHNfYm94KHQpIF4gcmNvX3Rh YltpXTsgIFwKKyAgICB0IF49IEVfS0VZWzggKiBpXTsgICAgIEVfS0VZWzggKiBpICsgOF0gPSB0 OyAgICBcCisgICAgdCBePSBFX0tFWVs4ICogaSArIDFdOyBFX0tFWVs4ICogaSArIDldID0gdDsg ICAgXAorICAgIHQgXj0gRV9LRVlbOCAqIGkgKyAyXTsgRV9LRVlbOCAqIGkgKyAxMF0gPSB0OyAg IFwKKyAgICB0IF49IEVfS0VZWzggKiBpICsgM107IEVfS0VZWzggKiBpICsgMTFdID0gdDsgICBc CisgICAgdCAgPSBFX0tFWVs4ICogaSArIDRdIF4gbHNfYm94KHQpOyAgICBcCisgICAgRV9LRVlb OCAqIGkgKyAxMl0gPSB0OyAgICAgICAgICAgICAgICBcCisgICAgdCBePSBFX0tFWVs4ICogaSAr IDVdOyBFX0tFWVs4ICogaSArIDEzXSA9IHQ7ICAgXAorICAgIHQgXj0gRV9LRVlbOCAqIGkgKyA2 XTsgRV9LRVlbOCAqIGkgKyAxNF0gPSB0OyAgIFwKKyAgICB0IF49IEVfS0VZWzggKiBpICsgN107 IEVfS0VZWzggKiBpICsgMTVdID0gdDsgICBcCit9CisKK3N0YXRpYyBpbnQKK2Flc19zZXRfa2V5 KHZvaWQgKmN0eF9hcmcsIGNvbnN0IHU4ICppbl9rZXksIHVuc2lnbmVkIGludCBrZXlfbGVuKQor eworCXN0cnVjdCBhZXNfY3R4ICpjdHggPSBjdHhfYXJnOworCXUzMiBpLCB0LCB1LCB2LCB3Owor CXUzMi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AoaSk7CisJCWJyZWFrOworCisJY2Fz ZSAyNDoKKwkJRV9LRVlbNF0gPSB1MzJfaW4gKGluX2tleSArIDE2KTsKKwkJdCA9IEVfS0VZWzVd ID0gdTMyX2luIChpbl9rZXkgKyAyMCk7CisJCWZvciAoaSA9IDA7IGkgPCA4OyArK2kpCisJCQls b29wNiAoaSk7CisJCWJyZWFrOworCisJY2FzZSAzMjoKKwkJRV9LRVlbNF0gPSB1MzJfaW4gKGlu X2tleSArIDE2KTsKKwkJRV9LRVlbNV0gPSB1MzJfaW4gKGluX2tleSArIDIwKTsKKwkJRV9LRVlb Nl0gPSB1MzJfaW4gKGluX2tleSArIDI0KTsKKwkJdCA9IEVfS0VZWzddID0gdTMyX2luIChpbl9r ZXkgKyAyOCk7CisJCWZvciAoaSA9IDA7IGkgPCA3OyArK2kpCisJCQlsb29wOCAoaSk7CisJCWJy ZWFrOworCX0KKworCURfS0VZWzBdID0gRV9LRVlbMF07CisJRF9LRVlbMV0gPSBFX0tFWVsxXTsK KwlEX0tFWVsyXSA9IEVfS0VZWzJdOworCURfS0VZWzNdID0gRV9LRVlbM107CisKKwlmb3IgKGkg PSA0OyBpIDwga2V5X2xlbiArIDI0OyArK2kpIHsKKwkJaW1peF9jb2wgKERfS0VZW2ldLCBFX0tF WVtpXSk7CisJfQorCisJLyogUGFkTG9jayBuZWVkcyBhIGRpZmZlcmVudCBmb3JtYXQgb2YgdGhl IGRlY3J5cHRpb24ga2V5LiAqLworCXJvdW5kcyA9IDEwICsgKGtleV9sZW4gLSAxNikgLyA0Owor CisJZm9yIChpID0gMDsgaSA8IHJvdW5kczsgaSsrKSB7CisJCVBbKChpICsgMSkgKiA0KSArIDBd ID0gRF9LRVlbKChyb3VuZHMgLSBpIC0gMSkgKiA0KSArIDBdOworCQlQWygoaSArIDEpICogNCkg KyAxXSA9IERfS0VZWygocm91bmRzIC0gaSAtIDEpICogNCkgKyAxXTsKKwkJUFsoKGkgKyAxKSAq IDQpICsgMl0gPSBEX0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EIihvdXRwdXQpCisJCSAgICAgIDogImQiKGNvbnRyb2xfd29yZCksICJiIihr ZXkpLCAiYyIoY291bnQpKTsKK30KKworc3RhdGljIGlubGluZSB2b2lkIHBhZGxvY2tfeGNyeXB0 X2NiYyh1OCAqaW5wdXQsIHU4ICpvdXRwdXQsIHU4ICprZXksCisJCQkJICAgICAgdTggKml2LCB2 b2lkICpjb250cm9sX3dvcmQsIHUzMiBjb3VudCkKK3sKKwlhc20gdm9sYXRpbGUgKCJwdXNoZmw7 IHBvcGZsIik7CQkvKiBlbmZvcmNlIGtleSByZWxvYWQuICovCisJYXNtIHZvbGF0aWxlICgiLmJ5 dGUgMHhmMywweDBmLDB4YTcsMHhkMCIJLyogcmVwIHhjcnlwdGNiYyAqLworCQkgICAgICA6ICI9 bSIoKm91dHB1dCksICIrUyIoaW5wdXQpLCAiK0QiKG91dHB1dCkKKwkJICAgICAgOiAiZCIoY29u dHJvbF93b3JkKSwgImIiKGtleSksICJjIihjb3VudCksICJhIihpdikpOworfQorCitzdGF0aWMg aW5saW5lIHZvaWQgcGFkbG9ja194Y3J5cHRfY2ZiKHU4ICppbnB1dCwgdTggKm91dHB1dCwgdTgg KmtleSwKKwkJCQkgICAgICB1OCAqaXYsIHZvaWQgKmNvbnRyb2xfd29yZCwgdTMyIGNvdW50KQor eworCWFzbSB2b2xhdGlsZSAoInB1c2hmbDsgcG9wZmwiKTsJCS8qIGVuZm9yY2Uga2V5IHJlbG9h ZC4gKi8KKwlhc20gdm9sYXRpbGUgKCIuYnl0ZSAweGYzLDB4MGYsMHhhNywweGUwIgkvKiByZXAg eGNyeXB0Y2ZiICovCisJCSAgICAgIDogIj1tIigqb3V0cHV0KSwgIitTIihpbnB1dCksICIrRCIo b3V0cHV0KQorCQkgICAgICA6ICJkIihjb250cm9sX3dvcmQpLCAiYiIoa2V5KSwgImMiKGNvdW50 KSwgImEiKGl2KSk7Cit9CisKK3N0YXRpYyBpbmxpbmUgdm9pZCBwYWRsb2NrX3hjcnlwdF9vZmIo dTggKmlucHV0LCB1OCAqb3V0cHV0LCB1OCAqa2V5LAorCQkJCSAgICAgIHU4ICppdiwgdm9pZCAq Y29udHJvbF93b3JkLCB1MzIgY291bnQpCit7CisJYXNtIHZvbGF0aWxlICgicHVzaGZsOyBwb3Bm bCIpOwkJLyogZW5mb3JjZSBrZXkgcmVsb2FkLiAqLworCWFzbSB2b2xhdGlsZSAoIi5ieXRlIDB4 ZjMsMHgwZiwweGE3LDB4ZTgiCS8qIHJlcCB4Y3J5cHRvZmIgKi8KKwkJICAgICAgOiAiPW0iKCpv dXRwdXQpLCAiK1MiKGlucHV0KSwgIitEIihvdXRwdXQpCisJCSAgICAgIDogImQiKGNvbnRyb2xf d29yZCksICJiIihrZXkpLCAiYyIoY291bnQpLCAiYSIoaXYpKTsKK30KKwordm9pZCAqY3J5cHRv X2FsaWduZWRfa21hbGxvYyhzaXplX3Qgc2l6ZSwgaW50IG1vZGUsIHNpemVfdCBhbGlnbm1lbnQs IHZvaWQgKippbmRleCkKK3sKKyAgICAgICBjaGFyICpwdHI7CisKKyAgICAgICBwdHIgPSBrbWFs bG9jKHNpemUgKyBhbGlnbm1lbnQsIG1vZGUpOworICAgICAgICppbmRleCA9IHB0cjsKKyAgICAg ICBpZiAoYWxpZ25tZW50ID4gMSAmJiAoKGxvbmcpcHRyICYgKGFsaWdubWVudCAtIDEpKSkgewor ICAgICAgICAgICAgICAgcHRyICs9IGFsaWdubWVudCAtICgobG9uZylwdHIgJiAoYWxpZ25tZW50 IC0gMSkpOworICAgICAgIH0KKworICAgICAgIHJldHVybiBwdHI7Cit9CisKK3ZvaWQgcGFkbG9j a19hbGlnbmVyKHU4ICpvdXRfYXJnLCBjb25zdCB1OCAqaW5fYXJnLCBjb25zdCB1OCAqaXZfYXJn LAorCQkgICAgIHZvaWQgKmtleSwgdW5pb24gY3dvcmQgKmN3b3JkLAorCQkgICAgIHNpemVfdCBu Ynl0ZXMsIHNpemVfdCBibG9ja3NpemUsCisJCSA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3VyY2UgImRyaXZlcnMvbWlzYy9LY29uZmln IgogCiBzb3VyY2UgImRyaXZlcnMvbWVkaWEvS2NvbmZpZyIKLS0tIGxpbnV4LTIuNi9kcml2ZXJz L01ha2VmaWxlLm5vY3J5cHRvCTIwMDQtMTEtMDIgMTg6NTQ6MDUuMDAwMDAwMDAwICswMzAwCisr KyBsaW51eC0yLjYvZHJpdmVycy9NYWtlZmlsZQkyMDA0LTExLTAyIDE4OjU0OjE3LjAwMDAwMDAw MCArMDMwMApAQCAtNTEsNiArNTEsNyBAQAogb2JqLSQoQ09ORklHX0kyQykJCSs9IGkyYy8KIG9i ai0kKENPTkZJR19XMSkJCSs9IHcxLwogb2JqLSQoQ09ORklHX0NPTk5FQ1RPUikJCSs9IGNvbm5l Y3Rvci8KK29iai0kKENPTkZJR19DT05ORUNUT1IpCQkrPSBhY3J5cHRvLwogb2JqLSQoQ09ORklH X1BIT05FKQkJKz0gdGVsZXBob255Lwogb2JqLSQoQ09ORklHX01EKQkJKz0gbWQvCiBvYmotJChD T05GSUdfQlQpCQkrPSBibHVldG9vdGgvCg== --Multipart=_Tue__2_Nov_2004_19_12_35_+0300_L9m.J=UR4DueZh+G-- From yoshfuji@linux-ipv6.org Tue Nov 2 08:28:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 08:28:52 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2GSkJK008525 for ; Tue, 2 Nov 2004 08:28:46 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 21A1F33CE5; Wed, 3 Nov 2004 01:29:25 +0900 (JST) Date: Wed, 03 Nov 2004 01:29:23 +0900 (JST) Message-Id: <20041103.012923.102810732.yoshfuji@linux-ipv6.org> To: jgarzik@pobox.com Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, akpm@osdl.org, davem@davemloft.net, yoshfuji@linux-ipv6.org Subject: Re: IPv6 dead in -bk11 From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <4187A4E3.8010600@pobox.com> References: <418781EF.7020100@pobox.com> <20041102.225343.06193184.yoshfuji@linux-ipv6.org> <4187A4E3.8010600@pobox.com> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 11350 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 404 Lines: 18 In article <4187A4E3.8010600@pobox.com> (at Tue, 02 Nov 2004 10:16:51 -0500), Jeff Garzik says: > > Please send me: > > % ifconfig -a > > % netstat -nr --inet6 : > Done, see attached. > > ipv6/working/* is 2.6.10-rc1-bk2, and ipv6/dead/* is 2.6.10-rc1-BK-current. Okay, thanks. So... I guess that kernel failed to add "default route" on receipt of RA. Right? Hmm.. --yoshfuji From jdmason@us.ibm.com Tue Nov 2 10:04:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 10:04:33 -0800 (PST) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.132]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2I4Icd012047 for ; Tue, 2 Nov 2004 10:04:18 -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.9) with ESMTP id iA2I3aJ8504168 for ; Tue, 2 Nov 2004 13:03:46 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA2I3PAY094190 for ; Tue, 2 Nov 2004 11:03:25 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA2I3PGw018165 for ; Tue, 2 Nov 2004 11:03:25 -0700 Received: from dreadnought.austin.ibm.com (dreadnought.austin.ibm.com [9.41.94.123]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA2I3PA3018159; Tue, 2 Nov 2004 11:03:25 -0700 From: Jon Mason Organization: IBM To: Francois Romieu Subject: [PATCH 3/3] r8169: clean up Date: Tue, 2 Nov 2004 12:03:25 -0600 User-Agent: KMail/1.6.2 Cc: netdev@oss.sgi.com MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_tv8hBKxXyyw9TC0" Message-Id: <200411021203.25100.jdmason@us.ibm.com> X-archive-position: 11353 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jdmason@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 3616 Lines: 112 --Boundary-00=_tv8hBKxXyyw9TC0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Removal of some magic numbers, unnecessary double not, and addition of "link down" notification. Signed-off-by: Jon Mason --- r8169.c 2004-11-02 10:37:31.035203120 -0600 +++ r8169.c.latest 2004-11-02 10:44:01.367863536 -0600 @@ -519,8 +519,10 @@ static void rtl8169_check_link_status(st if (tp->link_ok(ioaddr)) { netif_carrier_on(dev); printk(KERN_INFO PFX "%s: link up\n", dev->name); - } else + } else { netif_carrier_off(dev); + printk(KERN_INFO PFX "%s: link down\n", dev->name); + } spin_unlock_irqrestore(&tp->lock, flags); } @@ -773,7 +775,7 @@ static void rtl8169_gset_tbi(struct net_ status = RTL_R32(TBICSR); cmd->advertising = (status & TBINwEnable) ? ADVERTISED_Autoneg : 0; - cmd->autoneg = !!(status & TBINwEnable); + cmd->autoneg = status & TBINwEnable; cmd->speed = SPEED_1000; cmd->duplex = DUPLEX_FULL; /* Always set */ @@ -1639,7 +1641,7 @@ static int rtl8169_alloc_rx_skb(struct p if (!skb) goto err_out; - skb_reserve(skb, 2); + skb_reserve(skb, NET_IP_ALIGN); *sk_buff = skb; mapping = pci_map_single(pdev, skb->tail, rx_buf_sz, @@ -2071,9 +2073,9 @@ static inline int rtl8169_try_rx_copy(st if (pkt_size < rx_copybreak) { struct sk_buff *skb; - skb = dev_alloc_skb(pkt_size + 2); + skb = dev_alloc_skb(pkt_size + NET_IP_ALIGN); if (skb) { - skb_reserve(skb, 2); + skb_reserve(skb, NET_IP_ALIGN); eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0); *sk_buff = skb; rtl8169_return_to_asic(desc, rx_buf_sz); --Boundary-00=_tv8hBKxXyyw9TC0 Content-Type: text/x-diff; charset="us-ascii"; name="r8169-cleanup-3.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="r8169-cleanup-3.patch" --- r8169.c 2004-11-02 10:37:31.035203120 -0600 +++ r8169.c.latest 2004-11-02 10:44:01.367863536 -0600 @@ -519,8 +519,10 @@ static void rtl8169_check_link_status(st if (tp->link_ok(ioaddr)) { netif_carrier_on(dev); printk(KERN_INFO PFX "%s: link up\n", dev->name); - } else + } else { netif_carrier_off(dev); + printk(KERN_INFO PFX "%s: link down\n", dev->name); + } spin_unlock_irqrestore(&tp->lock, flags); } @@ -773,7 +775,7 @@ static void rtl8169_gset_tbi(struct net_ status = RTL_R32(TBICSR); cmd->advertising = (status & TBINwEnable) ? ADVERTISED_Autoneg : 0; - cmd->autoneg = !!(status & TBINwEnable); + cmd->autoneg = status & TBINwEnable; cmd->speed = SPEED_1000; cmd->duplex = DUPLEX_FULL; /* Always set */ @@ -1639,7 +1641,7 @@ static int rtl8169_alloc_rx_skb(struct p if (!skb) goto err_out; - skb_reserve(skb, 2); + skb_reserve(skb, NET_IP_ALIGN); *sk_buff = skb; mapping = pci_map_single(pdev, skb->tail, rx_buf_sz, @@ -2071,9 +2073,9 @@ static inline int rtl8169_try_rx_copy(st if (pkt_size < rx_copybreak) { struct sk_buff *skb; - skb = dev_alloc_skb(pkt_size + 2); + skb = dev_alloc_skb(pkt_size + NET_IP_ALIGN); if (skb) { - skb_reserve(skb, 2); + skb_reserve(skb, NET_IP_ALIGN); eth_copy_and_sum(skb, sk_buff[0]->tail, pkt_size, 0); *sk_buff = skb; rtl8169_return_to_asic(desc, rx_buf_sz); --Boundary-00=_tv8hBKxXyyw9TC0-- From jdmason@us.ibm.com Tue Nov 2 10:04:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 10:04:31 -0800 (PST) Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.133]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2I4BKM012028 for ; Tue, 2 Nov 2004 10:04:18 -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.9) with ESMTP id iA2I3S8m580050 for ; Tue, 2 Nov 2004 13:03:39 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA2I3IF9101258 for ; Tue, 2 Nov 2004 11:03:18 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA2I3HxO017689 for ; Tue, 2 Nov 2004 11:03:17 -0700 Received: from dreadnought.austin.ibm.com (dreadnought.austin.ibm.com [9.41.94.123]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA2I3HYp017655; Tue, 2 Nov 2004 11:03:17 -0700 From: Jon Mason Organization: IBM To: Francois Romieu Subject: [PATCH 1/3] r8169: non-NAPI netif_poll_disable removal Date: Tue, 2 Nov 2004 12:03:17 -0600 User-Agent: KMail/1.6.2 Cc: netdev@oss.sgi.com MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_lv8hBxmERC1vq5H" Message-Id: <200411021203.17013.jdmason@us.ibm.com> X-archive-position: 11352 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jdmason@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 3276 Lines: 98 --Boundary-00=_lv8hBxmERC1vq5H Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline rtl8169_close contains a call to netif_poll_disable. This call sets and spins on the __LINK_STATE_RX_SCHED bit, which isn't really a problem if this function is only called in close (as that bit is off with NAPI off). However, if the driver hits a transmit timeout (or any other call that references rtl8169_wait_for_quiescence), the the module will hang indefinitely during any subsequent call to netif_poll_disable or dev_close function call because this bit is now set. Since this function should not really be called with NAPI off, I chose to remove the calls if NAPI is not defined (See patch below). The patch is against the 2.6.10-rc1-mm2 version of the driver. I have verified that this fixes the problem on ppc64 and x86_64. Signed-off-by: Jon Mason --- r8169.c.orig 2004-11-02 10:21:31.305104272 -0600 +++ r8169.c 2004-11-02 10:25:56.849735352 -0600 @@ -85,10 +85,12 @@ VERSION 1.6LK <2004/04/14> #define rtl8169_rx_skb netif_receive_skb #define rtl8169_rx_hwaccel_skb vlan_hwaccel_rx #define rtl8169_rx_quota(count, quota) min(count, quota) +#define rtl8169_poll_disable(dev) netif_poll_disable(dev) #else #define rtl8169_rx_skb netif_rx #define rtl8169_rx_hwaccel_skb vlan_hwaccel_receive_skb #define rtl8169_rx_quota(count, quota) count +#define rtl8169_poll_disable(dev) #endif /* media options */ @@ -1745,7 +1747,7 @@ static void rtl8169_wait_for_quiescence( synchronize_irq(dev->irq); /* Wait for any pending NAPI task to complete */ - netif_poll_disable(dev); + rtl8169_poll_disable(dev); } static void rtl8169_reinit_task(void *_data) @@ -2284,7 +2286,7 @@ rtl8169_close(struct net_device *dev) free_irq(dev->irq, dev); - netif_poll_disable(dev); + rtl8169_poll_disable(dev); rtl8169_tx_clear(tp); --Boundary-00=_lv8hBxmERC1vq5H Content-Type: text/x-diff; charset="us-ascii"; name="r8169-close-1.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="r8169-close-1.patch" --- r8169.c.orig 2004-11-02 10:21:31.305104272 -0600 +++ r8169.c 2004-11-02 10:25:56.849735352 -0600 @@ -85,10 +85,12 @@ VERSION 1.6LK <2004/04/14> #define rtl8169_rx_skb netif_receive_skb #define rtl8169_rx_hwaccel_skb vlan_hwaccel_rx #define rtl8169_rx_quota(count, quota) min(count, quota) +#define rtl8169_poll_disable(dev) netif_poll_disable(dev) #else #define rtl8169_rx_skb netif_rx #define rtl8169_rx_hwaccel_skb vlan_hwaccel_receive_skb #define rtl8169_rx_quota(count, quota) count +#define rtl8169_poll_disable(dev) #endif /* media options */ @@ -1745,7 +1747,7 @@ static void rtl8169_wait_for_quiescence( synchronize_irq(dev->irq); /* Wait for any pending NAPI task to complete */ - netif_poll_disable(dev); + rtl8169_poll_disable(dev); } static void rtl8169_reinit_task(void *_data) @@ -2284,7 +2286,7 @@ rtl8169_close(struct net_device *dev) free_irq(dev->irq, dev); - netif_poll_disable(dev); + rtl8169_poll_disable(dev); rtl8169_tx_clear(tp); --Boundary-00=_lv8hBxmERC1vq5H-- From jdmason@us.ibm.com Tue Nov 2 10:04:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 10:04:31 -0800 (PST) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.130]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2I4FOs012043 for ; Tue, 2 Nov 2004 10:04:18 -0800 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.9) with ESMTP id iA2I3XAd706628 for ; Tue, 2 Nov 2004 13:03:43 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA2I3MAY113876 for ; Tue, 2 Nov 2004 11:03:22 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA2I3MZD018016 for ; Tue, 2 Nov 2004 11:03:22 -0700 Received: from dreadnought.austin.ibm.com (dreadnought.austin.ibm.com [9.41.94.123]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA2I3M88017984; Tue, 2 Nov 2004 11:03:22 -0700 From: Jon Mason Organization: IBM To: Francois Romieu Subject: [PATCH 2/3] r8169: Large Send enablement Date: Tue, 2 Nov 2004 12:03:21 -0600 User-Agent: KMail/1.6.2 Cc: netdev@oss.sgi.com MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_qv8hBO1M2IDuHYd" Message-Id: <200411021203.22003.jdmason@us.ibm.com> X-archive-position: 11351 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jdmason@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 6594 Lines: 189 --Boundary-00=_qv8hBO1M2IDuHYd Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline This patch enables driver support of MTUs greater than 1500. Though the adapter documentation says that maximum MTU is 16k, the largest packet I could send was 7440. So, I am setting that as the max mtu until I can figure out why the adapter misbehaves with packets larger than 7440. I have tested this code on ppc64 and x86_64. Signed-off-by: Jon Mason --- r8169-post-patch1.c 2004-11-02 10:37:18.190155864 -0600 +++ r8169.c 2004-11-02 10:37:31.035203120 -0600 @@ -114,14 +114,13 @@ static int multicast_filter_limit = 32; #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define EarlyTxThld 0x3F /* 0x3F means NO early transmit */ -#define RxPacketMaxSize 0x0800 /* Maximum size supported is 16K-1 */ +#define RxPacketMaxSize 0x3FE8 /* Maximum size supported is 16K-(1+Header+CRC+VLAN ) */ #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ #define R8169_REGS_SIZE 256 #define R8169_NAPI_WEIGHT 64 #define NUM_TX_DESC 64 /* Number of Tx descriptor registers */ #define NUM_RX_DESC 256 /* Number of Rx descriptor registers */ -#define RX_BUF_SIZE 1536 /* Rx Buffer size */ #define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc)) #define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) @@ -427,6 +426,8 @@ static void rtl8169_tx_timeout(struct ne static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev); static int rtl8169_rx_interrupt(struct net_device *, struct rtl8169_private *, void __iomem *); +static int rtl8169_change_mtu(struct net_device *netdev, int new_mtu); + #ifdef CONFIG_R8169_NAPI static int rtl8169_poll(struct net_device *dev, int *budget); #endif @@ -1239,7 +1240,7 @@ rtl8169_init_board(struct pci_dev *pdev, } tp->chipset = i; - tp->rx_buf_sz = RX_BUF_SIZE; + tp->rx_buf_sz = dev->mtu + ETH_HLEN + 8; *ioaddr_out = ioaddr; *dev_out = dev; @@ -1322,6 +1323,7 @@ rtl8169_init_one(struct pci_dev *pdev, c dev->watchdog_timeo = RTL8169_TX_TIMEOUT; dev->irq = pdev->irq; dev->base_addr = (unsigned long) ioaddr; + dev->change_mtu = rtl8169_change_mtu; #ifdef CONFIG_R8169_NAPI dev->poll = rtl8169_poll; @@ -1536,8 +1538,8 @@ rtl8169_hw_start(struct net_device *dev) RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); RTL_W8(EarlyTxThres, EarlyTxThld); - // For gigabit rtl8169 - RTL_W16(RxMaxSize, RxPacketMaxSize); + // For gigabit rtl8169, MTU + header + CRC + VLAN + RTL_W16(RxMaxSize, tp->rx_buf_sz); // Set Rx Config register i = rtl8169_rx_config | @@ -1578,6 +1580,24 @@ rtl8169_hw_start(struct net_device *dev) netif_start_queue(dev); } +static int rtl8169_change_mtu(struct net_device *dev, int new_mtu) +{ + struct rtl8169_private *tp = netdev_priv(dev); + + if (new_mtu < ETH_ZLEN || new_mtu > 7400) + return -EINVAL; + + if (netif_running(dev)) + rtl8169_close(dev); + + dev->mtu = new_mtu; + tp->rx_buf_sz = new_mtu + ETH_HLEN + 8; + + rtl8169_open(dev); + + return 0; +} + static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc) { desc->addr = 0x0badbadbadbadbadull; --Boundary-00=_qv8hBO1M2IDuHYd Content-Type: text/x-diff; charset="us-ascii"; name="r8169-large-send-2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="r8169-large-send-2.patch" --- r8169-post-patch1.c 2004-11-02 10:37:18.190155864 -0600 +++ r8169.c 2004-11-02 10:37:31.035203120 -0600 @@ -114,14 +114,13 @@ static int multicast_filter_limit = 32; #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define EarlyTxThld 0x3F /* 0x3F means NO early transmit */ -#define RxPacketMaxSize 0x0800 /* Maximum size supported is 16K-1 */ +#define RxPacketMaxSize 0x3FE8 /* Maximum size supported is 16K-(1+Header+CRC+VLAN ) */ #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ #define R8169_REGS_SIZE 256 #define R8169_NAPI_WEIGHT 64 #define NUM_TX_DESC 64 /* Number of Tx descriptor registers */ #define NUM_RX_DESC 256 /* Number of Rx descriptor registers */ -#define RX_BUF_SIZE 1536 /* Rx Buffer size */ #define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc)) #define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) @@ -427,6 +426,8 @@ static void rtl8169_tx_timeout(struct ne static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev); static int rtl8169_rx_interrupt(struct net_device *, struct rtl8169_private *, void __iomem *); +static int rtl8169_change_mtu(struct net_device *netdev, int new_mtu); + #ifdef CONFIG_R8169_NAPI static int rtl8169_poll(struct net_device *dev, int *budget); #endif @@ -1239,7 +1240,7 @@ rtl8169_init_board(struct pci_dev *pdev, } tp->chipset = i; - tp->rx_buf_sz = RX_BUF_SIZE; + tp->rx_buf_sz = dev->mtu + ETH_HLEN + 8; *ioaddr_out = ioaddr; *dev_out = dev; @@ -1322,6 +1323,7 @@ rtl8169_init_one(struct pci_dev *pdev, c dev->watchdog_timeo = RTL8169_TX_TIMEOUT; dev->irq = pdev->irq; dev->base_addr = (unsigned long) ioaddr; + dev->change_mtu = rtl8169_change_mtu; #ifdef CONFIG_R8169_NAPI dev->poll = rtl8169_poll; @@ -1536,8 +1538,8 @@ rtl8169_hw_start(struct net_device *dev) RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); RTL_W8(EarlyTxThres, EarlyTxThld); - // For gigabit rtl8169 - RTL_W16(RxMaxSize, RxPacketMaxSize); + // For gigabit rtl8169, MTU + header + CRC + VLAN + RTL_W16(RxMaxSize, tp->rx_buf_sz); // Set Rx Config register i = rtl8169_rx_config | @@ -1578,6 +1580,24 @@ rtl8169_hw_start(struct net_device *dev) netif_start_queue(dev); } +static int rtl8169_change_mtu(struct net_device *dev, int new_mtu) +{ + struct rtl8169_private *tp = netdev_priv(dev); + + if (new_mtu < ETH_ZLEN || new_mtu > 7400) + return -EINVAL; + + if (netif_running(dev)) + rtl8169_close(dev); + + dev->mtu = new_mtu; + tp->rx_buf_sz = new_mtu + ETH_HLEN + 8; + + rtl8169_open(dev); + + return 0; +} + static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc) { desc->addr = 0x0badbadbadbadbadull; --Boundary-00=_qv8hBO1M2IDuHYd-- From mdomsch@lists.us.dell.com Tue Nov 2 11:07:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 11:07:51 -0800 (PST) Received: from lists.us.dell.com (lists.us.dell.com [143.166.224.162]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2J7jFD015509 for ; Tue, 2 Nov 2004 11:07:45 -0800 Received: from lists.us.dell.com (localhost.localdomain [127.0.0.1]) by lists.us.dell.com (8.12.10/8.12.10/Dell.IT.3.31.03) with ESMTP id iA2J7OMU014449; Tue, 2 Nov 2004 13:07:24 -0600 Received: (from mdomsch@localhost) by lists.us.dell.com (8.12.10/8.12.10/Submit) id iA2J7OuU014447; Tue, 2 Nov 2004 13:07:24 -0600 Date: Tue, 2 Nov 2004 13:07:24 -0600 From: Matt Domsch To: netdev@oss.sgi.com, linux.nics@intel.com, jgarzik@pobox.com Subject: [PATCH 2.6] e100, e1000, ixgb: add MODULE_VERSION tags Message-ID: <20041102190724.GA6962@lists.us.dell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 11354 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Matt_Domsch@dell.com Precedence: bulk X-list: netdev Content-Length: 2465 Lines: 66 Patch below adds MODULE_VERSION tags to the e100, e1000, and ixgb drivers. Tools like DKMS will make use of this information to determine if a given driver is older or newer than another given driver based on this version number. Signed-off-by: Matt Domsch -- Matt Domsch Sr. Software Engineer, Lead Engineer Dell Linux Solutions linux.dell.com & www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com ===== drivers/net/e100.c 1.30 vs edited ===== --- 1.30/drivers/net/e100.c 2004-10-25 02:27:41 -05:00 +++ edited/drivers/net/e100.c 2004-11-02 12:49:44 -06:00 @@ -166,6 +166,7 @@ MODULE_DESCRIPTION(DRV_DESCRIPTION); MODULE_AUTHOR(DRV_COPYRIGHT); MODULE_LICENSE("GPL"); +MODULE_VERSION(DRV_VERSION); static int debug = 3; module_param(debug, int, 0); ===== drivers/net/e1000/e1000_main.c 1.137 vs edited ===== --- 1.137/drivers/net/e1000/e1000_main.c 2004-10-25 22:41:15 -05:00 +++ edited/drivers/net/e1000/e1000_main.c 2004-11-02 12:55:04 -06:00 @@ -48,7 +48,8 @@ #else #define DRIVERNAPI "-NAPI" #endif -char e1000_driver_version[] = "5.5.4-k2"DRIVERNAPI; +#define DRV_VERSION "5.5.4-k2"DRIVERNAPI +char e1000_driver_version[] = DRV_VERSION; char e1000_copyright[] = "Copyright (c) 1999-2004 Intel Corporation."; /* e1000_pci_tbl - PCI Device ID Table @@ -196,6 +197,7 @@ MODULE_AUTHOR("Intel Corporation, "); MODULE_DESCRIPTION("Intel(R) PRO/1000 Network Driver"); MODULE_LICENSE("GPL"); +MODULE_VERSION(DRV_VERSION); static int debug = NETIF_MSG_DRV | NETIF_MSG_PROBE; module_param(debug, int, 0); ===== drivers/net/ixgb/ixgb_main.c 1.18 vs edited ===== --- 1.18/drivers/net/ixgb/ixgb_main.c 2004-10-25 20:04:30 -05:00 +++ edited/drivers/net/ixgb/ixgb_main.c 2004-11-02 12:56:03 -06:00 @@ -30,7 +30,8 @@ char ixgb_driver_name[] = "ixgb"; char ixgb_driver_string[] = "Intel(R) PRO/10GbE Network Driver"; -char ixgb_driver_version[] = "1.0.66-k2"; +#define DRV_VERSION "1.0.66-k2" +char ixgb_driver_version[] = DRV_VERSION; char ixgb_copyright[] = "Copyright (c) 2001-2004 Intel Corporation."; /* ixgb_pci_tbl - PCI Device ID Table @@ -138,6 +139,7 @@ MODULE_AUTHOR("Intel Corporation, "); MODULE_DESCRIPTION("Intel(R) PRO/10GbE Network Driver"); MODULE_LICENSE("GPL"); +MODULE_VERSION(DRV_VERSION); /* some defines for controlling descriptor fetches in h/w */ #define RXDCTL_PTHRESH_DEFAULT 128 /* chip considers prefech below this */ From romieu@fr.zoreil.com Tue Nov 2 11:11:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 11:11:40 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2JBY7K015877 for ; Tue, 2 Nov 2004 11:11:35 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.10/8.12.1) with ESMTP id iA2JBDvr025379; Tue, 2 Nov 2004 20:11:13 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.10/8.12.10/Submit) id iA2JB3qF025378; Tue, 2 Nov 2004 20:11:03 +0100 Date: Tue, 2 Nov 2004 20:11:03 +0100 From: Francois Romieu To: Jon Mason Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH 2/3] r8169: Large Send enablement Message-ID: <20041102191103.GA24860@electric-eye.fr.zoreil.com> References: <200411021203.22003.jdmason@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200411021203.22003.jdmason@us.ibm.com> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-archive-position: 11355 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: 4893 Lines: 179 Jon Mason : [...] > @@ -1578,6 +1580,24 @@ rtl8169_hw_start(struct net_device *dev) > netif_start_queue(dev); > } > > +static int rtl8169_change_mtu(struct net_device *dev, int new_mtu) > +{ > + struct rtl8169_private *tp = netdev_priv(dev); > + > + if (new_mtu < ETH_ZLEN || new_mtu > 7400) > + return -EINVAL; > + > + if (netif_running(dev)) > + rtl8169_close(dev); > + > + dev->mtu = new_mtu; > + tp->rx_buf_sz = new_mtu + ETH_HLEN + 8; > + > + rtl8169_open(dev); > + > + return 0; > +} > + Ok. Powow: - rtl8169_close() is not protected as if it was issued during dev->close. It races with the irq handler. - I see no reason why the state of the device should change if the device was not up. Use the tool of your choice to correct me if I am wrong. - If rtl8169_open() fails [*] when the device was previously up, the driver could/should try to recover. Untested example below to clarify. [*] page allocation failure, bigger mtu/rx buffers -> I feel moderately confortable. diff -puN drivers/net/r8169.c~r8169-240 drivers/net/r8169.c --- linux-2.6.9/drivers/net/r8169.c~r8169-240 2004-10-21 21:55:45.000000000 +0200 +++ linux-2.6.9-fr/drivers/net/r8169.c 2004-11-01 23:10:25.000000000 +0100 @@ -120,6 +120,8 @@ static int multicast_filter_limit = 32; #define RX_BUF_SIZE 1536 /* Rx Buffer size */ #define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc)) #define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) +#define R8169_MIN_MTU 8 +#define R8169_MAX_MTU ((2 << 14) - 1) #define RTL8169_TX_TIMEOUT (6*HZ) #define RTL8169_PHY_TIMEOUT (10*HZ) @@ -412,6 +414,7 @@ MODULE_PARM_DESC(use_dac, "Enable PCI DA MODULE_LICENSE("GPL"); static int rtl8169_open(struct net_device *dev); +static int rtl8169_change_mtu(struct net_device *dev, int new_mtu); static int rtl8169_start_xmit(struct sk_buff *skb, struct net_device *dev); static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance, struct pt_regs *regs); @@ -1314,6 +1317,7 @@ rtl8169_init_one(struct pci_dev *pdev, c SET_ETHTOOL_OPS(dev, &rtl8169_ethtool_ops); dev->stop = rtl8169_close; dev->tx_timeout = rtl8169_tx_timeout; + dev->change_mtu = rtl8169_change_mtu; dev->set_multicast_list = rtl8169_set_rx_mode; dev->watchdog_timeo = RTL8169_TX_TIMEOUT; dev->irq = pdev->irq; @@ -1533,7 +1537,7 @@ rtl8169_hw_start(struct net_device *dev) RTL_W8(EarlyTxThres, EarlyTxThld); // For gigabit rtl8169 - RTL_W16(RxMaxSize, RxPacketMaxSize); + RTL_W16(RxMaxSize, tp->rx_buf_sz); // Set Rx Config register i = rtl8169_rx_config | @@ -1738,6 +1742,26 @@ static void rtl8169_schedule_work(struct schedule_delayed_work(&tp->task, 4); } +static void __rtl8169_kick(struct net_device *dev) +{ + rtl8169_hw_start(dev); + netif_poll_enable(dev); + netif_wake_queue(dev); + set_bit(__LINK_STATE_START, &dev->state); +} + +static void rtl8169_refill_task(void *_data) +{ + struct net_device *dev = _data; + int err; + + err = rtl8169_init_ring(dev); + if (err < 0) + rtl8169_schedule_work(dev, rtl8169_refill_task); + else if (netif_queue_stopped(dev)) + __rtl8169_kick(dev); +} + static void rtl8169_wait_for_quiescence(struct net_device *dev) { synchronize_irq(dev->irq); @@ -2223,6 +2247,72 @@ out: return IRQ_RETVAL(handled); } +static int rtl8169_set_rxbufsize(struct rtl8169_private *tp, int mtu) +{ + if (mtu < R8169_MIN_MTU || mtu > R8169_MAX_MTU) + return -EINVAL; + + tp->rx_buf_sz = mtu; + if (mtu > ETH_DATA_LEN) { + /* MTU + ethernet header + FCS + optional VLAN tag */ + tp->rx_buf_sz += ETH_HLEN + 8; + } + return 0; +} + + +static int rtl8169_change_mtu(struct net_device *dev, int new_mtu) +{ + struct rtl8169_private *tp = netdev_priv(dev); + struct TxDesc *txd = tp->TxDescArray; + void *ioaddr = tp->mmio_addr; + int ret, i; + + ret = rtl8169_set_rxbufsize(tp, new_mtu); + if (ret < 0) + goto out; + + if (!netif_running(dev)) + goto out; + + printk(KERN_DEBUG "%s: Tx/Rx activity going down!\n", dev->name); + RTL_W8(ChipCmd, 0x00); + RTL_R8(ChipCmd); + + flush_scheduled_work(); + + netif_poll_disable(dev); + + RTL_W16(IntrMask, 0x0000); + RTL_R16(IntrMask); + + /* A bit incestuous */ + clear_bit(__LINK_STATE_START, &dev->state); + + synchronize_irq(dev->irq); + + netif_stop_queue(dev); + + /* + * At this point we do not bother with the irq/napi handlers + * any more. Tx thread may lurk. + */ + for (i = 0; i < NUM_TX_DESC; i++, txd++) + txd->opts1 = le32_to_cpu(DescOwn); + + /* Give a racing hard_start_xmit a few cycles to complete. */ + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(1); + + rtl8169_rx_clear(tp); + rtl8169_tx_clear(tp); + + rtl8169_refill_task(dev); + +out: + return ret; +} + #ifdef CONFIG_R8169_NAPI static int rtl8169_poll(struct net_device *dev, int *budget) { _ From romieu@fr.zoreil.com Tue Nov 2 11:31:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 11:31:45 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2JVY20018144 for ; Tue, 2 Nov 2004 11:31:35 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.10/8.12.1) with ESMTP id iA2JRsvr025768; Tue, 2 Nov 2004 20:27:54 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.10/8.12.10/Submit) id iA2JRkte025766; Tue, 2 Nov 2004 20:27:46 +0100 Date: Tue, 2 Nov 2004 20:27:46 +0100 From: Francois Romieu To: Jon Mason Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH 3/3] r8169: clean up Message-ID: <20041102192746.GB24860@electric-eye.fr.zoreil.com> References: <200411021203.25100.jdmason@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200411021203.25100.jdmason@us.ibm.com> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-archive-position: 11356 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: 743 Lines: 23 Jon Mason : > Removal of some magic numbers, unnecessary double not, and addition of "link > down" notification. > > Signed-off-by: Jon Mason > > --- r8169.c 2004-11-02 10:37:31.035203120 -0600 > +++ r8169.c.latest 2004-11-02 10:44:01.367863536 -0600 [...] > @@ -773,7 +775,7 @@ static void rtl8169_gset_tbi(struct net_ > > status = RTL_R32(TBICSR); > cmd->advertising = (status & TBINwEnable) ? ADVERTISED_Autoneg : 0; > - cmd->autoneg = !!(status & TBINwEnable); > + cmd->autoneg = status & TBINwEnable; > > cmd->speed = SPEED_1000; > cmd->duplex = DUPLEX_FULL; /* Always set */ drivers/net/*.c use 0/1 or AUTONEG_{EN/DIS}ABLE. -- Ueimor From anil.gunturu@gmail.com Tue Nov 2 11:47:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 11:47:11 -0800 (PST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.193]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2Jl6rZ019185 for ; Tue, 2 Nov 2004 11:47:07 -0800 Received: by rproxy.gmail.com with SMTP id 77so329239rnk for ; Tue, 02 Nov 2004 11:46:46 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=RoCLPVYqnxnts+fAqCxRJsMwHXJPqOPVt4xj/l8QeT0ptYo8NBeD1gAhgXVkJoxvErelsNSlVFY/YZOjk1k4cBGhyX8KPN8g143fvrEF4Y3trGDj0gmbK6K30CRtvdcdBz+tyVi0v3Jz7xe0Kn7SfZUKuHVgij+li5shAhh8yUo= Received: by 10.39.2.52 with SMTP id e52mr647527rni; Tue, 02 Nov 2004 11:46:46 -0800 (PST) Received: by 10.39.2.38 with HTTP; Tue, 2 Nov 2004 11:46:46 -0800 (PST) Message-ID: <2f61ba570411021146657f63f4@mail.gmail.com> Date: Tue, 2 Nov 2004 11:46:46 -0800 From: Anil Gunturu Reply-To: Anil Gunturu To: netdev@oss.sgi.com Subject: NETLINK_ROUTE sockets in kernel Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 11357 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: anil.gunturu@gmail.com Precedence: bulk X-list: netdev Content-Length: 449 Lines: 10 Hi, I am trying to undestand the NETLINK_ROUTE protocol sockets on 2.4.18 kernel. Specifically, I am interested in knowing how the kernel processes the netlink messages that it recieves from user space. I was browsing the rtnetlink_rcv_msg (net/core/rtnetlink.c) function in the kernel. But its not clear on how the rtnetlink_links array is populated for PF_NETLINK family. rtnetlink_init seem to populate for PF_PACKET and PF_UNSPEC. Thanks, -Anil From jdmason@us.ibm.com Tue Nov 2 11:48:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 11:48:49 -0800 (PST) Received: from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.130]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2JmYcr019520 for ; Tue, 2 Nov 2004 11:48:34 -0800 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.9) with ESMTP id iA2JlpAd483956 for ; Tue, 2 Nov 2004 14:48:02 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA2JlfF9044180 for ; Tue, 2 Nov 2004 12:47:41 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA2Jle6W010048 for ; Tue, 2 Nov 2004 12:47:41 -0700 Received: from dreadnought.austin.ibm.com (dreadnought.austin.ibm.com [9.41.94.123]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA2Jle2j010012; Tue, 2 Nov 2004 12:47:40 -0700 From: Jon Mason Organization: IBM To: Francois Romieu Subject: Re: [PATCH 3/3] r8169: clean up Date: Tue, 2 Nov 2004 13:47:39 -0600 User-Agent: KMail/1.6.2 Cc: netdev@oss.sgi.com, jgarzik@pobox.com References: <200411021203.25100.jdmason@us.ibm.com> <20041102192746.GB24860@electric-eye.fr.zoreil.com> In-Reply-To: <20041102192746.GB24860@electric-eye.fr.zoreil.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200411021347.39047.jdmason@us.ibm.com> X-archive-position: 11358 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jdmason@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1125 Lines: 34 On Tuesday 02 November 2004 01:27 pm, Francois Romieu wrote: > Jon Mason : > > Removal of some magic numbers, unnecessary double not, and addition of > > "link down" notification. > > > > Signed-off-by: Jon Mason > > > > --- r8169.c 2004-11-02 10:37:31.035203120 -0600 > > +++ r8169.c.latest 2004-11-02 10:44:01.367863536 -0600 > > [...] > > > @@ -773,7 +775,7 @@ static void rtl8169_gset_tbi(struct net_ > > > > status = RTL_R32(TBICSR); > > cmd->advertising = (status & TBINwEnable) ? ADVERTISED_Autoneg : > > 0; - cmd->autoneg = !!(status & TBINwEnable); > > + cmd->autoneg = status & TBINwEnable; > > > > cmd->speed = SPEED_1000; > > cmd->duplex = DUPLEX_FULL; /* Always set */ > > drivers/net/*.c use 0/1 or AUTONEG_{EN/DIS}ABLE. Silly question, does "!!" not execute a bitwise not twice? If not, then please forgive my ignorance. If so, then it is unnecessary. But if you want something prettier, how about: cmd->autoneg = (status & TBINwEnable) ? AUTONEG_ENABLE : AUTONEG_DISABLE; -- Jon Mason jdmason@us.ibm.com From jgarzik@pobox.com Tue Nov 2 11:51:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 11:51:35 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2JpTZ6019889 for ; Tue, 2 Nov 2004 11:51:30 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CP4gR-0008Di-Km; Tue, 02 Nov 2004 19:51:11 +0000 Message-ID: <4187E523.4090402@pobox.com> Date: Tue, 02 Nov 2004 14:50:59 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jon Mason CC: Francois Romieu , netdev@oss.sgi.com Subject: Re: [PATCH 2/3] r8169: Large Send enablement References: <200411021203.22003.jdmason@us.ibm.com> In-Reply-To: <200411021203.22003.jdmason@us.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11359 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: 361 Lines: 9 Jon Mason wrote: > This patch enables driver support of MTUs greater than 1500. Though the > adapter documentation says that maximum MTU is 16k, the largest packet I > could send was 7440. So, I am setting that as the max mtu until I can figure > out why the adapter misbehaves with packets larger than 7440. this is dependent on hardware FIFO sizes... From tgr@reeler.org Tue Nov 2 11:55:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 11:55:40 -0800 (PST) Received: from rei.rakuen (217-162-107-144.dclient.hispeed.ch [217.162.107.144]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2JtYLn020311 for ; Tue, 2 Nov 2004 11:55:35 -0800 Received: from tgr by rei.rakuen with local (Exim 4.34) id 1CP4kB-0000Js-C4; Tue, 02 Nov 2004 20:55:03 +0100 Date: Tue, 2 Nov 2004 20:55:03 +0100 From: Thomas Graf To: Jon Mason Cc: Francois Romieu , netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH 3/3] r8169: clean up Message-ID: <20041102195503.GM19714@rei.reeler.org> References: <200411021203.25100.jdmason@us.ibm.com> <20041102192746.GB24860@electric-eye.fr.zoreil.com> <200411021347.39047.jdmason@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200411021347.39047.jdmason@us.ibm.com> X-archive-position: 11360 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 345 Lines: 7 > > > 0; - cmd->autoneg = !!(status & TBINwEnable); > > > + cmd->autoneg = status & TBINwEnable; > Silly question, does "!!" not execute a bitwise not twice? If not, then > please forgive my ignorance. Yes but the result is not the same, the result will be either 1 or 0 if done with !! and yours will result in TBINwEnable or 0. From linville@ra.tuxdriver.com Tue Nov 2 12:07:27 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 12:07:32 -0800 (PST) Received: from ra.tuxdriver.com (ra.tuxdriver.com [24.172.12.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2K7QDW020963 for ; Tue, 2 Nov 2004 12:07:26 -0800 Received: (from linville@localhost) by ra.tuxdriver.com (8.11.6/8.11.6) id iA2K6e319827; Tue, 2 Nov 2004 15:06:40 -0500 Date: Tue, 2 Nov 2004 15:06:39 -0500 From: "John W. Linville" To: Matt Domsch Cc: netdev@oss.sgi.com, linux.nics@intel.com, jgarzik@pobox.com Subject: Re: [PATCH 2.6] e100, e1000, ixgb: add MODULE_VERSION tags Message-ID: <20041102150639.A19501@tuxdriver.com> Mail-Followup-To: Matt Domsch , netdev@oss.sgi.com, linux.nics@intel.com, jgarzik@pobox.com References: <20041102190724.GA6962@lists.us.dell.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: <20041102190724.GA6962@lists.us.dell.com>; from Matt_Domsch@dell.com on Tue, Nov 02, 2004 at 01:07:24PM -0600 X-archive-position: 11361 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: linville@tuxdriver.com Precedence: bulk X-list: netdev Content-Length: 437 Lines: 12 On Tue, Nov 02, 2004 at 01:07:24PM -0600, Matt Domsch wrote: > Patch below adds MODULE_VERSION tags to the e100, e1000, and ixgb > drivers. Tools like DKMS will make use of this information to I had recently posted patches to this effect for e100, e1000 (nearly identical to yours) and several others. I did not, however, include ixgb, so I'm sure that one will be quite welcome! :-) John -- John W. Linville linville@tuxdriver.com From herbert@gondor.apana.org.au Tue Nov 2 12:37:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 12:38:07 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2Kbvwl024911 for ; Tue, 2 Nov 2004 12:37:58 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CP5PE-0006vC-00; Wed, 03 Nov 2004 07:37:28 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CP5P6-00039s-00; Wed, 03 Nov 2004 07:37:20 +1100 Date: Wed, 3 Nov 2004 07:37:20 +1100 To: jamal Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [NET] Fix neighbour tbl->entries race Message-ID: <20041102203720.GA12108@gondor.apana.org.au> References: <20041102112651.GA8633@gondor.apana.org.au> <1099404823.1021.15.camel@jzny.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1099404823.1021.15.camel@jzny.localdomain> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11362 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 950 Lines: 28 On Tue, Nov 02, 2004 at 09:13:43AM -0500, jamal wrote: > > Is this still the same logic: > > ------------- > - if (!neigh_forced_gc(tbl) && > - tbl->entries > tbl->gc_thresh3) > - goto out; > + neigh_forced_gc(tbl); > + if (atomic_read(&tbl->entries) > tbl->gc_thresh3) > + goto out_entries; > > ------- > > In previous code it seems you should short-circuit if > neigh_forced_gc(tbl) returns non-zero. why do you have to break that > if statement? The previous logic is slightly incorrect in that even if neigh_forced_gc succeeded in removing some entries, the total number of entries may still be above the threshold 3. Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From jesse.brandeburg@intel.com Tue Nov 2 12:45:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 12:45:45 -0800 (PST) Received: from orsfmr001.jf.intel.com (fmr12.intel.com [134.134.136.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2KjcGp025339 for ; Tue, 2 Nov 2004 12:45:39 -0800 Received: from talaria.jf.intel.com (talaria.jf.intel.com [10.7.209.7]) by orsfmr001.jf.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.15 2004/01/30 18:16:28 root Exp $) with ESMTP id iA2KjxmU003124; Tue, 2 Nov 2004 20:45:59 GMT Received: from nwlxmail01.jf.intel.com (nwlxmail01.jf.intel.com [10.7.171.40]) by talaria.jf.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.11 2004/07/29 22:51:53 root Exp $) with ESMTP id iA2Kc55o024830; Tue, 2 Nov 2004 20:38:06 GMT Received: from isotope.jf.intel.com (isotope.jf.intel.com [10.23.51.23]) by nwlxmail01.jf.intel.com (8.12.10/8.12.9/MailSET/Hub) with ESMTP id iA2Kj7gP031949; Tue, 2 Nov 2004 12:45:07 -0800 Date: Tue, 2 Nov 2004 12:45:07 -0800 (PST) From: Jesse Brandeburg X-X-Sender: jbrandeb@isotope.jf.intel.com To: jgarzik@intel.com, cc: netdev@oss.sgi.com Subject: [PATCH 2.6] ixgb: fix ixgb_intr looping checks Message-ID: ReplyTo: "Jesse Brandeburg" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 11363 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jesse.brandeburg@intel.com Precedence: bulk X-list: netdev Content-Length: 2040 Lines: 51 Hey Jeff, we have a little problem with a patch that got accepted into -mm and is now in netdev, but never got copied to netdev mailing list. This thread: http://marc.theaimsgroup.com/?t=109149508900004&r=1&w=2 the last comment is entirely correct, we need to update the comment. this patch reverts the patch to ixgb that akpm added to do two for loops, as we actually did intend to do the boolean '&' check, and both the functions *should* be called every time through the loop. Here is a patch that we would like applied, it undoes the change we don't like, it was checked to apply cleanly against the netdev-2.6 tree this morning, and reviewed by the team. It also keeps the 10Gig (ixgb) driver consistent with our 1gig (e1000) code. This patch undoes a change that we believe will impact performance adversely, by creating possibly too long a delay between servicing completions. The comment pretty much explains it. We need to call both cleanup routines each pass through the loop, this time we have a comment explaining why. Signed-off-by: Jesse Brandeburg --- netdev-2.6/drivers/net/ixgb/ixgb_main.c 2004-10-15 10:39:56.000000000 -0700 +++ netdev-2.6/drivers/net/ixgb/ixgb_main.c.new 2004-10-15 11:09:42.000000000 -0700 @@ -1613,13 +1613,14 @@ static irqreturn_t ixgb_intr(int irq, vo __netif_rx_schedule(netdev); } #else - for (i = 0; i < IXGB_MAX_INTR; i++) - if (ixgb_clean_rx_irq(adapter) == FALSE) - break; - for (i = 0; i < IXGB_MAX_INTR; i++) - if (ixgb_clean_tx_irq(adapter) == FALSE) + /* yes, that is actually a & and it is meant to make sure that + * every pass through this for loop checks both receive and + * transmit queues for completed descriptors, intended to + * avoid starvation issues and assist tx/rx fairness. */ + for(i = 0; i < IXGB_MAX_INTR; i++) + if(!ixgb_clean_rx_irq(adapter) & + !ixgb_clean_tx_irq(adapter)) break; - /* if RAIDC:EN == 1 and ICR:RXDMT0 == 1, we need to * set IMS:RXDMT0 to 1 to restart the RBD timer (POLL) */ From jesse.brandeburg@intel.com Tue Nov 2 12:51:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 12:51:06 -0800 (PST) Received: from hermes.jf.intel.com (fmr05.intel.com [134.134.136.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2Kovqb025708 for ; Tue, 2 Nov 2004 12:51:02 -0800 Received: from talaria.jf.intel.com (talaria.jf.intel.com [10.7.209.7]) by hermes.jf.intel.com (8.12.9-20030918-01/8.12.9/d: major-outer.mc,v 1.15 2004/01/30 18:16:28 root Exp $) with ESMTP id iA2KsdUf008611; Tue, 2 Nov 2004 20:54:39 GMT Received: from nwlxmail01.jf.intel.com (nwlxmail01.jf.intel.com [10.7.171.40]) by talaria.jf.intel.com (8.12.9-20030918-01/8.12.9/d: major-inner.mc,v 1.11 2004/07/29 22:51:53 root Exp $) with ESMTP id iA2KhP5o027826; Tue, 2 Nov 2004 20:43:25 GMT Received: from isotope.jf.intel.com (isotope.jf.intel.com [10.23.51.23]) by nwlxmail01.jf.intel.com (8.12.10/8.12.9/MailSET/Hub) with ESMTP id iA2KoRgP032285; Tue, 2 Nov 2004 12:50:27 -0800 Date: Tue, 2 Nov 2004 12:50:27 -0800 (PST) From: Jesse Brandeburg X-X-Sender: jbrandeb@isotope.jf.intel.com To: Jesse Brandeburg cc: jgarzik@pobox.com, , Subject: Re: [PATCH 2.6] ixgb: fix ixgb_intr looping checks In-Reply-To: Message-ID: ReplyTo: "Jesse Brandeburg" MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-Scanned-By: MIMEDefang 2.31 (www . roaringpenguin . com / mimedefang) X-archive-position: 11364 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jesse.brandeburg@intel.com Precedence: bulk X-list: netdev Content-Length: 2294 Lines: 61 whoops! including jeff this time... On Tue, 2 Nov 2004, Jesse Brandeburg wrote: Hey Jeff, we have a little problem with a patch that got accepted into -mm and is now in netdev, but never got copied to netdev mailing list. This thread: http://marc.theaimsgroup.com/?t=109149508900004&r=1&w=2 the last comment is entirely correct, we need to update the comment.  this patch reverts the patch to ixgb that akpm added to do two for loops, as we actually did intend to do the boolean '&' check, and both the functions *should* be called every time through the loop. Here is a patch that we would like applied, it undoes the change we don't like, it was checked to apply cleanly against the netdev-2.6 tree this morning, and reviewed by the team. It also keeps the 10Gig (ixgb) driver consistent with our 1gig (e1000) code. This patch undoes a change that we believe will impact performance adversely, by creating possibly too long a delay between servicing completions. The comment pretty much explains it.  We need to call both cleanup routines each pass through the loop, this time we have a comment explaining why. Signed-off-by: Jesse Brandeburg --- netdev-2.6/drivers/net/ixgb/ixgb_main.c     2004-10-15 10:39:56.000000000 -0700 +++ netdev-2.6/drivers/net/ixgb/ixgb_main.c.new 2004-10-15 11:09:42.000000000 -0700 @@ -1613,13 +1613,14 @@ static irqreturn_t ixgb_intr(int irq, vo                 __netif_rx_schedule(netdev);         }  #else -       for (i = 0; i < IXGB_MAX_INTR; i++) -               if (ixgb_clean_rx_irq(adapter) == FALSE) -                       break; -       for (i = 0; i < IXGB_MAX_INTR; i++) -               if (ixgb_clean_tx_irq(adapter) == FALSE) +       /* yes, that is actually a & and it is meant to make sure that +        * every pass through this for loop checks both receive and +        * transmit queues for completed descriptors, intended to +        * avoid starvation issues and assist tx/rx fairness. */ +       for(i = 0; i < IXGB_MAX_INTR; i++) +               if(!ixgb_clean_rx_irq(adapter) & +                  !ixgb_clean_tx_irq(adapter))                         break; -         /* if RAIDC:EN == 1 and ICR:RXDMT0 == 1, we need to          * set IMS:RXDMT0 to 1 to restart the RBD timer (POLL)          */ From herbert@gondor.apana.org.au Tue Nov 2 13:03:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 13:03:49 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2L3eA3026395 for ; Tue, 2 Nov 2004 13:03:41 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CP5o6-00077S-00; Wed, 03 Nov 2004 08:03:10 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CP5nv-0003Ie-00; Wed, 03 Nov 2004 08:02:59 +1100 Date: Wed, 3 Nov 2004 08:02:59 +1100 To: jamal Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [NET] Fix neighbour tbl->entries race Message-ID: <20041102210259.GA12642@gondor.apana.org.au> References: <20041102112651.GA8633@gondor.apana.org.au> <1099404823.1021.15.camel@jzny.localdomain> <20041102203720.GA12108@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: <20041102203720.GA12108@gondor.apana.org.au> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11365 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 3852 Lines: 135 --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Nov 03, 2004 at 07:37:20AM +1100, herbert wrote: > On Tue, Nov 02, 2004 at 09:13:43AM -0500, jamal wrote: > > > In previous code it seems you should short-circuit if > > neigh_forced_gc(tbl) returns non-zero. why do you have to break that > > if statement? > > The previous logic is slightly incorrect in that even if neigh_forced_gc > succeeded in removing some entries, the total number of entries may still > be above the threshold 3. Actually, after thinking about this a bit more, the short-circuit is indeed correct. The logic is that if we freed up at least one spot in the hash table then we ought to be able to take it. In fact, we can make it a bit more effective/fair by checking the previous entries count as well. Here is an updated patch. Signed-off-by: Herbert Xu Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== include/net/neighbour.h 1.24 vs edited ===== --- 1.24/include/net/neighbour.h 2004-10-22 14:51:12 +10:00 +++ edited/include/net/neighbour.h 2004-11-03 07:56:07 +11:00 @@ -189,7 +189,7 @@ struct timer_list gc_timer; struct timer_list proxy_timer; struct sk_buff_head proxy_queue; - int entries; + atomic_t entries; rwlock_t lock; unsigned long last_rand; struct neigh_parms *parms_list; ===== net/core/neighbour.c 1.54 vs edited ===== --- 1.54/net/core/neighbour.c 2004-10-06 04:37:37 +10:00 +++ edited/net/core/neighbour.c 2004-11-03 07:57:32 +11:00 @@ -254,18 +254,21 @@ { struct neighbour *n = NULL; unsigned long now = jiffies; + int entries; - if (tbl->entries > tbl->gc_thresh3 || - (tbl->entries > tbl->gc_thresh2 && + entries = atomic_inc_return(&tbl->entries) - 1; + if (entries >= tbl->gc_thresh3 || + (entries >= tbl->gc_thresh2 && time_after(now, tbl->last_flush + 5 * HZ))) { if (!neigh_forced_gc(tbl) && - tbl->entries > tbl->gc_thresh3) - goto out; + entries >= tbl->gc_thresh3 && + atomic_read(&tbl->entries) > tbl->gc_thresh3) + goto out_entries; } n = kmem_cache_alloc(tbl->kmem_cachep, SLAB_ATOMIC); if (!n) - goto out; + goto out_entries; memset(n, 0, tbl->entry_size); @@ -281,12 +284,15 @@ NEIGH_CACHE_STAT_INC(tbl, allocs); neigh_glbl_allocs++; - tbl->entries++; n->tbl = tbl; atomic_set(&n->refcnt, 1); n->dead = 1; out: return n; + +out_entries: + atomic_dec(&tbl->entries); + goto out; } static struct neighbour **neigh_hash_alloc(unsigned int entries) @@ -427,7 +433,7 @@ write_lock_bh(&tbl->lock); - if (tbl->entries > (tbl->hash_mask + 1)) + if (atomic_read(&tbl->entries) > (tbl->hash_mask + 1)) neigh_hash_grow(tbl, (tbl->hash_mask + 1) << 1); hash_val = tbl->hash(pkey, dev) & tbl->hash_mask; @@ -608,7 +614,7 @@ NEIGH_PRINTK2("neigh %p is destroyed.\n", neigh); neigh_glbl_allocs--; - neigh->tbl->entries--; + atomic_dec(&neigh->tbl->entries); kmem_cache_free(neigh->tbl->kmem_cachep, neigh); } @@ -1394,7 +1400,7 @@ del_timer_sync(&tbl->proxy_timer); pneigh_queue_purge(&tbl->proxy_queue); neigh_ifdown(tbl, NULL); - if (tbl->entries) + if (atomic_read(&tbl->entries)) printk(KERN_CRIT "neighbour leakage\n"); write_lock(&neigh_tbl_lock); for (tp = &neigh_tables; *tp; tp = &(*tp)->next) { @@ -1951,7 +1957,7 @@ seq_printf(seq, "%08x %08lx %08lx %08lx %08lx %08lx %08lx " "%08lx %08lx %08lx %08lx\n", - tbl->entries, + atomic_read(&tbl->entries), st->allocs, st->destroys, --vtzGhvizbBRQ85DL-- From davem@davemloft.net Tue Nov 2 13:32:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 13:32:47 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2LWfP0027244 for ; Tue, 2 Nov 2004 13:32:42 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CP66h-0007uS-00; Tue, 02 Nov 2004 13:22:23 -0800 Date: Tue, 2 Nov 2004 13:22:22 -0800 From: "David S. Miller" To: Anil Gunturu Cc: netdev@oss.sgi.com Subject: Re: NETLINK_ROUTE sockets in kernel Message-Id: <20041102132222.671cf16c.davem@davemloft.net> In-Reply-To: <2f61ba570411021146657f63f4@mail.gmail.com> References: <2f61ba570411021146657f63f4@mail.gmail.com> X-Mailer: Sylpheed version 0.9.99 (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: 11366 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 464 Lines: 11 On Tue, 2 Nov 2004 11:46:46 -0800 Anil Gunturu wrote: > But its not clear on how the rtnetlink_links array is > populated for PF_NETLINK family. rtnetlink_init seem to populate for > PF_PACKET and PF_UNSPEC. This is done via net/ipv4/devinet.c:devinet_init() which sets rtnetlink_links[] for PF_INET. Please run grep on the kernel tree for references to rtnetlink_links[] to see how other protocol family array entries are initialized. From pablo@eurodev.net Tue Nov 2 13:40:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 13:40:31 -0800 (PST) Received: from smtp06.retemail.es (smtp06.auna.com [62.81.186.16]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2LeMrC027677 for ; Tue, 2 Nov 2004 13:40:23 -0800 Received: from eurodev.net ([217.217.187.247]) by smtp06.retemail.es (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20041102213959.FUIT1314.smtp06.retemail.es@eurodev.net>; Tue, 2 Nov 2004 22:39:59 +0100 Message-ID: <4187FF18.5050608@eurodev.net> Date: Tue, 02 Nov 2004 22:41:44 +0100 From: Pablo Neira User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: netdev@oss.sgi.com CC: "David S. Miller" Subject: [NETLINK] introduce netlink bucket Content-Type: multipart/mixed; boundary="------------090104060208020908070101" X-archive-position: 11367 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pablo@eurodev.net Precedence: bulk X-list: netdev Content-Length: 4476 Lines: 162 This is a multi-part message in MIME format. --------------090104060208020908070101 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi Davem, This patch introduces the netlink bucket struct, it joins three arrays into an array of netlink bucket. Signed-off-by: Pablo Neira Ayuso --------------090104060208020908070101 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" ===== net/netlink/af_netlink.c 1.57 vs edited ===== --- 1.57/net/netlink/af_netlink.c 2004-10-20 07:10:40 +02:00 +++ edited/net/netlink/af_netlink.c 2004-10-30 19:37:26 +02:00 @@ -69,13 +69,15 @@ #define nlk_sk(__sk) ((struct netlink_opt *)(__sk)->sk_protinfo) -static struct hlist_head nl_table[MAX_LINKS]; static DECLARE_WAIT_QUEUE_HEAD(nl_table_wait); -static unsigned nl_nonroot[MAX_LINKS]; +static struct netlink_bucket { + struct hlist_head nl_table; + unsigned nl_nonroot; #ifdef NL_EMULATE_DEV -static struct socket *netlink_kernel[MAX_LINKS]; + struct socket *netlink_kernel; #endif +} nl_bucket[MAX_LINKS]; static int netlink_dump(struct sock *sk); static void netlink_destroy_callback(struct netlink_callback *cb); @@ -164,7 +166,7 @@ struct hlist_node *node; read_lock(&nl_table_lock); - sk_for_each(sk, node, &nl_table[protocol]) { + sk_for_each(sk, node, &nl_bucket[protocol].nl_table) { if (nlk_sk(sk)->pid == pid) { sock_hold(sk); goto found; @@ -185,7 +187,7 @@ struct hlist_node *node; netlink_table_grab(); - sk_for_each(osk, node, &nl_table[sk->sk_protocol]) { + sk_for_each(osk, node, &nl_bucket[sk->sk_protocol].nl_table) { if (nlk_sk(osk)->pid == pid) break; } @@ -193,7 +195,7 @@ err = -EBUSY; if (nlk_sk(sk)->pid == 0) { nlk_sk(sk)->pid = pid; - sk_add_node(sk, &nl_table[sk->sk_protocol]); + sk_add_node(sk, &nl_bucket[sk->sk_protocol].nl_table); err = 0; } } @@ -297,7 +299,7 @@ retry: netlink_table_grab(); - sk_for_each(osk, node, &nl_table[sk->sk_protocol]) { + sk_for_each(osk, node, &nl_bucket[sk->sk_protocol].nl_table) { if (nlk_sk(osk)->pid == pid) { /* Bind collision, search negative pid values. */ if (pid > 0) @@ -318,7 +320,7 @@ static inline int netlink_capable(struct socket *sock, unsigned flag) { - return (nl_nonroot[sock->sk->sk_protocol] & flag) || + return (nl_bucket[sock->sk->sk_protocol].nl_nonroot & flag) || capable(CAP_NET_ADMIN); } @@ -615,7 +617,7 @@ netlink_lock_table(); - sk_for_each(sk, node, &nl_table[protocol]) { + sk_for_each(sk, node, &nl_bucket[protocol].nl_table) { struct netlink_opt *nlk = nlk_sk(sk); if (ssk == sk) @@ -675,7 +677,7 @@ int protocol = ssk->sk_protocol; read_lock(&nl_table_lock); - sk_for_each(sk, node, &nl_table[protocol]) { + sk_for_each(sk, node, &nl_bucket[protocol].nl_table) { struct netlink_opt *nlk = nlk_sk(sk); if (ssk == sk) continue; @@ -883,7 +885,7 @@ void netlink_set_nonroot(int protocol, unsigned flags) { if ((unsigned)protocol < MAX_LINKS) - nl_nonroot[protocol] = flags; + nl_bucket[protocol].nl_nonroot = flags; } static void netlink_destroy_callback(struct netlink_callback *cb) @@ -1034,7 +1036,7 @@ return -ENOBUFS; nlk_sk(sk)->handler = function; write_lock_bh(&nl_emu_lock); - netlink_kernel[unit] = sk->sk_socket; + nl_bucket[unit].netlink_kernel = sk->sk_socket; write_unlock_bh(&nl_emu_lock); return 0; } @@ -1044,8 +1046,8 @@ struct socket *sock; write_lock_bh(&nl_emu_lock); - sock = netlink_kernel[unit]; - netlink_kernel[unit] = NULL; + sock = nl_bucket[unit].netlink_kernel; + nl_bucket[unit].netlink_kernel = NULL; write_unlock_bh(&nl_emu_lock); sock_release(sock); @@ -1056,7 +1058,7 @@ struct socket *sock; read_lock(&nl_emu_lock); - sock = netlink_kernel[unit]; + sock = nl_bucket[unit].netlink_kernel; if (sock) { struct sock *sk = sock->sk; memset(skb->cb, 0, sizeof(skb->cb)); @@ -1083,7 +1085,7 @@ loff_t off = 0; for (i=0; iprivate = (void *) i; return s; @@ -1114,7 +1116,7 @@ long i = (long)seq->private; while (++i < MAX_LINKS) { - s = sk_head(&nl_table[i]); + s = sk_head(&nl_bucket[i].nl_table); if (s) { seq->private = (void *) i; break; --------------090104060208020908070101-- From linville@ra.tuxdriver.com Tue Nov 2 13:45:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 13:45:36 -0800 (PST) Received: from ra.tuxdriver.com (ra.tuxdriver.com [24.172.12.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2LjS46028061 for ; Tue, 2 Nov 2004 13:45:29 -0800 Received: (from linville@localhost) by ra.tuxdriver.com (8.11.6/8.11.6) id iA2Lie321044; Tue, 2 Nov 2004 16:44:40 -0500 Date: Tue, 2 Nov 2004 16:44:40 -0500 From: "John W. Linville" To: Anil Gunturu Cc: netdev@oss.sgi.com, nhorman@redhat.com Subject: Re: NETLINK_ROUTE sockets in kernel Message-ID: <20041102164440.B19501@tuxdriver.com> Mail-Followup-To: Anil Gunturu , netdev@oss.sgi.com, nhorman@redhat.com References: <2f61ba570411021146657f63f4@mail.gmail.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: <2f61ba570411021146657f63f4@mail.gmail.com>; from anil.gunturu@gmail.com on Tue, Nov 02, 2004 at 11:46:46AM -0800 X-archive-position: 11368 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: linville@tuxdriver.com Precedence: bulk X-list: netdev Content-Length: 347 Lines: 12 On Tue, Nov 02, 2004 at 11:46:46AM -0800, Anil Gunturu wrote: > Hi, > I am trying to undestand the NETLINK_ROUTE protocol sockets on 2.4.18 > kernel. Specifically, I am interested in knowing how the kernel Neil Horman has been working on a paper that may be of use to you... John -- John W. Linville linville@tuxdriver.com From romieu@fr.zoreil.com Tue Nov 2 13:59:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 13:59:48 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2LxbFi028778 for ; Tue, 2 Nov 2004 13:59:38 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.10/8.12.1) with ESMTP id iA2Lu8vr028752; Tue, 2 Nov 2004 22:56:08 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.10/8.12.10/Submit) id iA2Lu864028751; Tue, 2 Nov 2004 22:56:08 +0100 Date: Tue, 2 Nov 2004 22:56:07 +0100 From: Francois Romieu To: Jon Mason Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH 3/3] r8169: clean up Message-ID: <20041102215607.GA28148@electric-eye.fr.zoreil.com> References: <200411021203.25100.jdmason@us.ibm.com> <20041102192746.GB24860@electric-eye.fr.zoreil.com> <200411021347.39047.jdmason@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200411021347.39047.jdmason@us.ibm.com> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-archive-position: 11369 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: 392 Lines: 18 Jon Mason : [...] > Silly question, does "!!" not execute a bitwise not twice? If not, then > please forgive my ignorance. logical not: ! bitwise not: ~ > If so, then it is unnecessary. But if you want something prettier, how about: > > cmd->autoneg = (status & TBINwEnable) ? AUTONEG_ENABLE : AUTONEG_DISABLE; Ok, I take it. -- Ueimor. From herbert@gondor.apana.org.au Tue Nov 2 14:06:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 14:06:52 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2M6gso029276 for ; Tue, 2 Nov 2004 14:06:44 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CP6n4-0007bj-00; Wed, 03 Nov 2004 09:06:10 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CP6mx-0003TT-00; Wed, 03 Nov 2004 09:06:03 +1100 Date: Wed, 3 Nov 2004 09:06:03 +1100 To: jamal Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [NET] Fix neighbour tbl->entries race Message-ID: <20041102220603.GA13312@gondor.apana.org.au> References: <20041102112651.GA8633@gondor.apana.org.au> <1099404823.1021.15.camel@jzny.localdomain> <20041102203720.GA12108@gondor.apana.org.au> <20041102210259.GA12642@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="zhXaljGHf11kAtnf" Content-Disposition: inline In-Reply-To: <20041102210259.GA12642@gondor.apana.org.au> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11370 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 3364 Lines: 123 --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Nov 03, 2004 at 08:02:59AM +1100, herbert wrote: > > In fact, we can make it a bit more effective/fair by checking the > previous entries count as well. Call me a flip-flop :) This extra check is silly because in the cases where it is done it is very unlikely to succeed. So here is yet another update without that check. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --zhXaljGHf11kAtnf Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== include/net/neighbour.h 1.24 vs edited ===== --- 1.24/include/net/neighbour.h 2004-10-22 14:51:12 +10:00 +++ edited/include/net/neighbour.h 2004-11-03 07:56:07 +11:00 @@ -189,7 +189,7 @@ struct timer_list gc_timer; struct timer_list proxy_timer; struct sk_buff_head proxy_queue; - int entries; + atomic_t entries; rwlock_t lock; unsigned long last_rand; struct neigh_parms *parms_list; ===== net/core/neighbour.c 1.54 vs edited ===== --- 1.54/net/core/neighbour.c 2004-10-06 04:37:37 +10:00 +++ edited/net/core/neighbour.c 2004-11-03 09:02:19 +11:00 @@ -254,18 +254,20 @@ { struct neighbour *n = NULL; unsigned long now = jiffies; + int entries; - if (tbl->entries > tbl->gc_thresh3 || - (tbl->entries > tbl->gc_thresh2 && + entries = atomic_inc_return(&tbl->entries) - 1; + if (entries >= tbl->gc_thresh3 || + (entries >= tbl->gc_thresh2 && time_after(now, tbl->last_flush + 5 * HZ))) { if (!neigh_forced_gc(tbl) && - tbl->entries > tbl->gc_thresh3) - goto out; + entries >= tbl->gc_thresh3) + goto out_entries; } n = kmem_cache_alloc(tbl->kmem_cachep, SLAB_ATOMIC); if (!n) - goto out; + goto out_entries; memset(n, 0, tbl->entry_size); @@ -281,12 +283,15 @@ NEIGH_CACHE_STAT_INC(tbl, allocs); neigh_glbl_allocs++; - tbl->entries++; n->tbl = tbl; atomic_set(&n->refcnt, 1); n->dead = 1; out: return n; + +out_entries: + atomic_dec(&tbl->entries); + goto out; } static struct neighbour **neigh_hash_alloc(unsigned int entries) @@ -427,7 +432,7 @@ write_lock_bh(&tbl->lock); - if (tbl->entries > (tbl->hash_mask + 1)) + if (atomic_read(&tbl->entries) > (tbl->hash_mask + 1)) neigh_hash_grow(tbl, (tbl->hash_mask + 1) << 1); hash_val = tbl->hash(pkey, dev) & tbl->hash_mask; @@ -608,7 +613,7 @@ NEIGH_PRINTK2("neigh %p is destroyed.\n", neigh); neigh_glbl_allocs--; - neigh->tbl->entries--; + atomic_dec(&neigh->tbl->entries); kmem_cache_free(neigh->tbl->kmem_cachep, neigh); } @@ -1394,7 +1399,7 @@ del_timer_sync(&tbl->proxy_timer); pneigh_queue_purge(&tbl->proxy_queue); neigh_ifdown(tbl, NULL); - if (tbl->entries) + if (atomic_read(&tbl->entries)) printk(KERN_CRIT "neighbour leakage\n"); write_lock(&neigh_tbl_lock); for (tp = &neigh_tables; *tp; tp = &(*tp)->next) { @@ -1951,7 +1956,7 @@ seq_printf(seq, "%08x %08lx %08lx %08lx %08lx %08lx %08lx " "%08lx %08lx %08lx %08lx\n", - tbl->entries, + atomic_read(&tbl->entries), st->allocs, st->destroys, --zhXaljGHf11kAtnf-- From herbert@gondor.apana.org.au Tue Nov 2 14:16:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 14:16:25 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2MGGWh029800 for ; Tue, 2 Nov 2004 14:16:17 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CP6vt-0007hp-00; Wed, 03 Nov 2004 09:15:17 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CP6vo-0003Uf-00; Wed, 03 Nov 2004 09:15:12 +1100 From: Herbert Xu To: Anil Gunturu Subject: Re: NETLINK_ROUTE sockets in kernel Cc: netdev@oss.sgi.com Organization: Core In-Reply-To: <2f61ba570411021146657f63f4@mail.gmail.com> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Wed, 03 Nov 2004 09:15:12 +1100 X-archive-position: 11371 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 507 Lines: 14 Anil Gunturu wrote: > > kernel. But its not clear on how the rtnetlink_links array is > populated for PF_NETLINK family. rtnetlink_init seem to populate for rtnetlink_links[PF_NETLINK] doesn't make sense. We don't have a routing system for NETLINK itself, yet. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From herbert@gondor.apana.org.au Tue Nov 2 14:16:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 14:16:46 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2MGejC029835 for ; Tue, 2 Nov 2004 14:16:40 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CP6ws-0007i2-00; Wed, 03 Nov 2004 09:16:18 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CP6wn-0003VF-00; Wed, 03 Nov 2004 09:16:13 +1100 From: Herbert Xu To: pablo@eurodev.net (Pablo Neira) Subject: Re: [NETLINK] introduce netlink bucket Cc: netdev@oss.sgi.com, davem@redhat.com Organization: Core In-Reply-To: <4187FF18.5050608@eurodev.net> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Wed, 03 Nov 2004 09:16:13 +1100 X-archive-position: 11372 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 478 Lines: 14 Pablo Neira wrote: > > This patch introduces the netlink bucket struct, it joins three arrays > into an array of netlink bucket. Please hold onto any work involving netlink itself, there are some pending patches in that area right now. Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From pablo@eurodev.net Tue Nov 2 14:24:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 14:24:47 -0800 (PST) Received: from smtp08.retemail.es (smtp08.auna.com [62.81.186.18]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2MOdse030550 for ; Tue, 2 Nov 2004 14:24:40 -0800 Received: from eurodev.net ([217.217.187.247]) by smtp09.retemail.es (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20041102222015.ZUNX10464.smtp09.retemail.es@eurodev.net>; Tue, 2 Nov 2004 23:20:15 +0100 Message-ID: <4188088D.4040506@eurodev.net> Date: Tue, 02 Nov 2004 23:22:05 +0100 From: Pablo Neira User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: Herbert Xu CC: netdev@oss.sgi.com, davem@redhat.com Subject: Re: [NETLINK] introduce netlink bucket References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11373 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: pablo@eurodev.net Precedence: bulk X-list: netdev Content-Length: 348 Lines: 18 Herbert Xu wrote: >Pablo Neira wrote: > > >>This patch introduces the netlink bucket struct, it joins three arrays >>into an array of netlink bucket. >> >> > >Please hold onto any work involving netlink itself, there are some >pending patches in that area right now. > > uh just curious, what kind of patches? Pablo From davem@davemloft.net Tue Nov 2 14:27:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 14:27:32 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2MRSml030902 for ; Tue, 2 Nov 2004 14:27:28 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CP6xU-00081S-00; Tue, 02 Nov 2004 14:16:56 -0800 Date: Tue, 2 Nov 2004 14:16:56 -0800 From: "David S. Miller" To: Pablo Neira Cc: herbert@gondor.apana.org.au, netdev@oss.sgi.com, davem@redhat.com Subject: Re: [NETLINK] introduce netlink bucket Message-Id: <20041102141656.197d657f.davem@davemloft.net> In-Reply-To: <4188088D.4040506@eurodev.net> References: <4188088D.4040506@eurodev.net> X-Mailer: Sylpheed version 0.9.99 (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: 11374 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 243 Lines: 8 On Tue, 02 Nov 2004 23:22:05 +0100 Pablo Neira wrote: > uh just curious, what kind of patches? Herbert and I have a pending patch which changes the code over to use hash lookups for the "find socket by PID" netlink code. From herbert@gondor.apana.org.au Tue Nov 2 14:54:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 14:54:46 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA2MsbL1032013 for ; Tue, 2 Nov 2004 14:54:39 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CP7XW-00084a-00; Wed, 03 Nov 2004 09:54:10 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CP7XS-0003bQ-00; Wed, 03 Nov 2004 09:54:06 +1100 Date: Wed, 3 Nov 2004 09:54:06 +1100 To: "David S. Miller" , mingo@elte.hu, netdev@oss.sgi.com Subject: [NET] Move local_bh_disable back in dev_queue_xmit Message-ID: <20041102225406.GA13760@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="TB36FDmn/VVEgNH/" Content-Disposition: inline User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11375 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 1783 Lines: 68 --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Ingo: Your recent fix to dev_queue_xmit moved the local_bh_disable to include stuff like skb_linearize and skb_checksum_help. These are potentially expensive operations. Since they don't need to run with preempt off, we could simply move the local_bh_enable up instead. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/core/dev.c 1.171 vs edited ===== --- 1.171/net/core/dev.c 2004-11-02 12:40:59 +11:00 +++ edited/net/core/dev.c 2004-11-03 09:31:09 +11:00 @@ -1261,11 +1261,6 @@ struct Qdisc *q; int rc = -ENOMEM; - /* Disable soft irqs for various locks below. Also - * stops preemption for RCU. - */ - local_bh_disable(); - if (skb_shinfo(skb)->frag_list && !(dev->features & NETIF_F_FRAGLIST) && __skb_linearize(skb, GFP_ATOMIC)) @@ -1290,6 +1285,11 @@ if (skb_checksum_help(skb, 0)) goto out_kfree_skb; + /* Disable soft irqs for various locks below. Also + * stops preemption for RCU. + */ + local_bh_disable(); + /* Updates of qdisc are serialized by queue_lock. * The struct Qdisc which is pointed to by qdisc is now a * rcu structure - it may be accessed without acquiring @@ -1363,10 +1363,10 @@ } out_enetdown: rc = -ENETDOWN; -out_kfree_skb: - kfree_skb(skb); out: local_bh_enable(); +out_kfree_skb: + kfree_skb(skb); return rc; } --TB36FDmn/VVEgNH/-- From shemminger@osdl.org Tue Nov 2 16:25:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 16:25:24 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA30PHil005775 for ; Tue, 2 Nov 2004 16:25:18 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id iA30Os918402; Tue, 2 Nov 2004 16:24:55 -0800 Date: Tue, 2 Nov 2004 16:24:54 -0800 From: Stephen Hemminger To: "David S. Miller" Cc: netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: [PATCH] UDP select handling of bad checksums. Message-Id: <20041102162454.3f153ff0@dxpl.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; x86_64-suse-linux) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 11376 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: 4321 Lines: 133 This patch addresses the issue of blocking usage of select() by UDP applications. The problem is Linux optimizes the UDP receive checksum path so that checksum validation is not performed until the application receive. This is a performance win but can cause applications that do select with blocking file descriptors to get false positives. There is a long running thread about this on LKML, as well as the cause of http://bugme.osdl.org/show_bug.cgi?id=3610 This patch makes these applications work, but keeps the one-pass performance gain for those applications smart enough to use non-blocking file descriptors with select/poll. There is still a possibility to get a false positive if application does select on non-blocking fd then makes it blocking before doing the receive, but that is unlikely. Tested by injecting bad packets with SOCK_RAW. Signed-off-by: Stephen Hemminger diff -Nru a/include/net/udp.h b/include/net/udp.h --- a/include/net/udp.h 2004-11-02 16:16:29 -08:00 +++ b/include/net/udp.h 2004-11-02 16:16:29 -08:00 @@ -71,6 +71,8 @@ extern int udp_rcv(struct sk_buff *skb); extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); extern int udp_disconnect(struct sock *sk, int flags); +extern unsigned int udp_poll(struct file *file, struct socket *sock, + poll_table *wait); DECLARE_SNMP_STAT(struct udp_mib, udp_statistics); #define UDP_INC_STATS(field) SNMP_INC_STATS(udp_statistics, field) diff -Nru a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c --- a/net/ipv4/af_inet.c 2004-11-02 16:16:29 -08:00 +++ b/net/ipv4/af_inet.c 2004-11-02 16:16:29 -08:00 @@ -809,7 +809,7 @@ .socketpair = sock_no_socketpair, .accept = sock_no_accept, .getname = inet_getname, - .poll = datagram_poll, + .poll = udp_poll, .ioctl = inet_ioctl, .listen = sock_no_listen, .shutdown = inet_shutdown, diff -Nru a/net/ipv4/udp.c b/net/ipv4/udp.c --- a/net/ipv4/udp.c 2004-11-02 16:16:29 -08:00 +++ b/net/ipv4/udp.c 2004-11-02 16:16:29 -08:00 @@ -1303,6 +1303,67 @@ return 0; } +static inline int udp_recv_ready(const struct file *file, + struct sk_buff_head *rcvq) +{ + struct sk_buff *skb; + + /* If non-blocking, can use faster single pass method. */ + if (file->f_flags & O_NONBLOCK) + return !skb_queue_empty(rcvq); + + spin_lock_irq(&rcvq->lock); + while ((skb = skb_peek(rcvq)) != NULL) { + /* checksum is wrong, silently remove it. */ + if (udp_checksum_complete(skb)) + __skb_unlink(skb, rcvq); + else { + /* no need to rescan */ + skb->ip_summed = CHECKSUM_UNNECESSARY; + break; + } + } + spin_unlock_irq(&rcvq->lock); + + return skb != NULL; +} + +/* + * Wait for a UDP event. + * + * This is same as datagram poll, except for the special case of + * blocking sockets. UDP doesn't checksum data until it is copied + * to the application on receive. So handle that special case here. + */ +unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait) +{ + struct sock *sk = sock->sk; + unsigned int mask; + + poll_wait(file, sk->sk_sleep, wait); + mask = 0; + + /* exceptional events? */ + if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) + mask |= POLLERR; + + if (sk->sk_shutdown == SHUTDOWN_MASK) + mask |= POLLHUP; + + /* readable? */ + if ( udp_recv_ready(file, &sk->sk_receive_queue) || + (sk->sk_shutdown & RCV_SHUTDOWN)) + mask |= POLLIN | POLLRDNORM; + + /* writable? */ + if (sock_writeable(sk)) + mask |= POLLOUT | POLLWRNORM | POLLWRBAND; + else + set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); + + return mask; + +} struct proto udp_prot = { .name = "UDP", @@ -1516,6 +1577,7 @@ EXPORT_SYMBOL(udp_port_rover); EXPORT_SYMBOL(udp_prot); EXPORT_SYMBOL(udp_sendmsg); +EXPORT_SYMBOL(udp_poll); #ifdef CONFIG_PROC_FS EXPORT_SYMBOL(udp_proc_register); diff -Nru a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c --- a/net/ipv6/af_inet6.c 2004-11-02 16:16:29 -08:00 +++ b/net/ipv6/af_inet6.c 2004-11-02 16:16:29 -08:00 @@ -501,7 +501,7 @@ .socketpair = sock_no_socketpair, /* a do nothing */ .accept = sock_no_accept, /* a do nothing */ .getname = inet6_getname, - .poll = datagram_poll, /* ok */ + .poll = udp_poll, /* ok */ .ioctl = inet6_ioctl, /* must change */ .listen = sock_no_listen, /* ok */ .shutdown = inet_shutdown, /* ok */ From mitch@sfgoth.com Tue Nov 2 16:51:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 16:51:30 -0800 (PST) Received: from gaz.sfgoth.com (gaz.sfgoth.com [69.36.241.230]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA30pO7A006693 for ; Tue, 2 Nov 2004 16:51:24 -0800 Received: from gaz.sfgoth.com (localhost.sfgoth.com [127.0.0.1]) by gaz.sfgoth.com (8.12.10/8.12.9) with ESMTP id iA30qsGa082330; Tue, 2 Nov 2004 16:52:54 -0800 (PST) (envelope-from mitch@gaz.sfgoth.com) Received: (from mitch@localhost) by gaz.sfgoth.com (8.12.10/8.12.6/Submit) id iA30qrxr082329; Tue, 2 Nov 2004 16:52:53 -0800 (PST) (envelope-from mitch) Date: Tue, 2 Nov 2004 16:52:53 -0800 From: Mitchell Blank Jr To: Stephen Hemminger Cc: "David S. Miller" , netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: [PATCH] UDP select handling of bad checksums. Message-ID: <20041103005253.GA77817@gaz.sfgoth.com> References: <20041102162454.3f153ff0@dxpl.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041102162454.3f153ff0@dxpl.pdx.osdl.net> User-Agent: Mutt/1.4.2.1i X-archive-position: 11377 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mitch@sfgoth.com Precedence: bulk X-list: netdev Content-Length: 1013 Lines: 29 Stephen Hemminger wrote: > This patch addresses the issue of blocking usage of select() by UDP applications. I'm glad to see someone actually putting some code forward in this debate... Looks pretty good, but can't you implement this a bit cleaner by just wrapping datagram_poll? Something like: unsigned int udp_poll(struct file *file, struct socket *sock, poll_table *wait) { unsigned int mask = datagram_poll(file, sock, wait); if ((mask & POLLRDNORM) != 0 && (file->f_flags & O_NONBLOCK) == 0 && (sk->sk_shutdown & RCV_SHUTDOWN) == 0) { struct sk_buff_head *rcvq = &sk->sk_receive_queue; struct sk_buff *skb; spin_lock_irq(&rcvq->lock); // the skb_peek() loop from your udp_rcv_ready() goes here... spin_unlock_irq(&rcvq->lock); if (skb == NULL) /* nope, nothing really ready */ mask &= ~(POLLIN | POLLRDNORM); } return mask; } That way you duplicate a lot less code. It does slightly more work but only in the broken !O_NONBLOCK case - the fast path is just as quick. -Mitch From nhorman@redhat.com Tue Nov 2 16:53:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 16:53:24 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA30rHwY007033 for ; Tue, 2 Nov 2004 16:53:17 -0800 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id iA30qlMt003268; Tue, 2 Nov 2004 19:52:47 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id iA30qlr21586; Tue, 2 Nov 2004 19:52:47 -0500 Received: from redhat.com (vpn50-74.rdu.redhat.com [172.16.50.74]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id iA30qkLu000320; Tue, 2 Nov 2004 19:52:46 -0500 Message-ID: <41882BD5.6000406@redhat.com> Date: Tue, 02 Nov 2004 19:52:37 -0500 From: Neil Horman Reply-To: nhorman@redhat.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0; hi, Mom) Gecko/20020604 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "John W. Linville" CC: Anil Gunturu , netdev@oss.sgi.com Subject: Re: NETLINK_ROUTE sockets in kernel References: <2f61ba570411021146657f63f4@mail.gmail.com> <20041102164440.B19501@tuxdriver.com> In-Reply-To: <20041102164440.B19501@tuxdriver.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11378 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: nhorman@redhat.com Precedence: bulk X-list: netdev Content-Length: 806 Lines: 35 John W. Linville wrote: >On Tue, Nov 02, 2004 at 11:46:46AM -0800, Anil Gunturu wrote: > > >>Hi, >>I am trying to undestand the NETLINK_ROUTE protocol sockets on 2.4.18 >>kernel. Specifically, I am interested in knowing how the kernel >> >> > >Neil Horman has been working on a paper that >may be of use to you... > >John > > you can fetch the latest version of that paper from my people page: http://people.redhat.com/nhorman I've been working on it a little more and may have an update for it soon. Thanks for the reference john! Neil -- /*************************************************** *Neil Horman *Software Engineer *Red Hat, Inc. *nhorman@redhat.com *gpg keyid: 1024D / 0x92A74FA1 *http://pgp.mit.edu ***************************************************/ From mingo@elte.hu Tue Nov 2 17:10:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 17:10:08 -0800 (PST) Received: from mx2.elte.hu (mx2.elte.hu [157.181.151.9]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA319w22007782 for ; Tue, 2 Nov 2004 17:09:59 -0800 Received: from chiara.elte.hu (chiara.elte.hu [157.181.150.200]) by mx2.elte.hu (Postfix) with ESMTP id 819362B5320; Wed, 3 Nov 2004 02:09:23 +0100 (CET) Received: by chiara.elte.hu (Postfix, from userid 17806) id 13A9A1FC2; Wed, 3 Nov 2004 02:09:34 +0100 (CET) Date: Wed, 3 Nov 2004 02:10:43 +0100 From: Ingo Molnar To: Herbert Xu Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [NET] Move local_bh_disable back in dev_queue_xmit Message-ID: <20041103011043.GA16771@elte.hu> References: <20041102225406.GA13760@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041102225406.GA13760@gondor.apana.org.au> User-Agent: Mutt/1.4.1i X-ELTE-SpamVersion: MailScanner 4.31.6-itk1 (ELTE 1.2) SpamAssassin 2.63 ClamAV 0.73 X-ELTE-VirusStatus: clean X-ELTE-SpamCheck: no X-ELTE-SpamCheck-Details: score=-4.9, required 5.9, autolearn=not spam, BAYES_00 -4.90 X-ELTE-SpamLevel: X-ELTE-SpamScore: -4 X-archive-position: 11379 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mingo@elte.hu Precedence: bulk X-list: netdev Content-Length: 1764 Lines: 65 sure - perfectly fine to me. Ingo * Herbert Xu wrote: > Hi Ingo: > > Your recent fix to dev_queue_xmit moved the local_bh_disable to > include stuff like skb_linearize and skb_checksum_help. These > are potentially expensive operations. Since they don't need to > run with preempt off, we could simply move the local_bh_enable > up instead. > > Signed-off-by: Herbert Xu > > Cheers, > -- > Visit Openswan at http://www.openswan.org/ > Email: Herbert Xu ~{PmV>HI~} > Home Page: http://gondor.apana.org.au/~herbert/ > PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt > ===== net/core/dev.c 1.171 vs edited ===== > --- 1.171/net/core/dev.c 2004-11-02 12:40:59 +11:00 > +++ edited/net/core/dev.c 2004-11-03 09:31:09 +11:00 > @@ -1261,11 +1261,6 @@ > struct Qdisc *q; > int rc = -ENOMEM; > > - /* Disable soft irqs for various locks below. Also > - * stops preemption for RCU. > - */ > - local_bh_disable(); > - > if (skb_shinfo(skb)->frag_list && > !(dev->features & NETIF_F_FRAGLIST) && > __skb_linearize(skb, GFP_ATOMIC)) > @@ -1290,6 +1285,11 @@ > if (skb_checksum_help(skb, 0)) > goto out_kfree_skb; > > + /* Disable soft irqs for various locks below. Also > + * stops preemption for RCU. > + */ > + local_bh_disable(); > + > /* Updates of qdisc are serialized by queue_lock. > * The struct Qdisc which is pointed to by qdisc is now a > * rcu structure - it may be accessed without acquiring > @@ -1363,10 +1363,10 @@ > } > out_enetdown: > rc = -ENETDOWN; > -out_kfree_skb: > - kfree_skb(skb); > out: > local_bh_enable(); > +out_kfree_skb: > + kfree_skb(skb); > return rc; > } > From yoshfuji@linux-ipv6.org Tue Nov 2 17:13:28 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 17:13:34 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA31DRSN008186 for ; Tue, 2 Nov 2004 17:13:27 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 7ABDF33CE5; Wed, 3 Nov 2004 10:14:06 +0900 (JST) Date: Wed, 03 Nov 2004 10:14:03 +0900 (JST) Message-Id: <20041103.101403.118617263.yoshfuji@linux-ipv6.org> To: herbert@gondor.apana.org.au Cc: hadi@cyberus.ca, davem@davemloft.net, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: [NET] Fix neighbour tbl->entries race From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20041102210259.GA12642@gondor.apana.org.au> References: <1099404823.1021.15.camel@jzny.localdomain> <20041102203720.GA12108@gondor.apana.org.au> <20041102210259.GA12642@gondor.apana.org.au> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 11380 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 542 Lines: 15 In article <20041102210259.GA12642@gondor.apana.org.au> (at Wed, 3 Nov 2004 08:02:59 +1100), Herbert Xu says: > - if (tbl->entries > tbl->gc_thresh3 || > - (tbl->entries > tbl->gc_thresh2 && > + entries = atomic_inc_return(&tbl->entries) - 1; > + if (entries >= tbl->gc_thresh3 || > + (entries >= tbl->gc_thresh2 && Why don't you do something like this? entries = atomic_inc_return(&tbl->entries); if (entries > tbl->gc_thresh3 || (entries > tbl->gc_thresh2 && --yoshfuji From herbert@gondor.apana.org.au Tue Nov 2 17:26:00 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 17:26:07 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA31PuKG008824 for ; Tue, 2 Nov 2004 17:25:59 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CP9tv-0000gj-00; Wed, 03 Nov 2004 12:25:27 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CP9to-0003s8-00; Wed, 03 Nov 2004 12:25:20 +1100 Date: Wed, 3 Nov 2004 12:25:20 +1100 To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@" Cc: hadi@cyberus.ca, davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [NET] Fix neighbour tbl->entries race Message-ID: <20041103012520.GA14818@gondor.apana.org.au> References: <1099404823.1021.15.camel@jzny.localdomain> <20041102203720.GA12108@gondor.apana.org.au> <20041102210259.GA12642@gondor.apana.org.au> <20041103.101403.118617263.yoshfuji@linux-ipv6.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103.101403.118617263.yoshfuji@linux-ipv6.org> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11381 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 1100 Lines: 28 On Wed, Nov 03, 2004 at 10:14:03AM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote: > In article <20041102210259.GA12642@gondor.apana.org.au> (at Wed, 3 Nov 2004 08:02:59 +1100), Herbert Xu says: > > > - if (tbl->entries > tbl->gc_thresh3 || > > - (tbl->entries > tbl->gc_thresh2 && > > + entries = atomic_inc_return(&tbl->entries) - 1; > > + if (entries >= tbl->gc_thresh3 || > > + (entries >= tbl->gc_thresh2 && > > Why don't you do something like this? > > entries = atomic_inc_return(&tbl->entries); > if (entries > tbl->gc_thresh3 || > (entries > tbl->gc_thresh2 && We could do that. The first form generates slightly better code on i386. However, the situation is probably reversed for other architectures. A more serious issue is that some architectures arm/arm26/um/x86_64 don't have atomic_inc_return. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From herbert@gondor.apana.org.au Tue Nov 2 17:49:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 17:49:09 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA31mwGj009564 for ; Tue, 2 Nov 2004 17:49:02 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CPAG8-0000m4-00; Wed, 03 Nov 2004 12:48:24 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CPAFz-0003wZ-00; Wed, 03 Nov 2004 12:48:15 +1100 Date: Wed, 3 Nov 2004 12:48:14 +1100 To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@" Cc: hadi@cyberus.ca, davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [NET] Fix neighbour tbl->entries race Message-ID: <20041103014814.GA15148@gondor.apana.org.au> References: <1099404823.1021.15.camel@jzny.localdomain> <20041102203720.GA12108@gondor.apana.org.au> <20041102210259.GA12642@gondor.apana.org.au> <20041103.101403.118617263.yoshfuji@linux-ipv6.org> <20041103012520.GA14818@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103012520.GA14818@gondor.apana.org.au> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11382 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 442 Lines: 11 On Wed, Nov 03, 2004 at 12:25:20PM +1100, herbert wrote: > > A more serious issue is that some architectures arm/arm26/um/x86_64 > don't have atomic_inc_return. Actually arm/arm26/x86_64 have atomic_inc_return now so it's just um. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From herbert@gondor.apana.org.au Tue Nov 2 17:53:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Tue, 02 Nov 2004 17:53:14 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA31r6Xd009950 for ; Tue, 2 Nov 2004 17:53:07 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CPAKE-0000oM-00; Wed, 03 Nov 2004 12:52:38 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CPAKD-0003y3-00; Wed, 03 Nov 2004 12:52:37 +1100 Date: Wed, 3 Nov 2004 12:52:37 +1100 To: "YOSHIFUJI Hideaki / ?$B5HF#1QL@" Cc: hadi@cyberus.ca, davem@davemloft.net, netdev@oss.sgi.com Subject: Re: [NET] Fix neighbour tbl->entries race Message-ID: <20041103015237.GA15240@gondor.apana.org.au> References: <1099404823.1021.15.camel@jzny.localdomain> <20041102203720.GA12108@gondor.apana.org.au> <20041102210259.GA12642@gondor.apana.org.au> <20041103.101403.118617263.yoshfuji@linux-ipv6.org> <20041103012520.GA14818@gondor.apana.org.au> <20041103014814.GA15148@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103014814.GA15148@gondor.apana.org.au> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11383 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 589 Lines: 15 On Wed, Nov 03, 2004 at 12:48:14PM +1100, herbert wrote: > On Wed, Nov 03, 2004 at 12:25:20PM +1100, herbert wrote: > > > > A more serious issue is that some architectures arm/arm26/um/x86_64 > > don't have atomic_inc_return. > > Actually arm/arm26/x86_64 have atomic_inc_return now so it's just um. And of course um doesn't need it since it just includes asm/arch/atomic.h :) -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From herbert@gondor.apana.org.au Wed Nov 3 01:45:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 01:45:27 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA39jIT8006506 for ; Wed, 3 Nov 2004 01:45:19 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CPHhH-0002yr-00; Wed, 03 Nov 2004 20:44:55 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CPHhD-0005dj-00; Wed, 03 Nov 2004 20:44:51 +1100 Date: Wed, 3 Nov 2004 20:44:51 +1100 To: "David S. Miller" , netdev@oss.sgi.com Subject: [TCP] Modular IPv6 support in tcpdiag Message-ID: <20041103094451.GA20220@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="n8g4imXOkfNTN/H1" Content-Disposition: inline User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11384 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 4489 Lines: 166 --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Dave: This patch allows tcpdiag to support ipv6 work as a module when itself is also a module. I was planning for a more extensible method but now I think the effort would be better directed at a new generic socket netlink interface than the TCP-specific tcpdiag. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/ipv4/Kconfig 1.22 vs edited ===== --- 1.22/net/ipv4/Kconfig 2004-11-02 11:48:28 +11:00 +++ edited/net/ipv4/Kconfig 2004-11-03 20:39:16 +11:00 @@ -351,12 +351,16 @@ config IP_TCPDIAG tristate "IP: TCP socket monitoring interface" + depends on INET default y ---help--- Support for TCP socket monitoring interface used by native Linux tools such as ss. If unsure, say Y. + +config IP_TCPDIAG_IPV6 + def_bool (IP_TCPDIAG=y && IPV6=y) || (IP_TCPDIAG=m && IPV6) source "net/ipv4/ipvs/Kconfig" ===== net/ipv4/tcp_diag.c 1.26 vs edited ===== --- 1.26/net/ipv4/tcp_diag.c 2004-11-02 11:48:28 +11:00 +++ edited/net/ipv4/tcp_diag.c 2004-11-03 20:37:03 +11:00 @@ -103,14 +103,12 @@ r->tcpdiag_wqueue = 0; r->tcpdiag_uid = 0; r->tcpdiag_inode = 0; -#ifdef CONFIG_IPV6 if (r->tcpdiag_family == AF_INET6) { ipv6_addr_copy((struct in6_addr *)r->id.tcpdiag_src, &tw->tw_v6_rcv_saddr); ipv6_addr_copy((struct in6_addr *)r->id.tcpdiag_dst, &tw->tw_v6_daddr); } -#endif nlh->nlmsg_len = skb->tail - b; return skb->len; } @@ -120,7 +118,6 @@ r->id.tcpdiag_src[0] = inet->rcv_saddr; r->id.tcpdiag_dst[0] = inet->daddr; -#ifdef CONFIG_IPV6 if (r->tcpdiag_family == AF_INET6) { struct ipv6_pinfo *np = inet6_sk(sk); @@ -129,7 +126,6 @@ ipv6_addr_copy((struct in6_addr *)r->id.tcpdiag_dst, &np->daddr); } -#endif #define EXPIRES_IN_MS(tmo) ((tmo-jiffies)*1000+HZ-1)/HZ @@ -188,11 +184,19 @@ return -1; } -extern struct sock *tcp_v4_lookup(u32 saddr, u16 sport, u32 daddr, u16 dport, int dif); -#ifdef CONFIG_IPV6 +extern struct sock *tcp_v4_lookup(u32 saddr, u16 sport, u32 daddr, u16 dport, + int dif); +#ifdef CONFIG_IP_TCPDIAG_IPV6 extern struct sock *tcp_v6_lookup(struct in6_addr *saddr, u16 sport, struct in6_addr *daddr, u16 dport, int dif); +#else +static inline struct sock *tcp_v6_lookup(struct in6_addr *saddr, u16 sport, + struct in6_addr *daddr, u16 dport, + int dif) +{ + return NULL; +} #endif static int tcpdiag_get_exact(struct sk_buff *in_skb, const struct nlmsghdr *nlh) @@ -207,13 +211,11 @@ req->id.tcpdiag_src[0], req->id.tcpdiag_sport, req->id.tcpdiag_if); } -#ifdef CONFIG_IPV6 else if (req->tcpdiag_family == AF_INET6) { sk = tcp_v6_lookup((struct in6_addr*)req->id.tcpdiag_dst, req->id.tcpdiag_dport, (struct in6_addr*)req->id.tcpdiag_src, req->id.tcpdiag_sport, req->id.tcpdiag_if); } -#endif else { return -EINVAL; } @@ -422,14 +424,12 @@ struct inet_opt *inet = inet_sk(sk); entry.family = sk->sk_family; -#ifdef CONFIG_IPV6 if (entry.family == AF_INET6) { struct ipv6_pinfo *np = inet6_sk(sk); entry.saddr = np->rcv_saddr.s6_addr32; entry.daddr = np->daddr.s6_addr32; } else -#endif { entry.saddr = &inet->rcv_saddr; entry.daddr = &inet->daddr; @@ -482,14 +482,12 @@ r->tcpdiag_wqueue = 0; r->tcpdiag_uid = sock_i_uid(sk); r->tcpdiag_inode = 0; -#ifdef CONFIG_IPV6 if (r->tcpdiag_family == AF_INET6) { ipv6_addr_copy((struct in6_addr *)r->id.tcpdiag_src, &req->af.v6_req.loc_addr); ipv6_addr_copy((struct in6_addr *)r->id.tcpdiag_dst, &req->af.v6_req.rmt_addr); } -#endif nlh->nlmsg_len = skb->tail - b; return skb->len; @@ -545,16 +543,12 @@ if (bc) { entry.saddr = -#ifdef CONFIG_IPV6 (entry.family == AF_INET6) ? req->af.v6_req.loc_addr.s6_addr32 : -#endif &req->af.v4_req.loc_addr; entry.daddr = -#ifdef CONFIG_IPV6 (entry.family == AF_INET6) ? req->af.v6_req.rmt_addr.s6_addr32 : -#endif &req->af.v4_req.rmt_addr; entry.dport = ntohs(req->rmt_port); --n8g4imXOkfNTN/H1-- From yoshfuji@linux-ipv6.org Wed Nov 3 03:25:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 03:25:32 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3BPPjM014189 for ; Wed, 3 Nov 2004 03:25:25 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id D2BBE33CE5; Wed, 3 Nov 2004 20:26:04 +0900 (JST) Date: Wed, 03 Nov 2004 20:26:04 +0900 (JST) Message-Id: <20041103.202604.56126215.yoshfuji@linux-ipv6.org> To: herbert@gondor.apana.org.au, davem@davemloft.net Cc: netdev@oss.sgi.com Subject: Re: [TCP] Modular IPv6 support in tcpdiag From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20041103094451.GA20220@gondor.apana.org.au> References: <20041103094451.GA20220@gondor.apana.org.au> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 11385 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 256 Lines: 8 In article <20041103094451.GA20220@gondor.apana.org.au> (at Wed, 3 Nov 2004 20:44:51 +1100), Herbert Xu says: > This patch allows tcpdiag to support ipv6 work as a module when itself > is also a module. I agree. --yoshfuji From tommy.christensen@tpack.net Wed Nov 3 06:49:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 06:49:30 -0800 (PST) Received: from mail.tpack.net (ip18.tpack.net [213.173.228.18]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id iA3EnMb6022495 for ; Wed, 3 Nov 2004 06:49:23 -0800 Received: (qmail 20945 invoked from network); 3 Nov 2004 14:48:59 -0000 Received: from dhcp-179.cph.tpack.net (HELO ?172.17.159.11?) (192.168.0.179) by 0 with SMTP; 3 Nov 2004 14:48:59 -0000 Message-ID: <4188EFD1.4050909@tpack.net> Date: Wed, 03 Nov 2004 15:48:49 +0100 From: Tommy Christensen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Herbert Xu CC: "David S. Miller" , mingo@elte.hu, netdev@oss.sgi.com Subject: Re: [NET] Move local_bh_disable back in dev_queue_xmit References: <20041102225406.GA13760@gondor.apana.org.au> In-Reply-To: <20041102225406.GA13760@gondor.apana.org.au> Content-Type: multipart/mixed; boundary="------------070405050509000708050508" X-archive-position: 11386 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tommy.christensen@tpack.net Precedence: bulk X-list: netdev Content-Length: 2122 Lines: 79 This is a multi-part message in MIME format. --------------070405050509000708050508 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Herbert Xu wrote: > Hi Ingo: > > Your recent fix to dev_queue_xmit moved the local_bh_disable to > include stuff like skb_linearize and skb_checksum_help. These > are potentially expensive operations. Since they don't need to > run with preempt off, we could simply move the local_bh_enable > up instead. No, this breaks the normal return path. How about this instead? Signed-off-by: Tommy S. Christensen --------------070405050509000708050508 Content-Type: text/plain; name="dev.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dev.c.patch" --- linux-2.6.10-rc1-bk/net/core/dev.c Wed Nov 3 15:10:43 2004 +++ linux-2.6.10-rc1-work/net/core/dev.c Wed Nov 3 15:31:22 2004 @@ -1261,11 +1261,6 @@ struct Qdisc *q; int rc = -ENOMEM; - /* Disable soft irqs for various locks below. Also - * stops preemption for RCU. - */ - local_bh_disable(); - if (skb_shinfo(skb)->frag_list && !(dev->features & NETIF_F_FRAGLIST) && __skb_linearize(skb, GFP_ATOMIC)) @@ -1290,6 +1285,11 @@ if (skb_checksum_help(skb, 0)) goto out_kfree_skb; + /* Disable soft irqs for various locks below. Also + * stops preemption for RCU. + */ + local_bh_disable(); + /* Updates of qdisc are serialized by queue_lock. * The struct Qdisc which is pointed to by qdisc is now a * rcu structure - it may be accessed without acquiring @@ -1352,7 +1352,6 @@ if (net_ratelimit()) printk(KERN_CRIT "Virtual device %s asks to " "queue packet!\n", dev->name); - goto out_enetdown; } else { /* Recursion is detected! It is possible, * unfortunately */ @@ -1361,10 +1360,13 @@ "%s, fix it urgently!\n", dev->name); } } -out_enetdown: + rc = -ENETDOWN; + local_bh_enable(); + out_kfree_skb: kfree_skb(skb); + return rc; out: local_bh_enable(); return rc; --------------070405050509000708050508-- From yoshfuji@linux-ipv6.org Wed Nov 3 08:20:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 08:20:57 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3GKnen031946 for ; Wed, 3 Nov 2004 08:20:50 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 745E533CE8; Thu, 4 Nov 2004 01:21:29 +0900 (JST) Date: Thu, 04 Nov 2004 01:21:28 +0900 (JST) Message-Id: <20041104.012128.51410945.yoshfuji@linux-ipv6.org> To: davem@davemloft.net, jgarzik@pobox.com Cc: linux-kernel@vger.kernel.org, netdev@oss.sgi.com, akpm@osdl.org, davem@davemloft.net, yoshfuji@linux-ipv6.org Subject: Re: IPv6 dead in -bk11 From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20041103.012923.102810732.yoshfuji@linux-ipv6.org> References: <20041102.225343.06193184.yoshfuji@linux-ipv6.org> <4187A4E3.8010600@pobox.com> <20041103.012923.102810732.yoshfuji@linux-ipv6.org> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit X-archive-position: 11387 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 1029 Lines: 37 In article <20041103.012923.102810732.yoshfuji@linux-ipv6.org> (at Wed, 03 Nov 2004 01:29:23 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > So... I guess that kernel failed to add "default route" on receipt of RA. > Right? : Sorry, this bug was introduced by my changeset: . David, this should fix the issue. Please apply. D: Don't purge default routes by RA. D: D: Signed-off-by: Hideaki YOSHIFUJI ===== net/ipv6/ndisc.c 1.103 vs edited ===== --- 1.103/net/ipv6/ndisc.c 2004-10-26 12:55:42 +09:00 +++ edited/net/ipv6/ndisc.c 2004-11-04 01:05:19 +09:00 @@ -1078,13 +1078,6 @@ return; } neigh->flags |= NTF_ROUTER; - - /* - * If we where using an "all destinations on link" route - * delete it - */ - - rt6_purge_dflt_routers(); } if (rt) -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From shemminger@osdl.org Wed Nov 3 09:14:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 09:14:53 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3HEjMP000559 for ; Wed, 3 Nov 2004 09:14:46 -0800 Received: from zqx3.pdx.osdl.net (fw.osdl.org [65.172.181.6]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id iA3HEAPE018876 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 3 Nov 2004 09:14:11 -0800 Date: Wed, 3 Nov 2004 09:16:09 -0800 From: Stephen Hemminger To: Herbert Xu Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [TCP] Modular IPv6 support in tcpdiag Message-Id: <20041103091609.7f6d5d9c@zqx3.pdx.osdl.net> In-Reply-To: <20041103094451.GA20220@gondor.apana.org.au> References: <20041103094451.GA20220@gondor.apana.org.au> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i686-suse-linux) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: osdl$Revision: 1.95 $ X-Scanned-By: MIMEDefang 2.36 X-archive-position: 11388 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: 887 Lines: 23 On Wed, 3 Nov 2004 20:44:51 +1100 Herbert Xu wrote: > Hi Dave: > > This patch allows tcpdiag to support ipv6 work as a module when itself > is also a module. > > I was planning for a more extensible method but now I think the effort > would be better directed at a new generic socket netlink interface than > the TCP-specific tcpdiag. > > Signed-off-by: Herbert Xu I wanted to ask why all the work to make tcp_diag a module? If it is a module there are more possibilties of user problems. Any utilities that expect it would then have to deal with it not being loaded as well as the possiblity of building a kernel without it. Perhaps there ought to be a CONFIG_INET_EMBEDDED that is for those configurations that want more restricted and smaller networking (ie no cache's, smaller hash tables, less sysctl options, ...) From Falko_M_Klein@gmx.de Wed Nov 3 09:38:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 09:38:37 -0800 (PST) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by oss.sgi.com (8.13.0/8.13.0) with SMTP id iA3HcVDv001347 for ; Wed, 3 Nov 2004 09:38:31 -0800 Received: (qmail 9754 invoked by uid 0); 3 Nov 2004 17:38:09 -0000 Received: from 141.78.180.92 by www6.gmx.net with HTTP; Wed, 3 Nov 2004 18:38:09 +0100 (MET) Date: Wed, 3 Nov 2004 18:38:09 +0100 (MET) From: "Anton meier" To: netdev@oss.sgi.com MIME-Version: 1.0 Subject: Interviewing some Linux Developer X-Priority: 3 (Normal) X-Authenticated: #24899823 Message-ID: <7624.1099503489@www6.gmx.net> X-Mailer: WWW-Mail 1.6 (Global Message Exchange) X-Flags: 0001 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-archive-position: 11389 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Falko_M_Klein@gmx.de Precedence: bulk X-list: netdev Content-Length: 521 Lines: 19 Hi! I'm doing my final thesis on "Coordination Mechanism and Coordination Success at Linux". In order to complete it, I would like to interview some Linux Developers about project coordination, project structure, motivation ect. The interview will be by email or by telephone (at my charge). Please send me an email if you are interested in participating. Kind regards, Falko Klein -- NEU +++ DSL Komplett von GMX +++ http://www.gmx.net/de/go/dsl GMX DSL-Netzanschluss + Tarif zum supergünstigen Komplett-Preis! From davem@davemloft.net Wed Nov 3 12:19:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 12:19:36 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3KJSNA008381 for ; Wed, 3 Nov 2004 12:19:28 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CPRR2-0001ew-00; Wed, 03 Nov 2004 12:08:48 -0800 Date: Wed, 3 Nov 2004 12:08:48 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: jgarzik@pobox.com, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, akpm@osdl.org, yoshfuji@linux-ipv6.org Subject: Re: IPv6 dead in -bk11 Message-Id: <20041103120848.632e8fee.davem@davemloft.net> In-Reply-To: <20041104.012128.51410945.yoshfuji@linux-ipv6.org> References: <20041102.225343.06193184.yoshfuji@linux-ipv6.org> <4187A4E3.8010600@pobox.com> <20041103.012923.102810732.yoshfuji@linux-ipv6.org> <20041104.012128.51410945.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.99 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id iA3KJSNA008381 X-archive-position: 11390 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 617 Lines: 16 On Thu, 04 Nov 2004 01:21:28 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > In article <20041103.012923.102810732.yoshfuji@linux-ipv6.org> (at Wed, 03 Nov 2004 01:29:23 +0900 (JST)), YOSHIFUJI Hideaki / $B5HF#1QL@(B says: > > > So... I guess that kernel failed to add "default route" on receipt of RA. > > Right? > : > > Sorry, this bug was introduced by my changeset: > . > > David, this should fix the issue. Patch applied, thanks for tracking down and fixing this bug. From davem@davemloft.net Wed Nov 3 12:31:36 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 12:31:42 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3KVZXZ008928 for ; Wed, 3 Nov 2004 12:31:36 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CPRcg-0001l1-00; Wed, 03 Nov 2004 12:20:50 -0800 Date: Wed, 3 Nov 2004 12:20:50 -0800 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: [TCP] Modular IPv6 support in tcpdiag Message-Id: <20041103122050.50f6f556.davem@davemloft.net> In-Reply-To: <20041103094451.GA20220@gondor.apana.org.au> References: <20041103094451.GA20220@gondor.apana.org.au> X-Mailer: Sylpheed version 0.9.99 (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: 11391 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 391 Lines: 12 On Wed, 3 Nov 2004 20:44:51 +1100 Herbert Xu wrote: > This patch allows tcpdiag to support ipv6 work as a module when itself > is also a module. Any particular reason you didn't use the same config ifdef tests we use for structure layouts? Ie. #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) I don't see the need for the special new config option. From herbert@gondor.apana.org.au Wed Nov 3 12:32:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 12:33:06 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3KWub5009090 for ; Wed, 3 Nov 2004 12:32:58 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CPRny-0007S1-00; Thu, 04 Nov 2004 07:32:30 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CPRnv-0006aa-00; Thu, 04 Nov 2004 07:32:27 +1100 Date: Thu, 4 Nov 2004 07:32:27 +1100 To: Stephen Hemminger Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [TCP] Modular IPv6 support in tcpdiag Message-ID: <20041103203227.GA25279@gondor.apana.org.au> References: <20041103094451.GA20220@gondor.apana.org.au> <20041103091609.7f6d5d9c@zqx3.pdx.osdl.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103091609.7f6d5d9c@zqx3.pdx.osdl.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11392 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 901 Lines: 22 On Wed, Nov 03, 2004 at 09:16:09AM -0800, Stephen Hemminger wrote: > > I wanted to ask why all the work to make tcp_diag a module? If it is > a module there are more possibilties of user problems. Any utilities > that expect it would then have to deal with it not being loaded as well > as the possiblity of building a kernel without it. The reason is that prior to this if IPv6 was built as a module then you couldn't have tcp_diag support for IPv6 sockets at all. You're absolutely right about the potential problems with modules. However, I did set the default to Y. We should also have netlink module aliases so that these modules can be loaded automatically by af_netlink. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From herbert@gondor.apana.org.au Wed Nov 3 12:34:43 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 12:34:48 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3KYeYI009594 for ; Wed, 3 Nov 2004 12:34:42 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CPRpf-0007TM-00; Thu, 04 Nov 2004 07:34:15 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CPRpe-0006b8-00; Thu, 04 Nov 2004 07:34:14 +1100 Date: Thu, 4 Nov 2004 07:34:14 +1100 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [TCP] Modular IPv6 support in tcpdiag Message-ID: <20041103203414.GB25279@gondor.apana.org.au> References: <20041103094451.GA20220@gondor.apana.org.au> <20041103122050.50f6f556.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103122050.50f6f556.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11393 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 653 Lines: 20 On Wed, Nov 03, 2004 at 12:20:50PM -0800, David S. Miller wrote: > > Any particular reason you didn't use the same config ifdef > tests we use for structure layouts? Ie. > > #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) If I used that then it'll break when TCPDIAG is built-in and IPv6 is built as a module. > I don't see the need for the special new config option. The user won't see it at all since it's a def_bool. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From davem@davemloft.net Wed Nov 3 12:40:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 12:40:31 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3KePk6010006 for ; Wed, 3 Nov 2004 12:40:25 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CPRlF-0001mJ-00; Wed, 03 Nov 2004 12:29:41 -0800 Date: Wed, 3 Nov 2004 12:29:41 -0800 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: [TCP] Modular IPv6 support in tcpdiag Message-Id: <20041103122941.71a5b440.davem@davemloft.net> In-Reply-To: <20041103203414.GB25279@gondor.apana.org.au> References: <20041103094451.GA20220@gondor.apana.org.au> <20041103122050.50f6f556.davem@davemloft.net> <20041103203414.GB25279@gondor.apana.org.au> X-Mailer: Sylpheed version 0.9.99 (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: 11394 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 485 Lines: 15 On Thu, 4 Nov 2004 07:34:14 +1100 Herbert Xu wrote: > On Wed, Nov 03, 2004 at 12:20:50PM -0800, David S. Miller wrote: > > > > Any particular reason you didn't use the same config ifdef > > tests we use for structure layouts? Ie. > > > > #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) > > If I used that then it'll break when TCPDIAG is built-in and > IPv6 is built as a module. I see, you need the ipv6 tcp socket lookup symbols... hmmm. From herbert@gondor.apana.org.au Wed Nov 3 12:43:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 12:43:57 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3Khmqi010377 for ; Wed, 3 Nov 2004 12:43:49 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CPRyY-0007b9-00; Thu, 04 Nov 2004 07:43:26 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CPRyV-0006d7-00; Thu, 04 Nov 2004 07:43:23 +1100 Date: Thu, 4 Nov 2004 07:43:21 +1100 To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: Re: [TCP] Modular IPv6 support in tcpdiag Message-ID: <20041103204321.GA25470@gondor.apana.org.au> References: <20041103094451.GA20220@gondor.apana.org.au> <20041103122050.50f6f556.davem@davemloft.net> <20041103203414.GB25279@gondor.apana.org.au> <20041103122941.71a5b440.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103122941.71a5b440.davem@davemloft.net> User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11395 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 704 Lines: 19 On Wed, Nov 03, 2004 at 12:29:41PM -0800, David S. Miller wrote: > > > If I used that then it'll break when TCPDIAG is built-in and > > IPv6 is built as a module. > > I see, you need the ipv6 tcp socket lookup symbols... hmmm. Well it really should be turned into a plugin system. However, since any effort to do that might as well be spent doing a generic socket info interface, I thought that we should just patch up tcp_diag and mark it as obsolete once we have a new interface. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From davem@davemloft.net Wed Nov 3 12:51:48 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 12:51:53 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3KplsB010851 for ; Wed, 3 Nov 2004 12:51:48 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CPRwF-0001pu-00; Wed, 03 Nov 2004 12:41:03 -0800 Date: Wed, 3 Nov 2004 12:41:03 -0800 From: "David S. Miller" To: Herbert Xu Cc: netdev@oss.sgi.com Subject: Re: [TCP] Modular IPv6 support in tcpdiag Message-Id: <20041103124103.13fe69d5.davem@davemloft.net> In-Reply-To: <20041103204321.GA25470@gondor.apana.org.au> References: <20041103094451.GA20220@gondor.apana.org.au> <20041103122050.50f6f556.davem@davemloft.net> <20041103203414.GB25279@gondor.apana.org.au> <20041103122941.71a5b440.davem@davemloft.net> <20041103204321.GA25470@gondor.apana.org.au> X-Mailer: Sylpheed version 0.9.99 (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: 11396 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 766 Lines: 19 On Thu, 4 Nov 2004 07:43:21 +1100 Herbert Xu wrote: > On Wed, Nov 03, 2004 at 12:29:41PM -0800, David S. Miller wrote: > > > > > If I used that then it'll break when TCPDIAG is built-in and > > > IPv6 is built as a module. > > > > I see, you need the ipv6 tcp socket lookup symbols... hmmm. > > Well it really should be turned into a plugin system. However, > since any effort to do that might as well be spent doing a > generic socket info interface, I thought that we should just > patch up tcp_diag and mark it as obsolete once we have a new > interface. I've put your patch in for now, but I don't know what I think about deprecating an interface that took so much effort to get people to use over the /proc/net/tcp{,6} stuff. From davem@davemloft.net Wed Nov 3 13:01:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 13:01:30 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3L1PCb011649 for ; Wed, 3 Nov 2004 13:01:25 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CPS5O-0001qz-00; Wed, 03 Nov 2004 12:50:30 -0800 Date: Wed, 3 Nov 2004 12:50:30 -0800 From: "David S. Miller" To: Tommy Christensen Cc: herbert@gondor.apana.org.au, mingo@elte.hu, netdev@oss.sgi.com Subject: Re: [NET] Move local_bh_disable back in dev_queue_xmit Message-Id: <20041103125030.211d9833.davem@davemloft.net> In-Reply-To: <4188EFD1.4050909@tpack.net> References: <20041102225406.GA13760@gondor.apana.org.au> <4188EFD1.4050909@tpack.net> X-Mailer: Sylpheed version 0.9.99 (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: 11397 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 548 Lines: 17 On Wed, 03 Nov 2004 15:48:49 +0100 Tommy Christensen wrote: > Herbert Xu wrote: > > Hi Ingo: > > > > Your recent fix to dev_queue_xmit moved the local_bh_disable to > > include stuff like skb_linearize and skb_checksum_help. These > > are potentially expensive operations. Since they don't need to > > run with preempt off, we could simply move the local_bh_enable > > up instead. > > No, this breaks the normal return path. > > How about this instead? Yep, this one is better. Patch applied, thanks everyone. From herbert@gondor.apana.org.au Wed Nov 3 13:09:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 13:10:02 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3L9rUl012149 for ; Wed, 3 Nov 2004 13:09:54 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CPSNf-0007r4-00; Thu, 04 Nov 2004 08:09:23 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CPSNY-0006fe-00; Thu, 04 Nov 2004 08:09:16 +1100 From: Herbert Xu To: tommy.christensen@tpack.net (Tommy Christensen) Subject: Re: [NET] Move local_bh_disable back in dev_queue_xmit Cc: herbert@gondor.apana.org.au, davem@davemloft.net, mingo@elte.hu, netdev@oss.sgi.com Organization: Core In-Reply-To: <4188EFD1.4050909@tpack.net> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Thu, 04 Nov 2004 08:09:16 +1100 X-archive-position: 11398 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 377 Lines: 12 Tommy Christensen wrote: > > No, this breaks the normal return path. > > How about this instead? Thanks, your patch looks much better. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From shemminger@osdl.org Wed Nov 3 13:19:10 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 13:19:15 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3LJ9XR012618 for ; Wed, 3 Nov 2004 13:19:09 -0800 Received: from zqx3.pdx.osdl.net (fw.osdl.org [65.172.181.6]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id iA3LIkPE021844 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 3 Nov 2004 13:18:46 -0800 Date: Wed, 3 Nov 2004 13:20:46 -0800 From: Stephen Hemminger To: Mitchell Blank Jr Cc: "David S. Miller" , netdev@oss.sgi.com, linux-net@vger.kernel.org Subject: Re: [PATCH] UDP select handling of bad checksums. Message-Id: <20041103132046.02061e54@zqx3.pdx.osdl.net> In-Reply-To: <20041103005253.GA77817@gaz.sfgoth.com> References: <20041102162454.3f153ff0@dxpl.pdx.osdl.net> <20041103005253.GA77817@gaz.sfgoth.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i686-suse-linux) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: osdl$Revision: 1.95 $ X-Scanned-By: MIMEDefang 2.36 X-archive-position: 11399 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: 743 Lines: 19 On Tue, 2 Nov 2004 16:52:53 -0800 Mitchell Blank Jr wrote: > Stephen Hemminger wrote: > > This patch addresses the issue of blocking usage of select() by UDP applications. > > I'm glad to see someone actually putting some code forward in this debate... > Looks pretty good, but can't you implement this a bit cleaner by just > wrapping datagram_poll? Something like: But the wrapper was bigger and uglier than just doing it. Especially since UDP doesn't need to connection oriented checks. So the fast path code in UDP is actually faster than datagram_poll. > > That way you duplicate a lot less code. It does slightly more work but > only in the broken !O_NONBLOCK case - the fast path is just as quick. > > -Mitch From tgraf@suug.ch Wed Nov 3 13:58:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 13:58:22 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3LwEEf013700 for ; Wed, 3 Nov 2004 13:58:15 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 95F7FF; Wed, 3 Nov 2004 22:57:33 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 5EDE01C0E9; Wed, 3 Nov 2004 22:58:16 +0100 (CET) Date: Wed, 3 Nov 2004 22:58:16 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com, hadi@cyberus.ca Subject: [PATCHSET 0/8] PKT_SCHED: Use gnet_stats for actions and policer Message-ID: <20041103215816.GA12289@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-archive-position: 11400 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 497 Lines: 15 Dave, This is the last patchset in my attempt to clean up traffic control statistics. It converts the action and policer code to the gnet_stats API. I decided to not provide backward compatibility for action statistics and introduce a new TLV type TCA_ACT_STATS for them in order to get some consistency and be prepared if we ever introduce statistics to classifiers. This was approved by Jamal. Shall I mark the old estimator and statistic API as __deprecated or remove it right away? Cheers From tgraf@suug.ch Wed Nov 3 13:59:04 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 13:59:11 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3Lx3ag013794 for ; Wed, 3 Nov 2004 13:59:03 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 5E2F4F; Wed, 3 Nov 2004 22:58:24 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id C40D61C0E9; Wed, 3 Nov 2004 22:59:07 +0100 (CET) Date: Wed, 3 Nov 2004 22:59:07 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com, hadi@cyberus.ca Subject: [PATCH 1/8] tcf_action: copy generic stats via TCA_ACT_STATS Message-ID: <20041103215907.GB12289@postel.suug.ch> References: <20041103215816.GA12289@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103215816.GA12289@postel.suug.ch> X-archive-position: 11401 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 3193 Lines: 107 Dumps the statistic common to all action modules via the newly introduced TLV type TCA_ACT_STATS in tcf_action_copy_stats but allows the corresponding module to dump its own statistic by implementing the get_stats callback. Signed-off-by: Thomas Graf diff -Nru linux-2.6.10-rc1-bk11.orig/include/linux/rtnetlink.h linux-2.6.10-rc1-bk11/include/linux/rtnetlink.h --- linux-2.6.10-rc1-bk11.orig/include/linux/rtnetlink.h 2004-11-02 11:43:04.000000000 +0100 +++ linux-2.6.10-rc1-bk11/include/linux/rtnetlink.h 2004-11-02 12:02:44.000000000 +0100 @@ -699,6 +699,7 @@ TCA_RATE, TCA_FCNT, TCA_STATS2, + TCA_ACT_STATS, __TCA_MAX }; diff -Nru linux-2.6.10-rc1-bk11.orig/include/net/act_api.h linux-2.6.10-rc1-bk11/include/net/act_api.h --- linux-2.6.10-rc1-bk11.orig/include/net/act_api.h 2004-11-02 11:43:07.000000000 +0100 +++ linux-2.6.10-rc1-bk11/include/net/act_api.h 2004-11-02 12:02:33.000000000 +0100 @@ -44,10 +44,16 @@ u32 capab; \ int action; \ struct tcf_t tm; \ - struct tc_stats stats; \ + struct gnet_stats_basic bstats; \ + struct gnet_stats_queue qstats; \ + struct gnet_stats_rate_est rate_est; \ spinlock_t *stats_lock; \ spinlock_t lock +struct tcf_act_hdr +{ + tca_gen(act_hdr); +}; struct tc_action { diff -Nru linux-2.6.10-rc1-bk11.orig/include/net/pkt_act.h linux-2.6.10-rc1-bk11/include/net/pkt_act.h --- linux-2.6.10-rc1-bk11.orig/include/net/pkt_act.h 2004-11-02 11:43:07.000000000 +0100 +++ linux-2.6.10-rc1-bk11/include/net/pkt_act.h 2004-11-02 12:03:01.000000000 +0100 @@ -60,7 +60,7 @@ *p1p = p->next; write_unlock_bh(&tcf_t_lock); #ifdef CONFIG_NET_ESTIMATOR - qdisc_kill_estimator(&p->stats); + gen_kill_estimator(&p->bstats, &p->rate_est); #endif kfree(p); return; @@ -256,9 +256,8 @@ p->tm.install = jiffies; p->tm.lastuse = jiffies; #ifdef CONFIG_NET_ESTIMATOR - if (est) { - qdisc_new_estimator(&p->stats, p->stats_lock, est); - } + if (est) + gen_new_estimator(&p->bstats, &p->rate_est, p->stats_lock, est); #endif h = tcf_hash(p->index); write_lock_bh(&tcf_t_lock); diff -Nru linux-2.6.10-rc1-bk11.orig/net/sched/act_api.c linux-2.6.10-rc1-bk11/net/sched/act_api.c --- linux-2.6.10-rc1-bk11.orig/net/sched/act_api.c 2004-11-02 11:43:27.000000000 +0100 +++ linux-2.6.10-rc1-bk11/net/sched/act_api.c 2004-11-02 12:06:02.000000000 +0100 @@ -416,14 +416,37 @@ int tcf_action_copy_stats (struct sk_buff *skb,struct tc_action *a) { + struct gnet_dump d; + struct tcf_act_hdr *h = a->priv; + #ifdef CONFIG_KMOD /* place holder */ #endif - if (NULL == a->ops || NULL == a->ops->get_stats) - return 1; + if (NULL == h) + goto errout; + + if (gnet_stats_start_copy(skb, TCA_ACT_STATS, h->stats_lock, &d) < 0) + goto errout; + + if (NULL != a->ops && NULL != a->ops->get_stats) + if (a->ops->get_stats(skb, a) < 0) + goto errout; + + if (gnet_stats_copy_basic(&d, &h->bstats) < 0 || +#ifdef CONFIG_NET_ESTIMATOR + gnet_stats_copy_rate_est(&d, &h->rate_est) < 0 || +#endif + gnet_stats_copy_queue(&d, &h->qstats) < 0) + goto errout; + + if (gnet_stats_finish_copy(&d) < 0) + goto errout; + + return 0; - return a->ops->get_stats(skb,a); +errout: + return -1; } From tgraf@suug.ch Wed Nov 3 13:59:44 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 13:59:47 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3Lxh5N014137 for ; Wed, 3 Nov 2004 13:59:44 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id D0226F; Wed, 3 Nov 2004 22:59:04 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 3CC341C0E9; Wed, 3 Nov 2004 22:59:48 +0100 (CET) Date: Wed, 3 Nov 2004 22:59:48 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com, hadi@cyberus.ca Subject: [PATCH 2/8] gact: use gnet_stats for action stats Message-ID: <20041103215948.GC12289@postel.suug.ch> References: <20041103215816.GA12289@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103215816.GA12289@postel.suug.ch> X-archive-position: 11402 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1286 Lines: 54 Signed-off-by: Thomas Graf diff -Nru linux-2.6.10-rc1-bk11.orig/net/sched/gact.c linux-2.6.10-rc1-bk11/net/sched/gact.c --- linux-2.6.10-rc1-bk11.orig/net/sched/gact.c 2004-11-02 11:43:27.000000000 +0100 +++ linux-2.6.10-rc1-bk11/net/sched/gact.c 2004-11-02 12:10:39.000000000 +0100 @@ -62,7 +62,7 @@ int gact_determ(struct tcf_gact *p) { - if (p->stats.packets%p->pval) + if (p->bstats.packets%p->pval) return p->action; return p->paction; } @@ -163,10 +163,10 @@ #else action = p->action; #endif - p->stats.bytes += skb->len; - p->stats.packets++; + p->bstats.bytes += skb->len; + p->bstats.packets++; if (TC_ACT_SHOT == action) - p->stats.drops++; + p->qstats.drops++; p->tm.lastuse = jiffies; spin_unlock(&p->lock); @@ -214,17 +214,6 @@ return -1; } -int -tcf_gact_stats(struct sk_buff *skb, struct tc_action *a) -{ - struct tcf_gact *p; - p = PRIV(a,gact); - if (NULL != p) - return qdisc_copy_stats(skb, &p->stats,p->stats_lock); - - return 1; -} - struct tc_action_ops act_gact_ops = { .next = NULL, .kind = "gact", @@ -232,7 +221,6 @@ .capab = TCA_CAP_NONE, .owner = THIS_MODULE, .act = tcf_gact, - .get_stats = tcf_gact_stats, .dump = tcf_gact_dump, .cleanup = tcf_gact_cleanup, .lookup = tcf_hash_search, From tgraf@suug.ch Wed Nov 3 14:00:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 14:00:26 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3M0L1V014646 for ; Wed, 3 Nov 2004 14:00:22 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id AEFC8F; Wed, 3 Nov 2004 22:59:42 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 1C8FD1C0E9; Wed, 3 Nov 2004 23:00:26 +0100 (CET) Date: Wed, 3 Nov 2004 23:00:26 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com, hadi@cyberus.ca Subject: [PATCH 3/8] ipt: use gnet_stats for action stats Message-ID: <20041103220026.GD12289@postel.suug.ch> References: <20041103215816.GA12289@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103215816.GA12289@postel.suug.ch> X-archive-position: 11403 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1533 Lines: 63 Signed-off-by: Thomas Graf diff -Nru linux-2.6.10-rc1-bk11.orig/net/sched/ipt.c linux-2.6.10-rc1-bk11/net/sched/ipt.c --- linux-2.6.10-rc1-bk11.orig/net/sched/ipt.c 2004-11-02 11:59:44.000000000 +0100 +++ linux-2.6.10-rc1-bk11/net/sched/ipt.c 2004-11-02 12:14:04.000000000 +0100 @@ -218,9 +218,8 @@ */ p->tm.install = jiffies; #ifdef CONFIG_NET_ESTIMATOR - if (est) { - qdisc_new_estimator(&p->stats, p->stats_lock, est); - } + if (est) + gen_new_estimator(&p->bstats, &p->rate_est, p->stats_lock, est); #endif h = tcf_hash(p->index); write_lock_bh(&ipt_lock); @@ -258,8 +257,8 @@ spin_lock(&p->lock); p->tm.lastuse = jiffies; - p->stats.bytes += skb->len; - p->stats.packets++; + p->bstats.bytes += skb->len; + p->bstats.packets++; if (skb_cloned(skb) ) { if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) { @@ -278,7 +277,7 @@ break; case NF_DROP: result = TC_ACT_SHOT; - p->stats.drops++; + p->qstats.drops++; break; case IPT_CONTINUE: result = TC_ACT_PIPE; @@ -346,17 +345,6 @@ return -1; } -int -tcf_ipt_stats(struct sk_buff *skb, struct tc_action *a) -{ - struct tcf_ipt *p; - p = PRIV(a,ipt); - if (NULL != p) - return qdisc_copy_stats(skb, &p->stats, p->stats_lock); - - return 1; -} - struct tc_action_ops act_ipt_ops = { .next = NULL, .kind = "ipt", @@ -364,7 +352,6 @@ .capab = TCA_CAP_NONE, .owner = THIS_MODULE, .act = tcf_ipt, - .get_stats = tcf_ipt_stats, .dump = tcf_ipt_dump, .cleanup = tcf_ipt_cleanup, .lookup = tcf_hash_search, From tgraf@suug.ch Wed Nov 3 14:00:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 14:01:04 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3M0xk6014986 for ; Wed, 3 Nov 2004 14:00:59 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 63D0FF; Wed, 3 Nov 2004 23:00:20 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id BE4991C0E9; Wed, 3 Nov 2004 23:01:03 +0100 (CET) Date: Wed, 3 Nov 2004 23:01:03 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com, hadi@cyberus.ca Subject: [PATCH 4/8] mirred: use gnet_stats for action stats Message-ID: <20041103220103.GE12289@postel.suug.ch> References: <20041103215816.GA12289@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103215816.GA12289@postel.suug.ch> X-archive-position: 11404 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1473 Lines: 56 Signed-off-by: Thomas Graf diff -Nru linux-2.6.10-rc1-bk11.orig/net/sched/mirred.c linux-2.6.10-rc1-bk11/net/sched/mirred.c --- linux-2.6.10-rc1-bk11.orig/net/sched/mirred.c 2004-11-02 11:43:27.000000000 +0100 +++ linux-2.6.10-rc1-bk11/net/sched/mirred.c 2004-11-02 12:10:07.000000000 +0100 @@ -195,9 +195,9 @@ bad_mirred: if (NULL != skb2) kfree_skb(skb2); - p->stats.overlimits++; - p->stats.bytes += skb->len; - p->stats.packets++; + p->qstats.overlimits++; + p->bstats.bytes += skb->len; + p->bstats.packets++; spin_unlock(&p->lock); /* should we be asking for packet to be dropped? * may make sense for redirect case only @@ -216,8 +216,8 @@ goto bad_mirred; } - p->stats.bytes += skb2->len; - p->stats.packets++; + p->bstats.bytes += skb2->len; + p->bstats.packets++; if ( !(at & AT_EGRESS)) { if (p->ok_push) { skb_push(skb2, skb2->dev->hard_header_len); @@ -268,18 +268,6 @@ return -1; } -int -tcf_mirred_stats(struct sk_buff *skb, struct tc_action *a) -{ - struct tcf_mirred *p; - p = PRIV(a,mirred); - - if (NULL != p) - return qdisc_copy_stats(skb, &p->stats, p->stats_lock); - - return 1; -} - static struct tc_action_ops act_mirred_ops = { .next = NULL, .kind = "mirred", @@ -287,7 +275,6 @@ .capab = TCA_CAP_NONE, .owner = THIS_MODULE, .act = tcf_mirred, - .get_stats = tcf_mirred_stats, .dump = tcf_mirred_dump, .cleanup = tcf_mirred_cleanup, .lookup = tcf_hash_search, From tgraf@suug.ch Wed Nov 3 14:01:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 14:01:33 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3M1SHj015222 for ; Wed, 3 Nov 2004 14:01:29 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id BACF9F; Wed, 3 Nov 2004 23:00:49 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 25BBE1C0E9; Wed, 3 Nov 2004 23:01:33 +0100 (CET) Date: Wed, 3 Nov 2004 23:01:33 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com, hadi@cyberus.ca Subject: [PATCH 5/8] pedit: use gnet_stats for action stats Message-ID: <20041103220133.GF12289@postel.suug.ch> References: <20041103215816.GA12289@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103215816.GA12289@postel.suug.ch> X-archive-position: 11405 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1076 Lines: 45 Signed-off-by: Thomas Graf diff -Nru linux-2.6.10-rc1-bk11.orig/net/sched/pedit.c linux-2.6.10-rc1-bk11/net/sched/pedit.c --- linux-2.6.10-rc1-bk11.orig/net/sched/pedit.c 2004-11-02 11:43:27.000000000 +0100 +++ linux-2.6.10-rc1-bk11/net/sched/pedit.c 2004-11-02 12:11:11.000000000 +0100 @@ -183,10 +183,10 @@ } bad: - p->stats.overlimits++; + p->qstats.overlimits++; done: - p->stats.bytes += skb->len; - p->stats.packets++; + p->bstats.bytes += skb->len; + p->bstats.packets++; spin_unlock(&p->lock); return p->action; } @@ -255,17 +255,6 @@ return -1; } -int -tcf_pedit_stats(struct sk_buff *skb, struct tc_action *a) -{ - struct tcf_pedit *p; - p = PRIV(a,pedit); - if (NULL != p) - return qdisc_copy_stats(skb, &p->stats, p->stats_lock); - - return 1; -} - static struct tc_action_ops act_pedit_ops = { .kind = "pedit", @@ -273,7 +262,6 @@ .capab = TCA_CAP_NONE, .owner = THIS_MODULE, .act = tcf_pedit, - .get_stats = tcf_pedit_stats, .dump = tcf_pedit_dump, .cleanup = tcf_pedit_cleanup, .lookup = tcf_hash_search, From tgraf@suug.ch Wed Nov 3 14:01:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 14:02:02 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3M1vY6015546 for ; Wed, 3 Nov 2004 14:01:57 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 79F0AF; Wed, 3 Nov 2004 23:01:18 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id DC1751C0E9; Wed, 3 Nov 2004 23:02:01 +0100 (CET) Date: Wed, 3 Nov 2004 23:02:01 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com, hadi@cyberus.ca Subject: [PATCH 6/8] police: use gnet_stats for action policer stats Message-ID: <20041103220201.GG12289@postel.suug.ch> References: <20041103215816.GA12289@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103215816.GA12289@postel.suug.ch> X-archive-position: 11406 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1713 Lines: 65 Signed-off-by: Thomas Graf diff -Nru linux-2.6.10-rc1-bk11.orig/net/sched/police.c linux-2.6.10-rc1-bk11/net/sched/police.c --- linux-2.6.10-rc1-bk11.orig/net/sched/police.c 2004-11-02 11:43:27.000000000 +0100 +++ linux-2.6.10-rc1-bk11/net/sched/police.c 2004-11-02 13:54:14.000000000 +0100 @@ -245,7 +245,7 @@ p->index = parm->index ? : tcf_police_new_index(); #ifdef CONFIG_NET_ESTIMATOR if (est) - qdisc_new_estimator(&p->stats, p->stats_lock, est); + gen_new_estimator(&p->bstats, &p->rate_est, p->stats_lock, est); #endif h = tcf_police_hash(p->index); write_lock_bh(&police_lock); @@ -275,16 +275,6 @@ return 0; } -int tcf_act_police_stats(struct sk_buff *skb, struct tc_action *a) -{ - struct tcf_police *p; - p = PRIV(a); - if (NULL != p) - return qdisc_copy_stats(skb, &p->stats, p->stats_lock); - - return 1; -} - int tcf_act_police(struct sk_buff **pskb, struct tc_action *a) { psched_time_t now; @@ -302,12 +292,12 @@ spin_lock(&p->lock); - p->stats.bytes += skb->len; - p->stats.packets++; + p->bstats.bytes += skb->len; + p->bstats.packets++; #ifdef CONFIG_NET_ESTIMATOR - if (p->ewma_rate && p->stats.bps >= p->ewma_rate) { - p->stats.overlimits++; + if (p->ewma_rate && p->rate_est.bps >= p->ewma_rate) { + p->qstats.overlimits++; spin_unlock(&p->lock); return p->action; } @@ -343,7 +333,7 @@ } } - p->stats.overlimits++; + p->qstats.overlimits++; spin_unlock(&p->lock); return p->action; } @@ -400,7 +390,6 @@ .capab = TCA_CAP_NONE, .owner = THIS_MODULE, .act = tcf_act_police, - .get_stats = tcf_act_police_stats, .dump = tcf_act_police_dump, .cleanup = tcf_act_police_cleanup, .lookup = tcf_hash_search, From tgraf@suug.ch Wed Nov 3 14:02:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 14:02:38 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3M2Vac015922 for ; Wed, 3 Nov 2004 14:02:32 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id CD20BF; Wed, 3 Nov 2004 23:01:52 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 407EE1C0E9; Wed, 3 Nov 2004 23:02:36 +0100 (CET) Date: Wed, 3 Nov 2004 23:02:36 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com, hadi@cyberus.ca Subject: [PATCH 7/8] police: use gnet_stats for old policer stats Message-ID: <20041103220236.GH12289@postel.suug.ch> References: <20041103215816.GA12289@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103215816.GA12289@postel.suug.ch> X-archive-position: 11407 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 3248 Lines: 110 Transforms old policer to use generic statistic via TCA_STATS2 and maintain backward compatibility via TCA_STATS. Adds a new API for classifiers to invoke the dumping process. Signed-off-by: Thomas Graf diff -Nru linux-2.6.10-rc1-bk13.orig/include/net/act_api.h linux-2.6.10-rc1-bk13/include/net/act_api.h --- linux-2.6.10-rc1-bk13.orig/include/net/act_api.h 2004-11-03 17:04:58.000000000 +0100 +++ linux-2.6.10-rc1-bk13/include/net/act_api.h 2004-11-03 17:04:44.000000000 +0100 @@ -28,7 +28,9 @@ struct qdisc_rate_table *R_tab; struct qdisc_rate_table *P_tab; - struct tc_stats stats; + struct gnet_stats_basic bstats; + struct gnet_stats_queue qstats; + struct gnet_stats_rate_est rate_est; spinlock_t *stats_lock; }; @@ -101,6 +103,7 @@ extern void tcf_police_destroy(struct tcf_police *p); extern struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est); extern int tcf_police_dump(struct sk_buff *skb, struct tcf_police *p); +extern int tcf_police_dump_stats(struct sk_buff *skb, struct tcf_police *p); static inline int tcf_police_release(struct tcf_police *p, int bind) diff -Nru linux-2.6.10-rc1-bk13.orig/net/sched/police.c linux-2.6.10-rc1-bk13/net/sched/police.c --- linux-2.6.10-rc1-bk13.orig/net/sched/police.c 2004-11-03 17:05:10.000000000 +0100 +++ linux-2.6.10-rc1-bk13/net/sched/police.c 2004-11-03 17:04:44.000000000 +0100 @@ -149,7 +149,7 @@ *p1p = p->next; write_unlock_bh(&police_lock); #ifdef CONFIG_NET_ESTIMATOR - qdisc_kill_estimator(&p->stats); + gen_kill_estimator(&p->bstats, &p->rate_est); #endif if (p->R_tab) qdisc_put_rtab(p->R_tab); @@ -469,7 +469,7 @@ p->action = parm->action; #ifdef CONFIG_NET_ESTIMATOR if (est) - qdisc_new_estimator(&p->stats, p->stats_lock, est); + gen_new_estimator(&p->bstats, &p->rate_est, p->stats_lock, est); #endif h = tcf_police_hash(p->index); write_lock_bh(&police_lock); @@ -493,12 +493,12 @@ spin_lock(&p->lock); - p->stats.bytes += skb->len; - p->stats.packets++; + p->bstats.bytes += skb->len; + p->bstats.packets++; #ifdef CONFIG_NET_ESTIMATOR - if (p->ewma_rate && p->stats.bps >= p->ewma_rate) { - p->stats.overlimits++; + if (p->ewma_rate && p->rate_est.bps >= p->ewma_rate) { + p->qstats.overlimits++; spin_unlock(&p->lock); return p->action; } @@ -534,7 +534,7 @@ } } - p->stats.overlimits++; + p->qstats.overlimits++; spin_unlock(&p->lock); return p->action; } @@ -570,9 +570,34 @@ return -1; } +int tcf_police_dump_stats(struct sk_buff *skb, struct tcf_police *p) +{ + struct gnet_dump d; + + if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, + TCA_XSTATS, p->stats_lock, &d) < 0) + + if (gnet_stats_copy_basic(&d, &p->bstats) < 0 || +#ifdef CONFIG_NET_ESTIMATOR + gnet_stats_copy_rate_est(&d, &p->rate_est) < 0 || +#endif + gnet_stats_copy_queue(&d, &p->qstats) < 0) + goto errout; + + if (gnet_stats_finish_copy(&d) < 0) + goto errout; + + return 0; + +errout: + return -1; +} + + EXPORT_SYMBOL(tcf_police); EXPORT_SYMBOL(tcf_police_destroy); EXPORT_SYMBOL(tcf_police_dump); +EXPORT_SYMBOL(tcf_police_dump_stats); EXPORT_SYMBOL(tcf_police_hash); EXPORT_SYMBOL(tcf_police_ht); EXPORT_SYMBOL(tcf_police_locate); From tgraf@suug.ch Wed Nov 3 14:03:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 14:03:12 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3M36xD016253 for ; Wed, 3 Nov 2004 14:03:07 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id EB514F; Wed, 3 Nov 2004 23:02:27 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 380421C0E9; Wed, 3 Nov 2004 23:03:11 +0100 (CET) Date: Wed, 3 Nov 2004 23:03:11 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com, hadi@cyberus.ca Subject: [PATCH 8/8] cls_*: use tcf_police_dump_stats to dump via new gnet_stats API Message-ID: <20041103220311.GI12289@postel.suug.ch> References: <20041103215816.GA12289@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103215816.GA12289@postel.suug.ch> X-archive-position: 11408 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 2456 Lines: 70 Signed-off-by: Thomas Graf diff -Nru linux-2.6.10-rc1-bk11.orig/net/sched/cls_fw.c linux-2.6.10-rc1-bk11/net/sched/cls_fw.c --- linux-2.6.10-rc1-bk11.orig/net/sched/cls_fw.c 2004-11-02 11:43:27.000000000 +0100 +++ linux-2.6.10-rc1-bk11/net/sched/cls_fw.c 2004-11-02 13:53:52.000000000 +0100 @@ -395,11 +395,9 @@ } #else /* CONFIG_NET_CLS_ACT */ #ifdef CONFIG_NET_CLS_POLICE - if (f->police) { - if (qdisc_copy_stats(skb, &f->police->stats, - f->police->stats_lock)) + if (f->police) + if (tcf_police_dump_stats(skb, f->police) < 0) goto rtattr_failure; - } #endif /* CONFIG_NET_CLS_POLICE */ #endif /* CONFIG_NET_CLS_ACT */ return skb->len; diff -Nru linux-2.6.10-rc1-bk11.orig/net/sched/cls_route.c linux-2.6.10-rc1-bk11/net/sched/cls_route.c --- linux-2.6.10-rc1-bk11.orig/net/sched/cls_route.c 2004-11-02 11:43:27.000000000 +0100 +++ linux-2.6.10-rc1-bk11/net/sched/cls_route.c 2004-11-02 13:53:52.000000000 +0100 @@ -566,11 +566,9 @@ rta->rta_len = skb->tail - b; #ifdef CONFIG_NET_CLS_POLICE - if (f->police) { - if (qdisc_copy_stats(skb, &f->police->stats, - f->police->stats_lock)) + if (f->police) + if (tcf_police_dump_stats(skb, f->police) < 0) goto rtattr_failure; - } #endif return skb->len; diff -Nru linux-2.6.10-rc1-bk11.orig/net/sched/cls_rsvp.h linux-2.6.10-rc1-bk11/net/sched/cls_rsvp.h --- linux-2.6.10-rc1-bk11.orig/net/sched/cls_rsvp.h 2004-11-02 11:43:27.000000000 +0100 +++ linux-2.6.10-rc1-bk11/net/sched/cls_rsvp.h 2004-11-02 13:53:52.000000000 +0100 @@ -631,11 +631,9 @@ rta->rta_len = skb->tail - b; #ifdef CONFIG_NET_CLS_POLICE - if (f->police) { - if (qdisc_copy_stats(skb, &f->police->stats, - f->police->stats_lock)) + if (f->police) + if (tcf_police_dump_stats(skb, f->police) < 0) goto rtattr_failure; - } #endif return skb->len; diff -Nru linux-2.6.10-rc1-bk11.orig/net/sched/cls_u32.c linux-2.6.10-rc1-bk11/net/sched/cls_u32.c --- linux-2.6.10-rc1-bk11.orig/net/sched/cls_u32.c 2004-11-02 11:43:27.000000000 +0100 +++ linux-2.6.10-rc1-bk11/net/sched/cls_u32.c 2004-11-02 13:53:52.000000000 +0100 @@ -775,11 +775,9 @@ } #else #ifdef CONFIG_NET_CLS_POLICE - if (TC_U32_KEY(n->handle) && n->police) { - if (qdisc_copy_stats(skb, &n->police->stats, - n->police->stats_lock)) + if (TC_U32_KEY(n->handle) && n->police) + if (tcf_police_dump_stats(skb, n->police) < 0) goto rtattr_failure; - } #endif #endif return skb->len; From davem@davemloft.net Wed Nov 3 14:29:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 14:29:14 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3MT7BM017369 for ; Wed, 3 Nov 2004 14:29:08 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CPTSO-0001zL-00; Wed, 03 Nov 2004 14:18:20 -0800 Date: Wed, 3 Nov 2004 14:18:20 -0800 From: "David S. Miller" To: Thomas Graf Cc: netdev@oss.sgi.com, hadi@cyberus.ca Subject: Re: [PATCHSET 0/8] PKT_SCHED: Use gnet_stats for actions and policer Message-Id: <20041103141820.7a0c7832.davem@davemloft.net> In-Reply-To: <20041103215816.GA12289@postel.suug.ch> References: <20041103215816.GA12289@postel.suug.ch> X-Mailer: Sylpheed version 0.9.99 (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: 11409 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 683 Lines: 19 On Wed, 3 Nov 2004 22:58:16 +0100 Thomas Graf wrote: > This is the last patchset in my attempt to clean up traffic > control statistics. It converts the action and policer code > to the gnet_stats API. > > I decided to not provide backward compatibility for action > statistics and introduce a new TLV type TCA_ACT_STATS for them > in order to get some consistency and be prepared if we ever > introduce statistics to classifiers. This was approved by Jamal. All applied, very nice work Thomas. > Shall I mark the old estimator and statistic API as __deprecated > or remove it right away? Since nothing in the tree uses it any more, let's just kill it outright. From linux-netdev@gmane.org Wed Nov 3 15:33:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 15:33:32 -0800 (PST) Received: from main.gmane.org (main.gmane.org [80.91.229.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA3NXOgn019379 for ; Wed, 3 Nov 2004 15:33:25 -0800 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CPUck-0007B6-00 for ; Thu, 04 Nov 2004 00:33:06 +0100 Received: from lan-outside.tiba.com ([200.61.64.36]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Nov 2004 00:33:06 +0100 Received: from javier by lan-outside.tiba.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Nov 2004 00:33:06 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: netdev@oss.sgi.com From: Javier Szyszlican Subject: Outbound IPIP Tunnel Packets not shaped/policed Date: Wed, 03 Nov 2004 20:36:14 -0300 Organization: TIBA Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: lan-outside.tiba.com User-Agent: Mozilla Thunderbird 0.8 (X11/20040921) X-Accept-Language: en-us, en X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime X-archive-position: 11410 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: javier@szysz.com Precedence: bulk X-list: netdev Content-Length: 1633 Lines: 55 Hi, I've a gateway host (cali), connected to the Internet via ADSL and a PPTP tunnel (ppp0). I also have a IPIP tunnel to another host over the Internet (mytun). I want to give more priority to the IPIP packets coming OUT of the PPP (PPTP connection) interface. And I can't get this to work. Class 2:21 is the one with high priority. FILTERS: filter parent 2: protocol ip pref 1 fw filter parent 2: protocol ip pref 1 fw handle 0x1 classid 2:21 CLASS Stats: class htb 2:21 parent 2:1 prio 1 rate 96Kbit ceil 128Kbit burst 1721b cburst 1762b Sent 0 bytes 0 pkts (dropped 0, overlimits 0) lended: 0 borrowed: 0 giants: 0 tokens: 218962 ctokens: 168131 As you can see no packets have gone out of this class. IPTABLES RULES (mangle table): Chain OUTPUT (policy ACCEPT 794K packets, 111M bytes) pkts bytes target prot opt in out source destination 4984 377K mark.4 4 -- * * 0.0.0.0/0 0.0.0.0/0 Chain mark.4 (1 references) pkts bytes target prot opt in out source destination 4984 377K MARK all -- * * 0.0.0.0/0 0.0.0.0/0 MARK set 0x1 But you can see that iptables is marking the packets correctly (the counters were reset at the same time). So, I'm guessing that the IPIP packets generated by the kernel, are not going into the packet scheduling routines/functions. If someone can point me to the place where this should be occurring, it will be great. I'm using Kernel 2.6.9 (2.6.8 did the same thing). Thanks. Javier -- -=-=-=-=-=-=-=-=- Javier Szyszlican javier@^^^^^.com From davem@davemloft.net Wed Nov 3 16:02:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 16:02:29 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA402LUx020253 for ; Wed, 3 Nov 2004 16:02:21 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CPUrh-0002Av-00; Wed, 03 Nov 2004 15:48:33 -0800 Date: Wed, 3 Nov 2004 15:48:33 -0800 From: "David S. Miller" To: Pablo Neira Cc: netdev@oss.sgi.com, davem@redhat.com, herbert@gondor.apana.org.au Subject: Re: [NETLINK] introduce netlink bucket Message-Id: <20041103154833.164e33f5.davem@davemloft.net> In-Reply-To: <4187FF18.5050608@eurodev.net> References: <4187FF18.5050608@eurodev.net> X-Mailer: Sylpheed version 0.9.99 (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: 11411 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 16499 Lines: 737 On Tue, 02 Nov 2004 22:41:44 +0100 Pablo Neira wrote: > This patch introduces the netlink bucket struct, it joins three arrays > into an array of netlink bucket. > > Signed-off-by: Pablo Neira Ayuso Here is the work Herbert and I were talking about. It kind of makes your patch taken care of already :-) Herbert, this is what I actually checked into my tree. If you could cook up a 2.4.x version, that would be really great. # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/03 15:34:53-08:00 herbert@gondor.apana.org.au # [NETLINK]: Hash sockets by pid if not multicast. # # Collaborative work between David S. Miller and # Herbert Xu. # # Signed-off-by: Herbert Xu # Signed-off-by: David S. Miller # # net/netlink/af_netlink.c # 2004/11/03 15:33:45-08:00 herbert@gondor.apana.org.au +374 -109 # [NETLINK]: Hash sockets by pid if not multicast. # diff -Nru a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c --- a/net/netlink/af_netlink.c 2004-11-03 15:35:38 -08:00 +++ b/net/netlink/af_netlink.c 2004-11-03 15:35:38 -08:00 @@ -44,6 +44,12 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include #include @@ -56,9 +62,9 @@ struct netlink_opt { u32 pid; - unsigned groups; + unsigned int groups; u32 dst_pid; - unsigned dst_groups; + unsigned int dst_groups; unsigned long state; int (*handler)(int unit, struct sk_buff *skb); wait_queue_head_t wait; @@ -69,9 +75,28 @@ #define nlk_sk(__sk) ((struct netlink_opt *)(__sk)->sk_protinfo) -static struct hlist_head nl_table[MAX_LINKS]; +struct nl_pid_hash { + struct hlist_head *table; + unsigned long rehash_time; + + unsigned int mask; + unsigned int shift; + + unsigned int entries; + unsigned int max_shift; + + u32 rnd; +}; + +struct netlink_table { + struct nl_pid_hash hash; + struct hlist_head mc_list; +}; + +static struct netlink_table *nl_table; + static DECLARE_WAIT_QUEUE_HEAD(nl_table_wait); -static unsigned nl_nonroot[MAX_LINKS]; +static unsigned int nl_nonroot[MAX_LINKS]; #ifdef NL_EMULATE_DEV static struct socket *netlink_kernel[MAX_LINKS]; @@ -85,6 +110,11 @@ static struct notifier_block *netlink_chain; +static struct hlist_head *nl_pid_hashfn(struct nl_pid_hash *hash, u32 pid) +{ + return &hash->table[jhash_1word(pid, hash->rnd) & hash->mask]; +} + static void netlink_sock_destruct(struct sock *sk) { skb_queue_purge(&sk->sk_receive_queue); @@ -153,11 +183,14 @@ static __inline__ struct sock *netlink_lookup(int protocol, u32 pid) { + struct nl_pid_hash *hash = &nl_table[protocol].hash; + struct hlist_head *head; struct sock *sk; struct hlist_node *node; read_lock(&nl_table_lock); - sk_for_each(sk, node, &nl_table[protocol]) { + head = nl_pid_hashfn(hash, pid); + sk_for_each(sk, node, head) { if (nlk_sk(sk)->pid == pid) { sock_hold(sk); goto found; @@ -169,27 +202,118 @@ return sk; } +static inline struct hlist_head *nl_pid_hash_alloc(size_t size) +{ + if (size <= PAGE_SIZE) + return kmalloc(size, GFP_ATOMIC); + else + return (struct hlist_head *) + __get_free_pages(GFP_ATOMIC, get_order(size)); +} + +static inline void nl_pid_hash_free(struct hlist_head *table, size_t size) +{ + if (size <= PAGE_SIZE) + kfree(table); + else + free_pages((unsigned long)table, get_order(size)); +} + +static int nl_pid_hash_rehash(struct nl_pid_hash *hash, int grow) +{ + unsigned int omask, mask, shift; + size_t osize, size; + struct hlist_head *otable, *table; + int i; + + omask = mask = hash->mask; + osize = size = (mask + 1) * sizeof(*table); + shift = hash->shift; + + if (grow) { + if (++shift > hash->max_shift) + return 0; + mask = mask * 2 + 1; + size *= 2; + } + + table = nl_pid_hash_alloc(size); + if (!table) + return 0; + + memset(table, 0, size); + otable = hash->table; + hash->table = table; + hash->mask = mask; + hash->shift = shift; + get_random_bytes(&hash->rnd, sizeof(hash->rnd)); + + for (i = 0; i <= omask; i++) { + struct sock *sk; + struct hlist_node *node, *tmp; + + sk_for_each_safe(sk, node, tmp, &otable[i]) + __sk_add_node(sk, nl_pid_hashfn(hash, nlk_sk(sk)->pid)); + } + + nl_pid_hash_free(otable, osize); + hash->rehash_time = jiffies + 10 * 60 * HZ; + return 1; +} + +static inline int nl_pid_hash_dilute(struct nl_pid_hash *hash, int len) +{ + int avg = hash->entries >> hash->shift; + + if (unlikely(avg > 1) && nl_pid_hash_rehash(hash, 1)) + return 1; + + if (unlikely(len > avg) && time_after(jiffies, hash->rehash_time)) { + nl_pid_hash_rehash(hash, 0); + return 1; + } + + return 0; +} + static struct proto_ops netlink_ops; static int netlink_insert(struct sock *sk, u32 pid) { + struct nl_pid_hash *hash = &nl_table[sk->sk_protocol].hash; + struct hlist_head *head; int err = -EADDRINUSE; struct sock *osk; struct hlist_node *node; + int len; netlink_table_grab(); - sk_for_each(osk, node, &nl_table[sk->sk_protocol]) { + head = nl_pid_hashfn(hash, pid); + len = 0; + sk_for_each(osk, node, head) { if (nlk_sk(osk)->pid == pid) break; + len++; } - if (!node) { - err = -EBUSY; - if (nlk_sk(sk)->pid == 0) { - nlk_sk(sk)->pid = pid; - sk_add_node(sk, &nl_table[sk->sk_protocol]); - err = 0; - } - } + if (node) + goto err; + + err = -EBUSY; + if (nlk_sk(sk)->pid) + goto err; + + err = -ENOMEM; + if (BITS_PER_LONG > 32 && unlikely(hash->entries >= UINT_MAX)) + goto err; + + if (len && nl_pid_hash_dilute(hash, len)) + head = nl_pid_hashfn(hash, pid); + hash->entries++; + nlk_sk(sk)->pid = pid; + sk_add_node(sk, head); + err = 0; + +err: netlink_table_ungrab(); return err; } @@ -197,7 +321,10 @@ static void netlink_remove(struct sock *sk) { netlink_table_grab(); + nl_table[sk->sk_protocol].hash.entries--; sk_del_node_init(sk); + if (nlk_sk(sk)->groups) + __sk_del_bind_node(sk); netlink_table_ungrab(); } @@ -282,19 +409,25 @@ static int netlink_autobind(struct socket *sock) { struct sock *sk = sock->sk; + struct nl_pid_hash *hash = &nl_table[sk->sk_protocol].hash; + struct hlist_head *head; struct sock *osk; struct hlist_node *node; s32 pid = current->pid; int err; + static s32 rover = -4097; retry: + cond_resched(); netlink_table_grab(); - sk_for_each(osk, node, &nl_table[sk->sk_protocol]) { + head = nl_pid_hashfn(hash, pid); + sk_for_each(osk, node, head) { if (nlk_sk(osk)->pid == pid) { /* Bind collision, search negative pid values. */ if (pid > 0) - pid = -4096; - pid--; + pid = rover; + else if (--pid > 0) + pid = -4097; netlink_table_ungrab(); goto retry; } @@ -308,7 +441,7 @@ return 0; } -static inline int netlink_capable(struct socket *sock, unsigned flag) +static inline int netlink_capable(struct socket *sock, unsigned int flag) { return (nl_nonroot[sock->sk->sk_protocol] & flag) || capable(CAP_NET_ADMIN); @@ -331,21 +464,19 @@ if (nlk->pid) { if (nladdr->nl_pid != nlk->pid) return -EINVAL; - nlk->groups = nladdr->nl_groups; - return 0; + } else { + err = nladdr->nl_pid ? + netlink_insert(sk, nladdr->nl_pid) : + netlink_autobind(sock); + if (err) + return err; } - if (nladdr->nl_pid == 0) { - err = netlink_autobind(sock); - if (err == 0) - nlk->groups = nladdr->nl_groups; - return err; - } + nlk->groups = nladdr->nl_groups; + if (nladdr->nl_groups) + sk_add_bind_node(sk, &nl_table[sk->sk_protocol].mc_list); - err = netlink_insert(sk, nladdr->nl_pid); - if (err == 0) - nlk->groups = nladdr->nl_groups; - return err; + return 0; } static int netlink_connect(struct socket *sock, struct sockaddr *addr, @@ -590,16 +721,76 @@ return -1; } +struct netlink_broadcast_data { + struct sock *exclude_sk; + u32 pid; + u32 group; + int failure; + int congested; + int delivered; + int allocation; + struct sk_buff *skb, *skb2; +}; + +static inline int do_one_broadcast(struct sock *sk, + struct netlink_broadcast_data *p) +{ + struct netlink_opt *nlk = nlk_sk(sk); + int val; + + if (p->exclude_sk == sk) + goto out; + + if (nlk->pid == p->pid || !(nlk->groups & p->group)) + goto out; + + if (p->failure) { + netlink_overrun(sk); + goto out; + } + + sock_hold(sk); + if (p->skb2 == NULL) { + if (atomic_read(&p->skb->users) != 1) { + p->skb2 = skb_clone(p->skb, p->allocation); + } else { + p->skb2 = p->skb; + atomic_inc(&p->skb->users); + } + } + if (p->skb2 == NULL) { + netlink_overrun(sk); + /* Clone failed. Notify ALL listeners. */ + p->failure = 1; + } else if ((val = netlink_broadcast_deliver(sk, p->skb2)) < 0) { + netlink_overrun(sk); + } else { + p->congested |= val; + p->delivered = 1; + p->skb2 = NULL; + } + sock_put(sk); + +out: + return 0; +} + int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, u32 pid, u32 group, int allocation) { - struct sock *sk; + struct netlink_broadcast_data info; struct hlist_node *node; - struct sk_buff *skb2 = NULL; - int protocol = ssk->sk_protocol; - int failure = 0, delivered = 0; - int congested = 0; - int val; + struct sock *sk; + + info.exclude_sk = ssk; + info.pid = pid; + info.group = group; + info.failure = 0; + info.congested = 0; + info.delivered = 0; + info.allocation = allocation; + info.skb = skb; + info.skb2 = NULL; netlink_trim(skb, allocation); @@ -607,77 +798,65 @@ netlink_lock_table(); - sk_for_each(sk, node, &nl_table[protocol]) { - struct netlink_opt *nlk = nlk_sk(sk); - - if (ssk == sk) - continue; - - if (nlk->pid == pid || !(nlk->groups & group)) - continue; - - if (failure) { - netlink_overrun(sk); - continue; - } - - sock_hold(sk); - if (skb2 == NULL) { - if (atomic_read(&skb->users) != 1) { - skb2 = skb_clone(skb, allocation); - } else { - skb2 = skb; - atomic_inc(&skb->users); - } - } - if (skb2 == NULL) { - netlink_overrun(sk); - /* Clone failed. Notify ALL listeners. */ - failure = 1; - } else if ((val = netlink_broadcast_deliver(sk, skb2)) < 0) { - netlink_overrun(sk); - } else { - congested |= val; - delivered = 1; - skb2 = NULL; - } - sock_put(sk); - } + sk_for_each_bound(sk, node, &nl_table[ssk->sk_protocol].mc_list) + do_one_broadcast(sk, &info); netlink_unlock_table(); - if (skb2) - kfree_skb(skb2); + if (info.skb2) + kfree_skb(info.skb2); kfree_skb(skb); - if (delivered) { - if (congested && (allocation & __GFP_WAIT)) + if (info.delivered) { + if (info.congested && (allocation & __GFP_WAIT)) yield(); return 0; } - if (failure) + if (info.failure) return -ENOBUFS; return -ESRCH; } +struct netlink_set_err_data { + struct sock *exclude_sk; + u32 pid; + u32 group; + int code; +}; + +static inline int do_one_set_err(struct sock *sk, + struct netlink_set_err_data *p) +{ + struct netlink_opt *nlk = nlk_sk(sk); + + if (sk == p->exclude_sk) + goto out; + + if (nlk->pid == p->pid || !(nlk->groups & p->group)) + goto out; + + sk->sk_err = p->code; + sk->sk_error_report(sk); +out: + return 0; +} + void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) { - struct sock *sk; + struct netlink_set_err_data info; struct hlist_node *node; - int protocol = ssk->sk_protocol; + struct sock *sk; + + info.exclude_sk = ssk; + info.pid = pid; + info.group = group; + info.code = code; read_lock(&nl_table_lock); - sk_for_each(sk, node, &nl_table[protocol]) { - struct netlink_opt *nlk = nlk_sk(sk); - if (ssk == sk) - continue; - if (nlk->pid == pid || !(nlk->groups & group)) - continue; + sk_for_each_bound(sk, node, &nl_table[ssk->sk_protocol].mc_list) + do_one_set_err(sk, &info); - sk->sk_err = code; - sk->sk_error_report(sk); - } read_unlock(&nl_table_lock); } @@ -853,6 +1032,9 @@ struct socket *sock; struct sock *sk; + if (!nl_table) + return NULL; + if (unit<0 || unit>=MAX_LINKS) return NULL; @@ -875,9 +1057,9 @@ return sk; } -void netlink_set_nonroot(int protocol, unsigned flags) +void netlink_set_nonroot(int protocol, unsigned int flags) { - if ((unsigned)protocol < MAX_LINKS) + if ((unsigned int)protocol < MAX_LINKS) nl_nonroot[protocol] = flags; } @@ -1070,20 +1252,31 @@ #endif #ifdef CONFIG_PROC_FS +struct nl_seq_iter { + int link; + int hash_idx; +}; + static struct sock *netlink_seq_socket_idx(struct seq_file *seq, loff_t pos) { - long i; + struct nl_seq_iter *iter = seq->private; + int i, j; struct sock *s; struct hlist_node *node; loff_t off = 0; for (i=0; iprivate = (void *) i; - return s; + struct nl_pid_hash *hash = &nl_table[i].hash; + + for (j = 0; j <= hash->mask; j++) { + sk_for_each(s, node, &hash->table[j]) { + if (off == pos) { + iter->link = i; + iter->hash_idx = j; + return s; + } + ++off; } - ++off; } } return NULL; @@ -1098,6 +1291,8 @@ static void *netlink_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct sock *s; + struct nl_seq_iter *iter; + int i, j; ++*pos; @@ -1105,18 +1300,29 @@ return netlink_seq_socket_idx(seq, 0); s = sk_next(v); - if (!s) { - long i = (long)seq->private; + if (s) + return s; + + iter = seq->private; + i = iter->link; + j = iter->hash_idx + 1; - while (++i < MAX_LINKS) { - s = sk_head(&nl_table[i]); + do { + struct nl_pid_hash *hash = &nl_table[i].hash; + + for (; j <= hash->mask; j++) { + s = sk_head(&hash->table[j]); if (s) { - seq->private = (void *) i; - break; + iter->link = i; + iter->hash_idx = j; + return s; } } - } - return s; + + j = 0; + } while (++i < MAX_LINKS); + + return NULL; } static void netlink_seq_stop(struct seq_file *seq, void *v) @@ -1160,7 +1366,24 @@ static int netlink_seq_open(struct inode *inode, struct file *file) { - return seq_open(file, &netlink_seq_ops); + struct seq_file *seq; + struct nl_seq_iter *iter; + int err; + + iter = kmalloc(sizeof(*iter), GFP_KERNEL); + if (!iter) + return -ENOMEM; + + err = seq_open(file, &netlink_seq_ops); + if (err) { + kfree(iter); + return err; + } + + memset(iter, 0, sizeof(*iter)); + seq = file->private_data; + seq->private = iter; + return 0; } static struct file_operations netlink_seq_fops = { @@ -1168,7 +1391,7 @@ .open = netlink_seq_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = seq_release_private, }; #endif @@ -1210,14 +1433,54 @@ .owner = THIS_MODULE, /* for consistency 8) */ }; +extern void netlink_skb_parms_too_large(void); + static int __init netlink_proto_init(void) { struct sk_buff *dummy_skb; + int i; + unsigned long max; + unsigned int order; + + if (sizeof(struct netlink_skb_parms) > sizeof(dummy_skb->cb)) + netlink_skb_parms_too_large(); + + nl_table = kmalloc(sizeof(*nl_table) * MAX_LINKS, GFP_KERNEL); + if (!nl_table) { +enomem: + printk(KERN_CRIT "netlink_init: Cannot allocate nl_table\n"); + return -ENOMEM; + } + + memset(nl_table, 0, sizeof(*nl_table) * MAX_LINKS); - if (sizeof(struct netlink_skb_parms) > sizeof(dummy_skb->cb)) { - printk(KERN_CRIT "netlink_init: panic\n"); - return -1; + if (num_physpages >= (128 * 1024)) + max = num_physpages >> (21 - PAGE_SHIFT); + else + max = num_physpages >> (23 - PAGE_SHIFT); + + order = get_bitmask_order(max) - 1 + PAGE_SHIFT; + max = (1UL << order) / sizeof(struct hlist_head); + order = get_bitmask_order(max > UINT_MAX ? UINT_MAX : max) - 1; + + for (i = 0; i < MAX_LINKS; i++) { + struct nl_pid_hash *hash = &nl_table[i].hash; + + hash->table = nl_pid_hash_alloc(1 * sizeof(*hash->table)); + if (!hash->table) { + while (i-- > 0) + nl_pid_hash_free(nl_table[i].hash.table, + 1 * sizeof(*hash->table)); + kfree(nl_table); + goto enomem; + } + memset(hash->table, 0, 1 * sizeof(*hash->table)); + hash->max_shift = order; + hash->shift = 0; + hash->mask = 0; + hash->rehash_time = jiffies; } + sock_register(&netlink_family_ops); #ifdef CONFIG_PROC_FS proc_net_fops_create("netlink", 0, &netlink_seq_fops); @@ -1231,6 +1494,8 @@ { sock_unregister(PF_NETLINK); proc_net_remove("netlink"); + kfree(nl_table); + nl_table = NULL; } core_initcall(netlink_proto_init); From davem@davemloft.net Wed Nov 3 16:05:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 16:05:31 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA405O9w020630 for ; Wed, 3 Nov 2004 16:05:24 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CPUxa-0002Bj-00; Wed, 03 Nov 2004 15:54:38 -0800 Date: Wed, 3 Nov 2004 15:54:38 -0800 From: "David S. Miller" To: Herbert Xu Cc: hadi@cyberus.ca, netdev@oss.sgi.com Subject: Re: [NET] Fix neighbour tbl->entries race Message-Id: <20041103155438.07a219ad.davem@davemloft.net> In-Reply-To: <20041102220603.GA13312@gondor.apana.org.au> References: <20041102112651.GA8633@gondor.apana.org.au> <1099404823.1021.15.camel@jzny.localdomain> <20041102203720.GA12108@gondor.apana.org.au> <20041102210259.GA12642@gondor.apana.org.au> <20041102220603.GA13312@gondor.apana.org.au> X-Mailer: Sylpheed version 0.9.99 (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: 11412 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 674 Lines: 19 On Wed, 3 Nov 2004 09:06:03 +1100 Herbert Xu wrote: > On Wed, Nov 03, 2004 at 08:02:59AM +1100, herbert wrote: > > > > In fact, we can make it a bit more effective/fair by checking the > > previous entries count as well. > > Call me a flip-flop :) This extra check is silly because in the > cases where it is done it is very unlikely to succeed. So here > is yet another update without that check. > > Signed-off-by: Herbert Xu Applied. We can make the proposed atomic_inc_return() enhancement as a followon patch. Can you cook up a 2.4.x version of this Herbert? The new neighbour code is now there too. From jdmason@us.ibm.com Wed Nov 3 16:17:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 16:17:36 -0800 (PST) Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA40HKbo021141 for ; Wed, 3 Nov 2004 16:17:20 -0800 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.9) with ESMTP id iA40Gb1p429856 for ; Wed, 3 Nov 2004 19:16:47 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA40GGaS085680 for ; Wed, 3 Nov 2004 17:16:17 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA40GFk4006137 for ; Wed, 3 Nov 2004 17:16:15 -0700 Received: from dreadnought.austin.ibm.com (dreadnought.austin.ibm.com [9.41.94.123]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA40GFEW006123; Wed, 3 Nov 2004 17:16:15 -0700 From: Jon Mason Organization: IBM To: Francois Romieu Subject: Re: [PATCH 2/3] r8169: Large Send enablement Date: Wed, 3 Nov 2004 18:16:11 -0600 User-Agent: KMail/1.6.2 Cc: netdev@oss.sgi.com, jgarzik@pobox.com References: <200411021203.22003.jdmason@us.ibm.com> <20041102191103.GA24860@electric-eye.fr.zoreil.com> In-Reply-To: <20041102191103.GA24860@electric-eye.fr.zoreil.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200411031816.11675.jdmason@us.ibm.com> X-archive-position: 11413 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jdmason@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 1438 Lines: 40 On Tuesday 02 November 2004 01:11 pm, Francois Romieu wrote: [...] > - If rtl8169_open() fails [*] when the device was previously up, the driver > could/should try to recover. I disagree. It should fail, complain loudly, and let the user try and fix it (or return it to the previous state). The code provided below will act like it is successful in changing the MTU, even if it hits an error and is in the process of recovering. This will cause more difficult to diagnose problems. > Untested example below to clarify. > > [*] page allocation failure, bigger mtu/rx buffers -> I feel moderately > confortable. > > > diff -puN drivers/net/r8169.c~r8169-240 drivers/net/r8169.c > --- linux-2.6.9/drivers/net/r8169.c~r8169-240 2004-10-21 21:55:45.000000000 > +0200 +++ linux-2.6.9-fr/drivers/net/r8169.c 2004-11-01 23:10:25.000000000 > +0100 @@ -120,6 +120,8 @@ static int multicast_filter_limit = 32; > #define RX_BUF_SIZE 1536 /* Rx Buffer size */ > #define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc)) > #define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) > +#define R8169_MIN_MTU 8 > +#define R8169_MAX_MTU ((2 << 14) - 1) [...] > @@ -2223,6 +2247,72 @@ out: > return IRQ_RETVAL(handled); > } > > +static int rtl8169_set_rxbufsize(struct rtl8169_private *tp, int mtu) > +{ > + if (mtu < R8169_MIN_MTU || mtu > R8169_MAX_MTU) Is 8 really a valid MTU? -- Jon Mason jdmason@us.ibm.com From davem@davemloft.net Wed Nov 3 16:18:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 16:18:32 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA40IPvD021438 for ; Wed, 3 Nov 2004 16:18:25 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CPV9z-0002DI-00; Wed, 03 Nov 2004 16:07:27 -0800 Date: Wed, 3 Nov 2004 16:07:27 -0800 From: "David S. Miller" To: Herbert Xu Cc: Matt_Domsch@dell.com, hadi@cyberus.ca, netdev@oss.sgi.com Subject: Re: [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len Message-Id: <20041103160727.54dc0c15.davem@davemloft.net> In-Reply-To: <20041101220644.GA23903@gondor.apana.org.au> References: <20041030030936.GA25102@lists.us.dell.com> <1099163419.1039.97.camel@jzny.localdomain> <20041101044433.GA18772@lists.us.dell.com> <20041101173434.GA12437@lists.us.dell.com> <20041101202754.GA23149@gondor.apana.org.au> <20041101203821.GA15086@lists.us.dell.com> <20041101204131.GA23277@gondor.apana.org.au> <20041101204533.GA17279@lists.us.dell.com> <1099345849.1073.1.camel@jzny.localdomain> <20041101215944.GB17279@lists.us.dell.com> <20041101220644.GA23903@gondor.apana.org.au> X-Mailer: Sylpheed version 0.9.99 (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: 11415 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 567 Lines: 15 On Tue, 2 Nov 2004 09:06:44 +1100 Herbert Xu wrote: > On Mon, Nov 01, 2004 at 03:59:44PM -0600, Matt Domsch wrote: > > > > Actually, -EOVERFLOW appears throughout the kernel. A couple examples: > > I agree. Please disregard my comment re ERANGE. I think there is nothing wrong with clearing out the buffer for the !dev->addr_len case. This is not to say that what the apps are doing is correct or not, it merely preserves 2.4.x behavior which was changed unintentionally. I'm going to apply Matt's patch which began this thread. From jdmason@us.ibm.com Wed Nov 3 16:18:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 16:18:32 -0800 (PST) Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.132]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA40IDJP021373 for ; Wed, 3 Nov 2004 16:18:14 -0800 Received: from westrelay04.boulder.ibm.com (westrelay04.boulder.ibm.com [9.17.193.32]) by e34.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id iA40HLJ8159458 for ; Wed, 3 Nov 2004 19:17:41 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA40HBaS141838 for ; Wed, 3 Nov 2004 17:17:11 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA40HAVO007311 for ; Wed, 3 Nov 2004 17:17:10 -0700 Received: from dreadnought.austin.ibm.com (dreadnought.austin.ibm.com [9.41.94.123]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA40H9CA007300; Wed, 3 Nov 2004 17:17:09 -0700 From: Jon Mason Organization: IBM To: Francois Romieu Subject: [PATCH] r8169: Large Send enablement, part 2 Date: Wed, 3 Nov 2004 18:17:06 -0600 User-Agent: KMail/1.6.2 Cc: netdev@oss.sgi.com, jgarzik@pobox.com References: <200411021203.22003.jdmason@us.ibm.com> <20041102191103.GA24860@electric-eye.fr.zoreil.com> In-Reply-To: <20041102191103.GA24860@electric-eye.fr.zoreil.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_CUXiBVwclKE1ew4" Message-Id: <200411031817.06629.jdmason@us.ibm.com> X-archive-position: 11414 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jdmason@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 12338 Lines: 403 --Boundary-00=_CUXiBVwclKE1ew4 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline I have tried to address all of the issues with the previous large send patch in the following patch (and I have confirmed it works on ppc64). --- r8169.c.orig 2004-11-02 11:01:02.000000000 -0600 +++ r8169.c 2004-11-03 17:58:49.830373784 -0600 @@ -85,10 +85,14 @@ VERSION 1.6LK <2004/04/14> #define rtl8169_rx_skb netif_receive_skb #define rtl8169_rx_hwaccel_skb vlan_hwaccel_rx #define rtl8169_rx_quota(count, quota) min(count, quota) +#define rtl8169_poll_disable(dev) netif_poll_disable(dev) +#define rtl8169_poll_enable(dev) netif_poll_enable(dev) #else #define rtl8169_rx_skb netif_rx #define rtl8169_rx_hwaccel_skb vlan_hwaccel_receive_skb #define rtl8169_rx_quota(count, quota) count +#define rtl8169_poll_disable(dev) +#define rtl8169_poll_enable(dev) #endif /* media options */ @@ -112,14 +116,13 @@ static int multicast_filter_limit = 32; #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define EarlyTxThld 0x3F /* 0x3F means NO early transmit */ -#define RxPacketMaxSize 0x0800 /* Maximum size supported is 16K-1 */ +#define RxPacketMaxSize 0x3FFE /* Maximum size supported is 16K-1 */ #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ #define R8169_REGS_SIZE 256 #define R8169_NAPI_WEIGHT 64 #define NUM_TX_DESC 64 /* Number of Tx descriptor registers */ #define NUM_RX_DESC 256 /* Number of Rx descriptor registers */ -#define RX_BUF_SIZE 1536 /* Rx Buffer size */ #define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc)) #define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) @@ -425,6 +428,9 @@ static void rtl8169_tx_timeout(struct ne static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev); static int rtl8169_rx_interrupt(struct net_device *, struct rtl8169_private *, void __iomem *); +static int rtl8169_change_mtu(struct net_device *netdev, int new_mtu); +static int rtl8169_down(struct net_device *dev); + #ifdef CONFIG_R8169_NAPI static int rtl8169_poll(struct net_device *dev, int *budget); #endif @@ -1237,8 +1243,6 @@ rtl8169_init_board(struct pci_dev *pdev, } tp->chipset = i; - tp->rx_buf_sz = RX_BUF_SIZE; - *ioaddr_out = ioaddr; *dev_out = dev; out: @@ -1320,6 +1324,7 @@ rtl8169_init_one(struct pci_dev *pdev, c dev->watchdog_timeo = RTL8169_TX_TIMEOUT; dev->irq = pdev->irq; dev->base_addr = (unsigned long) ioaddr; + dev->change_mtu = rtl8169_change_mtu; #ifdef CONFIG_R8169_NAPI dev->poll = rtl8169_poll; @@ -1455,6 +1460,8 @@ rtl8169_open(struct net_device *dev) struct pci_dev *pdev = tp->pci_dev; int retval; + tp->rx_buf_sz = dev->mtu + ETH_HLEN + 8; + retval = request_irq(dev->irq, rtl8169_interrupt, SA_SHIRQ, dev->name, dev); if (retval < 0) @@ -1534,8 +1541,8 @@ rtl8169_hw_start(struct net_device *dev) RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); RTL_W8(EarlyTxThres, EarlyTxThld); - // For gigabit rtl8169 - RTL_W16(RxMaxSize, RxPacketMaxSize); + // For gigabit rtl8169, MTU + header + CRC + VLAN + RTL_W16(RxMaxSize, tp->rx_buf_sz); // Set Rx Config register i = rtl8169_rx_config | @@ -1576,6 +1583,36 @@ rtl8169_hw_start(struct net_device *dev) netif_start_queue(dev); } +static int rtl8169_change_mtu(struct net_device *dev, int new_mtu) +{ + struct rtl8169_private *tp = netdev_priv(dev); + int retval; + + if (new_mtu < ETH_ZLEN || new_mtu > RxPacketMaxSize) + return -EINVAL; + + dev->mtu = new_mtu; + + if (!netif_running(dev)) + return 0; + + rtl8169_down(dev); + + tp->rx_buf_sz = new_mtu + ETH_HLEN + 8; + + retval = rtl8169_init_ring(dev); + if (retval < 0) + return retval; + + rtl8169_hw_start(dev); + + rtl8169_poll_enable(dev); + + rtl8169_request_timer(dev); + + return 0; +} + static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc) { desc->addr = 0x0badbadbadbadbadull; @@ -1745,7 +1782,7 @@ static void rtl8169_wait_for_quiescence( synchronize_irq(dev->irq); /* Wait for any pending NAPI task to complete */ - netif_poll_disable(dev); + rtl8169_poll_disable(dev); } static void rtl8169_reinit_task(void *_data) @@ -1785,6 +1822,7 @@ static void rtl8169_reset_task(void *_da rtl8169_init_ring_indexes(tp); rtl8169_hw_start(dev); netif_wake_queue(dev); + rtl8169_poll_enable(dev); } else { if (net_ratelimit()) { printk(PFX KERN_EMERG "%s: Rx buffers shortage\n", @@ -2255,19 +2293,17 @@ static int rtl8169_poll(struct net_devic } #endif -static int -rtl8169_close(struct net_device *dev) +static int rtl8169_down(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); - struct pci_dev *pdev = tp->pci_dev; void __iomem *ioaddr = tp->mmio_addr; + rtl8169_delete_timer(dev); + netif_stop_queue(dev); flush_scheduled_work(); - rtl8169_delete_timer(dev); - spin_lock_irq(&tp->lock); /* Stop the chip's Tx and Rx DMA processes. */ @@ -2282,14 +2318,30 @@ rtl8169_close(struct net_device *dev) spin_unlock_irq(&tp->lock); - free_irq(dev->irq, dev); + synchronize_irq(dev->irq); + + rtl8169_poll_disable(dev); - netif_poll_disable(dev); + /* Give a racing hard_start_xmit a few cycles to complete. */ + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(1); rtl8169_tx_clear(tp); rtl8169_rx_clear(tp); + return 0; +} + +static int rtl8169_close(struct net_device *dev) +{ + struct rtl8169_private *tp = netdev_priv(dev); + struct pci_dev *pdev = tp->pci_dev; + + rtl8169_down(dev); + + free_irq(dev->irq, dev); + pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, tp->RxPhyAddr); pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, --Boundary-00=_CUXiBVwclKE1ew4 Content-Type: text/x-diff; charset="iso-8859-1"; name="r8169-large-send.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="r8169-large-send.patch" --- r8169.c.orig 2004-11-02 11:01:02.000000000 -0600 +++ r8169.c 2004-11-03 17:58:49.830373784 -0600 @@ -85,10 +85,14 @@ VERSION 1.6LK <2004/04/14> #define rtl8169_rx_skb netif_receive_skb #define rtl8169_rx_hwaccel_skb vlan_hwaccel_rx #define rtl8169_rx_quota(count, quota) min(count, quota) +#define rtl8169_poll_disable(dev) netif_poll_disable(dev) +#define rtl8169_poll_enable(dev) netif_poll_enable(dev) #else #define rtl8169_rx_skb netif_rx #define rtl8169_rx_hwaccel_skb vlan_hwaccel_receive_skb #define rtl8169_rx_quota(count, quota) count +#define rtl8169_poll_disable(dev) +#define rtl8169_poll_enable(dev) #endif /* media options */ @@ -112,14 +116,13 @@ static int multicast_filter_limit = 32; #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ #define EarlyTxThld 0x3F /* 0x3F means NO early transmit */ -#define RxPacketMaxSize 0x0800 /* Maximum size supported is 16K-1 */ +#define RxPacketMaxSize 0x3FFE /* Maximum size supported is 16K-1 */ #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ #define R8169_REGS_SIZE 256 #define R8169_NAPI_WEIGHT 64 #define NUM_TX_DESC 64 /* Number of Tx descriptor registers */ #define NUM_RX_DESC 256 /* Number of Rx descriptor registers */ -#define RX_BUF_SIZE 1536 /* Rx Buffer size */ #define R8169_TX_RING_BYTES (NUM_TX_DESC * sizeof(struct TxDesc)) #define R8169_RX_RING_BYTES (NUM_RX_DESC * sizeof(struct RxDesc)) @@ -425,6 +428,9 @@ static void rtl8169_tx_timeout(struct ne static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev); static int rtl8169_rx_interrupt(struct net_device *, struct rtl8169_private *, void __iomem *); +static int rtl8169_change_mtu(struct net_device *netdev, int new_mtu); +static int rtl8169_down(struct net_device *dev); + #ifdef CONFIG_R8169_NAPI static int rtl8169_poll(struct net_device *dev, int *budget); #endif @@ -1237,8 +1243,6 @@ rtl8169_init_board(struct pci_dev *pdev, } tp->chipset = i; - tp->rx_buf_sz = RX_BUF_SIZE; - *ioaddr_out = ioaddr; *dev_out = dev; out: @@ -1320,6 +1324,7 @@ rtl8169_init_one(struct pci_dev *pdev, c dev->watchdog_timeo = RTL8169_TX_TIMEOUT; dev->irq = pdev->irq; dev->base_addr = (unsigned long) ioaddr; + dev->change_mtu = rtl8169_change_mtu; #ifdef CONFIG_R8169_NAPI dev->poll = rtl8169_poll; @@ -1455,6 +1460,8 @@ rtl8169_open(struct net_device *dev) struct pci_dev *pdev = tp->pci_dev; int retval; + tp->rx_buf_sz = dev->mtu + ETH_HLEN + 8; + retval = request_irq(dev->irq, rtl8169_interrupt, SA_SHIRQ, dev->name, dev); if (retval < 0) @@ -1534,8 +1541,8 @@ rtl8169_hw_start(struct net_device *dev) RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); RTL_W8(EarlyTxThres, EarlyTxThld); - // For gigabit rtl8169 - RTL_W16(RxMaxSize, RxPacketMaxSize); + // For gigabit rtl8169, MTU + header + CRC + VLAN + RTL_W16(RxMaxSize, tp->rx_buf_sz); // Set Rx Config register i = rtl8169_rx_config | @@ -1576,6 +1583,36 @@ rtl8169_hw_start(struct net_device *dev) netif_start_queue(dev); } +static int rtl8169_change_mtu(struct net_device *dev, int new_mtu) +{ + struct rtl8169_private *tp = netdev_priv(dev); + int retval; + + if (new_mtu < ETH_ZLEN || new_mtu > RxPacketMaxSize) + return -EINVAL; + + dev->mtu = new_mtu; + + if (!netif_running(dev)) + return 0; + + rtl8169_down(dev); + + tp->rx_buf_sz = new_mtu + ETH_HLEN + 8; + + retval = rtl8169_init_ring(dev); + if (retval < 0) + return retval; + + rtl8169_hw_start(dev); + + rtl8169_poll_enable(dev); + + rtl8169_request_timer(dev); + + return 0; +} + static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc) { desc->addr = 0x0badbadbadbadbadull; @@ -1745,7 +1782,7 @@ static void rtl8169_wait_for_quiescence( synchronize_irq(dev->irq); /* Wait for any pending NAPI task to complete */ - netif_poll_disable(dev); + rtl8169_poll_disable(dev); } static void rtl8169_reinit_task(void *_data) @@ -1785,6 +1822,7 @@ static void rtl8169_reset_task(void *_da rtl8169_init_ring_indexes(tp); rtl8169_hw_start(dev); netif_wake_queue(dev); + rtl8169_poll_enable(dev); } else { if (net_ratelimit()) { printk(PFX KERN_EMERG "%s: Rx buffers shortage\n", @@ -2255,19 +2293,17 @@ static int rtl8169_poll(struct net_devic } #endif -static int -rtl8169_close(struct net_device *dev) +static int rtl8169_down(struct net_device *dev) { struct rtl8169_private *tp = netdev_priv(dev); - struct pci_dev *pdev = tp->pci_dev; void __iomem *ioaddr = tp->mmio_addr; + rtl8169_delete_timer(dev); + netif_stop_queue(dev); flush_scheduled_work(); - rtl8169_delete_timer(dev); - spin_lock_irq(&tp->lock); /* Stop the chip's Tx and Rx DMA processes. */ @@ -2282,14 +2318,30 @@ rtl8169_close(struct net_device *dev) spin_unlock_irq(&tp->lock); - free_irq(dev->irq, dev); + synchronize_irq(dev->irq); + + rtl8169_poll_disable(dev); - netif_poll_disable(dev); + /* Give a racing hard_start_xmit a few cycles to complete. */ + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(1); rtl8169_tx_clear(tp); rtl8169_rx_clear(tp); + return 0; +} + +static int rtl8169_close(struct net_device *dev) +{ + struct rtl8169_private *tp = netdev_priv(dev); + struct pci_dev *pdev = tp->pci_dev; + + rtl8169_down(dev); + + free_irq(dev->irq, dev); + pci_free_consistent(pdev, R8169_RX_RING_BYTES, tp->RxDescArray, tp->RxPhyAddr); pci_free_consistent(pdev, R8169_TX_RING_BYTES, tp->TxDescArray, --Boundary-00=_CUXiBVwclKE1ew4-- From tgr@reeler.org Wed Nov 3 16:40:45 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 16:40:51 -0800 (PST) Received: from rei.rakuen (217-162-107-144.dclient.hispeed.ch [217.162.107.144]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA40eiVA025777 for ; Wed, 3 Nov 2004 16:40:45 -0800 Received: from tgr by rei.rakuen with local (Exim 4.34) id 1CPVfn-0000Am-Sz; Thu, 04 Nov 2004 01:40:19 +0100 Date: Thu, 4 Nov 2004 01:40:19 +0100 From: Thomas Graf To: Javier Szyszlican Cc: netdev@oss.sgi.com Subject: Re: Outbound IPIP Tunnel Packets not shaped/policed Message-ID: <20041104004019.GO19714@rei.reeler.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-archive-position: 11416 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 927 Lines: 24 * Javier Szyszlican 2004-11-03 20:36 > filter parent 2: protocol ip pref 1 fw > filter parent 2: protocol ip pref 1 fw handle 0x1 classid 2:21 > > Chain OUTPUT (policy ACCEPT 794K packets, 111M bytes) > pkts bytes target prot opt in out source > destination > 4984 377K mark.4 4 -- * * 0.0.0.0/0 > 0.0.0.0/0 > > Chain mark.4 (1 references) > pkts bytes target prot opt in out source > destination > 4984 377K MARK all -- * * 0.0.0.0/0 > 0.0.0.0/0 MARK set 0x1 Is this on the same device? I have such a setup in my test suite and it works fine with the latest bk snapshot. Can you show me the actual commands you execute? > So, I'm guessing that the IPIP packets generated by the kernel, are not > going into the packet scheduling routines/functions. They surely are. From tgraf@suug.ch Wed Nov 3 16:43:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 16:43:31 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA40hQI9026138 for ; Wed, 3 Nov 2004 16:43:26 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id 7D34EF; Thu, 4 Nov 2004 01:42:46 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 18AC21C0E9; Thu, 4 Nov 2004 01:43:27 +0100 (CET) Date: Thu, 4 Nov 2004 01:43:27 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com, hadi@cyberus.ca Subject: Re: [PATCHSET 0/8] PKT_SCHED: Use gnet_stats for actions and policer Message-ID: <20041104004327.GJ12289@postel.suug.ch> References: <20041103215816.GA12289@postel.suug.ch> <20041103141820.7a0c7832.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103141820.7a0c7832.davem@davemloft.net> X-archive-position: 11417 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 389 Lines: 9 * David S. Miller <20041103141820.7a0c7832.davem@davemloft.net> 2004-11-03 14:18 > > Shall I mark the old estimator and statistic API as __deprecated > > or remove it right away? > > Since nothing in the tree uses it any more, let's just kill it > outright. I will come up with a patch tomorrow together with the iproute2 patch which needs some more work. Thanks for the quick applying. From linux-netdev@gmane.org Wed Nov 3 16:52:14 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 16:52:19 -0800 (PST) Received: from main.gmane.org (main.gmane.org [80.91.229.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA40qDC7026915 for ; Wed, 3 Nov 2004 16:52:14 -0800 Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1CPVr2-0002CF-00 for ; Thu, 04 Nov 2004 01:51:56 +0100 Received: from lan-outside.tiba.com ([200.61.64.36]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Nov 2004 01:51:56 +0100 Received: from javier by lan-outside.tiba.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 04 Nov 2004 01:51:56 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: netdev@oss.sgi.com From: Javier Szyszlican Subject: Re: Outbound IPIP Tunnel Packets not shaped/policed Date: Wed, 03 Nov 2004 21:55:03 -0300 Organization: TIBA Message-ID: <41897DE7.8080106@szysz.com> References: <20041104004019.GO19714@rei.reeler.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org Cc: netdev@oss.sgi.com X-Gmane-NNTP-Posting-Host: lan-outside.tiba.com User-Agent: Mozilla Thunderbird 0.8 (X11/20040921) X-Accept-Language: en-us, en In-Reply-To: <20041104004019.GO19714@rei.reeler.org> X-Enigmail-Version: 0.86.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime X-archive-position: 11418 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: javier@szysz.com Precedence: bulk X-list: netdev Content-Length: 1855 Lines: 62 Thomas, The commands are (Generated via firehol) Iptables: -A FORWARD -p 4 -j mark.4 -A OUTPUT -p ipencap -j mark.5 -A mark.4 -j MARK --set-mark 0x1 -A mark.5 -j MARK --set-mark 0x1 And in TC: tc qdisc add dev ppp0 root handle 2:0 htb default 22 tc class add dev ppp0 parent 2:0 classid 2:1 htb rate 128kbit ceil 128kbit tc class add dev ppp0 parent 2:1 classid 2:22 htb rate 32kbit ceil 128kbit prio 10 tc class add dev ppp0 parent 2:1 classid 2:21 htb rate 96kbit ceil 128kbit prio 1 tc filter add dev ppp0 protocol ip parent 2:0 prio 1 handle 1 fw flowid 2:21 What do you mean by "same device", all this is on my gateway host, that has the pptp connection (ppp0) and over that the IPIP tunnel. If the IPIP packets geneated by kernel are going to the shaping functions, how is that I don't see them in my tc -s ? Thanks you very much for helping me. Javier Thomas Graf wrote: > * Javier Szyszlican 2004-11-03 20:36 > >>filter parent 2: protocol ip pref 1 fw >>filter parent 2: protocol ip pref 1 fw handle 0x1 classid 2:21 >> >>Chain OUTPUT (policy ACCEPT 794K packets, 111M bytes) >> pkts bytes target prot opt in out source >> destination >> 4984 377K mark.4 4 -- * * 0.0.0.0/0 >> 0.0.0.0/0 >> >>Chain mark.4 (1 references) >> pkts bytes target prot opt in out source >> destination >> 4984 377K MARK all -- * * 0.0.0.0/0 >> 0.0.0.0/0 MARK set 0x1 > > > Is this on the same device? I have such a setup in my test suite > and it works fine with the latest bk snapshot. Can you show me > the actual commands you execute? > > >>So, I'm guessing that the IPIP packets generated by the kernel, are not >>going into the packet scheduling routines/functions. > > > They surely are. > > From christopherc@team.outblaze.com Wed Nov 3 17:03:53 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 17:03:59 -0800 (PST) Received: from corpmail.outblaze.com (corpmail.outblaze.com [203.86.166.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA413qrH027598 for ; Wed, 3 Nov 2004 17:03:53 -0800 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by corpmail.outblaze.com (Postfix) with ESMTP id 8692237B08 for ; Thu, 4 Nov 2004 01:03:34 +0000 (GMT) Received: from smtp1.hk1.outblaze.com (smtp1.hk1.outblaze.com [203.86.166.80]) by corpmail.outblaze.com (Postfix) with SMTP id 4B46F16DD8D for ; Thu, 4 Nov 2004 01:03:34 +0000 (GMT) Received: (qmail 9857 invoked from network); 4 Nov 2004 01:03:33 -0000 Received: from unknown (HELO ?192.168.4.22?) (christopherc@team.outblaze.com@210.177.227.130) by smtp1.hk1.outblaze.com with SMTP; 4 Nov 2004 01:03:33 -0000 Message-ID: <4189810C.4080302@outblaze.com> Date: Thu, 04 Nov 2004 09:08:28 +0800 From: Christopher Chan User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com Cc: Christopher Chan , ganesh.venkatesan@intel.com Subject: Re: linux 2.6.9 still having network code problems References: <418741EB.3080701@outblaze.com> <20041102011918.2b453e21.akpm@osdl.org> <4187478A.1040002@outblaze.com> In-Reply-To: <4187478A.1040002@outblaze.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiVirus: checked by Vexira MailArmor (version: 2.0.2-8; VAE: 6.28.0.12; VDF: 6.28.0.52; host: corpmail.outblaze.com) X-archive-position: 11419 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: 5753 Lines: 127 Christopher Chan wrote: > >>> Previously with 2.6.7 I had to use this values in sysctl to be able >>> to continue to access the box: >>> >>> net.ipv4.tcp_max_syn_backlog = 2048 >>> net.ipv4.route.gc_thresh = 65536 >>> net.ipv4.route.max_size = 1048576 >>> Nov 1 03:16:00 spf5-3 kernel: Out of Memory: Killed process 21861 >>> (smtpd). >>> Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) >>> failed at net/ipv4/tcp.c (1284) >>> Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 >>> Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) >>> failed at net/ipv4/tcp.c (1284) >>> Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 >>> Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (tp->copied_seq == >>> tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at >>> net/ipv4/tcp.c (1348) >>> Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) >>> failed at net/ipv4/tcp.c (1284) >>> Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 >>> Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (tp->copied_seq == >>> tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at >>> net/ipv4/tcp.c (1348) >>> Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (flags & MSG_PEEK) >>> failed at net/ipv4/tcp.c (1284) >>> Nov 1 03:16:00 spf5-3 kernel: recvmsg bug: copied 1E619F78 seq 1E61A378 >>> Nov 1 03:16:00 spf5-3 kernel: KERNEL: assertion (tp->copied_seq == >>> tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed at >>> net/ipv4/tcp.c (1348) >> >> >> >> This is a networking bug. >> > > Yes...it's the same one that won't allow me to use the e100 driver with > NAPI enabled with or without them sysctl tweaks and the same one that > forces me to use the tweaks without NAPI enabled for the e100 driver. > > With NAPI enabled, I see the problem when under pressure. > > FYI, the 2.6.9 kernel is running with NAPI enabled. > 2.6.9 kernel with NAPI enabled and sysctl tweaks listed at the top of mail still triggers network code problems: Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed a t net/ipv4/tcp.c (1348) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed a t net/ipv4/tcp.c (1348) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed a t net/ipv4/tcp.c (1348) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed a t net/ipv4/tcp.c (1348) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed a t net/ipv4/tcp.c (1348) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed a t net/ipv4/tcp.c (1348) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed a t net/ipv4/tcp.c (1348) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed a t net/ipv4/tcp.c (1348) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 3 10:46:45 spf0 kernel: KERNEL: assertion (tp->copied_seq == tp->rcv_nxt || (flags & (MSG_PEEK | MSG_TRUNC))) failed a t net/ipv4/tcp.c (1348) Nov 3 10:47:56 spf0 kernel: kb)->end_seq)) failed at net/ipv4/tcp.c (1061) Nov 3 10:47:56 spf0 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 3 10:47:56 spf0 kernel: KERNEL: assertion (!skb || before(tp->copied_seq, TCP_SKB_CB(skb)->end_seq)) failed at net/ipv 4/tcp.c (1061) ...................................... Nov 3 10:47:59 spf0 kernel: printk: 156 messages suppressed. Nov 3 10:47:59 spf0 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 3 10:47:59 spf0 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 3 10:47:59 spf0 kernel: KERNEL: assertion (!skb || before(tp->copied_seq, TCP_SKB_CB(skb)->end_seq)) failed at net/ipv 4/tcp.c (1061) Nov 3 10:47:59 spf0 kernel: printk: 106 messages suppressed. Nov 3 10:47:59 spf0 kernel: printk: 121 messages suppressed. Nov 3 10:47:59 spf0 kernel: printk: 222 messages suppressed. Nov 3 10:47:59 spf0 kernel: printk: 151 messages suppressed. Nov 3 10:47:59 spf0 kernel: KERNEL: assertion (flags & MSG_PEEK) failed at net/ipv4/tcp.c (1284) Nov 3 10:47:59 spf0 kernel: recvmsg bug: copied D51512C9 seq D51512FA Nov 3 10:47:59 spf0 kernel: printk: 163 messages suppressed. Nov 3 10:48:04 spf0 kernel: printk: 216 messages suppressed. apparent recovery... Nov 3 11:15:44 spf0 kernel: printk: 15 messages suppressed. Nov 3 11:23:42 spf0 kernel: printk: 61 messages suppressed. Box is gone... Please continue to keep available the NAPI disable/enable option in the e100 driver. From kaber@trash.net Wed Nov 3 19:11:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 19:11:40 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA43BXxU032222 for ; Wed, 3 Nov 2004 19:11:34 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPY1n-0005oB-W5 for netdev@oss.sgi.com; Thu, 04 Nov 2004 04:11:12 +0100 Message-ID: <41899DCF.3050804@trash.net> Date: Thu, 04 Nov 2004 04:11:11 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: netdev@oss.sgi.com Subject: request_module while holding rtnl semaphore Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11420 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 500 Lines: 12 There are several instances of request_module beeing called while holding the rtnl semaphore in net/sched. A pratical problem with this is the teql scheduler which deadlocks when calling register_netdev from its init function. A more far-fetched problem would be some crazy person with their modules in a nfs-mounted directory on a server reachable over a dial-on-demand link. I couldn't come up with a solution except for refusing to autoload teql, maybe someone else has an idea. Regards Patrick From mdomsch@lists.us.dell.com Wed Nov 3 19:43:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 19:43:19 -0800 (PST) Received: from lists.us.dell.com (linux.us.dell.com [143.166.224.162]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA43hDih000786 for ; Wed, 3 Nov 2004 19:43:13 -0800 Received: from lists.us.dell.com (localhost.localdomain [127.0.0.1]) by lists.us.dell.com (8.12.11/8.12.11) with ESMTP id iA43gg8t026355; Wed, 3 Nov 2004 21:42:42 -0600 Received: (from mdomsch@localhost) by lists.us.dell.com (8.12.11/8.12.11/Submit) id iA43ggwg026353; Wed, 3 Nov 2004 21:42:42 -0600 Date: Wed, 3 Nov 2004 21:42:42 -0600 From: Matt Domsch To: "David S. Miller" Cc: Herbert Xu , hadi@cyberus.ca, netdev@oss.sgi.com Subject: Re: [PATCH 2.6] dev.c: clear SIOCGIFHWADDR buffer if !dev->addr_len Message-ID: <20041104034241.GA26300@lists.us.dell.com> References: <20041101044433.GA18772@lists.us.dell.com> <20041101173434.GA12437@lists.us.dell.com> <20041101202754.GA23149@gondor.apana.org.au> <20041101203821.GA15086@lists.us.dell.com> <20041101204131.GA23277@gondor.apana.org.au> <20041101204533.GA17279@lists.us.dell.com> <1099345849.1073.1.camel@jzny.localdomain> <20041101215944.GB17279@lists.us.dell.com> <20041101220644.GA23903@gondor.apana.org.au> <20041103160727.54dc0c15.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041103160727.54dc0c15.davem@davemloft.net> User-Agent: Mutt/1.4.1i X-archive-position: 11421 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: Matt_Domsch@dell.com Precedence: bulk X-list: netdev Content-Length: 1024 Lines: 29 On Wed, Nov 03, 2004 at 04:07:27PM -0800, David S. Miller wrote: > On Tue, 2 Nov 2004 09:06:44 +1100 > Herbert Xu wrote: > > > On Mon, Nov 01, 2004 at 03:59:44PM -0600, Matt Domsch wrote: > > > > > > Actually, -EOVERFLOW appears throughout the kernel. A couple examples: > > > > I agree. Please disregard my comment re ERANGE. > > I think there is nothing wrong with clearing out the buffer > for the !dev->addr_len case. This is not to say that what > the apps are doing is correct or not, it merely preserves > 2.4.x behavior which was changed unintentionally. > > I'm going to apply Matt's patch which began this thread. If it's all the same to you, I prefer the last version. If you want to remove the net_ratelimited printk, that would be fine too. Either way the apps will work as expected again. Thanks, Matt -- Matt Domsch Sr. Software Engineer, Lead Engineer Dell Linux Solutions linux.dell.com & www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com From kaber@trash.net Wed Nov 3 22:26:11 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 22:26:17 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA46QBbT008129 for ; Wed, 3 Nov 2004 22:26:11 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPb47-00021k-Ty; Thu, 04 Nov 2004 07:25:47 +0100 Message-ID: <4189CB6B.5050508@trash.net> Date: Thu, 04 Nov 2004 07:25:47 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com, jamal Subject: [PATCH 2.6 3/5]: ipt: mark some functions static Content-Type: multipart/mixed; boundary="------------000307010105070907030008" X-archive-position: 11424 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1980 Lines: 89 This is a multi-part message in MIME format. --------------000307010105070907030008 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Mark some functions static in ipt action. --------------000307010105070907030008 Content-Type: text/x-patch; name="3.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="3.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/04 06:41:17+01:00 kaber@coreworks.de # [PKT_SCHED]: ipt: mark some functions static # # Signed-off-by: Patrick McHardy # # net/sched/ipt.c # 2004/11/04 06:41:10+01:00 kaber@coreworks.de +6 -6 # [PKT_SCHED]: ipt: mark some functions static # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/ipt.c b/net/sched/ipt.c --- a/net/sched/ipt.c 2004-11-04 07:17:23 +01:00 +++ b/net/sched/ipt.c 2004-11-04 07:17:23 +01:00 @@ -42,7 +42,7 @@ #define MY_TAB_SIZE 16 #define MY_TAB_MASK 15 -u32 idx_gen; +static u32 idx_gen; static struct tcf_ipt *tcf_ipt_ht[MY_TAB_SIZE]; /* ipt hash table lock */ static rwlock_t ipt_lock = RW_LOCK_UNLOCKED; @@ -93,7 +93,7 @@ return ret; } -int +static int tcf_ipt_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a, int ovr, int bind) { struct ipt_entry_target *t; @@ -231,7 +231,7 @@ } -int +static int tcf_ipt_cleanup(struct tc_action *a, int bind) { struct tcf_ipt *p; @@ -241,7 +241,7 @@ return 0; } -int +static int tcf_ipt(struct sk_buff **pskb, struct tc_action *a) { int ret = 0, result = 0; @@ -293,7 +293,7 @@ } -int +static int tcf_ipt_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) { struct ipt_entry_target *t; @@ -345,7 +345,7 @@ return -1; } -struct tc_action_ops act_ipt_ops = { +static struct tc_action_ops act_ipt_ops = { .next = NULL, .kind = "ipt", .type = TCA_ACT_IPT, --------------000307010105070907030008-- From kaber@trash.net Wed Nov 3 22:26:15 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 22:26:21 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA46QEsA008143 for ; Wed, 3 Nov 2004 22:26:14 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPb4C-00021w-IT; Thu, 04 Nov 2004 07:25:52 +0100 Message-ID: <4189CB70.3060703@trash.net> Date: Thu, 04 Nov 2004 07:25:52 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com, jamal Subject: [PATCH 2.6 5/5]: act_api: mark some functions static/remove unused function Content-Type: multipart/mixed; boundary="------------000304030001030906050804" X-archive-position: 11426 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 4010 Lines: 164 This is a multi-part message in MIME format. --------------000304030001030906050804 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Mark some functions static in act_api. tc_lookup_action_id was unused so I removed it. --------------000304030001030906050804 Content-Type: text/x-patch; name="5.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="5.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/04 06:45:26+01:00 kaber@coreworks.de # [PKT_SCHED]: act_api: mark some functions static/remove unused function # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2004/11/04 06:45:20+01:00 kaber@coreworks.de +11 -33 # [PKT_SCHED]: act_api: mark some functions static/remove unused function # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2004-11-04 07:17:32 +01:00 +++ b/net/sched/act_api.c 2004-11-04 07:17:32 +01:00 @@ -88,7 +88,7 @@ } /* lookup by name */ -struct tc_action_ops *tc_lookup_action_n(char *kind) +static struct tc_action_ops *tc_lookup_action_n(char *kind) { struct tc_action_ops *a = NULL; @@ -111,7 +111,7 @@ } /* lookup by rtattr */ -struct tc_action_ops *tc_lookup_action(struct rtattr *kind) +static struct tc_action_ops *tc_lookup_action(struct rtattr *kind) { struct tc_action_ops *a = NULL; @@ -134,28 +134,6 @@ return a; } -/* lookup by id */ -struct tc_action_ops *tc_lookup_action_id(u32 type) -{ - struct tc_action_ops *a = NULL; - - if (type) { - read_lock(&act_mod_lock); - for (a = act_base; a; a = a->next) { - if (a->type == type) { - if (!try_module_get(a->owner)) { - read_unlock(&act_mod_lock); - return NULL; - } - break; - } - } - read_unlock(&act_mod_lock); - } - - return a; -} - int tcf_action_exec(struct sk_buff *skb,struct tc_action *act, struct tcf_result *res) { @@ -504,7 +482,7 @@ return err; } -int tcf_action_get_1(struct rtattr *rta, struct tc_action *a, struct nlmsghdr *n, u32 pid) +static int tcf_action_get_1(struct rtattr *rta, struct tc_action *a, struct nlmsghdr *n, u32 pid) { struct tc_action_ops *a_o; char act_name[4 + IFNAMSIZ + 1]; @@ -571,7 +549,7 @@ return err; } -void cleanup_a (struct tc_action *act) +static void cleanup_a (struct tc_action *act) { struct tc_action *a; @@ -587,7 +565,7 @@ } } -struct tc_action_ops *get_ao(struct rtattr *kind, struct tc_action *a) +static struct tc_action_ops *get_ao(struct rtattr *kind, struct tc_action *a) { char act_name[4 + IFNAMSIZ + 1]; struct tc_action_ops *a_o = NULL; @@ -622,7 +600,7 @@ return a_o; } -struct tc_action *create_a(int i) +static struct tc_action *create_a(int i) { struct tc_action *act = NULL; @@ -639,7 +617,7 @@ return act; } -int tca_action_flush(struct rtattr *rta, struct nlmsghdr *n, u32 pid) +static int tca_action_flush(struct rtattr *rta, struct nlmsghdr *n, u32 pid) { struct sk_buff *skb; unsigned char *b; @@ -709,7 +687,7 @@ return err; } -int tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event ) +static int tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event ) { int s = 0; @@ -793,7 +771,7 @@ } -int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event, unsigned flags) +static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event, unsigned flags) { struct tcamsg *t; struct nlmsghdr *nlh; @@ -840,7 +818,7 @@ } -int tcf_action_add(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int ovr ) +static int tcf_action_add(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int ovr ) { int ret = 0; struct tc_action *act = NULL; @@ -923,7 +901,7 @@ return ret; } -char * +static char * find_dump_kind(struct nlmsghdr *n) { struct rtattr *tb1, *tb2[TCA_ACT_MAX+1]; --------------000304030001030906050804-- From kaber@trash.net Wed Nov 3 22:26:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 22:26:14 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA46Q7Ao008127 for ; Wed, 3 Nov 2004 22:26:08 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPb45-00021f-Hk; Thu, 04 Nov 2004 07:25:45 +0100 Message-ID: <4189CB69.1000309@trash.net> Date: Thu, 04 Nov 2004 07:25:45 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com, jamal Subject: [PATCH 2.6 2/5]: mirred: mark some functions static Content-Type: multipart/mixed; boundary="------------000804080501010506010904" X-archive-position: 11422 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1626 Lines: 71 This is a multi-part message in MIME format. --------------000804080501010506010904 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Mark some functions static in mirred action. --------------000804080501010506010904 Content-Type: text/x-patch; name="2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="2.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/04 06:40:04+01:00 kaber@coreworks.de # [PKT_SCHED]: mirred: mark some functions static # # Signed-off-by: Patrick McHardy # # net/sched/mirred.c # 2004/11/04 06:39:58+01:00 kaber@coreworks.de +4 -4 # [PKT_SCHED]: mirred: mark some functions static # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/mirred.c b/net/sched/mirred.c --- a/net/sched/mirred.c 2004-11-04 07:17:19 +01:00 +++ b/net/sched/mirred.c 2004-11-04 07:17:19 +01:00 @@ -76,7 +76,7 @@ return 0; } -int +static int tcf_mirred_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a,int ovr, int bind) { struct rtattr *tb[TCA_MIRRED_MAX]; @@ -150,7 +150,7 @@ } -int +static int tcf_mirred_cleanup(struct tc_action *a, int bind) { struct tcf_mirred *p; @@ -160,7 +160,7 @@ return 0; } -int +static int tcf_mirred(struct sk_buff **pskb, struct tc_action *a) { struct tcf_mirred *p; @@ -235,7 +235,7 @@ return p->action; } -int +static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a,int bind, int ref) { unsigned char *b = skb->tail; --------------000804080501010506010904-- From kaber@trash.net Wed Nov 3 22:26:13 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 22:26:18 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA46QCQR008133 for ; Wed, 3 Nov 2004 22:26:12 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPb4A-00021p-9o; Thu, 04 Nov 2004 07:25:50 +0100 Message-ID: <4189CB6E.8020208@trash.net> Date: Thu, 04 Nov 2004 07:25:50 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com, jamal Subject: [PATCH 2.6 4/5]: gact: mark some functions static Content-Type: multipart/mixed; boundary="------------020606090909060602060201" X-archive-position: 11425 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 2166 Lines: 97 This is a multi-part message in MIME format. --------------020606090909060602060201 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Mark some functions static in gact. --------------020606090909060602060201 Content-Type: text/x-patch; name="4.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="4.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/04 06:42:01+01:00 kaber@coreworks.de # [PKT_SCHED]: gact: mark some functions static # # Signed-off-by: Patrick McHardy # # net/sched/gact.c # 2004/11/04 06:41:55+01:00 kaber@coreworks.de +7 -7 # [PKT_SCHED]: gact: mark some functions static # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/gact.c b/net/sched/gact.c --- a/net/sched/gact.c 2004-11-04 07:17:28 +01:00 +++ b/net/sched/gact.c 2004-11-04 07:17:28 +01:00 @@ -53,14 +53,14 @@ #ifdef CONFIG_GACT_PROB typedef int (*g_rand)(struct tcf_gact *p); -int +static int gact_net_rand(struct tcf_gact *p) { if (net_random()%p->pval) return p->action; return p->paction; } -int +static int gact_determ(struct tcf_gact *p) { if (p->bstats.packets%p->pval) return p->action; @@ -71,7 +71,7 @@ g_rand gact_rand[MAX_RAND]= { NULL,gact_net_rand, gact_determ}; #endif -int +static int tcf_gact_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a,int ovr,int bind) { struct rtattr *tb[TCA_GACT_MAX]; @@ -129,7 +129,7 @@ return ret; } -int +static int tcf_gact_cleanup(struct tc_action *a, int bind) { struct tcf_gact *p; @@ -139,7 +139,7 @@ return 0; } -int +static int tcf_gact(struct sk_buff **pskb, struct tc_action *a) { struct tcf_gact *p; @@ -173,7 +173,7 @@ return action; } -int +static int tcf_gact_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) { unsigned char *b = skb->tail; @@ -214,7 +214,7 @@ return -1; } -struct tc_action_ops act_gact_ops = { +static struct tc_action_ops act_gact_ops = { .next = NULL, .kind = "gact", .type = TCA_ACT_GACT, --------------020606090909060602060201-- From kaber@trash.net Wed Nov 3 22:26:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 22:26:16 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA46Q60p008125 for ; Wed, 3 Nov 2004 22:26:07 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPb42-00021U-Uz; Thu, 04 Nov 2004 07:25:42 +0100 Message-ID: <4189CB66.5080208@trash.net> Date: Thu, 04 Nov 2004 07:25:42 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com, jamal Subject: [PATCH 2.6 1/5]: pedit: mark some functions static Content-Type: multipart/mixed; boundary="------------050807030609090808030600" X-archive-position: 11423 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1631 Lines: 71 This is a multi-part message in MIME format. --------------050807030609090808030600 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Mark some functions static in pedit action. --------------050807030609090808030600 Content-Type: text/x-patch; name="1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="1.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/04 06:38:09+01:00 kaber@coreworks.de # [PKT_SCHED]: pedit: mark some functions static # # Signed-off-by: Patrick McHardy # # net/sched/pedit.c # 2004/11/04 06:38:02+01:00 kaber@coreworks.de +4 -4 # [PKT_SCHED]: pedit: mark some functions static # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/pedit.c b/net/sched/pedit.c --- a/net/sched/pedit.c 2004-11-04 07:17:14 +01:00 +++ b/net/sched/pedit.c 2004-11-04 07:17:14 +01:00 @@ -53,7 +53,7 @@ #include -int +static int tcf_pedit_init(struct rtattr *rta, struct rtattr *est, struct tc_action *a,int ovr, int bind) { struct rtattr *tb[TCA_PEDIT_MAX]; @@ -100,7 +100,7 @@ return ret; } -int +static int tcf_pedit_cleanup(struct tc_action *a, int bind) { struct tcf_pedit *p; @@ -113,7 +113,7 @@ /* ** */ -int +static int tcf_pedit(struct sk_buff **pskb, struct tc_action *a) { struct tcf_pedit *p; @@ -191,7 +191,7 @@ return p->action; } -int +static int tcf_pedit_dump(struct sk_buff *skb, struct tc_action *a,int bind, int ref) { unsigned char *b = skb->tail; --------------050807030609090808030600-- From kaber@trash.net Wed Nov 3 22:30:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Wed, 03 Nov 2004 22:30:29 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA46UO8h009105 for ; Wed, 3 Nov 2004 22:30:25 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPb8E-00026h-UB; Thu, 04 Nov 2004 07:30:02 +0100 Message-ID: <4189CC6A.9040007@trash.net> Date: Thu, 04 Nov 2004 07:30:02 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com, jamal Subject: [PATCH 2.6]: Fix device leaks in mirred action Content-Type: multipart/mixed; boundary="------------060200070306030602060705" X-archive-position: 11427 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1368 Lines: 49 This is a multi-part message in MIME format. --------------060200070306030602060705 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit When a mirred action is created it takes two references to the device (dev_get_by_index + dev_hold), but only drops one when it gets destroyed. It also leaks a reference when a mirred action is replaced. --------------060200070306030602060705 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/04 07:28:30+01:00 kaber@coreworks.de # [PKT_SCHED]: Fix device leaks in mirred action # # Signed-off-by: Patrick McHardy # # net/sched/mirred.c # 2004/11/04 07:28:24+01:00 kaber@coreworks.de +2 -1 # [PKT_SCHED]: Fix device leaks in mirred action # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/mirred.c b/net/sched/mirred.c --- a/net/sched/mirred.c 2004-11-04 07:28:59 +01:00 +++ b/net/sched/mirred.c 2004-11-04 07:28:59 +01:00 @@ -138,8 +138,9 @@ p->eaction = parm->eaction; if (parm->ifindex) { p->ifindex = parm->ifindex; + if (ovr) + dev_put(p->dev); p->dev = dev; - dev_hold(p->dev); } spin_unlock(&p->lock); } --------------060200070306030602060705-- From anil.gunturu@gmail.com Thu Nov 4 00:17:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 00:17:32 -0800 (PST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.205]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA48HNlV012043 for ; Thu, 4 Nov 2004 00:17:23 -0800 Received: by rproxy.gmail.com with SMTP id z35so243252rne for ; Thu, 04 Nov 2004 00:17:01 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=FbHlEe3ti7Hj34Y17GMom9+W69UGfQ6FbXkJaoArsu7hpt5rSABbhBZUyL3MZ0kxDA0GaK8GhZkpNrmDmgFZKWXm6+B/VaAQa0mUIQv/nR+dHdC4gBB/kN6BUow8ZPt/ae7XeBt8mL7i15P3yfBCwFygziOBQnFeAl+7bzzKlmI= Received: by 10.38.163.72 with SMTP id l72mr694079rne; Wed, 03 Nov 2004 23:17:01 -0800 (PST) Received: by 10.39.2.38 with HTTP; Wed, 3 Nov 2004 23:17:01 -0800 (PST) Message-ID: <2f61ba570411032317438bd494@mail.gmail.com> Date: Wed, 3 Nov 2004 23:17:01 -0800 From: Anil Gunturu Reply-To: Anil Gunturu To: netdev@oss.sgi.com Subject: kernel scalability Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-archive-position: 11428 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: anil.gunturu@gmail.com Precedence: bulk X-list: netdev Content-Length: 425 Lines: 9 Hi, We are porting linux kernel (2.4.18) for an embdded device that supports a large number of logical interfaces (upto 200) and routes (4000). There are only two physical ethernet interfaces, but we are planning to add multiple ip addresses and routes using the "ip" utility from iproute2 package. Just wondering if there are any scalability issues in doing so as far as the kernel is concerned. Thanks for your help, -Anil From herbert@gondor.apana.org.au Thu Nov 4 01:08:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 01:08:30 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA498KtV017146 for ; Thu, 4 Nov 2004 01:08:21 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CPbzf-0003Be-00; Thu, 04 Nov 2004 18:25:15 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CPbzb-0007ld-00; Thu, 04 Nov 2004 18:25:11 +1100 Date: Thu, 4 Nov 2004 18:25:11 +1100 To: "David S. Miller" , netdev@oss.sgi.com Subject: [NET] Get rid of unused glbl counter in neighbour Message-ID: <20041104072511.GA29842@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="TB36FDmn/VVEgNH/" Content-Disposition: inline User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11429 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 1407 Lines: 51 --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Dave: This patch gets rid of an unused global counter in neighbour.c. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/core/neighbour.c 1.55 vs edited ===== --- 1.55/net/core/neighbour.c 2004-11-04 10:41:49 +11:00 +++ edited/net/core/neighbour.c 2004-11-04 14:47:14 +11:00 @@ -59,7 +59,6 @@ static int pneigh_ifdown(struct neigh_table *tbl, struct net_device *dev); void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); -static int neigh_glbl_allocs; static struct neigh_table *neigh_tables; static struct file_operations neigh_stat_seq_fops; @@ -282,7 +281,6 @@ n->timer.data = (unsigned long)n; NEIGH_CACHE_STAT_INC(tbl, allocs); - neigh_glbl_allocs++; n->tbl = tbl; atomic_set(&n->refcnt, 1); n->dead = 1; @@ -612,7 +610,6 @@ NEIGH_PRINTK2("neigh %p is destroyed.\n", neigh); - neigh_glbl_allocs--; atomic_dec(&neigh->tbl->entries); kmem_cache_free(neigh->tbl->kmem_cachep, neigh); } --TB36FDmn/VVEgNH/-- From andi@cosy.sbg.ac.at Thu Nov 4 05:13:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 05:13:29 -0800 (PST) Received: from dobermann.cosy.sbg.ac.at (dobermann.cosy.sbg.ac.at [141.201.2.56]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4DDO5t003125 for ; Thu, 4 Nov 2004 05:13:24 -0800 Received: by dobermann.cosy.sbg.ac.at (Postfix, from userid 102) id 4306BF9B54; Thu, 4 Nov 2004 14:13:06 +0100 (CET) Received: from leu (leu.cosy.sbg.ac.at [141.201.2.107]) by dobermann.cosy.sbg.ac.at (Postfix) with ESMTP id 010DEF9ABC for ; Thu, 4 Nov 2004 14:13:05 +0100 (CET) Date: Thu, 04 Nov 2004 13:13:10 +0000 From: Andreas Maier Subject: Hide AF_INET To: netdev@oss.sgi.com X-Mailer: Balsa 2.2.5 Message-Id: <1099573990l.4491l.1l@leu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp=Yes; Format=Flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id iA4DDO5t003125 X-archive-position: 11430 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: andi@cosy.sbg.ac.at Precedence: bulk X-list: netdev Content-Length: 1889 Lines: 75 I need a Linux testbed to test applications in an IPv6-only environment. Unfortunately IPv6 cannot be enabled without also enabling IPv4. Therefor I try to hide AF_INET from user space with the appended patch. It is a partial success in that AF_INET is no longer available to user space, the kernel does not crash, TCP6 connections (ssh) work and UDP6 connections seem to work (DNS). The drawback is that ICMP6 (ping6) does not work and that I think my basic approach is ugly. What could be a quick hack to get ICMP6 working in my scenario? Would it be possible - with reasonable effort - to convert networking code so that IPv6 no longer depends on IPv4 so that an IPv6-only configuration can be created easily? Thanks for your help, -andi --- net/ipv4/af_inet.c.orig 2004-10-29 15:01:42.000000000 +0200 +++ net/ipv4/af_inet.c 2004-11-04 11:57:11.000000000 +0100 @@ -1032,7 +1032,10 @@ * Tell SOCKET that we are alive... */ +#define HIDE_V4 +#ifndef HIDE_V4 (void)sock_register(&inet_family_ops); +#endif /* * Add all the base protocols. @@ -1066,9 +1069,11 @@ * Set the IP module up */ +#ifndef HIDE_V4 ip_init(); tcp_v4_init(&inet_family_ops); +#endif /* Setup TCP slab cache for open requests. */ tcp_init(); @@ -1078,7 +1083,9 @@ * Set the ICMP layer up */ +#ifndef HIDE_V4 icmp_init(&inet_family_ops); +#endif /* * Initialise the multicast router @@ -1093,7 +1100,9 @@ if(init_ipv4_mibs()) printk(KERN_CRIT "inet_init: Cannot init ipv4 mibs\n"); ; +#ifndef HIDE_V4 ipv4_proc_init(); +#endif ipfrag_init(); -- | Andreas Maier Paris-Lodron University of Salzburg | | (andi [at] cosy.sbg.ac.at) Department of Scientific Computing | | Tel. +43/662/8044-6339 Jakob Haringerstr. 2 | | Fax. +43/662/8044-172 5020 Salzburg / Austria, Europe | From hadi@cyberus.ca Thu Nov 4 05:54:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 05:54:28 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4DsNkQ004739 for ; Thu, 4 Nov 2004 05:54:24 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CPi3w-0003Fj-2H for netdev@oss.sgi.com; Thu, 04 Nov 2004 08:54:04 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CPi3t-0002n5-Pw; Thu, 04 Nov 2004 08:54:02 -0500 Subject: Re: [PATCH 2.6]: Fix device leaks in mirred action From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <4189CC6A.9040007@trash.net> References: <4189CC6A.9040007@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1099576439.1038.147.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Nov 2004 08:53:59 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 11431 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: 395 Lines: 16 On Thu, 2004-11-04 at 01:30, Patrick McHardy wrote: > When a mirred action is created it takes two references to the > device (dev_get_by_index + dev_hold), but only drops one when > it gets destroyed. Good catch. The correct fix is to remove the dev_hold(p->dev) call. > It also leaks a reference when a mirred action > is replaced. How? Is this patch supposed to fix that? cheers, jamal From hadi@cyberus.ca Thu Nov 4 05:57:07 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 05:57:10 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4Dv600005320 for ; Thu, 4 Nov 2004 05:57:06 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CPi6Y-0006Q2-RS for netdev@oss.sgi.com; Thu, 04 Nov 2004 08:56:46 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CPi6X-0003BT-6R; Thu, 04 Nov 2004 08:56:45 -0500 Subject: Re: [PATCH 2.6 5/5]: act_api: mark some functions static/remove unused function From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <4189CB70.3060703@trash.net> References: <4189CB70.3060703@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1099576602.1039.151.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Nov 2004 08:56:42 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 11432 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: 282 Lines: 13 On Thu, 2004-11-04 at 01:25, Patrick McHardy wrote: > Mark some functions static in act_api. All the rest of the static conversions are good except for this. > tc_lookup_action_id was unused > so I removed it. Please dont. I am incrementally submitting patches. cheers, jamal From uweber@astaro.de Thu Nov 4 06:01:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 06:01:55 -0800 (PST) Received: from mail.astaro.com (mail.astaro.com [213.221.123.2]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4E1kFa005820 for ; Thu, 4 Nov 2004 06:01:49 -0800 Received: from [192.168.2.219] (helo=[192.168.2.219]) by mail.astaro.com with esmtp (TLSv1:RC4-MD5:128) (Exim 4.30) id 1CPhr2-0003GF-Re; Thu, 04 Nov 2004 14:40:44 +0100 Message-ID: <418A3630.1040900@astaro.de> Date: Thu, 04 Nov 2004 15:01:20 +0100 From: Ulrich Weber User-Agent: Mozilla Thunderbird 0.8 (X11/20040926) X-Accept-Language: en-us, en MIME-Version: 1.0 To: vpn-failover@lists.balabit.hu CC: netdev@oss.sgi.com, ipsec-tools-devel@lists.sourceforge.net Subject: Re: [Vpn-failover] [RFC] IPSEC failover - Netlink part References: <1099045435.2888.47.camel@nienna.balabit> In-Reply-To: <1099045435.2888.47.camel@nienna.balabit> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------080205020700070500050104" X-Scan-Signature: 15b2a1d998c4a55cfa3008925b70daf3 X-archive-position: 11433 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: uweber@astaro.de Precedence: bulk X-list: netdev Content-Length: 5971 Lines: 210 This is a multi-part message in MIME format. --------------080205020700070500050104 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I take the opportunity to post my code as well. At the moment I'm working at the same as Krisztian. My solutions however is for openswan, which uses netlink instead of pfkey. Please find attached the appropriate netlink modifications to include/linux/xfrm.h and net/xfrm/xfrm_users.c In theses patches, a new netlink group (XFRMGRP_REPLAY) is added to notify about seq number changes. Each notify message contains a xfrm_usersa_id struct with the replay struct attached as rt attribute. In addition, these replay struct is also attached at ipsec sa dumps. Any comments are welcome :) Cheers ~ Ulrich -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBijYw22t2oTuElzoRAp0LAKCdKc4CgzWqLJLh4/U2oRFA96e49gCgk2R3 Rff8wpPVtUZtlCwJUEnP+34= =b6vx -----END PGP SIGNATURE----- --------------080205020700070500050104 Content-Type: text/x-chdr; name="linux_xfrm.h" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="linux_xfrm.h" --- linux.org/include/linux/xfrm.h. 2004-10-11 04:57:07.000000000 +0200 +++ linux/include/linux/xfrm.h 2004-10-18 17:00:43.000000000 +0200 @@ -140,6 +140,9 @@ XFRM_MSG_FLUSHPOLICY, #define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY + XFRM_MSG_UPDSEQ, +#define XFRM_MSG_UPDSEQ XFRM_MSG_UPDSEQ + XFRM_MSG_MAX }; @@ -171,6 +174,7 @@ XFRMA_ALG_COMP, /* struct xfrm_algo */ XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */ XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ + XFRMA_REPLAY, /* struct xfrm_replay_state */ __XFRMA_MAX #define XFRMA_MAX (__XFRMA_MAX - 1) @@ -258,5 +258,6 @@ #define XFRMGRP_ACQUIRE 1 #define XFRMGRP_EXPIRE 2 +#define XFRMGRP_REPLAY 3 #endif /* _LINUX_XFRM_H */ --------------080205020700070500050104 Content-Type: text/x-patch; name="xfrm_user.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xfrm_user.diff" --- linux.org/net/xfrm/xfrm_user.c 2004-10-18 23:54:32.000000000 +0200 +++ linux/net/xfrm/xfrm_user.c 2004-10-21 16:27:59.000000000 +0200 @@ -240,6 +240,12 @@ if ((err = attach_encap_tmpl(&x->encap, xfrma[XFRMA_ENCAP-1]))) goto error; + if(xfrma[XFRMA_REPLAY-1]) { + struct xfrm_replay_state *replay; + replay = RTA_DATA(xfrma[XFRMA_REPLAY - 1]); + x->replay = *replay; + } + err = -ENOENT; x->type = xfrm_get_type(x->id.proto, x->props.family); if (x->type == NULL) @@ -368,6 +375,8 @@ if (x->encap) RTA_PUT(skb, XFRMA_ENCAP, sizeof(*x->encap), x->encap); + RTA_PUT(skb, XFRMA_REPLAY, sizeof(x->replay), &x->replay); + nlh->nlmsg_len = skb->tail - b; out: sp->this_idx++; @@ -852,6 +861,27 @@ return 0; } +static int xfrm_update_seq(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) +{ + struct xfrm_state *x; + struct xfrm_usersa_id *p = NLMSG_DATA(nlh); + struct xfrm_replay_state *replay; + + x = xfrm_state_lookup(&p->daddr, p->spi, p->proto, p->family); + if (x == NULL) { + printk(KERN_INFO "Found no xfrm state for sa seq update\n"); + return -ESRCH; + } + + if(xfrma[XFRMA_REPLAY-1]) { + replay = RTA_DATA(xfrma[XFRMA_REPLAY - 1]); + x->replay = *replay; + } + else return -EINVAL; + + return 0; +} + static const int xfrm_msg_min[(XFRM_MSG_MAX + 1 - XFRM_MSG_BASE)] = { NLMSG_LENGTH(sizeof(struct xfrm_usersa_info)), /* NEW SA */ NLMSG_LENGTH(sizeof(struct xfrm_usersa_id)), /* DEL SA */ @@ -867,6 +897,7 @@ NLMSG_LENGTH(sizeof(struct xfrm_user_polexpire)), /* POLEXPIRE */ NLMSG_LENGTH(sizeof(struct xfrm_usersa_flush)), /* FLUSH SA */ NLMSG_LENGTH(0), /* FLUSH POLICY */ + NLMSG_LENGTH(sizeof(struct xfrm_usersa_id)),/* UPD SEQ */ }; static struct xfrm_link { @@ -893,6 +924,7 @@ {}, { .doit = xfrm_flush_sa }, { .doit = xfrm_flush_policy }, + { .doit = xfrm_update_seq }, }; static int xfrm_done(struct netlink_callback *cb) @@ -1050,6 +1082,33 @@ return -1; } +static int build_replay(struct sk_buff *skb, struct xfrm_state *x, int event) +{ + struct xfrm_usersa_id *id; + struct nlmsghdr *nlh; + unsigned char *b = skb->tail; + + nlh = NLMSG_PUT(skb, 0, 0, XFRM_MSG_UPDSEQ, + sizeof(*id)); + id = NLMSG_DATA(nlh); + nlh->nlmsg_flags = 0; + + id->daddr = x->id.daddr; + id->spi = x->id.spi; + id->family = x->props.family; + id->proto = x->id.proto; + + RTA_PUT(skb, XFRMA_REPLAY, sizeof(x->replay), &x->replay); + + nlh->nlmsg_len = skb->tail - b; + return skb->len; + +rtattr_failure: +nlmsg_failure: + skb_trim(skb, b - skb->data); + return -1; +} + static int xfrm_send_state_notify(struct xfrm_state *x, int hard) { struct sk_buff *skb; @@ -1218,12 +1277,28 @@ return netlink_broadcast(xfrm_nl, skb, 0, XFRMGRP_EXPIRE, GFP_ATOMIC); } +static int xfrm_send_replay_notify(struct xfrm_state *x, int event) { + struct sk_buff *skb; + + skb = alloc_skb(sizeof(struct xfrm_usersa_id) + sizeof(struct xfrm_replay_state) + 16, GFP_ATOMIC); + if (skb == NULL) + return -ENOMEM; + + if (build_replay(skb, x, event) < 0) + BUG(); + + NETLINK_CB(skb).dst_groups = XFRMGRP_REPLAY; + + return netlink_broadcast(xfrm_nl, skb, 0, XFRMGRP_REPLAY, GFP_ATOMIC); +} + static struct xfrm_mgr netlink_mgr = { .id = "netlink", .notify = xfrm_send_state_notify, .acquire = xfrm_send_acquire, .compile_policy = xfrm_compile_policy, .notify_policy = xfrm_send_policy_notify, + .notify_seq = xfrm_send_replay_notify, }; static int __init xfrm_user_init(void) --------------080205020700070500050104-- From hadi@cyberus.ca Thu Nov 4 06:15:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 06:16:00 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4EFqpI006675 for ; Thu, 4 Nov 2004 06:15:52 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CPiOe-0006Oi-Ep for netdev@oss.sgi.com; Thu, 04 Nov 2004 09:15:28 -0500 Received: from cpe0030ab124d2f-cm014500000962.cpe.net.cable.rogers.com ([24.103.99.32] helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CPiOW-0005vz-6c; Thu, 04 Nov 2004 09:15:20 -0500 Subject: Re: BUG: dst underflow (again) From: jamal Reply-To: hadi@cyberus.ca To: Lennert Buytenhek Cc: YOSHIFUJI "Hideaki / ?$B5HF#1QL@" , jgarzik@pobox.com, netdev@oss.sgi.com In-Reply-To: <20041022075947.GA15795@xi.wantstofly.org> References: <4178AB0D.6060107@pobox.com> <20041022.155159.98771450.yoshfuji@linux-ipv6.org> <20041022075947.GA15795@xi.wantstofly.org> Content-Type: text/plain Organization: jamalopolous Message-Id: <1099577717.1039.155.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Nov 2004 09:15:17 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 11434 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: 1264 Lines: 44 Jeff/Lennert Could you turn off netfilter and see if this continues to happen? Know how to reproduce this? ;-> cheers, jamal On Fri, 2004-10-22 at 03:59, Lennert Buytenhek wrote: > On Fri, Oct 22, 2004 at 03:51:59PM +0900, YOSHIFUJI Hideaki / ?$B5HF#1QL@ wrote: > > > > As requested, I updated my kernel to see if the "BUG: dst underflow..." > > > messages disappeared. Alas, they didn't. dmesg and .config from > > > 2.6.9-final attached. > > > > Okay, thanks, but hmm... > > (We haven't met this issue... I really want to know tow to reproduce...) > > FWIW, I'm seeing loads of these on the kernel that comes with Fedora > Core 2, also in the ipv6.ko module. I have 6to4 enabled, if that matters > anything. > > % dmesg | grep BUG | sort | uniq > BUG: dst underflow -1: 3bcf9a80 at 42350024 > BUG: dst underflow 0: 3bcf9a80 at 423486d2 > BUG: dst underflow 0: 3bcf9a80 at 4235823d > % cat /sys/module/ipv6/sections/.text > 0x42345000 > > 0x42350024 - 0x42345000 = 0xb024, corresponds to: > 0000affa > > 0x423486d2 - 0x42345000 = 0x36d2, corresponds to: > 0000339d > > 0x4235823d - 0x42345000 = 0x1323d, corresponds to: > 00012c0d (god, that's one big function btw) > > > --L > > From kaber@trash.net Thu Nov 4 06:59:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 06:59:16 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4ExB4l008722 for ; Thu, 4 Nov 2004 06:59:12 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPj4R-0003HP-BW; Thu, 04 Nov 2004 15:58:39 +0100 Message-ID: <418A439F.2010401@trash.net> Date: Thu, 04 Nov 2004 15:58:39 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 2.6]: Fix device leaks in mirred action References: <4189CC6A.9040007@trash.net> <1099576439.1038.147.camel@jzny.localdomain> In-Reply-To: <1099576439.1038.147.camel@jzny.localdomain> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11435 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 324 Lines: 19 jamal wrote: >>It also leaks a reference when a mirred action >>is replaced. >> >> > >How? Is this patch supposed to fix that? > > + if (ovr) + dev_put(p->dev); p->dev = dev; By dropping the reference before replacing it. Regards Patrick From hadi@cyberus.ca Thu Nov 4 07:24:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 07:24:27 -0800 (PST) Received: from mx01.cybersurf.com (mx01.cybersurf.com [209.197.145.104]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4FOL5m011050 for ; Thu, 4 Nov 2004 07:24:22 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx01.cybersurf.com with esmtp (Exim 4.30) id 1CPjT0-0000Qp-GP for netdev@oss.sgi.com; Thu, 04 Nov 2004 10:24:02 -0500 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CPjSy-0000WM-HW; Thu, 04 Nov 2004 10:24:00 -0500 Subject: Re: [PATCH 2.6]: Fix device leaks in mirred action From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <418A439F.2010401@trash.net> References: <4189CC6A.9040007@trash.net> <1099576439.1038.147.camel@jzny.localdomain> <418A439F.2010401@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1099581832.1080.15.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Nov 2004 10:23:53 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 11436 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: 473 Lines: 23 On Thu, 2004-11-04 at 09:58, Patrick McHardy wrote: > jamal wrote: > > >>It also leaks a reference when a mirred action > >>is replaced. > > > >How? Is this patch supposed to fix that? > > > > > + if (ovr) > + dev_put(p->dev); > p->dev = dev; > > By dropping the reference before replacing it. > Ok, makes sense. Thanks Patrick. Dave please apply the patch in its entirety. cheers, jamal From kaber@trash.net Thu Nov 4 07:29:08 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 07:29:14 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4FT7Ki011759 for ; Thu, 4 Nov 2004 07:29:07 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPjXM-0003NM-WA; Thu, 04 Nov 2004 16:28:33 +0100 Message-ID: <418A4AA0.8070609@trash.net> Date: Thu, 04 Nov 2004 16:28:32 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 2.6 5/5]: act_api: mark some functions static/remove unused function References: <4189CB70.3060703@trash.net> <1099576602.1039.151.camel@jzny.localdomain> In-Reply-To: <1099576602.1039.151.camel@jzny.localdomain> Content-Type: multipart/mixed; boundary="------------070506020303020400050606" X-archive-position: 11437 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 4316 Lines: 179 This is a multi-part message in MIME format. --------------070506020303020400050606 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit jamal wrote: >On Thu, 2004-11-04 at 01:25, Patrick McHardy wrote: > > >>tc_lookup_action_id was unused >>so I removed it. >> >> > >Please dont. > Ok, here is the same patch without removing tc_lookup_action_id. It is instead surrounded by #if 0. >I am incrementally submitting patches. > I was about to do more cleanup, please stop me if you are already doing any of this: - move the functions from include/net/pkt_act.h to act_generic.c - convert lastuse/install/expires to USER_HZ - fix ipt: leaks memory at destruction, ovr doesn't work, doesn't refcount iptables module references Is there already userspace-code for anything besides gact ? I would like to test my changes. Regards Patrick --------------070506020303020400050606 Content-Type: text/x-patch; name="5.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="5.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/04 16:11:08+01:00 kaber@coreworks.de # [PKT_SCHED]: act_api: mark some functions static # # Signed-off-by: Patrick McHardy # # net/sched/act_api.c # 2004/11/04 16:11:02+01:00 kaber@coreworks.de +13 -11 # [PKT_SCHED]: act_api: mark some functions static # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/act_api.c b/net/sched/act_api.c --- a/net/sched/act_api.c 2004-11-04 16:11:32 +01:00 +++ b/net/sched/act_api.c 2004-11-04 16:11:32 +01:00 @@ -88,7 +88,7 @@ } /* lookup by name */ -struct tc_action_ops *tc_lookup_action_n(char *kind) +static struct tc_action_ops *tc_lookup_action_n(char *kind) { struct tc_action_ops *a = NULL; @@ -111,7 +111,7 @@ } /* lookup by rtattr */ -struct tc_action_ops *tc_lookup_action(struct rtattr *kind) +static struct tc_action_ops *tc_lookup_action(struct rtattr *kind) { struct tc_action_ops *a = NULL; @@ -134,6 +134,7 @@ return a; } +#if 0 /* lookup by id */ struct tc_action_ops *tc_lookup_action_id(u32 type) { @@ -155,6 +156,7 @@ return a; } +#endif int tcf_action_exec(struct sk_buff *skb,struct tc_action *act, struct tcf_result *res) { @@ -504,7 +506,7 @@ return err; } -int tcf_action_get_1(struct rtattr *rta, struct tc_action *a, struct nlmsghdr *n, u32 pid) +static int tcf_action_get_1(struct rtattr *rta, struct tc_action *a, struct nlmsghdr *n, u32 pid) { struct tc_action_ops *a_o; char act_name[4 + IFNAMSIZ + 1]; @@ -571,7 +573,7 @@ return err; } -void cleanup_a (struct tc_action *act) +static void cleanup_a (struct tc_action *act) { struct tc_action *a; @@ -587,7 +589,7 @@ } } -struct tc_action_ops *get_ao(struct rtattr *kind, struct tc_action *a) +static struct tc_action_ops *get_ao(struct rtattr *kind, struct tc_action *a) { char act_name[4 + IFNAMSIZ + 1]; struct tc_action_ops *a_o = NULL; @@ -622,7 +624,7 @@ return a_o; } -struct tc_action *create_a(int i) +static struct tc_action *create_a(int i) { struct tc_action *act = NULL; @@ -639,7 +641,7 @@ return act; } -int tca_action_flush(struct rtattr *rta, struct nlmsghdr *n, u32 pid) +static int tca_action_flush(struct rtattr *rta, struct nlmsghdr *n, u32 pid) { struct sk_buff *skb; unsigned char *b; @@ -709,7 +711,7 @@ return err; } -int tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event ) +static int tca_action_gd(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int event ) { int s = 0; @@ -793,7 +795,7 @@ } -int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event, unsigned flags) +static int tcf_add_notify(struct tc_action *a, u32 pid, u32 seq, int event, unsigned flags) { struct tcamsg *t; struct nlmsghdr *nlh; @@ -840,7 +842,7 @@ } -int tcf_action_add(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int ovr ) +static int tcf_action_add(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int ovr ) { int ret = 0; struct tc_action *act = NULL; @@ -923,7 +925,7 @@ return ret; } -char * +static char * find_dump_kind(struct nlmsghdr *n) { struct rtattr *tb1, *tb2[TCA_ACT_MAX+1]; --------------070506020303020400050606-- From hadi@cyberus.ca Thu Nov 4 07:54:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 07:54:40 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4FsVsR013935 for ; Thu, 4 Nov 2004 07:54:31 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CPjwB-0005C4-07 for netdev@oss.sgi.com; Thu, 04 Nov 2004 10:54:11 -0500 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CPjw8-0006Sb-GT; Thu, 04 Nov 2004 10:54:08 -0500 Subject: Re: [PATCH 2.6 5/5]: act_api: mark some functions static/remove unused function From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <418A4AA0.8070609@trash.net> References: <4189CB70.3060703@trash.net> <1099576602.1039.151.camel@jzny.localdomain> <418A4AA0.8070609@trash.net> Content-Type: multipart/mixed; boundary="=-jsey1+L9qfIUO70ryExe" Organization: jamalopolous Message-Id: <1099583639.1081.30.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Nov 2004 10:53:59 -0500 X-archive-position: 11438 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: 30642 Lines: 1303 --=-jsey1+L9qfIUO70ryExe Content-Type: text/plain Content-Transfer-Encoding: 7bit On Thu, 2004-11-04 at 10:28, Patrick McHardy wrote: > jamal wrote: > >Please dont. > > > Ok, here is the same patch without removing tc_lookup_action_id. > It is instead surrounded by #if 0. Why is this function bothering you? ;-> Why do you need to put the #if 0? > >I am incrementally submitting patches. > > > I was about to do more cleanup, please stop me if you are already doing > any of this: > My changes will be new stuff going in. So any cleanup is welcome. > - move the functions from include/net/pkt_act.h to act_generic.c Some of the larger ones make sense to move. Whats the main reason for moving them? > - convert lastuse/install/expires to USER_HZ > - fix ipt: leaks memory at destruction, ovr doesn't work, doesn't refcount > iptables module references > These two make sense. I need help eyeballing the iptables stuff. I commented out some of the refcount attempts; also i think quiet a few targets are not friendly in getting accessed by anything other than iptables; I was going at some point fix them and send you guys patches. Maybe you can help me in this area as well. > Is there already userspace-code for anything besides gact ? > I would like to test my changes. > Stephen is probably stalled somewhere because he hasnt been sucking in my updates to iproute2. I have the latest and greatest on my test machine at home. But here are tc updates for ipt and mirred that i could find on my laptop. The ipt patch needs iptables libraries and may not work with latest iptables (although the one at home will surely work). The problem is some of the iptables functions were updated. It would be nice if i didnt have to maintain my own variants in user space. cheers, jamal --=-jsey1+L9qfIUO70ryExe Content-Disposition: attachment; filename=tc-269-mirred-patch-oct052004 Content-Type: text/plain; name=tc-269-mirred-patch-oct052004; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- /dev/null 1998-05-05 16:32:27.000000000 -0400 +++ /home/hadi/iproute2-2.6.9/tc/m_mirred.c 2004-10-04 11:57:51.000000000 -0400 @@ -0,0 +1,310 @@ +/* + * m_egress.c ingress/egress packet mirror/redir actions module + * + * This program is free software; you can distribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: J Hadi Salim (hadi@cyberus.ca) + * + * TODO: Add Ingress support + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "utils.h" +#include "tc_util.h" +#include + +int mirred_d = 1; + +static void +explain(void) +{ + fprintf(stderr, "Usage: mirred [index INDEX] \n"); + fprintf(stderr, "where: \n"); + fprintf(stderr, "DIRECTION := \n"); + fprintf(stderr, "aCTION := \n"); + fprintf(stderr, " : INDEX is the specific policy instance id\n"); + fprintf(stderr, " : DEVICENAME is the devicename \n"); +} + +#define usage() return(-1) + +char *mirred_n2a(int action) +{ + switch (action) { + case TCA_EGRESS_REDIR: + return "Egress Redirect"; + case TCA_INGRESS_REDIR: + return "Ingress Redirect"; + case TCA_EGRESS_MIRROR: + return "Egress Mirror"; + case TCA_INGRESS_MIRROR: + return "Ingress Mirror"; + default: + return "unknown"; + } +} + +int +parse_egress(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struct nlmsghdr *n) +{ + + int argc = *argc_p; + char **argv = *argv_p; + int ok = 0, iok = 0, mirror=0,redir=0; + struct tc_mirred p; + struct rtattr *tail; + char d[16]; + struct rtnl_handle rth; + + memset(d,0,sizeof(d)-1); + memset(&p,0,sizeof(struct tc_mirred)); + + while (argc > 0) { + + if (matches(*argv, "action") == 0) { + break; + } else if (matches(*argv, "egress") == 0) { + NEXT_ARG(); + ok++; + continue; + } else { + + if (matches(*argv, "index") == 0) { + NEXT_ARG(); + if (get_u32(&p.index, *argv, 10)) { + fprintf(stderr, "Illegal \"index\"\n"); + return -1; + } + iok++; + if (!ok) { + argc--; + argv++; + break; + } + } else if(!ok) { + fprintf(stderr, "was expecting egress (%s)\n", *argv); + break; + + } else if (!mirror && matches(*argv, "mirror") == 0) { + mirror=1; + if (redir) { + fprintf(stderr, "Cant have both mirror and redir\n"); + return -1; + } + p.eaction = TCA_EGRESS_MIRROR; + p.action = TC_ACT_PIPE; + ok++; + } else if (!redir && matches(*argv, "redirect") == 0) { + redir=1; + if (mirror) { + fprintf(stderr, "Cant have both mirror and redir\n"); + return -1; + } + p.eaction = TCA_EGRESS_REDIR; + p.action = TC_ACT_STOLEN; + ok++; + } else if ((redir || mirror) && matches(*argv, "dev") == 0) { + NEXT_ARG(); + if (strlen(d)) + duparg("dev", *argv); + + strncpy(d, *argv, sizeof(d)-1); + argc--; + argv++; + + break; + + } + } + + NEXT_ARG(); + } + + if (!ok && !iok) { + explain(); + return -1; + } + + + + if (d[0]) { + int idx; + if (rtnl_open(&rth, 0) < 0) { + fprintf(stderr, "Cannot open rtnetlink\n"); + exit(1); + } + ll_init_map(&rth); + + + if ((idx = ll_name_to_index(d)) == 0) { + fprintf(stderr, "Cannot find device \"%s\"\n", d); + rtnl_close(&rth); + return -1; + } + + p.ifindex = idx; + rtnl_close(&rth); + } + + + if (argc && p.eaction == TCA_EGRESS_MIRROR) { + + if (matches(*argv, "reclassify") == 0) { + p.action = TC_POLICE_RECLASSIFY; + NEXT_ARG(); + } else if (matches(*argv, "pipe") == 0) { + p.action = TC_POLICE_PIPE; + NEXT_ARG(); + } else if (matches(*argv, "drop") == 0 || + matches(*argv, "shot") == 0) { + p.action = TC_POLICE_SHOT; + NEXT_ARG(); + } else if (matches(*argv, "continue") == 0) { + p.action = TC_POLICE_UNSPEC; + NEXT_ARG(); + } else if (matches(*argv, "pass") == 0) { + p.action = TC_POLICE_OK; + NEXT_ARG(); + } + + } + + if (argc) { + if (iok && matches(*argv, "index") == 0) { + fprintf(stderr, "mirred: Illegal double index\n"); + return -1; + } else { + if (matches(*argv, "index") == 0) { + NEXT_ARG(); + if (get_u32(&p.index, *argv, 10)) { + fprintf(stderr, "mirred: Illegal \"index\"\n"); + return -1; + } + argc--; + argv++; + } + } + } + + if (mirred_d) + fprintf(stdout, "Action %d device %s ifindex %d\n",p.action, d,p.ifindex); + + tail = (struct rtattr *) (((void *) n) + NLMSG_ALIGN(n->nlmsg_len)); + addattr_l(n, MAX_MSG, tca_id, NULL, 0); + addattr_l(n, MAX_MSG, TCA_MIRRED_PARMS, &p, sizeof (p)); + tail->rta_len = + (((void *) n) + NLMSG_ALIGN(n->nlmsg_len)) - (void *) tail; + + *argc_p = argc; + *argv_p = argv; + return 0; +} + + +int +parse_mirred(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struct nlmsghdr *n) +{ + + int argc = *argc_p; + char **argv = *argv_p; + + if (argc < 0) { + fprintf(stderr,"mirred bad arguement count %d\n", argc); + return -1; + } + + if (matches(*argv, "mirred") == 0) { + NEXT_ARG(); + } else { + fprintf(stderr,"mirred bad arguement %s\n", *argv); + return -1; + } + + + if (matches(*argv, "egress") == 0 || matches(*argv, "index") == 0) { + int ret = parse_egress(a, &argc, &argv, tca_id, n); + if (ret == 0) { + *argc_p = argc; + *argv_p = argv; + return 0; + } + + } else if (matches(*argv, "ingress") == 0) { + fprintf(stderr,"mirred ingress not supported at the moment\n"); + + } else { + fprintf(stderr,"mirred not supported %s\n", *argv); + } + + return -1; + +} + +int +print_mirred(struct action_util *au,FILE * f, struct rtattr *arg) +{ + struct tc_mirred *p; + struct rtattr *tb[TCA_MIRRED_MAX + 1]; + struct rtnl_handle rth; + const char *dev; + SPRINT_BUF(b1); + + if (arg == NULL) + return -1; + + memset(tb, 0, sizeof (tb)); + parse_rtattr(tb, TCA_MIRRED_MAX, RTA_DATA(arg), RTA_PAYLOAD(arg)); + + if (tb[TCA_MIRRED_PARMS] == NULL) { + fprintf(f, "[NULL mirred parameters]"); + return -1; + } + p = RTA_DATA(tb[TCA_MIRRED_PARMS]); + + if (rtnl_open(&rth, 0) < 0) { + fprintf(stderr, "Cannot open rtnetlink\n"); + return -1; + } + + ll_init_map(&rth); + + + if ((dev = ll_index_to_name(p->ifindex)) == 0) { + fprintf(stderr, "Cannot find device %d\n", p->ifindex); + rtnl_close(&rth); + return -1; + } + + fprintf(f, "mirred (%s to device %s) %s", mirred_n2a(p->eaction), dev,action_n2a(p->action, b1, sizeof (b1))); + + fprintf(f, "\n "); + fprintf(f, "\tindex %d ref %d bind %d",p->index,p->refcnt,p->bindcnt); + + if (show_stats) { + if (tb[TCA_MIRRED_TM]) { + struct tcf_t *tm = RTA_DATA(tb[TCA_MIRRED_TM]); + print_tm(f,tm); + } + } + fprintf(f, "\n "); + rtnl_close(&rth); + return 0; +} + +struct action_util mirred_util = { + .id = "mirred", + .parse_aopt = parse_mirred, + .print_aopt = print_mirred, +}; --- /dev/null 1998-05-05 16:32:27.000000000 -0400 +++ /home/hadi/iproute2-2.6.9/include/linux/tc_act/tc_mirred.h 2004-10-04 11:34:03.000000000 -0400 @@ -0,0 +1,28 @@ +#ifndef __LINUX_TC_MIR_H +#define __LINUX_TC_MIR_H + +#include + +#define TCA_ACT_MIRRED 8 +#define TCA_EGRESS_REDIR 1 /* packet redirect to EGRESS*/ +#define TCA_EGRESS_MIRROR 2 /* mirror packet to EGRESS */ +#define TCA_INGRESS_REDIR 3 /* packet redirect to INGRESS*/ +#define TCA_INGRESS_MIRROR 4 /* mirror packet to INGRESS */ + +struct tc_mirred +{ + tc_gen; + int eaction; /* one of IN/EGRESS_MIRROR/REDIR */ + __u32 ifindex; /* ifindex of egress port */ +}; + +enum +{ + TCA_MIRRED_UNSPEC, + TCA_MIRRED_TM, + TCA_MIRRED_PARMS, + __TCA_MIRRED_MAX +}; +#define TCA_MIRRED_MAX (__TCA_MIRRED_MAX - 1) + +#endif --- /home/hadi/iproute2-2.6.9/configure 2004/10/04 15:31:54 1.1 +++ /home/hadi/iproute2-2.6.9/configure 2004/10/04 15:36:07 @@ -26,12 +26,19 @@ fi rm -f /tmp/atmtest.c /tmp/atmtest -# hack for now +# hacks for now echo "TC actions" if [ -e "tc/m_gact.c" ] then + echo " GACT found" echo "TC_CONFIG_ACTION_GACT=y" >>Config echo "TC_CONFIG_ACTION_PROB=y" >>Config fi +if [ -e "tc/m_mirred.c" ] +then + echo " MIRRED found" + echo "TC_CONFIG_ACTION_MIRRED=y" >>Config +fi + --- /dev/null 1998-05-05 16:32:27.000000000 -0400 +++ /home/hadi/iproute2-2.6.9/doc/actions/mirred-usage 2004-10-04 14:38:43.000000000 -0400 @@ -0,0 +1,71 @@ + +Very funky action. I do plan to add to a few more things to it +This is the basic stuff. Idea borrowed from the way ethernet switches +mirror and redirect packets. + +Usage: + +mirred [index INDEX] +where: +DIRECTION := +ACTION := +INDEX is the specific policy instance id +DEVICENAME is the devicename + + +Mirroring essentially takes a copy of the packet whereas redirecting +steals the packet and redirects to specified destination. + +Some examples: +Host A is hooked up to us on eth0 + +tc qdisc add dev lo ingress +# redirect all packets arriving on ingress of lo to eth0 +tc filter add dev lo parent ffff: protocol ip prio 10 u32 \ +match u32 0 0 flowid 1:2 action mirred egress redirect dev eth0 + +On host A start a tcpdump on interface connecting to us. + +on our host ping -c 2 127.0.0.1 + +Ping would fail sinc all packets are heading out eth0 +tcpudmp on host A would show them + +if you substitute the redirect with mirror above as in: +tc filter add dev lo parent ffff: protocol ip prio 10 u32 \ +match u32 0 0 flowid 1:2 action mirred egress mirror dev eth0 + +Then you should see the packets on both host A and the local +stack (i.e ping would work). + +Even more funky example: + +# +#allow 1 out 10 packets to randomly make it to the +# host A (Randomness uses the netrand generator) +# +tc filter add dev lo parent ffff: protocol ip prio 10 u32 \ +match u32 0 0 flowid 1:2 \ +action drop random determ ok 10\ +action mirred egress mirror dev eth0 + +------ +Example 2: +# for packets coming from 10.0.0.9: +#Redirect packets on egress (to ISP A) if you exceed a certain rate +# to eth1 (to ISP B) if you exceed a certain rate +# + +tc qdisc add dev eth0 handle 1:0 root prio + +tc filter add dev eth0 parent 1:0 protocol ip prio 6 u32 \ +match ip src 10.0.0.9/32 flowid 1:16 \ +action police rate 100kbit burst 90k ok \ +action mirred egress mirror dev eth1 + +--- + +A more interesting example is when you mirror flows to a dummy device +so you could tcpdump them (dummy by defaults drops all devices it sees). +This is a very useful debug feature. + --- /home/hadi/iproute2-2.6.9/tc/Makefile 2004/10/04 15:34:15 1.1 +++ /home/hadi/iproute2-2.6.9/tc/Makefile 2004/10/04 15:35:40 @@ -21,6 +21,7 @@ TCMODULES += q_hfsc.o TCMODULES += q_htb.o TCMODULES += m_gact.o +TCMODULES += m_mirred.o TCOBJ += $(TCMODULES) --=-jsey1+L9qfIUO70ryExe Content-Disposition: attachment; filename=patch-ipt-tc-269-3 Content-Type: text/plain; name=patch-ipt-tc-269-3; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit --- /dev/null 2003-09-15 09:40:47.000000000 -0400 +++ /root/iproute2-2.6.9-041019-mod/tc/m_ipt.c 2004-10-25 18:37:57.656805960 -0400 @@ -0,0 +1,683 @@ +/* + * m_ipt.c iptables based targets + * utilities mostly ripped from iptables + * + * This program is free software; you can distribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Authors: J Hadi Salim (hadi@cyberus.ca) + * + * TODO: bad bad hardcoding IPT_LIB_DIR and PROC_SYS_MODPROBE + * +*/ + +#include +#include +#include +#include +#include +#include +#include "utils.h" +#include "tc_util.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +const char *pname = "tc-ipt"; +const char *tname = "mangle"; +const char *pversion = "0.1"; + +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef IPT_LIB_DIR +#define IPT_LIB_DIR "/usr/local/lib/iptables" +#endif + +#ifndef PROC_SYS_MODPROBE +#define PROC_SYS_MODPROBE "/proc/sys/kernel/modprobe" +#endif + +static char *ipthooks[] = { + "NF_IP_PRE_ROUTING", + "NF_IP_LOCAL_IN", + "NF_IP_FORWARD", + "NF_IP_LOCAL_OUT", + "NF_IP_POST_ROUTING", +}; + +static struct option original_opts[] = { + {"jump", 1, 0, 'j'}, + {0, 0, 0, 0} +}; + +static struct iptables_target *t_list = NULL; +static unsigned int global_option_offset = 0; +#define OPTION_OFFSET 256 + +/* no clue why register match is within targets + figure out later. Talk to Harald -- JHS +*/ +void +register_match(struct iptables_match *me) +{ +/* fprintf(stderr, "\nDummy register_match\n"); */ +} + +void +register_target(struct iptables_target *me) +{ +/* fprintf(stderr, "\nDummy register_target %s \n", me->name); +*/ + me->next = t_list; + t_list = me; + +} + +void +exit_tryhelp(int status) +{ + fprintf(stderr, "Try `%s -h' or '%s --help' for more information.\n", + pname, pname); + exit(status); +} + +void +exit_error(enum exittype status, char *msg, ...) +{ + va_list args; + + va_start(args, msg); + fprintf(stderr, "%s v%s: ", pname, pversion); + vfprintf(stderr, msg, args); + va_end(args); + fprintf(stderr, "\n"); + if (status == PARAMETER_PROBLEM) + exit_tryhelp(status); + if (status == VERSION_PROBLEM) + fprintf(stderr, + "Perhaps iptables or your kernel needs to be upgraded.\n"); + exit(status); +} + +/* stolen from iptables 1.2.11 +They should really have them as a library so i can link to them +Email them next time i remember +*/ + +static char * +addr_to_network(const struct in_addr *addr) +{ + struct netent *net; + + if ((net = getnetbyaddr((long) ntohl(addr->s_addr), AF_INET)) != NULL) + return (char *) net->n_name; + + return (char *) NULL; +} + +char * +addr_to_dotted(const struct in_addr *addrp) +{ + static char buf[20]; + const unsigned char *bytep; + + bytep = (const unsigned char *) &(addrp->s_addr); + sprintf(buf, "%d.%d.%d.%d", bytep[0], bytep[1], bytep[2], bytep[3]); + return buf; +} + +int +string_to_number_ll(const char *s, unsigned long long min, unsigned long long max, + unsigned long long *ret) +{ + unsigned long long number; + char *end; + + /* Handle hex, octal, etc. */ + errno = 0; + number = strtoull(s, &end, 0); + if (*end == '\0' && end != s) { + /* we parsed a number, let's see if we want this */ + if (errno != ERANGE && min <= number && (!max || number <= max)) { + *ret = number; + return 0; + } + } + return -1; +} + +int +string_to_number_l(const char *s, unsigned long min, unsigned long max, + unsigned long *ret) +{ + int result; + unsigned long long number; + + result = string_to_number_ll(s, min, max, &number); + *ret = (unsigned long)number; + + return result; +} + +int string_to_number(const char *s, unsigned int min, unsigned int max, + unsigned int *ret) +{ + int result; + unsigned long number; + + result = string_to_number_l(s, min, max, &number); + *ret = (unsigned int)number; + + return result; +} + +#if 0 +int +string_to_number(const char *s, unsigned int min, unsigned int max, + unsigned int *ret) +{ + long number; + char *end; + + /* Handle hex, octal, etc. */ + errno = 0; + number = strtol(s, &end, 0); + if (*end == '\0' && end != s) { + /* we parsed a number, let's see if we want this */ + if (errno != ERANGE && min <= number && number <= max) { + *ret = number; + return 0; + } + } + return -1; +} +#endif + +static struct option * +copy_options(struct option *oldopts) +{ + struct option *merge; + unsigned int num_old; + for (num_old = 0; oldopts[num_old].name; num_old++) ; + merge = malloc(sizeof (struct option) * (num_old + 1)); + if (NULL == merge) + return NULL; + memcpy(merge, oldopts, num_old * sizeof (struct option)); + memset(merge + num_old, 0, sizeof (struct option)); + return merge; +} + +static struct option * +merge_options(struct option *oldopts, const struct option *newopts, + unsigned int *option_offset) +{ + struct option *merge; + unsigned int num_old, num_new, i; + + for (num_old = 0; oldopts[num_old].name; num_old++) ; + for (num_new = 0; newopts[num_new].name; num_new++) ; + + *option_offset = global_option_offset + OPTION_OFFSET; + + merge = malloc(sizeof (struct option) * (num_new + num_old + 1)); + memcpy(merge, oldopts, num_old * sizeof (struct option)); + for (i = 0; i < num_new; i++) { + merge[num_old + i] = newopts[i]; + merge[num_old + i].val += *option_offset; + } + memset(merge + num_old + num_new, 0, sizeof (struct option)); + + return merge; +} + +static void * +fw_calloc(size_t count, size_t size) +{ + void *p; + + if ((p = (void *) calloc(count, size)) == NULL) { + perror("iptables: calloc failed"); + exit(1); + } + return p; +} + +#if 0 +static void * +fw_malloc(size_t size) +{ + void *p; + + if ((p = (void *) malloc(size)) == NULL) { + perror("iptables: malloc failed"); + exit(1); + } + return p; +} + +int +check_inverse(const char option[], int *invert) +{ + if (option && strcmp(option, "!") == 0) { + if (*invert) + exit_error(PARAMETER_PROBLEM, + "Multiple `!' flags not allowed"); + + *invert = TRUE; + return TRUE; + } + return FALSE; +} +#endif + +struct iptables_target * +find_t(char *name) +{ + struct iptables_target *m; + for (m = t_list; m; m = m->next) { + if (strcmp(m->name, name) == 0) + return m; + } + + return NULL; +} + +struct iptables_target * +get_target_name(char *name) +{ + void *handle; + char *error; + char *new_name, *lname; + struct iptables_target *m; + + char path[sizeof (IPT_LIB_DIR) + sizeof ("/libipt_.so") + strlen(name)]; + + new_name = malloc(strlen(name) + 1); + lname = malloc(strlen(name) + 1); + if (new_name) + memset(new_name, '\0', strlen(name) + 1); + else + exit_error(PARAMETER_PROBLEM, "get_target_name"); + + if (lname) + memset(lname, '\0', strlen(name) + 1); + else + exit_error(PARAMETER_PROBLEM, "get_target_name"); + + strcpy(new_name, name); + strcpy(lname, name); + + if (isupper(lname[0])) { + int i; + for (i = 0; i < strlen(name); i++) { + lname[i] = tolower(lname[i]); + } + } + + if (islower(new_name[0])) { + int i; + for (i = 0; i < strlen(new_name); i++) { + new_name[i] = toupper(new_name[i]); + } + } + + sprintf(path, IPT_LIB_DIR "/libipt_%s.so", new_name); + handle = dlopen(path, RTLD_LAZY); + if (!handle) { + sprintf(path, IPT_LIB_DIR "/libipt_%s.so", lname); + handle = dlopen(path, RTLD_LAZY); + if (!handle) { + fputs(dlerror(), stderr); + printf("\n"); + return NULL; + } + } + + m = dlsym(handle, new_name); + if ((error = dlerror()) != NULL) { + m = (struct iptables_target *) dlsym(handle, lname); + if ((error = dlerror()) != NULL) { + m = find_t(new_name); + if (NULL == m) { + m = find_t(lname); + if (NULL == m) { + fputs(error, stderr); + fprintf(stderr, "\n"); + dlclose(handle); + return NULL; + } + } + } + } + + return m; +} + +#if 0 +char * +addr_to_dotted(const struct in_addr *addrp) +{ + static char buf[20]; + const unsigned char *bytep; + + bytep = (const unsigned char *) &(addrp->s_addr); + sprintf(buf, "%d.%d.%d.%d", bytep[0], bytep[1], bytep[2], bytep[3]); + return buf; +} +#endif + +struct in_addr * +dotted_to_addr(const char *dotted) +{ + static struct in_addr addr; + unsigned char *addrp; + char *p, *q; + unsigned int onebyte; + int i; + char buf[20]; + + /* copy dotted string, because we need to modify it */ + strncpy(buf, dotted, sizeof (buf) - 1); + addrp = (unsigned char *) &(addr.s_addr); + + p = buf; + for (i = 0; i < 3; i++) { + if ((q = strchr(p, '.')) == NULL) + return (struct in_addr *) NULL; + + *q = '\0'; + if (string_to_number(p, 0, 255, &onebyte) == -1) + return (struct in_addr *) NULL; + + addrp[i] = (unsigned char) onebyte; + p = q + 1; + } + + /* we've checked 3 bytes, now we check the last one */ + if (string_to_number(p, 0, 255, &onebyte) == -1) + return (struct in_addr *) NULL; + + addrp[3] = (unsigned char) onebyte; + + return &addr; +} + +int +build_st(struct iptables_target *target, struct ipt_entry_target *t) +{ + unsigned int nfcache = 0; + + if (target) { + size_t size; + + size = + IPT_ALIGN(sizeof (struct ipt_entry_target)) + target->size; + + if (NULL == t) { + target->t = fw_calloc(1, size); + target->init(target->t, &nfcache); + target->t->u.target_size = size; + } else { + target->t = t; + } + strcpy(target->t->u.user.name, target->name); + return 0; + } + + return -1; +} + +int +parse_ipt(struct action_util *a,int *argc_p, char ***argv_p, int tca_id, struct nlmsghdr *n) +{ + struct iptables_target *m = NULL; + struct ipt_entry fw; + struct rtattr *tail; + int c; + int rargc = *argc_p; + char **argv = *argv_p; + struct option *opts; + int argc = 0, iargc = 0; + char k[16]; + int res = -1; + int size = 0; + int iok = 0, ok = 0; + __u32 hook = 0, index = 0; + res = 0; + + { + int i; + for (i = 0; i < rargc; i++) { + if (NULL == argv[i] || 0 == strcmp(argv[i], "action")) { + break; + } + } + iargc = argc = i; + } + + if (argc <= 2) { + fprintf(stderr,"bad arguements to ipt %d vs %d \n", argc, rargc); + return -1; + } + + opts = copy_options(original_opts); + + if (NULL == opts) + return -1; + + while (1) { + c = getopt_long(argc, argv, "j:", opts, NULL); + if (c == -1) + break; + switch (c) { + case 'j': + m = get_target_name(optarg); + if (NULL != m) { + + if (0 > build_st(m, NULL)) { + printf(" %s error \n", m->name); + return -1; + } + opts = + merge_options(opts, m->extra_opts, + &m->option_offset); + } else { + fprintf(stderr," failed to find target %s\n\n", optarg); + return -1; + } + ok++; + break; + + default: + memset(&fw, 0, sizeof (fw)); + if (m) { + unsigned int fake_flags = 0; + m->parse(c - m->option_offset, argv, 0, + &fake_flags, NULL, &m->t); + } else { + fprintf(stderr," failed to find target %s\n\n", optarg); + return -1; + + } + ok++; + + /*m->final_check(m->t); -- Is this necessary? + ** useful when theres depencies + ** eg ipt_TCPMSS.c has have the TCP match loaded + ** before this can be used; + ** also seems the ECN target needs it + */ + + break; + + } + } + + if (iargc > optind) { + if (matches(argv[optind], "index") == 0) { + if (get_u32(&index, argv[optind + 1], 10)) { + fprintf(stderr, "Illegal \"index\"\n"); + return -1; + } + iok++; + + optind += 2; + } + } + + if (!ok && !iok) { + fprintf(stderr," ipt Parser BAD!! (%s)\n",argv); + return -1; + } + + { + struct tcmsg *t = NLMSG_DATA(n); + if (t->tcm_parent != TC_H_ROOT + && t->tcm_parent == TC_H_MAJ(TC_H_INGRESS)) { + hook = NF_IP_PRE_ROUTING; + } else { + hook = NF_IP_POST_ROUTING; + } + } + + tail = (struct rtattr *) (((void *) n) + NLMSG_ALIGN(n->nlmsg_len)); + addattr_l(n, MAX_MSG, tca_id, NULL, 0); + fprintf(stdout, "tablename: %s hook: %s\n ", tname, ipthooks[hook]); + fprintf(stdout, "\ttarget: "); + + if (m) + m->print(NULL, m->t, 0); + fprintf(stdout, " index %d\n", index); + + if (strlen(tname) > 16) { + size = 16; + k[15] = 0; + } else { + size = 1 + strlen(tname); + } + strncpy(k, tname, size); + + addattr_l(n, MAX_MSG, TCA_IPT_TABLE, k, size); + addattr_l(n, MAX_MSG, TCA_IPT_HOOK, &hook, 4); + addattr_l(n, MAX_MSG, TCA_IPT_INDEX, &index, 4); + if (m) + addattr_l(n, MAX_MSG, TCA_IPT_TARG, m->t, m->t->u.target_size); + tail->rta_len = + (((void *) n) + NLMSG_ALIGN(n->nlmsg_len)) - (void *) tail; + + argc -= optind; + argv += optind; + *argc_p = rargc - iargc; + *argv_p = argv; + + optind = 1; + + return 0; + +} + +int +print_ipt(struct action_util *au,FILE * f, struct rtattr *arg) +{ + struct rtattr *tb[TCA_IPT_MAX + 1]; + struct ipt_entry_target *t = NULL; + struct option *opts; + + if (arg == NULL) + return -1; + + opts = copy_options(original_opts); + + if (NULL == opts) + return -1; + memset(tb, 0, sizeof (tb)); + parse_rtattr(tb, TCA_IPT_MAX, RTA_DATA(arg), RTA_PAYLOAD(arg)); + + if (tb[TCA_IPT_TABLE] == NULL) { + fprintf(f, "[NULL ipt table name ] assuming mangle "); + } else { + fprintf(f, "tablename: %s ", + (char *) RTA_DATA(tb[TCA_IPT_TABLE])); + } + + if (tb[TCA_IPT_HOOK] == NULL) { + fprintf(f, "[NULL ipt hook name ]\n "); + return -1; + } else { + __u32 hook; + hook = *(__u32 *) RTA_DATA(tb[TCA_IPT_HOOK]); + fprintf(f, " hook: %s \n", ipthooks[hook]); + } + + if (tb[TCA_IPT_TARG] == NULL) { + fprintf(f, "\t[NULL ipt target parameters ] \n"); + return -1; + } else { + struct iptables_target *m = NULL; + t = RTA_DATA(tb[TCA_IPT_TARG]); + m = get_target_name(t->u.user.name); + if (NULL != m) { + if (0 > build_st(m, t)) { + fprintf(stderr, " %s error \n", m->name); + return -1; + } + + opts = + merge_options(opts, m->extra_opts, + &m->option_offset); + } else { + fprintf(stderr, " failed to find target %s\n\n", + t->u.user.name); + return -1; + } + fprintf(f, "\ttarget "); + m->print(NULL, m->t, 0); + if (tb[TCA_IPT_INDEX] == NULL) { + fprintf(f, " [NULL ipt target index ]\n"); + } else { + __u32 index; + index = *(__u32 *) RTA_DATA(tb[TCA_IPT_INDEX]); + fprintf(f, " \n\tindex %d", index); + } + + if (tb[TCA_IPT_CNT]) { + struct tc_cnt *c = RTA_DATA(tb[TCA_IPT_CNT]);; + fprintf(f, " ref %d bind %d", c->refcnt, c->bindcnt); + } + if (show_stats) { + if (tb[TCA_IPT_TM]) { + struct tcf_t *tm = RTA_DATA(tb[TCA_IPT_TM]); + print_tm(f,tm); + } + } + fprintf(f, " \n"); + + } + + return 0; +} + +struct action_util ipt_action_util = { + .id = "ipt", + .parse_aopt = parse_ipt, + .print_aopt = print_ipt, +}; + --- /dev/null 2003-09-15 09:40:47.000000000 -0400 +++ /root/iproute2-2.6.9-041019-mod/include/linux/tc_act/tc_ipt.h 2004-10-24 14:48:06.000000000 -0400 @@ -0,0 +1,21 @@ +#ifndef __LINUX_TC_IPT_H +#define __LINUX_TC_IPT_H + +#include + +#define TCA_ACT_IPT 6 + +enum +{ + TCA_IPT_UNSPEC, + TCA_IPT_TABLE, + TCA_IPT_HOOK, + TCA_IPT_INDEX, + TCA_IPT_CNT, + TCA_IPT_TM, + TCA_IPT_TARG, + __TCA_IPT_MAX +}; +#define TCA_IPT_MAX (__TCA_IPT_MAX - 1) + +#endif --- /root/iproute2-2.6.9-041019/tc/Makefile 2004-10-19 16:49:02.000000000 -0400 +++ /root/iproute2-2.6.9-041019-mod/tc/Makefile 2004-10-24 21:49:33.000000000 -0400 @@ -3,6 +3,8 @@ include ../Config +IPT_INCL = /root/iptables-1.2.11/include + TCMODULES := TCMODULES += q_fifo.o TCMODULES += q_sfq.o @@ -29,6 +31,12 @@ TCLIB += tc_cbq.o TCLIB += tc_estimator.o +ifeq ($(TC_CONFIG_ACTION_IPT),y) +LDLIBS += -L. m_ipt.o -ltc -lm -ldl +else +LDLIBS += -L. -ltc -lm -ldl +endif + CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PROB @@ -52,10 +60,15 @@ ./$* >$@ rm $* -all: libtc.a tc $(TCSO) $(NETEM_DIST) +all: ipt libtc.a tc $(TCSO) $(NETEM_DIST) tc: $(TCOBJ) $(LIBNETLINK) $(LIBUTIL) $(TCLIB) +ipt: +ifeq ($(TC_CONFIG_ACTION_IPT),y) + $(CC) $(CCOPTS) -I$(KERNEL_INCLUDE) $(DEFINES) -I$(IPT_INCL) -I../include -c -o m_ipt.o m_ipt.c +#$(CC) $(CCOPTS) -I$(KERNEL_INCLUDE) -I../include $(DEFINES) -DCONFIG_NET_CLS_ACT -I$(IPT_INCL) -c -o m_ipt.o m_ipt.c +endif libtc.a: $(TCLIB) $(AR) rcs $@ $(TCLIB) --- /root/iproute2-2.6.9-041019/configure 2004-10-19 16:49:02.000000000 -0400 +++ /root/iproute2-2.6.9-041019-mod/configure 2004-10-24 14:40:01.000000000 -0400 @@ -26,12 +26,24 @@ fi rm -f /tmp/atmtest.c /tmp/atmtest -# hack for now +# hacks for now echo "TC actions" if [ -e "tc/m_gact.c" ] then + echo " GACT found" echo "TC_CONFIG_ACTION_GACT=y" >>Config echo "TC_CONFIG_ACTION_PROB=y" >>Config fi +if [ -e "tc/m_mirred.c" ] +then + echo " MIRRED found" + echo "TC_CONFIG_ACTION_MIRRED=y" >>Config +fi + +if [ -e "tc/m_ipt.c" ] +then + echo " IPT found" + echo "TC_CONFIG_ACTION_IPT=y" >>Config +fi --=-jsey1+L9qfIUO70ryExe-- From kaber@trash.net Thu Nov 4 08:24:58 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 08:25:02 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4GOvVx020240 for ; Thu, 4 Nov 2004 08:24:58 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPkPQ-0004aY-S6; Thu, 04 Nov 2004 17:24:24 +0100 Message-ID: <418A57B8.9040205@trash.net> Date: Thu, 04 Nov 2004 17:24:24 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@cyberus.ca CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 2.6 5/5]: act_api: mark some functions static/remove unused function References: <4189CB70.3060703@trash.net> <1099576602.1039.151.camel@jzny.localdomain> <418A4AA0.8070609@trash.net> <1099583639.1081.30.camel@jzny.localdomain> In-Reply-To: <1099583639.1081.30.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11439 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1720 Lines: 59 jamal wrote: >On Thu, 2004-11-04 at 10:28, Patrick McHardy wrote: > >>Ok, here is the same patch without removing tc_lookup_action_id. >>It is instead surrounded by #if 0. >> > > >Why is this function bothering you? ;-> >Why do you need to put the #if 0? > Because the compiler will warn about an unused static function. >>- move the functions from include/net/pkt_act.h to act_generic.c >> > >Some of the larger ones make sense to move. Whats the main reason for >moving them? > I was talking about the larger ones. There are multiple large inline functions that are used by all(?) actions. >These two make sense. I need help eyeballing the iptables stuff. >I commented out some of the refcount attempts; also i think quiet a >few targets are not friendly in getting accessed by anything other than >iptables; I was going at some point fix them and send you guys patches. >Maybe you can help me in this area as well. > > I can't think of a reason why targets would mind beeing used by ipt, but I'll look out for problems. >>Is there already userspace-code for anything besides gact ? >>I would like to test my changes. >> >> >> > >Stephen is probably stalled somewhere because he hasnt been sucking in >my updates to iproute2. >I have the latest and greatest on my test machine at home. But here >are tc updates for ipt and mirred that i could find on my laptop. > > Thanks. >The ipt patch needs iptables libraries and may not work with latest >iptables (although the one at home will surely work). The problem is >some of the iptables functions were updated. It would be nice if i didnt >have to maintain my own variants in user space. > > I can't see a way to avoid this currently. Regards Patrick From hadi@cyberus.ca Thu Nov 4 08:32:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 08:32:30 -0800 (PST) Received: from mx02.cybersurf.com (mx02.cybersurf.com [209.197.145.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4GWOvt021149 for ; Thu, 4 Nov 2004 08:32:25 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx02.cybersurf.com with esmtp (Exim 4.30) id 1CPkWr-0002wy-Gd for netdev@oss.sgi.com; Thu, 04 Nov 2004 11:32:05 -0500 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CPkWp-0005AV-Ku; Thu, 04 Nov 2004 11:32:03 -0500 Subject: Re: [PATCH 2.6 5/5]: act_api: mark some functions static/remove unused function From: jamal Reply-To: hadi@cyberus.ca To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <418A57B8.9040205@trash.net> References: <4189CB70.3060703@trash.net> <1099576602.1039.151.camel@jzny.localdomain> <418A4AA0.8070609@trash.net> <1099583639.1081.30.camel@jzny.localdomain> <418A57B8.9040205@trash.net> Content-Type: text/plain Organization: jamalopolous Message-Id: <1099585914.1081.53.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Nov 2004 11:31:54 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 11440 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: 1499 Lines: 55 On Thu, 2004-11-04 at 11:24, Patrick McHardy wrote: > >Why is this function bothering you? ;-> > >Why do you need to put the #if 0? > > > Because the compiler will warn about an unused static function. > fsck the compiler. Ok, fine if-0 it. I will unif-0 it when i submit code later on. > > > >Some of the larger ones make sense to move. Whats the main reason for > >moving them? > > > I was talking about the larger ones. There are multiple > large inline functions that are used by all(?) actions. > Sure go ahead. > > I can't think of a reason why targets would mind beeing used by ipt, > but I'll look out for problems. > Try a few targets; what i found is they were bugs in the targets code. Typically they wont check for something or other that i pass NULL to and just directly reference it. This could be both in kernel and user space. > >The ipt patch needs iptables libraries and may not work with latest > >iptables (although the one at home will surely work). The problem is > >some of the iptables functions were updated. It would be nice if i didnt > >have to maintain my own variants in user space. > > > > I can't see a way to avoid this currently. > I guess nobody has needed it before; take a look at the code i cutnpasted. See if some of that code could be made common and just referenced by me (since you guys maintain it). Thanks a lot for your help Patrick. cheers, jamal PS:- I am gonna disappear for a short while - so responses will have high latency. From hadi@znyx.com Thu Nov 4 08:35:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 08:35:15 -0800 (PST) Received: from lotus.znyx.com (znx208-2-156-007.znyx.com [208.2.156.7]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4GZBfZ021633 for ; Thu, 4 Nov 2004 08:35:12 -0800 Received: from [10.0.0.9] ([208.2.156.2]) by lotus.znyx.com (Lotus Domino Release 5.0.11) with ESMTP id 2004110408384675:7870 ; Thu, 4 Nov 2004 08:38:46 -0800 Subject: Re: [PATCH 2.6 5/5]: act_api: mark some functions static/remove unused function From: Jamal Hadi Salim Reply-To: hadi@znyx.com To: Patrick McHardy Cc: "David S. Miller" , netdev@oss.sgi.com In-Reply-To: <1099585914.1081.53.camel@jzny.localdomain> References: <4189CB70.3060703@trash.net> <1099576602.1039.151.camel@jzny.localdomain> <418A4AA0.8070609@trash.net> <1099583639.1081.30.camel@jzny.localdomain> <418A57B8.9040205@trash.net> <1099585914.1081.53.camel@jzny.localdomain> Organization: Znyx Networks Message-Id: <1099586091.1080.56.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 04 Nov 2004 11:34:51 -0500 X-MIMETrack: Itemize by SMTP Server on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 11/04/2004 08:38:47 AM, Serialize by Router on Lotus/Znyx(Release 5.0.11 |July 24, 2002) at 11/04/2004 08:38:48 AM, Serialize complete at 11/04/2004 08:38:48 AM Content-Transfer-Encoding: 7bit Content-Type: text/plain X-archive-position: 11441 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: hadi@znyx.com Precedence: bulk X-list: netdev Content-Length: 199 Lines: 9 BTW, at some point i would like to discuss an IMQ replacement which uses mirred and dummy device extension. I want these patches to settle down for a while first and getting tested. cheers, jamal From kaber@trash.net Thu Nov 4 08:51:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 08:51:15 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4GpBww023137 for ; Thu, 4 Nov 2004 08:51:11 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPkos-0004ee-6N; Thu, 04 Nov 2004 17:50:42 +0100 Message-ID: <418A5DE2.9010001@trash.net> Date: Thu, 04 Nov 2004 17:50:42 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: hadi@znyx.com CC: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH 2.6 5/5]: act_api: mark some functions static/remove unused function References: <4189CB70.3060703@trash.net> <1099576602.1039.151.camel@jzny.localdomain> <418A4AA0.8070609@trash.net> <1099583639.1081.30.camel@jzny.localdomain> <418A57B8.9040205@trash.net> <1099585914.1081.53.camel@jzny.localdomain> <1099586091.1080.56.camel@jzny.localdomain> In-Reply-To: <1099586091.1080.56.camel@jzny.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11442 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 358 Lines: 14 Jamal Hadi Salim wrote: >BTW, at some point i would like to discuss an IMQ replacement >which uses mirred and dummy device extension. >I want these patches to settle down for a while first and getting >tested. > > I'm not very familiar with the needs of the IMQ users these days, but I'm sure there will be lots of people with wishes :) Regards Patrick From shemminger@osdl.org Thu Nov 4 10:01:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 10:01:38 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4I1Vh4029018 for ; Thu, 4 Nov 2004 10:01:31 -0800 Received: from dxpl.pdx.osdl.net (dxpl.pdx.osdl.net [172.20.1.103]) by mail.osdl.org (8.11.6/8.11.6) with ESMTP id iA4I14921474; Thu, 4 Nov 2004 10:01:04 -0800 Date: Thu, 4 Nov 2004 10:01:04 -0800 From: Stephen Hemminger To: Michael Vittrup Larsen Cc: "David S. Miller" , netdev@oss.sgi.com Subject: Re: [PATCH] tcp: efficient port randomisation Message-Id: <20041104100104.570e67cd@dxpl.pdx.osdl.net> In-Reply-To: <200411020854.44745.michael.vittrup.larsen@ericsson.com> References: <20041027092531.78fe438c@guest-251-240.pdx.osdl.net> <200411011058.23141.michael.vittrup.larsen@ericsson.com> <20041101092027.2a741e82@zqx3.pdx.osdl.net> <200411020854.44745.michael.vittrup.larsen@ericsson.com> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; x86_64-suse-linux) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id iA4I1Vh4029018 X-archive-position: 11443 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: 3517 Lines: 71 On Tue, 2 Nov 2004 09:54:44 +0200 Michael Vittrup Larsen wrote: > On Monday 01 November 2004 18:20, Stephen Hemminger wrote: > > > * It is probably a good strategy to set 'tcp_rover_next' such that > > >   the next search is resumed from the previous port found to be free. > > >   (similar to the old algorithm).  I don't see this in your patch, > > >   but of course I could have missed it. > > > > It was intentional since it would require holding a lock around the search. > > The tradeoff is better SMP performance in the sparsely filled port space > > (more typical) vs. better UP performance in the case of a mostly full port > > space. > > I think a typical scenario is many short-lived (e.g. minutes) TCP connections, > few long-lived (e.g. hours) connections and an ephemeral port wrap-around > probably also in hours - at least a long time compared to the life-time of > the short-lived connections. But because of the hashing most ports will be scattered all over the port space, because they come from different hosts. > This would result in a closely spaced 'group' of ports being occupied > somewhere in the ephemeral port range, and 'tcp_rover_next' would point at > the uppermost extreme of this group and thus always guarantee a free port on > first try (collisions will only happen with long-lived connections). If you > don't update 'tcp_rover_next', and this somehow gets to lag behind this > 'group' of ports (say point at the lower extreme) you will need to search > through this group first before you enter the unoccupied port space. Also, Linux TCP will reuse ports if (saddr, daddr, sport) are different. Look at __tcp_v4_check_established. This means that the ports actually have to be in use with real connections to the same host. > Your scheme works initially because you do not lag behind the free port space, > but eventually you will, and I think this will result in less optimal > performance compared to the old behaviour. Free port space should be evenly distributed because of the hash function. > Since updating the 'tcp_rover_next' practically always result in a free port > on first try, I think SMP performance will not suffer even though the lock > was held all through the port search (except when the port space is very > crowded). But by not having a global lock on port allocation, different cpu's can be searching different hash trees. This would matter under Dos attack with multiple interfaces. > And yes, I do use Linux exclusively, so I do care :-)) > > >From a statistically point of view, if the connection life-times are uniformly > distributed from zero to infinite (theoretical scenario), it does not matter > what starting point you use. However, soon as life-times are not uniformly > distributed, this kind of search algorithm will benefit from good starting > point defining where the probability of used vs. unused port drop from high > to low. > > The BSD solution with a pure random rover suffers similarly, especially when > the port space becomes crowded. > > > > > * connect_port_offset() does not (at least from an algorithm point > > >   of view) need to return an u32, an u16 is sufficient. > > > > If it is truncated to u16, then compiler has to take extra effort to > > truncate is unnecessary given later  modulo operation. > > I agree (in fact thats what I argued in the draft) - it probably depends on > your platform - you are assuming a 32-bit platform I guess. From kaber@trash.net Thu Nov 4 10:16:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 10:16:22 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4IGHIY030620 for ; Thu, 4 Nov 2004 10:16:18 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPm9K-0004ry-I0; Thu, 04 Nov 2004 19:15:54 +0100 Message-ID: <418A71DA.2090607@trash.net> Date: Thu, 04 Nov 2004 19:15:54 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: Ulrich Weber CC: vpn-failover@lists.balabit.hu, netdev@oss.sgi.com, ipsec-tools-devel@lists.sourceforge.net Subject: Re: [Vpn-failover] [RFC] IPSEC failover - Netlink part References: <1099045435.2888.47.camel@nienna.balabit> <418A3630.1040900@astaro.de> In-Reply-To: <418A3630.1040900@astaro.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11444 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 3666 Lines: 137 Ulrich Weber wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi, > > I take the opportunity to post my code as well. At the moment I'm > working at > the same as Krisztian. My solutions however is for openswan, which uses > netlink instead of pfkey. > > Please find attached the appropriate netlink modifications to > include/linux/xfrm.h and net/xfrm/xfrm_users.c > > In theses patches, a new netlink group (XFRMGRP_REPLAY) is added to > notify > about seq number changes. Each notify message contains a xfrm_usersa_id > struct with the replay struct attached as rt attribute. In addition, > these > replay struct is also attached at ipsec sa dumps. > > Any comments are welcome :) Some minor bugs, see below. Regards Patrick >------------------------------------------------------------------------ > >--- linux.org/include/linux/xfrm.h. 2004-10-11 04:57:07.000000000 +0200 >+++ linux/include/linux/xfrm.h 2004-10-18 17:00:43.000000000 +0200 >@@ -140,6 +140,9 @@ > XFRM_MSG_FLUSHPOLICY, > #define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY > >+ XFRM_MSG_UPDSEQ, >+#define XFRM_MSG_UPDSEQ XFRM_MSG_UPDSEQ >+ > XFRM_MSG_MAX > }; > >@@ -171,6 +174,7 @@ > XFRMA_ALG_COMP, /* struct xfrm_algo */ > XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */ > XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ >+ XFRMA_REPLAY, /* struct xfrm_replay_state */ > __XFRMA_MAX > > #define XFRMA_MAX (__XFRMA_MAX - 1) >@@ -258,5 +258,6 @@ > > #define XFRMGRP_ACQUIRE 1 > #define XFRMGRP_EXPIRE 2 >+#define XFRMGRP_REPLAY 3 > > #endif /* _LINUX_XFRM_H */ > > >------------------------------------------------------------------------ > >--- linux.org/net/xfrm/xfrm_user.c 2004-10-18 23:54:32.000000000 +0200 >+++ linux/net/xfrm/xfrm_user.c 2004-10-21 16:27:59.000000000 +0200 >@@ -240,6 +240,12 @@ > if ((err = attach_encap_tmpl(&x->encap, xfrma[XFRMA_ENCAP-1]))) > goto error; > >+ if(xfrma[XFRMA_REPLAY-1]) { >+ struct xfrm_replay_state *replay; >+ replay = RTA_DATA(xfrma[XFRMA_REPLAY - 1]); >+ x->replay = *replay; >+ } >+ > err = -ENOENT; > x->type = xfrm_get_type(x->id.proto, x->props.family); > if (x->type == NULL) >@@ -368,6 +375,8 @@ > if (x->encap) > RTA_PUT(skb, XFRMA_ENCAP, sizeof(*x->encap), x->encap); > >+ RTA_PUT(skb, XFRMA_REPLAY, sizeof(x->replay), &x->replay); >+ > nlh->nlmsg_len = skb->tail - b; > out: > sp->this_idx++; >@@ -852,6 +861,27 @@ > return 0; > } > >+static int xfrm_update_seq(struct sk_buff *skb, struct nlmsghdr *nlh, void **xfrma) >+{ >+ struct xfrm_state *x; >+ struct xfrm_usersa_id *p = NLMSG_DATA(nlh); > > >+ struct xfrm_replay_state *replay; >+ >+ x = xfrm_state_lookup(&p->daddr, p->spi, p->proto, p->family); >+ if (x == NULL) { >+ printk(KERN_INFO "Found no xfrm state for sa seq update\n"); >+ return -ESRCH; >+ } >+ >+ if(xfrma[XFRMA_REPLAY-1]) { >+ replay = RTA_DATA(xfrma[XFRMA_REPLAY - 1]); >+ x->replay = *replay; > > >+ } >+ else return -EINVAL; > > ^^ leaks xfrm_state reference >+ >+ return 0; > > ^^ same here >+} >+ > static const int xfrm_msg_min[(XFRM_MSG_MAX + 1 - XFRM_MSG_BASE)] = { > NLMSG_LENGTH(sizeof(struct xfrm_usersa_info)), /* NEW SA */ > NLMSG_LENGTH(sizeof(struct xfrm_usersa_id)), /* DEL SA */ >@@ -867,6 +897,7 @@ > NLMSG_LENGTH(sizeof(struct xfrm_user_polexpire)), /* POLEXPIRE */ > NLMSG_LENGTH(sizeof(struct xfrm_usersa_flush)), /* FLUSH SA */ > NLMSG_LENGTH(0), /* FLUSH POLICY */ >+ NLMSG_LENGTH(sizeof(struct xfrm_usersa_id)),/* UPD SEQ */ > > ^^ what about struct xfrm_replay_state ? From romieu@fr.zoreil.com Thu Nov 4 10:47:49 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 10:47:52 -0800 (PST) Received: from fr.zoreil.com (electric-eye.fr.zoreil.com [213.41.134.224]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4Ill3t000607 for ; Thu, 4 Nov 2004 10:47:48 -0800 Received: from electric-eye.fr.zoreil.com (localhost.localdomain [127.0.0.1]) by fr.zoreil.com (8.12.10/8.12.1) with ESMTP id iA4Ijavr003034; Thu, 4 Nov 2004 19:45:36 +0100 Received: (from romieu@localhost) by electric-eye.fr.zoreil.com (8.12.10/8.12.10/Submit) id iA4IjTZ3003033; Thu, 4 Nov 2004 19:45:29 +0100 Date: Thu, 4 Nov 2004 19:45:29 +0100 From: Francois Romieu To: Jon Mason Cc: netdev@oss.sgi.com, jgarzik@pobox.com Subject: Re: [PATCH 2/3] r8169: Large Send enablement Message-ID: <20041104184529.GA2694@electric-eye.fr.zoreil.com> References: <200411021203.22003.jdmason@us.ibm.com> <20041102191103.GA24860@electric-eye.fr.zoreil.com> <200411031816.11675.jdmason@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200411031816.11675.jdmason@us.ibm.com> User-Agent: Mutt/1.4.1i X-Organisation: Land of Sunshine Inc. X-archive-position: 11445 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: 764 Lines: 17 Jon Mason : > On Tuesday 02 November 2004 01:11 pm, Francois Romieu wrote: > [...] > > - If rtl8169_open() fails [*] when the device was previously up, the driver > > could/should try to recover. > > I disagree. It should fail, complain loudly, and let the user try and fix it > (or return it to the previous state). The code provided below will act like Mmmm... Actually both patches try to paper over the real issue: the driver should reserve the ressources it needs for the change of mtu first. Ok, I'll take the patch provided I can't find anything badly racy in it and focus on the 8139C+/8169 merge. It has already been delayed for too long and it seems the right place to fix the aforementionned issue with style :o) -- Ueimor From kaber@trash.net Thu Nov 4 15:25:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 15:25:58 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4NPrJx027282 for ; Thu, 4 Nov 2004 15:25:53 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPqyy-0006Yt-68; Fri, 05 Nov 2004 00:25:32 +0100 Message-ID: <418ABA6C.8060402@trash.net> Date: Fri, 05 Nov 2004 00:25:32 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com, jamal Subject: [PATCH 2.6 4/4]: ipt: convert jiffie values to USER_HZ when dumping Content-Type: multipart/mixed; boundary="------------050509080902080304040906" X-archive-position: 11449 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1542 Lines: 48 This is a multi-part message in MIME format. --------------050509080902080304040906 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Convert jiffie values to USER_HZ in ipt action. --------------050509080902080304040906 Content-Type: text/x-patch; name="4.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="4.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/05 00:17:18+01:00 kaber@coreworks.de # [PKT_SCHED]: ipt: convert jiffie values to USER_HZ when dumping # # Signed-off-by: Patrick McHardy # # net/sched/ipt.c # 2004/11/05 00:17:10+01:00 kaber@coreworks.de +3 -3 # [PKT_SCHED]: ipt: convert jiffie values to USER_HZ when dumping # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/ipt.c b/net/sched/ipt.c --- a/net/sched/ipt.c 2004-11-05 00:19:01 +01:00 +++ b/net/sched/ipt.c 2004-11-05 00:19:01 +01:00 @@ -334,9 +334,9 @@ RTA_PUT(skb, TCA_IPT_HOOK, 4, &p->hook); RTA_PUT(skb, TCA_IPT_CNT, sizeof(struct tc_cnt), &c); RTA_PUT(skb, TCA_IPT_TABLE, IFNAMSIZ, p->tname); - tm.install = jiffies - p->tm.install; - tm.lastuse = jiffies - p->tm.lastuse; - tm.expires = p->tm.expires; + tm.install = jiffies_to_clock_t(jiffies - p->tm.install); + tm.lastuse = jiffies_to_clock_t(jiffies - p->tm.lastuse); + tm.expires = jiffies_to_clock_t(p->tm.expires); RTA_PUT(skb, TCA_IPT_TM, sizeof (tm), &tm); return skb->len; --------------050509080902080304040906-- From kaber@trash.net Thu Nov 4 15:25:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 15:25:44 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4NPcIq027243 for ; Thu, 4 Nov 2004 15:25:38 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPqyg-0006YV-OH; Fri, 05 Nov 2004 00:25:14 +0100 Message-ID: <418ABA5A.70800@trash.net> Date: Fri, 05 Nov 2004 00:25:14 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com, jamal Subject: [PATCH 2.6 1/4]: pedit: convert jiffie values to USER_HZ when dumping Content-Type: multipart/mixed; boundary="------------020803060501050404010200" X-archive-position: 11446 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1453 Lines: 48 This is a multi-part message in MIME format. --------------020803060501050404010200 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Convert jiffie values to USER_HZ in pedit action. --------------020803060501050404010200 Content-Type: text/x-patch; name="1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="1.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/04 20:18:34+01:00 kaber@coreworks.de # [PKT_SCHED]: pedit: convert jiffie values to USER_HZ when dumping # # Signed-off-by: Patrick McHardy # # net/sched/pedit.c # 2004/11/04 20:18:27+01:00 kaber@coreworks.de +3 -3 # [PKT_SCHED]: pedit: convert jiffie values to USER_HZ when dumping # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/pedit.c b/net/sched/pedit.c --- a/net/sched/pedit.c 2004-11-05 00:18:46 +01:00 +++ b/net/sched/pedit.c 2004-11-05 00:18:46 +01:00 @@ -244,9 +244,9 @@ #endif RTA_PUT(skb, TCA_PEDIT_PARMS, s, opt); - t.install = jiffies - p->tm.install; - t.lastuse = jiffies - p->tm.lastuse; - t.expires = p->tm.expires; + t.install = jiffies_to_clock_t(jiffies - p->tm.install); + t.lastuse = jiffies_to_clock_t(jiffies - p->tm.lastuse); + t.expires = jiffies_to_clock_t(p->tm.expires); RTA_PUT(skb, TCA_PEDIT_TM, sizeof (t), &t); return skb->len; --------------020803060501050404010200-- From kaber@trash.net Thu Nov 4 15:25:47 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 15:25:51 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4NPlrx027260 for ; Thu, 4 Nov 2004 15:25:47 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPqyr-0006Yi-Kw; Fri, 05 Nov 2004 00:25:25 +0100 Message-ID: <418ABA65.3090601@trash.net> Date: Fri, 05 Nov 2004 00:25:25 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com, jamal Subject: [PATCH 2.6 2/4]: mirred: convert jiffie values to USER_HZ when dumping Content-Type: multipart/mixed; boundary="------------050909090204030802000404" X-archive-position: 11447 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1607 Lines: 48 This is a multi-part message in MIME format. --------------050909090204030802000404 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Convert jiffie values to USER_HZ in mirred action. --------------050909090204030802000404 Content-Type: text/x-patch; name="2.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="2.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/04 20:21:35+01:00 kaber@coreworks.de # [PKT_SCHED]: mirred: convert jiffie values to USER_HZ when dumping # # Signed-off-by: Patrick McHardy # # net/sched/mirred.c # 2004/11/04 20:21:29+01:00 kaber@coreworks.de +3 -3 # [PKT_SCHED]: mirred: convert jiffie values to USER_HZ when dumping # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/mirred.c b/net/sched/mirred.c --- a/net/sched/mirred.c 2004-11-05 00:18:51 +01:00 +++ b/net/sched/mirred.c 2004-11-05 00:18:51 +01:00 @@ -257,9 +257,9 @@ opt.ifindex = p->ifindex; DPRINTK(" tcf_mirred_dump index %d action %d eaction %d ifndex %d\n",p->index,p->action,p->eaction,p->ifindex); RTA_PUT(skb, TCA_MIRRED_PARMS, sizeof (opt), &opt); - t.install = jiffies - p->tm.install; - t.lastuse = jiffies - p->tm.lastuse; - t.expires = p->tm.expires; + t.install = jiffies_to_clock_t(jiffies - p->tm.install); + t.lastuse = jiffies_to_clock_t(jiffies - p->tm.lastuse); + t.expires = jiffies_to_clock_t(p->tm.expires); RTA_PUT(skb, TCA_MIRRED_TM, sizeof (t), &t); return skb->len; --------------050909090204030802000404-- From kaber@trash.net Thu Nov 4 15:25:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 15:25:54 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA4NPnvX027264 for ; Thu, 4 Nov 2004 15:25:50 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CPqyu-0006Yn-Mv; Fri, 05 Nov 2004 00:25:28 +0100 Message-ID: <418ABA68.4040100@trash.net> Date: Fri, 05 Nov 2004 00:25:28 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com, jamal Subject: [PATCH 2.6 3/4]: gact: convert jiffie values to USER_HZ when dumping Content-Type: multipart/mixed; boundary="------------010902060007020400060401" X-archive-position: 11448 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1462 Lines: 48 This is a multi-part message in MIME format. --------------010902060007020400060401 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Convert jiffie values to USER_HZ in gact action. --------------010902060007020400060401 Content-Type: text/x-patch; name="3.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="3.diff" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/04 20:22:38+01:00 kaber@coreworks.de # [PKT_SCHED]: gact: convert jiffie values to USER_HZ when dumping # # Signed-off-by: Patrick McHardy # # net/sched/gact.c # 2004/11/04 20:22:32+01:00 kaber@coreworks.de +3 -3 # [PKT_SCHED]: gact: convert jiffie values to USER_HZ when dumping # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/gact.c b/net/sched/gact.c --- a/net/sched/gact.c 2004-11-05 00:18:57 +01:00 +++ b/net/sched/gact.c 2004-11-05 00:18:57 +01:00 @@ -203,9 +203,9 @@ RTA_PUT(skb, TCA_GACT_PROB, sizeof (p_opt), &p_opt); } #endif - t.install = jiffies - p->tm.install; - t.lastuse = jiffies - p->tm.lastuse; - t.expires = p->tm.expires; + t.install = jiffies_to_clock_t(jiffies - p->tm.install); + t.lastuse = jiffies_to_clock_t(jiffies - p->tm.lastuse); + t.expires = jiffies_to_clock_t(p->tm.expires); RTA_PUT(skb, TCA_GACT_TM, sizeof (t), &t); return skb->len; --------------010902060007020400060401-- From jgarzik@pobox.com Thu Nov 4 18:18:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 18:18:41 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA52IXfi006547 for ; Thu, 4 Nov 2004 18:18:34 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CPtg6-0001M0-N8; Fri, 05 Nov 2004 02:18:15 +0000 Message-ID: <418AE27D.6060609@pobox.com> Date: Thu, 04 Nov 2004 21:16:29 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-2022-JP?B?WU9TSElGVUpJIEhpZGVha2kgLyAbJEI1SEYjMVFMQBsoQg==?= CC: davem@davemloft.net, linux-kernel@vger.kernel.org, netdev@oss.sgi.com, akpm@osdl.org Subject: Re: IPv6 dead in -bk11 References: <20041102.225343.06193184.yoshfuji@linux-ipv6.org> <4187A4E3.8010600@pobox.com> <20041103.012923.102810732.yoshfuji@linux-ipv6.org> <20041104.012128.51410945.yoshfuji@linux-ipv6.org> In-Reply-To: <20041104.012128.51410945.yoshfuji@linux-ipv6.org> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-archive-position: 11450 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: 387 Lines: 19 YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > Sorry, this bug was introduced by my changeset: > . > > David, this should fix the issue. > Please apply. > > D: Don't purge default routes by RA. > D: > D: Signed-off-by: Hideaki YOSHIFUJI ACK. This fixed my problem. Thanks! Jeff From jdmason@us.ibm.com Thu Nov 4 21:51:41 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 21:51:46 -0800 (PST) Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.129]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA55pYZR015107 for ; Thu, 4 Nov 2004 21:51:41 -0800 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id iA55pBLv229882 for ; Fri, 5 Nov 2004 00:51:11 -0500 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id iA55pB1D268252 for ; Thu, 4 Nov 2004 22:51:11 -0700 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA55pBEr031447 for ; Thu, 4 Nov 2004 22:51:11 -0700 Received: from sig-9-65-22-92.mts.ibm.com (sig-9-65-22-92.mts.ibm.com [9.65.22.92]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id iA55pBOO031439; Thu, 4 Nov 2004 22:51:11 -0700 From: Jon Mason Organization: IBM To: Francois Romieu Subject: Re: [PATCH 2/3] r8169: Large Send enablement Date: Fri, 5 Nov 2004 05:50:33 +0000 User-Agent: KMail/1.7 Cc: netdev@oss.sgi.com, jgarzik@pobox.com References: <200411021203.22003.jdmason@us.ibm.com> <200411031816.11675.jdmason@us.ibm.com> <20041104184529.GA2694@electric-eye.fr.zoreil.com> In-Reply-To: <20041104184529.GA2694@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: <200411050550.33521.jdmason@us.ibm.com> X-archive-position: 11451 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jdmason@us.ibm.com Precedence: bulk X-list: netdev Content-Length: 808 Lines: 18 On Thursday 04 November 2004 06:45 pm, Francois Romieu wrote: > Jon Mason : > > On Tuesday 02 November 2004 01:11 pm, Francois Romieu wrote: > > [...] > > > > > - If rtl8169_open() fails [*] when the device was previously up, the > > > driver could/should try to recover. > > > > I disagree. It should fail, complain loudly, and let the user try and > > fix it (or return it to the previous state). The code provided below > > will act like > > Mmmm... Actually both patches try to paper over the real issue: the driver > should reserve the resources it needs for the change of mtu first. Agreed. I did a quick look in the other drivers, and didn't find any drivers that handle this possibility. Most of them ignore the fact. This sounds like an open hole in all of the drivers. From davem@davemloft.net Thu Nov 4 22:29:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 22:29:32 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA56TOWu016359 for ; Thu, 4 Nov 2004 22:29:25 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CPxQ9-0004zi-00; Thu, 04 Nov 2004 22:18:01 -0800 Date: Thu, 4 Nov 2004 22:18:01 -0800 From: "David S. Miller" To: hadi@cyberus.ca Cc: buytenh@wantstofly.org, yoshfuji@linux-ipv6.org, jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: BUG: dst underflow (again) Message-Id: <20041104221801.584c8f11.davem@davemloft.net> In-Reply-To: <1099577717.1039.155.camel@jzny.localdomain> References: <4178AB0D.6060107@pobox.com> <20041022.155159.98771450.yoshfuji@linux-ipv6.org> <20041022075947.GA15795@xi.wantstofly.org> <1099577717.1039.155.camel@jzny.localdomain> X-Mailer: Sylpheed version 0.9.99 (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: 11452 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 1351 Lines: 36 On 04 Nov 2004 09:15:17 -0500 jamal wrote: > Could you turn off netfilter and see if this continues to happen? That's one possible angle, but let's look at the tracepoints more closely. BTW Lennert, the decoded addresses are extremely helpful. Thanks. Jeff, could you similarly decode the ones that you seem to get? That would be an incredibly useful datapoint. If you've provided this already, my bad and please point me at where you posted that. > > BUG: dst underflow -1: 3bcf9a80 at 42350024 > > BUG: dst underflow 0: 3bcf9a80 at 423486d2 > > BUG: dst underflow 0: 3bcf9a80 at 4235823d ... > > 0x42350024 - 0x42345000 = 0xb024, corresponds to: > > 0000affa > > > > 0x423486d2 - 0x42345000 = 0x36d2, corresponds to: > > 0000339d > > > > 0x4235823d - 0x42345000 = 0x1323d, corresponds to: > > 00012c0d (god, that's one big function btw) The last one is the most interesting. The only dst_release() call that occurs in udpv6_sendmsg() is when xfrm_lookup() returns an error. The semantics of that function are a complete mess (when it errors, it sometimes releases the DST, sometimes does not) and I'll fix that up. But let me ask, do you have any IPSEC policies in the kernel when these BUGs trigger? If so, I'm pretty sure I know what the problem may be. From yoshfuji@linux-ipv6.org Thu Nov 4 22:53:20 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 22:53:24 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA56rI4q017188 for ; Thu, 4 Nov 2004 22:53:20 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 1D8FC33CE5; Fri, 5 Nov 2004 15:53:57 +0900 (JST) Date: Fri, 05 Nov 2004 15:53:55 +0900 (JST) Message-Id: <20041105.155355.110780816.yoshfuji@linux-ipv6.org> To: davem@davemloft.net Cc: hadi@cyberus.ca, buytenh@wantstofly.org, jgarzik@pobox.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: BUG: dst underflow (again) From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20041104221801.584c8f11.davem@davemloft.net> References: <20041022075947.GA15795@xi.wantstofly.org> <1099577717.1039.155.camel@jzny.localdomain> <20041104221801.584c8f11.davem@davemloft.net> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 11453 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 1615 Lines: 50 In article <20041104221801.584c8f11.davem@davemloft.net> (at Thu, 4 Nov 2004 22:18:01 -0800), "David S. Miller" says: > > > 00012c0d (god, that's one big function btw) > > The last one is the most interesting. The only dst_release() call > that occurs in udpv6_sendmsg() is when xfrm_lookup() returns > an error. The semantics of that function are a complete mess > (when it errors, it sometimes releases the DST, sometimes does not) > and I'll fix that up. Oh,yes, something like this? Signed-off-by: Hideaki YOSHIFUJI ===== net/ipv6/udp.c 1.76 vs edited ===== --- 1.76/net/ipv6/udp.c 2004-10-26 11:47:26 +09:00 +++ edited/net/ipv6/udp.c 2004-11-05 15:42:00 +09:00 @@ -631,7 +631,7 @@ struct ipv6_txoptions *opt = NULL; struct ip6_flowlabel *flowlabel = NULL; struct flowi *fl = &inet->cork.fl; - struct dst_entry *dst; + struct dst_entry *dst = NULL; int addr_len = msg->msg_namelen; int ulen = len; int hlimit = -1; @@ -797,10 +797,8 @@ if (final_p) ipv6_addr_copy(&fl->fl6_dst, final_p); - if ((err = xfrm_lookup(&dst, fl, sk, 0)) < 0) { - dst_release(dst); + if ((err = xfrm_lookup(&dst, fl, sk, 0)) < 0) goto out; - } if (hlimit < 0) { if (ipv6_addr_is_multicast(&fl->fl6_dst)) @@ -846,6 +844,7 @@ err = np->recverr ? net_xmit_errno(err) : 0; release_sock(sk); out: + dst_release(dst); fl6_sock_release(flowlabel); if (!err) { UDP6_INC_STATS_USER(UDP_MIB_OUTDATAGRAMS); -- Hideaki YOSHIFUJI @ USAGI Project GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA From jgarzik@pobox.com Thu Nov 4 23:06:16 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 23:06:21 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA576Fcg017888 for ; Thu, 4 Nov 2004 23:06:16 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CPyAV-0005oX-FO; Fri, 05 Nov 2004 07:05:55 +0000 Message-ID: <418B2645.6080404@pobox.com> Date: Fri, 05 Nov 2004 02:05:41 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" , hadi@cyberus.ca CC: buytenh@wantstofly.org, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: BUG: dst underflow (again) References: <4178AB0D.6060107@pobox.com> <20041022.155159.98771450.yoshfuji@linux-ipv6.org> <20041022075947.GA15795@xi.wantstofly.org> <1099577717.1039.155.camel@jzny.localdomain> <20041104221801.584c8f11.davem@davemloft.net> In-Reply-To: <20041104221801.584c8f11.davem@davemloft.net> Content-Type: multipart/mixed; boundary="------------060008080907010202080502" X-archive-position: 11454 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: 4961 Lines: 194 This is a multi-part message in MIME format. --------------060008080907010202080502 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit David S. Miller wrote: > Jeff, could you similarly decode the ones that you seem to get? > That would be an incredibly useful datapoint. If you've provided > this already, my bad and please point me at where you posted that. I've compiled IPv6 into my router's kernel image, so next time I reboot, I should be able to get at symbol info out of the BUGs a bit more easily. > But let me ask, do you have any IPSEC policies in the kernel > when these BUGs trigger? If so, I'm pretty sure I know what > the problem may be. I know this question wasn't directed at me, but, I do always compile ipsec stuff into my kernel, in addition to netfilter. The relevant options are attached for the curious. Jeff P.S. Jamal-- I cannot disable netfilter for a period of time long enough to cause the BUGs to be produced, since that disables my NAT'ing. --------------060008080907010202080502 Content-Type: text/plain; name="config.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="config.txt" # CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set CONFIG_NETLINK_DEV=y CONFIG_UNIX=y CONFIG_NET_KEY=y CONFIG_INET=y CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set CONFIG_NET_IPIP=m CONFIG_NET_IPGRE=m # CONFIG_NET_IPGRE_BROADCAST is not set # CONFIG_IP_MROUTE is not set # CONFIG_ARPD is not set # CONFIG_SYN_COOKIES is not set CONFIG_INET_AH=y CONFIG_INET_ESP=y CONFIG_INET_IPCOMP=y CONFIG_INET_TUNNEL=y # # IP: Virtual Server Configuration # # CONFIG_IP_VS is not set CONFIG_IPV6=m CONFIG_IPV6_PRIVACY=y CONFIG_INET6_AH=m CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set # # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m # CONFIG_IP_NF_CT_ACCT is not set # CONFIG_IP_NF_CONNTRACK_MARK is not set # CONFIG_IP_NF_CT_PROTO_SCTP is not set CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m CONFIG_IP_NF_TFTP=m CONFIG_IP_NF_AMANDA=m CONFIG_IP_NF_QUEUE=m CONFIG_IP_NF_IPTABLES=m CONFIG_IP_NF_MATCH_LIMIT=m CONFIG_IP_NF_MATCH_IPRANGE=m CONFIG_IP_NF_MATCH_MAC=m CONFIG_IP_NF_MATCH_PKTTYPE=m CONFIG_IP_NF_MATCH_MARK=m CONFIG_IP_NF_MATCH_MULTIPORT=m CONFIG_IP_NF_MATCH_TOS=m CONFIG_IP_NF_MATCH_RECENT=m CONFIG_IP_NF_MATCH_ECN=m CONFIG_IP_NF_MATCH_DSCP=m CONFIG_IP_NF_MATCH_AH_ESP=m CONFIG_IP_NF_MATCH_LENGTH=m CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_MATCH_TCPMSS=m CONFIG_IP_NF_MATCH_HELPER=m CONFIG_IP_NF_MATCH_STATE=m CONFIG_IP_NF_MATCH_CONNTRACK=m CONFIG_IP_NF_MATCH_OWNER=m CONFIG_IP_NF_MATCH_ADDRTYPE=m CONFIG_IP_NF_MATCH_REALM=m # CONFIG_IP_NF_MATCH_SCTP is not set CONFIG_IP_NF_MATCH_COMMENT=m CONFIG_IP_NF_MATCH_HASHLIMIT=m CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_TARGET_LOG=m CONFIG_IP_NF_TARGET_ULOG=m CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m # CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m CONFIG_IP_NF_NAT_TFTP=m CONFIG_IP_NF_NAT_AMANDA=m CONFIG_IP_NF_MANGLE=m CONFIG_IP_NF_TARGET_TOS=m CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_MARK=m CONFIG_IP_NF_TARGET_CLASSIFY=m CONFIG_IP_NF_RAW=m # CONFIG_IP_NF_TARGET_NOTRACK is not set CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_ARP_MANGLE=m # CONFIG_IP_NF_COMPAT_IPCHAINS is not set # CONFIG_IP_NF_COMPAT_IPFWADM is not set # # IPv6: Netfilter Configuration # CONFIG_IP6_NF_QUEUE=m CONFIG_IP6_NF_IPTABLES=m CONFIG_IP6_NF_MATCH_LIMIT=m CONFIG_IP6_NF_MATCH_MAC=m CONFIG_IP6_NF_MATCH_RT=m CONFIG_IP6_NF_MATCH_OPTS=m CONFIG_IP6_NF_MATCH_FRAG=m CONFIG_IP6_NF_MATCH_HL=m CONFIG_IP6_NF_MATCH_MULTIPORT=m CONFIG_IP6_NF_MATCH_OWNER=m CONFIG_IP6_NF_MATCH_MARK=m CONFIG_IP6_NF_MATCH_IPV6HEADER=m CONFIG_IP6_NF_MATCH_AHESP=m CONFIG_IP6_NF_MATCH_LENGTH=m CONFIG_IP6_NF_MATCH_EUI64=m CONFIG_IP6_NF_FILTER=m CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_TARGET_MARK=m CONFIG_IP6_NF_RAW=m CONFIG_XFRM=y CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) # CONFIG_IP_SCTP=m # CONFIG_SCTP_DBG_MSG is not set # CONFIG_SCTP_DBG_OBJCNT is not set # CONFIG_SCTP_HMAC_NONE is not set CONFIG_SCTP_HMAC_SHA1=y # CONFIG_SCTP_HMAC_MD5 is not set # CONFIG_ATM is not set # CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set # CONFIG_DECNET is not set CONFIG_LLC=y CONFIG_LLC2=y # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set CONFIG_NET_CLS_ROUTE=y --------------060008080907010202080502-- From davem@davemloft.net Thu Nov 4 23:25:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 23:25:59 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA57PpHJ018726 for ; Thu, 4 Nov 2004 23:25:52 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CPyIr-00057R-00; Thu, 04 Nov 2004 23:14:33 -0800 Date: Thu, 4 Nov 2004 23:14:33 -0800 From: "David S. Miller" To: Jeff Garzik Cc: hadi@cyberus.ca, buytenh@wantstofly.org, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: BUG: dst underflow (again) Message-Id: <20041104231433.3a7233e8.davem@davemloft.net> In-Reply-To: <418B2645.6080404@pobox.com> References: <4178AB0D.6060107@pobox.com> <20041022.155159.98771450.yoshfuji@linux-ipv6.org> <20041022075947.GA15795@xi.wantstofly.org> <1099577717.1039.155.camel@jzny.localdomain> <20041104221801.584c8f11.davem@davemloft.net> <418B2645.6080404@pobox.com> X-Mailer: Sylpheed version 0.9.99 (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: 11455 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 1043 Lines: 26 On Fri, 05 Nov 2004 02:05:41 -0500 Jeff Garzik wrote: > David S. Miller wrote: > > Jeff, could you similarly decode the ones that you seem to get? > > That would be an incredibly useful datapoint. If you've provided > > this already, my bad and please point me at where you posted that. > > I've compiled IPv6 into my router's kernel image, so next time I reboot, > I should be able to get at symbol info out of the BUGs a bit more easily. Thanks a lot. > > But let me ask, do you have any IPSEC policies in the kernel > > when these BUGs trigger? If so, I'm pretty sure I know what > > the problem may be. > > I know this question wasn't directed at me, but, I do always compile > ipsec stuff into my kernel, in addition to netfilter. The relevant > options are attached for the curious. Yes, but do you actually install any IPSEC rules into your system? The only way xfrm_lookup() can ever fall (and call that BUG'ing dst_release() in udpv6_sendmsg()) is if you have at least some IPSEC policies configured. From davem@davemloft.net Thu Nov 4 23:27:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 23:27:35 -0800 (PST) Received: from cheetah.davemloft.net (mail@adsl-63-197-226-105.dsl.snfc21.pacbell.net [63.197.226.105]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA57RU0b019036 for ; Thu, 4 Nov 2004 23:27:31 -0800 Received: from localhost ([127.0.0.1] helo=cheetah.davemloft.net ident=davem) by cheetah.davemloft.net with smtp (Exim 3.36 #1 (Debian)) id 1CPyKY-00059N-00; Thu, 04 Nov 2004 23:16:18 -0800 Date: Thu, 4 Nov 2004 23:16:18 -0800 From: "David S. Miller" To: yoshfuji@linux-ipv6.org Cc: hadi@cyberus.ca, buytenh@wantstofly.org, jgarzik@pobox.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: BUG: dst underflow (again) Message-Id: <20041104231618.1d584a6f.davem@davemloft.net> In-Reply-To: <20041105.155355.110780816.yoshfuji@linux-ipv6.org> References: <20041022075947.GA15795@xi.wantstofly.org> <1099577717.1039.155.camel@jzny.localdomain> <20041104221801.584c8f11.davem@davemloft.net> <20041105.155355.110780816.yoshfuji@linux-ipv6.org> X-Mailer: Sylpheed version 0.9.99 (GTK+ 1.2.10; sparc-unknown-linux-gnu) X-Face: "_;p5u5aPsO,_Vsx"^v-pEq09'CU4&Dc1$fQExov$62l60cgCc%FnIwD=.UF^a>?5'9Kn[;433QFVV9M..2eN.@4ZWPGbdi<=?[:T>y?SD(R*-3It"Vj:)"dP Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id iA57RU0b019036 X-archive-position: 11456 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: davem@davemloft.net Precedence: bulk X-list: netdev Content-Length: 6707 Lines: 267 On Fri, 05 Nov 2004 15:53:55 +0900 (JST) YOSHIFUJI Hideaki / $B5HF#1QL@(B wrote: > In article <20041104221801.584c8f11.davem@davemloft.net> (at Thu, 4 Nov 2004 22:18:01 -0800), "David S. Miller" says: > > > > > 00012c0d (god, that's one big function btw) > > > > The last one is the most interesting. The only dst_release() call > > that occurs in udpv6_sendmsg() is when xfrm_lookup() returns > > an error. The semantics of that function are a complete mess > > (when it errors, it sometimes releases the DST, sometimes does not) > > and I'll fix that up. > > Oh,yes, something like this? Something, but not quite. :-) This change you propose adds a leak, you have to modify xfrm_lookup() as well. I'm mid-way through such changes, but it looks something like this (BTW, note the addrconf.c leak I noticed today as well): ===== net/ipv6/addrconf.c 1.115 vs edited ===== --- 1.115/net/ipv6/addrconf.c 2004-10-25 21:11:35 -07:00 +++ edited/net/ipv6/addrconf.c 2004-11-04 13:10:26 -08:00 @@ -509,6 +509,7 @@ rt = addrconf_dst_alloc(idev, addr, 0); if (IS_ERR(rt)) { err = PTR_ERR(rt); + rt = NULL; goto out; } @@ -572,6 +573,8 @@ if (unlikely(err == 0)) notifier_call_chain(&inet6addr_chain, NETDEV_UP, ifa); else { + if (rt) + dst_free(&rt->u.dst); kfree(ifa); ifa = ERR_PTR(err); } ===== net/ipv6/datagram.c 1.19 vs edited ===== --- 1.19/net/ipv6/datagram.c 2004-08-27 09:35:00 -07:00 +++ edited/net/ipv6/datagram.c 2004-11-04 16:43:24 -08:00 @@ -174,10 +174,8 @@ if (final_p) ipv6_addr_copy(&fl.fl6_dst, final_p); - if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { - dst_release(dst); + if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) goto out; - } /* source address lookup done in ip6_dst_lookup */ ===== net/ipv6/icmp.c 1.59 vs edited ===== --- 1.59/net/ipv6/icmp.c 2004-09-14 22:32:09 -07:00 +++ edited/net/ipv6/icmp.c 2004-11-04 16:44:01 -08:00 @@ -373,7 +373,7 @@ if (err) goto out; if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) - goto out_dst_release; + goto out; if (hlimit < 0) { if (ipv6_addr_is_multicast(&fl.fl6_dst)) @@ -461,7 +461,7 @@ if (err) goto out; if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) - goto out_dst_release; + goto out; if (hlimit < 0) { if (ipv6_addr_is_multicast(&fl.fl6_dst)) ===== net/ipv6/ip6_tunnel.c 1.25 vs edited ===== --- 1.25/net/ipv6/ip6_tunnel.c 2004-09-13 13:03:39 -07:00 +++ edited/net/ipv6/ip6_tunnel.c 2004-11-04 16:49:24 -08:00 @@ -759,9 +759,14 @@ t->recursion--; return 0; + tx_err_link_failure: stats->tx_carrier_errors++; dst_link_failure(skb); + if (opt) + kfree(opt); + goto tx_err; + tx_err_dst_release: dst_release(dst); if (opt) ===== net/ipv6/ndisc.c 1.104 vs edited ===== --- 1.104/net/ipv6/ndisc.c 2004-11-03 11:56:07 -08:00 +++ edited/net/ipv6/ndisc.c 2004-11-04 16:49:48 -08:00 @@ -408,10 +408,8 @@ return; err = xfrm_lookup(&dst, &fl, NULL, 0); - if (err < 0) { - dst_release(dst); + if (err < 0) return; - } if (inc_opt) { if (dev->addr_len) @@ -499,10 +497,8 @@ return; err = xfrm_lookup(&dst, &fl, NULL, 0); - if (err < 0) { - dst_release(dst); + if (err < 0) return; - } len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr); send_llinfo = dev->addr_len && !ipv6_addr_any(saddr); @@ -575,10 +571,8 @@ return; err = xfrm_lookup(&dst, &fl, NULL, 0); - if (err < 0) { - dst_release(dst); + if (err < 0) return; - } len = sizeof(struct icmp6hdr); if (dev->addr_len) @@ -1302,10 +1296,8 @@ dst = &rt->u.dst; err = xfrm_lookup(&dst, &fl, NULL, 0); - if (err) { - dst_release(dst); + if (err) return; - } rt = (struct rt6_info *) dst; ===== net/ipv6/raw.c 1.73 vs edited ===== --- 1.73/net/ipv6/raw.c 2004-10-25 19:47:26 -07:00 +++ edited/net/ipv6/raw.c 2004-11-04 16:50:05 -08:00 @@ -743,10 +743,8 @@ if (final_p) ipv6_addr_copy(&fl.fl6_dst, final_p); - if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { - dst_release(dst); + if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) goto out; - } if (hlimit < 0) { if (ipv6_addr_is_multicast(&fl.fl6_dst)) ===== net/ipv6/tcp_ipv6.c 1.100 vs edited ===== --- 1.100/net/ipv6/tcp_ipv6.c 2004-11-01 16:48:28 -08:00 +++ edited/net/ipv6/tcp_ipv6.c 2004-11-04 16:52:43 -08:00 @@ -680,10 +680,8 @@ if (final_p) ipv6_addr_copy(&fl.fl6_dst, final_p); - if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { - dst_release(dst); + if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) goto failure; - } if (saddr == NULL) { saddr = &fl.fl6_src; @@ -1047,10 +1045,8 @@ /* sk = NULL, but it is safe for now. RST socket required. */ if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) { - if ((xfrm_lookup(&buff->dst, &fl, NULL, 0)) < 0) { - dst_release(buff->dst); + if ((xfrm_lookup(&buff->dst, &fl, NULL, 0)) < 0) return; - } ip6_xmit(NULL, buff, &fl, NULL, 0); TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); @@ -1114,10 +1110,9 @@ fl.fl_ip_sport = t1->source; if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) { - if ((xfrm_lookup(&buff->dst, &fl, NULL, 0)) < 0) { - dst_release(buff->dst); + if ((xfrm_lookup(&buff->dst, &fl, NULL, 0)) < 0) return; - } + ip6_xmit(NULL, buff, &fl, NULL, 0); TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); return; @@ -1378,7 +1373,7 @@ newsk = tcp_create_openreq_child(sk, req, skb); if (newsk == NULL) - goto out; + goto out_release; /* Charge newly allocated IPv6 socket */ #ifdef INET_REFCNT_DEBUG @@ -1457,11 +1452,12 @@ out_overflow: NET_INC_STATS_BH(LINUX_MIB_LISTENOVERFLOWS); +out_release: + dst_release(dst); out: NET_INC_STATS_BH(LINUX_MIB_LISTENDROPS); if (opt && opt != np->opt) sock_kfree_s(sk, opt, opt->tot_len); - dst_release(dst); return NULL; } @@ -1784,7 +1780,6 @@ if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { sk->sk_err_soft = -err; - dst_release(dst); return err; } @@ -1838,7 +1833,6 @@ if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { sk->sk_route_caps = 0; - dst_release(dst); return err; } ===== net/xfrm/xfrm_policy.c 1.57 vs edited ===== --- 1.57/net/xfrm/xfrm_policy.c 2004-10-25 20:23:46 -07:00 +++ edited/net/xfrm/xfrm_policy.c 2004-11-04 16:39:23 -08:00 @@ -745,8 +745,8 @@ switch (policy->action) { case XFRM_POLICY_BLOCK: /* Prohibit the flow */ - xfrm_pol_put(policy); - return -EPERM; + err = -EPERM; + goto error; case XFRM_POLICY_ALLOW: if (policy->xfrm_nr == 0) { @@ -762,8 +762,8 @@ */ dst = xfrm_find_bundle(fl, policy, family); if (IS_ERR(dst)) { - xfrm_pol_put(policy); - return PTR_ERR(dst); + err = PTR_ERR(dst); + goto error; } if (dst) From jgarzik@pobox.com Thu Nov 4 23:31:42 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 23:31:46 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA57VfGT019463 for ; Thu, 4 Nov 2004 23:31:42 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CPyZ9-0006B8-QQ; Fri, 05 Nov 2004 07:31:23 +0000 Message-ID: <418B2C3F.60107@pobox.com> Date: Fri, 05 Nov 2004 02:31:11 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jesse Brandeburg CC: jgarzik@intel.com, akpm@osdl.org, netdev@oss.sgi.com Subject: Re: [PATCH 2.6] ixgb: fix ixgb_intr looping checks References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11457 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: 105 Lines: 8 I'm OK with the patch, but it doesn't apply for me... Can you resend against 2.6.10-rc1-bk14? Jeff From jgarzik@pobox.com Thu Nov 4 23:35:17 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 23:35:21 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA57ZGkY019930 for ; Thu, 4 Nov 2004 23:35:17 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CPycb-0006Dh-NN; Fri, 05 Nov 2004 07:34:57 +0000 Message-ID: <418B2D15.5080303@pobox.com> Date: Fri, 05 Nov 2004 02:34:45 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "David S. Miller" CC: hadi@cyberus.ca, buytenh@wantstofly.org, yoshfuji@linux-ipv6.org, netdev@oss.sgi.com Subject: Re: BUG: dst underflow (again) References: <4178AB0D.6060107@pobox.com> <20041022.155159.98771450.yoshfuji@linux-ipv6.org> <20041022075947.GA15795@xi.wantstofly.org> <1099577717.1039.155.camel@jzny.localdomain> <20041104221801.584c8f11.davem@davemloft.net> <418B2645.6080404@pobox.com> <20041104231433.3a7233e8.davem@davemloft.net> In-Reply-To: <20041104231433.3a7233e8.davem@davemloft.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11458 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: 519 Lines: 17 David S. Miller wrote: > On Fri, 05 Nov 2004 02:05:41 -0500 > Jeff Garzik wrote: >>I know this question wasn't directed at me, but, I do always compile >>ipsec stuff into my kernel, in addition to netfilter. The relevant >>options are attached for the curious. > > > Yes, but do you actually install any IPSEC rules into your system? Unless FC2 initscripts do something weird (I've never configured IPSEC... only the policies that the kernel boots with (presumably the null set?). Jeff From jgarzik@pobox.com Thu Nov 4 23:38:50 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 23:38:55 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA57cnKe020334 for ; Thu, 4 Nov 2004 23:38:49 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CPyg3-0006HF-Q2; Fri, 05 Nov 2004 07:38:31 +0000 Message-ID: <418B2DEB.4020203@pobox.com> Date: Fri, 05 Nov 2004 02:38:19 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: netdev@oss.sgi.com CC: "David S. Miller" , hadi@cyberus.ca, buytenh@wantstofly.org, yoshfuji@linux-ipv6.org Subject: Re: BUG: dst underflow (again) References: <4178AB0D.6060107@pobox.com> <20041022.155159.98771450.yoshfuji@linux-ipv6.org> <20041022075947.GA15795@xi.wantstofly.org> <1099577717.1039.155.camel@jzny.localdomain> <20041104221801.584c8f11.davem@davemloft.net> <418B2645.6080404@pobox.com> <20041104231433.3a7233e8.davem@davemloft.net> <418B2D15.5080303@pobox.com> In-Reply-To: <418B2D15.5080303@pobox.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11459 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: 267 Lines: 11 BTW to netdev, there is IMHO no excuse not to test IPv6 ;-) Plugging... Check out http://linux.yyz.us/ipv6-fc2-howto.html for starting points. Quick and easy IPv6 "6to4 automatic tunneling" setup for FC1/FC2, with pointers to Deb/Mac/Win instructions. Jeff From jgarzik@pobox.com Thu Nov 4 23:40:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 23:40:35 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA57eVnP020683 for ; Thu, 4 Nov 2004 23:40:31 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CPyhh-0006J4-Gy; Fri, 05 Nov 2004 07:40:13 +0000 Message-ID: <418B2E51.9060108@pobox.com> Date: Fri, 05 Nov 2004 02:40:01 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: jt@hpl.hp.com CC: Linux kernel mailing list , netdev@oss.sgi.com Subject: Re: [PATCH 2.6] Wireless Extension dropped patchlet References: <20041101225823.GA16560@bougret.hpl.hp.com> In-Reply-To: <20041101225823.GA16560@bougret.hpl.hp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11460 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 yoshfuji@linux-ipv6.org Thu Nov 4 23:43:54 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 23:43:59 -0800 (PST) Received: from yue.st-paulia.net (yue.linux-ipv6.org [203.178.140.15]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA57hrt0021060 for ; Thu, 4 Nov 2004 23:43:54 -0800 Received: from localhost (localhost [127.0.0.1]) by yue.st-paulia.net (Postfix) with ESMTP id 4251733CE5; Fri, 5 Nov 2004 16:44:35 +0900 (JST) Date: Fri, 05 Nov 2004 16:44:34 +0900 (JST) Message-Id: <20041105.164434.121268406.yoshfuji@linux-ipv6.org> To: davem@davemloft.net Cc: hadi@cyberus.ca, buytenh@wantstofly.org, jgarzik@pobox.com, netdev@oss.sgi.com, yoshfuji@linux-ipv6.org Subject: Re: BUG: dst underflow (again) From: YOSHIFUJI Hideaki / =?iso-2022-jp?B?GyRCNUhGIzFRTEAbKEI=?= In-Reply-To: <20041104231618.1d584a6f.davem@davemloft.net> References: <20041104221801.584c8f11.davem@davemloft.net> <20041105.155355.110780816.yoshfuji@linux-ipv6.org> <20041104231618.1d584a6f.davem@davemloft.net> Organization: USAGI Project X-URL: http://www.yoshifuji.org/%7Ehideaki/ X-Fingerprint: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA X-PGP-Key-URL: http://www.yoshifuji.org/%7Ehideaki/hideaki@yoshifuji.org.asc X-Face: "5$Al-.M>NJ%a'@hhZdQm:."qn~PA^gq4o*>iCFToq*bAi#4FRtx}enhuQKz7fNqQz\BYU] $~O_5m-9'}MIs`XGwIEscw;e5b>n"B_?j/AkL~i/MEaZBLP X-Mailer: Mew version 2.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-archive-position: 11461 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: yoshfuji@linux-ipv6.org Precedence: bulk X-list: netdev Content-Length: 307 Lines: 9 In article <20041104231618.1d584a6f.davem@davemloft.net> (at Thu, 4 Nov 2004 23:16:18 -0800), "David S. Miller" says: > I'm mid-way through such changes, but it looks something > like this (BTW, note the addrconf.c leak I noticed today > as well): Ok, I leave it to you. --yoshfuji From jgarzik@pobox.com Thu Nov 4 23:47:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 23:47:45 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA57lYmh021436 for ; Thu, 4 Nov 2004 23:47:34 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CPyoW-0006Pq-DD; Fri, 05 Nov 2004 07:47:16 +0000 Message-ID: <418B2FF6.8030907@pobox.com> Date: Fri, 05 Nov 2004 02:47:02 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nishanth Aravamudan CC: netdev@oss.sgi.com, kernel-janitors@lists.osdl.org Subject: Re: [PATCH] net/gt96100eth: replace gt96100_delay() with msleep_interruptible() References: <4184C72F.8000905@pobox.com> <20041101190841.GB1730@us.ibm.com> In-Reply-To: <20041101190841.GB1730@us.ibm.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11462 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: 1815 Lines: 58 Nishanth Aravamudan wrote: > On Sun, Oct 31, 2004 at 06:06:23AM -0500, Jeff Garzik wrote: > >>janitor@sternwelten.at wrote: >> >>>@@ -528,7 +517,7 @@ abort(struct net_device *dev, u32 abort_ >>> // wait for abort to complete >>> while (GT96100ETH_READ(gp, GT96100_ETH_SDMA_COMM) & abort_bits) { >>> // snooze for 20 msec and check again >>>- gt96100_delay(1); >>>+ msleep_interruptible(20); >>> >>> if (--timedout == 0) { >> >> >>don't change the behavior of the driver, even if it disagrees with the >>comment. > > > Ok, please find the corrected patch below. > > Description: Uses msleep_interruptible() instead of gt96100_delay() > to guarantee the task delays as expected. Removes prototype and > definition of now unused gt96100_delay() function. Corrects one comment > to correspond to the code. > > Signed-off-by: Nishanth Aravamudan > > > --- 2.6.10-rc1-vanilla/drivers/net/gt96100eth.c 2004-10-30 15:33:30.000000000 -0700 > +++ 2.6.10-rc1/drivers/net/gt96100eth.c 2004-11-01 11:05:37.000000000 -0800 > @@ -59,7 +59,6 @@ > // prototypes > static void* dmaalloc(size_t size, dma_addr_t *dma_handle); > static void dmafree(size_t size, void *vaddr); > -static void gt96100_delay(int msec); > static int gt96100_add_hash_entry(struct net_device *dev, > unsigned char* addr); > static void read_mib_counters(struct gt96100_private *gp); > @@ -183,16 +182,6 @@ static void dmafree(size_t size, void *v > free_pages((unsigned long)vaddr, get_order(size)); > } > > -static void gt96100_delay(int ms) > -{ > - if (in_interrupt()) > - return; > - else { > - current->state = TASK_INTERRUPTIBLE; > - schedule_timeout(ms*HZ/1000); I'm still worried about this patch, because 1) in_interrupt() check disappears, and 2) does driver already include linux/delay.h ? From jgarzik@pobox.com Thu Nov 4 23:58:29 2004 Received: with ECARTIS (v1.0.0; list netdev); Thu, 04 Nov 2004 23:58:33 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA57wTrb021966 for ; Thu, 4 Nov 2004 23:58:29 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CPyz5-0006eP-71; Fri, 05 Nov 2004 07:58:11 +0000 Message-ID: <418B3286.5050102@pobox.com> Date: Fri, 05 Nov 2004 02:57:58 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Randy.Dunlap" CC: netdev@oss.sgi.com, rl@hellgate.ch Subject: Re: [PATCH] via-rhine: references __init code during resume References: <4179543F.1020407@osdl.org> <418390F2.7080901@pobox.com> <418670AC.7010801@osdl.org> In-Reply-To: <418670AC.7010801@osdl.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11463 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: jgarzik@pobox.com Precedence: bulk X-list: netdev Content-Length: 318 Lines: 8 [jgarzik@pretzel net-drivers-2.6]$ dotest < /g/tmp/mbox bk import -tpatch -CR -yvia-rhine: references __init code during resume /tmp/patch21199 . Patching... Patch failed. **** patch log follows **** Patching file drivers/net/via-rhine.c 1 out of 1 hunk FAILED -- saving rejects to file drivers/net/via-rhine.c.rej From jgarzik@pobox.com Fri Nov 5 00:00:35 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 00:00:38 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA580YkJ022281 for ; Fri, 5 Nov 2004 00:00:34 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CPz17-0006hJ-1g; Fri, 05 Nov 2004 08:00:17 +0000 Message-ID: <418B3305.8040303@pobox.com> Date: Fri, 05 Nov 2004 03:00:05 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Pekka Enberg CC: netdev@oss.sgi.com Subject: Re: [PATCH] 8139too: use iomap for pio/mmio References: <1099228076.9571.12.camel@localhost> In-Reply-To: <1099228076.9571.12.camel@localhost> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11464 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: 73 Lines: 6 Find someone who will test it... then resend and I'll apply :) Jeff From garzik@havoc.gtf.org Fri Nov 5 00:22:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 00:22:51 -0800 (PST) Received: from havoc.gtf.org (havoc.gtf.org [69.28.190.101]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA58MjTt026355 for ; Fri, 5 Nov 2004 00:22:45 -0800 Received: from havoc.gtf.org (havoc.gtf.org [127.0.0.1]) by havoc.gtf.org (Postfix) with ESMTP id 978E57958; Fri, 5 Nov 2004 03:22:22 -0500 (EST) Received: (from garzik@localhost) by havoc.gtf.org (8.12.10/8.12.10/Submit) id iA58MMpp025933; Fri, 5 Nov 2004 03:22:22 -0500 Date: Fri, 5 Nov 2004 03:22:22 -0500 From: Jeff Garzik To: Andrew Morton , Linus Torvalds Cc: netdev@oss.sgi.com Subject: [BK PATCHES] 2.6.x net driver updates Message-ID: <20041105082222.GA25906@havoc.gtf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-archive-position: 11465 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: 3371 Lines: 89 Please do a bk pull bk://gkernel.bkbits.net/net-drivers-2.6 This will update the following files: include/net/iw_handler.h | 8 ++++---- net/core/wireless.c | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) through these ChangeSets: (04/11/05 1.2465) [PATCH] Wireless Extension dropped patchlet This tiny bit of the last WE-17 patch was lost between me and you. I initially decided to wait to resubmit, but Chris Wedgwood reported that the MadWifi driver needs it. Sorry for not having pushed harder. I recreated this patch, and tested with 2.6.10-rc1, and Chris tested it with MadWifi. Would you mind pushing that up to Linus ? Changelog : o remove unneeded const o spelling + comments Signed-off-by: Jean Tourrilhes Signed-off-by: Jeff Garzik diff -Nru a/include/net/iw_handler.h b/include/net/iw_handler.h --- a/include/net/iw_handler.h 2004-11-05 03:21:48 -05:00 +++ b/include/net/iw_handler.h 2004-11-05 03:21:48 -05:00 @@ -314,10 +314,10 @@ { /* Number of handlers defined (more precisely, index of the * last defined handler + 1) */ - const __u16 num_standard; - const __u16 num_private; + __u16 num_standard; + __u16 num_private; /* Number of private arg description */ - const __u16 num_private_args; + __u16 num_private_args; /* Array of handlers for standard ioctls * We will call dev->wireless_handlers->standard[ioctl - SIOCSIWNAME] @@ -335,7 +335,7 @@ const struct iw_priv_args * private_args; /* This field will be *removed* in the next version of WE */ - const long spy_offset; /* DO NOT USE */ + long spy_offset; /* DO NOT USE */ /* New location of get_wireless_stats, to de-bloat struct net_device. * The old pointer in struct net_device will be gradually phased diff -Nru a/net/core/wireless.c b/net/core/wireless.c --- a/net/core/wireless.c 2004-11-05 03:21:48 -05:00 +++ b/net/core/wireless.c 2004-11-05 03:21:48 -05:00 @@ -52,7 +52,8 @@ * v6 - 18.06.04 - Jean II * o Change get_spydata() method for added safety * o Remove spy #ifdef, they are always on -> cleaner code - * o Allow any size GET request is user specifies length > max + * o Allow any size GET request if user specifies length > max + * and if request has IW_DESCR_FLAG_NOMAX flag or is SIOCGIWPRIV * o Start migrating get_wireless_stats to struct iw_handler_def * o Add wmb() in iw_handler_set_spy() for non-coherent archs/cpus * Based on patch from Pavel Roskin : @@ -690,6 +691,10 @@ * we can support any size GET requests. * There is still a limit : -ENOMEM. */ extra_size = user_length * descr->token_size; + /* Note : user_length is originally a __u16, + * and token_size is controlled by us, + * so extra_size won't get negative and + * won't overflow... */ } } @@ -1227,7 +1232,7 @@ /* We want to operate without locking, because wireless_spy_update() * most likely will happen in the interrupt handler, and therefore - * have it own locking constraints and needs performance. + * have its own locking constraints and needs performance. * The rtnl_lock() make sure we don't race with the other iw_handlers. * This make sure wireless_spy_update() "see" that the spy list * is temporarily disabled. */ From herbert@gondor.apana.org.au Fri Nov 5 00:49:38 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 00:49:45 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA58na6N027772 for ; Fri, 5 Nov 2004 00:49:37 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CPzmQ-0005oK-00; Fri, 05 Nov 2004 19:49:10 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CPzmK-00029Q-00; Fri, 05 Nov 2004 19:49:04 +1100 Date: Fri, 5 Nov 2004 19:49:04 +1100 To: "David S. Miller" , YOSHIFUJI Hideaki , netdev@oss.sgi.com Subject: [IPV6] Fix memory leaks in TCP error path Message-ID: <20041105084904.GA8253@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="NzB8fVQJ5HfG6fxh" Content-Disposition: inline User-Agent: Mutt/1.5.6+20040722i From: Herbert Xu X-archive-position: 11466 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 1779 Lines: 61 --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi: I've gone through all the xfrm_lookup() calls in net/ipv6 and I haven't seen anything that can cause an underflow. I did find a couple of memory leaks though. In tcp_ipv6.c we may leak skb's if xfrm_lookup fails. Signed-off-by: Herbert Xu Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=p ===== net/ipv6/tcp_ipv6.c 1.100 vs edited ===== --- 1.100/net/ipv6/tcp_ipv6.c 2004-11-02 11:48:28 +11:00 +++ edited/net/ipv6/tcp_ipv6.c 2004-11-05 19:44:56 +11:00 @@ -1045,13 +1045,8 @@ fl.fl_ip_sport = t1->source; /* sk = NULL, but it is safe for now. RST socket required. */ - if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) { - - if ((xfrm_lookup(&buff->dst, &fl, NULL, 0)) < 0) { - dst_release(buff->dst); - return; - } - + if (!ip6_dst_lookup(NULL, &buff->dst, &fl) && + !xfrm_lookup(&buff->dst, &fl, NULL, 0)) { ip6_xmit(NULL, buff, &fl, NULL, 0); TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); TCP_INC_STATS_BH(TCP_MIB_OUTRSTS); @@ -1113,11 +1108,8 @@ fl.fl_ip_dport = t1->dest; fl.fl_ip_sport = t1->source; - if (!ip6_dst_lookup(NULL, &buff->dst, &fl)) { - if ((xfrm_lookup(&buff->dst, &fl, NULL, 0)) < 0) { - dst_release(buff->dst); - return; - } + if (!ip6_dst_lookup(NULL, &buff->dst, &fl) && + !xfrm_lookup(&buff->dst, &fl, NULL, 0)) { ip6_xmit(NULL, buff, &fl, NULL, 0); TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); return; --NzB8fVQJ5HfG6fxh-- From buytenh@wantstofly.org Fri Nov 5 01:35:52 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 01:35:56 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA59ZpD3029265 for ; Fri, 5 Nov 2004 01:35:51 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id C8BE82B0EC; Fri, 5 Nov 2004 10:13:41 +0100 (MET) Date: Fri, 5 Nov 2004 10:13:41 +0100 From: Lennert Buytenhek To: Jeff Garzik Cc: netdev@oss.sgi.com, "David S. Miller" , hadi@cyberus.ca, yoshfuji@linux-ipv6.org Subject: Re: BUG: dst underflow (again) Message-ID: <20041105091341.GA28112@xi.wantstofly.org> References: <4178AB0D.6060107@pobox.com> <20041022.155159.98771450.yoshfuji@linux-ipv6.org> <20041022075947.GA15795@xi.wantstofly.org> <1099577717.1039.155.camel@jzny.localdomain> <20041104221801.584c8f11.davem@davemloft.net> <418B2645.6080404@pobox.com> <20041104231433.3a7233e8.davem@davemloft.net> <418B2D15.5080303@pobox.com> <418B2DEB.4020203@pobox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <418B2DEB.4020203@pobox.com> User-Agent: Mutt/1.4.1i X-archive-position: 11467 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev Content-Length: 1564 Lines: 38 On Fri, Nov 05, 2004 at 02:38:19AM -0500, Jeff Garzik wrote: > BTW to netdev, there is IMHO no excuse not to test IPv6 ;-) :-) RIPE hands out IPv6 address space in chunks of /32, and it will only allocate such a /32 for you if you plan on assigning more than 200 /48's in two years. They specify that you should assign a /64 to a customer if they only need a single subnet, otherwise you should assign a /48. In order to assign 200 /48's in two years, you have to assign 200 address blocks to people who need at least 2 subnets, so that means you have to assign at least 400 subnets' worth of address space. If you take the canonical IPv6 subnet to be a /64 and the canonical IPv4 subnet to be a /24, that means you have to assign a block of IPv6 address space that roughly corresponds to a IPv4 /15 in two years in order to get IPv6 address space at all. I politely told RIPE that I don't think we'll be assigning that much address space any time soon, and the result of that was that our address space request was simply denied ("because it does not comply with current policy.") As a result of all this nonsense, the ISPs in the Netherlands (and elsewhere) that do supply IPv6 connectivity to their customers resort to the immensely wasteful practise of giving each and every single customer an entire /48 because otherwise they will not have assigned enough address space in two years and risk the wrath of RIPE. (And there's no way in hell you'll get people to peer with you if you start sending them 2002:xxxx:xxxx::/48 routes :-) cheers, Lennert From buytenh@wantstofly.org Fri Nov 5 01:35:51 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 01:35:56 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA59ZphB029266 for ; Fri, 5 Nov 2004 01:35:51 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 7A2272B0F4; Fri, 5 Nov 2004 10:14:27 +0100 (MET) Date: Fri, 5 Nov 2004 10:14:27 +0100 From: Lennert Buytenhek To: "David S. Miller" Cc: hadi@cyberus.ca, yoshfuji@linux-ipv6.org, jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: BUG: dst underflow (again) Message-ID: <20041105091427.GB28112@xi.wantstofly.org> References: <4178AB0D.6060107@pobox.com> <20041022.155159.98771450.yoshfuji@linux-ipv6.org> <20041022075947.GA15795@xi.wantstofly.org> <1099577717.1039.155.camel@jzny.localdomain> <20041104221801.584c8f11.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041104221801.584c8f11.davem@davemloft.net> User-Agent: Mutt/1.4.1i X-archive-position: 11468 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev Content-Length: 403 Lines: 16 On Thu, Nov 04, 2004 at 10:18:01PM -0800, David S. Miller wrote: > BTW Lennert, the decoded addresses are extremely helpful. Thanks. I'm glad. > But let me ask, do you have any IPSEC policies in the kernel > when these BUGs trigger? If so, I'm pretty sure I know what > the problem may be. IPSEC.. not that I know of. So unless my distro does stuff behind my back, no. How do I make sure? --L From acme@conectiva.com.br Fri Nov 5 01:42:02 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 01:42:07 -0800 (PST) Received: from orion.netbank.com.br (orion.netbank.com.br [200.203.199.90]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA59g1k3030012 for ; Fri, 5 Nov 2004 01:42:02 -0800 Received: from [200.138.55.111] (helo=oops.ghostprotocols.net) by orion.netbank.com.br with asmtp (Exim 3.33 #1) id 1CQ0bZ-0001an-00; Fri, 05 Nov 2004 07:42:01 -0200 Received: from [192.168.1.6] (amd64.kerneljanitors.org [192.168.1.6]) by oops.ghostprotocols.net (Postfix) with ESMTP id 8D89614639; Fri, 5 Nov 2004 07:41:38 -0200 (BRST) Message-ID: <418B4B1A.8@conectiva.com.br> Date: Fri, 05 Nov 2004 07:42:50 -0200 From: Arnaldo Carvalho de Melo Organization: Conectiva S.A. User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Lennert Buytenhek Cc: "David S. Miller" , hadi@cyberus.ca, yoshfuji@linux-ipv6.org, jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: BUG: dst underflow (again) References: <4178AB0D.6060107@pobox.com> <20041022.155159.98771450.yoshfuji@linux-ipv6.org> <20041022075947.GA15795@xi.wantstofly.org> <1099577717.1039.155.camel@jzny.localdomain> <20041104221801.584c8f11.davem@davemloft.net> <20041105091427.GB28112@xi.wantstofly.org> In-Reply-To: <20041105091427.GB28112@xi.wantstofly.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11469 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: acme@conectiva.com.br Precedence: bulk X-list: netdev Content-Length: 466 Lines: 22 Lennert Buytenhek wrote: > On Thu, Nov 04, 2004 at 10:18:01PM -0800, David S. Miller wrote: > > >>BTW Lennert, the decoded addresses are extremely helpful. Thanks. > > > I'm glad. > > > >>But let me ask, do you have any IPSEC policies in the kernel >>when these BUGs trigger? If so, I'm pretty sure I know what >>the problem may be. > > > IPSEC.. not that I know of. So unless my distro does stuff behind > my back, no. How do I make sure? setkey -DP From spam@crocom.com.pl Fri Nov 5 01:49:25 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 01:49:30 -0800 (PST) Received: from crocom.crocom.com.pl (task-crocom-rtr.task.gda.pl [153.19.102.70]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA59nLGn030511 for ; Fri, 5 Nov 2004 01:49:25 -0800 Received: from crocom.com.pl (localhost [127.0.0.1]) by crocom.crocom.com.pl (8.12.11/8.12.11) with ESMTP id iA59miek006737; Fri, 5 Nov 2004 10:48:45 +0100 (CET) Message-ID: <418B4C7C.8000402@crocom.com.pl> Date: Fri, 05 Nov 2004 10:48:44 +0100 From: Szymon Miotk Organization: Crocom Computer Systems s.c. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040124 X-Accept-Language: en-us, en, pl MIME-Version: 1.0 To: netdev@oss.sgi.com CC: kuznet@ms2.inr.ac.ru, jmorris@redhat.com Subject: PROBLEM: IProute hangs after running traffic shaping scripts Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11470 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: spam@crocom.com.pl Precedence: bulk X-list: netdev Content-Length: 22731 Lines: 543 This mail was posted 02-11-2004 to linux-net@vger.kernel.org, but I got no response at all, so I am resending it. [1.] One line summary of the problem: IProute hangs after running traffic shaping scripts [2.] Full description of the problem/report: I have a server with 3 links to ISPs and 1 link for internal network. I shape my clients to certain speeds, depending on the time of the day. I have HTB shaping on each interface, about 2250 classes and 2250 qdisc on each, so it makes total ~9000 classes (HTB) and ~9000 qdisc (SFQ). I run shaping scripts 4 times/day. Sometimes it makes a kernel oops, hangs at some 'tc ...' command (it differs). Then the shaping works so-so (usually it works, but doesn't fully utilize the bandwidth) and every iproute command hangs. Killing the hanging processes kills them, but still every iproute command hangs, including ip and tc. Sometimes the server stops forwarding, but usually it does so few hours after kernel oops. Reboot always helps. [3.] Keywords (i.e., modules, networking, kernel): traffic shaping, htb, qdisc, networking, kernel [4.] Kernel version (from /proc/version): Linux version 2.6.9 (root@ducttape.mlyniec) (gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)) #2 Thu Oct 28 17:06:01 CEST 2004 [5.] Output of Oops.. message (if applicable) with symbolic information resolved (see Documentation/oops-tracing.txt ksymoops 2.4.9 on i686 2.6.5-1.358smp. Options used -v /usr/src/linux-2.6.9/vmlinux (specified) -K (specified) -L (specified) -O (specified) -m /usr/src/linux-2.6.9/System.map (specified) Oct 31 15:02:38 cerber kernel: Unable to handle kernel paging request at virtual address 00100100 Oct 31 15:02:38 cerber kernel: *pde = 00000000 Oct 31 15:02:38 cerber kernel: Oops: 0000 [#1] Oct 31 15:02:38 cerber kernel: c03728c8 Oct 31 15:02:38 cerber kernel: CPU: 0 Oct 31 15:02:38 cerber kernel: EIP: 0060:[] Not tainted VLI Using defaults from ksymoops -t elf32-i386 -a i386 Oct 31 15:02:38 cerber kernel: EFLAGS: 00010286 (2.6.9) Oct 31 15:02:38 cerber kernel: eax: 001000b8 ebx: 001000b8 ecx: f0166048 edx: 00100100 Oct 31 15:02:38 cerber kernel: esi: f7c1b12c edi: 00010000 ebp: f7c1b000 esp: f1b47c54 Oct 31 15:02:38 cerber kernel: ds: 007b es: 007b ss: 0068 Oct 31 15:02:38 cerber kernel: Stack: ef3aaa10 eedd6000 c037325c c0373353 00000000 00000000 00000000 00000000 Oct 31 15:02:38 cerber kernel: 00000000 000008dc 00000002 00000000 f23de000 c01044e5 f1b47c94 00000002 Oct 31 15:02:38 cerber kernel: 00000000 ffffffff c18fcf80 ef3aaa00 f5019680 f23de000 00000000 f5019680 Oct 31 15:02:38 cerber kernel: Call Trace: Oct 31 15:02:38 cerber kernel: [] tc_modify_qdisc+0x0/0x6e3 Oct 31 15:02:38 cerber kernel: [] tc_modify_qdisc+0xf7/0x6e3 Oct 31 15:02:38 cerber kernel: [] error_code+0x2d/0x38 Oct 31 15:02:38 cerber kernel: [] tc_modify_qdisc+0x0/0x6e3 Oct 31 15:02:38 cerber kernel: [] rtnetlink_rcv+0x2af/0x359 Oct 31 15:02:38 cerber kernel: [] rtnetlink_rcv+0x0/0x359 Oct 31 15:02:38 cerber kernel: [] netlink_data_ready+0x55/0x5d Oct 31 15:02:38 cerber kernel: [] netlink_sendskb+0x8a/0x8c Oct 31 15:02:38 cerber kernel: [] netlink_sendmsg+0x1d7/0x2af Oct 31 15:02:38 cerber kernel: [] sock_sendmsg+0xcc/0xe6 Oct 31 15:02:38 cerber kernel: [] sock_recvmsg+0xdc/0xf7 Oct 31 15:02:38 cerber kernel: [] buffered_rmqueue+0xcf/0x27a Oct 31 15:02:38 cerber kernel: [] ip_forward_finish+0x26/0x4b Oct 31 15:02:38 cerber kernel: [] autoremove_wake_function+0x0/0x43 Oct 31 15:02:38 cerber kernel: [] copy_from_user+0x54/0x83 Oct 31 15:02:38 cerber kernel: [] verify_iovec+0x2a/0x74 Oct 31 15:02:38 cerber kernel: [] sys_sendmsg+0x14c/0x197 Oct 31 15:02:38 cerber kernel: [] handle_mm_fault+0x11d/0x2cf Oct 31 15:02:38 cerber kernel: [] sockfd_lookup+0x16/0x6e Oct 31 15:02:38 cerber kernel: [] sys_setsockopt+0x69/0x9e Oct 31 15:02:38 cerber kernel: [] sys_socketcall+0x22b/0x249 Oct 31 15:02:38 cerber kernel: [] do_page_fault+0x0/0x52b Oct 31 15:02:38 cerber kernel: [] error_code+0x2d/0x38 Oct 31 15:02:38 cerber kernel: [] sysenter_past_esp+0x52/0x71 Oct 31 15:02:38 cerber kernel: Code: 89 d7 56 53 8b 88 2c 01 00 00 8d 59 b8 8b 53 48 0f 18 02 90 8d b0 2c 01 00 00 39 f1 74 18 39 7b 14 74 19 8b 53 48 8d 42 b8 89 c3 <8b> 40 48 0f 18 00 90 39 f2 75 e8 31 c0 5b 5e 5f c3 89 d8 eb f8 >>EIP; c03728c8 <===== >>ecx; f0166048 >>esi; f7c1b12c >>ebp; f7c1b000 >>esp; f1b47c54 Trace; c037325c Trace; c0373353 Trace; c01044e5 Trace; c037325c Trace; c036bb36 Trace; c036b887 Trace; c038add3 Trace; c038a49f Trace; c038aac5 Trace; c03595c9 Trace; c03596fb Trace; c0140657 Trace; c039333b Trace; c011a0f2 Trace; c021586d Trace; c035f4fa Trace; c035ab74 Trace; c015001e Trace; c03593fb Trace; c035a921 Trace; c035af9f Trace; c0112ca2 Trace; c01044e5 Trace; c01042e9 This architecture has variable length instructions, decoding before eip is unreliable, take these instructions with a pinch of salt. Code; c037289d 00000000 <_EIP>: Code; c037289d 0: 89 d7 mov %edx,%edi Code; c037289f 2: 56 push %esi Code; c03728a0 3: 53 push %ebx Code; c03728a1 4: 8b 88 2c 01 00 00 mov 0x12c(%eax),%ecx Code; c03728a7 a: 8d 59 b8 lea 0xffffffb8(%ecx),%ebx Code; c03728aa d: 8b 53 48 mov 0x48(%ebx),%edx Code; c03728ad 10: 0f 18 02 prefetchnta (%edx) Code; c03728b0 13: 90 nop Code; c03728b1 14: 8d b0 2c 01 00 00 lea 0x12c(%eax),%esi Code; c03728b7 1a: 39 f1 cmp %esi,%ecx Code; c03728b9 1c: 74 18 je 36 <_EIP+0x36> Code; c03728bb 1e: 39 7b 14 cmp %edi,0x14(%ebx) Code; c03728be 21: 74 19 je 3c <_EIP+0x3c> Code; c03728c0 23: 8b 53 48 mov 0x48(%ebx),%edx Code; c03728c3 26: 8d 42 b8 lea 0xffffffb8(%edx),%eax Code; c03728c6 29: 89 c3 mov %eax,%ebx This decode from eip onwards should be reliable Code; c03728c8 00000000 <_EIP>: Code; c03728c8 <===== 0: 8b 40 48 mov 0x48(%eax),%eax <===== Code; c03728cb 3: 0f 18 00 prefetchnta (%eax) Code; c03728ce 6: 90 nop Code; c03728cf 7: 39 f2 cmp %esi,%edx Code; c03728d1 9: 75 e8 jne fffffff3 <_EIP+0xfffffff3> Code; c03728d3 b: 31 c0 xor %eax,%eax Code; c03728d5 d: 5b pop %ebx Code; c03728d6 e: 5e pop %esi Code; c03728d7 f: 5f pop %edi Code; c03728d8 10: c3 ret Code; c03728d9 11: 89 d8 mov %ebx,%eax Code; c03728db 13: eb f8 jmp d <_EIP+0xd> [6.] A small shell script or example program which triggers the problem (if possible) my traffic shaping scripts are rather huge and they don't always cause kernel oops. I tried to run them together (so classes and qdisc on every interface were changed in parallel), but it didn't help. I can send you them if you wish. [7.] Environment [7.1.] Software (add the output of the ver_linux script here) This is output from where the kernel was compiled. This is machine with the same hardware setup and the same Linux distro, but with developing packages installed. Gnu C 3.3.3 Gnu make 3.80 binutils 2.15.90.0.3 util-linux 2.12 mount 2.12 module-init-tools 2.4.26 e2fsprogs 1.35 reiserfsprogs line reiser4progs line pcmcia-cs 3.2.7 quota-tools 3.10. PPP 2.4.2 isdn4k-utils 3.3 nfs-utils 1.0.6 Linux C Library 2.3.3 Dynamic linker (ldd) 2.3.3 Procps 3.2.0 Net-tools 1.60 Kbd 1.12 Sh-utils 5.2.1 [7.2.] Processor information (from /proc/cpuinfo): processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 2 model name : Intel(R) Pentium(R) 4 CPU 2.80GHz stepping : 5 cpu MHz : 2814.286 cache size : 512 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 2 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr bogomips : 5554.17 This is HT P4, but SMP was disabled. [7.3.] Module information (from /proc/modules): This is static kernel, no modules. [7.4.] Loaded driver and hardware information (/proc/ioports, /proc/iomem) cat /proc/ioports 0000-001f : dma1 0020-0021 : pic1 0040-0043 : timer0 0050-0053 : timer1 0060-006f : keyboard 0070-0077 : rtc 0080-008f : dma page reg 00a0-00a1 : pic2 00c0-00df : dma2 00f0-00ff : fpu 0170-0177 : ide1 01f0-01f7 : libata 02f8-02ff : serial 0376-0376 : ide1 03c0-03df : vga+ 03f8-03ff : serial 0cf8-0cff : PCI conf1 1000-107f : 0000:00:1f.0 1080-10bf : 0000:00:1f.0 1400-141f : 0000:00:1f.3 a000-a03f : 0000:02:00.0 a000-a03f : e1000 a400-a43f : 0000:02:01.0 a400-a43f : e1000 a800-a83f : 0000:02:02.0 a800-a83f : e1000 ac00-ac3f : 0000:02:03.0 ac00-ac3f : e1000 f000-f00f : 0000:00:1f.2 f000-f00f : libata cat /proc/iomem 00000000-0009ffff : System RAM 000a0000-000bffff : Video RAM area 000c0000-000ccbff : Video ROM 000d0000-000d0fff : Adapter ROM 000d1000-000d1fff : Adapter ROM 000d2000-000d2fff : Adapter ROM 000d3000-000d3fff : Adapter ROM 000f0000-000fffff : System ROM 00100000-3ffeffff : System RAM 00100000-004215e9 : Kernel code 004215ea-0057e3ff : Kernel data 3fff0000-3fff2fff : ACPI Non-volatile Storage 3fff3000-3fffffff : ACPI Tables e8000000-efffffff : 0000:00:00.0 f0000000-f7ffffff : PCI Bus #01 f0000000-f7ffffff : 0000:01:00.0 f8000000-f9ffffff : PCI Bus #01 f8000000-f8ffffff : 0000:01:00.0 fb000000-fb01ffff : 0000:02:00.0 fb000000-fb01ffff : e1000 fb020000-fb03ffff : 0000:02:00.0 fb020000-fb03ffff : e1000 fb040000-fb05ffff : 0000:02:01.0 fb040000-fb05ffff : e1000 fb060000-fb07ffff : 0000:02:01.0 fb060000-fb07ffff : e1000 fb080000-fb09ffff : 0000:02:02.0 fb080000-fb09ffff : e1000 fb0a0000-fb0bffff : 0000:02:02.0 fb0a0000-fb0bffff : e1000 fb0c0000-fb0dffff : 0000:02:03.0 fb0c0000-fb0dffff : e1000 fb0e0000-fb0fffff : 0000:02:03.0 fb0e0000-fb0fffff : e1000 fec00000-ffffffff : reserved [7.5.] PCI information ('lspci -vvv' as root) In short: 4 x Intel 1000 MT carts, Marvell/Yukon integreated GbE disabled. 00:00.0 Host bridge: Intel Corp. 82865G/PE/P DRAM Controller/Host-Hub Interface (rev 02) Subsystem: Giga-byte Technology GA-8IPE1000 Pro2 motherboard (865PE) Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap+ 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- SERR- 00:01.0 PCI bridge: Intel Corp. 82865G/PE/P PCI to AGP Controller (rev 02) (prog-if 00 [Normal decode]) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap- 66Mhz+ UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- SERR- Reset- FastB2B- 00:1e.0 PCI bridge: Intel Corp. 82801BA/CA/DB/EB/ER Hub interface to PCI Bridge (rev c2) (prog-if 00 [Normal decode]) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- SERR- Reset- FastB2B- 00:1f.0 ISA bridge: Intel Corp. 82801EB/ER (ICH5/ICH5R) LPC Bridge (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- Region 1: I/O ports at Region 2: I/O ports at Region 3: I/O ports at Region 4: I/O ports at f000 [size=16] 00:1f.3 SMBus: Intel Corp. 82801EB/ER (ICH5/ICH5R) SMBus Controller (rev 02) Subsystem: Giga-byte Technology GA-8IPE1000 Pro2 motherboard (865PE) Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- 02:00.0 Ethernet controller: Intel Corp. 82541GI/PI Gigabit Ethernet Controller Subsystem: Intel Corp. PRO/1000 MT Desktop Adapter 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- ; Fri, 5 Nov 2004 02:02:25 -0800 Received: from havoc.gtf.org (havoc.gtf.org [127.0.0.1]) by havoc.gtf.org (Postfix) with ESMTP id DFC067767; Fri, 5 Nov 2004 05:02:00 -0500 (EST) Received: (from garzik@localhost) by havoc.gtf.org (8.12.10/8.12.10/Submit) id iA5A20ek031827; Fri, 5 Nov 2004 05:02:00 -0500 Date: Fri, 5 Nov 2004 05:02:00 -0500 From: Jeff Garzik To: netdev@oss.sgi.com Cc: linux-kernel@vger.kernel.org Subject: netdev-2.6 queue updated Message-ID: <20041105100200.GA31755@havoc.gtf.org> Reply-To: netdev@oss.sgi.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.4.1i X-archive-position: 11471 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: 9191 Lines: 244 NOTE: you will need to re-clone the netdev-2.6 tree. BK users: bk pull bk://gkernel.bkbits.net/netdev-2.6 Patch: http://www.kernel.org/pub/linux/kernel/people/jgarzik/patchkits/2.6/2.6.10-rc1-bk14-netdev1.patch.bz2 This will update the following files: drivers/net/3c505.c | 10 drivers/net/3c507.c | 148 ++-- drivers/net/3c59x.c | 1 drivers/net/8139cp.c | 102 ++- drivers/net/8139too.c | 98 +- drivers/net/8390.c | 1 drivers/net/8390.h | 1 drivers/net/Kconfig | 62 - drivers/net/ac3200.c | 64 - drivers/net/atp.c | 2 drivers/net/bonding/bond_3ad.c | 10 drivers/net/depca.c | 24 drivers/net/e100.c | 1 drivers/net/e2100.c | 18 drivers/net/eepro100.c | 293 +++----- drivers/net/fealnx.c | 275 +++----- drivers/net/hp100.c | 65 + drivers/net/ixgb/ixgb_main.c | 33 - drivers/net/lne390.c | 64 - drivers/net/mace.c | 66 -- drivers/net/ne3210.c | 34 - drivers/net/pcmcia/fmvj18x_cs.c | 4 drivers/net/pcmcia/ibmtr_cs.c | 7 drivers/net/pcmcia/pcnet_cs.c | 39 - drivers/net/pcmcia/smc91c92_cs.c | 2 drivers/net/pcmcia/xirc2ps_cs.c | 2 drivers/net/r8169.c | 855 +++++++++++++++++++------- drivers/net/sb1000.c | 14 drivers/net/sis900.c | 1 drivers/net/skfp/h/fplustm.h | 6 drivers/net/skfp/h/targethw.h | 6 drivers/net/skfp/h/targetos.h | 2 drivers/net/skfp/h/types.h | 21 drivers/net/skfp/skfddi.c | 25 drivers/net/skfp/smt.c | 7 drivers/net/starfire.c | 79 +- drivers/net/sundance.c | 259 +++---- drivers/net/tlan.c | 72 +- drivers/net/tlan.h | 88 -- drivers/net/tokenring/3c359.c | 36 - drivers/net/tokenring/3c359.h | 2 drivers/net/tokenring/ibmtr.c | 158 ++-- drivers/net/tokenring/lanstreamer.c | 24 drivers/net/tokenring/lanstreamer.h | 2 drivers/net/tokenring/olympic.c | 94 +- drivers/net/tulip/de2104x.c | 1 drivers/net/tulip/dmfe.c | 1 drivers/net/tulip/tulip_core.c | 3 drivers/net/tulip/winbond-840.c | 3 drivers/net/tulip/xircom_tulip_cb.c | 16 drivers/net/typhoon.c | 3 drivers/net/via-rhine.c | 276 ++++---- drivers/net/via-velocity.h | 4 drivers/net/wan/c101.c | 3 drivers/net/wan/cycx_drv.c | 22 drivers/net/wan/n2.c | 5 drivers/net/wireless/airo.c | 69 -- drivers/net/wireless/airport.c | 5 drivers/net/wireless/arlan-main.c | 90 +- drivers/net/wireless/arlan-proc.c | 15 drivers/net/wireless/arlan.h | 26 drivers/net/wireless/hermes.c | 43 - drivers/net/wireless/hermes.h | 62 - drivers/net/wireless/netwave_cs.c | 75 +- drivers/net/wireless/orinoco_cs.c | 10 drivers/net/wireless/orinoco_pci.c | 7 drivers/net/wireless/orinoco_plx.c | 82 +- drivers/net/wireless/orinoco_tmd.c | 51 - drivers/net/wireless/prism54/isl_ioctl.c | 24 drivers/net/wireless/prism54/islpci_hotplug.c | 2 drivers/net/wireless/prism54/prismcompat.h | 4 drivers/net/wireless/ray_cs.c | 4 drivers/net/wireless/wavelan_cs.c | 25 drivers/net/wireless/wavelan_cs.p.h | 1 include/linux/delay.h | 5 include/linux/ibmtr.h | 15 include/linux/pci_ids.h | 3 include/pcmcia/mem_op.h | 89 +- 78 files changed, 2239 insertions(+), 1982 deletions(-) through these ChangeSets: : o [netdrvr 8139cp] add PCI ID Adrian Bunk: o net/skfp/smt.c: remove an unused function o net/3c505.c: remove unused functions o bonding: remove an unused function o net/wan/n2.c: remove an unused function Alexander Viro: o mace iomem annotations - trivial part o airo iomem annotations o wavelan_cs iomem annotations o lne390 iomem annotations and fixes o fealnx iomem annotations, switch to io{read,write} o wireless iomem annotations and fixes, switch to io{read,write} o ibmtr annotations - the rest o skfp iomem annotations, switch to io{read,write} o olympic_open() cleanup and fixes o sundance iomem annotations, switch to io{read,write} o via-rhine iomem annotations, switch to io{read,write} o net/pcmcia iomem annotations o netwave iomem annotations o arlan iomem annotations and cleanups o netdev_priv() in netwave_cs o netdev_priv() in arlan o (25/32) lanstreamer iomem annotations o beginning of ibmtr iomem annotations o e2100 iomem annotations and fixes o 3c359 iomem annotations o depca iomem annotations o killed isa_... in 3c507 o starfire iomem annotations o ne3210 iomem annotations o ac3200 iomem annotations and fixes o iomem annotations in r8169 Andrew Morton: o r8169 module_param build fix Arjan van de Ven: o ray_cs export cleanup Christoph Hellwig: o unexport ei_tx_timeout Daniele Venzano: o Add Altimata PHY to sis900 driver David Dillow: o net/typhoon.c: use previously-unused function David S. Miller: o eepro100.c iomap conversion Felipe Damasio: o 8139cp net driver: add MODULE_VERSION François Romieu: o r8169: netconsole support o r8169: unneeded synchronize_irq() o r8169: always clean Tx desc o r8169: cleanup o r8169: rtl8169_close() races o r8169: automatic pci dac step down o r8169: wrong advertisement of VLAN features o r8169: Tx timeout rework o r8169: default on disabling PCIDAC o r8169: Mac identifier extracted from Realtek's driver v2.2 o r8169: TSO support o r8169: hint for Tx flow control o r8169: miscalculation of available Tx descriptors o 8139cp: SG support fixes o r8169: vlan support o r8169: Rx checksum support o r8169: advertise DMA to high memory o r8169: Tx checksum offload o r8169: comment a gcc 2.95.x bug o r8169: sync the names of a few bits with the 8139cp driver o r8169: bump version number o r8169: enable MWI o r8169: code cleanup o r8169: per device receive buffer size o r8169: add ethtool_ops.{get_regs_len/get_regs} Ganesh Venkatesan: o ixgb: Condition that determines when to quit polling o ixgb: Fix memory leak in NAPI mode. Avoid unnecessary o ixgb: Fix VLAN filter setup errors (while running Jeff Garzik: o [netdrvr eepro100] fix pci_iomap() args and info msg that follows o [netdrvr 8139cp] TSO support John W. Linville: o tulip: Add MODULE_VERSION o e100: Add MODULE_VERSION o r8169: Add MODULE_VERSION o 8139too: Add MODULE_VERSION o 3c59x: Add MODULE_VERSION o r8169: simplify trick if() expression o r8169: fix RxVlan bit manipulation o r8169: endian-swap return of rtl8169_tx_vlan_tag() Krzysztof Halasa: o net/wan/n2.c: remove an unused function Margit Schubert-While: o prism54 sparse fixes o prism54 fix resume processing Nishanth Aravamudan: o net/sb1000: replace nicedelay() with ssleep_interruptible() o net/cycx_drv: replace delay_cycx() with ssleep_interruptible() o net/airo: replace schedule_timeout() with *sleep() variants o Add ssleep_interruptible() Rene Herman: o 8139too Interframe Gap Time Roger Luethi: o mc_filter on big-endian arch Steffen Klassert: o 8139cp - add netpoll support Stephen Hemminger: o xircom_tulip_cb: convert to using module_param o tlan: enable faster hash function o tlan: make inline's static (rev2) o tlan: get rid of unneeded global vars (rev 2) o tlan: use netdev_priv (rev 2) o hp100: use inline for comple usage of dev->priv o hp100: use netdev_priv (rev 2) o via-velocity: get rid of unused global o via-rhine: free_ring should be static o via-rhine: use module_param o 8139too: use netdev_priv o r8169: use netdev_priv o r8169: use module_param o 8139cp - module_param Thomas Gleixner: o rtl8139too.c: Fix missing pci_disable_dev o rtl8139too.c: Fix missing pci_disable_dev Tom Rini: o IBM EMAC Kconfig changes: Add 'select CRC32' o IBM EMAC Kconfig changes From michael.vittrup.larsen@ericsson.com Fri Nov 5 02:04:39 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 02:04:45 -0800 (PST) Received: from penguin.ericsson.se (penguin.ericsson.se [193.180.251.47]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5A4Zrr031549 for ; Fri, 5 Nov 2004 02:04:36 -0800 Received: from esealmw142.al.sw.ericsson.se ([153.88.254.119]) by penguin.ericsson.se (8.12.10/8.12.10/WIREfire-1.8b) with ESMTP id iA5A4Hh5000715 for ; Fri, 5 Nov 2004 11:04:17 +0100 (MET) Received: from esealnt611.al.sw.ericsson.se ([153.88.254.121]) by esealmw142.al.sw.ericsson.se with Microsoft SMTPSVC(6.0.3790.211); Fri, 5 Nov 2004 11:04:17 +0100 Received: from unixmail.ted.dk.eu.ericsson.se (knud.ted.dk.eu.ericsson.se [213.159.188.246]) by esealnt611.al.sw.ericsson.se with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id WHL3DGFZ; Fri, 5 Nov 2004 11:04:09 +0100 Received: from diadem.ted.dk.eu.ericsson.se (diadem.ted.dk.eu.ericsson.se [213.159.189.76]) by unixmail.ted.dk.eu.ericsson.se (8.10.1/8.10.1/TEDmain-1.0) with ESMTP id iA5A3x317689; Fri, 5 Nov 2004 11:04:04 +0100 (MET) X-Sybari-Trust: 28fb81f7 bfd556f1 5f2520c6 00000139 From: Michael Vittrup Larsen Organization: Ericsson To: Stephen Hemminger Subject: Re: [PATCH] tcp: efficient port randomisation Date: Fri, 5 Nov 2004 12:03:58 +0200 User-Agent: KMail/1.7 Cc: "David S. Miller" , netdev@oss.sgi.com References: <20041027092531.78fe438c@guest-251-240.pdx.osdl.net> <200411020854.44745.michael.vittrup.larsen@ericsson.com> <20041104100104.570e67cd@dxpl.pdx.osdl.net> In-Reply-To: <20041104100104.570e67cd@dxpl.pdx.osdl.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Message-Id: <200411051103.59032.michael.vittrup.larsen@ericsson.com> X-OriginalArrivalTime: 05 Nov 2004 10:04:17.0096 (UTC) FILETIME=[CF808C80:01C4C31E] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id iA5A4Zrr031549 X-archive-position: 11472 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: michael.vittrup.larsen@ericsson.com Precedence: bulk X-list: netdev Content-Length: 2304 Lines: 54 On Thursday 04 November 2004 19:01, Stephen Hemminger wrote: > But because of the hashing most ports will be scattered all over the port > space, because they come from different hosts. > > Also, Linux TCP will reuse ports if (saddr, daddr, sport) are different. > Look at __tcp_v4_check_established.  This means that the ports actually > have to be in use with real connections to the same host. __tcp_v4_check_established is the linux version of the uniqueness test from the draft, and of course ports ports can be reused when at least one of the other parameters (saddr, daddr, sport) are different. I focus on the situation where (saddr, daddr, sport) is constant since this is where we get collisions and need to try another port. Not storing the port found to be unused will result in situations like: tcp_rover_next is say 2000 Ports 2000-2010 are already used because you are browsing www.osdl.org Your search will find 2011 to be unused after 10 retries and tcp_rover_next will be 2001. Your next search (you continue to browse www.osdl.org) will result in 2012 - again after 10 retries. In a simple browsing scenario like this, you will usually not have holes because of TCP TIME-WAIT and your rover will continue to lag behind and you will continue to make 10 retries on ports. The question is then, when do the rover begin to lack behind? Everytime you meet a long-lived connection in the port space your rover will lag one port behind the real 'unused' rover. Using wget and browsing www.osdl.org may easily produce this problem. I understand your argument for not holding the lock, and maybe the following algorithm is a compromise: 1. Use the current algorithm that does not hold the lock 2. If a port was found in first try, then exit (you have already incremented tcp_rover_next by 1 so this is up to date as per the old algorithm). 3. If more than one port try was necessary, compute the difference between the initial rover to the current unused port, and atomic_add() this to tcp_rover_next. The only drawback of this is, that tcp_rover_next may 'run' a little too fast in contention cases, which only has theoretical impact on performance. Also, this only happens when we meet a long-lived connection, which we usually do not have many of. From buytenh@wantstofly.org Fri Nov 5 02:15:32 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 02:15:47 -0800 (PST) Received: from xi.wantstofly.org (alephnull.demon.nl [212.238.201.82]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5AFVGA031969 for ; Fri, 5 Nov 2004 02:15:32 -0800 Received: by xi.wantstofly.org (Postfix, from userid 500) id 13F2B2B102; Fri, 5 Nov 2004 11:15:14 +0100 (MET) Date: Fri, 5 Nov 2004 11:15:13 +0100 From: Lennert Buytenhek To: Arnaldo Carvalho de Melo Cc: "David S. Miller" , hadi@cyberus.ca, yoshfuji@linux-ipv6.org, jgarzik@pobox.com, netdev@oss.sgi.com Subject: Re: BUG: dst underflow (again) Message-ID: <20041105101513.GA28779@xi.wantstofly.org> References: <4178AB0D.6060107@pobox.com> <20041022.155159.98771450.yoshfuji@linux-ipv6.org> <20041022075947.GA15795@xi.wantstofly.org> <1099577717.1039.155.camel@jzny.localdomain> <20041104221801.584c8f11.davem@davemloft.net> <20041105091427.GB28112@xi.wantstofly.org> <418B4B1A.8@conectiva.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <418B4B1A.8@conectiva.com.br> User-Agent: Mutt/1.4.1i X-archive-position: 11473 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: buytenh@wantstofly.org Precedence: bulk X-list: netdev Content-Length: 294 Lines: 15 On Fri, Nov 05, 2004 at 07:42:50AM -0200, Arnaldo Carvalho de Melo wrote: > >IPSEC.. not that I know of. So unless my distro does stuff behind > >my back, no. How do I make sure? > > setkey -DP Thanks. Both machines I'm seeing this problem on have: # setkey -DP No SPD entries. # --L From tgr@reeler.org Fri Nov 5 04:20:05 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 04:20:11 -0800 (PST) Received: from rei.rakuen (217-162-107-144.dclient.hispeed.ch [217.162.107.144]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5CK4r6017687 for ; Fri, 5 Nov 2004 04:20:05 -0800 Received: from tgr by rei.rakuen with local (Exim 4.34) id 1CQ2fn-0006N7-5M; Fri, 05 Nov 2004 12:54:31 +0100 Date: Fri, 5 Nov 2004 12:54:31 +0100 From: Thomas Graf To: Szymon Miotk Cc: netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru, jmorris@redhat.com Subject: Re: PROBLEM: IProute hangs after running traffic shaping scripts Message-ID: <20041105115430.GP19714@rei.reeler.org> References: <418B4C7C.8000402@crocom.com.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <418B4C7C.8000402@crocom.com.pl> X-archive-position: 11475 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 2269 Lines: 54 > [2.] Full description of the problem/report: > I have a server with 3 links to ISPs and 1 link for internal network. > I shape my clients to certain speeds, depending on the time of the day. > I have HTB shaping on each interface, about 2250 classes and 2250 qdisc > on each, so it makes total ~9000 classes (HTB) and ~9000 qdisc (SFQ). > I run shaping scripts 4 times/day. Could you send me the rules via private email or explain the basic architecutre of it? My first thought was that you might run out of stack space while dumping the qdisc tree but it doesn't seem so regarding your oops reports. > Sometimes it makes a kernel oops, hangs at some 'tc ...' command (it > differs). > Then the shaping works so-so (usually it works, but doesn't fully > utilize the bandwidth) and every iproute command hangs. > Killing the hanging processes kills them, but still every iproute > command hangs, including ip and tc. > Sometimes the server stops forwarding, but usually it does so few hours > after kernel oops. > Reboot always helps.A There have been at least 2 slab corruptions in CBQ and some might have been ported over to HTB. I will look into it. > Oct 31 15:02:38 cerber kernel: [] tc_modify_qdisc+0x0/0x6e3 > Oct 31 15:02:38 cerber kernel: [] tc_modify_qdisc+0xf7/0x6e3 > Oct 31 15:02:38 cerber kernel: [] error_code+0x2d/0x38 > Oct 31 15:02:38 cerber kernel: [] tc_modify_qdisc+0x0/0x6e3 Something is wrong here and qdisc_lookup has something to do with it. I will audit qdisc_list changes. > my traffic shaping scripts are rather huge and they don't always cause > kernel oops. I tried to run them together (so classes and qdisc on every > interface were changed in parallel), but it didn't help. > I can send you them if you wish. My first guess is that something corrupts qdisc_list of the device. I'm not sure what causes this but I will look into it today. > The default kernel has serious problems with traffic shaping, that was > resolved in 2.6.9 kernel line. Can you be more exact? Those were different issues, right? > Without recompiling iproute, it hanged every time two iproute commands > were run in parallel. iproute2 problem or kernel problem? Can you give an example how to trigger it? From mic@maxipes.logix.cz Fri Nov 5 04:26:46 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 04:26:52 -0800 (PST) Received: from maxipes.logix.cz (maxipes.logix.cz [217.11.251.249]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5CQjfR018111 for ; Fri, 5 Nov 2004 04:26:46 -0800 Received: by maxipes.logix.cz (Postfix, from userid 500) id CD9541F9E2; Fri, 5 Nov 2004 11:27:40 +0100 (CET) Date: Fri, 5 Nov 2004 11:27:40 +0100 (CET) From: Michal Ludvig To: Aidas Kasparas Cc: Joy Latten , ipsec-tools-devel@lists.sourceforge.net, netdev@oss.sgi.com Subject: Re: [Ipsec-tools-devel] ipv4/ipv6 forwarding check In-Reply-To: <4181EBC3.3020507@gmc.lt> Message-ID: References: <200410300506.i9U56Yse005815@faith.austin.ibm.com> <4181EBC3.3020507@gmc.lt> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-archive-position: 11476 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: michal@logix.cz Precedence: bulk X-list: netdev Content-Length: 621 Lines: 17 On Fri, 29 Oct 2004, Aidas Kasparas wrote: > 4) extend setkey's syntax to make explicit forward policy management > possible and write docs for all the admins to change policies. I have uploaded a tarball of IPsec-tools 0.5-preview to sf.net. Among other changes, setkey is now able (hopefully :-) to handle fwd policies. Please test and report any problems to the IPsec-tools list. Download here: https://sourceforge.net/project/showfiles.php?group_id=74601&package_id=133565 Michal Ludvig -- * A mouse is a device used to point at the xterm you want to type in. * Personal homepage - http://www.logix.cz/michal From util@deuroconsult.ro Fri Nov 5 04:26:59 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 04:27:06 -0800 (PST) Received: from webhosting.rdsbv.ro (webhosting.rdsbv.ro [213.157.185.164]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5CQwxH018139 for ; Fri, 5 Nov 2004 04:26:59 -0800 Received: from webhosting.rdsbv.ro (webhosting.rdsbv.ro [213.157.185.164]) by webhosting.rdsbv.ro (8.13.1/8.13.1) with ESMTP id iA5BcY2w021174 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 5 Nov 2004 13:38:35 +0200 Date: Fri, 5 Nov 2004 13:38:33 +0200 (EET) From: "Catalin(ux aka Dino) BOIE" X-X-Sender: util@webhosting.rdsbv.ro To: linux-net@vger.kernel.org, lartc@mailman.ds9a.nl, netdev@oss.sgi.com Subject: [PATCH] Use nfmark as a key for u32 classifier Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1646943047-1849353369-1099654713=:19155" X-archive-position: 11477 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: util@deuroconsult.ro Precedence: bulk X-list: netdev Content-Length: 6279 Lines: 123 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1646943047-1849353369-1099654713=:19155 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Hello! I am glad to announce a patch for u32 to allow matches on nfmark. The patch is non intrusive (few lines). Why I did this? Because fw classifier cannot be used together with u32. For example, now, you cannot match a mark of 0x90 and a destination port of 80. I know you can do it with iptables to do the marking, but if you use Jamal actions to apply mark to policed packets, you need this. All stuff can be found at http://kernel.umbrella.ro/ also. Dave, please consider adding this patch. Stephen, if Dave accepts the patch, please apply the iproute2 patch. Thank you. Signed-off-by: Catalin(ux aka Dino) BOIE Thank you for you time. --- Catalin(ux aka Dino) BOIE catab at deuroconsult.ro http://kernel.umbrella.ro/ ---1646943047-1849353369-1099654713=:19155 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="iproute2-match-mark-in-u32.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="iproute2-match-mark-in-u32.patch" LS0tIGlwcm91dGUyLTIuNi45L3RjL2ZfdTMyLmMub3JpZwkyMDA0LTExLTA0 IDE1OjM4OjUzLjAwMDAwMDAwMCArMDIwMA0KKysrIGlwcm91dGUyLTIuNi45 L3RjL2ZfdTMyLmMJMjAwNC0xMS0wNSAxMjoyMzo0NC4wMDAwMDAwMDAgKzAy MDANCkBAIC03LDYgKzcsNyBAQA0KICAqCQkyIG9mIHRoZSBMaWNlbnNlLCBv ciAoYXQgeW91ciBvcHRpb24pIGFueSBsYXRlciB2ZXJzaW9uLg0KICAqDQog ICogQXV0aG9yczoJQWxleGV5IEt1em5ldHNvdiwgPGt1em5ldEBtczIuaW5y LmFjLnJ1Pg0KKyAqCQlNYXRjaCBtYXJrIGFkZGVkIGJ5IENhdGFsaW4odXgg YWthIERpbm8pIEJPSUUgPGNhdGFiIGF0IHVtYnJlbGxhLnJvPiBbNSBub3Yg MjAwNF0NCiAgKg0KICAqLw0KIA0KQEAgLTMzLDcgKzM0LDcgQEAgc3RhdGlj IHZvaWQgZXhwbGFpbih2b2lkKQ0KIAlmcHJpbnRmKHN0ZGVyciwgIm9yICAg ICAgICAgdTMyIGRpdm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cuMDAwMDAwMDAwICswMjAwDQorKysgaXByb3V0ZTItMi42LjkvaW5jbHVk ZS9saW51eC9wa3RfY2xzLmgJMjAwNC0xMS0wNSAxMToxMjoyMi4wMDAwMDAw MDAgKzAyMDANCkBAIC0yMDgsNiArMjA4LDcgQEAgc3RydWN0IHRjX3UzMl9z ZWwNCiAJdW5zaWduZWQgY2hhcgkJZmxhZ3M7DQogCXVuc2lnbmVkIGNoYXIJ CW9mZnNoaWZ0Ow0KIAl1bnNpZ25lZCBjaGFyCQlua2V5czsNCisJX191MzIJ CQltYXJrOw0KIA0KIAlfX3UxNgkJCW9mZm1hc2s7DQogCV9fdTE2CQkJb2Zm Ow0K ---1646943047-1849353369-1099654713=:19155 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="net-match-nfmark-in-u32.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="net-match-nfmark-in-u32.patch" LS0tIGxpbnV4Lm9yaWcvbmV0L3NjaGVkL2Nsc191MzIuYwkyMDA0LTEwLTE5 IDAwOjUzOjQ1LjAwMDAwMDAwMCArMDMwMA0KKysrIGxpbnV4L25ldC9zY2hl ZC9jbHNfdTMyLmMJMjAwNC0xMS0wNSAxMjoxNDozMS4wMDAwMDAwMDAgKzAy MDANCkBAIC0yNyw2ICsyNyw3IEBADQogICoJSkhTOiBXZSBzaG91bGQgcmVt b3ZlIHRoZSBDT05GSUdfTkVUX0NMU19JTkQgZnJvbSBoZXJlDQogICoJZXZl bnR1YWxseSB3aGVuIHRoZSBtZXRhIG1hdGNoIGV4dGVuc2lvbiBpcyBtYWRl IGF2YWlsYWJsZQ0KICAqDQorICoJbmZtYXJrIG1hdGNoIGFkZGVkIGJ5IENh dGFsaW4odXggYWthIERpbm8pIEJPSUUgPGNhdGFiIGF0IHVtYnJlbGxhLnJv Pg0KICAqLw0KIA0KICNpbmNsdWRlIDxhc20vdWFjY2Vzcy5oPg0KQEAgLTEz OSw2ICsxNDAsMTEgQEAgbmV4dF9rbm9kZToNCiAJCW4tPnBmLT5yY250ICs9 MTsNCiAJCWogPSAwOw0KICNlbmRpZg0KKwkJaWYgKChuLT5zZWwubWFyayA+ IDApICYmIChuLT5zZWwubWFyayAhPSBza2ItPm5mbWFyaykpIHsNCisJCQlu ID0gbi0+bmV4dDsNCisJCQlnb3RvIG5leHRfa25vZGU7DQorCQl9DQorDQog CQlmb3IgKGkgPSBuLT5zZWwubmtleXM7IGk+MDsgaS0tLCBrZXkrKykgew0K IA0KIAkJCWlmICgoKih1MzIqKShwdHIra2V5LT5vZmYrKG9mZjIma2V5LT5v ZmZtYXNrKSlea2V5LT52YWwpJmtleS0+bWFzaykgew0KLS0tIGxpbnV4Lm9y aWcvaW5jbHVkZS9saW51eC9wa3RfY2xzLmgJMjAwNC0xMC0xOSAwMDo1Mzow Ny4wMDAwMDAwMDAgKzAzMDANCisrKyBsaW51eC9pbmNsdWRlL2xpbnV4L3Br dF9jbHMuaAkyMDA0LTExLTA1IDExOjAwOjI3LjAwMDAwMDAwMCArMDIwMA0K QEAgLTIwOCw2ICsyMDgsNyBAQCBzdHJ1Y3QgdGNfdTMyX3NlbA0KIAl1bnNp Z25lZCBjaGFyCQlmbGFnczsNCiAJdW5zaWduZWQgY2hhcgkJb2Zmc2hpZnQ7 DQogCXVuc2lnbmVkIGNoYXIJCW5rZXlzOw0KKwl1MzIJCQltYXJrOw0KIA0K IAlfX3UxNgkJCW9mZm1hc2s7DQogCV9fdTE2CQkJb2ZmOw0K ---1646943047-1849353369-1099654713=:19155-- From tgr@reeler.org Fri Nov 5 06:17:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 06:17:18 -0800 (PST) Received: from rei.rakuen (217-162-107-144.dclient.hispeed.ch [217.162.107.144]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5EHBh5024835 for ; Fri, 5 Nov 2004 06:17:12 -0800 Received: from tgr by rei.rakuen with local (Exim 4.34) id 1CQ4tM-0000px-K4; Fri, 05 Nov 2004 15:16:40 +0100 Date: Fri, 5 Nov 2004 15:16:40 +0100 From: Thomas Graf To: davem@davemloft.net Cc: netdev@oss.sgi.com, spam@crocom.com.pl, kuznet@ms2.inr.ac.ru, jmorris@redhat.com Subject: [PATCH] PKT_SCHED: Initialize list field in dummy qdiscs Message-ID: <20041105141640.GQ19714@rei.reeler.org> References: <418B4C7C.8000402@crocom.com.pl> <20041105115430.GP19714@rei.reeler.org> <418B4C7C.8000402@crocom.com.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041105115430.GP19714@rei.reeler.org> <418B4C7C.8000402@crocom.com.pl> X-archive-position: 11479 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1344 Lines: 42 > Oct 31 15:02:38 cerber kernel: Unable to handle kernel paging request at > virtual address 00100100 The conversion to the generic list API was nice, it really helps in such a case when a poison value shows up in an oops. However it is not nice if new bugs are introduced with such changes. - if (dev) { - struct Qdisc *q, **qp; - for (qp = &qdisc->dev->qdisc_list; (q=*qp) != NULL; qp = &q->next) { - if (q == qdisc) { - *qp = q->next; - break; - } - } - } + list_del(&qdisc->list); Nice cleanup, although it assumes that everyone calling qdisc_destroy provides a Qdisc which is actually linked or at least has an initialized list node. This was not the true for noqueue and noop dummy qdiscs. Signed-off-by: Thomas Graf --- linux-2.6.10-rc1-bk14.orig/net/sched/sch_generic.c 2004-11-05 01:11:17.000000000 +0100 +++ linux-2.6.10-rc1-bk14/net/sched/sch_generic.c 2004-11-05 15:05:54.000000000 +0100 @@ -280,6 +280,7 @@ .dequeue = noop_dequeue, .flags = TCQ_F_BUILTIN, .ops = &noop_qdisc_ops, + .list = LIST_HEAD_INIT(noop_qdisc.list), }; struct Qdisc_ops noqueue_qdisc_ops = { @@ -298,6 +299,7 @@ .dequeue = noop_dequeue, .flags = TCQ_F_BUILTIN, .ops = &noqueue_qdisc_ops, + .list = LIST_HEAD_INIT(noqueue_qdisc.list), }; From tgraf@suug.ch Fri Nov 5 06:28:56 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 06:29:04 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5EStQ3025420 for ; Fri, 5 Nov 2004 06:28:56 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id C2D36F; Fri, 5 Nov 2004 15:28:14 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id B3F0F1C0E9; Fri, 5 Nov 2004 15:28:57 +0100 (CET) Date: Fri, 5 Nov 2004 15:28:57 +0100 From: Thomas Graf To: "David S. Miller" Cc: netdev@oss.sgi.com Subject: [PATCH] PKT_SCHED: Remove old rate estimator and statistics bits Message-ID: <20041105142857.GW12289@postel.suug.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-archive-position: 11480 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 8609 Lines: 269 Signed-off-by: Thomas Graf diff -Nru linux-2.6.10-rc1-bk14.orig/include/net/act_api.h linux-2.6.10-rc1-bk14/include/net/act_api.h --- linux-2.6.10-rc1-bk14.orig/include/net/act_api.h 2004-11-05 01:10:18.000000000 +0100 +++ linux-2.6.10-rc1-bk14/include/net/act_api.h 2004-11-05 01:42:00.000000000 +0100 @@ -99,7 +99,6 @@ #endif /* CONFIG_NET_CLS_ACT */ extern int tcf_police(struct sk_buff *skb, struct tcf_police *p); -extern int qdisc_copy_stats(struct sk_buff *skb, struct tc_stats *st, spinlock_t *lock); extern void tcf_police_destroy(struct tcf_police *p); extern struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est); extern int tcf_police_dump(struct sk_buff *skb, struct tcf_police *p); diff -Nru linux-2.6.10-rc1-bk14.orig/include/net/pkt_sched.h linux-2.6.10-rc1-bk14/include/net/pkt_sched.h --- linux-2.6.10-rc1-bk14.orig/include/net/pkt_sched.h 2004-11-05 01:10:18.000000000 +0100 +++ linux-2.6.10-rc1-bk14/include/net/pkt_sched.h 2004-11-05 01:42:25.000000000 +0100 @@ -222,9 +222,6 @@ extern void qdisc_destroy(struct Qdisc *qdisc); extern struct Qdisc * qdisc_create_dflt(struct net_device *dev, struct Qdisc_ops *ops); -extern int qdisc_new_estimator(struct tc_stats *stats, spinlock_t *stats_lock, - struct rtattr *opt); -extern void qdisc_kill_estimator(struct tc_stats *stats); extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, struct rtattr *tab); extern void qdisc_put_rtab(struct qdisc_rate_table *tab); diff -Nru linux-2.6.10-rc1-bk14.orig/net/sched/Makefile linux-2.6.10-rc1-bk14/net/sched/Makefile --- linux-2.6.10-rc1-bk14.orig/net/sched/Makefile 2004-11-05 01:11:17.000000000 +0100 +++ linux-2.6.10-rc1-bk14/net/sched/Makefile 2004-11-05 01:41:51.000000000 +0100 @@ -5,7 +5,6 @@ obj-y := sch_generic.o obj-$(CONFIG_NET_SCHED) += sch_api.o sch_fifo.o -obj-$(CONFIG_NET_ESTIMATOR) += estimator.o obj-$(CONFIG_NET_CLS) += cls_api.o obj-$(CONFIG_NET_CLS_ACT) += act_api.o obj-$(CONFIG_NET_ACT_POLICE) += police.o diff -Nru linux-2.6.10-rc1-bk14.orig/net/sched/estimator.c linux-2.6.10-rc1-bk14/net/sched/estimator.c --- linux-2.6.10-rc1-bk14.orig/net/sched/estimator.c 2004-11-05 01:11:17.000000000 +0100 +++ linux-2.6.10-rc1-bk14/net/sched/estimator.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,197 +0,0 @@ -/* - * net/sched/estimator.c Simple rate estimator. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - * Authors: Alexey Kuznetsov, - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - This code is NOT intended to be used for statistics collection, - its purpose is to provide a base for statistical multiplexing - for controlled load service. - If you need only statistics, run a user level daemon which - periodically reads byte counters. - - Unfortunately, rate estimation is not a very easy task. - F.e. I did not find a simple way to estimate the current peak rate - and even failed to formulate the problem 8)8) - - So I preferred not to built an estimator into the scheduler, - but run this task separately. - Ideally, it should be kernel thread(s), but for now it runs - from timers, which puts apparent top bounds on the number of rated - flows, has minimal overhead on small, but is enough - to handle controlled load service, sets of aggregates. - - We measure rate over A=(1<next) { - struct tc_stats *st = e->stats; - u64 nbytes; - u32 npackets; - u32 rate; - - spin_lock(e->stats_lock); - nbytes = st->bytes; - npackets = st->packets; - rate = (nbytes - e->last_bytes)<<(7 - idx); - e->last_bytes = nbytes; - e->avbps += ((long)rate - (long)e->avbps) >> e->ewma_log; - st->bps = (e->avbps+0xF)>>5; - - rate = (npackets - e->last_packets)<<(12 - idx); - e->last_packets = npackets; - e->avpps += ((long)rate - (long)e->avpps) >> e->ewma_log; - e->stats->pps = (e->avpps+0x1FF)>>10; - spin_unlock(e->stats_lock); - } - - mod_timer(&elist[idx].timer, jiffies + ((HZ<interval < -2 || parm->interval > 3) - return -EINVAL; - - est = kmalloc(sizeof(*est), GFP_KERNEL); - if (est == NULL) - return -ENOBUFS; - - memset(est, 0, sizeof(*est)); - est->interval = parm->interval + 2; - est->stats = stats; - est->stats_lock = stats_lock; - est->ewma_log = parm->ewma_log; - est->last_bytes = stats->bytes; - est->avbps = stats->bps<<5; - est->last_packets = stats->packets; - est->avpps = stats->pps<<10; - - est->next = elist[est->interval].list; - if (est->next == NULL) { - init_timer(&elist[est->interval].timer); - elist[est->interval].timer.data = est->interval; - elist[est->interval].timer.expires = jiffies + ((HZ<interval)/4); - elist[est->interval].timer.function = est_timer; - add_timer(&elist[est->interval].timer); - } - write_lock_bh(&est_lock); - elist[est->interval].list = est; - write_unlock_bh(&est_lock); - return 0; -} - -void qdisc_kill_estimator(struct tc_stats *stats) -{ - int idx; - struct qdisc_estimator *est, **pest; - - for (idx=0; idx <= EST_MAX_INTERVAL; idx++) { - int killed = 0; - pest = &elist[idx].list; - while ((est=*pest) != NULL) { - if (est->stats != stats) { - pest = &est->next; - continue; - } - - write_lock_bh(&est_lock); - *pest = est->next; - write_unlock_bh(&est_lock); - - kfree(est); - killed++; - } - if (killed && elist[idx].list == NULL) - del_timer(&elist[idx].timer); - } -} - -EXPORT_SYMBOL(qdisc_kill_estimator); -EXPORT_SYMBOL(qdisc_new_estimator); diff -Nru linux-2.6.10-rc1-bk14.orig/net/sched/sch_api.c linux-2.6.10-rc1-bk14/net/sched/sch_api.c --- linux-2.6.10-rc1-bk14.orig/net/sched/sch_api.c 2004-11-05 01:11:17.000000000 +0100 +++ linux-2.6.10-rc1-bk14/net/sched/sch_api.c 2004-11-05 01:42:38.000000000 +0100 @@ -728,19 +728,6 @@ return 0; } -int qdisc_copy_stats(struct sk_buff *skb, struct tc_stats *st, spinlock_t *lock) -{ - spin_lock_bh(lock); - RTA_PUT(skb, TCA_STATS, sizeof(struct tc_stats), st); - spin_unlock_bh(lock); - return 0; - -rtattr_failure: - spin_unlock_bh(lock); - return -1; -} - - static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid, u32 pid, u32 seq, unsigned flags, int event) { @@ -1271,7 +1258,6 @@ subsys_initcall(pktsched_init); -EXPORT_SYMBOL(qdisc_copy_stats); EXPORT_SYMBOL(qdisc_get_rtab); EXPORT_SYMBOL(qdisc_put_rtab); EXPORT_SYMBOL(register_qdisc); From hadi@cyberus.ca Fri Nov 5 07:51:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 07:51:18 -0800 (PST) Received: from mx03.cybersurf.com (mx03.cybersurf.com [209.197.145.106]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5FpCEr029212 for ; Fri, 5 Nov 2004 07:51:12 -0800 Received: from mail.cyberus.ca ([209.197.145.21]) by mx03.cybersurf.com with esmtp (Exim 4.30) id 1CQ6MX-0003Qs-AU for netdev@oss.sgi.com; Fri, 05 Nov 2004 10:50:53 -0500 Received: from [216.209.86.2] (helo=[10.0.0.9]) by mail.cyberus.ca with esmtp (Exim 4.20) id 1CQ6MR-0008Dd-1i; Fri, 05 Nov 2004 10:50:47 -0500 Subject: Re: [PATCH] Use nfmark as a key for u32 classifier From: jamal Reply-To: hadi@cyberus.ca To: "Catalin(ux aka Dino) "BOIE Cc: linux-net@vger.kernel.org, lartc@mailman.ds9a.nl, netdev@oss.sgi.com In-Reply-To: References: Content-Type: text/plain Organization: jamalopolous Message-Id: <1099669841.1026.18.camel@jzny.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 05 Nov 2004 10:50:41 -0500 Content-Transfer-Encoding: 7bit X-archive-position: 11481 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: 1312 Lines: 39 I think this is an ok midterm solution and should be applied. One comment Catalin: Can you resend the patch make this a selectable choice via kconfig? Eventually - we should kill this + the indev choices on u32 and move it up one so that we can have all filters capable of following filters from other classifiers. As a matter of fact we already have this feature but it is a little on the inefficient side at the moment. cheers, jamal On Fri, 2004-11-05 at 06:38, Catalin(ux aka Dino) BOIE wrote: > Hello! > > I am glad to announce a patch for u32 to allow matches on nfmark. > The patch is non intrusive (few lines). > > Why I did this? Because fw classifier cannot be used together with u32. > For example, now, you cannot match a mark of 0x90 and a destination > port of 80. I know you can do it with iptables to do the marking, but if > you use Jamal actions to apply mark to policed packets, you need this. > > All stuff can be found at http://kernel.umbrella.ro/ also. > > Dave, please consider adding this patch. > > Stephen, if Dave accepts the patch, please apply the iproute2 patch. Thank > you. > > Signed-off-by: Catalin(ux aka Dino) BOIE > > Thank you for you time. > --- > Catalin(ux aka Dino) BOIE > catab at deuroconsult.ro > http://kernel.umbrella.ro/ From mcgrof@studorgs.rutgers.edu Fri Nov 5 08:20:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 08:21:01 -0800 (PST) Received: from ruslug.rutgers.edu (studorgs.rutgers.edu [128.6.24.131]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5GKsBv007162 for ; Fri, 5 Nov 2004 08:20:55 -0800 Received: by ruslug.rutgers.edu (Postfix, from userid 503) id 9FC25F9E04; Fri, 5 Nov 2004 11:20:37 -0500 (EST) Date: Fri, 5 Nov 2004 11:20:37 -0500 To: prism54-devel@prism54.org Cc: Netdev , Jouni Malinen Subject: Re: [Prism54-devel] Prism54 AP WPA using Hostap and WDS Message-ID: <20041105162037.GN388@ruslug.rutgers.edu> Mail-Followup-To: prism54-devel@prism54.org, Netdev , Jouni Malinen References: <20041104032219.GU388@ruslug.rutgers.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QDd5rp1wjxlDmy9q" Content-Disposition: inline In-Reply-To: <20041104032219.GU388@ruslug.rutgers.edu> User-Agent: Mutt/1.3.28i X-Operating-System: 2.4.18-1-686 Organization: Rutgers University Student Linux Users Group From: mcgrof@studorgs.rutgers.edu (Luis R. Rodriguez) X-archive-position: 11482 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: mcgrof@studorgs.rutgers.edu Precedence: bulk X-list: netdev Content-Length: 2416 Lines: 75 --QDd5rp1wjxlDmy9q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 03, 2004 at 10:22:19PM -0500, Luis R. Rodriguez wrote: >=20 > I'd like to announce we've received patches to allow for AP WPA > using hostap and complete WDS support. I'd like to thank Bell Kin from > PEK Inc. for contributing this. I'll be reviewing the code now and > integrating what needs to go into CVS. >=20 > WPA STA support is still there -- what can I say, I'm stuck. I believe I > have added most of what needs to be added to the driver for its support > but at this point am having trouble getting the device to work > appropritately. I do believe companies out there do have WPA STA support > for their FullMAC chipsets. I wanted to ask for their support in > reviewing what we have to see if we can finally get this through. >=20 > Thanks, >=20 > Luis Great news, I have reviewed, cleaned up and committed Bell Kin's patches into CVS. Prism54 AP WPA (Version 1) support and WDS support is now complete. I've updated the README and there two new sections: Access Point WPA support (NEW) (requires hostapd) Access Point WDS Support (NEW) I did not have time or a box available to test the code (even to compile). Please help with this. Please read the documentation, and test.= =20 If you find something broken please e-mail prism54-devel and if possible=20 send patches which fixes what's broken even if its documentation. After this has been tested we then can send patches upstream to netdev for kernel inclusion. Please note that Prism54 client/STA suppport has been added but its not yet working. We need help with this from experienced companies that have used the FullMAC and enabled STA WPA support. --- Left on our TODO list are: * fix WPA STA support * move to netif_msg, away from our nasty debug system I say let's work hard on these two and push a new driver release. --- Thanks once again to Bell Kin for from PEK Inc for his contributions. Luis --=20 GnuPG Key fingerprint =3D 113F B290 C6D2 0251 4D84 A34A 6ADD 4937 E20A 525E --QDd5rp1wjxlDmy9q Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFBi6hVat1JN+IKUl4RAm2bAJ9UVWYY+5hTpHvVYsZ8L+8kzBY3ggCfdiss DTta2Avhs3ajwOPtSK+HVF4= =Zorm -----END PGP SIGNATURE----- --QDd5rp1wjxlDmy9q-- From akpm@osdl.org Fri Nov 5 15:29:55 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 15:30:14 -0800 (PST) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5NTtC6023256 for ; Fri, 5 Nov 2004 15:29:55 -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 iA5NQU930292 for ; Fri, 5 Nov 2004 15:26:30 -0800 Date: Fri, 5 Nov 2004 15:30:40 -0800 From: Andrew Morton To: netdev@oss.sgi.com Subject: Fw: [Bugme-new] [Bug 3706] New: Kernel build fails on sungem driver compile. Message-Id: <20041105153040.564f1c2a.akpm@osdl.org> 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: 11483 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: 25687 Lines: 1191 Begin forwarded message: Date: Fri, 5 Nov 2004 14:23:19 -0800 From: bugme-daemon@osdl.org To: bugme-new@lists.osdl.org Subject: [Bugme-new] [Bug 3706] New: Kernel build fails on sungem driver compile. http://bugme.osdl.org/show_bug.cgi?id=3706 Summary: Kernel build fails on sungem driver compile. Kernel Version: 2.6.10-rc1 Status: NEW Severity: blocking Owner: jgarzik@pobox.com Submitter: jathan@gmail.com Distribution: Gentoo 2004.3 Hardware Environment: 2nd Gen PowerMac G5 (2 x 1.8GHz, 160GB HD, 1.5GB RAM) Software Environment: Linux rebot 2.6.9-gentoo-r1 #1 SMP Sat Oct 23 22:34:45 UTC 2004 ppc64 PPC970, altivec supported PowerMac7,3 GNU/Linux Problem Description: Make fails like so: rebot linux-2.6.10-rc1 # make CHK include/linux/version.h make[1]: `arch/ppc64/kernel/asm-offsets.s' is up to date. CHK include/linux/compile.h GEN_INITRAMFS_LIST usr/initramfs_list Using shipped usr/initramfs_list GEN .version CHK include/linux/compile.h UPD include/linux/compile.h CC init/version.o LD init/built-in.o LD .tmp_vmlinux1 drivers/built-in.o(.text+0xc3520): In function `.gem_init_one': : undefined reference to `.get_gem_mac_nonobp' make: *** [.tmp_vmlinux1] Error 1 Steps to reproduce: Try to make using this .config: rebot linux-2.6.10-rc1 # cat .config # # Automatically generated make config: don't edit # Linux kernel version: 2.6.10-rc1 # Fri Nov 5 17:08:31 2004 # CONFIG_64BIT=y CONFIG_MMU=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y CONFIG_GENERIC_ISA_DMA=y CONFIG_HAVE_DEC_LOCK=y CONFIG_EARLY_PRINTK=y CONFIG_COMPAT=y CONFIG_FRAME_POINTER=y CONFIG_FORCE_MAX_ZONEORDER=13 # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y # # General setup # CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_POSIX_MQUEUE is not set # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_LOG_BUF_SHIFT=17 CONFIG_HOTPLUG=y CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_FUTEX=y CONFIG_EPOLL=y # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set CONFIG_SHMEM=y # CONFIG_TINY_SHMEM is not set # # Loadable module support # # CONFIG_MODULES is not set CONFIG_SYSVIPC_COMPAT=y # # Platform support # # CONFIG_PPC_ISERIES is not set CONFIG_PPC_MULTIPLATFORM=y CONFIG_PPC_PSERIES=y # CONFIG_PPC_PMAC is not set CONFIG_PPC=y CONFIG_PPC64=y CONFIG_PPC_OF=y CONFIG_ALTIVEC=y # CONFIG_PPC_SPLPAR is not set # CONFIG_U3_DART is not set # CONFIG_BOOTX_TEXT is not set # CONFIG_POWER4_ONLY is not set # CONFIG_IOMMU_VMERGE is not set CONFIG_SMP=y CONFIG_IRQ_ALL_CPUS=y CONFIG_NR_CPUS=32 # CONFIG_HMT is not set # CONFIG_DISCONTIGMEM is not set # CONFIG_SCHED_SMT is not set # CONFIG_PREEMPT is not set CONFIG_GENERIC_HARDIRQS=y CONFIG_PPC_RTAS=y CONFIG_RTAS_FLASH=y CONFIG_SCANLOG=y CONFIG_LPARCFG=y # # General setup # CONFIG_PCI=y CONFIG_PCI_DOMAINS=y CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_MISC is not set CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y # CONFIG_HOTPLUG_CPU is not set # # PCCARD (PCMCIA/CardBus) support # # CONFIG_PCCARD is not set # # PC-card bridges # # # PCI Hotplug Support # CONFIG_HOTPLUG_PCI=y # CONFIG_HOTPLUG_PCI_FAKE is not set # CONFIG_HOTPLUG_PCI_CPCI is not set # CONFIG_HOTPLUG_PCI_PCIE is not set # CONFIG_HOTPLUG_PCI_SHPC is not set CONFIG_HOTPLUG_PCI_RPA=y CONFIG_HOTPLUG_PCI_RPA_DLPAR=y CONFIG_PROC_DEVICETREE=y # CONFIG_CMDLINE_BOOL is not set # # Device Drivers # # # Generic Driver Options # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=y # CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) # # CONFIG_MTD is not set # # Parallel port support # # CONFIG_PARPORT is not set # # Plug and Play support # # # Block devices # CONFIG_BLK_DEV_FD=y # CONFIG_BLK_CPQ_DA is not set # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set CONFIG_BLK_DEV_LOOP=y # CONFIG_BLK_DEV_CRYPTOLOOP is not set CONFIG_BLK_DEV_NBD=y # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" # CONFIG_CDROM_PKTCDVD is not set # # IO Schedulers # CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y # # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y # # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_IDE_SATA is not set CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set CONFIG_BLK_DEV_IDECD=y # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set # # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_OFFBOARD is not set CONFIG_BLK_DEV_GENERIC=y # CONFIG_BLK_DEV_OPTI621 is not set CONFIG_BLK_DEV_SL82C105=y CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_IDEDMA_FORCED is not set CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set # CONFIG_BLK_DEV_AEC62XX is not set # CONFIG_BLK_DEV_ALI15X3 is not set CONFIG_BLK_DEV_AMD74XX=y # CONFIG_BLK_DEV_CMD64X is not set # CONFIG_BLK_DEV_TRIFLEX is not set # CONFIG_BLK_DEV_CY82C693 is not set # CONFIG_BLK_DEV_CS5520 is not set # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_BLK_DEV_HPT366 is not set # CONFIG_BLK_DEV_SC1200 is not set # CONFIG_BLK_DEV_PIIX is not set # CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_PDC202XX_OLD is not set # CONFIG_BLK_DEV_PDC202XX_NEW is not set # CONFIG_BLK_DEV_SVWKS is not set # CONFIG_BLK_DEV_SIIMAGE is not set # CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set # CONFIG_BLK_DEV_VIA82CXXX is not set # CONFIG_IDE_ARM is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y # CONFIG_BLK_DEV_HD is not set # # SCSI device support # CONFIG_SCSI=y CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=y CONFIG_CHR_DEV_ST=y # CONFIG_CHR_DEV_OSST is not set CONFIG_BLK_DEV_SR=y CONFIG_BLK_DEV_SR_VENDOR=y CONFIG_CHR_DEV_SG=y # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # CONFIG_SCSI_MULTI_LUN=y CONFIG_SCSI_CONSTANTS=y # CONFIG_SCSI_LOGGING is not set # # SCSI Transport Attributes # CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCSI_FC_ATTRS=y # # SCSI low-level drivers # # CONFIG_BLK_DEV_3W_XXXX_RAID is not set # CONFIG_SCSI_3W_9XXX is not set # CONFIG_SCSI_ACARD is not set # CONFIG_SCSI_AACRAID is not set # CONFIG_SCSI_AIC7XXX is not set # CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_AIC79XX is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set # CONFIG_SCSI_SATA is not set # CONFIG_SCSI_BUSLOGIC is not set # CONFIG_SCSI_DMX3191D is not set # CONFIG_SCSI_EATA is not set # CONFIG_SCSI_EATA_PIO is not set # CONFIG_SCSI_FUTURE_DOMAIN is not set # CONFIG_SCSI_GDTH is not set # CONFIG_SCSI_IPS is not set # CONFIG_SCSI_IBMVSCSI is not set # CONFIG_SCSI_INITIO is not set # CONFIG_SCSI_INIA100 is not set CONFIG_SCSI_SYM53C8XX_2=y CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=0 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set # CONFIG_SCSI_IPR is not set # CONFIG_SCSI_QLOGIC_ISP is not set # CONFIG_SCSI_QLOGIC_FC is not set # CONFIG_SCSI_QLOGIC_1280 is not set # CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=y CONFIG_SCSI_QLA21XX=y CONFIG_SCSI_QLA22XX=y CONFIG_SCSI_QLA2300=y CONFIG_SCSI_QLA2322=y CONFIG_SCSI_QLA6312=y CONFIG_SCSI_QLA6322=y # CONFIG_SCSI_DC395x is not set # CONFIG_SCSI_DC390T is not set # CONFIG_SCSI_DEBUG is not set # # Multi-device support (RAID and LVM) # # CONFIG_MD is not set # # Fusion MPT device support # # CONFIG_FUSION is not set # # IEEE 1394 (FireWire) support # # CONFIG_IEEE1394 is not set # # I2O device support # # CONFIG_I2O is not set # # Macintosh device drivers # # # Networking support # CONFIG_NET=y # # Networking options # CONFIG_PACKET=y # CONFIG_PACKET_MMAP is not set # CONFIG_NETLINK_DEV is not set CONFIG_UNIX=y CONFIG_NET_KEY=y CONFIG_INET=y CONFIG_IP_MULTICAST=y # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set CONFIG_NET_IPIP=y # CONFIG_NET_IPGRE is not set # CONFIG_IP_MROUTE is not set # CONFIG_ARPD is not set CONFIG_SYN_COOKIES=y CONFIG_INET_AH=y CONFIG_INET_ESP=y CONFIG_INET_IPCOMP=y CONFIG_INET_TUNNEL=y # # IP: Virtual Server Configuration # # CONFIG_IP_VS is not set # CONFIG_IPV6 is not set CONFIG_NETFILTER=y # CONFIG_NETFILTER_DEBUG is not set # # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=y # CONFIG_IP_NF_CT_ACCT is not set # CONFIG_IP_NF_CONNTRACK_MARK is not set # CONFIG_IP_NF_CT_PROTO_SCTP is not set CONFIG_IP_NF_FTP=y CONFIG_IP_NF_IRC=y CONFIG_IP_NF_TFTP=y CONFIG_IP_NF_AMANDA=y CONFIG_IP_NF_QUEUE=y CONFIG_IP_NF_IPTABLES=y CONFIG_IP_NF_MATCH_LIMIT=y CONFIG_IP_NF_MATCH_IPRANGE=y CONFIG_IP_NF_MATCH_MAC=y CONFIG_IP_NF_MATCH_PKTTYPE=y CONFIG_IP_NF_MATCH_MARK=y CONFIG_IP_NF_MATCH_MULTIPORT=y CONFIG_IP_NF_MATCH_TOS=y CONFIG_IP_NF_MATCH_RECENT=y CONFIG_IP_NF_MATCH_ECN=y CONFIG_IP_NF_MATCH_DSCP=y CONFIG_IP_NF_MATCH_AH_ESP=y CONFIG_IP_NF_MATCH_LENGTH=y CONFIG_IP_NF_MATCH_TTL=y CONFIG_IP_NF_MATCH_TCPMSS=y CONFIG_IP_NF_MATCH_HELPER=y CONFIG_IP_NF_MATCH_STATE=y CONFIG_IP_NF_MATCH_CONNTRACK=y CONFIG_IP_NF_MATCH_OWNER=y # CONFIG_IP_NF_MATCH_ADDRTYPE is not set # CONFIG_IP_NF_MATCH_REALM is not set # CONFIG_IP_NF_MATCH_SCTP is not set # CONFIG_IP_NF_MATCH_COMMENT is not set # CONFIG_IP_NF_MATCH_HASHLIMIT is not set CONFIG_IP_NF_FILTER=y CONFIG_IP_NF_TARGET_REJECT=y CONFIG_IP_NF_TARGET_LOG=y CONFIG_IP_NF_TARGET_ULOG=y CONFIG_IP_NF_TARGET_TCPMSS=y CONFIG_IP_NF_NAT=y CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_NF_TARGET_REDIRECT=y CONFIG_IP_NF_TARGET_NETMAP=y CONFIG_IP_NF_TARGET_SAME=y # CONFIG_IP_NF_NAT_LOCAL is not set CONFIG_IP_NF_NAT_SNMP_BASIC=y CONFIG_IP_NF_NAT_IRC=y CONFIG_IP_NF_NAT_FTP=y CONFIG_IP_NF_NAT_TFTP=y CONFIG_IP_NF_NAT_AMANDA=y CONFIG_IP_NF_MANGLE=y CONFIG_IP_NF_TARGET_TOS=y CONFIG_IP_NF_TARGET_ECN=y CONFIG_IP_NF_TARGET_DSCP=y CONFIG_IP_NF_TARGET_MARK=y CONFIG_IP_NF_TARGET_CLASSIFY=y # CONFIG_IP_NF_RAW is not set CONFIG_IP_NF_ARPTABLES=y CONFIG_IP_NF_ARPFILTER=y CONFIG_IP_NF_ARP_MANGLE=y CONFIG_XFRM=y CONFIG_XFRM_USER=y # # SCTP Configuration (EXPERIMENTAL) # # CONFIG_IP_SCTP is not set # CONFIG_ATM is not set # CONFIG_BRIDGE is not set # CONFIG_VLAN_8021Q is not set # CONFIG_DECNET is not set CONFIG_LLC=y # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # CONFIG_NET_HW_FLOWCONTROL is not set # # QoS and/or fair queueing # # CONFIG_NET_SCHED is not set # CONFIG_NET_CLS_ROUTE is not set # # Network testing # # CONFIG_NET_PKTGEN is not set CONFIG_NETPOLL=y CONFIG_NETPOLL_RX=y CONFIG_NETPOLL_TRAP=y CONFIG_NET_POLL_CONTROLLER=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set # CONFIG_BT is not set CONFIG_NETDEVICES=y CONFIG_DUMMY=y CONFIG_BONDING=y # CONFIG_EQUALIZER is not set CONFIG_TUN=y # # ARCnet devices # # CONFIG_ARCNET is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y CONFIG_MII=y # CONFIG_HAPPYMEAL is not set CONFIG_SUNGEM=y # CONFIG_NET_VENDOR_3COM is not set # # Tulip family network device support # # CONFIG_NET_TULIP is not set # CONFIG_HP100 is not set # CONFIG_IBMVETH is not set CONFIG_NET_PCI=y CONFIG_PCNET32=y # CONFIG_AMD8111_ETH is not set # CONFIG_ADAPTEC_STARFIRE is not set # CONFIG_B44 is not set # CONFIG_FORCEDETH is not set # CONFIG_DGRS is not set # CONFIG_EEPRO100 is not set # CONFIG_E100 is not set # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set # CONFIG_NE2K_PCI is not set # CONFIG_8139CP is not set # CONFIG_8139TOO is not set # CONFIG_SIS900 is not set # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set # CONFIG_VIA_RHINE is not set # CONFIG_VIA_VELOCITY is not set # # Ethernet (1000 Mbit) # CONFIG_ACENIC=y CONFIG_ACENIC_OMIT_TIGON_I=y # CONFIG_DL2K is not set CONFIG_E1000=y # CONFIG_E1000_NAPI is not set # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set # CONFIG_YELLOWFIN is not set # CONFIG_R8169 is not set # CONFIG_SK98LIN is not set CONFIG_TIGON3=y # # Ethernet (10000 Mbit) # CONFIG_IXGB=y # CONFIG_IXGB_NAPI is not set # CONFIG_S2IO is not set # # Token Ring devices # CONFIG_TR=y CONFIG_IBMOL=y # CONFIG_3C359 is not set # CONFIG_TMS380TR is not set # # Wireless LAN (non-hamradio) # # CONFIG_NET_RADIO is not set # # Wan interfaces # # CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set CONFIG_PPP=y # CONFIG_PPP_MULTILINK is not set # CONFIG_PPP_FILTER is not set CONFIG_PPP_ASYNC=y CONFIG_PPP_SYNC_TTY=y CONFIG_PPP_DEFLATE=y CONFIG_PPP_BSDCOMP=y CONFIG_PPPOE=y # CONFIG_SLIP is not set # CONFIG_NET_FC is not set # CONFIG_SHAPER is not set CONFIG_NETCONSOLE=y # # ISDN subsystem # # CONFIG_ISDN is not set # # Telephony Support # # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_INPUT_JOYDEV is not set # CONFIG_INPUT_TSDEV is not set # CONFIG_INPUT_EVDEV is not set # CONFIG_INPUT_EVBUG is not set # # Input I/O drivers # # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y CONFIG_SERIO=y CONFIG_SERIO_I8042=y # CONFIG_SERIO_SERPORT is not set # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set # CONFIG_SERIO_RAW is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=y # CONFIG_MOUSE_SERIAL is not set # CONFIG_MOUSE_VSXXXAA is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set CONFIG_INPUT_MISC=y CONFIG_INPUT_PCSPKR=y # CONFIG_INPUT_UINPUT is not set # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_SERIAL_NONSTANDARD is not set # # Serial drivers # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_NR_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_PMACZILOG is not set # CONFIG_SERIAL_ICOM is not set CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 CONFIG_HVC_CONSOLE=y # CONFIG_HVCS is not set # # IPMI # # CONFIG_IPMI_HANDLER is not set # # Watchdog Cards # # CONFIG_WATCHDOG is not set CONFIG_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # # CONFIG_AGP is not set # CONFIG_DRM is not set CONFIG_RAW_DRIVER=y CONFIG_MAX_RAW_DEVS=256 # # I2C support # CONFIG_I2C=y # CONFIG_I2C_CHARDEV is not set # # I2C Algorithms # CONFIG_I2C_ALGOBIT=y # CONFIG_I2C_ALGOPCF is not set # CONFIG_I2C_ALGOPCA is not set # # I2C Hardware Bus support # # CONFIG_I2C_ALI1535 is not set # CONFIG_I2C_ALI1563 is not set # CONFIG_I2C_ALI15X3 is not set # CONFIG_I2C_AMD756 is not set # CONFIG_I2C_AMD8111 is not set # CONFIG_I2C_I801 is not set # CONFIG_I2C_I810 is not set # CONFIG_I2C_ISA is not set # CONFIG_I2C_NFORCE2 is not set # CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_PROSAVAGE is not set # CONFIG_I2C_SAVAGE4 is not set # CONFIG_SCx200_ACB is not set # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set # CONFIG_I2C_VIA is not set # CONFIG_I2C_VIAPRO is not set # CONFIG_I2C_VOODOO3 is not set # CONFIG_I2C_PCA_ISA is not set # # Hardware Sensors Chip support # # CONFIG_I2C_SENSOR is not set # CONFIG_SENSORS_ADM1021 is not set # CONFIG_SENSORS_ADM1025 is not set # CONFIG_SENSORS_ADM1031 is not set # CONFIG_SENSORS_ASB100 is not set # CONFIG_SENSORS_DS1621 is not set # CONFIG_SENSORS_FSCHER is not set # CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_IT87 is not set # CONFIG_SENSORS_LM75 is not set # CONFIG_SENSORS_LM77 is not set # CONFIG_SENSORS_LM78 is not set # CONFIG_SENSORS_LM80 is not set # CONFIG_SENSORS_LM83 is not set # CONFIG_SENSORS_LM85 is not set # CONFIG_SENSORS_LM87 is not set # CONFIG_SENSORS_LM90 is not set # CONFIG_SENSORS_MAX1619 is not set # CONFIG_SENSORS_SMSC47M1 is not set # CONFIG_SENSORS_VIA686A is not set # CONFIG_SENSORS_W83781D is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83627HF is not set # # Other I2C Chip support # # CONFIG_SENSORS_EEPROM is not set # CONFIG_SENSORS_PCF8574 is not set # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set # CONFIG_I2C_DEBUG_CHIP is not set # # Dallas's 1-wire bus # # CONFIG_W1 is not set # # Misc devices # # # Multimedia devices # # CONFIG_VIDEO_DEV is not set # # Digital Video Broadcasting Devices # # CONFIG_DVB is not set # # Graphics support # CONFIG_FB=y CONFIG_FB_MODE_HELPERS=y # CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set CONFIG_FB_OF=y # CONFIG_FB_CT65550 is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set # CONFIG_FB_VGA16 is not set # CONFIG_FB_RIVA is not set CONFIG_FB_MATROX=y CONFIG_FB_MATROX_MILLENIUM=y CONFIG_FB_MATROX_MYSTIQUE=y CONFIG_FB_MATROX_G450=y CONFIG_FB_MATROX_G100=y # CONFIG_FB_MATROX_I2C is not set CONFIG_FB_MATROX_MULTIHEAD=y # CONFIG_FB_RADEON_OLD is not set CONFIG_FB_RADEON=y CONFIG_FB_RADEON_I2C=y # CONFIG_FB_RADEON_DEBUG is not set # CONFIG_FB_ATY128 is not set # CONFIG_FB_ATY is not set # CONFIG_FB_SIS is not set # CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_KYRO is not set # CONFIG_FB_3DFX is not set # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_TRIDENT is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # # CONFIG_VGA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y # CONFIG_FONTS is not set CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y # # Logo configuration # CONFIG_LOGO=y CONFIG_LOGO_LINUX_MONO=y CONFIG_LOGO_LINUX_VGA16=y CONFIG_LOGO_LINUX_CLUT224=y # # Sound # # CONFIG_SOUND is not set # # USB support # CONFIG_USB=y # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_OTG is not set # # USB Host Controller Drivers # CONFIG_USB_EHCI_HCD=y # CONFIG_USB_EHCI_SPLIT_ISO is not set # CONFIG_USB_EHCI_ROOT_HUB_TT is not set CONFIG_USB_OHCI_HCD=y # CONFIG_USB_UHCI_HCD is not set # # USB Device Class drivers # # CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_RW_DETECT is not set # CONFIG_USB_STORAGE_DATAFAB is not set # CONFIG_USB_STORAGE_FREECOM is not set # CONFIG_USB_STORAGE_ISD200 is not set # CONFIG_USB_STORAGE_DPCM is not set # CONFIG_USB_STORAGE_HP8200e is not set # CONFIG_USB_STORAGE_SDDR09 is not set # CONFIG_USB_STORAGE_SDDR55 is not set # CONFIG_USB_STORAGE_JUMPSHOT is not set # # USB Human Interface Devices (HID) # CONFIG_USB_HID=y CONFIG_USB_HIDINPUT=y # CONFIG_HID_FF is not set CONFIG_USB_HIDDEV=y # CONFIG_USB_AIPTEK is not set # CONFIG_USB_WACOM is not set # CONFIG_USB_KBTAB is not set # CONFIG_USB_POWERMATE is not set # CONFIG_USB_MTOUCH is not set # CONFIG_USB_EGALAX is not set # CONFIG_USB_XPAD is not set # CONFIG_USB_ATI_REMOTE is not set # # USB Imaging devices # # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set # CONFIG_USB_HPUSBSCSI is not set # # USB Multimedia devices # # CONFIG_USB_DABUSB is not set # # Video4Linux support is needed for USB Multimedia device support # # # USB Network adaptors # # CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set # CONFIG_USB_PEGASUS is not set # CONFIG_USB_RTL8150 is not set # CONFIG_USB_USBNET is not set # # USB port drivers # # # USB Serial Converter support # # CONFIG_USB_SERIAL is not set # # USB Miscellaneous drivers # # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set # CONFIG_USB_TIGL is not set # CONFIG_USB_AUERSWALD is not set # CONFIG_USB_RIO500 is not set # CONFIG_USB_LEGOTOWER is not set # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYTHERM is not set # CONFIG_USB_PHIDGETSERVO is not set # CONFIG_USB_TEST is not set # # USB ATM/DSL drivers # # # USB Gadget Support # # CONFIG_USB_GADGET is not set # # File systems # CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y # CONFIG_EXT2_FS_SECURITY is not set CONFIG_EXT3_FS=y CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_POSIX_ACL=y # CONFIG_EXT3_FS_SECURITY is not set CONFIG_JBD=y # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y # CONFIG_REISERFS_FS is not set # CONFIG_JFS_FS is not set CONFIG_FS_POSIX_ACL=y # CONFIG_XFS_FS is not set # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set CONFIG_AUTOFS_FS=y # CONFIG_AUTOFS4_FS is not set # # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=y # CONFIG_JOLIET is not set # CONFIG_ZISOFS is not set CONFIG_UDF_FS=y CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems # CONFIG_FAT_FS=y CONFIG_MSDOS_FS=y CONFIG_VFAT_FS=y CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" # CONFIG_NTFS_FS is not set # # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y CONFIG_DEVFS_FS=y # CONFIG_DEVFS_MOUNT is not set # CONFIG_DEVFS_DEBUG is not set CONFIG_DEVPTS_FS_XATTR=y # CONFIG_DEVPTS_FS_SECURITY is not set CONFIG_TMPFS=y # CONFIG_TMPFS_XATTR is not set CONFIG_HUGETLBFS=y CONFIG_HUGETLB_PAGE=y CONFIG_RAMFS=y # # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set CONFIG_CRAMFS=y # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set # # Network File Systems # # CONFIG_NFS_FS is not set # CONFIG_NFSD is not set # CONFIG_EXPORTFS is not set # CONFIG_SMB_FS is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # # Partition Types # # CONFIG_PARTITION_ADVANCED is not set CONFIG_MSDOS_PARTITION=y # # Native Language Support # CONFIG_NLS=y CONFIG_NLS_DEFAULT="iso8859-1" # CONFIG_NLS_CODEPAGE_437 is not set # CONFIG_NLS_CODEPAGE_737 is not set # CONFIG_NLS_CODEPAGE_775 is not set # CONFIG_NLS_CODEPAGE_850 is not set # CONFIG_NLS_CODEPAGE_852 is not set # CONFIG_NLS_CODEPAGE_855 is not set # CONFIG_NLS_CODEPAGE_857 is not set # CONFIG_NLS_CODEPAGE_860 is not set # CONFIG_NLS_CODEPAGE_861 is not set # CONFIG_NLS_CODEPAGE_862 is not set # CONFIG_NLS_CODEPAGE_863 is not set # CONFIG_NLS_CODEPAGE_864 is not set # CONFIG_NLS_CODEPAGE_865 is not set # CONFIG_NLS_CODEPAGE_866 is not set # CONFIG_NLS_CODEPAGE_869 is not set # CONFIG_NLS_CODEPAGE_936 is not set # CONFIG_NLS_CODEPAGE_950 is not set # CONFIG_NLS_CODEPAGE_932 is not set # CONFIG_NLS_CODEPAGE_949 is not set # CONFIG_NLS_CODEPAGE_874 is not set # CONFIG_NLS_ISO8859_8 is not set # CONFIG_NLS_CODEPAGE_1250 is not set # CONFIG_NLS_CODEPAGE_1251 is not set # CONFIG_NLS_ASCII is not set # CONFIG_NLS_ISO8859_1 is not set # CONFIG_NLS_ISO8859_2 is not set # CONFIG_NLS_ISO8859_3 is not set # CONFIG_NLS_ISO8859_4 is not set # CONFIG_NLS_ISO8859_5 is not set # CONFIG_NLS_ISO8859_6 is not set # CONFIG_NLS_ISO8859_7 is not set # CONFIG_NLS_ISO8859_9 is not set # CONFIG_NLS_ISO8859_13 is not set # CONFIG_NLS_ISO8859_14 is not set # CONFIG_NLS_ISO8859_15 is not set # CONFIG_NLS_KOI8_R is not set # CONFIG_NLS_KOI8_U is not set # CONFIG_NLS_UTF8 is not set # # Profiling support # CONFIG_PROFILING=y CONFIG_OPROFILE=y # # Kernel hacking # CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set # CONFIG_DEBUG_INFO is not set CONFIG_DEBUG_STACKOVERFLOW=y CONFIG_DEBUG_STACK_USAGE=y CONFIG_DEBUGGER=y CONFIG_XMON=y CONFIG_XMON_DEFAULT=y # CONFIG_PPCDBG is not set # CONFIG_IRQSTACKS is not set # # CONFIG_KEYS is not set # CONFIG_SECURITY is not set # # Cryptographic options # CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC=y # CONFIG_CRYPTO_NULL is not set # CONFIG_CRYPTO_MD4 is not set CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_SHA1=y # CONFIG_CRYPTO_SHA256 is not set # CONFIG_CRYPTO_SHA512 is not set # CONFIG_CRYPTO_WP512 is not set CONFIG_CRYPTO_DES=y # CONFIG_CRYPTO_BLOWFISH is not set # CONFIG_CRYPTO_TWOFISH is not set # CONFIG_CRYPTO_SERPENT is not set # CONFIG_CRYPTO_AES is not set # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set # CONFIG_CRYPTO_TEA is not set # CONFIG_CRYPTO_ARC4 is not set # CONFIG_CRYPTO_KHAZAD is not set CONFIG_CRYPTO_DEFLATE=y # CONFIG_CRYPTO_MICHAEL_MIC is not set # CONFIG_CRYPTO_CRC32C is not set # CONFIG_CRYPTO_TEST is not set # # Library routines # CONFIG_CRC_CCITT=y CONFIG_CRC32=y # CONFIG_LIBCRC32C is not set CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is. From raghavendra.koushik@s2io.com Fri Nov 5 15:33:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 15:33:28 -0800 (PST) Received: from ns1.s2io.com (ns1.s2io.com [142.46.200.198]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5NXKFM023666 for ; Fri, 5 Nov 2004 15:33:21 -0800 Received: from guinness.s2io.com (sentry [142.46.200.199]) by ns1.s2io.com (8.12.10/8.12.10) with ESMTP id iA5KPaje009834; Fri, 5 Nov 2004 15:25:36 -0500 (EST) Received: from [10.16.16.112] ([10.16.16.112]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id iA5KPW39002391; Fri, 5 Nov 2004 15:25:32 -0500 (EST) From: koushik Organization: S2IO To: jgarzik@pobox.com, romieu@fr.zoreil.com, netdev@oss.sgi.com Subject: Please ignore the corrupt patches sent earlier. Date: Fri, 5 Nov 2004 05:23:49 -0800 User-Agent: KMail/1.6.2 Cc: leonid.grossman@s2io.com, ravinandan.arakali@s2io.com, raghavendra.koushik@s2io.com, rapuru.sriram@s2io.com, alicia.pena@s2io.com MIME-Version: 1.0 Content-Disposition: inline X-PRIORITY: 2 (High) Priority: urgent Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200411050523.49239.raghavendra.koushik@s2io.com> X-Scanned-By: MIMEDefang 2.34 X-archive-position: 11484 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: raghavendra.koushik@s2io.com Precedence: bulk X-list: netdev Content-Length: 282 Lines: 7 Hi All, I had sent five of my patches with the new mail client, but it seems to have introduced some series of '-' charecters at the end. So please ignore all those 5 mails, I will be sending the series of 12 patches again (hopefully for the last time :-)). With regards Koushik From raghavendra.koushik@s2io.com Fri Nov 5 15:33:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 15:33:32 -0800 (PST) Received: from ns1.s2io.com (ns1.s2io.com [142.46.200.198]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5NXKFS023666 for ; Fri, 5 Nov 2004 15:33:23 -0800 Received: from guinness.s2io.com (sentry [142.46.200.199]) by ns1.s2io.com (8.12.10/8.12.10) with ESMTP id iA5K9Cje009665; Fri, 5 Nov 2004 15:09:12 -0500 (EST) Received: from [10.16.16.112] ([10.16.16.112]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id iA5K9739027614; Fri, 5 Nov 2004 15:09:08 -0500 (EST) From: koushik Organization: S2IO Subject: [PATCH 2.6.9-rc2 4/12] S2io: hardware fixes Date: Fri, 5 Nov 2004 05:07:24 -0800 User-Agent: KMail/1.6.2 To: jgarzik@pobox.com, romieu@fr.zoreil.com, netdev@oss.sgi.com Cc: leonid.grossman@s2io.com, ravinandan.arakali@s2io.com, raghavendra.koushik@s2io.com, rapuru.sriram@s2io.com, alicia.pena@s2io.com MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200411050507.24903.raghavendra.koushik@s2io.com> X-Scanned-By: MIMEDefang 2.34 X-archive-position: 11485 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: raghavendra.koushik@s2io.com Precedence: bulk X-list: netdev Content-Length: 10991 Lines: 334 Hi, Following are the code changes addressing the hardware errata mentioned in user guide. 1. Xena3's with a set of subsystem IDs had Link LED problems, fixed that specifically for them. 2. To write into the Keyed Mac_Cfg register to enable broadcast, writing two 32 bit writes into it along with a write to the key register rather than a single write to key and a 64 bit write to mac_cfg. This is necessary on 32 bit systems where a writeq(64 bit write) is actually two writel (32 bit writes). 3. Writes to some special registers mentioned in UG is being done by a special macro which defines which 32 bits of the 64 bit register is to be written first. Again this applies only on 32 bit systems. 4. Configured pause frame related water marks and a shared_split value which describes the Max TXDMA related split transaction that can be used without giving room for the Rx transactions. 5. The mac_rmac_err_reg R1 register will be cleared in the interrupt handler itself rather than in the scheduled task as was being done previously. 6. Even on PCC_FB_ECC error the card will be reset by disabling adapter enable bit. Signed-off-by: Raghavendra Koushik Signed-off-by: Ravinandan Arakali --- diff -urN vanilla-linux/drivers/net/s2io.c linux-2.6.8.1/drivers/net/s2io.c --- vanilla-linux/drivers/net/s2io.c 2004-10-07 11:44:04.000000000 -0700 +++ linux-2.6.8.1/drivers/net/s2io.c 2004-10-07 11:45:41.000000000 -0700 @@ -71,6 +71,15 @@ static char s2io_driver_name[] = "s2io"; static char s2io_driver_version[] = "Version 1.7.5.1"; +/* + * Cards with following subsystem_id have a link state indication + * problem, 600B, 600C, 600D, 640B, 640C and 640D. + * macro below identifies these cards given the subsystem_id. + */ +#define CARDS_WITH_FAULTY_LINK_INDICATORS(subid) \ + (((subid >= 0x600B) && (subid <= 0x600D)) || \ + ((subid >= 0x640B) && (subid <= 0x640D))) ? 1 : 0 + #define LINK_IS_UP(val64) (!(val64 & (ADAPTER_STATUS_RMAC_REMOTE_FAULT | \ ADAPTER_STATUS_RMAC_LOCAL_FAULT))) #define TASKLET_IN_USE test_and_set_bit(0, \ @@ -563,10 +572,13 @@ schedule_timeout(HZ / 2); /* Enable Receiving broadcasts */ + add = (void *) &bar0->mac_cfg; val64 = readq(&bar0->mac_cfg); val64 |= MAC_RMAC_BCAST_ENABLE; writeq(RMAC_CFG_KEY(0x4C0D), &bar0->rmac_cfg_key); - writeq(val64, &bar0->mac_cfg); + writel((u32) val64, add); + writeq(RMAC_CFG_KEY(0x4C0D), &bar0->rmac_cfg_key); + writel((u32) (val64 >> 32), (add + 4)); /* Read registers in all blocks */ val64 = readq(&bar0->mac_int_mask); @@ -598,8 +610,8 @@ dtx_cnt++; goto mdio_cfg; } - writeq(default_dtx_cfg[dtx_cnt], - &bar0->dtx_control); + SPECIAL_REG_WRITE(default_dtx_cfg[dtx_cnt], + &bar0->dtx_control, UF); val64 = readq(&bar0->dtx_control); dtx_cnt++; } @@ -609,8 +621,8 @@ mdio_cnt++; goto dtx_cfg; } - writeq(default_mdio_cfg[mdio_cnt], - &bar0->mdio_control); + SPECIAL_REG_WRITE(default_mdio_cfg[mdio_cnt], + &bar0->mdio_control, UF); val64 = readq(&bar0->mdio_control); mdio_cnt++; } @@ -873,6 +885,47 @@ writel((u32) (val64 >> 32), (add + 4)); val64 = readq(&bar0->mac_cfg); + /* + * Set the time value to be inserted in the pause frame + * generated by xena. + */ + val64 = readq(&bar0->rmac_pause_cfg); + val64 &= ~(RMAC_PAUSE_HG_PTIME(0xffff)); + val64 |= RMAC_PAUSE_HG_PTIME(nic->mac_control.rmac_pause_time); + writeq(val64, &bar0->rmac_pause_cfg); + + /* + * Set the Threshold Limit for Generating the pause frame + * If the amount of data in any Queue exceeds ratio of + * (mac_control.mc_pause_threshold_q0q3 or q4q7)/256 + * pause frame is generated + */ + val64 = 0; + for (i = 0; i < 4; i++) { + val64 |= + (((u64) 0xFF00 | nic->mac_control. + mc_pause_threshold_q0q3) + << (i * 2 * 8)); + } + writeq(val64, &bar0->mc_pause_thresh_q0q3); + + val64 = 0; + for (i = 0; i < 4; i++) { + val64 |= + (((u64) 0xFF00 | nic->mac_control. + mc_pause_threshold_q4q7) + << (i * 2 * 8)); + } + writeq(val64, &bar0->mc_pause_thresh_q4q7); + + /* + * TxDMA will stop Read request if the number of read split has + * exceeded the limit pointed by shared_splits + */ + val64 = readq(&bar0->pic_control); + val64 |= PIC_CNTL_SHARED_SPLITS(0); + writeq(val64, &bar0->pic_control); + return SUCCESS; } @@ -1227,7 +1280,7 @@ */ val64 = readq(&bar0->mc_rldram_mrs); val64 |= MC_RLDRAM_QUEUE_SIZE_ENABLE | MC_RLDRAM_MRS_ENABLE; - writeq(val64, &bar0->mc_rldram_mrs); + SPECIAL_REG_WRITE(val64, &bar0->mc_rldram_mrs, UF); val64 = readq(&bar0->mc_rldram_mrs); set_current_state(TASK_UNINTERRUPTIBLE); @@ -1291,13 +1344,13 @@ * force link down. Since link is already up, we will get * link state change interrupt after this reset */ - writeq(0x80010515001E0000ULL, &bar0->dtx_control); + SPECIAL_REG_WRITE(0x80010515001E0000ULL, &bar0->dtx_control, UF); val64 = readq(&bar0->dtx_control); udelay(50); - writeq(0x80010515001E00E0ULL, &bar0->dtx_control); + SPECIAL_REG_WRITE(0x80010515001E00E0ULL, &bar0->dtx_control, UF); val64 = readq(&bar0->dtx_control); udelay(50); - writeq(0x80070515001F00E4ULL, &bar0->dtx_control); + SPECIAL_REG_WRITE(0x80070515001F00E4ULL, &bar0->dtx_control, UF); val64 = readq(&bar0->dtx_control); udelay(50); @@ -1884,6 +1937,7 @@ /* Handling link status change error Intr */ err_reg = readq(&bar0->mac_rmac_err_reg); + writeq(err_reg, &bar0->mac_rmac_err_reg); if (err_reg & RMAC_LINK_STATE_CHANGE_INT) { schedule_work(&nic->set_link_task); } @@ -1896,6 +1950,22 @@ schedule_work(&nic->rst_timer_task); } + /* + * Also as mentioned in the latest Errata sheets if the PCC_FB_ECC + * Error occurs, the adapter will be recycled by disabling the + * adapter enable bit and enabling it again after the device + * becomes Quiescent. + */ + val64 = readq(&bar0->pcc_err_reg); + writeq(val64, &bar0->pcc_err_reg); + if (val64 & PCC_FB_ECC_DB_ERR) { + u64 ac = readq(&bar0->adapter_control); + ac &= ~(ADAPTER_CNTL_EN); + writeq(ac, &bar0->adapter_control); + ac = readq(&bar0->adapter_control); + schedule_work(&nic->set_link_task); + } + /* Other type of interrupts are not being handled now, TODO */ } @@ -2870,12 +2940,13 @@ static int s2io_ethtool_idnic(struct net_device *dev, u32 data) { - u64 val64 = 0; + u64 val64 = 0, last_gpio_ctrl_val; nic_t *sp = dev->priv; XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; u16 subid; subid = sp->pdev->subsystem_device; + last_gpio_ctrl_val = readq(&bar0->gpio_control); if ((subid & 0xFF) < 0x07) { val64 = readq(&bar0->adapter_control); if (!(val64 & ADAPTER_CNTL_EN)) { @@ -2897,6 +2968,11 @@ schedule_timeout(MAX_SCHEDULE_TIMEOUT); del_timer_sync(&sp->id_timer); + if (CARDS_WITH_FAULTY_LINK_INDICATORS(subid)) { + writeq(last_gpio_ctrl_val, &bar0->gpio_control); + last_gpio_ctrl_val = readq(&bar0->gpio_control); + } + return 0; } @@ -2983,7 +3059,7 @@ val64 = I2C_CONTROL_DEV_ID(S2IO_DEV_ID) | I2C_CONTROL_ADDR(off) | I2C_CONTROL_BYTE_CNT(0x3) | I2C_CONTROL_READ | I2C_CONTROL_CNTL_START; - writeq(val64, &bar0->i2c_control); + SPECIAL_REG_WRITE(val64, &bar0->i2c_control, LF); while (exit_cnt < 5) { val64 = readq(&bar0->i2c_control); @@ -3024,7 +3100,7 @@ val64 = I2C_CONTROL_DEV_ID(S2IO_DEV_ID) | I2C_CONTROL_ADDR(off) | I2C_CONTROL_BYTE_CNT(cnt) | I2C_CONTROL_SET_DATA(data) | I2C_CONTROL_CNTL_START; - writeq(val64, &bar0->i2c_control); + SPECIAL_REG_WRITE(val64, &bar0->i2c_control, LF); while (exit_cnt < 5) { val64 = readq(&bar0->i2c_control); @@ -3352,10 +3428,10 @@ val64 = readq(&bar0->mc_rldram_mrs); val64 |= MC_RLDRAM_QUEUE_SIZE_ENABLE; - writeq(val64, &bar0->mc_rldram_mrs); + SPECIAL_REG_WRITE(val64, &bar0->mc_rldram_mrs, UF); val64 |= MC_RLDRAM_MRS_ENABLE; - writeq(val64, &bar0->mc_rldram_mrs); + SPECIAL_REG_WRITE(val64, &bar0->mc_rldram_mrs, UF); while (iteration < 2) { val64 = 0x55555555aaaa0000ULL; @@ -3757,8 +3833,10 @@ nic_t *nic = (nic_t *) data; struct net_device *dev = nic->dev; XENA_dev_config_t *bar0 = (XENA_dev_config_t *) nic->bar0; - register u64 val64, err_reg; + register u64 val64; + u16 subid; + subid = nic->pdev->subsystem_device; /* * Allow a small delay for the NICs self initiated * cleanup to complete. @@ -3768,16 +3846,19 @@ val64 = readq(&bar0->adapter_status); if (verify_xena_quiescence(val64, nic->device_enabled_once)) { - /* Acknowledge Intr and clear R1 register. */ - err_reg = readq(&bar0->mac_rmac_err_reg); - writeq(err_reg, &bar0->mac_rmac_err_reg); - if (LINK_IS_UP(val64)) { val64 = readq(&bar0->adapter_control); val64 |= ADAPTER_CNTL_EN; writeq(val64, &bar0->adapter_control); - val64 |= ADAPTER_LED_ON; - writeq(val64, &bar0->adapter_control); + if (CARDS_WITH_FAULTY_LINK_INDICATORS(subid)) { + val64 = readq(&bar0->gpio_control); + val64 |= GPIO_CTRL_GPIO_0; + writeq(val64, &bar0->gpio_control); + val64 = readq(&bar0->gpio_control); + } else { + val64 |= ADAPTER_LED_ON; + writeq(val64, &bar0->adapter_control); + } val64 = readq(&bar0->adapter_status); if (!LINK_IS_UP(val64)) { DBG_PRINT(ERR_DBG, "%s:", dev->name); @@ -3791,6 +3872,12 @@ } s2io_link(nic, LINK_UP); } else { + if (CARDS_WITH_FAULTY_LINK_INDICATORS(subid)) { + val64 = readq(&bar0->gpio_control); + val64 &= ~GPIO_CTRL_GPIO_0; + writeq(val64, &bar0->gpio_control); + val64 = readq(&bar0->gpio_control); + } s2io_link(nic, LINK_DOWN); } } else { /* NIC is not Quiescent. */ @@ -3917,6 +4004,7 @@ return SUCCESS; } + /** * s2io_link - stops/starts the Tx queue. * @sp : private member of the device structure, which is a pointer to the diff -urN vanilla-linux/drivers/net/s2io.h linux-2.6.8.1/drivers/net/s2io.h --- vanilla-linux/drivers/net/s2io.h 2004-10-07 11:44:04.000000000 -0700 +++ linux-2.6.8.1/drivers/net/s2io.h 2004-10-08 15:20:09.316690064 -0700 @@ -693,6 +693,27 @@ writel((u32) (val), addr); writel((u32) (val >> 32), (addr + 4)); } + +/* In 32 bit modes, some registers have to be written in a + * particular order to expect correct hardware operation. The + * macro SPECIAL_REG_WRITE is used to perform such ordered + * writes. Defines UF (Upper First) and LF (Lower First) will + * be used to specify the required write order. + */ +#define UF 1 +#define LF 2 +static inline void SPECIAL_REG_WRITE(u64 val, void *addr, int order) +{ + if (order == LF) { + writel((u32) (val), addr); + writel((u32) (val >> 32), (addr + 4)); + } else { + writel((u32) (val >> 32), (addr + 4)); + writel((u32) (val), addr); + } +} +#else +#define SPECIAL_REG_WRITE(val, addr, dummy) writeq(val, addr) #endif /* Interrupt related values of Xena */ ------------------------------------------------------- From raghavendra.koushik@s2io.com Fri Nov 5 15:33:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 15:33:35 -0800 (PST) Received: from ns1.s2io.com (ns1.s2io.com [142.46.200.198]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5NXKFU023666 for ; Fri, 5 Nov 2004 15:33:24 -0800 Received: from guinness.s2io.com (sentry [142.46.200.199]) by ns1.s2io.com (8.12.10/8.12.10) with ESMTP id iA5K9lje009677; Fri, 5 Nov 2004 15:09:47 -0500 (EST) Received: from [10.16.16.112] ([10.16.16.112]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id iA5K9h39027735; Fri, 5 Nov 2004 15:09:43 -0500 (EST) From: koushik Organization: S2IO Subject: [PATCH 2.6.9-rc2 5/12] S2io: module loadable parameters Date: Fri, 5 Nov 2004 05:08:00 -0800 User-Agent: KMail/1.6.2 To: jgarzik@pobox.com, romieu@fr.zoreil.com, netdev@oss.sgi.com Cc: leonid.grossman@s2io.com, ravinandan.arakali@s2io.com, raghavendra.koushik@s2io.com, rapuru.sriram@s2io.com, alicia.pena@s2io.com MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200411050508.00919.raghavendra.koushik@s2io.com> X-Scanned-By: MIMEDefang 2.34 X-archive-position: 11488 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: raghavendra.koushik@s2io.com Precedence: bulk X-list: netdev Content-Length: 21480 Lines: 672 Hi, This patch adds/modifies the following module loadable parameters. 1. Max Txds per List. 2. statistics refresh time 3. pause frame control parameters including gap between two successive frames, threshold watermarks 4. RTI and TTI configuration parameters including ranges, packet counts and timeout periods. For further information please read the section 3.5 of XFrame H/W spec. 5. PCI/PCI-X configuration variables latency_timer, MMRBC and OST. 6. OS offload features TSO (If support available) and checksum offload. 7. If NAPI is not in use, a variable indicate_max_pkts can be used to limit number of Rx side packets processed for one call to Rx Intr handler. Signed-off-by: Raghavendra Koushik Signed-off-by: Ravinandan Arakali --- diff -urN vanilla-linux/drivers/net/s2io.c linux-2.6.8.1/drivers/net/s2io.c --- vanilla-linux/drivers/net/s2io.c 2004-10-11 15:33:35.000000000 -0700 +++ linux-2.6.8.1/drivers/net/s2io.c 2004-10-11 15:34:23.000000000 -0700 @@ -223,14 +223,66 @@ }; /* Module Loadable parameters. */ -static u32 ring_num; static u32 frame_len[MAX_RX_RINGS]; -static u32 ring_len[MAX_RX_RINGS]; -static u32 fifo_num; -static u32 fifo_len[MAX_TX_FIFOS]; static u32 rx_prio; static u32 tx_prio; -static u8 latency_timer; + +static unsigned int lso_enable = 1; +#ifndef CONFIG_S2IO_NAPI +static unsigned int indicate_max_pkts; +#endif +static unsigned int cksum_offload_enable = 1; +static unsigned int tx_fifo_num = 1; +static unsigned int tx_fifo_len_0 = DEFAULT_FIFO_LEN; +static unsigned int tx_fifo_len_1; +static unsigned int tx_fifo_len_2; +static unsigned int tx_fifo_len_3; +static unsigned int tx_fifo_len_4; +static unsigned int tx_fifo_len_5; +static unsigned int tx_fifo_len_6; +static unsigned int tx_fifo_len_7; +static unsigned int max_txds = MAX_SKB_FRAGS; +static unsigned int rx_ring_num = 1; +static unsigned int rx_ring_sz_0 = SMALL_BLK_CNT; +static unsigned int rx_ring_sz_1; +static unsigned int rx_ring_sz_2; +static unsigned int rx_ring_sz_3; +static unsigned int rx_ring_sz_4; +static unsigned int rx_ring_sz_5; +static unsigned int rx_ring_sz_6; +static unsigned int rx_ring_sz_7; +static unsigned int Stats_refresh_time = 4; +static unsigned int rmac_pause_time = 65535; +static unsigned int mc_pause_threshold_q0q3 = 187; +static unsigned int mc_pause_threshold_q4q7 = 187; +static unsigned int shared_splits; +#if defined(__ia64__) +static unsigned int max_splits_trans = XENA_THREE_SPLIT_TRANSACTION; +#else +static unsigned int max_splits_trans = XENA_TWO_SPLIT_TRANSACTION; +#endif +static unsigned int tmac_util_period = 5; +static unsigned int rmac_util_period = 5; +static unsigned int tx_timer_val = 0xFFF; +static unsigned int tx_utilz_periodic = 1; +static unsigned int rx_timer_val = 0xFFF; +static unsigned int rx_utilz_periodic = 1; +static unsigned int tx_urange_a = 0xA; +static unsigned int tx_ufc_a = 0x10; +static unsigned int tx_urange_b = 0x10; +static unsigned int tx_ufc_b = 0x20; +static unsigned int tx_urange_c = 0x30; +static unsigned int tx_ufc_c = 0x40; +static unsigned int tx_ufc_d = 0x80; +static unsigned int rx_urange_a = 0xA; +static unsigned int rx_ufc_a = 0x1; +static unsigned int rx_urange_b = 0x10; +static unsigned int rx_ufc_b = 0x2; +static unsigned int rx_urange_c = 0x30; +static unsigned int rx_ufc_c = 0x40; +static unsigned int rx_ufc_d = 0x80; +static u8 latency_timer = 0xf8; +static u8 max_read_byte_cnt = 2; /* * S2IO device table. @@ -782,14 +834,16 @@ /* Enable statistics */ writeq(mac_control->stats_mem_phy, &bar0->stat_addr); - val64 = SET_UPDT_PERIOD(8) | STAT_CFG_STAT_RO | STAT_CFG_STAT_EN; + val64 = SET_UPDT_PERIOD(Stats_refresh_time) | + STAT_CFG_STAT_RO | STAT_CFG_STAT_EN; writeq(val64, &bar0->stat_cfg); /* * Initializing the sampling rate for the device to calculate the * bandwidth utilization. */ - val64 = MAC_TX_LINK_UTIL_VAL(0x5) | MAC_RX_LINK_UTIL_VAL(0x5); + val64 = MAC_TX_LINK_UTIL_VAL(tmac_util_period) | + MAC_RX_LINK_UTIL_VAL(rmac_util_period); writeq(val64, &bar0->mac_link_util); @@ -798,14 +852,18 @@ * Scheme. */ /* TTI Initialization */ - val64 = TTI_DATA1_MEM_TX_TIMER_VAL(0xFFF) | - TTI_DATA1_MEM_TX_URNG_A(0xA) | TTI_DATA1_MEM_TX_URNG_B(0x10) | - TTI_DATA1_MEM_TX_URNG_C(0x30) | TTI_DATA1_MEM_TX_TIMER_AC_EN; + val64 = TTI_DATA1_MEM_TX_TIMER_VAL(tx_timer_val) | + TTI_DATA1_MEM_TX_URNG_A(tx_urange_a) | + TTI_DATA1_MEM_TX_URNG_B(tx_urange_b) | + TTI_DATA1_MEM_TX_URNG_C(tx_urange_c); + if (tx_utilz_periodic) + val64 |= TTI_DATA1_MEM_TX_TIMER_AC_EN; writeq(val64, &bar0->tti_data1_mem); - val64 = - TTI_DATA2_MEM_TX_UFC_A(0x10) | TTI_DATA2_MEM_TX_UFC_B(0x20) | - TTI_DATA2_MEM_TX_UFC_C(0x40) | TTI_DATA2_MEM_TX_UFC_D(0x80); + val64 = TTI_DATA2_MEM_TX_UFC_A(tx_ufc_a) | + TTI_DATA2_MEM_TX_UFC_B(tx_ufc_b) | + TTI_DATA2_MEM_TX_UFC_C(tx_ufc_c) | + TTI_DATA2_MEM_TX_UFC_D(tx_ufc_d); writeq(val64, &bar0->tti_data2_mem); val64 = TTI_CMD_MEM_WE | TTI_CMD_MEM_STROBE_NEW_CMD; @@ -834,13 +892,19 @@ } /* RTI Initialization */ - val64 = RTI_DATA1_MEM_RX_TIMER_VAL(0xFFF) | - RTI_DATA1_MEM_RX_URNG_A(0xA) | RTI_DATA1_MEM_RX_URNG_B(0x10) | - RTI_DATA1_MEM_RX_URNG_C(0x30) | RTI_DATA1_MEM_RX_TIMER_AC_EN; + val64 = RTI_DATA1_MEM_RX_TIMER_VAL(rx_timer_val) | + RTI_DATA1_MEM_RX_URNG_A(rx_urange_a) | + RTI_DATA1_MEM_RX_URNG_B(rx_urange_b) | + RTI_DATA1_MEM_RX_URNG_C(rx_urange_c); + if (rx_utilz_periodic) + val64 |= RTI_DATA1_MEM_RX_TIMER_AC_EN; + writeq(val64, &bar0->rti_data1_mem); - val64 = RTI_DATA2_MEM_RX_UFC_A(0x1) | RTI_DATA2_MEM_RX_UFC_B(0x2) | - RTI_DATA2_MEM_RX_UFC_C(0x40) | RTI_DATA2_MEM_RX_UFC_D(0x80); + val64 = RTI_DATA2_MEM_RX_UFC_A(rx_ufc_a) | + RTI_DATA2_MEM_RX_UFC_B(rx_ufc_b) | + RTI_DATA2_MEM_RX_UFC_C(rx_ufc_c) | + RTI_DATA2_MEM_RX_UFC_D(rx_ufc_d); writeq(val64, &bar0->rti_data2_mem); val64 = RTI_CMD_MEM_WE | RTI_CMD_MEM_STROBE_NEW_CMD; @@ -923,7 +987,7 @@ * exceeded the limit pointed by shared_splits */ val64 = readq(&bar0->pic_control); - val64 |= PIC_CNTL_SHARED_SPLITS(0); + val64 |= PIC_CNTL_SHARED_SPLITS(shared_splits); writeq(val64, &bar0->pic_control); return SUCCESS; @@ -1381,7 +1445,7 @@ for (i = 0; i < config->tx_fifo_num; i++) { for (j = 0; j < config->tx_cfg[i].fifo_len - 1; j++) { txdp = mac_control->txdl_start[i] + - (config->max_txds * j); + (config->max_txds * j); skb = (struct sk_buff *) ((unsigned long) txdp-> Host_Control); @@ -1807,7 +1871,12 @@ mac_control->rx_curr_get_info[i].offset = offset_info.offset; pkt_cnt++; + if ((indicate_max_pkts) + && (pkt_cnt > indicate_max_pkts)) + break; } + if ((indicate_max_pkts) && (pkt_cnt > indicate_max_pkts)) + break; } } #endif @@ -4004,7 +4073,6 @@ return SUCCESS; } - /** * s2io_link - stops/starts the Tx queue. * @sp : private member of the device structure, which is a pointer to the @@ -4088,17 +4156,23 @@ &latency_timer); } - /* Set MMRB count to 4096 in PCI-X Command register. */ + /* Set MMRB count to 2048 in PCI-X Command register. */ + sp->pcix_cmd &= 0xFFF3; pci_write_config_word(sp->pdev, PCIX_COMMAND_REGISTER, - (sp->pcix_cmd | 0x0C)); + (sp->pcix_cmd | (max_read_byte_cnt << 2))); pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER, &(sp->pcix_cmd)); /* Setting Maximum outstanding splits based on system type. */ sp->pcix_cmd &= 0xFF8F; - sp->pcix_cmd |= - XENA_MAX_OUTSTANDING_SPLITS(XENA_TWO_SPLIT_TRANSACTION); + sp->pcix_cmd |= XENA_MAX_OUTSTANDING_SPLITS(max_splits_trans); + pci_write_config_word(sp->pdev, PCIX_COMMAND_REGISTER, + sp->pcix_cmd); + pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER, + &(sp->pcix_cmd)); + /* Forcibly disabling relaxed ordering capability of the card. */ + sp->pcix_cmd &= 0xfffd; pci_write_config_word(sp->pdev, PCIX_COMMAND_REGISTER, sp->pcix_cmd); pci_read_config_word(sp->pdev, PCIX_COMMAND_REGISTER, @@ -4107,14 +4181,58 @@ MODULE_AUTHOR("Raghavendra Koushik "); MODULE_LICENSE("GPL"); -MODULE_PARM(ring_num, "1-" __MODULE_STRING(1) "i"); -MODULE_PARM(frame_len, "1-" __MODULE_STRING(8) "i"); -MODULE_PARM(ring_len, "1-" __MODULE_STRING(8) "i"); -MODULE_PARM(fifo_num, "1-" __MODULE_STRING(1) "i"); -MODULE_PARM(fifo_len, "1-" __MODULE_STRING(8) "i"); -MODULE_PARM(rx_prio, "1-" __MODULE_STRING(1) "i"); -MODULE_PARM(tx_prio, "1-" __MODULE_STRING(1) "i"); -MODULE_PARM(latency_timer, "1-" __MODULE_STRING(1) "i"); +MODULE_PARM(lso_enable, "i"); +#ifndef CONFIG_S2IO_NAPI +MODULE_PARM(indicate_max_pkts, "i"); +#endif +MODULE_PARM(cksum_offload_enable, "i"); +MODULE_PARM(tx_fifo_num, "i"); +MODULE_PARM(tx_fifo_len_0, "i"); +MODULE_PARM(tx_fifo_len_1, "i"); +MODULE_PARM(tx_fifo_len_2, "i"); +MODULE_PARM(tx_fifo_len_3, "i"); +MODULE_PARM(tx_fifo_len_4, "i"); +MODULE_PARM(tx_fifo_len_5, "i"); +MODULE_PARM(tx_fifo_len_6, "i"); +MODULE_PARM(tx_fifo_len_7, "i"); +MODULE_PARM(max_txds, "i"); +MODULE_PARM(rx_ring_num, "i"); +MODULE_PARM(rx_ring_sz_0, "i"); +MODULE_PARM(rx_ring_sz_1, "i"); +MODULE_PARM(rx_ring_sz_2, "i"); +MODULE_PARM(rx_ring_sz_3, "i"); +MODULE_PARM(rx_ring_sz_4, "i"); +MODULE_PARM(rx_ring_sz_5, "i"); +MODULE_PARM(rx_ring_sz_6, "i"); +MODULE_PARM(rx_ring_sz_7, "i"); +MODULE_PARM(Stats_refresh_time, "i"); +MODULE_PARM(rmac_pause_time, "i"); +MODULE_PARM(mc_pause_threshold_q0q3, "i"); +MODULE_PARM(mc_pause_threshold_q4q7, "i"); +MODULE_PARM(shared_splits, "i"); +MODULE_PARM(max_splits_trans, "i"); +MODULE_PARM(tmac_util_period, "i"); +MODULE_PARM(rmac_util_period, "i"); +MODULE_PARM(tx_timer_val, "i"); +MODULE_PARM(tx_utilz_periodic, "i"); +MODULE_PARM(rx_timer_val, "i"); +MODULE_PARM(rx_utilz_periodic, "i"); +MODULE_PARM(tx_urange_a, "i"); +MODULE_PARM(tx_ufc_a, "i"); +MODULE_PARM(tx_urange_b, "i"); +MODULE_PARM(tx_ufc_b, "i"); +MODULE_PARM(tx_urange_c, "i"); +MODULE_PARM(tx_ufc_c, "i"); +MODULE_PARM(tx_ufc_d, "i"); +MODULE_PARM(rx_urange_a, "i"); +MODULE_PARM(rx_ufc_a, "i"); +MODULE_PARM(rx_urange_b, "i"); +MODULE_PARM(rx_ufc_b, "i"); +MODULE_PARM(rx_urange_c, "i"); +MODULE_PARM(rx_ufc_c, "i"); +MODULE_PARM(rx_ufc_d, "i"); +MODULE_PARM(latency_timer, "i"); +MODULE_PARM(max_read_byte_cnt, "i"); /** * s2io_init_nic - Initialization of the adapter . * @pdev : structure containing the PCI related information of the device. @@ -4215,33 +4333,23 @@ config = &sp->config; /* Tx side parameters. */ - config->tx_fifo_num = fifo_num ? fifo_num : 1; - - if (!fifo_len[0] && (fifo_num > 1)) { - printk(KERN_ERR "Fifo Lens not specified for all FIFOs\n"); - goto init_failed; - } - - if (fifo_len[0]) { - int cnt; - - for (cnt = 0; fifo_len[cnt]; cnt++); - if (fifo_num) { - if (cnt < fifo_num) { - printk(KERN_ERR - "Fifo Lens not specified for "); - printk(KERN_ERR "all FIFOs\n"); - goto init_failed; - } - } - for (cnt = 0; cnt < config->tx_fifo_num; cnt++) { - config->tx_cfg[cnt].fifo_len = fifo_len[cnt]; - config->tx_cfg[cnt].fifo_priority = cnt; - } - } else { - config->tx_cfg[0].fifo_len = DEFAULT_FIFO_LEN; - config->tx_cfg[0].fifo_priority = 0; - } + config->tx_fifo_num = tx_fifo_num; + config->tx_cfg[0].fifo_len = tx_fifo_len_0; + config->tx_cfg[0].fifo_priority = 0; + config->tx_cfg[1].fifo_len = tx_fifo_len_1; + config->tx_cfg[1].fifo_priority = 1; + config->tx_cfg[2].fifo_len = tx_fifo_len_2; + config->tx_cfg[2].fifo_priority = 2; + config->tx_cfg[3].fifo_len = tx_fifo_len_3; + config->tx_cfg[3].fifo_priority = 3; + config->tx_cfg[4].fifo_len = tx_fifo_len_4; + config->tx_cfg[4].fifo_priority = 4; + config->tx_cfg[5].fifo_len = tx_fifo_len_5; + config->tx_cfg[5].fifo_priority = 5; + config->tx_cfg[6].fifo_len = tx_fifo_len_6; + config->tx_cfg[6].fifo_priority = 6; + config->tx_cfg[7].fifo_len = tx_fifo_len_7; + config->tx_cfg[7].fifo_priority = 7; config->tx_intr_type = TXD_INT_TYPE_UTILZ; for (i = 0; i < config->tx_fifo_num; i++) { @@ -4255,27 +4363,34 @@ config->max_txds = MAX_SKB_FRAGS; /* Rx side parameters. */ - config->rx_ring_num = ring_num ? ring_num : 1; + config->rx_ring_num = rx_ring_num; + config->rx_cfg[0].num_rxd = rx_ring_sz_0 * (MAX_RXDS_PER_BLOCK + 1); + config->rx_cfg[0].ring_priority = 0; + config->rx_cfg[1].num_rxd = rx_ring_sz_1 * (MAX_RXDS_PER_BLOCK + 1); + config->rx_cfg[1].ring_priority = 1; + config->rx_cfg[2].num_rxd = rx_ring_sz_2 * (MAX_RXDS_PER_BLOCK + 1); + config->rx_cfg[2].ring_priority = 2; + config->rx_cfg[3].num_rxd = rx_ring_sz_3 * (MAX_RXDS_PER_BLOCK + 1); + config->rx_cfg[3].ring_priority = 3; + config->rx_cfg[4].num_rxd = rx_ring_sz_4 * (MAX_RXDS_PER_BLOCK + 1); + config->rx_cfg[4].ring_priority = 4; + config->rx_cfg[5].num_rxd = rx_ring_sz_5 * (MAX_RXDS_PER_BLOCK + 1); + config->rx_cfg[5].ring_priority = 5; + config->rx_cfg[6].num_rxd = rx_ring_sz_6 * (MAX_RXDS_PER_BLOCK + 1); + config->rx_cfg[6].ring_priority = 6; + config->rx_cfg[7].num_rxd = rx_ring_sz_7 * (MAX_RXDS_PER_BLOCK + 1); + config->rx_cfg[7].ring_priority = 7; - if (ring_len[0]) { - int cnt; - for (cnt = 0; cnt < config->rx_ring_num; cnt++) { - config->rx_cfg[cnt].num_rxd = ring_len[cnt]; - config->rx_cfg[cnt].ring_priority = cnt; - } - } else { - config->rx_cfg[0].num_rxd = SMALL_RXD_CNT; - config->rx_cfg[0].ring_priority = 0; - } - - for (i = 0; i < config->rx_ring_num; i++) { + for (i = 0; i < rx_ring_num; i++) { config->rx_cfg[i].ring_org = RING_ORG_BUFF1; config->rx_cfg[i].f_no_snoop = (NO_SNOOP_RXD | NO_SNOOP_RXD_BUFFER); } /* Setting Mac Control parameters */ - mac_control->rmac_pause_time = 0; + mac_control->rmac_pause_time = rmac_pause_time; + mac_control->mc_pause_threshold_q0q3 = mc_pause_threshold_q0q3; + mac_control->mc_pause_threshold_q4q7 = mc_pause_threshold_q4q7; /* Initialize Ring buffer parameters. */ @@ -4334,11 +4449,14 @@ dev->weight = 90; /* For now. */ #endif - dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM; + dev->features |= NETIF_F_SG; + if (cksum_offload_enable) + dev->features |= NETIF_F_IP_CSUM; if (sp->high_dma_flag == TRUE) dev->features |= NETIF_F_HIGHDMA; #ifdef NETIF_F_TSO - dev->features |= NETIF_F_TSO; + if (lso_enable) + dev->features |= NETIF_F_TSO; #endif dev->tx_timeout = &s2io_tx_watchdog; @@ -4453,7 +4571,6 @@ bar0_remap_failed: mem_alloc_failed: free_shared_mem(sp); - init_failed: pci_disable_device(pdev); pci_release_regions(pdev); pci_set_drvdata(pdev, NULL); @@ -4503,6 +4620,8 @@ int __init s2io_starter(void) { + if (verify_load_parm()) + return -ENODEV; return pci_module_init(&s2io_driver); } @@ -4519,3 +4638,223 @@ module_init(s2io_starter); module_exit(s2io_closer); +/** + * verify_load_parm - verifies the module loadable parameters + * Descriptions: Verifies the module loadable parameters and initializes the + * Tx Fifo, Rx Ring and other paramters. + */ + +int verify_load_parm() +{ + int fail = 0; + if (!((lso_enable == 0) || (lso_enable == 1))) { + printk("lso_enable can be either '1' or '0'\n"); + fail = 1; + } +#ifndef CONFIG_S2IO_NAPI + if ((indicate_max_pkts > (0xFFFFFFFF))) { + printk + ("indicate_max_pkts can take value greater than zero but less than 2power(32)\n"); + fail = 1; + } +#endif + if (!((cksum_offload_enable == 0) || (cksum_offload_enable == 1))) { + printk("cksum_offload_enable can be only '0' or '1' \n"); + fail = 1; + } + if ((tx_fifo_num == 0) || (tx_fifo_num > 8)) { + printk("tx_fifo_num can take value from 1 to 8\n"); + fail = 1; + } + switch (tx_fifo_num) { + case 8: + if ((tx_fifo_len_7 == 0) || tx_fifo_len_7 > 8192) { + printk + ("tx_fifo_len_7 can take value from 1 to 8192\n"); + fail = 1; + } + case 7: + if ((tx_fifo_len_6 == 0) || tx_fifo_len_6 > 8192) { + printk + ("tx_fifo_len_6 can take value from 1 to 8192\n"); + fail = 1; + } + case 6: + if ((tx_fifo_len_5 == 0) || tx_fifo_len_5 > 8192) { + printk + ("tx_fifo_len_5 can take value from 1 to 8192\n"); + fail = 1; + } + case 5: + if ((tx_fifo_len_4 == 0) || tx_fifo_len_4 > 8192) { + printk + ("tx_fifo_len_4 can take value from 1 to 8192\n"); + fail = 1; + } + case 4: + if ((tx_fifo_len_3 == 0) || tx_fifo_len_3 > 8192) { + printk + ("tx_fifo_len_3 can take value from 1 to 8192\n"); + fail = 1; + } + case 3: + if ((tx_fifo_len_2 == 0) || tx_fifo_len_2 > 8192) { + printk + ("tx_fifo_len_2 can take value from 1 to 8192\n"); + fail = 1; + } + case 2: + if ((tx_fifo_len_1 == 0) || tx_fifo_len_1 > 8192) { + printk + ("tx_fifo_len_1 can take value from 1 to 8192\n"); + fail = 1; + } + case 1: + if ((tx_fifo_len_0 == 0) || tx_fifo_len_0 > 8192) { + printk + ("tx_fifo_len_0 can take value from 1 to 8192\n"); + fail = 1; + } + } + if ((max_txds > 32) || (max_txds < 1)) { + printk("max_txds can take value from 1 to 32\n"); + fail = 1; + } + if ((rx_ring_num > 8) || (rx_ring_num < 1)) { + printk("rx_ring_num can take value from 1 to 8\n"); + fail = 1; + } + switch (rx_ring_num) { + case 8: + if (rx_ring_sz_7 < 1) { + printk + ("rx_ring_sz_7 can take value greater than 0\n"); + fail = 1; + } + case 7: + if (rx_ring_sz_6 < 1) { + printk + ("rx_ring_sz_6 can take value greater than 0\n"); + fail = 1; + } + case 6: + if (rx_ring_sz_5 < 1) { + printk + ("rx_ring_sz_5 can take value greater than 0\n"); + fail = 1; + } + case 5: + if (rx_ring_sz_4 < 1) { + printk + ("rx_ring_sz_4 can take value greater than 0\n"); + fail = 1; + } + case 4: + if (rx_ring_sz_3 < 1) { + printk + ("rx_ring_sz_3 can take value greater than 0\n"); + fail = 1; + } + case 3: + if (rx_ring_sz_2 < 1) { + printk + ("rx_ring_sz_2 can take value greater than 0\n"); + fail = 1; + } + case 2: + if (rx_ring_sz_1 < 1) { + printk + ("rx_ring_sz_1 can take value greater than 0\n"); + fail = 1; + } + case 1: + if (rx_ring_sz_0 < 1) { + printk + ("rx_ring_sz_0 can take value greater than 0\n"); + fail = 1; + } + } + if ((Stats_refresh_time < 1)) { + printk + ("Stats_refresh_time cannot be less than 1 second \n"); + fail = 1; + } + if (((rmac_pause_time < 0x10) && (rmac_pause_time != 0)) || + (rmac_pause_time > 0xFFFF)) { + printk + ("rmac_pause_time can take value from 16 to 65535\n"); + fail = 1; + } + if (max_splits_trans > 7) { + printk("max_splits_trans can take value from 0 to 7\n"); + fail = 1; + } + if ((mc_pause_threshold_q0q3 > 0xFE)) { + printk("mc_pause_threshold_q0q3 cannot exceed 254\n"); + fail = 1; + } + if ((mc_pause_threshold_q4q7 > 0xFE)) { + printk("mc_pause_threshold_q4q7 cannot exceed 254\n"); + fail = 1; + } + if ((latency_timer) + && ((latency_timer < 8) || (latency_timer > 255))) { + printk("latency_timer can take value from 8 to 255\n"); + fail = 1; + } + if (max_read_byte_cnt > 3) { + printk("max_read_byte_cnt can take value from 0 to 3\n"); + fail = 1; + } + if (shared_splits > 31) { + printk("shared_splits cannot exceed 31\n"); + fail = 1; + } + if (rmac_util_period > 0xF) { + printk("rmac_util_period cannot exceed 15\n"); + fail = 1; + } + if (tmac_util_period > 0xF) { + printk("tmac_util_period cannot exceed 15\n"); + fail = 1; + } + if ((tx_utilz_periodic > 1) || (rx_utilz_periodic > 1)) { + printk + ("tx_utilz_periodic & rx_utilz_periodic can be either " + "'0' or '1'\n"); + fail = 1; + } + if (((tx_urange_a > 100) || (tx_urange_b > 100) || + (tx_urange_c > 100)) || (tx_urange_a > tx_urange_b) + || (tx_urange_b > tx_urange_c)) { + printk + ("tx_urange_a, tx_urange_b & tx_urange_c can take value " + "from 0 to 100 and range_a can't exceed range_b " + "neither can range_b exceed range_c\n"); + fail = 1; + } + if (((rx_urange_a > 100) || (rx_urange_b > 100) || + (rx_urange_c > 100)) || (rx_urange_a > rx_urange_b) + || (rx_urange_b > rx_urange_c)) { + printk + ("rx_urange_a, rx_urange_b & rx_urange_c can take value " + "from 0 to 100 and range_a can't exceed range_b " + "neither can range_b exceed range_c\n"); + fail = 1; + } + if ((tx_ufc_a > 0xffff) || (tx_ufc_b > 0xffff) || + (tx_ufc_c > 0xffff) || (tx_ufc_d > 0xffff)) { + printk + (" tx_ufc_a, tx_ufc_b, tx_ufc_c, tx_ufc_d can take value" + "from 0 to 65535(0xFFFF)\n"); + fail = 1; + } + if ((rx_ufc_a > 0xffff) || (rx_ufc_b > 0xffff) || + (rx_ufc_c > 0xffff) || (rx_ufc_d > 0xffff)) { + printk + (" rx_ufc_a, rx_ufc_b, rx_ufc_c, rx_ufc_d can take value" + "from 0 to 65535(0xFFFF)\n"); + fail = 1; + } + return fail; +} diff -urN vanilla-linux/drivers/net/s2io.h linux-2.6.8.1/drivers/net/s2io.h --- vanilla-linux/drivers/net/s2io.h 2004-10-11 15:33:35.000000000 -0700 +++ linux-2.6.8.1/drivers/net/s2io.h 2004-10-11 15:34:23.000000000 -0700 @@ -348,9 +348,9 @@ u8 ring_priority; /*Specifies service priority of ring */ /* OSM should not set any two rings with same priority */ u8 ring_org; /*Organization of ring */ -#define RING_ORG_BUFF1 0x01 -#define RX_RING_ORG_BUFF3 0x03 -#define RX_RING_ORG_BUFF5 0x05 +#define RING_ORG_BUFF1 0x01 +#define RX_RING_ORG_BUFF3 0x03 +#define RX_RING_ORG_BUFF5 0x05 u8 f_no_snoop; #define NO_SNOOP_RXD 0x01 ------------------------------------------------------- From raghavendra.koushik@s2io.com Fri Nov 5 15:33:23 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 15:33:33 -0800 (PST) Received: from ns1.s2io.com (ns1.s2io.com [142.46.200.198]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5NXKFQ023666 for ; Fri, 5 Nov 2004 15:33:23 -0800 Received: from guinness.s2io.com (sentry [142.46.200.199]) by ns1.s2io.com (8.12.10/8.12.10) with ESMTP id iA5K85je009652; Fri, 5 Nov 2004 15:08:05 -0500 (EST) Received: from [10.16.16.112] ([10.16.16.112]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id iA5K8139027510; Fri, 5 Nov 2004 15:08:01 -0500 (EST) From: koushik Organization: S2IO Subject: [PATCH 2.6.9-rc2 3/12] S2io: optimizations Date: Fri, 5 Nov 2004 05:06:18 -0800 User-Agent: KMail/1.6.2 To: jgarzik@pobox.com, romieu@fr.zoreil.com, netdev@oss.sgi.com Cc: leonid.grossman@s2io.com, ravinandan.arakali@s2io.com, raghavendra.koushik@s2io.com, rapuru.sriram@s2io.com, alicia.pena@s2io.com MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200411050506.18749.raghavendra.koushik@s2io.com> X-Scanned-By: MIMEDefang 2.34 X-archive-position: 11487 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: raghavendra.koushik@s2io.com Precedence: bulk X-list: netdev Content-Length: 6893 Lines: 238 Hi, Following are the optimization-related changes made in this patch. 1. Definitions of LOW and PANIC levels of the Rx buffers have changed. 2. In wait_for_cmd_complete there is no longer a writeq but just a read and wait for strobe bit to reset. 3. In s2io_isr, the isr_lock has been done away with also the NICs interrupt are no longer disabled explicitly on entering the interrupt handler and re-enabled again before leaving it. 4. Also clearing the semaphore "tasklet_status" when exiting erroneously from s2io_isr after failing fill_rx_buffer call. 5. The set/reset Tx Csum function through ethtool was added to the ethtool_ops structure. 6. Added a Rx side error code in the rx_osm_handler function. 7. No longer stopping and waking Tx queue when link state changes in s2io_link function. 8. removed the isr_lock spinlock from the s2io_nic structure. 9. changed parameters which determine thresholds(LOW and PANIC) to replenish Rx buffers. This has been found to result in better performance. Signed-off-by: Raghavendra Koushik Signed-off-by: Ravinandan Arakali --- diff -urN vanilla-linux/drivers/net/s2io.c linux-2.6.8.1/drivers/net/s2io.c --- vanilla-linux/drivers/net/s2io.c 2004-10-06 17:24:02.000000000 -0700 +++ linux-2.6.8.1/drivers/net/s2io.c 2004-10-06 17:37:32.751003528 -0700 @@ -80,10 +80,11 @@ static inline int rx_buffer_level(nic_t * sp, int rxb_size, int ring) { int level = 0; - if ((sp->pkt_cnt[ring] - rxb_size) > 128) { + if ((sp->pkt_cnt[ring] - rxb_size) > 16) { level = LOW; - if (rxb_size < sp->pkt_cnt[ring] / 8) + if ((sp->pkt_cnt[ring] - rxb_size) < MAX_RXDS_PER_BLOCK) { level = PANIC; + } } return level; @@ -1916,12 +1917,8 @@ u64 val64; while (TRUE) { - val64 = - RMAC_ADDR_CMD_MEM_RD | RMAC_ADDR_CMD_MEM_STROBE_NEW_CMD - | RMAC_ADDR_CMD_MEM_OFFSET(0); - writeq(val64, &bar0->rmac_addr_cmd_mem); val64 = readq(&bar0->rmac_addr_cmd_mem); - if (!val64) { + if (!(val64 & RMAC_ADDR_CMD_MEM_STROBE_CMD_EXECUTING)) { ret = SUCCESS; break; } @@ -2192,14 +2189,11 @@ register u64 val64 = 0; u16 cnt = 0; - spin_lock(&sp->isr_lock); netif_stop_queue(dev); /* disable Tx and Rx traffic on the NIC */ stop_nic(sp); - spin_unlock(&sp->isr_lock); - /* * If the device tasklet is running, wait till its done * before killing it @@ -2398,15 +2392,13 @@ struct net_device *dev = (struct net_device *) dev_id; nic_t *sp = dev->priv; XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; - u64 reason = 0, general_mask = 0; + u64 reason = 0; mac_info_t *mac_control; struct config_param *config; mac_control = &sp->mac_control; config = &sp->config; - spin_lock(&sp->isr_lock); - /* * Identify the cause for interrupt and call the appropriate * interrupt handler. Causes for the interrupt could be; @@ -2419,14 +2411,9 @@ if (!reason) { /* The interrupt was not raised by Xena. */ - spin_unlock(&sp->isr_lock); return IRQ_NONE; } - /* Mask the Interrupts on the NIC. */ - general_mask = readq(&bar0->general_int_mask); - writeq(0xFFFFFFFFFFFFFFFFULL, &bar0->general_int_mask); - /* If Intr is because of Tx Traffic */ if (reason & GEN_INTR_TXTRAFFIC) { tx_intr_handler(sp); @@ -2441,11 +2428,6 @@ if (netif_rx_schedule_prep(dev)) { en_dis_able_nic_intrs(sp, RX_TRAFFIC_INTR, DISABLE_INTRS); - /* - * Here we take a snap shot of the general - * Intr Register. - */ - general_mask = readq(&bar0->general_int_mask); __netif_rx_schedule(dev); } } @@ -2481,9 +2463,9 @@ "%s:Out of memory", dev->name); DBG_PRINT(ERR_DBG, " in ISR!!\n"); - writeq(general_mask, - &bar0->general_int_mask); - spin_unlock(&sp->isr_lock); + clear_bit(0, + (unsigned long *) (&sp-> + tasklet_status)); return IRQ_HANDLED; } clear_bit(0, @@ -2501,10 +2483,6 @@ tasklet_schedule(&sp->task); #endif - /* Unmask all previously enabled interrupts on the NIC. */ - writeq(general_mask, &bar0->general_int_mask); - - spin_unlock(&sp->isr_lock); return IRQ_HANDLED; } @@ -3626,6 +3604,17 @@ return (S2IO_STAT_LEN); } +int s2io_ethtool_op_set_tx_csum(struct net_device *dev, u32 data) +{ + if (data) + dev->features |= NETIF_F_IP_CSUM; + else + dev->features &= ~NETIF_F_IP_CSUM; + + return 0; +} + + static struct ethtool_ops netdev_ethtool_ops = { .get_settings = s2io_ethtool_gset, .set_settings = s2io_ethtool_sset, @@ -3641,7 +3630,7 @@ .get_rx_csum = s2io_ethtool_get_rx_csum, .set_rx_csum = s2io_ethtool_set_rx_csum, .get_tx_csum = ethtool_op_get_tx_csum, - .set_tx_csum = ethtool_op_set_tx_csum, + .set_tx_csum = s2io_ethtool_op_set_tx_csum, .get_sg = ethtool_op_get_sg, .set_sg = ethtool_op_set_sg, #ifdef NETIF_F_TSO @@ -3902,6 +3891,12 @@ skb->ip_summed = CHECKSUM_NONE; } + if (rxdp->Control_1 & RXD_T_CODE) { + unsigned long long err = rxdp->Control_1 & RXD_T_CODE; + DBG_PRINT(ERR_DBG, "%s: Rx error Value: 0x%llx\n", + dev->name, err); + } + skb->dev = dev; skb_put(skb, len); skb->protocol = eth_type_trans(skb, dev); @@ -3922,25 +3917,6 @@ return SUCCESS; } -int check_for_tx_space(nic_t * sp) -{ - u32 put_off, get_off, queue_len; - int ret = TRUE, i; - - for (i = 0; i < sp->config.tx_fifo_num; i++) { - queue_len = sp->mac_control.tx_curr_put_info[i].fifo_len - + 1; - put_off = sp->mac_control.tx_curr_put_info[i].offset; - get_off = sp->mac_control.tx_curr_get_info[i].offset; - if (((put_off + 1) % queue_len) == get_off) { - ret = FALSE; - break; - } - } - - return ret; -} - /** * s2io_link - stops/starts the Tx queue. * @sp : private member of the device structure, which is a pointer to the @@ -3962,17 +3938,9 @@ if (link == LINK_DOWN) { DBG_PRINT(ERR_DBG, "%s: Link down\n", dev->name); netif_carrier_off(dev); - netif_stop_queue(dev); } else { DBG_PRINT(ERR_DBG, "%s: Link Up\n", dev->name); netif_carrier_on(dev); - if (check_for_tx_space(sp) == TRUE) { - /* - * Dont wake the queue if we know there - * are no free TxDs available. - */ - netif_wake_queue(dev); - } } } sp->last_link_state = link; @@ -4357,7 +4325,6 @@ /* Initialize spinlocks */ spin_lock_init(&sp->tx_lock); - spin_lock_init(&sp->isr_lock); /* * SXE-002: Configure link and activity LED to init state diff -urN vanilla-linux/drivers/net/s2io.h linux-2.6.8.1/drivers/net/s2io.h --- vanilla-linux/drivers/net/s2io.h 2004-10-06 17:24:05.000000000 -0700 +++ linux-2.6.8.1/drivers/net/s2io.h 2004-10-06 17:37:47.532756360 -0700 @@ -612,7 +612,6 @@ atomic_t rx_bufs_left[MAX_RX_RINGS]; spinlock_t tx_lock; - spinlock_t isr_lock; #define PROMISC 1 #define ALL_MULTI 2 ------------------------------------------------------- From raghavendra.koushik@s2io.com Fri Nov 5 15:33:22 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 15:33:33 -0800 (PST) Received: from ns1.s2io.com (ns1.s2io.com [142.46.200.198]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5NXKFO023666 for ; Fri, 5 Nov 2004 15:33:22 -0800 Received: from guinness.s2io.com (sentry [142.46.200.199]) by ns1.s2io.com (8.12.10/8.12.10) with ESMTP id iA5K7Rje009648; Fri, 5 Nov 2004 15:07:27 -0500 (EST) Received: from [10.16.16.112] ([10.16.16.112]) by guinness.s2io.com (8.12.6/8.12.6) with ESMTP id iA5K7O39027384; Fri, 5 Nov 2004 15:07:25 -0500 (EST) From: koushik Organization: S2IO Subject: [PATCH 2.6.9-rc2 2/12] S2io: sw bug fixes Date: Fri, 5 Nov 2004 05:05:41 -0800 User-Agent: KMail/1.6.2 To: jgarzik@pobox.com, romieu@fr.zoreil.com, netdev@oss.sgi.com Cc: leonid.grossman@s2io.com, ravinandan.arakali@s2io.com, raghavendra.koushik@s2io.com, rapuru.sriram@s2io.com, alicia.pena@s2io.com MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200411050505.41343.raghavendra.koushik@s2io.com> X-Scanned-By: MIMEDefang 2.34 X-archive-position: 11486 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: raghavendra.koushik@s2io.com Precedence: bulk X-list: netdev Content-Length: 6159 Lines: 216 Hi, Attached is the second patch in this submission. It contains the following software bug fixes. 1. In free_rx_buffers clearing out RxDs not owned by Xena. 2. In alarm_intr_handler, when a serr error occurs, schedule a task to reset the card rather than stopping Tx queue. 3. In s2io_close freeing IRQ before calling s2io_reset also added a new call to flush queued tasks. This is not done if the s2io_close itself is called from a queued task like s2io_restart_nic. 4. read_eeprom function has been changed such that data to be returned is sent as an input argument and the return value represents a pass/fail. The previous implementation as Randy had pointed out was error prone as on failure it returned -1 which can be interpreted as all ff's, so any data area which contained ff's in the eeprom was likely to be treated as an error. 5. Added a flag "task_flag" to track if the call to s2io_close is coming from the s2io_restart_nic function or from the ifconfig down called by user. 6. Moved register_netdev call from just after setting entry points to the end of the s2io_init_nic function. 7. In s2io.h field added a new member into the s2io_nic structure called "task_flag". Signed-off-by: Raghavendra Koushik Signed-off-by: Ravinandan Arakali --- diff -urN vanilla-linux/drivers/net/s2io.c linux-2.6.8.1/drivers/net/s2io.c --- vanilla-linux/drivers/net/s2io.c 2004-10-06 15:18:10.000000000 -0700 +++ linux-2.6.8.1/drivers/net/s2io.c 2004-10-06 16:19:52.821420504 -0700 @@ -1525,6 +1525,11 @@ blk++; } + if (!(rxdp->Control_1 & RXD_OWN_XENA)) { + memset(rxdp, 0, sizeof(RxD_t)); + continue; + } + skb = (struct sk_buff *) ((unsigned long) rxdp-> Host_Control); @@ -1887,7 +1892,7 @@ if (val64 & SERR_SOURCE_ANY) { DBG_PRINT(ERR_DBG, "%s: Device indicates ", dev->name); DBG_PRINT(ERR_DBG, "serious error!!\n"); - netif_stop_queue(dev); + schedule_work(&nic->rst_timer_task); } /* Other type of interrupts are not being handled now, TODO */ @@ -2205,6 +2210,17 @@ } tasklet_kill(&sp->task); + /* Free the Registered IRQ */ + free_irq(dev->irq, dev); + + /* Flush all scheduled tasks */ + if (sp->task_flag == 1) { + DBG_PRINT(INFO_DBG, "%s: Calling close from a task\n", + dev->name); + } else { + flush_scheduled_work(); + } + /* Check if the device is Quiescent and then Reset the NIC */ do { val64 = readq(&bar0->adapter_status); @@ -2225,9 +2241,6 @@ } while (1); s2io_reset(sp); - /* Free the Registered IRQ */ - free_irq(dev->irq, dev); - /* Free all Tx Buffers waiting for transmission */ free_tx_buffers(sp); @@ -2982,9 +2995,10 @@ */ #define S2IO_DEV_ID 5 -static u32 read_eeprom(nic_t * sp, int off) +static int read_eeprom(nic_t * sp, int off, u32 * data) { - u32 data = -1, exit_cnt = 0; + int ret = -1; + u32 exit_cnt = 0; u64 val64; XENA_dev_config_t *bar0 = (XENA_dev_config_t *) sp->bar0; @@ -2996,7 +3010,8 @@ while (exit_cnt < 5) { val64 = readq(&bar0->i2c_control); if (I2C_CONTROL_CNTL_END(val64)) { - data = I2C_CONTROL_GET_DATA(val64); + *data = I2C_CONTROL_GET_DATA(val64); + ret = 0; break; } set_current_state(TASK_UNINTERRUPTIBLE); @@ -3004,7 +3019,7 @@ exit_cnt++; } - return data; + return ret; } /** @@ -3073,8 +3088,7 @@ eeprom->len = XENA_EEPROM_SPACE - eeprom->offset; for (i = 0; i < eeprom->len; i += 4) { - data = read_eeprom(sp, eeprom->offset + i); - if (data < 0) { + if (read_eeprom(sp, (eeprom->offset + i), &data)) { DBG_PRINT(ERR_DBG, "Read of EEPROM failed\n"); return -EFAULT; } @@ -3213,7 +3227,8 @@ static int s2io_eeprom_test(nic_t * sp, uint64_t * data) { - int fail = 0, ret_data; + int fail = 0; + u32 ret_data; /* Test Write Error at offset 0 */ if (!write_eeprom(sp, 0, 0, 3)) @@ -3222,7 +3237,7 @@ /* Test Write at offset 4f0 */ if (write_eeprom(sp, 0x4F0, 0x01234567, 3)) fail = 1; - if ((ret_data = read_eeprom(sp, 0x4F0)) < 0) + if (read_eeprom(sp, 0x4F0, &ret_data)) fail = 1; if (ret_data != 0x01234567) @@ -3238,7 +3253,7 @@ /* Test Write Request at offset 0x7fc */ if (write_eeprom(sp, 0x7FC, 0x01234567, 3)) fail = 1; - if ((ret_data = read_eeprom(sp, 0x7FC)) < 0) + if (read_eeprom(sp, 0x7FC, &ret_data)) fail = 1; if (ret_data != 0x01234567) @@ -3811,7 +3826,9 @@ struct net_device *dev = (struct net_device *) data; nic_t *sp = dev->priv; + sp->task_flag = 1; s2io_close(dev); + sp->task_flag = 0; sp->device_close_flag = TRUE; s2io_open(dev); DBG_PRINT(ERR_DBG, @@ -4275,18 +4292,13 @@ INIT_WORK(&sp->set_link_task, (void (*)(void *)) s2io_set_link, sp); - if (register_netdev(dev)) { - DBG_PRINT(ERR_DBG, "Device registration failed\n"); - goto register_failed; - } - pci_save_state(sp->pdev, sp->config_space); /* Setting swapper control on the NIC, for proper reset operation */ if (s2io_set_swapper(sp)) { DBG_PRINT(ERR_DBG, "%s:swapper settings are wrong\n", dev->name); - goto register_failed; + goto set_swap_failed; } /* Fix for all "FFs" MAC address problems observed on Alpha platforms */ @@ -4363,6 +4375,11 @@ sp->rx_csum = 1; /* Rx chksum verify enabled by default */ + if (register_netdev(dev)) { + DBG_PRINT(ERR_DBG, "Device registration failed\n"); + goto register_failed; + } + /* * Make Link state as off at this point, when the Link change * interrupt comes the state will be automatically changed to @@ -4373,9 +4390,8 @@ return 0; - set_swap_failed: - unregister_netdev(dev); register_failed: + set_swap_failed: iounmap(sp->bar1); bar1_remap_failed: iounmap(sp->bar0); diff -urN vanilla-linux/drivers/net/s2io.h linux-2.6.8.1/drivers/net/s2io.h --- vanilla-linux/drivers/net/s2io.h 2004-10-06 15:15:03.000000000 -0700 +++ linux-2.6.8.1/drivers/net/s2io.h 2004-10-06 16:19:52.829419288 -0700 @@ -668,6 +668,8 @@ u16 last_link_state; #define LINK_DOWN 1 #define LINK_UP 2 + + int task_flag; } nic_t; #define RESET_ERROR 1; ------------------------------------------------------- From herbert@gondor.apana.org.au Fri Nov 5 15:36:12 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 15:36:21 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5NaAU1025365 for ; Fri, 5 Nov 2004 15:36:12 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1CQDcR-0003nT-00; Sat, 06 Nov 2004 10:35:47 +1100 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1CQDcP-0003ff-00; Sat, 06 Nov 2004 10:35:45 +1100 From: Herbert Xu To: kaber@trash.net (Patrick McHardy) Subject: Re: request_module while holding rtnl semaphore Cc: netdev@oss.sgi.com Organization: Core In-Reply-To: <41899DCF.3050804@trash.net> X-Newsgroups: apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.4.27-hx-1-686-smp (i686)) Message-Id: Date: Sat, 06 Nov 2004 10:35:45 +1100 X-archive-position: 11489 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 1431 Lines: 33 Patrick McHardy wrote: > There are several instances of request_module beeing called while > holding the rtnl semaphore in net/sched. A pratical problem with > this is the teql scheduler which deadlocks when calling register_netdev > from its init function. A more far-fetched problem would be some crazy > person with their modules in a nfs-mounted directory on a server > reachable over a dial-on-demand link. I couldn't come up with a > solution except for refusing to autoload teql, maybe someone else has > an idea. There are a couple of causes for this problem: 1) Abuse of the rtnl. It's being used for too many things. It's basically the networking system's BKL. If the locking were more granular then this shouldn't occur. 2) Hooking random net/sched requests into rtnetlink. By being an rtnetlink user you pay the price of taking the rtnl. Most of the net/sched stuff has nothing to do with rtnetlink. You know it because they all live in AF_UNSPEC :) Tackling either problem would lead to a solution to the dead-lock. However, neither is trivial to solve. On a related note, I'm working on making it easier to add new netlink families which could lead to a solution to 2. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt From kaber@trash.net Fri Nov 5 15:37:18 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 15:37:23 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5NbGa7025696 for ; Fri, 5 Nov 2004 15:37:17 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CQBty-0002o8-Kn; Fri, 05 Nov 2004 22:45:46 +0100 Message-ID: <418BF48A.5060707@trash.net> Date: Fri, 05 Nov 2004 22:45:46 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: netdev@oss.sgi.com Subject: [PATCH 2.6 PKT_SCHED]: Fix rcu_assign_pointer fallout, use it in the right place Content-Type: multipart/mixed; boundary="------------010107060405000301040302" X-archive-position: 11490 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 2960 Lines: 90 This is a multi-part message in MIME format. --------------010107060405000301040302 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit The patch "RCU: use rcu_assign_pointer()" http://linux.bkbits.net:8080/linux-2.6/diffs/net/sched/sch_api.c@1.39?nav=index.html|src/net/|src/net|src/net/sched|related/net/sched/sch_api.c|cset@1.2287 changed a list_add_tail to list_add_tail_rcu in qdisc_create. It's dev->qdisc not dev->qdisc_list that is protected by RCU, this patch reverts that change. It also removes a misleading comment and replaces the smp_wmb in qdisc_create_dflt by rcu_assign_pointer in dev_activate to document more clearly what is protected. Regards Patrick --------------010107060405000301040302 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/05 22:14:18+01:00 kaber@coreworks.de # [PKT_SCHED]: Fix rcu_assign_pointer fallout, use it in the right place # # Signed-off-by: Patrick McHardy # # net/sched/sch_generic.c # 2004/11/05 22:14:08+01:00 kaber@coreworks.de +5 -7 # [PKT_SCHED]: Fix rcu_assign_pointer fallout, use it in the right place # # Signed-off-by: Patrick McHardy # # net/sched/sch_api.c # 2004/11/05 22:14:08+01:00 kaber@coreworks.de +2 -4 # [PKT_SCHED]: Fix rcu_assign_pointer fallout, use it in the right place # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/sch_api.c b/net/sched/sch_api.c --- a/net/sched/sch_api.c 2004-11-05 22:29:06 +01:00 +++ b/net/sched/sch_api.c 2004-11-05 22:29:06 +01:00 @@ -451,11 +451,9 @@ else sch->handle = handle; - /* enqueue is accessed locklessly - make sure it's visible - * before we set a netdevice's qdisc pointer to sch */ if (!ops->init || (err = ops->init(sch, tca[TCA_OPTIONS-1])) == 0) { qdisc_lock_tree(dev); - list_add_tail_rcu(&sch->list, &dev->qdisc_list); + list_add_tail(&sch->list, &dev->qdisc_list); qdisc_unlock_tree(dev); #ifdef CONFIG_NET_ESTIMATOR diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c --- a/net/sched/sch_generic.c 2004-11-05 22:29:06 +01:00 +++ b/net/sched/sch_generic.c 2004-11-05 22:29:06 +01:00 @@ -436,9 +436,6 @@ dev_hold(dev); sch->stats_lock = &dev->queue_lock; atomic_set(&sch->refcnt, 1); - /* enqueue is accessed locklessly - make sure it's visible - * before we set a netdevice's qdisc pointer to sch */ - smp_wmb(); if (!ops->init || ops->init(sch, NULL) == 0) return sch; @@ -519,7 +516,8 @@ } spin_lock_bh(&dev->queue_lock); - if ((dev->qdisc = dev->qdisc_sleeping) != &noqueue_qdisc) { + rcu_assign_pointer(dev->qdisc, dev->qdisc_sleeping); + if (dev->qdisc != &noqueue_qdisc) { dev->trans_start = jiffies; dev_watchdog_up(dev); } --------------010107060405000301040302-- From kaber@trash.net Fri Nov 5 15:37:24 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 15:37:31 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5NbNUa025708 for ; Fri, 5 Nov 2004 15:37:24 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CQ8fm-0000Qo-Vz; Fri, 05 Nov 2004 19:18:54 +0100 Message-ID: <418BC40E.8080402@trash.net> Date: Fri, 05 Nov 2004 19:18:54 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: Thomas Graf CC: davem@davemloft.net, netdev@oss.sgi.com, spam@crocom.com.pl, kuznet@ms2.inr.ac.ru, jmorris@redhat.com Subject: Re: [PATCH] PKT_SCHED: Initialize list field in dummy qdiscs References: <418B4C7C.8000402@crocom.com.pl> <20041105115430.GP19714@rei.reeler.org> <418B4C7C.8000402@crocom.com.pl> <20041105141640.GQ19714@rei.reeler.org> <418BA66A.60804@trash.net> <20041105163951.GY12289@postel.suug.ch> <418BB7D2.6060908@trash.net> <20041105175812.GZ12289@postel.suug.ch> In-Reply-To: <20041105175812.GZ12289@postel.suug.ch> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11491 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 2222 Lines: 76 Thomas Graf wrote: >* Patrick McHardy <418BB7D2.6060908@trash.net> 2004-11-05 18:26 > > >>ops->put seems to be safe even without holding dev->queue_lock. >>The class refcnt is only changed from userspace, and always under >>the rtnl semaphore. get/put are always balanced, so pratically a >>class can never get destroyed by put. >> >> > >You are right, this cannot be the problem. However, there is a >potential risk in qdisc_destroy if dev->queue_lock is not held. > > Yes, but there doesn't seem to be a path where this is true. >I'm not sure but aren't all callers to qdisc_destroy holding >qdisc_lock_tree(dev) such as dev_shutdown a potential risk to >deadlocks because __qdisc_destroy tries to lock again? > > __qdisc_destroy is called from a rcu-callback, not directly from qdisc_destroy. >>Either refcnt them or add add some kind of flag to qdiscs created >>by qdisc_create/qdisc_create_default and check for that flag. >>Initializing the lists doesn't fix all problems, directly using >>noop/noqueue doesn't increment the device refcnt, so is must not >>be dropped it __qdisc_destroy. >> >> > >I was irritated by the TCQ_F_BUILTIN check in __qdisc_destroy. None >of the code in __qdisc_destroy should be applied to a builtin qdisc >or am I missing something? > > No, your patch looks fine. Regards Patrick >The patch below prevents builtin qdiscs from being destroyed and >fixes a refcnt underflow whould lead to a bogus list unlinking >and dev_put. > >Signed-off-by: Thomas Graf > >--- linux-2.6.10-rc1-bk14.orig/net/sched/sch_generic.c 2004-11-05 18:44:49.000000000 +0100 >+++ linux-2.6.10-rc1-bk14/net/sched/sch_generic.c 2004-11-05 18:43:52.000000000 +0100 >@@ -479,15 +479,15 @@ > module_put(ops->owner); > > dev_put(qdisc->dev); >- if (!(qdisc->flags&TCQ_F_BUILTIN)) >- kfree((char *) qdisc - qdisc->padded); >+ kfree((char *) qdisc - qdisc->padded); > } > > /* Under dev->queue_lock and BH! */ > > void qdisc_destroy(struct Qdisc *qdisc) > { >- if (!atomic_dec_and_test(&qdisc->refcnt)) >+ if (qdisc->flags & TCQ_F_BUILTIN || >+ !atomic_dec_and_test(&qdisc->refcnt)) > return; > list_del(&qdisc->list); > call_rcu(&qdisc->q_rcu, __qdisc_destroy); > > > > From kaber@trash.net Fri Nov 5 15:37:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 15:37:35 -0800 (PST) Received: from kaber.coreworks.de ([62.206.217.67]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5NbUIl025731 for ; Fri, 5 Nov 2004 15:37:30 -0800 Received: from localhost ([127.0.0.1] ident=kaber) by kaber.coreworks.de with esmtp (Exim 4.34) id 1CQA2Z-0001yQ-Fg; Fri, 05 Nov 2004 20:46:31 +0100 Message-ID: <418BD897.5000409@trash.net> Date: Fri, 05 Nov 2004 20:46:31 +0100 From: Patrick McHardy User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.3) Gecko/20041008 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: "David S. Miller" CC: Thomas Graf , netdev@oss.sgi.com Subject: [PATCH 2.4]: Don't try to destroy builtin qdiscs Content-Type: multipart/mixed; boundary="------------030606070008030700090802" X-archive-position: 11492 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: kaber@trash.net Precedence: bulk X-list: netdev Content-Length: 1556 Lines: 61 This is a multi-part message in MIME format. --------------030606070008030700090802 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Backported from Thomas's patch, we also need this for 2.4. --------------030606070008030700090802 Content-Type: text/plain; name="x" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="x" # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/11/05 20:44:30+01:00 kaber@coreworks.de # [PKT_SCHED]: Don't try to destroy builtin qdiscs # # Backported from Thomas Graf's fix for 2.6. # # Signed-off-by: Patrick McHardy # # net/sched/sch_generic.c # 2004/11/05 20:44:28+01:00 kaber@coreworks.de +3 -3 # [PKT_SCHED]: Don't try to destroy builtin qdiscs # # Backported from Thomas Graf's fix for 2.6. # # Signed-off-by: Patrick McHardy # diff -Nru a/net/sched/sch_generic.c b/net/sched/sch_generic.c --- a/net/sched/sch_generic.c 2004-11-05 20:44:43 +01:00 +++ b/net/sched/sch_generic.c 2004-11-05 20:44:43 +01:00 @@ -423,7 +423,8 @@ { struct Qdisc_ops *ops = qdisc->ops; - if (!atomic_dec_and_test(&qdisc->refcnt)) + if (qdisc->flags&TCQ_F_BUILTIN || + !atomic_dec_and_test(&qdisc->refcnt)) return; list_del(&qdisc->list); #ifdef CONFIG_NET_ESTIMATOR @@ -433,8 +434,7 @@ ops->reset(qdisc); if (ops->destroy) ops->destroy(qdisc); - if (!(qdisc->flags&TCQ_F_BUILTIN)) - kfree(qdisc); + kfree(qdisc); } --------------030606070008030700090802-- From shemminger@osdl.org Fri Nov 5 15:41:30 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 15:41:37 -0800 (PST) Received: from fire-1.osdl.org (fire.osdl.org [65.172.181.4]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5NfUm0026712 for ; Fri, 5 Nov 2004 15:41:30 -0800 Received: from zqx3.pdx.osdl.net (fw.osdl.org [65.172.181.6]) (authenticated bits=0) by fire-1.osdl.org (8.12.8/8.12.8) with ESMTP id iA5LkdPE013537 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 5 Nov 2004 13:46:39 -0800 Date: Fri, 5 Nov 2004 13:48:51 -0800 From: Stephen Hemminger To: netdev@oss.sgi.com Subject: Fw: [Bug 3692] New: The vsftpd reports an error when upgrading to 2.6.9 form 2.6.8.1 Message-Id: <20041105134851.6d2a7e52@zqx3.pdx.osdl.net> Organization: Open Source Development Lab X-Mailer: Sylpheed version 0.9.10claws (GTK+ 1.2.10; i686-suse-linux) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: osdl$Revision: 1.95 $ X-Scanned-By: MIMEDefang 2.36 X-archive-position: 11493 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: 1035 Lines: 32 Has anybody else seen this? Begin forwarded message: Date: Wed, 3 Nov 2004 17:21:19 -0800 From: bugme-daemon@osdl.org To: shemminger@osdl.org Subject: [Bug 3692] New: The vsftpd reports an error when upgrading to 2.6.9 form 2.6.8.1 http://bugme.osdl.org/show_bug.cgi?id=3692 Summary: The vsftpd reports an error when upgrading to 2.6.9 form 2.6.8.1 Kernel Version: 2.6.9 Status: NEW Severity: normal Owner: shemminger@osdl.org Submitter: andrei@interchange.ubc.edu Distribution: Slackware 9 Hardware Environment: Pentium 3 / 256 RAM / i440BX / NIC Realtec Software Environment: Kernel 2.6.9 Problem Description: After upgrading the vsftpd does not work neither 2.01 nor any other version, reporting some strange error 50x. Steps to reproduce: Just upgrade to 2.6.9 and try vsftpd any version. with default configuration. ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. From jgarzik@pobox.com Fri Nov 5 15:51:26 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 15:51:30 -0800 (PST) Received: from www.linux.org.uk (IDENT:93@parcelfarce.linux.theplanet.co.uk [195.92.249.252]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5NpPSD027335 for ; Fri, 5 Nov 2004 15:51:26 -0800 Received: from rdu74-155-169.nc.rr.com ([24.74.155.169] helo=[10.10.10.88]) by www.linux.org.uk with asmtp (TLSv1:AES256-SHA:256) (Exim 4.33) id 1CQAzy-0000eP-IE; Fri, 05 Nov 2004 20:47:54 +0000 Message-ID: <418BE6EC.3060103@pobox.com> Date: Fri, 05 Nov 2004 15:47:40 -0500 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040922 X-Accept-Language: en-us, en MIME-Version: 1.0 To: koushik CC: romieu@fr.zoreil.com, netdev@oss.sgi.com, leonid.grossman@s2io.com, ravinandan.arakali@s2io.com, rapuru.sriram@s2io.com, alicia.pena@s2io.com Subject: Re: Please ignore the corrupt patches sent earlier. References: <200411050523.49239.raghavendra.koushik@s2io.com> In-Reply-To: <200411050523.49239.raghavendra.koushik@s2io.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 11494 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: 829 Lines: 27 koushik wrote: > Hi All, > I had sent five of my patches with the new mail client, but it seems to have introduced > some series of '-' charecters at the end. So please ignore all those 5 mails, I will be sending > the series of 12 patches again (hopefully for the last time :-)). FWIW, I have found that use of "cat email-01.txt | sendmail -t" on a Unix system is the easiest way to send a large number of patches. You simply have to provide a minimal email header, a blank line, and then the patch content itself, in a single text file. Example: $ cat > email-01.txt To: jgarzik@pobox.com CC: netdev@oss.sgi.com From: koushik Subject: [patch 2.6.10-rc1-bk14 1/12] s2io: do something EOF $ cat patch-description >> email-01.txt $ cat patch >> email-01.txt $ sendmail -t < email-01.txt From tgraf@suug.ch Fri Nov 5 15:52:34 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 15:52:40 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id iA5NqYBZ027589 for ; Fri, 5 Nov 2004 15:52:34 -0800 Received: from postel.suug.ch (unknown [195.134.158.23]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by b.mx.projectdream.org (Postfix) with ESMTP id AE851F; Fri, 5 Nov 2004 17:39:08 +0100 (CET) Received: by postel.suug.ch (Postfix, from userid 10001) id 859421C0E9; Fri, 5 Nov 2004 17:39:51 +0100 (CET) Date: Fri, 5 Nov 2004 17:39:51 +0100 From: Thomas Graf To: Patrick McHardy Cc: davem@davemloft.net, netdev@oss.sgi.com, spam@crocom.com.pl, kuznet@ms2.inr.ac.ru, jmorris@redhat.com Subject: Re: [PATCH] PKT_SCHED: Initialize list field in dummy qdiscs Message-ID: <20041105163951.GY12289@postel.suug.ch> References: <418B4C7C.8000402@crocom.com.pl> <20041105115430.GP19714@rei.reeler.org> <418B4C7C.8000402@crocom.com.pl> <20041105141640.GQ19714@rei.reeler.org> <418BA66A.60804@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <418BA66A.60804@trash.net> X-archive-position: 11496 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: tgraf@suug.ch Precedence: bulk X-list: netdev Content-Length: 1253 Lines: 26 * Patrick McHardy <418BA66A.60804@trash.net> 2004-11-05 17:12 > Nice catch. I can't understand how you triggered that oops, > though. The noop- and noqueue-qdiscs used without qdisc_create_* > are not refcounted, so I would expect: > > void qdisc_destroy(struct Qdisc *qdisc) > { > if (!atomic_dec_and_test(&qdisc->refcnt)) > return; > > to underflow and return until refcnt finally reaches 0 again. > Can you explain, please ? Right, this is indeed the case. This doesn't fix the oops reported but will prevent the oops you are referring to which was triggerd after 2h stress testing on my machine. I haven't had the time to check if incrementing the refcnt of builtin qdiscs causes any problems but initializing the list is good in any case. I found huge locking problems from qidsc_destroy calling contexts though. Almost all calling paths to qdisc_destroy invoked from qdiscs are messed up. I am resolving those now. I have a theoretical path that could cause the reported oops which is htb_put -> htb_destroy_class -> qdisc_destroy not bh locking dev->queue_lock and thus the list unlinking could take place during a walk/lookup and thus lead to POISON value in the next pointer. I could not reproduce this so far though. From tgraf@suug.ch Fri Nov 5 15:52:31 2004 Received: with ECARTIS (v1.0.0; list netdev); Fri, 05 Nov 2004 15:52:39 -0800 (PST) Received: from b.mx.projectdream.org (eth0-0.arisu.projectdream.org [194.158.4.191]) by oss.sgi.com (8.13