1*89e560f4SRandall Stewart #ifndef __pacer_timer_h__ 2*89e560f4SRandall Stewart #define __pacer_timer_h__ 3*89e560f4SRandall Stewart /*- 4*89e560f4SRandall Stewart * Copyright (c) 2017 5*89e560f4SRandall Stewart * Netflix Inc. 6*89e560f4SRandall Stewart * All rights reserved. 7*89e560f4SRandall Stewart * 8*89e560f4SRandall Stewart * Redistribution and use in source and binary forms, with or without 9*89e560f4SRandall Stewart * modification, are permitted provided that the following conditions 10*89e560f4SRandall Stewart * are met: 11*89e560f4SRandall Stewart * 1. Redistributions of source code must retain the above copyright 12*89e560f4SRandall Stewart * notice, this list of conditions and the following disclaimer. 13*89e560f4SRandall Stewart * 2. Redistributions in binary form must reproduce the above copyright 14*89e560f4SRandall Stewart * notice, this list of conditions and the following disclaimer in the 15*89e560f4SRandall Stewart * documentation and/or other materials provided with the distribution. 16*89e560f4SRandall Stewart * 17*89e560f4SRandall Stewart * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18*89e560f4SRandall Stewart * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19*89e560f4SRandall Stewart * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20*89e560f4SRandall Stewart * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21*89e560f4SRandall Stewart * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22*89e560f4SRandall Stewart * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23*89e560f4SRandall Stewart * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24*89e560f4SRandall Stewart * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25*89e560f4SRandall Stewart * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26*89e560f4SRandall Stewart * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27*89e560f4SRandall Stewart * SUCH DAMAGE. 28*89e560f4SRandall Stewart * 29*89e560f4SRandall Stewart * __FBSDID("$FreeBSD$"); 30*89e560f4SRandall Stewart */ 31*89e560f4SRandall Stewart /* Common defines and such used by both RACK and BBR */ 32*89e560f4SRandall Stewart /* Special values for mss accounting array */ 33*89e560f4SRandall Stewart #define TCP_MSS_ACCT_JUSTRET 0 34*89e560f4SRandall Stewart #define TCP_MSS_ACCT_SNDACK 1 35*89e560f4SRandall Stewart #define TCP_MSS_ACCT_PERSIST 2 36*89e560f4SRandall Stewart #define TCP_MSS_ACCT_ATIMER 60 37*89e560f4SRandall Stewart #define TCP_MSS_ACCT_INPACE 61 38*89e560f4SRandall Stewart #define TCP_MSS_ACCT_LATE 62 39*89e560f4SRandall Stewart #define TCP_MSS_SMALL_SIZE_OFF 63 /* Point where small sizes enter */ 40*89e560f4SRandall Stewart #define TCP_MSS_ACCT_SIZE 70 41*89e560f4SRandall Stewart #define TCP_MSS_SMALL_MAX_SIZE_DIV (TCP_MSS_ACCT_SIZE - TCP_MSS_SMALL_SIZE_OFF) 42*89e560f4SRandall Stewart 43*89e560f4SRandall Stewart 44*89e560f4SRandall Stewart /* Magic flags to tell whats cooking on the pacing wheel */ 45*89e560f4SRandall Stewart #define PACE_PKT_OUTPUT 0x01 /* Output Packets being paced */ 46*89e560f4SRandall Stewart #define PACE_TMR_RACK 0x02 /* RACK timer running */ 47*89e560f4SRandall Stewart #define PACE_TMR_TLP 0x04 /* TLP timer running */ 48*89e560f4SRandall Stewart #define PACE_TMR_RXT 0x08 /* Retransmit timer running */ 49*89e560f4SRandall Stewart #define PACE_TMR_PERSIT 0x10 /* Persists timer running */ 50*89e560f4SRandall Stewart #define PACE_TMR_KEEP 0x20 /* Keep alive timer running */ 51*89e560f4SRandall Stewart #define PACE_TMR_DELACK 0x40 /* Delayed ack timer running */ 52*89e560f4SRandall Stewart #define PACE_TMR_MASK (PACE_TMR_KEEP|PACE_TMR_PERSIT|PACE_TMR_RXT|PACE_TMR_TLP|PACE_TMR_RACK|PACE_TMR_DELACK) 53*89e560f4SRandall Stewart 54*89e560f4SRandall Stewart /* Magic flags for tracing progress events */ 55*89e560f4SRandall Stewart #define PROGRESS_DROP 1 56*89e560f4SRandall Stewart #define PROGRESS_UPDATE 2 57*89e560f4SRandall Stewart #define PROGRESS_CLEAR 3 58*89e560f4SRandall Stewart #define PROGRESS_START 4 59*89e560f4SRandall Stewart 60*89e560f4SRandall Stewart 61*89e560f4SRandall Stewart /* RTT sample methods */ 62*89e560f4SRandall Stewart #define USE_RTT_HIGH 0 63*89e560f4SRandall Stewart #define USE_RTT_LOW 1 64*89e560f4SRandall Stewart #define USE_RTT_AVG 2 65*89e560f4SRandall Stewart 66*89e560f4SRandall Stewart #ifdef _KERNEL 67*89e560f4SRandall Stewart /* We have only 7 bits in rack so assert its true */ 68*89e560f4SRandall Stewart CTASSERT((PACE_TMR_MASK & 0x80) == 0); 69*89e560f4SRandall Stewart #endif 70*89e560f4SRandall Stewart #endif 71