aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/cdc_ncm.h
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2014-05-16 15:48:22 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-16 22:39:01 -0400
commit6c4e548ff36672eeb78f8288a2920d66fa4a6a66 (patch)
treefe2e6d17ffd63d02ee28d3a51e8a0b166ba1d311 /include/linux/usb/cdc_ncm.h
parent68864abf08f06d7cbbabd03740beb383ccf5e5d5 (diff)
net: cdc_ncm: use ethtool to tune coalescing settings
Datagram coalescing is an integral part of the NCM and MBIM protocols, intended to reduce the interrupt load primarily on the device end of the USB link. As with all coalescing solutions, there is a trade-off between buffering and interrupts. The current defaults are based on the assumption that device side buffers should be the limiting factor. However, many modern high speed LTE modems suffers from buffer-bloat, making this assumption fail. This results in sub-optimal performance due to excessive coalescing. And in cases where such modems are connected to cheap embedded hosts there is often severe buffer allocation issues, giving very noticeable performance degradation . A start on improving this is going from build time hard coded limits to per device user configurable limits. The ethtool coalescing API was selected as user interface because, although the tuned values are buffer sizes, these settings directly control datagram coalescing. 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.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h
index 55b6feead93b..5c1066b4dc41 100644
--- a/include/linux/usb/cdc_ncm.h
+++ b/include/linux/usb/cdc_ncm.h
@@ -72,7 +72,9 @@
72/* Restart the timer, if amount of datagrams is less than given value */ 72/* Restart the timer, if amount of datagrams is less than given value */
73#define CDC_NCM_RESTART_TIMER_DATAGRAM_CNT 3 73#define CDC_NCM_RESTART_TIMER_DATAGRAM_CNT 3
74#define CDC_NCM_TIMER_PENDING_CNT 2 74#define CDC_NCM_TIMER_PENDING_CNT 2
75#define CDC_NCM_TIMER_INTERVAL (400UL * NSEC_PER_USEC) 75#define CDC_NCM_TIMER_INTERVAL_USEC 400UL
76#define CDC_NCM_TIMER_INTERVAL_MIN 5UL
77#define CDC_NCM_TIMER_INTERVAL_MAX (15UL * USEC_PER_SEC)
76 78
77/* The following macro defines the minimum header space */ 79/* The following macro defines the minimum header space */
78#define CDC_NCM_MIN_HDR_SIZE \ 80#define CDC_NCM_MIN_HDR_SIZE \
@@ -107,6 +109,8 @@ struct cdc_ncm_ctx {
107 spinlock_t mtx; 109 spinlock_t mtx;
108 atomic_t stop; 110 atomic_t stop;
109 111
112 u64 timer_interval;
113
110 u32 tx_timer_pending; 114 u32 tx_timer_pending;
111 u32 tx_curr_frame_num; 115 u32 tx_curr_frame_num;
112 u32 rx_max; 116 u32 rx_max;