Skip to content

Commit 6bed5e2

Browse files
committed
Merge branch 'fix-DCTCP-delayed-ACK'
Yuchung Cheng says: ==================== fix DCTCP delayed ACK This patch series addresses the issue that sometimes DCTCP fail to acknowledge the latest sequence and result in sender timeout if inflight is small. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 5fc853c + a69258f commit 6bed5e2

File tree

3 files changed

+4
-33
lines changed

3 files changed

+4
-33
lines changed

include/net/tcp.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,8 +912,6 @@ enum tcp_ca_event {
912912
CA_EVENT_LOSS, /* loss timeout */
913913
CA_EVENT_ECN_NO_CE, /* ECT set, but not CE marked */
914914
CA_EVENT_ECN_IS_CE, /* received CE marked IP packet */
915-
CA_EVENT_DELAYED_ACK, /* Delayed ack is sent */
916-
CA_EVENT_NON_DELAYED_ACK,
917915
};
918916

919917
/* Information about inbound ACK, passed to cong_ops->in_ack_event() */

net/ipv4/tcp_dctcp.c

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ struct dctcp {
5555
u32 dctcp_alpha;
5656
u32 next_seq;
5757
u32 ce_state;
58-
u32 delayed_ack_reserved;
5958
u32 loss_cwnd;
6059
};
6160

@@ -96,7 +95,6 @@ static void dctcp_init(struct sock *sk)
9695

9796
ca->dctcp_alpha = min(dctcp_alpha_on_init, DCTCP_MAX_ALPHA);
9897

99-
ca->delayed_ack_reserved = 0;
10098
ca->loss_cwnd = 0;
10199
ca->ce_state = 0;
102100

@@ -134,7 +132,8 @@ static void dctcp_ce_state_0_to_1(struct sock *sk)
134132
/* State has changed from CE=0 to CE=1 and delayed
135133
* ACK has not sent yet.
136134
*/
137-
if (!ca->ce_state && ca->delayed_ack_reserved) {
135+
if (!ca->ce_state &&
136+
inet_csk(sk)->icsk_ack.pending & ICSK_ACK_TIMER) {
138137
u32 tmp_rcv_nxt;
139138

140139
/* Save current rcv_nxt. */
@@ -164,7 +163,8 @@ static void dctcp_ce_state_1_to_0(struct sock *sk)
164163
/* State has changed from CE=1 to CE=0 and delayed
165164
* ACK has not sent yet.
166165
*/
167-
if (ca->ce_state && ca->delayed_ack_reserved) {
166+
if (ca->ce_state &&
167+
inet_csk(sk)->icsk_ack.pending & ICSK_ACK_TIMER) {
168168
u32 tmp_rcv_nxt;
169169

170170
/* Save current rcv_nxt. */
@@ -248,25 +248,6 @@ static void dctcp_state(struct sock *sk, u8 new_state)
248248
}
249249
}
250250

251-
static void dctcp_update_ack_reserved(struct sock *sk, enum tcp_ca_event ev)
252-
{
253-
struct dctcp *ca = inet_csk_ca(sk);
254-
255-
switch (ev) {
256-
case CA_EVENT_DELAYED_ACK:
257-
if (!ca->delayed_ack_reserved)
258-
ca->delayed_ack_reserved = 1;
259-
break;
260-
case CA_EVENT_NON_DELAYED_ACK:
261-
if (ca->delayed_ack_reserved)
262-
ca->delayed_ack_reserved = 0;
263-
break;
264-
default:
265-
/* Don't care for the rest. */
266-
break;
267-
}
268-
}
269-
270251
static void dctcp_cwnd_event(struct sock *sk, enum tcp_ca_event ev)
271252
{
272253
switch (ev) {
@@ -276,10 +257,6 @@ static void dctcp_cwnd_event(struct sock *sk, enum tcp_ca_event ev)
276257
case CA_EVENT_ECN_NO_CE:
277258
dctcp_ce_state_1_to_0(sk);
278259
break;
279-
case CA_EVENT_DELAYED_ACK:
280-
case CA_EVENT_NON_DELAYED_ACK:
281-
dctcp_update_ack_reserved(sk, ev);
282-
break;
283260
default:
284261
/* Don't care for the rest. */
285262
break;

net/ipv4/tcp_output.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3523,8 +3523,6 @@ void tcp_send_delayed_ack(struct sock *sk)
35233523
int ato = icsk->icsk_ack.ato;
35243524
unsigned long timeout;
35253525

3526-
tcp_ca_event(sk, CA_EVENT_DELAYED_ACK);
3527-
35283526
if (ato > TCP_DELACK_MIN) {
35293527
const struct tcp_sock *tp = tcp_sk(sk);
35303528
int max_ato = HZ / 2;
@@ -3581,8 +3579,6 @@ void tcp_send_ack(struct sock *sk)
35813579
if (sk->sk_state == TCP_CLOSE)
35823580
return;
35833581

3584-
tcp_ca_event(sk, CA_EVENT_NON_DELAYED_ACK);
3585-
35863582
/* We are not putting this on the write queue, so
35873583
* tcp_transmit_skb() will set the ownership to this
35883584
* sock.

0 commit comments

Comments
 (0)