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 452 Lines • ▼ Show 20 Lines | |||||
static void rack_fini(struct tcpcb *tp, int32_t tcb_is_purged); | static void rack_fini(struct tcpcb *tp, int32_t tcb_is_purged); | ||||
static int rack_get_sockopt(struct inpcb *inp, struct sockopt *sopt); | static int rack_get_sockopt(struct inpcb *inp, struct sockopt *sopt); | ||||
static void | static void | ||||
rack_do_goodput_measurement(struct tcpcb *tp, struct tcp_rack *rack, | rack_do_goodput_measurement(struct tcpcb *tp, struct tcp_rack *rack, | ||||
tcp_seq th_ack, int line, uint8_t quality); | tcp_seq th_ack, int line, uint8_t quality); | ||||
static uint32_t | static uint32_t | ||||
rack_get_pacing_len(struct tcp_rack *rack, uint64_t bw, uint32_t mss); | rack_get_pacing_len(struct tcp_rack *rack, uint64_t bw, uint32_t mss); | ||||
static int32_t rack_handoff_ok(struct tcpcb *tp); | static int32_t rack_handoff_ok(struct tcpcb *tp); | ||||
static int32_t rack_init(struct tcpcb *tp); | static int32_t rack_init(struct tcpcb *tp, void **ptr); | ||||
static void rack_init_sysctls(void); | static void rack_init_sysctls(void); | ||||
static void | static void | ||||
rack_log_ack(struct tcpcb *tp, struct tcpopt *to, | rack_log_ack(struct tcpcb *tp, struct tcpopt *to, | ||||
struct tcphdr *th, int entered_rec, int dup_ack_struck); | struct tcphdr *th, int entered_rec, int dup_ack_struck); | ||||
static void | static void | ||||
rack_log_output(struct tcpcb *tp, struct tcpopt *to, int32_t len, | rack_log_output(struct tcpcb *tp, struct tcpopt *to, int32_t len, | ||||
uint32_t seq_out, uint16_t th_flags, int32_t err, uint64_t ts, | uint32_t seq_out, uint16_t th_flags, int32_t err, uint64_t ts, | ||||
struct rack_sendmap *hintrsm, uint16_t add_flags, struct mbuf *s_mb, uint32_t s_moff, int hw_tls); | struct rack_sendmap *hintrsm, uint16_t add_flags, struct mbuf *s_mb, uint32_t s_moff, int hw_tls); | ||||
▲ Show 20 Lines • Show All 11,869 Lines • ▼ Show 20 Lines | #endif | ||||
if (rack->r_ctl.fsb.tcp_ip_hdr == NULL) { | if (rack->r_ctl.fsb.tcp_ip_hdr == NULL) { | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} | } | ||||
rack->r_fsb_inited = 0; | rack->r_fsb_inited = 0; | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
rack_init(struct tcpcb *tp) | rack_init(struct tcpcb *tp, void **ptr) | ||||
{ | { | ||||
struct inpcb *inp = tptoinpcb(tp); | struct inpcb *inp = tptoinpcb(tp); | ||||
struct tcp_rack *rack = NULL; | struct tcp_rack *rack = NULL; | ||||
#ifdef INVARIANTS | #ifdef INVARIANTS | ||||
struct rack_sendmap *insret; | struct rack_sendmap *insret; | ||||
#endif | #endif | ||||
uint32_t iwin, snt, us_cts; | uint32_t iwin, snt, us_cts; | ||||
int err; | int err; | ||||
tp->t_fb_ptr = uma_zalloc(rack_pcb_zone, M_NOWAIT); | *ptr = uma_zalloc(rack_pcb_zone, M_NOWAIT); | ||||
if (tp->t_fb_ptr == NULL) { | if (*ptr == NULL) { | ||||
/* | /* | ||||
* We need to allocate memory but cant. The INP and INP_INFO | * We need to allocate memory but cant. The INP and INP_INFO | ||||
* locks and they are recursive (happens during setup. So a | * locks and they are recursive (happens during setup. So a | ||||
* scheme to drop the locks fails :( | * scheme to drop the locks fails :( | ||||
* | * | ||||
*/ | */ | ||||
return (ENOMEM); | return (ENOMEM); | ||||
} | } | ||||
memset(tp->t_fb_ptr, 0, sizeof(struct tcp_rack)); | memset(ptr, 0, sizeof(struct tcp_rack)); | ||||
rack = (struct tcp_rack *)tp->t_fb_ptr; | rack = (struct tcp_rack *)ptr; | ||||
RB_INIT(&rack->r_ctl.rc_mtree); | RB_INIT(&rack->r_ctl.rc_mtree); | ||||
TAILQ_INIT(&rack->r_ctl.rc_free); | TAILQ_INIT(&rack->r_ctl.rc_free); | ||||
TAILQ_INIT(&rack->r_ctl.rc_tmap); | TAILQ_INIT(&rack->r_ctl.rc_tmap); | ||||
rack->rc_tp = tp; | rack->rc_tp = tp; | ||||
rack->rc_inp = inp; | rack->rc_inp = inp; | ||||
/* Set the flag */ | /* Set the flag */ | ||||
rack->r_is_v6 = (inp->inp_vflag & INP_IPV6) != 0; | rack->r_is_v6 = (inp->inp_vflag & INP_IPV6) != 0; | ||||
/* Probably not needed but lets be sure */ | /* Probably not needed but lets be sure */ | ||||
▲ Show 20 Lines • Show All 8,357 Lines • Show Last 20 Lines |