* Re: [git patches] net driver fixes
From: Kumar Gala @ 2006-04-12 22:47 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Andrew Morton, Linus Torvalds, netdev, linux-kernel
In-Reply-To: <443D8310.5020304@garzik.org>
On Apr 12, 2006, at 5:45 PM, Jeff Garzik wrote:
> Kumar Gala wrote:
>> Jeff,
>> Noticed Andy's gianfar fixes aren't in here. I'd be good to see
>> if we can get them in for 2.6.17
>
> Never saw them...
Odd, posted to netdev, Andy may not have copied you on them.
http://marc.theaimsgroup.com/?l=linux-netdev&m=114437381506340&w=2
^ permalink raw reply
* Re: [git patches] net driver fixes
From: Jeff Garzik @ 2006-04-12 22:45 UTC (permalink / raw)
To: Kumar Gala; +Cc: Andrew Morton, Linus Torvalds, netdev, linux-kernel
In-Reply-To: <53E69375-551D-41FC-9D09-E3D39EC80A19@kernel.crashing.org>
Kumar Gala wrote:
> Jeff,
>
> Noticed Andy's gianfar fixes aren't in here. I'd be good to see if we
> can get them in for 2.6.17
Never saw them...
^ permalink raw reply
* Re: [git patches] net driver fixes
From: Kumar Gala @ 2006-04-12 22:43 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Andrew Morton, Linus Torvalds, netdev, linux-kernel
In-Reply-To: <20060412221437.GA20899@havoc.gtf.org>
Jeff,
Noticed Andy's gianfar fixes aren't in here. I'd be good to see if
we can get them in for 2.6.17
- kumar
On Apr 12, 2006, at 5:14 PM, Jeff Garzik wrote:
>
> Please pull from 'upstream-linus' branch of
> master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git
>
> to receive the following updates:
>
> drivers/net/b44.c | 64 ++++++---------
> drivers/net/bnx2.c | 2
> drivers/net/hydra.h | 177
> ------------------------------------------
> drivers/net/ixgb/ixgb_main.c | 13 ++-
> drivers/net/mv643xx_eth.c | 19 +++-
> drivers/net/natsemi.c | 2
> drivers/net/pcmcia/axnet_cs.c | 2
> drivers/net/skge.c | 2
> drivers/net/sky2.c | 6 -
> drivers/net/sky2.h | 2
> drivers/net/starfire.c | 2
> drivers/net/typhoon.c | 2
> drivers/net/via-rhine.c | 7 -
> 13 files changed, 67 insertions(+), 233 deletions(-)
>
> Adrian Bunk:
> drivers/net/via-rhine.c: make a function static
> remove drivers/net/hydra.h
>
> Andreas Schwab:
> Use pci_set_consistent_dma_mask in ixgb driver
>
> Brent Cook:
> mv643xx_eth: Always free completed tx descs on tx interrupt
>
> Dale Farnsworth:
> mv643xx_eth: Fix tx_timeout to only conditionally wake tx queue
>
> Gary Zambrano:
> b44: disable default tx pause
> b44: increase version to 1.00
>
> Jeff Garzik:
> [netdrvr b44] trim trailing whitespace
>
> Komuro:
> network: axnet_cs.c: add missing 'PRIV' in ei_rx_overrun
>
> Randy Dunlap:
> net drivers: fix section attributes for gcc
>
> Roger Luethi:
> via-rhine: execute bounce buffers code on Rhine-I only
>
> Stephen Hemminger:
> dlink pci cards using wrong driver
> sky2: bad memory reference on dual port cards
^ permalink raw reply
* [PATCH] atm: clip timer race
From: Stephen Hemminger @ 2006-04-12 22:42 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Herbert Xu, davem, chas, linux-atm-general, netdev
In-Reply-To: <20060412145254.4dd21be6@localhost.localdomain>
By inspection, the clip idle timer code is racy on SMP.
Here is a safe version of timer management.
Untested, I don't have ATM hardware.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
--- clip.orig/net/atm/clip.c 2006-04-12 14:24:10.000000000 -0700
+++ clip/net/atm/clip.c 2006-04-12 14:40:01.000000000 -0700
@@ -54,8 +54,6 @@
static struct atm_vcc *atmarpd;
static struct neigh_table clip_tbl;
static struct timer_list idle_timer;
-static int start_timer = 1;
-
static int to_atmarpd(enum atmarp_ctrl_type type,int itf,unsigned long ip)
{
@@ -725,13 +723,8 @@
return -EADDRINUSE;
}
- if (start_timer) {
- start_timer = 0;
- init_timer(&idle_timer);
- idle_timer.expires = jiffies+CLIP_CHECK_INTERVAL*HZ;
- idle_timer.function = idle_timer_check;
- add_timer(&idle_timer);
- }
+ mod_timer(&idle_timer, jiffies+CLIP_CHECK_INTERVAL*HZ);
+
atmarpd = vcc;
set_bit(ATM_VF_META,&vcc->flags);
set_bit(ATM_VF_READY,&vcc->flags);
@@ -1002,6 +995,8 @@
register_netdevice_notifier(&clip_dev_notifier);
register_inetaddr_notifier(&clip_inet_notifier);
+ setup_timer(&idle_timer, idle_timer_check, 0);
+
#ifdef CONFIG_PROC_FS
{
struct proc_dir_entry *p;
@@ -1029,8 +1024,7 @@
/* First, stop the idle timer, so it stops banging
* on the table.
*/
- if (start_timer == 0)
- del_timer(&idle_timer);
+ del_timer_sync(&idle_timer);
/* Next, purge the table, so that the device
* unregister loop below does not hang due to
^ permalink raw reply
* Re: kernel panic (on DHCP discover?) in sky2 driver of 2.6.17-rc1
From: Guenther Thomsen @ 2006-04-12 22:26 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: John W. Linville, netdev
In-Reply-To: <20060412144812.6b679204@localhost.localdomain>
On Wednesday 12 April 2006 14:48, Stephen Hemminger wrote:
> You need this patch, which Jeff hasn't applied yet.
> -----
> Subject: sky2: crash when bringing up second port
>
> Sky2 driver will oops referencing bad memory if used on
> a dual port card. The problem is accessing past end of
> MIB counter space.
>
> Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
>
>
> --- test-2.6.orig/drivers/net/sky2.c
> +++ test-2.6/drivers/net/sky2.c
> @@ -579,8 +579,8 @@ static void sky2_mac_init(struct sky2_hw
> reg = gma_read16(hw, port, GM_PHY_ADDR);
> gma_write16(hw, port, GM_PHY_ADDR, reg | GM_PAR_MIB_CLR);
>
> - for (i = 0; i < GM_MIB_CNT_SIZE; i++)
> - gma_read16(hw, port, GM_MIB_CNT_BASE + 8 * i);
> + for (i = GM_MIB_CNT_BASE; i <= GM_MIB_CNT_END; i += 4)
> + gma_read16(hw, port, i);
> gma_write16(hw, port, GM_PHY_ADDR, reg);
>
> /* transmit control */
> --- test-2.6.orig/drivers/net/sky2.h
> +++ test-2.6/drivers/net/sky2.h
> @@ -1375,7 +1375,7 @@ enum {
> GM_PHY_ADDR = 0x0088, /* 16 bit r/w GPHY Address Register */
> /* MIB Counters */
> GM_MIB_CNT_BASE = 0x0100, /* Base Address of MIB Counters */
> - GM_MIB_CNT_SIZE = 256,
> + GM_MIB_CNT_END = 0x025C, /* Last MIB counter */
> };
Thanks for the very quick response. The patch indeed prevents the panic
when bringing up the second interface, but now the host doesn't receive
any packets anymore. It still sends packets (ARP requests, naturally).
If I inject the Ethernet address of a second host into the arp table of
the test subject, ICMP Echo requests are sent, but then sendmsg's
buffer space is exhausted (?):
--8<--
[root@penguin1 ~]# arp -s 192.168.65.67 00:A0:D1:E1:F3:2C
[root@penguin1 ~]# ping 192.168.65.67
PING 192.168.65.67 (192.168.65.67) 56(84) bytes of data.
ping: sendmsg: No buffer space available
ping: sendmsg: No buffer space available
ping: sendmsg: No buffer space available
ping: sendmsg: No buffer space available
ping: sendmsg: No buffer space available
ping: sendmsg: No buffer space available
--- 192.168.65.67 ping statistics ---
19 packets transmitted, 0 received, 100% packet loss, time 37012ms
-->8--
There is no hint of a malfunction to be found in the kernel's message
buffer.
best regards
Guenther
^ permalink raw reply
* [git patches] net driver fixes
From: Jeff Garzik @ 2006-04-12 22:14 UTC (permalink / raw)
To: Andrew Morton, Linus Torvalds; +Cc: netdev, linux-kernel
Please pull from 'upstream-linus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git
to receive the following updates:
drivers/net/b44.c | 64 ++++++---------
drivers/net/bnx2.c | 2
drivers/net/hydra.h | 177 ------------------------------------------
drivers/net/ixgb/ixgb_main.c | 13 ++-
drivers/net/mv643xx_eth.c | 19 +++-
drivers/net/natsemi.c | 2
drivers/net/pcmcia/axnet_cs.c | 2
drivers/net/skge.c | 2
drivers/net/sky2.c | 6 -
drivers/net/sky2.h | 2
drivers/net/starfire.c | 2
drivers/net/typhoon.c | 2
drivers/net/via-rhine.c | 7 -
13 files changed, 67 insertions(+), 233 deletions(-)
Adrian Bunk:
drivers/net/via-rhine.c: make a function static
remove drivers/net/hydra.h
Andreas Schwab:
Use pci_set_consistent_dma_mask in ixgb driver
Brent Cook:
mv643xx_eth: Always free completed tx descs on tx interrupt
Dale Farnsworth:
mv643xx_eth: Fix tx_timeout to only conditionally wake tx queue
Gary Zambrano:
b44: disable default tx pause
b44: increase version to 1.00
Jeff Garzik:
[netdrvr b44] trim trailing whitespace
Komuro:
network: axnet_cs.c: add missing 'PRIV' in ei_rx_overrun
Randy Dunlap:
net drivers: fix section attributes for gcc
Roger Luethi:
via-rhine: execute bounce buffers code on Rhine-I only
Stephen Hemminger:
dlink pci cards using wrong driver
sky2: bad memory reference on dual port cards
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index c4e12b5..3d30668 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -2,6 +2,7 @@
*
* Copyright (C) 2002 David S. Miller (davem@redhat.com)
* Fixed by Pekka Pietikainen (pp@ee.oulu.fi)
+ * Copyright (C) 2006 Broadcom Corporation.
*
* Distribute under GPL.
*/
@@ -28,8 +29,8 @@
#define DRV_MODULE_NAME "b44"
#define PFX DRV_MODULE_NAME ": "
-#define DRV_MODULE_VERSION "0.97"
-#define DRV_MODULE_RELDATE "Nov 30, 2005"
+#define DRV_MODULE_VERSION "1.00"
+#define DRV_MODULE_RELDATE "Apr 7, 2006"
#define B44_DEF_MSG_ENABLE \
(NETIF_MSG_DRV | \
@@ -136,7 +137,7 @@ static inline unsigned long br32(const s
return readl(bp->regs + reg);
}
-static inline void bw32(const struct b44 *bp,
+static inline void bw32(const struct b44 *bp,
unsigned long reg, unsigned long val)
{
writel(val, bp->regs + reg);
@@ -286,13 +287,13 @@ static void __b44_cam_write(struct b44 *
val |= ((u32) data[4]) << 8;
val |= ((u32) data[5]) << 0;
bw32(bp, B44_CAM_DATA_LO, val);
- val = (CAM_DATA_HI_VALID |
+ val = (CAM_DATA_HI_VALID |
(((u32) data[0]) << 8) |
(((u32) data[1]) << 0));
bw32(bp, B44_CAM_DATA_HI, val);
bw32(bp, B44_CAM_CTRL, (CAM_CTRL_WRITE |
(index << CAM_CTRL_INDEX_SHIFT)));
- b44_wait_bit(bp, B44_CAM_CTRL, CAM_CTRL_BUSY, 100, 1);
+ b44_wait_bit(bp, B44_CAM_CTRL, CAM_CTRL_BUSY, 100, 1);
}
static inline void __b44_disable_ints(struct b44 *bp)
@@ -410,25 +411,18 @@ static void __b44_set_flow_ctrl(struct b
static void b44_set_flow_ctrl(struct b44 *bp, u32 local, u32 remote)
{
- u32 pause_enab = bp->flags & (B44_FLAG_TX_PAUSE |
- B44_FLAG_RX_PAUSE);
+ u32 pause_enab = 0;
- if (local & ADVERTISE_PAUSE_CAP) {
- if (local & ADVERTISE_PAUSE_ASYM) {
- if (remote & LPA_PAUSE_CAP)
- pause_enab |= (B44_FLAG_TX_PAUSE |
- B44_FLAG_RX_PAUSE);
- else if (remote & LPA_PAUSE_ASYM)
- pause_enab |= B44_FLAG_RX_PAUSE;
- } else {
- if (remote & LPA_PAUSE_CAP)
- pause_enab |= (B44_FLAG_TX_PAUSE |
- B44_FLAG_RX_PAUSE);
- }
- } else if (local & ADVERTISE_PAUSE_ASYM) {
- if ((remote & LPA_PAUSE_CAP) &&
- (remote & LPA_PAUSE_ASYM))
- pause_enab |= B44_FLAG_TX_PAUSE;
+ /* The driver supports only rx pause by default because
+ the b44 mac tx pause mechanism generates excessive
+ pause frames.
+ Use ethtool to turn on b44 tx pause if necessary.
+ */
+ if ((local & ADVERTISE_PAUSE_CAP) &&
+ (local & ADVERTISE_PAUSE_ASYM)){
+ if ((remote & LPA_PAUSE_ASYM) &&
+ !(remote & LPA_PAUSE_CAP))
+ pause_enab |= B44_FLAG_RX_PAUSE;
}
__b44_set_flow_ctrl(bp, pause_enab);
@@ -1063,7 +1057,7 @@ static int b44_change_mtu(struct net_dev
spin_unlock_irq(&bp->lock);
b44_enable_ints(bp);
-
+
return 0;
}
@@ -1381,7 +1375,7 @@ static void b44_init_hw(struct b44 *bp)
bw32(bp, B44_DMARX_ADDR, bp->rx_ring_dma + bp->dma_offset);
bw32(bp, B44_DMARX_PTR, bp->rx_pending);
- bp->rx_prod = bp->rx_pending;
+ bp->rx_prod = bp->rx_pending;
bw32(bp, B44_MIB_CTRL, MIB_CTRL_CLR_ON_READ);
@@ -1553,9 +1547,9 @@ static void __b44_set_rx_mode(struct net
val |= RXCONFIG_ALLMULTI;
else
i = __b44_load_mcast(bp, dev);
-
+
for (; i < 64; i++) {
- __b44_cam_write(bp, zero, i);
+ __b44_cam_write(bp, zero, i);
}
bw32(bp, B44_RXCONFIG, val);
val = br32(bp, B44_CAM_CTRL);
@@ -1737,7 +1731,7 @@ static int b44_set_ringparam(struct net_
spin_unlock_irq(&bp->lock);
b44_enable_ints(bp);
-
+
return 0;
}
@@ -1782,7 +1776,7 @@ static int b44_set_pauseparam(struct net
spin_unlock_irq(&bp->lock);
b44_enable_ints(bp);
-
+
return 0;
}
@@ -1898,7 +1892,7 @@ static int __devinit b44_get_invariants(
bp->core_unit = ssb_core_unit(bp);
bp->dma_offset = SB_PCI_DMA;
- /* XXX - really required?
+ /* XXX - really required?
bp->flags |= B44_FLAG_BUGGY_TXPTR;
*/
out:
@@ -1946,7 +1940,7 @@ static int __devinit b44_init_one(struct
"aborting.\n");
goto err_out_free_res;
}
-
+
err = pci_set_consistent_dma_mask(pdev, (u64) B44_DMA_MASK);
if (err) {
printk(KERN_ERR PFX "No usable DMA configuration, "
@@ -2041,9 +2035,9 @@ static int __devinit b44_init_one(struct
pci_save_state(bp->pdev);
- /* Chip reset provides power to the b44 MAC & PCI cores, which
+ /* Chip reset provides power to the b44 MAC & PCI cores, which
* is necessary for MAC register access.
- */
+ */
b44_chip_reset(bp);
printk(KERN_INFO "%s: Broadcom 4400 10/100BaseT Ethernet ", dev->name);
@@ -2091,10 +2085,10 @@ static int b44_suspend(struct pci_dev *p
del_timer_sync(&bp->timer);
- spin_lock_irq(&bp->lock);
+ spin_lock_irq(&bp->lock);
b44_halt(bp);
- netif_carrier_off(bp->dev);
+ netif_carrier_off(bp->dev);
netif_device_detach(bp->dev);
b44_free_rings(bp);
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 2671da2..5ca99e2 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -63,7 +63,7 @@
/* Time in jiffies before concluding the transmitter is hung. */
#define TX_TIMEOUT (5*HZ)
-static char version[] __devinitdata =
+static const char version[] __devinitdata =
"Broadcom NetXtreme II Gigabit Ethernet Driver " DRV_MODULE_NAME " v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
MODULE_AUTHOR("Michael Chan <mchan@broadcom.com>");
diff --git a/drivers/net/hydra.h b/drivers/net/hydra.h
deleted file mode 100644
index 3741414..0000000
--- a/drivers/net/hydra.h
+++ /dev/null
@@ -1,177 +0,0 @@
-/* $Linux: hydra.h,v 1.0 1994/10/26 02:03:47 cgd Exp $ */
-
-/*
- * Copyright (c) 1994 Timo Rossi
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Timo Rossi
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * The Hydra Systems card uses the National Semiconductor
- * 8390 NIC (Network Interface Controller) chip, located
- * at card base address + 0xffe1. NIC registers are accessible
- * only at odd byte addresses, so the register offsets must
- * be multiplied by two.
- *
- * Card address PROM is located at card base + 0xffc0 (even byte addresses)
- *
- * RAM starts at the card base address, and is 16K or 64K.
- * The current Amiga NetBSD hydra driver is hardwired for 16K.
- * It seems that the RAM should be accessed as words or longwords only.
- *
- */
-
-/* adapted for Linux by Topi Kanerva 03/29/95
- with original author's permission */
-
-#define HYDRA_NIC_BASE 0xffe1
-
-/* Page0 registers */
-
-#define NIC_CR 0 /* Command register */
-#define NIC_PSTART (1*2) /* Page start (write) */
-#define NIC_PSTOP (2*2) /* Page stop (write) */
-#define NIC_BNDRY (3*2) /* Boundary pointer */
-#define NIC_TSR (4*2) /* Transmit status (read) */
-#define NIC_TPSR (4*2) /* Transmit page start (write) */
-#define NIC_NCR (5*2) /* Number of collisions, read */
-#define NIC_TBCR0 (5*2) /* Transmit byte count low (write) */
-#define NIC_FIFO (6*2) /* FIFO reg. (read) */
-#define NIC_TBCR1 (6*2) /* Transmit byte count high (write) */
-#define NIC_ISR (7*2) /* Interrupt status register */
-#define NIC_RBCR0 (0xa*2) /* Remote byte count low (write) */
-#define NIC_RBCR1 (0xb*2) /* Remote byte count high (write) */
-#define NIC_RSR (0xc*2) /* Receive status (read) */
-#define NIC_RCR (0xc*2) /* Receive config (write) */
-#define NIC_CNTR0 (0xd*2) /* Frame alignment error count (read) */
-#define NIC_TCR (0xd*2) /* Transmit config (write) */
-#define NIC_CNTR1 (0xe*2) /* CRC error counter (read) */
-#define NIC_DCR (0xe*2) /* Data config (write) */
-#define NIC_CNTR2 (0xf*2) /* missed packet counter (read) */
-#define NIC_IMR (0xf*2) /* Interrupt mask reg. (write) */
-
-/* Page1 registers */
-
-#define NIC_PAR0 (1*2) /* Physical address */
-#define NIC_PAR1 (2*2)
-#define NIC_PAR2 (3*2)
-#define NIC_PAR3 (4*2)
-#define NIC_PAR4 (5*2)
-#define NIC_PAR5 (6*2)
-#define NIC_CURR (7*2) /* Current RX ring-buffer page */
-#define NIC_MAR0 (8*2) /* Multicast address */
-#define NIC_MAR1 (9*2)
-#define NIC_MAR2 (0xa*2)
-#define NIC_MAR3 (0xb*2)
-#define NIC_MAR4 (0xc*2)
-#define NIC_MAR5 (0xd*2)
-#define NIC_MAR6 (0xe*2)
-#define NIC_MAR7 (0xf*2)
-
-/* Command register definitions */
-
-#define CR_STOP 0x01 /* Stop -- software reset command */
-#define CR_START 0x02 /* Start */
-#define CR_TXP 0x04 /* Transmit packet */
-
-#define CR_RD0 0x08 /* Remote DMA cmd */
-#define CR_RD1 0x10
-#define CR_RD2 0x20
-
-#define CR_NODMA CR_RD2
-
-#define CR_PS0 0x40 /* Page select */
-#define CR_PS1 0x80
-
-#define CR_PAGE0 0
-#define CR_PAGE1 CR_PS0
-#define CR_PAGE2 CR_PS1
-
-/* Interrupt status reg. definitions */
-
-#define ISR_PRX 0x01 /* Packet received without errors */
-#define ISR_PTX 0x02 /* Packet transmitted without errors */
-#define ISR_RXE 0x04 /* Receive error */
-#define ISR_TXE 0x08 /* Transmit error */
-#define ISR_OVW 0x10 /* Ring buffer overrun */
-#define ISR_CNT 0x20 /* Counter overflow */
-#define ISR_RDC 0x40 /* Remote DMA compile */
-#define ISR_RST 0x80 /* Reset status */
-
-/* Data config reg. definitions */
-
-#define DCR_WTS 0x01 /* Word transfer select */
-#define DCR_BOS 0x02 /* Byte order select */
-#define DCR_LAS 0x04 /* Long address select */
-#define DCR_LS 0x08 /* Loopback select */
-#define DCR_AR 0x10 /* Auto-init remote */
-#define DCR_FT0 0x20 /* FIFO threshold select */
-#define DCR_FT1 0x40
-
-/* Transmit config reg. definitions */
-
-#define TCR_CRC 0x01 /* Inhibit CRC */
-#define TCR_LB0 0x02 /* Loopback control */
-#define TCR_LB1 0x04
-#define TCR_ATD 0x08 /* Auto transmit disable */
-#define TCR_OFST 0x10 /* Collision offset enable */
-
-/* Transmit status reg. definitions */
-
-#define TSR_PTX 0x01 /* Packet transmitted */
-#define TSR_COL 0x04 /* Transmit collided */
-#define TSR_ABT 0x08 /* Transmit aborted */
-#define TSR_CRS 0x10 /* Carrier sense lost */
-#define TSR_FU 0x20 /* FIFO underrun */
-#define TSR_CDH 0x40 /* CD Heartbeat */
-#define TSR_OWC 0x80 /* Out of Window Collision */
-
-/* Receiver config register definitions */
-
-#define RCR_SEP 0x01 /* Save errored packets */
-#define RCR_AR 0x02 /* Accept runt packets */
-#define RCR_AB 0x04 /* Accept broadcast */
-#define RCR_AM 0x08 /* Accept multicast */
-#define RCR_PRO 0x10 /* Promiscuous mode */
-#define RCR_MON 0x20 /* Monitor mode */
-
-/* Receiver status register definitions */
-
-#define RSR_PRX 0x01 /* Packet received without error */
-#define RSR_CRC 0x02 /* CRC error */
-#define RSR_FAE 0x04 /* Frame alignment error */
-#define RSR_FO 0x08 /* FIFO overrun */
-#define RSR_MPA 0x10 /* Missed packet */
-#define RSR_PHY 0x20 /* Physical address */
-#define RSR_DIS 0x40 /* Received disabled */
-#define RSR_DFR 0x80 /* Deferring (jabber) */
-
-/* Hydra System card address PROM offset */
-
-#define HYDRA_ADDRPROM 0xffc0
-
-
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index f9f77e4..cfd67d8 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -357,18 +357,20 @@ ixgb_probe(struct pci_dev *pdev,
if((err = pci_enable_device(pdev)))
return err;
- if(!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK))) {
+ if(!(err = pci_set_dma_mask(pdev, DMA_64BIT_MASK)) &&
+ !(err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK))) {
pci_using_dac = 1;
} else {
- if((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) {
+ if((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK)) ||
+ (err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK))) {
IXGB_ERR("No usable DMA configuration, aborting\n");
- return err;
+ goto err_dma_mask;
}
pci_using_dac = 0;
}
if((err = pci_request_regions(pdev, ixgb_driver_name)))
- return err;
+ goto err_request_regions;
pci_set_master(pdev);
@@ -502,6 +504,9 @@ err_ioremap:
free_netdev(netdev);
err_alloc_etherdev:
pci_release_regions(pdev);
+err_request_regions:
+err_dma_mask:
+ pci_disable_device(pdev);
return err;
}
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 9f26613..ea62a3e 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -281,10 +281,16 @@ static void mv643xx_eth_tx_timeout_task(
{
struct mv643xx_private *mp = netdev_priv(dev);
- netif_device_detach(dev);
+ if (!netif_running(dev))
+ return;
+
+ netif_stop_queue(dev);
+
eth_port_reset(mp->port_num);
eth_port_start(dev);
- netif_device_attach(dev);
+
+ if (mp->tx_ring_size - mp->tx_desc_count >= MAX_DESCS_PER_SKB)
+ netif_wake_queue(dev);
}
/**
@@ -552,9 +558,9 @@ static irqreturn_t mv643xx_eth_int_handl
#else
if (eth_int_cause & ETH_INT_CAUSE_RX)
mv643xx_eth_receive_queue(dev, INT_MAX);
+#endif
if (eth_int_cause_ext & ETH_INT_CAUSE_TX)
mv643xx_eth_free_completed_tx_descs(dev);
-#endif
/*
* If no real interrupt occured, exit.
@@ -1186,7 +1192,12 @@ static int mv643xx_eth_start_xmit(struct
BUG_ON(netif_queue_stopped(dev));
BUG_ON(skb == NULL);
- BUG_ON(mp->tx_ring_size - mp->tx_desc_count < MAX_DESCS_PER_SKB);
+
+ if (mp->tx_ring_size - mp->tx_desc_count < MAX_DESCS_PER_SKB) {
+ printk(KERN_ERR "%s: transmit with queue full\n", dev->name);
+ netif_stop_queue(dev);
+ return 1;
+ }
if (has_tiny_unaligned_frags(skb)) {
if ((skb_linearize(skb, GFP_ATOMIC) != 0)) {
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 7826afb..9062775 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -238,7 +238,7 @@ static int full_duplex[MAX_UNITS];
#define NATSEMI_RX_LIMIT 2046 /* maximum supported by hardware */
/* These identify the driver base version and may not be removed. */
-static char version[] __devinitdata =
+static const char version[] __devinitdata =
KERN_INFO DRV_NAME " dp8381x driver, version "
DRV_VERSION ", " DRV_RELDATE "\n"
KERN_INFO " originally by Donald Becker <becker@scyld.com>\n"
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 56233af..448a094 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -1560,7 +1560,7 @@ static void ei_receive(struct net_device
static void ei_rx_overrun(struct net_device *dev)
{
- axnet_dev_t *info = (axnet_dev_t *)dev;
+ axnet_dev_t *info = PRIV(dev);
long e8390_base = dev->base_addr;
unsigned char was_txing, must_resend = 0;
struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 35dbf05..a70c2b0 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -78,6 +78,8 @@ static const struct pci_device_id skge_i
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE) },
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU) },
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T), },
+ { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) },
+ { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) },
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4320) },
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5005) }, /* Belkin */
{ PCI_DEVICE(PCI_VENDOR_ID_CNET, PCI_DEVICE_ID_CNET_GIGACARD) },
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 68f9c20..67b0eab 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -99,8 +99,6 @@ MODULE_PARM_DESC(disable_msi, "Disable M
static const struct pci_device_id sky2_id_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) },
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) },
- { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) },
- { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) },
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4340) },
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4341) },
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4342) },
@@ -579,8 +577,8 @@ static void sky2_mac_init(struct sky2_hw
reg = gma_read16(hw, port, GM_PHY_ADDR);
gma_write16(hw, port, GM_PHY_ADDR, reg | GM_PAR_MIB_CLR);
- for (i = 0; i < GM_MIB_CNT_SIZE; i++)
- gma_read16(hw, port, GM_MIB_CNT_BASE + 8 * i);
+ for (i = GM_MIB_CNT_BASE; i <= GM_MIB_CNT_END; i += 4)
+ gma_read16(hw, port, i);
gma_write16(hw, port, GM_PHY_ADDR, reg);
/* transmit control */
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 62532b4..89dd18c 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -1375,7 +1375,7 @@ enum {
GM_PHY_ADDR = 0x0088, /* 16 bit r/w GPHY Address Register */
/* MIB Counters */
GM_MIB_CNT_BASE = 0x0100, /* Base Address of MIB Counters */
- GM_MIB_CNT_SIZE = 256,
+ GM_MIB_CNT_END = 0x025C, /* Last MIB counter */
};
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index 45ad036..9b7805b 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -335,7 +335,7 @@ do { \
/* These identify the driver base version and may not be removed. */
-static char version[] __devinitdata =
+static const char version[] __devinitdata =
KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n"
KERN_INFO " (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n";
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index c1ce87a..d9258d4 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -134,7 +134,7 @@ static const int multicast_filter_limit
#include "typhoon.h"
#include "typhoon-firmware.h"
-static char version[] __devinitdata =
+static const char version[] __devinitdata =
"typhoon.c: version " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
MODULE_AUTHOR("David Dillow <dave@thedillows.org>");
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index a9b2150..6a23964 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -469,7 +469,7 @@ struct rhine_private {
struct sk_buff *tx_skbuff[TX_RING_SIZE];
dma_addr_t tx_skbuff_dma[TX_RING_SIZE];
- /* Tx bounce buffers */
+ /* Tx bounce buffers (Rhine-I only) */
unsigned char *tx_buf[TX_RING_SIZE];
unsigned char *tx_bufs;
dma_addr_t tx_bufs_dma;
@@ -1043,7 +1043,8 @@ static void alloc_tbufs(struct net_devic
rp->tx_ring[i].desc_length = cpu_to_le32(TXDESC);
next += sizeof(struct tx_desc);
rp->tx_ring[i].next_desc = cpu_to_le32(next);
- rp->tx_buf[i] = &rp->tx_bufs[i * PKT_BUF_SZ];
+ if (rp->quirks & rqRhineI)
+ rp->tx_buf[i] = &rp->tx_bufs[i * PKT_BUF_SZ];
}
rp->tx_ring[i-1].next_desc = cpu_to_le32(rp->tx_ring_dma);
@@ -1091,7 +1092,7 @@ static void rhine_check_media(struct net
}
/* Called after status of force_media possibly changed */
-void rhine_set_carrier(struct mii_if_info *mii)
+static void rhine_set_carrier(struct mii_if_info *mii)
{
if (mii->force_media) {
/* autoneg is off: Link is always assumed to be up */
^ permalink raw reply related
* Re: [PATCH] atm: clip causes unregister hang
From: Stephen Hemminger @ 2006-04-12 21:52 UTC (permalink / raw)
To: Herbert Xu, davem; +Cc: chas, linux-atm-general, netdev, stable
In-Reply-To: <20060412202551.GA20085@gondor.apana.org.au>
If Classical IP over ATM module is loaded, its neighbor table gets
populated when permanent neighbor entries are created; but these entries
are not flushed when the device is removed. Since the entry never gets
flushed the unregister of the network device never completes.
This version of the patch also adds locking around the reference to
the atm arp daemon to avoid races with events and daemon state changes.
(Note: barrier() was never really safe)
Bug-reference: http://bugzilla.kernel.org/show_bug.cgi?id=6295
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
--- clip.orig/net/atm/clip.c 2006-04-12 14:10:45.000000000 -0700
+++ clip/net/atm/clip.c 2006-04-12 14:21:41.000000000 -0700
@@ -613,12 +613,19 @@
static int clip_device_event(struct notifier_block *this,unsigned long event,
- void *dev)
+ void *arg)
{
+ struct net_device *dev = arg;
+
+ if (event == NETDEV_UNREGISTER) {
+ neigh_ifdown(&clip_tbl, dev);
+ return NOTIFY_DONE;
+ }
+
/* ignore non-CLIP devices */
- if (((struct net_device *) dev)->type != ARPHRD_ATM ||
- ((struct net_device *) dev)->hard_start_xmit != clip_start_xmit)
+ if (dev->type != ARPHRD_ATM || dev->hard_start_xmit != clip_start_xmit)
return NOTIFY_DONE;
+
switch (event) {
case NETDEV_UP:
DPRINTK("clip_device_event NETDEV_UP\n");
@@ -686,14 +693,12 @@
static void atmarpd_close(struct atm_vcc *vcc)
{
DPRINTK("atmarpd_close\n");
- atmarpd = NULL; /* assumed to be atomic */
- barrier();
- unregister_inetaddr_notifier(&clip_inet_notifier);
- unregister_netdevice_notifier(&clip_dev_notifier);
- if (skb_peek(&sk_atm(vcc)->sk_receive_queue))
- printk(KERN_ERR "atmarpd_close: closing with requests "
- "pending\n");
+
+ rtnl_lock();
+ atmarpd = NULL;
skb_queue_purge(&sk_atm(vcc)->sk_receive_queue);
+ rtnl_unlock();
+
DPRINTK("(done)\n");
module_put(THIS_MODULE);
}
@@ -714,7 +719,12 @@
static int atm_init_atmarp(struct atm_vcc *vcc)
{
- if (atmarpd) return -EADDRINUSE;
+ rtnl_lock();
+ if (atmarpd) {
+ rtnl_unlock();
+ return -EADDRINUSE;
+ }
+
if (start_timer) {
start_timer = 0;
init_timer(&idle_timer);
@@ -731,10 +741,7 @@
vcc->push = NULL;
vcc->pop = NULL; /* crash */
vcc->push_oam = NULL; /* crash */
- if (register_netdevice_notifier(&clip_dev_notifier))
- printk(KERN_ERR "register_netdevice_notifier failed\n");
- if (register_inetaddr_notifier(&clip_inet_notifier))
- printk(KERN_ERR "register_inetaddr_notifier failed\n");
+ rtnl_unlock();
return 0;
}
@@ -992,6 +999,8 @@
clip_tbl_hook = &clip_tbl;
register_atm_ioctl(&clip_ioctl_ops);
+ register_netdevice_notifier(&clip_dev_notifier);
+ register_inetaddr_notifier(&clip_inet_notifier);
#ifdef CONFIG_PROC_FS
{
@@ -1012,6 +1021,9 @@
remove_proc_entry("arp", atm_proc_root);
+ unregister_inetaddr_notifier(&clip_inet_notifier);
+ unregister_netdevice_notifier(&clip_dev_notifier);
+
deregister_atm_ioctl(&clip_ioctl_ops);
/* First, stop the idle timer, so it stops banging
^ permalink raw reply
* Re: kernel panic (on DHCP discover?) in sky2 driver of 2.6.17-rc1
From: Stephen Hemminger @ 2006-04-12 21:48 UTC (permalink / raw)
To: Guenther Thomsen; +Cc: John W. Linville, netdev
In-Reply-To: <200604121442.56750.gthomsen@bluearc.com>
You need this patch, which Jeff hasn't applied yet.
-----
Subject: sky2: crash when bringing up second port
Sky2 driver will oops referencing bad memory if used on
a dual port card. The problem is accessing past end of
MIB counter space.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
--- test-2.6.orig/drivers/net/sky2.c
+++ test-2.6/drivers/net/sky2.c
@@ -579,8 +579,8 @@ static void sky2_mac_init(struct sky2_hw
reg = gma_read16(hw, port, GM_PHY_ADDR);
gma_write16(hw, port, GM_PHY_ADDR, reg | GM_PAR_MIB_CLR);
- for (i = 0; i < GM_MIB_CNT_SIZE; i++)
- gma_read16(hw, port, GM_MIB_CNT_BASE + 8 * i);
+ for (i = GM_MIB_CNT_BASE; i <= GM_MIB_CNT_END; i += 4)
+ gma_read16(hw, port, i);
gma_write16(hw, port, GM_PHY_ADDR, reg);
/* transmit control */
--- test-2.6.orig/drivers/net/sky2.h
+++ test-2.6/drivers/net/sky2.h
@@ -1375,7 +1375,7 @@ enum {
GM_PHY_ADDR = 0x0088, /* 16 bit r/w GPHY Address Register */
/* MIB Counters */
GM_MIB_CNT_BASE = 0x0100, /* Base Address of MIB Counters */
- GM_MIB_CNT_SIZE = 256,
+ GM_MIB_CNT_END = 0x025C, /* Last MIB counter */
};
^ permalink raw reply
* kernel panic (on DHCP discover?) in sky2 driver of 2.6.17-rc1
From: Guenther Thomsen @ 2006-04-12 21:42 UTC (permalink / raw)
To: shemminger, John W. Linville; +Cc: netdev
I'm happy to report, that the version of the sky2 driver in 2.6.17-rc1
yields line rate at low CPU utilization (as determined using ttcp).
Unfortunately, it's not quite bug-free yet ;-}
When enabling the second interface (of the same network controller) the
kernel panics (perhaps during DHCP discovery?):
--8<--
[root@penguin1 ~]# ifup eth1
Determining IP information for eth1...Unable to handle kernel paging
request at ffffc20000014000 RIP:
<ffffffff811a3329>{sky2_mac_init+522}
PGD 13fc49067 PUD 13fc4a067 PMD 13fc4b067 PTE 0
Oops: 0000 [1] SMP
CPU 3os linked in: autofs4 sr_mod cdrom dm_mod button usb_storage
uhci_hcd 11BladeRunner_sk98lin #1
RIP: 0010:[<ffffffff811a3329>] <ffffffff811a68 RCX: 000000000000001e
RDX: 0000000000004008 RSI: ffffc20000010000 11 0000000000000fe0 R12:
0000000000001000
R13: ffff81013fae61a8 R14:
S: 010 DS: 0000 ES: 0000 CR0:
000000008005003b
CR2: ffffc20000014000fe40)
Stack: 0000000000001000 ffff81013fae6000 ffff81013fae6500
00000f1013fae6000
Call Trace: <ffffffff811a3e0c>{sky2_up+334} <ffffffff81
<ffffffff81144cf4>{sprintf+144}
<ffffffff8123b616>{inet_ioctl{s_ioctl+44}
<ffffffff81085703>{sys_ioctl+107}
<ffffffff81009a2ac_init+522} RSP <ffff81013487fd28>
CR2: ffffc20000014000
<0>Kerne
-->8--
or (2nd try):
--8<--
[root@penguin1 ~]# Unable to handle kernel paging request at
ffffc20000014000 RIP:
<ffffffff811a3329>{sky2_mac_init+522}
PGD 13fc49067 PUD 13fc4a067 PMD 13fc4b067 PTE 0
Oops: 0000 [1] SMP
CPU 2
Modules linked in: autofs4 sr_mod cdrom dm_mod button usb_storage
uhci_hcd ehci_hcd e752x_edac edac_mc shpcR: 00:[<ffffffff811a3329>]
<ffffffff811a3329>{sky2_mac_init+522}
RDX: 0000000000004008 RSI: ffffc20000010000 RDI: 0000000000000000
R1 0000000001000
R13: ffff81013f0511a8 R14: 0000000000000001 R15: 0000S0000 CR0:
000000008005003b
CR2: ffffc20000014000 CR3: 000000013425b000000000001000 ffff81013f051000
ffff81013f051500 0000000000000000
Call Trace: <ffffffff811a3e0c>{sky2_up+334}
<ffffffff811fea04>{dev_op844cf4>{sprintf+144}
<ffffffff8123b616>{inet_ioctl+74}
<fffffffff81085703>{ys_ioctl+107}
<ffffffff81009ac8>{tracesys+209}
+} RSP <ffff81013534fd28>
CR2: ffffc20000014000
<0>Kernel panic - n
-->8--
The kernel is vanilla 2.6.17-rc1, the sky2 driver was compiled into the
kernel. OS is RedHat Fedora Core 4. The kernel was compiled using
gcc32.
The system is a Blade of a BladeRunner 4130 of Penguincomputing, it
contains two Xeon CPU (+ HT enabled) and an on-board 8062 network
controller of Marvell (88E8062 is stamped on the chip).
The hardware seems to work fine using 2.6.15(.7) with the sk98lin driver
version 8.31 of Syskonnect (skd.de).
Please let me know, if I can provide further information or assist in
any other way.
best regards
Guenther
^ permalink raw reply
* Re: [PATCH] shutting down an interface should remove ipv4 addresses
From: Roberto Nibali @ 2006-04-12 21:38 UTC (permalink / raw)
To: David S. Miller; +Cc: koszik, netdev
In-Reply-To: <20060411.013503.04535700.davem@davemloft.net>
David S. Miller wrote:
> From: Matyas Koszik <koszik@atw.hu>
> Date: Tue, 11 Apr 2006 10:08:01 +0200 (CEST)
>
>> Then it maybe shouldn't affect the flow of packets while the
>> interface is down - or is it also something people depend on?
>
> Yes, people probably do depend upon it.
Not that my voice weights in too much, but I should like to note that
our network and firewall setup depends on this behaviour since the early
2.2.x kernel releases.
2-stage network setup (address assignment and link state) is very much
to our liking :). I would not be too thrilled to change that again.
Best regards,
Roberto Nibali, ratz
--
echo
'[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc
^ permalink raw reply
* Re: Window shrinking (was Linux v2.6.16-rc6)
From: Roberto Nibali @ 2006-04-12 21:24 UTC (permalink / raw)
To: Mark Butler; +Cc: andy.furniss, David S. Miller, michal.k.k.piotrowski, netdev
In-Reply-To: <443ABFE1.6030601@middle.net>
>>>> Thanks Mark, I guess packeteer closes window down properly, I
>>>> thought Dave's reply meant that doing that was Treason.
>>>
>>> Packeteer is almost certainly being cavalier about the way it reduces
>>> windows. It could be a serious problem, depending on the way it
>>> treats traffic on the return path. The "treason" thing is a joke.
>>> It is like a bank extending you a credit line one day, and revoking
>>> it the next.
>>
>> I don't use or know of anyone who uses Packeteer - or have you tested?
I had the distinct pleasure of partly get involved with debugging
network stalls related to Linux clients (2.6.x kernel) and a Packeteer.
>> to mean that it was illegal to close down a window at all - you
>> cleared that up - ie it is legal if you close it by <= the amount of
>> data that has just been acked. I assume this won't cause the Treason
>> messaage so don't really understand why it is cavalier - or do you
>> just mean the whole idea of window manipulation to shape may be dodgey
>> but legal?
>
> I thought that Packeteer was causing the error messages. If not then no
> problem. The "treason" messages will not occur if the window is reduced
> normally. The window is there for a reason - namely flow control. A
> zero rwnd means "I can't handle any more data right now". That is
> perfectly legal as long as previously granted transmit credit is not
> withdrawn. Generally speaking the rwnd always drops to zero when the
> receive buffer is full.
Regarding Packeteer traffic shaper and Linux TCP stacks:
A customer of ours has had significant problems with the packeteer
traffic shaper in the past. Unfortunately my consulting contract only
lasted so long as to point out the problem with the shaper in
conjunction with Linux clients, thus I cannot provide you with more
detailed information.
The setup at the customer side (ISP) was like follows: they had
installed a squid-proxy farm for their clients and used the Packeteer to
do some sort of micro-billing, shaping and general QoS. The problem of
window shrinking by the shaper affecting the client's performance
manifested itself most of the time when their customers were accessing a
site via that proxy-farm, which delivered its site-pictures using
content caching services like Akamai (a really horrible example for
testing squid's patience is, among others, http://www.pro-sieben.de).
This caused quite a burst of quick TCP connection setups and teardowns,
eventually resulting in a complete stall for 10-15s.
Disabling the Packeteer traffic shaper completely solved this issue and
customers were not experiencing any stalls anymore when surfing the net.
Updating the firmware of the shaper did help somewhat, so I suspect
their TCP window handling is also error-prone to some extend. So I went
on and blamed the Packeteer traffic shaper device. It was not until I
tested the whole setup with their pilot squid-farm based on Solaris
(SunOS 2.5.1) when I had to rethink my blaming, since routing their
customers over the Solaris squid proxies did not exhibit the problem
when enabling the traffic shaper for the same troublesome websites. So,
this again showed an indication towards an issue with Linux clients and
the Packeteer traffic shaper. The squid-farm is running on a SuSE 9.3
based kernel. Due to performance constraints we had to go with the Linux
solution and disable the traffic shaper.
As soon as I get some more consulting days and if the customer desires,
I'll be debugging this issue in greater detail. I will send a debug
report to netdev in this case. Chances are slim though, since they only
have one Packeteer so far and no test network to perform test conducts,
so erroneous tests would cause major downtime for a lot of this ISP's
customers.
My 2 cents,
Roberto Nibali, ratz
--
echo
'[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq' | dc
^ permalink raw reply
* Re: [patch] net/ieee80211: report hidden ESSIDs as zero-length, not "<hidden>"
From: John W. Linville @ 2006-04-12 21:04 UTC (permalink / raw)
To: Dan Williams; +Cc: netdev, Zhu Yi, James Ketrenos
In-Reply-To: <1143215843.3417.16.camel@localhost.localdomain>
On Fri, Mar 24, 2006 at 10:57:22AM -0500, Dan Williams wrote:
> <hidden> this is something that ieee80211 does that's completely wrong.
> Drivers need to report the _exact_ ESSID from the air in their scan
> results. It's up to the user space app to deal with ESSID length of 0.
What is the outcome of this? Did we get agreement on a patch?
John
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply
* Re: [PATCH] acxsm: Reduce the number of ACX_PACKED instructions
From: John W. Linville @ 2006-04-12 20:58 UTC (permalink / raw)
To: Carlos Martin; +Cc: netdev, Denis Vlasenko, acx100-devel
In-Reply-To: <11433168763687-git-send-email-carlos@cmartin.tk>
On Sat, Mar 25, 2006 at 09:01:16PM +0100, Carlos Martin wrote:
> Up to now, we were using ACX_PACKED after every field. I've finally
> found out how to use only one at the end of each struct whilst
> maintaining the typedef where it is now.
>
> This should also apply to acx with a bit of fuzz, but I consider it to
> be in maintenance mode, so this doesn't qualify for it.
>
> Signed-off-by: Carlos Martin <carlos@cmartin.tk>
>
> ---
>
> acx_struct.h | 874 +++++++++++++++++++++++++++++-----------------------------
> common.c | 26 +-
> ioctl.c | 10 -
> usb.c | 8 -
> 4 files changed, 457 insertions(+), 461 deletions(-)
>
> 5fb2fdfd8c028a40921bbf9ef7ec4c53c03fcab4
> diff --git a/acx_struct.h b/acx_struct.h
Denis, have you got this patch? Or do I need to apply it?
Carlos, please make your diffs from the root of the kernel tree.
Thanks,
John
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply
* [2.6 patch] net/xfrm/xfrm_state: unexport xfrm_state_mtu
From: Adrian Bunk @ 2006-04-12 20:54 UTC (permalink / raw)
To: netdev
This patch removes the unused EXPORT_SYMBOL(xfrm_state_mtu).
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.17-rc1-mm2-full/net/xfrm/xfrm_state.c.old 2006-04-12 22:38:57.000000000 +0200
+++ linux-2.6.17-rc1-mm2-full/net/xfrm/xfrm_state.c 2006-04-12 22:39:03.000000000 +0200
@@ -1152,8 +1152,6 @@
return res;
}
-EXPORT_SYMBOL(xfrm_state_mtu);
-
int xfrm_init_state(struct xfrm_state *x)
{
struct xfrm_state_afinfo *afinfo;
^ permalink raw reply
* Re: [2.6 patch] net/ipv4/: possible cleanups
From: David S. Miller @ 2006-04-12 20:54 UTC (permalink / raw)
To: bunk; +Cc: netdev
In-Reply-To: <20060412202225.GD6517@stusta.de>
From: Adrian Bunk <bunk@stusta.de>
Date: Wed, 12 Apr 2006 22:22:25 +0200
> Done.
I was eagerly awaiting this after seeing the wan drivers disappear.
Thanks Bunk-bot. :-)
^ permalink raw reply
* Re: [RFD][PATCH] typhoon and core sample for folding away VLAN stuff
From: David S. Miller @ 2006-04-12 20:51 UTC (permalink / raw)
To: greearb; +Cc: ioe-lkml, netdev, vda, dave, netdev, linux-kernel, jgarzik
In-Reply-To: <443D5E9E.80002@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
Date: Wed, 12 Apr 2006 13:10:06 -0700
> What is the reasoning for this change? Is the compiler
> able to optomize the right-hand-side to a constant with your
> change in place?
>
> > - if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) {
> > + if (veth->h_vlan_proto != htons(ETH_P_8021Q)) {
> > return -EINVAL;
> > }
As a policy, Ben, we only use __constant_htons() in compile
time initializers of data structures. Otherwise we use the
normal htons().
That's why.
^ permalink raw reply
* Re: [PATCH] atm: clip causes unregister hang
From: Herbert Xu @ 2006-04-12 20:25 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: davem, chas, linux-atm-general, netdev, stable
In-Reply-To: <20060412131527.71f42d58@localhost.localdomain>
On Wed, Apr 12, 2006 at 01:15:27PM -0700, Stephen Hemminger wrote:
>
> If atm_init_atmarp has not been done, then to_atamarpd is a nop because
> atmarpd == NULL.
Good point. But I don't see anything that will keep atmarpd from
closing the socket. Previously the unregister_notifier calls served
as sort of a barrier which prevented the close from proceeding until
we're out of the event handlers.
Now that thw unregister_notifier calls have been moved we need some
other way of ensuring that. Holding the RTNL should be enough.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [RFD][PATCH] typhoon and core sample for folding away VLAN stuff
From: Stephen Hemminger @ 2006-04-12 20:23 UTC (permalink / raw)
To: Ben Greear
Cc: Ingo Oeser, Ingo Oeser, Denis Vlasenko, Dave Dillow, netdev,
David S. Miller, linux-kernel, jgarzik
In-Reply-To: <443D5E9E.80002@candelatech.com>
On Wed, 12 Apr 2006 13:10:06 -0700
Ben Greear <greearb@candelatech.com> wrote:
> What is the reasoning for this change? Is the compiler
> able to optomize the right-hand-side to a constant with your
> change in place?
>
> > - if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) {
> > + if (veth->h_vlan_proto != htons(ETH_P_8021Q)) {
> > return -EINVAL;
> > }
Read the source, the macro handles it.
For i386:
htons maps to __cpu_to_be16
cpu_to_be16 maps to swab16 which is defined in swab.h
# define __swab16(x) \
(__builtin_constant_p((__u16)(x)) ? \
___swab16((x)) : \
__fswab16((x)))
^ permalink raw reply
* [2.6 patch] net/ipv4/: possible cleanups
From: Adrian Bunk @ 2006-04-12 20:22 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
In-Reply-To: <20060406.133857.40478787.davem@davemloft.net>
On Thu, Apr 06, 2006 at 01:38:57PM -0700, David S. Miller wrote:
> From: Adrian Bunk <bunk@stusta.de>
> Date: Thu, 6 Apr 2006 10:49:09 +0200
>
> > On Wed, Apr 05, 2006 at 10:25:43PM -0700, David S. Miller wrote:
> > > > - remove the following unused EXPORT_SYMBO's:
> > > > - devinet.c: devinet_ioctl
> > >
> > > Used by wan drivers, can't remove.
> >
> > Used only by drivers that:
> > - are marked as BROKEN since at least 2.6.0
> > - are removed in a maintainer-approved patch I sent before this one
>
> Then get the WAN drivers removed, once they are you can remove the
> export, but until then you can't.
Done.
cu
Adrian
<-- snip -->
This patch contains the following possible cleanups:
- make the following needlessly global function static:
- arp.c: arp_rcv()
- remove the following unused EXPORT_SYMBOL's:
- devinet.c: devinet_ioctl
- fib_frontend.c: ip_rt_ioctl
- inet_hashtables.c: inet_bind_bucket_create
- inet_hashtables.c: inet_bind_hash
- tcp_input.c: sysctl_tcp_abc
- tcp_ipv4.c: sysctl_tcp_tw_reuse
- tcp_output.c: sysctl_tcp_mtu_probing
- tcp_output.c: sysctl_tcp_base_mss
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
include/net/arp.h | 2 --
net/ipv4/arp.c | 4 ++--
net/ipv4/devinet.c | 1 -
net/ipv4/fib_frontend.c | 1 -
net/ipv4/inet_hashtables.c | 4 ----
net/ipv4/tcp_input.c | 1 -
net/ipv4/tcp_ipv4.c | 1 -
net/ipv4/tcp_output.c | 3 ---
8 files changed, 2 insertions(+), 15 deletions(-)
--- linux-2.6.16-mm2-full/include/net/arp.h.old 2006-04-04 00:17:55.000000000 +0200
+++ linux-2.6.16-mm2-full/include/net/arp.h 2006-04-04 00:18:01.000000000 +0200
@@ -10,8 +10,6 @@
extern struct neigh_table arp_tbl;
extern void arp_init(void);
-extern int arp_rcv(struct sk_buff *skb, struct net_device *dev,
- struct packet_type *pt, struct net_device *orig_dev);
extern int arp_find(unsigned char *haddr, struct sk_buff *skb);
extern int arp_ioctl(unsigned int cmd, void __user *arg);
extern void arp_send(int type, int ptype, u32 dest_ip,
--- linux-2.6.16-mm2-full/net/ipv4/arp.c.old 2006-04-04 00:18:10.000000000 +0200
+++ linux-2.6.16-mm2-full/net/ipv4/arp.c 2006-04-04 00:18:31.000000000 +0200
@@ -928,7 +928,8 @@
* Receive an arp request from the device layer.
*/
-int arp_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)
+static int arp_rcv(struct sk_buff *skb, struct net_device *dev,
+ struct packet_type *pt, struct net_device *orig_dev)
{
struct arphdr *arp;
@@ -1417,7 +1418,6 @@
EXPORT_SYMBOL(arp_broken_ops);
EXPORT_SYMBOL(arp_find);
-EXPORT_SYMBOL(arp_rcv);
EXPORT_SYMBOL(arp_create);
EXPORT_SYMBOL(arp_xmit);
EXPORT_SYMBOL(arp_send);
--- linux-2.6.16-mm2-full/net/ipv4/devinet.c.old 2006-04-04 00:46:22.000000000 +0200
+++ linux-2.6.16-mm2-full/net/ipv4/devinet.c 2006-04-04 00:46:31.000000000 +0200
@@ -1556,7 +1556,6 @@
#endif
}
-EXPORT_SYMBOL(devinet_ioctl);
EXPORT_SYMBOL(in_dev_finish_destroy);
EXPORT_SYMBOL(inet_select_addr);
EXPORT_SYMBOL(inetdev_by_index);
--- linux-2.6.16-mm2-full/net/ipv4/fib_frontend.c.old 2006-04-04 00:46:57.000000000 +0200
+++ linux-2.6.16-mm2-full/net/ipv4/fib_frontend.c 2006-04-04 00:47:05.000000000 +0200
@@ -667,4 +667,3 @@
EXPORT_SYMBOL(inet_addr_type);
EXPORT_SYMBOL(ip_dev_find);
-EXPORT_SYMBOL(ip_rt_ioctl);
--- linux-2.6.16-mm2-full/net/ipv4/inet_hashtables.c.old 2006-04-04 00:48:35.000000000 +0200
+++ linux-2.6.16-mm2-full/net/ipv4/inet_hashtables.c 2006-04-04 00:49:43.000000000 +0200
@@ -43,8 +43,6 @@
return tb;
}
-EXPORT_SYMBOL(inet_bind_bucket_create);
-
/*
* Caller must hold hashbucket lock for this tb with local BH disabled
*/
@@ -64,8 +62,6 @@
inet_csk(sk)->icsk_bind_hash = tb;
}
-EXPORT_SYMBOL(inet_bind_hash);
-
/*
* Get rid of any references to a local port held by the given sock.
*/
--- linux-2.6.16-mm2-full/net/ipv4/tcp_input.c.old 2006-04-04 00:50:56.000000000 +0200
+++ linux-2.6.16-mm2-full/net/ipv4/tcp_input.c 2006-04-04 00:51:03.000000000 +0200
@@ -4559,7 +4559,6 @@
EXPORT_SYMBOL(sysctl_tcp_ecn);
EXPORT_SYMBOL(sysctl_tcp_reordering);
-EXPORT_SYMBOL(sysctl_tcp_abc);
EXPORT_SYMBOL(tcp_parse_options);
EXPORT_SYMBOL(tcp_rcv_established);
EXPORT_SYMBOL(tcp_rcv_state_process);
--- linux-2.6.16-mm2-full/net/ipv4/tcp_ipv4.c.old 2006-04-04 00:51:38.000000000 +0200
+++ linux-2.6.16-mm2-full/net/ipv4/tcp_ipv4.c 2006-04-04 00:51:46.000000000 +0200
@@ -1858,5 +1858,4 @@
#endif
EXPORT_SYMBOL(sysctl_local_port_range);
EXPORT_SYMBOL(sysctl_tcp_low_latency);
-EXPORT_SYMBOL(sysctl_tcp_tw_reuse);
--- linux-2.6.16-mm2-full/net/ipv4/tcp_output.c.old 2006-04-04 00:52:13.000000000 +0200
+++ linux-2.6.16-mm2-full/net/ipv4/tcp_output.c 2006-04-04 00:52:32.000000000 +0200
@@ -59,9 +59,6 @@
int sysctl_tcp_mtu_probing = 0;
int sysctl_tcp_base_mss = 512;
-EXPORT_SYMBOL(sysctl_tcp_mtu_probing);
-EXPORT_SYMBOL(sysctl_tcp_base_mss);
-
static void update_send_head(struct sock *sk, struct tcp_sock *tp,
struct sk_buff *skb)
{
^ permalink raw reply
* Re: [PATCH] atm: clip causes unregister hang
From: Stephen Hemminger @ 2006-04-12 20:15 UTC (permalink / raw)
To: Herbert Xu; +Cc: davem, chas, linux-atm-general, netdev, stable
In-Reply-To: <20060412200015.GA19878@gondor.apana.org.au>
On Thu, 13 Apr 2006 06:00:15 +1000
Herbert Xu <herbert@gondor.apana.org.au> wrote:
> Hi Stephen:
>
> On Wed, Apr 12, 2006 at 12:45:33PM -0700, Stephen Hemminger wrote:
> >
> > /* ignore non-CLIP devices */
> > - if (((struct net_device *) dev)->type != ARPHRD_ATM ||
> > - ((struct net_device *) dev)->hard_start_xmit != clip_start_xmit)
> > + if (dev->type != ARPHRD_ATM || dev->hard_start_xmit != clip_start_xmit)
> > return NOTIFY_DONE;
>
> I think we need to check whether atm_init_atmarp has been done before
> passing this point. We also need to make sure that it doesn't get pulled
> out from under us while we're doing this.
>
> Cheers,
If atm_init_atmarp has not been done, then to_atamarpd is a nop because
atmarpd == NULL.
^ permalink raw reply
* Re: [RFD][PATCH] typhoon and core sample for folding away VLAN stuff
From: Ben Greear @ 2006-04-12 20:10 UTC (permalink / raw)
To: Ingo Oeser
Cc: Ingo Oeser, Denis Vlasenko, Dave Dillow, netdev, David S. Miller,
linux-kernel, jgarzik
In-Reply-To: <200604122132.46113.ioe-lkml@rameria.de>
What is the reasoning for this change? Is the compiler
able to optomize the right-hand-side to a constant with your
change in place?
> - if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) {
> + if (veth->h_vlan_proto != htons(ETH_P_8021Q)) {
> return -EINVAL;
> }
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: [PATCH] atm: clip causes unregister hang
From: Herbert Xu @ 2006-04-12 20:00 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: davem, chas, linux-atm-general, netdev, stable
In-Reply-To: <20060412124533.14e0c4ff@localhost.localdomain>
Hi Stephen:
On Wed, Apr 12, 2006 at 12:45:33PM -0700, Stephen Hemminger wrote:
>
> /* ignore non-CLIP devices */
> - if (((struct net_device *) dev)->type != ARPHRD_ATM ||
> - ((struct net_device *) dev)->hard_start_xmit != clip_start_xmit)
> + if (dev->type != ARPHRD_ATM || dev->hard_start_xmit != clip_start_xmit)
> return NOTIFY_DONE;
I think we need to check whether atm_init_atmarp has been done before
passing this point. We also need to make sure that it doesn't get pulled
out from under us while we're doing this.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* [PATCH] atm: clip causes unregister hang
From: Stephen Hemminger @ 2006-04-12 19:45 UTC (permalink / raw)
To: Herbert Xu; +Cc: davem, chas, linux-atm-general, netdev, stable
In-Reply-To: <E1FTjlM-00050V-00@gondolin.me.apana.org.au>
If Classical IP over ATM module is loaded, its neighbor table gets
populated when permanent neighbor entries are created; but these entries
are not flushed when the device is removed. Since the entry never gets
flushed the unregister of the network device never completes.
Bug-reference: http://bugzilla.kernel.org/show_bug.cgi?id=6295
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
--- linux-2.6.16.2.orig/net/atm/clip.c 2006-04-12 10:10:43.000000000 -0700
+++ linux-2.6.16.2/net/atm/clip.c 2006-04-12 11:22:47.000000000 -0700
@@ -613,12 +613,19 @@
static int clip_device_event(struct notifier_block *this,unsigned long event,
- void *dev)
+ void *arg)
{
+ struct net_device *dev = arg;
+
+ if (event == NETDEV_UNREGISTER) {
+ neigh_ifdown(&clip_tbl, dev);
+ return NOTIFY_DONE;
+ }
+
/* ignore non-CLIP devices */
- if (((struct net_device *) dev)->type != ARPHRD_ATM ||
- ((struct net_device *) dev)->hard_start_xmit != clip_start_xmit)
+ if (dev->type != ARPHRD_ATM || dev->hard_start_xmit != clip_start_xmit)
return NOTIFY_DONE;
+
switch (event) {
case NETDEV_UP:
DPRINTK("clip_device_event NETDEV_UP\n");
@@ -688,8 +695,7 @@
DPRINTK("atmarpd_close\n");
atmarpd = NULL; /* assumed to be atomic */
barrier();
- unregister_inetaddr_notifier(&clip_inet_notifier);
- unregister_netdevice_notifier(&clip_dev_notifier);
+
if (skb_peek(&sk_atm(vcc)->sk_receive_queue))
printk(KERN_ERR "atmarpd_close: closing with requests "
"pending\n");
@@ -731,10 +737,6 @@
vcc->push = NULL;
vcc->pop = NULL; /* crash */
vcc->push_oam = NULL; /* crash */
- if (register_netdevice_notifier(&clip_dev_notifier))
- printk(KERN_ERR "register_netdevice_notifier failed\n");
- if (register_inetaddr_notifier(&clip_inet_notifier))
- printk(KERN_ERR "register_inetaddr_notifier failed\n");
return 0;
}
@@ -992,6 +994,8 @@
clip_tbl_hook = &clip_tbl;
register_atm_ioctl(&clip_ioctl_ops);
+ register_netdevice_notifier(&clip_dev_notifier);
+ register_inetaddr_notifier(&clip_inet_notifier);
#ifdef CONFIG_PROC_FS
{
@@ -1012,6 +1016,9 @@
remove_proc_entry("arp", atm_proc_root);
+ unregister_inetaddr_notifier(&clip_inet_notifier);
+ unregister_netdevice_notifier(&clip_dev_notifier);
+
deregister_atm_ioctl(&clip_ioctl_ops);
/* First, stop the idle timer, so it stops banging
^ permalink raw reply
* Fw: [Bugme-new] [Bug 6378] New: bonding mode=1 does not always pick right primary interface
From: Andrew Morton @ 2006-04-12 19:45 UTC (permalink / raw)
To: netdev; +Cc: linux
Begin forwarded message:
Date: Wed, 12 Apr 2006 05:57:27 -0700
From: bugme-daemon@bugzilla.kernel.org
To: bugme-new@lists.osdl.org
Subject: [Bugme-new] [Bug 6378] New: bonding mode=1 does not always pick right primary interface
http://bugzilla.kernel.org/show_bug.cgi?id=6378
Summary: bonding mode=1 does not always pick right primary
interface
Kernel Version: 2.6.16
Status: NEW
Severity: normal
Owner: acme@conectiva.com.br
Submitter: linux@hrunting.org
Most recent kernel where this bug did not occur: 2.6.10
Distribution: Fedora Core 4
Hardware Environment: Dual P4 2.4GHz, dual onboard e1000 NICs, one unused e100
management NIC
Software Environment: FC4, 2.6.16-1.2069_FC4
Problem Description: Picking a primary interface does not always work
Steps to reproduce:
Configure /etc/modprobe.conf with lines like such:
alias eth0 e1000
alias eth1 e1000
alias bond0 bonding
options bond0 miimon=100 mode=1 primary=eth1
Reboot the box.
When the box comes up, it's using eth0 as the primary NIC and eth1 as a backup.
If you drop the connection on eth0 (I do this by shutting down a port on the
router), it fails over properly to eth1. If I then bring back up eth0, it stays
on eth0 correctly. Shutting down the port to eth1 fails over to eth0 properly.
Bringing back up the port for eth1 causes it to fail back over to eth1 properly.
So it looks like the primary mode is being set right, but isn't being
acknowledged or handled properly when the bond is first brought up.
I also have Opteron servers running this config and they do not seem to be
affected by this bug. It might be a timing issue on boot that affects Intel
systems more than Opterons, though. I've seen it once or twice on Opteron with
kernel 2.6.15. It's regularly reproducible with the Intel systems, though, with
both 2.6.15 and 2.6.16 FC4 kernels.
The relevant portions of lspci -v:
03:01.0 Ethernet controller: Intel Corporation 82541EI Gigabit Ethernet
Controller (Copper)
Subsystem: Intel Corporation: Unknown device 1213
Flags: bus master, 66Mhz, medium devsel, latency 64, IRQ 28
Memory at fd8c0000 (32-bit, non-prefetchable) [size=128K]
I/O ports at c400 [size=64]
Capabilities: [dc] Power Management version 2
Capabilities: [e4] PCI-X non-bridge device.
03:02.0 Ethernet controller: Intel Corporation 82541EI Gigabit Ethernet
Controller (Copper)
Subsystem: Intel Corporation: Unknown device 1213
Flags: bus master, 66Mhz, medium devsel, latency 64, IRQ 29
Memory at fd8e0000 (32-bit, non-prefetchable) [size=128K]
I/O ports at c800 [size=64]
Capabilities: [dc] Power Management version 2
Capabilities: [e4] PCI-X non-bridge device.
Relevant lines from dmesg (boot):
Ethernet Channel Bonding Driver: v3.0.1 (January 9, 2006)
bonding: MII link monitoring set to 100 ms
e1000: eth0: e1000_watchdog_task: NIC Link is Up 1000 Mbps Full Duplex
bonding: bond0: making interface eth0 the new active one.
bonding: bond0: enslaving eth0 as an active interface with an up link.
e1000: eth1: e1000_watchdog_task: NIC Link is Up 1000 Mbps Full Duplex
bonding: bond0: enslaving eth1 as a backup interface with an up link.
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
^ permalink raw reply
* [RFD][PATCH] typhoon and core sample for folding away VLAN stuff (was: Re: [PATCH] deinline a few large functions in vlan code v2)
From: Ingo Oeser @ 2006-04-12 19:32 UTC (permalink / raw)
To: Ingo Oeser
Cc: Denis Vlasenko, Dave Dillow, netdev, David S. Miller,
linux-kernel, jgarzik
In-Reply-To: <200604111517.37215.netdev@axxeo.de>
Hi Denis,
here is a sample patch for the vlan core and API plus
typhoon driver converted as example.
Just so you can see, what I meant with "No #if in control flow code."
I couldn't resist cleaning up the vlan core, while I'm at it.
Of course I can seperate this, if you want the pure unilining stuff only.
So I hope this style is clear enough that you can do the rest of
the conversion without any problems.
Dave Dillow: Is this style clean enough to have it in your driver?
This kind of changes are important, because bloat creeps in byte by byte
of unused features. So I really appreciate your work here Denis.
Regards
Ingo Oeser
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index c1ce87a..aab24b8 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -285,7 +285,9 @@ struct typhoon {
struct pci_dev * pdev;
struct net_device * dev;
spinlock_t state_lock;
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
struct vlan_group * vlgrp;
+#endif
struct basic_ring rxHiRing;
struct basic_ring rxBuffRing;
struct rxbuff_ent rxbuffers[RXENT_ENTRIES];
@@ -350,6 +352,19 @@ enum state_values {
#define TSO_OFFLOAD_ON 0
#endif
+
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+static inline struct vlan_group *typhoon_get_vlgrp(struct typhoon *tp)
+{
+ return tp->vlgrp;
+}
+#else
+static inline struct vlan_group *typhoon_get_vlgrp(struct typhoon *tp)
+{
+ return NULL;
+}
+#endif
+
static inline void
typhoon_inc_index(u32 *index, const int count, const int num_entries)
{
@@ -707,6 +722,7 @@ out:
return err;
}
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
static void
typhoon_vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
{
@@ -754,6 +770,12 @@ typhoon_vlan_rx_kill_vid(struct net_devi
tp->vlgrp->vlan_devices[vid] = NULL;
spin_unlock_bh(&tp->state_lock);
}
+#else
+
+#define typhoon_vlan_rx_register NULL
+#define typhoon_vlan_rx_kill_vid NULL
+
+#endif
static inline void
typhoon_tso_fill(struct sk_buff *skb, struct transmit_ring *txRing,
@@ -1686,6 +1708,7 @@ typhoon_rx(struct typhoon *tp, struct ba
struct rx_desc *rx;
struct sk_buff *skb, *new_skb;
struct rxbuff_ent *rxb;
+ struct vlan_group *vlgrp;
dma_addr_t dma_addr;
u32 local_ready;
u32 rxaddr;
@@ -1745,8 +1768,9 @@ typhoon_rx(struct typhoon *tp, struct ba
new_skb->ip_summed = CHECKSUM_NONE;
spin_lock(&tp->state_lock);
- if(tp->vlgrp != NULL && rx->rxStatus & TYPHOON_RX_VLAN)
- vlan_hwaccel_receive_skb(new_skb, tp->vlgrp,
+ vlgrp = typhoon_get_vlgrp(tp);
+ if(vlgrp != NULL && rx->rxStatus & TYPHOON_RX_VLAN)
+ vlan_hwaccel_receive_skb(new_skb, vlgrp,
ntohl(rx->vlanTag) & 0xffff);
else
netif_receive_skb(new_skb);
@@ -2233,7 +2257,7 @@ typhoon_suspend(struct pci_dev *pdev, pm
return 0;
spin_lock_bh(&tp->state_lock);
- if(tp->vlgrp && tp->wol_events & TYPHOON_WAKE_MAGIC_PKT) {
+ if(typhoon_get_vlgrp(tp) && tp->wol_events & TYPHOON_WAKE_MAGIC_PKT) {
spin_unlock_bh(&tp->state_lock);
printk(KERN_ERR "%s: cannot do WAKE_MAGIC with VLANS\n",
dev->name);
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index eef0876..4ed541f 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -14,6 +14,8 @@
#define _LINUX_IF_VLAN_H_
#ifdef __KERNEL__
+#define HAVE_VLAN_PUT_TAG
+#define HAVE_VLAN_GET_TAG
/* externally defined structs */
struct vlan_group;
@@ -119,79 +121,29 @@ struct vlan_dev_info {
struct net_device_stats dev_stats; /* Device stats (rx-bytes, tx-pkts, etc...) */
};
-#define VLAN_DEV_INFO(x) ((struct vlan_dev_info *)(x->priv))
-
-/* inline functions */
-
-static inline struct net_device_stats *vlan_dev_get_stats(struct net_device *dev)
-{
- return &(VLAN_DEV_INFO(dev)->dev_stats);
-}
-
-static inline __u32 vlan_get_ingress_priority(struct net_device *dev,
- unsigned short vlan_tag)
-{
- struct vlan_dev_info *vip = VLAN_DEV_INFO(dev);
-
- return vip->ingress_priority_map[(vlan_tag >> 13) & 0x7];
-}
-
/* VLAN tx hw acceleration helpers. */
struct vlan_skb_tx_cookie {
u32 magic;
u32 vlan_tag;
};
-#define VLAN_TX_COOKIE_MAGIC 0x564c414e /* "VLAN" in ascii. */
#define VLAN_TX_SKB_CB(__skb) ((struct vlan_skb_tx_cookie *)&((__skb)->cb[0]))
-#define vlan_tx_tag_present(__skb) \
- (VLAN_TX_SKB_CB(__skb)->magic == VLAN_TX_COOKIE_MAGIC)
+
#define vlan_tx_tag_get(__skb) (VLAN_TX_SKB_CB(__skb)->vlan_tag)
-/* VLAN rx hw acceleration helper. This acts like netif_{rx,receive_skb}(). */
-static inline int __vlan_hwaccel_rx(struct sk_buff *skb,
- struct vlan_group *grp,
- unsigned short vlan_tag, int polling)
-{
- struct net_device_stats *stats;
-
- skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK];
- if (skb->dev == NULL) {
- dev_kfree_skb_any(skb);
-
- /* Not NET_RX_DROP, this is not being dropped
- * due to congestion.
- */
- return 0;
- }
+#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
+#define VLAN_DEV_INFO(x) ((struct vlan_dev_info *)(x->priv))
+#define VLAN_REAL_DEV(x) (VLAN_DEV_INFO(x)->real_dev)
- skb->dev->last_rx = jiffies;
+#define VLAN_TX_COOKIE_MAGIC 0x564c414e /* "VLAN" in ascii. */
- stats = vlan_dev_get_stats(skb->dev);
- stats->rx_packets++;
- stats->rx_bytes += skb->len;
-
- skb->priority = vlan_get_ingress_priority(skb->dev, vlan_tag);
- switch (skb->pkt_type) {
- case PACKET_BROADCAST:
- break;
-
- case PACKET_MULTICAST:
- stats->multicast++;
- break;
-
- case PACKET_OTHERHOST:
- /* Our lower layer thinks this is not local, let's make sure.
- * This allows the VLAN to have a different MAC than the underlying
- * device, and still route correctly.
- */
- if (!memcmp(eth_hdr(skb)->h_dest, skb->dev->dev_addr, ETH_ALEN))
- skb->pkt_type = PACKET_HOST;
- break;
- };
- return (polling ? netif_receive_skb(skb) : netif_rx(skb));
-}
+#define vlan_tx_tag_present(__skb) \
+ (VLAN_TX_SKB_CB(__skb)->magic == VLAN_TX_COOKIE_MAGIC)
+
+
+int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
+ unsigned short vlan_tag, int polling);
static inline int vlan_hwaccel_rx(struct sk_buff *skb,
struct vlan_group *grp,
@@ -207,55 +159,7 @@ static inline int vlan_hwaccel_receive_s
return __vlan_hwaccel_rx(skb, grp, vlan_tag, 1);
}
-/**
- * __vlan_put_tag - regular VLAN tag inserting
- * @skb: skbuff to tag
- * @tag: VLAN tag to insert
- *
- * Inserts the VLAN tag into @skb as part of the payload
- * Returns a VLAN tagged skb. If a new skb is created, @skb is freed.
- *
- * Following the skb_unshare() example, in case of error, the calling function
- * doesn't have to worry about freeing the original skb.
- */
-static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short tag)
-{
- struct vlan_ethhdr *veth;
-
- if (skb_headroom(skb) < VLAN_HLEN) {
- struct sk_buff *sk_tmp = skb;
- skb = skb_realloc_headroom(sk_tmp, VLAN_HLEN);
- kfree_skb(sk_tmp);
- if (!skb) {
- printk(KERN_ERR "vlan: failed to realloc headroom\n");
- return NULL;
- }
- } else {
- skb = skb_unshare(skb, GFP_ATOMIC);
- if (!skb) {
- printk(KERN_ERR "vlan: failed to unshare skbuff\n");
- return NULL;
- }
- }
-
- veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN);
-
- /* Move the mac addresses to the beginning of the new header. */
- memmove(skb->data, skb->data + VLAN_HLEN, 2 * VLAN_ETH_ALEN);
-
- /* first, the ethernet type */
- veth->h_vlan_proto = __constant_htons(ETH_P_8021Q);
-
- /* now, the tag */
- veth->h_vlan_TCI = htons(tag);
-
- skb->protocol = __constant_htons(ETH_P_8021Q);
- skb->mac.raw -= VLAN_HLEN;
- skb->nh.raw -= VLAN_HLEN;
-
- return skb;
-}
-
+struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short tag);
/**
* __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting
* @skb: skbuff to tag
@@ -274,8 +178,6 @@ static inline struct sk_buff *__vlan_hwa
return skb;
}
-#define HAVE_VLAN_PUT_TAG
-
/**
* vlan_put_tag - inserts VLAN tag according to device features
* @skb: skbuff to tag
@@ -304,7 +206,7 @@ static inline int __vlan_get_tag(struct
{
struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data;
- if (veth->h_vlan_proto != __constant_htons(ETH_P_8021Q)) {
+ if (veth->h_vlan_proto != htons(ETH_P_8021Q)) {
return -EINVAL;
}
@@ -334,8 +236,6 @@ static inline int __vlan_hwaccel_get_tag
}
}
-#define HAVE_VLAN_GET_TAG
-
/**
* vlan_get_tag - get the VLAN ID from the skb
* @skb: skbuff to query
@@ -352,6 +252,41 @@ static inline int vlan_get_tag(struct sk
}
}
+#else
+
+#define VLAN_REAL_DEV(x) x
+#define vlan_tx_tag_present(__skb) 0
+
+static inline int vlan_hwaccel_rx(struct sk_buff *skb,
+ struct vlan_group *grp,
+ unsigned short vlan_tag)
+{
+ return netif_rx(skb);
+}
+
+static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb,
+ struct vlan_group *grp,
+ unsigned short vlan_tag)
+{
+ return netif_receive_skb(skb);
+}
+
+static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, unsigned short tag)
+{
+ return skb;
+}
+
+static inline int vlan_get_tag(struct sk_buff *skb, unsigned short *tag)
+{
+ *tag = 0;
+ return -EINVAL;
+}
+
+#endif /* defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) */
+
+
+
+
#endif /* __KERNEL__ */
/* VLAN IOCTLs are found in sockios.h */
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index da9cfe9..d7c4eb1 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -37,6 +37,21 @@
#include <linux/if_vlan.h>
#include <net/ip.h>
+/* inline functions */
+
+static inline struct net_device_stats *vlan_dev_get_stats(struct net_device *dev)
+{
+ return &(VLAN_DEV_INFO(dev)->dev_stats);
+}
+
+static inline __u32 vlan_get_ingress_priority(struct net_device *dev,
+ unsigned short vlan_tag)
+{
+ struct vlan_dev_info *vip = VLAN_DEV_INFO(dev);
+
+ return vip->ingress_priority_map[(vlan_tag >> 13) & 0x7];
+}
+
/*
* Rebuild the Ethernet MAC header. This is called after an ARP
* (or in future other address resolution) has completed on this
@@ -71,7 +86,7 @@ int vlan_dev_rebuild_header(struct sk_bu
return 0;
}
-static inline struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb)
+static struct sk_buff *vlan_check_reorder_header(struct sk_buff *skb)
{
if (VLAN_DEV_INFO(skb->dev)->flags & 1) {
if (skb_shared(skb) || skb_cloned(skb)) {
@@ -90,6 +105,104 @@ static inline struct sk_buff *vlan_check
return skb;
}
+/**
+ * __vlan_put_tag - regular VLAN tag inserting
+ * @skb: skbuff to tag
+ * @tag: VLAN tag to insert
+ *
+ * Inserts the VLAN tag into @skb as part of the payload
+ * Returns a VLAN tagged skb. If a new skb is created, @skb is freed.
+ *
+ * Following the skb_unshare() example, in case of error, the calling function
+ * doesn't have to worry about freeing the original skb.
+ */
+struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short tag)
+{
+ struct vlan_ethhdr *veth;
+
+ if (skb_headroom(skb) < VLAN_HLEN) {
+ struct sk_buff *sk_tmp = skb;
+ skb = skb_realloc_headroom(sk_tmp, VLAN_HLEN);
+ kfree_skb(sk_tmp);
+ if (!skb) {
+ printk(KERN_ERR "vlan: failed to realloc headroom\n");
+ return NULL;
+ }
+ } else {
+ skb = skb_unshare(skb, GFP_ATOMIC);
+ if (!skb) {
+ printk(KERN_ERR "vlan: failed to unshare skbuff\n");
+ return NULL;
+ }
+ }
+
+ veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN);
+
+ /* Move the mac addresses to the beginning of the new header. */
+ memmove(skb->data, skb->data + VLAN_HLEN, 2 * VLAN_ETH_ALEN);
+
+ /* first, the ethernet type */
+ veth->h_vlan_proto = __constant_htons(ETH_P_8021Q);
+
+ /* now, the tag */
+ veth->h_vlan_TCI = htons(tag);
+
+ skb->protocol = __constant_htons(ETH_P_8021Q);
+ skb->mac.raw -= VLAN_HLEN;
+ skb->nh.raw -= VLAN_HLEN;
+
+ return skb;
+}
+
+static void vlan_rx_common(struct sk_buff *skb, unsigned short vlan_tag)
+{
+ struct net_device_stats *stats;
+
+ stats = vlan_dev_get_stats(skb->dev);
+ stats->rx_packets++;
+ stats->rx_bytes += skb->len;
+
+ skb->priority = vlan_get_ingress_priority(skb->dev, vlan_tag);
+ switch (skb->pkt_type) {
+ case PACKET_BROADCAST:
+ break;
+
+ case PACKET_MULTICAST:
+ stats->multicast++;
+ break;
+
+ case PACKET_OTHERHOST:
+ /* Our lower layer thinks this is not local, let's make sure.
+ * This allows the VLAN to have a different MAC than the underlying
+ * device, and still route correctly.
+ */
+ if (!compare_ether_addr(eth_hdr(skb)->h_dest, skb->dev->dev_addr)) {
+ skb->pkt_type = PACKET_HOST;
+ break;
+ };
+}
+
+/* VLAN rx hw acceleration helper. This acts like netif_{rx,receive_skb}(). */
+int __vlan_hwaccel_rx(struct sk_buff *skb,
+ struct vlan_group *grp,
+ unsigned short vlan_tag, int polling)
+{
+ skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK];
+ if (skb->dev == NULL) {
+ dev_kfree_skb_any(skb);
+
+ /* Not NET_RX_DROP, this is not being dropped
+ * due to congestion.
+ */
+ return 0;
+ }
+
+
+ skb->dev->last_rx = jiffies;
+ vlan_rx_common(skb, vlan_tag);
+ return (polling ? netif_receive_skb(skb) : netif_rx(skb));
+}
+
/*
* Determine the packet's protocol ID. The rule here is that we
* assume 802.3 if the type field is short enough to be a length.
@@ -158,11 +271,6 @@ int vlan_skb_recv(struct sk_buff *skb, s
skb->dev->last_rx = jiffies;
- /* Bump the rx counters for the VLAN device. */
- stats = vlan_dev_get_stats(skb->dev);
- stats->rx_packets++;
- stats->rx_bytes += skb->len;
-
/* Take off the VLAN header (4 bytes currently) */
skb_pull_rcsum(skb, VLAN_HLEN);
@@ -184,42 +292,7 @@ int vlan_skb_recv(struct sk_buff *skb, s
return -1;
}
- /*
- * Deal with ingress priority mapping.
- */
- skb->priority = vlan_get_ingress_priority(skb->dev, ntohs(vhdr->h_vlan_TCI));
-
-#ifdef VLAN_DEBUG
- printk(VLAN_DBG "%s: priority: %lu for TCI: %hu (hbo)\n",
- __FUNCTION__, (unsigned long)(skb->priority),
- ntohs(vhdr->h_vlan_TCI));
-#endif
-
- /* The ethernet driver already did the pkt_type calculations
- * for us...
- */
- switch (skb->pkt_type) {
- case PACKET_BROADCAST: /* Yeah, stats collect these together.. */
- // stats->broadcast ++; // no such counter :-(
- break;
-
- case PACKET_MULTICAST:
- stats->multicast++;
- break;
-
- case PACKET_OTHERHOST:
- /* Our lower layer thinks this is not local, let's make sure.
- * This allows the VLAN to have a different MAC than the underlying
- * device, and still route correctly.
- */
- if (!compare_ether_addr(eth_hdr(skb)->h_dest, skb->dev->dev_addr)) {
- /* It is for our (changed) MAC-address! */
- skb->pkt_type = PACKET_HOST;
- }
- break;
- default:
- break;
- };
+ vlan_rx_common(skb, vlan_tag);
/* Was a VLAN packet, grab the encapsulated protocol, which the layer
* three protocols care about.
@@ -258,7 +331,7 @@ int vlan_skb_recv(struct sk_buff *skb, s
* won't work for fault tolerant netware but does for the rest.
*/
if (*(unsigned short *)rawp == 0xFFFF) {
- skb->protocol = __constant_htons(ETH_P_802_3);
+ skb->protocol = htons(ETH_P_802_3);
/* place it back on the queue to be handled by true layer 3 protocols.
*/
@@ -281,7 +354,7 @@ int vlan_skb_recv(struct sk_buff *skb, s
/*
* Real 802.2 LLC
*/
- skb->protocol = __constant_htons(ETH_P_802_2);
+ skb->protocol = htons(ETH_P_802_2);
/* place it back on the queue to be handled by upper layer protocols.
*/
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 3da9264..dec3495 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -879,10 +879,8 @@ static unsigned int ip_sabotage_out(unsi
if ((out->hard_start_xmit == br_dev_xmit &&
okfn != br_nf_forward_finish &&
okfn != br_nf_local_out_finish && okfn != br_nf_dev_queue_xmit)
-#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
|| ((out->priv_flags & IFF_802_1Q_VLAN) &&
- VLAN_DEV_INFO(out)->real_dev->hard_start_xmit == br_dev_xmit)
-#endif
+ VLAN_REAL_DEV(out)->hard_start_xmit == br_dev_xmit)
) {
struct nf_bridge_info *nf_bridge;
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox