Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Jul 2023 12:50:43 GMT
From:      Michael Tuexen <tuexen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: e4a873bf10b7 - main - tcp: improve layout of struct tcpcb
Message-ID:  <202307191250.36JCohNt060533@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=e4a873bf10b7cc8fa67087a7291a640d09e430f2

commit e4a873bf10b7cc8fa67087a7291a640d09e430f2
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2023-07-19 12:47:36 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2023-07-19 12:47:36 +0000

    tcp: improve layout of struct tcpcb
    
    Put optional fields at the end to minimize run time problems in
    case CC modules are build from within its directory.
    
    Reviewed by:            cc, gallatin, glebius, imp
    Sponsored by:           Netflix, Inc.
    Differential Revision:  https://reviews.freebsd.org/D41059
---
 sys/netinet/tcp_var.h | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
index 8e89f2aef0f2..0f57fec74865 100644
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -442,15 +442,6 @@ struct tcpcb {
 	const char *t_output_caller;	/* Function that called tcp_output */
 	struct statsblob *t_stats;	/* Per-connection stats */
 	/* Should these be a pointer to the arrays or an array? */
-#ifdef TCP_ACCOUNTING
-	uint64_t tcp_cnt_counters[TCP_NUM_CNT_COUNTERS];
-	uint64_t tcp_proc_time[TCP_NUM_CNT_COUNTERS];
-#endif
-#ifdef TCP_REQUEST_TRK
-	uint32_t tcp_hybrid_start;	/* Num of times we started hybrid pacing */
-	uint32_t tcp_hybrid_stop;	/* Num of times we stopped hybrid pacing */
-	uint32_t tcp_hybrid_error;	/* Num of times we failed to start hybrid pacing */
-#endif
 	uint32_t t_logsn;		/* Log "serial number" */
 	uint32_t gput_ts;		/* Time goodput measurement started */
 	tcp_seq gput_seq;		/* Outbound measurement seq */
@@ -478,10 +469,6 @@ struct tcpcb {
 		uint8_t t_end_info_bytes[TCP_END_BYTE_INFO];
 		uint64_t t_end_info;
 	};
-#ifdef TCPPCAP
-	struct mbufq t_inpkts;		/* List of saved input packets. */
-	struct mbufq t_outpkts;		/* List of saved output packets. */
-#endif
 	struct osd	t_osd;		/* storage for Khelp module data */
 	uint8_t _t_logpoint;	/* Used when a BB log points is enabled */
 #ifdef TCP_REQUEST_TRK
@@ -489,8 +476,19 @@ struct tcpcb {
 	uint8_t t_tcpreq_req;	/* Request count */
 	uint8_t t_tcpreq_open;	/* Number of open range requests */
 	uint8_t t_tcpreq_closed;	/* Number of closed range requests */
+	uint32_t tcp_hybrid_start;	/* Num of times we started hybrid pacing */
+	uint32_t tcp_hybrid_stop;	/* Num of times we stopped hybrid pacing */
+	uint32_t tcp_hybrid_error;	/* Num of times we failed to start hybrid pacing */
 	struct tcp_sendfile_track t_tcpreq_info[MAX_TCP_TRK_REQ];
 #endif
+#ifdef TCP_ACCOUNTING
+	uint64_t tcp_cnt_counters[TCP_NUM_CNT_COUNTERS];
+	uint64_t tcp_proc_time[TCP_NUM_CNT_COUNTERS];
+#endif
+#ifdef TCPPCAP
+	struct mbufq t_inpkts;		/* List of saved input packets. */
+	struct mbufq t_outpkts;		/* List of saved output packets. */
+#endif
 };
 #endif	/* _KERNEL || _WANT_TCPCB */
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202307191250.36JCohNt060533>