aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>2007-08-09 07:33:18 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:47:55 -0400
commitb5860bbac7be1381626f3dc8a0cb970a60fcefb4 (patch)
tree53034429084f92fdb55c062498e1f4255be9bd4a /include
parent35e8694198ba94b62df8aa35fa6e52a1cfb86df2 (diff)
[TCP]: Tighten tcp_sock's belt, drop left_out
It is easily calculable when needed and user are not that many after all. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/tcp.h1
-rw-r--r--include/net/tcp.h4
2 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index d64734389fb6..1f12fa0b67d7 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -304,7 +304,6 @@ struct tcp_sock {
304 u32 rtt_seq; /* sequence number to update rttvar */ 304 u32 rtt_seq; /* sequence number to update rttvar */
305 305
306 u32 packets_out; /* Packets which are "in flight" */ 306 u32 packets_out; /* Packets which are "in flight" */
307 u32 left_out; /* Packets which leaved network */
308 u32 retrans_out; /* Retransmitted packets out */ 307 u32 retrans_out; /* Retransmitted packets out */
309/* 308/*
310 * Options received (usually on last packet, some only on SYN packets). 309 * Options received (usually on last packet, some only on SYN packets).
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 9d3438f6b52f..299872d461c7 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -735,7 +735,8 @@ static inline void tcp_ca_event(struct sock *sk, const enum tcp_ca_event event)
735 */ 735 */
736static inline unsigned int tcp_packets_in_flight(const struct tcp_sock *tp) 736static inline unsigned int tcp_packets_in_flight(const struct tcp_sock *tp)
737{ 737{
738 return (tp->packets_out - tp->left_out + tp->retrans_out); 738 return tp->packets_out - (tp->sacked_out + tp->lost_out) +
739 tp->retrans_out;
739} 740}
740 741
741/* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd. 742/* If cwnd > ssthresh, we may raise ssthresh to be half-way to cwnd.
@@ -757,7 +758,6 @@ static inline void tcp_sync_left_out(struct tcp_sock *tp)
757{ 758{
758 BUG_ON(tp->rx_opt.sack_ok && 759 BUG_ON(tp->rx_opt.sack_ok &&
759 (tp->sacked_out + tp->lost_out > tp->packets_out)); 760 (tp->sacked_out + tp->lost_out > tp->packets_out));
760 tp->left_out = tp->sacked_out + tp->lost_out;
761} 761}
762 762
763extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); 763extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh);