Index: sys/netinet/cc/cc_dctcp.c =================================================================== --- sys/netinet/cc/cc_dctcp.c +++ sys/netinet/cc/cc_dctcp.c @@ -109,7 +109,7 @@ dctcp_data = ccv->cc_data; - if (CCV(ccv, t_flags) & TF_ECN_PERMIT) { + if (CCV(ccv, t_flags2) & TF2_ECN_PERMIT) { /* * DCTCP doesn't treat receipt of ECN marked packet as a * congestion event. Thus, DCTCP always executes the ACK @@ -168,7 +168,7 @@ { struct dctcp *dctcp_data; - if (CCV(ccv, t_flags) & TF_ECN_PERMIT) { + if (CCV(ccv, t_flags2) & TF2_ECN_PERMIT) { dctcp_data = ccv->cc_data; /* Initialize internal parameters after idle time */ @@ -234,7 +234,7 @@ struct dctcp *dctcp_data; u_int cwin, mss; - if (CCV(ccv, t_flags) & TF_ECN_PERMIT) { + if (CCV(ccv, t_flags2) & TF2_ECN_PERMIT) { dctcp_data = ccv->cc_data; cwin = CCV(ccv, snd_cwnd); mss = CCV(ccv, t_maxseg); @@ -284,7 +284,7 @@ dctcp_data->ece_curr = 1; break; case CC_RTO: - CCV(ccv, t_flags) |= TF_ECN_SND_CWR; + CCV(ccv, t_flags2) |= TF2_ECN_SND_CWR; dctcp_update_alpha(ccv); dctcp_data->save_sndnxt += CCV(ccv, t_maxseg); dctcp_data->num_cong_events++; @@ -301,7 +301,7 @@ dctcp_data = ccv->cc_data; - if (CCV(ccv, t_flags) & TF_ECN_PERMIT) + if (CCV(ccv, t_flags2) & TF2_ECN_PERMIT) dctcp_data->save_sndnxt = CCV(ccv, snd_nxt); } @@ -313,7 +313,7 @@ { newreno_cc_algo.post_recovery(ccv); - if (CCV(ccv, t_flags) & TF_ECN_PERMIT) + if (CCV(ccv, t_flags2) & TF2_ECN_PERMIT) dctcp_update_alpha(ccv); } @@ -344,12 +344,12 @@ if (!dctcp_data->ce_prev && (ccflag & CCF_DELACK)) delay_ack = 0; dctcp_data->ce_prev = 1; - CCV(ccv, t_flags) |= TF_ECN_SND_ECE; + CCV(ccv, t_flags2) |= TF2_ECN_SND_ECE; } else { if (dctcp_data->ce_prev && (ccflag & CCF_DELACK)) delay_ack = 0; dctcp_data->ce_prev = 0; - CCV(ccv, t_flags) &= ~TF_ECN_SND_ECE; + CCV(ccv, t_flags2) &= ~TF2_ECN_SND_ECE; } /* DCTCP sets delayed ack when this segment sets the CWR flag. */ Index: sys/netinet/tcp_input.c =================================================================== --- sys/netinet/tcp_input.c +++ sys/netinet/tcp_input.c @@ -390,16 +390,16 @@ case CC_NDUPACK: if (!IN_FASTRECOVERY(tp->t_flags)) { tp->snd_recover = tp->snd_max; - if (tp->t_flags & TF_ECN_PERMIT) - tp->t_flags |= TF_ECN_SND_CWR; + if (tp->t_flags2 & TF2_ECN_PERMIT) + tp->t_flags2 |= TF2_ECN_SND_CWR; } break; case CC_ECN: if (!IN_CONGRECOVERY(tp->t_flags)) { TCPSTAT_INC(tcps_ecn_rcwnd); tp->snd_recover = tp->snd_max; - if (tp->t_flags & TF_ECN_PERMIT) - tp->t_flags |= TF_ECN_SND_CWR; + if (tp->t_flags2 & TF2_ECN_PERMIT) + tp->t_flags2 |= TF2_ECN_SND_CWR; } break; case CC_RTO: @@ -1489,12 +1489,12 @@ /* * TCP ECN processing. */ - if (tp->t_flags & TF_ECN_PERMIT) { + if (tp->t_flags2 & TF2_ECN_PERMIT) { if (thflags & TH_CWR) - tp->t_flags &= ~TF_ECN_SND_ECE; + tp->t_flags2 &= ~TF2_ECN_SND_ECE; switch (iptos & IPTOS_ECN_MASK) { case IPTOS_ECN_CE: - tp->t_flags |= TF_ECN_SND_ECE; + tp->t_flags2 |= TF2_ECN_SND_ECE; TCPSTAT_INC(tcps_ecn_ce); break; case IPTOS_ECN_ECT0: @@ -1923,7 +1923,7 @@ if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && V_tcp_do_ecn) { - tp->t_flags |= TF_ECN_PERMIT; + tp->t_flags2 |= TF2_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } Index: sys/netinet/tcp_output.c =================================================================== --- sys/netinet/tcp_output.c +++ sys/netinet/tcp_output.c @@ -1135,7 +1135,7 @@ } if (tp->t_state == TCPS_ESTABLISHED && - (tp->t_flags & TF_ECN_PERMIT)) { + (tp->t_flags2 & TF2_ECN_PERMIT)) { /* * If the peer has ECN, mark data packets with * ECN capable transmission (ECT). @@ -1155,11 +1155,11 @@ /* * Reply with proper ECN notifications. */ - if (tp->t_flags & TF_ECN_SND_CWR) { + if (tp->t_flags2 & TF2_ECN_SND_CWR) { flags |= TH_CWR; - tp->t_flags &= ~TF_ECN_SND_CWR; + tp->t_flags2 &= ~TF2_ECN_SND_CWR; } - if (tp->t_flags & TF_ECN_SND_ECE) + if (tp->t_flags2 & TF2_ECN_SND_ECE) flags |= TH_ECE; } Index: sys/netinet/tcp_stacks/rack.c =================================================================== --- sys/netinet/tcp_stacks/rack.c +++ sys/netinet/tcp_stacks/rack.c @@ -1809,16 +1809,16 @@ rack_log_to_prr(rack, 2); rack->r_ctl.rc_prr_recovery_fs = tp->snd_max - tp->snd_una; tp->snd_recover = tp->snd_max; - if (tp->t_flags & TF_ECN_PERMIT) - tp->t_flags |= TF_ECN_SND_CWR; + if (tp->t_flags2 & TF2_ECN_PERMIT) + tp->t_flags2 |= TF2_ECN_SND_CWR; } break; case CC_ECN: if (!IN_CONGRECOVERY(tp->t_flags)) { TCPSTAT_INC(tcps_ecn_rcwnd); tp->snd_recover = tp->snd_max; - if (tp->t_flags & TF_ECN_PERMIT) - tp->t_flags |= TF_ECN_SND_CWR; + if (tp->t_flags2 & TF2_ECN_PERMIT) + tp->t_flags2 |= TF2_ECN_SND_CWR; } break; case CC_RTO: @@ -6307,7 +6307,7 @@ if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && V_tcp_do_ecn) { - tp->t_flags |= TF_ECN_PERMIT; + tp->t_flags2 |= TF2_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } if (SEQ_GT(th->th_ack, tp->snd_una)) { @@ -7708,12 +7708,12 @@ * TCP ECN processing. XXXJTL: If we ever use ECN, we need to move * this to occur after we've validated the segment. */ - if (tp->t_flags & TF_ECN_PERMIT) { + if (tp->t_flags2 & TF2_ECN_PERMIT) { if (thflags & TH_CWR) - tp->t_flags &= ~TF_ECN_SND_ECE; + tp->t_flags2 &= ~TF2_ECN_SND_ECE; switch (iptos & IPTOS_ECN_MASK) { case IPTOS_ECN_CE: - tp->t_flags |= TF_ECN_SND_ECE; + tp->t_flags2 |= TF2_ECN_SND_ECE; TCPSTAT_INC(tcps_ecn_ce); break; case IPTOS_ECN_ECT0: @@ -9470,7 +9470,7 @@ flags |= TH_ECE | TH_CWR; } if (tp->t_state == TCPS_ESTABLISHED && - (tp->t_flags & TF_ECN_PERMIT)) { + (tp->t_flags2 & TF2_ECN_PERMIT)) { /* * If the peer has ECN, mark data packets with ECN capable * transmission (ECT). Ignore pure ack packets, @@ -9489,11 +9489,11 @@ /* * Reply with proper ECN notifications. */ - if (tp->t_flags & TF_ECN_SND_CWR) { + if (tp->t_flags2 & TF2_ECN_SND_CWR) { flags |= TH_CWR; - tp->t_flags &= ~TF_ECN_SND_CWR; + tp->t_flags2 &= ~TF2_ECN_SND_CWR; } - if (tp->t_flags & TF_ECN_SND_ECE) + if (tp->t_flags2 & TF2_ECN_SND_ECE) flags |= TH_ECE; } /* Index: sys/netinet/tcp_syncache.c =================================================================== --- sys/netinet/tcp_syncache.c +++ sys/netinet/tcp_syncache.c @@ -1023,7 +1023,7 @@ } if (sc->sc_flags & SCF_ECN) - tp->t_flags |= TF_ECN_PERMIT; + tp->t_flags2 |= TF2_ECN_PERMIT; /* * Set up MSS and get cached values from tcp_hostcache. Index: sys/netinet/tcp_usrreq.c =================================================================== --- sys/netinet/tcp_usrreq.c +++ sys/netinet/tcp_usrreq.c @@ -1572,7 +1572,7 @@ ti->tcpi_snd_wscale = tp->snd_scale; ti->tcpi_rcv_wscale = tp->rcv_scale; } - if (tp->t_flags & TF_ECN_PERMIT) + if (tp->t_flags2 & TF2_ECN_PERMIT) ti->tcpi_options |= TCPI_OPT_ECN; ti->tcpi_rto = tp->t_rxtcur * tick; @@ -2610,16 +2610,25 @@ db_printf("%sTF_TSO", comma ? ", " : ""); comma = 1; } - if (t_flags & TF_ECN_PERMIT) { - db_printf("%sTF_ECN_PERMIT", comma ? ", " : ""); - comma = 1; - } if (t_flags & TF_FASTOPEN) { db_printf("%sTF_FASTOPEN", comma ? ", " : ""); comma = 1; } } +static void +db_print_tflags2(u_int t_flags2) +{ + int comma; + + comma = 0; + if (t_flags2 & TF2_ECN_PERMIT) { + db_printf("%sTF2_ECN_PERMIT", comma ? ", " : ""); + comma = 1; + } +} + + static void db_print_toobflags(char t_oobflags) { @@ -2667,6 +2676,11 @@ db_print_tflags(tp->t_flags); db_printf(")\n"); + db_print_indent(indent); + db_printf("t_flags2: 0x%x (", tp->t_flags2); + db_print_tflags2(tp->t_flags2); + db_printf(")\n"); + db_print_indent(indent); db_printf("snd_una: 0x%08x snd_max: 0x%08x snd_nxt: x0%08x\n", tp->snd_una, tp->snd_max, tp->snd_nxt); Index: sys/netinet/tcp_var.h =================================================================== --- sys/netinet/tcp_var.h +++ sys/netinet/tcp_var.h @@ -326,6 +326,8 @@ #define TF_NEEDFIN 0x000800 /* send FIN (implicit state) */ #define TF_NOPUSH 0x001000 /* don't push */ #define TF_PREVVALID 0x002000 /* saved values for bad rxmit valid */ +#define TF_UNUSED1 0x00004000 /* unused */ +#define TF_UNUSED2 0x00008000 /* unused */ #define TF_MORETOCOME 0x010000 /* More data to be appended to sock */ #define TF_LQ_OVERFLOW 0x020000 /* listen queue overflow */ #define TF_LASTIDLE 0x040000 /* connection was previously idle */ @@ -336,9 +338,9 @@ #define TF_FORCEDATA 0x800000 /* force out a byte */ #define TF_TSO 0x1000000 /* TSO enabled on this connection */ #define TF_TOE 0x2000000 /* this connection is offloaded */ -#define TF_ECN_PERMIT 0x4000000 /* connection ECN-ready */ -#define TF_ECN_SND_CWR 0x8000000 /* ECN CWR in queue */ -#define TF_ECN_SND_ECE 0x10000000 /* ECN ECE in queue */ +#define TF_UNUSED3 0x4000000 /* unused */ +#define TF_UNUSED4 0x8000000 /* unused */ +#define TF_UNUSED5 0x10000000 /* unused */ #define TF_CONGRECOVERY 0x20000000 /* congestion recovery mode */ #define TF_WASCRECOVERY 0x40000000 /* was in congestion recovery */ #define TF_FASTOPEN 0x80000000 /* TCP Fast Open indication */ @@ -377,6 +379,10 @@ #define TF2_PLPMTU_MAXSEGSNT 0x00000004 /* Last seg sent was full seg. */ #define TF2_LOG_AUTO 0x00000008 /* Session is auto-logging. */ #define TF2_DROP_AF_DATA 0x00000010 /* Drop after all data ack'd */ +#define TF2_ECN_PERMIT 0x00000020 /* connection ECN-ready */ +#define TF2_ECN_SND_CWR 0x00000040 /* ECN CWR in queue */ +#define TF2_ECN_SND_ECE 0x00000080 /* ECN ECE in queue */ +#define TF2_ACE_PERMIT 0x00000100 /* Accurate ECN mode */ /* * Structure to hold TCP options that are only used during segment