Alex Shnitman
2008-Jan-30 14:15 UTC
[Bridge] Bridge not functional after disconnect / connect
Hi, I have two NICs on my machine, one connected to a router and is always up, and the other connected back-to-back to a laptop, and this one I disconnect and connect all the time. I created a bridge on top of these two interfaces, and it functions fine, except when I disconnect and connect the laptop, I have to remove it from the bridge and add it back before it starts bridging! In other words, I need to do "brctl delif br0 eth0; brctl addif br0 eth0". The output of "brctl showmacs br0" and "brctl showstp br0" looks the same and perfectly correct before the removal/adding and after it. From playing around with Wireshark it seems to me that before delif/addif only broadcasts are received from the laptop; unicast packets do not appear there. I got all zeros in /proc/sys/net/bridge/*. It looks like everything is configured correctly. Any idea at all why I see this behavior? Any tips as to how I might debug it? The kernel I'm running is 2.6.18 from Debian Etch. Please, if any more information is required, let me know. I don't want to spam the list with long dumps of everything if it's not needed. Thanks in advance, --Alex ____________________________________________________________________________________ Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
Stephen Hemminger
2008-Jan-30 14:23 UTC
[Bridge] Bridge not functional after disconnect / connect
On Wed, 30 Jan 2008 14:15:11 -0800 (PST) Alex Shnitman <alexta69@yahoo.com> wrote:> Hi, > > I have two NICs on my machine, one connected to a router and is always up, and the other connected back-to-back to a laptop, and this one I disconnect and connect all the time. I created a bridge on top of these two interfaces, and it functions fine, except when I disconnect and connect the laptop, I have to remove it from the bridge and add it back before it starts bridging! In other words, I need to do "brctl delif br0 eth0; brctl addif br0 eth0". > > The output of "brctl showmacs br0" and "brctl showstp br0" looks the same and perfectly correct before the removal/adding and after it. From playing around with Wireshark it seems to me that before delif/addif only broadcasts are received from the laptop; unicast packets do not appear there. I got all zeros in /proc/sys/net/bridge/*. It looks like everything is configured correctly. > > Any idea at all why I see this behavior? Any tips as to how I might debug it? > > The kernel I'm running is 2.6.18 from Debian Etch.What hardware? There were many fixes since that old kernel. -- Stephen Hemminger <stephen.hemminger@vyatta.com>
Alex Shnitman
2008-Jan-31 00:45 UTC
[Bridge] Bridge not functional after disconnect / connect
Hi, lspci gives this: 02:05.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller (rev 13) 02:09.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10) The first one is the one having the trouble. Is this hardware known to be problematic? Thanks, --Alex ----- Original Message ---- From: Stephen Hemminger <shemminger@linux-foundation.org> To: Alex Shnitman <alexta69@yahoo.com> Cc: bridge@lists.linux-foundation.org Sent: Thursday, January 31, 2008 12:22:22 AM Subject: Re: [Bridge] Bridge not functional after disconnect / connect On Wed, 30 Jan 2008 14:15:11 -0800 (PST) Alex Shnitman <alexta69@yahoo.com> wrote:>Hi,> >I have two NICs on my machine, one connected to a router and is always up, and the other connected back-to-back to a laptop, and this one I disconnect and connect all the time. I created a bridge on top of these two interfaces, and it functions fine, except when I disconnect and connect the laptop, I have to remove it from the bridge and add it back before it starts bridging! In other words, I need to do "brctl delif br0 eth0; brctl addif br0 eth0".> >The output of "brctl showmacs br0" and "brctl showstp br0" looks the same and perfectly correct before the removal/adding and after it.>Fromplaying around with Wireshark it seems to me that before delif/addif only broadcasts are received from the laptop; unicast packets do not appear there. I got all zeros in /proc/sys/net/bridge/*. It looks like everything is configured correctly.> >Any idea at all why I see this behavior? Any tips as to how I might debug it?> >The kernel I'm running is 2.6.18 from Debian Etch. What hardware? There were many fixes since that old kernel. -- Stephen Hemminger <stephen.hemminger@vyatta.com> ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
Malcolm Scott
2008-Jan-31 01:59 UTC
[Bridge] Bridge not functional after disconnect / connect
At 00:44 today, Alex Shnitman wrote:> 02:05.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller (rev 13)Is that the sky2 driver? That is in my experience pretty buggy until about 2.6.22. -- Malcolm Scott Research Assistant University of Cambridge Computer Laboratory
Alex Shnitman
2008-Jan-31 03:31 UTC
[Bridge] Bridge not functional after disconnect / connect
In fact, it's the skge driver. I'll try to upgrade the kernel to 2.6.22 (the latest one available in etch backports) and report the results. Thanks, --Alex ----- Original Message ---- From: Malcolm Scott <Malcolm.Scott@cl.cam.ac.uk> To: Alex Shnitman <alexta69@yahoo.com> Cc: Stephen Hemminger <shemminger@linux-foundation.org>; bridge@lists.linux-foundation.org Sent: Thursday, January 31, 2008 11:59:34 AM Subject: Re: [Bridge] Bridge not functional after disconnect / connect At 00:44 today, Alex Shnitman wrote:>02:05.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller (rev 13) Is that the sky2 driver? That is in my experience pretty buggy until about 2.6.22. -- Malcolm Scott Research Assistant University of Cambridge Computer Laboratory ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs
Stephen Hemminger
2008-Jan-31 08:50 UTC
[Bridge] Bridge not functional after disconnect / connect
There were some fixes to carrier handling that went into 2.6.24. commit 21d7f67700ad7a4523d35d43ce95755e40eae5b7 Author: Stephen Hemminger <shemminger@linux-foundation.org> Date: Mon Nov 26 11:54:51 2007 -0800 skge: fiber link up/down fix The driver would not work over fibre if other end when down then came back up (would require reloading driver). The correct way to manage the link the same way for both TP and fibre. Resloves problem described in: http://lkml.org/lkml/2007/11/6/395 Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org> diff --git a/drivers/net/skge.c b/drivers/net/skge.c index b680cb0..73a4246 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c @@ -1095,16 +1095,9 @@ static void xm_link_down(struct skge_hw *hw, int port) { struct net_device *dev = hw->dev[port]; struct skge_port *skge = netdev_priv(dev); - u16 cmd = xm_read16(hw, port, XM_MMU_CMD); xm_write16(hw, port, XM_IMSK, XM_IMSK_DISABLE); - cmd &= ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX); - xm_write16(hw, port, XM_MMU_CMD, cmd); - - /* dummy read to ensure writing */ - xm_read16(hw, port, XM_MMU_CMD); - if (netif_carrier_ok(dev)) skge_link_down(skge); } @@ -1194,6 +1187,7 @@ static void genesis_init(struct skge_hw *hw) static void genesis_reset(struct skge_hw *hw, int port) { const u8 zero[8] = { 0 }; + u32 reg; skge_write8(hw, SK_REG(port, GMAC_IRQ_MSK), 0); @@ -1209,6 +1203,11 @@ static void genesis_reset(struct skge_hw *hw, int port) xm_write16(hw, port, PHY_BCOM_INT_MASK, 0xffff); xm_outhash(hw, port, XM_HSM, zero); + + /* Flush TX and RX fifo */ + reg = xm_read32(hw, port, XM_MODE); + xm_write32(hw, port, XM_MODE, reg | XM_MD_FTF); + xm_write32(hw, port, XM_MODE, reg | XM_MD_FRF); } @@ -1714,6 +1713,12 @@ static void genesis_stop(struct skge_port *skge) struct skge_hw *hw = skge->hw; int port = skge->port; unsigned retries = 1000; + u16 cmd; + + /* Disable Tx and Rx */ + cmd = xm_read16(hw, port, XM_MMU_CMD); + cmd &= ~(XM_MMU_ENA_RX | XM_MMU_ENA_TX); + xm_write16(hw, port, XM_MMU_CMD, cmd); genesis_reset(hw, port);