Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F81969263
D6198.id15883.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6198.id15883.diff
View Options
Index: sys/netinet/tcp_hostcache.c
===================================================================
--- sys/netinet/tcp_hostcache.c
+++ sys/netinet/tcp_hostcache.c
@@ -124,6 +124,12 @@
static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, hostcache, CTLFLAG_RW, 0,
"TCP Host cache");
+VNET_DEFINE(int, tcp_use_hostcache) = 1;
+#define V_tcp_use_hostcache VNET(tcp_use_hostcache)
+SYSCTL_INT(_net_inet_tcp_hostcache, OID_AUTO, enable, CTLFLAG_VNET | CTLFLAG_RW,
+ &VNET_NAME(tcp_use_hostcache), 0,
+ "Enable the TCP hostcache");
+
SYSCTL_UINT(_net_inet_tcp_hostcache, OID_AUTO, cachelimit, CTLFLAG_VNET | CTLFLAG_RDTUN,
&VNET_NAME(tcp_hostcache.cache_limit), 0,
"Overall entry limit for hostcache");
@@ -272,6 +278,9 @@
static struct hc_metrics *
tcp_hc_lookup(struct in_conninfo *inc)
{
+ if (!V_tcp_use_hostcache)
+ return NULL;
+
int hash;
struct hc_head *hc_head;
struct hc_metrics *hc_entry;
@@ -328,6 +337,9 @@
static struct hc_metrics *
tcp_hc_insert(struct in_conninfo *inc)
{
+ if (!V_tcp_use_hostcache)
+ return NULL;
+
int hash;
struct hc_head *hc_head;
struct hc_metrics *hc_entry;
@@ -419,6 +431,9 @@
void
tcp_hc_get(struct in_conninfo *inc, struct hc_metrics_lite *hc_metrics_lite)
{
+ if (!V_tcp_use_hostcache)
+ return;
+
struct hc_metrics *hc_entry;
/*
@@ -458,6 +473,9 @@
u_long
tcp_hc_getmtu(struct in_conninfo *inc)
{
+ if (!V_tcp_use_hostcache)
+ return 0;
+
struct hc_metrics *hc_entry;
u_long mtu;
@@ -480,6 +498,9 @@
void
tcp_hc_updatemtu(struct in_conninfo *inc, u_long mtu)
{
+ if (!V_tcp_use_hostcache)
+ return;
+
struct hc_metrics *hc_entry;
/*
@@ -519,6 +540,9 @@
void
tcp_hc_update(struct in_conninfo *inc, struct hc_metrics_lite *hcml)
{
+ if (!V_tcp_use_hostcache)
+ return;
+
struct hc_metrics *hc_entry;
hc_entry = tcp_hc_lookup(inc);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 15, 4:30 AM (9 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9091386
Default Alt Text
D6198.id15883.diff (1 KB)
Attached To
Mode
D6198: Add sysctl to disable the TCP hostcache
Attached
Detach File
Event Timeline
Log In to Comment