Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 01 Oct 2017 15:39:15 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-pf@FreeBSD.org
Subject:   [Bug 222126] pf is not clearing expired states
Message-ID:  <bug-222126-17777-i0yFzF0Xv5@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-222126-17777@https.bugs.freebsd.org/bugzilla/>
References:  <bug-222126-17777@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D222126

--- Comment #32 from Kristof Provost <kp@freebsd.org> ---
(In reply to hlh from comment #31)
It's a little odd that you're seeing double pf_purge_expired_states:return
entries.
Any chance you've got two such probes in your dtrace script?

Anyway, let's stick a couple of static probes in and see what's going on:
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 8613a161f0a..f8244a6ef6e 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/md5.h>
 #include <sys/random.h>
 #include <sys/refcount.h>
+#include <sys/sdt.h>
 #include <sys/socket.h>
 #include <sys/sysctl.h>
 #include <sys/taskqueue.h>
@@ -105,6 +106,14 @@ __FBSDID("$FreeBSD$");

 #define        DPFPRINTF(n, x) if (V_pf_status.debug >=3D (n)) printf x

+/* DTrace static probes */
+SDT_PROVIDER_DEFINE(pf);
+
+SDT_PROBE_DEFINE(pf, purge, thread, wakeup);
+SDT_PROBE_DEFINE2(pf, purge, , expired_states,
+               "unsigned int",
+               "int");
+
 /*
  * Global variables
  */
@@ -1434,6 +1443,7 @@ pf_purge_thread(void *unused __unused)
        sx_xlock(&pf_end_lock);
        while (pf_end_threads =3D=3D 0) {
                sx_sleep(pf_purge_thread, &pf_end_lock, 0, "pftm", hz / 10);
+               SDT_PROBE0(pf, purge, thread, wakeup);

                VNET_LIST_RLOCK();
                VNET_FOREACH(vnet_iter) {
@@ -1680,6 +1690,8 @@ pf_purge_expired_states(u_int i, int maxcheck)

        V_pf_status.states =3D uma_zone_get_cur(V_pf_state_z);

+       SDT_PROBE2(pf, purge, , expired_states, i, maxcheck);
+
        /*
         * Go through hash and unlink states that expire now.
         */

You can trace those with:
#!/usr/sbin/dtrace -s

pf:purge:thread:wakeup
{

}

pf:purge::expired_states
{
    printf("i %d maxentry %d %d", arg0, arg1, arg2);
}

Hopefully we'll get a clue as to what's going on with this.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-222126-17777-i0yFzF0Xv5>