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 19,401 Lines • ▼ Show 20 Lines | TAILQ_FOREACH_SAFE(dol, &rack->r_ctl.opt_list, next, sdol) { | ||||
TAILQ_REMOVE(&rack->r_ctl.opt_list, dol, next); | TAILQ_REMOVE(&rack->r_ctl.opt_list, dol, next); | ||||
/* Disadvantage of deferal is you loose the error return */ | /* Disadvantage of deferal is you loose the error return */ | ||||
s_optval = (uint32_t)dol->optval; | s_optval = (uint32_t)dol->optval; | ||||
(void)rack_process_option(rack->rc_tp, rack, dol->optname, s_optval, dol->optval); | (void)rack_process_option(rack->rc_tp, rack, dol->optname, s_optval, dol->optval); | ||||
free(dol, M_TCPDO); | free(dol, M_TCPDO); | ||||
} | } | ||||
} | } | ||||
static int | |||||
rack_pru_options(struct tcpcb *tp, int flags) | |||||
{ | |||||
if (flags & PRUS_OOB) | |||||
return (EOPNOTSUPP); | |||||
return (0); | |||||
} | |||||
static struct tcp_function_block __tcp_rack = { | |||||
.tfb_tcp_block_name = __XSTRING(STACKNAME), | |||||
.tfb_tcp_output = rack_output, | |||||
.tfb_do_queued_segments = ctf_do_queued_segments, | |||||
.tfb_do_segment_nounlock = rack_do_segment_nounlock, | |||||
.tfb_tcp_do_segment = rack_do_segment, | |||||
.tfb_tcp_ctloutput = rack_ctloutput, | |||||
.tfb_tcp_fb_init = rack_init, | |||||
.tfb_tcp_fb_fini = rack_fini, | |||||
.tfb_tcp_timer_stop_all = rack_stopall, | |||||
.tfb_tcp_timer_activate = rack_timer_activate, | |||||
.tfb_tcp_timer_active = rack_timer_active, | |||||
.tfb_tcp_timer_stop = rack_timer_stop, | |||||
.tfb_tcp_rexmit_tmr = rack_remxt_tmr, | |||||
.tfb_tcp_handoff_ok = rack_handoff_ok, | |||||
.tfb_tcp_mtu_chg = rack_mtu_change, | |||||
.tfb_pru_options = rack_pru_options, | |||||
}; | |||||
/* | /* | ||||
* rack_ctloutput() must drop the inpcb lock before performing copyin on | * rack_ctloutput() must drop the inpcb lock before performing copyin on | ||||
* socket option arguments. When it re-acquires the lock after the copy, it | * socket option arguments. When it re-acquires the lock after the copy, it | ||||
* has to revalidate that the connection is still valid for the socket | * has to revalidate that the connection is still valid for the socket | ||||
* option. | * option. | ||||
*/ | */ | ||||
static int | static int | ||||
rack_set_sockopt(struct socket *so, struct sockopt *sopt, | rack_set_sockopt(struct socket *so, struct sockopt *sopt, | ||||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | rack_set_sockopt(struct socket *so, struct sockopt *sopt, | ||||
} | } | ||||
if (error) | if (error) | ||||
return (error); | return (error); | ||||
INP_WLOCK(inp); | INP_WLOCK(inp); | ||||
if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { | if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { | ||||
INP_WUNLOCK(inp); | INP_WUNLOCK(inp); | ||||
return (ECONNRESET); | return (ECONNRESET); | ||||
} | } | ||||
if (tp->t_fb != &__tcp_rack) { | |||||
INP_WUNLOCK(inp); | |||||
return (ENOPROTOOPT); | |||||
} | |||||
if (rack->defer_options && (rack->gp_ready == 0) && | if (rack->defer_options && (rack->gp_ready == 0) && | ||||
(sopt->sopt_name != TCP_DEFER_OPTIONS) && | (sopt->sopt_name != TCP_DEFER_OPTIONS) && | ||||
(sopt->sopt_name != TCP_RACK_PACING_BETA) && | (sopt->sopt_name != TCP_RACK_PACING_BETA) && | ||||
(sopt->sopt_name != TCP_RACK_PACING_BETA_ECN) && | (sopt->sopt_name != TCP_RACK_PACING_BETA_ECN) && | ||||
(sopt->sopt_name != TCP_RACK_MEASURE_CNT)) { | (sopt->sopt_name != TCP_RACK_MEASURE_CNT)) { | ||||
/* Options are beind deferred */ | /* Options are beind deferred */ | ||||
if (rack_add_deferred_option(rack, sopt->sopt_name, loptval)) { | if (rack_add_deferred_option(rack, sopt->sopt_name, loptval)) { | ||||
INP_WUNLOCK(inp); | INP_WUNLOCK(inp); | ||||
▲ Show 20 Lines • Show All 319 Lines • ▼ Show 20 Lines | if (sopt->sopt_dir == SOPT_SET) { | ||||
return (rack_set_sockopt(so, sopt, inp, tp, rack)); | return (rack_set_sockopt(so, sopt, inp, tp, rack)); | ||||
} else if (sopt->sopt_dir == SOPT_GET) { | } else if (sopt->sopt_dir == SOPT_GET) { | ||||
return (rack_get_sockopt(so, sopt, inp, tp, rack)); | return (rack_get_sockopt(so, sopt, inp, tp, rack)); | ||||
} | } | ||||
out: | out: | ||||
INP_WUNLOCK(inp); | INP_WUNLOCK(inp); | ||||
return (error); | return (error); | ||||
} | } | ||||
static int | |||||
rack_pru_options(struct tcpcb *tp, int flags) | |||||
{ | |||||
if (flags & PRUS_OOB) | |||||
return (EOPNOTSUPP); | |||||
return (0); | |||||
} | |||||
static struct tcp_function_block __tcp_rack = { | |||||
.tfb_tcp_block_name = __XSTRING(STACKNAME), | |||||
.tfb_tcp_output = rack_output, | |||||
.tfb_do_queued_segments = ctf_do_queued_segments, | |||||
.tfb_do_segment_nounlock = rack_do_segment_nounlock, | |||||
.tfb_tcp_do_segment = rack_do_segment, | |||||
.tfb_tcp_ctloutput = rack_ctloutput, | |||||
.tfb_tcp_fb_init = rack_init, | |||||
.tfb_tcp_fb_fini = rack_fini, | |||||
.tfb_tcp_timer_stop_all = rack_stopall, | |||||
.tfb_tcp_timer_activate = rack_timer_activate, | |||||
.tfb_tcp_timer_active = rack_timer_active, | |||||
.tfb_tcp_timer_stop = rack_timer_stop, | |||||
.tfb_tcp_rexmit_tmr = rack_remxt_tmr, | |||||
.tfb_tcp_handoff_ok = rack_handoff_ok, | |||||
.tfb_tcp_mtu_chg = rack_mtu_change, | |||||
.tfb_pru_options = rack_pru_options, | |||||
}; | |||||
static const char *rack_stack_names[] = { | static const char *rack_stack_names[] = { | ||||
__XSTRING(STACKNAME), | __XSTRING(STACKNAME), | ||||
#ifdef STACKALIAS | #ifdef STACKALIAS | ||||
__XSTRING(STACKALIAS), | __XSTRING(STACKALIAS), | ||||
#endif | #endif | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |