From nobody Mon Dec 06 12:25:46 2021 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 EE90818CA5DA; Mon, 6 Dec 2021 12:25:47 +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 4J72hW1y6Rz3Ghf; Mon, 6 Dec 2021 12:25:47 +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 103153B65; Mon, 6 Dec 2021 12:25:47 +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 1B6CPkpJ048158; Mon, 6 Dec 2021 12:25:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1B6CPkN5048157; Mon, 6 Dec 2021 12:25:46 GMT (envelope-from git) Date: Mon, 6 Dec 2021 12:25:46 GMT Message-Id: <202112061225.1B6CPkN5048157@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: 93a3fa41dcff - main - pfsync: fix defer timeout 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: 93a3fa41dcff274180133712a13392d17a3e75a1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638793547; 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=h4WBaysvG6dXzWNIuu6QymmHB3+FullKB2kbJrgLm1Y=; b=kLpWJhD5vXNMHJYHGtcMpBvagE+neVoyiUyemg6QYNnnaC88XWvzXGaU8Ar/+d6Jtfp1LT XMt4AD4kK2sF6OzpDh1Cn1FflzMaDLqFsM9B+yuLTMFS73nzQBWqxhZ2vMB1ZFhye3N10H gDui6luTcNX5d1ut0qdBbSenwI+t9KWdrGLpbjqMZct6XxCB2olsOOL6SWv5jhkRP+QBSq BS2vFkr/kwdbr1zWeOnof9HpVTcqY3A6xx7ppzxy9ydMh+jib1jQNJU5zY9p7npAvItpdJ BAHlWnXDlRU7kWfLXlUBkUuhojMR+C8yImjPYHQCX4srpdvUtxMmKIRNqXaegA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638793547; a=rsa-sha256; cv=none; b=R1vkSUGOjh+uvzXtsGLOcpdtk18HdmtK78uYcHcK2dGufyCcTGDZuDyAs6uhxaqywV70j1 BRQIhfiyX8dQ3YrbriS0zRS5+CZacq8yQLUaJQ45H7oGxrLl26pTTvlaBSdgK8dJ7y8ZXP GWxkU8PSIA1k4qDV6YE7SG2J1+GM6ti1dlJgZ3wLdbQqiTI1PHkYuQjx1rd//BdOGNJ5QA K2UZzLm3E+A6+o5PINB1gMFEbQidK1BKyxabFy3iGQ8b06WU+e57KxwM3tt8m4S2HSR5sp 8o6+ivMlO28t3rw7IOfe+uaEmvb7vvbOqDu8j5VdwXOQ8xvfPulpGX577W5ScA== 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=93a3fa41dcff274180133712a13392d17a3e75a1 commit 93a3fa41dcff274180133712a13392d17a3e75a1 Author: Kristof Provost AuthorDate: 2021-12-02 16:30:36 +0000 Commit: Kristof Provost CommitDate: 2021-12-06 12:25:14 +0000 pfsync: fix defer timeout Don't use a fixed number of ticks, but take hz into account so we have a consistent timeout, regardless of what hz is set up. Use a 20ms timeout, becaues that's what OpenBSD uses. Reviewed by: glebius MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D33242 --- sys/netpfil/pf/if_pfsync.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index a991c7ce5c7f..244e619bbe46 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -316,6 +316,7 @@ static struct pfsync_bucket *pfsync_get_bucket(struct pfsync_softc *, struct pf_kstate *); #define PFSYNC_MAX_BULKTRIES 12 +#define PFSYNC_DEFER_TIMEOUT ((20 * hz) / 1000) VNET_DEFINE(struct if_clone *, pfsync_cloner); #define V_pfsync_cloner VNET(pfsync_cloner) @@ -1769,7 +1770,7 @@ pfsync_defer(struct pf_kstate *st, struct mbuf *m) TAILQ_INSERT_TAIL(&b->b_deferrals, pd, pd_entry); callout_init_mtx(&pd->pd_tmo, &b->b_mtx, CALLOUT_RETURNUNLOCKED); - callout_reset(&pd->pd_tmo, 10, pfsync_defer_tmo, pd); + callout_reset(&pd->pd_tmo, PFSYNC_DEFER_TIMEOUT, pfsync_defer_tmo, pd); pfsync_push(b);