diff options
author | David S. Miller <davem@davemloft.net> | 2012-07-10 06:14:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-07-11 01:40:08 -0400 |
commit | 81166dd6fa8eb780b2132d32fbc77eb6ac04e44e (patch) | |
tree | 7a41b12950640648d3bb95ca74bfa1391efa0421 /net/ipv4/tcp_minisocks.c | |
parent | 94334d5ed4b64ebcd2c4b421e133b921f8ccf75d (diff) |
tcp: Move timestamps from inetpeer to metrics cache.
With help from Lin Ming.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_minisocks.c')
-rw-r--r-- | net/ipv4/tcp_minisocks.c | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 72b7c63b1a39..a51aa534dab1 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
@@ -49,52 +49,6 @@ struct inet_timewait_death_row tcp_death_row = { | |||
49 | }; | 49 | }; |
50 | EXPORT_SYMBOL_GPL(tcp_death_row); | 50 | EXPORT_SYMBOL_GPL(tcp_death_row); |
51 | 51 | ||
52 | /* VJ's idea. Save last timestamp seen from this destination | ||
53 | * and hold it at least for normal timewait interval to use for duplicate | ||
54 | * segment detection in subsequent connections, before they enter synchronized | ||
55 | * state. | ||
56 | */ | ||
57 | |||
58 | static bool tcp_remember_stamp(struct sock *sk) | ||
59 | { | ||
60 | const struct inet_connection_sock *icsk = inet_csk(sk); | ||
61 | struct tcp_sock *tp = tcp_sk(sk); | ||
62 | struct inet_peer *peer; | ||
63 | |||
64 | peer = icsk->icsk_af_ops->get_peer(sk); | ||
65 | if (peer) { | ||
66 | if ((s32)(peer->tcp_ts - tp->rx_opt.ts_recent) <= 0 || | ||
67 | ((u32)get_seconds() - peer->tcp_ts_stamp > TCP_PAWS_MSL && | ||
68 | peer->tcp_ts_stamp <= (u32)tp->rx_opt.ts_recent_stamp)) { | ||
69 | peer->tcp_ts_stamp = (u32)tp->rx_opt.ts_recent_stamp; | ||
70 | peer->tcp_ts = tp->rx_opt.ts_recent; | ||
71 | } | ||
72 | return true; | ||
73 | } | ||
74 | |||
75 | return false; | ||
76 | } | ||
77 | |||
78 | static bool tcp_tw_remember_stamp(struct inet_timewait_sock *tw) | ||
79 | { | ||
80 | const struct tcp_timewait_sock *tcptw; | ||
81 | struct sock *sk = (struct sock *) tw; | ||
82 | struct inet_peer *peer; | ||
83 | |||
84 | tcptw = tcp_twsk(sk); | ||
85 | peer = tcptw->tw_peer; | ||
86 | if (peer) { | ||
87 | if ((s32)(peer->tcp_ts - tcptw->tw_ts_recent) <= 0 || | ||
88 | ((u32)get_seconds() - peer->tcp_ts_stamp > TCP_PAWS_MSL && | ||
89 | peer->tcp_ts_stamp <= (u32)tcptw->tw_ts_recent_stamp)) { | ||
90 | peer->tcp_ts_stamp = (u32)tcptw->tw_ts_recent_stamp; | ||
91 | peer->tcp_ts = tcptw->tw_ts_recent; | ||
92 | } | ||
93 | return true; | ||
94 | } | ||
95 | return false; | ||
96 | } | ||
97 | |||
98 | static bool tcp_in_window(u32 seq, u32 end_seq, u32 s_win, u32 e_win) | 52 | static bool tcp_in_window(u32 seq, u32 end_seq, u32 s_win, u32 e_win) |
99 | { | 53 | { |
100 | if (seq == s_win) | 54 | if (seq == s_win) |