Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
minuscat committed Aug 25, 2024
1 parent 2c1b857 commit df5c4cb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion include/linux/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ struct tcp_sock {
u8 dup_ack_counter:2,
tlp_retrans:1, /* TLP is a retransmission */
syn_ect_snt:2, /* AccECN ECT memory, only */
syn_ect_rcv:2; /* ... needed durign 3WHS + first seqno */
syn_ect_rcv:2, /* ... needed durign 3WHS + first seqno */
wait_third_ack:1; /* Need 3rd ack in simultaneous ope nfor AccECN */
u8 accecn_fail_mode:4, /* AccECN failure handling */
saw_accecn_opt:2, /* An AccECN option was seen */
first_data_ack:1; /* Check for first data ack */
Expand Down
1 change: 1 addition & 0 deletions net/ipv4/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3079,6 +3079,7 @@ int tcp_disconnect(struct sock *sk, int flags)
tp->window_clamp = 0;
tp->delivered = 0;
tp->delivered_ce = 0;
tp->wait_third_ack = 0;
tp->accecn_fail_mode = 0;
tp->saw_accecn_opt = TCP_ACCECN_OPT_NOT_SEEN;
tp->first_data_ack = 0;
Expand Down
12 changes: 9 additions & 3 deletions net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -6492,8 +6492,10 @@ static bool tcp_validate_incoming(struct sock *sk, struct sk_buff *skb,
TCP_SKB_CB(skb)->seq + 1 == TCP_SKB_CB(skb)->end_seq &&
TCP_SKB_CB(skb)->seq + 1 == tp->rcv_nxt &&
TCP_SKB_CB(skb)->ack_seq == tp->snd_nxt) {
if (!tcp_ecn_disabled(tp))
if (!tcp_ecn_disabled(tp)) {
tp->wait_third_ack = true;
__tcp_send_ack(sk, tp->rcv_nxt, tcp_accecn_reflector_flags(tp->syn_ect_rcv));
}
goto pass;
}

Expand Down Expand Up @@ -6712,6 +6714,10 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb)
return;

step5:
if (tcp_ecn_mode_accecn(tp) && tp->wait_third_ack) {
tp->wait_third_ack = false;
tcp_accecn_third_ack(sk, skb, tp->syn_ect_snt);
}
tcp_ecn_received_counters(sk, skb, len - th->doff * 4);

reason = tcp_ack(sk, skb, FLAG_SLOWPATH | FLAG_UPDATE_TS_RECENT);
Expand Down Expand Up @@ -7322,13 +7328,13 @@ tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb)
tp->lsndtime = tcp_jiffies32;

tcp_initialize_rcv_mss(sk);
if (tcp_ecn_mode_accecn(tp))
if (tcp_ecn_mode_accecn(tp) && !tp->wait_third_ack)
tcp_accecn_third_ack(sk, skb, tp->syn_ect_snt);
tcp_fast_path_on(tp);
if (sk->sk_shutdown & SEND_SHUTDOWN)
tcp_shutdown(sk, SEND_SHUTDOWN);

if (sk->sk_socket)
if (sk->sk_socket && !tp->wait_third_ack)
goto consume;
break;

Expand Down

0 comments on commit df5c4cb

Please sign in to comment.