1#ifndef __rack_bbr_common_h__
2#define __rack_bbr_common_h__
32#define TCP_MSS_ACCT_JUSTRET 0
33#define TCP_MSS_ACCT_SNDACK 1
34#define TCP_MSS_ACCT_PERSIST 2
35#define TCP_MSS_ACCT_ATIMER 60
36#define TCP_MSS_ACCT_INPACE 61
37#define TCP_MSS_ACCT_LATE 62
38#define TCP_MSS_SMALL_SIZE_OFF 63
39#define TCP_MSS_ACCT_SIZE 70
40#define TCP_MSS_SMALL_MAX_SIZE_DIV (TCP_MSS_ACCT_SIZE - TCP_MSS_SMALL_SIZE_OFF)
42#define DUP_ACK_THRESHOLD 3
45#define PROGRESS_DROP 1
46#define PROGRESS_UPDATE 2
47#define PROGRESS_CLEAR 3
48#define PROGRESS_START 4
51#define CTF_JR_SENT_DATA 0
52#define CTF_JR_CWND_LIMITED 1
53#define CTF_JR_RWND_LIMITED 2
54#define CTF_JR_APP_LIMITED 3
55#define CTF_JR_ASSESSING 4
56#define CTF_JR_PERSISTS 5
60#define BBR_JR_SENT_DATA CTF_JR_SENT_DATA
61#define BBR_JR_CWND_LIMITED CTF_JR_CWND_LIMITED
62#define BBR_JR_RWND_LIMITED CTF_JR_RWND_LIMITED
63#define BBR_JR_APP_LIMITED CTF_JR_APP_LIMITED
64#define BBR_JR_ASSESSING CTF_JR_ASSESSING
65#define BBR_JR_PERSISTS CTF_JR_PERSISTS
66#define BBR_JR_PRR CTF_JR_PRR
73#define PACE_MAX_IP_BYTES 65536
74#define USECS_IN_SECOND 1000000
75#define MSEC_IN_SECOND 1000
76#define MS_IN_USEC 1000
77#define USEC_TO_MSEC(x) (x / MS_IN_USEC)
78#define TCP_TS_OVERHEAD 12
81#define FORTY_EIGHT_MBPS 6000000
82#define THIRTY_MBPS 3750000
83#define TWENTY_THREE_MBPS 2896000
84#define FIVETWELVE_MBPS 64000000
85#define ONE_POINT_TWO_MEG 150000
95 struct mbuf *m,
int has_pkt);
102 struct tcpcb *tp, int32_t *tlenp,
103 int32_t *thf, int32_t *drop_hdrlen, int32_t *ret_val,
106#define ctf_drop_checks(a, b, c, d, e, f, g, h) _ctf_drop_checks(a, b, c, d, e, f, g, h, NULL, NULL)
110 struct tcphdr *th, int32_t thflags, int32_t tlen,
113#define ctf_do_dropafterack(a, b, c, d, e, f) __ctf_do_dropafterack(a, b, c, d, e, f, NULL, NULL)
117 struct tcphdr *th, int32_t rstreason, int32_t tlen);
124#define ctf_process_rst(m, t, s, p) __ctf_process_rst(m, t, s, p, NULL, NULL)
128 struct tcpcb *tp, int32_t * ret_val);
132 struct tcpcb *tp, int32_t tlen, int32_t thflags, int32_t * ret_val);
142 int32_t rstreason, int32_t tlen);
uint32_t ctf_decay_count(uint32_t count, uint32_t decay_percentage)
int __ctf_process_rst(struct mbuf *m, struct tcphdr *th, struct socket *so, struct tcpcb *tp, uint32_t *ts, uint32_t *cnt)
int32_t ctf_progress_timeout_check(struct tcpcb *tp, bool log)
int ctf_do_queued_segments(struct socket *so, struct tcpcb *tp, int have_pkt)
void ctf_log_sack_filter(struct tcpcb *tp, int num_sack_blks, struct sackblk *sack_blocks)
CTASSERT((PACE_TMR_MASK &0x80)==0)
void ctf_ack_war_checks(struct tcpcb *tp, uint32_t *ts, uint32_t *cnt)
int ctf_ts_check_ac(struct tcpcb *tp, int32_t thflags)
void ctf_do_dropwithreset(struct mbuf *m, struct tcpcb *tp, struct tcphdr *th, int32_t rstreason, int32_t tlen)
void ctf_do_drop(struct mbuf *m, struct tcpcb *tp)
void ctf_challenge_ack(struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, int32_t *ret_val)
int _ctf_drop_checks(struct tcpopt *to, struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, int32_t *tlenp, int32_t *thf, int32_t *drop_hdrlen, int32_t *ret_val, uint32_t *ts, uint32_t *cnt)
uint32_t ctf_outstanding(struct tcpcb *tp)
uint32_t ctf_fixed_maxseg(struct tcpcb *tp)
uint32_t ctf_flight_size(struct tcpcb *tp, uint32_t rc_sacked)
void __ctf_do_dropafterack(struct mbuf *m, struct tcpcb *tp, struct tcphdr *th, int32_t thflags, int32_t tlen, int32_t *ret_val, uint32_t *ts, uint32_t *cnt)
int ctf_process_inbound_raw(struct tcpcb *tp, struct socket *so, struct mbuf *m, int has_pkt)
int ctf_ts_check(struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, int32_t tlen, int32_t thflags, int32_t *ret_val)
void ctf_calc_rwin(struct socket *so, struct tcpcb *tp)
void ctf_do_dropwithreset_conn(struct mbuf *m, struct tcpcb *tp, struct tcphdr *th, int32_t rstreason, int32_t tlen)