Skip to content

Commit 1675134

Browse files
Stephen HemmingerDavid S. Miller
Stephen Hemminger
authored and
David S. Miller
committed
[TCP]: remove unused argument to cong_avoid op
None of the existing TCP congestion controls use the rtt value pased in the ca_ops->cong_avoid interface. Which is lucky because seq_rtt could have been -1 when handling a duplicate ack. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 44beac0 commit 1675134

14 files changed

+24
-28
lines changed

include/net/tcp.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -652,8 +652,7 @@ struct tcp_congestion_ops {
652652
/* lower bound for congestion window (optional) */
653653
u32 (*min_cwnd)(const struct sock *sk);
654654
/* do new cwnd calculation (required) */
655-
void (*cong_avoid)(struct sock *sk, u32 ack,
656-
u32 rtt, u32 in_flight, int good_ack);
655+
void (*cong_avoid)(struct sock *sk, u32 ack, u32 in_flight, int good_ack);
657656
/* call before changing ca_state (optional) */
658657
void (*set_state)(struct sock *sk, u8 new_state);
659658
/* call when cwnd event occurs (optional) */
@@ -684,8 +683,7 @@ extern void tcp_slow_start(struct tcp_sock *tp);
684683

685684
extern struct tcp_congestion_ops tcp_init_congestion_ops;
686685
extern u32 tcp_reno_ssthresh(struct sock *sk);
687-
extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack,
688-
u32 rtt, u32 in_flight, int flag);
686+
extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight, int flag);
689687
extern u32 tcp_reno_min_cwnd(const struct sock *sk);
690688
extern struct tcp_congestion_ops tcp_reno;
691689

net/ipv4/tcp_bic.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
137137
}
138138

139139
static void bictcp_cong_avoid(struct sock *sk, u32 ack,
140-
u32 seq_rtt, u32 in_flight, int data_acked)
140+
u32 in_flight, int data_acked)
141141
{
142142
struct tcp_sock *tp = tcp_sk(sk);
143143
struct bictcp *ca = inet_csk_ca(sk);

net/ipv4/tcp_cong.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,7 @@ EXPORT_SYMBOL_GPL(tcp_slow_start);
324324
/* This is Jacobson's slow start and congestion avoidance.
325325
* SIGCOMM '88, p. 328.
326326
*/
327-
void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 rtt, u32 in_flight,
328-
int flag)
327+
void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 in_flight, int flag)
329328
{
330329
struct tcp_sock *tp = tcp_sk(sk);
331330

net/ipv4/tcp_cubic.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ static inline void measure_delay(struct sock *sk)
270270
}
271271

272272
static void bictcp_cong_avoid(struct sock *sk, u32 ack,
273-
u32 seq_rtt, u32 in_flight, int data_acked)
273+
u32 in_flight, int data_acked)
274274
{
275275
struct tcp_sock *tp = tcp_sk(sk);
276276
struct bictcp *ca = inet_csk_ca(sk);

net/ipv4/tcp_highspeed.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static void hstcp_init(struct sock *sk)
109109
tp->snd_cwnd_clamp = min_t(u32, tp->snd_cwnd_clamp, 0xffffffff/128);
110110
}
111111

