189e560f4SRandall Stewart /*- 2963fb2adSRandall Stewart * Copyright (c) 2016-2020 Netflix, Inc. 389e560f4SRandall Stewart * 489e560f4SRandall Stewart * Redistribution and use in source and binary forms, with or without 589e560f4SRandall Stewart * modification, are permitted provided that the following conditions 689e560f4SRandall Stewart * are met: 789e560f4SRandall Stewart * 1. Redistributions of source code must retain the above copyright 889e560f4SRandall Stewart * notice, this list of conditions and the following disclaimer. 989e560f4SRandall Stewart * 2. Redistributions in binary form must reproduce the above copyright 1089e560f4SRandall Stewart * notice, this list of conditions and the following disclaimer in the 1189e560f4SRandall Stewart * documentation and/or other materials provided with the distribution. 1289e560f4SRandall Stewart * 1389e560f4SRandall Stewart * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1489e560f4SRandall Stewart * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1589e560f4SRandall Stewart * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1689e560f4SRandall Stewart * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 1789e560f4SRandall Stewart * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1889e560f4SRandall Stewart * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 1989e560f4SRandall Stewart * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2089e560f4SRandall Stewart * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2189e560f4SRandall Stewart * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2289e560f4SRandall Stewart * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2389e560f4SRandall Stewart * SUCH DAMAGE. 2489e560f4SRandall Stewart * 2589e560f4SRandall Stewart * $FreeBSD$ 2689e560f4SRandall Stewart */ 2789e560f4SRandall Stewart 2889e560f4SRandall Stewart #ifndef _NETINET_TCP_RACK_H_ 2989e560f4SRandall Stewart #define _NETINET_TCP_RACK_H_ 3089e560f4SRandall Stewart 31141a53cdSRandall Stewart #define RACK_ACKED 0x000001/* The remote endpoint acked this */ 32*c3679af3SGordon Bergling #define RACK_TO_REXT 0x000002/* A timeout occurred on this sendmap entry */ 33141a53cdSRandall Stewart #define RACK_DEFERRED 0x000004/* We can't use this for RTT calc - not used */ 34141a53cdSRandall Stewart #define RACK_OVERMAX 0x000008/* We have more retran's then we can fit */ 35141a53cdSRandall Stewart #define RACK_SACK_PASSED 0x000010/* A sack was done above this block */ 36141a53cdSRandall Stewart #define RACK_WAS_SACKPASS 0x000020/* We retransmitted due to SACK pass */ 37141a53cdSRandall Stewart #define RACK_HAS_FIN 0x000040/* segment is sent with fin */ 38141a53cdSRandall Stewart #define RACK_TLP 0x000080/* segment sent as tail-loss-probe */ 39141a53cdSRandall Stewart #define RACK_RWND_COLLAPSED 0x000100/* The peer collapsed the rwnd on the segment */ 40141a53cdSRandall Stewart #define RACK_APP_LIMITED 0x000200/* We went app limited after this send */ 41141a53cdSRandall Stewart #define RACK_WAS_ACKED 0x000400/* a RTO undid the ack, but it already had a rtt calc done */ 42141a53cdSRandall Stewart #define RACK_HAS_SYN 0x000800/* SYN is on this guy */ 43141a53cdSRandall Stewart #define RACK_SENT_W_DSACK 0x001000/* Sent with a dsack */ 44141a53cdSRandall Stewart #define RACK_SENT_SP 0x002000/* sent in slow path */ 45141a53cdSRandall Stewart #define RACK_SENT_FP 0x004000/* sent in fast path */ 46141a53cdSRandall Stewart #define RACK_HAD_PUSH 0x008000/* Push was sent on original send */ 47141a53cdSRandall Stewart #define RACK_MUST_RXT 0x010000/* We must retransmit this rsm (non-sack/mtu chg)*/ 4889e560f4SRandall Stewart #define RACK_NUM_OF_RETRANS 3 4989e560f4SRandall Stewart 505d8fd932SRandall Stewart #define RACK_INITIAL_RTO 1000000 /* 1 second in microseconds */ 5189e560f4SRandall Stewart 525d8fd932SRandall Stewart #define RACK_REQ_AVG 3 /* Must be less than 256 */ 53963fb2adSRandall Stewart 5489e560f4SRandall Stewart struct rack_sendmap { 555d8fd932SRandall Stewart TAILQ_ENTRY(rack_sendmap) r_tnext; /* Time of transmit based next */ 5689e560f4SRandall Stewart uint32_t r_start; /* Sequence number of the segment */ 5789e560f4SRandall Stewart uint32_t r_end; /* End seq, this is 1 beyond actually */ 5889e560f4SRandall Stewart uint32_t r_rtr_bytes; /* How many bytes have been retransmitted */ 59141a53cdSRandall Stewart uint32_t r_flags : 24, /* Flags as defined above */ 60141a53cdSRandall Stewart r_rtr_cnt : 8; /* Retran count, index this -1 to get time */ 615d8fd932SRandall Stewart struct mbuf *m; 625d8fd932SRandall Stewart uint32_t soff; 635d8fd932SRandall Stewart uint32_t orig_m_len; 64963fb2adSRandall Stewart uint32_t r_nseq_appl; /* If this one is app limited, this is the nxt seq limited */ 6535c7bb34SRandall Stewart uint8_t r_dupack; /* Dup ack count */ 6689e560f4SRandall Stewart uint8_t r_in_tmap; /* Flag to see if its in the r_tnext array */ 675e02b277SJonathan T. Looney uint8_t r_limit_type; /* is this entry counted against a limit? */ 68963fb2adSRandall Stewart uint8_t r_just_ret : 1, /* After sending, the next pkt was just returned, i.e. limited */ 69963fb2adSRandall Stewart r_one_out_nr : 1, /* Special case 1 outstanding and not in recovery */ 705d8fd932SRandall Stewart r_no_rtt_allowed : 1, /* No rtt measurement allowed */ 719e4d9e4cSRandall Stewart r_hw_tls : 1, 729e4d9e4cSRandall Stewart r_avail : 4; 735d8fd932SRandall Stewart uint64_t r_tim_lastsent[RACK_NUM_OF_RETRANS]; 745d8fd932SRandall Stewart uint64_t r_ack_arrival; /* This is the time of ack-arrival (if SACK'd) */ 755d8fd932SRandall Stewart RB_ENTRY(rack_sendmap) r_next; /* RB Tree next */ 764e4c84f8SRandall Stewart uint32_t r_fas; /* Flight at send */ 7789e560f4SRandall Stewart }; 7889e560f4SRandall Stewart 795d8fd932SRandall Stewart struct deferred_opt_list { 805d8fd932SRandall Stewart TAILQ_ENTRY(deferred_opt_list) next; 815d8fd932SRandall Stewart int optname; 825d8fd932SRandall Stewart uint64_t optval; 835d8fd932SRandall Stewart }; 845d8fd932SRandall Stewart 855d8fd932SRandall Stewart /* 865d8fd932SRandall Stewart * Timestamps in the rack sendmap are now moving to be 875d8fd932SRandall Stewart * uint64_t's. This means that if you want a uint32_t 885d8fd932SRandall Stewart * usec timestamp (the old usecond timestamp) you simply have 895d8fd932SRandall Stewart * to cast it to uint32_t. The reason we do this is not for 905d8fd932SRandall Stewart * wrap, but we need to get back, at times, to the millisecond 915d8fd932SRandall Stewart * timestamp that is used in the TSTMP option. To do this we 925d8fd932SRandall Stewart * can use the rack_ts_to_msec() inline below which can take 935d8fd932SRandall Stewart * the 64bit ts and make into the correct timestamp millisecond 945d8fd932SRandall Stewart * wise. Thats not possible with the 32bit usecond timestamp since 955d8fd932SRandall Stewart * the seconds wrap too quickly to cover all bases. 965d8fd932SRandall Stewart * 975d8fd932SRandall Stewart * There are quite a few places in rack where I simply cast 985d8fd932SRandall Stewart * back to uint32_t and then end up using the TSTMP_XX() 995d8fd932SRandall Stewart * macros. This is ok, but we could do simple compares if 1005d8fd932SRandall Stewart * we ever decided to move all of those variables to 64 bits 1015d8fd932SRandall Stewart * as well. 1025d8fd932SRandall Stewart */ 1035d8fd932SRandall Stewart 1045d8fd932SRandall Stewart inline uint64_t 1055d8fd932SRandall Stewart rack_to_usec_ts(struct timeval *tv) 1065d8fd932SRandall Stewart { 1075d8fd932SRandall Stewart return ((tv->tv_sec * HPTS_USEC_IN_SEC) + tv->tv_usec); 1085d8fd932SRandall Stewart } 1095d8fd932SRandall Stewart 1105d8fd932SRandall Stewart inline uint32_t 1115d8fd932SRandall Stewart rack_ts_to_msec(uint64_t ts) 1125d8fd932SRandall Stewart { 1135d8fd932SRandall Stewart return((uint32_t)(ts / HPTS_MSEC_IN_SEC)); 1145d8fd932SRandall Stewart } 1155d8fd932SRandall Stewart 1165d8fd932SRandall Stewart 11735c7bb34SRandall Stewart RB_HEAD(rack_rb_tree_head, rack_sendmap); 11889e560f4SRandall Stewart TAILQ_HEAD(rack_head, rack_sendmap); 1195d8fd932SRandall Stewart TAILQ_HEAD(def_opt_head, deferred_opt_list); 1205d8fd932SRandall Stewart 1215d8fd932SRandall Stewart /* Map change logging */ 1225d8fd932SRandall Stewart #define MAP_MERGE 0x01 1235d8fd932SRandall Stewart #define MAP_SPLIT 0x02 1245d8fd932SRandall Stewart #define MAP_NEW 0x03 1255d8fd932SRandall Stewart #define MAP_SACK_M1 0x04 1265d8fd932SRandall Stewart #define MAP_SACK_M2 0x05 1275d8fd932SRandall Stewart #define MAP_SACK_M3 0x06 1285d8fd932SRandall Stewart #define MAP_SACK_M4 0x07 1295d8fd932SRandall Stewart #define MAP_SACK_M5 0x08 1305d8fd932SRandall Stewart #define MAP_FREE 0x09 1315d8fd932SRandall Stewart #define MAP_TRIM_HEAD 0x0a 13289e560f4SRandall Stewart 13335c7bb34SRandall Stewart #define RACK_LIMIT_TYPE_SPLIT 1 13489e560f4SRandall Stewart 13589e560f4SRandall Stewart /* 13689e560f4SRandall Stewart * We use the rate sample structure to 13789e560f4SRandall Stewart * assist in single sack/ack rate and rtt 13889e560f4SRandall Stewart * calculation. In the future we will expand 13989e560f4SRandall Stewart * this in BBR to do forward rate sample 14089e560f4SRandall Stewart * b/w estimation. 14189e560f4SRandall Stewart */ 14289e560f4SRandall Stewart #define RACK_RTT_EMPTY 0x00000001 /* Nothing yet stored in RTT's */ 14389e560f4SRandall Stewart #define RACK_RTT_VALID 0x00000002 /* We have at least one valid RTT */ 14489e560f4SRandall Stewart struct rack_rtt_sample { 14589e560f4SRandall Stewart uint32_t rs_flags; 14689e560f4SRandall Stewart uint32_t rs_rtt_lowest; 14789e560f4SRandall Stewart uint32_t rs_rtt_highest; 14889e560f4SRandall Stewart uint32_t rs_rtt_cnt; 149963fb2adSRandall Stewart uint32_t rs_us_rtt; 150963fb2adSRandall Stewart int32_t confidence; 15189e560f4SRandall Stewart uint64_t rs_rtt_tot; 152963fb2adSRandall Stewart uint16_t rs_us_rtrcnt; 15389e560f4SRandall Stewart }; 15489e560f4SRandall Stewart 15589e560f4SRandall Stewart #define RACK_LOG_TYPE_ACK 0x01 15689e560f4SRandall Stewart #define RACK_LOG_TYPE_OUT 0x02 15789e560f4SRandall Stewart #define RACK_LOG_TYPE_TO 0x03 15889e560f4SRandall Stewart #define RACK_LOG_TYPE_ALLOC 0x04 15989e560f4SRandall Stewart #define RACK_LOG_TYPE_FREE 0x05 16089e560f4SRandall Stewart 16189e560f4SRandall Stewart /* 16289e560f4SRandall Stewart * Magic numbers for logging timeout events if the 16389e560f4SRandall Stewart * logging is enabled. 16489e560f4SRandall Stewart */ 16589e560f4SRandall Stewart #define RACK_TO_FRM_TMR 1 16689e560f4SRandall Stewart #define RACK_TO_FRM_TLP 2 16789e560f4SRandall Stewart #define RACK_TO_FRM_RACK 3 16889e560f4SRandall Stewart #define RACK_TO_FRM_KEEP 4 16989e560f4SRandall Stewart #define RACK_TO_FRM_PERSIST 5 17089e560f4SRandall Stewart #define RACK_TO_FRM_DELACK 6 17189e560f4SRandall Stewart 17289e560f4SRandall Stewart struct rack_opts_stats { 17389e560f4SRandall Stewart uint64_t tcp_rack_tlp_reduce; 17489e560f4SRandall Stewart uint64_t tcp_rack_pace_always; 17589e560f4SRandall Stewart uint64_t tcp_rack_pace_reduce; 17689e560f4SRandall Stewart uint64_t tcp_rack_max_seg; 17789e560f4SRandall Stewart uint64_t tcp_rack_prr_sendalot; 17889e560f4SRandall Stewart uint64_t tcp_rack_min_to; 17989e560f4SRandall Stewart uint64_t tcp_rack_early_seg; 18089e560f4SRandall Stewart uint64_t tcp_rack_reord_thresh; 18189e560f4SRandall Stewart uint64_t tcp_rack_reord_fade; 18289e560f4SRandall Stewart uint64_t tcp_rack_tlp_thresh; 18389e560f4SRandall Stewart uint64_t tcp_rack_pkt_delay; 18489e560f4SRandall Stewart uint64_t tcp_rack_tlp_inc_var; 18589e560f4SRandall Stewart uint64_t tcp_tlp_use; 18689e560f4SRandall Stewart uint64_t tcp_rack_idle_reduce; 18789e560f4SRandall Stewart uint64_t tcp_rack_idle_reduce_high; 18889e560f4SRandall Stewart uint64_t rack_no_timer_in_hpts; 18989e560f4SRandall Stewart uint64_t tcp_rack_min_pace_seg; 190963fb2adSRandall Stewart uint64_t tcp_rack_pace_rate_ca; 191963fb2adSRandall Stewart uint64_t tcp_rack_rr; 1921cf55767SRandall Stewart uint64_t tcp_rack_do_detection; 193963fb2adSRandall Stewart uint64_t tcp_rack_rrr_no_conf_rate; 194963fb2adSRandall Stewart uint64_t tcp_initial_rate; 195963fb2adSRandall Stewart uint64_t tcp_initial_win; 196963fb2adSRandall Stewart uint64_t tcp_hdwr_pacing; 197963fb2adSRandall Stewart uint64_t tcp_gp_inc_ss; 198963fb2adSRandall Stewart uint64_t tcp_gp_inc_ca; 199963fb2adSRandall Stewart uint64_t tcp_gp_inc_rec; 200963fb2adSRandall Stewart uint64_t tcp_rack_force_max_seg; 201963fb2adSRandall Stewart uint64_t tcp_rack_pace_rate_ss; 202963fb2adSRandall Stewart uint64_t tcp_rack_pace_rate_rec; 203963fb2adSRandall Stewart /* Temp counters for dsack */ 204963fb2adSRandall Stewart uint64_t tcp_sack_path_1; 205963fb2adSRandall Stewart uint64_t tcp_sack_path_2a; 206963fb2adSRandall Stewart uint64_t tcp_sack_path_2b; 207963fb2adSRandall Stewart uint64_t tcp_sack_path_3; 208963fb2adSRandall Stewart uint64_t tcp_sack_path_4; 209963fb2adSRandall Stewart /* non temp counters */ 210963fb2adSRandall Stewart uint64_t tcp_rack_scwnd; 211963fb2adSRandall Stewart uint64_t tcp_rack_noprr; 212963fb2adSRandall Stewart uint64_t tcp_rack_cfg_rate; 213963fb2adSRandall Stewart uint64_t tcp_timely_dyn; 214963fb2adSRandall Stewart uint64_t tcp_rack_mbufq; 215963fb2adSRandall Stewart uint64_t tcp_fillcw; 216963fb2adSRandall Stewart uint64_t tcp_npush; 217963fb2adSRandall Stewart uint64_t tcp_lscwnd; 218963fb2adSRandall Stewart uint64_t tcp_profile; 2195d8fd932SRandall Stewart uint64_t tcp_hdwr_rate_cap; 2205d8fd932SRandall Stewart uint64_t tcp_pacing_rate_cap; 2215d8fd932SRandall Stewart uint64_t tcp_pacing_up_only; 2225d8fd932SRandall Stewart uint64_t tcp_use_cmp_acks; 2235d8fd932SRandall Stewart uint64_t tcp_rack_abc_val; 2245d8fd932SRandall Stewart uint64_t tcp_rec_abc_val; 2255d8fd932SRandall Stewart uint64_t tcp_rack_measure_cnt; 2265d8fd932SRandall Stewart uint64_t tcp_rack_delayed_ack; 2275d8fd932SRandall Stewart uint64_t tcp_rack_rtt_use; 2285d8fd932SRandall Stewart uint64_t tcp_data_after_close; 2295d8fd932SRandall Stewart uint64_t tcp_defer_opt; 2305d8fd932SRandall Stewart uint64_t tcp_rack_fastrsm_hack; 2315d8fd932SRandall Stewart uint64_t tcp_rack_beta; 2325d8fd932SRandall Stewart uint64_t tcp_rack_beta_ecn; 2334f3addd9SRandall Stewart uint64_t tcp_rack_timer_slop; 2345baf32c9SRandall Stewart uint64_t tcp_rack_dsack_opt; 23589e560f4SRandall Stewart }; 23689e560f4SRandall Stewart 237963fb2adSRandall Stewart /* RTT shrink reasons */ 238963fb2adSRandall Stewart #define RACK_RTTS_INIT 0 239963fb2adSRandall Stewart #define RACK_RTTS_NEWRTT 1 240963fb2adSRandall Stewart #define RACK_RTTS_EXITPROBE 2 241963fb2adSRandall Stewart #define RACK_RTTS_ENTERPROBE 3 242963fb2adSRandall Stewart #define RACK_RTTS_REACHTARGET 4 243963fb2adSRandall Stewart #define RACK_RTTS_SEEHBP 5 244963fb2adSRandall Stewart #define RACK_RTTS_NOBACKOFF 6 245963fb2adSRandall Stewart #define RACK_RTTS_SAFETY 7 246963fb2adSRandall Stewart 247963fb2adSRandall Stewart #define RACK_USE_BEG 1 248963fb2adSRandall Stewart #define RACK_USE_END 2 249963fb2adSRandall Stewart #define RACK_USE_END_OR_THACK 3 250963fb2adSRandall Stewart 25189e560f4SRandall Stewart #define TLP_USE_ID 1 /* Internet draft behavior */ 25289e560f4SRandall Stewart #define TLP_USE_TWO_ONE 2 /* Use 2.1 behavior */ 25389e560f4SRandall Stewart #define TLP_USE_TWO_TWO 3 /* Use 2.2 behavior */ 254963fb2adSRandall Stewart #define RACK_MIN_BW 8000 /* 64kbps in Bps */ 25589e560f4SRandall Stewart 256e834f9a4SRandall Stewart /* Rack quality indicators for GPUT measurements */ 257e834f9a4SRandall Stewart #define RACK_QUALITY_NONE 0 /* No quality stated */ 258e834f9a4SRandall Stewart #define RACK_QUALITY_HIGH 1 /* A normal measurement of a GP RTT */ 259e834f9a4SRandall Stewart #define RACK_QUALITY_APPLIMITED 2 /* An app limited case that may be of lower quality */ 260e834f9a4SRandall Stewart #define RACK_QUALITY_PERSIST 3 /* A measurement where we went into persists */ 261e834f9a4SRandall Stewart #define RACK_QUALITY_PROBERTT 4 /* A measurement where we went into or exited probe RTT */ 262e834f9a4SRandall Stewart #define RACK_QUALITY_ALLACKED 5 /* All data is now acknowledged */ 263e834f9a4SRandall Stewart 2646edfc10cSRandall Stewart /*********************/ 2656edfc10cSRandall Stewart /* Rack Trace points */ 2666edfc10cSRandall Stewart /*********************/ 2676edfc10cSRandall Stewart /* 2686edfc10cSRandall Stewart * Rack trace points are interesting points within 2696edfc10cSRandall Stewart * the rack code that the author/debugger may want 2706edfc10cSRandall Stewart * to have BB logging enabled if we hit that point. 2716edfc10cSRandall Stewart * In order to enable a trace point you set the 2726edfc10cSRandall Stewart * sysctl var net.inet.tcp.<stack>.tp.number to 2736edfc10cSRandall Stewart * one of the numbers listed below. You also 2746edfc10cSRandall Stewart * must make sure net.inet.tcp.<stack>.tp.bbmode is 275bd9e23c0SGordon Bergling * non-zero, the default is 4 for continuous tracing. 2766edfc10cSRandall Stewart * You also set in the number of connections you want 2776edfc10cSRandall Stewart * have get BB logs in net.inet.tcp.<stack>.tp.count. 2786edfc10cSRandall Stewart * 2796edfc10cSRandall Stewart * Count will decrement every time BB logging is assigned 2806edfc10cSRandall Stewart * to a connection that hit your tracepoint. 2816edfc10cSRandall Stewart * 2826edfc10cSRandall Stewart * You can enable all trace points by setting the number 2836edfc10cSRandall Stewart * to 0xffffffff. You can disable all trace points by 2846edfc10cSRandall Stewart * setting number to zero (or count to 0). 2856edfc10cSRandall Stewart * 2866edfc10cSRandall Stewart * Below are the enumerated list of tracepoints that 2876edfc10cSRandall Stewart * have currently been defined in the code. Add more 2886edfc10cSRandall Stewart * as you add a call to rack_trace_point(rack, <name>); 2896edfc10cSRandall Stewart * where <name> is defined below. 2906edfc10cSRandall Stewart */ 2916edfc10cSRandall Stewart #define RACK_TP_HWENOBUF 0x00000001 /* When we are doing hardware pacing and hit enobufs */ 2926edfc10cSRandall Stewart #define RACK_TP_ENOBUF 0x00000002 /* When we hit enobufs with software pacing */ 2936edfc10cSRandall Stewart #define RACK_TP_COLLAPSED_WND 0x00000003 /* When a peer to collapses its rwnd on us */ 29462ce18fcSRandall Stewart #define RACK_TP_COLLAPSED_RXT 0x00000004 /* When we actually retransmit a collapsed window rsm */ 295e834f9a4SRandall Stewart 296963fb2adSRandall Stewart #define MIN_GP_WIN 6 /* We need at least 6 MSS in a GP measurement */ 29789e560f4SRandall Stewart #ifdef _KERNEL 29889e560f4SRandall Stewart #define RACK_OPTS_SIZE (sizeof(struct rack_opts_stats)/sizeof(uint64_t)) 29989e560f4SRandall Stewart extern counter_u64_t rack_opts_arry[RACK_OPTS_SIZE]; 30089e560f4SRandall Stewart #define RACK_OPTS_ADD(name, amm) counter_u64_add(rack_opts_arry[(offsetof(struct rack_opts_stats, name)/sizeof(uint64_t))], (amm)) 30189e560f4SRandall Stewart #define RACK_OPTS_INC(name) RACK_OPTS_ADD(name, 1) 30289e560f4SRandall Stewart #endif 30389e560f4SRandall Stewart /* 30489e560f4SRandall Stewart * As we get each SACK we wade through the 30589e560f4SRandall Stewart * rc_map and mark off what is acked. 30689e560f4SRandall Stewart * We also increment rc_sacked as well. 30789e560f4SRandall Stewart * 30889e560f4SRandall Stewart * We also pay attention to missing entries 30989e560f4SRandall Stewart * based on the time and possibly mark them 31089e560f4SRandall Stewart * for retransmit. If we do and we are not already 31189e560f4SRandall Stewart * in recovery we enter recovery. In doing 31289e560f4SRandall Stewart * so we claer prr_delivered/holes_rxt and prr_sent_dur_rec. 31389e560f4SRandall Stewart * We also setup rc_next/rc_snd_nxt/rc_send_end so 31489e560f4SRandall Stewart * we will know where to send from. When not in 31589e560f4SRandall Stewart * recovery rc_next will be NULL and rc_snd_nxt should 31689e560f4SRandall Stewart * equal snd_max. 31789e560f4SRandall Stewart * 31889e560f4SRandall Stewart * Whenever we retransmit from recovery we increment 31989e560f4SRandall Stewart * rc_holes_rxt as we retran a block and mark it as retransmitted 32089e560f4SRandall Stewart * with the time it was sent. During non-recovery sending we 32189e560f4SRandall Stewart * add to our map and note the time down of any send expanding 32289e560f4SRandall Stewart * the rc_map at the tail and moving rc_snd_nxt up with snd_max. 32389e560f4SRandall Stewart * 32489e560f4SRandall Stewart * In recovery during SACK/ACK processing if a chunk has 32589e560f4SRandall Stewart * been retransmitted and it is now acked, we decrement rc_holes_rxt. 32689e560f4SRandall Stewart * When we retransmit from the scoreboard we use 32789e560f4SRandall Stewart * rc_next and rc_snd_nxt/rc_send_end to help us 32889e560f4SRandall Stewart * find what needs to be retran. 32989e560f4SRandall Stewart * 33089e560f4SRandall Stewart * To calculate pipe we simply take (snd_max - snd_una) + rc_holes_rxt 33189e560f4SRandall Stewart * This gets us the effect of RFC6675 pipe, counting twice for 33289e560f4SRandall Stewart * bytes retransmitted. 33389e560f4SRandall Stewart */ 33489e560f4SRandall Stewart 33589e560f4SRandall Stewart #define TT_RACK_FR_TMR 0x2000 33689e560f4SRandall Stewart 33789e560f4SRandall Stewart /* 33889e560f4SRandall Stewart * Locking for the rack control block. 33989e560f4SRandall Stewart * a) Locked by INP_WLOCK 34089e560f4SRandall Stewart * b) Locked by the hpts-mutex 34189e560f4SRandall Stewart * 34289e560f4SRandall Stewart */ 34335c7bb34SRandall Stewart #define RACK_GP_HIST 4 /* How much goodput history do we maintain? */ 34489e560f4SRandall Stewart 3455d8fd932SRandall Stewart #define RACK_NUM_FSB_DEBUG 16 346e834f9a4SRandall Stewart #ifdef _KERNEL 3475d8fd932SRandall Stewart struct rack_fast_send_blk { 3485d8fd932SRandall Stewart uint32_t left_to_send; 3495d8fd932SRandall Stewart uint16_t tcp_ip_hdr_len; 3505d8fd932SRandall Stewart uint8_t tcp_flags; 3515d8fd932SRandall Stewart uint8_t hoplimit; 3525d8fd932SRandall Stewart uint8_t *tcp_ip_hdr; 3535d8fd932SRandall Stewart uint32_t recwin; 3545d8fd932SRandall Stewart uint32_t off; 3555d8fd932SRandall Stewart struct tcphdr *th; 3565d8fd932SRandall Stewart struct udphdr *udp; 3575d8fd932SRandall Stewart struct mbuf *m; 3585d8fd932SRandall Stewart uint32_t o_m_len; 3595d8fd932SRandall Stewart uint32_t rfo_apply_push : 1, 3609e4d9e4cSRandall Stewart hw_tls : 1, 3619e4d9e4cSRandall Stewart unused : 30; 3625d8fd932SRandall Stewart }; 3635d8fd932SRandall Stewart 36489e560f4SRandall Stewart struct rack_control { 36589e560f4SRandall Stewart /* Second cache line 0x40 from tcp_rack */ 36635c7bb34SRandall Stewart struct rack_rb_tree_head rc_mtree; /* Tree of all segments Lock(a) */ 36789e560f4SRandall Stewart struct rack_head rc_tmap; /* List in transmit order Lock(a) */ 36889e560f4SRandall Stewart struct rack_sendmap *rc_tlpsend; /* Remembered place for 36989e560f4SRandall Stewart * tlp_sending Lock(a) */ 37089e560f4SRandall Stewart struct rack_sendmap *rc_resend; /* something we have been asked to 37189e560f4SRandall Stewart * resend */ 3725d8fd932SRandall Stewart struct rack_fast_send_blk fsb; /* The fast-send block */ 3734f3addd9SRandall Stewart uint32_t timer_slop; 37435c7bb34SRandall Stewart uint32_t input_pkt; 37535c7bb34SRandall Stewart uint32_t saved_input_pkt; 37689e560f4SRandall Stewart uint32_t rc_hpts_flags; 377963fb2adSRandall Stewart uint32_t rc_fixed_pacing_rate_ca; 378963fb2adSRandall Stewart uint32_t rc_fixed_pacing_rate_rec; 379963fb2adSRandall Stewart uint32_t rc_fixed_pacing_rate_ss; 380963fb2adSRandall Stewart uint32_t cwnd_to_use; /* The cwnd in use */ 38189e560f4SRandall Stewart uint32_t rc_timer_exp; /* If a timer ticks of expiry */ 38289e560f4SRandall Stewart uint32_t rc_rack_min_rtt; /* lowest RTT seen Lock(a) */ 38389e560f4SRandall Stewart uint32_t rc_rack_largest_cwnd; /* Largest CWND we have seen Lock(a) */ 38489e560f4SRandall Stewart 38589e560f4SRandall Stewart /* Third Cache line 0x80 */ 38689e560f4SRandall Stewart struct rack_head rc_free; /* Allocation array */ 3875d8fd932SRandall Stewart uint64_t last_hw_bw_req; 3885d8fd932SRandall Stewart uint64_t crte_prev_rate; 3895d8fd932SRandall Stewart uint64_t bw_rate_cap; 39089e560f4SRandall Stewart uint32_t rc_reorder_ts; /* Last time we saw reordering Lock(a) */ 39189e560f4SRandall Stewart 39289e560f4SRandall Stewart uint32_t rc_tlp_new_data; /* we need to send new-data on a TLP 39389e560f4SRandall Stewart * Lock(a) */ 39489e560f4SRandall Stewart uint32_t rc_prr_out; /* bytes sent during recovery Lock(a) */ 39589e560f4SRandall Stewart 39689e560f4SRandall Stewart uint32_t rc_prr_recovery_fs; /* recovery fs point Lock(a) */ 39789e560f4SRandall Stewart 39889e560f4SRandall Stewart uint32_t rc_prr_sndcnt; /* Prr sndcnt Lock(a) */ 39989e560f4SRandall Stewart 40089e560f4SRandall Stewart uint32_t rc_sacked; /* Tot sacked on scoreboard Lock(a) */ 4015baf32c9SRandall Stewart uint32_t last_sent_tlp_seq; /* Last tlp sequence that was retransmitted Lock(a) */ 40289e560f4SRandall Stewart 40389e560f4SRandall Stewart uint32_t rc_prr_delivered; /* during recovery prr var Lock(a) */ 404963fb2adSRandall Stewart uint16_t rc_tlp_cnt_out; /* count of times we have sent a TLP without new data */ 4055baf32c9SRandall Stewart uint16_t last_sent_tlp_len; /* Number of bytes in the last sent tlp */ 40689e560f4SRandall Stewart 407963fb2adSRandall Stewart uint32_t rc_loss_count; /* How many bytes have been retransmitted 40889e560f4SRandall Stewart * Lock(a) */ 40989e560f4SRandall Stewart uint32_t rc_reorder_fade; /* Socket option value Lock(a) */ 41089e560f4SRandall Stewart 41189e560f4SRandall Stewart /* Forth cache line 0xc0 */ 41289e560f4SRandall Stewart /* Times */ 41389e560f4SRandall Stewart 41489e560f4SRandall Stewart uint32_t rc_rack_tmit_time; /* Rack transmit time Lock(a) */ 41589e560f4SRandall Stewart uint32_t rc_holes_rxt; /* Tot retraned from scoreboard Lock(a) */ 41689e560f4SRandall Stewart 41789e560f4SRandall Stewart uint32_t rc_num_maps_alloced; /* Number of map blocks (sacks) we 41889e560f4SRandall Stewart * have allocated */ 41989e560f4SRandall Stewart uint32_t rc_rcvtime; /* When we last received data */ 4205e02b277SJonathan T. Looney uint32_t rc_num_split_allocs; /* num split map entries allocated */ 42135c7bb34SRandall Stewart 42289e560f4SRandall Stewart uint32_t rc_last_output_to; 42389e560f4SRandall Stewart uint32_t rc_went_idle_time; 42489e560f4SRandall Stewart 42589e560f4SRandall Stewart struct rack_sendmap *rc_sacklast; /* sack remembered place 42689e560f4SRandall Stewart * Lock(a) */ 42789e560f4SRandall Stewart 428963fb2adSRandall Stewart struct rack_sendmap *rc_first_appl; /* Pointer to first app limited */ 429963fb2adSRandall Stewart struct rack_sendmap *rc_end_appl; /* Pointer to last app limited */ 43089e560f4SRandall Stewart /* Cache line split 0x100 */ 43189e560f4SRandall Stewart struct sack_filter rack_sf; 43289e560f4SRandall Stewart /* Cache line split 0x140 */ 43389e560f4SRandall Stewart /* Flags for various things */ 43435c7bb34SRandall Stewart uint32_t rc_pace_max_segs; 43535c7bb34SRandall Stewart uint32_t rc_pace_min_segs; 436963fb2adSRandall Stewart uint32_t rc_app_limited_cnt; 437963fb2adSRandall Stewart uint16_t rack_per_of_gp_ss; /* 100 = 100%, so from 65536 = 655 x bw */ 438963fb2adSRandall Stewart uint16_t rack_per_of_gp_ca; /* 100 = 100%, so from 65536 = 655 x bw */ 439963fb2adSRandall Stewart uint16_t rack_per_of_gp_rec; /* 100 = 100%, so from 65536 = 655 x bw, 0=off */ 440963fb2adSRandall Stewart uint16_t rack_per_of_gp_probertt; /* 100 = 100%, so from 65536 = 655 x bw, 0=off */ 44135c7bb34SRandall Stewart uint32_t rc_high_rwnd; 44235c7bb34SRandall Stewart uint32_t ack_count; 44335c7bb34SRandall Stewart uint32_t sack_count; 44435c7bb34SRandall Stewart uint32_t sack_noextra_move; 44535c7bb34SRandall Stewart uint32_t sack_moved_extra; 44689e560f4SRandall Stewart struct rack_rtt_sample rack_rs; 447963fb2adSRandall Stewart const struct tcp_hwrate_limit_table *crte; 448963fb2adSRandall Stewart uint32_t rc_agg_early; 449963fb2adSRandall Stewart uint32_t rc_agg_delayed; 45035c7bb34SRandall Stewart uint32_t rc_tlp_rxt_last_time; 45135c7bb34SRandall Stewart uint32_t rc_saved_cwnd; 4525d8fd932SRandall Stewart uint64_t rc_gp_output_ts; /* chg*/ 4535d8fd932SRandall Stewart uint64_t rc_gp_cumack_ts; /* chg*/ 454963fb2adSRandall Stewart struct timeval act_rcv_time; 455963fb2adSRandall Stewart struct timeval rc_last_time_decay; /* SAD time decay happened here */ 456963fb2adSRandall Stewart uint64_t gp_bw; 457963fb2adSRandall Stewart uint64_t init_rate; 458963fb2adSRandall Stewart #ifdef NETFLIX_SHARED_CWND 459963fb2adSRandall Stewart struct shared_cwnd *rc_scw; 460963fb2adSRandall Stewart #endif 461963fb2adSRandall Stewart uint64_t last_gp_comp_bw; 462963fb2adSRandall Stewart uint64_t last_max_bw; /* Our calculated max b/w last */ 463963fb2adSRandall Stewart struct time_filter_small rc_gp_min_rtt; 4645d8fd932SRandall Stewart struct def_opt_head opt_list; 465963fb2adSRandall Stewart int32_t rc_rtt_diff; /* Timely style rtt diff of our gp_srtt */ 466963fb2adSRandall Stewart uint32_t rc_gp_srtt; /* Current GP srtt */ 467963fb2adSRandall Stewart uint32_t rc_prev_gp_srtt; /* Previous RTT */ 468963fb2adSRandall Stewart uint32_t rc_entry_gp_rtt; /* Entry to PRTT gp-rtt */ 469963fb2adSRandall Stewart uint32_t rc_loss_at_start; /* At measurement window where was our lost value */ 470963fb2adSRandall Stewart 4715baf32c9SRandall Stewart uint32_t dsack_round_end; /* In a round of seeing a DSACK */ 4724e4c84f8SRandall Stewart uint32_t current_round; /* Starting at zero */ 4734e4c84f8SRandall Stewart uint32_t roundends; /* acked value above which round ends */ 4745baf32c9SRandall Stewart uint32_t num_dsack; /* Count of dsack's seen (1 per window)*/ 475963fb2adSRandall Stewart uint32_t forced_ack_ts; 47662ce18fcSRandall Stewart uint32_t last_collapse_point; /* Last point peer collapsed too */ 47762ce18fcSRandall Stewart uint32_t high_collapse_point; 478963fb2adSRandall Stewart uint32_t rc_lower_rtt_us_cts; /* Time our GP rtt was last lowered */ 479963fb2adSRandall Stewart uint32_t rc_time_probertt_entered; 480963fb2adSRandall Stewart uint32_t rc_time_probertt_starts; 481963fb2adSRandall Stewart uint32_t rc_lowest_us_rtt; 482963fb2adSRandall Stewart uint32_t rc_highest_us_rtt; 483963fb2adSRandall Stewart uint32_t rc_last_us_rtt; 484963fb2adSRandall Stewart uint32_t rc_time_of_last_probertt; 485963fb2adSRandall Stewart uint32_t rc_target_probertt_flight; 486963fb2adSRandall Stewart uint32_t rc_probertt_sndmax_atexit; /* Highest sent to in probe-rtt */ 4875d8fd932SRandall Stewart uint32_t rc_cwnd_at_erec; 4885d8fd932SRandall Stewart uint32_t rc_ssthresh_at_erec; 4895d8fd932SRandall Stewart uint32_t dsack_byte_cnt; 4905d8fd932SRandall Stewart uint32_t retran_during_recovery; 491963fb2adSRandall Stewart uint32_t rc_gp_lowrtt; /* Lowest rtt seen during GPUT measurement */ 492963fb2adSRandall Stewart uint32_t rc_gp_high_rwnd; /* Highest rwnd seen during GPUT measurement */ 493*c3679af3SGordon Bergling uint32_t rc_snd_max_at_rto; /* For non-sack when the RTO occurred what was snd-max */ 4945d8fd932SRandall Stewart uint32_t rc_out_at_rto; 495963fb2adSRandall Stewart int32_t rc_scw_index; 49689e560f4SRandall Stewart uint32_t rc_tlp_threshold; /* Socket option value Lock(a) */ 4975d8fd932SRandall Stewart uint32_t rc_last_timeout_snduna; 4985baf32c9SRandall Stewart uint32_t last_tlp_acked_start; 4995baf32c9SRandall Stewart uint32_t last_tlp_acked_end; 5005d8fd932SRandall Stewart uint32_t challenge_ack_ts; 5015d8fd932SRandall Stewart uint32_t challenge_ack_cnt; 5025d8fd932SRandall Stewart uint32_t rc_min_to; /* Socket option value Lock(a) */ 5035d8fd932SRandall Stewart uint32_t rc_pkt_delay; /* Socket option value Lock(a) */ 50426cbd002SRandall Stewart uint32_t persist_lost_ends; 5055d8fd932SRandall Stewart struct newreno rc_saved_beta; /* 5065d8fd932SRandall Stewart * For newreno cc: 5075d8fd932SRandall Stewart * rc_saved_cc are the values we have had 5085d8fd932SRandall Stewart * set by the user, if pacing is not happening 5095d8fd932SRandall Stewart * (i.e. its early and we have not turned on yet 5105d8fd932SRandall Stewart * or it was turned off). The minute pacing 5115d8fd932SRandall Stewart * is turned on we pull out the values currently 5125d8fd932SRandall Stewart * being used by newreno and replace them with 5135d8fd932SRandall Stewart * these values, then save off the old values here, 5145d8fd932SRandall Stewart * we also set the flag (if ecn_beta is set) to make 5155d8fd932SRandall Stewart * new_reno do less of a backoff for ecn (think abe). 5165d8fd932SRandall Stewart */ 51789e560f4SRandall Stewart uint16_t rc_early_recovery_segs; /* Socket option value Lock(a) */ 51889e560f4SRandall Stewart uint16_t rc_reorder_shift; /* Socket option value Lock(a) */ 5195baf32c9SRandall Stewart uint8_t dsack_persist; 520963fb2adSRandall Stewart uint8_t rc_no_push_at_mrtt; /* No push when we exceed max rtt */ 5215d8fd932SRandall Stewart uint8_t num_measurements; /* Number of measurements (up to 0xff, we freeze at 0xff) */ 5225d8fd932SRandall Stewart uint8_t req_measurements; /* How many measurements are required? */ 52389e560f4SRandall Stewart uint8_t rc_tlp_cwnd_reduce; /* Socket option value Lock(a) */ 52489e560f4SRandall Stewart uint8_t rc_prr_sendalot;/* Socket option value Lock(a) */ 52589e560f4SRandall Stewart uint8_t rc_rate_sample_method; 52689e560f4SRandall Stewart }; 527e834f9a4SRandall Stewart #endif 52889e560f4SRandall Stewart 529963fb2adSRandall Stewart #define RACK_TIMELY_CNT_BOOST 5 /* At 5th increase boost */ 530963fb2adSRandall Stewart #define RACK_MINRTT_FILTER_TIM 10 /* Seconds */ 531963fb2adSRandall Stewart 532a9696510SRandall Stewart #define RACK_HYSTART_OFF 0 533a9696510SRandall Stewart #define RACK_HYSTART_ON 1 /* hystart++ on */ 534a9696510SRandall Stewart #define RACK_HYSTART_ON_W_SC 2 /* hystart++ on +Slam Cwnd */ 535a9696510SRandall Stewart #define RACK_HYSTART_ON_W_SC_C 3 /* hystart++ on, 536a9696510SRandall Stewart * Conservative ssthresh and 537a9696510SRandall Stewart * +Slam cwnd 538a9696510SRandall Stewart */ 539a9696510SRandall Stewart 54089e560f4SRandall Stewart #ifdef _KERNEL 54189e560f4SRandall Stewart 54289e560f4SRandall Stewart struct tcp_rack { 54389e560f4SRandall Stewart /* First cache line 0x00 */ 54489e560f4SRandall Stewart TAILQ_ENTRY(tcp_rack) r_hpts; /* hptsi queue next Lock(b) */ 54589e560f4SRandall Stewart int32_t(*r_substate) (struct mbuf *, struct tcphdr *, 54689e560f4SRandall Stewart struct socket *, struct tcpcb *, struct tcpopt *, 5478df12ffcSMichael Tuexen int32_t, int32_t, uint32_t, int, int, uint8_t); /* Lock(a) */ 54889e560f4SRandall Stewart struct tcpcb *rc_tp; /* The tcpcb Lock(a) */ 54989e560f4SRandall Stewart struct inpcb *rc_inp; /* The inpcb Lock(a) */ 5505d8fd932SRandall Stewart uint8_t rc_free_cnt; /* Number of free entries on the rc_free list 55189e560f4SRandall Stewart * Lock(a) */ 55262ce18fcSRandall Stewart uint8_t client_bufferlvl : 4, /* Expected range [0,5]: 0=unset, 1=low/empty */ 55362ce18fcSRandall Stewart rack_deferred_inited : 1, 55462ce18fcSRandall Stewart /* ******************************************************************** */ 55562ce18fcSRandall Stewart /* Note for details of next two fields see rack_init_retransmit_rate() */ 55662ce18fcSRandall Stewart /* ******************************************************************** */ 55762ce18fcSRandall Stewart full_size_rxt: 1, 55862ce18fcSRandall Stewart shape_rxt_to_pacing_min : 1, 55962ce18fcSRandall Stewart /* ******************************************************************** */ 56062ce18fcSRandall Stewart spare : 1; 5615d8fd932SRandall Stewart uint8_t no_prr_addback : 1, 5625d8fd932SRandall Stewart gp_ready : 1, 5635d8fd932SRandall Stewart defer_options: 1, 5645d8fd932SRandall Stewart fast_rsm_hack: 1, 5655d8fd932SRandall Stewart rc_ack_can_sendout_data: 1, /* 5665d8fd932SRandall Stewart * If set it will override pacing restrictions on not sending 5675d8fd932SRandall Stewart * data when the pacing timer is running. I.e. you set this 5685d8fd932SRandall Stewart * and an ACK will send data. Default is off and its only used 5695d8fd932SRandall Stewart * without pacing when we are doing 5G speed up for there 5705d8fd932SRandall Stewart * ack filtering. 5715d8fd932SRandall Stewart */ 5725d8fd932SRandall Stewart rc_pacing_cc_set: 1, /* 5735d8fd932SRandall Stewart * If we are pacing (pace_always=1) and we have reached the 5745d8fd932SRandall Stewart * point where we start pacing (fixed or gp has reached its 5755d8fd932SRandall Stewart * magic gp_ready state) this flag indicates we have set in 5765d8fd932SRandall Stewart * values to effect CC's backoff's. If pacing is turned off 5775d8fd932SRandall Stewart * then we must restore the values saved in rc_saved_beta, 5785d8fd932SRandall Stewart * if its going to gp_ready we need to copy the values into 5795d8fd932SRandall Stewart * the CC module and set our flags. 5805d8fd932SRandall Stewart * 5815d8fd932SRandall Stewart * Note this only happens if the cc name is newreno (CCALGONAME_NEWRENO). 5825d8fd932SRandall Stewart */ 5835d8fd932SRandall Stewart 5845baf32c9SRandall Stewart rc_rack_tmr_std_based :1, 5855baf32c9SRandall Stewart rc_rack_use_dsack: 1; 5865baf32c9SRandall Stewart uint8_t rc_dsack_round_seen: 1, 5875baf32c9SRandall Stewart rc_last_tlp_acked_set: 1, 5885baf32c9SRandall Stewart rc_last_tlp_past_cumack: 1, 5895baf32c9SRandall Stewart rc_last_sent_tlp_seq_valid: 1, 5905baf32c9SRandall Stewart rc_last_sent_tlp_past_cumack: 1, 59126cbd002SRandall Stewart probe_not_answered: 1, 59226cbd002SRandall Stewart avail_bytes : 2; 59389e560f4SRandall Stewart uint32_t rc_rack_rtt; /* RACK-RTT Lock(a) */ 594963fb2adSRandall Stewart uint16_t r_mbuf_queue : 1, /* Do we do mbuf queue for non-paced */ 595963fb2adSRandall Stewart rtt_limit_mul : 4, /* muliply this by low rtt */ 596963fb2adSRandall Stewart r_limit_scw : 1, 5975d8fd932SRandall Stewart r_must_retran : 1, /* For non-sack customers we hit an RTO and new data should be resends */ 5985d8fd932SRandall Stewart r_use_cmp_ack: 1, /* Do we use compressed acks */ 5995d8fd932SRandall Stewart r_ent_rec_ns: 1, /* We entered recovery and have not sent */ 6005d8fd932SRandall Stewart r_might_revert: 1, /* Flag to find out if we might need to revert */ 6015d8fd932SRandall Stewart r_fast_output: 1, /* Fast output is in progress we can skip the bulk of rack_output */ 6025d8fd932SRandall Stewart r_fsb_inited: 1, 6035d8fd932SRandall Stewart r_rack_hw_rate_caps: 1, 6045d8fd932SRandall Stewart r_up_only: 1, 6055d8fd932SRandall Stewart r_via_fill_cw : 1, 6065d8fd932SRandall Stewart r_fill_less_agg : 1; 60789e560f4SRandall Stewart 6085d8fd932SRandall Stewart uint8_t rc_user_set_max_segs; /* Socket option value Lock(a) */ 6095d8fd932SRandall Stewart uint8_t rc_labc; /* Appropriate Byte Counting Value */ 610963fb2adSRandall Stewart uint16_t forced_ack : 1, 611963fb2adSRandall Stewart rc_gp_incr : 1, 612963fb2adSRandall Stewart rc_gp_bwred : 1, 613963fb2adSRandall Stewart rc_gp_timely_inc_cnt : 3, 614963fb2adSRandall Stewart rc_gp_timely_dec_cnt : 3, 6155d8fd932SRandall Stewart r_use_labc_for_rec: 1, 616963fb2adSRandall Stewart rc_highly_buffered: 1, /* The path is highly buffered */ 617963fb2adSRandall Stewart rc_dragged_bottom: 1, 618963fb2adSRandall Stewart rc_dack_mode : 1, /* Mac O/S emulation of d-ack */ 619963fb2adSRandall Stewart rc_dack_toggle : 1, /* For Mac O/S emulation of d-ack */ 6208d64b4b4SRandall Stewart rc_gp_filled : 1, 6218d64b4b4SRandall Stewart rc_is_spare : 1; 62289e560f4SRandall Stewart uint8_t r_state; /* Current rack state Lock(a) */ 62389e560f4SRandall Stewart uint8_t rc_tmr_stopped : 7, 62489e560f4SRandall Stewart t_timers_stopped : 1; 625963fb2adSRandall Stewart uint8_t rc_enobuf : 7, /* count of enobufs on connection provides */ 626963fb2adSRandall Stewart rc_on_min_to : 1; 62789e560f4SRandall Stewart uint8_t r_timer_override : 1, /* hpts override Lock(a) */ 62889e560f4SRandall Stewart r_is_v6 : 1, /* V6 pcb Lock(a) */ 62989e560f4SRandall Stewart rc_in_persist : 1, 63089e560f4SRandall Stewart rc_tlp_in_progress : 1, 63189e560f4SRandall Stewart rc_always_pace : 1, /* Socket option value Lock(a) */ 632963fb2adSRandall Stewart rc_pace_to_cwnd : 1, 633963fb2adSRandall Stewart rc_pace_fill_if_rttin_range : 1, 6345d8fd932SRandall Stewart rc_srtt_measure_made : 1; 635963fb2adSRandall Stewart uint8_t app_limited_needs_set : 1, 636963fb2adSRandall Stewart use_fixed_rate : 1, 63735c7bb34SRandall Stewart rc_has_collapsed : 1, 63835c7bb34SRandall Stewart r_rep_attack : 1, 63935c7bb34SRandall Stewart r_rep_reverse : 1, 640963fb2adSRandall Stewart rack_hdrw_pacing : 1, /* We are doing Hardware pacing */ 641963fb2adSRandall Stewart rack_hdw_pace_ena : 1, /* Is hardware pacing enabled? */ 642963fb2adSRandall Stewart rack_attempt_hdwr_pace : 1; /* Did we attempt hdwr pacing (if allowed) */ 643963fb2adSRandall Stewart uint8_t rack_tlp_threshold_use : 3, /* only 1, 2 and 3 used so far */ 644963fb2adSRandall Stewart rack_rec_nonrxt_use_cr : 1, 645963fb2adSRandall Stewart rack_enable_scwnd : 1, 646963fb2adSRandall Stewart rack_attempted_scwnd : 1, 647963fb2adSRandall Stewart rack_no_prr : 1, 648963fb2adSRandall Stewart rack_scwnd_is_idle : 1; 64989e560f4SRandall Stewart uint8_t rc_allow_data_af_clo: 1, 65089e560f4SRandall Stewart delayed_ack : 1, 65135c7bb34SRandall Stewart set_pacing_done_a_iw : 1, 652963fb2adSRandall Stewart use_rack_rr : 1, 6535e02b277SJonathan T. Looney alloc_limit_reported : 1, 65435c7bb34SRandall Stewart sack_attack_disable : 1, 65535c7bb34SRandall Stewart do_detection : 1, 656963fb2adSRandall Stewart rc_force_max_seg : 1; 6578d64b4b4SRandall Stewart uint8_t r_early : 1, 658963fb2adSRandall Stewart r_late : 1, 659963fb2adSRandall Stewart r_wanted_output: 1, 6608d64b4b4SRandall Stewart r_rr_config : 2, 66162ce18fcSRandall Stewart r_persist_lt_bw_off : 1, 66262ce18fcSRandall Stewart r_collapse_point_valid : 1, 66362ce18fcSRandall Stewart rc_avail_bit : 2; 664963fb2adSRandall Stewart uint16_t rc_init_win : 8, 665963fb2adSRandall Stewart rc_gp_rtt_set : 1, 666963fb2adSRandall Stewart rc_gp_dyn_mul : 1, 667963fb2adSRandall Stewart rc_gp_saw_rec : 1, 668963fb2adSRandall Stewart rc_gp_saw_ca : 1, 669963fb2adSRandall Stewart rc_gp_saw_ss : 1, 670963fb2adSRandall Stewart rc_gp_no_rec_chg : 1, 671963fb2adSRandall Stewart in_probe_rtt : 1, 672963fb2adSRandall Stewart measure_saw_probe_rtt : 1; 67389e560f4SRandall Stewart /* Cache line 2 0x40 */ 67489e560f4SRandall Stewart struct rack_control r_ctl; 67589e560f4SRandall Stewart } __aligned(CACHE_LINE_SIZE); 67689e560f4SRandall Stewart 67789e560f4SRandall Stewart #endif 67889e560f4SRandall Stewart #endif 679