In the TCP stack, the hhook(9) framework provides hooks for kernel modules

to add actions that run when a TCP frame is sent or received on a TCP
session in the ESTABLISHED state. In the base tree, this functionality is
only used for the h_ertt module, which is used by the cc_cdg, cc_chd, cc_hd,
and cc_vegas congestion control modules.

Presently, we incur overhead to check for hooks each time a TCP frame is
sent or received on an ESTABLISHED TCP session.

This change adds a new compile-time option (TCP_HHOOK) to determine whether
to include the hhook(9) framework for TCP. To retain backwards
compatibility, I added the TCP_HHOOK option to every configuration file that
already defined "options INET". (Therefore, this patch introduces no
functional change. In order to see a functional difference, you need to
compile a custom kernel without the TCP_HHOOK option.) This change will
allow users to easily exclude this functionality from their kernel, should
they wish to do so.

Note that any users who use a custom kernel configuration and use one of the
congestion control modules listed above will need to add the TCP_HHOOK
option to their kernel configuration.

Reviewed by:	rrs, lstewart, hiren (previous version), sjg (makefiles only)
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D8185
This commit is contained in:
Jonathan T. Looney 2016-10-12 02:16:42 +00:00
parent 368bf0c2c6
commit bd79708dbf
77 changed files with 142 additions and 5 deletions

View File

@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
20161008:
Use of the cc_cdg, cc_chd, cc_hd, or cc_vegas congestion control
modules now requires that the kernel configuration contain the
TCP_HHOOK option. (This option is included in the GENERIC kernel.)
20161003:
The WITHOUT_ELFCOPY_AS_OBJCOPY src.conf(5) knob has been retired.
ELF Tool Chain's elfcopy is always installed as /usr/bin/objcopy.

View File

@ -30,6 +30,7 @@ options INET # InterNETworking
options INET6 # IPv6 communications protocols
options IPSEC # IP (v4/v6) security
options TCP_OFFLOAD # TCP offload
options TCP_HHOOK # hhook(9) framework for TCP
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support

View File

@ -35,6 +35,7 @@ options SCHED_4BSD # 4BSD scheduler
#options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support

View File

@ -36,6 +36,7 @@ options DEVICE_POLLING
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
options GEOM_PART_BSD # BSD partition scheme
options GEOM_PART_MBR # MBR partition scheme
options TMPFS # Efficient memory filesystem

View File

@ -33,6 +33,7 @@ makeoptions MODULES_OVERRIDE=""
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
#options UFS_ACL # Support for access control lists

View File

@ -37,6 +37,7 @@ options DEVICE_POLLING
options SCHED_4BSD # 4BSD scheduler
#options PREEMPTION
options INET # InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
options GEOM_PART_BSD # BSD partition scheme
options GEOM_PART_MBR # MBR partition scheme
options TMPFS # Efficient memory filesystem

View File

@ -46,6 +46,7 @@ options GEOM_LABEL # Provides labelization
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists

View File

@ -34,6 +34,7 @@ options HZ=100
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists

View File

@ -15,6 +15,7 @@ makeoptions WERROR="-Werror"
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options GEOM_PART_BSD # BSD partition scheme
options GEOM_PART_MBR # MBR partition scheme
options TMPFS # Efficient memory filesystem

View File

@ -15,6 +15,7 @@ makeoptions WERROR="-Werror"
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options GEOM_PART_BSD # BSD partition scheme
options GEOM_PART_MBR # MBR partition scheme
options TMPFS # Efficient memory filesystem

View File

@ -15,6 +15,7 @@ makeoptions WERROR="-Werror"
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
options NANDFS # NAND Filesystem
options NFSCL # Network Filesystem Client

View File

@ -29,6 +29,7 @@ options SOC_MV_KIRKWOOD
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
options NFSCL # Network Filesystem Client

View File

