aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2024-10-24 03:15:55 +0000
committerKyle Evans <kevans@FreeBSD.org>2024-10-24 03:15:55 +0000
commit3360a15898ce6cd06aad5afd9b48c8a5454cf952 (patch)
tree04586466dc24cbb6e03de070d181f0a8d42b9fb6
parent9f718b57b846b8e1fa562584747fdae42ffed8f4 (diff)
downloadsrc-3360a15898ce.tar.gz
src-3360a15898ce.zip
net: route: convert routing statistics to a sysctl
Exporting the relevant pcpustat is trivial, so let's do that. We will use it in a near-future change in netstat to avoid having to dig around in mem(4) for live kernel statistics. Differential Revision: https://reviews.freebsd.org/D47231
-rw-r--r--sys/net/route.c4
-rw-r--r--sys/net/route.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index 650da826d89d..7a50bcc43e06 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -75,6 +75,10 @@ VNET_PCPUSTAT_SYSINIT(rtstat);
VNET_PCPUSTAT_SYSUNINIT(rtstat);
#endif
+SYSCTL_DECL(_net_route);
+SYSCTL_VNET_PCPUSTAT(_net_route, OID_AUTO, stats, struct rtstat,
+ rtstat, "route statistics");
+
EVENTHANDLER_LIST_DEFINE(rt_addrmsg);
static int rt_ifdelroute(const struct rtentry *rt, const struct nhop_object *,
diff --git a/sys/net/route.h b/sys/net/route.h
index 6d28f21e9181..603e4fac5354 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -239,6 +239,7 @@ struct rtstat {
uint64_t rts_add_retry; /* # of route addition retries */
uint64_t rts_del_failure; /* # of route deletion failure */
uint64_t rts_del_retry; /* # of route deletion retries */
+ uint64_t rts_spare[5];
};
/*