From nobody Mon Jan 26 23:12:32 2026 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 4f0PSw2zDVz6Pml5 for ; Mon, 26 Jan 2026 23:12:32 +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 "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f0PSw24PHz3SPs for ; Mon, 26 Jan 2026 23:12:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769469152; 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=UtS/EGVrtH67esMi0qYesI1gcsSWoNdl44VqOx1kbOA=; b=naKlGvO+3CudjPTHd9BYqQb4D8AyIc3DurfL6L7HzzeLNfUBZRn7He67XRlBRKiQjvbv64 6z7oxgKlmWxZu3Pa7j//1z3vKT7ATIGGmUJwrueaSmr+Nha7Fhycx+vzA4UhP1PwYDxcFE u1H/LxukdpDunARwzrWqFpfJaHr/jouUxe5Ay/n5jhgYNKsh3gc2qGfgG1yupAPnda01sO PqVwxVg2G+ptnzr0vQBMlcVGUD3tYCTatPT7A8R4i3A5WUfMAD/XSV2ryb8Cp+dODmE6fo iN2B/WSIANerasXwk+NkpXu08I4Rs5IILb1MNEtMneOImrMZBlv3njzzdS3b1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769469152; 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=UtS/EGVrtH67esMi0qYesI1gcsSWoNdl44VqOx1kbOA=; b=eXLeR5JRCLcYL8OoHUvrcOHZhD0mWusgD+XIDn6HeUnIgYhdzuXqkufjat0Izby5ighVQ1 bEM3lnSv9a9l4ADR4S7qbhfMgMnytcU6sD2ueJ3E+wPxgmFL1dTpT9e0OSiOU0qogDQ9sh U1ZtOVivHkGrdqyxAtReqWYG3fKKcfEnXmBNfHgq1x5P3F3Aium++AlbRbc0bX1KBwKJ38 QTL82X5fiwpMZ3D08JRpcgrQarRp40+tJX2SoEmnU7NFt+iafuFISL48zziTjGtWSba/o8 BuTxP6JfTlqHD1WkHouP7y4AexaaC6ko3fkdlXMzi4yJ1W+gEqLNMRfFWxA60A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769469152; a=rsa-sha256; cv=none; b=l5AWEQEBoaDjUcligVBXMAYWFzr4aKdI5My377rgw2ZrxHqmYGMljumSr4147mZxBDQLkx hwAnIsE6qSve9q27OzNWZmMZWc1uUYGVAqJcuXp9aXcVN1HDtxohtsjA7xz6SyBC+xeeYS R+bUJx3JIZYQTIbszPjdbxMcifS0J/OlYje1sZDVRsIilxnMJ0/BQ2DdW/PCmLquWweKmj iEkOEjsKM9YrmYOIM2ejXGiE5pmX+6hvIWW9r9sNXC2aWjqKcBFZBI0y00dmYOUCR1FagR rIsWcLLSwkiOU7WYA04AolK+fCNbTpfkWrZMcBNHMlKXdJBbLPpIdoirxbHOwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f0PSw1ZHczhyv for ; Mon, 26 Jan 2026 23:12:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3cf88 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 26 Jan 2026 23:12:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: d1a8f1a62f31 - main - ipfw: don't use the upper half lock to walk dynamic states buckets 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: glebius X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1a8f1a62f31779e1902b856b44249b198178fc9 Auto-Submitted: auto-generated Date: Mon, 26 Jan 2026 23:12:32 +0000 Message-Id: <6977f4e0.3cf88.6277afb5@gitrepo.freebsd.org> The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d1a8f1a62f31779e1902b856b44249b198178fc9 commit d1a8f1a62f31779e1902b856b44249b198178fc9 Author: Gleb Smirnoff AuthorDate: 2026-01-26 23:05:17 +0000 Commit: Gleb Smirnoff CommitDate: 2026-01-26 23:05:17 +0000 ipfw: don't use the upper half lock to walk dynamic states buckets The lock is sleepable and we can't grab it in dyn_tick(). Use the individual bucket locks instead. Fixes: e3caa360d5d0a73af0de1d293d5b8ff6e900ceb4 --- sys/netpfil/ipfw/ip_fw_dynamic.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/sys/netpfil/ipfw/ip_fw_dynamic.c b/sys/netpfil/ipfw/ip_fw_dynamic.c index 99fd72de5e0a..d2bf4f4fc899 100644 --- a/sys/netpfil/ipfw/ip_fw_dynamic.c +++ b/sys/netpfil/ipfw/ip_fw_dynamic.c @@ -2498,13 +2498,8 @@ dyn_send_keepalive_ipv4(struct ip_fw_chain *chain) uint32_t bucket; mbufq_init(&q, INT_MAX); - IPFW_UH_RLOCK(chain); - /* - * It is safe to not use hazard pointer and just do lockless - * access to the lists, because states entries can not be deleted - * while we hold IPFW_UH_RLOCK. - */ for (bucket = 0; bucket < V_curr_dyn_buckets; bucket++) { + DYN_BUCKET_LOCK(bucket); CK_SLIST_FOREACH(s, &V_dyn_ipv4[bucket], entry) { /* * Only established TCP connections that will @@ -2517,8 +2512,8 @@ dyn_send_keepalive_ipv4(struct ip_fw_chain *chain) continue; dyn_enqueue_keepalive_ipv4(&q, s); } + DYN_BUCKET_UNLOCK(bucket); } - IPFW_UH_RUNLOCK(chain); while ((m = mbufq_dequeue(&q)) != NULL) ip_output(m, NULL, NULL, 0, NULL, NULL); } @@ -2605,13 +2600,8 @@ dyn_send_keepalive_ipv6(struct ip_fw_chain *chain) uint32_t bucket; mbufq_init(&q, INT_MAX); - IPFW_UH_RLOCK(chain); - /* - * It is safe to not use hazard pointer and just do lockless - * access to the lists, because states entries can not be deleted - * while we hold IPFW_UH_RLOCK. - */ for (bucket = 0; bucket < V_curr_dyn_buckets; bucket++) { + DYN_BUCKET_LOCK(bucket); CK_SLIST_FOREACH(s, &V_dyn_ipv6[bucket], entry) { /* * Only established TCP connections that will @@ -2624,8 +2614,8 @@ dyn_send_keepalive_ipv6(struct ip_fw_chain *chain) continue; dyn_enqueue_keepalive_ipv6(&q, s); } + DYN_BUCKET_UNLOCK(bucket); } - IPFW_UH_RUNLOCK(chain); while ((m = mbufq_dequeue(&q)) != NULL) ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); }