Utilize SYSCTL_UMA_CUR() to export usage of syncache and

tcp reassembly zones.

Sponsored by:	Nginx, Inc.
This commit is contained in:
Gleb Smirnoff 2014-02-07 14:31:51 +00:00
parent 0a5a3ccb81
commit 92f8975ff4
2 changed files with 5 additions and 28 deletions

View File

@ -75,8 +75,6 @@ __FBSDID("$FreeBSD$");
#include <netinet/tcp_debug.h>
#endif /* TCPDEBUG */
static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS);
static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0,
"TCP Segment Reassembly Queue");
@ -86,10 +84,6 @@ SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN,
&VNET_NAME(tcp_reass_maxseg), 0,
"Global maximum number of TCP Segments in Reassembly Queue");
SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments,
(CTLTYPE_INT | CTLFLAG_RD), NULL, 0, &tcp_reass_sysctl_qsize, "I",
"Global number of TCP Segments currently in Reassembly Queue");
static VNET_DEFINE(int, tcp_reass_overflows) = 0;
#define V_tcp_reass_overflows VNET(tcp_reass_overflows)
SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows,
@ -99,6 +93,9 @@ SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, overflows,
static VNET_DEFINE(uma_zone_t, tcp_reass_zone);
#define V_tcp_reass_zone VNET(tcp_reass_zone)
SYSCTL_UMA_CUR(_net_inet_tcp_reass, OID_AUTO, cursegments, CTLFLAG_VNET,
&VNET_NAME(tcp_reass_zone),
"Global number of TCP Segments currently in Reassembly Queue");
/* Initialize TCP reassembly queue */
static void
@ -155,15 +152,6 @@ tcp_reass_flush(struct tcpcb *tp)
tp, tp->t_segqlen));
}
static int
tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS)
{
int qsize;
qsize = uma_zone_get_cur(V_tcp_reass_zone);
return (sysctl_handle_int(oidp, &qsize, 0, req));
}
int
tcp_reass(struct tcpcb *tp, struct tcphdr *th, int *tlenp, struct mbuf *m)
{

View File

@ -126,7 +126,6 @@ struct syncache *syncache_lookup(struct in_conninfo *, struct syncache_head **);
static int syncache_respond(struct syncache *);
static struct socket *syncache_socket(struct syncache *, struct socket *,
struct mbuf *m);
static int syncache_sysctl_count(SYSCTL_HANDLER_ARGS);
static void syncache_timeout(struct syncache *sc, struct syncache_head *sch,
int docallout);
static void syncache_timer(void *);
@ -170,9 +169,8 @@ SYSCTL_VNET_UINT(_net_inet_tcp_syncache, OID_AUTO, cachelimit, CTLFLAG_RDTUN,
&VNET_NAME(tcp_syncache.cache_limit), 0,
"Overall entry limit for syncache");
SYSCTL_VNET_PROC(_net_inet_tcp_syncache, OID_AUTO, count, (CTLTYPE_UINT|CTLFLAG_RD),
NULL, 0, &syncache_sysctl_count, "IU",
"Current number of entries in syncache");
SYSCTL_UMA_CUR(_net_inet_tcp_syncache, OID_AUTO, count, CTLFLAG_VNET,
&VNET_NAME(tcp_syncache.zone), "Current number of entries in syncache");
SYSCTL_VNET_UINT(_net_inet_tcp_syncache, OID_AUTO, hashsize, CTLFLAG_RDTUN,
&VNET_NAME(tcp_syncache.hashsize), 0,
@ -328,15 +326,6 @@ syncache_destroy(void)
}
#endif
static int
syncache_sysctl_count(SYSCTL_HANDLER_ARGS)
{
int count;
count = uma_zone_get_cur(V_tcp_syncache.zone);
return (sysctl_handle_int(oidp, &count, 0, req));
}
/*
* Inserts a syncache entry into the specified bucket row.
* Locks and unlocks the syncache_head autonomously.