From owner-dev-commits-src-main@freebsd.org Thu Aug 5 23:25:38 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41B2566C904; Thu, 5 Aug 2021 23:25:38 +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 4Ggl8f0xvvz4fkV; Thu, 5 Aug 2021 23:25:38 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 04CBB2313B; Thu, 5 Aug 2021 23:25:38 +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 175NPbqh035137; Thu, 5 Aug 2021 23:25:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 175NPbZG035136; Thu, 5 Aug 2021 23:25:37 GMT (envelope-from git) Date: Thu, 5 Aug 2021 23:25:37 GMT Message-Id: <202108052325.175NPbZG035136@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: 739de953ecc1 - main - ktls: Move KERN_TLS ifdef to tcp_var.h 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: 739de953ecc13afa930e2f55b7ee2a04e41e3519 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Aug 2021 23:25:38 -0000 The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=739de953ecc13afa930e2f55b7ee2a04e41e3519 commit 739de953ecc13afa930e2f55b7ee2a04e41e3519 Author: Andrew Gallatin AuthorDate: 2021-08-05 23:17:35 +0000 Commit: Andrew Gallatin CommitDate: 2021-08-05 23:17:35 +0000 ktls: Move KERN_TLS ifdef to tcp_var.h This allows us to remove stubs in ktls.h and allows us to sort the function prototypes. Reviewed by: jhb Sponsored by: Netflix --- sys/netinet/tcp_var.h | 6 +++--- sys/sys/ktls.h | 14 +++----------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 8cfd2c5417c2..64e954cf4ad5 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1144,8 +1144,6 @@ static inline void tcp_account_for_send(struct tcpcb *tp, uint32_t len, uint8_t is_rxt, uint8_t is_tlp, int hw_tls) { - uint64_t rexmit_percent; - if (is_tlp) { tp->t_sndtlppack++; tp->t_sndtlpbyte += len; @@ -1156,11 +1154,13 @@ tcp_account_for_send(struct tcpcb *tp, uint32_t len, uint8_t is_rxt, else tp->t_sndbytes += len; +#ifdef KERN_TLS if (hw_tls && is_rxt) { - rexmit_percent = (1000ULL * tp->t_snd_rxt_bytes) / (10ULL * (tp->t_snd_rxt_bytes + tp->t_sndbytes)); + uint64_t rexmit_percent = (1000ULL * tp->t_snd_rxt_bytes) / (10ULL * (tp->t_snd_rxt_bytes + tp->t_sndbytes)); if (rexmit_percent > ktls_ifnet_max_rexmit_pct) ktls_disable_ifnet(tp); } +#endif } #endif /* _KERNEL */ diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index a4156eb10395..437e36f965ea 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -197,7 +197,10 @@ struct ktls_session { bool disable_ifnet_pending; } __aligned(CACHE_LINE_SIZE); +extern unsigned int ktls_ifnet_max_rexmit_pct; + void ktls_check_rx(struct sockbuf *sb); +void ktls_disable_ifnet(void *arg); int ktls_enable_rx(struct socket *so, struct tls_enable *en); int ktls_enable_tx(struct socket *so, struct tls_enable *en); void ktls_destroy(struct ktls_session *tls); @@ -233,16 +236,5 @@ ktls_free(struct ktls_session *tls) ktls_destroy(tls); } -#ifdef KERN_TLS -extern unsigned int ktls_ifnet_max_rexmit_pct; -void ktls_disable_ifnet(void *arg); -#else -#define ktls_ifnet_max_rexmit_pct 1 -static inline void -ktls_disable_ifnet(void *arg __unused) -{ -} -#endif - #endif /* !_KERNEL */ #endif /* !_SYS_KTLS_H_ */