Bug #22

RealTek 8169S/8110S support.

Added by dragonfly almost 9 years ago. Updated about 8 years ago.

Status:ClosedStart date:
Priority:LowDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Matthew Dillon wrote:
>
> Do a boot -v and report which MII driver is currently attaching
> to the RE ethernet. It's probably the generic driver (ukphy), in
> which case we will need to port rgephy.c from FreeBSD to DragonFly.
>
> FreeBSD: sys/dev/mii/rge*
> DragonFly: sys/dev/netif/mii_layer/rge*
>
> There is some fairly minor porting work that needs to be done,
> which you can look at by looking at the cvs log history for some
> of the other MII source modules in DragonFly.
>
> -Matt

Please find attached my attempt to import support for the RealTek
8169S/8110S from FreeBSD. This supports my DLink 528(T) Card. Could
someone please review/test? The patch is against HEAD. I ran into two
main issues.

DragonFly is missing a mii_phy_update() function so I wrote an
rge_phy_update() replacement. I'm not sure this is 100% correct.

The card would not auto-negotiate a 1Gbit connection. I increased the
auto-negotiation interval to 17 seconds from five which solved the
problem. There was PR report with this problem and solution for re(4)
and a Cisco switch but I can no longer find the link.

I can see why the cards are $12. I'm slightly disappointed that two of
these cards back to back only manage ~150Mbit/s but it's an improvement
over my built-in vr0.

Regards

G.Allan

ifconfig re0
re0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
options=1b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING>
inet6 fe80::213:46ff:fe2f:5a8e%re0 prefixlen 64 scopeid 0x3
ether 00:13:46:2f:5a:8e
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active

dmesg | grep miibus2
miibus2: <MII bus> on re0
rgephy0: <RTL8169S/8110S media interface> on miibus2

rgephy.diff Magnifier (25.8 KB) dragonfly, 12/23/2005 09:22 PM

History

#1 Updated by sepherosa almost 9 years ago

On 12/24/05, Gary Allan <> wrote:
> Matthew Dillon wrote:
> >
> > Do a boot -v and report which MII driver is currently attaching
> > to the RE ethernet. It's probably the generic driver (ukphy), in
> > which case we will need to port rgephy.c from FreeBSD to DragonFly.
> >
> > FreeBSD: sys/dev/mii/rge*
> > DragonFly: sys/dev/netif/mii_layer/rge*
> >
> > There is some fairly minor porting work that needs to be done,
> > which you can look at by looking at the cvs log history for some
> > of the other MII source modules in DragonFly.
> >
> > -Matt
>
> Please find attached my attempt to import support for the RealTek
> 8169S/8110S from FreeBSD. This supports my DLink 528(T) Card. Could
> someone please review/test? The patch is against HEAD. I ran into two

I have merged the missing inclusion of if_rereg.h in into following
updated patch:
http://leaf.dragonflybsd.org/~sephe/rgephy1.diff

If you have time, please test it

> main issues.
>
> DragonFly is missing a mii_phy_update() function so I wrote an
> rge_phy_update() replacement. I'm not sure this is 100% correct.
>
> The card would not auto-negotiate a 1Gbit connection. I increased the
> auto-negotiation interval to 17 seconds from five which solved the

I still use 5 sec as interval value in the updated patch. It works
fine with my TP-Link 1000M switch. Pleae let me know if it does not
work for your re(4)

> problem. There was PR report with this problem and solution for re(4)
> and a Cisco switch but I can no longer find the link.
>
> I can see why the cards are $12. I'm slightly disappointed that two of
> these cards back to back only manage ~150Mbit/s but it's an improvement
> over my built-in vr0.

I have those pooool vr(4)s too -_-

>
> Regards
>
> G.Allan

Best Regards,
sephe

#2 Updated by dragonfly almost 9 years ago

Sepherosa Ziehau wrote:
>
> I have merged the missing inclusion of if_rereg.h in into following
> updated patch:
> http://leaf.dragonflybsd.org/~sephe/rgephy1.diff
>
> If you have time, please test it
>
>On 12/24/05, Gary Allan wrote:
>>main issues.
>>
>>DragonFly is missing a mii_phy_update() function so I wrote an
>>rge_phy_update() replacement. I'm not sure this is 100% correct.
>>
>>The card would not auto-negotiate a 1Gbit connection. I increased the
>>auto-negotiation interval to 17 seconds from five which solved the
>>problem.
>
> I still use 5 sec as interval value in the updated patch. It works
> fine with my TP-Link 1000M switch. Pleae let me know if it does not
> work for your re(4)
>
>

I've installed and tested your patch and everything is working as
expected. I have two RealTek 8169S cards connected via a crossover cable
and have not been able to reproduce the auto-negotiation issues I was
experiencing previously with my patch. (At 5 seconds the negotiation
process would restart before it had a chance to complete causing a loop.)

I've found the links to the commits that change the auto-negotiation
timeout to 17 seconds for gigE cards. This is the setting used by other
gigE drivers such as nsgphy.c and is why I tried this value.

nsgphy.c Revision 1.1.2.2
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/mii/nsgphy.c

Minimal patch to get NetGear622 talking to cisco gigE switches.

mii_physubr.c Revision 1.16
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/mii/mii_physubr.c

Increase gigE negotiation timeout to 17 seconds.

10 seconds is not enough to negotiate a gigE link with a cisco switch
which holds carrier off for several seconds between tries.

Regards

G.Allan

#3 Updated by corecode almost 9 years ago

committed by sephe

Also available in: Atom PDF