udpstat
struct udpstat udpstat_percpu[MAXCPU] __cachealign;
bzero(&udpstat_percpu[cpu], sizeof(struct udpstat));
sizeof(struct udpstat))))
sizeof(struct udpstat))))
CTASSERT((sizeof(struct udpstat) & __VM_CACHELINE_MASK) == 0);
extern struct udpstat udpstat_percpu[MAXCPU];
CPU_STATS_FUNC(udp, struct udpstat);
struct udpstat udpstat, *stattmp;
struct udpstat zerostat[SMP_MAXCPU];
size_t len = sizeof(struct udpstat) * SMP_MAXCPU;
cpucnt = len / sizeof(struct udpstat);
udp_stats_agg(stattmp, &udpstat, cpucnt);
#define p(f, m) if (udpstat.f || sflag <= 1) \
printf(m, udpstat.f, plural(udpstat.f))
#define p1a(f, m) if (udpstat.f || sflag <= 1) \
printf(m, udpstat.f)
delivered = udpstat.udps_ipackets -
udpstat.udps_hdrops -
udpstat.udps_badlen -
udpstat.udps_badsum -
udpstat.udps_noport -
udpstat.udps_noportbcast -
udpstat.udps_fullsock;
CPU_STATS_FUNC(udp, struct udpstat);
fetch_udpstat(struct udpstat *st)
struct udpstat stattmp[SMP_MAXCPU];
len = sizeof(struct udpstat) * SMP_MAXCPU;
cpucnt = len / sizeof(struct udpstat);
struct udpstat u;