aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2023-07-19 12:47:36 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2023-07-19 12:47:36 +0000
commite4a873bf10b7cc8fa67087a7291a640d09e430f2 (patch)
treecb12200a90e6faf33c593b4c0c704c6db1508e9e
parentc5312bd79e66ce8ef50655ce7f3eca06d6b6e24f (diff)
downloadsrc-e4a873bf10b7cc8fa67087a7291a640d09e430f2.tar.gz
src-e4a873bf10b7cc8fa67087a7291a640d09e430f2.zip
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
-rw-r--r--sys/netinet/tcp_var.h24
1 files 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 */