Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Mar 2022 11:37:56 GMT
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: bb77a828a477 - stable/12 - pf: remove spurious zeroing from pf_ioctl_addrule
Message-ID:  <202203281137.22SBbuxJ076791@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by mjg:

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

commit bb77a828a4774edd510da4eb39db57eaefade680
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2022-02-25 16:18:13 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-03-28 11:37:31 +0000

    pf: remove spurious zeroing from pf_ioctl_addrule
    
    Newly allocated counters are guaranteed to be 0.
    
    This removes 5 IPIs for each loaded rule.
    
    Reviewed by:    kp
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    
    (cherry picked from commit 15ada7514954150e6c07fd6a31ceb686ece76943)
---
 sys/netpfil/pf/pf_ioctl.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c
index 5636ea93e99d..ac99ac6d80bc 100644
--- a/sys/netpfil/pf/pf_ioctl.c
+++ b/sys/netpfil/pf/pf_ioctl.c
@@ -2103,11 +2103,6 @@ pf_ioctl_addrule(struct pf_krule *rule, uint32_t ticket,
 	}
 
 	rule->rpool.cur = TAILQ_FIRST(&rule->rpool.list);
-	pf_counter_u64_zero(&rule->evaluations);
-	for (int i = 0; i < 2; i++) {
-		pf_counter_u64_zero(&rule->packets[i]);
-		pf_counter_u64_zero(&rule->bytes[i]);
-	}
 	TAILQ_INSERT_TAIL(ruleset->rules[rs_num].inactive.ptr,
 	    rule, entries);
 	ruleset->rules[rs_num].inactive.rcount++;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202203281137.22SBbuxJ076791>