Link up problem between 1000base-SX(bge) and SUN

Hideki Yamamoto yamamoto436 at oki.com
Mon Dec 29 02:29:31 PST 2003


Hello again,

Thank you for your reply.

From: Olaf Hoyer <ohoyer at gaff.hhhr.ision.net>
Message-ID: <20031229100720.X65076 at gaff.hhhr.ision.net>

> On Mon, 29 Dec 2003, Hideki Yamamoto wrote:
> 
> >
> > Hello,
> >
> > I'm having a problem about link up between 1000base-SX(bge) and SUN.
> >
> > I tried yesterday's 4.9-stable on a FreeBSD box with two 3COM
> > 3C996-SXs and two onboard BMC5703 chips.  Two 3COM 3C996-SX board link
> > went up, but the other side, a 1000base-SX I/F on SUN F280 did not go
> > up.  When doing ping command to SUN from FreeBSD box, LED on 3C996
> > were brinking but nothing happened to SUN board.  I changed bge0 to
> > bge2, but the situation was the same.  Hardware diagram is as follows.
> > bge0 can send or receive packates to the router or another PC with
> > intel SX board.
> >
> > Is this related to AUTO negotiation?
> 
> Hi!
> 
> Sometimes SUN cards are a bit picky.
> But, lets start gathering additional data:
> 
> I assume you have a ge-card in, or which card are you using in the 280?
> The man page says that autoneg is performed, but chooses :

Yes, I have three 'ge' cards in one F280R. 

> <quote from ge(7D)>
> The GEM PCS is capable of performing  auto-negotiation
>      using the remote (or link partner) link end and receives the
>      capabilities
>       of the remote end. It selects the  highest common demonina-
>      tor  mode  of  operation  based on priorities. The ge driver
>      also supports forced-mode operation under which  the  driver
>      selects the mode of operation
> 
> </quote>
> 
> 
> I assume that the interface is plumbed, and shows up in ifconfig as
> well, could you also post the snippet of the ifconfig entry?

The machine is in a data center now.  I cannot type ifconfig now.

> > I cannot find any parameters about AUTO negotiation in 'bge' driver
> > source.  I checked Linux 2.4.22 kernel source and have found the
> > several code about auto negotiation.  I wonder if a linux box works
> > well.  I do not need full support of auto negotiation, but sample code
> > that handles auto negotiation with Solaris machine.
> 
> in bge(4) it is stated, that the bge's also support autoneg over a
> cross-cable-config (which this basically is).
> But: have a look at the link0 option there (can be adjusted via
> ifconfig) normally, autoneg shall do, but over a cross-cable you need to
> designate one end being master, other end being slave.
> 
> My suspicion is, that autoneg procedure somewhere fails, and you should
> try to set the bge to be link master.
> 

Thank you for your advice.

I am reading both FreeBSD and Linux driver.  
The following seems the definition of link master of Linux kernel
source code in 'tg3.h'.
--------------
|/* Tigon3 specific PHY MII registers. */
|#define  TG3_BMCR_SPEED1000		0x0040
|
|#define MII_TG3_CTRL			0x09 /* 1000-baseT control register */
|#define  MII_TG3_CTRL_ADV_1000_HALF	0x0100
|#define  MII_TG3_CTRL_ADV_1000_FULL	0x0200
|#define  MII_TG3_CTRL_AS_MASTER		0x0800
|#define  MII_TG3_CTRL_ENABLE_AS_MASTER	0x1000
--------------

In 'tg3.c', the following code seems to set the link master.
------------------------------------------
|		if (tp->link_config.advertising &
|		    (ADVERTISED_1000baseT_Half | ADVERTISED_1000baseT_Full)) {
|			new_adv = 0;
|			  -
|			  -
|			if (!(tp->tg3_flags & TG3_FLAG_10_100_ONLY) &&
|			    (tp->pci_chip_rev_id == CHIPREV_ID_5701_A0 ||
|			     tp->pci_chip_rev_id == CHIPREV_ID_5701_B0))
|				new_adv |= (MII_TG3_CTRL_AS_MASTER |
|					    MII_TG3_CTRL_ENABLE_AS_MASTER);
|			tg3_writephy(tp, MII_TG3_CTRL, new_adv);
|			  -
|			  -
|		}
------------------------------------------

In 'if_bge.c' in FreeBSD kernel, the following function seems problem,
because it checks only IFM_1000_TX.  I feel that IFM_1000_SX also have
to be checked.

I have another strange thing about 'dmesg' I showed in the original
mail.  Both bge0 and bge1 which specifiy SX cards did not have miibus
or PHY in dmesg. 

Is this related to the link-up problem?

------------------------------------------
|static void
|bge_miibus_statchg(dev)
|	device_t dev;
|{
|	struct bge_softc *sc;
|	struct mii_data *mii;
|
|	sc = device_get_softc(dev);
|	mii = device_get_softc(sc->bge_miibus);
|
|	BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_PORTMODE);
|	if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_TX) {
|		BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_GMII);
|	} else {
|		BGE_SETBIT(sc, BGE_MAC_MODE, BGE_PORTMODE_MII);
|	}
|
|	if ((mii->mii_media_active & IFM_GMASK) == IFM_FDX) {
|		BGE_CLRBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX);
|	} else {
|		BGE_SETBIT(sc, BGE_MAC_MODE, BGE_MACMODE_HALF_DUPLEX);
|	}
|
|	return;
|}
----------------------
> Just my 0.02 EUR
> -- 
> Olaf Hoyer        ohoyer at gaff.hhhr.ision.net
> Fuerchterliche Erlebniss geben zu raten,
> ob der, welcher sie erlebt, nicht etwas Fuerchterliches ist.
> (Nietzsche, Jenseits von Gut und Boese)

Regards,

Hideki Yamammoto
-----------------------------------------------------------------
Hideki YAMAMOTO 		     |
Broadband Media Solutions Department | E-mail: yamamoto436 at oki.com
Broadband Media Company		     | Tel: +81-3-3455-0870
Oki Electric Industry Co., Ltd.      | FAX: +81-3-3798-7670 



More information about the freebsd-hardware mailing list