U4 - kernel change: cdc_ncm.c, or new RTL8156 driver request

Moderators: Gully, peteru

Post Reply
Grumpy_Geoff
Uber Wizard
Posts: 6490
Joined: Thu Mar 05, 2009 22:54
Location: Perth

U4 - kernel change: cdc_ncm.c, or new RTL8156 driver request

Post by Grumpy_Geoff » Thu Apr 29, 2021 20:29

Hi peteru

I installed a USB-ethernet adapter in my U4 (long ago the U4's ethernet connection dropped to 100Mbps).
The USB-ethernet adapter is using the Realtek RTL8156 chip. The adapter works, and the link light on the switch it's connected to indicates 1Gbps link rate.
However, the "messages" log file is flooded with this pair of entries at the rate of about 15-16 pairs per second -

Code: Select all

Apr 29 16:26:05 beyonwizu4 user.info kernel: cdc_ncm 4-1.3:2.0 usb0: network connection: connected
Apr 29 16:26:05 beyonwizu4 user.info kernel: cdc_ncm 4-1.3:2.0 usb0: 1000 mbit/s downlink 1000 mbit/s uplink
My amateur sleuthing turned up this comment and code in a block in cdc_ncm.c that appears to suppress those "downlink/uplink" messages (I don't know about the "network connection:" messages).

Code: Select all

	/* if the speed hasn't changed, don't report it.
	 * RTL8156 shipped before 2021 sends notification about every 32ms.
	 */
	if (dev->rx_speed == rx_speed && dev->tx_speed == tx_speed)
		return;
From - https://github.com/torvalds/linux/blob/ ... cm.c#L1832

Is there any possibility of a kernel re-compile with the above module, to suppress these link speed messages?

Or instead, a new RTL8156 driver (possibly a part of RTL8152) as per these bug reports -
Comment in "Bug 1851340 - flooded with - cdc_ncm 2-2:2.0 enp2s0f0u2c2: network connection: connected" https://bugzilla.redhat.com/show_bug.cgi?id=1851340 to "Download and compile Realtek driver r8152 version 2.14.0".
It links to - https://www.realtek.com/en/component/zo ... 0-software which contains a new driver for the RTL8156.

A Ubuntu bug report "cdc_ncm floods syslog unneccessarily" in https://bugs.launchpad.net/ubuntu/+sour ... ug/1832472 links to the same Realtek driver.

If it's easy to build the new driver, perhaps you could do so when you have time, and then I could download it and use opkg to install it.


Cheers,
Geoff

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: U4 - kernel change: cdc_ncm.c, or new RTL8156 driver request

Post by peteru » Sat May 22, 2021 16:42

I spent a considerable amount of time looking into this and there is no easy way to get this sorted properly.

The best I can do is completely comment out the lines that print the speed information. However, that means there won't be any indication of the connection speed. I also don't have the device to test with, so any changes will be untested.

Should I bother (still a few more hours work) or can you just use a dongle that works better or use the onboard Ethernet? I suspect that your use case will be one-in-ten-thousand, as the U4 ships with GigE Ethernet, so having a second Ethernet interface on USB is uncharacteristic of typical setup.

"Beauty lies in the hands of the beer holder."
Blog.

Grumpy_Geoff
Uber Wizard
Posts: 6490
Joined: Thu Mar 05, 2009 22:54
Location: Perth

Re: U4 - kernel change: cdc_ncm.c, or new RTL8156 driver request

Post by Grumpy_Geoff » Sat May 22, 2021 17:01

Thanks.
I'm only using it because my U4's ethernet connection dropped to 100Mbps, hence why I was searching for something a bit faster (which this is, about 250-300Mbps on the U4).
If it's a few hours of work, then don't bother going ahead.
I was hoping that getting a new RTL8152/RTL8156 driver would be easier.

User avatar
peteru
Uber Wizard
Posts: 9741
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: U4 - kernel change: cdc_ncm.c, or new RTL8156 driver request

Post by peteru » Sat May 22, 2021 17:08

It's complicated because the kernel USB net driver infrastructure in the old kernel used by U4 does not have the fields required to backport any patches or build the RTL driver. I can't just change the kernel USB net driver infrastructure because that would break compatibility with all the other drivers.

The root cause of the problem appears to be buggy silicon on that chip. Comments in code would suggest that the bug was only fixed this year in a new revision of the chip.

"Beauty lies in the hands of the beer holder."
Blog.

Grumpy_Geoff
Uber Wizard
Posts: 6490
Joined: Thu Mar 05, 2009 22:54
Location: Perth

Re: U4 - kernel change: cdc_ncm.c, or new RTL8156 driver request

Post by Grumpy_Geoff » Sat May 22, 2021 17:22

Thanks again. Leave things as they are.

Post Reply

Return to “Accessories (USB Tuner, Keyboards, Wifi Dongles)”