Subject: r8168-dkms and interaction with IOMMU setting

From: Gary Dale <[email-masked]>
Date: Sat, 12 Oct 2013 00:21:50 -0400

I'm running Jessie. I just replaced my mainboard and was having some 
problems.

1) I was not getting the RTL8168 onboard NIC to work. It seemed to be 
able to receive but not transmit if I read this ifconfig output correctly:

eth0      Link encap:Ethernet  HWaddr 94:de:80:b1:57:17
           UP BROADCAST MULTICAST  MTU:1500  Metric:1
           RX packets:86 errors:0 dropped:0 overruns:0 frame:0
           TX packets:0 errors:0 dropped:34 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:15027 (14.6 KiB)  TX bytes:0 (0.0 B)
           Interrupt:72 Base address:0xa000

I was not getting a DHCP address for eth0. I tried to set it manually 
and add a route to the router, but I still couldn't get out. I've also 
tried the SID r8168-dkms driver and the slightly more recent one from 
RealTek but they didn't work either.

The lspci listing for it is: 04:00.0 Ethernet controller: Realtek 
Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet 
Controller (rev 06)

2) Most of the back panel USB ports didn't seem to work. The USB3 ports 
do but not the USB2 ones.

The lspci listings for the USB controllers are:
00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] 
SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] 
SB7x0/SB8x0/SB9x0 USB EHCI Controller
00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] 
SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] 
SB7x0/SB8x0/SB9x0 USB EHCI Controller
....
00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] 
SB7x0/SB8x0/SB9x0 USB OHCI2 Controller
00:16.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] 
SB7x0/SB8x0/SB9x0 USB OHCI0 Controller
00:16.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] 
SB7x0/SB8x0/SB9x0 USB EHCI Controller
...
02:00.0 USB controller: VIA Technologies, Inc. Device 3483 (rev 01)

The lsusb listing is:
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 009 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 066b:400b Linksys, Inc. USB10TX
Bus 001 Device 003: ID 046d:c03d Logitech, Inc. M-BT96a Pilot Optical Mouse
Bus 001 Device 002: ID 2109:3431
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 001 Device 004 is an old USB network adapter I'd pressed into 
service to give me network connectivity.
Bus 001 Device 003 is my logitech mouse.

Both devices are plugged into the USB3 ports. They didn't work in the 
USB2 ports.

Anyway, after looking at a report of problems with AMD 970 USB ports, I 
discovered that the BIOS IOMMU setting seems to be important. Enabling 
it seems to have fixed both problems (don't know now if the USB3 ports 
work - my mouse stopped working on it, but now works on a USB2 port).

I'm also getting a lot of IO_PAGE_FAULT errors now that weren't there 
before. I've attached the dmesg log in case you need it. I don't know if 
this is of interest to you but it does seem to have an impact on the 
r8168 NIC.