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
This commit is contained in:
Michael Tuexen
2023-07-19 14:47:36 +02:00
parent c5312bd79e
commit e4a873bf10
+11 -13
View File
@@ -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 */