git: 15ada7514954 - main - pf: remove spurious zeroing from pf_ioctl_addrule
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 10 Mar 2022 17:21:09 UTC
The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=15ada7514954150e6c07fd6a31ceb686ece76943 commit 15ada7514954150e6c07fd6a31ceb686ece76943 Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2022-02-25 16:18:13 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2022-03-10 17:20:41 +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") --- 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 908e22184172..ef7092c0ed1b 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2184,11 +2184,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++;