Page MenuHomeFreeBSD

D56484.id.diff
No OneTemporary

D56484.id.diff

diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c
--- a/sys/netinet/tcp_subr.c
+++ b/sys/netinet/tcp_subr.c
@@ -1133,6 +1133,9 @@
MALLOC_DEFINE(M_TCPLOG, "tcplog", "TCP address and flags print buffers");
MALLOC_DEFINE(M_TCPFUNCTIONS, "tcpfunc", "TCP function set memory");
+#ifdef TCP_REQUEST_TRK
+MALLOC_DEFINE(M_TCPREQTRK, "tcpreqtrk", "TCP request tracking");
+#endif
static struct mtx isn_mtx;
@@ -2445,6 +2448,12 @@
#ifdef STATS
stats_blob_destroy(tp->t_stats);
#endif
+#ifdef TCP_REQUEST_TRK
+ if (tp->t_tcpreq_info != NULL) {
+ free(tp->t_tcpreq_info, M_TCPREQTRK);
+ tp->t_tcpreq_info = NULL;
+ }
+#endif
CC_ALGO(tp) = NULL;
if ((m = STAILQ_FIRST(&tp->t_inqueue)) != NULL) {
@@ -4890,6 +4899,14 @@
struct tcp_sendfile_track *fil;
int i, allocated;
+ /* Allocate the request tracking array on demand */
+ if (tp->t_tcpreq_info == NULL) {
+ tp->t_tcpreq_info = malloc(
+ sizeof(*tp->t_tcpreq_info) * MAX_TCP_TRK_REQ,
+ M_TCPREQTRK, M_NOWAIT | M_ZERO);
+ if (tp->t_tcpreq_info == NULL)
+ return (NULL);
+ }
/* In case the stack does not check for completions do so now */
tcp_req_check_for_comp(tp, tp->snd_una);
/* Check for stale entries */
diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h
--- a/sys/netinet/tcp_var.h
+++ b/sys/netinet/tcp_var.h
@@ -493,7 +493,7 @@
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];
+ struct tcp_sendfile_track *t_tcpreq_info;
#endif
#ifdef TCP_ACCOUNTING
uint64_t tcp_cnt_counters[TCP_NUM_CNT_COUNTERS];

File Metadata

Mime Type
text/plain
Expires
Thu, Sep 3, 11:09 AM (6 h, 30 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38099780
Default Alt Text
D56484.id.diff (1 KB)

Event Timeline