Bridge not functional after disconnect / connect
Subsystems (2)
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 <[email protected]>
To: Alex Shnitman <[email protected]>
Cc: [email protected]
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
<[email protected]>
Quoted 1 line · wrote:
Hi,
Quoted 2 lines
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".
Quoted 2 lines
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.
Quoted 2 lines
Any
idea
at
all
why
I
see
this
behavior?
Any
tips
as
to
how
I
might
debug
it?
Quoted 2 lines
The
kernel
I'm
running
is
2.6.18
from
Debian
Etch.
What
hardware?
There
were
many
fixes
since
that
old
kernel.
Signature · 11 lines
Stephen Hemminger <[email protected]> ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
Quoted 1 line · Alex Shnitman
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.
Signature · 3 lines
Malcolm Scott Research Assistant University of Cambridge Computer Laboratory
There were some fixes to carrier handling that went into 2.6.24.
commit 21d7f67700ad7a4523d35d43ce95755e40eae5b7
Author: Stephen Hemminger <[email protected]> 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
drivers/net/skge.c +12 -7
@@ -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);