aboutsummaryrefslogtreecommitdiff
path: root/sys/netipsec/esp_var.h
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2024-08-22 14:41:32 +0000
committerKristof Provost <kp@FreeBSD.org>2024-08-28 10:02:45 +0000
commitb1c3a4d75f4ff74218434a11cdd4e56632e13711 (patch)
tree5101e74fb73ce4500264a6f6520f3838227f9de2 /sys/netipsec/esp_var.h
parent84f46335ab5da086c74032579799c0a74aa27447 (diff)
downloadsrc-b1c3a4d75f4ff74218434a11cdd4e56632e13711.tar.gz
src-b1c3a4d75f4ff74218434a11cdd4e56632e13711.zip
netipsec: add probe points for the ipsec/esp/ah/ipcomp counters
Extend what we did for netinet counters in 60d8dbbef075 (netinet: add a probe point for IP, IP6, ICMP, ICMP6, UDP and TCP stats counters, 2024-01-18) to the IPsec code. Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46416
Diffstat (limited to 'sys/netipsec/esp_var.h')
-rw-r--r--sys/netipsec/esp_var.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/netipsec/esp_var.h b/sys/netipsec/esp_var.h
index c1f492913107..3490bf2e3c40 100644
--- a/sys/netipsec/esp_var.h
+++ b/sys/netipsec/esp_var.h
@@ -72,15 +72,25 @@ struct espstat {
#ifdef _KERNEL
#include <sys/counter.h>
+#include <netinet/in_kdtrace.h>
VNET_DECLARE(int, esp_enable);
VNET_DECLARE(int, esp_ctr_compatibility);
#define V_esp_ctr_compatibility VNET(esp_ctr_compatibility)
VNET_PCPUSTAT_DECLARE(struct espstat, espstat);
-#define ESPSTAT_ADD(name, val) \
- VNET_PCPUSTAT_ADD(struct espstat, espstat, name, (val))
+#define ESPSTAT_ADD(name, val) \
+ do { \
+ MIB_SDT_PROBE1(esp, count, name, (val)); \
+ VNET_PCPUSTAT_ADD(struct espstat, espstat, name, (val)); \
+ } while (0)
#define ESPSTAT_INC(name) ESPSTAT_ADD(name, 1)
+#define ESPSTAT_INC2(name, type) \
+ do { \
+ MIB_SDT_PROBE2(esp, count, name, 1, (type)); \
+ VNET_PCPUSTAT_ADD(struct espstat, espstat, name[type], 1); \
+ } while (0)
+
#define V_esp_enable VNET(esp_enable)
#endif /* _KERNEL */
#endif /*_NETIPSEC_ESP_VAR_H_*/