Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156955534
D6931.id17976.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
D6931.id17976.diff
View Options
Index: sys/netinet/tcp_pcap.h
===================================================================
--- sys/netinet/tcp_pcap.h
+++ sys/netinet/tcp_pcap.h
@@ -36,4 +36,6 @@
void tcp_pcap_set_sock_max(struct mbufq *queue, int newval);
int tcp_pcap_get_sock_max(struct mbufq *queue);
+extern int tcp_pcap_aggressive_free;
+
#endif /* _NETINET_TCP_PCAP_H_ */
Index: sys/netinet/tcp_pcap.c
===================================================================
--- sys/netinet/tcp_pcap.c
+++ sys/netinet/tcp_pcap.c
@@ -42,9 +42,13 @@
#define M_LEADINGSPACE_NOWRITE(m) \
((m)->m_data - M_START(m))
+int tcp_pcap_aggressive_free = 1;
static int tcp_pcap_clusters_referenced_cur = 0;
static int tcp_pcap_clusters_referenced_max = 0;
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_pcap_aggressive_free,
+ CTLFLAG_RW, &tcp_pcap_aggressive_free, 0,
+ "Free saved packets when the memory system comes under pressure");
SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcp_pcap_clusters_referenced_cur,
CTLFLAG_RD, &tcp_pcap_clusters_referenced_cur, 0,
"Number of clusters currently referenced on TCP PCAP queues");
Index: sys/netinet/tcp_subr.c
===================================================================
--- sys/netinet/tcp_subr.c
+++ sys/netinet/tcp_subr.c
@@ -1605,6 +1605,13 @@
if ((tcpb = intotcpcb(inpb)) != NULL) {
tcp_reass_flush(tcpb);
tcp_clean_sackreport(tcpb);
+#ifdef TCPPCAP
+ if (tcp_pcap_aggressive_free) {
+ /* Free the TCP PCAP queues. */
+ tcp_pcap_drain(&(tcpb->t_inpkts));
+ tcp_pcap_drain(&(tcpb->t_outpkts));
+ }
+#endif
}
INP_WUNLOCK(inpb);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, May 18, 3:20 PM (14 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33236386
Default Alt Text
D6931.id17976.diff (1 KB)
Attached To
Mode
D6931: Free TCPPCAP mbufs when under memory pressure
Attached
Detach File
Event Timeline
Log In to Comment