112-
static void hstcp_cong_avoid(struct sock *sk, u32 adk, u32 rtt,
112+
static void hstcp_cong_avoid(struct sock *sk, u32 adk,
113113
u32 in_flight, int data_acked)
114114
{
115115
struct tcp_sock *tp = tcp_sk(sk);

net/ipv4/tcp_htcp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static u32 htcp_recalc_ssthresh(struct sock *sk)
225225
return max((tp->snd_cwnd * ca->beta) >> 7, 2U);
226226
}
227227

228-
static void htcp_cong_avoid(struct sock *sk, u32 ack, u32 rtt,
228+
static void htcp_cong_avoid(struct sock *sk, u32 ack, s32 rtt,
229229
u32 in_flight, int data_acked)
230230
{
231231
struct tcp_sock *tp = tcp_sk(sk);

net/ipv4/tcp_hybla.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static inline u32 hybla_fraction(u32 odds)
8585
* o Give cwnd a new value based on the model proposed
8686
* o remember increments <1
8787
*/
88-
static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 rtt,
88+
static void hybla_cong_avoid(struct sock *sk, u32 ack,
8989
u32 in_flight, int flag)
9090
{
9191
struct tcp_sock *tp = tcp_sk(sk);
@@ -103,7 +103,7 @@ static void hybla_cong_avoid(struct sock *sk, u32 ack, u32 rtt,
103103
return;
104104

105105
if (!ca->hybla_en)
106-
return tcp_reno_cong_avoid(sk, ack, rtt, in_flight, flag);
106+
return tcp_reno_cong_avoid(sk, ack, in_flight, flag);
107107

108108
if (ca->rho == 0)
109109
hybla_recalc_param(sk);

net/ipv4/tcp_illinois.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ static void tcp_illinois_state(struct sock *sk, u8 new_state)
258258
/*
259259
* Increase window in response to successful acknowledgment.
260260
*/
261-
static void tcp_illinois_cong_avoid(struct sock *sk, u32 ack, u32 rtt,
261+
static void tcp_illinois_cong_avoid(struct sock *sk, u32 ack,
262262
u32 in_flight, int flag)
263263
{
264264
struct tcp_sock *tp = tcp_sk(sk);

net/ipv4/tcp_input.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -2323,11 +2323,11 @@ static inline void tcp_ack_update_rtt(struct sock *sk, const int flag,
23232323
tcp_ack_no_tstamp(sk, seq_rtt, flag);
23242324
}
23252325

2326-
static void tcp_cong_avoid(struct sock *sk, u32 ack, u32 rtt,
2326+
static void tcp_cong_avoid(struct sock *sk, u32 ack,
23272327
u32 in_flight, int good)
23282328
{
23292329
const struct inet_connection_sock *icsk = inet_csk(sk);
2330-
icsk->icsk_ca_ops->cong_avoid(sk, ack, rtt, in_flight, good);
2330+
icsk->icsk_ca_ops->cong_avoid(sk, ack, in_flight, good);
23312331
tcp_sk(sk)->snd_cwnd_stamp = tcp_time_stamp;
23322332
}
23332333

@@ -2826,11 +2826,11 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
28262826
/* Advance CWND, if state allows this. */
28272827
if ((flag & FLAG_DATA_ACKED) && !frto_cwnd &&
28282828
tcp_may_raise_cwnd(sk, flag))
2829-
tcp_cong_avoid(sk, ack, seq_rtt, prior_in_flight, 0);
2829+
tcp_cong_avoid(sk, ack, prior_in_flight, 0);
28302830
tcp_fastretrans_alert(sk, prior_snd_una, prior_packets, flag);
28312831
} else {
28322832
if ((flag & FLAG_DATA_ACKED) && !frto_cwnd)
2833-
tcp_cong_avoid(sk, ack, seq_rtt, prior_in_flight, 1);
2833+
tcp_cong_avoid(sk, ack, prior_in_flight, 1);
28342834
}
28352835

28362836
if ((flag & FLAG_FORWARD_PROGRESS) || !(flag&FLAG_NOT_DUP))

net/ipv4/tcp_lp.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,12 @@ static void tcp_lp_init(struct sock *sk)
115115
* Will only call newReno CA when away from inference.
116116
* From TCP-LP's paper, this will be handled in additive increasement.
117117
*/
118-
static void tcp_lp_cong_avoid(struct sock *sk, u32 ack, u32 rtt, u32 in_flight,
119-
int flag)
118+
static void tcp_lp_cong_avoid(struct sock *sk, u32 ack, u32 in_flight, int flag)
120119
{
121120
struct lp *lp = inet_csk_ca(sk);
122121

123122
if (!(lp->flag & LP_WITHIN_INF))
124-
tcp_reno_cong_avoid(sk, ack, rtt, in_flight, flag);
123+
tcp_reno_cong_avoid(sk, ack, in_flight, flag);
125124
}
126125

127126
/**

net/ipv4/tcp_scalable.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#define TCP_SCALABLE_AI_CNT 50U
1616
#define TCP_SCALABLE_MD_SCALE 3
1717

18-
static void tcp_scalable_cong_avoid(struct sock *sk, u32 ack, u32 rtt,
18+
static void tcp_scalable_cong_avoid(struct sock *sk, u32 ack,
1919
u32 in_flight, int flag)
2020
{
2121
struct tcp_sock *tp = tcp_sk(sk);

net/ipv4/tcp_vegas.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ void tcp_vegas_cwnd_event(struct sock *sk, enum tcp_ca_event event)
163163
EXPORT_SYMBOL_GPL(tcp_vegas_cwnd_event);
164164

165165
static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack,
166-
u32 seq_rtt, u32 in_flight, int flag)
166+
u32 in_flight, int flag)
167167
{
168168
struct tcp_sock *tp = tcp_sk(sk);
169169
struct vegas *vegas = inet_csk_ca(sk);
170170

171171
if (!vegas->doing_vegas_now)
172-
return tcp_reno_cong_avoid(sk, ack, seq_rtt, in_flight, flag);
172+
return tcp_reno_cong_avoid(sk, ack, in_flight, flag);
173173

174174
/* The key players are v_beg_snd_una and v_beg_snd_nxt.
175175
*
@@ -228,7 +228,7 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack,
228228
/* We don't have enough RTT samples to do the Vegas
229229
* calculation, so we'll behave like Reno.
230230
*/
231-
tcp_reno_cong_avoid(sk, ack, seq_rtt, in_flight, flag);
231+
tcp_reno_cong_avoid(sk, ack, in_flight, flag);
232232
} else {
233233
u32 rtt, target_cwnd, diff;
234234

net/ipv4/tcp_veno.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ static void tcp_veno_cwnd_event(struct sock *sk, enum tcp_ca_event event)
115115
}
116116

117117
static void tcp_veno_cong_avoid(struct sock *sk, u32 ack,
118-
u32 seq_rtt, u32 in_flight, int flag)
118+
u32 in_flight, int flag)
119119
{
120120
struct tcp_sock *tp = tcp_sk(sk);
121121
struct veno *veno = inet_csk_ca(sk);
122122

123123
if (!veno->doing_veno_now)
124-
return tcp_reno_cong_avoid(sk, ack, seq_rtt, in_flight, flag);
124+
return tcp_reno_cong_avoid(sk, ack, in_flight, flag);
125125

126126
/* limited by applications */
127127
if (!tcp_is_cwnd_limited(sk, in_flight))
@@ -132,7 +132,7 @@ static void tcp_veno_cong_avoid(struct sock *sk, u32 ack,
132132
/* We don't have enough rtt samples to do the Veno
133133
* calculation, so we'll behave like Reno.
134134
*/
135-
tcp_reno_cong_avoid(sk, ack, seq_rtt, in_flight, flag);
135+
tcp_reno_cong_avoid(sk, ack, in_flight, flag);
136136
} else {
137137
u32 rtt, target_cwnd;
138138

net/ipv4/tcp_yeah.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static void tcp_yeah_pkts_acked(struct sock *sk, u32 pkts_acked, ktime_t last)
7070
}
7171

7272
static void tcp_yeah_cong_avoid(struct sock *sk, u32 ack,
73-
u32 seq_rtt, u32 in_flight, int flag)
73+
u32 in_flight, int flag)
7474
{
7575
struct tcp_sock *tp = tcp_sk(sk);
7676
struct yeah *yeah = inet_csk_ca(sk);

0 commit comments

Comments
 (0)