From nobody Mon Dec 13 13:50:37 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 7FEB518D1A1E; Mon, 13 Dec 2021 13:50:38 +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 4JCNF95QYQz3CP7; Mon, 13 Dec 2021 13:50:37 +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 708C7155F7; Mon, 13 Dec 2021 13:50:37 +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 1BDDob3s036971; Mon, 13 Dec 2021 13:50:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BDDob5h036970; Mon, 13 Dec 2021 13:50:37 GMT (envelope-from git) Date: Mon, 13 Dec 2021 13:50:37 GMT Message-Id: <202112131350.1BDDob5h036970@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: ffc4301ba780 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: ffc4301ba780b2184b9a04348ca992ad8002e0ea Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639403438; 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=Z43EOfE0ubSFnpw24hf7rZIO62f/xdR5NbRY3hZAK/g=; b=IyWtRRDF+USfEUj5lYWZfwqWIqknnc3ilwJd9kIJl4ZCDo3ES8qyjdp1xehuEppxotsJma pWzFMfhZ5jYEBL1gLQmizahPM1UjZHl3Q+g/Nz29yDcr3F7MnQO23VdRuRSda7XWnn8LN4 GLCbMvsHFtPQJhjSIl308LMYf0TMxFGRS6j509696utwLjgwy2DSTWhvaxHLrvlv3OnfJG FG3JSFUrWm0OHD4CiztmpwQ5WIWaUw722kpTkCJ8iHZ2095GDPzsXp2Pw9m4YDhmwRAQRY dlnlIVkKHPXISPIv4yZQy3awsGhzt0RMOxL80vXwDiwBl1CadA6uIAjtkIAWhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639403438; a=rsa-sha256; cv=none; b=cRuA4jk7oZv1yYEkKhNFOzI0EZQE+aMLOg+x8beTNETeWzry5h0jpZazRM5L/t1PAWoutz 2L0m4DIgtAwKGfGrOHTGWSTw4MFTiLVD+QD5w0HWMcG92Yv8Xq1CDG8rVxHavIgJngFV4v JLkUXHpW1tKbTlyNuxTikegueHl1kEps8aZ4fA8wLaXz3M/9zG6JZ6I2kpRiyM6er+TkmW i1Fkt/p9pwv76lfLQmEIBr9jWAkG1Pqvo/aCi1seEVKFFUnLWqLUbTbxjl4IruOEu0v9x/ 9zlqdGPTFn1e+0QGhjK2NfW8c/Gibb0inu9kQKkXhRdzoL3pagB+57kOwAiJPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ffc4301ba780b2184b9a04348ca992ad8002e0ea commit ffc4301ba780b2184b9a04348ca992ad8002e0ea Author: Kristof Provost AuthorDate: 2021-12-02 16:30:36 +0000 Commit: Kristof Provost CommitDate: 2021-12-13 08:54:15 +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 301d963abd9c..ce4ad158e557 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 *, #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) @@ -1771,7 +1772,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);