linux/drivers/net/usb
Grant Grundler de658a195e net: usb: cdc_ncm: don't spew notifications
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>
2021-01-20 09:01:55 -08:00
..
aqc111.c net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias 2020-11-12 14:58:27 -08:00
aqc111.h net: usb: aqc111: Use the correct style for SPDX License Identifier 2019-11-27 11:27:01 -08:00
asix_common.c net: usb: Fix uninit-was-stored issue in asix_read_phy_addr() 2020-08-27 07:37:19 -07:00
asix_devices.c net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias 2020-11-12 14:58:27 -08:00
asix.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
ax88172a.c net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias 2020-11-12 14:58:27 -08:00
ax88179_178a.c net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias 2020-11-12 14:58:27 -08:00
catc.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
cdc_eem.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
cdc_ether.c r8152: Add Lenovo Powered USB-C Travel Hub 2021-01-12 20:00:51 -08:00
cdc_mbim.c net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias 2020-11-12 14:58:27 -08:00
cdc_ncm.c net: usb: cdc_ncm: don't spew notifications 2021-01-20 09:01:55 -08:00
cdc_subset.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
cdc-phonet.c net: usb: convert comma to semicolon 2020-12-09 16:23:08 -08:00
ch9200.c net: ch9200: remove unnecessary return 2020-01-07 13:30:36 -08:00
cx82310_eth.c cx82310_eth: fix error return code in cx82310_bind() 2020-11-16 15:23:44 -08:00
dm9601.c net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias 2020-11-12 14:58:27 -08:00
gl620a.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
hso.c usb: hso: remove bogus check for EINPROGRESS 2020-08-05 17:43:39 -07:00
huawei_cdc_ncm.c net: huawei_cdc_ncm: remove redundant assignment to variable ret 2020-05-10 11:13:07 -07:00
int51x1.c net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias 2020-11-12 14:58:27 -08:00
ipheth.c usbnet: ipheth: fix connectivity with iOS 14 2020-11-21 14:01:34 -08:00
kalmia.c net: kalmia: fix memory leaks 2019-08-18 13:03:21 -07:00
kaweth.c net: usb: kaweth: Remove last user of kaweth_control() 2020-09-29 14:02:54 -07:00
Kconfig nt: usb: USB_RTL8153_ECM should not default to y 2021-01-14 10:51:06 -08:00
lan78xx.c net: usb: lan78xx: Remove lots of set but unused 'ret' variables 2020-11-03 16:37:44 -08:00
lan78xx.h
lg-vl600.c net: usb: Delete unnecessary checks before the macro call “dev_kfree_skb” 2019-08-22 16:22:03 -07:00
Makefile r8153_ecm: avoid to be prior to r8152 driver 2020-11-19 08:23:46 -08:00
mcs7830.c net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias 2020-11-12 14:58:27 -08:00
net1080.c net: usb: net1080: Remove in_interrupt() comment 2020-09-29 14:02:54 -07:00
pegasus.c USB/PHY/Thunderbolt driver patches for 5.10-rc1 2020-10-15 09:51:18 -07:00
pegasus.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
plusb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
qmi_wwan.c net: usb: qmi_wwan: add Quectel EM160R-GL 2021-01-04 13:37:43 -08:00
r8152.c r8152: Add Lenovo Powered USB-C Travel Hub 2021-01-12 20:00:51 -08:00
r8153_ecm.c r8153_ecm: Add Lenovo Powered USB-C Hub as a fallback of r8152 2021-01-12 20:00:51 -08:00
rndis_host.c rndis_host: set proper input size for OID_GEN_PHYSICAL_MEDIUM request 2021-01-11 17:54:40 -08:00
rtl8150.c net: usb: rtl8150: don't incorrectly assign random MAC addresses 2020-10-18 12:57:30 -07:00
sierra_net.c net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias 2020-11-12 14:58:27 -08:00
smsc75xx.c net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias 2020-11-12 14:58:27 -08:00
smsc75xx.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
smsc95xx.c net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias 2020-11-12 14:58:27 -08:00
smsc95xx.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
sr9700.c net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias 2020-11-12 14:58:27 -08:00
sr9700.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
sr9800.c net: usb: switch to dev_get_tstats64 and remove usbnet_get_stats64 alias 2020-11-12 14:58:27 -08:00
sr9800.h
usbnet.c usbnet: switch to core handling of rx/tx byte/packet counters 2020-11-12 14:58:27 -08:00
zaurus.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00