linux-brain/drivers/net/usb
Grant Grundler aaa41b3094 net: usb: cdc_ncm: don't spew notifications
[ Upstream commit de658a195ee23ca6aaffe197d1d2ea040beea0a2 ]

RTL8156 sends notifications about every 32ms.
Only display/log notifications when something changes.

This issue has been reported by others:
	https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1832472
	https://lkml.org/lkml/2020/8/27/1083

...
[785962.779840] usb 1-1: new high-speed USB device number 5 using xhci_hcd
[785962.929944] usb 1-1: New USB device found, idVendor=0bda, idProduct=8156, bcdDevice=30.00
[785962.929949] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[785962.929952] usb 1-1: Product: USB 10/100/1G/2.5G LAN
[785962.929954] usb 1-1: Manufacturer: Realtek
[785962.929956] usb 1-1: SerialNumber: 000000001
[785962.991755] usbcore: registered new interface driver cdc_ether
[785963.017068] cdc_ncm 1-1:2.0: MAC-Address: 00:24:27:88:08:15
[785963.017072] cdc_ncm 1-1:2.0: setting rx_max = 16384
[785963.017169] cdc_ncm 1-1:2.0: setting tx_max = 16384
[785963.017682] cdc_ncm 1-1:2.0 usb0: register 'cdc_ncm' at usb-0000:00:14.0-1, CDC NCM, 00:24:27:88:08:15
[785963.019211] usbcore: registered new interface driver cdc_ncm
[785963.023856] usbcore: registered new interface driver cdc_wdm
[785963.025461] usbcore: registered new interface driver cdc_mbim
[785963.038824] cdc_ncm 1-1:2.0 enx002427880815: renamed from usb0
[785963.089586] cdc_ncm 1-1:2.0 enx002427880815: network connection: disconnected
[785963.121673] cdc_ncm 1-1:2.0 enx002427880815: network connection: disconnected
[785963.153682] cdc_ncm 1-1:2.0 enx002427880815: network connection: disconnected
...

This is about 2KB per second and will overwrite all contents of a 1MB
dmesg buffer in under 10 minutes rendering them useless for debugging
many kernel problems.

This is also an extra 180 MB/day in /var/logs (or 1GB per week) rendering
the majority of those logs useless too.

When the link is up (expected state), spew amount is >2x higher:
...
[786139.600992] cdc_ncm 2-1:2.0 enx002427880815: network connection: connected
[786139.632997] cdc_ncm 2-1:2.0 enx002427880815: 2500 mbit/s downlink 2500 mbit/s uplink
[786139.665097] cdc_ncm 2-1:2.0 enx002427880815: network connection: connected
[786139.697100] cdc_ncm 2-1:2.0 enx002427880815: 2500 mbit/s downlink 2500 mbit/s uplink
[786139.729094] cdc_ncm 2-1:2.0 enx002427880815: network connection: connected
[786139.761108] cdc_ncm 2-1:2.0 enx002427880815: 2500 mbit/s downlink 2500 mbit/s uplink
...

Chrome OS cannot support RTL8156 until this is fixed.

Signed-off-by: Grant Grundler <grundler@chromium.org>
Reviewed-by: Hayes Wang <hayeswang@realtek.com>
Link: https://lore.kernel.org/r/20210120011208.3768105-1-grundler@chromium.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-06-10 13:37:01 +02:00
..
Kconfig
Makefile
aqc111.c
aqc111.h
asix.h
asix_common.c net: usb: Fix uninit-was-stored issue in asix_read_phy_addr() 2020-09-09 19:12:37 +02:00
asix_devices.c
ax88172a.c ax88172a: fix ax88172a_unbind() failures 2020-07-29 10:18:31 +02:00
ax88179_178a.c net: usb: ax88179_178a: initialize local variables before use 2021-05-07 10:51:37 +02:00
catc.c
cdc-phonet.c net: cdc-phonet: fix data-interface release on probe failure 2021-03-30 14:35:27 +02:00
cdc_eem.c
cdc_ether.c r8152: Add Lenovo Powered USB-C Travel Hub 2021-01-19 18:26:13 +01:00
cdc_mbim.c
cdc_ncm.c net: usb: cdc_ncm: don't spew notifications 2021-06-10 13:37:01 +02:00
cdc_subset.c
ch9200.c
cx82310_eth.c
dm9601.c net: usb: dm9601: Add USB ID of Keenetic Plus DSL 2020-09-12 14:18:55 +02:00
gl620a.c
hso.c net: hso: bail out on interrupt URB allocation failure 2021-06-03 08:59:16 +02:00
huawei_cdc_ncm.c
int51x1.c
ipheth.c usbnet: ipheth: fix connectivity with iOS 14 2020-12-08 10:40:24 +01:00
kalmia.c
kaweth.c
lan78xx.c net: lan78xx: replace bogus endpoint lookup 2020-08-11 15:33:40 +02:00
lan78xx.h
lg-vl600.c
mcs7830.c
net1080.c
pegasus.c
pegasus.h
plusb.c
qmi_wwan.c net: usb: qmi_wwan: allow qmimux add/del with master up 2021-03-17 17:03:35 +01:00
r8152.c r8152: limit the RX buffer size of RTL8153A for USB 2.0 2021-03-30 14:35:27 +02:00
rndis_host.c rndis_host: set proper input size for OID_GEN_PHYSICAL_MEDIUM request 2021-01-23 15:57:58 +01:00
rtl8150.c net: usb: rtl8150: set random MAC address when set_ethernet_addr() fails 2020-10-14 10:33:06 +02:00
sierra_net.c
smsc75xx.c net: usb: fix memory leak in smsc75xx_bind 2021-06-03 08:59:06 +02:00
smsc75xx.h
smsc95xx.c smsc95xx: avoid memory leak in smsc95xx_bind 2020-07-16 08:16:39 +02:00
smsc95xx.h
sr9700.c
sr9700.h
sr9800.c
sr9800.h
usbnet.c
zaurus.c