From nobody Tue Jan 11 10:16:57 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id BBE7B1940E43; Tue, 11 Jan 2022 10:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JY67G0LC3z4mHZ; Tue, 11 Jan 2022 10:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5207169D5; Tue, 11 Jan 2022 10:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20BAGvKY057881; Tue, 11 Jan 2022 10:16:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20BAGvjG057880; Tue, 11 Jan 2022 10:16:57 GMT (envelope-from git) Date: Tue, 11 Jan 2022 10:16:57 GMT Message-Id: <202201111016.20BAGvjG057880@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 751d4c7b8728 - main - pf: postpone clearing of struct pf_pdesc List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 751d4c7b8728d82cb4dd51b851e4dc5d6b4092c8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641896218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NCEwaew1IRXPkJwTXj+jEgVmy+wrLcm96GrjjIuvZkI=; b=hnUZw6w5AG4kk15cwYkUZ9Fc4tJH+KkcjDS5tq1dj4g6OR8zrbHdCBJIhp3OPkshx9EID5 uqXwTcoOaq0uTAnmMnaWLwRknwvKdDOrMhkoQK2YlHNBZ3y4TfvQZvOE1VxsPQ0fJqmxP0 5kLL8h07caOLQ54qWOWdR8Z61HPG2z6gSXE7RQsrtm6NIyRwSWIefRrj26R7iO0tohsnWT OK+6wDgh9SswN/wTgxGhN8tZjop1kMRyeydYO5bPnmd00kQ3i317Zk43+rVrHpo+blp33K rkcZf/2Zxcy/vIoUZiohaubkZdu7hkKus4LkpMw0khrPlyrr624cd+sNB8DuBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641896218; a=rsa-sha256; cv=none; b=vvfIezLyJoEJPOz+qYhtOYKcN24FlC5lCCRvVyT2uNn9SuVyrsGaCLSQkBDisf2xhlCG1q HXQJiVsX5LxBSOIZ3XZPRnNEvzi4TFcfNVSrfHmh5vJHCp6q9T718aITQ8M0aY4Ypcq/S9 iSPfL+U4BgZ2U2VkPg5XU+HbsQXkXgMJQIYCYhycSsruW00TyM8qdIY4ScOXoi/RwquHmU L7o0bDy0EKEMMePy50QhljYM96WdgYsOkWTTthnP1A7+wQKihbqnrtRAwFiOwIetrvdmVq yreOi37D2LwAqhDtcEbYO8rdAXFUGi9hdSrMh/SkrOGRjGUiOX0+rOm38dIDqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=751d4c7b8728d82cb4dd51b851e4dc5d6b4092c8 commit 751d4c7b8728d82cb4dd51b851e4dc5d6b4092c8 Author: Kristof Provost AuthorDate: 2022-01-10 17:43:35 +0000 Commit: Kristof Provost CommitDate: 2022-01-11 09:10:23 +0000 pf: postpone clearing of struct pf_pdesc Postpone zeroing out pd until after the PFI_IFLAG_SKIP/M_SKIP_FIREWALL checks. We don't need it until then, and it saves us a few CPU cycles in some cases. This isn't expected to make a measurable performance change though. Reviewed by: mjg, glebius Pointed out by: markj Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33815 --- sys/netpfil/pf/pf.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 9390f0050cdc..7e98d5062286 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -6461,8 +6461,6 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * if (!V_pf_status.running) return (PF_PASS); - memset(&pd, 0, sizeof(pd)); - kif = (struct pfi_kkif *)ifp->if_pf_kif; if (kif == NULL) { @@ -6476,6 +6474,7 @@ pf_test(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb * if (m->m_flags & M_SKIP_FIREWALL) return (PF_PASS); + memset(&pd, 0, sizeof(pd)); pd.pf_mtag = pf_find_mtag(m); if (ip_dn_io_ptr != NULL && pd.pf_mtag != NULL && @@ -6962,9 +6961,6 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb if (!V_pf_status.running) return (PF_PASS); - memset(&pd, 0, sizeof(pd)); - pd.pf_mtag = pf_find_mtag(m); - kif = (struct pfi_kkif *)ifp->if_pf_kif; if (kif == NULL) { DPFPRINTF(PF_DEBUG_URGENT, @@ -6977,6 +6973,9 @@ pf_test6(int dir, int pflags, struct ifnet *ifp, struct mbuf **m0, struct inpcb if (m->m_flags & M_SKIP_FIREWALL) return (PF_PASS); + memset(&pd, 0, sizeof(pd)); + pd.pf_mtag = pf_find_mtag(m); + if (ip_dn_io_ptr != NULL && pd.pf_mtag != NULL && pd.pf_mtag->flags & PF_TAG_DUMMYNET) { pd.pf_mtag->flags &= ~PF_TAG_DUMMYNET;