Re: [PATCH] usbnet: Fix tx_bytes statistic running backward in cdc_ncm
From: David Miller <hidden>
Date: 2015-03-29 19:07:20
From: Bjørn Mork <redacted> Date: Wed, 25 Mar 2015 21:41:33 +0100
From: Ben Hutchings <redacted>
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: beeecd42c3b4 ("net: cdc_ncm/cdc_mbim: adding NCM protocol statistics")
Signed-off-by: Ben Hutchings <redacted>
Signed-off-by: Bjørn Mork <redacted>
---
This should really go to stable-3.19 and 4.0, but since it depends on
6588af614e7b ("usbnet: Fix tx_packets stat for FLAG_MULTI_FRAME drivers")
already in net-next, then I guess it is net-next for this patch as well.
I cherry picked 6588af614e7b ("usbnet: Fix tx_packets stat for
FLAG_MULTI_FRAME drivers") and put it into 'net', along with
this fix.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html