The branch main has been updated by kp:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=02923dd9b0de050b989b5a4103e402055cb7f61a

commit 02923dd9b0de050b989b5a4103e402055cb7f61a
Author:     Kristof Provost <[email protected]>
AuthorDate: 2025-10-10 10:06:21 +0000
Commit:     Kristof Provost <[email protected]>
CommitDate: 2025-10-11 11:24:25 +0000

    dummynet: SDT probe dropped packets
    
    Add static probe points to track where we increment io_pkt_drop. This is
    intended to assist in debugging dummynet, allowing us to work out when and
    hopefully why packets get dropped.
    
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
---
 sys/netpfil/ipfw/ip_dn_io.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sys/netpfil/ipfw/ip_dn_io.c b/sys/netpfil/ipfw/ip_dn_io.c
index 03116cb0641c..3a8de2b2bfee 100644
--- a/sys/netpfil/ipfw/ip_dn_io.c
+++ b/sys/netpfil/ipfw/ip_dn_io.c
@@ -43,6 +43,7 @@
 #include <sys/priv.h>
 #include <sys/proc.h>
 #include <sys/rwlock.h>
+#include <sys/sdt.h>
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <sys/sysctl.h>
@@ -70,6 +71,9 @@
 #endif
 #include <netpfil/ipfw/dn_sched.h>
 
+SDT_PROVIDER_DEFINE(dummynet);
+SDT_PROBE_DEFINE2(dummynet, , , drop, "struct mbuf *", "struct dn_queue *");
+
 /*
  * We keep a private variable for the simulation time, but we could
  * probably use an existing one ("softticks" in sys/kern/kern_timeout.c)
@@ -545,6 +549,7 @@ dn_enqueue(struct dn_queue *q, struct mbuf* m, int drop)
 
 drop:
        V_dn_cfg.io_pkt_drop++;
+       SDT_PROBE2(dummynet, , , drop, m, q);
        q->ni.drops++;
        ni->drops++;
        FREE_PKT(m);
@@ -1001,6 +1006,7 @@ done:
 
 dropit:
        V_dn_cfg.io_pkt_drop++;
+       SDT_PROBE2(dummynet, , , drop, m, q);
        DN_BH_WUNLOCK();
        if (m)
                FREE_PKT(m);

Reply via email to