From owner-dev-commits-src-main@freebsd.org Mon Jun 28 15:49:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53947657ED3; Mon, 28 Jun 2021 15:49:27 +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 4GDBqq1rfBz3Q2V; Mon, 28 Jun 2021 15:49:27 +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 2711D27EC6; Mon, 28 Jun 2021 15:49:27 +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 15SFnR4o016106; Mon, 28 Jun 2021 15:49:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 15SFnRVX016105; Mon, 28 Jun 2021 15:49:27 GMT (envelope-from git) Date: Mon, 28 Jun 2021 15:49:27 GMT Message-Id: <202106281549.15SFnRVX016105@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: e6dd0e2e8d4f - main - pf: assert that sizeof(struct pf_state) <= 312 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6dd0e2e8d4f59275fb576a9ccb9d356d36457bb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jun 2021 15:49:27 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e6dd0e2e8d4f59275fb576a9ccb9d356d36457bb commit e6dd0e2e8d4f59275fb576a9ccb9d356d36457bb Author: Mateusz Guzik AuthorDate: 2021-06-28 12:49:40 +0000 Commit: Mateusz Guzik CommitDate: 2021-06-28 15:49:20 +0000 pf: assert that sizeof(struct pf_state) <= 312 To prevent accidentally going over a threshold which makes UMA fit only 12 objects per page instead of 13. Reviewed by: kp Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 9578ec0a701f..9f0bf002b631 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -551,6 +551,11 @@ struct pf_state { u_int8_t sync_updates; u_int8_t _tail[3]; }; + +/* + * Size <= fits 13 objects per page on LP64. Try to not grow the struct beyond that. + */ +_Static_assert(sizeof(struct pf_state) <= 312, "pf_state size crosses 312 bytes"); #endif /*