aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_stacks/rack_bbr_common.h
diff options
context:
space:
mode:
authorRandall Stewart <rrs@FreeBSD.org>2019-12-17 16:08:07 +0000
committerRandall Stewart <rrs@FreeBSD.org>2019-12-17 16:08:07 +0000
commit1cf55767b800492f15d2d49884f78f05506049c0 (patch)
tree0d634265921d2276fbd6722431a2e137e2b29851 /sys/netinet/tcp_stacks/rack_bbr_common.h
parentc7b0edf219290a9a77a4c59987b5783061ae19c9 (diff)
downloadsrc-1cf55767b800492f15d2d49884f78f05506049c0.tar.gz
src-1cf55767b800492f15d2d49884f78f05506049c0.zip
This commit is a bit of a re-arrange of deck chairs. It
gets both rack and bbr ready for the completion of the STATs framework in FreeBSD. For now if you don't have both NF_stats and stats on it disables them. As soon as the rest of the stats framework lands we can remove that restriction and then just uses stats when defined. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D22479
Notes
Notes: svn path=/head/; revision=355859
Diffstat (limited to 'sys/netinet/tcp_stacks/rack_bbr_common.h')
-rw-r--r--sys/netinet/tcp_stacks/rack_bbr_common.h34
1 files changed, 32 insertions, 2 deletions
diff --git a/sys/netinet/tcp_stacks/rack_bbr_common.h b/sys/netinet/tcp_stacks/rack_bbr_common.h
index 6cb2fed7c2fa..5eb304ddf4ad 100644
--- a/sys/netinet/tcp_stacks/rack_bbr_common.h
+++ b/sys/netinet/tcp_stacks/rack_bbr_common.h
@@ -1,5 +1,5 @@
-#ifndef __pacer_timer_h__
-#define __pacer_timer_h__
+#ifndef __rack_bbr_common_h__
+#define __rack_bbr_common_h__
/*-
* Copyright (c) 2017-9 Netflix, Inc.
*
@@ -26,6 +26,12 @@
*
* __FBSDID("$FreeBSD$");
*/
+
+/* XXXLAS: Couple STATS to NETFLIX_STATS until stats(3) is fully upstreamed. */
+#ifndef NETFLIX_STATS
+#undef STATS
+#endif
+
/* Common defines and such used by both RACK and BBR */
/* Special values for mss accounting array */
#define TCP_MSS_ACCT_JUSTRET 0
@@ -46,6 +52,23 @@
#define PROGRESS_CLEAR 3
#define PROGRESS_START 4
+/* codes for just-return */
+#define CTF_JR_SENT_DATA 0
+#define CTF_JR_CWND_LIMITED 1
+#define CTF_JR_RWND_LIMITED 2
+#define CTF_JR_APP_LIMITED 3
+#define CTF_JR_ASSESSING 4
+#define CTF_JR_PERSISTS 5
+#define CTF_JR_PRR 6
+
+/* Compat. */
+#define BBR_JR_SENT_DATA CTF_JR_SENT_DATA
+#define BBR_JR_CWND_LIMITED CTF_JR_CWND_LIMITED
+#define BBR_JR_RWND_LIMITED CTF_JR_RWND_LIMITED
+#define BBR_JR_APP_LIMITED CTF_JR_APP_LIMITED
+#define BBR_JR_ASSESSING CTF_JR_ASSESSING
+#define BBR_JR_PERSISTS CTF_JR_PERSISTS
+#define BBR_JR_PRR CTF_JR_PRR
/* RTT sample methods */
#define USE_RTT_HIGH 0
@@ -59,6 +82,13 @@
#define USEC_TO_MSEC(x) (x / MS_IN_USEC)
#define TCP_TS_OVERHEAD 12 /* Overhead of having Timestamps on */
+/* Bits per second in bytes per second */
+#define FORTY_EIGHT_MBPS 6000000 /* 48 megabits in bytes */
+#define THIRTY_MBPS 3750000 /* 30 megabits in bytes */
+#define TWENTY_THREE_MBPS 2896000
+#define FIVETWELVE_MBPS 64000000 /* 512 megabits in bytes */
+#define ONE_POINT_TWO_MEG 150000 /* 1.2 megabits in bytes */
+
#ifdef _KERNEL
/* We have only 7 bits in rack so assert its true */
CTASSERT((PACE_TMR_MASK & 0x80) == 0);