summaryrefslogtreecommitdiff
path: root/drivers/net/usb/sr9800.c
diff options
context:
space:
mode:
authorBen Hutchings <ben.hutchings@codethink.co.uk>2015-03-25 23:41:33 +0300
committerDavid S. Miller <davem@davemloft.net>2015-03-29 22:06:45 +0300
commit7a1e890e2168e33fb62d84528e996b8b4b478fea (patch)
tree2b9d47228b9d613a9934f8bddde26a6633cf748e /drivers/net/usb/sr9800.c
parent1e9e39f4a29857a396ac7b669d109f697f66695e (diff)
downloadlinux-7a1e890e2168e33fb62d84528e996b8b4b478fea.tar.xz
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: beeecd42c3b4 ("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>
Diffstat (limited to 'drivers/net/usb/sr9800.c')
-rw-r--r--drivers/net/usb/sr9800.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/usb/sr9800.c b/drivers/net/usb/sr9800.c
index 7650cdc8fe6b..953de13267df 100644
--- a/drivers/net/usb/sr9800.c
+++ b/drivers/net/usb/sr9800.c
@@ -144,7 +144,7 @@ static struct sk_buff *sr_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
skb_put(skb, sizeof(padbytes));
}
- usbnet_set_skb_tx_stats(skb, 1);
+ usbnet_set_skb_tx_stats(skb, 1, 0);
return skb;
}