aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/kcm.h
diff options
context:
space:
mode:
authorTom Herbert <tom@herbertland.com>2016-03-07 17:11:11 -0500
committerDavid S. Miller <davem@davemloft.net>2016-03-09 16:36:15 -0500
commit29152a34f72cb4d7ab32885ad2f20a482c92a8f3 (patch)
tree89287b971525eab8a238437e3e12959074f9fa63 /include/net/kcm.h
parent7ced95ef525c329f947c424859cf2b0a3b731f8c (diff)
kcm: Add receive message timeout
This patch adds receive timeout for message assembly on the attached TCP sockets. The timeout is set when a new messages is started and the whole message has not been received by TCP (not in the receive queue). If the completely message is subsequently received the timer is cancelled, if the timer expires the RX side is aborted. The timeout value is taken from the socket timeout (SO_RCVTIMEO) that is set on a TCP socket (i.e. set by get sockopt before attaching a TCP socket to KCM. Signed-off-by: Tom Herbert <tom@herbertland.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/kcm.h')
-rw-r--r--include/net/kcm.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/net/kcm.h b/include/net/kcm.h
index d892956ff552..95c425ca97b6 100644
--- a/include/net/kcm.h
+++ b/include/net/kcm.h
@@ -29,6 +29,7 @@ struct kcm_psock_stats {
29 unsigned int rx_mem_fail; 29 unsigned int rx_mem_fail;
30 unsigned int rx_need_more_hdr; 30 unsigned int rx_need_more_hdr;
31 unsigned int rx_msg_too_big; 31 unsigned int rx_msg_too_big;
32 unsigned int rx_msg_timeouts;
32 unsigned int rx_bad_hdr_len; 33 unsigned int rx_bad_hdr_len;
33 unsigned long long reserved; 34 unsigned long long reserved;
34 unsigned long long unreserved; 35 unsigned long long unreserved;
@@ -130,6 +131,7 @@ struct kcm_psock {
130 struct kcm_sock *rx_kcm; 131 struct kcm_sock *rx_kcm;
131 unsigned long long saved_rx_bytes; 132 unsigned long long saved_rx_bytes;
132 unsigned long long saved_rx_msgs; 133 unsigned long long saved_rx_msgs;
134 struct timer_list rx_msg_timer;
133 unsigned int rx_need_bytes; 135 unsigned int rx_need_bytes;
134 136
135 /* Transmit */ 137 /* Transmit */
@@ -194,6 +196,7 @@ static inline void aggregate_psock_stats(struct kcm_psock_stats *stats,
194 SAVE_PSOCK_STATS(rx_mem_fail); 196 SAVE_PSOCK_STATS(rx_mem_fail);
195 SAVE_PSOCK_STATS(rx_need_more_hdr); 197 SAVE_PSOCK_STATS(rx_need_more_hdr);
196 SAVE_PSOCK_STATS(rx_msg_too_big); 198 SAVE_PSOCK_STATS(rx_msg_too_big);
199 SAVE_PSOCK_STATS(rx_msg_timeouts);
197 SAVE_PSOCK_STATS(rx_bad_hdr_len); 200 SAVE_PSOCK_STATS(rx_bad_hdr_len);
198 SAVE_PSOCK_STATS(tx_msgs); 201 SAVE_PSOCK_STATS(tx_msgs);
199 SAVE_PSOCK_STATS(tx_bytes); 202 SAVE_PSOCK_STATS(tx_bytes);