aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJulian Anastasov <ja@ssi.bg>2012-09-04 07:03:15 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-05 15:15:02 -0400
commitd23ff701643a4a725e2c7a8ba2d567d39daa29ea (patch)
tree039dbda9d59c1e18df6a89f600226924d452fbed /include/linux
parentab868256f8d6095e7200d928fcc054b66d0f13a3 (diff)
tcp: add generic netlink support for tcp_metrics
Add support for genl "tcp_metrics". No locking is changed, only that now we can unlink and delete entries after grace period. We implement get/del for single entry and dump to support show/flush filtering in user space. Del without address attribute causes flush for all addresses, sadly under genl_mutex. v2: - remove rcu_assign_pointer as suggested by Eric Dumazet, it is not needed because there are no other writes under lock - move the flushing code in tcp_metrics_flush_all v3: - remove synchronize_rcu on flush as suggested by Eric Dumazet Signed-off-by: Julian Anastasov <ja@ssi.bg> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/tcp_metrics.h54
2 files changed, 55 insertions, 0 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 1f2c1c787f17..90da0af28352 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -363,6 +363,7 @@ header-y += sysctl.h
363header-y += sysinfo.h 363header-y += sysinfo.h
364header-y += taskstats.h 364header-y += taskstats.h
365header-y += tcp.h 365header-y += tcp.h
366header-y += tcp_metrics.h
366header-y += telephony.h 367header-y += telephony.h
367header-y += termios.h 368header-y += termios.h
368header-y += time.h 369header-y += time.h
diff --git a/include/linux/tcp_metrics.h b/include/linux/tcp_metrics.h
new file mode 100644
index 000000000000..cb5157b55f32
--- /dev/null
+++ b/include/linux/tcp_metrics.h
@@ -0,0 +1,54 @@
1/* tcp_metrics.h - TCP Metrics Interface */
2
3#ifndef _LINUX_TCP_METRICS_H
4#define _LINUX_TCP_METRICS_H
5
6#include <linux/types.h>
7
8/* NETLINK_GENERIC related info
9 */
10#define TCP_METRICS_GENL_NAME "tcp_metrics"
11#define TCP_METRICS_GENL_VERSION 0x1
12
13enum tcp_metric_index {
14 TCP_METRIC_RTT,
15 TCP_METRIC_RTTVAR,
16 TCP_METRIC_SSTHRESH,
17 TCP_METRIC_CWND,
18 TCP_METRIC_REORDERING,
19
20 /* Always last. */
21 __TCP_METRIC_MAX,
22};
23
24#define TCP_METRIC_MAX (__TCP_METRIC_MAX - 1)
25
26enum {
27 TCP_METRICS_ATTR_UNSPEC,
28 TCP_METRICS_ATTR_ADDR_IPV4, /* u32 */
29 TCP_METRICS_ATTR_ADDR_IPV6, /* binary */
30 TCP_METRICS_ATTR_AGE, /* msecs */
31 TCP_METRICS_ATTR_TW_TSVAL, /* u32, raw, rcv tsval */
32 TCP_METRICS_ATTR_TW_TS_STAMP, /* s32, sec age */
33 TCP_METRICS_ATTR_VALS, /* nested +1, u32 */
34 TCP_METRICS_ATTR_FOPEN_MSS, /* u16 */
35 TCP_METRICS_ATTR_FOPEN_SYN_DROPS, /* u16, count of drops */
36 TCP_METRICS_ATTR_FOPEN_SYN_DROP_TS, /* msecs age */
37 TCP_METRICS_ATTR_FOPEN_COOKIE, /* binary */
38
39 __TCP_METRICS_ATTR_MAX,
40};
41
42#define TCP_METRICS_ATTR_MAX (__TCP_METRICS_ATTR_MAX - 1)
43
44enum {
45 TCP_METRICS_CMD_UNSPEC,
46 TCP_METRICS_CMD_GET,
47 TCP_METRICS_CMD_DEL,
48
49 __TCP_METRICS_CMD_MAX,
50};
51
52#define TCP_METRICS_CMD_MAX (__TCP_METRICS_CMD_MAX - 1)
53
54#endif /* _LINUX_TCP_METRICS_H */