Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_stacks/rack.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 13,517 Lines • ▼ Show 20 Lines | #endif | ||||
*/ | */ | ||||
if (tp->t_state == TCPS_SYN_SENT && V_tcp_do_ecn == 1) { | if (tp->t_state == TCPS_SYN_SENT && V_tcp_do_ecn == 1) { | ||||
if (tp->t_rxtshift >= 1) { | if (tp->t_rxtshift >= 1) { | ||||
if (tp->t_rxtshift <= V_tcp_ecn_maxretries) | if (tp->t_rxtshift <= V_tcp_ecn_maxretries) | ||||
flags |= TH_ECE | TH_CWR; | flags |= TH_ECE | TH_CWR; | ||||
} else | } else | ||||
flags |= TH_ECE | TH_CWR; | flags |= TH_ECE | TH_CWR; | ||||
} | } | ||||
if (tp->t_state == TCPS_ESTABLISHED && | if ((tp->t_state == TCPS_ESTABLISHED && | ||||
(tp->t_flags2 & TF2_ECN_PERMIT)) { | (tp->t_flags2 & TF2_ECN_PERMIT)) || | ||||
((tp->t_state > TCPS_ESTABLISHED) && | |||||
(tp->t_flags2 & TF2_ECN_PERMIT) && | |||||
(V_tcp_ecn_plusplus == 2)) || | |||||
/* | /* | ||||
* Note that a passive open SYN,ACK | |||||
* is actually sent from tcp_syncache | |||||
*/ | |||||
(((flags & (TH_SYN|TH_ACK)) == (TH_SYN)) && | |||||
((flags & (TH_ECE|TH_CWR)) == (TH_ECE|TH_CWR)) && | |||||
(V_tcp_ecn_plusplus == 2)) || | |||||
(((flags & (TH_SYN|TH_ACK)) == (TH_SYN|TH_ACK)) && | |||||
(flags & (TH_CWR|TH_ECE)) && | |||||
(V_tcp_ecn_plusplus))) { | |||||
/* | |||||
* If the peer has ECN, mark data packets with ECN capable | * If the peer has ECN, mark data packets with ECN capable | ||||
* transmission (ECT). Ignore pure ack packets, | * transmission (ECT). Ignore pure ack packets, | ||||
* retransmissions. | * retransmissions. | ||||
*/ | */ | ||||
if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) && | if ((V_tcp_ecn_plusplus == 2) || | ||||
(sack_rxmit == 0)) { | (V_tcp_ecn_plusplus && tp->t_state < TCPS_ESTABLISHED) || | ||||
((len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) && | |||||
(sack_rxmit == 0)))) { | |||||
#ifdef INET6 | #ifdef INET6 | ||||
if (isipv6) | if (isipv6) | ||||
ip6->ip6_flow |= htonl(IPTOS_ECN_ECT0 << 20); | ip6->ip6_flow |= htonl(IPTOS_ECN_ECT0 << 20); | ||||
else | else | ||||
#endif | #endif | ||||
ip->ip_tos |= IPTOS_ECN_ECT0; | ip->ip_tos |= IPTOS_ECN_ECT0; | ||||
KMOD_TCPSTAT_INC(tcps_ecn_ect0); | KMOD_TCPSTAT_INC(tcps_ecn_ect0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,552 Lines • Show Last 20 Lines |