aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_htcp.c
diff options
context:
space:
mode:
authorLawrence Brakmo <brakmo@fb.com>2016-05-11 13:02:13 -0400
committerDavid S. Miller <davem@davemloft.net>2016-05-11 14:43:19 -0400
commit756ee1729b2feb3a45767da29e338f70f2086ba3 (patch)
tree9329409e197d2912d3fba7e247a57239996c99e9 /net/ipv4/tcp_htcp.c
parentcf88585b1d5ce49515aabb381812976e2840a967 (diff)
tcp: replace cnt & rtt with struct in pkts_acked()
Replace 2 arguments (cnt and rtt) in the congestion control modules' pkts_acked() function with a struct. This will allow adding more information without having to modify existing congestion control modules (tcp_nv in particular needs bytes in flight when packet was sent). As proposed by Neal Cardwell in his comments to the tcp_nv patch. Signed-off-by: Lawrence Brakmo <brakmo@fb.com> Acked-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_htcp.c')
-rw-r--r--net/ipv4/tcp_htcp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/tcp_htcp.c b/net/ipv4/tcp_htcp.c
index 82f0d9ed60f5..4a4d8e76738f 100644
--- a/net/ipv4/tcp_htcp.c
+++ b/net/ipv4/tcp_htcp.c
@@ -99,7 +99,7 @@ static inline void measure_rtt(struct sock *sk, u32 srtt)
99} 99}
100 100
101static void measure_achieved_throughput(struct sock *sk, 101static void measure_achieved_throughput(struct sock *sk,
102 u32 pkts_acked, s32 rtt) 102 const struct ack_sample *sample)
103{ 103{
104 const struct inet_connection_sock *icsk = inet_csk(sk); 104 const struct inet_connection_sock *icsk = inet_csk(sk);
105 const struct tcp_sock *tp = tcp_sk(sk); 105 const struct tcp_sock *tp = tcp_sk(sk);
@@ -107,10 +107,10 @@ static void measure_achieved_throughput(struct sock *sk,
107 u32 now = tcp_time_stamp; 107 u32 now = tcp_time_stamp;
108 108
109 if (icsk->icsk_ca_state == TCP_CA_Open) 109 if (icsk->icsk_ca_state == TCP_CA_Open)
110 ca->pkts_acked = pkts_acked; 110 ca->pkts_acked = sample->pkts_acked;
111 111
112 if (rtt > 0) 112 if (sample->rtt_us > 0)
113 measure_rtt(sk, usecs_to_jiffies(rtt)); 113 measure_rtt(sk, usecs_to_jiffies(sample->rtt_us));
114 114
115 if (!use_bandwidth_switch) 115 if (!use_bandwidth_switch)
116 return; 116 return;
@@ -122,7 +122,7 @@ static void measure_achieved_throughput(struct sock *sk,
122 return; 122 return;
123 } 123 }
124 124
125 ca->packetcount += pkts_acked; 125 ca->packetcount += sample->pkts_acked;
126 126
127 if (ca->packetcount >= tp->snd_cwnd - (ca->alpha >> 7 ? : 1) && 127 if (ca->packetcount >= tp->snd_cwnd - (ca->alpha >> 7 ? : 1) &&
128 now - ca->lasttime >= ca->minRTT && 128 now - ca->lasttime >= ca->minRTT &&