From nobody Tue Jan 16 19:05:08 2024 X-Original-To: dev-commits-src-all@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 4TDz3S3Sdxz57qv9; Tue, 16 Jan 2024 19:05:08 +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 4TDz3S32zbz54RL; Tue, 16 Jan 2024 19:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705431908; 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=C9EAxLfmbEI/0QCs4cYkcSA50J74mYjeW4VKacyYE+o=; b=mJUq+olvM6tH64JlV+rCSwCHSuvcScT9aWNBIbVDeSRhSUvSRd/HadSZKr5OMXAvDRn4Ir AuuRZOeLXjLEUdzp79qZtodP5YFXFLU6TpYI3LzcqLGOydfDfpItdsP9s+7VZ3SNPxI7Jv vX5iLcP9FXAZ/AP9fv0hmhUba33Tgz2LcKJ96w7UIe/Pfc16/uCWbodSun5iqvos3KmPkU aPA9kPCR/qAB/WpeLaq3BPS9C0iCpHnaHl9PlE/XjUGMsAPm1ES2lSSy9q9PQCf2qx7pRv sJAWLPt2gtr+fg4GlLfxbEqTWLiM4SI4oIFcq/y3BaHFUxOmuF6Yne21SCKgTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705431908; 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=C9EAxLfmbEI/0QCs4cYkcSA50J74mYjeW4VKacyYE+o=; b=KT8l3ZtF75DgLkBYcXoulyYwVHFXL30ET0cRDCRpBQtKZGcIWq7VuYdtPQyYboc+VR+s0+ kuuXFzJocGrQCVNfDgi++kGvQIvk6wa2ejCvQKWUtoQ5mtVPf0utM+ootmpxG9NinNuguG l209PJvI3JAwjsncQ/nkbOdeZg+JcRol8H/rGPMB4OibTgNaDSREnuAVa1epdbpNsN5ydA nEBNh1PAKX6SqhVZuem+3Lk5ALkhsomjWZAkHRebl/jyoiuleuKj1y6eDAsqFOhptehOrU 8sLK1YixFdMCvoY9Lmdo5HgkXQQYHlgxce0ecuR6iUR0kDySRXHYxEX4/y0b9w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705431908; a=rsa-sha256; cv=none; b=gEMFefFgWxQgjneHln6wx12AfOyRkq4o+kAU33HiSOe2hBWFVZJYX51jXaJsTVSQttwWgu 25m2AgITfkwUr+IlExRJgvTMw3kc+6EyFCsxoy5MsAf7vKMuzoYdH4N2brGyYrjAQ+mYlf kGUtzX2KuRZOIfPA5iJeVdkfu9sMpMzTOI8vjjMZ3pgIGbD+kBgZUCA0TrR9RUiFtj1/sz DMrhiyoCm9WCnp+sibd6tkrpHbOdNuFJXFlSrs1xql882eM/XtcPXsfCgETJVxg05sfVHr oxXdF/6uu9tuDp2PAjCulIvi5gEuhc9PmRQC/et5JjdCgK1crx3NJpC8moXmcQ== 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 4TDz3S2821zsbb; Tue, 16 Jan 2024 19:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40GJ58N6009869; Tue, 16 Jan 2024 19:05:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40GJ58e8009866; Tue, 16 Jan 2024 19:05:08 GMT (envelope-from git) Date: Tue, 16 Jan 2024 19:05:08 GMT Message-Id: <202401161905.40GJ58e8009866@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gleb Smirnoff Subject: git: 56a55eee6bbe - stable/14 - tcp: uninline tcp_account_for_send() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 56a55eee6bbe4aac9bd1c870f9ace58a95328c55 Auto-Submitted: auto-generated The branch stable/14 has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=56a55eee6bbe4aac9bd1c870f9ace58a95328c55 commit 56a55eee6bbe4aac9bd1c870f9ace58a95328c55 Author: Gleb Smirnoff AuthorDate: 2023-11-21 17:21:41 +0000 Commit: Gleb Smirnoff CommitDate: 2024-01-16 18:37:06 +0000 tcp: uninline tcp_account_for_send() This allows to clear inclusion of "opt_kern_tls.h" from a system header. Reviewed by: rscheff, tuexen Differential Revision: https://reviews.freebsd.org/D42696 (cherry picked from commit 219a6ca919576c4f7e783720f66a458d51476f3d) --- sys/netinet/tcp_subr.c | 27 +++++++++++++++++++++++++++ sys/netinet/tcp_var.h | 26 +------------------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 27b0eae83837..083a8b1ea384 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -4678,3 +4678,30 @@ tcp_get_srtt(struct tcpcb *tp, int granularity) return (srtt); } + +void +tcp_account_for_send(struct tcpcb *tp, uint32_t len, uint8_t is_rxt, + uint8_t is_tlp, bool hw_tls) +{ + + if (is_tlp) { + tp->t_sndtlppack++; + tp->t_sndtlpbyte += len; + } + /* To get total bytes sent you must add t_snd_rxt_bytes to t_sndbytes */ + if (is_rxt) + tp->t_snd_rxt_bytes += len; + else + tp->t_sndbytes += len; + +#ifdef KERN_TLS + if (hw_tls && is_rxt && len != 0) { + uint64_t rexmit_percent; + + 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 +} diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 624de66e3e23..4be7fc1baad5 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -38,7 +38,6 @@ #include #ifdef _KERNEL -#include "opt_kern_tls.h" #include #include #include @@ -1356,6 +1355,7 @@ VNET_DECLARE(struct hhook_head *, tcp_hhh[HHOOK_TCP_LAST + 1]); #define V_tcp_hhh VNET(tcp_hhh) #endif +void tcp_account_for_send(struct tcpcb *, uint32_t, uint8_t, uint8_t, bool); int tcp_addoptions(struct tcpopt *, u_char *); struct tcpcb * tcp_close(struct tcpcb *); @@ -1589,30 +1589,6 @@ tcp_set_flags(struct tcphdr *th, uint16_t flags) th->th_x2 = (flags >> 8) & 0x0f; th->th_flags = flags & 0xff; } - -static inline void -tcp_account_for_send(struct tcpcb *tp, uint32_t len, uint8_t is_rxt, - uint8_t is_tlp, bool hw_tls) -{ - if (is_tlp) { - tp->t_sndtlppack++; - tp->t_sndtlpbyte += len; - } - /* To get total bytes sent you must add t_snd_rxt_bytes to t_sndbytes */ - if (is_rxt) - tp->t_snd_rxt_bytes += len; - else - tp->t_sndbytes += len; - -#ifdef KERN_TLS - if (hw_tls && is_rxt && len != 0) { - 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 */ #endif /* _NETINET_TCP_VAR_H_ */