summaryrefslogtreecommitdiff
path: root/include/linux/usb/cdc_ncm.h
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2014-05-16 23:48:25 +0400
committerDavid S. Miller <davem@davemloft.net>2014-05-17 06:39:01 +0400
commitbeeecd42c3b41d17d0bf1d839db99274c287f514 (patch)
tree65bbae15a9ec1d3368a059f3bd4fad7d7c0a018b /include/linux/usb/cdc_ncm.h
parent43e4c6dfc0fd781e68f20caf563a06f5c6ece995 (diff)
downloadlinux-beeecd42c3b41d17d0bf1d839db99274c287f514.tar.xz
net: cdc_ncm/cdc_mbim: adding NCM protocol statistics
To have an idea of the effects of the protocol coalescing it's useful to have some counters showing the different aspects. Due to the asymmetrical usbnet interface the netdev rx_bytes counter has been counting real received payload, while the tx_bytes counter has included the NCM/MBIM framing overhead. This overhead can be many times the payload because of the aggressive padding strategy of this driver, and will vary a lot depending on device and traffic. With very few exceptions, users are only interested in the payload size. Having an somewhat accurate payload byte counter is particularly important for mobile broadband devices, which many NCM devices and of course all MBIM devices are. Users and userspace applications will use this counter to monitor account quotas. Having protocol specific counters for the overhead, we are now able to correct the tx_bytes netdev counter so that it shows the real payload Signed-off-by: Bjørn Mork <bjorn@mork.no> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/usb/cdc_ncm.h')
-rw-r--r--include/linux/usb/cdc_ncm.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h
index 79de6724d398..88d2d7f1820f 100644
--- a/include/linux/usb/cdc_ncm.h
+++ b/include/linux/usb/cdc_ncm.h
@@ -116,6 +116,17 @@ struct cdc_ncm_ctx {
u16 rx_seq;
u16 connected;
u16 min_tx_pkt;
+
+ /* statistics */
+ u32 tx_curr_frame_payload;
+ u32 tx_reason_ntb_full;
+ u32 tx_reason_ndp_full;
+ u32 tx_reason_timeout;
+ u32 tx_reason_max_datagram;
+ u64 tx_overhead;
+ u64 tx_ntbs;
+ u64 rx_overhead;
+ u64 rx_ntbs;
};
u8 cdc_ncm_select_altsetting(struct usb_interface *intf);