← All posts

DisplayLink dock Ethernet issues

I’ve been using a DisplayLink based docking station with my Lenovo laptop for a while and I’ve always had issues with being unable to achieve gigabit speeds, only ever getting around 400mbit/s download; when using Windows it works no problem. I’m running Fedora KDE Workstation, but I’m pretty sure this will affect any distribution.

I started debugging the problem and found out about /sys/class/net/eth0/cdc_ncm/rx_max and /sys/class/net/eth0/cdc_ncm/tx_max, by default they’re set to 16k and as soon as I doubled the values to 32k, I achieved gigabit speeds.

I can apply a long term fix via a new udev rule that would set it to 32k when the dock is plugged in, so the change stays persistent. Upon changing in to the /etc/udev/rules.d/ directory I noticed the DisplayLink RPM installer created 99-displaylink.rules. Within this file it has two entries to set the rx_max and tx_max values to the max value reported by the hardware, but clearly these two rules were not taking effect.

I ran the command udevadm info --query=property --path=/sys/class/net/eth0 to see what udev thinks about my Ethernet device a part of my dock, and there is no PRODUCT value at all, so when the rules are evaluated the rules in 99-displaylink.rules are skipped because the PRODUCT does not match.

DEVPATH=/devices/pci0000:00/0000:00:08.1/0000:74:00.4/usb4/4-1/4-1.1/4-1.1:1.5/net/eth0
INTERFACE=eth0
IFINDEX=12
SUBSYSTEM=net
USEC_INITIALIZED=3640388761
ID_NET_DRIVER=cdc_ncm
ID_BUS=usb
ID_MODEL=dynadock_U3.0
ID_MODEL_ENC=dynadock\x20U3.0
ID_MODEL_ID=4305
ID_SERIAL=DisplayLink_dynadock_U3.0_10084571
ID_SERIAL_SHORT=10084571
ID_VENDOR=DisplayLink
ID_VENDOR_ENC=DisplayLink
ID_VENDOR_ID=17e9
ID_REVISION=3015
ID_TYPE=generic
ID_USB_MODEL=dynadock_U3.0
ID_USB_MODEL_ENC=dynadock\x20U3.0
ID_USB_MODEL_ID=4305
ID_USB_SERIAL=DisplayLink_dynadock_U3.0_10084571
ID_USB_SERIAL_SHORT=10084571
ID_USB_VENDOR=DisplayLink
ID_USB_VENDOR_ENC=DisplayLink
ID_USB_VENDOR_ID=17e9
ID_USB_REVISION=3015
ID_USB_TYPE=generic
ID_USB_INTERFACES=:ff0003:fe0101:010120:010220:020d00:0a0001:
ID_USB_INTERFACE_NUM=05
ID_USB_DRIVER=cdc_ncm
ID_USB_CLASS_FROM_DATABASE=Miscellaneous Device
ID_USB_PROTOCOL_FROM_DATABASE=Interface Association
ID_VENDOR_FROM_DATABASE=DisplayLink
ID_NET_NAMING_SCHEME=v258
ID_NET_NAME_MAC=enx0050b65b7c2b
ID_OUI_FROM_DATABASE=GOOD WAY IND. CO., LTD.
ID_NET_NAME_PATH=enp116s0f4u1u1i5
ID_MM_CANDIDATE=1
ID_PATH_WITH_USB_REVISION=pci-0000:74:00.4-usbv3-0:1.1:1.5
ID_PATH=pci-0000:74:00.4-usb-0:1.1:1.5
ID_PATH_TAG=pci-0000_74_00_4-usb-0_1_1_1_5
ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
ID_NET_NAME=eth0
SYSTEMD_ALIAS=/sys/subsystem/net/devices/eth0
TAGS=:systemd:
CURRENT_TAGS=:systemd:

Now I’ve tested it with two different model Toshiba docks, but maybe the value is there on other docking stations that contain DisplayLink chips, but not for my Toshiba ones. I’ve emailed about the issue to DisplayLink, as ideally the official installer needs fixing as I’m sure I can’t be the only one having this issue.

The fix

My fix for the moment is to create /etc/udev/rules.d/80-cdc-ncm-ntb.rules with my own set of rules, which check for the vendor id and driver, then correctly apply the rule which for my dock supports 64k rx_max and tx_max. This means it’ll automatically set the correct values for whatever docking station I plug in, rather than assuming 32k rx_max and tx_max is supported on all docking stations.

ACTION=="add|move|bind", SUBSYSTEM=="net", DRIVERS=="cdc_ncm", ENV{ID_USB_VENDOR_ID}=="17e9", \
    ATTR{cdc_ncm/rx_max}=="?*", ATTR{cdc_ncm/dwNtbInMaxSize}=="?*", ATTR{cdc_ncm/rx_max}="$attr{cdc_ncm/dwNtbInMaxSize}"
ACTION=="add|move|bind", SUBSYSTEM=="net", DRIVERS=="cdc_ncm", ENV{ID_USB_VENDOR_ID}=="17e9", \
    ATTR{cdc_ncm/tx_max}=="?*", ATTR{cdc_ncm/dwNtbOutMaxSize}=="?*", ATTR{cdc_ncm/tx_max}="$attr{cdc_ncm/dwNtbOutMaxSize}"

Once the file is created, run sudo udevadm control --reload-rules to get udev to pick up the new rule, then unplug and replug the dock so the rule is applied.

I am using a repackaged version of the DisplayLink software for RPM based systems, as the official installer is only provided for Ubuntu, but I have redownloaded it and checked the udev rule it installs and it matches the repackaged version, so it’s not a bug caused by the repackaging.

Hopefully this post will help other people, if/when DisplayLink manage to fix the issue in an installer update.

Comments