Subject: kern/33763: Realtek 8168B doesn't function
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <dieter.r@pandora.be>
List: netbsd-bugs
Date: 06/18/2006 21:05:00
>Number:         33763
>Category:       kern
>Synopsis:       Realtek 8168B doesn't function
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 18 21:05:00 +0000 2006
>Originator:     dieter roelants
>Release:        NetBSD 3.99.21
>Organization:
>Environment:
System: NetBSD simult.amelgem.be 3.99.21 NetBSD 3.99.21 (GENERIC.MPACPI) #2: Sun Jun 18 17:49:44 UTC 2006 dieter@simult.amelgem.be:/build/obj.current.i386/sys/arch/i386/compile/GENERIC.MPACPI i386
Architecture: i386
Machine: i386
>Description:
	When booting a NetBSD current kernel with the device id of
	a realtek 8168B added to the re(4) driver, the board is
	being attached, but then gives:

re0 at pci3 dev 0 function 0: RealTek 8168B/8111B Gigabit Ethernet
re0: interrupting at ioapic0 pin 19 (irq 10)
re0: eeprom autoload timed out
re0: Ethernet address 00:15:f2:d9:18:19
re0: using 256 tx descriptors
re0: WARNING, DMA FAILURE!
re0: expected TX data: 00:68:65:6c:6c:6f/00:77:6f:72:6c:64/0x800
re0: received RX data: 65:6c:6c:6f:00:77/6f:72:6c:64:08:00/0xfe34
re0: You may have a defective 32-bit NIC plugged into a 64-bit PCI slot.
re0: Please re-install the NIC in a 32-bit slot for proper operation.
re0: Read the re(4) man page for more details.
re0: attach aborted due to hardware diag failure
	
	The FreeBSD re driver doesn't show this, so the DMA corruption
	is probably not what's going on here. Also, the NIC is
	onboard...

	I first tried disabling the test, which made re0 attach.
	However, as could be expected, that didn't make it function
	properly. Packets sent were ok, but upon receiving packets,
	tcpdump showed the first 2 bytes missing. This is also what
	can be seen in the diag test result above.

	After browsing the FreeBSD CVS history for this driver, I
	noticed that in their revision 1.48 of src/sys/pci/if_rlreg.h,
	they made RE_ETHER_ALIGN 0, at least for i386 and amd64.
	Not knowing what I was doing, I changed the definition of
	RTK_ETHER_ALIGN in src/sys/dev/ic/rtl81x9var.h from 2 to
	0 and that makes the driver happy.

>How-To-Repeat:
>Fix:
	No real idea.