@ -32,6 +32,7 @@ options SOC_MV_KIRKWOOD
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
options NFSCL # Network Filesystem Client

View File

@ -16,6 +16,7 @@ makeoptions WERROR="-Werror"
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
options NFSCL # Network Filesystem Client
options NFSLOCKD # Network Lock Manager

View File

@ -26,6 +26,7 @@ makeoptions MODULES_OVERRIDE=""
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
#options SOFTUPDATES # Enable FFS soft updates support
#options UFS_ACL # Support for access control lists

View File

@ -31,6 +31,7 @@ options SCHED_4BSD # 4BSD scheduler
#options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
#options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support

View File

@ -25,6 +25,7 @@ options SCHED_ULE # ULE scheduler
options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support

View File

@ -39,6 +39,7 @@ options HZ=100
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists

View File

@ -31,6 +31,7 @@ makeoptions MODULES_OVERRIDE=""
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
#options SOFTUPDATES # Enable FFS soft updates support
#options UFS_ACL # Support for access control lists

View File

@ -29,6 +29,7 @@ makeoptions MODULES_OVERRIDE=""
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
#options SOFTUPDATES # Enable FFS soft updates support
#options UFS_ACL # Support for access control lists

View File

@ -32,6 +32,7 @@ makeoptions MODULES_OVERRIDE=""
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
#options SOFTUPDATES # Enable FFS soft updates support
#options UFS_ACL # Support for access control lists

View File

@ -43,6 +43,7 @@ options DEVICE_POLLING
options SCHED_ULE # ULE scheduler
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists

View File

@ -32,6 +32,7 @@ makeoptions MODULES_OVERRIDE=""
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
#options SOFTUPDATES # Enable FFS soft updates support
#options UFS_ACL # Support for access control lists

View File

@ -42,6 +42,7 @@ options SCHED_4BSD # 4BSD scheduler
#options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
#options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support

View File

@ -38,6 +38,7 @@ makeoptions MODULES_OVERRIDE=""
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options TMPFS # Efficient memory filesystem
options FFS # Berkeley Fast Filesystem
#options SOFTUPDATES # Enable FFS soft updates support

View File

@ -31,6 +31,7 @@ makeoptions MODULES_OVERRIDE=""
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
#options SOFTUPDATES # Enable FFS soft updates support
#options UFS_ACL # Support for access control lists

View File

@ -17,6 +17,7 @@ options HZ=1000
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
options NANDFS # NAND Filesystem
options NFSCL # Network Filesystem Client

View File

@ -31,6 +31,7 @@ makeoptions MODULES_OVERRIDE=""
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
#options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
#options SOFTUPDATES # Enable FFS soft updates support
#options UFS_ACL # Support for access control lists

View File

@ -15,6 +15,7 @@ makeoptions WERROR="-Werror"
options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
options NFSCL # Network Filesystem Client

View File

@ -7,6 +7,7 @@ options ARM_L2_PIPT # Only L2 PIPT is supported
options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options IPSEC # IP (v4/v6) security
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem

View File

@ -29,6 +29,7 @@ options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options IPSEC # IP (v4/v6) security
options TCP_HHOOK # hhook(9) framework for TCP
options TCP_OFFLOAD # TCP offload
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem

View File

@ -982,6 +982,8 @@ device lagg
# TCPPCAP enables code which keeps the last n packets sent and received
# on a TCP socket.
#
# TCP_HHOOK enables the hhook(9) framework hooks for the TCP stack.
#
# RADIX_MPATH provides support for equal-cost multi-path routing.
#
options MROUTING # Multicast routing
@ -1001,6 +1003,7 @@ options IPSTEALTH #support for stealth forwarding
options PF_DEFAULT_TO_DROP #drop everything by default
options TCPDEBUG
options TCPPCAP
options TCP_HHOOK
options RADIX_MPATH
# The MBUF_STRESS_TEST option enables options which create

View File

@ -443,6 +443,7 @@ SLIP_IFF_OPTS opt_slip.h
TCPDEBUG
TCPPCAP opt_global.h
SIFTR
TCP_HHOOK opt_inet.h
TCP_OFFLOAD opt_inet.h # Enable code to dispatch TCP offloading
TCP_RFC7413 opt_inet.h
TCP_RFC7413_MAX_KEYS opt_inet.h

View File

@ -31,6 +31,7 @@ options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options IPSEC # IP (v4/v6) security
options TCP_HHOOK # hhook(9) framework for TCP
options TCP_OFFLOAD # TCP offload
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem

View File

@ -33,6 +33,7 @@ options KDB
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
options NFSCL #Network Filesystem Client
options NFS_ROOT #NFS usable as /, requires NFSCL
options PSEUDOFS #Pseudo-filesystem framework

View File

@ -33,6 +33,7 @@ options KDB
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
options NFSCL #Network Filesystem Client
options NFS_ROOT #NFS usable as /, requires NFSCL
options PSEUDOFS #Pseudo-filesystem framework

View File

@ -35,6 +35,7 @@ options KDB
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
options INET6 # IPv6
options TCP_HHOOK # hhook(9) framework for TCP
# options NFSCL #Network Filesystem Client

View File

@ -36,6 +36,7 @@ options KDB
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
#options INET6 # IPv6
options TCP_HHOOK # hhook(9) framework for TCP
#options NFSCL #Network Filesystem Client
options PSEUDOFS #Pseudo-filesystem framework
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions

View File

@ -28,6 +28,7 @@ options KDB
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
options NFSCL #Network Filesystem Client
#options NFS_ROOT #NFS usable as /, requires NFSCL
options PSEUDOFS #Pseudo-filesystem framework

View File

@ -39,6 +39,7 @@ options FFS #Berkeley Fast Filesystem
options INET
options INET6
options TCP_HHOOK # hhook(9) framework for TCP
options KGSSAPI
options NFSCL
options NFSLOCKD

View File

@ -55,6 +55,7 @@ options SCHED_ULE # ULE scheduler
options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support

View File

@ -32,6 +32,7 @@ options SMP # Symmetric MultiProcessor Kernel
options SCHED_ULE
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS #Berkeley Fast Filesystem

View File

@ -30,6 +30,7 @@ options SMP # Symmetric MultiProcessor Kernel
options SCHED_ULE
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS #Berkeley Fast Filesystem

View File

@ -16,6 +16,7 @@ options KDB
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
options NFSCL #Network Filesystem Client
options NFS_ROOT #NFS usable as /, requires NFSCL
options PSEUDOFS #Pseudo-filesystem framework

View File

@ -54,6 +54,7 @@ options SCHED_ULE
#options SCHED_4BSD #4BSD scheduler
#options COMPAT_43
options INET #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
options NFSCL #Network Filesystem Client
options NFS_ROOT #NFS usable as /, requires NFSCL
options PSEUDOFS #Pseudo-filesystem framework

View File

@ -54,6 +54,7 @@ options SCHED_ULE # ULE scheduler
options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support

View File

@ -37,6 +37,7 @@ options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
# Can't do IPv6 - it just doesn't fit.
# options INET6
options TCP_HHOOK # hhook(9) framework for TCP
# options NFSCL #Network Filesystem Client
options PSEUDOFS #Pseudo-filesystem framework
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions

View File

@ -31,6 +31,7 @@ options ALT_BREAK_TO_DEBUGGER
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
#options INET6 #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
#options NFSCL #Network Filesystem Client
options PSEUDOFS #Pseudo-filesystem framework
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions

View File

@ -32,6 +32,7 @@ options KDB
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
options NFSCL #Network Filesystem Client
options NFS_ROOT #NFS usable as /, requires NFSCL
options PSEUDOFS #Pseudo-filesystem framework

View File

@ -53,6 +53,7 @@ options SCHED_ULE
#options SCHED_4BSD #4BSD scheduler
#options COMPAT_43
options INET #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
options NFSCL #Network Filesystem Client
options NFS_ROOT #NFS usable as /, requires NFSCL
options PSEUDOFS #Pseudo-filesystem framework

View File

@ -51,6 +51,7 @@ options KDB
options SCHED_ULE
options INET #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
#options NFSCL #Network Filesystem Client
#options NFS_ROOT #NFS usable as /, requires NFSCL
options PSEUDOFS #Pseudo-filesystem framework

View File

@ -44,6 +44,7 @@ options KDB
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
options NFSCL #Network Filesystem Client
options NFS_ROOT #NFS usable as /, requires NFSCL
options PSEUDOFS #Pseudo-filesystem framework

View File

@ -62,6 +62,7 @@ options PREEMPTION # Enable kernel thread preemption
#options FULL_PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
#options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists

View File

@ -36,6 +36,7 @@ options SMP
#options FULL_PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
#options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists

View File

@ -36,6 +36,7 @@ options PREEMPTION # Enable kernel thread preemption
#options FULL_PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
#options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists

View File

@ -34,6 +34,7 @@ options KDB
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
options INET6 # IPv6
options TCP_HHOOK # hhook(9) framework for TCP
# options NFSCL #Network Filesystem Client

View File

@ -33,6 +33,7 @@ options KDB
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
options INET6 # IPv6
options TCP_HHOOK # hhook(9) framework for TCP
# options NFSCL #Network Filesystem Client

View File

@ -32,6 +32,7 @@ options VM_KMEM_SIZE_SCALE=1
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
options INET6 #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
#options NFSCL #Network Filesystem Client
options PSEUDOFS #Pseudo-filesystem framework
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions

View File

@ -30,6 +30,7 @@ options ALT_BREAK_TO_DEBUGGER
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
#options INET6 #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
#options NFSCL #Network Filesystem Client
options PSEUDOFS #Pseudo-filesystem framework
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions

View File

@ -31,6 +31,7 @@ options ALQ
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
#options INET6 #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
#options NFSCL #Network Filesystem Client
options PSEUDOFS #Pseudo-filesystem framework
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions

View File

@ -21,6 +21,7 @@ options KDB
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
options NFSCL #Network Filesystem Client
options NFS_ROOT #NFS usable as /, requires NFSCL
options PSEUDOFS #Pseudo-filesystem framework

View File

@ -35,6 +35,7 @@ options ALQ
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
#options INET6 #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
#options NFSCL #Network Filesystem Client
options PSEUDOFS #Pseudo-filesystem framework
options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions

View File

@ -20,6 +20,7 @@ options KDB
options SCHED_4BSD #4BSD scheduler
options INET #InterNETworking
options TCP_HHOOK # hhook(9) framework for TCP
options NFSCL #Network Filesystem Client
options NFS_ROOT #NFS usable as /, requires NFSCL
options PSEUDOFS #Pseudo-filesystem framework

View File

@ -15,6 +15,7 @@ options PREEMPTION # Enable kernel thread preemption
#options FULL_PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options FFS # Berkeley Fast Filesystem
#options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for access control lists

View File

@ -1,11 +1,20 @@
# $FreeBSD$
SUBDIR= cc_cdg \
cc_chd \
cc_cubic \
SUBDIR= cc_cubic \
cc_dctcp \
cc_htcp
# Do we have the TCP_HHOOK symbol defined? If not, there is no point in
# building these modules by default.
# We will default to building these modules unless $OPT_INET is defined
# and does not contain the TCP_HHOOK option.
.if defined(ALL_MODULES) || ${OPT_INET:UTCP_HHOOK:MTCP_HHOOK} != ""
SUBDIR+= \
cc_cdg \
cc_chd \
cc_hd \
cc_htcp \
cc_vegas
.endif
.include <bsd.subdir.mk>

View File

@ -1,5 +1,13 @@
# $FreeBSD$
SUBDIR= h_ertt
SUBDIR=
# Do we have the TCP_HHOOK symbol defined? If not, there is no point in
# building this modules by default.
# We will default to building this module unless $OPT_INET is defined
# and does not contain the TCP_HHOOK option.
.if defined(ALL_MODULES) || ${OPT_INET:UTCP_HHOOK:MTCP_HHOOK} != ""
SUBDIR+= h_ertt
.endif
.include <bsd.subdir.mk>

View File

@ -57,7 +57,9 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/kernel.h>
#ifdef TCP_HHOOK
#include <sys/hhook.h>
#endif
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/proc.h> /* for proc0 declaration */
@ -278,6 +280,7 @@ kmod_tcpstat_inc(int statnum)
counter_u64_add(VNET(tcpstat)[statnum], 1);
}
#ifdef TCP_HHOOK
/*
* Wrapper for the TCP established input helper hook.
*/
@ -295,6 +298,7 @@ hhook_run_tcp_est_in(struct tcpcb *tp, struct tcphdr *th, struct tcpopt *to)
tp->osd);
}
}
#endif
/*
* CC wrapper hook functions
@ -1753,8 +1757,10 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
}
acked = BYTES_THIS_ACK(tp, th);
#ifdef TCP_HHOOK
/* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */
hhook_run_tcp_est_in(tp, th, &to);
#endif
TCPSTAT_ADD(tcps_rcvackpack, nsegs);
TCPSTAT_ADD(tcps_rcvackbyte, acked);
@ -2499,8 +2505,10 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
*/
tp->sackhint.sacked_bytes = 0;
#ifdef TCP_HHOOK
/* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */
hhook_run_tcp_est_in(tp, th, &to);
#endif
if (SEQ_LEQ(th->th_ack, tp->snd_una)) {
u_int maxseg;

View File

@ -40,7 +40,9 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/domain.h>
#ifdef TCP_HHOOK
#include <sys/hhook.h>
#endif
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/mbuf.h>
@ -140,11 +142,14 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFLAG_VNET | CTLFLAG_RW,
tcp_timer_active((tp), TT_PERSIST), \
("neither rexmt nor persist timer is set"))
#ifdef TCP_HHOOK
static void inline hhook_run_tcp_est_out(struct tcpcb *tp,
struct tcphdr *th, struct tcpopt *to,
uint32_t len, int tso);
#endif
static void inline cc_after_idle(struct tcpcb *tp);
#ifdef TCP_HHOOK
/*
* Wrapper for the TCP established output helper hook.
*/
@ -165,6 +170,7 @@ hhook_run_tcp_est_out(struct tcpcb *tp, struct tcphdr *th,
tp->osd);
}
}
#endif
/*
* CC wrapper hook functions
@ -1306,8 +1312,10 @@ tcp_output(struct tcpcb *tp)
__func__, len, hdrlen, ipoptlen, m_length(m, NULL)));
#endif
#ifdef TCP_HHOOK
/* Run HHOOK_TCP_ESTABLISHED_OUT helper hooks. */
hhook_run_tcp_est_out(tp, th, &to, len, tso);
#endif
#ifdef TCPDEBUG
/*

View File

@ -62,7 +62,9 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/module.h>
#include <sys/kernel.h>
#ifdef TCP_HHOOK
#include <sys/hhook.h>
#endif
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/proc.h> /* for proc0 declaration */
@ -266,8 +268,10 @@ tcp_do_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so,
if (winup_only == 0) {
acked = BYTES_THIS_ACK(tp, th);
#ifdef TCP_HHOOK
/* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */
hhook_run_tcp_est_in(tp, th, to);
#endif
TCPSTAT_ADD(tcps_rcvackbyte, acked);
sbdrop(&so->so_snd, acked);
@ -1040,8 +1044,10 @@ tcp_do_slowpath(struct mbuf *m, struct tcphdr *th, struct socket *so,
*/
tp->sackhint.sacked_bytes = 0;
#ifdef TCP_HHOOK
/* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */
hhook_run_tcp_est_in(tp, th, to);
#endif
if (SEQ_LEQ(th->th_ack, tp->snd_una)) {
if (tlen == 0 && tiwin == tp->snd_wnd) {
@ -2127,8 +2133,10 @@ tcp_fastack(struct mbuf *m, struct tcphdr *th, struct socket *so,
if (winup_only == 0) {
acked = BYTES_THIS_ACK(tp, th);
#ifdef TCP_HHOOK
/* Run HHOOK_TCP_ESTABLISHED_IN helper hooks. */
hhook_run_tcp_est_in(tp, th, to);
#endif
TCPSTAT_ADD(tcps_rcvackbyte, acked);
sbdrop(&so->so_snd, acked);

View File

@ -42,9 +42,13 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/callout.h>
#include <sys/eventhandler.h>
#ifdef TCP_HHOOK
#include <sys/hhook.h>
#endif
#include <sys/kernel.h>
#ifdef TCP_HHOOK
#include <sys/khelp.h>
#endif
#include <sys/sysctl.h>
#include <sys/jail.h>
#include <sys/malloc.h>
@ -238,7 +242,9 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, signature_verify_input, CTLFLAG_RW,
VNET_DEFINE(uma_zone_t, sack_hole_zone);
#define V_sack_hole_zone VNET(sack_hole_zone)
#ifdef TCP_HHOOK
VNET_DEFINE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST+1]);
#endif
static struct inpcb *tcp_notify(struct inpcb *, int);
static struct inpcb *tcp_mtudisc_notify(struct inpcb *, int);
@ -449,7 +455,9 @@ struct tcpcb_mem {
struct tcpcb tcb;
struct tcp_timer tt;
struct cc_var ccv;
#ifdef TCP_HHOOK
struct osd osd;
#endif
};
static VNET_DEFINE(uma_zone_t, tcpcb_zone);
@ -605,12 +613,14 @@ tcp_init(void)
tcbhash_tuneable = "net.inet.tcp.tcbhashsize";
#ifdef TCP_HHOOK
if (hhook_head_register(HHOOK_TYPE_TCP, HHOOK_TCP_EST_IN,
&V_tcp_hhh[HHOOK_TCP_EST_IN], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 0)
printf("%s: WARNING: unable to register helper hook\n", __func__);
if (hhook_head_register(HHOOK_TYPE_TCP, HHOOK_TCP_EST_OUT,
&V_tcp_hhh[HHOOK_TCP_EST_OUT], HHOOK_NOWAIT|HHOOK_HEADISINVNET) != 0)
printf("%s: WARNING: unable to register helper hook\n", __func__);
#endif
hashsize = TCBHASHSIZE;
TUNABLE_INT_FETCH(tcbhash_tuneable, &hashsize);
if (hashsize == 0) {
@ -763,6 +773,7 @@ tcp_destroy(void *unused __unused)
tcp_fastopen_destroy();
#endif
#ifdef TCP_HHOOK
error = hhook_head_deregister(V_tcp_hhh[HHOOK_TCP_EST_IN]);
if (error != 0) {
printf("%s: WARNING: unable to deregister helper hook "
@ -775,6 +786,7 @@ tcp_destroy(void *unused __unused)
"type=%d, id=%d: error %d returned\n", __func__,
HHOOK_TYPE_TCP, HHOOK_TCP_EST_OUT, error);
}
#endif
}
VNET_SYSUNINIT(tcp, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, tcp_destroy, NULL);
#endif
@ -1204,6 +1216,7 @@ tcp_newtcpcb(struct inpcb *inp)
return (NULL);
}
#ifdef TCP_HHOOK
tp->osd = &tm->osd;
if (khelp_init_osd(HELPER_CLASS_TCP, tp->osd)) {
if (tp->t_fb->tfb_tcp_fb_fini)
@ -1212,6 +1225,7 @@ tcp_newtcpcb(struct inpcb *inp)
uma_zfree(V_tcpcb_zone, tm);
return (NULL);
}
#endif
#ifdef VIMAGE
tp->t_vnet = inp->inp_vnet;
@ -1477,7 +1491,9 @@ tcp_discardcb(struct tcpcb *tp)
if (CC_ALGO(tp)->cb_destroy != NULL)
CC_ALGO(tp)->cb_destroy(tp->ccv);
#ifdef TCP_HHOOK
khelp_destroy_osd(tp->osd);
#endif
CC_ALGO(tp) = NULL;
inp->inp_ppcb = NULL;

View File

@ -749,8 +749,10 @@ VNET_DECLARE(int, tcp_ecn_maxretries);
#define V_tcp_do_ecn VNET(tcp_do_ecn)
#define V_tcp_ecn_maxretries VNET(tcp_ecn_maxretries)
#ifdef TCP_HHOOK
VNET_DECLARE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST + 1]);
#define V_tcp_hhh VNET(tcp_hhh)
#endif
VNET_DECLARE(int, tcp_do_rfc6675_pipe);
#define V_tcp_do_rfc6675_pipe VNET(tcp_do_rfc6675_pipe)
@ -788,8 +790,10 @@ void cc_ack_received(struct tcpcb *tp, struct tcphdr *th,
void cc_conn_init(struct tcpcb *tp);
void cc_post_recovery(struct tcpcb *tp, struct tcphdr *th);
void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type);
#ifdef TCP_HHOOK
void hhook_run_tcp_est_in(struct tcpcb *tp,
struct tcphdr *th, struct tcpopt *to);
#endif
int tcp_input(struct mbuf **, int *, int);
void tcp_do_segment(struct mbuf *, struct tcphdr *,

View File

@ -30,6 +30,7 @@ options SCHED_4BSD # 4BSD scheduler
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options IPSEC # IP (v4/v6) security
options TCP_HHOOK # hhook(9) framework for TCP
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support

View File

@ -38,6 +38,7 @@ options PREEMPTION #Enable kernel thread preemption
options INET #InterNETworking
options INET6 #IPv6 communications protocols
options IPSEC # IP (v4/v6) security
options TCP_HHOOK # hhook(9) framework for TCP
options SCTP #Stream Control Transmission Protocol
options FFS #Berkeley Fast Filesystem
options SOFTUPDATES #Enable FFS soft updates support

View File

@ -37,6 +37,7 @@ options SCHED_ULE #ULE scheduler
options PREEMPTION #Enable kernel thread preemption
options INET #InterNETworking
options INET6 #IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options SCTP #Stream Control Transmission Protocol
options FFS #Berkeley Fast Filesystem
options SOFTUPDATES #Enable FFS soft updates support

View File

@ -36,6 +36,7 @@ options GDB
options GEOM_PART_GPT
options INET
options INET6
options TCP_HHOOK # hhook(9) framework for TCP
options INVARIANTS
options INVARIANT_SUPPORT
options KDB

View File

@ -32,6 +32,7 @@ options SCHED_ULE # ULE scheduler
options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options TCP_HHOOK # hhook(9) framework for TCP
options IPSEC # IP (v4/v6) security
options TCP_OFFLOAD # TCP offload
options SCTP # Stream Control Transmission Protocol

View File

@ -31,6 +31,7 @@ options PREEMPTION # Enable kernel thread preemption
options INET # InterNETworking
options INET6 # IPv6 communications protocols
options IPSEC # IP (v4/v6) security
options TCP_HHOOK # hhook(9) framework for TCP
options SCTP # Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support