Re: [patch 5/7] bonding: replace system timer with work queue
On Mon, 26 Mar 2007, Jay Vosburgh wrote: > Andrew Morton <[EMAIL PROTECTED]> wrote: > > >On Mon, 26 Mar 2007 21:50:01 -0800 [EMAIL PROTECTED] wrote: > > > >> Replace system timer with work queue in monitor functions. The reason for > >> this change is that bonding handlers calls various sleeping functions from > >> the timer handler which is not allowed. Because we cannot share the main > >> workqueue threads (rtnl_lock is used also in linkwatch_event) - new bond > >> workqueue thread is created. > > > >I have a note here that this patch needs additional work. > > > >I forget what it was, there has since been no followup and hence I shall now > >drop this patch. > > Andy Gospodarek <[EMAIL PROTECTED]> and I have been working off > list to come up with a comprehensive scheme to resolve the various > locking problems in bonding all at once, rather than piecemeal. > Currently, we believe we've identified all of the problem areas, have > worked up a set of locking rules, and are now hashing out an > implementation that (hopefully) doesn't suck. > > The patch referenced above is more or less a functional subset > of the work we're doing, in that we'll also be moving the timers to > workqueues. When do you expect to finish your work? I think that common rule is to have at least some code to fix the problem rather than none. Jaroslav - Jaroslav Kysela <[EMAIL PROTECTED]> Linux Kernel Sound Maintainer ALSA Project, 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: [patch 5/7] bonding: replace system timer with work queue
Andrew Morton <[EMAIL PROTECTED]> wrote: >On Mon, 26 Mar 2007 21:50:01 -0800 [EMAIL PROTECTED] wrote: > >> Replace system timer with work queue in monitor functions. The reason for >> this change is that bonding handlers calls various sleeping functions from >> the timer handler which is not allowed. Because we cannot share the main >> workqueue threads (rtnl_lock is used also in linkwatch_event) - new bond >> workqueue thread is created. > >I have a note here that this patch needs additional work. > >I forget what it was, there has since been no followup and hence I shall now >drop this patch. Andy Gospodarek <[EMAIL PROTECTED]> and I have been working off list to come up with a comprehensive scheme to resolve the various locking problems in bonding all at once, rather than piecemeal. Currently, we believe we've identified all of the problem areas, have worked up a set of locking rules, and are now hashing out an implementation that (hopefully) doesn't suck. The patch referenced above is more or less a functional subset of the work we're doing, in that we'll also be moving the timers to workqueues. Andy, anything to add? -J --- -Jay Vosburgh, IBM Linux Technology Center, [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: [NET]: Allow forwarding of ip_summed except CHECKSUM_COMPLETE
From: Herbert Xu <[EMAIL PROTECTED]> Date: Tue, 27 Mar 2007 15:38:21 +1000 > [NET]: Allow forwarding of ip_summed except CHECKSUM_COMPLETE > > Right now Xen has a horrible hack that lets it forward packets with > partial checksums. One of the reasons that CHECKSUM_PARTIAL and > CHECKSUM_COMPLETE were added is so that we can get rid of this hack > (where it creates two extra bits in the skbuff to essentially mirror > ip_summed without being destroyed by the forwarding code). > > I had forgotten that I've already gone through all the deivce drivers > last time around to make sure that they're looking at ip_summed == > CHECKSUM_PARTIAL rather than ip_summed != 0 on transmit. In any case, > I've now done that again so it should definitely be safe. > > Unfortunately nobody has yet added any code to update CHECKSUM_COMPLETE > values on forward so we I'm setting that to CHECKSUM_NONE. This should > be safe to remove for bridging but I'd like to check that code path > first. > > So here is the patch that lets us get rid of the hack by preserving > ip_summed (mostly) on forwarded packets. > > Signed-off-by: Herbert Xu <[EMAIL PROTECTED]> Applied to net-2.6.22, thanks Herbert. - 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 1/3] [NET] fib_rules: goto rule action
From: Stephen Hemminger <[EMAIL PROTECTED]> Date: Mon, 26 Mar 2007 21:13:07 -0700 > Do we have to worry about self inflicted infinite loops? > Shouldn't there be some way to some basic validation? We do, and there is. You obviously didn't read Thomas's patch. He prevents loops by only allowing forward gotos. - 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 7/7] iPhase: 64bit cleanup
I have a note here that this patch needs additional work. I forget what it was, there has since been no followup and hence I shall now drop this patch. - 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 5/7] bonding: replace system timer with work queue
On Mon, 26 Mar 2007 21:50:01 -0800 [EMAIL PROTECTED] wrote: > Replace system timer with work queue in monitor functions. The reason for > this change is that bonding handlers calls various sleeping functions from > the timer handler which is not allowed. Because we cannot share the main > workqueue threads (rtnl_lock is used also in linkwatch_event) - new bond > workqueue thread is created. I have a note here that this patch needs additional work. I forget what it was, there has since been no followup and hence I shall now drop this patch. - 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] drivers/net/bonding/bond_main.c:make 3 functions static
From: Adrian Bunk <[EMAIL PROTECTED]> This patch makes the following needlessly global functions static: - bond_mode_name() - bond_sethwaddr() - bond_mii_monitor() Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- drivers/net/bonding/bond_main.c |7 --- drivers/net/bonding/bonding.h |3 --- 2 files changed, 4 insertions(+), 6 deletions(-) diff -puN drivers/net/bonding/bond_main.c~drivers-net-bonding-bond_maincmake-3-functions-static drivers/net/bonding/bond_main.c --- a/drivers/net/bonding/bond_main.c~drivers-net-bonding-bond_maincmake-3-functions-static +++ a/drivers/net/bonding/bond_main.c @@ -188,7 +188,7 @@ static void bond_send_gratuitous_arp(str /* General routines -*/ -const char *bond_mode_name(int mode) +static const char *bond_mode_name(int mode) { switch (mode) { case BOND_MODE_ROUNDROBIN : @@ -1225,7 +1225,8 @@ static void bond_detach_slave(struct bon /*-- IOCTL --*/ -int bond_sethwaddr(struct net_device *bond_dev, struct net_device *slave_dev) +static int bond_sethwaddr(struct net_device *bond_dev, + struct net_device *slave_dev) { dprintk("bond_dev=%p\n", bond_dev); dprintk("slave_dev=%p\n", slave_dev); @@ -2039,7 +2040,7 @@ static int bond_slave_info_query(struct /* Monitoring ---*/ /* this function is called regularly to monitor each slave's link. */ -void bond_mii_monitor(struct work_struct *work) +static void bond_mii_monitor(struct work_struct *work) { struct bonding *bond = container_of(work, struct bonding, mii_work.work); struct net_device *bond_dev = bond->dev; diff -puN drivers/net/bonding/bonding.h~drivers-net-bonding-bond_maincmake-3-functions-static drivers/net/bonding/bonding.h --- a/drivers/net/bonding/bonding.h~drivers-net-bonding-bond_maincmake-3-functions-static +++ a/drivers/net/bonding/bonding.h @@ -301,13 +301,10 @@ int bond_create_slave_symlinks(struct ne void bond_destroy_slave_symlinks(struct net_device *master, struct net_device *slave); int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev); int bond_release(struct net_device *bond_dev, struct net_device *slave_dev); -int bond_sethwaddr(struct net_device *bond_dev, struct net_device *slave_dev); -void bond_mii_monitor(struct work_struct *work); void bond_loadbalance_arp_mon(struct work_struct *work); void bond_activebackup_arp_mon(struct work_struct *work); void bond_set_mode_ops(struct bonding *bond, int mode); int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl); -const char *bond_mode_name(int mode); void bond_select_active_slave(struct bonding *bond); void bond_change_active_slave(struct bonding *bond, struct slave *new_active); void bond_register_arp(struct bonding *); _ - 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] bonding: replace system timer with work queue
From: Jaroslav Kysela <[EMAIL PROTECTED]> Replace system timer with work queue in monitor functions. The reason for this change is that bonding handlers calls various sleeping functions from the timer handler which is not allowed. Because we cannot share the main workqueue threads (rtnl_lock is used also in linkwatch_event) - new bond workqueue thread is created. [EMAIL PROTECTED]: cleanups] Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]> Cc: Stephen Hemminger <[EMAIL PROTECTED]> Cc: Oleg Nesterov <[EMAIL PROTECTED]> Cc: Chad Tindel <[EMAIL PROTECTED]> Cc: Jay Vosburgh <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- drivers/net/bonding/bond_3ad.c |9 ++ drivers/net/bonding/bond_3ad.h |4 - drivers/net/bonding/bond_alb.c | 12 ++- drivers/net/bonding/bond_alb.h |4 - drivers/net/bonding/bond_main.c | 92 + drivers/net/bonding/bond_sysfs.c | 60 -- drivers/net/bonding/bonding.h| 15 ++-- 7 files changed, 83 insertions(+), 113 deletions(-) diff -puN drivers/net/bonding/bond_3ad.c~bonding-replace-system-timer-with-work-queue drivers/net/bonding/bond_3ad.c --- a/drivers/net/bonding/bond_3ad.c~bonding-replace-system-timer-with-work-queue +++ a/drivers/net/bonding/bond_3ad.c @@ -2097,11 +2097,16 @@ void bond_3ad_unbind_slave(struct slave * times out, and it selects an aggregator for the ports that are yet not * related to any aggregator, and selects the active aggregator for a bond. */ -void bond_3ad_state_machine_handler(struct bonding *bond) +void bond_3ad_state_machine_handler(struct work_struct *work) { + struct ad_bond_info *ad_info; + struct bonding *bond; struct port *port; struct aggregator *aggregator; + ad_info = container_of(work, struct ad_bond_info, ad_work.work); + bond = container_of(ad_info, struct bonding, ad_info); + read_lock(&bond->lock); if (bond->kill_timers) { @@ -2149,7 +2154,7 @@ void bond_3ad_state_machine_handler(stru } re_arm: - mod_timer(&(BOND_AD_INFO(bond).ad_timer), jiffies + ad_delta_in_ticks); + queue_delayed_work(bond_wq, &(BOND_AD_INFO(bond).ad_work), ad_delta_in_ticks); out: read_unlock(&bond->lock); } diff -puN drivers/net/bonding/bond_3ad.h~bonding-replace-system-timer-with-work-queue drivers/net/bonding/bond_3ad.h --- a/drivers/net/bonding/bond_3ad.h~bonding-replace-system-timer-with-work-queue +++ a/drivers/net/bonding/bond_3ad.h @@ -261,7 +261,7 @@ struct ad_bond_info { int lacp_fast; /* whether fast periodic tx should be * requested */ - struct timer_list ad_timer; + struct delayed_work ad_work; struct packet_type ad_pkt_type; }; @@ -276,7 +276,7 @@ struct ad_slave_info { void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution, int lacp_fast); int bond_3ad_bind_slave(struct slave *slave); void bond_3ad_unbind_slave(struct slave *slave); -void bond_3ad_state_machine_handler(struct bonding *bond); +void bond_3ad_state_machine_handler(struct work_struct *work); void bond_3ad_adapter_speed_changed(struct slave *slave); void bond_3ad_adapter_duplex_changed(struct slave *slave); void bond_3ad_handle_link_change(struct slave *slave, char link); diff -puN drivers/net/bonding/bond_alb.c~bonding-replace-system-timer-with-work-queue drivers/net/bonding/bond_alb.c --- a/drivers/net/bonding/bond_alb.c~bonding-replace-system-timer-with-work-queue +++ a/drivers/net/bonding/bond_alb.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include @@ -1365,12 +1365,16 @@ out: return 0; } -void bond_alb_monitor(struct bonding *bond) +void bond_alb_monitor(struct work_struct *work) { - struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond)); + struct alb_bond_info *bond_info; + struct bonding *bond; struct slave *slave; int i; + bond_info = container_of(work, struct alb_bond_info, alb_work.work); + bond = container_of(bond_info, struct bonding, alb_info); + read_lock(&bond->lock); if (bond->kill_timers) { @@ -1469,7 +1473,7 @@ void bond_alb_monitor(struct bonding *bo } re_arm: - mod_timer(&(bond_info->alb_timer), jiffies + alb_delta_in_ticks); + queue_delayed_work(bond_wq, &(bond_info->alb_work), alb_delta_in_ticks); out: read_unlock(&bond->lock); } diff -puN drivers/net/bonding/bond_alb.h~bonding-replace-system-timer-with-work-queue drivers/net/bonding/bond_alb.h --- a/drivers/net/bonding/bond_alb.h~bonding-replace-system-timer-with-work-queue +++ a/drivers/net/bonding/bond_alb.h @@ -84,7 +84,7 @@ struct tlb_slave_info { }; struct alb_bond_info { - struct timer_list alb_timer; + struct delayed_work alb_work; struct tlb_client_info *tx_hashtbl; /* Dynamically
[patch 06/10] tulip: fix shutdown DMA/irq race
From: Grant Grundler <[EMAIL PROTECTED]> IRQs are racing with tulip_down(). DMA can be restarted by the interrupt handler _after_ we call tulip_stop_rxtx() and the DMA buffers are unmapped. The result is an MCA (hard crash on ia64) because of an IO TLB miss. The long-term fix is to make the interrupt handler shutdown aware. Signed-off-by: Grant Grundler <[EMAIL PROTECTED]> Acked-by: Valerie Henson <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- drivers/net/tulip/tulip_core.c | 31 +-- 1 file changed, 21 insertions(+), 10 deletions(-) diff -puN drivers/net/tulip/tulip_core.c~tulip-fix-shutdown-dma-irq-race drivers/net/tulip/tulip_core.c --- a/drivers/net/tulip/tulip_core.c~tulip-fix-shutdown-dma-irq-race +++ a/drivers/net/tulip/tulip_core.c @@ -734,23 +734,36 @@ static void tulip_down (struct net_devic #endif spin_lock_irqsave (&tp->lock, flags); + /* + FIXME: We should really add a shutdown-in-progress flag and + check it in the interrupt handler to see whether we should + reenable DMA or not. The preferred ordering here would be: + + stop DMA engine + disable interrupts + remove DMA resources + free_irq() + + The below works but is non-obvious and doesn't match the + ordering of bring-up. -VAL + */ + /* Disable interrupts by clearing the interrupt mask. */ iowrite32 (0x, ioaddr + CSR7); + ioread32 (ioaddr + CSR7); /* flush posted write */ - /* Stop the Tx and Rx processes. */ - tulip_stop_rxtx(tp); + spin_unlock_irqrestore (&tp->lock, flags); - /* prepare receive buffers */ - tulip_refill_rx(dev); + free_irq (dev->irq, dev); /* no more races after this */ + tulip_stop_rxtx(tp);/* Stop DMA */ - /* release any unconsumed transmit buffers */ - tulip_clean_tx_ring(tp); + /* Put driver back into the state we start with */ + tulip_refill_rx(dev); /* prepare RX buffers */ + tulip_clean_tx_ring(tp);/* clean up unsent TX buffers */ if (ioread32 (ioaddr + CSR6) != 0x) tp->stats.rx_missed_errors += ioread32 (ioaddr + CSR8) & 0x; - spin_unlock_irqrestore (&tp->lock, flags); - init_timer(&tp->timer); tp->timer.data = (unsigned long)dev; tp->timer.function = tulip_tbl[tp->chip_id].media_timer; @@ -776,7 +789,6 @@ static int tulip_close (struct net_devic printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n", dev->name, ioread32 (ioaddr + CSR5)); - free_irq (dev->irq, dev); /* Free all the skbuffs in the Rx queue. */ for (i = 0; i < RX_RING_SIZE; i++) { @@ -1747,7 +1759,6 @@ static int tulip_suspend (struct pci_dev tulip_down(dev); netif_device_detach(dev); - free_irq(dev->irq, dev); pci_save_state(pdev); pci_disable_device(pdev); _ - 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] iPhase: 64bit cleanup
From: Alan Cox <[EMAIL PROTECTED]> Signed-off-by: Alan Cox <[EMAIL PROTECTED]> Date: Thu, 09 Nov 2006 16:12:30 -0800 (PST) From: David Miller <[EMAIL PROTECTED]> This fixes the most obvious 64-bit problems, but it is still very very broken in other aspects. It is bad enough that I feel irresponsible turning it on in the 64-bit build. For example, it takes an ioremap()'d value, and accesses it as a regular cpu pointer which will explode on many architectures since all such accesses should go through asm/io.h accessors. Specifically I'm talking about dev->seg_ram, it is initialized like this: base = ioremap(real_base,iadev->pci_map_size); /* ioremap is not resolved ??? */ ... iadev->seg_ram = base + ACTUAL_SEG_RAM_BASE; ... Then used like this: desc1 = *(u_short *)(dev->seg_ram + dev->host_tcq_wr); and this: *(u_short *) (dev->seg_ram + dev->host_tcq_wr) = 0; and this: *(u_short *)(dev->seg_ram + dev->ffL.tcq_rd) = i+1; and this: desc_num = *(u_short *)(dev->seg_ram + dev->ffL.tcq_rd); and this: desc_num = *(u_short *)(dev->seg_ram + dev->ffL.tcq_rd); and this: SchedTbl = (u16*)(dev->seg_ram+CBR_SCHED_TABLE*dev->memSize); ... TstSchedTbl = (u16*)(SchedTbl+testSlot); //set index and read in value ... memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC)); ... memcpy((caddr_t)TstSchedTbl, (caddr_t)&vcIndex,sizeof(TstSchedTbl)); Really, this driver has a ton of unresolved portability problems. Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- drivers/atm/Kconfig |2 +- drivers/atm/iphase.c | 23 ++- 2 files changed, 11 insertions(+), 14 deletions(-) diff -puN drivers/atm/Kconfig~resend-iphase-64bit-cleanup drivers/atm/Kconfig --- a/drivers/atm/Kconfig~resend-iphase-64bit-cleanup +++ a/drivers/atm/Kconfig @@ -286,7 +286,7 @@ config ATM_HORIZON_DEBUG config ATM_IA tristate "Interphase ATM PCI x575/x525/x531" - depends on PCI && ATM && !64BIT + depends on PCI && ATM ---help--- This is a driver for the Interphase (i)ChipSAR adapter cards which include a variety of variants in term of the size of the diff -puN drivers/atm/iphase.c~resend-iphase-64bit-cleanup drivers/atm/iphase.c --- a/drivers/atm/iphase.c~resend-iphase-64bit-cleanup +++ a/drivers/atm/iphase.c @@ -93,10 +93,6 @@ module_param(IADebugFlag, uint, 0644); MODULE_LICENSE("GPL"); -#if BITS_PER_LONG != 32 -# error FIXME: this driver only works on 32-bit platforms -#endif - / IA_LIB **/ static void ia_init_rtn_q (IARTN_Q *que) @@ -1408,7 +1404,6 @@ static int rx_init(struct atm_dev *dev) struct abr_vc_table *abr_vc_table; u16 *vc_table; u16 *reass_table; -u16 *ptr16; int i,j, vcsize_sel; u_short freeq_st_adr; u_short *freeq_start; @@ -1423,14 +1418,15 @@ static int rx_init(struct atm_dev *dev) printk(KERN_ERR DEV_LABEL "can't allocate DLEs\n"); goto err_out; } - iadev->rx_dle_q.start = (struct dle*)dle_addr; + iadev->rx_dle_q.start = (struct dle *)dle_addr; iadev->rx_dle_q.read = iadev->rx_dle_q.start; iadev->rx_dle_q.write = iadev->rx_dle_q.start; - iadev->rx_dle_q.end = (struct dle*)((u32)dle_addr+sizeof(struct dle)*DLE_ENTRIES); + iadev->rx_dle_q.end = (struct dle*)((unsigned long)dle_addr+sizeof(struct dle)*DLE_ENTRIES); /* the end of the dle q points to the entry after the last DLE that can be used. */ /* write the upper 20 bits of the start address to rx list address register */ + /* We know this is 32bit bus addressed so the following is safe */ writel(iadev->rx_dle_dma & 0xf000, iadev->dma + IPHASE5575_RX_LIST_ADDR); IF_INIT(printk("Tx Dle list addr: 0x%08x value: 0x%0x\n", @@ -1584,11 +1580,12 @@ static int rx_init(struct atm_dev *dev) Set Packet Aging Interval count register to overflow in about 4 us */ writew(0xF6F8, iadev->reass_reg+PKT_TM_CNT ); -ptr16 = (u16*)j; -i = ((u32)ptr16 >> 6) & 0xff; - ptr16 += j - 1; - i |=(((u32)ptr16 << 2) & 0xff00); + +i = (j >> 6) & 0xFF; +j += 2 * (j - 1); +i |= ((j << 2) & 0xFF00); writew(i, iadev->reass_reg+TMOUT_RANGE); + /* initiate the desc_tble */ for(i=0; inum_tx_desc;i++) iadev->desc_tbl[i].timestamp = 0; @@ -1911,7 +1908,7 @@ static int tx_init(struct atm_dev *dev) iadev->tx_dle_q.start = (struct dle*)dle_addr; iadev->tx_dle_q.read = iadev->tx_dle_q.start; iadev->tx_dle_q.write = iadev->tx_dle_q.start; - iadev->tx_dle_q.end = (struct dle*)((u32)dle_addr+sizeof(struct dle)*DLE_ENTRIES); + iadev->tx_dle_q.end = (struct dle*)((unsigned long)d
[patch 4/7] net: tun/tap: fixed hw address handling
From: Brian Braunstein <[EMAIL PROTECTED]> Fixed tun/tap driver's handling of hw addresses. The hw address is stored in both the net_device.dev_addr and tun.dev_addr fields. These fields were not kept synchronized, and in fact weren't even initialized to the same value. Now during both init and when performing SIOCSIFHWADDR on the tun device these values are both updated. However, if SIOCSIFHWADDR is performed on the net device directly (for instance, setting the hw address using ifconfig), the tun device does not get updated. Perhaps the tun.dev_addr field should be removed completely at some point, as it is redundant and net_device.dev_addr can be used anywhere it is used. Signed-off-by: Brian Braunstein <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- drivers/net/tun.c | 38 +++--- 1 file changed, 27 insertions(+), 11 deletions(-) diff -puN drivers/net/tun.c~net-tun-tap-fixed-hw-address-handling drivers/net/tun.c --- a/drivers/net/tun.c~net-tun-tap-fixed-hw-address-handling +++ a/drivers/net/tun.c @@ -18,6 +18,10 @@ /* * Changes: * + * Brian Braunstein <[EMAIL PROTECTED]> 2007/03/23 + *Fixed hw address handling. Now net_device.dev_addr is kept consistent + *with tun.dev_addr when the address is set by this module. + * * Mike Kershaw <[EMAIL PROTECTED]> 2005/08/14 *Add TUNSETLINK ioctl to set the link encapsulation * @@ -196,7 +200,10 @@ static void tun_net_init(struct net_devi dev->set_multicast_list = tun_net_mclist; ether_setup(dev); - random_ether_addr(dev->dev_addr); + + /* random address already created for us by tun_set_iff, use it */ + memcpy(dev->dev_addr, tun->dev_addr, min(sizeof(tun->dev_addr), sizeof(dev->dev_addr)) ); + dev->tx_queue_len = TUN_READQ_SIZE; /* We prefer our own queue length */ break; } @@ -636,6 +643,7 @@ static int tun_chr_ioctl(struct inode *i return 0; case SIOCGIFHWADDR: + /* Note: the actual net device's address may be different */ memcpy(ifr.ifr_hwaddr.sa_data, tun->dev_addr, min(sizeof ifr.ifr_hwaddr.sa_data, sizeof tun->dev_addr)); if (copy_to_user( argp, &ifr, sizeof ifr)) @@ -643,16 +651,24 @@ static int tun_chr_ioctl(struct inode *i return 0; case SIOCSIFHWADDR: - /** Set the character device's hardware address. This is used when -* filtering packets being sent from the network device to the character -* device. */ - memcpy(tun->dev_addr, ifr.ifr_hwaddr.sa_data, - min(sizeof ifr.ifr_hwaddr.sa_data, sizeof tun->dev_addr)); - DBG(KERN_DEBUG "%s: set hardware address: %x:%x:%x:%x:%x:%x\n", - tun->dev->name, - tun->dev_addr[0], tun->dev_addr[1], tun->dev_addr[2], - tun->dev_addr[3], tun->dev_addr[4], tun->dev_addr[5]); - return 0; + { + /* try to set the actual net device's hw address */ + int ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr); + + if (ret == 0) { + /** Set the character device's hardware address. This is used when +* filtering packets being sent from the network device to the character +* device. */ + memcpy(tun->dev_addr, ifr.ifr_hwaddr.sa_data, + min(sizeof ifr.ifr_hwaddr.sa_data, sizeof tun->dev_addr)); + DBG(KERN_DEBUG "%s: set hardware address: %x:%x:%x:%x:%x:%x\n", + tun->dev->name, + tun->dev_addr[0], tun->dev_addr[1], tun->dev_addr[2], + tun->dev_addr[3], tun->dev_addr[4], tun->dev_addr[5]); + } + + return ret; + } case SIOCADDMULTI: /** Add the specified group to the character device's multicast filter _ - 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] Delete unused header file linux/sdla_fr.h.
From: "Robert P. J. Day" <[EMAIL PROTECTED]> Delete the unreferenced header file include/linux/sdla_fr.h. Signed-off-by: Robert P. J. Day <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- include/linux/sdla_fr.h | 638 -- 1 file changed, 638 deletions(-) diff -puN include/linux/sdla_fr.h~delete-unused-header-file-linux-sdla_frh /dev/null --- a/include/linux/sdla_fr.h +++ /dev/null @@ -1,638 +0,0 @@ -/* -* sdla_fr.hSangoma frame relay firmware API definitions. -* -* Author: Gideon Hack -* Nenad Corbic <[EMAIL PROTECTED]> -* -* Copyright: (c) 1995-2000 Sangoma Technologies Inc. -* -* 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. -* -* Oct 04, 1999 Gideon Hack Updated API structures -* Jun 02, 1999 Gideon HackModifications for S514 support -* Oct 12, 1997 Jaspreet Singh Added FR_READ_DLCI_IB_MAPPING -* Jul 21, 1997 Jaspreet Singh Changed FRRES_TOO_LONG and FRRES_TOO_MANY to -* 0x05 and 0x06 respectively. -* Dec 23, 1996 Gene Kozin v2.0 -* Apr 29, 1996 Gene Kozin v1.0 (merged version S502 & S508 definitions). -* Sep 26, 1995 Gene Kozin Initial version. -*/ -#ifndef_SDLA_FR_H -#define_SDLA_FR_H - -/* - * Notes: - * -- - * 1. All structures defined in this file are byte-alined. - * - * CompilerPlatform - * - * GNU C Linux - */ - -#ifndefPACKED -#definePACKED __attribute__((packed)) -#endif /* PACKED */ - -/* Adapter memory layout */ -#defineFR_MB_VECTOR0xE000 /* mailbox window vector */ -#defineFR502_RX_VECTOR 0xA000 /* S502 direct receive window vector */ -#defineFR502_MBOX_OFFS 0xF60 /* S502 mailbox offset */ -#defineFR508_MBOX_OFFS 0 /* S508 mailbox offset */ -#defineFR502_FLAG_OFFS 0x1FF0 /* S502 status flags offset */ -#defineFR508_FLAG_OFFS 0x1000 /* S508 status flags offset */ -#defineFR502_RXMB_OFFS 0x900 /* S502 direct receive mailbox offset */ -#defineFR508_TXBC_OFFS 0x1100 /* S508 Tx buffer info offset */ -#defineFR508_RXBC_OFFS 0x1120 /* S508 Rx buffer info offset */ - -/* Important constants */ -#define FR502_MAX_DATA 4096/* maximum data buffer length */ -#define FR508_MAX_DATA 4080/* maximum data buffer length */ -#define MIN_LGTH_FR_DATA_CFG 300 /* min Information frame length -(for configuration purposes) */ -#define FR_MAX_NO_DATA_BYTES_IN_FRAME 15354 /* max Information frame length */ - -#define HIGHEST_VALID_DLCI 991 - -/** Data Structures */ - -/* - * Frame relay command block. - */ -typedef struct fr_cmd -{ - unsigned char command PACKED; /* command code */ - unsigned short length PACKED; /* length of data buffer */ - unsigned char result PACKED; /* return code */ - unsigned short dlci PACKED; /* DLCI number */ - unsigned char attr PACKED; /* FECN, BECN, DE and C/R bits */ - unsigned short rxlost1 PACKED; /* frames discarded at int. level */ - unsigned long rxlost2 PACKED; /* frames discarded at app. level */ - unsigned char rsrv[2] PACKED; /* reserved for future use */ -} fr_cmd_t; - -/* 'command' field defines */ -#defineFR_WRITE0x01 -#defineFR_READ 0x02 -#defineFR_ISSUE_IS_FRAME 0x03 -#define FR_SET_CONFIG 0x10 -#define FR_READ_CONFIG 0x11 -#define FR_COMM_DISABLE0x12 -#define FR_COMM_ENABLE 0x13 -#define FR_READ_STATUS 0x14 -#define FR_READ_STATISTICS 0x15 -#define FR_FLUSH_STATISTICS0x16 -#defineFR_LIST_ACTIVE_DLCI 0x17 -#define FR_FLUSH_DATA_BUFFERS 0x18 -#define FR_READ_ADD_DLC_STATS 0x19 -#defineFR_ADD_DLCI 0x20 -#defineFR_DELETE_DLCI 0x21 -#defineFR_ACTIVATE_DLCI0x22 -#defineFR_DEACTIVATE_DLCI 0x22 -#define FR_READ_MODEM_STATUS 0x30 -#define FR_SET_MODEM_STATUS0x31 -#define FR_READ_ERROR_STATS0x32 -#define FR_FLUSH_ERROR_STATS 0x33 -#define FR_READ_DLCI_IB_MAPPING 0x34 -#define FR_READ_CODE_VERSION 0x40 -#defineFR_SET_INTR_MODE0x50 -#d
[patch 3/7] Delete unused header file linux/if_wanpipe_common.h
From: "Robert P. J. Day" <[EMAIL PROTECTED]> Delete the unreferenced header file include/linux/if_wanpipe_common.h, as well as the reference to it in the Doc file. Signed-off-by: Robert P. J. Day <[EMAIL PROTECTED]> Cc: Krzysztof Halasa <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- Documentation/networking/wan-router.txt |1 include/linux/if_wanpipe_common.h | 58 -- 2 files changed, 59 deletions(-) diff -puN Documentation/networking/wan-router.txt~delete-unused-header-file-linux-if_wanpipe_commonh Documentation/networking/wan-router.txt --- a/Documentation/networking/wan-router.txt~delete-unused-header-file-linux-if_wanpipe_commonh +++ a/Documentation/networking/wan-router.txt @@ -250,7 +250,6 @@ PRODUCT COMPONENTS AND RELATED FILES sdladrv.h SDLA support module API definitions sdlasfm.h SDLA firmware module definitions if_wanpipe.hWANPIPE Socket definitions - if_wanpipe_common.h WANPIPE Socket/Driver common definitions. sdlapci.h WANPIPE PCI definitions diff -puN include/linux/if_wanpipe_common.h~delete-unused-header-file-linux-if_wanpipe_commonh /dev/null --- a/include/linux/if_wanpipe_common.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -* if_wanipe_common.h Sangoma Driver/Socket common area definitions. -* -* Author: Nenad Corbic <[EMAIL PROTECTED]> -* -* Copyright:(c) 2000 Sangoma Technologies Inc. -* -* 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. -* -* Jan 13, 2000 Nenad Corbic Initial version -*/ - - -#ifndef _WANPIPE_SOCK_DRIVER_COMMON_H -#define _WANPIPE_SOCK_DRIVER_COMMON_H - -typedef struct { - struct net_device *slave; - atomic_t packet_sent; - atomic_t receive_block; - atomic_t command; - atomic_t disconnect; - atomic_t driver_busy; - long common_critical; - struct timer_list *tx_timer; - struct sock *sk;/* Wanpipe Sock bind's here */ - int (*func)(struct sk_buff *skb, struct net_device *dev, - struct sock *sk); - - struct work_struct wanpipe_work;/* deferred keventd work */ - unsigned char rw_bind;/* Sock bind state */ - unsigned char usedby; - unsigned char state; - unsigned char svc; - unsigned short lcn; - void *mbox; -} wanpipe_common_t; - - -enum { - WANSOCK_UNCONFIGURED, /* link/channel is not configured */ - WANSOCK_DISCONNECTED, /* link/channel is disconnected */ - WANSOCK_CONNECTING, /* connection is in progress */ - WANSOCK_CONNECTED, /* link/channel is operational */ - WANSOCK_LIMIT, /* for verification only */ - WANSOCK_DUALPORT, /* for Dual Port cards */ - WANSOCK_DISCONNECTING, - WANSOCK_BINDED, - WANSOCK_BIND_LISTEN, - WANSOCK_LISTEN -}; - -#endif - - _ - 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] fix irq problem with NAPI + NETPOLL
From: Atsushi Nemoto <[EMAIL PROTECTED]> This patch is to make netif_receive_skb() robust on NAPI+NETPOLL case. 1. netpoll_send_skb() calls netpoll_poll() with interrupt disabled. 2. netpoll_poll() calls poll_napi(). 3. poll_napi() calls dev->poll(). 4. dev->poll() (for example rtl8139_poll()) calls rtl8139_rx(). 5. rtl8139_rx() calls netif_receive_skb(). 6. netif_receive_skb() calls netpoll_rx(). If netpoll_rx() returned 1, no problem. If netpoll_rx() returned 0, netif_receive_skb() continues to processing the skb with interrupt disabled. It might cause some problems, for example, netif_receive_skb() -> deliver_skb() -> arp_rcv() -> arp_process() -> neigh_lookup() -> read_unlock_bh() -> local_bh_enable() -> WARN_ON_ONCE(irqs_disabled()). The patch tries to avoid this by redirecting skb to netif_rx() if netif_receive_skb() was called from irq context or irq disabled. Signed-off-by: Atsushi Nemoto <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> Cc: Francois Romieu <[EMAIL PROTECTED]> Cc: "David S. Miller" <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- net/core/dev.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff -puN net/core/dev.c~fix-irq-problem-with-napi-netpoll net/core/dev.c --- a/net/core/dev.c~fix-irq-problem-with-napi-netpoll +++ a/net/core/dev.c @@ -1769,8 +1769,15 @@ int netif_receive_skb(struct sk_buff *sk __be16 type; /* if we've gotten here through NAPI, check netpoll */ - if (skb->dev->poll && netpoll_rx(skb)) - return NET_RX_DROP; +#ifdef CONFIG_NET_POLL_CONTROLLER + if (skb->dev->poll && skb->dev->poll_controller) { + /* NAPI poll might be called in irq context on NETPOLL */ + if (in_irq() || irqs_disabled()) + return netif_rx(skb); + if (netpoll_rx(skb)) + return NET_RX_DROP; + } +#endif if (!skb->tstamp.off_sec) net_timestamp(skb); _ - 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 10/10] forcedeth: work around NULL skb dereference crash
From: Ingo Molnar <[EMAIL PROTECTED]> work around a NULL skb dereference crash that occurs during high load. Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]> Cc: Ayaz Abdulla <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- drivers/net/forcedeth.c | 20 1 file changed, 20 insertions(+) diff -puN drivers/net/forcedeth.c~forcedeth-work-around-null-skb-dereference-crash drivers/net/forcedeth.c --- a/drivers/net/forcedeth.c~forcedeth-work-around-null-skb-dereference-crash +++ a/drivers/net/forcedeth.c @@ -1902,6 +1902,16 @@ static void nv_tx_done(struct net_device np->stats.tx_carrier_errors++; np->stats.tx_errors++; } else { + if (!np->get_tx_ctx->skb) { + printk("get_tx: %td, put_tx: " + "%td\n", + np->get_tx_ctx - + np->first_tx_ctx, + np->put_tx_ctx - + np->first_tx_ctx); + WARN_ON(1); + break; + } np->stats.tx_packets++; np->stats.tx_bytes += np->get_tx_ctx->skb->len; } @@ -1917,6 +1927,16 @@ static void nv_tx_done(struct net_device np->stats.tx_carrier_errors++; np->stats.tx_errors++; } else { + if (!np->get_tx_ctx->skb) { + printk("get_tx: %td, put_tx: " + "%td\n", + np->get_tx_ctx - + np->first_tx_ctx, + np->put_tx_ctx - + np->first_tx_ctx); + WARN_ON(1); + break; + } np->stats.tx_packets++; np->stats.tx_bytes += np->get_tx_ctx->skb->len; } _ - 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 09/10] forcedeth: fix tx timeout
From: Ayaz Abdulla <[EMAIL PROTECTED]> The tx timeout routine was waking the tx queue conditionally. However, it must call it unconditionally since the dev_watchdog has halted the tx queue before calling the timeout function. Signed-off-by: Ayaz Abdulla <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- drivers/net/forcedeth.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -puN drivers/net/forcedeth.c~forcedeth-fix-tx-timeout drivers/net/forcedeth.c --- a/drivers/net/forcedeth.c~forcedeth-fix-tx-timeout +++ a/drivers/net/forcedeth.c @@ -2050,9 +2050,10 @@ static void nv_tx_timeout(struct net_dev nv_drain_tx(dev); nv_init_tx(dev); setup_hw_rings(dev, NV_SETUP_TX_RING); - netif_wake_queue(dev); } + netif_wake_queue(dev); + /* 4) restart tx engine */ nv_start_tx(dev); spin_unlock_irq(&np->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
[patch 05/10] remove unused header file: drivers/net/skfp/h/lnkstat.h
From: "Robert P. J. Day" <[EMAIL PROTECTED]> Signed-off-by: Robert P. J. Day <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- drivers/net/skfp/h/lnkstat.h | 84 - 1 file changed, 84 deletions(-) diff -puN drivers/net/skfp/h/lnkstat.h~remove-unused-header-file-drivers-net-skfp-h-lnkstath /dev/null --- a/drivers/net/skfp/h/lnkstat.h +++ /dev/null @@ -1,84 +0,0 @@ -/** - * - * (C)Copyright 1998,1999 SysKonnect, - * a business unit of Schneider & Koch & Co. Datensysteme GmbH. - * - * 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. - * - * The information in this file is provided "AS IS" without warranty. - * - **/ - -/* - * Definition of the Error Log Structure - * This structure will be copied into the Error Log buffer - * during the NDIS General Request ReadErrorLog by the MAC Driver - */ - -struct s_error_log { - - /* -* place holder for token ring adapter error log (zeros) -*/ - u_char reserved_0 ;/* byte 0 inside Error Log */ - u_char reserved_1 ;/* byte 1 */ - u_char reserved_2 ;/* byte 2 */ - u_char reserved_3 ;/* byte 3 */ - u_char reserved_4 ;/* byte 4 */ - u_char reserved_5 ;/* byte 5 */ - u_char reserved_6 ;/* byte 6 */ - u_char reserved_7 ;/* byte 7 */ - u_char reserved_8 ;/* byte 8 */ - u_char reserved_9 ;/* byte 9 */ - u_char reserved_10 ; /* byte 10 */ - u_char reserved_11 ; /* byte 11 */ - u_char reserved_12 ; /* byte 12 */ - u_char reserved_13 ; /* byte 13 */ - - /* -* FDDI link statistics -*/ -/* - * smt error low - */ -#define SMT_ERL_AEB(1<<15) /* A elast. buffer */ -#define SMT_ERL_BLC(1<<14) /* B link error condition */ -#define SMT_ERL_ALC(1<<13) /* A link error condition */ -#define SMT_ERL_NCC(1<<12) /* not copied condition */ -#define SMT_ERL_FEC(1<<11) /* frame error condition */ - -/* - * smt event low - */ -#define SMT_EVL_NCE(1<<5) - - u_short smt_error_low ; /* byte 14/15 */ - u_short smt_error_high ;/* byte 16/17 */ - u_short smt_event_low ; /* byte 18/19 */ - u_short smt_event_high ;/* byte 20/21 */ - u_short connection_policy_violation ; /* byte 22/23 */ - u_short port_event ;/* byte 24/25 */ - u_short set_count_low ; /* byte 26/27 */ - u_short set_count_high ;/* byte 28/29 */ - u_short aci_id_code ; /* byte 30/31 */ - u_short purge_frame_counter ; /* byte 32/33 */ - - /* -* CMT and RMT state machines -*/ - u_short ecm_state ; /* byte 34/35 */ - u_short pcm_a_state ; /* byte 36/37 */ - u_short pcm_b_state ; /* byte 38/39 */ - u_short cfm_state ; /* byte 40/41 */ - u_short rmt_state ; /* byte 42/43 */ - - u_short not_used[30] ; /* byte 44-103 */ - - u_short ucode_version_level ; /* byte 104/105 */ - - u_short not_used_1 ;/* byte 106/107 */ - u_short not_used_2 ;/* byte 108/109 */ -} ; _ - 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 04/10] baycom_ser_fdx: also allow i/o ports >= 0x1000 and enhanced failure logging
From: Folkert van Heusden <[EMAIL PROTECTED]> The baycom_ser_fdx driver did not allow i/o ports >= 0x1000. Now that there are pci cards (with rs232 ports) which use for example 0xb800 this limit should not exists. Also, for non kernel coders find the cause of problems was challenging so I added extra logging. Signed-off-by: Folkert van Heusden <[EMAIL PROTECTED]> Cc: Jeff Garzik <[EMAIL PROTECTED]> Cc: Alan Cox <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- drivers/net/hamradio/baycom_ser_fdx.c | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff -puN drivers/net/hamradio/baycom_ser_fdx.c~baycom_ser_fdx-also-allow-i-o-ports-=-0x1000-and-enhanced drivers/net/hamradio/baycom_ser_fdx.c --- a/drivers/net/hamradio/baycom_ser_fdx.c~baycom_ser_fdx-also-allow-i-o-ports-=-0x1000-and-enhanced +++ a/drivers/net/hamradio/baycom_ser_fdx.c @@ -413,11 +413,18 @@ static int ser12_open(struct net_device if (!dev || !bc) return -ENXIO; - if (!dev->base_addr || dev->base_addr > 0x1000-SER12_EXTENT || - dev->irq < 2 || dev->irq > 15) + if (!dev->base_addr || dev->base_addr > 0x-SER12_EXTENT || + dev->irq < 2 || dev->irq > NR_IRQS) { + printk(KERN_INFO "baycom_ser_fdx: invalid portnumber (max %u) " + "or irq (2 <= irq <= %d)\n", + 0x-SER12_EXTENT, NR_IRQS); return -ENXIO; - if (bc->baud < 300 || bc->baud > 4800) + } + if (bc->baud < 300 || bc->baud > 4800) { + printk(KERN_INFO "baycom_ser_fdx: invalid baudrate " + "(300...4800)\n"); return -EINVAL; + } if (!request_region(dev->base_addr, SER12_EXTENT, "baycom_ser_fdx")) { printk(KERN_WARNING "BAYCOM_SER_FSX: I/O port 0x%04lx busy \n", dev->base_addr); _ - 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 03/10] strlcpy is smart enough
From: Jean Delvare <[EMAIL PROTECTED]> strlcpy already accounts for the trailing zero in its length computation, so there is no need to substract one to the buffer size. Signed-off-by: Jean Delvare <[EMAIL PROTECTED]> Cc: Jan-Bernd Themann <[EMAIL PROTECTED]> Cc: Thomas Klein <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- drivers/net/ehea/ehea_ethtool.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/net/ehea/ehea_ethtool.c~ehea-strlcpy-is-smart-enough drivers/net/ehea/ehea_ethtool.c --- a/drivers/net/ehea/ehea_ethtool.c~ehea-strlcpy-is-smart-enough +++ a/drivers/net/ehea/ehea_ethtool.c @@ -144,8 +144,8 @@ static int ehea_nway_reset(struct net_de static void ehea_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) { - strlcpy(info->driver, DRV_NAME, sizeof(info->driver) - 1); - strlcpy(info->version, DRV_VERSION, sizeof(info->version) - 1); + strlcpy(info->driver, DRV_NAME, sizeof(info->driver)); + strlcpy(info->version, DRV_VERSION, sizeof(info->version)); } static u32 ehea_get_msglevel(struct net_device *dev) _ - 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 07/10] SUN3/3X Lance trivial fix improved
From: "Cyrill V. Gorcunov" <[EMAIL PROTECTED]> This patch adds checking for allocated DVMA memory and granted IRQ line. Signed-off-by: Cyrill V. Gorcunov <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- drivers/net/sun3lance.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff -puN drivers/net/sun3lance.c~sun3-3x-lance-trivial-fix-improved drivers/net/sun3lance.c --- a/drivers/net/sun3lance.c~sun3-3x-lance-trivial-fix-improved +++ a/drivers/net/sun3lance.c @@ -336,13 +336,27 @@ static int __init lance_probe( struct ne /* XXX - leak? */ MEM = dvma_malloc_align(sizeof(struct lance_memory), 0x1); + if (MEM == NULL) { +#ifdef CONFIG_SUN3 + iounmap((void __iomem *)ioaddr); +#endif + printk(KERN_WARNING "SUN3 Lance couldn't allocate DVMA memory\n"); + return 0; + } lp->iobase = (volatile unsigned short *)ioaddr; dev->base_addr = (unsigned long)ioaddr; /* informational only */ REGA(CSR0) = CSR0_STOP; - request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev); + if (request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev) < 0) { +#ifdef CONFIG_SUN3 + iounmap((void __iomem *)ioaddr); +#endif + dvma_free((void *)MEM); + printk(KERN_WARNING "SUN3 Lance unable to allocate IRQ\n"); + return 0; + } dev->irq = (unsigned short)LANCE_IRQ; _ - 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 08/10] forcedeth: fix nic poll
From: Ayaz Abdulla <[EMAIL PROTECTED]> The nic poll routine was missing the call to the optimized irq routine. This patch adds the missing call for the optimized path. See http://bugzilla.kernel.org/show_bug.cgi?id=7950 for more information. Signed-off-by: Ayaz Abdulla <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> --- drivers/net/forcedeth.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff -puN drivers/net/forcedeth.c~forcedeth-fix-nic-poll drivers/net/forcedeth.c --- a/drivers/net/forcedeth.c~forcedeth-fix-nic-poll +++ a/drivers/net/forcedeth.c @@ -3536,7 +3536,10 @@ static void nv_do_nic_poll(unsigned long pci_push(base); if (!using_multi_irqs(dev)) { - nv_nic_irq(0, dev); + if (np->desc_ver == DESC_VER_3) + nv_nic_irq_optimized(0, dev); + else + nv_nic_irq(0, dev); if (np->msi_flags & NV_MSI_X_ENABLED) enable_irq_lockdep(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector); else _ - 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 01/10] 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 file 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
[NET]: Allow forwarding of ip_summed except CHECKSUM_COMPLETE
Hi Dave: [NET]: Allow forwarding of ip_summed except CHECKSUM_COMPLETE Right now Xen has a horrible hack that lets it forward packets with partial checksums. One of the reasons that CHECKSUM_PARTIAL and CHECKSUM_COMPLETE were added is so that we can get rid of this hack (where it creates two extra bits in the skbuff to essentially mirror ip_summed without being destroyed by the forwarding code). I had forgotten that I've already gone through all the deivce drivers last time around to make sure that they're looking at ip_summed == CHECKSUM_PARTIAL rather than ip_summed != 0 on transmit. In any case, I've now done that again so it should definitely be safe. Unfortunately nobody has yet added any code to update CHECKSUM_COMPLETE values on forward so we I'm setting that to CHECKSUM_NONE. This should be safe to remove for bridging but I'd like to check that code path first. So here is the patch that lets us get rid of the hack by preserving ip_summed (mostly) on forwarded packets. Signed-off-by: Herbert Xu <[EMAIL PROTECTED]> Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 4ff3940..6d4243d 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1481,5 +1481,12 @@ static inline int skb_is_gso(const struct sk_buff *skb) return skb_shinfo(skb)->gso_size; } +static inline void skb_forward_csum(struct sk_buff *skb) +{ + /* Unfortunately we don't support this one. Any brave souls? */ + if (skb->ip_summed == CHECKSUM_COMPLETE) + skb->ip_summed = CHECKSUM_NONE; +} + #endif /* __KERNEL__ */ #endif /* _LINUX_SKBUFF_H */ diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c index 3e45c1a..ada7f49 100644 --- a/net/bridge/br_forward.c +++ b/net/bridge/br_forward.c @@ -71,7 +71,7 @@ static void __br_forward(const struct net_bridge_port *to, struct sk_buff *skb) indev = skb->dev; skb->dev = to->dev; - skb->ip_summed = CHECKSUM_NONE; + skb_forward_csum(skb); NF_HOOK(PF_BRIDGE, NF_BR_FORWARD, skb, indev, skb->dev, br_forward_finish); diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index 369e721..a38037b 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c @@ -67,7 +67,7 @@ int ip_forward(struct sk_buff *skb) if (skb->pkt_type != PACKET_HOST) goto drop; - skb->ip_summed = CHECKSUM_NONE; + skb_forward_csum(skb); /* * According to the RFC, we must first decrease the TTL field. If diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 3055169..ba0143c 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -372,7 +372,7 @@ int ip6_forward(struct sk_buff *skb) goto drop; } - skb->ip_summed = CHECKSUM_NONE; + skb_forward_csum(skb); /* * We DO NOT make any processing on - 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: [NET]: Allow ip_summed to be forwarded as is
On Tue, Mar 27, 2007 at 03:22:43PM +1000, Herbert Xu wrote: > > [NET]: Allow ip_summed to be forwarded as is Nevermind, that one is broken too. I forgot to update the complete checksums when forwarding. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[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
[NET]: Allow ip_summed to be forwarded as is
Hi Dave: [NET]: Allow ip_summed to be forwarded as is Right now Xen has a horrible hack that lets it forward packets with partial checksums. One of the reasons that CHECKSUM_PARTIAL and CHECKSUM_COMPLETE were added is so that we can get rid of this hack (where it creates two extra bits in the skbuff to essentially mirror ip_summed without being destroyed by the forwarding code). I had forgotten that I've already gone through all the deivce drivers last time around to make sure that they're looking at ip_summed == CHECKSUM_PARTIAL rather than ip_summed != 0 on transmit. In any case, I've now done that again so it should definitely be safe. So here is the patch that lets us get rid of the hack by preserving ip_summed on forwarded packets. Signed-off-by: Herbert Xu <[EMAIL PROTECTED]> Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c index 3e45c1a..f0a270a 100644 --- a/net/bridge/br_forward.c +++ b/net/bridge/br_forward.c @@ -71,7 +71,6 @@ static void __br_forward(const struct net_bridge_port *to, struct sk_buff *skb) indev = skb->dev; skb->dev = to->dev; - skb->ip_summed = CHECKSUM_NONE; NF_HOOK(PF_BRIDGE, NF_BR_FORWARD, skb, indev, skb->dev, br_forward_finish); diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index 369e721..1c65ff9 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c @@ -67,8 +67,6 @@ int ip_forward(struct sk_buff *skb) if (skb->pkt_type != PACKET_HOST) goto drop; - skb->ip_summed = CHECKSUM_NONE; - /* * According to the RFC, we must first decrease the TTL field. If * that reaches zero, we must reply an ICMP control message telling diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 3055169..a6fe803 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -372,8 +372,6 @@ int ip6_forward(struct sk_buff *skb) goto drop; } - skb->ip_summed = CHECKSUM_NONE; - /* * We DO NOT make any processing on * RA packets, pushing them to user level AS 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: [NET]: Allow partial checksums to be forwarded
On Tue, Mar 27, 2007 at 02:36:48PM +1000, Herbert Xu wrote: > > Looks like I forgot to finish the checksum stuff for Xen last time around. > > [NET]: Allow partial checksums to be forwarded Hang on, this only gets rid of half the hack. Let me change this first so that we can get rid of them all :) Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[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
Re: [NET]: Allow partial checksums to be forwarded
Herbert Xu wrote: Hi Dave: Looks like I forgot to finish the checksum stuff for Xen last time around. [NET]: Allow partial checksums to be forwarded Right now Xen has a horrible hack that lets it forward packets with partial checksums. One of the reasons that CHECKSUM_PARTIAL was added is so that we can get rid of this hack (where it creates an extra bit in the skbuff to essentially mirror ip_summed without being destroyed by the forwarding code). So here is the patch that lets us get rid of the hack by preserving CHECKSUM_PARTIAL on forwarded packets. Signed-off-by: Herbert Xu <[EMAIL PROTECTED]> Cheers, Looks okay. - 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
[NET]: Allow partial checksums to be forwarded
Hi Dave: Looks like I forgot to finish the checksum stuff for Xen last time around. [NET]: Allow partial checksums to be forwarded Right now Xen has a horrible hack that lets it forward packets with partial checksums. One of the reasons that CHECKSUM_PARTIAL was added is so that we can get rid of this hack (where it creates an extra bit in the skbuff to essentially mirror ip_summed without being destroyed by the forwarding code). So here is the patch that lets us get rid of the hack by preserving CHECKSUM_PARTIAL on forwarded packets. Signed-off-by: Herbert Xu <[EMAIL PROTECTED]> Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 4ff3940..ecea1a0 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -33,6 +33,10 @@ #define CHECKSUM_NONE 0 #define CHECKSUM_PARTIAL 1 + +/* Values larger than this are invalid for TX. */ +#define CHECKSUM_TX_MAX 1 + #define CHECKSUM_UNNECESSARY 2 #define CHECKSUM_COMPLETE 3 @@ -1481,5 +1485,11 @@ static inline int skb_is_gso(const struct sk_buff *skb) return skb_shinfo(skb)->gso_size; } +static inline void skb_forward_csum(struct sk_buff *skb) +{ + if (skb->ip_summed > CHECKSUM_TX_MAX) + skb->ip_summed = CHECKSUM_NONE; +} + #endif /* __KERNEL__ */ #endif /* _LINUX_SKBUFF_H */ diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c index 3e45c1a..ada7f49 100644 --- a/net/bridge/br_forward.c +++ b/net/bridge/br_forward.c @@ -71,7 +71,7 @@ static void __br_forward(const struct net_bridge_port *to, struct sk_buff *skb) indev = skb->dev; skb->dev = to->dev; - skb->ip_summed = CHECKSUM_NONE; + skb_forward_csum(skb); NF_HOOK(PF_BRIDGE, NF_BR_FORWARD, skb, indev, skb->dev, br_forward_finish); diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index 369e721..a38037b 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c @@ -67,7 +67,7 @@ int ip_forward(struct sk_buff *skb) if (skb->pkt_type != PACKET_HOST) goto drop; - skb->ip_summed = CHECKSUM_NONE; + skb_forward_csum(skb); /* * According to the RFC, we must first decrease the TTL field. If diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index 3055169..ba0143c 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c @@ -372,7 +372,7 @@ int ip6_forward(struct sk_buff *skb) goto drop; } - skb->ip_summed = CHECKSUM_NONE; + skb_forward_csum(skb); /* * We DO NOT make any processing on - 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 1/3] [NET] fib_rules: goto rule action
David Miller wrote: From: Thomas Graf <[EMAIL PROTECTED]> Date: Tue, 27 Mar 2007 01:54:51 +0200 This patch adds a new rule action FR_ACT_GOTO which allows to skip a set of rules by jumping to another rule. The rule to jump to is specified via the FRA_GOTO attribute which carries a rule preference. Referring to a rule which doesn't exists is explicitely allowed. Such goto rules are marked with the flag FIB_RULE_UNRESOLVED and will act like a rule with a non-matching selector. The rule will become functional as soon as its target is present. The goto action enables performance optimizations by reducing the average number of rules that have to be passed per lookup. Example: 0: from all lookup local 40: not from all to 192.168.23.128 goto 32766 41: from all fwmark 0xa blackhole 42: from all fwmark 0xff blackhole 32766: from all lookup main Signed-off-by: Thomas Graf <[EMAIL PROTECTED]> This looks excellent, applied to net-2.6.22, thanks Thomas. - 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 Do we have to worry about self inflicted infinite loops? Shouldn't there be some way to some basic validation? - 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]: Add security check before flushing SAD/SPD
On Mon, 26 Mar 2007, Joy Latten wrote: > > Sending again since one of the email addresses was incorrect. > > > > Ok, I have made improvements based on James' and Eric's comments. > Acked-by: James Morris <[EMAIL PROTECTED]> > + if (xfrm_id_proto_match(x->id.proto, proto) && > +(err = security_xfrm_state_delete(x)) != 0) { Still not a showstopper, but standard idiom would be nice at some point. - James -- James Morris <[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
[1/5] 2.6.21-rc5: known regressions
This email lists some known regressions in Linus' tree compared to 2.6.20. If you find your name in the Cc header, you are either submitter of one of the bugs, maintainer of an affectected subsystem or driver, a patch of you caused a breakage or I'm considering you in any other way possibly involved with one or more of these issues. Due to the huge amount of recipients, please trim the Cc when answering. Subject: crashes in KDE References : http://bugzilla.kernel.org/show_bug.cgi?id=8157 Submitter : Oliver Pinter <[EMAIL PROTECTED]> Status : unknown Subject: kwin dies silently (sysctl related?) References : http://lkml.org/lkml/2007/2/28/112 Submitter : Sid Boyce <[EMAIL PROTECTED]> Boris Mogwitz <[EMAIL PROTECTED]> Status : submitter was asked to bisect further Subject: problem with sockets References : http://lkml.org/lkml/2007/3/21/248 Submitter : Jose Alberto Reguero <[EMAIL PROTECTED]> Status : unknown Subject: e1000 resume weirdness References : http://lkml.org/lkml/2007/3/26/91 Submitter : Ingo Molnar <[EMAIL PROTECTED]> Handled-By : Jesse Brandeburg <[EMAIL PROTECTED]> Auke Kok <[EMAIL PROTECTED]> Status : problem is being debugged Subject: forcedeth: sporadic under-load crashes References : http://lkml.org/lkml/2007/3/26/63 Submitter : Ingo Molnar <[EMAIL PROTECTED]> Handled-By : Ingo Molnar <[EMAIL PROTECTED]> Ayaz Abdulla <[EMAIL PROTECTED]> Status : problem is being debugged Subject: forcedeth: skb_over_panic References : http://bugzilla.kernel.org/show_bug.cgi?id=8058 Submitter : Albert Hopkins <[EMAIL PROTECTED]> Handled-By : Ayaz Abdulla <[EMAIL PROTECTED]> Patch : http://bugzilla.kernel.org/show_bug.cgi?id=8058 Status : patch available - 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]: SAD sometimes has double SAs.
On Mon, 2007-03-26 at 14:48 -0700, David Miller wrote: > From: Eric Paris <[EMAIL PROTECTED]> > Date: Mon, 26 Mar 2007 17:34:59 -0400 > > > I'm not at all able to speak on the correctness or validity of the > > solution, > > Neither am I yet :) > > > but shouldn't the ipv6 case be a && not an || like the ipv4 > > case? Isn't this going to match all sorts of things? Did you test this > > patch on ipv6 and see it to solve your problem? > > > > I'm also not enjoying the formatting in the ipv6 part where the first > > time you have the cast on the same time as the object but not the second > > part where x->props.saddr.a6 is on its own little line. > > Also, I want to understand what is going to tear down these > "other direction" fake entries later on? I think I can review > this patch better if I understand that. > I am going to refer to the other-direction-placeholder as the "fake" entry. And the larval SA that gets created for the new spi as result of a GETSPI message as the "real" entry. The fake entry gets created when the real entry does and does not have an spi. It shares some of the same properties of a "real" larval SA (they are created using same code) and it's state is marked as XFRM_STATE_ACQ. The real entry has a timeout. So, should IKE negotiation fail, take too long, etc... it will eventually timeout and be deleted. So does the fake entry. It will timeout and should be eventually deleted. (I will test this part tomorrow for assurance.) When the IKE negotiations are successful, xfrm_state_add() and the xfrm_state_update() look for larval SAs in that they look for an SA with same src, dst, etc... and with state==XFRM_STATE_ACQUIRE. Any that are found are deleted and new SA added. This removes the real larval SA, and should also remove the fake entry too. Of course, this is all based on my assumption that IKE will install two SAs, one for incoming and one for outgoing. Hopefully this answers how fake entries will be removed. Admittedly, I may miss something or didn't understand something correctly as I learn the code, so please let me know. There may even be a better solution that I don't readily see. > As it stands, this looks to me like a workaround for an improperly > implemented IPSEC daemon. Joy states it as saying that the current > code requires the keying daemon to manage it's SAs, and I wonder > whether any other implementation is even valid. > My big mouth. :-) But yes, I do think more SA management in userspace would be ideal. This fix will hopefully ensure kernel doesn't send any extra acquires regardless. Joy - 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] LVS: Send ICMP unreachable responses to end-users when real-servers are removed
From: Horms <[EMAIL PROTECTED]> Date: Sun, 11 Feb 2007 12:04:43 +0900 > Hi, > > this is a small patch by Janusz Krzysztofik to ip_route_output_slow() > that allows VIP-less LVS linux director to generate packets originating > >From VIP if sysctl_ip_nonlocal_bind is set. > > In a nutshell, the intention is for an LVS linux director to be able > to send ICMP unreachable responses to end-users when real-servers are > removed. > > http://archive.linuxvirtualserver.org/html/lvs-users/2007-01/msg00106.html > > I'm not really sure about the correctness of this approach, > so I am sending it here to netdev for review > > Cc: Janusz Krzysztofik <[EMAIL PROTECTED]> > Signed-off-by: Simon Horman <[EMAIL PROTECTED]> Applied to net-2.6.22, thanks Simon. - 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/3] [NET] fib_rules: Add no-operation action
From: Thomas Graf <[EMAIL PROTECTED]> Date: Tue, 27 Mar 2007 01:54:53 +0200 > The use of nop rules simplifies the usage of goto rules > and adds more flexibility as they allow targets to remain > while the actual content of the branches can change easly. > > Signed-off-by: Thomas Graf <[EMAIL PROTECTED]> This also looks good, applied to net-2.6.22 - 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/3] [NET] fib_rules: Mark rules detached from the device
From: Thomas Graf <[EMAIL PROTECTED]> Date: Tue, 27 Mar 2007 01:54:52 +0200 > Rules which match against device names in their selector can > remain while the device itself disappears, in fact the device > doesn't have to present when the rule is added in the first > place. The device name is resolved by trying when the rule is > added and later by listening to NETDEV_REGISTER/UNREGISTER > notifications. > > This patch adds the flag FIB_RULE_DEV_DETACHED which is set > towards userspace when a rule contains a device match which > is unresolved at the moment. This eases spotting the reason > why certain rules seem not to function properly. > > Signed-off-by: Thomas Graf <[EMAIL PROTECTED]> Yep, this should make failure diagnosis easier. Applied to net-2.6.22, thanks. - 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 1/3] [NET] fib_rules: goto rule action
From: Thomas Graf <[EMAIL PROTECTED]> Date: Tue, 27 Mar 2007 01:54:51 +0200 > This patch adds a new rule action FR_ACT_GOTO which allows > to skip a set of rules by jumping to another rule. The rule > to jump to is specified via the FRA_GOTO attribute which > carries a rule preference. > > Referring to a rule which doesn't exists is explicitely allowed. > Such goto rules are marked with the flag FIB_RULE_UNRESOLVED > and will act like a rule with a non-matching selector. The rule > will become functional as soon as its target is present. > > The goto action enables performance optimizations by reducing > the average number of rules that have to be passed per lookup. > > Example: > 0: from all lookup local > 40: not from all to 192.168.23.128 goto 32766 > 41: from all fwmark 0xa blackhole > 42: from all fwmark 0xff blackhole > 32766: from all lookup main > > Signed-off-by: Thomas Graf <[EMAIL PROTECTED]> This looks excellent, applied to net-2.6.22, thanks Thomas. - 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] iproute2: support for goto/nop action and detached flag
Stephen, Patch to support the new fib rules features I just posted on netdev. Index: iproute2.git/include/linux/fib_rules.h === --- iproute2.git.orig/include/linux/fib_rules.h 2007-03-25 22:26:33.0 +0200 +++ iproute2.git/include/linux/fib_rules.h 2007-03-27 02:00:48.0 +0200 @@ -7,6 +7,8 @@ /* rule is permanent, and cannot be deleted */ #define FIB_RULE_PERMANENT 1 #define FIB_RULE_INVERT2 +#define FIB_RULE_UNRESOLVED4 +#define FIB_RULE_DEV_DETACHED 8 struct fib_rule_hdr { @@ -29,7 +31,7 @@ enum FRA_DST,/* destination address */ FRA_SRC,/* source address */ FRA_IFNAME, /* interface name */ - FRA_UNUSED1, + FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */ FRA_UNUSED2, FRA_PRIORITY, /* priority/preference */ FRA_UNUSED3, @@ -51,8 +53,8 @@ enum { FR_ACT_UNSPEC, FR_ACT_TO_TBL, /* Pass to fixed table */ - FR_ACT_RES1, - FR_ACT_RES2, + FR_ACT_GOTO,/* Jump to another rule */ + FR_ACT_NOP, /* No operation */ FR_ACT_RES3, FR_ACT_RES4, FR_ACT_BLACKHOLE, /* Drop without notification */ Index: iproute2.git/ip/iprule.c === --- iproute2.git.orig/ip/iprule.c 2007-03-25 22:25:28.0 +0200 +++ iproute2.git/ip/iprule.c2007-03-27 02:00:48.0 +0200 @@ -42,6 +42,7 @@ static void usage(void) fprintf(stderr, "ACTION := [ table TABLE_ID ]\n"); fprintf(stderr, " [ prohibit | reject | unreachable ]\n"); fprintf(stderr, " [ realms [SRCREALM/]DSTREALM ]\n"); + fprintf(stderr, " [ goto NUMBER ]\n"); fprintf(stderr, "TABLE_ID := [ local | main | default | NUMBER ]\n"); exit(-1); } @@ -144,6 +145,8 @@ int print_rule(const struct sockaddr_nl if (tb[RTA_IIF]) { fprintf(fp, "iif %s ", (char*)RTA_DATA(tb[RTA_IIF])); + if (r->rtm_flags & FIB_RULE_DEV_DETACHED) + fprintf(fp, "[detached] "); } table = rtm_get_table(r, tb); @@ -171,7 +174,17 @@ int print_rule(const struct sockaddr_nl abuf, sizeof(abuf))); } else fprintf(fp, "masquerade"); - } else if (r->rtm_type != RTN_UNICAST) + } else if (r->rtm_type == FR_ACT_GOTO) { + fprintf(fp, "goto "); + if (tb[FRA_GOTO]) + fprintf(fp, "%u", *(__u32 *) RTA_DATA(tb[FRA_GOTO])); + else + fprintf(fp, "none"); + if (r->rtm_flags & FIB_RULE_UNRESOLVED) + fprintf(fp, " [unresolved]"); + } else if (r->rtm_type == FR_ACT_NOP) + fprintf(fp, "nop"); + else if (r->rtm_type != RTN_UNICAST) fprintf(fp, "%s", rtnl_rtntype_n2a(r->rtm_type, b1, sizeof(b1))); fprintf(fp, "\n"); @@ -311,9 +324,19 @@ static int iprule_modify(int cmd, int ar } if (matches(*argv, "help") == 0) usage(); - if (rtnl_rtntype_a2n(&type, *argv)) + else if (matches(*argv, "goto") == 0) { + __u32 target; + type = FR_ACT_GOTO; + NEXT_ARG(); + if (get_u32(&target, *argv, 0)) + invarg("invalid target\n", *argv); + addattr32(&req.n, sizeof(req), FRA_GOTO, target); + } else if (matches(*argv, "nop") == 0) + type = FR_ACT_NOP; + else if (rtnl_rtntype_a2n(&type, *argv)) invarg("Failed to parse rule type", *argv); req.r.rtm_type = type; + table_ok = 1; } argc--; argv++; - 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/3] [NET] fib_rules: Add no-operation action
The use of nop rules simplifies the usage of goto rules and adds more flexibility as they allow targets to remain while the actual content of the branches can change easly. Signed-off-by: Thomas Graf <[EMAIL PROTECTED]> Index: net-2.6.22/include/linux/fib_rules.h === --- net-2.6.22.orig/include/linux/fib_rules.h 2007-03-27 01:45:56.0 +0200 +++ net-2.6.22/include/linux/fib_rules.h2007-03-27 01:46:33.0 +0200 @@ -54,7 +54,7 @@ enum FR_ACT_UNSPEC, FR_ACT_TO_TBL, /* Pass to fixed table */ FR_ACT_GOTO,/* Jump to another rule */ - FR_ACT_RES2, + FR_ACT_NOP, /* No operation */ FR_ACT_RES3, FR_ACT_RES4, FR_ACT_BLACKHOLE, /* Drop without notification */ Index: net-2.6.22/net/core/fib_rules.c === --- net-2.6.22.orig/net/core/fib_rules.c2007-03-27 01:46:22.0 +0200 +++ net-2.6.22/net/core/fib_rules.c 2007-03-27 01:46:33.0 +0200 @@ -146,7 +146,9 @@ jumped: rule = target; goto jumped; } - } else + } else if (rule->action == FR_ACT_NOP) + continue; + else err = ops->action(rule, fl, flags, arg); if (err != -EAGAIN) { -- - 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/3] [NET] fib_rules: Mark rules detached from the device
Rules which match against device names in their selector can remain while the device itself disappears, in fact the device doesn't have to present when the rule is added in the first place. The device name is resolved by trying when the rule is added and later by listening to NETDEV_REGISTER/UNREGISTER notifications. This patch adds the flag FIB_RULE_DEV_DETACHED which is set towards userspace when a rule contains a device match which is unresolved at the moment. This eases spotting the reason why certain rules seem not to function properly. Signed-off-by: Thomas Graf <[EMAIL PROTECTED]> Index: net-2.6.22/include/linux/fib_rules.h === --- net-2.6.22.orig/include/linux/fib_rules.h 2007-03-27 01:43:14.0 +0200 +++ net-2.6.22/include/linux/fib_rules.h2007-03-27 01:45:56.0 +0200 @@ -8,6 +8,7 @@ #define FIB_RULE_PERMANENT 1 #define FIB_RULE_INVERT2 #define FIB_RULE_UNRESOLVED4 +#define FIB_RULE_DEV_DETACHED 8 struct fib_rule_hdr { Index: net-2.6.22/net/core/fib_rules.c === --- net-2.6.22.orig/net/core/fib_rules.c2007-03-27 01:43:39.0 +0200 +++ net-2.6.22/net/core/fib_rules.c 2007-03-27 01:46:22.0 +0200 @@ -450,9 +450,13 @@ static int fib_nl_fill_rule(struct sk_bu if (rule->action == FR_ACT_GOTO && rule->ctarget == NULL) frh->flags |= FIB_RULE_UNRESOLVED; - if (rule->ifname[0]) + if (rule->ifname[0]) { NLA_PUT_STRING(skb, FRA_IFNAME, rule->ifname); + if (rule->ifindex == -1) + frh->flags |= FIB_RULE_DEV_DETACHED; + } + if (rule->pref) NLA_PUT_U32(skb, FRA_PRIORITY, rule->pref); -- - 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/3] [PATCHSET] fib_rules: goto/nop action, flag for detached rules
Patches to the fib rules code, not directly connected, see description of each patch. - 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/3] [NET] fib_rules: goto rule action
This patch adds a new rule action FR_ACT_GOTO which allows to skip a set of rules by jumping to another rule. The rule to jump to is specified via the FRA_GOTO attribute which carries a rule preference. Referring to a rule which doesn't exists is explicitely allowed. Such goto rules are marked with the flag FIB_RULE_UNRESOLVED and will act like a rule with a non-matching selector. The rule will become functional as soon as its target is present. The goto action enables performance optimizations by reducing the average number of rules that have to be passed per lookup. Example: 0: from all lookup local 40: not from all to 192.168.23.128 goto 32766 41: from all fwmark 0xa blackhole 42: from all fwmark 0xff blackhole 32766: from all lookup main Signed-off-by: Thomas Graf <[EMAIL PROTECTED]> Index: net-2.6.22/include/linux/fib_rules.h === --- net-2.6.22.orig/include/linux/fib_rules.h 2007-03-26 13:07:41.0 +0200 +++ net-2.6.22/include/linux/fib_rules.h2007-03-27 01:43:14.0 +0200 @@ -7,6 +7,7 @@ /* rule is permanent, and cannot be deleted */ #define FIB_RULE_PERMANENT 1 #define FIB_RULE_INVERT2 +#define FIB_RULE_UNRESOLVED4 struct fib_rule_hdr { @@ -29,7 +30,7 @@ enum FRA_DST,/* destination address */ FRA_SRC,/* source address */ FRA_IFNAME, /* interface name */ - FRA_UNUSED1, + FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */ FRA_UNUSED2, FRA_PRIORITY, /* priority/preference */ FRA_UNUSED3, @@ -51,7 +52,7 @@ enum { FR_ACT_UNSPEC, FR_ACT_TO_TBL, /* Pass to fixed table */ - FR_ACT_RES1, + FR_ACT_GOTO,/* Jump to another rule */ FR_ACT_RES2, FR_ACT_RES3, FR_ACT_RES4, Index: net-2.6.22/include/net/fib_rules.h === --- net-2.6.22.orig/include/net/fib_rules.h 2007-03-26 13:07:41.0 +0200 +++ net-2.6.22/include/net/fib_rules.h 2007-03-26 13:40:32.0 +0200 @@ -19,6 +19,8 @@ struct fib_rule u32 flags; u32 table; u8 action; + u32 target; + struct fib_rule * ctarget; struct rcu_head rcu; }; @@ -35,6 +37,8 @@ struct fib_rules_ops struct list_headlist; int rule_size; int addr_size; + int unresolved_rules; + int nr_goto_rules; int (*action)(struct fib_rule *, struct flowi *, int, @@ -66,7 +70,8 @@ struct fib_rules_ops [FRA_PRIORITY] = { .type = NLA_U32 }, \ [FRA_FWMARK]= { .type = NLA_U32 }, \ [FRA_FWMASK]= { .type = NLA_U32 }, \ - [FRA_TABLE] = { .type = NLA_U32 } + [FRA_TABLE] = { .type = NLA_U32 }, \ + [FRA_GOTO] = { .type = NLA_U32 } static inline void fib_rule_get(struct fib_rule *rule) { Index: net-2.6.22/net/core/fib_rules.c === --- net-2.6.22.orig/net/core/fib_rules.c2007-03-26 13:07:41.0 +0200 +++ net-2.6.22/net/core/fib_rules.c 2007-03-27 01:43:39.0 +0200 @@ -132,10 +132,23 @@ int fib_rules_lookup(struct fib_rules_op rcu_read_lock(); list_for_each_entry_rcu(rule, ops->rules_list, list) { +jumped: if (!fib_rule_match(rule, ops, fl, flags)) continue; - err = ops->action(rule, fl, flags, arg); + if (rule->action == FR_ACT_GOTO) { + struct fib_rule *target; + + target = rcu_dereference(rule->ctarget); + if (target == NULL) { + continue; + } else { + rule = target; + goto jumped; + } + } else + err = ops->action(rule, fl, flags, arg); + if (err != -EAGAIN) { fib_rule_get(rule); arg->rule = rule; @@ -180,7 +193,7 @@ static int fib_nl_newrule(struct sk_buff struct fib_rules_ops *ops = NULL; struct fib_rule *rule, *r, *last = NULL; struct nlattr *tb[FRA_MAX+1]; - int err = -EINVAL; + int err = -EINVAL, unresolved = 0; if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*frh))) goto errout; @@ -237,6 +250,28 @@ static int fib_nl_newrule(struct sk_buff if (!rule->pref && ops->default_pref) rule->pref = ops->default_pref(); + err = -EINVAL; + if (tb[FRA_GOTO]) { + if (r
Re: [PATCH/RFC] e1000: Check for hw type before enabling ipv6 TSO
Sridhar Samudrala wrote: I think the check for hw type is missing in e1000_set_tso() before enabling ipv6 TSO. e1000_probe() makes sure that NETIF_F_TSO6 is set only if hw.mac_type > e1000_82547_rev_2. But this is not done in e1000_set_tso() that gets called when trying to enable TSO using ethtool. I noticed this problem when i tried to do an ipv6 netperf test with TSO enabled on 82541 based e1000 card. The following patch adds this check to e1000_set_tso() that looks indeed like an oversight. I'll make sure this is verified and will include this patch in my upstream submission to the kernel maintainer if it checks out, thanks for posting! Auke Thanks Sridhar Signed-off-by: Sridhar Samudrala <[EMAIL PROTECTED]> diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c --- a/drivers/net/e1000/e1000_ethtool.c +++ b/drivers/net/e1000/e1000_ethtool.c @@ -351,10 +351,12 @@ e1000_set_tso(struct net_device *netdev, uint32_t data) else netdev->features &= ~NETIF_F_TSO; - if (data) - netdev->features |= NETIF_F_TSO6; - else - netdev->features &= ~NETIF_F_TSO6; + if (adapter->hw.mac_type > e1000_82547_rev_2) { + if (data) + netdev->features |= NETIF_F_TSO6; + else + netdev->features &= ~NETIF_F_TSO6; + } DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled"); adapter->tso_force = TRUE; - 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]: SAD sometimes has double SAs.
On Mon, 2007-03-26 at 17:34 -0400, Eric Paris wrote: > On Fri, 2007-03-23 at 16:58 -0600, Joy Latten wrote: > > > @@ -710,11 +713,20 @@ static struct xfrm_state *__find_acq_cor > > > > switch (family) { > > case AF_INET: > > + if (x->id.daddr.a4 == saddr->a4 && > > + x->props.saddr.a4 == daddr->a4) > > + track_opposite = 1; > > if (x->id.daddr.a4!= daddr->a4 || > > x->props.saddr.a4 != saddr->a4) > > continue; > > break; > > case AF_INET6: > > + if (ipv6_addr_equal((struct in6_addr *)x->id.daddr.a6, > > +(struct in6_addr *)saddr) || > > + ipv6_addr_equal((struct in6_addr *) > > +x->props.saddr.a6, > > +(struct in6_addr *)daddr)) > > + track_opposite = 1; > > if (!ipv6_addr_equal((struct in6_addr *)x->id.daddr.a6, > > (struct in6_addr *)daddr) || > > !ipv6_addr_equal((struct in6_addr *) > > I'm not at all able to speak on the correctness or validity of the > solution, but shouldn't the ipv6 case be a && not an || like the ipv4 > case? Isn't this going to match all sorts of things? Did you test this > patch on ipv6 and see it to solve your problem? > Will fix this and resend. Sorry, forgot about ipv6. My mistake! :-( > I'm also not enjoying the formatting in the ipv6 part where the first > time you have the cast on the same time as the object but not the second > part where x->props.saddr.a6 is on its own little line. > ok. Joy - 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]: Add security check before flushing SAD/SPD
Sending again since one of the email addresses was incorrect. Ok, I have made improvements based on James' and Eric's comments. Regards, Joy Signed-off-by: Joy Latten<[EMAIL PROTECTED]> diff -urpN linux-2.6.20.orig/include/net/xfrm.h linux-2.6.20.patch/include/net/xfrm.h --- linux-2.6.20.orig/include/net/xfrm.h2007-03-23 11:01:48.0 -0500 +++ linux-2.6.20.patch/include/net/xfrm.h 2007-03-25 21:36:05.0 -0500 @@ -937,7 +937,7 @@ static inline int xfrm_state_sort(struct #endif extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); extern int xfrm_state_delete(struct xfrm_state *x); -extern void xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info); +extern int xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info); extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq); extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq); extern void xfrm_replay_notify(struct xfrm_state *x, int event); @@ -991,13 +991,13 @@ struct xfrm_policy *xfrm_policy_bysel_ct struct xfrm_sec_ctx *ctx, int delete, int *err); struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete, int *err); -void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); +int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); u32 xfrm_get_acqseq(void); void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi); struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, xfrm_address_t *daddr, xfrm_address_t *saddr, int create, unsigned short family); -extern void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); +extern int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst, struct flowi *fl, int family, int strict); diff -urpN linux-2.6.20.orig/net/key/af_key.c linux-2.6.20.patch/net/key/af_key.c --- linux-2.6.20.orig/net/key/af_key.c 2007-03-23 11:02:49.0 -0500 +++ linux-2.6.20.patch/net/key/af_key.c 2007-03-25 21:34:35.0 -0500 @@ -1645,6 +1645,7 @@ static int pfkey_flush(struct sock *sk, unsigned proto; struct km_event c; struct xfrm_audit audit_info; + int err; proto = pfkey_satype2proto(hdr->sadb_msg_satype); if (proto == 0) @@ -1652,7 +1653,9 @@ static int pfkey_flush(struct sock *sk, audit_info.loginuid = audit_get_loginuid(current->audit_context); audit_info.secid = 0; - xfrm_state_flush(proto, &audit_info); + err = xfrm_state_flush(proto, &audit_info); + if (err) + return err; c.data.proto = proto; c.seq = hdr->sadb_msg_seq; c.pid = hdr->sadb_msg_pid; @@ -2628,10 +2631,13 @@ static int pfkey_spdflush(struct sock *s { struct km_event c; struct xfrm_audit audit_info; + int err; audit_info.loginuid = audit_get_loginuid(current->audit_context); audit_info.secid = 0; - xfrm_policy_flush(XFRM_POLICY_TYPE_MAIN, &audit_info); + err = xfrm_policy_flush(XFRM_POLICY_TYPE_MAIN, &audit_info); + if (err) + return err; c.data.type = XFRM_POLICY_TYPE_MAIN; c.event = XFRM_MSG_FLUSHPOLICY; c.pid = hdr->sadb_msg_pid; diff -urpN linux-2.6.20.orig/net/xfrm/xfrm_policy.c linux-2.6.20.patch/net/xfrm/xfrm_policy.c --- linux-2.6.20.orig/net/xfrm/xfrm_policy.c2007-03-23 11:02:46.0 -0500 +++ linux-2.6.20.patch/net/xfrm/xfrm_policy.c 2007-03-26 17:19:26.0 -0500 @@ -813,11 +813,67 @@ struct xfrm_policy *xfrm_policy_byid(u8 } EXPORT_SYMBOL(xfrm_policy_byid); -void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info) +#ifdef CONFIG_SECURITY_NETWORK_XFRM +static inline int +xfrm_policy_flush_secctx_check(u8 type, struct xfrm_audit *audit_info) { - int dir; + int dir, err = 0; + + for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { + struct xfrm_policy *pol; + struct hlist_node *entry; + int i; + + hlist_for_each_entry(pol, entry, +&xfrm_policy_inexact[dir], bydst) { + if (pol->type != type) + continue; + err = security_xfrm_policy_delete(pol); + if (err) { + xfrm_audit_log(audit_info->loginuid, + audit_info->secid, + AUDIT_MAC_IPSEC_DELSPD, 0, + pol, NULL); + return err; + } +} + for (i =
Re: [PATCH] NET: Remove dead net/sched/Makefile entry for sch_hpfq.o.
From: "Robert P. J. Day" <[EMAIL PROTECTED]> Date: Mon, 26 Mar 2007 19:10:03 -0400 (EDT) > > Remove the worthless net/sched/Makefile entry for the non-existent > source file sch_hpfq.c. > > Signed-off-by: Robert P. J. Day <[EMAIL PROTECTED]> Applied, thanks Robert. I wonder how cruft like this is able to live for so long :-) - 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] e1000: Check for hw type before enabling ipv6 TSO
I think the check for hw type is missing in e1000_set_tso() before enabling ipv6 TSO. e1000_probe() makes sure that NETIF_F_TSO6 is set only if hw.mac_type > e1000_82547_rev_2. But this is not done in e1000_set_tso() that gets called when trying to enable TSO using ethtool. I noticed this problem when i tried to do an ipv6 netperf test with TSO enabled on 82541 based e1000 card. The following patch adds this check to e1000_set_tso() Thanks Sridhar Signed-off-by: Sridhar Samudrala <[EMAIL PROTECTED]> diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c --- a/drivers/net/e1000/e1000_ethtool.c +++ b/drivers/net/e1000/e1000_ethtool.c @@ -351,10 +351,12 @@ e1000_set_tso(struct net_device *netdev, uint32_t data) else netdev->features &= ~NETIF_F_TSO; - if (data) - netdev->features |= NETIF_F_TSO6; - else - netdev->features &= ~NETIF_F_TSO6; + if (adapter->hw.mac_type > e1000_82547_rev_2) { + if (data) + netdev->features |= NETIF_F_TSO6; + else + netdev->features &= ~NETIF_F_TSO6; + } DPRINTK(PROBE, INFO, "TSO is %s\n", data ? "Enabled" : "Disabled"); adapter->tso_force = TRUE; - 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] NET: Remove dead net/sched/Makefile entry for sch_hpfq.o.
Remove the worthless net/sched/Makefile entry for the non-existent source file sch_hpfq.c. Signed-off-by: Robert P. J. Day <[EMAIL PROTECTED]> --- diff --git a/net/sched/Makefile b/net/sched/Makefile index ff2d6e5..020767a 100644 --- a/net/sched/Makefile +++ b/net/sched/Makefile @@ -17,7 +17,6 @@ obj-$(CONFIG_NET_ACT_SIMP)+= act_simple.o obj-$(CONFIG_NET_SCH_FIFO) += sch_fifo.o obj-$(CONFIG_NET_SCH_CBQ) += sch_cbq.o obj-$(CONFIG_NET_SCH_HTB) += sch_htb.o -obj-$(CONFIG_NET_SCH_HPFQ) += sch_hpfq.o obj-$(CONFIG_NET_SCH_HFSC) += sch_hfsc.o obj-$(CONFIG_NET_SCH_RED) += sch_red.o obj-$(CONFIG_NET_SCH_GRED) += sch_gred.o -- Robert P. J. Day Linux Consulting, Training and Annoying Kernel Pedantry Waterloo, Ontario, CANADA http://fsdev.net/wiki/index.php?title=Main_Page - 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]: Add security check before flushing SAD/SPD
I have made improvements based on James' and Eric's comments. Regards, Joy Signed-off-by: Joy Latten<[EMAIL PROTECTED]> diff -urpN linux-2.6.20.orig/include/net/xfrm.h linux-2.6.20.patch/include/net/xfrm.h --- linux-2.6.20.orig/include/net/xfrm.h2007-03-23 11:01:48.0 -0500 +++ linux-2.6.20.patch/include/net/xfrm.h 2007-03-25 21:36:05.0 -0500 @@ -937,7 +937,7 @@ static inline int xfrm_state_sort(struct #endif extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); extern int xfrm_state_delete(struct xfrm_state *x); -extern void xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info); +extern int xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info); extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq); extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq); extern void xfrm_replay_notify(struct xfrm_state *x, int event); @@ -991,13 +991,13 @@ struct xfrm_policy *xfrm_policy_bysel_ct struct xfrm_sec_ctx *ctx, int delete, int *err); struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete, int *err); -void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); +int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); u32 xfrm_get_acqseq(void); void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi); struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, xfrm_address_t *daddr, xfrm_address_t *saddr, int create, unsigned short family); -extern void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); +extern int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst, struct flowi *fl, int family, int strict); diff -urpN linux-2.6.20.orig/net/key/af_key.c linux-2.6.20.patch/net/key/af_key.c --- linux-2.6.20.orig/net/key/af_key.c 2007-03-23 11:02:49.0 -0500 +++ linux-2.6.20.patch/net/key/af_key.c 2007-03-25 21:34:35.0 -0500 @@ -1645,6 +1645,7 @@ static int pfkey_flush(struct sock *sk, unsigned proto; struct km_event c; struct xfrm_audit audit_info; + int err; proto = pfkey_satype2proto(hdr->sadb_msg_satype); if (proto == 0) @@ -1652,7 +1653,9 @@ static int pfkey_flush(struct sock *sk, audit_info.loginuid = audit_get_loginuid(current->audit_context); audit_info.secid = 0; - xfrm_state_flush(proto, &audit_info); + err = xfrm_state_flush(proto, &audit_info); + if (err) + return err; c.data.proto = proto; c.seq = hdr->sadb_msg_seq; c.pid = hdr->sadb_msg_pid; @@ -2628,10 +2631,13 @@ static int pfkey_spdflush(struct sock *s { struct km_event c; struct xfrm_audit audit_info; + int err; audit_info.loginuid = audit_get_loginuid(current->audit_context); audit_info.secid = 0; - xfrm_policy_flush(XFRM_POLICY_TYPE_MAIN, &audit_info); + err = xfrm_policy_flush(XFRM_POLICY_TYPE_MAIN, &audit_info); + if (err) + return err; c.data.type = XFRM_POLICY_TYPE_MAIN; c.event = XFRM_MSG_FLUSHPOLICY; c.pid = hdr->sadb_msg_pid; diff -urpN linux-2.6.20.orig/net/xfrm/xfrm_policy.c linux-2.6.20.patch/net/xfrm/xfrm_policy.c --- linux-2.6.20.orig/net/xfrm/xfrm_policy.c2007-03-23 11:02:46.0 -0500 +++ linux-2.6.20.patch/net/xfrm/xfrm_policy.c 2007-03-26 17:19:26.0 -0500 @@ -813,11 +813,67 @@ struct xfrm_policy *xfrm_policy_byid(u8 } EXPORT_SYMBOL(xfrm_policy_byid); -void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info) +#ifdef CONFIG_SECURITY_NETWORK_XFRM +static inline int +xfrm_policy_flush_secctx_check(u8 type, struct xfrm_audit *audit_info) { - int dir; + int dir, err = 0; + + for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { + struct xfrm_policy *pol; + struct hlist_node *entry; + int i; + + hlist_for_each_entry(pol, entry, +&xfrm_policy_inexact[dir], bydst) { + if (pol->type != type) + continue; + err = security_xfrm_policy_delete(pol); + if (err) { + xfrm_audit_log(audit_info->loginuid, + audit_info->secid, + AUDIT_MAC_IPSEC_DELSPD, 0, + pol, NULL); + return err; + } +} + for (i = xfrm_policy_bydst[dir].hmask; i >= 0; i--) { + hlist_for_each_e
Re: [PATCH]: SAD sometimes has double SAs.
From: Eric Paris <[EMAIL PROTECTED]> Date: Mon, 26 Mar 2007 17:34:59 -0400 > I'm not at all able to speak on the correctness or validity of the > solution, Neither am I yet :) > but shouldn't the ipv6 case be a && not an || like the ipv4 > case? Isn't this going to match all sorts of things? Did you test this > patch on ipv6 and see it to solve your problem? > > I'm also not enjoying the formatting in the ipv6 part where the first > time you have the cast on the same time as the object but not the second > part where x->props.saddr.a6 is on its own little line. Also, I want to understand what is going to tear down these "other direction" fake entries later on? I think I can review this patch better if I understand that. As it stands, this looks to me like a workaround for an improperly implemented IPSEC daemon. Joy states it as saying that the current code requires the keying daemon to manage it's SAs, and I wonder whether any other implementation is even valid. There is a limit to the amount to which we can workaround racoon's design issues. :-) - 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 PATCHv5 1/5] [TCP]: Add highest_sack seqno, points to globally highest SACK
On Sun, 25 Mar 2007, David Miller wrote: > From: "Ilpo_Järvinen" <[EMAIL PROTECTED]> > Date: Mon, 26 Mar 2007 00:55:57 +0300 (EEST) > > > On Sat, 24 Mar 2007, David Miller wrote: > > > > > From: "Ilpo_Järvinen" <[EMAIL PROTECTED]> > > > > > > > It is guaranteed to be valid only when !tp->sacked_out. In most > > > > cases this seqno is available in the last ACK but there is no > > > > guarantee for that. The new fast recovery loss marking algorithm > > > > needs this as entry point. > > > > > > It's a shame we keep around multiple values which represent very > > > related values. For example, this new seqno could be computed > > > using "fackets_out" if we knew also how many holes there were. > > > > It would then be an estimate which is 100% accurate in most cases (when > > all related skbs are full sized). I think it must never underestimate > > highest_sack though, it would be quite ok to use fackets_out * mss but > > any > mss skb would obviously be a problem (if they ever occur)... > > Are all paths ok with that (this is beoynd the codepaths I'm quite > > sure of...)?! I was being overly broad here, of course these happen with gso, but the point was to say if skb's pcount * current mss < size of the skb, using fackets_count to estimate highest sack is problematic... At least path MTU discovery comes to my mind as a potential problematic case since it's playing with sizing but as I said, I'm not sure if it is bad after all... > Right, I understand that we really can't even use such an estimate > because of the "full mss size" assumption. Are you sure of this "can't"? I think the LOST marking algorithm can safely be used if highest_sack is never underestimated... As long as the search begins at or a point after the real highest_sack, the highest SACK block can be located by walking until the first SACKED_ACKED is found or TCP encounters a LOST skb (due to an earlier timedout). Overestimating just means some extra backwards walking in the queue (and couple lines of code :-))... Of course care should be taken that the walk is never started from a sequence number that is after send_head... Also, if I understand your queue_find code correctly, the case where send_head is pointing to nothing (TCP cannot check it's seqno :-)) and we overestimated, the find would return NULL. In such case, instead of doing queue_find, a correct thing would be to start from the last skb I think... -- i.
Re: [PATCH]: SAD sometimes has double SAs.
On Fri, 2007-03-23 at 16:58 -0600, Joy Latten wrote: > @@ -710,11 +713,20 @@ static struct xfrm_state *__find_acq_cor > > switch (family) { > case AF_INET: > + if (x->id.daddr.a4 == saddr->a4 && > + x->props.saddr.a4 == daddr->a4) > + track_opposite = 1; > if (x->id.daddr.a4!= daddr->a4 || > x->props.saddr.a4 != saddr->a4) > continue; > break; > case AF_INET6: > + if (ipv6_addr_equal((struct in6_addr *)x->id.daddr.a6, > + (struct in6_addr *)saddr) || > + ipv6_addr_equal((struct in6_addr *) > + x->props.saddr.a6, > + (struct in6_addr *)daddr)) > + track_opposite = 1; > if (!ipv6_addr_equal((struct in6_addr *)x->id.daddr.a6, >(struct in6_addr *)daddr) || > !ipv6_addr_equal((struct in6_addr *) I'm not at all able to speak on the correctness or validity of the solution, but shouldn't the ipv6 case be a && not an || like the ipv4 case? Isn't this going to match all sorts of things? Did you test this patch on ipv6 and see it to solve your problem? I'm also not enjoying the formatting in the ipv6 part where the first time you have the cast on the same time as the object but not the second part where x->props.saddr.a6 is on its own little line. -Eric - 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] NAPI support for Sibyte MAC
Hello, > -Original Message- > From: Sergei Shtylyov [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 24, 2007 12:49 PM > To: Mark E Mason > Cc: [EMAIL PROTECTED]; netdev@vger.kernel.org > Subject: Re: [PATCH] NAPI support for Sibyte MAC [snip] > > @@ -2075,12 +2143,52 @@ > > */ > > > > if (isr & (M_MAC_INT_CHANNEL << S_MAC_TX_CH0)) { > > - sbdma_tx_process(sc,&(sc->sbm_txdma)); > > + sbdma_tx_process(sc,&(sc->sbm_txdma), 0); > > +#ifdef CONFIG_NETPOLL_TRAP > > + if (netpoll_trap()) { > > + if > (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state)) > > + __netif_schedule(dev); > > + } > > +#endif > > } > > This just doesn't make sense. That option is enabled to > *prevent* calls to > __netif_schedule() -- you can't override it that way. (Well, > how it works > currently, doesn't make much sense either since it totally > breaks the TX queue > control -- I was going to post a patch). I'll admit - this was just copied over from the non-NAPI version we started with ;-). Are you saying that the #ifdef test should simply be an #ifndef here? [I'm working on a revised patch based on feedback from Ralf and others which removes the Kconfig option for NAPI - it'll just be on, all the time.] Thanks, Mark - 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] net: tun/tap: fixed hw address handling
Brian Braunstein wrote: > > From: Brian Braunstein <[EMAIL PROTECTED]> > > Fixed tun/tap driver's handling of hw addresses. The hw address is > stored in > both the net_device.dev_addr and tun.dev_addr fields. These fields were > not > kept synchronized, and in fact weren't even initialized to the same value. > Now during both init and when performing SIOCSIFHWADDR on the tun device > these values are both updated. However, if SIOCSIFHWADDR is performed > on the > net device directly (for instance, setting the hw address using ifconfig), > the tun device does not get updated. Perhaps the tun.dev_addr field should > be removed completely at some point, as it is redundant and > net_device.dev_addr can be used anywhere it is used. > Signed-off-by: Brian Braunstein <[EMAIL PROTECTED]> > Patch is hopelessly corrupted: missing leading space in context lines converted to four spaces > > --- linux-2.6.20.4-ORIG/drivers/net/tun.c2007-03-23 > 12:52:51.0 -0700 > +++ linux-2.6.20.4/drivers/net/tun.c2007-03-25 00:44:20.0 -0700 > @@ -18,6 +18,10 @@ > /* > * Changes: > * > + * Brian Braunstein <[EMAIL PROTECTED]> 2007/03/23 > + *Fixed hw address handling. Now net_device.dev_addr is kept > consistent > + *with tun.dev_addr when the address is set by this module. > + * > * Mike Kershaw <[EMAIL PROTECTED]> 2005/08/14 > *Add TUNSETLINK ioctl to set the link encapsulation > * > @@ -196,7 +200,10 @@ static void tun_net_init(struct net_devi > dev->set_multicast_list = tun_net_mclist; > > ether_setup(dev); > -random_ether_addr(dev->dev_addr); > + > +/* random address already created for us by tun_set_iff, use it */ > +memcpy(dev->dev_addr, tun->dev_addr, min(sizeof(tun->dev_addr), > sizeof(dev->dev_addr)) ); > + > dev->tx_queue_len = TUN_READQ_SIZE; /* We prefer our own queue > length */ > break; > } > @@ -636,6 +643,7 @@ static int tun_chr_ioctl(struct inode *i > return 0; > > case SIOCGIFHWADDR: > +/* Note: the actual net device's address may be different */ > memcpy(ifr.ifr_hwaddr.sa_data, tun->dev_addr, > min(sizeof ifr.ifr_hwaddr.sa_data, sizeof tun->dev_addr)); > if (copy_to_user( argp, &ifr, sizeof ifr)) > @@ -643,16 +651,24 @@ static int tun_chr_ioctl(struct inode *i > return 0; > > case SIOCSIFHWADDR: > -/** Set the character device's hardware address. This is used when > - * filtering packets being sent from the network device to the > character > - * device. */ > -memcpy(tun->dev_addr, ifr.ifr_hwaddr.sa_data, > -min(sizeof ifr.ifr_hwaddr.sa_data, sizeof tun->dev_addr)); > -DBG(KERN_DEBUG "%s: set hardware address: %x:%x:%x:%x:%x:%x\n", > -tun->dev->name, > -tun->dev_addr[0], tun->dev_addr[1], tun->dev_addr[2], > -tun->dev_addr[3], tun->dev_addr[4], tun->dev_addr[5]); > -return 0; > +{ > +/* try to set the actual net device's hw address */ > +int ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr); > + > +if (ret == 0) { > +/** Set the character device's hardware address. This is > used when > + * filtering packets being sent from the network device to > the character > + * device. */ > +memcpy(tun->dev_addr, ifr.ifr_hwaddr.sa_data, > +min(sizeof ifr.ifr_hwaddr.sa_data, sizeof > tun->dev_addr)); > +DBG(KERN_DEBUG "%s: set hardware address: > %x:%x:%x:%x:%x:%x\n", > +tun->dev->name, > +tun->dev_addr[0], tun->dev_addr[1], tun->dev_addr[2], > +tun->dev_addr[3], tun->dev_addr[4], tun->dev_addr[5]); > +} > + > +return ret; > +} > > case SIOCADDMULTI: > /** Add the specified group to the character device's multicast > filter > - 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] fib_hash removal
From: Robert Olsson <[EMAIL PROTECTED]> Date: Mon, 26 Mar 2007 11:29:04 +0200 > Paul E. McKenney writes: > > > Those of use who dive into networking only occasionally would much > > appreciate this. ;-) > > No problem here... > > Cheers > --ro > > Acked-by: Robert Olsson <[EMAIL PROTECTED]> > Signed-off-by: Paul E. McKenney <[EMAIL PROTECTED]> (but trivial) Applied, thanks. - 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] Correct accept(2) recovery after sock_attach_fd()
From: Alexey Dobriyan <[EMAIL PROTECTED]> Date: Mon, 26 Mar 2007 19:34:31 +0400 > * d_alloc() in sock_attach_fd() fails leaving ->f_dentry of new file NULL > * bail out to out_fd label, doing fput()/__fput() on new file > * but __fput() assumes valid ->f_dentry and dereferences it > > Signed-off-by: Alexey Dobriyan <[EMAIL PROTECTED]> Thanks for this bug fix Alexey, patch applied. - 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] net: tun/tap: fixed hw address handling
On Mon, Mar 26, 2007 at 10:55:11PM +0200, ahmed wrote: > On Sun, Mar 25, 2007 at 01:29:29AM -0700, Brian Braunstein wrote: > > --- linux-2.6.20.4-ORIG/drivers/net/tun.c 2007-03-23 > > 12:52:51.0 -0700 > > +++ linux-2.6.20.4/drivers/net/tun.c2007-03-25 00:44:20.0 > > -0700 > > @@ -18,6 +18,10 @@ > > /* > > * Changes: > > * > > + * Brian Braunstein <[EMAIL PROTECTED]> 2007/03/23 > > + *Fixed hw address handling. Now net_device.dev_addr is kept > > consistent > > Your mailer still wrap the long lines mistakenly as it did in the first > version of the patch. > It seems a bug in my mutt mail reader (not a feature, it displays other mails long lines without wrapping), sorry. -- Ahmed S. Darwish http://darwish.07.googlepages.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
Problem with sockets an 2.6.21-rc5 kernel
I had two python programs, server.py and client.py(attached) With server.py in a kernel 2.6.21-rc5 x86_64 and client.py in the same machine, server.py get the message. With server.py in a kerner 2.6.21-rc5 x86_64 and client.py in another machine, server.py don't get the message. The same with the programs in c(attached). With kernel 2.6.20.3 the programs work well. There are something wrong in the programs? Thanks. Jose Alberto client.py Description: application/python #include #include #include main() { int sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); struct sockaddr_in ClientAddr; memset(&ClientAddr, 0, sizeof(ClientAddr)); ClientAddr.sin_family = AF_INET; ClientAddr.sin_addr.s_addr = inet_addr("227.234.253.9"); int port = 15922; ClientAddr.sin_port = htons((short) port); char str[] = "Hello, world"; sendto(sock, str, strlen(str), 0, (struct sockaddr *)&ClientAddr, sizeof(ClientAddr)); close(sock); } #include #include #include #include #include main() { struct sockaddr_in ServerAddr; int sock = socket (AF_INET, SOCK_DGRAM, IPPROTO_UDP); int reuse = 1; setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(int)); memset(&ServerAddr, 0, sizeof(ServerAddr)); ServerAddr.sin_family = AF_INET; ServerAddr.sin_addr.s_addr = htonl(INADDR_ANY); int port = 15922; ServerAddr.sin_port = htons((short) port); bind(sock, (struct sockaddr *)&ServerAddr, sizeof(ServerAddr)); struct ip_mreq mreq; memset(&mreq, 0, sizeof(mreq)); mreq.imr_multiaddr.s_addr = inet_addr("227.234.253.9"); mreq.imr_interface.s_addr = htonl(INADDR_ANY); setsockopt(sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)); char str[100]; memset(&str, 0, sizeof(str)); recv(sock, str, 100, 0); printf(":%s:\n", str); close (sock); } server.py Description: application/python
Re: [PATCH 7/7] qla3xxx: Bumping driver version number to v2.03.00-k4
The zeroeth patch was visable on my browser, but the seven patches didn't show up. I thought there was a problem with sendmail so turned debug on and retried. Forget the second set as they are identical patches. On Mon, Mar 26, 2007 at 01:47:30PM -0700, Andrew Vasquez wrote: > BTW: this patchset was sent twice to netdev. - 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] net: tun/tap: fixed hw address handling
On Sun, Mar 25, 2007 at 01:29:29AM -0700, Brian Braunstein wrote: > > From: Brian Braunstein <[EMAIL PROTECTED]> > No need for this line. This line is used when you _forward_ another patch from others. Signed-off-by is enough > > Signed-off-by: Brian Braunstein <[EMAIL PROTECTED]> > > --- > > Kernel Version: 2.6.20.4 > It's always better to generate the patch against the latest -rc kernel. > --- linux-2.6.20.4-ORIG/drivers/net/tun.c 2007-03-23 > 12:52:51.0 -0700 > +++ linux-2.6.20.4/drivers/net/tun.c 2007-03-25 00:44:20.0 -0700 > @@ -18,6 +18,10 @@ > /* > * Changes: > * > + * Brian Braunstein <[EMAIL PROTECTED]> 2007/03/23 > + *Fixed hw address handling. Now net_device.dev_addr is kept > consistent Your mailer still wrap the long lines mistakenly as it did in the first version of the patch. Regards, -- Ahmed S. Darwish http://darwish.07.googlepages.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: [PATCH 7/7] qla3xxx: Bumping driver version number to v2.03.00-k4
BTW: this patchset was sent twice to netdev. - 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] qla3xxx: bugfix: Jumbo frame handling.
Fixed rx checksum bits. Turn on TCP processing for rx checksum. Fixed max frame length register write. It wasn't getting set in multi-port system. Set rx buffer queue length properly for jumbo frames. Signed-off-by: Ron Mercer <[EMAIL PROTECTED]> --- drivers/net/qla3xxx.c | 29 +++-- drivers/net/qla3xxx.h |3 +-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 24c485e..9947a8d 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -1933,17 +1933,18 @@ static void ql_process_macip_rx_intr(struct ql3_adapter *qdev, u16 checksum = le16_to_cpu(ib_ip_rsp_ptr->checksum); if (checksum & (IB_IP_IOCB_RSP_3032_ICE | -IB_IP_IOCB_RSP_3032_CE | -IB_IP_IOCB_RSP_3032_NUC)) { +IB_IP_IOCB_RSP_3032_CE)) { printk(KERN_ERR "%s: Bad checksum for this %s packet, checksum = %x.\n", __func__, ((checksum & IB_IP_IOCB_RSP_3032_TCP) ? "TCP" : "UDP"),checksum); - } else if (checksum & IB_IP_IOCB_RSP_3032_TCP) { + } else if ((checksum & IB_IP_IOCB_RSP_3032_TCP) || + (checksum & IB_IP_IOCB_RSP_3032_UDP && + !(checksum & IB_IP_IOCB_RSP_3032_NUC))) { skb2->ip_summed = CHECKSUM_UNNECESSARY; - } + } } skb2->dev = qdev->ndev; skb2->protocol = eth_type_trans(skb2, qdev->ndev); @@ -3039,15 +3040,6 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) goto out; } - if (qdev->mac_index) - ql_write_page0_reg(qdev, - &port_regs->mac1MaxFrameLengthReg, - qdev->max_frame_size); - else - ql_write_page0_reg(qdev, - &port_regs->mac0MaxFrameLengthReg, - qdev->max_frame_size); - value = qdev->nvram_data.tcpMaxWindowSize; ql_write_page0_reg(qdev, &port_regs->tcpMaxWindow, value); @@ -3067,6 +3059,14 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) ql_sem_unlock(qdev, QL_FLASH_SEM_MASK); } + if (qdev->mac_index) + ql_write_page0_reg(qdev, + &port_regs->mac1MaxFrameLengthReg, + qdev->max_frame_size); + else + ql_write_page0_reg(qdev, + &port_regs->mac0MaxFrameLengthReg, + qdev->max_frame_size); if(ql_sem_spinlock(qdev, QL_PHY_GIO_SEM_MASK, (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) * @@ -3137,7 +3137,8 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) if (qdev->device_id == QL3032_DEVICE_ID) { value = (QL3032_PORT_CONTROL_EF | QL3032_PORT_CONTROL_KIE | -QL3032_PORT_CONTROL_EIv6 | QL3032_PORT_CONTROL_EIv4); +QL3032_PORT_CONTROL_EIv6 | QL3032_PORT_CONTROL_EIv4 | + QL3032_PORT_CONTROL_ET); ql_write_page0_reg(qdev, &port_regs->functionControl, ((value << 16) | value)); } else { diff --git a/drivers/net/qla3xxx.h b/drivers/net/qla3xxx.h index 34cd658..0203f88 100755 --- a/drivers/net/qla3xxx.h +++ b/drivers/net/qla3xxx.h @@ -1014,8 +1014,7 @@ struct eeprom_data { /* Transmit and Receive Buffers */ #define NUM_LBUFQ_ENTRIES 128 -#define JUMBO_NUM_LBUFQ_ENTRIES\ -(NUM_LBUFQ_ENTRIES/(JUMBO_MTU_SIZE/NORMAL_MTU_SIZE)) +#define JUMBO_NUM_LBUFQ_ENTRIES 32 #define NUM_SBUFQ_ENTRIES 64 #define QL_SMALL_BUFFER_SIZE32 #define QL_ADDR_ELE_PER_BUFQ_ENTRY \ -- 1.5.0.rc4.16.g9e258 - 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] qla3xxx: Bumping driver version number to v2.03.00-k4
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 3a49fc9..2967c89 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -39,7 +39,7 @@ #define DRV_NAME "qla3xxx" #define DRV_STRING "QLogic ISP3XXX Network Driver" -#define DRV_VERSION"v2.03.00-k3" +#define DRV_VERSION"v2.03.00-k4" #define PFXDRV_NAME " " static const char ql3xxx_driver_name[] = DRV_NAME; -- 1.5.0.rc4.16.g9e258 - 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] qla3xxx: Adding support for the Agere PHY (ET1011C)
This PHY support patch was written by Benjamin Li. Signed-off-by: Benjamin Li <[EMAIL PROTECTED]> Signed-off-by: Ron Mercer <[EMAIL PROTECTED]> --- drivers/net/qla3xxx.c | 347 +++-- drivers/net/qla3xxx.h | 33 +- 2 files changed, 335 insertions(+), 45 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 631bf9f..3a49fc9 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -72,6 +72,30 @@ static struct pci_device_id ql3xxx_pci_tbl[] __devinitdata = { MODULE_DEVICE_TABLE(pci, ql3xxx_pci_tbl); /* + * These are the known PHY's which are used + */ +typedef enum { + PHY_TYPE_UNKNOWN = 0, + PHY_VITESSE_VSC8211, + PHY_AGERE_ET1011C, + MAX_PHY_DEV_TYPES +} PHY_DEVICE_et; + +typedef struct { + PHY_DEVICE_et phyDevice; + u32 phyIdOUI; + u16 phyIdModel; + char*name; +} PHY_DEVICE_INFO_t; + +const PHY_DEVICE_INFO_t PHY_DEVICES[] = + {{PHY_TYPE_UNKNOWN,0x00, 0x0, "PHY_TYPE_UNKNOWN"}, +{PHY_VITESSE_VSC8211, 0x0003f1, 0xb, "PHY_VITESSE_VSC8211"}, +{PHY_AGERE_ET1011C, 0x00a0bc, 0x1, "PHY_AGERE_ET1011C"}, +}; + + +/* * Caller must take hw_lock. */ static int ql_sem_spinlock(struct ql3_adapter *qdev, @@ -662,7 +686,7 @@ static u8 ql_mii_disable_scan_mode(struct ql3_adapter *qdev) } static int ql_mii_write_reg_ex(struct ql3_adapter *qdev, - u16 regAddr, u16 value, u32 mac_index) + u16 regAddr, u16 value, u32 phyAddr) { struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; @@ -680,7 +704,7 @@ static int ql_mii_write_reg_ex(struct ql3_adapter *qdev, } ql_write_page0_reg(qdev, &port_regs->macMIIMgmtAddrReg, - PHYAddr[mac_index] | regAddr); + phyAddr | regAddr); ql_write_page0_reg(qdev, &port_regs->macMIIMgmtDataReg, value); @@ -701,7 +725,7 @@ static int ql_mii_write_reg_ex(struct ql3_adapter *qdev, } static int ql_mii_read_reg_ex(struct ql3_adapter *qdev, u16 regAddr, - u16 * value, u32 mac_index) + u16 * value, u32 phyAddr) { struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; @@ -720,7 +744,7 @@ static int ql_mii_read_reg_ex(struct ql3_adapter *qdev, u16 regAddr, } ql_write_page0_reg(qdev, &port_regs->macMIIMgmtAddrReg, - PHYAddr[mac_index] | regAddr); + phyAddr | regAddr); ql_write_page0_reg(qdev, &port_regs->macMIIMgmtControlReg, (MAC_MII_CONTROL_RC << 16)); @@ -850,28 +874,31 @@ static void ql_petbi_start_neg(struct ql3_adapter *qdev) } -static void ql_petbi_reset_ex(struct ql3_adapter *qdev, u32 mac_index) +static void ql_petbi_reset_ex(struct ql3_adapter *qdev) { ql_mii_write_reg_ex(qdev, PETBI_CONTROL_REG, PETBI_CTRL_SOFT_RESET, - mac_index); + PHYAddr[qdev->mac_index]); } -static void ql_petbi_start_neg_ex(struct ql3_adapter *qdev, u32 mac_index) +static void ql_petbi_start_neg_ex(struct ql3_adapter *qdev) { u16 reg; /* Enable Auto-negotiation sense */ - ql_mii_read_reg_ex(qdev, PETBI_TBI_CTRL, ®, mac_index); + ql_mii_read_reg_ex(qdev, PETBI_TBI_CTRL, ®, + PHYAddr[qdev->mac_index]); reg |= PETBI_TBI_AUTO_SENSE; - ql_mii_write_reg_ex(qdev, PETBI_TBI_CTRL, reg, mac_index); + ql_mii_write_reg_ex(qdev, PETBI_TBI_CTRL, reg, + PHYAddr[qdev->mac_index]); ql_mii_write_reg_ex(qdev, PETBI_NEG_ADVER, - PETBI_NEG_PAUSE | PETBI_NEG_DUPLEX, mac_index); + PETBI_NEG_PAUSE | PETBI_NEG_DUPLEX, + PHYAddr[qdev->mac_index]); ql_mii_write_reg_ex(qdev, PETBI_CONTROL_REG, PETBI_CTRL_AUTO_NEG | PETBI_CTRL_RESTART_NEG | PETBI_CTRL_FULL_DUPLEX | PETBI_CTRL_SPEED_1000, - mac_index); + PHYAddr[qdev->mac_index]); } static void ql_petbi_init(struct ql3_adapter *qdev) @@ -880,10 +907,10 @@ static void ql_petbi_init(struct ql3_adapter *qdev) ql_petbi_start_neg(qdev); } -static void ql_petbi_init_ex(struct ql3_adapter *qdev, u32 mac_index) +static void ql_petbi_init_ex(struct ql3_adapter *qdev) { - ql_petbi_reset_ex(qdev, mac_index); - ql_petbi_start_neg_ex(qdev, mac_index); + ql_petbi_reset_ex(qdev); + ql_petbi_start_neg_ex(qdev); } static int ql_is_petbi_neg_pause(struct ql3_adapter *qdev) @@ -896,33 +923,128 @@ static int ql_is_petbi_neg_pause(struct ql3_adapter *qdev) return (reg & PETBI_NEG_PAUSE_MASK) == PETBI
[PATCH 5/7] qla3xxx: Add ethtool get_pauseparam for improved bonding support.
Signed-off-by: Ron Mercer <[EMAIL PROTECTED]> --- drivers/net/qla3xxx.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 9947a8d..631bf9f 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -1624,6 +1624,23 @@ static void ql_set_msglevel(struct net_device *ndev, u32 value) qdev->msg_enable = value; } +static void ql_get_pauseparam(struct net_device *ndev, + struct ethtool_pauseparam *pause) +{ + struct ql3_adapter *qdev = netdev_priv(ndev); + struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; + + u32 reg; + if(qdev->mac_index == 0) + reg = ql_read_page0_reg(qdev, &port_regs->mac0ConfigReg); + else + reg = ql_read_page0_reg(qdev, &port_regs->mac1ConfigReg); + + pause->autoneg = ql_get_auto_cfg_status(qdev); + pause->rx_pause = (reg & MAC_CONFIG_REG_RF) >> 2; + pause->tx_pause = (reg & MAC_CONFIG_REG_TF) >> 1; +} + static const struct ethtool_ops ql3xxx_ethtool_ops = { .get_settings = ql_get_settings, .get_drvinfo = ql_get_drvinfo, @@ -1631,6 +1648,7 @@ static const struct ethtool_ops ql3xxx_ethtool_ops = { .get_link = ethtool_op_get_link, .get_msglevel = ql_get_msglevel, .set_msglevel = ql_set_msglevel, + .get_pauseparam = ql_get_pauseparam, }; static int ql_populate_free_queue(struct ql3_adapter *qdev) -- 1.5.0.rc4.16.g9e258 - 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] qla3xxx: bugfix: Add tx control block memset.
This was removed in a previous patch to increase performance, but caused a transmit error for the 4032 chip. Signed-off-by: Ron Mercer <[EMAIL PROTECTED]> --- drivers/net/qla3xxx.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 356b1c4..f645a0d 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -2380,6 +2380,7 @@ static int ql3xxx_send(struct sk_buff *skb, struct net_device *ndev) } mac_iocb_ptr = tx_cb->queue_entry; + memset((void *)mac_iocb_ptr, 0, sizeof(struct ob_mac_iocb_req)); mac_iocb_ptr->opcode = qdev->mac_ob_opcode; mac_iocb_ptr->flags = OB_MAC_IOCB_REQ_X; mac_iocb_ptr->flags |= qdev->mb_bit_mask; -- 1.5.0.rc4.16.g9e258 - 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] qla3xxx: bugfix: Multi segment sends were getting whacked.
The proper header length was not being used. Signed-off-by: Ron Mercer <[EMAIL PROTECTED]> --- drivers/net/qla3xxx.c |9 ++--- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index f645a0d..85850d1 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -2217,12 +2217,7 @@ static int ql_send_map(struct ql3_adapter *qdev, int seg_cnt, seg = 0; int frag_cnt = (int)skb_shinfo(skb)->nr_frags; - seg_cnt = tx_cb->seg_count = ql_get_seg_count(qdev, - (skb_shinfo(skb)->nr_frags)); - if(seg_cnt == -1) { - printk(KERN_ERR PFX"%s: invalid segment count!\n",__func__); - return NETDEV_TX_BUSY; - } + seg_cnt = tx_cb->seg_count; /* * Map the skb buffer first. */ @@ -2278,7 +2273,7 @@ static int ql_send_map(struct ql3_adapter *qdev, pci_unmap_addr_set(&tx_cb->map[seg], mapaddr, map); pci_unmap_len_set(&tx_cb->map[seg], maplen, - len); + sizeof(struct oal)); oal_entry = (struct oal_entry *)oal; oal++; seg++; -- 1.5.0.rc4.16.g9e258 - 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] qla3xxx: bugfix: Dropping interrupt under heavy network load.
Update the rx queue pointer when exiting NAPI poll rather than at the end of each iteration. Remove unnecessary PCI flushes that occurred after every write. Now write all regs and flush once. Signed-off-by: Ron Mercer <[EMAIL PROTECTED]> --- drivers/net/qla3xxx.c | 71 1 files changed, 30 insertions(+), 41 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 85850d1..24c485e 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -1691,6 +1691,27 @@ static int ql_populate_free_queue(struct ql3_adapter *qdev) /* * Caller holds hw_lock. */ +static void ql_update_small_bufq_prod_index(struct ql3_adapter *qdev) +{ + struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; + if (qdev->small_buf_release_cnt >= 16) { + while (qdev->small_buf_release_cnt >= 16) { + qdev->small_buf_q_producer_index++; + + if (qdev->small_buf_q_producer_index == + NUM_SBUFQ_ENTRIES) + qdev->small_buf_q_producer_index = 0; + qdev->small_buf_release_cnt -= 8; + } + wmb(); + writel(qdev->small_buf_q_producer_index, + &port_regs->CommonRegs.rxSmallQProducerIndex); + } +} + +/* + * Caller holds hw_lock. + */ static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev) { struct bufq_addr_element *lrg_buf_q_ele; @@ -1732,13 +1753,10 @@ static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev) lrg_buf_q_ele = qdev->lrg_buf_q_virt_addr; } } - + wmb(); qdev->lrg_buf_next_free = lrg_buf_q_ele; - - ql_write_common_reg(qdev, - &port_regs->CommonRegs. - rxLargeQProducerIndex, - qdev->lrg_buf_q_producer_index); + writel(qdev->lrg_buf_q_producer_index, + &port_regs->CommonRegs.rxLargeQProducerIndex); } } @@ -1944,16 +1962,12 @@ static void ql_process_macip_rx_intr(struct ql3_adapter *qdev, static int ql_tx_rx_clean(struct ql3_adapter *qdev, int *tx_cleaned, int *rx_cleaned, int work_to_do) { - struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; struct net_rsp_iocb *net_rsp; struct net_device *ndev = qdev->ndev; - unsigned long hw_flags; int work_done = 0; - u32 rsp_producer_index = le32_to_cpu(*(qdev->prsp_producer_index)); - /* While there are entries in the completion queue. */ - while ((rsp_producer_index != + while ((le32_to_cpu(*(qdev->prsp_producer_index)) != qdev->rsp_consumer_index) && (work_done < work_to_do)) { net_rsp = qdev->rsp_current; @@ -2009,33 +2023,7 @@ static int ql_tx_rx_clean(struct ql3_adapter *qdev, work_done = *tx_cleaned + *rx_cleaned; } - if(work_done) { - spin_lock_irqsave(&qdev->hw_lock, hw_flags); - - ql_update_lrg_bufq_prod_index(qdev); - - if (qdev->small_buf_release_cnt >= 16) { - while (qdev->small_buf_release_cnt >= 16) { - qdev->small_buf_q_producer_index++; - - if (qdev->small_buf_q_producer_index == - NUM_SBUFQ_ENTRIES) - qdev->small_buf_q_producer_index = 0; - qdev->small_buf_release_cnt -= 8; - } - - wmb(); - ql_write_common_reg(qdev, - &port_regs->CommonRegs. - rxSmallQProducerIndex, - qdev->small_buf_q_producer_index); - - } - - spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); - } - - return *tx_cleaned + *rx_cleaned; + return work_done; } static int ql_poll(struct net_device *ndev, int *budget) @@ -2059,9 +2047,10 @@ quit_polling: netif_rx_complete(ndev); spin_lock_irqsave(&qdev->hw_lock, hw_flags); - ql_write_common_reg(qdev, - &port_regs->CommonRegs.rspQConsumerIndex, - qdev->rsp_consumer_index); + ql_update_small_bufq_prod_index(qdev); + ql_update_lrg_bufq_prod_index(qdev); + writel(qdev->rsp_consumer_index, + &port_regs->CommonRegs.rspQConsumerIndex); spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); ql_enable_interrupts(qdev); -- 1.
Re: [PATCH]: Add security check before flushing SAD/SPD
On Mon, 2007-03-26 at 13:39 -0600, Joy Latten wrote: > + if ((err = security_xfrm_policy_delete(pol)) != 0) { > + xfrm_audit_log(audit_info->loginuid, > +audit_info->secid, > +AUDIT_MAC_IPSEC_DELSPD, > +err ? 0 : 1, pol, NULL); > + return err; In all of the denial log statements you keep the "err ? 0 : 1" which are common among audit, but in this patch we always know that err is 1. Is it worth simplifying this down to just a 0 in the all of the xfrm_audit_log calls? -Eric - 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]: Add security check before flushing SAD/SPD
On Mon, 26 Mar 2007, James Morris wrote: > On Mon, 26 Mar 2007, Joy Latten wrote: > > > Signed-off-by: Joy Latten<[EMAIL PROTECTED]> > > This looks ok to me, although I have a couple of minor issues (which > should probably not stop it being merged): > > > + if ((err = security_xfrm_policy_delete(pol)) != 0) { > > The value of 'err' is implicitly inverted several times in this function > (and similarly in the state flush one). Something like > > ret = (fn() != 0); Oops, ignore the above. The correct idiom is: err = fn(); if (err) { /* handle error */ } Please use that, to reduce confusion :-) - James -- James Morris <[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]: Add security check before flushing SAD/SPD
On Mon, 26 Mar 2007, Joy Latten wrote: > Signed-off-by: Joy Latten<[EMAIL PROTECTED]> This looks ok to me, although I have a couple of minor issues (which should probably not stop it being merged): > + if ((err = security_xfrm_policy_delete(pol)) != 0) { The value of 'err' is implicitly inverted several times in this function (and similarly in the state flush one). Something like ret = (fn() != 0); might be better. > +} > + for (i = xfrm_policy_bydst[dir].hmask; i >= 0; i--) { Tab damage? - James -- James Morris <[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]: Add security check before flushing SAD/SPD
On Thu, 2007-03-22 at 20:56 -0400, James Morris wrote: >On Thu, 22 Mar 2007, Joy Latten wrote: >> > Perhaps a better semantic would be to fail the entire flush operation if >> > one of the security checks failed. e.g. loop through for permissions >> > first, then if all ok, loop through for deletion. >> > >> Ok, will code this up and test it if there are no objections. > >I'd suggest making the permission loop a noop if CONFIG_SECURITY=n, via a >static inline function. Reworked patch with improved semantics as suggested. I used CONFIG_SECURITY_NETWORK_XFRM instead of CONFIG_SECURITY since this can be considered part of the labeled networking semantics. Let me know if my assumption sounds incorrect. Also, I have built and tested with and without CONFIG_SECURITY_NETWORK_XFRM. Regards, Joy Signed-off-by: Joy Latten<[EMAIL PROTECTED]> diff -urpN linux-2.6.20.orig/include/net/xfrm.h linux-2.6.20.patch/include/net/xfrm.h --- linux-2.6.20.orig/include/net/xfrm.h2007-03-23 11:01:48.0 -0500 +++ linux-2.6.20.patch/include/net/xfrm.h 2007-03-25 21:36:05.0 -0500 @@ -937,7 +937,7 @@ static inline int xfrm_state_sort(struct #endif extern struct xfrm_state *xfrm_find_acq_byseq(u32 seq); extern int xfrm_state_delete(struct xfrm_state *x); -extern void xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info); +extern int xfrm_state_flush(u8 proto, struct xfrm_audit *audit_info); extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq); extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq); extern void xfrm_replay_notify(struct xfrm_state *x, int event); @@ -991,13 +991,13 @@ struct xfrm_policy *xfrm_policy_bysel_ct struct xfrm_sec_ctx *ctx, int delete, int *err); struct xfrm_policy *xfrm_policy_byid(u8, int dir, u32 id, int delete, int *err); -void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); +int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); u32 xfrm_get_acqseq(void); void xfrm_alloc_spi(struct xfrm_state *x, __be32 minspi, __be32 maxspi); struct xfrm_state * xfrm_find_acq(u8 mode, u32 reqid, u8 proto, xfrm_address_t *daddr, xfrm_address_t *saddr, int create, unsigned short family); -extern void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); +extern int xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info); extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst, struct flowi *fl, int family, int strict); diff -urpN linux-2.6.20.orig/net/key/af_key.c linux-2.6.20.patch/net/key/af_key.c --- linux-2.6.20.orig/net/key/af_key.c 2007-03-23 11:02:49.0 -0500 +++ linux-2.6.20.patch/net/key/af_key.c 2007-03-25 21:34:35.0 -0500 @@ -1645,6 +1645,7 @@ static int pfkey_flush(struct sock *sk, unsigned proto; struct km_event c; struct xfrm_audit audit_info; + int err; proto = pfkey_satype2proto(hdr->sadb_msg_satype); if (proto == 0) @@ -1652,7 +1653,9 @@ static int pfkey_flush(struct sock *sk, audit_info.loginuid = audit_get_loginuid(current->audit_context); audit_info.secid = 0; - xfrm_state_flush(proto, &audit_info); + err = xfrm_state_flush(proto, &audit_info); + if (err) + return err; c.data.proto = proto; c.seq = hdr->sadb_msg_seq; c.pid = hdr->sadb_msg_pid; @@ -2628,10 +2631,13 @@ static int pfkey_spdflush(struct sock *s { struct km_event c; struct xfrm_audit audit_info; + int err; audit_info.loginuid = audit_get_loginuid(current->audit_context); audit_info.secid = 0; - xfrm_policy_flush(XFRM_POLICY_TYPE_MAIN, &audit_info); + err = xfrm_policy_flush(XFRM_POLICY_TYPE_MAIN, &audit_info); + if (err) + return err; c.data.type = XFRM_POLICY_TYPE_MAIN; c.event = XFRM_MSG_FLUSHPOLICY; c.pid = hdr->sadb_msg_pid; diff -urpN linux-2.6.20.orig/net/xfrm/xfrm_policy.c linux-2.6.20.patch/net/xfrm/xfrm_policy.c --- linux-2.6.20.orig/net/xfrm/xfrm_policy.c2007-03-23 11:02:46.0 -0500 +++ linux-2.6.20.patch/net/xfrm/xfrm_policy.c 2007-03-25 21:32:51.0 -0500 @@ -813,11 +813,65 @@ struct xfrm_policy *xfrm_policy_byid(u8 } EXPORT_SYMBOL(xfrm_policy_byid); -void xfrm_policy_flush(u8 type, struct xfrm_audit *audit_info) +#ifdef CONFIG_SECURITY_NETWORK_XFRM +static inline int +xfrm_policy_flush_secctx_check(u8 type, struct xfrm_audit *audit_info) { - int dir; + int dir, err = 0; + + for (dir = 0; dir < XFRM_POLICY_MAX; dir++) { + struct xfrm_policy *pol; + struct hlist_node *entry; + int i; + + hlist_for_each_entry(pol, en
[PATCH 4/7] qla3xxx: bugfix: Jumbo frame handling.
Fixed rx checksum bits. Turn on TCP processing for rx checksum. Fixed max frame length register write. It wasn't getting set in multi-port system. Set rx buffer queue length properly for jumbo frames. Signed-off-by: Ron Mercer <[EMAIL PROTECTED]> --- drivers/net/qla3xxx.c | 29 +++-- drivers/net/qla3xxx.h |3 +-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 24c485e..9947a8d 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -1933,17 +1933,18 @@ static void ql_process_macip_rx_intr(struct ql3_adapter *qdev, u16 checksum = le16_to_cpu(ib_ip_rsp_ptr->checksum); if (checksum & (IB_IP_IOCB_RSP_3032_ICE | -IB_IP_IOCB_RSP_3032_CE | -IB_IP_IOCB_RSP_3032_NUC)) { +IB_IP_IOCB_RSP_3032_CE)) { printk(KERN_ERR "%s: Bad checksum for this %s packet, checksum = %x.\n", __func__, ((checksum & IB_IP_IOCB_RSP_3032_TCP) ? "TCP" : "UDP"),checksum); - } else if (checksum & IB_IP_IOCB_RSP_3032_TCP) { + } else if ((checksum & IB_IP_IOCB_RSP_3032_TCP) || + (checksum & IB_IP_IOCB_RSP_3032_UDP && + !(checksum & IB_IP_IOCB_RSP_3032_NUC))) { skb2->ip_summed = CHECKSUM_UNNECESSARY; - } + } } skb2->dev = qdev->ndev; skb2->protocol = eth_type_trans(skb2, qdev->ndev); @@ -3039,15 +3040,6 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) goto out; } - if (qdev->mac_index) - ql_write_page0_reg(qdev, - &port_regs->mac1MaxFrameLengthReg, - qdev->max_frame_size); - else - ql_write_page0_reg(qdev, - &port_regs->mac0MaxFrameLengthReg, - qdev->max_frame_size); - value = qdev->nvram_data.tcpMaxWindowSize; ql_write_page0_reg(qdev, &port_regs->tcpMaxWindow, value); @@ -3067,6 +3059,14 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) ql_sem_unlock(qdev, QL_FLASH_SEM_MASK); } + if (qdev->mac_index) + ql_write_page0_reg(qdev, + &port_regs->mac1MaxFrameLengthReg, + qdev->max_frame_size); + else + ql_write_page0_reg(qdev, + &port_regs->mac0MaxFrameLengthReg, + qdev->max_frame_size); if(ql_sem_spinlock(qdev, QL_PHY_GIO_SEM_MASK, (QL_RESOURCE_BITS_BASE_CODE | (qdev->mac_index) * @@ -3137,7 +3137,8 @@ static int ql_adapter_initialize(struct ql3_adapter *qdev) if (qdev->device_id == QL3032_DEVICE_ID) { value = (QL3032_PORT_CONTROL_EF | QL3032_PORT_CONTROL_KIE | -QL3032_PORT_CONTROL_EIv6 | QL3032_PORT_CONTROL_EIv4); +QL3032_PORT_CONTROL_EIv6 | QL3032_PORT_CONTROL_EIv4 | + QL3032_PORT_CONTROL_ET); ql_write_page0_reg(qdev, &port_regs->functionControl, ((value << 16) | value)); } else { diff --git a/drivers/net/qla3xxx.h b/drivers/net/qla3xxx.h index 34cd658..0203f88 100755 --- a/drivers/net/qla3xxx.h +++ b/drivers/net/qla3xxx.h @@ -1014,8 +1014,7 @@ struct eeprom_data { /* Transmit and Receive Buffers */ #define NUM_LBUFQ_ENTRIES 128 -#define JUMBO_NUM_LBUFQ_ENTRIES\ -(NUM_LBUFQ_ENTRIES/(JUMBO_MTU_SIZE/NORMAL_MTU_SIZE)) +#define JUMBO_NUM_LBUFQ_ENTRIES 32 #define NUM_SBUFQ_ENTRIES 64 #define QL_SMALL_BUFFER_SIZE32 #define QL_ADDR_ELE_PER_BUFQ_ENTRY \ -- 1.5.0.rc4.16.g9e258 - 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] qla3xxx: Adding support for the Agere PHY (ET1011C)
This PHY support patch was written by Benjamin Li. Signed-off-by: Benjamin Li <[EMAIL PROTECTED]> Signed-off-by: Ron Mercer <[EMAIL PROTECTED]> --- drivers/net/qla3xxx.c | 347 +++-- drivers/net/qla3xxx.h | 33 +- 2 files changed, 335 insertions(+), 45 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 631bf9f..3a49fc9 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -72,6 +72,30 @@ static struct pci_device_id ql3xxx_pci_tbl[] __devinitdata = { MODULE_DEVICE_TABLE(pci, ql3xxx_pci_tbl); /* + * These are the known PHY's which are used + */ +typedef enum { + PHY_TYPE_UNKNOWN = 0, + PHY_VITESSE_VSC8211, + PHY_AGERE_ET1011C, + MAX_PHY_DEV_TYPES +} PHY_DEVICE_et; + +typedef struct { + PHY_DEVICE_et phyDevice; + u32 phyIdOUI; + u16 phyIdModel; + char*name; +} PHY_DEVICE_INFO_t; + +const PHY_DEVICE_INFO_t PHY_DEVICES[] = + {{PHY_TYPE_UNKNOWN,0x00, 0x0, "PHY_TYPE_UNKNOWN"}, +{PHY_VITESSE_VSC8211, 0x0003f1, 0xb, "PHY_VITESSE_VSC8211"}, +{PHY_AGERE_ET1011C, 0x00a0bc, 0x1, "PHY_AGERE_ET1011C"}, +}; + + +/* * Caller must take hw_lock. */ static int ql_sem_spinlock(struct ql3_adapter *qdev, @@ -662,7 +686,7 @@ static u8 ql_mii_disable_scan_mode(struct ql3_adapter *qdev) } static int ql_mii_write_reg_ex(struct ql3_adapter *qdev, - u16 regAddr, u16 value, u32 mac_index) + u16 regAddr, u16 value, u32 phyAddr) { struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; @@ -680,7 +704,7 @@ static int ql_mii_write_reg_ex(struct ql3_adapter *qdev, } ql_write_page0_reg(qdev, &port_regs->macMIIMgmtAddrReg, - PHYAddr[mac_index] | regAddr); + phyAddr | regAddr); ql_write_page0_reg(qdev, &port_regs->macMIIMgmtDataReg, value); @@ -701,7 +725,7 @@ static int ql_mii_write_reg_ex(struct ql3_adapter *qdev, } static int ql_mii_read_reg_ex(struct ql3_adapter *qdev, u16 regAddr, - u16 * value, u32 mac_index) + u16 * value, u32 phyAddr) { struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; @@ -720,7 +744,7 @@ static int ql_mii_read_reg_ex(struct ql3_adapter *qdev, u16 regAddr, } ql_write_page0_reg(qdev, &port_regs->macMIIMgmtAddrReg, - PHYAddr[mac_index] | regAddr); + phyAddr | regAddr); ql_write_page0_reg(qdev, &port_regs->macMIIMgmtControlReg, (MAC_MII_CONTROL_RC << 16)); @@ -850,28 +874,31 @@ static void ql_petbi_start_neg(struct ql3_adapter *qdev) } -static void ql_petbi_reset_ex(struct ql3_adapter *qdev, u32 mac_index) +static void ql_petbi_reset_ex(struct ql3_adapter *qdev) { ql_mii_write_reg_ex(qdev, PETBI_CONTROL_REG, PETBI_CTRL_SOFT_RESET, - mac_index); + PHYAddr[qdev->mac_index]); } -static void ql_petbi_start_neg_ex(struct ql3_adapter *qdev, u32 mac_index) +static void ql_petbi_start_neg_ex(struct ql3_adapter *qdev) { u16 reg; /* Enable Auto-negotiation sense */ - ql_mii_read_reg_ex(qdev, PETBI_TBI_CTRL, ®, mac_index); + ql_mii_read_reg_ex(qdev, PETBI_TBI_CTRL, ®, + PHYAddr[qdev->mac_index]); reg |= PETBI_TBI_AUTO_SENSE; - ql_mii_write_reg_ex(qdev, PETBI_TBI_CTRL, reg, mac_index); + ql_mii_write_reg_ex(qdev, PETBI_TBI_CTRL, reg, + PHYAddr[qdev->mac_index]); ql_mii_write_reg_ex(qdev, PETBI_NEG_ADVER, - PETBI_NEG_PAUSE | PETBI_NEG_DUPLEX, mac_index); + PETBI_NEG_PAUSE | PETBI_NEG_DUPLEX, + PHYAddr[qdev->mac_index]); ql_mii_write_reg_ex(qdev, PETBI_CONTROL_REG, PETBI_CTRL_AUTO_NEG | PETBI_CTRL_RESTART_NEG | PETBI_CTRL_FULL_DUPLEX | PETBI_CTRL_SPEED_1000, - mac_index); + PHYAddr[qdev->mac_index]); } static void ql_petbi_init(struct ql3_adapter *qdev) @@ -880,10 +907,10 @@ static void ql_petbi_init(struct ql3_adapter *qdev) ql_petbi_start_neg(qdev); } -static void ql_petbi_init_ex(struct ql3_adapter *qdev, u32 mac_index) +static void ql_petbi_init_ex(struct ql3_adapter *qdev) { - ql_petbi_reset_ex(qdev, mac_index); - ql_petbi_start_neg_ex(qdev, mac_index); + ql_petbi_reset_ex(qdev); + ql_petbi_start_neg_ex(qdev); } static int ql_is_petbi_neg_pause(struct ql3_adapter *qdev) @@ -896,33 +923,128 @@ static int ql_is_petbi_neg_pause(struct ql3_adapter *qdev) return (reg & PETBI_NEG_PAUSE_MASK) == PETBI
[PATCH 5/7] qla3xxx: Add ethtool get_pauseparam for improved bonding support.
Signed-off-by: Ron Mercer <[EMAIL PROTECTED]> --- drivers/net/qla3xxx.c | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 9947a8d..631bf9f 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -1624,6 +1624,23 @@ static void ql_set_msglevel(struct net_device *ndev, u32 value) qdev->msg_enable = value; } +static void ql_get_pauseparam(struct net_device *ndev, + struct ethtool_pauseparam *pause) +{ + struct ql3_adapter *qdev = netdev_priv(ndev); + struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; + + u32 reg; + if(qdev->mac_index == 0) + reg = ql_read_page0_reg(qdev, &port_regs->mac0ConfigReg); + else + reg = ql_read_page0_reg(qdev, &port_regs->mac1ConfigReg); + + pause->autoneg = ql_get_auto_cfg_status(qdev); + pause->rx_pause = (reg & MAC_CONFIG_REG_RF) >> 2; + pause->tx_pause = (reg & MAC_CONFIG_REG_TF) >> 1; +} + static const struct ethtool_ops ql3xxx_ethtool_ops = { .get_settings = ql_get_settings, .get_drvinfo = ql_get_drvinfo, @@ -1631,6 +1648,7 @@ static const struct ethtool_ops ql3xxx_ethtool_ops = { .get_link = ethtool_op_get_link, .get_msglevel = ql_get_msglevel, .set_msglevel = ql_set_msglevel, + .get_pauseparam = ql_get_pauseparam, }; static int ql_populate_free_queue(struct ql3_adapter *qdev) -- 1.5.0.rc4.16.g9e258 - 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] qla3xxx: Bumping driver version number to v2.03.00-k4
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 3a49fc9..2967c89 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -39,7 +39,7 @@ #define DRV_NAME "qla3xxx" #define DRV_STRING "QLogic ISP3XXX Network Driver" -#define DRV_VERSION"v2.03.00-k3" +#define DRV_VERSION"v2.03.00-k4" #define PFXDRV_NAME " " static const char ql3xxx_driver_name[] = DRV_NAME; -- 1.5.0.rc4.16.g9e258 - 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] qla3xxx: bugfix: Add tx control block memset.
This was removed in a previous patch to increase performance, but caused a transmit error for the 4032 chip. Signed-off-by: Ron Mercer <[EMAIL PROTECTED]> --- drivers/net/qla3xxx.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 356b1c4..f645a0d 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -2380,6 +2380,7 @@ static int ql3xxx_send(struct sk_buff *skb, struct net_device *ndev) } mac_iocb_ptr = tx_cb->queue_entry; + memset((void *)mac_iocb_ptr, 0, sizeof(struct ob_mac_iocb_req)); mac_iocb_ptr->opcode = qdev->mac_ob_opcode; mac_iocb_ptr->flags = OB_MAC_IOCB_REQ_X; mac_iocb_ptr->flags |= qdev->mb_bit_mask; -- 1.5.0.rc4.16.g9e258 - 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] qla3xxx: bugfix: Multi segment sends were getting whacked.
The proper header length was not being used. Signed-off-by: Ron Mercer <[EMAIL PROTECTED]> --- drivers/net/qla3xxx.c |9 ++--- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index f645a0d..85850d1 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -2217,12 +2217,7 @@ static int ql_send_map(struct ql3_adapter *qdev, int seg_cnt, seg = 0; int frag_cnt = (int)skb_shinfo(skb)->nr_frags; - seg_cnt = tx_cb->seg_count = ql_get_seg_count(qdev, - (skb_shinfo(skb)->nr_frags)); - if(seg_cnt == -1) { - printk(KERN_ERR PFX"%s: invalid segment count!\n",__func__); - return NETDEV_TX_BUSY; - } + seg_cnt = tx_cb->seg_count; /* * Map the skb buffer first. */ @@ -2278,7 +2273,7 @@ static int ql_send_map(struct ql3_adapter *qdev, pci_unmap_addr_set(&tx_cb->map[seg], mapaddr, map); pci_unmap_len_set(&tx_cb->map[seg], maplen, - len); + sizeof(struct oal)); oal_entry = (struct oal_entry *)oal; oal++; seg++; -- 1.5.0.rc4.16.g9e258 - 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] qla3xxx: bugfix: Dropping interrupt under heavy network load.
Update the rx queue pointer when exiting NAPI poll rather than at the end of each iteration. Remove unnecessary PCI flushes that occurred after every write. Now write all regs and flush once. Signed-off-by: Ron Mercer <[EMAIL PROTECTED]> --- drivers/net/qla3xxx.c | 71 1 files changed, 30 insertions(+), 41 deletions(-) diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 85850d1..24c485e 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -1691,6 +1691,27 @@ static int ql_populate_free_queue(struct ql3_adapter *qdev) /* * Caller holds hw_lock. */ +static void ql_update_small_bufq_prod_index(struct ql3_adapter *qdev) +{ + struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; + if (qdev->small_buf_release_cnt >= 16) { + while (qdev->small_buf_release_cnt >= 16) { + qdev->small_buf_q_producer_index++; + + if (qdev->small_buf_q_producer_index == + NUM_SBUFQ_ENTRIES) + qdev->small_buf_q_producer_index = 0; + qdev->small_buf_release_cnt -= 8; + } + wmb(); + writel(qdev->small_buf_q_producer_index, + &port_regs->CommonRegs.rxSmallQProducerIndex); + } +} + +/* + * Caller holds hw_lock. + */ static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev) { struct bufq_addr_element *lrg_buf_q_ele; @@ -1732,13 +1753,10 @@ static void ql_update_lrg_bufq_prod_index(struct ql3_adapter *qdev) lrg_buf_q_ele = qdev->lrg_buf_q_virt_addr; } } - + wmb(); qdev->lrg_buf_next_free = lrg_buf_q_ele; - - ql_write_common_reg(qdev, - &port_regs->CommonRegs. - rxLargeQProducerIndex, - qdev->lrg_buf_q_producer_index); + writel(qdev->lrg_buf_q_producer_index, + &port_regs->CommonRegs.rxLargeQProducerIndex); } } @@ -1944,16 +1962,12 @@ static void ql_process_macip_rx_intr(struct ql3_adapter *qdev, static int ql_tx_rx_clean(struct ql3_adapter *qdev, int *tx_cleaned, int *rx_cleaned, int work_to_do) { - struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers; struct net_rsp_iocb *net_rsp; struct net_device *ndev = qdev->ndev; - unsigned long hw_flags; int work_done = 0; - u32 rsp_producer_index = le32_to_cpu(*(qdev->prsp_producer_index)); - /* While there are entries in the completion queue. */ - while ((rsp_producer_index != + while ((le32_to_cpu(*(qdev->prsp_producer_index)) != qdev->rsp_consumer_index) && (work_done < work_to_do)) { net_rsp = qdev->rsp_current; @@ -2009,33 +2023,7 @@ static int ql_tx_rx_clean(struct ql3_adapter *qdev, work_done = *tx_cleaned + *rx_cleaned; } - if(work_done) { - spin_lock_irqsave(&qdev->hw_lock, hw_flags); - - ql_update_lrg_bufq_prod_index(qdev); - - if (qdev->small_buf_release_cnt >= 16) { - while (qdev->small_buf_release_cnt >= 16) { - qdev->small_buf_q_producer_index++; - - if (qdev->small_buf_q_producer_index == - NUM_SBUFQ_ENTRIES) - qdev->small_buf_q_producer_index = 0; - qdev->small_buf_release_cnt -= 8; - } - - wmb(); - ql_write_common_reg(qdev, - &port_regs->CommonRegs. - rxSmallQProducerIndex, - qdev->small_buf_q_producer_index); - - } - - spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); - } - - return *tx_cleaned + *rx_cleaned; + return work_done; } static int ql_poll(struct net_device *ndev, int *budget) @@ -2059,9 +2047,10 @@ quit_polling: netif_rx_complete(ndev); spin_lock_irqsave(&qdev->hw_lock, hw_flags); - ql_write_common_reg(qdev, - &port_regs->CommonRegs.rspQConsumerIndex, - qdev->rsp_consumer_index); + ql_update_small_bufq_prod_index(qdev); + ql_update_lrg_bufq_prod_index(qdev); + writel(qdev->rsp_consumer_index, + &port_regs->CommonRegs.rspQConsumerIndex); spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); ql_enable_interrupts(qdev); -- 1.
more... iproute2/htb/whatever critical bug ?
Hello again one more bug, and seems even more painful, kernel panic... kernel 2.6.20.3 It is kind of complicated setup: Init of shaper on ifb0 device $TC qdisc add dev ifb0 root handle 1: htb default 1000 $TC filter add dev ifb0 parent 1:0 prio 1000 protocol ip u32 match ip dst 0.0.0.0/0 classid 1:131 Then when interface go up $TC class add dev ifb0 classid 1:${id} parent 1: htb rate ${rate}bit quantum 1600 $TC qdisc add dev ifb0 parent 1:${id} handle ${id}: sfq perturb 5 $TC filter add dev ifb0 protocol ip pref ${id} parent 1: handle ${id} fw classid 1:${id} $TC qdisc del dev $2 ingress 1>/dev/null 2>/dev/null $TC qdisc add dev $2 ingress $TC filter add dev $2 parent : protocol ip prio 10 u32 \ match u32 0 0 flowid 1:1 \ action ipt -j MARK --set-mark ${id} \ action mirred egress redirect dev ifb0 It happens when interface (pppN) go down, commands executed in ip-down $TC filter del dev ifb0 protocol ip pref ${id} $TC class del dev ifb0 classid 1:${id} Mar 26 23:21:11 ROUTER-75 pppd[22773]: Connection terminated. Mar 26 21:20:04 ROUTER-75 [ 551.481081] BUG: unable to handle kernel NULL pointer dereference Mar 26 21:20:04 ROUTER-75 at virtual address 0074 Mar 26 21:20:04 ROUTER-75 [ 551.481187] printing eip: Mar 26 21:20:04 ROUTER-75 [ 551.481236] f8a11df1 Mar 26 21:20:04 ROUTER-75 [ 551.481289] *pde = Mar 26 21:20:04 ROUTER-75 [ 551.481340] Oops: [#1] Mar 26 21:20:04 ROUTER-75 [ 551.481384] Mar 26 21:20:04 ROUTER-75 SMP Mar 26 21:20:04 ROUTER-75 Mar 26 21:20:04 ROUTER-75 [ 551.481549] Modules linked in: long module list ar 26 21:20:04 ROUTER-75 [ 551.485237] CPU:0 Mar 26 21:20:04 ROUTER-75 [ 551.485238] EIP:0060:[]Not tainted VLI Mar 26 21:20:04 ROUTER-75 [ 551.485239] EFLAGS: 00010282 (2.6.20.3-build- 0001 #4) Mar 26 21:20:04 ROUTER-75 [ 551.485438] EIP is at htb_qlen_notify+0x9/0x79 [sch_htb] Mar 26 21:20:04 ROUTER-75 [ 551.485487] eax: f3aa9800 ebx: ecx: edx: Mar 26 21:20:04 ROUTER-75 [ 551.485594] esi: f3aa9800 edi: f8a13420 ebp: 000c esp: f22c3c40 Mar 26 21:20:04 ROUTER-75 [ 551.485644] ds: 007b es: 007b ss: 0068 Mar 26 21:20:04 ROUTER-75 [ 551.485691] Process tc (pid: 24816, ti=f22c2000 task=f204a030 task.ti=f22c2000) Mar 26 21:20:04 ROUTER-75 Mar 26 21:20:04 ROUTER-75 [ 551.485741] Stack: Mar 26 21:20:04 ROUTER-75 f2214000 Mar 26 21:20:04 ROUTER-75 f220e000 Mar 26 21:20:04 ROUTER-75 Mar 26 21:20:04 ROUTER-75 00010263 Mar 26 21:20:04 ROUTER-75 Mar 26 21:20:04 ROUTER-75 f3aa9800 Mar 26 21:20:04 ROUTER-75 c021b0b5 Mar 26 21:20:04 ROUTER-75 000c Mar 26 21:20:04 ROUTER-75 Mar 26 21:20:04 ROUTER-75 [ 551.486247] Mar 26 21:20:04 ROUTER-75 f2a4c600 Mar 26 21:20:04 ROUTER-75 Mar 26 21:20:04 ROUTER-75 f3aa9800 Mar 26 21:20:04 ROUTER-75 Mar 26 21:20:04 ROUTER-75 [ 551.486705] Mar 26 21:20:04 ROUTER-75 Mar 26 21:20:04 ROUTER-75 f2a4c600 Mar 26 21:20:04 ROUTER-75 ffed Mar 26 21:20:04 ROUTER-75 00010263 Mar 26 21:20:04 ROUTER-75 c02e5318 Mar 26 21:20:04 ROUTER-75 [ 551.487226] Call Trace: Mar 26 21:20:04 ROUTER-75 tc_ctl_tclass+0x144/0x1fd Mar 26 21:20:04 ROUTER-75 rtnetlink_rcv_msg+0x0/0x1d2 Mar 26 21:20:04 ROUTER-75 [ 551.488183] [] Mar 26 21:20:04 ROUTER-75 [ 551.488266] [] Mar 26 21:20:04 ROUTER-75 netlink_data_ready+0x12/0x4c Mar 26 21:20:04 ROUTER-75 [ 551.488415] [] Mar 26 21:20:04 ROUTER-75 [ 551.488498] [] Mar 26 21:20:04 ROUTER-75 netlink_sendmsg+0x23b/0x247 Mar 26 21:20:04 ROUTER-75 [ 551.488658] [] Mar 26 21:20:04 ROUTER-75 sock_sendmsg+0xbc/0xd4 Mar 26 21:20:04 ROUTER-75 autoremove_wake_function+0x0/0x35 Mar 26 21:20:04 ROUTER-75 [ 551.488913] [] Mar 26 21:20:04 ROUTER-75 autoremove_wake_function+0x0/0x35 Mar 26 21:20:04 ROUTER-75 [ 551.489006] [] Mar 26 21:20:04 ROUTER-75 __qdisc_run+0x2e/0x182 Mar 26 21:20:04 ROUTER-75 [ 551.489158] [] Mar 26 21:20:04 ROUTER-75 tcf_mirred+0x0/0x14d [act_mirred] Mar 26 21:20:04 ROUTER-75 [ 551.489249] [] Mar 26 21:20:04 ROUTER-75 verify_iovec+0x3e/0x70 Mar 26 21:20:04 ROUTER-75 sys_sendmsg+0x194/0x1f9 Mar 26 21:20:04 ROUTER-75 [ 551.489483] [] Mar 26 21:20:04 ROUTER-75 sys_recvmsg+0x14d/0x1cf Mar 26 21:20:04 ROUTER-75 [ 551.489628] [] Mar 26 21:20:04 ROUTER-75 get_page_from_freelist+0x253/0x2d3 Mar 26 21:20:04 ROUTER-75 [ 551.489717] [] Mar 26 21:20:04 ROUTER-75 ppp_input+0xc6/0xe6 [ppp_generic] Mar 26 21:20:04 ROUTER-75 [ 551.489868] [] Mar 26 21:20:04 ROUTER-75 [ 551.489960] [] Mar 26 21:20:04 ROUTER-75 tc_classify+0x34/0xbc Mar 26 21:20:04 ROUTER-75 [ 551.490110] [] Mar 26 21:20:04 ROUTER-75 ingress_enqueue+0x16/0x55 [sch_ingress] Mar 26 21:20:04 ROUTER-75 [ 551.490200] [] Mar 26 21:20:04 ROUTER-75 netif_receive_skb+0x215/0x349 Mar 26 21:20:04 ROUTER-75 [ 551.490346] [] Mar 26 21:20:04 ROUTER-75 rtl8139_interrupt+0x2a1/0x3c5 [8139too] Mar 26 21:20:04 ROUTER-75 [ 551.490438] [] Mar 26 21:20:04 ROUTER-75 [ 551.4
[PATCH 0/7] qla3xxx: bugfixes and new PHY support.
Jeff, Of the following 7 patches, the first four are bugfixes that we would like to get into 2.6.21 if possible. The other three add support for a new PHY and change the driver version. We've built and tested this using netdev/upstream 2.6.21-rc3. Ron Mercer Signed-off-by: Ron Mercer <[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] Correct accept(2) recovery after sock_attach_fd()
* d_alloc() in sock_attach_fd() fails leaving ->f_dentry of new file NULL * bail out to out_fd label, doing fput()/__fput() on new file * but __fput() assumes valid ->f_dentry and dereferences it Signed-off-by: Alexey Dobriyan <[EMAIL PROTECTED]> --- net/socket.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/net/socket.c +++ b/net/socket.c @@ -1381,7 +1381,7 @@ asmlinkage long sys_accept(int fd, struc err = sock_attach_fd(newsock, newfile); if (err < 0) - goto out_fd; + goto out_fd_simple; err = security_socket_accept(sock, newsock); if (err) @@ -1414,6 +1414,11 @@ out_put: fput_light(sock->file, fput_needed); out: return err; +out_fd_simple: + sock_release(newsock); + put_filp(newfile); + put_unused_fd(newfd); + goto out_put; out_fd: fput(newfile); put_unused_fd(newfd); - 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] fib_hash removal
Paul E. McKenney writes: > Those of use who dive into networking only occasionally would much > appreciate this. ;-) No problem here... Cheers --ro Acked-by: Robert Olsson <[EMAIL PROTECTED]> Signed-off-by: Paul E. McKenney <[EMAIL PROTECTED]> (but trivial) diff -urpNa -X dontdiff linux-2.6.20/net/ipv4/fib_trie.c linux-2.6.20-fn_trie_RTNL/net/ipv4/fib_trie.c --- linux-2.6.20/net/ipv4/fib_trie.c2007-02-04 10:44:54.0 -0800 +++ linux-2.6.20-fn_trie_RTNL/net/ipv4/fib_trie.c 2007-03-20 08:13:59.0 -0700 @@ -1124,6 +1124,9 @@ err: return fa_head; } +/* + * Caller must hold RTNL. + */ static int fn_trie_insert(struct fib_table *tb, struct fib_config *cfg) { struct trie *t = (struct trie *) tb->tb_data; @@ -1543,6 +1546,9 @@ static int trie_leaf_remove(struct trie return 1; } +/* + * Caller must hold RTNL. + */ static int fn_trie_delete(struct fib_table *tb, struct fib_config *cfg) { struct trie *t = (struct trie *) tb->tb_data; @@ -1721,6 +1727,9 @@ up: return NULL; /* Ready. Root of trie */ } +/* + * Caller must hold RTNL. + */ static int fn_trie_flush(struct fib_table *tb) { struct trie *t = (struct trie *) tb->tb_data; - 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
net-2.6.22 rebased...
I build this tree by cloning the current bug fix net-2.6 tree then merging in all of the net-2.6.22 stuff on top, in the usual spot: kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.22.git I merged in a few of the small "oh shit" type bug fix patches into the changeset that caused the problem. There were also, as usual, several merge conflicts. I double and triple checked my work, but it's always possible that I made mistakes here, so let me know if you see anything out of place or flat-out wrong. Sanity tested on ix86, and I'm doing build+sanity checks on sparc64 and have a "allmodconfig" build going as well. Thanks! - 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: [irda-users] [2.6.20-rt8] "Neighbour table overflow."
On Sat, 24 Mar 2007, Samuel Ortiz wrote: On Fri, Mar 23, 2007 at 01:14:43PM +0100, Guennadi Liakhovetski wrote: Below is a patch that fixes ONE sk_buff leak (maintainer added to cc: hi, Paul:-)). Still investigating if there are more there. Are you still seeing the skb cache growing with your fix ? No, running stable so far. Thanks Guennadi - Guennadi Liakhovetski, Ph.D. DSA Daten- und Systemtechnik GmbH Pascalstr. 28 D-52076 Aachen Germany - 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