Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_usrreq.c
Show First 20 Lines • Show All 1,374 Lines • ▼ Show 20 Lines | if ((tp->t_flags & TF_REQ_SCALE) && (tp->t_flags & TF_RCVD_SCALE)) { | ||||
ti->tcpi_options |= TCPI_OPT_WSCALE; | ti->tcpi_options |= TCPI_OPT_WSCALE; | ||||
ti->tcpi_snd_wscale = tp->snd_scale; | ti->tcpi_snd_wscale = tp->snd_scale; | ||||
ti->tcpi_rcv_wscale = tp->rcv_scale; | ti->tcpi_rcv_wscale = tp->rcv_scale; | ||||
} | } | ||||
if (tp->t_flags & TF_ECN_PERMIT) | if (tp->t_flags & TF_ECN_PERMIT) | ||||
ti->tcpi_options |= TCPI_OPT_ECN; | ti->tcpi_options |= TCPI_OPT_ECN; | ||||
ti->tcpi_rto = tp->t_rxtcur * tick; | ti->tcpi_rto = tp->t_rxtcur * tick; | ||||
ti->tcpi_last_data_recv = ((uint32_t)ticks - tp->t_rcvtime) * tick; | ti->tcpi_last_data_recv = (long)((tcp_ts_getsbintime() - tp->t_rcvtime)/tick_sbt) * tick; | ||||
ti->tcpi_rtt = ((u_int64_t)tp->t_srtt * tick) >> TCP_RTT_SHIFT; | ti->tcpi_rtt = ((u_int64_t)(tp->t_srtt/tick_sbt) * tick); | ||||
ti->tcpi_rttvar = ((u_int64_t)tp->t_rttvar * tick) >> TCP_RTTVAR_SHIFT; | ti->tcpi_rttvar = ((u_int64_t)(tp->t_rttvar/tick_sbt) * tick); | ||||
ti->tcpi_snd_ssthresh = tp->snd_ssthresh; | ti->tcpi_snd_ssthresh = tp->snd_ssthresh; | ||||
ti->tcpi_snd_cwnd = tp->snd_cwnd; | ti->tcpi_snd_cwnd = tp->snd_cwnd; | ||||
/* | /* | ||||
* FreeBSD-specific extension fields for tcp_info. | * FreeBSD-specific extension fields for tcp_info. | ||||
*/ | */ | ||||
ti->tcpi_rcv_space = tp->rcv_wnd; | ti->tcpi_rcv_space = tp->rcv_wnd; | ||||
▲ Show 20 Lines • Show All 776 Lines • ▼ Show 20 Lines | #endif | ||||
} | } | ||||
if (tp->t_state >= TCPS_FIN_WAIT_2) { | if (tp->t_state >= TCPS_FIN_WAIT_2) { | ||||
soisdisconnected(tp->t_inpcb->inp_socket); | soisdisconnected(tp->t_inpcb->inp_socket); | ||||
/* Prevent the connection hanging in FIN_WAIT_2 forever. */ | /* Prevent the connection hanging in FIN_WAIT_2 forever. */ | ||||
if (tp->t_state == TCPS_FIN_WAIT_2) { | if (tp->t_state == TCPS_FIN_WAIT_2) { | ||||
int timeout; | int timeout; | ||||
timeout = (tcp_fast_finwait2_recycle) ? | timeout = (tcp_fast_finwait2_recycle) ? | ||||
tcp_finwait2_timeout : TP_MAXIDLE(tp); | tcp_finwait2_timeout*tick_sbt : TP_MAXIDLE(tp); | ||||
tcp_timer_activate(tp, TT_2MSL, timeout); | tcp_timer_activate(tp, TT_2MSL, timeout); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
#ifdef DDB | #ifdef DDB | ||||
static void | static void | ||||
db_print_indent(int indent) | db_print_indent(int indent) | ||||
▲ Show 20 Lines • Show All 234 Lines • ▼ Show 20 Lines | db_print_tcpcb(struct tcpcb *tp, const char *name, int indent) | ||||
db_printf("snd_wnd: %u snd_cwnd: %u\n", | db_printf("snd_wnd: %u snd_cwnd: %u\n", | ||||
tp->snd_wnd, tp->snd_cwnd); | tp->snd_wnd, tp->snd_cwnd); | ||||
db_print_indent(indent); | db_print_indent(indent); | ||||
db_printf("snd_ssthresh: %u snd_recover: " | db_printf("snd_ssthresh: %u snd_recover: " | ||||
"0x%08x\n", tp->snd_ssthresh, tp->snd_recover); | "0x%08x\n", tp->snd_ssthresh, tp->snd_recover); | ||||
db_print_indent(indent); | db_print_indent(indent); | ||||
db_printf("t_rcvtime: %u t_startime: %u\n", | db_printf("t_rcvtime: %zu t_startime: %zu\n", | ||||
tp->t_rcvtime, tp->t_starttime); | tp->t_rcvtime, tp->t_starttime); | ||||
db_print_indent(indent); | db_print_indent(indent); | ||||
db_printf("t_rttime: %u t_rtsq: 0x%08x\n", | db_printf("t_rttime: %zu t_rtsq: 0x%08x\n", | ||||
tp->t_rtttime, tp->t_rtseq); | tp->t_rtttime, tp->t_rtseq); | ||||
db_print_indent(indent); | db_print_indent(indent); | ||||
db_printf("t_rxtcur: %d t_maxseg: %u t_srtt: %d\n", | db_printf("t_rxtcur: %zu t_maxseg: %u t_srtt: %zu\n", | ||||
tp->t_rxtcur, tp->t_maxseg, tp->t_srtt); | tp->t_rxtcur, tp->t_maxseg, tp->t_srtt); | ||||
db_print_indent(indent); | db_print_indent(indent); | ||||
db_printf("t_rttvar: %d t_rxtshift: %d t_rttmin: %u " | db_printf("t_rttvar: %zu t_rxtshift: %d t_rttmin: %zu " | ||||
"t_rttbest: %u\n", tp->t_rttvar, tp->t_rxtshift, tp->t_rttmin, | "t_rttbest: %zu\n", tp->t_rttvar, tp->t_rxtshift, tp->t_rttmin, | ||||
tp->t_rttbest); | tp->t_rttbest); | ||||
db_print_indent(indent); | db_print_indent(indent); | ||||
db_printf("t_rttupdated: %lu max_sndwnd: %u t_softerror: %d\n", | db_printf("t_rttupdated: %lu max_sndwnd: %u t_softerror: %d\n", | ||||
tp->t_rttupdated, tp->max_sndwnd, tp->t_softerror); | tp->t_rttupdated, tp->max_sndwnd, tp->t_softerror); | ||||
db_print_indent(indent); | db_print_indent(indent); | ||||
db_printf("t_oobflags: 0x%x (", tp->t_oobflags); | db_printf("t_oobflags: 0x%x (", tp->t_oobflags); | ||||
db_print_toobflags(tp->t_oobflags); | db_print_toobflags(tp->t_oobflags); | ||||
db_printf(") t_iobc: 0x%02x\n", tp->t_iobc); | db_printf(") t_iobc: 0x%02x\n", tp->t_iobc); | ||||
db_print_indent(indent); | db_print_indent(indent); | ||||
db_printf("snd_scale: %u rcv_scale: %u request_r_scale: %u\n", | db_printf("snd_scale: %u rcv_scale: %u request_r_scale: %u\n", | ||||
tp->snd_scale, tp->rcv_scale, tp->request_r_scale); | tp->snd_scale, tp->rcv_scale, tp->request_r_scale); | ||||
db_print_indent(indent); | db_print_indent(indent); | ||||
db_printf("ts_recent: %u ts_recent_age: %u\n", | db_printf("ts_recent: %u ts_recent_age: %zu\n", | ||||
tp->ts_recent, tp->ts_recent_age); | tp->ts_recent, tp->ts_recent_age); | ||||
db_print_indent(indent); | db_print_indent(indent); | ||||
db_printf("ts_offset: %u last_ack_sent: 0x%08x snd_cwnd_prev: " | db_printf("last_ack_sent: 0x%08x snd_cwnd_prev: " | ||||
"%u\n", tp->ts_offset, tp->last_ack_sent, tp->snd_cwnd_prev); | "%u\n", tp->last_ack_sent, tp->snd_cwnd_prev); | ||||
db_print_indent(indent); | db_print_indent(indent); | ||||
db_printf("snd_ssthresh_prev: %u snd_recover_prev: 0x%08x " | db_printf("snd_ssthresh_prev: %u snd_recover_prev: 0x%08x " | ||||
"t_badrxtwin: %u\n", tp->snd_ssthresh_prev, | "t_badrxtwin: %zu\n", tp->snd_ssthresh_prev, | ||||
tp->snd_recover_prev, tp->t_badrxtwin); | tp->snd_recover_prev, tp->t_badrxtwin); | ||||
db_print_indent(indent); | db_print_indent(indent); | ||||
db_printf("snd_numholes: %d snd_holes first: %p\n", | db_printf("snd_numholes: %d snd_holes first: %p\n", | ||||
tp->snd_numholes, TAILQ_FIRST(&tp->snd_holes)); | tp->snd_numholes, TAILQ_FIRST(&tp->snd_holes)); | ||||
db_print_indent(indent); | db_print_indent(indent); | ||||
db_printf("snd_fack: 0x%08x rcv_numsacks: %d sack_newdata: " | db_printf("snd_fack: 0x%08x rcv_numsacks: %d sack_newdata: " | ||||
Show All 22 Lines |