]> git.baikalelectronics.ru Git - kernel.git/commit
usbnet: Fix tx_bytes statistic running backward in cdc_ncm
authorBen Hutchings <ben.hutchings@codethink.co.uk>
Wed, 25 Mar 2015 20:41:33 +0000 (21:41 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 29 Mar 2015 19:06:45 +0000 (12:06 -0700)
commit77b1be3cb1691563456b6f760decddb15d38dbe8
tree2b9d47228b9d613a9934f8bddde26a6633cf748e
parent47cdc2f1e2adb49f3e4bd8bf204b9a578bc238f3
usbnet: Fix tx_bytes statistic running backward in cdc_ncm

cdc_ncm disagrees with usbnet about how much framing overhead should
be counted in the tx_bytes statistics, and tries 'fix' this by
decrementing tx_bytes on the transmit path.  But statistics must never
be decremented except due to roll-over; this will thoroughly confuse
user-space.  Also, tx_bytes is only incremented by usbnet in the
completion path.

Fix this by requiring drivers that set FLAG_MULTI_FRAME to set a
tx_bytes delta along with the tx_packets count.

Fixes: 420b179989ab ("net: cdc_ncm/cdc_mbim: adding NCM protocol statistics")
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
drivers/net/usb/asix_common.c
drivers/net/usb/cdc_ncm.c
drivers/net/usb/sr9800.c
drivers/net/usb/usbnet.c
include/linux/usb/usbnet.h