Bug 225325 - RealTek 8169 network devices don't seem to work with memory mapped registers
Summary: RealTek 8169 network devices don't seem to work with memory mapped registers
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-19 18:56 UTC by aaron.styx
Modified: 2024-09-30 12:14 UTC (History)
2 users (show)

See Also:


Attachments
re 8169 fix (419 bytes, patch)
2018-01-19 18:58 UTC, aaron.styx
no flags Details | Diff
/var/log/messages re1 output (1.88 KB, text/plain)
2018-01-23 11:37 UTC, aaron.styx
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description aaron.styx 2018-01-19 18:56:32 UTC
I came across a RealTek network device (device id 0x8169) that doesn't work with memory mapped registers. Reverting to using IO space as is already being done for the 8169SC (0x8167) devices solved the problem. Patch is attached.
Comment 1 aaron.styx 2018-01-19 18:58:11 UTC
Created attachment 189913 [details]
re 8169 fix
Comment 2 Marius Strobl freebsd_committer freebsd_triage 2018-01-22 22:06:45 UTC
(In reply to aaron.styx from comment #1)

Unfortunately, RT_DEVICEID_8169 is rather broad and there definitely are
members of that family which are know to work just fine when using the
SYS_RES_MEMORY-type BAR. What are the exact chip and MAC revisions as
reported in the re(4) attach message that is failing for you? Please post
all lines emitted by re(4) during attach so we also see all resources
assigned.
Also what exactly do you mean by "doesn't work"? In case this is an add-on
card, have you tried it in a different kind of machine?
Comment 3 aaron.styx 2018-01-23 11:37:17 UTC
Created attachment 189996 [details]
/var/log/messages re1 output

After submitting the bug, I did some digging and saw how common this chip is, so I would agree that simply forcing all of them to use IO mapped registers is not the right solution. The attached is the relevant output of /var/log/messages. (Note that this is from a 10.1 Live CD). 

I clearly need to do some more testing with this. I'll try this card in a different machine, and I'd also like to compile with RE_DIAG to see if this is simply a known problem with this device, but that will take me a bit. I'm not sure if the 10.1 live cd build is compiled with this or not...

As for the meaning of "doesn't work," I'm able to set the address and bring the device up with ifconfig, which reports the device is up and active. However, any attempts to ping another host on the network results in 'sendto: Host is down.' Wireshark shows no packets coming from the 1869 re device. 

Other network devices on this machine work as expected, so I know it's not a network issue. Setting hw.re.prefer_iomap=1 also works. The device works on Linux in this machine, though I haven't taken a close look at their driver yet, or figured out if they're using Memory or IO mapped registers.
Comment 4 aaron.styx 2018-01-24 12:56:20 UTC
Tested this card on an older machine and it worked fine with memory mapped registers. The problem system is with an Asus p8h67-m pro. Investigation ongoing...
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2024-09-28 00:29:24 UTC
^Triage: clear the now obsolete 'patch' keyword.

To submitter: is this aging PR still relevant?
Comment 6 aaron.styx 2024-09-30 12:09:04 UTC
(In reply to Mark Linimon from comment #5)
No, I never was able to figure out why this card/motherboard combination had a problem, and I have a local configuration workaround in case I ever need to use it again. I've not seen the issue anywhere else, so if nobody else has encountered this, I'd say the bug can be closed.
Comment 7 Mark Linimon freebsd_committer freebsd_triage 2024-09-30 12:14:43 UTC
^Triage: apparently particular to one hardware setup.