Re: [RFC][PATCH 2/9] deadlock prevention core
On Wed, 16 Aug 2006 20:58:28 -0700 Daniel Phillips [EMAIL PROTECTED] wrote: Andrew Morton wrote: Peter Zijlstra [EMAIL PROTECTED] wrote: Testcase: Mount an NBD device as sole swap device and mmap physical RAM, then loop through touching pages only once. Fix: don't try to swap over the network. Yes, there may be some scenarios where people have no local storage, but it's reasonable to expect anyone who is using Linux as an enterprise storage platform to stick a local disk on the thing for swap. That leaves MAP_SHARED, but mm-tracking-shared-dirty-pages.patch will fix that, will it not? Hi Andrew, What happened to the case where we just fill memory full of dirty file pages backed by a remote disk? Processes which are dirtying those pages throttle at /proc/sys/vm/dirty_ratio% of memory dirty. So it is not possible to fill memory with dirty pages. If the amount of physical memory which is dirty exceeds 40%: bug. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/9] network namespaces: playing and debugging
On Wed, Aug 16, 2006 at 11:22:28AM -0600, Eric W. Biederman wrote: Stephen Hemminger [EMAIL PROTECTED] writes: On Tue, 15 Aug 2006 18:48:43 +0400 Andrey Savochkin [EMAIL PROTECTED] wrote: Temporary code to play with network namespaces in the simplest way. Do exec 7 /proc/net/net_ns in your bash shell and you'll get a brand new network namespace. There you can, for example, do ip link set lo up ip addr list ip addr add 1.2.3.4 dev lo ping -n 1.2.3.4 Signed-off-by: Andrey Savochkin [EMAIL PROTECTED] NACK, new /proc interfaces are not acceptable. The rule is that new /proc interfaces that are not process related are not acceptable. If structured right a network namespace can arguably be process related. I do agree that this interface is pretty ugly there. This proc interface was a backdoor to play with namespaces without compiling any user-space programs. As you wish. Do you want to have a new clone flag right away? Andrey - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [d80211 rfc] link master interface from wiphy
On Wed, 2006-08-16 at 19:05 +0200, Jiri Benc wrote: Btw, we will probably need some way to ask d80211 about all interfaces belonging to given wiphy anyway. Crawling all network interfaces and searching for correct wiphy symlinks is probably not the best way. I think a new netlink interface can be used for this. Yeah, that should be fairly easy. wpa_supplicant could use this, I guess. I think another link to wlan#ap should be created (or does wpa_supplicant set the name of that so it knows which one it will get?), or something like that anyway. wmgmt# will go away in future. There is an ioctl to get its ifindex, so no need for the link. Right, Jouni pointed that out already. Forget what I said :) Besides, I'm already working hard on deprecating it :P What do you mean by making the virtual devices all children of the wiphy? Currently, all virtual devices (of one physical device) have the same pointer to ieee80211_local in their net_dev structure and pointers to them are stored in the linked list in ieee80211_local. I was wondering why they in sysfs have their device link set to the physical device instead of the master wiphy. I'm not sure if the latter makes sense though. Do you know about /sys/class/net/X/wiphy symlinks? yes, I'm actually using them :) Thanks, johannes - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: proposal for new wireless configuration API
On Wed, 2006-08-16 at 11:02 -0700, Simon Barber wrote: I'd suggest that the new signal strength measure should be defined as 'RCPI' - the 'Received Channel Power Indicator' - which is defined in IEEE 802.11k (the Radio Measurements amendment to 802.11). Except that we unfortunately have no way of getting this with all the reverse engineered devices :) Hence, I guess we should then have multiple different possibilities. A device reporting RCPI would be better than just reporting RSSI, but that's still better than nothing... johannes - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/6] IP100A, add end of pci id table
From: Jesse Huang [EMAIL PROTECTED] Add 0, and NULL, to sundance_pci_tbl and pci_id_table. Change Logs: Add 0, and NULL, to sundance_pci_tbl and pci_id_table. --- drivers/net/sundance.c |8 1 files changed, 4 insertions(+), 4 deletions(-) 9ef94f8b85a0070e49bb1883a9f124be1711761d diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index ac17377..eb81d91 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -21,8 +21,8 @@ */ #define DRV_NAME sundance -#define DRV_VERSION1.1 -#define DRV_RELDATE27-Jun-2006 +#define DRV_VERSION1.2 +#define DRV_RELDATE03-Aug-2006 /* The user-configurable values. @@ -212,7 +212,7 @@ static const struct pci_device_id sundan { 0x1186, 0x1002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4 }, { 0x13F0, 0x0201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5 }, { 0x13F0, 0x0200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6 }, - { } + { 0,} }; MODULE_DEVICE_TABLE(pci, sundance_pci_tbl); @@ -231,7 +231,7 @@ static const struct pci_id_info pci_id_t {D-Link DL10050-based FAST Ethernet Adapter}, {Sundance Technology Alta}, {IC Plus Corporation IP100A FAST Ethernet Adapter}, - { } /* terminate list. */ + { NULL,}/* terminate list. */ }; /* This driver was written to use PCI memory space, however x86-oriented -- 1.3.GIT - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/6] IP100A Fix Tx pause bug
From: Jesse Huang [EMAIL PROTECTED] Fix Tx pause bug Change Logs: Fix Tx pause bug --- drivers/net/sundance.c | 49 +++- 1 files changed, 28 insertions(+), 21 deletions(-) 7e6bffe518096d89a9e7ee9b80f246b3ff442f2e diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index eb81d91..910ea17 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -262,8 +262,6 @@ enum alta_offsets { ASICCtrl = 0x30, EEData = 0x34, EECtrl = 0x36, - TxStartThresh = 0x3c, - RxEarlyThresh = 0x3e, FlashAddr = 0x40, FlashData = 0x44, TxStatus = 0x46, @@ -1084,6 +1082,8 @@ reset_tx (struct net_device *dev) } /* free all tx skbuff */ for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc = 0; + skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, @@ -1099,6 +1099,10 @@ reset_tx (struct net_device *dev) } np-cur_tx = np-dirty_tx = 0; np-cur_task = 0; + + np-last_tx=0; + iowrite8(127, ioaddr + TxDMAPollPeriod); + iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); return 0; } @@ -1156,29 +1160,29 @@ static irqreturn_t intr_handler(int irq, np-stats.tx_fifo_errors++; if (tx_status 0x02) np-stats.tx_window_errors++; - /* - ** This reset has been verified on - ** DFE-580TX boards ! [EMAIL PROTECTED] - */ - if (tx_status 0x10) { /* TxUnderrun */ - unsigned short txthreshold; - - txthreshold = ioread16 (ioaddr + TxStartThresh); - /* Restart Tx FIFO and transmitter */ - sundance_reset(dev, (NetworkReset|FIFOReset|TxReset) 16); - iowrite16 (txthreshold, ioaddr + TxStartThresh); - /* No need to reset the Tx pointer here */ + + /* FIFO ERROR need to be reset tx */ + if (tx_status 0x10) { /* Reset the Tx. */ + spin_lock(np-lock); + reset_tx(dev); + spin_unlock(np-lock); + } + if (tx_status 0x1e) { + /* need to make sure tx enabled */ + int i = 10; + do { + iowrite16 (ioread16(ioaddr + MACCtrl1) | TxEnable, ioaddr + MACCtrl1); + if (ioread16(ioaddr + MACCtrl1) TxEnabled) + break; + mdelay(1); + } while (--i); } - /* Restart the Tx. */ - iowrite16 (TxEnable, ioaddr + MACCtrl1); } - /* Yup, this is a documentation bug. It cost me *hours*. */ + iowrite16 (0, ioaddr + TxStatus); - if (tx_cnt 0) { - iowrite32(5000, ioaddr + DownCounter); - break; - } tx_status = ioread16 (ioaddr + TxStatus); + if (tx_cnt 0) + break; } hw_frame_id = (tx_status 8) 0xff; } else { @@ -1244,6 +1248,9 @@ static irqreturn_t intr_handler(int irq, if (netif_msg_intr(np)) printk(KERN_DEBUG %s: exiting interrupt, status=%#4.4x.\n, dev-name, ioread16(ioaddr + IntrStatus)); + + iowrite32(5000, ioaddr + DownCounter); + return IRQ_RETVAL(handled); } -- 1.3.GIT - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info
[PATCH 3/6] IP100A Remove CONFIG_SUNDANCE_MMIO, mask of mapping address
From: Jesse Huang [EMAIL PROTECTED] Remove CONFIG_SUNDANCE_MMIO, mask of mapping address Change Logs: Remove CONFIG_SUNDANCE_MMIO, mask of mapping address --- drivers/net/sundance.c | 13 ++--- 1 files changed, 6 insertions(+), 7 deletions(-) dc932975858ae18801620d04212c516ced6920bd diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 910ea17..2bde1b3 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -21,8 +21,8 @@ */ #define DRV_NAME sundance -#define DRV_VERSION1.2 -#define DRV_RELDATE03-Aug-2006 +#define DRV_VERSION1.01+LK1.13 +#define DRV_RELDATE04-Aug-2006 /* The user-configurable values. @@ -199,10 +199,6 @@ IVc. Errata */ -/* Work-around for Kendin chip bugs. */ -#ifndef CONFIG_SUNDANCE_MMIO -#define USE_IO_OPS 1 -#endif static const struct pci_device_id sundance_pci_tbl[] = { { 0x1186, 0x1002, 0x1186, 0x1002, 0, 0, 0 }, @@ -491,10 +487,13 @@ #endif if (pci_request_regions(pdev, DRV_NAME)) goto err_out_netdev; - ioaddr = pci_iomap(pdev, bar, netdev_io_size); + ioaddr =(void __iomem *) +((unsigned long)pci_iomap(pdev, bar, netdev_io_size) + 0xff80); if (!ioaddr) goto err_out_res; + for (i = 0; i 3; i++) ((u16 *)dev-dev_addr)[i] = le16_to_cpu(eeprom_read(ioaddr, i + EEPROM_SA_OFFSET)); -- 1.3.GIT - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/6] IP100A Change search phy addr start form 0
From: Jesse Huang [EMAIL PROTECTED] Change search phy addr start form 0 Change Logs: Change search phy addr start form 0 --- drivers/net/sundance.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) 212cd4ffa21a57300eae4254bf02e5b33b96f544 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index 2bde1b3..f63871a 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -21,7 +21,7 @@ */ #define DRV_NAME sundance -#define DRV_VERSION1.01+LK1.13 +#define DRV_VERSION1.01+LK1.14 #define DRV_RELDATE04-Aug-2006 @@ -559,8 +559,9 @@ #endif /* * It seems some phys doesn't deal well with address 0 being accessed * first, so leave address zero to the end of the loop (32 31). +* for IP100A the phy should start from 0 */ - for (phy = 1; phy = 32 phy_idx MII_CNT; phy++) { + for (phy = 0; phy = 32 phy_idx MII_CNT; phy++) { int phyx = phy 0x1f; int mii_status = mdio_read(dev, phyx, MII_BMSR); if (mii_status != 0xmii_status != 0x) { -- 1.3.GIT - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[take11 0/3] kevent: Generic event handling mechanism.
Generic event handling mechanism. Changes from 'take10' patchset: * removed non-existent prototypes * added helper function for kevent_registered_callbacks * fixed 80 lines comments issues * added shared between userspace and kernelspace header instead of embedd them in one * core restructuring to remove forward declarations * s o m e w h i t e s p a c e c o d y n g s t y l e c l e a n u p * use vm_insert_page() instead of remap_pfn_range() Changes from 'take9' patchset: * fixed -nopage method Changes from 'take8' patchset: * fixed mmap release bug * use module_init() instead of late_initcall() * use better structures for timer notifications Changes from 'take7' patchset: * new mmap interface (not tested, waiting for other changes to be acked) - use nopage() method to dynamically substitue pages - allocate new page for events only when new added kevent requres it - do not use ugly index dereferencing, use structure instead - reduced amount of data in the ring (id and flags), maximum 12 pages on x86 per kevent fd Changes from 'take6' patchset: * a lot of comments! * do not use list poisoning for detection of the fact, that entry is in the list * return number of ready kevents even if copy*user() fails * strict check for number of kevents in syscall * use ARRAY_SIZE for array size calculation * changed superblock magic number * use SLAB_PANIC instead of direct panic() call * changed -E* return values * a lot of small cleanups and indent fixes Changes from 'take5' patchset: * removed compilation warnings about unused wariables when lockdep is not turned on * do not use internal socket structures, use appropriate (exported) wrappers instead * removed default 1 second timeout * removed AIO stuff from patchset Changes from 'take4' patchset: * use miscdevice instead of chardevice * comments fixes Changes from 'take3' patchset: * removed serializing mutex from kevent_user_wait() * moved storage list processing to RCU * removed lockdep screaming - all storage locks are initialized in the same function, so it was learned to differentiate between various cases * remove kevent from storage if is marked as broken after callback * fixed a typo in mmaped buffer implementation which would end up in wrong index calcualtion Changes from 'take2' patchset: * split kevent_finish_user() to locked and unlocked variants * do not use KEVENT_STAT ifdefs, use inline functions instead * use array of callbacks of each type instead of each kevent callback initialization * changed name of ukevent guarding lock * use only one kevent lock in kevent_user for all hash buckets instead of per-bucket locks * do not use kevent_user_ctl structure instead provide needed arguments as syscall parameters * various indent cleanups * added optimisation, which is aimed to help when a lot of kevents are being copied from userspace * mapped buffer (initial) implementation (no userspace yet) Changes from 'take1' patchset: - rebased against 2.6.18-git tree - removed ioctl controlling - added new syscall kevent_get_events(int fd, unsigned int min_nr, unsigned int max_nr, unsigned int timeout, void __user *buf, unsigned flags) - use old syscall kevent_ctl for creation/removing, modification and initial kevent initialization - use mutuxes instead of semaphores - added file descriptor check and return error if provided descriptor does not match kevent file operations - various indent fixes - removed aio_sendfile() declarations. Thank you. Signed-off-by: Evgeniy Polyakov [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 5/6] IP100A correct init and close step
From: Jesse Huang [EMAIL PROTECTED] correct init and close step Change Logs: correct init and close step --- drivers/net/sundance.c | 10 +- 1 files changed, 9 insertions(+), 1 deletions(-) b5e343a17f5d70d1cc9a4ba20d366bab355f64a6 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index f63871a..c7c22f0 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -830,6 +830,11 @@ #endif iowrite8(0x01, ioaddr + DebugCtrl1); netif_start_queue(dev); + // 04/19/2005 Jesse fix for complete initial step + spin_lock(np-lock); + reset_tx(dev); + spin_unlock(np-lock); + iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1); if (netif_msg_ifup(np)) @@ -1654,7 +1659,10 @@ static int netdev_close(struct net_devic /* Disable interrupts by clearing the interrupt mask. */ iowrite16(0x, ioaddr + IntrEnable); - + + // 04/19/2005 Jesse fix for complete initial step + writew(0x500, ioaddr + DMACtrl); + /* Stop the chip's Tx and Rx processes. */ iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1); -- 1.3.GIT - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[take11 2/3] kevent: poll/select() notifications.
poll/select() notifications. This patch includes generic poll/select and timer notifications. kevent_poll works simialr to epoll and has the same issues (callback is invoked not from internal state machine of the caller, but through process awake). Signed-off-by: Evgeniy Polyakov [EMAIL PROTECTED] diff --git a/kernel/kevent/kevent_poll.c b/kernel/kevent/kevent_poll.c new file mode 100644 index 000..75a75d1 --- /dev/null +++ b/kernel/kevent/kevent_poll.c @@ -0,0 +1,221 @@ +/* + * kevent_poll.c + * + * 2006 Copyright (c) Evgeniy Polyakov [EMAIL PROTECTED] + * All rights reserved. + * + * 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. + */ + +#include linux/kernel.h +#include linux/types.h +#include linux/list.h +#include linux/slab.h +#include linux/spinlock.h +#include linux/timer.h +#include linux/file.h +#include linux/kevent.h +#include linux/poll.h +#include linux/fs.h + +static kmem_cache_t *kevent_poll_container_cache; +static kmem_cache_t *kevent_poll_priv_cache; + +struct kevent_poll_ctl +{ + struct poll_table_structpt; + struct kevent *k; +}; + +struct kevent_poll_wait_container +{ + struct list_headcontainer_entry; + wait_queue_head_t *whead; + wait_queue_twait; + struct kevent *k; +}; + +struct kevent_poll_private +{ + struct list_headcontainer_list; + spinlock_t container_lock; +}; + +static int kevent_poll_enqueue(struct kevent *k); +static int kevent_poll_dequeue(struct kevent *k); +static int kevent_poll_callback(struct kevent *k); + +static int kevent_poll_wait_callback(wait_queue_t *wait, + unsigned mode, int sync, void *key) +{ + struct kevent_poll_wait_container *cont = + container_of(wait, struct kevent_poll_wait_container, wait); + struct kevent *k = cont-k; + struct file *file = k-st-origin; + u32 revents; + + revents = file-f_op-poll(file, NULL); + + kevent_storage_ready(k-st, NULL, revents); + + return 0; +} + +static void kevent_poll_qproc(struct file *file, wait_queue_head_t *whead, + struct poll_table_struct *poll_table) +{ + struct kevent *k = + container_of(poll_table, struct kevent_poll_ctl, pt)-k; + struct kevent_poll_private *priv = k-priv; + struct kevent_poll_wait_container *cont; + unsigned long flags; + + cont = kmem_cache_alloc(kevent_poll_container_cache, SLAB_KERNEL); + if (!cont) { + kevent_break(k); + return; + } + + cont-k = k; + init_waitqueue_func_entry(cont-wait, kevent_poll_wait_callback); + cont-whead = whead; + + spin_lock_irqsave(priv-container_lock, flags); + list_add_tail(cont-container_entry, priv-container_list); + spin_unlock_irqrestore(priv-container_lock, flags); + + add_wait_queue(whead, cont-wait); +} + +static int kevent_poll_enqueue(struct kevent *k) +{ + struct file *file; + int err, ready = 0; + unsigned int revents; + struct kevent_poll_ctl ctl; + struct kevent_poll_private *priv; + + file = fget(k-event.id.raw[0]); + if (!file) + return -ENODEV; + + err = -EINVAL; + if (!file-f_op || !file-f_op-poll) + goto err_out_fput; + + err = -ENOMEM; + priv = kmem_cache_alloc(kevent_poll_priv_cache, SLAB_KERNEL); + if (!priv) + goto err_out_fput; + + spin_lock_init(priv-container_lock); + INIT_LIST_HEAD(priv-container_list); + + k-priv = priv; + + ctl.k = k; + init_poll_funcptr(ctl.pt, kevent_poll_qproc); + + err = kevent_storage_enqueue(file-st, k); + if (err) + goto err_out_free; + + revents = file-f_op-poll(file, ctl.pt); + if (revents k-event.event) { + ready = 1; + kevent_poll_dequeue(k); + } + + return ready; + +err_out_free: + kmem_cache_free(kevent_poll_priv_cache, priv); +err_out_fput: + fput(file); + return err; +} + +static int kevent_poll_dequeue(struct kevent *k) +{ + struct file *file = k-st-origin; + struct kevent_poll_private *priv = k-priv; + struct kevent_poll_wait_container *w, *n; + unsigned long flags; + + kevent_storage_dequeue(k-st, k); + + spin_lock_irqsave(priv-container_lock, flags); +
[take11 3/3] kevent: Timer notifications.
Timer notifications. Timer notifications can be used for fine grained per-process time management, since interval timers are very inconvenient to use, and they are limited. Signed-off-by: Evgeniy Polyakov [EMAIL PROTECTED] diff --git a/kernel/kevent/kevent_timer.c b/kernel/kevent/kevent_timer.c new file mode 100644 index 000..5217cd1 --- /dev/null +++ b/kernel/kevent/kevent_timer.c @@ -0,0 +1,107 @@ +/* + * kevent_timer.c + * + * 2006 Copyright (c) Evgeniy Polyakov [EMAIL PROTECTED] + * All rights reserved. + * + * 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 linux/kernel.h +#include linux/types.h +#include linux/list.h +#include linux/slab.h +#include linux/spinlock.h +#include linux/timer.h +#include linux/jiffies.h +#include linux/kevent.h + +struct kevent_timer +{ + struct timer_list ktimer; + struct kevent_storage ktimer_storage; +}; + +static void kevent_timer_func(unsigned long data) +{ + struct kevent *k = (struct kevent *)data; + struct timer_list *t = k-st-origin; + + kevent_storage_ready(k-st, NULL, KEVENT_MASK_ALL); + mod_timer(t, jiffies + msecs_to_jiffies(k-event.id.raw[0])); +} + +static struct lock_class_key kevent_timer_key; + +static int kevent_timer_enqueue(struct kevent *k) +{ + int err; + struct kevent_timer *t; + + t = kmalloc(sizeof(struct kevent_timer), GFP_KERNEL); + if (!t) + return -ENOMEM; + + setup_timer(t-ktimer, kevent_timer_func, (unsigned long)k); + + err = kevent_storage_init(t-ktimer, t-ktimer_storage); + if (err) + goto err_out_free; + lockdep_set_class(t-ktimer_storage.lock, kevent_timer_key); + + err = kevent_storage_enqueue(t-ktimer_storage, k); + if (err) + goto err_out_st_fini; + + mod_timer(t-ktimer, jiffies + msecs_to_jiffies(k-event.id.raw[0])); + + return 0; + +err_out_st_fini: + kevent_storage_fini(t-ktimer_storage); +err_out_free: + kfree(t); + + return err; +} + +static int kevent_timer_dequeue(struct kevent *k) +{ + struct kevent_storage *st = k-st; + struct kevent_timer *t = container_of(st, struct kevent_timer, ktimer_storage); + + del_timer_sync(t-ktimer); + kevent_storage_dequeue(st, k); + kfree(t); + + return 0; +} + +static int kevent_timer_callback(struct kevent *k) +{ + k-event.ret_data[0] = (__u32)jiffies; + return 1; +} + +static int __init kevent_init_timer(void) +{ + struct kevent_callbacks tc = { + .callback = kevent_timer_callback, + .enqueue = kevent_timer_enqueue, + .dequeue = kevent_timer_dequeue}; + + return kevent_add_callbacks(tc, KEVENT_TIMER); +} +module_init(kevent_init_timer); - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[take11 1/3] kevent: Core files.
Core files. This patch includes core kevent files: - userspace controlling - kernelspace interfaces - initialization - notification state machines Signed-off-by: Evgeniy Polyakov [EMAIL PROTECTED] diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S index dd63d47..091ff42 100644 --- a/arch/i386/kernel/syscall_table.S +++ b/arch/i386/kernel/syscall_table.S @@ -317,3 +317,5 @@ ENTRY(sys_call_table) .long sys_tee /* 315 */ .long sys_vmsplice .long sys_move_pages + .long sys_kevent_get_events + .long sys_kevent_ctl diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S index 5d4a7d1..b2af4a8 100644 --- a/arch/x86_64/ia32/ia32entry.S +++ b/arch/x86_64/ia32/ia32entry.S @@ -713,4 +713,6 @@ #endif .quad sys_tee .quad compat_sys_vmsplice .quad compat_sys_move_pages + .quad sys_kevent_get_events + .quad sys_kevent_ctl ia32_syscall_end: diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index fc1c8dd..c9dde13 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h @@ -323,10 +323,12 @@ #define __NR_sync_file_range 314 #define __NR_tee 315 #define __NR_vmsplice 316 #define __NR_move_pages317 +#define __NR_kevent_get_events 318 +#define __NR_kevent_ctl319 #ifdef __KERNEL__ -#define NR_syscalls 318 +#define NR_syscalls 320 /* * user-visible error numbers are in the range -1 - -128: see diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h index 94387c9..61363e0 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86_64/unistd.h @@ -619,10 +619,14 @@ #define __NR_vmsplice 278 __SYSCALL(__NR_vmsplice, sys_vmsplice) #define __NR_move_pages279 __SYSCALL(__NR_move_pages, sys_move_pages) +#define __NR_kevent_get_events 280 +__SYSCALL(__NR_kevent_get_events, sys_kevent_get_events) +#define __NR_kevent_ctl281 +__SYSCALL(__NR_kevent_ctl, sys_kevent_ctl) #ifdef __KERNEL__ -#define __NR_syscall_max __NR_move_pages +#define __NR_syscall_max __NR_kevent_ctl #ifndef __NO_STUBS diff --git a/include/linux/kevent.h b/include/linux/kevent.h new file mode 100644 index 000..eef9709 --- /dev/null +++ b/include/linux/kevent.h @@ -0,0 +1,174 @@ +/* + * 2006 Copyright (c) Evgeniy Polyakov [EMAIL PROTECTED] + * All rights reserved. + * + * 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 + */ + +#ifndef __KEVENT_H +#define __KEVENT_H +#include linux/types.h +#include linux/list.h +#include linux/spinlock.h +#include linux/mutex.h +#include linux/wait.h +#include linux/net.h +#include linux/rcupdate.h +#include linux/kevent_storage.h +#include linux/ukevent.h + +#define KEVENT_MAX_EVENTS 4096 +#define KEVENT_MIN_BUFFS_ALLOC 3 + +struct kevent; +struct kevent_storage; +typedef int (* kevent_callback_t)(struct kevent *); + +/* @callback is called each time new event has been caught. */ +/* @enqueue is called each time new event is queued. */ +/* @dequeue is called each time event is dequeued. */ + +struct kevent_callbacks { + kevent_callback_t callback, enqueue, dequeue; +}; + +#define KEVENT_READY 0x1 +#define KEVENT_STORAGE 0x2 +#define KEVENT_USER0x4 + +struct kevent +{ + /* Used for kevent freeing.*/ + struct rcu_head rcu_head; + struct ukevent event; + /* This lock protects ukevent manipulations, e.g. ret_flags changes. */ + spinlock_t ulock; + + /* Entry of user's queue. */ + struct list_headkevent_entry; + /* Entry of origin's queue. */ + struct list_headstorage_entry; + /* Entry of user's ready. */ + struct list_headready_entry; + + u32 flags; + + /* User who requested this kevent. */ + struct kevent_user *user; + /* Kevent container. */ + struct kevent_storage *st; + + struct kevent_callbacks callbacks; + + /* Private data for different storages. +* poll()/select storage has a list of wait_queue_t containers +* for each -poll() { poll_wait()' } here. +*/ + void
[PATCH 6/6] IP100A Solve host error problem when in low performance embedded
From: Jesse Huang [EMAIL PROTECTED] Solve host error problem when in low performance embedded Change Logs: Solve host error problem when in low performance embedded --- drivers/net/sundance.c | 26 ++ 1 files changed, 22 insertions(+), 4 deletions(-) 78ff57ea887c19b7552342e990375f5e2bb10af9 diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index c7c22f0..94ba6ca 100755 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c @@ -1075,7 +1075,7 @@ reset_tx (struct net_device *dev) struct sk_buff *skb; int i; int irq = in_interrupt(); - + tasklet_kill(np-tx_tasklet); /* Reset tx logic, TxListPtr will be cleaned */ iowrite16 (TxDisable, ioaddr + MACCtrl1); iowrite16 (TxReset | DMAReset | FIFOReset | NetworkReset, @@ -1646,6 +1646,13 @@ static int netdev_close(struct net_devic struct sk_buff *skb; int i; + /* Wait and kill tasklet */ + tasklet_kill(np-rx_tasklet); + tasklet_kill(np-tx_tasklet); + np-cur_tx = np-dirty_tx = 0; + np-cur_task = 0; + np-last_tx=0; + netif_stop_queue(dev); if (netif_msg_ifdown(np)) { @@ -1666,9 +1673,19 @@ static int netdev_close(struct net_devic /* Stop the chip's Tx and Rx processes. */ iowrite16(TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl1); - /* Wait and kill tasklet */ - tasklet_kill(np-rx_tasklet); - tasklet_kill(np-tx_tasklet); +for(i=2000;i 0;i--) { + if((readl(ioaddr + DMACtrl)0xC000) == 0)break; + mdelay(1); +} + +writew(GlobalReset | DMAReset | FIFOReset |NetworkReset, ioaddr +ASICCtrl + 2); + +for(i=2000;i 0;i--) +{ + if((readw(ioaddr + ASICCtrl +2)ResetBusy) == 0) + break; + mdelay(1); +} #ifdef __i386__ if (netif_msg_hw(np)) { @@ -1706,6 +1723,7 @@ #endif /* __i386__ debugging only */ } } for (i = 0; i TX_RING_SIZE; i++) { + np-tx_ring[i].next_desc=0; skb = np-tx_skbuff[i]; if (skb) { pci_unmap_single(np-pci_dev, -- 1.3.GIT - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: bonding: cannot remove certain named devices
On Wed, 2006-08-16 at 17:11, Bodo Eggert wrote: On Wed, 16 Aug 2006, Bill Nottingham wrote: Giacomo A. Catenazzi ([EMAIL PROTECTED]) said: Are you willing to work to add the special case code necessary to handle whitespace characters in the device name over all of the kernel code and also all of the userland tools too? But if you don't handle spaces in userspace, you handle *, ?, [, ], $, , ', \ in userspace? Should kernel disable also these (insane device chars) chars? Don't forget unicode characters! And long names or control characters. Seriously, while it might be insane to use some of these, I'm wondering if trying to filter names is more work than fixing the tools. I think it's sane to avoid control characters and unicode/iso*, since they can interfere with log output or analysis. I only thought about the kernel itself and the corresponding userspace tools, which should handle any character sequence just fine or could be easily fixed. Why not simply retricting chars to isalnum() ones ? Xav - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
802.11 headers
The d80211 headers are messy. Before merging, we definitely need to clean them up and split them between userland-visible and kernel-only headers, or else ... ;) My current thoughts: - net/d80211_common.h can die sometime soon due to being replaced with linux/nl80211.h (to be published today). - net/d80211_mgmt.h needs cleaning up (I know Michael has been doing some of that), and then should probably be renamed to linux/ieee80211.h and be userland-visible, and contain a bunch of other frame definitions as well. A bit like net/ieee80211.h now, though more protocol-centric. - net/ieee80211_radiotap.h should be userland-visible, and hence linux/radiotap.h or such. - net/d80211_shared.h probably has the same fate as net/d80211_common.h, except for the _RATE_* thingies, but I'm not sure why they should be userland-visible. - net/d80211.h can stay there as-is, it's in-kernel only API. Or put another way, my suggestions: - put all in-kernel API (for drivers) into net/d80211.h - put stuff defined in the IEEE 802.11 specification series into linux/ieee80211.h, make user-visible (headers-y in Kbuild!). This serves just as a reference. It's not really necessary that the kernel ships this, but we need it in the kernel and probably won't be pulling it from some other source. Besides, I wouldn't know where else to maintain it. - radiotap simply moves to linux/ and gets to be userland-visible. Of course, d80211 should actually start using it too ;) - all the other userland stuff seems to be configuration related and hence moves over to linux/nl80211.h Comments? johannes - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 15/15]: [IPSEC] esp: Defer output IV initialization to first use.
[IPSEC] esp: Defer output IV initialization to first use. First of all, if the xfrm_state only gets used for input packets this entropy is a complete waste. Secondly, it is often the case that a configuration loads many rules (perhaps even dynamically) and they don't all necessarily ever get used. This get_random_bytes() call was showing up in the profiles for xfrm_state inserts which is how I noticed this. Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/net/esp.h |5 +++-- net/ipv4/esp4.c | 10 +++--- net/ipv6/esp6.c |9 +++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/include/net/esp.h b/include/net/esp.h index 90cd94f..636163c 100644 --- a/include/net/esp.h +++ b/include/net/esp.h @@ -14,13 +14,14 @@ struct esp_data struct { u8 *key; /* Key */ int key_len;/* Key length */ - u8 *ivec; /* ivec buffer */ + int padlen; /* 0..255 */ /* ivlen is offset from enc_data, where encrypted data start. * It is logically different of crypto_tfm_alg_ivsize(tfm). * We assume that it is either zero (no ivec), or * = crypto_tfm_alg_ivsize(tfm). */ int ivlen; - int padlen; /* 0..255 */ + int ivinitted; + u8 *ivec; /* ivec buffer */ struct crypto_tfm *tfm; /* crypto handle */ } conf; diff --git a/net/ipv4/esp4.c b/net/ipv4/esp4.c index fc2f8ce..1ceda9f 100644 --- a/net/ipv4/esp4.c +++ b/net/ipv4/esp4.c @@ -91,9 +91,13 @@ static int esp_output(struct xfrm_state esph-seq_no = htonl(++x-replay.oseq); xfrm_aevent_doreplay(x); - if (esp-conf.ivlen) + if (esp-conf.ivlen) { + if (unlikely(!esp-conf.ivinitted)) { + get_random_bytes(esp-conf.ivec, esp-conf.ivlen); + esp-conf.ivinitted = 1; + } crypto_cipher_set_iv(tfm, esp-conf.ivec, crypto_tfm_alg_ivsize(tfm)); - + } do { struct scatterlist *sg = esp-sgbuf[0]; @@ -363,7 +367,7 @@ static int esp_init_state(struct xfrm_st esp-conf.ivec = kmalloc(esp-conf.ivlen, GFP_KERNEL); if (unlikely(esp-conf.ivec == NULL)) goto error; - get_random_bytes(esp-conf.ivec, esp-conf.ivlen); + esp-conf.ivinitted = 0; } if (crypto_cipher_setkey(esp-conf.tfm, esp-conf.key, esp-conf.key_len)) goto error; diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index a278d5e..efa6155 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c @@ -95,8 +95,13 @@ static int esp6_output(struct xfrm_state esph-seq_no = htonl(++x-replay.oseq); xfrm_aevent_doreplay(x); - if (esp-conf.ivlen) + if (esp-conf.ivlen) { + if (unlikely(!esp-conf.ivinitted)) { + get_random_bytes(esp-conf.ivec, esp-conf.ivlen); + esp-conf.ivinitted = 1; + } crypto_cipher_set_iv(tfm, esp-conf.ivec, crypto_tfm_alg_ivsize(tfm)); + } do { struct scatterlist *sg = esp-sgbuf[0]; @@ -339,7 +344,7 @@ static int esp6_init_state(struct xfrm_s esp-conf.ivec = kmalloc(esp-conf.ivlen, GFP_KERNEL); if (unlikely(esp-conf.ivec == NULL)) goto error; - get_random_bytes(esp-conf.ivec, esp-conf.ivlen); + esp-conf.ivinitted = 0; } if (crypto_cipher_setkey(esp-conf.tfm, esp-conf.key, esp-conf.key_len)) goto error; -- 1.4.2.rc2.g3e042 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 9/15]: [XFRM]: Do not flush all bundles on SA insert.
[XFRM]: Do not flush all bundles on SA insert. Instead, simply set all potentially aliasing existing xfrm_state objects to have the current generation counter value. This will make routes get relooked up the next time an existing route mentioning these aliased xfrm_state objects gets used, via xfrm_dst_check(). Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/net/xfrm.h |1 - net/xfrm/xfrm_policy.c | 10 -- net/xfrm/xfrm_state.c | 25 - 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 7d18fff..3f54542 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -896,7 +896,6 @@ struct xfrm_state * xfrm_find_acq(u8 mod extern void xfrm_policy_flush(void); extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); extern int xfrm_flush_bundles(void); -extern void xfrm_flush_all_bundles(void); extern int xfrm_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl, int family); extern void xfrm_init_pmtu(struct dst_entry *dst); diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index c504b9a..c16b30a 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -1244,16 +1244,6 @@ int xfrm_flush_bundles(void) return 0; } -static int always_true(struct dst_entry *dst) -{ - return 1; -} - -void xfrm_flush_all_bundles(void) -{ - xfrm_prune_bundles(always_true); -} - void xfrm_init_pmtu(struct dst_entry *dst) { do { diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 3e8485a..a3a7396 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -655,13 +655,30 @@ static void __xfrm_state_insert(struct x schedule_work(xfrm_hash_work); } +/* xfrm_state_lock is held */ +static void __xfrm_state_bump_genids(struct xfrm_state *xnew) +{ + unsigned short family = xnew-props.family; + u32 reqid = xnew-props.reqid; + struct xfrm_state *x; + struct hlist_node *entry; + unsigned int h; + + h = xfrm_dst_hash(xnew-id.daddr, reqid, family); + hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) { + if (x-props.family == family + x-props.reqid == reqid + !xfrm_addr_cmp(x-id.daddr, xnew-id.daddr, family)) + x-genid = xfrm_state_genid; + } +} + void xfrm_state_insert(struct xfrm_state *x) { spin_lock_bh(xfrm_state_lock); + __xfrm_state_bump_genids(x); __xfrm_state_insert(x); spin_unlock_bh(xfrm_state_lock); - - xfrm_flush_all_bundles(); } EXPORT_SYMBOL(xfrm_state_insert); @@ -779,15 +796,13 @@ int xfrm_state_add(struct xfrm_state *x) x-id.proto, x-id.daddr, x-props.saddr, 0); + __xfrm_state_bump_genids(x); __xfrm_state_insert(x); err = 0; out: spin_unlock_bh(xfrm_state_lock); - if (!err) - xfrm_flush_all_bundles(); - if (x1) { xfrm_state_delete(x1); xfrm_state_put(x1); -- 1.4.2.rc2.g3e042 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 14/15]: [XFRM]: Extract common hashing code into xfrm_hash.[ch]
[XFRM]: Extract common hashing code into xfrm_hash.[ch] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/xfrm/Makefile |3 + net/xfrm/xfrm_hash.c | 41 ++ net/xfrm/xfrm_hash.h | 112 net/xfrm/xfrm_policy.c | 95 +++-- net/xfrm/xfrm_state.c | 99 -- 5 files changed, 172 insertions(+), 178 deletions(-) diff --git a/net/xfrm/Makefile b/net/xfrm/Makefile index 693aac1..de3c1a6 100644 --- a/net/xfrm/Makefile +++ b/net/xfrm/Makefile @@ -2,6 +2,7 @@ # # Makefile for the XFRM subsystem. # -obj-$(CONFIG_XFRM) := xfrm_policy.o xfrm_state.o xfrm_input.o xfrm_algo.o +obj-$(CONFIG_XFRM) := xfrm_policy.o xfrm_state.o xfrm_hash.o \ + xfrm_input.o xfrm_algo.o obj-$(CONFIG_XFRM_USER) += xfrm_user.o diff --git a/net/xfrm/xfrm_hash.c b/net/xfrm/xfrm_hash.c new file mode 100644 index 000..37643bb --- /dev/null +++ b/net/xfrm/xfrm_hash.c @@ -0,0 +1,41 @@ +/* xfrm_hash.c: Common hash table code. + * + * Copyright (C) 2006 David S. Miller ([EMAIL PROTECTED]) + */ + +#include linux/kernel.h +#include linux/mm.h +#include linux/bootmem.h +#include linux/vmalloc.h +#include linux/slab.h +#include linux/xfrm.h + +#include xfrm_hash.h + +struct hlist_head *xfrm_hash_alloc(unsigned int sz) +{ + struct hlist_head *n; + + if (sz = PAGE_SIZE) + n = kmalloc(sz, GFP_KERNEL); + else if (hashdist) + n = __vmalloc(sz, GFP_KERNEL, PAGE_KERNEL); + else + n = (struct hlist_head *) + __get_free_pages(GFP_KERNEL, get_order(sz)); + + if (n) + memset(n, 0, sz); + + return n; +} + +void xfrm_hash_free(struct hlist_head *n, unsigned int sz) +{ + if (sz = PAGE_SIZE) + kfree(n); + else if (hashdist) + vfree(n); + else + free_pages((unsigned long)n, get_order(sz)); +} diff --git a/net/xfrm/xfrm_hash.h b/net/xfrm/xfrm_hash.h new file mode 100644 index 000..ae756aa --- /dev/null +++ b/net/xfrm/xfrm_hash.h @@ -0,0 +1,112 @@ +#ifndef _XFRM_HASH_H +#define _XFRM_HASH_H + +#include linux/xfrm.h +#include linux/socket.h + +static inline unsigned int __xfrm4_daddr_hash(xfrm_address_t *daddr) +{ + return ntohl(daddr-a4); +} + +static inline unsigned int __xfrm6_daddr_hash(xfrm_address_t *daddr) +{ + return ntohl(daddr-a6[2] ^ daddr-a6[3]); +} + +static inline unsigned int __xfrm4_daddr_saddr_hash(xfrm_address_t *daddr, xfrm_address_t *saddr) +{ + return ntohl(daddr-a4 ^ saddr-a4); +} + +static inline unsigned int __xfrm6_daddr_saddr_hash(xfrm_address_t *daddr, xfrm_address_t *saddr) +{ + return ntohl(daddr-a6[2] ^ daddr-a6[3] ^ +saddr-a6[2] ^ saddr-a6[3]); +} + +static inline unsigned int __xfrm_dst_hash(xfrm_address_t *daddr, xfrm_address_t *saddr, + u32 reqid, unsigned short family, + unsigned int hmask) +{ + unsigned int h = family ^ reqid; + switch (family) { + case AF_INET: + h ^= __xfrm4_daddr_saddr_hash(daddr, saddr); + break; + case AF_INET6: + h ^= __xfrm6_daddr_saddr_hash(daddr, saddr); + break; + } + return (h ^ (h 16)) hmask; +} + +static inline unsigned int +__xfrm_spi_hash(xfrm_address_t *daddr, u32 spi, u8 proto, unsigned short family, + unsigned int hmask) +{ + unsigned int h = spi ^ proto; + switch (family) { + case AF_INET: + h ^= __xfrm4_daddr_hash(daddr); + break; + case AF_INET6: + h ^= __xfrm6_daddr_hash(daddr); + break; + } + return (h ^ (h 10) ^ (h 20)) hmask; +} + +static inline unsigned int __idx_hash(u32 index, unsigned int hmask) +{ + return (index ^ (index 8)) hmask; +} + +static inline unsigned int __sel_hash(struct xfrm_selector *sel, unsigned short family, unsigned int hmask) +{ + xfrm_address_t *daddr = sel-daddr; + xfrm_address_t *saddr = sel-saddr; + unsigned int h = 0; + + switch (family) { + case AF_INET: + if (sel-prefixlen_d != 32 || + sel-prefixlen_s != 32) + return hmask + 1; + + h = __xfrm4_daddr_saddr_hash(daddr, saddr); + break; + + case AF_INET6: + if (sel-prefixlen_d != 128 || + sel-prefixlen_s != 128) + return hmask + 1; + + h = __xfrm6_daddr_saddr_hash(daddr, saddr); + break; + }; + h ^= (h 16); + return h hmask; +} + +static inline unsigned int __addr_hash(xfrm_address_t *daddr, xfrm_address_t *saddr, unsigned short family, unsigned int hmask) +{ + unsigned int h = 0; + +
[PATCH 6/15]: [XFRM]: Add generation count to xfrm_state and xfrm_dst.
[XFRM]: Add generation count to xfrm_state and xfrm_dst. Each xfrm_state inserted gets a new generation counter value. When a bundle is created, the xfrm_dst objects get the current generation counter of the xfrm_state they will attach to at dst-xfrm. xfrm_bundle_ok() will return false if it sees an xfrm_dst with a generation count different from the generation count of the xfrm_state that dst points to. This provides a facility by which to passively and cheaply invalidate cached IPSEC routes during SA database changes. Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/net/xfrm.h |3 +++ net/ipv4/xfrm4_policy.c |1 + net/ipv6/xfrm6_policy.c |1 + net/xfrm/xfrm_policy.c |2 ++ net/xfrm/xfrm_state.c |3 +++ 5 files changed, 10 insertions(+), 0 deletions(-) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index e2bb0a9..7d18fff 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -103,6 +103,8 @@ struct xfrm_state struct xfrm_id id; struct xfrm_selectorsel; + u32 genid; + /* Key manger bits */ struct { u8 state; @@ -540,6 +542,7 @@ struct xfrm_dst struct rt6_info rt6; } u; struct dst_entry *route; + u32 genid; u32 route_mtu_cached; u32 child_mtu_cached; u32 route_cookie; diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 8f50eae..72b75b8 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c @@ -93,6 +93,7 @@ __xfrm4_bundle_create(struct xfrm_policy xdst = (struct xfrm_dst *)dst1; xdst-route = rt-u.dst; + xdst-genid = xfrm[i]-genid; dst1-next = dst_prev; dst_prev = dst1; diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 73cd250..e46a639 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c @@ -109,6 +109,7 @@ __xfrm6_bundle_create(struct xfrm_policy xdst = (struct xfrm_dst *)dst1; xdst-route = rt-u.dst; + xdst-genid = xfrm[i]-genid; if (rt-rt6i_node) xdst-route_cookie = rt-rt6i_node-fn_sernum; diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 3da67ca..c504b9a 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -1300,6 +1300,8 @@ int xfrm_bundle_ok(struct xfrm_dst *firs return 0; if (dst-xfrm-km.state != XFRM_STATE_VALID) return 0; + if (xdst-genid != dst-xfrm-genid) + return 0; mtu = dst_mtu(dst-child); if (xdst-child_mtu_cached != mtu) { diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index af3f23e..eb17f1b 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -52,6 +52,7 @@ static struct hlist_head *xfrm_state_bys static unsigned int xfrm_state_hmask __read_mostly; static unsigned int xfrm_state_hashmax __read_mostly = 1 * 1024 * 1024; static unsigned int xfrm_state_num; +static unsigned int xfrm_state_genid; static inline unsigned int __xfrm4_dst_hash(xfrm_address_t *addr, unsigned int hmask) { @@ -640,6 +641,8 @@ static void __xfrm_state_insert(struct x { unsigned h = xfrm_dst_hash(x-id.daddr, x-props.family); + x-genid = ++xfrm_state_genid; + hlist_add_head(x-bydst, xfrm_state_bydst+h); xfrm_state_hold(x); -- 1.4.2.rc2.g3e042 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 11/15]: [XFRM]: Kill excessive refcounting of xfrm_state objects.
[XFRM]: Kill excessive refcounting of xfrm_state objects. The refcounting done for timers and hash table insertions are just wasted cycles. We can eliminate all of this refcounting because: 1) The implicit refcount when the xfrm_state object is active will always be held while the object is in the hash tables. We never kfree() the xfrm_state until long after we've made sure that it has been unhashed. 2) Timers are even easier. Once we mark that x-km.state as anything other than XFRM_STATE_VALID (__xfrm_state_delete sets it to XFRM_STATE_DEAD), any timer that fires will do nothing and return without rearming the timer. Therefore we can defer the del_timer calls until when the object is about to be freed up during GC. We have to use del_timer_sync() and defer it to GC because we can't do a del_timer_sync() while holding x-lock which all callers of __xfrm_state_delete hold. This makes SA changes even more light-weight. Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/xfrm/xfrm_state.c | 54 + 1 files changed, 14 insertions(+), 40 deletions(-) diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index b1c0ae7..814e72e 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -229,10 +229,8 @@ void km_state_expired(struct xfrm_state static void xfrm_state_gc_destroy(struct xfrm_state *x) { - if (del_timer(x-timer)) - BUG(); - if (del_timer(x-rtimer)) - BUG(); + del_timer_sync(x-timer); + del_timer_sync(x-rtimer); kfree(x-aalg); kfree(x-ealg); kfree(x-calg); @@ -323,9 +321,9 @@ static void xfrm_timer_handler(unsigned if (warn) km_state_expired(x, 0, 0); resched: - if (next != LONG_MAX - !mod_timer(x-timer, jiffies + make_jiffies(next))) - xfrm_state_hold(x); + if (next != LONG_MAX) + mod_timer(x-timer, jiffies + make_jiffies(next)); + goto out; expired: @@ -340,7 +338,6 @@ expired: out: spin_unlock(x-lock); - xfrm_state_put(x); } static void xfrm_replay_timer_handler(unsigned long data); @@ -394,17 +391,10 @@ int __xfrm_state_delete(struct xfrm_stat x-km.state = XFRM_STATE_DEAD; spin_lock(xfrm_state_lock); hlist_del(x-bydst); - __xfrm_state_put(x); - if (x-id.spi) { + if (x-id.spi) hlist_del(x-byspi); - __xfrm_state_put(x); - } xfrm_state_num--; spin_unlock(xfrm_state_lock); - if (del_timer(x-timer)) - __xfrm_state_put(x); - if (del_timer(x-rtimer)) - __xfrm_state_put(x); /* All xfrm_state objects are created by xfrm_state_alloc. * The xfrm_state_alloc call gives a reference, and that @@ -579,14 +569,11 @@ xfrm_state_find(xfrm_address_t *daddr, x if (km_query(x, tmpl, pol) == 0) { x-km.state = XFRM_STATE_ACQ; hlist_add_head(x-bydst, xfrm_state_bydst+h); - xfrm_state_hold(x); if (x-id.spi) { h = xfrm_spi_hash(x-id.daddr, x-id.spi, x-id.proto, family); hlist_add_head(x-byspi, xfrm_state_byspi+h); - xfrm_state_hold(x); } x-lft.hard_add_expires_seconds = XFRM_ACQ_EXPIRES; - xfrm_state_hold(x); x-timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ; add_timer(x-timer); } else { @@ -609,24 +596,17 @@ static void __xfrm_state_insert(struct x { unsigned int h; - h = xfrm_dst_hash(x-id.daddr, x-props.reqid, x-props.family); - x-genid = ++xfrm_state_genid; + h = xfrm_dst_hash(x-id.daddr, x-props.reqid, x-props.family); hlist_add_head(x-bydst, xfrm_state_bydst+h); - xfrm_state_hold(x); h = xfrm_spi_hash(x-id.daddr, x-id.spi, x-id.proto, x-props.family); - hlist_add_head(x-byspi, xfrm_state_byspi+h); - xfrm_state_hold(x); - - if (!mod_timer(x-timer, jiffies + HZ)) - xfrm_state_hold(x); - if (x-replay_maxage - !mod_timer(x-rtimer, jiffies + x-replay_maxage)) - xfrm_state_hold(x); + mod_timer(x-timer, jiffies + HZ); + if (x-replay_maxage) + mod_timer(x-rtimer, jiffies + x-replay_maxage); wake_up(km_waitq); @@ -738,7 +718,6 @@ static struct xfrm_state *__find_acq_cor xfrm_state_hold(x); x-timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ; add_timer(x-timer); - xfrm_state_hold(x);
[PATCH 0/15]: Fix algorithmic complexity of XFRM control plane
This is a repost of the series I sent the other day with significant additions and some minor mods to the original patches. The biggest change since my last posting of this stuff is to add hashing of non-prefixed policies to speed up policy insert/delete and lookup. Alexey Kuznetsov is who this idea came from. I consider these bits logically complete at this point. In all of my stress testing the things showing up at the top of the profiles now are bzero() in glibc, and memset/memcpy in the kernel :-) On my desktop I can insert about 60,000 SA entries per second, and I can insert about 130,000 SPD entries per second. Before these changes trying to insert even 30,000 SPD entries would probably take a half hour or so on the same system. So we clearly needed improvements here. The basic summary: 1) Hash xfrm_state objects using two dynamically sized hash tables. One hashes on SPI/PROTO/DADDR, the other on FAMILY/REQID/DADDR/SADDR SPI/PROTO/DADDR hash is used on packet input. FAMILY/REQID/DADDR/SADDR hash is used on output route resolution lookup, and insertion conflict resolution. It is also used to assist handling of potential shadowing of xfrm_state objects when a new xfrm_state is inserted. 2) Hash xfrm_policy objects by index and DADDR/SADDR if not prefixed. By prefixed we mean that either the DADDR or the SADDR are specifying a masked subnet instead of a full IP address. All xfrm_policy objects go into the index hash, which is used for generating unique policy-index values. If an xfrm_policy is prefixed it goes onto a per-direction singly linked list which looks like the policy lists the code used to have. If an xfrm_policy is not prefixed, it is instead inserted into a per-direction hash table which is consulted first on lookups. All of the policy hashes are dynamically sized as needed. 3) xfrm_state objects were excessively reference counted. The based implicit reference protected entry into the hashtables, and in exchange for not refcounting each timer reference we only pay a del_timer_sync() at GC destruction time. 4) xfrm_state insertion of transformations using ESP were computationally dominated by the initial IV value computation, via get_random_bytes(). We can defer this until the first time we actually try to output a packet using this xfrm_state. This is good for another reason, if the xfrm_state is just for input packet the initial IV initialization just wastes random number entropy since it will never be used. 5) Generation IDs are used to keep xfrm_state insert/delete from having to touch the xfrm_policy database and vice versa. Previously adding or removing an xfrm_state required flushing policy layer cached routes and other ugly crap like that. Every time we add an xfrm_state into the hashes, we give it a new generation count. When a cached route is made which points to that entry, the cached route records this generation count. On every use of that route, we'll go through xfrm_dst_check() which will make sure the generation count of the cached route still matches the count of the xfrm_state it refers to. If not, the route will be relooked up. When we insert a new xfrm_state, we look for any existing xfrm_states that match the same FAMILY/REQID/DADDR/SADDR. On each such match we assign a new generation count to force a mismatch with any cached routes referring to those entries. A route relookup will also be forced on xfrm_state removal because xfrm_dst_check() makes sure that xfrm_state-km.state is set to XFRM_STATE_VALID. 6) All linkage converted to hlists so that the hash tables are more compact. This made xfrm_policy_insert()'s priority based insertion a little hairy, but overall it seems to be a clear improvement. Well... I guess that was actually the not-so-basic summary :-) Now that the control plane is reasonably fast I'll start looking at the data path. One of the first ideas I have derived with Herbert Xu is to put the policy bundle cached routes into the flow cache. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/15]: [XFRM]: Convert xfrm_state hash linkage to hlists.
[XFRM]: Convert xfrm_state hash linkage to hlists. Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/net/xfrm.h|4 +-- net/xfrm/xfrm_state.c | 71 +++-- 2 files changed, 41 insertions(+), 34 deletions(-) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 2cbaee7..e2bb0a9 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -94,8 +94,8 @@ extern struct mutex xfrm_cfg_mutex; struct xfrm_state { /* Note: bydst is re-used during gc */ - struct list_headbydst; - struct list_headbyspi; + struct hlist_node bydst; + struct hlist_node byspi; atomic_trefcnt; spinlock_t lock; diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index e4b0c6e..724479f 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -46,8 +46,8 @@ #define XFRM_DST_HSIZE1024 * Main use is finding SA after policy selected tunnel or transport mode. * Also, it can be used by ah/esp icmp error handler to find offending SA. */ -static struct list_head xfrm_state_bydst[XFRM_DST_HSIZE]; -static struct list_head xfrm_state_byspi[XFRM_DST_HSIZE]; +static struct hlist_head xfrm_state_bydst[XFRM_DST_HSIZE]; +static struct hlist_head xfrm_state_byspi[XFRM_DST_HSIZE]; static __inline__ unsigned __xfrm4_dst_hash(xfrm_address_t *addr) @@ -116,7 +116,7 @@ static DEFINE_RWLOCK(xfrm_state_afinfo_l static struct xfrm_state_afinfo *xfrm_state_afinfo[NPROTO]; static struct work_struct xfrm_state_gc_work; -static struct list_head xfrm_state_gc_list = LIST_HEAD_INIT(xfrm_state_gc_list); +static HLIST_HEAD(xfrm_state_gc_list); static DEFINE_SPINLOCK(xfrm_state_gc_lock); static int xfrm_state_gc_flush_bundles; @@ -152,8 +152,8 @@ static void xfrm_state_gc_destroy(struct static void xfrm_state_gc_task(void *data) { struct xfrm_state *x; - struct list_head *entry, *tmp; - struct list_head gc_list = LIST_HEAD_INIT(gc_list); + struct hlist_node *entry, *tmp; + struct hlist_head gc_list; if (xfrm_state_gc_flush_bundles) { xfrm_state_gc_flush_bundles = 0; @@ -161,13 +161,13 @@ static void xfrm_state_gc_task(void *dat } spin_lock_bh(xfrm_state_gc_lock); - list_splice_init(xfrm_state_gc_list, gc_list); + gc_list.first = xfrm_state_gc_list.first; + INIT_HLIST_HEAD(xfrm_state_gc_list); spin_unlock_bh(xfrm_state_gc_lock); - list_for_each_safe(entry, tmp, gc_list) { - x = list_entry(entry, struct xfrm_state, bydst); + hlist_for_each_entry_safe(x, entry, tmp, gc_list, bydst) xfrm_state_gc_destroy(x); - } + wake_up(km_waitq); } @@ -261,8 +261,8 @@ struct xfrm_state *xfrm_state_alloc(void if (x) { atomic_set(x-refcnt, 1); atomic_set(x-tunnel_users, 0); - INIT_LIST_HEAD(x-bydst); - INIT_LIST_HEAD(x-byspi); + INIT_HLIST_NODE(x-bydst); + INIT_HLIST_NODE(x-byspi); init_timer(x-timer); x-timer.function = xfrm_timer_handler; x-timer.data = (unsigned long)x; @@ -287,7 +287,7 @@ void __xfrm_state_destroy(struct xfrm_st BUG_TRAP(x-km.state == XFRM_STATE_DEAD); spin_lock_bh(xfrm_state_gc_lock); - list_add(x-bydst, xfrm_state_gc_list); + hlist_add_head(x-bydst, xfrm_state_gc_list); spin_unlock_bh(xfrm_state_gc_lock); schedule_work(xfrm_state_gc_work); } @@ -300,10 +300,10 @@ int __xfrm_state_delete(struct xfrm_stat if (x-km.state != XFRM_STATE_DEAD) { x-km.state = XFRM_STATE_DEAD; spin_lock(xfrm_state_lock); - list_del(x-bydst); + hlist_del(x-bydst); __xfrm_state_put(x); if (x-id.spi) { - list_del(x-byspi); + hlist_del(x-byspi); __xfrm_state_put(x); } spin_unlock(xfrm_state_lock); @@ -349,12 +349,13 @@ EXPORT_SYMBOL(xfrm_state_delete); void xfrm_state_flush(u8 proto) { int i; - struct xfrm_state *x; spin_lock_bh(xfrm_state_lock); for (i = 0; i XFRM_DST_HSIZE; i++) { + struct hlist_node *entry; + struct xfrm_state *x; restart: - list_for_each_entry(x, xfrm_state_bydst+i, bydst) { + hlist_for_each_entry(x, entry, xfrm_state_bydst+i, bydst) { if (!xfrm_state_kern(x) (proto == IPSEC_PROTO_ANY || x-id.proto == proto)) { xfrm_state_hold(x); @@ -391,8 +392,9 @@ static struct xfrm_state *__xfrm_state_l { unsigned int h = xfrm_spi_hash(daddr, spi, proto, family); struct xfrm_state *x; + struct hlist_node *entry; -
[PATCH 5/15]: [XFRM]: Dynamic xfrm_state hash table sizing.
[XFRM]: Dynamic xfrm_state hash table sizing. The grow algorithm is simple, we grow if: 1) we see a hash chain collision at insert, and 2) we haven't hit the hash size limit (currently 1*1024*1024 slots), and 3) the number of xfrm_state objects is the current hash mask All of this needs some tweaking. Remove __initdata from hashdist so we can use it safely at run time. Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/linux/bootmem.h |2 mm/page_alloc.c |2 net/xfrm/xfrm_state.c | 200 ++- 3 files changed, 165 insertions(+), 39 deletions(-) diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 1021f50..e319c64 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h @@ -114,7 +114,7 @@ #define HASHDIST_DEFAULT 1 #else #define HASHDIST_DEFAULT 0 #endif -extern int __initdata hashdist;/* Distribute hashes across NUMA nodes? */ +extern int hashdist; /* Distribute hashes across NUMA nodes? */ #endif /* _LINUX_BOOTMEM_H */ diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 54a4f53..3b5358a 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2363,7 +2363,7 @@ int percpu_pagelist_fraction_sysctl_hand return 0; } -__initdata int hashdist = HASHDIST_DEFAULT; +int hashdist = HASHDIST_DEFAULT; #ifdef CONFIG_NUMA static int __init set_hashdist(char *str) diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 724479f..af3f23e 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -18,6 +18,9 @@ #include net/xfrm.h #include linux/pfkeyv2.h #include linux/ipsec.h #include linux/module.h +#include linux/bootmem.h +#include linux/vmalloc.h +#include linux/cache.h #include asm/uaccess.h struct sock *xfrm_nl; @@ -38,77 +41,188 @@ EXPORT_SYMBOL(sysctl_xfrm_aevent_rseqth) static DEFINE_SPINLOCK(xfrm_state_lock); -#define XFRM_DST_HSIZE 1024 - /* Hash table to find appropriate SA towards given target (endpoint * of tunnel or destination of transport mode) allowed by selector. * * Main use is finding SA after policy selected tunnel or transport mode. * Also, it can be used by ah/esp icmp error handler to find offending SA. */ -static struct hlist_head xfrm_state_bydst[XFRM_DST_HSIZE]; -static struct hlist_head xfrm_state_byspi[XFRM_DST_HSIZE]; +static struct hlist_head *xfrm_state_bydst __read_mostly; +static struct hlist_head *xfrm_state_byspi __read_mostly; +static unsigned int xfrm_state_hmask __read_mostly; +static unsigned int xfrm_state_hashmax __read_mostly = 1 * 1024 * 1024; +static unsigned int xfrm_state_num; -static __inline__ -unsigned __xfrm4_dst_hash(xfrm_address_t *addr) +static inline unsigned int __xfrm4_dst_hash(xfrm_address_t *addr, unsigned int hmask) { - unsigned h; + unsigned int h; h = ntohl(addr-a4); - h = (h ^ (h16)) % XFRM_DST_HSIZE; + h = (h ^ (h16)) xfrm_state_hmask; return h; } -static __inline__ -unsigned __xfrm6_dst_hash(xfrm_address_t *addr) +static inline unsigned int __xfrm6_dst_hash(xfrm_address_t *addr, unsigned int hmask) { - unsigned h; + unsigned int h; h = ntohl(addr-a6[2]^addr-a6[3]); - h = (h ^ (h16)) % XFRM_DST_HSIZE; + h = (h ^ (h16)) hmask; return h; } -static __inline__ -unsigned xfrm_dst_hash(xfrm_address_t *addr, unsigned short family) +static inline unsigned int __xfrm_dst_hash(xfrm_address_t *addr, unsigned short family, + unsigned int hmask) { switch (family) { case AF_INET: - return __xfrm4_dst_hash(addr); + return __xfrm4_dst_hash(addr, hmask); case AF_INET6: - return __xfrm6_dst_hash(addr); + return __xfrm6_dst_hash(addr, hmask); } return 0; } -static __inline__ -unsigned __xfrm4_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto) +static inline unsigned int xfrm_dst_hash(xfrm_address_t *addr, unsigned short family) +{ + return __xfrm_dst_hash(addr, family, xfrm_state_hmask); +} + +static inline unsigned int __xfrm4_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto, + unsigned int hmask) { - unsigned h; + unsigned int h; h = ntohl(addr-a4^spi^proto); - h = (h ^ (h10) ^ (h20)) % XFRM_DST_HSIZE; + h = (h ^ (h10) ^ (h20)) hmask; return h; } -static __inline__ -unsigned __xfrm6_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto) +static inline unsigned int __xfrm6_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto, + unsigned int hmask) { - unsigned h; + unsigned int h; h = ntohl(addr-a6[2]^addr-a6[3]^spi^proto); - h = (h ^ (h10) ^ (h20)) % XFRM_DST_HSIZE; + h = (h ^ (h10) ^ (h20)) hmask; return h; } -static __inline__ -unsigned xfrm_spi_hash(xfrm_address_t
[PATCH 1/15] [XFRM]: Pull xfrm_state_bydst hash table knowledge out of afinfo.
[XFRM]: Pull xfrm_state_bydst hash table knowledge out of afinfo. Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/net/xfrm.h | 34 - net/ipv4/xfrm4_state.c | 50 --- net/ipv6/xfrm6_state.c | 53 net/xfrm/xfrm_state.c | 125 4 files changed, 115 insertions(+), 147 deletions(-) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 9c5ee9f..e53819f 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -235,16 +235,12 @@ extern int __xfrm_state_delete(struct xf struct xfrm_state_afinfo { unsigned short family; - struct list_head*state_bydst; struct list_head*state_byspi; int (*init_flags)(struct xfrm_state *x); void(*init_tempsel)(struct xfrm_state *x, struct flowi *fl, struct xfrm_tmpl *tmpl, xfrm_address_t *daddr, xfrm_address_t *saddr); struct xfrm_state *(*state_lookup)(xfrm_address_t *daddr, u32 spi, u8 proto); - struct xfrm_state *(*find_acq)(u8 mode, u32 reqid, u8 proto, -xfrm_address_t *daddr, xfrm_address_t *saddr, -int create); }; extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); @@ -391,36 +387,6 @@ static inline void xfrm_pol_put(struct x #define XFRM_DST_HSIZE 1024 static __inline__ -unsigned __xfrm4_dst_hash(xfrm_address_t *addr) -{ - unsigned h; - h = ntohl(addr-a4); - h = (h ^ (h16)) % XFRM_DST_HSIZE; - return h; -} - -static __inline__ -unsigned __xfrm6_dst_hash(xfrm_address_t *addr) -{ - unsigned h; - h = ntohl(addr-a6[2]^addr-a6[3]); - h = (h ^ (h16)) % XFRM_DST_HSIZE; - return h; -} - -static __inline__ -unsigned xfrm_dst_hash(xfrm_address_t *addr, unsigned short family) -{ - switch (family) { - case AF_INET: - return __xfrm4_dst_hash(addr); - case AF_INET6: - return __xfrm6_dst_hash(addr); - } - return 0; -} - -static __inline__ unsigned __xfrm4_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto) { unsigned h; diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c index 81e1751..f0a77fc 100644 --- a/net/ipv4/xfrm4_state.c +++ b/net/ipv4/xfrm4_state.c @@ -80,61 +80,11 @@ __xfrm4_state_lookup(xfrm_address_t *dad return NULL; } -static struct xfrm_state * -__xfrm4_find_acq(u8 mode, u32 reqid, u8 proto, -xfrm_address_t *daddr, xfrm_address_t *saddr, -int create) -{ - struct xfrm_state *x, *x0; - unsigned h = __xfrm4_dst_hash(daddr); - - x0 = NULL; - - list_for_each_entry(x, xfrm4_state_afinfo.state_bydst+h, bydst) { - if (x-props.family == AF_INET - daddr-a4 == x-id.daddr.a4 - mode == x-props.mode - proto == x-id.proto - saddr-a4 == x-props.saddr.a4 - reqid == x-props.reqid - x-km.state == XFRM_STATE_ACQ - !x-id.spi) { - x0 = x; - break; - } - } - if (!x0 create (x0 = xfrm_state_alloc()) != NULL) { - x0-sel.daddr.a4 = daddr-a4; - x0-sel.saddr.a4 = saddr-a4; - x0-sel.prefixlen_d = 32; - x0-sel.prefixlen_s = 32; - x0-props.saddr.a4 = saddr-a4; - x0-km.state = XFRM_STATE_ACQ; - x0-id.daddr.a4 = daddr-a4; - x0-id.proto = proto; - x0-props.family = AF_INET; - x0-props.mode = mode; - x0-props.reqid = reqid; - x0-props.family = AF_INET; - x0-lft.hard_add_expires_seconds = XFRM_ACQ_EXPIRES; - xfrm_state_hold(x0); - x0-timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ; - add_timer(x0-timer); - xfrm_state_hold(x0); - list_add_tail(x0-bydst, xfrm4_state_afinfo.state_bydst+h); - wake_up(km_waitq); - } - if (x0) - xfrm_state_hold(x0); - return x0; -} - static struct xfrm_state_afinfo xfrm4_state_afinfo = { .family = AF_INET, .init_flags = xfrm4_init_flags, .init_tempsel = __xfrm4_init_tempsel, .state_lookup = __xfrm4_state_lookup, - .find_acq = __xfrm4_find_acq, }; void __init xfrm4_state_init(void) diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c index b33296b..c43e45d 100644 --- a/net/ipv6/xfrm6_state.c +++ b/net/ipv6/xfrm6_state.c @@ -81,63 +81,10 @@ __xfrm6_state_lookup(xfrm_address_t *dad
[PATCH 2/15]: [XFRM]: Pull xfrm_state_byspi hash table knowledge out of afinfo.
[XFRM]: Pull xfrm_state_byspi hash table knowledge out of afinfo. Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/net/xfrm.h |2 - net/ipv4/xfrm4_state.c | 19 net/ipv6/xfrm6_state.c | 19 net/xfrm/xfrm_state.c | 73 ++-- 4 files changed, 39 insertions(+), 74 deletions(-) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index e53819f..00ae025 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -235,12 +235,10 @@ extern int __xfrm_state_delete(struct xf struct xfrm_state_afinfo { unsigned short family; - struct list_head*state_byspi; int (*init_flags)(struct xfrm_state *x); void(*init_tempsel)(struct xfrm_state *x, struct flowi *fl, struct xfrm_tmpl *tmpl, xfrm_address_t *daddr, xfrm_address_t *saddr); - struct xfrm_state *(*state_lookup)(xfrm_address_t *daddr, u32 spi, u8 proto); }; extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); diff --git a/net/ipv4/xfrm4_state.c b/net/ipv4/xfrm4_state.c index f0a77fc..097cb5d 100644 --- a/net/ipv4/xfrm4_state.c +++ b/net/ipv4/xfrm4_state.c @@ -62,29 +62,10 @@ __xfrm4_init_tempsel(struct xfrm_state * x-props.family = AF_INET; } -static struct xfrm_state * -__xfrm4_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto) -{ - unsigned h = __xfrm4_spi_hash(daddr, spi, proto); - struct xfrm_state *x; - - list_for_each_entry(x, xfrm4_state_afinfo.state_byspi+h, byspi) { - if (x-props.family == AF_INET - spi == x-id.spi - daddr-a4 == x-id.daddr.a4 - proto == x-id.proto) { - xfrm_state_hold(x); - return x; - } - } - return NULL; -} - static struct xfrm_state_afinfo xfrm4_state_afinfo = { .family = AF_INET, .init_flags = xfrm4_init_flags, .init_tempsel = __xfrm4_init_tempsel, - .state_lookup = __xfrm4_state_lookup, }; void __init xfrm4_state_init(void) diff --git a/net/ipv6/xfrm6_state.c b/net/ipv6/xfrm6_state.c index c43e45d..90ad0a4 100644 --- a/net/ipv6/xfrm6_state.c +++ b/net/ipv6/xfrm6_state.c @@ -63,28 +63,9 @@ __xfrm6_init_tempsel(struct xfrm_state * x-props.family = AF_INET6; } -static struct xfrm_state * -__xfrm6_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto) -{ - unsigned h = __xfrm6_spi_hash(daddr, spi, proto); - struct xfrm_state *x; - - list_for_each_entry(x, xfrm6_state_afinfo.state_byspi+h, byspi) { - if (x-props.family == AF_INET6 - spi == x-id.spi - ipv6_addr_equal((struct in6_addr *)daddr, (struct in6_addr *)x-id.daddr.a6) - proto == x-id.proto) { - xfrm_state_hold(x); - return x; - } - } - return NULL; -} - static struct xfrm_state_afinfo xfrm6_state_afinfo = { .family = AF_INET6, .init_tempsel = __xfrm6_init_tempsel, - .state_lookup = __xfrm6_state_lookup, }; void __init xfrm6_state_init(void) diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index da67054..9da47aa 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -355,6 +355,37 @@ xfrm_init_tempsel(struct xfrm_state *x, return 0; } +static struct xfrm_state *__xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto, unsigned short family) +{ + unsigned int h = xfrm_spi_hash(daddr, spi, proto, family); + struct xfrm_state *x; + + list_for_each_entry(x, xfrm_state_byspi+h, byspi) { + if (x-props.family != family || + x-id.spi != spi || + x-id.proto != proto) + continue; + + switch (family) { + case AF_INET: + if (x-id.daddr.a4 != daddr-a4) + continue; + break; + case AF_INET6: + if (!ipv6_addr_equal((struct in6_addr *)daddr, +(struct in6_addr *) +x-id.daddr.a6)) + continue; + break; + }; + + xfrm_state_hold(x); + return x; + } + + return NULL; +} + struct xfrm_state * xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, struct flowi *fl, struct xfrm_tmpl *tmpl, @@ -366,14 +397,7 @@ xfrm_state_find(xfrm_address_t *daddr, x int acquire_in_progress = 0; int error = 0; struct
[PATCH 12/15]: [XFRM]: Hash xfrm_state objects by source address too.
[XFRM]: Hash xfrm_state objects by source address too. The source address is always non-prefixed so we should use it to help give entropy to the bydst hash. Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/xfrm/xfrm_state.c | 51 +++-- 1 files changed, 32 insertions(+), 19 deletions(-) diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 814e72e..f97872e 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -54,49 +54,60 @@ static unsigned int xfrm_state_hashmax _ static unsigned int xfrm_state_num; static unsigned int xfrm_state_genid; -static inline unsigned int __xfrm4_addr_hash(xfrm_address_t *addr) +static inline unsigned int __xfrm4_daddr_hash(xfrm_address_t *daddr) { - return ntohl(addr-a4); + return ntohl(daddr-a4); } -static inline unsigned int __xfrm6_addr_hash(xfrm_address_t *addr) +static inline unsigned int __xfrm6_daddr_hash(xfrm_address_t *daddr) { - return ntohl(addr-a6[2]^addr-a6[3]); + return ntohl(daddr-a6[2] ^ daddr-a6[3]); } -static inline unsigned int __xfrm_dst_hash(xfrm_address_t *addr, +static inline unsigned int __xfrm4_daddr_saddr_hash(xfrm_address_t *daddr, xfrm_address_t *saddr) +{ + return ntohl(daddr-a4 ^ saddr-a4); +} + +static inline unsigned int __xfrm6_daddr_saddr_hash(xfrm_address_t *daddr, xfrm_address_t *saddr) +{ + return ntohl(daddr-a6[2] ^ daddr-a6[3] ^ +saddr-a6[2] ^ saddr-a6[3]); +} + +static inline unsigned int __xfrm_dst_hash(xfrm_address_t *daddr, xfrm_address_t *saddr, u32 reqid, unsigned short family, unsigned int hmask) { unsigned int h = family ^ reqid; switch (family) { case AF_INET: - h ^= __xfrm4_addr_hash(addr); + h ^= __xfrm4_daddr_saddr_hash(daddr, saddr); break; case AF_INET6: - h ^= __xfrm6_addr_hash(addr); + h ^= __xfrm6_daddr_saddr_hash(daddr, saddr); break; } return (h ^ (h 16)) hmask; } -static inline unsigned int xfrm_dst_hash(xfrm_address_t *addr, +static inline unsigned int xfrm_dst_hash(xfrm_address_t *daddr, xfrm_address_t *saddr, u32 reqid, unsigned short family) { - return __xfrm_dst_hash(addr, reqid, family, xfrm_state_hmask); + return __xfrm_dst_hash(daddr, saddr, reqid, family, xfrm_state_hmask); } static inline unsigned int -__xfrm_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto, unsigned short family, +__xfrm_spi_hash(xfrm_address_t *daddr, u32 spi, u8 proto, unsigned short family, unsigned int hmask) { unsigned int h = spi ^ proto; switch (family) { case AF_INET: - h ^= __xfrm4_addr_hash(addr); + h ^= __xfrm4_daddr_hash(daddr); break; case AF_INET6: - h ^= __xfrm6_addr_hash(addr); + h ^= __xfrm6_daddr_hash(daddr); break; } return (h ^ (h 10) ^ (h 20)) hmask; @@ -147,8 +158,9 @@ static void xfrm_hash_transfer(struct hl hlist_for_each_entry_safe(x, entry, tmp, list, bydst) { unsigned int h; - h = __xfrm_dst_hash(x-id.daddr, x-props.reqid, - x-props.family, nhashmask); + h = __xfrm_dst_hash(x-id.daddr, x-props.saddr, + x-props.reqid, x-props.family, + nhashmask); hlist_add_head(x-bydst, ndsttable+h); h = __xfrm_spi_hash(x-id.daddr, x-id.spi, x-id.proto, @@ -500,7 +512,7 @@ xfrm_state_find(xfrm_address_t *daddr, x struct xfrm_policy *pol, int *err, unsigned short family) { - unsigned int h = xfrm_dst_hash(daddr, tmpl-reqid, family); + unsigned int h = xfrm_dst_hash(daddr, saddr, tmpl-reqid, family); struct hlist_node *entry; struct xfrm_state *x, *x0; int acquire_in_progress = 0; @@ -598,7 +610,7 @@ static void __xfrm_state_insert(struct x x-genid = ++xfrm_state_genid; - h = xfrm_dst_hash(x-id.daddr, x-props.reqid, x-props.family); + h = xfrm_dst_hash(x-id.daddr, x-props.saddr, x-props.reqid, x-props.family); hlist_add_head(x-bydst, xfrm_state_bydst+h); h = xfrm_spi_hash(x-id.daddr, x-id.spi, x-id.proto, x-props.family); @@ -627,11 +639,12 @@ static void __xfrm_state_bump_genids(str struct hlist_node *entry; unsigned int h; - h = xfrm_dst_hash(xnew-id.daddr, reqid, family); + h = xfrm_dst_hash(xnew-id.daddr, xnew-props.saddr, reqid, family); hlist_for_each_entry(x, entry, xfrm_state_bydst+h, bydst) { if (x-props.family == family x-props.reqid == reqid -
Re: [PATCH 3/9] network namespaces: playing and debugging
Temporary code to play with network namespaces in the simplest way. Do exec 7 /proc/net/net_ns in your bash shell and you'll get a brand new network namespace. There you can, for example, do ip link set lo up ip addr list ip addr add 1.2.3.4 dev lo ping -n 1.2.3.4 Signed-off-by: Andrey Savochkin [EMAIL PROTECTED] NACK, new /proc interfaces are not acceptable. As you can find from the comment this patch is just for playing with network namespace. Kirill - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 8/15]: [XFRM]: Simplify xfrm_spi_hash
[XFRM]: Simplify xfrm_spi_hash It can use __xfrm{4,6}_addr_hash(). Signed-off-by: David S. Miller [EMAIL PROTECTED] --- net/xfrm/xfrm_state.c | 27 ++- 1 files changed, 6 insertions(+), 21 deletions(-) diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 9b3ab5c..3e8485a 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -86,35 +86,20 @@ static inline unsigned int xfrm_dst_hash return __xfrm_dst_hash(addr, reqid, family, xfrm_state_hmask); } -static inline unsigned int __xfrm4_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto, - unsigned int hmask) -{ - unsigned int h; - h = ntohl(addr-a4^spi^proto); - h = (h ^ (h10) ^ (h20)) hmask; - return h; -} - -static inline unsigned int __xfrm6_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto, - unsigned int hmask) -{ - unsigned int h; - h = ntohl(addr-a6[2]^addr-a6[3]^spi^proto); - h = (h ^ (h10) ^ (h20)) hmask; - return h; -} - static inline unsigned int __xfrm_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto, unsigned short family, unsigned int hmask) { + unsigned int h = spi ^ proto; switch (family) { case AF_INET: - return __xfrm4_spi_hash(addr, spi, proto, hmask); + h ^= __xfrm4_addr_hash(addr); + break; case AF_INET6: - return __xfrm6_spi_hash(addr, spi, proto, hmask); + h ^= __xfrm6_addr_hash(addr); + break; } - return 0; /*XXX*/ + return (h ^ (h 10) ^ (h 20)) hmask; } static inline unsigned int -- 1.4.2.rc2.g3e042 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/15]: [XFRM]: Move SPI hashing functions local to xfrm_state.c
[XFRM]: Move SPI hashing functions local to xfrm_state.c Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/net/xfrm.h| 32 net/xfrm/xfrm_state.c | 32 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 00ae025..2cbaee7 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -382,38 +382,6 @@ static inline void xfrm_pol_put(struct x __xfrm_policy_destroy(policy); } -#define XFRM_DST_HSIZE 1024 - -static __inline__ -unsigned __xfrm4_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto) -{ - unsigned h; - h = ntohl(addr-a4^spi^proto); - h = (h ^ (h10) ^ (h20)) % XFRM_DST_HSIZE; - return h; -} - -static __inline__ -unsigned __xfrm6_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto) -{ - unsigned h; - h = ntohl(addr-a6[2]^addr-a6[3]^spi^proto); - h = (h ^ (h10) ^ (h20)) % XFRM_DST_HSIZE; - return h; -} - -static __inline__ -unsigned xfrm_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto, unsigned short family) -{ - switch (family) { - case AF_INET: - return __xfrm4_spi_hash(addr, spi, proto); - case AF_INET6: - return __xfrm6_spi_hash(addr, spi, proto); - } - return 0; /*XXX*/ -} - extern void __xfrm_state_destroy(struct xfrm_state *); static inline void __xfrm_state_put(struct xfrm_state *x) diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 9da47aa..e4b0c6e 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -38,6 +38,8 @@ EXPORT_SYMBOL(sysctl_xfrm_aevent_rseqth) static DEFINE_SPINLOCK(xfrm_state_lock); +#define XFRM_DST_HSIZE 1024 + /* Hash table to find appropriate SA towards given target (endpoint * of tunnel or destination of transport mode) allowed by selector. * @@ -77,6 +79,36 @@ unsigned xfrm_dst_hash(xfrm_address_t *a return 0; } +static __inline__ +unsigned __xfrm4_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto) +{ + unsigned h; + h = ntohl(addr-a4^spi^proto); + h = (h ^ (h10) ^ (h20)) % XFRM_DST_HSIZE; + return h; +} + +static __inline__ +unsigned __xfrm6_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto) +{ + unsigned h; + h = ntohl(addr-a6[2]^addr-a6[3]^spi^proto); + h = (h ^ (h10) ^ (h20)) % XFRM_DST_HSIZE; + return h; +} + +static __inline__ +unsigned xfrm_spi_hash(xfrm_address_t *addr, u32 spi, u8 proto, unsigned short family) +{ + switch (family) { + case AF_INET: + return __xfrm4_spi_hash(addr, spi, proto); + case AF_INET6: + return __xfrm6_spi_hash(addr, spi, proto); + } + return 0; /*XXX*/ +} + DECLARE_WAIT_QUEUE_HEAD(km_waitq); EXPORT_SYMBOL(km_waitq); -- 1.4.2.rc2.g3e042 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] network namespaces
Basically there are currently 3 approaches that have been proposed. The trivial bsdjail style as implemented by Serge and in a slightly more sophisticated version in vserver. This approach as it does not touch the packets has little to no packet level overhead. Basically this is what I have called the Level 3 approach. The more in depth approach where we modify the packet processing based upon which network interface the packet comes in on, and it looks like each namespace has it's own instance of the network stack. Roughly what was proposed earlier in this thread the Level 2 approach. This potentially has per packet overhead so we need to watch the implementation very carefully. Some weird hybrid as proposed by Daniel, that I was never clear on the semantics. The good thing is that these approaches do not contradict each other. We discussed it with Daniel during the summit and as Andrey proposed some shortcuts can be created to avoid double stack traversing. From the previous conversations my impression was that as long as we could get a Layer 2 approach that did not slow down the networking stack and was clean, everyone would be happy. agree. I'm buried in the process id namespace at the moment, and except to be so for the rest of the month, so I'm not going to be very helpful except for a few stray comments. I will be very much obliged if you find some time to review these new patches so that we could make some progress here. Thanks, Kirill - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 13/15]: [XFRM]: Hash policies when non-prefixed.
[XFRM]: Hash policies when non-prefixed. This idea is from Alexey Kuznetsov. It is common for policies to be non-prefixed. And for that case we can optimize lookups, insert, etc. quite a bit. For each direction, we have a dynamically sized policy hash table for non-prefixed policies. We also have a hash table on policy-index. For prefixed policies, we have a list per-direction which we will consult on lookups when a non-prefix hashtable lookup fails. This still isn't as efficient as I would like it. There are four immediate problems: 1) Lots of excessive refcounting, which can be fixed just like xfrm_state was 2) We do 2 hash probes on insert, one to look for dups and one to allocate a unique policy-index. Althought I wonder how much this matters since xfrm_state inserts do up to 3 hash probes and that seems to perform fine. 3) xfrm_policy_insert() is very complex because of the priority ordering and entry replacement logic. 4) Lots of counter bumping, in addition to policy refcounts, in the form of xfrm_policy_count[]. This is merely used to let code path(s) know that some IPSEC rules exist. So this count is indexed per-direction, maybe that is overkill. Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/net/xfrm.h | 10 - net/xfrm/xfrm_policy.c | 613 2 files changed, 516 insertions(+), 107 deletions(-) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 8123d49..cdd3490 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -314,8 +314,8 @@ #define XFRM_MAX_DEPTH 4 struct xfrm_policy { - struct xfrm_policy *next; - struct list_headlist; + struct hlist_node bydst; + struct hlist_node byidx; /* This lock only affects elements except for entry. */ rwlock_tlock; @@ -368,7 +368,7 @@ extern int xfrm_register_km(struct xfrm_ extern int xfrm_unregister_km(struct xfrm_mgr *km); -extern struct xfrm_policy *xfrm_policy_list[XFRM_POLICY_MAX*2]; +extern unsigned int xfrm_policy_count[XFRM_POLICY_MAX*2]; static inline void xfrm_pol_hold(struct xfrm_policy *policy) { @@ -628,7 +628,7 @@ static inline int xfrm_policy_check(stru if (sk sk-sk_policy[XFRM_POLICY_IN]) return __xfrm_policy_check(sk, dir, skb, family); - return (!xfrm_policy_list[dir] !skb-sp) || + return (!xfrm_policy_count[dir] !skb-sp) || (skb-dst-flags DST_NOPOLICY) || __xfrm_policy_check(sk, dir, skb, family); } @@ -648,7 +648,7 @@ extern int __xfrm_route_forward(struct s static inline int xfrm_route_forward(struct sk_buff *skb, unsigned short family) { - return !xfrm_policy_list[XFRM_POLICY_OUT] || + return !xfrm_policy_count[XFRM_POLICY_OUT] || (skb-dst-flags DST_NOXFRM) || __xfrm_route_forward(skb, family); } diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index bc4d66a..0f6eff8 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -22,6 +22,9 @@ #include linux/notifier.h #include linux/netdevice.h #include linux/netfilter.h #include linux/module.h +#include linux/bootmem.h +#include linux/vmalloc.h +#include linux/cache.h #include net/xfrm.h #include net/ip.h @@ -30,8 +33,8 @@ EXPORT_SYMBOL(xfrm_cfg_mutex); static DEFINE_RWLOCK(xfrm_policy_lock); -struct xfrm_policy *xfrm_policy_list[XFRM_POLICY_MAX*2]; -EXPORT_SYMBOL(xfrm_policy_list); +unsigned int xfrm_policy_count[XFRM_POLICY_MAX*2]; +EXPORT_SYMBOL(xfrm_policy_count); static DEFINE_RWLOCK(xfrm_policy_afinfo_lock); static struct xfrm_policy_afinfo *xfrm_policy_afinfo[NPROTO]; @@ -39,8 +42,7 @@ static struct xfrm_policy_afinfo *xfrm_p static kmem_cache_t *xfrm_dst_cache __read_mostly; static struct work_struct xfrm_policy_gc_work; -static struct list_head xfrm_policy_gc_list = - LIST_HEAD_INIT(xfrm_policy_gc_list); +static HLIST_HEAD(xfrm_policy_gc_list); static DEFINE_SPINLOCK(xfrm_policy_gc_lock); static struct xfrm_policy_afinfo *xfrm_policy_get_afinfo(unsigned short family); @@ -310,8 +312,10 @@ struct xfrm_policy *xfrm_policy_alloc(gf policy = kzalloc(sizeof(struct xfrm_policy), gfp); if (policy) { - atomic_set(policy-refcnt, 1); + INIT_HLIST_NODE(policy-bydst); + INIT_HLIST_NODE(policy-byidx); rwlock_init(policy-lock); + atomic_set(policy-refcnt, 1); init_timer(policy-timer); policy-timer.data = (unsigned long)policy; policy-timer.function = xfrm_policy_timer; @@ -357,17 +361,16 @@ static void xfrm_policy_gc_kill(struct x static void xfrm_policy_gc_task(void *data) { struct xfrm_policy *policy; - struct list_head *entry, *tmp; - struct list_head gc_list = LIST_HEAD_INIT(gc_list); + struct hlist_node
[PATCH 10/15]: [XFRM]: Purge dst references to deleted SAs passively.
[XFRM]: Purge dst references to deleted SAs passively. Just let GC and other normal mechanisms take care of getting rid of DST cache references to deleted xfrm_state objects instead of walking all the policy bundles. Signed-off-by: David S. Miller [EMAIL PROTECTED] --- include/net/xfrm.h |1 - net/xfrm/xfrm_policy.c |2 +- net/xfrm/xfrm_state.c | 17 - 3 files changed, 1 insertions(+), 19 deletions(-) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 3f54542..8123d49 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -895,7 +895,6 @@ struct xfrm_state * xfrm_find_acq(u8 mod int create, unsigned short family); extern void xfrm_policy_flush(void); extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); -extern int xfrm_flush_bundles(void); extern int xfrm_bundle_ok(struct xfrm_dst *xdst, struct flowi *fl, int family); extern void xfrm_init_pmtu(struct dst_entry *dst); diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index c16b30a..bc4d66a 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -1238,7 +1238,7 @@ static void __xfrm_garbage_collect(void) xfrm_prune_bundles(unused_bundle); } -int xfrm_flush_bundles(void) +static int xfrm_flush_bundles(void) { xfrm_prune_bundles(stale_bundle); return 0; diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index a3a7396..b1c0ae7 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -219,8 +219,6 @@ static struct work_struct xfrm_state_gc_ static HLIST_HEAD(xfrm_state_gc_list); static DEFINE_SPINLOCK(xfrm_state_gc_lock); -static int xfrm_state_gc_flush_bundles; - int __xfrm_state_delete(struct xfrm_state *x); static struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned short family); @@ -255,11 +253,6 @@ static void xfrm_state_gc_task(void *dat struct hlist_node *entry, *tmp; struct hlist_head gc_list; - if (xfrm_state_gc_flush_bundles) { - xfrm_state_gc_flush_bundles = 0; - xfrm_flush_bundles(); - } - spin_lock_bh(xfrm_state_gc_lock); gc_list.first = xfrm_state_gc_list.first; INIT_HLIST_HEAD(xfrm_state_gc_list); @@ -413,16 +406,6 @@ int __xfrm_state_delete(struct xfrm_stat if (del_timer(x-rtimer)) __xfrm_state_put(x); - /* The number two in this test is the reference -* mentioned in the comment below plus the reference -* our caller holds. A larger value means that -* there are DSTs attached to this xfrm_state. -*/ - if (atomic_read(x-refcnt) 2) { - xfrm_state_gc_flush_bundles = 1; - schedule_work(xfrm_state_gc_work); - } - /* All xfrm_state objects are created by xfrm_state_alloc. * The xfrm_state_alloc call gives a reference, and that * is what we are dropping here. -- 1.4.2.rc2.g3e042 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 1/7] ip1000: update maintainer information
From: Jesse Huang [EMAIL PROTECTED] update maintainer information Change Logs: update maintainer information --- drivers/net/ipg.c | 32 1 files changed, 20 insertions(+), 12 deletions(-) 11745492c8580b2e40764e7fcd6a7a35f28c7635 diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index 754ddb5..67bf552 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -1,18 +1,26 @@ -/*PCI_DEVICE_ID_IP1000 +/* + * ipg.c: Device Driver for the IP1000 Gigabit Ethernet Adapter + * + * Copyright (C) 2003, 2006 IC Plus Corp. + * + * Original Author: * - * ipg.c + * Craig Rich + * Sundance Technology, Inc. + * 1485 Saratoga Avenue + * Suite 200 + * San Jose, CA 95129 + * 408 873 4117 + * www.sundanceti.com + * [EMAIL PROTECTED] * - * IC Plus IP1000 Gigabit Ethernet Adapter Linux Driver v2.01 - * by IC Plus Corp. 2003 + * Current Maintainer: * - * Craig Rich - * Sundance Technology, Inc. - * 1485 Saratoga Avenue - * Suite 200 - * San Jose, CA 95129 - * 408 873 4117 - * www.sundanceti.com - * [EMAIL PROTECTED] + * Sorbica Shieh. + * 10F, No.47, Lane 2, Kwang-Fu RD. + * Sec. 2, Hsin-Chu, Taiwan, R.O.C. + * http://www.icplus.com.tw + * [EMAIL PROTECTED] */ #include linux/crc32.h #include linux/ethtool.h -- 1.3.2 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 6/7] ip1000: Add IPG_AC_FIFO flag when Tx reset
From: Jesse Huang [EMAIL PROTECTED] This is a bug when Tx underrun happen, Tx reset without IPG_AC_FIFO will cause Tx hold and can't transmit packet again. Change Logs: 1. Tx reset when Tx Under run will cause Tx fail 2. ipg_nic_txcleanup() add IPG_AC_FIFO when Tx reset --- drivers/net/ipg.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 7e88cf9432ea466a76f7b26d11a280300c8735f2 diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index 56ffc80..ae22fa8 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -1036,7 +1036,7 @@ static void ipg_nic_txcleanup(struct net IPG_DEBUG_MSG(Transmitter underrun.\n); sp-stats.tx_fifo_errors++; ipg_reset(dev, IPG_AC_TX_RESET | - IPG_AC_DMA | IPG_AC_NETWORK); + IPG_AC_DMA | IPG_AC_NETWORK| IPG_AC_FIFO); /* Re-configure after DMA reset. */ if ((ipg_io_config(dev) 0) || -- 1.3.GIT - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/7] ip1000: remove some default phy params
From: Jesse Huang [EMAIL PROTECTED] remove some default phy params Change Logs: remove some default phy params --- drivers/net/ipg.h | 54 + 1 files changed, 1 insertions(+), 53 deletions(-) af38044af640ea6997ad6ced277e5f42f8307d8d diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h index 58b1417..9f841d2 100644 --- a/drivers/net/ipg.h +++ b/drivers/net/ipg.h @@ -919,59 +919,7 @@ unsigned short DefaultPhyParam[] = { // 01/09/04 IP1000A v1-5 rev=0x41 (0x4100 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x42 - (0x4200 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x43 - (0x4300 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x44 - (0x4400 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x45 - (0x4500 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x46 - (0x4600 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x47 - (0x4700 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x48 - (0x4800 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x49 - (0x4900 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x4A - (0x4A00 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x4B - (0x4B00 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x4C - (0x4C00 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x4D - (0x4D00 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, - // 01/09/04 IP1000A v1-5 rev=0x4E - (0x4E00 | (07 * 4)), 31, 0x0001, 27, 0x01e0, 31, 0x0002, 27, 0xeb8e, 31, - 0x, - 30, 0x005e, 9, 0x0700, + 30, 0x005e, 9, 0x0700, 0x }; -- 1.3.2 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 4/7] ip1000: ipg_config_autoneg rewrite
From: Jesse Huang [EMAIL PROTECTED] ipg_config_autoneg rewrite Change Logs: ipg_config_autoneg rewrite --- drivers/net/ipg.c | 307 ++--- 1 files changed, 32 insertions(+), 275 deletions(-) c3f6df15430f9c05e19f36b8485b31110d52a091 diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index a996c45..f859107 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -484,26 +484,18 @@ static int ipg_config_autoneg(struct net { struct ipg_nic_private *sp = netdev_priv(dev); void __iomem *ioaddr = sp-ioaddr; + u8 phyctrl; u32 asicctrl; - u32 mac_ctl; - int phyaddr = 0; - u16 status = 0; - u16 advertisement; - u16 linkpartner_ability; - u16 gigadvertisement; - u16 giglinkpartner_ability; - u16 techabilities; int fiber; int gig; int fullduplex; int txflowcontrol; int rxflowcontrol; - u8 phyctrl; IPG_DEBUG_MSG(_config_autoneg\n); asicctrl = ioread32(ioaddr + ASIC_CTRL); - phyctrl = ioread8(ioaddr + PHY_CTRL); + phyctrl = ioread32(ioaddr + PHY_CTRL); /* Set flags for use in resolving auto-negotation, assuming * non-1000Mbps, half duplex, no flow control. @@ -519,14 +511,13 @@ static int ipg_config_autoneg(struct net */ sp-tenmbpsmode = 0; - printk(Link speed = ); + printk(KERN_INFO Link speed = ); /* Determine actual speed of operation. */ switch (phyctrl IPG_PC_LINK_SPEED) { case IPG_PC_LINK_SPEED_10MBPS: printk(10Mbps.\n); - printk(KERN_INFO %s: 10Mbps operational mode enabled.\n, - dev-name); + printk(%s: 10Mbps operational mode enabled.\n,dev-name); sp-tenmbpsmode = 1; break; case IPG_PC_LINK_SPEED_100MBPS: @@ -538,283 +529,49 @@ static int ipg_config_autoneg(struct net break; default: printk(undefined!\n); - } - - fiber = ipg_sti_fiber_detect(dev); - - /* Determine if auto-negotiation resolution is necessary. -* First check for fiber based media 10/100 media. -*/ - if ((fiber == 1) - (asicctrl (IPG_AC_PHY_SPEED10 | IPG_AC_PHY_SPEED100))) { - printk(KERN_INFO - %s: Fiber based PHY, setting full duplex, no flow control.\n, - dev-name); - - mac_ctl = ioread32(ioaddr + MAC_CTRL); - mac_ctl |= IPG_MC_DUPLEX_SELECT_FD; - mac_ctl = ~IPG_MC_TX_FLOW_CONTROL_ENABLE; - mac_ctl = ~IPG_MC_RX_FLOW_CONTROL_ENABLE; - - iowrite32(IPG_MC_RSVD_MASK mac_ctl, ioaddr + MAC_CTRL); - return 0; } - /* Determine if PHY is auto-negotiation capable. */ - phyaddr = ipg_find_phyaddr(dev); - - if (phyaddr == -1) { - printk(KERN_INFO - %s: Error on read to GMII/MII Status register.\n, - dev-name); - return -EILSEQ; - } - sp-mii_if.phy_id = phyaddr; - - IPG_DEBUG_MSG(GMII/MII PHY address = %x\n, phyaddr); - - status = mdio_read(dev, phyaddr, MII_BMSR); - - printk(PHYStatus = %x \n, status); - if ((status BMSR_ANEGCAPABLE) == 0) { - printk(KERN_INFO - %s: Error PHY unable to perform auto-negotiation.\n, - dev-name); - return -EILSEQ; - } - - advertisement = mdio_read(dev, phyaddr, MII_ADVERTISE); - linkpartner_ability = mdio_read(dev, phyaddr, MII_LPA); - - printk(PHYadvertisement=%x LinkPartner=%x \n, advertisement, - linkpartner_ability); - if ((advertisement == 0x) || (linkpartner_ability == 0x)) { - printk(KERN_INFO - %s: Error on read to GMII/MII registers 4 and/or 5.\n, - dev-name); - return -EILSEQ; + if (phyctrl IPG_PC_DUPLEX_STATUS) { + fullduplex = 1; + txflowcontrol = 1; + rxflowcontrol = 1; + } else { + fullduplex = 0; + txflowcontrol = 0; + rxflowcontrol = 0; } - fiber = ipg_tmi_fiber_detect(dev, phyaddr); - - /* Resolve full/half duplex if 1000BASE-X. */ - if ((gig == 1) (fiber == 1)) { - int bmcr; - /* -* Compare the full duplex bits in the GMII registers -* for the local device, and the link partner. If these -* bits are logic 1 in both registers, configure the -* IPG for full duplex operation. -*/ - bmcr = mdio_read(dev, phyaddr, MII_BMCR); + /* Configure full duplex, and flow control. */ + if (fullduplex == 1) { + /*
[PATCH 3/7] ip1000: remove threshold config from ipg_io_config
From: Jesse Huang [EMAIL PROTECTED] remove threshold config from ipg_io_config Change Logs: remove threshold config from ipg_io_config --- drivers/net/ipg.c | 10 +- drivers/net/ipg.h | 38 -- 2 files changed, 1 insertions(+), 47 deletions(-) 28a5c5965399fa91d31420cf41b9e7c483f2f672 diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index 67bf552..a996c45 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -943,15 +943,7 @@ static int ipg_io_config(struct net_devi ipg_nic_set_multicast_list(dev); iowrite16(IPG_MAX_RXFRAME_SIZE, ioaddr + MAX_FRAME_SIZE); - iowrite16(IPG_RE_RSVD_MASK (IPG_RXEARLYTHRESH_VALUE), - ioaddr + RX_EARLY_THRESH); - iowrite32(IPG_TT_RSVD_MASK (IPG_TXSTARTTHRESH_VALUE), - ioaddr + TX_START_THRESH); - iowrite32((IPG_RI_RSVD_MASK - ((IPG_RI_RXFRAME_COUNT IPG_RXFRAME_COUNT) | - (IPG_RI_PRIORITY_THRESH (IPG_PRIORITY_THRESH 12)) | - (IPG_RI_RXDMAWAIT_TIME (IPG_RXDMAWAIT_TIME 16, - ioaddr + RX_DMA_INT_CTRL); + iowrite8(IPG_RP_RSVD_MASK (IPG_RXDMAPOLLPERIOD_VALUE), ioaddr + RX_DMA_POLL_PERIOD); iowrite8(IPG_RU_RSVD_MASK (IPG_RXDMAURGENTTHRESH_VALUE), diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h index 9f841d2..818a677 100644 --- a/drivers/net/ipg.h +++ b/drivers/net/ipg.h @@ -80,14 +80,11 @@ enum ipg_regs { RX_DMA_BURST_THRESH = 0x24, RX_DMA_URGENT_THRESH= 0x25, RX_DMA_POLL_PERIOD = 0x26, - RX_DMA_INT_CTRL = 0x28, DEBUG_CTRL = 0x2c, ASIC_CTRL = 0x30, FIFO_CTRL = 0x38, // Unused - RX_EARLY_THRESH = 0x3a, FLOW_OFF_THRESH = 0x3c, FLOW_ON_THRESH = 0x3e, - TX_START_THRESH = 0x44, EEPROM_DATA = 0x48, EEPROM_CTRL = 0x4a, EXPROM_ADDR = 0x4c, // Unused @@ -324,12 +321,6 @@ #define IPG_RU_RSVD_MASK /* RxDMAPollPeriod */ #define IPG_RP_RSVD_MASK0xFF -/* TxStartThresh */ -#define IPG_TT_RSVD_MASK0x0FFF - -/* RxEarlyThresh */ -#define IPG_RE_RSVD_MASK0x07FF - /* ReceiveMode */ #define IPG_RM_RSVD_MASK0x3F #define IPG_RM_RECEIVEUNICAST 0x01 @@ -496,12 +487,6 @@ #define IPG_MC_RX_DISABLE #define IPG_MC_RX_ENABLED 0x2000 #define IPG_MC_PAUSED 0x4000 -/* RxDMAIntCtrl */ -#define IPG_RI_RSVD_MASK0x1CFF -#define IPG_RI_RXFRAME_COUNT0x00FF -#define IPG_RI_PRIORITY_THRESH 0x1C00 -#define IPG_RI_RXDMAWAIT_TIME 0x - /* * Tune */ @@ -662,32 +647,11 @@ #define IPG_MAXRFDPROCESS_COUNT 0x80 */ #defineIPG_MINUSEDRFDSTOFREE 0x80 -/* Specify priority threshhold for a RxDMAPriority interrupt. */ -#defineIPG_PRIORITY_THRESH 0x07 - -/* Specify the number of receive frames transferred via DMA - * before a RX interrupt is issued. - */ -#defineIPG_RXFRAME_COUNT 0x08 - /* specify the jumbo frame maximum size * per unit is 0x600 (the RxBuffer size that one RFD can carry) */ #define MAX_JUMBOSIZE 0x8 // max is 12K -/* Specify the maximum amount of time (in 64ns increments) to wait - * before issuing a RX interrupt if number of frames received - * is less than IPG_RXFRAME_COUNT. - * - * Value Time - * --- - * 0x3D09 ~1ms - * 0x061A ~100us - * 0x009C ~10us - * 0x000F ~1us - */ -#defineIPG_RXDMAWAIT_TIME 0x009C - /* Key register values loaded at driver start up. */ /* TXDMAPollPeriod is specified in 320ns increments. @@ -700,7 +664,6 @@ #define IPG_RXDMAWAIT_TIME 0x009C * 0xFF~82us */ #defineIPG_TXDMAPOLLPERIOD_VALUE 0x26 -#defineIPG_TXSTARTTHRESH_VALUE 0x0FFF /* TxDMAUrgentThresh specifies the minimum amount of * data in the transmit FIFO before asserting an @@ -737,7 +700,6 @@ #define IPG_TXDMABURSTTHRESH_VALUE 0x30 * 0xFF~82us */ #defineIPG_RXDMAPOLLPERIOD_VALUE 0x01 -#defineIPG_RXEARLYTHRESH_VALUE 0x07FF /* RxDMAUrgentThresh specifies the minimum amount of * free space within the receive FIFO before asserting -- 1.3.2 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 5/7] ip1000: Modify coding style of ipg_config_autoneg()
From: Jesse Huang [EMAIL PROTECTED] This is only coding style modify for ipg_config_autoneg(). Thanks for the suggestion form Francois. Change Logs: Modify coding style of ipg_config_autoneg() --- drivers/net/ipg.c | 17 ++--- 1 files changed, 10 insertions(+), 7 deletions(-) 737498ca620437d8179e21be4d5220333066cbbd diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index f859107..be96f93 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -491,11 +491,13 @@ static int ipg_config_autoneg(struct net int fullduplex; int txflowcontrol; int rxflowcontrol; + long MacCtrlValue; IPG_DEBUG_MSG(_config_autoneg\n); asicctrl = ioread32(ioaddr + ASIC_CTRL); - phyctrl = ioread32(ioaddr + PHY_CTRL); + phyctrl = ioread8(ioaddr + PHY_CTRL); + MacCtrlValue = ioread32(ioaddr + MAC_CTRL); /* Set flags for use in resolving auto-negotation, assuming * non-1000Mbps, half duplex, no flow control. @@ -547,22 +549,22 @@ static int ipg_config_autoneg(struct net /* Configure IPG for full duplex operation. */ printk(KERN_INFO setting full duplex, ); - iowrite32(ioread32(ioaddr + MAC_CTRL) | IPG_MC_DUPLEX_SELECT_FD, ioaddr + MAC_CTRL); + MacCtrlValue |= IPG_MC_DUPLEX_SELECT_FD; if (txflowcontrol == 1) { printk(TX flow control); - iowrite32(ioread32(ioaddr + MAC_CTRL) | IPG_MC_TX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL); + MacCtrlValue |= IPG_MC_TX_FLOW_CONTROL_ENABLE; } else { printk(no TX flow control); - iowrite32(ioread32(ioaddr + MAC_CTRL) ~IPG_MC_TX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL); + MacCtrlValue = ~IPG_MC_TX_FLOW_CONTROL_ENABLE; } if (rxflowcontrol == 1) { printk(, RX flow control.); - iowrite32(ioread32(ioaddr+MAC_CTRL) | IPG_MC_RX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL); + MacCtrlValue |= IPG_MC_RX_FLOW_CONTROL_ENABLE; } else { printk(, no RX flow control.); - iowrite32(ioread32(ioaddr+MAC_CTRL) ~IPG_MC_RX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL); + MacCtrlValue = MacCtrlValue ~IPG_MC_RX_FLOW_CONTROL_ENABLE; } printk(\n); @@ -570,8 +572,9 @@ static int ipg_config_autoneg(struct net /* Configure IPG for half duplex operation. */ printk(KERN_INFO setting half duplex, no TX flow control, no RX flow control.\n); - iowrite32(ioread32(ioaddr+MAC_CTRL) ~IPG_MC_DUPLEX_SELECT_FD ~IPG_MC_TX_FLOW_CONTROL_ENABLE ~IPG_MC_RX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL); + MacCtrlValue = ~IPG_MC_DUPLEX_SELECT_FD ~IPG_MC_TX_FLOW_CONTROL_ENABLE ~IPG_MC_RX_FLOW_CONTROL_ENABLE; } + iowrite32(MacCtrlValue , ioaddr+MAC_CTRL); return 0; } -- 1.3.GIT - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 7/7] ip1000: For compatible at PCI 66MHz issue
From: Jesse Huang [EMAIL PROTECTED] IP1000A on some motherboard when running at PCI 66MHz will cause transmit hold. I had change three functions to solve this problem. Sorry for lot of modify. Change Logs: For compatible at 66MHz issue rewrite init_tfdlist() rewrite ipg_nic_hard_start_xmit() rewrite ipg_nic_txfree() in ipg.h add: long LastTFDHoldAddr; int LastTFDHoldCnt; int ResetCurrentTFD; --- drivers/net/ipg.c | 40 +++- drivers/net/ipg.h |4 +++- 2 files changed, 34 insertions(+), 10 deletions(-) 152a32c3d36ec4ce1eee72429aa5956274bb0e6a diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index ae22fa8..8127f2c 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c @@ -886,10 +886,7 @@ static int init_tfdlist(struct net_devic IPG_DEBUG_MSG(_init_tfdlist\n); for (i = 0; i IPG_TFDLIST_LENGTH; i++) { - sp-TFDList[i].TFDNextPtr = cpu_to_le64(sp-TFDListDMAhandle + - ((sizeof(struct TFD)) * -((i + 1) % - IPG_TFDLIST_LENGTH))); + sp-TFDList[i].TFDNextPtr = 0; sp-TFDList[i].TFC = cpu_to_le64(IPG_TFC_TFDDONE); if (sp-TxBuff[i] != NULL) @@ -907,6 +904,7 @@ static int init_tfdlist(struct net_devic iowrite32((u32) (sp-TFDListDMAhandle), ioaddr + TFD_LIST_PTR_0); iowrite32(0x, ioaddr + TFD_LIST_PTR_1); + sp-ResetCurrentTFD=1; return 0; } @@ -919,6 +917,7 @@ static void ipg_nic_txfree(struct net_de struct ipg_nic_private *sp = netdev_priv(dev); int NextToFree; int maxtfdcount; + long CurrentTxTFDPtr=(ioread32(ipg_ioaddr(dev)+TFD_LIST_PTR_0)-(long)sp-TFDListDMAhandle)/(long)sizeof(struct TFD); IPG_DEBUG_MSG(_nic_txfree\n); @@ -941,8 +940,10 @@ static void ipg_nic_txfree(struct net_de * If the TFDDone bit is set, free the associated * buffer. */ - if ((le64_to_cpu(sp-TFDList[NextToFree].TFC) -IPG_TFC_TFDDONE) (NextToFree != sp-CurrentTFD)) { + if((NextToFree != sp-CurrentTFD)(NextToFree!=CurrentTxTFDPtr)) + { + //JesseAdd: setup TFDDONE for compatible issue. + sp-TFDList[NextToFree].TFC = cpu_to_le64(sp-TFDList[NextToFree].TFC|IPG_TFC_TFDDONE); /* Free the transmit buffer. */ if (sp-TxBuff[NextToFree] != NULL) { pci_unmap_single(sp-pdev, @@ -965,6 +966,15 @@ static void ipg_nic_txfree(struct net_de maxtfdcount--; } while (maxtfdcount != 0); + if(sp-LastTFDHoldCnt1000) { + sp-LastTFDHoldCnt=0; + ipg_reset(dev, IPG_AC_TX_RESET | IPG_AC_DMA | IPG_AC_NETWORK | IPG_AC_FIFO); + // Re-configure after DMA reset. + if ((ipg_io_config(dev) 0) ||(init_tfdlist(dev) 0)) { + printk(KERN_INFO%s: Error during re-configuration.\n,dev-name); + } + iowrite32(IPG_MC_RSVD_MASK (ioread32(ipg_ioaddr(dev) + MAC_CTRL) | IPG_MC_TX_ENABLE),ipg_ioaddr(dev) + MAC_CTRL); + } } /* @@ -2041,10 +2051,17 @@ static int ipg_nic_hard_start_xmit(struc * counter, modulus the length of the TFDList. */ NextTFD = (sp-CurrentTFD + 1) % IPG_TFDLIST_LENGTH; + if(sp-ResetCurrentTFD!=0) + { + sp-ResetCurrentTFD=0; + NextTFD=0; + } + /* Check for availability of next TFD. Reserve 1 for not become ring*/ + if (NextTFD == sp-LastFreedTxBuff) { + + if(sp-LastTFDHoldAddr==sp-CurrentTFD) sp-LastTFDHoldCnt++; + else {sp-LastTFDHoldAddr=sp-CurrentTFD;sp-LastTFDHoldCnt=0;} - /* Check for availability of next TFD. */ - if (!(le64_to_cpu(sp-TFDList[NextTFD].TFC) - IPG_TFC_TFDDONE) || (NextTFD == sp-LastFreedTxBuff)) { IPG_DEBUG_MSG(Next TFD not available.\n); /* Attempt to free any used TFDs. */ @@ -2058,8 +2075,11 @@ #ifdef IPG_DEBUG sp-TFDunavailCount++; #endif + iowrite32(IPG_DC_RSVD_MASK (IPG_DC_TX_DMA_POLL_NOW),ioaddr + DMA_CTRL); return -ENOMEM; } + + sp-TFDList[NextTFD].TFDNextPtr=0; sp-TxBuffDMAhandle[NextTFD].len = skb-len; sp-TxBuffDMAhandle[NextTFD].dmahandle = @@ -2151,6 +2171,8 @@ #endif * for transfer to the IPG. */ sp-TFDList[NextTFD].TFC = cpu_to_le64(~IPG_TFC_TFDDONE); + sp-TFDList[sp-CurrentTFD].TFDNextPtr=cpu_to_le64(sp-TFDListDMAhandle+ +sizeof(struct TFD)*NextTFD); /* Record frame transmit start time (jiffies = Linux
Re: [PATCH 1/7] ip1000: update maintainer information
Hi Jesse, On 8/17/06, Jesse Huang [EMAIL PROTECTED] wrote: From: Jesse Huang [EMAIL PROTECTED] update maintainer information Change Logs: update maintainer information The patches are missing signed-off-by so please resend. I am starting my vacation on friday so I suggest you send the whole driver as a patch for review at netdev@vger.kernel.org for inclusion. I can apply your patches to git://git.kernel.org/pub/scm/linux/kernel/git/penberg/netdev-ipg-2.6.git if you want, though. Only the first three patches apply and everything starting from ipg_config_autoneg rewrite' fail. Pekka - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH][RFC][RESEND] remove broken URLs from net drivers' output
Remove broken URLs (www.scyld.com) from network drivers' logging output. URLs in comments and other strings are left intact. Signed-off-by: Markus Dahms [EMAIL PROTECTED] --- (second try, got no reaction last time) I was tired of always seeing an URL not working anymore on initialization of 3c59x and natsemi. So this is an attempt to get rid of these messages. The patch is against 2.6.18-rc4-git (c4e321b85a89d7cd392d3105b2c033a6c58ed337 from .../gregkh/linux-2.6). Btw: Is there a policy for message output for drivers with respect to author name, email addresses, copyright messages or home pages? Markus 3c509.c |5 ++--- 3c59x.c |2 +- atp.c |8 +++- eepro100.c |2 +- epic100.c | 10 -- natsemi.c |1 - ne2k-pci.c |3 +-- sundance.c |3 +-- yellowfin.c |1 - 9 files changed, 13 insertions(+), 22 deletions(-) diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index cbdae54..dccf142 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c @@ -96,8 +96,7 @@ #include asm/uaccess.h #include asm/io.h #include asm/irq.h -static char versionA[] __initdata = DRV_NAME .c: DRV_VERSION DRV_RELDATE [EMAIL PROTECTED]; -static char versionB[] __initdata = http://www.scyld.com/network/3c509.html\n;; +static char version[] __initdata = DRV_NAME .c: DRV_VERSION DRV_RELDATE [EMAIL PROTECTED]; #if defined(CONFIG_PM) (defined(CONFIG_MCA) || defined(CONFIG_EISA)) #define EL3_SUSPEND @@ -360,7 +359,7 @@ #endif printk(, IRQ %d.\n, dev-irq); if (el3_debug 0) - printk(KERN_INFO %s KERN_INFO %s, versionA, versionB); + printk(KERN_INFO %s, version); return 0; } diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index 80e8ca0..098c7aa 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c @@ -103,7 +103,7 @@ #include linux/delay.h static char version[] __devinitdata = -DRV_NAME : Donald Becker and others. www.scyld.com/network/vortex.html\n; +DRV_NAME : Donald Becker and others.\n; MODULE_AUTHOR(Donald Becker [EMAIL PROTECTED]); MODULE_DESCRIPTION(3Com 3c59x/3c9xx ethernet driver ); diff --git a/drivers/net/atp.c b/drivers/net/atp.c index bfa674e..697967f 100644 --- a/drivers/net/atp.c +++ b/drivers/net/atp.c @@ -31,10 +31,8 @@ */ -static const char versionA[] = +static const char version[] = atp.c:v1.09=ac 2002/10/01 Donald Becker [EMAIL PROTECTED]\n; -static const char versionB[] = - http://www.scyld.com/network/atp.html\n;; /* The user-configurable values. These may be modified when a driver module is loaded.*/ @@ -324,7 +322,7 @@ #endif #ifndef MODULE if (net_debug) - printk(KERN_INFO %s KERN_INFO %s, versionA, versionB); + printk(KERN_INFO %s, version); #endif printk(KERN_NOTICE %s: Pocket adapter found at %#3lx, IRQ %d, SAPROM @@ -932,7 +930,7 @@ static void set_rx_mode_8012(struct net_ static int __init atp_init_module(void) { if (debug) /* Emit version even if no cards detected. */ - printk(KERN_INFO %s KERN_INFO %s, versionA, versionB); + printk(KERN_INFO %s, version); return atp_init(); } diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c index e445988..0f4b495 100644 --- a/drivers/net/eepro100.c +++ b/drivers/net/eepro100.c @@ -28,7 +28,7 @@ */ static const char * const version = -eepro100.c:v1.09j-t 9/29/99 Donald Becker http://www.scyld.com/network/eepro100.html\n; +eepro100.c:v1.09j-t 9/29/99 Donald Becker\n eepro100.c: $Revision: 1.36 $ 2000/11/17 Modified by Andrey V. Savochkin [EMAIL PROTECTED] and others\n; /* A few user-configurable values that apply to all boards. diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index a67650c..ebef8ae 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c @@ -93,8 +93,6 @@ #include asm/uaccess.h static char version[] __devinitdata = DRV_NAME .c:v1.11 1/7/2001 Written by Donald Becker [EMAIL PROTECTED]\n; static char version2[] __devinitdata = - http://www.scyld.com/network/epic100.html\n;; -static char version3[] __devinitdata = (unofficial 2.4.x kernel port, version DRV_VERSION , DRV_RELDATE )\n; MODULE_AUTHOR(Donald Becker [EMAIL PROTECTED]); @@ -323,8 +321,8 @@ static int __devinit epic_init_one (stru #ifndef MODULE static int printed_version; if (!printed_version++) - printk (KERN_INFO %s KERN_INFO %s KERN_INFO %s, - version, version2, version3); + printk (KERN_INFO %s KERN_INFO %s, + version, version2); #endif card_idx++; @@ -1600,8 +1598,8 @@ static int __init epic_init (void) { /* when a module, this is printed whether or not devices are found in probe */ #ifdef MODULE - printk (KERN_INFO %s KERN_INFO %s KERN_INFO %s, - version, version2, version3); + printk (KERN_INFO %s
[PATCH] locking bug in fib_semantics.c
Hello! [IPV4]: severe locking bug in fib_semantics.c The patch is for net-2.6.19, but the bug is present in all the kernels since yore. Found in 2.4 by Yixin Pan [EMAIL PROTECTED]. Why do we need lockdep, when sharp-sighted eyes are available? :-) When I read fib_semantics.c of Linux-2.4.32, write_lock(fib_info_lock) = is used in fib_release_info() instead of write_lock_bh(fib_info_lock). = Is the following case possible: a BH interrupts fib_release_info() while = holding the write lock, and calls ip_check_fib_default() which calls = read_lock(fib_info_lock), and spin forever. Signed-off-by: Alexey Kuznetsov [EMAIL PROTECTED] --- diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 4ea6c68..5dfdad5 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -159,7 +159,7 @@ void free_fib_info(struct fib_info *fi) void fib_release_info(struct fib_info *fi) { - spin_lock(fib_info_lock); + spin_lock_bh(fib_info_lock); if (fi --fi-fib_treeref == 0) { hlist_del(fi-fib_hash); if (fi-fib_prefsrc) @@ -172,7 +172,7 @@ void fib_release_info(struct fib_info *f fi-fib_dead = 1; fib_info_put(fi); } - spin_unlock(fib_info_lock); + spin_unlock_bh(fib_info_lock); } static __inline__ int nh_comp(const struct fib_info *fi, const struct fib_info *ofi) @@ -598,7 +598,7 @@ static void fib_hash_move(struct hlist_h unsigned int old_size = fib_hash_size; unsigned int i, bytes; - spin_lock(fib_info_lock); + spin_lock_bh(fib_info_lock); old_info_hash = fib_info_hash; old_laddrhash = fib_info_laddrhash; fib_hash_size = new_size; @@ -639,7 +639,7 @@ static void fib_hash_move(struct hlist_h } fib_info_laddrhash = new_laddrhash; - spin_unlock(fib_info_lock); + spin_unlock_bh(fib_info_lock); bytes = old_size * sizeof(struct hlist_head *); fib_hash_free(old_info_hash, bytes); @@ -820,7 +820,7 @@ link_it: fi-fib_treeref++; atomic_inc(fi-fib_clntref); - spin_lock(fib_info_lock); + spin_lock_bh(fib_info_lock); hlist_add_head(fi-fib_hash, fib_info_hash[fib_info_hashfn(fi)]); if (fi-fib_prefsrc) { @@ -839,7 +839,7 @@ link_it: head = fib_info_devhash[hash]; hlist_add_head(nh-nh_hash, head); } endfor_nexthops(fi) - spin_unlock(fib_info_lock); + spin_unlock_bh(fib_info_lock); return fi; err_inval: - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH][RFC][RESEND] remove broken URLs from net drivers' output
On 17/08/06, Markus Dahms [EMAIL PROTECTED] wrote: Remove broken URLs (www.scyld.com) from network drivers' logging output. URLs in comments and other strings are left intact. Makes good sense to me. No point in refering to URLs that are no longer operational. The best thing would be to find a replacement URL if one exist, but failing that removing the wrong ones is a good thing IMHO. -- Jesper Juhl [EMAIL PROTECTED] Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html Plain text mails only, please http://www.expita.com/nomime.html - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/7] ip1000: remove some default phy params
Hi Jesse, On Aug 17 at 03:43:29, Jesse Huang wrote: From: Jesse Huang [EMAIL PROTECTED] remove some default phy params Change Logs: remove some default phy params First, thanks for finalling commiting this driver ;). But please resend the patches with Signed-off-by: line. I'm not much of a git hacker, but i think you can use 'git-applymbox' to put a signedoff line in your mbox-formatted patches. regards, -- David Gómez Jabber ID: [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH][RFC][RESEND] remove broken URLs from net drivers' output
Ar Iau, 2006-08-17 am 11:30 +0200, ysgrifennodd Markus Dahms: Remove broken URLs (www.scyld.com) from network drivers' logging output. URLs in comments and other strings are left intact. Signed-off-by: Markus Dahms [EMAIL PROTECTED] Acked-by: Alan Cox [EMAIL PROTECTED] Bcc'd to one of the penguincomputing folks in case they want to put them back/provide alternate URLs - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Possible leak of multicast source filter sctructure
Hello David, Michal, I believe the patch I submitted yesterday fixes this problem, and in a simpler way. Somehow I've missed that e-mail (It did not appear on the thread's list at MARC archives). Sorry for that. +-DLS I've reviewed your patch (the IPv4 part of it) and I think I can say that our soulutions are actually quite similar. But I can come up with one difference that I'd like know your opinion on. Suppose the following situatuion: 1) create pppX interface: IP: A.B.C.D 2) join a multicast group by address: A.B.C.D ASSUMPTION: no other interface with the same IP address exists; the result should be that the group is joined on the pppX interface 3) create pppY interface IP: A.B.C.D (Yes the same IP, not unusual on ppp links.) 4) delete the pppX interace 5) attempt to leave the multicast group by address: A.B.C.D 6) * if your algorthim is used -EADDRNOTAVAIL is returned * if mine is used the multicast group is left on the pppX interface Surely this won't be a common problem but I think it's worth pointing out here. Michal - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC][PATCH 0/75] pci_module_init to pci_register_driver conversion
On Thu, Aug 17, 2006 at 04:26:35AM +, Michal Piotrowski wrote: Hi, pci_module_init is obsolete. This patch series converts pci_module_init to pci_register_driver. Can I remove this? include/linux/pci.h:385 /* * pci_module_init is obsolete, this stays here till we fix up all usages of it * in the tree. */ #define pci_module_init pci_register_driver As repeated numerous times, it's up to the network developers if they will take this or not. I'll hold off on taking this series, please push it through the driver subsystem maintainers. thanks, greg k-h - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv2 2.6.17] net/ipv6/udp.c: remove duplicate udp_get_port code
[NET]: UDPv4 and UDPv6 use an almost identical version of the get_port function, which is unnecessary since the (long) code differs in only one if-statement. This patch creates one common function which is called by udp_v4_get_port() and udp_v6_get_port(). As a result, * duplicated code is removed * udp_port_rover and local port lookup can now be removed from udp.h * further savings follow since the same function will be used by UDP-Litev4 and UDP-Litev6 In contrast to the patch sent in response to Yoshifujis comments (fixed by this variant), the code below also removes the EXPORT_SYMBOL(udp_port_rover), since udp_port_rover can now remain local to net/ipv4/udp.c. Signed-off-by: Gerrit Renker [EMAIL PROTECTED] --- include/net/udp.h | 18 +- net/ipv4/udp.c| 96 +- net/ipv6/udp.c| 76 +- 3 files changed, 64 insertions(+), 126 deletions(-) diff --git a/include/net/udp.h b/include/net/udp.h index 766fba1..c490a0f 100644 --- a/include/net/udp.h +++ b/include/net/udp.h @@ -30,25 +30,9 @@ #include linux/seq_file.h #define UDP_HTABLE_SIZE128 -/* udp.c: This needs to be shared by v4 and v6 because the lookup - *and hashing code needs to work with different AF's yet - *the port space is shared. - */ extern struct hlist_head udp_hash[UDP_HTABLE_SIZE]; extern rwlock_t udp_hash_lock; -extern int udp_port_rover; - -static inline int udp_lport_inuse(u16 num) -{ - struct sock *sk; - struct hlist_node *node; - - sk_for_each(sk, node, udp_hash[num (UDP_HTABLE_SIZE - 1)]) - if (inet_sk(sk)-num == num) - return 1; - return 0; -} /* Note: this must match 'valbool' in sock_setsockopt */ #define UDP_CSUM_NOXMIT1 @@ -63,6 +47,8 @@ extern struct proto udp_prot; struct sk_buff; +extern int udp_get_port(struct sock *sk, unsigned short snum, +int (*saddr_cmp)(struct sock *, struct sock *)); extern voidudp_err(struct sk_buff *, u32); extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 3f93292..9d4e156 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -119,14 +119,34 @@ DEFINE_SNMP_STAT(struct udp_mib, udp_sta struct hlist_head udp_hash[UDP_HTABLE_SIZE]; DEFINE_RWLOCK(udp_hash_lock); -/* Shared by v4/v6 udp. */ +/* Shared by v4/v6 udp_get_port */ int udp_port_rover; -static int udp_v4_get_port(struct sock *sk, unsigned short snum) +static inline int udp_lport_inuse(u16 num) { + struct sock *sk; struct hlist_node *node; + + sk_for_each(sk, node, udp_hash[num (UDP_HTABLE_SIZE - 1)]) + if (inet_sk(sk)-num == num) + return 1; + return 0; +} + +/** + * udp_get_port - common port lookup for IPv4 and IPv6 + * + * @sk: socket struct in question + * @snum:port number to look up + * @saddr_comp: AF-dependent comparison of bound local IP addresses + */ +int udp_get_port(struct sock *sk, unsigned short snum, +int (*saddr_cmp)(struct sock *sk1, struct sock *sk2)) +{ + struct hlist_node *node; + struct hlist_head *head; struct sock *sk2; - struct inet_sock *inet = inet_sk(sk); + interror = 1; write_lock_bh(udp_hash_lock); if (snum == 0) { @@ -138,11 +158,10 @@ static int udp_v4_get_port(struct sock * best_size_so_far = 32767; best = result = udp_port_rover; for (i = 0; i UDP_HTABLE_SIZE; i++, result++) { - struct hlist_head *list; int size; - list = udp_hash[result (UDP_HTABLE_SIZE - 1)]; - if (hlist_empty(list)) { + head = udp_hash[result (UDP_HTABLE_SIZE - 1)]; + if (hlist_empty(head)) { if (result sysctl_local_port_range[1]) result = sysctl_local_port_range[0] + ((result - sysctl_local_port_range[0]) @@ -150,12 +169,11 @@ static int udp_v4_get_port(struct sock * goto gotit; } size = 0; - sk_for_each(sk2, node, list) - if (++size = best_size_so_far) - goto next; - best_size_so_far = size; - best = result; - next:; + sk_for_each(sk2, node, head) + if (++size best_size_so_far) { + best_size_so_far = size; + best = result; + } }
Re: 802.11 headers
On Thu, 17 Aug 2006 09:48:19 +0200, Johannes Berg wrote: My current thoughts: - net/d80211_common.h can die sometime soon due to being replaced with linux/nl80211.h (to be published today). - net/d80211_mgmt.h needs cleaning up (I know Michael has been doing some of that), and then should probably be renamed to linux/ieee80211.h and be userland-visible, and contain a bunch of other frame definitions as well. A bit like net/ieee80211.h now, though more protocol-centric. - net/ieee80211_radiotap.h should be userland-visible, and hence linux/radiotap.h or such. - net/d80211_shared.h probably has the same fate as d80211_shared.h should probably be merged into d80211.h. net/d80211_common.h, except for the _RATE_* thingies, but I'm not sure why they should be userland-visible. - net/d80211.h can stay there as-is, it's in-kernel only API. Or put another way, my suggestions: - put all in-kernel API (for drivers) into net/d80211.h - put stuff defined in the IEEE 802.11 specification series into linux/ieee80211.h, make user-visible (headers-y in Kbuild!). This serves just as a reference. It's not really necessary that the kernel ships this, but we need it in the kernel and probably won't be pulling it from some other source. Besides, I wouldn't know where else to maintain it. - radiotap simply moves to linux/ and gets to be userland-visible. Of course, d80211 should actually start using it too ;) - all the other userland stuff seems to be configuration related and hence moves over to linux/nl80211.h Comments? I like this proposal. Jiri -- Jiri Benc SUSE Labs - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: 802.11 headers
On Thu, Aug 17, 2006 at 02:34:43PM +0200, Jiri Benc wrote: On Thu, 17 Aug 2006 09:48:19 +0200, Johannes Berg wrote: Or put another way, my suggestions: - put all in-kernel API (for drivers) into net/d80211.h - put stuff defined in the IEEE 802.11 specification series into linux/ieee80211.h, make user-visible (headers-y in Kbuild!). This serves just as a reference. It's not really necessary that the kernel ships this, but we need it in the kernel and probably won't be pulling it from some other source. Besides, I wouldn't know where else to maintain it. - radiotap simply moves to linux/ and gets to be userland-visible. Of course, d80211 should actually start using it too ;) - all the other userland stuff seems to be configuration related and hence moves over to linux/nl80211.h Comments? I like this proposal. I second that. John -- John W. Linville [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH wireless-dev 4/6] d80211: Send Layer 2 Update frames in kernel
On Mon, 07 Aug 2006 16:16:12 -0700, Jouni Malinen wrote: Send Layer 2 Update frame from the 802.11 code in kernel to the netdev that the STA is bound to. If the STA is bound to another VLAN netdev, send another update frame. This fixes an issue in which a local bridge table was not updated when hostapd sent this frame. This seems like a hack to me. Isn't there some netlink mechanism that can be used instead? Jiri -- Jiri Benc SUSE Labs - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC][PATCH 0/75] pci_module_init to pci_register_driver conversion
Greg KH wrote: On Thu, Aug 17, 2006 at 04:26:35AM +, Michal Piotrowski wrote: Hi, pci_module_init is obsolete. This patch series converts pci_module_init to pci_register_driver. Can I remove this? include/linux/pci.h:385 /* * pci_module_init is obsolete, this stays here till we fix up all usages of it * in the tree. */ #define pci_module_init pci_register_driver As repeated numerous times, it's up to the network developers if they will take this or not. I'll hold off on taking this series, please push it through the driver subsystem maintainers. It's already in subsystem trees, in fact. But it is most definitely not 2.6.18-rc material :) Jeff - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC][PATCH 0/75] pci_module_init to pci_register_driver conversion
But it is most definitely not 2.6.18-rc material :) that part of it isn't.. marking it deprecated so that people doing new code get a warning probably IS 2.6.18, the sooner that happens the better -- if you want to mail me at work (you don't), use arjan (at) linux.intel.com - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC][PATCH 0/75] pci_module_init to pci_register_driver conversion
Arjan van de Ven wrote: But it is most definitely not 2.6.18-rc material :) that part of it isn't.. marking it deprecated so that people doing new code get a warning probably IS 2.6.18, the sooner that happens the better I disagree. With all the cleanups going into 2.6.19, that would just introduce needless build noise into 2.6.18. Jeff - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC][PATCH 0/75] pci_module_init to pci_register_driver conversion
On 17/08/06, Jeff Garzik [EMAIL PROTECTED] wrote: Greg KH wrote: On Thu, Aug 17, 2006 at 04:26:35AM +, Michal Piotrowski wrote: Hi, pci_module_init is obsolete. This patch series converts pci_module_init to pci_register_driver. Can I remove this? include/linux/pci.h:385 /* * pci_module_init is obsolete, this stays here till we fix up all usages of it * in the tree. */ #define pci_module_init pci_register_driver As repeated numerous times, it's up to the network developers if they will take this or not. I'll hold off on taking this series, please push it through the driver subsystem maintainers. It's already in subsystem trees, in fact. Did you mean http://www.kernel.org/git/?p=linux/kernel/git/davem/net-2.6.19.git;a=shortlog ? The patches are against 2.6.18-rc4-mm1. Unfortunately patches weren't delivered to netdev (my fault). I'll add To:actual maintainer and resend. But it is most definitely not 2.6.18-rc material :) I agree. Jeff Regards, Michal -- Michal K. K. Piotrowski LTG - Linux Testers Group (http://www.stardust.webpages.pl/ltg/wiki/) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 20/75] net: drivers/net/e1000/e1000_main.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/e1000/e1000_main.c linux-work2/drivers/net/e1000/e1000_main.c --- linux-work-clean/drivers/net/e1000/e1000_main.c 2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/e1000/e1000_main.c 2006-08-17 05:14:36.0 +0200 @@ -245,7 +245,7 @@ e1000_init_module(void) printk(KERN_INFO %s\n, e1000_copyright); - ret = pci_module_init(e1000_driver); + ret = pci_register_driver(e1000_driver); return ret; } - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 72/75] net: drivers/net/wan/wanxl.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/wan/wanxl.c linux-work2/drivers/net/wan/wanxl.c --- linux-work-clean/drivers/net/wan/wanxl.c2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/wan/wanxl.c 2006-08-17 05:20:02.0 +0200 @@ -837,7 +837,7 @@ static int __init wanxl_init_module(void #ifdef MODULE printk(KERN_INFO %s\n, version); #endif - return pci_module_init(wanxl_pci_driver); + return pci_register_driver(wanxl_pci_driver); } static void __exit wanxl_cleanup_module(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 32/75] net: drivers/net/wireless/ipw2200.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/wireless/ipw2200.c linux-work2/drivers/net/wireless/ipw2200.c --- linux-work-clean/drivers/net/wireless/ipw2200.c 2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/wireless/ipw2200.c 2006-08-17 05:20:17.0 +0200 @@ -11753,7 +11753,7 @@ static int __init ipw_init(void) printk(KERN_INFO DRV_NAME : DRV_DESCRIPTION , DRV_VERSION \n); printk(KERN_INFO DRV_NAME : DRV_COPYRIGHT \n); - ret = pci_module_init(ipw_driver); + ret = pci_register_driver(ipw_driver); if (ret) { IPW_ERROR(Unable to initialize PCI module\n); return ret; - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 41/75] net: drivers/net/ne2k-pci.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/ne2k-pci.c linux-work2/drivers/net/ne2k-pci.c --- linux-work-clean/drivers/net/ne2k-pci.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/ne2k-pci.c 2006-08-17 05:15:27.0 +0200 @@ -702,7 +702,7 @@ static int __init ne2k_pci_init(void) #ifdef MODULE printk(version); #endif - return pci_module_init (ne2k_driver); + return pci_register_driver(ne2k_driver); } - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 6/75] net: drivers/net/amd8111e.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/amd8111e.c linux-work2/drivers/net/amd8111e.c --- linux-work-clean/drivers/net/amd8111e.c 2006-08-16 22:40:59.0 +0200 +++ linux-work2/drivers/net/amd8111e.c 2006-08-17 05:13:42.0 +0200 @@ -2158,7 +2158,7 @@ static struct pci_driver amd8111e_driver static int __init amd8111e_init(void) { - return pci_module_init(amd8111e_driver); + return pci_register_driver(amd8111e_driver); } static void __exit amd8111e_cleanup(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 62/75] net: drivers/net/starfire.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/starfire.c linux-work2/drivers/net/starfire.c --- linux-work-clean/drivers/net/starfire.c 2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/starfire.c 2006-08-17 05:17:15.0 +0200 @@ -2053,7 +2053,7 @@ static int __init starfire_init (void) return -ENODEV; } - return pci_module_init (starfire_driver); + return pci_register_driver(starfire_driver); } - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 25/75] net: drivers/net/fealnx.c module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/fealnx.c linux-work2/drivers/net/fealnx.c --- linux-work-clean/drivers/net/fealnx.c 2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/fealnx.c2006-08-17 05:14:55.0 +0200 @@ -1984,7 +1984,7 @@ static int __init fealnx_init(void) printk(version); #endif - return pci_module_init(fealnx_driver); + return pci_register_driver(fealnx_driver); } static void __exit fealnx_exit(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 14/75] net: drivers/net/tulip/de2104x.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/tulip/de2104x.c linux-work2/drivers/net/tulip/de2104x.c --- linux-work-clean/drivers/net/tulip/de2104x.c2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/tulip/de2104x.c 2006-08-17 05:18:32.0 +0200 @@ -2172,7 +2172,7 @@ static int __init de_init (void) #ifdef MODULE printk(%s, version); #endif - return pci_module_init (de_driver); + return pci_register_driver(de_driver); } static void __exit de_exit (void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 36/75] net: drivers/net/tokenring/lanstreamer.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/tokenring/lanstreamer.c linux-work2/drivers/net/tokenring/lanstreamer.c --- linux-work-clean/drivers/net/tokenring/lanstreamer.c2006-08-17 00:10:47.0 +0200 +++ linux-work2/drivers/net/tokenring/lanstreamer.c 2006-08-17 05:18:15.0 +0200 @@ -1998,7 +1998,7 @@ static struct pci_driver streamer_pci_dr }; static int __init streamer_init_module(void) { - return pci_module_init(streamer_pci_driver); + return pci_register_driver(streamer_pci_driver); } static void __exit streamer_cleanup_module(void) { - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 47/75] net: drivers/net/wireless/orinoco_tmd.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/wireless/orinoco_tmd.c linux-work2/drivers/net/wireless/orinoco_tmd.c --- linux-work-clean/drivers/net/wireless/orinoco_tmd.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/wireless/orinoco_tmd.c 2006-08-17 05:20:37.0 +0200 @@ -228,7 +228,7 @@ MODULE_LICENSE(Dual MPL/GPL); static int __init orinoco_tmd_init(void) { printk(KERN_DEBUG %s\n, version); - return pci_module_init(orinoco_tmd_driver); + return pci_register_driver(orinoco_tmd_driver); } static void __exit orinoco_tmd_exit(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 23/75] net: drivers/net/epic100.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/epic100.c linux-work2/drivers/net/epic100.c --- linux-work-clean/drivers/net/epic100.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/epic100.c 2006-08-17 05:14:49.0 +0200 @@ -1604,7 +1604,7 @@ static int __init epic_init (void) version, version2, version3); #endif - return pci_module_init (epic_driver); + return pci_register_driver(epic_driver); } - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 11/75] net: drivers/net/cassini.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/cassini.c linux-work2/drivers/net/cassini.c --- linux-work-clean/drivers/net/cassini.c 2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/cassini.c 2006-08-17 05:14:07.0 +0200 @@ -5245,7 +5245,7 @@ static int __init cas_init(void) else link_transition_timeout = 0; - return pci_module_init(cas_driver); + return pci_register_driver(cas_driver); } static void __exit cas_cleanup(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 74/75] net: drivers/net/tulip/xircom_tulip_cb.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/tulip/xircom_tulip_cb.c linux-work2/drivers/net/tulip/xircom_tulip_cb.c --- linux-work-clean/drivers/net/tulip/xircom_tulip_cb.c2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/tulip/xircom_tulip_cb.c 2006-08-17 05:19:07.0 +0200 @@ -1707,7 +1707,7 @@ static int __init xircom_init(void) #ifdef MODULE printk(version); #endif - return pci_module_init(xircom_driver); + return pci_register_driver(xircom_driver); } - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 45/75] net: drivers/net/wireless/orinoco_pci.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/wireless/orinoco_pci.c linux-work2/drivers/net/wireless/orinoco_pci.c --- linux-work-clean/drivers/net/wireless/orinoco_pci.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/wireless/orinoco_pci.c 2006-08-17 05:20:26.0 +0200 @@ -244,7 +244,7 @@ MODULE_LICENSE(Dual MPL/GPL); static int __init orinoco_pci_init(void) { printk(KERN_DEBUG %s\n, version); - return pci_module_init(orinoco_pci_driver); + return pci_register_driver(orinoco_pci_driver); } static void __exit orinoco_pci_exit(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 66/75] net: drivers/net/tg3.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/tg3.c linux-work2/drivers/net/tg3.c --- linux-work-clean/drivers/net/tg3.c 2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/tg3.c 2006-08-17 05:17:47.0 +0200 @@ -11819,7 +11819,7 @@ static struct pci_driver tg3_driver = { static int __init tg3_init(void) { - return pci_module_init(tg3_driver); + return pci_register_driver(tg3_driver); } static void __exit tg3_cleanup(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 22/75] net: drivers/net/eepro100.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/eepro100.c linux-work2/drivers/net/eepro100.c --- linux-work-clean/drivers/net/eepro100.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/eepro100.c 2006-08-17 05:14:42.0 +0200 @@ -2385,7 +2385,7 @@ static int __init eepro100_init_module(v #ifdef MODULE printk(version); #endif - return pci_module_init(eepro100_driver); + return pci_register_driver(eepro100_driver); } static void __exit eepro100_cleanup_module(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 1/75] net: drivers/net/tokenring/3c359.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/tokenring/3c359.c linux-work2/drivers/net/tokenring/3c359.c --- linux-work-clean/drivers/net/tokenring/3c359.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/tokenring/3c359.c 2006-08-17 05:18:07.0 +0200 @@ -1815,7 +1815,7 @@ static struct pci_driver xl_3c359_driver static int __init xl_pci_init (void) { - return pci_module_init (xl_3c359_driver); + return pci_register_driver(xl_3c359_driver); } - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 63/75] net: drivers/net/sundance.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/sundance.c linux-work2/drivers/net/sundance.c --- linux-work-clean/drivers/net/sundance.c 2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/sundance.c 2006-08-17 05:17:21.0 +0200 @@ -1733,7 +1733,7 @@ static int __init sundance_init(void) #ifdef MODULE printk(version); #endif - return pci_module_init(sundance_driver); + return pci_register_driver(sundance_driver); } static void __exit sundance_exit(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 64/75] net: drivers/net/sungem.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/sungem.c linux-work2/drivers/net/sungem.c --- linux-work-clean/drivers/net/sungem.c 2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/sungem.c2006-08-17 05:17:28.0 +0200 @@ -3194,7 +3194,7 @@ static struct pci_driver gem_driver = { static int __init gem_init(void) { - return pci_module_init(gem_driver); + return pci_register_driver(gem_driver); } static void __exit gem_cleanup(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 65/75] net: drivers/net/tc35815.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/tc35815.c linux-work2/drivers/net/tc35815.c --- linux-work-clean/drivers/net/tc35815.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/tc35815.c 2006-08-17 05:17:42.0 +0200 @@ -1725,7 +1725,7 @@ static struct pci_driver tc35815_driver static int __init tc35815_init_module(void) { - return pci_module_init(tc35815_driver); + return pci_register_driver(tc35815_driver); } static void __exit tc35815_cleanup_module(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 70/75] net: drivers/net/via-rhine.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/via-rhine.c linux-work2/drivers/net/via-rhine.c --- linux-work-clean/drivers/net/via-rhine.c2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/via-rhine.c 2006-08-17 05:19:18.0 +0200 @@ -2005,7 +2005,7 @@ static int __init rhine_init(void) #ifdef MODULE printk(version); #endif - return pci_module_init(rhine_driver); + return pci_register_driver(rhine_driver); } - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 59/75] net: net/skfp/skfddi.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/skfp/skfddi.c linux-work2/drivers/net/skfp/skfddi.c --- linux-work-clean/drivers/net/skfp/skfddi.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/skfp/skfddi.c 2006-08-17 05:16:45.0 +0200 @@ -2280,7 +2280,7 @@ static struct pci_driver skfddi_pci_driv static int __init skfd_init(void) { - return pci_module_init(skfddi_pci_driver); + return pci_register_driver(skfddi_pci_driver); } static void __exit skfd_exit(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 75/75] net: drivers/net/yellowfin.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/yellowfin.c linux-work2/drivers/net/yellowfin.c --- linux-work-clean/drivers/net/yellowfin.c2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/yellowfin.c 2006-08-17 05:20:50.0 +0200 @@ -1434,7 +1434,7 @@ static int __init yellowfin_init (void) #ifdef MODULE printk(version); #endif - return pci_module_init (yellowfin_driver); + return pci_register_driver(yellowfin_driver); } - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 61/75] net: drivers/net/skge.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/skge.c linux-work2/drivers/net/skge.c --- linux-work-clean/drivers/net/skge.c 2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/skge.c 2006-08-17 05:17:04.0 +0200 @@ -3510,7 +3510,7 @@ static struct pci_driver skge_driver = { static int __init skge_init_module(void) { - return pci_module_init(skge_driver); + return pci_register_driver(skge_driver); } static void __exit skge_cleanup_module(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 69/75] net: drivers/net/typhoon.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/typhoon.c linux-work2/drivers/net/typhoon.c --- linux-work-clean/drivers/net/typhoon.c 2006-08-17 00:10:47.0 +0200 +++ linux-work2/drivers/net/typhoon.c 2006-08-17 05:19:13.0 +0200 @@ -2660,7 +2660,7 @@ static struct pci_driver typhoon_driver static int __init typhoon_init(void) { - return pci_module_init(typhoon_driver); + return pci_register_driver(typhoon_driver); } static void __exit - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 33/75] net: drivers/net/wireless/prism54/islpci_hotplug.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/wireless/prism54/islpci_hotplug.c linux-work2/drivers/net/wireless/prism54/islpci_hotplug.c --- linux-work-clean/drivers/net/wireless/prism54/islpci_hotplug.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/wireless/prism54/islpci_hotplug.c 2006-08-17 05:20:43.0 +0200 @@ -313,7 +313,7 @@ prism54_module_init(void) __bug_on_wrong_struct_sizes (); - return pci_module_init(prism54_driver); + return pci_register_driver(prism54_driver); } /* by the time prism54_module_exit() terminates, as a postcondition - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 0/75] pci_module_init to pci_register_driver conversion
Hi, pci_module_init is obsolete. This patch series converts pci_module_init to pci_register_driver. ata/ata_generic.c |2 +- ata/pata_pdc2027x.c |2 +- char/ipmi/ipmi_si_intf.c |2 +- crypto/geode-aes.c|2 +- edac/k8_edac.c|2 +- net/3c59x.c |2 +- net/8139cp.c |2 +- net/8139too.c |2 +- net/acenic.c |2 +- net/amd8111e.c|2 +- net/arcnet/com20020-pci.c |2 +- net/b44.c |2 +- net/bnx2.c|2 +- net/cassini.c |2 +- net/chelsio/cxgb2.c |2 +- net/defxx.c |2 +- net/dl2k.c|2 +- net/e100.c|2 +- net/e1000/e1000_main.c|2 +- net/eepro100.c|2 +- net/epic100.c |2 +- net/fealnx.c |2 +- net/forcedeth.c |2 +- net/hp100.c |2 +- net/ixgb/ixgb_main.c |2 +- net/natsemi.c |2 +- net/ne2k-pci.c|2 +- net/ns83820.c |2 +- net/pci-skeleton.c|2 +- net/pcnet32.c |2 +- net/r8169.c |2 +- net/rrunner.c |2 +- net/s2io.c|2 +- net/saa9730.c |2 +- net/sis190.c |2 +- net/sis900.c |2 +- net/sk98lin/skge.c|2 +- net/skfp/skfddi.c |2 +- net/skge.c|2 +- net/starfire.c|2 +- net/sundance.c|2 +- net/sungem.c |2 +- net/tc35815.c |2 +- net/tg3.c |2 +- net/tokenring/3c359.c |2 +- net/tokenring/lanstreamer.c |2 +- net/tokenring/olympic.c |2 +- net/tulip/de2104x.c |2 +- net/tulip/de4x5.c |2 +- net/tulip/dmfe.c |2 +- net/tulip/tulip_core.c|2 +- net/tulip/winbond-840.c |2 +- net/tulip/xircom_tulip_cb.c |2 +- net/typhoon.c |2 +- net/via-rhine.c |2 +- net/via-velocity.c|2 +- net/wan/dscc4.c |2 +- net/wan/farsync.c |2 +- net/wan/lmc/lmc_main.c|2 +- net/wan/pc300_drv.c |2 +- net/wan/pci200syn.c |2 +- net/wan/wanxl.c |2 +- net/wireless/atmel_pci.c |2 +- net/wireless/ipw2100.c|2 +- net/wireless/ipw2200.c|2 +- net/wireless/orinoco_nortel.c |2 +- net/wireless/orinoco_pci.c|2 +- net/wireless/orinoco_plx.c|2 +- net/wireless/orinoco_tmd.c|2 +- net/wireless/prism54/islpci_hotplug.c |2 +- net/yellowfin.c |2 +- scsi/ips.c|2 +- scsi/megaraid.c |2 +- scsi/megaraid/megaraid_sas.c |2 +- scsi/tmscsim.c|2 +- 75 files changed, 75 insertions(+), 75 deletions(-) Regards, Michal -- Michal K. K. Piotrowski LTG - Linux Testers Group (http://www.stardust.webpages.pl/ltg/wiki/) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 46/75] net: drivers/net/wireless/orinoco_plx.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/wireless/orinoco_plx.c linux-work2/drivers/net/wireless/orinoco_plx.c --- linux-work-clean/drivers/net/wireless/orinoco_plx.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/wireless/orinoco_plx.c 2006-08-17 05:20:31.0 +0200 @@ -351,7 +351,7 @@ MODULE_LICENSE(Dual MPL/GPL); static int __init orinoco_plx_init(void) { printk(KERN_DEBUG %s\n, version); - return pci_module_init(orinoco_plx_driver); + return pci_register_driver(orinoco_plx_driver); } static void __exit orinoco_plx_exit(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 37/75] net: drivers/net/wan/lmc/lmc_main.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/wan/lmc/lmc_main.c linux-work2/drivers/net/wan/lmc/lmc_main.c --- linux-work-clean/drivers/net/wan/lmc/lmc_main.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/wan/lmc/lmc_main.c 2006-08-17 05:19:43.0 +0200 @@ -1790,7 +1790,7 @@ static struct pci_driver lmc_driver = { static int __init init_lmc(void) { -return pci_module_init(lmc_driver); +return pci_register_driver(lmc_driver); } static void __exit exit_lmc(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC][PATCH 51/75] net: drivers/net/pci-skeleton.c pci_module_init to pci_register_driver conversion
Please just send one big patch that converts all drivers/net drivers at once. Jeff - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 52/75] net: drivers/net/pcnet32.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/pcnet32.c linux-work2/drivers/net/pcnet32.c --- linux-work-clean/drivers/net/pcnet32.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/pcnet32.c 2006-08-17 05:15:52.0 +0200 @@ -2969,7 +2969,7 @@ static int __init pcnet32_init_module(vo tx_start = tx_start_pt; /* find the PCI devices */ - if (!pci_module_init(pcnet32_driver)) + if (!pci_register_driver(pcnet32_driver)) pcnet32_have_pci = 1; /* should we find any remaining VLbus devices ? */ - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 3/75] net: drivers/net/8139cp.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/8139cp.c linux-work2/drivers/net/8139cp.c --- linux-work-clean/drivers/net/8139cp.c 2006-08-16 22:41:16.0 +0200 +++ linux-work2/drivers/net/8139cp.c2006-08-17 05:13:25.0 +0200 @@ -2098,7 +2098,7 @@ static int __init cp_init (void) #ifdef MODULE printk(%s, version); #endif - return pci_module_init (cp_driver); + return pci_register_driver(cp_driver); } static void __exit cp_exit (void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 58/75] net: drivers/net/sis900.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/sis900.c linux-work2/drivers/net/sis900.c --- linux-work-clean/drivers/net/sis900.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/sis900.c2006-08-17 05:16:32.0 +0200 @@ -2495,7 +2495,7 @@ static int __init sis900_init_module(voi printk(version); #endif - return pci_module_init(sis900_pci_driver); + return pci_register_driver(sis900_pci_driver); } static void __exit sis900_cleanup_module(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 53/75] net: drivers/net/r8169.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/r8169.c linux-work2/drivers/net/r8169.c --- linux-work-clean/drivers/net/r8169.c2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/r8169.c 2006-08-17 05:15:58.0 +0200 @@ -2910,7 +2910,7 @@ static struct pci_driver rtl8169_pci_dri static int __init rtl8169_init_module(void) { - return pci_module_init(rtl8169_pci_driver); + return pci_register_driver(rtl8169_pci_driver); } static void __exit - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 57/75] net: drivers/net/sis190.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/sis190.c linux-work2/drivers/net/sis190.c --- linux-work-clean/drivers/net/sis190.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/sis190.c2006-08-17 05:16:27.0 +0200 @@ -1871,7 +1871,7 @@ static struct pci_driver sis190_pci_driv static int __init sis190_init_module(void) { - return pci_module_init(sis190_pci_driver); + return pci_register_driver(sis190_pci_driver); } static void __exit sis190_cleanup_module(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 55/75] net: drivers/net/s2io.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/s2io.c linux-work2/drivers/net/s2io.c --- linux-work-clean/drivers/net/s2io.c 2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/s2io.c 2006-08-17 05:16:10.0 +0200 @@ -7233,7 +7233,7 @@ static void __devexit s2io_rem_nic(struc int __init s2io_starter(void) { - return pci_module_init(s2io_driver); + return pci_register_driver(s2io_driver); } /** - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 12/75] net: drivers/net/arcnet/com20020-pci.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/arcnet/com20020-pci.c linux-work2/drivers/net/arcnet/com20020-pci.c --- linux-work-clean/drivers/net/arcnet/com20020-pci.c 2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/arcnet/com20020-pci.c 2006-08-17 05:13:48.0 +0200 @@ -178,7 +178,7 @@ static struct pci_driver com20020pci_dri static int __init com20020pci_init(void) { BUGLVL(D_NORMAL) printk(VERSION); - return pci_module_init(com20020pci_driver); + return pci_register_driver(com20020pci_driver); } static void __exit com20020pci_cleanup(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 68/75] net: drivers/net/tulip/tulip_core.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/tulip/tulip_core.c linux-work2/drivers/net/tulip/tulip_core.c --- linux-work-clean/drivers/net/tulip/tulip_core.c 2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/tulip/tulip_core.c 2006-08-17 05:18:56.0 +0200 @@ -1860,7 +1860,7 @@ static int __init tulip_init (void) tulip_max_interrupt_work = max_interrupt_work; /* probe for and init boards */ - return pci_module_init (tulip_driver); + return pci_register_driver(tulip_driver); } - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 8/75] net: drivers/net/wireless/atmel_pci.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/wireless/atmel_pci.c linux-work2/drivers/net/wireless/atmel_pci.c --- linux-work-clean/drivers/net/wireless/atmel_pci.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/wireless/atmel_pci.c2006-08-17 05:20:06.0 +0200 @@ -76,7 +76,7 @@ static void __devexit atmel_pci_remove(s static int __init atmel_init_module(void) { - return pci_module_init(atmel_driver); + return pci_register_driver(atmel_driver); } static void __exit atmel_cleanup_module(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 44/75] net: drivers/net/wireless/orinoco_nortel.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/wireless/orinoco_nortel.c linux-work2/drivers/net/wireless/orinoco_nortel.c --- linux-work-clean/drivers/net/wireless/orinoco_nortel.c 2006-08-16 22:41:00.0 +0200 +++ linux-work2/drivers/net/wireless/orinoco_nortel.c 2006-08-17 05:20:22.0 +0200 @@ -304,7 +304,7 @@ MODULE_LICENSE(Dual MPL/GPL); static int __init orinoco_nortel_init(void) { printk(KERN_DEBUG %s\n, version); - return pci_module_init(orinoco_nortel_driver); + return pci_register_driver(orinoco_nortel_driver); } static void __exit orinoco_nortel_exit(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC][PATCH 0/75] pci_module_init to pci_register_driver conversion
Actually, I stand corrected: netdev-2.6.git#upstream does not contain a pci_register_driver() patch. Send the drivers/net piece along to me and I'll apply it. Jeff - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 71/75] net: drivers/net/via-velocity.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/via-velocity.c linux-work2/drivers/net/via-velocity.c --- linux-work-clean/drivers/net/via-velocity.c 2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/via-velocity.c 2006-08-17 05:19:24.0 +0200 @@ -2250,7 +2250,7 @@ static int __init velocity_init_module(v int ret; velocity_register_notifier(); - ret = pci_module_init(velocity_driver); + ret = pci_register_driver(velocity_driver); if (ret 0) velocity_unregister_notifier(); return ret; - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 56/75] net: drivers/net/saa9730.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/saa9730.c linux-work2/drivers/net/saa9730.c --- linux-work-clean/drivers/net/saa9730.c 2006-03-20 06:53:29.0 +0100 +++ linux-work2/drivers/net/saa9730.c 2006-08-17 05:16:21.0 +0200 @@ -1131,7 +1131,7 @@ static struct pci_driver saa9730_driver static int __init saa9730_init(void) { - return pci_module_init(saa9730_driver); + return pci_register_driver(saa9730_driver); } static void __exit saa9730_cleanup(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 60/75] net: drivers/net/sk98lin/skge.c pci_module_init to pci_register_driver conversion
Signed-off-by: Michal Piotrowski [EMAIL PROTECTED] diff -uprN -X linux-work/Documentation/dontdiff linux-work-clean/drivers/net/sk98lin/skge.c linux-work2/drivers/net/sk98lin/skge.c --- linux-work-clean/drivers/net/sk98lin/skge.c 2006-08-16 22:41:17.0 +0200 +++ linux-work2/drivers/net/sk98lin/skge.c 2006-08-17 05:16:39.0 +0200 @@ -5133,7 +5133,7 @@ static struct pci_driver skge_driver = { static int __init skge_init(void) { - return pci_module_init(skge_driver); + return pci_register_driver(skge_driver); } static void __exit skge_exit(void) - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html