From nobody Mon Dec 13 13:50:36 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 2ED9518D18BC; Mon, 13 Dec 2021 13:50:37 +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 4JCNF85H8Yz3CV3; Mon, 13 Dec 2021 13:50:36 +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 8BDCF159BC; Mon, 13 Dec 2021 13:50:36 +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 1BDDoaHb036940; Mon, 13 Dec 2021 13:50:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BDDoaIg036939; Mon, 13 Dec 2021 13:50:36 GMT (envelope-from git) Date: Mon, 13 Dec 2021 13:50:36 GMT Message-Id: <202112131350.1BDDoaIg036939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 912a0f7fabfa - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 912a0f7fabfa02f98ab08bc36508de3d2ceeb6cf Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639403436; 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=lIqOkzwTlgNSeA4elI6sG1tnNkljSXadexD5HbA3ShQ=; b=iz3Bb8JIKnz2q0r/bv9jDwU4gBQcTrJKMWRPOvjZR/fjTfs96ARqB4ddFnKiCGMGVFhWTw stQPBme8hvRwDqUNuh71MDbYbSSbCe9jaL9Flq9ooPLRCClT4pEdd3+Mn52Yb8n5Nq61ZD n8Ea6eAjIXJStjr04Z5CoFqA5nLDb4P6PLdKyTu9+PEtZS2aQyyHd1vpM+8U3FVQLmq7MK MVj0+lZK24+e/emJq2+lwUvqQGusHEVRIQAphbRRL/c9SKkhsa1L9PcSeOqmCKPSIWsJng S21X3QPhiMPGXz+OCFV9Xmywkl5Gy3BZ3RDZ3bVLTSemyxv2edsIVt8IgCWw5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639403436; a=rsa-sha256; cv=none; b=GoqAgykjWsww6NfbzqmDMGM9cj2Wo1oVULDDDvK30tL1I+gFBak8XMkFvXKDJa0OrNiQjc bj3FlIrNRoEHGdkfqWzlasnIs7a9IBDjl2a+766BjeuvnnJKWfh7c9fEAZ51QfLOvALCnu LVPpjKvfwfpHHZZxoBVRl5vv6/bN99e0lOS7rXcu8DNvz/NYyK18qMwIJD5PRLjBV5Zhsi h3f+zI5odRe0I61ZJgLcT0RRI8mLWNVEIBvs2tNgx+1NtGdArTohjcdFwDqL0Ll0oEVUWo K6+2Hyxf+lWYDgXJpVi+lI5rYGgvQl2cBJCPfQrx8oRWx8gcMUKhTN4G3l74qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=912a0f7fabfa02f98ab08bc36508de3d2ceeb6cf commit 912a0f7fabfa02f98ab08bc36508de3d2ceeb6cf Author: Kristof Provost AuthorDate: 2021-12-02 16:30:36 +0000 Commit: Kristof Provost CommitDate: 2021-12-13 13:49:27 +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 (cherry picked from commit 93a3fa41dcff274180133712a13392d17a3e75a1) --- 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 c10f1a64799f..a4f1d43f5ea0 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);