git: bb77a828a477 - stable/12 - pf: remove spurious zeroing from pf_ioctl_addrule
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 28 Mar 2022 11:37:56 UTC
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++;