[PATCH] net: unregister_netdevice as void
There was no real useful information from the unregister_netdevice() return code, the only error occurred in a situation that was a driver bug. So change it to a void function. Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] --- include/linux/netdevice.h |2 +- net/core/dev.c| 15 ++- net/ipv4/ip_gre.c |3 ++- net/ipv4/ipip.c |3 ++- net/ipv6/ip6_tunnel.c |3 ++- net/ipv6/sit.c|3 ++- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 6be767c..e16d66e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -588,7 +588,7 @@ extern int dev_open(struct net_device * extern int dev_close(struct net_device *dev); extern int dev_queue_xmit(struct sk_buff *skb); extern int register_netdevice(struct net_device *dev); -extern int unregister_netdevice(struct net_device *dev); +extern voidunregister_netdevice(struct net_device *dev); extern voidfree_netdev(struct net_device *dev); extern voidsynchronize_net(void); extern int register_netdevice_notifier(struct notifier_block *nb); diff --git a/net/core/dev.c b/net/core/dev.c index e660cb5..4a8a7fd 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -3247,7 +3247,7 @@ void synchronize_net(void) * unregister_netdev() instead of this. */ -int unregister_netdevice(struct net_device *dev) +void unregister_netdevice(struct net_device *dev) { struct net_device *d, **dp; @@ -3258,8 +3258,10 @@ int unregister_netdevice(struct net_devi if (dev-reg_state == NETREG_UNINITIALIZED) { printk(KERN_DEBUG unregister_netdevice: device %s/%p never was registered\n, dev-name, dev); - return -ENODEV; - } + + WARN_ON(1); + return; + } BUG_ON(dev-reg_state != NETREG_REGISTERED); @@ -3280,11 +3282,7 @@ int unregister_netdevice(struct net_devi break; } } - if (!d) { - printk(KERN_ERR unregister net_device: '%s' not found\n, - dev-name); - return -ENODEV; - } + BUG_ON(!d); dev-reg_state = NETREG_UNREGISTERING; @@ -3316,7 +3314,6 @@ int unregister_netdevice(struct net_devi synchronize_net(); dev_put(dev); - return 0; } /** diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 476cb60..51c8350 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -1008,7 +1008,8 @@ ipgre_tunnel_ioctl (struct net_device *d goto done; dev = t-dev; } - err = unregister_netdevice(dev); + unregister_netdevice(dev); + err = 0; break; default: diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 9d719d6..da8bbd2 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -754,7 +754,8 @@ ipip_tunnel_ioctl (struct net_device *de goto done; dev = t-dev; } - err = unregister_netdevice(dev); + unregister_netdevice(dev); + err = 0; break; default: diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 8d91834..2b9e3bb 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -999,7 +999,8 @@ ip6ip6_tnl_ioctl(struct net_device *dev, break; dev = t-dev; } - err = unregister_netdevice(dev); + err = 0; + unregister_netdevice(dev); break; default: err = -EINVAL; diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 77b7b09..47cfead 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -686,7 +686,8 @@ ipip6_tunnel_ioctl (struct net_device *d goto done; dev = t-dev; } - err = unregister_netdevice(dev); + unregister_netdevice(dev); + err = 0; break; default: -- 1.4.2.4 - 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] xt_hashlimit.c: fix typo
Signed-off-by: Alexey Dobriyan [EMAIL PROTECTED] --- net/netfilter/xt_hashlimit.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c @@ -745,7 +745,7 @@ static int __init xt_hashlimit_init(void } hashlimit_procdir6 = proc_mkdir(ip6t_hashlimit, proc_net); if (!hashlimit_procdir6) { - printk(KERN_ERR xt_hashlimit: tnable to create proc dir + printk(KERN_ERR xt_hashlimit: unable to create proc dir entry\n); goto err4; } - 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] smc911x
Attached a patch on smc911x driver, which corrects obvious errors in the 16bit chips support of this driver. Please note that this driver still do NOT support 16bit chips (9115 and 9117), as it claims to, there may be mistakes in the data fifo managment, this patch enable the driver to init the chip, but the data is then corrupted. I managed to make my chip work with the driver smsc911x (out of the box), from smsc, which has been refused to be included in the kernel tree. http://thread.gmane.org/gmane.linux.network.general/10498/focus=40384 I think it my be a good idea to reconsider this choice - smsc911x has more chance to be supported as it has originally been made by the manufacturer of the chip. - smc911x is mono chip (do not work with 9117 at least), mono arch and mono plateform (restricted to PXA), while smsc911x has been tested on various chips by smsc The only thing that is missing in smsc911x is dma support, which is very architecture dependant ( There is one way to do dma with the pxa, another on the freescale mxc plateforms, another on the x86..) -- Pierre Tardy --- linux-2.6.18.1.orig/drivers/net/smc911x.h 2006-10-14 05:34:03.0 +0200 +++ linux-2.6.18.1/drivers/net/smc911x.h 2006-12-19 11:22:39.0 +0100 @@ -46,13 +46,13 @@ #if SMC_USE_16BIT #define SMC_inb(a, r) readb((a) + (r)) #define SMC_inw(a, r) readw((a) + (r)) -#define SMC_inl(a, r) ((SMC_inw(a, r) 0x)+(SMC_inw(a+2, r)16)) +#define SMC_inl(a, r) ((SMC_inw(a, r) 0x)|(SMC_inw(a+2, r)16)) #define SMC_outb(v, a, r) writeb(v, (a) + (r)) #define SMC_outw(v, a, r) writew(v, (a) + (r)) #define SMC_outl(v, a, r) \ do{ \ - writel(v 0x, (a) + (r)); \ - writel(v 16, (a) + (r) + 2); \ + writew((v) 0x, (a) + (r)); \ + writew((v) 16, (a) + (r) + 2); \ } while (0) #define SMC_insl(a, r, p, l) readsw((short*)((a) + (r)), p, l*2) #define SMC_outsl(a, r, p, l) writesw((short*)((a) + (r)), p, l*2)
[PATCH 1/5] qla3xxx: Add support for Qlogic 4032 chip.
Signed-off-by: Ron Mercer [EMAIL PROTECTED] --- drivers/net/qla3xxx.c | 375 + drivers/net/qla3xxx.h | 92 +++- 2 files changed, 392 insertions(+), 75 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index ec640f6..c39f20d 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -22,6 +22,7 @@ #include linux/interrupt.h #include linux/errno.h #include linux/ioport.h #include linux/ip.h +#include linux/in.h #include linux/if_arp.h #include linux/if_ether.h #include linux/netdevice.h @@ -63,6 +64,7 @@ MODULE_PARM_DESC(msi, Turn on Message S static struct pci_device_id ql3xxx_pci_tbl[] __devinitdata = { {PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, QL3022_DEVICE_ID)}, + {PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, QL3032_DEVICE_ID)}, /* required last entry */ {0,} }; @@ -1466,6 +1468,10 @@ static int ql_mii_setup(struct ql3_adapt 2) 7)) return -1; + if (qdev-device_id == QL3032_DEVICE_ID) + ql_write_page0_reg(qdev, + port_regs-macMIIMgmtControlReg, 0x0f0); + /* Divide 125MHz clock by 28 to meet PHY timing requirements */ reg = MAC_MII_CONTROL_CLK_SEL_DIV28; @@ -1697,18 +1703,43 @@ static void ql_process_mac_tx_intr(struc struct ob_mac_iocb_rsp *mac_rsp) { struct ql_tx_buf_cb *tx_cb; + int i; tx_cb = qdev-tx_buf[mac_rsp-transaction_id]; + pci_unmap_single(qdev-pdev, -pci_unmap_addr(tx_cb, mapaddr), -pci_unmap_len(tx_cb, maplen), PCI_DMA_TODEVICE); - dev_kfree_skb_irq(tx_cb-skb); +pci_unmap_addr(tx_cb-map[0], mapaddr), +pci_unmap_len(tx_cb-map[0], maplen), +PCI_DMA_TODEVICE); + tx_cb-seg_count--; + if (tx_cb-seg_count) { + for (i = 1; i tx_cb-seg_count; i++) { + pci_unmap_page(qdev-pdev, + pci_unmap_addr(tx_cb-map[i], + mapaddr), + pci_unmap_len(tx_cb-map[i], maplen), + PCI_DMA_TODEVICE); + } + } qdev-stats.tx_packets++; qdev-stats.tx_bytes += tx_cb-skb-len; + dev_kfree_skb_irq(tx_cb-skb); tx_cb-skb = NULL; atomic_inc(qdev-tx_count); } +/* + * The difference between 3022 and 3032 for inbound completions: + * 3022 uses two buffers per completion. The first buffer contains + * (some) header info, the second the remainder of the headers plus + * the data. For this chip we reserve some space at the top of the + * receive buffer so that the header info in buffer one can be + * prepended to the buffer two. Buffer two is the sent up while + * buffer one is returned to the hardware to be reused. + * 3032 receives all of it's data and headers in one buffer for a + * simpler process. 3032 also supports checksum verification as + * can be seen in ql_process_macip_rx_intr(). + */ static void ql_process_mac_rx_intr(struct ql3_adapter *qdev, struct ib_mac_iocb_rsp *ib_mac_rsp_ptr) { @@ -1731,14 +1762,17 @@ static void ql_process_mac_rx_intr(struc qdev-last_rsp_offset = qdev-small_buf_phy_addr_low + offset; qdev-small_buf_release_cnt++; - /* start of first buffer */ - lrg_buf_phy_addr_low = le32_to_cpu(*curr_ial_ptr); - lrg_buf_cb1 = qdev-lrg_buf[qdev-lrg_buf_index]; - qdev-lrg_buf_release_cnt++; - if (++qdev-lrg_buf_index == NUM_LARGE_BUFFERS) - qdev-lrg_buf_index = 0; - curr_ial_ptr++; /* 64-bit pointers require two incs. */ - curr_ial_ptr++; + if (qdev-device_id == QL3022_DEVICE_ID) { + /* start of first buffer (3022 only) */ + lrg_buf_phy_addr_low = le32_to_cpu(*curr_ial_ptr); + lrg_buf_cb1 = qdev-lrg_buf[qdev-lrg_buf_index]; + qdev-lrg_buf_release_cnt++; + if (++qdev-lrg_buf_index == NUM_LARGE_BUFFERS) { + qdev-lrg_buf_index = 0; + } + curr_ial_ptr++; /* 64-bit pointers require two incs. */ + curr_ial_ptr++; + } /* start of second buffer */ lrg_buf_phy_addr_low = le32_to_cpu(*curr_ial_ptr); @@ -1769,7 +1803,8 @@ static void ql_process_mac_rx_intr(struc qdev-ndev-last_rx = jiffies; lrg_buf_cb2-skb = NULL; - ql_release_to_lrg_buf_free_list(qdev, lrg_buf_cb1); + if (qdev-device_id == QL3022_DEVICE_ID) + ql_release_to_lrg_buf_free_list(qdev, lrg_buf_cb1); ql_release_to_lrg_buf_free_list(qdev, lrg_buf_cb2); } @@ -1781,7 +1816,7 @@ static void ql_process_macip_rx_intr(str struct ql_rcv_buf_cb
[PATCH 2/5] qla3xxx: Change version to v2.03.00-k2.
Signed-off-by: Ron Mercer [EMAIL PROTECTED] --- drivers/net/qla3xxx.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index c39f20d..ae65602 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -39,7 +39,7 @@ #include qla3xxx.h #define DRV_NAME qla3xxx #define DRV_STRING QLogic ISP3XXX Network Driver -#define DRV_VERSIONv2.02.00-k36 +#define DRV_VERSIONv2.03.00-k2 #define PFXDRV_NAME static const char ql3xxx_driver_name[] = DRV_NAME; -- 1.4.2.rc2-dirty - 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/5] qla3xxx: Add delay to NVRAM register access.
Some platforms showed issues when no delay was used. This code only runs during the probe. Signed-off-by: Ron Mercer [EMAIL PROTECTED] --- drivers/net/qla3xxx.c | 37 +++-- 1 files changed, 23 insertions(+), 14 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index ae65602..5aef8aa 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -210,6 +210,15 @@ static void ql_write_common_reg(struct q return; } +static void ql_write_nvram_reg(struct ql3_adapter *qdev, + u32 __iomem *reg, u32 value) +{ + writel(value, reg); + readl(reg); + udelay(1); + return; +} + static void ql_write_page0_reg(struct ql3_adapter *qdev, u32 __iomem *reg, u32 value) { @@ -338,9 +347,9 @@ static void fm93c56a_select(struct ql3_a qdev-mem_map_registers; qdev-eeprom_cmd_data = AUBURN_EEPROM_CS_1; - ql_write_common_reg(qdev, port_regs-CommonRegs.serialPortInterfaceReg, + ql_write_nvram_reg(qdev, port_regs-CommonRegs.serialPortInterfaceReg, ISP_NVRAM_MASK | qdev-eeprom_cmd_data); - ql_write_common_reg(qdev, port_regs-CommonRegs.serialPortInterfaceReg, + ql_write_nvram_reg(qdev, port_regs-CommonRegs.serialPortInterfaceReg, ((ISP_NVRAM_MASK 16) | qdev-eeprom_cmd_data)); } @@ -357,14 +366,14 @@ static void fm93c56a_cmd(struct ql3_adap qdev-mem_map_registers; /* Clock in a zero, then do the start bit */ - ql_write_common_reg(qdev, port_regs-CommonRegs.serialPortInterfaceReg, + ql_write_nvram_reg(qdev, port_regs-CommonRegs.serialPortInterfaceReg, ISP_NVRAM_MASK | qdev-eeprom_cmd_data | AUBURN_EEPROM_DO_1); - ql_write_common_reg(qdev, port_regs-CommonRegs.serialPortInterfaceReg, + ql_write_nvram_reg(qdev, port_regs-CommonRegs.serialPortInterfaceReg, ISP_NVRAM_MASK | qdev- eeprom_cmd_data | AUBURN_EEPROM_DO_1 | AUBURN_EEPROM_CLK_RISE); - ql_write_common_reg(qdev, port_regs-CommonRegs.serialPortInterfaceReg, + ql_write_nvram_reg(qdev, port_regs-CommonRegs.serialPortInterfaceReg, ISP_NVRAM_MASK | qdev- eeprom_cmd_data | AUBURN_EEPROM_DO_1 | AUBURN_EEPROM_CLK_FALL); @@ -380,20 +389,20 @@ static void fm93c56a_cmd(struct ql3_adap * If the bit changed, then change the DO state to * match */ - ql_write_common_reg(qdev, + ql_write_nvram_reg(qdev, port_regs-CommonRegs. serialPortInterfaceReg, ISP_NVRAM_MASK | qdev- eeprom_cmd_data | dataBit); previousBit = dataBit; } - ql_write_common_reg(qdev, + ql_write_nvram_reg(qdev, port_regs-CommonRegs. serialPortInterfaceReg, ISP_NVRAM_MASK | qdev- eeprom_cmd_data | dataBit | AUBURN_EEPROM_CLK_RISE); - ql_write_common_reg(qdev, + ql_write_nvram_reg(qdev, port_regs-CommonRegs. serialPortInterfaceReg, ISP_NVRAM_MASK | qdev- @@ -414,20 +423,20 @@ static void fm93c56a_cmd(struct ql3_adap * If the bit changed, then change the DO state to * match */ - ql_write_common_reg(qdev, + ql_write_nvram_reg(qdev, port_regs-CommonRegs. serialPortInterfaceReg, ISP_NVRAM_MASK | qdev- eeprom_cmd_data | dataBit); previousBit = dataBit; } - ql_write_common_reg(qdev, + ql_write_nvram_reg(qdev, port_regs-CommonRegs. serialPortInterfaceReg, ISP_NVRAM_MASK | qdev- eeprom_cmd_data | dataBit | AUBURN_EEPROM_CLK_RISE); - ql_write_common_reg(qdev, + ql_write_nvram_reg(qdev, port_regs-CommonRegs.
[PATCH 4/5] qla3xxx: Remove NETIF_F_LLTX from driver features.
The TX locking was removed some time ago but this flag was overlooked. Signed-off-by: Ron Mercer [EMAIL PROTECTED] --- drivers/net/qla3xxx.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 5aef8aa..24205c6 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -3630,7 +3630,6 @@ static int __devinit ql3xxx_probe(struct qdev-msg_enable = netif_msg_init(debug, default_msg); - ndev-features |= NETIF_F_LLTX; if (pci_using_dac) ndev-features |= NETIF_F_HIGHDMA; if (qdev-device_id == QL3032_DEVICE_ID) -- 1.4.2.rc2-dirty - 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/5] qla3xxx: Fixed rx checksum warning.
Signed-off-by: Ron Mercer [EMAIL PROTECTED] --- drivers/net/qla3xxx.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 24205c6..f384e40 100644 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -1879,7 +1879,7 @@ static void ql_process_macip_rx_intr(str memcpy(skb_push(skb2, size), skb1-data + VLAN_ID_LEN, size); skb2-ip_summed = CHECKSUM_NONE; } else { - skb2-ip_summed = CHECKSUM_COMPLETE; + skb2-ip_summed = CHECKSUM_UNNECESSARY; if (ib_ip_rsp_ptr-checksum IB_IP_IOCB_RSP_3032_ICE) { skb2-ip_summed = CHECKSUM_NONE; printk(KERN_ERR -- 1.4.2.rc2-dirty - 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 0/5] qla3xxx:resubmit support for Qlogic 4032 and fixes.
These 5 patches were submitted on Dec 5th (12) and Dec 11th (3-5). They add/fix the following 1. Add support for Qlogic 4032 chip. 2. Change minor version for 4032 support. 3. Add delay when accessing NVRAM. 4. Remove NETIF_F_LLTX flag from features. It was left over from the early driver and shouldn't be there. 5. Fix rx checksum warning. We didn't get any feedback on any of these previously posted patches and couldn't find a tree where they were added. We've build and tested them on 2.6.20-rc1. These patches must be applied in order. - 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] 8139too: force media setting cleanup
From: Bernard Lee [EMAIL PROTECTED] Setting bit 4 5 alone in 8139too module media option does not really force 100Mbps full-duplex mode. When media option bit 0-3 is cleared, 8139too module does not force media setting. Therefore, bit 0-3 requires to be set for bit 4 5 to take effect. The hidden bit 0-3 setting is not stated in module description. It can be fixed by changing rtl8139_private structure default_port bitfield from 4-bit to 6-bit. Besides, module media bit 9 is a duplicate of bit 4 (full-duplex). It is suggested that bit 9 is freed. A remark is added to module description that bit 0 can be used to force setting. It helps to clarify 10Mbps half-duplex mode. Signed-off-by: Bernard Lee [EMAIL PROTECTED] Cc: Jeff Garzik [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] --- drivers/net/8139too.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff -puN drivers/net/8139too.c~8139too-force-media-setting-fix drivers/net/8139too.c --- a/drivers/net/8139too.c~8139too-force-media-setting-fix +++ a/drivers/net/8139too.c @@ -586,7 +586,7 @@ struct rtl8139_private { signed char phys[4];/* MII device addresses. */ char twistie, twist_row, twist_col; /* Twister tune state. */ unsigned int watchdog_fired : 1; - unsigned int default_port : 4; /* Last dev-if_port value. */ + unsigned int default_port : 6; /* Last dev-if_port value. */ unsigned int have_thread : 1; spinlock_t lock; spinlock_t rx_lock; @@ -612,7 +612,7 @@ module_param_array(full_duplex, int, NUL module_param(debug, int, 0); MODULE_PARM_DESC (debug, 8139too bitmapped message enable number); MODULE_PARM_DESC (multicast_filter_limit, 8139too maximum number of filtered multicast addresses); -MODULE_PARM_DESC (media, 8139too: Bits 4+9: force full duplex, bit 5: 100Mbps); +MODULE_PARM_DESC (media, 8139too: bit 0: force setting, bit 4: full duplex, bit 5: 100Mbps); MODULE_PARM_DESC (full_duplex, 8139too: Force full duplex for board(s) (1)); static int read_eeprom (void __iomem *ioaddr, int location, int addr_len); @@ -1068,8 +1068,8 @@ static int __devinit rtl8139_init_one (s /* The lower four bits are the media type. */ option = (board_idx = MAX_UNITS) ? 0 : media[board_idx]; if (option 0) { - tp-mii.full_duplex = (option 0x210) ? 1 : 0; - tp-default_port = option 0xFF; + tp-mii.full_duplex = (option 0x10) ? 1 : 0; + tp-default_port = option 0x3F; if (tp-default_port) tp-mii.force_media = 1; } _ - 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/7] driver for Silan SC92031 netdev
From: Cesar Eduardo Barros [EMAIL PROTECTED] This is a driver for the Silan SC92031/Rsltek 8139D NIC chip. This chip is found on at least one counterfeit Encore ENL832-TX-RENT NIC [1], which came with a mini-CD with the 2.4 driver. A slightly older version of the driver was found at [2]. The main difference between them is that the newer one has a small bugfix in the RX path, a lot of gratuitous renaming of functions, all the printable strings changed to show as a Rsltek 8139D [sic], and a PCI ID of 8139 instead of 2031. The driver on this patch is a rewrite of the vendor drivers (based mostly on the older one). Changes from the previous patch sent to netdev: - Use MMIO instead of PIO - Changed TX bounce buffers allocation - Use skb_copy_and_csum_dev - Several small bug fixes - Tested for more than just a few minutes each time [1] See http://www.encore-usa.com/faq.php under ENL832-TX-RENT for more information [2] Look for SL_LINUX.ZIP (which is really a .tar.gz) at http://broadbandforum.in/dataone_Intex_LAN_cardlinux-t4207-s15.html [3] To compile on 2.6.17, simply add back the last argument to the interrupt handler in two places, and copy the boolean declarations from 2.6.19 [EMAIL PROTECTED]: build fixes] Signed-off-by: Cesar Eduardo Barros [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] --- drivers/net/Kconfig | 12 drivers/net/Makefile |1 drivers/net/sc92031.c | 1620 3 files changed, 1633 insertions(+) diff -puN drivers/net/Kconfig~driver-for-silan-sc92031-netdev drivers/net/Kconfig --- a/drivers/net/Kconfig~driver-for-silan-sc92031-netdev +++ a/drivers/net/Kconfig @@ -1788,6 +1788,18 @@ config LAN_SAA9730 workstations. See http://www.semiconductors.philips.com/pip/SAA9730_flyer_1. +config SC92031 + tristate Silan SC92031 PCI Fast Ethernet Adapter driver (EXPERIMENTAL) + depends on NET_PCI PCI EXPERIMENTAL + select CRC32 + ---help--- + This is a driver for the Fast Ethernet PCI network cards based on + the Silan SC92031 chip (sometimes also called Rsltek 8139D). If you + have one of these, say Y here. + + To compile this driver as a module, choose M here: the module + will be called sc92031. This is recommended. + config NET_POCKET bool Pocket and portable adapters depends on NET_ETHERNET PARPORT diff -puN drivers/net/Makefile~driver-for-silan-sc92031-netdev drivers/net/Makefile --- a/drivers/net/Makefile~driver-for-silan-sc92031-netdev +++ a/drivers/net/Makefile @@ -160,6 +160,7 @@ obj-$(CONFIG_APRICOT) += 82596.o obj-$(CONFIG_LASI_82596) += lasi_82596.o obj-$(CONFIG_MVME16x_NET) += 82596.o obj-$(CONFIG_BVME6000_NET) += 82596.o +obj-$(CONFIG_SC92031) += sc92031.o # This is also a 82596 and should probably be merged obj-$(CONFIG_LP486E) += lp486e.o diff -puN /dev/null drivers/net/sc92031.c --- /dev/null +++ a/drivers/net/sc92031.c @@ -0,0 +1,1620 @@ +/* Silan SC92031 PCI Fast Ethernet Adapter driver + * + * Based on vendor drivers: + * Silan Fast Ethernet Netcard Driver: + *MODULE_AUTHOR (gaoyonghong); + *MODULE_DESCRIPTION (SILAN Fast Ethernet driver); + *MODULE_LICENSE(GPL); + * 8139D Fast Ethernet driver: + *(C) 2002 by gaoyonghong + *MODULE_AUTHOR (gaoyonghong); + *MODULE_DESCRIPTION (Rsltek 8139D PCI Fast Ethernet Adapter driver); + *MODULE_LICENSE(GPL); + * Both are almost identical and seem to be based on pci-skeleton.c + * + * Rewritten for 2.6 by Cesar Eduardo Barros + */ + +/* Note about set_mac_address: I don't know how to change the hardware + * matching, so you need to enable IFF_PROMISC when using it. + */ + +#include linux/module.h +#include linux/kernel.h +#include linux/delay.h +#include linux/pci.h +#include linux/dma-mapping.h +#include linux/netdevice.h +#include linux/etherdevice.h +#include linux/ethtool.h +#include linux/crc32.h + +#include asm/irq.h + +#define PCI_VENDOR_ID_SILAN0x1904 +#define PCI_DEVICE_ID_SILAN_SC920310x2031 +#define PCI_DEVICE_ID_SILAN_8139D 0x8139 + +#define SC92031_NAME sc92031 +#define SC92031_DESCRIPTION Silan SC92031 PCI Fast Ethernet Adapter driver +#define SC92031_VERSION 2.0c + +/* BAR 0 is MMIO, BAR 1 is PIO */ +#ifndef SC92031_USE_BAR +#define SC92031_USE_BAR 0 +#endif + +/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). */ +static int multicast_filter_limit = 64; +module_param(multicast_filter_limit, int, 0); +MODULE_PARM_DESC(multicast_filter_limit, + Maximum number of filtered multicast addresses); + +static int media; +module_param(media, int, 0); +MODULE_PARM_DESC(media, Media type (0x00 = autodetect, +0x01 = 10M half, 0x02 = 10M full, +0x04 = 100M half, 0x08 = 100M full)); + +/* Size of the in-memory receive ring. */ +#define RX_BUF_LEN_IDX 3 /* 0==8K, 1==16K, 2==32K, 3==64K ,4==128K*/ +#define RX_BUF_LEN(8192
[patch 7/7] netpoll: drivers must not enable IRQ unconditionally in their NAPI handler
From: Francois Romieu [EMAIL PROTECTED] net/core/netpoll.c::netpoll_send_skb() calls the poll handler when it is available. As netconsole can be used from almost any context, IRQ must not be enabled blindly in the NAPI handler of a driver which supports netpoll. b57bd06655a028aba7b92e1c19c2093e7fcfb341 fixed the issue for the 8139too.c driver. Signed-off-by: Francois Romieu [EMAIL PROTECTED] Cc: Stephen Hemminger [EMAIL PROTECTED] Cc: Ayaz Abdulla [EMAIL PROTECTED] Cc: Gary Zambrano [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] --- drivers/net/8139cp.c|6 -- drivers/net/b44.c |6 -- drivers/net/forcedeth.c | 11 +++ drivers/net/skge.c |5 +++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff -puN drivers/net/8139cp.c~netpoll-drivers-must-not-enable-irq-unconditionally-in-their-napi-handler drivers/net/8139cp.c --- a/drivers/net/8139cp.c~netpoll-drivers-must-not-enable-irq-unconditionally-in-their-napi-handler +++ a/drivers/net/8139cp.c @@ -617,13 +617,15 @@ rx_next: * this round of polling */ if (rx_work) { + unsigned long flags; + if (cpr16(IntrStatus) cp_rx_intr_mask) goto rx_status_loop; - local_irq_disable(); + local_irq_save(flags); cpw16_f(IntrMask, cp_intr_mask); __netif_rx_complete(dev); - local_irq_enable(); + local_irq_restore(flags); return 0; /* done */ } diff -puN drivers/net/b44.c~netpoll-drivers-must-not-enable-irq-unconditionally-in-their-napi-handler drivers/net/b44.c --- a/drivers/net/b44.c~netpoll-drivers-must-not-enable-irq-unconditionally-in-their-napi-handler +++ a/drivers/net/b44.c @@ -879,12 +879,14 @@ static int b44_poll(struct net_device *n } if (bp-istat ISTAT_ERRORS) { - spin_lock_irq(bp-lock); + unsigned long flags; + + spin_lock_irqsave(bp-lock, flags); b44_halt(bp); b44_init_rings(bp); b44_init_hw(bp, 1); netif_wake_queue(bp-dev); - spin_unlock_irq(bp-lock); + spin_unlock_irqrestore(bp-lock, flags); done = 1; } diff -puN drivers/net/forcedeth.c~netpoll-drivers-must-not-enable-irq-unconditionally-in-their-napi-handler drivers/net/forcedeth.c --- a/drivers/net/forcedeth.c~netpoll-drivers-must-not-enable-irq-unconditionally-in-their-napi-handler +++ a/drivers/net/forcedeth.c @@ -2576,14 +2576,15 @@ static int nv_napi_poll(struct net_devic int pkts, limit = min(*budget, dev-quota); struct fe_priv *np = netdev_priv(dev); u8 __iomem *base = get_hwbase(dev); + unsigned long flags; pkts = nv_rx_process(dev, limit); if (nv_alloc_rx(dev)) { - spin_lock_irq(np-lock); + spin_lock_irqsave(np-lock, flags); if (!np-in_shutdown) mod_timer(np-oom_kick, jiffies + OOM_REFILL); - spin_unlock_irq(np-lock); + spin_unlock_irqrestore(np-lock, flags); } if (pkts limit) { @@ -2591,13 +2592,15 @@ static int nv_napi_poll(struct net_devic netif_rx_complete(dev); /* re-enable receive interrupts */ - spin_lock_irq(np-lock); + spin_lock_irqsave(np-lock, flags); + np-irqmask |= NVREG_IRQ_RX_ALL; if (np-msi_flags NV_MSI_X_ENABLED) writel(NVREG_IRQ_RX_ALL, base + NvRegIrqMask); else writel(np-irqmask, base + NvRegIrqMask); - spin_unlock_irq(np-lock); + + spin_unlock_irqrestore(np-lock, flags); return 0; } else { /* used up our quantum, so reschedule */ diff -puN drivers/net/skge.c~netpoll-drivers-must-not-enable-irq-unconditionally-in-their-napi-handler drivers/net/skge.c --- a/drivers/net/skge.c~netpoll-drivers-must-not-enable-irq-unconditionally-in-their-napi-handler +++ a/drivers/net/skge.c @@ -2920,6 +2920,7 @@ static int skge_poll(struct net_device * struct skge_hw *hw = skge-hw; struct skge_ring *ring = skge-rx_ring; struct skge_element *e; + unsigned long flags; int to_do = min(dev-quota, *budget); int work_done = 0; @@ -2957,12 +2958,12 @@ static int skge_poll(struct net_device * if (work_done = to_do) return 1; /* not done */ - spin_lock_irq(hw-hw_lock); + spin_lock_irqsave(hw-hw_lock, flags); __netif_rx_complete(dev); hw-intr_mask |= irqmask[skge-port]; skge_write32(hw, B0_IMSK, hw-intr_mask); skge_read32(hw, B0_IMSK); - spin_unlock_irq(hw-hw_lock); + spin_unlock_irqrestore(hw-hw_lock, flags); return 0; } _ - To
[patch 6/7] PHY probe not working properly for ibm_emac (PPC4xx)
From: Hynek Petrak [EMAIL PROTECTED] I have a system with AMCC PowerPC 405EP and PHY Intel LXT971A. Linux 2.6.18.3 is not able to detect the PHY ID correctly. The PHY ID detected is 0, but should be 0x1d. This is because phy_read() (__emac_mdio_read() resp.) from drivers/net/ibm_emac/ibm_emac_core.c might return -ETIMEDOUT or -EREMOTEIO on error. This is ignored inside the int mii_phy_probe(struct mii_phy *phy, int address) from drivers/net/ibm_emac/ibm_emac_phy.c as the return value is assigned to an u32 variable. Cc: Jeff Garzik [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] --- drivers/net/ibm_emac/ibm_emac_phy.c |4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) diff -puN drivers/net/ibm_emac/ibm_emac_phy.c~problem-phy-probe-not-working-properly-for-ibm_emac-ppc4xx drivers/net/ibm_emac/ibm_emac_phy.c --- a/drivers/net/ibm_emac/ibm_emac_phy.c~problem-phy-probe-not-working-properly-for-ibm_emac-ppc4xx +++ a/drivers/net/ibm_emac/ibm_emac_phy.c @@ -309,7 +309,7 @@ int mii_phy_probe(struct mii_phy *phy, i { struct mii_phy_def *def; int i; - u32 id; + int id; phy-autoneg = AUTONEG_DISABLE; phy-advertising = 0; @@ -324,6 +324,8 @@ int mii_phy_probe(struct mii_phy *phy, i /* Read ID and find matching entry */ id = (phy_read(phy, MII_PHYSID1) 16) | phy_read(phy, MII_PHYSID2); + if (id 0) + return -ENODEV; for (i = 0; (def = mii_phy_table[i]) != NULL; i++) if ((id def-phy_id_mask) == def-phy_id) break; _ - 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] ep93xx: some minor cleanups to the ep93xx eth driver
From: Yan Burman [EMAIL PROTECTED] Small cleanup in the Cirrus Logic EP93xx ethernet driver: Check for NULL pointer before dereferencing it instead of after. Remove unreferenced variable. Signed-off-by: Yan Burman [EMAIL PROTECTED] Cc: Jeff Garzik [EMAIL PROTECTED] Cc: Russell King [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] --- drivers/net/arm/ep93xx_eth.c |4 +--- 1 files changed, 1 insertion(+), 3 deletions(-) diff -puN drivers/net/arm/ep93xx_eth.c~ep93xx-some-minor-cleanups-to-the-ep93xx-eth-driver drivers/net/arm/ep93xx_eth.c --- a/drivers/net/arm/ep93xx_eth.c~ep93xx-some-minor-cleanups-to-the-ep93xx-eth-driver +++ a/drivers/net/arm/ep93xx_eth.c @@ -780,12 +780,10 @@ static struct ethtool_ops ep93xx_ethtool struct net_device *ep93xx_dev_alloc(struct ep93xx_eth_data *data) { struct net_device *dev; - struct ep93xx_priv *ep; dev = alloc_etherdev(sizeof(struct ep93xx_priv)); if (dev == NULL) return NULL; - ep = netdev_priv(dev); memcpy(dev-dev_addr, data-dev_addr, ETH_ALEN); @@ -840,9 +838,9 @@ static int ep93xx_eth_probe(struct platf struct ep93xx_priv *ep; int err; - data = pdev-dev.platform_data; if (pdev == NULL) return -ENODEV; + data = pdev-dev.platform_data; dev = ep93xx_dev_alloc(data); if (dev == NULL) { _ - 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] irda: handle out of memory errors
On Tue, Dec 19, 2006 at 05:55:09PM +0900, Akinobu Mita wrote: This patch checks return value of memory allocation functions for irda subsystem and fixes memory leaks in error cases. Cc: Samuel Ortiz [EMAIL PROTECTED] Signed-off-by: Akinobu Mita [EMAIL PROTECTED] That looks correct, thanks for the patch. Signed-off-by: Samuel Ortiz [EMAIL PROTECTED] Cheers, Samuel. --- net/irda/irias_object.c | 40 1 file changed, 40 insertions(+) Index: 2.6-mm/net/irda/irias_object.c === --- 2.6-mm.orig/net/irda/irias_object.c +++ 2.6-mm/net/irda/irias_object.c @@ -91,6 +91,12 @@ struct ias_object *irias_new_object( cha obj-magic = IAS_OBJECT_MAGIC; obj-name = strndup(name, IAS_MAX_CLASSNAME); + if (!obj-name) { + IRDA_WARNING(%s(), Unable to allocate name!\n, + __FUNCTION__); + kfree(obj); + return NULL; + } obj-id = id; /* Locking notes : the attrib spinlock has lower precendence @@ -101,6 +107,7 @@ struct ias_object *irias_new_object( cha if (obj-attribs == NULL) { IRDA_WARNING(%s(), Unable to allocate attribs!\n, __FUNCTION__); + kfree(obj-name); kfree(obj); return NULL; } @@ -357,6 +364,15 @@ void irias_add_integer_attrib(struct ias /* Insert value */ attrib-value = irias_new_integer_value(value); + if (!attrib-name || !attrib-value) { + IRDA_WARNING(%s: Unable to allocate attribute!\n, + __FUNCTION__); + if (attrib-value) + irias_delete_value(attrib-value); + kfree(attrib-name); + kfree(attrib); + return; + } irias_add_attrib(obj, attrib, owner); } @@ -391,6 +407,15 @@ void irias_add_octseq_attrib(struct ias_ attrib-name = strndup(name, IAS_MAX_ATTRIBNAME); attrib-value = irias_new_octseq_value( octets, len); + if (!attrib-name || !attrib-value) { + IRDA_WARNING(%s: Unable to allocate attribute!\n, + __FUNCTION__); + if (attrib-value) + irias_delete_value(attrib-value); + kfree(attrib-name); + kfree(attrib); + return; + } irias_add_attrib(obj, attrib, owner); } @@ -424,6 +449,15 @@ void irias_add_string_attrib(struct ias_ attrib-name = strndup(name, IAS_MAX_ATTRIBNAME); attrib-value = irias_new_string_value(value); + if (!attrib-name || !attrib-value) { + IRDA_WARNING(%s: Unable to allocate attribute!\n, + __FUNCTION__); + if (attrib-value) + irias_delete_value(attrib-value); + kfree(attrib-name); + kfree(attrib); + return; + } irias_add_attrib(obj, attrib, owner); } @@ -473,6 +507,12 @@ struct ias_value *irias_new_string_value value-type = IAS_STRING; value-charset = CS_ASCII; value-t.string = strndup(string, IAS_MAX_STRING); + if (!value-t.string) { + IRDA_WARNING(%s: Unable to kmalloc!\n, __FUNCTION__); + kfree(value); + return NULL; + } + value-len = strlen(value-t.string); return value; - 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] irlan: handle out of memory errors
On Tue, Dec 19, 2006 at 05:56:01PM +0900, Akinobu Mita wrote: This patch checks return values: - irlmp_register_client() - irlmp_register_service() - irlan_open() Cc: Samuel Ortiz [EMAIL PROTECTED] Signed-off-by: Akinobu Mita [EMAIL PROTECTED] This one seems correct as well, thanks again. Signed-off-by: Samuel Ortiz [EMAIL PROTECTED] Cheers, Samuel. --- net/irda/irlan/irlan_common.c | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-) Index: 2.6-mm/net/irda/irlan/irlan_common.c === --- 2.6-mm.orig/net/irda/irlan/irlan_common.c +++ 2.6-mm/net/irda/irlan/irlan_common.c @@ -144,12 +144,18 @@ static int __init irlan_init(void) /* Register with IrLMP as a client */ ckey = irlmp_register_client(hints, irlan_client_discovery_indication, NULL, NULL); - + if (!ckey) + goto err_ckey; + /* Register with IrLMP as a service */ - skey = irlmp_register_service(hints); + skey = irlmp_register_service(hints); + if (!skey) + goto err_skey; /* Start the master IrLAN instance (the only one for now) */ - new = irlan_open(DEV_ADDR_ANY, DEV_ADDR_ANY); + new = irlan_open(DEV_ADDR_ANY, DEV_ADDR_ANY); + if (!new) + goto err_open; /* The master will only open its (listen) control TSAP */ irlan_provider_open_ctrl_tsap(new); @@ -158,6 +164,17 @@ static int __init irlan_init(void) irlmp_discovery_request(DISCOVERY_DEFAULT_SLOTS); return 0; + +err_open: + irlmp_unregister_service(skey); +err_skey: + irlmp_unregister_client(ckey); +err_ckey: +#ifdef CONFIG_PROC_FS + remove_proc_entry(irlan, proc_irda); +#endif /* CONFIG_PROC_FS */ + + return -ENOMEM; } static void __exit irlan_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
Re: [ANN] Acrypto asynchronous crypto layer 2.6.19 release.
Evgeniy Polyakov wrote: You can change it in async_provider in compilation time or I can create module version. There is an item in related todo list to use crypto contexts, they were created exactly for such kind of things (actually for hardware devices which do not support realtime key changes). ok, what do I need to change to get aes-cbc-essiv:sha256 support so I can use acrypto with my current dm-crypt'ed partitions? would be nice to track those issues, so people testing your patch are aware of the situation. I will change acrypto software crypto provider, but right now, yes, software crypto only supports one mode. ok, thanks. Regards, Andreas - 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: [ANN] Acrypto asynchronous crypto layer 2.6.19 release.
On Tue, Dec 19, 2006 at 11:51:01AM +0100, Andreas Jellinghaus ([EMAIL PROTECTED]) wrote: Evgeniy Polyakov wrote: You can change it in async_provider in compilation time or I can create module version. There is an item in related todo list to use crypto contexts, they were created exactly for such kind of things (actually for hardware devices which do not support realtime key changes). ok, what do I need to change to get aes-cbc-essiv:sha256 support so I can use acrypto with my current dm-crypt'ed partitions? For AES CBC only set of supported operations should be extended. Something like patch below: diff --git a/acrypto/async_provider.c b/acrypto/async_provider.c index ac11708..186cc5c 100644 --- a/acrypto/async_provider.c +++ b/acrypto/async_provider.c @@ -48,6 +48,12 @@ static struct acrypto_capability prov_caps[] = { {ACRYPTO_OP_ENCRYPT, ACRYPTO_TYPE_AES_128, ACRYPTO_MODE_CBC, 1000}, {ACRYPTO_OP_DECRYPT, ACRYPTO_TYPE_AES_128, ACRYPTO_MODE_CBC, 1000}, + + {ACRYPTO_OP_ENCRYPT, ACRYPTO_TYPE_AES_192, ACRYPTO_MODE_CBC, 1000}, + {ACRYPTO_OP_DECRYPT, ACRYPTO_TYPE_AES_192, ACRYPTO_MODE_CBC, 1000}, + + {ACRYPTO_OP_ENCRYPT, ACRYPTO_TYPE_AES_256, ACRYPTO_MODE_CBC, 1000}, + {ACRYPTO_OP_DECRYPT, ACRYPTO_TYPE_AES_256, ACRYPTO_MODE_CBC, 1000}, }; static int prov_cap_number = sizeof(prov_caps)/sizeof(prov_caps[0]); -- Evgeniy Polyakov - 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: Bug 7596 - Potential performance bottleneck for Linxu TCP
I noticed this bit of discussion in tcp_recvmsg. It implies that a better queuing policy would be good. But it is confusing English (Alexey?) so not sure where to start. if (!sysctl_tcp_low_latency tp-ucopy.task == user_recv) { /* Install new reader */ if (!user_recv !(flags (MSG_TRUNC | MSG_PEEK))) { user_recv = current; tp-ucopy.task = user_recv; tp-ucopy.iov = msg-msg_iov; } tp-ucopy.len = len; BUG_TRAP(tp-copied_seq == tp-rcv_nxt || (flags (MSG_PEEK | MSG_TRUNC))); /* Ugly... If prequeue is not empty, we have to * process it before releasing socket, otherwise * order will be broken at second iteration. * More elegant solution is required!!! * * Look: we have the following (pseudo)queues: * * 1. packets in flight * 2. backlog * 3. prequeue * 4. receive_queue * * Each queue can be processed only if the next ones * are empty. At this point we have empty receive_queue. * But prequeue _can_ be not empty after 2nd iteration, * when we jumped to start of loop because backlog * processing added something to receive_queue. * We cannot release_sock(), because backlog contains * packets arrived _after_ prequeued ones. * * Shortly, algorithm is clear --- to process all * the queues in order. We could make it more directly, * requeueing packets from backlog to prequeue, if * is not empty. It is more elegant, but eats cycles, * unfortunately. */ if (!skb_queue_empty(tp-ucopy.prequeue)) goto do_prequeue; /* __ Set realtime policy in scheduler __ */ } if (copied = target) { /* Do not sleep, just process backlog. */ release_sock(sk); lock_sock(sk); } else -- Stephen Hemminger [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: [2.6 patch] net/irda/: proper prototypes
Hi Adrian, On Mon, Dec 18, 2006 at 04:46:26AM +0100, Adrian Bunk wrote: This patch adds proper prototypes for some functions in include/net/irda/irda.h Signed-off-by: Adrian Bunk [EMAIL PROTECTED] looks good to me, thanks. Signed-off-by: Samuel Ortiz [EMAIL PROTECTED] Cheers, Samuel. --- include/net/irda/irda.h | 15 +++ net/irda/irmod.c| 13 - 2 files changed, 15 insertions(+), 13 deletions(-) --- linux-2.6.20-rc1-mm1/include/net/irda/irda.h.old 2006-12-18 02:49:02.0 +0100 +++ linux-2.6.20-rc1-mm1/include/net/irda/irda.h 2006-12-18 02:58:02.0 +0100 @@ -113,4 +113,19 @@ #define IAS_IRCOMM_ID 0x2343 #define IAS_IRLPT_ID 0x9876 +struct net_device; +struct packet_type; + +void irda_proc_register(void); +void irda_proc_unregister(void); + +int irda_sysctl_register(void); +void irda_sysctl_unregister(void); + +int irsock_init(void); +void irsock_cleanup(void); + +int irlap_driver_rcv(struct sk_buff *skb, struct net_device *dev, + struct packet_type *ptype, struct net_device *orig_dev); + #endif /* NET_IRDA_H */ --- linux-2.6.20-rc1-mm1/net/irda/irmod.c.old 2006-12-18 02:52:18.0 +0100 +++ linux-2.6.20-rc1-mm1/net/irda/irmod.c 2006-12-18 02:53:59.0 +0100 @@ -42,19 +42,6 @@ #include net/irda/irttp.h /* irttp_init */ #include net/irda/irda_device.h/* irda_device_init */ -/* irproc.c */ -extern void irda_proc_register(void); -extern void irda_proc_unregister(void); -/* irsysctl.c */ -extern int irda_sysctl_register(void); -extern void irda_sysctl_unregister(void); -/* af_irda.c */ -extern int irsock_init(void); -extern void irsock_cleanup(void); -/* irlap_frame.c */ -extern int irlap_driver_rcv(struct sk_buff *, struct net_device *, - struct packet_type *, struct net_device *); - /* * Module parameters */ - 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: Bug 7596 - Potential performance bottleneck for Linxu TCP
Stephen Hemminger [EMAIL PROTECTED] wrote: I noticed this bit of discussion in tcp_recvmsg. It implies that a better queuing policy would be good. But it is confusing English (Alexey?) so not sure where to start. Actually I think the comment says that the current code isn't the most elegant but is more efficient. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED] Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt - 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
BUG: soft lockup detected on CPU#0! (2.6.18.2 plus hacks)
This is from 2.6.18.2 kernel with my patch set. The MAC-VLANs are in active use. From the backtrace, I am thinking this might be a generic problem, however. Any ideas about what this could be? It seems to be reproducible every day or two, but no known way to make it happen quickly... Kernel is SMP, PREEMPT. Dec 19 04:49:33 localhost kernel: BUG: soft lockup detected on CPU#0! Dec 19 04:49:33 localhost kernel: [78104252] show_trace+0x12/0x20 Dec 19 04:49:33 localhost kernel: [78104929] dump_stack+0x19/0x20 Dec 19 04:49:33 localhost kernel: [7814c88b] softlockup_tick+0x9b/0xd0 Dec 19 04:49:33 localhost kernel: [7812a992] run_local_timers+0x12/0x20 Dec 19 04:49:33 localhost kernel: [7812ac08] update_process_times+0x38/0x80 Dec 19 04:49:33 localhost kernel: [78112796] smp_apic_timer_interrupt+0x66/0x70 Dec 19 04:49:33 localhost kernel: [78103baa] apic_timer_interrupt+0x2a/0x30 Dec 19 04:49:33 localhost kernel: [78354e8c] _read_lock+0x3c/0x50 Dec 19 04:49:33 localhost kernel: [78331f42] ip_check_mc+0x22/0xb0 Dec 19 04:49:33 localhost kernel: [783068bf] ip_route_input+0x17f/0xef0 Dec 19 04:49:33 localhost kernel: [78309c59] ip_rcv+0x349/0x580 Dec 19 04:49:33 localhost kernel: [782ec98d] netif_receive_skb+0x36d/0x3b0 Dec 19 04:49:33 localhost kernel: [782ee50c] process_backlog+0x9c/0x130 Dec 19 04:49:33 localhost kernel: [782ee795] net_rx_action+0xc5/0x1f0 Dec 19 04:49:33 localhost kernel: [78125e58] __do_softirq+0x88/0x110 Dec 19 04:49:33 localhost kernel: [78125f59] do_softirq+0x79/0x80 Dec 19 04:49:33 localhost kernel: [781260ed] irq_exit+0x5d/0x60 Dec 19 04:49:33 localhost kernel: [78105a6d] do_IRQ+0x4d/0xa0 Dec 19 04:49:33 localhost kernel: [78103ae9] common_interrupt+0x25/0x2c Dec 19 04:49:33 localhost kernel: [78354c45] _spin_lock+0x35/0x50 Dec 19 04:49:33 localhost kernel: [781aab1d] proc_register+0x2d/0x110 Dec 19 04:49:33 localhost kernel: [781ab23d] create_proc_entry+0x5d/0xd0 Dec 19 04:49:33 localhost kernel: [7812873b] register_proc_table+0x6b/0x110 Dec 19 04:49:33 localhost kernel: [78128771] register_proc_table+0xa1/0x110 Dec 19 04:49:33 localhost last message repeated 3 times Dec 19 04:49:33 localhost kernel: [7812886d] register_sysctl_table+0x8d/0xc0 Dec 19 04:49:33 localhost kernel: [7832f0c9] devinet_sysctl_register+0x109/0x150 Dec 19 04:49:33 localhost kernel: [7832f2ea] inetdev_init+0xea/0x160 Dec 19 04:49:33 localhost kernel: [7832fa2e] inet_rtm_newaddr+0x16e/0x190 Dec 19 04:49:33 localhost kernel: [782f58a9] rtnetlink_rcv_msg+0x169/0x230 Dec 19 04:49:33 localhost kernel: [78300ed0] netlink_run_queue+0x90/0x140 Dec 19 04:49:33 localhost kernel: [782f56dc] rtnetlink_rcv+0x2c/0x50 Dec 19 04:49:33 localhost kernel: [783014a5] netlink_data_ready+0x15/0x60 Dec 19 04:49:33 localhost kernel: [78300167] netlink_sendskb+0x27/0x50 Dec 19 04:49:33 localhost kernel: [78300bab] netlink_unicast+0x15b/0x1f0 Dec 19 04:49:33 localhost kernel: [783013ab] netlink_sendmsg+0x20b/0x2f0 Dec 19 04:49:33 localhost kernel: [782e12bc] sock_sendmsg+0xfc/0x120 Dec 19 04:49:33 localhost kernel: [782e1a5a] sys_sendmsg+0x10a/0x220 Dec 19 04:49:33 localhost kernel: [782e3311] sys_socketcall+0x261/0x290 Dec 19 04:49:33 localhost kernel: [7810307d] sysenter_past_esp+0x56/0x8d Dec 19 04:52:17 localhost sshd[32311]: gethostby*.getanswer: asked for 203.60.60.10.in-addr.arpa IN PTR, got type A -- Ben Greear [EMAIL PROTECTED] Candela Technologies Inc http://www.candelatech.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: [Bugme-new] [Bug 7716] New: change in behavior of OUTPUT chain reject rule in 2.6.19?
On Tue, 19 Dec 2006 19:58:14 -0800 [EMAIL PROTECTED] wrote: http://bugzilla.kernel.org/show_bug.cgi?id=7716 Summary: change in behavior of OUTPUT chain reject rule in 2.6.19? Kernel Version: 2.6.19 Status: NEW Severity: normal Owner: [EMAIL PROTECTED] Submitter: [EMAIL PROTECTED] Between 2.6.18 and 2.6.19 (and 2.6.19.1) we've observed that a reject rule on the OUTPUT chain no longer causes a connection attempt to abort immediately with Connection refused. As a specific example, this rule iptables -A OUTPUT -p tcp --destination-port 23 \ --destination 10.0.20.1 -j REJECT --reject-with tcp-reset will cause a telnet connection to 10.0.20.1 to fail immediately under 2.6.18 but will take minutes to timeout under 2.6.19. A git bisect identifies change 9d02002d2dc2c7423e5891b97727fde4d667adf1 as the culprit. The change description gives no hint that this effect was intended. Is this a regression? --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. - 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: Bug 7596 - Potential performance bottleneck for Linxu TCP
From: Herbert Xu [EMAIL PROTECTED] Date: Wed, 20 Dec 2006 10:52:19 +1100 Stephen Hemminger [EMAIL PROTECTED] wrote: I noticed this bit of discussion in tcp_recvmsg. It implies that a better queuing policy would be good. But it is confusing English (Alexey?) so not sure where to start. Actually I think the comment says that the current code isn't the most elegant but is more efficient. It's just explaining the hierarchy of queues that need to be purged, and in what order, for correctness. Alexey added that code when I mentioned to him, right after we added the prequeue, that it was possible process the normal backlog before the prequeue, which is illegal. In fixing that bug, he added the comment we are discussing. - 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: [2.6 patch] drivers/atm/Kconfig: remove dead ATM_TNETA1570 option
From: Adrian Bunk [EMAIL PROTECTED] Date: Tue, 19 Dec 2006 05:13:00 +0100 This patch removes the unconverted ATM_TNETA1570 option that also lacks any code in the kernel. Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Applied, thanks Adrian. - 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: [2.6 patch] drivers/atm/fore200e.c: cleanups
From: Adrian Bunk [EMAIL PROTECTED] Date: Tue, 19 Dec 2006 05:12:58 +0100 This patch contains the following transformations from custom functions to standard kernel version: - fore200e_kmalloc() - kzalloc() - fore200e_kfree() - kfree() - fore200e_swap() - cpu_to_be32() Signed-off-by: Adrian Bunk [EMAIL PROTECTED] Looks good, applied, thanks Adrian. - 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
netif_poll_enable() barrier
Hi ! I stumbled accross what might be a bug on out of order architecture: netif_poll_enable() only does a clear_bit(). However, netif_poll_disable/enable pairs are often used as simili-spinlocks. (netif_poll_enable() has pretty much spin_lock semantics except that it schedules instead of looping). Thus, shouldn't netif_poll_disable() do an smp_wmb(); before clearing the bit to make sure that any stores done within the poll-disabled section are properly visible to the rest of the system before clearing the bit ? Cheers, Ben. - 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: Bug 7596 - Potential performance bottleneck for Linxu TCP
On Tue, 19 Dec 2006 18:55:25 -0800 (PST) David Miller [EMAIL PROTECTED] wrote: From: Herbert Xu [EMAIL PROTECTED] Date: Wed, 20 Dec 2006 10:52:19 +1100 Stephen Hemminger [EMAIL PROTECTED] wrote: I noticed this bit of discussion in tcp_recvmsg. It implies that a better queuing policy would be good. But it is confusing English (Alexey?) so not sure where to start. Actually I think the comment says that the current code isn't the most elegant but is more efficient. It's just explaining the hierarchy of queues that need to be purged, and in what order, for correctness. Alexey added that code when I mentioned to him, right after we added the prequeue, that it was possible process the normal backlog before the prequeue, which is illegal. In fixing that bug, he added the comment we are discussing. It was the realtime/normal comments that piqued my interest. Perhaps we should either tweak process priority or remove the comments. - 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: Bug 7596 - Potential performance bottleneck for Linxu TCP
From: Stephen Hemminger [EMAIL PROTECTED] Date: Tue, 19 Dec 2006 21:11:24 -0800 It was the realtime/normal comments that piqued my interest. Perhaps we should either tweak process priority or remove the comments. I mentioned that to Linus once and he said the entire idea was bogus. With the recent tcp_recvmsg() preemption issue thread, I agree with his sentiments even more than I did previously. What needs to happen is to liberate the locking so that input packet processing can occur in parallel with tcp_recvmsg(), instead of doing this bogus backlog thing which can wedge TCP ACK processing for an entire quantum if we take a kernel preemption while the process has the socket lock held. - 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] d80211: allow migration to ieee80211_dev
d80211: allow migration to ieee80211_dev This patch allows drivers to switch from ieee80211_hw to ieee80211_dev before we really rename ieee80211_hw and break everything. Signed-off-by: Michael Wu [EMAIL PROTECTED] --- include/net/d80211.h |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/include/net/d80211.h b/include/net/d80211.h index 65a5d36..f5de509 100644 --- a/include/net/d80211.h +++ b/include/net/d80211.h @@ -452,6 +452,9 @@ typedef enum { SET_KEY, DISABLE_KEY, REMOVE_ALL_KEYS, } set_key_cmd; +/* Will go away once ieee80211_hw is really renamed to ieee80211_dev. + Please use ieee80211_dev in your driver. */ +#define ieee80211_dev ieee80211_hw /* This is driver-visible part of the per-hw state the stack keeps. */ struct ieee80211_hw { /* these are assigned by d80211, don't write */ pgp5zRV9mzULU.pgp Description: PGP signature
[PATCH] forcedeth: modified comment header
This patch removes comment that forcedeth is not supported by NVIDIA. Signed-Off-By: Ayaz Abdulla [EMAIL PROTECTED] --- orig-2.6/drivers/net/forcedeth.c2006-12-19 23:16:38.0 -0500 +++ new-2.6/drivers/net/forcedeth.c 2006-12-19 23:19:28.0 -0500 @@ -3,8 +3,7 @@ * * Note: This driver is a cleanroom reimplementation based on reverse * engineered documentation written by Carl-Daniel Hailfinger - * and Andrew de Quincey. It's neither supported nor endorsed - * by NVIDIA Corp. Use at your own risk. + * and Andrew de Quincey. * * NVIDIA, nForce and other NVIDIA marks are trademarks or registered * trademarks of NVIDIA Corporation in the United States and other @@ -14,7 +13,7 @@ * Copyright (C) 2004 Andrew de Quincey (wol support) * Copyright (C) 2004 Carl-Daniel Hailfinger (invalid MAC handling, insane * IRQ rate fixes, bigendian fixes, cleanups, verification) - * Copyright (c) 2004 NVIDIA Corporation + * Copyright (c) 2004,5,6 NVIDIA Corporation * * 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
[PATCH] d80211: fix softlockup in hw_scan card when rmmod
The local-scan_work.data is not clear after scan is completed. This will cause softlockup when removing driver module because the local-scan_work is not initialized for hw_scan card and we are trying to cancel the scan_work with an uninitialized timer_list. Signed-off-by: Hong Liu [EMAIL PROTECTED] diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c index 507d071..3b55427 100644 --- a/net/d80211/ieee80211_sta.c +++ b/net/d80211/ieee80211_sta.c @@ -3641,6 +3641,7 @@ void ieee80211_scan_completed(struct iee printk(KERN_DEBUG %s: scan completed\n, dev-name); spin_lock_bh(local-ifsta_data_lock); local-sta_scanning = 0; + local-scan_work.data = NULL; local-last_scan_completed = jiffies; spin_unlock_bh(local-ifsta_data_lock); - 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