Date: Wed, 12 Oct 2016 02:16:42 +0000 (UTC) From: "Jonathan T. Looney" <jtl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r307082 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules/cc sys/modules/khelp sys/netinet sys/netinet/tcp_stacks sys/pc98/conf sy... Message-ID: <201610120216.u9C2Gga8041814@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jtl Date: Wed Oct 12 02:16:42 2016 New Revision: 307082 URL: https://svnweb.freebsd.org/changeset/base/307082 Log: 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 Modified: head/UPDATING head/sys/amd64/conf/GENERIC head/sys/arm/conf/ATMEL head/sys/arm/conf/AVILA head/sys/arm/conf/BWCT head/sys/arm/conf/CAMBRIA head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/CRB head/sys/arm/conf/DB-78XXX head/sys/arm/conf/DB-88F5XXX head/sys/arm/conf/DB-88F6XXX head/sys/arm/conf/DOCKSTAR head/sys/arm/conf/DREAMPLUG-1001 head/sys/arm/conf/EA3250 head/sys/arm/conf/EB9200 head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/EXYNOS5.common head/sys/arm/conf/GUMSTIX head/sys/arm/conf/HL200 head/sys/arm/conf/HL201 head/sys/arm/conf/KB920X head/sys/arm/conf/NSLU head/sys/arm/conf/QILA9G20 head/sys/arm/conf/SAM9260EK head/sys/arm/conf/SAM9G20EK head/sys/arm/conf/SAM9X25EK head/sys/arm/conf/SHEEVAPLUG head/sys/arm/conf/SN9G45 head/sys/arm/conf/TS7800 head/sys/arm/conf/std.armv6 head/sys/arm64/conf/GENERIC head/sys/conf/NOTES head/sys/conf/options head/sys/i386/conf/GENERIC head/sys/mips/conf/ADM5120 head/sys/mips/conf/ALCHEMY head/sys/mips/conf/AR71XX_BASE head/sys/mips/conf/AR724X_BASE head/sys/mips/conf/BCM head/sys/mips/conf/BERI_TEMPLATE head/sys/mips/conf/ERL head/sys/mips/conf/GXEMUL head/sys/mips/conf/GXEMUL32 head/sys/mips/conf/IDT head/sys/mips/conf/MT7620 head/sys/mips/conf/OCTEON1 head/sys/mips/conf/PB92 head/sys/mips/conf/QCA953X_BASE head/sys/mips/conf/QEMU head/sys/mips/conf/RT305X head/sys/mips/conf/RT5350 head/sys/mips/conf/SENTRY5 head/sys/mips/conf/XLR head/sys/mips/conf/XLR64 head/sys/mips/conf/XLRN32 head/sys/mips/conf/std.AR5312 head/sys/mips/conf/std.AR5315 head/sys/mips/conf/std.AR91XX head/sys/mips/conf/std.AR933X head/sys/mips/conf/std.AR934X head/sys/mips/conf/std.MALTA head/sys/mips/conf/std.QCA955X head/sys/mips/conf/std.SWARM head/sys/mips/conf/std.XLP head/sys/modules/cc/Makefile head/sys/modules/khelp/Makefile head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_var.h head/sys/pc98/conf/GENERIC head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 head/sys/powerpc/conf/MPC85XX head/sys/riscv/conf/GENERIC head/sys/sparc64/conf/GENERIC Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Oct 12 02:15:06 2016 (r307081) +++ head/UPDATING Wed Oct 12 02:16:42 2016 (r307082) @@ -31,6 +31,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 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. Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/amd64/conf/GENERIC Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/ATMEL Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/AVILA ============================================================================== --- head/sys/arm/conf/AVILA Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/AVILA Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/BWCT ============================================================================== --- head/sys/arm/conf/BWCT Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/BWCT Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/CAMBRIA ============================================================================== --- head/sys/arm/conf/CAMBRIA Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/CAMBRIA Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/CNS11XXNAS Wed Oct 12 02:16:42 2016 (r307082) @@ -46,6 +46,7 @@ options GEOM_LABEL # Provides labeliza 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 Modified: head/sys/arm/conf/CRB ============================================================================== --- head/sys/arm/conf/CRB Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/CRB Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/DB-78XXX ============================================================================== --- head/sys/arm/conf/DB-78XXX Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/DB-78XXX Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/DB-88F5XXX ============================================================================== --- head/sys/arm/conf/DB-88F5XXX Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/DB-88F5XXX Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/DB-88F6XXX ============================================================================== --- head/sys/arm/conf/DB-88F6XXX Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/DB-88F6XXX Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/DOCKSTAR ============================================================================== --- head/sys/arm/conf/DOCKSTAR Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/DOCKSTAR Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/DREAMPLUG-1001 ============================================================================== --- head/sys/arm/conf/DREAMPLUG-1001 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/DREAMPLUG-1001 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/EA3250 ============================================================================== --- head/sys/arm/conf/EA3250 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/EA3250 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/EB9200 ============================================================================== --- head/sys/arm/conf/EB9200 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/EB9200 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/ETHERNUT5 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/EXYNOS5.common ============================================================================== --- head/sys/arm/conf/EXYNOS5.common Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/EXYNOS5.common Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/GUMSTIX ============================================================================== --- head/sys/arm/conf/GUMSTIX Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/GUMSTIX Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/HL200 ============================================================================== --- head/sys/arm/conf/HL200 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/HL200 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/HL201 ============================================================================== --- head/sys/arm/conf/HL201 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/HL201 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/KB920X ============================================================================== --- head/sys/arm/conf/KB920X Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/KB920X Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/NSLU ============================================================================== --- head/sys/arm/conf/NSLU Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/NSLU Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/QILA9G20 ============================================================================== --- head/sys/arm/conf/QILA9G20 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/QILA9G20 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/SAM9260EK Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/SAM9G20EK ============================================================================== --- head/sys/arm/conf/SAM9G20EK Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/SAM9G20EK Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/SAM9X25EK ============================================================================== --- head/sys/arm/conf/SAM9X25EK Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/SAM9X25EK Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/SHEEVAPLUG ============================================================================== --- head/sys/arm/conf/SHEEVAPLUG Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/SHEEVAPLUG Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/SN9G45 ============================================================================== --- head/sys/arm/conf/SN9G45 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/SN9G45 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/TS7800 ============================================================================== --- head/sys/arm/conf/TS7800 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/TS7800 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm/conf/std.armv6 Wed Oct 12 02:16:42 2016 (r307082) @@ -7,6 +7,7 @@ options ARM_L2_PIPT # Only L2 PIPT is 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 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/arm64/conf/GENERIC Wed Oct 12 02:16:42 2016 (r307082) @@ -29,6 +29,7 @@ options PREEMPTION # Enable kernel thr 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 Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/conf/NOTES Wed Oct 12 02:16:42 2016 (r307082) @@ -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 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 Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/conf/options Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/i386/conf/GENERIC ============================================================================== --- head/sys/i386/conf/GENERIC Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/i386/conf/GENERIC Wed Oct 12 02:16:42 2016 (r307082) @@ -31,6 +31,7 @@ options PREEMPTION # Enable kernel thr 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 Modified: head/sys/mips/conf/ADM5120 ============================================================================== --- head/sys/mips/conf/ADM5120 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/ADM5120 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/ALCHEMY ============================================================================== --- head/sys/mips/conf/ALCHEMY Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/ALCHEMY Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/AR71XX_BASE ============================================================================== --- head/sys/mips/conf/AR71XX_BASE Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/AR71XX_BASE Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/AR724X_BASE ============================================================================== --- head/sys/mips/conf/AR724X_BASE Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/AR724X_BASE Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/BCM ============================================================================== --- head/sys/mips/conf/BCM Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/BCM Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/BERI_TEMPLATE ============================================================================== --- head/sys/mips/conf/BERI_TEMPLATE Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/BERI_TEMPLATE Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/ERL ============================================================================== --- head/sys/mips/conf/ERL Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/ERL Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/GXEMUL ============================================================================== --- head/sys/mips/conf/GXEMUL Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/GXEMUL Wed Oct 12 02:16:42 2016 (r307082) @@ -32,6 +32,7 @@ options SMP # Symmetric MultiProcesso options SCHED_ULE options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS #Berkeley Fast Filesystem Modified: head/sys/mips/conf/GXEMUL32 ============================================================================== --- head/sys/mips/conf/GXEMUL32 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/GXEMUL32 Wed Oct 12 02:16:42 2016 (r307082) @@ -30,6 +30,7 @@ options SMP # Symmetric MultiProcesso options SCHED_ULE options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_HHOOK # hhook(9) framework for TCP options FFS #Berkeley Fast Filesystem Modified: head/sys/mips/conf/IDT ============================================================================== --- head/sys/mips/conf/IDT Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/IDT Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/MT7620 ============================================================================== --- head/sys/mips/conf/MT7620 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/MT7620 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/OCTEON1 ============================================================================== --- head/sys/mips/conf/OCTEON1 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/OCTEON1 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/PB92 ============================================================================== --- head/sys/mips/conf/PB92 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/PB92 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/QCA953X_BASE ============================================================================== --- head/sys/mips/conf/QCA953X_BASE Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/QCA953X_BASE Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/QEMU ============================================================================== --- head/sys/mips/conf/QEMU Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/QEMU Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/RT305X ============================================================================== --- head/sys/mips/conf/RT305X Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/RT305X Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/RT5350 ============================================================================== --- head/sys/mips/conf/RT5350 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/RT5350 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/SENTRY5 ============================================================================== --- head/sys/mips/conf/SENTRY5 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/SENTRY5 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/XLR ============================================================================== --- head/sys/mips/conf/XLR Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/XLR Wed Oct 12 02:16:42 2016 (r307082) @@ -62,6 +62,7 @@ options PREEMPTION # Enable kernel thr #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 Modified: head/sys/mips/conf/XLR64 ============================================================================== --- head/sys/mips/conf/XLR64 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/XLR64 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/XLRN32 ============================================================================== --- head/sys/mips/conf/XLRN32 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/XLRN32 Wed Oct 12 02:16:42 2016 (r307082) @@ -36,6 +36,7 @@ options PREEMPTION # Enable kernel thr #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 Modified: head/sys/mips/conf/std.AR5312 ============================================================================== --- head/sys/mips/conf/std.AR5312 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.AR5312 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/std.AR5315 ============================================================================== --- head/sys/mips/conf/std.AR5315 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.AR5315 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/std.AR91XX ============================================================================== --- head/sys/mips/conf/std.AR91XX Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.AR91XX Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/std.AR933X ============================================================================== --- head/sys/mips/conf/std.AR933X Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.AR933X Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/std.AR934X ============================================================================== --- head/sys/mips/conf/std.AR934X Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.AR934X Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/std.MALTA ============================================================================== --- head/sys/mips/conf/std.MALTA Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.MALTA Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/std.QCA955X ============================================================================== --- head/sys/mips/conf/std.QCA955X Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.QCA955X Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/std.SWARM ============================================================================== --- head/sys/mips/conf/std.SWARM Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.SWARM Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/mips/conf/std.XLP ============================================================================== --- head/sys/mips/conf/std.XLP Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/mips/conf/std.XLP Wed Oct 12 02:16:42 2016 (r307082) @@ -15,6 +15,7 @@ options PREEMPTION # Enable kernel thr #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 Modified: head/sys/modules/cc/Makefile ============================================================================== --- head/sys/modules/cc/Makefile Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/modules/cc/Makefile Wed Oct 12 02:16:42 2016 (r307082) @@ -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> Modified: head/sys/modules/khelp/Makefile ============================================================================== --- head/sys/modules/khelp/Makefile Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/modules/khelp/Makefile Wed Oct 12 02:16:42 2016 (r307082) @@ -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> Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/netinet/tcp_input.c Wed Oct 12 02:16:42 2016 (r307082) @@ -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, s tp->osd); } } +#endif /* * CC wrapper hook functions @@ -1753,8 +1757,10 @@ tcp_do_segment(struct mbuf *m, struct tc } 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 tc */ 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; Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/netinet/tcp_output.c Wed Oct 12 02:16:42 2016 (r307082) @@ -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, send 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, tp->osd); } } +#endif /* * CC wrapper hook functions @@ -1306,8 +1312,10 @@ send: __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 /* Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/netinet/tcp_stacks/fastpath.c Wed Oct 12 02:16:42 2016 (r307082) @@ -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 tc 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 t */ 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 tcphd 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); Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/netinet/tcp_subr.c Wed Oct 12 02:16:42 2016 (r307082) @@ -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, sign 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; Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/netinet/tcp_var.h Wed Oct 12 02:16:42 2016 (r307082) @@ -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, s 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 *, Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/pc98/conf/GENERIC Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/powerpc/conf/GENERIC Wed Oct 12 02:16:42 2016 (r307082) @@ -38,6 +38,7 @@ options PREEMPTION #Enable kernel thre 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 Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/powerpc/conf/GENERIC64 Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/powerpc/conf/MPC85XX ============================================================================== --- head/sys/powerpc/conf/MPC85XX Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/powerpc/conf/MPC85XX Wed Oct 12 02:16:42 2016 (r307082) @@ -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 Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Wed Oct 12 02:15:06 2016 (r307081) +++ head/sys/riscv/conf/GENERIC Wed Oct 12 02:16:42 2016 (r307082) @@ -32,6 +32,7 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610120216.u9C2Gga8041814>