1 diff -Ndur linux-2.6.32-700/include/net/tcp.h linux-2.6.32-700-xidmask/include/net/tcp.h
2 --- linux-2.6.32-700/include/net/tcp.h 2013-01-10 14:18:49.880337393 -0500
3 +++ linux-2.6.32-700-xidmask/include/net/tcp.h 2013-01-10 14:21:16.366337329 -0500
5 #ifdef CONFIG_WEB100_STATS
6 extern int sysctl_web100_fperms;
7 extern int sysctl_web100_gid;
8 +extern int sysctl_web100_sidestream_xid;
9 +extern int sysctl_web100_mask_xid;
12 extern atomic_t tcp_memory_allocated;
13 diff -Ndur linux-2.6.32-700/net/ipv4/sysctl_net_ipv4.c linux-2.6.32-700-xidmask/net/ipv4/sysctl_net_ipv4.c
14 --- linux-2.6.32-700/net/ipv4/sysctl_net_ipv4.c 2013-01-10 14:18:50.233320698 -0500
15 +++ linux-2.6.32-700-xidmask/net/ipv4/sysctl_net_ipv4.c 2013-01-10 14:30:18.997403751 -0500
18 .proc_handler = &web100_proc_dointvec_update,
21 + .ctl_name = CTL_UNNUMBERED,
22 + .procname = "web100_sidestream_xid",
23 + .data = &sysctl_web100_sidestream_xid,
24 + .maxlen = sizeof(int),
26 + .proc_handler = &web100_proc_dointvec_update,
29 + .ctl_name = CTL_UNNUMBERED,
30 + .procname = "web100_mask_xid",
31 + .data = &sysctl_web100_mask_xid,
32 + .maxlen = sizeof(int),
34 + .proc_handler = &web100_proc_dointvec_update,
38 .ctl_name = CTL_UNNUMBERED,
39 diff -Ndur linux-2.6.32-700/net/ipv4/tcp.c linux-2.6.32-700-xidmask/net/ipv4/tcp.c
40 --- linux-2.6.32-700/net/ipv4/tcp.c 2013-01-10 14:18:50.234322447 -0500
41 +++ linux-2.6.32-700-xidmask/net/ipv4/tcp.c 2013-01-10 14:21:16.368337586 -0500
43 #ifdef CONFIG_WEB100_STATS
44 int sysctl_web100_fperms = CONFIG_WEB100_FPERMS;
45 int sysctl_web100_gid = CONFIG_WEB100_GID;
46 +int sysctl_web100_sidestream_xid = 0;
47 +int sysctl_web100_mask_xid = -1;
50 atomic_t tcp_memory_allocated; /* Current allocated memory. */
53 tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH);
54 #ifdef CONFIG_WEB100_STATS
55 - web100_update_writeq(sk);
56 + WEB100_UPDATE_FUNC(tcp_sk(sk), web100_update_writeq(sk));
62 tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH);
63 #ifdef CONFIG_WEB100_STATS
64 - web100_update_writeq(sk);
65 + WEB100_UPDATE_FUNC(tcp_sk(sk), web100_update_writeq(sk));
72 #ifdef CONFIG_WEB100_STATS
73 - web100_update_recvq(sk);
74 + WEB100_UPDATE_FUNC(tcp_sk(sk), web100_update_recvq(sk));
77 /* Well, if we have backlog, try to process it now yet. */
78 diff -Ndur linux-2.6.32-700/net/ipv4/tcp_input.c linux-2.6.32-700-xidmask/net/ipv4/tcp_input.c
79 --- linux-2.6.32-700/net/ipv4/tcp_input.c 2013-01-10 14:18:50.232318345 -0500
80 +++ linux-2.6.32-700-xidmask/net/ipv4/tcp_input.c 2013-01-10 14:21:16.371337187 -0500
84 #ifdef CONFIG_WEB100_NET100
85 - if (vars->WAD_NoAI) {
86 + if (stats != NULL && vars->WAD_NoAI) {
87 tp->snd_cwnd += vars->WAD_CwndAdjust;
88 vars->WAD_CwndAdjust = 0;
89 tp->snd_cwnd_stamp = tcp_time_stamp;
91 tcp_fast_path_check(sk);
93 #ifdef CONFIG_WEB100_STATS
94 - web100_update_recvq(sk);
95 + WEB100_UPDATE_FUNC(tcp_sk(sk), web100_update_recvq(sk));
100 tp->rcv_nxt, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq);
102 #ifdef CONFIG_WEB100_STATS
103 - web100_update_recvq(sk);
104 + WEB100_UPDATE_FUNC(tcp_sk(sk), web100_update_recvq(sk));
106 skb_set_owner_r(skb, sk);
108 @@ -5372,7 +5372,7 @@
111 #ifdef CONFIG_WEB100_STATS
112 - web100_update_recvq(sk);
113 + WEB100_UPDATE_FUNC(tcp_sk(sk), web100_update_recvq(sk));
115 tcp_event_data_recv(sk, skb);
117 diff -Ndur linux-2.6.32-700/net/ipv4/tcp_ipv4.c linux-2.6.32-700-xidmask/net/ipv4/tcp_ipv4.c
118 --- linux-2.6.32-700/net/ipv4/tcp_ipv4.c 2013-01-10 14:18:50.235319018 -0500
119 +++ linux-2.6.32-700-xidmask/net/ipv4/tcp_ipv4.c 2013-01-10 14:21:16.372284450 -0500
120 @@ -1383,7 +1383,9 @@
124 - tcp_sk(newsk)->tcp_stats->wc_vars.LocalAddressType = WC_ADDRTYPE_IPV4;
125 + if ( tcp_sk(newsk)->tcp_stats != NULL ) {
126 + tcp_sk(newsk)->tcp_stats->wc_vars.LocalAddressType = WC_ADDRTYPE_IPV4;
130 newsk->sk_gso_type = SKB_GSO_TCPV4;
131 @@ -1857,7 +1859,9 @@
132 if ((err = web100_stats_create(sk))) {
135 - tcp_sk(sk)->tcp_stats->wc_vars.LocalAddressType = WC_ADDRTYPE_IPV4;
136 + if ( tcp_sk(sk)->tcp_stats != NULL ) {
137 + tcp_sk(sk)->tcp_stats->wc_vars.LocalAddressType = WC_ADDRTYPE_IPV4;
142 diff -Ndur linux-2.6.32-700/net/ipv4/web100_stats.c linux-2.6.32-700-xidmask/net/ipv4/web100_stats.c
143 --- linux-2.6.32-700/net/ipv4/web100_stats.c 2013-01-10 14:18:50.231318735 -0500
144 +++ linux-2.6.32-700-xidmask/net/ipv4/web100_stats.c 2013-01-10 14:21:16.373337472 -0500
146 struct web100directs *vars;
147 struct tcp_sock *tp = tcp_sk(sk);
150 + printk("Web100: stats_create(): checking xid(%d) mask(%d)\n",
151 + sk->sk_xid, sysctl_web100_mask_xid);
152 + if ( sk->sk_xid == sysctl_web100_mask_xid ) {
153 + /* this xid is masked, so do not allocate or update tcp_stats */
154 + printk("Web100: skipping stats_create() for xid(%d) mask(%d)\n",
155 + sk->sk_xid, sysctl_web100_mask_xid);
156 + tp->tcp_stats = NULL;
160 if ((stats = kmalloc(sizeof (struct web100stats), gfp_any())) == NULL)
164 void web100_stats_destroy(struct web100stats *stats)
166 + if ( stats == NULL ) {
169 /* Attribute final sndlim time. */
170 web100_update_sndlim(tcp_sk(stats->wc_sk), stats->wc_limstate);
172 diff -Ndur linux-2.6.32-700/net/ipv6/tcp_ipv6.c linux-2.6.32-700-xidmask/net/ipv6/tcp_ipv6.c
173 --- linux-2.6.32-700/net/ipv6/tcp_ipv6.c 2013-01-10 14:18:50.219284269 -0500
174 +++ linux-2.6.32-700-xidmask/net/ipv6/tcp_ipv6.c 2013-01-10 14:21:16.373337472 -0500
175 @@ -1380,7 +1380,9 @@
179 - tcp_sk(newsk)->tcp_stats->wc_vars.LocalAddressType = WC_ADDRTYPE_IPV6;
180 + if ( tcp_sk(newsk)->tcp_stats != NULL ) {
181 + tcp_sk(newsk)->tcp_stats->wc_vars.LocalAddressType = WC_ADDRTYPE_IPV6;
186 @@ -1901,7 +1903,9 @@
187 if ((err = web100_stats_create(sk))) {
190 - tcp_sk(sk)->tcp_stats->wc_vars.LocalAddressType = WC_ADDRTYPE_IPV6;
191 + if ( tcp_sk(sk)->tcp_stats != NULL ) {
192 + tcp_sk(sk)->tcp_stats->wc_vars.LocalAddressType = WC_ADDRTYPE_IPV6;