28#ifndef _NETINET_TCP_BBR_H_
29#define _NETINET_TCP_BBR_H_
31#define BBR_INITIAL_RTO 1000000
33#define BBR_ACKED 0x0001
34#define BBR_WAS_RENEGED 0x0002
35#define BBR_RXT_CLEARED 0x0004
36#define BBR_OVERMAX 0x0008
38#define BBR_SACK_PASSED 0x0010
39#define BBR_WAS_SACKPASS 0x0020
40#define BBR_HAS_FIN 0x0040
42#define BBR_HAS_SYN 0x0100
43#define BBR_MARKED_LOST 0x0200
47#define BBR_RWND_COLLAPSED 0x0400
48#define BBR_NUM_OF_RETRANS 7
51#define BBR_INCL_ENET_OH 0x01
52#define BBR_INCL_IP_OH 0x02
53#define BBR_INCL_TCP_OH 0x03
103#define BBR_LIMIT_TYPE_SPLIT 1
107#define BBR_SEGMENT_TIME_SIZE 1500
109#define BBR_MIN_SEG 1460
110#define BBR_MAX_GAIN_VALUE 0xffff
112#define BBR_TIMER_FUDGE 1500
115#define BBR_RED_BW_CONGSIG 0
116#define BBR_RED_BW_RATECAL 1
117#define BBR_RED_BW_USELRBW 2
119#define BBR_RED_BW_SETHIGHLOSS 3
121#define BBR_RED_BW_PE_CLREARLY 4
123#define BBR_RED_BW_PE_CLAFDEL 5
125#define BBR_RED_BW_REC_ENDCLL 6
127#define BBR_RED_BW_PE_NOEARLY_OUT 7
131#define BBR_CALC_LOSS 2
133#define BBR_RTT_BY_TIMESTAMP 0
134#define BBR_RTT_BY_EXACTMATCH 1
135#define BBR_RTT_BY_EARLIER_RET 2
136#define BBR_RTT_BY_THIS_RETRAN 3
137#define BBR_RTT_BY_SOME_RETRAN 4
138#define BBR_RTT_BY_TSMATCHING 5
141#define BBR_PERSISTS_FROM_1 1
142#define BBR_PERSISTS_FROM_2 2
143#define BBR_PERSISTS_FROM_3 3
144#define BBR_PERSISTS_FROM_4 4
145#define BBR_PERSISTS_FROM_5 5
148#define BBR_RTT_PROP 0
149#define BBR_RTT_RACK 1
150#define BBR_RTT_PKTRTT 2
154#define BBR_CUM_ACKED 1
157#define BBR_HIGH_SPEED 1000
158#define BBR_HIGHSPEED_NUM_MSS 12
160#define MAX_REDUCE_RXT 3
173#define BBR_RS_RTT_EMPTY 0x00000001
174#define BBR_RS_BW_EMPTY 0x00000002
175#define BBR_RS_RTT_VALID 0x00000004
176#define BBR_RS_BW_VAILD 0x00000008
177#define BBR_RS_EMPTY (BBR_RS_RTT_EMPTY|BBR_RS_BW_EMPTY)
198#define BBR_RTTS_INIT 0
199#define BBR_RTTS_NEWRTT 1
200#define BBR_RTTS_RTTPROBE 2
201#define BBR_RTTS_WASIDLE 3
202#define BBR_RTTS_PERSIST 4
203#define BBR_RTTS_REACHTAR 5
204#define BBR_RTTS_ENTERPROBE 6
205#define BBR_RTTS_SHRINK_PG 7
206#define BBR_RTTS_SHRINK_PG_FINAL 8
207#define BBR_RTTS_NEW_TARGET 9
208#define BBR_RTTS_LEAVE_DRAIN 10
209#define BBR_RTTS_RESETS_VALUES 11
211#define BBR_NUM_RATES 5
213#define BBR_RT_FLAG_FREE 0x00
214#define BBR_RT_FLAG_INUSE 0x01
215#define BBR_RT_FLAG_READY 0x02
216#define BBR_RT_FLAG_CAPPED_PRE 0x04
217#define BBR_RT_FLAG_CAPPED 0x08
218#define BBR_RT_FLAG_PASTFA 0x10
219#define BBR_RT_FLAG_LIMITED 0x20
220#define BBR_RT_SEEN_A_ACK 0x40
221#define BBR_RT_PREV_RTT_SET 0x80
222#define BBR_RT_PREV_SEND_TIME 0x100
226#define BBR_RT_SET_GRADIENT 0x200
227#define BBR_RT_TS_VALID 0x400
286#define BBR_TO_FRM_TMR 1
287#define BBR_TO_FRM_TLP 2
288#define BBR_TO_FRM_RACK 3
289#define BBR_TO_FRM_KEEP 4
290#define BBR_TO_FRM_PERSIST 5
291#define BBR_TO_FRM_DELACK 6
293#define BBR_SEES_STRETCH_ACK 1
294#define BBR_SEES_COMPRESSED_ACKS 2
328#define TT_BBR_FR_TMR 0x2001
331#define BBR_UNIT (1 << BBR_SCALE)
333#define BBR_NUM_RTTS_FOR_DEL_LIMIT 8
335#define BBR_NUM_RTTS_FOR_GOOG_DEL_LIMIT 10
338#define BBR_SECONDS_NO_RTT 10
339#define BBR_PROBERTT_MAX 200
340#define BBR_PROBERTT_NUM_MSS 4
341#define BBR_STARTUP_EPOCHS 3
342#define USECS_IN_MSEC 1000
343#define BBR_TIME_TO_SECONDS(a) (a / USECS_IN_SECOND)
344#define BBR_TIME_TO_MILLI(a) (a / MS_IN_USEC)
347#define BBR_TS_TO_MS(t) ((t+999)/MS_IN_USEC)
355#define BBR_STATE_STARTUP 0x01
356#define BBR_STATE_DRAIN 0x02
357#define BBR_STATE_PROBE_BW 0x03
358#define BBR_STATE_PROBE_RTT 0x04
359#define BBR_STATE_IDLE_EXIT 0x05
362#define BBR_SUB_GAIN 0
363#define BBR_SUB_DRAIN 1
364#define BBR_SUB_LEVEL1 2
365#define BBR_SUB_LEVEL2 3
366#define BBR_SUB_LEVEL3 4
367#define BBR_SUB_LEVEL4 5
368#define BBR_SUB_LEVEL5 6
369#define BBR_SUB_LEVEL6 7
370#define BBR_SUBSTATE_COUNT 8
373#define BBR_REDUCE_AT_FR 5
375#define BBR_BIG_LOG_SIZE 300000
505#define BBR_STAT_SIZE (sizeof(struct bbr_stats)/sizeof(uint64_t))
507#define BBR_STAT_ADD(name, amm) counter_u64_add(bbr_stat_arry[(offsetof(struct bbr_stats, name)/sizeof(uint64_t))], (amm))
508#define BBR_STAT_INC(name) BBR_STAT_ADD(name, 1)
509#define BBR_OPTS_SIZE (sizeof(struct bbr_stats)/sizeof(uint64_t))
511#define BBR_OPTS_ADD(name, amm) counter_u64_add(bbr_opts_arry[(offsetof(struct bbr_opts_stats, name)/sizeof(uint64_t))], (amm))
512#define BBR_OPTS_INC(name) BBR_OPTS_ADD(name, 1)
515#define BBR_NUM_LOSS_RATES 3
516#define BBR_NUM_BW_RATES 3
518#define BBR_RECOVERY_LOWRTT 1
519#define BBR_RECOVERY_MEDRTT 2
520#define BBR_RECOVERY_HIGHRTT 3
521#define BBR_RECOVERY_EXTREMERTT 4
const struct tcp_hwrate_limit_table * crte
uint16_t rc_num_small_maps_alloced
uint32_t last_startup_measure
uint32_t rc_flight_at_input
uint64_t rc_bbr_lastbtlbw
uint16_t bbr_hptsi_bytes_min
uint32_t rc_pkt_epoch_time
uint32_t rc_bbr_cwnd_gain
uint32_t rc_initial_hptsi_bw
int32_t bbr_hptsi_segments_max
uint32_t rc_pace_max_segs
uint64_t rc_bbr_cur_del_rate
uint32_t r_app_limited_until
uint32_t rc_lost_at_pktepoch
uint32_t bbr_hdwr_cnt_noset_snt
uint32_t rc_num_maps_alloced
uint32_t rc_num_split_allocs
uint32_t rc_tlp_rxt_last_time
uint32_t rc_target_at_state
uint32_t last_in_probertt
struct time_filter rc_delrate
uint32_t startup_last_srtt
uint32_t rc_bbr_enters_probertt
uint32_t rc_recovery_start
uint32_t rc_bbr_last_startup_epoch
uint32_t bbr_smallest_srtt_this_state
uint32_t rc_last_delay_val
int32_t bbr_hptsi_segments_delay_tar
uint32_t rc_went_idle_time
struct sack_filter bbr_sf
uint32_t highest_hdwr_delay
uint32_t rc_rcv_epoch_start
struct bbr_sendmap * rc_tlp_send
uint32_t rc_bbr_state_time
uint32_t rc_pkt_epoch_rtt
uint32_t rc_bbr_hptsi_gain
uint32_t bbr_lost_at_state
uint32_t bbr_ts_check_our_cts
uint32_t r_measurement_count
struct bbr_sendmap * rc_next
uint32_t rc_bbr_state_atflight
uint32_t cur_rtt_send_time
uint32_t bbr_rttprobe_gain_val
uint32_t rc_ack_hdwr_delay
struct bbr_sendmap * rc_sacklast
uint32_t bbr_peer_tsratio
uint32_t rc_hptsi_agg_delay
uint32_t flightsize_at_drain
uint32_t rc_pace_min_segs
uint32_t bbr_ts_check_tstmp
struct bbr_sendmap * rc_resend
uint32_t bbr_smallest_srtt_state2
struct time_filter_small rc_rttprop
uint16_t rc_reorder_shift
uint16_t bbr_google_discount
int32_t bbr_hptsi_per_second
uint32_t rc_lost_at_startup
uint16_t bbr_hptsi_segments_floor
uint32_t rc_pkt_epoch_loss_rate
uint32_t rc_pkt_epoch_del
uint32_t rc_level_state_extra
uint32_t rc_probertt_srttchktim
uint16_t rc_tlp_seg_send_cnt
struct bbr_log entries[0]
uint64_t tcp_bbr_lowgain_half
uint64_t tcp_bbr_topaceout
uint64_t tcp_bbr_algorithm
uint64_t tcp_rack_pace_max_seg
uint64_t tcp_bbr_lowgain_fd
uint64_t tcp_rack_reord_fade
uint64_t tcp_bbr_rec_over_hpts
uint64_t tcp_bbr_drain_inc_extra
uint64_t tcp_bbr_probertt_gain
uint64_t tcp_bbr_pace_seg_min
uint64_t tcp_bbr_lowgain_thresh
uint64_t tcp_use_rackcheat
uint64_t tcp_bbr_pace_seg_max
uint64_t tcp_rack_pkt_delay
uint64_t tcp_bbr_probertt_len
uint64_t tcp_bbr_usedel_rate
uint64_t tcp_bbr_rwnd_is_app
uint64_t tcp_bbr_tslimits
uint64_t tcp_bbr_one_retran
uint64_t tcp_bbr_startup_loss_exit
uint64_t tcp_bbr_use_lowgain
uint64_t tcp_bbr_pace_del_tar
uint64_t tcp_bbr_probe_rtt_int
uint64_t tcp_bbr_drain_pg
uint64_t tcp_bbr_pace_per_sec
uint64_t tcp_floor_min_tso
uint64_t tcp_rack_tlp_thresh
uint64_t tcp_utter_max_tso
uint64_t tcp_bbr_recforce
uint64_t tcp_pacing_oh_tmr
uint64_t tcp_bbr_pace_cross
uint64_t tcp_bbr_unlimited
uint64_t tcp_rack_reord_thresh
uint64_t tcp_bbr_startup_pg
uint64_t tcp_bbr_startup_exit_epoch
uint64_t tcp_bbr_ack_comp_alg
uint32_t rs_rtt_low_seq_start
uint32_t rs_rtt_lowest_sendtime
uint32_t r_first_sent_time
uint8_t r_rtt_not_allowed
uint32_t r_tim_lastsent[BBR_NUM_OF_RETRANS]
uint32_t r_flight_at_send
TAILQ_ENTRY(bbr_sendmap) r_next
uint64_t bbr_hdwr_rl_mod_fail
uint64_t bbr_miss_tso_app
uint64_t bbr_miss_tso_cwnd
uint64_t bbr_alloc_limited
uint64_t bbr_miss_unknown
uint64_t bbr_split_limited
uint64_t bbr_to_alloc_failed
uint64_t bbr_sack_proc_short
uint64_t bbr_tlp_retran_fail
uint64_t bbr_hpts_min_time
uint64_t bbr_paced_segments
uint64_t bbr_acks_with_sacks
uint64_t bbr_rlock_left_ret0
uint64_t bbr_dropped_af_data
uint64_t bbr_collapsed_win
uint64_t bbr_sack_proc_all
uint64_t bbr_progress_drops
uint64_t bbr_alloc_limited_conns
uint64_t bbr_rlock_left_ret1
uint64_t bbr_sack_search_back
uint64_t bbr_sack_search_fwd
uint64_t bbr_persist_reneg
uint64_t bbr_offset_recovery
uint64_t bbr_sack_search_both
uint64_t bbr_reorder_seen
uint64_t bbr_reneges_seen
uint64_t bbr_force_timer_start
uint64_t bbr_rwnd_limited
uint64_t bbr_meets_tso_thresh
uint64_t bbr_failed_mbuf_aloc
uint64_t bbr_hdwr_rl_add_fail
uint64_t bbr_hdwr_rl_mod_ok
uint64_t bbr_force_output
uint64_t bbr_miss_tso_rwnd
uint64_t bbr_cwnd_limited
uint64_t bbr_sack_blocks_skip
uint64_t bbr_hdwr_rl_add_ok
uint64_t bbr_enter_probertt
uint64_t bbr_to_alloc_emerg
uint64_t bbr_dynamic_rwnd
uint64_t bbr_sack_proc_restart
uint8_t xxx_bbr_hdw_pace_idx
uint8_t rc_allow_data_af_clo
int32_t(* r_substate)(struct mbuf *, struct tcphdr *, struct socket *, struct tcpcb *, struct tcpopt *, int32_t, int32_t, uint32_t, int32_t, int32_t, uint8_t)
uint16_t rc_resends_use_tso
uint8_t rc_tlp_in_progress
uint8_t bbr_use_rack_cheat
uint16_t output_error_seen
uint16_t rc_output_starts_timer
uint16_t rc_all_timers_stopped
uint16_t rc_lt_is_sampling
uint16_t rc_ack_was_delayed
uint32_t rc_pacer_started
uint8_t bbr_init_win_cheat
uint8_t rc_use_idle_restart
uint8_t use_policer_detection
uint8_t alloc_limit_reported
uint16_t rc_is_pkt_epoch_now
uint16_t rc_has_collapsed
uint8_t rc_ts_cant_be_used
uint8_t bbr_attempt_hdwr_pace
counter_u64_t bbr_stat_arry[BBR_STAT_SIZE]
TAILQ_HEAD(bbr_head, bbr_sendmap)
counter_u64_t bbr_opts_arry[BBR_OPTS_SIZE]
#define BBR_NUM_OF_RETRANS
struct bbr_rtt_sample __aligned