Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175995142
D60733.id189926.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D60733.id189926.diff
View Options
diff --git a/sys/netinet/tcp_hostcache.c b/sys/netinet/tcp_hostcache.c
--- a/sys/netinet/tcp_hostcache.c
+++ b/sys/netinet/tcp_hostcache.c
@@ -448,6 +448,21 @@
return (tcp_hc_update(inc, &hcm));
}
+/*
+ * External function: update send/recv socket buffer sizes (pipes).
+ */
+void
+tcp_hc_updatepipes(const struct in_conninfo *inc, uint32_t recvpipe,
+ uint32_t sendpipe)
+{
+ struct tcp_hc_metrics hcm = {
+ .hc_sendpipe = sendpipe,
+ .hc_recvpipe = recvpipe,
+ };
+
+ return (tcp_hc_update(inc, &hcm));
+}
+
/*
* External function: update the TCP metrics of an entry in the hostcache.
* Creates a new entry if none was found.
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -1450,6 +1450,8 @@
(so->so_rcv.sb_hiwat / 2)), V_tcp_autorcvbuf_max);
if (sbreserve_locked(so, SO_RCV, newsize, NULL)) {
TCP_PROBE2(receive__autoresize, tp, newsize);
+ tcp_hc_updatepipes(&tp->t_inpcb.inp_inc,
+ newsize, 0);
} else {
so->so_rcv.sb_flags &= ~SB_AUTOSIZE;
}
diff --git a/sys/netinet/tcp_output.c b/sys/netinet/tcp_output.c
--- a/sys/netinet/tcp_output.c
+++ b/sys/netinet/tcp_output.c
@@ -2170,6 +2170,7 @@
V_tcp_autosndbuf_max);
if (sbreserve_locked(so, SO_SND, newsize, curthread)) {
TCP_PROBE2(send__autoresize, tp, newsize);
+ tcp_hc_updatepipes(&tp->t_inpcb.inp_inc, 0, newsize);
} else {
so->so_snd.sb_flags &= ~SB_AUTOSIZE;
}
diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c
--- a/sys/netinet/tcp_stacks/rack.c
+++ b/sys/netinet/tcp_stacks/rack.c
@@ -18900,6 +18900,8 @@
scaleup = V_tcp_autosndbuf_max;
if (sbreserve_locked(so, SO_SND, scaleup, curthread)) {
TCP_PROBE2(send__autoresize, tp, scaleup);
+ tcp_hc_updatepipes(&tp->t_inpcb.inp_inc, 0,
+ scaleup);
} else {
so->so_snd.sb_flags &= ~SB_AUTOSIZE;
}
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
@@ -1525,6 +1525,7 @@
void tcp_hc_get(const struct in_conninfo *, struct tcp_hc_metrics *);
uint32_t tcp_hc_getmtu(const struct in_conninfo *);
void tcp_hc_updatemtu(const struct in_conninfo *, uint32_t);
+void tcp_hc_updatepipes(const struct in_conninfo *, uint32_t, uint32_t);
void tcp_hc_update(const struct in_conninfo *, struct tcp_hc_metrics *);
void cc_after_idle(struct tcpcb *tp);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 16, 3:28 AM (7 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40880065
Default Alt Text
D60733.id189926.diff (2 KB)
Attached To
Mode
D60733: tcp: update the send/recv pipes in hostcache during connection lifetime
Attached
Detach File
Event Timeline
Log In to Comment