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
This commit is contained in:
Kyle Evans 2024-10-23 22:15:55 -05:00
parent 9f718b57b8
commit 3360a15898
2 changed files with 5 additions and 0 deletions

View File

@ -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 *,

View File

@ -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];
};
/*