summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/conf/GENERIC2
-rw-r--r--sys/net/if_wg.c15
2 files changed, 15 insertions, 2 deletions
diff --git a/sys/conf/GENERIC b/sys/conf/GENERIC
index 34d608cff44..f0eff16d2b8 100644
--- a/sys/conf/GENERIC
+++ b/sys/conf/GENERIC
@@ -109,7 +109,7 @@ pseudo-device vether # Virtual ethernet
pseudo-device vxlan # Virtual extensible LAN
pseudo-device vlan # IEEE 802.1Q VLAN
pseudo-device switch # Switch
-#pseudo-device wg # WireGuard
+pseudo-device wg # WireGuard
pseudo-device bio 1 # ioctl multiplexing device
diff --git a/sys/net/if_wg.c b/sys/net/if_wg.c
index e27a575cc1b..9e23dfb60ee 100644
--- a/sys/net/if_wg.c
+++ b/sys/net/if_wg.c
@@ -1681,13 +1681,26 @@ error:
task_add(net_tq(sc->sc_if.if_index), &peer->p_deliver_in);
}
+#define BUCKETS 512
+static unsigned int buckets[BUCKETS];
+unsigned int times;
+
void
wg_encap_worker(void *_sc)
{
struct mbuf *m;
struct wg_softc *sc = _sc;
- while ((m = wg_ring_dequeue(&sc->sc_encap_ring)) != NULL)
+ unsigned int i = 0;
+ while ((m = wg_ring_dequeue(&sc->sc_encap_ring)) != NULL) {
wg_encap(sc, m);
+ ++i;
+ }
+ if (i < BUCKETS)
+ ++buckets[i];
+ if (times++ == 4096 * 8) {
+ for (i = 0; i < BUCKETS; ++i)
+ DPRINTF(sc, "%u: %u\n", i, buckets[i]);
+ }
}
void