From nobody Tue Jan 10 21:18:22 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ns3ZQ2FDsz2pGcs; Tue, 10 Jan 2023 21:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ns3ZQ1mkCz3DYB; Tue, 10 Jan 2023 21:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673385502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ATyBl6qQe5IPZUM1NEHobw9FZ647gUkFj0QUpX0Wk/4=; b=ZD+Ndz2/0/Ob+C+iOPdaVdumB0RX+0RVngfhtO5TwOoC4ejFvFfxIxiUpQKWCr6oAErCFO tlSdMvKKArSTTZlreDCT+SznaofQUk5x1/d4ozSSawDcXyl127T9k0H8U0KOqj0RtmVnQZ U8UYjH3r8BgpV3Op63t+Jcb29W2YyV28wepdouIvpeptdL/HFxEsMryboqEkUhn+QDUjFV 9NVwfRMaPNKqWN2gNGciTgkCRSkoCOQoMP3q/xnTSpFcEPX7L2qCo6jSKhnmmDY3vW+LuQ igE6Bf8KZcBxLKXohaTYnvY8FHS6auOhXgBpxC0OKVhzB1vLY464vnwGxsdzag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1673385502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ATyBl6qQe5IPZUM1NEHobw9FZ647gUkFj0QUpX0Wk/4=; b=Ai1t2tQ1dHzt5yK1TbVlROZwvs4EJFkfjCRZKlc38e9TGlWKhrhqLOeZ6260DF/2A379/B Jw4FIfUSjYW+udHUNuEBQtOaver2UCuN4lWOooNlh10BuasEDj1Q3pNGDwPs2UFjH/I7OC W30zOLj6UdLTXTUKrUw8Ib/VWqWXjsxeYhNwBQjFQjmAXOnAQrOyM5jLswJ5chrehpmPtG 1grm7fPgijPmoxWhXGoUDTs214BBtA+6qtHsNdG3YXvQOdkojsl2+YLU53/SrRjiBpG3Z1 dNdq/gfsifRnTvnauBRyJwODx9GaTVVYDkkHjWlixxvnfWPNHppQomRO13wC7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1673385502; a=rsa-sha256; cv=none; b=nF2/L3njNLP9bn9mU4OM8xmpR56rTgu8OKryzEsb1DvwaCSCRm4Mv6t5oTdZM0nL72Wm9n TSRkVfM2AN8VmE2Ajg78w9eEnebEpdtpIH/CHtCePppdU8xDClcTf84gBKk87zPX9x123B mIv+HlUYHZ9PqcXLOl4/30NFaH6WAJqHAlXeb7xHdvRD+FPwOYA8Qzulj+qSHaitGAhvbk GQhLBXgQMK+qakO1hO/c2ooxfD5NNKb1pWQ8BvK8UadUGm9trhuSOwOLHKDr7TURxdVYSk oAA/rPsCBT6pAr71uvyivecjzbYAUQdlaoetYkjF12XM0QQggpLuDoz/qbvRNw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ns3ZQ0qJ7zNKM; Tue, 10 Jan 2023 21:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30ALIMPa024133; Tue, 10 Jan 2023 21:18:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30ALIMRq024132; Tue, 10 Jan 2023 21:18:22 GMT (envelope-from git) Date: Tue, 10 Jan 2023 21:18:22 GMT Message-Id: <202301102118.30ALIMRq024132@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 8ea418299548 - main - tcp: Build RACK and BBR stacks as a part of LINT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ea41829954831d345c3aef58488adf0fc8dbb42 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=8ea41829954831d345c3aef58488adf0fc8dbb42 commit 8ea41829954831d345c3aef58488adf0fc8dbb42 Author: Andrew Gallatin AuthorDate: 2023-01-10 21:09:00 +0000 Commit: Andrew Gallatin CommitDate: 2023-01-10 21:16:43 +0000 tcp: Build RACK and BBR stacks as a part of LINT When RACK and BBR were added to the kernel, they were put behind 'WITH_EXTRA_TCP_STACKS=1'. Unfortunately that was never added to any NOTES file, so RACK & BBR were not compiled with the various LINT-NOINET, LINT-NOINET6, and LINT-NOIP kernels. This lead to the stacks sometimes being broken. This change: - Fixes RACK so that it compiles with the various LINT-NO* kernels - Adds WITH_EXTRA_TCP_STACKS=1 to all NOTES kernels so that RACK and BBR are compile tested regularly Sponsored by: Netflix Reviewed by: rrs Differential Revision: https://reviews.freebsd.org/D37903 --- sys/conf/NOTES | 1 + sys/netinet/tcp_stacks/rack.c | 23 ++++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/sys/conf/NOTES b/sys/conf/NOTES index a1c0e71551ae..6cea39d27ad6 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -677,6 +677,7 @@ options TCP_OFFLOAD # TCP offload support. options TCP_RFC7413 # TCP Fast Open options TCPHPTS +makeoptions WITH_EXTRA_TCP_STACKS=1 # RACK and BBR TCP kernel modules # In order to enable IPSEC you MUST also add device crypto to # your kernel configuration diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 6070ad5dc17a..dafe8184a8fd 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ipsec.h" #include "opt_ratelimit.h" #include "opt_kern_tls.h" +#if defined(INET) || defined(INET6) #include #include #include @@ -12347,6 +12348,7 @@ rack_init_fsb_block(struct tcpcb *tp, struct tcp_rack *rack) ip6, rack->r_ctl.fsb.th); } else #endif /* INET6 */ +#ifdef INET { rack->r_ctl.fsb.tcp_ip_hdr_len = sizeof(struct tcpiphdr); ip = (struct ip *)rack->r_ctl.fsb.tcp_ip_hdr; @@ -12366,6 +12368,7 @@ rack_init_fsb_block(struct tcpcb *tp, struct tcp_rack *rack) tp->t_port, ip, rack->r_ctl.fsb.th); } +#endif rack->r_fsb_inited = 1; } @@ -15611,7 +15614,7 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma struct tcpopt to; u_char opt[TCP_MAXOLEN]; uint32_t hdrlen, optlen; - int32_t slot, segsiz, max_val, tso = 0, error, ulen = 0; + int32_t slot, segsiz, max_val, tso = 0, error = 0, ulen = 0; uint16_t flags; uint32_t if_hw_tsomaxsegcount = 0, startseq; uint32_t if_hw_tsomaxsegsize; @@ -15935,8 +15938,6 @@ rack_fast_rsm_output(struct tcpcb *tp, struct tcp_rack *rack, struct rack_sendma &inp->inp_route6, 0, NULL, NULL, inp); } -#endif -#if defined(INET) && defined(INET6) else #endif #ifdef INET @@ -16102,7 +16103,9 @@ rack_fast_output(struct tcpcb *tp, struct tcp_rack *rack, uint64_t ts_val, * the max-burst). We have how much to send and all the info we * need to just send. */ +#ifdef INET struct ip *ip = NULL; +#endif struct udphdr *udp = NULL; struct tcphdr *th = NULL; struct mbuf *m, *s_mb; @@ -16133,8 +16136,10 @@ rack_fast_output(struct tcpcb *tp, struct tcp_rack *rack, uint64_t ts_val, } else #endif /* INET6 */ { +#ifdef INET ip = (struct ip *)rack->r_ctl.fsb.tcp_ip_hdr; hdrlen = sizeof(struct tcpiphdr); +#endif } if (tp->t_port && (V_tcp_udp_tunneling_port == 0)) { m = NULL; @@ -16281,8 +16286,10 @@ again: else #endif { +#ifdef INET ip->ip_tos &= ~IPTOS_ECN_MASK; ip->ip_tos |= ect; +#endif } } tcp_set_flags(th, flags); @@ -18346,7 +18353,9 @@ send: ip6 = (struct ip6_hdr *)rack->r_ctl.fsb.tcp_ip_hdr; else #endif /* INET6 */ +#ifdef INET ip = (struct ip *)rack->r_ctl.fsb.tcp_ip_hdr; +#endif th = rack->r_ctl.fsb.th; udp = rack->r_ctl.fsb.udp; if (udp) { @@ -18375,6 +18384,7 @@ send: } else #endif /* INET6 */ { +#ifdef INET ip = mtod(m, struct ip *); if (tp->t_port) { udp = (struct udphdr *)((caddr_t)ip + sizeof(struct ip)); @@ -18386,6 +18396,7 @@ send: } else th = (struct tcphdr *)(ip + 1); tcpip_fillheaders(inp, tp->t_port, ip, th); +#endif } } /* @@ -18419,8 +18430,10 @@ send: else #endif { +#ifdef INET ip->ip_tos &= ~IPTOS_ECN_MASK; ip->ip_tos |= ect; +#endif } } /* @@ -18514,7 +18527,9 @@ send: ip6 = mtod(m, struct ip6_hdr *); else #endif /* INET6 */ +#ifdef INET ip = mtod(m, struct ip *); +#endif th = (struct tcphdr *)(cpto + ((uint8_t *)rack->r_ctl.fsb.th - rack->r_ctl.fsb.tcp_ip_hdr)); /* If we have a udp header lets set it into the mbuf as well */ if (udp) @@ -20834,3 +20849,5 @@ static moduledata_t tcp_rack = { MODULE_VERSION(MODNAME, 1); DECLARE_MODULE(MODNAME, tcp_rack, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); MODULE_DEPEND(MODNAME, tcphpts, 1, 1, 1); + +#endif /* #if !defined(INET) && !defined(INET6) */