From nobody Mon Apr 13 00:21:02 2026 X-Original-To: dev-commits-src-main@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 4fv7P00Z3jz6ZBdy for ; Mon, 13 Apr 2026 00:21:08 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fv7Nz4KK7z3WHt for ; Mon, 13 Apr 2026 00:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776039667; 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=/P5I7TzvFReC+2Vh+bZeasb8h4DFBaUv7FnPz7bYLQ0=; b=VImVjg3aGHhwUZtgWDPWLvr5+bIXdud0mA5F9lRDNDlCp5ivdeUxHLCkDxbk7RDJEkzlGE 2xKuNgzwGdEaqiobNac6aIUrOk5CvNO/3xOI9Bw29e5Y3TwPL//f46heKlATk+emKc8tDd ikZjwzCZPvFa0voHfR+xR/l6Kzo4SljfTGiAyu1SmL9NNqgE+t5WaGmvcYTcyd4ce+ylKs I3TfsogfK3UVb/Z724vsPD+Yov0Rxy50kVcU0iyJUWV38G6Np7oDQQbIkN5BiAbOpXuQiZ E6k223om9Gtu6IWhebCKIRsFAyC0nAOdwJ2WvywVORcpODh5qcGxJQTWqit2/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776039667; a=rsa-sha256; cv=none; b=Fu/fVJbgiYxh1Mwq+/dc0tO31fxA+Ph1SSgPWCxwaf4kMCvtB+cuOKxxjhsi43is4MX014 lgqpMIZ1Ga75vNsQ8g96rFEg2IPOYQR1zsCIZDKc0Zoqoyx7r6X8yAEz7XNMUIkrPjpA9t a9t3QypGg/EiAO0bMWpKUJnuTuzuvIvhc+NnVNGL/FtP2kahBccmLWvrAzFDVsJM8jd9mC c62jECIfIjyH5LFutQ1ebW62G/iZaQ9FxbULoG8gwoAHtytj1DKZPfCeFeCGAhB/oq41w0 HIbV2FTrE8ZaTuKCfsl8VwHMybKYb2cJcH31+srh545YTVzixliDvmKHpXSbfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776039667; 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=/P5I7TzvFReC+2Vh+bZeasb8h4DFBaUv7FnPz7bYLQ0=; b=S/DBcNAQroSowJ3HRFzVPpinZufd+Frh+A5taawdvAPL5HRJdxifIw2Z+g/Qufx7i3XY+J k4bmnhlFhbMyVBM0o5bLUMTzxWl+MGvxBljdV4viCFNtx0Cpk7kbjDIFSbhpJ4X+TjduvW lUIOrdtho39KiOLsabkwzcjSk5xjQ0i8VM7W8VJ5hhZzu3BPX42w+Ek/n5K/1cWb7Ur35J JxLJeuUyHR9tWFQrhtpNqd9FrE233uTVa9csYN6e3tt+UARZp2QypbG23ULt/ZsmV2vWYb q9kD08AIUvz0zCAJpU4GouMbYhxkdUA4DgNUyVF6vaD/K8bdygLCRPMOJhS9aQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fv7Nz2y88zgxy for ; Mon, 13 Apr 2026 00:21:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3653b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 00:21:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 8085c5a5c1e5 - main - nvme_ctrlr_linux_passthru_cmd: correct size of upages_small array List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8085c5a5c1e50eb478fb7b59fae201d9ab4207f0 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 00:21:02 +0000 Message-Id: <69dc36ee.3653b.3a0fbfd6@gitrepo.freebsd.org> The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=8085c5a5c1e50eb478fb7b59fae201d9ab4207f0 commit 8085c5a5c1e50eb478fb7b59fae201d9ab4207f0 Author: Ryan Libby AuthorDate: 2026-04-12 23:39:41 +0000 Commit: Ryan Libby CommitDate: 2026-04-12 23:39:41 +0000 nvme_ctrlr_linux_passthru_cmd: correct size of upages_small array The size broke when upages was converted from array to double pointer. Reported by: gcc -Wsizeof-pointer-div Reviewed by: imp Fixes: 82ff1c334b97 ("nvme: Allow larger user request sizes") Differential Revision: https://reviews.freebsd.org/D56368 --- sys/dev/nvme/nvme_ctrlr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index e5094e909a24..447a824df8be 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -1518,8 +1518,8 @@ nvme_ctrlr_linux_passthru_cmd(struct nvme_controller *ctrlr, } if (is_user) { ret = nvme_user_ioctl_req(npc->addr, npc->data_len, - npc->opcode & 0x1, &upages, nitems(upages), &npages, - &req, nvme_npc_done, npc); + npc->opcode & 0x1, &upages, nitems(upages_small), + &npages, &req, nvme_npc_done, npc); if (ret != 0) return (ret); } else From nobody Mon Apr 13 04:39:46 2026 X-Original-To: dev-commits-src-main@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 4fvF7Q65QKz6YFmH for ; Mon, 13 Apr 2026 04:39:46 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvF7Q43QXz43H8 for ; Mon, 13 Apr 2026 04:39:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776055186; 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=ipHD4o1kVaIYViQbVt8h2rJW/sZrCrgHdlyL2E6lMZY=; b=La/1bFa5SL2NzSUNDfX/a6JMVwpqW5sm31ryHFtfsHPF0NnDWWVyy77hX9J0/cyWhITpCp fLXEwMWPcNrzXwBKfQk4xy5XUpIDsmdFeVzISAAasxjr4z2KdGj8ulxmMEgWKeda+74rca 5C4Ll8dUk2JhXpU69jDCSqpjpWn2J0iwgnNX2Zc2sX5nS46VfLL/K10aAXnvHPVAH1iZCG GiJ5VMtSMTe9M6qVIKytF1ptDyDrJUAfJJmK3B84hhgYhcL6jANb1r4EyM/q4T8S+U6r/H 34tm6yN+RSZ5SoKqh3nxapKw8D7cJPD04vNZH5vn+ZgHmX4YKB4OBKXg4K74YQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776055186; a=rsa-sha256; cv=none; b=qKdKTd+M9cA480kxdY0EpFNvvxqErbo81sRPnpGKoxuURU/SckBqfCx1hkyj1Via1tzqQa MN+eoLvMHHZwUmip9t59H6mhRowvFC2Gywoae+R2xz4pA2SSP0Ibw4BO4E7rl0U3zeOxhY Xdkrkkz1VTxzfRortt4MlwBBD235YECfNyVyEqgLKoaevUG1QftEpqKl22S/121iMm9IgY 6Ky6v77sry/EXwaKy8XmZ4FpknhKqjb2eo8EHGH9S9DuEBjE2vKNoHegQ/0l8oKDMqqEMg rF9ZHSVBTYgwjs9AfL5HpnAj6QQDC/qMBi2qk4HGIj9uMmp+RGnCArMPyiJ9sg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776055186; 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=ipHD4o1kVaIYViQbVt8h2rJW/sZrCrgHdlyL2E6lMZY=; b=TdTQEL2/2qHkwvOrlwFEmLlfbaU6cXVxjfSKbOwQerwgL0Ss36Gg3FjTdh1JCiluO1AMs8 NLSr0xi8KvBi0VHvddQr867ERfV9Pk8qkZ3b/if37FJ6Z/Lb55oFAaF/JVOqw2OEywuPTV zOf8egquvg2bOPyD9JF/w5V0FQ5qugOi2KQFNsq06WKC/3rhrf+jppn6nrmMd9xkQqc+Dn bw77OO3Z67bEb7jFWVu2uz5gY6lGewOTNbR3SxvjmsnUUhQ67ca9vO8NpxAxGlnadyJMCQ gcsoLCTOwAdL/WlKi+Xdh7gSqCiUEZL4EbLhY7XUBSKKNY2p434xoYFKQHcNpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvF7Q3XqBzpKn for ; Mon, 13 Apr 2026 04:39:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 20358 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 04:39:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: f1fae67afbb1 - main - ifnet: vnet_if_return(): Avoid unnecessary recursive acquisition of ifnet_detach_sxlock List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1fae67afbb13a41d488d0e0ec66b1805925019c Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 04:39:46 +0000 Message-Id: <69dc7392.20358.24e77fa1@gitrepo.freebsd.org> The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=f1fae67afbb13a41d488d0e0ec66b1805925019c commit f1fae67afbb13a41d488d0e0ec66b1805925019c Author: Zhenlei Huang AuthorDate: 2026-04-13 04:38:43 +0000 Commit: Zhenlei Huang CommitDate: 2026-04-13 04:38:43 +0000 ifnet: vnet_if_return(): Avoid unnecessary recursive acquisition of ifnet_detach_sxlock vnet_if_return() will be invocked by vnet_sysuninit() on vnet destructing, while the lock ifnet_detach_sxlock has been acquired in vnet_destroy() already. With this change the order of locking is more clear. There should be no functional change. Reviewed by: pouria Fixes: 868bf82153e8 if: avoid interface destroy race MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56288 --- sys/net/if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 519b23750b52..73138716cf46 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -479,6 +479,8 @@ vnet_if_return(const void *unused __unused) i = 0; + /* The lock has already been aquired in vnet_destroy() */ + sx_assert(&ifnet_detach_sxlock, SX_XLOCKED); /* * We need to protect our access to the V_ifnet tailq. Ordinarily we'd * enter NET_EPOCH, but that's not possible, because if_vmove() calls @@ -507,9 +509,7 @@ vnet_if_return(const void *unused __unused) IFNET_WUNLOCK(); for (int j = 0; j < i; j++) { - sx_xlock(&ifnet_detach_sxlock); if_vmove(pending[j], pending[j]->if_home_vnet); - sx_xunlock(&ifnet_detach_sxlock); } free(pending, M_IFNET); From nobody Mon Apr 13 04:39:47 2026 X-Original-To: dev-commits-src-main@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 4fvF7S10gQz6YGHC for ; Mon, 13 Apr 2026 04:39:48 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvF7R5n4Qz43Dq for ; Mon, 13 Apr 2026 04:39:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776055187; 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=irZa2tS7gFPtViwYTc00zG66V4W+yFfmULZskqL9y5s=; b=RykKHFKuzRcBarBhWliJl2XXpBM/KU8Z5FQYM4slOd4ySASzDmWGqNC+AnKLcwBSLiCQKL 3EV1HNEGYqNxQiRB3BJGg2JDf8JpIxL/LlKUFDr7wV7k9UFlf7Ayl+guYpLUH4LHMOlFKV 3qX6/NCFytiPfLdL+Ow12o9Ox244XkeqHzyHlS9E1l7cB53GMgThIDYrbBdASUaNEAsW8k 0IMWxUZ4V+mO3c+X4p3eo6cxXTCGmrPzlLDIHwnj0iimuaw3oweRiJiNCCOG1CL2mSy6T1 7KfPaGTJ07bswUI4OklT36woFjx0086jU5Xw343tq2pNW6xrxUz2gYphGuZcrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776055187; a=rsa-sha256; cv=none; b=JtxdnsVGcCloM3tHHOOXqVUeLdOiViPIawRsb5UawpDqOVS8Vq2gRkMtmJwhuoNiEfC83W Yx9rBs4EUYsDRTgL1tTVOrpTRjf9oQaUQmn3GcYTJvediVUTch6EW4mZrrmH5zrIe5m17u +EH9kEXeWcEEJTmvgfSpC2XJrrX/CKYLVdSrxVqyaBKwj5j2kNWILRlQ70Y9l5s+VkuwKH vORBmvXrvkCRp8BDc7iue+LqRVr0gHW+LtfI4k6ynK76l2gMswHHTOt3SXp+LIUyeiXF80 ZUbkiu7mYQ8qH/JU5CrLDED+UEU40pKengQl1Yz3E0QvW/QxyDEm38dPqbMI3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776055187; 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=irZa2tS7gFPtViwYTc00zG66V4W+yFfmULZskqL9y5s=; b=JV9Fa4BVYJ08EJszlepQuls+AbVLYEKy4eiZCd5n6VzAA1oeGxwOoXxB661QV8G5Ap2ur+ moSQvMubCic3jY8xtex2csO3NajDD7sDkGbWXVK0pO4oR0uEoohugdkXLsoAxdPJqj6NTh CMcbOtMPJJqBfbqjYAlh1mPIwqGdKL3BJ8oigGw1jhmL7NvHjFRbUWVAuY0q+sOAT8EXfD YIYH2tQ9i8KkQOK/V0azqd3SNck4bpzBUgDGV/aNaxMSL9UtqutJNB6hSXp47E+bO0s3RD fIb+xBovw6qItRqcC15Fk/k/xnk7YnGiNaPgNBoQwSqO+5TCGVWqUqWZzrqW2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvF7R4wlNzpc9 for ; Mon, 13 Apr 2026 04:39:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 21c2b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 04:39:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 38bd7ef62f31 - main - ifnet: Move SIOCSIFVNET from ifhwioctl() to ifioctl() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 38bd7ef62f318f791e232e217855307a9d75efa0 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 04:39:47 +0000 Message-Id: <69dc7393.21c2b.5635f87@gitrepo.freebsd.org> The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=38bd7ef62f318f791e232e217855307a9d75efa0 commit 38bd7ef62f318f791e232e217855307a9d75efa0 Author: Zhenlei Huang AuthorDate: 2026-04-13 04:38:44 +0000 Commit: Zhenlei Huang CommitDate: 2026-04-13 04:38:44 +0000 ifnet: Move SIOCSIFVNET from ifhwioctl() to ifioctl() SIOCSIFVNET is not a hardware ioctl. Move it to where it belongs. Where here, rewrite the logic of checking whether we are moving the interface from and to the same vnet or not, since it is obviously not stable to access the interface's vnet, given the current thread may race with other threads those running if_vmove(). MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D55880 --- sys/net/if.c | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 73138716cf46..1d73c55aa69f 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1191,26 +1191,39 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) * Move an ifnet to or from another child prison/vnet, specified by the jail id. */ static int -if_vmove_loan(struct thread *td, struct ifnet *ifp, char *ifname, int jid) +if_vmove_loan(struct thread *td, char *ifname, int jid) { struct prison *pr; - struct ifnet *difp; + struct ifnet *ifp, *difp; bool found; + MPASS(curthread == td); + MPASS(curvnet == TD_TO_VNET(td)); + + /* + * We check the existence of the interface, and will later try to + * unlink it from the "active" list, so it is sufficient to only + * hold a weak reference to it. + * Be aware that it is unsafe to access any member of it, until it + * is proven to be safe to ( say it was on the "active" list ). + */ + ifp = ifunit(ifname); + if (ifp == NULL) + return (ENXIO); + /* Try to find the prison within our visibility. */ sx_slock(&allprison_lock); pr = prison_find_child(td->td_ucred->cr_prison, jid); sx_sunlock(&allprison_lock); if (pr == NULL) return (ENXIO); - prison_hold_locked(pr); - mtx_unlock(&pr->pr_mtx); - - /* Do not try to move the iface from and to the same prison. */ - if (pr->pr_vnet == ifp->if_vnet) { - prison_free(pr); + /* Do not try to move the iface from and to the same vnet. */ + if (pr->pr_vnet == TD_TO_VNET(td)) { + mtx_unlock(&pr->pr_mtx); return (EEXIST); } + prison_hold_locked(pr); + mtx_unlock(&pr->pr_mtx); /* Make sure the named iface does not exists in the dst. prison/vnet. */ /* XXX Lock interfaces to avoid races. */ @@ -2580,15 +2593,6 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td) error = if_rename(ifp, new_name); break; -#ifdef VIMAGE - case SIOCSIFVNET: - error = priv_check(td, PRIV_NET_SETIFVNET); - if (error) - return (error); - error = if_vmove_loan(td, ifp, ifr->ifr_name, ifr->ifr_jid); - break; -#endif - case SIOCSIFMETRIC: error = priv_check(td, PRIV_NET_SETIFMETRIC); if (error) @@ -2876,6 +2880,12 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) ifr = (struct ifreq *)data; switch (cmd) { #ifdef VIMAGE + case SIOCSIFVNET: + error = priv_check(td, PRIV_NET_SETIFVNET); + if (error == 0) + error = if_vmove_loan(td, ifr->ifr_name, ifr->ifr_jid); + goto out_noref; + case SIOCSIFRVNET: error = priv_check(td, PRIV_NET_SETIFVNET); if (error == 0) From nobody Mon Apr 13 04:39:48 2026 X-Original-To: dev-commits-src-main@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 4fvF7T1FVfz6YFmQ for ; Mon, 13 Apr 2026 04:39:49 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvF7S6GWDz43QN for ; Mon, 13 Apr 2026 04:39:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776055188; 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=xi6JL43Mh7J/OTgcNhAr8NFHNwJ2Kamy203YKwkbAIc=; b=k3TdYhXHgFDYFiCvco/yqDTNXVrXdsvvKMQOSCr3xgH2y6ScNimwrZRjA11u702zcRJvA7 vDIPjYz2/guMVVi4HtCTzILi6nAhQ6YONCpoh4yWzc6YFcidUQeF23q8UBhuUw60kdl3P2 zCRIEwWun81PrVpzEjSWd1QYa6hJNoAgmf3Xr2W6BTwlkY/5Bldp/2xmm3dB+2nKeB+k4R jk7GeCSHPO+jmyIHkKsVSdwzZBXUbPt8/DhctRGhXSc30gh4t1hR+c8dR52JluxbygoSX+ 3knlY+0GqULiNU03kuS/xKU+cbDiLuMq+If3O9/kdQc95oZSdhIkFZAqmVM/4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776055188; a=rsa-sha256; cv=none; b=b24gCCV2VfWtKnjK2B+0UDW7DjP/en1lAWnkm0o7/X/57pSmovL4xVHTFKXUs0Z1cSJxAd KC0pza8mD7X6IeuFFWaf5c3GbRH/HvP3rkhZm7xJ4s0TqCIPmZ9cThyASFlMkfPDV79b8m b7Y59/Dx3K6dldXpi33JbFuhb7PpxfNuyuznp9tpMbIaSlDjcOwKw6+/iWyKzA1kn4kBLK wA2Zy/sqJGKoEulD0FU+6tO5h6mWXKII9KmHOT2Ag23gqf8t9cfrMe4UnQXqhzyn0SVXFN nPWTdaaHaewp7U1oP6jDg3uuwm+Y2+PDa2cBBR5CBlreIcNL9SmrIKeHua+1xA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776055188; 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=xi6JL43Mh7J/OTgcNhAr8NFHNwJ2Kamy203YKwkbAIc=; b=cd/P8LJoX25Tu4dMx0Stja0xcxTjb+8d6rHBAC6Y2WBcm/vX4iljexHkIhTgjsa27HPBHb FRhXcQ/9JB3/9w7tqndzAryRQ2NR8jARyzea/tkxkOZwSeup/B1o9iEqFBm3JXv0SraUCE A+44iUMg4xMpXw75FROkUCD+xYokIgn6OZaQ4FFgHiqOjF96p6/7jR3xcFiA1VOYur0CVh jLTn1TbAuAD5jMmEtdqDLkV5tWe72e15Dqz0RsSHg/y43JUXa/cslE56DuZqzPanrStNdV kfowxTKnYI9+HjTbRt94yA4xhrxIVBqAhFPwmQaLKrWMx0fEsMbe2dzdfXLz7w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvF7S5HWwzpNV for ; Mon, 13 Apr 2026 04:39:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 203c3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 04:39:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: e9fc0c538264 - main - if_clone: Make ifnet_detach_sxlock opaque to consumers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e9fc0c538264355bd3fd9120c650078281c2a290 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 04:39:48 +0000 Message-Id: <69dc7394.203c3.3a41c692@gitrepo.freebsd.org> The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e9fc0c538264355bd3fd9120c650078281c2a290 commit e9fc0c538264355bd3fd9120c650078281c2a290 Author: Zhenlei Huang AuthorDate: 2026-04-13 04:38:44 +0000 Commit: Zhenlei Huang CommitDate: 2026-04-13 04:38:44 +0000 if_clone: Make ifnet_detach_sxlock opaque to consumers The change e133271fc1b5e introduced ifnet_detach_sxlock, and change 6d2a10d96fb5 widened its coverage, but there are still consumers, net80211 and tuntap e.g., want it. Instead of sprinkling it everywhere, make it opaque to consumers. Out of tree drivers shall also benefit from this change. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D56298 --- sys/net/if.c | 5 +---- sys/net/if_clone.c | 17 ++++++++++++++++- sys/netlink/route/iface.c | 3 --- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 1d73c55aa69f..760ae94e842b 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2904,11 +2904,8 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct thread *td) case SIOCIFDESTROY: error = priv_check(td, PRIV_NET_IFDESTROY); - if (error == 0) { - sx_xlock(&ifnet_detach_sxlock); + if (error == 0) error = if_clone_destroy(ifr->ifr_name); - sx_xunlock(&ifnet_detach_sxlock); - } goto out_noref; case SIOCIFGCLONERS: diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index 4bc04130da1e..db3db78c1b76 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -441,6 +441,14 @@ if_clone_destroyif_flags(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags { int err; + /* + * XXXZL: To avoid racing with if_vmove() so that we will have + * stable if_vnet. + * This have a good effect, that is, the destroying of tightly + * coupled cloned interfaces such as epair(4) is serialized, + * although the driver is responsible to take care of that. + */ + sx_assert(&ifnet_detach_sxlock, SA_XLOCKED); /* * Given that the cloned ifnet might be attached to a different * vnet from where its cloner was registered, we have to @@ -467,7 +475,12 @@ if_clone_destroyif_flags(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags int if_clone_destroyif(struct if_clone *ifc, struct ifnet *ifp) { - return (if_clone_destroyif_flags(ifc, ifp, 0)); + int err; + + sx_xlock(&ifnet_detach_sxlock); + err = if_clone_destroyif_flags(ifc, ifp, 0); + sx_xunlock(&ifnet_detach_sxlock); + return (err); } static struct if_clone * @@ -670,9 +683,11 @@ if_clone_detach(struct if_clone *ifc) V_if_cloners_count--; IF_CLONERS_UNLOCK(); + sx_xlock(&ifnet_detach_sxlock); /* destroy all interfaces for this cloner */ while (!LIST_EMPTY(&ifc->ifc_iflist)) if_clone_destroyif_flags(ifc, LIST_FIRST(&ifc->ifc_iflist), IFC_F_FORCE); + sx_xunlock(&ifnet_detach_sxlock); IF_CLONE_REMREF(ifc); } diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c index 3e30d74a3793..d449e4114f24 100644 --- a/sys/netlink/route/iface.c +++ b/sys/netlink/route/iface.c @@ -556,10 +556,7 @@ rtnl_handle_dellink(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate *n } NLP_LOG(LOG_DEBUG3, nlp, "mapped ifindex %u to %s", attrs.ifi_index, if_name(ifp)); - sx_xlock(&ifnet_detach_sxlock); error = if_clone_destroy(if_name(ifp)); - sx_xunlock(&ifnet_detach_sxlock); - NLP_LOG(LOG_DEBUG2, nlp, "deleting interface %s returned %d", if_name(ifp), error); if_rele(ifp); From nobody Mon Apr 13 12:33:45 2026 X-Original-To: dev-commits-src-main@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 4fvRfR1Hl1z6Z6rV for ; Mon, 13 Apr 2026 12:33:51 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvRfR0gjGz3bX1 for ; Mon, 13 Apr 2026 12:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776083631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5OhIV6F0eFPfcLZUSwCf27mD0Ezr2X6AzjjKziASgz8=; b=AugtU5uTRdY0QlCAcdXsFP8+mFJO5QOobHof7XbLdjaUPvZgbZwI7bqWS2Pr2CYX2Qi5tH YdE8H4fK/MKRxKrZwYQmuRb2p9+L9acdSMc6kibGpSdrhpyKOHBN1GTD09DeoH+gqJscnm 36o/rP8SUfnD4capAZ5Ra+az00yGK/W/q0v1JMSRfDnV3zfk3oep8AVcEV0Vzmf4FA9ecL sSGQ5mAA1fyNypO3DdBhNL0tiuSa/powQ9mCDZ0unl6Mke+ofQ4NY6Lp419cEjj26S4aTd pfAoP8OK4uXxyIy1hLfT9qt45joRk2z2nm4wHQcjSdYsxIYaiYYJffwUOHXiig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776083631; a=rsa-sha256; cv=none; b=j1dQCoixWN78bIF6qgUiYSgbU7WZ5rjFpFPMAFTERz/x6pzsEZvDb8JJCNiPNG7IfZjelK Ug+1q98ZpxSdOAsdCumVpMh+00PRh+hznLToDt1+4P1dnA4RZ1oTCcoxnWclK8AiJ03Tj5 Q0PfTytlN2q7NV9qgHaOnBnVyLP8FVYTihpG1AVOob7CDni2ZOIDrJJ8m/MAqQRNuKkWZf zocstOkaAsNaOXwD8bxuFSZnJ8LyAbmCvoBVFAq51uUf1EOzETXWwiuyI3vMPjVQ6SWu7s XGDCs5aUqvDN9QJcLbfHh0j6M1ukVXQMycJOMepPwijDklz3XTS9LeTqC6uiHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776083631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5OhIV6F0eFPfcLZUSwCf27mD0Ezr2X6AzjjKziASgz8=; b=jBXkhaGpkyf3o/seLXvXgcnUa1Q/Q6Lpi4ovfqxpizLeQ7kQ6QRAbA5+G0HgsixU9lm3G0 6aiDkTi8kM2GnR5I2gpD76Vlrd9fbAYTFgMVWkPv4qF9OsVXKSeFrTGDQmqMlZ+OQtkPXM vmLNaGqk9/yIIRlhrbyiZNHgNB5ZO+/WQ3SDNwF8sHXlb2+HhBIIUOcQ+IrKjqJ3KxPWfJ ZFio/VY1+LlZe0Gka+0cLEYURC/NPhSx+F8rROxkhrdv8fv11C835b7o/6oJW7pTPOme1j d7G6OX5WuyRrLbsjo57DT1pguXPGdvwBEIuxNKchf7MCNGqGqKkPLeW7dO3LkA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvRfR00T4z13Lt for ; Mon, 13 Apr 2026 12:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c629 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 12:33:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: YAO, Xin From: Pouria Mousavizadeh Tehrani Subject: git: 26740e8f80da - main - compat/linux: Add Linux i2c-dev ioctl compatibility support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 26740e8f80da17c78bee6fa322e6bb1f2669be5c Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 12:33:45 +0000 Message-Id: <69dce2a9.3c629.544d35cd@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=26740e8f80da17c78bee6fa322e6bb1f2669be5c commit 26740e8f80da17c78bee6fa322e6bb1f2669be5c Author: YAO, Xin AuthorDate: 2026-04-13 12:28:48 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-13 12:31:47 +0000 compat/linux: Add Linux i2c-dev ioctl compatibility support Implement Linux I2C ioctl translation in the Linux compatibility layer and wire iicbus cdevs up for in-kernel rdwr handling. Support common i2c-dev requests including SLAVE, FUNCS, and RDWR, while rejecting unsupported 10-bit and SMBus operations. Signed-off-by: YAO, Xin Reviewed by: imp, adrian, pouria Differential Revision: https://reviews.freebsd.org/D56251 --- sys/compat/linux/linux_ioctl.c | 115 +++++++++++++++++++++++++++++++++++++++++ sys/compat/linux/linux_ioctl.h | 24 +++++++++ sys/dev/iicbus/iic.c | 39 ++++++++++++-- sys/dev/iicbus/iic.h | 8 +++ 4 files changed, 182 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_ioctl.c b/sys/compat/linux/linux_ioctl.c index d2fa0331026b..b68e950a2dcf 100644 --- a/sys/compat/linux/linux_ioctl.c +++ b/sys/compat/linux/linux_ioctl.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -59,6 +60,7 @@ #include #include +#include #include #ifdef COMPAT_LINUX32 @@ -100,6 +102,7 @@ DEFINE_LINUX_IOCTL_SET(vfat, VFAT); DEFINE_LINUX_IOCTL_SET(console, CONSOLE); DEFINE_LINUX_IOCTL_SET(hdio, HDIO); DEFINE_LINUX_IOCTL_SET(disk, DISK); +DEFINE_LINUX_IOCTL_SET(i2c, I2C); DEFINE_LINUX_IOCTL_SET(socket, SOCKET); DEFINE_LINUX_IOCTL_SET(sound, SOUND); DEFINE_LINUX_IOCTL_SET(termio, TERMIO); @@ -160,6 +163,18 @@ struct linux_hd_big_geometry { uint32_t start; }; +struct linux_i2c_msg { + uint16_t addr; + uint16_t flags; + uint16_t len; + l_uintptr_t buf; +}; + +struct linux_i2c_rdwr_data { + l_uintptr_t msgs; + l_uint nmsgs; +}; + static int linux_ioctl_hdio(struct thread *td, struct linux_ioctl_args *args) { @@ -3639,6 +3654,106 @@ linux_ioctl_nvme(struct thread *td, struct linux_ioctl_args *args) } #endif +static int +linux_ioctl_i2c(struct thread *td, struct linux_ioctl_args *args) +{ + struct linux_i2c_rdwr_data lrdwr; + struct linux_i2c_msg *lmsgs = NULL; + struct iic_rdwr_data rdwr; + struct iic_msg *msgs = NULL; + struct file *fp; + iic_linux_rdwr_t *linux_rdwr; + l_ulong funcs; + uint16_t lflags; + uint8_t addr; + int error; + l_uint i; + + error = fget(td, args->fd, &cap_ioctl_rights, &fp); + if (error != 0) + return (error); + + linux_rdwr = NULL; + if (fp->f_type == DTYPE_VNODE && fp->f_vnode != NULL && + fp->f_vnode->v_rdev != NULL) + linux_rdwr = (iic_linux_rdwr_t *)fp->f_vnode->v_rdev->si_drv2; + + switch (args->cmd & 0xffff) { + case LINUX_I2C_RETRIES: + case LINUX_I2C_TIMEOUT: + case LINUX_I2C_PEC: + error = 0; + break; + case LINUX_I2C_TENBIT: + error = (args->arg == 0) ? 0 : ENOTSUP; + break; + case LINUX_I2C_FUNCS: + funcs = LINUX_I2C_FUNC_I2C | LINUX_I2C_FUNC_NOSTART; + error = copyout(&funcs, (void *)args->arg, sizeof(funcs)); + break; + case LINUX_I2C_SLAVE: + case LINUX_I2C_SLAVE_FORCE: + if (args->arg > 0x7f) { + error = EINVAL; + break; + } + addr = (uint8_t)(args->arg << 1); + error = fo_ioctl(fp, I2CSADDR, (caddr_t)&addr, td->td_ucred, td); + break; + case LINUX_I2C_RDWR: + error = copyin((void *)args->arg, &lrdwr, sizeof(lrdwr)); + if (error != 0) + break; + if (lrdwr.nmsgs > IIC_RDRW_MAX_MSGS) { + error = EINVAL; + break; + } + lmsgs = malloc(sizeof(*lmsgs) * lrdwr.nmsgs, M_TEMP, M_WAITOK); + msgs = malloc(sizeof(*msgs) * lrdwr.nmsgs, M_TEMP, M_WAITOK); + error = copyin((void *)(uintptr_t)lrdwr.msgs, lmsgs, + sizeof(*lmsgs) * lrdwr.nmsgs); + if (error != 0) + break; + for (i = 0; i < lrdwr.nmsgs; i++) { + lflags = lmsgs[i].flags; + if (lmsgs[i].addr > 0x7f || (lflags & LINUX_I2C_M_TEN) != 0) { + error = ENOTSUP; + break; + } + if ((lflags & ~(LINUX_I2C_M_RD | LINUX_I2C_M_NOSTART)) != 0) { + error = ENOTSUP; + break; + } + msgs[i].slave = lmsgs[i].addr << 1; + msgs[i].flags = (lflags & LINUX_I2C_M_RD) ? IIC_M_RD : IIC_M_WR; + if ((lflags & LINUX_I2C_M_NOSTART) != 0) + msgs[i].flags |= IIC_M_NOSTART; + msgs[i].len = lmsgs[i].len; + msgs[i].buf = (uint8_t *)(uintptr_t)lmsgs[i].buf; + } + if (error == 0) { + if (linux_rdwr == NULL) { + error = ENOTTY; + } else { + rdwr.msgs = msgs; + rdwr.nmsgs = lrdwr.nmsgs; + error = linux_rdwr(fp, &rdwr, fp->f_flag, td); + if (error == 0) + td->td_retval[0] = lrdwr.nmsgs; + } + } + break; + case LINUX_I2C_SMBUS: + default: + error = ENOTSUP; + break; + } + free(msgs, M_TEMP); + free(lmsgs, M_TEMP); + fdrop(fp, td); + return (error); +} + static int linux_ioctl_hidraw(struct thread *td, struct linux_ioctl_args *args) { diff --git a/sys/compat/linux/linux_ioctl.h b/sys/compat/linux/linux_ioctl.h index 116a4e676228..769f56b7de51 100644 --- a/sys/compat/linux/linux_ioctl.h +++ b/sys/compat/linux/linux_ioctl.h @@ -71,6 +71,30 @@ #define LINUX_IOCTL_HDIO_MIN LINUX_HDIO_GET_GEO #define LINUX_IOCTL_HDIO_MAX LINUX_HDIO_GET_GEO_BIG +/* + * i2c + */ +#define LINUX_I2C_RETRIES 0x0701 +#define LINUX_I2C_TIMEOUT 0x0702 +#define LINUX_I2C_SLAVE 0x0703 +#define LINUX_I2C_TENBIT 0x0704 +#define LINUX_I2C_FUNCS 0x0705 +#define LINUX_I2C_SLAVE_FORCE 0x0706 +#define LINUX_I2C_RDWR 0x0707 +#define LINUX_I2C_PEC 0x0708 +#define LINUX_I2C_SMBUS 0x0720 + +#define LINUX_IOCTL_I2C_MIN LINUX_I2C_RETRIES +#define LINUX_IOCTL_I2C_MAX LINUX_I2C_SMBUS + +#define LINUX_I2C_M_RD 0x0001 +#define LINUX_I2C_M_TEN 0x0010 +#define LINUX_I2C_M_NOSTART 0x4000 + +#define LINUX_I2C_FUNC_I2C 0x00000001UL +#define LINUX_I2C_FUNC_10BIT_ADDR 0x00000002UL +#define LINUX_I2C_FUNC_NOSTART 0x00000010UL + /* * cdrom */ diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c index efb8569a23c0..c3fcb2dbdaed 100644 --- a/sys/dev/iicbus/iic.c +++ b/sys/dev/iicbus/iic.c @@ -31,11 +31,13 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -96,7 +98,10 @@ static void iic_identify(driver_t *driver, device_t parent); static void iicdtor(void *data); static int iicuio_move(struct iic_cdevpriv *priv, struct uio *uio, int last); static int iicuio(struct cdev *dev, struct uio *uio, int ioflag); -static int iicrdwr(struct iic_cdevpriv *priv, struct iic_rdwr_data *d, int flags, bool compat32); +static int iicrdwr(struct iic_cdevpriv *priv, struct iic_rdwr_data *d, + int flags, bool compat32, bool kernel_msgs); +static int iic_linux_rdwr(struct file *fp, struct iic_rdwr_data *d, + int flags, struct thread *td); static device_method_t iic_methods[] = { /* device interface */ @@ -163,6 +168,7 @@ iic_attach(device_t dev) return (ENXIO); } sc->sc_devnode->si_drv1 = sc; + sc->sc_devnode->si_drv2 = (void *)iic_linux_rdwr; return (0); } @@ -341,7 +347,7 @@ iic_copyinmsgs32(struct iic_rdwr_data *d, struct iic_msg *buf) static int iicrdwr(struct iic_cdevpriv *priv, struct iic_rdwr_data *d, int flags, - bool compat32 __unused) + bool compat32 __unused, bool kernel_msgs) { #ifdef COMPAT_FREEBSD32 struct iic_rdwr_data dswab; @@ -375,7 +381,11 @@ iicrdwr(struct iic_cdevpriv *priv, struct iic_rdwr_data *d, int flags, error = iic_copyinmsgs32(d, buf); else #endif - error = copyin(d->msgs, buf, sizeof(*d->msgs) * d->nmsgs); + if (kernel_msgs) + memcpy(buf, d->msgs, sizeof(*d->msgs) * d->nmsgs); + else + error = copyin(d->msgs, buf, + sizeof(*d->msgs) * d->nmsgs); if (error != 0) { free(buf, M_IIC); return (error); @@ -424,6 +434,27 @@ iicrdwr(struct iic_cdevpriv *priv, struct iic_rdwr_data *d, int flags, return (error); } +static int +iic_linux_rdwr(struct file *fp, struct iic_rdwr_data *d, int flags, + struct thread *td) +{ + struct file *saved_fp; + struct iic_cdevpriv *priv; + int error; + + saved_fp = td->td_fpop; + td->td_fpop = fp; + error = devfs_get_cdevpriv((void **)&priv); + td->td_fpop = saved_fp; + if (error != 0) + return (error); + + IIC_LOCK(priv); + error = iicrdwr(priv, d, flags, false, true); + IIC_UNLOCK(priv); + return (error); +} + static int iicioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *td) { @@ -582,7 +613,7 @@ iicioctl(struct cdev *dev, u_long cmd, caddr_t data, int flags, struct thread *t compat32 = false; #endif error = iicrdwr(priv, (struct iic_rdwr_data *)data, flags, - compat32); + compat32, false); break; diff --git a/sys/dev/iicbus/iic.h b/sys/dev/iicbus/iic.h index f6e9360186e0..badfb76e92eb 100644 --- a/sys/dev/iicbus/iic.h +++ b/sys/dev/iicbus/iic.h @@ -31,6 +31,14 @@ #include +#ifdef _KERNEL +struct file; +struct iic_rdwr_data; +struct thread; +typedef int iic_linux_rdwr_t(struct file *fp, struct iic_rdwr_data *d, + int flags, struct thread *td); +#endif + /* Designed to be compatible with linux's struct i2c_msg */ struct iic_msg { From nobody Mon Apr 13 14:06:12 2026 X-Original-To: dev-commits-src-main@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 4fvTj56njRz6ZDD7 for ; Mon, 13 Apr 2026 14:06:17 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvTj56SBbz3lwY for ; Mon, 13 Apr 2026 14:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776089177; 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=xVFNJohSO9+zkyYkAF9v+vJFIA9oozoSi/4eQ6ggZuY=; b=Ao6uCxbDTZyMS35vQ/8zmduIRFqn15r2jFHsSLqYI97TctA3IgmweVzus+i8a5m73EzAm/ JHSXIX/ijCv3q8YXryr9LbqsgDFoQGS6ie/q3xjzg1Di/dISVpmz9hKhVy1+rJQ++fr9sc oJEuokSiEOdoK13CE5w6SZzbbxocorOnzWbwcUgsfBhgq+97aRPfF3SDfuR4RdO15JVbxC FUqgOlDraGjaSwwsnYyBne1FA0FTrKiScr0mGgETxrQ45h/Q2ubxitHdr7iGw+cz/ymqQB AY5hBOaCk562OcEXsR3ZWLtHmpwtPmXaaGuNrOnUlJI0qsgLeDu8EqLZ7lPcYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776089177; a=rsa-sha256; cv=none; b=TvfNDXfkATyAdsTmudMUB2acHy9v3/QMAebXX96RwJNvcLie83Qwf9AuvfXcSiEl7+T+4k oZt4vmsOf6g/Zy5Urk/ZzxfR51uumjIGkX3QRcLnXI7aqXMgX1OSdpE8SiUT2Afs08pGtW 7TQoTgSK6qdblNeaVijCaKHfLZy4ayzzC+wKdqbIpRfGf7o/b7learEEryVEEdDc9tXdKY +scI+VJYEHtrIWK0SD7yGF/zgrrf2EqAK6fBFEL8QvPgweQ8wIbU3dEWB3KtVTHVVnATlv K4ywhlIO0CZxoJbsKSd8gG6E52nVoV3sn3xma4/KEcEIGHK8ZhEvFUmFjd9Qxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776089177; 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=xVFNJohSO9+zkyYkAF9v+vJFIA9oozoSi/4eQ6ggZuY=; b=xaLFZCaMlqlIYresnMZpjUh+sqSnaOZhG+wEGzxubqe/yDYl0CMgAxTPgEjWCQqcW70DiF +fAk4pcTgTXx1NBDbrejJugqgjOP08TfAi0o2DMcIPOhIN2KDoWJDJBpD4Rac3QM5ptCP8 UxDGYOLitZgao+QzPpIhoni4nO42mB3I0i6xK64jQzIs8wfEiq3xPSkKY78rVwqfqVnwVd GImS3KrLDSjYBZ66lzzswcA9hiGNO71sDiwWPnznJtdqN8rHrYuI53biDisMzIXXwtQ12u w2qPj9BW0FsmZf6tmvXI+duI3aEDCFs4Y6HwQ1vtNE874AvLj1R8LYJK5Bl/PA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvTj55psQz16WD for ; Mon, 13 Apr 2026 14:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 425f5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 14:06:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: eb5165bb4911 - main - libarchive: merge from vendor branch List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb5165bb491138f60d9004bc4c781490016d9288 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 14:06:12 +0000 Message-Id: <69dcf854.425f5.5d77dfe5@gitrepo.freebsd.org> The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=eb5165bb491138f60d9004bc4c781490016d9288 commit eb5165bb491138f60d9004bc4c781490016d9288 Merge: 26740e8f80da f2cd95a37200 Author: Martin Matuska AuthorDate: 2026-04-13 13:47:17 +0000 Commit: Martin Matuska CommitDate: 2026-04-13 13:47:17 +0000 libarchive: merge from vendor branch libarchive 3.8.7 Important bugfixes: #2871 libarchive: fix handling of option failures #2897 iso9660: fix undefined behavior #2898 RAR: fix LZSS window size mismatch after PPMd block #2900 CAB: fix NULL pointer dereference during skip #2911 libarchive: do not continue with truncated numbers #2919 CAB: Fix Heap OOB Write in CAB LZX decoder #2934 iso9660: fix posibble heap buffer overflow on 32-bit systems #2939 cpio: Fix -R memory leak #2947 libarchive: lzop and grzip filter support Important bugfixes between 3.8.5 and 3.8.6: #2860 bsdunzip: fix ISO week year and Gregorian year confusion #2864 7zip: ix SEGV in check_7zip_header_in_sfx via ELF offset validation #2875 7zip: fix out-of-bounds access on ELF 64-bit header #2877 RAR5 reader: fix infinite loop in rar5 decompression #2878 mtree reader: Fix file descriptor leak in mtree parser cleanup (CWE-775) #2892 RAR5 reader: fix potential memory leak #2893 RAR5: fix SIGSEGV when archive_read_support_format_rar5 is called twice #2895 CAB reader: fix memory leak on repeated calls to archive_read_support_format_cab Obtained from: libarchive Vendor commit: ded82291ab41d5e355831b96b0e1ff49e24d8939 MFC after: 1 week contrib/libarchive/NEWS | 4 + contrib/libarchive/README.md | 9 +- contrib/libarchive/cpio/cmdline.c | 15 +- contrib/libarchive/cpio/cpio.c | 123 ++- contrib/libarchive/cpio/cpio.h | 2 - contrib/libarchive/cpio/test/test_format_newc.c | 7 + contrib/libarchive/libarchive/archive.h | 4 +- contrib/libarchive/libarchive/archive_acl.c | 6 +- .../libarchive/libarchive/archive_check_magic.c | 4 +- .../libarchive/archive_cryptor_private.h | 4 + contrib/libarchive/libarchive/archive_entry.h | 2 +- contrib/libarchive/libarchive/archive_hmac.c | 6 + contrib/libarchive/libarchive/archive_options.c | 4 +- contrib/libarchive/libarchive/archive_pathmatch.c | 4 +- contrib/libarchive/libarchive/archive_ppmd8.c | 22 +- .../libarchive/libarchive/archive_ppmd8_private.h | 25 - contrib/libarchive/libarchive/archive_read.c | 12 +- .../libarchive/archive_read_append_filter.c | 4 + .../libarchive/archive_read_disk_posix.c | 6 +- .../libarchive/archive_read_open_filename.c | 7 +- .../libarchive/archive_read_support_filter_grzip.c | 2 +- .../libarchive/archive_read_support_filter_lz4.c | 4 +- .../libarchive/archive_read_support_filter_lzop.c | 2 +- .../archive_read_support_filter_program.c | 2 + .../libarchive/archive_read_support_format_7zip.c | 24 +- .../libarchive/archive_read_support_format_cab.c | 24 +- .../libarchive/archive_read_support_format_cpio.c | 4 +- .../archive_read_support_format_iso9660.c | 26 +- .../libarchive/archive_read_support_format_lha.c | 11 +- .../libarchive/archive_read_support_format_mtree.c | 7 +- .../libarchive/archive_read_support_format_rar.c | 73 +- .../libarchive/archive_read_support_format_rar5.c | 45 +- .../libarchive/archive_read_support_format_tar.c | 6 +- .../libarchive/archive_read_support_format_xar.c | 14 +- .../libarchive/archive_read_support_format_zip.c | 22 +- contrib/libarchive/libarchive/archive_string.c | 16 +- contrib/libarchive/libarchive/archive_write.c | 2 +- .../archive_write_add_filter_b64encode.c | 22 +- .../libarchive/archive_write_add_filter_bzip2.c | 7 +- .../libarchive/archive_write_add_filter_gzip.c | 12 +- .../libarchive/archive_write_add_filter_lrzip.c | 21 +- .../libarchive/archive_write_add_filter_lz4.c | 14 +- .../libarchive/archive_write_add_filter_lzop.c | 7 +- .../libarchive/archive_write_add_filter_uuencode.c | 22 +- .../libarchive/archive_write_add_filter_xz.c | 27 +- .../libarchive/archive_write_add_filter_zstd.c | 52 +- .../libarchive/archive_write_disk_posix.c | 30 +- .../libarchive/archive_write_set_format_7zip.c | 9 +- .../archive_write_set_format_cpio_binary.c | 4 +- .../archive_write_set_format_cpio_newc.c | 2 +- .../libarchive/archive_write_set_format_cpio_odc.c | 2 +- .../libarchive/archive_write_set_format_gnutar.c | 34 +- .../libarchive/archive_write_set_format_iso9660.c | 18 +- .../libarchive/archive_write_set_format_mtree.c | 2 +- .../libarchive/archive_write_set_format_pax.c | 6 +- .../libarchive/archive_write_set_format_ustar.c | 27 +- .../libarchive/archive_write_set_format_v7tar.c | 27 +- .../libarchive/archive_write_set_format_xar.c | 6 +- .../libarchive/archive_write_set_format_zip.c | 49 +- contrib/libarchive/libarchive/test/test_acl_text.c | 23 + .../libarchive/test/test_archive_pathmatch.c | 18 + .../test/test_archive_string_conversion.c | 135 +++ .../test/test_gnutar_filename_encoding.c | 40 + .../libarchive/test/test_read_format_7zip.c | 26 + .../test/test_read_format_7zip_malformed.c | 17 + .../test/test_read_format_7zip_malformed3.7z.uu | 24 + .../test_read_format_7zip_sfx_elf64trunc.elf.uu | 5 + .../libarchive/test/test_read_format_cab_lzx_oob.c | 45 + .../test/test_read_format_cab_lzx_oob.cab.uu | 11 + .../test/test_read_format_cab_skip_malformed.c | 41 + .../test_read_format_cab_skip_malformed.cab.uu | 95 ++ .../test/test_read_format_iso_zisofs_overflow.c | 104 ++ .../test_read_format_iso_zisofs_overflow.iso.uu | 1096 ++++++++++++++++++++ .../test/test_read_format_lha_oversize_header.c | 50 + .../test_read_format_lha_oversize_header.lzh.uu | 60 ++ .../test/test_read_format_rar5_loop_bug.c | 53 + .../test/test_read_format_rar5_loop_bug.rar.uu | 189 ++++ .../libarchive/test/test_read_set_format.c | 34 + .../libarchive/test/test_ustar_filename_encoding.c | 40 + .../libarchive/test/test_v7tar_filename_encoding.c | 67 ++ .../test/test_warn_missing_hardlink_target.c | 2 +- .../libarchive/libarchive/test/test_write_disk.c | 29 + .../libarchive/test/test_write_disk_perms.c | 11 +- .../libarchive/test/test_zip_filename_encoding.c | 40 + .../la_getline.c => libarchive_fe/lafe_getline.c} | 11 +- .../la_getline.h => libarchive_fe/lafe_getline.h} | 15 +- contrib/libarchive/tar/bsdtar.c | 20 +- contrib/libarchive/tar/read.c | 2 +- contrib/libarchive/tar/util.c | 8 +- contrib/libarchive/tar/write.c | 16 +- contrib/libarchive/test_utils/test_common.h | 4 + contrib/libarchive/test_utils/test_main.c | 85 +- contrib/libarchive/unzip/bsdunzip.c | 6 +- lib/libarchive/tests/Makefile | 13 + usr.bin/unzip/Makefile | 2 +- 95 files changed, 3019 insertions(+), 372 deletions(-) diff --cc contrib/libarchive/README.md index e9691f1b710b,000000000000..3009e1b54d18 mode 100644,000000..100644 --- a/contrib/libarchive/README.md +++ b/contrib/libarchive/README.md @@@ -1,247 -1,0 +1,250 @@@ +# Welcome to libarchive! + +The libarchive project develops a portable, efficient C library that +can read and write streaming archives in a variety of formats. It +also includes implementations of the common `tar`, `cpio`, and `zcat` +command-line tools that use the libarchive library. + +## Questions? Issues? + +* https://www.libarchive.org is the home for ongoing + libarchive development, including documentation, + and links to the libarchive mailing lists. +* To report an issue, use the issue tracker at + https://github.com/libarchive/libarchive/issues +* To submit an enhancement to libarchive, please + submit a pull request via GitHub: https://github.com/libarchive/libarchive/pulls + +## Contents of the Distribution + +This distribution bundle includes the following major components: + +* **libarchive**: a library for reading and writing streaming archives +* **tar**: the 'bsdtar' program is a full-featured 'tar' implementation built on libarchive +* **cpio**: the 'bsdcpio' program is a different interface to essentially the same functionality +* **cat**: the 'bsdcat' program is a simple replacement tool for zcat, bzcat, xzcat, and such +* **unzip**: the 'bsdunzip' program is a simple replacement tool for Info-ZIP's unzip +* **examples**: Some small example programs that you may find useful. +* **examples/minitar**: a compact sample demonstrating use of libarchive. +* **contrib**: Various items sent to me by third parties; please contact the authors with any questions. + +The top-level directory contains the following information files: + +* **NEWS** - highlights of recent changes +* **COPYING** - what you can do with this +* **INSTALL** - installation instructions +* **README** - this file +* **CMakeLists.txt** - input for "cmake" build tool, see INSTALL +* **configure** - configuration script, see INSTALL for details. If your copy of the source lacks a `configure` script, you can try to construct it by running the script in `build/autogen.sh` (or use `cmake`). + - The following files in the top-level directory are used by the 'configure' script: ++The following files in the top-level directory are related to the 'configure' script and are only needed by maintainers: + - * `Makefile.am`, `aclocal.m4`, `configure.ac` - used to build this distribution, only needed by maintainers - * `Makefile.in`, `config.h.in` - templates used by configure script ++* `configure.ac` - used (by autoconf) to build the configure script and related files ++* `Makefile.am` - used (by automake) to generate Makefile.in ++* `aclocal.m4` - auto-generated file (created by aclocal) used to build the configure script ++* `Makefile.in` - auto-generated template (created by automake) used by the configure script to create Makefile ++* `config.h.in` - auto-generated template (created by autoheader) used by the configure script to create config.h + +## Documentation + +In addition to the informational articles and documentation +in the online [libarchive Wiki](https://github.com/libarchive/libarchive/wiki), +the distribution also includes a number of manual pages: + + * bsdtar.1 explains the use of the bsdtar program + * bsdcpio.1 explains the use of the bsdcpio program + * bsdcat.1 explains the use of the bsdcat program + * libarchive.3 gives an overview of the library as a whole + * archive_read.3, archive_write.3, archive_write_disk.3, and + archive_read_disk.3 provide detailed calling sequences for the read + and write APIs + * archive_entry.3 details the "struct archive_entry" utility class + * archive_internals.3 provides some insight into libarchive's + internal structure and operation. + * libarchive-formats.5 documents the file formats supported by the library + * cpio.5, mtree.5, and tar.5 provide detailed information about these + popular archive formats, including hard-to-find details about + modern cpio and tar variants. + +The manual pages above are provided in the 'doc' directory in +a number of different formats. + +You should also read the copious comments in `archive.h` and the +source code for the sample programs for more details. Please let us +know about any errors or omissions you find. + +## Supported Formats + +Currently, the library automatically detects and reads the following formats: + + * Old V7 tar archives + * POSIX ustar + * GNU tar format (including GNU long filenames, long link names, and sparse files) + * Solaris 9 extended tar format (including ACLs) + * POSIX pax interchange format + * POSIX octet-oriented cpio + * SVR4 ASCII cpio + * Binary cpio (big-endian or little-endian) + * PWB binary cpio + * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) + * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives) + * ZIPX archives (with support for bzip2, zstd, ppmd8, lzma and xz compressed entries) + * GNU and BSD 'ar' archives + * 'mtree' format + * 7-Zip archives (including archives that use zstandard compression) + * Microsoft CAB format + * LHA and LZH archives + * RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status) + * WARC archives + * XAR archives + +The library also detects and handles any of the following before evaluating the archive: + + * uuencoded files + * files with RPM wrapper + * gzip compression + * bzip2 compression + * compress/LZW compression + * lzma, lzip, and xz compression + * lz4 compression + * lzop compression + * zstandard compression + +The library can create archives in any of the following formats: + + * POSIX ustar + * POSIX pax interchange format + * "restricted" pax format, which will create ustar archives except for + entries that require pax extensions (for long filenames, ACLs, etc). + * Old GNU tar format + * Old V7 tar format + * POSIX octet-oriented cpio + * SVR4 "newc" cpio + * Binary cpio (little-endian) + * PWB binary cpio + * shar archives + * ZIP archives (with uncompressed or "deflate" compressed entries) + * ZIPX archives (with bzip2, zstd, lzma or xz compressed entries) + * GNU and BSD 'ar' archives + * 'mtree' format + * ISO9660 format + * 7-Zip archives (including archives that use zstandard compression) + * WARC archives + * XAR archives + +When creating archives, the result can be filtered with any of the following: + + * uuencode + * base64 + * gzip compression + * bzip2 compression + * compress/LZW compression + * lzma, lzip, and xz compression + * lz4 compression + * lzop compression + * zstandard compression + +## Notes about the Library Design + +The following notes address many of the most common +questions we are asked about libarchive: + +* This is a heavily stream-oriented system. That means that + it is optimized to read or write the archive in a single + pass from beginning to end. For example, this allows + libarchive to process archives too large to store on disk + by processing them on-the-fly as they are read from or + written to a network or tape drive. This also makes + libarchive useful for tools that need to produce + archives on-the-fly (such as webservers that provide + archived contents of a users account). + +* In-place modification and random access to the contents + of an archive are not directly supported. For some formats, + this is not an issue: For example, tar.gz archives are not + designed for random access. In some other cases, libarchive + can re-open an archive and scan it from the beginning quickly + enough to provide the needed abilities even without true + random access. Of course, some applications do require true + random access; those applications should consider alternatives + to libarchive. + +* The library is designed to be extended with new compression and + archive formats. The only requirement is that the format be + readable or writable as a stream and that each archive entry be + independent. There are articles on the libarchive Wiki explaining + how to extend libarchive. + +* On read, compression and format are always detected automatically. + +* The same API is used for all formats; it should be very + easy for software using libarchive to transparently handle + any of libarchive's archiving formats. + +* Libarchive's automatic support for decompression can be used + without archiving by explicitly selecting the "raw" and "empty" + formats. + +* I've attempted to minimize static link pollution. If you don't + explicitly invoke a particular feature (such as support for a + particular compression or format), it won't get pulled in to + statically-linked programs. In particular, if you don't explicitly + enable a particular compression or decompression support, you won't + need to link against the corresponding compression or decompression + libraries. This also reduces the size of statically-linked + binaries in environments where that matters. + +* The library is generally _thread-safe_ depending on the platform: + it does not define any global variables of its own. However, some + platforms do not provide fully thread-safe versions of key C library + functions. On those platforms, libarchive will use the non-thread-safe + functions. Patches to improve this are of great interest to us. + +* The function `archive_write_disk_header()` is _not_ thread safe on + POSIX machines and could lead to security issue resulting in world + writeable directories. Thus it must be mutexed by the calling code. + This is due to calling `umask(oldumask = umask(0))`, which sets the + umask for the whole process to 0 for a short time frame. + In case other thread calls the same function in parallel, it might + get interrupted by it and cause the executable to use umask=0 for the + remaining execution. + This will then lead to implicitly created directories to have 777 + permissions without sticky bit. + +* In particular, libarchive's modules to read or write a directory + tree do use `chdir()` to optimize the directory traversals. This + can cause problems for programs that expect to do disk access from + multiple threads. Of course, those modules are completely + optional and you can use the rest of libarchive without them. + +* The library is _not_ thread-aware, however. It does no locking + or thread management of any kind. If you create a libarchive + object and need to access it from multiple threads, you will + need to provide your own locking. + +* On read, the library accepts whatever blocks you hand it. + Your read callback is free to pass the library a byte at a time + or mmap the entire archive and give it to the library at once. + On write, the library always produces correctly-blocked output. + +* The object-style approach allows you to have multiple archive streams + open at once. bsdtar uses this in its "@archive" extension. + +* The archive itself is read/written using callback functions. + You can read an archive directly from an in-memory buffer or + write it to a socket, if you wish. There are some utility + functions to provide easy-to-use "open file," etc, capabilities. + +* The read/write APIs are designed to allow individual entries + to be read or written to any data source: You can create + a block of data in memory and add it to a tar archive without + first writing a temporary file. You can also read an entry from + an archive and write the data directly to a socket. If you want + to read/write entries to disk, there are convenience functions to + make this especially easy. + +* Note: The "pax interchange format" is a POSIX standard extended tar + format that should be used when the older _ustar_ format is not + appropriate. It has many advantages over other tar formats + (including the legacy GNU tar format) and is widely supported by + current tar implementations. diff --cc contrib/libarchive/libarchive/test/test_read_format_7zip_malformed3.7z.uu index 000000000000,4e814980a6da..4e814980a6da mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_read_format_7zip_malformed3.7z.uu +++ b/contrib/libarchive/libarchive/test/test_read_format_7zip_malformed3.7z.uu diff --cc contrib/libarchive/libarchive/test/test_read_format_7zip_sfx_elf64trunc.elf.uu index 000000000000,512da918218b..512da918218b mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_read_format_7zip_sfx_elf64trunc.elf.uu +++ b/contrib/libarchive/libarchive/test/test_read_format_7zip_sfx_elf64trunc.elf.uu diff --cc contrib/libarchive/libarchive/test/test_read_format_cab_lzx_oob.c index 000000000000,a4c15d62f789..a4c15d62f789 mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_read_format_cab_lzx_oob.c +++ b/contrib/libarchive/libarchive/test/test_read_format_cab_lzx_oob.c diff --cc contrib/libarchive/libarchive/test/test_read_format_cab_lzx_oob.cab.uu index 000000000000,2f453ef27116..2f453ef27116 mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_read_format_cab_lzx_oob.cab.uu +++ b/contrib/libarchive/libarchive/test/test_read_format_cab_lzx_oob.cab.uu diff --cc contrib/libarchive/libarchive/test/test_read_format_cab_skip_malformed.c index 000000000000,05cc80b79c93..05cc80b79c93 mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_read_format_cab_skip_malformed.c +++ b/contrib/libarchive/libarchive/test/test_read_format_cab_skip_malformed.c diff --cc contrib/libarchive/libarchive/test/test_read_format_cab_skip_malformed.cab.uu index 000000000000,7ec83433546d..7ec83433546d mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_read_format_cab_skip_malformed.cab.uu +++ b/contrib/libarchive/libarchive/test/test_read_format_cab_skip_malformed.cab.uu diff --cc contrib/libarchive/libarchive/test/test_read_format_iso_zisofs_overflow.c index 000000000000,bad52b154acd..bad52b154acd mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_read_format_iso_zisofs_overflow.c +++ b/contrib/libarchive/libarchive/test/test_read_format_iso_zisofs_overflow.c diff --cc contrib/libarchive/libarchive/test/test_read_format_iso_zisofs_overflow.iso.uu index 000000000000,5e7dcc3750ac..5e7dcc3750ac mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_read_format_iso_zisofs_overflow.iso.uu +++ b/contrib/libarchive/libarchive/test/test_read_format_iso_zisofs_overflow.iso.uu diff --cc contrib/libarchive/libarchive/test/test_read_format_lha_oversize_header.c index 000000000000,fbdbd671df7c..fbdbd671df7c mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_read_format_lha_oversize_header.c +++ b/contrib/libarchive/libarchive/test/test_read_format_lha_oversize_header.c diff --cc contrib/libarchive/libarchive/test/test_read_format_lha_oversize_header.lzh.uu index 000000000000,e562e440a777..e562e440a777 mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_read_format_lha_oversize_header.lzh.uu +++ b/contrib/libarchive/libarchive/test/test_read_format_lha_oversize_header.lzh.uu diff --cc contrib/libarchive/libarchive/test/test_read_format_rar5_loop_bug.c index 000000000000,77dd78cccc48..77dd78cccc48 mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_read_format_rar5_loop_bug.c +++ b/contrib/libarchive/libarchive/test/test_read_format_rar5_loop_bug.c diff --cc contrib/libarchive/libarchive/test/test_read_format_rar5_loop_bug.rar.uu index 000000000000,3e470043fb70..3e470043fb70 mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_read_format_rar5_loop_bug.rar.uu +++ b/contrib/libarchive/libarchive/test/test_read_format_rar5_loop_bug.rar.uu diff --cc contrib/libarchive/libarchive/test/test_v7tar_filename_encoding.c index 000000000000,96594b12180e..96594b12180e mode 000000,100644..100644 --- a/contrib/libarchive/libarchive/test/test_v7tar_filename_encoding.c +++ b/contrib/libarchive/libarchive/test/test_v7tar_filename_encoding.c diff --cc lib/libarchive/tests/Makefile index 880c0d3ce0c6,000000000000..3a03725054f4 mode 100644,000000..100644 --- a/lib/libarchive/tests/Makefile +++ b/lib/libarchive/tests/Makefile @@@ -1,751 -1,0 +1,764 @@@ +.include + +PACKAGE= tests + +WARNS?= 3 + +_LIBARCHIVEDIR= ${SRCTOP}/contrib/libarchive + +ATF_TESTS_SH+= functional_test + +TEST_METADATA.functional_test+= timeout="600" + +BINDIR= ${TESTSDIR} + +PROGS+= libarchive_test + +CFLAGS+= -I${.CURDIR} -I${.CURDIR:H} -I${.OBJDIR} +CFLAGS+= -I${_LIBARCHIVEDIR}/libarchive -I${_LIBARCHIVEDIR}/libarchive/test +CFLAGS+= -I${_LIBARCHIVEDIR}/test_utils +CFLAGS+= -I${SRCTOP}/sys/contrib/zstd/lib + +CFLAGS.test_utils.c+= -Wno-cast-align + +# Uncomment to link against dmalloc +#LDADD+= -L/usr/local/lib -ldmalloc +#CFLAGS+= -I/usr/local/include -DUSE_DMALLOC + +.PATH: ${_LIBARCHIVEDIR}/libarchive/test +TESTS_SRCS= \ + test_7zip_filename_encoding.c \ + test_acl_nfs4.c \ + test_acl_pax.c \ + test_acl_platform_nfs4.c \ + test_acl_platform_posix1e.c \ + test_acl_posix1e.c \ + test_acl_text.c \ + test_ar_mode.c \ + test_archive_api_feature.c \ + test_archive_clear_error.c \ + test_archive_cmdline.c \ + test_archive_digest.c \ + test_archive_match_time.c \ + test_archive_match_owner.c \ + test_archive_match_path.c \ + test_archive_pathmatch.c \ + test_archive_parse_date.c \ + test_archive_read.c \ + test_archive_read_add_passphrase.c \ + test_archive_read_close_twice.c \ + test_archive_read_close_twice_open_fd.c \ + test_archive_read_close_twice_open_filename.c \ + test_archive_read_multiple_data_objects.c \ + test_archive_read_next_header_empty.c \ + test_archive_read_next_header_raw.c \ + test_archive_read_open2.c \ + test_archive_read_set_filter_option.c \ + test_archive_read_set_format_option.c \ + test_archive_read_set_option.c \ + test_archive_read_set_options.c \ + test_archive_read_support.c \ + test_archive_set_error.c \ + test_archive_string.c \ + test_archive_string_conversion.c \ + test_archive_write_add_filter_by_name.c \ + test_archive_write_set_filter_option.c \ + test_archive_write_set_format_by_name.c \ + test_archive_write_set_format_filter_by_ext.c \ + test_archive_write_set_format_option.c \ + test_archive_write_set_option.c \ + test_archive_write_set_options.c \ + test_archive_write_set_passphrase.c \ + test_bad_fd.c \ + test_compat_bzip2.c \ + test_compat_cpio.c \ + test_compat_gtar.c \ + test_compat_gtar_large.c \ + test_compat_gzip.c \ + test_compat_lz4.c \ + test_compat_lzip.c \ + test_compat_lzma.c \ + test_compat_lzop.c \ + test_compat_mac.c \ + test_compat_perl_archive_tar.c \ + test_compat_plexus_archiver_tar.c \ + test_compat_solaris_tar_acl.c \ + test_compat_solaris_pax_sparse.c \ + test_compat_star_acl.c \ + test_compat_tar_directory.c \ + test_compat_tar_hardlink.c \ + test_compat_uudecode.c \ + test_compat_uudecode_large.c \ + test_compat_xz.c \ + test_compat_zip.c \ + test_compat_zstd.c \ + test_empty_write.c \ + test_entry.c \ + test_entry_strmode.c \ + test_extattr_freebsd.c \ + test_filter_count.c \ + test_gnutar_filename_encoding.c \ + test_link_resolver.c \ + test_open_fd.c \ + test_open_failure.c \ + test_open_file.c \ + test_open_filename.c \ + test_pax_filename_encoding.c \ + test_pax_xattr_header.c \ + test_read_data_large.c \ + test_read_disk.c \ + test_read_disk_directory_traversals.c \ + test_read_disk_entry_from_file.c \ + test_read_extract.c \ + test_read_file_nonexistent.c \ + test_read_filter_compress.c \ + test_read_filter_grzip.c \ + test_read_filter_gzip_recursive.c \ + test_read_filter_lrzip.c \ + test_read_filter_lzop.c \ + test_read_filter_lzop_multiple_parts.c \ + test_read_filter_program.c \ + test_read_filter_program_signature.c \ + test_read_filter_uudecode.c \ + test_read_filter_uudecode_raw.c \ + test_read_format_7zip.c \ + test_read_format_7zip_encryption_data.c \ + test_read_format_7zip_encryption_header.c \ + test_read_format_7zip_encryption_partially.c \ + test_read_format_7zip_issue2765.c \ + test_read_format_7zip_malformed.c \ + test_read_format_7zip_packinfo_digests.c \ + test_read_format_ar.c \ + test_read_format_cab.c \ + test_read_format_cab_filename.c \ ++ test_read_format_cab_lzx_oob.c \ ++ test_read_format_cab_skip_malformed.c \ + test_read_format_cpio_afio.c \ + test_read_format_cpio_bin.c \ + test_read_format_cpio_bin_Z.c \ + test_read_format_cpio_bin_be.c \ + test_read_format_cpio_bin_bz2.c \ + test_read_format_cpio_bin_gz.c \ + test_read_format_cpio_bin_le.c \ + test_read_format_cpio_bin_lzip.c \ + test_read_format_cpio_bin_lzma.c \ + test_read_format_cpio_bin_xz.c \ + test_read_format_cpio_filename.c \ + test_read_format_cpio_odc.c \ + test_read_format_cpio_svr4_gzip.c \ + test_read_format_cpio_svr4c_Z.c \ + test_read_format_cpio_svr4_bzip2_rpm.c \ + test_read_format_cpio_svr4_gzip_rpm.c \ + test_read_format_empty.c \ + test_read_format_gtar_filename.c \ + test_read_format_gtar_gz.c \ + test_read_format_gtar_lzma.c \ + test_read_format_gtar_redundant_L.c \ + test_read_format_gtar_sparse.c \ + test_read_format_gtar_sparse_length.c \ + test_read_format_gtar_sparse_skip_entry.c \ + test_read_format_huge_rpm.c \ + test_read_format_iso_Z.c \ + test_read_format_iso_multi_extent.c \ + test_read_format_iso_xorriso.c \ ++ test_read_format_iso_zisofs_overflow.c \ + test_read_format_isorr_rr_moved.c \ + test_read_format_isojoliet_bz2.c \ + test_read_format_isojoliet_long.c \ + test_read_format_isojoliet_rr.c \ + test_read_format_isojoliet_versioned.c \ + test_read_format_isorr_bz2.c \ + test_read_format_isorr_ce.c \ + test_read_format_isorr_new_bz2.c \ + test_read_format_isozisofs_bz2.c \ + test_read_format_lha.c \ + test_read_format_lha_bugfix_0.c \ + test_read_format_lha_filename.c \ + test_read_format_lha_filename_utf16.c \ ++ test_read_format_lha_oversize_header.c \ + test_read_format_mtree.c \ + test_read_format_mtree_crash747.c \ + test_read_format_pax_bz2.c \ + test_read_format_rar.c \ ++ test_read_format_rar5_loop_bug.c \ + test_read_format_rar5.c \ + test_read_format_rar_encryption.c \ + test_read_format_rar_encryption_data.c \ + test_read_format_rar_encryption_header.c \ + test_read_format_rar_encryption_partially.c \ + test_read_format_rar_filter.c \ + test_read_format_rar_invalid1.c \ + test_read_format_rar_overflow.c \ + test_read_format_raw.c \ + test_read_format_tar.c \ + test_read_format_tar_V_negative_size.c \ + test_read_format_tar_concatenated.c \ + test_read_format_tar_empty_filename.c \ + test_read_format_tar_empty_pax.c \ + test_read_format_tar_empty_with_gnulabel.c \ + test_read_format_tar_filename.c \ + test_read_format_tar_invalid_pax_size.c \ + test_read_format_tar_mac_metadata.c \ + test_read_format_tar_pax_g_large.c \ + test_read_format_tar_pax_large_attr.c \ + test_read_format_tar_pax_negative_time.c \ + test_read_format_tbz.c \ + test_read_format_tgz.c \ + test_read_format_tlz.c \ + test_read_format_txz.c \ + test_read_format_tz.c \ + test_read_format_ustar_filename.c \ + test_read_format_warc.c \ + test_read_format_xar.c \ + test_read_format_xar_doublelink.c \ + test_read_format_zip.c \ + test_read_format_zip_7075_utf8_paths.c \ + test_read_format_zip_comment_stored.c \ + test_read_format_zip_encryption_data.c \ + test_read_format_zip_encryption_header.c \ + test_read_format_zip_encryption_partially.c \ + test_read_format_zip_extra_padding.c \ + test_read_format_zip_filename.c \ + test_read_format_zip_high_compression.c \ + test_read_format_zip_jar.c \ + test_read_format_zip_mac_metadata.c \ + test_read_format_zip_malformed.c \ + test_read_format_zip_msdos.c \ + test_read_format_zip_nested.c \ + test_read_format_zip_nofiletype.c \ + test_read_format_zip_padded.c \ + test_read_format_zip_sfx.c \ + test_read_format_zip_traditional_encryption_data.c \ + test_read_format_zip_winzip_aes.c \ + test_read_format_zip_winzip_aes_large.c \ + test_read_format_zip_with_invalid_traditional_eocd.c \ + test_read_format_zip_zip64.c \ + test_read_large.c \ + test_read_pax_empty_val_no_nl.c \ + test_read_pax_xattr_rht_security_selinux.c \ + test_read_pax_xattr_schily.c \ + test_read_pax_truncated.c \ + test_read_position.c \ + test_read_set_format.c \ + test_read_too_many_filters.c \ + test_read_truncated.c \ + test_read_truncated_filter.c \ + test_short_writes.c \ + test_sparse_basic.c \ + test_tar_filenames.c \ + test_tar_large.c \ ++ test_v7tar_filename_encoding.c \ + test_warn_missing_hardlink_target.c \ + test_ustar_filenames.c \ + test_ustar_filename_encoding.c \ + test_write_disk.c \ + test_write_disk_appledouble.c \ + test_write_disk_failures.c \ + test_write_disk_fixup.c \ + test_write_disk_hardlink.c \ + test_write_disk_hfs_compression.c \ + test_write_disk_lookup.c \ + test_write_disk_mac_metadata.c \ + test_write_disk_no_hfs_compression.c \ + test_write_disk_perms.c \ + test_write_disk_secure.c \ + test_write_disk_secure_noabsolutepaths.c \ + test_write_disk_secure744.c \ + test_write_disk_secure745.c \ + test_write_disk_secure746.c \ + test_write_disk_sparse.c \ + test_write_disk_symlink.c \ + test_write_disk_times.c \ + test_write_filter_b64encode.c \ + test_write_filter_bzip2.c \ + test_write_filter_compress.c \ + test_write_filter_gzip.c \ + test_write_filter_gzip_timestamp.c \ + test_write_filter_lrzip.c \ + test_write_filter_lz4.c \ + test_write_filter_lzip.c \ + test_write_filter_lzma.c \ + test_write_filter_lzop.c \ + test_write_filter_program.c \ + test_write_filter_uuencode.c \ + test_write_filter_xz.c \ + test_write_filter_zstd.c \ + test_write_format_7zip.c \ + test_write_format_7zip_empty.c \ + test_write_format_7zip_large.c \ + test_write_format_ar.c \ + test_write_format_cpio.c \ + test_write_format_cpio_empty.c \ + test_write_format_cpio_newc.c \ + test_write_format_cpio_odc.c \ + test_write_format_gnutar.c \ + test_write_format_gnutar_filenames.c \ + test_write_format_iso9660.c \ + test_write_format_iso9660_boot.c \ + test_write_format_iso9660_empty.c \ + test_write_format_iso9660_filename.c \ + test_write_format_iso9660_zisofs.c \ + test_write_format_mtree.c \ + test_write_format_mtree_absolute_path.c \ + test_write_format_mtree_classic.c \ + test_write_format_mtree_classic_indent.c \ + test_write_format_mtree_fflags.c \ + test_write_format_mtree_no_separator.c \ + test_write_format_mtree_preset_digests.c \ + test_write_format_mtree_quoted_filename.c \ + test_write_format_pax.c \ + test_write_format_raw.c \ + test_write_format_raw_b64.c \ + test_write_format_shar_empty.c \ + test_write_format_tar.c \ + test_write_format_tar_empty.c \ + test_write_format_tar_sparse.c \ + test_write_format_tar_ustar.c \ + test_write_format_tar_v7tar.c \ + test_write_format_warc.c \ + test_write_format_warc_empty.c \ + test_write_format_xar.c \ + test_write_format_xar_empty.c \ + test_write_format_zip.c \ + test_write_format_zip_compression_store.c \ + test_write_format_zip_compression_zstd.c \ + test_write_format_zip_compression_bzip2.c \ + test_write_format_zip_compression_lzmaxz.c \ + test_write_format_zip_empty.c \ + test_write_format_zip_empty_zip64.c \ + test_write_format_zip_entry_size_unset.c \ + test_write_format_zip_file.c \ + test_write_format_zip_file_zip64.c \ + test_write_format_zip_large.c \ + test_write_format_zip_zip64.c \ + test_write_format_zip64_stream.c \ + test_write_format_zip_stream.c \ + test_write_format_zip_windows_path.c \ + test_write_open_memory.c \ + test_write_read_format_zip.c \ + test_xattr_platform.c \ + test_zip_filename_encoding.c + +# Deterministic failures: +# Fails with `test_read_disk_directory_traversals.c:1094: File at has atime 886622, 1443306049 seconds ago` +BROKEN_TESTS+= test_read_disk_directory_traversals + +.if 0 +# test_fuzz.c is not a real test, but rather a simple fuzz-test using random(). +# Since this is not a regression/unit test, we don't include it by default. +# If you would still like to include it, comment out the `.if 0`. +TEST_SCRCS+= test_fuzz.c +${PACKAGE}FILES+= test_fuzz.cab.uu +${PACKAGE}FILES+= test_fuzz.lzh.uu +${PACKAGE}FILES+= test_fuzz_1.iso.Z.uu +# Non-deterministic failures: +# (Times out?) [and] crashes +BROKEN_TESTS+= test_fuzz_rar +.endif + +# Build the test program. +SRCS.libarchive_test= \ + ${TESTS_SRCS} \ + read_open_memory.c \ + list.h + +LIBADD.libarchive_test= archive + +.PATH: ${_LIBARCHIVEDIR}/test_utils +SRCS.libarchive_test+= test_main.c \ + test_utils.c + +# list.h is just a list of all tests, as indicated by DEFINE_TEST macro lines +list.h: ${TESTS_SRCS} Makefile + @(cd ${_LIBARCHIVEDIR}/libarchive/test && \ + grep -E -h ^DEFINE_TEST ${.ALLSRC:N*Makefile} | \ + egrep -v '${BROKEN_TESTS:tW:C/ /|/g}') > ${.TARGET}.tmp + @mv ${.TARGET}.tmp ${.TARGET} + +CLEANTESTS+= list.h list.h.tmp +${PACKAGE}FILES+= README +${PACKAGE}FILES+= test_acl_pax_posix1e.tar.uu +${PACKAGE}FILES+= test_acl_pax_nfs4.tar.uu +${PACKAGE}FILES+= test_archive_string_conversion.txt.Z.uu +${PACKAGE}FILES+= test_compat_bzip2_1.tbz.uu +${PACKAGE}FILES+= test_compat_bzip2_2.tbz.uu +${PACKAGE}FILES+= test_compat_cpio_1.cpio.uu +${PACKAGE}FILES+= test_compat_gtar_1.tar.uu +${PACKAGE}FILES+= test_compat_gtar_2.tar.uu +${PACKAGE}FILES+= test_compat_gzip_1.tgz.uu +${PACKAGE}FILES+= test_compat_gzip_2.tgz.uu +${PACKAGE}FILES+= test_compat_lz4_1.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_2.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_3.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B4.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B4BD.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B4BDBX.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B5.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B5BD.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B6.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B6BD.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B7.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_B7BD.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lz4_skippable_frames_B4.tar.lz4.uu +${PACKAGE}FILES+= test_compat_lzip_1.tlz.uu +${PACKAGE}FILES+= test_compat_lzip_2.tlz.uu +${PACKAGE}FILES+= test_compat_lzip_3.lz.uu +${PACKAGE}FILES+= test_compat_lzip_4.tlz.uu +${PACKAGE}FILES+= test_compat_lzma_1.tlz.uu +${PACKAGE}FILES+= test_compat_lzma_2.tlz.uu +${PACKAGE}FILES+= test_compat_lzma_3.tlz.uu +${PACKAGE}FILES+= test_compat_lzop_1.tar.lzo.uu +${PACKAGE}FILES+= test_compat_lzop_2.tar.lzo.uu +${PACKAGE}FILES+= test_compat_lzop_3.tar.lzo.uu +${PACKAGE}FILES+= test_compat_mac-1.tar.Z.uu +${PACKAGE}FILES+= test_compat_mac-2.tar.Z.uu +${PACKAGE}FILES+= test_compat_perl_archive_tar.tar.uu +${PACKAGE}FILES+= test_compat_plexus_archiver_tar.tar.uu +${PACKAGE}FILES+= test_compat_solaris_pax_sparse_1.pax.Z.uu +${PACKAGE}FILES+= test_compat_solaris_pax_sparse_2.pax.Z.uu +${PACKAGE}FILES+= test_compat_solaris_tar_acl.tar.uu +${PACKAGE}FILES+= test_compat_star_acl_nfs4.tar.uu +${PACKAGE}FILES+= test_compat_star_acl_posix1e.tar.uu +${PACKAGE}FILES+= test_compat_tar_directory_1.tar.uu +${PACKAGE}FILES+= test_compat_tar_hardlink_1.tar.uu +${PACKAGE}FILES+= test_compat_uudecode_large.tar.Z.uu +${PACKAGE}FILES+= test_compat_xz_1.txz.uu +${PACKAGE}FILES+= test_compat_zip_1.zip.uu +${PACKAGE}FILES+= test_compat_zip_2.zip.uu +${PACKAGE}FILES+= test_compat_zip_3.zip.uu +${PACKAGE}FILES+= test_compat_zip_4.zip.uu +${PACKAGE}FILES+= test_compat_zip_5.zip.uu +${PACKAGE}FILES+= test_compat_zip_6.zip.uu +${PACKAGE}FILES+= test_compat_zip_7.xps.uu +${PACKAGE}FILES+= test_compat_zip_8.zip.uu +${PACKAGE}FILES+= test_compat_zstd_1.tar.zst.uu +${PACKAGE}FILES+= test_compat_zstd_2.tar.zst.uu +${PACKAGE}FILES+= test_pax_filename_encoding.tar.uu +${PACKAGE}FILES+= test_pax_xattr_header_all.tar.uu +${PACKAGE}FILES+= test_pax_xattr_header_libarchive.tar.uu +${PACKAGE}FILES+= test_pax_xattr_header_schily.tar.uu +${PACKAGE}FILES+= test_rar_multivolume_multiple_files.part1.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_multiple_files.part2.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_multiple_files.part3.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_multiple_files.part4.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_multiple_files.part5.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_multiple_files.part6.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_single_file.part1.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_single_file.part2.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_single_file.part3.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part01.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part02.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part03.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part04.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part05.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part06.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part07.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part08.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part09.rar.uu +${PACKAGE}FILES+= test_rar_multivolume_uncompressed_files.part10.rar.uu +${PACKAGE}FILES+= test_read_filter_grzip.tar.grz.uu +${PACKAGE}FILES+= test_read_filter_gzip_recursive.gz.uu +${PACKAGE}FILES+= test_read_filter_lrzip.tar.lrz.uu +${PACKAGE}FILES+= test_read_filter_lzop.tar.lzo.uu +${PACKAGE}FILES+= test_read_filter_lzop_multiple_parts.tar.lzo.uu +${PACKAGE}FILES+= test_read_filter_uudecode_base64_raw.uu +${PACKAGE}FILES+= test_read_filter_uudecode_raw.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_bzip2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_copy_1.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_copy_2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_copy_lzma.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_deflate.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_deflate_arm64.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_deflate_powerpc.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_lzma1_1.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_lzma1_2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_lzma2_1.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj2_lzma2_2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj_bzip2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj_copy.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj_deflate.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj_lzma1.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bcj_lzma2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_bzip2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_copy.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_copy_2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_deflate.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_delta_lzma1.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_delta_lzma2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_delta4_lzma1.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_delta4_lzma2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_empty_archive.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_empty_file.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_encryption.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_encryption_header.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_encryption_partially.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_extract_second.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_issue2765.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma1.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma1_2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma1_lzma2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma2.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma2_arm.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma2_arm64.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma2_powerpc.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma2_riscv.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_lzma2_sparc.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_malformed.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_malformed2.7z.uu ++${PACKAGE}FILES+= test_read_format_7zip_malformed3.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_packinfo_digests.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_ppmd.7z.uu ++${PACKAGE}FILES+= test_read_format_7zip_sfx_elf64trunc.elf.uu +${PACKAGE}FILES+= test_read_format_7zip_sfx_elf.elf.uu +${PACKAGE}FILES+= test_read_format_7zip_sfx_modified_pe.exe.uu +${PACKAGE}FILES+= test_read_format_7zip_sfx_pe.exe.uu +${PACKAGE}FILES+= test_read_format_7zip_solid_zstd.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_symbolic_name.7z.uu +${PACKAGE}FILES+= test_read_format_7zip_zstd.7z.uu *** 284 LINES SKIPPED *** From nobody Mon Apr 13 14:16:56 2026 X-Original-To: dev-commits-src-main@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 4fvTxP1JtNz6ZDTZ for ; Mon, 13 Apr 2026 14:16:57 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvTxN6c1yz3njf for ; Mon, 13 Apr 2026 14:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776089816; 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=UjUYuH+SrCdc3VRYm4nTBVBMFdygHkYSXuERpAXfWUk=; b=we/qAdmaVlUU5ZVN46fLknRINv3MesxTo20FFlxN/MWSt8yf1MTJutD+fSoZFOizLdvVGG ludYMtStxZCk94CQ7yegzc4uMuAr1Acjo6LtPi1AssfZR1NA9lO++H2bH8OiyK3vOmLKg8 0Wt/fz5SBHI7CIyqYMhw1e2nnf3mqi8rSQS44FfK6Nx5FcYOngP6byTDFW9sguk36o09ON G6OdZz99byF3nvWqjNddaQnKlSG9XumKe1SNdrQM5jD+tpTMIBuamiGVkmshWzX6OoVxkM rAmagTdxguY7iwe4VDbV3XFzB/pIHlWrMh3whGzEcpl/Gc32qR6GIYW5thUCHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776089816; a=rsa-sha256; cv=none; b=NiFJ61+CASAH+tlPE3WTajGExegY6YS0r8yzuiWnEOGB1tZtezU/QMdiuTg+WCJUwTQWr7 sWq0u0TjdLuz0F5flEMLYBedB8x/gtcVrNwlLTAUhqiiXfA/qkxkoiXsM9zff2k4L8OEAD 6MjqmQUrgGZggDes1xY5w+gwOldMYCdYOk8jjSzhg/veWcNnNtEl8fiTW5BRBAznKKBlc8 D58DdfaI6noekom7n1zG9ej4SvDLB3zWAN2KKYVcHBDc0AM7FYV8cQANBrZNxQWo4UkZYx mTXE8ncN2a6s7MNECD5Ui3bMgSzh8EefohmINGcoNRyT1qnVzSMsxkPibwRHfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776089816; 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=UjUYuH+SrCdc3VRYm4nTBVBMFdygHkYSXuERpAXfWUk=; b=fzcXTZoDj9pnXInRI+IL2IMWa/nHYYIsPsUDzfCZg0Y9IiztnLxNk1zmZET7r3A2hpeU7o VS7ZI8cskrSVqWyH65lTvrp8ZX2JIA30vMwoObbpNhoyF7U7t2ATBnuheZ/GE0OQF6if+B fqgVAIZmQdMTwf4/E/pbFS4MyT3HH6w43SH5EMAVgqqjgRt36IFN0lv0m/RsT9lbf3mD66 wYELJ6Uu/1AQGnVWiYJz0wnr8VCDd6kB8DZLJgzoSpfF/lqulAh138lyAv3+HCunBEgcSR CWkmjh3qsULHYg+ufbeZdfKvhQn6JImcZM+FeVfiDf7Wl88uSdIZgluxdvH6Cw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvTxN6ByZz16gj for ; Mon, 13 Apr 2026 14:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47191 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 14:16:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: e44d2e941e8e - main - if_geneve: Add Support for Geneve (RFC8926) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e44d2e941e8ebd74e6a1b1fdbed83fe86671cbc6 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 14:16:56 +0000 Message-Id: <69dcfad8.47191.15534965@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=e44d2e941e8ebd74e6a1b1fdbed83fe86671cbc6 commit e44d2e941e8ebd74e6a1b1fdbed83fe86671cbc6 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-11 14:12:01 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-13 14:14:58 +0000 if_geneve: Add Support for Geneve (RFC8926) geneve creates a generic network virtualization tunnel interface for Tentant Systems over an L3 (IP/UDP) underlay network that provides a Layer 2 (ethernet) or Layer 3 service using the geneve protocol. This implementation is based on RFC8926. Reviewed by: glebius, adrian Discussed with: zlei, kp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D54172 --- sys/conf/NOTES | 4 + sys/conf/files | 1 + sys/kern/kern_jail.c | 1 + sys/modules/Makefile | 1 + sys/modules/if_geneve/Makefile | 7 + sys/net/if.c | 2 + sys/net/if.h | 6 +- sys/net/if_geneve.c | 3967 ++++++++++++++++++++++++++++++++++++++++ sys/net/if_geneve.h | 70 + sys/net/if_strings.h | 12 +- sys/netlink/route/interface.h | 44 + sys/sys/mbuf.h | 6 +- sys/sys/priv.h | 1 + 13 files changed, 4115 insertions(+), 7 deletions(-) diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 4dda93e2ee70..4279fae4c547 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -880,6 +880,10 @@ device vlan # frames in UDP packets according to RFC7348. device vxlan +# The `geneve' device implements the GENEVE encapsulation of virtual +# overlays according to RFC8926. +device geneve + # The `wlan' device provides generic code to support 802.11 # drivers, including host AP mode; it is MANDATORY for the wi, # and ath drivers and will eventually be required by all 802.11 drivers. diff --git a/sys/conf/files b/sys/conf/files index b44fb46ef764..99ba7cdaba33 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -4238,6 +4238,7 @@ net/if_stf.c optional stf inet inet6 net/if_tuntap.c optional tuntap net/if_vlan.c optional vlan net/if_vxlan.c optional vxlan inet | vxlan inet6 +net/if_geneve.c optional geneve inet | geneve inet6 net/ifdi_if.m optional ether pci iflib net/iflib.c optional ether pci iflib net/mp_ring.c optional ether iflib diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index 384825b7f8ac..bc80adb91cd6 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -4385,6 +4385,7 @@ prison_priv_check(struct ucred *cred, int priv) case PRIV_NET_SETIFVNET: case PRIV_NET_SETIFFIB: case PRIV_NET_OVPN: + case PRIV_NET_GENEVE: case PRIV_NET_ME: case PRIV_NET_WG: diff --git a/sys/modules/Makefile b/sys/modules/Makefile index a4100c31ef26..faedb856977c 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -169,6 +169,7 @@ SUBDIR= \ if_tuntap \ if_vlan \ if_vxlan \ + if_geneve \ ${_if_wg} \ iflib \ ${_igc} \ diff --git a/sys/modules/if_geneve/Makefile b/sys/modules/if_geneve/Makefile new file mode 100644 index 000000000000..1e65d4dbb168 --- /dev/null +++ b/sys/modules/if_geneve/Makefile @@ -0,0 +1,7 @@ +.PATH: ${SRCTOP}/sys/net + +KMOD= if_geneve +SRCS= if_geneve.c +SRCS+= opt_inet.h opt_inet6.h + +.include diff --git a/sys/net/if.c b/sys/net/if.c index 760ae94e842b..8a148ba0fd06 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2273,6 +2273,8 @@ const struct ifcap_nv_bit_name ifcap2_nv_bit_names[] = { CAP2NV(RXTLS4), CAP2NV(RXTLS6), CAP2NV(IPSEC_OFFLOAD), + CAP2NV(GENEVE_HWCSUM), + CAP2NV(GENEVE_HWTSO), {0, NULL} }; #undef CAPNV diff --git a/sys/net/if.h b/sys/net/if.h index 1b47237e46bb..4bb6a2659ce7 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -255,7 +255,9 @@ struct if_data { #define IFCAP_B_RXTLS4 32 /* can do TLS receive for TCP */ #define IFCAP_B_RXTLS6 33 /* can do TLS receive for TCP6 */ #define IFCAP_B_IPSEC_OFFLOAD 34 /* inline IPSEC offload */ -#define __IFCAP_B_SIZE 35 +#define IFCAP_B_GENEVE_HWCSUM 35 /* can do IFCAN_HWCSUM on GENEVE */ +#define IFCAP_B_GENEVE_HWTSO 36 /* can do IFCAP_TSO on GENEVE */ +#define __IFCAP_B_SIZE 37 #define IFCAP_B_MAX (__IFCAP_B_MAX - 1) #define IFCAP_B_SIZE (__IFCAP_B_SIZE) @@ -299,6 +301,8 @@ struct if_data { #define IFCAP2_RXTLS4 (IFCAP_B_RXTLS4 - 32) #define IFCAP2_RXTLS6 (IFCAP_B_RXTLS6 - 32) #define IFCAP2_IPSEC_OFFLOAD (IFCAP_B_IPSEC_OFFLOAD - 32) +#define IFCAP2_GENEVE_HWCSUM (IFCAP_B_GENEVE_HWCSUM - 32) +#define IFCAP2_GENEVE_HWTSO (IFCAP_B_GENEVE_HWTSO - 32) #define IFCAP2_BIT(x) (1UL << (x)) diff --git a/sys/net/if_geneve.c b/sys/net/if_geneve.c new file mode 100644 index 000000000000..9562a3476099 --- /dev/null +++ b/sys/net/if_geneve.c @@ -0,0 +1,3967 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025-2026 Pouria Mousavizadeh Tehrani + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_inet.h" +#include "opt_inet6.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +SDT_PROVIDER_DEFINE(if_geneve); + +struct geneve_softc; +LIST_HEAD(geneve_softc_head, geneve_softc); + +static struct sx geneve_sx; +SX_SYSINIT(geneve, &geneve_sx, "GENEVE global start/stop lock"); + +static unsigned geneve_osd_jail_slot; + +union sockaddr_union { + struct sockaddr sa; + struct sockaddr_in sin; + struct sockaddr_in6 sin6; +}; + +struct geneve_socket_mc_info { + union sockaddr_union gnvsomc_saddr; + union sockaddr_union gnvsomc_gaddr; + int gnvsomc_ifidx; + int gnvsomc_users; +}; + +/* The maximum MTU of encapsulated geneve packet. */ +#define GENEVE_MAX_L3MTU (IP_MAXPACKET - \ + 60 /* Maximum IPv4 header len */ - \ + sizeof(struct udphdr) - \ + sizeof(struct genevehdr)) +#define GENEVE_MAX_MTU (GENEVE_MAX_L3MTU - \ + ETHER_HDR_LEN - ETHER_VLAN_ENCAP_LEN) + +#define GENEVE_BASIC_IFCAPS (IFCAP_LINKSTATE | IFCAP_JUMBO_MTU | IFCAP_NV) + +#define GENEVE_VERSION 0 +#define GENEVE_VNI_MASK (GENEVE_VNI_MAX - 1) + +#define GENEVE_HDR_VNI_SHIFT 8 + +#define GENEVE_SO_MC_MAX_GROUPS 32 + +#define GENEVE_SO_VNI_HASH_SHIFT 6 +#define GENEVE_SO_VNI_HASH_SIZE (1 << GENEVE_SO_VNI_HASH_SHIFT) +#define GENEVE_SO_VNI_HASH(_vni) ((_vni) % GENEVE_SO_VNI_HASH_SIZE) + +struct geneve_socket { + struct socket *gnvso_sock; + struct rmlock gnvso_lock; + u_int gnvso_refcnt; + union sockaddr_union gnvso_laddr; + LIST_ENTRY(geneve_socket) gnvso_entry; + struct geneve_softc_head gnvso_vni_hash[GENEVE_SO_VNI_HASH_SIZE]; + struct geneve_socket_mc_info gnvso_mc[GENEVE_SO_MC_MAX_GROUPS]; +}; + +#define GENEVE_SO_RLOCK(_gnvso, _p) rm_rlock(&(_gnvso)->gnvso_lock, (_p)) +#define GENEVE_SO_RUNLOCK(_gnvso, _p) rm_runlock(&(_gnvso)->gnvso_lock, (_p)) +#define GENEVE_SO_WLOCK(_gnvso) rm_wlock(&(_gnvso)->gnvso_lock) +#define GENEVE_SO_WUNLOCK(_gnvso) rm_wunlock(&(_gnvso)->gnvso_lock) +#define GENEVE_SO_LOCK_ASSERT(_gnvso) \ + rm_assert(&(_gnvso)->gnvso_lock, RA_LOCKED) +#define GENEVE_SO_LOCK_WASSERT(_gnvso) \ + rm_assert(&(_gnvso)->gnvso_lock, RA_WLOCKED) + +#define GENEVE_SO_ACQUIRE(_gnvso) refcount_acquire(&(_gnvso)->gnvso_refcnt) +#define GENEVE_SO_RELEASE(_gnvso) refcount_release(&(_gnvso)->gnvso_refcnt) + +struct gnv_ftable_entry { + LIST_ENTRY(gnv_ftable_entry) gnvfe_hash; + uint16_t gnvfe_flags; + uint8_t gnvfe_mac[ETHER_ADDR_LEN]; + union sockaddr_union gnvfe_raddr; + time_t gnvfe_expire; +}; + +#define GENEVE_FE_FLAG_DYNAMIC 0x01 +#define GENEVE_FE_FLAG_STATIC 0x02 + +#define GENEVE_FE_IS_DYNAMIC(_fe) \ + ((_fe)->gnvfe_flags & GENEVE_FE_FLAG_DYNAMIC) + +#define GENEVE_SC_FTABLE_SHIFT 9 +#define GENEVE_SC_FTABLE_SIZE (1 << GENEVE_SC_FTABLE_SHIFT) +#define GENEVE_SC_FTABLE_MASK (GENEVE_SC_FTABLE_SIZE - 1) +#define GENEVE_SC_FTABLE_HASH(_sc, _mac) \ + (geneve_mac_hash(_sc, _mac) % GENEVE_SC_FTABLE_SIZE) + +LIST_HEAD(geneve_ftable_head, gnv_ftable_entry); + +struct geneve_statistics { + uint32_t ftable_nospace; + uint32_t ftable_lock_upgrade_failed; + counter_u64_t txcsum; + counter_u64_t tso; + counter_u64_t rxcsum; +}; + +struct geneve_softc { + LIST_ENTRY(geneve_softc) gnv_entry; + + struct ifnet *gnv_ifp; + uint32_t gnv_flags; +#define GENEVE_FLAG_INIT 0x0001 +#define GENEVE_FLAG_RUNNING 0x0002 +#define GENEVE_FLAG_TEARDOWN 0x0004 +#define GENEVE_FLAG_LEARN 0x0008 +#define GENEVE_FLAG_USER_MTU 0x0010 +#define GENEVE_FLAG_TTL_INHERIT 0x0020 +#define GENEVE_FLAG_DSCP_INHERIT 0x0040 +#define GENEVE_FLAG_COLLECT_METADATA 0x0080 + + int gnv_reqcap; + int gnv_reqcap2; + struct geneve_socket *gnv_sock; + union sockaddr_union gnv_src_addr; + union sockaddr_union gnv_dst_addr; + uint32_t gnv_fibnum; + uint32_t gnv_vni; + uint32_t gnv_port_hash_key; + uint16_t gnv_proto; + uint16_t gnv_min_port; + uint16_t gnv_max_port; + uint8_t gnv_ttl; + enum ifla_geneve_df gnv_df; + + /* Lookup table from MAC address to forwarding entry. */ + uint32_t gnv_ftable_cnt; + uint32_t gnv_ftable_max; + uint32_t gnv_ftable_timeout; + uint32_t gnv_ftable_hash_key; + struct geneve_ftable_head *gnv_ftable; + + /* Derived from gnv_dst_addr. */ + struct gnv_ftable_entry gnv_default_fe; + + struct ip_moptions *gnv_im4o; + struct ip6_moptions *gnv_im6o; + + struct rmlock gnv_lock; + volatile u_int gnv_refcnt; + + int gnv_so_mc_index; + struct geneve_statistics gnv_stats; + struct callout gnv_callout; + struct ether_addr gnv_hwaddr; + int gnv_mc_ifindex; + struct ifnet *gnv_mc_ifp; + struct ifmedia gnv_media; + char gnv_mc_ifname[IFNAMSIZ]; + + /* For rate limiting errors on the tx fast path. */ + struct timeval err_time; + int err_pps; +}; + +#define GENEVE_RLOCK(_sc, _p) rm_rlock(&(_sc)->gnv_lock, (_p)) +#define GENEVE_RUNLOCK(_sc, _p) rm_runlock(&(_sc)->gnv_lock, (_p)) +#define GENEVE_WLOCK(_sc) rm_wlock(&(_sc)->gnv_lock) +#define GENEVE_WUNLOCK(_sc) rm_wunlock(&(_sc)->gnv_lock) +#define GENEVE_LOCK_WOWNED(_sc) rm_wowned(&(_sc)->gnv_lock) +#define GENEVE_LOCK_ASSERT(_sc) rm_assert(&(_sc)->gnv_lock, RA_LOCKED) +#define GENEVE_LOCK_WASSERT(_sc) rm_assert(&(_sc)->gnv_lock, RA_WLOCKED) +#define GENEVE_UNLOCK(_sc, _p) do { \ + if (GENEVE_LOCK_WOWNED(_sc)) \ + GENEVE_WUNLOCK(_sc); \ + else \ + GENEVE_RUNLOCK(_sc, _p); \ +} while (0) + +#define GENEVE_ACQUIRE(_sc) refcount_acquire(&(_sc)->gnv_refcnt) +#define GENEVE_RELEASE(_sc) refcount_release(&(_sc)->gnv_refcnt) + +#define SATOCONSTSIN(sa) ((const struct sockaddr_in *)(sa)) +#define SATOCONSTSIN6(sa) ((const struct sockaddr_in6 *)(sa)) + +struct geneve_pkt_info { + u_int isr; + uint16_t ethertype; + uint8_t ecn; + uint8_t ttl; +}; + +struct nl_parsed_geneve { + /* essential */ + uint32_t ifla_vni; + uint16_t ifla_proto; + struct sockaddr *ifla_local; + struct sockaddr *ifla_remote; + uint16_t ifla_local_port; + uint16_t ifla_remote_port; + + /* optional */ + struct ifla_geneve_port_range ifla_port_range; + enum ifla_geneve_df ifla_df; + uint8_t ifla_ttl; + bool ifla_ttl_inherit; + bool ifla_dscp_inherit; + bool ifla_external; + + /* l2 specific */ + bool ifla_ftable_learn; + bool ifla_ftable_flush; + uint32_t ifla_ftable_max; + uint32_t ifla_ftable_timeout; + uint32_t ifla_ftable_count; /* read-only */ + + /* multicast specific */ + char *ifla_mc_ifname; + uint32_t ifla_mc_ifindex; /* read-only */ +}; + +/* The multicast-based learning parts of the code are taken from if_vxlan */ +static int geneve_ftable_addr_cmp(const uint8_t *, const uint8_t *); +static void geneve_ftable_init(struct geneve_softc *); +static void geneve_ftable_fini(struct geneve_softc *); +static void geneve_ftable_flush(struct geneve_softc *, int); +static void geneve_ftable_expire(struct geneve_softc *); +static int geneve_ftable_update_locked(struct geneve_softc *, + const union sockaddr_union *, const uint8_t *, + struct rm_priotracker *); +static int geneve_ftable_learn(struct geneve_softc *, + const struct sockaddr *, const uint8_t *); + +static struct gnv_ftable_entry * + geneve_ftable_entry_alloc(void); +static void geneve_ftable_entry_free(struct gnv_ftable_entry *); +static void geneve_ftable_entry_init(struct geneve_softc *, + struct gnv_ftable_entry *, const uint8_t *, + const struct sockaddr *, uint32_t); +static void geneve_ftable_entry_destroy(struct geneve_softc *, + struct gnv_ftable_entry *); +static int geneve_ftable_entry_insert(struct geneve_softc *, + struct gnv_ftable_entry *); +static struct gnv_ftable_entry * + geneve_ftable_entry_lookup(struct geneve_softc *, + const uint8_t *); + +static struct geneve_socket * + geneve_socket_alloc(union sockaddr_union *laddr); +static void geneve_socket_destroy(struct geneve_socket *); +static void geneve_socket_release(struct geneve_socket *); +static struct geneve_socket * + geneve_socket_lookup(union sockaddr_union *); +static void geneve_socket_insert(struct geneve_socket *); +static int geneve_socket_init(struct geneve_socket *, struct ifnet *); +static int geneve_socket_bind(struct geneve_socket *, struct ifnet *); +static int geneve_socket_create(struct ifnet *, int, + const union sockaddr_union *, struct geneve_socket **); +static int geneve_socket_set_df(struct geneve_socket *, bool); + +static struct geneve_socket * + geneve_socket_mc_lookup(const union sockaddr_union *); +static int geneve_sockaddr_mc_info_match( + const struct geneve_socket_mc_info *, + const union sockaddr_union *, + const union sockaddr_union *, int); +static int geneve_socket_mc_join_group(struct geneve_socket *, + const union sockaddr_union *, const union sockaddr_union *, + int *, union sockaddr_union *); +static int geneve_socket_mc_leave_group(struct geneve_socket *, + const union sockaddr_union *, + const union sockaddr_union *, int); +static int geneve_socket_mc_add_group(struct geneve_socket *, + const union sockaddr_union *, + const union sockaddr_union *, int, int *); +static void geneve_socket_mc_release_group(struct geneve_socket *, int); + +static struct geneve_softc * + geneve_socket_lookup_softc_locked(struct geneve_socket *, + uint32_t); +static struct geneve_softc * + geneve_socket_lookup_softc(struct geneve_socket *, uint32_t); +static int geneve_socket_insert_softc(struct geneve_socket *, + struct geneve_softc *); +static void geneve_socket_remove_softc(struct geneve_socket *, + struct geneve_softc *); + +static struct ifnet * + geneve_multicast_if_ref(struct geneve_softc *, uint32_t); +static void geneve_free_multicast(struct geneve_softc *); +static int geneve_setup_multicast_interface(struct geneve_softc *); + +static int geneve_setup_multicast(struct geneve_softc *); +static int geneve_setup_socket(struct geneve_softc *); +static void geneve_setup_interface_hdrlen(struct geneve_softc *); +static int geneve_valid_init_config(struct geneve_softc *); +static void geneve_init_complete(struct geneve_softc *); +static void geneve_init(void *); +static void geneve_release(struct geneve_softc *); +static void geneve_teardown_wait(struct geneve_softc *); +static void geneve_teardown_locked(struct geneve_softc *); +static void geneve_teardown(struct geneve_softc *); +static void geneve_timer(void *); + +static int geneve_flush_ftable(struct geneve_softc *, bool); +static uint16_t geneve_get_local_port(struct geneve_softc *); +static uint16_t geneve_get_remote_port(struct geneve_softc *); + +static int geneve_set_vni_nl(struct geneve_softc *, struct nl_pstate *, + uint32_t); +static int geneve_set_local_addr_nl(struct geneve_softc *, struct nl_pstate *, + struct sockaddr *); +static int geneve_set_remote_addr_nl(struct geneve_softc *, struct nl_pstate *, + struct sockaddr *); +static int geneve_set_local_port_nl(struct geneve_softc *, struct nl_pstate *, + uint16_t); +static int geneve_set_remote_port_nl(struct geneve_softc *, struct nl_pstate *, + uint16_t); +static int geneve_set_port_range_nl(struct geneve_softc *, struct nl_pstate *, + struct ifla_geneve_port_range); +static int geneve_set_df_nl(struct geneve_softc *, struct nl_pstate *, + enum ifla_geneve_df); +static int geneve_set_ttl_nl(struct geneve_softc *, struct nl_pstate *, + uint8_t); +static int geneve_set_ttl_inherit_nl(struct geneve_softc *, struct nl_pstate *, + bool); +static int geneve_set_dscp_inherit_nl(struct geneve_softc *, struct nl_pstate *, + bool); +static int geneve_set_collect_metadata_nl(struct geneve_softc *, + struct nl_pstate *, bool); +static int geneve_set_learn_nl(struct geneve_softc *, struct nl_pstate *, + bool); +static int geneve_set_ftable_max_nl(struct geneve_softc *, struct nl_pstate *, + uint32_t); +static int geneve_set_ftable_timeout_nl(struct geneve_softc *, + struct nl_pstate *, uint32_t); +static int geneve_set_mc_if_nl(struct geneve_softc *, struct nl_pstate *, + char *); +static int geneve_flush_ftable_nl(struct geneve_softc *, struct nl_pstate *, + bool); +static void geneve_get_local_addr_nl(struct geneve_softc *, struct nl_writer *); +static void geneve_get_remote_addr_nl(struct geneve_softc *, struct nl_writer *); + +static int geneve_ioctl_ifflags(struct geneve_softc *); +static int geneve_ioctl(struct ifnet *, u_long, caddr_t); + +static uint16_t geneve_pick_source_port(struct geneve_softc *, struct mbuf *); +static void geneve_encap_header(struct geneve_softc *, struct mbuf *, + int, uint16_t, uint16_t, uint16_t); +static uint16_t geneve_get_ethertype(struct mbuf *); +static int geneve_inherit_l3_hdr(struct mbuf *, struct geneve_softc *, + uint16_t, uint8_t *, uint8_t *, u_short *); +static int geneve_encap4(struct geneve_softc *, + const union sockaddr_union *, struct mbuf *); +static int geneve_encap6(struct geneve_softc *, + const union sockaddr_union *, struct mbuf *); +static int geneve_transmit(struct ifnet *, struct mbuf *); +static void geneve_qflush(struct ifnet *); +static int geneve_output(struct ifnet *, struct mbuf *, + const struct sockaddr *, struct route *); +static uint32_t geneve_map_etype_to_af(uint32_t); +static bool geneve_udp_input(struct mbuf *, int, struct inpcb *, + const struct sockaddr *, void *); +static int geneve_input_ether(struct geneve_softc *, struct mbuf **, + const struct sockaddr *, struct geneve_pkt_info *); +static int geneve_input_inherit(struct geneve_softc *, + struct mbuf **, int, struct geneve_pkt_info *); +static int geneve_next_option(struct geneve_socket *, struct genevehdr *, + struct mbuf **); +static void geneve_input_csum(struct mbuf *m, struct ifnet *ifp, + counter_u64_t rxcsum); + +static void geneve_stats_alloc(struct geneve_softc *); +static void geneve_stats_free(struct geneve_softc *); +static void geneve_set_default_config(struct geneve_softc *); +static int geneve_set_reqcap(struct geneve_softc *, struct ifnet *, int, + int); +static void geneve_set_hwcaps(struct geneve_softc *); +static int geneve_clone_create(struct if_clone *, char *, size_t, + struct ifc_data *, struct ifnet **); +static int geneve_clone_destroy(struct if_clone *, struct ifnet *, + uint32_t); +static int geneve_clone_create_nl(struct if_clone *, char *, size_t, + struct ifc_data_nl *); +static int geneve_clone_modify_nl(struct ifnet *, struct ifc_data_nl *); +static void geneve_clone_dump_nl(struct ifnet *, struct nl_writer *); + +static uint32_t geneve_mac_hash(struct geneve_softc *, const uint8_t *); +static int geneve_media_change(struct ifnet *); +static void geneve_media_status(struct ifnet *, struct ifmediareq *); + +static int geneve_sockaddr_cmp(const union sockaddr_union *, + const struct sockaddr *); +static void geneve_sockaddr_copy(union sockaddr_union *, + const struct sockaddr *); +static int geneve_sockaddr_in_equal(const union sockaddr_union *, + const struct sockaddr *); +static void geneve_sockaddr_in_copy(union sockaddr_union *, + const struct sockaddr *); +static int geneve_sockaddr_supported(const union sockaddr_union *, int); +static int geneve_sockaddr_in_any(const union sockaddr_union *); + +static int geneve_can_change_config(struct geneve_softc *); +static int geneve_check_proto(uint16_t); +static int geneve_check_multicast_addr(const union sockaddr_union *); +static int geneve_check_sockaddr(const union sockaddr_union *, const int); + +static int geneve_prison_remove(void *, void *); +static void vnet_geneve_load(void); +static void vnet_geneve_unload(void); +static void geneve_module_init(void); +static void geneve_module_deinit(void); +static int geneve_modevent(module_t, int, void *); + + +static const char geneve_name[] = "geneve"; +static MALLOC_DEFINE(M_GENEVE, geneve_name, + "Generic Network Virtualization Encapsulation Interface"); +#define MTAG_GENEVE_LOOP 0x93d66dc0 /* geneve mtag */ + +VNET_DEFINE_STATIC(struct if_clone *, geneve_cloner); +#define V_geneve_cloner VNET(geneve_cloner) + +static struct mtx geneve_list_mtx; +#define GENEVE_LIST_LOCK() mtx_lock(&geneve_list_mtx) +#define GENEVE_LIST_UNLOCK() mtx_unlock(&geneve_list_mtx) + +static LIST_HEAD(, geneve_socket) geneve_socket_list = LIST_HEAD_INITIALIZER(geneve_socket_list); + +/* Default maximum number of addresses in the forwarding table. */ +#define GENEVE_FTABLE_MAX 2000 + +/* Timeout (in seconds) of addresses learned in the forwarding table. */ +#define GENEVE_FTABLE_TIMEOUT (20 * 60) + +/* Maximum timeout (in seconds) of addresses learned in the forwarding table. */ +#define GENEVE_FTABLE_MAX_TIMEOUT (60 * 60 * 24) + +/* Number of seconds between pruning attempts of the forwarding table. */ +#define GENEVE_FTABLE_PRUNE (5 * 60) + +static int geneve_ftable_prune_period = GENEVE_FTABLE_PRUNE; + +#define _OUT(_field) offsetof(struct nl_parsed_geneve, _field) +static const struct nlattr_parser nla_p_geneve_create[] = { + { .type = IFLA_GENEVE_PROTOCOL, .off = _OUT(ifla_proto), .cb = nlattr_get_uint16 }, +}; +#undef _OUT +NL_DECLARE_ATTR_PARSER(geneve_create_parser, nla_p_geneve_create); + +#define _OUT(_field) offsetof(struct nl_parsed_geneve, _field) +static const struct nlattr_parser nla_p_geneve[] = { + { .type = IFLA_GENEVE_ID, .off = _OUT(ifla_vni), .cb = nlattr_get_uint32 }, + { .type = IFLA_GENEVE_PROTOCOL, .off = _OUT(ifla_proto), .cb = nlattr_get_uint16 }, + { .type = IFLA_GENEVE_LOCAL, .off = _OUT(ifla_local), .cb = nlattr_get_ip }, + { .type = IFLA_GENEVE_REMOTE, .off = _OUT(ifla_remote), .cb = nlattr_get_ip }, + { .type = IFLA_GENEVE_LOCAL_PORT, .off = _OUT(ifla_local_port), .cb = nlattr_get_uint16 }, + { .type = IFLA_GENEVE_PORT, .off = _OUT(ifla_remote_port), .cb = nlattr_get_uint16 }, + { .type = IFLA_GENEVE_PORT_RANGE, .off = _OUT(ifla_port_range), + .arg = (void *)sizeof(struct ifla_geneve_port_range), .cb = nlattr_get_bytes }, + { .type = IFLA_GENEVE_DF, .off = _OUT(ifla_df), .cb = nlattr_get_uint8 }, + { .type = IFLA_GENEVE_TTL, .off = _OUT(ifla_ttl), .cb = nlattr_get_uint8 }, + { .type = IFLA_GENEVE_TTL_INHERIT, .off = _OUT(ifla_ttl_inherit), .cb = nlattr_get_bool }, + { .type = IFLA_GENEVE_DSCP_INHERIT, .off = _OUT(ifla_dscp_inherit), .cb = nlattr_get_bool }, + { .type = IFLA_GENEVE_COLLECT_METADATA, .off = _OUT(ifla_external), .cb = nlattr_get_bool }, + { .type = IFLA_GENEVE_FTABLE_LEARN, .off = _OUT(ifla_ftable_learn), .cb = nlattr_get_bool }, + { .type = IFLA_GENEVE_FTABLE_FLUSH, .off = _OUT(ifla_ftable_flush), .cb = nlattr_get_bool }, + { .type = IFLA_GENEVE_FTABLE_MAX, .off = _OUT(ifla_ftable_max), .cb = nlattr_get_uint32 }, + { .type = IFLA_GENEVE_FTABLE_TIMEOUT, .off = _OUT(ifla_ftable_timeout), .cb = nlattr_get_uint32 }, + { .type = IFLA_GENEVE_MC_IFNAME, .off = _OUT(ifla_mc_ifname), .cb = nlattr_get_string }, +}; +#undef _OUT +NL_DECLARE_ATTR_PARSER(geneve_modify_parser, nla_p_geneve); + +static const struct nlhdr_parser *all_parsers[] = { + &geneve_create_parser, &geneve_modify_parser, +}; + +static int +geneve_ftable_addr_cmp(const uint8_t *a, const uint8_t *b) +{ + int i, d; + + for (i = 0, d = 0; i < ETHER_ADDR_LEN && d == 0; i++) + d = (int)a[i] - (int)b[i]; + + return (d); +} + +static void +geneve_ftable_init(struct geneve_softc *sc) +{ + int i; + + sc->gnv_ftable = malloc(sizeof(struct geneve_ftable_head) * + GENEVE_SC_FTABLE_SIZE, M_GENEVE, M_ZERO | M_WAITOK); + + for (i = 0; i < GENEVE_SC_FTABLE_SIZE; i++) + LIST_INIT(&sc->gnv_ftable[i]); + sc->gnv_ftable_hash_key = arc4random(); +} + +static void +geneve_ftable_fini(struct geneve_softc *sc) +{ + int i; + + for (i = 0; i < GENEVE_SC_FTABLE_SIZE; i++) { + KASSERT(LIST_EMPTY(&sc->gnv_ftable[i]), + ("%s: geneve %p ftable[%d] not empty", __func__, sc, i)); + } + MPASS(sc->gnv_ftable_cnt == 0); + + free(sc->gnv_ftable, M_GENEVE); + sc->gnv_ftable = NULL; +} + +static void +geneve_ftable_flush(struct geneve_softc *sc, int all) +{ + struct gnv_ftable_entry *fe, *tfe; + + for (int i = 0; i < GENEVE_SC_FTABLE_SIZE; i++) { + LIST_FOREACH_SAFE(fe, &sc->gnv_ftable[i], gnvfe_hash, tfe) { + if (all || GENEVE_FE_IS_DYNAMIC(fe)) + geneve_ftable_entry_destroy(sc, fe); + } + } +} + +static void +geneve_ftable_expire(struct geneve_softc *sc) +{ + struct gnv_ftable_entry *fe, *tfe; + + GENEVE_LOCK_WASSERT(sc); + + for (int i = 0; i < GENEVE_SC_FTABLE_SIZE; i++) { + LIST_FOREACH_SAFE(fe, &sc->gnv_ftable[i], gnvfe_hash, tfe) { + if (GENEVE_FE_IS_DYNAMIC(fe) && + time_uptime >= fe->gnvfe_expire) + geneve_ftable_entry_destroy(sc, fe); + } + } +} + +static int +geneve_ftable_update_locked(struct geneve_softc *sc, + const union sockaddr_union *unsa, const uint8_t *mac, + struct rm_priotracker *tracker) +{ + struct gnv_ftable_entry *fe; + int error; + + GENEVE_LOCK_ASSERT(sc); + +again: + /* + * A forwarding entry for this MAC address might already exist. If + * so, update it, otherwise create a new one. We may have to upgrade + * the lock if we have to change or create an entry. + */ + fe = geneve_ftable_entry_lookup(sc, mac); + if (fe != NULL) { + fe->gnvfe_expire = time_uptime + sc->gnv_ftable_timeout; + + if (!GENEVE_FE_IS_DYNAMIC(fe) || + geneve_sockaddr_in_equal(&fe->gnvfe_raddr, &unsa->sa)) + return (0); + if (!GENEVE_LOCK_WOWNED(sc)) { + GENEVE_RUNLOCK(sc, tracker); + GENEVE_WLOCK(sc); + sc->gnv_stats.ftable_lock_upgrade_failed++; + goto again; + } + geneve_sockaddr_in_copy(&fe->gnvfe_raddr, &unsa->sa); + return (0); + } + + if (!GENEVE_LOCK_WOWNED(sc)) { + GENEVE_RUNLOCK(sc, tracker); + GENEVE_WLOCK(sc); + sc->gnv_stats.ftable_lock_upgrade_failed++; + goto again; + } + + if (sc->gnv_ftable_cnt >= sc->gnv_ftable_max) { + sc->gnv_stats.ftable_nospace++; + return (ENOSPC); + } + + fe = geneve_ftable_entry_alloc(); + if (fe == NULL) + return (ENOMEM); + + geneve_ftable_entry_init(sc, fe, mac, &unsa->sa, GENEVE_FE_FLAG_DYNAMIC); + + /* The prior lookup failed, so the insert should not. */ + error = geneve_ftable_entry_insert(sc, fe); + MPASS(error == 0); + + return (error); +} + +static int +geneve_ftable_learn(struct geneve_softc *sc, const struct sockaddr *sa, + const uint8_t *mac) +{ + struct rm_priotracker tracker; + union sockaddr_union unsa; + int error; + + /* + * The source port may be randomly selected by the remote host, so + * use the port of the default destination address. + */ + geneve_sockaddr_copy(&unsa, sa); + unsa.sin.sin_port = sc->gnv_dst_addr.sin.sin_port; + + if (unsa.sa.sa_family == AF_INET6) { + error = sa6_embedscope(&unsa.sin6, V_ip6_use_defzone); + if (error) + return (error); + } + + GENEVE_RLOCK(sc, &tracker); + error = geneve_ftable_update_locked(sc, &unsa, mac, &tracker); + GENEVE_UNLOCK(sc, &tracker); + + return (error); +} + +static struct gnv_ftable_entry * +geneve_ftable_entry_alloc(void) +{ + struct gnv_ftable_entry *fe; + + fe = malloc(sizeof(*fe), M_GENEVE, M_ZERO | M_NOWAIT); + + return (fe); +} + +static void +geneve_ftable_entry_free(struct gnv_ftable_entry *fe) +{ + + free(fe, M_GENEVE); +} + +static void +geneve_ftable_entry_init(struct geneve_softc *sc, struct gnv_ftable_entry *fe, + const uint8_t *mac, const struct sockaddr *sa, uint32_t flags) +{ + + fe->gnvfe_flags = flags; + fe->gnvfe_expire = time_uptime + sc->gnv_ftable_timeout; + memcpy(fe->gnvfe_mac, mac, ETHER_ADDR_LEN); + geneve_sockaddr_copy(&fe->gnvfe_raddr, sa); +} + +static void +geneve_ftable_entry_destroy(struct geneve_softc *sc, + struct gnv_ftable_entry *fe) +{ + + sc->gnv_ftable_cnt--; + LIST_REMOVE(fe, gnvfe_hash); + geneve_ftable_entry_free(fe); +} + +static int +geneve_ftable_entry_insert(struct geneve_softc *sc, + struct gnv_ftable_entry *fe) +{ + struct gnv_ftable_entry *lfe; + uint32_t hash; + int dir; + + GENEVE_LOCK_WASSERT(sc); + hash = GENEVE_SC_FTABLE_HASH(sc, fe->gnvfe_mac); + + lfe = LIST_FIRST(&sc->gnv_ftable[hash]); + if (lfe == NULL) { + LIST_INSERT_HEAD(&sc->gnv_ftable[hash], fe, gnvfe_hash); + goto out; + } + + do { + dir = geneve_ftable_addr_cmp(fe->gnvfe_mac, lfe->gnvfe_mac); + if (dir == 0) + return (EEXIST); + if (dir > 0) { + LIST_INSERT_BEFORE(lfe, fe, gnvfe_hash); + goto out; + } else if (LIST_NEXT(lfe, gnvfe_hash) == NULL) { + LIST_INSERT_AFTER(lfe, fe, gnvfe_hash); + goto out; + } else + lfe = LIST_NEXT(lfe, gnvfe_hash); + } while (lfe != NULL); + +out: + sc->gnv_ftable_cnt++; + + return (0); +} + +static struct gnv_ftable_entry * +geneve_ftable_entry_lookup(struct geneve_softc *sc, const uint8_t *mac) +{ + struct gnv_ftable_entry *fe; + uint32_t hash; + int dir; + + GENEVE_LOCK_ASSERT(sc); + + hash = GENEVE_SC_FTABLE_HASH(sc, mac); + LIST_FOREACH(fe, &sc->gnv_ftable[hash], gnvfe_hash) { + dir = geneve_ftable_addr_cmp(mac, fe->gnvfe_mac); + if (dir == 0) + return (fe); + if (dir > 0) + break; + } + + return (NULL); +} + +static struct geneve_socket * +geneve_socket_alloc(union sockaddr_union *laddr) +{ + struct geneve_socket *gnvso; + + gnvso = malloc(sizeof(*gnvso), M_GENEVE, M_WAITOK | M_ZERO); + rm_init(&gnvso->gnvso_lock, "genevesorm"); + refcount_init(&gnvso->gnvso_refcnt, 0); + for (int i = 0; i < GENEVE_SO_VNI_HASH_SIZE; i++) + LIST_INIT(&gnvso->gnvso_vni_hash[i]); + gnvso->gnvso_laddr = *laddr; + + return (gnvso); +} + +static void +geneve_socket_destroy(struct geneve_socket *gnvso) +{ + struct socket *so; + + so = gnvso->gnvso_sock; + if (so != NULL) { + gnvso->gnvso_sock = NULL; + soclose(so); + } + + rm_destroy(&gnvso->gnvso_lock); + free(gnvso, M_GENEVE); +} + +static void +geneve_socket_release(struct geneve_socket *gnvso) +{ + int destroy; + + GENEVE_LIST_LOCK(); *** 3327 LINES SKIPPED *** From nobody Mon Apr 13 14:16:57 2026 X-Original-To: dev-commits-src-main@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 4fvTxQ1yg3z6ZDrd for ; Mon, 13 Apr 2026 14:16:58 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvTxQ0Lq7z3ncx for ; Mon, 13 Apr 2026 14:16:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776089818; 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=O7wvGHzgtBNYFBqB0cA1kA5dp0hWbA6siYUmaHWZHmg=; b=qaubJ4/JtY7aL3NClLM26jiKowlbjnG3zDXfLIWAvj1oOnpgkC34jshta4IY9tCIk9MKA8 VoSKHy+EJymK8T1SXEvO3oKxm6z2GishiocscnJTHqtbK9fIuJYitiFXy4n7yWc3dvGFed 1brzxvn0vKsjmt0rtDNv36X3wiiYY3jdx+zsyZwcYPu+Bs6CsQJy0yGNOFg56yiEbx1VWP j1yTFAs1El70BFw0jCMcRNC+1NEoHeceR7MOsYoKgEjp4kszObhY5r6iTsjgxs+Ml5VEax HspNT8uHLmrKJW65Ixp6mfjWI065urxEPfWKJTEuDFDGLJlJ2JiRKR05kA3xuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776089818; a=rsa-sha256; cv=none; b=nuMMVcuZaPzGym6TDWVD2vXydY8wCUzrUIVV87D8cYbwZNEsPAbi5K+22avEnuCXukozfG EG5Ay9rFZ/dgOdpvjEmLcRmHdW0KYNYR8whX0P8aF1y4UHmF9kS91KTsBdul4i1FTwHbxi MgzpY/VELzXMRmtQqgkqMkVPnjhHxQ8ndwYG16fERddgKCBNQcB0CcWwcbSKXa8mUKsNQC T4vf+IiGKAK3ZJRjuQNUcB45WZogMPAMJRdTL+iLHPsMSsd/u9IMnECL8qm0/GieyWHM0J 4FJtJigDMC8XlFk8C2yKHfSpPXhVpzTv7d74pX3NXdVnppRJlWnVuApLWt79XA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776089818; 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=O7wvGHzgtBNYFBqB0cA1kA5dp0hWbA6siYUmaHWZHmg=; b=OcTa87lcsQ8sC2tcOXTsuYSdRInV+JzJDxnttJbDArz1GHNNG7CXfR2f/5+k/oIbnFIdHG 6QI0kZhYtfwNlwkxuy+bWA/nhlsfXhx8YvJ82YEz8mpX5Ekvhc3rtUtfQlmohrY/b/X7YR xQFqr3IYqvGWGOaN7jdMmaqE0XeXfRGs6mYy6x0nYIMhx+GKyq0+E32h+PHaU4TuAqg+8H s47jt0EPMxhpR05qllC0xRgZ/NaoyDHaAWb3pEqbv4qmQnTrlIOMeiF45xCeFn8bin9aBB tNaZkbqg4dfg5/NIc4qQDH5w5oiGk6PWfbZrPSAzbUI8eJ85Mc2NDkfkDuu9PQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvTxP74DMz16Qq for ; Mon, 13 Apr 2026 14:16:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46b23 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 14:16:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: 688e289ee904 - main - ifconfig: Add support for geneve (netlink) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 688e289ee904fe625d92f93680a71753d03ba2ee Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 14:16:57 +0000 Message-Id: <69dcfad9.46b23.7e93103@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=688e289ee904fe625d92f93680a71753d03ba2ee commit 688e289ee904fe625d92f93680a71753d03ba2ee Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-11 18:38:41 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-13 14:15:01 +0000 ifconfig: Add support for geneve (netlink) This implementation is netlink only Differential Revision: https://reviews.freebsd.org/D55184 --- lib/libifconfig/libifconfig.c | 4 +- sbin/ifconfig/Makefile | 1 + sbin/ifconfig/ifgeneve.c | 889 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 893 insertions(+), 1 deletion(-) diff --git a/lib/libifconfig/libifconfig.c b/lib/libifconfig/libifconfig.c index f844ae235a71..bc0fcb6021b2 100644 --- a/lib/libifconfig/libifconfig.c +++ b/lib/libifconfig/libifconfig.c @@ -562,7 +562,9 @@ ifconfig_create_interface(ifconfig_handle_t *h, const char *name, char **ifname) (strncmp(name, "vlan", strlen("vlan")) == 0) || (strncmp(name, "vxlan", - strlen("vxlan")) == 0)) { + strlen("vxlan")) == 0) || + (strncmp(name, "geneve", + strlen("geneve")) == 0)) { h->error.errtype = OTHER; h->error.errcode = ENOSYS; return (-1); diff --git a/sbin/ifconfig/Makefile b/sbin/ifconfig/Makefile index b777d875f966..cc518693c2f5 100644 --- a/sbin/ifconfig/Makefile +++ b/sbin/ifconfig/Makefile @@ -30,6 +30,7 @@ SRCS+= ifmedia.c # SIOC[GS]IFMEDIA support SRCS+= iffib.c # non-default FIB support SRCS+= ifvlan.c # SIOC[GS]ETVLAN support SRCS+= ifvxlan.c # VXLAN support +SRCS+= ifgeneve.c # GENEVE support SRCS+= ifgre.c # GRE keys etc SRCS+= ifgif.c # GIF reversed header workaround SRCS+= ifipsec.c # IPsec VTI diff --git a/sbin/ifconfig/ifgeneve.c b/sbin/ifconfig/ifgeneve.c new file mode 100644 index 000000000000..aac8c81a3b10 --- /dev/null +++ b/sbin/ifconfig/ifgeneve.c @@ -0,0 +1,889 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025-2026 Pouria Mousavizadeh Tehrani + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "ifconfig.h" +#include "ifconfig_netlink.h" + +struct nl_parsed_geneve { + /* essential */ + uint32_t ifla_vni; + uint16_t ifla_proto; + struct sockaddr *ifla_local; + struct sockaddr *ifla_remote; + uint16_t ifla_local_port; + uint16_t ifla_remote_port; + + /* optional */ + struct ifla_geneve_port_range *ifla_port_range; + enum ifla_geneve_df ifla_df; + uint8_t ifla_ttl; + bool ifla_ttl_inherit; + bool ifla_dscp_inherit; + bool ifla_external; + + /* l2 specific */ + bool ifla_ftable_learn; + bool ifla_ftable_flush; + uint32_t ifla_ftable_max; + uint32_t ifla_ftable_timeout; + uint32_t ifla_ftable_count; + uint32_t ifla_ftable_nospace; + uint32_t ifla_ftable_lock_upgrade_failed; + + /* multicast specific */ + char *ifla_mc_ifname; + uint32_t ifla_mc_ifindex; + + /* csum info */ + uint64_t ifla_stats_txcsum; + uint64_t ifla_stats_tso; + uint64_t ifla_stats_rxcsum; +}; + +static struct geneve_params gnvp = { + .ifla_proto = GENEVE_PROTO_ETHER, +}; + +static int +get_proto(const char *cp, uint16_t *valp) +{ + uint16_t val; + + if (!strcmp(cp, "l2")) + val = GENEVE_PROTO_ETHER; + else if (!strcmp(cp, "l3")) + val = GENEVE_PROTO_INHERIT; + else + return (-1); + + *valp = val; + return (0); +} + +static int +get_val(const char *cp, u_long *valp) +{ + char *endptr; + u_long val; + + errno = 0; + val = strtoul(cp, &endptr, 0); + if (cp[0] == '\0' || endptr[0] != '\0' || errno == ERANGE) + return (-1); + + *valp = val; + return (0); +} + +static int +get_df(const char *cp, enum ifla_geneve_df *valp) +{ + enum ifla_geneve_df df; + + if (!strcmp(cp, "set")) + df = IFLA_GENEVE_DF_SET; + else if (!strcmp(cp, "inherit")) + df = IFLA_GENEVE_DF_INHERIT; + else if (!strcmp(cp, "unset")) + df = IFLA_GENEVE_DF_UNSET; + else + return (-1); + + *valp = df; + return (0); +} + +static bool +is_multicast(struct addrinfo *ai) +{ +#if (defined INET || defined INET6) + struct sockaddr *sa; + sa = ai->ai_addr; +#endif + + switch (ai->ai_family) { +#ifdef INET + case AF_INET: { + struct sockaddr_in *sin = satosin(sa); + + return (IN_MULTICAST(ntohl(sin->sin_addr.s_addr))); + } +#endif +#ifdef INET6 + case AF_INET6: { + struct sockaddr_in6 *sin6 = satosin6(sa); + + return (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)); + } +#endif + default: + errx(1, "address family not supported"); + } +} + +/* + * geneve mode is read-only after creation, + * therefore there is no need for separate netlink implementation + */ +static void +setgeneve_mode_clone(if_ctx *ctx __unused, const char *arg, int dummy __unused) +{ + uint16_t val; + + if (get_proto(arg, &val) < 0) + errx(1, "invalid inner protocol: %s", arg); + + gnvp.ifla_proto = val; +} + +struct nla_geneve_info { + const char *kind; + struct nl_parsed_geneve data; +}; + +struct nla_geneve_link { + uint32_t ifi_index; + struct nla_geneve_info linkinfo; +}; + +static inline void +geneve_nl_init(if_ctx *ctx, struct snl_writer *nw, uint32_t flags) +{ + struct nlmsghdr *hdr; + + snl_init_writer(ctx->io_ss, nw); + hdr = snl_create_msg_request(nw, NL_RTM_NEWLINK); + hdr->nlmsg_flags |= flags; + snl_reserve_msg_object(nw, struct ifinfomsg); + snl_add_msg_attr_string(nw, IFLA_IFNAME, ctx->ifname); +} + +static inline void +geneve_nl_fini(if_ctx *ctx, struct snl_writer *nw) +{ + struct nlmsghdr *hdr; + struct snl_errmsg_data errmsg = {}; + + hdr = snl_finalize_msg(nw); + if (hdr == NULL || !snl_send_message(ctx->io_ss, hdr)) + err(1, "unable to send netlink message"); + + if (!snl_read_reply_code(ctx->io_ss, hdr->nlmsg_seq, &errmsg)) + errx(errmsg.error, "%s", errmsg.error_str); +} + +#define _OUT(_field) offsetof(struct nl_parsed_geneve, _field) +static const struct snl_attr_parser nla_geneve_linkinfo_data[] = { + { .type = IFLA_GENEVE_ID, .off = _OUT(ifla_vni), .cb = snl_attr_get_uint32 }, + { .type = IFLA_GENEVE_PROTOCOL, .off = _OUT(ifla_proto), .cb = snl_attr_get_uint16 }, + { .type = IFLA_GENEVE_LOCAL, .off = _OUT(ifla_local), .cb = snl_attr_get_ip }, + { .type = IFLA_GENEVE_REMOTE, .off = _OUT(ifla_remote), .cb = snl_attr_get_ip }, + { .type = IFLA_GENEVE_LOCAL_PORT, .off = _OUT(ifla_local_port), .cb = snl_attr_get_uint16 }, + { .type = IFLA_GENEVE_PORT, .off = _OUT(ifla_remote_port), .cb = snl_attr_get_uint16 }, + { .type = IFLA_GENEVE_PORT_RANGE, .off = _OUT(ifla_port_range), .cb = snl_attr_dup_struct }, + { .type = IFLA_GENEVE_DF, .off = _OUT(ifla_df), .cb = snl_attr_get_uint8 }, + { .type = IFLA_GENEVE_TTL, .off = _OUT(ifla_ttl), .cb = snl_attr_get_uint8 }, + { .type = IFLA_GENEVE_TTL_INHERIT, .off = _OUT(ifla_ttl_inherit), .cb = snl_attr_get_bool }, + { .type = IFLA_GENEVE_DSCP_INHERIT, .off = _OUT(ifla_dscp_inherit), .cb = snl_attr_get_bool }, + { .type = IFLA_GENEVE_COLLECT_METADATA, .off = _OUT(ifla_external), .cb = snl_attr_get_bool }, + { .type = IFLA_GENEVE_FTABLE_LEARN, .off = _OUT(ifla_ftable_learn), .cb = snl_attr_get_bool }, + { .type = IFLA_GENEVE_FTABLE_FLUSH, .off = _OUT(ifla_ftable_flush), .cb = snl_attr_get_bool }, + { .type = IFLA_GENEVE_FTABLE_MAX, .off = _OUT(ifla_ftable_max), .cb = snl_attr_get_uint32 }, + { .type = IFLA_GENEVE_FTABLE_TIMEOUT, .off = _OUT(ifla_ftable_timeout), .cb = snl_attr_get_uint32 }, + { .type = IFLA_GENEVE_FTABLE_COUNT, .off = _OUT(ifla_ftable_count), .cb = snl_attr_get_uint32 }, + { .type = IFLA_GENEVE_FTABLE_NOSPACE_CNT, .off = _OUT(ifla_ftable_nospace), .cb = snl_attr_get_uint32 }, + { .type = IFLA_GENEVE_FTABLE_LOCK_UP_FAIL_CNT, .off = _OUT(ifla_ftable_lock_upgrade_failed), .cb = snl_attr_get_uint32 }, + { .type = IFLA_GENEVE_MC_IFNAME, .off = _OUT(ifla_mc_ifname), .cb = snl_attr_get_string }, + { .type = IFLA_GENEVE_MC_IFINDEX, .off = _OUT(ifla_mc_ifindex), .cb = snl_attr_get_uint32 }, + { .type = IFLA_GENEVE_TXCSUM_CNT, .off = _OUT(ifla_stats_txcsum), .cb = snl_attr_get_uint64 }, + { .type = IFLA_GENEVE_TSO_CNT, .off = _OUT(ifla_stats_tso), .cb = snl_attr_get_uint64 }, + { .type = IFLA_GENEVE_RXCSUM_CNT, .off = _OUT(ifla_stats_rxcsum), .cb = snl_attr_get_uint64 }, +}; +#undef _OUT +SNL_DECLARE_ATTR_PARSER(geneve_linkinfo_data_parser, nla_geneve_linkinfo_data); + +#define _OUT(_field) offsetof(struct nla_geneve_info, _field) +static const struct snl_attr_parser ap_geneve_linkinfo[] = { + { .type = IFLA_INFO_KIND, .off = _OUT(kind), .cb = snl_attr_get_string }, + { .type = IFLA_INFO_DATA, .off = _OUT(data), + .arg = &geneve_linkinfo_data_parser, .cb = snl_attr_get_nested }, +}; +#undef _OUT +SNL_DECLARE_ATTR_PARSER(geneve_linkinfo_parser, ap_geneve_linkinfo); + +#define _IN(_field) offsetof(struct ifinfomsg, _field) +#define _OUT(_field) offsetof(struct nla_geneve_link, _field) +static const struct snl_attr_parser ap_geneve_link[] = { + { .type = IFLA_LINKINFO, .off = _OUT(linkinfo), + .arg = &geneve_linkinfo_parser, .cb = snl_attr_get_nested }, +}; + +static const struct snl_field_parser fp_geneve_link[] = { + { .off_in = _IN(ifi_index), .off_out = _OUT(ifi_index), .cb = snl_field_get_uint32 }, +}; +#undef _IN +#undef _OUT +SNL_DECLARE_PARSER(geneve_parser, struct ifinfomsg, fp_geneve_link, ap_geneve_link); + +static const struct snl_hdr_parser *all_parsers[] = { + &geneve_linkinfo_data_parser, + &geneve_linkinfo_parser, + &geneve_parser, +}; + +static void +geneve_status_nl(if_ctx *ctx) +{ + struct snl_writer nw; + struct nlmsghdr *hdr; + struct snl_errmsg_data errmsg; + struct nla_geneve_link geneve_link; + char src[INET6_ADDRSTRLEN], dst[INET6_ADDRSTRLEN]; + struct sockaddr *lsa, *rsa; + int mc; + bool ipv6 = false; + + if (strncmp(ctx->ifname, "geneve", sizeof("geneve") - 1) != 0) + return; + + snl_init_writer(ctx->io_ss, &nw); + hdr = snl_create_msg_request(&nw, NL_RTM_GETLINK); + hdr->nlmsg_flags |= NLM_F_DUMP; + snl_reserve_msg_object(&nw, struct ifinfomsg); + snl_add_msg_attr_string(&nw, IFLA_IFNAME, ctx->ifname); + + if (!(hdr = snl_finalize_msg(&nw)) || (!snl_send_message(ctx->io_ss, hdr))) + return; + + hdr = snl_read_reply(ctx->io_ss, hdr->nlmsg_seq); + if (hdr->nlmsg_type != NL_RTM_NEWLINK) { + if (!snl_parse_errmsg(ctx->io_ss, hdr, &errmsg)) + errx(EINVAL, "(NETLINK)"); + if (errmsg.error_str != NULL) + errx(errmsg.error, "(NETLINK) %s", errmsg.error_str); + } + + if (!snl_parse_nlmsg(ctx->io_ss, hdr, &geneve_parser, &geneve_link)) + return; + + struct nla_geneve_info geneve_info = geneve_link.linkinfo; + struct nl_parsed_geneve geneve_data = geneve_info.data; + + printf("\tgeneve mode: "); + switch (geneve_data.ifla_proto) { + case GENEVE_PROTO_INHERIT: + printf("l3"); + break; + case GENEVE_PROTO_ETHER: + default: + printf("l2"); + break; + } + + printf("\n\tgeneve config:\n"); + /* Just report nothing if the network identity isn't set yet. */ + if (geneve_data.ifla_vni >= GENEVE_VNI_MAX) { + printf("\t\tvirtual network identifier (vni): not configured\n"); + return; + } + + lsa = geneve_data.ifla_local; + rsa = geneve_data.ifla_remote; + + if ((lsa == NULL) || + (getnameinfo(lsa, lsa->sa_len, src, sizeof(src), + NULL, 0, NI_NUMERICHOST) != 0)) + src[0] = '\0'; + if ((rsa == NULL) || + (getnameinfo(rsa, rsa->sa_len, dst, sizeof(dst), + NULL, 0, NI_NUMERICHOST) != 0)) + dst[0] = '\0'; + else { + ipv6 = rsa->sa_family == AF_INET6; + if (!ipv6) { + struct sockaddr_in *sin = satosin(rsa); + mc = IN_MULTICAST(ntohl(sin->sin_addr.s_addr)); + } else { + struct sockaddr_in6 *sin6 = satosin6(rsa); + mc = IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr); + } + } + + printf("\t\tvirtual network identifier (vni): %d", geneve_data.ifla_vni); + if (src[0] != '\0') + printf("\n\t\tlocal: %s%s%s:%u", ipv6 ? "[" : "", src, ipv6 ? "]" : "", + geneve_data.ifla_local_port); + if (dst[0] != '\0') { + printf("\n\t\t%s: %s%s%s:%u", mc ? "group" : "remote", ipv6 ? "[" : "", + dst, ipv6 ? "]" : "", geneve_data.ifla_local_port); + if (mc) + printf(", dev: %s", geneve_data.ifla_mc_ifname); + } + + if (ctx->args->verbose) { + printf("\n\t\tportrange: %u-%u", + geneve_data.ifla_port_range->low, + geneve_data.ifla_port_range->high); + + if (geneve_data.ifla_ttl_inherit) + printf(", ttl: inherit"); + else + printf(", ttl: %d", geneve_data.ifla_ttl); + + if (geneve_data.ifla_dscp_inherit) + printf(", dscp: inherit"); + + if (geneve_data.ifla_df == IFLA_GENEVE_DF_INHERIT) + printf(", df: inherit"); + else if (geneve_data.ifla_df == IFLA_GENEVE_DF_SET) + printf(", df: set"); + else if (geneve_data.ifla_df == IFLA_GENEVE_DF_UNSET) + printf(", df: unset"); + + if (geneve_data.ifla_external) + printf(", externally controlled"); + + if (geneve_data.ifla_proto == GENEVE_PROTO_ETHER) { + printf("\n\t\tftable mode: %slearning", + geneve_data.ifla_ftable_learn ? "" : "no"); + printf(", count: %d, max: %d, timeout: %d", + geneve_data.ifla_ftable_count, + geneve_data.ifla_ftable_max, + geneve_data.ifla_ftable_timeout); + printf(", nospace: %u", + geneve_data.ifla_ftable_nospace); + } + + printf("\n\t\tstats: tso %lu, txcsum %lu, rxcsum %lu", + geneve_data.ifla_stats_tso, + geneve_data.ifla_stats_txcsum, + geneve_data.ifla_stats_rxcsum); + } + + putchar('\n'); +} + + +static void +geneve_create_nl(if_ctx *ctx, struct ifreq *ifr) +{ + struct snl_writer nw = {}; + struct nlmsghdr *hdr; + int off, off2; + + snl_init_writer(ctx->io_ss, &nw); + hdr = snl_create_msg_request(&nw, RTM_NEWLINK); + hdr->nlmsg_flags |= (NLM_F_CREATE | NLM_F_EXCL); + snl_reserve_msg_object(&nw, struct ifinfomsg); + snl_add_msg_attr_string(&nw, IFLA_IFNAME, ifr->ifr_name); + + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + snl_add_msg_attr_u16(&nw, IFLA_GENEVE_PROTOCOL, gnvp.ifla_proto); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_vni_nl(if_ctx *ctx, const char *arg, int dummy __unused) +{ + struct snl_writer nw = {}; + int off, off2; + u_long val; + + if (get_val(arg, &val) < 0 || val >= GENEVE_VNI_MAX) + errx(1, "invalid network identifier: %s", arg); + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + snl_add_msg_attr_u32(&nw, IFLA_GENEVE_ID, val); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_local_nl(if_ctx *ctx, const char *addr, int dummy __unused) +{ + struct snl_writer nw = {}; + int off, off2; + struct addrinfo *ai; + const struct sockaddr *sa; + int error; + + if ((error = getaddrinfo(addr, NULL, NULL, &ai)) != 0) + errx(1, "error in parsing local address string: %s", + gai_strerror(error)); + + if (is_multicast(ai)) + errx(1, "local address cannot be multicast"); + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + + sa = ai->ai_addr; + snl_add_msg_attr_ip(&nw, IFLA_GENEVE_LOCAL, sa); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_remote_nl(if_ctx *ctx, const char *addr, int dummy __unused) +{ + struct snl_writer nw = {}; + int off, off2; + struct addrinfo *ai; + const struct sockaddr *sa; + int error; + + if ((error = getaddrinfo(addr, NULL, NULL, &ai)) != 0) + errx(1, "error in parsing remote address string: %s", + gai_strerror(error)); + + if (is_multicast(ai)) + errx(1, "remote address cannot be multicast"); + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + + sa = ai->ai_addr; + snl_add_msg_attr_ip(&nw, IFLA_GENEVE_REMOTE, sa); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_group_nl(if_ctx *ctx, const char *addr, int dummy __unused) +{ + struct snl_writer nw = {}; + int off, off2; + struct addrinfo *ai; + struct sockaddr *sa; + int error; + + if ((error = getaddrinfo(addr, NULL, NULL, &ai)) != 0) + errx(1, "error in parsing local address string: %s", + gai_strerror(error)); + + if (!is_multicast(ai)) + errx(1, "group address must be multicast"); + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + + sa = ai->ai_addr; + snl_add_msg_attr_ip(&nw, IFLA_GENEVE_REMOTE, sa); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + + +static void +setgeneve_local_port_nl(if_ctx *ctx, const char *arg, int dummy __unused) +{ + struct snl_writer nw = {}; + int off, off2; + u_long val; + + if (get_val(arg, &val) < 0 || val >= UINT16_MAX) + errx(1, "invalid local port: %s", arg); + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + + snl_add_msg_attr_u16(&nw, IFLA_GENEVE_LOCAL_PORT, val); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_remote_port_nl(if_ctx *ctx, const char *arg, int dummy __unused) +{ + struct snl_writer nw = {}; + int off, off2; + u_long val; + + if (get_val(arg, &val) < 0 || val >= UINT16_MAX) + errx(1, "invalid remote port: %s", arg); + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + + snl_add_msg_attr_u16(&nw, IFLA_GENEVE_PORT, val); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_port_range_nl(if_ctx *ctx, const char *arg1, const char *arg2) +{ + struct snl_writer nw = {}; + int off, off2; + u_long min, max; + + if (get_val(arg1, &min) < 0 || min >= UINT16_MAX) + errx(1, "invalid port range minimum: %s", arg1); + if (get_val(arg2, &max) < 0 || max >= UINT16_MAX) + errx(1, "invalid port range maximum: %s", arg2); + if (max < min) + errx(1, "invalid port range"); + + const struct ifla_geneve_port_range port_range = { + .low = min, + .high = max + }; + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + + snl_add_msg_attr(&nw, IFLA_GENEVE_PORT_RANGE, + sizeof(port_range), (const void *)&port_range); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_timeout_nl(if_ctx *ctx, const char *arg, int dummy __unused) +{ + struct snl_writer nw = {}; + int off, off2; + u_long val; + + if (get_val(arg, &val) < 0 || (val & ~0xFFFFFFFF) != 0) + errx(1, "invalid timeout value: %s", arg); + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + + snl_add_msg_attr_u32(&nw, IFLA_GENEVE_FTABLE_TIMEOUT, val); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_maxaddr_nl(if_ctx *ctx, const char *arg, int dummy __unused) +{ + struct snl_writer nw = {}; + int off, off2; + u_long val; + + if (get_val(arg, &val) < 0 || (val & ~0xFFFFFFFF) != 0) + errx(1, "invalid maxaddr value: %s", arg); + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + + snl_add_msg_attr_u32(&nw, IFLA_GENEVE_FTABLE_MAX, val); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_dev_nl(if_ctx *ctx, const char *arg, int dummy __unused) +{ + struct snl_writer nw = {}; + int off, off2; + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + + snl_add_msg_attr_string(&nw, IFLA_GENEVE_MC_IFNAME, arg); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_ttl_nl(if_ctx *ctx, const char *arg, int dummy __unused) +{ + struct snl_writer nw = {}; + int off, off2; + u_long val; + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + if ((get_val(arg, &val) < 0 || val > 256) == 0) { + snl_add_msg_attr_u8(&nw, IFLA_GENEVE_TTL, val); + snl_add_msg_attr_bool(&nw, IFLA_GENEVE_TTL_INHERIT, false); + } else if (!strcmp(arg, "inherit")) { + snl_add_msg_attr_bool(&nw, IFLA_GENEVE_TTL_INHERIT, true); + } else + errx(1, "invalid TTL value: %s", arg); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_df_nl(if_ctx *ctx, const char *arg, int dummy __unused) +{ + struct snl_writer nw = {}; + int off, off2; + enum ifla_geneve_df df; + + if (get_df(arg, &df) < 0) + errx(1, "invalid df value: %s", arg); + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + + snl_add_msg_attr_u8(&nw, IFLA_GENEVE_DF, df); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_inherit_dscp_nl(if_ctx *ctx, const char *arg __unused, int d) +{ + struct snl_writer nw = {}; + int off, off2; + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + + snl_add_msg_attr_bool(&nw, IFLA_GENEVE_DSCP_INHERIT, d != 0); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_learn_nl(if_ctx *ctx, const char *arg __unused, int d) +{ + struct snl_writer nw = {}; + int off, off2; + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + + snl_add_msg_attr_bool(&nw, IFLA_GENEVE_FTABLE_LEARN, d != 0); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_flush_nl(if_ctx *ctx, const char *val __unused, int d) +{ + struct snl_writer nw = {}; + int off, off2; + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + + snl_add_msg_attr_bool(&nw, IFLA_GENEVE_FTABLE_FLUSH, d != 0); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static void +setgeneve_external_nl(if_ctx *ctx, const char *val __unused, int d) +{ + struct snl_writer nw = {}; + int off, off2; + + geneve_nl_init(ctx, &nw, 0); + off = snl_add_msg_attr_nested(&nw, IFLA_LINKINFO); + snl_add_msg_attr_string(&nw, IFLA_INFO_KIND, "geneve"); + + off2 = snl_add_msg_attr_nested(&nw, IFLA_INFO_DATA); + + snl_add_msg_attr_bool(&nw, IFLA_GENEVE_COLLECT_METADATA, d != 0); + + snl_end_attr_nested(&nw, off2); + snl_end_attr_nested(&nw, off); + + geneve_nl_fini(ctx, &nw); +} + +static struct cmd geneve_cmds[] = { + + DEF_CLONE_CMD_ARG("genevemode", setgeneve_mode_clone), + + DEF_CMD_ARG("geneveid", setgeneve_vni_nl), + DEF_CMD_ARG("genevelocal", setgeneve_local_nl), + DEF_CMD_ARG("geneveremote", setgeneve_remote_nl), + DEF_CMD_ARG("genevegroup", setgeneve_group_nl), + DEF_CMD_ARG("genevelocalport", setgeneve_local_port_nl), + DEF_CMD_ARG("geneveremoteport", setgeneve_remote_port_nl), + DEF_CMD_ARG2("geneveportrange", setgeneve_port_range_nl), + DEF_CMD_ARG("genevetimeout", setgeneve_timeout_nl), + DEF_CMD_ARG("genevemaxaddr", setgeneve_maxaddr_nl), + DEF_CMD_ARG("genevedev", setgeneve_dev_nl), + DEF_CMD_ARG("genevettl", setgeneve_ttl_nl), + DEF_CMD_ARG("genevedf", setgeneve_df_nl), + DEF_CMD("genevedscpinherit", 1, setgeneve_inherit_dscp_nl), + DEF_CMD("-genevedscpinherit", 0, setgeneve_inherit_dscp_nl), + DEF_CMD("genevelearn", 1, setgeneve_learn_nl), + DEF_CMD("-genevelearn", 0, setgeneve_learn_nl), + DEF_CMD("geneveflushall", 0, setgeneve_flush_nl), + DEF_CMD("geneveflush", 1, setgeneve_flush_nl), + DEF_CMD("geneveexternal", 1, setgeneve_external_nl), + DEF_CMD("-geneveexternal", 0, setgeneve_external_nl), + + DEF_CMD_SARG("genevehwcsum", IFCAP2_GENEVE_HWCSUM_NAME, + setifcapnv), + DEF_CMD_SARG("-genevehwcsum", "-"IFCAP2_GENEVE_HWCSUM_NAME, + setifcapnv), + DEF_CMD_SARG("genevehwtso", IFCAP2_GENEVE_HWTSO_NAME, + setifcapnv), + DEF_CMD_SARG("-genevehwtso", "-"IFCAP2_GENEVE_HWTSO_NAME, + setifcapnv), +}; + +static struct afswtch af_geneve = { + .af_name = "af_geneve", + .af_af = AF_UNSPEC, + .af_other_status = geneve_status_nl, +}; + +static __constructor void +geneve_ctor(void) +{ + size_t i; + + for (i = 0; i < nitems(geneve_cmds); i++) + cmd_register(&geneve_cmds[i]); + af_register(&af_geneve); + clone_setdefcallback_prefix("geneve", geneve_create_nl); + SNL_VERIFY_PARSERS(all_parsers); +} From nobody Mon Apr 13 14:16:59 2026 X-Original-To: dev-commits-src-main@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 4fvTxR4bcsz6ZF03 for ; Mon, 13 Apr 2026 14:16:59 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvTxR1RfKz3njm for ; Mon, 13 Apr 2026 14:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776089819; 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=KzS2cqueHfBO9CXukMKHDY47lXdiDat2nn5f1zotKcg=; b=LGq7eZ+c3RcOwICi/j0Xrrlj+KDn27qYx5NxH0CKmNMN3tzoQp1OGc2v6/jSej9l0w1cZx 1UUj0xJ9RpqU6sjllJoqlyi1Bh5YvhjLHV58TAzKJ5cHIAu1iazbOQeWnD19kjqV1/CfRJ u/YSBqPmEDN9F0hjxJtE32f+d3loqN/toE4bnV2LtUapi4nE9IPg35F4au6PHyRoIbR4Vy 5Rnr/Xb9xgbqFDj9fIx63S+QirNFN4Z09vXmG9CkYVEm0YFBRKGI7lDKyXIwml9R56e019 kLlQJSw0soN/cizKjYkV9toMbtohoSKyQD4MN+6vK5f03taLaB7hAdQQf42C4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776089819; a=rsa-sha256; cv=none; b=R2JbH1uyAGYtM10lB515unJamxQRjNCGnwGEPGDi+rHA/BB7YQZ+yashF5fu34PZ5GHjJn ApxXYaGFkTHoAPEsD3X/wN3wWUXWqGy8v441WmuZ7G4DkWcIWwsDDL2kGJFzlWpyQLoYZe lRXAvFvcIJ0DdSGX2i0GaIIhFJ0sS4syVdllgwSKXqgddcon4vD1JaLcSYl5pXZ1at5ZPc fOzMM07vstM6S5oGcaxpJUTKRh2zcsWHQsIh/Gg7/Rt8mlaQo5wc8/62S9YGTv1UEU5K/k S0gOCANJGtiFo5Q6xlN97qKMcd2oBCnNd/07NY3KxTqyXEU2IkirtjcmwjdLLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776089819; 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=KzS2cqueHfBO9CXukMKHDY47lXdiDat2nn5f1zotKcg=; b=iFEVzWr1YIXGhbwa8adm3cb640lP7b5g41fICVF2zvJku2GMAX1aSgfEmALxR0fd0SzU1y wbIgfK0Tvm+FUVaCc6OjykKRZJKhQ88qqQY5LGENV5g/GJ16boE9D5iHEOMAzDvmpMZMGr KECcHzq8Q+4EyPNFlvdJ0xvUuT+Bd1A2ZJGCROnfB99DSL8OUmTIBOUn1VV1aOQF4XlLXY FVoDXC3kkASe8ELp2rINYEzyh9nyHAQLH/SkpaEo7DZkaeHgBBApYI3zUg7gCaV7H5yJlc UtjLc6RuNeWFK5ts90qjRgwz5cHv8V1G5vYQ73jO2Uc6wGa4rosn0J3HTEfPow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvTxR0py5z16FZ for ; Mon, 13 Apr 2026 14:16:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46269 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 14:16:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: aa9f669d09a7 - main - geneve: Add tests for geneve List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa9f669d09a7a193d470477398815f45a42c0270 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 14:16:59 +0000 Message-Id: <69dcfadb.46269.5b10c7b2@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=aa9f669d09a7a193d470477398815f45a42c0270 commit aa9f669d09a7a193d470477398815f45a42c0270 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-11 18:45:08 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-13 14:15:04 +0000 geneve: Add tests for geneve Add tests for each combinations of geneve modes, address families and multicast. Differential Revision: https://reviews.freebsd.org/D55183 --- tests/ci/tools/ci.conf | 1 + tests/sys/net/Makefile | 1 + tests/sys/net/if_geneve.sh | 1000 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1002 insertions(+) diff --git a/tests/ci/tools/ci.conf b/tests/ci/tools/ci.conf index 2302fc479a47..5ddb3476eb26 100644 --- a/tests/ci/tools/ci.conf +++ b/tests/ci/tools/ci.conf @@ -74,6 +74,7 @@ kld_list="\${kld_list} fusefs" # sys/fs/fusefs kld_list="\${kld_list} if_bridge" # sys/net/if_bridge_test kld_list="\${kld_list} if_enc" # sys/netpfil/pf kld_list="\${kld_list} if_epair" # sys/net/if_epair_test +kld_list="\${kld_list} if_geneve" # sys/net/if_geneve kld_list="\${kld_list} if_ovpn" # sys/net/if_ovpn kld_list="\${kld_list} if_stf" # sys/net/if_stf kld_list="\${kld_list} ipdivert" # sys/netinet (loads ipdivert) diff --git a/tests/sys/net/Makefile b/tests/sys/net/Makefile index e390c6e8059d..6dcc23b49b67 100644 --- a/tests/sys/net/Makefile +++ b/tests/sys/net/Makefile @@ -15,6 +15,7 @@ ATF_TESTS_SH+= if_stf ATF_TESTS_SH+= if_tun_test ATF_TESTS_SH+= if_vlan ATF_TESTS_SH+= if_wg +ATF_TESTS_SH+= if_geneve TESTS_SUBDIRS+= bpf TESTS_SUBDIRS+= if_ovpn diff --git a/tests/sys/net/if_geneve.sh b/tests/sys/net/if_geneve.sh new file mode 100644 index 000000000000..7eb2649b44a9 --- /dev/null +++ b/tests/sys/net/if_geneve.sh @@ -0,0 +1,1000 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2025-2026 Pouria Mousavizadeh Tehrani +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/../common/vnet.subr + +atf_test_case "ether_ipv4" "cleanup" +ether_ipv4_head() +{ + atf_set descr 'Create a geneve(4) l2 tunnel over an ipv4 underlay using epair and pass traffic between jails' + atf_set require.user root +} + +ether_ipv4_body() +{ + local epair geneve1 geneve2 vni1 endpoint1 endpoint2 + local v4tunnel1 v4tunnel2 v6tunnel1 v6tunnel2 + + endpoint1=192.168.2.1 + endpoint2=192.168.2.2 + v4tunnel1=169.254.0.1 + v4tunnel2=169.254.0.2 + v6tunnel1=2001:db8::1 + v6tunnel2=2001:db8::2 + vni1=1 + + if ! kldstat -q -m if_geneve; then + atf_skip "This test requires if_geneve" + fi + + vnet_init + epair=$(vnet_mkepair) + vnet_mkjail genevetest1 ${epair}a + vnet_mkjail genevetest2 ${epair}b + + ifconfig -j genevetest1 ${epair}a inet ${endpoint1}/24 up + ifconfig -j genevetest2 ${epair}b inet ${endpoint2}/24 up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 create genevemode l2 debug \ + geneveid $vni1 geneveremote ${endpoint2} genevelocal ${endpoint1} up + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 create genevemode l2 debug \ + geneveid $vni1 geneveremote ${endpoint1} genevelocal ${endpoint2} up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet ${v4tunnel1}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet6 ${v6tunnel1} + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet ${v4tunnel2}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet6 ${v6tunnel2} + + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v4tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v4tunnel1 + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v6tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v6tunnel1 +} + +ether_ipv4_cleanup() +{ + vnet_cleanup +} + +atf_test_case "ether_ipv6" "cleanup" +ether_ipv6_head() +{ + atf_set descr 'Create a geneve(4) l2 tunnel over an ipv6 underlay using epair and pass traffic between jails' + atf_set require.user root +} + +ether_ipv6_body() +{ + local epair geneve1 geneve2 vni1 endpoint1 endpoint2 + local v4tunnel1 v4tunnel2 v6tunnel1 v6tunnel2 + + endpoint1=3fff::1 + endpoint2=3fff::2 + v4tunnel1=169.254.0.1 + v4tunnel2=169.254.0.2 + v6tunnel1=2001:db8::1 + v6tunnel2=2001:db8::2 + vni1=1 + + if ! kldstat -q -m if_geneve; then + atf_skip "This test requires if_geneve" + fi + + vnet_init + epair=$(vnet_mkepair) + vnet_mkjail genevetest1 ${epair}a + vnet_mkjail genevetest2 ${epair}b + + ifconfig -j genevetest1 ${epair}a inet6 ${endpoint1} up + ifconfig -j genevetest2 ${epair}b inet6 ${endpoint2} up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 create genevemode l2 debug \ + geneveid $vni1 geneveremote ${endpoint2} genevelocal ${endpoint1} up + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 create genevemode l2 debug \ + geneveid $vni1 geneveremote ${endpoint1} genevelocal ${endpoint2} up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet ${v4tunnel1}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet6 ${v6tunnel1} + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet ${v4tunnel2}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet6 ${v6tunnel2} + + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v4tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v4tunnel1 + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v6tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v6tunnel1 +} + +ether_ipv6_cleanup() +{ + vnet_cleanup +} + +atf_test_case "inherit_ipv4" "cleanup" +inherit_ipv4_head() +{ + atf_set descr 'Create a geneve(4) l3 tunnel over an ipv4 underlay using epair and pass traffic between jails' + atf_set require.user root +} + +inherit_ipv4_body() +{ + local epair geneve1 geneve2 vni1 endpoint1 endpoint2 + local v4tunnel1 v4tunnel2 v6tunnel1 v6tunnel2 + + endpoint1=192.168.2.1 + endpoint2=192.168.2.2 + v4tunnel1=169.254.0.1 + v4tunnel2=169.254.0.2 + v6tunnel1=2001:db8::1 + v6tunnel2=2001:db8::2 + vni1=2 + + if ! kldstat -q -m if_geneve; then + atf_skip "This test requires if_geneve" + fi + + vnet_init + epair=$(vnet_mkepair) + vnet_mkjail genevetest1 ${epair}a + vnet_mkjail genevetest2 ${epair}b + + ifconfig -j genevetest1 ${epair}a inet ${endpoint1}/24 up + ifconfig -j genevetest2 ${epair}b inet ${endpoint2}/24 up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 create genevemode l3 debug \ + geneveid $vni1 geneveremote ${endpoint2} genevelocal ${endpoint1} up + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 create genevemode l3 debug \ + geneveid $vni1 geneveremote ${endpoint1} genevelocal ${endpoint2} up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet ${v4tunnel1}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet6 ${v6tunnel1} + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet ${v4tunnel2}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet6 ${v6tunnel2} + + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v4tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v4tunnel1 + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v6tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v6tunnel1 +} + +inherit_ipv4_cleanup() +{ + vnet_cleanup +} + +atf_test_case "inherit_ipv6" "cleanup" +inherit_ipv6_head() +{ + atf_set descr 'Create a geneve(4) l3 tunnel over an ipv6 underlay using epair and pass traffic between jails' + atf_set require.user root +} + +inherit_ipv6_body() +{ + local epair geneve1 geneve2 vni1 endpoint1 endpoint2 + local v4tunnel1 v4tunnel2 v6tunnel1 v6tunnel2 + + endpoint1=3fff::1 + endpoint2=3fff::2 + v4tunnel1=169.254.0.1 + v4tunnel2=169.254.0.2 + v6tunnel1=2001:db8::1 + v6tunnel2=2001:db8::2 + vni1=1 + + if ! kldstat -q -m if_geneve; then + atf_skip "This test requires if_geneve" + fi + + vnet_init + epair=$(vnet_mkepair) + vnet_mkjail genevetest1 ${epair}a + vnet_mkjail genevetest2 ${epair}b + + ifconfig -j genevetest1 ${epair}a inet6 ${endpoint1} up + ifconfig -j genevetest2 ${epair}b inet6 ${endpoint2} up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 create genevemode l3 debug \ + geneveid $vni1 geneveremote ${endpoint2} genevelocal ${endpoint1} up + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 create genevemode l3 debug \ + geneveid $vni1 geneveremote ${endpoint1} genevelocal ${endpoint2} up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet ${v4tunnel1}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet6 ${v6tunnel1} + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet ${v4tunnel2}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet6 ${v6tunnel2} + + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v4tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v4tunnel1 + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v6tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v6tunnel1 +} + +inherit_ipv6_cleanup() +{ + vnet_cleanup +} + +atf_test_case "ether_ipv6_blind_options" "cleanup" +ether_ipv6_blind_options_head() +{ + atf_set descr 'Create a geneve(4) l2 ipv6 tunnel and test geneve options' + atf_set require.user root +} + +ether_ipv6_blind_options_body() +{ + local epair geneve1 geneve2 vni1 endpoint1 endpoint2 + local v6tunnel1 v6tunnel2 + + endpoint1=3fff::1 + endpoint2=3fff::2 + v6tunnel1=2001:db8::1 + v6tunnel2=2001:db8::2 + vni1=1 + + if ! kldstat -q -m if_geneve; then + atf_skip "This test requires if_geneve" + fi + + vnet_init + epair=$(vnet_mkepair) + vnet_mkjail genevetest1 ${epair}a + vnet_mkjail genevetest2 ${epair}b + + ifconfig -j genevetest1 ${epair}a inet6 ${endpoint1} up + ifconfig -j genevetest2 ${epair}b inet6 ${endpoint2} up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 create genevemode l2 debug \ + geneveid $vni1 geneveremote ${endpoint2} genevelocal ${endpoint1} up + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 create genevemode l2 debug \ + geneveid $vni1 geneveremote ${endpoint1} genevelocal ${endpoint2} up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet6 ${v6tunnel1} + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet6 ${v6tunnel2} + + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v6tunnel2 + + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 genevemaxaddr 1000 + atf_check -s exit:0 -o match:"max: 1000" ifconfig -j genevetest1 -v geneve1 + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 genevetimeout 1000 + atf_check -s exit:0 -o match:"timeout: 1000" ifconfig -j genevetest1 -v geneve1 + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 -genevelearn + atf_check -s exit:0 -o match:"mode: nolearning" ifconfig -j genevetest1 -v geneve1 + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 genevelearn + atf_check -s exit:0 -o match:" learning" ifconfig -j genevetest1 -v geneve1 + atf_check -s exit:0 -o match:"count: 1" ifconfig -j genevetest1 -v geneve1 + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 geneveflush + atf_check -s exit:0 -o match:"count: 0" ifconfig -j genevetest1 -v geneve1 + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 geneveflushall + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 genevettl inherit + atf_check -s exit:0 -o match:"ttl: inherit" ifconfig -j genevetest1 -v geneve1 + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 genevettl 1 + atf_check -s exit:0 -o match:"ttl: 1" ifconfig -j genevetest1 -v geneve1 + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 down genevedf set up + atf_check -s exit:0 -o match:"df: set" ifconfig -j genevetest1 -v geneve1 + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 down genevedf inherit up + atf_check -s exit:0 -o match:"df: inherit" ifconfig -j genevetest1 -v geneve1 + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 down genevedf unset up + atf_check -s exit:0 -o match:"df: unset" ifconfig -j genevetest1 -v geneve1 + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 genevedscpinherit + atf_check -s exit:0 -o match:"dscp: inherit" ifconfig -j genevetest1 -v geneve1 + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 -genevedscpinherit + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 geneveexternal + atf_check -s exit:0 -o match:" external" ifconfig -j genevetest1 -v geneve1 + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 -geneveexternal + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 down geneveportrange 11000 62000 up + atf_check -s exit:0 -o match:"portrange: 11000-62000" ifconfig -j genevetest1 -v geneve1 + + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v6tunnel1 +} + +ether_ipv6_blind_options_cleanup() +{ + vnet_cleanup +} + +atf_test_case "ether_ipv6_external" "cleanup" +ether_ipv6_external_head() +{ + atf_set descr 'Create a geneve(4) l2 ipv6 tunnel and test geneve collect metadata' + atf_set require.user root +} + +ether_ipv6_external_body() +{ + local epair geneve1 geneve2 vni1 endpoint1 endpoint2 + local v6tunnel1 v6tunnel2 + + endpoint1=3fff::1 + endpoint2=3fff::2 + v6tunnel1=2001:db8::1 + v6tunnel2=2001:db8::2 + vni1=1 + + if ! kldstat -q -m if_geneve; then + atf_skip "This test requires if_geneve" + fi + + vnet_init + epair=$(vnet_mkepair) + vnet_mkjail genevetest1 ${epair}a + vnet_mkjail genevetest2 ${epair}b + + ifconfig -j genevetest1 ${epair}a inet6 ${endpoint1} up + ifconfig -j genevetest2 ${epair}b inet6 ${endpoint2} up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 create genevemode l2 debug \ + geneveid $vni1 geneveremote ${endpoint2} genevelocal ${endpoint1} up + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 create genevemode l2 debug \ + geneveid $vni1 geneveremote ${endpoint1} genevelocal ${endpoint2} up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet6 ${v6tunnel1} + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet6 ${v6tunnel2} + + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v6tunnel2 + + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 geneveexternal + atf_check -s exit:16 -e ignore ifconfig -j genevetest1 geneve1 down geneveid 10 up + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 -geneveexternal + atf_check -s exit:0 -o ignore ifconfig -j genevetest1 geneve1 down geneveid 10 up + +} + +ether_ipv6_external_cleanup() +{ + vnet_cleanup +} + +atf_test_case "ether_ipv4_multicast" "cleanup" +ether_ipv4_multicast_head() +{ + atf_set descr 'Create a geneve(4) l2 ipv4 multicast tunnel using epair and pass traffic between jails' + atf_set require.user root +} + +ether_ipv4_multicast_body() +{ + local epair geneve1 geneve2 vni1 endpoint1 endpoint2 mc_group + local v4tunnel1 v4tunnel2 v6tunnel1 v6tunnel2 + + endpoint1=192.168.2.1 + endpoint2=192.168.2.2 + mc_group=239.0.0.1 + v4tunnel1=169.254.0.1 + v4tunnel2=169.254.0.2 + v6tunnel1=2001:db8::1 + v6tunnel2=2001:db8::2 + vni1=1 + + if ! kldstat -q -m if_geneve; then + atf_skip "This test requires if_geneve" + fi + if ! kldstat -q -m ip_mroute; then + atf_skip "This test requires ip_mroute" + fi + + vnet_init + epair=$(vnet_mkepair) + vnet_mkjail genevetest1 ${epair}a + vnet_mkjail genevetest2 ${epair}b + + ifconfig -j genevetest1 ${epair}a inet ${endpoint1}/24 up + ifconfig -j genevetest2 ${epair}b inet ${endpoint2}/24 up + + # manually add the multicast routes to epairs + route -j genevetest1 add -net 239.0.0.0/8 -interface ${epair}a + route -j genevetest2 add -net 239.0.0.0/8 -interface ${epair}b + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 create genevemode l2 debug \ + geneveid $vni1 genevelocal ${endpoint1} \ + genevegroup ${mc_group} genevedev ${epair}a up + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 create genevemode l2 debug \ + geneveid $vni1 genevelocal ${endpoint2} \ + genevegroup ${mc_group} genevedev ${epair}b up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet ${v4tunnel1}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet6 ${v6tunnel1} + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet ${v4tunnel2}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet6 ${v6tunnel2} + + atf_check -s exit:0 -o match:"group 239.0.0.1" jexec genevetest1 ifmcstat -i ${epair}a -f inet + atf_check -s exit:0 -o match:"group 239.0.0.1" jexec genevetest2 ifmcstat -i ${epair}b -f inet + + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v4tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v6tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v4tunnel1 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v6tunnel1 + +} + +ether_ipv4_multicast_cleanup() +{ + vnet_cleanup +} + +atf_test_case "ether_ipv6_multicast" "cleanup" +ether_ipv6_multicast_head() +{ + atf_set descr 'Create a geneve(4) l2 ipv6 multicast tunnel using epair and pass traffic between jails' + atf_set require.user root +} + +ether_ipv6_multicast_body() +{ + local epair geneve1 geneve2 vni1 endpoint1 endpoint2 mc_group + local v4tunnel1 v4tunnel2 v6tunnel1 v6tunnel2 + + endpoint1=3fff::1 + endpoint2=3fff::2 + mc_group=ff08::db8:0:1 + v4tunnel1=169.254.0.1 + v4tunnel2=169.254.0.2 + v6tunnel1=2001:db8::1 + v6tunnel2=2001:db8::2 + vni1=1 + + if ! kldstat -q -m if_geneve; then + atf_skip "This test requires if_geneve" + fi + if ! kldstat -q -m ip6_mroute; then + atf_skip "This test requires ip6_mroute" + fi + + vnet_init + epair=$(vnet_mkepair) + vnet_mkjail genevetest1 ${epair}a + vnet_mkjail genevetest2 ${epair}b + + ifconfig -j genevetest1 ${epair}a inet6 ${endpoint1} up + ifconfig -j genevetest2 ${epair}b inet6 ${endpoint2} up + + # manually add the multicast routes to epairs + route -j genevetest1 -n6 add -net ff08::db8:0:1/96 -interface ${epair}a + route -j genevetest2 -n6 add -net ff08::db8:0:1/96 -interface ${epair}b + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 create genevemode l2 debug \ + geneveid $vni1 genevelocal ${endpoint1} \ + genevegroup ${mc_group} genevedev ${epair}a up + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 create genevemode l2 debug \ + geneveid $vni1 genevelocal ${endpoint2} \ + genevegroup ${mc_group} genevedev ${epair}b up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet ${v4tunnel1}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet6 ${v6tunnel1} + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet ${v4tunnel2}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet6 ${v6tunnel2} + + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v4tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v6tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v4tunnel1 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v6tunnel1 + +} + +ether_ipv6_multicast_cleanup() +{ + vnet_cleanup +} + +atf_test_case "ether_ipv4_multicast_without_dev" "cleanup" +ether_ipv4_multicast_without_dev_head() +{ + atf_set descr 'Create a geneve(4) l2 ipv4 multicast tunnel without specifying genevedev using epair and pass traffic between jails' + atf_set require.user root +} + +ether_ipv4_multicast_without_dev_body() +{ + local epair geneve1 geneve2 vni1 endpoint1 endpoint2 mc_group + local v4tunnel1 v4tunnel2 v6tunnel1 v6tunnel2 + + endpoint1=192.168.2.1 + endpoint2=192.168.2.2 + mc_group=239.0.0.1 + v4tunnel1=169.254.0.1 + v4tunnel2=169.254.0.2 + v6tunnel1=2001:db8::1 + v6tunnel2=2001:db8::2 + vni1=1 + + if ! kldstat -q -m if_geneve; then + atf_skip "This test requires if_geneve" + fi + if ! kldstat -q -m ip_mroute; then + atf_skip "This test requires ip_mroute" + fi + + vnet_init + epair=$(vnet_mkepair) + vnet_mkjail genevetest1 ${epair}a + vnet_mkjail genevetest2 ${epair}b + + ifconfig -j genevetest1 ${epair}a inet ${endpoint1}/24 up + ifconfig -j genevetest2 ${epair}b inet ${endpoint2}/24 up + + # manually add the multicast routes to epairs + route -j genevetest1 add -net 239.0.0.0/8 -interface ${epair}a + route -j genevetest2 add -net 239.0.0.0/8 -interface ${epair}b + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 create genevemode l2 debug \ + geneveid $vni1 genevelocal ${endpoint1} genevegroup ${mc_group} up + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 create genevemode l2 debug \ + geneveid $vni1 genevelocal ${endpoint2} genevegroup ${mc_group} up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet ${v4tunnel1}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet6 ${v6tunnel1} + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet ${v4tunnel2}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet6 ${v6tunnel2} + + atf_check -s exit:0 -o match:"group 239.0.0.1" jexec genevetest1 ifmcstat -i ${epair}a -f inet + atf_check -s exit:0 -o match:"group 239.0.0.1" jexec genevetest2 ifmcstat -i ${epair}b -f inet + + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v4tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v6tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v4tunnel1 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v6tunnel1 + +} + +ether_ipv4_multicast_without_dev_cleanup() +{ + vnet_cleanup +} + + +atf_test_case "ether_ipv6_multicast_without_dev" "cleanup" +ether_ipv6_multicast_without_dev_head() +{ + atf_set descr 'Create a geneve(4) l2 ipv6 multicast tunnel without specifying genevedev using epair and pass traffic between jails' + atf_set require.user root +} + +ether_ipv6_multicast_without_dev_body() +{ + local epair geneve1 geneve2 vni1 endpoint1 endpoint2 mc_group + local v4tunnel1 v4tunnel2 v6tunnel1 v6tunnel2 + + endpoint1=3fff::1 + endpoint2=3fff::2 + mc_group=ff08::db8:0:1 + v4tunnel1=169.254.0.1 + v4tunnel2=169.254.0.2 + v6tunnel1=2001:db8::1 + v6tunnel2=2001:db8::2 + vni1=1 + + if ! kldstat -q -m if_geneve; then + atf_skip "This test requires if_geneve" + fi + if ! kldstat -q -m ip6_mroute; then + atf_skip "This test requires ip6_mroute" + fi + + vnet_init + epair=$(vnet_mkepair) + vnet_mkjail genevetest1 ${epair}a + vnet_mkjail genevetest2 ${epair}b + + ifconfig -j genevetest1 ${epair}a inet6 ${endpoint1} up + ifconfig -j genevetest2 ${epair}b inet6 ${endpoint2} up + + # manually add the multicast routes to epairs + route -j genevetest1 -n6 add -net ff08::db8:0:1/96 -interface ${epair}a + route -j genevetest2 -n6 add -net ff08::db8:0:1/96 -interface ${epair}b + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 create genevemode l2 debug \ + geneveid $vni1 genevelocal ${endpoint1} genevegroup ${mc_group} up + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 create genevemode l2 debug \ + geneveid $vni1 genevelocal ${endpoint2} genevegroup ${mc_group} up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet ${v4tunnel1}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet6 ${v6tunnel1} + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet ${v4tunnel2}/24 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet6 ${v6tunnel2} + + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v4tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v6tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v4tunnel1 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v6tunnel1 + +} + +ether_ipv6_multicast_without_dev_cleanup() +{ + vnet_cleanup +} + +atf_test_case "inherit_ipv4_multicast" "cleanup" +inherit_ipv4_multicast_head() +{ + atf_set descr 'Create a geneve(4) l3 ipv4 multicast tunnel using epair and pass traffic between jails' + atf_set require.user root +} + +inherit_ipv4_multicast_body() +{ + local epair geneve1 geneve2 vni1 endpoint1 endpoint2 mc_group + local v4tunnel1 v4tunnel2 v6tunnel1 v6tunnel2 + + endpoint1=192.168.2.1 + endpoint2=192.168.2.2 + mc_group=239.0.0.1 + v4tunnel1=169.254.0.1 + v4tunnel2=169.254.0.2 + v6tunnel1=2001:db8::1 + v6tunnel2=2001:db8::2 + vni1=1 + + if ! kldstat -q -m if_geneve; then + atf_skip "This test requires if_geneve" + fi + if ! kldstat -q -m ip_mroute; then + atf_skip "This test requires ip_mroute" + fi + + vnet_init + epair=$(vnet_mkepair) + vnet_mkjail genevetest1 ${epair}a + vnet_mkjail genevetest2 ${epair}b + + ifconfig -j genevetest1 ${epair}a inet ${endpoint1}/24 up + ifconfig -j genevetest2 ${epair}b inet ${endpoint2}/24 up + + # manually add the multicast routes to epairs + route -j genevetest1 add -net 239.0.0.0/8 -interface ${epair}a + route -j genevetest2 add -net 239.0.0.0/8 -interface ${epair}b + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 create genevemode l3 debug \ + geneveid $vni1 genevelocal ${endpoint1} \ + genevegroup ${mc_group} genevedev ${epair}a up + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 create genevemode l3 debug \ + geneveid $vni1 genevelocal ${endpoint2} \ + genevegroup ${mc_group} genevedev ${epair}b up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet ${v4tunnel1}/30 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet6 ${v6tunnel1} + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet ${v4tunnel2}/30 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet6 ${v6tunnel2} + + atf_check -s exit:0 -o ignore sysctl -j genevetest1 net.inet.icmp.bmcastecho=1 + atf_check -s exit:0 -o ignore sysctl -j genevetest2 net.inet.icmp.bmcastecho=1 + + atf_check -s exit:0 -o match:"group 239.0.0.1" jexec genevetest1 ifmcstat -i ${epair}a -f inet + atf_check -s exit:0 -o match:"group 239.0.0.1" jexec genevetest2 ifmcstat -i ${epair}b -f inet + + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v4tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v4tunnel1 + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v6tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v6tunnel1 + +} + +inherit_ipv4_multicast_cleanup() +{ + vnet_cleanup +} + +atf_test_case "inherit_ipv6_multicast" "cleanup" +inherit_ipv6_multicast_head() +{ + atf_set descr 'Create a geneve(4) l3 ipv6 multicast tunnel using epair and pass traffic between jails' + atf_set require.user root +} + +inherit_ipv6_multicast_body() +{ + local epair geneve1 geneve2 vni1 endpoint1 endpoint2 mc_group + local v4tunnel1 v4tunnel2 v6tunnel1 v6tunnel2 + + endpoint1=3fff::1 + endpoint2=3fff::2 + mc_group=ff08::db8:0:1 + v4tunnel1=169.254.0.1 + v4tunnel2=169.254.0.2 + v6tunnel1=2001:db8::1 + v6tunnel2=2001:db8::2 + vni1=1 + + if ! kldstat -q -m if_geneve; then + atf_skip "This test requires if_geneve" + fi + if ! kldstat -q -m ip6_mroute; then + atf_skip "This test requires ip6_mroute" + fi + + vnet_init + epair=$(vnet_mkepair) + vnet_mkjail genevetest1 ${epair}a + vnet_mkjail genevetest2 ${epair}b + + ifconfig -j genevetest1 ${epair}a inet6 ${endpoint1} up + ifconfig -j genevetest2 ${epair}b inet6 ${endpoint2} up + + # manually add the multicast routes to epairs + route -j genevetest1 -n6 add -net ff08::db8:0:1/96 -interface ${epair}a + route -j genevetest2 -n6 add -net ff08::db8:0:1/96 -interface ${epair}b + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 create genevemode l3 debug \ + geneveid $vni1 genevelocal ${endpoint1} \ + genevegroup ${mc_group} genevedev ${epair}a up + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 create genevemode l3 debug \ + geneveid $vni1 genevelocal ${endpoint2} \ + genevegroup ${mc_group} genevedev ${epair}b up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet ${v4tunnel1}/30 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet6 ${v6tunnel1} + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet ${v4tunnel2}/30 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet6 ${v6tunnel2} + + atf_check -s exit:0 -o ignore sysctl -j genevetest1 net.inet.icmp.bmcastecho=1 + atf_check -s exit:0 -o ignore sysctl -j genevetest2 net.inet.icmp.bmcastecho=1 + + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v6tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v6tunnel1 + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v4tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v4tunnel1 + +} + +inherit_ipv6_multicast_cleanup() +{ + vnet_cleanup +} + +atf_test_case "inherit_ipv4_multicast_without_dev" "cleanup" +inherit_ipv4_multicast_without_dev_head() +{ + atf_set descr 'Create a geneve(4) l3 ipv4 multicast tunnel without specifying genevedev using epair and pass traffic between jails' + atf_set require.user root +} + +inherit_ipv4_multicast_without_dev_body() +{ + local epair geneve1 geneve2 vni1 endpoint1 endpoint2 mc_group + local v4tunnel1 v4tunnel2 v6tunnel1 v6tunnel2 + + endpoint1=192.168.2.1 + endpoint2=192.168.2.2 + mc_group=239.0.0.1 + v4tunnel1=169.254.0.1 + v4tunnel2=169.254.0.2 + v6tunnel1=2001:db8::1 + v6tunnel2=2001:db8::2 + vni1=1 + + if ! kldstat -q -m if_geneve; then + atf_skip "This test requires if_geneve" + fi + if ! kldstat -q -m ip_mroute; then + atf_skip "This test requires ip_mroute" + fi + + vnet_init + epair=$(vnet_mkepair) + vnet_mkjail genevetest1 ${epair}a + vnet_mkjail genevetest2 ${epair}b + + ifconfig -j genevetest1 ${epair}a inet ${endpoint1}/24 up + ifconfig -j genevetest2 ${epair}b inet ${endpoint2}/24 up + + # manually add the multicast routes to epairs + route -j genevetest1 add -net 239.0.0.0/8 -interface ${epair}a + route -j genevetest2 add -net 239.0.0.0/8 -interface ${epair}b + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 create genevemode l3 debug \ + geneveid $vni1 genevelocal ${endpoint1} genevegroup ${mc_group} up + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 create genevemode l3 debug \ + geneveid $vni1 genevelocal ${endpoint2} genevegroup ${mc_group} up + + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet ${v4tunnel1}/30 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest1 geneve1 inet6 ${v6tunnel1} + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet ${v4tunnel2}/30 + atf_check -s exit:0 -o ignore \ + ifconfig -j genevetest2 geneve1 inet6 ${v6tunnel2} + + atf_check -s exit:0 -o ignore sysctl -j genevetest1 net.inet.icmp.bmcastecho=1 + atf_check -s exit:0 -o ignore sysctl -j genevetest2 net.inet.icmp.bmcastecho=1 + + atf_check -s exit:0 -o match:"group 239.0.0.1" jexec genevetest1 ifmcstat -i ${epair}a -f inet + atf_check -s exit:0 -o match:"group 239.0.0.1" jexec genevetest2 ifmcstat -i ${epair}b -f inet + + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v4tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v4tunnel1 + atf_check -s exit:0 -o ignore jexec genevetest1 ping -nc 1 -t 1 $v6tunnel2 + atf_check -s exit:0 -o ignore jexec genevetest2 ping -nc 1 -t 1 $v6tunnel1 + +} + +inherit_ipv4_multicast_without_dev_cleanup() +{ + vnet_cleanup +} + + +atf_test_case "inherit_ipv6_multicast_without_dev" "cleanup" +inherit_ipv6_multicast_without_dev_head() +{ + atf_set descr 'Create a geneve(4) l3 ipv6 multicast tunnel without specifying genevedev using epair and pass traffic between jails' + atf_set require.user root +} + +inherit_ipv6_multicast_without_dev_body() +{ + local epair geneve1 geneve2 vni1 endpoint1 endpoint2 mc_group + local v4tunnel1 v4tunnel2 v6tunnel1 v6tunnel2 + + endpoint1=3fff::1 + endpoint2=3fff::2 + mc_group=ff08::db8:0:1 + v4tunnel1=169.254.0.1 + v4tunnel2=169.254.0.2 + v6tunnel1=2001:db8::1 + v6tunnel2=2001:db8::2 + vni1=1 + + if ! kldstat -q -m if_geneve; then + atf_skip "This test requires if_geneve" + fi *** 65 LINES SKIPPED *** From nobody Mon Apr 13 14:17:00 2026 X-Original-To: dev-commits-src-main@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 4fvTxS678Lz6ZDrg for ; Mon, 13 Apr 2026 14:17:00 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvTxS2wBXz3ngn for ; Mon, 13 Apr 2026 14:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776089820; 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=76RRfpYQDk7gy/g5+BGkNopxNbUBd0deVMrWWe539PM=; b=P1OeFJ/nVh5ngfatc8kJKZ6JNsL1Ak49qjjTdgaHKVzKdtm9uBe060xTpcsuuA/QM8+NZr iEFyqvmyl+fxH5eeo8+jiTJ5rUiI0fLY+xsG/0j46QUEdt8OkXNkfZls2MJ6usZ3YTi960 yb36+WHjmVHs2KMyPKsGWwMV+rbwubNffoT4hcSQy58EgSPUiqlgKA8xc4R20ohuFIa//1 HBj8qHrnwZkeRyzNBEfoCp9gcdH7AjKpz+2X8GKQrH3JwYVeLKOSwOmAhGZUEqRb3gHBQR 4yz0XiHH33dT0sO76rp/VTkFkxsf6LfOjnuDcGPstltek66AmkzSOkaXbNaBSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776089820; a=rsa-sha256; cv=none; b=fOScEPLZpAoG4BBE3kRMyQfIfZghdxzc32H4yBUeENUAQy7iYhLzmPuavp6bDftM7K7aHi 5H55K6WQcLDB9p4Ejdnc64nffpjvjO1kY7mjZEWg25aOYPR19uIeQS1USxH57qCli1JCxc TqakUI+NFlzxtlowNjs3h3rpRdl+QnOsGRg6/5QEjbeHd+wLW6GZIuOwi74Z5vBTSdTq5m tDW3U39sdTRtL3+vCxJOAoZQipAkmep8yIFSZ7lWcofBbHFiCpmq7+pVxjMJo2gEpJmWHd HlOYSedJYmfQDriG/14i47SOrvkfTBp+lsGAjapwhMXuqAEaZAiqUaKIfmOI9Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776089820; 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=76RRfpYQDk7gy/g5+BGkNopxNbUBd0deVMrWWe539PM=; b=ff6XvOg7lyuZazZMhcb67UcSXyCfsfULutr8+sVrriR9uVc3TbkNKgcsOS+JWPCNfL0QR+ A1PohNas8JqXFRKsVJrx6pgPxnddBslPehQZvREpx6XcQhULNtRenBtyXH30aTxxUQL61n ufbNEzjdYhe9oQooZjUcyPyZEmcyUys1im2RSV3d+Jaq5CZboz1vILNnRAba0ozrk66Q5F x1qjd+0FkB6+XTQ4h/EtVtU3BaBkCVzwRSL0JsJSR/1187UCVwNkRj4+gILh8g7qPaoDd2 LgQKOYOJ5vW6Kd/oRFDF8UBBibmXgUTt8+T+KUXMXzb5vPRg4ThV1IbbxXzi4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvTxS1SBBz16d5 for ; Mon, 13 Apr 2026 14:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46149 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 14:17:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: adecd4c4cd05 - main - geneve.4: Add geneve manual List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: adecd4c4cd05b404ff81dbfce88b772e2b754a7f Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 14:17:00 +0000 Message-Id: <69dcfadc.46149.2775e088@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=adecd4c4cd05b404ff81dbfce88b772e2b754a7f commit adecd4c4cd05b404ff81dbfce88b772e2b754a7f Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-11 18:51:58 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-13 14:15:05 +0000 geneve.4: Add geneve manual Reviewed by: ziaee, adrian Differential Revision: https://reviews.freebsd.org/D55182 --- share/man/man4/Makefile | 2 + share/man/man4/geneve.4 | 384 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 386 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 6883cdd7d6cf..7920b2006822 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -187,6 +187,7 @@ MAN= aac.4 \ gem.4 \ genet.4 \ genetlink.4 \ + geneve.4 \ geom.4 \ geom_linux_lvm.4 \ geom_uzip.4 \ @@ -728,6 +729,7 @@ MLINKS+=fwip.4 if_fwip.4 MLINKS+=fxp.4 if_fxp.4 MLINKS+=gem.4 if_gem.4 MLINKS+=genet.4 if_genet.4 +MLINKS+=geneve.4 if_geneve.4 MLINKS+=geom.4 GEOM.4 MLINKS+=gif.4 if_gif.4 MLINKS+=gpio.4 gpiobus.4 diff --git a/share/man/man4/geneve.4 b/share/man/man4/geneve.4 new file mode 100644 index 000000000000..fdb752c0a8be --- /dev/null +++ b/share/man/man4/geneve.4 @@ -0,0 +1,384 @@ +.\" +.\" Copyright (c) 2025-2026 Pouria Mousavizadeh Tehrani +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd March 31, 2026 +.Dt GENEVE 4 +.Os +.Sh NAME +.Nm geneve +.Nd Generic Network Virtualization Encapsulation interface +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Cd device geneve +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Cd if_geneve_load="YES" +.Sh DESCRIPTION +The +.Nm +driver creates a generic network virtualization tunnel interfaces +for Tentant Systems over an L3 (IP/UDP) underlay network that provides +a Layer 2 (ethernet) or Layer 3 service using +.Nm +protocol. +.Pp +This driver corresponds to RFC 8926 for format specification and by default +uses the multicast-learning-based approach for its control plane. +To provide control plane independence all of the driver-specific operations +are implemented using +.Xr rtnetlink 4 +and all the +.Xr ioctl 2 +calls are implemented using the +.Xr nv 9 +library. +Each +.Nm +interface is created at runtime using interface cloning. +This is most easily done with the +.Xr ifconfig 8 +.Cm create +command or using the +.Va cloned_interfaces +variable in +.Xr rc.conf 5 . +The interface may be removed with the +.Xr ifconfig 8 +.Cm destroy +command. +.Pp +The +.Nm +interface must be configured in either L2 or L3 mode. +An L2 +.Nm +tunnel could be used as a backplane between the virtual switches +residing in hypervisors, switches, or other appliances. +.Pp +The L3 +.Nm +tunnel provides virtualized IP forwarding service similar to IP/VRF. +.Pp +By default the +.Nm +driver creates an L2 interface that supports the usual network +.Xr ioctl 2 Ns s +and thus can be used with +.Xr ifconfig 8 +like any other Ethernet interface. +An L2 +.Nm +interface encapsulates the Ethernet frame by prepending IP/UDP and +.Nm +headers. +Thus, the encapsulated (inner) frame is able to be transmitted +over a routed, Layer 3 network to the remote host. +.Pp +The +.Nm +interface may be configured in either unicast or multicast mode. +When in unicast mode, +the interface creates a tunnel to a single remote host, +and all traffic is transmitted to that host. +When in multicast mode, +the interface joins an IP multicast group, +and receives packets sent to the group address, +and transmits packets to either the multicast group address, +or directly to the remote host if there is an appropriate +forwarding table entry. +.Pp +When the +.Nm +interface is brought up, a +.Xr udp 4 +.Xr socket 9 +is created based on the configuration, +such as the local address for unicast mode or +the group address for multicast mode, +and the listening (local) port number. +Since multiple +.Nm +interfaces may be created that either +use the same local address +or join the same group address, +and use the same port, +the driver may share a socket among multiple interfaces. +However, each interface within a socket must belong to +a unique +.Nm +segment per +.Xr vnet 9 . +The analogous +.Xr vlan 4 +configuration would be a physical interface configured as +the parent device for multiple VLAN interfaces, each with +a unique VLAN tag. +Each +.Nm +segment is identified by a 24-bit value in the +.Nm +header called the +.Dq Virtual Network Identifier , +or VNI. +This value can be set with +.Xr ifconfig 8 +.Cm geneveid +parameter. +.Pp +When configured with the +.Xr ifconfig 8 +.Cm genevelearn +parameter, the interface dynamically creates forwarding table entries +from received packets. +An entry in the forwarding table maps the inner source MAC address +to the outer remote IP address. +During transmit, the interface attempts to lookup an entry for +the encapsulated destination MAC address. +If an entry is found, the IP address in the entry is used to directly +transmit the encapsulated frame to the destination. +Otherwise, when configured in multicast mode, +the interface must flood the frame to all hosts in the group. +The maximum number of entries in the table is configurable with the +.Xr ifconfig 8 +.Cm genevemaxaddr +command. +Stale entries in the table are periodically pruned. +The timeout is configurable with the +.Xr ifconfig 8 +.Cm genevetimeout +command. +.Ss MTU +Since the +.Nm +interface encapsulates the Ethernet frame with an IP, UDP, and +.Nm +header, the resulting frame may be larger than the MTU of the +physical network. +The +.Nm +specification recommends the physical network MTU be configured +to use jumbo frames to accommodate the encapsulated frame size. +.Pp +By default, the +.Nm +driver sets its MTU to usual ethernet MTU of 1500 bytes, reduced by +the size of geneve headers prepended which is depends on +.Cm genevemode . +.Pp +Alternatively, the +.Xr ifconfig 8 +.Cm mtu +command may be used to set the fixed MTU size on the +.Nm +interface to allow the encapsulated frame to fit in the +current MTU of the physical network. +If the +.Cm mtu +command was used, system no longer adjust the +.Nm +interface MTU on routing or address changes. +.Ss Hop Limit +TTL value of +.Nm +interface can change by using the +.Xr ifconfig 8 +.Cm genevettl +command and it also can be inherited from carrying packet. +You can set the +.Cm genevettl +to a number value or +.Cm inherit +option to be inherited at the encapsulation and decapsulation point. +.Ss Traffic Class +Just like the TTL value, ToS value can be inherited at the encapsulation point +using +.Xr ifconfig 8 +.Cm genevedscpinherit . +As defined in RFC 8926, ECN value follows the RFC 6040 for both ingress and +egress traffic. +.Ss Don't Fragment +To make sure fragmentation does not happing during transmission, you can +set the +.Xr ifconfig 8 +.Cm genevedf +value to +.Cm set +value which sets the DF bit on IPv4 header and IP_DONTFRAG option on both IPv4 +and IPv6 sockets. +Similar to other options, it can be set to +.Cm inherit +value. +.Ss Multicast +To create the +.Nm +interface with multicast underlay, one must use +.Xr ifconfig 8 +.Cm genevegroup +instead of +.Cm geneveremote +and set it to a multicast address (e.g. ff08::db8:0:1, 239.0.0.1). +One can set the outbound multicast interface with +.Xr ifconfig 8 +.Cm genevedev +to bound its multicast group to specific interface. +.Pp +The +.Cm ip_mroute +kernel module for IPv4 underlay and +.Cm ip6_mroute +for IPv6 underlay must be loaded for +.Xr multicast 4 +to function. +.Sh HARDWARE +The +.Nm +driver supports hardware checksum offload (receive and transmit) and TSO on the +encapsulated traffic over physical interfaces that support these features. +The +.Nm +interface examines the +.Cm genevedev +interface, if one is specified, or the interface hosting the +.Cm genevelocal +address, and configures its capabilities based on the hardware offload +capabilities of that physical interface. +If multiple physical interfaces will transmit or receive traffic for the +.Nm +then they all must have the same hardware capabilities. +The transmit routine of a +.Nm +interface may fail with +.Er ENXIO +if an outbound physical interface does not support +an offload that the +.Nm +interface is requesting. +This can happen if there are multiple physical interfaces involved, with +different hardware capabilities, or an interface capability was disabled after +the +.Nm +interface had already started. +.Sh EXAMPLES +.Bd -literal + Host A (198.51.100.10) + +--------------------+ + | VNI 100 10.1.1.0/24| + | VNI 200 10.2.2.0/24| + +---------+----------+ + | + (198.51.100.0/24) + | + +---------------v---------------+ + | Host B (203.0.113.1) | + | +------+-------+ | + | geneve0| |geneve1| + | +------v----+ +-----v-----+ | + | | bridge0 | | bridge1 | | + | | (VNI 100) | | (VNI 200) | | + | +------+----+ +----+------+ | + | | | | + +--------v-------------v--------+ + epair0b| |epair1b + +------+----+ +----+------+ + | Jail A | | Jail B | + | (10.1.1.x)| | (10.2.2.x)| + +-----------+ +-----------+ +.Ed +Assume host A has the (external) IP address 198.51.100.10 and +two internal addresses of 10.1.1.1/24 and 10.2.2.1/24, while +host B has the external address of 203.0.113.10 and two jails +with their own separate +.Xr VNET 9 . +the following commands will configure the tunnel: +.Pp +On host A, create a l2 +.Nm +interface in unicast mode: +.Bd -literal +ifconfig geneve0 create geneveid 100 genevelocal 198.51.100.10 geneveremote 203.0.113.1 +ifconfig geneve1 create geneveid 200 genevelocal 198.51.100.10 geneveremote 203.0.113.1 +.Ed +.Pp +On host B: +.Bd -literal +ifconfig geneve0 create geneveid 100 genevelocal 203.0.113.1 geneveremote 198.51.100.10 +ifconfig geneve1 create geneveid 200 genevelocal 203.0.113.1 geneveremote 198.51.100.10 +ifconfig bridge0 addm geneve0 addm epair0a +ifconfig bridge1 addm geneve1 addm epair1a +.Ed +.Pp +The example below demonstrate multicast configuration with IPv6: +.Bd -literal + ----------- VNI 42 ----------- + / \\ +2001:db8::1/64 --- Host A ------ Multicast ------- Host B --- 2001:db8::2/64 + 3fff::1 [em0] ff08::db8:1 [em0] 3fff::2 +.Ed +.Pp +Create a +.Nm +interface in multicast mode, +with the +.Cm genevelocal +address of 3fff::1, +and the +.Cm genevegroup +address of ff08::db8:0:1. +The em0 interface will be used to transmit multicast packets. +On host A: +.Bd -literal +ifconfig geneve0 create geneveid 42 genevelocal 3fff::1 genevegroup ff08::db8:1 genevedev em0 +.Ed +.Pp +On host B: +.Bd -literal +ifconfig geneve0 create geneveid 42 genevelocal 3fff::2 genevegroup ff08::db8:1 genevedev em0 +.Ed +.Pp +Once created, the +.Nm +interface can be configured with +.Xr ifconfig 8 . +.Pp +The following when placed in the file +.Pa /etc/rc.conf +will cause a geneve interface called +.Dq Li geneve0 +to be created, and will configure the interface in unicast mode. +.Bd -literal +cloned_interfaces="geneve0" +create_args_geneve0="geneveid 108 genevelocal 192.168.100.1 geneveremote 192.168.100.2" +.Ed +.Sh SEE ALSO +.Xr inet 4 , +.Xr inet6 4 , +.Xr multicast 4 , +.Xr rtnetlink 4 , +.Xr vlan 4 , +.Xr rc.conf 5 , +.Xr ifconfig 8 , +.Xr sysctl 8 +.Rs +.%A "J. Gross, Ed." +.%A "I. Gross, Ed." +.%A "T. Sridhar, Ed." +.%T "Geneve: Generic Network Virtualization Encapsulation" +.%D November 2020 +.%O "RFC 8926" +.Re +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Seyed Pouria Mousavizadeh Tehrani Aq info@spmzt.net +.Sh BUGS +Current geneve implementation with netlink can't set geneve options +other than genevemode during interface cloning in ifconfig without +specifying the interface index. From nobody Mon Apr 13 14:17:01 2026 X-Original-To: dev-commits-src-main@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 4fvTxT61MKz6ZDwq for ; Mon, 13 Apr 2026 14:17:01 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvTxT2YhMz3nk7 for ; Mon, 13 Apr 2026 14:17:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776089821; 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=F8T5pEqnGJ5oTIUfUDjqy3aKk5bWufE99duA3nW7p98=; b=fkD6qIvRM/ip7o7aLoaF/9tS7ITgAgYwv3zIh0/Ko1i1XITsrOqpEwDhpBFILuEjKsEbHt hYZ7qeszYOzizkOr6TNM2/OVeJfPKhyEQ2BMCUTxXBi046ADlIXWawjlF+zPgjmZAyPHa3 GCkT02kXbbVkWLrXpzT754D3vSDUmtsftvEEDJ4TdaJ3zNbcjtnkLa55vKO1Sv6H/vPq/u UM4lS1HqFsdxd7+MIDtY5F9foswqG/PCEM5KzD8yivWE5JhfQyJPj8nw2Lt9wE3VuCv51J YgumK0U5OtbyVHls5lHl/q3GT1n10VqmY+1bA8ZjVzH3kDguo0TpoAx4UsDUOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776089821; a=rsa-sha256; cv=none; b=FJ6uAC/b5kmDIw+p4xEXiBsk6Lp9a1uF4sZ19cmS8Xyl1vFELJ+mJPCLnrSZfv6kvvOkcP J4mfE89Ss1HuZ3mZjipIMWsH2ZTuP15orOedSceCp1/xL93j1sdU58oa8OiuAddXH192Pw k4575j6Lz4OzS+BJ7NIc+x7SDS6tFzoyFqvo0lJTMOZi0eA11xheVxhYQwAdfePFXiDW8l anlI3kLwYUOuM23EflQ0nnKFUIXw0sUay4YY1iv41BeUMREnYAEQ4kfAu788sZPxyo6bTa 8fEepIPhCfBgScZRBrtc3fdB+bYqlTyWpEuIvYl/xZxXnuI3mZGC4IoaMxRolw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776089821; 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=F8T5pEqnGJ5oTIUfUDjqy3aKk5bWufE99duA3nW7p98=; b=x+aChpiO2l1G3zHNvIN6eLK4hqsoYqi3V4RFlMCUk3r0sCrRTNQuW+CyqBEfjrbcOOTR91 154SkmH3uISga1YFzmXsTbSX+bKUbrAwkEBghknM3idPxcwNYBNU2Q/i8W+ro/DvtM6yl+ 3pVxdk55A//k7HHxfoQGIlvdIOWIXJ03ztySziXKsjkTNhEXBJLj+NcnAB3NP/0P6hOSOF T3YVSDraRICbYYR1xOUMDJqhLVboJER+f+Lsg3SeNWxWa6Xu2HrRi5CBuYPgMHSfba/mPO 5xnABHEcKe8W4FXcd78SzQMsM8DGHjmqVpfKlOQE6ufRF1vJPji2L9NTag8O2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvTxT1yfhz16lq for ; Mon, 13 Apr 2026 14:17:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 462a8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 14:17:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: b0ef03f0c4bc - main - ifconfig.8: Add geneve(4) parameters List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0ef03f0c4bc2a7715e4b8ea4ead8dd73dffdd95 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 14:17:01 +0000 Message-Id: <69dcfadd.462a8.13c0a6fa@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=b0ef03f0c4bc2a7715e4b8ea4ead8dd73dffdd95 commit b0ef03f0c4bc2a7715e4b8ea4ead8dd73dffdd95 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-13 12:38:53 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-13 14:15:06 +0000 ifconfig.8: Add geneve(4) parameters Add geneve parameters to ifconfig manual. Reviewed by: ziaee Differential Revision: https://reviews.freebsd.org/D55181 --- sbin/ifconfig/ifconfig.8 | 113 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 112 insertions(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index f062ddec774d..1dc599a61623 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 12, 2025 +.Dd December 11, 2025 .Dt IFCONFIG 8 .Os .Sh NAME @@ -3257,6 +3257,117 @@ Delete all dynamically-learned addresses from the forwarding table. .It Cm vxlanflushall Delete all addresses, including static addresses, from the forwarding table. .El +.Ss Generic Network Virtualization Encapsulation Parameters +The following parameters are used to configure +.Xr geneve 4 +interfaces. +.Bl -tag -width indent +.It Cm geneveid Ar identifier +This value is a 24-bit Virtual Network Identifier (VNI) that identifies the +virtual network identifier of the interface. +.It Cm genevemode Ar mode +Set the +.Nm +protocol operating +.Ar mode +value. +Supported modes are currently: +.Bl -tag -width indent +.It Cm l2 +Default. +.It Cm l3 +.El +.It Cm genevelocal Ar address +The source address used in the encapsulating IPv4/IPv6 header. +The address should already be assigned to an existing interface. +When the interface is configured in unicast mode, the listening socket +is bound to this address. +.It Cm geneveremote Ar address +The interface can be configured in a unicast, or point-to-point, mode +to create a tunnel between two hosts. +This is the IP address of the remote end of the tunnel. +.It Cm genevegroup Ar address +The interface can be configured in a multicast mode +to create a virtual network of hosts. +This is the IP multicast group address the interface will join. +.It Cm genevelocalport Ar port +The port number the interface will listen on. +The default port number is 6081. +.It Cm geneveremoteport Ar port +The destination port number used in the encapsulating IPv4/IPv6 header. +The remote host should be listening on this port. +The default port number is 6081. +.It Cm geneveportrange Ar low high +The range of source ports used in the encapsulating IPv4/IPv6 header. +The port selected within the range is based on a hash of the inner frame. +A range is useful to provide entropy within the outer IP header +for more effective load balancing. +The default range is between the +.Xr sysctl 8 +variables +.Va net.inet.ip.portrange.first +and +.Va net.inet.ip.portrange.last +.It Cm genevetimeout Ar timeout +The maximum time, in seconds, before an entry in the forwarding table +is pruned. +The default is 1200 seconds (20 minutes). +.It Cm genevemaxaddr Ar max +The maximum number of entries in the forwarding table. +The default is 2000. +.It Cm genevedev Ar dev +When the interface is configured in multicast mode, the +.Cm dev +interface is used to transmit IP multicast packets. +.It Cm genevedf Ar df +Set the Do not fragment (DF) bit in the encapsulating header. +Supported +.Ar df +values are currently: +.Bl -tag -width indent +.It Cm set +Do not allow fragmentation on the output IPv4/IPv6 packets and +set the Do not fragment (DF) bit in the encapsulating IPv4 header. +.It Cm unset +Default. +.It Cm inherit +The Do not fragment (DF) bit copied from inner IPv4 header to the +outer IPv4 header. +.El +.It Cm genevettl Ar ttl +The TTL used in the encapsulating IPv4/IPv6 header. +.Bl -tag -width indent +.It Cm 0-255 +The default is 64. +.It Cm inherit +The TTL copied from inner encapsulated header to the outer header. +.El +.It Cm genevedscpinherit +Inherit DSCP or Traffic Class value from the inner IPv4/IPv6 header. +.It Fl genevedscpinherit +Unconfigure DSCP or Traffic Class inheritence from the inner IPv4/IPv6 header. +This is the default. +.It Cm genevelearn +When in L2 unicast mode, The source IP address and inner source Ethernet +MAC address of received packets are used to dynamically populate the +forwarding table. +When in L2 multicast mode, an entry in the forwarding table allows the +interface to send the frame directly to the remote host instead of +broadcasting the frame to the multicast group. +This is the default. +.It Fl genevelearn +In L2 mode, geneve forwarding table is not populated by received packets. +.It Cm geneveexternal +make this tunnel externally controlled. +.It Fl geneveexternal +enable manual configuration for this tunnel. +This is the default +.It Cm geneveflush +Delete all dynamically-learned addresses from the forwarding table when in L2 +mode. +.It Cm geneveflushall +Delete all addresses, including static addresses, from the forwarding table. +.El .Ss CARP Parameters The following parameters are used to configure .Xr carp 4 From nobody Mon Apr 13 14:24:04 2026 X-Original-To: dev-commits-src-main@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 4fvV5d3Dlvz6ZFTl for ; Mon, 13 Apr 2026 14:24:05 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvV5c6kc3z3qmD for ; Mon, 13 Apr 2026 14:24:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776090245; 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=vdC+iHO8MES5lVr69Bvf9fkX1I+eBvWzQ8wCwULZVAg=; b=BknqVt9rNC2Sw68RsyHUQDu4q4+GUypMgfIQVxk/D4bAkH79a7L+2n+XVP4F6e7QXZRTnK z8jBkxMNuObQdyoLEm0p228KUAYcigkKV64PNyVaM0NkrLryrVq6xNvKk7Dxv+djL0+x5I TP9I1U4pau9DE8+6vvw22cNN2kZX9zh85M9AGSKQD9ErX4OxIW08nigRZURp7FfdLsqaAs D2OE/CJnOGQp08o24zLg8+iash5++Ha77OGihMWzjQVqkGoJpRCNzVSkAb5UJxkCqhkvVV GovwLZTCbY/zqj/1LyoxpbyuSmjJVFD5VZ9XBXkvUhr2fFEV6aPH6cWkSyWWew== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776090245; a=rsa-sha256; cv=none; b=cwQXMktjCB6RyeoiZbbTGMhWobsfyglRoNSORl6RLVA+Qayx2huGw71pBujIFG4SzTN9/P u18qS+6EITYRdHFygWJfOwmQqVUbD8s3hPzBIr+BdswRDIiewZDi6hjqk273r45LZk/Ig3 XLh2I1RXTpvdRdzRR1J53v7FkFMvuNHoNPGh2nQw8xY9J9I9+X3sm3RoQvkYP3bfcmQNy3 nGN0KX7Akw6yD57uHuCexuwTHQNek9bTG93OiitjrH3VBtFcvIkd2C1687d6nWs1gjAMJN zfpAw9FLX5gYp61dsdB7/cbBxQJ0RBSIBEoBsjoBm9Vw+9K0kZmBsDGWSB71EA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776090245; 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=vdC+iHO8MES5lVr69Bvf9fkX1I+eBvWzQ8wCwULZVAg=; b=Fbc9fixWdAe/MDW1iRjUHkfUaLPK6+UfKz1SqCadPSFKohenbL9A2w4Ap75xmB3a4MY2rr 2XoAPAfGLYPVz9u6e8Mah1r6t9nbUWkhmGwERtfWx0TYvlqRSw2XGAba+1iuOn55G+6r6h AL13PBdM5/l7hMzUO4sIbVdEYHupudVdmIWNsdEPcbdGzGfecghdDogZfoP1HMAF1sTVEB 7/vUFR6DxcEedqThfKtGG53+bbbuZM43cv5KdXDKj6+qapNy/7jJGf8Co9NWZhG7ChWi4z XPh2vZ6GgJ4Fb+ZEzxBaBBp08em5hmbRQ7kUTyKLqFAwUIGbPD6Y19Ka1i0tJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvV5c5zqpz16hT for ; Mon, 13 Apr 2026 14:24:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46530 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 14:24:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: c208439cdb58 - main - arm64: Add a cmap page to pmap List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c208439cdb588d91aead9403cec3d4acf4a8bebf Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 14:24:04 +0000 Message-Id: <69dcfc84.46530.22f71c34@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c208439cdb588d91aead9403cec3d4acf4a8bebf commit c208439cdb588d91aead9403cec3d4acf4a8bebf Author: Andrew Turner AuthorDate: 2026-04-13 11:50:32 +0000 Commit: Andrew Turner CommitDate: 2026-04-13 14:23:05 +0000 arm64: Add a cmap page to pmap When modifying mappings in pmap we may need to perform a break-before-make sequence. This creates an invalid mapping, then recreates it with the changes. When modifying DMAP mappings we may be changing the mapping that contains its own page table then after breaking the old entry we are unable to create the new entry. To fix this create a map that can be used & won't be affected by the break-before-make sequence. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D56306 --- sys/arm64/arm64/pmap.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 678030f827dd..7d19c927d369 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -290,6 +290,10 @@ VM_PAGE_TO_PV_LIST_LOCK(vm_page_t m) #define PTE_TO_VM_PAGE(pte) PHYS_TO_VM_PAGE(PTE_TO_PHYS(pte)) #define VM_PAGE_TO_PTE(m) PHYS_TO_PTE(VM_PAGE_TO_PHYS(m)) +static struct mtx cmap_lock; +static void *cmap1_addr; +static pt_entry_t *cmap1_pte; + /* * The presence of this flag indicates that the mapping is writeable. * If the ATTR_S1_AP_RO bit is also set, then the mapping is clean, otherwise @@ -1363,7 +1367,7 @@ pmap_bootstrap(void) virtual_avail = preinit_map_va + PMAP_PREINIT_MAPPING_SIZE; virtual_avail = roundup2(virtual_avail, L1_SIZE); - virtual_end = VM_MAX_KERNEL_ADDRESS - PMAP_MAPDEV_EARLY_SIZE; + virtual_end = VM_MAX_KERNEL_ADDRESS - PMAP_MAPDEV_EARLY_SIZE - L2_SIZE; kernel_vm_end = virtual_avail; /* @@ -1419,6 +1423,19 @@ pmap_bootstrap(void) alloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); msgbufp = (void *)msgbufpv; + /* Allocate space for the CPU0 CMAP */ + bs_state.va = virtual_end; + pmap_bootstrap_l2_table(&bs_state); + pmap_store(&bs_state.l3[pmap_l3_index(bs_state.va)], + PHYS_TO_PTE(pmap_early_vtophys((vm_offset_t)bs_state.l3)) | + ATTR_AF | pmap_sh_attr | ATTR_S1_XN | ATTR_KERN_GP | + ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | L3_PAGE); + dsb(ishst); + + mtx_init(&cmap_lock, "SYSMAPS", NULL, MTX_DEF); + cmap1_addr = (void *)(virtual_end + L3_SIZE); + cmap1_pte = &bs_state.l3[pmap_l3_index((vm_offset_t)cmap1_addr)]; + pa = pmap_early_vtophys(bs_state.freemempos); physmem_exclude_region(start_pa, pa - start_pa, EXFLAG_NOALLOC); From nobody Mon Apr 13 14:24:05 2026 X-Original-To: dev-commits-src-main@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 4fvV5f2tgNz6ZFFv for ; Mon, 13 Apr 2026 14:24:06 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvV5d75hzz3qyd for ; Mon, 13 Apr 2026 14:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776090246; 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=dj939GV4e2wF3lll7PVMrZNqi9H0DzxMiu9r3JhNzOk=; b=Sbe0C4YaO+Z3NxuEr82lAhElPZyrS5S1FaiHC/ZpD3O1QtnRsvuDVVStu/RKfWxMkq4qZ+ lysvZfFXnybOpMGXkP6u1tuuKxMfCg1o8fUj+XJBS3kbt9jkAvq1wDw1wpjxb1ABPWPDAN y5e31aSEdJoKUrhvw5GMpaVsH6CHEBIVev+wDI6Cya/EH/jkLThQ+62WrD+EMFzipAK8Zj u2P//wwpEhTZg1hZXsIHIP5T44mgLkz1n0F60ykX3/cOvkkSC0g+iMYeKzcq3Ye1TG/MVI FWoUeqF80n89YDdt31jmiaENDfFQl1zJtrMMU6UprIVUnUE3IV0wAk375YDUpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776090246; a=rsa-sha256; cv=none; b=c/+0ipvMNkpkrvvVH7byEGM6fuAL+T5/DnmOhs73VivDq2u67D1DXWBwFU8vbSFvBy33dV DlolXWbac4GRkyF8wDSxjYK4/ywAklV/erC5deeBOlH3dba+miQd+En7Yhdp1Uog/Y75xB SNojntTG/LABVdoIDOd5QtZiTEGvU5/g2oAGokCpwifhhl5lbv7bICkwOvNfxFlVzYOyzE GCsqyz8ynSZaFfv4mUSTLW/f1iIjmpBS0Q5Xy8jg5COGm3O29g6tS8rR5f7TrQQF/xiFsw 1I7QLCJlfC5/CwjFN+puM3RR1tREoOrzqW72U75CfY08hNJ/Eb0t6ejSmp7pUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776090246; 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=dj939GV4e2wF3lll7PVMrZNqi9H0DzxMiu9r3JhNzOk=; b=gZPCArJUJs/7B5chYvfuHCGpKezsIvOLJBEDdE4NTqxdk70MavoZ3+gwkgf3Ad9WCq56aa svMrSmSIbFaNqX7+OMQCpwMOYZXIIdv5qo5Mx2moS7pziEdA5q2kGIHGBrPRn7k/3HQirT RT42IzwnyTwsHpogXXi5e82eMV/gWN0qlhWfc8oCKt8iOWWmBxzCH+fj2kZ8AEoO1u2L4q 3L7YAh4xOyPyLeT8jzAeNVuwx0X7f2JDl4rGU7i1uVd0G4CwRwSqrtjly2Mt+3H51d2jX/ s2ncfANJz4JQdtRFc0NcHBATM3TrU8jmbv4PJpRR+q/WtorEKjB92Bs9hulNBA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvV5d6VBcz16s1 for ; Mon, 13 Apr 2026 14:24:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4722b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 14:24:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 580958427536 - main - arm64: Handle changing self-referential DMAP pages List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5809584275363d6b2f44981d8561a126a1344360 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 14:24:05 +0000 Message-Id: <69dcfc85.4722b.421b2c62@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=5809584275363d6b2f44981d8561a126a1344360 commit 5809584275363d6b2f44981d8561a126a1344360 Author: Andrew Turner AuthorDate: 2026-04-13 11:50:47 +0000 Commit: Andrew Turner CommitDate: 2026-04-13 14:23:05 +0000 arm64: Handle changing self-referential DMAP pages Support changing the property of a DMAP page that holds it's own page table entry. Because we need to perform a break-before-make sequence to change the properties of pages a page that also holds it's own page table entry will fault in the make part of the sequence. Handle this by mapping the page with a temporary mapping as we already do when demoting a superpage. Reviewed by: kib Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D55943 --- sys/arm64/arm64/pmap.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 7d19c927d369..a23905994846 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -8248,6 +8248,7 @@ pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, vm_paddr_t pa; pt_entry_t pte, *ptep, *newpte; pt_entry_t bits, mask; + char *tmpptep; int lvl, rv; PMAP_LOCK_ASSERT(kernel_pmap, MA_OWNED); @@ -8377,6 +8378,24 @@ pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, break; } + tmpptep = 0; + if (tmpva <= (vm_offset_t)ptep && + tmpva + pte_size > (vm_offset_t)ptep) { + vm_paddr_t pte_pa; + + mtx_lock(&cmap_lock); + tmpptep = cmap1_addr; + pte_pa = DMAP_TO_PHYS((vm_offset_t)ptep); + pmap_store(cmap1_pte, ATTR_AF | + pmap_sh_attr | ATTR_S1_AP(ATTR_S1_AP_RW) | + ATTR_S1_XN | ATTR_KERN_GP | + ATTR_S1_IDX(VM_MEMATTR_WRITE_BACK) | + PHYS_TO_PTE(pte_pa &~L3_OFFSET) | L3_PAGE); + dsb(ishst); + ptep = (pt_entry_t *)(tmpptep + + ((vm_offset_t)ptep & PAGE_MASK)); + } + /* Update the entry */ pte = pmap_load(ptep); pte &= ~mask; @@ -8403,6 +8422,13 @@ pmap_change_props_locked(vm_offset_t va, vm_size_t size, vm_prot_t prot, break; } + if (tmpptep != 0) { + pmap_clear(cmap1_pte); + pmap_s1_invalidate_page(kernel_pmap, + (vm_offset_t)tmpptep, true); + mtx_unlock(&cmap_lock); + } + pa = PTE_TO_PHYS(pte); if (!VIRT_IN_DMAP(tmpva) && PHYS_IN_DMAP(pa)) { /* From nobody Mon Apr 13 14:24:07 2026 X-Original-To: dev-commits-src-main@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 4fvV5g2Fn2z6ZFLt for ; Mon, 13 Apr 2026 14:24:07 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvV5g0wjcz3qcl for ; Mon, 13 Apr 2026 14:24:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776090247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bFcE2PnXohFv7QzeQhvsi/sU+pKgHbPbAkOOVbJ7uug=; b=GgfhXQ9ondIu7+zrCFjG9cvTAfD+KrELSc/CbzBW3UvWyvk4PGMBo+f9x6zc7pgyq+eX8D F5d6SPuDqFx5xlINoU9bVoAuHaRgOUBkFOTm5yJJiDnzFmU9ukblEZeUaknW6HKSq8w7ln SPPgRRk4CYgPiX/zkF0XV/dZt+8bViCwUBhb4MgO5GSXq1ar3I+JEnF8wo6uFabLeVfu9S lLhvXQ2oRJWl/90rq/Xm4fLoWM8mLrFMfKprtk5hk4wSDq0i8LaV434IBuBDZGqiJXXuOv 6xZAgcmNhW/odO7F+TdGoKK5C8K1IO4ceFRlBzD6P1ycr52s3f2luaIVneALZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776090247; a=rsa-sha256; cv=none; b=N7l6HfMO9FhokSVtYRWNRhcFAmeRpzmex0lrdFarI9H5QI8RgLXSZ/q0gVz/lPCGi4buCe Lrj8aS1gULMU/pM1SRZk6e+XObBpMfDAfvfWq41aYQP6zBjGB2vSewCgS4SBpk+e8hU+Xf PsDwh3HdGLNWowki96vKzINPEOjDflpwe99MlaMBJnSpG/XqlweWOEgls+Yfg8HLGMXLiI d0hygyer0U25m7xdrdMbQX6p04rAIXlzrUC+5hHmUALRVqRHlacToDdr0PJbvunGhaswG/ 2E/SRdD0ygLuqnuReXcWxSVYAbN1NVOMisUI+31fxQF68V3ulSWcYoB/7bca3g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776090247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bFcE2PnXohFv7QzeQhvsi/sU+pKgHbPbAkOOVbJ7uug=; b=xmK5OPKk+RnhGt+IWz45DUVNtg3wpAmbZJw6Ym5ZqC0G3CAFvtlOIQBp4soTpTdgokArMt Lk/ZE7jjA0Bi8nGiQIqYyMSXCC4xm6mPO9eEDcet4CUfGDgiUtO80JtZp16vmjFLEFLyun Megi5L9qmnRpFvOGsJDN7WQuRU5j1Q1IxfY80XjQZ+ob+Zzy14AaxNXHZLIzI65KaQQEXi lveaUl4Wv354geGxzChptFchKQSXAJHWx+16BQqW2I8TrRg0AQQdAcX5nXSq8PR5uRnJmo 6yYUf1CcAnrJMfiqbBE0ghG+U5C0YdaUgGW+GbNfiwo3SZrd15dcMn25Q1vu8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvV5g0F0bz16hW for ; Mon, 13 Apr 2026 14:24:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4693e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 14:24:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Harry Moulton From: Andrew Turner Subject: git: 7e718b9a8eec - main - arm64: mte: cleanup cache register definitions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e718b9a8eec6b5ed86b3b5509fb09dd590a3b60 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 14:24:07 +0000 Message-Id: <69dcfc87.4693e.2f93ca58@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=7e718b9a8eec6b5ed86b3b5509fb09dd590a3b60 commit 7e718b9a8eec6b5ed86b3b5509fb09dd590a3b60 Author: Harry Moulton AuthorDate: 2026-04-13 11:52:10 +0000 Commit: Andrew Turner CommitDate: 2026-04-13 14:23:05 +0000 arm64: mte: cleanup cache register definitions Cleanup the definitions in armreg.h for the CSSIDR_EL1, CLIDR_EL1 and CSSELR_EL1 system register to prepare for additional bitfeilds for Memory Tagging Extension (MTE). Reviewed by: andrew Sponsored by: Arm Ltd Signed-off-by: Harry Moulton Differential Revision: https://reviews.freebsd.org/D55944 --- sys/arm64/arm64/identcpu.c | 8 ++-- sys/arm64/include/armreg.h | 93 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 78 insertions(+), 23 deletions(-) diff --git a/sys/arm64/arm64/identcpu.c b/sys/arm64/arm64/identcpu.c index 4b5361090ead..400ea5860695 100644 --- a/sys/arm64/arm64/identcpu.c +++ b/sys/arm64/arm64/identcpu.c @@ -3086,10 +3086,10 @@ print_cpu_cache(struct cpu_desc *desc, struct sbuf *sb, uint64_t ccs, * register. */ if ((desc->id_aa64mmfr2 & ID_AA64MMFR2_CCIDX_64)) - cache_size = (CCSIDR_NSETS_64(ccs) + 1) * - (CCSIDR_ASSOC_64(ccs) + 1); + cache_size = (CCSIDR_NumSets64(ccs) + 1) * + (CCSIDR_Assoc64(ccs) + 1); else - cache_size = (CCSIDR_NSETS(ccs) + 1) * (CCSIDR_ASSOC(ccs) + 1); + cache_size = (CCSIDR_NumSets(ccs) + 1) * (CCSIDR_Assoc(ccs) + 1); cache_size *= line_size; sbuf_printf(sb, "%zuKB (%s)", cache_size / 1024, @@ -3377,7 +3377,7 @@ identify_cpu(u_int cpu) int j = 0; if ((clidr & CLIDR_CTYPE_IO)) { WRITE_SPECIALREG(csselr_el1, - CSSELR_Level(i) | CSSELR_InD); + CSSELR_Level(i) | CSSELR_InD_IC); desc->ccsidr[i][j++] = READ_SPECIALREG(ccsidr_el1); } diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 271fe693cdea..257239b923af 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -167,30 +167,71 @@ #define APIBKeyLo_EL1_op2 2 /* CCSIDR_EL1 - Cache Size ID Register */ -#define CCSIDR_NumSets_MASK 0x0FFFE000 -#define CCSIDR_NumSets64_MASK 0x00FFFFFF00000000 -#define CCSIDR_NumSets_SHIFT 13 -#define CCSIDR_NumSets64_SHIFT 32 -#define CCSIDR_Assoc_MASK 0x00001FF8 -#define CCSIDR_Assoc64_MASK 0x0000000000FFFFF8 +#define CCSIDR_EL1_REG MRS_REG_ALT_NAME(CCSIDR_EL1) +#define CCSIDR_EL1_op0 2 +#define CCSIDR_EL1_op1 1 +#define CCSIDR_EL1_CRn 0 +#define CCSIDR_EL1_CRm 0 +#define CCSIDR_EL1_op2 0 +#define CCSIDR_LineSize_SHIFT 0 +#define CCSIDR_LineSize_WIDTH 3 +#define CCSIDR_LineSize_MASK (UL(0x7) << CCSIDR_LineSize_SHIFT) +#define CCSIDR_LineSize_VAL(x) ((x) & CCSIDR_LineSize_MASK) #define CCSIDR_Assoc_SHIFT 3 +#define CCSIDR_Assoc_WIDTH 10 +#define CCSIDR_Assoc_MASK (UL(0x3ff) << CCSIDR_Assoc_SHIFT) +#define CCSIDR_Assoc_VAL(x) ((x) & CCSIDR_Assoc_MASK) +#define CCSIDR_NumSets_SHIFT 13 +#define CCSIDR_NumSets_WIDTH 15 +#define CCSIDR_NumSets_MASK (UL(0x7fff) << CCSIDR_NumSets_SHIFT) +#define CCSIDR_NumSets_VAL(x) ((x) & CCSIDR_NumSets_MASK) +/* FEAT_CCIDX - Extended Cache Index */ #define CCSIDR_Assoc64_SHIFT 3 -#define CCSIDR_LineSize_MASK 0x7 -#define CCSIDR_NSETS(idr) \ +#define CCSIDR_Assoc64_WIDTH 20 +#define CCSIDR_Assoc64_MASK (UL(0x1fffff) << CCSIDR_Assoc64_SHIFT) +#define CCSIDR_Assoc64_VAL(x) ((x) & CCSIDR_Assoc64_MASK) +#define CCSIDR_NumSets64_SHIFT 32 +#define CCSIDR_NumSets64_WIDTH 23 +#define CCSIDR_NumSets64_MASK (UL(0xffffff) << CCSIDR_NumSets64_SHIFT) +#define CCSIDR_NumSets64_VAL(x) ((x) & CCSIDR_NumSets64_MASK) +#define CCSIDR_NumSets(idr) \ (((idr) & CCSIDR_NumSets_MASK) >> CCSIDR_NumSets_SHIFT) -#define CCSIDR_ASSOC(idr) \ - (((idr) & CCSIDR_Assoc_MASK) >> CCSIDR_Assoc_SHIFT) -#define CCSIDR_NSETS_64(idr) \ +#define CCSIDR_NumSets64(idr) \ (((idr) & CCSIDR_NumSets64_MASK) >> CCSIDR_NumSets64_SHIFT) -#define CCSIDR_ASSOC_64(idr) \ +#define CCSIDR_Assoc(idr) \ + (((idr) & CCSIDR_Assoc_MASK) >> CCSIDR_Assoc_SHIFT) +#define CCSIDR_Assoc64(idr) \ (((idr) & CCSIDR_Assoc64_MASK) >> CCSIDR_Assoc64_SHIFT) /* CLIDR_EL1 - Cache level ID register */ -#define CLIDR_CTYPE_MASK 0x7 /* Cache type mask bits */ -#define CLIDR_CTYPE_IO 0x1 /* Instruction only */ -#define CLIDR_CTYPE_DO 0x2 /* Data only */ -#define CLIDR_CTYPE_ID 0x3 /* Split instruction and data */ -#define CLIDR_CTYPE_UNIFIED 0x4 /* Unified */ +#define CLIDR_EL1_REG MRS_REG_ALT_NAME(CLIDR_EL1) +#define CLIDR_EL1_op0 2 +#define CLIDR_EL1_op1 1 +#define CLIDR_EL1_CRn 0 +#define CLIDR_EL1_CRm 0 +#define CLIDR_EL1_op2 1 +#define CLIDR_CTYPE_MASK UL(0x7) +#define CLIDR_CTYPE_NONE 0x0 /* No cache */ +#define CLIDR_CTYPE_IC 0x1 /* Instruction cache only */ +#define CLIDR_CTYPE_DC 0x2 /* Data cache only */ +#define CLIDR_CTYPE_IO 0x3 /* Separate instruction & data cache */ +#define CLIDR_CTYPE_UNIFIED 0x4 /* Unified cache */ +#define CLIDR_LoUIS_SHIFT 21 +#define CLIDR_LoUIS_WIDTH 3 +#define CLIDR_LoUIS_MASK (UL(0x7) << CLIDR_LoUIS_SHIFT) +#define CLIDR_LoUIS_VAL(x) ((x) & CLIDR_LoUIS_MASK) +#define CLIDR_LoC_SHIFT 24 +#define CLIDR_LoC_WIDTH 3 +#define CLIDR_LoC_MASK (UL(0x7) << CLIDR_LoC_SHIFT) +#define CLIDR_LoC_VAL(x) ((x) & CLIDR_LoC_MASK) +#define CLIDR_LoUU_SHIFT 27 +#define CLIDR_LoUU_WIDTH 3 +#define CLIDR_LoUU_MASK (UL(0x7) << CLIDR_LoUU_SHIFT) +#define CLIDR_LoUU_VAL(x) ((x) & CLIDR_LoUU_MASK) +#define CLIDR_ICB_SHIFT 30 +#define CLIDR_ICB_WIDTH 3 +#define CLIDR_ICB_MASK (UL(0x7) << CLIDR_ICB_SHIFT) +#define CLIDR_ICB_VAL(x) ((x) & CLIDR_ICB_MASK) /* CNTKCTL_EL1 - Counter-timer Kernel Control Register */ #define CNTKCTL_EL1_op0 3 @@ -342,8 +383,22 @@ #define CPACR_EL12_op2 2 /* CSSELR_EL1 - Cache size selection register */ -#define CSSELR_Level(i) (i << 1) -#define CSSELR_InD 0x00000001 +#define CSSELR_EL1_REG MRS_REG_ALT_NAME(CSSELR_EL1) +#define CSSELR_EL1_op0 3 +#define CSSELR_EL1_op1 2 +#define CSSELR_EL1_CRn 0 +#define CSSELR_EL1_CRm 0 +#define CSSELR_EL1_op2 0 +#define CSSELR_InD_SHIFT 0 +#define CSSELR_InD_WIDTH 1 +#define CSSELR_InD_MASK (UL(0x1) << CSSELR_InD_SHIFT) +#define CSSELR_InD_VAL(x) ((x) & CSSELR_InD_MASK) +#define CSSELR_InD_DC (0x0 << CSSELR_InD_SHIFT) /* Data or unified cache */ +#define CSSELR_InD_IC (0x1 << CSSELR_InD_SHIFT) /* Instruction cache */ +#define CSSELR_Level_SHIFT 1 +#define CSSELR_Level_WIDTH 3 +#define CSSELR_Level_MASK (UL(0x7) << CSSELR_Level_SHIFT) +#define CSSELR_Level(i) (i << CSSELR_Level_SHIFT) /* CTR_EL0 - Cache Type Register */ #define CTR_EL0_REG MRS_REG_ALT_NAME(CTR_EL0) From nobody Mon Apr 13 14:24:08 2026 X-Original-To: dev-commits-src-main@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 4fvV5h5Hncz6ZFG1 for ; Mon, 13 Apr 2026 14:24:08 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvV5h1kmkz3qyg for ; Mon, 13 Apr 2026 14:24:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776090248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YwCaJzH/lbHln/Aiy2tJi6nx6L4Jvfjwu50kJQ9vVGQ=; b=FxxPYisNVBB666p2oBjTRpYYQut/PwG5lVuyb/dFJn1Tpkva9R2AzixjYHelYr4CYzCQ08 hpfND9hDFwBAvz7R5KLYgUZ8OXDtGMisTXNMnGrLk26Mljz5syb2oOLJdA98JK7WXrFXfO Esu6Etzx0nYjqdysB1Fk3LIcUJuyVzSy1K22fgdK5kEPWeaa4fG1/5P34NZMtxk2vmR1Cg P6593WMUGf3D2kZYoR+eBVIgUom2NZ97l9ABvEJuXKaKd7u4hCFjy0RcZ8we6NATQaCm+f CcRn6ATvV5ygZcVX0auWpgd3TAhIao8ecmcc0Zkn3fzmCdb/5786Z1xax5NoBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776090248; a=rsa-sha256; cv=none; b=tXGhrA3bAvpGyzIwgkhAM+ttjIMfraajU3EEEZCjod69c642djTZpKj9/DToVfYfrcWeKb 74cEvDR6ZTr1NUFKCK5fj/j67GRQh3b3aLV6J3yLD4Rt+k0Z4bYvWyLiVFLE6/D0RiBNxw AjeWvy6A2JA4FO8TQlWw81mrNu5OX4X77lZ7rzOUBbrokaAl/WM5jfKSh8vX6fUIyG9Nxr YpkaRs+KgBZtrw/Q3gQXbLDEjR0FGfEzYANtA/cjO2np7TGxiXyvI0zYcynuTzrH2hSzmW HVd+Ad/NvxACfRylhFuvrNSvCUkp/4uC80nFVXWz0JL8YycWb7rzMQb392UtBg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776090248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YwCaJzH/lbHln/Aiy2tJi6nx6L4Jvfjwu50kJQ9vVGQ=; b=hVIYtwMwncseuXyZEodSXse5z0PtSYDg4M5sUsaubQ3MtppseYRw025uLRK0T2Fk4U2gtd vApLNxFC1HswD3q5jhzhCk0WnPxRUWek7uE7PWSWJm6DDsfcRcU9gwwcRvueP0vApYcWPW y63+hl9Nu8lVn9yUNF6UcPBJ+EOtDI5caDcu2xm6CrI/KSMGZizXRDyzYtJDfhwcubX+mx uTa2j78muy6po9OMP3unkToD9ddyIhlbyi9WBMItQFOtkhuKLR1iOwoPwOtDLYTNfRfaBH E6KZJ3vws1ZLi4GR43exPLdKyB2BaI2o9OYFH/IwZ1Glx1neQAuWVpLyxoKOig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvV5h133Wz16hX for ; Mon, 13 Apr 2026 14:24:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4722f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 14:24:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Harry Moulton From: Andrew Turner Subject: git: aa555b6004d6 - main - arm64: mte: add system register definitions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa555b6004d605ff0fd48832340b0c32f14d51d4 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 14:24:08 +0000 Message-Id: <69dcfc88.4722f.573bcad1@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=aa555b6004d605ff0fd48832340b0c32f14d51d4 commit aa555b6004d605ff0fd48832340b0c32f14d51d4 Author: Harry Moulton AuthorDate: 2026-04-13 11:53:37 +0000 Commit: Andrew Turner CommitDate: 2026-04-13 14:23:05 +0000 arm64: mte: add system register definitions Add system register and bit field definitions for Memory Tagging Extension (MTE) in ARMv8.5. Reviewed by: andrew Sponsored by: Arm Ltd Signed-off-by: Harry Moulton Co-authored-by: Andrew Turner Differential Revision: https://reviews.freebsd.org/D55945 --- sys/arm64/include/armreg.h | 96 +++++++++++++++++++++++++++++++++++++++++- sys/arm64/include/hypervisor.h | 24 +++++++++++ 2 files changed, 118 insertions(+), 2 deletions(-) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 257239b923af..6447f0064d33 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -232,6 +232,11 @@ #define CLIDR_ICB_WIDTH 3 #define CLIDR_ICB_MASK (UL(0x7) << CLIDR_ICB_SHIFT) #define CLIDR_ICB_VAL(x) ((x) & CLIDR_ICB_MASK) +#define CLIDR_TTYPE_MASK UL(0x7) +#define CLIDR_TTYPE_NONE 0x0 /* No tag cache */ +#define CLIDR_TTYPE_SAT 0x1 /* Separate Allocation Tag cache */ +#define CLIDR_TTYPE_UATU 0x2 /* Unified Allocation Tag, unified lines */ +#define CLIDR_TTYPE_UATS 0x3 /* Unified Allocation Tag, separate lines */ /* CNTKCTL_EL1 - Counter-timer Kernel Control Register */ #define CNTKCTL_EL1_op0 3 @@ -399,6 +404,12 @@ #define CSSELR_Level_WIDTH 3 #define CSSELR_Level_MASK (UL(0x7) << CSSELR_Level_SHIFT) #define CSSELR_Level(i) (i << CSSELR_Level_SHIFT) +#define CSSELR_TnD_SHIFT 4 +#define CSSELR_TnD_WIDTH 1 +#define CSSELR_TnD_MASK (UL(0x1) << CSSELR_TnD_SHIFT) +#define CSSELR_TnD_VAL(x) ((x) & CSSELR_TnD_MASK) +#define CSSELR_TnD_DIU (0x0 << CSSELR_TnD_SHIFT) /* Data, Instruction or Unified cache */ +#define CSSELR_TnD_SAT (0x1 << CSSELR_TnD_SHIFT) /* Separate Allocation Tag cache */ /* CTR_EL0 - Cache Type Register */ #define CTR_EL0_REG MRS_REG_ALT_NAME(CTR_EL0) @@ -700,6 +711,7 @@ #define ISS_DATA_DFSC_PF_L2 (0x0e << 0) #define ISS_DATA_DFSC_PF_L3 (0x0f << 0) #define ISS_DATA_DFSC_EXT (0x10 << 0) +#define ISS_DATA_DFSC_TAG (0x11 << 0) #define ISS_DATA_DFSC_EXT_L0 (0x14 << 0) #define ISS_DATA_DFSC_EXT_L1 (0x15 << 0) #define ISS_DATA_DFSC_EXT_L2 (0x16 << 0) @@ -776,6 +788,30 @@ #define FAR_EL12_CRm 0 #define FAR_EL12_op2 0 +/* GCR_EL1 - Tag Control Register */ +#define GCR_EL1_REG MRS_REG_ALT_NAME(GCR_EL1) +#define GCR_EL1_op0 3 +#define GCR_EL1_op1 0 +#define GCR_EL1_CRn 1 +#define GCR_EL1_CRm 0 +#define GCR_EL1_op2 6 +#define GCR_Exclude_SHIFT 0 +#define GCR_Exclude_MASK (UL(0xffff) << GCR_Exclude_SHIFT) +#define GCR_RRND_SHIFT 16 +#define GCR_RRND (UL(0x1) << GCR_RRND_SHIFT) + +/* GMID_EL1 - Multiple tag transfer ID Register */ +#define GMID_EL1_REG MRS_REG_ALT_NAME(GMID_EL1) +#define GMID_EL1_op0 3 +#define GMID_EL1_op1 1 +#define GMID_EL1_CRn 0 +#define GMID_EL1_CRm 0 +#define GMID_EL1_op2 4 +#define GMID_BS_SHIFT 0 +#define GMID_BS_WIDTH 4 +#define GMID_BS_MASK (UL(0xf) << GMID_BS_SHIFT) +#define GMID_BS_SIZE(reg) (((reg) & GMID_BS_MASK) >> GMID_BS_SHIFT) + /* ICC_CTLR_EL1 */ #define ICC_CTLR_EL1_EOIMODE (1U << 1) @@ -2043,6 +2079,7 @@ #define MAIR_DEVICE_nGnRE UL(0x04) #define MAIR_NORMAL_NC UL(0x44) #define MAIR_NORMAL_WT UL(0xbb) +#define MAIR_NORMAL_TG UL(0xf0) #define MAIR_NORMAL_WB UL(0xff) /* MAIR_EL12 */ @@ -2656,6 +2693,18 @@ #define PMXEVTYPER_EL0_CRm 13 #define PMXEVTYPER_EL0_op2 1 +/* RGSR_EL1 - Random Allocation Tag Seed Register */ +#define RGSR_EL1_REG MRS_REG_ALT_NAME(RGSR_EL1) +#define RGSR_EL1_op0 3 +#define RGSR_EL1_op1 0 +#define RGSR_EL1_CRn 1 +#define RGSR_EL1_CRm 0 +#define RGSR_EL1_op2 5 +#define RGSR_TAG_SHIFT 0 +#define RGSR_TAG_MASK (UL(0xf) << RGSR_TAG_SHIFT) +#define RGSR_SEED_SHIFT 8 +#define RGSR_SEED_MASK (UL(0xffff) << RGSR_SEED_SHIFT) + /* RNDRRS */ #define RNDRRS_REG MRS_REG_ALT_NAME(RNDRRS) #define RNDRRS_op0 3 @@ -2710,8 +2759,18 @@ #define SCTLR_BT0 (UL(0x1) << 35) #define SCTLR_BT1 (UL(0x1) << 36) #define SCTLR_ITFSB (UL(0x1) << 37) -#define SCTLR_TCF0_MASK (UL(0x3) << 38) -#define SCTLR_TCF_MASK (UL(0x3) << 40) +#define SCTLR_TCF0_SHIFT 38 +#define SCTLR_TCF0_MASK (UL(0x3) << SCTLR_TCF0_SHIFT) +#define SCTLR_TCF0_NONE (UL(0x0) << SCTLR_TCF0_SHIFT) +#define SCTLR_TCF0_SYNC (UL(0x1) << SCTLR_TCF0_SHIFT) +#define SCTLR_TCF0_ASYNC (UL(0x2) << SCTLR_TCF0_SHIFT) +#define SCTLR_TCF0_ASYM (UL(0x3) << SCTLR_TCF0_SHIFT) +#define SCTLR_TCF_SHIFT 40 +#define SCTLR_TCF_MASK (UL(0x3) << SCTLR_TCF_SHIFT) +#define SCTLR_TCF_NONE (UL(0x0) << SCTLR_TCF_SHIFT) +#define SCTLR_TCF_SYNC (UL(0x1) << SCTLR_TCF_SHIFT) +#define SCTLR_TCF_ASYNC (UL(0x2) << SCTLR_TCF_SHIFT) +#define SCTLR_TCF_ASYM (UL(0x3) << SCTLR_TCF_SHIFT) #define SCTLR_ATA0 (UL(0x1) << 42) #define SCTLR_ATA (UL(0x1) << 43) #define SCTLR_DSSBS (UL(0x1) << 44) @@ -2821,6 +2880,15 @@ #define REVIDR_EL1_CRm 0 #define REVIDR_EL1_op2 6 +/* TCO - Tag Check Override */ +#define TCO MRS(TCO) +#define TCO_REG MRS_REG_ALT_NAME(TCO) +#define TCO_op0 3 +#define TCO_op1 3 +#define TCO_CRn 4 +#define TCO_CRm 2 +#define TCO_op2 7 + /* TCR_EL1 - Translation Control Register */ #define TCR_EL1_REG MRS_REG_ALT_NAME(TCR_EL1) #define TCR_EL1_op0 3 @@ -2936,6 +3004,30 @@ #define TCR_EL12_CRm 0 #define TCR_EL12_op2 2 +/* TFSRE0_EL1 - Tag Fault Status Register (EL0) */ +#define TFSRE0_EL1_REG MRS_REG_ALT_NAME(TFSRE0_EL1) +#define TFSRE0_EL1_op0 3 +#define TFSRE0_EL1_op1 0 +#define TFSRE0_EL1_CRn 5 +#define TFSRE0_EL1_CRm 6 +#define TFSRE0_EL1_op2 1 +#define TFSRE0_TF0_SHIFT 0 +#define TFSRE0_TF0_MASK (UL(0x1) << TFSRE0_TF0_SHIFT) +#define TFSRE0_TF1_SHIFT 1 +#define TFSRE0_TF1_MASK (UL(0x1) << TFSRE0_TF1_SHIFT) + +/* TFSR_EL1 - Tag Fault Status Register */ +#define TFSR_EL1_REG MRS_REG_ALT_NAME(TFSR_EL1) +#define TFSR_EL1_op0 3 +#define TFSR_EL1_op1 0 +#define TFSR_EL1_CRn 5 +#define TFSR_EL1_CRm 6 +#define TFSR_EL1_op2 0 +#define TFSR_TF0_SHIFT 0 +#define TFSR_TF0_MASK (UL(0x1) << TFSR_TF0_SHIFT) +#define TFSR_TF1_SHIFT 1 +#define TFSR_TF1_MASK (UL(0x1) << TFSR_TF1_SHIFT) + /* TTBR0_EL1 & TTBR1_EL1 - Translation Table Base Register 0 & 1 */ #define TTBR_ASID_SHIFT 48 #define TTBR_ASID_MASK (0xfffful << TTBR_ASID_SHIFT) diff --git a/sys/arm64/include/hypervisor.h b/sys/arm64/include/hypervisor.h index 3ee5c12f2265..73adf89b4182 100644 --- a/sys/arm64/include/hypervisor.h +++ b/sys/arm64/include/hypervisor.h @@ -2062,6 +2062,16 @@ #define SCTLR_EL2_EIS (0x1UL << SCTLR_EL2_EIS_SHIFT) #define SCTLR_EL2_EE_SHIFT 25 #define SCTLR_EL2_EE (0x1UL << SCTLR_EL2_EE_SHIFT) +#define SCTLR_EL2_ITFSB_SHIFT 37 +#define SCTLR_EL2_ITFSB (0x1UL << SCTLR_EL2_ITFSB_SHIFT) +#define SCTLR_EL2_TCF0_SHIFT 38 +#define SCTLR_EL2_TCF0 (0x2UL << SCTLR_EL2_TCF0_SHIFT) +#define SCTLR_EL2_TCF_SHIFT 40 +#define SCTLR_EL2_TCF (0x2UL << SCTLR_EL2_TCF_SHIFT) +#define SCTLR_EL2_ATA0_SHIFT 42 +#define SCTLR_EL2_ATA0 (0x1UL << SCTLR_EL2_ATA0_SHIFT) +#define SCTLR_EL2_ATA_SHIFT 43 +#define SCTLR_EL2_ATA (0x1UL << SCTLR_EL2_ATA_SHIFT) /* TCR_EL2 - Translation Control Register */ #define TCR_EL2_RES1 ((0x1UL << 31) | (0x1UL << 23)) @@ -2104,6 +2114,20 @@ #define TCR_EL2_HWU62 (1UL << TCR_EL2_HWU62_SHIFT) #define TCR_EL2_HWU \ (TCR_EL2_HWU59 | TCR_EL2_HWU60 | TCR_EL2_HWU61 | TCR_EL2_HWU62) +#define TCR_EL2_TCMA_SHIFT 30 +#define TCR_EL2_TCMA (1UL << TCR_EL2_TCMA_SHIFT) + +/* TFSR_EL2 - Tag Fault Status Register EL2 */ +#define TFSR_EL2_REG MRS_REG_ALT_NAME(TFSR_EL2) +#define TFSR_EL2_op0 3 +#define TFSR_EL2_op1 4 +#define TFSR_EL2_CRn 5 +#define TFSR_EL2_CRm 6 +#define TFSR_EL2_op2 0 +#define TFSR_TF0_SHIFT 0 +#define TFSR_TF0_MASK (UL(0x1) << TFSR_TF0_SHIFT) +#define TFSR_TF1_SHIFT 1 +#define TFSR_TF1_MASK (UL(0x1) << TFSR_TF1_SHIFT) /* VMPDIR_EL2 - Virtualization Multiprocessor ID Register */ #define VMPIDR_EL2_U 0x0000000040000000 From nobody Mon Apr 13 14:24:09 2026 X-Original-To: dev-commits-src-main@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 4fvV5j57vjz6ZFX9 for ; Mon, 13 Apr 2026 14:24:09 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvV5j2fMsz3qnR for ; Mon, 13 Apr 2026 14:24:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776090249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5x8AWcqgg1O98p5uiIGvvmronIiky0y76GlwClvtrk8=; b=FvybQT7nqymAWfdKyTSIiKBjzO/MRiVrkdxo9KFjNhCkfWZ5VcIneV4L9/t+Zo4Dw/eC5v GYDCSHg7h8vX6SK3pBetEdDv8jY5FAmEp/Feh7Lg9MyghpyJ7LIQwCRjFLBfwc+NZr8kLi N5Kt5ngBsNVoMU5/IrLh1brvTA9Kfe+0XYJ8oMobhtETTU4chjdDERwlwxB2vlfiTZKoCg R9GG/pPOWpOgFFtJMzrF5oURBnLd8kltr2MU39IxviEG9ZYP9vmm5bEJlcMZT/urgPt8JX o6Ypq1c8jNmIan8yWiLk9Kk37F4vbjzomyuYP6TJElAgArMEr0nQT7auPQdrbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776090249; a=rsa-sha256; cv=none; b=oFQtEf3PLJmim7gJ2Q0UJqTrHEzqCvWVOq4Q+sqmRJJeOmnbHmJZSbH17jTNv9x0mqh275 FXrpim0SaXbld6uCISeUpeGiXqt7R39+RHgeccwDB/NsEVF8HaRaxK4d+EjasEQc8HdXEJ Kf7HISzMZzF6kTfAevLFN6tXuq0HVtpA2CQ6kIHZqimb5Sz9oGdWzZMX6DMtLjYlWVfnNQ 1jaPbconV/Q+jhgDwnmuzHxmC4Bpq/NqUPK2mu8lhbtdqoAvi6vmqODGLfmjLQjozxxPRg pv46RUwfjTTE/tNFFvfrV9gUiEB6JeDuKiFNAsy4ckfQtAp75U9HT8dOh7MiVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776090249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5x8AWcqgg1O98p5uiIGvvmronIiky0y76GlwClvtrk8=; b=mAbjga95z84Pj2sZkdh3yBda9X+3trM0RggLGwYyb4oqNnd8PLEDUzeBUgg4PXZg5cdvoi mP0omt1G9+eg78cYA2TmCRTvQDjxiyBau6yx8AtaHTAI+yaRUj8HYqX4Jxj8RnOtyARN06 sFuCpTNeShwnwAT0YT/Yx/fTSGl54OQwp0hiYtn7PoZQZ64ouUxUi/u2Y6VMvlABVAkZCo 3YgsDofL/1Xny7QWUZMjFV6LKhFjESjzYKp/dtkHRDLtZKLPc9BsHXNI7VlTRQEtqKpOWm IYBhO37iz5CDlwuj1/+lZ1i1OjKieCIecX9q2PKag29doA+T8n7XZEh6Ss7uQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvV5j1hC5z172G for ; Mon, 13 Apr 2026 14:24:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 464ef by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 14:24:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Harry Moulton From: Andrew Turner Subject: git: 58de79153622 - main - arm64: mte: configure initial state for system registers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 58de79153622145cb6fc57bc92c4de678876992f Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 14:24:09 +0000 Message-Id: <69dcfc89.464ef.4e312925@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=58de79153622145cb6fc57bc92c4de678876992f commit 58de79153622145cb6fc57bc92c4de678876992f Author: Harry Moulton AuthorDate: 2026-04-13 11:54:38 +0000 Commit: Andrew Turner CommitDate: 2026-04-13 14:23:05 +0000 arm64: mte: configure initial state for system registers The fields in SCTLR_EL1 and HCR_EL2 for enabling MTE are set, and if the ID_AA64PFR1_EL1 register shows MTE is present, the GCR_EL1 register is also configured, and the two TFSR registers which hold pending tag check faults are cleared. Reviewed by: andrew Sponsored by: Arm Ltd Signed-off-by: Harry Moulton Differential Revision: https://reviews.freebsd.org/D55946 --- sys/arm64/arm64/locore.S | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index f1228235dfe7..4c8e0c680321 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -398,7 +398,7 @@ LENTRY(enter_kernel_el) */ /* Configure the Hypervisor */ - ldr x2, =(HCR_RW | HCR_APK | HCR_API) + ldr x2, =(HCR_RW | HCR_APK | HCR_API | HCR_ATA) msr hcr_el2, x2 /* Stash value of HCR_EL2 for later */ @@ -1063,6 +1063,21 @@ LENTRY(start_mmu) isb ldr x2, mair + + /* + * If MTE is supported, configure GCR_EL1 and clear the TFSR registers of + * any pending tag check faults + */ + CHECK_CPU_FEAT(x3, ID_AA64PFR1, MTE, MTE, 1f) + + /* Set GCR_EL1, non-zero tags excluded by default */ + mov x3, #(GCR_Exclude_MASK | GCR_RRND) + msr GCR_EL1_REG, x3 + + /* Clear any pending tag check faults */ + msr TFSR_EL1_REG, xzr + msr TFSRE0_EL1_REG, xzr +1: msr mair_el1, x2 /* From nobody Mon Apr 13 14:31:36 2026 X-Original-To: dev-commits-src-main@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 4fvVGL20G2z6ZFf0; Mon, 13 Apr 2026 14:31:38 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvVGL192Lz3t1s; Mon, 13 Apr 2026 14:31:38 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776090698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0qRWZBVdMhE8JeXBQSfmsLXG/eGYlst7osJq/Sea/Do=; b=Sdh+wWE01r3MzGg4+119lBYpk6afN8jVOuroS5VPuRqjwLXcCcLw9ugCX8hf2niiUZS5hp bMLSOiCloCtTwuWcZlBFZrhm7WVMsWyKihA6EPwpVWCwaHWw0hvPHfElfmGjbmNx+wRwQd W9M7bNZ9NzOGInxSuRVnzrEz+o5zIF6Ia6hfzWWBcEfMRgGBOvOiPeRERIfmjgzwzKvtz7 6xcUY5qGRIVTGSjsbGEU0402IwvX+9+4kLzwX+aGgbaGR11IESaUx5CQbUZZ8Oujueaw1m vy1VQkb+ID4IU88TfNMe8vb7dsGUUPVITkytBOiWTnsMWW/Jf/rw6rmc3ZJ2JA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776090698; a=rsa-sha256; cv=none; b=MNcXtVOjyiCd4UwdIzXHLRP+su5o4Q6D8qOF0JbEtM9nIMdYeIf87b6Y1Dl+lAccpCN00H kjGEV2vjYQVRXorcEntp23WT+4oHlHBjAqVJHXjdKao4hD90uJ3JWq7MreHtxOmt4trs4d wdWp4B1wLJveNtP0J/Lcryw5I14TOqNJDC71SBiWzBN61E4pV9In66KuzMHXAhFkqX8m+J qGAgyh2wKSk36H29v+hKSrrS4uydNWLRLHRoKvRju5OJzFHYfSinnfumRkNrPM24z9+C++ yxAQpuAck5gzkgjsUPPik/hHMvyVxq//tdHfct0Oj4fn1eQqcJtHzZ+Kcw7cbg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776090698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0qRWZBVdMhE8JeXBQSfmsLXG/eGYlst7osJq/Sea/Do=; b=mWQ5MvfOgx728Y0S4DmMg3Nzut19+kiQHbWaYnmLq+Bm4tJik2caoKFJXnGQKjWWRl0EAX 2uzOcQzkXsu7YniOxpJ4MSljHkGlGo+rSjhYmmyM/OPzD8Zslx0/qT5ydc+//5Nje0kkBc CXJnwZc5brYaLFSHEDrMuK9unICFgLEN3Ct4PoAdTo6foqzvGVw3UJJpTXt75gUwsz2/Xn yT2p3XFV5+0qEiPQN2tdcR23WBSvpVincKsVJWTuUtWmzBrxICHhYxQ7ckn7BV0woq4sbm XEgnpJFicBFJG0TYczZTcJ/SNFe1/nbkevVggUE7xq5p/KzP8fVGCG8cSZxt0w== Received: from ltc.des.dev (2a01cb0585090500922e16fffef1acef.ipv6.abo.wanadoo.fr [IPv6:2a01:cb05:8509:500:922e:16ff:fef1:acef]) (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) (Authenticated sender: des/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fvVGK6vdrzZLy; Mon, 13 Apr 2026 14:31:37 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 331E2F625; Mon, 13 Apr 2026 16:31:36 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Gleb Smirnoff Cc: Olivier Cochard , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c5961b6fcfe0 - main - yes: fix argv test race between fork and exec In-Reply-To: (Gleb Smirnoff's message of "Sun, 12 Apr 2026 09:50:11 -0700") References: <69d3ebe6.1f204.7943777e@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Mon, 13 Apr 2026 16:31:36 +0200 Message-ID: <865x5vextj.fsf@ltc.des.dev> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Gleb Smirnoff writes: > This kind of fix doesn't make it 100% flakyless, but adds a 100% guarante= ed 0.1 > second test execution time overhead. In general, all sh(1) based tests t= hat > create a background process should have a wait cycle with `sleep 0.01` in= it. =E2=80=9CLe mieux est l'ennemi du bien=E2=80=9C. This works well enough, a= nd if you're worried about CI runtimes I suggest you look into parallelizing kyua instead. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Mon Apr 13 15:35:24 2026 X-Original-To: dev-commits-src-main@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 4fvWgw3cDfz6ZKfD for ; Mon, 13 Apr 2026 15:35:24 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvWgw2t9Mz43yG for ; Mon, 13 Apr 2026 15:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776094524; 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=xik8ziejetb8kCa/wI0PgL6G3Hra9sk4y+ohTtpWUq8=; b=oIaOk4gkU4JKzfEmDtEQ4CnclffEsjIDZDid5QKqqhZgWcu0eCg9CevzzwNjRWULWjfQ3i uKXfiPPvwL5D2lfNh2odjVhxpMldZMsQFEl7xRMNSvb6S1Lx11HIAgR5izd25E27feC1w4 26G2nVCiOf1mqb+Aih/KD2DmtcQN8hUAcyPym0SNA0hilg1sVhe+B3BoPNH7WGJOXL36Pd RBG3U8HnejAXScK8GT22Dr3Fgr8E1m0hnWXqnkAy9BgPEH5o2mBK5OZW405xhIISRR1rl5 r2ySbDmRYBu4Ih95g6YgzWGNSjDT7FhEPaECBg6+6CNoAWPzBWSj2bqEMfl1Hw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776094524; a=rsa-sha256; cv=none; b=JNhZPrXugbTCl06UIbdpsdJS9emzTjJe3JfB3ihzEuKfZQREY09IXNI7IgKInxvgIpCoG+ cGXO6JjI+cVbpLmLTQW87xkf6SEz7ZmncXlNnQjqUjY2en8taJGRTCxEP91WRYMei7YMuV 9wEUYeyy9uQD5PZWccX1XJD9ya4RwSUGUK6/c7u11POXfSFqhysAYmt50UHMmIslJcHFk0 oVAtTRmWlOjbCWvqbYHZQRgzvqLcgwcF5YB4O8hPu5uGna2owRz5oRs7XJ7dbEpPOgTp2x WkSWv6Rg6Tdabq7Zy0jkSJgtBu2tN5odmswZIw70kumgFygwuKuxI8OgIq7gfg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776094524; 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=xik8ziejetb8kCa/wI0PgL6G3Hra9sk4y+ohTtpWUq8=; b=kr1YKPUS+tusMsxFa8vtUNlKtc80tV2pziVE31N8gFT70zjZwdueYY3XTM7O2UBt+1M4A2 JdyEELUEG7DxNtjq/EnntRkPZKFaaUgRC823qPyGfs5Mf/3fEfcshQB75+PKZCjsBbvlmB Rv+0BFHNFJTh6oUn/vOteGzYVfXsWmF6z8+XTaKhSZkKev5bMKsY0RieI9oDpcCzewkjR0 gWqwX8Fosq1oe1sLpYnok9kEvjcYZqoGEFHOdDWdVpuoD4KzmzWMaH6SLLoXUJacSvaJjH +C6x+HIGpvfY6Sm7a4Ug3XvAk3xzIp5ECln0rYHUSTri8BJVl+LGsl/EJBv0oQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvWgw2Pcfz18b7 for ; Mon, 13 Apr 2026 15:35:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1e635 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 15:35:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dave Cottlehuber Subject: git: 3b108068121b - main - release: remove Oracle Cloud Infrastructure build targets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dch X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b108068121ba30fb3dbed569d6757da2ab529a4 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 15:35:24 +0000 Message-Id: <69dd0d3c.1e635.3bcc33a1@gitrepo.freebsd.org> The branch main has been updated by dch: URL: https://cgit.FreeBSD.org/src/commit/?id=3b108068121ba30fb3dbed569d6757da2ab529a4 commit 3b108068121ba30fb3dbed569d6757da2ab529a4 Author: Dave Cottlehuber AuthorDate: 2026-04-12 22:29:44 +0000 Commit: Dave Cottlehuber CommitDate: 2026-04-13 15:34:17 +0000 release: remove Oracle Cloud Infrastructure build targets Oracle's previous support is no longer available to the project. Repeated attempts to find a sponsor within Oracle's cloud business have not been successful. The last published official images are from 15.0-RELEASE. https://marketplace.oracle.com/app/freebsd-release Relnotes: yes Sponsored by: SkunkWerks, GmbH Differential Revision: https://reviews.freebsd.org/D56360 MFC after: 3 days --- release/Makefile.oracle | 108 --------------------- release/Makefile.vm | 5 - release/release.conf.sample | 2 +- .../oracle/arm64_shape_compatibilities.json | 24 ----- .../oracle/default_shape_compatibilities.json | 1 - release/scripts/oracle/generate_metadata.lua | 74 -------------- release/scripts/oracle/image_capability_data.json | 96 ------------------ release/scripts/oracle/image_metadata.json | 21 ---- release/tools/oracle.conf | 105 -------------------- 9 files changed, 1 insertion(+), 435 deletions(-) diff --git a/release/Makefile.oracle b/release/Makefile.oracle deleted file mode 100644 index 6d792cc9fd30..000000000000 --- a/release/Makefile.oracle +++ /dev/null @@ -1,108 +0,0 @@ -# -# Makefile for preparing & uploading Oracle Cloud images from existing -# .raw files created by cloudware-release. -# -# Overview: -# -# The base image is already created by cloudware-release. -# -# Construct the custom OCI metadata, derived from exported official OCI images. -# It is architecture-specific but appears mostly stable over time. -# Compress the raw image and place it in the same directory as the metadata. -# Make a GNU format tarball of these files. -# Upload the tarball to Oracle Cloud via a pre-approved curl URI, into -# the FreeBSD Foundation's Oracle Cloud account. -# -# These images go into the "re" bucket in us-ashburn-1 region, which -# is mounted into the FreeBSD Foundation Oracle Marketplace account. -# Once uploaded, a manual step is needed to import the images as local -# custom images. These can then be tested within the us-ashburn-1 region. -# Once tested, follow the manual Oracle Marketplace import process to -# create a new FreeBSD version, attach the images, and initiate validation -# by Oracle. This can take up to 5 working days. Once complete, a final -# manual step is needed to mark the currently private images, public. -# Syncing to all sites should take 2-3 hours after this final step. - -ORACLE_BASENAME= ${OSRELEASE}-${BUILDDATE}${GITREV:C/^(.+)/-\1/} -CLEANFILES+= cw-oracle-portinstall - -cw-oracle-portinstall: .PHONY -.if (!exists(/usr/local/bin/curl) || !exists(/usr/local/bin/qemu-img)) && !exists(${PORTSDIR}/Makefile) -. if !exists(/usr/local/sbin/pkg-static) - env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf -. endif -.endif -.if !exists(/usr/local/bin/curl) -. if !exists(${PORTSDIR}/Makefile) - env ASSUME_ALWAYS_YES=yes pkg install -y ftp/curl -. else - env UNAME_r=${UNAME_r} make -C \ - ${PORTSDIR}/ftp/curl \ - BATCH=1 WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles \ - all install clean -. endif -.endif -.if !exists(/usr/local/bin/qemu-img) -. if !exists(${PORTSDIR}/Makefile) - env ASSUME_ALWAYS_YES=yes pkg install -y emulators/qemu@tools -. else - env UNAME_r=${UNAME_r} FLAVOR=tools make -C \ - ${PORTSDIR}/emulators/qemu \ - BATCH=1 WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles \ - all install clean -. endif -.endif - -.for _FS in ${ORACLE_FSLIST} -ORACLE_OCI_LIST+= cw-oracle-${_FS}.oci -ORACLE_UPLOAD_LIST+= cw-oracle-upload-${_FS} -CLEANFILES+= cw-oracle-${_FS}.oci -ORACLE_TMP_${_FS}= cw-oracle-${_FS}.oci.tmpdir -CLEANDIRS+= ${ORACLE_TMP_${_FS}} -ORACLE_METADATA= ${.CURDIR}/scripts/oracle -ORACLE_CAPABILITY= ${.CURDIR}/scripts/oracle/image_capability_data.json -ORACLE_TEMPLATE= ${.CURDIR}/scripts/oracle/image_metadata.json -ORACLE_OUTPUT_${_FS}= ${ORACLE_TMP_${_FS}}/image_metadata.json -.if ${TARGET} == "arm64" -ORACLE_SHAPES= ${ORACLE_METADATA}/arm64_shape_compatibilities.json -.else -ORACLE_SHAPES= ${ORACLE_METADATA}/default_shape_compatibilities.json -.endif - -cw-oracle-${_FS}.oci: cw-oracle-portinstall cw-oracle-${_FS}-raw - mkdir -p ${ORACLE_TMP_${_FS}} - # create architecture-specific JSON metadata - env TYPE="${TYPE}" \ - OSRELEASE="${OSRELEASE}" \ - ORACLE_CAPABILITY="${ORACLE_CAPABILITY}" \ - ORACLE_SHAPES="${ORACLE_SHAPES}" \ - ORACLE_TEMPLATE="${ORACLE_TEMPLATE}" \ - ORACLE_OUTPUT="${ORACLE_OUTPUT_${_FS}}" \ - ${ORACLE_METADATA}/generate_metadata.lua - - # convert raw to native qcow2 for zstd compression, saves ~ 8GiB - qemu-img convert -S 512b -p -O qcow2 -c -o compression_type=zstd \ - ${.OBJDIR}/${ORACLE${_FS:tu}RAWIMAGE} \ - ${ORACLE_TMP_${_FS}}/output.QCOW2 - - # Create GNU-compatible tarball using BSD tar - tar --format=gnutar -cf ${.TARGET} -C ${ORACLE_TMP_${_FS}} \ - image_metadata.json output.QCOW2 - - echo "Oracle image ${.TARGET} is ready for upload." - -cw-oracle-upload-${_FS}: cw-oracle-${_FS}.oci -.if !defined(ORACLE_PAR_URL) || empty(ORACLE_PAR_URL) - @echo "--------------------------------------------------------------" - @echo ">>> ORACLE_PAR_URL must be set for Oracle image upload" - @echo ">>> for testing, use a file:/// URL to a local directory" - @echo "--------------------------------------------------------------" - @false -.endif - echo "Please wait ... uploading cw-oracle-${_FS}.oci to ${ORACLE_BASENAME}-${_FS}.oci" - curl -s ${ORACLE_PAR_URL}/${ORACLE_BASENAME}-${_FS}.oci --upload-file cw-oracle-${_FS}.oci - echo "Uploaded cw-oracle-${_FS}.oci as ${ORACLE_BASENAME}-${_FS}.oci" - touch ${.TARGET} -.endfor - -cw-oracle-upload: cw-oracle-portinstall ${ORACLE_UPLOAD_LIST} diff --git a/release/Makefile.vm b/release/Makefile.vm index abbfcb341afc..d937783f02fe 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -24,7 +24,6 @@ CLOUDWARE_TYPES?= AZURE \ BASIC-CLOUDINIT \ EC2 \ GCE \ - ORACLE \ VAGRANT AZURE_FORMAT= vhdf AZURE_FSLIST?= ufs zfs @@ -45,9 +44,6 @@ EC2-SMALL_DESC= Amazon EC2 small image GCE_FORMAT= raw GCE_FSLIST?= ufs zfs GCE_DESC= Google Compute Engine image -ORACLE_FORMAT= raw -ORACLE_FSLIST?= ufs zfs -ORACLE_DESC= Oracle Cloud Infrastructure image OPENSTACK_FORMAT=qcow2 OPENSTACK_FSLIST?= ufs OPENSTACK_DESC= OpenStack platform image @@ -315,6 +311,5 @@ cloudware-release: .include "${.CURDIR}/Makefile.ec2" .include "${.CURDIR}/Makefile.firecracker" .include "${.CURDIR}/Makefile.gce" -.include "${.CURDIR}/Makefile.oracle" .include "${.CURDIR}/Makefile.vagrant" .include "${.CURDIR}/Makefile.inc1" diff --git a/release/release.conf.sample b/release/release.conf.sample index e583e49828d4..72faef150f88 100644 --- a/release/release.conf.sample +++ b/release/release.conf.sample @@ -113,7 +113,7 @@ PORTBRANCH="main" ## If WITH_CLOUDWARE is set to a non-empty value, this is a list of providers ## to create disk images. -#CLOUDWARE="EC2 GCE ORACLE VAGRANT-VIRTUALBOX VAGRANT-VMWARE" +#CLOUDWARE="EC2 GCE VAGRANT-VIRTUALBOX VAGRANT-VMWARE" ## If WITH_OCIIMAGES is set to a non-empty value, build Open Container ## Initiative (OCI) base images as part of the release. diff --git a/release/scripts/oracle/arm64_shape_compatibilities.json b/release/scripts/oracle/arm64_shape_compatibilities.json deleted file mode 100644 index dfd066b5474f..000000000000 --- a/release/scripts/oracle/arm64_shape_compatibilities.json +++ /dev/null @@ -1,24 +0,0 @@ -[ - { - "internalShapeName": "VM.Standard.A1.Flex", - "ocpuConstraints": { - "min": 1, - "max": 80 - }, - "memoryConstraints": { - "minInGBs": 1, - "maxInGBs": 512 - } - }, - { - "internalShapeName": "VM.Standard.A2.Flex", - "ocpuConstraints": { - "min": 1, - "max": 78 - }, - "memoryConstraints": { - "minInGBs": 1, - "maxInGBs": 946 - } - } -] diff --git a/release/scripts/oracle/default_shape_compatibilities.json b/release/scripts/oracle/default_shape_compatibilities.json deleted file mode 100644 index fe51488c7066..000000000000 --- a/release/scripts/oracle/default_shape_compatibilities.json +++ /dev/null @@ -1 +0,0 @@ -[] diff --git a/release/scripts/oracle/generate_metadata.lua b/release/scripts/oracle/generate_metadata.lua deleted file mode 100755 index 751b9680cc29..000000000000 --- a/release/scripts/oracle/generate_metadata.lua +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/libexec/flua - -local ucl = require("ucl") - --- read from environment variables -local os_type = os.getenv("TYPE") -local os_version = os.getenv("OSRELEASE") --- the raw file -local capability_file = os.getenv("ORACLE_CAPABILITY") --- the platform-specific file -local shapes_file = os.getenv("ORACLE_SHAPES") --- base template -local template_file = os.getenv("ORACLE_TEMPLATE") -local output_file = os.getenv("ORACLE_OUTPUT") - -if not os_type or not os_version or not capability_file or - not shapes_file or not template_file or not output_file then - io.stderr:write("Error: Oracle metadata script is missing required environment variables:\n") - io.stderr:write("TYPE, OSRELEASE, ORACLE_CAPABILITY, ORACLE_SHAPES, ORACLE_TEMPLATE, ORACLE_OUTPUT\n") - os.exit(1) -end - --- read files -local function read_file(path) - local f = io.open(path, "r") - if not f then - io.stderr:write("Error: Oracle metadata script cannot open file: " .. path .. "\n") - os.exit(1) - end - local content = f:read("*a") - f:close() - return content -end - --- parse the template -local template = read_file(template_file) -local metadata = ucl.parser() -metadata:parse_string(template) -local data = metadata:get_object() - --- update the simple fields -data.operatingSystem = os_type -data.operatingSystemVersion = os_version - --- capability data is actually JSON, but needs to be inserted as a raw blob -local caps = read_file(capability_file) --- remove all newlines and preceding spaces to match Oracle's format -caps = caps:gsub("\n", "") -caps = caps:gsub("%s+", "") --- is it still valid JSON? -local caps_parser = ucl.parser() -if not caps_parser:parse_string(caps) then - io.stderr:write("Error: Oracle metadata script found invalid JSON in capability file\n") - os.exit(1) -end --- insert as a raw blob -data.imageCapabilityData = caps - --- parse and insert architecture-dependent shape compatibilities data -local shapes_data = read_file(shapes_file) -local shapes = ucl.parser() -shapes:parse_string(shapes_data) -data.additionalMetadata.shapeCompatibilities = shapes:get_object() - --- save the metadata file -local dir = os.getenv("PWD") -local out = io.open(output_file, "w") -if not out then - io.stderr:write("Error: Oracle metadata script cannot create output file: " - .. dir .. "/" .. output_file .. "\n") - os.exit(1) -end -out:write(ucl.to_format(data, "json", {pretty = true})) -out:close() diff --git a/release/scripts/oracle/image_capability_data.json b/release/scripts/oracle/image_capability_data.json deleted file mode 100644 index 01af71f73031..000000000000 --- a/release/scripts/oracle/image_capability_data.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "capabilities": { - "Compute.AMD_SecureEncryptedVirtualization": { - "descriptorType": "boolean", - "defaultValue": false - }, - "Storage.BootVolumeType": { - "descriptorType": "enumstring", - "values": [ - "ISCSI", - "PARAVIRTUALIZED", - "SCSI", - "IDE", - "NVME" - ], - "defaultValue": "PARAVIRTUALIZED" - }, - "Storage.Iscsi.MultipathDeviceSupported": { - "descriptorType": "boolean", - "defaultValue": false - }, - "Storage.ParaVirtualization.EncryptionInTransit": { - "descriptorType": "boolean", - "defaultValue": true - }, - "Storage.ConsistentVolumeNaming": { - "descriptorType": "boolean", - "defaultValue": true - }, - "Compute.SecureBoot": { - "descriptorType": "boolean", - "defaultValue": false - }, - "Storage.ParaVirtualization.AttachmentVersion": { - "descriptorType": "enuminteger", - "values": [ - 1, - 2 - ], - "defaultValue": 2 - }, - "Storage.LocalDataVolumeType": { - "descriptorType": "enumstring", - "values": [ - "ISCSI", - "PARAVIRTUALIZED", - "SCSI", - "IDE", - "NVME" - ], - "defaultValue": "PARAVIRTUALIZED" - }, - "Network.AttachmentType": { - "descriptorType": "enumstring", - "values": [ - "PARAVIRTUALIZED", - "VDPA" - ], - "defaultValue": "PARAVIRTUALIZED" - }, - "Storage.RemoteDataVolumeType": { - "descriptorType": "enumstring", - "values": [ - "ISCSI", - "PARAVIRTUALIZED", - "SCSI", - "IDE", - "NVME" - ], - "defaultValue": "PARAVIRTUALIZED" - }, - "Compute.LaunchMode": { - "descriptorType": "enumstring", - "values": [ - "NATIVE", - "EMULATED", - "VDPA", - "PARAVIRTUALIZED", - "CUSTOM" - ], - "defaultValue": "PARAVIRTUALIZED" - }, - "Network.IPv6Only": { - "descriptorType": "boolean", - "defaultValue": false - }, - "Compute.Firmware": { - "descriptorType": "enumstring", - "values": [ - "BIOS", - "UEFI_64" - ], - "defaultValue": "UEFI_64" - } - } -} diff --git a/release/scripts/oracle/image_metadata.json b/release/scripts/oracle/image_metadata.json deleted file mode 100644 index eaea3dd1cad2..000000000000 --- a/release/scripts/oracle/image_metadata.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 2, - "externalLaunchOptions": { - "firmware": "UEFI_64", - "networkType": "PARAVIRTUALIZED", - "bootVolumeType": "PARAVIRTUALIZED", - "remoteDataVolumeType": "PARAVIRTUALIZED", - "localDataVolumeType": "PARAVIRTUALIZED", - "launchOptionsSource": "PARAVIRTUALIZED", - "pvAttachmentVersion": 2, - "pvEncryptionInTransitEnabled": false, - "consistentVolumeNamingEnabled": false - }, - "imageCapabilityData": "REPLACE", - "imageCapsFormatVersion": "23cfd738-ad9c-4f56-9281-67be6c8cd14c", - "operatingSystem": "REPLACE", - "operatingSystemVersion": "REPLACE", - "additionalMetadata": { - "shapeCompatibilities": "REPLACE" - } -} diff --git a/release/tools/oracle.conf b/release/tools/oracle.conf deleted file mode 100644 index b289f4e4e7e7..000000000000 --- a/release/tools/oracle.conf +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/sh -# Set to a list of packages to install. -export VM_EXTRA_PACKAGES=" - comms/py-pyserial - converters/base64 - devel/oci-cli - devel/py-babel - devel/py-iso8601 - devel/py-pbr - devel/py-six - ftp/curl - lang/python - lang/python3 - net/cloud-init - net/py-eventlet - net/py-netaddr - net/py-netifaces - net/py-oauth - net/rsync - security/ca_root_nss - security/sudo@default - sysutils/firstboot-freebsd-update - sysutils/firstboot-pkgs - sysutils/panicmail - textproc/jq - " - -# Should be enough for base image, image can be resized in needed -export VMSIZE=8g - -# Set to a list of third-party software to enable in rc.conf(5). -export VM_RC_LIST=" - cloudinit - firstboot_pkgs - firstboot_freebsd_update - growfs - ntpd - ntpd_sync_on_start - sshd - zfs" - -# Hack for FreeBSD 15.0; should go away before 15.1. -MISSING_METALOGS=" -./usr/local/etc/cloud/cloud.cfg -./usr/local/etc/cloud/cloud.cfg.d/05_logging.cfg -./usr/local/etc/cloud/cloud.cfg.d/99_freebsd.cfg -./usr/local/etc/pam.d/sudo -./usr/local/etc/rsync/rsyncd.conf -./usr/local/etc/ssl/cert.pem -./usr/local/etc/sudo.conf -./usr/local/etc/sudo_logsrvd.conf -./usr/local/etc/sudoers -" - -vm_extra_pre_umount() { - cat <<-'EOF' >> ${DESTDIR}/etc/rc.conf - dumpdev=AUTO -EOF - - cat <<-'EOF' >> ${DESTDIR}/boot/loader.conf - autoboot_delay="5" - beastie_disable="YES" - boot_serial="YES" - loader_logo="none" - cryptodev_load="YES" - opensolaris_load="YES" - xz_load="YES" - zfs_load="YES" -EOF - metalog_add_data ./boot/loader.conf - - cat <<-'EOF' >> ${DESTDIR}/etc/ssh/sshd_config - # S11 Configure the SSH service to prevent password-based login - PermitRootLogin prohibit-password - PasswordAuthentication no - KbdInteractiveAuthentication no - PermitEmptyPasswords no - UseDNS no -EOF - - # S14 Root user login must be disabled on serial-over-ssh console - pw -R ${DESTDIR} usermod root -w no - # Oracle requirements override the default FreeBSD cloud-init settings - cat <<-'EOF' >> ${DESTDIR}/usr/local/etc/cloud/cloud.cfg.d/98_oracle.cfg - disable_root: true - system_info: - distro: freebsd - default_user: - name: freebsd - lock_passwd: True - gecos: "Oracle Cloud Default User" - groups: [wheel] - sudo: ["ALL=(ALL) NOPASSWD:ALL"] - shell: /bin/sh - network: - renderers: ['freebsd'] -EOF - metalog_add_data ./usr/local/etc/cloud/cloud.cfg.d/98_oracle.cfg - - # Use Oracle Cloud Infrastructure NTP server - sed -i '' -E -e 's/^pool.*iburst/server 169.254.169.254 iburst/' \ - ${DESTDIR}/etc/ntp.conf - - return 0 -} From nobody Mon Apr 13 15:51:52 2026 X-Original-To: dev-commits-src-main@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 4fvX3D1PWMz6ZLnw for ; Mon, 13 Apr 2026 15:52:08 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvX3B4vH0z45kt for ; Mon, 13 Apr 2026 15:52:06 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; arc=pass ("google.com:s=arc-20240605:i=1"); dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.208.51 as permitted sender) smtp.mailfrom=asomers@gmail.com Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-6719e2372a0so1243893a12.0 for ; Mon, 13 Apr 2026 08:52:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776095525; cv=none; d=google.com; s=arc-20240605; b=NlHblDYTDxlMS4nYODQeuVt+gBQETKlD5+ylakGBgYKQhxXTIcRU/w/PrLQfH3qO/q rwrlM/xN8BjsNGZ3qjShwxghbBv8kbTWyqqHpoxG4m1t6DW/rwlPKtfFRviiWybgGldS dm5AU0voNfJVVp8KnmWBnIvi8b+jnHnH59JwGd8M4PPKKlmjSBoVbolDcPUO91ikVYED 3reb0Mj8Ku0VEXE3QoyRfEnGt2GCt+HwtGHBeEKgxNRCAotGb9B6OEkq5xY+uNrpXVwn r/iWqOumi5fv2khrWyf7ytS8Gg3SWG9dSB292h8OC92vvXJmPHJx1v2+lFzRIQDdPV7x sAYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=ErNbfwKLoqluoAHm778FUo4E4ob4Alf+KwSFzLCilOQ=; fh=ONzmy89kXi2ScJp/iPhFNEPn9+nW12xLTNhJRzQ3PxI=; b=jiwmcz/N9ZlH25EnRMlHjXSOzgeU8GhZ3e5Lv/wIVtSlgKJBFjwqP7/fKSbTE/MYs/ Nv48iVE+eHAvZDNDk/kRxim3qoLqBDHWM+zv4fb7+UU3Yje3/zm1u2ba4dzLYzwoR5TU jqE8lq39g3QQz9MjqGG6yeQmFoKRQk9BQomjq2hMLuJkk7Zt9/h6ieQ1tU6YMaW6WOoW n6sFgg3K1hMLjXn6/SRy7YIntqCAj1g6RkyjWTiUaL4xrwJQmqGzBlYMzpAG4o3GL2BR SwUf3e+rCJG1WvbQVpaNQrpeaMv//wB5LxTslW0v4lCrenFA/XsC0T8LAjBPEHkmjHJw l95w==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776095525; x=1776700325; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ErNbfwKLoqluoAHm778FUo4E4ob4Alf+KwSFzLCilOQ=; b=LDDqGSMNiT3k3t8QNypWwuuQCiuQHRz+8OIa5/BnM0rYcOA+xCPQRP+mOGef2HEHDS /2CZG1b8YdhpjcCxoja4UPnvEg/gtDO0ag/x/F5DabpetJJbcn9O7SPRs5CHmNlSuzSK d4lT5SI9im0aDFZ7xQzyYLXuMZWus4UP/gtJlkeHXsEOWD8w+hc1r6pyHL3szUpoikAl co5UylMJmtIMOSCHB1RyeUi+9I/ND7hm65X4e2neVDMuW9h4xh7T1uwH3xeANB1KULHg KrxW+7STPjzrWCOysYym5Q/ZvRmU6OM6eL59j+6KmXIRyBXNE2YFrl/0RDenznYgadxE aWwQ== X-Forwarded-Encrypted: i=1; AFNElJ/mj+UvwTH+leRVxabBaT0QPGD1ssozaBBWU+zX1I6saYYV89VExsXAPXpqY6FSqC3RJAQbtz2qkEJ0Qr8/jVC7pNqgjw==@freebsd.org X-Gm-Message-State: AOJu0YzUlZOry87R4FftlO2qFQT1j3tuxc8jThe/Hgb271H0m3dxtwH+ XMYZ6b/pxYO1UmwHhP4OlXnK4xqGR5JuA52IYR5pr4BMiqeh07EMQ9jCezsK24804edtnZrtB5X JKLxdpoQtTgwUzPvrOvYk6Oil2a7CdmmzIFK5 X-Gm-Gg: AeBDietCinQQXD/ecDvie0AXs3PRUw3FGE2oiEa4EBHVc58TV7AdqpB8BPpeoJHqL89 aMEhht0ZFlQvRuDrZcjeQ/z+L5EuEvexoU3XAM+JvIFZX5ZctFfrYu4BZ9Co90B+FW0tXt3jiNQ XsxwVhfiI7Rc3rBWc+7UfAb2WUD7/U22+pRSX4ZD+PLe/pyaarSNx1srAG9k4Pvk3I8KF3fQwos B7nLHDqXQkenzfGJO+3pIfC9JmStcdSBGE1tCcdkEAENO8M2W07ZvMQ2kOK8kKxrPTCd6M3IrqC cWNemRPj70W+mKAv/vo+C1VaaHkQNyj1BzmX+kiFEgG0SZb7lQ81rC+VcIjKlG6jf+qg X-Received: by 2002:a05:6402:4558:b0:665:3d68:c46c with SMTP id 4fb4d7f45d1cf-6707a47eb05mr4755625a12.14.1776095524409; Mon, 13 Apr 2026 08:52:04 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202508062010.576KA2Mk062184@gitrepo.freebsd.org> In-Reply-To: <202508062010.576KA2Mk062184@gitrepo.freebsd.org> From: Alan Somers Date: Mon, 13 Apr 2026 09:51:52 -0600 X-Gm-Features: AQROBzBTYwyEssH9AFjFo-crl7OHcWcAV9Qsb-bBo41RodLs8M7DLXElAHVQq1E Message-ID: Subject: Re: git: 66b5296f1b29 - main - ctld: Add support for NVMe over Fabrics To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-3.89 / 15.00]; ARC_ALLOW(-1.00)[google.com:s=arc-20240605:i=1]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.996]; NEURAL_HAM_LONG(-1.00)[-0.995]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; MIME_GOOD(-0.10)[text/plain]; FREEFALL_USER(0.00)[asomers]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.51:from]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_TLS_LAST(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.51:from]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; MISSING_XM_UA(0.00)[]; R_DKIM_NA(0.00)[]; RCPT_COUNT_THREE(0.00)[4] X-Rspamd-Queue-Id: 4fvX3B4vH0z45kt X-Spamd-Bar: --- On Wed, Aug 6, 2025 at 2:10=E2=80=AFPM John Baldwin wrote= : > > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D66b5296f1b29083634e2875ff0= 8c32e7b6b866a8 > > commit 66b5296f1b29083634e2875ff08c32e7b6b866a8 > Author: John Baldwin > AuthorDate: 2025-08-06 19:57:50 +0000 > Commit: John Baldwin > CommitDate: 2025-08-06 19:59:13 +0000 > > ctld: Add support for NVMe over Fabrics > > While the overall structure is similar for NVMeoF controllers and > iSCSI targets, there are sufficient differences that NVMe support use= s > an alternate configuration syntax. > > - In authentication groups, permitted NVMeoF hosts can be allowed by > names (NQNs) via "host-nqn" values (similar to "initiator-name" for > iSCSI). Similarly, "host-address" accepts permitted host addresses > similar to "initiator-portal" for iSCSI. > > - A new "transport-group" context enumerates transports that can be > used by a group of NVMeoF controllers similar to the "portal-group" > context for iSCSI. In this section, the "listen" keyword accepts a > transport as well as an address to permit other types of transports > besides TCP in the future. The "foreign", "offload", and "redirect= " > keywords are also not meaningful and thus not supported. > > - A new "controller" context describes an NVMeoF I/O controller > similar to the "target" context for iSCSI. One key difference here > is that "lun" objects are replaced by "namespace" objects. However= , > a "namespace" can reference a named global lun permitting LUNs to b= e > shared between iSCSI targets and NVMeoF controllers. > > NB: Authentication via CHAP is not implemented for NVMeoF. > > Reviewed by: imp > Sponsored by: Chelsio Communications > Differential Revision: https://reviews.freebsd.org/D48773 ... > +struct target * > +conf::add_controller(const char *name) > +{ > + if (!nvmf_nqn_valid_strict(name)) { > + log_warnx("controller name \"%s\" is invalid for NVMe", n= ame); > + return nullptr; > + } > + > + /* > + * Normalize the name to lowercase to match iSCSI. > + */ > + std::string t_name(name); > + for (char &c : t_name) > + c =3D tolower(c); ... This makes it impossible to define an uppercase or mixed case target name in ctld. I guess the intent was to comply with rfc3722[^1]? Even so, it's surprising, because such target names used to work. It's also inconsistent, because it's still possible to create an uppercase target name using ctladm directly, like this: ctladm port -c -d iscsi -O cfiscsi_portal_group_tag=3D257 -O cfiscsi_target=3Diqn.2018-10.myhost:TESTVOL1 Should we warn the user if they specify an uppercase target name, or even fail to create it? [^1]: https://datatracker.ietf.org/doc/html/rfc3722 From nobody Mon Apr 13 16:56:37 2026 X-Original-To: dev-commits-src-main@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 4fvYTf48G8z6ZQmQ; Mon, 13 Apr 2026 16:56:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvYTf3cQ5z3HCn; Mon, 13 Apr 2026 16:56:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776099398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cymmBp0CvKOJnVJFkTWB99sCtTICR7yh9qGoNJfCHrA=; b=ud8whnMSCquWhVH9HibzQ1kkPDPRUx3GhFVW4nKxewsYRMD3XeaQ87lgg5ME0ix9RwQy5l BXHouDgMeWsoRk5pTPqFNgiPcaJ5aLiOylpcD5tHLilW0QeDYZejy+SQ3sm/vGjrL1tjsx ewrTWxoTmiY/NUvWXyWff1XIE9760oggtZnCCy3Vgdwoh6dD5kVKaJCT2misIdeyKKt3tG 3jhV9BJljDKPJeg4mW6eYiv4dhAPygvv4FKzJ9hLRFrCvIKR5M1aufUxQMxvFJkMfgh1Sc iT9d1BNZq2NBq34+X9rH1z0a2u35GZm3h+kxyYL8Lficg37Y3kyYweP4NHz+dg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776099398; a=rsa-sha256; cv=none; b=gpJrE97tBfjxEsHVCS/2WC9QLed6pHbUfgpmUb67HngTKyRDo8cV9MH3QCa17oJ1ms2eUu CPVH7Gp9CovbxVHyg/q5JfIhMS8+w3NYdd889MVCpcYOlsP+24RWmrte6lbfNFiVWXLkKz hFllMxzyxVIoPsweD3Nx2ZlNZrMocu5E+kyGceM3j2LeSkEazO15l3n7O+AXJxdP1TaujN hyRiFzxhJsLgTyEyjIOxJVSKSQsocvnQPrOSGwlH6MAFHOvpSJBdAjaKbe3T/1nYvGBOEg 0V6riUiEOyFNk9tXh1IKK1PmCj8J3BYeMVOR2crBe3YXd1rKjPJTOAYSL0Cgxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776099398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cymmBp0CvKOJnVJFkTWB99sCtTICR7yh9qGoNJfCHrA=; b=DcTAIdEA4ktrroww+FI5gU4PkPFqFesdrkS9MB/p+4EKV8EHCqdKcUJUYG3nC0/NznfTIZ I0WtYbfrN1kgslrMyrxpgt68jpyAu/a1FEM9uoSIAGaz0yhxcXk0GX86Y6NfvzQV44Q2ut di/hTcAAYk29gH1q+HRGb3FwCKS339fjJ34n7YeJY3RyaZmw7L7LUapGesCsG/Xr7xrfYT 95GiSxtkwCKuuTqCmS59q1aYjDoreM0zw1O1IcqMVdcO7dKU+8lEMu25sKdxC1KvKrDXyL /63iAszAtu8OJdivTKJ6BwXeIOs9vmqtaJAiJnhxGzE0rovNnr7hfEwbeMMmBA== Received: from [IPV6:2601:5c0:4202:5670:7939:bbf5:92d0:fbb9] (unknown [IPv6:2601:5c0:4202:5670:7939:bbf5:92d0:fbb9]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fvYTf1b0rzmwm; Mon, 13 Apr 2026 16:56:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 13 Apr 2026 12:56:37 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 66b5296f1b29 - main - ctld: Add support for NVMe over Fabrics Content-Language: en-US To: Alan Somers Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202508062010.576KA2Mk062184@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/13/26 11:51, Alan Somers wrote: > On Wed, Aug 6, 2025 at 2:10 PM John Baldwin wrote: >> >> The branch main has been updated by jhb: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=66b5296f1b29083634e2875ff08c32e7b6b866a8 >> >> commit 66b5296f1b29083634e2875ff08c32e7b6b866a8 >> Author: John Baldwin >> AuthorDate: 2025-08-06 19:57:50 +0000 >> Commit: John Baldwin >> CommitDate: 2025-08-06 19:59:13 +0000 >> >> ctld: Add support for NVMe over Fabrics >> >> While the overall structure is similar for NVMeoF controllers and >> iSCSI targets, there are sufficient differences that NVMe support uses >> an alternate configuration syntax. >> >> - In authentication groups, permitted NVMeoF hosts can be allowed by >> names (NQNs) via "host-nqn" values (similar to "initiator-name" for >> iSCSI). Similarly, "host-address" accepts permitted host addresses >> similar to "initiator-portal" for iSCSI. >> >> - A new "transport-group" context enumerates transports that can be >> used by a group of NVMeoF controllers similar to the "portal-group" >> context for iSCSI. In this section, the "listen" keyword accepts a >> transport as well as an address to permit other types of transports >> besides TCP in the future. The "foreign", "offload", and "redirect" >> keywords are also not meaningful and thus not supported. >> >> - A new "controller" context describes an NVMeoF I/O controller >> similar to the "target" context for iSCSI. One key difference here >> is that "lun" objects are replaced by "namespace" objects. However, >> a "namespace" can reference a named global lun permitting LUNs to be >> shared between iSCSI targets and NVMeoF controllers. >> >> NB: Authentication via CHAP is not implemented for NVMeoF. >> >> Reviewed by: imp >> Sponsored by: Chelsio Communications >> Differential Revision: https://reviews.freebsd.org/D48773 > ... >> +struct target * >> +conf::add_controller(const char *name) >> +{ >> + if (!nvmf_nqn_valid_strict(name)) { >> + log_warnx("controller name \"%s\" is invalid for NVMe", name); >> + return nullptr; >> + } >> + >> + /* >> + * Normalize the name to lowercase to match iSCSI. >> + */ >> + std::string t_name(name); >> + for (char &c : t_name) >> + c = tolower(c); > ... > > This makes it impossible to define an uppercase or mixed case target > name in ctld. I guess the intent was to comply with rfc3722[^1]? > Even so, it's surprising, because such target names used to work. > It's also inconsistent, because it's still possible to create an > uppercase target name using ctladm directly, like this: > > ctladm port -c -d iscsi -O cfiscsi_portal_group_tag=257 -O > cfiscsi_target=iqn.2018-10.myhost:TESTVOL1 > > Should we warn the user if they specify an uppercase target name, or > even fail to create it? > > [^1]: https://datatracker.ietf.org/doc/html/rfc3722 Note that this function is for NVMe, not iSCSI. iSCSI targets are created in conf::add_target which has similar code: struct target * conf::add_target(const char *name) { if (!valid_iscsi_name(name, log_warnx)) return (nullptr); /* * RFC 3722 requires us to normalize the name to lowercase. */ std::string t_name(name); for (char &c : t_name) c = tolower(c); Prior to the C++ commit, this change was already in place: struct target * target_new(struct conf *conf, const char *name) { struct target *targ; int i, len; targ = target_find(conf, name); if (targ != NULL) { log_warnx("duplicated target \"%s\"", name); return (NULL); } if (valid_iscsi_name(name, log_warnx) == false) { return (NULL); } targ = new target(); targ->t_name = checked_strdup(name); /* * RFC 3722 requires us to normalize the name to lowercase. */ len = strlen(name); for (i = 0; i < len; i++) targ->t_name[i] = tolower(targ->t_name[i]); targ->t_conf = conf; TAILQ_INSERT_TAIL(&conf->conf_targets, targ, t_next); return (targ); } This was present in commit 009ea47eb2d21856af4529aaaca32cd67748daea which brought in the iSCSI target, so it has always been present in ctld. Also, AFAICT, the names are still accepted, they are just normalized. I guess one difference is that before, target_new() called target_find() with the non-normalized name to check for duplicates, and now we check for duplicates after normalizing the name. I'm not sure how that worked in the past in practice as you would have had two targets with the same name (e.g. I wonder what the ctladm portlist output looked like for this case and if it would have listed two ports with the same name)? I suspect that was more by accident and probably didn't work properly in practice (e.g. the kernel handoff ioctl used the normalized name when invoking CTL_ISCSI, so connections to both "names" probably were always mapped to only one of the connections, and finding a port during login processing probably only found the first target, and only if the initiator gave the all-lowercase name). That is to say, you didn't get an error before, but it didn't work, and now it tells you that it doesn't work AFAICT. -- John Baldwin From nobody Mon Apr 13 17:01:55 2026 X-Original-To: dev-commits-src-main@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 4fvYbl1WY2z6ZQsv for ; Mon, 13 Apr 2026 17:01:55 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvYbl0blPz3JTP for ; Mon, 13 Apr 2026 17:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776099715; 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=0hKIMI2n5ISCJGfU02WJ2DUKa3kcWB1gXhfXAOdug1s=; b=ZxxEfSSRue4eYVoxsEmofgMC9bzFzNtoAXeo8SWHoYwD9Iin0HErV5AMU502WyUW6QYdY4 W6FVI9mEj3qZ7y/UyWAbRElpe4XCNC0iWDI9K4JvGyEo1Cr2eTMRiJauznD6kxQvyTigt4 hEqUwWPcMBPp0uCrJWNMdQ+USpf2zJ99pNM8ZmzCvJTveb8PXO735kc15kEnuoVryZPt7T EibRkFBhuZnY7rkIIVRc90zQFHAte5n+7QztucDoHRm7ceIn6Z3Oy1atatfGi5wT7QdMXL 5rSoXLjEXMWcAqk3Nf7clZZbvFZ0Jnl6itgK5Irs4fKN0liO8A3/WWujrn5+Aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776099715; a=rsa-sha256; cv=none; b=GLABYLT8gapLz745COzuRDktKgun2pv4cqNIYnePJ+ifoR2i00QxHw+DmZ1Rvb64D2ff/o DQ4pkLkDi68eCDHE0BA2+l57zGCqug3oBmHGRF82R0uU+BHEZscYC1IVe+JkyM2eJEZ7IO kF1dM/ZvWnNJ6GRg+ewN7/ZiYPcfuH0tgWtRJJXtVigIdziEG00J/p4uN0ZnSMdhEwJOd1 SHy6BazG9LTmpYf7oc6lck3rOVDizoFObaXCCT+Y+07pV84zTAD6s5MFDDvJlUI+krV5CR LaVkfD11xEq3gOeAsNGEcTCjhfuL5SmoQORnO4ob2l3RS774oF/rpcGhCfQ2Gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776099715; 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=0hKIMI2n5ISCJGfU02WJ2DUKa3kcWB1gXhfXAOdug1s=; b=T3Ow5eblcoIy2IajfRjfOfs1aLHCC6AJlBVNa2xM3yW4LOW24cxLL7J5jPbyKC5h9J2GKc b96hPYXeRrmEv6uPTDO/ncN4CzCpwma72omog8V/BhnBcSnoGn9L/AvNfuHFcfApdr4ThX 5Ipab0nkal2LIZuEsdhV4nZ6L0kwD+DBEhVTQ9PKwholN1Sva6l+RBOXraEPURO5XAedZu 5E8iRC/dfKttwFNQ2WwcG74WZ2WZAg0FFsCwi0lcIzRnc3fqsyZ8Rlt+8BvYhfF0r9Bd/a KCGHzKRMZnv9+GVM5tz1T8A9O10AIwS+koA7AA7t+i4GY2NYbz/xS4/QldeUzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvYbl0Bktz1Bfv for ; Mon, 13 Apr 2026 17:01:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30d35 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 17:01:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: bc793ad78734 - main - ifconfig: Fix printf on geneve for 32-bit architectures List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc793ad78734acc4833f8f38bfb505e810c52963 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 17:01:55 +0000 Message-Id: <69dd2183.30d35.35598107@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=bc793ad78734acc4833f8f38bfb505e810c52963 commit bc793ad78734acc4833f8f38bfb505e810c52963 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-13 16:55:26 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-13 16:58:31 +0000 ifconfig: Fix printf on geneve for 32-bit architectures Replace uint64_t type with uintmax_t in printf to fix warnings on 32-bit architectures. Reported by: Jenkins Fixes: 688e289ee904 ("ifconfig: Add support for geneve") Differential Revision: https://reviews.freebsd.org/D55184 --- sbin/ifconfig/ifgeneve.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/ifconfig/ifgeneve.c b/sbin/ifconfig/ifgeneve.c index aac8c81a3b10..db0e90e6f278 100644 --- a/sbin/ifconfig/ifgeneve.c +++ b/sbin/ifconfig/ifgeneve.c @@ -403,10 +403,10 @@ geneve_status_nl(if_ctx *ctx) geneve_data.ifla_ftable_nospace); } - printf("\n\t\tstats: tso %lu, txcsum %lu, rxcsum %lu", - geneve_data.ifla_stats_tso, - geneve_data.ifla_stats_txcsum, - geneve_data.ifla_stats_rxcsum); + printf("\n\t\tstats: tso %ju, txcsum %ju, rxcsum %ju", + (uintmax_t)geneve_data.ifla_stats_tso, + (uintmax_t)geneve_data.ifla_stats_txcsum, + (uintmax_t)geneve_data.ifla_stats_rxcsum); } putchar('\n'); From nobody Mon Apr 13 17:36:11 2026 X-Original-To: dev-commits-src-main@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 4fvZMc2SKnz6ZT2p for ; Mon, 13 Apr 2026 17:36:28 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvZMb3bmpz3PDK for ; Mon, 13 Apr 2026 17:36:27 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-671c4d08dc2so265319a12.3 for ; Mon, 13 Apr 2026 10:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776101786; cv=none; d=google.com; s=arc-20240605; b=VK1y82fla6hY+LuQWVH3km1op4SlC6lZSfwQZFBrfmS6/KJiOqgx0Q05tUPNNBu2Lv EqO86LpMCsUtUA48K8US5IVMHnP0BIb2AshsLrx1wumqHQ391kepy8ZPtZcuWdt9wQGr Z8VYeiYd3j3G8NsDsyd/bwjJEFFt0rty7pavoFXSxuBCFFFdMc/DL/5Ik0WgY+fyjhmE sPHVHWGDJmeKgeh5rGrgFc6llZVpmK/D64Q1QBRfRmNh0YHtozpJ5bheiU7D93w7l9a2 TcRZli4WAy5GXiah39UKDY6XBtsTlcgL4ZpjoOPqjrj3+VYuk2TBWbvvI4O5Myk16aTE TpFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=lzuWUjcyzos8Cfp8OyWG+exlnd52GeMtiOF+zOoSQ8c=; fh=TkXurbKcPm/66tD1gOxm0yQ9E4co5OX/L+JyJ41/nis=; b=BYF0YR+ZSCYsaY7lg3MkA1QW8jnaf3MHKl0wJd6vW8z8xr5Ee7W1+CQRPP/QaKN62e DwYndLG9rRtE8soEqnMSphO5WASDcKsk0D5oXMJs40p0oxJB0jx9BxfQiIjAuVUxLwzR +CkunlqelAlpagqA0H8Y2YEjO4d51ElS3bCJHnC4tSBw19qXk5kXCD3Jxf/SdAcNlvYG Gc+mTIfL1fDv5+0aJa0SfuRBZbF1ILdieGvqWdxCG/XvmNkI/FwumpsbrLnaX7oPWXrp gvlQvBPK9oABsraTrJReRzYcBy0muyGRXbdrRX7V7GVi0UNR/9mKiNvDy1zMfKIdFvv6 RnOA==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776101786; x=1776706586; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lzuWUjcyzos8Cfp8OyWG+exlnd52GeMtiOF+zOoSQ8c=; b=FuxjWonYBbxWFZw3WPuftj/3H58gUBRRSDnEerpdNtQVZC0UCbyK5XYTz5HI4HGwSW /TvdQL5Js9L9DrcnjLygZmYnktK6TnzCbUqeFwUt6H36+JzyhcG/Ip3FK2iottqh63oy Qi+UKzKQ8PSLuwZvdPMAIYj9R9MPZKSnk7h1H74ujdO3lwLEDx8Hp4H8bxUZekEcYEC7 ojbpCkhwZ2QK/Z+7WPJ/P06SPPDK0cpO1eZR7JI525q+5NEeSU/4h+vnGktMkkuqLBW4 PiJPCVy0YdTlYuPyWwfFyJykBo19jRhSyS5n6ESrr71Xnp5zS9IjwHL+ruT4nXFiDpmT dwGg== X-Forwarded-Encrypted: i=1; AFNElJ9seEmcV1llONgN8Xn2X4aRDZjNNQJN/BXLlzKAPOVPkcLt0LiI9m3T9yteRmKYe7dTZkiYLH41Uf47LxYAEe0UaltbQg==@freebsd.org X-Gm-Message-State: AOJu0Yxs2BZNIvxivP3l0O32RF08N7ni+p9yjzRK13haLAbIFUm05nAn D/BNxT5f0QV+tE9N1WIv6M212sbip8cx1DLlpHRC0NW+4QjwK7jYRxjwIGBTElDjgnLHgo9qcdj oc6hMkUX2HdM/Id3IhLAy+BMxvNlYra4= X-Gm-Gg: AeBDiesAGWXy8iVn/kdWUPL7Z7zIVnPSZGzEX5IWU5Hrmd2B7S/V1j4NrjKXZ007VDF rOzML3VYHTIxSMfcTXfUeIkrHzxjNZVbeGME2tfjujFtHoO0J+Pju+/KatFj6sfNu/UWKihssAe 7kl5Yz9NXIlsm3vZRZF9a/L2SzYBCtar66Xdt7BCwr64aKdUAe0hZ1onucwpVLSR0gfI3Cq8SVO KTtMTuCFOMZ/l+Eh5kVvoNDpVh3AU4LbHIR2lCbv0CVygQigAVu/dXRr62txMLXaCcNo3XQUCPy r9Dp69U9OplP3rw1yG6jTDCpGrxZCfeBonOXx5jsugLV4xjbG6GQqLQufo8BM0+hii4g X-Received: by 2002:a05:6402:440b:b0:66e:bad4:3f52 with SMTP id 4fb4d7f45d1cf-67077641317mr7013847a12.2.1776101785738; Mon, 13 Apr 2026 10:36:25 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202508062010.576KA2Mk062184@gitrepo.freebsd.org> In-Reply-To: From: Alan Somers Date: Mon, 13 Apr 2026 11:36:11 -0600 X-Gm-Features: AQROBzBUsdn3ZnjiHOI1ffcNBqDX_x1SIynFSNHQkrD0vHC5sgjwqWWh0DQJtUs Message-ID: Subject: Re: git: 66b5296f1b29 - main - ctld: Add support for NVMe over Fabrics To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4fvZMb3bmpz3PDK X-Spamd-Bar: ---- On Mon, Apr 13, 2026 at 10:56=E2=80=AFAM John Baldwin wro= te: > > On 4/13/26 11:51, Alan Somers wrote: > > On Wed, Aug 6, 2025 at 2:10=E2=80=AFPM John Baldwin w= rote: > >> > >> The branch main has been updated by jhb: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=3D66b5296f1b29083634e2875= ff08c32e7b6b866a8 > >> > >> commit 66b5296f1b29083634e2875ff08c32e7b6b866a8 > >> Author: John Baldwin > >> AuthorDate: 2025-08-06 19:57:50 +0000 > >> Commit: John Baldwin > >> CommitDate: 2025-08-06 19:59:13 +0000 > >> > >> ctld: Add support for NVMe over Fabrics > >> > >> While the overall structure is similar for NVMeoF controllers and > >> iSCSI targets, there are sufficient differences that NVMe support= uses > >> an alternate configuration syntax. > >> > >> - In authentication groups, permitted NVMeoF hosts can be allowed= by > >> names (NQNs) via "host-nqn" values (similar to "initiator-name"= for > >> iSCSI). Similarly, "host-address" accepts permitted host addre= sses > >> similar to "initiator-portal" for iSCSI. > >> > >> - A new "transport-group" context enumerates transports that can = be > >> used by a group of NVMeoF controllers similar to the "portal-gr= oup" > >> context for iSCSI. In this section, the "listen" keyword accep= ts a > >> transport as well as an address to permit other types of transp= orts > >> besides TCP in the future. The "foreign", "offload", and "redi= rect" > >> keywords are also not meaningful and thus not supported. > >> > >> - A new "controller" context describes an NVMeoF I/O controller > >> similar to the "target" context for iSCSI. One key difference = here > >> is that "lun" objects are replaced by "namespace" objects. How= ever, > >> a "namespace" can reference a named global lun permitting LUNs = to be > >> shared between iSCSI targets and NVMeoF controllers. > >> > >> NB: Authentication via CHAP is not implemented for NVMeoF. > >> > >> Reviewed by: imp > >> Sponsored by: Chelsio Communications > >> Differential Revision: https://reviews.freebsd.org/D48773 > > ... > >> +struct target * > >> +conf::add_controller(const char *name) > >> +{ > >> + if (!nvmf_nqn_valid_strict(name)) { > >> + log_warnx("controller name \"%s\" is invalid for NVMe"= , name); > >> + return nullptr; > >> + } > >> + > >> + /* > >> + * Normalize the name to lowercase to match iSCSI. > >> + */ > >> + std::string t_name(name); > >> + for (char &c : t_name) > >> + c =3D tolower(c); > > ... > > > > This makes it impossible to define an uppercase or mixed case target > > name in ctld. I guess the intent was to comply with rfc3722[^1]? > > Even so, it's surprising, because such target names used to work. > > It's also inconsistent, because it's still possible to create an > > uppercase target name using ctladm directly, like this: > > > > ctladm port -c -d iscsi -O cfiscsi_portal_group_tag=3D257 -O > > cfiscsi_target=3Diqn.2018-10.myhost:TESTVOL1 > > > > Should we warn the user if they specify an uppercase target name, or > > even fail to create it? > > > > [^1]: https://datatracker.ietf.org/doc/html/rfc3722 > > Note that this function is for NVMe, not iSCSI. iSCSI targets are create= d in > conf::add_target which has similar code: > > struct target * > conf::add_target(const char *name) > { > if (!valid_iscsi_name(name, log_warnx)) > return (nullptr); > > /* > * RFC 3722 requires us to normalize the name to lowercase. > */ > std::string t_name(name); > for (char &c : t_name) > c =3D tolower(c); > > Prior to the C++ commit, this change was already in place: > > struct target * > target_new(struct conf *conf, const char *name) > { > struct target *targ; > int i, len; > > targ =3D target_find(conf, name); > if (targ !=3D NULL) { > log_warnx("duplicated target \"%s\"", name); > return (NULL); > } > if (valid_iscsi_name(name, log_warnx) =3D=3D false) { > return (NULL); > } > targ =3D new target(); > targ->t_name =3D checked_strdup(name); > > /* > * RFC 3722 requires us to normalize the name to lowercase. > */ > len =3D strlen(name); > for (i =3D 0; i < len; i++) > targ->t_name[i] =3D tolower(targ->t_name[i]); > > targ->t_conf =3D conf; > TAILQ_INSERT_TAIL(&conf->conf_targets, targ, t_next); > > return (targ); > } > > This was present in commit 009ea47eb2d21856af4529aaaca32cd67748daea > which brought in the iSCSI target, so it has always been present > in ctld. > > Also, AFAICT, the names are still accepted, they are just normalized. > > I guess one difference is that before, target_new() called target_find() > with the non-normalized name to check for duplicates, and now we check > for duplicates after normalizing the name. I'm not sure how that worked > in the past in practice as you would have had two targets with the same > name (e.g. I wonder what the ctladm portlist output looked like for this > case and if it would have listed two ports with the same name)? I suspec= t > that was more by accident and probably didn't work properly in practice > (e.g. the kernel handoff ioctl used the normalized name when invoking > CTL_ISCSI, so connections to both "names" probably were always mapped to > only one of the connections, and finding a port during login processing > probably only found the first target, and only if the initiator gave the > all-lowercase name). > > That is to say, you didn't get an error before, but it didn't work, and > now it tells you that it doesn't work AFAICT. Excuse me, I spoke a little too soon. You are correct that ctld has been converting target names to lower case before registering them in the kernel for a long time. The change is that previously, if an initiator attempted to connect to an uppercase target name, ctld would accept it. That's because port_find_in_pg used strcasecmp in stable/14. But change 4b1aac931465f39c5c26bfa1d5539a428d340f20 removed strcasecmp, replacing it by the C++ STL's find method on std::unordered_map. So we used to accept connections case-insensitively, and now we accept them case-sensitively. To restore the previous behavior, should we add tolower() on the target_name in iscsi_connection::login() ? From nobody Mon Apr 13 17:38:57 2026 X-Original-To: dev-commits-src-main@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 4fvZQT5qp3z6ZT86 for ; Mon, 13 Apr 2026 17:38:57 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvZQT49qgz3QGq for ; Mon, 13 Apr 2026 17:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776101937; 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=zZ22ATWZG5uiWWdyocnBni1PzmmX2ZdpaQcr6fkE2iA=; b=foZietRAL0Xuv7BHp5FjJSq2Hwa3f1bw1XYhlZO5MzoD89RgqYs+WV0sgaWKEI0Y1SXy10 BNxVWH0G1KN9NF8CEN5+XX/kAcGo10G04dZLtFwZkX9GoWGh/CixtCaCSYIZXnxDvKsDDP 8slKbzRjIyOhpLvZeN/rz5O0wBbugPX5TpFUrU1WASfyYrvRnx0D/5vIq7taes+u2puWgc PGEsdyJ9/rFBxoRs/kaUNPw7iJpdXvqnP/6fPcEdweKk+cALAYmym7lLR1pudrYXV07qVH b+AaR57ZeeXPtZItnu4JcQlxzIB3wGeHBdpnXvHEq+2Q/b/66hXZ+Vrp2mCZqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776101937; a=rsa-sha256; cv=none; b=g/yh26tKl1VxCx9lN17xiAtCaeFr25r8zYWjAS3J/FMFO/gAYh6v5wKRgoGLqzZBifNigP zeqUzzl1BYP8F6Sz7NqZvsbPKUp7wceIo5GjZ6O7rouLO39itH5XYqIPGop1H/C7QfWIQ1 CJqa2nSUcG/p6z0Ur/tHfPo3yjKJHXeARtxOxbHSmrmwXCi0k7XaHAXXSEA45yArBFXvlQ l5BTHZBw67wZWZWQgH04Wr9fH0VWZe1DMpccKGhUbMolHsMtUsa5ZfSpDNJgOg4gcHDZN2 p/VHjuvtKK1A0ugtWQMz2BbBl7MxauCNhdLlTtcVIVI3NI3WpQDZvlZbjpOzHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776101937; 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=zZ22ATWZG5uiWWdyocnBni1PzmmX2ZdpaQcr6fkE2iA=; b=S9vyxrzC2OTQfUDpYzyvI3rkpx/PNCC4fvC5BFY1q4rsIeRwPAe8UiKuO1bVAhfelqRgp8 J94Ara1JlJjPMHHE8xNXMg1v5k14m9J+Hj97/y6AULAIgCSiVD9lKiQ5Nz4pXwhdXtEskR 11tfb4390xhoH1/xZEZSSvq/OeKO1r3bu0s1yrYVjnKo6zN7mOldBXAsIZbc2RwoxfZAa3 tKzNn85YwP9o2Ydt1/ViIEQOK5PKIVNPuGS/xuU0NYFefaWrpLFlK5U0dSWPCFt/UzGDqB O8CRwRJtXQgd22l7HA/3SFFCeEhOJDFL9JsvKDmWR65bdV9ktj/1WS2uXCHkew== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvZQT3TqSz1CVj for ; Mon, 13 Apr 2026 17:38:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31cfa by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 17:38:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Simon J. Gerraty Subject: git: e272f4a61e78 - main - Fix default for .MAKE.SAVE_DOLLARS List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e272f4a61e78037ec8477ba9e9afcbe3ae2cd8e3 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 17:38:57 +0000 Message-Id: <69dd2a31.31cfa.5334a5bf@gitrepo.freebsd.org> The branch main has been updated by sjg: URL: https://cgit.FreeBSD.org/src/commit/?id=e272f4a61e78037ec8477ba9e9afcbe3ae2cd8e3 commit e272f4a61e78037ec8477ba9e9afcbe3ae2cd8e3 Author: Simon J. Gerraty AuthorDate: 2026-04-13 17:38:50 +0000 Commit: Simon J. Gerraty CommitDate: 2026-04-13 17:38:50 +0000 Fix default for .MAKE.SAVE_DOLLARS NetBSD make defaults this to "yes", bmake defauts it to "no" to retain the traditional behavior. The default is dealt with in bmake's Makefile but that does not address boot-strap. For now, just change the ifdef in main. PR: 294436 --- contrib/bmake/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bmake/main.c b/contrib/bmake/main.c index ace5c729be51..15b028a65241 100644 --- a/contrib/bmake/main.c +++ b/contrib/bmake/main.c @@ -1315,7 +1315,7 @@ ReadFirstDefaultMakefile(void) } #ifndef MAKE_SAVE_DOLLARS_DEFAULT -# define MAKE_SAVE_DOLLARS_DEFAULT "yes" +# define MAKE_SAVE_DOLLARS_DEFAULT "no" #endif /* From nobody Mon Apr 13 19:36:52 2026 X-Original-To: dev-commits-src-main@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 4fvd2f2K2kz6Zbv9 for ; Mon, 13 Apr 2026 19:36:58 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvd2d73cPz3kQC for ; Mon, 13 Apr 2026 19:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776109018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=992pLBYu54X9OkWYcF/jh4WIHl+JpP3FVPC63ZhydfA=; b=elo6oV2U9kdyLhkdj1fdBvNVoWGtEA73VeeZwqQ/ZOg7NXLIMZxwbu9b7g7GK+o3m20UfN b9sQg0d3S/PPSvh9foSsMN3aFulmQPBrQ2Hu0zymw9XUdjOlXiu2cAN79khxVaZH+YQA/W WpNVF7PjFbXDsBn87ajDpYLUlZM0zz9SxknZyYT7EzrbYEhy76ZfpNggkxt6hSGOpLCtWD 1c+be4iJJYd+AuaJ3Ccs1YhdqfWl5rV7f06BWIHhK2LGy7Uo3Gkemgzm+ym8Qm76rtQrh5 9lKB3RiWsc5ZaMlz7F2oOcb6XcxDP6Vapo+waKMSTkjesSvL3C4TgBbBG2R3KA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776109018; a=rsa-sha256; cv=none; b=k/+7i8rIL0JXu5IbVa6utkaWEJ0zsuKzihn6MLAS/t1PHXQrJZlYihkv7U+v8d9agtkWre sRwi7YuW4xSvkSoNMo4dSjNOzbEkPuXaltPEDTIW7EsXYPYcj5BSIpzj7xEY1URlbl3yiI 6bCKlNbcJCZiepescwU8SYgHn8SU0pReSbQUobHnSB/jqe3/OCCYDtPiNnl02z2HNI24hf nkyDv+nQlqKOu2AV1G3B/WpvVZK7ItUDbtuvD8qk9xLtKS8wUfLlc9eR2BJnqKfAjSMZDE XrksYa1i58baorDmwrBL1HlhbkRtBWYG5G8dHIy+0abamRBMhagiSKlK+8WxQw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776109018; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=992pLBYu54X9OkWYcF/jh4WIHl+JpP3FVPC63ZhydfA=; b=MCnEsVYCLhwcJFZt19OW2dYY3fY9sDKkr4OPW6kRCqdUguSuI3FuzPmcMU9sFUWnd4cRpN +BF6EiirbIj5me6MB9oKZNZ4OGU4U08LotD74YVpIjeOtSirQmu8fFSOedZ1jFCIAaChkA EOrMwh4r5Ur60mwrCQSWT0z1okcSlZMEu89O6AgFcVgIjsBVX5bqPvtRv4l63YhLNodktd tHENi3cx/5asynIkLlPeWRcj5eCoSzKsa1BrN7+2dSFTYxGXqBTbPj46ewQrLfqzjFnr1u HSVLz+rwp9/P1h4m7lCzuZQ7/mvYCCP7aXT1yg2x1X0YXoDAYK/9wDDU9in6/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvd2d5vZnz2Kn for ; Mon, 13 Apr 2026 19:36:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 40714 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 19:36:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Isaac Freund From: Ed Maste Subject: git: 2018ae4e3b6a - main - pkgbase: remove incorrect clang shlib requires List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2018ae4e3b6a2d7c147933cb36642f6a54830907 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 19:36:52 +0000 Message-Id: <69dd45d4.40714.899194b@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2018ae4e3b6a2d7c147933cb36642f6a54830907 commit 2018ae4e3b6a2d7c147933cb36642f6a54830907 Author: Isaac Freund AuthorDate: 2026-01-20 14:57:17 +0000 Commit: Ed Maste CommitDate: 2026-04-13 19:36:15 +0000 pkgbase: remove incorrect clang shlib requires The FreeBSD-clang package contains a 32-bit shared object at /usr/lib/clang/19/lib/freebsd/libclang_rt.asan-i386.so This is expected, since clang uses this object when compiling for i386 targets with asan enabled. What is not expected is that the FreeBSD-clang package currently depends on 32-bit libc packages due to pkg's shared library analysis, making it impossible to install pkgbase on x86_64 without any lib32 packages. This commit leverages a new pkg feature implemented in [1], but could be landed before a pkg version including that feature is released without any ill effects. Unknown keys in package manifests are ignored. [1]: https://github.com/freebsd/pkg/pull/2594 Reviewed by: ivy Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54792 --- release/packages/ucl/clang.ucl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/release/packages/ucl/clang.ucl b/release/packages/ucl/clang.ucl index 3c15d9b7ef03..deee636dc0a7 100644 --- a/release/packages/ucl/clang.ucl +++ b/release/packages/ucl/clang.ucl @@ -7,3 +7,8 @@ deps { version = "${VERSION}" } } + +shlibs_required_ignore: [ + "libc.so.7:32", + "libgcc_s.so.1:32", +] From nobody Mon Apr 13 19:44:05 2026 X-Original-To: dev-commits-src-main@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 4fvdBs2Dbfz6ZcCC for ; Mon, 13 Apr 2026 19:44:05 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvdBs0XV1z3lbY for ; Mon, 13 Apr 2026 19:44:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776109445; 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=ekPAYiZpXzOfh1iCAQNft+Az3grk8IeRycqjkUlg+jg=; b=baPjLETg7zrV+I/95Kj0UEyzqEiRoZH7O7ozvSO4nVHRLi9eQS5dfjkBrCrlkywA1sL6xP vhoXHJSX9Vbzou0zmpMJokO9dDtqxNsDIZ59ivhhTAMUs3n7z278C2h14zuUnn46rJcVlO vyZugeeo5O//R2ROBxz+hxRE47P3FjvFvJ4/XhacN6xkcrTmLmAQ2e/kqoyyqnOoiTWBK2 gWAd8ycR1s0Rj12a+XuKjOqoKrcOJK4IDBkdUYKbFoe5Yr+xcqdL19foxp7qyRd50RBizU l4NXzpBK17uuLhKHA5w3fKYnZ/C6/5mxduUrPa3T6nFLUWz6Wy0NIIY6KaGmNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776109445; a=rsa-sha256; cv=none; b=cP1C8/iiFhV6C5gzCb1nz8yW9Anjb+FZtzy4liTCH8PzBd1lEZLVjXP71OAu6YR6w7fGVE XKcwOVHyOv24C9MPYTbl0nlCm/BH0V4hWzUBZVy2DZ1gRnrcKCgAcXecoNl4DRXq1YzhId So/44KlMVeOPBcxVI34szl2333xJHegdQksSB5wahltxshmE99etpUAO6JgG2ehmO/eefC P2HN/1AMhFiDbO14MGo+xzftQUOoXfDeq7nk0My+pRXHREdiVcwgLJvWgfFzWVi3gzxO6K bnqgg7uV1Y6+/b5YLxwJUcxMb67ev8wBl7hUgtoeWms7m2nuF6utxtYFz9iURQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776109445; 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=ekPAYiZpXzOfh1iCAQNft+Az3grk8IeRycqjkUlg+jg=; b=ZT8w9wcrrrB3INVfayywz5UdJjoSS2WFoPoUhyh+Ovma2GVdG8IGZ0h/RgPUBPUjUOELtm ei1r6Amp7gVNCA7HMtitZ67G+5yxnd5btxbUkVsHvAipFPU6X2D7jSjmXSvh8SVS40dBc9 ih93l9K4rZUchphoyjklwQR08dB0GAkKjdgQBOmjXMakdhrXeIoAxTisiPr28Ffd/BqSvK I57ETygdAdvtNVURTj+ldbH7saqzR5PMFrfAksiPKYg5kjxhC8bKGXG4Pt5pmmx4b/7a1a SVUBN12uyNATGrSWGg0HqANbEpk8lUcTnib6av7dRmhqcQuinwTA4LpqJomxhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvdBs07ZXz36N for ; Mon, 13 Apr 2026 19:44:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 41bd8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 19:44:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: fa31e76a4c14 - main - Revert "EC2: Add clibs-lib32 pkg to small/builder images" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa31e76a4c147eb5148595c9f3615040fcac74e5 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 19:44:05 +0000 Message-Id: <69dd4785.41bd8.45bffee@gitrepo.freebsd.org> The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=fa31e76a4c147eb5148595c9f3615040fcac74e5 commit fa31e76a4c147eb5148595c9f3615040fcac74e5 Author: Colin Percival AuthorDate: 2026-04-13 19:42:57 +0000 Commit: Colin Percival CommitDate: 2026-04-13 19:42:57 +0000 Revert "EC2: Add clibs-lib32 pkg to small/builder images" This should no longer be necessary after 2018ae4e3b6a. This reverts commit cfe0b7d37e552d78762c029f5b15e0f36d9d0d38. --- release/tools/ec2-builder.conf | 1 - release/tools/ec2-small.conf | 1 - 2 files changed, 2 deletions(-) diff --git a/release/tools/ec2-builder.conf b/release/tools/ec2-builder.conf index a272ea49a426..3b0344f9eb9a 100644 --- a/release/tools/ec2-builder.conf +++ b/release/tools/ec2-builder.conf @@ -17,7 +17,6 @@ vm_extra_filter_base_packages() { -e '.*-dbg$' \ -e '.*-lib32$' \ -e '^FreeBSD-set-tests' - echo FreeBSD-clibs-lib32 } # Packages to install into the image we're creating. In addition to packages diff --git a/release/tools/ec2-small.conf b/release/tools/ec2-small.conf index c1a05f98356f..6564a59c2cf6 100644 --- a/release/tools/ec2-small.conf +++ b/release/tools/ec2-small.conf @@ -20,7 +20,6 @@ vm_extra_filter_base_packages() { -e '.*-dbg$' \ -e '.*-lib32$' \ -e '^FreeBSD-set-tests' - echo FreeBSD-clibs-lib32 } # Packages to install into the image we're creating. In addition to packages From nobody Mon Apr 13 19:53:28 2026 X-Original-To: dev-commits-src-main@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 4fvdPh3jmkz6ZcsP for ; Mon, 13 Apr 2026 19:53:28 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvdPh2wj5z3mXN for ; Mon, 13 Apr 2026 19:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776110008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bd7GrozHq5xkGkWO6/uKvGSpIK5JGpmU1oDlrl3G7DE=; b=LqTw9RfbTBbkqY5NF75kX9BkyWLuZzx3akUVKTI0hPoj17/7OvfR2gchedrNmgg/UB0uT7 fLWx0Blg9Zcn0h5227z2JLQKgD9oOxBJJRgSjIjY+A/oqdobuJ9yk6EyLA4/io1CQgPgyV 5mEHS2XGFIa7iU21r1kxv7MVi5Gdsc9Kujv31rYanUCxRDuoFt7z0fPhuqaUzX58bORmtr TpkmwLsbT33EgUuIGuG3nCiFwccbBBojUMyzU1PRF5yUuthgsYFAGPGXDUkOHthssaDT8u /ma5mmU5/Ct7zvieFaYERo0V8fR3UbthqtuxYgd7ZNdOqjEAJeroopZPy6oYmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776110008; a=rsa-sha256; cv=none; b=MO5oEbiAhhyS+mCDtNbhEGhSyV3xrl871rJT1EgBjqVYBnlE0sMXYE67MibbXAr6VkUj7t T3fMFxNT8gSh2HPe2HfOcpV3NjKTMTh72mJVjhQNCpxqqJZE6Q/3HFGFmPEo0EqsOi+kHC +VG4aoVvtnA+C7h2IF8Qzhtb2v93rj8dx4dxr/lYev7gfa72FLNqp6Z48pbSW9vKxd3v9K R0UrIW2j7g4hgXlPen5ZNRjWo6DHgTSV42E5R+ds2x98S0njYpSh7JtMz7ZQWA6YbAEUaJ EJ6IPKAOWQb5G2L74ohkiQiwI8kfGhQ2KZ4Qf77b5BEq65bUg5PAaGJgiTqrvw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776110008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bd7GrozHq5xkGkWO6/uKvGSpIK5JGpmU1oDlrl3G7DE=; b=uALZ2dHSRd1Q0bdLdCqishlqS7BNkiWYMz2AzJngD1y//etFiinuEWZNXV4Sn1y9kqFUpi KzFfJ8UtYdtqU2iaDTgetGv5nfNs8RpJ7ef32Y0fgH1il5ABB0CvvNJTotj/DzZOfv8W90 uSFErDGa9rLfIRGXHNJA5fA5FffV2tqhB5ZGVCpz2K1cZ/5jXINIuqBW1mFXyTINU8oQ8K cVLrZYMvUG7nqRGRfHVnVLBbd+xFrWz36gB8O7E2DZuyt8z1Tk54l3TzHeZ7VkXpFvTfpG aubdIQ7RMCDorkjPMYDT0tPiuup00Cc+9WWOaQkJZmspWXJo771P6N8UPzy9bQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvdPh2LBxz3dF for ; Mon, 13 Apr 2026 19:53:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4270d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 19:53:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Artem Bunichev From: Alexander Ziaee Subject: git: b1bc748430b5 - main - timeout.1: Document non-POSIX options List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b1bc748430b5ee79ae103c464dbf5ebc8802f782 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 19:53:28 +0000 Message-Id: <69dd49b8.4270d.7caf13b4@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=b1bc748430b5ee79ae103c464dbf5ebc8802f782 commit b1bc748430b5ee79ae103c464dbf5ebc8802f782 Author: Artem Bunichev AuthorDate: 2026-04-13 01:15:41 +0000 Commit: Alexander Ziaee CommitDate: 2026-04-13 19:52:21 +0000 timeout.1: Document non-POSIX options MFC after: 3 days Reviewed by: Aaron Li , ziaee Differential Revision: https://reviews.freebsd.org/D56090 --- bin/timeout/timeout.1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/timeout/timeout.1 b/bin/timeout/timeout.1 index 0a9754a2cc4e..46a5a986cbce 100644 --- a/bin/timeout/timeout.1 +++ b/bin/timeout/timeout.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 3, 2025 +.Dd April 11, 2026 .Dt TIMEOUT 1 .Os .Sh NAME @@ -269,6 +269,10 @@ The utility is expected to conform to the .St -p1003.1-2024 specification. +.Pp +The +.Fl v +option and long option names are extensions to that specification. .Sh HISTORY The .Nm From nobody Mon Apr 13 19:53:29 2026 X-Original-To: dev-commits-src-main@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 4fvdPj4npGz6Zchn for ; Mon, 13 Apr 2026 19:53:29 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvdPj3fhTz3m5F for ; Mon, 13 Apr 2026 19:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776110009; 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=Ecoo20W0BDiowV7GMLUrP1szDo27FS3H8YANGgq9oI4=; b=o8ZuUyyy4/WNBzYwLgHdKHzmlPfLmau9C320JdpRGV5Aix/eMkL5vxT+EU0wFF1g1mwL2t NKLyiJm5LoHIb1KNEctRG6ojC3UV1qlpjQPb+/Sb74v8AbAZi5x40MW3ha5z+oqCNL0nyc JL31TaFwfO3Q02QClA6e9FjDwNqx70njmsdo9w9rcE/YKSRdcEIswgsX/gfgd4E3DVov9m zyVPucsVpX2nLbTdX9+sbukPy+4YQPwfINj4+XKiohfpqv92vSpBmtRbwBNQF0PY797l9S sFBrXstWwXDRjNhFjOpFxWdkuXLENp1TIELgaHva3q37038Y0lTYASclSsZrvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776110009; a=rsa-sha256; cv=none; b=KtNAi556KJHjCiMaQgFM2HhbIEjCcSOy22a3SWiOMqcYkLuGT35XHuxG0ibA+TH4p9GX+k f4x6kA3CFW3raFyFxBGAjcdxuboQrnA+goNl0x5YEfyGFofLkeCL1k+8XQBuWjLWJnbyAA 7JKDvaPd5KbGhSFtGHc1IuiUMI+0+SpyHPnlrNKl4fhJTf2hZbNW96Jr/+8iJYG6jqM+z1 5/Wan8D1NiUNkAu/6sYmomRq6ivTMYAUCTbJRebOZk30VmnGhchCmPybWd4j17MBaAKRzl Pugi8oj71PeTfUkvaOuVUtTxCVWJGrvDURCechq51Bf4OcHJnUEznlZE7yOmbA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776110009; 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=Ecoo20W0BDiowV7GMLUrP1szDo27FS3H8YANGgq9oI4=; b=GctrxKGvNHZzPuJUbuF2VJrRQ75r7UbVMJ0xNEhW6huWatj+A+wEdpR7Jbof7tckn0WQGO 4r3EYg9DNL2d30Z2oRtUxscUKXfMfn2FoQFa9jVC11bQF4EtNAkwVjgSqbOFBFYp7I+FVl uRGcQmHUARCHZs4Ll6m+wslTbWKKkjWKA6vKyD3cmn889OOMrLy6hqcF8qnp4sep7+iXep G4BX/MS2GJhLiOAw6tZJYBeQvAxsdmnQr21lXiq2sKjs6pxRW/w7q2JmT1uax6X6VzoZBA iPD9qyQUqFgkDgeNiHLwaHhXMUASa22mivIAGUaUs/KbqWLY8NLHJcLVrizjoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvdPj37C1z2Nf for ; Mon, 13 Apr 2026 19:53:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 40a5c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 19:53:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: afe57c12e97d - main - diskinfo: Align and alphabetize options List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: afe57c12e97d5c8773d829c2914f35462a7cdd0c Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 19:53:29 +0000 Message-Id: <69dd49b9.40a5c.7872d0e3@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=afe57c12e97d5c8773d829c2914f35462a7cdd0c commit afe57c12e97d5c8773d829c2914f35462a7cdd0c Author: Alexander Ziaee AuthorDate: 2026-04-13 01:59:33 +0000 Commit: Alexander Ziaee CommitDate: 2026-04-13 19:52:24 +0000 diskinfo: Align and alphabetize options MFC after: 3 days --- usr.sbin/diskinfo/diskinfo.8 | 12 ++++++------ usr.sbin/diskinfo/diskinfo.c | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/usr.sbin/diskinfo/diskinfo.8 b/usr.sbin/diskinfo/diskinfo.8 index 970bafd4f8e5..aea4c123048a 100644 --- a/usr.sbin/diskinfo/diskinfo.8 +++ b/usr.sbin/diskinfo/diskinfo.8 @@ -35,7 +35,7 @@ .Nd get information about disk device .Sh SYNOPSIS .Nm -.Op Fl citSvw +.Op Fl ciStvw .Ar disk ... .Nm .Op Fl l @@ -52,9 +52,7 @@ utility prints out information about a disk device, and optionally runs a naive performance test on the device. .Pp The following options are available: -.Bl -tag -width ".Fl v" -.It Fl v -Print fields one per line with a descriptive comment. +.Bl -tag -width "-c" .It Fl c Perform a simple measurement of the I/O read command overhead. .It Fl i @@ -70,16 +68,18 @@ character as a separator. Return the physical path of the disk. This is a string that identifies the physical path to the disk in the storage enclosure. -.It Fl s -Return the disk ident, usually the serial number. .It Fl S Perform synchronous random write test (ZFS SLOG test), measuring time required to write data blocks of different size and flush disk cache. Blocks of more then 128KB are written with multiple parallel operations. +.It Fl s +Return the disk ident, usually the serial number. .It Fl t Perform a simple and rather naive benchmark of the disks seek and transfer performance. +.It Fl v +Print fields one per line with a descriptive comment. .It Fl w Allow disruptive write tests. .El diff --git a/usr.sbin/diskinfo/diskinfo.c b/usr.sbin/diskinfo/diskinfo.c index f091d0ccfbea..d8a79d430edb 100644 --- a/usr.sbin/diskinfo/diskinfo.c +++ b/usr.sbin/diskinfo/diskinfo.c @@ -58,7 +58,7 @@ static void usage(void) { - fprintf(stderr, "usage: diskinfo [-ciStvw] disk ...\n" + fprintf(stderr, "usage: diskinfo [-citSvw] disk ...\n" " diskinfo [-l] -p disk ...\n" " diskinfo [-l] -s disk ...\n" ); @@ -91,7 +91,7 @@ main(int argc, char **argv) u_int sectorsize, fwsectors, fwheads, zoned = 0, isreg; uint32_t zone_mode; - while ((ch = getopt(argc, argv, "cilpsStvw")) != -1) { + while ((ch = getopt(argc, argv, "cilpSstvw")) != -1) { switch (ch) { case 'c': opt_c = 1; @@ -107,13 +107,13 @@ main(int argc, char **argv) case 'p': opt_p = 1; break; - case 's': - opt_s = 1; - break; case 'S': opt_S = 1; opt_v = 1; break; + case 's': + opt_s = 1; + break; case 't': opt_t = 1; opt_v = 1; From nobody Mon Apr 13 20:03:45 2026 X-Original-To: dev-commits-src-main@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 4fvddY45lXz6ZdrP for ; Mon, 13 Apr 2026 20:03:45 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvddY3HZWz3tNm for ; Mon, 13 Apr 2026 20:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776110625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kYcXNyU/ONYZCYZ8zirdJOMR93ujd2g2q1CmIv/hw8o=; b=tStEfwTJNnYi9S/St1bfbWYtqrHtdXbHfpE1HssSMNqN+nBYHDG2tgOa3QfW+1O+PahN+Z YEHY9+lNlPqzw24Ea5ADs74tq06cxUXwNiT0da3JD1M8jZVvclzROc5UTX0Dtn7PECt4oi jeWpsPJlPU/wXf4OPshr7AMg2wJ/zbOJ/dUyloH+lbLIU21ms2M6VcGhabvwSncXQp8iOD e03TiidlMjZLdqicIPC3LBWZXhfntqUBw381BBQKIo7kOngAg//AOn95fRX95+UBx+mqL/ z/1r7jJ6jxSOQfQhbjRhVppTjy5u/2oKuVPzuewaqVMWQ4cZJafHGABDNOh5Yg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776110625; a=rsa-sha256; cv=none; b=fe7pTw9Qn+EwV0mHSU8mGFgUDMStoy2sHt68nf88kwnN+jfatFhMXldJgnwJQvxpw0wsJv wq9hFpvw3ouIB0UIGXDvNXrfuRa+dmHXthcyOAmxJvp43mqQm87Qv6fQnz2sz7xwVz0MzV l9wpxYCaUeMT2w2fQCKgfEx47I3/XSTs8lRJTVJTEqbaHY1suvpKTj8jp5ybuhHZARXb5T +OYtGPGGdhOpaOHPVvhu4W7/890i+ELT1ahCxnFCCiE8Fzs46b5B3+NwMF/AJSb3ybelFa q6DTZXoEd7vhUXHMQPYfErRJ0vxqzz+FR9DjYZcdXYFDQ9hXabfgs6EsSVvp6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776110625; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kYcXNyU/ONYZCYZ8zirdJOMR93ujd2g2q1CmIv/hw8o=; b=BrxYWQJpVHLnvy3pXwf49W0UKSYGikzmSU0McBbGBMqrhCpvDAlBshVR6vnQCKIpU2hjWP fhBIfbO2XKwP4OTZHmope8X5xpngchmTr+s4WTBRxGRmoBJQlwQ36ufyIrNu3MAuzp0aoK Qq1Q1smHU/9WU/r0BfIvgz8Hu4t3XafGrFLD6Gd9hWgg8AX20O8YXUwj6+60mVG/ntEbkd TyEki91xlERutZQee2jI2A7GzBLre04NQfSzRCxP0x1lshQFaD8Ka5yYtp4jpURcRD70CA 3CpAeKVEHuXgHNt3ng/xG46oMARNQluCpTXOjmxLMEsaLW2JvHp+tsTHkjgl9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvddY2vBsz3sq for ; Mon, 13 Apr 2026 20:03:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 43448 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 20:03:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Isaac Freund From: Ed Maste Subject: git: e11eba76cfbd - main - pkgbase: only provide shlibs from /lib,/usr/lib,/usr/lib32 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e11eba76cfbd6b439ad40faeb8ffccf4241e7034 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 20:03:45 +0000 Message-Id: <69dd4c21.43448.19c673cb@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e11eba76cfbd6b439ad40faeb8ffccf4241e7034 commit e11eba76cfbd6b439ad40faeb8ffccf4241e7034 Author: Isaac Freund AuthorDate: 2026-01-20 14:57:11 +0000 Commit: Ed Maste CommitDate: 2026-04-13 20:03:22 +0000 pkgbase: only provide shlibs from /lib,/usr/lib,/usr/lib32 Reviewed by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D54793 --- Makefile.inc1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.inc1 b/Makefile.inc1 index 1edab54eeea0..681ebb44fc52 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2285,6 +2285,8 @@ create-world-package-${pkgname}: .PHONY /^version/ { print $$2; next } \ ' ${WSTAGEDIR}/${pkgname}.ucl && \ ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \ + -o SHLIB_PROVIDE_PATHS_NATIVE=/lib,/usr/lib \ + ${_ALL_LIBCOMPATS:range:@i@-o SHLIB_PROVIDE_PATHS_COMPAT_${_ALL_LIBCOMPATS:[$i]}=/usr/lib${_ALL_libcompats:[$i]}@} \ -o OSVERSION="${SRCRELDATE}" \ create -f ${PKG_FORMAT} ${PKG_CLEVEL} -T${PKG_CTHREADS} \ -M ${WSTAGEDIR}/${pkgname}.ucl \ From nobody Mon Apr 13 22:32:41 2026 X-Original-To: dev-commits-src-main@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 4fvhxQ1BTqz6Wsbw for ; Mon, 13 Apr 2026 22:32:42 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvhxP5Qzzz3BqS for ; Mon, 13 Apr 2026 22:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776119561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ae7p4rONId/mYxOwZeJ358mOzV9M5m0YLpPnL3N6vtE=; b=tQ2W/B92fu8FWcdnNtP9WVufZNdSif59Mk+R7SZclvlmXzCqTrvmMXoD+PKzCHtk8comS0 tSyneRRmCAxIiXBkV0H/SATV/f4V1d+8xQrXuUQ1MnPOmkvBcRq7vNfFFSWa5i8kyW+wK6 ZcZdEVDe7cjy+8cDE6ChZCl5Iz+eVOJMbZo9ILl50V4xP3Nju2rk4MomxsBBFXPrbKbGWc iJvhIXPgJRmqyevwdO7fWEhVxoEwO/M8wpJ8eJZMSJJT1C1gcHqjG2nP/Je/wMi/uotW/R jheiFwFc5T+t99wZGOWeaqQ5FPOztIlu11+K/csdTVcb9v/jYx1DqdD7qOJ3Cw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776119561; a=rsa-sha256; cv=none; b=yCIS9vhEDB5UvfaBr676NZyxnHrYFNllQl/fwlv8oGs1kQIc7Q2ZVzmdrknJThRZILm4E0 g+v9aytRgK6bwwDbmFh2Om38wMsY9GoI2bidIVQtzWHoF2gdm8cHcB2y9L4NfVKe3pyU49 8V9UcFZJglQJcNbBztQnCLN7IBbui7ocqVd7StRS+qleugg1FIOgpMOWekrv/uQ9mF6yHX AFO5R/hYPcYkqQ6VpX1KtR1rDEMHeqC5udCsQo7b28Lpq8oxGB5XwvixNknsSlXxIGM06r JDSlejl0s3HqMm630/jO6uYhx0TveQGgnnvm9GvYndzFaQlrndLVADsnGmRlFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776119561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ae7p4rONId/mYxOwZeJ358mOzV9M5m0YLpPnL3N6vtE=; b=R/Mtve48JckVNgT+/AR5IsD9n/892uY9y0NUH4O4/jxU/HYiI7xn3Y1E/MYANcxTlk4xZ/ aIWfXgJwpuR5Vh5szexLFYTocYqEXspcfUNNB2HWw1IDIjASAxdHCw5mkPvR6m5QZok9T8 c1yDulOK++seUVAqNrtSPYHH9Actd7gzl37eeXuDUw3cg6sQtEXjgtfLgG/k1YlhsWNx+w Mf+Bp/0d9vPjKmAW1zW44dPiichIWr4dvaO6YKNOyiZEuudwNJqolr1lWeL/1i+Eb1x+bP bWtFKhwDeCeVMce/4DXXW3vFpM1HPli3WanuGo4TZPWLhyU4QTk7XAyelhzN/Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvhxP4j1nz7vG for ; Mon, 13 Apr 2026 22:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 246f6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 22:32:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: YAO, Xin From: Ed Maste Subject: git: a3c457398f26 - main - linux: add sysfs filetype support for Linux statfs() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3c457398f269c913aaa4d9dedcc72a70c02e845 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 22:32:41 +0000 Message-Id: <69dd6f09.246f6.48daec1a@gitrepo.freebsd.org> The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=a3c457398f269c913aaa4d9dedcc72a70c02e845 commit a3c457398f269c913aaa4d9dedcc72a70c02e845 Author: YAO, Xin AuthorDate: 2026-04-04 14:02:59 +0000 Commit: Ed Maste CommitDate: 2026-04-13 22:32:12 +0000 linux: add sysfs filetype support for Linux statfs() Added MAGIC number below and map to linsysfs in bsd_to_linux_ftype() This maps: - `linsysfs` -> `LINUX_SYSFS_MAGIC` (`0x62656572`) Signed-off-by: YAO, Xin Reviewed by: emaste Pull request: https://github.com/freebsd/freebsd-src/pull/2119 --- sys/compat/linux/linux_stats.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index 03783d466211..6f96a219003b 100644 --- a/sys/compat/linux/linux_stats.c +++ b/sys/compat/linux/linux_stats.c @@ -295,26 +295,28 @@ struct l_statfs { #define LINUX_ZFS_SUPER_MAGIC 0x2FC12FC1 #define LINUX_DEVFS_SUPER_MAGIC 0x1373L #define LINUX_SHMFS_MAGIC 0x01021994 +#define LINUX_SYSFS_MAGIC 0x62656572 static long bsd_to_linux_ftype(const char *fstypename) { int i; static struct {const char *bsd_name; long linux_type;} b2l_tbl[] = { - {"ufs", LINUX_UFS_SUPER_MAGIC}, - {"zfs", LINUX_ZFS_SUPER_MAGIC}, - {"cd9660", LINUX_ISOFS_SUPER_MAGIC}, - {"nfs", LINUX_NFS_SUPER_MAGIC}, - {"ext2fs", LINUX_EXT2_SUPER_MAGIC}, - {"procfs", LINUX_PROC_SUPER_MAGIC}, - {"msdosfs", LINUX_MSDOS_SUPER_MAGIC}, - {"ntfs", LINUX_NTFS_SUPER_MAGIC}, - {"nwfs", LINUX_NCP_SUPER_MAGIC}, - {"hpfs", LINUX_HPFS_SUPER_MAGIC}, - {"coda", LINUX_CODA_SUPER_MAGIC}, - {"devfs", LINUX_DEVFS_SUPER_MAGIC}, - {"tmpfs", LINUX_SHMFS_MAGIC}, - {NULL, 0L}}; + {"ufs", LINUX_UFS_SUPER_MAGIC}, + {"zfs", LINUX_ZFS_SUPER_MAGIC}, + {"cd9660", LINUX_ISOFS_SUPER_MAGIC}, + {"nfs", LINUX_NFS_SUPER_MAGIC}, + {"ext2fs", LINUX_EXT2_SUPER_MAGIC}, + {"procfs", LINUX_PROC_SUPER_MAGIC}, + {"msdosfs", LINUX_MSDOS_SUPER_MAGIC}, + {"ntfs", LINUX_NTFS_SUPER_MAGIC}, + {"nwfs", LINUX_NCP_SUPER_MAGIC}, + {"hpfs", LINUX_HPFS_SUPER_MAGIC}, + {"coda", LINUX_CODA_SUPER_MAGIC}, + {"devfs", LINUX_DEVFS_SUPER_MAGIC}, + {"tmpfs", LINUX_SHMFS_MAGIC}, + {"linsysfs", LINUX_SYSFS_MAGIC}, + {NULL, 0L}}; for (i = 0; b2l_tbl[i].bsd_name != NULL; i++) if (strcmp(b2l_tbl[i].bsd_name, fstypename) == 0) From nobody Mon Apr 13 23:07:02 2026 X-Original-To: dev-commits-src-main@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 4fvjj75Qszz6WwXw for ; Mon, 13 Apr 2026 23:07:07 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvjj73NBwz3JgD for ; Mon, 13 Apr 2026 23:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776121627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D2Fc5Q0x3Hlx76eZHWOY3ROqBKFv1tr0vOwQt8IqzsQ=; b=IhZvJm7CpV2QTMpiHhzN+o6mJVIIddtkLZx/vG7A4jX6iqYcQOlgedU9dNjP/f7A5ghFUz aSO8ZnQ1sD0xmaTIK8BbrLv/8c2kRe+pqKRq4XhxiGZchO0Ki/4DYZDk8vvfEXiDjXOHJP Vunh+xANBWVBYdejiKomUBUtx6qrZ/Z1FjF60nTEzu+hAUGW/o68WcVI02NtdJ//2vzZYg qFPnoqKOImjU74XCRtMB3J+11bG36mkROjFOG5OaLShZ6593vygbX6arhhk0+b9PUgfFWA /YcSUy957n3ZGbQ1Yr53hDvK+rW8nvApcutTur9jyuiRUvegdpnCWgZlDSCn+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776121627; a=rsa-sha256; cv=none; b=vLLyrY8ehs29lKlplx+uKhKzQtX369HRVF8Y7oUMDrAol53gfIiWQgCsRRfvv7G9D+izql by2dyCPOqCFYzoqMubHcd2Csie6Sy7a+CQqUT1jTRs+N4yCnLV7X0qT7lywQ8pjOe4roWB YVkCcxf4n/6cgI/QuEr0jn6MxevBHhof+7lRKrziWP14T6E9GngdpwbPwmv3JQbshOVsT1 4pS6ldihdm48q2JPKXttWcdVsbdURo3Hlle7nyTyUENWzzzQbx0dAAUlcpzhOncjVxJYZA TNiUrQucFbC5Ap0qfwKZXFsVyGxtVvQeq9oA5ZOPNh4vL/OVg9pvksyDeSJyOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776121627; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D2Fc5Q0x3Hlx76eZHWOY3ROqBKFv1tr0vOwQt8IqzsQ=; b=bjnlETD0Q3N4RobpZmx3dQbAsQXe4XXKNBMklDMSQkCUOeRnp8MhVcteT72O2ML1lH10A7 i8x7BujhBVHVjySoXUbK1Z/lQMG31t5/DQTOrPUhVaUPF2wat+1nwaIlzkBTmo/KplKqZ2 v42i0vcnmHprPT5m3bwtm6PKAmsMy5U0X3w3gq7r8zZRAQLVyiNkEdmQbtjZXgPH0CwQln 9wMUsb45zKgwMQyx1MDK0hCaJDAEX8aE+umNii2GRrK5rYZ6eQ9X5dJJfbSOD+qUUx/oTv UE7c1LSbd3EDmQUAx4rZE1hOFDoIaDisZfe1lqU1c2qioivrZGxuBNZvlVbzJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvjj72fJVz8ky for ; Mon, 13 Apr 2026 23:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 266e3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 23:07:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Kristofer Peterson From: Alexander Ziaee Subject: git: 81b2055c49de - main - sh: Increase default history size to POSIX mandated minimum of 128 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81b2055c49dec8884d7bb23503f1dfeac37ac95d Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 23:07:02 +0000 Message-Id: <69dd7716.266e3.a3b35ad@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=81b2055c49dec8884d7bb23503f1dfeac37ac95d commit 81b2055c49dec8884d7bb23503f1dfeac37ac95d Author: Kristofer Peterson AuthorDate: 2026-03-24 14:56:48 +0000 Commit: Alexander Ziaee CommitDate: 2026-04-13 23:06:41 +0000 sh: Increase default history size to POSIX mandated minimum of 128 The default history size in bin/sh is currently 100 however POSIX.1-2024 mandates that a default greater than or equal to 128 shall be used, therefore this increases the default history size in /bin/sh to 128. POSIX standards reference: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/sh.html#tag_20_110_08 MFC after: 3 days Reviewed by: emaste, jilles, jlduran, ziaee Signed-off-by: Kristofer Peterson Closes: https://github.com/freebsd/freebsd-src/pull/2093 --- bin/sh/histedit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index c109cf20613d..a9a4837a92e5 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -233,7 +233,7 @@ sethistsize(const char *hs) if (hist != NULL) { if (hs == NULL || !is_number(hs)) - histsize = 100; + histsize = 128; else histsize = atoi(hs); history(hist, &he, H_SETSIZE, histsize); From nobody Mon Apr 13 23:34:13 2026 X-Original-To: dev-commits-src-main@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 4fvkJP3R6fz6YT8f for ; Mon, 13 Apr 2026 23:34:13 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvkJP2ZLvz3Nlc for ; Mon, 13 Apr 2026 23:34:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776123253; 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=mU5lyDrozgEwuclXJPAOoFeACYsRGClreBFstSY/gPU=; b=VHZJlGh1gEls0l3eJpGocBm5XB0EYveFCGSsAkY06X1MrYIW49uGQZdENSVXE4F5Xh7cDV tZdymJlty/wMr4DX30NFzhRvJ/QV66V3NUN6aD7k7M/+hnVNvcaVmuVRElpFD116YyS7YG ZyMzd269wAgXT9XktI4+Thp65dbEJPh7c6IfKXP78CjtHW7vb8NxQ2onleYiNN511G2XEI lODAlXx07XYHRJ41dYQs1wFUuq7/29Fiv09Fz/b0EQiqCknEVlXihsdDLiUh6waTXCFOLy Cus31LyaPcXQelgpftgW/DLfFIVmon6MBNAZLleOGREvSHACIWa0XK5uo0FIMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776123253; a=rsa-sha256; cv=none; b=V0DzC5GNWJW/BD+2TMFsbIUdSZMxflqjTlKZjKEazaaza/1WcW7cBSjqI32AvCZNsbOx2P OyY7uHtrofT+P9XI0hi/DKatzmbHauIZ7o0H30GelSTc3KbgcQItKSAXFL7wfetcLM41KL //uAdgO5iZ8WQbQj6svw0zmHlHtj1WrTf/lGjIE1hXXGW9kCbzXQ1VsNo2UuhKPA7f5oBE RKBeDNVGwui4DEuTfmS3BVvAkGMCc+lV1jwRKRYxmEWij/oEe8ohdzmrDm5j4cDiom32ZD /6RyhYSFlc9ZcKpmbvcalfEoQICYrx+1+UaZIMZFadSQgYKXft4xp/V9HWhJmg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776123253; 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=mU5lyDrozgEwuclXJPAOoFeACYsRGClreBFstSY/gPU=; b=aSLxlBe3hguFXUPiigOWSmNn+B5fNW5CCMsaLFjpJq9RAWG5KtdwzN9UOqKsTiC1L+HQ+j YhQnsH+F3IXgup/M98hu+8EXRd/wBVQzZ00s13X8hTk7+5HDmCMAil3QaD4yEOppDmAAlD b8wpjQpncuvLjOc+1SZ8JATK/FgBBdC3AGItSJUZbPHn+LToXLjoBXkD5nRuTjTw1dT+OW tIwMbMofst2Qw1MGF17FMKvOA1bMSHeVpsPLryh+aa3EPdfHumpm963nGmAMJJ2GADWEnk 7XaRsf7P6ywd0EnEsXR2t/lLRFUsQ9J4emGlVRpxyG8WmW+Waub9gtG7PyrHyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvkJP25bDz9LF for ; Mon, 13 Apr 2026 23:34:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 326f6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 13 Apr 2026 23:34:13 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2b954770ddd7 - main - nvme: Use passed in max_pages. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b954770ddd7a4246c2100373d86ef5316becd81 Auto-Submitted: auto-generated Date: Mon, 13 Apr 2026 23:34:13 +0000 Message-Id: <69dd7d75.326f6.1090f913@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2b954770ddd7a4246c2100373d86ef5316becd81 commit 2b954770ddd7a4246c2100373d86ef5316becd81 Author: Warner Losh AuthorDate: 2026-04-13 23:30:24 +0000 Commit: Warner Losh CommitDate: 2026-04-13 23:33:13 +0000 nvme: Use passed in max_pages. Noticed by: jhb Sponsored by: Netflix --- sys/dev/nvme/nvme_ctrlr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/nvme/nvme_ctrlr.c b/sys/dev/nvme/nvme_ctrlr.c index 447a824df8be..753a8b380a75 100644 --- a/sys/dev/nvme/nvme_ctrlr.c +++ b/sys/dev/nvme/nvme_ctrlr.c @@ -1364,7 +1364,7 @@ nvme_user_ioctl_req(vm_offset_t addr, size_t len, bool is_read, npages = nvme_page_count(addr, len); if (npages > atop(maxphys)) return (EINVAL); - if (npages > NVME_MAX_PAGES) + if (npages > max_pages) upages_us = malloc(npages * sizeof(vm_page_t), M_NVME, M_ZERO | M_WAITOK); From nobody Tue Apr 14 04:59:03 2026 X-Original-To: dev-commits-src-main@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 4fvsWK1mHXz6ZB1M for ; Tue, 14 Apr 2026 04:59:09 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvsWK1F4tz42vx for ; Tue, 14 Apr 2026 04:59:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776142749; 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=r24SduA0VGBKKLjMnVJJGL4oqGdQzCTH2j5007iN8Yc=; b=B8HnNXkHg5GXcXww5KnwwREgPW0dyUubUDn9WihaWzvikqn577NMt/uorRCYQlia5jH0DB LWu1jHZlahU43xlZAP+nYWRPrg0hz93MO6gaFL7xPzWsButbLNuvCqyIDoIOMz+dBwBGY8 8/0lNn4yOqGGBQPsfVcj6XQovkolD70qy3C8/m78T5NtBBb+2oEagLkESnrvAWUIB9rFj7 C4MwuiwIyeVyFvi7k0nsKJgv18G2H5dZEQbz4z9KPjc/gAkdcNzXaMAlfZwX1rEkTsqI8k VVRt94KIXAx9rIlW8g19g3nf0OAo0rmyboeLSi9HP+gHPS3NuUB4BqTKNj0QPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776142749; a=rsa-sha256; cv=none; b=b25twY2FftPI1J10sECwmQumFttWiL1OLFL+z+mzIMd83I8qsmz1IcHvN49aury7ooEtXO TlzMCKFKSL8ojJWUM6FBMH9M1FbJspXRtyppaEAJ/KAj6pXzBlrqZy1ZjPWhfeP6tEix2G 8iw7sDq4cstdi0bAKX3/7Xo9cB3tzyuAVpiLCsTL5osVlgCJ+NVgCCW1i3QDXBbCl7Z81z iutjYyRjhlzwOSsXu6IC+n/9+iJexO55i5QV2CJVQPnlRwhySyfS5mPDRSfS7v7MNKuQKS dhr7yrgUllXQr2nHdl5n+BWTXAB1V/hPebSqx34lb/nhxkq/shfyyNDRlO35aQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776142749; 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=r24SduA0VGBKKLjMnVJJGL4oqGdQzCTH2j5007iN8Yc=; b=PsDabur0EmlVjeDikIRfazi9dEK61sv+Ia5bXcJPUCirseKzBRK67DdpedbS9DI+znuYn0 /jYeLqOP1iFNhn6Jhu/50sd8+xflnD5yRNujft70KMaZC5bodxGbUgqutL7OqD7ps5f+9Y 1Elmfu5z9N5yh+0p06+lBZ+jyXOXjWSjLTEWI4nfJ6v4G0c1JDqxmb/KTEyKB5TbnrDCvM y7kdH09TjOBJwqRosy6UuwSMVAlEkqmddXrZNaOyxV1vYAc8SMCYQEK5WLNpgjsV6Uc1CT DlfADGxheMdUVACgnyMJSsVM8zhaBxZ1JlcQRp3eoLdFPfw8gyWCi9P8x+VOng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvsWK0pNqzcXM for ; Tue, 14 Apr 2026 04:59:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 341a8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 04:59:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: ShengYi Hung Subject: git: 43d632779b7d - main - x86: Mark LOCORE to prevent build failure on i386 platform List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43d632779b7d1df6c96a5cc0f506c13e09a845f3 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 04:59:03 +0000 Message-Id: <69ddc997.341a8.301b82f@gitrepo.freebsd.org> The branch main has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=43d632779b7d1df6c96a5cc0f506c13e09a845f3 commit 43d632779b7d1df6c96a5cc0f506c13e09a845f3 Author: ShengYi Hung AuthorDate: 2026-04-13 14:46:43 +0000 Commit: ShengYi Hung CommitDate: 2026-04-14 04:58:39 +0000 x86: Mark LOCORE to prevent build failure on i386 platform PR: 294468 Reported by: dan.kotowski@a9development.com Tested by: dan.kotowski@a9development.com Discussed with: kib Fixes: 9289df1949cd ("x86: Add zen identifier helper function") MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56377 --- sys/x86/include/cputypes.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/x86/include/cputypes.h b/sys/x86/include/cputypes.h index ed26304a89ac..0b6f0f3746a9 100644 --- a/sys/x86/include/cputypes.h +++ b/sys/x86/include/cputypes.h @@ -54,7 +54,9 @@ #define CPU_AMD_UNKNOWN 0xffffffff #ifdef _KERNEL +#ifndef LOCORE u_int ident_zen_cpu(void); #endif +#endif #endif /* !_X86_CPUTYPES_H_ */ From nobody Tue Apr 14 07:39:16 2026 X-Original-To: dev-commits-src-main@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 4fvx4427DNz6ZN7k for ; Tue, 14 Apr 2026 07:39:16 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvx441b0gz4KPC for ; Tue, 14 Apr 2026 07:39:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776152356; 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=IxBuLno6H4Xx5hVQF1rMCu0BQkDVCECf9AZWYG92Vxg=; b=E+Tu0bDZ7m5i/aH0LxWTVLTzfqsuiqtx0CNl6veflBZKDL0BQMf1aCZAv+Mr53/jdzRZEr CPtTybf5ZgWBVCcONPXpIfWGrBwmesTw87BHgafOAHWXRk5zJVUitq/DobH2RmWAGUjzj0 K+6zUsTDyXwI9AF6qmJySTfJCxBjt2YikY3eYobXZYxN4JfuZy8mW+K7rGSbEUdxbG9xzi S3e16ss8if7rRTAFvCRpWDQD4hoVnkdm1vD5nP0g0tRcTJsGPM02VvUajbk1aQUmD2hojS +1fqdnD7VIsWE8uw31GN20O913zUrAQfKHfBE5qivFQ52ylQiYqmDofHj/iyYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776152356; a=rsa-sha256; cv=none; b=s+SyQWikntJvJro9pCsGC/jncRO2cblhSDWep8D8oTEf3cu+n6voYH2H+/v51laZz7nV/L efWdDUuSQTsug9w1fe4TUOtFgoNzWMHY6nVk1gG4Wqfev8vse4uGUip8ndCrSRZfdEvplX cWgl5DOkPBTcMvdxokZXd6CGVw5Mfm4Y4KXQOAczCvucaRheRAVGHoWwCwd5/gRQNG4Eie +m6x7va7zFum9XVtktXIOPHIqgk8JeODslNR+QHsrwXoijDmYRmdkMhevhzS9qlIY/oBOJ OpHUEGy5EJ/xBZWsmLlFla0zvsNATCS7nwRxDCFthdl9lg3h3+xUxifr4nPlTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776152356; 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=IxBuLno6H4Xx5hVQF1rMCu0BQkDVCECf9AZWYG92Vxg=; b=T0O/RVeYTnCxhnFxV/uPajAVaMl5zFeIXtCIkbWJyv5ZYsVe40lMsJlMtQw1xqKH2VaOPu agmDK/MubHDY5w2t9d6/LKA2+Hx46Zw2k/WHJketbiCNBBRPTkY9GrrXph+9zyU52y3kfP I8ds9iKcZPinD/1cLYsf3jQfZ6KRskx0/zHZtBhjtykBt8Zg4CDpRsU565nY/+N4fb9Ymk PucmQas+uHpkmsHI3ws8WJQl0X2jYxe7kzxToOmYOpvQcy7zDXoY0MIhqf+KZnkzDv1bsx lwsgZJkICKJZHE4LLQA/Gm6/NlwkaRSk1tRrlU6M4VDnfoblLPuRWXoo0XIY8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvx440dkdzgtP for ; Tue, 14 Apr 2026 07:39:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44a8e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 07:39:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Osipov Subject: git: 54f5d20492d2 - main - ciss.4: List all devices supported by ciss(4) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 54f5d20492d231b5c2ddc6f1d94dbffa1707d820 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 07:39:16 +0000 Message-Id: <69ddef24.44a8e.1844f684@gitrepo.freebsd.org> The branch main has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=54f5d20492d231b5c2ddc6f1d94dbffa1707d820 commit 54f5d20492d231b5c2ddc6f1d94dbffa1707d820 Author: Michael Osipov AuthorDate: 2026-04-06 18:21:48 +0000 Commit: Michael Osipov CommitDate: 2026-04-14 07:39:02 +0000 ciss.4: List all devices supported by ciss(4) PR: 285744 Reviewed by: ziaee MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D56285 --- share/man/man4/ciss.4 | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/share/man/man4/ciss.4 b/share/man/man4/ciss.4 index d731aaddad38..cf59836c47dd 100644 --- a/share/man/man4/ciss.4 +++ b/share/man/man4/ciss.4 @@ -1,7 +1,7 @@ .\" Written by Tom Rhodes .\" This file is in the public domain. .\" -.Dd November 6, 2025 +.Dd April 6, 2026 .Dt CISS 4 .Os .Sh NAME @@ -116,6 +116,18 @@ HP Smart Array E200 .It HP Smart Array E200i .It +HP Smart Array E500 +.It +HP Smart Array H240 +.It +HP Smart Array H240ar +.It +HP Smart Array H240nr +.It +HP Smart Array H241 +.It +HP Smart Array H244br +.It HP Smart Array P212 .It HP Smart Array P220i @@ -124,6 +136,12 @@ HP Smart Array P222 .It HP Smart Array P230i .It +HP Smart Array P240nr +.It +HP Smart Array P244br +.It +HP Smart Array P246br +.It HP Smart Array P400 .It HP Smart Array P400i @@ -146,30 +164,56 @@ HP Smart Array P430i .It HP Smart Array P431 .It +HP Smart Array P440 +.It HP Smart Array P440ar .It +HP Smart Array P441 +.It HP Smart Array P530 .It HP Smart Array P531 .It +HP Smart Array P542d +.It HP Smart Array P600 .It +HP Smart Array P700m +.It +HP Smart Array P712m +.It HP Smart Array P721m .It HP Smart Array P731m .It +HP Smart Array P741m +.It HP Smart Array P800 .It HP Smart Array P812 .It +HP Smart Array P822 +.It HP Smart Array P830 .It HP Smart Array P830i .It +HP Smart Array P840 +.It +HP Smart Array P840ar +.It +HP Smart Array P841 +.It HP Modular Smart Array 20 (MSA20) .It HP Modular Smart Array 500 (MSA500) .El +.Pp +Additionally, several HP Smart Array controllers are supported by PCI +subdevice ID only, as no model name is available for them: +0x3220, 0x3222, 0x3230, 0x3231, 0x3232, 0x3233, 0x3236, 0x3238, +0x3239, 0x323A, 0x323B, 0x323C, and 0x324B +(all with PCI subvendor 0x103C). .Sh SEE ALSO .Xr cam 4 , .Xr pass 4 , From nobody Tue Apr 14 09:14:18 2026 X-Original-To: dev-commits-src-main@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 4fvz9k3X6kz6ZTd6 for ; Tue, 14 Apr 2026 09:14:18 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvz9k2WH2z3FPX for ; Tue, 14 Apr 2026 09:14:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776158058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Gp7Z6+WRGsLUL3ZjufK2qZ1quPiJDVBkQLJKoWXlGo=; b=emjfqgb0uJgq6j6orDRhWYRB9XVpD5PnQlL3uQdIaG8BeyqzxyoFasxwNSVzQeVFFTESLB K7/igAEQiHlsZCMaB/bXSaXc5pTtWlvNltDQFn3Y7jYUVpMpjkpIR1qIic5mwW9TJcd8Wr XoL1wOz2XHlqGTino/d4922WIV2dgdFr/mJCTfDT0jN00pTMmnzuBAVhRde0eUtf8eLnpM MPiGvOYkKzr3w8Hv5/uKlvU79w7R3RthpTkXsPN8qTTsgWUmWaB5N9yPeDFVHHd64pBj1Y Kxpcj0dic54eMhOzBngAQLOZp3d/svmHDbxgWam09WDVhOk0lUQnV11Ppnr20Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776158058; a=rsa-sha256; cv=none; b=cK/5RNBjjqmsQJXBvEGwtYPH9PFZ+ZcKb1jHdb7ewvcextjKizAlapyw/zF7brErQVC7t3 PplQp+4VdPkwuA6RQd+HqqGYzdaTxMC4uo3xo9SPIlq0sC9/W4mDvCp8+/YBcOrY0Y05EM TNy5v5EoPTWvpyOTkG/Z4WcjBKZF9GZwFBoa5e9v4Xn/eYUz4vbwlbO6p3gi1Lc1C/jHaE XMQjxF5h7Nk5ZFJLvDu+eG4Zg65H1XcInzyfkjtApCk0m09qqGXbsa/O6GHjlG9BS+oH01 ozhXq5F/XG/3RbieHtXP+aSbQdhXlRygUar4U/tBw/weC0QXWeNTPAHbL5s57w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776158058; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3Gp7Z6+WRGsLUL3ZjufK2qZ1quPiJDVBkQLJKoWXlGo=; b=FgeMHngm6djUyHSq3BrDCyxcgJk1thmYsEHsR9n1NMpr0u+B5+7wV7cnUFCLSqiBFQ/wlq CS/sZQfiTH/slYaQYDrD+0iD9xJXEZ9jKunSonPKKIlhPQ85htlOgV43GmLcM0NHMSC+Xr yXxb5U8dry4w37RJ51W2UsvxJhNtHDG/VlrqZrTdeJimfdP1Vf8PZordhjMjNNcBCDtue2 o0HwwkCkoYV50e0LmRVDozCHahzbhQAozFdpoU3I9uP79jtd8Iit3GfrN6APHnDBXH144U ScA+5/kqJCAH3H8lJjL/b/c49eHrLthyfaSra1jUngn13NGMLCPQ/7iQ0qjSyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvz9k1sCyzkxP for ; Tue, 14 Apr 2026 09:14:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1efdc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 09:14:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Sreekanth Reddy From: Sumit Saxena Subject: git: d2b96f654a67 - main - iflib: Fix panic observed while doing sysctl -a with if_bnxt unload List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ssaxena X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d2b96f654a672f6059c5c623c276dcd76841ed12 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 09:14:18 +0000 Message-Id: <69de056a.1efdc.319ecdb4@gitrepo.freebsd.org> The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=d2b96f654a672f6059c5c623c276dcd76841ed12 commit d2b96f654a672f6059c5c623c276dcd76841ed12 Author: Sreekanth Reddy AuthorDate: 2026-04-13 06:28:08 +0000 Commit: Sumit Saxena CommitDate: 2026-04-14 09:13:34 +0000 iflib: Fix panic observed while doing sysctl -a with if_bnxt unload Observed below kernel panic calltrace while performing sysctl -a operation while unloading the if_bnxt driver, Fatal trap 9: general protection fault while in kernel mode KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe02a7569940 vpanic() at vpanic+0x136/frame 0xfffffe02a7569a70 panic() at panic+0x43/frame 0xfffffe02a7569ad0 trap_fatal() at trap_fatal+0x68/frame 0xfffffe02a7569af0 calltrap() at calltrap+0x8/frame 0xfffffe02a7569af0 trap 0x9, rip = 0xffffffff80c0b411, rsp = 0xfffffe02a7569bc0, rbp = 0xfffffe02a7569be0 --- sysctl_handle_counter_u64() at sysctl_handle_counter_u64+0x61/frame 0xfffffe02a7569be0 sysctl_root_handler_locked() at sysctl_root_handler_locked+0x9c/frame 0xfffffe02a7569c30 sysctl_root() at sysctl_root+0x22f/frame 0xfffffe02a7569cb0 userland_sysctl() at userland_sysctl+0x196/frame 0xfffffe02a7569d50 sys___sysctl() at sys___sysctl+0x65/frame 0xfffffe02a7569e00 amd64_syscall() at amd64_syscall+0x169/frame 0xfffffe02a7569f30 fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe02a7569f30 Root Cause: iflib adds per-device sysctl nodes under the device tree using the device sysctl context. Some of those nodes are counter sysctl that point at fields inside txq→ift_br. When the if_bnxt driver is unloaded, iflib_device_deregister runs and calls iflib_tx_structures_free, which frees the txqs ift_br. The device sysctl tree is only freed when the device is destroyed. If sysctl -a runs during unload, it can still traverse the device tree and call sysctl_handle_counter_u64 for those nodes. The handler does counter_u64_fetch(*(counter_u64_t *)arg1). By then arg1 can point into freed memory and leads to use after free type kernel panic. Fix: flib now uses its own sysctl context for all iflib-related nodes instead of using device’s context. And iflib sysctl context is now removed before any queue/ring memory is freed. MFC after: 2 weeks Reviewed by: gallatin, ssaxena, #iflib Differential Revision: https://reviews.freebsd.org/D55981 --- sys/net/iflib.c | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index f9d0b1af0f83..186c41d9f839 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -190,6 +190,7 @@ struct iflib_ctx { struct ifmedia ifc_media; struct ifmedia *ifc_mediap; + struct sysctl_ctx_list ifc_sysctl_ctx; struct sysctl_oid *ifc_sysctl_node; uint16_t ifc_sysctl_ntxqs; uint16_t ifc_sysctl_nrxqs; @@ -5293,6 +5294,8 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct fail_detach: ether_ifdetach(ctx->ifc_ifp); fail_queues: + sysctl_ctx_free(&ctx->ifc_sysctl_ctx); + ctx->ifc_sysctl_node = NULL; taskqueue_free(ctx->ifc_tq); iflib_tqg_detach(ctx); iflib_tx_structures_free(ctx); @@ -5332,6 +5335,9 @@ iflib_device_deregister(if_ctx_t ctx) if_t ifp = ctx->ifc_ifp; device_t dev = ctx->ifc_dev; + sysctl_ctx_free(&ctx->ifc_sysctl_ctx); + ctx->ifc_sysctl_node = NULL; + /* Make sure VLANS are not using driver */ if (if_vlantrunkinuse(ifp)) { device_printf(dev, "Vlan in use, detach first\n"); @@ -6787,62 +6793,61 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx) { device_t dev = iflib_get_dev(ctx); struct sysctl_oid_list *child, *oid_list; - struct sysctl_ctx_list *ctx_list; struct sysctl_oid *node; - ctx_list = device_get_sysctl_ctx(dev); + sysctl_ctx_init(&ctx->ifc_sysctl_ctx); child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); - ctx->ifc_sysctl_node = node = SYSCTL_ADD_NODE(ctx_list, child, + ctx->ifc_sysctl_node = node = SYSCTL_ADD_NODE(&ctx->ifc_sysctl_ctx, child, OID_AUTO, "iflib", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "IFLIB fields"); oid_list = SYSCTL_CHILDREN(node); - SYSCTL_ADD_CONST_STRING(ctx_list, oid_list, OID_AUTO, "driver_version", + SYSCTL_ADD_CONST_STRING(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "driver_version", CTLFLAG_RD, ctx->ifc_sctx->isc_driver_version, "driver version"); - SYSCTL_ADD_BOOL(ctx_list, oid_list, OID_AUTO, "simple_tx", + SYSCTL_ADD_BOOL(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "simple_tx", CTLFLAG_RDTUN, &ctx->ifc_sysctl_simple_tx, 0, "use simple tx ring"); - SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "override_ntxqs", + SYSCTL_ADD_U16(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "override_ntxqs", CTLFLAG_RWTUN, &ctx->ifc_sysctl_ntxqs, 0, "# of txqs to use, 0 => use default #"); - SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "override_nrxqs", + SYSCTL_ADD_U16(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "override_nrxqs", CTLFLAG_RWTUN, &ctx->ifc_sysctl_nrxqs, 0, "# of rxqs to use, 0 => use default #"); - SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "override_qs_enable", + SYSCTL_ADD_U16(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "override_qs_enable", CTLFLAG_RWTUN, &ctx->ifc_sysctl_qs_eq_override, 0, "permit #txq != #rxq"); - SYSCTL_ADD_INT(ctx_list, oid_list, OID_AUTO, "disable_msix", + SYSCTL_ADD_INT(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "disable_msix", CTLFLAG_RWTUN, &ctx->ifc_softc_ctx.isc_disable_msix, 0, "disable MSI-X (default 0)"); - SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "rx_budget", + SYSCTL_ADD_U16(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "rx_budget", CTLFLAG_RWTUN, &ctx->ifc_sysctl_rx_budget, 0, "set the RX budget"); - SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "tx_abdicate", + SYSCTL_ADD_U16(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "tx_abdicate", CTLFLAG_RWTUN, &ctx->ifc_sysctl_tx_abdicate, 0, "cause TX to abdicate instead of running to completion"); ctx->ifc_sysctl_core_offset = CORE_OFFSET_UNSPECIFIED; - SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "core_offset", + SYSCTL_ADD_U16(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "core_offset", CTLFLAG_RDTUN, &ctx->ifc_sysctl_core_offset, 0, "offset to start using cores at"); - SYSCTL_ADD_U8(ctx_list, oid_list, OID_AUTO, "separate_txrx", + SYSCTL_ADD_U8(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "separate_txrx", CTLFLAG_RDTUN, &ctx->ifc_sysctl_separate_txrx, 0, "use separate cores for TX and RX"); - SYSCTL_ADD_U8(ctx_list, oid_list, OID_AUTO, "use_logical_cores", + SYSCTL_ADD_U8(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "use_logical_cores", CTLFLAG_RDTUN, &ctx->ifc_sysctl_use_logical_cores, 0, "try to make use of logical cores for TX and RX"); - SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "use_extra_msix_vectors", + SYSCTL_ADD_U16(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "use_extra_msix_vectors", CTLFLAG_RDTUN, &ctx->ifc_sysctl_extra_msix_vectors, 0, "attempt to reserve the given number of extra MSI-X vectors during driver load for the creation of additional interfaces later"); - SYSCTL_ADD_INT(ctx_list, oid_list, OID_AUTO, "allocated_msix_vectors", + SYSCTL_ADD_INT(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "allocated_msix_vectors", CTLFLAG_RDTUN, &ctx->ifc_softc_ctx.isc_vectors, 0, "total # of MSI-X vectors allocated by driver"); /* XXX change for per-queue sizes */ - SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_ntxds", + SYSCTL_ADD_PROC(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "override_ntxds", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, ctx, IFLIB_NTXD_HANDLER, mp_ndesc_handler, "A", "list of # of TX descriptors to use, 0 = use default #"); - SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_nrxds", + SYSCTL_ADD_PROC(&ctx->ifc_sysctl_ctx, oid_list, OID_AUTO, "override_nrxds", CTLTYPE_STRING | CTLFLAG_RWTUN | CTLFLAG_NEEDGIANT, ctx, IFLIB_NRXD_HANDLER, mp_ndesc_handler, "A", "list of # of RX descriptors to use, 0 = use default #"); @@ -6853,9 +6858,8 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) { if_shared_ctx_t sctx = ctx->ifc_sctx; if_softc_ctx_t scctx = &ctx->ifc_softc_ctx; - device_t dev = iflib_get_dev(ctx); struct sysctl_oid_list *child; - struct sysctl_ctx_list *ctx_list; + struct sysctl_ctx_list *ctx_list = &ctx->ifc_sysctl_ctx; iflib_fl_t fl; iflib_txq_t txq; iflib_rxq_t rxq; @@ -6864,7 +6868,6 @@ iflib_add_device_sysctl_post(if_ctx_t ctx) char *qfmt; struct sysctl_oid *queue_node, *fl_node, *node; struct sysctl_oid_list *queue_list, *fl_list; - ctx_list = device_get_sysctl_ctx(dev); node = ctx->ifc_sysctl_node; child = SYSCTL_CHILDREN(node); From nobody Tue Apr 14 09:14:19 2026 X-Original-To: dev-commits-src-main@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 4fvz9l47cPz6ZT7g for ; Tue, 14 Apr 2026 09:14:19 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fvz9l3CPzz3Fk0 for ; Tue, 14 Apr 2026 09:14:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776158059; 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=OfUGp0IhMKCMrpHYImcvA5l8n+7EvgW93kDWOS183RA=; b=eMIQH9JgEKQD3WxQeEh7rSlKSJBMwe2E9li8GudXKIaJa3uRsz/e+cqL1ZEfQjmpMA6YyX gHUIJbXQtwoH1AbeO3ZupBHMAeShpDMNyRDFI8L91vOaJSUdM3aEJlbh9evIymhfsy8pIV 5iVh2WzFpQ0PMunZZU2N8sEqFeDyg0lfekwFSCX3Q4LFYSxRMAP2nFOyLPR2fbx8a624OK IHv85gU5Sz2Pnoy9HqHB/FLbQMq7+7C3DF47uNVapEiHBWNoa27jXXTF60/NBXP+EjP2QS c77wZZuzKbGconlPCsaK5tLWlwu84rOc2VGNy46K0wlyTydfGu9/CAXmAwgntA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776158059; a=rsa-sha256; cv=none; b=RdxtLLOvU7klIByxsb6EMHEhYT3jRIcuERgC2nBT7Y31h/X4MLTb2ovMBGWYMov7lazcHh HRNrYADEOn0HY2zaAMhKYEHc2grs7d1V32lZkWUPtv7nLbLe6KxMo1j3pcdgOlwrWAoov9 svhbpiy8PCJnm4haqXf0IYJuDIFHrc8xdMwKyRkZpZiA3qcdr4sHsj5NdgjNeyxpFAU+bg 1o89jmTlPq7FSn51QJWle18OJjoZsrMxhMHnwjjvXaRz4rBsgppPPHdbldtHXcJMbtioYn KmcpPdtukI+MYr+M+NAQ2VHRj/NSIE7oBVq2GVxjyd67aoUfnfF2JI2PDmbAUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776158059; 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=OfUGp0IhMKCMrpHYImcvA5l8n+7EvgW93kDWOS183RA=; b=EcDsVENQIFjxCn5BQeOWJJ3P4+UsCZwzBd//OzLqb+GY2YGq2Lu0gxljCx4g8CFvb/06hS W5DmbJL6CyPe4U98dG9/ixpaSGUws5mkeLSvtcQgPRks/Kol2hk3KtjkHpj5Znk40RBRUU WVGtgjCiVKM8AmDlsS0wo+6VDeH+WRW8G/C9M29M8a2+Kj3oFnsyZ+Vpg7cz2vJ7qK/IPQ 3PF6EpxSjjkH0OorjtUSNy7Lvk9NCBln2PZrVU45Fe3vLuFDJBIXhES8l+LZfTN0RqDcTb QSfZyvYw/yZJA6sem/oJmHtYvUOjWrazxrVoovhMLCvQzPNFWEB0rudS0AotTw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fvz9l2mDTzkmw for ; Tue, 14 Apr 2026 09:14:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1eb43 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 09:14:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Sumit Saxena Subject: git: 439132310ae1 - main - iflib: drain admin task and fix teardown order on register failure List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ssaxena X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 439132310ae1f623f6c0a3dc241d0a34e98e040b Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 09:14:19 +0000 Message-Id: <69de056b.1eb43.38d63c8a@gitrepo.freebsd.org> The branch main has been updated by ssaxena: URL: https://cgit.FreeBSD.org/src/commit/?id=439132310ae1f623f6c0a3dc241d0a34e98e040b commit 439132310ae1f623f6c0a3dc241d0a34e98e040b Author: Sumit Saxena AuthorDate: 2026-04-13 06:33:46 +0000 Commit: Sumit Saxena CommitDate: 2026-04-14 09:13:53 +0000 iflib: drain admin task and fix teardown order on register failure When IFDI_ATTACH_POST() fails (or netmap attach fails), iflib tears down with ether_ifdetach(), taskqueue_free(ifc_tq), and IFDI_DETACH(). CTX_LOCK is still held after ether_ifattach. ether_ifdetach() and taskqueue_drain(admin) must not run under CTX_LOCK. Teardown ordering (match iflib_device_deregister): - Free the per-interface admin taskqueue after IFDI_DETACH / IFDI_QUEUES_FREE, not before. - Drop IFNET_WLOCK() across IFDI_DETACH / IFDI_QUEUES_FREE so driver detach can sleep in LinuxKPI workqueue drain, then retake IFNET_WLOCK() before iflib_free_intr_mem and fail_unlock. MFC after: 2 weeks Reviewed by: gallatin, kgalazka, #iflib Differential Revision: https://reviews.freebsd.org/D56316 --- sys/net/iflib.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 186c41d9f839..b58544255efd 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -5292,16 +5292,33 @@ iflib_device_register(device_t dev, void *sc, if_shared_ctx_t sctx, if_ctx_t *ct return (0); fail_detach: + CTX_UNLOCK(ctx); + taskqueue_drain(ctx->ifc_tq, &ctx->ifc_admin_task); ether_ifdetach(ctx->ifc_ifp); + CTX_LOCK(ctx); fail_queues: sysctl_ctx_free(&ctx->ifc_sysctl_ctx); ctx->ifc_sysctl_node = NULL; - taskqueue_free(ctx->ifc_tq); + /* + * Drain without holding CTX_LOCK so _task_fn_admin can run to + * completion if it needs the context lock. On fail_detach we already + * drained above; a second drain is a no-op when the queue is empty. + */ + CTX_UNLOCK(ctx); + taskqueue_drain(ctx->ifc_tq, &ctx->ifc_admin_task); + CTX_LOCK(ctx); iflib_tqg_detach(ctx); iflib_tx_structures_free(ctx); iflib_rx_structures_free(ctx); + /* + * Match iflib_device_deregister: IFDI_DETACH before taskqueue_free. + * Avoid IFNET_WLOCK across driver detach (LinuxKPI workqueue drain). + */ + IFNET_WUNLOCK(); IFDI_DETACH(ctx); IFDI_QUEUES_FREE(ctx); + IFNET_WLOCK(); + taskqueue_free(ctx->ifc_tq); fail_intr_free: iflib_free_intr_mem(ctx); fail_unlock: From nobody Tue Apr 14 10:31:41 2026 X-Original-To: dev-commits-src-main@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 4fw0v26MKrz6ZZJn; Tue, 14 Apr 2026 10:31:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw0v25gqvz3S9N; Tue, 14 Apr 2026 10:31:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776162702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=66wBet8nT5SN+6PqDxSTMlepCraMxwiXSJxDs4tk7zs=; b=TiwZI617TlErF8y/tTG6Sg2PxLZRKEC+rQY7imeuErr5aZSli91DuSbZfSECxL7OtHvcjT lfVx1b+PJi8geZl+3owkNRXObwZolvWAbkxG7raw/Hlg08fpe73TGIsa5u/VX33JSBVkF4 55KzEqdVjyqQlgff6e7P+qrKhFuUI0AldNRUwmq/4HAiD1Fo2JQRFCPUvM5DSZsRs5PHGn UvGg/pJa4+VzZSB8GiPFfOvUCB6yHGgB43R8T1QdeilVIhzcVzySw4YMgQC8H5lIeYNBG4 qM5KLkm8NdfLeIxLPDqra0OF9Xk1kp/m0oLd5b84rCz4bVwyWLxF6NuJeFOAwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776162702; a=rsa-sha256; cv=none; b=MMX25M8wMl8vuJzVBq/j7Qkvl1uxFbJAY1KrUanYRUFiLVw18N/2NnC0QwivsLsqCLpVXW 77t2bP58eTICrKv6uCbdCaYAOPwOLkQzgkOuUHbnbMqEHE2qKy9ElKYzIu/GaRBHMoY4WX qV5peQ+LC2a35Dq52ZyNHVckBzfKuxWbBPHrLnnigBoOpUBEjhqpyRsj/wTNX7KN+gdZ9O ayQUc5vafs8h1yRPVC+Ft6soUZW3ctDKWpMe5oFgdIp/TKQNPDP8bkA+Jp6hc2W4ocGSOy zGFcXDyvEjQkhLf9+Eob/MSbLyM99hX7ebci104xQg1IlgJNbXWDxCKNG/n65g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776162702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=66wBet8nT5SN+6PqDxSTMlepCraMxwiXSJxDs4tk7zs=; b=ba1J+wU8v3WnlzpTrxktIMSJymYp8o5G+ZwEcb80zBEAd4SUxstpXgKT1qAZ42mx3HJGy+ MTZArersks9X0Cv3bPND2vvZJuM6SfAle+z5rZkkGQXNUT0wbQkhxO+pgLfoL3QO6/6tZw ZU5OUFcwAAOr9OyXz8AeS8WvZpI5TydZ2S1UasFge/t/Qg4Ee1O4bc4v8nWG5f883Y9Nl+ IbNuJptnXbfGqU5/Ha5MBsmtFKh0L+RLLnS0hyHzUfC4D9sa2Ax57J2nH3J/sgIdaPsKZC q+2ROiOFoY6tze800jpNXdvOKtgdxwKz4fJtucQISAKUdjcLYtCq3DIjRfgFbg== Received: from [IPV6:2601:5c0:4202:5670:a430:510:6dbb:a5ca] (unknown [IPv6:2601:5c0:4202:5670:a430:510:6dbb:a5ca]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fw0v23kKrz199Q; Tue, 14 Apr 2026 10:31:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <680f1cb7-f8f6-4d40-af31-83e2ea0205d6@FreeBSD.org> Date: Tue, 14 Apr 2026 06:31:41 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 66b5296f1b29 - main - ctld: Add support for NVMe over Fabrics Content-Language: en-US To: Alan Somers Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202508062010.576KA2Mk062184@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 4/13/26 13:36, Alan Somers wrote: > On Mon, Apr 13, 2026 at 10:56 AM John Baldwin wrote: >> >> On 4/13/26 11:51, Alan Somers wrote: >>> On Wed, Aug 6, 2025 at 2:10 PM John Baldwin wrote: >>>> >>>> The branch main has been updated by jhb: >>>> >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=66b5296f1b29083634e2875ff08c32e7b6b866a8 >>>> >>>> commit 66b5296f1b29083634e2875ff08c32e7b6b866a8 >>>> Author: John Baldwin >>>> AuthorDate: 2025-08-06 19:57:50 +0000 >>>> Commit: John Baldwin >>>> CommitDate: 2025-08-06 19:59:13 +0000 >>>> >>>> ctld: Add support for NVMe over Fabrics >>>> >>>> While the overall structure is similar for NVMeoF controllers and >>>> iSCSI targets, there are sufficient differences that NVMe support uses >>>> an alternate configuration syntax. >>>> >>>> - In authentication groups, permitted NVMeoF hosts can be allowed by >>>> names (NQNs) via "host-nqn" values (similar to "initiator-name" for >>>> iSCSI). Similarly, "host-address" accepts permitted host addresses >>>> similar to "initiator-portal" for iSCSI. >>>> >>>> - A new "transport-group" context enumerates transports that can be >>>> used by a group of NVMeoF controllers similar to the "portal-group" >>>> context for iSCSI. In this section, the "listen" keyword accepts a >>>> transport as well as an address to permit other types of transports >>>> besides TCP in the future. The "foreign", "offload", and "redirect" >>>> keywords are also not meaningful and thus not supported. >>>> >>>> - A new "controller" context describes an NVMeoF I/O controller >>>> similar to the "target" context for iSCSI. One key difference here >>>> is that "lun" objects are replaced by "namespace" objects. However, >>>> a "namespace" can reference a named global lun permitting LUNs to be >>>> shared between iSCSI targets and NVMeoF controllers. >>>> >>>> NB: Authentication via CHAP is not implemented for NVMeoF. >>>> >>>> Reviewed by: imp >>>> Sponsored by: Chelsio Communications >>>> Differential Revision: https://reviews.freebsd.org/D48773 >>> ... >>>> +struct target * >>>> +conf::add_controller(const char *name) >>>> +{ >>>> + if (!nvmf_nqn_valid_strict(name)) { >>>> + log_warnx("controller name \"%s\" is invalid for NVMe", name); >>>> + return nullptr; >>>> + } >>>> + >>>> + /* >>>> + * Normalize the name to lowercase to match iSCSI. >>>> + */ >>>> + std::string t_name(name); >>>> + for (char &c : t_name) >>>> + c = tolower(c); >>> ... >>> >>> This makes it impossible to define an uppercase or mixed case target >>> name in ctld. I guess the intent was to comply with rfc3722[^1]? >>> Even so, it's surprising, because such target names used to work. >>> It's also inconsistent, because it's still possible to create an >>> uppercase target name using ctladm directly, like this: >>> >>> ctladm port -c -d iscsi -O cfiscsi_portal_group_tag=257 -O >>> cfiscsi_target=iqn.2018-10.myhost:TESTVOL1 >>> >>> Should we warn the user if they specify an uppercase target name, or >>> even fail to create it? >>> >>> [^1]: https://datatracker.ietf.org/doc/html/rfc3722 >> >> Note that this function is for NVMe, not iSCSI. iSCSI targets are created in >> conf::add_target which has similar code: >> >> struct target * >> conf::add_target(const char *name) >> { >> if (!valid_iscsi_name(name, log_warnx)) >> return (nullptr); >> >> /* >> * RFC 3722 requires us to normalize the name to lowercase. >> */ >> std::string t_name(name); >> for (char &c : t_name) >> c = tolower(c); >> >> Prior to the C++ commit, this change was already in place: >> >> struct target * >> target_new(struct conf *conf, const char *name) >> { >> struct target *targ; >> int i, len; >> >> targ = target_find(conf, name); >> if (targ != NULL) { >> log_warnx("duplicated target \"%s\"", name); >> return (NULL); >> } >> if (valid_iscsi_name(name, log_warnx) == false) { >> return (NULL); >> } >> targ = new target(); >> targ->t_name = checked_strdup(name); >> >> /* >> * RFC 3722 requires us to normalize the name to lowercase. >> */ >> len = strlen(name); >> for (i = 0; i < len; i++) >> targ->t_name[i] = tolower(targ->t_name[i]); >> >> targ->t_conf = conf; >> TAILQ_INSERT_TAIL(&conf->conf_targets, targ, t_next); >> >> return (targ); >> } >> >> This was present in commit 009ea47eb2d21856af4529aaaca32cd67748daea >> which brought in the iSCSI target, so it has always been present >> in ctld. >> >> Also, AFAICT, the names are still accepted, they are just normalized. >> >> I guess one difference is that before, target_new() called target_find() >> with the non-normalized name to check for duplicates, and now we check >> for duplicates after normalizing the name. I'm not sure how that worked >> in the past in practice as you would have had two targets with the same >> name (e.g. I wonder what the ctladm portlist output looked like for this >> case and if it would have listed two ports with the same name)? I suspect >> that was more by accident and probably didn't work properly in practice >> (e.g. the kernel handoff ioctl used the normalized name when invoking >> CTL_ISCSI, so connections to both "names" probably were always mapped to >> only one of the connections, and finding a port during login processing >> probably only found the first target, and only if the initiator gave the >> all-lowercase name). >> >> That is to say, you didn't get an error before, but it didn't work, and >> now it tells you that it doesn't work AFAICT. > > Excuse me, I spoke a little too soon. You are correct that ctld has > been converting target names to lower case before registering them in > the kernel for a long time. The change is that previously, if an > initiator attempted to connect to an uppercase target name, ctld would > accept it. That's because port_find_in_pg used strcasecmp in > stable/14. But change 4b1aac931465f39c5c26bfa1d5539a428d340f20 > removed strcasecmp, replacing it by the C++ STL's find method on > std::unordered_map. > > So we used to accept connections case-insensitively, and now we accept > them case-sensitively. To restore the previous behavior, should we > add tolower() on the target_name in iscsi_connection::login() ? Yes, we should normalize there, and that indeed is my fault and warrants a Fixes tag. -- John Baldwin From nobody Tue Apr 14 10:33:53 2026 X-Original-To: dev-commits-src-main@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 4fw0xf4hKKz6ZZcJ for ; Tue, 14 Apr 2026 10:33:58 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw0xf3rL6z3VWZ for ; Tue, 14 Apr 2026 10:33:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776162838; 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=13BECXfu3YVG+KZyNN2TFwW7eSaDebtN0tvXKN5IkyM=; b=QcoX7BbPVk5lv/usbwcPAUwOEUqB+sK20KxVpeThdQjcRZT/qAizSb7guSMQADfC39jjUi MlJhcnoqAJnWEyFWA3ySBnb7NOzyCa4pvDLswLY27VBrt3xOMlxjYb9uhznj5L3c3vWHLU 0eaQtsOwiJmYVcQx3yas6sLsDXn3cgTO60nnIftrIsJ6uOZjwPeVAlM6QZjf+VpWSFNMwC DgfbbJTJlgWe0Nd3qtLmBtKDq7StsaiaaVyoTKKnJ2eG8ids6Nfh/5PbJSIFgbEvGBN16o i7nlcjsCKS5EhjCtsIGmHP2/gW6Q7Zzh4DJA18hsRInnyrU9VPdUdTB1IlEE4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776162838; a=rsa-sha256; cv=none; b=cz7yHXxYuYrM03vkUtE6tIIKjb7rVW4f8BHiL0+GT3ff1LSbAekuxkEBZZbevrgbj4xc3i wjgYSXUMIwyruY4pmwOukCtDP4oPEEuXoE+H7Yr7HRyaholPV1e8qO8ySzU5qB74A3Bc+o FZi/8SCGHibiIBurpPXodVDqcsrsUBVMzYp9R6z8k4BkWztA8pyxgCrAeBzFPKFLC+P61O h0/URGqv1WorywStWY6IKWzBFoTuPqvp2hiJkti5ZdolKauZgkti6MfAEeL47Ji6ye5Tke 4UNhdx98NGi/0a3bdxE3K4CDDC5eZnv0FGHx/GMSw+oa6QAHFuEXpwjFb3tFeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776162838; 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=13BECXfu3YVG+KZyNN2TFwW7eSaDebtN0tvXKN5IkyM=; b=e0sw1bEDUvlakt1Vvm0y2dQ4++VzT5miVtoi7lBLHpupKFK1O0m5RbTNWkyucWKg/djL9L ubTtuza/f0jrC+KEWkFoaXkj7SjMe6SV4McailF6sy+VN/yJ7hRcVUgwHQk72uo4No9I7S 9eKNmhT/TO8zDiMBHsM5UHF5PH0xRcvEbxfGvXq8nXTWsBtocsfjUB7mZizpTbwaNpWGtO 8u1M4IikDJbKI3e2O+ONHRCq4e28ENPQiXrW9fF6bKYYnZH7c/YSI72LPvFRLmr8WgxY7z xftssZvPGg+759uK+1hVs8joUMnSk0yNBReBkjl37fdHYk14QrQOj2gYCLgqxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fw0xf3L2yzn0C for ; Tue, 14 Apr 2026 10:33:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 277db by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 10:33:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: 7d38eb720a8d - main - routing: Fix use-after-free in finalize_nhop List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7d38eb720a8d8345949986d779e785984ae19ae0 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 10:33:53 +0000 Message-Id: <69de1811.277db.36218e50@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=7d38eb720a8d8345949986d779e785984ae19ae0 commit 7d38eb720a8d8345949986d779e785984ae19ae0 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-14 09:36:53 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-14 10:32:56 +0000 routing: Fix use-after-free in finalize_nhop FIB_NH_LOG calls the `nhop_get_upper_family(nh)` to read `nh->nh_priv->nh_upper_family` for failure logging. Call FIB_NH_LOG before freeing nh so failures are logged without causing a panic. MFC after: 3 days --- sys/net/route/nhop_ctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/route/nhop_ctl.c b/sys/net/route/nhop_ctl.c index 6c03e621ed82..52e7b0fefcd2 100644 --- a/sys/net/route/nhop_ctl.c +++ b/sys/net/route/nhop_ctl.c @@ -491,17 +491,17 @@ finalize_nhop(struct nh_control *ctl, struct nhop_object *nh, bool link) /* Allocate per-cpu packet counter */ nh->nh_pksent = counter_u64_alloc(M_NOWAIT); if (nh->nh_pksent == NULL) { + FIB_NH_LOG(LOG_WARNING, nh, "counter_u64_alloc() failed"); nhop_free(nh); RTSTAT_INC(rts_nh_alloc_failure); - FIB_NH_LOG(LOG_WARNING, nh, "counter_u64_alloc() failed"); return (ENOMEM); } if (!reference_nhop_deps(nh)) { + FIB_NH_LOG(LOG_WARNING, nh, "interface reference failed"); counter_u64_free(nh->nh_pksent); nhop_free(nh); RTSTAT_INC(rts_nh_alloc_failure); - FIB_NH_LOG(LOG_WARNING, nh, "interface reference failed"); return (EAGAIN); } From nobody Tue Apr 14 10:59:18 2026 X-Original-To: dev-commits-src-main@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 4fw1Vt4CS4z6ZbZQ for ; Tue, 14 Apr 2026 10:59:18 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw1Vt1Zc8z3Xqn for ; Tue, 14 Apr 2026 10:59:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776164358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K6hatQ3XTpWRxLyk6iMutk0D9dtVVeON6u+iIyJGsag=; b=lxVxM1a/42Y6NYpOVYoLIW4MxYuRxs24a6RNS0KP+l/UHYByBnuGV6RgyfsnkyhvT2Dr4R cZ7G3N6weba9E/+7h8sAmNl0l9FqLOE3Pac+V5NfpZ8DGivCmUkTVnEa0fCVC4gj0F7JQz FMXRyvi809SG/4mZY/Tlju88Io5Swk76LkyOlJ6KAlvAnyM4lMNAB5IJZAP9T0J1HM19oh hKiGDKc4m73smRw4ZPgDltErFedJWH70NecucrFNtD/wlAGrNcdYUrDDBJ+lcgZ06GWlaO cSYHJ/1j5yhyN1PTQZSkZcCLNP5TRvWF28oBC0nCqZg2o9jl/T+h9J+8WfkK0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776164358; a=rsa-sha256; cv=none; b=H0kfc73epzlIXsW/NdXTHHes2szSTyPfGJ5V5YjWdTfop0SsugpTXcrxJwQDdH98N8BDTO efoSAr11Pv3Nk4FUrnVXYLzoP7C9+NzRRkM0rdt6uKRZpzA6/oXj45BAoi9dGpP9NBMO3U FigNLxllWj+vM1ajgehPiomD71JZFXOkg5oIIiPONNyFPuwPT25kuDmf0PB4Y9dTxzYpvu g1IqO9BoN1w5Cur0WeR2WmVQoLlhy17z0b5HLlUEcYS+1ByFk6B6NY69uf0s0NgRH9/uZw ExY4NFAV122adxjktgfUZ8NKXv818bITdxcmqmPA0U0ydcMf1+nw2M6NmDxRNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776164358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K6hatQ3XTpWRxLyk6iMutk0D9dtVVeON6u+iIyJGsag=; b=cnxSLpr3Qnk1n1ZuV3xVnF63e0EbITeTrRaIHEn194zfTJja0t2OAEKbwlLHbIy+sx55Z3 qqs1IZpyqhveFXe7nX6tX9z7GGUVZ1cw2HRTQRx60SNGIiBZ7UxGBU5s46sTj8amGvnjOy 3Zd3KzKCSIxEpjf+NnE4e1roMlL7N4W6DHbNYnUU0baVhesaz8JSPH4fcasdqYys/oGCzq IOtCZ1D/UhsYG9SVnVzCqBQG1LaS4pA+I4/XuArQ6/icIEMXXcD/EJYUcikWhK1F5TjeBK S9mYZYmC7TGsmrpHI+e1KScvgbpCpSizNHayQoFMO+xfx4htNGoKcWOLkfFRMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fw1Vt12c0zng6 for ; Tue, 14 Apr 2026 10:59:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32f30 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 10:59:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Goran=?utf-8?Q? Meki=C4=87?= From: Christos Margiolis Subject: git: 3524d4ebbe1f - main - sound examples: Add mmap example List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3524d4ebbe1f562dd76dc553c085386aadfd2682 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 10:59:18 +0000 Message-Id: <69de1e06.32f30.7f998dfa@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=3524d4ebbe1f562dd76dc553c085386aadfd2682 commit 3524d4ebbe1f562dd76dc553c085386aadfd2682 Author: Goran Mekić AuthorDate: 2026-04-14 10:57:53 +0000 Commit: Christos Margiolis CommitDate: 2026-04-14 10:59:14 +0000 sound examples: Add mmap example This example opens separate OSS capture and playback channels in mmap mode, places them into a sync group, and starts them together so both ring buffers advance on the same device timeline. It then monitors the capture mmap pointer with SNDCTL_DSP_GETIPTR, converts that pointer into monotonic absolute progress using the reported block count, and copies newly recorded audio from the input ring to the matching region of the output ring. The main loop is driven by an absolute monotonic frame clock rather than a fixed relative usleep delay. Wakeups are scheduled from the sample rate using a small frame step similar to the SOSSO timing model, while the audio path itself stays intentionally simple: just copy input to output, with no explicit xrun recovery or processing beyond ring wraparound handling. MFC after: 1 week Reviewed by: christos Differential Revision: https://reviews.freebsd.org/D53749 --- share/examples/Makefile | 1 + share/examples/sound/mmap.c | 297 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 298 insertions(+) diff --git a/share/examples/Makefile b/share/examples/Makefile index 0174792d2ecb..d977f2e5a0da 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -323,6 +323,7 @@ SE_DIRS+= sound SE_SOUND= \ kqueue.c \ midi.c \ + mmap.c \ oss.h \ poll.c \ select.c \ diff --git a/share/examples/sound/mmap.c b/share/examples/sound/mmap.c new file mode 100644 index 000000000000..7f165d417020 --- /dev/null +++ b/share/examples/sound/mmap.c @@ -0,0 +1,297 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2026 Goran Mekić + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * This program demonstrates low-latency audio pass-through using mmap. + * Opens input and output audio devices using memory-mapped I/O, + * synchronizes them in a sync group for simultaneous start, + * then continuously copies audio data from input to output. + */ + +#include + +#include "oss.h" + +/* + * Get current time in nanoseconds using monotonic clock. + * Monotonic clock is not affected by system time changes. + */ +static int64_t +gettime_ns(void) +{ + struct timespec ts; + + if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) + err(1, "clock_gettime failed"); + return ((int64_t)ts.tv_sec * 1000000000LL + ts.tv_nsec); +} + +/* + * Sleep until the specified absolute time (in nanoseconds). + * Uses TIMER_ABSTIME for precise timing synchronization. + */ +static void +sleep_until_ns(int64_t target_ns) +{ + struct timespec ts; + + ts.tv_sec = target_ns / 1000000000LL; + ts.tv_nsec = target_ns % 1000000000LL; + if (clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME, &ts, NULL) != 0) + err(1, "clock_nanosleep failed"); +} + +/* + * Calculate the number of frames to process per iteration. + * Higher sample rates require larger steps to maintain efficiency. + */ +static unsigned +frame_stepping(unsigned sample_rate) +{ + return (16U * (1U + (sample_rate / 50000U))); +} + +/* + * Update the mmap pointer and calculate progress. + * Returns the absolute progress in bytes. + * + * fd: file descriptor for the audio device + * request: ioctl request (SNDCTL_DSP_GETIPTR or SNDCTL_DSP_GETOPTR) + * map_pointer: current pointer position in the ring buffer + * map_progress: absolute progress in bytes + * buffer_bytes: total size of the ring buffer + * frag_size: size of each fragment + * frame_size: size of one audio frame in bytes + */ +static int64_t +update_map_progress(int fd, unsigned long request, int *map_pointer, + int64_t *map_progress, int buffer_bytes, int frag_size, int frame_size) +{ + count_info info = {}; + unsigned delta, max_bytes, cycles; + int fragments; + + if (ioctl(fd, request, &info) < 0) + err(1, "Failed to get mmap pointer"); + if (info.ptr < 0 || info.ptr >= buffer_bytes) + errx(1, "Pointer out of bounds: %d", info.ptr); + if ((info.ptr % frame_size) != 0) + errx(1, "Pointer %d not aligned to frame size %d", info.ptr, + frame_size); + if (info.blocks < 0) + errx(1, "Invalid block count %d", info.blocks); + + /* + * Calculate delta: how many bytes have been processed since last check. + * Handle ring buffer wraparound using modulo arithmetic. + */ + delta = (info.ptr + buffer_bytes - *map_pointer) % buffer_bytes; + + /* + * Adjust delta based on reported blocks available. + * This accounts for cases where the pointer has wrapped multiple times. + */ + max_bytes = (info.blocks + 1) * frag_size - 1; + if (max_bytes >= delta) { + cycles = max_bytes - delta; + cycles -= cycles % buffer_bytes; + delta += cycles; + } + + /* Verify fragment count matches expected value */ + fragments = delta / frag_size; + if (info.blocks < fragments || info.blocks > fragments + 1) + warnx("Pointer block mismatch: ptr=%d blocks=%d delta=%u", + info.ptr, info.blocks, delta); + + /* Update pointer and progress tracking */ + *map_pointer = info.ptr; + *map_progress += delta; + return (*map_progress); +} + +/* + * Copy data between ring buffers, handling wraparound. + * The copy starts at 'offset' and copies 'length' bytes. + * If the copy crosses the buffer boundary, it wraps to the beginning. + */ +static void +copy_ring(void *dstv, const void *srcv, int buffer_bytes, int offset, + int length) +{ + uint8_t *dst = dstv; + const uint8_t *src = srcv; + int first; + + if (length <= 0) + return; + + /* Calculate bytes to copy before wraparound */ + first = buffer_bytes - offset; + if (first > length) + first = length; + + /* Copy first part (up to buffer end or length) */ + memcpy(dst + offset, src + offset, first); + + /* Copy remaining part from beginning of buffer if needed */ + if (first < length) + memcpy(dst, src, length - first); +} + +int +main(int argc, char *argv[]) +{ + int ch, bytes; + int frag_size, frame_size, verbose = 0; + int map_pointer = 0; + unsigned step_frames; + int64_t frame_ns, start_ns, next_wakeup_ns; + int64_t read_progress = 0, write_progress = 0; + oss_syncgroup sync_group = { 0, 0, { 0 } }; + struct config config_in = { + .device = "/dev/dsp", + .mode = O_RDONLY | O_EXCL | O_NONBLOCK, + .format = AFMT_S32_NE, + .sample_rate = 48000, + .mmap = 1, + }; + struct config config_out = { + .device = "/dev/dsp", + .mode = O_WRONLY | O_EXCL | O_NONBLOCK, + .format = AFMT_S32_NE, + .sample_rate = 48000, + .mmap = 1, + }; + + while ((ch = getopt(argc, argv, "v")) != -1) { + switch (ch) { + case 'v': + verbose = 1; + break; + } + } + argc -= optind; + argv += optind; + + if (!verbose) + printf("Use -v for verbose mode\n"); + + oss_init(&config_in); + oss_init(&config_out); + + /* + * Verify input and output have matching ring-buffer geometry. + * The passthrough loop copies raw bytes at the same offset in both mmap + * buffers, so both devices must expose the same total byte count. + * They must also use the same max_channels because frame_size is + * derived from that value and all mmap pointers/lengths are expected to + * stay aligned to whole frames on both sides. If channels differed, the + * same byte offset could land in the middle of a frame on one device. + */ + if (config_in.buffer_info.bytes != config_out.buffer_info.bytes) + errx(1, + "Input and output configurations have different buffer sizes"); + if (config_in.audio_info.max_channels != + config_out.audio_info.max_channels) + errx(1, + "Input and output configurations have different number of channels"); + + bytes = config_in.buffer_info.bytes; + frag_size = config_in.buffer_info.fragsize; + frame_size = config_in.sample_size * config_in.audio_info.max_channels; + if (frag_size != config_out.buffer_info.fragsize) + errx(1, + "Input and output configurations have different fragment sizes"); + + /* Calculate timing parameters */ + step_frames = frame_stepping(config_in.sample_rate); + frame_ns = 1000000000LL / config_in.sample_rate; + + /* Clear output buffer to prevent noise on startup */ + memset(config_out.buf, 0, bytes); + + /* Configure and start sync group */ + sync_group.mode = PCM_ENABLE_INPUT; + if (ioctl(config_in.fd, SNDCTL_DSP_SYNCGROUP, &sync_group) < 0) + err(1, "Failed to add input to syncgroup"); + sync_group.mode = PCM_ENABLE_OUTPUT; + if (ioctl(config_out.fd, SNDCTL_DSP_SYNCGROUP, &sync_group) < 0) + err(1, "Failed to add output to syncgroup"); + if (ioctl(config_in.fd, SNDCTL_DSP_SYNCSTART, &sync_group.id) < 0) + err(1, "Starting sync group failed"); + + /* Initialize timing and progress tracking */ + start_ns = gettime_ns(); + read_progress = update_map_progress(config_in.fd, SNDCTL_DSP_GETIPTR, + &map_pointer, &read_progress, bytes, frag_size, frame_size); + write_progress = read_progress; + next_wakeup_ns = start_ns; + + /* + * Main processing loop: + * 1. Sleep until next scheduled wakeup + * 2. Check how much new audio data is available + * 3. Copy available data from input to output buffer + * 4. Schedule next wakeup + */ + for (;;) { + sleep_until_ns(next_wakeup_ns); + read_progress = update_map_progress(config_in.fd, + SNDCTL_DSP_GETIPTR, &map_pointer, &read_progress, bytes, + frag_size, frame_size); + + /* Copy new audio data if available */ + if (read_progress > write_progress) { + int offset = write_progress % bytes; + int length = read_progress - write_progress; + + copy_ring(config_out.buf, config_in.buf, bytes, offset, + length); + write_progress = read_progress; + if (verbose) + printf("copied %d bytes at %d (abs %lld)\n", + length, offset, (long long)write_progress); + } + + /* Schedule next wakeup based on frame timing */ + next_wakeup_ns += (int64_t)step_frames * frame_ns; + if (next_wakeup_ns < gettime_ns()) + next_wakeup_ns = gettime_ns(); + } + + if (munmap(config_in.buf, bytes) != 0) + err(1, "Memory unmap failed"); + config_in.buf = NULL; + if (munmap(config_out.buf, bytes) != 0) + err(1, "Memory unmap failed"); + config_out.buf = NULL; + close(config_in.fd); + close(config_out.fd); + + return (0); +} From nobody Tue Apr 14 12:35:52 2026 X-Original-To: dev-commits-src-main@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 4fw3fc69lwz6YVWJ for ; Tue, 14 Apr 2026 12:36:08 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw3fc3kx4z3npt for ; Tue, 14 Apr 2026 12:36:08 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-66e129e457dso5660114a12.1 for ; Tue, 14 Apr 2026 05:36:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776170167; cv=none; d=google.com; s=arc-20240605; b=GWRsW7SEAkFG9BFQ/00Y9nz9WaqhV7Vps2fp7h8RQjX61tIFLw5DgQUuwv/UrwvBIg zGg5GbnbmhrvYxCgYLoRE1SkpgVWs1+XXjJH5/ETz5KrLsiUQTuhHf8wJ46JE0hjMfx4 VUQcQiWV8/lRg2ECUippp9uecbLj5kgJXJ8xfYgA7mDvMG7rRb7BWhzlWmo5u/US+vVA NrNamDqFpZKvoCK8mNNDxXG0tZhyl2LI9bPXjCGKR8pwGQnrFuJ7p/X/F12XnXlESis9 D/+4T6tq9Z5Lecq7fFRWQ71SOuDuMH7x9awdTsl+MBbwdBiUMIgX5pjZJus0QafBo1F9 jMeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=S97K0PQrWD5HNxxAVVzqsWN4puhz/Doi4O1coJ94MyA=; fh=++LYNKKLdDrwxPxlTIjCK1fqdlwThLc6rXGoab5dPnQ=; b=ai/Eirnn7toAGiamQURrUEMed1q+Q/uyWttzQPxLkuf5BDnTtdNhWCWrVExeY0lLYK zMMJ57yg1PurZy9YYFb0ILhhtxIWQApOu/V/rGlv/o9DjcFbWmUWfzIe8KYdRQK2KBbz 8Mqv7HNEeZcxV2HbBKO4NFqmHoAVbP8efYO5C5enCvRcr3TkDm3rTu2H9PlPmfB+EIYX OiFuuFtDTLtGW/07Ea/KhnERI6XrHO9UFmcCZwqDpIV8srLNH1jqhv78i5DKfbm4m0hK pz4zrqMo3aUenN5P/9UFgXfM3Z6sjb+r1G9OZFGaRZSSy9G2bJ4TIAqL0tC+5GpEu0fe zCjA==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776170167; x=1776774967; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=S97K0PQrWD5HNxxAVVzqsWN4puhz/Doi4O1coJ94MyA=; b=flkDvD00LhLGQsvAx6hemSpvVAbxbS899ApPNnh5lI9nS1H7y1hKfnGezmsH7Yq8lo yD1mi8ZYEVbjSXjGwy71dyInTH5asq7DFmlrsSAk6Gn+mX+kpnd1C2FgGeV7YwANHn6g OuXZYhr1Ya3bVdj8mlw/92zY5dIIor+4GvFYDGLd+nlUeWDdGVZPhqt5orPoeCSY1YbU qhLARwuWajlzwV1oq9K1hJM727XXNzi9RC+Dt5uOX/gM0X4MpGOSnZzfLuvwHP9hitIi caj2Yasi5H+vEzutawFYGqAI3yunQX3dsLGSAp8KVYi7egMn8aq+O4mPzfUGb3679NpH gGIw== X-Forwarded-Encrypted: i=1; AFNElJ83+P1iLnrC/ce8y2XK/uqm5bVvHIlUWw/Fo7TM3vWz2o6b2UK5CcLGy1QhFOvM7X2lXCE12JcbxVwqD6z5ZJ4QxiTH9A==@freebsd.org X-Gm-Message-State: AOJu0YyLeXT3f6R82L+l7IHF9VHY6OXBtyJ21PT2KKX3uR8jT8PhYk7T mQyPB080ChJgb3ikxFS6NDG2Me0XFlXzKWBFvcbuqbtpidcCW0ol1gA6h1q5/JqN0fGzd798C2U O+YOpWMcYHqvgquHCXXCHhs5Zfy3ccTg= X-Gm-Gg: AeBDiesbd3+p6FZiGGYth92q+cW5yEOQB1jhip1EJVGwr6ckesSB9Ys+rZD2BoHmvHC TEsRxt/97AJkshKA2z5RuX0PLDnQpgv39PeORZecwlKI3x9OV9ug0WqlJaElSyocqHkiX94qec9 +o/b/NusmXuOqDKuMJ5j/o1d6KIWv7w+NWAKT56ReAhbYeL70TO4hAzCwr9n0tV7vYj9+RI3XM+ 0gvcoL1PHCVXcgyeqgUqQFQ03geSMJmGuovSVKpYL6N4tQDifDIEYRu46jEoc7Uw8R8hPlaKSGf pnIQlyDnT68gDTE9/T8gbYfIQkiBj1/Xhsw7szXHqp5nT1h1aDb+WMfDYmu4O5Mo+EQdTut+YCE 6kTU= X-Received: by 2002:a05:6402:21ce:b0:66e:bff3:8608 with SMTP id 4fb4d7f45d1cf-6707af15efemr6906663a12.25.1776170165739; Tue, 14 Apr 2026 05:36:05 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202508062010.576KA2Mk062184@gitrepo.freebsd.org> <680f1cb7-f8f6-4d40-af31-83e2ea0205d6@FreeBSD.org> In-Reply-To: <680f1cb7-f8f6-4d40-af31-83e2ea0205d6@FreeBSD.org> From: Alan Somers Date: Tue, 14 Apr 2026 06:35:52 -0600 X-Gm-Features: AQROBzAV1j70Yc8aUtsuj9z-RB6SHKiORzvbW8bfGT8fleHQvpNoUu89MiXC6SI Message-ID: Subject: Re: git: 66b5296f1b29 - main - ctld: Add support for NVMe over Fabrics To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4fw3fc3kx4z3npt X-Spamd-Bar: ---- On Tue, Apr 14, 2026 at 4:31=E2=80=AFAM John Baldwin wrot= e: > > On 4/13/26 13:36, Alan Somers wrote: > > On Mon, Apr 13, 2026 at 10:56=E2=80=AFAM John Baldwin = wrote: > >> > >> On 4/13/26 11:51, Alan Somers wrote: > >>> On Wed, Aug 6, 2025 at 2:10=E2=80=AFPM John Baldwin = wrote: > >>>> > >>>> The branch main has been updated by jhb: > >>>> > >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D66b5296f1b29083634e28= 75ff08c32e7b6b866a8 > >>>> > >>>> commit 66b5296f1b29083634e2875ff08c32e7b6b866a8 > >>>> Author: John Baldwin > >>>> AuthorDate: 2025-08-06 19:57:50 +0000 > >>>> Commit: John Baldwin > >>>> CommitDate: 2025-08-06 19:59:13 +0000 > >>>> > >>>> ctld: Add support for NVMe over Fabrics > >>>> > >>>> While the overall structure is similar for NVMeoF controllers = and > >>>> iSCSI targets, there are sufficient differences that NVMe supp= ort uses > >>>> an alternate configuration syntax. > >>>> > >>>> - In authentication groups, permitted NVMeoF hosts can be allo= wed by > >>>> names (NQNs) via "host-nqn" values (similar to "initiator-na= me" for > >>>> iSCSI). Similarly, "host-address" accepts permitted host ad= dresses > >>>> similar to "initiator-portal" for iSCSI. > >>>> > >>>> - A new "transport-group" context enumerates transports that c= an be > >>>> used by a group of NVMeoF controllers similar to the "portal= -group" > >>>> context for iSCSI. In this section, the "listen" keyword ac= cepts a > >>>> transport as well as an address to permit other types of tra= nsports > >>>> besides TCP in the future. The "foreign", "offload", and "r= edirect" > >>>> keywords are also not meaningful and thus not supported. > >>>> > >>>> - A new "controller" context describes an NVMeoF I/O controlle= r > >>>> similar to the "target" context for iSCSI. One key differen= ce here > >>>> is that "lun" objects are replaced by "namespace" objects. = However, > >>>> a "namespace" can reference a named global lun permitting LU= Ns to be > >>>> shared between iSCSI targets and NVMeoF controllers. > >>>> > >>>> NB: Authentication via CHAP is not implemented for NVMeoF. > >>>> > >>>> Reviewed by: imp > >>>> Sponsored by: Chelsio Communications > >>>> Differential Revision: https://reviews.freebsd.org/D48773 > >>> ... > >>>> +struct target * > >>>> +conf::add_controller(const char *name) > >>>> +{ > >>>> + if (!nvmf_nqn_valid_strict(name)) { > >>>> + log_warnx("controller name \"%s\" is invalid for NVM= e", name); > >>>> + return nullptr; > >>>> + } > >>>> + > >>>> + /* > >>>> + * Normalize the name to lowercase to match iSCSI. > >>>> + */ > >>>> + std::string t_name(name); > >>>> + for (char &c : t_name) > >>>> + c =3D tolower(c); > >>> ... > >>> > >>> This makes it impossible to define an uppercase or mixed case target > >>> name in ctld. I guess the intent was to comply with rfc3722[^1]? > >>> Even so, it's surprising, because such target names used to work. > >>> It's also inconsistent, because it's still possible to create an > >>> uppercase target name using ctladm directly, like this: > >>> > >>> ctladm port -c -d iscsi -O cfiscsi_portal_group_tag=3D257 -O > >>> cfiscsi_target=3Diqn.2018-10.myhost:TESTVOL1 > >>> > >>> Should we warn the user if they specify an uppercase target name, or > >>> even fail to create it? > >>> > >>> [^1]: https://datatracker.ietf.org/doc/html/rfc3722 > >> > >> Note that this function is for NVMe, not iSCSI. iSCSI targets are cre= ated in > >> conf::add_target which has similar code: > >> > >> struct target * > >> conf::add_target(const char *name) > >> { > >> if (!valid_iscsi_name(name, log_warnx)) > >> return (nullptr); > >> > >> /* > >> * RFC 3722 requires us to normalize the name to lowercase. > >> */ > >> std::string t_name(name); > >> for (char &c : t_name) > >> c =3D tolower(c); > >> > >> Prior to the C++ commit, this change was already in place: > >> > >> struct target * > >> target_new(struct conf *conf, const char *name) > >> { > >> struct target *targ; > >> int i, len; > >> > >> targ =3D target_find(conf, name); > >> if (targ !=3D NULL) { > >> log_warnx("duplicated target \"%s\"", name); > >> return (NULL); > >> } > >> if (valid_iscsi_name(name, log_warnx) =3D=3D false) { > >> return (NULL); > >> } > >> targ =3D new target(); > >> targ->t_name =3D checked_strdup(name); > >> > >> /* > >> * RFC 3722 requires us to normalize the name to lowercase. > >> */ > >> len =3D strlen(name); > >> for (i =3D 0; i < len; i++) > >> targ->t_name[i] =3D tolower(targ->t_name[i]); > >> > >> targ->t_conf =3D conf; > >> TAILQ_INSERT_TAIL(&conf->conf_targets, targ, t_next); > >> > >> return (targ); > >> } > >> > >> This was present in commit 009ea47eb2d21856af4529aaaca32cd67748daea > >> which brought in the iSCSI target, so it has always been present > >> in ctld. > >> > >> Also, AFAICT, the names are still accepted, they are just normalized. > >> > >> I guess one difference is that before, target_new() called target_find= () > >> with the non-normalized name to check for duplicates, and now we check > >> for duplicates after normalizing the name. I'm not sure how that work= ed > >> in the past in practice as you would have had two targets with the sam= e > >> name (e.g. I wonder what the ctladm portlist output looked like for th= is > >> case and if it would have listed two ports with the same name)? I sus= pect > >> that was more by accident and probably didn't work properly in practic= e > >> (e.g. the kernel handoff ioctl used the normalized name when invoking > >> CTL_ISCSI, so connections to both "names" probably were always mapped = to > >> only one of the connections, and finding a port during login processin= g > >> probably only found the first target, and only if the initiator gave t= he > >> all-lowercase name). > >> > >> That is to say, you didn't get an error before, but it didn't work, an= d > >> now it tells you that it doesn't work AFAICT. > > > > Excuse me, I spoke a little too soon. You are correct that ctld has > > been converting target names to lower case before registering them in > > the kernel for a long time. The change is that previously, if an > > initiator attempted to connect to an uppercase target name, ctld would > > accept it. That's because port_find_in_pg used strcasecmp in > > stable/14. But change 4b1aac931465f39c5c26bfa1d5539a428d340f20 > > removed strcasecmp, replacing it by the C++ STL's find method on > > std::unordered_map. > > > > So we used to accept connections case-insensitively, and now we accept > > them case-sensitively. To restore the previous behavior, should we > > add tolower() on the target_name in iscsi_connection::login() ? > > Yes, we should normalize there, and that indeed is my fault and warrants > a Fixes tag. > > -- > John Baldwin Ok. I'll take care of it. From nobody Tue Apr 14 12:51:57 2026 X-Original-To: dev-commits-src-main@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 4fw40s6VDkz6YWNn for ; Tue, 14 Apr 2026 12:51:57 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw40s4h2hz3rMd for ; Tue, 14 Apr 2026 12:51:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776171117; 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=DqOS/kf4e/ntFCvuwS7JTELkXmF/o/5eDgXvEEjy7SQ=; b=RZDLuhuxs82ZBOM+LXGx6jWtW7N4QDE8xl/rvPf/vUZSYYdzSTRoBHCZFrftVMn46J10js v0PwlYv9fjgfdLw7VkWIWFvvVh5Kp/jDrMZmKansvhBXJNwNZDD44UqmYw/M+DyGzBLNmc JwyhQjTqMFO9UMtKEeuUADINnS61zun2jY6BQz3eVgYZl2LbyenXhZBur1MmsDe83Peb3c UHlryAyJ3BpcZNz9vS9ZXAq/F1vfdmdKXESM3jCBA+Mezc/BkEkx67x2dTCnCEjYoU9UaZ WgoYTtKpeTsrJy+PZsgPMtpp3fxPL36U4NqUgi1hmABg6XF5R3t4NscbM5aI7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776171117; a=rsa-sha256; cv=none; b=SiHueFK4PrAGI4Z5y47oxHi2flMMDImhaB6oFXp0ASreVDCBbqSFa0lKi2YeH6Le2MMGX2 P7XIeXjyaApk2GaSVkhPuSTTan4P6I6vl3xWueYXusAFw+3hl5sQZn5JToC0PBBnrr0C5F OA9qY7ajoPiyB5lnaQyMRHlg1HwIkqQF/F6fQXaRMm0pK4/0z8ugQCrcwGHfIJcykdzUWC 90fiGZuu9++6Ptnr/qQhe9y5duZA+d9EgEiTyBlMOU5dqGsB0O3xHx3Sihioy5w2m9Uir6 lQhZZhkAZt5lMfrrv1L7YQfZP2a19s/6EWZdElPvgTK382+7lGZx323NwHAfmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776171117; 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=DqOS/kf4e/ntFCvuwS7JTELkXmF/o/5eDgXvEEjy7SQ=; b=uQ2Cy26YLRpbIrTIcyeRBBqvfHFccFiJ32jVUSJ2QWZ4P8nzphKCr4bt8FK2yMoUT+ytYe 9ofcwdIKD6AzZmx6M7+pPYnSM5PRJxlE7hN4IcZ3hgZbT28JFlhY6th8y0YQQaRCkimkNK Ot1xxyu8Xxku+pAFf2hvUrPpf0RHT77kaPq6sPgBw3k7ot08t5IMjVec5AWtNchoxY3XF2 BJIfNZh91kGYOF7h0UF4ztuBEqCXmx2UyYnsMdPQDtqF5YFIblPecdm57JdByyAI6+ckPe 35hrucLO+Ru6t8613dvcfR/jadHIYOKXaWPDnSJbGtEB6fwQrOEGNCi88U7Fbw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fw40s42xszrdq for ; Tue, 14 Apr 2026 12:51:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3dc52 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 12:51:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: fa912e3b9b5c - main - libthr.3: describe what we mean by C runtime environment. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa912e3b9b5c074793bb1899f8256ea4baf72631 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 12:51:57 +0000 Message-Id: <69de386d.3dc52.613617a9@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=fa912e3b9b5c074793bb1899f8256ea4baf72631 commit fa912e3b9b5c074793bb1899f8256ea4baf72631 Author: Konstantin Belousov AuthorDate: 2026-04-14 00:10:49 +0000 Commit: Konstantin Belousov CommitDate: 2026-04-14 12:51:32 +0000 libthr.3: describe what we mean by C runtime environment. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D56384 --- lib/libthr/libthr.3 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/libthr/libthr.3 b/lib/libthr/libthr.3 index b84176abcd32..8c7b84490547 100644 --- a/lib/libthr/libthr.3 +++ b/lib/libthr/libthr.3 @@ -52,6 +52,12 @@ The library is tightly integrated with the run-time link editor and .Lb libc ; all three components must be built from the same source tree. +Together, they constitute the base C runtime environment of +.Fx , +running on top of the +.Fx +kernel. +.Pp Mixing .Li libc and From nobody Tue Apr 14 12:51:58 2026 X-Original-To: dev-commits-src-main@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 4fw40v2fzjz6YWpR for ; Tue, 14 Apr 2026 12:51:59 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw40t6Gckz3r0y for ; Tue, 14 Apr 2026 12:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776171118; 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=aG3SY/B07qEsTR6uUrHlXh/eA2Nzg2b3MD4A2qH27gM=; b=dkgTcwAMpLlcA0k9Hp1NhufVhPxu92WBq8m96ggIGe8W20wD+VJqXkf33fAcMT1wUglbsi q4uFqUIK8ow7ZxoXSeZCJ0nuZ3/lfLLMgwFljjn8f+z4JowtPuj13RBtwGMU/5OOXFHVNR A0Yv4x6ZaVkB53NZToU2DlBEPkmoGFDbTVDffcOf3SGWHiUSqB/JknbB5E5jzhXOZp/bvI aK3PABCSDzH+NhziGO5klgPg8tq9SVkihjRKN5tQtpmykDj6XExLVKR02PbU+RMSD5Ycxc XhgnRSNIaEnBo2cJTJTqeep1tmJZFnrOt67RB+mLuYhy0QXdMwVQmS9qrwobsA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776171118; a=rsa-sha256; cv=none; b=sCOIfuXFHMJOxdkja/4ipShoMWiYwFKrI1+aoEOleH/HrfKHWt1LuTfxqUqI9T9tolaP6T I57lsBY1oPeDqVJsluPGC3ngBvn7od4UmfasZkI/7nNsZgglQMyXdC7bm6Yriq0kLb3Beu eTvHRBjSJ7lOT3mNUZzsU5piW3KbhJql7rVlse0Hd9k50OE5ZNmina1B4J56EHfjXeHJwR hxyXRydZqi83Lgwv9x+dF/yZiSAq9+BPjBhz2fIq5s5dgn5xC2sPi68n9PQB6UhFDB9sHW SC8Wu0T7sj1y4pexLaZH69DlfUtVi+vSK6ZScPwRylEtI1qnnTTUdTa5Dcdpcw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776171118; 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=aG3SY/B07qEsTR6uUrHlXh/eA2Nzg2b3MD4A2qH27gM=; b=nVkF2T1zw1EQVc7e50JqXG4hmjc01Pq8qCeZ67SSaE/OQ4/dGJONV+Ek9AoIp7B8cjf7pG XY269k2CTv5o3hy+1b+w42O9RoHTufic1LQcRoaY5A6ak439n6qKTGXWn0my9G09NGYCpd F10iLC5f7VnJDZ6d5l/o3V4ixTyKLpansv+iyCg18PFv3RC6FQibXfYSRPLabCtU07+Coj 3TGNWRAJ4X1RAyo/AJFePGUbfcUCUNxZlUoQt9bcCmefc7zOKkM4ooO8yJAmMhSybsh4o9 C1wZ9L8Rb3oX2KtrpwdDia292ng7N5CN6TtvorbbtuYMnYdcN0KA6ia690KuOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fw40t4pQKzrVM for ; Tue, 14 Apr 2026 12:51:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f4bb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 12:51:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 934a35ac2bbb - main - libthr.3: describe SIGTHR List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 934a35ac2bbbcf8cd65d8824fa824eb5c6170c88 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 12:51:58 +0000 Message-Id: <69de386e.3f4bb.66a5e2a1@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=934a35ac2bbbcf8cd65d8824fa824eb5c6170c88 commit 934a35ac2bbbcf8cd65d8824fa824eb5c6170c88 Author: Konstantin Belousov AuthorDate: 2026-04-13 23:42:51 +0000 Commit: Konstantin Belousov CommitDate: 2026-04-14 12:51:38 +0000 libthr.3: describe SIGTHR Explain how SIGTHR is used and that it should be not touched by user code. Note about SIGLIBRT. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential revision: https://reviews.freebsd.org/D56384 --- lib/libthr/libthr.3 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/libthr/libthr.3 b/lib/libthr/libthr.3 index 8c7b84490547..5d9c5ec6706b 100644 --- a/lib/libthr/libthr.3 +++ b/lib/libthr/libthr.3 @@ -269,6 +269,25 @@ the critical section. This should be taken into account when interpreting .Xr ktrace 1 logs. +.Pp +The +.Nm +library uses the +.Va SIGTHR +signal for internal operations, in particular, +for cancellation requests. +This signal's masking and disposition is controlled by the library, +and user programs should not try to modify them. +The library interposes functions controlling signals to prevent +inadvertent modifications and to guard portable code against +exposure to +.Va SIGTHR . +.Pp +Note: similarly, the +.Va SIGLIBRT +signal is reserved for use by +.Lb librt , +and should be not modified by users. .Sh PROCESS-SHARED SYNCHRONIZATION OBJECTS In the .Li libthr From nobody Tue Apr 14 13:03:34 2026 X-Original-To: dev-commits-src-main@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 4fw4GH2knMz6YXF7 for ; Tue, 14 Apr 2026 13:03:35 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw4GG74Ldz3sky for ; Tue, 14 Apr 2026 13:03:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776171815; 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=TjG43nUmVhQP8ZAz+MiN9Dk2j10Hz4N7GJ64RfJ/Hnc=; b=y1N77hAt74mCoYyhDPCJGiT+BxVEy/oHkU8oG13u9QZcsdsx0iEzhpbQZ+xoxebInvUxU2 PKyx5f3HJ4tybKbLqcOetVRNICwptoWwDu91z8TZF2jcioZBxddzfHb39v0zU+VUilsuWi V6fFWqRIzxor7MFHddAlm1hYmI/dbcDZtIzfUbWZMODn9CbDTZ/hgNnglnlU8Y9geP+Xxn iQ4yq6Ms5K1wk4E5lYOvK22zt1KfPoV9RFtk/Sra/p2o6Bh8QZZdH2CrlJj15IH7QETUoa oYDTj9HiiDZAMV73E1KLBu/0LS2/nv/9qq3zWp7u3pI3v8BbUFMdUWDi2pFqKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776171815; a=rsa-sha256; cv=none; b=A4fieoFmn/lqyj+iUZ0EggPZUPwflSZYWjnqAyWlnXyr2JOGU1Joo793ZdSNGjFxHQtPcI 9ar2lS1jnCR+8mKBj8gHzIQvdNG/sMdRVAtnSUc4UVJTxVQKGL4RhHnlaBVX0AC7AQh6aR VWi4krdhm8fPwaQwoG41C7iiNqNcDURieU3yk7TKwS8kPZWdVDzdH1HbaGKFKswnbhGTCP 0G8q83Gu0nY5rnIqMaAd3Tmj//gwHi89GC4AyGGv+/SWlDWc1Pe6uDFeI2DaHfpILkXE2C O074KsubP9P4JDEeOjh6TezBRU2OewIH7gXoh8L0JAWiFxuwHr2wscS15teERQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776171815; 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=TjG43nUmVhQP8ZAz+MiN9Dk2j10Hz4N7GJ64RfJ/Hnc=; b=ge8XamNPWzVbAB9FY2t+u0dVgSLnNccHI5LFnc8zSaFLOFXlNS7fn+UfXrjtv6rrUwcKfg iACbakNJ747IBF2pEqPiLfTAjuvT1COsH1qAYklFVmXvd+lkJYh7LPVFoO2tvGajvMRLvA E+QSjRSDkbD+28ehmmpDdZXMhCeKuWA6ReWET6AGUgPtdSeXXI3rQbY4nQLZmrx0yeubo8 vrmxhds00O6TLFtgGrgcXei0VcIlXKLoxwQhs1fHOOPuhvzXVY4/czdlI8aIk4H/v8tkOc YJZiwPfj9xws6zsBoFofr71T3ZSBvAZpEj4C56NunIqhUbL1H4nqmbY1WFju6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fw4GG6b3VzrCK for ; Tue, 14 Apr 2026 13:03:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3faa6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 13:03:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: dc140a9fc151 - main - Bourne shell -> POSIX shell List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc140a9fc151f3717bce2157f49070daafa13ec0 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 13:03:34 +0000 Message-Id: <69de3b26.3faa6.416026cd@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=dc140a9fc151f3717bce2157f49070daafa13ec0 commit dc140a9fc151f3717bce2157f49070daafa13ec0 Author: Alexander Ziaee AuthorDate: 2026-04-14 13:02:53 +0000 Commit: Alexander Ziaee CommitDate: 2026-04-14 13:02:58 +0000 Bourne shell -> POSIX shell The FreeBSD shell is a POSIX compatible shell. It evolved over several decades from the Almquist shell, which was preceeded a decade before that by the Bourne shell. Most readers today have never seen a Bourne shell. If someone wants to learn to use our shell, they need to look for tutorials on the POSIX shell. Align descriptions through out the tree with this reality, consistent with it's manual and common parlance. We made a similar change to the doc tree in b4d6eb01540fe. MFC after: 3 days Reviewed by: carlavilla Differential Revision: https://reviews.freebsd.org/D56382 --- share/skel/dot.profile | 2 +- usr.bin/apply/apply.1 | 2 +- usr.bin/chpass/chpass.1 | 2 +- usr.bin/fortune/datfiles/freebsd-tips | 4 ++-- usr.bin/script/script.1 | 4 ++-- usr.sbin/adduser/adduser.8 | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/share/skel/dot.profile b/share/skel/dot.profile index 40dfa58f4e84..d67a6e2a934b 100644 --- a/share/skel/dot.profile +++ b/share/skel/dot.profile @@ -1,5 +1,5 @@ # -# .profile - Bourne Shell startup script for login shells +# .profile - POSIX Shell startup script for login shells # # see also sh(1), environ(7). # diff --git a/usr.bin/apply/apply.1 b/usr.bin/apply/apply.1 index f1c114d40814..1e0115364e81 100644 --- a/usr.bin/apply/apply.1 +++ b/usr.bin/apply/apply.1 @@ -96,7 +96,7 @@ The following environment variable affects the execution of .Bl -tag -width SHELL .It Ev SHELL Pathname of shell to use. -If this variable is not defined, the Bourne shell is used. +If this variable is not defined, the POSIX shell is used. .El .Sh FILES .Bl -tag -width /bin/sh -compact diff --git a/usr.bin/chpass/chpass.1 b/usr.bin/chpass/chpass.1 index 0891f3f28c92..0321d748a1a4 100644 --- a/usr.bin/chpass/chpass.1 +++ b/usr.bin/chpass/chpass.1 @@ -227,7 +227,7 @@ The field is the command interpreter the user prefers. If the .Ar shell -field is empty, the Bourne shell, +field is empty, the POSIX shell, .Pa /bin/sh , is assumed. When altering a login shell, and not the super-user, the user diff --git a/usr.bin/fortune/datfiles/freebsd-tips b/usr.bin/fortune/datfiles/freebsd-tips index 379f772fea88..47fd3c755626 100644 --- a/usr.bin/fortune/datfiles/freebsd-tips +++ b/usr.bin/fortune/datfiles/freebsd-tips @@ -180,7 +180,7 @@ directory sizes. nc(1) (or netcat) is useful not only for redirecting input/output to TCP or UDP connections, but also for proxying them with inetd(8). % -sh (the default Bourne shell in FreeBSD) supports command-line editing. Just +sh (the default POSIX shell in FreeBSD) supports command-line editing. Just ``set -o emacs'' or ``set -o vi'' to enable it. Use "" key to complete paths. % @@ -415,7 +415,7 @@ if you leave the shell idle for more than 30 minutes. % You can use aliases to decrease the amount of typing you need to do to get commands you commonly use. Examples of fairly popular aliases include (in -Bourne shell style, as in /bin/sh, bash, ksh, and zsh): +POSIX shell style, as in /bin/sh, bash, ksh, and zsh): alias lf="ls -FA" alias ll="ls -lA" diff --git a/usr.bin/script/script.1 b/usr.bin/script/script.1 index 5f40e5af28ff..ef8eaa35174f 100644 --- a/usr.bin/script/script.1 +++ b/usr.bin/script/script.1 @@ -139,7 +139,7 @@ Forward terminal size changes on The script ends when the forked shell (or command) exits (a .Em control-D to exit -the Bourne shell +the POSIX shell .Pf ( Xr sh 1 ) , and .Em exit , @@ -184,7 +184,7 @@ exists, the shell forked by will be that shell. If .Ev SHELL -is not set, the Bourne shell +is not set, the POSIX shell is assumed. .Pq Most shells set this variable automatically . .El diff --git a/usr.sbin/adduser/adduser.8 b/usr.sbin/adduser/adduser.8 index e21a7653f250..eacc12a8f3ce 100644 --- a/usr.sbin/adduser/adduser.8 +++ b/usr.sbin/adduser/adduser.8 @@ -459,7 +459,7 @@ command appeared in .An -nosplit This manual page and the original script, in Perl, was written by .An Wolfram Schneider Aq Mt wosch@FreeBSD.org . -The replacement script, written as a Bourne +The replacement script, written as a POSIX shell script with some enhancements, and the man page modification that came with it were done by .An Mike Makonnen Aq Mt mtm@identd.net . From nobody Tue Apr 14 13:21:20 2026 X-Original-To: dev-commits-src-main@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 4fw4fm3Q8Pz6YYfG for ; Tue, 14 Apr 2026 13:21:20 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw4fm2pZyz3vY1 for ; Tue, 14 Apr 2026 13:21:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776172880; 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=dlaRuxqh35bx8Dk2VwLG/NQAS587SEgoGi32IID0Gc0=; b=RfEmQq4usfmZdCneDKt/iyw/1NxmbjDyaKqXmR7fA6qyKjr1KMyno265abIhe+q0pqDap9 vTUytUpIJ4F5QvYRG9nYp2vMVPvqz9VNNCYO/RitIUowOtQ3f9OB8TEN7caRVEa5EdyHmv GjKEDBqMqJwlkmdXlLQ8jI3Td/96oGIeKMjj4ud8UgeESjS4q7wsiu9JwmEDpDmKVpmBkr kLjwXEhqNXpUQ9xOn9iMne0ZMVaYundqGk1JKKaFaxYzOqYtr6j4rn3dJStZ20/Pok3UXk uOAvPwRkFl8BETjRoh0fMHmGmdLCyHQ9c42jIYFMvfP4zDkiZYbzVBYGYcrdUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776172880; a=rsa-sha256; cv=none; b=IVIp5f8ss2mGJ7qKiTPA2shx3vX3eSVkhkWI04YX3QT00zMRBC8YbWfTtPLslDGszAFmrG T+vyzz94cPNy4JCIBaUx7XpeU3Y1zdms4tOw3e/YHV68pi412Qt0cMpk0eNWaHf4UGtleF l5g48EQEj9pn3UT4iEhblTg5KsWuhwXpWQjLi5CLAnXFwBydGXDQcLgvRyhk07WRJWzUyD a0pxxM/MS99glJJ7/XJAXO5kAEozxmvXqh8Aoc4C6uXS4FwdcVCX3YMQtk0f2STK9dF2Lz OmceLgtWkM831bXMw7DmKgcehQGcecny9XSRa98mE651G2lb8WgpwxHK9Yk/4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776172880; 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=dlaRuxqh35bx8Dk2VwLG/NQAS587SEgoGi32IID0Gc0=; b=CI+pK9JyufT6ZRzm9bcuxnwbOQKvSAAjTYcD/J6diguNCEBcfYS6S0GjDGM/mCo4dA7jO3 9oVdu1b10sADbJNMiVm/h0tu7mY21VBu/yQVJqA9EGbGg4voKzwz0Vg7U7WD9mS3lGJXyZ WWaKrxPA8/8wxa7IUw2+TggvPjfLoymeHNZ1XR+1dmbb3V+6axhXHztPizRZO/Py8GFdsW MGrAgiMQvFa5qUBSV+NftWupuIYV8V5TkdMykVEuQG00z/5orSF19Qn9QnSShSoqOSlZvk lB63ncV5Yl+SOh6E6gaATqdjZcNYebrpr/4lQmxz2JNcAv50rXeCR6WesYKVuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fw4fm2CxNzs3d for ; Tue, 14 Apr 2026 13:21:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 41ab7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 13:21:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 5f922bd20d81 - main - freebsd-base.7: Break examples into subsections List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f922bd20d81af4b5759b8f104d5c22ee3e5cd1b Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 13:21:20 +0000 Message-Id: <69de3f50.41ab7.7c8a6eb6@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=5f922bd20d81af4b5759b8f104d5c22ee3e5cd1b commit 5f922bd20d81af4b5759b8f104d5c22ee3e5cd1b Author: Alexander Ziaee AuthorDate: 2026-04-14 13:20:38 +0000 Commit: Alexander Ziaee CommitDate: 2026-04-14 13:21:05 +0000 freebsd-base.7: Break examples into subsections Break the examples into subsections, so that we can have multi-step examples. MFC after: 3 days (to 15 only) Discussed with: ivy Differential Revision: https://reviews.freebsd.org/D55526 --- share/man/man7/freebsd-base.7 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/share/man/man7/freebsd-base.7 b/share/man/man7/freebsd-base.7 index 383808579487..aaa5a875df71 100644 --- a/share/man/man7/freebsd-base.7 +++ b/share/man/man7/freebsd-base.7 @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd December 4, 2025 +.Dd February 26, 2026 .Dt FREEBSD-BASE 7 .Os .Sh NAME @@ -183,13 +183,14 @@ The system test suite, installed in All available system kernels. .El .Sh EXAMPLES +.Ss Install a single piece of userland Install the .Xr vi 1 text editor on the running system: .Bd -literal -offset indent pkg install FreeBSD-vi .Ed -.Pp +.Ss Install userland to a jail Install a new .Xr jail 8 system using the @@ -198,17 +199,17 @@ package set: .Bd -literal -offset indent pkg -r /jails/myjail install FreeBSD-set-minimal-jail .Ed -.Pp +.Ss Install native compilers Install C/C++ compilers on the running system: .Bd -literal -offset indent pkg install FreeBSD-set-devel .Ed -.Pp +.Ss Update the currently running system Apply available updates to the running system: .Bd -literal -offset indent pkg upgrade -r FreeBSD-base .Ed -.Pp +.Ss Install cross compilers Install the development toolchain for FreeBSD/powerpc64le in an alternate root (for example, to support cross-compiling software for a different target than the host system): From nobody Tue Apr 14 13:23:29 2026 X-Original-To: dev-commits-src-main@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 4fw4jF5LQXz6YZ2N for ; Tue, 14 Apr 2026 13:23:29 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw4jF4dpcz3wMw for ; Tue, 14 Apr 2026 13:23:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776173009; 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=RcB4itTuFHKsrRW0w++2rGQcg7fSiguJ0oA13QXsGG0=; b=PePeB+RTy5T0nZHmb6YMlBWnx68J7UuPI8E+50uk9fA2W7zKOv4k8kfBx68UjTWM9lSTKJ v6jLkBzsm7dK0AkqpFHbNRPNafnVsjfvT5JcTg50wiPvNjpJATLLpC6M+HjjJR/nGz49Vl xGeW9LbDeTJEwLOTCRKOhRySH+XvMQLVB9pLcQEHptRHmyfRUemQpgl30R2cIBSpD3l34s hma19WhK5oRByw+vZ87+DFwpuFa+E6SznRyUSJzBzaYMfOqf94miw6GhSkBc/M9tVtkL3B m6BF+T5vcrWrJFlQAUqG1tdIPQB8wQrhzIAZedYALQHO6DDl8fZ9aUtyGfGOWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776173009; a=rsa-sha256; cv=none; b=jdzgv/zeHXpWQpZ2l2UTs4YHX4jOK9d+IWCWdVyyqDt0rPBGBj+4pm8q4BijdJ/RsuDi2Z bdKTZKWelDve+Y/lEXPKuDmhZLGPnKzOtu2ZkZ1T9zu2YBjmcJ0xlwsBf6D9+oWaU/4hi0 alvUEtkdAFVbx1choqgijrvcQIlPCMngGiFSIj9JpGcbFuy58pSktoNuYa3Gl4ixKeXSvO 5GPL0Beegc+wuAKOPOMh1LTjUgThitR3OvkZDIwR4Sc8LIn2L+O7yzfRk1XsFqsUvLCZoq doTNPtrWXPgzRN3/Ki+NCj6284pCHYuTJ1X6bTN12Xx1TbYtwd2PDrUjXTSlJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776173009; 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=RcB4itTuFHKsrRW0w++2rGQcg7fSiguJ0oA13QXsGG0=; b=MtoOIGcoeOoqlLCaM6qXmPkwSa8zh9EiLhyFHTalyHCKmjyk7xUVoPLlNtmrcI1aGDHWq5 WWFHfcdYa1dmtO5yXWxRu39oO+MRGdLIqm2bt0Ncvms9zAhIO1hJezccECYkUGZPQFuG0D 4GkVC8von1YBWQJILasXZhED/OdGmDL5kLTOULhF/rMqZpINFChftqb094c0MIZrKjsUws +7b6ertIJEoWty+KIssVCpHQRzi8iLMDGgMFsvOJ2GpdnTq2Q5ZQoFFAM7Dzce0Ey9yqeX xN8jxqju1JwYNMPN8Gl4qzvKeiZKxpkCWSEAafnyUk1G08WuEfmFU7OoWKp4XQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fw4jF43kSzs9l for ; Tue, 14 Apr 2026 13:23:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 41abb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 13:23:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 998d501ae61a - main - freebsd-base.7: Add an example for unregistering List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 998d501ae61a3e3c800e6d102d8ab5253c7c1b91 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 13:23:29 +0000 Message-Id: <69de3fd1.41abb.2f258183@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=998d501ae61a3e3c800e6d102d8ab5253c7c1b91 commit 998d501ae61a3e3c800e6d102d8ab5253c7c1b91 Author: Alexander Ziaee AuthorDate: 2026-04-14 13:21:50 +0000 Commit: Alexander Ziaee CommitDate: 2026-04-14 13:22:15 +0000 freebsd-base.7: Add an example for unregistering MFC after: 3 days Reviewed by: ivy, emaste Discussed with: bapt, des, emaste, ivy, phk, pi Differential Revision: https://reviews.freebsd.org/D55458 --- share/man/man7/freebsd-base.7 | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/share/man/man7/freebsd-base.7 b/share/man/man7/freebsd-base.7 index aaa5a875df71..c690a7a9e0b9 100644 --- a/share/man/man7/freebsd-base.7 +++ b/share/man/man7/freebsd-base.7 @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd February 26, 2026 +.Dd April 1, 2026 .Dt FREEBSD-BASE 7 .Os .Sh NAME @@ -217,6 +217,39 @@ for a different target than the host system): pkg -r /ppcdev -oABI=FreeBSD:16:powerpc64le \e install FreeBSD-set-devel .Ed +.Ss Unregister a currently running system +Systems managed through +.Xr pkg 8 +can be unregistered from the package manager \(em +for example to upgrade in-place via +.Dq make installworld . +See +.Xr build 7 . +.Pp +To unregister the base system from the package manager: +.Bd -literal -offset indent +pkg unregister -fg 'FreeBSD-\e*' +.Ed +.Pp +Then, disable the base system package repository. +If a configuration file was created in +.Pa /usr/local/etc/pkg/repos/ +to enable base system packages, remove it: +.Bd -literal -offset indent +rm /usr/local/etc/pkg/repos/FreeBSD-base.conf +.Ed +.Pp +Alternatively, if it is desired to keep it, +edit the file and change +.Dq Li enabled: +to +.Dq Li no +to disable the entry. +.Pp +.Sy Warning : +This is a destructive action +which will prevent updating the base system via +.Xr pkg 8 . .Sh SEE ALSO .Xr build 7 , .Xr pkg 8 , @@ -225,3 +258,4 @@ pkg -r /ppcdev -oABI=FreeBSD:16:powerpc64le \e Support for installing the base system as packages was introduced in .Fx 15.0 . Earlier releases supported a subset of this functionality. +Support for unregistering an existing installation appeared in pkg 2.5. From nobody Tue Apr 14 13:25:46 2026 X-Original-To: dev-commits-src-main@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 4fw4lv0YFKz6YZ0y for ; Tue, 14 Apr 2026 13: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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw4lt50zDz3wm3 for ; Tue, 14 Apr 2026 13:25:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776173146; 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=v8Nll50Et+HnMH/dwUBFsIhrOHWqLl0x9QLlKJtApzg=; b=jiKMJehoI4Bh9G6YtNR2VEWXOqU6hO6A/wV3zZPhJdgL1I8dW9/4J3Ya01HE/FI/fa29g3 VyEJ9x3SWokCQn3qkPqRJCUA4phiuFTR4BkSThX0QTnrxGEVVuooia3CuuaAADh2R954DO QC9cGKdt7ePOyahmF0KQJ6vN4V3O+bNhuj7/32USyiVuE9eZyG2GviNo7Z9VLRzPyD3Xvb qhWzpU6b4IAN/Nb3OwMe3cZO9Dc1K8IsV/oFvozK0qRy2S7QrLJTth76AttCi5fVPTD91a HlPJu4RXIPgTlCdQtWj5H+lyecD6CMOsj/lrR6MjPV8hdMDHFs1wOUkYhaMXeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776173146; a=rsa-sha256; cv=none; b=F6DVrnjGJ3m0FJixPTvOhrGJoU0TlVLrgiNCpKFL9AU23BjxQd0sCS1u3SVno2C4TAqBvq h6x+M9WVxcnPXMd7MHF0RG3LxvU4e+ol+AvvDb6tr4NzpvcyjBhiCx3eJO+GDgIn46bhnE 8C/w1aSsjWugJ18k2cmfBGFgE0hYYJR2RUV6V618Zp+fzrux3Rz9Xa0B4+JmppaQeowbTQ 9t6goNpiQMQvxQpXmT53+tycnd0Gc7OENiEbDb8ltJU8X0US/pBKsHtrFCos08MZqaCPnu jQYz7ZcZ/FMQ1jCHGQMYXLeCt854lfljMRa53s85nC/vYgwULuKdjtp0k2A+dA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776173146; 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=v8Nll50Et+HnMH/dwUBFsIhrOHWqLl0x9QLlKJtApzg=; b=lK1v30sMDINMncewwUMB+aXZVuDbyuIY6uSuQWSuIjY3pESM/0v3PhEBPTMJAOSdTqW5qH ZpliDFF0qWgedsuwl/bAVcwjSV5f5WP2MgFyD9kjdk114eOEv8NE17z3Ps/UwXk24YhIy4 tEZ63LsPBY4PaQv/EJSQOPp7AZFpN07EdlFjQQpoS6AmbNDxM7Jdr/OoIyEGJVdCzbMzum LE3IN+jO2htemplGa2+/JSl48Hto05/lLxsBGtY9q8VAX+ktIcspTbYXLRbgQl3qbP4NZk 2LAkUxHRl4CrqIyd5lUbn5r9nisYsEVpgYkAZJNx1iaOK6hX5EacVdzfJ3jZJg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fw4lt4CHTzshc for ; Tue, 14 Apr 2026 13:25:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 41d83 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 13:25:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 8c941e313e39 - main - acpi_apm: Don't recurse on ACPI_LOCK in apmreadfilt List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8c941e313e3925b17e49b093244c159db7a112f8 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 13:25:46 +0000 Message-Id: <69de405a.41d83.310c267d@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8c941e313e3925b17e49b093244c159db7a112f8 commit 8c941e313e3925b17e49b093244c159db7a112f8 Author: John Baldwin AuthorDate: 2026-04-14 13:25:37 +0000 Commit: John Baldwin CommitDate: 2026-04-14 13:25:37 +0000 acpi_apm: Don't recurse on ACPI_LOCK in apmreadfilt The lock is already held by the caller since it is used as the knlist lock. PR: 293901 Reported by: Jiaming Zhang Fixes: cc2715cf1f86 ("acpi_apm: Narrow scope of ACPI_LOCK") --- sys/x86/acpica/acpi_apm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/x86/acpica/acpi_apm.c b/sys/x86/acpica/acpi_apm.c index 71e2573d5fde..e9db0c090f5c 100644 --- a/sys/x86/acpica/acpi_apm.c +++ b/sys/x86/acpica/acpi_apm.c @@ -430,9 +430,7 @@ apmreadfilt(struct knote *kn, long hint) int sleeping; clone = kn->kn_hook; - ACPI_LOCK(acpi); sleeping = clone->acpi_sc->acpi_next_stype != POWER_STYPE_AWAKE; - ACPI_UNLOCK(acpi); return (sleeping); } From nobody Tue Apr 14 15:57:41 2026 X-Original-To: dev-commits-src-main@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 4fw87F3PB7z6Z2Xn; Tue, 14 Apr 2026 15:57:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw87F1vwKz3JFm; Tue, 14 Apr 2026 15:57:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776182265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0jBsqrCJvuQLbw4R8tuIkHxRY6InPsBNx5ify9DBA6k=; b=pAPj4d47O5FD5pgJIvzbnc4f93fUMxNTdEeb+wLYA3jpYbnxyqxeVQV0seEgOmMeCDC9vT qmiruz3EwIUtaoapWPB2nGbdeXJJYXhm4W3MQb/K03xHdKPPvl5i440T+SgAwXRhs2ORCz NuUfCSA/7SSdL4XkgQbkG/R8IrQIQNuFdpUJsByC+y9Sv7Txf6PpVUdFwVtbVLVo+MiP7Y SbCNYyq0LU2ih145jArzc4IagDJrZnElgOg1NgjwWZzDXfrD6zOIaJHPx4OhiwhnO+o1pf XHtFicTrqlZlWNJiTirCHjqpUsApW5ger+HYXy89sIiN9F287ipsP//Mb3nm9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776182265; a=rsa-sha256; cv=none; b=GdrJrFzQgXkESQKEmA3xJdKo7mZYFIudxMdqw+JGZtsAuqlXar3ZHbrZBd3ZaynAdU8HMP Sbd/xcaSZ7XdPL7StTT2hk28pogZCQUujmKJqXtZ0is7k2NLzrVwx3IcFIwKA96qh2qoeF jNMVeW0DYmTFmmfcdQVHX7U/lAX+0SMGmZUunaupjfJHfK8VeIY+ZECNpdKMRpeEzFv7tZ UexjojnvknxWF/A/5+yBySs3BzLDl++JE9maQ/0JA3A4AFkiFa/UxSp4phiZ1xnWATCvAN Q5iyAS+twc/TutDmlUdyiSl8m9ML/h8xXdLppCBJ2W7Wm+KUaszXRCvlU+rYEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776182265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0jBsqrCJvuQLbw4R8tuIkHxRY6InPsBNx5ify9DBA6k=; b=mgBAoBG2jI7jKkmVjK3iKt+oZeU4AEsRtHgo4Vfbj80t1j2ueRtHMmelMLI/mB7US1pilV amtzxqzN+tXumNeTauIukgCTqdXF9iok0baeNrWoiBo0YfOZ8u4Ixb2bgDrU34YRxQTaDD 1WxhmtvYod4d4X1VKRdiGWCmzeQuYls+RWq+mMDZoLPJj5ogdnSwPoXcHESPE4C45gVwbX rLklupmtNur2LGsg3J1scr3DKT7RmonnlcwarWO7WGI8NpY0KX0EOuCeHVWoJBoszPCx5p PzhIBT8qjcfCrm1nhQWgSIIoh7oK709dySr2Y6hTmhkf9OWF6T2U/sKqFC8uTA== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (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 (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R12" (not verified)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fw87D6fqLz49c; Tue, 14 Apr 2026 15:57:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 65CD1168BB; Tue, 14 Apr 2026 17:57:42 +0200 (CEST) From: Kristof Provost To: Zhenlei Huang Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: e9fc0c538264 - main - if_clone: Make ifnet_detach_sxlock opaque to consumers Date: Tue, 14 Apr 2026 17:57:41 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: In-Reply-To: <69dc7394.203c3.3a41c692@gitrepo.freebsd.org> References: <69dc7394.203c3.3a41c692@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_4D2EEB50-D9A0-4561-A201-3D0996B9026B_=" --=_MailMate_4D2EEB50-D9A0-4561-A201-3D0996B9026B_= Content-Type: text/plain; charset=UTF-8; format=flowed; markup=markdown Content-Transfer-Encoding: quoted-printable On 13 Apr 2026, at 6:39, Zhenlei Huang wrote: > The branch main has been updated by zlei: > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3De9fc0c538264355bd3fd9120c6500= 78281c2a290 > > commit e9fc0c538264355bd3fd9120c650078281c2a290 > Author: Zhenlei Huang > AuthorDate: 2026-04-13 04:38:44 +0000 > Commit: Zhenlei Huang > CommitDate: 2026-04-13 04:38:44 +0000 > > if_clone: Make ifnet_detach_sxlock opaque to consumers > > The change e133271fc1b5e introduced ifnet_detach_sxlock, and = > change > 6d2a10d96fb5 widened its coverage, but there are still consumers, > net80211 and tuntap e.g., want it. Instead of sprinkling it = > everywhere, > make it opaque to consumers. > > Out of tree drivers shall also benefit from this change. > > Reviewed by: kp > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D56298 I don=E2=80=99t really understand why, but this commit causes bricoler te= st = runs to fail for me. Or more precisely, it looks like parallel test runs see a number of = failures in the pf tests. Reverting only part of this change, specifically this: diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c index db3db78c1b76..d0fe54b6146b 100644 --- a/sys/net/if_clone.c +++ b/sys/net/if_clone.c @@ -683,11 +683,12 @@ if_clone_detach(struct if_clone *ifc) V_if_cloners_count--; IF_CLONERS_UNLOCK(); - sx_xlock(&ifnet_detach_sxlock); /* destroy all interfaces for this cloner */ - while (!LIST_EMPTY(&ifc->ifc_iflist)) + while (!LIST_EMPTY(&ifc->ifc_iflist)) { + sx_xlock(&ifnet_detach_sxlock); if_clone_destroyif_flags(ifc, = LIST_FIRST(&ifc->ifc_iflist), IFC_F_FORCE); - sx_xunlock(&ifnet_detach_sxlock); + sx_xunlock(&ifnet_detach_sxlock); + } IF_CLONE_REMREF(ifc); } Seems to be enough to avoid the problem. So it looks like somehow = deleting all interfaces for a given cloner under that lock (rather than = releasing it and re-acquiring it) causes the test failures. The failing tests I see are: sys/netpfil/pf/divert-to:in_div -> failed: Test case body returned a = non-ok exit code, but this is not allowed [36.591s] sys/netpfil/pf/divert-to:in_div_in -> failed: atf-check failed; see = the output of the test for details [30.867s] sys/netpfil/pf/divert-to:in_div_in_fwd_out_div_out -> failed: = atf-check failed; see the output of the test for details [39.705s] sys/netpfil/pf/divert-to:in_dn_in_div_in_out_div_out_dn_out -> = failed: atf-check failed; see the output of the test for details = [45.059s] sys/netpfil/pf/divert-to:out_div -> failed: Test case body returned a = non-ok exit code, but this is not allowed [23.629s] sys/netpfil/pf/killstate:gateway -> failed: Killing with a different = gateway removed the state. [32.803s] sys/netpfil/pf/killstate:id -> failed: Killing a different ID removed = the state. [32.789s] sys/netpfil/pf/killstate:label -> failed: Killing a non-existing = label removed the state. [47.749s] sys/netpfil/pf/killstate:multilabel -> failed: Setting new rules = removed the state. [43.570s] sys/netpfil/pf/killstate:src_dst -> failed: Killing with the wrong = destination IP removed our state. [57.819s] sys/netpfil/pf/killstate:v6 -> failed: Killing with the wrong IP = removed our state. [54.957s] sys/netpfil/pf/nat64:pool -> failed: atf-check failed; see the output = of the test for details [51.118s] sys/netpfil/pf/nat64:sctp_in -> failed: Failed to connect to SCTP = server [55.495s] sys/netpfil/pf/nat64.py:TestNAT64::test_udp_checksum -> failed: = /usr/tests/sys/netpfil/pf/nat64.py:205: AttributeError [80.001s] sys/netpfil/pf/pflog:matches -> failed: atf-check failed; see the = output of the test for details [61.807s] sys/netpfil/pf/pflog:matches_logif -> failed: atf-check failed; see = the output of the test for details [51.261s] sys/netpfil/pf/pflog:unspecified_v6 -> failed: atf-check failed; see = the output of the test for details [36.281s] sys/netpfil/pf/rdr:srcport_pass -> failed: atf-check failed; see the = output of the test for details [76.815s] sys/netpfil/pf/sctp:pfsync -> failed: Initial SCTP connection failed = [134.866s] sys/netpfil/pf/sctp:related_icmp -> failed: SCTP connection failed = [59.620s] sys/netpfil/pf/table:zero_one -> failed: atf-check failed; see the = output of the test for details [64.125s] sys/netpfil/pf/tcp:rst -> failed: atf-check failed; see the output of = the test for details [80.261s] Looking at it now, those runtimes seems suspiciously high as well. Best regards, Kristof --=_MailMate_4D2EEB50-D9A0-4561-A201-3D0996B9026B_= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On 13 Apr 2026, at 6:39, Zhenlei Huang wrote:

The branch main has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/co= mmit/?id=3De9fc0c538264355bd3fd9120c650078281c2a290

commit e9fc0c538264355bd3fd9120c650078281c2a290
Author: Zhenlei Huang zlei@FreeBS= D.org
AuthorDate: 2026-04-13 04:38:44 +0000
Commit: Zhenlei Huang zlei@FreeBS= D.org
CommitDate: 2026-04-13 04:38:44 +0000

if=
_clone: Make ifnet_detach_sxlock opaque to consumers

The change e133271fc1b5e introduced ifnet_detach_sxlock, and change
6d2a10d96fb5 widened its coverage, but there are still consumers,
net80211 and tuntap e.g., want it. Instead of sprinkling it everywhere,
make it opaque to consumers.

Out of tree drivers shall also benefit from this change.

Reviewed by:    kp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56298

I don=E2=80=99t really understand why, but this commit ca= uses bricoler test runs to fail for me.
Or more precisely, it looks like parallel test runs see a number of failu= res in the pf tests.

Reverting only part of this change, specifically this:

di=
ff --git a/sys/net/if_clone.c b/sys/net/if_clone.c
index db3db78c1b76..d0fe54b6146b 100644
--- a/sys/net/if_clone.c
+++ b/sys/net/if_clone.c
@@ -683,11 +683,12 @@ if_clone_detach(struct if_clone *ifc)
        V_if_cloners_count--;
        IF_CLONERS_UNLOCK();

-       sx_xlock(&ifnet_detach_sxlock);
        /* destroy all interfaces for this cloner */
-       while (!LIST_EMPTY(&ifc->ifc_iflist))
+       while (!LIST_EMPTY(&ifc->ifc_iflist)) {
+               sx_xlock(&ifnet_detach_sxlock);
                if_clone_destroyif_flags(ifc, LIST_FIRST(&ifc->ifc=
_iflist), IFC_F_FORCE);
-       sx_xunlock(&ifnet_detach_sxlock);
+               sx_xunlock(&ifnet_detach_sxlock);
+       }

        IF_CLONE_REMREF(ifc);
 }

Seems to be enough to avoid the problem. So it looks like= somehow deleting all interfaces for a given cloner under that lock (rath= er than releasing it and re-acquiring it) causes the test failures.

The failing tests I see are:

sy=
s/netpfil/pf/divert-to:in_div  ->  failed: Test case body returned a n=
on-ok exit code, but this is not allowed  [36.591s]
sys/netpfil/pf/divert-to:in_div_in  ->  failed: atf-check failed; see =
the output of the test for details  [30.867s]
sys/netpfil/pf/divert-to:in_div_in_fwd_out_div_out  ->  failed: atf-ch=
eck failed; see the output of the test for details  [39.705s]
sys/netpfil/pf/divert-to:in_dn_in_div_in_out_div_out_dn_out  ->  faile=
d: atf-check failed; see the output of the test for details  [45.059s]
sys/netpfil/pf/divert-to:out_div  ->  failed: Test case body returned =
a non-ok exit code, but this is not allowed  [23.629s]
sys/netpfil/pf/killstate:gateway  ->  failed: Killing with a different=
 gateway removed the state.  [32.803s]
sys/netpfil/pf/killstate:id  ->  failed: Killing a different ID remove=
d the state.  [32.789s]
sys/netpfil/pf/killstate:label  ->  failed: Killing a non-existing lab=
el removed the state.  [47.749s]
sys/netpfil/pf/killstate:multilabel  ->  failed: Setting new rules rem=
oved the state.  [43.570s]
sys/netpfil/pf/killstate:src_dst  ->  failed: Killing with the wrong d=
estination IP removed our state.  [57.819s]
sys/netpfil/pf/killstate:v6  ->  failed: Killing with the wrong IP rem=
oved our state.  [54.957s]
sys/netpfil/pf/nat64:pool  ->  failed: atf-check failed; see the outpu=
t of the test for details  [51.118s]
sys/netpfil/pf/nat64:sctp_in  ->  failed: Failed to connect to SCTP se=
rver  [55.495s]
sys/netpfil/pf/nat64.py:TestNAT64::test_udp_checksum  ->  failed: /usr=
/tests/sys/netpfil/pf/nat64.py:205: AttributeError  [80.001s]
sys/netpfil/pf/pflog:matches  ->  failed: atf-check failed; see the ou=
tput of the test for details  [61.807s]
sys/netpfil/pf/pflog:matches_logif  ->  failed: atf-check failed; see =
the output of the test for details  [51.261s]
sys/netpfil/pf/pflog:unspecified_v6  ->  failed: atf-check failed; see=
 the output of the test for details  [36.281s]
sys/netpfil/pf/rdr:srcport_pass  ->  failed: atf-check failed; see the=
 output of the test for details  [76.815s]
sys/netpfil/pf/sctp:pfsync  ->  failed: Initial SCTP connection failed=
  [134.866s]
sys/netpfil/pf/sctp:related_icmp  ->  failed: SCTP connection failed  =
[59.620s]
sys/netpfil/pf/table:zero_one  ->  failed: atf-check failed; see the o=
utput of the test for details  [64.125s]
sys/netpfil/pf/tcp:rst  ->  failed: atf-check failed; see the output o=
f the test for details  [80.261s]

Looking at it now, those runtimes seems suspiciously high= as well.

Best regards,
Kristof

--=_MailMate_4D2EEB50-D9A0-4561-A201-3D0996B9026B_=-- From nobody Tue Apr 14 15:59:07 2026 X-Original-To: dev-commits-src-main@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 4fw8964w7Sz6Z2jX for ; Tue, 14 Apr 2026 15:59:22 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw8956vhTz3L27 for ; Tue, 14 Apr 2026 15:59:21 +0000 (UTC) (envelope-from asomers@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=none; arc=pass ("google.com:s=arc-20240605:i=1"); dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.208.46 as permitted sender) smtp.mailfrom=asomers@gmail.com Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-66d65646c65so2951844a12.1 for ; Tue, 14 Apr 2026 08:59:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776182360; cv=none; d=google.com; s=arc-20240605; b=CADisVFCwWDm34z2rp5fU5RPGxH80RXoOwl0YkKjoNDRjZoKlbu+Zr18uMNrL9WHcV gxDRJZbQ0yQynoqRn5sXQYVFBRHu4TCwNn1EYhxM6483tJARrCfiloP0Up5E/ZtzoZJ+ XlX+NlIJetndinQ9HC0BWPjmqv9nzJZd2PWDxfD77dd++VcSUx1JiOikGuNYJPnYmqrv NkEXyyeIwhc62MtLoRHdk7gOHajTL+eHaxxdG5HKfrQNcWyIUyT/Arid9+/LNDqKka7I mayq9dgOCBKipmFgJPNahZEUnXI88RBK9eOoU5O259ZrTsNfaulZ7ulbu5gqMFMrjsDS MHHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:subject:message-id:date:from :in-reply-to:references:mime-version; bh=jxf8/aEjDiN6rsg4Ncu9YJaPGBL6iHR77KBxNbLhgK4=; fh=cDjLFfI510m5ujMCgLSLRu6e/SHEBxod4BPYDO9Rwhk=; b=Uqnfuh5VUcMZXeof5/8pHPu5ebzikpLQPB0gioli/u53zOWXoiDmo2ITsIWJVUlsvJ mybwX245Nun8GTr6ZUuijtbyrs73E6U8A/DJbNSyAHaruzgZQA67T3Suc52FcR133tS2 5DJq0HgneQ27KQr71/GqdUAmgndG7TlqcWOZOYgXTlmCYhyyqsoEVcZWudpSYGNNGPoX KNU2bCagE6PQyoMZsf+N0OAAnTTGPUKB0uMpvXF/5lxHZISnZxIeNYfIpekbS3cORz9D CfAtN+jz16lh8pOkHlyDN8zL1mFvkLiovW13qxwdQ+cQLVEB3XplXcgq4nXnQvRHEdt2 uY4Q==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776182360; x=1776787160; h=content-transfer-encoding:cc:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jxf8/aEjDiN6rsg4Ncu9YJaPGBL6iHR77KBxNbLhgK4=; b=fUZROI5VX4OejVUygPccPx6N1fh7fyu2LmkHz2v27FxjtuHbwOBJ/a6AE/wbXwcTo/ wAPPmxrmMFjk6hZLbJtFvWq/O7afWC9lurRWLaq6yXV8PpS7QWAn4NLixYy8csSukIov 9OCokMq7Z06IhRy5CrH3olWVoEI7b51buDsYmD+dbAk6L1nmVnZcF4XMh4Pc9CgzgcQ/ q7dxXVPRdZwgSROFjcfZ8Oxv4huOZ9RnPsmLUlwk8huqnTgr2psHnH9K+eJm+QK40UXE u86xPaOVYnsomGqQigdYShF8bfSu1qeeH8ulfMRj3nH1XnRKuWiiuQPZq59nI3bjO+lF 6n/g== X-Forwarded-Encrypted: i=1; AFNElJ82NtVYps6fTEEVSNNqJwny8kb/GsWCne+tnYaYZCZWY72m3k3pjDft0ZWhgcuB1vpf9lF4+7aAggDiEc0HM4L+OUHFLA==@freebsd.org X-Gm-Message-State: AOJu0Yxtb7/6I2XwYkfCWWRGnhoHq49ElM90e5NMeElcGcMSI0PJ4dfx x/uaBqz2v6AlFltNjpyBims3nklRTIxhyVPYVcAORGIpypbPe/v7Osmbtbf11exKIi2jsmFeh7R JmpzC6s458mJ6CM9+Z2TOYigjkNg4eHDLT83o X-Gm-Gg: AeBDiesHBqojO8NYZaw0CbNPASA613pbQ2ScX/sgfqEF+UZrPaLUfiKSrFsSYF5zipf zFjtftH5ZFNV3PceHRgT52BKBAV0eANjfeFcI9mqk475eU5gUStPDrQIJZDG8hS+OpkpSkOQ2Eb 78WvNeD7XEFTy45TIzbjfpqmeZncdUntleOf3blDK+aV9jcXAUZeSCk24VFj9heXk6z56tzgg81 g0xPDwDcbMA+qUuxjQV2Lt3DgzDYBTZjp04ba48o9AzhlT/9mZw0gSMAAOJdPGP70GtR3JEF602 ZOxlfFz+knvSfVFKgD8a6/qtX0efgvCwlwogcTIPh9DJql5RQ4Enju25dJ4W/Jh2zho/e3LzAJ/ ntFk= X-Received: by 2002:a05:6402:454a:b0:66e:6f38:47ef with SMTP id 4fb4d7f45d1cf-670752ab0e7mt7007900a12.8.1776182360033; Tue, 14 Apr 2026 08:59:20 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <202508062010.576KA2Mk062184@gitrepo.freebsd.org> <680f1cb7-f8f6-4d40-af31-83e2ea0205d6@FreeBSD.org> In-Reply-To: From: Alan Somers Date: Tue, 14 Apr 2026 09:59:07 -0600 X-Gm-Features: AQROBzDliuCRFuDXQt97Uw597qNeo5cx6cvNwLVliT9gCnYYi-4jf3hVBoLzrBY Message-ID: Subject: Re: git: 66b5296f1b29 - main - ctld: Add support for NVMe over Fabrics Cc: John Baldwin , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [0.11 / 15.00]; MISSING_TO(2.00)[]; ARC_ALLOW(-1.00)[google.com:s=arc-20240605:i=1]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_SPAM_LONG(1.00)[0.997]; NEURAL_HAM_SHORT(-0.99)[-0.990]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MIME_GOOD(-0.10)[text/plain]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), No valid DKIM,none]; RCPT_COUNT_THREE(0.00)[4]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; TO_DN_SOME(0.00)[]; MISSING_XM_UA(0.00)[]; FREEFALL_USER(0.00)[asomers]; FREEMAIL_ENVFROM(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-main@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_ONE(0.00)[1]; MLMMJ_DEST(0.00)[dev-commits-src-main@freebsd.org]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.46:from]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.46:from] X-Rspamd-Queue-Id: 4fw8956vhTz3L27 X-Spamd-Bar: / On Tue, Apr 14, 2026 at 6:35=E2=80=AFAM Alan Somers w= rote: > > On Tue, Apr 14, 2026 at 4:31=E2=80=AFAM John Baldwin wr= ote: > > > > On 4/13/26 13:36, Alan Somers wrote: > > > On Mon, Apr 13, 2026 at 10:56=E2=80=AFAM John Baldwin wrote: > > >> > > >> On 4/13/26 11:51, Alan Somers wrote: > > >>> On Wed, Aug 6, 2025 at 2:10=E2=80=AFPM John Baldwin wrote: > > >>>> > > >>>> The branch main has been updated by jhb: > > >>>> > > >>>> URL: https://cgit.FreeBSD.org/src/commit/?id=3D66b5296f1b29083634e= 2875ff08c32e7b6b866a8 > > >>>> > > >>>> commit 66b5296f1b29083634e2875ff08c32e7b6b866a8 > > >>>> Author: John Baldwin > > >>>> AuthorDate: 2025-08-06 19:57:50 +0000 > > >>>> Commit: John Baldwin > > >>>> CommitDate: 2025-08-06 19:59:13 +0000 > > >>>> > > >>>> ctld: Add support for NVMe over Fabrics > > >>>> > > >>>> While the overall structure is similar for NVMeoF controller= s and > > >>>> iSCSI targets, there are sufficient differences that NVMe su= pport uses > > >>>> an alternate configuration syntax. > > >>>> > > >>>> - In authentication groups, permitted NVMeoF hosts can be al= lowed by > > >>>> names (NQNs) via "host-nqn" values (similar to "initiator-= name" for > > >>>> iSCSI). Similarly, "host-address" accepts permitted host = addresses > > >>>> similar to "initiator-portal" for iSCSI. > > >>>> > > >>>> - A new "transport-group" context enumerates transports that= can be > > >>>> used by a group of NVMeoF controllers similar to the "port= al-group" > > >>>> context for iSCSI. In this section, the "listen" keyword = accepts a > > >>>> transport as well as an address to permit other types of t= ransports > > >>>> besides TCP in the future. The "foreign", "offload", and = "redirect" > > >>>> keywords are also not meaningful and thus not supported. > > >>>> > > >>>> - A new "controller" context describes an NVMeoF I/O control= ler > > >>>> similar to the "target" context for iSCSI. One key differ= ence here > > >>>> is that "lun" objects are replaced by "namespace" objects.= However, > > >>>> a "namespace" can reference a named global lun permitting = LUNs to be > > >>>> shared between iSCSI targets and NVMeoF controllers. > > >>>> > > >>>> NB: Authentication via CHAP is not implemented for NVMeoF. > > >>>> > > >>>> Reviewed by: imp > > >>>> Sponsored by: Chelsio Communications > > >>>> Differential Revision: https://reviews.freebsd.org/D48773 > > >>> ... > > >>>> +struct target * > > >>>> +conf::add_controller(const char *name) > > >>>> +{ > > >>>> + if (!nvmf_nqn_valid_strict(name)) { > > >>>> + log_warnx("controller name \"%s\" is invalid for N= VMe", name); > > >>>> + return nullptr; > > >>>> + } > > >>>> + > > >>>> + /* > > >>>> + * Normalize the name to lowercase to match iSCSI. > > >>>> + */ > > >>>> + std::string t_name(name); > > >>>> + for (char &c : t_name) > > >>>> + c =3D tolower(c); > > >>> ... > > >>> > > >>> This makes it impossible to define an uppercase or mixed case targe= t > > >>> name in ctld. I guess the intent was to comply with rfc3722[^1]? > > >>> Even so, it's surprising, because such target names used to work. > > >>> It's also inconsistent, because it's still possible to create an > > >>> uppercase target name using ctladm directly, like this: > > >>> > > >>> ctladm port -c -d iscsi -O cfiscsi_portal_group_tag=3D257 -O > > >>> cfiscsi_target=3Diqn.2018-10.myhost:TESTVOL1 > > >>> > > >>> Should we warn the user if they specify an uppercase target name, o= r > > >>> even fail to create it? > > >>> > > >>> [^1]: https://datatracker.ietf.org/doc/html/rfc3722 > > >> > > >> Note that this function is for NVMe, not iSCSI. iSCSI targets are c= reated in > > >> conf::add_target which has similar code: > > >> > > >> struct target * > > >> conf::add_target(const char *name) > > >> { > > >> if (!valid_iscsi_name(name, log_warnx)) > > >> return (nullptr); > > >> > > >> /* > > >> * RFC 3722 requires us to normalize the name to lowercase. > > >> */ > > >> std::string t_name(name); > > >> for (char &c : t_name) > > >> c =3D tolower(c); > > >> > > >> Prior to the C++ commit, this change was already in place: > > >> > > >> struct target * > > >> target_new(struct conf *conf, const char *name) > > >> { > > >> struct target *targ; > > >> int i, len; > > >> > > >> targ =3D target_find(conf, name); > > >> if (targ !=3D NULL) { > > >> log_warnx("duplicated target \"%s\"", name); > > >> return (NULL); > > >> } > > >> if (valid_iscsi_name(name, log_warnx) =3D=3D false) { > > >> return (NULL); > > >> } > > >> targ =3D new target(); > > >> targ->t_name =3D checked_strdup(name); > > >> > > >> /* > > >> * RFC 3722 requires us to normalize the name to lowercase. > > >> */ > > >> len =3D strlen(name); > > >> for (i =3D 0; i < len; i++) > > >> targ->t_name[i] =3D tolower(targ->t_name[i]); > > >> > > >> targ->t_conf =3D conf; > > >> TAILQ_INSERT_TAIL(&conf->conf_targets, targ, t_next); > > >> > > >> return (targ); > > >> } > > >> > > >> This was present in commit 009ea47eb2d21856af4529aaaca32cd67748daea > > >> which brought in the iSCSI target, so it has always been present > > >> in ctld. > > >> > > >> Also, AFAICT, the names are still accepted, they are just normalized= . > > >> > > >> I guess one difference is that before, target_new() called target_fi= nd() > > >> with the non-normalized name to check for duplicates, and now we che= ck > > >> for duplicates after normalizing the name. I'm not sure how that wo= rked > > >> in the past in practice as you would have had two targets with the s= ame > > >> name (e.g. I wonder what the ctladm portlist output looked like for = this > > >> case and if it would have listed two ports with the same name)? I s= uspect > > >> that was more by accident and probably didn't work properly in pract= ice > > >> (e.g. the kernel handoff ioctl used the normalized name when invokin= g > > >> CTL_ISCSI, so connections to both "names" probably were always mappe= d to > > >> only one of the connections, and finding a port during login process= ing > > >> probably only found the first target, and only if the initiator gave= the > > >> all-lowercase name). > > >> > > >> That is to say, you didn't get an error before, but it didn't work, = and > > >> now it tells you that it doesn't work AFAICT. > > > > > > Excuse me, I spoke a little too soon. You are correct that ctld has > > > been converting target names to lower case before registering them in > > > the kernel for a long time. The change is that previously, if an > > > initiator attempted to connect to an uppercase target name, ctld woul= d > > > accept it. That's because port_find_in_pg used strcasecmp in > > > stable/14. But change 4b1aac931465f39c5c26bfa1d5539a428d340f20 > > > removed strcasecmp, replacing it by the C++ STL's find method on > > > std::unordered_map. > > > > > > So we used to accept connections case-insensitively, and now we accep= t > > > them case-sensitively. To restore the previous behavior, should we > > > add tolower() on the target_name in iscsi_connection::login() ? > > > > Yes, we should normalize there, and that indeed is my fault and warrant= s > > a Fixes tag. > > > > -- > > John Baldwin > > Ok. I'll take care of it. FYI, I opened this bug, just so other users can find the issue. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D294522 From nobody Tue Apr 14 16:06:03 2026 X-Original-To: dev-commits-src-main@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 4fw8Jr1d7yz6Z3LD for ; Tue, 14 Apr 2026 16:06:04 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw8Jq6dcQz3MNG for ; Tue, 14 Apr 2026 16:06:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776182763; 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=3jVmgSYb7CpQv0UNV2HckNKrJbJkv760ccFi2p8Ex6g=; b=u//RhQzuGiqupgaoWwYH4U7sCVzij7TuOh41Tnx2OW4no2Jpee9xYK1jFBQfOOQVHdWX7R JSNbrRZCoFeU6Y23EETZL9R49n2e6H8wbgD4FruLtvv2WaZCsX7x6ss4i2szzQNw1MwQ2i bTJNYhXzyRR13jLfF7ki6vkMeRrocGab13KHwUorM6D69tR6P2iFuyyOEmoSVOSzmmhyNA 6UWBP5jH9J3n2wHCuD3u0rPmAU2j3dJhWO+qqoZzxEkjAOSc9H6v+O16O7A5/nel1J+1Y4 4mRYFL5mCSWqd9ah+RBRzbJAFYfzW4YSwE9VTAKHKfiHfUBugM5zZBJJ1Z6Mpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776182763; a=rsa-sha256; cv=none; b=B7OvIki7fIB1yabK7Yky9/z0H5KNjc5CQlHRDj0EY7yWe+p5N6B99vM5TH6ZS/dJgrwP9y R3ZwlEdTTPMV7zTgvXUR8Bj4ZvPDwqO07o8DyLfEeQLwZFstM3d9Su+eAvSvg22K88OuW0 gghRyMYoxSBnj/zvYSDebYlvrR0sF8tm/QsxTJskGMzKORJt8+yZbbj1iIrfUVqqj3XocS NSP8GKZ3TAkRKdaNtoUpbm9hhiZ03Ziy3JqqA7xnjhYqmRftuQL3OT70exPZGsKT6wz5mz IBu2uzYSc3ogrT3nnHI/V0Jo1muvzjrYntj5J8dehXYuS0NJTuTmrNJZkufYjA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776182763; 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=3jVmgSYb7CpQv0UNV2HckNKrJbJkv760ccFi2p8Ex6g=; b=ryZeFdYmOI/MGeKNVtvJUyw7AIMZXKRNhxp4XdaTRFIAn2ug/B952rQmXqyjIjVUJ2H6Av LKyAwaVa6R94+fsJe7pgfGfA/1Ov1K5RjZj2STeAO/Qd6652/vH5+GJWMPkUSEXYPnv7AP mT8yaTDT8ztGQVnw331kKqlwWZLe5SKhXltaf6QXe4pBlf05f4Nl9pL5bfAtAes7b5sZ1b 5S4anvQDXjG8VetJYBV0N6AEnsTnli+d9BJWBIgHiIT845vTEFFDqMHFqk7j6vDBUVzXby Z87lYaaJqCLWNvo6ct2OqKk7H8+o7RqUjnqR1THf6yHZuOWbw4aeauOFXOyXEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fw8Jq5r82zxJW for ; Tue, 14 Apr 2026 16:06:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 21a5c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 16:06:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 9b76228006d8 - main - inpcb: retire inp_vnet List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 9b76228006d8f0e45dea03d305eeac587d7a8500 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 16:06:03 +0000 Message-Id: <69de65eb.21a5c.61244c2a@gitrepo.freebsd.org> The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=9b76228006d8f0e45dea03d305eeac587d7a8500 commit 9b76228006d8f0e45dea03d305eeac587d7a8500 Author: Gleb Smirnoff AuthorDate: 2026-04-14 16:02:00 +0000 Commit: Gleb Smirnoff CommitDate: 2026-04-14 16:02:00 +0000 inpcb: retire inp_vnet Now that a functional inpcb can not outlive its socket, just use socket's vnet pointer. --- sys/kern/uipc_ktls.c | 4 ++-- sys/netinet/in_pcb.c | 3 --- sys/netinet/in_pcb.h | 8 -------- sys/netinet/tcp_hpts.c | 2 +- sys/netinet/tcp_timer.c | 10 +++++----- 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 0112cf8b6941..4c3a4085b8db 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -1797,7 +1797,7 @@ ktls_reset_send_tag(void *context, int pending) INP_WLOCK(inp); tp = intotcpcb(inp); if (!(tp->t_flags & TF_DISCONNECTED)) { - CURVNET_SET(inp->inp_vnet); + CURVNET_SET(inp->inp_socket->so_vnet); tp = tcp_drop(tp, ECONNABORTED); CURVNET_RESTORE(); if (tp != NULL) { @@ -2475,7 +2475,7 @@ ktls_drop(struct socket *so, int error) NET_EPOCH_ENTER(et); INP_WLOCK(inp); if (!(tp->t_flags & TF_DISCONNECTED)) { - CURVNET_SET(inp->inp_vnet); + CURVNET_SET(inp->inp_socket->so_vnet); tp = tcp_drop(tp, error); CURVNET_RESTORE(); if (tp != NULL) diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c index af62aea91bf8..22c3287b93fd 100644 --- a/sys/netinet/in_pcb.c +++ b/sys/netinet/in_pcb.c @@ -558,9 +558,6 @@ in_pcbinfo_init(struct inpcbinfo *pcbinfo, struct inpcbstorage *pcbstor, mtx_init(&pcbinfo->ipi_hash_lock, pcbstor->ips_hashlock_name, NULL, MTX_DEF); -#ifdef VIMAGE - pcbinfo->ipi_vnet = curvnet; -#endif CK_LIST_INIT(&pcbinfo->ipi_list_unconn); pcbinfo->ipi_count = 0; diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 8663ba205b0a..1a6ce50aedbb 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -299,7 +299,6 @@ struct xktls_session { #include #include #include -#include #include #include @@ -418,8 +417,6 @@ struct inpcb { }; }; -#define inp_vnet inp_pcbinfo->ipi_vnet - /* * Per-VNET pcb database for each high-level protocol (UDP, TCP, ...) in both * IPv4 and IPv6. @@ -478,11 +475,6 @@ struct inpcbinfo { * hashed by local port. */ struct inpcblbgrouphead *ipi_lbgrouphashbase; /* (r:e/w:h) */ - - /* - * Pointer to network stack instance - */ - struct vnet *ipi_vnet; /* (c) */ }; /* diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c index 8dfbe126d46a..2bb78ed28372 100644 --- a/sys/netinet/tcp_hpts.c +++ b/sys/netinet/tcp_hpts.c @@ -1359,7 +1359,7 @@ again: */ __tcp_set_hpts(pace, tp); } - CURVNET_SET(inp->inp_vnet); + CURVNET_SET(inp->inp_socket->so_vnet); /* Lets do any logging that we might want to */ tcp_hpts_log(hpts, tp, &tv, slots_to_run, i, from_callout); diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c index b409daf5895e..ca242f2be627 100644 --- a/sys/netinet/tcp_timer.c +++ b/sys/netinet/tcp_timer.c @@ -315,7 +315,7 @@ tcp_timer_delack(struct tcpcb *tp) INP_WLOCK_ASSERT(inp); - CURVNET_SET(inp->inp_vnet); + CURVNET_SET(inp->inp_socket->so_vnet); tp->t_flags |= TF_ACKNOW; TCPSTAT_INC(tcps_delack); NET_EPOCH_ENTER(et); @@ -335,7 +335,7 @@ tcp_timer_2msl(struct tcpcb *tp) INP_WLOCK_ASSERT(inp); TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); - CURVNET_SET(inp->inp_vnet); + CURVNET_SET(inp->inp_socket->so_vnet); tcp_log_end_status(tp, TCP_EI_STATUS_2MSL); tcp_free_sackholes(tp); /* @@ -385,7 +385,7 @@ tcp_timer_keep(struct tcpcb *tp) INP_WLOCK_ASSERT(inp); TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); - CURVNET_SET(inp->inp_vnet); + CURVNET_SET(inp->inp_socket->so_vnet); /* * Because we don't regularly reset the keepalive callout in * the ESTABLISHED state, it may be that we don't actually need @@ -493,7 +493,7 @@ tcp_timer_persist(struct tcpcb *tp) INP_WLOCK_ASSERT(inp); TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); - CURVNET_SET(inp->inp_vnet); + CURVNET_SET(inp->inp_socket->so_vnet); /* * Persistence timer into zero window. * Force a byte to be output, if possible. @@ -560,7 +560,7 @@ tcp_timer_rexmt(struct tcpcb *tp) INP_WLOCK_ASSERT(inp); TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); - CURVNET_SET(inp->inp_vnet); + CURVNET_SET(inp->inp_socket->so_vnet); if (tp->t_fb->tfb_tcp_rexmit_tmr) { /* The stack has a timer action too. */ (*tp->t_fb->tfb_tcp_rexmit_tmr)(tp); From nobody Tue Apr 14 16:06:04 2026 X-Original-To: dev-commits-src-main@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 4fw8Js562Yz6Z38b for ; Tue, 14 Apr 2026 16:06:05 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fw8Js0Lkfz3MQr for ; Tue, 14 Apr 2026 16:06:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776182765; 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=gqyr+rVOU7gV0oU2lpSyujy3PXN6Lgigq+6/WKVqD8o=; b=xWlhcFtDI0c7GGFG2PJ4CC0hJOavVKF1uCiniqVOdt5PAWcETCHYowlrJ9Rr4cr7VdQ23L oOljpLEDsuNhL5pJ66GQDrAlIjTTWTHRqzcrV03SlknYi5gGbvThhQTjL1CcugQNH/k9yJ qFgfXgJaayzEQl1rBX+XjRxfCvgnNvO5cDO9bbnG3mHC1TofqQVMLbFLrHvu/kQK1ZRvcr yThSkHH9bPdW9inadVbER52KA9x81NDUW2csHBC+3LpWagH4lGlGjylLAHv+zGBChFVns7 /uaDrc4VnjjUTDPaEG3j9AblwcjfH7CI1RgYjpZ+P9XtxhHG186z2lOAWEDzrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776182765; a=rsa-sha256; cv=none; b=WzN3P9ejzb+Rke7mXtiotOqWEL1+t3cWenj2eyKqaPbNKQTnJW0U8DQN+1Ro6XPdB1/jIy REpkJPEKfWXpe4krMbghKeua8FzOHfS59xhZZtNmNzzb91M3qXelKTenvyaefHlF9kRrzn gn2w/cvaUxwi1UT5Vy0TM39GJKE1TsS5hH0etaCKw9lzPyfRIt/QpnHv9bKuMjVY4EM9em H3vtTCH7+7tLVdz18R9v4Z6nSNPMjTJGnNVn98/PoIwLXzP9MJ5rbZGfNdr64X+YMRMWGe 2xjcVcTy/3RDRRorhm3bRsrpEq+DW1O1oCnub33TlXHdN0/F8hgMNRA3Jcrn8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776182765; 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=gqyr+rVOU7gV0oU2lpSyujy3PXN6Lgigq+6/WKVqD8o=; b=Ml8DAYX9RzC4dMUvPclDZhT6I5oAzrjsZ4qYdWhfNZfeYyekulDdOJw505IoJwYmclW8Wz ou5wy62vuvqvanwwzYJxwbPXjNoyGeth4gKdrnTrfxah+eaGhJsGlu9qr6yLBH/ATY9EGR zu0AijNNV5mdrKHzFXNr4JScsjj2p4GSBx3BGxiMQrCELdNWBhA9T73+LTKGn+ld8Krk5p ZoBptr5cpk343y5zI4zzdBYdExYGIaJVh822uhGJDrtuQN9UAYva65eqvY6YwrFJx+uDQh pGRnToztZdL4HiVZ0TwirkH0l15Rr4BdwwcgkN8OZsiE9yKRoJprX3QqESn6Fw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fw8Jr66LLzxkk for ; Tue, 14 Apr 2026 16:06:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 21176 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 16:06:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 76b90c1d31b9 - main - inpcb: remove last use of relic u_quad_t List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 76b90c1d31b9bbe803f1d521398e0c1a10553a3b Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 16:06:04 +0000 Message-Id: <69de65ec.21176.2738af1d@gitrepo.freebsd.org> The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=76b90c1d31b9bbe803f1d521398e0c1a10553a3b commit 76b90c1d31b9bbe803f1d521398e0c1a10553a3b Author: Gleb Smirnoff AuthorDate: 2026-04-14 16:02:00 +0000 Commit: Gleb Smirnoff CommitDate: 2026-04-14 16:02:00 +0000 inpcb: remove last use of relic u_quad_t --- sys/netinet/in_pcb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 1a6ce50aedbb..f590d464f0ea 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -437,7 +437,7 @@ struct inpcbinfo { * Generation count -- incremented each time a connection is allocated * or freed. */ - u_quad_t ipi_gencnt; /* (h) */ + uint64_t ipi_gencnt; /* (h) */ /* * Fields associated with port lookup and allocation. From nobody Tue Apr 14 17:37:23 2026 X-Original-To: dev-commits-src-main@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 4fwBLD6kC6z6Z933 for ; Tue, 14 Apr 2026 17:37:24 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwBLD5NRQz3fSs for ; Tue, 14 Apr 2026 17:37:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776188244; 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=GKZDvNRFnyDBsN9FG/hQBD0SKawVZmjUMD32WLiLlEg=; b=FC+fpbXQv4LimgCMwMN1eu4oc8/gudfYuxto0YWrCgKPHN+pkMlsIPW1gkFvvEZWfraHKm EKFMJ6GDDX7b/tv0KSlHw+4jls9OBemwCqgTXvvXIoGk6+uwOVUcMsQASZEbjUnBUZdU6/ 7yF9BA42uadpsMt7BMWCyxxt81S/lzWkFzO23TYWiFk4HJEHyZd45I3EQp0lVns2v7a0lK 3bxcNxvIdp5no8t9mlvCaJ9Nes/AGFQLB1tCkgIcRnJ9vMqG8/4y3nnwc71qnFNeKn/G+M O0NA23/cKJva7EuBFDF8S6KG78zjscp13ZloL5tUHVe4PXMQhl5wvcIzSB3vqA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776188244; a=rsa-sha256; cv=none; b=M5qxIANWDW7vahs9q5lcKFoF51PLup+bPVtN4H/Gx7P7Orbl5sJLRBbaGn15MsnAnrFdep oqck/TrKabGwS3EwAdW1J1vqF9DcurU3W+K+IKpHwxUhLuqitYYKbZkMPN2x0Rbuy3q4i4 g3nCz95OhowtYDn5UJt63JqEy1njkrqZssUwuFyfOkUXviRRdMlF/2b8gOJEw/s9qx2JJf Ywe6axHnNxlJqtFgiN2WuBfzKwDfCCQw6TF3TYqUzpERbZ7pke8zhJ+2jPaMP+HM30ZP1Z HI/H+iqlSjzFeMhlIlKq8+QKjgkhX0cGXQ95fEd+cvEvv9s4bqGujGoH0vzjOA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776188244; 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=GKZDvNRFnyDBsN9FG/hQBD0SKawVZmjUMD32WLiLlEg=; b=x4QqAOIV454d05kSF7xszldXbVEdoir53YYGIQ3Y2gQZ5rxBPN+S99yXQ77ncMWI2HQesP dL3wEoyNMzfjLAJ+P7UE7UZ6ZtbALfaCi2Ady4dzLS7HpdgjsH4gVOs+uoqn9viM1OnYnu bCbEvjnsUi/BScBlPDYs6y6u1z0+Z+WeToLqFwgE/xUPCohdfBhrXc+K0WAXP9nLAzKb77 IvdBOtAH6/HqQJgmUTJfQ0yPzvPOd/0yQcwmdDg1PowGw/VvGLhqM0AMCDqmnoiBPsk2FT vyVNVsv8NQoxOc5I/nCgD36jMr7qzX1nbEiHMsP0bDEtNtl9Ge3JXzbcGm7p6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwBLD4gGSz10xZ for ; Tue, 14 Apr 2026 17:37:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3297d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 17:37:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 6dd86310e54d - main - CTL: add ATF tests for REPORT SUPPORTED OPCODES List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6dd86310e54d3f2dd9f688670913b9176176246c Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 17:37:23 +0000 Message-Id: <69de7b53.3297d.5f5c654a@gitrepo.freebsd.org> The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=6dd86310e54d3f2dd9f688670913b9176176246c commit 6dd86310e54d3f2dd9f688670913b9176176246c Author: Alan Somers AuthorDate: 2026-04-14 17:35:54 +0000 Commit: Alan Somers CommitDate: 2026-04-14 17:36:07 +0000 CTL: add ATF tests for REPORT SUPPORTED OPCODES This includes a regression test for CVE-2024-42416 MFC after: 2 weeks Sponsored by: ConnectWise Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D46613 --- tests/sys/cam/ctl/Makefile | 2 + tests/sys/cam/ctl/all-supported-opcodes.txt | 39 +++++ tests/sys/cam/ctl/opcodes.sh | 241 ++++++++++++++++++++++++++++ 3 files changed, 282 insertions(+) diff --git a/tests/sys/cam/ctl/Makefile b/tests/sys/cam/ctl/Makefile index 05f0831fc8b0..4707a2f4b357 100644 --- a/tests/sys/cam/ctl/Makefile +++ b/tests/sys/cam/ctl/Makefile @@ -3,8 +3,10 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/cam/ctl BINDIR=${TESTSDIR} +${PACKAGE}FILES+= all-supported-opcodes.txt ${PACKAGE}FILES+= ctl.subr +ATF_TESTS_SH+= opcodes ATF_TESTS_SH+= persist ATF_TESTS_SH+= prevent ATF_TESTS_SH+= read_buffer diff --git a/tests/sys/cam/ctl/all-supported-opcodes.txt b/tests/sys/cam/ctl/all-supported-opcodes.txt new file mode 100644 index 000000000000..d1725b5a7c80 --- /dev/null +++ b/tests/sys/cam/ctl/all-supported-opcodes.txt @@ -0,0 +1,39 @@ + 00 00 00 02 60 00 00 00 00 00 00 00 06 03 00 00 00 + 10 00 00 00 06 04 00 00 00 00 00 00 06 08 00 00 00 + 20 00 00 00 06 0a 00 00 00 00 00 00 06 12 00 00 00 + 30 00 00 00 06 15 00 00 00 00 00 00 06 16 00 00 00 + 40 00 00 00 06 17 00 00 00 00 00 00 06 1a 00 00 00 + 50 00 00 00 06 1b 00 00 00 00 00 00 06 1e 00 00 00 + 60 00 00 00 06 25 00 00 00 00 00 00 0a 28 00 00 00 + 70 00 00 00 0a 2a 00 00 00 00 00 00 0a 2e 00 00 00 + 80 00 00 00 0a 2f 00 00 00 00 00 00 0a 35 00 00 00 + 90 00 00 00 0a 37 00 00 00 00 00 00 0a 3b 00 00 02 + a0 00 01 00 0a 3c 00 00 02 00 01 00 0a 3c 00 00 03 + b0 00 01 00 0a 3c 00 00 0b 00 01 00 0a 41 00 00 00 + c0 00 00 00 0a 42 00 00 00 00 00 00 0a 4d 00 00 00 + d0 00 00 00 0a 55 00 00 00 00 00 00 0a 56 00 00 00 + e0 00 00 00 0a 57 00 00 00 00 00 00 0a 5a 00 00 00 + f0 00 00 00 0a 5e 00 00 00 00 01 00 0a 5e 00 00 01 + 100 00 01 00 0a 5e 00 00 02 00 01 00 0a 5e 00 00 03 + 110 00 01 00 0a 5f 00 00 00 00 01 00 0a 5f 00 00 01 + 120 00 01 00 0a 5f 00 00 02 00 01 00 0a 5f 00 00 03 + 130 00 01 00 0a 5f 00 00 04 00 01 00 0a 5f 00 00 05 + 140 00 01 00 0a 5f 00 00 06 00 01 00 0a 83 00 00 00 + 150 00 01 00 10 83 00 00 01 00 01 00 10 83 00 00 10 + 160 00 01 00 10 83 00 00 11 00 01 00 10 83 00 00 1c + 170 00 01 00 10 84 00 00 00 00 01 00 10 84 00 00 03 + 180 00 01 00 10 84 00 00 04 00 01 00 10 84 00 00 05 + 190 00 01 00 10 84 00 00 07 00 01 00 10 84 00 00 08 + 1a0 00 01 00 10 88 00 00 00 00 00 00 10 89 00 00 00 + 1b0 00 00 00 10 8a 00 00 00 00 00 00 10 8e 00 00 00 + 1c0 00 00 00 10 8f 00 00 00 00 00 00 10 91 00 00 00 + 1d0 00 00 00 10 93 00 00 00 00 00 00 10 9b 00 00 02 + 1e0 00 01 00 10 9b 00 00 03 00 01 00 10 9b 00 00 0b + 1f0 00 01 00 10 9c 00 00 00 00 00 00 10 9e 00 00 10 + 200 00 01 00 10 9e 00 00 12 00 01 00 10 a0 00 00 00 + 210 00 00 00 0c a3 00 00 05 00 01 00 0c a3 00 00 0a + 220 00 01 00 0c a3 00 00 0c 00 01 00 0c a3 00 00 0d + 230 00 01 00 0c a3 00 00 0f 00 01 00 0c a8 00 00 00 + 240 00 00 00 0c aa 00 00 00 00 00 00 0c ae 00 00 00 + 250 00 00 00 0c af 00 00 00 00 00 00 0c b7 00 00 00 + 260 00 00 00 0c diff --git a/tests/sys/cam/ctl/opcodes.sh b/tests/sys/cam/ctl/opcodes.sh new file mode 100644 index 000000000000..1d558a1095a0 --- /dev/null +++ b/tests/sys/cam/ctl/opcodes.sh @@ -0,0 +1,241 @@ +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Axcient +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS DOCUMENTATION IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# Not Tested +# * Allocation length, because sg3_utils 1.48 does not provide a way to set it. +# * RCTD bit, because CTL does not support it. + +. $(atf_get_srcdir)/ctl.subr + +require_sg_opcodes_version() +{ + WANT=$1 + HAVE=$(sg_opcodes -V 2>&1 | cut -w -f 3) + if [ `echo "$HAVE >= $WANT" | bc -l` = 0 ]; then + atf_skip "This test requires sg_opcodes $WANT or greater" + fi +} + +# Query all supported opcodes. +# NB: the fixture here may need to change frequently, any time CTL gains +# support for new opcodes or service actions. +atf_test_case all_opcodes cleanup +all_opcodes_head() +{ + atf_set "descr" "REPORT SUPPORTED OPCODES can report all supported opcodes" + atf_set "require.user" "root" + atf_set "require.progs" sg_opcodes +} +all_opcodes_body() +{ + create_ramdisk + + atf_check -o file:$(atf_get_srcdir)/all-supported-opcodes.txt sg_opcodes -p disk -nH /dev/$dev +} +all_opcodes_cleanup() +{ + cleanup +} + +# Query support for a single opcode. The REPORTING OPTIONS field will be 1 and +# REQUESTED SERVICE ACTION will be zero. +atf_test_case basic cleanup +basic_head() +{ + atf_set "descr" "REPORT SUPPORTED OPCODES can report a single supported opcode" + atf_set "require.user" "root" + atf_set "require.progs" sg_opcodes +} +basic_body() +{ + create_ramdisk + + atf_check -o inline:" 00 00 03 00 0a 28 1a ff ff ff ff 00 ff ff 07\n" sg_opcodes -o 0x28 -p disk -nH /dev/$dev +} +basic_cleanup() +{ + cleanup +} + +atf_test_case invalid_rep_opts cleanup +invalid_rep_opts_head() +{ + atf_set "descr" "REPORT SUPPORTED OPCODES will fail gracefully if the REPORTING OPTIONS field is set to an invalid value" + atf_set "require.user" "root" + atf_set "require.progs" sg_opcodes +} +invalid_rep_opts_body() +{ + require_sg_opcodes_version 1.03 + create_ramdisk + + atf_check -o ignore -e ignore -s exit:5 sg_opcodes -o 0x28 -p disk -n --rep-opts=4 /dev/$dev +} +invalid_rep_opts_cleanup() +{ + cleanup +} + +# Try to query support for an opcode that needs a service action, but without +# specifying a service action. +atf_test_case missing_service_action cleanup +missing_service_action_head() +{ + atf_set "descr" "REPORT SUPPORTED OPCODES fails gracefully if the service action is omitted" + atf_set "require.user" "root" + atf_set "require.progs" sg_opcodes +} +missing_service_action_body() +{ + create_ramdisk + + atf_check -e ignore -s exit:5 sg_opcodes -o 0x3c -p disk -n /dev/$dev +} +missing_service_action_cleanup() +{ + cleanup +} + +# Regression test for CVE-2024-42416 +atf_test_case out_of_bounds_service_action cleanup +out_of_bounds_service_action_head() +{ + atf_set "descr" "REPORT SUPPORTED OPCODES fails gracefully if the requested service action is out of bounds" + atf_set "require.user" "root" + atf_set "require.progs" sg_opcodes +} +out_of_bounds_service_action_body() +{ + require_sg_opcodes_version 1.03 + create_ramdisk + + # opcode 0 (Test Unit Ready) does not take service actions + # opcode 0x3c (Read Buffer(10)) does take service actions + for opcode in 0 0x3c; do + for ro in 2 3; do + for sa in 32 100 255 256 10000 65535; do + atf_check -s exit:5 -o ignore -e ignore sg_opcodes --rep-opts=$ro -o $opcode -s $sa -p disk -nH /dev/$dev + done + done + done +} +out_of_bounds_service_action_cleanup() +{ + cleanup +} + +# Query support for an opcode that needs a service action +atf_test_case service_action cleanup +service_action_head() +{ + atf_set "descr" "REPORT SUPPORTED OPCODES can query an opcode that needs a service action" + atf_set "require.user" "root" + atf_set "require.progs" sg_opcodes +} +service_action_body() +{ + create_ramdisk + + atf_check -o inline:" 00 00 03 00 0a 3c 02 00 ff ff ff ff ff ff 07\n" sg_opcodes -o 0x3c -s 2 -p disk -nH /dev/$dev +} +service_action_cleanup() +{ + cleanup +} + +# Try to query support for an opcode that does not need a service action, but +# provide one anyway. +atf_test_case unexpected_service_action cleanup +unexpected_service_action_head() +{ + atf_set "descr" "REPORT SUPPORTED OPCODES fails gracefully if an extraneous service action is provided" + atf_set "require.user" "root" + atf_set "require.progs" sg_opcodes +} +unexpected_service_action_body() +{ + create_ramdisk + + atf_check -e ignore -s exit:5 sg_opcodes -o 0x28 -s 1 -p disk -n /dev/$dev +} +unexpected_service_action_cleanup() +{ + cleanup +} + +# Try to query support for an opcode that does not need a service action, but +# provide one anyway. Set REPORTING OPTIONS to 3. This requests that the +# command be reported as unsupported, but REQUEST SUPPORTED OPCODES will return +# successfully. +atf_test_case unexpected_service_action_ro3 cleanup +unexpected_service_action_ro3_head() +{ + atf_set "descr" "REPORT SUPPORTED OPCODES fails gracefully if an extraneous service action is provided, using REPORTING OPTIONS 3" + atf_set "require.user" "root" + atf_set "require.progs" sg_opcodes +} +unexpected_service_action_ro3_body() +{ + require_sg_opcodes_version 1.03 + create_ramdisk + + atf_check -e ignore -o inline:" 00 00 01 00 00\n" sg_opcodes --rep-opts=3 -o 0xb7 -s 1 -p disk -nH /dev/$dev +} +unexpected_service_action_ro3_cleanup() +{ + cleanup +} + +atf_test_case unsupported_opcode cleanup +unsupported_opcode_head() +{ + atf_set "descr" "REPORT SUPPORTED OPCODES can report a single unsupported opcode" + atf_set "require.user" "root" + atf_set "require.progs" sg_opcodes +} +unsupported_opcode_body() +{ + create_ramdisk + + atf_check -o inline:" 00 00 01 00 00\n" sg_opcodes -o 1 -p disk -nH /dev/$dev +} +unsupported_opcode_cleanup() +{ + cleanup +} + + +atf_init_test_cases() +{ + atf_add_test_case all_opcodes + atf_add_test_case basic + atf_add_test_case invalid_rep_opts + atf_add_test_case missing_service_action + atf_add_test_case out_of_bounds_service_action + atf_add_test_case service_action + atf_add_test_case unsupported_opcode + atf_add_test_case unexpected_service_action + atf_add_test_case unexpected_service_action_ro3 +} From nobody Tue Apr 14 17:45:53 2026 X-Original-To: dev-commits-src-main@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 4fwBXH2stnz6ZBWR; Tue, 14 Apr 2026 17:46:07 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwBXH1Dj1z3gs8; Tue, 14 Apr 2026 17:46:07 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776188767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mlfS1GeaMOfLVKZNwE8/94Xf6fhsf6s4RKmF5ExZXzI=; b=HRPkL3W932B6cHkOccIEY5VlMRyQyTbU4wAI8o0ix9m+HoG/O7lh3MBGs+2fPaBNpvujBG 9o3SuTqiNlRKhhZyTeyYxRW4Nu9VGuHoXBcvxb8W/ChVPePIHYT8YrBD+VKq9Io0eurBe6 7Ik2doPhgIPFn3kjpinWTYcQHoF+ndcr9sdO9VekHF2LfBGqEy7ZSaVRSesJ9XWyxS+BUk l6lVzBym8Hzl+qEQym0b7RCCNrZweIuGmeJQ9g75wjc56gUmwFViyW4ijRs6ySVQ5wTub/ O8gzf3JvIaSVlwSfnk8X6/eupwzwOBaWZUQMcpo6rkS369/wsMMQqWTZbvLs4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776188767; a=rsa-sha256; cv=none; b=ZOPyXLzavTJgRTTxxZR1/6Jf7W0lVWrnfLqXAcUS0VXk1zoYH4DQfABe0PMqI6ndOOGday a/Bkis88KuCmUu2FTdPWlYx7Lar10WQL9dHbaTw/FJD9W7U3xE5QHME5flrxWUxJseb2LO noo1qEWqvbDnGue3TpvPvDm1LDqAHJcIdPUAPmTTiEUKLomhh0DnWZG6OJ8QD+Z80Jjku5 biuj1+zvPb5IsPZ/qO9Lztv+kOQs1g4E1NRgoWj1PcWXB0lLchkNqyP+4C6PxRoPrIr/zt 4NnZSGY3z8xgN8V8xf1eG6LJWmbn+OlzR2o3gX2cKajpI2CrDq8kuWddiLsaBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776188767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mlfS1GeaMOfLVKZNwE8/94Xf6fhsf6s4RKmF5ExZXzI=; b=Cx3mCyFqnsTNPtZ2QdurULOyLjuf2cwgBgXZg2XyJ0lrd5ZV6bM/MgQXjhxUMHlTcSaZyw JpYKyothQHouO11Rqo1lfoB3LcxsL+gs36HZ+HV+10uNymDAezEraca3xuHxlHZ8LZEZb3 TWQR7IqnuRCymxTc5W2h/tGohztrZvV0ZKUwZjc1jVQPYNF1gXqrYpjQROjhP5qlQa66bx kwcYAha+pYq7kwoM0UUJt4mbL8u2slQmXYHhxUHaMA/r4tkP3XBNSvg6mlfPwW+vKxWJn5 DFase99xO2jR8biLWR85hIPh0lWF1s1hIHcGQADPwcRkxJITHepNFkTc6Dd0uA== Received: from smtpclient.apple (ns1.oxydns.net [45.32.91.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fwBXD26XTz66K; Tue, 14 Apr 2026 17:46:03 +0000 (UTC) (envelope-from zlei@FreeBSD.org) From: Zhenlei Huang Message-Id: Content-Type: multipart/alternative; boundary="Apple-Mail=_34CB54E6-A347-4C15-86A2-3F0EA7E1F9D0" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: git: e9fc0c538264 - main - if_clone: Make ifnet_detach_sxlock opaque to consumers Date: Wed, 15 Apr 2026 01:45:53 +0800 In-Reply-To: Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: Kristof Provost References: <69dc7394.203c3.3a41c692@gitrepo.freebsd.org> X-Mailer: Apple Mail (2.3696.120.41.1.10) --Apple-Mail=_34CB54E6-A347-4C15-86A2-3F0EA7E1F9D0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 14, 2026, at 11:57 PM, Kristof Provost wrote: >=20 > On 13 Apr 2026, at 6:39, Zhenlei Huang wrote: >=20 > The branch main has been updated by zlei: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3De9fc0c538264355bd3fd9120c6500782= 81c2a290 = > commit e9fc0c538264355bd3fd9120c650078281c2a290 > Author: Zhenlei Huang zlei@FreeBSD.org > AuthorDate: 2026-04-13 04:38:44 +0000 > Commit: Zhenlei Huang zlei@FreeBSD.org > CommitDate: 2026-04-13 04:38:44 +0000 >=20 > if_clone: Make ifnet_detach_sxlock opaque to consumers >=20 > The change e133271fc1b5e introduced ifnet_detach_sxlock, and change > 6d2a10d96fb5 widened its coverage, but there are still consumers, > net80211 and tuntap e.g., want it. Instead of sprinkling it = everywhere, > make it opaque to consumers. >=20 > Out of tree drivers shall also benefit from this change. >=20 > Reviewed by: kp > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D56298 > I don=E2=80=99t really understand why, but this commit causes bricoler = test runs to fail for me. > Or more precisely, it looks like parallel test runs see a number of = failures in the pf tests. >=20 > Reverting only part of this change, specifically this: >=20 > diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c > index db3db78c1b76..d0fe54b6146b 100644 > --- a/sys/net/if_clone.c > +++ b/sys/net/if_clone.c > @@ -683,11 +683,12 @@ if_clone_detach(struct if_clone *ifc) > V_if_cloners_count--; > IF_CLONERS_UNLOCK(); >=20 > - sx_xlock(&ifnet_detach_sxlock); > /* destroy all interfaces for this cloner */ > - while (!LIST_EMPTY(&ifc->ifc_iflist)) > + while (!LIST_EMPTY(&ifc->ifc_iflist)) { > + sx_xlock(&ifnet_detach_sxlock); > if_clone_destroyif_flags(ifc, = LIST_FIRST(&ifc->ifc_iflist), IFC_F_FORCE); > - sx_xunlock(&ifnet_detach_sxlock); > + sx_xunlock(&ifnet_detach_sxlock); > + } >=20 > IF_CLONE_REMREF(ifc); > } > Seems to be enough to avoid the problem. So it looks like somehow = deleting all interfaces for a given cloner under that lock (rather than = releasing it and re-acquiring it) causes the test failures. >=20 >=20 That is interesting. I do not expect a re-acquiring will make any = differences, given ifc_detach_cloner() and / or if_clone_detach() are = basically be invoked by VNET_SYSUNINIT() and vnet_destroy() has = acquired ifnet_detach_sxlock ( I planed to removed the acquiring of it = in vnet_destroy() but not yet done ). So I'd expect an assert = `sx_assert(&ifnet_detach_sxlock, SA_XLOCKED)` in if_clone_detach() will = mostly succeed. Some drivers, for example wg(4), iterate all VNETs and invoke = ifc_detach_cloner() on module unload. That should be the only case that = `ifnet_detach_sxlock` is not recursively acquired, and not acquired = prior to the commit. > The failing tests I see are: >=20 > sys/netpfil/pf/divert-to:in_div -> failed: Test case body returned a = non-ok exit code, but this is not allowed [36.591s] > sys/netpfil/pf/divert-to:in_div_in -> failed: atf-check failed; see = the output of the test for details [30.867s] > sys/netpfil/pf/divert-to:in_div_in_fwd_out_div_out -> failed: = atf-check failed; see the output of the test for details [39.705s] > sys/netpfil/pf/divert-to:in_dn_in_div_in_out_div_out_dn_out -> = failed: atf-check failed; see the output of the test for details = [45.059s] > sys/netpfil/pf/divert-to:out_div -> failed: Test case body returned = a non-ok exit code, but this is not allowed [23.629s] > sys/netpfil/pf/killstate:gateway -> failed: Killing with a different = gateway removed the state. [32.803s] > sys/netpfil/pf/killstate:id -> failed: Killing a different ID = removed the state. [32.789s] > sys/netpfil/pf/killstate:label -> failed: Killing a non-existing = label removed the state. [47.749s] > sys/netpfil/pf/killstate:multilabel -> failed: Setting new rules = removed the state. [43.570s] > sys/netpfil/pf/killstate:src_dst -> failed: Killing with the wrong = destination IP removed our state. [57.819s] > sys/netpfil/pf/killstate:v6 -> failed: Killing with the wrong IP = removed our state. [54.957s] > sys/netpfil/pf/nat64:pool -> failed: atf-check failed; see the = output of the test for details [51.118s] > sys/netpfil/pf/nat64:sctp_in -> failed: Failed to connect to SCTP = server [55.495s] > sys/netpfil/pf/nat64.py:TestNAT64::test_udp_checksum -> failed: = /usr/tests/sys/netpfil/pf/nat64.py:205: AttributeError [80.001s] > sys/netpfil/pf/pflog:matches -> failed: atf-check failed; see the = output of the test for details [61.807s] > sys/netpfil/pf/pflog:matches_logif -> failed: atf-check failed; see = the output of the test for details [51.261s] > sys/netpfil/pf/pflog:unspecified_v6 -> failed: atf-check failed; see = the output of the test for details [36.281s] > sys/netpfil/pf/rdr:srcport_pass -> failed: atf-check failed; see the = output of the test for details [76.815s] > sys/netpfil/pf/sctp:pfsync -> failed: Initial SCTP connection failed = [134.866s] > sys/netpfil/pf/sctp:related_icmp -> failed: SCTP connection failed = [59.620s] > sys/netpfil/pf/table:zero_one -> failed: atf-check failed; see the = output of the test for details [64.125s] > sys/netpfil/pf/tcp:rst -> failed: atf-check failed; see the output = of the test for details [80.261s] > Looking at it now, those runtimes seems suspiciously high as well. >=20 >=20 I noticed that. My local test shows most of them finish in seconds. Some = require more time to finish but still within about 20 seconds. I tested as the following, ``` # kyua test -k Kyuafile pf/divert-to ``` Is the failing tests always fail ? Does the kyua report show anything = useful ? > Best regards, > Kristof >=20 Best regards, Zhenlei --Apple-Mail=_34CB54E6-A347-4C15-86A2-3F0EA7E1F9D0 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

On Apr 14, 2026, at 11:57 PM, Kristof Provost <kp@FreeBSD.org> = wrote:

On 13 Apr 2026, at 6:39, Zhenlei Huang wrote:

The branch main has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=3De9fc0c538264355bd3fd9= 120c650078281c2a290

commit = e9fc0c538264355bd3fd9120c650078281c2a290
Author: Zhenlei Huang zlei@FreeBSD.org
AuthorDate: 2026-04-13 04:38:44 +0000
Commit: Zhenlei Huang zlei@FreeBSD.org
CommitDate: 2026-04-13 04:38:44 +0000

if_clone: Make =
ifnet_detach_sxlock opaque to consumers

The change e133271fc1b5e introduced ifnet_detach_sxlock, and change
6d2a10d96fb5 widened its coverage, but there are still consumers,
net80211 and tuntap e.g., want it. Instead of sprinkling it everywhere,
make it opaque to consumers.

Out of tree drivers shall also benefit from this change.

Reviewed by:    kp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56298

I don=E2=80=99t really = understand why, but this commit causes bricoler test runs to fail for = me.
Or more precisely, it looks like parallel test runs see a number of = failures in the pf tests.

Reverting only = part of this change, specifically this:

diff --git a/sys/net/if_clone.c =
b/sys/net/if_clone.c
index db3db78c1b76..d0fe54b6146b 100644
--- a/sys/net/if_clone.c
+++ b/sys/net/if_clone.c
@@ -683,11 +683,12 @@ if_clone_detach(struct if_clone *ifc)
        V_if_cloners_count--;
        IF_CLONERS_UNLOCK();

-       sx_xlock(&ifnet_detach_sxlock);
        /* destroy all interfaces for this cloner */
-       while (!LIST_EMPTY(&ifc->ifc_iflist))
+       while (!LIST_EMPTY(&ifc->ifc_iflist)) {
+               sx_xlock(&ifnet_detach_sxlock);
                if_clone_destroyif_flags(ifc, =
LIST_FIRST(&ifc->ifc_iflist), IFC_F_FORCE);
-       sx_xunlock(&ifnet_detach_sxlock);
+               sx_xunlock(&ifnet_detach_sxlock);
+       }

        IF_CLONE_REMREF(ifc);
 }

Seems to be enough to avoid the = problem. So it looks like somehow deleting all interfaces for a given = cloner under that lock (rather than releasing it and re-acquiring it) = causes the test failures.



That is interesting. I do not expect a re-acquiring = will make any differences, given ifc_detach_cloner() and / or = if_clone_detach() are basically be invoked by VNET_SYSUNINIT() and =  vnet_destroy() has acquired ifnet_detach_sxlock ( I planed to = removed the acquiring of it in vnet_destroy() but not = yet done ). So I'd expect an assert `sx_assert(&ifnet_detach_sxlock, = SA_XLOCKED)` in if_clone_detach() will mostly = succeed.

Some drivers, for example = wg(4), iterate all VNETs and invoke ifc_detach_cloner() on module = unload. That should be the only case that `ifnet_detach_sxlock` is = not recursively acquired, and not acquired prior = to
the commit.

The failing tests I see are:

sys/netpfil/pf/divert-to:in_div  =
->  failed: Test case body returned a non-ok exit code, but this is =
not allowed  [36.591s]
sys/netpfil/pf/divert-to:in_div_in  ->  failed: atf-check failed; see =
the output of the test for details  [30.867s]
sys/netpfil/pf/divert-to:in_div_in_fwd_out_div_out  ->  failed: =
atf-check failed; see the output of the test for details  [39.705s]
sys/netpfil/pf/divert-to:in_dn_in_div_in_out_div_out_dn_out  ->  =
failed: atf-check failed; see the output of the test for details  =
[45.059s]
sys/netpfil/pf/divert-to:out_div  ->  failed: Test case body returned =
a non-ok exit code, but this is not allowed  [23.629s]
sys/netpfil/pf/killstate:gateway  ->  failed: Killing with a =
different gateway removed the state.  [32.803s]
sys/netpfil/pf/killstate:id  ->  failed: Killing a different ID =
removed the state.  [32.789s]
sys/netpfil/pf/killstate:label  ->  failed: Killing a non-existing =
label removed the state.  [47.749s]
sys/netpfil/pf/killstate:multilabel  ->  failed: Setting new rules =
removed the state.  [43.570s]
sys/netpfil/pf/killstate:src_dst  ->  failed: Killing with the wrong =
destination IP removed our state.  [57.819s]
sys/netpfil/pf/killstate:v6  ->  failed: Killing with the wrong IP =
removed our state.  [54.957s]
sys/netpfil/pf/nat64:pool  ->  failed: atf-check failed; see the =
output of the test for details  [51.118s]
sys/netpfil/pf/nat64:sctp_in  ->  failed: Failed to connect to SCTP =
server  [55.495s]
sys/netpfil/pf/nat64.py:TestNAT64::test_udp_checksum  ->  failed: =
/usr/tests/sys/netpfil/pf/nat64.py:205: AttributeError  [80.001s]
sys/netpfil/pf/pflog:matches  ->  failed: atf-check failed; see the =
output of the test for details  [61.807s]
sys/netpfil/pf/pflog:matches_logif  ->  failed: atf-check failed; see =
the output of the test for details  [51.261s]
sys/netpfil/pf/pflog:unspecified_v6  ->  failed: atf-check failed; =
see the output of the test for details  [36.281s]
sys/netpfil/pf/rdr:srcport_pass  ->  failed: atf-check failed; see =
the output of the test for details  [76.815s]
sys/netpfil/pf/sctp:pfsync  ->  failed: Initial SCTP connection =
failed  [134.866s]
sys/netpfil/pf/sctp:related_icmp  ->  failed: SCTP connection failed  =
[59.620s]
sys/netpfil/pf/table:zero_one  ->  failed: atf-check failed; see the =
output of the test for details  [64.125s]
sys/netpfil/pf/tcp:rst  ->  failed: atf-check failed; see the output =
of the test for details  [80.261s]

Looking at it now, those = runtimes seems suspiciously high as well.



I noticed that. My local test shows most of them finish = in seconds. Some require more time to finish but still within about 20 = seconds.
I tested as the = following,
```
# kyua test -k Kyuafile = pf/divert-to
```

Is the = failing tests always fail ? Does the kyua report show anything useful = ?

Best regards,
Kristof


Best regards,
Zhenlei

= --Apple-Mail=_34CB54E6-A347-4C15-86A2-3F0EA7E1F9D0-- From nobody Tue Apr 14 18:37:18 2026 X-Original-To: dev-commits-src-main@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 4fwCgL5J48z6ZFPY for ; Tue, 14 Apr 2026 18:37:18 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwCgL4JZJz3mL8 for ; Tue, 14 Apr 2026 18:37:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776191838; 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=93if5XhR079HSHdEIawOXwC8TvOPzNDYBWHbP6FMA+U=; b=GXJwitiH4INjQGdwStUUbbAYilwVtFVJZE8/8P+g7cjoy714FlzbjA8kbHtR5DgDZZ7iVm flRtPMTF2bywcvdcmQ/k0R98MRcjw0NTJ5b0k6bcVNKjDDS82X0BT/3XXnoBbC3olb9Ajs 8fKqGYkD92QOkPwpLLe/cCzOcXzzD7W9tbJtaIT6PEMWjcYM3PB872MUf9U/2ZtNBAMNIJ CTK8yJQ20WLG9j0ejkQAzVww8ybQRP2pqmsGDuQ0RYZknVlQyQuykpCfpvXGHFwlo1P2vf o0O1J45uW9ht/kCaFeT3HWVCmi6LHhDoxDUyI5FG2pCEk1oCY9vB+GfuekVADg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776191838; a=rsa-sha256; cv=none; b=mmttAnacv7svukOBhi9RXsrCdFwKOaF5v/oU7SekdkzCsfbojBwkmoE/rPi6KOocZqRqwy Ra28t1vTaVO6KRRa/YfoFrOB64C1tIS2mAJY3uDUIzJswbAREZNbR38UaFra5C7TVr9VHt v+7QNZbt5yypy0y8d8F0Wr+5Q5qUenNKm8IqNfA7sN6xbCBSj2weNeMzMKXmkpNioVbcFa RjXSc2l/5WnFgH2kQuB8ncMDNii/MXcjo/1sEE0b9qPBSLZrl6dE4dNxVRC0ePLBNhmYds toaX149W6CR8KO8qIOY+dnIVTIj7ZvPGG27yDcdwDvylcUgMNzkyW92Y+b57AA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776191838; 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=93if5XhR079HSHdEIawOXwC8TvOPzNDYBWHbP6FMA+U=; b=B881zjbckyuO7WAF0l++nplIfH3BK1Mc5jNpmAeYAe7US/JLioz47PwRdMOneuewbW+n6k xVdmGL5b+GQL67TM6+UBIniayuzd9kJO3cCKB8+K17UpzxnGFizgNL9r0ida4BvOW5tuZP mNylDRjKLx2BLTJ9WVizZzTQKvcGEmj1sOuIcn23K5YncFrVRj6VHLvlSb5LrpPU5g8Vsu ggHZ7dGcS4KAqYsf0EV6o9sbt8GYhU40go5k7LrwP0uXrpL41D0/+XvvvJjduV4bfJ9Z0u zjqgnBY06eCOek7Fam+hy/qBeDUJph2v52FqjtmzjU3hg4OhYk/5JHab976ZKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwCgL3vh2z12cl for ; Tue, 14 Apr 2026 18:37:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 398d0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 18:37:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 4fadf2466468 - main - tcp_close: Use in6_pcbdisconnect for INET6 sockets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 18:37:18 +0000 Message-Id: <69de895e.398d0.7253ff8b@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 commit 4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 Author: John Baldwin AuthorDate: 2026-04-14 18:07:51 +0000 Commit: John Baldwin CommitDate: 2026-04-14 18:07:51 +0000 tcp_close: Use in6_pcbdisconnect for INET6 sockets This also fixes the LINT-NOINET builds. Fixes: 40dbb06fa73c ("inpcb: retire INP_DROPPED and in_pcbdrop()") --- sys/netinet/tcp_subr.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 443af020848f..4adc8d859f3e 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2551,7 +2551,16 @@ tcp_close(struct tcpcb *tp) tcp_timer_stop(tp); if (tp->t_fb->tfb_tcp_timer_stop_all != NULL) tp->t_fb->tfb_tcp_timer_stop_all(tp); +#if defined(INET) && defined(INET6) + if ((inp->inp_vflag & INP_IPV6) != 0) + in6_pcbdisconnect(inp); + else + in_pcbdisconnect(inp); +#elif defined(INET6) + in6_pcbdisconnect(inp); +#else in_pcbdisconnect(inp); +#endif TCPSTAT_INC(tcps_closed); if (tp->t_state != TCPS_CLOSED) tcp_state_change(tp, TCPS_CLOSED); From nobody Tue Apr 14 18:37:19 2026 X-Original-To: dev-commits-src-main@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 4fwCgN1Xhtz6ZFTY for ; Tue, 14 Apr 2026 18:37:20 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwCgM5NKtz3mCX for ; Tue, 14 Apr 2026 18:37:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776191839; 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=vexbBfl2aOGdYpzexChNgkQn4OUZku4D2Ki2s2nhfDg=; b=WB4grNffPj6iRRIOCAJ9v2Xgl4zpds7TmCEqDB4RXC5xqWpnY2OzcEGWB3qX2kJARg7Q2f DlIceQ9ueCYP/Uq9WluBvhsrfkP82NU1x8MdG9nyzbK/EXfFM8W4pohNHb/izV8GJ7rNHN K7IqkQgcYqxKp/qvbnPlvqphAH5YgvJF1kaEMqF8zSs0ijikE5HjgOTRPSTYZ95UR2aLst NrIcAfstnIlOEJ/lJVSZzPP60mcy2OqeNSB6NhQn1uYbJnbTFNOKyRZcI+yO7T1KkinJdt lIJ3Ss3l2ISG8lZp/u5Rahycog0Coft/aUeXq2B5KASOkp63kU0dvyWo90Fi/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776191839; a=rsa-sha256; cv=none; b=d7tuWtI7kOg/7zdCGD1rJzYy1Of3GKZW9qxlISdcnrQVRdE/d+emx+EhUOPqXP8dtLzt8w ANN4XQJa2o0SXqMT01ekKyg0U7SVRVLDbPnknk2pIGj2YEVswd482aJw2/wL2oNWe3p4ig xIg8YZDGRcEp5/iUU+RFnWzEF4LzYeB8bbcS3q8hWYnUS5pRwSSu5G2G0Yjs961XEszQPn kVzMlpJ8XHt8SLaIPuuiGIoGNXu4UariFhemXzVtSSpgfrAP3quKLGLhoBQhFpYXAejmwl /eG7JSF/nOIRvttfhWegweYCy2rPTiTpiK9EeaGHoJc0Pdd9UMrPVASWfub4jA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776191839; 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=vexbBfl2aOGdYpzexChNgkQn4OUZku4D2Ki2s2nhfDg=; b=sWOMCt/Q2RT9c72Vi7EKHknK91v23C4Z+RKaebFmu7SojEscjCEU0JoLRgjBPDia50qxVx RDOq/OkveloSus/9RfELW72O4xpnHPAsxtvGUfwO9d5pyiGwruEbpHLCEYwiSQ97AYHerK NIee+khWOQX/s90ghKd1S+SEvZP9PX0akBLbyRpdRd1yu8R158URIBsrtYA/3eAi7hCnwM 7udCqu2FGz7/rt1Humz1iJMmbeY461rOTYRGCaQwW4p1lTiFh8YaeJ6Pg3mrqXRByhKquB UjqVrQxnsJ7y/C6TgpEmXz6pDOKr0DJcH2m4BkOUb/FZSqE9KO8D17d/LPdfsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwCgM4ghtz12JR for ; Tue, 14 Apr 2026 18:37:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a16c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 18:37:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 0b77f92575cd - main - in_pcb: Fix RIPCB_HASH in kernels without INET or INET6 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0b77f92575cdfecb9920041c7c1d4cc26245e2ec Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 18:37:19 +0000 Message-Id: <69de895f.3a16c.4ab7a80d@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0b77f92575cdfecb9920041c7c1d4cc26245e2ec commit 0b77f92575cdfecb9920041c7c1d4cc26245e2ec Author: John Baldwin AuthorDate: 2026-04-14 18:25:19 +0000 Commit: John Baldwin CommitDate: 2026-04-14 18:25:19 +0000 in_pcb: Fix RIPCB_HASH in kernels without INET or INET6 Only use hashes for protocols that are enabled in the kernel configuration. Fixes: ece716c5d347 ("raw ip: move hash table manipulation to inpcb layer") --- sys/netinet/in_pcb.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index f590d464f0ea..fb52f59ff725 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -591,9 +591,17 @@ VNET_DECLARE(uint32_t, in_pcbhashseed); #define INP_PCBPORTHASH(lport, mask) (ntohs((lport)) & (mask)) +#if defined(INET) && defined(INET6) #define RIPCB_HASH(inp) (((inp)->inp_vflag & INP_IPV6) ? \ IN6_ADDR_JHASH32(&(inp)->in6p_faddr) : \ IN_ADDR_JHASH32(&(inp)->inp_faddr)) +#elif defined(INET6) +#define RIPCB_HASH(inp) \ + IN6_ADDR_JHASH32(&(inp)->in6p_faddr) +#else +#define RIPCB_HASH(inp) \ + IN_ADDR_JHASH32(&(inp)->inp_faddr) +#endif /* * Flags passed to in_pcblookup*(), inp_smr_lock() and inp_next(). From nobody Tue Apr 14 18:37:20 2026 X-Original-To: dev-commits-src-main@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 4fwCgP1yN8z6ZFTc for ; Tue, 14 Apr 2026 18:37:21 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwCgN6D5Bz3lwl for ; Tue, 14 Apr 2026 18:37:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776191840; 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=/f0jge+HYRW6GDYarRBqmxLf7CpSPgHVlj3vm16G8QQ=; b=gCmrwLIN0TSLtErE10/p98Zo/l1hZy4TpMjgC8+Eubewbc1PbK8S/FHZ7nS0BaNnHdxG5Z 1QwCR6sS615iVXxH1PdFmaStxKkd5TudKlFY2L3c2zbts6z52SL4ASpg2qxqEykgLK3cs1 s8iWXcVk/j4lsBp0GrU/duipOHshgBajPXWPhmvH3UtphuqfSA8KsTKbUXzuPRjMMGY1Ba Gu/byeLZ9H+LN2ky+mmqH0c26OvFSfTE/5YuzghYZCGY2MjM+kJMXs5AKZ0IDEI1nl9+l/ kXL8IqKJARQd2pSGhkXDY7Q+799QTTK57uVAeVC/GBpunOKbDl4AWFQ/rp2szA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776191840; a=rsa-sha256; cv=none; b=yFr585S8jba0rYoQfP0SJr316KII5oP0KL/885E66VGOkrde3gf5py2Q1VrfQ4kMh9sEJ3 S8y8GZwUp7GHU/HtwGZbmfTl71nMjxiZWXyvos2tRyLHPVhjOMTdmyIbn9Af2g9j6qNHfz kMjqxJKe40pWtVYHqSt0EPZ+A144wQ1hI3d8r2+ICFdU0s9RAlLO4H5kzRdqugNN2HjYrM vGxtJiWUafCZGw1zwp+AADFWHThPck9/s1k/9A6BsFWrccVkKvDHA5ynpfZSA26pW8ISd9 /cPgo2GG0BhzqEp81eSsRTB5O1jnuu6HA4ilwVpOBYW2+QDlFmV9g0NDI1PEDQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776191840; 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=/f0jge+HYRW6GDYarRBqmxLf7CpSPgHVlj3vm16G8QQ=; b=xkEc2GeRsYIbNCOozzIfdBncWNm0N4wIS9sITk3hRi/I+qf6fgdAnKzNuvpu1L4k6/EuyT joBsDLP8TwcYOUuouE05Gl8T9Y2VnRoHNWehHem6G7yqLeMLx5m92JvU7xl8E9/v3++R+W onsD0gXWvA3a0RZnc0oJbsslClQRyVW1vy5yIvTSjmjxqMuROGyDrYPbXNVrEl1SGpZ0Hp XLH4WHJqzmhMCe5INvoe2LFrVKKfNCVGN1FIZbqpNapXyxDpoZkQMmcn4NyrFxC0yVVBkA tPtkuMgv237RyQ0Q4OVVUtO6c6ajM0vhB+7IieDJeEwlQjwTugnyHk6sBqANuQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwCgN5VC3z12JS for ; Tue, 14 Apr 2026 18:37:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ad29 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 18:37:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: f4e5b45b1162 - main - if_geneve: Fix build without INET or without INET6 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f4e5b45b11628416f596b3aec2ccd3056800a171 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 18:37:20 +0000 Message-Id: <69de8960.3ad29.4ae97873@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f4e5b45b11628416f596b3aec2ccd3056800a171 commit f4e5b45b11628416f596b3aec2ccd3056800a171 Author: John Baldwin AuthorDate: 2026-04-14 18:28:31 +0000 Commit: John Baldwin CommitDate: 2026-04-14 18:28:31 +0000 if_geneve: Fix build without INET or without INET6 --- sys/net/if_geneve.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/sys/net/if_geneve.c b/sys/net/if_geneve.c index 9562a3476099..ab8b313e860a 100644 --- a/sys/net/if_geneve.c +++ b/sys/net/if_geneve.c @@ -429,10 +429,14 @@ static void geneve_encap_header(struct geneve_softc *, struct mbuf *, static uint16_t geneve_get_ethertype(struct mbuf *); static int geneve_inherit_l3_hdr(struct mbuf *, struct geneve_softc *, uint16_t, uint8_t *, uint8_t *, u_short *); +#ifdef INET static int geneve_encap4(struct geneve_softc *, const union sockaddr_union *, struct mbuf *); +#endif +#ifdef INET6 static int geneve_encap6(struct geneve_softc *, const union sockaddr_union *, struct mbuf *); +#endif static int geneve_transmit(struct ifnet *, struct mbuf *); static void geneve_qflush(struct ifnet *); static int geneve_output(struct ifnet *, struct mbuf *, @@ -696,11 +700,13 @@ geneve_ftable_learn(struct geneve_softc *sc, const struct sockaddr *sa, geneve_sockaddr_copy(&unsa, sa); unsa.sin.sin_port = sc->gnv_dst_addr.sin.sin_port; +#ifdef INET6 if (unsa.sa.sa_family == AF_INET6) { error = sa6_embedscope(&unsa.sin6, V_ip6_use_defzone); if (error) return (error); } +#endif GENEVE_RLOCK(sc, &tracker); error = geneve_ftable_update_locked(sc, &unsa, mac, &tracker); @@ -936,10 +942,20 @@ geneve_socket_create(struct ifnet *ifp, int multicast, * must be specified when binding. */ if (multicast != 0) { - if (laddr.sa.sa_family == AF_INET) + switch (laddr.sa.sa_family) { +#ifdef INET + case AF_INET: laddr.sin.sin_addr.s_addr = INADDR_ANY; - else + break; +#endif +#ifdef INET6 + case AF_INET6: laddr.sin6.sin6_addr = in6addr_any; + break; +#endif + default: + return (EAFNOSUPPORT); + } } gnvso = geneve_socket_alloc(&laddr); if (gnvso == NULL) @@ -978,10 +994,20 @@ geneve_socket_mc_lookup(const union sockaddr_union *unsa) laddr = *unsa; - if (laddr.sa.sa_family == AF_INET) + switch (laddr.sa.sa_family) { +#ifdef INET + case AF_INET: laddr.sin.sin_addr.s_addr = INADDR_ANY; - else + break; +#endif +#ifdef INET6 + case AF_INET6: laddr.sin6.sin6_addr = in6addr_any; + break; +#endif + default: + return (NULL); + } return (geneve_socket_lookup(&laddr)); } @@ -1818,11 +1844,13 @@ geneve_set_local_addr_nl(struct geneve_softc *sc, struct nl_pstate *npt, if (error != 0) goto ret; +#ifdef INET6 if (unsa->sa.sa_family == AF_INET6) { error = sa6_embedscope(&unsa->sin6, V_ip6_use_defzone); if (error != 0) goto ret; } +#endif GENEVE_WLOCK(sc); if (geneve_can_change_config(sc)) { @@ -1856,11 +1884,13 @@ geneve_set_remote_addr_nl(struct geneve_softc *sc, struct nl_pstate *npt, if (error != 0) goto ret; +#ifdef INET6 if (unsa->sa.sa_family == AF_INET6) { error = sa6_embedscope(&unsa->sin6, V_ip6_use_defzone); if (error != 0) goto ret; } +#endif GENEVE_WLOCK(sc); if (geneve_can_change_config(sc)) { @@ -2486,6 +2516,7 @@ geneve_inherit_l3_hdr(struct mbuf *m, struct geneve_softc *sc, uint16_t proto, return (0); } +#ifdef INET static int geneve_encap4(struct geneve_softc *sc, const union sockaddr_union *funsa, struct mbuf *m) @@ -2604,7 +2635,9 @@ geneve_encap4(struct geneve_softc *sc, const union sockaddr_union *funsa, return (error); } +#endif +#ifdef INET6 static int geneve_encap6(struct geneve_softc *sc, const union sockaddr_union *funsa, struct mbuf *m) @@ -2744,6 +2777,7 @@ geneve_encap6(struct geneve_softc *sc, const union sockaddr_union *funsa, return (error); } +#endif static int geneve_transmit(struct ifnet *ifp, struct mbuf *m) @@ -2795,12 +2829,20 @@ geneve_transmit(struct ifnet *ifp, struct mbuf *m) GENEVE_ACQUIRE(sc); GENEVE_RUNLOCK(sc, &tracker); - if (af == AF_INET) + switch (af) { +#ifdef INET + case AF_INET: error = geneve_encap4(sc, &unsa, m); - else if (af == AF_INET6) + break; +#endif +#ifdef INET6 + case AF_INET6: error = geneve_encap6(sc, &unsa, m); - else + break; +#endif + default: error = EAFNOSUPPORT; + } geneve_release(sc); if (mcifp != NULL) From nobody Tue Apr 14 18:37:21 2026 X-Original-To: dev-commits-src-main@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 4fwCgQ4MfVz6ZFXF for ; Tue, 14 Apr 2026 18:37:22 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwCgP6jVmz3m8q for ; Tue, 14 Apr 2026 18:37:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776191842; 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=MzxuT4SLmdk2CdJ8zSsNQaG6s7dlkcgLoeqjdUP8LE4=; b=nIZ+jW/ud5QrBAnytcMW5bz310DRAoTyrdZ2CqxiOv2rtAluDEwslnngCaLBwlrpUO4/hU 80DsPw9RyQ+CCFxe4C2Qj/3Nj+o9ScrdCHT+9ZumhaLXz8asyEFjsUJ618o9FIUr6kBP8D V9+UkaWps/pZK5xF7RBONIE1gZPQ1I6z+Y3EEMOIvw3Ecdz2/boYg0wct6lAaPkqeJk821 mz5k8MUhZyX7UDX86EUVVEIYF7rt5LLOCGc8kQbcNKeqVehbvXJE0ZvzpBZauL8cb/JVFB en6p4oTVHKpkQ5RxdKA79I6EmrN8UfszvgwBKZffoQOstiYxTC5r9kTixeA5bQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776191842; a=rsa-sha256; cv=none; b=no42jXRAGT+yo65BEw7RO21/6rq0CxwxZNyE2qH4D89ig2gJLwNf87GQCe6tn/zhKsnOXI 9uA4sLDXjOCSrQfQHlHUeXE+PQmM+Xj88tSo2GRVlI2uYgE1kAK2pDYhNYcv1QVI3l+Tmz 7zVRrKRUv3FP1z8cQhWwowt0H2BRbPRxzNC+3TItiGlYqP4sc+N15BMNGxPhqR2dBLqFhZ nNOxZdJLwa5EdP8F7Jfu5uZLtQqHxFX3ssAXkROqs/LheeQbdSteZD2zE8CduTckRXzxkJ 5eAb5H9pysWv7v0pm7Js+6QNTZYzm/SGXB9DA9YHI1CO1SV+kCFNZUadF+2LVw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776191842; 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=MzxuT4SLmdk2CdJ8zSsNQaG6s7dlkcgLoeqjdUP8LE4=; b=LZcIsvf2wGS6eLPm0k0gGpzWmJKGCVtvOg3LyZGfIjkEitUvb65CIj3lCqwg863qZCQ4Ju ApAEcS3zCfVvedP5042NiyGZsEZfVwbvsIRNOElIaGw77dnu92JYH8BvZsnG2s8IFVySaZ 05nxBOh2EniW2pkaSigvWCKTOXboC32lXRHB1Xd6w7fR2gAJhGqCa2Qy7rtzLYtfFT0yZd EnXZHCdiZ/d8dsI9UD3KhiruDkgUNRpoAQKconk4LhFIBGodjuOekjdAxPQMpEMvmYkOOo rwCMzl0f8Qt5SVS3pJ1y4XUp2LykXgZZ52oE/gjPEyU/bjkf3pxC0n6A03eaBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwCgP6H32z12NN for ; Tue, 14 Apr 2026 18:37:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b661 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 18:37:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c48381df77e1 - main - qcom_gcc: Only build on arm64 for kernels with FDT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c48381df77e15fda271555dcd5ef0cbbbd7cd9bf Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 18:37:21 +0000 Message-Id: <69de8961.3b661.4248ec5e@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c48381df77e15fda271555dcd5ef0cbbbd7cd9bf commit c48381df77e15fda271555dcd5ef0cbbbd7cd9bf Author: John Baldwin AuthorDate: 2026-04-14 18:35:16 +0000 Commit: John Baldwin CommitDate: 2026-04-14 18:35:16 +0000 qcom_gcc: Only build on arm64 for kernels with FDT This fixes the build of the LINT-ACPI kernel. Fixes: 4e3fdced7f78 ("qcom_gcc: migrate the MSM8916 support to qcom_gcc") --- sys/conf/files.arm64 | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index c36a391d75a2..5d1b6e164a51 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -768,20 +768,20 @@ dev/ahci/ahci_fsl_fdt.c optional soc_nxp_ls ahci fdt dev/flash/flexspi/flex_spi.c optional clk flex_spi soc_nxp_ls fdt # Qualcomm -dev/qcom_gcc/qcom_gcc_main.c optional qcom_gcc -dev/qcom_gcc/qcom_gcc_clock.c optional qcom_gcc -dev/qcom_gcc/qcom_gcc_reset.c optional qcom_gcc -dev/qcom_gcc/qcom_gcc_ipq4018_reset.c optional qcom_gcc -dev/qcom_gcc/qcom_gcc_ipq4018_clock.c optional qcom_gcc -dev/qcom_gcc/qcom_gcc_msm8916_reset.c optional qcom_gcc -dev/qcom_gcc/qcom_gcc_msm8916_clock.c optional qcom_gcc -dev/qcom_clk/qcom_clk_fepll.c optional qcom_gcc -dev/qcom_clk/qcom_clk_fdiv.c optional qcom_gcc -dev/qcom_clk/qcom_clk_apssdiv.c optional qcom_gcc -dev/qcom_clk/qcom_clk_freqtbl.c optional qcom_gcc -dev/qcom_clk/qcom_clk_rcg2.c optional qcom_gcc -dev/qcom_clk/qcom_clk_branch2.c optional qcom_gcc -dev/qcom_clk/qcom_clk_ro_div.c optional qcom_gcc +dev/qcom_gcc/qcom_gcc_main.c optional qcom_gcc fdt +dev/qcom_gcc/qcom_gcc_clock.c optional qcom_gcc fdt +dev/qcom_gcc/qcom_gcc_reset.c optional qcom_gcc fdt +dev/qcom_gcc/qcom_gcc_ipq4018_reset.c optional qcom_gcc fdt +dev/qcom_gcc/qcom_gcc_ipq4018_clock.c optional qcom_gcc fdt +dev/qcom_gcc/qcom_gcc_msm8916_reset.c optional qcom_gcc fdt +dev/qcom_gcc/qcom_gcc_msm8916_clock.c optional qcom_gcc fdt +dev/qcom_clk/qcom_clk_fepll.c optional qcom_gcc fdt +dev/qcom_clk/qcom_clk_fdiv.c optional qcom_gcc fdt +dev/qcom_clk/qcom_clk_apssdiv.c optional qcom_gcc fdt +dev/qcom_clk/qcom_clk_freqtbl.c optional qcom_gcc fdt +dev/qcom_clk/qcom_clk_rcg2.c optional qcom_gcc fdt +dev/qcom_clk/qcom_clk_branch2.c optional qcom_gcc fdt +dev/qcom_clk/qcom_clk_ro_div.c optional qcom_gcc fdt dev/qcom_mdio/qcom_mdio_ipq4018.c optional qcom_mdio fdt mdio mii # RockChip Drivers From nobody Tue Apr 14 18:50:35 2026 X-Original-To: dev-commits-src-main@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 4fwCyh2JqRz6ZGWS for ; Tue, 14 Apr 2026 18:50:36 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwCyg5kMvz3qn5 for ; Tue, 14 Apr 2026 18:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776192635; 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=idV52RF56kwLG7daTJ9hvh3a4Mg0tLRVeWJ2Uto3L/8=; b=yPCXW49jceEquWS156Zg9maHvpW8hrTy5m1Nb1mT9bKcc5VLyhPu070JBZ4A4D8qlebU3T PfvNg2c7ySOrQ8eeUI5K26UVGKh5DXWUc0oNzLRv2D8geY3iONtUNziElVGvFn8Py5pATu LGAFhST9NDzgb77bLg4ZnC+o/J3cLg1583fI3QhyfmCekKAtPvPKE2lg634DvdCAKfK5iq 7LInIVZHaSvdE8UJhF8Vv32Ke70qWq1jqPc+8nkho/0+g3hKDGzsAQXWC004ciJthLAyz6 I7HRsyFDB8Afwjj+teghud1/ThePV5xNRC9U0poZm1jIX8Mhl+vQe4n+lhoppA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776192635; a=rsa-sha256; cv=none; b=iCil5qzhgNDFLVuCvRGfNECRNI5TesczdVVbNcOLDiocFpyii3it7Orp4c+Xn7RUk5Q4o5 hvllKweFMqkIdE7md1vbcV/hewEUSFjp7zuZ+9GZhniXz8KbKahTnrrS0POgVoAd+M9s+b EzwMiQMyGljNKZewQZwl08H/v4nl/W3S3izdqln5Su6p4pf8NjfaikQ06srlRDnsnq5LyP pGqn879URDHUUvPE+opokm66oZksUo/u2afOG6CX2uaQVSATTLhhPkpJX3i7blg1wozQRQ xd8dAouIKDLbMQPYPOoCXcaX9BR0GDTvQwcSJG+ZrP630t+WJ3bDHKhXhD4X6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776192635; 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=idV52RF56kwLG7daTJ9hvh3a4Mg0tLRVeWJ2Uto3L/8=; b=kCNbIWcIbdUf2WP54aOltf3H1dwnE+kOGXAxEgU+dgyZ6l+2ILv/dELWq1j0owErYDauhQ bw8DwOsaBXf4M4H9y7cbNnKf2d+8tswJIzraZzprmRFJbgQtgY6TdWEB+aTfVXrIK5aHBG NfIloNp3lxC415cMA+ZNvKhUc9j5hSD7pdSHIUCzgi9M1jyYw9cEgvMYIdpnFyFCaCy3I2 IapmDdqnKnligmVycfg9gcWMlRBSR8Gc29ypZW/cld3hWwviR7+EsBadRugjqmzkaHLNtX a/Fhk7E7ZhPq1foCwBuRqttjPzYdEVHP8kQ0BvN4AMvW+YhlkbYKyuabXhDdyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwCyg5KyRz12QY for ; Tue, 14 Apr 2026 18:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3beba by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 18:50:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 963f1a5455c9 - main - ifconfig: add CMIS support for 400GbE optics List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 963f1a5455c9f94457c1fa122d18ab9c059db834 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 18:50:35 +0000 Message-Id: <69de8c7b.3beba.71fffb46@gitrepo.freebsd.org> The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=963f1a5455c9f94457c1fa122d18ab9c059db834 commit 963f1a5455c9f94457c1fa122d18ab9c059db834 Author: Andrew Gallatin AuthorDate: 2026-04-05 21:43:48 +0000 Commit: Andrew Gallatin CommitDate: 2026-04-14 18:47:56 +0000 ifconfig: add CMIS support for 400GbE optics Add support for CMIS based optics, typically used by 400GbE and faster ethernet optics. The CMIS standard requires paged support for i2c ioctls. This has been tested on an Nvidia ConnectX-7 and Broadcom Thor2 400GbE NIC, and I have verified that optics vendor information, light levels, and temperatures match the information provided by various vendor tools. Differential Revision: https://reviews.freebsd.org/D56265 Reviewed by: kbowling, sumit.saxena_broadcom.com Sponsored by: Netflix --- lib/libifconfig/libifconfig_sfp.c | 228 ++++++++++++++++++- lib/libifconfig/libifconfig_sfp.h | 27 ++- lib/libifconfig/sfp.lua | 120 ++++++++++ sbin/ifconfig/sfp.c | 16 +- sys/net/cmis.h | 450 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 836 insertions(+), 5 deletions(-) diff --git a/lib/libifconfig/libifconfig_sfp.c b/lib/libifconfig/libifconfig_sfp.c index 1ba6d231a992..8deccda5ff76 100644 --- a/lib/libifconfig/libifconfig_sfp.c +++ b/lib/libifconfig/libifconfig_sfp.c @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -114,6 +115,50 @@ read_i2c(struct i2c_info *ii, uint8_t addr, uint8_t off, uint8_t len, return (0); } +/* + * Reads i2c data with CMIS page/bank selection. + * For upper memory (offset >= 128), the page and bank fields select + * which CMIS register page is mapped into the 128-255 address range. + */ +static int +read_i2c_page(struct i2c_info *ii, uint8_t addr, uint8_t page, uint8_t bank, + uint8_t off, uint8_t len, uint8_t *buf) +{ + struct ifi2creq req; + int i, l; + + if (ii->error != 0) + return (ii->error); + + ii->ifr.ifr_data = (caddr_t)&req; + + i = 0; + l = 0; + memset(&req, 0, sizeof(req)); + req.dev_addr = addr; + req.offset = off; + req.len = len; + req.page = page; + req.bank = bank; + + while (len > 0) { + l = MIN(sizeof(req.data), len); + req.len = l; + if (ifconfig_ioctlwrap(ii->h, AF_LOCAL, SIOCGI2CPB, + &ii->ifr) != 0) { + ii->error = errno; + return (errno); + } + + memcpy(&buf[i], req.data, l); + len -= l; + i += l; + req.offset += l; + } + + return (0); +} + static int i2c_info_init(struct i2c_info *ii, ifconfig_handle_t *h, const char *name) { @@ -193,6 +238,61 @@ get_qsfp_info(struct i2c_info *ii, struct ifconfig_sfp_info *sfp) return (ii->error); } +static int +get_cmis_info(struct i2c_info *ii, struct ifconfig_sfp_info *sfp) +{ + uint8_t app_desc[CMIS_APP_DESC_SIZE]; + uint8_t dpconfig, appsel; + uint8_t app_off; + + /* Module ID from lower memory byte 0 */ + read_i2c(ii, CMIS_BASE, CMIS_ID, 1, &sfp->sfp_id); + + /* Connector type from Page 00h byte 203 */ + read_i2c_page(ii, CMIS_BASE, 0x00, 0, + CMIS_P0_CONNECTOR, 1, &sfp->sfp_conn); + + /* Media type from lower memory byte 85 */ + read_i2c(ii, CMIS_BASE, CMIS_MEDIA_TYPE, 1, + &sfp->sfp_cmis_media_type); + + /* + * Read the active AppSel code from the Active Control Set + * (Page 11h, byte 206, bits 7:4). This tells us which + * Application Descriptor is actually in use. + * AppSel is 1-based; 0 means no application selected. + */ + dpconfig = 0; + read_i2c_page(ii, CMIS_BASE, 0x11, 0, + CMIS_P11_ACS_DPCONFIG1, 1, &dpconfig); + appsel = (dpconfig & CMIS_ACS_APPSEL_MASK) >> CMIS_ACS_APPSEL_SHIFT; + + /* Fall back to first descriptor if AppSel is 0 or out of range */ + if (appsel == 0 || appsel > CMIS_MAX_APP_DESC) + appsel = 1; + + /* Read the active Application Descriptor */ + app_off = CMIS_APP_DESC_START + (appsel - 1) * CMIS_APP_DESC_SIZE; + read_i2c(ii, CMIS_BASE, app_off, CMIS_APP_DESC_SIZE, app_desc); + if (ii->error != 0) + return (ii->error); + + /* Store MediaInterfaceID based on media type */ + switch (sfp->sfp_cmis_media_type) { + case SFP_CMIS_MEDIA_TYPE_SMF: + sfp->sfp_cmis_smf = app_desc[CMIS_APP_MEDIA_IF_ID]; + break; + case SFP_CMIS_MEDIA_TYPE_MMF: + sfp->sfp_cmis_mmf = app_desc[CMIS_APP_MEDIA_IF_ID]; + break; + } + + /* Extract media lane count from app descriptor byte 2, bits 3:0 */ + sfp->sfp_cmis_lanes = app_desc[CMIS_APP_LANE_COUNT] & 0x0F; + + return (ii->error); +} + int ifconfig_sfp_get_sfp_info(ifconfig_handle_t *h, const char *name, struct ifconfig_sfp_info *sfp) @@ -205,6 +305,9 @@ ifconfig_sfp_get_sfp_info(ifconfig_handle_t *h, if (i2c_info_init(&ii, h, name) != 0) return (-1); + if (ifconfig_sfp_id_is_cmis(ii.id)) + return (get_cmis_info(&ii, sfp)); + /* Read bytes 3-10 at once */ read_i2c(&ii, SFF_8472_BASE, SFF_8472_TRANS_START, 8, buf); if (ii.error != 0) @@ -246,6 +349,12 @@ channel_count(enum sfp_id id) size_t ifconfig_sfp_channel_count(const struct ifconfig_sfp_info *sfp) { + /* CMIS modules: use lane count from Application Descriptor */ + if (ifconfig_sfp_id_is_cmis(sfp->sfp_id)) { + if (sfp->sfp_cmis_lanes > 0) + return (sfp->sfp_cmis_lanes); + return (0); + } return (channel_count(sfp->sfp_id)); } @@ -291,6 +400,41 @@ get_qsfp_vendor_info(struct i2c_info *ii, struct ifconfig_sfp_vendor_info *vi) return (ii->error); } +/* + * Read CMIS vendor strings from Page 00h (upper memory). + * Vendor info uses the same ASCII format as SFF-8436 but at + * different offsets and requires page selection. + */ +static void +get_cmis_string(struct i2c_info *ii, uint8_t off, char *dst) +{ + read_i2c_page(ii, CMIS_BASE, 0x00, 0, off, + SFF_VENDOR_STRING_SIZE, dst); + dst += SFF_VENDOR_STRING_SIZE; + do { *dst-- = '\0'; } while (*dst == 0x20); +} + +static void +get_cmis_date(struct i2c_info *ii, uint8_t off, char *dst) +{ + char buf[SFF_VENDOR_DATE_SIZE]; + + read_i2c_page(ii, CMIS_BASE, 0x00, 0, off, + SFF_VENDOR_DATE_SIZE, buf); + sprintf(dst, "20%c%c-%c%c-%c%c", buf[0], buf[1], buf[2], buf[3], + buf[4], buf[5]); +} + +static int +get_cmis_vendor_info(struct i2c_info *ii, struct ifconfig_sfp_vendor_info *vi) +{ + get_cmis_string(ii, CMIS_P0_VENDOR_NAME, vi->name); + get_cmis_string(ii, CMIS_P0_VENDOR_PN, vi->pn); + get_cmis_string(ii, CMIS_P0_VENDOR_SN, vi->sn); + get_cmis_date(ii, CMIS_P0_DATE_CODE, vi->date); + return (ii->error); +} + int ifconfig_sfp_get_sfp_vendor_info(ifconfig_handle_t *h, const char *name, struct ifconfig_sfp_vendor_info *vi) @@ -302,6 +446,8 @@ ifconfig_sfp_get_sfp_vendor_info(ifconfig_handle_t *h, if (i2c_info_init(&ii, h, name) != 0) return (-1); + if (ifconfig_sfp_id_is_cmis(ii.id)) + return (get_cmis_vendor_info(&ii, vi)); if (ifconfig_sfp_id_is_qsfp(ii.id)) return (get_qsfp_vendor_info(&ii, vi)); return (get_sfp_vendor_info(&ii, vi)); @@ -457,6 +603,47 @@ get_qsfp_status(struct i2c_info *ii, struct ifconfig_sfp_status *ss) return (ii->error); } +/* + * Read CMIS module status: temperature and voltage from lower memory, + * per-lane TX power, TX bias, and RX power from Page 11h Bank 0. + */ +static int +get_cmis_status(struct i2c_info *ii, struct ifconfig_sfp_status *ss, + size_t channels) +{ + /* Temperature and voltage are in lower memory (same format as SFF) */ + ss->temp = get_sff_temp(ii, CMIS_BASE, CMIS_TEMP); + ss->voltage = get_sff_voltage(ii, CMIS_BASE, CMIS_VCC); + + if (channels == 0) + return (ii->error); + + ss->channel = calloc(channels, sizeof(*ss->channel)); + if (ss->channel == NULL) { + ii->h->error.errtype = OTHER; + ii->h->error.errcode = ENOMEM; + return (-1); + } + + /* Read per-lane monitors from Page 11h Bank 0 */ + for (size_t chan = 0; chan < channels; ++chan) { + uint8_t off; + uint8_t buf[2]; + + /* RX optical power */ + off = CMIS_P11_RX_PWR_1 + chan * CMIS_LANE_MON_SIZE; + read_i2c_page(ii, CMIS_BASE, 0x11, 0, off, 2, buf); + ss->channel[chan].rx = (buf[0] << 8) | buf[1]; + + /* TX bias current */ + off = CMIS_P11_TX_BIAS_1 + chan * CMIS_LANE_MON_SIZE; + read_i2c_page(ii, CMIS_BASE, 0x11, 0, off, 2, buf); + ss->channel[chan].tx = (buf[0] << 8) | buf[1]; + } + + return (ii->error); +} + int ifconfig_sfp_get_sfp_status(ifconfig_handle_t *h, const char *name, struct ifconfig_sfp_status *ss) @@ -468,6 +655,20 @@ ifconfig_sfp_get_sfp_status(ifconfig_handle_t *h, const char *name, if (i2c_info_init(&ii, h, name) != 0) return (-1); + if (ifconfig_sfp_id_is_cmis(ii.id)) { + /* + * For CMIS, we need the lane count from the module info. + * Read the first Application Descriptor to get it. + */ + uint8_t app_desc[CMIS_APP_DESC_SIZE]; + size_t channels; + + read_i2c(&ii, CMIS_BASE, CMIS_APP_DESC_START, + CMIS_APP_DESC_SIZE, app_desc); + channels = app_desc[CMIS_APP_LANE_COUNT] & 0x0F; + return (get_cmis_status(&ii, ss, channels)); + } + if (ifconfig_sfp_id_is_qsfp(ii.id)) return (get_qsfp_status(&ii, ss)); return (get_sfp_status(&ii, ss)); @@ -527,6 +728,21 @@ const char * ifconfig_sfp_physical_spec(const struct ifconfig_sfp_info *sfp, const struct ifconfig_sfp_info_strings *strings) { + /* CMIS modules: look up media interface ID based on media type */ + if (ifconfig_sfp_id_is_cmis(sfp->sfp_id)) { + switch (sfp->sfp_cmis_media_type) { + case SFP_CMIS_MEDIA_TYPE_SMF: + if (strings->sfp_cmis_smf != NULL) + return (strings->sfp_cmis_smf); + break; + case SFP_CMIS_MEDIA_TYPE_MMF: + if (strings->sfp_cmis_mmf != NULL) + return (strings->sfp_cmis_mmf); + break; + } + return ("Unknown"); + } + switch (sfp->sfp_id) { case SFP_ID_UNKNOWN: break; @@ -562,7 +778,14 @@ ifconfig_sfp_get_sfp_dump(ifconfig_handle_t *h, const char *name, if (i2c_info_init(&ii, h, name) != 0) return (-1); - if (ifconfig_sfp_id_is_qsfp(ii.id)) { + if (ifconfig_sfp_id_is_cmis(ii.id)) { + /* Lower memory (0-127), Page 00h (128-255), Page 11h */ + read_i2c(&ii, CMIS_BASE, 0, 128, buf); + read_i2c_page(&ii, CMIS_BASE, 0x00, 0, 128, 128, + buf + 128); + read_i2c_page(&ii, CMIS_BASE, 0x11, 0, 128, 128, + buf + CMIS_DUMP_P11); + } else if (ifconfig_sfp_id_is_qsfp(ii.id)) { read_i2c(&ii, SFF_8436_BASE, QSFP_DUMP0_START, QSFP_DUMP0_SIZE, buf + QSFP_DUMP0_START); read_i2c(&ii, SFF_8436_BASE, QSFP_DUMP1_START, QSFP_DUMP1_SIZE, @@ -580,6 +803,9 @@ ifconfig_sfp_dump_region_count(const struct ifconfig_sfp_dump *dp) { uint8_t id_byte = dp->data[0]; + if (ifconfig_sfp_id_is_cmis((enum sfp_id)id_byte)) + return (3); + switch ((enum sfp_id)id_byte) { case SFP_ID_UNKNOWN: return (0); diff --git a/lib/libifconfig/libifconfig_sfp.h b/lib/libifconfig/libifconfig_sfp.h index 2e5374d6729e..9ed4f684e5c4 100644 --- a/lib/libifconfig/libifconfig_sfp.h +++ b/lib/libifconfig/libifconfig_sfp.h @@ -83,11 +83,15 @@ struct ifconfig_sfp_status { #define QSFP_DUMP1_SIZE 128 /**< bytes in the second region in a QSFP module dump */ +#define CMIS_DUMP_SIZE 512 /**< CMIS dump buffer size */ +#define CMIS_DUMP_P11 256 /**< offset of Page 11h in dump buffer */ + /** SFP module I2C memory dump - * SFP modules have one region, QSFP modules have two regions. + * SFP modules have one region, QSFP modules have two. + * CMIS modules have three: lower memory, Page 00h, and Page 11h. */ struct ifconfig_sfp_dump { - uint8_t data[SFF_DUMP_SIZE]; /**< memory dump data */ + uint8_t data[CMIS_DUMP_SIZE]; /**< memory dump data */ }; /** Get information about the static properties of an SFP/QSFP module @@ -126,6 +130,25 @@ ifconfig_sfp_id_is_qsfp(enum sfp_id id) } } +/** Is the given module ID a CMIS-managed module (QSFP-DD, OSFP, etc.) + * @param id The sfp_id field of a SFP module info object + * @return A bool true if CMIS-type sfp_id otherwise false + */ +static inline bool +ifconfig_sfp_id_is_cmis(enum sfp_id id) +{ + switch (id) { + case SFP_ID_QSFP_DD: + case SFP_ID_QSFP8X: + case SFP_ID_SFP_DD: + case SFP_ID_DSFP: + case SFP_ID_QSFP_CMIS: + return (true); + default: + return (false); + } +} + /** Get string descriptions of the given SFP/QSFP module info * The strings are static and do not need to be freed. * @see ifconfig_sfp_get_sfp_info to obtain the input info. diff --git a/lib/libifconfig/sfp.lua b/lib/libifconfig/sfp.lua index 4a43b2ed780b..1da49e35cade 100644 --- a/lib/libifconfig/sfp.lua +++ b/lib/libifconfig/sfp.lua @@ -359,6 +359,126 @@ enums = { {0x0, "UNSPECIFIED", "Unspecified"}, }, }, + + "CMIS (OIF-CMIS-05.3) Media Type Encodings (Table 8-20)", + { + name = "cmis_media_type", + description = "CMIS media type", + bits = 8, + values = { + {0x00, "UNDEFINED", "Undefined"}, + {0x01, "MMF", "Optical: MMF"}, + {0x02, "SMF", "Optical: SMF"}, + {0x03, "COPPER", "Passive/Linear Active Copper"}, + {0x04, "ACTIVE", "Active Cable"}, + {0x05, "BASET", "BASE-T"}, + }, + }, + + "CMIS Media Lane Count (from Application Descriptor)", + { + name = "cmis_lanes", + description = "CMIS media lane count", + bits = 8, + values = { + {0, "UNKNOWN", "Unknown"}, + {1, "1", "1 lane"}, + {2, "2", "2 lanes"}, + {4, "4", "4 lanes"}, + {8, "8", "8 lanes"}, + }, + }, + + "SFF-8024 Table 4-7: SMF Media Interface IDs (for CMIS MediaType=02h)", + "Verified against SFF-8024 Rev 4.6+ and SONiC sff8024.py", + { + name = "cmis_smf", + description = "CMIS SMF media interface", + bits = 8, + values = { + {0x00, "UNDEFINED", "Undefined"}, + {0x01, "10GBASE_LW", "10GBASE-LW"}, + {0x02, "10GBASE_EW", "10GBASE-EW"}, + {0x03, "10G_ZW", "10G-ZW"}, + {0x04, "10GBASE_LR", "10GBASE-LR"}, + {0x05, "10GBASE_ER", "10GBASE-ER"}, + {0x06, "10G_ZR", "10G-ZR"}, + {0x07, "25GBASE_LR", "25GBASE-LR"}, + {0x08, "25GBASE_ER", "25GBASE-ER"}, + {0x09, "40GBASE_LR4", "40GBASE-LR4"}, + {0x0A, "40GBASE_FR", "40GBASE-FR"}, + {0x0B, "50GBASE_FR", "50GBASE-FR"}, + {0x0C, "50GBASE_LR", "50GBASE-LR"}, + {0x0D, "100GBASE_LR4", "100GBASE-LR4"}, + {0x0E, "100GBASE_ER4", "100GBASE-ER4"}, + {0x0F, "100G_PSM4", "100G PSM4"}, + {0x10, "100G_CWDM4", "100G CWDM4"}, + {0x11, "100G_4WDM_10", "100G 4WDM-10"}, + {0x12, "100G_4WDM_20", "100G 4WDM-20"}, + {0x13, "100G_4WDM_40", "100G 4WDM-40"}, + {0x14, "100GBASE_DR", "100GBASE-DR"}, + {0x15, "100G_FR", "100G-FR/100GBASE-FR1"}, + {0x16, "100G_LR", "100G-LR/100GBASE-LR1"}, + {0x17, "200GBASE_DR4", "200GBASE-DR4"}, + {0x18, "200GBASE_FR4", "200GBASE-FR4"}, + {0x19, "200GBASE_LR4", "200GBASE-LR4"}, + {0x1A, "400GBASE_FR8", "400GBASE-FR8"}, + {0x1B, "400GBASE_LR8", "400GBASE-LR8"}, + {0x1C, "400GBASE_DR4", "400GBASE-DR4"}, + {0x1D, "400G_FR4", "400G-FR4/400GBASE-FR4"}, + {0x1E, "400G_LR4_10", "400G-LR4-10"}, + {0x1F, "8GFC_SM", "8GFC-SM"}, + {0x20, "10GFC_SM", "10GFC-SM"}, + {0x21, "16GFC_SM", "16GFC-SM"}, + {0x22, "32GFC_SM", "32GFC-SM"}, + {0x23, "64GFC_SM", "64GFC-SM"}, + {0x24, "128GFC_PSM4", "128GFC-PSM4"}, + {0x25, "256GFC_PSM4", "256GFC-PSM4"}, + {0x34, "100G_CWDM4_OCP", "100G CWDM4-OCP"}, + {0x3E, "400ZR_DWDM", "400ZR DWDM"}, + {0x40, "50GBASE_ER", "50GBASE-ER"}, + {0x41, "200GBASE_ER4", "200GBASE-ER4"}, + {0x42, "400GBASE_ER8", "400GBASE-ER8"}, + {0x43, "400GBASE_LR4_6", "400GBASE-LR4-6"}, + }, + }, + + "SFF-8024 Table 4-6: MMF Media Interface IDs (for CMIS MediaType=01h)", + "Verified against SFF-8024 Rev 4.6+ and SONiC sff8024.py", + { + name = "cmis_mmf", + description = "CMIS MMF media interface", + bits = 8, + values = { + {0x00, "UNDEFINED", "Undefined"}, + {0x01, "10GBASE_SW", "10GBASE-SW"}, + {0x02, "10GBASE_SR", "10GBASE-SR"}, + {0x03, "25GBASE_SR", "25GBASE-SR"}, + {0x04, "40GBASE_SR4", "40GBASE-SR4"}, + {0x05, "40GE_SWDM4", "40GE SWDM4"}, + {0x06, "40GE_BIDI", "40GE BiDi"}, + {0x07, "50GBASE_SR", "50GBASE-SR"}, + {0x08, "100GBASE_SR10", "100GBASE-SR10"}, + {0x09, "100GBASE_SR4", "100GBASE-SR4"}, + {0x0A, "100GE_SWDM4", "100GE SWDM4"}, + {0x0B, "100GE_BIDI", "100GE BiDi"}, + {0x0C, "100GBASE_SR2", "100GBASE-SR2"}, + {0x0D, "100G_SR", "100G-SR"}, + {0x0E, "200GBASE_SR4", "200GBASE-SR4"}, + {0x0F, "400GBASE_SR16", "400GBASE-SR16"}, + {0x10, "400GBASE_SR8", "400GBASE-SR8"}, + {0x11, "400G_SR4", "400G-SR4"}, + {0x12, "800G_SR8", "800G-SR8"}, + {0x13, "8GFC_MM", "8GFC-MM"}, + {0x14, "10GFC_MM", "10GFC-MM"}, + {0x15, "16GFC_MM", "16GFC-MM"}, + {0x16, "32GFC_MM", "32GFC-MM"}, + {0x17, "64GFC_MM", "64GFC-MM"}, + {0x18, "128GFC_MM4", "128GFC-MM4"}, + {0x19, "256GFC_MM4", "256GFC-MM4"}, + {0x1A, "400GBASE_SR4_2", "400GBASE-SR4.2"}, + }, + }, } -- Nothing else in this context. diff --git a/sbin/ifconfig/sfp.c b/sbin/ifconfig/sfp.c index b51393ea750e..f6400684ba7a 100644 --- a/sbin/ifconfig/sfp.c +++ b/sbin/ifconfig/sfp.c @@ -77,7 +77,9 @@ sfp_status(if_ctx *ctx) printf("\tvendor: %s PN: %s SN: %s DATE: %s\n", vendor_info.name, vendor_info.pn, vendor_info.sn, vendor_info.date); - if (ifconfig_sfp_id_is_qsfp(info.sfp_id)) { + if (ifconfig_sfp_id_is_cmis(info.sfp_id)) { + /* CMIS: no legacy compliance info to show */ + } else if (ifconfig_sfp_id_is_qsfp(info.sfp_id)) { if (verbose > 1) printf("\tcompliance level: %s\n", strings.sfp_rev); } else { @@ -113,7 +115,17 @@ sfp_status(if_ctx *ctx) if (ifconfig_sfp_get_sfp_dump(lifh, ctx->ifname, &dump) == -1) return; - if (ifconfig_sfp_id_is_qsfp(info.sfp_id)) { + if (ifconfig_sfp_id_is_cmis(info.sfp_id)) { + printf("\n\tCMIS DUMP (Lower Memory 0..127):\n"); + hexdump(dump.data, 128, + "\t", HD_OMIT_COUNT | HD_OMIT_CHARS); + printf("\n\tCMIS DUMP (Page 00h 128..255):\n"); + hexdump(dump.data + 128, 128, + "\t", HD_OMIT_COUNT | HD_OMIT_CHARS); + printf("\n\tCMIS DUMP (Page 11h 128..255):\n"); + hexdump(dump.data + CMIS_DUMP_P11, 128, + "\t", HD_OMIT_COUNT | HD_OMIT_CHARS); + } else if (ifconfig_sfp_id_is_qsfp(info.sfp_id)) { printf("\n\tSFF8436 DUMP (0xA0 128..255 range):\n"); hexdump(dump.data + QSFP_DUMP1_START, QSFP_DUMP1_SIZE, "\t", HD_OMIT_COUNT | HD_OMIT_CHARS); diff --git a/sys/net/cmis.h b/sys/net/cmis.h new file mode 100644 index 000000000000..00548a20c051 --- /dev/null +++ b/sys/net/cmis.h @@ -0,0 +1,450 @@ +/*- + * Copyright (c) 2026 Netflix Inc. + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +/* + * The following set of constants are from the OIF Common Management + * Interface Specification (CMIS) revision 5.3, September 2024. + * + * CMIS defines a 256-byte addressable memory with lower (0-127) and + * upper (128-255) regions. Lower memory is always accessible. + * Upper memory is paged via byte 127 (page select) and byte 126 + * (bank select). + * + * All values are read across an I2C bus at address 0xA0. + */ + +#ifndef _NET_CMIS_H_ +#define _NET_CMIS_H_ + +#define CMIS_BASE 0xA0 /* Base I2C address for all requests */ + +/* CMIS Module Types (SFF-8024 Identifier, byte 0) */ +#define CMIS_ID_QSFP_DD 0x18 /* QSFP-DD */ +#define CMIS_ID_QSFP8X 0x19 /* QSFP 8X (OSFP) */ +#define CMIS_ID_SFP_DD 0x1A /* SFP-DD */ +#define CMIS_ID_DSFP 0x1B /* DSFP */ +#define CMIS_ID_QSFP_CMIS 0x1E /* QSFP+ with CMIS */ + +/* Table 8-4: Lower Memory Map (bytes 0x00-0x7F) */ +enum { + /* Table 8-5: Management Characteristics (bytes 0-2) */ + CMIS_ID = 0, /* SFF-8024 Identifier */ + CMIS_REV = 1, /* CMIS revision (major.minor) */ + CMIS_MODULE_TYPE = 2, /* Memory model, config options */ + + /* Table 8-6: Global Status (byte 3) */ + CMIS_MODULE_STATE = 3, /* Module state, interrupt status */ + + /* Table 8-8: Flags Summary (bytes 4-7) */ + CMIS_FLAGS_BANK0 = 4, /* Flags summary, bank 0 */ + CMIS_FLAGS_BANK1 = 5, /* Flags summary, bank 1 */ + CMIS_FLAGS_BANK2 = 6, /* Flags summary, bank 2 */ + CMIS_FLAGS_BANK3 = 7, /* Flags summary, bank 3 */ + + /* Table 8-9: Module-Level Flags (bytes 8-13) */ + CMIS_MOD_FLAGS_START = 8, /* Module firmware/state flags */ + CMIS_MOD_FLAGS_TEMP_VCC = 9, /* Temp/VCC alarm/warning flags */ + CMIS_MOD_FLAGS_AUX = 10, /* Aux monitor alarm/warning flags */ + CMIS_MOD_FLAGS_CUSTOM = 11, /* Custom/Aux3 monitor flags */ + CMIS_MOD_FLAGS_RSVD = 12, /* Reserved */ + CMIS_MOD_FLAGS_VENDOR = 13, /* Custom module-level flags */ + + /* Table 8-10: Module-Level Monitor Values (bytes 14-25) */ + CMIS_TEMP = 14, /* S16 Temperature (1/256 deg C) */ + CMIS_VCC = 16, /* U16 Supply Voltage (100 uV) */ + CMIS_AUX1 = 18, /* S16 Aux1 Monitor */ + CMIS_AUX2 = 20, /* S16 Aux2 Monitor */ + CMIS_AUX3 = 22, /* S16 Aux3 Monitor */ + CMIS_CUSTOM_MON = 24, /* S16/U16 Custom Monitor */ + + /* Table 8-11: Module Global Controls (bytes 26-30) */ + CMIS_MOD_CTRL = 26, /* Global control bits */ + CMIS_MOD_CTRL2 = 27, /* Global control bits (cont.) */ + CMIS_MOD_CTRL3 = 28, /* Global control bits (cont.) */ + CMIS_MOD_CTRL4 = 29, /* Global control bits (cont.) */ + CMIS_MOD_CTRL5 = 30, /* Global control bits (cont.) */ + + /* Table 8-12: Module Level Masks (bytes 31-36) */ + CMIS_MOD_MASKS_START = 31, /* Module-level masks start */ + CMIS_MOD_MASKS_END = 36, /* Module-level masks end */ + + /* Table 8-13: CDB Command Status (bytes 37-38) */ + CMIS_CDB_STATUS1 = 37, /* CDB instance 1 status */ + CMIS_CDB_STATUS2 = 38, /* CDB instance 2 status */ + + /* Table 8-15: Module Active Firmware Version (bytes 39-40) */ + CMIS_FW_VER_MAJOR = 39, /* Active firmware major version */ + CMIS_FW_VER_MINOR = 40, /* Active firmware minor version */ + + /* Table 8-16: Fault Information (byte 41) */ + CMIS_FAULT_CAUSE = 41, /* Fault cause for ModuleFault */ + + /* Table 8-17: Miscellaneous Status (bytes 42-45) */ + CMIS_MISC_STATUS_START = 42, /* Password status, etc. */ + CMIS_MISC_STATUS_END = 45, + + /* Table 8-18: Extended Module Information (bytes 56-63) */ + CMIS_EXT_MOD_INFO_START = 56, + CMIS_EXT_MOD_INFO_END = 63, + + /* Table 8-21: Media Type (byte 85) */ + CMIS_MEDIA_TYPE = 85, /* MediaType encoding */ + + /* Table 8-23: Application Descriptors (bytes 86-117) */ + CMIS_APP_DESC_START = 86, /* First Application Descriptor */ + CMIS_APP_DESC1 = 86, /* AppDescriptor 1 (AppSel 1) */ + CMIS_APP_DESC2 = 90, /* AppDescriptor 2 (AppSel 2) */ + CMIS_APP_DESC3 = 94, /* AppDescriptor 3 (AppSel 3) */ + CMIS_APP_DESC4 = 98, /* AppDescriptor 4 (AppSel 4) */ + CMIS_APP_DESC5 = 102, /* AppDescriptor 5 (AppSel 5) */ + CMIS_APP_DESC6 = 106, /* AppDescriptor 6 (AppSel 6) */ + CMIS_APP_DESC7 = 110, /* AppDescriptor 7 (AppSel 7) */ + CMIS_APP_DESC8 = 114, /* AppDescriptor 8 (AppSel 8) */ + + /* Table 8-24: Password (bytes 118-125) */ + CMIS_PASSWORD_CHANGE = 118, /* Password change entry (4 bytes) */ + CMIS_PASSWORD_ENTRY = 122, /* Password entry area (4 bytes) */ + + /* Table 8-25: Page Mapping (bytes 126-127) */ + CMIS_BANK_SEL = 126, /* Bank select */ + CMIS_PAGE_SEL = 127, /* Page select */ +}; + +/* + * Byte 2 (CMIS_MODULE_TYPE) bit definitions (Table 8-5) + */ +#define CMIS_MODULE_TYPE_FLAT (1 << 7) /* MemoryModel: 1=flat, 0=paged */ +#define CMIS_MODULE_TYPE_STEPPED (1 << 6) /* SteppedConfigOnly */ +#define CMIS_MODULE_TYPE_MCISPEED_MASK 0x3C /* MciMaxSpeed, bits 5:2 */ +#define CMIS_MODULE_TYPE_MCISPEED_SHIFT 2 +#define CMIS_MODULE_TYPE_AUTOCOM_MASK 0x03 /* AutoCommissioning, bits 1:0 */ + +/* MciMaxSpeed values (I2CMCI) */ +#define CMIS_MCISPEED_400KHZ 0 /* Up to 400 kHz */ +#define CMIS_MCISPEED_1MHZ 1 /* Up to 1 MHz */ +#define CMIS_MCISPEED_3_4MHZ 2 /* Up to 3.4 MHz */ + +/* AutoCommissioning values (when SteppedConfigOnly=1) */ +#define CMIS_AUTOCOM_NONE 0x00 /* Neither regular nor hot */ +#define CMIS_AUTOCOM_REGULAR 0x01 /* Only regular (ApplyDPInit) */ +#define CMIS_AUTOCOM_HOT 0x02 /* Only hot (ApplyImmediate) */ + +/* + * Byte 3 (CMIS_MODULE_STATE) bit definitions (Table 8-6) + */ +#define CMIS_MODULE_STATE_MASK 0x0E /* ModuleState, bits 3:1 */ +#define CMIS_MODULE_STATE_SHIFT 1 +#define CMIS_MODULE_STATE_INTL 0x01 /* InterruptDeasserted (bit 0) */ + +/* Table 8-7: Module State Encodings (bits 3:1 of byte 3) */ +#define CMIS_STATE_LOWPWR 1 /* ModuleLowPwr */ +#define CMIS_STATE_PWRUP 2 /* ModulePwrUp */ +#define CMIS_STATE_READY 3 /* ModuleReady */ +#define CMIS_STATE_PWRDN 4 /* ModulePwrDn */ +#define CMIS_STATE_FAULT 5 /* ModuleFault */ + +/* + * Bytes 4-7 (CMIS_FLAGS_BANKn) bit definitions (Table 8-8) + * Same layout for all 4 bank bytes. + */ +#define CMIS_FLAGS_PAGE2CH (1 << 3) /* Flags on Page 2Ch */ +#define CMIS_FLAGS_PAGE14H (1 << 2) /* Flags on Page 14h */ +#define CMIS_FLAGS_PAGE12H (1 << 1) /* Flags on Page 12h */ +#define CMIS_FLAGS_PAGE11H (1 << 0) /* Flags on Page 11h */ + +/* + * Byte 8 (CMIS_MOD_FLAGS_START) bit definitions (Table 8-9) + */ +#define CMIS_FLAG_CDB_COMPLETE2 (1 << 7) /* CdbCmdCompleteFlag2 */ +#define CMIS_FLAG_CDB_COMPLETE1 (1 << 6) /* CdbCmdCompleteFlag1 */ +#define CMIS_FLAG_DP_FW_ERROR (1 << 2) /* DataPathFirmwareErrorFlag */ +#define CMIS_FLAG_MOD_FW_ERROR (1 << 1) /* ModuleFirmwareErrorFlag */ +#define CMIS_FLAG_STATE_CHANGED (1 << 0) /* ModuleStateChangedFlag */ + +/* + * Byte 9 (CMIS_MOD_FLAGS_TEMP_VCC) bit definitions (Table 8-9) + */ +#define CMIS_FLAG_VCC_LOW_WARN (1 << 7) /* VccMonLowWarningFlag */ +#define CMIS_FLAG_VCC_HIGH_WARN (1 << 6) /* VccMonHighWarningFlag */ +#define CMIS_FLAG_VCC_LOW_ALM (1 << 5) /* VccMonLowAlarmFlag */ +#define CMIS_FLAG_VCC_HIGH_ALM (1 << 4) /* VccMonHighAlarmFlag */ +#define CMIS_FLAG_TEMP_LOW_WARN (1 << 3) /* TempMonLowWarningFlag */ +#define CMIS_FLAG_TEMP_HIGH_WARN (1 << 2) /* TempMonHighWarningFlag */ +#define CMIS_FLAG_TEMP_LOW_ALM (1 << 1) /* TempMonLowAlarmFlag */ +#define CMIS_FLAG_TEMP_HIGH_ALM (1 << 0) /* TempMonHighAlarmFlag */ + +/* + * Byte 10 (CMIS_MOD_FLAGS_AUX) bit definitions (Table 8-9) + */ +#define CMIS_FLAG_AUX2_LOW_WARN (1 << 7) +#define CMIS_FLAG_AUX2_HIGH_WARN (1 << 6) +#define CMIS_FLAG_AUX2_LOW_ALM (1 << 5) +#define CMIS_FLAG_AUX2_HIGH_ALM (1 << 4) +#define CMIS_FLAG_AUX1_LOW_WARN (1 << 3) +#define CMIS_FLAG_AUX1_HIGH_WARN (1 << 2) +#define CMIS_FLAG_AUX1_LOW_ALM (1 << 1) +#define CMIS_FLAG_AUX1_HIGH_ALM (1 << 0) + +/* + * Byte 11 (CMIS_MOD_FLAGS_CUSTOM) bit definitions (Table 8-9) + */ +#define CMIS_FLAG_CUST_LOW_WARN (1 << 7) +#define CMIS_FLAG_CUST_HIGH_WARN (1 << 6) +#define CMIS_FLAG_CUST_LOW_ALM (1 << 5) +#define CMIS_FLAG_CUST_HIGH_ALM (1 << 4) +#define CMIS_FLAG_AUX3_LOW_WARN (1 << 3) +#define CMIS_FLAG_AUX3_HIGH_WARN (1 << 2) +#define CMIS_FLAG_AUX3_LOW_ALM (1 << 1) +#define CMIS_FLAG_AUX3_HIGH_ALM (1 << 0) + +/* + * Byte 26 (CMIS_MOD_CTRL) bit definitions (Table 8-11) + */ +#define CMIS_CTRL_BANK_BCAST (1 << 7) /* BankBroadcastEnable */ +#define CMIS_CTRL_LOWPWR_HW (1 << 6) /* LowPwrAllowRequestHW */ +#define CMIS_CTRL_SQUELCH_METHOD (1 << 5) /* SquelchMethodSelect */ +#define CMIS_CTRL_LOWPWR_SW (1 << 4) /* LowPwrRequestSW */ +#define CMIS_CTRL_SW_RESET (1 << 3) /* SoftwareReset */ + +/* + * Byte 27 (CMIS_MOD_CTRL2) bit definitions (Table 8-11) + */ +#define CMIS_CTRL2_MCISPEED_MASK 0x0F /* MciSpeedConfiguration, bits 3:0 */ + +/* + * Bytes 31-36 mask bits mirror bytes 8-13 flag bits (Table 8-12) + * Use the same bit positions as CMIS_FLAG_* above. + */ + +/* + * Bytes 37-38 (CDB Status) bit definitions (Table 8-14) + */ +#define CMIS_CDB_BUSY (1 << 7) /* CdbIsBusy */ +#define CMIS_CDB_FAILED (1 << 6) /* CdbHasFailed */ +#define CMIS_CDB_RESULT_MASK 0x3F /* CdbCommandResult, bits 5:0 */ + +/* Table 8-20: Media Type Encodings */ +#define CMIS_MEDIA_TYPE_UNDEF 0x00 /* Undefined */ +#define CMIS_MEDIA_TYPE_MMF 0x01 /* Optical: MMF */ +#define CMIS_MEDIA_TYPE_SMF 0x02 /* Optical: SMF */ +#define CMIS_MEDIA_TYPE_COPPER 0x03 /* Passive/Active Copper */ +#define CMIS_MEDIA_TYPE_ACTIVE 0x04 /* Active Cable */ +#define CMIS_MEDIA_TYPE_BASET 0x05 /* BASE-T */ + +/* Application Descriptor constants */ +#define CMIS_APP_DESC_SIZE 4 /* Bytes per descriptor */ +#define CMIS_MAX_APP_DESC 8 /* Max descriptors in lower memory */ + +/* Table 8-22: Offsets within an Application Descriptor */ +#define CMIS_APP_HOST_IF_ID 0 /* HostInterfaceID */ +#define CMIS_APP_MEDIA_IF_ID 1 /* MediaInterfaceID */ +#define CMIS_APP_LANE_COUNT 2 /* Host[7:4], Media[3:0] */ +#define CMIS_APP_HOST_ASSIGN 3 /* HostLaneAssignment */ +#define CMIS_APP_HOST_LANES_MASK 0xF0 /* HostLaneCount, bits 7:4 */ +#define CMIS_APP_HOST_LANES_SHIFT 4 +#define CMIS_APP_MEDIA_LANES_MASK 0x0F /* MediaLaneCount, bits 3:0 */ + +/* + * Table 8-26: Page 00h - Administrative Information + * Accessed with page=0x00, bank=0. + */ +enum { + CMIS_P0_ID = 128, /* SFF-8024 Identifier copy */ + CMIS_P0_VENDOR_NAME = 129, /* Vendor name (16 bytes, ASCII) */ + CMIS_P0_VENDOR_OUI = 145, /* Vendor IEEE OUI (3 bytes) */ + CMIS_P0_VENDOR_PN = 148, /* Part number (16 bytes, ASCII) */ + CMIS_P0_VENDOR_REV = 164, /* Vendor revision (2 bytes) */ + CMIS_P0_VENDOR_SN = 166, /* Serial number (16 bytes, ASCII) */ + CMIS_P0_DATE_CODE = 182, /* Date code (8 bytes: YYMMDDLL) */ + CMIS_P0_CLEI = 190, /* CLEI code (10 bytes, ASCII) */ + CMIS_P0_MOD_POWER = 200, /* Module power class */ + CMIS_P0_MAX_POWER = 201, /* Max power (multiples of 0.25W) */ + CMIS_P0_CABLE_LEN = 202, /* Cable assembly link length */ + CMIS_P0_CONNECTOR = 203, /* Connector type (SFF-8024) */ + CMIS_P0_COPPER_ATTEN = 204, /* Copper cable attenuation (6 bytes) */ + CMIS_P0_MEDIA_LANE_INFO = 210, /* Supported near end media lanes */ + CMIS_P0_CABLE_ASM_INFO = 211, /* Far end breakout info */ + CMIS_P0_MEDIA_TECH = 212, /* Media interface technology */ + CMIS_P0_MCI_ADVERT = 213, /* MCI advertisement (2 bytes) */ + CMIS_P0_PAGE_CKSUM = 222, /* Page checksum (bytes 128-221) */ + CMIS_P0_CUSTOM = 223, /* Custom (33 bytes) */ +}; + +/* + * Table 8-82: Page 11h - Lane Status and Data Path Status + * Accessed with page=0x11, bank=0 (lanes 1-8). + */ +enum { + /* Table 8-83: Data Path States (bytes 128-131) */ + CMIS_P11_DPSTATE_12 = 128, /* DPState for host lanes 1-2 */ + CMIS_P11_DPSTATE_34 = 129, /* DPState for host lanes 3-4 */ + CMIS_P11_DPSTATE_56 = 130, /* DPState for host lanes 5-6 */ + CMIS_P11_DPSTATE_78 = 131, /* DPState for host lanes 7-8 */ + + /* Table 8-85: Lane Output Status (bytes 132-133) */ + CMIS_P11_OUTPUT_RX = 132, /* OutputStatusRx per lane */ + CMIS_P11_OUTPUT_TX = 133, /* OutputStatusTx per lane */ + + /* Table 8-86: State Changed Flags (bytes 134-135) */ + CMIS_P11_DPSTATE_CHGD = 134, /* DPStateChanged flags */ + CMIS_P11_OUTPUT_CHGD_TX = 135, /* OutputStatusChangedTx flags*/ + + /* Table 8-87: Lane-Specific Tx Flags (bytes 136-141) */ + CMIS_P11_TX_FAULT = 136, /* TxFault per lane */ + CMIS_P11_TX_LOS = 137, /* TxLOS per lane */ + CMIS_P11_TX_CDR_LOL = 138, /* TxCDRLOL per lane */ + CMIS_P11_TX_ADPT_EQ_FAIL = 139, /* TxAdaptEqFail per lane */ + CMIS_P11_TX_PWR_HIGH_ALM = 140, /* TxPowerHighAlarm per lane */ + CMIS_P11_TX_PWR_LOW_ALM = 141, /* TxPowerLowAlarm per lane */ + CMIS_P11_TX_BIAS_HIGH_ALM = 142, /* TxBiasHighAlarm per lane */ + CMIS_P11_TX_BIAS_LOW_ALM = 143, /* TxBiasLowAlarm per lane */ + CMIS_P11_TX_PWR_HIGH_WARN = 144, /* TxPowerHighWarning per lane*/ + CMIS_P11_TX_PWR_LOW_WARN = 145, /* TxPowerLowWarning per lane */ + CMIS_P11_TX_BIAS_HIGH_WARN = 146, /* TxBiasHighWarning per lane */ + CMIS_P11_TX_BIAS_LOW_WARN = 147, /* TxBiasLowWarning per lane */ + + /* Table 8-88: Rx Flags (bytes 148-153) */ + CMIS_P11_RX_LOS = 148, /* RxLOS per lane */ + CMIS_P11_RX_CDR_LOL = 149, /* RxCDRLOL per lane */ + CMIS_P11_RX_PWR_HIGH_ALM = 150, /* RxPowerHighAlarm per lane */ + CMIS_P11_RX_PWR_LOW_ALM = 151, /* RxPowerLowAlarm per lane */ + CMIS_P11_RX_PWR_HIGH_WARN = 152, /* RxPowerHighWarning per lane*/ + CMIS_P11_RX_PWR_LOW_WARN = 153, /* RxPowerLowWarning per lane */ + + /* Table 8-89: Lane-Specific Monitors (bytes 154-201) */ + CMIS_P11_TX_PWR_1 = 154, /* U16 Tx optical pwr, lane 1 */ + CMIS_P11_TX_PWR_2 = 156, /* (0.1 uW increments) */ + CMIS_P11_TX_PWR_3 = 158, + CMIS_P11_TX_PWR_4 = 160, + CMIS_P11_TX_PWR_5 = 162, + CMIS_P11_TX_PWR_6 = 164, + CMIS_P11_TX_PWR_7 = 166, + CMIS_P11_TX_PWR_8 = 168, + CMIS_P11_TX_BIAS_1 = 170, /* U16 Tx bias current, lane 1*/ + CMIS_P11_TX_BIAS_2 = 172, /* (2 uA increments) */ + CMIS_P11_TX_BIAS_3 = 174, + CMIS_P11_TX_BIAS_4 = 176, + CMIS_P11_TX_BIAS_5 = 178, + CMIS_P11_TX_BIAS_6 = 180, + CMIS_P11_TX_BIAS_7 = 182, + CMIS_P11_TX_BIAS_8 = 184, + CMIS_P11_RX_PWR_1 = 186, /* U16 Rx input power, lane 1 */ + CMIS_P11_RX_PWR_2 = 188, /* (0.1 uW increments) */ + CMIS_P11_RX_PWR_3 = 190, + CMIS_P11_RX_PWR_4 = 192, + CMIS_P11_RX_PWR_5 = 194, + CMIS_P11_RX_PWR_6 = 196, + CMIS_P11_RX_PWR_7 = 198, + CMIS_P11_RX_PWR_8 = 200, + + /* Table 8-90: Config Command Status (bytes 202-205) */ + CMIS_P11_CONFIG_STAT_12 = 202, /* ConfigStatus lanes 1-2 */ + CMIS_P11_CONFIG_STAT_34 = 203, /* ConfigStatus lanes 3-4 */ + CMIS_P11_CONFIG_STAT_56 = 204, /* ConfigStatus lanes 5-6 */ + CMIS_P11_CONFIG_STAT_78 = 205, /* ConfigStatus lanes 7-8 */ + + /* Table 8-93: Active Control Set (bytes 206-234) */ + CMIS_P11_ACS_DPCONFIG1 = 206, /* DPConfigLane1 (AppSel[7:4])*/ + CMIS_P11_ACS_DPCONFIG2 = 207, /* DPConfigLane2 */ + CMIS_P11_ACS_DPCONFIG3 = 208, /* DPConfigLane3 */ + CMIS_P11_ACS_DPCONFIG4 = 209, /* DPConfigLane4 */ + CMIS_P11_ACS_DPCONFIG5 = 210, /* DPConfigLane5 */ + CMIS_P11_ACS_DPCONFIG6 = 211, /* DPConfigLane6 */ + CMIS_P11_ACS_DPCONFIG7 = 212, /* DPConfigLane7 */ + CMIS_P11_ACS_DPCONFIG8 = 213, /* DPConfigLane8 */ + CMIS_P11_ACS_TX_START = 214, /* Provisioned Tx Controls */ + CMIS_P11_ACS_TX_END = 225, + CMIS_P11_ACS_RX_START = 226, /* Provisioned Rx Controls */ + CMIS_P11_ACS_RX_END = 234, + + /* Table 8-96: Data Path Conditions (bytes 235-239) */ + CMIS_P11_DP_COND_START = 235, + CMIS_P11_DP_COND_END = 239, + + /* Table 8-97: Media Lane Mapping (bytes 240-255) */ + CMIS_P11_MEDIA_MAP_START = 240, + CMIS_P11_MEDIA_MAP_END = 255, +}; + +/* + * Per-lane bit positions for Page 11h flag/status registers. + * Bytes 132-153 use bit N for lane N+1 (bit 7 = lane 8, bit 0 = lane 1). + */ +#define CMIS_LANE8 (1 << 7) +#define CMIS_LANE7 (1 << 6) +#define CMIS_LANE6 (1 << 5) +#define CMIS_LANE5 (1 << 4) +#define CMIS_LANE4 (1 << 3) +#define CMIS_LANE3 (1 << 2) +#define CMIS_LANE2 (1 << 1) +#define CMIS_LANE1 (1 << 0) + +/* + * DPState encoding within bytes 128-131 (Table 8-83). + * Each byte holds two 4-bit DPState fields: + * bits 7:4 = even lane, bits 3:0 = odd lane. + */ +#define CMIS_DPSTATE_HI_MASK 0xF0 /* Upper nibble (even lane) */ +#define CMIS_DPSTATE_HI_SHIFT 4 +#define CMIS_DPSTATE_LO_MASK 0x0F /* Lower nibble (odd lane) */ + +/* Table 8-84: Data Path State Encoding */ +#define CMIS_DPSTATE_DEACTIVATED 1 /* DPDeactivated (or unused) */ +#define CMIS_DPSTATE_INIT 2 /* DPInit */ +#define CMIS_DPSTATE_DEINIT 3 /* DPDeinit */ +#define CMIS_DPSTATE_ACTIVATED 4 /* DPActivated */ +#define CMIS_DPSTATE_TXTURNON 5 /* DPTxTurnOn */ +#define CMIS_DPSTATE_TXTURNOFF 6 /* DPTxTurnOff */ +#define CMIS_DPSTATE_INITIALIZED 7 /* DPInitialized */ + +/* + * ConfigStatus encoding within bytes 202-205 (Table 8-90/91). + * Each byte holds two 4-bit status fields, same nibble layout as DPState. + */ +#define CMIS_CFGSTAT_UNDEFINED 0x0 /* Undefined */ +#define CMIS_CFGSTAT_SUCCESS 0x1 /* ConfigSuccess */ +#define CMIS_CFGSTAT_REJECTED 0x2 /* ConfigRejected */ +#define CMIS_CFGSTAT_REJECTEDINV 0x3 /* ConfigRejectedInvalidAppSel*/ +#define CMIS_CFGSTAT_INPROGRESS 0x4 /* ConfigInProgress */ +#define CMIS_CFGSTAT_REJECTEDLANE 0x5 /* ConfigRejectedInvalidLane */ +#define CMIS_CFGSTAT_REJECTEDEQ 0x6 /* ConfigRejectedInvalidEq */ + +/* DPConfigLane (CMIS_P11_ACS_DPCONFIGn) bit definitions (Table 8-92/93) */ +#define CMIS_ACS_APPSEL_MASK 0xF0 /* AppSel code, bits 7:4 */ +#define CMIS_ACS_APPSEL_SHIFT 4 +#define CMIS_ACS_DATAPATH_MASK 0x0F /* DataPathID, bits 3:0 */ + +/* *** 30 LINES SKIPPED *** From nobody Tue Apr 14 18:50:36 2026 X-Original-To: dev-commits-src-main@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 4fwCyj3PR3z6ZGSp for ; Tue, 14 Apr 2026 18: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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwCyj1b4gz3qn9 for ; Tue, 14 Apr 2026 18:50:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776192637; 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=Gs/7TQWjCVTeKY9qb/dL4uQ2TXL3uMB/HpzykuFxAhc=; b=jJQauRF/HYxKJsH+R/Zv3gm0ELnFLlm0v7ZTcc/V8o4J2WlVqUW2dHexR4ryxlaT0GCZZI kke9mbYJhlrn6PZqCF7mhwb7Y/9VORLg/wHlK2ZoTSAu+0TqdKyFJkU/dCqJc4Hwf/6Fmx QzEbZSpmjdlPKOIkitn+nLdMp4rZoFjat38SQiy9PXnHGyMed1mrWEgmWjXk57oWKdElBH B4v97DQqvsbgilavwsfK5bKNV/+bLR2s29yZLlMtmoHvohPquUIgPPlYg/+Own7AHdjUA3 CecOga0FZDXVn+96BY+UNjAgaOnscEsmoOJf+f46Nd0y0SNXrAfgnS52jj66Eg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776192637; a=rsa-sha256; cv=none; b=Aw+vXCDomPDDYuLEiEU/w0OraSyp15YgD7uGUFdH3VcnxESL7XxJg/xCzUMBANO+iDeQu0 /VIENfvYSKPE68a0IMyQvezfTqLhzMU/ebU6ld0CcnIPNGsGBn0TWP/d45LvwHgTsubAI1 sDlHTfLW4mmRB+6RZeTZnyVlJ4aXeiXa4wSq986aAl78gBa46qbY1RTJRyJqSKX5d7+33m qBXTq0nRvGlEENt3+xm2Jpuz0cI6ynUgsQ6hpH6g83AcD3x3kF9FQ0SgpemIKv8CxRfOZ1 n+OqDlEf5qb1Gu8+lmiR6LThGjrvl6MJR7HTt7iEBnRxP2bitA7mZE8MN6nCng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776192637; 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=Gs/7TQWjCVTeKY9qb/dL4uQ2TXL3uMB/HpzykuFxAhc=; b=vMV4U0H7UVIyVJgazZuvwdRyWt989kdIoNJos0NwqU7+c7uhcEmPT/8y8ea3TkGP+Z5yRa XwAYPeOFYTpKs3eJjIlx//rOhNRnQmJ8GC4oAffbNUCaLT9d7CeT/9CLDDmHmm3wk8Yz66 O2pNlJFYieqFJne2cCnUeGngr9SxskMcQ7g2xHbwWcL5kJSPM5NaDAymsuB8LPbl7RZ5Mt 9YnjNQjjTZ/+EcbrVdCcSzLn0Ij2eRAeJ981XsZxllYiKpBAL1ny7NsCxB5Xq/n/hdEooh J32PLsuqYyxS3MzKgw6AZy189Jx8CNZpTVLqicKzwvGNfpqqDPquSx6ukhXSLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwCyh6916z12np for ; Tue, 14 Apr 2026 18:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d836 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 18:50:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: f707cc00ed12 - main - lro: move pkt rejection checks to leafs to avoid queueing non-LRO'able pkts List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f707cc00ed124828e367b020d6b417842321f641 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 18:50:36 +0000 Message-Id: <69de8c7c.3d836.56c79b47@gitrepo.freebsd.org> The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=f707cc00ed124828e367b020d6b417842321f641 commit f707cc00ed124828e367b020d6b417842321f641 Author: Andrew Gallatin AuthorDate: 2026-04-13 21:33:17 +0000 Commit: Andrew Gallatin CommitDate: 2026-04-14 18:47:57 +0000 lro: move pkt rejection checks to leafs to avoid queueing non-LRO'able pkts When lro mbuf queuing is enabled, we should not queue easily reject-able packets. Queuing them does a bit of extra work (sorting, timestamps) and can potentially delay urgent packets such as LACP PDUs. This change moves simple rejection tests from lro_rx_common() into lro_rx and (more importantly) into tcp_lro_queue_mbuf(). Note this change only moves the easy checks on forwarding and packet metadata, where the rejection criteria is already hot in cache. It does not move parsing and looking inside the packet to verify the ether protocol, ip protocol, etc. This could be done, but we risk essentially doubling the cache misses per-packet by doing so. Differential Revision: https://reviews.freebsd.org/D56337 Reviewed by: rrs, tuexen Sponsored by: Netflix --- sys/netinet/tcp_lro.c | 73 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 21 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 06280bce2279..5819fb5ceae0 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -1305,27 +1305,6 @@ tcp_lro_rx_common(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum, bool use_h int error; uint16_t tcp_data_sum; -#ifdef INET - /* Quickly decide if packet cannot be LRO'ed */ - if (__predict_false(V_ipforwarding != 0)) - return (TCP_LRO_CANNOT); -#endif -#ifdef INET6 - /* Quickly decide if packet cannot be LRO'ed */ - if (__predict_false(V_ip6_forwarding != 0)) - return (TCP_LRO_CANNOT); -#endif - if (((m->m_pkthdr.csum_flags & (CSUM_DATA_VALID | CSUM_PSEUDO_HDR)) != - ((CSUM_DATA_VALID | CSUM_PSEUDO_HDR))) || - (m->m_pkthdr.csum_data != 0xffff)) { - /* - * The checksum either did not have hardware offload - * or it was a bad checksum. We can't LRO such - * a packet. - */ - counter_u64_add(tcp_bad_csums, 1); - return (TCP_LRO_CANNOT); - } /* We expect a contiguous header [eh, ip, tcp]. */ pa = tcp_lro_parser(m, &po, &pi, true); if (__predict_false(pa == NULL)) @@ -1443,6 +1422,29 @@ tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum) { int error; +#ifdef INET + /* Quickly decide if packet cannot be LRO'ed */ + if (__predict_false(V_ipforwarding != 0)) + return (TCP_LRO_CANNOT); +#endif +#ifdef INET6 + /* Quickly decide if packet cannot be LRO'ed */ + if (__predict_false(V_ip6_forwarding != 0)) + return (TCP_LRO_CANNOT); +#endif + + if (((m->m_pkthdr.csum_flags & (CSUM_DATA_VALID | CSUM_PSEUDO_HDR)) != + ((CSUM_DATA_VALID | CSUM_PSEUDO_HDR))) || + (m->m_pkthdr.csum_data != 0xffff)) { + /* + * The checksum either did not have hardware offload + * or it was a bad checksum. We can't LRO such + * a packet. + */ + counter_u64_add(tcp_bad_csums, 1); + return (TCP_LRO_CANNOT); + } + /* get current time */ binuptime(&lc->lro_last_queue_time); CURVNET_SET(lc->ifp->if_vnet); @@ -1472,6 +1474,22 @@ tcp_lro_queue_mbuf(struct lro_ctrl *lc, struct mbuf *mb) return; } +#ifdef INET + /* Quickly decide if packet cannot be LRO'ed */ + if (__predict_false(V_ipforwarding != 0)) { + /* input packet to network layer */ + (*lc->ifp->if_input) (lc->ifp, mb); + return; + } +#endif +#ifdef INET6 + /* Quickly decide if packet cannot be LRO'ed */ + if (__predict_false(V_ip6_forwarding != 0)) { + /* input packet to network layer */ + (*lc->ifp->if_input) (lc->ifp, mb); + return; + } +#endif /* check if packet is not LRO capable */ if (__predict_false((lc->ifp->if_capenable & IFCAP_LRO) == 0)) { /* input packet to network layer */ @@ -1479,6 +1497,19 @@ tcp_lro_queue_mbuf(struct lro_ctrl *lc, struct mbuf *mb) return; } + if (((mb->m_pkthdr.csum_flags & (CSUM_DATA_VALID | CSUM_PSEUDO_HDR)) != + ((CSUM_DATA_VALID | CSUM_PSEUDO_HDR))) || + (mb->m_pkthdr.csum_data != 0xffff)) { + /* + * The checksum either did not have hardware offload + * or it was a bad checksum. We can't LRO such + * a packet. + */ + counter_u64_add(tcp_bad_csums, 1); + (*lc->ifp->if_input) (lc->ifp, mb); + return; + } + /* If no hardware or arrival stamp on the packet add timestamp */ if ((tcplro_stacks_wanting_mbufq > 0) && (tcp_less_accurate_lro_ts == 0) && From nobody Tue Apr 14 19:31:23 2026 X-Original-To: dev-commits-src-main@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 4fwDsq3Kkvz6ZKCl; Tue, 14 Apr 2026 19:31:27 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwDsq1knGz3vxZ; Tue, 14 Apr 2026 19:31:27 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776195087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=msETnN36b/MWGPtQV7pJBrrSa1ghU4yRRRFkfQGM+Go=; b=sBFy+aBbpP9xZ8hhgeZHdpdrphwNXJ1ZCu/vZYpnlS6PtG+hx6z1xR5fA0OAGkTPHEy1lr mCSFszeP637sFefckhy7YWcnBaE0gdRE6dDaeRzFZuPsdHqfoMt2J342OG99xkEbO90RGE 4c01AgGqYes/84CsA2n+mZEMOl2NJsxq8zd3XV08wOmibCEileyBBGwXCtTwMnt4EIKYNT v73Hq91s8DoIz+G1k0VIu8dkXCcYqSgeccbkjLtl/28aFIrKvHl1Q4tiRoJwPhriwQn+sb 5yuqmvu74P+VHrfiR5tJB+3WXOEwpiTwa70UZrRbhhj7GCZUb39awdTmeSW9HA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776195087; a=rsa-sha256; cv=none; b=IPAki4S7ArlZOC/QWpuOn/jyJPS52UBNgpipAdUvQS0ae8JkyvspJqq3rotKgVedIK0EIG XESQW54v1JL1ljUm+xQ+si1OnaBM2wq2rXgd8p2RrTq7wFXZqlgLi4DCtGRxT1iAmI0Xq1 m3P9ecu4ZAhF0j778mQiMp85Vs8R5eHkVTQrJAlMt3qxkfBXBtALssopQF+JW37J7Cd/TI bz/bPXEnphtZq/xNiTkHyFv0TNDLblX5m7M/nuDBzXsCsrNKWIK6u8nOTUQ0xd28Ls/08H 1PbQNA9QmN3gZlbarpAIfhv+dPGGHwB9hQ1qfmbvhKfcF8IwXblBIWEDzj69zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776195087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=msETnN36b/MWGPtQV7pJBrrSa1ghU4yRRRFkfQGM+Go=; b=VH+pL44WSKPksP+Nd6XvTBFLiIEKLliXBOwQaMkX1Q/ml3rUJkBLK4rOn2YqLoWOXYE2ng tG+JiW/JUBh/CDt7XLGqVJO5B1GdU28+EPf75MXgpiQ70w5LLJWiBcxi54V4KnyFBATPaE nvDclQ5nmksQApI2YPsDsFfGoMtptscDPNtF0NPfqmRrYh/Innp9j0LNbC9xfbim5hG5g2 Y3fKn9cTqtG5S0iHV2XKAh5BbXuHlkH159g/QSJgOCb9Ks0CZ2ukK6NV1RrDcaL6VK8t+0 A6tSyVddBQ9l+ofLV5OnzOnBb0gS91HMfFjqhC+Os/+VeZJ4AqIhRJqY8g7WlQ== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fwDsp3C9mz7w5; Tue, 14 Apr 2026 19:31:26 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Tue, 14 Apr 2026 12:31:23 -0700 From: Gleb Smirnoff To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 4fadf2466468 - main - tcp_close: Use in6_pcbdisconnect for INET6 sockets Message-ID: References: <69de895e.398d0.7253ff8b@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <69de895e.398d0.7253ff8b@gitrepo.freebsd.org> On Tue, Apr 14, 2026 at 06:37:18PM +0000, John Baldwin wrote: J> The branch main has been updated by jhb: J> J> URL: https://cgit.FreeBSD.org/src/commit/?id=4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 J> J> commit 4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 J> Author: John Baldwin J> AuthorDate: 2026-04-14 18:07:51 +0000 J> Commit: John Baldwin J> CommitDate: 2026-04-14 18:07:51 +0000 J> J> tcp_close: Use in6_pcbdisconnect for INET6 sockets J> J> This also fixes the LINT-NOINET builds. J> J> Fixes: 40dbb06fa73c ("inpcb: retire INP_DROPPED and in_pcbdrop()") Thanks! I wonder how did it pass the tests. Looks like we don't have any UDPv6 tests? -- Gleb Smirnoff From nobody Tue Apr 14 19:42:03 2026 X-Original-To: dev-commits-src-main@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 4fwF651J8Fz6ZKdf; Tue, 14 Apr 2026 19:42:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwF650TDBz40MB; Tue, 14 Apr 2026 19:42:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776195725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YX1AB/R9/wz4Uz8gvPYr3JGwyjBBKHIVBQ5L66Vda6g=; b=jTptZ12zXNZmr6HrpwCMuiZ7mlKXp4fVlZ0aLCKn9H5yFGLbOFymK1nI4qwik9j0ldGpR3 E5zQ2tcPF+DYtL3lLi0pRXzCdKBPMrKIYLQwNzBIRHucBGi6Xe9yArJj6J2QPbJ5PrIjlm F3DYQKA9vDPLcEqWwzE20iFRLXh1SK2A2Vmt7mcvuN4TVTcw0XskGBGIYI18WpBGYxrzGX e0BrMoh2cLce/k1dCHesdXr5WqBIZW3biFd+UQ6k/2gpdU744OSxVT7nX3k8c/qSHDVtdp TK0hY+q+QpZHPAqNJSYKXDZHJTSXKzk/IbblpwitNs/2Wyq8AhtHVSNxXoehxg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776195725; a=rsa-sha256; cv=none; b=EYeGRtz0Q3OnPQeT7VfB82n/igqopkQ3IWnD394tM7ywOWC9BDKDsasiBmiuweowLw6mFU 7cWbpVAwdgxqVD/P4Ne6EmPl9glcdiUraTLeItvuQFY41o45YxRQnmchgz/JGuP4QJPDid jqamcrXxlqmuvsqx+AbLNz6zDmuo+REb1mMd+joZw2wMo/ObW8UYyclYwrnCJDSMciqiBK HXWeRce3jV6cQsWdfi5haO/YpZYDjzxiK6ttnCS2rFOuQ2lFQilL7uCySJGsMALYaxDYiI aGQNqYHwIysl/QbMhPqgJWgg9MHigAL8yyiwD2otFr+XkFedAFWZrz8Ak8QxpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776195725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YX1AB/R9/wz4Uz8gvPYr3JGwyjBBKHIVBQ5L66Vda6g=; b=C6DCvd2P1UdMZjdTL6h9CuIFMA62wxsOWf4Vwv9dEw40NQsRJ34CnEY6LBBd5jQ69vdhCy XsJgkpWfy1GAsihtTHOHTWTW6sTG3r3QINmhXmgd9d4pWocCB6jnw0r0qvDmE05B26WTUy tOKen+W6Gt1WYEKHNg8rcBPu/NT6hxzayePHX+Ra1aBxkpxa5Grn3eRhvMt2MEIdRagDPy AW1ZCAi/fzt4+aZU6Ej4LpXyQW2AhkWpm57V8REjucGxdvWRAnXQzjtp5LrZVWqXz4Mq3P 3E7vm+k1zLl8b+4Se9d0N4omdSnc9zwcgc+304WBzKgmA3rbBj1g6Mzh0+1OcQ== Received: from [IPV6:2601:5c0:4202:5670:a48b:e56:f352:935f] (unknown [IPv6:2601:5c0:4202:5670:a48b:e56:f352:935f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fwF6445DZz8nf; Tue, 14 Apr 2026 19:42:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <1fcc8e29-5a8c-4596-91d9-8212ff8cc379@FreeBSD.org> Date: Tue, 14 Apr 2026 15:42:03 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 4fadf2466468 - main - tcp_close: Use in6_pcbdisconnect for INET6 sockets Content-Language: en-US To: Gleb Smirnoff Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <69de895e.398d0.7253ff8b@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/14/26 15:31, Gleb Smirnoff wrote: > On Tue, Apr 14, 2026 at 06:37:18PM +0000, John Baldwin wrote: > J> The branch main has been updated by jhb: > J> > J> URL: https://cgit.FreeBSD.org/src/commit/?id=4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 > J> > J> commit 4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 > J> Author: John Baldwin > J> AuthorDate: 2026-04-14 18:07:51 +0000 > J> Commit: John Baldwin > J> CommitDate: 2026-04-14 18:07:51 +0000 > J> > J> tcp_close: Use in6_pcbdisconnect for INET6 sockets > J> > J> This also fixes the LINT-NOINET builds. > J> > J> Fixes: 40dbb06fa73c ("inpcb: retire INP_DROPPED and in_pcbdrop()") > > Thanks! I wonder how did it pass the tests. Looks like we don't have > any UDPv6 tests? If you look at in_pcbdisconnect and in6_pcbdisconnect they are mostly the same and given that it was a close operation about to discard the pcb anyway, the differences probably didn't matter in practice. I only noticed due to make tinderbox being broken. -- John Baldwin From nobody Tue Apr 14 19:47:41 2026 X-Original-To: dev-commits-src-main@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 4fwFDY3q1Bz6ZLD2 for ; Tue, 14 Apr 2026 19:47:41 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwFDY32L9z42Hm for ; Tue, 14 Apr 2026 19:47:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776196061; 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=WW+bgJ2MRnaEz49ko6fleZTDH18MT/p30ZNcn5qKKVo=; b=MuKibTsJkJ8n4e2ujyNxtr6eD2AEnTCSQhb0TlcZzky06jRxR+lP8VhihcD7GSUuH3mxo1 ft6pR8pTqD5uUCUCUD1V25D47quDHCo+agJKfomhuigduwrm5a/bxaVW3YvFNYQWTV8QPV uNnLgU/ELuwHVKz56izqik+5cdtQ6/25v6SBPm1lwMwaqMoJWHsk+UtjMPQAviyqDNrMlO 8fMYJX/zH6CpmswKcOjpAp1MDSA6gaqNW+gN42qaBmjem2B8ESfwk72f5OhA0Ze5rMPQ08 BCS4uvLvMS4ysGrjo+EwRbNh0X/LvAOkr1fD6H08/ospn9UmOFPYUVPAExUKbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776196061; a=rsa-sha256; cv=none; b=LrFf/G5QLcAf0PHMAfWyCRPjxqU+3Rj4xTqB4O/25gbHP9L6Ux8Dh/agHgHUj0K/T1kNqs jfWgNtbMtaxDdfp6K2FHvVJoT2I1zBOkZBy43rW0PcBUmJVDJ4RyK0ptMK7BE72wULS/8I NcogQHIOftf3NrhIEOYehP7e8d3Vd/xKdYtqoFYZTBFgKJwfDj9oCWcJRR11ZE6DJ+ij3i T1Z4+sJUWysAJz3UyuzDPcjNh7eTs2KrujNcfpqUlXtIOXz5zCTWFHGdGovFua7WIeHB9T qmZs7dHDpi68tPgpporCbEXz2vmqjN6A0iAPDvWsnVhACQFUNUy0D3ljf10NfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776196061; 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=WW+bgJ2MRnaEz49ko6fleZTDH18MT/p30ZNcn5qKKVo=; b=DRwShTf8wPViTzlUppgodA/I2vXOQniKL7Az1l3exTXh3eFX3QCwszJouLkl2BfmB/yS5l TGCjwS8juxEG/MCIvDx46K6nHpLhjDz9adZXuSJ1SJ5NQLEOPtZAulnL6C06T5emGP25WV KOCet0Mg36/rfPOiznttLkOcw0mY9Iiv3iZMWmuXOJRL2VdUTMQsBcUCkRl5mguw9HM7Dv JzmIcHDZ0xi3Lg5ZZlhxk4tgzwsiOrTdGGOO9QobYID7DmPScMehhxKWmWY6KAWZ6EmvCK Y99GzdHU9ARhSrhxnvhunpJ749+cAqVtblrZ+pOQNyBiMykh7JP5hUhfhogrlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwFDY280Xz13MB for ; Tue, 14 Apr 2026 19:47:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 422ab by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 19:47:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 956acdce0505 - main - loopback: Account for packet drops List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 956acdce0505ca8028d287d3b44789c623c8f37e Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 19:47:41 +0000 Message-Id: <69de99dd.422ab.2b84d627@gitrepo.freebsd.org> The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=956acdce0505ca8028d287d3b44789c623c8f37e commit 956acdce0505ca8028d287d3b44789c623c8f37e Author: Andrew Gallatin AuthorDate: 2026-04-14 19:43:28 +0000 Commit: Andrew Gallatin CommitDate: 2026-04-14 19:43:28 +0000 loopback: Account for packet drops Make loopback packet drops more obvious by reporting them in interface stats visable via netstat -ni Since loopback uses netisr, packets can be dropped if the netisr queue overflows. These drops are visible via netisr -Q, but its not an obvious place to look. Differential Revision: https://reviews.freebsd.org/D56356 Reviewed by: glebius, tuexen Sponsored by: Netflix --- sys/net/if_loop.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index 37309260a0d3..2ff265d5d1e7 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -350,9 +350,13 @@ if_simloop(struct ifnet *ifp, struct mbuf *m, int af, int hlen) m_freem(m); return (EAFNOSUPPORT); } - if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); - netisr_queue(isr, m); /* mbuf is free'd on failure. */ + if (netisr_queue(isr, m) == 0) { + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); + } else { + /* mbuf is free'd on failure. */ + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + } return (0); } From nobody Tue Apr 14 19:53:50 2026 X-Original-To: dev-commits-src-main@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 4fwFMk1Jrfz6ZLbx; Tue, 14 Apr 2026 19:53:54 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwFMk0ZsSz437Q; Tue, 14 Apr 2026 19:53:54 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776196434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=flU8VDeElTRRM8EMF3WFOProIRRBuMvxS8ZK8yS40aA=; b=eWs19X2q32iqLrZ5IU7CN1vgRpmV5V+DLjVkwCeUfj0JgJUoNFpLgJHfSJbvW8ySoSVyGu rjAU7r8vkAX6uyMx/8AsKWIP1ucITyh32DmzZKac5OJAr+x6Jgo8p378WhBRvpwdomgcCP BL3hh/DL3xJF5Vgom9ZsIh9y9OlfskbJxoTnKCUbKz2Uu/ZE7b7twDYiZOHHyKBYJfj7GS 6tC5DrWs4dKAGVRlCA2B3vPOTfLrkAGV6n9xwcwNEuwm0/FEh/rkiNhTXU1HMkI8uP/bqi P1B/To5DjeM7UzKSai4HuWUPtGPhuVSSSMeJ7yN9Qz4VdEK2q+jAoMiHRtkbDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776196434; a=rsa-sha256; cv=none; b=HXKojEK6k6m0fKGcyNZhhJPA0UvAt1DR0SrIB9HGHrJv0mJH6GTMUtAlMRreoULag/VrZA FsYQnS+LT308bW/p97yoe6N27gzsdXXauy2pVV2k+3TKgrpl7BpKAbgaRnxzwg4koscLah 0N7uIbuNIRwFyl7bSWts5eBgASB7fDvVz8HGVpmRH9Pdm4VaGCAZaWRLGi3wDY/CYN0abs mIEfhWD/7zOw42/zCf6V+b86LuuYAKHyr1fsaFPUl5rI/KWbRVPfdhPG032jBrNVZdUFLE DrG1pYVvWRv5cnTPGdr6s9vBlK++tyGHaq7dmJRnVHXgQYjchrOzOUVJHARYUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776196434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=flU8VDeElTRRM8EMF3WFOProIRRBuMvxS8ZK8yS40aA=; b=obsVVH2+rpqNwUOhOZgL/wHYuDXV/MsEmOXzTNPAFGb8hDDTsob7Duv4cqxv18MjOaqVKZ l+47Q54gc3LYQjpAaKSLsJU3f7USNXzvkV5zq0Tttqt3UaMGtEzDKrzfqT4pyccISvFBJf JP+dozfQXSnZG/t4olVXaK+aWpAak6exE5wgtmXKkYbccdRE/aHa9TUgxIVASSvUjJspKi JSbJJjhEElQGNXioUe5f/EMG5yjiHTMv1hR3EqcZA/zLKrgkVLGy8OoepXlLThk5S8S2m3 K8UG13JubADNytLY/OOLl9xzJnVOQJnZkiB+UEPNp+NWpZrIhGfPvWSfGQJxCA== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fwFMj2PpMz8Xx; Tue, 14 Apr 2026 19:53:53 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Tue, 14 Apr 2026 12:53:50 -0700 From: Gleb Smirnoff To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 4fadf2466468 - main - tcp_close: Use in6_pcbdisconnect for INET6 sockets Message-ID: References: <69de895e.398d0.7253ff8b@gitrepo.freebsd.org> <1fcc8e29-5a8c-4596-91d9-8212ff8cc379@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1fcc8e29-5a8c-4596-91d9-8212ff8cc379@FreeBSD.org> On Tue, Apr 14, 2026 at 03:42:03PM -0400, John Baldwin wrote: J> > J> URL: https://cgit.FreeBSD.org/src/commit/?id=4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 J> > J> J> > J> commit 4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 J> > J> Author: John Baldwin J> > J> AuthorDate: 2026-04-14 18:07:51 +0000 J> > J> Commit: John Baldwin J> > J> CommitDate: 2026-04-14 18:07:51 +0000 J> > J> J> > J> tcp_close: Use in6_pcbdisconnect for INET6 sockets J> > J> J> > J> This also fixes the LINT-NOINET builds. J> > J> J> > J> Fixes: 40dbb06fa73c ("inpcb: retire INP_DROPPED and in_pcbdrop()") J> > J> > Thanks! I wonder how did it pass the tests. Looks like we don't have J> > any UDPv6 tests? J> J> If you look at in_pcbdisconnect and in6_pcbdisconnect they are mostly the same and J> given that it was a close operation about to discard the pcb anyway, the differences J> probably didn't matter in practice. I only noticed due to make tinderbox being broken. Indeed, since after this path socket can't be reused assignment to IPv4 part of the union was harmless for IPv6. -- Gleb Smirnoff From nobody Tue Apr 14 20:48:44 2026 X-Original-To: dev-commits-src-main@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 4fwGbM4PPTz6ZQ72; Tue, 14 Apr 2026 20:49:03 +0000 (UTC) (envelope-from kp@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwGbM3jQpz47p4; Tue, 14 Apr 2026 20:49:03 +0000 (UTC) (envelope-from kp@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776199743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FVsgswl9yS7qYHdnKaf5Zolv1BUDLAs/itZI9to5SG4=; b=r2GjntCQmROzAy9RB5v/wx0zjpKYFWq26ls8XnFk0avowvkjBT+tX+I3LXw/dcuylvJjtk LZqLPYrA2HlM4rdhCa5iLvXe1eRbFozsHSW8bFdT4e9StFRNNuJ78J4sPCzQ59GCL33Mpn dt5fIfQh2Htlqk2MEzIGEzc38O6izcspbDjygIPSXGp/kJHi43kEnRxPDxse3VKyk4UiGU rGdJ62PBgv2AhOgcX49SHf2bCTp6+SVQs7Zb8A4952WMm2VLOLp95LmOlGsvAyrR2xC7aD vvJXhTgdsJC7PKTPKBGxWchSeMzSAYWo2SD8HB5PiX5YwMW0uvO5Cwm7okfshQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776199743; a=rsa-sha256; cv=none; b=DBdZ+GDXCz5DiJlLX4hz7wcQ4/NyluXMykjJX/0l/z84XwUkpXcjphneSBi4oKNPVVSHcj mSHby0Nqlf6FRqgJokfYoa47tojnVGPxBCebrjl8Aj/er3micpdO7hh4NpsFdYok/fMg8s S6frZRGTzEpdefaN4sj4np6cceJp5FxVUdsZ36Xpdwbc/nO3VfmwO6Eu0nWajwOV5bmoac HEhMWgoLSLOH/+JTg1+5gXtiCUBqAiBrgUcHntS8AOnjAUy+ky/te0Ly2Nt6ILtXT6+WL8 39SwzbIbkfk1Z/Z4F2U/OCmzxqclOdpaGBGR/06njXJUC5hJ+lvxlB2kE1AprQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776199743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FVsgswl9yS7qYHdnKaf5Zolv1BUDLAs/itZI9to5SG4=; b=XL2yiX/hjoWKKDxEu2xW5to4EmloEqFPJyNYNhiEwFcdNj6LuLHLOek22lyO8452FV5nqq nUBmX+Tm39eYmpyFBAx/CTZRpIuZdj+K/FD/FqwPoui3p/0bdDF1lXUB0QPRvgyVSVz6C7 7Br7W/3fl8zBbtWw0WxCs8m55RZO9MSrGeW6fx9E1iy2NayQoNClpRHqFVbTW7iiGjQLdj jZ8Vq/7XNHZCabWFB3MW14VZ2IGZkv9tCDCrrz+/bBHB2MyX/1nSvf5WaKN+nD4yiQfL0D LOweJzP53rgNBBZarE5a/P4ZJ5VixlW1klPqjaHDuU5vvrdzRdliaO6a/xcAFw== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (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 (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R12" (not verified)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fwGbM1kNgz9VG; Tue, 14 Apr 2026 20:49:03 +0000 (UTC) (envelope-from kp@freebsd.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id ABCB216E7B; Tue, 14 Apr 2026 22:49:00 +0200 (CEST) Content-Type: multipart/alternative; boundary=Apple-Mail-19B8ACE6-3C3A-4FAD-8D9C-088FBE08E17B Content-Transfer-Encoding: 7bit From: Kristof Provost List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (1.0) Subject: Re: git: e9fc0c538264 - main - if_clone: Make ifnet_detach_sxlock opaque to consumers Date: Tue, 14 Apr 2026 22:48:44 +0200 Message-Id: <582CBBF6-BBE9-49DB-8DF6-8EA56238E0F1@freebsd.org> References: Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org In-Reply-To: To: Zhenlei Huang X-Mailer: iPhone Mail (23E254) --Apple-Mail-19B8ACE6-3C3A-4FAD-8D9C-088FBE08E17B Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

On 14 Apr 2026, at 19:46, Zhenlei Huang <zlei= @freebsd.org> wrote:

=
=EF=BB=BF

On Apr 14, 2026, at 11:57 PM, Kristof Prov= ost <kp@FreeBSD.org> w= rote:

On 1= 3 Apr 2026, at 6:39, Zhenlei Huang wrote:

The bran= ch main has been updated by zlei:

URL: https://cgit.FreeBSD.org/src/commit/?id=3De9fc0c53826= 4355bd3fd9120c650078281c2a290

commit e9fc0= c538264355bd3fd9120c650078281c2a290
Author: Zhenlei Huang zle= i@FreeBSD.org
AuthorDate: 2026-04-13 04:38:44 +0000
Commit: Zhenlei Huang zle= i@FreeBSD.org
CommitDate: 2026-04-13 04:38:44 +0000

if_clone: Make ifnet_detach_sxlock opaque to consumers

The change e133271fc1b5e introduced ifnet_detach_sxlock, and change
6d2a10d96fb5 widened its coverage, but there are still consumers,
net80211 and tuntap e.g., want it. Instead of sprinkling it everywhere,
make it opaque to consumers.

Out of tree drivers shall also benefit from this change.

Reviewed by:    kp
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D56298

I don=E2=80=99t really understand wh= y, but this commit causes bricoler test runs to fail for me.
Or more precisely, it looks like parallel test runs see a number of failures= in the pf tests.

Reverting only part of this c= hange, specifically this:

diff --git a/sys/net/if_clone.c b/sys/net/if_clone.c
index db3db78c1b76..d0fe54b6146b 100644
--- a/sys/net/if_clone.c
+++ b/sys/net/if_clone.c
@@ -683,11 +683,12 @@ if_clone_detach(struct if_clone *ifc)
        V_if_cloners_count--;
        IF_CLONERS_UNLOCK();

-       sx_xlock(&ifnet_detach_sxlock);
        /* destroy all interfaces for this cloner */
-       while (!LIST_EMPTY(&ifc->ifc_iflist))
+       while (!LIST_EMPTY(&ifc->ifc_iflist)) {
+               sx_xlock(&ifnet_detach_sxlock);
                if_clone_destroyif_flags(ifc, LIST_FIRST(&ifc->ifc_if=
list), IFC_F_FORCE);
-       sx_xunlock(&ifnet_detach_sxlock);
+               sx_xunlock(&ifnet_detach_sxlock);
+       }

        IF_CLONE_REMREF(ifc);
 }

Seems to be enough to avoid the prob= lem. So it looks like somehow deleting all interfaces for a given cloner und= er that lock (rather than releasing it and re-acquiring it) causes the test f= ailures.



That is interesting. I do not expect a r= e-acquiring will make any differences, given ifc_detach_cloner() and / o= r if_clone_detach() are basically be invoked by VNET_SYSUNINIT() and  v= net_destroy() has acquired ifnet_detach_sxlock ( I planed to removed th= e acquiring of it in vnet_destroy() but not yet done ). So I'd ex= pect an assert `sx_assert(&ifnet_detach_sxlock, SA_XLOCKED)` in if_= clone_detach() will mostly succeed.

Some= drivers, for example wg(4), iterate all VNETs and invoke ifc_detach_cl= oner() on module unload. That should be the only case that `ifnet_detach_sxlo= ck` is not recursively acquired, and not acquired prior to
= t= he commit.

The failing tests I see are:

sys/netpfil/pf/divert-to:in_div  ->  failed: Test case body ret=
urned a non-ok exit code, but this is not allowed  [36.591s]
sys/netpfil/pf/divert-to:in_div_in  ->  failed: atf-check failed; see the=
 output of the test for details  [30.867s]
sys/netpfil/pf/divert-to:in_div_in_fwd_out_div_out  ->  failed: atf-check=
 failed; see the output of the test for details  [39.705s]
sys/netpfil/pf/divert-to:in_dn_in_div_in_out_div_out_dn_out  ->  failed: a=
tf-check failed; see the output of the test for details  [45.059s]
sys/netpfil/pf/divert-to:out_div  ->  failed: Test case body returned a n=
on-ok exit code, but this is not allowed  [23.629s]
sys/netpfil/pf/killstate:gateway  ->  failed: Killing with a different ga=
teway removed the state.  [32.803s]
sys/netpfil/pf/killstate:id  ->  failed: Killing a different ID removed t=
he state.  [32.789s]
sys/netpfil/pf/killstate:label  ->  failed: Killing a non-existing label r=
emoved the state.  [47.749s]
sys/netpfil/pf/killstate:multilabel  ->  failed: Setting new rules remove=
d the state.  [43.570s]
sys/netpfil/pf/killstate:src_dst  ->  failed: Killing with the wrong dest=
ination IP removed our state.  [57.819s]
sys/netpfil/pf/killstate:v6  ->  failed: Killing with the wrong IP remove=
d our state.  [54.957s]
sys/netpfil/pf/nat64:pool  ->  failed: atf-check failed; see the output o=
f the test for details  [51.118s]
sys/netpfil/pf/nat64:sctp_in  ->  failed: Failed to connect to SCTP serve=
r  [55.495s]
sys/netpfil/pf/nat64.py:TestNAT64::test_udp_checksum  ->  failed: /usr/te=
sts/sys/netpfil/pf/nat64.py:205: AttributeError  [80.001s]
sys/netpfil/pf/pflog:matches  ->  failed: atf-check failed; see the outpu=
t of the test for details  [61.807s]
sys/netpfil/pf/pflog:matches_logif  ->  failed: atf-check failed; see the=
 output of the test for details  [51.261s]
sys/netpfil/pf/pflog:unspecified_v6  ->  failed: atf-check failed; see th=
e output of the test for details  [36.281s]
sys/netpfil/pf/rdr:srcport_pass  ->  failed: atf-check failed; see the ou=
tput of the test for details  [76.815s]
sys/netpfil/pf/sctp:pfsync  ->  failed: Initial SCTP connection failed  [=
134.866s]
sys/netpfil/pf/sctp:related_icmp  ->  failed: SCTP connection failed  [59=
.620s]
sys/netpfil/pf/table:zero_one  ->  failed: atf-check failed; see the outp=
ut of the test for details  [64.125s]
sys/netpfil/pf/tcp:rst  ->  failed: atf-check failed; see the output of t=
he test for details  [80.261s]

Looking at it now, those runtimes se= ems suspiciously high as well.



I noticed that. My= local test shows most of them finish in seconds. Some require more time to f= inish but still within about 20 seconds.
I tested as the following= ,
```
# kyua test -k Kyuafile pf/divert-to
```

Is the failing tests always fail ?=

It=E2=80=99s relatively consistentl= y the same tests, I believe.

Does the kyua report show anything useful ?

Not obviously so, no, but I=E2=80=99ve also not done a l= ot of debugging. It=E2=80=99s an annoying problem, because re-running an ind= ividual test case just succeeds. 

In any event, I=E2= =80=99ll try to test the patch you sent me tomorrow. (Probably ~12 hours fro= m now.)

Best regards?
Kristof Provost&nbs= p;
= --Apple-Mail-19B8ACE6-3C3A-4FAD-8D9C-088FBE08E17B-- From nobody Tue Apr 14 22:02:05 2026 X-Original-To: dev-commits-src-main@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 4fwJCt5Sj5z6ZVXF for ; Tue, 14 Apr 2026 22:02:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwJCt3NZ5z3JJv for ; Tue, 14 Apr 2026 22:02:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-79f855b2575so65522797b3.2 for ; Tue, 14 Apr 2026 15:02:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776204137; cv=none; d=google.com; s=arc-20240605; b=XlkPqA03GfKJVG+hJwOlzghL6gViZ0Oti4zHZZ0TO2xW0nnXed+bq5nzJis1z20bWf lN+Zy3MjkGUX9BXk7yjYkaFw3zFV/cS9ZLXCgW1S16MBkgJHv3hwzNddWrS1xeS+QN3P 1f61ILLI1k3L/mfMwpNcBYiiOYfTOknMeugARi+/MTuwadMPIdthAys9tSJ78nRP/eQ1 4vf6nUz6Q9xz3nDtcgN0dRCl9CCEL36Q14NaaovtjljRAekKbOVdJnA4lKPZK0OUjNO5 8GvaR3ITSY5tua0JC4KyTUyrlHFfbGqQVegDCfmv7fhhoJLyP5uRl0aiVoQYbyZZGdkM +Ivg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version; bh=EemrZrq5OvkvQeEtIGEyuKnYLDBVm2wBhGCEK5b5mrI=; fh=E/F5Cikvmvvrj12KrCFPMrL+9Fu3rzJx4GCJIAYnxoI=; b=kUnI8YkNkVGS6IxaNwYdUQWkWNtkAb1Tam3oV4nOu2WuDS89cUMBL3s43nYrYER0P7 Vo+fh8rar2Z1oKO03/f2ExJrcKASXrt+Ze0go/EwxZ1cZQ34GLPp0JyoqVdtXUEXkiqh Cx0GQ1bGtT45+4kGuC1GmU2NJTppCZeAj1i++0bINntyLdYOBp3SB+OWZsY1JKqpQEq7 hp1u/H3dc0NiYwmJtZBqfFvE/qHZv03dEV6fLcNBnPDuIPjJM5Dthr6q8TjVkDA6VeXR T7ck+wJ0e8nI9TJu95FnNW+y0I/pXBRn2Q+zzSvRPbvgNVlgSG07aXU/XCNM+GD+MGvr 3+sQ==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776204137; x=1776808937; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=EemrZrq5OvkvQeEtIGEyuKnYLDBVm2wBhGCEK5b5mrI=; b=TMvHYps0ZNqcd8GU9DX9pTIq8W7x5YF7xCPVDG6MwGJpSPpUVVDn0aBvFHmkpeyVLR nz+Msw95aYtdTUvMj7CbSyTcroqS266/1B2W9dIukAM84W35xwul3wu26zWk7Hxbjn4R t7/KphEbc16vNdI3rY+yOoRwjm5jiwU3jPoDmm+05PcBmhKNg24sWv/rUgcnxKya+oE4 nVxq71xc+0UpD89iS/59TUAZcYMV+9pkki/hSKdKzQm6YeldzfTDH1zgjQuXDNtJRlaR T/qBDKTz0ivlvDcRYFGn7NSIkJCYZv6FpKc/N62bUf6TqS23In3aHTadbVfBYMMNqYob 9Kpg== X-Forwarded-Encrypted: i=1; AFNElJ+lmbGkXbP21lRy2TInaJCs0oNKmbHB8qvFdfgo6SY71zf0azOBWZqWfvr4WfxCm5n79RYIhKWHFSKtgo/LSwK0OjfASw==@freebsd.org X-Gm-Message-State: AOJu0YzzwFfQ0JqEjeLlMYS0jGPS95myfHoT63h+nVnLB5LxPBPlBAYb wjSpWQvVfP+wzmYsMjY9BoHl+cqMeEhJRq5fiOSO5aOtq5qZ4eKEnU8JZyNGBAIOW6+qiuh9w8V sKhT4J+w0PZ5puSH6PLdwVoTh44Vsu+YKjw== X-Gm-Gg: AeBDieuCjQ8s/pBMfcd5Fwo9QJrC4jqGrBGA4uFKWkVXKchWz63zkrlL+PAxeztPgJA /p6klpoCCJwE5hIYA3jIUcroXQgniN22st3C/AK/AyEUAa382yF5f9DbpiG8ZwsJ654YFiJ2eO0 obR3w1u8Xv3ML2rSSgqlhzo7WjEVn6qh4dCNH7Ya2w/ntsv9jFDxThb94zAk0UZAXaYIWzqsVwr YS2ew0poLMYXoAKG6Dml+WFGShQP/oxQnI2HxLeA6zMf6Io0pBFr4nY3LFYk/2ywghSciLtpPkB dHwDIdiaKZZKEna3+vDTd1/XtPgKW1lLltrhJQeUE2GiNTYHqlGNYKKL0nOEDgVtKk4Sm9ifKFM 3S/a+JEXUVpuNMmU98AP4QQ6iHfNNlKp/x2ovQQ== X-Received: by 2002:a05:690c:dd4:b0:79b:dd37:69b4 with SMTP id 00721157ae682-7af6f8094ddmr192601827b3.13.1776204137237; Tue, 14 Apr 2026 15:02:17 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <69de8961.3b661.4248ec5e@gitrepo.freebsd.org> In-Reply-To: <69de8961.3b661.4248ec5e@gitrepo.freebsd.org> From: Adrian Chadd Date: Tue, 14 Apr 2026 15:02:05 -0700 X-Gm-Features: AQROBzDhhaBdk1rFYnxN_c7T8GY2HCei2yXPwgKLv0NA3MLBMIFvzw1BmnMCv7k Message-ID: Subject: Re: git: c48381df77e1 - main - qcom_gcc: Only build on arm64 for kernels with FDT To: John Baldwin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4fwJCt3NZ5z3JJv X-Spamd-Bar: ---- oops sorry! I'll make sure i test this target out on the subsequent lands. -a On Tue, 14 Apr 2026 at 11:37, John Baldwin wrote: > > The branch main has been updated by jhb: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c48381df77e15fda271555dcd5ef0cbbbd7cd9bf > > commit c48381df77e15fda271555dcd5ef0cbbbd7cd9bf > Author: John Baldwin > AuthorDate: 2026-04-14 18:35:16 +0000 > Commit: John Baldwin > CommitDate: 2026-04-14 18:35:16 +0000 > > qcom_gcc: Only build on arm64 for kernels with FDT > > This fixes the build of the LINT-ACPI kernel. > > Fixes: 4e3fdced7f78 ("qcom_gcc: migrate the MSM8916 support to qcom_gcc") > --- > sys/conf/files.arm64 | 28 ++++++++++++++-------------- > 1 file changed, 14 insertions(+), 14 deletions(-) > > diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 > index c36a391d75a2..5d1b6e164a51 100644 > --- a/sys/conf/files.arm64 > +++ b/sys/conf/files.arm64 > @@ -768,20 +768,20 @@ dev/ahci/ahci_fsl_fdt.c optional soc_nxp_ls ahci fdt > dev/flash/flexspi/flex_spi.c optional clk flex_spi soc_nxp_ls fdt > > # Qualcomm > -dev/qcom_gcc/qcom_gcc_main.c optional qcom_gcc > -dev/qcom_gcc/qcom_gcc_clock.c optional qcom_gcc > -dev/qcom_gcc/qcom_gcc_reset.c optional qcom_gcc > -dev/qcom_gcc/qcom_gcc_ipq4018_reset.c optional qcom_gcc > -dev/qcom_gcc/qcom_gcc_ipq4018_clock.c optional qcom_gcc > -dev/qcom_gcc/qcom_gcc_msm8916_reset.c optional qcom_gcc > -dev/qcom_gcc/qcom_gcc_msm8916_clock.c optional qcom_gcc > -dev/qcom_clk/qcom_clk_fepll.c optional qcom_gcc > -dev/qcom_clk/qcom_clk_fdiv.c optional qcom_gcc > -dev/qcom_clk/qcom_clk_apssdiv.c optional qcom_gcc > -dev/qcom_clk/qcom_clk_freqtbl.c optional qcom_gcc > -dev/qcom_clk/qcom_clk_rcg2.c optional qcom_gcc > -dev/qcom_clk/qcom_clk_branch2.c optional qcom_gcc > -dev/qcom_clk/qcom_clk_ro_div.c optional qcom_gcc > +dev/qcom_gcc/qcom_gcc_main.c optional qcom_gcc fdt > +dev/qcom_gcc/qcom_gcc_clock.c optional qcom_gcc fdt > +dev/qcom_gcc/qcom_gcc_reset.c optional qcom_gcc fdt > +dev/qcom_gcc/qcom_gcc_ipq4018_reset.c optional qcom_gcc fdt > +dev/qcom_gcc/qcom_gcc_ipq4018_clock.c optional qcom_gcc fdt > +dev/qcom_gcc/qcom_gcc_msm8916_reset.c optional qcom_gcc fdt > +dev/qcom_gcc/qcom_gcc_msm8916_clock.c optional qcom_gcc fdt > +dev/qcom_clk/qcom_clk_fepll.c optional qcom_gcc fdt > +dev/qcom_clk/qcom_clk_fdiv.c optional qcom_gcc fdt > +dev/qcom_clk/qcom_clk_apssdiv.c optional qcom_gcc fdt > +dev/qcom_clk/qcom_clk_freqtbl.c optional qcom_gcc fdt > +dev/qcom_clk/qcom_clk_rcg2.c optional qcom_gcc fdt > +dev/qcom_clk/qcom_clk_branch2.c optional qcom_gcc fdt > +dev/qcom_clk/qcom_clk_ro_div.c optional qcom_gcc fdt > dev/qcom_mdio/qcom_mdio_ipq4018.c optional qcom_mdio fdt mdio mii > > # RockChip Drivers > From nobody Tue Apr 14 22:13:49 2026 X-Original-To: dev-commits-src-main@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 4fwJTF1sSCz6ZWYt; Tue, 14 Apr 2026 22:13:53 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwJTF0lDxz3L5Z; Tue, 14 Apr 2026 22:13:53 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776204833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WFTcVDWxWQE8dRqMLynG46Rc+AU+JjhZHGyQlilG7ls=; b=X4MIFJAkb85H254g17Zh7/XJWWkLnHuCdjBB7h+f+9zUcOjpsTvcEmvDhnxEpndvky0UQ0 9MxdHQBo19HudFoN4lkBZp2X8dWLq3wWUKfHl7qex+8Vx7aSO5rJDKvef0LDo5juIOG9mn wq4+iPW1r8lGCpRTXjO6wZaq0kMJK+bcFiL/+un7fUiZFqBl8LUXgjgJGpaTkwYK0gE0DF 5ljhGVuncqj+mtgg8BvczNyk3MslijXP5jMKtH0i7JisHbenFadhI14uiWIgoJkAUI9suI iDM4bzivAVL7y4QLxXWigEEBkV06IRM4a49J15gB+XkHpkXtAqrr1meNlAYpsg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776204833; a=rsa-sha256; cv=none; b=aRDvyAUn1GqjjuZTohvtl153aYcMqphKHOHg8E/lISP4VWu0bohEG3Fm0S47xHowvMBymy BdZGGe5HJc2hVhYLrRfjz27nndxVHTpKx/C9gfXJCwL/F6a/roiCi0Hqc7zHgEok2MHSSz 9g/jfNpqdK+x2OJr3KYqewdbigfHc2uvVMrY+GMEg0/Dq2X53z6g0fSF4pVCyHWBdeyfTj TTff84yV1rFUGvkwHFbbWC4wQYv558zJ4wcIYRNddyGK8IwCz2mXtxITwHb2jg2JJAN3/k V2wekofDjlrkDbcn70Lsq3V8yYJI0V9Trj30IW6my/o4gyQzpNOmNeDWETFDUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776204833; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WFTcVDWxWQE8dRqMLynG46Rc+AU+JjhZHGyQlilG7ls=; b=lj9Re5Z+G6TohwO/4j7i/bhozxrzccB6cj1qCpD8GQDa3n5D9VrGa4bQSFYN9s5bxo6EEk 8TuPk+pLXOomChaSnlrh5OWyGU0kZxaOpAhA4+v9+mrficjFWcaDnSy16EK+fxAee9SwQT ihVU/wPZHukrKc9p2Z62Rio9F0asfh5ZVgBJiG2tmIrTMkO9bZQ+rq1lpI4ldLdpOIvNWy u2AidHxdRBi4oAyTgLhIyMd5XPCeoeh83hI2HYwBmcuW5gCiL/RMMrTSWFAMk9vA81mrDz V5hwhzsI/mIglJJLGL17+isdD/SNVas4t1oRH4DmP+TNgq05Juc/dq/gRbqS7Q== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fwJTD2Q38zCTS; Tue, 14 Apr 2026 22:13:52 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Tue, 14 Apr 2026 15:13:49 -0700 From: Gleb Smirnoff To: John Baldwin , np@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 4fadf2466468 - main - tcp_close: Use in6_pcbdisconnect for INET6 sockets Message-ID: References: <69de895e.398d0.7253ff8b@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="j5X9tIynpjCB0zDl" Content-Disposition: inline In-Reply-To: <69de895e.398d0.7253ff8b@gitrepo.freebsd.org> --j5X9tIynpjCB0zDl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Apr 14, 2026 at 06:37:18PM +0000, John Baldwin wrote: J> The branch main has been updated by jhb: J> J> URL: https://cgit.FreeBSD.org/src/commit/?id=4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 J> J> commit 4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 J> Author: John Baldwin J> AuthorDate: 2026-04-14 18:07:51 +0000 J> Commit: John Baldwin J> CommitDate: 2026-04-14 18:07:51 +0000 J> J> tcp_close: Use in6_pcbdisconnect for INET6 sockets J> J> This also fixes the LINT-NOINET builds. J> J> Fixes: 40dbb06fa73c ("inpcb: retire INP_DROPPED and in_pcbdrop()") I think this change is also required. Almost sure it will fix panic observed by Navdeep. -- Gleb Smirnoff --j5X9tIynpjCB0zDl Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename=in6_pcbdisconnect.diff diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index ad596cf761d2..3750c7040fbc 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -531,6 +531,9 @@ in6_pcbdisconnect(struct inpcb *inp) KASSERT(inp->inp_smr == SMR_SEQ_INVALID, ("%s: inp %p was already disconnected", __func__, inp)); + if (inp->inp_flags & INP_UNCONNECTED) + return; + INP_HASH_WLOCK(inp->inp_pcbinfo); in_pcbremhash(inp); inp->inp_flags |= INP_UNCONNECTED; --j5X9tIynpjCB0zDl-- From nobody Tue Apr 14 22:18:02 2026 X-Original-To: dev-commits-src-main@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 4fwJZ21sdmz6ZWLQ for ; Tue, 14 Apr 2026 22:18:02 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwJZ21FKRz3LDx for ; Tue, 14 Apr 2026 22:18:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776205082; 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=T01vuOceOdedZ/nojNZN8HxRhafM3YYs1excy3O9oL0=; b=ZC5zC7W6eBBfvdJqM0KzLdQnjUSn1bivdBQJWx4jds1tChGHkPdQI++EofM3MtFUq44TCy xLhGx5RFGmfnjoQTPP4oMtPU96+g0akwH9bRNKWnkDOe44d+m0ShE+enePRZxndsMwBeDi riFzQrQ3rzP/r7Cry+HiE1WLpIwLU/SCu9NRh30xBxUkYmYPIuFYN5bAA1en0/+Fq9P5fX sJhfIe/l1u5/UZgGqxGMawW0ZeCi/PuuiG2be3GqLm6WhARWSfR0v5S+TATuf98UeBEbHf rKFaNoTdPrwEZcA7/lE3MVBD/Ebc7zJeJw11uONY8uTctc/i4srKX3zQeSui6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776205082; a=rsa-sha256; cv=none; b=EQvSMjgM18w83XJP1syqJKjsEsgv63WWQkFO9WL4Pp+FnFoT8XxHV937LxOHvmvAU6zaNB I7+LwUK2DItmHvgper03DFBjmAevc8zgy4oquRcdZMqnSUP+X35qh+zmGI60SAT8cIkDsi CCuiZAbPEs2TkZNvjtYyKowRfDIz64OmJbYfGH8OJ9h6FK6mbHeXFCtICqr/J7hGb4eSMV e83IGgZnq/Bqusp35A6WsNgaxduR1E3LuUzzUAIvUUbh6ySAKty3PjMR7ZxkI7skAUFGxi kI82axXCNN5/pjRHdjwWkYeF1K+YAFBcoOIS7ar8YbNuIIwHbxYEv7fKERkhoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776205082; 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=T01vuOceOdedZ/nojNZN8HxRhafM3YYs1excy3O9oL0=; b=ZsGurHxwkVa9RQDM/FRMbwqC/R6KNlu3cYR8V3wzY0IC0qXoRFUYl2EREZtxU/pakoQ6Fe vvdeSZM34k1YtOdQzkkL8SL/ioZl4QfAc4tgUOBFD43ft14iOSqF5msHshYHJ8tgtXxNgL 1gX0uporAgERGwRkJ6IaHz9QT7gKWVioWDu5iJ/A+ZscZdh+P6b5qa3zZtCF9zL/dnDarz NOG/j5Lb1H38ffexl5BZk3Oy3N5zoOzfdEOa2yXYkejJW6suk2yP14DtU4vpl5iXr2T9KJ KlFqfLu+u/sg0hExv5oRrjgN5oIjpUaimLTGdzmMfAIKOCgVDfeL+aSxTf1IIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwJZ20qbtz18DB for ; Tue, 14 Apr 2026 22:18:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2221b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 22:18:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: bf41d86df0d9 - main - routing: Make ip[6]_tryforward() FIB-aware for local traffic List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf41d86df0d9dc4a1342c579f4e72db3c66b3443 Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 22:18:02 +0000 Message-Id: <69debd1a.2221b.394ee779@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=bf41d86df0d9dc4a1342c579f4e72db3c66b3443 commit bf41d86df0d9dc4a1342c579f4e72db3c66b3443 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-11 12:58:28 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-14 22:11:18 +0000 routing: Make ip[6]_tryforward() FIB-aware for local traffic `ip_tryforward()` and `ip6_tryforward()` checks whether the destination address is local or not without considering if it belongs to the current FIB. If the destination is local but not in our FIB, forward it instead of returning it to ip_input(). PR: 292319 Reviewed by: zlei MFC after: 1 week MFC to: stable/15 Differential Revision: https://reviews.freebsd.org/D56353 --- sys/netinet/ip_fastfwd.c | 4 ++-- sys/netinet6/ip6_fastfwd.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c index 6001ce781bc8..d95cca490a5d 100644 --- a/sys/netinet/ip_fastfwd.c +++ b/sys/netinet/ip_fastfwd.c @@ -293,7 +293,7 @@ ip_tryforward(struct mbuf *m) /* * Is it for a local address on this host? */ - if (in_localip(ip->ip_dst)) + if (in_localip_fib(ip->ip_dst, M_GETFIB(m))) return m; IPSTAT_INC(ips_total); @@ -328,7 +328,7 @@ ip_tryforward(struct mbuf *m) /* * Is it now for a local address on this host? */ - if (in_localip(dest)) + if (in_localip_fib(dest, M_GETFIB(m))) goto forwardlocal; /* * Go on with new destination address diff --git a/sys/netinet6/ip6_fastfwd.c b/sys/netinet6/ip6_fastfwd.c index 9298b8ea9a49..8a288eb19891 100644 --- a/sys/netinet6/ip6_fastfwd.c +++ b/sys/netinet6/ip6_fastfwd.c @@ -113,7 +113,7 @@ ip6_tryforward(struct mbuf *m) IN6_IS_ADDR_LINKLOCAL(&ip6->ip6_src) || IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_dst) || IN6_IS_ADDR_UNSPECIFIED(&ip6->ip6_src) || - in6_localip(&ip6->ip6_dst)) + in6_localip_fib(&ip6->ip6_dst, M_GETFIB(m))) return (m); /* * Check that the amount of data in the buffers From nobody Tue Apr 14 23:24:17 2026 X-Original-To: dev-commits-src-main@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 4fwL2b3h80z6Zbdm for ; Tue, 14 Apr 2026 23:24:23 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwL2b24VHz3Qvk for ; Tue, 14 Apr 2026 23:24:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776209063; 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=6kXC19q8AmQcpohB67DwKYG3x/sdQhrv4TTbhB/lrNM=; b=nGRerWttHxGRaeXlnwBG27P1pe5GyS7uy8NbZbr8lEWw0PdF1U46yBJDorFP1DE6ki7YUk woSeAvVj7IjlbZGBiRvC4pGKGob6fIWRgFMReHVB82DC/XK9OW9xQNEtgzuTztF/gkVKU0 E/LCx+ImyuJ54q0i4r6IKHf92rRoGoHopSXnsc5BybaZUtpoob97fvMils+xOnXEAuB2Ft 7nIbSJ8WGo38jUQvNU+XdWotxgwtdkUpulKXaRO08Ic5Hzj0Cxxz0EcksMoPDUPH3x5oxk K1sF88bzxl4I1cjiZ+NDGvTZ1csG5agu12mKtiDKx+F4D2J+fjDGgf1wKv/k/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776209063; a=rsa-sha256; cv=none; b=t6yqhuWDzXELtNd81KXZPYmVMsqzUcqz8YeAuufLLFB8QKP6zKvby27xfXYzrEtWIiqnar 0ddcGKVR7EjSjG77qIzwE9Le8VB5RsZ+iasaZhQVN3W+GDwR9R3shYrNdVi/TK5d6zz83t fKGovMNsPDvA3X9a26m6QlO7Lj63yfEKprATGCNwbXBlV/+3KfVcJw6lQvZHalYczdUcYQ EJik9/ilshSZc5bDbBLxay/CQKMn5/gg9CSMR/rP+ngCf/eHCIGTFNqz3xEkS1qvUClCaF Mi4+yGE8EuqmPHa4pO1XCHQSUwQZ+iFdgjpinul52R/N1MEHPGcyNHkeNWj6Ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776209063; 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=6kXC19q8AmQcpohB67DwKYG3x/sdQhrv4TTbhB/lrNM=; b=SV6ZpNQUAMu9D39z0SqrHi07qC3d7WLSrn2O8yCZSLkrcK5xS7eqi+1aaIi4S9bU/xzPHJ IwqyYpNbVJom4X5sfIarZAAp9je5sVLDqlU15YMfN/hctyCDkXzlSQpaE8E/LRos0SU++h I5prcEhKPU6cUhWAe7/VNU58egx99XpmmL9qjNH8aO4v0TokPkCH8YZb6JdD9MGVN9kFLq yeqQtLzFon/4eV+XtkdWnfOy/9FOanbBPMB5u+eV/L5LbQP6AlS63XwlPk+U10bQ753PYm mfQqYQ1KzZYlFAPGOTagdR/niQ93XA42kVzbIhGRYvagR8DwNmHniXehiwkzCg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwL2b1C1sz19VD for ; Tue, 14 Apr 2026 23:24:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31320 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 14 Apr 2026 23:24:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gleb Smirnoff Subject: git: 6b00c652db7f - main - inpcb: make in6_pcbdisconnect() just like in_pcbdisconnect() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 6b00c652db7f43c698e8e3a902f266025c3126ac Auto-Submitted: auto-generated Date: Tue, 14 Apr 2026 23:24:17 +0000 Message-Id: <69decca1.31320.3f0a2e24@gitrepo.freebsd.org> The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=6b00c652db7f43c698e8e3a902f266025c3126ac commit 6b00c652db7f43c698e8e3a902f266025c3126ac Author: Gleb Smirnoff AuthorDate: 2026-04-14 23:23:26 +0000 Commit: Gleb Smirnoff CommitDate: 2026-04-14 23:23:26 +0000 inpcb: make in6_pcbdisconnect() just like in_pcbdisconnect() Allow to be passed with already unconnected inpcb. Fixes: 4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 --- sys/netinet6/in6_pcb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netinet6/in6_pcb.c b/sys/netinet6/in6_pcb.c index ad596cf761d2..3750c7040fbc 100644 --- a/sys/netinet6/in6_pcb.c +++ b/sys/netinet6/in6_pcb.c @@ -531,6 +531,9 @@ in6_pcbdisconnect(struct inpcb *inp) KASSERT(inp->inp_smr == SMR_SEQ_INVALID, ("%s: inp %p was already disconnected", __func__, inp)); + if (inp->inp_flags & INP_UNCONNECTED) + return; + INP_HASH_WLOCK(inp->inp_pcbinfo); in_pcbremhash(inp); inp->inp_flags |= INP_UNCONNECTED; From nobody Wed Apr 15 04:28:05 2026 X-Original-To: dev-commits-src-main@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 4fwSn66Pdjz6ZF0t for ; Wed, 15 Apr 2026 04:28:10 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwSn64Qpmz3qWC for ; Wed, 15 Apr 2026 04:28:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776227290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QS9yx4AChKMEuIcmHNToR+WSrhZuJz5Z/DaCnAxLTFk=; b=baAYYPn8QPL0wfs+r4gTESZIUtyNh8aWvELnzSokIdkm4/ifVJ1PWWMoNKyXKmsGPdlmb3 zpEpa2D79oHjTdeywCnovK7hkaIipf1ZSRv8sxIa43/QtbyQXeT71wKzR+rrUuPwRRea9l z64RgJSplPh/OZN6/meKaycMmpqGr7qP90gXn6zWX0SrXG54V19Hoj7hXC2yxZPsz+WMDE qfmwuHteh9zWI5AMXqiL5qBbRQwV/o4mYBhQbbMayOAf9mFvFp1wbnzuHfAyBlZ1KhTAwy dzn2ryAYDb8WZKwHbRh1dzscSXEHvk9C8T16YljvzMi/0E4mbxgvBG5NVmnufQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776227290; a=rsa-sha256; cv=none; b=Y1YWOA2foweTO0k+sn+V5cLDsk5BBN+Z4ZJBXkLYN9HlDVrOoMl3B+D7aMvPNaN6ri/Lls jWgbcz5VICQG9xxl4tjTaWC0D8W6ymmsuTK/furKf+oqdiKqfn+WdbaH7oUcAUCjswr8iK NAYXXI/9G4TpTkv4/hmiZj+JyI0miFgsmRNmTshalSfvTQ/5WktTjwo6vxluxovFiByRxb EjQ+IMjL0hwxQkEEbL3KZwh0F4haE+7y0XZilJS9xVgwchx/Lv1WL465KtDCyPGNM2K/KC Utyc66xrMyi0N6/Ib21wFAlHWpOg7xQPWPidP24fT+KSD+tSNkQlhBxT8ZYQgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776227290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QS9yx4AChKMEuIcmHNToR+WSrhZuJz5Z/DaCnAxLTFk=; b=NgMqzKBRcf75y5xjAWoDvTe2XpPDmRdWkEXkcOHyk/Eu37lmAiLHpYtD2PlyvX+bGVt8yt oH4OEC1XqXkGPg1P1jsSwLokAncus4oq6pbD7kCqjYNZhLlHPjtarOg0emzbpeO++cXbkh em8WyglgiON7IDA/Kmn0U3HlcUmyg0h8T7T9Aei+hxmJBRZogcWu31GRTkmUmVIWDeX+bO yFvlvtI2L9bYGJwkKvBBxk3PR3TsLz2tn0q4KXKRsb6+jzHiFUxRo7iMwwMs+bi5LNvG00 zFYd66FZGHJr4rFltwBTaCknIWD6CbpTfY9mIqnYrh8jKBE1JQbBcaz8V+g1VQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwSn63Ssgz1KVg for ; Wed, 15 Apr 2026 04:28:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3084c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 04:28:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Abdelkader Boudih From: Adrian Chadd Subject: git: 3e27114a7f96 - main - asmc: add raw SMC key read/write interface List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3e27114a7f961aac49d75a663a55332375d0bef3 Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 04:28:05 +0000 Message-Id: <69df13d5.3084c.15512e6d@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=3e27114a7f961aac49d75a663a55332375d0bef3 commit 3e27114a7f961aac49d75a663a55332375d0bef3 Author: Abdelkader Boudih AuthorDate: 2026-04-15 04:20:52 +0000 Commit: Adrian Chadd CommitDate: 2026-04-15 04:21:46 +0000 asmc: add raw SMC key read/write interface This patch adds a debugging interface to read and write arbitrary Apple SMC keys by name through sysctl, enabling hardware exploration and control of undocumented features. The interface provides four sysctls under dev.asmc.0.raw.*: - key - Set the 4-character SMC key name (e.g., "AUPO") - value - Read/write key value as a hex string - len - Auto-detected key value length (can be overridden) - type - Read-only 4-character type string (e.g., "ui8", "flt") Implementation includes a new asmc_key_getinfo() function using SMC command 0x13 to query key metadata. The interface automatically detects key lengths and types, uses hex string encoding for arbitrary binary values, and is safe for concurrent access via CTLFLAG_NEEDGIANT. This interface was essential for discovering that the AUPO key enables Wake-on-LAN from S5 state, and for mapping all 297 SMC keys on Mac Mini 5,1. Reviewed by: ngie, adrian, markj Differential Revision: https://reviews.freebsd.org/D54441 --- share/man/man4/asmc.4 | 29 +++++ sys/dev/asmc/asmc.c | 287 +++++++++++++++++++++++++++++++++++++++++-------- sys/dev/asmc/asmcvar.h | 19 ++++ 3 files changed, 288 insertions(+), 47 deletions(-) diff --git a/share/man/man4/asmc.4 b/share/man/man4/asmc.4 index 9e3550661797..9b42d021e1aa 100644 --- a/share/man/man4/asmc.4 +++ b/share/man/man4/asmc.4 @@ -112,6 +112,35 @@ minimum fan speed, the minimum speed and the maximum speed respectively. .Pp All values are in RPM. +.Sh RAW SMC KEY ACCESS +When the kernel is compiled with the +.Dv ASMC_DEBUG +option, a set of sysctl nodes is provided under +.Va dev.asmc.%d.raw +for reading and writing arbitrary SMC keys by name. +.Pp +.Bl -tag -width "dev.asmc.%d.raw.value" -compact +.It Va dev.asmc.%d.raw.key +Set the 4-character SMC key name to access (e.g.,\& +.Dq AUPO ) . +Setting this automatically queries the key's length and type. +.It Va dev.asmc.%d.raw.value +Read or write the key's value as a hex string. +.It Va dev.asmc.%d.raw.len +The auto-detected value length in bytes (read-only). +.It Va dev.asmc.%d.raw.type +The 4-character SMC type string (e.g.,\& +.Dq ui8 , +.Dq flt ) +(read-only). +.El +.Pp +Example usage: +.Bd -literal -offset indent +sysctl dev.asmc.0.raw.key=AUPO +sysctl dev.asmc.0.raw.value +sysctl dev.asmc.0.raw.value=01 +.Ed .Sh SUDDEN MOTION SENSOR The Sudden Motion Sensor (SMS for short) is a device that detects laptop movement and notifies the operating system via an interrupt. diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index 4a6734e22786..044fd7e85057 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -123,6 +123,15 @@ static int asmc_mbp_sysctl_light_control(SYSCTL_HANDLER_ARGS); static int asmc_mbp_sysctl_light_left_10byte(SYSCTL_HANDLER_ARGS); static int asmc_wol_sysctl(SYSCTL_HANDLER_ARGS); +#ifdef ASMC_DEBUG +/* Raw key access */ +static int asmc_key_getinfo(device_t, const char *, uint8_t *, char *); +static int asmc_raw_key_sysctl(SYSCTL_HANDLER_ARGS); +static int asmc_raw_value_sysctl(SYSCTL_HANDLER_ARGS); +static int asmc_raw_len_sysctl(SYSCTL_HANDLER_ARGS); +static int asmc_raw_type_sysctl(SYSCTL_HANDLER_ARGS); +#endif + struct asmc_model { const char *smc_model; /* smbios.system.product env var. */ const char *smc_desc; /* driver description */ @@ -828,6 +837,43 @@ asmc_attach(device_t dev) } } +#ifdef ASMC_DEBUG + /* + * Raw SMC key access for debugging. + */ + sc->sc_raw_tree = SYSCTL_ADD_NODE(sysctlctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "raw", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Raw SMC key access"); + + SYSCTL_ADD_PROC(sysctlctx, + SYSCTL_CHILDREN(sc->sc_raw_tree), + OID_AUTO, "key", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, + dev, 0, asmc_raw_key_sysctl, "A", + "SMC key name (4 chars)"); + + SYSCTL_ADD_PROC(sysctlctx, + SYSCTL_CHILDREN(sc->sc_raw_tree), + OID_AUTO, "value", + CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_MPSAFE, + dev, 0, asmc_raw_value_sysctl, "A", + "SMC key value (hex string)"); + + SYSCTL_ADD_PROC(sysctlctx, + SYSCTL_CHILDREN(sc->sc_raw_tree), + OID_AUTO, "len", + CTLTYPE_U8 | CTLFLAG_RD | CTLFLAG_MPSAFE, + dev, 0, asmc_raw_len_sysctl, "CU", + "SMC key value length"); + + SYSCTL_ADD_PROC(sysctlctx, + SYSCTL_CHILDREN(sc->sc_raw_tree), + OID_AUTO, "type", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + dev, 0, asmc_raw_type_sysctl, "A", + "SMC key type (4 chars)"); +#endif + if (model->smc_sms_x == NULL) goto nosms; @@ -1202,10 +1248,10 @@ static int asmc_key_dump(device_t dev, int number) { struct asmc_softc *sc = device_get_softc(dev); - char key[5] = { 0 }; - char type[7] = { 0 }; + char key[ASMC_KEYLEN + 1] = { 0 }; + char type[ASMC_KEYINFO_RESPLEN + 1] = { 0 }; uint8_t index[4]; - uint8_t v[32]; + uint8_t v[ASMC_MAXVAL]; uint8_t maxlen; int i, error = 1, try = 0; @@ -1214,40 +1260,40 @@ asmc_key_dump(device_t dev, int number) index[0] = (number >> 24) & 0xff; index[1] = (number >> 16) & 0xff; index[2] = (number >> 8) & 0xff; - index[3] = (number) & 0xff; + index[3] = number & 0xff; begin: - if (asmc_command(dev, 0x12)) + if (asmc_command(dev, ASMC_CMDGETBYINDEX)) goto out; - for (i = 0; i < 4; i++) { + for (i = 0; i < ASMC_KEYLEN; i++) { ASMC_DATAPORT_WRITE(sc, index[i]); - if (asmc_wait(dev, 0x04)) + if (asmc_wait(dev, ASMC_STATUS_AWAIT_DATA)) goto out; } - ASMC_DATAPORT_WRITE(sc, 4); + ASMC_DATAPORT_WRITE(sc, ASMC_KEYLEN); - for (i = 0; i < 4; i++) { - if (asmc_wait(dev, 0x05)) + for (i = 0; i < ASMC_KEYLEN; i++) { + if (asmc_wait(dev, ASMC_STATUS_DATA_READY)) goto out; key[i] = ASMC_DATAPORT_READ(sc); } - /* get type */ - if (asmc_command(dev, 0x13)) + /* Get key info (length + type). */ + if (asmc_command(dev, ASMC_CMDGETINFO)) goto out; - for (i = 0; i < 4; i++) { + for (i = 0; i < ASMC_KEYLEN; i++) { ASMC_DATAPORT_WRITE(sc, key[i]); - if (asmc_wait(dev, 0x04)) + if (asmc_wait(dev, ASMC_STATUS_AWAIT_DATA)) goto out; } - ASMC_DATAPORT_WRITE(sc, 6); + ASMC_DATAPORT_WRITE(sc, ASMC_KEYINFO_RESPLEN); - for (i = 0; i < 6; i++) { - if (asmc_wait(dev, 0x05)) + for (i = 0; i < ASMC_KEYINFO_RESPLEN; i++) { + if (asmc_wait(dev, ASMC_STATUS_DATA_READY)) goto out; type[i] = ASMC_DATAPORT_READ(sc); } @@ -1255,41 +1301,188 @@ begin: error = 0; out: if (error) { - if (++try < 10) + if (++try < ASMC_MAXRETRIES) goto begin; - device_printf(dev, "%s for key %s failed %d times, giving up\n", - __func__, key, try); - mtx_unlock_spin(&sc->sc_mtx); - } else { - char buf[1024]; - char buf2[8]; - mtx_unlock_spin(&sc->sc_mtx); - maxlen = type[0]; - type[0] = ' '; - type[5] = 0; - if (maxlen > sizeof(v)) { - device_printf(dev, - "WARNING: cropping maxlen from %d to %zu\n", maxlen, - sizeof(v)); - maxlen = sizeof(v); - } - for (i = 0; i < sizeof(v); i++) { - v[i] = 0; - } - asmc_key_read(dev, key, v, maxlen); - snprintf(buf, sizeof(buf), - "key %d is: %s, type %s (len %d), data", - number, key, type, maxlen); - for (i = 0; i < maxlen; i++) { - snprintf(buf2, sizeof(buf2), " %02x", v[i]); - strlcat(buf, buf2, sizeof(buf)); - } - strlcat(buf, " \n", sizeof(buf)); - device_printf(dev, "%s", buf); + device_printf(dev, + "%s for key %d failed %d times, giving up\n", + __func__, number, try); + } + mtx_unlock_spin(&sc->sc_mtx); + + if (error) + return (error); + + maxlen = type[0]; + type[0] = ' '; + type[5] = '\0'; + if (maxlen > sizeof(v)) + maxlen = sizeof(v); + + memset(v, 0, sizeof(v)); + error = asmc_key_read(dev, key, v, maxlen); + if (error) + return (error); + + device_printf(dev, "key %d: %s, type%s (len %d), data", + number, key, type, maxlen); + for (i = 0; i < maxlen; i++) + printf(" %02x", v[i]); + printf("\n"); + + return (0); +} + +/* + * Get key info (length and type) from SMC using command 0x13. + * Returns 0 on success, -1 on failure. + * If len is non-NULL, stores the key's value length. + * If type is non-NULL, stores the 4-char type string (must be at least 5 bytes). + */ +static int +asmc_key_getinfo(device_t dev, const char *key, uint8_t *len, char *type) +{ + struct asmc_softc *sc = device_get_softc(dev); + uint8_t info[ASMC_KEYINFO_RESPLEN]; + int i, error = -1, try = 0; + + mtx_lock_spin(&sc->sc_mtx); + +begin: + if (asmc_command(dev, ASMC_CMDGETINFO)) + goto out; + + for (i = 0; i < ASMC_KEYLEN; i++) { + ASMC_DATAPORT_WRITE(sc, key[i]); + if (asmc_wait(dev, ASMC_STATUS_AWAIT_DATA)) + goto out; } + ASMC_DATAPORT_WRITE(sc, ASMC_KEYINFO_RESPLEN); + + for (i = 0; i < ASMC_KEYINFO_RESPLEN; i++) { + if (asmc_wait(dev, ASMC_STATUS_DATA_READY)) + goto out; + info[i] = ASMC_DATAPORT_READ(sc); + } + + error = 0; +out: + if (error && ++try < ASMC_MAXRETRIES) + goto begin; + mtx_unlock_spin(&sc->sc_mtx); + + if (error == 0) { + if (len != NULL) + *len = info[0]; + if (type != NULL) { + for (i = 0; i < ASMC_TYPELEN; i++) + type[i] = info[i + 1]; + type[ASMC_TYPELEN] = '\0'; + } + } return (error); } + +/* + * Raw SMC key access sysctls - enables reading/writing any SMC key by name + * Usage: + * sysctl dev.asmc.0.raw.key=AUPO # Set key, auto-detects length + * sysctl dev.asmc.0.raw.value # Read current value (hex bytes) + * sysctl dev.asmc.0.raw.value=01 # Write new value + */ +static int +asmc_raw_key_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev = (device_t) arg1; + struct asmc_softc *sc = device_get_softc(dev); + char newkey[ASMC_KEYLEN + 1]; + uint8_t keylen; + int error; + + strlcpy(newkey, sc->sc_rawkey, sizeof(newkey)); + error = sysctl_handle_string(oidp, newkey, sizeof(newkey), req); + if (error || req->newptr == NULL) + return (error); + + if (strlen(newkey) != ASMC_KEYLEN) + return (EINVAL); + + /* Get key info to auto-detect length and type */ + if (asmc_key_getinfo(dev, newkey, &keylen, sc->sc_rawtype) != 0) + return (ENOENT); + + if (keylen > ASMC_MAXVAL) + keylen = ASMC_MAXVAL; + + strlcpy(sc->sc_rawkey, newkey, sizeof(sc->sc_rawkey)); + sc->sc_rawlen = keylen; + memset(sc->sc_rawval, 0, sizeof(sc->sc_rawval)); + + /* Read the key value */ + asmc_key_read(dev, sc->sc_rawkey, sc->sc_rawval, sc->sc_rawlen); + + return (0); +} + +static int +asmc_raw_value_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev = (device_t) arg1; + struct asmc_softc *sc = device_get_softc(dev); + char hexbuf[ASMC_MAXVAL * 2 + 1]; + int error, i; + + /* Refresh from SMC if a key has been selected. */ + if (sc->sc_rawkey[0] != '\0') { + asmc_key_read(dev, sc->sc_rawkey, sc->sc_rawval, + sc->sc_rawlen > 0 ? sc->sc_rawlen : ASMC_MAXVAL); + } + + /* Format as hex string */ + for (i = 0; i < sc->sc_rawlen && i < ASMC_MAXVAL; i++) + snprintf(hexbuf + i * 2, 3, "%02x", sc->sc_rawval[i]); + hexbuf[i * 2] = '\0'; + + error = sysctl_handle_string(oidp, hexbuf, sizeof(hexbuf), req); + if (error || req->newptr == NULL) + return (error); + + /* Reject writes until a key is selected via raw.key. */ + if (sc->sc_rawkey[0] == '\0') + return (EINVAL); + + memset(sc->sc_rawval, 0, sizeof(sc->sc_rawval)); + for (i = 0; i < sc->sc_rawlen && hexbuf[i*2] && hexbuf[i*2+1]; i++) { + unsigned int val; + char tmp[3] = { hexbuf[i*2], hexbuf[i*2+1], 0 }; + if (sscanf(tmp, "%02x", &val) == 1) + sc->sc_rawval[i] = (uint8_t)val; + } + + if (asmc_key_write(dev, sc->sc_rawkey, sc->sc_rawval, sc->sc_rawlen) != 0) + return (EIO); + + return (0); +} + +static int +asmc_raw_len_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev = (device_t) arg1; + struct asmc_softc *sc = device_get_softc(dev); + + return (sysctl_handle_8(oidp, &sc->sc_rawlen, 0, req)); +} + +static int +asmc_raw_type_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev = (device_t) arg1; + struct asmc_softc *sc = device_get_softc(dev); + + return (sysctl_handle_string(oidp, sc->sc_rawtype, + sizeof(sc->sc_rawtype), req)); +} #endif static int diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h index cfc176559ed9..0e8d4e9d4a36 100644 --- a/sys/dev/asmc/asmcvar.h +++ b/sys/dev/asmc/asmcvar.h @@ -28,6 +28,9 @@ */ #define ASMC_MAXFANS 6 +#define ASMC_MAXVAL 32 /* Maximum SMC value size */ +#define ASMC_KEYLEN 4 /* SMC key name length */ +#define ASMC_TYPELEN 4 /* SMC type string length */ struct asmc_softc { device_t sc_dev; @@ -53,6 +56,14 @@ struct asmc_softc { uint8_t sc_sms_intr_works; struct cdev *sc_kbd_bkl; uint32_t sc_kbd_bkl_level; +#ifdef ASMC_DEBUG + /* Raw key access */ + struct sysctl_oid *sc_raw_tree; + char sc_rawkey[ASMC_KEYLEN + 1]; + uint8_t sc_rawval[ASMC_MAXVAL]; + uint8_t sc_rawlen; + char sc_rawtype[ASMC_TYPELEN + 1]; +#endif }; /* @@ -71,6 +82,14 @@ struct asmc_softc { bus_write_1(sc->sc_ioport, 0x04, val) #define ASMC_CMDREAD 0x10 #define ASMC_CMDWRITE 0x11 +#define ASMC_CMDGETBYINDEX 0x12 +#define ASMC_CMDGETINFO 0x13 + +#define ASMC_STATUS_AWAIT_DATA 0x04 +#define ASMC_STATUS_DATA_READY 0x05 + +#define ASMC_KEYINFO_RESPLEN 6 /* getinfo: 1 len + 4 type + 1 attr */ +#define ASMC_MAXRETRIES 10 /* * Interrupt port. From nobody Wed Apr 15 08:35:21 2026 X-Original-To: dev-commits-src-main@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 4fwZGK2cLsz6ZWdk for ; Wed, 15 Apr 2026 08:35:21 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwZGK20Hsz4HGC for ; Wed, 15 Apr 2026 08:35:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776242121; 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=BVl0dOZuCAVcFSjbhv/zuz4xke6IvgMwa9JpdFXio4c=; b=xzVINK2L7AxvvV+FNe11AJ02ANfgh7nAwnjc/D3jDuAa+5aBxC1Q/4SucANImW9u5hvVPa UUqWjaX9khxv2/8jLnP2kpTNmkEhxCW7DUyV9qz5KAIvhYY5FJUZQFy+7EROsViWZM7bcr 2Viy+H1x3xzxdAtpDE/nbq2UKRSFX0CQ++E4eBjbByxEFyn9i2+zt61fVRgGQ/FbTUKf9/ BLXAM9OL3zW59Bzyz96NJClRecryai1wrjlYhg08TlZjE9eS8vtJAdPjGb5ZHkqWebh58r YU3CAhA8JxamUrVCJTj3Ttype/7MifCu8hvYtgNLn815oepNibkVvql4LSvS8A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776242121; a=rsa-sha256; cv=none; b=yGmxq4gRsTUp6PQW13KiHZQQqEEND9qfw1SZWPUPnxGoZTO9D0Scspos9e6+r8igQvhLmV Rdxp9qc9Db8qu0/SpvcsB+GHJfb2zx0ock74ZnN19XG5kWkAr1VBvO+0dXBaxUAw+cg0KR 4DY4JWydn/Xx+foYlBw0OIk7n2tqvXltISKQiw3SY1C0Q2WOXxMibRZ8AXBou5pDXooyP5 10Ka0MsuP+dMyCFrRb2KXGYpxVRR5C+9htRoHX+jfdWilNLQjbWSnStmuGeOb5QXFtFG// g8dFNWIdTofvc0sV8RbpCYEZRBxdkBQ3o70ydzxxmH/aUwuKtoBS12ryakdS3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776242121; 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=BVl0dOZuCAVcFSjbhv/zuz4xke6IvgMwa9JpdFXio4c=; b=PAByfCmPzXtIFBUPhOA+ILBC9LU+MgrLzQbs2ZsRuOHwAL7BFeaqQJuFA8GlDvNsYBKN92 D34Q3WrPNbr6iRah9mExekTbZ2EFST7bDhC2UgU9suI0zdG+03CK9PslaDklsma1pkPlLt 2Tr3WALfYHrEFo4gNjY1F3feM4MicwLXZGisTRYaDKkPtdzmcvn3mMOqpJBkXxXwpRZkfz 4W8QR91uBebVbRip0rehGWQNo3zn8rYiwIG1caOmAA+WkiH1cVNmyjYfeA/71CWvQ2kwR3 //X9lS+tqY497cdizH9TyczXXLj/upOirmshi43aEbNgDqHLKZWMgYvrar2qjA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwZGK1XlPz1S5D for ; Wed, 15 Apr 2026 08:35:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 18e73 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 08:35:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 00dccc3164c6 - main - sys/time: appease gcc -Wtype-limits List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 00dccc3164c6dff38350a1baeeea7238acf2efc3 Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 08:35:21 +0000 Message-Id: <69df4dc9.18e73.533e828@gitrepo.freebsd.org> The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=00dccc3164c6dff38350a1baeeea7238acf2efc3 commit 00dccc3164c6dff38350a1baeeea7238acf2efc3 Author: Ryan Libby AuthorDate: 2026-04-15 08:08:37 +0000 Commit: Ryan Libby CommitDate: 2026-04-15 08:08:37 +0000 sys/time: appease gcc -Wtype-limits In environments where time_t is 32 bits, including the 32-bit library build on amd64, the overflow being tested for cannot happen, and gcc complains with -Wtype-limits, causing the gcc build to fail. Work around this by ifdef'ing out the saturation code on i386. Reviewed by: imp, jfree Discussed with: markj Fixes: e3799530b3ba ("sys/time: Add saturating sbt conversions") Differential Revision: https://reviews.freebsd.org/D56369 --- sys/sys/time.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/sys/time.h b/sys/sys/time.h index 707565b6a6f1..6f18d8bd844d 100644 --- a/sys/sys/time.h +++ b/sys/sys/time.h @@ -355,10 +355,12 @@ tstosbt(struct timespec _ts) static __inline sbintime_t tstosbt_sat(struct timespec _ts) { +#ifndef __i386__ if (_ts.tv_sec > SBT_MAX >> 32) return (SBT_MAX); if (_ts.tv_sec < -(SBT_MAX >> 32) - 1) return (-SBT_MAX - 1); +#endif return (tstosbt(_ts)); } @@ -382,10 +384,12 @@ tvtosbt(struct timeval _tv) static __inline sbintime_t tvtosbt_sat(struct timeval _tv) { +#ifndef __i386__ if (_tv.tv_sec > SBT_MAX >> 32) return (SBT_MAX); if (_tv.tv_sec < -(SBT_MAX >> 32) - 1) return (-SBT_MAX - 1); +#endif return (tvtosbt(_tv)); } From nobody Wed Apr 15 09:06:58 2026 X-Original-To: dev-commits-src-main@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 4fwZyw0Fn0z6ZYgj for ; Wed, 15 Apr 2026 09:07:04 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwZyv6X6Yz4LT6 for ; Wed, 15 Apr 2026 09:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776244024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xViJpGgwQufjZnoD//rE5jxx4ku/l+yqmqLjwngBqbI=; b=MRXcEXlOdJLjeqEMzXl6YxOWh5GeoKC0knrN26ecDFSWahOTM97oYcd5Lww6SZmiwOyzoI QPMvQ90Q73ST/sGAMSXgkJZ+ieqt1aLCR3VY1JmwE3hjcGusScqWTBDPz6mXeHynrhketZ iwKZrNziPv9NC1k14qcOH+jilkwc4o5FH1YLBaj0EXDPed/v4EhtTo5s5Dq2REr7q/9bdi EbBj/5dSKY7CKkJc4OogcVxZFs63b3JV81ilwp65jzjL3dtXg14GLyZCPQzw+bAynM8abd JHtdAJEuxofEmjvQ4XpHY/2O86QNn97hSqMMWq207Ecy9uwfcr3IY+AsWMq1MA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776244023; a=rsa-sha256; cv=none; b=f5s2c3Q9QMcSfjk95a2KB84u/KanatRsnaY29kMlPlefH8dsZQAVMkedz04smm6opyqOt8 7N5bjcx8yQRJn5uNEWzdUhJJV+QzWSbxK4PMWdp0BbZQUhhTyiJeTBCFYPeLHkH5EdgsQK mhgbyGFJEYB9W3avlALX3ReVw1I1YGemGPpfIzXD52KOerKAqy1ULsYWxpumpYll8BJhGE PImHccVTLr976LNCCgiZq6/XI+wtRUsoFnGUp0ZJzE4WA+4NVxh77/k9faUQedCC/Ni259 uF2jXmWrBU9vOOnu8aIur6uTf2Yb55VjG5lxFEM7hUrF6FUlZ6bE5bQOAjlB6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776244023; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xViJpGgwQufjZnoD//rE5jxx4ku/l+yqmqLjwngBqbI=; b=uIN5IK/FzAFKcX57JRa0uNwyUnwHdnnPkjBth0qsqgqCQolGCwzoR5dkkyrLxHJIxq6PfV cOVieM8ZjCj0tNG4hFb8B8nvmnWkzgBR04vzKKftEP1MyknSLrbRqAGvbq3Jg/9mGkWt8n JO58BxFwLkIZY3oqWVQwwxiTCTgZqAeLNnA1jWivYaoqYDl67z/mPYX9RVetI7eYBzqI3l IozIypDi8qjRivZuNVy+GXpmFcsWVAmgQ7HLpFgptzO02HRIVDxQQ+UC6SkXUn1kDHRtQ5 qurPI8yHas8P5UHKfdamr7Q9VAKpNRzBIYBlmejaCPb14LFJ9oXSaextAfWZKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwZyv64w2z2D for ; Wed, 15 Apr 2026 09:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1f122 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 09:06:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Aotian Cao From: Michael Osipov Subject: git: 47a9af4b39bf - main - rc.d/NETWORKING: remove the NETWORK alias List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47a9af4b39bf174efed7f6d43644d4b0bc0c9886 Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 09:06:58 +0000 Message-Id: <69df5532.1f122.4d9b8d92@gitrepo.freebsd.org> The branch main has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=47a9af4b39bf174efed7f6d43644d4b0bc0c9886 commit 47a9af4b39bf174efed7f6d43644d4b0bc0c9886 Author: Aotian Cao AuthorDate: 2026-04-08 07:58:00 +0000 Commit: Michael Osipov CommitDate: 2026-04-15 09:06:32 +0000 rc.d/NETWORKING: remove the NETWORK alias NETWORKING is the documented placeholder, while /etc/rc.d/NETWORKING still provides the legacy alias NETWORK. The NETWORKING script was originally introduced to avoid conflicts with NetBSD's lowercase network script on case-insensitive file systems. The NETWORK alias was retained for compatibility with older scripts. Following the discussion in PR 293652, remove the legacy NETWORK alias from 16-CURRENT. Keeping both names adds more confusion than value now that NETWORKING is the documented placeholder and current base system and ports tree uses are already clean. Add an UPDATING entry to note that local RC scripts using REQUIRE: NETWORK should be migrated to REQUIRE: NETWORKING. PR: 293652 Reviewed by: michaelo, jlduran Relnotes: yes Differential Revision: https://reviews.freebsd.org/D56300 --- UPDATING | 6 ++++++ libexec/rc/rc.d/NETWORKING | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/UPDATING b/UPDATING index d4a6e486aed0..c60143c6184e 100644 --- a/UPDATING +++ b/UPDATING @@ -27,6 +27,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 16.x IS SLOW: world, or to merely disable the most expensive debugging functionality at runtime, run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20260412: + The /etc/rc.d/NETWORKING script no longer provides the legacy + NETWORK alias. Third-party or local RC scripts that still use + "REQUIRE: NETWORK" shall be updated to use "REQUIRE: NETWORKING" + instead. + 20260129: The "net.inet6.ip6.use_stableaddr" sysctl is now on by default. This changes the default algorithm to choose IPv6 SLAAC autogenerated diff --git a/libexec/rc/rc.d/NETWORKING b/libexec/rc/rc.d/NETWORKING index 402e20927a4c..8f46e78e3426 100755 --- a/libexec/rc/rc.d/NETWORKING +++ b/libexec/rc/rc.d/NETWORKING @@ -2,7 +2,7 @@ # # -# PROVIDE: NETWORKING NETWORK +# PROVIDE: NETWORKING # REQUIRE: netif netwait netoptions routing ppp ipfw stf # REQUIRE: defaultroute route6d resolv bridge # REQUIRE: static_arp static_ndp From nobody Wed Apr 15 09:29:00 2026 X-Original-To: dev-commits-src-main@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 4fwbST0XcLz6ZbD0 for ; Wed, 15 Apr 2026 09:29:13 +0000 (UTC) (envelope-from rlibby@gmail.com) Received: from mail-yw1-f180.google.com (mail-yw1-f180.google.com [209.85.128.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwbSS5grkz4PRl for ; Wed, 15 Apr 2026 09:29:12 +0000 (UTC) (envelope-from rlibby@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-yw1-f180.google.com with SMTP id 00721157ae682-79a46260385so70877087b3.3 for ; Wed, 15 Apr 2026 02:29:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776245352; x=1776850152; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=VzbspL4cP++Ktdk5RQBJd18u2DonjLp/cTewYc6bQqs=; b=VXLcG8dYTb5puc/cksz6P82zSA1KyMjZcXQ+I4txX7nagXNVLHnWL3RRPrn0muUhd1 RBp7wcmYKpqVbEYtPc9PKM3Y287eoSEa1w7ioKCLbDqs/3NQM08Z3bjYOL6iSqPidClI UrSRgLXw2pbhGjHBgBh6I02jllw0YzXBFYm0FCfxnzVQeUGcO8olUD5qBxfJReKNkI12 yn6v80aMEqTo7VsvowLae7hjYOIfUl3AMEi4bF+s5nk+ydTGbVhnN3Lg4482Xtq6TuJd 00RtcdfwmKgo5Pq9VstmTT2+LSouHKcj/TM/RO8mVGDoA9V0DJbRR/tgQljoL8ArF1p8 5Gkg== X-Forwarded-Encrypted: i=1; AFNElJ+Hy5tFBGw5a4YpaqARinIbEPFSTJxMSaba09UdfJjtcifNfANZMA3tsvZEXcK9TB0YsbzBphDTAkxbie3c882h0P1uUA==@freebsd.org X-Gm-Message-State: AOJu0Ywgit96XtD0KyBd0MnEfjJskMR599JmDgxF0Tbmd2kDghqHov4T AYg1wztKp/9XKM5lnqs/fFq8PVmX1SYi6+iGgtOTapHomsKDsKnIFk9eaoAPLQ== X-Gm-Gg: AeBDieuJ7YF4gIEUK3Mi8cOBAvpA2bbhxuKjKAkXOoMw5QpV84l4Xg+pOxGF76Bmj3B byygf4yzT9iDuIZY41VctQgDLn1d7m0nsswd+kyuxPOXfTwyNxCyAiyMwHaXoYFDeJaHuJ2odzv /DNxcAgfoN2sR1FOUZ2YcKbw3rPeKK6zRTJ26pZ0VjqQHk7czl3Cap9Fg+6ShfKrKGTjRRQi9e9 1i/IO8Bgzjp6vKCCxLoqBtyau4aJWqyXBXPBrDVBUIPnjq/HNdQB7WsTotJwGMPsLztBI61ThhF GRQCeIMq9fFud/16zdP5JDn8L+Mlqf4IiHlLPuPSkh9eeVRg8vopkgAtvmOxfY/CsaLRuQAto0Y qJUTwkSIV208hrrXkA1CYdwR4dLnvajZ7TZu2UYuukwciOx+VO2Dn21W2Kw5nwgzOnIElC+erPm Ogq8n+vD1s81wrGnmCk7KorRSW9b6S9s3CxMiGVzyOasBYy9q+luBmsPlYKfBsdt2jHkLe X-Received: by 2002:a05:690c:dd4:b0:79b:dd37:69b4 with SMTP id 00721157ae682-7af6f8094ddmr205469847b3.13.1776245351910; Wed, 15 Apr 2026 02:29:11 -0700 (PDT) Received: from mail-yx1-f47.google.com (mail-yx1-f47.google.com. [74.125.224.47]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7b7662147e1sm6212937b3.1.2026.04.15.02.29.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Apr 2026 02:29:11 -0700 (PDT) Received: by mail-yx1-f47.google.com with SMTP id 956f58d0204a3-651b0eb2564so4248542d50.3 for ; Wed, 15 Apr 2026 02:29:11 -0700 (PDT) X-Forwarded-Encrypted: i=1; AFNElJ9adorF6fK7bYSzB3jgeWYIVbOYbl/MK3hz8LYh1x7YkBa/A6aZK6GZp1PmSoVxvgRlGqLolJv8rdK9uYe+2UtxLIsu9Q==@freebsd.org X-Received: by 2002:a05:690e:134c:b0:651:b7e2:6835 with SMTP id 956f58d0204a3-651b7e268f5mr14220448d50.35.1776245351276; Wed, 15 Apr 2026 02:29:11 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <69df4dc9.18e73.533e828@gitrepo.freebsd.org> In-Reply-To: From: Ryan Libby Date: Wed, 15 Apr 2026 02:29:00 -0700 X-Gmail-Original-Message-ID: X-Gm-Features: AQROBzD91QOFGW37l2Lr1t1IOEUQLUu3dQTDgfct01SVQPTZ-1Hod_ZIjz4-pho Message-ID: Subject: Re: git: 00dccc3164c6 - main - sys/time: appease gcc -Wtype-limits To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4fwbSS5grkz4PRl X-Spamd-Bar: ---- On Wed, Apr 15, 2026 at 2:00=E2=80=AFAM Konstantin Belousov wrote: > > On Wed, Apr 15, 2026 at 08:35:21AM +0000, Ryan Libby wrote: > > The branch main has been updated by rlibby: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D00dccc3164c6dff38350a1ba= eeea7238acf2efc3 > > > > commit 00dccc3164c6dff38350a1baeeea7238acf2efc3 > > Author: Ryan Libby > > AuthorDate: 2026-04-15 08:08:37 +0000 > > Commit: Ryan Libby > > CommitDate: 2026-04-15 08:08:37 +0000 > > > > sys/time: appease gcc -Wtype-limits > > > > In environments where time_t is 32 bits, including the 32-bit libra= ry > > build on amd64, the overflow being tested for cannot happen, and gc= c > > complains with -Wtype-limits, causing the gcc build to fail. Work > > around this by ifdef'ing out the saturation code on i386. > > > > Reviewed by: imp, jfree > > Discussed with: markj > > Fixes: e3799530b3ba ("sys/time: Add saturating sbt conversions") > > Differential Revision: https://reviews.freebsd.org/D56369 > > --- > > sys/sys/time.h | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/sys/sys/time.h b/sys/sys/time.h > > index 707565b6a6f1..6f18d8bd844d 100644 > > --- a/sys/sys/time.h > > +++ b/sys/sys/time.h > > @@ -355,10 +355,12 @@ tstosbt(struct timespec _ts) > > static __inline sbintime_t > > tstosbt_sat(struct timespec _ts) > > { > > +#ifndef __i386__ > > if (_ts.tv_sec > SBT_MAX >> 32) > > return (SBT_MAX); > > if (_ts.tv_sec < -(SBT_MAX >> 32) - 1) > > return (-SBT_MAX - 1); > > +#endif > > return (tstosbt(_ts)); > > } > > > > @@ -382,10 +384,12 @@ tvtosbt(struct timeval _tv) > > static __inline sbintime_t > > tvtosbt_sat(struct timeval _tv) > > { > > +#ifndef __i386__ > > if (_tv.tv_sec > SBT_MAX >> 32) > > return (SBT_MAX); > > if (_tv.tv_sec < -(SBT_MAX >> 32) - 1) > > return (-SBT_MAX - 1); > > +#endif > > return (tvtosbt(_tv)); > > } > > I dislike the direct tests for the arch. Could we add some define like > __SIZEOF_TIME_T and put the code under > #ifdef __SIZEOF_TIME_T >=3D 8 instead of __i386__? Sure, that would work, if you don't mind the wider patch and added definiti= ons. I put up this diff for review: https://reviews.freebsd.org/D56401 Ryan From nobody Wed Apr 15 09:37:35 2026 X-Original-To: dev-commits-src-main@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 4fwbf76LzBz6ZbWS for ; Wed, 15 Apr 2026 09:37:35 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwbf74vh8z4QH0 for ; Wed, 15 Apr 2026 09:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776245855; 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=gPImuYYSo5lEMjzEEBAvyhQLCnPIWV06dYLTTV/uvWg=; b=W1qwhSHHtkyx0thF9gSx1m/vmAplkwQ3kUiHbAc7vCaprSnZyx132/2O72XP0HWnmMHtpF EC7KH+OHRtBJYmk5n78v8q8IS7VW6Oh0nPxXci2EZalK59ri/hiCckgJrz4dHsPPRmCNJi HJWhDbvIVpnv75dN61y6FarzcJD1WfcrPYJTFMxdf++qkR4cbO5JRseFbrl8fCvMKuIzuu UBocpjWa/v65fZ4l7vITBZi9xdTHXPmwCDYeP3ASKwzpM4ebC3TsawjC3Nkqokx8QhbqIG Vtn62/bPgkni1Sn3lWT9Zyl18WzJ9j1t6+9nSvSFskIXfB0hyYcvuj3xr4kRTQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776245855; a=rsa-sha256; cv=none; b=FF//PRV1qs54FUkaNh0Vpgy4dtm9RZ+BzjsmUcgmER3+lmNt6CeFKMK6DZbzfe17OdEmKQ 8Vu1zToCKsWC+lEmqU+W4jw8hA8+Bf5ZJ0PS1YBtNu+AZg0J8KWIgSgEgwFr0pQPH+E158 3Vg4GMncDJTtD9PUZoJjjxVKfV8XMawyZjK6J4AA1UcM++PS+1/97n/lkUPmsPJaJqO0ei //98fD2GkqVVpQU+0C1GgHRm5u6vtwmqN+VNQztv6TzJJfN7JSUJKV6h1kl+G7o9hHwQ8d uR6C3IP4YvR/AOI4O+pvMinKQVw00a9NTnDxlhVMu7fPxnxZjdbzCqkbi+06Iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776245855; 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=gPImuYYSo5lEMjzEEBAvyhQLCnPIWV06dYLTTV/uvWg=; b=Ofhm87k18h2GxyuhmDgAIG6+bjk0mdAsl+0+EReoJa8b/aLGhwGkNqnf28j7kDZ/1D4ool OETlZCSTYHcAdMt3ls1QxclRmR+2PdZUdYH/lQz2baowIfIU+Gl+PTCEgxS/UKlWi01QRn 92Kp7z8kgjO+8pJ1xnWW/sw9IDBWGiMFDy9qL8xCITXydn2/B4ZQECl2/A+2TThcrfIrZ/ vnGeYCjjJ4fyhqnIMUirvpPXleYzpm7RpTgYUUf1/uXU/pzxWPHLKyKvudawxkeBdPxzlu xhUS/V1siXcvX+ZC4Q2BVMJq/I9vBhrGLNOPUiGMa0/l589LdwSro7S+/HnolQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwbf73zdzz14b for ; Wed, 15 Apr 2026 09:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22711 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 09:37:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: a6bd704850a6 - main - sockstat: Unbreak SEE ALSO section List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6bd704850a615ae81076855a2083c7ab6481df1 Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 09:37:35 +0000 Message-Id: <69df5c5f.22711.39b743f4@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a6bd704850a615ae81076855a2083c7ab6481df1 commit a6bd704850a615ae81076855a2083c7ab6481df1 Author: Dag-Erling Smørgrav AuthorDate: 2026-04-15 09:36:40 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-04-15 09:36:40 +0000 sockstat: Unbreak SEE ALSO section MFC after: 1 week Fixes: 7b35b4d19630 ("sockstat: add libxo support") --- usr.bin/sockstat/sockstat.1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/sockstat/sockstat.1 b/usr.bin/sockstat/sockstat.1 index b0fae81ee566..70513794ebd9 100644 --- a/usr.bin/sockstat/sockstat.1 +++ b/usr.bin/sockstat/sockstat.1 @@ -25,7 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 29, 2025 +.Dd April 15, 2026 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -261,10 +261,10 @@ $ sockstat --libxo json,pretty .Xr netstat 1 , .Xr procstat 1 , .Xr setfib 1 , +.Xr libxo 3 , .Xr inet 4 , .Xr inet6 4 , -.Xr protocols 5 -.Xr libxo 3 , +.Xr protocols 5 , .Xr xo_options 7 .Sh HISTORY The From nobody Wed Apr 15 12:12:51 2026 X-Original-To: dev-commits-src-main@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 4fwg5H63ZFz6ZnHm for ; Wed, 15 Apr 2026 12:12:51 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwg5H5K2tz3Ytg for ; Wed, 15 Apr 2026 12:12:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776255171; 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=b8Hsa5EtXl5chhke/tx/R6h0f5rZJrGJYEneitTk2gI=; b=SoZkooL1IqyuPiGhZsjCAkyzBINLeKt6efNxGokbfZppNz+/SQwmKpPz8NEbVuP4B1TV/v 7ySTbS3neQWULTxk0YnaMuDyNao9vGqphYa9Fq/xkgeRS1vUsR/LeYhXcp7VYBF8n1f/hm F/Oo2knfBkyCqFMcRflbGSLOpQxmCHMo6L2C6KnDsvKlC3JjS3w24Wcfm2dIu6Qes/X8EY /FHj9u5Nrt6i1lvk4/Btz8J05ERKWkndwnQ4gkDtn805c0cEVF2azWZosok0TDLgXiHKCW 1x/QUfyzZgYo37kw/A92lmJAFyHFbjGOt/XHJGE3HSa6AelMcSpsnvgYTMzW2A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776255171; a=rsa-sha256; cv=none; b=DXqQBqPiYxdVNdCTWFXhyHwFIVd7KYymXXpvi32AOta4uQ79uFs/HavAqGvULCcgJm4kX2 kLxxQkC+5VyLLD+iFDP5ezekrrbuuQ38QUaSXLGK9Et7s37Dh125UkjE4ZP2mU9KopUFtQ PJg0ceZEjgjaktcNzje2dZirRwVID9+/ZLqtXdwgQ8pcxn1ek27UcK4PQfnWR/rJSJppV5 t9v+cY+m1W66HWTnp+yF7zvrO9ZWtrOTrzGA5GXHvSFNUPOs4mRILq2EsRxk6sP/8B2ARr iFsk2OItbs97brP8ZnrJigSnx6g2yIGcd9n1CeiTRYaWIWmD4hdUVVNrVOn/rg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776255171; 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=b8Hsa5EtXl5chhke/tx/R6h0f5rZJrGJYEneitTk2gI=; b=WfRyrn4RJNLktqYL1uEjGwcmhlk2794pNvEmLNORoL3ookVB/Gc8y1Rtvu6/B1sGbqf09f /pfdWVF0vdjyJbo1LKGKjwUX7iiN9j3nPunvUW8FT3WS5Gagmj5sp/OsZRgNpmKAH3sken DaoWhhvcwpXYvVhpKIWx2I19fF7EHC9+2FM77WLkCDmSrW6OF1GOag0ln5q0LcexTHepTD 2GUgqta3/KeBtLzCOARD5jYSsA0nU6lIh+DvDpBWT6W5nwtzo7ctHUhauF+G+LLpcGJc0G B2CAwFX0xKFgYhWCZbJoXWyC1WsKPHrX6JnKC+Bi/H+C5L9gQ3lkOsNLbtbUAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwg5H4sMSz5N2 for ; Wed, 15 Apr 2026 12:12:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3bd7d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 12:12:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Aymeric Wibo Subject: git: bb36c457ea49 - main - thunderbolt: Support generic USB4 NHIs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb36c457ea49d80ca3109ef25ca41a614f9738b8 Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 12:12:51 +0000 Message-Id: <69df80c3.3bd7d.59a4f11d@gitrepo.freebsd.org> The branch main has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=bb36c457ea49d80ca3109ef25ca41a614f9738b8 commit bb36c457ea49d80ca3109ef25ca41a614f9738b8 Author: Aymeric Wibo AuthorDate: 2026-04-15 12:04:17 +0000 Commit: Aymeric Wibo CommitDate: 2026-04-15 12:10:24 +0000 thunderbolt: Support generic USB4 NHIs Check a PCI device's class, subclass, and progif to figure out if it is a USB4 NHI. nhi_identifiers is completely removed as only these generic USB4 NHIs are supported anyway, and all remnants of ICM-supporting code are removed too. All devices now use the HCM. PR: 290827 Reviewed by: jhb, ngie Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D52861 --- sys/dev/pci/pcireg.h | 1 + sys/dev/thunderbolt/nhi.c | 49 ++--------------- sys/dev/thunderbolt/nhi_pci.c | 121 ++---------------------------------------- sys/dev/thunderbolt/nhi_var.h | 18 ------- sys/dev/thunderbolt/tb_pcib.c | 12 ----- 5 files changed, 9 insertions(+), 192 deletions(-) diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h index f6aaf30611e4..3ec7879b8a09 100644 --- a/sys/dev/pci/pcireg.h +++ b/sys/dev/pci/pcireg.h @@ -464,6 +464,7 @@ #define PCIP_SERIALBUS_USB_OHCI 0x10 #define PCIP_SERIALBUS_USB_EHCI 0x20 #define PCIP_SERIALBUS_USB_XHCI 0x30 +#define PCIP_SERIALBUS_USB_USB4 0x40 #define PCIP_SERIALBUS_USB_DEVICE 0xfe #define PCIS_SERIALBUS_FC 0x04 #define PCIS_SERIALBUS_SMBUS 0x05 diff --git a/sys/dev/thunderbolt/nhi.c b/sys/dev/thunderbolt/nhi.c index 30a72652535a..74cefbb50ca1 100644 --- a/sys/dev/thunderbolt/nhi.c +++ b/sys/dev/thunderbolt/nhi.c @@ -84,11 +84,6 @@ MALLOC_DEFINE(M_NHI, "nhi", "nhi driver memory"); #define NHI_DEBUG_LEVEL 0 #endif -/* 0 = default, 1 = force-on, 2 = force-off */ -#ifndef NHI_FORCE_HCM -#define NHI_FORCE_HCM 0 -#endif - void nhi_get_tunables(struct nhi_softc *sc) { @@ -100,7 +95,6 @@ nhi_get_tunables(struct nhi_softc *sc) /* Set local defaults */ sc->debug = NHI_DEBUG_LEVEL; sc->max_ring_count = NHI_DEFAULT_NUM_RINGS; - sc->force_hcm = NHI_FORCE_HCM; /* Inherit setting from the upstream thunderbolt switch node */ val = TB_GET_DEBUG(sc->dev, &sc->debug); @@ -128,8 +122,6 @@ nhi_get_tunables(struct nhi_softc *sc) val = min(val, NHI_MAX_NUM_RINGS); sc->max_ring_count = max(val, 1); } - if (TUNABLE_INT_FETCH("hw.nhi.force_hcm", &val) != 0) - sc->force_hcm = val; /* Grab instance variables */ bzero(oid, 80); @@ -143,24 +135,10 @@ nhi_get_tunables(struct nhi_softc *sc) val = min(val, NHI_MAX_NUM_RINGS); sc->max_ring_count = max(val, 1); } - snprintf(tmpstr, sizeof(tmpstr), "dev, nhi.%d.force_hcm", - device_get_unit(sc->dev)); - if (TUNABLE_INT_FETCH(tmpstr, &val) != 0) - sc->force_hcm = val; return; } -static void -nhi_configure_caps(struct nhi_softc *sc) -{ - - if (NHI_IS_USB4(sc) || (sc->force_hcm == NHI_FORCE_HCM_ON)) - sc->caps |= NHI_CAP_HCM; - if (sc->force_hcm == NHI_FORCE_HCM_OFF) - sc->caps &= ~NHI_CAP_HCM; -} - struct nhi_cmd_frame * nhi_alloc_tx_frame(struct nhi_ring_pair *r) { @@ -268,16 +246,14 @@ nhi_attach(struct nhi_softc *sc) mtx_init(&sc->nhi_mtx, "nhimtx", "NHI Control Mutex", MTX_DEF); - nhi_configure_caps(sc); - /* * Get the number of TX/RX paths. This sizes some of the register * arrays during allocation and initialization. USB4 spec says that - * the max is 21. Alpine Ridge appears to default to 12. + * the max is 21. */ val = GET_HOST_CAPS_PATHS(nhi_read_reg(sc, NHI_HOST_CAPS)); tb_debug(sc, DBG_INIT|DBG_NOISY, "Total Paths= %d\n", val); - if ((val == 0) || (val > 21) || ((NHI_IS_AR(sc) && val != 12))) { + if (val == 0 || val > 21) { tb_printf(sc, "WARN: unexpected number of paths: %d\n", val); /* return (ENXIO); */ } @@ -297,10 +273,6 @@ nhi_attach(struct nhi_softc *sc) if (error == 0) error = tbdev_add_interface(sc); - if ((error == 0) && (NHI_USE_ICM(sc))) - tb_printf(sc, "WARN: device uses an internal connection manager\n"); - if ((error == 0) && (NHI_USE_HCM(sc))) - ; error = hcm_attach(sc); if (error == 0) @@ -312,9 +284,7 @@ nhi_attach(struct nhi_softc *sc) int nhi_detach(struct nhi_softc *sc) { - - if (NHI_USE_HCM(sc)) - hcm_detach(sc); + hcm_detach(sc); if (sc->root_rsc != NULL) tb_router_detach(sc->root_rsc); @@ -706,16 +676,6 @@ nhi_init(struct nhi_softc *sc) tb_debug(sc, DBG_INIT, "Setting interrupt auto-ACK, 0x%08x\n", val); nhi_write_reg(sc, NHI_DMA_MISC, val); - if (NHI_IS_AR(sc) || NHI_IS_TR(sc) || NHI_IS_ICL(sc)) - tb_printf(sc, "WARN: device uses an internal connection manager\n"); - - /* - * Populate the controller (local) UUID, necessary for cross-domain - * communications. - if (NHI_IS_ICL(sc)) - nhi_pci_get_uuid(sc); - */ - /* * Attach the router to the root thunderbolt bridge now that the DMA * channel is configured and ready. @@ -1163,9 +1123,6 @@ nhi_setup_sysctl(struct nhi_softc *sc) SYSCTL_ADD_U16(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "max_rings", CTLFLAG_RD, &sc->max_ring_count, 0, "Max number of rings available"); - SYSCTL_ADD_U8(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, - "force_hcm", CTLFLAG_RD, &sc->force_hcm, 0, - "Force on/off the function of the host connection manager"); return (0); } diff --git a/sys/dev/thunderbolt/nhi_pci.c b/sys/dev/thunderbolt/nhi_pci.c index 14cae7427448..777f8dd5352e 100644 --- a/sys/dev/thunderbolt/nhi_pci.c +++ b/sys/dev/thunderbolt/nhi_pci.c @@ -68,7 +68,6 @@ static int nhi_pci_resume(device_t); static void nhi_pci_free(struct nhi_softc *); static int nhi_pci_allocate_interrupts(struct nhi_softc *); static void nhi_pci_free_resources(struct nhi_softc *); -static int nhi_pci_icl_poweron(struct nhi_softc *); static device_method_t nhi_methods[] = { DEVMETHOD(device_probe, nhi_pci_probe), @@ -89,67 +88,18 @@ static driver_t nhi_pci_driver = { sizeof(struct nhi_softc) }; -struct nhi_ident { - uint16_t vendor; - uint16_t device; - uint16_t subvendor; - uint16_t subdevice; - uint32_t flags; - const char *desc; -} nhi_identifiers[] = { - { VENDOR_INTEL, DEVICE_AR_2C_NHI, 0xffff, 0xffff, NHI_TYPE_AR, - "Thunderbolt 3 NHI (Alpine Ridge 2C)" }, - { VENDOR_INTEL, DEVICE_AR_DP_B_NHI, 0xffff, 0xffff, NHI_TYPE_AR, - "Thunderbolt 3 NHI (Alpine Ridge 4C Rev B)" }, - { VENDOR_INTEL, DEVICE_AR_DP_C_NHI, 0xffff, 0xffff, NHI_TYPE_AR, - "Thunderbolt 3 NHI (Alpine Ridge 4C Rev C)" }, - { VENDOR_INTEL, DEVICE_AR_LP_NHI, 0xffff, 0xffff, NHI_TYPE_AR, - "Thunderbolt 3 NHI (Alpine Ridge LP 2C)" }, - { VENDOR_INTEL, DEVICE_ICL_NHI_0, 0xffff, 0xffff, NHI_TYPE_ICL, - "Thunderbolt 3 NHI Port 0 (IceLake)" }, - { VENDOR_INTEL, DEVICE_ICL_NHI_1, 0xffff, 0xffff, NHI_TYPE_ICL, - "Thunderbolt 3 NHI Port 1 (IceLake)" }, - { VENDOR_AMD, DEVICE_PINK_SARDINE_0, 0xffff, 0xffff, NHI_TYPE_USB4, - "USB4 NHI Port 0 (Pink Sardine)" }, - { VENDOR_AMD, DEVICE_PINK_SARDINE_1, 0xffff, 0xffff, NHI_TYPE_USB4, - "USB4 NHI Port 1 (Pink Sardine)" }, - { 0, 0, 0, 0, 0, NULL } -}; - DRIVER_MODULE_ORDERED(nhi, pci, nhi_pci_driver, NULL, NULL, SI_ORDER_ANY); -static struct nhi_ident * -nhi_find_ident(device_t dev) -{ - struct nhi_ident *n; - - for (n = nhi_identifiers; n->vendor != 0; n++) { - if (n->vendor != pci_get_vendor(dev)) - continue; - if (n->device != pci_get_device(dev)) - continue; - if ((n->subvendor != 0xffff) && - (n->subvendor != pci_get_subvendor(dev))) - continue; - if ((n->subdevice != 0xffff) && - (n->subdevice != pci_get_subdevice(dev))) - continue; - return (n); - } - - return (NULL); -} - static int nhi_pci_probe(device_t dev) { - struct nhi_ident *n; - if (resource_disabled("tb", 0)) return (ENXIO); - if ((n = nhi_find_ident(dev)) != NULL) { - device_set_desc(dev, n->desc); + if ((pci_get_class(dev) == PCIC_SERIALBUS) + && (pci_get_subclass(dev) == PCIS_SERIALBUS_USB) + && (pci_get_progif(dev) == PCIP_SERIALBUS_USB_USB4)) { + device_set_desc(dev, "Generic USB4 NHI"); return (BUS_PROBE_DEFAULT); } return (ENXIO); @@ -161,14 +111,12 @@ nhi_pci_attach(device_t dev) devclass_t dc; bus_dma_template_t t; struct nhi_softc *sc; - struct nhi_ident *n; int error = 0; sc = device_get_softc(dev); bzero(sc, sizeof(*sc)); sc->dev = dev; - n = nhi_find_ident(dev); - sc->hwflags = n->flags; + sc->hwflags = NHI_TYPE_USB4; nhi_get_tunables(sc); tb_debug(sc, DBG_INIT|DBG_FULL, "busmaster status was %s\n", @@ -188,12 +136,6 @@ nhi_pci_attach(device_t dev) tb_printf(sc, "Upstream Facing Port is %s\n", device_get_nameunit(sc->ufp)); - if (NHI_IS_ICL(sc)) { - if ((error = nhi_pci_icl_poweron(sc)) != 0) - return (error); - } - - /* Allocate BAR0 DMA registers */ sc->regs_rid = PCIR_BAR(0); if ((sc->regs_resource = bus_alloc_resource_any(dev, @@ -476,56 +418,3 @@ nhi_pci_disable_interrupts(struct nhi_softc *sc) nhi_read_reg(sc, NHI_ISR0); nhi_read_reg(sc, NHI_ISR1); } - -/* - * Icelake controllers need to be notified of power-on - */ -static int -nhi_pci_icl_poweron(struct nhi_softc *sc) -{ - device_t dev; - uint32_t val; - int i, error = 0; - - dev = sc->dev; - val = pci_read_config(dev, ICL_VSCAP_9, 4); - tb_debug(sc, DBG_INIT, "icl_poweron val= 0x%x\n", val); - if (val & ICL_VSCAP9_FWREADY) - return (0); - - val = pci_read_config(dev, ICL_VSCAP_22, 4); - val |= ICL_VSCAP22_FORCEPWR; - tb_debug(sc, DBG_INIT|DBG_FULL, "icl_poweron writing 0x%x\n", val); - pci_write_config(dev, ICL_VSCAP_22, val, 4); - - error = ETIMEDOUT; - for (i = 0; i < 15; i++) { - DELAY(1000000); - val = pci_read_config(dev, ICL_VSCAP_9, 4); - if (val & ICL_VSCAP9_FWREADY) { - error = 0; - break; - } - } - - return (error); -} - -/* - * Icelake and Alderlake controllers store their UUID in PCI config space - */ -int -nhi_pci_get_uuid(struct nhi_softc *sc) -{ - device_t dev; - uint32_t val[4]; - - dev = sc->dev; - val[0] = pci_read_config(dev, ICL_VSCAP_10, 4); - val[1] = pci_read_config(dev, ICL_VSCAP_11, 4); - val[2] = 0xffffffff; - val[3] = 0xffffffff; - - bcopy(val, &sc->uuid, 16); - return (0); -} diff --git a/sys/dev/thunderbolt/nhi_var.h b/sys/dev/thunderbolt/nhi_var.h index e79ecc954c1f..e22c0f4a2bae 100644 --- a/sys/dev/thunderbolt/nhi_var.h +++ b/sys/dev/thunderbolt/nhi_var.h @@ -142,19 +142,9 @@ struct nhi_softc { u_int debug; u_int hwflags; #define NHI_TYPE_UNKNOWN 0x00 -#define NHI_TYPE_AR 0x01 /* Alpine Ridge */ -#define NHI_TYPE_TR 0x02 /* Titan Ridge */ -#define NHI_TYPE_ICL 0x03 /* IceLake */ -#define NHI_TYPE_MR 0x04 /* Maple Ridge */ -#define NHI_TYPE_ADL 0x05 /* AlderLake */ #define NHI_TYPE_USB4 0x0f #define NHI_TYPE_MASK 0x0f #define NHI_MBOX_BUSY 0x10 - u_int caps; -#define NHI_CAP_ICM 0x01 -#define NHI_CAP_HCM 0x02 -#define NHI_USE_ICM(sc) ((sc)->caps & NHI_CAP_ICM) -#define NHI_USE_HCM(sc) ((sc)->caps & NHI_CAP_HCM) struct hcm_softc *hcm; struct router_softc *root_rsc; @@ -194,11 +184,6 @@ struct nhi_softc { struct intr_config_hook ich; - uint8_t force_hcm; -#define NHI_FORCE_HCM_DEFAULT 0x00 -#define NHI_FORCE_HCM_ON 0x01 -#define NHI_FORCE_HCM_OFF 0x02 - uint8_t uuid[16]; uint8_t lc_uuid[16]; }; @@ -209,9 +194,6 @@ struct nhi_dispatch { void *context; }; -#define NHI_IS_AR(sc) (((sc)->hwflags & NHI_TYPE_MASK) == NHI_TYPE_AR) -#define NHI_IS_TR(sc) (((sc)->hwflags & NHI_TYPE_MASK) == NHI_TYPE_TR) -#define NHI_IS_ICL(sc) (((sc)->hwflags & NHI_TYPE_MASK) == NHI_TYPE_ICL) #define NHI_IS_USB4(sc) (((sc)->hwflags & NHI_TYPE_MASK) == NHI_TYPE_USB4) int nhi_pci_configure_interrupts(struct nhi_softc *sc); diff --git a/sys/dev/thunderbolt/tb_pcib.c b/sys/dev/thunderbolt/tb_pcib.c index ffb85ebec9ae..b30de5a7493c 100644 --- a/sys/dev/thunderbolt/tb_pcib.c +++ b/sys/dev/thunderbolt/tb_pcib.c @@ -90,18 +90,6 @@ struct tb_pcib_ident { uint32_t flags; /* This follows the tb_softc flags */ const char *desc; } tb_pcib_identifiers[] = { - { VENDOR_INTEL, TB_DEV_AR_2C, 0xffff, 0xffff, TB_GEN_TB3|TB_HWIF_AR, - "Thunderbolt 3 PCI-PCI Bridge (Alpine Ridge 2C)" }, - { VENDOR_INTEL, TB_DEV_AR_LP, 0xffff, 0xffff, TB_GEN_TB3|TB_HWIF_AR, - "Thunderbolt 3 PCI-PCI Bridge (Alpine Ridge LP)" }, - { VENDOR_INTEL, TB_DEV_AR_C_4C, 0xffff, 0xffff, TB_GEN_TB3|TB_HWIF_AR, - "Thunderbolt 3 PCI-PCI Bridge (Alpine Ridge C 4C)" }, - { VENDOR_INTEL, TB_DEV_AR_C_2C, 0xffff, 0xffff, TB_GEN_TB3|TB_HWIF_AR, - "Thunderbolt 3 PCI-PCI Bridge C (Alpine Ridge C 2C)" }, - { VENDOR_INTEL, TB_DEV_ICL_0, 0xffff, 0xffff, TB_GEN_TB3|TB_HWIF_ICL, - "Thunderbolt 3 PCI-PCI Bridge (IceLake)" }, - { VENDOR_INTEL, TB_DEV_ICL_1, 0xffff, 0xffff, TB_GEN_TB3|TB_HWIF_ICL, - "Thunderbolt 3 PCI-PCI Bridge (IceLake)" }, { 0, 0, 0, 0, 0, NULL } }; From nobody Wed Apr 15 13:47:02 2026 X-Original-To: dev-commits-src-main@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 4fwj9z0cVhz6ZtfG for ; Wed, 15 Apr 2026 13:47:03 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwj9y5cwxz3mJ4 for ; Wed, 15 Apr 2026 13:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776260822; 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=cWlFT7Vuo74p54zN16KYUSkddWXWmakrBwfe6eIqsz4=; b=moUISRelcW4qZh3G1jprtfLd2X7Z5pgtbxCUXqTuW8GlDUuRIzjP45y1L+dqKoB1t7QvbQ wlawSXbgAqlR+TltEgrnHAWZgSPYQPN3LOho9LqPZzHEICvWGTFbxTz07u/UaTfQSsnJcB 7T+RuGcLI28CPY2cgXHSY4F7Jifra2dNIULxlzhnXziKkDEjnw46KYDN/NF0YA/3UkSuB5 wyKJrkzTHNKqmHpq+0RT/YtqIegffYsS8EkOD7fw5QJhGyk3mZbe9CwSgnLUwMmu/Z1TQi HORcyXLkBLW3ZG8UXo0mePuM6HVxKXlcM/Us+jCicQEiQDE/kOZp3pxVlU6bJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776260822; a=rsa-sha256; cv=none; b=PFgPbnvKyDko8gKSCMmZdh3geequ2hs5PF9aLtvy2SyJg76H9Qwp20XyCgyemZid4rFClR 4f6wA+dDmAOn5GgcnBX0T9narjj+dGsBv6zKXHLdVKTOn0M6nKgS5r8m34C7JpuGyQNPN1 esfuxdGL2RosRRF50jSieqaXuyr/Ddynha9lgBh9256eFXuGZ2NZq9Y+AZeAJVejvRCq4f DZI4DnjFA8INBOupcY2I8qrGcvaa8BHDe0QyEd8cmY0+bxA0HsX5+O6Q6VtwPa9L1i39fd vOYpr3VNXIjB/U3ViFTYHq0gnkXxLcDunhhuhKFcUxC8eRpTMYhgU8jYSLCEFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776260822; 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=cWlFT7Vuo74p54zN16KYUSkddWXWmakrBwfe6eIqsz4=; b=B4A+jjYR+fkHqqGCllvaM9hms5pytMYa7vn8zcp9xOf3bhete9NEICb25WFLarl1h3mHko OQeN+eabEc/pehk46kYQIih0KN93hTKaZADp6u3IxGG40TrYG2mV1hFARPhP+i8LcWruP7 gdRzP5ebbYZBJMeJJX0VriTaG3gk2DiMpSolJE0zjLccrq2orWKk9MBOZLnWvgo0NGXwKX M2KBaR2XFfzZ2Iy7RB46SsTt1ev0OptQZB2QIJxVMrDI2/kfs1NEKIy4gYYfXVWzRPOZ+M i5y8YdtzD0cd/1W7ruG6ax3bHNMLRUArQ/+vsVcQqZZzmnRjXeW6her6mdMejA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwj9y5DlXz7bB for ; Wed, 15 Apr 2026 13:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 432d6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 13:47:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 52d2fc702b85 - main - linuxkpi: Fix an off-by-one error in the kfifo implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52d2fc702b85d56b35f8828fe7efca3cde0d25b7 Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 13:47:02 +0000 Message-Id: <69df96d6.432d6.17bbc698@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=52d2fc702b85d56b35f8828fe7efca3cde0d25b7 commit 52d2fc702b85d56b35f8828fe7efca3cde0d25b7 Author: Mark Johnston AuthorDate: 2026-04-15 13:33:04 +0000 Commit: Mark Johnston CommitDate: 2026-04-15 13:33:04 +0000 linuxkpi: Fix an off-by-one error in the kfifo implementation "total" is the number of slots in the array, so wraparound needs to be done when "first" or "last" is greater than or equal to the number of slots. Note that no consumers of the code are currently connected to the kernel build. Reported by: Stanislav Fort Reviewed by: bz, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56371 --- sys/compat/linuxkpi/common/include/linux/kfifo.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/kfifo.h b/sys/compat/linuxkpi/common/include/linux/kfifo.h index fbe16e22683e..b0d0c17f07e4 100644 --- a/sys/compat/linuxkpi/common/include/linux/kfifo.h +++ b/sys/compat/linuxkpi/common/include/linux/kfifo.h @@ -89,7 +89,7 @@ (_kf)->head[(_kf)->last] = (_e); \ (_kf)->count++; \ (_kf)->last++; \ - if ((_kf)->last > (_kf)->total) \ + if ((_kf)->last >= (_kf)->total) \ (_kf)->last = 0; \ _rc = true; \ } \ @@ -107,7 +107,7 @@ *(_e) = (_kf)->head[(_kf)->first]; \ (_kf)->count--; \ (_kf)->first++; \ - if ((_kf)->first > (_kf)->total) \ + if ((_kf)->first >= (_kf)->total) \ (_kf)->first = 0; \ _rc = true; \ } \ From nobody Wed Apr 15 14:13:19 2026 X-Original-To: dev-commits-src-main@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 4fwjmH5V4fz6ZvrJ for ; Wed, 15 Apr 2026 14:13:19 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwjmH2Vdtz3pvF for ; Wed, 15 Apr 2026 14:13:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776262399; 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=vXu2jWfAnWy9KyRcuudVJ5PKKZnqs/islyjzoLEBP3Y=; b=Cc86k/zfdwLeRhm2P9gVi0tWzeMs7VfCnccELnAja/ensiMszu6v4OUAAxrT0hyZi++IxN U6Z6eqrGO9V1czpe7Dr3rdCrdVEmr0ZFpayImtmxfRwpI7gCgSA/JuFQFXmSCSNXnUcrAc hMkvtUMTXSpgXW9wrq5J6t23OMmFT+tS2sVjCPcRXsX9sF+bvcK5qtnuLxtumuxjUa7gZF ngU1tzta9rorPLZOcJYHEced3Iofb5eBCvCQ+Vt0EzM8YXuqFkeBKVqdslQbCUmR9HEe53 992twjgn55rLlEetSHyo+3dZL42r4Tf4izFD6D8vYZHIXNLm2oaKb29RlhoRPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776262399; a=rsa-sha256; cv=none; b=OVnU7gBE870ulafxalHc+jnp9Cu5aYslzSvze1B/G4higdz8zcmgxdKEAEheTexk7wOSgg 1wL0pg4NhIJpA+7JvUicaR4PwrOq5xEo8Be+L98bq3WFSsOE0zmgUCav8pOpZY9ihnEh1G SHke9fUF9sEh1glEziKh8H895dG4B0EUYq34SPPn44q3xh54NH6PCEotBGyOTa9CcPYIY9 jj768whqAloBQLGMbb8LYhRxPEepSmPZN+GGiX2CWgQQ10yxzQyBo5Z055ykGY0Srf5BQ/ 0kvzn4R3ghBiEa33YXzEydZQsLcJ1CLs+/KvWqTrYEYkAyRryvUEMnxKiIc01Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776262399; 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=vXu2jWfAnWy9KyRcuudVJ5PKKZnqs/islyjzoLEBP3Y=; b=FWOH3J0Nvdd6L/+bc/hw+/BZ+i4XvlzWV4Ykdz9wlLlUweVciuOgaf53B7CucG4lGSF5T6 +TaOk4qB2MIRuV1w0W2gn2kjBBOC+376AP+houE6UKC+Rs5Wc6dvNuReZG2e78/b7F52NN CK/4h/yOnWurEy8piiIkrmcnlKONvMBxf8KebcIE8GjC1frGUj6jPg0fnqqJj8pKKf9WK4 B6piYcT/hDPYiEpTicCeZmYH/gszvNVdWxrVxvineX5l0Wlz8/vTJiK+7VMbJhADnk3caG YA1OasfXs+YkpyM1wck93uAOknH8Ob+6q79uceH18LDkLrcu4sMg11WDJC5Ouw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwjmH267fz8fL for ; Wed, 15 Apr 2026 14:13:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47989 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 14:13:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 6c18dd3eb42b - main - du: Complete libxo transition List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6c18dd3eb42b50fddb6d9605ddde1362ae9c504a Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 14:13:19 +0000 Message-Id: <69df9cff.47989.675f3504@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=6c18dd3eb42b50fddb6d9605ddde1362ae9c504a commit 6c18dd3eb42b50fddb6d9605ddde1362ae9c504a Author: Dag-Erling Smørgrav AuthorDate: 2026-04-15 14:12:30 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-04-15 14:12:30 +0000 du: Complete libxo transition * Use xo_warn() / xo_err() instead of warn() / err(). * Add a test case for the POSIX-mandated stdout error check. * While here, don't assume the size of off_t, address some style issues, and broaden the use of bool instead of int. * Reorder SEE ALSO section. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D56402 --- usr.bin/du/du.1 | 4 ++-- usr.bin/du/du.c | 50 +++++++++++++++++++++++---------------------- usr.bin/du/tests/du_test.sh | 18 ++++++++++++++++ 3 files changed, 46 insertions(+), 26 deletions(-) diff --git a/usr.bin/du/du.1 b/usr.bin/du/du.1 index 1b6d800b0285..3b330de7bc5b 100644 --- a/usr.bin/du/du.1 +++ b/usr.bin/du/du.1 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 16, 2025 +.Dd April 15, 2026 .Dt DU 1 .Os .Sh NAME @@ -225,8 +225,8 @@ Also display a grand total at the end: .Xr chflags 2 , .Xr fts 3 , .Xr libxo 3 , -.Xr xo_options 7 , .Xr symlink 7 , +.Xr xo_options 7 , .Xr quot 8 .Sh STANDARDS The diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c index 16ca05fa9edc..bf138b1b5e36 100644 --- a/usr.bin/du/du.c +++ b/usr.bin/du/du.c @@ -35,7 +35,7 @@ #include #include #include -#include + #include #include #include @@ -67,8 +67,8 @@ struct ignentry { static bool check_threshold(FTSENT *); static void ignoreadd(const char *); static void ignoreclean(void); -static int ignorep(FTSENT *); -static int linkchk(FTSENT *); +static bool ignorep(FTSENT *); +static bool linkchk(FTSENT *); static void print_file_size(FTSENT *); static void prthumanval(const char *, int64_t); static void record_file_size(FTSENT *); @@ -91,6 +91,7 @@ main(int argc, char *argv[]) { FTS *fts; FTSENT *p; + int64_t num; off_t savednumber; int ftsoptions; int depth; @@ -189,11 +190,12 @@ main(int argc, char *argv[]) case 'r': /* Compatibility. */ break; case 't': - if (expand_number(optarg, &threshold) != 0 || - threshold == 0) { + if (expand_number(optarg, &num) != 0 || num == 0) { xo_warnx("invalid threshold: %s", optarg); usage(); - } else if (threshold < 0) + } + threshold = num; + if (threshold < 0) threshold_sign = -1; break; case 'x': @@ -239,7 +241,7 @@ main(int argc, char *argv[]) if (sflag) depth = 0; - if (!*argv) { + if (argc == 0) { argv = save; argv[0] = dot; argv[1] = NULL; @@ -262,13 +264,12 @@ main(int argc, char *argv[]) (void)signal(SIGINFO, siginfo); if ((fts = fts_open(argv, ftsoptions, NULL)) == NULL) - err(1, "fts_open"); - + xo_err(1, "fts_open"); xo_set_version(DU_XO_VERSION); xo_open_container("disk-usage-information"); xo_open_list("paths"); - while (errno = 0, (p = fts_read(fts)) != NULL) { + for (errno = 0; (p = fts_read(fts)) != NULL; errno = 0) { switch (p->fts_info) { case FTS_D: /* Ignore. */ if (ignorep(p)) @@ -313,7 +314,7 @@ main(int argc, char *argv[]) } xo_close_list("paths"); - if (errno) + if (errno != 0) xo_err(1, "fts_read"); if (cflag) { @@ -334,7 +335,7 @@ main(int argc, char *argv[]) exit(rval); } -static int +static bool linkchk(FTSENT *p) { struct links_entry { @@ -362,7 +363,7 @@ linkchk(FTSENT *p) number_buckets = links_hash_initial_size; buckets = malloc(number_buckets * sizeof(buckets[0])); if (buckets == NULL) - errx(1, "No memory for hardlink detection"); + xo_errx(1, "No memory for hardlink detection"); for (i = 0; i < number_buckets; i++) buckets[i] = NULL; } @@ -433,12 +434,12 @@ linkchk(FTSENT *p) free_list = le; } } - return (1); + return (true); } } if (stop_allocating) - return (0); + return (false); /* Add this entry to the links cache. */ if (free_list != NULL) { @@ -451,7 +452,7 @@ linkchk(FTSENT *p) if (le == NULL) { stop_allocating = 1; xo_warnx("No more memory for tracking hard links"); - return (0); + return (false); } le->dev = st->st_dev; le->ino = st->st_ino; @@ -462,7 +463,7 @@ linkchk(FTSENT *p) if (buckets[hash] != NULL) buckets[hash]->previous = le; buckets[hash] = le; - return (0); + return (false); } static void @@ -500,10 +501,10 @@ ignoreadd(const char *mask) ign = calloc(1, sizeof(*ign)); if (ign == NULL) - errx(1, "cannot allocate memory"); + xo_errx(1, "cannot allocate memory"); ign->mask = strdup(mask); if (ign->mask == NULL) - errx(1, "cannot allocate memory"); + xo_errx(1, "cannot allocate memory"); SLIST_INSERT_HEAD(&ignores, ign, next); } @@ -520,17 +521,18 @@ ignoreclean(void) } } -static int +static bool ignorep(FTSENT *ent) { struct ignentry *ign; if (nodumpflag && (ent->fts_statp->st_flags & UF_NODUMP)) - return (1); - SLIST_FOREACH(ign, &ignores, next) + return (true); + SLIST_FOREACH(ign, &ignores, next) { if (fnmatch(ign->mask, ent->fts_name, 0) != FNM_NOMATCH) - return (1); - return (0); + return (true); + } + return (false); } static void diff --git a/usr.bin/du/tests/du_test.sh b/usr.bin/du/tests/du_test.sh index 27076be8dc3e..dec01245fbad 100755 --- a/usr.bin/du/tests/du_test.sh +++ b/usr.bin/du/tests/du_test.sh @@ -295,6 +295,23 @@ t_flag_body() sort du.out } +atf_test_case stdout +stdout_head() +{ + atf_set "descr" "Failure to write to stdout" +} +stdout_body() +{ + ( + trap "" PIPE + sleep 1 + du 2>stderr + echo $? >result + ) | true + atf_check -o inline:"1\n" cat result + atf_check -o match:"stdout" cat stderr +} + atf_init_test_cases() { atf_add_test_case A_flag @@ -314,4 +331,5 @@ atf_init_test_cases() atf_add_test_case s_flag atf_add_test_case si_flag atf_add_test_case t_flag + atf_add_test_case stdout } From nobody Wed Apr 15 14:48:38 2026 X-Original-To: dev-commits-src-main@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 4fwkY35JkFz6Z00l; Wed, 15 Apr 2026 14:48:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwkY34WKcz3tPf; Wed, 15 Apr 2026 14:48:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776264519; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8H+oZr4xxHUwwVxroWdcR166x5U0CkS9y5osxQ34Q0U=; b=hRqnD1xyJ0qFONKuXIEM3CBag0U8zuerPn6cibL99K1l9u5g0OGGiZQfyWfHNW/qxspyPh WYTs48JyPDDLogfCpTGYhnOZ5f5pYa9/fW4W4QLnM+dH9lVBx5z9MAjnv//5g6jSbTAs02 Fif58UEaS8kTWE5tlXw/UFce+71NCywgi9p18XqxryJZuzmifgoj+sumgxss4wgzHjswFe xUnt2R0U/VnvhkWSjy+625tBPD+1bg2HBqbzaaaM/UPkHdvaDtpWFoRs77awYr5dU3G+NF OQSxYusas+MOWsY4J4ziKIqs20JLsnZsglMOB5RhHQcNgazk/rctYLkn/hNZOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776264519; a=rsa-sha256; cv=none; b=UJ7gOYF+N2xC3DAQHgPByU/Q5Lq3zqaILRolNfUJDeb6VR8wyDdS5LHQCAmwZ7MtLDWFkf RkCF5WczUmqL4Ipjx0z7/U83eHsgonnmuJyiyK3YLVasamKgpPcQ7NKT8JjKeUE4IaqBWz wKPQd3kJ84PLQEvk6ib5DhHxnMs5nCxUmuLYqwb4CPRarrJsgQY+gQzzXAWKimo/lmMj20 zQ64iLt8Z8nsltITvv4U2TZQkqFEBb6rnoR6G0lcn9uBV3xzBM6MooJlp4tvp5EElGFtsq BXLNRqXKUyA9R0K+MM6RijM8h+5ge6k0ZJIzS8KBA9E2wjMXv4EmHdLFtdFjtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776264519; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8H+oZr4xxHUwwVxroWdcR166x5U0CkS9y5osxQ34Q0U=; b=qVCLGS7g4lbthuPnNxeS79VeuKMB5MCaQm5uD9HSeDyxfTyF0VN027k37OAUPXpA3RQesd u4XVbMOEFoTzBt1j0AQEA7FuO+TfM+9Xb+00aZFBHn+wZn8SVgbeMfWkK5SXMn1iEFRPkq 0qsseozRHCWyQWJ+IeoQ14y/v99oM3bAUu1UIC/RuGFPl6Jb0EUk5GYCGSRlQigTc8yIFI ZIOuLuNQkXHg/X06LfCvQG2IOOQeIO01GjMgOX1W+lq1HdFf8iN/g+VYXRWRv+IxpGBJMU hQJwrczQZW4UKpNJvl3RjFVecppfsUnzvIrGyny3O4EI7giMtYPSCfokjOEcyQ== Received: from [IPV6:2601:5c0:4202:5670:a48b:e56:f352:935f] (unknown [IPv6:2601:5c0:4202:5670:a48b:e56:f352:935f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fwkY32SznzqMK; Wed, 15 Apr 2026 14:48:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <45629508-bfcb-4161-8913-470539b479ad@FreeBSD.org> Date: Wed, 15 Apr 2026 10:48:38 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 4fadf2466468 - main - tcp_close: Use in6_pcbdisconnect for INET6 sockets Content-Language: en-US To: Gleb Smirnoff , np@freebsd.org Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <69de895e.398d0.7253ff8b@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/14/26 18:13, Gleb Smirnoff wrote: > On Tue, Apr 14, 2026 at 06:37:18PM +0000, John Baldwin wrote: > J> The branch main has been updated by jhb: > J> > J> URL: https://cgit.FreeBSD.org/src/commit/?id=4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 > J> > J> commit 4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 > J> Author: John Baldwin > J> AuthorDate: 2026-04-14 18:07:51 +0000 > J> Commit: John Baldwin > J> CommitDate: 2026-04-14 18:07:51 +0000 > J> > J> tcp_close: Use in6_pcbdisconnect for INET6 sockets > J> > J> This also fixes the LINT-NOINET builds. > J> > J> Fixes: 40dbb06fa73c ("inpcb: retire INP_DROPPED and in_pcbdrop()") > > I think this change is also required. > > Almost sure it will fix panic observed by Navdeep. Yes, I had missed that when comparing the two. Given how similar this functions are, I wonder if in_pcbdisconnect() should be a shared method that just has a few AF-specific bits of code? The old in_pcbdrop() function was shared and not INET vs INET6 specific. -- John Baldwin From nobody Wed Apr 15 14:51:34 2026 X-Original-To: dev-commits-src-main@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 4fwkcR0BcYz6Z09Q for ; Wed, 15 Apr 2026 14:51:35 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwkcQ4mXGz3v8K for ; Wed, 15 Apr 2026 14:51:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776264694; 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=Qt/7FAGSFd0/wQpO0/7Wc5sW779qgx+8hYpzNtbzXew=; b=ETwD4Ikt3H20Ln+ohrdhPTUo1XPl92Qma7lMln8B/71BE3L54yJEx0YwEzLU94E53aWGPy aquVWyyDeeKvM3kstx59xkOq4Z4q6lcOs4vR83qpRmBqMa9i7CnG4bNvGnZKM952SHt4XP 2ytOP5C7gwGgjOie0MIRUb4nP6X2b60xb5eA1PXDEQ5BL51GiUWYyZGoWvG91tY0GonFCe NE76db5YbpSSru5AADJW2w9U8mLw/BBMXsSvbbZLk8AxTUVc05Cwq2yo+GhX3cgKCUE7Lo f/uUDLYPWQYpLGPlScOSd8+Nf9yDqAXoBvscUkV/sDnPbNJfsJUa5Z+6oavZkg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776264694; a=rsa-sha256; cv=none; b=A2KLg8wJpdWiBIF17irHM/wlmVWP2p2PEt2D1RPUa13toYY7IBLPs1NtTICMsUCHLd7JFu 2lBBA5w447BIzC6T4ntuA/utZfdsz1bc+xc19MlxBwCtoZo45asLXHQIPNcHoPYUlEDs/t NAZRCgh4rcmB2PDoAoE+JMxVn70vq6tb0thHk0X4oJpMzWjzGuEq2elXJBfceayOBCaD57 sseQScvjr1aVA56zUQaPs6FAJ6MyemxfuejDrrNjUyAcXBbN9+tKlxIln7VOzdaLCodCZM LFn5zHZXikEQQCWYJbRiRfqZEyYYxoPdYGQsrwroGQSBdD903bf0Rw/4015KvQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776264694; 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=Qt/7FAGSFd0/wQpO0/7Wc5sW779qgx+8hYpzNtbzXew=; b=mHM5Vvd1Ebv956g8Ar+WCc3LB0Wf3R/zEnvxNw8OhOEW3sAQIJ/u0REUtimFx0Ftj8L3R4 XEj0KqbY7JUHa29sCjCqDRBHb0qUyErJnYm3RON0nK3J89dvv6yy2u9YCQyEOXLXBRInCW mlqpCEFR8iMFOSg4t63NOAdkkYHOJC9Nl0C62CtPS96pTLH79mXON/4D4Ndlq9ELmEcVIG 17iNpRfsNqlY3hmwAr4SLnZRM4MKyGO0W5KUYVlKA/YV1E4i01j0RImd5z++ypVhaFC87a PFx24FuVdi8zFDWybsna3Jfj7xFbt8wfwxw5gOxHY0L3F7CDHc4xvmskM9bwHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwkcQ4Ml6z8qf for ; Wed, 15 Apr 2026 14:51:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1a158 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 14:51:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: e99b3f5e3186 - main - du: Fix t_flag test case List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e99b3f5e318626b45510e29993aabca1d161bfa0 Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 14:51:34 +0000 Message-Id: <69dfa5f6.1a158.3c3f3db1@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=e99b3f5e318626b45510e29993aabca1d161bfa0 commit e99b3f5e318626b45510e29993aabca1d161bfa0 Author: Dag-Erling Smørgrav AuthorDate: 2026-04-15 14:50:32 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-04-15 14:50:32 +0000 du: Fix t_flag test case MFC after: 1 week Fixes: 3e5550d25c6d ("du: Add regression tests") Sponsored by: Klara, Inc. --- usr.bin/du/tests/du_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/du/tests/du_test.sh b/usr.bin/du/tests/du_test.sh index dec01245fbad..58ff1c3ecbd8 100755 --- a/usr.bin/du/tests/du_test.sh +++ b/usr.bin/du/tests/du_test.sh @@ -276,7 +276,7 @@ si_flag_body() atf_check -o inline:'1.5M\tA\n1.6M\tB\n' du -A --si A B } -atf_add_test_case t_flag +atf_test_case t_flag t_flag_head() { atf_set "descr" "Verify -t output" From nobody Wed Apr 15 15:06:20 2026 X-Original-To: dev-commits-src-main@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 4fwkxS5RTJz6Z18f for ; Wed, 15 Apr 2026 15:06:20 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwkxS4Zhzz3wX9 for ; Wed, 15 Apr 2026 15:06:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776265580; 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=DeCpI7k7GVH6zB/mdC9F2b9VPmJPk6oNWzdFn24TlI4=; b=cnzrSol0FBrJFTuLzw8FWtEt4e1VCbnoz0Lc1NlCPrKlACsyxODE7AO7zGpyXU889cotyQ Lee5GoAPs2SzB6tzP/dCtgGs3Z1LsOWix+FAophiBm4EsEhe41FbJ5XEnlMDr2Bw4PJSdm HOU+3DXUnaIWQ3sIC8NfRIej66mbY/S21i95In9RLyvWV7AOolrpGuj68S9mmciIIs1qLM vivgob/Ke5oRAwPpn3Y96ipnKpZooL8Uve42JmmWOCfwxboA1hn094xPo8og/an4xwE7yJ Gk+8WX7Bihs1lw7/RN1h+59L5PSbZCs/GlTLdkpPKtKxNsF0oVQ2O/LI0QZmnw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776265580; a=rsa-sha256; cv=none; b=S8fXzAHoMuja6H/Sb3CT9tsJpHFqLnsq4wFR1BQCl69hnEfefCn7P5nUhKHOAF3yEup0dE XTTDOyLBqrUgVW8+0EtMcb2rbFThJ9KYfE1TQG6dSTiDVle2p5E+bpZ8ZgspwTXoh55czI XYxSRzH9BD9m2SaAtHzjnthdW9Qw/2ZBmoTNnSzvEt/JK5RMhX0t6o5lInZaZB8WXY4fSS b+wYuNhWFpFbrM54VSHJ+a7efLwMp3Nk7Qgj+ZhcNRyI1LTXthKzv0bcRBKwrxZCxmAwA8 Z7MotMvx+/nZi22KlVV3KJWA4Iu0Vs1XteVVfXzMcnGJydFAO8sgJems6BNAKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776265580; 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=DeCpI7k7GVH6zB/mdC9F2b9VPmJPk6oNWzdFn24TlI4=; b=bh59BCTDWoDe9VIvxQaE4ZSmf+ERueUAsjL0/ut9EZ9WTAtnn5h0eqkVsNOsU+IOTwQOaJ DTk278i94MoMQyX1l6ONB8DjGBO2oQyUC/99M63cVPj0FsgMzPoc6mbeQmlYqEeM9QoZRF lUNQQP1yZN9i8eidwaIagZOoLWAVjRCgj9OfyIqwk9Nr/rCmxPQQ1OpAJbN6LUJ019w+Sc J1rEqPaB4aWtdjc4iU0WnEBHekYXaKamwUFBUdq8ibNT7rOcJMKDnk05JHCqIpNZmsDhYm mNxrBdxy5NIgzQIzIHfnOy1PVP9F/gHmO0Xk39gmkLT/FvA/QYNNGfl+3EIZGg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwkxS499vz9pn for ; Wed, 15 Apr 2026 15:06:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c4b3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 15:06:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 18b7115cba2f - main - ip_mroute: Fix a lock leak in X_ip_mforward() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 18b7115cba2f698909a4801dc2cc1b04b1f4f210 Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 15:06:20 +0000 Message-Id: <69dfa96c.1c4b3.13d03ab2@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=18b7115cba2f698909a4801dc2cc1b04b1f4f210 commit 18b7115cba2f698909a4801dc2cc1b04b1f4f210 Author: Mark Johnston AuthorDate: 2026-04-15 15:01:58 +0000 Commit: Mark Johnston CommitDate: 2026-04-15 15:06:05 +0000 ip_mroute: Fix a lock leak in X_ip_mforward() If a FIB does not have a router configured, X_ip_mforward() would leak a lock. Plug the leak. The IPv6 counterpart did not have such a check. It wouldn't send an upcall to a non-existent router anyway due to the router_ver check, but we should verify that a router is present anyway. Add regression test cases to exercise these code paths. Reported by: Claude Opus 4.6 Fixes: 0bb9c2b665d9 ("ip6_mroute: FIBify") Sponsored by: Klara, Inc. Sponsored by: Stormshield --- sys/netinet/ip_mroute.c | 4 +- sys/netinet6/ip6_mroute.c | 4 ++ tests/sys/netinet/ip_mroute.py | 153 +++++++++++++++++++++++++++++++++++++---- 3 files changed, 147 insertions(+), 14 deletions(-) diff --git a/sys/netinet/ip_mroute.c b/sys/netinet/ip_mroute.c index 350f5db947af..359755b19e95 100644 --- a/sys/netinet/ip_mroute.c +++ b/sys/netinet/ip_mroute.c @@ -1385,8 +1385,10 @@ X_ip_mforward(struct ip *ip, struct ifnet *ifp, struct mbuf *m, * BEGIN: MCAST ROUTING HOT PATH */ MRW_RLOCK(); - if (__predict_false(mfct->router == NULL)) + if (__predict_false(mfct->router == NULL)) { + MRW_RUNLOCK(); return (EADDRNOTAVAIL); + } if (imo && ((vifi = imo->imo_multicast_vif) < mfct->numvifs)) { if (ip->ip_ttl < MAXTTL) diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 9ae0d699ca31..0e8a0aa6f1ea 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -1191,6 +1191,10 @@ X_ip6_mforward(struct ip6_hdr *ip6, struct ifnet *ifp, struct mbuf *m) mfct = &V_mfctables[M_GETFIB(m)]; MFC6_LOCK(); + if (__predict_false(mfct->router == NULL)) { + MFC6_UNLOCK(); + return (EADDRNOTAVAIL); + } /* * Determine forwarding mifs from the forwarding cache table diff --git a/tests/sys/netinet/ip_mroute.py b/tests/sys/netinet/ip_mroute.py index 5416d824d3c2..c79b046445e5 100644 --- a/tests/sys/netinet/ip_mroute.py +++ b/tests/sys/netinet/ip_mroute.py @@ -21,7 +21,9 @@ class MRouteTestTemplate(VnetTestTemplate): COORD_SOCK = "coord.sock" @staticmethod - def _msgwait(sock: socket.socket, expected: bytes): + def _msgwait(sock: socket.socket, expected: bytes, timeout=None): + if timeout is not None: + sock.settimeout(timeout) msg = sock.recv(1024) assert msg == expected @@ -196,12 +198,7 @@ class Test1RBasicINET(MRouteINETTestTemplate): self.waittest() -class Test1RCrissCrossINET(MRouteINETTestTemplate): - """ - Test a router connected to four hosts, with pairs of interfaces - in different FIBs. - """ - +class MRouteINETCrissCrossTestTemplate(MRouteINETTestTemplate): TOPOLOGY = { "vnet_router": {"ifaces": ["if1", "if2", "if3", "if4"]}, "vnet_host1": {"ifaces": ["if1"]}, @@ -231,6 +228,14 @@ class Test1RCrissCrossINET(MRouteINETTestTemplate): } MULTICAST_ADDR = "239.0.0.1" + + +class Test1RCrissCrossINET(MRouteINETCrissCrossTestTemplate): + """ + Test a router connected to four hosts, with pairs of interfaces + in different FIBs. + """ + def setup_method(self, method): # Create VNETs and start the handlers. super().setup_method(method) @@ -288,6 +293,65 @@ class Test1RCrissCrossINET(MRouteINETTestTemplate): self.waittest() +class Test1RCrissCrossINETMissingRouter(MRouteINETCrissCrossTestTemplate): + """ + Test what happens when a router is configured for some FIBs but not others. + """ + + def setup_method(self, method): + # Create VNETs and start the handlers. + super().setup_method(method) + + # Only start a pimd instance in FIB 0. + ifaces = [self.vnet.iface_alias_map[i].name for i in ["if1", "if2"]] + self.pimd0 = self.run_pimd("test0", ifaces, "127.0.0.1", + self.MULTICAST_ADDR + "/32", fib=0) + + time.sleep(3) # Give pimd a bit of time to get itself together. + + def vnet_host1_handler(self, vnet): + self.jointest(vnet) + + self.sock = self.mcast_join(self.MULTICAST_ADDR, 12345) + self._msgwait(self.sock, b"Hello, Multicast on FIB 0!") + self.mcast_sendto(self.MULTICAST_ADDR, 12345, vnet.ifaces[0].name, + b"Goodbye, Multicast on FIB 0!") + self.donetest() + + def vnet_host2_handler(self, vnet): + self.jointest(vnet) + self.sock = self.mcast_join(self.MULTICAST_ADDR, 12345) + self.mcast_sendto(self.MULTICAST_ADDR, 12345, vnet.ifaces[0].name, + b"Hello, Multicast on FIB 0!") + self._msgwait(self.sock, b"Hello, Multicast on FIB 0!") + self._msgwait(self.sock, b"Goodbye, Multicast on FIB 0!") + self.donetest() + + def vnet_host3_handler(self, vnet): + self.jointest(vnet) + self.sock = self.mcast_join(self.MULTICAST_ADDR, 12345) + timedout = False + try: + self._msgwait(self.sock, b"Hello, Multicast on FIB 1!", timeout=5) + except socket.timeout: + timedout = True + assert timedout, "Received a message when we shouldn't have" + self.donetest() + + def vnet_host4_handler(self, vnet): + self.jointest(vnet) + self.sock = self.mcast_join(self.MULTICAST_ADDR, 12345) + self.mcast_sendto(self.MULTICAST_ADDR, 12345, vnet.ifaces[0].name, + b"Hello, Multicast on FIB 1!") + self.donetest() + + @pytest.mark.require_user("root") + @pytest.mark.require_progs(["pimd"]) + @pytest.mark.timeout(30) + def test(self): + self.starttest(["vnet_host1", "vnet_host2", "vnet_host3", "vnet_host4"]) + self.waittest() + class Test1RBasicINET6(MRouteINET6TestTemplate): """Basic multicast routing setup with 2 hosts connected via a router.""" @@ -343,12 +407,7 @@ class Test1RBasicINET6(MRouteINET6TestTemplate): self.waittest() -class Test1RCrissCrossINET6(MRouteINET6TestTemplate): - """ - Test a router connected to four hosts, with pairs of interfaces - in different FIBs. - """ - +class MRouteINET6CrissCrossTestTemplate(MRouteINET6TestTemplate): TOPOLOGY = { "vnet_router": {"ifaces": ["if1", "if2", "if3", "if4"]}, "vnet_host1": {"ifaces": ["if1"]}, @@ -374,6 +433,74 @@ class Test1RCrissCrossINET6(MRouteINET6TestTemplate): } MULTICAST_ADDR = "ff05::1" + +class Test1RCrissCrossINET6MissingRouter(MRouteINET6CrissCrossTestTemplate): + """ + Test what happens when a router is configured for some FIBs but not others. + """ + + def setup_method(self, method): + # Create VNETs and start the handlers. + super().setup_method(method) + + # Only start an ip6_mrouted instance in FIB 0. + ifaces = [self.vnet.iface_alias_map[i].name for i in ["if1", "if2"]] + self.mrouted0 = self.run_ip6_mrouted("test0", ifaces, fib=0) + time.sleep(1) # Give ip6_mrouted a bit of time to get itself together. + + def vnet_host1_handler(self, vnet): + self.jointest(vnet) + + self.sock = self.mcast_join(self.MULTICAST_ADDR, 12345, vnet.ifaces[0].name) + self._msgwait(self.sock, b"Hello, Multicast on FIB 0!") + self.mcast_sendto(self.MULTICAST_ADDR, 12345, vnet.ifaces[0].name, + b"Goodbye, Multicast on FIB 0!") + self.donetest() + + def vnet_host2_handler(self, vnet): + self.jointest(vnet) + self.sock = self.mcast_join(self.MULTICAST_ADDR, 12345, vnet.ifaces[0].name) + self.mcast_sendto(self.MULTICAST_ADDR, 12345, vnet.ifaces[0].name, + b"Hello, Multicast on FIB 0!") + self._msgwait(self.sock, b"Hello, Multicast on FIB 0!") + self._msgwait(self.sock, b"Goodbye, Multicast on FIB 0!") + self.donetest() + + def vnet_host3_handler(self, vnet): + self.jointest(vnet) + + self.sock = self.mcast_join(self.MULTICAST_ADDR, 12345, + vnet.ifaces[0].name) + timedout = False + try: + self._msgwait(self.sock, b"Hello, Multicast on FIB 1!", timeout=5) + except socket.timeout: + timedout = True + assert timedout, "Received a message when we shouldn't have" + self.donetest() + + def vnet_host4_handler(self, vnet): + self.jointest(vnet) + + self.sock = self.mcast_join(self.MULTICAST_ADDR, 12345, + vnet.ifaces[0].name) + self.mcast_sendto(self.MULTICAST_ADDR, 12345, vnet.ifaces[0].name, + b"Hello, Multicast on FIB 1!") + self.donetest() + + @pytest.mark.require_user("root") + @pytest.mark.timeout(30) + def test(self): + self.starttest(["vnet_host1", "vnet_host2", "vnet_host3", "vnet_host4"]) + self.waittest() + + +class Test1RCrissCrossINET6(MRouteINET6CrissCrossTestTemplate): + """ + Test a router connected to four hosts, with pairs of interfaces + in different FIBs. + """ + def setup_method(self, method): # Create VNETs and start the handlers. super().setup_method(method) From nobody Wed Apr 15 16:03:30 2026 X-Original-To: dev-commits-src-main@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 4fwmCQ4JzKz6Z4ZQ for ; Wed, 15 Apr 2026 16:03:30 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwmCQ3gf4z42j0 for ; Wed, 15 Apr 2026 16:03:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776269010; 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=oo8FG2980KCyxvb1++wEaFnxyUH4QvOcXZrln2q4+U0=; b=FN4ul8yIu2i6bJ2XLesiwR93wzi/Cy2CMfLGnhLleG4NMwvOnErYLXjrYGmNL9Jaza9Nvq Evm0wdn6W8a3g4+8Zyh4+iOWo9M25RWcFUWiLTj5hqB8RZKlZULKTRUBk2wKim7ygA5mLD TbtVbeAVOZn1OeOCaHW/eCicyK2ACYrFBZTggnmCXnxIEuvpK+4k/jI4isi1IpB3YzmSJc 7GUrD3urutL8dz1eLIPPVEc4688CD09/9pHAssu4HvStMwDPzI9dTeTo57RgFwh4U9yALB EAhrai9zm7w66rk5tlgDQKamd25Iwe0l0QCHxX9MTH9+ciLslrAJTPFGbAr1tQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776269010; a=rsa-sha256; cv=none; b=M1dRWefRefo8zAvdwBAhOFQWxdLuMGLu1o6NCJy042u5EeoWCtww+N4OxNm2vaoEQsgjv8 aLAqY2CvMFnjHTeY+nX2zDEPu+7KM3q8Tu9uhxdNP7JcV7cCCmH8eFXsZc/sfxGX0pNa1W JedwrNR1GvCReU+UM2nOYaziVyJ8FgelFMhOmFaA+kw84KBAVL5JM2TXqBt5CUwbAFlfEW bmDDPzj1NJtW5DbDzOvfbAsxAQTgsg6cDCZ0cykdxYFnfEYC5EHKzqAjGvkm/U8iXxDBME rPMnsx8QabWsVFE8ZmznZrsJS7EKLfKiOSW3f38PF6SFPSCHN3dxci71dxp/Qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776269010; 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=oo8FG2980KCyxvb1++wEaFnxyUH4QvOcXZrln2q4+U0=; b=SKX7wPsi50B+N4Gbq8E0lOIKYHsptHN0A9wg24CjItVjLTSqiYUSJigCG6qPw9zgZWEiX1 8EWVHRr941Gy2VH8PNZZf6etIbakzZnYntMDqSv1wxtl4p6UZGFGfbfo3q8Ojh7Hk6Q7Db N8YZBjfvUrGSJ6DuNRXpcjiwoyFLV+i2x73yU/sDUe0rKcY8wJzRyoQc06vU8EZwgs2GX5 n76uQ5Ed7BgHeqQjULKeKzgdUcsguR/8kTTQeiihHrO7g8tkMgndWkOWUWG86lW1uCkSPI M/AvPPuo1R8HWCbDIwrdp2bgWB8IyAxxaKjXyWn1YaGnD8UkNat6cctIUkyq4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwmCQ3DvFzCRS for ; Wed, 15 Apr 2026 16:03:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 23d4d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 16:03:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: 1dddb580f950 - main - arm64: Define the .iplt section placement. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1dddb580f950a27fb9859b2879755dde114c9d8b Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 16:03:30 +0000 Message-Id: <69dfb6d2.23d4d.34b97e94@gitrepo.freebsd.org> The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=1dddb580f950a27fb9859b2879755dde114c9d8b commit 1dddb580f950a27fb9859b2879755dde114c9d8b Author: Michal Meloun AuthorDate: 2026-04-15 09:32:54 +0000 Commit: Michal Meloun CommitDate: 2026-04-15 16:02:01 +0000 arm64: Define the .iplt section placement. Ensure that the .plt and .ipld sections are in the executable memory segment. MFC after: 1 week Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D56403 --- sys/conf/ldscript.arm64 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/conf/ldscript.arm64 b/sys/conf/ldscript.arm64 index ae231c3037e6..7ec0d4324270 100644 --- a/sys/conf/ldscript.arm64 +++ b/sys/conf/ldscript.arm64 @@ -15,6 +15,12 @@ SECTIONS *(.gnu.warning) *(.gnu.linkonce.t*) } =0x9090 + .plt : + { + *(.plt) + *(.iplt) + } + /* * Align to the the largest page size the kernel could be built for. * If we don't then building page tables in locore.S could fail as it @@ -66,7 +72,6 @@ SECTIONS .rel.plt : { *(.rel.plt) } .rela.plt : { *(.rela.plt) } .init : { *(.init) } =0x9090 - .plt : { *(.plt) } . = ALIGN(4); _extab_start = .; From nobody Wed Apr 15 16:35:01 2026 X-Original-To: dev-commits-src-main@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 4fwmvn49Jpz6Z6Pr for ; Wed, 15 Apr 2026 16:35:01 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwmvn3D4Pz45n2 for ; Wed, 15 Apr 2026 16:35:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776270901; 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=I4VXbRUavL/5TbThqbf1ep2yuITLbtFuOcI7oBZFtvo=; b=iUy9CYW22gvfkAHa0TJ1hmNRZe0pM/eATKKG+amZowI6Q53yWTihxxN1XvQXxLq0G2r2yd VUPshkXUTCk09yh4gQvumyr8U6L2/v/2vMpXgXSpKlRMkfi4veihjbbCSI4sMMV07Y+6vC y3/aeCUBg/mgxSMHCXhBmsKNAV/Hi7W582Rr7PnSnpQjrTQIwXD9Ji0JGVzr2bijECLtiP g3r2+jNIq1S26ygiI4u6RCx4F4gHY8cq1bmyWjBY9g+13/6OfVHSuOEtojMlP1+fS7ufc/ GRilDHFNIT0oRUJ7d2mKJiF8TW/Fb3S9MmA9iQL8DYYhSslDUl5ZdYW0Tc4ZfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776270901; a=rsa-sha256; cv=none; b=MmPFEqljnQhf5q//vOu+D6raZIm+s7PnhEQbZsGr3nTmpyNMZW50enoVyWmiFPqWW1uHFT TtuNuATsBY8zNk4kMRSPG/4Ci3CIJZLBMyoVPkQAL8LJHdEtXNSrUx1oXXMA0XHeDCVMV9 coTVfauKGjdq836+7ueNNl69Vxcjmnl3RQQiiYmmKA541etC1StZ2CEFtzk5tnadkaOTE2 +5zW484CdwkUc/4XegW/0ZCpadxNv0zxKqwVUAhDfKvRzylz9TcejxCgPuJhg49f8/VIVR bZY0H9y3v5YBt/wUprwc63zyBG5NT7Nx3kufNm9NzZV2+Q79fgx11VyGU+5EDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776270901; 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=I4VXbRUavL/5TbThqbf1ep2yuITLbtFuOcI7oBZFtvo=; b=cN9mLWqnq2aMsHkHLlfzfwHqDF97JtAulLFjln27WmLydg2QWsZGzNZojcCMqhxHNTB02T JJXnGGSzh0Q8ZBX1fo0POtPoUh2BxuIoLOYhb+EQlYFS8Zs7cnZxqVFBTxybzs6JuIaCiW NjO31i015I3U5MXGpdU741y7arHcFzbIFYbAEF5E/dmPF8StU+/mFm+rTn2e2XExczO8pc +BHm1a5Y1g/j/vWgzuLuUkOJsoS7GLj3eNgY+FjuVcQQHNWT3bS6ZBKW1jlo1POwWoVVg5 iWYWHO9AnpbFXsF6v/QtN7olyTDeBFJlPzXfYSd3sQOb+9mgX2CmrO7x12ic0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwmvn2YKvzDBk for ; Wed, 15 Apr 2026 16:35:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2691f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 16:35:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: 0c09c6527b16 - main - tests/fusefs: appease gcc -Wcast-qual List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0c09c6527b16953d355125bee7a839f743a39dad Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 16:35:01 +0000 Message-Id: <69dfbe35.2691f.2c773556@gitrepo.freebsd.org> The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=0c09c6527b16953d355125bee7a839f743a39dad commit 0c09c6527b16953d355125bee7a839f743a39dad Author: Ryan Libby AuthorDate: 2026-04-15 16:32:22 +0000 Commit: Ryan Libby CommitDate: 2026-04-15 16:32:22 +0000 tests/fusefs: appease gcc -Wcast-qual Fix gcc build error. Reviewed by: asomers, kib Fixes: 7e68af7ce2c1 ("fusefs: redo vnode attribute locking") Differential Revision: https://reviews.freebsd.org/D56370 --- tests/sys/fs/fusefs/rename.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys/fs/fusefs/rename.cc b/tests/sys/fs/fusefs/rename.cc index 385f26953aae..d518071ca681 100644 --- a/tests/sys/fs/fusefs/rename.cc +++ b/tests/sys/fs/fusefs/rename.cc @@ -239,8 +239,8 @@ TEST_F(Rename, erelookup) _) ).WillRepeatedly(Invoke(ReturnErrno(EIO))); - ASSERT_EQ(0, pthread_create(&th0, NULL, setattr_th, (void*)FULLSRC)) - << strerror(errno); + ASSERT_EQ(0, pthread_create(&th0, NULL, setattr_th, + const_cast(FULLSRC))) << strerror(errno); ASSERT_EQ(0, clock_gettime(CLOCK_MONOTONIC, &timeout)); timeout.tv_nsec += NAP_NS; From nobody Wed Apr 15 17:32:38 2026 X-Original-To: dev-commits-src-main@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 4fwpBK5HRmz6ZBNM; Wed, 15 Apr 2026 17:32:41 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwpBK4gc8z3CTs; Wed, 15 Apr 2026 17:32:41 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776274361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PEtayJ1nHSbFs8WrvxLt61MkmKrPjnUIBjIOfYQR8zM=; b=LzCg9XAtJZq1wLFtaiykXnGXInhqiF+bSNBC5fHYccOr/tgLDBDc9p7fb8wIRqZ2cscWFj D03B63U3yH1DlmUBzMlKcMkI01XcZPbFBbd22ndQ7CcId29EBQV4mvWGw2qNyCWqfrv2/u ox5RU7Cl6zROPTBPRjbVYYUZIfjFALK0JWM32XXmU3aVvMdBNb5Jhy0G5Ka0gyPWmbTd2F 46VnQQsCBaCbTeDNugRn6tJRI+RT15gxW+2uQHtCBGwyOenYxXuGTShq4ha01kdK7Lt6je hQ015hbvmsXfKPyAz4M71ZAmaQ4U8KSK6e4F9PwsVTqJXJD8MQ8V8yhD0xDBjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776274361; a=rsa-sha256; cv=none; b=IsVkQBFOORFNMCKdhwJU+m3dgHJ+ByDrUjV1hYrcXFCxPiG+SqETZWQf5kI1/R2a/HSkIu CZof5VhuHWf/rh2SDGtrM3PIO27xjASvypfp/De/UyGP6Q+Py8c1/UohvZ7Lg5/7MR25f2 8IWtMHPA+5EspKYMU69vEJ1JCmdRsVlC8p5jV55AhBMtsyTgZ5QozTLM8d/AxE4vCr0l3K d7wzEHmFgVdfOodewUPKleXLPZ1GUjvFsUfdW0Ro7EtyT3yphNsuhDMYBJJqOjbxmvU29I +NzZEumzcpDPzzF3UztfFfyu7qRb6slF0UWbJr+xhMNTI1MP81DJPwEMbiuMhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776274361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PEtayJ1nHSbFs8WrvxLt61MkmKrPjnUIBjIOfYQR8zM=; b=kUfS+y3cChDdU1EHGQlAAZRRovlZwl3bmsBfLPh96EAGBaAs/HU5PUiO35TtdImcpAAlJz 9SKIeUD8CQGDxPD/D9PjMqC4TYb1tVD47HQD/pGdo+dtvN0g6OyWDe6runH0WKes9lG+wC RWrPQmarZ6Rz6DYUsuQ4IcrLUA7ThumQdbMdZ3F9kdcqEpi4F83B/zXGW7qyhhjVzs3WLM 4ZpKIJMXuc8fFOT9fBaafZOLzbK9dW1QXrto8vTmBDedGxAsDl2lmunUuXVo4IhnG8xtTh WGSWukKgnN45RhLioHL4guLXsCjzGL+6cd9Wwrot/2aXWwBEwGJovZtjwwHxLQ== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fwpBK0FZMztTx; Wed, 15 Apr 2026 17:32:40 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Wed, 15 Apr 2026 10:32:38 -0700 From: Gleb Smirnoff To: John Baldwin Cc: np@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 4fadf2466468 - main - tcp_close: Use in6_pcbdisconnect for INET6 sockets Message-ID: References: <69de895e.398d0.7253ff8b@gitrepo.freebsd.org> <45629508-bfcb-4161-8913-470539b479ad@FreeBSD.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45629508-bfcb-4161-8913-470539b479ad@FreeBSD.org> On Wed, Apr 15, 2026 at 10:48:38AM -0400, John Baldwin wrote: J> On 4/14/26 18:13, Gleb Smirnoff wrote: J> > On Tue, Apr 14, 2026 at 06:37:18PM +0000, John Baldwin wrote: J> > J> The branch main has been updated by jhb: J> > J> J> > J> URL: https://cgit.FreeBSD.org/src/commit/?id=4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 J> > J> J> > J> commit 4fadf2466468dd6dcb6cf9e3739ed696a18c1bb4 J> > J> Author: John Baldwin J> > J> AuthorDate: 2026-04-14 18:07:51 +0000 J> > J> Commit: John Baldwin J> > J> CommitDate: 2026-04-14 18:07:51 +0000 J> > J> J> > J> tcp_close: Use in6_pcbdisconnect for INET6 sockets J> > J> J> > J> This also fixes the LINT-NOINET builds. J> > J> J> > J> Fixes: 40dbb06fa73c ("inpcb: retire INP_DROPPED and in_pcbdrop()") J> > J> > I think this change is also required. J> > J> > Almost sure it will fix panic observed by Navdeep. J> J> Yes, I had missed that when comparing the two. J> J> Given how similar this functions are, I wonder if in_pcbdisconnect() should be a shared J> method that just has a few AF-specific bits of code? The old in_pcbdrop() function was J> shared and not INET vs INET6 specific. Absolutely. I have this on my list. -- Gleb Smirnoff From nobody Wed Apr 15 18:06:19 2026 X-Original-To: dev-commits-src-main@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 4fwpx735dGz6ZDZx for ; Wed, 15 Apr 2026 18:06:19 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwpx72crZz3GSs for ; Wed, 15 Apr 2026 18:06:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776276379; 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=GS38al3LWKQklntPzqB4T+FwTwYhApASO4XZckJxyZ8=; b=Y5Uf3YiEw5fnA2dmAeLgIJL/MyZ7akf3d5bMQFedQlVeFiDhjQ63ZzwZ+s5UqeHSFlrYFa TWLGMZqJ2W8EYC+YSk+SnKoAdhU8Iv46hQmtGPt8S/95ZEYs5EYZOjpbej7bftS1OB7WT8 WkXEVksMlJHENyB7ISAPt6jJZO4sZm6jTNEs4oUk4wrwxbyU0arnSX4gz8hDC+qcDer6a4 1ZjFbCkQa8lTSt2Sd+I6f3WfbSd+8ohzleWc5agbHkSroH9WiGhAvFMdUJaYlvGXz/5PN2 vXGlFF5xeiJzdLqcihFq9KobAJeE1Rmgj3l3bow7J8g/EZ05iACSUahAXpfohw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776276379; a=rsa-sha256; cv=none; b=gW4DrVhSSuKx8Z05MQV+dDnBWPFv44Xt4Gt3gOnhLvRjKEhNPaIdFH6JR+SNJr0bdOGFVZ 1Xn3qTcdKlVtMyhiEamDQvslh/swqKvRzMkmMV0uFyX4xLaF22TaqR3ggsj37ukNLGN9l4 3ewxysrjfbT679c00eK58Y6MeePE4bEGnpA8Lth2mvXMUNbEFYX5JEIh+6Qx1i8BJVvBJq MDbXK+CnhNcd3ynhgeSKjboBsIBDH9BVNjBEgLjK2LQkml9g8c5FFY5nQdm7ytTGsVd/j7 P7oASeoJu0zoeuH0iumtt7/p/ePVOXZnSD4HLJxOZeYH7FWlOa3tK7GEYhjYpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776276379; 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=GS38al3LWKQklntPzqB4T+FwTwYhApASO4XZckJxyZ8=; b=iq7QJmRp74tfVxkNW3ujt1/WHhhcZ/e87Sn2tZUmb0B4OoDfjZWjnWpv7nAwXJwbTwib2n ys4bUUsdSAuKu88ZlZEorRTQXuz1vMcyPb8jjgWXd0YqBKB8hwWSKX3Rbl1awOsFuJ7+gz w+PfdWGkKqZYvK6nwoCoNvBzLoPwJwO9QXbJM5si2THAjRboCr5tGSpulCn5f7JqXDSSiO 7wEAyqzTIhX1LRObp2vUoff51wkTOK/dHztH41LL7aZFs42x3SzRLQaEM/aD9ynVaGz8Jf RfWMhstCaO4iVj6wqUUYM0hLal/JBvZSjZW5kM/ViFQLEcCg88BkJvbu1dCAOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwpx71WWLzXXS for ; Wed, 15 Apr 2026 18:06:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3890a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 18:06:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b6b0afefec47 - main - vm_swapout: Remove a special case from vm_swapout_map_deactivate_pages() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b6b0afefec4739923897d984448704ce34a21e6b Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 18:06:19 +0000 Message-Id: <69dfd39b.3890a.7b191608@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b6b0afefec4739923897d984448704ce34a21e6b commit b6b0afefec4739923897d984448704ce34a21e6b Author: Mark Johnston AuthorDate: 2026-04-15 18:00:38 +0000 Commit: Mark Johnston CommitDate: 2026-04-15 18:00:38 +0000 vm_swapout: Remove a special case from vm_swapout_map_deactivate_pages() John points out that this probably should have been removed in commit 472888018ce, which removed a special case where we'd set desired=0 if the target process has P_INMEM clear. It's not obvious to me that the desired=0 case can't arise by setting an RSS limit to 0, but I'm not sure why we'd try to go the extra mile in that case anyway. Reported by: jhb Reviewed by: kib MFC after: 2 weeks Fixes: 472888018ce1 ("proc: Remove kernel stack swapping support, part 6") Differential Revision: https://reviews.freebsd.org/D56140 --- sys/vm/vm_swapout.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/sys/vm/vm_swapout.c b/sys/vm/vm_swapout.c index f510189d24be..e85a049f46fe 100644 --- a/sys/vm/vm_swapout.c +++ b/sys/vm/vm_swapout.c @@ -222,13 +222,11 @@ vm_swapout_map_deactivate_pages(vm_map_t map, long desired) { vm_map_entry_t tmpe; vm_object_t obj, bigobj; - int nothingwired; if (!vm_map_trylock_read(map)) return; bigobj = NULL; - nothingwired = TRUE; /* * first, search out the biggest object, and try to free pages from @@ -249,8 +247,6 @@ vm_swapout_map_deactivate_pages(vm_map_t map, long desired) VM_OBJECT_RUNLOCK(obj); } } - if (tmpe->wired_count > 0) - nothingwired = FALSE; } if (bigobj != NULL) { @@ -275,15 +271,6 @@ vm_swapout_map_deactivate_pages(vm_map_t map, long desired) } } - /* - * Remove all mappings if a process is swapped out, this will free page - * table pages. - */ - if (desired == 0 && nothingwired) { - pmap_remove(vm_map_pmap(map), vm_map_min(map), - vm_map_max(map)); - } - vm_map_unlock_read(map); } From nobody Wed Apr 15 18:18:46 2026 X-Original-To: dev-commits-src-main@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 4fwqCV5WC4z6ZF3k for ; Wed, 15 Apr 2026 18:18:46 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwqCV4vC7z3HlF for ; Wed, 15 Apr 2026 18:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776277126; 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=nKU/PGlQ1FlFiKa+bBuoveDiQOV6WV76dRXQSnNTgLM=; b=j0+C5fveqpFQQWgLUkg6kKMS3p+9+EbgwM5rCVVKbEqziequgOiDDJl5JTlOt+m6HkWiMj vQUwJpSWGlHHPmLox32iFaGlokt2xRD+8A4FVy6EVVrOCdqawTbCl69gAgBJh51XvGd5Bc 1m6v04rh0Z4b3fuxtyVtDZjOcco33ik/QE1iXkpeSge0yYKfJMdPSA9Kxy1b5+kRR39nYS ZnHDZxokqSzWcC+KkId51e7a6K1nd099tgZut9iiFzdQykvj/g2DDlggwk/ZK7PyvceBdh li9EQ6hpZq0489FuLex2P0FxK8EqXPt4ka+aUkt8mYrHttXNCa90sFFpCwivNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776277126; a=rsa-sha256; cv=none; b=h3hZtmhX+aKKXQ9zcxJDYPC6ngg4PuZ5sfqSrIOUYloOoTXS+xE6DktZ6jU/5I2vWRBUD5 I2ffzGRq5cJGj3eGY2sGMef1Zs0Fg6A+Z3mleGWzYQCbFKBSoclvoWnsNyB99jQ7EScd6Z cQXOmJQ+NfTw1TLGvMUVjNXULu9BeiW5DKv9Q1NB1XRVZQU315TI27to1EFBmHBfSQIhw+ aDzdH4nM4gw7Qpd1gxKjA5qjZSGwPpIvxYFZTQSflHaHw52C3OUkOcmnl7bJs1K5AHtfrK +D+lEZzIhjI6VWEVHy+ua+QwrAPhJI2f3QCnQuu6kQXMQKhYif/x15R3g+ttZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776277126; 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=nKU/PGlQ1FlFiKa+bBuoveDiQOV6WV76dRXQSnNTgLM=; b=mU3HTNQuSdESwtvJZzj5BypBP82JjnIHRVFCY0vkP4coAGYvrq+FEqiHMZjiarYAaxyXuL fXLd3f1zDhDXVI0346lrtYcseXRMlYJHe24SSImXVRzbDKItB3R3Ebk/sB2YNdVW2Oq/xK QlbGWEmeM2iIjijopM8IAr6w1dKZdRO85x3pO6+7avgpAmMuBzeatX+2uvcI4Z18w45i6s NJqLoka9ApnQw/YRZhy1VgmtFNMjZVjM0z8e5zUg/gctLxz0kl4g6ACotSTyKDVcaXaG2s vIhW5wRCTppQlAdZJxEmvLywCxJ7i9+3Jmy1YE/U0mnPJGttRkpNP+KQRnyYuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwqCV4FS4zXKS for ; Wed, 15 Apr 2026 18:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38749 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 18:18:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Osipov Subject: git: 92c69c791c43 - main - glabel(8): Fix debug message for already existing labels List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: michaelo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92c69c791c436eb966fab806393b70e53cde6874 Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 18:18:46 +0000 Message-Id: <69dfd686.38749.69f365e0@gitrepo.freebsd.org> The branch main has been updated by michaelo: URL: https://cgit.FreeBSD.org/src/commit/?id=92c69c791c436eb966fab806393b70e53cde6874 commit 92c69c791c436eb966fab806393b70e53cde6874 Author: Michael Osipov AuthorDate: 2026-04-14 08:38:59 +0000 Commit: Michael Osipov CommitDate: 2026-04-15 18:18:32 +0000 glabel(8): Fix debug message for already existing labels Remove the duplicate (incorrect) name. PR: 294542 Reviewed by: markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56400 --- sys/geom/label/g_label.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/geom/label/g_label.c b/sys/geom/label/g_label.c index faefbd7c2ef6..85d55444f91a 100644 --- a/sys/geom/label/g_label.c +++ b/sys/geom/label/g_label.c @@ -251,8 +251,8 @@ g_label_create(struct gctl_req *req, struct g_class *mp, struct g_provider *pp, if ((pp2->flags & G_PF_ORPHAN) != 0) continue; if (strcmp(pp2->name, name) == 0) { - G_LABEL_DEBUG(1, "Label %s(%s) already exists (%s).", - label, name, pp->name); + G_LABEL_DEBUG(1, "Label %s (%s) already exists.", + label, name); if (req != NULL) { gctl_error(req, "Provider %s already exists.", name); From nobody Wed Apr 15 19:27:43 2026 X-Original-To: dev-commits-src-main@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 4fwrl337dlz6ZLN7 for ; Wed, 15 Apr 2026 19:27:43 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwrl30mvZz3TRQ for ; Wed, 15 Apr 2026 19:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776281263; 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=R1auKZa0UmlnVaZc7EmGAllIs8Q0NIOKkqeGHZBznzI=; b=X4Hji36pEDc+olFP8JK7SuZOW+1ZqbBrckpn4YXkDd7YkwR+VQseaZAAoop+ru9OGUgt/K 8GpTUKYwP6Lxi2FquKf4ITxunj0eTxULtsUqU7IfYTGmrX7wWAlwihxwfToT0S9IfBgZc1 oKb3ISepJGWlVVjyWpm6gAnX6EmrFRXYSWZHJa4nEbbLlsk+WuYAO+B4Vm5rbS/ifxTpcS KvJnLmr3EFXfE9mmMpEby+QHtRLagtG6PdftQJTCODkVLKV2JgnHoyKS1n798FZJy6hrRt pd+GbTmp0wFk6YK85XstSofrn84yFcYHgSbwsTkAuYEQr8PV5AGQM51u5q5M3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776281263; a=rsa-sha256; cv=none; b=G89+uxV8gd5yv2T9P8kcqHq4P2BKnqZ3pUQaI9l99byQs6Ug3Cg4hRI3OAcqaE8oqr2pwW Z+hyWBZ+WYSq21UhGdKo4XUH0TmZGLMG7Cf3IoCoNLguj1DbgOqJbdd645oleWmXHWLb4C Wmf3ij6Svm/go71xJsrypa+ywcH0RJisbTa2kBdVeQIgy/SouTu7ETsGOD5svHlnWvBtcl 8t+xpKB5XeHE1Z40VYcSGe10XCVzPfmN04qi2F8rLBVzp0tPJDUnT9nJEZzmu7gHLbH21g 6O3KL+MxkH0SLmK8AGDKYXToF4YWc7lGamwFpcA9dkCS9FkRCaWdcpHb0/MXwg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776281263; 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=R1auKZa0UmlnVaZc7EmGAllIs8Q0NIOKkqeGHZBznzI=; b=jfLVeg0qS7dE/0ilczEmAMNG90PaVesyuAM/EuYn6fEwQroZm+icWJaC/J+OiV33ml7KQR +AJ5MSaLKaYZx0nO76BiPsRSEVfx7k51z/+ZXXn2yd+uyMNpvzpyL5HOOvoR0jRfC3tYCW mH9SSskmDoyPGt4RawqikTPzc/BYUFQ03KbLlENiP1rPK+zdyziZ4sSD1s0IITdp2ZYsfO GUHgqY6oWgIE+wgN6nkGgGcyzVM9Xo1tjbUbkpUR1NSHVpGayXPPAGwejV4oLxwOsLhplU CzrB68ixfcpv2cYW0U9iuvEKuBhhabWUTe0QUa5/gz40io23zifZQCZrNQpOuA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwrl30LsWzb93 for ; Wed, 15 Apr 2026 19:27:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 18613 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 19:27:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 04b994d19eec - main - bpf: fix handling the read timeout on ppc64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 04b994d19eec68a6b5d27ff4b0fa223a05f00e1f Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 19:27:43 +0000 Message-Id: <69dfe6af.18613.27aafdc1@gitrepo.freebsd.org> The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=04b994d19eec68a6b5d27ff4b0fa223a05f00e1f commit 04b994d19eec68a6b5d27ff4b0fa223a05f00e1f Author: Michael Tuexen AuthorDate: 2026-04-15 19:24:05 +0000 Commit: Michael Tuexen CommitDate: 2026-04-15 19:24:05 +0000 bpf: fix handling the read timeout on ppc64 On platforms other than amd64, BIOCSRTIMEOUT is equal to BIOCSRTIMEOUT32. Therefore, running the COMPAT_FREEBSD32 code basically clears tv_usec on big endian platforms. When tcpdump is used, the timeout requested is 100ms, which gets cleared to 0 on ppc64 platforms. This results in tcpdump showing the packets only when the read buffer is full. Thanks to kib for guiding me to the correct fix. Reported by: ivy Reviewed by: adrian, kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D56399 --- sys/net/bpf.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 05877f6410a4..9d0b76753560 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1201,7 +1201,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, case BIOCGDLTLIST32: case BIOCGRTIMEOUT32: case BIOCSRTIMEOUT32: - if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { + if (SV_CURPROC_FLAG(SV_ILP32)) { BPFD_LOCK(d); d->bd_compat32 = 1; BPFD_UNLOCK(d); @@ -1209,6 +1209,19 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, } #endif +#if defined(COMPAT_FREEBSD32) + if (SV_CURPROC_FLAG(SV_ILP32)) { + /* + * On platforms other than amd64, BIOC[GS]RTIMEOUT32 is equal to + * BIOC[GS]RTIMEOUT. Since this is difficult to handle in the + * switch command, map them. + */ + if (cmd == BIOCSRTIMEOUT32) + cmd = BIOCSRTIMEOUT; + if (cmd == BIOCGRTIMEOUT32) + cmd = BIOCGRTIMEOUT; + } +#endif CURVNET_SET(TD_TO_VNET(td)); switch (cmd) { default: @@ -1419,23 +1432,19 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, * Set read timeout. */ case BIOCSRTIMEOUT: -#if defined(COMPAT_FREEBSD32) && defined(__amd64__) - case BIOCSRTIMEOUT32: -#endif { struct timeval *tv = (struct timeval *)addr; -#if defined(COMPAT_FREEBSD32) +#ifdef COMPAT_FREEBSD32 struct timeval32 *tv32; struct timeval tv64; - if (cmd == BIOCSRTIMEOUT32) { + if (SV_CURPROC_FLAG(SV_ILP32)) { tv32 = (struct timeval32 *)addr; tv = &tv64; tv->tv_sec = tv32->tv_sec; tv->tv_usec = tv32->tv_usec; - } else + } #endif - tv = (struct timeval *)addr; /* * Subtract 1 tick from tvtohz() since this isn't @@ -1450,31 +1459,24 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, * Get read timeout. */ case BIOCGRTIMEOUT: -#if defined(COMPAT_FREEBSD32) && defined(__amd64__) - case BIOCGRTIMEOUT32: -#endif { - struct timeval *tv; -#if defined(COMPAT_FREEBSD32) && defined(__amd64__) + struct timeval *tv = (struct timeval *)addr; +#ifdef COMPAT_FREEBSD32 struct timeval32 *tv32; struct timeval tv64; - if (cmd == BIOCGRTIMEOUT32) + if (SV_CURPROC_FLAG(SV_ILP32)) tv = &tv64; - else #endif - tv = (struct timeval *)addr; - tv->tv_sec = d->bd_rtout / hz; tv->tv_usec = (d->bd_rtout % hz) * tick; -#if defined(COMPAT_FREEBSD32) && defined(__amd64__) - if (cmd == BIOCGRTIMEOUT32) { +#ifdef COMPAT_FREEBSD32 + if (SV_CURPROC_FLAG(SV_ILP32)) { tv32 = (struct timeval32 *)addr; tv32->tv_sec = tv->tv_sec; tv32->tv_usec = tv->tv_usec; } #endif - break; } From nobody Wed Apr 15 20:35:44 2026 X-Original-To: dev-commits-src-main@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 4fwtFY3QGJz6ZRrd for ; Wed, 15 Apr 2026 20:35:45 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwtFY0k1lz3csB for ; Wed, 15 Apr 2026 20:35:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776285345; 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=1AfuxfiDX0Htn4e72TNDauyHD6gd8LJQBf/yc5F8g3Y=; b=DyukP6v2PcaEY9W4vDeRMauRI36U1vdccOCS/DZVrvh6i7Tp67b4Jk3CkDMMP2ASjAf1CF dkJAI4W/1HWFCrujumKCYfa6laXzO8Wt91jiHy3zT9zlrDvI6/F2i2vQ8p6Q46rpQUx+JE oJClYDCPvzpLVEQeJkOfWHGjVHR/e5lRmH+ANK/U+D6D3NDdSTkACJqMhJhoTvQtmKrxm9 r8FOFT7gpeA85EYSZVGdvHcaA7VRn7GV3W5n9B8R5aU9jTEG/udXBeFOoDgiranO0fr4wC 2/xiqSB2lTifrWsEZh2Kar3EP9egpl0wkqB5M0q6faPbg+6l9nhjbbE8beMhiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776285345; a=rsa-sha256; cv=none; b=c/jvdpgQGC6P6lr2kvnU/zXsi7waQ4M0Xt1oKqzd2nsXNXoV8lAyft5Ogi3rCFvSxq+Uu3 0bKM5wX5gGNa8LoSA455UlHAcN9MnDj3jyvnRTwhrDRmGlcDpkrdjCy/ygz4OZ4fVgVPaP zfVEzpDZtrdlvzwMXxV+KQUdXKPZzsNI3FdvVVAsE5MaQfMlabIatkKxihpixob+Q4N7xD STLsbYJdGmKzdlWlJViPG7g0XiJCJRrYnAn/NV2Z5E5ISAX9f4HM5NfH+5cYfWxkNd8tP2 uvqLRhLECNbceELFzX1a1QNh38uBXYy056/CmaD2+40Xjbwg0HJZceNEE6inWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776285345; 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=1AfuxfiDX0Htn4e72TNDauyHD6gd8LJQBf/yc5F8g3Y=; b=fSW6LORLb3t954r+4ahcTE8OANMR8oi92EBGibMsO5VAtTtmBQlMgcca4wDZuSmPmY713j TdBoFzYb3R7+J9ZugRDoSgCXYtQNrwMV3zYlI2afkdYjKMiRiMbO9BAjAmzM+WVkZUu9Tj U8P53e8bV50UuR7FaeF2BRRq/d/U/9ifX8avjyi2sJlZocCMZv4K3Oxw9VhBO30nof+bYu PIM4oOQ5lZkBBKW7DLUxI9YwrmE43dJOrsyoEafcQ2nTb841ZJoyRg+oBE/EDOsD6Gu2La jCQR5hmTTyhHtytbmEIWU/ry3pyHbIBi/5q/1dnXyjlx69F5rNfHi7sDx25vFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwtFX6nymzcsM for ; Wed, 15 Apr 2026 20:35:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 20dad by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 20:35:44 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 2d13620c6e1b - main - tcp lro: fix vnet handling List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2d13620c6e1be7f8136095f648a6b824158d0941 Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 20:35:44 +0000 Message-Id: <69dff6a0.20dad.6680d624@gitrepo.freebsd.org> The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=2d13620c6e1be7f8136095f648a6b824158d0941 commit 2d13620c6e1be7f8136095f648a6b824158d0941 Author: Michael Tuexen AuthorDate: 2026-04-15 20:31:48 +0000 Commit: Michael Tuexen CommitDate: 2026-04-15 20:31:48 +0000 tcp lro: fix vnet handling Reported by: Shawn Webb Reviewed by: glebius, rrs Fixes: f707cc00ed12 ("lro: move pkt rejection checks to leafs to avoid queueing") Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D56420 --- sys/netinet/tcp_lro.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c index 5819fb5ceae0..961a1fa2cb31 100644 --- a/sys/netinet/tcp_lro.c +++ b/sys/netinet/tcp_lro.c @@ -1422,15 +1422,20 @@ tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum) { int error; + CURVNET_SET(lc->ifp->if_vnet); #ifdef INET /* Quickly decide if packet cannot be LRO'ed */ - if (__predict_false(V_ipforwarding != 0)) + if (__predict_false(V_ipforwarding != 0)) { + CURVNET_RESTORE(); return (TCP_LRO_CANNOT); + } #endif #ifdef INET6 /* Quickly decide if packet cannot be LRO'ed */ - if (__predict_false(V_ip6_forwarding != 0)) + if (__predict_false(V_ip6_forwarding != 0)) { + CURVNET_RESTORE(); return (TCP_LRO_CANNOT); + } #endif if (((m->m_pkthdr.csum_flags & (CSUM_DATA_VALID | CSUM_PSEUDO_HDR)) != @@ -1442,12 +1447,12 @@ tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum) * a packet. */ counter_u64_add(tcp_bad_csums, 1); + CURVNET_RESTORE(); return (TCP_LRO_CANNOT); } /* get current time */ binuptime(&lc->lro_last_queue_time); - CURVNET_SET(lc->ifp->if_vnet); error = tcp_lro_rx_common(lc, m, csum, true); if (__predict_false(error != 0)) { /* @@ -1474,10 +1479,12 @@ tcp_lro_queue_mbuf(struct lro_ctrl *lc, struct mbuf *mb) return; } + CURVNET_SET(lc->ifp->if_vnet); #ifdef INET /* Quickly decide if packet cannot be LRO'ed */ if (__predict_false(V_ipforwarding != 0)) { /* input packet to network layer */ + CURVNET_RESTORE(); (*lc->ifp->if_input) (lc->ifp, mb); return; } @@ -1486,10 +1493,12 @@ tcp_lro_queue_mbuf(struct lro_ctrl *lc, struct mbuf *mb) /* Quickly decide if packet cannot be LRO'ed */ if (__predict_false(V_ip6_forwarding != 0)) { /* input packet to network layer */ + CURVNET_RESTORE(); (*lc->ifp->if_input) (lc->ifp, mb); return; } #endif + CURVNET_RESTORE(); /* check if packet is not LRO capable */ if (__predict_false((lc->ifp->if_capenable & IFCAP_LRO) == 0)) { /* input packet to network layer */ From nobody Wed Apr 15 22:36:47 2026 X-Original-To: dev-commits-src-main@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 4fwwxK4R9Mz6ZcWW for ; Wed, 15 Apr 2026 22:36:53 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fwwxK2l1bz3sKq for ; Wed, 15 Apr 2026 22:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776292613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y7HFpOoZMWCc+N+bFDGcFmj9+GEN4IHQgEQOMMnTOOQ=; b=Dfw8xOxFTnEAoRdJ/spz8JqplP1oPyCsoBK35qUBIBlqRWd8DkNXHioU4gnD5DUxed0E74 TZFPnm/nWUQ5UjtpicDA9X20zdDISDNqs7M7/U916yD06SE3RTD8V5oMGnia0L4m+fTd9f vBCiONKxEO7+kYbdoocwvxNTn1JiAo9eKonhxqD20PWmktA29BnIVRy05A3sr4oFzRcrCE hHpf4/B2ctK/OASndI9yQIYHNYrKROB5T4TlXxQ503teYVl80jDk8TvG+FCXa1AqMR42vc Ou6LNsck5eb5XXwrjXm/pfUrSQqd4eqzYy0SzDworOckJ/KDEFC6fIRIlDFLtg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776292613; a=rsa-sha256; cv=none; b=wuBoZqFKJh3f/xyF0fWriUWPFXBvHUiycto+1Moed72gz6RB5ar0K7yQWPgkeZA9CKpMGo Bhs8DMbsbnYS5Bdnrwvs2+zBaPDgBu7dvzWxrlOIfYN4N7xLmvhXJQpssaWUG7v2g6gFD+ FQLPAxc1AcrKfvLc0dBF8XGiarAd030QP1DkrZiox9TDCdDKXX+27+BEpRqSG32m73/BOf mvNgX7YlhRZCYvYGUc08hqRCBmX6/lZeUiWMHu5QzKWJ9jTgsP4hqAC/N9uc+l9jMquw4o ucE3DHAt1AbMX2u2V8m0K8Ckmj7mgMkEbA6IKxGQdrXnvEgAsvQzYgQXEAU5fQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776292613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y7HFpOoZMWCc+N+bFDGcFmj9+GEN4IHQgEQOMMnTOOQ=; b=b0QxydolLGbbzrSrqdMgSwwCOSA6EZFu1QFzdPP3UM85rXVC3u/rPs7ch2iVVNpsLCpCtp nh8s3q+PGsZjm4oSemeZgq7zg0B+Hfainsu196E8po+7CM+VqChQ04CbPGpbWQqw00rRn5 jZk3HnZSe2w53mci4/BoZVRRFh1cw7rnjIi2MgaOZv0DiUipW8Z/Jxv9Fi/hQkDkJaHznG vpYIqC+zxbqbcnfGF4PF2KCdUZYHF7Qb+3PQhfjX9t2+Vv/fJaFB0wGFT8t/UTifVon2zl EjVRFO8JYtPQrZLWaJ23Gj+OAuPk0/rxYzFnl7f5gB/BrBHF2SF6J4mDZ1li3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fwwxK1rBSzgY2 for ; Wed, 15 Apr 2026 22:36:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3346d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 15 Apr 2026 22:36:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Abdelkader Boudih From: Enji Cooper Subject: git: a85c4ab626ef - main - appleir: Add Apple IR receiver driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a85c4ab626ef52530400ace1957daaa35dd07534 Auto-Submitted: auto-generated Date: Wed, 15 Apr 2026 22:36:47 +0000 Message-Id: <69e012ff.3346d.bf55c2@gitrepo.freebsd.org> The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=a85c4ab626ef52530400ace1957daaa35dd07534 commit a85c4ab626ef52530400ace1957daaa35dd07534 Author: Abdelkader Boudih AuthorDate: 2026-04-14 02:29:43 +0000 Commit: Enji Cooper CommitDate: 2026-04-15 22:36:17 +0000 appleir: Add Apple IR receiver driver HID driver for Apple IR receivers (USB HID, vendor 0x05ac). Supports Apple Remote and generic IR remotes using NEC protocol. Supported hardware: - Apple IR Receiver (0x8240, 0x8241, 0x8242, 0x8243, 0x1440) Apple Remote protocol (proprietary 5-byte HID reports): - Key down/repeat/battery-low detection - 17-key mapping with two-packet command support - Synthesized key-up via 125ms callout timer Generic IR remotes (NEC protocol): - Format: [0x26][0x7f][0x80][code][~code] - Checksum: code + ~code = 0xFF - Default keymap with 8 common codes - See: https://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol Output via evdev with standard KEY_* codes. Raw HID access available at /dev/hidraw0 for custom remapping. Based on protocol reverse-engineering by James McKenzie et al. Reference: drivers/hid/hid-appleir.c (Linux) Tested on Mac Mini 2011 (0x05ac:0x8242). Differential Revision: https://reviews.freebsd.org/D55472 --- share/man/man4/Makefile | 1 + share/man/man4/appleir.4 | 93 +++++++++ sys/conf/files | 1 + sys/dev/hid/appleir.c | 440 +++++++++++++++++++++++++++++++++++++++ sys/modules/hid/Makefile | 1 + sys/modules/hid/appleir/Makefile | 8 + 6 files changed, 544 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 7920b2006822..60ab6e8bdab6 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -44,6 +44,7 @@ MAN= aac.4 \ alc.4 \ ale.4 \ alpm.4 \ + appleir.4 \ altq.4 \ amdpm.4 \ ${_amdsbwd.4} \ diff --git a/share/man/man4/appleir.4 b/share/man/man4/appleir.4 new file mode 100644 index 000000000000..8717bf1b2e83 --- /dev/null +++ b/share/man/man4/appleir.4 @@ -0,0 +1,93 @@ +.\" Copyright (c) 2026 Abdelkader Boudih +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd February 13, 2026 +.Dt APPLEIR 4 +.Os +.Sh NAME +.Nm appleir +.Nd Apple IR receiver driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device appleir" +.Cd "device hidbus" +.Cd "device hid" +.Cd "device evdev" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 Ns : +.Bd -literal -offset indent +appleir_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for Apple IR receivers found in Mac computers +(2006-2011 era). +It supports both Apple Remote controls and generic IR remotes using the +NEC infrared protocol. +.Pp +Supported devices include: +.Bl -bullet -compact +.It +Apple IR Receiver (USB product IDs 0x8240, 0x8241, 0x8242, 0x8243, 0x1440) +.El +.Pp +The driver decodes proprietary Apple Remote button presses and provides +a default keymap for common NEC protocol codes used by generic IR remotes. +Unmapped button codes can be accessed via the raw HID device at +.Pa /dev/hidrawX +for custom userland remapping. +.Pp +The +.Pa /dev/input/eventX +device presents the remote control as an +evdev +input device with standard KEY_* codes suitable for media applications. +.Sh HARDWARE +The +.Nm +driver supports Apple IR receivers with USB vendor ID 0x05ac and the +following product IDs: +.Pp +.Bl -tag -width "0x8242" -compact +.It 0x8240 +Apple IR Receiver (first generation) +.It 0x8241 +Apple IR Receiver +.It 0x8242 +Apple IR Receiver (Mac Mini 2011, MacBook Pro 3,1) +.It 0x8243 +Apple IR Receiver +.It 0x1440 +Apple IR Receiver (slim) +.El +.Sh FILES +.Bl -tag -width ".Pa /dev/input/eventX" -compact +.It Pa /dev/input/eventX +evdev input device +.It Pa /dev/hidrawX +raw HID device for custom button mapping +.El +.Sh SEE ALSO +evdev , +.Xr hidbus 4 , +.Xr usbhid 4 +.Pp +NEC Infrared Transmission Protocol: +.Lk https://techdocs.altium.com/display/FPGA/NEC+Infrared+Transmission+Protocol +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 16.0 . +.Sh AUTHORS +.An Abdelkader Boudih Aq Mt freebsd@seuros.com +.Pp +Based on protocol reverse-engineering by James McKenzie and others. diff --git a/sys/conf/files b/sys/conf/files index 99ba7cdaba33..da07e370a712 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1775,6 +1775,7 @@ dev/gpio/gpio_if.m optional gpio dev/gpio/gpiobus_if.m optional gpio dev/gpio/gpiopps.c optional gpiopps fdt dev/gpio/ofw_gpiobus.c optional fdt gpio +dev/hid/appleir.c optional appleir dev/hid/bcm5974.c optional bcm5974 dev/hid/hconf.c optional hconf dev/hid/hcons.c optional hcons diff --git a/sys/dev/hid/appleir.c b/sys/dev/hid/appleir.c new file mode 100644 index 000000000000..956ad27f6d70 --- /dev/null +++ b/sys/dev/hid/appleir.c @@ -0,0 +1,440 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2026 Abdelkader Boudih + */ + +/* + * Apple IR Remote Control Driver + * + * HID driver for Apple IR receivers (USB HID, vendor 0x05ac). + * Supports Apple Remote and generic IR remotes using NEC protocol. + * + * The Apple Remote protocol was reverse-engineered by James McKenzie and + * others; key codes and packet format constants are derived from that work + * and are factual descriptions of the hardware protocol, not copied code. + * Linux reference (GPL-2.0, no code copied): drivers/hid/hid-appleir.c + * + * Apple Remote Protocol (proprietary): + * Key down: [0x25][0x87][0xee][remote_id][key_code] + * Key repeat: [0x26][0x87][0xee][remote_id][key_code] + * Battery low: [0x25][0x87][0xe0][remote_id][0x00] + * Key decode: (byte4 >> 1) & 0x0F -> keymap[index] + * Two-packet: bit 6 of key_code (0x40) set -> store index, use on next keydown + * + * Generic IR Protocol (NEC-style): + * Format: [0x26][0x7f][0x80][code][~code] + * Checksum: code + ~code = 0xFF + * + * NO hardware key-up events -- synthesize via 125ms callout timer. + */ + +#include + +#include "opt_hid.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define HID_DEBUG_VAR appleir_debug +#include +#include +#include "usbdevs.h" + +#ifdef HID_DEBUG +static int appleir_debug = 0; + +static SYSCTL_NODE(_hw_hid, OID_AUTO, appleir, CTLFLAG_RW, 0, + "Apple IR Remote Control"); +SYSCTL_INT(_hw_hid_appleir, OID_AUTO, debug, CTLFLAG_RWTUN, + &appleir_debug, 0, "Debug level"); +#endif + +/* Protocol constants */ +#define APPLEIR_REPORT_LEN 5 +#define APPLEIR_KEY_MASK 0x0F +#define APPLEIR_TWO_PKT_FLAG 0x40 /* bit 6: two-packet command */ +#define APPLEIR_KEYUP_TICKS MAX(1, hz / 8) /* 125ms */ +#define APPLEIR_TWOPKT_TICKS MAX(1, hz / 4) /* 250ms */ + +/* Report type markers (byte 0) */ +#define APPLEIR_PKT_KEYDOWN 0x25 /* key down / battery low */ +#define APPLEIR_PKT_REPEAT 0x26 /* key repeat / NEC generic */ + +/* Apple Remote signature (bytes 1-2) */ +#define APPLEIR_SIG_HI 0x87 +#define APPLEIR_SIG_KEYLO 0xee /* normal key event */ +#define APPLEIR_SIG_BATTLO 0xe0 /* battery low event */ + +/* Generic IR NEC signature (bytes 1-2) */ +#define APPLEIR_NEC_HI 0x7f +#define APPLEIR_NEC_LO 0x80 +#define APPLEIR_NEC_CHECKSUM 0xFF /* code + ~code must equal this */ + +/* + * Apple IR keymap: 17 entries, index = (key_code >> 1) & 0x0F + * Based on Linux driver (hid-appleir.c) keymap. + */ +static const uint16_t appleir_keymap[] = { + KEY_RESERVED, /* 0x00 */ + KEY_MENU, /* 0x01 - menu */ + KEY_PLAYPAUSE, /* 0x02 - play/pause */ + KEY_FORWARD, /* 0x03 - >> */ + KEY_BACK, /* 0x04 - << */ + KEY_VOLUMEUP, /* 0x05 - + */ + KEY_VOLUMEDOWN, /* 0x06 - - */ + KEY_RESERVED, /* 0x07 */ + KEY_RESERVED, /* 0x08 */ + KEY_RESERVED, /* 0x09 */ + KEY_RESERVED, /* 0x0A */ + KEY_RESERVED, /* 0x0B */ + KEY_RESERVED, /* 0x0C */ + KEY_RESERVED, /* 0x0D */ + KEY_ENTER, /* 0x0E - middle button (two-packet) */ + KEY_PLAYPAUSE, /* 0x0F - play/pause (two-packet) */ + KEY_RESERVED, /* 0x10 - out of range guard */ +}; +#define APPLEIR_NKEYS (nitems(appleir_keymap)) + +/* + * Generic IR keymap (NEC protocol codes). + * Maps raw NEC codes to evdev KEY_* codes. + */ +struct generic_ir_map { + uint8_t code; /* NEC IR code */ + uint16_t key; /* evdev KEY_* */ +}; + +static const struct generic_ir_map generic_keymap[] = { + { 0xe1, KEY_VOLUMEUP }, + { 0xe9, KEY_VOLUMEDOWN }, + { 0xed, KEY_CHANNELUP }, + { 0xf3, KEY_CHANNELDOWN }, + { 0xf5, KEY_PLAYPAUSE }, + { 0xf9, KEY_POWER }, + { 0xfb, KEY_MUTE }, + { 0xfe, KEY_OK }, +}; +#define GENERIC_NKEYS (nitems(generic_keymap)) + +static uint16_t +generic_ir_lookup(uint8_t code) +{ + int i; + + for (i = 0; i < GENERIC_NKEYS; i++) { + if (generic_keymap[i].code == code) + return (generic_keymap[i].key); + } + return (KEY_RESERVED); +} + +struct appleir_softc { + device_t sc_dev; + struct mtx sc_mtx; /* protects below + callout */ + struct evdev_dev *sc_evdev; + struct callout sc_co; /* key-up timer */ + struct callout sc_twoco; /* two-packet timeout */ + uint16_t sc_current_key; /* evdev keycode (0=none) */ + int sc_prev_key_idx;/* two-packet state (0=none) */ + bool sc_batt_warned; +}; + + +/* + * Callout: synthesize key-up event (no hardware key-up from remote). + * Runs with sc_mtx held (callout_init_mtx). + */ +static void +appleir_keyup(void *arg) +{ + struct appleir_softc *sc = arg; + + mtx_assert(&sc->sc_mtx, MA_OWNED); + + if (sc->sc_current_key != 0) { + evdev_push_key(sc->sc_evdev, sc->sc_current_key, 0); + evdev_sync(sc->sc_evdev); + sc->sc_current_key = 0; + sc->sc_prev_key_idx = 0; + } +} + +static void +appleir_twopacket_timeout(void *arg) +{ + struct appleir_softc *sc = arg; + + mtx_assert(&sc->sc_mtx, MA_OWNED); + sc->sc_prev_key_idx = 0; +} + +/* + * Process 5-byte HID interrupt report. + * Called from hidbus interrupt context. + */ +static void +appleir_intr(void *context, void *data, hid_size_t len) +{ + struct appleir_softc *sc = context; + uint8_t *buf = data; + uint8_t report[APPLEIR_REPORT_LEN]; + int index; + uint16_t new_key; + + if (len != APPLEIR_REPORT_LEN) { + DPRINTFN(1, "bad report len: %zu\n", (size_t)len); + return; + } + + memcpy(report, buf, APPLEIR_REPORT_LEN); + + mtx_lock(&sc->sc_mtx); + + /* Battery low: [KEYDOWN][SIG_HI][SIG_BATTLO] -- log and ignore */ + if (report[0] == APPLEIR_PKT_KEYDOWN && + report[1] == APPLEIR_SIG_HI && report[2] == APPLEIR_SIG_BATTLO) { + if (!sc->sc_batt_warned) { + device_printf(sc->sc_dev, + "remote battery may be low\n"); + sc->sc_batt_warned = true; + } + goto done; + } + + /* Key down: [KEYDOWN][SIG_HI][SIG_KEYLO][remote_id][key_code] */ + if (report[0] == APPLEIR_PKT_KEYDOWN && + report[1] == APPLEIR_SIG_HI && report[2] == APPLEIR_SIG_KEYLO) { + /* Release previous key if held */ + if (sc->sc_current_key != 0) { + evdev_push_key(sc->sc_evdev, sc->sc_current_key, 0); + evdev_sync(sc->sc_evdev); + sc->sc_current_key = 0; + } + + if (sc->sc_prev_key_idx > 0) { + /* Second packet of a two-packet command */ + index = sc->sc_prev_key_idx; + sc->sc_prev_key_idx = 0; + callout_stop(&sc->sc_twoco); + } else if (report[4] & APPLEIR_TWO_PKT_FLAG) { + /* First packet of a two-packet command -- wait for next */ + sc->sc_prev_key_idx = (report[4] >> 1) & APPLEIR_KEY_MASK; + callout_reset(&sc->sc_twoco, APPLEIR_TWOPKT_TICKS, + appleir_twopacket_timeout, sc); + goto done; + } else { + index = (report[4] >> 1) & APPLEIR_KEY_MASK; + } + + new_key = (index < APPLEIR_NKEYS) ? + appleir_keymap[index] : KEY_RESERVED; + if (new_key != KEY_RESERVED) { + sc->sc_current_key = new_key; + evdev_push_key(sc->sc_evdev, new_key, 1); + evdev_sync(sc->sc_evdev); + callout_reset(&sc->sc_co, APPLEIR_KEYUP_TICKS, + appleir_keyup, sc); + } + goto done; + } + + /* Key repeat: [REPEAT][SIG_HI][SIG_KEYLO][remote_id][key_code] */ + if (report[0] == APPLEIR_PKT_REPEAT && + report[1] == APPLEIR_SIG_HI && report[2] == APPLEIR_SIG_KEYLO) { + uint16_t repeat_key; + int repeat_idx; + + if (sc->sc_prev_key_idx > 0) + goto done; + if (report[4] & APPLEIR_TWO_PKT_FLAG) + goto done; + + repeat_idx = (report[4] >> 1) & APPLEIR_KEY_MASK; + repeat_key = (repeat_idx < APPLEIR_NKEYS) ? + appleir_keymap[repeat_idx] : KEY_RESERVED; + if (repeat_key == KEY_RESERVED || + repeat_key != sc->sc_current_key) + goto done; + + evdev_push_key(sc->sc_evdev, repeat_key, 1); + evdev_sync(sc->sc_evdev); + callout_reset(&sc->sc_co, APPLEIR_KEYUP_TICKS, + appleir_keyup, sc); + goto done; + } + + /* Generic IR (NEC protocol): [REPEAT][NEC_HI][NEC_LO][code][~code] */ + if (report[0] == APPLEIR_PKT_REPEAT && + report[1] == APPLEIR_NEC_HI && report[2] == APPLEIR_NEC_LO) { + uint8_t code = report[3]; + uint8_t checksum = report[4]; + + sc->sc_prev_key_idx = 0; + callout_stop(&sc->sc_twoco); + + if ((uint8_t)(code + checksum) != APPLEIR_NEC_CHECKSUM) { + DPRINTFN(1, "generic IR: bad checksum %02x+%02x\n", + code, checksum); + goto done; + } + + new_key = generic_ir_lookup(code); + if (new_key == KEY_RESERVED) + goto done; + + if (sc->sc_current_key != new_key) { + if (sc->sc_current_key != 0) + evdev_push_key(sc->sc_evdev, + sc->sc_current_key, 0); + sc->sc_current_key = new_key; + evdev_push_key(sc->sc_evdev, new_key, 1); + evdev_sync(sc->sc_evdev); + } else { + evdev_push_key(sc->sc_evdev, new_key, 1); + evdev_sync(sc->sc_evdev); + } + callout_reset(&sc->sc_co, APPLEIR_KEYUP_TICKS, + appleir_keyup, sc); + goto done; + } + + DPRINTFN(1, "unknown report: %02x %02x %02x\n", + report[0], report[1], report[2]); + +done: + mtx_unlock(&sc->sc_mtx); +} + +/* Apple IR receiver device IDs */ +static const struct hid_device_id appleir_devs[] = { + { HID_BVP(BUS_USB, USB_VENDOR_APPLE, 0x8240) }, + { HID_BVP(BUS_USB, USB_VENDOR_APPLE, 0x8241) }, + { HID_BVP(BUS_USB, USB_VENDOR_APPLE, 0x8242) }, + { HID_BVP(BUS_USB, USB_VENDOR_APPLE, 0x8243) }, + { HID_BVP(BUS_USB, USB_VENDOR_APPLE, 0x1440) }, +}; + +static int +appleir_probe(device_t dev) +{ + int error; + + error = HIDBUS_LOOKUP_DRIVER_INFO(dev, appleir_devs); + if (error != 0) + return (error); + + /* Only attach to first top-level collection (TLC index 0) */ + if (hidbus_get_index(dev) != 0) + return (ENXIO); + + hidbus_set_desc(dev, "Apple IR Receiver"); + return (BUS_PROBE_DEFAULT); +} + +static int +appleir_attach(device_t dev) +{ + struct appleir_softc *sc = device_get_softc(dev); + const struct hid_device_info *hw; + int i, error; + + sc->sc_dev = dev; + hw = hid_get_device_info(dev); + sc->sc_current_key = 0; + sc->sc_prev_key_idx = 0; + sc->sc_batt_warned = false; + mtx_init(&sc->sc_mtx, "appleir", NULL, MTX_DEF); + callout_init_mtx(&sc->sc_co, &sc->sc_mtx, 0); + callout_init_mtx(&sc->sc_twoco, &sc->sc_mtx, 0); + + sc->sc_evdev = evdev_alloc(); + evdev_set_name(sc->sc_evdev, device_get_desc(dev)); + evdev_set_phys(sc->sc_evdev, device_get_nameunit(dev)); + evdev_set_id(sc->sc_evdev, hw->idBus, hw->idVendor, hw->idProduct, + hw->idVersion); + evdev_set_serial(sc->sc_evdev, hw->serial); + evdev_support_event(sc->sc_evdev, EV_SYN); + evdev_support_event(sc->sc_evdev, EV_KEY); + evdev_support_event(sc->sc_evdev, EV_REP); + + for (i = 0; i < APPLEIR_NKEYS; i++) { + if (appleir_keymap[i] != KEY_RESERVED) + evdev_support_key(sc->sc_evdev, appleir_keymap[i]); + } + for (i = 0; i < GENERIC_NKEYS; i++) + evdev_support_key(sc->sc_evdev, generic_keymap[i].key); + + error = evdev_register_mtx(sc->sc_evdev, &sc->sc_mtx); + if (error != 0) { + device_printf(dev, "evdev_register_mtx failed: %d\n", error); + goto fail; + } + + hidbus_set_intr(dev, appleir_intr, sc); + + error = hid_intr_start(dev); + if (error != 0) { + device_printf(dev, "hid_intr_start failed: %d\n", error); + goto fail; + } + + return (0); + +fail: + if (sc->sc_evdev != NULL) + evdev_free(sc->sc_evdev); + callout_drain(&sc->sc_co); + callout_drain(&sc->sc_twoco); + mtx_destroy(&sc->sc_mtx); + return (error); +} + +static int +appleir_detach(device_t dev) +{ + struct appleir_softc *sc = device_get_softc(dev); + int error; + + error = hid_intr_stop(dev); + if (error != 0) { + device_printf(dev, "hid_intr_stop failed: %d\n", error); + return (error); + } + callout_drain(&sc->sc_co); + callout_drain(&sc->sc_twoco); + evdev_free(sc->sc_evdev); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static device_method_t appleir_methods[] = { + DEVMETHOD(device_probe, appleir_probe), + DEVMETHOD(device_attach, appleir_attach), + DEVMETHOD(device_detach, appleir_detach), + DEVMETHOD_END +}; + +static driver_t appleir_driver = { + "appleir", + appleir_methods, + sizeof(struct appleir_softc) +}; + +DRIVER_MODULE(appleir, hidbus, appleir_driver, NULL, NULL); +MODULE_DEPEND(appleir, hid, 1, 1, 1); +MODULE_DEPEND(appleir, hidbus, 1, 1, 1); +MODULE_DEPEND(appleir, evdev, 1, 1, 1); +MODULE_VERSION(appleir, 1); +HID_PNP_INFO(appleir_devs); diff --git a/sys/modules/hid/Makefile b/sys/modules/hid/Makefile index 10720570deb7..a32b9326647e 100644 --- a/sys/modules/hid/Makefile +++ b/sys/modules/hid/Makefile @@ -6,6 +6,7 @@ SUBDIR = \ hidraw SUBDIR += \ + appleir \ bcm5974 \ hconf \ hcons \ diff --git a/sys/modules/hid/appleir/Makefile b/sys/modules/hid/appleir/Makefile new file mode 100644 index 000000000000..5b56b7ea3048 --- /dev/null +++ b/sys/modules/hid/appleir/Makefile @@ -0,0 +1,8 @@ +.PATH: ${SRCTOP}/sys/dev/hid + +KMOD= appleir +SRCS= appleir.c +SRCS+= opt_hid.h +SRCS+= bus_if.h device_if.h usbdevs.h + +.include From nobody Thu Apr 16 06:06:24 2026 X-Original-To: dev-commits-src-main@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 4fx6w062Wkz6Z0Sr for ; Thu, 16 Apr 2026 06:06:24 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fx6w02gzWz3jVl for ; Thu, 16 Apr 2026 06:06:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZfpU9DVT5POloYiLhKUygCrUqVOaEPxHPdwY2gQHO6k=; b=ehbP9qjfsDhGRHfqe08D5I+ycFiJHcOl0qlYwwwGtnOrdmi+j045ZEeQQCEMdvr+INtGx+ MFAAXxau4V4N1+KtYlDAPAp4rp165G8zFVzTZXYgoFSTg5Qol1NWcLvyMIbULTv7pXyr2s FuLfXL97I+7u7bJ/go1r6ValddzXycrDxkk5oq9XfbJhutMFqtZS3t/CZYgzrpU8h4ILAr wTkotl1/P8FaG9R2D81jJYGgKbDhipu5UCWMTOXUhxe7crVRUYOzQJwwVEgNFMfQy2eVRI CJeIt0eTOdlfnGmnzXdFH64gRX/OFW3lUwo7GO1Kjd0bH8KmfGLVHJsAJfg6TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776319584; a=rsa-sha256; cv=none; b=qoKDwlV51eeS+gGxbXKin3ZMqtBhIpjN7a8Xn6lnFyrxEb0PdnDouZEHnDaiZh6KiC1KRy 8j5ZqoGlJjUNvyh9zHPgUlDAyVO/6CfwLIcpUekr6Rk6kP95CUTKfyD+42WeenxA5Brqm1 sGessz4XAzHEXHjIOQw5ENt6VhA8sTgKKc+YLffxiiWizZmLwzSWeo5Gldjkq6FZWL+BgA h6n2Ol3GLVD+zaSqaQwDQ0rf6v5dGe8xVavPJhpML90rCKA5jYyAEtv2bpAEG9xLFORiFv nBP1qj7UxeY+B4y241FcwthUXJGt1o8hIxpVFOR5MGIsMnH7Ssxx8plzn2KTmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319584; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZfpU9DVT5POloYiLhKUygCrUqVOaEPxHPdwY2gQHO6k=; b=PALmLepoaQiI5VJyE16cbDPdtRdaOyGJI6s5kCMlzp/OlEFHUljU9gaySgHEKSVYR9xqGl QjDKeEKp1rKpqJOvFyjqLRN5lhhUnLDipinG6cXbGd+2jCYuYip6onPk8HI8V6dcmJznJl lKy/0r3ddZ/qii1ckoyBxtm8p06wbz5zSFMJgL68lnypbch/52VhVXhePQSlG2NfbjLNQ3 sB54WmKROEsApKXNzH6W6C3DQIktrRcaQnkbGCVpA1KT4lvimp/gl08jD3hA89DjcmGqQj zUXJKWopVF3sX60/Xeaf3WrqrAaq3X3rYN4SEQ2/8jpnBoPFBnv5okqlxuNCxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fx6w01k9XzvCs for ; Thu, 16 Apr 2026 06:06:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ae59 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 06:06:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Marcus Gartner From: Warner Losh Subject: git: 31744051c8a1 - main - asmc: correctly label ASMC_KEY_FANMINSPEED as read-write List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 31744051c8a1c8baca219d93ace6e3e1a5463a45 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 06:06:24 +0000 Message-Id: <69e07c60.3ae59.e6b6bee@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=31744051c8a1c8baca219d93ace6e3e1a5463a45 commit 31744051c8a1c8baca219d93ace6e3e1a5463a45 Author: Marcus Gartner AuthorDate: 2026-04-11 02:02:52 +0000 Commit: Warner Losh CommitDate: 2026-04-16 06:05:20 +0000 asmc: correctly label ASMC_KEY_FANMINSPEED as read-write Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2137 --- sys/dev/asmc/asmcvar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h index 2c60181704e5..00857fe5fea8 100644 --- a/sys/dev/asmc/asmcvar.h +++ b/sys/dev/asmc/asmcvar.h @@ -109,7 +109,7 @@ struct asmc_softc { #define ASMC_KEY_FANMANUAL "FS! " /* RW; 2 bytes */ #define ASMC_KEY_FANID "F%dID" /* RO; 16 bytes */ #define ASMC_KEY_FANSPEED "F%dAc" /* RO; 2 bytes */ -#define ASMC_KEY_FANMINSPEED "F%dMn" /* RO; 2 bytes */ +#define ASMC_KEY_FANMINSPEED "F%dMn" /* RW; 2 bytes */ #define ASMC_KEY_FANMAXSPEED "F%dMx" /* RO; 2 bytes */ #define ASMC_KEY_FANSAFESPEED "F%dSf" /* RO; 2 bytes */ #define ASMC_KEY_FANTARGETSPEED "F%dTg" /* RW; 2 bytes */ From nobody Thu Apr 16 06:06:25 2026 X-Original-To: dev-commits-src-main@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 4fx6w142rvz6Z012 for ; Thu, 16 Apr 2026 06:06:25 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fx6w12hJbz3jSP for ; Thu, 16 Apr 2026 06:06:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bJzA3fPacYeLZELjHwHRja5gELE4ZAQqHLryh4xwIj8=; b=toNJT1+bzgGYtFn3qPPFFJeOremNqffAzkMiw0m07bXFOwkVqJkgFGaKLdZvftvK3TfkW+ NYHfyMIR7E8P8lKpWnZMwF9EhJsW/cKRe2aAFrQ8Ly3WXU7qhbImptNSnWbrJrs9pLGoIS EKwgSPLxsQvsXZ7aj0mFEZvENlt4wQT3TKstTfN/sZCV2KJxVXh9/u29qK8rstsOh1eppx cMDNP+xV9FlG2OTTR36v2nNHAM1HUUxPJgDJbt1NU+x7olBUsmLZ5qmh47zTcJlKL+xjMY n8IvHbCP6RWGmzOwmzJerKDG8DljpGFIOYxRFj3H6i/H6D6liCy349n2miUiiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776319585; a=rsa-sha256; cv=none; b=o4bRLPLr4SwEbH7/59JnOIKiYfhDV+bd9lnVy7qocVYxCbZlujR4uBCYJaXST2SzKA79cx ahU7iE5/F9CbWuyIT1pB+fhJoVL9AKRzjNRrge+pKmkLNQsKsrnGPzOyqjaOkvn2vprfUj 8RRD0DNBPn2DRGLDTpr8VYGKWHrHVx+FWCMslVG7aIM1Z0OUMxykU4q37b8pItxW9MdujL QU/rlmtG08TcwbXpPZk/ursM7HcrY5+s1QRxPYMBWCcSBSOGQmKvYCddxhc0AvEsUQPkWA /uuS+BlXobr7IQ82ibvgA05I3u197r+SJGiSc4TX/bWpW7UuI6DM1vphYmBrlg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319585; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bJzA3fPacYeLZELjHwHRja5gELE4ZAQqHLryh4xwIj8=; b=TCMvgtxQGMILdgfkrcf50/cbadTzTzfty0FxkYIWTpNrpCr2Q/riONWrEe7gS8guhcpEAG J0i+PiNTDKYo9sLSJHMC843xzmdi+7A1hORFk9EhEUVwi42kRhwojY/B9jKA9qZirNJAVk 6Z6EKDd3yWtZ6heNcL6Iw0p876ZxswWSulU2Dal7EA+9nbtYnrLTxkQt3WAnQ0abvhZ7kc IAbfoAgiW31Bi0V0gT92hAsVG/vg14EfIABzgTGogQpGQpIGaPyhbWNmcT3AIPxR5bifA+ HK5NS+Az5kSLccLpN8P63Weh+fA50XYEWyIYrJhHbcP8QMTMwZt8bDqC2YMnSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fx6w12DXdzvwk for ; Thu, 16 Apr 2026 06:06:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d3ae by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 06:06:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: brothersw From: Warner Losh Subject: git: 32cc01e75aab - main - sysctl.3: Correct kern and kern.proc type descriptions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 32cc01e75aabc117c2c19c25291aa25eb1ec3cef Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 06:06:25 +0000 Message-Id: <69e07c61.3d3ae.5f63595b@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=32cc01e75aabc117c2c19c25291aa25eb1ec3cef commit 32cc01e75aabc117c2c19c25291aa25eb1ec3cef Author: brothersw AuthorDate: 2026-04-07 18:45:08 +0000 Commit: Warner Losh CommitDate: 2026-04-16 06:05:20 +0000 sysctl.3: Correct kern and kern.proc type descriptions Fix several incorrect sysctl.3 type and mutability descriptions so the manpage matches the actual kern and kern.proc interfaces. Signed-off-by: Tyler Waddell Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2128 --- lib/libc/gen/sysctl.3 | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/libc/gen/sysctl.3 b/lib/libc/gen/sysctl.3 index ef897c653728..75fd6307bd30 100644 --- a/lib/libc/gen/sysctl.3 +++ b/lib/libc/gen/sysctl.3 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 31, 2025 +.Dd April 15, 2026 .Dt SYSCTL 3 .Os .Sh NAME @@ -325,7 +325,7 @@ information. .Bl -column "KERNXMAXFILESPERPROCXXX" "struct clockrateXXX" -offset indent .It Sy Second Level Name Ta Sy Type Ta Sy Changeable .It Dv KERN_ARGMAX Ta integer Ta no -.It Dv KERN_ARND Ta integer Ta no +.It Dv KERN_ARND Ta byte buffer Ta no .It Dv KERN_BOOTFILE Ta string Ta yes .It Dv KERN_BOOTTIME Ta struct timeval Ta no .It Dv KERN_CLOCKRATE Ta struct clockinfo Ta no @@ -333,7 +333,7 @@ information. .It Dv KERN_HOSTID Ta integer Ta yes .It Dv KERN_HOSTUUID Ta string Ta yes .It Dv KERN_HOSTNAME Ta string Ta yes -.It Dv KERN_IOV_MAX Ta integer Ta yes +.It Dv KERN_IOV_MAX Ta integer Ta no .It Dv KERN_JOB_CONTROL Ta integer Ta no .It Dv KERN_LOCKF Ta struct kinfo_lockf Ta no .It Dv KERN_LOGSIGEXIT Ta integer Ta yes @@ -457,7 +457,7 @@ the currently installed userland. .It Li KERN_OSRELEASE The system release string. .It Li KERN_OSREV -The system revision string. +The system revision number. .It Li KERN_OSTYPE The system type string. .It Li KERN_POSIX1 @@ -501,14 +501,14 @@ specifies the current process. .It Dv KERN_PROC_GROUPS Ta "gid_t []" .It Dv KERN_PROC_ENV Ta "Set of strings" .It Dv KERN_PROC_AUXV Ta "Elf_Auxinfo []" -.It Dv KERN_PROC_RLIMIT Ta "Integer" -.It Dv KERN_PROC_PS_STRINGS Ta "Integer" +.It Dv KERN_PROC_RLIMIT Ta "struct rlimit" +.It Dv KERN_PROC_PS_STRINGS Ta "Pointer to struct ps_strings" .It Dv KERN_PROC_UMASK Ta "Integer/short" .It Dv KERN_PROC_OSREL Ta "Integer" -.It Dv KERN_PROC_SIGTRAMP Ta "Integer" -.It Dv KERN_PROC_CWD Ta "String" +.It Dv KERN_PROC_SIGTRAMP Ta "struct kinfo_sigtramp" +.It Dv KERN_PROC_CWD Ta "struct kinfo_file" .It Dv KERN_PROC_NFDS Ta "Integer" -.It Dv KERN_PROC_SIGFASTBLK Ta "Integer" +.It Dv KERN_PROC_SIGFASTBLK Ta "Address" .It Dv KERN_PROC_VM_LAYOUT Ta "struct kinfo_vm_layout" .It Dv KERN_PROC_RLIMIT_USAGE Ta "rlim_t []" .It Dv KERN_PROC_KQUEUE Ta "struct kinfo_knote []" @@ -570,7 +570,8 @@ Read from the note of the elf executable at time. Might be modified by the process. .It Dv KERN_PROC_SIGTRAMP -Address of the signal trampoline in the process address space, +Structure describing the address range of the signal trampoline in the +process address space, where, simplifying, the kernel passes control for signal delivery. .It Dv KERN_PROC_CWD Returns the current working directory for the process. @@ -586,6 +587,12 @@ Fills a structure describing process virtual address space layout. Like .Dv KERN_PROC_RLIMIT , but instead of the limit, returns the accounted resource usage. +If the MIB is of the form +.Li kern.proc.rlimit_usage\&. Ns Va pid , +usage values for all resources are returned. +If the MIB is of the form +.Li kern.proc.rlimit_usage\&. Ns Va pid Ns \&. Ns Va resource , +the usage value for the specified resource is returned. For resources which do not have a meaningful current value, .Li \-1 is returned. From nobody Thu Apr 16 06:06:26 2026 X-Original-To: dev-commits-src-main@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 4fx6w314gGz6Z0QY for ; Thu, 16 Apr 2026 06:06: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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fx6w23s97z3jM3 for ; Thu, 16 Apr 2026 06:06:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zaRTQ+RUUK98Y9dc9DYo4hSYnaovK/x/nam9Z7NV2zI=; b=MV4DF88oUQ0+L9NDSwM93Pa8WBmzRS0hfFYBVud96uU8oNEL2dorrwbUON82Xn0A4oFk5/ mIUuZvujdwUJNQSL3M7pmdrHDjB1qb4rEgAydRmfUwEP44nyghcc4Em1lJ0QMByLl+zWKg wgEiUdltDj11kaeHg0hSe8FjHyU0QA8h7lK8MMFFb36OuOaH1cmqDUdKCaOKxdYC4KOSII M+TG0L3OsSOiCoZf9oK494BkYU/jE0VjKVIvxBmG6EdRCYcAZap82PDMyQa0lyYrrU314I VFH5W1U48fhtjuQo47dY5GbFCtE+HTVf0UjFUryAgnA3fbtL1WBjKzQBjvZkqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776319586; a=rsa-sha256; cv=none; b=pffCJo18IajvdPwa+M12kAw+6TIlmEjky65jcDC12prLB/Mfju4XM5xLpW1zra20yZTU0g vvmgSCxNJXM1J4424rBEK1aoy9rp5Hv/LTQr5nMbBMx6O3EHYYaF9thUkDRKg2YsgiKBTG c8g9RjRVNKVirUct+E4Vr87cW5S5S/2YhWlaB3HFw53CJapXu9nOhDqKcOohjQi6RbRzF5 2rD7ERlb/0hMY9qL8bBpZEcl2/kMpLYJiQ8+/FrKbtA67UosOGcyLtJvx3xIyU73ZbADc/ D1dviZInV8oOuOWgFOz6rHWCxc1u+RB4Xrl0WBa6CMwn5Uplg6ljs359ErCzDA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319586; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zaRTQ+RUUK98Y9dc9DYo4hSYnaovK/x/nam9Z7NV2zI=; b=eqMFZY2kf9sBtXzkdrgqm/YHn7+ZcGLK4ocCzl71QcUK0kjiG21ODuJYKPhbJ1o2wLGkpg lyRO2/4/matTND7/2DafNn8+egXVwnIzaBSWhpgnENY+AhZCiCLgxhdYCge1A10AgNnGmD rLT/Zxyz7T9cXXI04rZ2Z+FGGoUTygBe9Anxq+Y+WjhCxcTmaHBcFH//YG1Hmf3vGDDn/G wSPFF9ycbgVbmYC4RuI9R2Pu7C5PdevlTIcb2/rf+v1L5a/NGYgS0J90a41vo2Dkqmr2P/ LU+4kcBSEyPJ7t2cI6BCOADzcwTvbIgkjtAvgljPnFElqrPmW6SnYjSZFy2oJQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fx6w22sDmzvwl for ; Thu, 16 Apr 2026 06:06:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d246 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 06:06:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Vince From: Warner Losh Subject: git: 763404397007 - main - Fix xhci detection on Raspberry Pi 400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7634043970078f63eea03bb8975bd3fe1e883130 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 06:06:26 +0000 Message-Id: <69e07c62.3d246.45c03ae@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7634043970078f63eea03bb8975bd3fe1e883130 commit 7634043970078f63eea03bb8975bd3fe1e883130 Author: Vince AuthorDate: 2026-04-02 01:28:50 +0000 Commit: Warner Losh CommitDate: 2026-04-16 06:05:20 +0000 Fix xhci detection on Raspberry Pi 400 If you use the FreeBSD pre-build Raspberry Pi image, it does not include the specific .dtb file for the Raspberry Pi 400. On this hardware, it will fall back to attempting to load the Raspberry Pi 4 .dtb file instead. The Pi 4 .dtb file reports the board compatible name as "raspberrypi,4-model-b" The Pi 400 .dtb file reports the board compatible name as "raspberrypi,400" However, it's even better to use the generic name. When using the official Pi 400 .dtb file from the Raspberry Pi Firmware collection, the FreeBSD xhci driver currently fails to recognize this, and thus fails to initialize the xhci device. This means no external USB, or internal USB (which feeds the build-in keyboard) The official Raspberry Pi FreeBSD image has been working on the Pi 400 "on accident" simply because it didn't include the Pi 400 .dtb file prior to this. But the Stratipi Builder uses the full Raspberry Pi firmware suite and hit this bug. As a note: this is probably also a bug on the Compute Module 4 (CM4), but I don't own one of these devices in order to test/validate it. MFC After: 5 days Reviewed by: imp, Ali Mashtizadeh Pull Request: https://github.com/freebsd/freebsd-src/pull/2115 --- sys/arm/broadcom/bcm2835/bcm2838_xhci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm/broadcom/bcm2835/bcm2838_xhci.c b/sys/arm/broadcom/bcm2835/bcm2838_xhci.c index 25579d7227a5..b1461d17d391 100644 --- a/sys/arm/broadcom/bcm2835/bcm2838_xhci.c +++ b/sys/arm/broadcom/bcm2835/bcm2838_xhci.c @@ -89,7 +89,7 @@ bcm_xhci_probe(device_t dev) root = OF_finddevice("/"); if (root == -1) return (ENXIO); - if (!ofw_bus_node_is_compatible(root, "raspberrypi,4-model-b")) + if (!ofw_bus_node_is_compatible(root, "brcm,bcm2711")) return (ENXIO); /* @@ -105,7 +105,7 @@ bcm_xhci_probe(device_t dev) return (ENXIO); device_set_desc(dev, - "VL805 USB 3.0 controller (on the Raspberry Pi 4b)"); + "VL805 USB 3.0 controller (on the Raspberry Pi 4 series)"); return (BUS_PROBE_SPECIFIC); } From nobody Thu Apr 16 06:06:27 2026 X-Original-To: dev-commits-src-main@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 4fx6w468rPz6Z0dD for ; Thu, 16 Apr 2026 06:06:28 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fx6w413xhz3jKT for ; Thu, 16 Apr 2026 06:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YITDoeHAmHklMjMNJnZjqdCwIOoYdW/MHAH+3LH0bDY=; b=Oivsj8mhOyO8S3cGrUwymmlR2wEBrD4gFMw8trwBXAlA0nlkO66ND2SwTPEZF0B+BJZg8F sUP3wNkqUFJpUky7vgMOqeRKyrUjKRHsHppTT7ezwfA/7xQo9/AJEcI9mPYOH2cCgTRXxG Fh7CEvml1yfnbzDEgWPqlE3qp03dM8XD+IvzbG69tGZ0TtTFtdM7Ul4oBXBNDbng7Vit4e 8SOZ6fEw8pdHZOEH4i3sJhRMMos/CcUp+p1c4Yaa/ceA/jVB1t+IbWINLkvAiNX4fA9R5j Hs0wHsAQ45Dve6QFkZWT/5I8/8IEz22cloUzoNpgq8TqF2wsJ1obgvg7I5bt1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776319588; a=rsa-sha256; cv=none; b=OhUWTZHFe2jRdIpaF1Eu6vV28U/gTLAi6UEnPgEZ6THcGc7LNJOEtlRsEpn86wDE+2Q+No jUk7K86o0ejUXoQE8HymlbpSmf0WfoMJYWjXyVnVdnHNIDfh33e/FL6P0YwkSE5rpI6kwf W2bWSZhAkrfspLA5dR1vi3TbIAQtNhCpxZqd0kYpDkcmGQq/MnWSJhRukCICYaP0nUWSeT AW2ZQV1cCXtFGZZAmYPHQjvGISS0IGncGVEDrdLGaA6bUbZcWKGyLnAQflMVBEp8BCPYV/ SiXoRiURsRVFgXpo5hdRi23wm3wkbuQG8FJnAgx2Iyj0/Pmt7A36Dy0oTU2TPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YITDoeHAmHklMjMNJnZjqdCwIOoYdW/MHAH+3LH0bDY=; b=QqWUbc38AdX5y0P8+Qr+yyzOuqE4bl+ILOA61Fj95jBj0YvjSUi2A6ylbO3Jvq6HvVbyJg FtkpJ/5ScKikbY9KMObgDatLx4cZZ6uSOcFBe40rfEJh/WqmoTKnHS6Ff60jna6vvji4rT Ujv484SRj7RnZHRJySxqOIPDrjlexc9fh0HAsvajghZG7NflpC+aNIW/gPVe4TxAxy0SDs T08dTItEnXnEblAnBpsrHXDVrJ2Rvq/THnOpaFZA6wCFvJZMfue19/j0w/80QcY0yR53Gv HhVhXDpwUJgS/CVuJyCfTISTPRJ5tZqxi74VjwCmnvKaCWbkwFtplXXX6CSr3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fx6w33gwxzvPK for ; Thu, 16 Apr 2026 06:06:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d3b3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 06:06:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Weixie Cui From: Warner Losh Subject: git: 75e7709f4f3c - main - uvscom: Fix baud rate validation in uvscom_pre_param() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 75e7709f4f3c9e1576af45715730c286c1ec3b24 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 06:06:27 +0000 Message-Id: <69e07c63.3d3b3.6ef3e991@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=75e7709f4f3c9e1576af45715730c286c1ec3b24 commit 75e7709f4f3c9e1576af45715730c286c1ec3b24 Author: Weixie Cui AuthorDate: 2026-03-31 10:17:28 +0000 Commit: Warner Losh CommitDate: 2026-04-16 06:05:20 +0000 uvscom: Fix baud rate validation in uvscom_pre_param() The switch fell through from the supported B150–B115200 cases into default and returned EINVAL for every speed. Break out before default so valid rates return success, matching uvscom_cfg_param(). Signed-off-by: Weixie Cui Reviewed by: imp,aokblast Pull Request: https://github.com/freebsd/freebsd-src/pull/2110 --- sys/dev/usb/serial/uvscom.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/serial/uvscom.c b/sys/dev/usb/serial/uvscom.c index b9add5c1b37b..c5086f7e86cf 100644 --- a/sys/dev/usb/serial/uvscom.c +++ b/sys/dev/usb/serial/uvscom.c @@ -551,8 +551,9 @@ uvscom_pre_param(struct ucom_softc *ucom, struct termios *t) case B38400: case B57600: case B115200: + break; default: - return (EINVAL); + return (EINVAL); } return (0); } From nobody Thu Apr 16 06:06:23 2026 X-Original-To: dev-commits-src-main@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 4fx6w52vP8z6Z0W4 for ; Thu, 16 Apr 2026 06:06:29 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fx6w42SbHz3jPr for ; Thu, 16 Apr 2026 06:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CDBSpzCLZwQfeh3j8+0M9TEvvY3X1h+ECxOk7xIDd/w=; b=vJuBE5hMdICGuu3Golw525Hlv+hczxPBB4eFwW9x0XRwV4EKUfZLQGpi/90sUlo7GxedUo aUW3EqzT4a2pmSAjqYzIbzD5ZLjJMkOlDE9VG2BvLPJsrWO/QbtKtzSb90of2JeF/50jc8 J66mbmARYXmtqu6veKH/kLyZOeGKrdtANbGGb09uvWXI5nOlaSeY/AePHyrK1/jVI+xrLa Z3FY3N4R9zzXxjIeVsIlrzIerh2vOchuumnrb50Xm1ALp0fOEtxHZQcT74C+ihgElqzSJf RYhTc+MeoaDneJGOflHdDNZ3LQ8Q0XtI9NWaDWrpjAaqSjjxo+DLkQtJs9PA8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776319588; a=rsa-sha256; cv=none; b=mYysLMGsmMC66Z0LfE/z29nBqu4Jmsug4FRWfNgAxFEAjvDfsl+sk0oqas8eUc7ZO8P+q+ yFb3qd0/z0xCMryIyez2CC6dEQtCdgiViPiy+dWxJPOf6sr4w2qVOYOJV/Jq3bg5AE7glN xe1/L5SM3KjZEFPubdqbE8fEoa82OWPsTBQvkETOHfNdH3jtSjC75GnMf8OkmfcrOH9XU9 4TOBJ6luxIHzz89T0wi/BLmdv7GuR/b+WINR/tze/pyr9+EdiMZCHyNppuTVBkLljax/sd 9JNLvDO9HGvv7K3ty8Jx6tStIAF9DW/1XtyXmaRU6cG3ebK9pEUxUFPxk6NVDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CDBSpzCLZwQfeh3j8+0M9TEvvY3X1h+ECxOk7xIDd/w=; b=TjnFihHVICMfB1wxjYyZDYctqwtktEbBkaeyADsDT4NAysQLhja5tmWkILToQOPsetgPrC clt0Frn4Ci9HbvzmVUOaJ1/cc0OPbS730pRcNgbBlIctSlNBa8CFGfA2eUm4S5YntzzDIB jLB4Nbfa2R47MttpZvWxmh7dcyaSt0lQDOqFEz/2ShENRiAPy9mCl5kkfZx9GP8Si724eC gXpZvgMLUtl/iiLh/+r9LFzQhd4AtUQjJqLaYY41Pna7EM+r31hb9O3XHGAonbH3Z6jNF6 j+Bw99ZxgChWaJE97fDhBTdCOPKDHg8/wr+C0HMuSziaKBijp9W1QDZJb4YIxA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fx6w41Jn6zvwn for ; Thu, 16 Apr 2026 06:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3cb89 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 06:06:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Marcus Gartner From: Warner Losh Subject: git: b5b9c65a6894 - main - asmc: add support for MacBookPro13,1 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5b9c65a689457e608cc31831ed690d303d63ffa Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 06:06:23 +0000 Message-Id: <69e07c5f.3cb89.756528a9@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b5b9c65a689457e608cc31831ed690d303d63ffa commit b5b9c65a689457e608cc31831ed690d303d63ffa Author: Marcus Gartner AuthorDate: 2026-04-11 02:03:18 +0000 Commit: Warner Losh CommitDate: 2026-04-16 06:05:19 +0000 asmc: add support for MacBookPro13,1 This commit adds support for the MacBookPro13,1 (late 2016, 13-inch). The SMC keys were collected from https://logi.wiki/index.php/SMC_Sensor_Codes. Two temperature keys are omitted because they fail to be read: TI0P (IO Proximity) and Ta0P (Ambient Air). Note that the with this model the `dev.asmc.0.fan.0.minspeed` setting only applies when the fans have been activated by the system. In my testing, the fans did not spin up until CPU temperatures hit about 80C. At lower temperatures, the fans will happily ignore the minimum speed and remain at 0 rpm. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2137 --- sys/dev/asmc/asmc.c | 6 ++++++ sys/dev/asmc/asmcvar.h | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index 044fd7e85057..7cd5181605a8 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -343,6 +343,12 @@ static const struct asmc_model asmc_models[] = { ASMC_MBP115_TEMPS, ASMC_MBP115_TEMPNAMES, ASMC_MBP115_TEMPDESCS }, + { + "MacBookPro13,1", "Apple SMC MacBook Pro Retina Core i5 (late 2016, 13-inch)", + ASMC_SMS_FUNCS_DISABLED, ASMC_FAN_FUNCS2, ASMC_LIGHT_FUNCS, + ASMC_MBP131_TEMPS, ASMC_MBP131_TEMPNAMES, ASMC_MBP131_TEMPDESCS + }, + /* The Mac Mini has no SMS */ { "Macmini1,1", "Apple SMC Mac Mini", diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h index 0e8d4e9d4a36..2c60181704e5 100644 --- a/sys/dev/asmc/asmcvar.h +++ b/sys/dev/asmc/asmcvar.h @@ -564,6 +564,24 @@ struct asmc_softc { "Pbus", "Ambient Light", "Leftside", "Rightside", "CPU Package Core", \ "CPU Package GPU", "CPU Package Total", "System Total", "DC In" } +#define ASMC_MBP131_TEMPS { "TB0T", "TB1T", "TB2T", "TC0F", \ + "TC0P", "TC1C", "TC2C", "TCGC", \ + "TCSA", "TCXC", "Th1H", "TM0P", \ + "TPCD", "Ts0P", "Ts0S", "TaLC", \ + "Ts1P", NULL } + +#define ASMC_MBP131_TEMPNAMES { "battery", "battery_1", "battery_2", "cpu_die_peci", \ + "cpu_proximity", "cpu_core_1", "cpu_core_2", "intel_gpu", \ + "cpu_sys_agent", "cpu_core_peci", "right_fin_stack", "memory_proximity", \ + "platform_ctrl_hub", "trackpad", "bottom_skin", "air_flow", \ + "trackpad_act" } + +#define ASMC_MBP131_TEMPDESCS { "Battery", "Battery Sensor 1", "Battery Sensor 2", "CPU Die (PECI)", \ + "CPU Proximity", "CPU Core 1", "CPU Core 2", "Intel GPU", \ + "CPU System Agent Core (PECI)", "CPU Core (PECI)", "Right Fin Stack", "DDR3 Proximity", \ + "Platform Controller Hub Die", "Trackpad", "Bottom Skin", "Air Flow", \ + "Trackpad Actuator" } + #define ASMC_MM_TEMPS { "TN0P", "TN1P", NULL } #define ASMC_MM_TEMPNAMES { "northbridge1", "northbridge2" } #define ASMC_MM_TEMPDESCS { "Northbridge Point 1", \ From nobody Thu Apr 16 06:06:29 2026 X-Original-To: dev-commits-src-main@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 4fx6w610CGz6Z0WC for ; Thu, 16 Apr 2026 06:06:30 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fx6w56Lldz3jgX for ; Thu, 16 Apr 2026 06:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9uHk+A95ygrF3atcgzDBa43rMiG9cYisBNs1wafBfrY=; b=hCbGvEwjd2XGZ7ni9VN9lzTdNOBeHAz+5UOV9Z2PB7NcsZQx19OqdxcA6bfz5BZbDv/Vuk hEczb7BzdWfWFgILWRwxT1jj4CQMp4M4JCJInWH6sYl+PTQlD96nWfVeKac6AZZubA93LW ihUPJgikPaX2Bvy3AyUu5kgzi64jVXS3oQgNS2ciLC14s4dexGohOBHT8MtJCTg+Pb69rE tP9Hh7tY6fVwZSH/dOXORZkkzNKgLTyakc8jhYmW6O/5/B6/16KYQuv1r9MMcsaN6Slj+U sM/kanoBhV5BvV23kZQ9TmbCkhtuzLHrJwbfLC0QhIiyvnS6RhNUzoxp+N+uyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776319589; a=rsa-sha256; cv=none; b=vYgjso8WYVH8ULhzA62kxJMuk3foO8IZUkD2Gxg68uDBkGroAbsEa8tMMEyx+PiN0t23O7 AOdcmcp80vVECRj7C965bMoOBfD4dI0sYrc1BtJOAAQ0mgP/S10o5vYAs3Pf75iDZbi93L TW4zc7ZVRiob1dSDsWcY198WPKoGgeznrl7KLMQb4MHbMEfYRlliJA6yggBA0cNFnPKwXd vzomW25ZEIytMgSb9aOCRQRQB5WK99ExTTmfbiKv5OIHWkKAdsG8ZiIdS2cmg2Cv5FOtWq dOKvJSNJW5m9w1x8aqsC4Sz8dYa8F7lEHrQUoPt6Hdff8/PiLxQ467NihsDr/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9uHk+A95ygrF3atcgzDBa43rMiG9cYisBNs1wafBfrY=; b=wUnKvuxmYWnBbb9M26NJ2fWz+m9zBIaTm/QRPywcL/zQzgnqk9wfnDFR6O9YCNJ3YX2xzP JEKsFaR4NYdVdbUUTunFpQrQXq2/OzZUfZEyE5Ai+AY67bLuMuRd2sXnLTR9QB3Kwfx3sO zTNDCDL47zq1QbnhUQ5W3FENAajikJYGVq1FcQV6gffWZOYJ/qmf3YO/K3oJQjeIRnvvLJ R9UjpVscxaefAh8GsZeCrBecwgSzFefDDUV16S4rM40gKCJfDZJxCZ36l4l74/VL25VJ9D NFTV1+/gILbWDOFr3N1lw4rbq+wFbQk53lrwDJMfBRTGSKCdiXR4/89RfzdLvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fx6w55Czqzvwr for ; Thu, 16 Apr 2026 06:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3c2ea by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 06:06:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Po Han Chen From: Warner Losh Subject: git: 92378e0405a8 - main - periodic/daily: show verbose zpool status when errors are detected List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 92378e0405a8caf77372cd1028970b1f7c7cf364 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 06:06:29 +0000 Message-Id: <69e07c65.3c2ea.d0a245b@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=92378e0405a8caf77372cd1028970b1f7c7cf364 commit 92378e0405a8caf77372cd1028970b1f7c7cf364 Author: Po Han Chen AuthorDate: 2026-03-23 05:00:29 +0000 Commit: Warner Losh CommitDate: 2026-04-16 06:05:21 +0000 periodic/daily: show verbose zpool status when errors are detected When zpool status -x reports errors, the output only shows basic error counts without identifying which files are affected. Replace the unconditional echo of the brief status with verbose output (zpool status -v) in the error path so administrators can see exactly which files have been damaged. The healthy/no-pools path still shows the brief status. PR: 223243 Signed-off-by: Po Han Chen Reviewed by: imp, jlduran, asomers Pull Request: https://github.com/freebsd/freebsd-src/pull/2089 --- usr.sbin/periodic/etc/daily/404.status-zfs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.sbin/periodic/etc/daily/404.status-zfs b/usr.sbin/periodic/etc/daily/404.status-zfs index 052f794c0bbc..64b67a2dc008 100755 --- a/usr.sbin/periodic/etc/daily/404.status-zfs +++ b/usr.sbin/periodic/etc/daily/404.status-zfs @@ -25,13 +25,15 @@ case "$daily_status_zfs_enable" in ;; esac sout=`zpool status -x` - echo "$sout" # zpool status -x always exits with 0, so we have to interpret its # output to see what's going on. if [ "$sout" = "all pools are healthy" \ -o "$sout" = "no pools available" ]; then + echo "$sout" rc=0 else + # Show verbose status so we can see which files are affected + zpool status -v rc=1 fi ;; From nobody Thu Apr 16 06:06:28 2026 X-Original-To: dev-commits-src-main@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 4fx6w54Xg1z6Z01G for ; Thu, 16 Apr 2026 06:06:29 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fx6w458rkz3jZw for ; Thu, 16 Apr 2026 06:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5BT+mKleLFWXE9Fiz5jrDVvCYrY/PcL7om4S4RPzSV8=; b=W/nnWx1BkwjP15fAU+eFjZ829POnRTpqLONGKmtb6NdChYksanaytF71qgJnXCVpUsX6YL Hri4H5CKc2jeaULozygb+dkKnZIMPNQ8VkTsw0sHgflXf5rxy4yNGyhzlNu5hA+DFCez39 U3q2LcvZt2vl/KWdSI6k5Zg6CQ+YySyV3mrYCnPm58o53VadU9/cY/ByqdKEmjY3fg4QWK V/gPoHUFgxaRBmV5QtV5YISlnrA2+AnSWg3XIGC/GION63YLJ2L3Ef6c0DJ+PvTibNJ+LK AcxzDTt+YHcQe4etorLNk54VtD/TETwoOvA+5UlU/v5mj5RqlPgtfY1uI8XSGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776319588; a=rsa-sha256; cv=none; b=dDRvnFTo8TJB+j2zn/BtAYvEudjQ36voRJZAgXnxNfE8pffSIrfxq//Hy8hBhFIiFUQbMo eIXoX5LFSvBGGdv49pvfexBzElripH20OP3XM++sZy8dw1ao8lrZDVjINYJ1yYagHP3MKA LQlWwX5dS9Dxsy3NME78EvZnhqQmyPDjUk1O4Rc9wSU/CRluXBccd1HvfwII5qqXPsVW6I Wea0o82Y3bZwDLLDmVYy0kktDwjBS1D+697cNuLwT8nKeUIj0zU7c+uQQ/q/uRa+nl+WUY Ixisf+pBDJ9x1+wa1Xwsrcwu8eMyK/Xobqj5FQ43OALqrBhPIQ1JXQScyjhYhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5BT+mKleLFWXE9Fiz5jrDVvCYrY/PcL7om4S4RPzSV8=; b=xhW2ltt5m8R8QpffQM6wU9WJWu+pB9iEHPkNQrmZwsVAUWWbNSEijfZkd23Oax6Gm9piOb DGgDGfiyj97K/W1vd29v88QjJtgYTTlXnKuZNjOcmdL2TND/kmsyd6OiAzfRFe8c2vuydw c8r13sgA0d0rZPXM4NvU+h0IgEs9LuLxOQRKjr7u2j3p4NlA/kKt6MR6+ghj1HQ4pkXDdy kn3UTJpglQg7BZ4mQh+g0T2BzH7U/J9YLARYUn//S3xOZgkq/ZLexBfh1K0hXJeioRKrjX ekAJK2bhB/MOx14+pi+ZYZB2Y5P2rvhqch2JkYXg32v9uJWnEKotuxO6ZPvylA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fx6w44Tmvzvgf for ; Thu, 16 Apr 2026 06:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b0f5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 06:06:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Kit Dallege From: Warner Losh Subject: git: e0b22342f52b - main - newsyslog.conf(5): use "rotated" instead of "trimmed" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e0b22342f52b22b1762b09ab16bbc520cf0f2882 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 06:06:28 +0000 Message-Id: <69e07c64.3b0f5.28715640@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e0b22342f52b22b1762b09ab16bbc520cf0f2882 commit e0b22342f52b22b1762b09ab16bbc520cf0f2882 Author: Kit Dallege AuthorDate: 2026-03-27 04:25:35 +0000 Commit: Warner Losh CommitDate: 2026-04-16 06:05:20 +0000 newsyslog.conf(5): use "rotated" instead of "trimmed" The man page used "trimmed" to describe log rotation, which is misleading as it suggests the file is truncated to a specific size rather than being rotated (renamed and a new file created). Replace all instances of "trimmed" with "rotated" to match the actual behavior and the terminology used elsewhere in the page. PR: 278671 Signed-off-by: Kit Dallege Reviewed by: imp,ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/2099 --- usr.sbin/newsyslog/newsyslog.conf.5 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.sbin/newsyslog/newsyslog.conf.5 b/usr.sbin/newsyslog/newsyslog.conf.5 index 1683a1018f9e..b26df4bb1a61 100644 --- a/usr.sbin/newsyslog/newsyslog.conf.5 +++ b/usr.sbin/newsyslog/newsyslog.conf.5 @@ -18,7 +18,7 @@ .\" the suitability of this software for any purpose. It is .\" provided "as is" without express or implied warranty. .\" -.Dd March 8, 2026 +.Dd April 15, 2026 .Dt NEWSYSLOG.CONF 5 .Os .Sh NAME @@ -155,10 +155,10 @@ When the size of the log file reaches .Ar size , in kilobytes by default, or with suffixes like k, M, G, ... as supported by .Xr expand_number 3 , -the log file will be trimmed as described above. +the log file will be rotated. If this field contains an asterisk .Pq Ql * , -the log file will not be trimmed based on size. +the log file will not be rotated based on size. .It Ar when The .Ar when @@ -183,10 +183,10 @@ Additionally, the format may also be constructed with a sign along with a rotation time specification of once a day, once a week, or once a month. .Pp -Time based trimming happens only if +Time based rotation happens only if .Xr newsyslog 8 is run within one hour of the specified time. -If an interval is specified, the log file will be trimmed if that many +If an interval is specified, the log file will be rotated if that many hours have passed since the last rotation. When both a time and an interval are specified then both conditions must be satisfied for the rotation to From nobody Thu Apr 16 06:06:30 2026 X-Original-To: dev-commits-src-main@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 4fx6w76hbbz6Z01H for ; Thu, 16 Apr 2026 06:06:31 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fx6w66k16z3jk5 for ; Thu, 16 Apr 2026 06:06:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UnU8JH6uhoA2H6R+achFMJHtXAgY5s1eLF7BqnftBC8=; b=CqLDlk9ZhnjcclRZZTGDgrmC53xmpedKKivhc8TOgC4e7FmBGlKKn0FZljVNnmQig7VGu+ 6wHMFzB0NRH3XV9w4P5KWhIXVD/r9kSnxox3mZauL7bYicFfzFJosayNi2VoUnlV3QkMN+ mIkyzSgQZI7f+V3jvSE7Z4n+RqyP2nRndV+zNo5l+8YSwtfFWfqre6m1EyCVsEOrWV7W2A bVJebEgoVJhJkomKQK/TdAKhYX+DmyeC8TBcd2bDaL1aqYVEEOcJ5YWWOtsTlBHSv5Ufvc fRHFxFeSb+aBUrjzjwysVkaWzCKgVyIRC5truW+DU+W7cR87gBRywHUpwcKrwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776319590; a=rsa-sha256; cv=none; b=hNpjeZNQzRM5t9Ok+kUsloslG6kF3YhmIo+rZLyMzTEXqn4K4jzwdG9DhEdTKCoySeieKX OaQ2ApMDB4wZiwqqryT456HiGnQ6fn3n0/BNdcovvuDZGobL6fTX3bu8Q/TTFxvRwiHkzX 4LFGSkHsTOS7p4NTWfgKPSRjVCfE1pSUGwbonvlUTF3x7ENeBOmemvRKFEU1roVJbazjoc yniUbsk4NBxaLOde/tGhl1xYhCYp+vGpAEkggHotAjCPQGWEWsNwxdKadwXdAdUpyb2AvI SYlgSu/XveeeQrCx1gjWwaW2h8puG2Q+e/+bWNkk9ppTl0Xpbe0yFOK1WcWONQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319590; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UnU8JH6uhoA2H6R+achFMJHtXAgY5s1eLF7BqnftBC8=; b=sSMlTaKlRI815bR1H0IKJs8/tOKkTz7Hxf60epy2UZjTfXePDJHHtZFjntHc+jz49FZWH/ z0XLCc+52NkhEIdos3RE/ngKJkZYDh0ahH2Y0iRa/v+ENhl1nmOi0zzclb7oiSpqtkxjGt 13JoRJpqSkAeBorYZx2Z48OuD6WJmMSwhPzwhslNaZqARdkF/Cymh+YSqU/JVQdCtOCfRH Ns3SEJpAu3CCEOJDimLQXnWKV2bLAiwq1ZJvLncZBhFEBmspbMK8fK9awznUSrnXnIzkl0 V1iYN458+4fTWH/1Yyvxqz4/Cq0gzsbJ7NF0MYgjgFbLWKOXWd9ELMq2BknOpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fx6w65x88zvPN for ; Thu, 16 Apr 2026 06:06:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d3b8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 06:06:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Martin Filla From: Warner Losh Subject: git: aa462efde6dc - main - rockchip: support CM3588 board List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa462efde6dc009eed0e09272b5359950193b0be Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 06:06:30 +0000 Message-Id: <69e07c66.3d3b8.761a6a13@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=aa462efde6dc009eed0e09272b5359950193b0be commit aa462efde6dc009eed0e09272b5359950193b0be Author: Martin Filla AuthorDate: 2026-03-16 14:35:06 +0000 Commit: Warner Losh CommitDate: 2026-04-16 06:05:21 +0000 rockchip: support CM3588 board Signed-off-by: Martin Filla Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/2086 --- sys/modules/dtb/rockchip/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/modules/dtb/rockchip/Makefile b/sys/modules/dtb/rockchip/Makefile index fb29f4f0970a..407d054a144d 100644 --- a/sys/modules/dtb/rockchip/Makefile +++ b/sys/modules/dtb/rockchip/Makefile @@ -25,7 +25,8 @@ DTS= \ rockchip/rk3568-bpi-r2-pro.dts \ rockchip/rk3588-rock-5-itx.dts \ rockchip/rk3588-rock-5b.dts \ - rockchip/rk3588-orangepi-5-plus + rockchip/rk3588-orangepi-5-plus.dts \ + rockchip/rk3588-friendlyelec-cm3588-nas.dts DTSO= rk3328-analog-sound.dtso \ rk3328-i2c0.dtso \ From nobody Thu Apr 16 06:06:31 2026 X-Original-To: dev-commits-src-main@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 4fx6w83zmRz6Z0T2 for ; Thu, 16 Apr 2026 06:06: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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fx6w807bqz3htx for ; Thu, 16 Apr 2026 06:06:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qOhKr4eUTi2V8GrxMTWb8JHFb4OzwbG2O6P/oYiyssc=; b=H8DpU/+/vuH3gtgELFoPpPClCsb9Bdei06xqgVG5DRRL9/3OK+RWR+MkHjbGxSv8w1sg6O P/1PUSAA/JmK8dPrOxFPy+YspEBKTtvJELLs0daQ4BmkD6SZCaV9q0iSnZJKFK9NlLGchn LWSx9w9/HgyIuWl+9jsZV8JCGO/+/tTJgEob507l6RwRriaKnTaxIDjlmgy4Vof6tVsZok CDTPYa/aWlRVEozRHBo8Cz1lm4xuzrUaUcmIydY89nigMFg0sfA3zN0E+AUqlvsV2EdjPJ +Jo5QoHb73PtYeKKRkXwXsNCLduSvprVFE5bg4m24R0r++Mx+mY65sKtjrDg0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776319592; a=rsa-sha256; cv=none; b=fpu9gPRUs2RWqwalFuPzLZdgl3Begta2dO19s79wqG2sugTHroX5I/TZfrFtNFeDNSO3JO YoGTEywaFiR1BXmKoHJLHpDt2rTWwKM7FP+LiJEsLy0Ny3J/OK8dA2zT3D8WITdK1MRH1m 3hpBAvybEGY6PjmAqichTEFKDa6xgJpcj/cX0RpHlSatrk8uayd0VH4r0zupIZtRHRVJJ+ Z1x29oE3dg97hFV+p55jJ0mlIa8NdESH8nmSmBSprs20E3pTJL41ZiOBF/kk9E9G6hjgR0 i4kptGHBkqieeNCB1Q8wwcIz5o7WVSIV+zKznQoTOxbv2JmCAmhdvGN2smVYVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319592; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qOhKr4eUTi2V8GrxMTWb8JHFb4OzwbG2O6P/oYiyssc=; b=siNmx/RbMdUJhF38FVt6lOLxi/758BK1xz8njYzMK6mX9ZaZNuxdOMWAp4G2gCKkw5uMgg L6KIFfNDMIoxCJKWNjsucbu7DALtiVhPpPiN+falUp99P2Uju1Sp8ZcGgJQU6jEbWzMjyO oEM7HmzPGDAGCf7hC/MrjhUXxOFqs8MXGKwIhFcFyn9MzeMHs0LKh7TtAClWooNMURFXMB +XuKSVyXT0PeVKR6yeycTCMPZMLc6ZlrYJfb42w3lpwwzzaT931zF2LDYAJdFUXM2UqhSk slGPyXHdNf2YrqFh7BNz/TlmrtEDtbtQ41sdvJXjvlYng5VPMcmClMhKtN/E5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fx6w76kxgzvyQ for ; Thu, 16 Apr 2026 06:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d0b3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 06:06:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Andre Silva From: Warner Losh Subject: git: fbbf71f5813b - main - libpmc: surface raw TSC in pmclog events List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fbbf71f5813b041526c4d439d9961e8a8281d291 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 06:06:31 +0000 Message-Id: <69e07c67.3d0b3.4ce909c1@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fbbf71f5813b041526c4d439d9961e8a8281d291 commit fbbf71f5813b041526c4d439d9961e8a8281d291 Author: Andre Silva AuthorDate: 2026-03-31 20:28:04 +0000 Commit: Warner Losh CommitDate: 2026-04-16 06:05:21 +0000 libpmc: surface raw TSC in pmclog events The pmclog record header carries the raw TSC for each event. Export it in struct pmclog_ev, fix JSON output to emit it unsigned, and preserve the installed header ABI by overlaying pl_tsc with the legacy pl_ts storage. Update pmclog(3) to document the TSC semantics and the legacy alias. Sponsored by: AMD Signed-off-by: Andre Silva Reviewed by: imp, mhorne, Ali Mashtizadeh Pull Request: https://github.com/freebsd/freebsd-src/pull/2085 --- lib/libpmc/libpmc_json.cc | 5 ++--- lib/libpmc/pmclog.3 | 29 +++++++++++++++++++++++++++-- lib/libpmc/pmclog.c | 4 ++-- lib/libpmc/pmclog.h | 6 ++++-- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/lib/libpmc/libpmc_json.cc b/lib/libpmc/libpmc_json.cc index 90881f22971e..1ac0b3a50a6c 100644 --- a/lib/libpmc/libpmc_json.cc +++ b/lib/libpmc/libpmc_json.cc @@ -74,8 +74,8 @@ startentry(struct pmclog_ev *ev) { char eventbuf[128]; - snprintf(eventbuf, sizeof(eventbuf), "%s, \"tsc\": \"%jd\"", - typenames[ev->pl_type], (uintmax_t)ev->pl_ts.tv_sec); + snprintf(eventbuf, sizeof(eventbuf), "%s, \"tsc\": \"%ju\"", + typenames[ev->pl_type], (uintmax_t)ev->pl_tsc); return (string(eventbuf)); } @@ -393,4 +393,3 @@ event_to_json(struct pmclog_ev *ev){ errx(EX_USAGE, "ERROR: unrecognized event type: %d\n", ev->pl_type); } } - diff --git a/lib/libpmc/pmclog.3 b/lib/libpmc/pmclog.3 index 4af4150d60a9..452a14f42f55 100644 --- a/lib/libpmc/pmclog.3 +++ b/lib/libpmc/pmclog.3 @@ -77,7 +77,10 @@ struct pmclog_ev { enum pmclog_state pl_state; /* parser state after 'get_event()' */ off_t pl_offset; /* byte offset in stream */ size_t pl_count; /* count of records so far */ - struct timespec pl_ts; /* log entry timestamp */ + union { + uint64_t pl_tsc; /* TSC timestamp */ + struct timespec pl_ts; /* log entry timestamp (legacy) */ + }; enum pmclog_type pl_type; /* log entry kind */ union { /* log entry data */ struct pmclog_ev_callchain pl_cc; @@ -136,8 +139,30 @@ Field .Va pl_count contains the serial number of this event. Field +.Va pl_tsc +carries the raw CPU Time Stamp Counter (TSC) value recorded at the time +of the event. +This is not a wall-clock time; to convert to nanoseconds divide the TSC +delta between two events by the TSC frequency +.Pq Va pl_u.pl_i.pl_tsc_freq +reported in the +.Dv PMCLOG_TYPE_INITIALIZE +record. +The legacy .Va pl_ts -contains a timestamp with the system time when the event occurred. +member aliases the same storage for ABI compatibility, but its contents +no longer represent a wall-clock timestamp. +.Pp +Note that TSC-based timestamps and +.Va pl_u.pl_i.pl_tsc_freq +are only meaningful on x86 architectures +.Pq amd64 and i386 . +On all other architectures +.Pq including arm64 and powerpc , +.Va pl_tsc +and +.Va pl_u.pl_i.pl_tsc_freq +are set to zero. Field .Va pl_type denotes the kind of the event returned in argument diff --git a/lib/libpmc/pmclog.c b/lib/libpmc/pmclog.c index 22ff50b10ee0..c3587af46c7b 100644 --- a/lib/libpmc/pmclog.c +++ b/lib/libpmc/pmclog.c @@ -287,8 +287,8 @@ pmclog_get_event(void *cookie, char **data, ssize_t *len, return -1; } - /* copy out the time stamp */ - ev->pl_ts.tv_sec = ph->pl_tsc; + /* copy out the TSC from the event header */ + ev->pl_tsc = ph->pl_tsc; le += sizeof(*ph)/4; evlen = PMCLOG_HEADER_TO_LENGTH(h); diff --git a/lib/libpmc/pmclog.h b/lib/libpmc/pmclog.h index 72e73e3928d2..a79d33529890 100644 --- a/lib/libpmc/pmclog.h +++ b/lib/libpmc/pmclog.h @@ -169,7 +169,10 @@ struct pmclog_ev { enum pmclog_state pl_state; /* state after 'get_event()' */ off_t pl_offset; /* byte offset in stream */ size_t pl_count; /* count of records so far */ - struct timespec pl_ts; /* log entry timestamp */ + union { + uint64_t pl_tsc; /* TSC timestamp */ + struct timespec pl_ts; /* log entry timestamp (legacy) */ + }; enum pmclog_type pl_type; /* type of log entry */ void *pl_data; int pl_len; @@ -229,4 +232,3 @@ void pmclog_close(void *_cookie); __END_DECLS #endif - From nobody Thu Apr 16 06:06:33 2026 X-Original-To: dev-commits-src-main@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 4fx6w95BG5z6Z0Z3 for ; Thu, 16 Apr 2026 06:06:33 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fx6w91xYnz3jcV for ; Thu, 16 Apr 2026 06:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cqFKkFi6HLyrgY8xEkRPycX/bZCpNPGWmu/LmOhszhU=; b=pQq7LukKHyIidHLqpyJIgkgYqFg0bkdggiAlT1qwUSbXfTtwZhMNsDBZ+msa+g1BpdlkL4 tg3J3+XGBuKb32rLg5E6ZPlKxvvYHiGa7KpvHBkwlML8pJVnFPs4tr21iVEPlXUmfkio1T nHGpgGx2FMCFpY6YKrNREwsdtjG+vcWzLwTde6OJBYinNB9DC7b4P464x8AAhWWUO+aaw3 95tSEuke2VoOlQYWLO+WosyRuTLBK90rWQZOmRVh3uqivBVMJ5Klbs3ntkIYPjZ1d68GbW 08eQ1ZaRgjQNTResTFx2INKF7T/E+Vl0IoHGdZsvFB9GZF68xaUxBX+YcHo50g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776319593; a=rsa-sha256; cv=none; b=cFKGsbmwSjoWW844FUy4XSm+zCT+0TC2JO0wUMa5tD1zF1C7vnIniOzdNllwRVV9XQ0hej dTs74a1UU4/ONyTdyx8Tmsa26iuoSnCu+0VkwLP/wtT1UEwk+G+is8qthgUmdyUfexnh5x lK/IsG07WbMgkQbYIGR1E0J9H5NExlZj53Lqj3BFbTQ9MpBWfsWg+/VFZSKSb5FzQXqRE2 6Ydt/qZMSr4KPhZSIXbl7nA5WxPhrKkgLkboj2/te8kcxNijmGk4UjX15JTeHN11lneggo PqtUZKrJNwf+hwIpjdmB2qdBN1Hf0gxoCLeysXk4wjBwLLi1b+8NmEmqcp+nlg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319593; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cqFKkFi6HLyrgY8xEkRPycX/bZCpNPGWmu/LmOhszhU=; b=aHkns0meOE4R+Uv5gX+eTopeDcYnF10brfnM/IbO/QWi8WuKT/y/5TkuLIfF+U4NhPzYTD ngqpPnVWXXW0XZTOzX8rUcInXV/k951kI97EA4xs6gIIicDS8xFi/syabJ9/kZ+r0cEStG A8M4MHN1DqOuctIWsIBKYN9UW4lvDGlTg5jOg9612vRxD/Z/9mJOaI3rXjHXWQ4EkZLkJL Ob1mXVzvxurLMxK6UZa/W7rQukhKMRbsCWym5RHp5EuDVIyxMR+q1lfDdXOo7Aeh2MLQvf 0YeILEKT9EH1LP2jYWbDkGOVi9kPfbZOAE0i23fE/Gzw1RTd1iNLQsYjYA8hDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fx6w90QDdzvyR for ; Thu, 16 Apr 2026 06:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3cc0a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 06:06:33 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Andre Silva From: Warner Losh Subject: git: ee12645ec737 - main - pmcstat: print raw TSC in decoded log output List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee12645ec737eb940554769af2c275524ea20d37 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 06:06:33 +0000 Message-Id: <69e07c69.3cc0a.32f78fbf@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ee12645ec737eb940554769af2c275524ea20d37 commit ee12645ec737eb940554769af2c275524ea20d37 Author: Andre Silva AuthorDate: 2026-03-31 20:28:39 +0000 Commit: Warner Losh CommitDate: 2026-04-16 06:05:21 +0000 pmcstat: print raw TSC in decoded log output Extend pmcstat -R output to include the raw TSC for each decoded record and print tsc_freq from the initialize record so TSC deltas can be converted to elapsed time. Update the pmcstat documentation to describe the decoded output and the architecture-specific TSC behavior. Sponsored by: AMD Signed-off-by: Andre Silva Reviewed by: imp, mhorne, Ali Mashtizadeh Pull Request: https://github.com/freebsd/freebsd-src/pull/2085 --- usr.sbin/pmcstat/pmcstat.8 | 26 +++++++++++++++++++++++++- usr.sbin/pmcstat/pmcstat.h | 5 +++-- usr.sbin/pmcstat/pmcstat_log.c | 8 ++++++-- 3 files changed, 34 insertions(+), 5 deletions(-) diff --git a/usr.sbin/pmcstat/pmcstat.8 b/usr.sbin/pmcstat/pmcstat.8 index edb9ff106092..c78a13f910f9 100644 --- a/usr.sbin/pmcstat/pmcstat.8 +++ b/usr.sbin/pmcstat/pmcstat.8 @@ -23,7 +23,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.Dd April 19, 2025 +.Dd April 15, 2026 .Dt PMCSTAT 8 .Os .Sh NAME @@ -220,6 +220,30 @@ specified in .It Fl R Ar logfilename Perform offline analysis using sampling data in file .Ar logfilename . +Each decoded record is printed as a single line with the following fields: +a record type (e.g., +.Dq callchain , +.Dq initlog ) , +type-specific data, and a trailing 20-digit raw TSC value recording the +CPU cycle at which the event occurred. +The +.Dq initlog +record additionally prints +.Dq Li tsc_freq= , +the TSC tick rate in Hz measured by the kernel at boot. +To convert a TSC delta to nanoseconds: +.Pp +.Dl elapsed_ns = (tsc_end - tsc_start) * 1e9 / tsc_freq +.Pp +TSC-based timestamps and +.Dq Li tsc_freq +are only meaningful on x86 architectures +.Pq amd64 and i386 . +On all other architectures +.Pq including arm64 and powerpc +the +.Dq Li tsc_freq +field will be zero. .It Fl S Ar event-spec Allocate a system mode sampling PMC measuring hardware events specified in diff --git a/usr.sbin/pmcstat/pmcstat.h b/usr.sbin/pmcstat/pmcstat.h index 67571ce4b2ee..6131d7a50404 100644 --- a/usr.sbin/pmcstat/pmcstat.h +++ b/usr.sbin/pmcstat/pmcstat.h @@ -50,8 +50,9 @@ #define PMCSTAT_PRINT_ENTRY(T,...) do { \ (void) fprintf(args.pa_printfile, "%-9s", T); \ - (void) fprintf(args.pa_printfile, " " __VA_ARGS__); \ - (void) fprintf(args.pa_printfile, "\n"); \ + (void) fprintf(args.pa_printfile, " " __VA_ARGS__); \ + (void) fprintf(args.pa_printfile, " %20ju\n", \ + (uintmax_t)_pmcstat_current_tsc); \ } while (0) #define PMCSTAT_PL_NONE 0 diff --git a/usr.sbin/pmcstat/pmcstat_log.c b/usr.sbin/pmcstat/pmcstat_log.c index db9cbfabd9da..9af2ccc4e365 100644 --- a/usr.sbin/pmcstat/pmcstat_log.c +++ b/usr.sbin/pmcstat/pmcstat_log.c @@ -194,6 +194,7 @@ static struct pmc_plugins plugins[] = { }; static int pmcstat_mergepmc; +static uint64_t _pmcstat_current_tsc; /* TSC for PMCSTAT_PRINT_ENTRY */ int pmcstat_pmcinfilter = 0; /* PMC filter for top mode. */ float pmcstat_threshold = 0.5; /* Cost filter for top mode. */ @@ -471,6 +472,7 @@ pmcstat_print_log(void) while (pmclog_read(args.pa_logparser, &ev) == 0) { assert(ev.pl_state == PMCLOG_OK); + _pmcstat_current_tsc = ev.pl_tsc; switch (ev.pl_type) { case PMCLOG_TYPE_CALLCHAIN: PMCSTAT_PRINT_ENTRY("callchain", @@ -496,9 +498,11 @@ pmcstat_print_log(void) PMCSTAT_PRINT_ENTRY("drop",); break; case PMCLOG_TYPE_INITIALIZE: - PMCSTAT_PRINT_ENTRY("initlog","0x%x \"%s\"", + PMCSTAT_PRINT_ENTRY("initlog", + "0x%x \"%s\" tsc_freq=%" PRIu64, ev.pl_u.pl_i.pl_version, - pmc_name_of_cputype(ev.pl_u.pl_i.pl_arch)); + pmc_name_of_cputype(ev.pl_u.pl_i.pl_arch), + ev.pl_u.pl_i.pl_tsc_freq); if ((ev.pl_u.pl_i.pl_version & 0xFF000000) != PMC_VERSION_MAJOR << 24) warnx( From nobody Thu Apr 16 06:06:34 2026 X-Original-To: dev-commits-src-main@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 4fx6wB66Wvz6Z0dk for ; Thu, 16 Apr 2026 06:06:34 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fx6wB1yv0z3jhW for ; Thu, 16 Apr 2026 06:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ISwrOycC9pIvbHMco7jIp2MtYfdP9hl1B6b1FjxfWis=; b=Q+v+g84XFBC/NO+SAsNp3bXWPsawzBNhfA8B5Lzaj83Fnuws/f2o4A9yil8sDLqfFlBxHU 1cEdYgVs+4vMHseNJAjP9SJI2gzXYL9bjqImE11DivVXlTMdQppo58i88+6AWsxk7XYlIV xFmEbv1JzceY5h6JOSLmcA4yZ4myoAcIb291i3jZoou+hKxLQpbE4wcoz9ZdzehWfN5FI0 LbtLkrvPLrinNBzh6f+KEteDaHUcf1x/UEYHb6KqZJtNPFFyW96NFKGykK9SqGFEwpsDnk hfvCNEnf98gH8xiGdQgLn/zRueExGCLF8FUnBoqq7XmKiVJdY7m4mAoQ6S+D9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776319594; a=rsa-sha256; cv=none; b=WpggWqoFXYZKMl6e5Ho67dQ2mjAADEFeekGxSc/KRHCUYr+atiYiL93EJccmJsqd8N6UtY y0Go79IKRAzakyN1UuPEZavgwmQTmbpLBoXK1SSyhexpNMIwGrNc9p6JvxFDMJ0lV/NYrb 88e9x6tCTJmAFRQCy3KZ76f+BTEL0Kg7N7PlyAZykhe4RAu4nYhhAP6BaFtb5v7y/phs6N URxOqA3SVo3Dtt/LOFRSuq7ZPeT/fAOVgofNZYWDcEAiA4IeG5F3yILaJ3nP2BBH4l+vGi pN8Zql2W9fdwqyMH9aiDK0IAyHl2TKzEWQ/ew2khGmRPmGm30quTdGKtCGGmdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ISwrOycC9pIvbHMco7jIp2MtYfdP9hl1B6b1FjxfWis=; b=k3Umz6GLsfq2ahhnN6OJpj46YVeWedkxrBYdUat+I8njifealJeU+div0Ax8fRrCx3pRhX INZYghi0SNNvudVCu6z6pbcKE9YRR46C+Qe2JsuzGnbzvI/O6U/qu0dyiCrW1k6S4TD8tw JLcQB6qWdl+eSiNcXXzAo3w95DV0e02auZHhOkd+GqAl6zDBl9eZbPyS/zqBvy2XMqdKjt SnNozqSiwxPLLFCEQwTC4U9tUGL0ViabF7Wx8HyFn5XBv0rbEgdRtrkCUKjkEJcMafNYn/ IZnMzNiy3PYx3/Ajs23u8py6NsWSnTOaczjmPs51v9ZVBuHT2VYBM4wNm/myyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fx6wB1DQbzvCw for ; Thu, 16 Apr 2026 06:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d8c9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 06:06:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Aaditya Singh From: Warner Losh Subject: git: 50c1240ebfaf - main - mkimg: Fix parsing of filenames containing colons List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50c1240ebfaf920ad12f05eb16d00f8b5b9d72e0 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 06:06:34 +0000 Message-Id: <69e07c6a.3d8c9.1f3f9d13@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=50c1240ebfaf920ad12f05eb16d00f8b5b9d72e0 commit 50c1240ebfaf920ad12f05eb16d00f8b5b9d72e0 Author: Aaditya Singh AuthorDate: 2026-02-21 18:13:54 +0000 Commit: Warner Losh CommitDate: 2026-04-16 06:05:21 +0000 mkimg: Fix parsing of filenames containing colons When using PART_KIND_FILE (-p type:=filename), mkimg uses a colon to separate an optional offset (e.g., filename:offset). strsep() was being used to split the string at the first colon. This caused failures when the filename itself contained a colon (e.g., "th:is"). This patch uses stat() to check if the entire string exists as a file. If so, use it directly without splitting. If the full string is not a valid file, fall back to splitting at the right-most colon using strrchr(). Uses errc() to fail and exit immediately when an existing directory is input instead of a file in PART_KIND_FILE mode. PR: 257960 Signed-off-by: Aaditya Singh Reviewed by: jlduran Pull Request: https://github.com/freebsd/freebsd-src/pull/2041 --- usr.bin/mkimg/mkimg.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/usr.bin/mkimg/mkimg.c b/usr.bin/mkimg/mkimg.c index c625b49dc29a..4a288d66be81 100644 --- a/usr.bin/mkimg/mkimg.c +++ b/usr.bin/mkimg/mkimg.c @@ -446,6 +446,8 @@ mkimg(void) { FILE *fp; struct part *part; + struct stat sb; + char *p; lba_t block, blkoffset; uint64_t bytesize, byteoffset; char *size, *offset; @@ -468,12 +470,28 @@ mkimg(void) /* Look for an offset. Set size too if we can. */ switch (part->kind) { case PART_KIND_SIZE: - case PART_KIND_FILE: offset = part->contents; size = strsep(&offset, ":"); - if (part->kind == PART_KIND_SIZE && - expand_number(size, &bytesize) == -1) + if (expand_number(size, &bytesize) == -1) error = errno; + break; + case PART_KIND_FILE: + size = part->contents; + if (stat(part->contents, &sb) == 0) { + if (S_ISDIR(sb.st_mode)) { + errc(EX_IOERR, EISDIR, "partition %d", + part->index + 1); + } + offset = NULL; + } else { + p = strrchr(part->contents, ':'); + if (p != NULL) { + *p = '\0'; + offset = p + 1; + } else { + offset = NULL; + } + } if (offset != NULL) { if (*offset != '+') abs_offset = true; From nobody Thu Apr 16 06:06:36 2026 X-Original-To: dev-commits-src-main@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 4fx6wD6hG2z6Z0dn for ; Thu, 16 Apr 2026 06:06:36 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fx6wD3wvtz3jlN for ; Thu, 16 Apr 2026 06:06:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ezDz5NlZKfSN2gJiZVWZS6phOcVss9Wffy3Zv0alfVk=; b=P9QLwCEybGC7JCzwSk20GcoVkvo9+K0GLDqOFA8aDVROwmfN9o3wdaMD4KT4MtcH8oj/L+ eXlurrZ/hnP94uNe5oZCx+EgRF5fUz4Gt5Ri2zLaKrlM+Mv5xJ30lqiTu+Jhv77At9vPXV oUk3B9FlVkwJkukiU74gwaiLOLerNT7zYS6d0XwXWClMw4VK7gqY6M2KvCLDjemxcPkp90 V/WLHsN6KV7J3jyoeTCRvWooQdk7kxqKwcN4JJJkamRBI1qSr0o6YtB5aBXs1XSEl/diYT PnK8m3QcaSD+qMvg05BJ+ATQs7feLMvepVF+JPFQr+WzgY3MZndrJc9WHsFWKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776319596; a=rsa-sha256; cv=none; b=EMj9Z8HPx/slkDDXePtAfK9vSQwmBFexjF6s9nDqHqQQh4WN6u1R74vEaPRBKn3YC0OHhr x1AxWHeTALsBeHxHP9OCTsrvnO95C7hScGmrTurM9XqytxrfEPBWkPd/il7EuedXXatGWW 3w0NiZQXVwCxwK1LZGwgzBvl4PDG9jEMZgTC6toI7zUpweTfe0rWyB0tjf6LlMKUDhIKCe lDbF4aYrsGP9+KuuXrVRcWX8A0eqbg8kSQoEtdlEv8cf85wuJyZobpZuGGF8i5eVdY9Pdb e761EQ2GO1xIZ6jalxnzsuqR4TejRIrxf2fFYlKk5RehNMAYu98F8KUuS0/cOg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319596; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ezDz5NlZKfSN2gJiZVWZS6phOcVss9Wffy3Zv0alfVk=; b=gLADv9FoNGTb5OewfCqR+LxP/4YmKRnnYu/fmctl5tOLDuGF0tlNvqCQyFGd3A6aQy9UqN Hpn7PqQW40lYPjV0Ibgm4eka+RKmhXWVbeT34Cz9JmXx6ATc1kyCsFMBWyQ3BENbRB138l gTi9uDs8uMZuIPB9m6Juad3CWcDkaVmxMiS9XCWye55lS3nxRzJTZkWaIXff9OSxJMnLlR K/Cnt/hThHBYjVjI9K5Wz4O461DPnr1eb35nerrHvWQiMO3K5wYusUTtzjBA/ENNE4zRLP TfTTH4+RVYcW07+l5TFNMQ3UZK/3i0W/0/HiIKb3d/ecdvBJHaaQEd9zwdKiww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fx6wD2YMQzvyS for ; Thu, 16 Apr 2026 06:06:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3cb59 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 06:06:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Ryan Moeller From: Warner Losh Subject: git: 20cd1b475a1e - main - lib/libifconfig: Fix pointer-sign warnings List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20cd1b475a1ef9dfca30726999aa1b9a02d5bc39 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 06:06:36 +0000 Message-Id: <69e07c6c.3cb59.126f7498@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=20cd1b475a1ef9dfca30726999aa1b9a02d5bc39 commit 20cd1b475a1ef9dfca30726999aa1b9a02d5bc39 Author: Ryan Moeller AuthorDate: 2025-09-18 15:04:35 +0000 Commit: Warner Losh CommitDate: 2026-04-16 06:05:22 +0000 lib/libifconfig: Fix pointer-sign warnings Fix all pointer-sign warnings generated when compiling libifconfig. One of these warnings comes from the misuse of snl_add_msg_attr_string for a byte array. Though userland treats carpr_key as a string, it is actually an array of bytes. Handle it as such in libifconfig. While here, fix a small consistency nit in ifconfig_sfp_get_sfp_dump. Signed-off-by: Ryan Moeller Reviewed by: imp, zlei Pull Request: https://github.com/freebsd/freebsd-src/pull/1850 --- lib/libifconfig/libifconfig_carp.c | 5 +++-- lib/libifconfig/libifconfig_sfp.c | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/libifconfig/libifconfig_carp.c b/lib/libifconfig/libifconfig_carp.c index 59faa8def496..8599470cd3f9 100644 --- a/lib/libifconfig/libifconfig_carp.c +++ b/lib/libifconfig/libifconfig_carp.c @@ -53,7 +53,7 @@ static struct snl_attr_parser ap_carp_get[] = { { .type = CARP_NL_STATE, .off = _OUT(carpr_state), .cb = snl_attr_get_uint32 }, { .type = CARP_NL_ADVBASE, .off = _OUT(carpr_advbase), .cb = snl_attr_get_int32 }, { .type = CARP_NL_ADVSKEW, .off = _OUT(carpr_advskew), .cb = snl_attr_get_int32 }, - { .type = CARP_NL_KEY, .off = _OUT(carpr_key), .cb = snl_attr_copy_string, .arg_u32 = CARP_KEY_LEN }, + { .type = CARP_NL_KEY, .off = _OUT(carpr_key), .cb = snl_attr_get_bytes, .arg_u32 = CARP_KEY_LEN }, { .type = CARP_NL_ADDR, .off = _OUT(carpr_addr), .cb = snl_attr_get_in_addr }, { .type = CARP_NL_ADDR6, .off = _OUT(carpr_addr6), .cb = snl_attr_get_in6_addr }, { .type = CARP_NL_VERSION, .off = _OUT(carpr_version), .cb = snl_attr_get_uint8 }, @@ -177,7 +177,8 @@ ifconfig_carp_set_info(ifconfig_handle_t *h, const char *name, &carpr->carpr_addr); snl_add_msg_attr(&nw, CARP_NL_ADDR6, sizeof(carpr->carpr_addr6), &carpr->carpr_addr6); - snl_add_msg_attr_string(&nw, CARP_NL_KEY, carpr->carpr_key); + snl_add_msg_attr(&nw, CARP_NL_KEY, sizeof(carpr->carpr_key), + carpr->carpr_key); snl_add_msg_attr_u8(&nw, CARP_NL_VERSION, carpr->carpr_version); snl_add_msg_attr_u8(&nw, CARP_NL_VRRP_PRIORITY, carpr->carpr_vrrp_prio); snl_add_msg_attr_u16(&nw, CARP_NL_VRRP_ADV_INTER, carpr->carpr_vrrp_adv_inter); diff --git a/lib/libifconfig/libifconfig_sfp.c b/lib/libifconfig/libifconfig_sfp.c index 8deccda5ff76..a2cddf89a13a 100644 --- a/lib/libifconfig/libifconfig_sfp.c +++ b/lib/libifconfig/libifconfig_sfp.c @@ -298,7 +298,7 @@ ifconfig_sfp_get_sfp_info(ifconfig_handle_t *h, const char *name, struct ifconfig_sfp_info *sfp) { struct i2c_info ii; - char buf[8]; + uint8_t buf[8]; memset(sfp, 0, sizeof(*sfp)); @@ -365,7 +365,7 @@ ifconfig_sfp_channel_count(const struct ifconfig_sfp_info *sfp) static void get_sff_string(struct i2c_info *ii, uint8_t addr, uint8_t off, char *dst) { - read_i2c(ii, addr, off, SFF_VENDOR_STRING_SIZE, dst); + read_i2c(ii, addr, off, SFF_VENDOR_STRING_SIZE, (uint8_t *)dst); dst += SFF_VENDOR_STRING_SIZE; do { *dst-- = '\0'; } while (*dst == 0x20); } @@ -373,7 +373,7 @@ get_sff_string(struct i2c_info *ii, uint8_t addr, uint8_t off, char *dst) static void get_sff_date(struct i2c_info *ii, uint8_t addr, uint8_t off, char *dst) { - char buf[SFF_VENDOR_DATE_SIZE]; + uint8_t buf[SFF_VENDOR_DATE_SIZE]; read_i2c(ii, addr, off, SFF_VENDOR_DATE_SIZE, buf); sprintf(dst, "20%c%c-%c%c-%c%c", buf[0], buf[1], buf[2], buf[3], @@ -532,7 +532,7 @@ get_sfp_status(struct i2c_info *ii, struct ifconfig_sfp_status *ss) uint8_t diag_type, flags; /* Read diagnostic monitoring type */ - read_i2c(ii, SFF_8472_BASE, SFF_8472_DIAG_TYPE, 1, (caddr_t)&diag_type); + read_i2c(ii, SFF_8472_BASE, SFF_8472_DIAG_TYPE, 1, &diag_type); if (ii->error != 0) return (-1); @@ -773,7 +773,7 @@ ifconfig_sfp_get_sfp_dump(ifconfig_handle_t *h, const char *name, struct i2c_info ii; uint8_t *buf = dump->data; - memset(dump->data, 0, sizeof(dump->data)); + memset(buf, 0, sizeof(dump->data)); if (i2c_info_init(&ii, h, name) != 0) return (-1); From nobody Thu Apr 16 06:06:35 2026 X-Original-To: dev-commits-src-main@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 4fx6wD1kdvz6Z0k8 for ; Thu, 16 Apr 2026 06:06:36 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fx6wC2TDRz3hx1 for ; Thu, 16 Apr 2026 06:06:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jW1knxMdhspAyvDPZer/VSItCAj96Zxp7aQs/5xbE2k=; b=oPZ9NaSPeNJITL+j+9sSVzz27RbSafwz5E1M6BFIg8E5+maMcowaZazfJWTx6gHgYSf2zK V3fIUFi8DbiEjKxb6JzKf9gGUbcgYKXqW7//WyY3JGrh7rkwVM3rDS4UziIPVziSP1kbsl cWD/1ZkCP7Iz4fZdf2OG6dAVBxw5w1FuVVJ+xRRuL/IVPfB1lEsNEwC3xWgcwcobbF0ylv Phx7ZffNSqmuJR2PcNfnAaJZPPyfdKZAos4B4x2SPQfT9tfrrzGARBsLLq93TuVAbcMRRW IYgXiHQvEP7tIPHGIzR9La5Y5P5AhcX6pkYRkGv1HsSevY8ECeosSRtUhpXFgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776319595; a=rsa-sha256; cv=none; b=GwImXeXTFkBY7heHU1zxwhiiv3/CPqnUOVLxUAOGhizj6S/L4mu0VxG6+mEncpr45TPwfe RiTPTVG+1L66R6g4o+Ze1VNh34bZBImgq2J6LG75nwaenP52Xut2LoHr5pZSkj/788tFXp cgu3k0uiBQniCujFqrQRnM1ke6/5ULwNfBfhryhm9SFjV9V0iSLoqmpyFr3yo9vhWQYxvk oTXbhuUuo3pyJn3zboKM9X7Zbru1gnYROCli7cYg3JxZoZO/3qOZtmrbhgM6JFVm43dW/a HzpvXsJgR0V+YoLPGiDMDmO4o2sse5lWcNKK5zTwi00PXOsiJuOYzgmitnrykw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776319595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jW1knxMdhspAyvDPZer/VSItCAj96Zxp7aQs/5xbE2k=; b=ena03EpQHuJ+FDjEYSz6hK+XuvntPDSLJD8dIe/3JMOE9H52CVc0SKbEhb91pVaqAzq9SH RkdKIEjEUtXvLUh7twz+HSipUtrC7OI3fqbCoRawX7D6sH/irxvGG2PWY7kZf0wPWoyQWl vExSwWrOhqJSd6SfydBLL+99zaKA5NlrqL27u9V6HTVrJZmFy4n+Fj3hTqsMFgmSx9iMRv NLCYn4WlQBldCPXmSNi8RTqgbMl3zp8n+n26DeYr0Dh56d2gatWfPARJ8inN4Rc7n32Ge8 OHYh/wy1VKZCsFx8/bXkmtyOSlx8rrghqI8gwm9l0LGRmsWSAiUs+MGRylyEow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fx6wC20xHzvCx for ; Thu, 16 Apr 2026 06:06:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d24b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 06:06:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Kristofer Peterson From: Warner Losh Subject: git: e75b324c93a1 - main - kern_descrip.c: Clarify allocation and freeing of fd map in fdgrowtable() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e75b324c93a14ab68d79d9247943ae10da184657 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 06:06:35 +0000 Message-Id: <69e07c6b.3d24b.11fc05c1@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e75b324c93a14ab68d79d9247943ae10da184657 commit e75b324c93a14ab68d79d9247943ae10da184657 Author: Kristofer Peterson AuthorDate: 2026-02-18 13:56:53 +0000 Commit: Warner Losh CommitDate: 2026-04-16 06:05:22 +0000 kern_descrip.c: Clarify allocation and freeing of fd map in fdgrowtable() When expanding a file table, the condition for allocating a new map is NDSLOTS(nnfiles) > NDSLOTS(onfiles) whereas for freeing the old map is NDSLOTS(onfiles) > NDSLOTS(NDFILE). If a previously expanded file table were to be expanded slightly again such that the map did not need to be increased, then fdgrowtable could still free the current map. This does not happen currently as nnfiles is rounded up to a multiple of NDENTRIES at the beginning of fdgrowtable() so that every enlargement after the first enlargement will always require a larger map. Though the logic is currently correct, it is unclear and should the earlier rounding up of nnfiles be relaxed or remove, the logic would be incorrect. This patch therefore adds comments and invariants checking the size of the table and map, and updates the map free condition so that it is absolutely clear that the old map will only be deallocated if a new map has been allocated. Signed-off-by: Kristofer Peterson Reviewed by: kib, kevans Pull Request: https://github.com/freebsd/freebsd-src/pull/2029 --- sys/kern/kern_descrip.c | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 2fa0621bdfca..69985c39c3c0 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2006,6 +2006,21 @@ fdgrowtable(struct filedesc *fdp, int nfd) NDSLOTTYPE *nmap, *omap; KASSERT(fdp->fd_nfiles > 0, ("zero-length file table")); + KASSERT(fdp->fd_nfiles >= NDFILE, ("file table of length %d shorter " + "than NDFILE (%d)", fdp->fd_nfiles, NDFILE)); + KASSERT(fdp->fd_nfiles == NDFILE || fdp->fd_nfiles % NDENTRIES == 0, + ("file table of length %d should be multiple of NDENTRIES (%lu)", + fdp->fd_nfiles, NDENTRIES)); + KASSERT((fdp->fd_nfiles == NDFILE) == ((intptr_t)fdp->fd_files - + offsetof(struct filedesc0, fd_dfiles) == (intptr_t)fdp - + offsetof(struct filedesc0, fd_fd)), ("file table of length %d " + "should have %s table", fdp->fd_nfiles, fdp->fd_nfiles == NDFILE ? + "initial" : "dynamic")); + KASSERT((NDSLOTS(fdp->fd_nfiles) <= NDSLOTS(NDFILE)) == ((intptr_t) + fdp->fd_map - offsetof(struct filedesc0, fd_dmap) == (intptr_t)fdp - + offsetof(struct filedesc0, fd_fd)), ("file table of length %d " + "should have %s map", fdp->fd_nfiles, NDSLOTS(fdp->fd_nfiles) <= + NDSLOTS(NDFILE) ? "initial" : "dynamic")); /* save old values */ onfiles = fdp->fd_nfiles; @@ -2035,9 +2050,19 @@ fdgrowtable(struct filedesc *fdp, int nfd) onfiles * sizeof(ntable->fdt_ofiles[0])); /* - * Allocate a new map only if the old is not large enough. It will - * grow at a slower rate than the table as it can map more - * entries than the table can hold. + * Allocate a new map only if the old one is not large enough. + * + * The initial struct filedesc0 object contains a table and map sized + * for NDFILE (20) entries which means the initial map can accomodate + * up to NDENTRIES (32 or 64) before requiring reallocation. + * + * As the new table size (nnfiles) is always rounded up to a multiple + * of NDENTRIES, the map will be fully utilised following the first + * enlargement, whether it is still the initial map (which will be the + * case if nnfiles == NDENTRIES) or if a new one that has has been + * allocated (which will be the case if nnfiles == X*NDENTRIES for some + * X > 1). In either case, subsequent enlargements will always allocate + * a new map to go along with the new table. */ if (NDSLOTS(nnfiles) > NDSLOTS(onfiles)) { nmap = malloc(NDSLOTS(nnfiles) * NDSLOTSIZE, M_FILEDESC, @@ -2045,6 +2070,8 @@ fdgrowtable(struct filedesc *fdp, int nfd) /* copy over the old data and update the pointer */ memcpy(nmap, omap, NDSLOTS(onfiles) * sizeof(*omap)); fdp->fd_map = nmap; + } else { + nmap = NULL; } /* @@ -2085,9 +2112,10 @@ fdgrowtable(struct filedesc *fdp, int nfd) /* * The map does not have the same possibility of threads still * holding references to it. So always free it as long as it - * does not reference the original static allocation. + * does not reference the original static allocation and a new + * map was allocated. */ - if (NDSLOTS(onfiles) > NDSLOTS(NDFILE)) + if (nmap != NULL && NDSLOTS(onfiles) > NDSLOTS(NDFILE)) free(omap, M_FILEDESC); } From nobody Thu Apr 16 07:17:42 2026 X-Original-To: dev-commits-src-main@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 4fx8VG31wWz6Z62t for ; Thu, 16 Apr 2026 07:17:42 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fx8VG2VcFz40NK for ; Thu, 16 Apr 2026 07:17:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776323862; 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=9/eMt9X0I6u5+3o87nAQfrej7BqKmkYj4JAeVfSHUEM=; b=rALnkgjaxBTjx6tX5QzcWVXmoB1qt6tfVG/9V9uETUYw94IEDgOT0SS3iPn4AZbnZdFOyO CNG1BjxrKUN473qIsZUiop2SCmya+sB0282ee2/iR/A7xsxF7aatOxOeC6JsL9LtG7YilK 8uEB0qK+opChhEJhCzL9+r3zwMp1w3PeRU9dr8hZhLS/HPDNw9nD7tWXyuk8d3lv7+KwdI I+HL8bDDik5yQOXIoG7BS0V3l5YLO6B4MUlwvm4KZa7fXHuqbDYwhXmYJxXaPdkY1zuKTF sWNQ2lQvvL5Wa5cvELWUy5rT5oO8j4yM4zzvfS2ri20JBRbFdoLPFTwjE282Pw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776323862; a=rsa-sha256; cv=none; b=ymdszIIKIGJTBW+zZ8hSTftOPryYIbbfZu+LRFSxNlYott6NJediKoQGuE39FvbRXokE1Q BzCUxiUkLN7DQrYrbUco3r9ssyPB2UjIfXSgreqjxaTRrXw8Zew5sGKbQ+F4ZRnVwxbo/B sqSo6kPKk2GWkjK7yPpmOAAqfZm0VwN+tsbXGulkra/EqvjTVUwwrtPmolFDqWE25JApEJ 4pJ2gT8VTCXpcbnWNn2w4mC7qtIH5ohcYzyueDy1I/JaKMxOMGGJRPRXhardJZUyNXCoFl q6GfF4V/KO+2mcvvLiONQl4WXP+pshjdu7slRGRsSzAnl5S23KhTzKvYnp/DMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776323862; 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=9/eMt9X0I6u5+3o87nAQfrej7BqKmkYj4JAeVfSHUEM=; b=oMTtN+0Cz/Kgg3EB227IVXK9VavhHC8CjAZi+hlLWj6rm1YfHmCAhesHJ0eqzJgIO4RimQ pbgiVq9KfKH7FvP4Q/F0ic3agQC5Ff1YNY1Rua2fCu7b53nDOCrCxgfPMihqaagYE18/Bx WXir8CjH677fs0h2CjTcVV5ZvnA7uJ9QGFtqHl+JMs/sm2XfqTYY+hRmu/xGcsmkiJaVC6 d/R+Tye7zcBzL2BclFkzoPOucaEgd0iw0cDsDFOHgaRLtjnEVLhJ//fTVLYKn45Qs09QUG vZim/IlasffjBoJgFTS6hMurg50TWjz7MK+vD80O6gCbYF5OLVpZlRocV0/qFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fx8VG1vwnzxZZ for ; Thu, 16 Apr 2026 07:17:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 42f78 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 07:17:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Aymeric Wibo Subject: git: dc9ff9e5d078 - main - acpi: Return "unknown D-state" in acpi_d_state_to_str() if unknown List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: obiwac X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc9ff9e5d078fd923adc3dc5426b5f219156ea43 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 07:17:42 +0000 Message-Id: <69e08d16.42f78.56b589eb@gitrepo.freebsd.org> The branch main has been updated by obiwac: URL: https://cgit.FreeBSD.org/src/commit/?id=dc9ff9e5d078fd923adc3dc5426b5f219156ea43 commit dc9ff9e5d078fd923adc3dc5426b5f219156ea43 Author: Aymeric Wibo AuthorDate: 2026-04-16 07:12:33 +0000 Commit: Aymeric Wibo CommitDate: 2026-04-16 07:17:07 +0000 acpi: Return "unknown D-state" in acpi_d_state_to_str() if unknown Some ACPI debugging prints call acpi_d_state_to_str() on unset D-states (i.e. ACPI_STATE_UNKNOWN), so return a string explicitly saying "unknown D-state" instead of just panicking. Fixes: 84bbfc32a3f4 ("acpi_powerres: D3cold support") Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/dev/acpica/acpivar.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 1099e7a25b0a..7bcac6239253 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -507,6 +507,8 @@ acpi_d_state_to_str(int state) const char *strs[ACPI_D_STATE_COUNT] = {"D0", "D1", "D2", "D3hot", "D3cold"}; + if (state == ACPI_STATE_UNKNOWN) + return ("unknown D-state"); MPASS(state >= ACPI_STATE_D0 && state <= ACPI_D_STATES_MAX); return (strs[state]); } From nobody Thu Apr 16 08:44:24 2026 X-Original-To: dev-commits-src-main@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 4fxBQJ1b8fz6ZDxq for ; Thu, 16 Apr 2026 08:44:24 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxBQJ11YHz3C1M for ; Thu, 16 Apr 2026 08:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776329064; 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=CUxnFhioiC6EwsHD7FZzvtgSsqbbXXpPTPPiX2Tllq8=; b=To3i+kBpy2sff00wLLp5WJkVSJ9q3XNhwEBL6HcYiJavQFJGf039XxhjtFVDeowuRe828f FgQErnogZQZWxz6Ly94APlDdHWLZIZIWnvWCRJVStcV5oMFJhhfyxwHJVHH/fCGmXm+4N/ i0z5UbyBrWwh+eM8H5DR4Mqz8ECdOfcCWgvaQ3LK/9QmfKi21t3ltYunuStgteXzJn4WTV y2q6CyyHpy2bz9CNaTo/tNc9vSWgzGSTZgkj4JkzzzgwevQknzCAwZAHrROSNR5c3FIx4Y P+LjkqY5YTHky8wwRsulzhzazbIQYX3tnehr7AQ/rasfn7sbklneieplWTmQwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776329064; a=rsa-sha256; cv=none; b=v/mt7m6nuO9VJ7LsP0ioqzC2X62eZhaTU6q7YBtWFgerOHXL8HCLNJl0DUHjOxPNDH0DBm vQCI+/NjYT/1RQeXJgK7oZsvRN26G5CYTLmoPnLfn2F0ZFza3esGoRmH5nPSH9Y1pY5gWh fRiW+qBFw0ZWj4x2pgRlMJOUdNcvQwVtMJ3K7D2aHjjfL67wJbLs3wyKfW6tLvDS5AJM68 sjsgWJKHPxD5/i7q9mts4uAfbUMxGDzMGrZtzwiiLR/BPfEFq9WRyADJnRbrGF9//0S89s /d0fRpEk7XjBaLT8AkIyCrNCpqGMD5n1H4bJTgpkbozztkAlfq8XnI8YLFBfHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776329064; 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=CUxnFhioiC6EwsHD7FZzvtgSsqbbXXpPTPPiX2Tllq8=; b=ogML8ashfZDuR5AT/MlH+B6SzIC2KxGgAYxVqewRXaAadsgggchbP7bjK7DbPH6hLANRZP 65Pqc3BfjRdTc6xHJ62AhjtqbQBtsfldjf89i5OLR3HlXRZz8Xsg8M1tASNsua+XW/0AA/ sHC0NjUmCs/FgF7iBixk2nJS6SJNKiwBk1fguO52+2CzZFQThJQGaQ9SxNLwvN68cV7g58 CvqF4Cs2qcjOJszC9dIQG4hhQCPzXKDIete19S5OLWy+ZO8yiB//ytoWSzA3ShkICVSZqJ 5eqJWuYWRB3H9IF6nWERfryrX29ISlY0yLHhESiF31Tgjr2BvKPv8RQWSzkxBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxBQJ0WTwz10LW for ; Thu, 16 Apr 2026 08:44:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1e15f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 08:44:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: ShengYi Hung Subject: git: e48e97945899 - main - hwpstate_amd: Cache cpuid List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e48e9794589993da039a2f4d1c66f8fdd6421155 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 08:44:24 +0000 Message-Id: <69e0a168.1e15f.159ac75d@gitrepo.freebsd.org> The branch main has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=e48e9794589993da039a2f4d1c66f8fdd6421155 commit e48e9794589993da039a2f4d1c66f8fdd6421155 Author: ShengYi Hung AuthorDate: 2026-04-08 12:58:34 +0000 Commit: ShengYi Hung CommitDate: 2026-04-16 08:44:03 +0000 hwpstate_amd: Cache cpuid Reviewed by: olce Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56305 --- sys/x86/cpufreq/hwpstate_amd.c | 49 ++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/sys/x86/cpufreq/hwpstate_amd.c b/sys/x86/cpufreq/hwpstate_amd.c index 4be295075482..5e075a26a57b 100644 --- a/sys/x86/cpufreq/hwpstate_amd.c +++ b/sys/x86/cpufreq/hwpstate_amd.c @@ -179,6 +179,7 @@ struct hwpstate_softc { uint64_t request; } cppc; }; + u_int cpuid; }; static void hwpstate_identify(driver_t *driver, device_t parent); @@ -337,8 +338,6 @@ static int sysctl_cppc_dump_handler(SYSCTL_HANDLER_ARGS) { const struct hwpstate_softc *const sc = arg1; - const device_t dev = sc->dev; - const u_int cpuid = cpu_get_pcpu(dev)->pc_cpuid; struct sbuf *sb; struct sbuf sbs; struct get_cppc_regs_data data; @@ -349,16 +348,16 @@ sysctl_cppc_dump_handler(SYSCTL_HANDLER_ARGS) sb = sbuf_new_for_sysctl(&sbs, NULL, 0, req); - smp_rendezvous_cpu(cpuid, smp_no_rendezvous_barrier, get_cppc_regs_cb, - smp_no_rendezvous_barrier, &data); + smp_rendezvous_cpu(sc->cpuid, smp_no_rendezvous_barrier, + get_cppc_regs_cb, smp_no_rendezvous_barrier, &data); if (hwp_has_error(data.res, HWP_ERROR_CPPC_ENABLE)) sbuf_printf(sb, "CPU%u: " MSR_AMD_CPPC_ENABLE_NAME ": " - MSR_NOT_READ_MSG "\n", cpuid); + MSR_NOT_READ_MSG "\n", sc->cpuid); else sbuf_printf(sb, "CPU%u: HWP %sabled (" MSR_AMD_CPPC_REQUEST_NAME - ": %#" PRIx64 ")\n", cpuid, data.enable & 1 ? "En" : "Dis", - data.enable); + ": %#" PRIx64 ")\n", sc->cpuid, data.enable & 1 ? + "En" : "Dis", data.enable); if (hwp_has_error(data.res, HWP_ERROR_CPPC_CAPS)) print_cppc_no_caps_1(sb); @@ -433,10 +432,8 @@ set_cppc_request_cb(void *args) static inline void set_cppc_request_send_one(struct set_cppc_request_cb *const data, device_t dev) { - const u_int cpuid = cpu_get_pcpu(dev)->pc_cpuid; - data->sc = device_get_softc(dev); - smp_rendezvous_cpu(cpuid, smp_no_rendezvous_barrier, + smp_rendezvous_cpu(data->sc->cpuid, smp_no_rendezvous_barrier, set_cppc_request_cb, smp_no_rendezvous_barrier, data); } @@ -505,9 +502,7 @@ sysctl_cppc_request_field_handler(SYSCTL_HANDLER_ARGS) check_cppc_in_use(sc, __func__); if ((sc->flags & HWPFL_CPPC_REQUEST_NOT_READ) != 0) { - const u_int cpuid = cpu_get_pcpu(dev)->pc_cpuid; - - smp_rendezvous_cpu(cpuid, smp_no_rendezvous_barrier, + smp_rendezvous_cpu(sc->cpuid, smp_no_rendezvous_barrier, get_cppc_request_cb, smp_no_rendezvous_barrier, sc); if ((sc->flags & HWPFL_CPPC_REQUEST_NOT_READ) != 0) @@ -576,8 +571,10 @@ hwpstate_goto_pstate(device_t dev, int id) sbintime_t sbt; uint64_t msr; int cpu, j, limit; + struct hwpstate_softc *sc; - cpu = cpu_get_pcpu(dev)->pc_cpuid; + sc = device_get_softc(dev); + cpu = sc->cpuid; if (hwpstate_pstate_limit) { /* get the current pstate limit */ @@ -657,16 +654,14 @@ hwpstate_set(device_t dev, const struct cf_setting *cf) static int hwpstate_get_cppc(device_t dev, struct cf_setting *cf) { - struct pcpu *pc; + struct hwpstate_softc *sc; uint64_t rate; int ret; - pc = cpu_get_pcpu(dev); - if (pc == NULL) - return (ENXIO); + sc = device_get_softc(dev); memset(cf, CPUFREQ_VAL_UNKNOWN, sizeof(*cf)); cf->dev = dev; - if ((ret = cpu_est_clockrate(pc->pc_cpuid, &rate))) + if ((ret = cpu_est_clockrate(sc->cpuid, &rate))) return (ret); cf->freq = rate / 1000000; return (0); @@ -681,7 +676,7 @@ hwpstate_get_pstate(device_t dev, struct cf_setting *cf) int cpu; sc = device_get_softc(dev); - cpu = cpu_get_pcpu(dev)->pc_cpuid; + cpu = sc->cpuid; hwpstate_pstate_read_status(cpu, &msr); if (msr >= sc->cfnum) return (EINVAL); @@ -894,7 +889,7 @@ static int enable_cppc(struct hwpstate_softc *sc) { const device_t dev = sc->dev; - const u_int cpuid = cpu_get_pcpu(dev)->pc_cpuid; + const u_int cpuid = sc->cpuid; struct set_autonomous_hwp_data data; struct sbuf sbs; struct sbuf *sb; @@ -964,7 +959,7 @@ hwpstate_probe_pstate(device_t dev) int cpu; sc = device_get_softc(dev); - cpu = cpu_get_pcpu(dev)->pc_cpuid; + cpu = sc->cpuid; /* * Check if acpi_perf has INFO only flag. */ @@ -1042,6 +1037,7 @@ hwpstate_probe(device_t dev) device_set_desc(dev, "Cool`n'Quiet 2.0"); sc->dev = dev; + sc->cpuid = cpu_get_pcpu(dev)->pc_cpuid; if ((sc->flags & HWPFL_USE_CPPC) != 0) { sc->cpufreq_methods = &cppc_methods; return (0); @@ -1133,14 +1129,11 @@ static int hwpstate_pstate_read_settings(struct hwpstate_softc *sc, uint64_t vals[]) { struct hwpstate_pstate_read_settings_cb req; - device_t dev; req.sc = sc; req.vals = vals; - dev = sc->dev; - smp_rendezvous_cpu(cpu_get_pcpu(dev)->pc_cpuid, - smp_no_rendezvous_barrier, hwpstate_pstate_read_settings_cb, - smp_no_rendezvous_barrier, &req); + smp_rendezvous_cpu(sc->cpuid, smp_no_rendezvous_barrier, + hwpstate_pstate_read_settings_cb, smp_no_rendezvous_barrier, &req); return (req.err); } @@ -1155,7 +1148,7 @@ hwpstate_get_info_from_msr(device_t dev) family = CPUID_TO_FAMILY(cpu_id); sc = device_get_softc(dev); /* Get pstate count */ - hwpstate_pstate_read_limit(cpu_get_pcpu(dev)->pc_cpuid, &msr); + hwpstate_pstate_read_limit(sc->cpuid, &msr); sc->cfnum = 1 + AMD_10H_11H_GET_PSTATE_MAX_VAL(msr); hwpstate_set = sc->hwpstate_settings; hwpstate_pstate_read_settings(sc, state_settings); From nobody Thu Apr 16 13:27:23 2026 X-Original-To: dev-commits-src-main@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 4fxJhr1P9Lz6Zfh0 for ; Thu, 16 Apr 2026 13:27:24 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxJhr0XkMz42TD for ; Thu, 16 Apr 2026 13:27:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776346044; 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=Dc7RlXV8oB/8M++pO1HSy/q6j+7E0vQTSuUIsBcBrVU=; b=VJHRPuT68CuPtzaFu+K8Ju1ml/TCLdMxWWegB7jiS2OXseAB3IcrQ3zspjt97Bb60048EB lHnPUY58avpnFmHsoffk/x7IbFelkH9RB2cZ/fkzRcP0taJ+FdiheACNKpVVZYI68qZzV5 jQ0+B+yPkwp51iGC4hSmY/Gyg3gOa06PNp/a+Y6N4Bp1+ep2dv7AftItATroX4OAkmUrkb fx16jIFnRLWsLclGWm9pUFs7DKYPALna0uemWjM160kYoTf/vjg0zNOhP45EzObJtE1jDw 4H9ZtaSTNrqUHidbJJBean0VyTLMQjBf/f2SGwNyNMm9S3i/BK6iYG16EWYVFA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776346044; a=rsa-sha256; cv=none; b=I+m7YkArIr3q1rNUOw+lRrEB0xI99qU84z6eY0uvL/pZ5cKnfEFjjtDAs5Q5AtqRKGoTux 9y146zPpB2SHXMc/v5hKTTDhk/InYNMexnzac+vLEzuZfvn7A9/5PYldq9AN8fik0iKEKV B8o0tXk/NnP18bilPAxcC3tp4Ll92YIOs1A8/9kvboFYRXfK3WPfW+6zVsZDvrmg2iCn20 +o2ScKaesuZ9mR/YRQvNTI4J5hKeITOR2AZYuc8R7grSse1x+ysqFpMXS8JZ6ZWBaRxNfx ra3NRpr2UXTyTbDlInjaj5yO/0W/tW7osVXY3j3fJKnzFBmeCFQFULy/EBQ5nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776346044; 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=Dc7RlXV8oB/8M++pO1HSy/q6j+7E0vQTSuUIsBcBrVU=; b=p8kD7Gmpaja2hoNAOVvgA1I2dH/a5R2Ko8Siz09Bey/DeNIS26TLbr8d+fvHsp+E+J3rxB 1VXsJlaqixyujqxPzbXO94FG6XfOAi5zQt1QeF5gsljDVrVcmL1HgZlUGwnmMmrkbnA655 6r7+WMzZP1LnV0DAw6B571Rvpi6coX3qTLpc7uRJea4MCUzRNm+ju7GWEjrb024RUSWAFt T64QdWmYULmsf7qfo2345Qrsztro3c5yGmtta2+i1vgwupnBFkQ/x1g8z8Ewa1oD1U1rY8 2tFeabFCxOvPALFfWwanZ0pPipGzYHNHYicXdQpB/TiWz7FDrovse09YiW2B7g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxJhq6sbgz18Kx for ; Thu, 16 Apr 2026 13:27:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 43678 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 13:27:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 8a5601cff1ea - main - openat(2): check that userspace pass known and allowed flags List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8a5601cff1ea32ab63df1377f61620e4f91999b3 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 13:27:23 +0000 Message-Id: <69e0e3bb.43678.8e3a03e@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8a5601cff1ea32ab63df1377f61620e4f91999b3 commit 8a5601cff1ea32ab63df1377f61620e4f91999b3 Author: Konstantin Belousov AuthorDate: 2026-04-12 10:48:47 +0000 Commit: Konstantin Belousov CommitDate: 2026-04-16 13:26:53 +0000 openat(2): check that userspace pass known and allowed flags Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D56365 --- sys/kern/vfs_syscalls.c | 5 ++++- sys/sys/fcntl.h | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 06500909589e..0c4eeb584d41 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1168,12 +1168,15 @@ openflags(int *flagsp) { int flags; + flags = *flagsp; + if ((flags & ~FUSERALLOWED) != 0) + return (EINVAL); + /* * Only one of the O_EXEC, O_RDONLY, O_WRONLY and O_RDWR flags * may be specified. On the other hand, for O_PATH any mode * except O_EXEC is ignored. */ - flags = *flagsp; if ((flags & O_PATH) != 0) { flags &= ~O_ACCMODE; } else if ((flags & O_EXEC) != 0) { diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h index 8f2fc1e2debb..0b13241f0ee3 100644 --- a/sys/sys/fcntl.h +++ b/sys/sys/fcntl.h @@ -171,6 +171,12 @@ typedef __pid_t pid_t; #define FOPENFAILED O_TTY_INIT /* Only for O_PATH files which passed ACCESS FREAD check on open */ #define FKQALLOWED O_RESOLVE_BENEATH +/* Flags userspace is allowed to pass to openat() */ +#define FUSERALLOWED (O_ACCMODE | O_NONBLOCK | O_APPEND | O_SHLOCK | \ + O_EXLOCK | O_ASYNC | O_SYNC | O_NOFOLLOW | O_CREAT | O_TRUNC | \ + O_EXCL | O_NOCTTY | O_DIRECT | O_DIRECTORY | O_EXEC | O_TTY_INIT | \ + O_CLOEXEC | O_VERIFY | O_PATH | O_RESOLVE_BENEATH | O_DSYNC | \ + O_EMPTY_PATH | O_NAMEDATTR | O_CLOFORK) /* convert from open() flags to/from fflags; convert O_RD/WR to FREAD/FWRITE */ #define FFLAGS(oflags) ((oflags) & O_EXEC ? (oflags) : (oflags) + 1) From nobody Thu Apr 16 14:21:21 2026 X-Original-To: dev-commits-src-main@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 4fxKv61PFhz6ZkX5 for ; Thu, 16 Apr 2026 14:21:22 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxKv60RLGz47CP for ; Thu, 16 Apr 2026 14:21:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776349282; 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=ulEk0EqEI/aA9Bjy0/XJX+mFYCveSG9s+pj/seL00fI=; b=EbOd0/lKf/m16tHgruBeROlPc002tfvUEJrpR/RMINbgZRauWeft2aQFXW3XumiO9SPFjD BI2MbP1rq2kBh5IOJjwAOeV4ikFsfuZmCokA214wFmL1Y8+jJx+MSPIstsalvdywdD9m8c SaIIK/19Utlre/P2C1mGJK/O5B4pFCiDkk3ZWkW/sVV1NWjcXbzVnzEinvrSNx6au34VOm 6gekDJ7VZuYVjY3yx4mQ129iHflC0iHxjWtO3/e2JfSAI+F4GMwddgBg2VR5i/ysdvFUL+ siH784U6wdimxNRi9Lr8N3xxBN2OAq2rdGQ/fmPM08h+VROjewBeqKj92zaPDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776349282; a=rsa-sha256; cv=none; b=icJRGKSnK694JjsVuQsrupZzskSD8pRDNbURIEABzReu4oobGpkPEngVAGIuNG37Sau6I3 knBs4h9/8nM8zaGMuxyK4brpioBDfufnUzJ6bxQyWX4kwhjnu9T7uY0bWoEaeexEIkGZLD Q+HdUM5otReSeQ9JbeqNWReC6inw3pnbM4HWN42awgyjLW8FCLBgK8cMMT1RRjZc1nim3s 1P4f39nO/4VHL1uKxsrEfimwWuDqOhkT0rY3waaAA4Vb9ZEEH2zJN8Ltu7q1EeC1Jfv+2F TtmFpFSYToTF/Ieq22h1wuf0AOB3fLiVcSahZ6y7oxKGW6wkPp9m1z2PJzJ1Nw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776349282; 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=ulEk0EqEI/aA9Bjy0/XJX+mFYCveSG9s+pj/seL00fI=; b=ouSCvjn5O9c8gDQm6gQT2mNBT4W4c+Ipjo09juwLZGxiCkj0CmHk3npskCCoALzRbsWHQd JE0arL1lhk3zUYtPmhVicjICfV8uFh1UQHuf7lGlM8h+CivIKcschmiLxLWwgKogm9DIFW 3/d22kuTW86hNZYGNn3ZBqqQm51bmX79sD2RuDQxoTc3r84gdjcYvEJYj2vuGMkWjZJ2K9 4hGeRQqgJ9uOwMc5drHuTJzwMO7CiE5+6VfT0aPwHhz8oOCxxtVzVcLEDpue6mCID9IlXY 2uEZw3lJ93LmQ/vwKC8EYeikw0qD/0hxlWVO80nVpG5BWjb+G11Kqv5Y6IqaaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxKv575BTz19ls for ; Thu, 16 Apr 2026 14:21:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19306 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 14:21:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: b60cd486a652 - main - ofw: bool-ify OF_hasprop() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b60cd486a652f0427e525b4482ac598be5460459 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 14:21:21 +0000 Message-Id: <69e0f061.19306.b179267@gitrepo.freebsd.org> The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=b60cd486a652f0427e525b4482ac598be5460459 commit b60cd486a652f0427e525b4482ac598be5460459 Author: Mitchell Horne AuthorDate: 2026-04-16 14:12:41 +0000 Commit: Mitchell Horne CommitDate: 2026-04-16 14:12:41 +0000 ofw: bool-ify OF_hasprop() Adjust the function signature and the few callers that don't treat it this way already. This is style only; no functional change intended. Reviewed by: andrew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56203 --- sys/dev/clk/clk_fixed.c | 2 +- sys/dev/dwc/if_dwc.c | 8 ++++---- sys/dev/ofw/openfirm.c | 4 ++-- sys/dev/ofw/openfirm.h | 2 +- sys/dev/usb/net/if_smsc.c | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/dev/clk/clk_fixed.c b/sys/dev/clk/clk_fixed.c index f8dcfb8378cd..f18b8f8904c6 100644 --- a/sys/dev/clk/clk_fixed.c +++ b/sys/dev/clk/clk_fixed.c @@ -157,7 +157,7 @@ clk_fixed_probe(device_t dev) clk_type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; switch (clk_type) { case CLK_TYPE_FIXED: - if (OF_hasprop(ofw_bus_get_node(dev), "clock-frequency") == 0) { + if (!OF_hasprop(ofw_bus_get_node(dev), "clock-frequency")) { device_printf(dev, "clock-fixed has no clock-frequency\n"); return (ENXIO); diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c index 21a520db8b89..cd8651cc99ff 100644 --- a/sys/dev/dwc/if_dwc.c +++ b/sys/dev/dwc/if_dwc.c @@ -527,13 +527,13 @@ dwc_attach(device_t dev) sc->txpbl = pbl; if (OF_getencprop(sc->node, "snps,rxpbl", &sc->rxpbl, sizeof(uint32_t)) <= 0) sc->rxpbl = pbl; - if (OF_hasprop(sc->node, "snps,no-pbl-x8") == 1) + if (OF_hasprop(sc->node, "snps,no-pbl-x8")) sc->nopblx8 = true; - if (OF_hasprop(sc->node, "snps,fixed-burst") == 1) + if (OF_hasprop(sc->node, "snps,fixed-burst")) sc->fixed_burst = true; - if (OF_hasprop(sc->node, "snps,mixed-burst") == 1) + if (OF_hasprop(sc->node, "snps,mixed-burst")) sc->mixed_burst = true; - if (OF_hasprop(sc->node, "snps,aal") == 1) + if (OF_hasprop(sc->node, "snps,aal")) sc->aal = true; error = clk_set_assigned(dev, ofw_bus_get_node(dev)); diff --git a/sys/dev/ofw/openfirm.c b/sys/dev/ofw/openfirm.c index b5f58b86a9c3..a8d3786ed152 100644 --- a/sys/dev/ofw/openfirm.c +++ b/sys/dev/ofw/openfirm.c @@ -381,11 +381,11 @@ OF_getproplen(phandle_t package, const char *propname) } /* Check existence of a property of a package. */ -int +bool OF_hasprop(phandle_t package, const char *propname) { - return (OF_getproplen(package, propname) >= 0 ? 1 : 0); + return (OF_getproplen(package, propname) >= 0); } /* Get the value of a property of a package. */ diff --git a/sys/dev/ofw/openfirm.h b/sys/dev/ofw/openfirm.h index 4e2b035827cb..fd13f4abd29e 100644 --- a/sys/dev/ofw/openfirm.h +++ b/sys/dev/ofw/openfirm.h @@ -108,7 +108,7 @@ ssize_t OF_getprop(phandle_t node, const char *propname, void *buf, size_t len); ssize_t OF_getencprop(phandle_t node, const char *prop, pcell_t *buf, size_t len); /* Same as getprop, but maintains endianness */ -int OF_hasprop(phandle_t node, const char *propname); +bool OF_hasprop(phandle_t node, const char *propname); ssize_t OF_searchprop(phandle_t node, const char *propname, void *buf, size_t len); ssize_t OF_searchencprop(phandle_t node, const char *propname, diff --git a/sys/dev/usb/net/if_smsc.c b/sys/dev/usb/net/if_smsc.c index 0ebbf8482446..8e16b8609144 100644 --- a/sys/dev/usb/net/if_smsc.c +++ b/sys/dev/usb/net/if_smsc.c @@ -1585,7 +1585,7 @@ smsc_bootargs_get_mac_addr(device_t dev, struct usb_ether *ue) node = OF_finddevice("/chosen"); if (node == -1) return (false); - if (OF_hasprop(node, "bootargs") == 0) { + if (!OF_hasprop(node, "bootargs")) { smsc_dbg_printf((struct smsc_softc *)ue->ue_sc, "bootargs not found"); return (false); From nobody Thu Apr 16 14:21:23 2026 X-Original-To: dev-commits-src-main@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 4fxKv72dtsz6ZkRt for ; Thu, 16 Apr 2026 14:21:23 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxKv71G6Dz474C for ; Thu, 16 Apr 2026 14:21:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776349283; 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=6BHue/y5dpn8DVL0fwyElktkNtBT0leFpYJmUvrYkOo=; b=dRUIcuqcF6pUmEkvLk6/+Wc7egbrip83y+Lwh2yaiINzW38VSrWi+f59WjOBpYVhK9X5C2 IWFiWAU+WOhSl0anYlWADylO3BC3dIKfupJij4LA8vA3rbRtcHY/rOAZ9Kayng9c4A95kK 7sB+j2CgfXJxn7LdwBKxlztvXNRz7bU4qqo5deuPo8F2tGHVrV7JGer/Zh1PijOJwEElBE AErBzgbaIzj9C9pg98c2V9ycuquiL8wCo8Y9MkBkg9kt+hdfi8TaUHQuZnb2eNDsRwiv5q XeKQhXQfFKcNEimhLrGyMRn/YnBRmYeomr/ewQ8W4bac2vKT/AXOyW+VBcPPqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776349283; a=rsa-sha256; cv=none; b=X96fhCz43FFHBccxMmflmd90SOqk2wjLeJ7hqYbQNe0XP4FFLWI4vRFjf3zBtI7U5A/i8K vJDBLVv71FH02rCQAW6l0dAlKquCXslOKCGDQK9l24HH9z1Aq3MfOCT7E6lKwvOwUx1mFq SelMAX2CZaI89GIT8/KzPHJMyhIwPg00r2Ck5DS4Piy1zWrggVqQ3mu7U422AoTuYCK0vy pmnMOvZ7HrWOpN2h/GkacUUfIlpkRO/cANchsrL5qs3irXHrDvGxvdl0hogtwWKDqk6IkS 63+QPIhOkyU6kEbSiJrKGjq4uHqz+R6AAIqJO+nOsvVC4HDkKhUA0+iXrn+r2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776349283; 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=6BHue/y5dpn8DVL0fwyElktkNtBT0leFpYJmUvrYkOo=; b=rA2ZcY51iGQfEeuXjJl7Jk7l9eDrj8XmYTQX4LmstIUeEkP31o1rmy4kf5rHQwhT2Tj7Wo yUdNXqZOBqtzvTns3qUT65BVJfRey7FzzGa2hMfsllKaBd4uVp7wXN7Vm+fwoqXznVRGTc BpyWCbJqYimAxWODcLw2c8h2lUs0N0tpUTED3bWwx30ZyLEdtx1ImPlKj40SKqU4BygQZF TQ7YggsdnH1TQoUXOlVja113I2fPFHhTER4OfiamGNIReP/VJf/umKNH/wl6g1JSVJqt8W 4D/D7t+yfJxXPcq+H4YRXTbpiGDmC1tx+iFhIgsy7lGZca0y6KeqaGE0+ioHrA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxKv70lP9z19Fl for ; Thu, 16 Apr 2026 14:21:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 188bf by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 14:21:23 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 8728e21bd694 - main - clk_fixed: quiet a warning message List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8728e21bd694dbb813c149206c5c89290f9c32f5 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 14:21:23 +0000 Message-Id: <69e0f063.188bf.7670402e@gitrepo.freebsd.org> The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=8728e21bd694dbb813c149206c5c89290f9c32f5 commit 8728e21bd694dbb813c149206c5c89290f9c32f5 Author: Mitchell Horne AuthorDate: 2026-04-16 14:13:04 +0000 Commit: Mitchell Horne CommitDate: 2026-04-16 14:13:04 +0000 clk_fixed: quiet a warning message Frequently there are some unused/unspecified fixed clocks present in a device tree. Each one emits a warning before it fails to attach, which results in (sometimes many) repeated messages which are not user-actionable. Put this warning behind the bootverbose flag. MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56204 --- sys/dev/clk/clk_fixed.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/clk/clk_fixed.c b/sys/dev/clk/clk_fixed.c index f18b8f8904c6..6656aeec473e 100644 --- a/sys/dev/clk/clk_fixed.c +++ b/sys/dev/clk/clk_fixed.c @@ -158,8 +158,10 @@ clk_fixed_probe(device_t dev) switch (clk_type) { case CLK_TYPE_FIXED: if (!OF_hasprop(ofw_bus_get_node(dev), "clock-frequency")) { - device_printf(dev, - "clock-fixed has no clock-frequency\n"); + if (bootverbose) { + device_printf(dev, + "clock-fixed has no clock-frequency\n"); + } return (ENXIO); } device_set_desc(dev, "Fixed clock"); From nobody Thu Apr 16 14:23:06 2026 X-Original-To: dev-commits-src-main@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 4fxKx659S3z6ZkMK for ; Thu, 16 Apr 2026 14:23:06 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxKx63QCDz48hR for ; Thu, 16 Apr 2026 14:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776349386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tyFnbJ5yN1CYpNBZu2nI/db2M305oGWJA/ABJFquFoQ=; b=Tvd3GZqD40MnTJhKsj+txDlrLtniG+KGPBa+cQ//U5SMklJSAfRWDjqEgV6JSFc42Si59V ICBjsLq9h34PwPR9505ArShj9vGDyYdaY8YlKvxY+WoTc2YpbBGLMDQvy3P2psTvTZ3Vmv pf/8EIEAwcFADY+1Mqqw/c3mFzV1ZpJuwhLR7DTMNs86xaDdIXzl0NidFXVLmOdPSFK5sb ALTPVu8OiCyO9b46ofR64DBUK3mHFtLIpwTaNNPN9nI3a8cVLS+gaXZnOCVURWGNDNzgPa Gy/UCrx9H4FlXEPHhW0F1zjDROUUP8NF9JNqTZr4rAG4mweuwzb826MJlGqPDA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776349386; a=rsa-sha256; cv=none; b=USB/5hF/EhqBPwO8/clyqvLnwtZlnnLyw4B6o2dXDIvBTZ9MXtOvFCdSr1zkfwVumwCIAQ U6FRZ3EeeeNmvnaK39HXXx5hAma0Sekfm9iFzL6GmuGoynZtA7HENBlLxAC1WkQwXVK2GV Sn2c2dmJma/4hyJm2tqE24W74jIVYlTpIfElS/+V/wMb83gmHvYoeuRUyPQswWU5/d9pYQ taqoI59pABXiymc61MvWjWSgP63apEqYg/1WIYYrt9FMP2Qalo1DkiHo/zLIK479R+aR1/ C0UezhvnaZPG4qHqsenDn+t7iHvRIuSkdRlZNW+Yxc3PdOR98azOTKVZy43enA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776349386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tyFnbJ5yN1CYpNBZu2nI/db2M305oGWJA/ABJFquFoQ=; b=uOw4zEsHvZ9sPeYDZKkIMV9WqeukYkmUXOTP2QFyBGQNQgUaxG3TiBqMt9ZxeRZiHh61vc 7EgBibiOhOClKI5kKLI0WHHAblerSAo7aiHisFl4Bl0ZBEwxN/wbymdlCLIsLjgW5q/GFg UlRKrxxz2bSQ5x6Xo5Oeqi3sIv49PYA0+ttAOBW+xxxsnfeg/XqGHNcC6p7XoTNOHTIisS 2LkWmBfzf1nYKLZjIYs3g9Ke2Hxtaytv1lLuc4a5odXqZ4fpzNWd7pN4efr8YhlQkNq5Th WFtfwnmRtnz4euAAZ1I8xLyJhALAyM2uLwigyZ5i7yp5Dl0+XqEUrnrvP8+h/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxKx627SBz19kB for ; Thu, 16 Apr 2026 14:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 189dc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 14:23:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Harry Moulton From: Andrew Turner Subject: git: aa2d89cb4263 - main - arm64: mte: add tagged memory attribute List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa2d89cb4263f5d638b150efb4a2e6adab4ee9d6 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 14:23:06 +0000 Message-Id: <69e0f0ca.189dc.719cb132@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=aa2d89cb4263f5d638b150efb4a2e6adab4ee9d6 commit aa2d89cb4263f5d638b150efb4a2e6adab4ee9d6 Author: Harry Moulton AuthorDate: 2026-04-16 13:30:15 +0000 Commit: Andrew Turner CommitDate: 2026-04-16 14:22:24 +0000 arm64: mte: add tagged memory attribute Add the Normal-Tagged memory attribute introduced with MTE. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D55948 --- sys/arm64/arm64/locore.S | 3 ++- sys/arm64/arm64/pmap.c | 3 +++ sys/arm64/include/vm.h | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 4c8e0c680321..c86f98da55a8 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -1134,7 +1134,8 @@ mair: MAIR_ATTR(MAIR_NORMAL_NC, VM_MEMATTR_UNCACHEABLE) | \ MAIR_ATTR(MAIR_NORMAL_WB, VM_MEMATTR_WRITE_BACK) | \ MAIR_ATTR(MAIR_NORMAL_WT, VM_MEMATTR_WRITE_THROUGH) | \ - MAIR_ATTR(MAIR_DEVICE_nGnRE, VM_MEMATTR_DEVICE_nGnRE) + MAIR_ATTR(MAIR_DEVICE_nGnRE, VM_MEMATTR_DEVICE_nGnRE) | \ + MAIR_ATTR(MAIR_NORMAL_TG, VM_MEMATTR_TAGGED) tcr: #if PAGE_SIZE == PAGE_SIZE_4K #define TCR_TG (TCR_TG1_4K | TCR_TG0_4K) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index a23905994846..5017b5f63c4d 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -10015,6 +10015,9 @@ sysctl_kmaps_dump(struct sbuf *sb, struct pmap_kernel_map_range *range, case ATTR_S1_IDX(VM_MEMATTR_WRITE_THROUGH): mode = "WT"; break; + case ATTR_S1_IDX(VM_MEMATTR_TAGGED): + mode = "TAGGED"; + break; default: printf( "%s: unknown memory type %x for range 0x%016lx-0x%016lx\n", diff --git a/sys/arm64/include/vm.h b/sys/arm64/include/vm.h index e03e615bb841..4d9f2860f654 100644 --- a/sys/arm64/include/vm.h +++ b/sys/arm64/include/vm.h @@ -33,7 +33,8 @@ #define VM_MEMATTR_WRITE_BACK 2 #define VM_MEMATTR_WRITE_THROUGH 3 #define VM_MEMATTR_DEVICE_nGnRE 4 -#define VM_MEMATTR_END (VM_MEMATTR_DEVICE_nGnRE + 1) +#define VM_MEMATTR_TAGGED 5 +#define VM_MEMATTR_END (VM_MEMATTR_TAGGED + 1) #define VM_MEMATTR_DEVICE VM_MEMATTR_DEVICE_nGnRE #define VM_MEMATTR_DEVICE_NP VM_MEMATTR_DEVICE_nGnRnE From nobody Thu Apr 16 14:23:05 2026 X-Original-To: dev-commits-src-main@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 4fxKxB5KJXz6Zkm2 for ; Thu, 16 Apr 2026 14:23:10 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxKxB3zbxz48lL for ; Thu, 16 Apr 2026 14:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776349390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=97oi/BGir8n3/hAK8PjmiZK2S+ZK3hsRQDD6ikI9oY8=; b=XE24wdZVvSbyVJaYD1RodSJ81lzcRt0HBJtdKnsFTtjuNbHuQunpQtNMBXITcxlV1AZsJ2 wiD1GkstgI54Mrqiiy/x3EH4x4H/Q0EFfWuRQdmDtqFQzrFtkmhNWmf6XS1jKJfJHw0doy XyALmR/uDo3luEup0NkESurzvRjkOpQa8LQhcxOgc2TXaXpwSCzimFc6APCn4TVrWA5VWz DSpzJRVca0QZbtxJoBx5qZyhSl5wlCwl9rEq7y4lncYM74x12VWnJK6z5dNlovsbnqRAB4 xWsyvAJ/ljKbdGqeW4pL+WgDxWp4uyAdCuTByJIZQMwMiMqGjz+cDCVQkCXWwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776349390; a=rsa-sha256; cv=none; b=DFHnvNvNCqGQQbQfZnM9uOYyBp+lE4XttjA2g0qLuBUhGf0IebrwTNlS4qSylnF0laYFKS +VMZjFoayhMzHtBdp0D7Vc9AYSnku8Wwh3miDrmV70CGxuNkgWhe/yqhf2LcIOxeS2Jw5k IsyXm2bHNAKkza9bofXbUYItfET+KTN8lxeyPO/+cvgPb1XhXkF1A2lkaj5wLKeHvdHFZR dG4+gl4EUIzeqsFhnszaf8JP06xAaRM87oQocjo6tH/GHwxDBHz+d0DpdkLpXGWBSCtm80 At0v98of6G2YgIoSvs9L/hOnHGcvjEyGjtESLSbN52vKJ1+29Rubzt/uZDqwPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776349390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=97oi/BGir8n3/hAK8PjmiZK2S+ZK3hsRQDD6ikI9oY8=; b=GvbLQEqsKCmWBQu0AocgEmwTi8Rpe5wQZX5w74ktMu6kntpOF3L4wmu6Zt/kN7UQNDZzup v5ddWNLdrE1ZEHeqvnBup6VC89DzJijLWpHVATy0fIB+KLNRgvPT+fdDnpGwXeHniI49EQ 16BuqNwoK9SreRShsTAOzt6r2jCM96+4mLuOJXnT5NbWg5npo0flI6X/LbJcf8shJYm+rT X/q6H93mqf4byNjSEryl+ASbDlxN6k02eJ01PJOqt1SMXWv9tc/YFKKbkOqYji5iTo9OoR i4W7pCsfziHlKIkpadsgpoRRerjrfd5ziR/pYGq9RgB0HKTkDl1avSGSDFCDRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxKxB3Tndz19mM for ; Thu, 16 Apr 2026 14:23:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 18622 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 14:23:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Harry Moulton From: Andrew Turner Subject: git: 6f9e9eba984f - main - arm64: mte: handle synchronous tag check faults List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f9e9eba984f5c8d8a022c0ec99f844a911687fe Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 14:23:05 +0000 Message-Id: <69e0f0c9.18622.10353280@gitrepo.freebsd.org> The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=6f9e9eba984f5c8d8a022c0ec99f844a911687fe commit 6f9e9eba984f5c8d8a022c0ec99f844a911687fe Author: Harry Moulton AuthorDate: 2026-04-16 13:29:14 +0000 Commit: Andrew Turner CommitDate: 2026-04-16 14:22:24 +0000 arm64: mte: handle synchronous tag check faults The Memory Tagging Extension supports both Synchronous and Asynchronous faults, called Tag Check Faults, which are configurable via SCTLR_EL1.TCF0 for userspace and SCTLR_EL1.TCF for the kernel. This commit adds support for handling synchronous tag check faults at EL0 and EL1, although these are only enabled on a per-process basis in userspace, kernel space does not enable tag check faults. A TCF in the kernel will cause a kernel panic like any other virtual memory fault, and a TCF in userspace will result in a SIGSEGV Reviewed by: kib Sponsored by: Arm Ltd Signed-off-by: Harry Moulton Differential Revision: https://reviews.freebsd.org/D55947 --- sys/arm64/arm64/trap.c | 22 ++++++++++++++++++++++ sys/sys/signal.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c index ad461aa1bffc..1178817108e5 100644 --- a/sys/arm64/arm64/trap.c +++ b/sys/arm64/arm64/trap.c @@ -94,6 +94,7 @@ typedef void (abort_handler)(struct thread *, struct trapframe *, uint64_t, static abort_handler align_abort; static abort_handler data_abort; static abort_handler external_abort; +static abort_handler tag_check_abort; static abort_handler *abort_handlers[] = { [ISS_DATA_DFSC_TF_L0] = data_abort, @@ -106,6 +107,7 @@ static abort_handler *abort_handlers[] = { [ISS_DATA_DFSC_PF_L1] = data_abort, [ISS_DATA_DFSC_PF_L2] = data_abort, [ISS_DATA_DFSC_PF_L3] = data_abort, + [ISS_DATA_DFSC_TAG] = tag_check_abort, [ISS_DATA_DFSC_ALIGN] = align_abort, [ISS_DATA_DFSC_EXT] = external_abort, [ISS_DATA_DFSC_EXT_L0] = external_abort, @@ -250,6 +252,26 @@ external_abort(struct thread *td, struct trapframe *frame, uint64_t esr, panic("Unhandled external data abort"); } +static void +tag_check_abort(struct thread *td, struct trapframe *frame, uint64_t esr, + uint64_t far, int lower) +{ + /* + * A Tag Check Fault should be handled as a SIGSEGV if it occurs + * at EL0 and a kernel panic if at EL1. + */ + if (!lower) { + print_registers(frame); + print_gp_register("far", far); + printf(" esr: 0x%.16lx\n", esr); + panic("Tag Check Fault"); + } + + call_trapsignal(td, SIGSEGV, SEGV_MTESERR, (void *)far, + ESR_ELx_EXCEPTION(frame->tf_esr)); + userret(td, frame); +} + /* * It is unsafe to access the stack canary value stored in "td" until * kernel map translation faults are handled, see the pmap_klookup() call below. diff --git a/sys/sys/signal.h b/sys/sys/signal.h index c0b65c0c9ef0..863b981c2b7a 100644 --- a/sys/sys/signal.h +++ b/sys/sys/signal.h @@ -307,6 +307,8 @@ struct __siginfo32 { #define SEGV_ACCERR 2 /* Invalid permissions for mapped */ /* object. */ #define SEGV_PKUERR 100 /* x86: PKU violation */ +#define SEGV_MTEAERR 100 /* arm64: Asynchronous Arm MTE error */ +#define SEGV_MTESERR 101 /* arm64: Synchronous Arm MTE error */ /* codes for SIGFPE */ #define FPE_INTOVF 1 /* Integer overflow. */ From nobody Thu Apr 16 14:51:16 2026 X-Original-To: dev-commits-src-main@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 4fxLYc5pn3z6Zn8q for ; Thu, 16 Apr 2026 14:51:16 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxLYc4ymhz4GFk for ; Thu, 16 Apr 2026 14:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776351076; 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=GpDrWUEcpVpRzVyzqT95X4COE4+R7y20/y8nqTv4Kq0=; b=FWI+IR+mSeweDqP6ebJpsbPxNgF97KI3tyIXsf6yOzvR/cnKqMVo5PGlB4/et5F9a+sAet J3FV7q0qe7+MqAA/Ak0oNx6KNkuQnXvk5KvQnJc5dcDuHL1H3kQj3DxKvAOhYpxnLxVnpR RIzlK+CqPZXD34hK2tvy2Y7MJp4e2vONX7k50HY2uXrhrpfqdI708l/X5MWiIC9Udk1xMB JNSgJ0uVyeEfHxwK6uj8PPgMvAjRJMMukwXwRjpAthMKA+lwJzHPzb0uThBxhm7vYHm09W 7osVP2nwubAllYSQX6QZFp5PlwQqS4P5C9ctph6zk7fKewiqnzHu3jMA6cQN1Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776351076; a=rsa-sha256; cv=none; b=s/q/Hl6ME57CAGeg3j5aW/ye62AGL9v9cmsQ7q51AvxXuKmN9KrQwWrjBmLpig2hlpqGMO F1IcnXFIlruvd1fNcPCnSXWVNHm/PUfZfdZt77usuOexkZDT0elTe05oSPZNAz7ybTCwEu drUKuh4ZfU6fgqideG4MPnrUfnfvoFZmSnLjqGVg5BqtJiwEgrki+4bFngLVut+W3wFZ1n vbiOz9olThHz+16dypmG6HoRU5THWSxdBfs6qwWrifn2QJD2kd03/VrV3tXEXBrs5osdvU 8A667e5CH9wd/GkD0k/KBGSg1DlR4q++TCetqVpqq5yAw9IsJ4R/VxCorTU3sA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776351076; 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=GpDrWUEcpVpRzVyzqT95X4COE4+R7y20/y8nqTv4Kq0=; b=cz305snytzh9M6BCtuxPvx4Dum66AYtYTvPjydeBBW20g784ExhQeAtJ7POVrgUOSRcY4T moMAi7rNulUAuX8XJl+plfMvvVvAeoGPRu7CBd6VxyQ8Uv0HPrwb7jatDlpIJap/ObErjh etLIL87tn475FdW+pK4MuFgLaxx0utIQY9uHEYWDlCWkAgsNlQzriayjp0yCWWb2iEj4/Q XlJQ+1X27xBay7BU3uf4pQsLJg5+PyNOU9HMjZ4salZsKcbFFwXCCVqEezdRc4+xm7clx+ DnwMR2FRHfFrn2EFLjZDL1j1UfLfL5v/WK4Brt5ai04AJBhww9fcSiS3PYmsBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxLYc4WdYz1BVR for ; Thu, 16 Apr 2026 14:51:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1ca84 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 14:51:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 70e27ecba518 - main - virtual_oss: Introduce virtual_oss_default_control_device rc variable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 70e27ecba51892cbe4cc94bbf785c6dd261dfd57 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 14:51:16 +0000 Message-Id: <69e0f764.1ca84.2b51b9f1@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=70e27ecba51892cbe4cc94bbf785c6dd261dfd57 commit 70e27ecba51892cbe4cc94bbf785c6dd261dfd57 Author: Christos Margiolis AuthorDate: 2026-04-16 14:51:02 +0000 Commit: Christos Margiolis CommitDate: 2026-04-16 14:51:02 +0000 virtual_oss: Introduce virtual_oss_default_control_device rc variable The -t option gives the user the ability to create a control device for a given virtual_oss(8) instance, so that the instance's configuration can be manipulated during runtime with virtual_oss_cmd(8). As is expected, the control device's name is not known, since it is specified by the user. This patch introduces a virtual_oss_default_control_device rc variable, which defaults to "vdsp.ctl". The goal of this is that third-party programs and scripts can access the control device of the default virtual_oss(8) configuration without guessing. This is especially useful for sbin/devd/snd.conf which deals with hot-swapping sound devices using virtual_oss(8). Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D55670 --- libexec/rc/rc.d/virtual_oss | 6 +++++- sbin/devd/snd.conf | 14 ++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/libexec/rc/rc.d/virtual_oss b/libexec/rc/rc.d/virtual_oss index d55b51463442..a25abf256f55 100644 --- a/libexec/rc/rc.d/virtual_oss +++ b/libexec/rc/rc.d/virtual_oss @@ -25,6 +25,10 @@ required_modules="cuse" configs= pidpath="/var/run/${name}" default_unit=$(sysctl -n hw.snd.default_unit 2> /dev/null) + +# Default configuration's control device. +: "${virtual_oss_default_control_device:="vdsp.ctl"}" + virtual_oss_default_args="\ -S \ -C 2 \ @@ -35,7 +39,7 @@ virtual_oss_default_args="\ -i 8 \ -f /dev/dsp${default_unit} \ -d dsp \ - -t vdsp.ctl" + -t ${virtual_oss_default_control_device}" # Set to NO by default. Set it to "YES" to enable virtual_oss. : "${virtual_oss_enable:="NO"}" diff --git a/sbin/devd/snd.conf b/sbin/devd/snd.conf index 5ca0be86e246..e2dc6d94a299 100644 --- a/sbin/devd/snd.conf +++ b/sbin/devd/snd.conf @@ -7,12 +7,8 @@ notify 0 { # Other audio servers or device switching commands can be used here # instead of virtual_oss(8). - # - # FIXME: We are hardcoding /dev/vdsp.ctl here, simply because it is a - # common virtual_oss control device name. Until we find a proper way to - # define control devices here, /dev/vdsp.ctl can be changed to the - # control device of choice. - action "/usr/sbin/virtual_oss_cmd /dev/vdsp.ctl -R /dev/$cdev"; + action "/usr/sbin/virtual_oss_cmd \ + /dev/$(sysrc virtual_oss_default_control_device) -R /dev/$cdev"; }; notify 0 { @@ -22,7 +18,8 @@ notify 0 { match "cdev" "dsp[0-9]+"; # See comment above. - action "/usr/sbin/virtual_oss_cmd /dev/vdsp.ctl -P /dev/$cdev"; + action "/usr/sbin/virtual_oss_cmd \ + /dev/$(sysrc virtual_oss_default_control_device) -P /dev/$cdev"; }; notify 0 { @@ -32,5 +29,6 @@ notify 0 { # No connected devices. Disable both recording and playback to avoid # repeated virtual_oss error messages. - action "/usr/sbin/virtual_oss_cmd /dev/vdsp.ctl -f /dev/null"; + action "/usr/sbin/virtual_oss_cmd \ + /dev/$(sysrc virtual_oss_default_control_device) -f /dev/null"; }; From nobody Thu Apr 16 14:51:17 2026 X-Original-To: dev-commits-src-main@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 4fxLYf0rC0z6Zmyp for ; Thu, 16 Apr 2026 14:51:18 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxLYd68gdz4GFm for ; Thu, 16 Apr 2026 14:51:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776351077; 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=YFGM+SBuKGU73uUNK32Bby7GrFPMc9nvyFAPJlwLtpE=; b=emL6cm1JQQ9Ppn3fRpNw6H+eu02CIi25Wi9Ea34kZLQF68SgowFQ1CbInfTjN6ZLeySYuW C28KlYkujxAAHxSDB8UF5levWomB1cCOMZCaKgHzMiSAOaicQo47dgAGjmRQ0H7A67x6jL bCwnJClxgqDUmMTbgYTZumYBUCoo8kIYfg5EsUOMEDTCEyITkGdEVtzOYzsqbalP39V3Xx xnaRxtsfED5AsLDP0fdY6pToSNJ6ShbmDMiCDb6IGOlL5uHxVnlkwsdUV78+hYF24iDWOJ 8gBTP0274zoWwu4WyEhqQJ1JBr/1g09nK+aqVMOSIpCXIImzv6vq8Nj2+Wd/kg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776351077; a=rsa-sha256; cv=none; b=QMzIvpS8Xzl6O9kIiufqYerBtXdGA2xI/0fAVWiEykv9F2ccB3ndpQODIDBNTw4fPjRAQK 5MQqDSpwF6EECozQcx1KRF3CUPUiBk3L/gIuEXDwPmoS18A9Gi43Lo7utKuzpORF9sIyDn D4vGTdTRVfctOMmQwV4UFpaZbSRBKyQNWfuQlXHvwTP9JkQZeJYYLNNywWQel8KBFIxdU8 4+lkDo+BT47ajemlUUDEPImRQMpqwVpATtZn33uAFazLDrQD3KR95vuYh0BMFQQZRaxtOK hyUgWWdFKyyUUMm3T1Ztg6hzGgmdufIRPjL3ZtixIMYUXrzjJH17+dU592VA0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776351077; 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=YFGM+SBuKGU73uUNK32Bby7GrFPMc9nvyFAPJlwLtpE=; b=kT+b9gL+nYLyU3e6kVC+w4voveoyQ4LDuSG/OX44SQTB68fQ2D+zPv8197uFFkHpsCLYVt hx+Z1YeS/x0EtjwsSfefP/mKgQrTRTHv1+8l/Bxb1xFJER3pdYcnLZc8K4FCjEtGE6WQeE zQzQsdeYLJW98npVNfBniJNsNdzxS7ZhpR4iQked/CPkVkop+/3JmunIH8mceH2vLoysw+ eCdWGAVhUhM/5fj7v1c3ZrHe7278S/b5dlBpEzYjqLelahpCwSY5sFdi6fPO+3kkl8tEpc FTmcw1j6GI83ItJPcTZPPlD9hj2CgHMJxMBOP7WXSsk4+SZZDjNrqwWxYaDnag== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxLYd5KFGz1BGD for ; Thu, 16 Apr 2026 14:51:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c559 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 14:51:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: a3094f522fec - main - rc.conf.5: Document virtual_oss(8) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3094f522fec70f9e5cf3f12dc6e7a9b5f706459 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 14:51:17 +0000 Message-Id: <69e0f765.1c559.1b96b4a5@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a3094f522fec70f9e5cf3f12dc6e7a9b5f706459 commit a3094f522fec70f9e5cf3f12dc6e7a9b5f706459 Author: Christos Margiolis AuthorDate: 2026-04-16 14:51:06 +0000 Commit: Christos Margiolis CommitDate: 2026-04-16 14:51:06 +0000 rc.conf.5: Document virtual_oss(8) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56225 --- share/man/man5/rc.conf.5 | 57 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index fa8d8aab8c4e..b666345def48 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd November 14, 2025 +.Dd April 2, 2026 .Dt RC.CONF 5 .Os .Sh NAME @@ -4950,6 +4950,60 @@ For instance, the file is created to prevent .Xr shutdown 8 targeted at the wrong machine. +.It Va virtual_oss_enable +.Pq Vt bool +If set to +.Dq Li YES , +run one +.Xr virtual_oss 8 +instance for each configuration defined in +.Pa virtual_oss_configs . +.It Va virtual_oss_configs +.Pq Vt str +Space-separated list of +.Xr virtual_oss 8 +configurations. +For example: +.Bd -literal +virtual_oss_configs="foo bar" +.Ed +.Pp +Configurations need to be defined in +.Pa virtual_oss_ Ns Aq Ar config_name . +By default, there is a +.Pa dsp +configuration which replaces the +.Pa /dev/dsp +device created by +.Xr sound 4 +with a +.Xr virtual_oss 8 +one. +It can be redefined by setting the +.Pa virtual_oss_dsp +variable. +.It Va virtual_oss_ Ns Aq Ar config_name +.Pq Vt str +.Xr virtual_oss 8 +argument list for configuration +.Aq Ar config_name . +.It Va virtual_oss_default_control_device +.Pq Vt str +The +.Xr virtual_oss 8 +control device's name corresponding to the default configuration, +.Pa virtual_oss_dsp . +This is set by default to +.Pa vdsp.ctl . +When +.Pa virtual_oss_dsp +is set, it is strongly encouraged to set this variable as well, and use it as +the +.Fl t +option's argument in +.Pa virtual_oss_dsp , +because it is used by other programs and scripts, such as +.Pa /etc/devd/snd.conf . .El .Sh SERVICE JAILS The service jails part of the rc system automatically puts a service @@ -5170,6 +5224,7 @@ to .Xr unbound 8 , .Xr usbconfig 8 , .Xr utx 8 , +.Xr virtual_oss 8 , .Xr wlandebug 8 , .Xr yp 8 , .Xr ypbind 8 , From nobody Thu Apr 16 16:15:43 2026 X-Original-To: dev-commits-src-main@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 4fxNR41dB2z6Zvw4 for ; Thu, 16 Apr 2026 16:15:44 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxNR412nmz3R2C for ; Thu, 16 Apr 2026 16:15:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776356144; 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=/6UVwGGuUKgRUSWcOlb7X2oG6+dztF4rWb3WoycHGNE=; b=rq3kuboERkbOHf3GEBr3BAgFTZsU1YJBbdqgEOb5bYkZ+KHXegOa39NwwnTEUJ6dS+Wabl EbbetenfMEqhqtcxaN/aywgK4hOmRhopME+6ySaHFYla6rubseFw+uc3jPuCOwpmpAosOC v1GGx+sAFfUdCS95SR20f47NXOnPDHY1SvtFUzdt+VjJc2tRmhHx1H/Dt7ba7aFobp4o72 ayltTZONCJtDSK3nnzqS5IdB6KfZ4zJcPp/w601uJJS3q6lapWgQYOv5HD92Inbu9Kwa2C +oHCE2PYIicxo1PgcuH1R25ELhQCN148NFRy/mZNEExnwHcS+NoO8fk9WeFBxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776356144; a=rsa-sha256; cv=none; b=fGlGjOxKdgQ9iFtpwNuvWqGSrNo3ial2bOwiVD4qErgd483x3+8kqjpwXvAcrHXMElqeK7 HY5abonDDyu4XpP+4cOHok8ZtB3zfeJlk8sUcJPEnWOaiOzUKN2QUSNzLyMCQyGIVj5gsy TAA9N/yqK47GkZPm8vc6TGC3z1yLxmoyZxI5fRqr/7VMXk2fxI9rbkJbPB3d2QvElZwDM4 SP+9Py/3Ksrg/HwT0luLdgPZx7/kaTflIw0jVepkgejkUWgdGVwdFTkq37b4lq6HNNLYd4 Z3c3rPjspmqVnPjR/IR3abKjtkoB7vlcbEvUZzguUw1wKEjMpnZNiHbUWQcxng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776356144; 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=/6UVwGGuUKgRUSWcOlb7X2oG6+dztF4rWb3WoycHGNE=; b=Sk/V4COQVtCGvghjv9xl3uVmdTzDwtTKWYbJqLeaWHYii2KTDmPSKaEBmVBSxKrYhmTQji PfvKU0niujLjNIpjeJeAianKthyaO1cRMwn1P0WG2/xdph7vbKE1ZL0MnW7qbZgmYaMBML B6vC41CvLntqEdrVIwl/C5+NM3pE7Ua5AYmWxDxT9ASyg57/h1MBG2sbpIF29Exb6ojAo/ ic+lW8u1KErX4qBKjTW/tCtH5t1fK1K1L3Wmns8DiODo6KpwTEB3cwux91Pot7f51vuMFa InJmivAPEjNXRxrMuxfpti4FPdZHBehA9c/4PUwgw7ITbNJFlqrc1VUxKJnVYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxNR372Rwzkk for ; Thu, 16 Apr 2026 16:15:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 25362 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 16:15:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 47b0ac1cadc9 - main - OF_getprop.9: update OF_hasprop() signature List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47b0ac1cadc91eee5e98813169b590c443135fbc Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 16:15:43 +0000 Message-Id: <69e10b2f.25362.4e5f98b8@gitrepo.freebsd.org> The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=47b0ac1cadc91eee5e98813169b590c443135fbc commit 47b0ac1cadc91eee5e98813169b590c443135fbc Author: Mitchell Horne AuthorDate: 2026-04-16 15:57:48 +0000 Commit: Mitchell Horne CommitDate: 2026-04-16 16:15:40 +0000 OF_getprop.9: update OF_hasprop() signature The return type has been converted to a bool. Reported by: manu Sponsored by: The FreeBSD Foundation Fixes: b60cd486a652 ("ofw: bool-ify OF_hasprop()") --- share/man/man9/OF_getprop.9 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/share/man/man9/OF_getprop.9 b/share/man/man9/OF_getprop.9 index 3bb0068e3dc2..8c93d92bf73b 100644 --- a/share/man/man9/OF_getprop.9 +++ b/share/man/man9/OF_getprop.9 @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd June 23, 2018 +.Dd April 16, 2026 .Dt OF_GETPROP 9 .Os .Sh NAME @@ -52,7 +52,7 @@ .Ft ssize_t .Fn OF_getencprop "phandle_t node" "const char *prop" \ "pcell_t *buf" "size_t len" -.Ft int +.Ft bool .Fn OF_hasprop "phandle_t node" "const char *propname" .Ft ssize_t .Fn OF_searchprop "phandle_t node" "const char *propname" \ @@ -138,11 +138,15 @@ if the property does not exist. must be a multiple of 4. .Pp .Fn OF_hasprop -returns 1 if the device node +returns +.Dv true +if the device node .Fa node has a property specified by .Fa propname , -and zero if the property does not exist. +and +.Dv false +if the property does not exist. .Pp .Fn OF_searchprop recursively looks for the property specified by From nobody Thu Apr 16 16:15:45 2026 X-Original-To: dev-commits-src-main@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 4fxNR53Sppz6Zvr0 for ; Thu, 16 Apr 2026 16:15:45 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxNR50mZPz3R2D for ; Thu, 16 Apr 2026 16:15:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776356145; 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=js8jROihnoHRbaMATUySoIcFTD3x3SKbNHglyk2LqkM=; b=Mt39ykefke5OMYUOSI3SFm6BQSs9WivrlvZgiuqRyhqwWfZMGyk9hGiISruv63AZxqKvb+ hnIsi8AQf7nMly25Snc+WmS80Aoeftu68EQp5BY8HJ8Jip9wxqQCponof8wRrwN3c1mfgJ JiHgwzmi64m/sD+YeNb9RCq4cTyLH+crTg91+oxJNj2hLu3LbJqcfWWJcOUfUPpgUTOdVQ D8a09N7LzsS6Dn0c3mM313zHm43XR4dtYYlFauijlH0KXXU0WMVGSCzJTHvuVF8OVytgmO OLyeRycm2at/aULfuTWBWBUI9+xk/WFWdjlefP/OQ98l27oyJacpP42Fjj7i8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776356145; a=rsa-sha256; cv=none; b=IewTGKZ4j5sS/O0rdeWjw1Sf/etMwx4od91kBsjHs3wM1tmfUST2P4xMAXzYQmDulGu3gt 7kkMRcyfW6zxm/lMf5VvvUetAzrbs74aSXuphw3Yor3x3nLzrYGl876gTOaNC8wX4MlmxD UeIFJoIZHIj+YyGWDWbWwEBx6EuB5MmsEtRbuB851FwhJWvp9yAv80CThnUp0G65G1ukRj Miwq8C+StZeIIr/WyVN1k5hB0PDFrkpaHNasMuY0ZOU9kFyOJKm9nh8CGGa1UxDXyBlSpo sBXTQq5GgNt2YMUr20HJy8w3gHGZj7anaHMosqrTbsqmP15PQsgFXvBcigG5Zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776356145; 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=js8jROihnoHRbaMATUySoIcFTD3x3SKbNHglyk2LqkM=; b=Hl/bHBY+NEOBJYWUawZMnyK6hMbrjLZ9rGNv3OoVnUzoZdgs178XeCfKhA3lDTGOggfc8B 8JcGsR1CCqVycrj84aM1xB2biLxIyAbUveabyEYvUfCqP1SKbvB9g3ewNJd0Qin7GWqiF7 3K/Z+6BWP1t3ApiMf73ENQX59EyZZzVtI7BVA6esQjJ0uUDtd9YxGaD/Bkxu7rH5RadEhq 0UiRY3mx3dr2wLNRMyj9R7z+8t3P+iPz89/jz/1TsLrmL1N9gNCa2nI7Fe3Db0d4heuhjp Qpho0aQYf0JpCKch+nS3jsmDYt4MO4rTEL7i/WezJMfI13jj8K8DiPIUsjrlEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxNR507Wvz77 for ; Thu, 16 Apr 2026 16:15:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 258e2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 16:15:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: ce6b4973ba8c - main - raspberry_virtgpio: fix OF_hasprop() usage List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce6b4973ba8c6503d3b6dc12d9e6b42ce274d912 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 16:15:45 +0000 Message-Id: <69e10b31.258e2.7c6936b6@gitrepo.freebsd.org> The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ce6b4973ba8c6503d3b6dc12d9e6b42ce274d912 commit ce6b4973ba8c6503d3b6dc12d9e6b42ce274d912 Author: Mitchell Horne AuthorDate: 2026-04-16 16:05:25 +0000 Commit: Mitchell Horne CommitDate: 2026-04-16 16:15:41 +0000 raspberry_virtgpio: fix OF_hasprop() usage The function returns a bool. This driver was merged recently (by me) and I missed this instance. While here, adjust the ofw_bus_status_okay() call similarly. This function still returns an int, but this usage is more widely used in our drivers. No functional change intended. MFC after: 3 days Sponsored by: The FreeBSD Foundation Fixes: b60cd486a652 ("ofw: bool-ify OF_hasprop()") --- sys/arm/broadcom/bcm2835/raspberrypi_virtgpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/arm/broadcom/bcm2835/raspberrypi_virtgpio.c b/sys/arm/broadcom/bcm2835/raspberrypi_virtgpio.c index 64ce6fda6306..797896a7f22b 100644 --- a/sys/arm/broadcom/bcm2835/raspberrypi_virtgpio.c +++ b/sys/arm/broadcom/bcm2835/raspberrypi_virtgpio.c @@ -206,14 +206,14 @@ rpi_virt_gpio_probe(device_t dev) union msg_gpiovirtbuf cfg; int rv; - if (ofw_bus_status_okay(dev) == 0) + if (!ofw_bus_status_okay(dev)) return (ENXIO); if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) return (ENXIO); gpio = ofw_bus_get_node(dev); - if (OF_hasprop(gpio, "gpio-controller") == 0) + if (!OF_hasprop(gpio, "gpio-controller")) return (ENXIO); /* Check whether the firmware is ready. */ From nobody Thu Apr 16 16:18:00 2026 X-Original-To: dev-commits-src-main@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 4fxNTj5jKvz6ZBFH; Thu, 16 Apr 2026 16:18:01 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxNTj3yGTz3Rpb; Thu, 16 Apr 2026 16:18:01 +0000 (UTC) (envelope-from mhorne@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776356281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/JsKx4pyZnYdqPy4UscHkt4Xk/jNt4XhzzZXiO2D4vM=; b=cBJ3ubrMYZnTJhk5bkDGjURf6T9yJ5UGF3CsC8BXVb1CmdSy2IXBW6ZOuKSK9evEhuTHH9 mAyjYI53eJD7kr96jgQYY7izlnF+oc3HFWmIq4fuwxevUrbmdlw1KFZk1HMSDqDHTWbA8j vnVG+1YHIuPn/ezpigEQj0jceTdC5ObCzgjOhYFIUGFL9/Lnpyx4A8WihD4is61dUX8w1O MhcY+daMV/beffD1jiF8YgGVDMsdpOb68yJO4n7Gaeh8F1DyjIeUdvYRZ4V0IeycIXhXxw 208hSZuMYHTWnClMfd5YTJIcDk1jDWJgr5lIp02xkmwjM/inZX3wcTKJn6FjyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776356281; a=rsa-sha256; cv=none; b=YY2FywtsKuccWNx+Je/TO7x/dIyayqt8UrJmoyXd2wPz+fUChspcVHXId2jIEJphaxambM y+lm+cnQ+im0J0hLimke7qp919cyY9jWJsuZX1YXKuUmCV2qLJILn8A0xfeqSxziGQJD4Q xGHB19HfudZFPf7UkyyVv+TZKP7/qBhJUdJuNzneckPd7lQoOU3b3aGUqqApPwZND+9EQl qyo6Yzbc24CQtoeE3mWy0x9bpGUMMDwAIJPpHM2GydAG+En4SQ+nDYCiOdRVSC3W4d0OAQ gOreL3bUs10ktm5n6+MFZfwiDIWJocZH3DF5rERd/Aw2JNf5zYFPVcQczfgFWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776356281; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/JsKx4pyZnYdqPy4UscHkt4Xk/jNt4XhzzZXiO2D4vM=; b=KK9E5tS+A1hLD6RDUBjxRv6IfcEvohMTu+jDY6jquqwTIv/QO+rinevmFhcruomT+TGZjR Wi9PaiPOCzOGBUouPuchwAiFhrNBD8ig7lxLDZXSe10dSNgy7MWl3+JWAmAATTzzImkqBN zyxEKbbXGPseFSLvCDSx7VwoK4JWfHSOfW298ENoMNutgxnGL8uZmkxWKEZibJo7EYp0Zn vUWUvlGr3/9/zkKZ4hZDgv7uePGpceH9IupAaY3zqcURwW37awFAvxI6bT1DLqIpm5IK+Z 8g4biSCiK3lo2y7UJ+dgJnvIiaAlV4DsvJhIvPrndF08m3bpYgrJd4ETICc/QA== Received: from [192.168.2.224] (chtwpe0124w-47-54-102-213.pppoe-dynamic.high-speed.pei.bellaliant.net [47.54.102.213]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fxNTj13Zwz8DM; Thu, 16 Apr 2026 16:18:01 +0000 (UTC) (envelope-from mhorne@freebsd.org) Message-ID: <0df68e39-3024-4c9e-8acd-118d2ba87470@freebsd.org> Date: Thu, 16 Apr 2026 13:18:00 -0300 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: b60cd486a652 - main - ofw: bool-ify OF_hasprop() To: Emmanuel Vadot Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <69e0f061.19306.b179267@gitrepo.freebsd.org> <20260416171256.6658ac4f10a305c03724c9c9@blih.net> Content-Language: en-CA From: Mitchell Horne In-Reply-To: <20260416171256.6658ac4f10a305c03724c9c9@blih.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 4/16/26 12:12, Emmanuel Vadot wrote: > > Hi Mitchell, > > On Thu, 16 Apr 2026 14:21:21 +0000 > Mitchell Horne wrote: > >> The branch main has been updated by mhorne: >> >> URL: https://cgit.FreeBSD.org/src/commit/?id=b60cd486a652f0427e525b4482ac598be5460459 >> >> commit b60cd486a652f0427e525b4482ac598be5460459 >> Author: Mitchell Horne >> AuthorDate: 2026-04-16 14:12:41 +0000 >> Commit: Mitchell Horne >> CommitDate: 2026-04-16 14:12:41 +0000 >> >> ofw: bool-ify OF_hasprop() >> >> Adjust the function signature and the few callers that don't treat it >> this way already. >> >> This is style only; no functional change intended. >> >> Reviewed by: andrew >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D56203 > > Thanks, it makes more sense, could you also update the manpage please ? > > Cheers, > Good catch, thank you. Fixed in 47b0ac1cadc9. I spotted a couple other issues. Please look quickly at https://reviews.freebsd.org/D56429. Mitchell From nobody Thu Apr 16 16:30:50 2026 X-Original-To: dev-commits-src-main@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 4fxNmW0WYTz6ZC39 for ; Thu, 16 Apr 2026 16:30:51 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxNmV5vwcz3SgN for ; Thu, 16 Apr 2026 16:30:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776357050; 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=3TvRydS0dc7vHO7fxP8OfREY1tHYPngZZooznEmpyA8=; b=WRves781H409y4Ju7yKsaMoTt0LjpgEHCXjE+qcg5DmW5KHKAc5rSt+ILiRngMWrxvgWyA FNTPHHwD7/wYnVOndQnu/QDVxCXxstHBBD4zxx5DkHOOLGGRLmeHTeTFU00mXI+b4wXa7m IiskwbXLzhOxn6O43bS3r3vovE8tbhOsjb0CWgSiY/beET1OPoZljdQThXjWDidmOubMTs ywn8taB+DAMZ39I+7KvKjuJskkoEtDXsC4ZZLNBbcKKA4Ok/6cJ1hTm9SIkFpSuZcM4ZDA GTW7wVfMFp7nvYNcvKO1k0/kRklmeI+jCorvUbWk+jAzicjHOdvt5y75Lfq64A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776357050; a=rsa-sha256; cv=none; b=Duv+7YifJvB7sOwZ6THHh4mJ5tqu8ZEuEhQhoVhYhC9ko/KuCXqksiuFoeO3rUbU26Us1T Y32XUxghNCzEkklTF4s06kBDXAiFDnXapVVROUbDBACemSNNhwzv6IsNwKZ4K2hTgyCFNr ANHyoOPHx1B7zSfn8ttvCM23f+zbaY7ZZMqgFfLiFdVpInoM0YyTzhjHT58D4V+823lKCB W4QD/rqzaBIzjDuqjyHUXHbH4jUF9Xpbc5FIHCuXd3pN1nTF1iX/eJq584Y0ymDPu++Lj1 yf9oV+8iycgTuebUN+jIDss4ADMxVp6TmTW9DXp8vaCi1KBQrFVn71MVGY+rHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776357050; 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=3TvRydS0dc7vHO7fxP8OfREY1tHYPngZZooznEmpyA8=; b=kbRw9/78YVohrWczvdzc/dBsTI1zJZYfstlgWEayicHX8/50Rjhr8n0A/LbOPOXoGCiyac lPKsbq2fR5HUlar/QW1RCULDVW/amdI8l8nRTOIhVNgVhq+zOH1PQjZkhXfPE8UNHXMccD GeTq4rQcmBKtxXFRsk+nQcxYRHhNQEw0iPbcJ07XGpmJlR5IubZx7aF5BWj7IEuTuTt/jt 364Fn+oqoksla6QVV8X64FSNHZYZoihXJbf7K5PzKzMdLix9Wg+WZlITeUoPtITzYVTMFX XS5c65FnFHUpa7sdR9RZbE3WkUYp/MbF41m84AXvgssr0GgHUFgMsrbhQIe7Uw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxNmV5LB4z14Z for ; Thu, 16 Apr 2026 16:30:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 268b7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 16:30:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: ce33f96fcf2f - main - mlx5e: Ensure rx timestamps are monotonically increasing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce33f96fcf2f2d0d49c406274bcc64df72fe530e Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 16:30:50 +0000 Message-Id: <69e10eba.268b7.77f6bdc6@gitrepo.freebsd.org> The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=ce33f96fcf2f2d0d49c406274bcc64df72fe530e commit ce33f96fcf2f2d0d49c406274bcc64df72fe530e Author: Andrew Gallatin AuthorDate: 2026-04-16 16:26:07 +0000 Commit: Andrew Gallatin CommitDate: 2026-04-16 16:27:27 +0000 mlx5e: Ensure rx timestamps are monotonically increasing The clock calibration routine currently can result in rx timestamps jumping backwards, which can confuse the TCP stack. Ensure they are monotonically increasing by estimating what we'd calculate as the next timestamp and clamp the calibration so new timestamps are no earlier in time. Reviewed by: kib, nickbanks_netflix.com Tested by: nickbanks_netflix.com Differential Revision: https://reviews.freebsd.org/D56427 Sponsored by: Netflix --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index fb8b79c8f787..9bcb0dcf8e16 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -1134,6 +1134,25 @@ mlx5e_hw_clock(struct mlx5e_priv *priv) return (((uint64_t)hw_h << 32) | hw_l); } +/* + * Seed the first calibration point so that base_prev and clbr_hw_prev + * are always valid. Called once during attach before the first + * calibration callout fires. + */ +static void +mlx5e_seed_calibration(struct mlx5e_priv *priv) +{ + struct mlx5e_clbr_point *cp; + struct timespec ts; + + cp = &priv->clbr_points[0]; + cp->clbr_hw_curr = mlx5e_hw_clock(priv); + nanouptime(&ts); + cp->base_curr = mlx5e_timespec2usec(&ts); + cp->clbr_hw_prev = cp->clbr_hw_curr - 1; + cp->base_prev = cp->base_curr - 1; +} + /* * The calibration callout, it runs either in the context of the * thread which enables calibration, or in callout. It takes the @@ -1147,6 +1166,9 @@ mlx5e_calibration_callout(void *arg) struct mlx5e_priv *priv; struct mlx5e_clbr_point *next, *curr; struct timespec ts; + uint64_t hw_delta_new, hw_delta_old; + uint64_t old_nsec, old_projected, old_sec; + uint64_t res_n, res_s, res_s_mod, rt_delta_old; int clbr_curr_next; priv = arg; @@ -1175,6 +1197,33 @@ mlx5e_calibration_callout(void *arg) nanouptime(&ts); next->base_curr = mlx5e_timespec2usec(&ts); + /* + * Ensure monotonicity across calibration transitions. Compute + * what the old calibration would extrapolate to at the new + * hw_curr. If the new base_curr is less, clamp it so the new + * slope is at least as steep as the old one. This prevents + * packets from seeing time go backwards when the slope drops. + * + * Use the same split-seconds technique as mlx5e_mbuf_tstmp() + * to avoid overflowing uint64_t in the multiplication. + */ + hw_delta_new = next->clbr_hw_curr - curr->clbr_hw_curr; + rt_delta_old = curr->base_curr - curr->base_prev; + hw_delta_old = curr->clbr_hw_curr - curr->clbr_hw_prev; + old_sec = hw_delta_new / priv->cclk; + old_nsec = hw_delta_new % priv->cclk; + res_s = old_sec * rt_delta_old; + res_n = old_nsec * rt_delta_old; + res_s_mod = res_s % hw_delta_old; + res_s /= hw_delta_old; + res_s_mod *= priv->cclk; + res_n += res_s_mod; + res_n /= hw_delta_old; + res_s *= priv->cclk; + old_projected = curr->base_curr + res_s + res_n; + if (next->base_curr < old_projected) + next->base_curr = old_projected; + curr->clbr_gen = 0; atomic_thread_fence_rel(); priv->clbr_curr = clbr_curr_next; @@ -4887,6 +4936,7 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) callout_init(&priv->tstmp_clbr, 1); /* Pull out the frequency of the clock in hz */ priv->cclk = (uint64_t)MLX5_CAP_GEN(mdev, device_frequency_khz) * 1000ULL; + mlx5e_seed_calibration(priv); mlx5e_reset_calibration_callout(priv); pa.pa_version = PFIL_VERSION; From nobody Thu Apr 16 17:46:27 2026 X-Original-To: dev-commits-src-main@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 4fxQRm0Skwz6ZKCf for ; Thu, 16 Apr 2026 17:46:28 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxQRl75Wjz3dsL for ; Thu, 16 Apr 2026 17:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776361588; 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=jNry6h56fVmdrg6F4Q5CQrxTfXmNcHL+MFDn+/wzE9w=; b=ytcuiPLh++kbFApusrmKkHQGOimL7HFX3MwanCHQLc9poqIt9lpeepq/etzs6X1EftRLuG m8TUq3Hn6OJbN73xEukoGDpROFOr6Mf2P1ilojmxAwgNt6fp5l/6ymTl8tiDYg+FnXSYjQ QRkT6eAmFsC67igSILkerZYOiRP/dEY6rUDVQKkOnSw6wLeX7BhcbEZOC8ilMw56Wkh/ko /oYnDcSJyz2RYhkAYxgYwTYkMginVAsZnDMzgJeGaY9nqDIjUtbPFGsDo4RbWwYKiS0IOs 7mBedozvrKOpElOfT7wCw05fwP3z8Bq95DJjLo9RblpLzw01NAP5T/iAhrRUFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776361588; a=rsa-sha256; cv=none; b=IFuLic4gMgwHgAQCAsgZGc+oRmVbjJt7tA5VU9SV6P5usS/jMJYq0G5iicbQPHDrLGC+Gj CNysuwfhipLiLun2XWBwBJyQ+T19RzgZrcsVklduQauo5nf8G5xZY4ZOrufJN9DzNpgGoP uYOEAuRSgo7JGkSyvIsL5IRWKOFKUyjTPQsJXqM/1bvUB7Y6tdJlrB6gT2sGff0MzE+qWb hLfkD3vALz4Ff1f2mw3a0TuJQOfUhS+aJpmeDC+m0/NH5RpDchyD4/+zG47S08i0xsbqLD aZHKWgV+Da6Zu20CZqw0FRDjAuWnpYDeByT01COQ5TkHSl9JNc5Jpd+EqgN86g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776361588; 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=jNry6h56fVmdrg6F4Q5CQrxTfXmNcHL+MFDn+/wzE9w=; b=NLMa/TgePrD+0Exd8/xs4Ez99sj+9KpDH5mz2YvRsVfWwIkcE8fKUAONGazKfhVrXwaoBs roY+v5r6zzjIAibStk/IPb6IBJD8HT9MJQWfjRo1fKRgKxFkgwZGwX3hgdIFYvpF3NR6QV vBPGS/VSqmxfoxwni0LruOYE8cxSyiZDK0cKdC3grjJcuKvBLsl5e/RvksBph95s4Kt5Uj TBQHtovPOvIG1yA70NgAe5YCF+h68ZA9Mpez1F+bw57AfgLTYZkuylGgoz7nors/WLwwfR JOshJhaK7VWVsKLbmT/zooP+oKGFfgfk/9RnVn7fMWGlt4TsKIQeNF0HsdWvHQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxQRl6PXzz2d1 for ; Thu, 16 Apr 2026 17:46:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35df1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 17:46:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: fe6bf738aaeb - main - pkru.3: Remove a qualifier List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fe6bf738aaeb3d5fd74aabfcbf01eba827df6594 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 17:46:27 +0000 Message-Id: <69e12073.35df1.4c5897cf@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fe6bf738aaeb3d5fd74aabfcbf01eba827df6594 commit fe6bf738aaeb3d5fd74aabfcbf01eba827df6594 Author: Mark Johnston AuthorDate: 2026-04-16 17:46:05 +0000 Commit: Mark Johnston CommitDate: 2026-04-16 17:46:05 +0000 pkru.3: Remove a qualifier Now that i386 kernels are deprecated, we don't really need to mention this limitation. It's also a bit dated since PKRU is supported with 5-level paging as well. Reviewed by: alc, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56415 --- lib/libsys/x86/pkru.3 | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/libsys/x86/pkru.3 b/lib/libsys/x86/pkru.3 index 95bc66c979ac..06837a39858d 100644 --- a/lib/libsys/x86/pkru.3 +++ b/lib/libsys/x86/pkru.3 @@ -79,9 +79,6 @@ protection, it returns the error code. Note that some side effects may have occurred if this error is reported. .Pp -Protection keys require that the system uses 4-level paging -(also called long mode), -which means that it is only available on amd64 system. Both 64-bit and 32-bit applications can use protection keys. More information about the hardware feature is provided in the IA32 Software Developer's Manual published by Intel Corp. From nobody Thu Apr 16 17:46:28 2026 X-Original-To: dev-commits-src-main@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 4fxQRn2DvBz6ZK91 for ; Thu, 16 Apr 2026 17:46:29 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxQRn0CxDz3dsM for ; Thu, 16 Apr 2026 17:46:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776361589; 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=W81MTl/A0V1SEuMKTXFEL2RixrnKQYvV8H3cMC32qDk=; b=MVdk8eNtr5GjxrB+e7E7zU2Mpmo/GJX0M+m4huwy2KM1yxvLvIyChHGZYPa1MV8y7o9Lqq m+asnGyX2VQ8hRsXqp/fyxGTMl7VS/E+mLOGLs89PP+RGhnno/QgDyO7FHsbtkyptSgvbC noro4fDPJv9w1fagNsi9bMqzbhrPI95sTQksJNx0DEmLGoZR10tlafZTrFi131PaBwi3Q2 2LzAL735ra6icpohCaEsF8vqRmgCFvD1RyXc4R5xbrCgpLaN6DH5dBe2pnGyU9IlQo3jmv w+HeIYi5793yHl4N05npirloVnvRPpjpZJ33gakJwOllr0MvqgRQfvpO2fXZdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776361589; a=rsa-sha256; cv=none; b=nGRkIo/PM0K8FJ1WLPoa6JXiCoJUzsrWaFlhvMxu8fOz1zzBqGQ2xIyP+rTASri7gGpS0p xxY7emtXM3IYsoQve4Jc2uA84ML3dZkPTT4bL16FZmNvqY+f4Hoy+5MGH3GDyDWoGV9Y/p AFU/P9mLKFJzY7TFR8v0WYxdmr5wu5ozZO7YSiXhJrNsBAlDe6PWXLDBTodgHB2cTVS5qO dxm1V9RnTvm1YYB79VBFK4d9BONKGsBWvvsMsyJ+jtbUqu/23EyiNHoRGoGAtGERZHLgs5 +mczo+lYpkHoSHj1Hsa6lkLgahl+uRLOAR0OUeB8mGk4Qaz3yLUw/yhJOOxDpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776361589; 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=W81MTl/A0V1SEuMKTXFEL2RixrnKQYvV8H3cMC32qDk=; b=YuOZ3XyQAWmHIOeVcjeudkg7BdJ3oYeQYLbGq46LSavV+AEfocNWmENyDKbhQ4BcibY62w hOj8UQECzurvLhxvbexGmXHM0VqMD1xjAWzgopW1cHHkmY7JE9aXugxhW4GvJg5pj6KGuZ ytLEkGiTgl0bQkG+ZYNtjN6BhAyILc3d1iVKqWXsZv2MJyvnDcntZdeCbPg1oyl0AQ/SQF oJmejRcl6UBNyLF/odR7RbSI5wgsYqchuq9tERcLzG1Trsc3ekxxIOsLtcBuAsOtVemdCh 9itBaEOp5PA7nl8IqanI+8IVF27wM002Nn45iJTY5vYdDulTwZOnFOiMult2aA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxQRm6g50z36f for ; Thu, 16 Apr 2026 17:46:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 35df5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 17:46:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: fa77fecb0e06 - main - pkru.3: Note that the kernel may not respect PKRU protections List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa77fecb0e06ec697e3d7a9ed899e568f1d2090c Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 17:46:28 +0000 Message-Id: <69e12074.35df5.2ea31c3d@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fa77fecb0e06ec697e3d7a9ed899e568f1d2090c commit fa77fecb0e06ec697e3d7a9ed899e568f1d2090c Author: Mark Johnston AuthorDate: 2026-04-16 17:46:11 +0000 Commit: Mark Johnston CommitDate: 2026-04-16 17:46:11 +0000 pkru.3: Note that the kernel may not respect PKRU protections There are cases where the kernel will be able to access memory covered by a PKRU key which nomially prohibits accesses. I believe regular copyin()/copyout() are subject to the contents of PKRU, but memory accesses via uiomove_fromphys() will not be. This can arise when performing fault I/O, for instance. I didn't test, but I suspect AIO is another case. Update the man page to acknowledge this. Reviewed by: alc, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56416 --- lib/libsys/x86/pkru.3 | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/libsys/x86/pkru.3 b/lib/libsys/x86/pkru.3 index 06837a39858d..75580953e6ed 100644 --- a/lib/libsys/x86/pkru.3 +++ b/lib/libsys/x86/pkru.3 @@ -71,13 +71,16 @@ Only one key may apply to a given range at a time. The default protection key index is zero, it is used even if no key was explicitly assigned to the address, or if the key was removed. .Pp -The protection prevents the system from accessing user addresses as well -as the user applications. -When a system call was unable to read or write user memory due to key -protection, it returns the -.Er EFAULT -error code. -Note that some side effects may have occurred if this error is reported. +If the user application attempts a memory access which is prohibited by the +PKRU register, the offending thread receives a synchronous +.Dv SIGSEGV +signal with +.Va si_code +set to +.Dv SEGV_PKUERR . +PKRU protections might prevent the kernel from accessing protected +user addresses when handling system calls, but this is not guaranteed and +must not be relied upon. .Pp Both 64-bit and 32-bit applications can use protection keys. More information about the hardware feature is provided in the IA32 Software From nobody Thu Apr 16 17:50:25 2026 X-Original-To: dev-commits-src-main@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 4fxQXK3bwfz6ZKRt for ; Thu, 16 Apr 2026 17:50:25 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxQXK37b6z3fwC for ; Thu, 16 Apr 2026 17:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776361825; 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=YzBqTkFlHRugsrw2AsgqbHLJ3R3KkE2OBk8zD8A38Es=; b=OI87bfyfYIK5kC+vZLvx0jMkLiHYGAwQn+OoTnUPnMr094z1uGKM1EaA+NdB82T+ynEV8Q fkmLnAMLU6JL2ZVs6b+NaMdx/b3by0R7cMNl4GIcnwI51zt/bp5Ndff2+jeKl0ZmQp5PKK VbCgwLqPAavuYu3XBeH6U8xJkJZD5D7L9lukThiBTf3ClJzZ98fziFEo2e0d99bMvwFiO7 XoDjWWyL16p+1ZJMdzguX24fVgJz3eeno9LMPjvSJcnjwbu9zGSq3+7dEKoIn8JrUYFQIG 68waUW7U+GTgI4YHO/+YuzszAwaAkShqGElkPgIC+1ATZ5ODvYQSmWMBwaxU/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776361825; a=rsa-sha256; cv=none; b=HGvojHbiKCvVIqd7Cs50d46zjDxQWcILJSCbfG91uVEKDMsMkzdTJZHDcMlm1A2GzIBoXl au34DG8O8FsU3AMn5H8JvWjxP+NVEb9ArKQio91SkqAFh4I5cbxOK0ER8HsfKq7zAdDDAp CsLRlPFVOtynPYgArmd0gcy3FG4yUq5l3i/w7ldOhvK9dItTbMjm6MY25AWaKkWYOoDLYb 8tX4S53D+qKZ08qhKY8bdIs+SrtrGjH0865KijtCOQuuTUhytbH9F7y4ADqYI0HvXYet9q Xx6gKyo+zSlgV7IxNfyqi6ssIf6oA3snvoyW9gwGxKQZE6is5jK3rMCjuhseOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776361825; 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=YzBqTkFlHRugsrw2AsgqbHLJ3R3KkE2OBk8zD8A38Es=; b=tExsv0NyiTLiJC8vpU2bERS6tnCOe3GEItUfHRXIBi5gimW+0IrkqzuS2z3myaKcHzxhyU 75sLbQtUL65haALgKbG01d7fhAGGgyn4GaW7F07TIOZIqaUjrbjjbZdf5L85pZyoK/8T+A Nsh4gTlgBzFgSyvp+R3+Y+iAKhvLn1PnUcMjEBD+f7sZtwYZbxZtRFOIQQdxOPQO+2r3Sv N6G1UnVdKsjWFIoa7eedXfbZ9leFA8sk23KEo31bXseF1uuVmbEMrBP3pIv/7XG+cKmqN2 LFseHOEj6evzgBdhR4cgphnDPTIpc5cnVFFpUOhCm0PcE4DuHQ+tqbGwcBPMdw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxQXK2Y5Jz1tp for ; Thu, 16 Apr 2026 17:50:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 375b1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 17:50:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 48a05f833c7d - main - stand/libofw: make OF_hasprop() part of the library List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 48a05f833c7d0c089d37522cc234039ec823edf4 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 17:50:25 +0000 Message-Id: <69e12161.375b1.47fbd670@gitrepo.freebsd.org> The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=48a05f833c7d0c089d37522cc234039ec823edf4 commit 48a05f833c7d0c089d37522cc234039ec823edf4 Author: Mitchell Horne AuthorDate: 2026-04-16 17:48:46 +0000 Commit: Mitchell Horne CommitDate: 2026-04-16 17:50:14 +0000 stand/libofw: make OF_hasprop() part of the library Currently it is only needed by powerpc ofwfdt.c, and defined statically there. Make it available as part of libofw, mirroring what we have in the kernel. Two small tweaks are made to the implementation: 1. Return type is changed to bool 2. Return 'true' when OF_getproplen() == 0. This matches the expected semantics of the kernel version, described in OF_hasprop(9). Reviewed by: manu, imp, adrian MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56429 --- stand/libofw/openfirm.c | 7 +++++++ stand/libofw/openfirm.h | 1 + stand/powerpc/ofw/ofwfdt.c | 6 ------ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/stand/libofw/openfirm.c b/stand/libofw/openfirm.c index 1df65784e47a..ce4444262f6d 100644 --- a/stand/libofw/openfirm.c +++ b/stand/libofw/openfirm.c @@ -288,6 +288,13 @@ OF_getencprop(phandle_t package, const char *propname, cell_t *buf, int buflen) return (retval); } +/* Check existence of a property of a package. */ +bool +OF_hasprop(phandle_t node, const char *prop) +{ + return (OF_getproplen(node, prop) >= 0); +} + /* Get the next property of a package. */ int OF_nextprop(phandle_t package, const char *previous, char *buf) diff --git a/stand/libofw/openfirm.h b/stand/libofw/openfirm.h index 35d10c320b57..b4890762b0f9 100644 --- a/stand/libofw/openfirm.h +++ b/stand/libofw/openfirm.h @@ -89,6 +89,7 @@ phandle_t OF_instance_to_package(ihandle_t); int OF_getproplen(phandle_t, const char *); int OF_getprop(phandle_t, const char *, void *, int); int OF_getencprop(phandle_t, const char *, cell_t *, int); +bool OF_hasprop(phandle_t, const char *); int OF_nextprop(phandle_t, const char *, char *); int OF_setprop(phandle_t, const char *, void *, int); int OF_canon(const char *, char *, int); diff --git a/stand/powerpc/ofw/ofwfdt.c b/stand/powerpc/ofw/ofwfdt.c index eeb5f132a3f2..5422924a3b4c 100644 --- a/stand/powerpc/ofw/ofwfdt.c +++ b/stand/powerpc/ofw/ofwfdt.c @@ -32,12 +32,6 @@ extern int command_fdt_internal(int argc, char *argv[]); -static int -OF_hasprop(phandle_t node, const char *prop) -{ - return (OF_getproplen(node, (char *)prop) > 0); -} - static void add_node_to_fdt(void *buffer, phandle_t node, int fdt_offset) { From nobody Thu Apr 16 19:38:00 2026 X-Original-To: dev-commits-src-main@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 4fxSwS2zyQz6ZVmq for ; Thu, 16 Apr 2026 19:38:00 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxSwS2fL2z3xTM for ; Thu, 16 Apr 2026 19:38:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776368280; 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=+X6hm3JDpIOlFhMVZ6vVUew2i4rsK7XhY0/eIFzWMlU=; b=l8IXuERuxpGkxLh3MoQl++U+9NEOlLbiRD1vYC+x770W7GzreDPm286foaU3oEtaAaruln idEFb/RJ85D6N9mM6XgQxU9djCH1JJuh/Rb38kFujl4wDOjHMe2oDAa2ttCi8vOt4RpztP UAvhJrxOGJJtelD3gWAzXPZiePeeMRkRMKOdaFPiyTTQnkbV9JSwYzXhZXXtgz4RlyWmyz Nrqe5SxoPqIDZEXbmgFxiUjLDSN4fzSi0yw8DfGSLKj59o8u/S1k0bL6dSAsO3qE9IELXe BVHaeuCHIk0rAyG3TeKz9faXLsHBWgiQmi3UyKp0oT9Ftw7I3W7qnuELp8Amjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776368280; a=rsa-sha256; cv=none; b=n0313Ret2Ualn9suRq7e6KCHsPHU5g+t+Bh0ShuIyoA626YDTX9WKrR1Sgx6UaWOiftaGI 2mctrr+zOcazvRKUXctDK7bOBJ5YtN91X5WlYLhBYenkUUO+4ptF8aVxX2EKmJEgsdX2AJ rXelkKKqTcFMU782VBh/PRrFlOR68dkwV/J00vC+qkiDu+MQwKglYzJQpX2dxEMWkuh8LD 8+gRm64jTBzWikn3SBa2NUCUTC1En9+lS/kBphiu+hnCt5aodxyoWhQiwIF/BouskcQUOK w1eaKYADKdrheClvYBIgqQyVK7m/CVpCZX0MrYktty7tw7Kzj2M/NqNZvKlcDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776368280; 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=+X6hm3JDpIOlFhMVZ6vVUew2i4rsK7XhY0/eIFzWMlU=; b=SEpWGqBJAdD/IJ32kmkBL4jEn20u3Wqjwadv8i1DOJY9K9RYViPn6k+wQZp/E4XjKOl5Y7 hVWXHlWR1Gnn0C4Xtgnq+lfpHygcOLWCN66OpaeUwhOVZpHN6DP0KAG3+ZFJ46U5DDfJke /UgDXMg9tZt++fkeYTc7NfGh3C5OF9Z9Sz0sdtSOh04pB2+R6GX/YW2S4gdXcxN1jViYrE qnApAJTyX07899cxbOB86KI1RkGiCgAmxQh9B6cT5ItOukPJpQD0dAmSv1DsyPOFnF50o1 5SCJasTqh9YrLeuaAKqPbzeXyeGXOioMbxSIXCXy7j29qppnhauTHpQS1PLQjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxSwS24FPz6BY for ; Thu, 16 Apr 2026 19:38:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19c1c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 19:38:00 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: c8d25804f56a - main - nd6: Add support for route information (RFC 4191) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c8d25804f56ae7c35eaa492b6110807a2675d41a Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 19:38:00 +0000 Message-Id: <69e13a98.19c1c.5140b765@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=c8d25804f56ae7c35eaa492b6110807a2675d41a commit c8d25804f56ae7c35eaa492b6110807a2675d41a Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-16 14:23:49 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-16 18:57:07 +0000 nd6: Add support for route information (RFC 4191) Implement RFC 4191 by handling received Router Adverisement (RA) packets with route information option. For default routes, use the route information's lifetime and preference to overwrite the RA's lifetime/preference. Also install and update more-specific route prefixes with the option's lifetime and expire them when their lifetime elapses. PR: 263982 Reviewed by: markj Tested by: Marek Zarychta Relnotes: yes Differential Revision: https://reviews.freebsd.org/D55449 --- sys/net/route/nhop_ctl.c | 1 + sys/netinet/icmp6.h | 2 + sys/netinet6/nd6.c | 8 ++ sys/netinet6/nd6.h | 14 +- sys/netinet6/nd6_rtr.c | 337 ++++++++++++++++++++++++++++++++++++++++++++++- 5 files changed, 360 insertions(+), 2 deletions(-) diff --git a/sys/net/route/nhop_ctl.c b/sys/net/route/nhop_ctl.c index 52e7b0fefcd2..596ec9e25d1a 100644 --- a/sys/net/route/nhop_ctl.c +++ b/sys/net/route/nhop_ctl.c @@ -451,6 +451,7 @@ nhop_create_from_nhop(struct rib_head *rnh, const struct nhop_object *nh_orig, nhop_free(nh); return (error); } + set_nhop_expire_from_info(nh, info); *pnh = nhop_get_nhop(nh, &error); diff --git a/sys/netinet/icmp6.h b/sys/netinet/icmp6.h index 9508f221ba10..77145e4c7503 100644 --- a/sys/netinet/icmp6.h +++ b/sys/netinet/icmp6.h @@ -356,6 +356,8 @@ struct nd_opt_route_info { /* route info */ /* prefix follows */ } __packed; +#define ND_OPT_RTI_FLAG_PRF_MASK 0x18 /* 00011000 */ + struct nd_opt_rdnss { /* RDNSS option (RFC 6106) */ u_int8_t nd_opt_rdnss_type; u_int8_t nd_opt_rdnss_len; diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 48e80bb75e0b..c531d11f9e62 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -513,6 +513,14 @@ nd6_options(union nd_opts *ndopts) ndopts->nd_opts_pi_end = (struct nd_opt_prefix_info *)nd_opt; break; + case ND_OPT_ROUTE_INFO: + if (ndopts->nd_opt_array[nd_opt->nd_opt_type] == 0) { + ndopts->nd_opt_array[nd_opt->nd_opt_type] + = nd_opt; + } + ndopts->nd_opts_rti_end = + (struct nd_opt_route_info *)nd_opt; + break; /* What about ND_OPT_ROUTE_INFO? RFC 4191 */ case ND_OPT_RDNSS: /* RFC 6106 */ case ND_OPT_DNSSL: /* RFC 6106 */ diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index 8c8d5a3236ca..8dc27aef5e12 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -287,7 +287,7 @@ VNET_DECLARE(int, ip6_temp_regen_advance); /* seconds */ #define V_ip6_temp_regen_advance VNET(ip6_temp_regen_advance) union nd_opts { - struct nd_opt_hdr *nd_opt_array[16]; /* max = ND_OPT_NONCE */ + struct nd_opt_hdr *nd_opt_array[24]; /* max = ND_OPT_ROUTE_INFO */ struct { struct nd_opt_hdr *zero; struct nd_opt_hdr *src_lladdr; @@ -305,10 +305,20 @@ union nd_opts { struct nd_opt_hdr *__res13; struct nd_opt_nonce *nonce; struct nd_opt_hdr *__res15; + struct nd_opt_hdr *__res16; + struct nd_opt_hdr *__res17; + struct nd_opt_hdr *__res18; + struct nd_opt_hdr *__res19; + struct nd_opt_hdr *__res20; + struct nd_opt_hdr *__res21; + struct nd_opt_hdr *__res22; + struct nd_opt_hdr *__res23; + struct nd_opt_route_info *rti_beg; struct nd_opt_hdr *search; /* multiple opts */ struct nd_opt_hdr *last; /* multiple opts */ int done; struct nd_opt_prefix_info *pi_end;/* multiple opts, end */ + struct nd_opt_route_info *rti_end;/* multiple opts, end */ } nd_opt_each; }; #define nd_opts_src_lladdr nd_opt_each.src_lladdr @@ -318,6 +328,8 @@ union nd_opts { #define nd_opts_rh nd_opt_each.rh #define nd_opts_mtu nd_opt_each.mtu #define nd_opts_nonce nd_opt_each.nonce +#define nd_opts_rti nd_opt_each.rti_beg +#define nd_opts_rti_end nd_opt_each.rti_end #define nd_opts_search nd_opt_each.search #define nd_opts_last nd_opt_each.last #define nd_opts_done nd_opt_each.done diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 5819370a3011..623bfd60918e 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -60,6 +60,7 @@ #include #include #include +#include #include #include @@ -77,9 +78,20 @@ MALLOC_DEFINE(M_IP6NDP, "ip6ndp", "IPv6 Neighbor Discovery"); +struct nd_routectl { + struct ifnet *ndrt_ifp; /* nexthop interface */ + struct sockaddr_in6 ndrt_gateway; /* gateway address */ + struct sockaddr_in6 ndrt_prefix; /* route prefix */ + struct sockaddr_in6 ndrt_mask; /* route prefix mask */ + uint8_t ndrt_plen; /* route prefix len */ + uint8_t ndrt_flags; /* route info flags */ + uint32_t ndrt_lifetime; /* route info lifetime (sec) */ +}; + static struct nd_defrouter *defrtrlist_update(struct nd_defrouter *); static int prelist_update(struct nd_prefixctl *, struct nd_defrouter *, bool, int); +static int nd6_routelist_update(struct nd_routectl *); static int nd6_prefix_onlink(struct nd_prefix *); static int in6_get_tmp_ifid(struct in6_aliasreq *); @@ -304,6 +316,116 @@ nd6_ra_opt_pi(struct nd_opt_hdr *pt, struct ifnet *ifp, (void)prelist_update(&pr, dr, auth, mcast); } +static void +nd6_ra_opt_rti(struct nd_opt_hdr *hdr, struct ifnet *ifp, + struct in6_addr saddr6, struct nd_defrouter *dr) +{ + struct nd_opt_route_info *rti = NULL; + struct nd_routectl rt; + struct in6_addr prefix, netmask; + char ip6bufs[INET6_ADDRSTRLEN]; + int olen; + uint8_t pref; + + if (hdr->nd_opt_type != ND_OPT_ROUTE_INFO) + return; + + /* RFC 4191 section 2.3, Field validation */ + rti = (struct nd_opt_route_info *)hdr; + if (rti->nd_opt_rti_len == 0 || rti->nd_opt_rti_len > 3) { + nd6log((LOG_INFO, + "%s: invalid option len %d for route " + "information option, ignored\n", __func__, + rti->nd_opt_rti_len)); + return; + } + if (rti->nd_opt_rti_prefixlen > 128 || + (rti->nd_opt_rti_prefixlen > 64 && rti->nd_opt_rti_len != 3) || + (rti->nd_opt_rti_prefixlen > 0 && rti->nd_opt_rti_len < 2)) { + nd6log((LOG_INFO, + "%s: invalid prefix len %d with option len %d for route " + "information option, ignored\n", __func__, + rti->nd_opt_rti_prefixlen, rti->nd_opt_rti_len)); + return; + } + pref = rti->nd_opt_rti_flags & ND_OPT_RTI_FLAG_PRF_MASK; + if ((pref & ND_RA_FLAG_RTPREF_RSV) != 0) { + nd6log((LOG_INFO, + "%s: reserved preference %d for route " + "information option, ignored\n", __func__, + pref)); + return; + } + + /* + * RFC 4191 section 2.3: The bits in the prefix after + * the prefix length (if any) are reserved and MUST be + * initialized to zero by the sender and ignored by the receiver. + */ + memset(&prefix, 0, sizeof(prefix)); + /* + * Calculate the variable length of the option and copy the remaining + * length into the prefix. + * The resulting value cannot exceed the size of struct in6_addr + * since the option length is limited to 3 (24 bytes). + */ + olen = (rti->nd_opt_rti_len << 3) - sizeof(struct nd_opt_route_info); + memcpy(&prefix, (char *)rti + sizeof(struct nd_opt_route_info), olen); + in6_prefixlen2mask(&netmask, rti->nd_opt_rti_prefixlen); + IN6_MASK_ADDR(&prefix, &netmask); + if (IN6_IS_ADDR_MULTICAST(&prefix) || IN6_IS_ADDR_LINKLOCAL(&prefix)) { + nd6log((LOG_INFO, "%s: invalid prefix %s, ignored\n", + __func__, ip6_sprintf(ip6bufs, &prefix))); + return; + } + + /* + * RFC 4191 section 3.1: The Router Preference and Lifetime + * values in a ::/0 Route Information Option override the + * preference and lifetime values in the Router Advertisement header. + */ + if (rti->nd_opt_rti_prefixlen == 0 && dr != NULL) { + /* + * We may disable routes from RA messages when + * ND6_IFF_NO_RADR enabled on the receiving interface or + * (ip6.forwarding == 1 && ip6.rfc6204w3 != 1). + * Therefore, don't overwrite it. + */ + if (dr->rtlifetime == 0) + return; + /* + * XXXPO: ignore rti lifetime bigger than uint16_max until + * we update the dr structure size to uint32_t. + */ + if (ntohl(rti->nd_opt_rti_lifetime) > UINT16_MAX) + return; + dr->rtlifetime = ntohl(rti->nd_opt_rti_lifetime); + dr->expire = time_uptime + dr->rtlifetime; + dr->raflags &= ~ND_OPT_RTI_FLAG_PRF_MASK; + dr->raflags |= pref; + nd6log((LOG_INFO, + "%s: override default route with route information option\n", + __func__)); + return; + } + + memset(&rt, 0, sizeof(rt)); + rt.ndrt_ifp = ifp; + rt.ndrt_prefix.sin6_len = sizeof(struct sockaddr_in6); + rt.ndrt_prefix.sin6_family = AF_INET6; + rt.ndrt_prefix.sin6_addr = prefix; + rt.ndrt_gateway.sin6_len = sizeof(struct sockaddr_in6); + rt.ndrt_gateway.sin6_family = AF_INET6; + rt.ndrt_gateway.sin6_addr = saddr6; + rt.ndrt_mask.sin6_len = sizeof(struct sockaddr_in6); + rt.ndrt_mask.sin6_family = AF_INET6; + rt.ndrt_mask.sin6_addr = netmask; + rt.ndrt_plen = rti->nd_opt_rti_prefixlen; + rt.ndrt_flags = rti->nd_opt_rti_flags; + rt.ndrt_lifetime = ntohl(rti->nd_opt_rti_lifetime); + (void)nd6_routelist_update(&rt); +} + static void nd6_ra_opt_mtu(struct nd_opt_mtu *optmtu, struct ifnet *ifp, struct in6_addr saddr6) @@ -385,7 +507,7 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) struct in6_ifextra *ndi; struct ip6_hdr *ip6; struct nd_router_advert *nd_ra; - struct nd_opt_hdr *pt; + struct nd_opt_hdr *pt, *rti; struct in6_addr saddr6; struct nd_defrouter dr0, *dr; union nd_opts ndopts; @@ -493,6 +615,15 @@ nd6_ra_input(struct mbuf *m, int off, int icmp6len) nd_ra->nd_ra_curhoplimit); } } + /* Route Information */ + if (ndopts.nd_opts_rti != NULL) { + for (rti = (struct nd_opt_hdr *)ndopts.nd_opts_rti; + rti <= (struct nd_opt_hdr *)ndopts.nd_opts_rti_end; + rti = (struct nd_opt_hdr *)((char *)rti + + (rti->nd_opt_len << 3))) { + nd6_ra_opt_rti(rti, ifp, saddr6, &dr0); + } + } dr = defrtrlist_update(&dr0); /* Prefix Information */ if (ndopts.nd_opts_pi != NULL) { @@ -2167,6 +2298,210 @@ restart: return (error); } +/* + * Install advertised route via default router. + */ +static int +nd6_route_rtrequest(struct nd_routectl *key) +{ + struct rib_cmd_info rc; + struct rib_head *rnh; + struct nhop_object *nh; + struct ifaddr *ifa; + struct ifnet *ifp; + struct sockaddr *dst, *gw, *mask; + int flags, error; + time_t expire; + + NET_EPOCH_ASSERT(); + + ifp = key->ndrt_ifp; + dst = (struct sockaddr *)&key->ndrt_prefix; + gw = (struct sockaddr *)&key->ndrt_gateway; + mask = (struct sockaddr *)&key->ndrt_mask; + flags = RTF_DYNAMIC | RTF_GATEWAY; + if (key->ndrt_plen == 128) { + flags |= RTF_HOST; + mask = NULL; + } + + rnh = rt_tables_get_rnh_safe(key->ndrt_ifp->if_fib, AF_INET6); + if (rnh == NULL) + return (EINVAL); + + /* Get the best ifa for the given interface and gateway. */ + if ((ifa = ifaof_ifpforaddr(gw, ifp)) == NULL) + return (ENETUNREACH); + + expire = time_second + key->ndrt_lifetime; + struct rt_metrics rmx = { + .rmx_expire = expire, + }; + struct rt_addrinfo info = { + .rti_flags = flags, + .rti_info = { + [RTAX_DST] = dst, + [RTAX_GATEWAY] = gw, + [RTAX_NETMASK] = mask, + [RTAX_AUTHOR] = gw, + }, + .rti_ifa = ifa, + .rti_ifp = ifp, + .rti_mflags = RTV_EXPIRE, + .rti_rmx = &rmx, + }; + /* XXX: route preference */ + struct route_nhop_data rnd = { + .rnd_weight = RT_DEFAULT_WEIGHT, + }; + + error = nhop_create_from_info(rnh, &info, &nh); + if (error == 0) { + nhop_set_origin(nh, NH_ORIGIN_REDIRECT); + rnd.rnd_nhop = nh; + error = rib_add_route_px(ifp->if_fib, dst, key->ndrt_plen, &rnd, + RTM_F_CREATE, &rc); + } + if (error != 0) + return (error); + RTSTAT_INC(rts_dynamic); + + /* Send notification of a route addition to userland. */ + rt_missmsg_fib(RTM_REDIRECT, &info, flags | RTF_UP, error, ifp->if_fib); + + return (error); +} + +/* + * Update lifetime of advertised route. + */ +static int +nd6_route_rtupdate(struct nd_routectl *key) +{ + struct rib_cmd_info rc; + time_t expire; + + expire = time_second + key->ndrt_lifetime; + struct rt_metrics rmx = { + .rmx_expire = expire, + }; + struct rt_addrinfo info = { + .rti_info[RTAX_DST] = (struct sockaddr *)&key->ndrt_prefix, + .rti_mflags = RTV_EXPIRE, + .rti_rmx = &rmx, + }; + if (key->ndrt_plen != 128) + info.rti_info[RTAX_NETMASK] = (struct sockaddr *)&key->ndrt_mask; + return (rib_change_route(key->ndrt_ifp->if_fib, &info, &rc)); +} + +/* + * Delete advertised route. + */ +static int +nd6_route_rtdelete(struct nd_routectl *key) +{ + struct sockaddr *dst, *gw; + struct rib_cmd_info rc; + struct nhop_object *nh; + struct ifnet *ifp; + int error; + + ifp = key->ndrt_ifp; + dst = (struct sockaddr *)&key->ndrt_prefix; + gw = (struct sockaddr *)&key->ndrt_gateway; + error = rib_del_route_px(ifp->if_fib, dst, key->ndrt_plen, + rib_match_gw, gw, 0, &rc); + if (error == 0) { + nh = nhop_select_func(rc.rc_nh_old, 0); + rt_routemsg(RTM_DELETE, rc.rc_rt, nh, ifp->if_fib); + } + + return (error); +} + +/* + * Lookup for exact match of advertised route with gateway + * as its nexthop address. + */ +static bool +nd6_route_rtlookup(struct nd_routectl *key) +{ + RIB_RLOCK_TRACKER; + struct rib_head *rnh; + struct route_nhop_data rnd; + struct sockaddr *dst, *gw; + + dst = (struct sockaddr *)&key->ndrt_prefix; + gw = (struct sockaddr *)&key->ndrt_gateway; + rnh = rt_tables_get_rnh_safe(key->ndrt_ifp->if_fib, AF_INET6); + if (rnh == NULL) + return (false); + + RIB_RLOCK(rnh); + rib_lookup_prefix_plen(rnh, dst, key->ndrt_plen, &rnd); + RIB_RUNLOCK(rnh); + if (rnd.rnd_nhop == NULL) + return (false); + + return (match_nhop_gw(rnd.rnd_nhop, gw)); +} + +static int +nd6_routelist_update(struct nd_routectl *new) +{ + char ip6buf[INET6_ADDRSTRLEN]; + int error = 0; + + NET_EPOCH_ASSERT(); + + /* + * RFC 4191 section 3.1: If the received route's + * lifetime is zero, the route is removed from the Routing + * Table if present. + */ + if (new->ndrt_lifetime == 0) { + error = nd6_route_rtdelete(new); + if (error != 0) { + nd6log((LOG_DEBUG, + "%s: failed to delete the route %s/%d on %s (errno=%d)\n", + __func__, ip6_sprintf(ip6buf, &new->ndrt_prefix.sin6_addr), + new->ndrt_plen, if_name(new->ndrt_ifp), error)); + } + return (error); + } + + if (nd6_route_rtlookup(new)) { + /* + * RFC 4191 section 3.1: the route's lifetime and + * preference is updated if the route is already present. + * XXX: preference on routing table? (ndrt_flags) + */ + error = nd6_route_rtupdate(new); + if (error != 0) { + nd6log((LOG_DEBUG, + "%s: failed to update route lifetime of " + "%s/%d from RA on %s (errno=%d)\n", + __func__, ip6_sprintf(ip6buf, &new->ndrt_prefix.sin6_addr), + new->ndrt_plen, if_name(new->ndrt_ifp), error)); + } + } else { + /* + * RFC 4191 section 3.1: If a route's lifetime is non-zero, + * the route is added to the Routing Table if not present. + */ + error = nd6_route_rtrequest(new); + if (error != 0) { + nd6log((LOG_NOTICE, + "%s: failed to add route %s/%d from RA on %s (errno=%d)\n", + __func__, ip6_sprintf(ip6buf, &new->ndrt_prefix.sin6_addr), + new->ndrt_plen, if_name(new->ndrt_ifp), error)); + } + } + + return (error); +} + /* * Get a randomized interface identifier for a temporary address * Based on RFC 8981, Section 3.3.1. From nobody Thu Apr 16 19:38:01 2026 X-Original-To: dev-commits-src-main@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 4fxSwT49c3z6ZVl4 for ; Thu, 16 Apr 2026 19:38:01 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxSwT3MkGz3xHc for ; Thu, 16 Apr 2026 19:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776368281; 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=On9n7ytlFbZqx2n7rS4/GmlpfHvr1znvjUxo/2X8Doc=; b=CS/yQrRtKD9TynDSkFWXeF9LYQElkwpv1+drOugOw6Ac5zx7f00rwZmRptiDhIkJHy3LeY plwz9NFWwdhrz4Jc2OIebnaFOGaKYHCgCBl7+ZOgANLknwJh2tPm1lVuWo+fAv8/geQBlr hoI2qOd+GqHLVuiX5dN2Oi0+PxIxt1w4oFqhHxIdhSVdT/XXBqcNbJ4dnRhOKiiZ+HvE0i xCUaQ6cc3suZtAeQZPwYHGXCvmFGQ1CGX2AD0DatNtg0k01qXkfUf3ZTLKAE9nLJZHoVR6 VCRr9HIRVkGVwu86+5UxQcclbXXXugem1vO/bqKccuLyvH+V4nG/wCkuW70x9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776368281; a=rsa-sha256; cv=none; b=kXrZAB5exA8VLYq0lRkypd0IDkraEYre7OeosncEowDTgK0q1gpOrpRWYvaGegen1s4/jC kALU7IoopCDgcP17Fvio/kltPjyzaxOcEz3/UXuqOAtT+0zB/bOGQScB6oYRWXv8JulIdk 1JrIrZmvin16N+fGuWcXYrvGK7U5LHF8Yg/7QSIsmB2FHY/0I82onVSew3ZHM10Pyrc029 3w5bu4A8POwqJ6rKkz8NezxiZjfsBBPFjwioZjW4h6GgVxXdyh4a+nX1Ck+zGD5hCiTv9f Lvji7WUslkwdkvEZVxfL9woljUPrZ3glEf1gNNQ3p1KSY+oT7sEQ9sYSfRCLGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776368281; 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=On9n7ytlFbZqx2n7rS4/GmlpfHvr1znvjUxo/2X8Doc=; b=ckc9SBQfJo7HZaTSnHHfiiDIZg+bsc1MBnroDX5mB2c1kk518TKvEBzpYyEec3Ocwcwran SBG/LQxYXmIZpnRQoFfu17RcmISqxKnLIMAEZ6Ueq8acnpDbdcyQSxmt3ZXajgcpMJJo7R rw0HSOkIblt1dkEH+k61T8N4tZmLY1UNY3wD4nVe46WzGBQsOmqpdYlbkCzy5kTYdfGCRa pJ2HqTl2pXsVxl86jcsXy+oscUEsYWd1efWK7ZyZoiSVqTk0jyp9NPvDL6pcah0ZDUPYje 978V8m8x1WZELRtbYjAKbijXlK+QuZKgzBXzDirFZJ/dwScIHMX8tveG6DIaSQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxSwT2r76z6BZ for ; Thu, 16 Apr 2026 19:38:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1894b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 19:38:01 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: 4dc6522d57c7 - main - rtadvd(8): Set route info lifetime to 0 during shutdown List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4dc6522d57c748cdaddd8327909574360a3de517 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 19:38:01 +0000 Message-Id: <69e13a99.1894b.2cd6242f@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=4dc6522d57c748cdaddd8327909574360a3de517 commit 4dc6522d57c748cdaddd8327909574360a3de517 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-01 13:29:15 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-16 19:03:08 +0000 rtadvd(8): Set route info lifetime to 0 during shutdown RFC 4191 section 3.1: if the received route's lifetime is zero, the route is removed from the Routing Table if present. Also, do not tell route information option is unknown. PR: 263982 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D55448 --- usr.sbin/rtadvd/config.c | 3 +++ usr.sbin/rtadvd/rtadvd.c | 17 +++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/usr.sbin/rtadvd/config.c b/usr.sbin/rtadvd/config.c index 70fb2ed7dc28..8b7079c17822 100644 --- a/usr.sbin/rtadvd/config.c +++ b/usr.sbin/rtadvd/config.c @@ -1021,12 +1021,15 @@ getconfig_free_prf64: } else { struct rdnss *rdn; struct dnssl *dns; + struct rtinfo *rti; rai_old->rai_lifetime = 0; TAILQ_FOREACH(rdn, &rai_old->rai_rdnss, rd_next) rdn->rd_ltime = 0; TAILQ_FOREACH(dns, &rai_old->rai_dnssl, dn_next) dns->dn_ltime = 0; + TAILQ_FOREACH(rti, &rai_old->rai_route, rti_next) + rti->rti_ltime = 0; ifi->ifi_rainfo_trans = rai_old; ifi->ifi_state = IFI_STATE_TRANSITIVE; diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c index 2e9bced7c00e..b772f78845d8 100644 --- a/usr.sbin/rtadvd/rtadvd.c +++ b/usr.sbin/rtadvd/rtadvd.c @@ -138,6 +138,7 @@ union nd_opt { #define NDOPT_FLAG_RDNSS (1 << 5) #define NDOPT_FLAG_DNSSL (1 << 6) #define NDOPT_FLAG_PREF64 (1 << 7) +#define NDOPT_FLAG_ROUTEINFO (1 << 8) static uint32_t ndopt_flags[] = { [ND_OPT_SOURCE_LINKADDR] = NDOPT_FLAG_SRCLINKADDR, @@ -148,6 +149,7 @@ static uint32_t ndopt_flags[] = { [ND_OPT_RDNSS] = NDOPT_FLAG_RDNSS, [ND_OPT_DNSSL] = NDOPT_FLAG_DNSSL, [ND_OPT_PREF64] = NDOPT_FLAG_PREF64, + [ND_OPT_ROUTE_INFO] = NDOPT_FLAG_ROUTEINFO, }; static void rtadvd_shutdown(void); @@ -372,6 +374,7 @@ rtadvd_shutdown(void) struct rainfo *rai; struct rdnss *rdn; struct dnssl *dns; + struct rtinfo *rti; if (wait_shutdown) { syslog(LOG_INFO, @@ -416,6 +419,8 @@ rtadvd_shutdown(void) rdn->rd_ltime = 0; TAILQ_FOREACH(dns, &rai->rai_dnssl, dn_next) dns->dn_ltime = 0; + TAILQ_FOREACH(rti, &rai->rai_route, rti_next) + rti->rti_ltime = 0; } TAILQ_FOREACH(ifi, &ifilist, ifi_next) { if (!ifi->ifi_persist) @@ -1085,7 +1090,8 @@ ra_input(int len, struct nd_router_advert *nra, error = nd6_options((struct nd_opt_hdr *)(nra + 1), len - sizeof(struct nd_router_advert), &ndopts, NDOPT_FLAG_SRCLINKADDR | NDOPT_FLAG_PREFIXINFO | NDOPT_FLAG_MTU | - NDOPT_FLAG_RDNSS | NDOPT_FLAG_DNSSL | NDOPT_FLAG_PREF64); + NDOPT_FLAG_RDNSS | NDOPT_FLAG_DNSSL | NDOPT_FLAG_PREF64 | + NDOPT_FLAG_ROUTEINFO); if (error) { syslog(LOG_INFO, "<%s> ND option check failed for an RA from %s on %s", @@ -1418,7 +1424,8 @@ nd6_options(struct nd_opt_hdr *hdr, int limit, if (hdr->nd_opt_type > ND_OPT_MTU && hdr->nd_opt_type != ND_OPT_RDNSS && hdr->nd_opt_type != ND_OPT_DNSSL && - hdr->nd_opt_type != ND_OPT_PREF64) { + hdr->nd_opt_type != ND_OPT_PREF64 && + hdr->nd_opt_type != ND_OPT_ROUTE_INFO) { syslog(LOG_INFO, "<%s> unknown ND option(type %d)", __func__, hdr->nd_opt_type); continue; @@ -1452,6 +1459,11 @@ nd6_options(struct nd_opt_hdr *hdr, int limit, case ND_OPT_PREFIX_INFORMATION: if (optlen == sizeof(struct nd_opt_prefix_info)) break; + goto skip; + case ND_OPT_ROUTE_INFO: + if (optlen >= 8 && optlen <= 24 && + (optlen - sizeof(struct nd_opt_route_info)) % 8 == 0) + break; skip: syslog(LOG_INFO, "<%s> invalid option length", __func__); @@ -1464,6 +1476,7 @@ skip: case ND_OPT_RDNSS: case ND_OPT_DNSSL: case ND_OPT_PREF64: + case ND_OPT_ROUTE_INFO: break; /* we don't care about these options */ case ND_OPT_SOURCE_LINKADDR: case ND_OPT_MTU: From nobody Thu Apr 16 20:17:03 2026 X-Original-To: dev-commits-src-main@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 4fxTnb1bjgz6ZYlc; Thu, 16 Apr 2026 20:17:07 +0000 (UTC) (envelope-from markj@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxTnZ69FVz44tp; Thu, 16 Apr 2026 20:17:06 +0000 (UTC) (envelope-from markj@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776370626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y82ULl9BGmOL4tZCi2ADs7hceo/iLX6iui0zXncto9M=; b=Hnz1cdKu+hcyp61NFssKC8PLSJhorIawk+S6/W3tJ5MO5VS7jsx0/sPPEDKLznKCLv0Wez kpG8m18rI2aBl5xoXAScwhaM3mVtNXYGnjMISRxxQ85j58CtiLOMbuylki0VuJ+59eggbZ ZLBKMNdjEW3Q9Q5y/QgWa0huWlVIxiLiqivkv2Gp7dcviOQPYqdcZoxyysKEtDg7Vz+FVM DBD3am61jdzqw4PKJ8HSBP7ADONv+4bb99WaWF5XFJv0HBTcoRatu3dugmB7KrbUuJGsKA vdWyv+4eP6G94p2SumarCrwTbaeDbqr4rU9R/tkFxs+FKDI0/jrSEVAkvtOlyA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776370626; a=rsa-sha256; cv=none; b=b+JUnpQiRzvao8NTOVKXASkb6CEtHgwTxdBb99wyoiI6521hBiz1g2lYKkeL17dIsZjjmE FZR6Hkyb8jaA0/oTc1pUyg9xGMUuYf7nkym9Z2yP/rUxZBo3YeT1mAkl0gwFjdS9AZ0J2p rh6ZRoFp8oHOj7IZqPb7ytyHeRIkfZKBuNNNQyluU+ZDmTvmDXABCW+fbEa06ryGBilxOm wg7sAIsZDi2vJ9L/XIUKz14DKhUMwlKAEZAjWlB6ti1c2DvK8zSnCO9fXpnn1ywFyjHwIL igF4u3RIYke+veJvkFVAXtbO5uUNnba4w/ycjVo3RIgU3y9L5JVsB/BgEGVetQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776370626; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y82ULl9BGmOL4tZCi2ADs7hceo/iLX6iui0zXncto9M=; b=WFRcgrikKQp/6XprBV91KWoKMaRnOR5FMvrWwtyKtabudRVYrENeXoyT52xIoU08Zd2kQv hleozZrvrKjkY0nmztTFHfeMxtzvyefTUQ8K1YN3quC/pjaXPGpLG2iCP4UZCGGyJIlTOZ 1TQvgH4wfxNg1gX6gVMTwtdGHNIpjM8SSa7zfWBmnf8PpdgDCn72052yaW50kfXl8EeR3g MyA7gcTpYMsMEvi52ZJrAtpH4E0B9xyjKGGDjiW1TvbbiyqzUgVg9nbvkW9oHYUXcFPlkI wrsG3AaJto7vIdT+k+KZ3b23YMk3K3+P1GIRR2LGGxOwVhHOjqPL7dInoYAC5w== Received: from nuc (192-0-220-237.cpe.teksavvy.com [192.0.220.237]) (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) (Authenticated sender: markj) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fxTnZ3M0JzFFp; Thu, 16 Apr 2026 20:17:06 +0000 (UTC) (envelope-from markj@freebsd.org) Date: Thu, 16 Apr 2026 16:17:03 -0400 From: Mark Johnston To: Roger Pau =?iso-8859-1?Q?Monn=E9?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, imp@freebsd.org Subject: Re: git: 1491fe8f864a - main - uart/pci: support 16550A PCI serial devices Message-ID: References: <69c640e1.1fc2b.4542bc24@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <69c640e1.1fc2b.4542bc24@gitrepo.freebsd.org> On Fri, Mar 27, 2026 at 08:33:37AM +0000, Roger Pau Monn wrote: > The branch main has been updated by royger: > > URL: https://cgit.FreeBSD.org/src/commit/?id=1491fe8f864af5af37e83f1d12459905fb6097fd > > commit 1491fe8f864af5af37e83f1d12459905fb6097fd > Author: Roger Pau Monn > AuthorDate: 2026-03-26 10:01:57 +0000 > Commit: Roger Pau Monn > CommitDate: 2026-03-27 08:26:32 +0000 > > uart/pci: support 16550A PCI serial devices > > Expand the current check to also attach the ns8250 driver to devices > reporting as 16550A. This has been tested to work on a real device. > > From an inspection of the code in the ns8250 driver it seems like it should > support up to 16950A devices, but I don't have hardware to ensure that, > hence be conservative with the change. I have a system which hangs in uart_bus_probe() after this change. It has a 2-port UART PCI card installed: puc0@pci0:6:0:0: class=0x070002 rev=0x00 hdr=0x00 vendor=0x1415 device=0xc158 subvendor=0x1415 subdevice=0xc158 vendor = 'Oxford Semiconductor Ltd' device = 'OXPCIe952 Dual Native 950 UART' class = simple comms subclass = UART Normally puc(4) attaches to it and creates two child uart devices: puc0 Interrupt request lines: 0x11 pcib7 memory window: 0x84000000-0x841fffff 0x84200000-0x843fffff 0x84400000-0x84403fff uart2 puc0 I/O memory mapping: 0x84401000-0x844011ff puc0 port numbers: 0x1 uart3 puc0 I/O memory mapping: 0x84401200-0x844013ff puc0 port numbers: 0x2 After this change, though, uart(4) tries to probe the device directly and hangs. Presumably we still want to exclude at least multi-port devices here? > MFC: 2 weeks > Reviewed by: imp > Differential revision: https://reviews.freebsd.org/D56095 > --- > sys/dev/uart/uart_bus_pci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c > index 22af8ee8663c..7087958cbfa9 100644 > --- a/sys/dev/uart/uart_bus_pci.c > +++ b/sys/dev/uart/uart_bus_pci.c > @@ -297,7 +297,7 @@ uart_pci_probe(device_t dev) > } > if (pci_get_class(dev) == PCIC_SIMPLECOMM && > pci_get_subclass(dev) == PCIS_SIMPLECOMM_UART && > - pci_get_progif(dev) < PCIP_SIMPLECOMM_UART_16550A) { > + pci_get_progif(dev) <= PCIP_SIMPLECOMM_UART_16550A) { > /* XXX rclk what to do */ > id = &cid; > sc->sc_class = &uart_ns8250_class; > From nobody Thu Apr 16 20:27:57 2026 X-Original-To: dev-commits-src-main@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 4fxV2532ztz6Zb5k for ; Thu, 16 Apr 2026 20:27:57 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxV252C50z45hy for ; Thu, 16 Apr 2026 20:27:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776371277; 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=fHjTJ3U7lBAiJ0fUndZe2chJe5CNUMqkC9rWMSFR6Js=; b=ha0LQsE+Ihld4Q6bPvWblv5iFTzOC7QPZ+hfOlV3+duBSFP4ATDhfMDmYzdNFA84syhL/a M5k1E15mCFHgHHCJE1bWNAkihakl8IEQl/7+1q/LgwfIXWnQusLmXRyLnpypZ9N90vGl3A ql5mFpvBWIiYDVykWsL7BQ8FZpNTc4b2nZyVTY8Gi90uzh3hduI2T6wKqkTxrzaA5JD8lQ ERdbOcP3c9a/6d8HUNfpQyCJ2r6cpjGyLSIEVWSOOMu1zpWqTZtSTbEMR/QZu49tm/FM6O m2yhKNf/OU/Y+CzKYv9smuJ2hhUhj2iK/7ShHJPtDcUtdZ7zOJUZLIeJtgfEag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776371277; a=rsa-sha256; cv=none; b=cEa/8MJgFoD+DbCDxx1pHFKSkTBSlvHFitoy2e3gY7YK9X3OSmBmFGylyu4mmk/Np4L6RG s1Ti9H2wIJtN7zt2WlbClugOqmP+V3lcKVZhaTPWxfau7P9wK3KXVRvoKAZZ7dCySCAvjA LmuirDGKmCtxIeQOicvE9TUdEpo77r+CzzK25iR2gMV/6UchDJuchRirYeHnxK7mUnW3OE 0BrEtzNAOStjYQPtNNxQUDKOgHGw+KaGsdlBhK1FeAjpOIibrrtLoU91gWApBUSBO+U8zO 0/95aQ8fKCBpnNr/vNEi/RR/LAXJbZEwS6kjVSwLfrn7zKIhdkzhoPtR+JrpSA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776371277; 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=fHjTJ3U7lBAiJ0fUndZe2chJe5CNUMqkC9rWMSFR6Js=; b=oE7hLn2jeaCj5c+3zEISrA7/ElfqF54VgDFW50MzPLSXh4eO3Tv1c9HkgIVER0UQHpXR7q bW4StnoebLGjWop8z8Ne68a/6FRRewYiTWtFpEbJ8L5f2byISnBG7kk8Pmfz5/E5U8Rn6K env8+7VA1N7LIurbE9meTk40aUtCgYu/JFOpJ1nM1aH2GDHyJCMWDSUcQM6Bp8/3kKRqos UiSHBNSV9QNGzYbGK2+Vw9tQ1HqqBGif4v+D1MdHcFNzSGEt5IKMuzYWnIt6eA9uEfj3if UVkkKm2jzyNWDe8iV0cd+qMVvqJhEhMNuftMQS1O3c0ZNpuN2ssPhw6MvhjjOw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxV251Yhhz6hx for ; Thu, 16 Apr 2026 20:27:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2049c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 20:27:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d88a159da42a - main - so_splice: Fix the KTLS check for the sink socket in so_splice() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d88a159da42a75dbd46ea4f6f9c8059975dab5e8 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 20:27:57 +0000 Message-Id: <69e1464d.2049c.37395e0e@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d88a159da42a75dbd46ea4f6f9c8059975dab5e8 commit d88a159da42a75dbd46ea4f6f9c8059975dab5e8 Author: Mark Johnston AuthorDate: 2026-04-16 19:57:36 +0000 Commit: Mark Johnston CommitDate: 2026-04-16 20:27:45 +0000 so_splice: Fix the KTLS check for the sink socket in so_splice() Reviewed by: gallatin Reported by: Claude Sonnet 4.6 Fixes: 1000cc4a0d39 ("so_splice: Disallow splicing with KTLS-enabled sockets") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56385 --- sys/kern/uipc_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 45290c29f629..3debec547a80 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1768,7 +1768,7 @@ so_splice(struct socket *so, struct socket *so2, struct splice *splice) return (error); } SOCK_SENDBUF_LOCK(so2); - if (so->so_snd.sb_tls_info != NULL) { + if (so2->so_snd.sb_tls_info != NULL) { SOCK_SENDBUF_UNLOCK(so2); SOCK_UNLOCK(so2); mtx_lock(&sp->mtx); From nobody Thu Apr 16 20:27:58 2026 X-Original-To: dev-commits-src-main@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 4fxV2642flz6Zb1G for ; Thu, 16 Apr 2026 20:27:58 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxV263Dflz4627 for ; Thu, 16 Apr 2026 20:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776371278; 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=hf1sPtVaCkCmAllUcYipPJsrIOKvBGYHFMFo5+ZaKl8=; b=tHFnvVRxAUZJuQJoX+GEE+B36jwfJBuR+zeh0Cuel8FRrhN3PhND6bJkF2Vbuj2OKIH7l/ LqwPwVqCY6tR1pPX2m4QBtZqiB/6P1DHbY+oQUZPTHD8Pbe9+q7SD2d2WUp1wzK+4Ugv8L 5QXbsD2aQOFijTt6nWKI9j0ztlm8gLBbwX4EXb1wRCg7heqEPLtTVbyMr5faWJSPo6wTA7 K0jnD2N6F+DimLPqXsfui6f4O8rxHYRYOFm+896TwJtgWQmLSyGXIenX8GPMJpKLraumXa 7gI8gaqV9Vv3nh+luKjJsCJzHd9wUgi8CTdZrjaFTySEP/jnGdAF3P5ZzgBjaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776371278; a=rsa-sha256; cv=none; b=jgE+ZkdUbe97voQUPtmzhQv0FVXFSnZ552kw4AuEOD8Cm2AnYHnOXGxvZSJqptm8nMfwjD 0v4WuDWzpx+uH+WARiRGLoCM3jgmeQ1tPjHyF6snvCjvRhYW+usNXAKkohr3XrRZV+3iXB bh14fgaBT0s+Zy7uoYoFOMd3kP3uSYgsRYfJeLwGEQfHeEEMw4LikvGVb8SgvVB/CYFaN4 3dMNIJoFNmD/P/QrTBTRiULcFc0Pp5fQFfYJXPNGQ5in85k5yrniGZ995kjcIUx4a7yHNC m5U2ziP3eTqogE+1Qeov3G1MCwq/OQE9BNF2G1JoCWWIje3nxud4AQ4e+q3Dzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776371278; 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=hf1sPtVaCkCmAllUcYipPJsrIOKvBGYHFMFo5+ZaKl8=; b=vOY2fwwUPhPe1cq/C50FNvt/uIzcEdvfnA06LCM5+01gRQH7QgNTkEyswkRDkXe9Vj/dhz lUfvCrwoeU23CvRMe5wycXjMG3Bh1Jf/6RBEHI9qV1TPnH0ebdozD37b0m2+Cqrr3l44op 8uJrQac5YN9HmlDbLQgOLp4LZoRzROjQpz/q7idjk+LAryv7KBOoltTCQoBOJHPljPPOTD CDH1xDsv8rZgfaWIXemHKIrl0+BGvOz3k/7roKMJTbYDyHMjWiFdnJq/9wwFSHhR/7XPty alRwksLrKlJKh+NJxpLRw605wO//gP6tamWHPwLR/legUeCCtPPoFIbl0dE2LQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxV262Q4Lz6xk for ; Thu, 16 Apr 2026 20:27:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2068d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 20:27:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: bebc1a5b09e3 - main - in_mcast: Fix a lock leak in inp_set_source_filters() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bebc1a5b09e358b420077a1b5c0f85f8e7f0812f Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 20:27:58 +0000 Message-Id: <69e1464e.2068d.21336344@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bebc1a5b09e358b420077a1b5c0f85f8e7f0812f commit bebc1a5b09e358b420077a1b5c0f85f8e7f0812f Author: Mark Johnston AuthorDate: 2026-04-16 19:57:57 +0000 Commit: Mark Johnston CommitDate: 2026-04-16 20:27:45 +0000 in_mcast: Fix a lock leak in inp_set_source_filters() MFC after: 3 days Reported by: Claude Opus 4.6 --- sys/netinet/in_mcast.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index 6b9bb599a475..9e93992f81e0 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -2582,6 +2582,7 @@ inp_set_source_filters(struct inpcb *inp, struct sockopt *sopt) error = copyin(msfr.msfr_srcs, kss, sizeof(struct sockaddr_storage) * msfr.msfr_nsrcs); if (error) { + IN_MULTI_UNLOCK(); free(kss, M_TEMP); return (error); } From nobody Thu Apr 16 20:27:59 2026 X-Original-To: dev-commits-src-main@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 4fxV280Jsyz6Zb8S for ; Thu, 16 Apr 2026 20:28:00 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxV273lTkz45fC for ; Thu, 16 Apr 2026 20:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776371279; 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=CbzMf9qF3wN5ZqGt0X/EKjFb0YG8ap4j2czJw8RwlUE=; b=CrmR2GhfEbHoKzjGn+OnNoLi+NpqUTn4zcTqZV3NYoN8q6VnpHPf+IXK/3+9iDP3mvOMwR XeZOiu7HbGK5PtQpuETIdnPqAauZSlag1vFGCAOqtWh+NaxJIimY6VZt9OEC5S6iPObP+I r9VTyQ8qB5FGHPKgxmM9Gg5ZyL4jJBMX07KSKhG8wkahly47hy1H4aBJiM4DL0Zy6say0r xSLkBgkj0+kPS43BKzZfPu2fmhJaNhhImYzId3OBce5r2B/ncsI/sDKQBHulI1xsGZ80tH 5Yu407IAVkRWnYbSjJ5vX9GFlHN+CxddCd8wPELZPTykUFLOkhuxQoBsyIlVSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776371279; a=rsa-sha256; cv=none; b=yV/mQZpfN6CEhzorFj/r/pDF73+/wC7WPDciPGPx+Rp/ApHEYjwyeAgLLkUBCNf6hnH5P2 eUsoFBqyUzDZZYjpKKmuyYEEBSRj3Zz4XXLGsgbBo86k8qa+t/JmUBBNVvcT5dVgNIVsOK DHrfnekGFoKNjP1B6DUhjUZe0cdDDIMPBKk3NY/vexZ4P2txTon3gwY8ShbAMYUKTi9Sk+ Vp5YNKiaaeSapeBMt73K691M8y77riok0qKi8ilyaFosIm5f61dyP0p6S8ZOP1WXJxP2x4 l7blORFDEcaYQHTFbzSbsQMdo6FtQ1P8TXgPiPkLE+mUYbIme3BCDLocNO0w1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776371279; 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=CbzMf9qF3wN5ZqGt0X/EKjFb0YG8ap4j2czJw8RwlUE=; b=jN1s3AqK2iNqJriub66dB8n8Sx9dUsQ596uEZN4Cw+vTuF5CBpu2eLR2WZQLtNlaXCFeOX ctBUccCxXrxQQssLy6M78vDVJPISFsKntpLs74YJn8YtACMChVSjggC0dcq3dusW63cdjk Xznqx1ZGST450yTgVa4u7D7ZHaJ/BJL/PRo89VOsvijfhJDqB3gbl+fdeRq1TNLGeoPF5d /wYt+3LlXGZmVuiiBq2SOWIdTdskD/d/mFZWIGy3XBGkNU0ChICQz44QD8paOmT+OME3yA ZB2jwzL8HtCl1iRvjvOeiq+ceH1o6Xec5gVRJQb0F/aCfRXh2dNddEiisjbVBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxV2732vVz6xl for ; Thu, 16 Apr 2026 20:27:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2134e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 20:27:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 0dac997f2434 - main - file: Fix a format string assertion List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0dac997f2434a30785d71d7513b4ebfc3eecf0d7 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 20:27:59 +0000 Message-Id: <69e1464f.2134e.369aa0e1@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0dac997f2434a30785d71d7513b4ebfc3eecf0d7 commit 0dac997f2434a30785d71d7513b4ebfc3eecf0d7 Author: Mark Johnston AuthorDate: 2026-04-16 20:21:51 +0000 Commit: Mark Johnston CommitDate: 2026-04-16 20:27:46 +0000 file: Fix a format string assertion Reported by: Jenkins Fixes: e75b324c93a1 ("kern_descrip.c: Clarify allocation and freeing of fd map in fdgrowtable()") --- sys/kern/kern_descrip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 69985c39c3c0..48303926759b 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2009,7 +2009,7 @@ fdgrowtable(struct filedesc *fdp, int nfd) KASSERT(fdp->fd_nfiles >= NDFILE, ("file table of length %d shorter " "than NDFILE (%d)", fdp->fd_nfiles, NDFILE)); KASSERT(fdp->fd_nfiles == NDFILE || fdp->fd_nfiles % NDENTRIES == 0, - ("file table of length %d should be multiple of NDENTRIES (%lu)", + ("file table of length %d should be multiple of NDENTRIES (%zu)", fdp->fd_nfiles, NDENTRIES)); KASSERT((fdp->fd_nfiles == NDFILE) == ((intptr_t)fdp->fd_files - offsetof(struct filedesc0, fd_dfiles) == (intptr_t)fdp - From nobody Thu Apr 16 20:35:06 2026 X-Original-To: dev-commits-src-main@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 4fxVBL5DKfz6ZbjN for ; Thu, 16 Apr 2026 20:35:06 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxVBL3rhPz47l2 for ; Thu, 16 Apr 2026 20:35:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776371706; 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=RIJgbTT/L4aOn0JRNBf/7iQWp92Uutlh/TyOqhiOPBU=; b=R5rBHkncL9zyx8xtf1iWR4DfjocXDw38v7A3NRz9OR2V5vyhPSZDzQrZS+YB7MTbQ896Fa 1XaxtrLX2bUpT+9wAL4l8aju2kvKiYm7kT/IS4K+/wE1D9T69IP57KLz4jHT1BcJ2gBOGz rms+0BJEB+tC6L5rckgjrIHQN15179DhaXb8+QJhzNSjFY7FCi9FsMfZQ6x5PanrX6LiVH komJTd+MJSEaN78LdP/S483rpC0JcCucltyXO223+365ZRdOchTRdmz5rTtNADSbynnlmC c6EbtBWdTYOthjvcXWG+t/43I2eXIWW8r6Ufd4tEqnDnFDNT4ouQQIQaDh5hVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776371706; a=rsa-sha256; cv=none; b=At6I7+GHh2OXFf2jExPbIuDoUw5GrConf++Jv7Jlr4SjuQgFQgEiJusawU9vMP4jZz0Oh7 Uzl5/H0GjkIHdgbELp3Rd3qjfKXzeu8Eg/Sbl5dgNzl2MPqIuYDPdPbvWLZ6VsIFzddYvN so5Qz2Dlhhg0eP/43maiKhRiYkIPvpY46Hnf73kGcOnvmRdcOQ/bDOJAFcMoEWabdJ0ZPY 0FZzLA9d25R5k/rRUBVnLxxjfBgkggoe79bpLEqs/RLmA7fk55HB0E1ouH4g3BOdH5IgWB hxXYWo3skzabl3+rVfoFroa5mZYFlsnK73/qlKFMoMTus6T7LglUatssPC4dYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776371706; 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=RIJgbTT/L4aOn0JRNBf/7iQWp92Uutlh/TyOqhiOPBU=; b=ILPtDx3aqK5g7d7l77dKJWmUHl1jUY+HZIXc1ovuoss1FOnB0rnEozBLkzKQj9QHhstLRb DRG+nacP56grJ+b7T/bsOfno1e/cGOQzLOwkukCBLzegHpic76eWxbLQMvy6F8d3f5HIQI PjyU2EtAd/oKCWLfBj6pONyDWcWqXQZ0fSSUZefRYlL0zWAZthbBTIjqSBmtYGt6rYnezs dQGPhAKnt8/D65xAV683ned1k11ekGIq6sI8uezFsSDSsw6BfiawL1dlITX48x+QGalxdD Nllr7tOeOfjRAadDEj0PzuYaOJo4/1G2VPTmNVUStxHE6LhLv6eD2A2xm+ehdA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxVBL2zzvz7gb for ; Thu, 16 Apr 2026 20:35:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 20c7e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 20:35:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 6a3e2223ff35 - main - yacc: Fix SYSTEM_NAME List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6a3e2223ff35781fb837862f7cf7aaaa991968d9 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 20:35:06 +0000 Message-Id: <69e147fa.20c7e.1d428d56@gitrepo.freebsd.org> The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=6a3e2223ff35781fb837862f7cf7aaaa991968d9 commit 6a3e2223ff35781fb837862f7cf7aaaa991968d9 Author: Colin Percival AuthorDate: 2026-04-16 20:33:58 +0000 Commit: Colin Percival CommitDate: 2026-04-16 20:34:56 +0000 yacc: Fix SYSTEM_NAME This usually gets bumped by re@ when the version number changes in sys/conf/newvers.sh, but apparently we forgot for the past two major versions. --- usr.bin/yacc/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/yacc/config.h b/usr.bin/yacc/config.h index c9a9fe59139b..16ee996c427c 100644 --- a/usr.bin/yacc/config.h +++ b/usr.bin/yacc/config.h @@ -92,7 +92,7 @@ /* #undef STDC_NORETURN */ /* Define to the system name. */ -#define SYSTEM_NAME "freebsd14.0" +#define SYSTEM_NAME "freebsd16.0" /* "Define to 1 if you want to use dbmalloc for testing." */ /* #undef USE_DBMALLOC */ From nobody Thu Apr 16 21:05:41 2026 X-Original-To: dev-commits-src-main@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 4fxVsh5D2tz6Zfb1; Thu, 16 Apr 2026 21:05:44 +0000 (UTC) (envelope-from markj@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxVsh4h5hz3CXP; Thu, 16 Apr 2026 21:05:44 +0000 (UTC) (envelope-from markj@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776373544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bbR+BCRws9yM67pLXF4/9mJyg8dvYbwLpPiajzyMeYE=; b=NldC+iq1Kzj5b8P7IaPUmwesVl1C1Qh/KxoUzIHNac524MMgO2KlWoSCvhXK20yJ3y40vi 6cPecjvG2pRyJgkqg4eNtV0l1RI6triDPfeBAay+TwOa37z20fqM3DD/JU4M4EMivwqMgC l+6kMvpyQz8ryLcpT/hzurjrWRNiFY220zE5k6NWzCAEiIEW8IHC/gWfwtvy7jotAnIzAz M21SQeA9YjKxMMgoS6+09xuqk5zcz7SJU/99CMlpEjO59PVdLOLIVbqFmtl7Cu30D04/dc 0BZ4ebtvEpjpQayxn7CgOzVm3J6wv61nMa+ih2L1REJvbzqB5O/LtQKNtjrg+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776373544; a=rsa-sha256; cv=none; b=YyOG+c9bVhoZ0UKR9l4baxulwdXlM60Xc7fYfaxMJHDNNdu8u66YtBq6jwR13g1SOwwq6K vBxhMVVy881YBSw+tqkPy/vGd0lkF4jzBNQz8D1eiYgHpkQ03qti92iBTjOYCyIWI5S5mC moKD9MEytOnTcWf6wYmfflRxmCaIq3fFoiFGsV08WUtERyOjSC1/emhLuYiOLDRsj4s4/I AH4RSNeR5Nb596AzrVNJcYZ36NiLvBnOOlB8RvW1RSYa+cZMkxY/EZfxiGSzF03ceBdPgH /b/jMHPyX9PysXoevXI/eVwHzxTVuu9Nj27ni5DO/TQqRYXgjp5ZP/yqStixMQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776373544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bbR+BCRws9yM67pLXF4/9mJyg8dvYbwLpPiajzyMeYE=; b=lZQhDjFA0jeakMySgMRTHeEPeb86/VMcSlhY9YQkOWYhNyZAKJJ+RC7VdqDU+Y8ibhr+95 hndPUU5Sl4v9kjlLosjcuRtE8OTtINibuG9Q4FHpons/ubftTl/Jl0U3eKtYK2USRtS/B/ iV0GBCae5YK0p51b5tT+bwTIwcRe3WL0k4g55z1rW01GQ80VcyQdBb0OTfcEIANzOFTMSO BmydxT+tFTevyOClQI9R5vSBWbQo/cF6UqXjtaTvvVBEyoatCmDiK5ep13T6gQrpAbukMj Qpdhh3Ml/L7un8bh3hox4xhsE08i5tAhUJx2uDTy9MUsn2eXjx8Ra9/8PcK8Ag== Received: from nuc (192-0-220-237.cpe.teksavvy.com [192.0.220.237]) (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) (Authenticated sender: markj) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fxVsh1XqMzG8H; Thu, 16 Apr 2026 21:05:44 +0000 (UTC) (envelope-from markj@freebsd.org) Date: Thu, 16 Apr 2026 17:05:41 -0400 From: Mark Johnston To: Gleb Smirnoff Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 9b76228006d8 - main - inpcb: retire inp_vnet Message-ID: References: <69de65eb.21a5c.61244c2a@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <69de65eb.21a5c.61244c2a@gitrepo.freebsd.org> On Tue, Apr 14, 2026 at 04:06:03PM +0000, Gleb Smirnoff wrote: > The branch main has been updated by glebius: > > URL: https://cgit.FreeBSD.org/src/commit/?id=9b76228006d8f0e45dea03d305eeac587d7a8500 > > commit 9b76228006d8f0e45dea03d305eeac587d7a8500 > Author: Gleb Smirnoff > AuthorDate: 2026-04-14 16:02:00 +0000 > Commit: Gleb Smirnoff > CommitDate: 2026-04-14 16:02:00 +0000 > > inpcb: retire inp_vnet > > Now that a functional inpcb can not outlive its socket, just use socket's > vnet pointer. > --- > sys/kern/uipc_ktls.c | 4 ++-- > sys/netinet/in_pcb.c | 3 --- > sys/netinet/in_pcb.h | 8 -------- > sys/netinet/tcp_hpts.c | 2 +- > sys/netinet/tcp_timer.c | 10 +++++----- > 5 files changed, 8 insertions(+), 19 deletions(-) > > diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c > index 0112cf8b6941..4c3a4085b8db 100644 > --- a/sys/kern/uipc_ktls.c > +++ b/sys/kern/uipc_ktls.c > @@ -1797,7 +1797,7 @@ ktls_reset_send_tag(void *context, int pending) > INP_WLOCK(inp); > tp = intotcpcb(inp); > if (!(tp->t_flags & TF_DISCONNECTED)) { > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); > tp = tcp_drop(tp, ECONNABORTED); > CURVNET_RESTORE(); > if (tp != NULL) { > @@ -2475,7 +2475,7 @@ ktls_drop(struct socket *so, int error) > NET_EPOCH_ENTER(et); > INP_WLOCK(inp); > if (!(tp->t_flags & TF_DISCONNECTED)) { > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); > tp = tcp_drop(tp, error); > CURVNET_RESTORE(); > if (tp != NULL) > diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c > index af62aea91bf8..22c3287b93fd 100644 > --- a/sys/netinet/in_pcb.c > +++ b/sys/netinet/in_pcb.c > @@ -558,9 +558,6 @@ in_pcbinfo_init(struct inpcbinfo *pcbinfo, struct inpcbstorage *pcbstor, > > mtx_init(&pcbinfo->ipi_hash_lock, pcbstor->ips_hashlock_name, > NULL, MTX_DEF); > -#ifdef VIMAGE > - pcbinfo->ipi_vnet = curvnet; > -#endif > CK_LIST_INIT(&pcbinfo->ipi_list_unconn); > pcbinfo->ipi_count = 0; > > diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h > index 8663ba205b0a..1a6ce50aedbb 100644 > --- a/sys/netinet/in_pcb.h > +++ b/sys/netinet/in_pcb.h > @@ -299,7 +299,6 @@ struct xktls_session { > #include > #include > #include > -#include > #include > #include > > @@ -418,8 +417,6 @@ struct inpcb { > }; > }; > > -#define inp_vnet inp_pcbinfo->ipi_vnet > - > /* > * Per-VNET pcb database for each high-level protocol (UDP, TCP, ...) in both > * IPv4 and IPv6. > @@ -478,11 +475,6 @@ struct inpcbinfo { > * hashed by local port. > */ > struct inpcblbgrouphead *ipi_lbgrouphashbase; /* (r:e/w:h) */ > - > - /* > - * Pointer to network stack instance > - */ > - struct vnet *ipi_vnet; /* (c) */ > }; > > /* > diff --git a/sys/netinet/tcp_hpts.c b/sys/netinet/tcp_hpts.c > index 8dfbe126d46a..2bb78ed28372 100644 > --- a/sys/netinet/tcp_hpts.c > +++ b/sys/netinet/tcp_hpts.c > @@ -1359,7 +1359,7 @@ again: > */ > __tcp_set_hpts(pace, tp); > } > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); It's possible to have inp->inp_socket == NULL here. This is triggered by the sys/netinet/tcp_hpts_test.py tests. > /* Lets do any logging that we might want to */ > tcp_hpts_log(hpts, tp, &tv, slots_to_run, i, from_callout); > > diff --git a/sys/netinet/tcp_timer.c b/sys/netinet/tcp_timer.c > index b409daf5895e..ca242f2be627 100644 > --- a/sys/netinet/tcp_timer.c > +++ b/sys/netinet/tcp_timer.c > @@ -315,7 +315,7 @@ tcp_timer_delack(struct tcpcb *tp) > > INP_WLOCK_ASSERT(inp); > > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); > tp->t_flags |= TF_ACKNOW; > TCPSTAT_INC(tcps_delack); > NET_EPOCH_ENTER(et); > @@ -335,7 +335,7 @@ tcp_timer_2msl(struct tcpcb *tp) > INP_WLOCK_ASSERT(inp); > > TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); > tcp_log_end_status(tp, TCP_EI_STATUS_2MSL); > tcp_free_sackholes(tp); > /* > @@ -385,7 +385,7 @@ tcp_timer_keep(struct tcpcb *tp) > INP_WLOCK_ASSERT(inp); > > TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); > /* > * Because we don't regularly reset the keepalive callout in > * the ESTABLISHED state, it may be that we don't actually need > @@ -493,7 +493,7 @@ tcp_timer_persist(struct tcpcb *tp) > INP_WLOCK_ASSERT(inp); > > TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); > /* > * Persistence timer into zero window. > * Force a byte to be output, if possible. > @@ -560,7 +560,7 @@ tcp_timer_rexmt(struct tcpcb *tp) > INP_WLOCK_ASSERT(inp); > > TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); > - CURVNET_SET(inp->inp_vnet); > + CURVNET_SET(inp->inp_socket->so_vnet); > if (tp->t_fb->tfb_tcp_rexmit_tmr) { > /* The stack has a timer action too. */ > (*tp->t_fb->tfb_tcp_rexmit_tmr)(tp); > From nobody Thu Apr 16 22:21:51 2026 X-Original-To: dev-commits-src-main@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 4fxXYc3ldWz6Zmv0; Thu, 16 Apr 2026 22:21:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxXYc3BrJz3NYV; Thu, 16 Apr 2026 22:21:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776378116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ryKnZkq9cYP5sjNTLZtKzNwxbFy8Z62kkdqPys4LR4c=; b=HEpG0vTuIMmnyBv+ickiHR0qHbZdXRranpnbTTicxM4z74+1UQ4e2o+hsAfiTNl/7dKft+ /WbOXdxVmzV3Yu4iCyWgBD7/EzjszAlI5NzcbwVi8lWSyzpdz/wvlZQB2BxYfWjQdS6B7t N42nDBtrwAWcYonstdZYqp9k5UIak6BEXswzbyPZIaVh/K0AZMZXKvErrDukz7nxCUoGY+ zKWVT57Q3QUKnt/iWcL18Gsy/3EHxyevdz+ieCKXFfG1ql+gCGUFrl7LdB9dApaAiHWTVd B3UX+7lwmK8UbTF9kErPkUsHk+PR/TbswEV0zyNfbhy0Y7ia62XLzixTIytn7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776378116; a=rsa-sha256; cv=none; b=PDd9r7f9QAyKzSdwR6jfGILuwHeWBCN2fCiR7QsqwA7zCRkT54/OVizZKhLEKQHwX/qrq5 49W3Hg71tMIrGfBiznPOQzqNwzKkNmCaID6Nd8DI9AwDBGXMjMO/7YQMLZp+FBJanZB5x9 /mFPu6XxUaWq5ds+FklXuIW+5kknOf8n/25H1+vAm/3u/v0dwij58RnmmATr+jnmiCaBbr TOWQbwC6PCx5lrFBILuYALJAigPhxCEbIKWSQPW/aLEDt6ocIHXMUVuG//Q9g9IALoHO1n pWE2mdmw8UUlewaU8DzWErJJc2ZUM4Cn9QCqcb6a1tntiinKDtf11GpyRuu2Bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776378116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ryKnZkq9cYP5sjNTLZtKzNwxbFy8Z62kkdqPys4LR4c=; b=v9PN33fZwP0WbzHKqjG9h4n4yfdgPFPidmnJYT2xXVrwwPXN+gczahEX6nTREztaCkBu/p sfxnpVy16nN5cUVe911irMBBLE++wL/rYCIn/x37iqBXj7qxKANHQicRLliVvEJMg3OZyx HKoQWiS2LkfDb+L2iIulKKYPlesA3Zoj304l5rSIsqF6wB2X3Y40Ysp2hVH1IepDY/q7RW vuu2uxs9wqJsFmajTKKqNLnfAZIS2uk9y3GKV/Xdf/j45ZMfoVAd82HPB0kOeUvwc5Ga1c fwj1SavpJtR6hF8iGok05pY8tTWy8I+roGtUpj46GasM1zhEU/Q7x2wG70sBbA== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (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 (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R12" (not verified)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fxXYc1r41zJ4q; Thu, 16 Apr 2026 22:21:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 484DA1F027; Fri, 17 Apr 2026 00:21:53 +0200 (CEST) From: Kristof Provost To: Pouria Mousavizadeh Tehrani Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 688e289ee904 - main - ifconfig: Add support for geneve (netlink) Date: Fri, 17 Apr 2026 00:21:51 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: In-Reply-To: <69dcfad9.46b23.7e93103@gitrepo.freebsd.org> References: <69dcfad9.46b23.7e93103@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="=_MailMate_63B2A02B-69AA-45C6-8232-929A7F889685_=" --=_MailMate_63B2A02B-69AA-45C6-8232-929A7F889685_= Content-Type: text/plain; format=flowed; markup=markdown Content-Transfer-Encoding: quoted-printable On 13 Apr 2026, at 16:16, Pouria Mousavizadeh Tehrani wrote: > The branch main has been updated by pouria: > > URL: = > https://cgit.FreeBSD.org/src/commit/?id=3D688e289ee904fe625d92f93680a71= 753d03ba2ee > > commit 688e289ee904fe625d92f93680a71753d03ba2ee > Author: Pouria Mousavizadeh Tehrani > AuthorDate: 2026-04-11 18:38:41 +0000 > Commit: Pouria Mousavizadeh Tehrani > CommitDate: 2026-04-13 14:15:01 +0000 > > ifconfig: Add support for geneve (netlink) > > This implementation is netlink only > > Differential Revision: https://reviews.freebsd.org/D55184 This fails to build if WITHOUT_NETLINK_SUPPORT=3Dyes is set. I think we need this: diff --git a/sbin/ifconfig/Makefile b/sbin/ifconfig/Makefile index cc518693c2f5..26391023d54a 100644 --- a/sbin/ifconfig/Makefile +++ b/sbin/ifconfig/Makefile @@ -30,7 +30,6 @@ SRCS+=3D ifmedia.c # = SIOC[GS]IFMEDIA support SRCS+=3D iffib.c # non-default FIB support SRCS+=3D ifvlan.c # SIOC[GS]ETVLAN support SRCS+=3D ifvxlan.c # VXLAN support -SRCS+=3D ifgeneve.c # GENEVE support SRCS+=3D ifgre.c # GRE keys etc SRCS+=3D ifgif.c # GIF reversed header workaround SRCS+=3D ifipsec.c # IPsec VTI @@ -67,6 +66,7 @@ LIBADD+=3D nv .if ${MK_NETLINK_SUPPORT} !=3D "no" SRCS+=3D ifconfig_netlink.c +SRCS+=3D ifgeneve.c # GENEVE support .else CFLAGS+=3D-DWITHOUT_NETLINK .endif Best regards, Kristof --=_MailMate_63B2A02B-69AA-45C6-8232-929A7F889685_= Content-Type: text/html Content-Transfer-Encoding: quoted-printable

On 13 Apr 2026, at 16:16, Pouria Mousavizadeh Tehrani wro= te:

The branch main has been updated by pouria:

URL: https://cgit.FreeBSD.org/src/co= mmit/?id=3D688e289ee904fe625d92f93680a71753d03ba2ee

commit 688e289ee904fe625d92f93680a71753d03ba2ee
Author: Pouria Mousavizadeh Tehrani pouria@FreeBSD.org
AuthorDate: 2026-04-11 18:38:41 +0000
Commit: Pouria Mousavizadeh Tehrani pouria@FreeBSD.org
CommitDate: 2026-04-13 14:15:01 +0000

if=
config: Add support for geneve (netlink)

This implementation is netlink only

Differential Revision: https://reviews.freebsd.org/D55184

This fails to build if WITHOUT_NETLINK_SUPPORT=3Dyes is s= et.

I think we need this:

di=
ff --git a/sbin/ifconfig/Makefile b/sbin/ifconfig/Makefile
index cc518693c2f5..26391023d54a 100644
--- a/sbin/ifconfig/Makefile
+++ b/sbin/ifconfig/Makefile
@@ -30,7 +30,6 @@ SRCS+=3D        ifmedia.c               # SIOC[GS]IFMED=
IA support
 SRCS+=3D iffib.c                 # non-default FIB support
 SRCS+=3D ifvlan.c                # SIOC[GS]ETVLAN support
 SRCS+=3D ifvxlan.c               # VXLAN support
-SRCS+=3D ifgeneve.c              # GENEVE support
 SRCS+=3D ifgre.c                 # GRE keys etc
 SRCS+=3D ifgif.c                 # GIF reversed header workaround
 SRCS+=3D ifipsec.c               # IPsec VTI
@@ -67,6 +66,7 @@ LIBADD+=3D      nv

 .if ${MK_NETLINK_SUPPORT} !=3D "no"
 SRCS+=3D ifconfig_netlink.c
+SRCS+=3D ifgeneve.c              # GENEVE support
 .else
 CFLAGS+=3D-DWITHOUT_NETLINK
 .endif

Best regards,
Kristof

--=_MailMate_63B2A02B-69AA-45C6-8232-929A7F889685_=-- From nobody Thu Apr 16 22:39:52 2026 X-Original-To: dev-commits-src-main@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 4fxXyJ4JTJz6Zp7Q for ; Thu, 16 Apr 2026 22:39:52 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxXyJ3bSJz3Px6 for ; Thu, 16 Apr 2026 22:39:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776379192; 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=8y1rddsVf8CQ9qD8AxdtUsX2qVo+p2gZR4tz+OisRyM=; b=NcZVVDfOdDk9hIU2xquFK25FdfvqIG3FIJaa6ujWv+b+cSn22K999jERW4Nqii/TaGY8+U X/3RbXoeoVdGs7o4oxyYrka3xJchmFS/LOW55lTxgN731b+tdLBu7oBZB1rUk/r16LqwZm +psm0DCqL8sr1ek1gi3yaxZnzkeQ7PmLWk6QMFJxL7tp7XwB7Gwc43sZHu7KQRAW7lyZJb QlP89SHe7lsXUBIeD//++LxSWk5/+OyIMu3MGFo2XHPezrS35tOqnKuKS/Ma/PGLOaucyL zf5YysMqYlmV4puJFphfp8p163qPHtEn0DiYNHZb2DxzDNvpCAapNOc864ejCw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776379192; a=rsa-sha256; cv=none; b=DvElx2ESquqO47vdxobpJa4XjWvJBPuKhYj+Onrr/Wdhysf/AyaSUGtUOkiTQWPMAbF7IB pLaGsmV8DowkPXB30bZOMiHQ4BvDz5X7lU6NsYiNVT0riAmSFxsKHak40GxXGGs+Aa5vMo LQmgMWTaDZRus0ohIUmts2Q7veNo1hWobOZQ9y0Cvm+2OvRd8gqMBheX5YqeTFu6QOjFqy t99v194tFLX4PI0LYQSvmxxZ6ALHiGbZv4kWBg3vw5cZT71TdP7xNbfeC874AL0rUlMoHe wLt1xNdZrvQspSvcUg/kN39Laoj5do19k/bt4nco8n7yGABOV2zrck7TV6OfYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776379192; 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=8y1rddsVf8CQ9qD8AxdtUsX2qVo+p2gZR4tz+OisRyM=; b=uDIYQ85Ny9KsUaZ4UZXxtvPNq78lxTek/gCM9T7VOTRoKF95E1wQvG3UdbCQcTcTRgsZky whsHvGK3t/zZ7e88RvAzKnfjm5bIUJYZAt6cnEdz6ecGplCYXsIfAih0lVlPl5uG2AZbAe dMg4KkDuDOWrEPIu5xwDDmp18ci+c+cfg8RsiB5M7HuTIbrNGA5ED6d9H8vVvvVMbMMe1Q oOqvPxULse1UBJaVjjmoIaejVFEvu91yHjIWlBo8GsB6a8+O1MK2NpMDGRcdAznefJ1Idd ohltopkg0uoe9I3SG+OxqQu1piRve3mkYeGsRo1RORWKduqqq4OBy4O1hXTesA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxXyJ2wXZzBj4 for ; Thu, 16 Apr 2026 22:39:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 347b4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 22:39:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 680e6e30c020 - main - etherswitch: Add minimal support for mv88e6170 switch List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 680e6e30c02019c2a18c2ecfef3723b9adaa9ce5 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 22:39:52 +0000 Message-Id: <69e16538.347b4.3f0b14f@gitrepo.freebsd.org> The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=680e6e30c02019c2a18c2ecfef3723b9adaa9ce5 commit 680e6e30c02019c2a18c2ecfef3723b9adaa9ce5 Author: Justin Hibbits AuthorDate: 2026-04-16 22:35:32 +0000 Commit: Justin Hibbits CommitDate: 2026-04-16 22:35:32 +0000 etherswitch: Add minimal support for mv88e6170 switch --- sys/dev/etherswitch/e6000sw/e6000sw.c | 4 ++++ sys/dev/etherswitch/e6000sw/e6000swreg.h | 1 + 2 files changed, 5 insertions(+) diff --git a/sys/dev/etherswitch/e6000sw/e6000sw.c b/sys/dev/etherswitch/e6000sw/e6000sw.c index 7e9193f4ba47..771e64868740 100644 --- a/sys/dev/etherswitch/e6000sw/e6000sw.c +++ b/sys/dev/etherswitch/e6000sw/e6000sw.c @@ -302,6 +302,10 @@ e6000sw_probe(device_t dev) description = "Marvell 88E6352"; sc->num_ports = 7; break; + case MV88E6171: + description = "Marvell 88E6171"; + sc->num_ports = 7; + break; case MV88E6172: description = "Marvell 88E6172"; sc->num_ports = 7; diff --git a/sys/dev/etherswitch/e6000sw/e6000swreg.h b/sys/dev/etherswitch/e6000sw/e6000swreg.h index ec4503faeec5..aef79ad9de5d 100644 --- a/sys/dev/etherswitch/e6000sw/e6000swreg.h +++ b/sys/dev/etherswitch/e6000sw/e6000swreg.h @@ -45,6 +45,7 @@ struct atu_opt { #define MV88E6341 0x3410 #define MV88E6352 0x3520 #define MV88E6172 0x1720 +#define MV88E6171 0x1710 #define MV88E6176 0x1760 #define MV88E6190 0x1900 #define MV88E6190X 0x0a00 From nobody Thu Apr 16 22:39:53 2026 X-Original-To: dev-commits-src-main@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 4fxXyK4llFz6Zp0p for ; Thu, 16 Apr 2026 22:39:53 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxXyK47vTz3Q5J for ; Thu, 16 Apr 2026 22:39:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776379193; 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=cGNZ3g1REKHgLiPcHIGSuyNIHI/0IDc/pi8QXd8KBPw=; b=sv320lIVbE+Zn/6AOAwvbtmBiz3nnF8o29h0mpi5ETn8JiGy+X180Vtn3j91dhJRMQJltx e9SOeQ2Cv3dVMbhIn8w3PvzLsUvbkDT+KVFGWvkLWOfgFfgFn3gnKPHrWY4LcAFhadpY17 4TyyaJkOUgXQavtX4eOls9TLnMIb6ukZhwfRgC9YGlxLDVaPWvf3wUnaeb9NC6R7ljJQ6Y 7Wn2QP6zipXj8VexcdKF3fuU5S3ExhnLp38Wk8COX4g9Plet2iUwaxg8UyssSih/+wL3+w 3JnPJ6aEY8uzy/4m7DoJ7YvPjbuTRQUYFaMnRDIKAXvth1NfNtIF1PnYBhZAlg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776379193; a=rsa-sha256; cv=none; b=gPA9Jln72y08U/lEWhlpMZGsFcT68LhK+dZKvEkFO5lm/X5CdbsRLtf4h6HJIHxaqfWVus +6vokZPhkW1yDaK2E41Hv/en8riz8zgwn5y+Degm78+N/J8eeRIAQL0wM8bOBHue4woPnm sQefbjNt2vyJ5zh3x5taGJWhIJ1h3awy/XGlEyWzE0DhbfWERUsLMkq4v72JnaoO7BCdem DFInXuZd/HDpHLbC5PvNDZlJaFHILm2G4f5g31OcgB5PeTSC2iIPwoYXqk91iVSicxjIOo 1JaE1H7usA+TrOvcVmHt4RxRnyuTT3XpSEouoHyT9ecgnp5I3auMMOR7AIZmKw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776379193; 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=cGNZ3g1REKHgLiPcHIGSuyNIHI/0IDc/pi8QXd8KBPw=; b=LWtGVlPAxaIhsIK/gScPzqO6A7pP4Blz2G/8srHIXxMjEBL//CwYqMDYTQfl8E8rguzKKb mqtZYhQE0/PveG1DjaqibRsj/36eDkwN9No2vUQ9pUGKDD+xZ57ENs6vjvfi0FqQjUVG99 9X8LGLNBvAl0WrQWeQM3z51HJTk2a6Mv/OPKYooC/iN1W9nXKjh03qr8hpWhcBl41ReSim oZXjiy5LrkGTBDymG/sjzsY08d0pWwGjg7IXMnWVcEzNbxNtR1OjOoV+XhRR7Tnr4DQP8l OYlltmIoyzaO+afs3q9iSiZDe1bUjLYTW7T/bHamX/Cr4GfgRcA+v0nic1H7ZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxXyK3j4CzBj5 for ; Thu, 16 Apr 2026 22:39:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 372af by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 22:39:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 2fc58102426e - main - e6000/fdt: Ignore disabled switch ports List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2fc58102426ebb3a662675da2600591922a21082 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 22:39:53 +0000 Message-Id: <69e16539.372af.384f765d@gitrepo.freebsd.org> The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=2fc58102426ebb3a662675da2600591922a21082 commit 2fc58102426ebb3a662675da2600591922a21082 Author: Justin Hibbits AuthorDate: 2026-04-16 22:35:45 +0000 Commit: Justin Hibbits CommitDate: 2026-04-16 22:35:45 +0000 e6000/fdt: Ignore disabled switch ports Instead of trying to parse a bogus node, just skip it if marked disabled. --- sys/dev/etherswitch/e6000sw/e6000sw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/etherswitch/e6000sw/e6000sw.c b/sys/dev/etherswitch/e6000sw/e6000sw.c index 771e64868740..248a13952d35 100644 --- a/sys/dev/etherswitch/e6000sw/e6000sw.c +++ b/sys/dev/etherswitch/e6000sw/e6000sw.c @@ -575,6 +575,8 @@ e6000sw_attach(device_t dev) } for (child = OF_child(ports); child != 0; child = OF_peer(child)) { + if (!ofw_bus_node_status_okay(child)) + continue; err = e6000sw_parse_child_fdt(sc, child, &port); if (err != 0) { device_printf(sc->dev, "failed to parse DTS\n"); From nobody Thu Apr 16 22:39:54 2026 X-Original-To: dev-commits-src-main@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 4fxXyM1lwcz6Zp0s for ; Thu, 16 Apr 2026 22:39:55 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxXyL6DXxz3PxT for ; Thu, 16 Apr 2026 22:39:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776379194; 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=YMOoHkWts2C6my9WpOl1hiXNtaTyHmeaP5/X5M1wxAM=; b=e1sCXnYOgQ3+zugsnRilfacEDr6Sla6E2lk/CJYBtcjtvvqH6QGJ3pz7OH06+QklP3vCI1 2rTi4tb1D3dHChUnu1sXZHkwEwPdoJ7zEsGHuGTFWw3SOIjCQpAm9NL9cvJhtiWZL9mmyb lk4LIscvHg+INi9fLQCqEpzCudnWzVk52p3yljkc4M7PwzB4zyUDj08aNoHCbn8lSTle4u 7QoAcSnJJ2XcjZUXTmO7ire2OYFkE2ihUD0hapgL7rkQoKKn+iukJwil6d6bCPUX3z71nz cW39v5uK6YZO9kwN3lJ/hbzBMvuwfYnzX8XncFqmAiL2cEa3IOXq/Qp02PA2cQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776379194; a=rsa-sha256; cv=none; b=D13my+P1ised4CQY1HITMMGcj3jcr3xZxgTEHyD7PxBZPKN/IBPVnQQT1OxhADfO0MadJX k2keU47OLpDVeAVWDNh2NLyZbSaTVJJQpC8seAKVju7KcMPT69eo8/slJp2OkX52aK36IZ 8pYHJ8WK4iGc1w0W9dDB37MFZIMZVPBRL+2nlo/av8cWPjJZhBUqkvQA0riE18JEZpvWlj ubLQpcyto+GWnhNVgX5XYVasH4XTmWBB9RPdzFGlbol1ElTG69Nbvsuhcnl5fwKOY9VSun gIGvnqdbGJu4n54l2HPu2r8M+icBP2MI7wEyUP6P9j4paXoq9qfPuFAcZDIJ1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776379194; 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=YMOoHkWts2C6my9WpOl1hiXNtaTyHmeaP5/X5M1wxAM=; b=KUeBQAJXPwQnkcb4TArZYa3WpERKrHaj5pO0RKb1PUt5qmTSByX9ohDGg2/pQmCNmoIM3B CEW4bHVI9x/80Dlsl5OSCA8Vi1lwTEaOSljm4cOa8PcdeYyv0vC6HZvhCjuDCRjAOV/LYL qbzM2CSvlpaYymtZkVGmL2Ei38qfY3niRTuTgmZ8MSAMgZ/JF0SjBeRJzqxvCYfG/q9rH+ wn5yQY7YIyxXN+x0TACMXrGj6lLAttM1MUdSo2vijTw44BPraGdxh4rAGEK2CRMihjf+6R AJncMiRBKx+mz5ELyTJDYIQAfUvDUIwhnYJSY7T40S6ZkLwGUf4cAcAvn4si1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxXyL4YvzzBRT for ; Thu, 16 Apr 2026 22:39:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 347b8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 22:39:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 1fc50a4e68a1 - main - powerpc/pmap: Add support for page sizes found on E6500 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1fc50a4e68a1635f76d24694fc6ea8b94193c087 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 22:39:54 +0000 Message-Id: <69e1653a.347b8.5fe0671a@gitrepo.freebsd.org> The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=1fc50a4e68a1635f76d24694fc6ea8b94193c087 commit 1fc50a4e68a1635f76d24694fc6ea8b94193c087 Author: Justin Hibbits AuthorDate: 2026-02-01 03:44:21 +0000 Commit: Justin Hibbits CommitDate: 2026-04-16 22:35:52 +0000 powerpc/pmap: Add support for page sizes found on E6500 E6500 cores (MMUv2) support all powers-of-2 page sizes from 4k to 1TB, not just powers of 4. By using the other page sizes (8k, 32k, etc) we can save on TLB1 space, saving up to ~1/3 of used TLB1 entries. --- sys/powerpc/booke/pmap.c | 23 +++++++++++++++++------ sys/powerpc/include/spr.h | 5 +++++ sys/powerpc/include/tlb.h | 28 ++++++++++++++-------------- 3 files changed, 36 insertions(+), 20 deletions(-) diff --git a/sys/powerpc/booke/pmap.c b/sys/powerpc/booke/pmap.c index 08516b151e6b..a76ef6a089fd 100644 --- a/sys/powerpc/booke/pmap.c +++ b/sys/powerpc/booke/pmap.c @@ -177,6 +177,7 @@ static struct mtx copy_page_mutex; #endif static struct mtx tlbivax_mutex; +static bool mmuv2; /**************************************************************************/ /* PMAP */ @@ -640,6 +641,9 @@ mmu_booke_bootstrap(vm_offset_t start, vm_offset_t kernelend) debugf("mmu_booke_bootstrap: entered\n"); + if ((mfspr(SPR_MMUCFG) & MMUCFG_MAVN_M) > 0) + mmuv2 = true; + /* Set interesting system properties */ #ifdef __powerpc64__ hw_direct_map = 1; @@ -2703,7 +2707,7 @@ tsize2size(unsigned int tsize) * size = 4^tsize * 2^10 = 2^(2 * tsize - 10) */ - return ((1 << (2 * tsize)) * 1024); + return ((1UL << tsize) * 1024); } /* @@ -2713,7 +2717,7 @@ static unsigned int size2tsize(vm_size_t size) { - return (ilog2(size) / 2 - 5); + return (ilog2(size) - 10); } /* @@ -2772,23 +2776,29 @@ tlb1_mapin_region(vm_offset_t va, vm_paddr_t pa, vm_size_t size, int wimge) { vm_offset_t base; vm_size_t mapped, sz, ssize; + int shift; mapped = 0; base = va; ssize = size; + if (mmuv2) + shift = 1; + else + shift = 2; + while (size > 0) { - sz = 1UL << (ilog2(size) & ~1); + sz = 1UL << (ilog2(size) & ~(shift - 1)); /* Align size to PA */ if (pa % sz != 0) { do { - sz >>= 2; + sz >>= shift; } while (pa % sz != 0); } /* Now align from there to VA */ if (va % sz != 0) { do { - sz >>= 2; + sz >>= shift; } while (va % sz != 0); } #ifdef __powerpc64__ @@ -2805,7 +2815,8 @@ tlb1_mapin_region(vm_offset_t va, vm_paddr_t pa, vm_size_t size, int wimge) * For now, though, since we have plenty of space in TLB1, * always avoid creating entries larger than 4GB. */ - sz = MIN(sz, 1UL << 32); + if (!mmuv2) + sz = MIN(sz, 1UL << 32); #endif if (bootverbose) printf("Wiring VA=%p to PA=%jx (size=%lx)\n", diff --git a/sys/powerpc/include/spr.h b/sys/powerpc/include/spr.h index 605b1be194d9..5c6e9d67fcb4 100644 --- a/sys/powerpc/include/spr.h +++ b/sys/powerpc/include/spr.h @@ -864,5 +864,10 @@ #define BUCSR_BPEN 0x00000001 /* Branch Prediction Enable */ #define BUCSR_BBFI 0x00000200 /* Branch Buffer Flash Invalidate */ +#define SPR_MMUCFG 0x3f7 /* ..8 MMU Configuration Register */ +#define MMUCFG_PIDSIZE_M 0x000007c0 +#define MMUCFG_PIDSIZE_S 6 +#define MMUCFG_MAVN_M 0x00000003 + #endif /* BOOKE */ #endif /* !_POWERPC_SPR_H_ */ diff --git a/sys/powerpc/include/tlb.h b/sys/powerpc/include/tlb.h index 0a4463e0b928..33d31efab604 100644 --- a/sys/powerpc/include/tlb.h +++ b/sys/powerpc/include/tlb.h @@ -50,20 +50,20 @@ #define MAS1_TID_SHIFT 16 #define MAS1_TS_MASK 0x00001000 #define MAS1_TS_SHIFT 12 -#define MAS1_TSIZE_MASK 0x00000F00 -#define MAS1_TSIZE_SHIFT 8 - -#define TLB_SIZE_4K 1 -#define TLB_SIZE_16K 2 -#define TLB_SIZE_64K 3 -#define TLB_SIZE_256K 4 -#define TLB_SIZE_1M 5 -#define TLB_SIZE_4M 6 -#define TLB_SIZE_16M 7 -#define TLB_SIZE_64M 8 -#define TLB_SIZE_256M 9 -#define TLB_SIZE_1G 10 -#define TLB_SIZE_4G 11 +#define MAS1_TSIZE_MASK 0x00000F80 +#define MAS1_TSIZE_SHIFT 7 + +#define TLB_SIZE_4K 2 +#define TLB_SIZE_16K 4 +#define TLB_SIZE_64K 6 +#define TLB_SIZE_256K 8 +#define TLB_SIZE_1M 10 +#define TLB_SIZE_4M 12 +#define TLB_SIZE_16M 14 +#define TLB_SIZE_64M 16 +#define TLB_SIZE_256M 18 +#define TLB_SIZE_1G 20 +#define TLB_SIZE_4G 22 #ifdef __powerpc64__ #define MAS2_EPN_MASK 0xFFFFFFFFFFFFF000UL From nobody Thu Apr 16 22:39:55 2026 X-Original-To: dev-commits-src-main@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 4fxXyN0PYGz6Zp7T for ; Thu, 16 Apr 2026 22:39:56 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxXyM5n5zz3Q5j for ; Thu, 16 Apr 2026 22:39:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776379195; 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=hD5VzmPdv8Lcpo9y0roPoAeJkZh9HwpwIcPgES9+rf0=; b=c6jRKPpvbY829XqIPCLPyjVppujEM9zhe7YdO1rdXtcy8He0OyW8nGgpsFIoPVeZpnqOrk NzVFcSchQC73NgAiZBbvuMZm1p4EqWODJRmyAFJF8zcatP7bHb15/yveBwrRIxwhd9LGC1 +zR3x1l5M8X4o0tblDpoRkTeFe1exhWEZOA1En3TDtYEFSTFFwjq+BErX7U3gleqSXKu0n BOdrlT/RTRCcmYpugCRNRHFknPWO2QJeWWec9E+3J3XdH+zPjlzFOk1lMce+Z4JP/voAnM Oj5nHXiDmTFpU0Ko18r7doG9xDj0MxE7xzJMQiiq561HTTQQYbE+j0Yg00lMjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776379195; a=rsa-sha256; cv=none; b=mP6Uxg16IiblYlc5lEn4+8FoiBCNoiuye36w6Q0oXScl42Nlrinsx+xo7jLMXkR14m6LbM K3IYIj2J5/OybxPJlzh2ABKOZ4G61+Phme101A5KiQ+TLb2gcF8JnjLnNmp3dD/r5GxI7f j8Fgfyyf3GFEzv9jFLTN8PYoqHuY3MtPh/FIMBf4/BfJnerLRcRyy5YASEftufl/nakhSr eLi1ciR6MVfCmDl9ACVAtJPm8Ggi2BM6ehM9S3f1U6dsaueXfyqMTjGLyY4JX2GngXzZzw 4kWfcTx6UbXLjUw36ahvgiv0dfXtsRxY+8tNzSpGH06MmI7YyTiNhIg9L5ipaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776379195; 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=hD5VzmPdv8Lcpo9y0roPoAeJkZh9HwpwIcPgES9+rf0=; b=NYKxLvSzrwXtQitefIYrfXiQ7BXaBjQ3tgLRLfEbX8yBJK+S5rW5ONNtgFJDwL/woG1qlo Mlyd41cTJd0Gkm8PXGOYQ8iNruupKU1o/sz72Hc1lzXA771lUDQXq8uV6TeUpX80JlX0bW y3yb3gs9WdFlKkZx+h0XmZt4oQjlv4Uswg9WOUoO9CEJj1oltp/ndHdKtik+9EDWEzlhYV jziBHeo2srPOQFeWQ5KC6M6RYij2aZYUoPUATIHIqmWPDKtU8EgLWBNo4tSynDYBfoCwbE u9J3hkbmV/vm1INsS7ILrm1sltnG2I8kgX83C9xs12KJ38NcHz8VjCFeRFWt5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxXyM5DCnzBTM for ; Thu, 16 Apr 2026 22:39:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 347bc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 22:39:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 603a29b9b312 - main - mpc85xx: Support timebase sync on T-series devices List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 603a29b9b3126763c934afbed64fc43bf539469b Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 22:39:55 +0000 Message-Id: <69e1653b.347bc.204c98dd@gitrepo.freebsd.org> The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=603a29b9b3126763c934afbed64fc43bf539469b commit 603a29b9b3126763c934afbed64fc43bf539469b Author: Justin Hibbits AuthorDate: 2026-04-16 22:36:54 +0000 Commit: Justin Hibbits CommitDate: 2026-04-16 22:36:54 +0000 mpc85xx: Support timebase sync on T-series devices Freescale T-series QorIQ devices use a different register to twiddle the timebase enable. --- sys/powerpc/mpc85xx/platform_mpc85xx.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/sys/powerpc/mpc85xx/platform_mpc85xx.c b/sys/powerpc/mpc85xx/platform_mpc85xx.c index cc2ad829eb05..6781fdffa5a9 100644 --- a/sys/powerpc/mpc85xx/platform_mpc85xx.c +++ b/sys/powerpc/mpc85xx/platform_mpc85xx.c @@ -581,9 +581,19 @@ dummy_freeze(device_t dev, bool freeze) /* QorIQ Run control/power management timebase management. */ -#define RCPM_CTBENR 0x00000084 +#define RCPM_CTBENR_1_0 0x00000084 +#define RCPM_CTBENR_2_0 0x000001a0 + struct mpc85xx_rcpm_softc { struct resource *sc_mem; + bus_addr_t sc_ctbenr; + uint32_t sc_saved_tbenr; +}; + +struct ofw_compat_data compats[] = { + { "fsl,qoriq-rcpm-1.0", RCPM_CTBENR_1_0 }, + { "fsl,qoriq-rcpm-2.0", RCPM_CTBENR_2_0 }, + { NULL, 0 } }; static void @@ -593,16 +603,17 @@ mpc85xx_rcpm_freeze_timebase(device_t dev, bool freeze) sc = device_get_softc(dev); - if (freeze) - bus_write_4(sc->sc_mem, RCPM_CTBENR, 0); - else - bus_write_4(sc->sc_mem, RCPM_CTBENR, (1 << maxcpu) - 1); + if (freeze) { + sc->sc_saved_tbenr = bus_read_4(sc->sc_mem, sc->sc_ctbenr); + bus_write_4(sc->sc_mem, sc->sc_ctbenr, 0); + } else + bus_write_4(sc->sc_mem, sc->sc_ctbenr, sc->sc_saved_tbenr); } static int mpc85xx_rcpm_probe(device_t dev) { - if (!ofw_bus_is_compatible(dev, "fsl,qoriq-rcpm-1.0")) + if (ofw_bus_search_compatible(dev, compats)->ocd_str == NULL) return (ENXIO); device_set_desc(dev, "QorIQ Run control and power management"); @@ -622,6 +633,7 @@ mpc85xx_rcpm_attach(device_t dev) rid = 0; sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE | RF_SHAREABLE); + sc->sc_ctbenr = ofw_bus_search_compatible(dev, compats)->ocd_data; return (0); } From nobody Thu Apr 16 22:39:56 2026 X-Original-To: dev-commits-src-main@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 4fxXyP2SzGz6Znrq for ; Thu, 16 Apr 2026 22:39:57 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxXyN6TB9z3Py1 for ; Thu, 16 Apr 2026 22:39:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776379196; 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=KI18oxSHE4HXZbjwJb7vUrP+O9ZeEB7I4PAubV5efJk=; b=UAYvIYT9a0NzC8XwYeW7BuwgEIIc5fizU46oAQplvCs5yLBAsD/g40xG5ZsfUi2Go+vuV0 9FyhuLf48PGBI+fx/t1Z7l65a8Nwj99UQ/HoJg/xR+pyEF6bNSxrTDHy5tSobwoEOtL37k w3c0A714VCjjwqkKkiDEbMtVS7bydVMWuwLuBDmQjQ+RDVjUKzcveaPfmI9tcqIexoOJx7 5Ypslvt6rKyLQYntTkvmixPNWW9BI72PC6/vr8H0OyydluXoaCdOWQmMjhjEkQlcxQnXiz 5y1F/VDFYA4FKHdqGuFpRIbsBTaQHwkW+fuX5hK1VTv0U2VjtP0M9EOrh/z3pQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776379196; a=rsa-sha256; cv=none; b=MxLmFr0fZquPu+0VJPj1tqZ2Fvz4zlrSDVUeErZwQtv8NyIz2l708L1xCt5YKLwnzBBp/H /1iSmsAcB4pkU9shfjKRER0pZX7EtgjjNRR6nWlrIGT2HnQCLin0YYk6wiBJRscxo3VR+5 xV/X8WgomaiL0TtCGXf6lwWNLS4eK9tgM/bX1kaCkV15pqjvClinRx3AaQ+9budcBGopfn qPI7YYDkR3s1KWPkOSUYKKBogy0cu5lQqSuuVXAg9Hvj4jRmbcksiSTG/i4tg/3tm6vdd5 9aC4WUU8klSwuiPNptQdir+GKkk35LmzEedQpy+JF/hvRy7czQNsHXbkXRkW6A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776379196; 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=KI18oxSHE4HXZbjwJb7vUrP+O9ZeEB7I4PAubV5efJk=; b=E5tnDTHTSZM1/WUsY695RkZ+pT2QqUfe+jrmk5UL11Iyspj2stq/tcAM2g0BPY857qL97x q4IblKW0X4KCqGb4KNSA1E5FNlJ2HYEs5W9iXxaZDZrnwNxW/o5t/kbRqROFUS1I9ogNji iSiqrAgOEgCSis2o4ncH5r3B57zBonERRHwezkZN15KO9f88CkeCGTTVQC0ADoFjPMO9+H epsI7Rwt0Ml8Rj9k3IGN8w6ss8VVhpiiZKOr48bjWtxxCYIo08iFFIWg0bbeWMbD86VFTb i6icszWcejXRLv/Pm8e+bJ+nNBy718FNWmKE1AaW/o/x7NBm/FhASQPbqNMU1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxXyN61dlzBRV for ; Thu, 16 Apr 2026 22:39:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 36662 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 22:39:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: a249ddf07873 - main - powerpc/intr setup: Don't check intr name for IPI List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a249ddf07873be97967dd83df4d098ea95d0c92a Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 22:39:56 +0000 Message-Id: <69e1653c.36662.6dcf2e8c@gitrepo.freebsd.org> The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=a249ddf07873be97967dd83df4d098ea95d0c92a commit a249ddf07873be97967dd83df4d098ea95d0c92a Author: Justin Hibbits AuthorDate: 2026-04-16 22:37:01 +0000 Commit: Justin Hibbits CommitDate: 2026-04-16 22:37:01 +0000 powerpc/intr setup: Don't check intr name for IPI Since whether or not the irq is an IPI is passed into powerpc_setup_intr_int(), use this as the check for IPI instead of checking the name string. --- sys/powerpc/powerpc/intr_machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c index daab391bb800..7e742845dbd3 100644 --- a/sys/powerpc/powerpc/intr_machdep.c +++ b/sys/powerpc/powerpc/intr_machdep.c @@ -537,7 +537,7 @@ powerpc_setup_intr_int(const char *name, u_int irq, driver_filter_t filter, if (error) return (error); i->pi_domain = domain; - if (strcmp(name, "IPI") != 0) { + if (ipi) { CPU_ZERO(&i->pi_cpuset); CPU_COPY(&cpuset_domain[domain], &i->pi_cpuset); } From nobody Thu Apr 16 22:48:18 2026 X-Original-To: dev-commits-src-main@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 4fxY823dd7z6Zpjj for ; Thu, 16 Apr 2026 22:48:18 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxY822tTsz3T0h for ; Thu, 16 Apr 2026 22:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776379698; 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=YCisn3kR62RAX2cmVzLMoWkGcn0+IVJc4C3chFc+xO8=; b=CEEfcAZu/3pSG9LmFkXv++mOSK3Thoo/Qlr3ZWXXxjCfxcSYBRPkZibN8zt7WrMoF6etKQ Wm4iQUboweVncERkrGIXMMWGkx6zN1WZgvNuEyB8WwhbZ0Pfhy1O+Ax8iJEPwpgPi86Ms8 gu2TtLFhXvAea4TDZQ9QrolPSDxbOn270aXJhBskfvMQn+uzjsSUFIZj/RXigUcxrOpTkd SmnFxuzRroy6pq5tFBJwNRnYLmlu5I+GyqkvP8SjHUeXGegS4nQieMwz11b6Ww2zGMGLn7 GEX1jw396RTU51uABrsT19Io6yoNSBXRXU21MdgT9APyJRmxdVAEx1izLSXMOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776379698; a=rsa-sha256; cv=none; b=rN8Lf+LkuxPfWgLB88A6z54XkIHa1Vfd5JFJLlwQbCssDJ/86L7NMATPgu8lKQfM6JDXX6 wg0VFvcma88JXTf1PbsS5kySURG/cxUqGMEB++hcC8hvxMcOPJo/SXu+S3FVU6ejPpf+sX 0j0MIpM7YDAatNgFtbuRkYi24UU6KwPo9OUDwbiaC9gyxSDKCLZkvkhs6Zs9r2GFuOFDyW L7vMU+/gzubTXcL20LCvsAyDNVVkepp/NQQ0zAahKKtjN44leCF73KpoBhlOnfUtFV0fTS /cgyYDNWzFlRzE3wPgTBdGuGY6sjnUFaok7jayaW2JZCsR+QRau1FpFwfiRiEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776379698; 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=YCisn3kR62RAX2cmVzLMoWkGcn0+IVJc4C3chFc+xO8=; b=HxmSoBk4Q1boPA0Ty/btOizRkSKjVYFJrS9LNYGh8X9q7VEE8K+ysJkkXm/MPtVIeumjFF jEhWbc56tqZUHdRHWq8c4TxWSZ2KqWtNhuxVLQ2X14unEDhmKvFKjIS12VIYg7l0D0KjhZ Ay+Sc9x2UTlqBcp9fC69+iokZ+rxSZMxzfI7YLqDzFTFf4+MS5oy++iQle8OCsT7qWZXYg kHjSe6Y4atQSlgGqVegp18uaMhVRoPaNM4nH5jK0CfTdNRrevENtQfRV/D1D+wn55bDWm9 Vfs6Yj7I6NMdCowM2dONtEr/cfzCFmRUz4q7Q7ZRCDhvV+pdHW0zjpmlMPJB0Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxY822CRvzC96 for ; Thu, 16 Apr 2026 22:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3666d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 22:48:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: 19887b9c4cec - main - ifconfig: Do not build geneve with WITHOUT_NETLINK_SUPPORT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 19887b9c4cec9c6468481ef415bbf94f68592856 Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 22:48:18 +0000 Message-Id: <69e16732.3666d.506e1111@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=19887b9c4cec9c6468481ef415bbf94f68592856 commit 19887b9c4cec9c6468481ef415bbf94f68592856 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-16 22:40:02 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-16 22:47:59 +0000 ifconfig: Do not build geneve with WITHOUT_NETLINK_SUPPORT geneve(4) is netlink-only, therefore, don't build it with WITHOUT_NETLINK_SUPPORT=1 set. Reported by: kp Fixes: 688e289ee904 ("ifconfig: Add support for geneve (netlink)") Differential Revision: https://reviews.freebsd.org/D55184 --- sbin/ifconfig/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ifconfig/Makefile b/sbin/ifconfig/Makefile index cc518693c2f5..26391023d54a 100644 --- a/sbin/ifconfig/Makefile +++ b/sbin/ifconfig/Makefile @@ -30,7 +30,6 @@ SRCS+= ifmedia.c # SIOC[GS]IFMEDIA support SRCS+= iffib.c # non-default FIB support SRCS+= ifvlan.c # SIOC[GS]ETVLAN support SRCS+= ifvxlan.c # VXLAN support -SRCS+= ifgeneve.c # GENEVE support SRCS+= ifgre.c # GRE keys etc SRCS+= ifgif.c # GIF reversed header workaround SRCS+= ifipsec.c # IPsec VTI @@ -67,6 +66,7 @@ LIBADD+= nv .if ${MK_NETLINK_SUPPORT} != "no" SRCS+= ifconfig_netlink.c +SRCS+= ifgeneve.c # GENEVE support .else CFLAGS+=-DWITHOUT_NETLINK .endif From nobody Fri Apr 17 00:31:29 2026 X-Original-To: dev-commits-src-main@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 4fxbR55nq6z6b04X for ; Fri, 17 Apr 2026 00:31:29 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxbR549xYz3cfG for ; Fri, 17 Apr 2026 00:31:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776385889; 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=OPeU/cLRy7Rteyhct0Sppmahg47o5IN0zH1CXc9Orb8=; b=gFcSiRBbjuKxZhJ40OXA+v+/2cgGf1nYZFj2raZD0sC726T/eTph81l1Dfndi/sscaq+OF 8uGk6HPmpNk97zJSDSYwmZRi8h+oOEDCHbri+L9+tcp7UwDUeAWafdcJGdnXY/TkMOF5Uf A7FWEAFTSfgWantOydRe4b4k2/Tf49K/wl1+6kgJHfGG4BTynOQmQikYA8JVBmgoSLHhwK YH/nHYOfLc7DIU9ijgDkx1/qerzkseSkcvEbcoXRL1i1YQMjfgKfQ2G5KciwgX6h4HiyTZ GtssqneKLZ8SjjN7ESDmvggbUZVUXd73RnuHM4Lw054SmHc4knWHJd0TKKf/NA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776385889; a=rsa-sha256; cv=none; b=LDl4IFkeJzDgdu70szto4HGqjqCAgE6rGgoXTlFhlZ/N/j44nJDzNtR9HfSBT9pb2wJpnm EuBECKmCJ6LWp18ItaiYdA7+dRyJ/ZmuM9hJOx68fh0z9WIZ3y6j5YnWs8d8KdMgvFG/IY 4CsKeO9opoZfG52hQC9ESfI3v3R5+UQuIWJLSN09KhkyU7kyIXUrqVpKIlZro/iOzqgXbn //0aX3zFYumeLrv5Y6ayde2b3m6L4gd85XJCEIW3yt13r9F8IYJs8gycJsKH7/4ZTfyV/u tpN1TqBTJNnPOOJzaIsNRCWGT0M5tpuLYpTAnpsTUKMP6QxLU9glbQpwLF5bzQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776385889; 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=OPeU/cLRy7Rteyhct0Sppmahg47o5IN0zH1CXc9Orb8=; b=Xd/lVaSrSpcLLHDLaIhHT1R4g9giUME7F1OpHCYMmKGwbOtIJGjAM6GXZ/oe0xpoEsh0f3 GrfejSG0mxZn0fQhL0MB9C/PZlVEFJ2A3Hh10WW0ROC81gRglOPaYgAyl4Qs7JvwlTeHEM w05yXUbxq29GNpSFtV4hwSNq+7wSa8uCfeOGlqQ8xq4PQIRheh4kapUWKxdTdk4ct6aVgX 2tT4yQIX88O9kStF1B8N/Hjg7Q5ZPAy+0IvKu6sj1jLnMIIZfOOCptcNpi8qk+2X1+wm1r xxyhiTVvxe87VcHqRs1s5KlcpywHtSOHtC+HsXWAmsrdhdnZQEcv0DmbVCM7kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxbR53nWWzWTf for ; Fri, 17 Apr 2026 00:31:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 423fe by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 00:31:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: b49b3ccd40bd - main - ntp_adjtime.2: Increase visibility List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b49b3ccd40bda02f530c679f23f42ba9e0e4b2e2 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 00:31:29 +0000 Message-Id: <69e17f61.423fe.9eddfa6@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=b49b3ccd40bda02f530c679f23f42ba9e0e4b2e2 commit b49b3ccd40bda02f530c679f23f42ba9e0e4b2e2 Author: Alexander Ziaee AuthorDate: 2026-04-17 00:30:38 +0000 Commit: Alexander Ziaee CommitDate: 2026-04-17 00:30:46 +0000 ntp_adjtime.2: Increase visibility + s/ntp/ntpd/ for correctness + apropos results in document description + silence a linter warning by escaping a period with a zero-width space MFC after: 3 days --- lib/libsys/ntp_adjtime.2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libsys/ntp_adjtime.2 b/lib/libsys/ntp_adjtime.2 index 5be5194a9c1d..ed43fb79a9f1 100644 --- a/lib/libsys/ntp_adjtime.2 +++ b/lib/libsys/ntp_adjtime.2 @@ -27,13 +27,13 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 13, 2005 +.Dd March 22, 2026 .Dt NTP_ADJTIME 2 .Os .Sh NAME .Nm ntp_adjtime , .Nm ntp_gettime -.Nd Network Time Protocol (NTP) daemon interface system calls +.Nd Network Time Protocol daemon (ntpd) interface system calls .Sh LIBRARY .Lb libc .Sh SYNOPSIS @@ -59,7 +59,7 @@ The time offset and related variables which are set by are used by .Fn hardclock to adjust the phase and frequency of the phase- or frequency-lock loop -(PLL resp. FLL) which controls the system clock. +(PLL resp\&. FLL) which controls the system clock. .Pp The .Fn ntp_gettime From nobody Fri Apr 17 02:40:15 2026 X-Original-To: dev-commits-src-main@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 4fxfHg38kvz6b9N2 for ; Fri, 17 Apr 2026 02:40:15 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxfHg2JWWz3rXj for ; Fri, 17 Apr 2026 02:40:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776393615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7djJodo7tHnztR+j/ixbKwZ58QGP6zAr0wKdLh3iDns=; b=FSgC0J8mmDRT25hK9H79m6F7nt8hWbcwQifpYhTM3OXGzkVCEy0ZZNQZteUN3inxX1Mzax dwYIqivMRKHWYyhtNhPEMrCWLmGs1J577mS19w0P05C73gZiVy1jJRPho6mE83eYiG3Oif dFsfif7LCBKAr4htfUhnXMnibLF2Gen2nhne34jhTG4gZMRXLCiaz7cCxKNarWHIs7v47s JAWb7X+oyP++q34kK7MQ8Xj/e7gFf/UwIBfd1w4bmwWr+7IA3z963y4q0VXmpiqEU3WQQb X4lqZyUMhgn64cnW1caEo0qdgRG5wPQEoi7k08tfwSJjaokIRRaDVuJ1/edA4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776393615; a=rsa-sha256; cv=none; b=JoAH1y0UQrLMm0iwyCS6eFiW+Q2gwRfoYYbay1VXjQhrNsDicwtQ3Aq5+oqzbY7CM4EPaI EGGPlGJRcyStpGKeIZFZ59Xdve4ECaN0IuJEaJRyhIbrRXAh+RJskEXcckeGKcRwE17DHw K4OzlMY2jgAZT2gk7DwxSsPkK2naD0BVqgIiHD0Isi4yGafAWlNVPZk0ANHgp8mPEfqAvj Y7qv1MwDdDotlpjR3gYPRdkbuCvxg0f+Gq7hZ+H1EjVAjqmp5A5Ig/917zKqXUfOlI02Bm /eRPB2PDb1NR0xjd/ltZVRKtHpcMYIxCDIsFyQntQRBGLpZwV9h3CTVoLkcekw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776393615; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7djJodo7tHnztR+j/ixbKwZ58QGP6zAr0wKdLh3iDns=; b=sst0fLTgABCtImUdKkwVF6nWp90ouP2/CxwF63Ms9GHzBB2A43X4SYkNyqXunnO6Xf9MWU NqgMqFkVDisl02StFUqd4nGeSQ4HB88JWnCnZ49p3+jM6bytJOOC3fyFG7g/KzkRlJoeF0 Fc/Rim89X2XLlBmX4UxsF1hXBBZCyZiebuoY7p7l5HkiKkLmBHF0njV/Hizm2tWU5Xd/mp Ntumd8Lu+CvJdsx6l/uRzC+bDBuEXhxhwE9EUwD7UkUgrquSz3PwXFz7hvT9wgniv7qLcK CiXI32A3ocKTO6DQMHDDgDmlMNQxGaCX8jTJxU8jZ98l7dVRZ/nuJM3UnCY2gQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxfHg1fFrzbJv for ; Fri, 17 Apr 2026 02:40:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1ff1d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 02:40:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Christos Longros From: Adrian Chadd Subject: git: 4390c37b5c94 - main - rge: add disable_aspm tunable for PCIe power management List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4390c37b5c94b6de4cb4bdbcc3967efe74fa7517 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 02:40:15 +0000 Message-Id: <69e19d8f.1ff1d.4295e473@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=4390c37b5c94b6de4cb4bdbcc3967efe74fa7517 commit 4390c37b5c94b6de4cb4bdbcc3967efe74fa7517 Author: Christos Longros AuthorDate: 2026-04-17 02:34:55 +0000 Commit: Adrian Chadd CommitDate: 2026-04-17 02:34:55 +0000 rge: add disable_aspm tunable for PCIe power management Add a per-interface loader tunable dev.rge.%d.disable_aspm to disable PCIe ASPM (L0s/L1) and ECPM on the RTL8125/8126/8127. Disabling ASPM reduces latency at the cost of higher power consumption. Default is off (ASPM left as configured by BIOS). Signed-off-by: Christos Longros Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D56103 --- share/man/man4/rge.4 | 9 +++++++++ sys/dev/rge/if_rge.c | 28 ++++++++++++---------------- sys/dev/rge/if_rge_sysctl.c | 5 +++++ sys/dev/rge/if_rgevar.h | 1 + 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/share/man/man4/rge.4 b/share/man/man4/rge.4 index f9077a56f28b..24c42f9106dc 100644 --- a/share/man/man4/rge.4 +++ b/share/man/man4/rge.4 @@ -152,6 +152,15 @@ Maximum number of RX packets to process per interrupt. The default value is 16. Increasing this value may improve throughput on high-speed links at the cost of increased interrupt latency. +.It Va dev.rge.%d.disable_aspm +Disable PCIe Active State Power Management (ASPM) and Extended +Configuration Power Management (ECPM). +The default value is 0 (leave ASPM enabled). +Setting this to 1 reduces latency at the cost of increased power +consumption. +This tunable can only be set in +.Xr loader.conf 5 +and requires a reboot to take effect. .El .Sh DIAGNOSTICS .Bl -diag diff --git a/sys/dev/rge/if_rge.c b/sys/dev/rge/if_rge.c index 17225e065482..8887e8d39ae4 100644 --- a/sys/dev/rge/if_rge.c +++ b/sys/dev/rge/if_rge.c @@ -445,23 +445,19 @@ rge_attach(device_t dev) rge_config_imtype(sc, RGE_IMTYPE_SIM); - /* TODO: disable ASPM/ECPM? */ - -#if 0 - /* - * PCI Express check. - */ - if (pci_get_capability(pa->pa_pc, pa->pa_tag, PCI_CAP_PCIEXPRESS, - &offset, NULL)) { - /* Disable PCIe ASPM and ECPM. */ - reg = pci_conf_read(pa->pa_pc, pa->pa_tag, - offset + PCI_PCIE_LCSR); - reg &= ~(PCI_PCIE_LCSR_ASPM_L0S | PCI_PCIE_LCSR_ASPM_L1 | - PCI_PCIE_LCSR_ECPM); - pci_conf_write(pa->pa_pc, pa->pa_tag, offset + PCI_PCIE_LCSR, - reg); + /* Disable PCIe ASPM and ECPM if requested. */ + if (sc->sc_disable_aspm) { + int ecap; + if (pci_find_cap(dev, PCIY_EXPRESS, &ecap) == 0) { + uint16_t lctl; + lctl = pci_read_config(dev, + ecap + PCIER_LINK_CTL, 2); + lctl &= ~(PCIEM_LINK_CTL_ASPMC | + PCIEM_LINK_CTL_ECPM); + pci_write_config(dev, + ecap + PCIER_LINK_CTL, lctl, 2); + } } -#endif RGE_LOCK(sc); if (rge_chipinit(sc)) { diff --git a/sys/dev/rge/if_rge_sysctl.c b/sys/dev/rge/if_rge_sysctl.c index 16001b4c1d94..75e2316042ea 100644 --- a/sys/dev/rge/if_rge_sysctl.c +++ b/sys/dev/rge/if_rge_sysctl.c @@ -237,6 +237,11 @@ rge_sysctl_attach(struct rge_softc *sc) "rx_process_limit", CTLFLAG_RW, &sc->sc_rx_process_limit, 0, "max number of RX packets to process per interrupt"); + sc->sc_disable_aspm = 0; + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "disable_aspm", CTLFLAG_RDTUN, &sc->sc_disable_aspm, 0, + "disable PCIe ASPM and ECPM (requires reboot)"); + /* Stats */ rge_sysctl_drv_stats_attach(sc); rge_sysctl_mac_stats_attach(sc); diff --git a/sys/dev/rge/if_rgevar.h b/sys/dev/rge/if_rgevar.h index 89d02e8acb72..2e80dcf42187 100644 --- a/sys/dev/rge/if_rgevar.h +++ b/sys/dev/rge/if_rgevar.h @@ -205,6 +205,7 @@ struct rge_softc { uint32_t sc_debug; int sc_rx_process_limit; + int sc_disable_aspm; struct rge_drv_stats sc_drv_stats; From nobody Fri Apr 17 02:40:14 2026 X-Original-To: dev-commits-src-main@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 4fxfHl6wRGz6b9Fr for ; Fri, 17 Apr 2026 02:40:19 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxfHl4QL2z3rdY for ; Fri, 17 Apr 2026 02:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776393619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3AzPzUyTwX0HaHxGKY9l4LtoiUCThIiLJ+AO312TgAc=; b=t3ZePcYxG+E2gSwN4y7ZHYhhb2g5MP06jwACaNiNVqSeLef0gsgZE/FqyheXh8BpTDMMks /hYNHhNKFOOxCOdpICg36CS497lP6ON0PP7JydcZsQcKCZygr6imAJQ6TA3YZaDi/SEKr1 F7plvreuldIiwHtZg8JU0wPiRUyOl2FXFnavfqyMhpWPy6rUxa7qfjd9vlHvJNnuLJrinY 8r/ZUYVhX0g9QM27jsRTIvnJ5wAvFmqbd8AykO4AJurZSspFhgIebsbj4g7Xr0Hp3HFg/K KNZsjwcgd/ITJNy301+87R3itrIqEullfmUHhw/Jft2pNNDGo1ELDFtIGJL5+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776393619; a=rsa-sha256; cv=none; b=l2LpqTXBWtks4TRjy0V0CfV2LF5C8nwD58w51AKAxoLbOpJY2k2Zb61sAbOjTyJ8iPiCbk sMm+VetncS+Cr0htlm2YRdngIwWCyhK8vVndcNA+CSXP/TtLXkz9LE6xmW32aasjrTZlnh HPhuksHBevjk1jbhMga1J6D4peHw5hJxZPe7Zdw68b4rJsoqadNJcfSVsS+nk3rtmk/bBP Uq1xdkQsR996Ad5I7eK0hugLLxFLs2+3qz9ibn1199AuJXrLnaSsvwxGm6cTO8SrP+gGwx AznBgtM9xuPUq72lvmrZ3AP8LZ91xh3rGuVpKWr7FO4+a5TrE32V7nFn9cfM2w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776393619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3AzPzUyTwX0HaHxGKY9l4LtoiUCThIiLJ+AO312TgAc=; b=JhYZpxz0fSg+tQM0la5eQQtO9MH2m4xjFB6pcz1/jl8yyZF9mif3BYsAO7jYaooBajPE5/ DrOnbqpKk4G+2Znp4K5KgppdQ8/8UNX7Znu4P3xn34w32Ug3JPj3Bk1S5x9R/5N2+f3ddD SPa6dHfnZwXLuZHy/v/yStWMhAP5Lo0gxJHjArboOmIMZ+3E3zO6dAoc5o+bL7RcbdNscE yavKEKsi9Ix9W4OdA8QMsYuO8nF5zMQK1hAuTSJthE6oEm0n5kv9osCNUhMvRzB8dJVyhI lSNAmdcgfJt7uISarEd7PJn3/wmJ9P4/Gcj2ETWY8CJESAd35UuEpXF2sUrlCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxfHl355CzbVT for ; Fri, 17 Apr 2026 02:40:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1fe9f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 02:40:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Abdelkader Boudih From: Adrian Chadd Subject: git: aae906840494 - main - asmc: add automatic voltage/current/power/ambient sensor detection List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aae9068404947dd9ffd8522359d0f9dffaa70414 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 02:40:14 +0000 Message-Id: <69e19d8e.1fe9f.68a0f647@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=aae9068404947dd9ffd8522359d0f9dffaa70414 commit aae9068404947dd9ffd8522359d0f9dffaa70414 Author: Abdelkader Boudih AuthorDate: 2026-04-17 02:31:21 +0000 Commit: Adrian Chadd CommitDate: 2026-04-17 02:31:37 +0000 asmc: add automatic voltage/current/power/ambient sensor detection Apple SMCs contain numerous undocumented voltage, current, power, and ambient light sensors. This change adds automatic detection and registration of these sensors as sysctls. New sysctl trees: dev.asmc.0.voltage.* - Voltage sensors (millivolts) dev.asmc.0.current.* - Current sensors (milliamps) dev.asmc.0.power.* - Power sensors (milliwatts) dev.asmc.0.ambient.* - Ambient light sensors Implementation: - Scans all SMC keys at attach time via asmc_key_dump_by_index() - Identifies sensors by key prefix patterns: - Voltage: VC*, VD*, VG*, VP*, VI* - Current: I{C,D,G,M,N,O,H,P,B,A,L}* - Power: P{C,D,N,S,T,H,F,Z,z}* - Light: ALV*, ALS* - Dynamically creates sysctls for detected sensors - Supports 8 fixed-point SMC data types: - sp78, sp87, sp4b, sp5a, sp69, sp96, sp2d, ui16 - Auto-converts all values to milli-units (mV, mA, mW) On Mac Mini 5,1, detects: - 7 voltage sensors - 18 current sensors - 27 power sensors - 2 ambient light sensors Enables power consumption monitoring, voltage rail debugging, and ambient light detection without hardcoding model-specific sensor lists. Tested on: - Mac Mini 5,1 (2011) running FreeBSD 15.0-RELEASE - 54 sensors auto-detected and exposed via sysctl - All sensor types verified with multimeter readings - Fixed-point conversions validated against known values - Memory management tested (malloc/free on detach) Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D55807 --- sys/dev/asmc/asmc.c | 437 ++++++++++++++++++++++++++++++++++++++++++++++++- sys/dev/asmc/asmcvar.h | 10 ++ 2 files changed, 445 insertions(+), 2 deletions(-) diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index 7cd5181605a8..0a701e6fd663 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -123,15 +123,22 @@ static int asmc_mbp_sysctl_light_control(SYSCTL_HANDLER_ARGS); static int asmc_mbp_sysctl_light_left_10byte(SYSCTL_HANDLER_ARGS); static int asmc_wol_sysctl(SYSCTL_HANDLER_ARGS); +static int asmc_key_getinfo(device_t, const char *, uint8_t *, char *); + #ifdef ASMC_DEBUG /* Raw key access */ -static int asmc_key_getinfo(device_t, const char *, uint8_t *, char *); static int asmc_raw_key_sysctl(SYSCTL_HANDLER_ARGS); static int asmc_raw_value_sysctl(SYSCTL_HANDLER_ARGS); static int asmc_raw_len_sysctl(SYSCTL_HANDLER_ARGS); static int asmc_raw_type_sysctl(SYSCTL_HANDLER_ARGS); #endif +/* Voltage/Current/Power/Light sensor support */ +static int asmc_sensor_read(device_t, const char *, int *); +static int asmc_sensor_sysctl(SYSCTL_HANDLER_ARGS); +static int asmc_detect_sensors(device_t); +static int asmc_key_dump_by_index(device_t, int, char *, char *, uint8_t *); + struct asmc_model { const char *smc_model; /* smbios.system.product env var. */ const char *smc_desc; /* driver description */ @@ -963,6 +970,16 @@ asmc_detach(device_t dev) if (sc->sc_kbd_bkl != NULL) backlight_destroy(sc->sc_kbd_bkl); + /* Free sensor key arrays */ + for (int i = 0; i < sc->sc_voltage_count; i++) + free(sc->sc_voltage_sensors[i], M_DEVBUF); + for (int i = 0; i < sc->sc_current_count; i++) + free(sc->sc_current_sensors[i], M_DEVBUF); + for (int i = 0; i < sc->sc_power_count; i++) + free(sc->sc_power_sensors[i], M_DEVBUF); + for (int i = 0; i < sc->sc_light_count; i++) + free(sc->sc_light_sensors[i], M_DEVBUF); + if (sc->sc_sms_tq) { taskqueue_drain(sc->sc_sms_tq, &sc->sc_sms_task); taskqueue_free(sc->sc_sms_tq); @@ -1134,6 +1151,12 @@ nosms: sc->sc_nkeys = 0; } + /* + * Auto-detect and register voltage/current/power/ambient sensors. + * Scans SMC keys and creates sysctls for detected sensors. + */ + asmc_detect_sensors(dev); + out_err: #ifdef ASMC_DEBUG asmc_dumpall(dev); @@ -1337,10 +1360,10 @@ out: return (0); } +#endif /* ASMC_DEBUG */ /* * Get key info (length and type) from SMC using command 0x13. - * Returns 0 on success, -1 on failure. * If len is non-NULL, stores the key's value length. * If type is non-NULL, stores the 4-char type string (must be at least 5 bytes). */ @@ -1389,6 +1412,7 @@ out: return (error); } +#ifdef ASMC_DEBUG /* * Raw SMC key access sysctls - enables reading/writing any SMC key by name * Usage: @@ -1491,6 +1515,415 @@ asmc_raw_type_sysctl(SYSCTL_HANDLER_ARGS) } #endif +/* + * Convert signed fixed-point SMC values to milli-units. + * Format "spXY" means signed with X integer bits and Y fraction bits. + */ +static int +asmc_sp78_to_milli(const uint8_t *buf) +{ + int16_t val = (int16_t)be16dec(buf); + + return ((int)val * 1000) / 256; +} + +static int +asmc_sp87_to_milli(const uint8_t *buf) +{ + int16_t val = (int16_t)be16dec(buf); + + return ((int)val * 1000) / 128; +} + +static int +asmc_sp4b_to_milli(const uint8_t *buf) +{ + int16_t val = (int16_t)be16dec(buf); + + return ((int)val * 1000) / 2048; +} + +static int +asmc_sp5a_to_milli(const uint8_t *buf) +{ + int16_t val = (int16_t)be16dec(buf); + + return ((int)val * 1000) / 1024; +} + +static int +asmc_sp69_to_milli(const uint8_t *buf) +{ + int16_t val = (int16_t)be16dec(buf); + + return ((int)val * 1000) / 512; +} + +static int +asmc_sp96_to_milli(const uint8_t *buf) +{ + int16_t val = (int16_t)be16dec(buf); + + return ((int)val * 1000) / 64; +} + +static int +asmc_sp2d_to_milli(const uint8_t *buf) +{ + int16_t val = (int16_t)be16dec(buf); + + return ((int)val * 1000) / 8192; +} + +static bool +asmc_sensor_type_supported(const char *type) +{ + + return (strncmp(type, "sp78", 4) == 0 || + strncmp(type, "sp87", 4) == 0 || + strncmp(type, "sp4b", 4) == 0 || + strncmp(type, "sp5a", 4) == 0 || + strncmp(type, "sp69", 4) == 0 || + strncmp(type, "sp96", 4) == 0 || + strncmp(type, "sp2d", 4) == 0 || + strncmp(type, "ui16", 4) == 0); +} + +/* + * Generic sensor value reader with automatic type conversion. + * Reads an SMC key, detects its type, and converts to millivalue. + */ +static int +asmc_sensor_read(device_t dev, const char *key, int *millivalue) +{ + uint8_t buf[2]; + char type[ASMC_TYPELEN + 1]; + uint8_t len; + int error; + + error = asmc_key_getinfo(dev, key, &len, type); + if (error != 0) + return (error); + + if (len != 2) { + if (bootverbose) + device_printf(dev, + "%s: key %s unexpected length %d\n", + __func__, key, len); + return (ENXIO); + } + + error = asmc_key_read(dev, key, buf, sizeof(buf)); + if (error != 0) + return (error); + + if (strncmp(type, "sp78", 4) == 0) { + *millivalue = asmc_sp78_to_milli(buf); + } else if (strncmp(type, "sp87", 4) == 0) { + *millivalue = asmc_sp87_to_milli(buf); + } else if (strncmp(type, "sp4b", 4) == 0) { + *millivalue = asmc_sp4b_to_milli(buf); + } else if (strncmp(type, "sp5a", 4) == 0) { + *millivalue = asmc_sp5a_to_milli(buf); + } else if (strncmp(type, "sp69", 4) == 0) { + *millivalue = asmc_sp69_to_milli(buf); + } else if (strncmp(type, "sp96", 4) == 0) { + *millivalue = asmc_sp96_to_milli(buf); + } else if (strncmp(type, "sp2d", 4) == 0) { + *millivalue = asmc_sp2d_to_milli(buf); + } else if (strncmp(type, "ui16", 4) == 0) { + *millivalue = be16dec(buf); + } else { + if (bootverbose) + device_printf(dev, + "%s: unknown type '%s' for key %s\n", + __func__, type, key); + return (ENXIO); + } + + return (0); +} + +/* + * Generic sensor sysctl handler for voltage/current/power/light sensors. + * arg2 encodes: sensor_type (high byte) | sensor_index (low byte) + * Sensor types: 'V'=voltage, 'I'=current, 'P'=power, 'L'=light + */ +static int +asmc_sensor_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t dev = (device_t) arg1; + struct asmc_softc *sc = device_get_softc(dev); + int error, val; + int sensor_type = (arg2 >> 8) & 0xFF; + int sensor_idx = arg2 & 0xFF; + const char *key = NULL; + + /* Select sensor based on type and index */ + switch (sensor_type) { + case 'V': /* Voltage */ + if (sensor_idx < sc->sc_voltage_count) + key = sc->sc_voltage_sensors[sensor_idx]; + break; + case 'I': /* Current */ + if (sensor_idx < sc->sc_current_count) + key = sc->sc_current_sensors[sensor_idx]; + break; + case 'P': /* Power */ + if (sensor_idx < sc->sc_power_count) + key = sc->sc_power_sensors[sensor_idx]; + break; + case 'L': /* Light */ + if (sensor_idx < sc->sc_light_count) + key = sc->sc_light_sensors[sensor_idx]; + break; + default: + return (EINVAL); + } + + if (key == NULL) + return (ENOENT); + + error = asmc_sensor_read(dev, key, &val); + if (error != 0) + return (error); + + return (sysctl_handle_int(oidp, &val, 0, req)); +} + +/* + * Detect and register voltage/current/power/ambient sensors. + * Scans all SMC keys and identifies sensor keys by prefix. + * Returns 0 on success, -1 on error. + */ +static int +asmc_detect_sensors(device_t dev) +{ + struct asmc_softc *sc = device_get_softc(dev); + struct sysctl_ctx_list *sysctlctx; + struct sysctl_oid *tree_node; + char key[ASMC_KEYLEN + 1]; + char type[ASMC_TYPELEN + 1]; + uint8_t len; + unsigned int nkeys; + unsigned int i; + int error; + char *sensor_key; + + /* Initialize counts */ + sc->sc_voltage_count = 0; + sc->sc_current_count = 0; + sc->sc_power_count = 0; + sc->sc_light_count = 0; + + if (sc->sc_nkeys == 0) + return (0); + nkeys = sc->sc_nkeys; + + /* Scan all keys for voltage/current/power/ambient light sensors */ + for (i = 0; i < nkeys; i++) { + /* Get key name by index */ + error = asmc_key_dump_by_index(dev, i, key, type, &len); + if (error != 0) + continue; + if (!asmc_sensor_type_supported(type)) + continue; + + /* Voltage sensors (VC*, VD*, VG*, VP*, VI*) */ + if (key[0] == 'V' && (key[1] == 'C' || key[1] == 'D' || + key[1] == 'G' || key[1] == 'P' || key[1] == 'I') && + len == 2) { + if (sc->sc_voltage_count >= ASMC_MAX_SENSORS) + continue; + sensor_key = malloc(ASMC_KEYLEN + 1, + M_DEVBUF, M_WAITOK); + memcpy(sensor_key, key, ASMC_KEYLEN + 1); + sc->sc_voltage_sensors[sc->sc_voltage_count++] = + sensor_key; + } else if (key[0] == 'I' && (key[1] == 'C' || + key[1] == 'D' || key[1] == 'G' || key[1] == 'M' || + key[1] == 'N' || key[1] == 'O' || key[1] == 'H' || + key[1] == 'P' || key[1] == 'B' || key[1] == 'A' || + key[1] == 'L') && len == 2) { + /* Current sensors */ + if (sc->sc_current_count >= ASMC_MAX_SENSORS) + continue; + sensor_key = malloc(ASMC_KEYLEN + 1, + M_DEVBUF, M_WAITOK); + memcpy(sensor_key, key, ASMC_KEYLEN + 1); + sc->sc_current_sensors[sc->sc_current_count++] = + sensor_key; + } else if (key[0] == 'P' && (key[1] == 'C' || + key[1] == 'D' || key[1] == 'N' || key[1] == 'S' || + key[1] == 'T' || key[1] == 'H' || key[1] == 'F' || + key[1] == 'Z' || key[1] == 'z') && len == 2) { + /* Power sensors */ + if (sc->sc_power_count >= ASMC_MAX_SENSORS) + continue; + sensor_key = malloc(ASMC_KEYLEN + 1, + M_DEVBUF, M_WAITOK); + memcpy(sensor_key, key, ASMC_KEYLEN + 1); + sc->sc_power_sensors[sc->sc_power_count++] = + sensor_key; + } else if (key[0] == 'A' && key[1] == 'L' && + (key[2] == 'V' || key[2] == 'S') && len == 2) { + /* Ambient light sensors */ + if (sc->sc_light_count >= ASMC_MAX_SENSORS) + continue; + sensor_key = malloc(ASMC_KEYLEN + 1, + M_DEVBUF, M_WAITOK); + memcpy(sensor_key, key, ASMC_KEYLEN + 1); + sc->sc_light_sensors[sc->sc_light_count++] = + sensor_key; + } + } + + if (bootverbose) + device_printf(dev, + "detected %d voltage, %d current, " + "%d power, %d light sensors\n", + sc->sc_voltage_count, sc->sc_current_count, + sc->sc_power_count, sc->sc_light_count); + + /* Register sysctls for detected sensors */ + sysctlctx = device_get_sysctl_ctx(dev); + + /* Voltage sensors */ + if (sc->sc_voltage_count > 0) { + tree_node = SYSCTL_ADD_NODE(sysctlctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "voltage", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Voltage sensors (millivolts)"); + + for (i = 0; i < sc->sc_voltage_count; i++) { + SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(tree_node), + OID_AUTO, sc->sc_voltage_sensors[i], + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + dev, ('V' << 8) | i, asmc_sensor_sysctl, "I", + "Voltage sensor (millivolts)"); + } + } + + /* Current sensors */ + if (sc->sc_current_count > 0) { + tree_node = SYSCTL_ADD_NODE(sysctlctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "current", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Current sensors (milliamps)"); + + for (i = 0; i < sc->sc_current_count; i++) { + SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(tree_node), + OID_AUTO, sc->sc_current_sensors[i], + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + dev, ('I' << 8) | i, asmc_sensor_sysctl, "I", + "Current sensor (milliamps)"); + } + } + + /* Power sensors */ + if (sc->sc_power_count > 0) { + tree_node = SYSCTL_ADD_NODE(sysctlctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "power", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Power sensors (milliwatts)"); + + for (i = 0; i < sc->sc_power_count; i++) { + SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(tree_node), + OID_AUTO, sc->sc_power_sensors[i], + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + dev, ('P' << 8) | i, asmc_sensor_sysctl, "I", + "Power sensor (milliwatts)"); + } + } + + /* Ambient light sensors */ + if (sc->sc_light_count > 0) { + tree_node = SYSCTL_ADD_NODE(sysctlctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "ambient", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "Ambient light sensors"); + + for (i = 0; i < sc->sc_light_count; i++) { + SYSCTL_ADD_PROC(sysctlctx, SYSCTL_CHILDREN(tree_node), + OID_AUTO, sc->sc_light_sensors[i], + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + dev, ('L' << 8) | i, asmc_sensor_sysctl, "I", + "Light sensor value"); + } + } + + return (0); +} + +/* + * Helper function to get key info by index (for sensor detection). + */ +static int +asmc_key_dump_by_index(device_t dev, int index, char *key_out, + char *type_out, uint8_t *len_out) +{ + struct asmc_softc *sc = device_get_softc(dev); + uint8_t index_buf[ASMC_KEYLEN]; + uint8_t key_buf[ASMC_KEYLEN]; + uint8_t info_buf[ASMC_KEYINFO_RESPLEN]; + int error = ENXIO, try = 0; + int i; + + mtx_lock_spin(&sc->sc_mtx); + + index_buf[0] = (index >> 24) & 0xff; + index_buf[1] = (index >> 16) & 0xff; + index_buf[2] = (index >> 8) & 0xff; + index_buf[3] = index & 0xff; + +begin: + if (asmc_command(dev, ASMC_CMDGETBYINDEX)) + goto out; + + for (i = 0; i < ASMC_KEYLEN; i++) { + ASMC_DATAPORT_WRITE(sc, index_buf[i]); + if (asmc_wait(dev, ASMC_STATUS_AWAIT_DATA)) + goto out; + } + + ASMC_DATAPORT_WRITE(sc, ASMC_KEYLEN); + + for (i = 0; i < ASMC_KEYLEN; i++) { + if (asmc_wait(dev, ASMC_STATUS_DATA_READY)) + goto out; + key_buf[i] = ASMC_DATAPORT_READ(sc); + } + + if (asmc_command(dev, ASMC_CMDGETINFO)) + goto out; + + for (i = 0; i < ASMC_KEYLEN; i++) { + ASMC_DATAPORT_WRITE(sc, key_buf[i]); + if (asmc_wait(dev, ASMC_STATUS_AWAIT_DATA)) + goto out; + } + + ASMC_DATAPORT_WRITE(sc, ASMC_KEYINFO_RESPLEN); + + for (i = 0; i < ASMC_KEYINFO_RESPLEN; i++) { + if (asmc_wait(dev, ASMC_STATUS_DATA_READY)) + goto out; + info_buf[i] = ASMC_DATAPORT_READ(sc); + } + + memcpy(key_out, key_buf, ASMC_KEYLEN); + key_out[ASMC_KEYLEN] = '\0'; + *len_out = info_buf[0]; + memcpy(type_out, &info_buf[1], ASMC_TYPELEN); + type_out[ASMC_TYPELEN] = '\0'; + error = 0; + +out: + if (error) { + if (++try < ASMC_MAXRETRIES) + goto begin; + } + + mtx_unlock_spin(&sc->sc_mtx); + return (error); +} + static int asmc_key_write(device_t dev, const char *key, uint8_t *buf, uint8_t len) { diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h index 00857fe5fea8..43f679f3fef0 100644 --- a/sys/dev/asmc/asmcvar.h +++ b/sys/dev/asmc/asmcvar.h @@ -31,6 +31,7 @@ #define ASMC_MAXVAL 32 /* Maximum SMC value size */ #define ASMC_KEYLEN 4 /* SMC key name length */ #define ASMC_TYPELEN 4 /* SMC type string length */ +#define ASMC_MAX_SENSORS 64 /* Max sensors per type */ struct asmc_softc { device_t sc_dev; @@ -64,6 +65,15 @@ struct asmc_softc { uint8_t sc_rawlen; char sc_rawtype[ASMC_TYPELEN + 1]; #endif + /* Voltage/Current/Power/Light sensors */ + char *sc_voltage_sensors[ASMC_MAX_SENSORS]; + int sc_voltage_count; + char *sc_current_sensors[ASMC_MAX_SENSORS]; + int sc_current_count; + char *sc_power_sensors[ASMC_MAX_SENSORS]; + int sc_power_count; + char *sc_light_sensors[ASMC_MAX_SENSORS]; + int sc_light_count; }; /* From nobody Fri Apr 17 03:56:19 2026 X-Original-To: dev-commits-src-main@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 4fxgzR3shQz6bGWq for ; Fri, 17 Apr 2026 03:56:19 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxgzR2TnQz41BL for ; Fri, 17 Apr 2026 03:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776398179; 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=ppN+ySQZ4tEqC0sg4k/zM4u4gQXt1XnmlNCBmsVQlzY=; b=NDzYo24ijxkYfd+0ZgKJIFbapDNhPCrVRCQLvW1Y9YjDD9ITItsECWOJkB1klKCDPsmqUB HlFOyi5+l4jqApMmR0BM/g+QO81iRrjldZ1/OFHrmTCb47s0LCDcPiq+XxnZIbNVH2bADv eWBkQo4FxlaDfzbhjQyeYaie10fwyDbNi6h00haMaskAK0/Sd1d/CuBAYf6Glo/ezWzEfq 2J0LQFsyelChHlTEWVhZKbxUznQftkwc+7JjDKsW7iJaKlqj7AKhdOJRocodjsKN7cVaLR po4oFShrZKE/2l3qfAkH0nN3ZsTFKfSPasdH8/8xjr0GjRrHIfgva+xSNvzBNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776398179; a=rsa-sha256; cv=none; b=u99hIljJyIjs6cf+eNJ1NFZ800f9+slB2m7TCAaM1gz/bRaZ7rxM0V1P4YYYamh9aMIP/C x1+uDAVy/W+fxyi90ZQuohF9Opdo/sz+PTz2L5d8C/mdyiElDerjuV/WD1nMib8IILu+k5 pu2BANO63yepPMXpQKbt0YeKD9qlVTOy/3xCUy+wMG8lhTQesB5X5Vnl2pSRLxiXnxUdrP T8Ha2DpkuS7R2LkOl7qtmWEGBajegycMfrdDhFq/ba0YXkLPeTSINw4EDeSScexCh1uvB/ DrtLh8lyCTNZ1LThfQgnKm03VA4hrr8RoKjEAMZi1uzdS4tckUNlMM/nGZc4Hw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776398179; 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=ppN+ySQZ4tEqC0sg4k/zM4u4gQXt1XnmlNCBmsVQlzY=; b=AU12/NVDnQJnDSUDYRKktOgylY2SW2s8tMqCOm1FAyjJspepu3kBVIlmREzyccjkGp3KW6 95MTCp9/VzvcIQ3ppzunS63ISjtHZXJy+LhooH3oOqCMeQD8pK8EJWFnfm7Gk9cIldkJuc CHDBoZV7nRHpFHKr4dz+iyhIStSq2TzKuPs6qmD7Pm2AMjtA9PboCgrVnhJUPlEO+ol2s/ BfVvdkuKTzblUaS+ikg+jL7MpHX0LnzlNn4soXl7NSXOVM5vAEZqZJiveFLCV7MLnnllvi g+Uq3vcaRYQxQ1OGQcqsWdJkLH0Tt+DrV/Fcac8RNiLK9y7wbujPrSiHdMfnvA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxgzR1SCPzdYQ for ; Fri, 17 Apr 2026 03:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 27df0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 03:56:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alfredo Dal'Ava Junior Subject: git: 6fb5df548e4a - main - br.lenovo.kdb: add it to Makefile List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6fb5df548e4a581f958f60544b7fa8ba1716c4c6 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 03:56:19 +0000 Message-Id: <69e1af63.27df0.6196712f@gitrepo.freebsd.org> The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=6fb5df548e4a581f958f60544b7fa8ba1716c4c6 commit 6fb5df548e4a581f958f60544b7fa8ba1716c4c6 Author: Alfredo Dal'Ava Junior AuthorDate: 2026-04-17 03:44:46 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2026-04-17 03:55:03 +0000 br.lenovo.kdb: add it to Makefile This keyboard was implemented but wasn't actually installed to the system. Fixes: 9357c694e8dca627c25b15529e8435b2ab3dd48b MFC after: 1 day Relnotes: yes --- share/vt/keymaps/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/share/vt/keymaps/Makefile b/share/vt/keymaps/Makefile index 117eadde9fac..e3f63bd37d5f 100644 --- a/share/vt/keymaps/Makefile +++ b/share/vt/keymaps/Makefile @@ -8,6 +8,7 @@ FILES= INDEX.keymaps \ bg.phonetic.kbd \ br.kbd \ br.noacc.kbd \ + br.lenovo.kbd \ by.kbd \ ca.kbd \ ca-fr.kbd \ From nobody Fri Apr 17 03:57:24 2026 X-Original-To: dev-commits-src-main@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 4fxh0h48hWz6bGk2 for ; Fri, 17 Apr 2026 03:57:24 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxh0h3KpVz41ks for ; Fri, 17 Apr 2026 03:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776398244; 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=1VPXVzV7XEbqXs9V8b9B8yGBIct6phhjev4jA42iGeE=; b=RX8xYwWIRPauPsE6KEdnPvqmN0e/UPagcIxviRkNJaGSzoez1nVb0QRel3s6kGU0jwHMNC HIUQ/h5VlK/abTBupOV8tDyB+UT8Gp5X+1A7ufwbYZsi2lzyNWtnn9Zeho7nuHTUnAL04L sTZhJLBVrqb2TLX7ICHKmkGW8OLm5ROZ0YicKIRxlZEhY7jxEek22KxBNY9RfvWkx9i+Fc DwyAmjm0sSCzeAnvWnd2Sq3YyNfFhjrpu31544WBUDNno1Gf11JhtWNgrS9L7KSgGhwV6o sEybx64reMN24phY5tQlR/WKQfB6/eJKkK/HO6XtqOu7cIF4JuVbcpPNhClSIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776398244; a=rsa-sha256; cv=none; b=AWAK/zgco0YES4uA/RzV09k3y3+2recAWClVBptGhRCl29q138nkAblWErrXh9sXv2gaW5 4H9sXx9aNnxMNjS3UrclKo3xOWbZc8yritJhqdnzBiaqwVJKhUCxAWslDivqzY61BtLC8k EvsL/FhNOQy/AT5Ud67lQtWnVSFx6PZDrsN5+y/Zyh/MLLyinRGvoBg88LFS6srkHMGSOR /YsMGb1tHZymX+/x14MFwB0UXqF9DZ91o531LO3MjwPhQoYgbYyVRYMnrn4uYtwLKf+vP1 ViHd8hwo25VyYnrtrxWkcm3M4XuhdYnUT9Aqt4Y1wj9w8f+cW1c7UvItxCyDgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776398244; 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=1VPXVzV7XEbqXs9V8b9B8yGBIct6phhjev4jA42iGeE=; b=Hp0hsqPVeg5sJ9TtynMDWNMSsCHTMlelWIBOx8dnA6gbdJf19/eRVHSMZK00dwx4reSA0x yJdUPdvY3xnkihNEGAdjksaT1GAVC1EcvC9wXbJOvKNHstBiQpW2HOYXLl2scCg0LeymH2 4lxxVfLOIBu+e3moQJ8t8U0GHPup7hxEdASUv5mk018kPstlyPjFxAPcGNsdytd2nonSJB jVIPDOJxWtRM8EbgPhvHqosM4bZJQ100FyrFbFsL7jaxnfzKZsl6vsHAdrUgB8nZb6BvNl BWO3VisqHzYZXK7l/zVlwtKS0A38CtyeHjGjGDTeMBqjdtWvP6iIDl+UTKJa9w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxh0h2X0BzdnQ for ; Fri, 17 Apr 2026 03:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2788c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 03:57:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 51d2c3801082 - main - tests: kqueue: improve diagnostics for our CPONFORK test List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 51d2c38010824b90d7462711896a88165db9d015 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 03:57:24 +0000 Message-Id: <69e1afa4.2788c.3b1f88bb@gitrepo.freebsd.org> The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=51d2c38010824b90d7462711896a88165db9d015 commit 51d2c38010824b90d7462711896a88165db9d015 Author: Kyle Evans AuthorDate: 2026-04-17 03:57:06 +0000 Commit: Kyle Evans CommitDate: 2026-04-17 03:57:06 +0000 tests: kqueue: improve diagnostics for our CPONFORK test Notably, confirm in the child that our close-on-fork fd is actually closed, and break RECV_ALL out into a table and check each bit individually to provide a better message when the test fails. While we're here, just switch to waitid() rather than trying to identify the point where we have to make the switch. This reduces maintenance slightly, as keeping our assertion static would require still adding to a _RECV_ALL mask *just* for that purpose. Reviewed by: kib, markj (both slightly earlier version) Differential Revision: https://reviews.freebsd.org/D56372 --- tests/sys/kqueue/kqueue_fork.c | 71 +++++++++++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 11 deletions(-) diff --git a/tests/sys/kqueue/kqueue_fork.c b/tests/sys/kqueue/kqueue_fork.c index 6f517a2e0e29..ad8f69056e07 100644 --- a/tests/sys/kqueue/kqueue_fork.c +++ b/tests/sys/kqueue/kqueue_fork.c @@ -92,21 +92,68 @@ ATF_TC_BODY(shared_table_filt_sig, tc) #define RECV_VNODE 0x02 #define RECV_CLOREAD 0x04 #define RECV_ERROR 0x80 -#define RECV_ALL (RECV_TIMER | RECV_VNODE) + +static const struct cponfork_recv { + const char *recv_error_desc; + unsigned int recv_bit; + bool recv_parent_only; +} cponfork_recv[] = { + { "EVFILT_TIMER did not fire", RECV_TIMER, false }, + { "EVFILT_VNODE expected with creation of canary", RECV_VNODE, false }, + { "EVFILT_READ received for fd closed on fork", RECV_CLOREAD, true }, +}; + +static void +cponfork_notes_mask_check(unsigned int mask, bool childmask) +{ + const struct cponfork_recv *rcv; + unsigned int expect; + + ATF_REQUIRE(mask != RECV_ERROR); + for (size_t i = 0; i < nitems(cponfork_recv); i++) { + rcv = &cponfork_recv[i]; + + expect = childmask && rcv->recv_parent_only ? 0 : rcv->recv_bit; + ATF_REQUIRE_EQ_MSG(expect, mask & rcv->recv_bit, + "%s (%s, mask %x)", rcv->recv_error_desc, + childmask ? "child" : "parent", + mask); + } +} + +static unsigned int +cponfork_notes_mask(bool inchild) +{ + const struct cponfork_recv *rcv; + unsigned int mask = 0; + + for (size_t i = 0; i < nitems(cponfork_recv); i++) { + rcv = &cponfork_recv[i]; + + if (!inchild || !rcv->recv_parent_only) + mask |= rcv->recv_bit; + } + + ATF_REQUIRE(mask != 0); + return (mask); +} static int cponfork_notes_check(int kq, int clofd) { struct kevent ev; + unsigned int mask; int error, received = 0; + mask = cponfork_notes_mask(true); + EV_SET(&ev, TIMER_TIMEOUT, EVFILT_TIMER, EV_ADD | EV_ENABLE | EV_ONESHOT, NOTE_SECONDS, 4, NULL); error = kevent(kq, &ev, 1, NULL, 0, NULL); if (error == -1) return (RECV_ERROR); - while ((received & RECV_ALL) != RECV_ALL) { + while ((received & mask) != mask) { error = kevent(kq, NULL, 0, &ev, 1, NULL); if (error < 0) return (RECV_ERROR); @@ -138,7 +185,8 @@ ATF_TC_WITHOUT_HEAD(cponfork_notes); ATF_TC_BODY(cponfork_notes, tc) { struct kevent ev[3]; - int clofd, dfd, error, kq, pdfd, pmask, status; + siginfo_t info; + int clofd, dfd, error, kq, pdfd, pmask; pid_t pid; kq = kqueuex(KQUEUE_CPONFORK); @@ -164,8 +212,8 @@ ATF_TC_BODY(cponfork_notes, tc) /* * Every event we setup here we should expect to observe in both the * child and the parent, with exception to the EVFILT_READ of clofd. We - * except that one to be dropped in the child when the kqueue it's - * attached to goes away, thus its exclusion from the RECV_ALL mask. + * expect that one to be dropped in the child when the kqueue it's + * attached to goes away, thus its exclusion from the child mask. */ EV_SET(&ev[0], dfd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_ONESHOT, NOTE_WRITE, 0, NULL); @@ -195,6 +243,9 @@ ATF_TC_BODY(cponfork_notes, tc) else if (kf.kf_type != KF_TYPE_KQUEUE) _exit(RECV_ERROR); + if (fcntl(clofd, F_KINFO, &kf) != -1 || errno != EBADF) + _exit(RECV_ERROR); + _exit(cponfork_notes_check(kq, clofd)); } @@ -209,15 +260,13 @@ ATF_TC_BODY(cponfork_notes, tc) * still fire twice (once in parent, once in child). */ pmask = cponfork_notes_check(kq, clofd); - ATF_REQUIRE_EQ(pmask, RECV_ALL | RECV_CLOREAD); + cponfork_notes_mask_check(pmask, false); /* Wait for the child to timeout or observe the timer. */ - _Static_assert(RECV_ALL <= UCHAR_MAX, - "Too many events to observe -- switch from waitpid -> waitid"); - error = waitpid(pid, &status, 0); + error = waitid(P_PID, pid, &info, WEXITED); ATF_REQUIRE(error != -1); - ATF_REQUIRE(WIFEXITED(status)); - ATF_REQUIRE_EQ(WEXITSTATUS(status), RECV_ALL); + ATF_REQUIRE_EQ(CLD_EXITED, info.si_code); + cponfork_notes_mask_check(info.si_status, true); } ATF_TP_ADD_TCS(tp) From nobody Fri Apr 17 04:10:48 2026 X-Original-To: dev-commits-src-main@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 4fxhJ90mGQz6bHMM for ; Fri, 17 Apr 2026 04:10:49 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxhJ83v4hz42MY for ; Fri, 17 Apr 2026 04:10:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776399048; 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=HWezD5Mskjf//hlHlLBWoPcc9u6boEJ5N1SpYugN4SQ=; b=LsT8wlliqqN6DlR783Xl8c2dpSZK/dq38q7B082ld2QKxMauGFZ1JQUNz6CtoeZ8zr4VA6 91p8RtWLoypr79OXzwBY+lrHIo8doxa7POc5GCrOIm6qBcZFwRoL5bSDxrsap5MQgKeYry ILhdquC5IxVsKU6mNJAhZb0kjSBNzCwm1uE2FMO+FGvvWAjQ4+Mfwc9oBHFZzw0AiDpacX NmGzdJeJb8oYruPWdwIwCxgOFZwVR5jpSdTTtTqJFOLYKpmhELK67hbPekRysUPXtaFZJ3 3p6uVS6M2PIJ/GDU273E93tcEoROcTMetzV7blL8W0cWTifTKpC919FjBrvBTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776399048; a=rsa-sha256; cv=none; b=g1OvMuccSurwR5YqVcRJLtj/8B5Q58nascmXiWv6IaQ8w9GAoSwDvKj9E751Af0Wxki2vG 55/zQyHzghOMujzYKhRgZt5RM1tlgHyihP0WFuRVbGSNJIL9uWj4uly5DPK+2LnTYmBtsV Nd7H/Xx9+/Rf4fyrjTBCu92y8ImRnGGVs3X/cXQNs43FRxaraDnh2wclrAqsCxXvOnQ0tn 08M5amAgseFVn3GYdHIitknotIl1DOBO5eAm7dcYDNDvdCVXjGR/7Yr9dtz2U3m37dxfhP Ob55K28nQape67H85OoYqqrb4ID9loErBAdTyBtoZMNDCm1NDi/WYgurEAdoUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776399048; 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=HWezD5Mskjf//hlHlLBWoPcc9u6boEJ5N1SpYugN4SQ=; b=r7e+clzCtxaxc8tQ6E5zWG62xb4vxTwG+jrZ5KGsgYgcG2+GQed10/Xn2K/9CiMn5lr2+P z+idA6rQTCde9Og/b16viWMyyjyz2Ttw6EUPwBXjCXdRoHZXOrg7lLUIJrAZzxADXJSijz 5LJtg8R4fSxXNEmRBskNgSWolnaU27qkNzzFJcwzCq1c7H2bdXpCKTCNvS7FS59E1maQQy j7ch9sURVB1h6huQN1zGvuvFgyvon8ndrBZC6oepJAUfBF2g6k+VOsmdNohcarIHfK2fmB 9IXgqjFvGMgTA3SE1/wv8lLACVoIJbvspj/mElXErCwPYVJrxWnT/uQbQd6eAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxhJ83VV0zdKp for ; Fri, 17 Apr 2026 04:10:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31616 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 04:10:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: f5d0b30e4af1 - main - ippool(5): Correct example in man page List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5d0b30e4af1163bdc18a893b17236517b67790a Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 04:10:48 +0000 Message-Id: <69e1b2c8.31616.517fa647@gitrepo.freebsd.org> The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=f5d0b30e4af1163bdc18a893b17236517b67790a commit f5d0b30e4af1163bdc18a893b17236517b67790a Author: Cy Schubert AuthorDate: 2026-04-17 04:05:59 +0000 Commit: Cy Schubert CommitDate: 2026-04-17 04:09:42 +0000 ippool(5): Correct example in man page The example provided puts the semicolon in the wrong place. It must come after the file:// specification, not in it. MFC after: 1 week --- sbin/ipf/ippool/ippool.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ipf/ippool/ippool.5 b/sbin/ipf/ippool/ippool.5 index b45675bea069..1ab8681bef8b 100644 --- a/sbin/ipf/ippool/ippool.5 +++ b/sbin/ipf/ippool/ippool.5 @@ -121,7 +121,7 @@ addresses from. To do this simply use a "file://" URL where you would specify an actual IP address. .PP .nf -pool ipf/tree (name rfc1918;) { "file:///etc/ipf/rfc1918;" }; +pool ipf/tree (name rfc1918;) { "file:///etc/ipf/rfc1918"; }; .fi .PP The contents of the file might look something like this: From nobody Fri Apr 17 04:45:36 2026 X-Original-To: dev-commits-src-main@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 4fxj4J69vlz6bL7Q for ; Fri, 17 Apr 2026 04:45:36 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxj4J5YHkz45dg for ; Fri, 17 Apr 2026 04:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776401136; 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=jplFVE7I2uER/zhoftzY98/AO83o71wwAYf3YDrGuQM=; b=jQKfBRTxszb78FGPMy1vz2dXTusXjF3CKeX5IjLOU/mH2v1v3h1rV2gTtTluaIRxUurZi5 8ud6BXIdY3ccy37yKsFZzeDw/zNqtEFGWswLZy/k4ZDf7DBttrCKHTTP3UVWsYYXABhS3S VADU2R9eIyIApB/cEs9/kAhMCvwEbjbAWoM4Shensy2HMuJB6aLBu4xlNH5c6ST2eGXrIw z3P9VoTfnm0OlySQ+9oh/1Kblul7PWWUB3/QWTefaFoXqA1U+Avpwr96VYFc/sb4xA+1Jt spzKZw6zWkONXFG2gqjmwqm0Fv2syUbCAFyUKbn84qVxp+6asvUf/sC4I1dDxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776401136; a=rsa-sha256; cv=none; b=Jzh6wf3IMk4H2sBL2igF9kJbprx9nay/CylxGNW3GegXGjzi8fWiAj0F/hKRhQGXxNpC6o 0ruXcByNlkhOuS9KYRVo2KPiFpktoX7wwrEcEwJzS9QmqXImQBHhcbCBftpfXMDO+DBLlM 1hDRK3yQYLuu1a2m/Y0raHMjn/Iq+/Jc22UpLgGAAGSHdQ3y8u3vNoxcYKNgThBHb0LCRJ Fn2/wNCt9BXFOwbWVaRNeO5OAIfA+gKSG1DOv3AMUsBOwDRbJ/FQpBqkm+O1HFTxfJIHI4 vL4mS72dFMHZNHsdRoQD/ybCqD2OXgGb0SI8ilxG9L6eL7+YgsjPJeF6DugTJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776401136; 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=jplFVE7I2uER/zhoftzY98/AO83o71wwAYf3YDrGuQM=; b=TRCTi87ch2/59B7whYpHlRoHWrZeVSXpI6geJmvYwKACT1dfJyQRE3e+7uV5D9E7kP7yD5 bOdl7MHrNc6IpUOALmtSapmvFhAg8NIuAn1qV5cfwXqqT9kBrlLuslzJHnceDnwcEOl7cQ PqcgHAI8uAqr9aNv987djqrd5jcPDd16JoqBWoNCsKgNrsoicsuP8CxUHUqqideGlk6+hp Q1BM6zXpDBJBP45OBr6QCVWunuD67Z2j3rapTpAZOy5t2jJB6bLKgH28Uosp5/fkV7tgl3 zST1Dl0LWVOX0bZlPmdcTGA7vkp91pulgND7DrV11PfRA7xXkmqk6QHmQupIRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxj4J536wzfnC for ; Fri, 17 Apr 2026 04:45:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33fd2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 04:45:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 62a19cd59b54 - main - i386: mark the stack as non-executable List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 62a19cd59b54a030c21a5529ed491ba2060140ca Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 04:45:36 +0000 Message-Id: <69e1baf0.33fd2.1370e827@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=62a19cd59b54a030c21a5529ed491ba2060140ca commit 62a19cd59b54a030c21a5529ed491ba2060140ca Author: Warner Losh AuthorDate: 2026-04-17 04:41:49 +0000 Commit: Warner Losh CommitDate: 2026-04-17 04:44:18 +0000 i386: mark the stack as non-executable Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D56411 --- sys/crypto/aesni/aeskeys_i386.S | 2 ++ sys/i386/i386/bioscall.S | 2 ++ sys/i386/i386/exception.S | 2 ++ sys/i386/i386/locore.S | 2 ++ sys/i386/i386/mpboot.S | 2 ++ sys/i386/i386/sigtramp.S | 2 ++ sys/i386/i386/support.S | 2 ++ sys/i386/i386/swtch.S | 2 ++ sys/kern/subr_ticks.S | 2 ++ 9 files changed, 18 insertions(+) diff --git a/sys/crypto/aesni/aeskeys_i386.S b/sys/crypto/aesni/aeskeys_i386.S index 770c21dbf938..789d1641c25e 100644 --- a/sys/crypto/aesni/aeskeys_i386.S +++ b/sys/crypto/aesni/aeskeys_i386.S @@ -269,3 +269,5 @@ ENTRY(aesni_set_deckey) retl .cfi_endproc END(aesni_set_deckey) + + .section .note.GNU-stack,"",%progbits diff --git a/sys/i386/i386/bioscall.S b/sys/i386/i386/bioscall.S index d4b13a7012fa..304707182267 100644 --- a/sys/i386/i386/bioscall.S +++ b/sys/i386/i386/bioscall.S @@ -156,3 +156,5 @@ CNAME(bios16_jmp): pushl %ecx /* return address */ movl $KCSEL,4(%esp) lret /* reload %cs on the way out */ + + .section .note.GNU-stack,"",%progbits diff --git a/sys/i386/i386/exception.S b/sys/i386/i386/exception.S index a2a59db3c836..394f59f4f82b 100644 --- a/sys/i386/i386/exception.S +++ b/sys/i386/i386/exception.S @@ -682,3 +682,5 @@ outofnmi: #endif ENTRY(end_exceptions) + + .section .note.GNU-stack,"",%progbits diff --git a/sys/i386/i386/locore.S b/sys/i386/i386/locore.S index dd9bdfc6c532..e51f1a237d9e 100644 --- a/sys/i386/i386/locore.S +++ b/sys/i386/i386/locore.S @@ -449,3 +449,5 @@ END(identify_cpu) ENTRY(hypercall_page) .skip 0x1000, 0x90 /* Fill with "nop"s */ #endif + + .section .note.GNU-stack,"",%progbits diff --git a/sys/i386/i386/mpboot.S b/sys/i386/i386/mpboot.S index a5367d57a88e..2ab3a6bde034 100644 --- a/sys/i386/i386/mpboot.S +++ b/sys/i386/i386/mpboot.S @@ -279,3 +279,5 @@ BOOTMP2: .globl bootMP_size bootMP_size: .long BOOTMP2 - BOOTMP1 + + .section .note.GNU-stack,"",%progbits diff --git a/sys/i386/i386/sigtramp.S b/sys/i386/i386/sigtramp.S index 11e13d3ded60..ad4157279fd1 100644 --- a/sys/i386/i386/sigtramp.S +++ b/sys/i386/i386/sigtramp.S @@ -133,3 +133,5 @@ szosigcode: sz_lcall_tramp: .long esigcode-lcall_tramp #endif + + .section .note.GNU-stack,"",%progbits diff --git a/sys/i386/i386/support.S b/sys/i386/i386/support.S index 982108a0b968..e5e39c9ec5d4 100644 --- a/sys/i386/i386/support.S +++ b/sys/i386/i386/support.S @@ -586,3 +586,5 @@ ENTRY(cpu_sync_core) pushl %eax iretl END(cpu_sync_core) + + .section .note.GNU-stack,"",%progbits diff --git a/sys/i386/i386/swtch.S b/sys/i386/i386/swtch.S index ad7c1d16c788..a82bcefd494e 100644 --- a/sys/i386/i386/swtch.S +++ b/sys/i386/i386/swtch.S @@ -453,3 +453,5 @@ ENTRY(resumectx) xorl %eax,%eax lret END(resumectx) + + .section .note.GNU-stack,"",%progbits diff --git a/sys/kern/subr_ticks.S b/sys/kern/subr_ticks.S index 5cb994293d91..29f44c7b2f78 100644 --- a/sys/kern/subr_ticks.S +++ b/sys/kern/subr_ticks.S @@ -40,3 +40,5 @@ ticks =ticksl + TICKS_OFFSET .type jiffies, %object jiffies = ticksl .size jiffies, __SIZEOF_LONG__ + + .section .note.GNU-stack,"",%progbits From nobody Fri Apr 17 04:45:37 2026 X-Original-To: dev-commits-src-main@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 4fxj4L1xqtz6bLLV for ; Fri, 17 Apr 2026 04:45: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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxj4L0469z45dh for ; Fri, 17 Apr 2026 04:45:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776401138; 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=7DG4LndzyKhPXTGhfv9VSqOBxrq1p5ZYVJ5t2+CexKQ=; b=NV97Ug/n+gJBshoLc3OExpSBdRS2DWdtNGgAQ453ay/aD1hU0PdiaPiIzpmIDvWdCgtf1a a6wcbY3G0NQQM3SLhdaHHp6ifRde9a/skD3VaWvnJGbkuaRBwXsj8rxW2bFmwPHkAxB9MK UODyjk6gGnAm6zjQo06z2eY65IU4JhpZN0R+H8TaqF1uLGDOeDGK2Gt4rbCjBebrC0FjPf k9s5p94W+HR+wKwGsergrBSHk0TNWWDXgfzr2LrMRSDJkth/5LspZ+oLVB+fCZJDWqSv1B 9hy38nhQo9cM6HLO09ipRl7eFzG+Hbyqyrfnh9lEK8WtM/zv8VShKcDrcQ5Ivg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776401138; a=rsa-sha256; cv=none; b=wmJwvGo8ntsN6cnUftYqPh8/yw8Q/TphZi1xUfVsxo40xsGfZIvSLcfGfTOfnKmTpMKHLc x1bx3khS51VwCHO3eATip7Cxzo7Wj43IxUTf/qp7OKLujOdEXthXGien0FCSCy/bAciyjW g35Iy5Mqp6gWBv11cxQR/67EuvFcSGH7fPkq9VKmiC8puQKgyq2+o6OBiD2xJaa/x9+gx2 lXrhQtc8nUcQuiQrRCx9M6oPyKekimxOOm2bZG/LQpxAIV4FdQUTJTLA5wnLLiMsV5qisV MBWQoDYnRbkBCaEQSomWp7aVwmEbfbPElJPRW0isLF0bbahXGsqeV4megXfh4g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776401138; 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=7DG4LndzyKhPXTGhfv9VSqOBxrq1p5ZYVJ5t2+CexKQ=; b=JMlERIQzWZM/+IYFeXlei36ViocWRmrbnDmhqwpAf4NfWZdO5O6PjQlRaQVVkG3TJQl/u2 Li6XXXPbkouDau2/uprbFDI0anZAJG9mVG423afl64NbJT7M8kXQqGGm+8wqGHcNzFQYms f0b3SCDSLt2rIRMg6UUn1CjebdWMLaWT2N1Lm4Ft+szHQgQsSfsLW8UmJXQDbI/0hZjj98 4GoGydDPRTS27yDCpVErO+5EzBrK9GnVqcnnBVZCWQTwKLIs0DvIObfdkK/aAfFTS5I5s7 j04+SqeWSDMSinPV9v3MPRGM69/1RnAnYZyr0gD/9MNzjypdUpPqi9Gq8HN9lA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxj4K5t4jzfVh for ; Fri, 17 Apr 2026 04:45:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 329fc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 04:45:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2a1745da389b - main - syscalls: Preserve the attributes of the args List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2a1745da389bd3bb9fd32c25cf221fa32866debd Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 04:45:37 +0000 Message-Id: <69e1baf1.329fc.6fa77803@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2a1745da389bd3bb9fd32c25cf221fa32866debd commit 2a1745da389bd3bb9fd32c25cf221fa32866debd Author: Warner Losh AuthorDate: 2026-04-17 04:42:01 +0000 Commit: Warner Losh CommitDate: 2026-04-17 04:44:19 +0000 syscalls: Preserve the attributes of the args Lightly parse and preserve the attributes of the args as attributes. Sponsored by: Netflix Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D56407 --- sys/tools/syscalls/core/scarg.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/sys/tools/syscalls/core/scarg.lua b/sys/tools/syscalls/core/scarg.lua index 7ffbf15b3a80..ac0332ce3a78 100644 --- a/sys/tools/syscalls/core/scarg.lua +++ b/sys/tools/syscalls/core/scarg.lua @@ -29,6 +29,21 @@ local function checkAbiChanges(arg) return false end +-- Extracts the Microsoft(R) SAL annotations from this argument. +local function extractArgAnnotations(arg) + local annotations = {} + for ann in arg:gmatch("_Contains_[^ ]*[_)]") do + table.insert(annotations, ann) + end + for ann in arg:gmatch("_In[^ ]*[_)]") do + table.insert(annotations, ann) + end + for ann in arg:gmatch("_Out[^ ]*[_)]") do + table.insert(annotations, ann) + end + return table.concat(annotations, " ") +end + -- Strips the Microsoft(R) SAL annotations from this argument. local function stripArgAnnotations(arg) arg = arg:gsub("_Contains_[^ ]*[_)] ?", "") @@ -46,6 +61,7 @@ function scarg:init(line) self.arg_abi_change = checkAbiChanges(self.scarg) self.changes_abi = self.arg_abi_change + self.annotation = extractArgAnnotations(self.scarg) self.scarg = stripArgAnnotations(self.scarg) self.name = self.scarg:match("([^* ]+)$") @@ -126,15 +142,18 @@ function scarg:append(tbl) table.insert(tbl, { type = "uint32_t", name = self.name .. "1", + annotation = self.annotation or "", }) table.insert(tbl, { type = "uint32_t", name = self.name .. "2", + annotation = "", }) else table.insert(tbl, { type = self.type, name = self.name, + annotation = self.annotation or "", }) end end From nobody Fri Apr 17 04:45:38 2026 X-Original-To: dev-commits-src-main@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 4fxj4M2Vlgz6bLJ4 for ; Fri, 17 Apr 2026 04:45:39 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxj4L6mchz45dj for ; Fri, 17 Apr 2026 04:45:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776401139; 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=3p3q6Mm27LOZPvTOyDL4owtcCf0CCn+EsgG9ltsTUU4=; b=vqR1972J25aNJ+V0tWsH41mJiKDYRAhLRqRZcXzGSFXPiA/JSz9o1zrnGP6QVwvSEaXC6x v/kEKV2/SlKIumR8kKKEsNGXy12BfG/j6THjw0Ys9KBZ/u1kmrMAf4nGAytyzF2vrK66e1 F5t7eUvGAveqJ4iQT89lB3nuKH4J7/qCO/76PPk02e/akNJw4OL6lsERu7dyAjZOVbKffJ AIJ612pCOSVljUEk89zShS9pU+dLA3Ryah4z2Rh5XFWtJ+TzXZKlPWzOu4zRu+qOwxxVak Un1yCMnrTWRivgoDrc0DgoQKvx9i09Vgjno3G0Hz51Ew/7VQVCaw0fPdOGE8XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776401139; a=rsa-sha256; cv=none; b=cbYJPXe0agEZwszmUIeAeDygCXC1db/rP03fWyDjZYlyLL1/tRQ5Iyg7WiE3WAB5ONdaFO wbWricARvOZkQ+S1IoShkSNKIGN2I1KrplnP7Of/x8/rE+GGDyC+u6bZ8wj9Y8MAXjf92N yoFPwFCyKVsuJoTyhE+Fux7J4txx7xNSCdWfnR0DnGupTGkKHEAW51RLaa3s6xn2sXlA5M WQ/0QQ9nhoQqjRlKoyk60BLvX+Xk28OGArk/vDzH972IHu79GTNbQC33/qSzSCfwy/UFOY hvFceySUbx7OtHY9YqYXLUzRXNq0KrAGJMkuugyiK9c+eWVwGg6TaStzswMWxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776401139; 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=3p3q6Mm27LOZPvTOyDL4owtcCf0CCn+EsgG9ltsTUU4=; b=CLQEa44h27+GYrTDC9BmgnsJLbrEkfrTBOLnqd4jiQ+xBauSadC4jyYIUTzbK1W6uNlki1 QZHXPDZ7ZNm4tYlhuYyfZREU9/v87qJfY/uaClxBKEkp6eCCrvro5swujJGyVIfhwOX4tP CY6n76+un5mnIOCRBbQWB0uDsThI8Hv+E2kK+vjWYgS2r/FvuxUPPZo7DeH7fedMFjSt0m 09Ta8Ed2jUsrvjlRKpX0/+17DIQd8n1NiCx3jKtpy5LLa3B50xyZc+3bOj4yHaiUCw+aiy tsGXMnx4AgVOyeae5FmK8pHgvCwxW6VtcsLtVEwSgr3dIQikWd5muV+q/m98/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxj4L6KwXzg26 for ; Fri, 17 Apr 2026 04:45:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 348a7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 04:45:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: b3b23f284a67 - main - syscall: Create a script to export the data as json List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3b23f284a67317309af7c30bb70d5f461f3f02f Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 04:45:38 +0000 Message-Id: <69e1baf2.348a7.18453e25@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=b3b23f284a67317309af7c30bb70d5f461f3f02f commit b3b23f284a67317309af7c30bb70d5f461f3f02f Author: Warner Losh AuthorDate: 2026-04-17 04:42:10 +0000 Commit: Warner Losh CommitDate: 2026-04-17 04:44:19 +0000 syscall: Create a script to export the data as json Create a script to export the parsed data as json. Include the annotations for the system call arguments, since they are helpful to downstream uses. Sponsored by: Netflix Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D56408 --- sys/tools/syscalls/scripts/syscall_json.lua | 126 ++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/sys/tools/syscalls/scripts/syscall_json.lua b/sys/tools/syscalls/scripts/syscall_json.lua new file mode 100644 index 000000000000..a29510a9c4c9 --- /dev/null +++ b/sys/tools/syscalls/scripts/syscall_json.lua @@ -0,0 +1,126 @@ +#!/usr/libexec/flua +-- +-- SPDX-License-Identifier: BSD-2-Clause +-- +-- Copyright (c) 2026 Warner Losh +-- + +-- Setup to be a module, or ran as its own script. +local syscall_json = {} +local script = not pcall(debug.getlocal, 4, 1) -- TRUE if script. +if script then + -- Add library root to the package path. + local path = arg[0]:gsub("/[^/]+.lua$", "") + package.path = package.path .. ";" .. path .. "/../?.lua" +end + +local FreeBSDSyscall = require("core.freebsd-syscall") +local ucl = require("ucl") + +-- Convert the type flags set (table with flag=true entries) to a sorted list. +local function flagsToList(typetbl) + local flags = {} + for k, _ in pairs(typetbl) do + table.insert(flags, k) + end + table.sort(flags) + return flags +end + +-- Convert a single syscall object to a plain table suitable for JSON export. +-- Much of the data is available only as a method call. +local function syscallToTable(v) + local entry = { + num = v.num, + name = v.name or "", + alias = v.alias or "", + audit = v.audit or "", + flags = flagsToList(v.type), + compat_level = v:compatLevel(), + compat_prefix = v:compatPrefix(), + symbol = v:symbol(), + rettype = v.rettype or "int", + cap = v.cap or "0", + thr = v.thr or "SY_THR_STATIC", + changes_abi = v.changes_abi or false, + noproto = v.noproto or false, + args_size = v.args_size or "0", + arg_alias = v.arg_alias or "", + } + + -- Export arguments with annotations. + local args = {} + if v.args ~= nil then + for _, a in ipairs(v.args) do + arg = { + type = a.type, + name = a.name, + } + if a.annotation ~= nil and a.annotation ~= "" then + arg.annotation = a.annotation + end + table.insert(args, arg) + end + end + entry.args = args + + -- Export altname/alttag/rettype if present (loadable syscalls). + if v.altname ~= nil then + entry.altname = v.altname + end + if v.alttag ~= nil then + entry.alttag = v.alttag + end + + return entry +end + +function syscall_json.generate(tbl, config) + -- Build the syscalls array. + local syscalls = {} + for _, v in pairs(tbl.syscalls) do + table.insert(syscalls, syscallToTable(v)) + end + + -- Build the structs data into a nicer structure + local structs = {} + if tbl.structs ~= nil then + for k, _ in pairs(tbl.structs) do + table.insert(structs, k) + end + table.sort(structs) + end + + local root = { + syscalls = syscalls, + structs = structs, + } + + local json = ucl.to_json(root) + + -- Write to stdout. + io.write(json) + io.write("\n") +end + +-- Entry of script: +if script then + local config = require("config") + + if #arg < 1 or #arg > 2 then + error("usage: " .. arg[0] .. " syscall.master [config]") + end + + local sysfile, configfile = arg[1], arg[2] + + config.merge(configfile) + config.mergeCompat() + + -- The parsed system call table. + local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config} + + syscall_json.generate(tbl, config) +end + +-- Return the module. +return syscall_json From nobody Fri Apr 17 05:01:19 2026 X-Original-To: dev-commits-src-main@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 4fxjQh0K5bz6bMBZ for ; Fri, 17 Apr 2026 05:01:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxjQg47zlz49Zl for ; Fri, 17 Apr 2026 05:01:31 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-f48.google.com with SMTP id 6a1803df08f44-8a154cc6a48so3546476d6.0 for ; Thu, 16 Apr 2026 22:01:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776402091; cv=none; d=google.com; s=arc-20240605; b=BsbmX+QhPNpRrudyQxK9OBpPcxrXdXohFEq6XBaBA1HTOTFmw6GFvGGejHfqavRepD ptaQ8VRE0BQjsEE0bb1hILU3aPkrVqLN1xjwDtFeSoOlTO4GjjvyVcjg5+c/1WLJAYth JTo5APuCl237uAMqhxK497vT2Tg1lBaZfb7OqER/cZ2YAMLuhaEs9RdQ8WmarX+O26uX 5AFTapGzlDU/GSKMO01EpCWo996ZA/dGc4scBOGkdU2gsxYs20SN0czhVNxW8FLvVQi3 euemAZXOvuaUVxjVDXRXC6B34VhLO+u332VmCNnHgsRWcRkbGKkgEwYh7SPhKbDJNGu+ Pflg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version; bh=FSCuWueJFt/KVjj/jg0fzzHTbjI6xU4zkXxXS4oDTIs=; fh=SCj6qHLukUYqRl/nZJBvZymjumeE9FXrxZxeFj4MEVw=; b=S3vuXZvIsXkDI7dCUkeI3lGvp8F1lyhhfG3y8nFD7RSaABrXDgni2dC2FsnFpDVQv5 LdeIfY624ik11SvmoDpgzjGwzUca6RyXfCLWdgUy4xItlWmucmJ30rcOyaJGVj0wI4aY 6U3viTczrHU4P52JQAWaUyN957b1s1LTQemOTg/cEF5dda+DG9oz+RLU/rf3DHHoU3Gb FSoCDPmLL+Hz9f35WDBtCtNsh6f15Zn/tbHnob1H5H72E3exmoQD5gpOjspFG/237Jqs zp3l9l5JylXq+65J7GYSKuIOFcQdR6xOFACo5L5wM1WyN5lDQseP9dP3GoCTXtEq7sSa Bqfg==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776402091; x=1777006891; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FSCuWueJFt/KVjj/jg0fzzHTbjI6xU4zkXxXS4oDTIs=; b=KeU0Rlp8ujI5ibbMbkd/R3nZQ3UsCP9G5h0bIpos5VnEhFjBwMmyHfZQpB1CwiCm+U 1hsAElTxzQGMOTsLriM1js9mR+s+tDeULmpZVYVTLK+uYou4CaV4rkJ4vUQp6Wfj8Kr+ wKZOaMS3EsIInmJSqKxwh4CwelDwalusVxspvrIEZxQASyeJaQTomhb7U6VgJOUQ0eUP l86ihqJclV91tYOyr7M3U2wocD+B3EKif80w2UNAs+cGdOvBXY9zyT0vOv95Uq6IjEc/ 8QT75WqBLk/V1PQOszDT4n0es0Imjaqm5yZRmcVdD9Ss4TPl+tIoKYmpyA/Su+Q6fDPT S0jw== X-Forwarded-Encrypted: i=1; AFNElJ/KIm5WiDRCD7+uQvEimwcMyCCEUuHx0djY2HRJzSUTB2Racl74LRc9LHSTSPCXT2JQ0MzzyDvl5foMuTW4H/aD0TyNHw==@freebsd.org X-Gm-Message-State: AOJu0YxpkhoakjG4dq0Ojn+y1ovKabABXyh1RNtfN1Xy4bFGROlb+r2P +Qjp34EGccfJ4EE0Xb8vXUrPfhSSqyTOvn+OOdwDvWVTN9ayFEmoN1P+jNA5GTjOZCmvgRHiBQj Hy6NjosHCst1ycGUhucr+Y3rxHk4xqTLFjg== X-Gm-Gg: AeBDiev8kC8KsCt3NtXPwdHfQwEBpGKhushrZHvTEsj5s+AAXyuBfrhdc0b3tzEgrjj 9U5Qo/1bfb6d6qIZlyg0zKI/chAs2pANjqoSOg6U07Om/yIva+rlwzLz/+NOI9sOwLEL0M/sHZb Ih5SyLFNbecpYzVJoSPlU9XF/+LVocyDiKDazAw1M7sYn45je8KaiH27LMw8+rYtzwJQHX0IyO8 bv+9AXx4y++sBnAMrAQDAev24h53eo/kuLKwYs2SigVhblM/DvMV6gxyibIjVh5SBXalZnzs05T CiU9QEO8W2t7xxXGxcLZc87aA6nZpxvgg1TmLaWXyQRS9AaHK37TMl5/iriGHP7GQXipr6o+7wF 1TyAIkxiIMss4Cgzi5tUXyDMtGFNzJQLJEzOhcQ== X-Received: by 2002:ad4:5c65:0:b0:8ac:800f:10da with SMTP id 6a1803df08f44-8b027fd15e3mr24609646d6.4.1776402090740; Thu, 16 Apr 2026 22:01:30 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <69de65eb.21a5c.61244c2a@gitrepo.freebsd.org> In-Reply-To: From: Adrian Chadd Date: Thu, 16 Apr 2026 22:01:19 -0700 X-Gm-Features: AQROBzA3WWKDqqgSPTZjBY2FKl8PWzQyJ2Zw_xdqJr6Ozm7wEpKbk-SGJ82rZZU Message-ID: Subject: Re: git: 9b76228006d8 - main - inpcb: retire inp_vnet To: Mark Johnston Cc: Gleb Smirnoff , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4fxjQg47zlz49Zl X-Spamd-Bar: ---- On Thu, 16 Apr 2026 at 14:05, Mark Johnston wrote: > > > > It's possible to have inp->inp_socket == NULL here. This is triggered > by the sys/netinet/tcp_hpts_test.py tests. > > > /* Lets do any logging that we might want to */ > > tcp_hpts_log(hpts, tp, &tv, slots_to_run, i, from_callout); > > Do you think it's worth reverting? it's been a couple days and I just got emailed about that test failing after I landed some unrelated stuff! -a From nobody Fri Apr 17 07:14:11 2026 X-Original-To: dev-commits-src-main@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 4fxmMl3scvz6ZCh8 for ; Fri, 17 Apr 2026 07:14:11 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxmMl36bKz3S0l for ; Fri, 17 Apr 2026 07:14:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776410051; 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=WYnMI2wN+qvevvs6YOlng/KzPh47uVJ6AyOKVAGiLAs=; b=t3OIxPGygpPfzKwdf+kqdkBJYd5VRd8E8dHJSdhrWMmuc/lWWrKuBz6ngzrR+U1dVzS41y 00UuJLFqxbBzq/HwaZRvbq7fCWqoC2ib6IuA5+krwxnEQCU8YCTkyN/EI1/608vr2hcC6M AWOnh06S6nLDSAt1unrfRs5i0D3vbyjkamG44Ib1aOu7Twta9KJbAJXnGmPCS6M5pMGL2k nM5oLapnt1zqrRN840hfbZ23RP0OAe6zyb64koeZfM2wsE+PJh42OOLRj4Qngk5HRtUQKV fIarUxbxCAxyq8+VshY0tTpL7OT4KUuWbEpaI4lX76b0yZZgQ5R7I3Ph/wPtdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776410051; a=rsa-sha256; cv=none; b=tYhr5c5AeODYalXVs7THAf/dFUzQoBy8iVtb8+eeZ6iqxMZmlrIVK9A6gEEoGZfk77XpWJ TRjYs4tGvmS190TlkM08KLW9YodSAog7QJ/gKA/HsI2XbfV3W5FtxgzySeZLK4/XnNvQHQ U8cr6dh52azjLT/HfCQ6+WXA83iVMTLPc9TFmawr2q7jD5xcLnHiNCVfL4E0R5a4hw1Mwl 4we8NlNG7reXIJ8FywOvfJjA0YYC5yGwA1MkTEhhAcD1T2eHS5t9Bt9S68bAUVxpIfkIfp XMWqDfblefKc7QRHNbG+CuwzCMIxe3ObzytCUoaQcM0+SThiZGklW4oek/PMNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776410051; 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=WYnMI2wN+qvevvs6YOlng/KzPh47uVJ6AyOKVAGiLAs=; b=qgZ9+e5qzsQUstB5fcYGKiKhAQmic4yovEIBOaTQviKvCFAPGHOFhhZ7Ea6FrG/buhFvhh Qy9ve1/HdPOmB4Xq+aJB3jc9gcLS7VCHTHjAGIG/cFOVtArpbuOEWwU+VyEvl77fivPDYE ZfZYppwaljGZLmivtGlXpWnxYXYpwRxwGiFfpdi+HdHTpKBKvBMnK/vCtwpUuQlBgToev8 +bn8zf2ESba5zcYVvDpXxfZgKnGx0R6J3CkvTq5ejTul6Ic3Aglo4c0CE+zdC8/C3g797G oNNvZ5bHZQjVkRii3RpFcJeYxi5DX0+bbkmO/oDW7YI7KqnSXhmnwHDmCevVUg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxmMl2Rdfzks7 for ; Fri, 17 Apr 2026 07:14:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44589 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 07:14:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 3a54aa3b0911 - main - tcp: use RFC 6191 for connection recycling in TIME-WAIT List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3a54aa3b0911bef15e014b8a8185e116efb0a918 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 07:14:11 +0000 Message-Id: <69e1ddc3.44589.2f60ace5@gitrepo.freebsd.org> The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=3a54aa3b0911bef15e014b8a8185e116efb0a918 commit 3a54aa3b0911bef15e014b8a8185e116efb0a918 Author: Michael Tuexen AuthorDate: 2026-04-17 07:11:41 +0000 Commit: Michael Tuexen CommitDate: 2026-04-17 07:11:41 +0000 tcp: use RFC 6191 for connection recycling in TIME-WAIT Implement the criteria specified in RFC 6191 for recycling TCP connections in TIME-WAIT. Reviewed by: rscheff, Marius Halden Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D56321 --- sys/netinet/tcp_timewait.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/netinet/tcp_timewait.c b/sys/netinet/tcp_timewait.c index 430e98910743..eaa2fa336a94 100644 --- a/sys/netinet/tcp_timewait.c +++ b/sys/netinet/tcp_timewait.c @@ -215,12 +215,17 @@ tcp_twcheck(struct inpcb *inp, struct tcpopt *to, struct tcphdr *th, /* * If a new connection request is received * while in TIME_WAIT, drop the old connection - * and start over if the sequence numbers - * are above the previous ones. + * and start over if allowed by RFC 6191. * Allow UDP port number changes in this case. */ if (((thflags & (TH_SYN | TH_ACK)) == TH_SYN) && - SEQ_GT(th->th_seq, tp->rcv_nxt)) { + ((((tp->t_flags & TF_RCVD_TSTMP) != 0) && + ((to->to_flags & TOF_TS) != 0) && + TSTMP_LT(tp->ts_recent, to->to_tsval)) || + (((tp->t_flags & TF_RCVD_TSTMP) == 0) && + ((to->to_flags & TOF_TS) != 0) && + (V_tcp_tolerate_missing_ts == 0)) || + SEQ_GT(th->th_seq, tp->rcv_nxt))) { /* * In case we can't upgrade our lock just pretend we have * lost this packet. From nobody Fri Apr 17 07:22:52 2026 X-Original-To: dev-commits-src-main@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 4fxmYm5vgkz6ZDPX for ; Fri, 17 Apr 2026 07:22:52 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxmYm397bz3THB for ; Fri, 17 Apr 2026 07:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776410572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y4QAwyY5Pxf1jS7vGQv5yihj3B2d+gbTjUubj5NgaTY=; b=ttZlUPEMB9DK+FuqQLH92MTVjHFtiEu77X6QPMwjhaCxbnZ7bYQcgVu8DOQ5l0lNT7WLbt LaWocI7J17pTfLVdj1JykKGsugbdIcmWNL01/rtqPuuiB75GTwMzEWHkqHJ+NaVMLjQVqa 7P111W0Dfl9/7W1xZgHwOYYhTX+9mwtKc5r7QK5BA3AEUUtd10pIAlIj5uJD+fPLRCDOJk i2/aG5NrKhRztH2Tct8ICp3J/8+qpk+UFnJ66QP/t/u3mNUMft3DdWKZLBiPyUeW+2/N06 kSQanbqX+UxCkxMDPE6l8z611/EJGdeAH/XMPWXke5xuLGojmomcuAVbqCU/Hg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776410572; a=rsa-sha256; cv=none; b=FneSRCRZPjtVibZ56vOJwAYVf6dW1BmAi563TmOL3elWhDOPIjxWp9btu1a2vJ6hZVyG9Z HvuSHhNB8BucJ4SvdXdIMwJA4f0KxYTgAPvW9nAxeNQOW29jXJYDMFMy8q/qDZ14uY/iF2 GWMREwnNTpPcwqbZgab4ZD+xGVH1XNEZY78PZgobMTVxxflcAh2bTVADBdC3fv/InoS4Ie L+vh3aDtKf+zJlKMvtgre2gwtYjYlaQB9/3mphtL7zR6RAByTUUmKOqeSvtmViYkqD9Hj2 TnTSFqDWZvAUhIOOzF3p8Vfcpmpn8rEuP8EHuvMhV6zqo2MjB2/VnlX7Wm7obg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776410572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y4QAwyY5Pxf1jS7vGQv5yihj3B2d+gbTjUubj5NgaTY=; b=pkMHnR4+R4x+iApinKC8cspy/0FnOC03qYsJgo+z9MQVS3B5M9RM+wKbINbTWuPJ5mEaSk QmwaMjIu/Ub7I+Gsev4FpQPZw4Bvkem4DGjRJo5CMgsqMiVdqqBmZx0qyq0ahyYeSuDgUQ +4MENYI67bweR25XR87WXcfMOxy15voraIzhXjt3Wg5Iz/yNuaMXRTpnIfhHW8Ka5orywA NEFLXBpruXhXP5yjIjZ/z/+Yr27zZvuyQSqcWWtIMi0Fk4nZNZvcUBb2ukJf+xvnIWFRdt FyBiQQLvHANNRcxNwonq/M2fV9OLEkp7Kj2AfX71y5A3TAuGHyI1eyrFGMkszA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxmYm2lmqzkdQ for ; Fri, 17 Apr 2026 07:22:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4525b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 07:22:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Ricardo Branco From: Pouria Mousavizadeh Tehrani Subject: git: 64e2715f5d8f - main - linux: Support ICMP6_FILTER socket option translation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 64e2715f5d8f03ab7e763a49a0e102d755673810 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 07:22:52 +0000 Message-Id: <69e1dfcc.4525b.76faacf@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=64e2715f5d8f03ab7e763a49a0e102d755673810 commit 64e2715f5d8f03ab7e763a49a0e102d755673810 Author: Ricardo Branco AuthorDate: 2026-04-12 11:01:47 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 07:22:36 +0000 linux: Support ICMP6_FILTER socket option translation Handle Linux IPPROTO_ICMPV6 socket options in the Linuxulator and map ICMP6_FILTER for both getsockopt(2) and setsockopt(2). Linux and FreeBSD use inverted bit semantics for struct icmp6_filter, so invert the filter contents before/after calling setsockopt/getsockopt. Signed-off-by: Ricardo Branco PR: 294434 Reviewed by: pouria Pull-Request: https://github.com/freebsd/freebsd-src/pull/2138 --- sys/compat/linux/linux_socket.c | 67 +++++++++++++++++++++++++++++++++++++++++ sys/compat/linux/linux_socket.h | 2 ++ 2 files changed, 69 insertions(+) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 023be1e6b885..d971b2a7fbe7 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -52,6 +52,7 @@ #include #include #ifdef INET6 +#include #include #include #endif @@ -622,6 +623,19 @@ bsd_to_linux_tcp_user_timeout(u_int bsd_timeout) return (bsd_timeout * 1000U); } +#ifdef INET6 +static int +linux_to_bsd_icmp6_sockopt(int opt) +{ + + switch (opt) { + case LINUX_ICMP6_FILTER: + return (ICMP6_FILTER); + } + return (-1); +} +#endif + static int linux_to_bsd_msg_flags(int flags) { @@ -2175,6 +2189,29 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args) break; } break; +#ifdef INET6 + case IPPROTO_ICMPV6: { + struct icmp6_filter f; + int i; + + name = linux_to_bsd_icmp6_sockopt(args->optname); + if (name != ICMP6_FILTER) + break; + + if (args->optlen != sizeof(f)) + return (EINVAL); + + error = copyin(PTRIN(args->optval), &f, sizeof(f)); + if (error) + return (error); + + /* Linux uses opposite values for pass/block in ICMPv6 */ + for (i = 0; i < nitems(f.icmp6_filt); i++) + f.icmp6_filt[i] = ~f.icmp6_filt[i]; + return (kern_setsockopt(td, args->s, IPPROTO_ICMPV6, + ICMP6_FILTER, &f, UIO_SYSSPACE, sizeof(f))); + } +#endif case SOL_NETLINK: name = args->optname; break; @@ -2435,6 +2472,36 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) break; } break; +#ifdef INET6 + case IPPROTO_ICMPV6: { + struct icmp6_filter f; + int i; + + name = linux_to_bsd_icmp6_sockopt(args->optname); + if (name != ICMP6_FILTER) + break; + + error = copyin(PTRIN(args->optlen), &len, sizeof(len)); + if (error) + return (error); + if (len != sizeof(f)) + return (EINVAL); + + error = kern_getsockopt(td, args->s, IPPROTO_ICMPV6, + ICMP6_FILTER, &f, UIO_SYSSPACE, &len); + if (error) + return (error); + + /* Linux uses opposite values for pass/block in ICMPv6 */ + for (i = 0; i < nitems(f.icmp6_filt); i++) + f.icmp6_filt[i] = ~f.icmp6_filt[i]; + error = copyout(&f, PTRIN(args->optval), len); + if (error) + return (error); + + return (copyout(&len, PTRIN(args->optlen), sizeof(socklen_t))); + } +#endif default: name = -1; break; diff --git a/sys/compat/linux/linux_socket.h b/sys/compat/linux/linux_socket.h index f2a96b3e7dcb..d30d68409496 100644 --- a/sys/compat/linux/linux_socket.h +++ b/sys/compat/linux/linux_socket.h @@ -324,6 +324,8 @@ int linux_accept(struct thread *td, struct linux_accept_args *args); #define LINUX_TCP_MD5SIG 14 #define LINUX_TCP_USER_TIMEOUT 18 +#define LINUX_ICMP6_FILTER 1 + struct l_ifmap { l_ulong mem_start; l_ulong mem_end; From nobody Fri Apr 17 07:22:53 2026 X-Original-To: dev-commits-src-main@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 4fxmYn73bXz6ZDRZ for ; Fri, 17 Apr 2026 07:22:53 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxmYn4DQ7z3THD for ; Fri, 17 Apr 2026 07:22:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776410573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n/KkMuvd86P2u7/vGXiQ4K05s49BU9nR3B04PImOCKc=; b=p6PAFg0m+6A6aIljEf8mzZJA3Kh7cx7y/OcrSOBX+NVNPSy4Jhy2fZA/+7aExmHPGFdw1H 4zuFgbM/mFdH9scRc1tq67tUt1KXvfPmoQxMXYU7xtmJdA7dymzwTWJMUdE/B169Mfb6xX AOH5VHfu8hyMKELSauFy61ygaPbH2stwnAugLflTnxNNRz0ilbU/IBW+LPPZtxXedaRzZV Qr3vcNkgPtmDc8ownYoN4XXRWxIf/AQwgHFjisCcn7nfbcGbfW6fimLWSJDM6III91hhgd CJGxyY30x5f4G/4gKkOPnhIEcfalMvrA/iv8eVVnNYzT17qQoKHPKbkNCx7g7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776410573; a=rsa-sha256; cv=none; b=wU+44+LQnTDy6Wt1ZPgrABj2cX9s5MRVyEzSAfDJpBnGc73Rc9ZneIAlr5tfQ3Hn9YWuh8 LusBLH/UxxSiyuWqjsXWy5T8yTzm03hFqtyC74+xKYGEdD5e4Z8L8Q2I57my/0YZbQToxI o2BgHUDyICxOztYurcygOZaDZNfzSTYyKarKF5OnN8lPBkQEEdCtrDQCLKRMIV3/ZxY5Hu DKcKyRQu/1haCGa7kjA4jwB7Qyf64mJuBqPCQ9/nl3e8XXFT56uesERFXgA4OKcm8mpH+8 rOx+kkqJy6DClbLk5BOylQCL/F72x4ZvpsI6dupHQB6lFgGeRdQgYMFXhoia2g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776410573; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=n/KkMuvd86P2u7/vGXiQ4K05s49BU9nR3B04PImOCKc=; b=IaKQCee7yh3IltAQjBPhmNmm4eRQGpr9Hfb5PNlzGEYK1Bn4rKJpQX2w+iv6RjhLnTmnu3 RoZw4sBkWBT4IkQNU0+hDG9ya4AqjLgGFdnYq7o+OhZLbhKCX8hk2yHNkne2/+iDVAgeAD ARCzY4IN6pqJSGWwjEUfqelMRStkpqQtqXQE0n6rj8fWiQHL/xnDiX9n4Is0oL1/WuXCRv DMC8vTZ02Yg9gtzExnuPjGXnmi3xSs0yeBLTg6TXo1FZEeHVaTyH7G8YuFngiiR/Ykd3Zh D+whrMcFgvK6mH7Oqxgwsgx5jZZXWJRbrFh+RIuLFucXZHGCJlOjUGY3p7T/ww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxmYn3d0kzl1b for ; Fri, 17 Apr 2026 07:22:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 42e7c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 07:22:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Ricardo Branco From: Pouria Mousavizadeh Tehrani Subject: git: caaa7a07fed4 - main - linux: Support IPPROTO_RAW socket option translation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: caaa7a07fed4a16e753c0064482c0eaa0900607b Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 07:22:53 +0000 Message-Id: <69e1dfcd.42e7c.4d8a468a@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=caaa7a07fed4a16e753c0064482c0eaa0900607b commit caaa7a07fed4a16e753c0064482c0eaa0900607b Author: Ricardo Branco AuthorDate: 2026-04-12 14:08:38 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 07:22:39 +0000 linux: Support IPPROTO_RAW socket option translation Handle Linux IPPROTO_RAW socket options in the Linuxulator for both getsockopt(2) and setsockopt(2). Detect the socket family and remap the level to IPPROTO_IPV6 for AF_INET6, reusing the existing option translators. This fixes IPV6_CHECKSUM for IPv6 raw sockets, which Linux programs set at level IPPROTO_RAW rather than IPPROTO_IPV6. Signed-off-by: Ricardo Branco PR: 294434 Reviewed by: pouria Pull-Request: https://github.com/freebsd/freebsd-src/pull/2138 --- sys/compat/linux/linux_socket.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index d971b2a7fbe7..2d20751a41aa 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -2190,6 +2191,26 @@ linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args) } break; #ifdef INET6 + case IPPROTO_RAW: { + struct file *fp; + struct socket *so; + int family; + + error = getsock(td, args->s, &cap_setsockopt_rights, &fp); + if (error != 0) + return (error); + so = fp->f_data; + family = so->so_proto->pr_domain->dom_family; + fdrop(fp, td); + + name = -1; + if (family == AF_INET6) { + name = linux_to_bsd_ip6_sockopt(args->optname); + if (name >= 0) + level = IPPROTO_IPV6; + } + break; + } case IPPROTO_ICMPV6: { struct icmp6_filter f; int i; @@ -2473,6 +2494,26 @@ linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args) } break; #ifdef INET6 + case IPPROTO_RAW: { + struct file *fp; + struct socket *so; + int family; + + error = getsock(td, args->s, &cap_getsockopt_rights, &fp); + if (error != 0) + return (error); + so = fp->f_data; + family = so->so_proto->pr_domain->dom_family; + fdrop(fp, td); + + name = -1; + if (family == AF_INET6) { + name = linux_to_bsd_ip6_sockopt(args->optname); + if (name >= 0) + level = IPPROTO_IPV6; + } + break; + } case IPPROTO_ICMPV6: { struct icmp6_filter f; int i; From nobody Fri Apr 17 07:22:54 2026 X-Original-To: dev-commits-src-main@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 4fxmYq0gDhz6ZDRn for ; Fri, 17 Apr 2026 07:22:55 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxmYp4XKlz3T3X for ; Fri, 17 Apr 2026 07:22:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776410574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m2ffVvF2j10WOwlLyQJ8/3tSwRoToOxWXp7VCrl5/Vs=; b=IHKHI2UQzyXKUOEMqEGXLkWFzZylt5F+ScDbnfRBKCXt2Mu+MAjqh8ng/SfZdgLMB14nJv BgIAFAHJq1pakaVJUfmCA2tOti3M0VWfc5D6GMjb1qJd5RS5O4XG18vjxuL2mw7ZwqaleO mLH2ks9xBidk8PdDF0ee07uI50OMWd0R+g4UL1wa7RZiNdNZXEubv3R+Ti6G9hZbpd73dA JDkMUjI8OlEiGXwn3lVgeA8zWUKQl09nTHlA1Botq4Hx9l+S2TENRWAtrvKFRL9Ou1m188 f32Cqo6uLpPD+66zsXBmVB0TMSgBaHdx9Z3B9HSLdR1A8hcMBoPB06UxSPQoUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776410574; a=rsa-sha256; cv=none; b=dSAeV5h8ECG9/BICrashCwCWn90qvQuJanwwYH2AbAnOAhOzErAc459iwxJ2K164DUI3kQ h9v4/3PrLycRIephF7Q9GOfs+Mvxpy0yZ3L9B2tPjiHuVKy/eTuah9To3u0bpXoJqCZRDH McZF9AYICDLDKV+hNttkIIprDiNEAovsqu9m2WwNyxKxLwiQkVYSirJTww1q0Xq/lw2VaG 24vIVdzfrsTt8ATPAk1UXBKj9i449DTTdKjYEtem5hQk2Etc4rx2YJEGdK/fjM1iUC4kjh 6ObJg2MA/v3N7uNURo1fy/MDK+4j+dFTRDGx2uDtjdQSEnN5fFUjxgI7ly6auQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776410574; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m2ffVvF2j10WOwlLyQJ8/3tSwRoToOxWXp7VCrl5/Vs=; b=YA7nSC29/OHwbb6vzJyPeK0DZL2JaZ8Bv9hubnIQhN3Oxsggk2bkJiIRv/wiLUn71o3KS6 QZM1dSbJI6SMSQaMYqomDyKKrkC6zwSIpTYXKUmFHdb1SSNRq5f3nY4Q5uKPo9STYy6/WI Q95lJ5j6kEMVjTJUootAzabOe1hPMFhCUGuBFndGhTF6dZS0lvItLH8o1La/oyrqvtcDCy WUkXnCcW1unHcm7f3HaT5OobNj1Zqu0LoSINBrTQaXKMbjIjNxgDfi+59FWo+Rh3IHK8ve pGqyoewvJ8XKTG6vnrJnj9P1m49q/+etZadvNBWWH1RyCtC8iyCgGy/Nfvuafg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxmYp43tDzkdS for ; Fri, 17 Apr 2026 07:22:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 43fc1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 07:22:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Ricardo Branco From: Pouria Mousavizadeh Tehrani Subject: git: cd34d8dea4ad - main - linux: Translate IPv6 hoplimit ancillary data for recvmsg List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd34d8dea4adb69b3d7189c7b98dbc9516da3e4a Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 07:22:54 +0000 Message-Id: <69e1dfce.43fc1.496046ed@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=cd34d8dea4adb69b3d7189c7b98dbc9516da3e4a commit cd34d8dea4adb69b3d7189c7b98dbc9516da3e4a Author: Ricardo Branco AuthorDate: 2026-04-12 14:43:05 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 07:22:44 +0000 linux: Translate IPv6 hoplimit ancillary data for recvmsg Signed-off-by: Ricardo Branco Reviewed by: pouria Pull-Request: https://github.com/freebsd/freebsd-src/pull/2138 --- sys/compat/linux/linux_socket.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 2d20751a41aa..29b55ef60357 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -707,6 +707,20 @@ bsd_to_linux_ip_cmsg_type(int cmsg_type) return (-1); } +#ifdef INET6 +static int +bsd_to_linux_ip6_cmsg_type(int cmsg_type) +{ + switch (cmsg_type) { + case IPV6_2292HOPLIMIT: + return (LINUX_IPV6_2292HOPLIMIT); + case IPV6_HOPLIMIT: + return (LINUX_IPV6_HOPLIMIT); + } + return (-1); +} +#endif + static int bsd_to_linux_cmsg_type(struct proc *p, int cmsg_type, int cmsg_level) { @@ -714,6 +728,10 @@ bsd_to_linux_cmsg_type(struct proc *p, int cmsg_type, int cmsg_level) if (cmsg_level == IPPROTO_IP) return (bsd_to_linux_ip_cmsg_type(cmsg_type)); +#ifdef INET6 + if (cmsg_level == IPPROTO_IPV6) + return (bsd_to_linux_ip6_cmsg_type(cmsg_type)); +#endif if (cmsg_level != SOL_SOCKET) return (-1); From nobody Fri Apr 17 09:28:05 2026 X-Original-To: dev-commits-src-main@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 4fxqLT1bmYz6ZQcq; Fri, 17 Apr 2026 09:28:17 +0000 (UTC) (envelope-from royger@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxqLS5X5Yz3qx6; Fri, 17 Apr 2026 09:28:16 +0000 (UTC) (envelope-from royger@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776418096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3Ig0+wsjGXB2SyFzYYosvGXFfusb9md+hjUPfEBTMfI=; b=VsqM0YW+lwkjrW2Vaa4nxjCuWFowsUdmp2AfE6YZbccg8b08mBz5qOpx8rreXHdvKChCCm ZpV1Zccz4CgFOdMQ14CsCBIs3mpdinyM2FBRCFIAldDQYOgCG0HVz0by2ScwOoUcbdQddJ ulVJu/6gahArVUve3/zkrjKTso14Pq28W5i0j/Tb9pgqwoK/BR7S82jln2jhqka8aOclf7 mxRSh3Nk8hn3XyUc+JMyiFjs7K4xMy8vTTpfb+6CxbsmCoT8NVYIvh/5eC26+5keatQZaA u9TJV4HaS8GCV7J/7u0z0FqzlLgVNZ65Yqq1A6YrhfuAeGclIvI31R0FlYxsdg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776418096; a=rsa-sha256; cv=none; b=DUo4Gl0DhsaYfD0sSufCOEX8y4XxvuwtEhPwVzDXSWJYnL91AuEFxSBLhYkAgEELjMmbz/ xgxw7JOX+UL3a62POKrcW37BODK5RoscGG+dQ6LFJfKotvma9sn5WNxBGHUWIuroHq638V KPtKsi0qh7O5hHHHvr6ikuRiNUO2dfcm+d8RCkOQPFXfE5mggIs6Me6hwjp9bQ1OP8wOEk 3KkIALoZbPekAzsQsCPPVfYEuIku6L5Rqp2szmuFea8KAZ+UBgxXuzaNwfsZcRAMHHng1K VoLHvsQaWFeljODgZfAajqZEBKI1vyPEVQmG6Dkh9fP9I5Ffe5qtcwcv+ZogZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776418096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3Ig0+wsjGXB2SyFzYYosvGXFfusb9md+hjUPfEBTMfI=; b=aj/Ko1nbML58tqrS7ejFkKg9CpghLnECxbZ6NcSEYTVm5bxRINBO7s0qzV+Cyvcw+Ne4t5 6BFjsMM3Bs6y2ppCE8O8CsL9ki6Gp3rZ9fb+pzGb/IBXe/X2pjJPSBCR1xFzH7alBN/Gqu wLvE5zXpXF99Jrerhg0wA50fS01b9RREP7IVrZ3aiinWBGvXfFA4QzkOR6NS9PKrsmfNDq SF5W80dm8PT8Ftcd0vPnpSNpucV/kCRRYxceZLqSdqWMSZ9BImdH6LWxFRwEf+QHQbPiR4 BonlV7UolmIYKZOOkIncq5Sr/Gg+6A2I4YLNQTS/kTE4dzrGiiEXI7SI2qbGUw== Received: from localhost (112.pool92-178-7.dynamic.orange.es [92.178.7.112]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: royger) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fxqLS2MqZznnC; Fri, 17 Apr 2026 09:28:16 +0000 (UTC) (envelope-from royger@freebsd.org) Date: Fri, 17 Apr 2026 11:28:05 +0200 From: Roger Pau =?utf-8?B?TW9ubsOp?= To: Mark Johnston Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, imp@freebsd.org Subject: Re: git: 1491fe8f864a - main - uart/pci: support 16550A PCI serial devices Message-ID: References: <69c640e1.1fc2b.4542bc24@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Apr 16, 2026 at 04:17:03PM -0400, Mark Johnston wrote: > On Fri, Mar 27, 2026 at 08:33:37AM +0000, Roger Pau Monné wrote: > > The branch main has been updated by royger: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=1491fe8f864af5af37e83f1d12459905fb6097fd > > > > commit 1491fe8f864af5af37e83f1d12459905fb6097fd > > Author: Roger Pau Monné > > AuthorDate: 2026-03-26 10:01:57 +0000 > > Commit: Roger Pau Monné > > CommitDate: 2026-03-27 08:26:32 +0000 > > > > uart/pci: support 16550A PCI serial devices > > > > Expand the current check to also attach the ns8250 driver to devices > > reporting as 16550A. This has been tested to work on a real device. > > > > From an inspection of the code in the ns8250 driver it seems like it should > > support up to 16950A devices, but I don't have hardware to ensure that, > > hence be conservative with the change. > > I have a system which hangs in uart_bus_probe() after this change. It > has a 2-port UART PCI card installed: > > puc0@pci0:6:0:0: class=0x070002 rev=0x00 hdr=0x00 vendor=0x1415 device=0xc158 subvendor=0x1415 subdevice=0xc158 > vendor = 'Oxford Semiconductor Ltd' > device = 'OXPCIe952 Dual Native 950 UART' > class = simple comms > subclass = UART > > Normally puc(4) attaches to it and creates two child uart devices: > > puc0 > Interrupt request lines: > 0x11 > pcib7 memory window: > 0x84000000-0x841fffff > 0x84200000-0x843fffff > 0x84400000-0x84403fff > uart2 > puc0 I/O memory mapping: > 0x84401000-0x844011ff > puc0 port numbers: > 0x1 > uart3 > puc0 I/O memory mapping: > 0x84401200-0x844013ff > puc0 port numbers: > 0x2 > > After this change, though, uart(4) tries to probe the device directly > and hangs. Presumably we still want to exclude at least multi-port > devices here? Hm, I see, sorry, I didn't think changing the UART version compatibility would cause this. What about using BUS_PROBE_SPECIFIC vs BUS_PROBE_GENERIC? If the PCI device matches a device in the pci_ns8250_ids array we return SPECIFIC, otherwise if it's a generic PCI serial device we return GENERIC, thus allowing the puc driver to take over it. Could you please give a try to the patch below. Thanks, Roger. --- diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c index b0d285e3c603..f8da4eaf8d25 100644 --- a/sys/dev/uart/uart_bus_pci.c +++ b/sys/dev/uart/uart_bus_pci.c @@ -280,33 +280,43 @@ uart_pci_probe(device_t dev) { struct uart_softc *sc; const struct pci_id *id; - struct pci_id cid = { - .regshft = 0, - .rclk = 0, - .rid = 0x10 | PCI_NO_MSI, - .desc = "Generic SimpleComm PCI device", - }; - int result; sc = device_get_softc(dev); id = uart_pci_match(dev, pci_ns8250_ids); if (id != NULL) { sc->sc_class = &uart_ns8250_class; - goto match; + return BUS_PROBE_SPECIFIC; } if (pci_get_class(dev) == PCIC_SIMPLECOMM && pci_get_subclass(dev) == PCIS_SIMPLECOMM_UART && pci_get_progif(dev) <= PCIP_SIMPLECOMM_UART_16550A) { - /* XXX rclk what to do */ - id = &cid; sc->sc_class = &uart_ns8250_class; - goto match; + return BUS_PROBE_GENERIC; } /* Add checks for non-ns8250 IDs here. */ return (ENXIO); +} + +static int +uart_pci_attach(device_t dev) +{ + const struct pci_id cid = { + .regshft = 0, + .rclk = 0, + .rid = 0x10 | PCI_NO_MSI, + .desc = "Generic SimpleComm PCI device", + }; + struct uart_softc *sc; + const struct pci_id *id = uart_pci_match(dev, pci_ns8250_ids); + int count, result; + + if (id == NULL) + /* No specific PCI ID match, must be a generic device. */ + id = &cid; + + sc = device_get_softc(dev); - match: result = uart_bus_probe(dev, id->regshft, 0, id->rclk, id->rid & PCI_RID_MASK, 0, 0); /* Bail out on error. */ @@ -322,26 +332,13 @@ uart_pci_probe(device_t dev) /* Set/override the device description. */ if (id->desc) device_set_desc(dev, id->desc); - return (result); -} - -static int -uart_pci_attach(device_t dev) -{ - struct uart_softc *sc; - const struct pci_id *id; - int count; - - sc = device_get_softc(dev); /* - * Use MSI in preference to legacy IRQ if available. However, experience - * suggests this is only reliable when one MSI vector is advertised. + * Use MSI in preference to legacy IRQ if available. However, + * experience suggests this is only reliable when one MSI vector is + * advertised. */ - id = uart_pci_match(dev, pci_ns8250_ids); - /* Always disable MSI for generic devices. */ - if (id != NULL && (id->rid & PCI_NO_MSI) == 0 && - pci_msi_count(dev) == 1) { + if ((id->rid & PCI_NO_MSI) == 0 && pci_msi_count(dev) == 1) { count = 1; if (pci_alloc_msi(dev, &count) == 0) { sc->sc_irid = 1; From nobody Fri Apr 17 09:45:49 2026 X-Original-To: dev-commits-src-main@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 4fxqkj6PHJz6ZRjn for ; Fri, 17 Apr 2026 09:45:49 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxqkj5dnqz3v0K for ; Fri, 17 Apr 2026 09:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776419149; 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=H0IgagGpaHjmz1XTCnTo+SEHFr4SUfXQ7HQ/2R2BrQo=; b=aRGK4kPCB1/xPojHmdZCpyqcslORnFhEQngUTLqYBYYvnnQUFOGh8J1xdIkA2yiZmyhyEP lqvLQ16Vbi0euKFymLvZ3PM1uojmntZhDs+/VS8GDKeks8lg6i65/YhPB0fxEkXadzWrDa DNsga0qINAE8nuuFjRNaNiJL6FdGYCM7EXLKoMtxAiOBt77GbG5ZUf85acJkFPLZ0HAenT YeGSzR9g9PJEwgOjDQISqUw4k24R77s0jK2Bl4Crma5JIvrMxPyflTn6LeHsgrMv8LFleY ZTXZEghkLtwsQC3k+8Fb5ftQ+mYeMDFmVwviRs47n0O1k/LjcDLxH+1QSaO6BQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776419149; a=rsa-sha256; cv=none; b=lO/viHtIkRqUgM0iTUv2OuTQSzUxOQx/c0u4qJNfZMLXwolyrqxkGXJdh8ia14iqXHQUdh Plpfo7Jh7UQDdH2gQwADA+Exq5f8KkX5b3aBYt0upfEWp9ZqzNNrQDDpNayZi/Z3tBs1Vv rzggEIpZybUV8x4l1yq9yy0SPIgjUfipoDGZ65TxRw59c9+MgijnS61UHortlpxyhBYAG0 Grz5e/E4Oss9wO6gBH9EMmbvm88c4LwLWyEmLlfvSj7c4DAUZ96Nf+hKv7/7ZYk6cxdeEy axezgyq/5Ly2MWpvmYnXJlLQk1XsbDjG7TpSsHCdMDqelk6dr7QKkuoj68zJ7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776419149; 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=H0IgagGpaHjmz1XTCnTo+SEHFr4SUfXQ7HQ/2R2BrQo=; b=Ie+L5hIt24tltD6WQP/w7QMC/iQqDXiFem8m74FQ0sUjHRByk6CsksY44RKPyItk6LYGl3 A4TnS5b76NAZEDNZpmrwKhFMMTPNf60tTu4qvmvrZ792Ku27GRh0dgz/lYSJwkVTWuOv5V gyS2w4D8X8OXHCAWznOkA5mkF7PuUGvZFSTD4tlYTq8nYpvgIn/wkvNozQzz8dqDH2VDqm axyIFtAUA1FJyod3YsF7MRhW/FMOGsKod5nbzp/+5RrYexpdBURyzFxfSyOIbvVrYQmKUn cd/XswF8VRHHoVVaMj31RxAGYYSTQHe0CccO2jWyEFfTp9t4LJj6iw3mxLFXzA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxqkj4tmkzpr6 for ; Fri, 17 Apr 2026 09:45:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2373a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 09:45:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alfredo Dal'Ava Junior Subject: git: 3b373d484046 - main - us.intl.acc.kbd: add it to Makefile List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b373d484046a94d050a7901feadc001f35fa97f Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 09:45:49 +0000 Message-Id: <69e2014d.2373a.86f5619@gitrepo.freebsd.org> The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=3b373d484046a94d050a7901feadc001f35fa97f commit 3b373d484046a94d050a7901feadc001f35fa97f Author: Alfredo Dal'Ava Junior AuthorDate: 2026-04-17 05:01:54 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2026-04-17 09:45:32 +0000 us.intl.acc.kbd: add it to Makefile This keyboard was implemented but wasn't actually installed to the system. Fixes: a049678039e40bdf523230852f78887a12435def Discussed with: imp MFC after: 1 day Relnotes: yes --- share/vt/keymaps/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/share/vt/keymaps/Makefile b/share/vt/keymaps/Makefile index e3f63bd37d5f..27291f7709fd 100644 --- a/share/vt/keymaps/Makefile +++ b/share/vt/keymaps/Makefile @@ -80,6 +80,7 @@ FILES= INDEX.keymaps \ uk.kbd \ uk.macbook.kbd \ us.acc.kbd \ + us.intl.acc.kbd \ us.ctrl.kbd \ us.dvorak.kbd \ us.dvorakl.kbd \ From nobody Fri Apr 17 09:58:09 2026 X-Original-To: dev-commits-src-main@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 4fxr135d8Tz6ZScf; Fri, 17 Apr 2026 09:58:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxr134xJRz3w2R; Fri, 17 Apr 2026 09:58:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776419895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uxUt3vISo6Co4LBDZY89eBgz/lpzgksdJltr0Y9yjZo=; b=khux1+JO9j6P/e1e3iuYk7Qk1/nn0N8tAFXCgYhUZs8jLZNGDIhp2HMn3O0gg5CGzlvbLj DpW48lD17lsxbTkme3gt6zPzdixXaREByYbpfF6U4Tzj9BK0FLJaklwT+7rhvTk4JrG3A9 gBAKnNJutiY9f/7vPuzb4hg0o4j3x7wHXGos9tr19sZmqq4+uuoIHaEhBocLCK/W4CaJ51 H9fOtc2LyV6o2IPO2zvmM6J+pLy8DnJTASeBNf6u2UlNujo0i3CZvsRB2C6qZRa3aLKcdK ehesX3KEo70B+ZFb+n/VMRuCQoLGXFYsjMTgUfFuK4JF2nFq5x6ZkrAc2uhWSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776419895; a=rsa-sha256; cv=none; b=RNshTF1BXfN7tRHDcjYfvAqqN7m9I3K0e3QOT5JqWZ5x59JeizUGUuxy9mJTNsFNLtYolT enPGGd2/6gIIgfOPFjdlkgqj+uBVnihi/31VBrGdDuCgZuHiO1gu+VVX+JJMa4ubdfjJD+ ooBFnoJzYEUTGgroQZIDXGuOhGXRWq91WWMm8z9bdGCXTa+5f/xOOe5DrioDN5on4DfuUx OlAOpP7CKsmH9K4nf8nO/bIGbPBPLT3wgmowUzHqVZ3Te8usC4b/gahKzJyd3sZhMXjYDT MO/Kgop9fw/ubC9+7g52W/HjeeBGNFgGZ2iraNU4bXpp9oZBns8e4GrbOyhSWg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776419895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uxUt3vISo6Co4LBDZY89eBgz/lpzgksdJltr0Y9yjZo=; b=IhayaEkuPTA1VpzjuH9y0vWSYn1Kr2V5MCJYEX1R9gu7vMiCMU+7K/dypwCnq9BAzHQ3br QGAD5r9aF4kALjcIziMTlzSH46gsGjTFm58THrN5cxwRt5LcxU8f46TEQ3gk1eJuOjHUIX 3QS2qTcjALZRmCjHA1ax5y+L88ytr/wrKyCH5dRN8Mbu2Q+gt20jCwhpCUAxrrubnO8Rfv Lnn68vlFD0ZXWPtcvudrFfG/ut9t8dAL40gJ3ach1lrL1KtFPUWWOtmrb7IZIv9+nIRsEo qTd3pRWdcpc2Aai4CRPwcAxxEenA93wSqgTeONLLNZkKPf9vWM0lE86wQe0sOw== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (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 (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R12" (not verified)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fxr133VV4znqm; Fri, 17 Apr 2026 09:58:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id D0EAE1FF98; Fri, 17 Apr 2026 11:58:09 +0200 (CEST) From: Kristof Provost To: Andrew Gallatin Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 956acdce0505 - main - loopback: Account for packet drops Date: Fri, 17 Apr 2026 11:58:09 +0200 X-Mailer: MailMate (2.0r6272) Message-ID: In-Reply-To: <69de99dd.422ab.2b84d627@gitrepo.freebsd.org> References: <69de99dd.422ab.2b84d627@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 14 Apr 2026, at 21:47, Andrew Gallatin wrote: > The branch main has been updated by gallatin: > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D956acdce0505ca8028d287d3= b44789c623c8f37e > > commit 956acdce0505ca8028d287d3b44789c623c8f37e > Author: Andrew Gallatin > AuthorDate: 2026-04-14 19:43:28 +0000 > Commit: Andrew Gallatin > CommitDate: 2026-04-14 19:43:28 +0000 > > loopback: Account for packet drops > > Make loopback packet drops more obvious by reporting them > in interface stats visable via netstat -ni > Since loopback uses netisr, packets can be dropped if the > netisr queue overflows. These drops are visible via > netisr -Q, but its not an obvious place to look. > > Differential Revision: https://reviews.freebsd.org/D56356 > Reviewed by: glebius, tuexen > Sponsored by: Netflix > --- > sys/net/if_loop.c | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > > diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c > index 37309260a0d3..2ff265d5d1e7 100644 > --- a/sys/net/if_loop.c > +++ b/sys/net/if_loop.c > @@ -350,9 +350,13 @@ if_simloop(struct ifnet *ifp, struct mbuf *m, int = af, int hlen) > m_freem(m); > return (EAFNOSUPPORT); > } > - if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); > - if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); > - netisr_queue(isr, m); /* mbuf is free'd on failure. */ > + if (netisr_queue(isr, m) =3D=3D 0) { > + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); > + if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); I=E2=80=99m seeing reproducible KASAN use-after-free warnings here (runni= ng the pf tests). Which makes sense, because after the netisr_queue() call we no longer own= the mbuf. I think we need something like this: diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index 2ff265d5d1e7..33ddd3a8540e 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -276,6 +276,7 @@ int if_simloop(struct ifnet *ifp, struct mbuf *m, int af, int hlen) { int isr; + int32_t len; M_ASSERTPKTHDR(m); m_tag_delete_nonpersistent(m); @@ -350,9 +351,10 @@ if_simloop(struct ifnet *ifp, struct mbuf *m, int a= f, int hlen) m_freem(m); return (EAFNOSUPPORT); } + len =3D m->m_pkthdr.len; if (netisr_queue(isr, m) =3D=3D 0) { if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - if_inc_counter(ifp, IFCOUNTER_IBYTES, m->m_pkthdr.len); + if_inc_counter(ifp, IFCOUNTER_IBYTES, len); } else { /* mbuf is free'd on failure. */ if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); Best regards, Kristof From nobody Fri Apr 17 11:55:39 2026 X-Original-To: dev-commits-src-main@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 4fxtcX2hMxz6Zd0t for ; Fri, 17 Apr 2026 11:55:40 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxtcX0Nz2z4727 for ; Fri, 17 Apr 2026 11:55:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776426940; 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=9LyEIXU9e2Lx/8CSZ7U/on8RTigfV+aJdqyOpkHKjT8=; b=jp844tQ/Gw7Kyk+2/AUaaJW3NVzLmB1h4k4xiahWp+xyEtloJ2gdv8ZVZIGUkJYCpKbzps ctG88WDqDv50R252oLvpVr7gzQVgZAIfC/t2USiR07svVEGNAwKtdflE4ch837eOl8bor+ 4773KzWFxPar0oiX5IgY6ABDeTbmrZE2LQEAL42/QnbOkKWKlYD+vDgTotTZK8uJ1F2oij emvMO7cNgaIntAprPFB/5jjp+wT78sKD5IQRyh5pJa79IpqO4qL1tj1wUli39FRloEbuLM KFw9K5XR+qxrh1tZTsW7k1unmH1wQOB2lFH3DOyj5kUkXngx9eJuIdHNiKDuyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776426940; a=rsa-sha256; cv=none; b=no1K5epo5tY/ExaWa3RpQSxnBBM0QLiEpE/iPyhjlq7wPJ9+blVPnff4SfQfVFJjr5jJIu W5pTbORZR69lfjlMRaLJlk7AVYXBpj3ppPKWe1gVlUgEEgOGHSUvlejpF5FV0FU4TTDjI1 BZ4Gjpu+MY2TuoqIbw4JoZIt6u8ieh77oOGyClEfRDitBiBDaAf6zuA2PRnKCuDP7i/Eok BzfW0rBUtA0vSXmDwKqFZZXDUBGf2YZ8QDhnP3GD1GTXOGDZ2f5y+ltgyinhgMe8nCGKDe fDdCqKQTTgc6Xfr4d/D6rCGn1tLzzteir1bVyPaBYMymNou9g58RKkvuXRVt5Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776426940; 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=9LyEIXU9e2Lx/8CSZ7U/on8RTigfV+aJdqyOpkHKjT8=; b=hkJ2SQH2YupHkFJE1uOIe+iQY/73aIGgHiaBG+UMnP9MsQYayqw+84Mi2HnNMBKq20FTWP smpl1ogOs/efYdw2bej82Dh8iLkmmj9MeAvPuxrP3+3QTtBE88GwNGWoAyfZPyZThVITVA oowmSk7wsGcvTgjOGsisx5U7BWSvRLDz2szgNEVq3jpZaduVKznG+ZsbIVTkzIEhsBW+Qq F2sTL6DzyF9l1SnaJG7B0atIQgqVN340hjT7W8bnzlevxinW1UwVSBScesAv5iSn/bX9J5 QzfrSMEh2m4+KkAMKC3vZ7+gDmfse14w9qg/W2DwxkgMeS0JvO57KLo0HLw4Xg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxtcW6Qljzss9 for ; Fri, 17 Apr 2026 11:55:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a696 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 11:55:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 13b4a14c719a - main - libpfctl: fix add state/source limiter List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 13b4a14c719ab7c65ccaab86ddc79f0edc312aa3 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 11:55:39 +0000 Message-Id: <69e21fbb.3a696.318383b4@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=13b4a14c719ab7c65ccaab86ddc79f0edc312aa3 commit 13b4a14c719ab7c65ccaab86ddc79f0edc312aa3 Author: Kristof Provost AuthorDate: 2026-04-16 12:30:35 +0000 Commit: Kristof Provost CommitDate: 2026-04-17 11:55:05 +0000 libpfctl: fix add state/source limiter When processing the return data from these calls pass the limiter pointer, not the limiter pointer pointer. Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libpfctl/libpfctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index cd484949e4da..59783592a370 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -4084,7 +4084,7 @@ pfctl_state_limiter_add(struct pfctl_handle *h, struct pfctl_state_lim *lim) return (ENXIO); while ((hdr = snl_read_reply_multi(&h->ss, seq_id, &e)) != NULL) { - if (! snl_parse_nlmsg(&h->ss, hdr, &statelim_parser, &lim)) + if (! snl_parse_nlmsg(&h->ss, hdr, &statelim_parser, lim)) continue; } @@ -4153,7 +4153,7 @@ pfctl_source_limiter_add(struct pfctl_handle *h, struct pfctl_source_lim *lim) return (ENXIO); while ((hdr = snl_read_reply_multi(&h->ss, seq_id, &e)) != NULL) { - if (! snl_parse_nlmsg(&h->ss, hdr, &sourcelim_parser, &lim)) + if (! snl_parse_nlmsg(&h->ss, hdr, &sourcelim_parser, lim)) continue; } From nobody Fri Apr 17 11:55:41 2026 X-Original-To: dev-commits-src-main@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 4fxtcY2t7mz6ZcvL for ; Fri, 17 Apr 2026 11:55:41 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxtcY0d8Hz47JD for ; Fri, 17 Apr 2026 11:55:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776426941; 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=DyFFMkFb720sklFjHEq+C0+n2G27kwyydu0e5XVy5rs=; b=r6gfx+tJIZzdbLbh+r7ZshoiSYMWEssxiA6xV0DaYA2bO5h1ToE1Nw50zbUsuR+xu6BqGk ggjSxf93TtwxIT7mbMWPDoTxa7nNnYEurd9gpfelhmUOL3Pvm5P8kC5Y65uUhGHlsbVA33 1itkcUcPox/S3XhZ6T4TMdX7Dqf6vbfZGaqfcTXMk6qR0Veu2CEtNkOyHmhAgNa9eQCDhj PBjf2TkX1OJYi8ZKBUB5KdRpP6dylWujD3DG4VJ0pGY6jF89LMYCiCT3ihAwMOonHnQld7 0Ha6BDboBfWlljPN2/YJGchArHWjniqw36Yq3Jo0Jz2TFDkoocqd03jyI7J8TQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776426941; a=rsa-sha256; cv=none; b=fAJkQBdO1jM0ctBUcFy7T1QqtmfMylUqG6SpOa5t0GEUdAvxY8m60zKyKMtRfRK5/la+hE 7zOJlxjbNcYzOLFJOW1A7kwP5b9YJD1HaXBWNON3OjBa/MEp9o++CXm3Xb1lEYWXpeErwS CAtK1h0oLSeeLRCV5um505mb8p9bPTUZXyk0ZYdETWRPzzohEaBnFTpZp49fG+QESTgS4H oY3Lqf949qaT4r59zeYcUXVRLPvvuTOGvuX57Dcs1KpYW5vSeBhxxVmV0kKGpjLZzbxIXT 4Pf7KHqDiqfxgu4pTvmDwr7GuCPPxC+nXyPuJjwv/yx4idyDU1vozZOzZ0l37g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776426941; 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=DyFFMkFb720sklFjHEq+C0+n2G27kwyydu0e5XVy5rs=; b=cadReKoHDKqxLQmDVtOmSZ6aO2xSiclPHfHo+znCsf9jXAya8yvXCyQFaTh1p1+b5RvqEA AzNlX4eMo24bKZzG27QUrx/K9RS/H6kf8n1SyW3ov7jlAHD+9pUBtmraQK4zsOEP6l7gry Ke/ieDItri2TDOoILjaXpf2ovGnrbHcARyfF6ksRhYSImhouO/5GP3ix2n5ClVk2XhBzoj sL7HwNjEImUsqjlXHvbFUCsAPokxEF4M3lq8PeGJF2cabDRHu0E/0D9sLS9Cm6hssiFFoN TpiYRloROmNDk+WG/4XwgWpXM3Am8AbEfqfbapI5DoNtXLBj9T7d9Z6+R23CVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxtcY079XztBN for ; Fri, 17 Apr 2026 11:55:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a5d8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 11:55:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 6f8ea66cbcf2 - main - pfctl: fix how source and state limiters are wired into rbtrees List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 6f8ea66cbcf2e2e5bc82e8f0c2e0038a3c7d6a9e Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 11:55:41 +0000 Message-Id: <69e21fbd.3a5d8.262dc858@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=6f8ea66cbcf2e2e5bc82e8f0c2e0038a3c7d6a9e commit 6f8ea66cbcf2e2e5bc82e8f0c2e0038a3c7d6a9e Author: Kristof Provost AuthorDate: 2026-04-16 09:16:29 +0000 Commit: Kristof Provost CommitDate: 2026-04-17 11:55:05 +0000 pfctl: fix how source and state limiters are wired into rbtrees i messed up when we added support for names on these things. the id and names are each supposed to be unique, which is checked by putting the one limiter into an rb tree based on their id and another based on their name. unfortunately i used the same RBT_ENTRY fields for both trees, which meant using both trees on the same limiter corrupted the topology, which goes badly when you want to use multiple limiters. found by, tested, and ok dgl@ (who is not me, this is not a typo) ok jmatthew@ Obtained from: OpenBSD, dlg , f951d642cc Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/pfctl.c | 21 ++++++++++++--------- sbin/pfctl/pfctl_parser.h | 6 ++++-- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index a7bba4055b06..48e6a053a842 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -152,13 +152,13 @@ int pfctl_call_cleartables(int, int, struct pfr_anchoritem *); int pfctl_call_clearanchors(int, int, struct pfr_anchoritem *); int pfctl_call_showtables(int, int, struct pfr_anchoritem *); -RB_PROTOTYPE(pfctl_statelim_ids, pfctl_statelim, entry, +RB_PROTOTYPE(pfctl_statelim_ids, pfctl_statelim, id_entry, pfctl_statelim_id_cmp); -RB_PROTOTYPE(pfctl_statelim_nms, pfctl_statelim, entry, +RB_PROTOTYPE(pfctl_statelim_nms, pfctl_statelim, nm_entry, pfctl_statelim_nm_cmp); -RB_PROTOTYPE(pfctl_sourcelim_ids, pfctl_sourcelim, entry, +RB_PROTOTYPE(pfctl_sourcelim_ids, pfctl_sourcelim, id_entry, pfctl_sourcelim_id_cmp); -RB_PROTOTYPE(pfctl_sourcelim_nms, pfctl_sourcelim, entry, +RB_PROTOTYPE(pfctl_sourcelim_nms, pfctl_sourcelim, nm_entry, pfctl_sourcelim_nm_cmp); enum showopt_id { @@ -4187,7 +4187,8 @@ pfctl_statelim_id_cmp(const struct pfctl_statelim *a, return (0); } -RB_GENERATE(pfctl_statelim_ids, pfctl_statelim, entry, pfctl_statelim_id_cmp); +RB_GENERATE(pfctl_statelim_ids, pfctl_statelim, id_entry, + pfctl_statelim_id_cmp); static inline int pfctl_statelim_nm_cmp(const struct pfctl_statelim *a, @@ -4196,7 +4197,8 @@ pfctl_statelim_nm_cmp(const struct pfctl_statelim *a, return (strcmp(a->ioc.name, b->ioc.name)); } -RB_GENERATE(pfctl_statelim_nms, pfctl_statelim, entry, pfctl_statelim_nm_cmp); +RB_GENERATE(pfctl_statelim_nms, pfctl_statelim, nm_entry, + pfctl_statelim_nm_cmp); int pfctl_add_statelim(struct pfctl *pf, struct pfctl_statelim *stlim) @@ -4253,7 +4255,7 @@ pfctl_sourcelim_id_cmp(const struct pfctl_sourcelim *a, return (0); } -RB_GENERATE(pfctl_sourcelim_ids, pfctl_sourcelim, entry, +RB_GENERATE(pfctl_sourcelim_ids, pfctl_sourcelim, id_entry, pfctl_sourcelim_id_cmp); static inline int @@ -4263,7 +4265,7 @@ pfctl_sourcelim_nm_cmp(const struct pfctl_sourcelim *a, return (strcmp(a->ioc.name, b->ioc.name)); } -RB_GENERATE(pfctl_sourcelim_nms, pfctl_sourcelim, entry, +RB_GENERATE(pfctl_sourcelim_nms, pfctl_sourcelim, nm_entry, pfctl_sourcelim_nm_cmp); int @@ -4272,8 +4274,9 @@ pfctl_add_sourcelim(struct pfctl *pf, struct pfctl_sourcelim *srlim) struct pfctl_sourcelim *osrlim; osrlim = RB_INSERT(pfctl_sourcelim_ids, &pf->sourcelim_ids, srlim); - if (osrlim != NULL) + if (osrlim != NULL) { return (-1); + } osrlim = RB_INSERT(pfctl_sourcelim_nms, &pf->sourcelim_nms, srlim); if (osrlim != NULL) { diff --git a/sbin/pfctl/pfctl_parser.h b/sbin/pfctl/pfctl_parser.h index 8934238da148..631a6b9a32ea 100644 --- a/sbin/pfctl/pfctl_parser.h +++ b/sbin/pfctl/pfctl_parser.h @@ -77,7 +77,8 @@ struct pfr_buffer; /* forward definition */ struct pfctl_statelim { struct pfctl_state_lim ioc; - RB_ENTRY(pfctl_statelim) entry; + RB_ENTRY(pfctl_statelim) id_entry; + RB_ENTRY(pfctl_statelim) nm_entry; }; RB_HEAD(pfctl_statelim_ids, pfctl_statelim); @@ -85,7 +86,8 @@ RB_HEAD(pfctl_statelim_nms, pfctl_statelim); struct pfctl_sourcelim { struct pfctl_source_lim ioc; - RB_ENTRY(pfctl_sourcelim) entry; + RB_ENTRY(pfctl_sourcelim) id_entry; + RB_ENTRY(pfctl_sourcelim) nm_entry; }; RB_HEAD(pfctl_sourcelim_ids, pfctl_sourcelim); From nobody Fri Apr 17 11:55:42 2026 X-Original-To: dev-commits-src-main@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 4fxtcb0Kbwz6ZdLT for ; Fri, 17 Apr 2026 11:55:43 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxtcZ2Dvcz46tN for ; Fri, 17 Apr 2026 11:55:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776426942; 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=vLBNVRUaoASW/MDTs3shPjziPQfu+XiRBiwEzE8l7hs=; b=yr7GMOIvW+QuaKVMetSnZUQdsBeK6gR58+62n8/BkOuW2s7oC59bWvhB3D2XAr4FTlVaYI +5rbfhjVX+aa7ICWdCD4M3zPbp1EdbeZQSyf3hmINyhWS97FkLZAHrwTdsmbvCXkuZZwDV GukQnm83BlqZ8ZYlGCEHIRBucfdIsywMRbtFO5l2GcRqK4Qws9qgs9ejx5rYeIrIwh43Fy Ty7uWzMPNHP2IvdWNL129AcK4ULEAo+D1aPiEue6JdsD1pOnDejQM7J380w/eYb+sV4Sxm cG8E9PclVcCZW4AXgVEZoifmq9waDkcFhUeNWXHUniiGj0O5cU4O8V8PNIDG6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776426942; a=rsa-sha256; cv=none; b=HT6ukgJeC+IsPCcGYzyvBneXqiK4ohqxXuJl75fcPoIHX/qUQScTaXuEjCb/ACBB4TFq64 vIq7+cRIUJVHyj7CucZGP965lsK5bxyD6Q2U8YGmQpLVkGP0VvtCQ9L14rlCOix2MbZ6+s qfhnyhMr1RL8xnv5hbnJgGhKvrntzy6cZ9u6F2aMp7EYQEWJ3maCIUOp+FAkc+9tzjxViq 3YYGqnqTIoAojT2H5m8A34mZfdwatK8WdNwW40XdB8jsGwIlHEIgszWlmOf+rzgp2z3FU8 7VFnAMZtlAKw905yrh0MFU6WvehqcmQOSs84Xu7PmDKT6zPvSFuMe7OvZEOqyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776426942; 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=vLBNVRUaoASW/MDTs3shPjziPQfu+XiRBiwEzE8l7hs=; b=X3rxOLbkQifFNO3Sg1AbhDyH/y2rkEkARh9wlB/4y3qx7Kyo/UJ93Aj6l5/p2ia+JoniFd BVi8avMLK7xE4RA+/LR6K34M69E0feVioud/lP6OUSYznDUm2hjEgdZ+XdkrhslzqWWYNF YrD0mEv70Lhw6PddPRUvMRaMQGuTFOFPJTi3EO7q4uCENztvmv7TuVVOXN58SDcTekmGaB /jmKTmZrdWgJHT2b1eesjmAzOCYXdLo7HPFnjkTNJUSk7Pm9Gxn0+OEFjhF0LQPckq2Q4h RZkyKDiuvsWgzfYW5SdcwaePIaKHd6GbCHDS9cVos/y3hWU7Zj5bOgeupQyfnw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxtcZ0XR8ztBP for ; Fri, 17 Apr 2026 11:55:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 397d2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 11:55:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 95fe1ba5579d - main - pf tests: test having multiple state limiters List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 95fe1ba5579df2fe204ad30d892160966677ae98 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 11:55:42 +0000 Message-Id: <69e21fbe.397d2.7d823b5d@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=95fe1ba5579df2fe204ad30d892160966677ae98 commit 95fe1ba5579df2fe204ad30d892160966677ae98 Author: Kristof Provost AuthorDate: 2026-04-16 13:46:59 +0000 Commit: Kristof Provost CommitDate: 2026-04-17 11:55:06 +0000 pf tests: test having multiple state limiters Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/limiters.sh | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tests/sys/netpfil/pf/limiters.sh b/tests/sys/netpfil/pf/limiters.sh index 8d9a199db787..f576955e5640 100644 --- a/tests/sys/netpfil/pf/limiters.sh +++ b/tests/sys/netpfil/pf/limiters.sh @@ -185,6 +185,56 @@ state_block_cleanup() pft_cleanup } +atf_test_case "state_multiple" "cleanup" +state_multiple_head() +{ + atf_set descr 'Create multiple state limiters' + atf_set require.user root +} + +state_multiple_body() +{ + pft_init + + epair=$(vnet_mkepair) + + ifconfig ${epair}a 192.0.2.2/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping -c 1 192.0.2.1 + + jexec alcatraz pfctl -e + # Allow up to one ICMP state. + pft_set_rules alcatraz \ + "set timeout icmp.error 120" \ + "state limiter \"server\" id 1 limit 1" \ + "state limiter \"client\" id 2 limit 1" \ + "block in proto icmp" \ + "pass in proto icmp state limiter \"server\" (no-match)" + + atf_check -s exit:0 -o ignore \ + ping -c 2 192.0.2.1 + + # This should now fail + atf_check -s exit:2 -o ignore \ + ping -c 2 192.0.2.1 + + jexec alcatraz pfctl -sLimiterStates + hardlim=$(jexec alcatraz pfctl -sLimiterStates | awk 'NR>1 { print $5; }') + if [ $hardlim -eq 0 ]; then + atf_fail "Hard limit not incremented" + fi +} + +state_multiple_cleanup() +{ + pft_cleanup +} + atf_test_case "source_basic" "cleanup" source_basic_head() { @@ -261,5 +311,6 @@ atf_init_test_cases() atf_add_test_case "state_basic" atf_add_test_case "state_rate" atf_add_test_case "state_block" + atf_add_test_case "state_multiple" atf_add_test_case "source_basic" } From nobody Fri Apr 17 11:55:43 2026 X-Original-To: dev-commits-src-main@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 4fxtcc3SZtz6ZdY2 for ; Fri, 17 Apr 2026 11:55:44 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxtcb3h8Kz47JY for ; Fri, 17 Apr 2026 11:55:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776426943; 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=5khgc9K8z9W6+pfQ7UMJj2PfJFQ9f7OsSxhWFGS2Zi4=; b=b9WmRfVICGamniIvCNHOgrOW37+x+6hZAOyThTOPMVFHIy5cgTqO+rEZ216oYokx/7vZBb ItvG6FiV023GNqJjB+QY4C0kn2vADSxORdLzOx2EJvQ+xN5GzaDDVac0VTq+1gDZM0O78s SHOaSAP09NuB2sRREtIVCiGJtVVBFkeZLnLTAzlkzq0FcyopI9vcLTKzJ+3Am/JoWKo0Pg J3g93BuP8rc9In3HkSAsB4z56u59WaAeP9ap9gb/xQhMKjvnzUVrsU04KLH200NiW6Qlmm M9AIZx2gBldCf59OHU2zOIMJi2ioi666V6Oj7x1kdenLJWwfjueTcsgzHA75Ng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776426943; a=rsa-sha256; cv=none; b=CW4WRMGtHJTtwdNl1/qwqW+wFQpLgoG3lITxHjcXgqxCd+hG4HMCDMV+QKxgbrSj/9ZDbd UazfFmoKZ9dHsoBH+4BBD7Uo5r+bn6UN4gvlM9KjkM8NdXTvRDiYHinL/0hoRovmCCZYa+ huyiSRSSVp50nN+990kJjCtMluEkv0aFSv2O1YXGkW/7+yPeCyAoszSJHOgbcydejKJ1cC bXvarlzI9iGtEMMNgA6lD9dNgxjF9ywvjO4Ey9oJwqq1ndSVkx0O611QKbaIPKVzxP5Zft /SFhs/RMv9RM/hYoT86z+QegD3mctaqp7MagmktKoDU6WMdpi7bK0iQ2EJftBQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776426943; 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=5khgc9K8z9W6+pfQ7UMJj2PfJFQ9f7OsSxhWFGS2Zi4=; b=QEt0IKfC9DLwDIjZZDRq5bQIpzDw3e07rL3IT2IX96jzXt/uUZnjjzdUOYe1LZQSHTTwuO Meoa9y09S91C2yIYybBZEQ7hoqHA90sdtAH8wIluwJ4mAqcC9+nmTynMSytLs62AjOUbF6 PbWTmQwGwtawPauhVT5KB1695aEbsZ5CC9u9yAt8TnY5iZuL7tieOFfuo68ldSuEomeCE+ /Rw7SzVCdTMSZhhqCWb8l+qYZIt4GkcFrhiC5YN/hCUBVNxaq3A4YL7zmwUTDDc6eGOLAw mxF1+waNsjqdUiYs3V3vDonBbIvnW1hYdcPrZkv7o89H2f9Mlescgqu5IUyuXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxtcb1MDLzsxV for ; Fri, 17 Apr 2026 11:55:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b1f5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 11:55:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 05ac1013984c - main - pf: fix error handling in pf_sourcelim_add() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 05ac1013984ced5b8b57430fe92a7074e34054ce Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 11:55:43 +0000 Message-Id: <69e21fbf.3b1f5.27471d54@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=05ac1013984ced5b8b57430fe92a7074e34054ce commit 05ac1013984ced5b8b57430fe92a7074e34054ce Author: Kristof Provost AuthorDate: 2026-04-16 13:49:26 +0000 Commit: Kristof Provost CommitDate: 2026-04-17 11:55:06 +0000 pf: fix error handling in pf_sourcelim_add() There are two issues in pf_sourcelim_add() error path: - stale pointers are left in pf_sourcelim_id_tree_inactive when duplicate source limiter instance is found in pf_sourcelim_nm_tree - overload table may leak when insertion of new source limiter instance fails. Both issues reported and patch submitted by: Renaud Allard OK sashan@ Obtained from: OpenBSD, sashan , 32063577ec Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index a2e12b3065d0..8b2ff108d9cb 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2239,7 +2239,7 @@ pf_sourcelim_add(const struct pfioc_sourcelim *ioc) if (RB_INSERT(pf_sourcelim_nm_tree, &V_pf_sourcelim_nm_tree_inactive, pfsrlim) != NULL) { - RB_INSERT(pf_sourcelim_nm_tree, &V_pf_sourcelim_nm_tree_inactive, + RB_REMOVE(pf_sourcelim_nm_tree, &V_pf_sourcelim_nm_tree_inactive, pfsrlim); error = EBUSY; goto unlock; @@ -2252,6 +2252,8 @@ pf_sourcelim_add(const struct pfioc_sourcelim *ioc) return (0); unlock: + if (pfsrlim->pfsrlim_overload.table != NULL) + pfr_detach_table(pfsrlim->pfsrlim_overload.table); PF_RULES_WUNLOCK(); free: From nobody Fri Apr 17 11:55:44 2026 X-Original-To: dev-commits-src-main@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 4fxtcc65Clz6ZdLX for ; Fri, 17 Apr 2026 11:55:44 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxtcc2dRhz470x for ; Fri, 17 Apr 2026 11:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776426944; 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=kGxTNkJxVXYcpc+fjVRmoMd+s5Z0jd/W0ig6fIdsBtY=; b=I8t1Y3MXplQRJHdx42Wajm8mQUtIJWHKjNtEP3O+n/4NzEI1ro9idJ+3ZGmXp8aRwszerr zHfQGkN9vuUvDoUCQaj/1CsuYMUHtgcP+9NfWFopF8LlVD6flsHlweKuBBOIJArHPxHPdF diUgy+Q4JHMLVjfOuowHK2BMuCUE6CA7aQHTitasWZX78sW771frQPi/eMPWl2fvzLSfOt xpvLJdL6nPsKWbIOeS9g9U56etrXROAP3gRzzPV/Sb2irNg+CJCr+OZtkITgvIdfrKHNew TekKrzpJ3vpBTThbh0RHNzb5zQUzf3Y0wwXqV/uOZ+GdBMw0lHn68sJMjWpwWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776426944; a=rsa-sha256; cv=none; b=UszP5uawhA0oGN9x/zOW8QfRkyCcVfw4UTTPSxEg/1KUFnH+0q3uEF/JPT1hah4yLYt2qA rPQ4tkItC7/x+0TGmWU+7jRcPXD4zpbs9jtbp7xErYikKNqkhtLY9zGo4wVvRi6UMjCpCQ RwHDFUoyzaGW4R0vq6ez7GiVVih5J8rzpKD83tqJrj7E3F/tvNnNhQM+HX755KIeW0EbdI cZKWwPn3EECFDr1Z4ouFe9K4D+sHmQGcH3u+RdG6SnrFtFEdLccAiwC3XAYTHv2A2GruJL bf8qXn/3Su2p3uGspbSy5dEUcZcw+nZmgk8z4DRCQpMkyFaSKOaCj5k5qFFvsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776426944; 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=kGxTNkJxVXYcpc+fjVRmoMd+s5Z0jd/W0ig6fIdsBtY=; b=fbfeT8kSRInFYApmE6e+oOH6Eu3v/bLsWMEsION5W5Xkk4Ngb6eI79h8CVGGnTS6HrqZGk 0ZhAPMnYfQW94sEtv0/klDyt/XvcVcjoIQTC37hyTbl9m/Nj+2RQ1Blu8Ab9i7Pvn6aaL1 GSL42JhAUx4iL8NCrvAtEXJ2yUo78QLjOCsb1Bn+ome3fr5E9DJ/kV4WmPvUh2TSSctkm/ Af6Z4D2oi1jv/8oSjmEkMqiXYli6FnDZvMQbFW28Ap5+Zb34DYt2sTS//YrpmArTgT6pMP KJQ6nR0EzfuFWbtFt9IROJlaUb6CI+N+Uj0E0KfPo31w/RKut4+E0Qz52Zdjxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxtcc2DkKzsmb for ; Fri, 17 Apr 2026 11:55:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3aad1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 11:55:44 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 5b7192230a15 - main - pf: pf_frag_compare() should not be using subtraction to compare fragment IDs List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 5b7192230a15bbf2378b8f74278d21d4766c5110 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 11:55:44 +0000 Message-Id: <69e21fc0.3aad1.1f6b19eb@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5b7192230a15bbf2378b8f74278d21d4766c5110 commit 5b7192230a15bbf2378b8f74278d21d4766c5110 Author: Kristof Provost AuthorDate: 2026-04-16 13:51:54 +0000 Commit: Kristof Provost CommitDate: 2026-04-17 11:55:06 +0000 pf: pf_frag_compare() should not be using subtraction to compare fragment IDs Issues reported and patch submitted by: Renaud Allard OK sashan@ Obtained from: OpenBSD, sashan , 747740863c Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_norm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c index 1362ce5387bb..348c1cafbd49 100644 --- a/sys/netpfil/pf/pf_norm.c +++ b/sys/netpfil/pf/pf_norm.c @@ -236,10 +236,10 @@ pf_frnode_compare(struct pf_frnode *a, struct pf_frnode *b) static __inline int pf_frag_compare(struct pf_fragment *a, struct pf_fragment *b) { - int diff; - - if ((diff = a->fr_id - b->fr_id) != 0) - return (diff); + if (a->fr_id > b->fr_id) + return (1); + if (a->fr_id < b->fr_id) + return (-1); return (0); } From nobody Fri Apr 17 11:55:45 2026 X-Original-To: dev-commits-src-main@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 4fxtcd6j47z6ZdY3 for ; Fri, 17 Apr 2026 11:55:45 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxtcd3wqrz47Rd for ; Fri, 17 Apr 2026 11:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776426945; 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=c4RSnCYUS8/NFwZK9HzVyv+zHg5zuggpsN/EvsfZbqA=; b=BQdCSg9Q13P8Xvab1VtZNbRwd5xrP0nXJ5YQ9uHzhcy+XG0c5nGtuNBLQQ5Z9AjCMSrJ/N r6kbZKiJeTVBGkPGVmy/rxFbU3SQORyFjCJMBvIOrCHecmxE7XfO5K2WqVDU4ThBRyfviP T1fxbOeG9mJOoMVDhEg1Q8GDCQraMDLQV1rMWiFsa0f6X3qrz7QbPR/gjtECXmcqegz2bB MUrPX8j3PVyGCwQvYPXjs97kIMJzYvK0f7OoP7selsr12a8EVFfgcVuVebb8p+jhGvr70s L0iojkhbwqJ+yxKhoTjOrTUU+AF6pOO9F/cKLZbVWwaGWzkFEklcAqffGN1IzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776426945; a=rsa-sha256; cv=none; b=pFUA4vWUAsJzbOt6oM8jiu+ELF8L+Z5cAg6tJSRi5xJcDF+5gAD6zMAIPHZLJ2SAXxU3KZ CukrGjKPxSKyD9ocwf7xmyESavdI0n2hdtAvS69KcpgbzBVeG6kKeRdDXPc+i6eL/+snCw LOfAheKDG/IkbjhHw4LKKd9QSsZ9XxeOeJauSS7Q9yLel99T8FQga03ni4ShkWAN0/Yzmi C7QUuZkqxF+BTP0LgyFRot1rCZKynuDQTM+w+rhU5naS31uGCePql/EpMZW0kDPgR+oaUB zuMTbVbZN2qlJtyrkgZ16O6QZjM85SOCuGxrH1v6fbaBwQCEZNr7fvCJTL1cQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776426945; 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=c4RSnCYUS8/NFwZK9HzVyv+zHg5zuggpsN/EvsfZbqA=; b=m1gveA6nkk63paynyItc9ZmTJfY8+9GDT9dNvfATtZd2Rnj/Yxrgw1MsYeF4MYNBkyYw4u cvM+4DX493oBVbYXAwjweRyz/l1OmRpsGy7oa5xQ63JKlTnLbw25++ABE8+u3xwYqnwRxT NOHU0+UA9kMgkz7LmOQb7RWHzMo+w96jHdRPdQ4JmFKii2By2FG20Jl2b1PYTjzR9ciCTR gLnDepMvqulcoUtsqYBQ3ENS14LYeKo0ips053OsDOY5IfTbMstDUjh1+9qttEX03fbt+2 ZRy7Ep2CPpC1l/ciOnv9iI5pFp5Ikjz50xYOHcrcEFTqhWNFx4pnaj+1h7ieXw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxtcd2mMczsv4 for ; Fri, 17 Apr 2026 11:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3a889 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 11:55:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 3c9cd6e4dc59 - main - pf: use correct address family in pfr_pool_get() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 3c9cd6e4dc59202f2b150a5456541629b633af3b Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 11:55:45 +0000 Message-Id: <69e21fc1.3a889.768d25ad@gitrepo.freebsd.org> The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3c9cd6e4dc59202f2b150a5456541629b633af3b commit 3c9cd6e4dc59202f2b150a5456541629b633af3b Author: Kristof Provost AuthorDate: 2026-04-16 13:53:15 +0000 Commit: Kristof Provost CommitDate: 2026-04-17 11:55:07 +0000 pf: use correct address family in pfr_pool_get() pfr_pool_get() in call to pfr_prepare_network()must use af instead of hardcoded AF_INET Issues reported and patch submitted by: Renaud Allard OK sashan@ Obtained from: OpenBSD, sashan , 8e156a5ebe Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netpfil/pf/pf_table.c b/sys/netpfil/pf/pf_table.c index 650334c45db3..e6290e622fea 100644 --- a/sys/netpfil/pf/pf_table.c +++ b/sys/netpfil/pf/pf_table.c @@ -2423,7 +2423,7 @@ _next_block: _next_entry: /* we need to increase the counter past the nested block */ - pfr_prepare_network(&umask, AF_INET, ke2->pfrke_net); + pfr_prepare_network(&umask, af, ke2->pfrke_net); pfr_sockaddr_to_pf_addr(&umask, &umask_addr); pf_poolmask(addr, addr, &umask_addr, &pfr_ffaddr, af); pf_addr_inc(addr, af); From nobody Fri Apr 17 12:20:04 2026 X-Original-To: dev-commits-src-main@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 4fxv8l51HWz6ZgHq; Fri, 17 Apr 2026 12:20:07 +0000 (UTC) (envelope-from markj@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxv8l2q91z4F9L; Fri, 17 Apr 2026 12:20:07 +0000 (UTC) (envelope-from markj@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776428407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2xb0equwvNir78cb+WVCvNvL/ezqHxghwCybR4RcwRA=; b=IhyYqmSBA3nzDFc4/ufT3R1Q40BGvASiIQOM+EJroXpnZ6rOxNxQlKkbgKYfEdesIKRdZv eYljPAUXhsAYvJgXBgXWondKut6eH/8br0sa7MZ3q+6Zy62msrZBkEbV8YmJolgjQReB8b kKqDzLq7NVS3d/N1ksb9YtLmMdhCKc+osy3VPz94PFhz+6EyQdZ9ju2wrsuA43FNwaNcGK OGAXG6/lG7Tup7071QgXrXhjXqo5+itAtwSV+vWn8a5a+wv0RKUajRyEkugyPEXcgh83Ys ACRcWmpH9kuUHI3GLH0J/RRfTXoo1dPYoALKFlLdlV6eXFDDi5AP33sZBynR8Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776428407; a=rsa-sha256; cv=none; b=whhFzFjvTKfnwecfn3XyEbkDpyGo37io180G5lpFQazA5j0VtKGjG6bDc6s+K+HbV0bm79 fUWb9p/ESScZBvvC4fsTkKTvDDDtAv6DZ9HhUn0jZXJiK8j4QKOH9ulWMtLYFDg4OCHB6L ckMbGXXP1PKdey7CcYc4drZaftt3Q1LePDq58oJNy48CEPmft70iHz06ug4qNCLM97BVnp 3bL64v8gnnKNl/QyNdTDoAMZMzEoWdMUlA6RTHwq+rDnAyaeHjZhLXZeFBtf3KqBUIAtiE Sy+ygUoqNh0uBuvoXCtq0BXGG4Wu69z9Rotd6yf55ILsw3eum/A8F7Lr4m1qVA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776428407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2xb0equwvNir78cb+WVCvNvL/ezqHxghwCybR4RcwRA=; b=byqI2eY63bjHsnAAnY9eV5kVRkIxkz0NoVQ6KYi3/2cAvHrZojWtWj8RZ6YL1KRbgKrXvx jvX1z6zN5Mu3VtLiO15NMIaBVjXxkPxRj57OBeHQJ1LIcEo7j+CyhQMslLPWZK96APVPEc TA7RBHIXv1XSdFH6uNMq5mgO8YyiuUpweHIJ5HEhcHMBIhFebwErAHUAsbOBN6HRvtZmrV eDxZUNpKtG/ObRyMoALMWn/IZqWd4/2xzqyRBxc9vk9vJaUTKensvAp6QiCYKJjNzanDEi B4uztVI8UD+Tyt28+gcymDQIuAqsLN5V2hNvV6OTUvYGilX63D8HpA4Q8J76ng== Received: from nuc (192-0-220-237.cpe.teksavvy.com [192.0.220.237]) (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) (Authenticated sender: markj) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fxv8k6tZqzqyB; Fri, 17 Apr 2026 12:20:06 +0000 (UTC) (envelope-from markj@freebsd.org) Date: Fri, 17 Apr 2026 08:20:04 -0400 From: Mark Johnston To: Roger Pau =?iso-8859-1?Q?Monn=E9?= Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, imp@freebsd.org Subject: Re: git: 1491fe8f864a - main - uart/pci: support 16550A PCI serial devices Message-ID: References: <69c640e1.1fc2b.4542bc24@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Fri, Apr 17, 2026 at 11:28:05AM +0200, Roger Pau Monn wrote: > On Thu, Apr 16, 2026 at 04:17:03PM -0400, Mark Johnston wrote: > > On Fri, Mar 27, 2026 at 08:33:37AM +0000, Roger Pau Monn wrote: > > > The branch main has been updated by royger: > > > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=1491fe8f864af5af37e83f1d12459905fb6097fd > > > > > > commit 1491fe8f864af5af37e83f1d12459905fb6097fd > > > Author: Roger Pau Monn > > > AuthorDate: 2026-03-26 10:01:57 +0000 > > > Commit: Roger Pau Monn > > > CommitDate: 2026-03-27 08:26:32 +0000 > > > > > > uart/pci: support 16550A PCI serial devices > > > > > > Expand the current check to also attach the ns8250 driver to devices > > > reporting as 16550A. This has been tested to work on a real device. > > > > > > From an inspection of the code in the ns8250 driver it seems like it should > > > support up to 16950A devices, but I don't have hardware to ensure that, > > > hence be conservative with the change. > > > > I have a system which hangs in uart_bus_probe() after this change. It > > has a 2-port UART PCI card installed: > > > > puc0@pci0:6:0:0: class=0x070002 rev=0x00 hdr=0x00 vendor=0x1415 device=0xc158 subvendor=0x1415 subdevice=0xc158 > > vendor = 'Oxford Semiconductor Ltd' > > device = 'OXPCIe952 Dual Native 950 UART' > > class = simple comms > > subclass = UART > > > > Normally puc(4) attaches to it and creates two child uart devices: > > > > puc0 > > Interrupt request lines: > > 0x11 > > pcib7 memory window: > > 0x84000000-0x841fffff > > 0x84200000-0x843fffff > > 0x84400000-0x84403fff > > uart2 > > puc0 I/O memory mapping: > > 0x84401000-0x844011ff > > puc0 port numbers: > > 0x1 > > uart3 > > puc0 I/O memory mapping: > > 0x84401200-0x844013ff > > puc0 port numbers: > > 0x2 > > > > After this change, though, uart(4) tries to probe the device directly > > and hangs. Presumably we still want to exclude at least multi-port > > devices here? > > Hm, I see, sorry, I didn't think changing the UART version > compatibility would cause this. What about using BUS_PROBE_SPECIFIC > vs BUS_PROBE_GENERIC? > > If the PCI device matches a device in the pci_ns8250_ids array we > return SPECIFIC, otherwise if it's a generic PCI serial device we > return GENERIC, thus allowing the puc driver to take over it. > > Could you please give a try to the patch below. This patch allowed my system to boot, thank you. From nobody Fri Apr 17 12:43:06 2026 X-Original-To: dev-commits-src-main@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 4fxvgJ2567z6ZjDV for ; Fri, 17 Apr 2026 12:43:08 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxvgH0wKBz4Jsr for ; Fri, 17 Apr 2026 12:43:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776429787; 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=LRoAa52Tj6zHYm+XC6x0h9AzpYbYT8ALaXPyCyA3Q8Y=; b=AxEW44brbomoDEntgY3CFDPiPbVwh/NkfJWo+oX9SGvEGeeYPPAwv97dMu/ea3MgsNu+hT V52Rz9VgLcGX61YkjJfVoYg27f5P0meur1kw4d730ZkZhxP6SCWpXH/WI7oNWSogYzRPLh +gRGB025HWR16FcuZYF8Zyx8eRmdQYumsR6s7u2KIZKfvB3KpjPczTR7VD8/PGNjVw+wI7 CzFRL+u1Ib6ooX8+7OBOUmSN+A7ZExUSebXb6MB9RX55kTLsuiDdAKlx1AT9Jq+9rrpBNN U5Rm4l5ZKJe+Z7MFGfDa0rtL0bPEzKlOoQ4TNnnexLJszKSR45aMQZKxgjwBHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776429787; a=rsa-sha256; cv=none; b=UBFc9g7Srj0p6laTAurOks7Sb/qJoFq4EaLT/o9dahiO/MIW49Xie79xPS2TLgefcJ8mgE Q+4ZZELxr8FAbWR3iHd5ppPrTpXcWX52hnpvi38iORYz7wQeOp3OMauNZI/g9Ddw30St2B Be0qyBpMMnYasZQjW0AcAwIpzVwCU766CfOSPTNT05+fzcuWQhxYlQ/D9uAJmRqAT5AOZr UwWTwtodUR558JGF2It4dNAm7pzzSCT2Q65f+lxoIRUXIJHducfHj/I+4xab7mMgWkUP7H cUGox3XcvYWhofNvTep5SNMjXP2Jq5G6UTuSxj/YlQgc6zC+jmq3oPklfjH83A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776429787; 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=LRoAa52Tj6zHYm+XC6x0h9AzpYbYT8ALaXPyCyA3Q8Y=; b=Qy5R0Qc9QJ3KBC1X13PEyVXUGJPYPiJNpSRDNIiq8lVYPlCcSxd1A51bSyeU59Wscn7ear J0nQmkZ6VzBvUEHz50eZkDfIieDK2fTdhKYqDjn6E4wIds8cBWqdzMqoeCmhkqi7wK3XBJ 9fr95y+Epj9CY8F/OvEBPyEUB7Lxpt8pp1yyiXtKmi4nuiSyNaq2telGUQnKaDHVFGiiuF UACOmxBMZ4qXUNSaglB1naNe1OLbyRjHpA1Vnx90R2ZWEiVx1mqJy5WhxDSNnPHxsultsa gmvDsHXojj5yBusuO91KBykCFt0BooAcUkrkEg1RWWeb4M0cDbHhmz37/n3vlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxvgH0X8sztwD for ; Fri, 17 Apr 2026 12:43:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f835 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 12:43:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c1b514c88c76 - main - in_mcast: Avoid calling sysctl_wire_old_buffer() in an epoch section List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1b514c88c76a4de906775d47b06388e62ab6845 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 12:43:06 +0000 Message-Id: <69e22ada.3f835.544104e5@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c1b514c88c76a4de906775d47b06388e62ab6845 commit c1b514c88c76a4de906775d47b06388e62ab6845 Author: Mark Johnston AuthorDate: 2026-04-17 12:42:54 +0000 Commit: Mark Johnston CommitDate: 2026-04-17 12:42:54 +0000 in_mcast: Avoid calling sysctl_wire_old_buffer() in an epoch section Wiring a virtual address range may require the thread to sleep, and this is not permitted in an epoch section. MFC after: 1 week --- sys/netinet/in_mcast.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/netinet/in_mcast.c b/sys/netinet/in_mcast.c index 9e93992f81e0..1e7985ac01d7 100644 --- a/sys/netinet/in_mcast.c +++ b/sys/netinet/in_mcast.c @@ -2853,6 +2853,11 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_ARGS) return (EINVAL); } + retval = sysctl_wire_old_buffer(req, + sizeof(uint32_t) + (in_mcast_maxgrpsrc * sizeof(struct in_addr))); + if (retval) + return (retval); + ifindex = name[0]; NET_EPOCH_ENTER(et); ifp = ifnet_byindex(ifindex); @@ -2863,13 +2868,6 @@ sysctl_ip_mcast_filters(SYSCTL_HANDLER_ARGS) return (ENOENT); } - retval = sysctl_wire_old_buffer(req, - sizeof(uint32_t) + (in_mcast_maxgrpsrc * sizeof(struct in_addr))); - if (retval) { - NET_EPOCH_EXIT(et); - return (retval); - } - IN_MULTI_LIST_LOCK(); CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { From nobody Fri Apr 17 12:48:51 2026 X-Original-To: dev-commits-src-main@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 4fxvnv5lm7z6Zjdq for ; Fri, 17 Apr 2026 12:48:51 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxvnv44xqz4LDZ for ; Fri, 17 Apr 2026 12:48:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776430131; 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=jryR7FyPzFgLW4zofWn34vbzKG/9FflKizPIsXgJdKw=; b=MaLH/TKjbG3EZxkOvo5pVdxtauy56O6tp1OcYKdnNE9fdIqJ4d5M9MSNVJo0cvTSblUUF/ tbDBf0W1eq5qgOKHzEl5qgr0il7ZsWOX2ZCSP18oObSrF+UWnrPr8IT2XYcEoCb7057yEm Fhh6oR2JoQrK3l8w5rpbOveBF8n7toUa1dfvlOcQUs51bbmcxokB5G0UgpcHp7QAotcbjk 5HNsHa1WL93TjxOhV6/e1OgqphZGjUUUFwV5Lw0d5vUehZwiraOcLgkLwepPeHC0s0INE7 b7BV+s6UCiILlPa9V5M4OgOeO4EMQZ50/00+WTnzFPk5HnZhze+1hI+bHWgzeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776430131; a=rsa-sha256; cv=none; b=dRwElagNu0ci0ti2xRvl0xCn72h2NZpwryumGdCDhQmFvDBWHP7srA7RBt+DaMlQH+B+7x 1hm1jthD12SSG4jzp2N+tboECI4AKd4mzwQVQuiJn4QGpikdb4rmh8tzwVO7suyjlW6qEu aya85QAQBAqqNmEqpWzzNoSvz+A6qbXNB9ou0vgajjYi6aTNu8QnxK0K9ur3g53dOXxAYU 0pmuJU5OGD2R2BA2laXiEquGSj0lgxYB0jsAXJNmQhbKrOMTZQiXJgN0Qs6EUwCym5ssSU KFmFlAiSUvvRpoO/+gTiTKBb3AMfkyBP8rvonpKCin2loK3ol+DZMDexvgpjMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776430131; 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=jryR7FyPzFgLW4zofWn34vbzKG/9FflKizPIsXgJdKw=; b=DtOx7pf9fdI92IxC8KLAa661qIOGNohqUVwa5+7yHm+eOnMXBemI8GOWUztBVnpE1jw9f4 G8kIFxMWQruO/EDbESlSpNmHbMjHLu6orjgoRjH3wsBSklKgQDHu7TKzj1vnk1pE0FziGG +yZnYQ0BpvDVTES3ooV2FXzsACbz65PtNK0Xg3NxugMm1+uJY3w+U99IOUqLMx3gqZ1mOy wlWNawBgVN1U2b39qmgmMWuB8Hg+wwtfy3pg6XZhTHNz7Fq+oN4S83MZ0lcFSPj+RCwgUr Iu7cqw+NTxqvCftsVVYuSow1jQ8e9cpweIh3l9uqtjfcnrOY00IBfXDlOQNqmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxvnv3bCzztd1 for ; Fri, 17 Apr 2026 12:48:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f5e7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 12:48:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 9f6041fb5791 - main - tests/socket_afinet: Remove a conditional skip List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f6041fb579106aa6fa358071a14eddabd581998 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 12:48:51 +0000 Message-Id: <69e22c33.3f5e7.50134c60@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9f6041fb579106aa6fa358071a14eddabd581998 commit 9f6041fb579106aa6fa358071a14eddabd581998 Author: Mark Johnston AuthorDate: 2026-04-17 12:48:39 +0000 Commit: Mark Johnston CommitDate: 2026-04-17 12:48:39 +0000 tests/socket_afinet: Remove a conditional skip The test runs without any unexpected results when mac_portacl is loaded. PR: 238781 MFC after: 1 week --- tests/sys/netinet/socket_afinet.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/sys/netinet/socket_afinet.c b/tests/sys/netinet/socket_afinet.c index e90fed961b73..cfa2c9aa1706 100644 --- a/tests/sys/netinet/socket_afinet.c +++ b/tests/sys/netinet/socket_afinet.c @@ -57,9 +57,6 @@ ATF_TC_BODY(socket_afinet_bind_zero, tc) int sd, rc; struct sockaddr_in sin; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("doesn't work when mac_portacl(4) loaded (https://bugs.freebsd.org/238781)"); - sd = socket(PF_INET, SOCK_DGRAM, 0); ATF_CHECK(sd >= 0); From nobody Fri Apr 17 13:16:58 2026 X-Original-To: dev-commits-src-main@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 4fxwQN0sNYz6ZlPb; Fri, 17 Apr 2026 13:17:00 +0000 (UTC) (envelope-from siva@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxwQN0JKPz4Pjf; Fri, 17 Apr 2026 13:17:00 +0000 (UTC) (envelope-from siva@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776431820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vx5icxN7xWXaOvvaCqGYfDu7Bhnev92rtK5A2UU31Sc=; b=RAtVpdCFpO10z8coojSVbnHMORNH9duhSDT2Iij5VSsv4PR6N0em9JaTN930tuj9pJLszx 9T1UW5LVEEYbiBIbigZ7Y7/qzjWAxiS9E8O56PNGmK+lyUWapbxP8SBGj3ENyJDSsZbMri MyQTuJd/TbgHR0hFBCp7+1sU7m/d40L+Wi77iyAa2Xs2uFXWXcm3ehEWMg2OG9YMY1QZOL FK8nMkpLJfwTLJNODSyRS025jD7VE38xy277Q7+4t+bTUNjy3e0fFHXPk6ww3xBTgxkoOa J0Mjq8nYuf9CsvyCU84F6tUyVZTJZGOE9pFPsT7hdcSiu3CyO5yXUoTJ9vV0mQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776431820; a=rsa-sha256; cv=none; b=fH6fe/UX71CeJTiQ+HvHANUGROxn/Kboqn2G4xM2l0ahBPw7GuIt7eBbaPBG4HV2tAPyrr 0JpDt7iAwVhuKw9c2YzNvy9UwoNtKZ0En2XtwxWxJUpwZ+k1rFhZ3fwrPqr2zW6l9WhK50 PCRtZPqES9uRZVwEHTI+JbExhviW1dzC6z8jQZj+gF6xsfbmg/v6gU1+wQhkg9T0boaz7p Yc9yG2rdU5EZIXhsBHtsrrjba7XxRrLtN8PGcL7z6iBwPu3N7yeRdBApCyj08E6fPHXm6s DPnUi4jGvgqoP7QVPSjgbiMUcCXQ3Uh/0dyYlO57ulzOAikrjueKeiRA/qj3dA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776431820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Vx5icxN7xWXaOvvaCqGYfDu7Bhnev92rtK5A2UU31Sc=; b=h8JrdwSRv0VnEWhWNUR+CTo03voYPtnCKsvnJutAOSwjJ7vaURKOPQyHeB/WA3DtqjOmkE TJD7SO7iRvHR4tPx4ohs0s2Iz9gfXqDG07d88E9iNUkqH2BwqNDzAAuZikLOUE4OtqwInr XKt2iq3USTnaUJnJjN+W37yOWpGgoUKAmPasxh3bu+n4KkNE4hHJSMADoOh3pS+L6FwNEU WQF88W8/VgC2jRS/e6GKS2NgigTJO8ZnmZ7wH+nn+BwHKk/115ezisuDeE8vURZK+opdQu IMgSCdy1qotvAAWB3Kj1Z7WoRk4K6MR4kgqL8m6KBTvNel2ra4zcdCHt5xyDow== Received: from localhost (bras-base-ktnron0692w-grc-18-184-146-154-60.dsl.bell.ca [184.146.154.60]) (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) (Authenticated sender: siva/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fxwQM5dWJzskN; Fri, 17 Apr 2026 13:16:59 +0000 (UTC) (envelope-from siva@FreeBSD.org) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 17 Apr 2026 09:16:58 -0400 Message-Id: Subject: Re: git: 9b76228006d8 - main - inpcb: retire inp_vnet From: "Siva Mahadevan" Cc: "Gleb Smirnoff" , , , , To: "Adrian Chadd" , "Mark Johnston" X-Mailer: aerc 0.21.0 References: <69de65eb.21a5c.61244c2a@gitrepo.freebsd.org> In-Reply-To: On Fri Apr 17, 2026 at 46:00 UTC, Adrian Chadd wrote: > On Thu, 16 Apr 2026 at 14:05, Mark Johnston wrote: >> >> >> >> It's possible to have inp->inp_socket =3D=3D NULL here. This is trigger= ed >> by the sys/netinet/tcp_hpts_test.py tests. >> >> > /* Lets do any logging that we might want to */ >> > tcp_hpts_log(hpts, tp, &tv, slots_to_run, i, fro= m_callout); >> > > > Do you think it's worth reverting? it's been a couple days and I just > got emailed about that > test failing after I landed some unrelated stuff! > I think it's worth reverting. This is preventing other tests from completing: https://ci.freebsd.org/tinderbox/ (the archs that do complete don't have python installed, and thus skip this test). From nobody Fri Apr 17 13:56:07 2026 X-Original-To: dev-commits-src-main@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 4fxxHW55q0z6ZpXk for ; Fri, 17 Apr 2026 13:56:07 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxxHW3HwXz3FHf for ; Fri, 17 Apr 2026 13:56:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776434167; 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=QT+Da3JmeurM6UkMJ18vBcgidTrLDXyJb662/A75B8U=; b=jc85OCG1O6fBiGXpBnto3oNGwZIKQnZqHoFhWO6jht+zaPsDu5/tLYYTiACLxubd1TCmbE fFlzzWDpEw4xtIfhcDSmC1Pit5GUJIvQuxL+f8sHUJ+Ccaht6Mwo1IeLmg/LGCVSmXVz5A 1dESNMpMu5pHUKYEC1mmaZWkU47GjrEb73cDGX/s3j8GFpsPOuHMHqs5WoxCtO8qiaUnXJ tTScIGSdLhHhfJ20fvM6H5FzuXPzT9AqhX/Pu3T8RXo/H1uMfNlwkTH1U3CLXCbCfBvZAE tZJ6nRn2ljxMKDzdNuTRo8zC032+W3cseNk3wGayPH3uzZssRcVlZ+nmsBHuSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776434167; a=rsa-sha256; cv=none; b=axCxf5NI4WZ3j3vcnQy2nsHJAJH5XhexazPOfV8IAcaKohTO+NtlAYZvnBDWVQtYjowc9G rAFiTEtgyNOB5SEO/OD7Ji2UNGklOEiTi84elBcio2GJ1vT/ioV+JSWc6yMxe9JXBGnDIn nwPFl359OApFEH1HBa4fbKC3TmTRYT3PkAc+Y39nM4kglfUFNyQk/6vtATk8oUpSEMh8dk 8tuzU0RZ0DPiGRuaTbHy3zDK9JbFzfx4AG+tpACIY4/Dh+Tb2ztnJsBW13SAt38jvcaMaN i6yxC8QzpW2a+WnWvjWKKfKhB2JRCmE7yWYFeEnXuJxRhlHh9uZguQrK/blszg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776434167; 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=QT+Da3JmeurM6UkMJ18vBcgidTrLDXyJb662/A75B8U=; b=QCfOKxKZQ0MvmvLR8PuduBosXibWD/hQIP9tJ8QYkfE40D5oaZFLXReWUZ18RH2cGlU312 rYTyTlUcUjo4xlQiUca4xmQQPJSFh6ZeEdwZDiUyNdR24pjz/je12SA/y0XRhuq1nFD7M4 XOXy9itmnZIHR4Ul11/Znu3WNPa/jgxDmifCcZ7t9p1uAu+qIymeXOX8EcTbXGPWKN5yI4 pse6b1koHOKkzE8UHswad5sgGIZ1kVb7DqoCX3macCAfcYL5EDoI6WyRibwlnffOcHufhj zeFO7GVp+ijfU0oue1itBqxvvTWYZWndXO+WgKYFPe9bdaPjQpMzjFko/Dx4GA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxxHW2brpzwTl for ; Fri, 17 Apr 2026 13:56:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45154 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 13:56:07 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jose Luis Duran Subject: git: 8e08080ee581 - main - rc.conf: Fix typo in comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e08080ee581dfd30c128d032035da7b6ae44463 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 13:56:07 +0000 Message-Id: <69e23bf7.45154.6adbec06@gitrepo.freebsd.org> The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=8e08080ee581dfd30c128d032035da7b6ae44463 commit 8e08080ee581dfd30c128d032035da7b6ae44463 Author: Jose Luis Duran AuthorDate: 2026-04-17 13:55:16 +0000 Commit: Jose Luis Duran CommitDate: 2026-04-17 13:55:16 +0000 rc.conf: Fix typo in comment The correct path is /etc/defaults/rc.conf (defaults in plural). Reviewed by: netchild Fixes: cc4eb1ea1040 ("Add support for a /etc/defaults/vendor.conf override file") MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D56456 --- libexec/rc/rc.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index c4cc6dea02a2..75420e42cdeb 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -791,7 +791,7 @@ if [ -z "${source_rc_confs_defined}" ]; then } fi -# Allow vendors to override FreeBSD defaults in /etc/default/rc.conf +# Allow vendors to override FreeBSD defaults in /etc/defaults/rc.conf # without the need to carefully manage /etc/rc.conf. if [ -r /etc/defaults/vendor.conf ]; then . /etc/defaults/vendor.conf From nobody Fri Apr 17 14:22:11 2026 X-Original-To: dev-commits-src-main@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 4fxxsb6f4Jz6ZsNm for ; Fri, 17 Apr 2026 14:22:11 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxxsb3tqpz3K1P for ; Fri, 17 Apr 2026 14:22:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776435731; 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=MfpC7v1SPvmNT4oZqq9cDE9MXJQGmUouTSLGa+R+UWw=; b=L0vp6liDffJLJCaEu48RS3sGShafWns1ThCtIrd/ZbCU5+hs6W/2CpPdb2mGVwQ+f31Emc sDSCfqlMPsB4vr/PGNi1RLF/XqhF67ucvS/nCudSjK1ZWOQeGG1azk53Dam/ktqhLJtMaM MuSSrZ2eBJlrqmSZvFITKl0/RuSTfRp0AibWaC0oI61dyT5WgOLA4VOOsjvZGxnWA0WmSB MpCUFjfXMLOkAmRuw2CYXDhzRB9k6jAW7djTzGzvVXMrQTBzyQTBPIkWOuuQ7quleyilvI T79uRIPiLtuvEGNSN/8UVslTnqBpQPzgCCLA8g7qT9JKm6smijH9T4dv8gnAIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776435731; a=rsa-sha256; cv=none; b=UvHPmAfHtaJWPzXPMthx9xEOwJ43itBral8au/FebTolvlT3PTNjK6jeUrmPM9XGdaPjUq ZxjBxd6iihtUiXIe47+64lyS7ThyT6Fr2fxmtP35lCGS5BVujexDfndJpwvN/VHHHtdFB6 /hFduu4S01sfNYCl3s4jw2P/PQtrU/H8pMK8zXAmg1QYMZkyzRfrBqUfrPTXI75t3xp0us YxW73AZbf2zMCD6lGnEdrc9ghvAC2JBKZOImHVoxKUJFzPHwZgZufVS9A/N2kMN+0ImuvR VRXzMwkfBpYHYyPTSHA85oNtJgnhz9V2nts8GLJK2kJuU4GmTGuS//x31jGNXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776435731; 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=MfpC7v1SPvmNT4oZqq9cDE9MXJQGmUouTSLGa+R+UWw=; b=ToHSKU/+Zu1CySmMShkypbbKo4CeHY+udK+NIGrBKR0WoIZwloZ17JQ86fl8vM92yuQJTK cUItIs1avu/mp3s7f/FVIAQtDIyN1syG3zX55y6bED8vMCcFdYVp/cqprZxl5xbxCzeI0+ zb4CwmDvPnKUoTHZR/4TePYRAvXDscfWEiHL9QxNaKLOdANf0rx9wqxIZ6upKv/uBIt4m7 t5D1wZCMkRhS9QBhIEzc6k/uaGlAx0DjotwcqOo7ApAongqfdajZDaYz1tMPWmrJTGtvc8 Ne1iNe9+tl2TKuX+knVlKTbDeUsfB0kZ8hrJx3Ehf8xuq/A20KovikbgoKBI/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxxsb3VTszxTR for ; Fri, 17 Apr 2026 14:22:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47fd5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 14:22:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: ab1d659e78e4 - main - loader.efi: Defer efi_translate(e_entry) until after bi_load List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ab1d659e78e454995b7c2b4566e035269b215e48 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 14:22:11 +0000 Message-Id: <69e24213.47fd5.5e13e45e@gitrepo.freebsd.org> The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=ab1d659e78e454995b7c2b4566e035269b215e48 commit ab1d659e78e454995b7c2b4566e035269b215e48 Author: Jessica Clarke AuthorDate: 2026-04-17 14:20:12 +0000 Commit: Jessica Clarke CommitDate: 2026-04-17 14:20:12 +0000 loader.efi: Defer efi_translate(e_entry) until after bi_load bi_load itself loads various things into the staging area which can cause it to grow, which may result in the staging area moving, including the kernel. Therefore the address we get for the kernel entry point prior to bi_load may not be correct afterwards when we actually call it, and so we must defer the translation. On arm and riscv (but not arm64, which predates both of them in loader.efi and did not gain a copy of arm's added printf when arm support was added) we also printf this entry point to the console, which we can no longer do since bi_load calls ExitBootServices, so remove this printf that, in practice, seems to not be so useful, given nobody ever felt the need to add it to arm64. If anyone really feels this is an important printf to have then bi_load will need to be split so we can call printf after all the loading and potential reallocation of the staging area, but before ExitBootServices is called. We may also want to make this code more uniform and shared between the three architectures here, since there isn't much architecture-specific about this (and something like the RISC-V boot hart protocol could easily be made an MD hook). Reviewed by: imp Fixes: 0cafabf97fae ("Add support for arm64 to loader.efi and boot1.efi") Fixes: ea7796a9ae6b ("EFI: don't call printf after ExitBootServices, since it uses Boot Services") Fixes: 2192efc03bc4 ("RISC-V boot1.efi and loader.efi support") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56431 --- stand/efi/loader/arch/arm/exec.c | 5 ++--- stand/efi/loader/arch/arm64/exec.c | 3 ++- stand/efi/loader/arch/riscv/exec.c | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/stand/efi/loader/arch/arm/exec.c b/stand/efi/loader/arch/arm/exec.c index 50e94af05fd2..a33855397a5a 100644 --- a/stand/efi/loader/arch/arm/exec.c +++ b/stand/efi/loader/arch/arm/exec.c @@ -69,9 +69,6 @@ __elfN(arm_exec)(struct preloaded_file *fp) efi_time_fini(); - entry = efi_translate(e->e_entry); - - printf("Kernel entry at %p...\n", entry); printf("Kernel args: %s\n", fp->f_args); /* @@ -85,6 +82,8 @@ __elfN(arm_exec)(struct preloaded_file *fp) return (error); } + entry = efi_translate(e->e_entry); + (*entry)((void *)modulep); panic("exec returned"); } diff --git a/stand/efi/loader/arch/arm64/exec.c b/stand/efi/loader/arch/arm64/exec.c index 6b5181b54507..406be822a28c 100644 --- a/stand/efi/loader/arch/arm64/exec.c +++ b/stand/efi/loader/arch/arm64/exec.c @@ -67,7 +67,6 @@ elf64_exec(struct preloaded_file *fp) return(EFTYPE); ehdr = (Elf_Ehdr *)&(md->md_data); - entry = efi_translate(ehdr->e_entry); /* * we have to cleanup here because net_cleanup() doesn't work after @@ -82,6 +81,8 @@ elf64_exec(struct preloaded_file *fp) return (err); } + entry = efi_translate(ehdr->e_entry); + /* Clean D-cache under kernel area and invalidate whole I-cache */ clean_addr = (vm_offset_t)efi_translate(fp->f_addr); clean_size = (vm_offset_t)efi_translate(kernendp) - clean_addr; diff --git a/stand/efi/loader/arch/riscv/exec.c b/stand/efi/loader/arch/riscv/exec.c index 64e522775471..900e8ca8ff62 100644 --- a/stand/efi/loader/arch/riscv/exec.c +++ b/stand/efi/loader/arch/riscv/exec.c @@ -85,9 +85,6 @@ __elfN(exec)(struct preloaded_file *fp) efi_time_fini(); - entry = efi_translate(e->e_entry); - - printf("Kernel entry at %p...\n", entry); printf("Kernel args: %s\n", fp->f_args); /* @@ -101,6 +98,8 @@ __elfN(exec)(struct preloaded_file *fp) return (error); } + entry = efi_translate(e->e_entry); + (*entry)((void *)modulep); panic("exec returned"); } From nobody Fri Apr 17 14:59:55 2026 X-Original-To: dev-commits-src-main@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 4fxyj73cpxz66y82 for ; Fri, 17 Apr 2026 14:59:55 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxyj72ht7z3NT6 for ; Fri, 17 Apr 2026 14:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776437995; 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=RBrFrR6ltJGnDu/TG4rzc/zP+h0IWZ5W4kSxz61b8mc=; b=t/h0QwJ0bYDLxo8BD5XpvMgUj+VOw+3oEBgKsCsrgSNnQ55O0euvQBTmMg3eSm2XJvHjNE YS9c+Tqkvsa6p4hKTwFAVLx9w3GpNct1e45XkE3Jd0myrRj6shNmmjNM23CWbkbgkTgZ+g IL7Z/cjvaT0nAPFmo64u/+bVgF/6ZMM0HPkA1gv7hixSK+NcMqluJ4ca+7wdNiharSPToU LmXdZk0SX5T4mNpXJpFYB0SMWXkad8fEv+GPdtW9wVuZpPg7nym3wyc1MF3Bo8a54H0pKF 07ZSjcnH8o5ziwFgcKTI0dQeKXp08C3AqzFZrvgO26saBeG1qv3ntmNpj2WZDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776437995; a=rsa-sha256; cv=none; b=nJaqm6HenwDinpO9xKV95RdqplL1o6D7g5LvA1OmIHMJVCXQZMfs0wRFQAKSL+Akix2Y8y JM7dOYSgHXofF3ZgkqFyWJrtL9zlK3csnHBAgJuF/GY1urBw85RUaw1p5J7DVH0FQ5v1Wb bR+9snTFcBGud8T6qSkLPBMj/OGwiU0fnu/ltD7k1t5ayBCAflfu7OlZyIXUhga1KNzHoj OL8Ba/jUSlYFVgvqyMeOhuM21UNV/6imGa+kge7+O9XsvqLBLOG2CT9yI5Mt4ihgfggPKb oygqpo43QfOJ98L0ctSkHaq3SIUcvYQyQVadk+9EsVe9eZ7DjfyLbXMQE1H4cA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776437995; 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=RBrFrR6ltJGnDu/TG4rzc/zP+h0IWZ5W4kSxz61b8mc=; b=dMEJVTj4sV33LMa7IkkJhAH2RuF7Q7sLiI17AxX0tAQSF607AuDBWWwfDeHd3RexlPvc4A c6irCbZJRoTzxD0As556sccrvFWxJDbSo+mJK/av6LU7k36bEY1/8mz+SJt2NnbGfOqiLt gwjuou6UQuPMPXU0WI5y1ufQ0YZCL8ozip6xUNWxMReQofcFbO3bDDmQXBsrOn/JBTtBy2 FOsFH1rDzQauD20W9KVebDKnRIU7qukGhkgNPy3LjeMM86HgpM569YPrKxMLcf1zmJjP+7 EefmkCPugdTf3geKkCEF6Wl/5Qs7rAc8JW8aNvofxTPYjbKczWewahGBu5lV8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxyj71zFPzy2L for ; Fri, 17 Apr 2026 14:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d09b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 14:59:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: a154d72775cb - main - sctp(4): Fix a typo in a source code comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a154d72775cbf3f0679fb2f989b3d1a035ae41c9 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 14:59:55 +0000 Message-Id: <69e24aeb.1d09b.414e51fb@gitrepo.freebsd.org> The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=a154d72775cbf3f0679fb2f989b3d1a035ae41c9 commit a154d72775cbf3f0679fb2f989b3d1a035ae41c9 Author: Gordon Bergling AuthorDate: 2026-04-17 14:59:26 +0000 Commit: Gordon Bergling CommitDate: 2026-04-17 14:59:26 +0000 sctp(4): Fix a typo in a source code comment - s/initited/initiated/ Obtained from: NetBSD MFC after: 3 days --- sys/netinet/sctp_structs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctp_structs.h b/sys/netinet/sctp_structs.h index 53d9bfd4f445..177b54656ae9 100644 --- a/sys/netinet/sctp_structs.h +++ b/sys/netinet/sctp_structs.h @@ -898,7 +898,7 @@ struct sctp_association { uint32_t str_reset_seq_in; /* various verification tag information */ - uint32_t my_vtag; /* The tag to be used. if assoc is re-initited + uint32_t my_vtag; /* The tag to be used. if assoc is re-initiated * by remote end, and I have unlocked this * will be regenerated to a new random value. */ uint32_t peer_vtag; /* The peers last tag */ From nobody Fri Apr 17 15:21:46 2026 X-Original-To: dev-commits-src-main@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 4fxzBM1GMWz671c7 for ; Fri, 17 Apr 2026 15:21: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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxzBM0M8Lz3QxK for ; Fri, 17 Apr 2026 15:21:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776439307; 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=aZHFsCNhco72vVAvZF5lIoaxYCfG+wh2BNUoRfVzCds=; b=sT4yxtzpk+/vCTjW9SAy6ioAm5PxsodjmWut4jQUdoJO/VoESRUpJYhChC+BkfCnabWkRZ uVj9RFu1IJ8qNnWAQ+M2RAGOzpnmNfRy8Hp9NfJ8ULELGJMEXWnhE6OFrGvt+zZ3/2eX9k VnbUxdbrKZLJwawRbv19w638C41c97xLO+G4QrpSSsxhRJ+2oNb27zjaP/O442whbPgZGt C7wijjcyWg1ZDNhAWMOukFogYQK8N2PBb5YpKb11r8lo11bSoQ//KPr6b1x3m8FheaELMo A8+cNEzbKqN5ScUsKJGuPK/WDQMZY2BVaUGU7hT6Onyx8I44uLwkI8zGSIF7VA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776439307; a=rsa-sha256; cv=none; b=Je0z/mgQoYYwJiB15UFudhJ++zYsdbthwEKuoqhHLdnkEyyWMQu35mmlpKxSIgHZb+XRDU oSR4MNZ9AR/a2OWtblh5eEaVuuTwJnvC8mpZS+GeWaO+IRfaoKoLZQBpMIMEL+eMrVN9Yt v4hSakav85x9le904vXFZkDCL/tV0bPKbcuzAtYD5yDFeaGvUd/2jfPJ5VccKGCTAp1XAL zgXIPMrb/Bbv/pIX2md63VjAau4TwYCSa17EfxvDnZuK5KToVCHotBWzZqUOywASwbdByQ CDGOTqeH9S2zphNE7UWFiyxpREhjgT8ArtxFKtljADLcvI35CgjgIqGy0PJ+eQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776439307; 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=aZHFsCNhco72vVAvZF5lIoaxYCfG+wh2BNUoRfVzCds=; b=VJxBciR6/uQCoKUqCTIm4XXfWNt2JqBhZz9n6qQ7LIbwM159n38OR2xS+Ta38D83utXkDW zS11Uyy9e7zGYlMd3/kKUKTUBll9Lcu2fX0cMPravPM/4vTxnDx86NE0G8JNedKwMduD0F V8+IaBGl+DA2Ez5CA58rB6JuZHq9/AGfvmeL08qbGtP0o/kyutc6mhp5XMCR/llvdO0g2y XCVkwlHcn/S7LJo3R4GKUtuBpY7vQWYgKyf/NqfBQnncyVcwK5XfJsMrGPP29s2+XdKPZV +MJ3Gzg1TQl20vGdbVHFkuLDt3Qr8m+1e2X7l7swRpq/Z6Xz4wV9m8K/bdiMxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxzBL6ynmz102f for ; Fri, 17 Apr 2026 15:21:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 202a2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 15:21:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: b2aea7a042b6 - main - e6000sw.4: Mention MV88E6171 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2aea7a042b6b6e6f1f4922e7e32b6d350a81327 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 15:21:46 +0000 Message-Id: <69e2500a.202a2.3570015e@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=b2aea7a042b6b6e6f1f4922e7e32b6d350a81327 commit b2aea7a042b6b6e6f1f4922e7e32b6d350a81327 Author: Alexander Ziaee AuthorDate: 2026-04-17 15:21:05 +0000 Commit: Alexander Ziaee CommitDate: 2026-04-17 15:21:13 +0000 e6000sw.4: Mention MV88E6171 Fixes: 680e6e30c020 (etherswitch: Add minimal support for mv88e6170) Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D56455 --- share/man/man4/e6000sw.4 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/man/man4/e6000sw.4 b/share/man/man4/e6000sw.4 index 92a3b5c8ed0b..be80888dc3b9 100644 --- a/share/man/man4/e6000sw.4 +++ b/share/man/man4/e6000sw.4 @@ -3,7 +3,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.Dd May 10, 2025 +.Dd April 16, 2026 .Dt E6000SW 4 .Sh NAME .Nm e6000sw @@ -31,6 +31,8 @@ Marvell 88E6176 .It Marvell 88E6172 .It +Marvell 88E6171 +.It Marvell 88E6341 .It Marvell 88E6141 From nobody Fri Apr 17 15:31:17 2026 X-Original-To: dev-commits-src-main@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 4fxzPL1mXlz672Js for ; Fri, 17 Apr 2026 15:31:18 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxzPL0yjDz3Scd for ; Fri, 17 Apr 2026 15:31:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776439878; 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=Aww4Ut7VJtc2GZD8OcR3tcafLstke0x62rsNYKY8Q40=; b=Uzv6x3HnPfrW4HzJwLP/t0Alx68yVJVZFVXxAniU3Rq3r55wiFntLRQrC2oY3qVJSPfTxZ kIPeuZd5b1CBXi4fUA2kHkL62uJsqJ9mnORGYTbK9G8qzvcQtl7iYNOVCK1GcN1vehLkNE 0ayPgosiECiUiWYePCswKTIN7F7v/2iLO09R4vlnbeheHt2Elp2xdCE2hdDRa5NxsodL+1 QdX8QvXTYXD2PQGDw7ZuruiBVtlrlXwE1EOv5LKIzQBeT2Fut7DZet3Vebft7aGlLEYWwN 9IbuelHNpfcLEP8AVkx1bKMFhC8MWBx/ccC6AuUlHn9xFMoH1TI0mLo79RIpDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776439878; a=rsa-sha256; cv=none; b=wBAHWUHKH/AiN5Htm0ubp4FHhQlCmIYNLKlcQXNgVv+4XwzD60n1hqL6KeixwZUBdOvE3+ 2RZ1I97MkxlSeWuf4bEz+8ELa+nhG+aSBSU51ON/OmkcN1bea8S10MKG6ShfCT5d32LP6n 5aT59MyevaOVRf7aJcT/CBZMQ7gsc7gJV3StB47dOI8v4bsl/cigkU6NgdveN/FZ8OkhAj ii4vUpw57XyQhRZR8YaxMvgWGtGxTlSTUVcc0gBlLUx+ykG/YIb8N5RpyVSRWOj79Yq+t3 Z3ynIKNF5Rf5QYJtn51KcpaKG1tKMKZTJTohUsP9YF2QDLQEwb1i2RJWxQAy6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776439878; 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=Aww4Ut7VJtc2GZD8OcR3tcafLstke0x62rsNYKY8Q40=; b=Hv8y7080YUWUiINYBJDiBHYl3uA5I3f1uJPkY+9ztZcx23c3FGSPsdI2LLCptQXCszRC+s oGyaTiHDKEFu+/Ai+ZH1W9SD7wrebireUGjpnw2rOKhfDRAlBuKuXpkbA9P7V+r0g4ge4E eHBJ1iO2OJDYXgyHRKyUaL7zWxtXiBgBEGzZkmkZ9gSCo65pYafC4/WQWH8eg2JYhInt0c ZlVQyM3Eph92MW6PiZUPI26m755hEbd35l8T98doaHmEjw5P2OFr8pxd2oxFdF03U12hHk n+A2dRrnciFN9wSJ1BL/jjGReFC0z7eJKSsQGCjWooXb1B80h3XEqVum2VzRcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxzPK75mXz1034 for ; Fri, 17 Apr 2026 15:31:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 21905 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 15:31:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: 49e9b3061df0 - main - dtrace: Improve dmesg kernel message prefix List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49e9b3061df036a73e8bc424c026158f3f57b183 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 15:31:17 +0000 Message-Id: <69e25245.21905.5449f153@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=49e9b3061df036a73e8bc424c026158f3f57b183 commit 49e9b3061df036a73e8bc424c026158f3f57b183 Author: Alexander Ziaee AuthorDate: 2026-04-17 15:25:01 +0000 Commit: Alexander Ziaee CommitDate: 2026-04-17 15:29:19 +0000 dtrace: Improve dmesg kernel message prefix Provide intuitive log search keywords and increased system consistency. MFC after: 2 weeks Reported by: mav Reviewed by: 0mp, dteske OpenZFS change: d45c8d648 (Improve dmesg kernel message prefix) Differential Revision: https://reviews.freebsd.org/D55765 --- sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c b/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c index 24abeb66ea51..a9c2a0906ef2 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c @@ -35,21 +35,21 @@ vcmn_err(int ce, const char *fmt, va_list adx) prefix = NULL; /* silence unwitty compilers */ switch (ce) { case CE_CONT: - prefix = "Solaris(cont): "; + prefix = "dtrace(cont): "; break; case CE_NOTE: - prefix = "Solaris: NOTICE: "; + prefix = "dtrace: NOTICE: "; break; case CE_WARN: - prefix = "Solaris: WARNING: "; + prefix = "dtrace: WARNING: "; break; case CE_PANIC: - prefix = "Solaris(panic): "; + prefix = "dtrace(panic): "; break; case CE_IGNORE: break; default: - panic("Solaris: unknown severity level"); + panic("dtrace: unknown severity level"); } if (ce == CE_PANIC) { vsnprintf(buf, sizeof(buf), fmt, adx); @@ -76,7 +76,7 @@ int assfail(const char *a, const char *f, int l) { - panic("solaris assert: %s, file: %s, line: %d", a, f, l); + panic("dtrace assert: %s, file: %s, line: %d", a, f, l); return (0); } @@ -86,6 +86,6 @@ assfail3(const char *a, uintmax_t lv, const char *op, uintmax_t rv, const char *f, int l) { - panic("solaris assert: %s (0x%jx %s 0x%jx), file: %s, line: %d", + panic("dtrace assert: %s (0x%jx %s 0x%jx), file: %s, line: %d", a, lv, op, rv, f, l); } From nobody Fri Apr 17 16:57:58 2026 X-Original-To: dev-commits-src-main@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 4fy1KL6pPxz679FC for ; Fri, 17 Apr 2026 16:57:58 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy1KL633Sz3fw6 for ; Fri, 17 Apr 2026 16:57:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776445078; 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=Pc3xUDDH33cg3f7ctOC1IsPeeSshVVe+RnXnLalISo8=; b=PMFBK5SWB/tCyJAC+NPYkcCdyz0IO+1btiLLLk/DurKMGA6rfv1CXRwCWTZzDpwoU1wtQI 9MgEkZunUnsGpkNwzdL2Ly9ku36D+rPpPlrCVviwY6SVvL6Lfh55FfI/QypL3O3MJLJe83 V7b1KvejUdKIftycWabOSbcRAbkQVsIsrKOEBgQGeD68i9HSbCFZczl6brfZ2v4ngzh9Vg +A5qQbSldX9+D/M7s8YeUnbICkxtXagohr2520YcTOKOFOZW8Z5PhTKu/EwVkr8coadFi1 q7HSYAxzHmfCot6E2zzWomoWlpu0nZEPmP9un3V19FKDUT9i0DW7ebWjYB6Alg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776445078; a=rsa-sha256; cv=none; b=MFqmfXpAl8gh1sv4oUDcPXo4FCwGoJASeoNQQcy07ec9RSKk+ZgJJtbbxm/NF8/XRGXQEM v30uh25QerFVmuWyDEc/gdO58moDBUZ1VoClmrdQYk06XDGWzWDuX7z5diynbuxGFw6TP/ ACX/B39IaEBOrT3qOFmVDk/oDYiXoPU/OeBzjjcEZkh+ByQnhLVABSsVFt2nwUCNXT5tGk DO39OwNdpdxl1a9AHyWkVmyMhK1Nwt+EYN9Pm3mls+CSSi9a0PHlJ9/QnKK3l9DkhVnjN2 6qcmzB4dmWOoprOeA7zIc4cn16rxUZW2oSijGDgXG2+Zbd+YE9r+NtYSk0iKSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776445078; 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=Pc3xUDDH33cg3f7ctOC1IsPeeSshVVe+RnXnLalISo8=; b=dWd3fDWgreO+dUjGtpnK8cf9/0bLNIjfp8/TFPu5UEVdVFuJJ6Ne/qZmeXFbmCohVCwHFy Js3pH+Z0qVZcRGoX8opQYsJesQSPZIbPgqt7pnH7YHkyjVEs/85bZpKKxKvaS2kCZ3lxqc l/2iaPvMsYgCiPWDWSZ3ygHp2W7S9cEaubyfZpebbL0N+m1M08VZtxjD1sdP1V4KVsXL19 TFiFmP7it9GfcpgZRaCXswxjjQoahwCSWtnXKOu3nKBR6WRuS5BOvN2vsml96EIsiCm62c Jojf8b9OO6zngoFZlPnWS1t+3irRvvCOtr0y0rlCVztgqHG9Ab3o1zjYGTU8aQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy1KL5N3gz123w for ; Fri, 17 Apr 2026 16:57:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31c1b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 16:57:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: eb0279550d52 - main - boot1.chrp: Improve comment for the SLOF hack List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb0279550d52962241b4178101cd7f7d732eb682 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 16:57:58 +0000 Message-Id: <69e26696.31c1b.7490e442@gitrepo.freebsd.org> The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=eb0279550d52962241b4178101cd7f7d732eb682 commit eb0279550d52962241b4178101cd7f7d732eb682 Author: Lexi Winter AuthorDate: 2026-04-17 16:56:33 +0000 Commit: Lexi Winter CommitDate: 2026-04-17 16:56:33 +0000 boot1.chrp: Improve comment for the SLOF hack Since this original comment was written, the actual issue in SLOF was diagnosed and documented in commit 424089a0fc, which fixed it for loader(8). Update the comment in boot1 to be more informative to future readers. MFC after: 3 days Reviewed by: jhibbits, adrian Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D56470 --- stand/powerpc/boot1.chrp/boot1.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/stand/powerpc/boot1.chrp/boot1.c b/stand/powerpc/boot1.chrp/boot1.c index 1a546f3473e2..1bb06bf82983 100644 --- a/stand/powerpc/boot1.chrp/boot1.c +++ b/stand/powerpc/boot1.chrp/boot1.c @@ -102,14 +102,11 @@ ofwh_t bootdevh; ofwh_t stdinh, stdouth; /* - * Note about the entry point: + * Our entrypoint. * - * For some odd reason, the first page of the load appears to have trouble - * when entering in LE. The first five instructions decode weirdly. - * I suspect it is some cache weirdness between the ELF headers and .text. - * - * Ensure we have a gap between the start of .text and the entry as a - * workaround. + * A bug in the SLOF shipped with some versions of QEMU causes the first + * 32 bytes of .text to be wrongly byte-swapped when loading LE programs. + * As a workaround, we add some padding at the start of the text section. */ __asm(" \n\ .data \n\ @@ -118,7 +115,7 @@ stack: \n\ .space 16384 \n\ \n\ .text \n\ - /* SLOF cache hack */ \n\ + /* SLOF workaround */ \n\ .space 4096 \n\ .globl _start \n\ _start: \n\ From nobody Fri Apr 17 16:59:31 2026 X-Original-To: dev-commits-src-main@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 4fy1MN3tMTz679Hc for ; Fri, 17 Apr 2026 16:59:44 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy1MN1rXNz3g8d for ; Fri, 17 Apr 2026 16:59:44 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-8a15ebb3abbso13665156d6.1 for ; Fri, 17 Apr 2026 09:59:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776445183; cv=none; d=google.com; s=arc-20240605; b=Tw2Sxp6ZzDQsga9ALjD55wiIoBZpi7YgPBVkS8PCzVDNhx1HH7dg1Xra19N8njMMeM 6vgnPF++6Nsymeok+lCdUkIoeq7OfHReDCRNX926oN2NXMJaznYybDHslInUe47nq6Ez YwBkdoaXCT1zNNDZu5jSvGk1YvUX0AQLe6wRp0u8bixm5lCKkbUDBPROBHFyECILZXWN lEhZzstH5V2Sdk6dL4IWA5uXGJCnKn4KXBU18h8jJhsgfjx/Ih28LEuGfZD7e1ombfhq WrFrXPuI+Rv6GphK9l6KStPiSVjDtGCbra3EK5t0dsoCqTj4v/uqROoRHf06eCYVFcAT 64QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version; bh=mN9mmm1t/IAdXOs/+y9Daz7/G2YOWLjKhKg20XyTe+U=; fh=d3wg66ksFR8pLZgrbEZVW6blwDo/cqcxc+rTCPNnyik=; b=CK9Eoxi0Ux3wBJmeGk1Gg8+iG0+lXiTPl338bwvilZjqCTOBxaSgDX3OYwIRtsiigE SQUZuvnsHFGyKCw3ZqNDWLmUvsD1E2kiXyGseDprVZkn1T8aMvdY3IUzb36skjs9zWgy 6OLDGRUjPIf9ERAZtrQ0DfZFeKBOLoDtKuNZbwURsxkco7k6NNOJqEKwuPLuhtfCd+1B V3nAZJJ+OdgraNWCWCkWgmc1SZe0ErCblxJHXY2Yv9ynrtB0KzGxDsLPHtQVdQ6WL+p4 NNsDX4Wb07yxUF8bQ0R7H6P5+BKhmicDXYupFEBKVKnCdO2LZWdrF1518f3uiG/u+o38 w2bQ==; darn=freebsd.org ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776445183; x=1777049983; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mN9mmm1t/IAdXOs/+y9Daz7/G2YOWLjKhKg20XyTe+U=; b=LTHalacEFtnKme1m7pvdySjdt/CHN827cVQ+I4IzdCrwlifKFgv6xjFd8vW2hT/ot2 NxFxdqNGCTuZ7JD5eawYY10jWV6V7Rt8LKDJFaasnd/ILZs5AiVyo8YCvz1mf1zDhEZC wM8DH+rJa+E6QvAqtoTpF0a3WDyP6Iu9dzfUwgMe/+vkKQcS1L9tF3reUzcwO1Ss5m5c 28XLf/CAMvJ3W+ThVNJJOj6XJH7PGHfiwTU4EcOuiLuIwHXRC+6FLxpBUC8x8M6ghoLZ kUbN9KntH6xW9N3W7CGiugBEDEmPzy5Z99JggG4+m4e4TCZ+SIbw34VxtBBcYrk7UsY4 RH0A== X-Forwarded-Encrypted: i=1; AFNElJ9i/oYIzEwUI7ryGIoV0qkQgZLNsbxc/GbZkph6hYpFJRtUAgV8/ebADvScfKZ2Rf/EIkiiJvdG/T62ZMyl/QOJdaeqIw==@freebsd.org X-Gm-Message-State: AOJu0Yx+eB/uIx37FMueS/vHEVkTvIc3vLKSnZTuQ/EReyn1+lHmy4p0 DJlmG48kDECuKNlfb0gbha4DMx3av/f14gt/qIH71nmmOnFjMPJymxpIxIMwpjUlqFJ94wkZb+1 74KcI0P/tjC0lngLzLr/hsKG6XLJ1qtY= X-Gm-Gg: AeBDietXWzsOO4KF/dyCpfaE7micIR+S9A91ikLEWT8E42Y2v+5VqoWr37+gPYC5f9u cuEL1o1X8s+eo95UzRBmFC2KbzcwCHdIZPVHkWiXv8iOmmECtXb19COUci/QO1yZnCUW9TVX6ZH vxfiHIpR8/3IRViEXYb7G0zIyQrm+fiO6m3R67+FoTxzRo2OSlvIaLNQ0ojwwaiP8xDT/Tl2GN2 9o/uAZgxLLOUvfySVFMusHzaT0cRyBxOLifsQ0rOLMIoxp4FjscGVDroH2wJwgVQrTfJkkhLQoU KywaNytswsjo3EuyP2OmvaJLBJc/7v2/Ersz3VKSrIevD6/gWQa8fh7MJnzBH7hQS8z/2SCfqJX 5VKrPU2DF9v09pBmP4LRW4Nn2c/ZWWmrKvHfNzw== X-Received: by 2002:a05:6214:419a:b0:89c:daf4:5e2 with SMTP id 6a1803df08f44-8b0280ffbf1mr52685686d6.35.1776445183227; Fri, 17 Apr 2026 09:59:43 -0700 (PDT) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 References: <69de65eb.21a5c.61244c2a@gitrepo.freebsd.org> In-Reply-To: From: Adrian Chadd Date: Fri, 17 Apr 2026 09:59:31 -0700 X-Gm-Features: AQROBzDc2EaGuJeifY7fanxNxIr48Dqqstobcu-GxPzA4kqOhnYSaJ2Sg65_qF8 Message-ID: Subject: Re: git: 9b76228006d8 - main - inpcb: retire inp_vnet To: Siva Mahadevan Cc: Mark Johnston , Gleb Smirnoff , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, owner-src-committers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] X-Rspamd-Queue-Id: 4fy1MN1rXNz3g8d X-Spamd-Bar: ---- Ok, @Gleb Smirnoff Do you mind reverting it until a more comprehensive fix is available? -a On Fri, 17 Apr 2026 at 06:17, Siva Mahadevan wrote: > > On Fri Apr 17, 2026 at 46:00 UTC, Adrian Chadd wrote: > > On Thu, 16 Apr 2026 at 14:05, Mark Johnston wrote: > >> > >> > >> > >> It's possible to have inp->inp_socket == NULL here. This is triggered > >> by the sys/netinet/tcp_hpts_test.py tests. > >> > >> > /* Lets do any logging that we might want to */ > >> > tcp_hpts_log(hpts, tp, &tv, slots_to_run, i, from_callout); > >> > > > > > Do you think it's worth reverting? it's been a couple days and I just > > got emailed about that > > test failing after I landed some unrelated stuff! > > > > I think it's worth reverting. This is preventing other tests from > completing: https://ci.freebsd.org/tinderbox/ (the archs that do complete > don't have python installed, and thus skip this test). From nobody Fri Apr 17 17:12:57 2026 X-Original-To: dev-commits-src-main@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 4fy1ff054Wz67BJ3 for ; Fri, 17 Apr 2026 17:12:58 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy1fd6x9Tz3ktG for ; Fri, 17 Apr 2026 17:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776445977; 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=2tHSrkaGtb2JuFFqPzV/+VuU6oaTTkhjlX6FINtqB2A=; b=s7k+Px8s1TwXeoWM0YWE3UrBGgawdo6vOMfCKAH9bE45KXEfp9yEVX9hinWr/B8W0Si8kL GPT7R4xwXsj7XVBOmPY3MAv+8dvPCdbJxAnlko2l/kLbL5vgdnUcfApdh++SIgwWAxnoxs 6PaHI0Z3mQlZ7M52JOxDARijABYJqLLRQu4zJ9MUzCDW9fcolbXm506ddAPY8NOMtYYH9R +k7oz7l8jaH14mZkW33X4Zo7ovw96IIJFjPbO8QIJTNlO8JlqPC0LVDfeOube4JFixjNNX euxWaG6+dBY7V6jxvf0IWyCaEW1O5vJWOZaCs5z2LcWt3uNVKpiYqty+SbvFnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776445977; a=rsa-sha256; cv=none; b=KI307+yA5X/sTY9+9dYP5XUJ8FTzheswQ9L7/7scteKzNazVEjBfeFP79Y0FDbyiVipHz8 3qHK7wI89/q8rVjHbhruG+CmOF/172icw6ImMT53JY7SjnY2Hsewlm4Y90TwuZH0iUt+DD F101XKuzHoySk7thzMZRVa4pbjGFe49I5y3ixT/vYPJcpzpx3dZ5JMI2N62HgftVM3uE5C sky7bq4VOLmgehI4vIOK5XqoDu4S07mdELkaa5Yf2qSKlqocOtEwHhZGv4H2Xis9NMxNFB vaCW5Qu4jRFb1E3gxwn2OL4hDEE57TUpzJV3lbucCEeghG0rrW5w4O4Loa/imw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776445977; 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=2tHSrkaGtb2JuFFqPzV/+VuU6oaTTkhjlX6FINtqB2A=; b=Eybnb/AFRDt0UbUE7PYlgDQSc8243H2tOJuYKAlJr2ZN9QuJk56ZY4Sil+WS9ySDzgI5Lj vFSst9kfJYacGL8+cn4TE/0dzT4SU8gcAutOpUJ+2/tiJ4ZfmFjC5DFvcu6hW/mRYE8boz ucBxLNh/r1n0RHRI4sDLgyu39tJtly1DaRZ0wbxo3UQ0+GmqPualQDbJCfyCjbUl4bD5Qm g17bxWGgdPbjR6bE/oHzzE1415DzL2yNkl8RSjTJwzu/TTazTchwPGTLshQTvnyig7trec /LAWcZXRqznnkRnkdAKNl0wZNnm9liSK78YjV1sbEJGS2lDDOH9ZlKfurCWnxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy1fd6DHWz13Pv for ; Fri, 17 Apr 2026 17:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32cd5 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 17:12:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: cfec995c87f3 - main - ixgbe: add MDIO bus support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cfec995c87f39e59c80554b85625b4aaa8ddf8db Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 17:12:57 +0000 Message-Id: <69e26a19.32cd5.1fe9c3f5@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=cfec995c87f39e59c80554b85625b4aaa8ddf8db commit cfec995c87f39e59c80554b85625b4aaa8ddf8db Author: Adrian Chadd AuthorDate: 2026-04-17 17:11:42 +0000 Commit: Adrian Chadd CommitDate: 2026-04-17 17:11:42 +0000 ixgbe: add MDIO bus support This works enough to let me see the marvell switch on the MDIO bus. It uses clause 22, which ixgbe's existing MDIO code doesn't currently support, so it's implemented in a new source file. Since mdio(4) is now required, add it where appropriate to GENERIC kernels. Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D50128 --- sys/amd64/conf/GENERIC | 3 + sys/conf/NOTES | 3 + sys/conf/files | 4 + sys/dev/ixgbe/if_ix.c | 15 +++- sys/dev/ixgbe/if_ix_mdio.c | 158 ++++++++++++++++++++++++++++++++++++ sys/dev/ixgbe/if_ix_mdio.h | 34 ++++++++ sys/dev/ixgbe/if_ix_mdio_hw.c | 181 ++++++++++++++++++++++++++++++++++++++++++ sys/dev/ixgbe/if_ix_mdio_hw.h | 33 ++++++++ sys/modules/ix/Makefile | 3 +- 9 files changed, 432 insertions(+), 2 deletions(-) diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC index 7de19f86afbf..c6a095f2d98a 100644 --- a/sys/amd64/conf/GENERIC +++ b/sys/amd64/conf/GENERIC @@ -229,6 +229,9 @@ device ppi # Parallel port interface device device puc # Multi I/O cards and multi-channel UARTs +# MDIO bus for Ethernet NICs that directly expose the MDIO bus +device mdio + # PCI/PCI-X/PCIe Ethernet NICs that use iflib infrastructure device iflib device em # Intel PRO/1000 Gigabit Ethernet Family diff --git a/sys/conf/NOTES b/sys/conf/NOTES index 4279fae4c547..d982164ae3a1 100644 --- a/sys/conf/NOTES +++ b/sys/conf/NOTES @@ -1997,6 +1997,9 @@ device vr # VIA Rhine, Rhine II device vte # DM&P Vortex86 RDC R6040 Fast Ethernet device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') +# MDIO bus for Ethernet NICs that directly expose the MDIO bus +device mdio + # PCI/PCI-X/PCIe Ethernet NICs that use iflib infrastructure device iflib device em # Intel Pro/1000 Gigabit Ethernet diff --git a/sys/conf/files b/sys/conf/files index da07e370a712..18ca17c731a8 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -2300,6 +2300,10 @@ dev/ixgbe/if_ix.c optional ix inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" dev/ixgbe/if_ixv.c optional ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" +dev/ixgbe/if_ix_mdio.c optional ix inet mdio \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/if_ix_mdio_hw.c optional ix inet mdio \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/if_bypass.c optional ix inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/if_fdir.c optional ix inet | ixv inet \ diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 829fbba48a72..b9d88fcab523 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -36,10 +36,14 @@ #include "opt_rss.h" #include "ixgbe.h" +#include "mdio_if.h" #include "ixgbe_sriov.h" #include "ifdi_if.h" +#include "if_ix_mdio_hw.h" +#include "if_ix_mdio.h" #include +#include #include /************************************************************************ @@ -298,6 +302,10 @@ static device_method_t ix_methods[] = { DEVMETHOD(pci_iov_uninit, iflib_device_iov_uninit), DEVMETHOD(pci_iov_add_vf, iflib_device_iov_add_vf), #endif /* PCI_IOV */ + DEVMETHOD(bus_add_child, device_add_child_ordered), + DEVMETHOD(mdio_readreg, ixgbe_mdio_readreg_c22), + DEVMETHOD(mdio_writereg, ixgbe_mdio_writereg_c22), + DEVMETHOD_END }; @@ -305,11 +313,13 @@ static driver_t ix_driver = { "ix", ix_methods, sizeof(struct ixgbe_softc), }; -DRIVER_MODULE(ix, pci, ix_driver, 0, 0); +DRIVER_MODULE(mdio, ix, mdio_driver, 0, 0); /* needs to happen before ix */ +DRIVER_MODULE_ORDERED(ix, pci, ix_driver, NULL, NULL, SI_ORDER_ANY); /* needs to be last */ IFLIB_PNP_INFO(pci, ix_driver, ixgbe_vendor_info_array); MODULE_DEPEND(ix, pci, 1, 1, 1); MODULE_DEPEND(ix, ether, 1, 1, 1); MODULE_DEPEND(ix, iflib, 1, 1, 1); +MODULE_DEPEND(ix, mdio, 1, 1, 1); static device_method_t ixgbe_if_methods[] = { DEVMETHOD(ifdi_attach_pre, ixgbe_if_attach_pre), @@ -1274,6 +1284,9 @@ ixgbe_if_attach_post(if_ctx_t ctx) /* Add sysctls */ ixgbe_add_device_sysctls(ctx); + /* Add MDIO bus if required / supported */ + ixgbe_mdio_attach(sc); + /* Init recovery mode timer and state variable */ if (sc->feat_en & IXGBE_FEATURE_RECOVERY_MODE) { sc->recovery_mode = 0; diff --git a/sys/dev/ixgbe/if_ix_mdio.c b/sys/dev/ixgbe/if_ix_mdio.c new file mode 100644 index 000000000000..3aa7ea80c3a7 --- /dev/null +++ b/sys/dev/ixgbe/if_ix_mdio.c @@ -0,0 +1,158 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Adrian Chadd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_rss.h" + +#include "ixgbe.h" +#include "mdio_if.h" +#include "ixgbe_sriov.h" +#include "ifdi_if.h" +#include "if_ix_mdio_hw.h" +#include "if_ix_mdio.h" + +#include + +/** + * @brief Return if the given ixgbe chipset supports clause 22 MDIO bus access. + * + * Although technically all of the ixgbe chipsets support an MDIO + * bus interface, there's a bunch of factors controlling whether + * this should be exposed for external control. + * + * This functionr returns true if it supports an MDIO bus and + * clause 22 transactions. + */ +static bool +ixgbe_has_mdio_bus_clause22(struct ixgbe_hw *hw) +{ + switch (hw->device_id) { + case IXGBE_DEV_ID_X550EM_A_KR: + case IXGBE_DEV_ID_X550EM_A_KR_L: + case IXGBE_DEV_ID_X550EM_A_SFP_N: + case IXGBE_DEV_ID_X550EM_A_SGMII: + case IXGBE_DEV_ID_X550EM_A_SGMII_L: + case IXGBE_DEV_ID_X550EM_A_10G_T: + case IXGBE_DEV_ID_X550EM_A_SFP: + case IXGBE_DEV_ID_X550EM_A_1G_T: + case IXGBE_DEV_ID_X550EM_A_1G_T_L: + return (true); + } + return (false); +} + + + +/** + * @brief Initiate a clause-22 MDIO read transfer. + * + * Note this is only officially supported for a small subset + * of NICs, notably the X552/X553 devices. This must not be + * called for other chipsets. + */ +int +ixgbe_mdio_readreg_c22(device_t dev, int phy, int reg) +{ + if_ctx_t ctx = device_get_softc(dev); + struct sx *iflib_ctx_lock = iflib_ctx_lock_get(ctx); + struct ixgbe_softc *sc = iflib_get_softc(ctx); + struct ixgbe_hw *hw = &sc->hw; + uint16_t val = 0; + int32_t ret = 0; + + if (! ixgbe_has_mdio_bus_clause22(hw)) + return (-1); + + sx_xlock(iflib_ctx_lock); + ret = ixgbe_read_mdio_c22(hw, phy, reg, &val); + if (ret != IXGBE_SUCCESS) { + device_printf(dev, "%s: read_mdi_22 failed (%d)\n", + __func__, ret); + sx_xunlock(iflib_ctx_lock); + return (-1); + } + sx_xunlock(iflib_ctx_lock); + return (val); +} + +/** + * @brief Initiate a clause-22 MDIO write transfer. + * + * Note this is only officially supported for a small subset + * of NICs, notably the X552/X553 devices. This must not be + * called for other chipsets. + */ +int +ixgbe_mdio_writereg_c22(device_t dev, int phy, int reg, int data) +{ + if_ctx_t ctx = device_get_softc(dev); + struct sx *iflib_ctx_lock = iflib_ctx_lock_get(ctx); + struct ixgbe_softc *sc = iflib_get_softc(ctx); + struct ixgbe_hw *hw = &sc->hw; + int32_t ret; + + if (! ixgbe_has_mdio_bus_clause22(hw)) + return (-1); + + sx_xlock(iflib_ctx_lock); + ret = ixgbe_write_mdio_c22(hw, phy, reg, data); + if (ret != IXGBE_SUCCESS) { + device_printf(dev, "%s: write_mdi_22 failed (%d)\n", + __func__, ret); + sx_xunlock(iflib_ctx_lock); + return (-1); + } + sx_xunlock(iflib_ctx_lock); + return (0); +} + +/** + * @brief Attach the MDIO bus if one exists. + */ +void +ixgbe_mdio_attach(struct ixgbe_softc *sc) +{ + struct ixgbe_hw *hw = &sc->hw; + int enable_mdio = 0; + + /* + * This explicitly needs to be enabled regardless of whether + * the device / instance supports an external MDIO bus. + */ + if (resource_int_value(device_get_name(sc->dev), + device_get_unit(sc->dev), "enable_mdio", &enable_mdio) == 0) { + if (enable_mdio == 0) + return; + } else + return; + + if (! ixgbe_has_mdio_bus_clause22(hw)) + return; + + device_add_child(sc->dev, "mdio", DEVICE_UNIT_ANY); + bus_attach_children(sc->dev); +} diff --git a/sys/dev/ixgbe/if_ix_mdio.h b/sys/dev/ixgbe/if_ix_mdio.h new file mode 100644 index 000000000000..f9fe99275b2b --- /dev/null +++ b/sys/dev/ixgbe/if_ix_mdio.h @@ -0,0 +1,34 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2025 Adrian Chadd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _IF_IX_MDIO_H_ +#define _IF_IX_MDIO_H_ + +int ixgbe_mdio_readreg_c22(device_t, int, int); +int ixgbe_mdio_writereg_c22(device_t, int, int, int); +void ixgbe_mdio_attach(struct ixgbe_softc *); + +#endif /* _IF_IX_MDIO_H */ diff --git a/sys/dev/ixgbe/if_ix_mdio_hw.c b/sys/dev/ixgbe/if_ix_mdio_hw.c new file mode 100644 index 000000000000..581ed09f27e3 --- /dev/null +++ b/sys/dev/ixgbe/if_ix_mdio_hw.c @@ -0,0 +1,181 @@ +/****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause + + Copyright (c) 2001-2024, Intel Corporation + All rights reserved. + Copyright (c) 2026 Adrian Chadd + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ + +#include "ixgbe_api.h" +#include "ixgbe_common.h" +#include "ixgbe_phy.h" + +#include "if_ix_mdio_hw.h" + +/* + * These routines are separate from the rest of ixgbe for now to make merging + * easier. + */ + +static s32 +ixgbe_read_mdio_unlocked_c22(struct ixgbe_hw *hw, u16 phy, u16 reg, u16 *phy_data) +{ + u32 i, data, command; + + /* Setup and write the read command */ + command = (reg << IXGBE_MSCA_DEV_TYPE_SHIFT) | + (phy << IXGBE_MSCA_PHY_ADDR_SHIFT) | + IXGBE_MSCA_OLD_PROTOCOL | IXGBE_MSCA_READ_AUTOINC | + IXGBE_MSCA_MDI_COMMAND; + + IXGBE_WRITE_REG(hw, IXGBE_MSCA, command); + + /* Check every 10 usec to see if the access completed. + * The MDI Command bit will clear when the operation is + * complete + */ + for (i = 0; i < IXGBE_MDIO_COMMAND_TIMEOUT; i++) { + usec_delay(10); + + command = IXGBE_READ_REG(hw, IXGBE_MSCA); + if (!(command & IXGBE_MSCA_MDI_COMMAND)) + break; + } + + if (command & IXGBE_MSCA_MDI_COMMAND) + return IXGBE_ERR_PHY; + + /* Read operation is complete. Get the data from MSRWD */ + data = IXGBE_READ_REG(hw, IXGBE_MSRWD); + data >>= IXGBE_MSRWD_READ_DATA_SHIFT; + *phy_data = (u16)data; + + return IXGBE_SUCCESS; +} + +static s32 +ixgbe_write_mdio_unlocked_c22(struct ixgbe_hw *hw, u16 phy, u16 reg, u16 phy_data) +{ + u32 i, command; + + /* Put the data in the MDI single read and write data register*/ + IXGBE_WRITE_REG(hw, IXGBE_MSRWD, (u32)phy_data); + + /* Setup and write the write command */ + command = (reg << IXGBE_MSCA_DEV_TYPE_SHIFT) | + (phy << IXGBE_MSCA_PHY_ADDR_SHIFT) | + IXGBE_MSCA_OLD_PROTOCOL | IXGBE_MSCA_WRITE | + IXGBE_MSCA_MDI_COMMAND; + + IXGBE_WRITE_REG(hw, IXGBE_MSCA, command); + + /* Check every 10 usec to see if the access completed. + * The MDI Command bit will clear when the operation is + * complete + */ + for (i = 0; i < IXGBE_MDIO_COMMAND_TIMEOUT; i++) { + usec_delay(10); + + command = IXGBE_READ_REG(hw, IXGBE_MSCA); + if (!(command & IXGBE_MSCA_MDI_COMMAND)) + break; + } + + if (command & IXGBE_MSCA_MDI_COMMAND) + return IXGBE_ERR_PHY; + + return IXGBE_SUCCESS; +} + +/* + * Return true if the MAC is an X55x backplane. + * + * These have a single MDIO PHY semaphore (PHY0) and also require the + * token semaphore. + */ +static bool +ixgbe_check_mdio_is_x550em(struct ixgbe_hw *hw) +{ + + switch (hw->device_id) { + case IXGBE_DEV_ID_X550EM_A_KR: + case IXGBE_DEV_ID_X550EM_A_KR_L: + case IXGBE_DEV_ID_X550EM_A_SFP_N: + case IXGBE_DEV_ID_X550EM_A_SGMII: + case IXGBE_DEV_ID_X550EM_A_SGMII_L: + case IXGBE_DEV_ID_X550EM_A_10G_T: + case IXGBE_DEV_ID_X550EM_A_SFP: + case IXGBE_DEV_ID_X550EM_A_1G_T: + case IXGBE_DEV_ID_X550EM_A_1G_T_L: + return true; + default: + return false; + } +} + +s32 +ixgbe_read_mdio_c22(struct ixgbe_hw *hw, u16 phy, u16 reg, u16 *phy_data) +{ + u32 gssr = hw->phy.phy_semaphore_mask; + s32 ret; + + if (ixgbe_check_mdio_is_x550em(hw)) + gssr |= IXGBE_GSSR_PHY0_SM | IXGBE_GSSR_TOKEN_SM; + + if (hw->mac.ops.acquire_swfw_sync(hw, gssr)) { + *phy_data = -1; + return IXGBE_ERR_TIMEOUT; + } + + ret = ixgbe_read_mdio_unlocked_c22(hw, phy, reg, phy_data); + if (ret != IXGBE_SUCCESS) + *phy_data = -1; + + hw->mac.ops.release_swfw_sync(hw, gssr); + return ret; +} + +s32 +ixgbe_write_mdio_c22(struct ixgbe_hw *hw, u16 phy, u16 reg, u16 data) +{ + u32 gssr = hw->phy.phy_semaphore_mask; + s32 ret; + + if (ixgbe_check_mdio_is_x550em(hw)) + gssr |= IXGBE_GSSR_PHY0_SM | IXGBE_GSSR_TOKEN_SM; + + if (hw->mac.ops.acquire_swfw_sync(hw, gssr)) + return IXGBE_ERR_TIMEOUT; + + ret = ixgbe_write_mdio_unlocked_c22(hw, phy, reg, data); + + hw->mac.ops.release_swfw_sync(hw, gssr); + return ret; +} diff --git a/sys/dev/ixgbe/if_ix_mdio_hw.h b/sys/dev/ixgbe/if_ix_mdio_hw.h new file mode 100644 index 000000000000..b2db5d431819 --- /dev/null +++ b/sys/dev/ixgbe/if_ix_mdio_hw.h @@ -0,0 +1,33 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2026 Adrian Chadd + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _IF_IX_MDIO_HW_H_ +#define _IF_IX_MDIO_HW_H_ + +s32 ixgbe_read_mdio_c22(struct ixgbe_hw *hw, u16 phy, u16 reg, u16 *phy_data); +s32 ixgbe_write_mdio_c22(struct ixgbe_hw *hw, u16 phy, u16 reg, u16 data); + +#endif /* _IF_IX_MDIO_HW_H_ */ diff --git a/sys/modules/ix/Makefile b/sys/modules/ix/Makefile index 252ff4a3378d..2884f6ba898e 100644 --- a/sys/modules/ix/Makefile +++ b/sys/modules/ix/Makefile @@ -1,9 +1,10 @@ .PATH: ${SRCTOP}/sys/dev/ixgbe KMOD = if_ix -SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h ifdi_if.h +SRCS = device_if.h bus_if.h pci_if.h pci_iov_if.h ifdi_if.h mdio_if.h SRCS += opt_inet.h opt_inet6.h opt_rss.h SRCS += if_ix.c if_bypass.c if_fdir.c if_sriov.c ix_txrx.c ixgbe_osdep.c +SRCS += if_ix_mdio.c if_ix_mdio_hw.c # Shared source SRCS += ixgbe_common.c ixgbe_api.c ixgbe_phy.c ixgbe_mbx.c ixgbe_vf.c SRCS += ixgbe_dcb.c ixgbe_dcb_82598.c ixgbe_dcb_82599.c From nobody Fri Apr 17 17:12:58 2026 X-Original-To: dev-commits-src-main@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 4fy1fg1wHCz67BQl for ; Fri, 17 Apr 2026 17:12:59 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy1fg0Qtsz3lDC for ; Fri, 17 Apr 2026 17:12:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776445979; 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=DM5z1kATx2A0qLftZxlvoXEGK8C11coz9e0955iF6m0=; b=luiFectjgaPKe54QeOKNW1d41leRYM4cDTIfU+O4z4Fjp4Qmi0TwGCPkshADsuaMORh+Z3 s01xb3u52B1un5RoOmbfUGhxznok0J/j2Xj61BrDEDA27zfxNl/X09ufsJ3cvg2f83ZrYX vbQHuXegEvWpdraXlpAJdJfnobfwd4gxZvxfqtIEGWnZKx7ASWyPoYd17VFAtBjbW+rlSq uz+kIBrODIHAibBSpUZwTDlENqZwp3Gn0cHZaE+sfM/E+kqOmObnvobL6H0YPzxN8gNx/N Xez3ZSf9HiSwn0iX+aSONIM5MA07H9ZrHohyj8TvicbXVKxNYbYExzDrSAq3Tg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776445979; a=rsa-sha256; cv=none; b=knRWkxrru0IhfhEHKQNmA9m9z51vLPMfC9GkexBV0FWvxMAddIsqIMeRXeZHWUgdpUyviY 3f7ef0YftBiUlTsSo1LuINDBdRM/bl9PjHuZMycu9S54FxRlOul+MhwChrukqnPQIVlD7U aIT+r7RS0OFsfpcd4V8GMhG1yPPP+vH/3iGIXy0yBYzQRKYLz/xk4OrSGVl257GlpOYWmS SoKzD5Q5X2YeJVNmWd2sSLNHKBiLPaY/5JelXjZ15JS6NonXrpADl6cIJNTovawJIlBFKU XpOH9/ahYA+9hdJhRovghfMxemKZS0lC4xhblp7+PjhgEnFTTY4/O9lUmYtlig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776445979; 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=DM5z1kATx2A0qLftZxlvoXEGK8C11coz9e0955iF6m0=; b=eSS2rkPmmg2jB7KZNX7l5iOY/NKlNI78Qwmi+7NhfQ3r2BbJ+8tl9Qb1iZP6X8/T5CcJhY r2tEwuSp2gl2dhRkN2/Gu9ga+A7PsGOYNJUyW2eO/gnKZZJmCe3qs4oZwY21dlIUtaH68c li9wYBtrZwgCPgk/THNl4eou7lcKGVo6R46v2J+Y3MAu2WQaQEnximsZYLcv5ET71CZUcz 5bdCgj5ugw5I1K9wlFmMUZo7kK4PXzSPJdqjwMLFsu7BIxdNojfAblLVvT8E2UXIA6Qnez DlJByvvxTYUix/viYm8zNB0lpm25+3IJ/POYPt5x20z6GY8FCZ/+la/ZYFeKJA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy1ff75Rnz13K9 for ; Fri, 17 Apr 2026 17:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 33e01 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 17:12:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: f46d75c90f5f - main - ixgbe: improve MDIO performance by reducing semaphore/IPC delays List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f46d75c90f5feb87259635134dde4da328282842 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 17:12:58 +0000 Message-Id: <69e26a1a.33e01.49fe138@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=f46d75c90f5feb87259635134dde4da328282842 commit f46d75c90f5feb87259635134dde4da328282842 Author: Adrian Chadd AuthorDate: 2026-04-17 17:11:53 +0000 Commit: Adrian Chadd CommitDate: 2026-04-17 17:11:53 +0000 ixgbe: improve MDIO performance by reducing semaphore/IPC delays Each MDIO transfer takes 8ms, and all of that is spent in a set of DELAY() calls, which is consuming a LOT of CPU. * Change the timeout in ixgbe_hic_unlocked() - doing IPC to the on-chip firmware - to a 1uS delay and bump timeout appropriately. This seems to finish in a couple of microseconds on my local test devices. * Change the 2ms sleep in ixgbe_release_swfw_sync_X540() to 2ms for EEPROM/flash, and 10uS otherwise. 10uS seems to work fine on my local testing, but the config EEPROM doesn't read right without this extra delay. The first change shouldn't change the driver behaviour, but the latter change is more intrusive and needs some wider testing. (My guess here is that there SHOULD have been some completion check somewhere in the EEPROM/flash IO path, and these sleeps are masking them.) Locally tested: * C3558 (Denverton) w/ X553 backplane Reviewed by: kbowling Differential Revision: https://reviews.freebsd.org/D50295 --- sys/dev/ixgbe/ixgbe_common.c | 4 ++-- sys/dev/ixgbe/ixgbe_x540.c | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index bff022585a03..9e827d2e5473 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -4631,11 +4631,11 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length, /* Setting this bit tells the ARC that a new command is pending. */ IXGBE_WRITE_REG(hw, IXGBE_HICR, hicr | IXGBE_HICR_C); - for (i = 0; i < timeout; i++) { + for (i = 0; i < timeout * 1000; i++) { hicr = IXGBE_READ_REG(hw, IXGBE_HICR); if (!(hicr & IXGBE_HICR_C)) break; - msec_delay(1); + usec_delay(1); } /* For each command except "Apply Update" perform diff --git a/sys/dev/ixgbe/ixgbe_x540.c b/sys/dev/ixgbe/ixgbe_x540.c index 57cec5b52e18..561fe6f0f78a 100644 --- a/sys/dev/ixgbe/ixgbe_x540.c +++ b/sys/dev/ixgbe/ixgbe_x540.c @@ -878,7 +878,21 @@ void ixgbe_release_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask) IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC_BY_MAC(hw), swfw_sync); ixgbe_release_swfw_sync_semaphore(hw); - msec_delay(2); + + /* + * EEPROM / flash access requires a 2ms sleep or interacting with + * them isn't stable. However, a 2ms delay for all sync operations + * is very expensive for MDIO access. + * + * So use a 10us delay for PHY0/PHY1 MDIO and management access and + * 2ms for everything else. This keep MDIO access (eg from a switch + * driver) fast. + */ + if (mask & + (IXGBE_GSSR_PHY0_SM | IXGBE_GSSR_PHY1_SM | IXGBE_GSSR_SW_MNG_SM)) + usec_delay(10); + else + usec_delay(2000); } /** From nobody Fri Apr 17 17:35:05 2026 X-Original-To: dev-commits-src-main@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 4fy289641Mz6WjqK for ; Fri, 17 Apr 2026 17:35:05 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy2895Wq4z3nF0 for ; Fri, 17 Apr 2026 17:35:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776447305; 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=rU+Msi8Qf0PTRg1bZ4iIJ+Ms1G9Xs86YFYg1ZQxmR/Y=; b=GJg6B2zbb7T/zgmjCcnOthqi7kT7tPikLtJ4GOnjlZj/l+R/CdnKoc22IP8uMQaI1UP2Ts hgZ85RNoWBYgjULW671zgrK16RBJCbF+Pt1325glnPzC1h47L9y9T+2SFFjIZD6YaWUCbF NyaRqRk0THhqChq+bTrtZaKYsK+2sDeqHGXkqXPY0bmEmzh6GL1VepDNAYMeum7cbAQfok eeq9GZKshL0phHhgZgox7G734GQjTOMNUAgfQ2HuMSS4QZMd7LeUWWD3+A4be6z7Dl/ksg K26FI/tkmbgiMpO+4y8oyqM2STm+Uu8VQK6WEXb8Z1xWfHWUg3rDYUQ981Cn8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776447305; a=rsa-sha256; cv=none; b=NGIchskw8E8NYF6mcMgLR9YEWWYnPS6Rm9oHEg6qPh4nnJNvY4FaZ/YraTtQ/5vOw4o3Jj B++Rx35UhC34OV0Tc6GogjTyyxFepZIYG7zPbHn4TB24zsP9rSyOqZm5MkBe8nqyVonjj3 WNRWfpmXFYzHgTBrBwPHYpCnvmNCwlQu2X75qwQtbx+zG0Q9/JB7tDrVKcndAvxso7lSb/ S0u8BuafDSFSR6ojoqCor+R8WpHzUTmf4jQy+3CHrHM+XjbGZ/VLvE9b1Eiv8520xriETy GG4R5myO/9tENUvjBQPu5NxLwkbnbX5P/lILZLFDDQVXm1scxMDzWnEoSB71Pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776447305; 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=rU+Msi8Qf0PTRg1bZ4iIJ+Ms1G9Xs86YFYg1ZQxmR/Y=; b=diIcQHqrDt/Q96ZUYuAx7pAIJVlS22ACiJz3phIyFmcjXnihhJ5FRxkwPsolp4SdxYEDpi t7309FCZ7Ks6WVQuz3syaFJtJGf+4XikchQFslVtNEgfP4wz45C7JYZ31wjOUVEoHULQSO cTq9VCXgWHyhiWU7jGxaaedQwCHc0eObEYF8R0IVYDYQI/PpUt6zaRRU6/jCsc5x6dj1dt 5QvzJhINe1UEfawy29ADeFki3pZnVvoj5d/bydO0fYi+bxG2aaRuKoBZJeJmgIpsTs2eyK BMcZKly9TYX0d9Zu7JooXkIlleF7ivCdUjZYNoxSuc10r78qzQRsfm/igYVABA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy2894w8Jz13P1 for ; Fri, 17 Apr 2026 17:35:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 329ea by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 17:35:05 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 52e7958702be - main - iflib: ignore reclaim coalescing when low on tx descriptors List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52e7958702be469a61a5e3173c20a08fc0721b4d Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 17:35:05 +0000 Message-Id: <69e26f49.329ea.298f2de3@gitrepo.freebsd.org> The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=52e7958702be469a61a5e3173c20a08fc0721b4d commit 52e7958702be469a61a5e3173c20a08fc0721b4d Author: Andrew Gallatin AuthorDate: 2026-04-17 15:52:36 +0000 Commit: Andrew Gallatin CommitDate: 2026-04-17 17:34:27 +0000 iflib: ignore reclaim coalescing when low on tx descriptors If we are low on TX descriptors, bypass iflib_txq_can_reclaim() and force a reclaim. This is intended to reduce the number of output drops under heavy load when using simple transmit. Differential Revision: https://reviews.freebsd.org/D56339 Sponsored by: Netflix --- sys/net/iflib.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index b58544255efd..085b69b62553 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -703,6 +703,7 @@ static struct mbuf *iflib_fixup_rx(struct mbuf *m); #endif static __inline int iflib_completed_tx_reclaim(iflib_txq_t txq, struct mbuf **m_defer); +static __inline void iflib_completed_tx_reclaim_force(iflib_txq_t txq); static SLIST_HEAD(cpu_offset_list, cpu_offset) cpu_offsets = SLIST_HEAD_INITIALIZER(cpu_offsets); @@ -3600,7 +3601,7 @@ defrag: * cxgb */ if (__predict_false(nsegs > TXQ_AVAIL(txq))) { - (void)iflib_completed_tx_reclaim(txq, NULL); + iflib_completed_tx_reclaim_force(txq); if (__predict_false(nsegs > TXQ_AVAIL(txq))) { txq->ift_no_desc_avail++; bus_dmamap_unload(buf_tag, map); @@ -3789,6 +3790,20 @@ iflib_completed_tx_reclaim(iflib_txq_t txq, struct mbuf **m_defer) return (reclaim); } +/* + * Reclaim any transmit descriptors possible, ignoring coalescing + */ +static __inline void +iflib_completed_tx_reclaim_force(iflib_txq_t txq) +{ + int reclaim; + + iflib_tx_credits_update(txq->ift_ctx, txq); + reclaim = DESC_RECLAIMABLE(txq); + if (reclaim != 0) + _iflib_completed_tx_reclaim(txq, NULL, reclaim); +} + static struct mbuf ** _ring_peek_one(struct ifmp_ring *r, int cidx, int offset, int remaining) { From nobody Fri Apr 17 17:35:06 2026 X-Original-To: dev-commits-src-main@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 4fy28C2Kb3z6WkHb for ; Fri, 17 Apr 2026 17:35:07 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy28C0BFBz3n4R for ; Fri, 17 Apr 2026 17:35:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776447307; 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=OiotUL01o6TUVbCHwqx9u0kM2RlfsxGXOQutOl197tg=; b=nCctOI4mjYhRLtN/jDo9bpq0mdB3iOpSMDXowoiW+qSATFHlRMN8gfF5dqiytt7Ch/lAxy 0Yp6p3pMpUWyTBmEN7XV+kQ3FIK13uCgQ0WaV3lGHRQDoYipAybhG60ivBFqjkkp0ZCaC3 9JuT++hw/B3CTSUuRSSmwdaQMPy+qb1vG5eaV2aYkYrwtuEb8mVnyGnw8uS/k0LMTpCoxF rLlMPmTZ9Vtncz/99SgHx91loefKpKwXTiFhZjl5s7pUHcdwd3spRIXDlQF+OCuftvXo1D WjiL52wHiNBBVZN9BskUIl4HqHG5STMYQ9t6gdREJWI9ZTJ+MDkfd1qLJruHaw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776447307; a=rsa-sha256; cv=none; b=kpONUJr9Qr07KySl9PfQhgkIyOQhLWZzx6xLEcKSC3/pOJumhO/8KR/ZKXbe8r/LtK7ByC Gtc9C09z6pUlYToSG9uoaj3GH4Ow2LqrL7pEpZIjzBxqS9ghF07Bml84VdEHJ4ai/SRRgV rHiG66mLO2a4ARjDzrw/2qRWEquI4/cqr2eTz2gFj6MTfSIWkGulbK2Fhv+7jMjw8V6MRg 3YT0aOVsIBoh/cHkP+6R6YQzNZhepixISGLOT9MFmBXfhoHStzQMtiiGMwmi92dkE6iuB9 vK3pqkpShbmnGY6/zxcAFRju3pDNYwGZnsIgCEVyaQ66f4iKpSjZhnrlBH0u6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776447307; 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=OiotUL01o6TUVbCHwqx9u0kM2RlfsxGXOQutOl197tg=; b=shSXipKw+UPGigfde/jVbO+KABHB6cnvDnkZqpUZvGZcIMqeNYqkGYPC4T23mu8bSysLzF pCCIquOq2aO/taFtu7o3seruh282VihvWGz13ww7hQAioKAR9jcRAsP4VglQfLFKi5fsc5 Qouigdy7CaOrmn+WUEZZbpZO9GWJ+hB5jn6y6vMy0s18+FFtAbplGSdsZGTEhxZg4JPBU3 zxJ0GuRKUBBg8daUCwoZglLkS5R5fX/WKWTzoDY6wmyrzFXg0WpXyOldcE8O4HPS8fzzzt K2+UvFQvMyOw7azeeJ+VNWW+7cEYGfJfXmL5Fn2J6o9D4Ru621GnJDb3kO+Zkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy28B64JJz13gS for ; Fri, 17 Apr 2026 17:35:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 346e1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 17:35:06 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 3fade68cfdf9 - main - iflib: accurately count bytes/segments for TSO List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3fade68cfdf95ee0b517b5d69b270bd8da633404 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 17:35:06 +0000 Message-Id: <69e26f4a.346e1.31c510c2@gitrepo.freebsd.org> The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=3fade68cfdf95ee0b517b5d69b270bd8da633404 commit 3fade68cfdf95ee0b517b5d69b270bd8da633404 Author: Andrew Gallatin AuthorDate: 2026-04-17 15:45:22 +0000 Commit: Andrew Gallatin CommitDate: 2026-04-17 17:34:27 +0000 iflib: accurately count bytes/segments for TSO When using software based ifnet counters, iflib has not factored TSO into account when reporting the segments and bytes sent. So it will underreport NIC bandwidth by a small percent, and will undercount sent segments by a large factor. Fix this by calculating the number of added segments the NIC will send, and add header size multiplied by that number to arrive at a correct accounting of segments and bytes sent. This makes these software counters directly comparable to hardware counters. Doing this requires moving the calculation into iflib_encap() where we have already parsed the packet and know the header size, MSS, etc. Differential Revision: https://reviews.freebsd.org/D56338 Sponsored by: Netflix --- sys/net/iflib.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 085b69b62553..1fd8d57f4ee9 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -3478,7 +3478,7 @@ iflib_ether_pad(device_t dev, struct mbuf **m_head, uint16_t min_frame_size) } static int -iflib_encap(iflib_txq_t txq, struct mbuf **m_headp) +iflib_encap(iflib_txq_t txq, struct mbuf **m_headp, int *obytes, int *opkts) { if_ctx_t ctx; if_shared_ctx_t sctx; @@ -3663,6 +3663,20 @@ defrag: */ txq->ift_pidx = pi.ipi_new_pidx; txq->ift_npending += pi.ipi_ndescs; + + /* + * Update packets / bytes sent + */ + if (flags & IFLIB_TSO) { + int hlen = pi.ipi_ehdrlen + pi.ipi_ip_hlen + pi.ipi_tcp_hlen; + int tsolen = pi.ipi_len - hlen; + int nsegs = (tsolen + pi.ipi_tso_segsz - 1) / pi.ipi_tso_segsz; + *obytes += tsolen + nsegs * hlen; + *opkts += nsegs; + } else { + *obytes += pi.ipi_len; + *opkts += 1; + } } else { *m_headp = m_head = iflib_remove_mbuf(txq); if (err == EFBIG) { @@ -3918,7 +3932,7 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx) skipped++; continue; } - err = iflib_encap(txq, mp); + err = iflib_encap(txq, mp, &bytes_sent, &pkt_sent); if (__predict_false(err)) { /* no room - bail out */ if (err == ENOBUFS) @@ -3927,10 +3941,8 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx) /* we can't send this packet - skip it */ continue; } - pkt_sent++; m = *mp; DBG_COUNTER_INC(tx_sent); - bytes_sent += m->m_pkthdr.len; mcast_sent += !!(m->m_flags & M_MCAST); if (__predict_false(!(if_getdrvflags(ifp) & IFF_DRV_RUNNING))) @@ -7136,6 +7148,8 @@ iflib_debugnet_transmit(if_t ifp, struct mbuf *m) if_ctx_t ctx; iflib_txq_t txq; int error; + int bytes_sent = 0; + int pkt_sent = 0; ctx = if_getsoftc(ifp); if ((if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != @@ -7143,7 +7157,7 @@ iflib_debugnet_transmit(if_t ifp, struct mbuf *m) return (EBUSY); txq = &ctx->ifc_txqs[0]; - error = iflib_encap(txq, &m); + error = iflib_encap(txq, &m, &bytes_sent, &pkt_sent); if (error == 0) (void)iflib_txd_db_check(txq, true); return (error); @@ -7209,10 +7223,8 @@ iflib_simple_transmit(if_t ifp, struct mbuf *m) txq = iflib_simple_select_queue(ctx, m); mtx_lock(&txq->ift_mtx); - error = iflib_encap(txq, &m); + error = iflib_encap(txq, &m, &bytes_sent, &pkt_sent); if (error == 0) { - pkt_sent++; - bytes_sent += m->m_pkthdr.len; mcast_sent += !!(m->m_flags & M_MCAST); (void)iflib_txd_db_check(txq, true); } else { From nobody Fri Apr 17 18:21:56 2026 X-Original-To: dev-commits-src-main@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 4fy3BD55VCz6WpD0 for ; Fri, 17 Apr 2026 18:21:56 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy3BD4FbSz3vWp for ; Fri, 17 Apr 2026 18:21:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776450116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CCje9gkiyScVtqrF+pfbfCL9SzmZ7KNrH+JvwGefRzI=; b=kdFWJAkG7ayBqhBeV1ZJlQzFJk6LXVEUV139l71YS1aCU6ZXzmIS5Dak9JcUK7+wQRzIsA 8dulCNcALK4lADqIrk16PIW+ZhDxpenPjYnCc+T9NgPC5LiAAmWskxZoGMnYfJeTxdRlD1 AaUeRQ/YXSdEIZL2+hG4uPZc5QQ0xfgbEofpyVV0v7INlNBUakxnF0LZffPo45oN3Gjkij r8NRl/qccO7Febi9byX7JgaTXY2A1JqGyqrB+O0QzYzVZWibz5JIamO2IL3gqCp5bibwzO 6Zxk//WMqJTUa6VZpbkgruBhLBgna9Ylt7hZrNkQH1hJqtrJR7rFxnRTW4e7rA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776450116; a=rsa-sha256; cv=none; b=O1NfGUr/7wSuJ82VhKrRQBH5qi+TUjv5GnbXZ7hfKf+1xfpf2MBcaUSja+ZjiPbTSKvAuG dfkaMBEF4FWIgQIA0Vb3oD54j0C7TPOBS+haetPYYe7oHkkZu+0k9LA5Sms15kDNI2HH9x anmKpvvBsiKKXzJPZN6X4T1exoa88AFbSaiuv3IpwGUv+sk+ym5vxjAkBOn7oX/ZKG+KOK rZBYnOKiB5ipvpdHrNwTwfSbm1tlEmA8DBAhmZ4XZLhiozJrXfv6qJSD4oxfFq7XSnHqER GX6ni7cRnUnGgGe2EQDS2WbO6XNLm2b73n4h9E1dTZSeZu2sQp9vTwj/ghyJVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776450116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CCje9gkiyScVtqrF+pfbfCL9SzmZ7KNrH+JvwGefRzI=; b=HJiJ7/nrN3dr+++TIj1YZt6n4aKRwmSWdw0EOOq/s15JSG0MkmqsDeg606El80M1aDcGlo MB3Hj6F6qu7ptZIq9YRfcXTaZkEqfbnCeozN5efCodNwe/V16hH3cNMsh0RE4htUQ6loh2 amXB8o6YRnr+idC3vk7KGZ+ZgyQ6de4eVHAv0sMgXsSa9Uvvo1yitef4mFF8gRKEuHBWuu RFVUk9zI+FoB7il7/Sk+O2Emja6IiS7aV9n/AWa9TmEMOEm3ITEJG4ON4BOnjaURKr4KUE +2oIdcn0fNmKQ9O9k5ETcMap7CouXh4C181FzkBI1Q0np0kPYYf2aj4NXvSqnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy3BD3GLLz14tY for ; Fri, 17 Apr 2026 18:21:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3af4e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 18:21:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Christos Longros From: Jose Luis Duran Subject: git: 9a4a9f623bba - main - ping6: treat setsockopt failures as fatal List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jlduran X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a4a9f623bbaf991b3ba580593d47f2ee9f7b03b Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 18:21:56 +0000 Message-Id: <69e27a44.3af4e.6e191bfa@gitrepo.freebsd.org> The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=9a4a9f623bbaf991b3ba580593d47f2ee9f7b03b commit 9a4a9f623bbaf991b3ba580593d47f2ee9f7b03b Author: Christos Longros AuthorDate: 2026-04-17 18:19:24 +0000 Commit: Jose Luis Duran CommitDate: 2026-04-17 18:19:39 +0000 ping6: treat setsockopt failures as fatal ping6 needs IPV6_RECVPKTINFO and IPV6_RECVHOPLIMIT to process incoming replies. When these options fail, replies are silently dropped and ping6 appears to hang. Use err(3) instead of warn(3) so the user gets a clear error and immediate exit. Signed-off-by: Christos Longros Reviewed by: pouria, jlduran, glebius MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56237 --- sbin/ping/ping6.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sbin/ping/ping6.c b/sbin/ping/ping6.c index 356f0f72a6f8..f81de062e59a 100644 --- a/sbin/ping/ping6.c +++ b/sbin/ping/ping6.c @@ -1083,21 +1083,21 @@ ping6(int argc, char *argv[]) #ifdef IPV6_RECVPKTINFO if (setsockopt(srecv, IPPROTO_IPV6, IPV6_RECVPKTINFO, &optval, sizeof(optval)) < 0) - warn("setsockopt(IPV6_RECVPKTINFO)"); /* XXX err? */ + err(1, "setsockopt(IPV6_RECVPKTINFO)"); #else /* old adv. API */ if (setsockopt(srecv, IPPROTO_IPV6, IPV6_PKTINFO, &optval, sizeof(optval)) < 0) - warn("setsockopt(IPV6_PKTINFO)"); /* XXX err? */ + err(1, "setsockopt(IPV6_PKTINFO)"); #endif #endif /* USE_SIN6_SCOPE_ID */ #ifdef IPV6_RECVHOPLIMIT if (setsockopt(srecv, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &optval, sizeof(optval)) < 0) - warn("setsockopt(IPV6_RECVHOPLIMIT)"); /* XXX err? */ + err(1, "setsockopt(IPV6_RECVHOPLIMIT)"); #else /* old adv. API */ if (setsockopt(srecv, IPPROTO_IPV6, IPV6_HOPLIMIT, &optval, sizeof(optval)) < 0) - warn("setsockopt(IPV6_HOPLIMIT)"); /* XXX err? */ + err(1, "setsockopt(IPV6_HOPLIMIT)"); #endif cap_rights_clear(&rights_srecv, CAP_SETSOCKOPT); From nobody Fri Apr 17 18:33:11 2026 X-Original-To: dev-commits-src-main@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 4fy3RC5lcrz6Wq5g for ; Fri, 17 Apr 2026 18:33:11 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy3RC56bfz3wHg for ; Fri, 17 Apr 2026 18:33:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776450791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YsbeXnxmLoqI5pn6i3zZLCcLphyMJ3NLqxaTotI5T2Q=; b=RxG/XsYsRuPTNy5iNUiPyxLlhs9k8F4yOtwrN0z/eaCb5r5Rn0ebsSbXKcKtQHZAtjyQt+ 4//nipGPOLAABqY0tpk/PdCKCo6+/fMVRjW32yyy58Do+sy8+yqWZvOYr8Gsu6RpRBWPzk kA/JWLhdjWGdTfg9NxOCVyfhf9tRDObK71yqLr5+wJO5tYInrflAGnnTUiTHQhlO/FEr77 pkcz456WBNAL0OYZ7xVEAVQ3UaGD9fXEuZVnPaL2QMcKL6regh126av4KfjW2xx7L+JblB 9w9jS/lAYOMk5shV/jvRpq6cHgpjWPr3yEn1j0BVYsOn0NqhXzM+RQEHWmjDYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776450791; a=rsa-sha256; cv=none; b=t6vLmnXLbbx3v2OyDES0iWb4PVdi2rkqMPawvU1HfqumxPGmkQhREcTElR/eP18MzDKRNd +fcu4FrT/RICI1v0Vi2VxtHukx8rLg/pa+lhWrA+Fji19fE+5klAYhqfo/srm6kjNN8eXJ gVTeaHIe8MYWlt8nC1rDWSyW6aNREE9y5RL2gl/WFTsKjG2a7jA3B8KV65yWNctvlfCBR7 DuQ7dm0BNqPJGQDnufOe3N41hvXgMlKnaTF00B5v/so69aGDRnODU9BjTYl8m87lpQnNv+ VdCOQIojyiVM5nuUmMgH21hR71pFKM4ZrLpwcS0cqvgfikcNVtVB3cC99UP7ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776450791; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YsbeXnxmLoqI5pn6i3zZLCcLphyMJ3NLqxaTotI5T2Q=; b=a71PmmDougPqeo7enSB2tfcwACMP4vI+azWDllwcTsnG2fhkU6M2gK+o8xqsECm+WaaXKu sHitG4fPz6KR+r3i3PQU5ZNwrDpuq1Pa5r0OyfVLSJzw+l4KVXySvV7ULsAF5Wb/ugrlhR JMd1ZyUAxtUOWfjVPuHkbO0zO8zvb2RkQ3CFv9stqPvAcT0keeKj17oIGCXbjTor5B+pry 4shaLc4p+ei0uRq5E4s6MngBjldNJ4sr2lMMliv1VdeJqY3l5mpOTFPN/lqk/dw9nBYLRp jM8z7r0lyVAEpEY/GFnXRTGhij2W1ry7AaBij0gCJtZCiZv7s+hczMz5mtdK4A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy3RC4fF3z15FC for ; Fri, 17 Apr 2026 18:33:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ccf6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 18:33:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Christos Longros From: Gleb Smirnoff Subject: git: d9e7dd4a19b8 - main - carp: define CARP_AUTHLEN for carp_authlen field List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: d9e7dd4a19b81a78a801973f8f5231f46a6d20b8 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 18:33:11 +0000 Message-Id: <69e27ce7.3ccf6.6d4c9395@gitrepo.freebsd.org> The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=d9e7dd4a19b81a78a801973f8f5231f46a6d20b8 commit d9e7dd4a19b81a78a801973f8f5231f46a6d20b8 Author: Christos Longros AuthorDate: 2026-04-17 18:32:01 +0000 Commit: Gleb Smirnoff CommitDate: 2026-04-17 18:32:01 +0000 carp: define CARP_AUTHLEN for carp_authlen field Replace the bare 7 with a named constant. --- sys/netinet/ip_carp.c | 2 +- sys/netinet/ip_carp.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 32823c6c4a87..9a97c1a19525 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1216,7 +1216,7 @@ carp_send_ad_locked(struct carp_softc *sc) ch.carp_vhid = sc->sc_vhid; ch.carp_advbase = sc->sc_advbase; ch.carp_advskew = advskew; - ch.carp_authlen = 7; /* XXX DEFINE */ + ch.carp_authlen = CARP_AUTHLEN; ch.carp_pad1 = 0; /* must be zero */ ch.carp_cksum = 0; diff --git a/sys/netinet/ip_carp.h b/sys/netinet/ip_carp.h index 8d82286feb7d..97040403b41e 100644 --- a/sys/netinet/ip_carp.h +++ b/sys/netinet/ip_carp.h @@ -80,6 +80,12 @@ struct carp_header { CTASSERT(sizeof(struct carp_header) == 36); +/* + * CARP authentication length in 32-bit chunks: + * counter[2] (8 bytes) + SHA1 HMAC (20 bytes) = 28 bytes = 7 chunks. + */ +#define CARP_AUTHLEN 7 + /* * The VRRPv3 header layout is as follows: * See RFC9568, 5.1. VRRP Packet Format From nobody Fri Apr 17 18:35:24 2026 X-Original-To: dev-commits-src-main@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 4fy3Tq5Ccvz6Wpl3; Fri, 17 Apr 2026 18:35:27 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy3Tq4bDDz3wvn; Fri, 17 Apr 2026 18:35:27 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776450927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tRQ/3NoZzmLuJajBAiisbKcRqbnyfHEO6yp1avYHric=; b=ZCT6dw9swASlpBw5wfCXhx1Ot789HjvJXovDBnZkqr/Mt1A3YP9Ro8xr3VbHuL+QIj7PWx 3xE5ileSAQsEKWj2PM5rmD2meiMg6vsmn/T9plPOuqE316hCld1XY+3RUYcKQPZJM04e8Q s+tCXgY2qvH4rGj2MX6dp7k8W73Jak3EMzYjjNcPYbj6/tmNdtoxPk9H3z/3jEVWp1bUbw jwjTfuitovuhwtJ8hXjFqAVOSuftzbVDKLOloRQpAee1BHO/0nIQ1ShpoPt+ath1tzyZtj 1Nefj53m75oZvrrOImSg6JIhLR8jy9Z4Rk+bslUwySJEsBOTPWfVIMEEdtCOOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776450927; a=rsa-sha256; cv=none; b=yLwQybFF8+rfGi5JRFRh+3LsLW5O+Sr6luAoZdrIiFTii513d8HaeeMDjURvXNAHrCbPa2 c2RlxHuAKcyaSXUx9bOdqDUkEGe4BMWzyWFUWWDweIZhY51wIIXw1H5ashZ/I2PTbbMMXi d63dC2oedjFT1bSIj8hPXvGNGuGAFSQ7s4cdKAR+WHLTMm+gIy2FEDvJ1zyRNTXQxgB6kC qJiKfVDuETYGr+qxVXeL+xhmVg9GhBg3+qErMM1wQOo4V6F7F6JX4ljnW42WLUA9M07DaF 41NmzfLjU37IhJWf7FSVBYJBN9jbC6Rp+5sHCQw5sVct2k+ui2EVWz6POiiGKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776450927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tRQ/3NoZzmLuJajBAiisbKcRqbnyfHEO6yp1avYHric=; b=Ke1IJ4zx5BSDYOYIcKDD9LEmzYDDwVra6wAbtMVjlCAm6MBvVY1Zs9VGChrPdfE53ggaXu BvAr3lYt/4fxHfwSxeLHciPwv2TDYsxCGrG85bnqt+7GpU4Qo0VRKzeEmLwfvEWdEg7NPA v2bpGh+FugOiVikdqE4fPIm9GAunG75QkXr+grZ4ZE+3kyft/egsYjtQ2/NDj/zGhTJ337 ZjWRIlhCTPq5kagS1yijLveeSxsKwgFObS6HhCjC5QDPh1ioc7YpaMa9aWEDDnyapNqWVs VA9HT4Wsg8jqMtnGMItmn4+S+0jM4fL5q6HnTP7NBXoIGPy9zZMZ2ilXXrsBjA== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fy3Tp5kRdzynq; Fri, 17 Apr 2026 18:35:26 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Fri, 17 Apr 2026 11:35:24 -0700 From: Gleb Smirnoff To: Adrian Chadd Cc: Siva Mahadevan , Mark Johnston , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, owner-src-committers@freebsd.org Subject: Re: git: 9b76228006d8 - main - inpcb: retire inp_vnet Message-ID: References: <69de65eb.21a5c.61244c2a@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Apr 17, 2026 at 09:59:31AM -0700, Adrian Chadd wrote: A> Ok, @Gleb Smirnoff Do you mind reverting it until a more comprehensive A> fix is available? Nope. The test is incorrect. Li-Wen has a fix and hopefull will commit soon. It is impossible to create an inpcb without inp_socket in the kernel, unless you use special kernel module called ktest. -- Gleb Smirnoff From nobody Fri Apr 17 18:52:17 2026 X-Original-To: dev-commits-src-main@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 4fy3sJ4mJKz6Ws0x; Fri, 17 Apr 2026 18:52:20 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy3sJ48MNz40MM; Fri, 17 Apr 2026 18:52:20 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776451940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7o+YOoe5l0qqOM1p6Pv0I9amj4iVc+mQuCNc8b111yI=; b=eWEH+sAWwJBt5mDAm06UcCmzy5s/o/7L7fdGYTGwlh9ID647AKaUy7689KFtgbMctg1+RQ 0R5WsRelo1c84MBF6F6N5EZbniqDm97KgqLaXOBkTItytlx0P/v/L+ujj/AUJLisiYU+37 AKmDXqABFebAM3Mz3YTfr0AIzKf81AjiBztCjZpkZX62tJLEEBk+hZL/AvkMggbuWsVU0Z xc7kufWPKgEXG+8h1tHS6YvLOuMOAfYJDKIVGwB0O+2S7/wMdstNZb3lfDaWuSDBCgUSjt oWXi7P9fLR2jMmFgm8nhpiUZbtSlcNyxWpx4RO3vqwCH566ns6J3Q9RIp2OFKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776451940; a=rsa-sha256; cv=none; b=hM8CDMmuCLwZExbpefLxW2W3I3pkyNUqe/3jEeDF0Iank2FP4w4RexJ3ydft2S+h02VyHU QdkYORcc7TWFl5hatd57Q1CWWM+dcY8+zvJ3ttMiPz4zQX47Ba+L9Dlnt7Zps75sE48WLN BiohZXKchgLRKdhVt8yMFTdX0vhDUgaxHVd+YBIUL3ZsUFVcMiNLj32dVHL3Dl11YEekzH AWPCMSkD2M3QPjblLpP4cD+JBYhs3PiEc1bHlTckPHCih5oGXKxni52M8ZiItxAO3rkzYt 41fcNQgIUQKJDMv0OTcOD3IifRrns3mpv/OxnOHDlQyI85CqnUM40fJyf9Qm6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776451940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7o+YOoe5l0qqOM1p6Pv0I9amj4iVc+mQuCNc8b111yI=; b=Ve2iErkuTMTZxk5svr4k0TbsGfOsnrUiFLOHXTa3BwzNf0LWU/gZqDwA3Bf+deL/C+FOUD i9LiDavxPcd3rcWmTjIh5B+3jY4ThaF3SiYgHDSCgNqlr9Nl4Y/0SjaTnszlsglhthjFtB dXt92Jj42+RevkYCFGL329Rf4JdMRCGj2eNhzjB3wWdUHQIAG3MwIwBE/CpJqgsW+9iUpA 3zA2xbk10Zc4SWjM8IB0gWcX+vB0ESEgp9bkqHvo2+r0L/E0sDn+F9ojVJXui23hkqz7+J 0+fkos8P5eeqPJybjfJhn51yca8Gq9MEX8/20SVK/YyHLbDpsnRyp0BH4WKYtw== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (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) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fy3sH6c19z10nV; Fri, 17 Apr 2026 18:52:19 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Fri, 17 Apr 2026 11:52:17 -0700 From: Gleb Smirnoff To: Kristof Provost Cc: Pouria Mousavizadeh Tehrani , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 688e289ee904 - main - ifconfig: Add support for geneve (netlink) Message-ID: References: <69dcfad9.46b23.7e93103@gitrepo.freebsd.org> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Apr 17, 2026 at 12:21:51AM +0200, Kristof Provost wrote: K> On 13 Apr 2026, at 16:16, Pouria Mousavizadeh Tehrani wrote: K> > The branch main has been updated by pouria: K> > K> > URL: https://cgit.FreeBSD.org/src/commit/?id=688e289ee904fe625d92f93680a71753d03ba2ee K> > K> > commit 688e289ee904fe625d92f93680a71753d03ba2ee K> > Author: Pouria Mousavizadeh Tehrani K> > AuthorDate: 2026-04-11 18:38:41 +0000 K> > Commit: Pouria Mousavizadeh Tehrani K> > CommitDate: 2026-04-13 14:15:01 +0000 K> > K> > ifconfig: Add support for geneve (netlink) K> > K> > This implementation is netlink only K> > K> > Differential Revision: https://reviews.freebsd.org/D55184 K> K> This fails to build if WITHOUT_NETLINK_SUPPORT=yes is set. I'm afraid we are going to have more of that in the near future. What about dropping WITHOUT_NETLINK_SUPPORT=yes from 16.0-CURRENT? -- Gleb Smirnoff From nobody Fri Apr 17 18:55:56 2026 X-Original-To: dev-commits-src-main@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 4fy3xl3J8Yz6Ws37; Fri, 17 Apr 2026 18:56:11 +0000 (UTC) (envelope-from pouria@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy3xl2VgVz40gV; Fri, 17 Apr 2026 18:56:11 +0000 (UTC) (envelope-from pouria@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776452171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3K51+l7KB49ncMjcQkqeAEvWR+EtbYbXC9y06v7yysM=; b=pPXSGz6blMEaW496AqJX/MO6SuJkDZ54rUBFGMf33h9j5wY6Pt4bSkXxx3Uj0RwIZYUiEc Ywj2FZ84+BkzBPTHNvZi6ZmhMBZCVDueyrgRBkfGm8kONNZFC0Ju8E0VLAag5pksL0X2eG vdx8GMRM9c9NwVkHZZ0zi2C+N1AtqPohj1BNTXYN2NqqEM+PqxgBYbsnJaurQezWUlgEB9 YpuM8Gc944t5AOPpQ7C1hH5skC5uuzpMiOPD1Mm3Fli4aQ+WR8jw9Jk/YlnixgtAAUp4Ru WjkT2DKbyUyZGMzDX26DhDweSWMjb8gZaFnkQqOePaOZxTWRxRc7CoJz3lOjjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776452171; a=rsa-sha256; cv=none; b=U18VbbAVJ0uEirAhUaLE0OjERIUZD/NhEwZRwt0CY4OlnZPuJIkcPIiAXY1Urk8yJSwLHI UJwUCnkcwSIdnILdtYUwHWLNYeDv3P/w5nfrdxlpCj3q9Q2JY8SFuweP5/xnLDrbkCIU+o oI/tbmeb3WCb4vk0S6nhejWueptW4mgyr0nK00x1ILFV2S02WkKTb/QbS3vzv0wt047ZeV h2MthpqV32/X0kZQ5FBhdHb7mqrBpAQn2yaXCZSMf5KVqNR7FdJZFmzpk8xrivad08fz1e HCsQ2s56Exg9L3dzWZPOpxxhS/deJA9EWhfi2LoSs5XiazgFJcYIoBsVc+axrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776452171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3K51+l7KB49ncMjcQkqeAEvWR+EtbYbXC9y06v7yysM=; b=Ktp0sI2YXe+9ZNyjJ2XkaaOgZJrKKDmnGm2+mfIA9KaJ9N+F+Nq51ETslfWuATGbOjxlcv Bi7ikyRI4JxielWlYISTz9gfT4C1rwBs2TJs/o9l34kRUQ1J90Y+xigRuhtOG+bUxi84cs F5BL2jJGEem7iNdRPrg19rMYb+n7O9QzdzNfT3DVAYzXuYp/eAxu51h7NgdrACoYTqCDSO L819Yht8NkP3+c+6X7K7LL+Sa+JoOgITDQra8Md4STh4qDH8XRzQlW5l1mYSRgiaPhO2eB FCmegq42NK9MlSCxAczdn9Rj91vEJ801387in/Ujl0EBfP6DATCSqzylXqii/Q== Received: from nl.mail.spmzt.net (unknown [IPv6:2a01:e140:12:1::25]) (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) (Authenticated sender: pouria) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fy3xk4lv3z10nW; Fri, 17 Apr 2026 18:56:10 +0000 (UTC) (envelope-from pouria@FreeBSD.org) Received: by nl.mail.spmzt.net (OpenSMTPD) with ESMTPSA id ecf02414 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 17 Apr 2026 23:25:51 +0430 (+0430) Message-ID: <47d6f65b-710a-4ed3-ac72-8d96e393f1eb@FreeBSD.org> Date: Fri, 17 Apr 2026 22:25:56 +0330 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 688e289ee904 - main - ifconfig: Add support for geneve (netlink) To: Gleb Smirnoff Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Kristof Provost References: <69dcfad9.46b23.7e93103@gitrepo.freebsd.org> Content-Language: en-US, fa-IR From: Pouria Mousavizadeh Tehrani In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------0jwzitq3t4Dc04OYD9MrlOBs" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------0jwzitq3t4Dc04OYD9MrlOBs Content-Type: multipart/mixed; boundary="------------t2mBjHqUEDeUTjijhLFlbgWB"; protected-headers="v1" Message-ID: <47d6f65b-710a-4ed3-ac72-8d96e393f1eb@FreeBSD.org> Date: Fri, 17 Apr 2026 22:25:56 +0330 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 688e289ee904 - main - ifconfig: Add support for geneve (netlink) To: Gleb Smirnoff Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org, Kristof Provost References: <69dcfad9.46b23.7e93103@gitrepo.freebsd.org> Content-Language: en-US, fa-IR From: Pouria Mousavizadeh Tehrani In-Reply-To: Autocrypt-Gossip: addr=glebius@freebsd.org; keydata= xjMEZOhRoRYJKwYBBAHaRw8BAQdAWBrA6etXy+BrVw11ixY/+IPIwPauz6iNDSiP+CHFaZ3N I0dsZWIgU21pcm5vZmYgPGdsZWJpdXNARnJlZUJTRC5vcmc+wpkEExYKAEECGwMFCRLP94AF CwkIBwMFFQoJCAsFFgIDAQACHgUCF4AWIQT+rgtjiRzq3LbQ3Nn+/1jAXQXMIgUCZmHoyAIZ AQAKCRD+/1jAXQXMIribAQDmJdWHR+9ubGk0zo6enMn0QurNVBQbUJJoSsLXfIjuPgEAkt8Y klyuuMqNHmBD+Fu6BimBmXaR7aGEmxLscuZjYgLOOARk6FGhEgorBgEEAZdVAQUBAQdAMGvM cQRTnusEbYEj+kE4NzFzldYXBUG3FC6GUP7vzBoDAQgHwn4EGBYKACYWIQT+rgtjiRzq3LbQ 3Nn+/1jAXQXMIgUCZOhRoQIbDAUJEs/3gAAKCRD+/1jAXQXMIngNAP9xgOdyhVwMUmCvyveG 5QB7ys/1qT0XJMR20EffmCvvfgEAgcpP9+LnHvgT5dTjQc9xrlclMv95JaX0UiNR8ek49Ak= --------------t2mBjHqUEDeUTjijhLFlbgWB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: base64 T24gNC8xNy8yNiAyMjoyMiwgR2xlYiBTbWlybm9mZiB3cm90ZToNCj4gT24gRnJpLCBBcHIg MTcsIDIwMjYgYXQgMTI6MjE6NTFBTSArMDIwMCwgS3Jpc3RvZiBQcm92b3N0IHdyb3RlOg0K PiBLPiBPbiAxMyBBcHIgMjAyNiwgYXQgMTY6MTYsIFBvdXJpYSBNb3VzYXZpemFkZWggVGVo cmFuaSB3cm90ZToNCj4gSz4gPiBUaGUgYnJhbmNoIG1haW4gaGFzIGJlZW4gdXBkYXRlZCBi eSBwb3VyaWE6DQo+IEs+ID4NCj4gSz4gPiBVUkw6IGh0dHBzOi8vY2dpdC5GcmVlQlNELm9y Zy9zcmMvY29tbWl0Lz9pZD02ODhlMjg5ZWU5MDRmZTYyNWQ5MmY5MzY4MGE3MTc1M2QwM2Jh MmVlDQo+IEs+ID4NCj4gSz4gPiBjb21taXQgNjg4ZTI4OWVlOTA0ZmU2MjVkOTJmOTM2ODBh NzE3NTNkMDNiYTJlZQ0KPiBLPiA+IEF1dGhvcjogICAgIFBvdXJpYSBNb3VzYXZpemFkZWgg VGVocmFuaSA8cG91cmlhQEZyZWVCU0Qub3JnPg0KPiBLPiA+IEF1dGhvckRhdGU6IDIwMjYt MDQtMTEgMTg6Mzg6NDEgKzAwMDANCj4gSz4gPiBDb21taXQ6ICAgICBQb3VyaWEgTW91c2F2 aXphZGVoIFRlaHJhbmkgPHBvdXJpYUBGcmVlQlNELm9yZz4NCj4gSz4gPiBDb21taXREYXRl OiAyMDI2LTA0LTEzIDE0OjE1OjAxICswMDAwDQo+IEs+ID4NCj4gSz4gPiAgICAgaWZjb25m aWc6IEFkZCBzdXBwb3J0IGZvciBnZW5ldmUgKG5ldGxpbmspDQo+IEs+ID4NCj4gSz4gPiAg ICAgVGhpcyBpbXBsZW1lbnRhdGlvbiBpcyBuZXRsaW5rIG9ubHkNCj4gSz4gPg0KPiBLPiA+ ICAgICBEaWZmZXJlbnRpYWwgUmV2aXNpb246IGh0dHBzOi8vcmV2aWV3cy5mcmVlYnNkLm9y Zy9ENTUxODQNCj4gSz4NCj4gSz4gVGhpcyBmYWlscyB0byBidWlsZCBpZiBXSVRIT1VUX05F VExJTktfU1VQUE9SVD15ZXMgaXMgc2V0Lg0KPiANCj4gSSdtIGFmcmFpZCB3ZSBhcmUgZ29p bmcgdG8gaGF2ZSBtb3JlIG9mIHRoYXQgaW4gdGhlIG5lYXIgZnV0dXJlLg0KPiANCj4gV2hh dCBhYm91dCBkcm9wcGluZyBXSVRIT1VUX05FVExJTktfU1VQUE9SVD15ZXMgZnJvbSAxNi4w LUNVUlJFTlQ/DQoNCisxDQoNCi0tIA0KUG91cmlhDQo= --------------t2mBjHqUEDeUTjijhLFlbgWB-- --------------0jwzitq3t4Dc04OYD9MrlOBs Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQSqt7cppfvJ816gj0lUwVnUeMwagAUCaeKCPAAKCRBUwVnUeMwa gJ7JAP9C9PcFQPOtgNmTJXyogsVAfvIYbNS/WXLrHsF0KeN/EAEA6ep22uk20Vhw eah5OVxjpQIDnIYWtc8p1ZnTuUxEOwU= =4DBF -----END PGP SIGNATURE----- --------------0jwzitq3t4Dc04OYD9MrlOBs-- From nobody Fri Apr 17 18:58:14 2026 X-Original-To: dev-commits-src-main@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 4fy40T39zVz6WsHq; Fri, 17 Apr 2026 18:58:33 +0000 (UTC) (envelope-from kp@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy40T1r5cz41Q3; Fri, 17 Apr 2026 18:58:33 +0000 (UTC) (envelope-from kp@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776452313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r3ceKAelwiYh1TPNUN1rVy6LLA63jk5h/8OSeHumJHw=; b=hTId8YtcLD5Kl4bpezNMxoyle1+RjOlwXnUu8kZYQyYGkvPmKxdTuxP6S2/SmkoDNK4+NB bo9L+lpT8unmJQ3JkX7Rt1qYbfRt45y/78Yv2OTrAqfJaKYxmnsrugC2reE4Y6DHomwm3N 469JaGU08rmiKclUJY6418RCiOEIbxMZZKKTviM8dNW9Oz58mqGEhzYoe6NoHQQU+Ryz3z qqHqc0xLs1ArmhWNcpQxvh+jSTmQ/9lIK0/FS5gf6tI/Tf2MQw6xczeh3GOd2iEWgEoP9s ar/ElD9jUsWwKvOMEHoZihBrJftiMwe8NBRAEb/ANM5elCmnTEgi6Ek4yqligw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776452313; a=rsa-sha256; cv=none; b=OfTRHJiwuysYU/6ML3BgaPVxnIUvrVCn/hIvuJFlOxyTWsqjMmxPzM8lh3TwkC9rpUHRax In904V4C+qkuZ7RukHICinLXOEqCZ6DJ5v96M8pQfcwpNpuM9NNK/r2QaaSe0/H8d1kxJR 2FXArqADLgsbIc1tyXWbTWd8WoS4vaENf8q131hhTLnbg2EA33BKSWJqspjfveovoVG8rt ox/h4zDLxdOhSzYw18Td39es5HOP27BcZ3YgqhzODKU1I0RHWVfXoe/1jRlSxRez+icV4Q 3SD3nv38yw6KSi/9Dz0qLgl7jZMn7Am1sW4cPVcs341MLqqHu4IWIIQl85Egjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776452313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r3ceKAelwiYh1TPNUN1rVy6LLA63jk5h/8OSeHumJHw=; b=flUFmLAjwyx1t9TakQK9QCJQINvKeMX2PfDOsPmk9rhg0pr7m/rne1Ja1Y95f+dF5bNwhv gkHtXviUE5j/AtPFksRETosXPW0wDCPDUxBKRDdQymMm7Z113FvwOi/09D864l8GI0HNke AtBRV4zZm07QuYHvsSRyR0QJ+wJsC+4duRtL3asJd6LtH3PRpplSa/k9d3V/a4f9Y2GOfS /9Yrbiss1ocMqiDgedp4chY1P7LzdT8w53ZyICOKAD7+2u8+Ig7RYCVD+aL6tPvfy+GnOy 8FLNU1fMvAQ97KIfDhYUksu8FDvtmLsezrU6v6Wt+tSMajiMeZeKmqg+5xPzww== Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (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 (2048 bits) client-digest SHA256) (Client CN "mx1.codepro.be", Issuer "R12" (not verified)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fy40T0V6vz10Hq; Fri, 17 Apr 2026 18:58:33 +0000 (UTC) (envelope-from kp@freebsd.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id E3DD320937; Fri, 17 Apr 2026 20:58:26 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Kristof Provost List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (1.0) Subject: Re: git: 688e289ee904 - main - ifconfig: Add support for geneve (netlink) Date: Fri, 17 Apr 2026 20:58:14 +0200 Message-Id: <856A25FB-45B7-40C2-A11B-90C9437EA6E6@freebsd.org> References: Cc: Pouria Mousavizadeh Tehrani , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org In-Reply-To: To: Gleb Smirnoff X-Mailer: iPhone Mail (23E254) > On 17 Apr 2026, at 20:52, Gleb Smirnoff wrote: >=20 > =EF=BB=BFOn Fri, Apr 17, 2026 at 12:21:51AM +0200, Kristof Provost wrote: > K> On 13 Apr 2026, at 16:16, Pouria Mousavizadeh Tehrani wrote: > K> > The branch main has been updated by pouria: > K> > > K> > URL: https://cgit.FreeBSD.org/src/commit/?id=3D688e289ee904fe625d92f9= 3680a71753d03ba2ee > K> > > K> > commit 688e289ee904fe625d92f93680a71753d03ba2ee > K> > Author: Pouria Mousavizadeh Tehrani > K> > AuthorDate: 2026-04-11 18:38:41 +0000 > K> > Commit: Pouria Mousavizadeh Tehrani > K> > CommitDate: 2026-04-13 14:15:01 +0000 > K> > > K> > ifconfig: Add support for geneve (netlink) > K> > > K> > This implementation is netlink only > K> > > K> > Differential Revision: https://reviews.freebsd.org/D55184 > K> > K> This fails to build if WITHOUT_NETLINK_SUPPORT=3Dyes is set. >=20 > I'm afraid we are going to have more of that in the near future. >=20 > What about dropping WITHOUT_NETLINK_SUPPORT=3Dyes from 16.0-CURRENT? >=20 No objections from me. =E2=80=94=20 Kristof= From nobody Fri Apr 17 19:15:05 2026 X-Original-To: dev-commits-src-main@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 4fy4Mm0Jddz6WtrR; Fri, 17 Apr 2026 19:15:16 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy4Ml6wx3z42yB; Fri, 17 Apr 2026 19:15:15 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776453316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q3htLYVc+pk1+PqjZg8Mm5Ti1dVHofOr/UxM8cTWJdw=; b=a2z29+iaDJ1nV4Jj1uKE6PhRCGRvIZw6Rl0RnS1AGY+QL69qGn0mDbdE4ZOEwKG5XISGNE h4BMRWeRPFdMFtWRdaJorhsdO28ewzeEU31JNtdKgmixgKanb2EGl+d8GXQtFMou5xvAC1 kKji+s834rthJzhgJaoz6Ry6gtMIAgEwPiXfyMZXTcTaETjsPR8q+cglTG4+XutuDijYCN RY0xmqjZN/rKjZjJLOWKgE2fKkVRVAf5yzpP5DHjKZuawsm04NhIABNWZ3FpdqVIHssUab iCCRkJZWsV9DqPybrzT0wiFqPpGMdMGpkzfX7hRlZugUrkNs0NcAzTG5HC1IGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776453316; a=rsa-sha256; cv=none; b=ZUNuOM0m/2MSFhMSejyiH9eWeBOB1hW0/rFnnySCWnV/WdeokDnleQ7YMATC1PCwCtJBn4 QLccDkT4mJFiuJ/lZIUAy/49BBFMRBbevEhY0ZcIkusqD8HZfIyh0t1eNpH2/v7azmgCKl eQQLE/JPaUSQBj1DOWLZr15HirS+GkC60wBArN4FmBZbajsxOZOneAyogbgey/yJJWocID xN21JcPmn1uFX5973S5n7MpC4KD5jiJTrS3j9KgeAYLiWOOB/WiMSwSMjdMk0M/t5d7Qnw CeeTBDqr/X9+cx8myB4seq2D/tSX3CsQ17fmd/7+VYOqNi7UuifssyN+w/ImEA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776453316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q3htLYVc+pk1+PqjZg8Mm5Ti1dVHofOr/UxM8cTWJdw=; b=Dx2RJgF/6So4HLTlTaoQAtnrCghP/LcBvhK3JazEsIruIStxuxJhNVENw76XtMkl9gdXx/ 1J87yTxeNfseuDZvM58hgsU2sM+o3lnhob0FZsvY08FafN6UCXxCogwGb4IwfpgCwPysfl V6QI0h57+Ynwz0rQIUqU8jGdAWRFD8bjOD8D1cuZ5dSBnjeo+gBJ0Ty6QuJS/Aj/DvrzHV oyx3aa+STbw9440vBtOYeRMHRFkkX9O0Jx+jcd0ys+DXRqGWtOyj9Pj93goiNclEosVhuK t4cxcfmMyOLA2B5LmHk/GiELgm3f2rZAUVvlGq/XhciSxMgkRvWD6evwhC5p6g== Received: from smtpclient.apple (unknown [IPv6:2001:19f0:6001:9db:98f0:9fe0:3545:10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fy4Mj0ZBhz10ss; Fri, 17 Apr 2026 19:15:12 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Content-Type: text/plain; charset=us-ascii List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.10\)) Subject: Re: git: 688e289ee904 - main - ifconfig: Add support for geneve (netlink) From: Zhenlei Huang In-Reply-To: Date: Sat, 18 Apr 2026 03:15:05 +0800 Cc: Kristof Provost , Pouria Mousavizadeh Tehrani , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <69dcfad9.46b23.7e93103@gitrepo.freebsd.org> To: Gleb Smirnoff X-Mailer: Apple Mail (2.3696.120.41.1.10) > On Apr 18, 2026, at 2:52 AM, Gleb Smirnoff = wrote: >=20 > On Fri, Apr 17, 2026 at 12:21:51AM +0200, Kristof Provost wrote: > K> On 13 Apr 2026, at 16:16, Pouria Mousavizadeh Tehrani wrote: > K> > The branch main has been updated by pouria: > K> >=20 > K> > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D688e289ee904fe625d92f93680a71753= d03ba2ee > K> >=20 > K> > commit 688e289ee904fe625d92f93680a71753d03ba2ee > K> > Author: Pouria Mousavizadeh Tehrani > K> > AuthorDate: 2026-04-11 18:38:41 +0000 > K> > Commit: Pouria Mousavizadeh Tehrani > K> > CommitDate: 2026-04-13 14:15:01 +0000 > K> >=20 > K> > ifconfig: Add support for geneve (netlink) > K> >=20 > K> > This implementation is netlink only > K> >=20 > K> > Differential Revision: https://reviews.freebsd.org/D55184 > K>=20 > K> This fails to build if WITHOUT_NETLINK_SUPPORT=3Dyes is set. >=20 > I'm afraid we are going to have more of that in the near future. >=20 > What about dropping WITHOUT_NETLINK_SUPPORT=3Dyes from 16.0-CURRENT? Will that affect backporting new features, such as this one GENEVE ? >=20 > --=20 > Gleb Smirnoff >=20 Best regards, Zhenlei From nobody Fri Apr 17 19:32:53 2026 X-Original-To: dev-commits-src-main@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 4fy4m53xXJz6WwDr for ; Fri, 17 Apr 2026 19:32:53 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy4m53Ffpz44KH for ; Fri, 17 Apr 2026 19:32:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776454373; 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=zz9AZ0thYF1NpepLHe2sYhZF1Hxd7oNbozPrqLQqYTM=; b=uM5Q8SSHo5j+XJ+2LTqnyUv1oy3xd3BjM2fVvq0ORLayKjk3bENKm9fcle8mEbNHgcV8dm RotpfwBBxW+ffVq6YcQi9leaISL1ZNQS+Cz76xWFoHEGf1BhLhnTc6y3QFwl0OW47x6qqR RIpn+J+3MW/F8AFQCPO1p2QASdvcJGBDiIKopTGcTft2RVc2RR67lf9Ox0ZoIHIWKjNWxd cPkRWlovnO7m0VKTvQNlcbELWoLB+3zXHDeq1ZFDn5UFy8ccfQF8irXeAjdNchIam/d0DE xgMLuj+rHH4sF6KtXmgK0LwHF/2Koxvy08dbJ8CZtN4ET1qKJYwRTD6TCRoWDA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776454373; a=rsa-sha256; cv=none; b=SmMircVeW6VhLGRbD/08NOCjkJC6v3wD2KbhzP10BJ+LCP1EZbMSrhy6pAK1rcJu+MtV2P iOYCw/BfK0Ib0zZaVcQ4oUyYEXt0KFob6oR30DSMBzir2QyaR2Hnq/vL0oYt1TOWcmJRVG BE7olF2jNKQ32f8SjyHApXktZEUSPaJTHSpxVkV1SFjpJlyX3+vz9uHqN3gKYqqpdC/Uz0 wpXMrAtpkq7ZkOtFYei4NfL/qSD/dmVa3pw9T75GRxxPiJ30cZmbwsel1joNXUsGzlpVWe rWbphbGio+mNiycHbpEVODeoipOfy9lx2YiWGQeu5FiyiilpGCtEYYsvQK+79A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776454373; 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=zz9AZ0thYF1NpepLHe2sYhZF1Hxd7oNbozPrqLQqYTM=; b=uyGCkuFEEAlFVVq92LSYNGgIVbm2XxoVy0aqRhdvqiZY8795ZLtQfVbALHeeQfg69UVsba ZtlyhAhz5wVXta9JXp3GMpZoVjVeqNQpQhpiEFDU8CRfPIG4akUgKED3c/a3iZIAgfLis8 WQEq1SuMoSiwawWt98DaL0UO0nCTk2NQGJsted9wnG6o810VcxcKs2AE7X/vChgcDLZlJl /W4doLbVRnhQ/A3W4Jb0NuOp6gzCAnaOk8AHz5Ic4g2UbaNGUYBum6tTkR+8+FcSkXyJkS DgjSi8EeU+ReTTjK48kE12I/sac4C3uYVfwyBxlDfyMX7LqK8JkW+408UazlUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy4m52kTPz16k8 for ; Fri, 17 Apr 2026 19:32:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3fbd9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 19:32:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: b4be4a7890e7 - main - powerpc64: fix builds List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b4be4a7890e7f3a94acc08440e28d480434f5bb8 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 19:32:53 +0000 Message-Id: <69e28ae5.3fbd9.7b0cba10@gitrepo.freebsd.org> The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=b4be4a7890e7f3a94acc08440e28d480434f5bb8 commit b4be4a7890e7f3a94acc08440e28d480434f5bb8 Author: Adrian Chadd AuthorDate: 2026-04-17 19:32:23 +0000 Commit: Adrian Chadd CommitDate: 2026-04-17 19:32:48 +0000 powerpc64: fix builds Oops, I missed 'device ix' in here, and it now requires mdio. --- sys/powerpc/conf/GENERIC64 | 2 ++ sys/powerpc/conf/GENERIC64LE | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/powerpc/conf/GENERIC64 b/sys/powerpc/conf/GENERIC64 index 8daf5353263a..f2c688b1c622 100644 --- a/sys/powerpc/conf/GENERIC64 +++ b/sys/powerpc/conf/GENERIC64 @@ -175,6 +175,8 @@ device glc # Sony Playstation 3 Ethernet device llan # IBM pSeries Virtual Ethernet device cxgbe # Chelsio 10/25G NIC +device mdio # MDIO bus + # PCI Ethernet NICs that use the common MII bus controller code. device miibus # MII bus support device bge # Broadcom BCM570xx Gigabit Ethernet diff --git a/sys/powerpc/conf/GENERIC64LE b/sys/powerpc/conf/GENERIC64LE index 499ee95d1905..ee5ecc271743 100644 --- a/sys/powerpc/conf/GENERIC64LE +++ b/sys/powerpc/conf/GENERIC64LE @@ -181,6 +181,8 @@ device fxp # Intel EtherExpress PRO/100B (82557, 82558) device re # Realtek 8139C+/8169/8169S/8110S device rl # Realtek 8129/8139 +device mdio # MDIO bus + # Nvidia/Mellanox Connect-X 4 and later, Ethernet only # mlx5ib requires ibcore infra and is not included by default device mlx5 # Base driver From nobody Fri Apr 17 19:37:40 2026 X-Original-To: dev-commits-src-main@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 4fy4sd0xbSz6WwXZ for ; Fri, 17 Apr 2026 19:37:41 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy4sc73p3z44pt for ; Fri, 17 Apr 2026 19:37:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776454661; 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=VawBEbvb9+XfENIHJFn6bgcHhsjfUSz8w89BpvJqCyE=; b=aHFe0toNWWHVBTQIYzIcJEi1JeDbmU9w9srGYbwWeBf9eMrAuFb+2qeSebt58PqPik58cu zB44hWDFnc0Pk24nMUEDD5K/QgypXcYhB90KANFATDvy9hSERktxbefuzxM5+coNGvZdrt yXJZJdd3D/e9WjSdgzmJCbJKZNBt+MXzCtU9nFVkOB8AP4mAWtxzA+Crvl7rBFJjgJ7ggv /XZ6Adr7i+qb9IBKGTm00Fvr0tuUrGU3eIpGheUXTb5hYVnCYD0JIF5YxjeIuNnZ1jolbL 778CtgB8bBC/sVaAx7ZVGyf8T2YcpGftOXgTqwoLHTFKofS1d+TqPbtZgYHHMA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776454661; a=rsa-sha256; cv=none; b=TJTPJ1TmxYI2NLhi7TaJQZD90y/ZihyDjIgE/AhAkjOn3MNe3QQTca/Js611tUQJrxbtjl kqZT5QK2tmG55k2mMu2oJfGp2JXbtl86pXl2rG3ijtB4MYnPgdD/ZTqMLstVdIw0os/Gdx 82n/3sPQTlMDSnAo9cLkwVWmT9iElLhXmJ/ScN2vczreKSp/kZQQ8oOxFd4PPWIj2XzPHr +zbiSKGbfaqp0A1GK+/8BUd/P2GnRzcoRTiRTGyfJ7l2fSu3R6wg1rAxU9GXmLBfb87R4/ gjsA43ReZ7lOOQI/XUjh5kmRSV/2rMr2ao3gWScXbr8uy1/Bwe5KnsRqW3XC0A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776454661; 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=VawBEbvb9+XfENIHJFn6bgcHhsjfUSz8w89BpvJqCyE=; b=v3+MctyPDo/O6Un31jxCo1+m5saAbR2OOXSZMZ+UGwp5OD0i5KUPyM3M9un78ivoErsqnD nH9GMQM0rU0g8SWmu5TqfLl0AezMggTbSmARXrH5ppEyGYh0ENEM7yIsfK4jjHS1tUH+vl 6mTiLUYdjO9xCveG14sFQzJQj68n/jL678W+P4mmaVXN/wm36VdHHM67GemqqAoO42Ly86 wTRU9ejggiqL6QXKGVAKJgp/nHFgA/KQTqeU9Osu3lM6EahyRa77fcOTrcKKmM/01VOdWJ scF5PpjEC5XcZo6Dfe1NlN2goDjOkECIhshYYvsg7ircq5qLe6pp7nLqHgBt5A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy4sc6Fj6z16kB for ; Fri, 17 Apr 2026 19:37:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1bb57 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 19:37:40 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Roger Pau =?utf-8?Q?Monn=C3=A9?= Subject: git: 45c8ddc874bb - main - uart/pci: recover ADL AMT device after FIFO size probing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45c8ddc874bb9149ed20cb46b6ef8bdd0567714c Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 19:37:40 +0000 Message-Id: <69e28c04.1bb57.42d4783d@gitrepo.freebsd.org> The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=45c8ddc874bb9149ed20cb46b6ef8bdd0567714c commit 45c8ddc874bb9149ed20cb46b6ef8bdd0567714c Author: Roger Pau Monné AuthorDate: 2026-03-27 09:55:02 +0000 Commit: Roger Pau Monné CommitDate: 2026-04-17 19:37:26 +0000 uart/pci: recover ADL AMT device after FIFO size probing When the Alder Lake Serial-over-LAN device is put into loopback mode and repeated writes are performed to the data register it results in the device ending up in a non-functional state afterwards. Recovering the device to a working state requires re-writing the LCR register with it's current value (no effective change). This should be harmless on all other devices. Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D56107 Reviewed by: imp --- sys/dev/uart/uart_dev_ns8250.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c index b0c7cd4b44e1..c13eabe9055e 100644 --- a/sys/dev/uart/uart_dev_ns8250.c +++ b/sys/dev/uart/uart_dev_ns8250.c @@ -999,6 +999,15 @@ ns8250_bus_probe(struct uart_softc *sc) uart_setreg(bas, REG_IER, ier); uart_setreg(bas, REG_MCR, mcr); uart_setreg(bas, REG_FCR, 0); + /* + * The Alder Lake AMT SOL Redirection device will never + * set LSR_OE (when in loopback mode at least) and + * instead block further input by not setting LSR_TEMT. + * Recovering the device afterwards into a working + * state requires re-writing the LCR register. This + * should be harmless on all other devices. + */ + uart_setreg(bas, REG_LCR, uart_getreg(bas, REG_LCR)); uart_barrier(bas); count = 0; goto describe; From nobody Fri Apr 17 19:37:41 2026 X-Original-To: dev-commits-src-main@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 4fy4sf0sG2z6WwJS for ; Fri, 17 Apr 2026 19:37:42 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy4sd6rxNz44xv for ; Fri, 17 Apr 2026 19:37:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776454662; 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=3U6CoLrszPyIdHYby0T0+akxN4kmuiWx/oIDIIiQ0Kw=; b=YFZorHEjNoJ00Z8y8tpRzYmv1sDEGen+OGoxlmn8uAMeKzY4cI7se1y8QuOUbWk4KTmmXx y+jQOpBoc+IbY0QnVc8qhSPOPcLROiLPcxmmOUBV0N0cPYN+uiqRcQ2pI7Ip7pqrl4ol+s JV+ZOpzP+JyOs60ihrHqHtgdx8JrTsFCdmp9DTJFFAz6aSX3i+m1WeauZB4gR99COHpSbF p5r8+tPgfv3skhRZUPWy9qUwXzlzFVv35hI/orgBJLYd5D9P05YZbZXI1N8J/pSxv4vjg0 AHSOg4KPARhQ0CwNQQX+SFPB+vt+goX1Fgn7XgM7D4n2PABXCSO955grg9CP6A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776454662; a=rsa-sha256; cv=none; b=SMNXDiogySh/weJdGzgCBC9N4WbMtAoAk/gRDcYTAn+mmfX2tt6HdsKD8vXiO2V7BaS0Rx ze6F5Cl2sq38TXbvVnaJcTAkK38bJKf0tgXcHs/uVCrXo3Nyi36CSdhEoN7pBArrVTa6KU 6kQJ4EHnFoiBAF5CVmlULZ+4h9fk/EXyi/zHTDzeFLjOt85q4LGTmuK6xr3ysUtHk5tCdQ MWgMLNI8iW0NHy/IRjAUuFYiCTVb+MBam4HJYIYhvuawVm10/KvKbmp4SWcWLYLXc+Rr0c CnvxnzpKu8DDe/jEfOU357SgAuXv1oHr2+hhGVpsJdxh0BMU42M/5xSCbf+5qA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776454662; 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=3U6CoLrszPyIdHYby0T0+akxN4kmuiWx/oIDIIiQ0Kw=; b=M2I0IGbKRLyOqWuU4+OPSQPg2MQ70HVaC0XQmMf4TXuai4KLYV0wSfUws0mE4Wkhq+mE1w 5XlD2HLazw4JfnabT1cOc3G4UKXprrMrwv4JtiEVb6Ggk5/lYky9I+ToWY/jBOF4VFU1/0 2S2bIkN/3nhrHK1iuz8VgilGmCCsb6uUJbtZOyHQ47Qq6Rhh6GAGjRFWY9Yea2YUqgXouK KbGuJnWV78+YwedbmZi1PGoQYWfyZXEy2Z1kZ529xYnAj2z7ulkmPP3x87yJ7Z6wbZyh/+ ZVI49AJEPdkrlEDS0Gws5pzOSlMBJTe7pQCmy/GKDlWR/rPsW6LoKMbjvLglqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy4sd699Nz16kD for ; Fri, 17 Apr 2026 19:37:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 195ba by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 19:37:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Roger Pau =?utf-8?Q?Monn=C3=A9?= Subject: git: 2ac5b9bd0b13 - main - uart/pci: use different probe return values List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: royger X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ac5b9bd0b132ac0fb69800724dbfcab45ccc35c Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 19:37:41 +0000 Message-Id: <69e28c05.195ba.26247395@gitrepo.freebsd.org> The branch main has been updated by royger: URL: https://cgit.FreeBSD.org/src/commit/?id=2ac5b9bd0b132ac0fb69800724dbfcab45ccc35c commit 2ac5b9bd0b132ac0fb69800724dbfcab45ccc35c Author: Roger Pau Monné AuthorDate: 2026-04-17 12:46:39 +0000 Commit: Roger Pau Monné CommitDate: 2026-04-17 19:37:26 +0000 uart/pci: use different probe return values For PCI devices listed in pci_ns8250_ids return BUS_PROBE_SPECIFIC, while for generic UART devices not explicitly listed in pci_ns8250_ids return BUS_PROBE_GENERIC. This allows more specific drivers to take over those devices, and the generic UART PCI driver will only be used as a fallback. This fixes an issue where the UART PCI driver would attach to multiport PCI UART devices, that instead need to use the puc(4) driver to multiplex the device. Reported by: markj Sponsored by: Citrix Systems R&D Differential revision: https://reviews.freebsd.org/D56467 Reviewed by: markj imp --- sys/dev/uart/uart_bus_pci.c | 55 +++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/sys/dev/uart/uart_bus_pci.c b/sys/dev/uart/uart_bus_pci.c index b0d285e3c603..97c5ff84d251 100644 --- a/sys/dev/uart/uart_bus_pci.c +++ b/sys/dev/uart/uart_bus_pci.c @@ -280,33 +280,43 @@ uart_pci_probe(device_t dev) { struct uart_softc *sc; const struct pci_id *id; - struct pci_id cid = { - .regshft = 0, - .rclk = 0, - .rid = 0x10 | PCI_NO_MSI, - .desc = "Generic SimpleComm PCI device", - }; - int result; sc = device_get_softc(dev); id = uart_pci_match(dev, pci_ns8250_ids); if (id != NULL) { sc->sc_class = &uart_ns8250_class; - goto match; + return (BUS_PROBE_SPECIFIC); } if (pci_get_class(dev) == PCIC_SIMPLECOMM && pci_get_subclass(dev) == PCIS_SIMPLECOMM_UART && pci_get_progif(dev) <= PCIP_SIMPLECOMM_UART_16550A) { - /* XXX rclk what to do */ - id = &cid; sc->sc_class = &uart_ns8250_class; - goto match; + return (BUS_PROBE_GENERIC); } /* Add checks for non-ns8250 IDs here. */ return (ENXIO); +} + +static int +uart_pci_attach(device_t dev) +{ + static const struct pci_id cid = { + .regshft = 0, + .rclk = 0, + .rid = 0x10 | PCI_NO_MSI, + .desc = "Generic SimpleComm PCI device", + }; + struct uart_softc *sc; + const struct pci_id *id = uart_pci_match(dev, pci_ns8250_ids); + int count, result; + + if (id == NULL) + /* No specific PCI ID match, must be a generic device. */ + id = &cid; + + sc = device_get_softc(dev); - match: result = uart_bus_probe(dev, id->regshft, 0, id->rclk, id->rid & PCI_RID_MASK, 0, 0); /* Bail out on error. */ @@ -322,26 +332,13 @@ uart_pci_probe(device_t dev) /* Set/override the device description. */ if (id->desc) device_set_desc(dev, id->desc); - return (result); -} - -static int -uart_pci_attach(device_t dev) -{ - struct uart_softc *sc; - const struct pci_id *id; - int count; - - sc = device_get_softc(dev); /* - * Use MSI in preference to legacy IRQ if available. However, experience - * suggests this is only reliable when one MSI vector is advertised. + * Use MSI in preference to legacy IRQ if available. However, + * experience suggests this is only reliable when one MSI vector is + * advertised. */ - id = uart_pci_match(dev, pci_ns8250_ids); - /* Always disable MSI for generic devices. */ - if (id != NULL && (id->rid & PCI_NO_MSI) == 0 && - pci_msi_count(dev) == 1) { + if ((id->rid & PCI_NO_MSI) == 0 && pci_msi_count(dev) == 1) { count = 1; if (pci_alloc_msi(dev, &count) == 0) { sc->sc_irid = 1; From nobody Fri Apr 17 20:28:11 2026 X-Original-To: dev-commits-src-main@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 4fy5zv21spz6YW0y for ; Fri, 17 Apr 2026 20:28:11 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy5zv15pmz3CFB for ; Fri, 17 Apr 2026 20:28:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776457691; 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=WnXw/AF/ob5QcmhqmlJpvo9mW0IP0J23qBQVvJuY/Ic=; b=f2PK7OifkcPCBd4w4Ev1QTGP3R2n5dT/xPZhTIKKT+dYIEDecQyfCGnDar/fJsiCqYWCpP 0OniD5BkDhFb0sWPbMgFcBnGzbdjJhiJ1OH4+mpK8EKCf07+SBMRTQGJcz6o/YhgL07zC/ H2MwTkGoaEPQJ2t0HUQuLLmM86FqD0apZsuhmCAxXu+qc1muwCjshbi8Yph5sL5PZXp80h Y55QczyhTn5iaYdNoRngQJ0lITGAG0RCmVOIaZzCYDSYxo6LXb6HwrOecqOFibUF007VHD r4UxGx5TagBbYwvueVv4lxykogjJy70U0ai+VETXNk0lD0Hxc5dhdXK+EMlmSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776457691; a=rsa-sha256; cv=none; b=TeKSLsP3ZLU9S82jRoE/EZSBtFw+5HXu4ZcN3HvVz8LJ1gMdylhCOjzlGXMbTMFrVuOOxq cgntCPvFEvHnYHOsUW7+diZ0Qk5UiI9mjxGHRbvLSyNNoGnBU4Q36RRg2PflJV/LMFSJNb XPmf8+6nMxtq9wcXn+2Xw1sV7Rf1IL5h1vuyi2vUFhMaBn1HAntFcckhVga+0KSoYrD/RS GsDmq/ku1hFbOlkS9WsA3xqIkoO84b9E6PLXpysQA6DniRoIZrVkGYjVxE8CKeporzz8YS bUfvQJGC7YgTlDC39Tk3xW0HbLhsm92YIiLPwlO5l7vVL6WdY9tqM99E/sWtXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776457691; 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=WnXw/AF/ob5QcmhqmlJpvo9mW0IP0J23qBQVvJuY/Ic=; b=il8Pfk/VDQ4jq2V1BDQiH7fuP6ISKc0dqPBZnr/6/FYWLfo5TnpoywLku2GGr0yGN+IjHq bU/7f+Bj3Njq/DrHTdzmpnyaypij92G0lCeKC5/IQb2xBaQ6aq4GVLrjOvSoKlfbCdGGh6 eaQhK7e/sPHnPDQ2DXbJsIm5k3eOE3QRowJ4aNuz6KtLfX3QCL399MqfMwkhUZ6Yb5wk8z ubanf8grW+Gd1zF3XuAwwOBuV++fAjmENpZi8w+q94Ns7rWRxzc8UnEqCs0afjaTiSGg+e TRrNnpGhqhfzDgEx98G0OH4k8vhBpV+c9C0fTSnza0cOexD0v0qfhgwx0i9jIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy5zv0VM6z1784 for ; Fri, 17 Apr 2026 20:28:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 20712 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 20:28:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: bd05b47fbd8b - main - acpi_spmc(4): Small probe improvements/fixes List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd05b47fbd8b7301983dc4ceaf0498fb8d5ca9f2 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 20:28:11 +0000 Message-Id: <69e297db.20712.efdbc17@gitrepo.freebsd.org> The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=bd05b47fbd8b7301983dc4ceaf0498fb8d5ca9f2 commit bd05b47fbd8b7301983dc4ceaf0498fb8d5ca9f2 Author: Olivier Certner AuthorDate: 2026-04-10 14:15:09 +0000 Commit: Olivier Certner CommitDate: 2026-04-17 20:27:51 +0000 acpi_spmc(4): Small probe improvements/fixes Remove the test on presence of an ACPI handle, this is implied by ACPI_ID_PROBE() succeeding. Set 'sc->dev' early, so that acpi_spmc_check_dsm_set() using device_printf() will print the driver name. Add a missing newline after printing that more DSM functions are implemented then expected. Reviewed by: obiwac Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56483 --- sys/dev/acpica/acpi_spmc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sys/dev/acpica/acpi_spmc.c b/sys/dev/acpica/acpi_spmc.c index ca7b3bd95ead..5be2ba439de4 100644 --- a/sys/dev/acpica/acpi_spmc.c +++ b/sys/dev/acpica/acpi_spmc.c @@ -200,12 +200,13 @@ acpi_spmc_probe(device_t dev) } handle = acpi_get_handle(dev); - if (handle == NULL) - return (ENXIO); + /* ACPI_ID_PROBE() above cannot succeed without a handle. */ + MPASS(handle != NULL); sc = device_get_softc(dev); + sc->dev = dev; - /* Check which sets of DSM's are supported. */ + /* Check which sets of DSMs are supported. */ sc->dsm_sets = 0; acpi_spmc_check_dsm_set(sc, handle, &intel_dsm_set); @@ -286,7 +287,7 @@ acpi_spmc_check_dsm_set(struct acpi_spmc_softc *sc, ACPI_HANDLE handle, if ((dsms_supported & ~max_dsms) != 0) device_printf(sc->dev, "DSM set %s supports more DSMs than " - "expected (%#" PRIx64 " vs %#" PRIx64 ").", dsm_set->name, + "expected (%#" PRIx64 " vs %#" PRIx64 ").\n", dsm_set->name, dsms_supported, max_dsms); } From nobody Fri Apr 17 20:49:08 2026 X-Original-To: dev-commits-src-main@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 4fy6S50HYbz6YXZp for ; Fri, 17 Apr 2026 20:49:09 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy6S46mDVz3Fgd for ; Fri, 17 Apr 2026 20:49:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776458948; 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=6XfjacI+aCP9xk79gSzZzHQ8ql8R2BcSPgaRvIUUWeY=; b=MplyEc6KbZOsQRzNwrVtG+PjOVsXtAc/0LNLlIWMHj0llYbdxPVte4GurfFxMK9kznnoqH 967Z2k7oPzpywLpou8FFRBnYRUhnTi0s6UvKO9MdPTE6UotCaNulK9n0uoAWBa5rGJUOYI r/4MSsfUZ1HJ6uQmxtyw1WrysWZBzKYU6YL3yDAGs8U9gG+YgXh9eUe9w5Bc0QU5WWgWlm OB5ZO+aMFQjV6mPkLsAIoUc1t1xJxgAfG/0dtMn9mQotVA5J8MDpf7FgmjTJibydZKJDij nuSzngJ5ByRbyyvin5OrgvQ9pmjJpfz+1LpCQ8AqFiOOxYIdPOI+VSH4pIuCEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776458948; a=rsa-sha256; cv=none; b=iMIERzP5xuYVTIPT1aq84R71v3V48cCLD1y3nfw4GLvAezSMfwu0m+hJSrw+bDHLuBk+Qb Dvg2w92xsBl25VIfbODqNbGxs/iOYfSUWbwdj5820Aomj7JeMLmXcHiyj4cNW/ZF3a4ier SDQ7JrSBZYGUZTHqXAXYCVC/nbEG3lHdck0hEN4vh4vJJUhFCZchJwLhdF2tyoaQEBa2HP 2pi4x3s9lIpDbEUs3CZmv3N08IuWl13pF5333zlwoJz1C6CTE3F1yBV+NTayU5hfnskctU z7B8LGqX7/3gvNqYuF+Mi2L8VGN5CbwlFpcNh9btjR8Um76ONf0VI4OTVaLE1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776458948; 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=6XfjacI+aCP9xk79gSzZzHQ8ql8R2BcSPgaRvIUUWeY=; b=POzi5OkaB8b/+WREEpHDe74FwSNfS9/7oqgf6p/midFE53RzuzEi62JluCDS04j2hJQtV5 5ti248F0MHnqmoyF/TEOcolj5ln6FCoTyRRRJL9ol/LTdY75MTGe5zWDEk6IMS644pV6sp 0eUZ1ZFdwEmOVC8n7rCa5Kg01seloB+YNfliqFz6HoRcOr0JpkeOCPMBaAMb76qseYnDc/ SuxIiIo4ik3Ro2G38sZ3td8WKOtFAyWuBhJ/2b8yWEhfsRghLrk8Rwri1OxRhgBg/dX+OU D6z+GGxfOMmoAOztclppRjKxkzjMxsE62Zq2hExXINGkQX8q8D4zqxBPyQm+8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy6S46FGNz189k for ; Fri, 17 Apr 2026 20:49:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2231a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 20:49:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 788d71e73f1b - main - virtual_oss.8: Remove CPU performance example List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 788d71e73f1b4fdac572dae72d3eac5cfb0f9f18 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 20:49:08 +0000 Message-Id: <69e29cc4.2231a.6bdecd5a@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=788d71e73f1b4fdac572dae72d3eac5cfb0f9f18 commit 788d71e73f1b4fdac572dae72d3eac5cfb0f9f18 Author: Christos Margiolis AuthorDate: 2026-04-17 20:47:16 +0000 Commit: Christos Margiolis CommitDate: 2026-04-17 20:48:38 +0000 virtual_oss.8: Remove CPU performance example See also: https://github.com/freebsd/virtual_oss/issues/2 Sponsored by: The FreeBSD Foundation MFC after: 1 week --- usr.sbin/virtual_oss/virtual_oss/virtual_oss.8 | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/usr.sbin/virtual_oss/virtual_oss/virtual_oss.8 b/usr.sbin/virtual_oss/virtual_oss/virtual_oss.8 index 6aa9f1289b35..b607f45cd369 100644 --- a/usr.sbin/virtual_oss/virtual_oss/virtual_oss.8 +++ b/usr.sbin/virtual_oss/virtual_oss/virtual_oss.8 @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" -.Dd September 3, 2024 +.Dd April 17, 2026 .Dt VIRTUAL_OSS 8 .Os .Sh NAME @@ -325,17 +325,6 @@ server: virtual_oss -S -b 16 -C 2 -c 2 -r 48000 -s 4ms \\ -f /dev/sndio/default -d dsp .Ed -.Pp -How to set intel based CPUs in performance mode: -.Bd -literal -offset indent -sysctl -aN | fgrep dev.hwpstate | fgrep epp | \ -while read OID -do -sysctl ${OID}=0 -done - -sysctl kern.sched.preempt_thresh=224 -.Ed .Sh NOTES All character devices are created using the 0666 mode which gives everyone in the system access. From nobody Fri Apr 17 21:05:04 2026 X-Original-To: dev-commits-src-main@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 4fy6pZ1pl1z6YZ4J for ; Fri, 17 Apr 2026 21:05:10 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy6pY6DSzz3Gwh for ; Fri, 17 Apr 2026 21:05:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776459909; 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=y2Dnf3biIq6lLgNfjSTMC8JWhRQdUOYhTF+WX6imWv0=; b=qweD+9dtZuktR/LG8q5aJXtBka3igiaJY1yCXm5ePP/WMnUTK0atDlXkpGMg9zyU7ZByt0 viNOnULJbUtlyc/wckypzOCLfi/0XL1fBLR2oxchYj60QBNwnTywcM+0GVR/m/zFjf4vYj ShI5Kg4T7hpR6mmcyfFqbkm/eWGwVKCu5CHIq4Ks0EUdekyS4tJiWL0CG65VFbs3bxi+Mg Eonaz8VQ87ym8HEN/Vlb2vJVlX6FvNYz9tnXwemwjNittgntEdamFTXO0s9pKdm1H0OXjx 592LGh/ALr9pqUJ2t9qjf2bo3Zt+MLoiCy/U6fTX8yT4VFOBH5jN9T+r9O6MSQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776459909; a=rsa-sha256; cv=none; b=g0IGaI1fE2kXjK0XS9lN1e9IfqS6nQdvV/u5PQ8+r8ymd2I+QnQXDgyd+pY9MYB2rdnJfU FKCmYQMJVC9TfXB5gdHo5UpjMtWRd4ZrJo4I2qFJGW50CwpCJqqYPuYe8YU5ymEaaKTZz+ nPW1XomRuip2KJY6PMKH4DixrhEE6g7ly+JRr7CnpRNG96mn3xjcIBGam9fUA04SJKgUDO S/I1Uc4BiOJERznz/G8pKL9vSkP7JUGqzjZT6nOHMEvuCWjjNjd0jh7L8YJKaYgOd7W5XH 6gcREYelgOMSF+DeO5eT+16sZkq2rv7q6EFf/40OTdkXslJv3A5CZKouIFgaig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776459909; 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=y2Dnf3biIq6lLgNfjSTMC8JWhRQdUOYhTF+WX6imWv0=; b=B/DzvvG6mX4AXe3Dl/4thlseZ4fTRKc5KLszLMGeR6YtrjgAb03F4Nx0B45SGFTj59QH1f KpnBRG4/19/UzKyNKF2shkgJrHn56fP6ygPBxMaTo0QLwfwSVEgQtkGZoSTI4Sg89FTykD VvloyNAnsN5rr8hzSw2Rda8rzg06yegyv4P8CmwSSBcv48d+Aic/YK321npVBmlCJUlMJW CfNBfX3FL3W2HffE5kRsTyCTM0GhRYjypjbylx4sJPXd/LDRWTo9B2QtgvDBeJQz4wxWRW ssT02ML5zn3k/rreYbGJ1m03HP+A9kefRrzjVOZGgOk/bvW1SUM4YlGKlrefTg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy6pS5q9Zz193c for ; Fri, 17 Apr 2026 21:05:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2444d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 21:05:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: 0a764beb6215 - main - acpi_spmc(4): Remove redundant setting of 'sc->dev' on attach List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a764beb6215f067787fba1723f211b7ef0eeeb0 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 21:05:04 +0000 Message-Id: <69e2a080.2444d.6a64fe58@gitrepo.freebsd.org> The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=0a764beb6215f067787fba1723f211b7ef0eeeb0 commit 0a764beb6215f067787fba1723f211b7ef0eeeb0 Author: Olivier Certner AuthorDate: 2026-04-17 21:02:06 +0000 Commit: Olivier Certner CommitDate: 2026-04-17 21:04:50 +0000 acpi_spmc(4): Remove redundant setting of 'sc->dev' on attach Should have been part of the previous commit (but PEBCAK). Reviewed by: obiwac Fixes: bd05b47fbd8b ("acpi_spmc(4): Small probe improvements/fixes") Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56483 --- sys/dev/acpica/acpi_spmc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/dev/acpica/acpi_spmc.c b/sys/dev/acpica/acpi_spmc.c index 5be2ba439de4..03944800327d 100644 --- a/sys/dev/acpica/acpi_spmc.c +++ b/sys/dev/acpica/acpi_spmc.c @@ -227,8 +227,6 @@ acpi_spmc_attach(device_t dev) { struct acpi_spmc_softc *sc = device_get_softc(dev); - sc->dev = dev; - sc->handle = acpi_get_handle(dev); if (sc->handle == NULL) return (ENXIO); From nobody Fri Apr 17 22:58:46 2026 X-Original-To: dev-commits-src-main@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 4fy9Kf5SPlz6ZGHx for ; Fri, 17 Apr 2026 22:58:46 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy9Kf3LMFz3SZP for ; Fri, 17 Apr 2026 22:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466726; 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=JdzHYVHDji7XIPRKHUQqDiMJ09P4fGv8gLxf6aN3Kzs=; b=jhfEIv6PYEGAdlFTzR7s4yb4mE2QlsI5ZRfXLUOgQoAWw0kRzZaRCbJ3d/0lnVlW31nIaU kWWaMebQ4RvjgVnbrZ8FQLZqoSjLOdboVrBDEynqCddBe9j3hvpAXCezxGEvu/VpTOWTW8 SR8Uu+IWpgHVfONrG/BZlI8j0pHGHXCJvZd+juZZcddFT13qDRoRylqcm8tMgwKDiltia5 guzuvESkgZv5mg3TukeS1Y++cRGHOmSWzDluZUce3CjoWkVG4mKoEVYghqRena+zvYM5gl kJtgzcEUs/Il0IOroLJs1gPkG1falypllkYErw7YQhx1CxPLRnAaTQJUOqW4jw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776466726; a=rsa-sha256; cv=none; b=TeYnzQiTdFe2yRojufoR/WphSCLsMoDnJNWgK6A2gt4r2maCv3NEANNQpPGJTbPlz9AD2b 0kX5Px0YLGPgKVEcNZzG1CrpntQtlk3o9FnCyauNNTf2VQEmXIbHKEd4K/c4Cqrm+ywIDN y8CZiZGmCaJnt+AfhR808D9rMorM0PJnb8f1WKL2Wx+WKDydkZKkYeozPBUH46istHghX2 kUxY4hKdQBahgynQpERRi/SQxSP/TpebTXdCXHQrx3kmmNpVxUnipBVgp6ZOExGjoGuMA+ q9yNlTqlkF7aAN0n2oV4P7rHgN0TM41REjImsDtFQBi4c3r2khgntqSScLXKYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466726; 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=JdzHYVHDji7XIPRKHUQqDiMJ09P4fGv8gLxf6aN3Kzs=; b=eWQLbGjIcBMB39yuttYVnXgzfQz+J4+2ezSHj8/AbxCqsWvpBjn3GxZlIJbhAbNtXFmnqt wrAIrMo8OQdDCeCb/d/7guPcgNM4vX+ICViLrK/BBkEOqgg8Ai4EwglzH5r/yO74T72+94 CKTVeFphWoSkUXpobnMNsAb2LkDIJHPrXXb9wIPkqkrKt+eqjIxgB63letLA0STLjihF6h 8fPC/CjGteqyjE76mfL+579JXt6sxfYicj+GiJONdrWocUmECuLz+c04XNCzPt8iOy/zXL KDBbzrzjaJdZNy6XBPoSz/8kxC+jQvTxaSYPEymW+F43yHfMK4GCQMsTcQmixg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy9Kf2gHwz1CVC for ; Fri, 17 Apr 2026 22:58:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39112 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 22:58:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: ced1de238fbe - main - nd6: Break pfxrtr_add out of nd6_prelist_add List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ced1de238fbe620e2b110c34561d63656bd2043c Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 22:58:46 +0000 Message-Id: <69e2bb26.39112.75e65f90@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=ced1de238fbe620e2b110c34561d63656bd2043c commit ced1de238fbe620e2b110c34561d63656bd2043c Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-16 22:19:18 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 22:52:15 +0000 nd6: Break pfxrtr_add out of nd6_prelist_add Updating defrouter only required by `prelist_update()`. since `nd6_prelist_add()` is a public function, exclude unsed dr logic from it. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56131 --- sys/netinet6/in6.c | 2 +- sys/netinet6/in6_ifattach.c | 2 +- sys/netinet6/nd6.h | 3 +-- sys/netinet6/nd6_rtr.c | 15 ++++++--------- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/sys/netinet6/in6.c b/sys/netinet6/in6.c index cf2720cac036..feb63bd0eaa4 100644 --- a/sys/netinet6/in6.c +++ b/sys/netinet6/in6.c @@ -1319,7 +1319,7 @@ in6_addifaddr(struct ifnet *ifp, struct in6_aliasreq *ifra, struct in6_ifaddr *i * nd6_prelist_add will install the corresponding * interface route. */ - if ((error = nd6_prelist_add(&pr0, NULL, &pr)) != 0) { + if ((error = nd6_prelist_add(&pr0, &pr)) != 0) { if (carp_attached) (*carp_detach_p)(&ia->ia_ifa, false); goto out; diff --git a/sys/netinet6/in6_ifattach.c b/sys/netinet6/in6_ifattach.c index 237fb7ecfd44..2f59b791a259 100644 --- a/sys/netinet6/in6_ifattach.c +++ b/sys/netinet6/in6_ifattach.c @@ -625,7 +625,7 @@ in6_ifattach_linklocal(struct ifnet *ifp, struct ifnet *altifp) * valid with referring to the old link-local address. */ if ((pr = nd6_prefix_lookup(&pr0)) == NULL) { - if ((error = nd6_prelist_add(&pr0, NULL, &pr)) != 0) + if ((error = nd6_prelist_add(&pr0, &pr)) != 0) return (error); /* Reference prefix */ ia->ia6_ndpr = pr; diff --git a/sys/netinet6/nd6.h b/sys/netinet6/nd6.h index 8dc27aef5e12..92b776b008b9 100644 --- a/sys/netinet6/nd6.h +++ b/sys/netinet6/nd6.h @@ -402,8 +402,7 @@ void nd6_defrouter_flush_all(void); void nd6_defrouter_purge(struct ifnet *); void nd6_defrouter_timer(void); void nd6_defrouter_init(void); -int nd6_prelist_add(struct nd_prefixctl *, struct nd_defrouter *, - struct nd_prefix **); +int nd6_prelist_add(struct nd_prefixctl *, struct nd_prefix **); void nd6_prefix_unlink(struct nd_prefix *, struct nd_prhead *); void nd6_prefix_del(struct nd_prefix *); void nd6_prefix_ref(struct nd_prefix *); diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 7b7db1b95e31..5833bf487c23 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1400,8 +1400,7 @@ nd6_prefix_rele(struct nd_prefix *pr) } int -nd6_prelist_add(struct nd_prefixctl *pr, struct nd_defrouter *dr, - struct nd_prefix **newp) +nd6_prelist_add(struct nd_prefixctl *pr, struct nd_prefix **newp) { struct nd_prefix *new; char ip6buf[INET6_ADDRSTRLEN]; @@ -1448,8 +1447,6 @@ nd6_prelist_add(struct nd_prefixctl *pr, struct nd_defrouter *dr, ND6_ONLINK_UNLOCK(); } - if (dr != NULL) - pfxrtr_add(new, dr); if (newp != NULL) *newp = new; return (0); @@ -1571,17 +1568,15 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, NET_EPOCH_ASSERT(); /* check if prefix already exists on the same interface */ - if ((pr = nd6_prefix_lookup(new)) != NULL) { + if ((pr = nd6_prefix_lookup(new)) != NULL) nd6_prefix_update(new, pr); - if (dr != NULL) - pfxrtr_add(pr, dr); - } else { + else { if (new->ndpr_vltime == 0) goto end; if (new->ndpr_raf_onlink == 0 && new->ndpr_raf_auto == 0) goto end; - error = nd6_prelist_add(new, dr, &pr); + error = nd6_prelist_add(new, &pr); if (error != 0) { nd6log((LOG_NOTICE, "%s: nd6_prelist_add() failed for " "the prefix %s/%d on %s (errno=%d)\n", __func__, @@ -1603,6 +1598,8 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, in6_init_prefix_ltimes(pr); } } + if (dr != NULL) + pfxrtr_add(pr, dr); /* * Address autoconfiguration based on Section 5.5.3 of RFC 2462. From nobody Fri Apr 17 22:58:47 2026 X-Original-To: dev-commits-src-main@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 4fy9Kg5cHqz6ZGP6 for ; Fri, 17 Apr 2026 22:58: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy9Kg3vPlz3ScZ for ; Fri, 17 Apr 2026 22:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466727; 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=dhETzXXvzneFXD5Y3WaoarqwWCKKyUbERlhMnHO+mbI=; b=C4XylgZh9B84SrJObKkA4XvZOgIcNVqnj2xn+jAuSkLAYSOcg+RGLAuVHEZU3TEWYRy1qQ a5B8/lywWKoVxyfLjKhr7uSgbZYBx3tfXfusrQQWUwvkp46gadoi92peiuGp4yIhhL0u6F r/VVEoDDZGQK4TRte1vVbcU/c4mu/xOuATI2tBKQc5AbASZnN7WOT3m2Rx+Y2xi2vaS5OJ M8XCaPkBqHZrHU98a/zdeeTYW7ur2OeTW1xz3NZjqbizYslWw35jWuEhklqE4WttzPFTiD qr8tw71eY4U85ztv8ZSxYu3kkxfX84BBbENt6HlnI6TAzEEC6OS51thE73cUYA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776466727; a=rsa-sha256; cv=none; b=LUuBaFCWfLeqOlBrGU4CZFkeSwehqfaSPZp0xfpdeX5NRl8XgWguajVBb+wXsWZEVq5IxP oDXneX060jK1OMjb2kSl2K++vWhdBHB7gHGyN98qCRppYlVLqDKQ2vjVvP9gsevqNZwdxI ojvIbaBaVpZ7P3N1bQPKzxxenruiKGzYCbcJeQVAF+OuKboJo3iJ/HqQURQjMYNZNoUrqm DH61PicBPl8l70usa/fUQ1Lfj/AIMa2sUL/ZC39pKAkoIv++tDf2WEVowXiiJO8Q9iptcc l/HDdWUSKBDSVZdlKNALjMnjGZ2dGzeWsWanB+yzcF6pqIWlOr/MoUSTsgAkgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466727; 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=dhETzXXvzneFXD5Y3WaoarqwWCKKyUbERlhMnHO+mbI=; b=yMP0YNZSm6kHo31xZEP5nrShCJGFGMnaZhQDO8ySwCJjx9V8NP82O+AQOCJEvI24fEHcva hCgXLxJXNRo1BCrGRCOsQfGyMa2b95F/WuTtt6Wr35vZiUdtqAuax7bcXazzOx96yhJkKW 3fP1X0Pjy/S0VvYB1bRsScwTsy2pymt7XsUMfDPQTAQH9hiHQVKkE/udRdoIC4hZLhqDo4 0HHuM+79QJIvhAt+W0c8gIv7IR78AJS+u3B4IOJzVStaCvdVcQl7D9GQZ21f2MBknsAt9J sM0n147JLwrmximwHbNX03ndHV7R2YCGq5ok5HkkSIW6vjy9fKcAkNBJn1ZVaQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy9Kg3Vvyz1C8y for ; Fri, 17 Apr 2026 22:58:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3908f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 22:58:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: d022dd82059b - main - nd6: Change prelist_update return type to void List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d022dd82059b6173505377d47e3d0048906f8311 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 22:58:47 +0000 Message-Id: <69e2bb27.3908f.71752c21@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=d022dd82059b6173505377d47e3d0048906f8311 commit d022dd82059b6173505377d47e3d0048906f8311 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-16 22:20:47 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 22:52:17 +0000 nd6: Change prelist_update return type to void The return value of `prelist_update()` is unused. Reviewed by: markj, zlei Differential Revision: https://reviews.freebsd.org/D56132 --- sys/netinet6/nd6_rtr.c | 47 ++++++++++++++++++----------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 5833bf487c23..339ae5ebbaea 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -89,7 +89,7 @@ struct nd_routectl { }; static struct nd_defrouter *defrtrlist_update(struct nd_defrouter *); -static int prelist_update(struct nd_prefixctl *, struct nd_defrouter *, +static void prelist_update(struct nd_prefixctl *, struct nd_defrouter *, bool, int); static int nd6_routelist_update(struct nd_routectl *); static int nd6_prefix_onlink(struct nd_prefix *); @@ -313,7 +313,7 @@ nd6_ra_opt_pi(struct nd_opt_hdr *pt, struct ifnet *ifp, pr.ndpr_plen = pi->nd_opt_pi_prefix_len; pr.ndpr_vltime = ntohl(pi->nd_opt_pi_valid_time); pr.ndpr_pltime = ntohl(pi->nd_opt_pi_preferred_time); - (void)prelist_update(&pr, dr, auth, mcast); + prelist_update(&pr, dr, auth, mcast); } static void @@ -1552,7 +1552,7 @@ nd6_prefix_update(struct nd_prefixctl *new, struct nd_prefix *pr) } } -static int +static void prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, bool auth, int mcast) { @@ -1572,9 +1572,9 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, nd6_prefix_update(new, pr); else { if (new->ndpr_vltime == 0) - goto end; + return; if (new->ndpr_raf_onlink == 0 && new->ndpr_raf_auto == 0) - goto end; + return; error = nd6_prelist_add(new, &pr); if (error != 0) { @@ -1582,7 +1582,8 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, "the prefix %s/%d on %s (errno=%d)\n", __func__, ip6_sprintf(ip6buf, &new->ndpr_prefix.sin6_addr), new->ndpr_plen, if_name(new->ndpr_ifp), error)); - goto end; /* we should just give up in this case. */ + /* we should just give up in this case. */ + return; } /* @@ -1602,24 +1603,16 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, pfxrtr_add(pr, dr); /* - * Address autoconfiguration based on Section 5.5.3 of RFC 2462. + * Address autoconfiguration based on Section 5.5.3 of RFC 4862. * Note that pr must be non NULL at this point. + * + * 5.5.3 (a). Ignore the prefix without the A bit set. + * 5.5.3 (b). the link-local prefix should have been ignored in nd6_ra_input. + * 5.5.3 (c). Consistency check on lifetimes: pltime <= vltime. */ - - /* 5.5.3 (a). Ignore the prefix without the A bit set. */ - if (!new->ndpr_raf_auto) - goto end; - - /* - * 5.5.3 (b). the link-local prefix should have been ignored in - * nd6_ra_input. - */ - - /* 5.5.3 (c). Consistency check on lifetimes: pltime <= vltime. */ - if (new->ndpr_pltime > new->ndpr_vltime) { - error = EINVAL; /* XXX: won't be used */ + if (new->ndpr_raf_auto == 0 || + new->ndpr_pltime > new->ndpr_vltime) goto end; - } /* * 5.5.3 (d). If the prefix advertised is not equal to the prefix of @@ -1628,12 +1621,12 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, * Lifetime is not 0, form an address. We first check if we have * a matching prefix. * Note: we apply a clarification in rfc2462bis-02 here. We only - * consider autoconfigured addresses while RFC2462 simply said + * consider autoconfigured addresses while RFC 4862 simply said * "address". */ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct in6_ifaddr *ifa6; - u_int32_t remaininglifetime; + uint32_t remaininglifetime; if (ifa->ifa_addr->sa_family != AF_INET6) continue; @@ -1844,16 +1837,12 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, * XXX: what if address duplication happens? */ pfxlist_onlink_check(); - } else { - /* just set an error. do not bark here. */ - error = EADDRNOTAVAIL; /* XXX: might be unused. */ } } end: - if (pr != NULL) - nd6_prefix_rele(pr); - return (error); + nd6_prefix_rele(pr); + return; } /* From nobody Fri Apr 17 22:58:48 2026 X-Original-To: dev-commits-src-main@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 4fy9Kh5Ylrz6ZGX4 for ; Fri, 17 Apr 2026 22:58:48 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy9Kh4l7hz3Snw for ; Fri, 17 Apr 2026 22:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466728; 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=VIaPj6MkTicOBCsFP1OYa3xR7mkVVoj43RbdwD5uVZw=; b=ROmnXTAA37m0e3iNVpA/h2YfXzMLzUgJj/8sxE+i0Y0sRwgWLb0STfV1ZZQ+nAb+jMj4E2 l5sUahQpTRxFT1mg44lwtyB9cbxuQwW6G21WlVM3bgRNp3uMGs/J4+7T2Rrewg8E4xQYCv 4qQEO8GyDL+89PVYhNhlqFQou1mE1jRDkRPc2GvpQjGCGA6xvofmUmsX9UtwJvkLdvnGKt jDl1bUogUpHLf1S6TdajwAjRfz+NhN6DrJwuFEgmIP0mCwHee6d4eYBfZO4KzSg+EK13+T 96H4RDjO9V56zrbNPl+Gmp1qUAqEO4GTlYI+wOziSn0H9Iq5E9eaq3t7KMG3hQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776466728; a=rsa-sha256; cv=none; b=hauyx7xLZaVzTfPcxDr+lz8GSZI06cklXnCgCJHZhfDupmoG0zeQZLe3syUVcn4K1AwgZf 3vUdeZ5JzBB3uCyUX7TLSbsMUanUdX8Aulf6jwYVuz08FYPaoChiElzBc1D269lsKvFw9T l3wXUO3ji0Ly9f5y0VUF+Ji7y9v4bdDGlGwGnbeXQR5qv/92NNrN1CZ/GLTRO0WpSsOzty FC5gG+9ArXVkyJqZKrP70yQ0eCYX5J+cYMdtCwIHCSrwqBIv1h9zSNoJDvlxpnUNPKWzwT Y/PtLRaRAwWxUAbR500rAUIwnModWuhOX8zGQlUnf/h4Ro6OxCNvU35f3gKdJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466728; 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=VIaPj6MkTicOBCsFP1OYa3xR7mkVVoj43RbdwD5uVZw=; b=sU6skDwRCK+cthZ0uXF+3Tvyiz6e8cdF9tjxeD4E24huZmyvgljbdDkrllzq0uUbxy0AE7 jfJCWdwdoxbYeTQbUhf8vx7q7L/UDmUYHBp7ugeYfQTEmRIMf6Fy46UrRVV0LqkYHu20Rs HdMWLaBWizwcZMNFY0zyWwmCdRBeULT0jv+0mXp4l1UiA6pkQxb9pfjzv4LQg34Rt5beO+ W9AZOHMvUpntPzOYBwgSwAUL/t1iuNaCBnriVR/T175GTRGN/Eb7eri2HEgmRRgtxaBahz E0NfjWIOr1mRnR5YvLmm3W9MDVFLyDZFm2EyNn8LbvND3rJ1kOdlElefFuScMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy9Kh4M26z1BvY for ; Fri, 17 Apr 2026 22:58:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 381d9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 22:58:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: 05f2acd34483 - main - nd6: Ignore entire PI if violates RFC 4862 section 5.5.3 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05f2acd34483e9a2aa3d3b3d53e398cadab199ad Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 22:58:48 +0000 Message-Id: <69e2bb28.381d9.51c57c5a@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=05f2acd34483e9a2aa3d3b3d53e398cadab199ad commit 05f2acd34483e9a2aa3d3b3d53e398cadab199ad Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-16 22:27:33 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 22:52:18 +0000 nd6: Ignore entire PI if violates RFC 4862 section 5.5.3 Ignore prefix information update earlier in `prelist_update()`. If PI is invalid or autonomous bit is unset, we better to let our SLAAC address expire and if we don't have any previous matching prefix, better not to create new one. Because either our router don't want us to have one anymore, or the very RA is malicious. Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D56133 --- sys/netinet6/nd6_rtr.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 339ae5ebbaea..a27df537ecdc 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1567,6 +1567,16 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, NET_EPOCH_ASSERT(); + /* + * Address autoconfiguration based on Section 5.5.3 of RFC 4862. + * 5.5.3 (a). Ignore the prefix without the A bit set. + * 5.5.3 (b). the link-local prefix should have been ignored in nd6_ra_input. + * 5.5.3 (c). Consistency check on lifetimes: pltime <= vltime. + */ + if (new->ndpr_raf_auto == 0 || + new->ndpr_pltime > new->ndpr_vltime) + return; + /* check if prefix already exists on the same interface */ if ((pr = nd6_prefix_lookup(new)) != NULL) nd6_prefix_update(new, pr); @@ -1602,18 +1612,6 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, if (dr != NULL) pfxrtr_add(pr, dr); - /* - * Address autoconfiguration based on Section 5.5.3 of RFC 4862. - * Note that pr must be non NULL at this point. - * - * 5.5.3 (a). Ignore the prefix without the A bit set. - * 5.5.3 (b). the link-local prefix should have been ignored in nd6_ra_input. - * 5.5.3 (c). Consistency check on lifetimes: pltime <= vltime. - */ - if (new->ndpr_raf_auto == 0 || - new->ndpr_pltime > new->ndpr_vltime) - goto end; - /* * 5.5.3 (d). If the prefix advertised is not equal to the prefix of * an address configured by stateless autoconfiguration already in the From nobody Fri Apr 17 22:58:49 2026 X-Original-To: dev-commits-src-main@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 4fy9Kk2Ldnz6ZGJ6 for ; Fri, 17 Apr 2026 22:58:50 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy9Kj5Ghnz3Sp5 for ; Fri, 17 Apr 2026 22:58:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466729; 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=PpvwwMhnvleHTCssJTVSTkrCUY7+PG9sjrb1nOr3HcM=; b=STCdbv/RrTuuy1iWdGqKSzAH6HAESYwS+ioSpSsPvosriJg25o2n8qCotxF6YsIducyj1z nwTbFeJcUx+zA+IjTVfjd7wKqbcKwjPNWON9P9HI7gYoODjl51uIedvYE5PUcYzj03VZfD S+GEE3LLWtNrYBd+jVQllJmaGE2R/LiAv3cPHzaaxp6oiIqw9SdK9llfVrbhRAT4obpdVG oovxClqzuC779yafn2DRGG2/H9Va6IXesuReh0EqggsAcWB2L/Gr/IPObkhQjypo31JrIx oN0jVKRzC+8fKyuQhHoJN4qlLUMj8ZfPvzippnTbNspnMSJ9HLXOmM0aSyKBiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776466729; a=rsa-sha256; cv=none; b=pb1p/15sY9gW7xHi/cAuWlQ/XWHXwllpCoMrA/zG/dvXd8160XgEKahE4r5D/rViMEkxYm plWzBPJXw3b1OfFbKcw3SFIY5vCyBLpCuTbJDgwQTF/NTBV16UBwZ5EbhCXqEF2J1rnDXN D5dc+bfMa9RIRxaIbEHOwjouH/0ciBn010lyGkDnazkiKBL92Yicn3o31B1WMtVVvTa2Af +b+0iAA7gi9Kiy/Rm+Q3q3jMoN3stH/kX+MpQbCOIGxlx/pzIEbK+E6nbfB3JwhcAyUEru TSAKTYejm+TJD0+xkNPr1YlonUzTWaHVIA8m4eXvkRBrNQzKN6+VENVOAFLOyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466729; 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=PpvwwMhnvleHTCssJTVSTkrCUY7+PG9sjrb1nOr3HcM=; b=JcobUX8vU/ScIahBvYh30s1pdEgRW5tSH0zo7vpv7WVu5KROdAw0idF/1CxMGXKqKS+LE/ qKp7kkTfLCdQJrVuNHzwC2S1pHSQWlu/Ys/1EclEHByec/B1rQKs7vFyKqVqDpIzJnHk9B PpJFnmbThQXytBVa0u1sFlHUBlXuYs8MHVsjIkofbSpEEqLC/mTz8b7XZ/oRPmP6u8Uqru aiMwC792vTmMr2YrIP5INlTIvvKvtPB+vuD2QLtlIlBgGHRGbKg3XiwKmwuSn4BUw/W/gr iJ0oD8+wpertxZG3uP6nK8GK8gSmX5vUgM3U0y0BZYR1hAaSkdbAyEklMluKsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy9Kj4kYyz1CGZ for ; Fri, 17 Apr 2026 22:58:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 369f2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 22:58:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: e80811906177 - main - nd6: Remove anycast check in prelist_update List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8081190617741e348fc85f17ff90b066407fc0f Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 22:58:49 +0000 Message-Id: <69e2bb29.369f2.1aa91bb5@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=e8081190617741e348fc85f17ff90b066407fc0f commit e8081190617741e348fc85f17ff90b066407fc0f Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-16 22:31:52 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 22:52:19 +0000 nd6: Remove anycast check in prelist_update RFC 2462 is obsoleted by RFC 4862 and it made statements more clear than before. Considering SLAAC can't create anycast addresses by itself, remove its check. While here, update comments based on RFC 4862. Reviewed by: markj, zlei Differential Revision: https://reviews.freebsd.org/D56134 --- sys/netinet6/nd6_rtr.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index a27df537ecdc..2a73007d5118 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1613,14 +1613,13 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, pfxrtr_add(pr, dr); /* - * 5.5.3 (d). If the prefix advertised is not equal to the prefix of + * 5.5.3 (d). If the prefix advertised is not equal to the prefix of * an address configured by stateless autoconfiguration already in the - * list of addresses associated with the interface, and the Valid - * Lifetime is not 0, form an address. We first check if we have - * a matching prefix. - * Note: we apply a clarification in rfc2462bis-02 here. We only - * consider autoconfigured addresses while RFC 4862 simply said - * "address". + * list of addresses associated with the interface (where "equal" + * means the two prefix lengths are the same and the first prefix-length + * bits of the prefixes are identical), + * and if the Valid Lifetime is not 0, form an address (and + * add it to the list). We first check if we have a matching prefix. */ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { struct in6_ifaddr *ifa6; @@ -1630,21 +1629,9 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, continue; ifa6 = (struct in6_ifaddr *)ifa; - - /* - * We only consider autoconfigured addresses as per rfc2462bis. - */ if (!(ifa6->ia6_flags & IN6_IFF_AUTOCONF)) continue; - /* - * Spec is not clear here, but I believe we should concentrate - * on unicast (i.e. not anycast) addresses. - * XXX: other ia6_flags? detached or duplicated? - */ - if ((ifa6->ia6_flags & IN6_IFF_ANYCAST) != 0) - continue; - /* * Ignore the address if it is not associated with a prefix * or is associated with a prefix that is different from this From nobody Fri Apr 17 22:58:45 2026 X-Original-To: dev-commits-src-main@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 4fy9Kl0Cwlz6ZGVX for ; Fri, 17 Apr 2026 22:58:51 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy9Kk4ZGbz3Slc for ; Fri, 17 Apr 2026 22:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466730; 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=d7ZKl8/lTP2IQ+8386W+jYrnXIVnV/lvZ4EFHKkbj9w=; b=xVTs1inBAGQJ/Q0OPkGpweji2g9ANcffq24011wTR2vZRZ0ze9qX89gF8oB1gZwp0VECeC 3hC5kOKuR98ySgJxtMwvDHXSnA1na2eGXKxY9oxw5xRskVf/RfrITVsoCU1CSAX4LM5pLd MKznDV4wVXcwzWmB54uds0z4R5EnU/SPmMa4HDK1iXZSAXUyGY7ectk7THErG7A/dDh1Tm RsdRVZlpqHrVzWQvrMsKtpZslFIcYjMSdkYWfXJuuXT5Q4DO4IISEbJkqk2E84nAsBX+q0 byncCg+E+t7lJ6lKtXs0ythONRFQ2awcRvRUH180mFbRLYKZA5Arnzg7nXxXNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776466730; a=rsa-sha256; cv=none; b=YUYnCctksIzSVFP+/PHyt2Z1TdCGu4dt4rOKLUypmPyHguPQZ7PvUWF280dl5oBqXUODCt WGsLLDranQJsGLCt57oipSbcx3nafLhSoSmidTdWuoaDaPx1pmw9aWG6k0+Mad2Mybz59N eghKMoLZAXYm4itm7/y0ElWEuXHWyfsjWjiN2C/eKJoLgEKb4oFkXRYxEPpXOMDrWHxQxq olkvaiaoV5U4wfKt83fwqvrNMm/RABCFm0F/REq5hoz+3inQdnr71xHx1vFmfsHiFg1K+F jjLKXW2jMljpNGQ64pXG3P9wk1d4Vm/lTgUy6uQQ/g7gaHmz8meSfFY+tFY3Mg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466730; 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=d7ZKl8/lTP2IQ+8386W+jYrnXIVnV/lvZ4EFHKkbj9w=; b=pCxWSmapnZZBzUQegcghhH2cTsKgeBkxFQcHSuDQhER1mlYRUOUOHX6TwKJMjM4XoshSQ0 q/B1cJQxsNd/sBMsnNxsRo+QIfA0flMB6KSTy04iVeKvDwr7gfvBOdywIz80CEHU5H0GJ6 H4hgFZQFCOvLRfF6Lae3q5HZ871+EYwlPOxS2IdvPNWu58R3qm4b/gPItyjIaxEXPn5o34 4JCxWl/Sg8zIidBZIwrHLPvK8J+JaWhhaFFOwUNlMZ+13ifUtFE+Vq96/xE8kdLj5ooDJa /DLpm5V6rndlHlWHnhT1Moflrp+/QYFS/Dn+/xg+6qsMSDmiDNcaEb4Yc7te4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy9Kk416fz1CJH for ; Fri, 17 Apr 2026 22:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 39818 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 22:58:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: d96e8cb4e728 - main - nd6: Break nd6_prefix_update out of prelist_update List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d96e8cb4e72847ac545423460af122fa14b2b1f1 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 22:58:45 +0000 Message-Id: <69e2bb25.39818.171c71b0@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=d96e8cb4e72847ac545423460af122fa14b2b1f1 commit d96e8cb4e72847ac545423460af122fa14b2b1f1 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-16 22:18:02 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 22:52:13 +0000 nd6: Break nd6_prefix_update out of prelist_update if PI exists, call prefix_update, instead of doing it inside the prelist_update. no functional change intended. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56130 --- sys/netinet6/nd6_rtr.c | 78 ++++++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 623bfd60918e..7b7db1b95e31 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1516,6 +1516,45 @@ nd6_prefix_del(struct nd_prefix *pr) pfxlist_onlink_check(); } +static void +nd6_prefix_update(struct nd_prefixctl *new, struct nd_prefix *pr) +{ + int error; + char ip6buf[INET6_ADDRSTRLEN]; + + /* + * Update prefix information. Note that the on-link (L) bit + * and the autonomous (A) bit should NOT be changed from 1 + * to 0. + */ + if (new->ndpr_raf_onlink == 1) + pr->ndpr_raf_onlink = 1; + if (new->ndpr_raf_auto == 1) + pr->ndpr_raf_auto = 1; + if (new->ndpr_raf_onlink != 0) { + pr->ndpr_vltime = new->ndpr_vltime; + pr->ndpr_pltime = new->ndpr_pltime; + in6_init_prefix_ltimes(pr); + pr->ndpr_lastupdate = time_uptime; + } + + if (new->ndpr_raf_onlink != 0 && + (pr->ndpr_stateflags & NDPRF_ONLINK) == 0) { + ND6_ONLINK_LOCK(); + if ((error = nd6_prefix_onlink(pr)) != 0) { + nd6log((LOG_ERR, + "%s: failed to make the prefix %s/%d " + "on-link on %s (errno=%d)\n", __func__, + ip6_sprintf(ip6buf, + &pr->ndpr_prefix.sin6_addr), + pr->ndpr_plen, if_name(pr->ndpr_ifp), + error)); + /* proceed anyway. XXX: is it correct? */ + } + ND6_ONLINK_UNLOCK(); + } +} + static int prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, bool auth, int mcast) @@ -1531,44 +1570,9 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, NET_EPOCH_ASSERT(); + /* check if prefix already exists on the same interface */ if ((pr = nd6_prefix_lookup(new)) != NULL) { - /* - * nd6_prefix_lookup() ensures that pr and new have the same - * prefix on a same interface. - */ - - /* - * Update prefix information. Note that the on-link (L) bit - * and the autonomous (A) bit should NOT be changed from 1 - * to 0. - */ - if (new->ndpr_raf_onlink == 1) - pr->ndpr_raf_onlink = 1; - if (new->ndpr_raf_auto == 1) - pr->ndpr_raf_auto = 1; - if (new->ndpr_raf_onlink) { - pr->ndpr_vltime = new->ndpr_vltime; - pr->ndpr_pltime = new->ndpr_pltime; - in6_init_prefix_ltimes(pr); - pr->ndpr_lastupdate = time_uptime; - } - - if (new->ndpr_raf_onlink && - (pr->ndpr_stateflags & NDPRF_ONLINK) == 0) { - ND6_ONLINK_LOCK(); - if ((error = nd6_prefix_onlink(pr)) != 0) { - nd6log((LOG_ERR, - "%s: failed to make the prefix %s/%d " - "on-link on %s (errno=%d)\n", __func__, - ip6_sprintf(ip6buf, - &pr->ndpr_prefix.sin6_addr), - pr->ndpr_plen, if_name(pr->ndpr_ifp), - error)); - /* proceed anyway. XXX: is it correct? */ - } - ND6_ONLINK_UNLOCK(); - } - + nd6_prefix_update(new, pr); if (dr != NULL) pfxrtr_add(pr, dr); } else { From nobody Fri Apr 17 22:58:50 2026 X-Original-To: dev-commits-src-main@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 4fy9Kl0y8Mz6ZGcG for ; Fri, 17 Apr 2026 22:58:51 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy9Kk6S9gz3SZg for ; Fri, 17 Apr 2026 22:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466730; 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=5czv4nfknqTsJT+wv/oYjBQHLTJK0r9C1AgYyyuNJyI=; b=vHe8AC+xl3pYf79uSEiJjMjLJLVoKXz5MCdvVSuuakR+/pTce0POxy9inOsPeq/kouS8oh G0+aW42f4rXqhZbvpJun9F6aZPRq9zQWq3XhzHRlrEHfZrtzUJyIoWYrzUdvdmL2BLGO5R D9h1mPDR0XOaXm165jJoqbbjZ/WMr43F9AhmFrFYyoflWLaYjBazz27/+PyRuDzitjV1Ad LsjoL4WRk1nnfJXTl673NmGJMts2gx6Y6eqApVrk+dk+VCoPTljsDk3EpEBEu1IcxMQ1Lk F5XYKu1atp0f+7EdX31gpPQ5FlV8TZkYkmn7dY8IYtKoAuiE6bxJcXYpfraLVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776466730; a=rsa-sha256; cv=none; b=wkLuObGoYXY+77rXQutaMsYB0WoF42xjg63+Xcwh0PtlGnpyFT4+db0yWFLzyUDcV+07SP NfAc0M3Iuo4OT0psT7lZYS3dldOz03tfwskBR4JZP1DC/0rD+5lB84K/Sc+bY4XloLRXXU q8isMk04xsCU+JICm3B5+NdEUx81c69ZhwZh7OlgsH1zOjaQRb+PrbWMjOmzYMoKLb77Eq wFRM/Rp/PoJRkSr6SsU4haKNTKCTqgvISpdluK+c0/csp4QjaQrSc0wiv8Dh9mLxajfRTR B2QqyCbkKOVY/R/RrKN3BATcxayA+fFh/0Md6SA8JsfnssojbO9VSTcNblObXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466730; 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=5czv4nfknqTsJT+wv/oYjBQHLTJK0r9C1AgYyyuNJyI=; b=SUYTLYwH4MmHtRqzUorux4uRTF3dubLUJVnm8CJIo4OuJDkeDSd6lPlyP2HXHBOQ1swz4e +Tuo5ipicVR381EhoCpTFWqiizTwFTzmlUXwX07Z6ruQtHY9yOYbNOVQNMh5Zu4FFxywYU U49brKdqaiYsBVuKFakGG7iJXpQZlBQrq1JlL+k1R7o8euKrB5EgPdzsIGjsIdPB1RD280 4sZJk2qsZxTsgmAT/537VsQga1/IrKrqysYgZdfRnUsG5oR79ZCXny6f09c2E3L346to7N JeA7lsJNBbOjI1bgPwHKKoO4v053V9aAyNY8No8LNdwfeMjCxkxeeK/7AgCwwQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy9Kk5c8Sz1CJJ for ; Fri, 17 Apr 2026 22:58:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 369f6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 22:58:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: 5f27592e149f - main - nd6: Break nd6_prefix_lifetime_update out of prelist_update List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f27592e149fbbb6318ef6c4b72482e1a7a41ef4 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 22:58:50 +0000 Message-Id: <69e2bb2a.369f6.41d75342@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=5f27592e149fbbb6318ef6c4b72482e1a7a41ef4 commit 5f27592e149fbbb6318ef6c4b72482e1a7a41ef4 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-17 14:16:51 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 22:52:21 +0000 nd6: Break nd6_prefix_lifetime_update out of prelist_update Logic of updating prefix lifetime is big enough that deserves its own function. While here, fix style. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D56135 --- sys/netinet6/nd6_rtr.c | 207 ++++++++++++++++++++++++------------------------- 1 file changed, 100 insertions(+), 107 deletions(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index 2a73007d5118..e0ea36586985 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1552,6 +1552,80 @@ nd6_prefix_update(struct nd_prefixctl *new, struct nd_prefix *pr) } } +/* + * RFC 4862 5.5.3 (e): update the lifetimes according to the "two hours" rule + * and the privacy extension. + * We apply some clarifications in rfc2462bis: + * - use remaininglifetime instead of storedlifetime as a variable name + * - remove the dead code in the "two-hour" rule + */ +static void +nd6_prefix_lifetime_update(struct nd_prefixctl *new, struct nd_prefix *pr, + struct in6_ifaddr *ia6, bool auth) +{ + struct in6_addrlifetime lt6_tmp; + uint32_t remaininglifetime; + + NET_EPOCH_ASSERT(); + +#define TWOHOUR (120*60) + lt6_tmp = ia6->ia6_lifetime; + if (lt6_tmp.ia6t_vltime == ND6_INFINITE_LIFETIME) + remaininglifetime = ND6_INFINITE_LIFETIME; + else if (time_uptime - ia6->ia6_updatetime > lt6_tmp.ia6t_vltime) + /* The case of "invalid" address. We should usually not see this case. */ + remaininglifetime = 0; + else + remaininglifetime = lt6_tmp.ia6t_vltime - (time_uptime - ia6->ia6_updatetime); + + /* when not updating, keep the current stored lifetime. */ + lt6_tmp.ia6t_vltime = remaininglifetime; + + if (TWOHOUR < new->ndpr_vltime || remaininglifetime < new->ndpr_vltime) { + lt6_tmp.ia6t_vltime = new->ndpr_vltime; + } else if (remaininglifetime <= TWOHOUR) { + if (auth) + lt6_tmp.ia6t_vltime = new->ndpr_vltime; + } else { + /* new->ndpr_vltime <= TWOHOUR && TWOHOUR < remaininglifetime */ + lt6_tmp.ia6t_vltime = TWOHOUR; + } + + /* The 2 hour rule is not imposed for preferred lifetime. */ + lt6_tmp.ia6t_pltime = new->ndpr_pltime; + + in6_init_address_ltimes(pr, <6_tmp); + + /* + * We need to treat lifetimes for temporary addresses differently, according + * to draft-ietf-ipv6-privacy-addrs-v2-01.txt 3.3 (1); + * we only update the lifetimes when they are in the maximum intervals. + */ + if ((ia6->ia6_flags & IN6_IFF_TEMPORARY) != 0) { + uint32_t maxvltime, maxpltime, vltime; + + vltime = time_uptime - ia6->ia6_createtime + V_ip6_desync_factor; + if (V_ip6_temp_valid_lifetime > vltime) + maxvltime = V_ip6_temp_valid_lifetime - vltime; + else + maxvltime = 0; + if (V_ip6_temp_preferred_lifetime > vltime) + maxpltime = V_ip6_temp_preferred_lifetime - vltime; + else + maxpltime = 0; + + if (lt6_tmp.ia6t_vltime == ND6_INFINITE_LIFETIME || + lt6_tmp.ia6t_vltime > maxvltime) + lt6_tmp.ia6t_vltime = maxvltime; + + if (lt6_tmp.ia6t_pltime == ND6_INFINITE_LIFETIME || + lt6_tmp.ia6t_pltime > maxpltime) + lt6_tmp.ia6t_pltime = maxpltime; + } + ia6->ia6_lifetime = lt6_tmp; + ia6->ia6_updatetime = time_uptime; +} + static void prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, bool auth, int mcast) @@ -1561,7 +1635,6 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, struct ifnet *ifp = new->ndpr_ifp; struct nd_prefix *pr; int error = 0; - struct in6_addrlifetime lt6_tmp; char ip6buf[INET6_ADDRSTRLEN]; bool has_temporary = false; @@ -1622,14 +1695,13 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, * add it to the list). We first check if we have a matching prefix. */ CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - struct in6_ifaddr *ifa6; - uint32_t remaininglifetime; + struct in6_ifaddr *ia6; if (ifa->ifa_addr->sa_family != AF_INET6) continue; - ifa6 = (struct in6_ifaddr *)ifa; - if (!(ifa6->ia6_flags & IN6_IFF_AUTOCONF)) + ia6 = (struct in6_ifaddr *)ifa; + if ((ia6->ia6_flags & IN6_IFF_AUTOCONF) == 0) continue; /* @@ -1637,122 +1709,43 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, * or is associated with a prefix that is different from this * one. (pr is never NULL here) */ - if (ifa6->ia6_ndpr != pr) + if (ia6->ia6_ndpr != pr) continue; /* - * An already autoconfigured address matched. Now that we - * are sure there is at least one matched address, we can - * proceed to 5.5.3. (e): update the lifetimes according to the - * "two hours" rule and the privacy extension. - * We apply some clarifications in rfc2462bis: - * - use remaininglifetime instead of storedlifetime as a - * variable name - * - remove the dead code in the "two-hour" rule + * An already autoconfigured address matched. + * Now that we are sure there is at least one matched address. */ -#define TWOHOUR (120*60) - lt6_tmp = ifa6->ia6_lifetime; + nd6_prefix_lifetime_update(new, pr, ia6, auth); - if (lt6_tmp.ia6t_vltime == ND6_INFINITE_LIFETIME) - remaininglifetime = ND6_INFINITE_LIFETIME; - else if (time_uptime - ifa6->ia6_updatetime > - lt6_tmp.ia6t_vltime) { + if ((ifp->if_inet6->nd_flags & ND6_IFF_STABLEADDR) != 0) { /* - * The case of "invalid" address. We should usually - * not see this case. + * if stable addresses (RFC 7217) are enabled, mark that + * a temporary address has been found to avoid generating + * uneeded extra ones. */ - remaininglifetime = 0; - } else - remaininglifetime = lt6_tmp.ia6t_vltime - - (time_uptime - ifa6->ia6_updatetime); - - /* when not updating, keep the current stored lifetime. */ - lt6_tmp.ia6t_vltime = remaininglifetime; - - if (TWOHOUR < new->ndpr_vltime || - remaininglifetime < new->ndpr_vltime) { - lt6_tmp.ia6t_vltime = new->ndpr_vltime; - } else if (remaininglifetime <= TWOHOUR) { - if (auth) { - lt6_tmp.ia6t_vltime = new->ndpr_vltime; - } - } else { - /* - * new->ndpr_vltime <= TWOHOUR && - * TWOHOUR < remaininglifetime - */ - lt6_tmp.ia6t_vltime = TWOHOUR; - } - - /* The 2 hour rule is not imposed for preferred lifetime. */ - lt6_tmp.ia6t_pltime = new->ndpr_pltime; - - in6_init_address_ltimes(pr, <6_tmp); - - /* - * We need to treat lifetimes for temporary addresses - * differently, according to - * draft-ietf-ipv6-privacy-addrs-v2-01.txt 3.3 (1); - * we only update the lifetimes when they are in the maximum - * intervals. - */ - if ((ifa6->ia6_flags & IN6_IFF_TEMPORARY) != 0) { - u_int32_t maxvltime, maxpltime; + if ((ia6->ia6_flags & IN6_IFF_TEMPORARY) != 0) + has_temporary = true; /* - * if stable addresses (RFC 7217) are enabled, mark that a temporary address has been found - * to avoid generating uneeded extra ones. + * If using stable addresses (RFC 7217) and we still have retries + * to perform, ignore addresses already marked as duplicated, since + * a new one will be generated. Also ignore addresses marked as + * temporary, since their generation is orthogonal to opaque stable ones. + * + * There is a small race condition, in that the dad_counter could be + * incremented between here and when a new address is generated, but this + * will cause that generation to fail and no further retries should happen. */ - if (ifp->if_inet6->nd_flags & ND6_IFF_STABLEADDR) - has_temporary = true; - - if (V_ip6_temp_valid_lifetime > - (u_int32_t)((time_uptime - ifa6->ia6_createtime) + - V_ip6_desync_factor)) { - maxvltime = V_ip6_temp_valid_lifetime - - (time_uptime - ifa6->ia6_createtime) - - V_ip6_desync_factor; - } else - maxvltime = 0; - if (V_ip6_temp_preferred_lifetime > - (u_int32_t)((time_uptime - ifa6->ia6_createtime) + - V_ip6_desync_factor)) { - maxpltime = V_ip6_temp_preferred_lifetime - - (time_uptime - ifa6->ia6_createtime) - - V_ip6_desync_factor; - } else - maxpltime = 0; - - if (lt6_tmp.ia6t_vltime == ND6_INFINITE_LIFETIME || - lt6_tmp.ia6t_vltime > maxvltime) { - lt6_tmp.ia6t_vltime = maxvltime; - } - if (lt6_tmp.ia6t_pltime == ND6_INFINITE_LIFETIME || - lt6_tmp.ia6t_pltime > maxpltime) { - lt6_tmp.ia6t_pltime = maxpltime; - } + if (atomic_load_int(&DAD_FAILURES(ifp)) <= V_ip6_stableaddr_maxretries && + (ia6->ia6_flags & (IN6_IFF_DUPLICATED | IN6_IFF_TEMPORARY)) != 0) + continue; } - ifa6->ia6_lifetime = lt6_tmp; - ifa6->ia6_updatetime = time_uptime; - - /* - * If using stable addresses (RFC 7217) and we still have retries to perform, ignore - * addresses already marked as duplicated, since a new one will be generated. - * Also ignore addresses marked as temporary, since their generation is orthogonal to - * opaque stable ones. - * - * There is a small race condition, in that the dad_counter could be incremented - * between here and when a new address is generated, but this will cause that generation - * to fail and no further retries should happen. - */ - if (ifp->if_inet6->nd_flags & ND6_IFF_STABLEADDR && - atomic_load_int(&DAD_FAILURES(ifp)) <= V_ip6_stableaddr_maxretries && - ifa6->ia6_flags & (IN6_IFF_DUPLICATED | IN6_IFF_TEMPORARY)) - continue; if (ia6_match == NULL) /* remember the first one */ - ia6_match = ifa6; + ia6_match = ia6; } + if (ia6_match == NULL && new->ndpr_vltime) { int ifidlen; From nobody Fri Apr 17 22:58:51 2026 X-Original-To: dev-commits-src-main@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 4fy9Km2Y93z6ZGcJ for ; Fri, 17 Apr 2026 22:58:52 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy9Kl6rn0z3SpW for ; Fri, 17 Apr 2026 22:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466732; 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=sqkgNgzvHGQQaPfAiS7zYOBXKeuj6rqo/AffIR0Qpnk=; b=POa/CqSGJj/PWiRoV2iCvupqqUFddQO7GZmzBTjSJ3hDAhfE01c+GFxyy/sgr1FyV0qIOw HPxLa/JPw+1cX4kCfB1MOP88dWK8Tv4r89wNRW6m2aFLEFFmOri+PTEiPJJkmm7IuIZfiG TVN0TzK+5My/cGgmSdL/7YPf8R1G92SYkWdq7WuINplAQyZgLyyLaHezart6AGMkVVag95 4L6Wy8iVmB6KsbCZmgsmprvlUanaOoVimkXdy3vdr5yh6Gj0aHyFrgp+5JaucMLmABiDLd vSJifRTRlZlKvcSBZFLZieotMWPAPut8bSvlWpg+F8KKHychLiEiqTPKT+nVaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776466732; a=rsa-sha256; cv=none; b=EKZYIEk7rntANfgy3hScem0dyo7GHJglOCQZUY67bKqwH5E/h8UZhA8ahSaohhLZ5tmcTI 0zOLmjjxr3EY1ODN8Xh/Rpga/Xp4A32zAI0/QZ6pkWOePxJuYgwZnKUuxR28sWa1ikGgLL FI8/1TRy7FURxTk0qsvBcbAeR15UkfTB9p41RfYp24SqsXn0ALRvbBJa7nYth37IyJuUdJ lBmPfJsEcWE+/yoi1G/Dq/378Eseoca1lPAp4W0kXqKJBKeXv/1rcUr6mAHKty92gH50Xf nXxemXkN/fQAFy2QCSnRL0SKZK1/X8d1umRiKk747wcb8v7NQRyjNFP/twrJgg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466732; 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=sqkgNgzvHGQQaPfAiS7zYOBXKeuj6rqo/AffIR0Qpnk=; b=WhCOf7xB6z5TxkdZ5fTxvolli9rWiF1pJHkCUw4Ks2uxu6OUXZI7R1lT2fQtQ5Ta5Fu27b pjnQcAlqFjFWj/UqqjTjQUVl5uUy13CQPYGdBth+VRMTbjzAAXeATOVlRpmtzmckkEEwhM lVGXadNEpNyFraeUsGwvjpsQvSj/NH61u1lEkBjWc9EuTTGRiGo8qUQ39JH5SAZvOk7TRu QzWzfLRr9jQ5uJP57mY+li+hH2ZTr5UAiFAXsfh2xGjJpdZGt11Y9dJ/lzQLODPQRBE7uF LlgBIZL8f6kWUhdPv7tIiLDrDRVMtW7/E5C7xsyPFQoKCLy7NDViSI2nKURwKA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy9Kl6T0tz1C90 for ; Fri, 17 Apr 2026 22:58:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38d07 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 22:58:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: 72043945c3c6 - main - nd6: Remove goto and unused condition in prelist_update List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72043945c3c6e924ac57ace76ec0a4447d05d905 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 22:58:51 +0000 Message-Id: <69e2bb2b.38d07.63bed8b7@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=72043945c3c6e924ac57ace76ec0a4447d05d905 commit 72043945c3c6e924ac57ace76ec0a4447d05d905 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-17 16:57:47 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 22:52:23 +0000 nd6: Remove goto and unused condition in prelist_update While here, style it. Reviewed by: markj, zlei Differential Revision: https://reviews.freebsd.org/D56136 --- sys/netinet6/nd6_rtr.c | 41 +++++++++++++---------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/sys/netinet6/nd6_rtr.c b/sys/netinet6/nd6_rtr.c index e0ea36586985..637f00bef2c9 100644 --- a/sys/netinet6/nd6_rtr.c +++ b/sys/netinet6/nd6_rtr.c @@ -1746,38 +1746,26 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, ia6_match = ia6; } - if (ia6_match == NULL && new->ndpr_vltime) { + /* + * 5.5.3 (d) (continued) + * If no address matched and the valid lifetime is non-zero, + * create a new address. + */ + if (ia6_match == NULL && new->ndpr_vltime != 0) { int ifidlen; - /* - * 5.5.3 (d) (continued) - * No address matched and the valid lifetime is non-zero. - * Create a new address. - */ - /* * Prefix Length check: * If the sum of the prefix length and interface identifier * length does not equal 128 bits, the Prefix Information * option MUST be ignored. The length of the interface - * identifier is defined in a separate link-type specific - * document. + * identifier is defined in a separate link-type specific document. */ ifidlen = in6_if2idlen(ifp); - if (ifidlen < 0) { - /* this should not happen, so we always log it. */ - log(LOG_ERR, "prelist_update: IFID undefined (%s)\n", - if_name(ifp)); - goto end; - } if (ifidlen + pr->ndpr_plen != 128) { - nd6log((LOG_INFO, - "%s: invalid prefixlen %d for %s, ignored\n", + nd6log((LOG_INFO, "%s: invalid prefixlen %d for %s, ignored\n", __func__, pr->ndpr_plen, if_name(ifp))); - goto end; - } - - if ((ia6 = in6_ifadd(new, mcast)) != NULL) { + } else if ((ia6 = in6_ifadd(new, mcast)) != NULL) { /* * note that we should use pr (not new) for reference. */ @@ -1789,8 +1777,7 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, * When a new public address is created as described * in RFC2462, also create a new temporary address. * - * RFC 3041 3.5. - * When an interface connects to a new link, a new + * 3.5: When an interface connects to a new link, a new * randomized interface identifier should be generated * immediately together with a new set of temporary * addresses. Thus, we specifiy 1 as the 2nd arg of @@ -1802,9 +1789,9 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, if (V_ip6_use_tempaddr && !has_temporary) { int e; if ((e = in6_tmpifadd(ia6, 1, 1)) != 0) { - nd6log((LOG_NOTICE, "%s: failed to " - "create a temporary address " - "(errno=%d)\n", __func__, e)); + nd6log((LOG_NOTICE, + "%s: failed to create a temporary address (errno=%d)\n", + __func__, e)); } } ifa_free(&ia6->ia_ifa); @@ -1818,9 +1805,7 @@ prelist_update(struct nd_prefixctl *new, struct nd_defrouter *dr, } } -end: nd6_prefix_rele(pr); - return; } /* From nobody Fri Apr 17 22:58:52 2026 X-Original-To: dev-commits-src-main@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 4fy9Kn1SBYz6ZGVj for ; Fri, 17 Apr 2026 22:58:53 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy9Kn0gGzz3Sjk for ; Fri, 17 Apr 2026 22:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466733; 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=CuB5fBeX1W+DjAMbgpj4tVTPQnb3UwfFLNriFcHJYac=; b=Dnu4D5E1lwy3qQnqliex5CEKa2+HEk0QM8sE15HdaTVIIZDkyhjT6lCQDQ+swqqS6A3JsQ Hxsi66CO0O5bYBB3w/xe96BR220s3/pvCTRYrlx0MptUfkaa8s799S01YAbi/rtSaK0Pyz knUbreI4f0fOiFIbTV6GeynM2wQNAMbq25Qbm9VEIPN+/Y3470DUbbMH81qkQsnvInphV1 40ZKn/vo3Ew8Lsj6ceicEiwMbk2c715AHD3SAllZ4dQLyCqJ+0Y8qcCv18BguYLA/uz32U g1xn76uAWcPtpeNHSmCucLPf+Qw67L9yAZkx/g/misjmhzxVn5UNtVz5WVo53w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776466733; a=rsa-sha256; cv=none; b=DlyT40WacvcJbfeLw/S45jHN5LHwXHemo1DQ1RINOW9SHRKbnHRiEbyGHgvfrxyVV/pP3h rmh2fw5t86TnUYcECeF2obCSKK4YZ7lpl9IH3ui41QR7Cm8L6PmUbe2TbVJcZh8qFlHm2w ArzR96bQPL54qFg60xUYeC++V2JHOCqKJKCk7GcCsrq8C1Nn6N8HfQ+U3rMaC8UYbyV4mG XHw2UhI35U/4u4lqVrY2xKoeyr3gB+Kg5DibyLfZhIqlfBrNurcbzoISsf7yR9StCzIQMP 3ALoj9IWm9qPY3+Yt0mYqRIVdx64mJ46bqEKrXK34NDVxVr/lRPcquBbwXqFzA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466733; 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=CuB5fBeX1W+DjAMbgpj4tVTPQnb3UwfFLNriFcHJYac=; b=ODSScPlUQXjPNYMPSnLXRFOJ70ZF0vwHjYK0zQSkNbFHiKISHPQ+RtWBxfaPVJ4KZ7QgY4 RXWwCc27f/FMP/o3Q2B10HZsHknE4ji2joDC9a6kcwPTbqBmPMqgZtfjBHZXiVO7cVcUKE s1YFQOWdedy5LGljYQnPfrtPHkn0I62BQrrqR+UpfkJhEsBI2vMk4oktza1C5/suM8jUpK VvRm+6OVP9UM7RWRacvrBtXWJ6A7dhScC0W/WkBXKk/ss12a3PrPx7/fHkdXL0uzfemnMa cmBCecob0hc7rEsdaIxmhMVupsWHz16A+PijBJajyuUUrYewF7D+XTSCRvQ85g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy9Kn02TPz1CJL for ; Fri, 17 Apr 2026 22:58:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 38d97 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 22:58:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: c173f02045c8 - main - tests/netinet6: Add SLAAC and RA validation tests to ndp List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c173f02045c8cfae219b26be99f9e02f291965fa Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 22:58:52 +0000 Message-Id: <69e2bb2c.38d97.5dd41652@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=c173f02045c8cfae219b26be99f9e02f291965fa commit c173f02045c8cfae219b26be99f9e02f291965fa Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-17 20:25:18 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 22:52:24 +0000 tests/netinet6: Add SLAAC and RA validation tests to ndp * RA hop limit validation * RA source address validation * Multi router RA validation * Two hour rule RA validation * SLAAC onlink prefix switching test Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D56128 --- tests/sys/netinet6/ndp.sh | 385 +++++++++++++++++++++++++++++++++++++++++++++- tests/sys/netinet6/ra.py | 21 ++- 2 files changed, 397 insertions(+), 9 deletions(-) diff --git a/tests/sys/netinet6/ndp.sh b/tests/sys/netinet6/ndp.sh index 526ef27a7fb3..035f8fc9989f 100755 --- a/tests/sys/netinet6/ndp.sh +++ b/tests/sys/netinet6/ndp.sh @@ -3,6 +3,7 @@ # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2021 Alexander V. Chernikov +# Copyright (c) 2026 Pouria Mousavizadeh Tehrani # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -300,23 +301,28 @@ ndp_prefix_lifetime_extend_head() { get_prefix_attr() { local prefix=$1 local attr=$2 + local jail="" - ndp -p --libxo json | \ + if [ -n "$3" ]; then + jail="jexec $3" + fi + + ${jail} ndp -p --libxo json | \ jq -r '.ndp.["prefix-list"][] | select(.prefix == "'${prefix}'") | .["'${attr}'"]' } # Given a prefix, return its expiry time in seconds. prefix_expiry() { - get_prefix_attr $1 "expires_sec" + get_prefix_attr $1 "expires_sec" $2 } # Given a prefix, return its valid and preferred lifetimes. prefix_lifetimes() { local p v - v=$(get_prefix_attr $1 "valid-lifetime") - p=$(get_prefix_attr $1 "preferred-lifetime") + v=$(get_prefix_attr $1 "valid-lifetime" $2) + p=$(get_prefix_attr $1 "preferred-lifetime" $2) echo $v $p } @@ -372,7 +378,7 @@ ndp_grand_linklayer_event_head() { } ndp_grand_linklayer_event_body() { - local epair0 jname address mac + local epair0 jname prefix address mac vnet_init @@ -414,13 +420,382 @@ ndp_grand_linklayer_event_body() { jexec ${jname}2 ndp -n ${prefix}1 } +ndp_grand_linklayer_event_cleanup() { + vnet_cleanup +} + +atf_test_case "ndp_input_validation_hlim" "cleanup" +ndp_input_validation_hlim_head() { + atf_set descr 'Test RFC 4861 section 6.1.2: RA hop limit validation' + atf_set require.user root + atf_set require.progs python3 scapy +} + +ndp_input_validation_hlim_body() { + local epair0 jname + + vnet_init + + jname="v6t-ndp_input_validation_hlim" + + epair0=$(vnet_mkepair) + + vnet_mkjail ${jname} ${epair0}a + + ndp_if_up ${epair0}a ${jname} + ndp_if_up ${epair0}b + atf_check jexec ${jname} ifconfig ${epair0}a inet6 accept_rtadv + + # Make sure that NAs from us are flagged as coming from a router. + atf_check -o ignore sysctl net.inet6.ip6.forwarding=1 + + # Send an invalid RA advertising a prefix. + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ + --sendif ${epair0}b \ + --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ + --src $(ndp_if_lladdr ${epair0}b) \ + --hoplimit 254 + + # Wait to make sure no router would appear. + sleep 0.5 + atf_check -o empty jexec ${jname} ndp -r +} + +ndp_input_validation_hlim_cleanup() { + vnet_cleanup +} + +atf_test_case "ndp_input_validation_src_linklocal" "cleanup" +ndp_input_validation_src_linklocal_head() { + atf_set descr 'Test RFC 4861 section 6.1.2: RA source address must be link-local' + atf_set require.user root + atf_set require.progs python3 scapy +} + +ndp_input_validation_src_linklocal_body() { + local epair0 jname + + vnet_init + + jname="v6t-ndp_input_validation_src_linklocal" + + epair0=$(vnet_mkepair) + + vnet_mkjail ${jname} ${epair0}a + + ndp_if_up ${epair0}a ${jname} + ndp_if_up ${epair0}b + atf_check jexec ${jname} ifconfig ${epair0}a inet6 accept_rtadv + + # Make sure that NAs from us are flagged as coming from a router. + atf_check -o ignore sysctl net.inet6.ip6.forwarding=1 + + # Send an invalid RA with multicast source. + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ + --sendif ${epair0}b \ + --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ + --src ff02::2 + + # Send an invalid RA with global unicast source. + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ + --sendif ${epair0}b \ + --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ + --src 3fff::1 + + # Wait to make sure no router would appear. + sleep 0.5 + atf_check -o empty jexec ${jname} ndp -r +} + +ndp_input_validation_src_linklocal_cleanup() { + vnet_cleanup +} + +atf_test_case "ndp_multirouter_pref" "cleanup" +ndp_multirouter_pref_head() { + atf_set descr 'Test RFC 4861 section 6.3.4: multiple routers with different pref' + atf_set require.user root + atf_set require.progs jq python3 scapy +} + +ndp_multirouter_pref_body() { + local epair0 jname prefix lladdr advrtrs + + vnet_init + + jname="v6t-ndp_multirouter_pref" + prefix="2001:db8:ffff:1000::" + + epair0=$(vnet_mkepair) + + vnet_mkjail ${jname} ${epair0}a + + ndp_if_up ${epair0}a ${jname} + ndp_if_up ${epair0}b + atf_check jexec ${jname} ifconfig ${epair0}a inet6 accept_rtadv + + # Make sure that NAs from us are flagged as coming from a router. + atf_check -o ignore sysctl net.inet6.ip6.forwarding=1 + + lladdr="$(ndp_if_lladdr ${epair0}b)" + lladdr="${lladdr%?}a" + # Send an RA with high preference. + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ + --sendif ${epair0}b \ + --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ + --src ${lladdr} \ + --rtrpref 1 --prefix ${prefix} \ + --validlifetime 10 --preferredlifetime 5 + + lladdr="${lladdr%?}b" + # Send an RA with medium preference. + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ + --sendif ${epair0}b \ + --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ + --src ${lladdr} \ + --rtrpref 0 --prefix ${prefix} \ + --validlifetime 10 --preferredlifetime 5 + + lladdr="${lladdr%?}c" + # Send an RA with low preference. + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ + --sendif ${epair0}b \ + --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ + --src ${lladdr} \ + --rtrpref 3 --prefix ${prefix} \ + --validlifetime 10 --preferredlifetime 5 + + # Wait for a default router to appear. + while [ "$(jexec ${jname} ndp -r | wc -l)" -ne 3 ]; do + sleep 0.01 + done + atf_check -s exit:0 \ + -o match:"^${lladdr%?}a%${epair0}a if=${epair0}a, flags=, pref=high,.*" \ + -o match:"^${lladdr%?}b%${epair0}a if=${epair0}a, flags=, pref=medium,.*" \ + -o match:"^${lladdr%?}c%${epair0}a if=${epair0}a, flags=, pref=low,.*" \ + jexec ${jname} ndp -r + + # Make sure a default route is being installed + # XXX: for now, does not matter which router + atf_check -o match:"^default[[:space:]]+${lladdr%?}" \ + jexec ${jname} netstat -rn6 + + # Make sure ndp knows about prefix advertising routers. + advrtrs=$(get_prefix_attr ${prefix}/64 "advertising-routers" "${jname}" | \ + jq -r '. | length') + if [ "${advrtrs}" -ne 3 ]; then + atf_fail "Unexpected number of advertising routers: ${advrtrs}" + fi +} + +ndp_muiltirouter_pref_cleanup() { + vnet_cleanup +} + +atf_test_case "ndp_slaac_twohour_rule" "cleanup" +ndp_slaac_twohour_rule_head() { + atf_set descr 'Test RFC 4862 section 5.5.3 (e): Two hour rule' + atf_set require.user root + atf_set require.progs jq python3 scapy +} + +ndp_slaac_twohour_rule_body() { + local epair0 jname prefix ex1 ex2 + + vnet_init + + jname="v6t-ndp_slaac_twohour_rule" + prefix="2001:db8:ffff:1000::" + + epair0=$(vnet_mkepair) + + vnet_mkjail ${jname} ${epair0}a + + ndp_if_up ${epair0}a ${jname} + ndp_if_up ${epair0}b + atf_check jexec ${jname} ifconfig ${epair0}a inet6 accept_rtadv + + # Make sure that NAs from us are flagged as coming from a router. + atf_check -o ignore sysctl net.inet6.ip6.forwarding=1 + + # Send an RA with 1 hour lifetime + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ + --sendif ${epair0}b \ + --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ + --src $(ndp_if_lladdr ${epair0}b) \ + --prefix ${prefix} --prefixlen 64 \ + --validlifetime 3600 --preferredlifetime 3600 + + # Wait for a default router to appear. + while [ -z "$(jexec ${jname} ndp -r)" ]; do + sleep 0.01 + done + ex1=$(prefix_expiry ${prefix}/64 "${jname}") + + # Set the address lifetime to 2 hours and verify that the prefix is updated. + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ + --sendif ${epair0}b \ + --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ + --src $(ndp_if_lladdr ${epair0}b) \ + --prefix ${prefix} --prefixlen 64 \ + --validlifetime 7200 --preferredlifetime 7200 + + # Verify that ndp sets the correct value from RA. + ex2=$(prefix_expiry ${prefix}/64 "${jname}") + if [ "${ex2}" -le "${ex1}" ]; then + atf_fail "Unexpected expiry time: ${ex2} <= ${ex1}" + fi + # Verify that address also updated the valid lifetime. + ex2=$(ifconfig -j "${jname}" ${epair0}a inet6 | grep vltime | awk '{print $NF}' ) + if [ "${ex2}" -le 3600 ]; then + atf_fail "Unexpected expiry time: ${ex2} <= ${ex1}" + fi + + # Set the address lifetime to 1 Hour and verify that + # the address of prefix is NOT updated to 1 hour. + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ + --sendif ${epair0}b \ + --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ + --src $(ndp_if_lladdr ${epair0}b) \ + --prefix ${prefix} --prefixlen 64 \ + --validlifetime 3600 --preferredlifetime 3600 + + # Verify that ndp sets the received value from RA. + ex2=$(prefix_expiry ${prefix}/64 "${jname}") + if [ "${ex2}" -gt 3600 ]; then + atf_fail "Unexpected ndp expiry time: ${ex2} > 3600" + fi + # Verify that address NOT updated the valid lifetime. + ex2=$(ifconfig -j "${jname}" ${epair0}a inet6 | grep vltime | awk '{print $NF}' ) + if [ "${ex2}" -le 3600 ]; then + atf_fail "Unexpected expiry time: ${ex2} <= 3600" + fi +} + +ndp_slaac_twohour_rule_cleanup() { + vnet_cleanup +} + +get_iface_prefix_flags() { + local prefix=$1 + local iface=$2 + local jail="" + + if [ -n "$3" ]; then + jail="jexec $3" + fi + + ${jail} ndp -p --libxo json | \ + jq -r '.ndp.["prefix-list"][] | + select((.prefix == "'${prefix}'") and .interface == "'${iface}'") | + .flags' +} + +atf_test_case "ndp_slaac_switch_onlink_prefix" "cleanup" +ndp_slaac_switch_onlink_prefix_head() { + atf_set descr 'Test SLAAC onlink prefix switching when prefix received via multiple interfaces' + atf_set require.user root +} + +ndp_slaac_switch_onlink_prefix_body() { + local epair0 epair1 jname prefix lladdr1 lladdr2 f1 f2 + + vnet_init + + jname="v6t-ndp_slaac_switch_onlink_prefix" + prefix="2001:db8:ffff:1000::" + + epair0=$(vnet_mkepair) + epair1=$(vnet_mkepair) + + vnet_mkjail ${jname} ${epair0}a + atf_check ifconfig ${epair1}a vnet ${jname} + + ndp_if_up ${epair0}a ${jname} + ndp_if_up ${epair1}a ${jname} + ndp_if_up ${epair0}b + ndp_if_up ${epair1}b + + atf_check ifconfig -j ${jname} ${epair0}a inet6 accept_rtadv + atf_check ifconfig -j ${jname} ${epair1}a inet6 accept_rtadv + lladdr0=$(ndp_if_lladdr ${epair0}b) + lladdr1=$(ndp_if_lladdr ${epair1}b) + + # Send an RA with high pref from epair0 + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ + --sendif ${epair0}b \ + --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ + --src ${lladdr0} \ + --rtrpref 1 --prefix ${prefix} \ + --validlifetime 10 --preferredlifetime 5 + + # Send an RA with medium pref from epair1 + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ + --sendif ${epair1}b \ + --dst $(ndp_if_lladdr ${epair1}a ${jname}) \ + --src ${lladdr1} \ + --rtrpref 0 --prefix ${prefix} \ + --validlifetime 10 --preferredlifetime 5 + + # Wait for a default router to appear. + while [ -z "$(jexec ${jname} ndp -r)" ]; do + sleep 0.01 + done + + # Verify that we have a default route to epair0a + atf_check -o match:"^default[[:space:]]+${lladdr0}" \ + jexec ${jname} netstat -rn6 + + # Verify that epair0a is_onlink and epair1a is_detached + f1=$(get_iface_prefix_flags "${prefix}/64" "${epair0}a" "${jname}") + f2=$(get_iface_prefix_flags "${prefix}/64" "${epair1}a" "${jname}") + if [ "${f1}" != "LAO" ]; then + atf_fail "Unexpected prefix flags on epair0a: ${f1}" + fi + if [ "${f2}" != "LAD" ]; then + atf_fail "Unexpected prefix flags on epair1a: ${f2}" + fi + + # Send an RA to withdraw prefix from epair0 + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ + --sendif ${epair0}b \ + --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ + --src ${lladdr0} \ + --rtrpref 1 --rtrltime 0 --prefix ${prefix} \ + --validlifetime 0 --preferredlifetime 0 + + # Verify that epair1a is_onlink and epair0a is not + while [ "$(get_iface_prefix_flags ${prefix}/64 ${epair0}a ${jname})" == "LAO" ]; + do + sleep 0.1 + done + f2=$(get_iface_prefix_flags "${prefix}/64" "${epair1}a" "${jname}") + if [ "${f2}" != "LAO" ]; then + atf_fail "Unexpected prefix flags on epair1a: ${f2}" + fi + + # Verify that we have a default route to epair1a + atf_check -o match:"^default[[:space:]]+${lladdr1}" \ + jexec ${jname} netstat -rn6 +} + +ndp_slaac_switch_onlink_prefix_cleanup() { + vnet_cleanup +} + + atf_init_test_cases() { atf_add_test_case "ndp_add_gu_success" atf_add_test_case "ndp_del_gu_success" atf_add_test_case "ndp_slaac_default_route" + atf_add_test_case "ndp_slaac_twohour_rule" + atf_add_test_case "ndp_slaac_switch_onlink_prefix" atf_add_test_case "ndp_prefix_len_mismatch" atf_add_test_case "ndp_prefix_lifetime" atf_add_test_case "ndp_prefix_lifetime_extend" atf_add_test_case "ndp_grand_linklayer_event" + atf_add_test_case "ndp_input_validation_hlim" + atf_add_test_case "ndp_input_validation_src_linklocal" + atf_add_test_case "ndp_multirouter_pref" } diff --git a/tests/sys/netinet6/ra.py b/tests/sys/netinet6/ra.py index 1b08c3e53c05..f71ab4b7499e 100644 --- a/tests/sys/netinet6/ra.py +++ b/tests/sys/netinet6/ra.py @@ -21,9 +21,19 @@ def main(): help='The source IP address') parser.add_argument('--dst', nargs=1, required=True, help='The destination IP address') - parser.add_argument('--prefix', nargs=1, required=True, + parser.add_argument('--hoplimit', nargs=1, required=False, + type=int, default=255, + help='The hop limit of IPv6 packet') + parser.add_argument('--rtrpref', nargs=1, required=False, + type=int, default=1, + help='The router preference advertised') + parser.add_argument('--rtrltime', nargs=1, required=False, + type=int, default=1800, + help='The router preference advertised') + parser.add_argument('--prefix', nargs=1, required=False, help='The prefix to be advertised') - parser.add_argument('--prefixlen', nargs=1, required=True, type=int, + parser.add_argument('--prefixlen', nargs=1, required=False, + type=int, default=64, help='The prefix length to be advertised') parser.add_argument('--validlifetime', nargs=1, required=False, type=int, default=4294967295, @@ -34,8 +44,11 @@ def main(): args = parser.parse_args() pkt = sp.Ether() / \ - sp.IPv6(src=args.src, dst=args.dst) / \ - sp.ICMPv6ND_RA(chlim=64) / \ + sp.IPv6(src=args.src, dst=args.dst, hlim=args.hoplimit) / \ + sp.ICMPv6ND_RA(chlim=64, prf=args.rtrpref, routerlifetime=args.rtrltime) + + if (args.prefix): + pkt = pkt / \ sp.ICMPv6NDOptPrefixInfo(prefix=args.prefix, prefixlen=args.prefixlen, validlifetime=args.validlifetime, From nobody Fri Apr 17 22:58:54 2026 X-Original-To: dev-commits-src-main@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 4fy9Kp4FW1z6ZGZD for ; Fri, 17 Apr 2026 22:58:54 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fy9Kp1Rqmz3SvC for ; Fri, 17 Apr 2026 22:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466734; 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=DpyAp1vkYFnygGpw5auGA3CQAn35F3UXO5a2To3WCXc=; b=khyU+tt/OWSWrDlJ/H88xkq3e/EGfvOCuS/rxVxVBH3+JNGIhhkwCMDJud3VfJaM/+rqlX 4LQ4LBmK5PO9thKrP4OI2XM+9WGx0RMMvflQHpsq+Mpg2B4IrLtB7E5G6jHGJSa51Lb8QR 4eWx253139X++S8zU6YVpanzAXqZlmUQXMKXEz7YVyDQVjAcaGGtVJ+kLQSpP+eE9hqkJe ZvCSFuanbZsMwUowoorg4yR2/lEc2ZJSuFrgAs0yMRa5KtBBz7ZwCBM1/Rg7CyO7arWMVW sCqzDrrF9H01z7DQzdWX+NwEsP9dVPhv1lUFserCJfxj2EgzjtzgYFSZ4NDN1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776466734; a=rsa-sha256; cv=none; b=vO8MaHxVLRGLkXKgFQoU/EpKXQ9wpR77kXlxHnFKxL2kuertcTZ7kD9n9p/GbJdA1drVq6 gWZs6tCdobaiEK51td2+Jc2vPV49soexFhcqrRT8pmGckWj/+KnJNBHgNnbnHdYPUxsktT nBfk7fNKL7BpQ4XIJKMlLWYZ0KcEgEBiIDloPk0Br3CoG7+lbsOBarCcfBDiDautUOqPuR t02uC5gNX56Az9y+LUPSlCQuufa1lTX3NQxOUKU5W6/KpSx2WqAPzMWwCCFKJiXNtS5L6E RASYOQXwAA+7wL4ScuO/vxyW3bXUs9eLcNQInbdrcX4CRb0+1Hyhx1dnK+weXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776466734; 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=DpyAp1vkYFnygGpw5auGA3CQAn35F3UXO5a2To3WCXc=; b=Oc9nrem5Y1sYyYNvOl+jXEPRixYdO+5Er4/XQcYTyW9mXzheafi0kdk16H10hgbxPqIfA1 3EVPm4CUwY2J1JclMA3QWs1KGi3A7CrCBk12sDvvhhCaUEfREq5Vb9GTF2J5aHYUAvrjDm cBolWpT09bFXuwyUPkOV9CCgVieaB/6t3oPBaFFNsfu0FaIleK3e10FANhZ2ztnIFUm49p CKgY/Oz92InTYEsMcPnnMBYWUIkBymQfJQ9WQSkg8yYdyoWgFtRiP37G1HMvtC6EU2Dt47 xcV7wLpXR6aeTQmxbiUiqqoht+4bg0QQpX9PPpZJGQEwIlcpqk8J02Zt8RBesg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fy9Kp0sqwz1CJM for ; Fri, 17 Apr 2026 22:58:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3981c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 17 Apr 2026 22:58:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pouria Mousavizadeh Tehrani Subject: git: f6bcc0925f0e - main - tests/netinet6: Add test for route information option List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pouria X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6bcc0925f0ea838da5183dc503f847e56d15cc8 Auto-Submitted: auto-generated Date: Fri, 17 Apr 2026 22:58:54 +0000 Message-Id: <69e2bb2e.3981c.1b277ded@gitrepo.freebsd.org> The branch main has been updated by pouria: URL: https://cgit.FreeBSD.org/src/commit/?id=f6bcc0925f0ea838da5183dc503f847e56d15cc8 commit f6bcc0925f0ea838da5183dc503f847e56d15cc8 Author: Pouria Mousavizadeh Tehrani AuthorDate: 2026-04-17 20:27:50 +0000 Commit: Pouria Mousavizadeh Tehrani CommitDate: 2026-04-17 22:52:26 +0000 tests/netinet6: Add test for route information option Test handling of receiving multiple route information options in RA. Reviewed by: glebius Differential Revision: https://reviews.freebsd.org/D56216 --- tests/sys/netinet6/ndp.sh | 67 +++++++++++++++++++++++++++++++++++++++++++++++ tests/sys/netinet6/ra.py | 32 ++++++++++++++++++---- 2 files changed, 94 insertions(+), 5 deletions(-) diff --git a/tests/sys/netinet6/ndp.sh b/tests/sys/netinet6/ndp.sh index 035f8fc9989f..16704742dd88 100755 --- a/tests/sys/netinet6/ndp.sh +++ b/tests/sys/netinet6/ndp.sh @@ -783,6 +783,72 @@ ndp_slaac_switch_onlink_prefix_cleanup() { vnet_cleanup } +atf_test_case "ndp_routeinfo_option" "cleanup" +ndp_routeinfo_option_head() { + atf_set descr 'Test RFC 4191: Add route based on received RTI in RA' + atf_set require.user root + atf_set require.progs jq python3 scapy +} + +ndp_routeinfo_option_body() { + local epair0 jname prefix lladdr route1 route2 + + vnet_init + + jname="v6t-ndp_routeinfo_option" + prefix="2001:db8:ffff:1000::" + route1="3fff:1000::" + route2="3fff:2000::" + + epair0=$(vnet_mkepair) + + vnet_mkjail ${jname} ${epair0}a + + ndp_if_up ${epair0}a ${jname} + ndp_if_up ${epair0}b + atf_check jexec ${jname} ifconfig ${epair0}a inet6 accept_rtadv + + # Make sure that NAs from us are flagged as coming from a router. + atf_check -o ignore sysctl net.inet6.ip6.forwarding=1 + + lladdr="$(ndp_if_lladdr ${epair0}b)" + # Send an RA with high preference with 3 routes. + # The last rti should overwrite the default route rtiltime to 100 seconds + # and its preference to medium. + atf_check -e ignore python3 $(atf_get_srcdir)/ra.py \ + --sendif ${epair0}b \ + --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ + --src ${lladdr} \ + --rtrpref 1 --rtrltime 1800 --prefix ${prefix} \ + --route ${route1} --routelen 32 \ + --rtipref 1 --rtiltime 1800 \ + --route ${route2} --routelen 48 \ + --rtipref 4 --rtiltime 600 \ + --route :: --routelen 0 \ + --rtipref 4 --rtiltime 100 + + # Wait for a default router to appear. + while [ -z "$(jexec ${jname} ndp -r)" ]; do + sleep 0.1 + done + + # Make sure routes from rti option are being installed + atf_check -s exit:0 \ + -o match:"^${route1}/32[[:space:]]+${lladdr}.*1800" \ + -o match:"^${route2}/48[[:space:]]+${lladdr}.*600" \ + -o match:"^default[[:space:]]+${lladdr}" \ + jexec ${jname} netstat -rn6 + + # Verify the default route lifetime and its preference is overwrited + atf_check -s exit:0 \ + -o match:"^${lladdr}%${epair0}a if=${epair0}a, flags=, pref=medium, expire=1m.*" \ + jexec ${jname} ndp -r +} + +ndp_routeinfo_option_cleanup() { + vnet_cleanup +} + atf_init_test_cases() { @@ -798,4 +864,5 @@ atf_init_test_cases() atf_add_test_case "ndp_input_validation_hlim" atf_add_test_case "ndp_input_validation_src_linklocal" atf_add_test_case "ndp_multirouter_pref" + atf_add_test_case "ndp_routeinfo_option" } diff --git a/tests/sys/netinet6/ra.py b/tests/sys/netinet6/ra.py index f71ab4b7499e..e732e952be71 100644 --- a/tests/sys/netinet6/ra.py +++ b/tests/sys/netinet6/ra.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2024 Klara, Inc. +# Copyright (c) 2026 Pouria Mousavizadeh Tehrani # import argparse @@ -41,18 +42,39 @@ def main(): parser.add_argument('--preferredlifetime', nargs=1, required=False, type=int, default=4294967295, help='The preferred lifetime of the prefix') + parser.add_argument('--route', nargs='*', required=False, + action='extend', type=str, default=[], + help='The route to be advertised') + parser.add_argument('--routelen', nargs='*', required=False, + action='extend', type=int, default=[], + help='The route length to be advertised') + parser.add_argument('--rtipref', nargs='*', required=False, + action='extend', type=int, default=[], + help='The route info preference advertised') + parser.add_argument('--rtiltime', nargs='*', required=False, + action='extend', type=int, default=[], + help='The route info preference advertised') args = parser.parse_args() pkt = sp.Ether() / \ sp.IPv6(src=args.src, dst=args.dst, hlim=args.hoplimit) / \ - sp.ICMPv6ND_RA(chlim=64, prf=args.rtrpref, routerlifetime=args.rtrltime) + sp.ICMPv6ND_RA(chlim=64, + prf=args.rtrpref, + routerlifetime=args.rtrltime) if (args.prefix): pkt = pkt / \ - sp.ICMPv6NDOptPrefixInfo(prefix=args.prefix, - prefixlen=args.prefixlen, - validlifetime=args.validlifetime, - preferredlifetime=args.preferredlifetime) + sp.ICMPv6NDOptPrefixInfo(prefix=args.prefix, + prefixlen=args.prefixlen, + validlifetime=args.validlifetime, + preferredlifetime=args.preferredlifetime) + + for i in range(0, len(args.route)): + pkt = pkt / \ + sp.ICMPv6NDOptRouteInfo(prefix=args.route[i], + plen=args.routelen[i], + prf=args.rtipref[i], + rtlifetime=args.rtiltime[i]) sp.sendp(pkt, iface=args.sendif[0], verbose=False) sys.exit(0) From nobody Sat Apr 18 01:12:41 2026 X-Original-To: dev-commits-src-main@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 4fyDJ92vjNz6ZTKg for ; Sat, 18 Apr 2026 01:12:41 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJ929srz3nTP for ; Sat, 18 Apr 2026 01:12:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474761; 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=Ez1eRYTDlkV89+/2NnWs0Gc5wd/rShdLlL2dOSTY+i4=; b=m6DyTys/AQLRhjiiapar/RwZTwbj8hyjE7NJxP0t/hgGiLa/yOaGEzwS6lCX+GGOuXHW+f IW9AVQuT3N7BP2OoywVwCe0zlIXMoG6d09OVlGp5dgxp+BWPHsC+9gB2J99ag6Ibj8cDfR VwU5Zr7lYVoedXw02gTVeSmXrucelDeXXs+sTC96XqYp5tnBHa1todU0ygMd9mwlkPIaOm mrVU7zCbLaSEwAS2txFnx3wnPFQb7QrVh/axbvXc89PTNcXzRoimcvHYxLlPCQoa/rSFoH NGcSMDaFhkfdqDvcdpMo/ih0X7H/oswq2ubIhm9zO4et/pb7Qbv+4nrF1Sshhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474761; a=rsa-sha256; cv=none; b=nWe5J7b8xCQy+FvSViE8zX4Q2ihDcQUw0Hh6R7V1zpnvtVrDWx3S9h8lP6fJjpT++kfU0g LGgvQFJfbiJ2nCn2uD0tH+kRYTS/hfiVTEhjH1nha2WFA5JoIYnbRuSXAhAm0bp0GNFtEY 97TyHDWK69duuNAh3tKMBimJ6sqYNj+kUP1NmxijVoNRbVhvRoiQJU0JBjXI0+3PwZxwfE yDSyvKFL0Vr3r233AdbOnZjs0qoG4hPyBiu5grHTzKSLQGwM0wHq3cnRl5hP659JeyBx5Z /jGPfVjhEji/EP9uz1iK4/X7GMcnl+AvtmIdyiXvejR7rQPPnPf0b1wpaFGdMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474761; 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=Ez1eRYTDlkV89+/2NnWs0Gc5wd/rShdLlL2dOSTY+i4=; b=fonyJlX8HicXDaqWFB+p3qRX74ZUFXf6mtnOqW0y0p/Tb6q+oi1z0hS5wMNrlyNotBLrmp ehQvxsZoL2FWeSlKit1Lv1Bg6aKRI22QJooVuJrkoK0+HehYLHPZz/yPyIhoUYmfLm10Vx MIcQ6d8vq8nHG0quMMEaNafTlLzABkv2KI/rreWxHV03wCgT7wgHGVIrBa8zb8JT9qk34L 7rUDS4EkWb7VrPfYRifScHlxZFjQSUgUzKF3rkRurjCx5Cp7T161EAcphVWhA+NVsnM6k0 nBoiFkNlR/k/hp2NJiXmIQG62B8/TbnxRj7yFma5O+R24uDbg4R76Bs8DvLUjQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJ91jYrz28D for ; Sat, 18 Apr 2026 01:12:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 456c1 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 695f0f0d037a - main - LinuxKPI: 802.11: factor out chandef/chanctx initialization List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 695f0f0d037a876fa27c0cdca9890e09fd75429e Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:41 +0000 Message-Id: <69e2da89.456c1.28fc7cc0@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=695f0f0d037a876fa27c0cdca9890e09fd75429e commit 695f0f0d037a876fa27c0cdca9890e09fd75429e Author: Bjoern A. Zeeb AuthorDate: 2026-01-03 20:10:24 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:07 +0000 LinuxKPI: 802.11: factor out chandef/chanctx initialization Factor out chandef and chanctx initialization from lkpi_sta_scan_to_auth(). This makes the code a lot more readable and prepares for the next steps that will re-use some of this. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 117 ++++++++++++++++++--------- 1 file changed, 78 insertions(+), 39 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 01347586ef63..8bb5bd4201ef 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -766,6 +766,7 @@ lkpi_sta_sync_from_ni(struct ieee80211_hw *hw, struct ieee80211_vif *vif, lkpi_sync_chanctx_cw_from_rx_bw(hw, vif, sta); } +#if 0 static uint8_t lkpi_get_max_rx_chains(struct ieee80211_node *ni) { @@ -792,6 +793,7 @@ lkpi_get_max_rx_chains(struct ieee80211_node *ni) return (chains); } +#endif static void lkpi_lsta_dump(struct lkpi_sta *lsta, struct ieee80211_node *ni, @@ -2214,6 +2216,70 @@ lkpi_80211_flush_tx(struct lkpi_hw *lhw, struct lkpi_sta *lsta) } } +static void +lkpi_init_chandef(struct cfg80211_chan_def *chandef, + struct linuxkpi_ieee80211_channel *chan, struct ieee80211_channel *c, + bool can_ht) +{ + + cfg80211_chandef_create(chandef, chan, + (can_ht) ? NL80211_CHAN_HT20 : NL80211_CHAN_NO_HT); + chandef->center_freq1 = ieee80211_get_channel_center_freq1(c); + chandef->center_freq2 = ieee80211_get_channel_center_freq2(c); + + IMPROVE("Check ht/vht_cap from band not just chan? See lkpi_sta_sync_from_ni..."); +#ifdef LKPI_80211_HT + if (IEEE80211_IS_CHAN_HT(c)) { + if (IEEE80211_IS_CHAN_HT40(c)) + chandef->width = NL80211_CHAN_WIDTH_40; + else + chandef->width = NL80211_CHAN_WIDTH_20; + } +#endif +#ifdef LKPI_80211_VHT + if (IEEE80211_IS_CHAN_VHT_5GHZ(c)) { + if (IEEE80211_IS_CHAN_VHT80P80(c)) + chandef->width = NL80211_CHAN_WIDTH_80P80; + else if (IEEE80211_IS_CHAN_VHT160(c)) + chandef->width = NL80211_CHAN_WIDTH_160; + else if (IEEE80211_IS_CHAN_VHT80(c)) + chandef->width = NL80211_CHAN_WIDTH_80; + } +#endif +} + +static uint32_t +lkpi_init_chanctx_conf(struct ieee80211_hw *hw, + struct cfg80211_chan_def *chandef, + struct ieee80211_chanctx_conf *chanctx_conf) +{ + uint32_t changed; + + lockdep_assert_wiphy(hw->wiphy); + + changed = 0; + + chanctx_conf->rx_chains_static = 1; + chanctx_conf->rx_chains_dynamic = 1; + changed |= IEEE80211_CHANCTX_CHANGE_RX_CHAINS; + + if (chanctx_conf->radar_enabled != hw->conf.radar_enabled) { + chanctx_conf->radar_enabled = hw->conf.radar_enabled; + changed |= IEEE80211_CHANCTX_CHANGE_RADAR; + } + + chanctx_conf->def = *chandef; + changed |= IEEE80211_CHANCTX_CHANGE_WIDTH; + + /* One day we should figure this out; is for iwlwifi-only. */ + chanctx_conf->min_def = chanctx_conf->def; + changed |= IEEE80211_CHANCTX_CHANGE_MIN_WIDTH; + + /* chanctx_conf->ap = */ + + return (changed); +} + static void lkpi_remove_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif) @@ -2310,6 +2376,7 @@ static int lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct linuxkpi_ieee80211_channel *chan; + struct cfg80211_chan_def chandef; struct lkpi_chanctx *lchanctx; struct ieee80211_chanctx_conf *chanctx_conf; struct lkpi_hw *lhw; @@ -2322,7 +2389,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int struct ieee80211_prep_tx_info prep_tx_info; uint32_t changed; int error; - bool synched; + bool synched, can_ht; /* * In here we use vap->iv_bss until lvif->lvif_bss is set. @@ -2391,50 +2458,22 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int chanctx_conf = &lchanctx->chanctx_conf; } - chanctx_conf->rx_chains_static = 1; - chanctx_conf->rx_chains_dynamic = 1; - chanctx_conf->radar_enabled = - (chan->flags & IEEE80211_CHAN_RADAR) ? true : false; - chanctx_conf->def.chan = chan; - chanctx_conf->def.width = NL80211_CHAN_WIDTH_20_NOHT; - chanctx_conf->def.center_freq1 = ieee80211_get_channel_center_freq1(ni->ni_chan); - chanctx_conf->def.center_freq2 = ieee80211_get_channel_center_freq2(ni->ni_chan); - IMPROVE("Check vht_cap from band not just chan?"); KASSERT(ni->ni_chan != NULL && ni->ni_chan != IEEE80211_CHAN_ANYC, ("%s:%d: ni %p ni_chan %p\n", __func__, __LINE__, ni, ni->ni_chan)); #ifdef LKPI_80211_HT - if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) { - if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) - chanctx_conf->def.width = NL80211_CHAN_WIDTH_40; - else - chanctx_conf->def.width = NL80211_CHAN_WIDTH_20; - } -#endif -#ifdef LKPI_80211_VHT - if (IEEE80211_IS_CHAN_VHT_5GHZ(ni->ni_chan)) { - if (IEEE80211_IS_CHAN_VHT80P80(ni->ni_chan)) - chanctx_conf->def.width = NL80211_CHAN_WIDTH_80P80; - else if (IEEE80211_IS_CHAN_VHT160(ni->ni_chan)) - chanctx_conf->def.width = NL80211_CHAN_WIDTH_160; - else if (IEEE80211_IS_CHAN_VHT80(ni->ni_chan)) - chanctx_conf->def.width = NL80211_CHAN_WIDTH_80; - } -#endif - chanctx_conf->rx_chains_dynamic = lkpi_get_max_rx_chains(ni); - /* Responder ... */ -#if 0 - chanctx_conf->min_def.chan = chanctx_conf->def.chan; - chanctx_conf->min_def.width = NL80211_CHAN_WIDTH_20_NOHT; -#ifdef LKPI_80211_HT - if (IEEE80211_IS_CHAN_HT(ni->ni_chan) || IEEE80211_IS_CHAN_VHT(ni->ni_chan)) - chanctx_conf->min_def.width = NL80211_CHAN_WIDTH_20; -#endif - chanctx_conf->min_def.center_freq1 = chanctx_conf->def.center_freq1; - chanctx_conf->min_def.center_freq2 = chanctx_conf->def.center_freq2; + can_ht = (vap->iv_ic->ic_flags_ht & IEEE80211_FHT_HT) != 0; #else - chanctx_conf->min_def = chanctx_conf->def; + can_ht = false; #endif + lkpi_init_chandef(&chandef, chan, ni->ni_chan, can_ht); + hw->conf.radar_enabled = + ((chan->flags & IEEE80211_CHAN_RADAR) != 0) ? true : false; + hw->conf.chandef = chandef; + vif->bss_conf.chanreq.oper = hw->conf.chandef; + changed = lkpi_init_chanctx_conf(hw, &chandef, chanctx_conf); + + /* Responder ... */ /* Set bss info (bss_info_changed). */ bss_changed = 0; From nobody Sat Apr 18 01:12:42 2026 X-Original-To: dev-commits-src-main@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 4fyDJB523Lz6ZTNd for ; Sat, 18 Apr 2026 01:12:42 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJB37G3z3n8S for ; Sat, 18 Apr 2026 01:12:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474762; 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=gSIOXzlkJpMqHy6N65pBwth/hDv9KvD8qrl8+y3iG4A=; b=TeIr0KtD5AYVb6P5wTmDj8zVPMNpQOpN5KwNCRGfOGy6+/R8I15N4JirfmoQcGEYP3zAp1 CQSaW4yswTRDQMZtb5fJjwlOtdDm7jK9RhDjD2RBYe2XWOxws94Huy8cl+eAG8ws7bcFsG Sh6ZFmQBmrIwlI1XqM/SrP8TsKJktwXl6H5C/rd8NPHfg2UY4J8PODvDY55007WGNhQTSL HmpLNaEg39VXtCr+uVZ6RMs3HfoLv4GLpVqwJl2ismgzs+mZjHoT7pH4eRvdoXvUb/i5CQ HnAp1DDUxETw1+TiG700mm178bnQWrOZ9tMrJaZ1OCTT4/7XqNrZF9ecvc/fEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474762; a=rsa-sha256; cv=none; b=hjUJC8y/1OqwDaxF6wX049F1YMu5RbySivgYdY9sNBNB6MVvDFPgmf04RjUr1hklBwV9MI hBZSojX9E87Vig+rcdo29OxvSfWD/DV9AxFMSDsn+VHjUh0WE3CuVmAGRGpd9Z2/SgbP7F f1fhWS7hdDrexR+FbUdTQKCKvWrH1jBxi2vbZhJ9NCyAcI1UwyiMXS68hGakLsBNsk3KVU 9MOSoP0GEsXe6DHAMmB6XZoSfQ3iQbtr+Wk/HS6pASoNQTRaxGZXCHzKIQ+ojhRfWAFkXm //qruV10PFUCuLInRfCdKWvtU1nc2ShsW+tXrzy+Y87OmWrn1FFiQDn+4mOr6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474762; 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=gSIOXzlkJpMqHy6N65pBwth/hDv9KvD8qrl8+y3iG4A=; b=TPFVeU9Y0OPwwr85xVyNY3WgknrN9znHnxbOT7me21mU/IkRBjKzQoQuuIm4ORvc9a6AuY P0bj1kF1SlKu6339znd7v1nGPOyiHiL7kq0VR/MwOfQN1Sj+Q6MYsREmfX5InXKJ/xC8i5 Nt6TlzR1J/csdQNmmRWiufiR4mxL54vAiWxMJh7paDj9Dmn1wR8FDhLnXZ7yYJAgJ3j+sG kqzlamd/0T0vAeF9XEmcIGYnn25CN8i4F0Bz8fpVcdP7WampEd84rOv0uakqQEKX7+oVdd +M1Xpt6GGd6UJkVz54vPnwOkAh1PurwBfZ1sjib64dk7R6JTpS6CoXNuUUHCLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJB2Wfkz28F for ; Sat, 18 Apr 2026 01:12:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4565e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: ced6909dd69b - main - LinuxKPI: 802.11: save the default channel List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ced6909dd69b8476121dc291e01fa56ae14520e5 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:42 +0000 Message-Id: <69e2da8a.4565e.5b581748@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ced6909dd69b8476121dc291e01fa56ae14520e5 commit ced6909dd69b8476121dc291e01fa56ae14520e5 Author: Bjoern A. Zeeb AuthorDate: 2026-03-10 20:02:43 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:08 +0000 LinuxKPI: 802.11: save the default channel Add a field to struct lkpi_hw to save the default channel for later reuse. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 2 ++ sys/compat/linuxkpi/common/src/linux_80211.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 8bb5bd4201ef..92eccefca078 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3963,6 +3963,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], lvif->lvif_ifllevent = EVENTHANDLER_REGISTER(iflladdr_event, lkpi_vif_iflladdr, vif, EVENTHANDLER_PRI_ANY); vif->bss_conf.link_id = 0; /* Non-MLO operation. */ + vif->bss_conf.chanreq.oper.chan = lhw->dflt_chandef.chan; vif->bss_conf.chanreq.oper.width = NL80211_CHAN_WIDTH_20_NOHT; vif->bss_conf.use_short_preamble = false; /* vap->iv_flags IEEE80211_F_SHPREAMBLE */ vif->bss_conf.use_short_slot = false; /* vap->iv_flags IEEE80211_F_SHSLOT */ @@ -6832,6 +6833,7 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) (ic->ic_flags_ht & IEEE80211_FHT_HT) ? NL80211_CHAN_HT20 : #endif NL80211_CHAN_NO_HT); + lhw->dflt_chandef = hw->conf.chandef; break; } } diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 8ae5c3d13d2d..a2945498e8df 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -254,6 +254,8 @@ struct lkpi_hw { /* name it mac80211_sc? */ unsigned int mc_flags; struct sx mc_sx; + struct cfg80211_chan_def dflt_chandef; + struct mtx txq_mtx; uint32_t txq_generation[IEEE80211_NUM_ACS]; spinlock_t txq_scheduled_lock[IEEE80211_NUM_ACS]; From nobody Sat Apr 18 01:12:43 2026 X-Original-To: dev-commits-src-main@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 4fyDJC5g0qz6ZTKj for ; Sat, 18 Apr 2026 01:12:43 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJC3mLCz3nF3 for ; Sat, 18 Apr 2026 01:12:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474763; 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=c6/Rf0mPpXvTW2/9yfUpfOxMIglHHs9R3byMMnoBqhw=; b=WJvRgtgNuZwNM5k/ctErcYU21ITbw78w/JwHWR2TuFF81Od0Apklr5NUP0CfIqqlklkCbo Hh/Yf72HYJWKxxvcLgmTaJwjF0ztVHT/NJX7OUkDmhVWFNnWLy6kaTeIe6ml3h8qHRJQCv CXVBwXUW3mme31Hhbwv2aG6abQEhY2Bt7vY+LpBNUqSi4SDeQYuso55FA/9tO9pK7+xZvu ahevNIlRexW8MvyUKD5z0npqQ0ocle930u3vhLIz96JfBn+znmWRYVRZgVAxD3zanlnhd6 2OYNpO5oBt0UzzqR3YMJRIlUYtgmYzRWpJQrJLqVuYLkj0MzK5gyTWOItTKG+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474763; a=rsa-sha256; cv=none; b=YdpKocKG0XjigrmlEehCBaChQ0z93LjpuFTaJlLIPF1vSmOZY4GI0faBtRJJ4GGx/Tghne Ifzh+J6M+15S917X68Mb+dSniLw5N+1hVRYdpi7GXhq4k2nmB5fynZ1C4RK3CQBljA4bEZ 91aUSPvoXGj/WAdb96lQOOlF75lcAy/5I5h5Od6VHCHy979gzNv4vZdvAW3/q+Udwjl04J ViM4T0qV/ih4UJ4h59ImZsTqIepv6QEQRru16CwDDoDIV+3kKA4bJOlRM2JUdNnNoDq8Mn 59cp2NdUt2/ZIRDhWYeRGOKpwf64uaWuLe8CFAD2lNmMxMXTzhqYX6z6s2Kw0w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474763; 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=c6/Rf0mPpXvTW2/9yfUpfOxMIglHHs9R3byMMnoBqhw=; b=Rq0zaeoR2uAW4yZ6u8M/ewN35yvsJKxHHDcxMkHQVjgUdW9YRwz8UvJDSn/gthFSoirK44 9JDcUHEYcJw7G5rUbId4Ct2MKdfRmTUuNMKPQ+oopVAm5Lox240BY9Xu9362i1QVMgdIby pELhx65ipZCpDqGH8YmO7na+Q8vSLEe7n4xj6AVZiM+BEfMR1YimF86DqPEehCZxnvwu72 +Z2TGCxOVjWQs/MxlCaYAsPGcN/qMT3RkIMtUZr+mEF79qDUzGfZ1M8AqBTGs/k5aIgUdN huctVzh3LJCXVvsOtVLED6m3jxmygfdq29Op/ynnDSAfNsNshaSBb44Yre1ADg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJC3L9wz32P for ; Sat, 18 Apr 2026 01:12:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 472f4 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: e62c92c0a5cf - main - LinuxKPI: 802.11: keep chanctx on a reserved list List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e62c92c0a5cfc000cf3c200e43738834ccc6472e Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:43 +0000 Message-Id: <69e2da8b.472f4.60af80d0@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e62c92c0a5cfc000cf3c200e43738834ccc6472e commit e62c92c0a5cfc000cf3c200e43738834ccc6472e Author: Bjoern A. Zeeb AuthorDate: 2026-03-23 00:47:57 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:08 +0000 LinuxKPI: 802.11: keep chanctx on a reserved list Keep the chanctx around as we may swap them. In the future (11be) these lists likely need to be (a) limited to maximum number of chanctx possible (see struct ieee80211_iface_limit), and (b) with that also by radio. For the moment keep this simple and start with a single chanctx and build up from there when we get there. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 69 ++++++++++++++++++++++++++-- sys/compat/linuxkpi/common/src/linux_80211.h | 2 + 2 files changed, 66 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 92eccefca078..40a7dfa79fba 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2280,13 +2280,54 @@ lkpi_init_chanctx_conf(struct ieee80211_hw *hw, return (changed); } +static struct lkpi_chanctx * +lkpi_alloc_lchanctx(struct ieee80211_hw *hw, struct lkpi_vif *lvif) +{ + struct lkpi_chanctx *lchanctx; + + lchanctx = malloc(sizeof(*lchanctx) + hw->chanctx_data_size, + M_LKPI80211, M_WAITOK | M_ZERO); + lchanctx->lvif = lvif; + + return (lchanctx); +} + +static struct lkpi_chanctx * +lkpi_find_lchanctx_reserved(struct ieee80211_hw *hw, struct lkpi_vif *lvif) +{ + struct lkpi_hw *lhw; + struct lkpi_chanctx *lchanctx; + bool found; + + lhw = HW_TO_LHW(hw); + + found = false; + rcu_read_lock(); + list_for_each_entry_rcu(lchanctx, &lhw->lchanctx_list_reserved, entry) { + if (lchanctx->lvif == lvif) { + found = true; + break; + } + } + rcu_read_unlock(); + + if (!found) { + lchanctx = lkpi_alloc_lchanctx(hw, lvif); + list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved); + } + + return (lchanctx); +} static void lkpi_remove_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { + struct lkpi_hw *lhw; struct ieee80211_chanctx_conf *chanctx_conf; struct lkpi_chanctx *lchanctx; + lockdep_assert_wiphy(hw->wiphy); + chanctx_conf = rcu_dereference_protected(vif->bss_conf.chanctx_conf, lockdep_is_held(&hw->wiphy->mtx)); @@ -2305,7 +2346,8 @@ lkpi_remove_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif) rcu_assign_pointer(vif->bss_conf.chanctx_conf, NULL); lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf); list_del(&lchanctx->entry); - free(lchanctx, M_LKPI80211); + lhw = HW_TO_LHW(hw); + list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved); } /* -------------------------------------------------------------------------- */ @@ -2452,9 +2494,8 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf); IMPROVE("diff changes for changed, working on live copy, rcu"); } else { - /* Keep separate alloc as in Linux this is rcu managed? */ - lchanctx = malloc(sizeof(*lchanctx) + hw->chanctx_data_size, - M_LKPI80211, M_WAITOK | M_ZERO); + lchanctx = lkpi_find_lchanctx_reserved(hw, lvif); + list_del(&lchanctx->entry); chanctx_conf = &lchanctx->chanctx_conf; } @@ -2535,7 +2576,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int rcu_assign_pointer(vif->bss_conf.chanctx_conf, NULL); lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf); list_del(&lchanctx->entry); - free(lchanctx, M_LKPI80211); + list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved); goto out; } } @@ -3954,6 +3995,10 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], /* Need to fill in other fields as well. */ IMPROVE(); + /* Create a chanctx to be used later. */ + IMPROVE("lkpi_alloc_lchanctx reserved as many as can be"); + (void) lkpi_find_lchanctx_reserved(hw, lvif); + /* XXX-BZ hardcoded for now! */ #if 1 RCU_INIT_POINTER(vif->bss_conf.chanctx_conf, NULL); @@ -6444,6 +6489,7 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops) /* Chanctx_conf */ INIT_LIST_HEAD(&lhw->lchanctx_list); + INIT_LIST_HEAD(&lhw->lchanctx_list_reserved); /* Deferred RX path. */ LKPI_80211_LHW_RXQ_LOCK_INIT(lhw); @@ -6518,6 +6564,7 @@ linuxkpi_ieee80211_iffree(struct ieee80211_hw *hw) __func__, lhw, mbufq_len(&lhw->rxq))); LKPI_80211_LHW_RXQ_LOCK_DESTROY(lhw); + wiphy_lock(hw->wiphy); /* Chanctx_conf. */ if (!list_empty_careful(&lhw->lchanctx_list)) { struct lkpi_chanctx *lchanctx, *next; @@ -6530,9 +6577,21 @@ linuxkpi_ieee80211_iffree(struct ieee80211_hw *hw) lkpi_80211_mo_remove_chanctx(hw, chanctx_conf); } list_del(&lchanctx->entry); + list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved); + } + } + if (!list_empty_careful(&lhw->lchanctx_list_reserved)) { + struct lkpi_chanctx *lchanctx, *next; + + list_for_each_entry_safe(lchanctx, next, &lhw->lchanctx_list_reserved, entry) { + list_del(&lchanctx->entry); + if (lchanctx->added_to_drv) + panic("%s: lchanctx %p on reserved list still added_to_drv\n", + __func__, lchanctx); free(lchanctx, M_LKPI80211); } } + wiphy_unlock(hw->wiphy); LKPI_80211_LHW_MC_LOCK(lhw); lkpi_cleanup_mcast_list_locked(lhw); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index a2945498e8df..e453cefa20f7 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -250,6 +250,7 @@ struct lkpi_hw { /* name it mac80211_sc? */ struct sx lvif_sx; struct list_head lchanctx_list; + struct list_head lchanctx_list_reserved; struct netdev_hw_addr_list mc_list; unsigned int mc_flags; struct sx mc_sx; @@ -330,6 +331,7 @@ struct lkpi_chanctx { struct list_head entry; bool added_to_drv; /* Managed by MO */ + struct lkpi_vif *lvif; /* Backpointer. */ struct ieee80211_chanctx_conf chanctx_conf __aligned(CACHE_LINE_SIZE); }; From nobody Sat Apr 18 01:12:44 2026 X-Original-To: dev-commits-src-main@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 4fyDJF166jz6ZTNf for ; Sat, 18 Apr 2026 01:12:45 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJD4bH7z3n8q for ; Sat, 18 Apr 2026 01:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474764; 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=Nl0TIt/iw0fQc42FEWdw8iHnyVUlJn2XsQ6kHiyuXUI=; b=wbeRbW0F78Kq1/rJapDe3xzEJll4JaxZqhZEs+UQWGBj0MgUQVYfeBO+XTiae/M5mBcrKt hcZ0/feljgv2/X11GSi902uKL1bXuDRazlTuaqcdAinil3qxAayP6smWjx1raCjYzvWKb3 /FzQnqUpIuPEUxHTWWgIfOH76Es7/7J6x2QBlLcQaMymtBVD4AyfOd6SoZlr/5Z8FU+aa8 s4MeB/QZa7L/9kID9Plp0HGgZQ3GYWYVdzRklk8+vOBQbXBA4jHLJWRriQTC5fYEi9pkFg yoaAxdbBVIq75D3ugMWLnHgfLItdWW7mh3dOgDLJ2iyRzJ/8ScyKRiAmvj2ZUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474764; a=rsa-sha256; cv=none; b=cO0Rjlztv2CsmUxUQG6l9W7665yu8Wujui4rSz/FdIrBoa1ZyJaKtaUykRWCT7X1eG09S+ cRZXEF7XaYUTdBZeemxAw0SrpH8KDJ4t3zCS7/Ed+en+j+Pq7bfHzcELV9ny/WWqvF99Ty DsJUrgKm9flufgGc7G1wuYb8hzXHIXdDLwcm8X01QfsAfEqZSxdQ4+uMBVO2MtftpUaxME zDl7sOzW7qapN9+l+6GMH8tjUTxGsVqMdL4KQ/sRQmLru0vmYnrm6KeutT63RZ55Hz2/Vc REN19WPIo5FjlvfWWlSK43KKhM9tP26LDzsfQzBXv2OBcu1iHRbOfY98HOnqBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474764; 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=Nl0TIt/iw0fQc42FEWdw8iHnyVUlJn2XsQ6kHiyuXUI=; b=G5wr9N8DE28WESEKt1uP5dWrDt/mrNZJzBnzUhBSEpdd6EUzTLqaya5dUkzETVTPoyb3XI 67MS45OaEJF/l4H5oNr0bRTXkinVoLkSIhul96JGAs55bAg4zNDZE2HVxG5Z7WP7Xpx48V blV5YSFicj2cV55WUfdwULbCKnNAPd4HaBL33SQ/l3ZsFE3Ove0qiEpuOEiRFA4Cws7bGu fpAFhnsVmBF4uOkDK7cQoGhvo4WTJW9x6+RvMbkNFDXcxDIeLtr5RyBVXcybK5cZxeqiXZ FjAJuRwuXXNfmqqlsJHgAwZ5MGVllTJyvhvTBNn+xBw5iJwYDhOL8o7GOC3ucg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJD4BV5z3HH for ; Sat, 18 Apr 2026 01:12:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 457af by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:44 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 88cb1e17f471 - main - LinuxKPI: 802.11: factor out getting and setting a chanctx List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 88cb1e17f471276e831c298c48acf9aca6ae29a6 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:44 +0000 Message-Id: <69e2da8c.457af.17f67fa2@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=88cb1e17f471276e831c298c48acf9aca6ae29a6 commit 88cb1e17f471276e831c298c48acf9aca6ae29a6 Author: Bjoern A. Zeeb AuthorDate: 2026-03-23 03:55:14 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:09 +0000 LinuxKPI: 802.11: factor out getting and setting a chanctx Further factor out acquiring the chanctx (either set or new), as well as populating a chanctx with information. This further simplifies lkpi_sta_scan_to_auth() and gives us more reusable function blocks. Sponsored by: The FreeBSD Foundation MFC after; 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 148 +++++++++++++++++---------- 1 file changed, 92 insertions(+), 56 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 40a7dfa79fba..d7648f31d70d 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2319,6 +2319,94 @@ lkpi_find_lchanctx_reserved(struct ieee80211_hw *hw, struct lkpi_vif *lvif) return (lchanctx); } +static struct ieee80211_chanctx_conf * +lkpi_get_chanctx_conf(struct ieee80211_hw *hw, struct ieee80211_vif *vif) +{ + struct ieee80211_chanctx_conf *chanctx_conf; + + chanctx_conf = rcu_dereference_protected(vif->bss_conf.chanctx_conf, + lockdep_is_held(&hw->wiphy->mtx)); + if (chanctx_conf == NULL) { + struct lkpi_chanctx *lchanctx; + struct lkpi_vif *lvif; + + lvif = VIF_TO_LVIF(vif); + lchanctx = lkpi_find_lchanctx_reserved(hw, lvif); + KASSERT(lchanctx != NULL, ("%s: hw %p, vif %p no lchanctx\n", + __func__, hw, vif)); + list_del(&lchanctx->entry); + chanctx_conf = &lchanctx->chanctx_conf; + } + /* else { IMPROVE("diff changes for changed, working on live copy, rcu"); } */ + + return (chanctx_conf); +} + +static int +lkpi_set_chanctx_conf(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_chanctx_conf *chanctx_conf, + uint32_t changed, bool changed_set) +{ + struct lkpi_hw *lhw; + struct lkpi_chanctx *lchanctx; + int error; + + if (vif->bss_conf.chanctx_conf == chanctx_conf) { + if (!changed_set) { + IMPROVE("OBSOLETE?"); + changed = IEEE80211_CHANCTX_CHANGE_MIN_WIDTH; + changed |= IEEE80211_CHANCTX_CHANGE_RADAR; + changed |= IEEE80211_CHANCTX_CHANGE_RX_CHAINS; + changed |= IEEE80211_CHANCTX_CHANGE_WIDTH; + } + lkpi_80211_mo_change_chanctx(hw, chanctx_conf, changed); + + return (0); + } + + lhw = HW_TO_LHW(hw); + + /* The device is no longer idle. */ + IMPROVE("Once we do multi-vif, only do for 1st chanctx"); + lkpi_hw_conf_idle(hw, false); + + error = lkpi_80211_mo_add_chanctx(hw, chanctx_conf); + if (error != 0 && error != EOPNOTSUPP) { + ic_printf(lhw->ic, "%s:%d: mo_add_chanctx " + "failed: %d\n", __func__, __LINE__, error); + return (error); + } + + vif->bss_conf.chanreq.oper.chan = chanctx_conf->def.chan; + vif->bss_conf.chanreq.oper.width = chanctx_conf->def.width; + vif->bss_conf.chanreq.oper.center_freq1 = + chanctx_conf->def.center_freq1; + vif->bss_conf.chanreq.oper.center_freq2 = + chanctx_conf->def.center_freq2; + + lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf); + list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list); + rcu_assign_pointer(vif->bss_conf.chanctx_conf, chanctx_conf); + + /* Assign vif chanctx. */ + if (error == 0) + error = lkpi_80211_mo_assign_vif_chanctx(hw, vif, + &vif->bss_conf, chanctx_conf); + if (error == EOPNOTSUPP) + error = 0; + if (error != 0) { + ic_printf(lhw->ic, "%s:%d: mo_assign_vif_chanctx " + "failed: %d\n", __func__, __LINE__, error); + lkpi_80211_mo_remove_chanctx(hw, chanctx_conf); + rcu_assign_pointer(vif->bss_conf.chanctx_conf, NULL); + lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf); + list_del(&lchanctx->entry); + list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved); + } + + return (error); +} + static void lkpi_remove_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { @@ -2419,7 +2507,6 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int { struct linuxkpi_ieee80211_channel *chan; struct cfg80211_chan_def chandef; - struct lkpi_chanctx *lchanctx; struct ieee80211_chanctx_conf *chanctx_conf; struct lkpi_hw *lhw; struct ieee80211_hw *hw; @@ -2488,16 +2575,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int wiphy_lock(hw->wiphy); /* Add chanctx (or if exists, change it). */ - chanctx_conf = rcu_dereference_protected(vif->bss_conf.chanctx_conf, - lockdep_is_held(&hw->wiphy->mtx)); - if (chanctx_conf != NULL) { - lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf); - IMPROVE("diff changes for changed, working on live copy, rcu"); - } else { - lchanctx = lkpi_find_lchanctx_reserved(hw, lvif); - list_del(&lchanctx->entry); - chanctx_conf = &lchanctx->chanctx_conf; - } + chanctx_conf = lkpi_get_chanctx_conf(hw, vif); KASSERT(ni->ni_chan != NULL && ni->ni_chan != IEEE80211_CHAN_ANYC, ("%s:%d: ni %p ni_chan %p\n", __func__, __LINE__, ni, ni->ni_chan)); @@ -2534,52 +2612,10 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int bss_changed |= lkpi_update_dtim_tsf(vif, ni, vap, __func__, __LINE__); - error = 0; - if (vif->bss_conf.chanctx_conf == chanctx_conf) { - changed = IEEE80211_CHANCTX_CHANGE_MIN_WIDTH; - changed |= IEEE80211_CHANCTX_CHANGE_RADAR; - changed |= IEEE80211_CHANCTX_CHANGE_RX_CHAINS; - changed |= IEEE80211_CHANCTX_CHANGE_WIDTH; - lkpi_80211_mo_change_chanctx(hw, chanctx_conf, changed); - } else { - /* The device is no longer idle. */ - IMPROVE("Once we do multi-vif, only do for 1st chanctx"); - lkpi_hw_conf_idle(hw, false); - - error = lkpi_80211_mo_add_chanctx(hw, chanctx_conf); - if (error == 0 || error == EOPNOTSUPP) { - vif->bss_conf.chanreq.oper.chan = chanctx_conf->def.chan; - vif->bss_conf.chanreq.oper.width = chanctx_conf->def.width; - vif->bss_conf.chanreq.oper.center_freq1 = - chanctx_conf->def.center_freq1; - vif->bss_conf.chanreq.oper.center_freq2 = - chanctx_conf->def.center_freq2; - } else { - ic_printf(vap->iv_ic, "%s:%d: mo_add_chanctx " - "failed: %d\n", __func__, __LINE__, error); - goto out; - } - - list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list); - rcu_assign_pointer(vif->bss_conf.chanctx_conf, chanctx_conf); + error = lkpi_set_chanctx_conf(hw, vif, chanctx_conf, changed, true); + if (error != 0) + goto out; - /* Assign vif chanctx. */ - if (error == 0) - error = lkpi_80211_mo_assign_vif_chanctx(hw, vif, - &vif->bss_conf, chanctx_conf); - if (error == EOPNOTSUPP) - error = 0; - if (error != 0) { - ic_printf(vap->iv_ic, "%s:%d: mo_assign_vif_chanctx " - "failed: %d\n", __func__, __LINE__, error); - lkpi_80211_mo_remove_chanctx(hw, chanctx_conf); - rcu_assign_pointer(vif->bss_conf.chanctx_conf, NULL); - lchanctx = CHANCTX_CONF_TO_LCHANCTX(chanctx_conf); - list_del(&lchanctx->entry); - list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved); - goto out; - } - } IMPROVE("update radiotap chan fields too"); /* RATES */ From nobody Sat Apr 18 01:12:45 2026 X-Original-To: dev-commits-src-main@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 4fyDJG3Qw4z6ZT7P for ; Sat, 18 Apr 2026 01:12:46 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJF5QqNz3nWP for ; Sat, 18 Apr 2026 01:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474765; 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=zYd+wJ+dpuHBTeME9dDfEvvgjt4pXK0QB1DF33D1570=; b=FD+Ea/DcvkwtYqn6T6V1NcnWCNKoewp9J3ybKXkAM682Zom9B+Ap8MrsG+gx1WDCdHaD2R av+6WshK6PzZm1uu17zchHMLy+ypTyrRtfFCviIppxa7mJHQWAw2aIfeATIjHBD1cxQftz RrRh18XeOBeFF2AulqyJ3whdgRG1RKLnYGS85m2ekfRuN52hbdWp333mdcxVaM/g+aHahI MwThAGDGNVjs372b7+0bJQmb49x1Dudzdld+biV1dYoz5UY6kyCeBfuxPfmNC4UhsJh3b3 c7vF2bzkfumWRakQrZhMwstLdf43CdxMwSfhXAHpcESr1d7SXeabn5DzWcjovg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474765; a=rsa-sha256; cv=none; b=DiNicyw45T5VuCn6s1/Jur+PR7thKZRy3WzKhjkkCav7cn4JnmzFwPxhwEVFSPYXJzxf8V E0jzJs/OCRmXPAYH+XP5KbDyVkiiK2vRHWK23ZpjnsTdbWd4K5Z+MXUp/38I2gNRNGtANl w2o2cLJgMZCSaTYX83/qyBXjGcvF3iCN/X2VhMrQz/nZtr/8aEEL701Pe6BXcsFmvZ6370 KxwDggYcfV6QUcdkIZ4pYfH4bPVpctSGaK2IVLNe24lx15NHeIixiSfJTapZrlMW+nipLF 9MWmkA3Ysrb8e+N3nvh18drhojyswEvLxXm2LzbbRj/t7Dt0S3jLijNWMmPcGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474765; 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=zYd+wJ+dpuHBTeME9dDfEvvgjt4pXK0QB1DF33D1570=; b=ZjG85/YJ79ft4LdBnO+ddE90vl2FbWMXK9nCo6NZ5Mpx+HgP1DmagJrqh/LpQ9HeuOrzAA 4R44kfZNdAq7vaHPnY6Fz4sZFJSMo4zZvbYjFJHAUjOFOBRnBND289HjwaDNbqicEfeN8O CDMao1qdXVIQZb08GXg6/G2hZi5Q+3BaujOC0k4L0OucU2+syB1vsD4qvLLFtWvqDXBmdy 7acyi6u1AeW90Wk+gNbkTSeUrkwHTvuE1H36+wIMmnBUiLobfU31Dodx0rgJ829ih9Berr ahjX4W8I/vAwLveo+SO/HNmedS0O3BLTVIuth5Bux5MVB7q/tu1GINnsy8z3Zw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJF52Spz336 for ; Sat, 18 Apr 2026 01:12:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46709 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 491f5876bfb4 - main - LinuxKPI: 802.11: rework lkpi_ic_set_channel() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 491f5876bfb40a4f70f523b5d14bccf6b53d2b0c Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:45 +0000 Message-Id: <69e2da8d.46709.17e5559f@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=491f5876bfb40a4f70f523b5d14bccf6b53d2b0c commit 491f5876bfb40a4f70f523b5d14bccf6b53d2b0c Author: Bjoern A. Zeeb AuthorDate: 2026-03-10 19:14:43 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:09 +0000 LinuxKPI: 802.11: rework lkpi_ic_set_channel() We are called by net80211 when channel changes are happening and we have to map this to LinuxKPI 802.11. There are multiple cases: (1) it is a hardware scan and net80211 still changes the channel; we do not need to; (2) it is a software scan (the magic fallback case) in which case we let net80211 drive the scan channel and we need to keep a copy of the scan_chandef (see follow-up commit); (3) no scanning but a normal channel change triggerd by net80211; in that case we could (should?) setup the full flags right away but deferred LinuxKPI logic currently handle this for us as not in all cases the information was fully available from net80211 in times we would have needed it. We only do this in order to handle the emulate chanctx cases but do not change the channel otherwise; scan_to_auth will set the correct chanctx. (3a) we have no (active) chanctx for that, create/set one, (3b) we do have an (active) chanctx for this, use it but reset to defaults. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 170 +++++++++++++++++++++------ sys/compat/linuxkpi/common/src/linux_80211.h | 1 + 2 files changed, 132 insertions(+), 39 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index d7648f31d70d..e839867bea58 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -4191,7 +4191,6 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], if (hw->max_listen_interval == 0) hw->max_listen_interval = 7 * (ic->ic_lintval / ic->ic_bintval); hw->conf.listen_interval = hw->max_listen_interval; - ic->ic_set_channel(ic); /* XXX-BZ do we need to be able to update these? */ hw->wiphy->frag_threshold = vap->iv_fragthreshold; @@ -5073,6 +5072,9 @@ lkpi_ic_scan_end(struct ieee80211com *ic) */ lkpi_enable_hw_scan(lhw); + /* Clear the scanning chandef. */ + memset(&lhw->scan_chandef, 0, sizeof(lhw->scan_chandef)); + LKPI_80211_LHW_SCAN_LOCK(lhw); wakeup(lhw); LKPI_80211_LHW_SCAN_UNLOCK(lhw); @@ -5115,6 +5117,25 @@ lkpi_ic_scan_mindwell(struct ieee80211_scan_state *ss) lhw->ic_scan_mindwell(ss); } +struct lkpi_ic_set_channel_iter_arg { + struct linuxkpi_ieee80211_channel *chan; + struct ieee80211_chanctx_conf *chanctx_conf; +}; + +static void +lkpi_ic_set_channel_chanctx_iterf(struct ieee80211_hw *hw, + struct ieee80211_chanctx_conf *chanctx_conf, void *arg) +{ + struct lkpi_ic_set_channel_iter_arg *chanctx_iter_arg; + + chanctx_iter_arg = arg; + if (chanctx_iter_arg->chanctx_conf != NULL) + return; + + if (chanctx_iter_arg->chan == chanctx_conf->def.chan) + chanctx_iter_arg->chanctx_conf = chanctx_conf; +} + static void lkpi_ic_set_channel(struct ieee80211com *ic) { @@ -5122,64 +5143,133 @@ lkpi_ic_set_channel(struct ieee80211com *ic) struct ieee80211_hw *hw; struct ieee80211_channel *c; struct linuxkpi_ieee80211_channel *chan; + struct ieee80211_chanctx_conf *chanctx_conf; + uint32_t changed; int error; - bool hw_scan_running; + bool hw_scan, scan_running; - lhw = ic->ic_softc; - - /* If we do not support (*config)() save us the work. */ - if (lhw->ops->config == NULL) - return; + IEEE80211_UNLOCK_ASSERT(ic); - /* If we have a hw_scan running do not switch channels. */ - LKPI_80211_LHW_SCAN_LOCK(lhw); - hw_scan_running = - (lhw->scan_flags & (LKPI_LHW_SCAN_RUNNING|LKPI_LHW_SCAN_HW)) == - (LKPI_LHW_SCAN_RUNNING|LKPI_LHW_SCAN_HW); - LKPI_80211_LHW_SCAN_UNLOCK(lhw); - if (hw_scan_running) - return; + lhw = ic->ic_softc; c = ic->ic_curchan; if (c == NULL || c == IEEE80211_CHAN_ANYC) { - ic_printf(ic, "%s: c %p ops->config %p\n", __func__, - c, lhw->ops->config); + ic_printf(ic, "%s: Unset channel: c %p, ignoring update\n", + __func__, c); return; } chan = lkpi_find_lkpi80211_chan(lhw, c); if (chan == NULL) { - ic_printf(ic, "%s: c %p chan %p\n", __func__, - c, chan); + ic_printf(ic, "%s: No channel found for c %p(%d) chan %p\n", + __func__, c, c->ic_ieee, chan); return; } - /* XXX max power for scanning? */ - IMPROVE(); + /* + * All net80211 callers call ieee80211_radiotap_chan_change(). + * That means we have nothing to do ourselves. + */ + + /* If we have a hw_scan running do not switch channels. */ + LKPI_80211_LHW_SCAN_LOCK(lhw); + scan_running = (lhw->scan_flags & LKPI_LHW_SCAN_RUNNING) != 0; + hw_scan = (lhw->scan_flags & LKPI_LHW_SCAN_HW) != 0; + LKPI_80211_LHW_SCAN_UNLOCK(lhw); + if (scan_running && hw_scan) { + TRACE_SCAN(ic, "scan_flags %b chan %d nothing to do.", + lhw->scan_flags, LKPI_LHW_SCAN_BITS, + c->ic_ieee); + /* Let us hope we set tx power levels elsewhere. */ + return; + } hw = LHW_TO_HW(lhw); - cfg80211_chandef_create(&hw->conf.chandef, chan, -#ifdef LKPI_80211_HT - (ic->ic_flags_ht & IEEE80211_FHT_HT) ? NL80211_CHAN_HT20 : -#endif - NL80211_CHAN_NO_HT); + wiphy_lock(hw->wiphy); + if (scan_running) { + struct ieee80211vap *vap; + struct lkpi_vif *lvif; + struct ieee80211_vif *vif; - error = lkpi_80211_mo_config(hw, IEEE80211_CONF_CHANGE_CHANNEL); - if (error != 0 && error != EOPNOTSUPP) { - ic_printf(ic, "ERROR: %s: config %#0x returned %d\n", - __func__, IEEE80211_CONF_CHANGE_CHANNEL, error); - /* XXX should we unroll to the previous chandef? */ - IMPROVE(); - } else { - /* Update radiotap channels as well. */ - lhw->rtap_tx.wt_chan_freq = htole16(c->ic_freq); - lhw->rtap_tx.wt_chan_flags = htole16(c->ic_flags); - lhw->rtap_rx.wr_chan_freq = htole16(c->ic_freq); - lhw->rtap_rx.wr_chan_flags = htole16(c->ic_flags); + /* + * For now and for scanning just pick the first VIF. + * net80211 will need to grow DBDC/link_id support + * for us to find the vif/chanctx otherwise. + */ + vap = TAILQ_FIRST(&ic->ic_vaps); + lvif = VAP_TO_LVIF(vap); + vif = LVIF_TO_VIF(lvif); + + /* We always set the chandef to no-HT for scanning. */ + cfg80211_chandef_create(&lhw->scan_chandef, chan, + NL80211_CHAN_NO_HT); + + /* + * This works for as long as we do not do BGSCANs; otherwise + * it'll have to be offchan work. + */ + chanctx_conf = lkpi_get_chanctx_conf(hw, vif); + changed = lkpi_init_chanctx_conf(hw, &lhw->scan_chandef, chanctx_conf); + error = lkpi_set_chanctx_conf(hw, vif, chanctx_conf, changed, true); + + TRACE_SCAN(ic, "scan_flags %b chan %d ???, error %d", + lhw->scan_flags, LKPI_LHW_SCAN_BITS, + c->ic_ieee, error); + + IMPROVE("max power for scanning; TODO in lkpi_80211_update_chandef"); + + } else if (lhw->ops->change_chanctx == ieee80211_emulate_change_chanctx) { + /* + * We do not set the channel here for normal chanctx operation. + * That's just a setup to fail. scan_to_auth will setup all the + * other neccessary options for this to work. + */ + struct lkpi_ic_set_channel_iter_arg chanctx_iter_arg = { + .chan = chan, + .chanctx_conf = NULL, + }; + struct cfg80211_chan_def chandef; + + lkpi_init_chandef(&chandef, chan, c, false); + + ieee80211_iter_chan_contexts_mtx(hw, + lkpi_ic_set_channel_chanctx_iterf, &chanctx_iter_arg); + + if (chanctx_iter_arg.chanctx_conf == NULL) { + /* No chanctx found for this channel. */ + struct ieee80211vap *vap; + struct lkpi_vif *lvif; + struct ieee80211_vif *vif; + + /* + * For now just pick the first VIF. + * net80211 will need to grow DBDC/link_id support + * for us to find the vif/chanctx otherwise. + */ + vap = TAILQ_FIRST(&ic->ic_vaps); + lvif = VAP_TO_LVIF(vap); + vif = LVIF_TO_VIF(lvif); + + chanctx_conf = lkpi_get_chanctx_conf(hw, vif); + changed = lkpi_init_chanctx_conf(hw, &chandef, chanctx_conf); + IMPROVE("update HT, VHT, bw, ..."); + error = lkpi_set_chanctx_conf(hw, vif, chanctx_conf, changed, true); + + } else { + /* + * We know we are on the same channel. + * Do we really have to reset everything? + */ + IMPROVE("update HT, VHT, bw, ..."); + + chanctx_conf = chanctx_iter_arg.chanctx_conf; + changed = lkpi_init_chanctx_conf(hw, &chandef, chanctx_conf); + lkpi_80211_mo_change_chanctx(hw, chanctx_conf, changed); + } } /* Currently PS is hard coded off! Not sure it belongs here. */ - IMPROVE(); + IMPROVE("PS"); if (ieee80211_hw_check(hw, SUPPORTS_PS) && (hw->conf.flags & IEEE80211_CONF_PS) != 0) { hw->conf.flags &= ~IEEE80211_CONF_PS; @@ -5189,6 +5279,8 @@ lkpi_ic_set_channel(struct ieee80211com *ic) "%d\n", __func__, IEEE80211_CONF_CHANGE_PS, error); } + + wiphy_unlock(hw->wiphy); } static struct ieee80211_node * diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index e453cefa20f7..07816cdfe166 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -256,6 +256,7 @@ struct lkpi_hw { /* name it mac80211_sc? */ struct sx mc_sx; struct cfg80211_chan_def dflt_chandef; + struct cfg80211_chan_def scan_chandef; struct mtx txq_mtx; uint32_t txq_generation[IEEE80211_NUM_ACS]; From nobody Sat Apr 18 01:12:46 2026 X-Original-To: dev-commits-src-main@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 4fyDJH1YCcz6ZTSb for ; Sat, 18 Apr 2026 01:12: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJG6VDcz3nRW for ; Sat, 18 Apr 2026 01:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474766; 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=7w8gLCvnmjIda2JWSiJJmi2F+4FhiMKt+pCgOGy1Mbg=; b=VHG0XM/bh3AW7C0ZJ+TJVJK5fVEmMTLGdTHeWN5bg7JpmryZZuHfF7SmZupVxPJF3AIOw1 He8e7rX7968s2FqnkZAXnrYeU91drxDunrUXRwPtCCm/UOLqhoxrE4GUaOnXCdZZTB8icZ nwFO+LhyJvRu3J0ipXJkmI/Se5TWmByy5pMx6emv4MPJvwUnmJMcynOe0+pftpjsy9eOkD Nn/KgfmYsS9hCKJWpaFOCtXBLJTx6tAJkVjdvjD6T5sWimZBQDE2j1nYDi7RkR2wngoUQg U5A/hi57ZiIMqaGOjt50EmTMJlreUMz0WpY6dAAyuLnCfGkwY1OMzgWILfTkSA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474766; a=rsa-sha256; cv=none; b=h6rGuLEg3AreVe8kjkrF7QyJZFBr5fVkxLHgFkVFszFisJA5V2urj0EF0ZJQheFiVVWCjs +mphuPij+2AkPyHDC+68dISf8MYamhIXnyjAUQNab7IZp6OqeJZGUFlyqeda0h6XU3Npqx 6jeQXTbiWSv2qGPCxrq3Vsijc9td4PqAYkctnoAyLkoHrm1CuawrZj23Vd2gB88oLpM6kg 0d09eiTmG1SW2teH4SgU+TRJMUuZXMLnPEZZvEm+5a+9SE8IVXVtz0dQml1lPiH4Oz3HJM UEF/k3R+YsR4MAjpGY2mOmauV2W9KrIpGQ4Jda73+oqHp2QTpxCwYjgllPDQnw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474766; 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=7w8gLCvnmjIda2JWSiJJmi2F+4FhiMKt+pCgOGy1Mbg=; b=nAUWKVzeoKu8lGO9m0v8aCBqHCzWDWhpRx4Z6h+PHZTLSkru3Qp88EQ8t+aroEojJtudiL q1khTNxOXzrFX1602IOdX2HFzPG0Sy0rx1OX3hD3LBP2iupC5LcZI2BF/YWM8MieSstIZj XXMffhUQqJhqiYL4dsxs2xbcyVnhj8EcDqWSQk2A0QcJeF3X2OMa+Qif2rFU9Vc2T8U/D0 wh2BfqKsiCAKigYibw2XYXtR55xOHDhQ4HePGTas8CNXYg2P0wL9HsKNZxHU+THmOh0E+Q hOHAwqWZq2vnVIAKHxvvRvljcoa82Tkg6RD/fueOb/B23Gj/fqh4Poi378tlDA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJG5w4Jz2nm for ; Sat, 18 Apr 2026 01:12:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 45c68 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:46 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 166a7344df58 - main - LinuxKPI: 802.11: improve emulate chanctx implementation List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 166a7344df582f98a88f2b37b7aa3dc4558c9438 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:46 +0000 Message-Id: <69e2da8e.45c68.e181e80@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=166a7344df582f98a88f2b37b7aa3dc4558c9438 commit 166a7344df582f98a88f2b37b7aa3dc4558c9438 Author: Bjoern A. Zeeb AuthorDate: 2026-03-10 11:16:12 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:09 +0000 LinuxKPI: 802.11: improve emulate chanctx implementation Now that all dependencies are implemented improve our chanctx emulation. Some drivers still rely on chandef information for channel work. In order to only do chanctx updates within mac80211 in Linux and likewise in the LinuxKPI 802.11 compat layer, emulation functions were introduced which claim to support chanctx driver operation but in reality convert these to chandef field updates and (*config) downcalls. This is relevant to several mt76 chipsets (at least 7615, 7915), and rtw88 and certain rtw89 chipsets (8851b, and the ones not supporting SCAN_OFFLOAD or BEACON_FILTER) for us. Migrate the logic out of the header and improve it. Make use of the introduced dflt_chandef and scan_chandef fields, add comparison of chandefs to see if we have to update, etc. Also add strict checks for driver settings in linuxkpi_ieee80211_alloc_hw() to make sure all preconditions are correctly met. Store the result if we are using the emulation functions in a field, so we can later check on it and also leave a note to the users if emulation is used in order to improve debugging on possible problem reports. Use the new field that we use emulation in lkpi_ic_set_channel() instead of a hand crafted check. Sponsored by: The FreeBSD Foundation MFC after: 3 days Fixes: ac1d519c01ca8 ("LinuxKPI: 802.11: adjustments for v6.11..") --- sys/compat/linuxkpi/common/include/net/mac80211.h | 72 ++------ sys/compat/linuxkpi/common/src/linux_80211.c | 208 +++++++++++++++++++++- sys/compat/linuxkpi/common/src/linux_80211.h | 1 + 3 files changed, 218 insertions(+), 63 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 4f3aad532810..c637e13a496d 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1196,6 +1196,22 @@ void linuxkpi_ieee80211_handle_wake_tx_queue(struct ieee80211_hw *, /* -------------------------------------------------------------------------- */ +/* + * Emulate chanctx operations. We cannot rename/prefix the functions + * as we rely on the (function)pointers being the same everywhere. + */ +int ieee80211_emulate_add_chanctx(struct ieee80211_hw *, + struct ieee80211_chanctx_conf *); +void ieee80211_emulate_remove_chanctx(struct ieee80211_hw *, + struct ieee80211_chanctx_conf *); +void ieee80211_emulate_change_chanctx(struct ieee80211_hw *, + struct ieee80211_chanctx_conf *, uint32_t); +int ieee80211_emulate_switch_vif_chanctx(struct ieee80211_hw *, + struct ieee80211_vif_chanctx_switch *, int, + enum ieee80211_chanctx_switch_mode); + +/* -------------------------------------------------------------------------- */ + static __inline void _ieee80211_hw_set(struct ieee80211_hw *hw, enum ieee80211_hw_flags flag) { @@ -2634,60 +2650,4 @@ ieee80211_cqm_beacon_loss_notify(struct ieee80211_vif *vif, gfp_t gfp __unused) /* -------------------------------------------------------------------------- */ -int lkpi_80211_update_chandef(struct ieee80211_hw *, - struct ieee80211_chanctx_conf *); - -static inline int -ieee80211_emulate_add_chanctx(struct ieee80211_hw *hw, - struct ieee80211_chanctx_conf *chanctx_conf) -{ - int error; - - hw->conf.radar_enabled = chanctx_conf->radar_enabled; - error = lkpi_80211_update_chandef(hw, chanctx_conf); - return (error); -} - -static inline void -ieee80211_emulate_remove_chanctx(struct ieee80211_hw *hw, - struct ieee80211_chanctx_conf *chanctx_conf __unused) -{ - hw->conf.radar_enabled = false; - lkpi_80211_update_chandef(hw, NULL); -} - -static inline void -ieee80211_emulate_change_chanctx(struct ieee80211_hw *hw, - struct ieee80211_chanctx_conf *chanctx_conf, uint32_t changed __unused) -{ - hw->conf.radar_enabled = chanctx_conf->radar_enabled; - lkpi_80211_update_chandef(hw, chanctx_conf); -} - -static inline int -ieee80211_emulate_switch_vif_chanctx(struct ieee80211_hw *hw, - struct ieee80211_vif_chanctx_switch *vifs, int n_vifs, - enum ieee80211_chanctx_switch_mode mode __unused) -{ - struct ieee80211_chanctx_conf *chanctx_conf; - int error; - - /* Sanity check. */ - if (n_vifs <= 0) - return (-EINVAL); - if (vifs == NULL || vifs[0].new_ctx == NULL) - return (-EINVAL); - - /* - * What to do if n_vifs > 1? - * Does that make sense for drivers not supporting chanctx? - */ - hw->conf.radar_enabled = vifs[0].new_ctx->radar_enabled; - chanctx_conf = vifs[0].new_ctx; - error = lkpi_80211_update_chandef(hw, chanctx_conf); - return (error); -} - -/* -------------------------------------------------------------------------- */ - #endif /* _LINUXKPI_NET_MAC80211_H */ diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index e839867bea58..c2f2adfc7053 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -181,6 +181,8 @@ static void lkpi_ieee80211_free_skb_mbuf(void *); #ifdef LKPI_80211_WME static int lkpi_wme_update(struct lkpi_hw *, struct ieee80211vap *, bool); #endif +static int lkpi_80211_update_chandef(struct ieee80211_hw *, + struct ieee80211_chanctx_conf *); static void lkpi_ieee80211_wake_queues_locked(struct ieee80211_hw *); static const char * @@ -5218,7 +5220,7 @@ lkpi_ic_set_channel(struct ieee80211com *ic) IMPROVE("max power for scanning; TODO in lkpi_80211_update_chandef"); - } else if (lhw->ops->change_chanctx == ieee80211_emulate_change_chanctx) { + } else if (lhw->emulate_chanctx) { /* * We do not set the channel here for normal chanctx operation. * That's just a setup to fail. scan_to_auth will setup all the @@ -6593,6 +6595,53 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops) struct lkpi_hw *lhw; struct wiphy *wiphy; int ac; + bool emuchanctx; + + /* + * Do certain checks before starting to allocate resources. + * Store results in temporary variables. + */ + + /* ac1d519c01ca introduced emulating chanctx changes. */ + emuchanctx = false; + if (ops->add_chanctx == ieee80211_emulate_add_chanctx && + ops->change_chanctx == ieee80211_emulate_change_chanctx && + ops->remove_chanctx == ieee80211_emulate_remove_chanctx) { + /* + * If we emulate the chanctx ops, we must not have + * assign_vif_chanctx and unassign_vif_chanctx. + */ + if (ops->assign_vif_chanctx != NULL || + ops->unassign_vif_chanctx != NULL) { + /* Fail gracefully. */ + printf("%s: emulate_chanctx but " + "assign_vif_chanctx %p != NULL || " + "unassign_vif_chanctx %p != NULL\n", __func__, + ops->assign_vif_chanctx, ops->unassign_vif_chanctx); + return (NULL); + } + emuchanctx = true; + } + if (!emuchanctx && (ops->add_chanctx == ieee80211_emulate_add_chanctx || + ops->change_chanctx == ieee80211_emulate_change_chanctx || + ops->remove_chanctx == ieee80211_emulate_remove_chanctx)) { + printf("%s: not emulating chanctx changes but emulating " + "function set: %d/%d/%d\n", __func__, + ops->add_chanctx == ieee80211_emulate_add_chanctx, + ops->change_chanctx == ieee80211_emulate_change_chanctx, + ops->remove_chanctx == ieee80211_emulate_remove_chanctx); + return (NULL); + } + if (!emuchanctx && (ops->add_chanctx == NULL || ops->change_chanctx == NULL || + ops->remove_chanctx == NULL || ops->assign_vif_chanctx == NULL || + ops->unassign_vif_chanctx == NULL)) { + printf("%s: not all functions set for chanctx operations " + "(emulating chanctx %d): %p/%p/%p %p/%p\n", + __func__, emuchanctx, + ops->add_chanctx, ops->change_chanctx, ops->remove_chanctx, + ops->assign_vif_chanctx, ops->unassign_vif_chanctx); + return (NULL); + } /* Get us and the driver data also allocated. */ wiphy = wiphy_new(&linuxkpi_mac80211cfgops, sizeof(*lhw) + priv_len); @@ -6618,6 +6667,7 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops) /* Chanctx_conf */ INIT_LIST_HEAD(&lhw->lchanctx_list); INIT_LIST_HEAD(&lhw->lchanctx_list_reserved); + lhw->emulate_chanctx = emuchanctx; /* Deferred RX path. */ LKPI_80211_LHW_RXQ_LOCK_INIT(lhw); @@ -6637,6 +6687,8 @@ linuxkpi_ieee80211_alloc_hw(size_t priv_len, const struct ieee80211_ops *ops) /* BSD Specific. */ lhw->ic = lkpi_ieee80211_ifalloc(); + if (lhw->emulate_chanctx) + ic_printf(lhw->ic, "Using chanctx emulation.\n"); IMPROVE(); return (hw); @@ -9220,6 +9272,35 @@ linuxkpi_cfg80211_bss_flush(struct wiphy *wiphy) /* -------------------------------------------------------------------------- */ +static bool +cfg80211_chan_def_are_same(struct cfg80211_chan_def *cd1, + struct cfg80211_chan_def *cd2) +{ + + if (cd1 == cd2) + return (true); + + if (cd1 == NULL || cd2 == NULL) + return (false); + + if (cd1->chan != cd2->chan) + return (false); + + if (cd1->width != cd2->width) + return (false); + + if (cd1->center_freq1 != cd2->center_freq1) + return (false); + + if (cd1->center_freq2 != cd2->center_freq2) + return (false); + + if (cd1->punctured != cd2->punctured) + return (false); + + return (true); +} + /* * hw->conf get initialized/set in various places for us: * - linuxkpi_ieee80211_alloc_hw(): flags @@ -9228,20 +9309,42 @@ linuxkpi_cfg80211_bss_flush(struct wiphy *wiphy) * - lkpi_ic_set_channel(): chandef, flags */ -int lkpi_80211_update_chandef(struct ieee80211_hw *hw, +static int +lkpi_80211_update_chandef(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *new) { + struct lkpi_hw *lhw; struct cfg80211_chan_def *cd; uint32_t changed; int error; + bool same; - changed = 0; - if (new == NULL || new->def.chan == NULL) - cd = NULL; - else + lockdep_assert_wiphy(hw->wiphy); + + lhw = HW_TO_LHW(hw); + if (!lhw->emulate_chanctx) + return (0); + + if (new == NULL || new->def.chan == NULL) { + /* + * In case of remove "new" is NULL, we need to get us to some + * basic channel width but we'd also need to set the channel + * accordingly somewhere. + * The same is true if we are scanning in which case the + * scan_chandef should have a channel set. + */ + if (lhw->scan_chandef.chan != NULL) { + cd = &lhw->scan_chandef; + } else { + cd = &lhw->dflt_chandef; + } + } else { cd = &new->def; + } - if (cd && cd->chan != hw->conf.chandef.chan) { + changed = 0; + same = cfg80211_chan_def_are_same(cd, &hw->conf.chandef); + if (!same) { /* Copy; the chan pointer is fine and will stay valid. */ hw->conf.chandef = *cd; changed |= IEEE80211_CONF_CHANGE_CHANNEL; @@ -9255,6 +9358,97 @@ int lkpi_80211_update_chandef(struct ieee80211_hw *hw, return (error); } +int +ieee80211_emulate_add_chanctx(struct ieee80211_hw *hw, + struct ieee80211_chanctx_conf *chanctx_conf) +{ + int error; + + lockdep_assert_wiphy(hw->wiphy); + +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_TRACE) != 0) { + struct lkpi_hw *lhw; + + lhw = HW_TO_LHW(hw); + ic_printf(lhw->ic, "%s:%d: chanctx_conf %p\n", + __func__, __LINE__, chanctx_conf); + } +#endif + + hw->conf.radar_enabled = chanctx_conf->radar_enabled; + error = lkpi_80211_update_chandef(hw, chanctx_conf); + return (error); +} + +void +ieee80211_emulate_remove_chanctx(struct ieee80211_hw *hw, + struct ieee80211_chanctx_conf *chanctx_conf __unused) +{ + + lockdep_assert_wiphy(hw->wiphy); + +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_TRACE) != 0) { + struct lkpi_hw *lhw; + + lhw = HW_TO_LHW(hw); + ic_printf(lhw->ic, "%s:%d: chanctx_conf %p\n", + __func__, __LINE__, chanctx_conf); + } +#endif + + hw->conf.radar_enabled = false; + lkpi_80211_update_chandef(hw, NULL); +} + +void +ieee80211_emulate_change_chanctx(struct ieee80211_hw *hw, + struct ieee80211_chanctx_conf *chanctx_conf, uint32_t changed __unused) +{ + + lockdep_assert_wiphy(hw->wiphy); + +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_TRACE) != 0) { + struct lkpi_hw *lhw; + + lhw = HW_TO_LHW(hw); + ic_printf(lhw->ic, "%s:%d: chanctx_conf %p\n", + __func__, __LINE__, chanctx_conf); + } +#endif + + hw->conf.radar_enabled = chanctx_conf->radar_enabled; + lkpi_80211_update_chandef(hw, chanctx_conf); +} + +int +ieee80211_emulate_switch_vif_chanctx(struct ieee80211_hw *hw, + struct ieee80211_vif_chanctx_switch *vifs, int n_vifs, + enum ieee80211_chanctx_switch_mode mode __unused) +{ + struct ieee80211_chanctx_conf *chanctx_conf; + int error; + + lockdep_assert_wiphy(hw->wiphy); + + /* Sanity check. */ + if (n_vifs <= 0) + return (-EINVAL); + if (vifs == NULL || vifs[0].new_ctx == NULL) + return (-EINVAL); + + /* + * What to do if n_vifs > 1? + * Does that make sense for drivers not supporting chanctx? + */ + hw->conf.radar_enabled = vifs[0].new_ctx->radar_enabled; + chanctx_conf = vifs[0].new_ctx; + error = lkpi_80211_update_chandef(hw, chanctx_conf); + return (error); +} + /* -------------------------------------------------------------------------- */ MODULE_VERSION(linuxkpi_wlan, 1); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 07816cdfe166..235597ea7a94 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -318,6 +318,7 @@ struct lkpi_hw { /* name it mac80211_sc? */ bool mc_all_multi; bool update_wme; bool rxq_stopped; + bool emulate_chanctx; /* Must be last! */ struct ieee80211_hw hw __aligned(CACHE_LINE_SIZE); From nobody Sat Apr 18 01:12:47 2026 X-Original-To: dev-commits-src-main@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 4fyDJJ39X4z6ZTNt for ; Sat, 18 Apr 2026 01:12:48 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJH6mlFz3n20 for ; Sat, 18 Apr 2026 01:12:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474768; 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=sDqu8Dgs6oqaX+9eiNIDTPpYdnrrh9g9BhFjcmh6lWc=; b=PSOArDX6S+wc4c31yBzzFiKcVE4aL3mTNiwTSu5ROrEzrG/Fj2KNSLTKvNR6Y2EfahI2Fg yemMFtqiDe1FOXTGlbW3bV3hgBPLsODeWQdyZ7Nl18L5aFkodoW5ExrycZwAFEzMSIDSvb oQXf4U1C5nRQ9XV/uyUA8CinldQjL+7ePjTPmEITbOx1x74zZTfCyNm96ePFAR8sspfsSk nx2hIP3NnApmJBfQ6lzTMf5xIqKU3FAK0HADaHvKMZ2OFDc9O/ZNXssd2vKP1mOzlDH00G VOZ2NpqLE6BYMVGyxscjj/BeUWTu/2ezQ/56zmAzZZa49clQg4nL8VpDwxhNFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474768; a=rsa-sha256; cv=none; b=JSElTzeR4kEnQ5o2XWfu3Ky4xWnxTYSgzGGNp5DULe4yoWXLiZeToicaHagVeU25tKE3cl pEkyj259T62Z1HuBrXL/NbMlNNnTAG78iFnw54ozgYbT3sjnnW5A7KflOfhikwFBE3mQoE ORSwLbPBecaod4cOXHbSgF1PFKbzKqsu6q5weDIzVVRZiCFLXsYJVoaS9bbGZNff4G0xJx SKDlgaW1Nm/R8CU25yulQPwCPO3SD3t8jedzmu9SgQ92FZ9iDNmmYC2MieZI0EM7rWmOOj FAJREeFJwsIYSJzj0763rPvKGFO5ViZwYV3AROz3cK40ONzpUM+1NYl9YORbmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474768; 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=sDqu8Dgs6oqaX+9eiNIDTPpYdnrrh9g9BhFjcmh6lWc=; b=cmAjNFiGczHuPCZjoYKPE5Z/8u2XkcCa+FctPtB8+4P4vE1L8m0eRcONxIAzdV2S6oo9mg B1eIcvFSKzuSANRS8jPzhJDuFRAAjlasHxCas/6UYU7DXhPaFJTPKeKvzj9X6fW4YY6NHJ LvhQjPsOdHpGF90ZYCnOnsvwIUyKMwpU9Y2NweibQa2C/cb+bgpYNkH/vcfcWTzirCR4L+ wCtgxZKi0Ams+GA2DUqUSNq5XxdsIW9FJ3sZ+txK84jrl639DgM70IaPuAj2Xt3FncMX15 mp7JYO/Z21d9EjnK6+IZIHJVfJFiCuYKNfdKVd7KnCN9Vi6r6rqWXu7XxsTd6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJH6Gskz2rs for ; Sat, 18 Apr 2026 01:12:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4572d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:47 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 72b9dda511b6 - main - LinuxKPI: 802.11: add chandef tracing List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 72b9dda511b6944068fb18c2f2e059bca48d9edd Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:47 +0000 Message-Id: <69e2da8f.4572d.cac6387@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=72b9dda511b6944068fb18c2f2e059bca48d9edd commit 72b9dda511b6944068fb18c2f2e059bca48d9edd Author: Bjoern A. Zeeb AuthorDate: 2026-04-03 19:59:02 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:09 +0000 LinuxKPI: 802.11: add chandef tracing Add chandef tracing so we can follow what is set and unset in the chanctx emulation for drivers still needing this. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 79 ++++++++++++++++++++++++++-- sys/compat/linuxkpi/common/src/linux_80211.h | 1 + 2 files changed, 77 insertions(+), 3 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index c2f2adfc7053..e1a3daf98cb2 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2219,7 +2219,8 @@ lkpi_80211_flush_tx(struct lkpi_hw *lhw, struct lkpi_sta *lsta) } static void -lkpi_init_chandef(struct cfg80211_chan_def *chandef, +lkpi_init_chandef(struct ieee80211com *ic __unused, + struct cfg80211_chan_def *chandef, struct linuxkpi_ieee80211_channel *chan, struct ieee80211_channel *c, bool can_ht) { @@ -2248,6 +2249,17 @@ lkpi_init_chandef(struct cfg80211_chan_def *chandef, chandef->width = NL80211_CHAN_WIDTH_80; } #endif + +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(ic, "%s:%d: chandef %p { chan %p { %u }, " + "width %d cfreq1 %u cfreq2 %u punctured %u }\n", + __func__, __LINE__, chandef, + chandef->chan, chandef->chan->center_freq, + chandef->width, + chandef->center_freq1, chandef->center_freq2, + chandef->punctured); +#endif } static uint32_t @@ -2587,11 +2599,18 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int #else can_ht = false; #endif - lkpi_init_chandef(&chandef, chan, ni->ni_chan, can_ht); + lkpi_init_chandef(vap->iv_ic, &chandef, chan, ni->ni_chan, can_ht); hw->conf.radar_enabled = ((chan->flags & IEEE80211_CHAN_RADAR) != 0) ? true : false; hw->conf.chandef = chandef; vif->bss_conf.chanreq.oper = hw->conf.chandef; +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(vap->iv_ic, "%s:%d: hw->conf.chandef %p = chandef %p = " + "vif->bss_conf.chanreq.oper %p\n", __func__, __LINE__, + &hw->conf.chandef, &chandef, &vif->bss_conf.chanreq.oper); +#endif + changed = lkpi_init_chanctx_conf(hw, &chandef, chanctx_conf); /* Responder ... */ @@ -5205,6 +5224,11 @@ lkpi_ic_set_channel(struct ieee80211com *ic) /* We always set the chandef to no-HT for scanning. */ cfg80211_chandef_create(&lhw->scan_chandef, chan, NL80211_CHAN_NO_HT); +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(ic, "%s:%d: initialized lhw->scan_chandef\n", + __func__, __LINE__); +#endif /* * This works for as long as we do not do BGSCANs; otherwise @@ -5232,7 +5256,7 @@ lkpi_ic_set_channel(struct ieee80211com *ic) }; struct cfg80211_chan_def chandef; - lkpi_init_chandef(&chandef, chan, c, false); + lkpi_init_chandef(ic, &chandef, chan, c, false); ieee80211_iter_chan_contexts_mtx(hw, lkpi_ic_set_channel_chanctx_iterf, &chanctx_iter_arg); @@ -5252,6 +5276,11 @@ lkpi_ic_set_channel(struct ieee80211com *ic) lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(ic, "%s:%d: using on stack chandef\n", + __func__, __LINE__); +#endif chanctx_conf = lkpi_get_chanctx_conf(hw, vif); changed = lkpi_init_chanctx_conf(hw, &chandef, chanctx_conf); IMPROVE("update HT, VHT, bw, ..."); @@ -5264,6 +5293,12 @@ lkpi_ic_set_channel(struct ieee80211com *ic) */ IMPROVE("update HT, VHT, bw, ..."); +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(ic, "%s:%d: using on stack chandef\n", + __func__, __LINE__); +#endif + chanctx_conf = chanctx_iter_arg.chanctx_conf; changed = lkpi_init_chanctx_conf(hw, &chandef, chanctx_conf); lkpi_80211_mo_change_chanctx(hw, chanctx_conf, changed); @@ -7073,6 +7108,12 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) #endif NL80211_CHAN_NO_HT); lhw->dflt_chandef = hw->conf.chandef; +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(ic, "%s:%d: initialized " + "hw->conf.chandef and dflt_chandef to %p\n", + __func__, __LINE__, &lhw->dflt_chandef); +#endif break; } } @@ -9334,11 +9375,26 @@ lkpi_80211_update_chandef(struct ieee80211_hw *hw, * scan_chandef should have a channel set. */ if (lhw->scan_chandef.chan != NULL) { +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(lhw->ic, "%s:%d: using scan_chandef %p\n", + __func__, __LINE__, &lhw->scan_chandef); +#endif cd = &lhw->scan_chandef; } else { +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(lhw->ic, "%s:%d: using dflt_chandef %p\n", + __func__, __LINE__, &lhw->dflt_chandef); +#endif cd = &lhw->dflt_chandef; } } else { +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(lhw->ic, "%s:%d: using chanctx %p chandef %p\n", + __func__, __LINE__, new, &new->def); +#endif cd = &new->def; } @@ -9351,6 +9407,23 @@ lkpi_80211_update_chandef(struct ieee80211_hw *hw, } IMPROVE("IEEE80211_CONF_CHANGE_PS, IEEE80211_CONF_CHANGE_POWER"); +#ifdef LINUXKPI_DEBUG_80211 + if ((linuxkpi_debug_80211 & D80211_CHANDEF) != 0) + ic_printf(lhw->ic, "%s:%d: chanctx %p { %u } cd %p { %u } " + "hw->conf.chandef %p { %u %d %u %u %u }, " + "changed %#04x same %d\n", + __func__, __LINE__, + new, (new != NULL && new->def.chan != NULL) ? + new->def.chan->center_freq : 0, + cd, cd->chan->center_freq, + &hw->conf.chandef, hw->conf.chandef.chan->center_freq, + hw->conf.chandef.width, + hw->conf.chandef.center_freq1, + hw->conf.chandef.center_freq2, + hw->conf.chandef.punctured, + changed, same); +#endif + if (changed == 0) return (0); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 235597ea7a94..569c4f12f6d6 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -57,6 +57,7 @@ #define D80211_IMPROVE 0x00000002 #endif #define D80211_IMPROVE_TXQ 0x00000004 +#define D80211_CHANDEF 0x00000008 #define D80211_TRACE 0x00000010 #define D80211_TRACEOK 0x00000020 #define D80211_SCAN 0x00000040 From nobody Sat Apr 18 01:12:48 2026 X-Original-To: dev-commits-src-main@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 4fyDJK3Ldtz6ZTgb for ; Sat, 18 Apr 2026 01:12:49 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJK0cXlz3ncK for ; Sat, 18 Apr 2026 01:12:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474769; 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=L7huqJ8di0dN+CeDSl+gl0Ctfn+eeOisO2Sdy3hcWjs=; b=PiowJHgZ+ZEj/zmYkkIELcXd/iPWcRaAvI6INupl+xNH8Le+5lv7fVMBAkpnGONqNBcJbk F7B2exDaPpkesevZ+3n+JCkrkBaoN65QA7AtKfV2dBucLLQMeyBj1topbECi2eSRiVFYyG SI7W7DNV6rzjqhEwVczURlwZRziJsovYeIrcfKIsBMD/SWUetn2Y67a4IhXa7bh06DLcUy TOVIWmbAljyygmSZU69AUEFOyyEEvrUWZV2VhldeRXJ5/jSs1NPEtiVOrWy17Uhnj4xHoD g8bc6EP/a7ZyqJ5/Ek1i4p2si6nKO2VSkU8yjn4Za75Iyq2awURIHejfTq3WQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474769; a=rsa-sha256; cv=none; b=mf0XpQdfBKcEypne8VIeH2tpvQPi5CGdcYLP3moBTrsvynM0GW8QILcjPhlcZ3W5RLaGHQ xRdvK/HbWZlkymyPcg8+dxnorrEVjrRvGPJPEWvUcHH8KFsqpAI8vl0TLGrt4FucQVm9Cx LjaSie1L/kaJE1g/Nf25kfGyGQBvctsGPhE0OKkX3u/ksfJm72KxrnoTOPAQtUJR04avlm /IqrBbRhrniSHcFAiliGZ1kIIFgFl9ymNSHhev+HnTkrUgbnw9x1bEn/oh1O9GXQrS5uVh 3O+gBVAxo6zDbdDLFV9zf6F2qWFZ3tEMVl1pnZdu+uptuULddn5gUSKAuc+xaQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474769; 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=L7huqJ8di0dN+CeDSl+gl0Ctfn+eeOisO2Sdy3hcWjs=; b=WE+5P+XEKVTsrioOudQ1cU8TeF78nefdhmmtua+Bt0Aq59q4jxN6xpNjQFXXUIG45Xgb8v RSLHTDhWVWGWXVx72fsCYHnFJCPUATVGjjeMafttqM7xYSUZugbygjpD30vsg+1Hj1L8GQ ib9q/PxLIw2Ay+PsUoqC13ijMLFPaq1v1CkgexXVhrkdlFZptxv9Vf3A4bkrlEmGAISo3/ 0mE8sxy06blBRGSrNalKdixYjNGj38tE986Zy+Zg2V6/vh1qMziZHvaStWIiVzZwh891sZ AQ/N1KFT0XnomfvYNQgmk9qumQugjJupF9gfF9VU80RU6BP5X+vw88QE/6xVyA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJJ759hz2nn for ; Sat, 18 Apr 2026 01:12:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 472f8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: dc886a442871 - main - LinuxKPI: 802.11: start filling vif->cfg.ap_addr List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dc886a4428712aa4fcdcf8cd9e850b048c923bbf Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:48 +0000 Message-Id: <69e2da90.472f8.17a79c0f@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=dc886a4428712aa4fcdcf8cd9e850b048c923bbf commit dc886a4428712aa4fcdcf8cd9e850b048c923bbf Author: Bjoern A. Zeeb AuthorDate: 2026-04-16 23:42:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:10 +0000 LinuxKPI: 802.11: start filling vif->cfg.ap_addr vif->cfg.ap_addr is used by various drivers now and is the BSSID for non-MLO or the AP addr for MLO configurations. If this is unset rtw89 gets cranky and certain packets are likely not going out correctly (also for iwlwifi). Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index e1a3daf98cb2..89395f2f98b8 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2617,6 +2617,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int /* Set bss info (bss_info_changed). */ bss_changed = 0; + IEEE80211_ADDR_COPY(vif->cfg.ap_addr, ni->ni_bssid); vif->bss_conf.bssid = ni->ni_bssid; bss_changed |= BSS_CHANGED_BSSID; vif->bss_conf.txpower = ni->ni_txpower; @@ -3467,6 +3468,7 @@ lkpi_sta_auth_to_scan(struct ieee80211vap *vap, enum ieee80211_state nstate, int bss_changed |= BSS_CHANGED_QOS; vif->cfg.ssid_len = 0; memset(vif->cfg.ssid, '\0', sizeof(vif->cfg.ssid)); + IEEE80211_ADDR_COPY(vif->cfg.ap_addr, ieee80211broadcastaddr); bss_changed |= BSS_CHANGED_BSSID; vif->bss_conf.use_short_preamble = false; /* XXX BSS_CHANGED_???? */ @@ -4072,6 +4074,7 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], vif->bss_conf.qos = false; vif->bss_conf.use_cts_prot = false; /* vap->iv_protmode */ vif->bss_conf.ht_operation_mode = IEEE80211_HT_OP_MODE_PROTECTION_NONE; + IEEE80211_ADDR_COPY(vif->cfg.ap_addr, ieee80211broadcastaddr); vif->cfg.aid = 0; vif->cfg.assoc = false; vif->cfg.idle = true; @@ -7913,13 +7916,13 @@ no_trace_beacons: struct ieee80211_vif *vif; struct ieee80211_frame *wh; - wh = mtod(m, struct ieee80211_frame *); - if (!IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_bssid)) - goto skip_device_ts; - lvif = VAP_TO_LVIF(vap); vif = LVIF_TO_VIF(lvif); + wh = mtod(m, struct ieee80211_frame *); + if (!IEEE80211_ADDR_EQ(wh->i_addr2, vif->cfg.ap_addr)) + goto skip_device_ts; + IMPROVE("TIMING_BEACON_ONLY?"); /* mac80211 specific (not net80211) so keep it here. */ vif->bss_conf.sync_device_ts = rx_status->device_timestamp; @@ -8757,8 +8760,6 @@ struct sk_buff * linuxkpi_ieee80211_nullfunc_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int linkid, bool qos) { - struct lkpi_vif *lvif; - struct ieee80211vap *vap; struct sk_buff *skb; struct ieee80211_frame *nullf; @@ -8770,17 +8771,15 @@ linuxkpi_ieee80211_nullfunc_get(struct ieee80211_hw *hw, skb_reserve(skb, hw->extra_tx_headroom); - lvif = VIF_TO_LVIF(vif); - vap = LVIF_TO_VAP(lvif); - nullf = skb_put_zero(skb, sizeof(*nullf)); nullf->i_fc[0] = IEEE80211_FC0_VERSION_0; nullf->i_fc[0] |= IEEE80211_FC0_SUBTYPE_NODATA | IEEE80211_FC0_TYPE_DATA; nullf->i_fc[1] = IEEE80211_FC1_DIR_TODS; - IEEE80211_ADDR_COPY(nullf->i_addr1, vap->iv_bss->ni_bssid); + /* XXX-BZ if link is given, this is different. */ + IEEE80211_ADDR_COPY(nullf->i_addr1, vif->cfg.ap_addr); IEEE80211_ADDR_COPY(nullf->i_addr2, vif->addr); - IEEE80211_ADDR_COPY(nullf->i_addr3, vap->iv_bss->ni_macaddr); + IEEE80211_ADDR_COPY(nullf->i_addr3, vif->cfg.ap_addr); return (skb); } From nobody Sat Apr 18 01:12:50 2026 X-Original-To: dev-commits-src-main@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 4fyDJL5TDlz6ZTdp for ; Sat, 18 Apr 2026 01:12:50 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJL1hqlz3nRy for ; Sat, 18 Apr 2026 01:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474770; 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=vGmjKP5hdicl4OpAP5HUubkbiRM49a7xX46nHRU48cU=; b=hwOzUnvVToT2tjHwQe763nuE4J4iq0SWdp/u4Tzk59WxfjOBDbSObi3XppNK1Q5BdvvoYN Oq5jFtiFJlPTq6xdpCIUxlm4T4N2e15sw7rs9kuRvh8Evs5vwSgysZTU8PGdDt/TiDWPDN THMhtSg2RE009FD/7uIW8LnzT2xma4Bl2HvWyo94juZc7D+tXBjj7er5aKBb1qGrhML38z lfW994oMT/r5AFB+eha5x1fdbBX5Z6ZbpzYH5ydODlY/cQGK5c4tEt8Y6LgiPVPjoi4p80 YGAfudbFl3el91DIgWOVPH16vyK8699aN6vNm5ETatGUGd7Afz8XcZRWb2zaAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474770; a=rsa-sha256; cv=none; b=HhKM2cGFYvdbctx5oL7t27Zr0nTxeZUVJ5/zH4Q25Oq4tVURQyv6liGfbphc0DKI8EAfaN +rXlljYs9kK2M1v7rD3HQYwshJFSBP+N0HKrsZ5pgnrHlnG680gVt+Azbj5RCGzRN7mObO elwAbnI0r2wOtmY5mAO4Q8plCBxROhi0QcAb88aFbzvVb67ts2ZYLzqQyddMkb5SH2MDug FgiutOP4mPqHAmzMi7cRbxnV8pSG2r0/8eFRodDV+CHJLcpVCWdii57j2RsweUNHutxqoR ztjzU4dLLFmNZbJF1uBjPwVk8yze3mKFmWpMJwvRwWm8ITWzZxIDhfncqVKvYA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474770; 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=vGmjKP5hdicl4OpAP5HUubkbiRM49a7xX46nHRU48cU=; b=hUUwAIcX+CtoopzEjqUgvvDOQSt/phFYZdQ4YjzPwpSEQtGctSB9a8Z3xmLLpGegMWIjX0 tLlkC5l/pzdk3Ynr9lWY6HAHJNWpnlEE3xQini5TTJBEyTNymK2s83JxfgcYnnj2BV+p1i yjaR/yQQk1I6mG38am6MClWC1/zpoPTnKyu2kZinBQMB/3UAd3zb4lK+1mRBxCXFv+gP0X wqKsr9tZlEQMIrOJihVbJX807BjXX3NOPH6wfxDp7dlcx1eLWH5BAr1ADFl7cENTohwzER mozVZ3mUoRALx2FggICnRor3k4Y2Iec0QWdt072GMGIo8uInlc5/msGq8vmdlw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJL1319z339 for ; Sat, 18 Apr 2026 01:12:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 44a57 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:50 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 9f20a4ebf044 - main - LinuxKPI: 802.11: make sure dtim_period is set List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9f20a4ebf044eb0cab83397c83f13bb3958abf6a Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:50 +0000 Message-Id: <69e2da92.44a57.539c2a67@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9f20a4ebf044eb0cab83397c83f13bb3958abf6a commit 9f20a4ebf044eb0cab83397c83f13bb3958abf6a Author: Bjoern A. Zeeb AuthorDate: 2026-04-17 02:34:51 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:10 +0000 LinuxKPI: 802.11: make sure dtim_period is set When going from ASSOC to RUN LinuxKPI based wireless drivers have certian expectations written in various ways. I believe mac80211 waits to see a beacon before setting the vif to assoc (or the sta to AUTHORIZED). We have some comments in lkpi_update_dtim_tsf() for that. In practice we can filter out the beacons already and know when they came in as we count them but it is hard to split up the state machine and defer the work. So we make sure that dtim_period is set to at least 1 before calling the (*vif_cfg_change) after setting assoc to true; 0 is a reserved value according to the standards. We will update it once we see a beacon and in case the value differs from 1 shortly afterwards from the recv_mgmt callback. While iwlwifi seems to have coped with our initial implementation, rtw89 may hit a DIV 0 if dtim_period is 0 depending on how well the rx path races with our unlocking in assoc_to_run. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 89395f2f98b8..b9528295ad8e 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2013,12 +2013,23 @@ lkpi_update_dtim_tsf(struct ieee80211_vif *vif, struct ieee80211_node *ni, * make sure we do not do it on every beacon we still may * get so only do if something changed. vif->bss_conf.dtim_period * should be 0 as we start up (we also reset it on teardown). + * + * If we are assoc we need to make sure dtim_period is non-0. + * 0 is a reserved value and drivers assume they can DIV by it. + * In theory this means we need to wait for the first beacon + * before we finalize the vif being assoc. In practise that + * is harder until net80211 learns how to. Work around like + * this for the moment. */ - if (vif->cfg.assoc && - vif->bss_conf.dtim_period != ni->ni_dtim_period && - ni->ni_dtim_period > 0) { - vif->bss_conf.dtim_period = ni->ni_dtim_period; - bss_changed |= BSS_CHANGED_BEACON_INFO; + if (vif->cfg.assoc) { + if (vif->bss_conf.dtim_period != ni->ni_dtim_period && + ni->ni_dtim_period > 0) { + vif->bss_conf.dtim_period = ni->ni_dtim_period; + bss_changed |= BSS_CHANGED_BEACON_INFO; + } else if (vif->bss_conf.dtim_period == 0) { + vif->bss_conf.dtim_period = 1; + bss_changed |= BSS_CHANGED_BEACON_INFO; + } } vif->bss_conf.sync_dtim_count = ni->ni_dtim_count; From nobody Sat Apr 18 01:12:52 2026 X-Original-To: dev-commits-src-main@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 4fyDJN6HwKz6ZTmY for ; Sat, 18 Apr 2026 01:12:52 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJN347Rz3nVj for ; Sat, 18 Apr 2026 01:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474772; 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=OS1dcmg/Rkgrxlzr15hXut61tvXIYm/xbNqDOa8VaEc=; b=VIhsnQen5p/Lh6FzucNhkghzfhvBsPdkcmmh0N+UqnKNFympSLmyUS5NNoG45PGCK356Y4 CjyMa3he8DPBiU2Ij/rFw1KPZJ0jJlX5S2Va2KUGeAHZctjelaD4iTeF6sjo20V8Q8GOfZ J4IusIPtwavC+AMB4S72LmbMSdqO3KQCNlMV0VaIN15yJ8QRF5ZYLkb0eye80fWFCBpKuL EpWQhEJMDiMoGIzMGxa7oFNW49bur4ZoOwYO+KNMV2QTg8I2jp51ixetV73bdVhTt2fpJc 8W82DC3RUGNH1RyyfjGkGdjOlh9SWdq9YCODG8LciKfd4gJDDSb1WtuLnRd5QQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474772; a=rsa-sha256; cv=none; b=Y+BNiprOrucOcnMMLqBn/bTMY2oKuztLc4S5ra0xNO7BGgH9aDsc36ZaZ4ALk3XlKrDBnD hOwPzlbwU06wNfhm5b0PhkV2V8Odsoi6J0WfTJiZFlzObFAeC9zm3adnr5EJW8ca5ygd3B 4P5wBCaZe0FiNjJE/8tJBafPSOKIpKPf7i3SmbIHquNbjn9XHxW1DcA3rjivoB/BBNW8Aa G4ocT/rOlrAf1YUav+Yhk/n4i2mc3hNe71Arci8Vh5TeUzPW/dm80PPHI4HSR5yfvKuQ+3 i1nEJTzXbnVL13iuXsGddds6525li4iUoSHih549mhk4pl+zLYEGY8ob1KS16g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474772; 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=OS1dcmg/Rkgrxlzr15hXut61tvXIYm/xbNqDOa8VaEc=; b=XbkVvh99E+imiV4cKLkIlU3cHPKjwncs1+2/eM4mZwN3UnBW6vejq8Mb7ql98tAFea+5+p TfFp3xlpzbDfbtcyZX3I+CDvgnCZCN8YYCcjblw5H6eIcLMVpLBMAsl5kPDGFKxM5+K8kz n6sZMmXD77mzdiwMTrh2kQi+eoWpmAMrC9frTymo5yrCoUeOcG1q6Hu3S3R+ZxZ4CFEaYC n/WNKQF4MFYVGyYtxJEKEtOqjbXxDIcgsRt1pY0R23WbUeQ1tO9C+rGxC346Vk/032avPW Wch2Aja/27IfgWRuirPukPrkoICzkE2UZtWRVOky1+Y04mWn3k2cwmM27LCkRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJN2cn6z33B for ; Sat, 18 Apr 2026 01:12:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 4660f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:52 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: f5cd992fa902 - main - bnxt_en: fix module Makefile for LinuxKPI List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5cd992fa902ebb27a3a1042ee8e0d4d351bb361 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:52 +0000 Message-Id: <69e2da94.4660f.771e7fad@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f5cd992fa902ebb27a3a1042ee8e0d4d351bb361 commit f5cd992fa902ebb27a3a1042ee8e0d4d351bb361 Author: Bjoern A. Zeeb AuthorDate: 2026-04-16 10:05:51 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:11 +0000 bnxt_en: fix module Makefile for LinuxKPI Rather than manually including the include directory for LinuxKPI use the provided macro. Before there was no -I for the dummy directory and as files synced from Linux under a permissive license may include them the build would fail. overflow.h will include linux/const.h which only exists as a dummy header at this point on FreeBSD. Sponsored by: The FreeBSD Foundation Fixes: 35b53f8c989f6 MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D56424 --- sys/modules/bnxt/bnxt_en/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/bnxt/bnxt_en/Makefile b/sys/modules/bnxt/bnxt_en/Makefile index d90f3b91d860..12c23898c106 100644 --- a/sys/modules/bnxt/bnxt_en/Makefile +++ b/sys/modules/bnxt/bnxt_en/Makefile @@ -14,6 +14,6 @@ SRCS += ${LINUXKPI_GENSRCS} CFLAGS+= -DIFLIB CFLAGS+= -I${SRCTOP}/sys/ofed/include -CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include +CFLAGS+= ${LINUXKPI_INCLUDES} .include From nobody Sat Apr 18 01:12:51 2026 X-Original-To: dev-commits-src-main@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 4fyDJM6d7jz6ZTSh for ; Sat, 18 Apr 2026 01:12:51 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJM2p2Pz3ncZ for ; Sat, 18 Apr 2026 01:12:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474771; 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=wMj29yvgF6S1vy1nVz+NrryWUbDaBW7EDe+kmBautHQ=; b=m99wZ/4sYGpsYhqBXC9Pw+Q/fTMPNrCvmaXzQC0bBsTCEajFNNViJc2Se0hqDT18Qu9zog 24qUXgLmeyfFSv13qIFuy8z100saCvXGjUV4pdoOsWlRX27CL8ypxEuOmYwD6Td6kjuxRN SI8D/Ckf20fj+6+QbVDz9LjP8zaYn9PlUlT2Y/iXTUtv/BKNzQwQ8OvLUzWkNLmdnyAuBR 1qEDipEuOSVX7GI3DR2sWw5VBPJLTq9T5pVF7Ecj6gxEfVQ4E3KlJFGlLj5j+5HHjN0su9 ZRa8t65DNGiYtcLq8gmvadU6oN4eYmccWHHrsytox/98JOQ0cFBI/bqv1p34qA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474771; a=rsa-sha256; cv=none; b=m3uxq9NPnmSURWtobr8QAIrhQJYNYIfO2E8u/r7ALrjnMyofRox2ZdgCLlUcZBN4H/YpXb nQeIOrWlX201LewZ9MXmhRskRU+5aaEXwfSpJUlOfYSc+C8hzc8/McRxgb+66MxMCpGcAe qTsPHvylVivXicjexlnnXvF9dJHBYofZt1gOCQeE2pfpJkp0d1PNIpmB6j0WQQCKQAje+3 gXuySFQhjyhE4IyoxnljrzKnMZes/MV3HtAE1CoQyNOx0+x+ERbGK9FMCu7690fNiBXTVV e3AmbFL5baLU+XzIasrvLTDRH7mStxLdLl3PA6u2lTjqYQogd1Lkl5PiyXjZxw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474771; 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=wMj29yvgF6S1vy1nVz+NrryWUbDaBW7EDe+kmBautHQ=; b=eTiQBuN1bOKiPec8TpQAkHgtd/606yfj7J8LLjMA/eiVnvpq5vS/qf7bB8cZt124uj+zD8 MXm6OrGzgXPPIa8YFCKSN5uUvSL9dLpmiT7Yyre6o8Vq75qY/rSEZrrwXmQ7psJUiDh18J 4XuohlHtfLMpJWWfQxxdwpTgbhfZfrMzs8pzBLxvPsflOLTDFKryCRBzZ7aBUs2dwY9DSv Yp83oSovCo0VI8sMNIPilsKRFiWhXmYLpTRQshyR8TPh4gxq4LON2zRBEPEe88I3W7Wf0x xHpT6zUZBo1ZQxZ1XMiSenShc7QpInII01Tqn50tJXru5CpciL8zD4xCezsIhg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJM1lBsz28J for ; Sat, 18 Apr 2026 01:12:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 468b8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 99bbfb77e3c3 - main - rtw89: add a warn about beacon_int or dtim_period being 0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 99bbfb77e3c395805fe0a7f19006c5c29136f9fc Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:51 +0000 Message-Id: <69e2da93.468b8.38ce4040@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=99bbfb77e3c395805fe0a7f19006c5c29136f9fc commit 99bbfb77e3c395805fe0a7f19006c5c29136f9fc Author: Bjoern A. Zeeb AuthorDate: 2026-04-17 02:40:03 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:11 +0000 rtw89: add a warn about beacon_int or dtim_period being 0 While after the changes to LinuxKPI 802.11 we should never be assoc and not have dtim_period set, we have seen before that this could happen. Add a WARN as that will help debugging the following DIV 0. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/contrib/dev/rtw89/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/contrib/dev/rtw89/core.c b/sys/contrib/dev/rtw89/core.c index aeaf1c8f80c5..1dee73a62f98 100644 --- a/sys/contrib/dev/rtw89/core.c +++ b/sys/contrib/dev/rtw89/core.c @@ -2838,6 +2838,10 @@ static void rtw89_core_bcn_track_assoc(struct rtw89_dev *rtwdev, dtim = bss_conf->dtim_period; rcu_read_unlock(); +#if defined(__FreeBSD__) + WARN(beacon_int == 0 || dtim == 0, "period %u / beacon_int %u / dtim %u\n", + period, beacon_int, dtim); +#endif beacons_in_period = period / beacon_int / dtim; bcn_intvl_us = ieee80211_tu_to_usec(beacon_int); From nobody Sat Apr 18 01:12:53 2026 X-Original-To: dev-commits-src-main@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 4fyDJP6RD3z6ZTgn for ; Sat, 18 Apr 2026 01:12:53 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJP4Gxfz3nm2 for ; Sat, 18 Apr 2026 01:12:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474773; 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=BQcDvyPBd3Yn6G1pbfD87ttNQXsvA/N+z1ElQbWSwEg=; b=lEOASsXVBSddjwKjhnrG3c2aoSFy0QZZjL+p9rA7xEgsdE8qBoKpi+as2nz4pz5H9OvV48 mcNqv39A5xJDDhTK9PhLyXpj04ouvny6v5jkjP0EPWznbgPhRPVrn1ZOl7cXOAug5JwRc+ PUYQ2Xir+FxvP+lHFi+SR9rQRrFkpRnBWM5X9Zwyv0fapCcxTWj5B9vgkV1a5vRR4i+EEp Js8eFOADLx5Nev8qZzOKU6NE020zVXCShgPCV8OSSokB+I5gPg7LIYs8XeBit4XVSXuyAX xTCAaHWmp86Khri7PByfbtsUcO+PX+kZO1t619ImVz9pIG1XhqF3IV0iCgpCWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474773; a=rsa-sha256; cv=none; b=taXeRplq0PyMogfKCDq1Kdd8Mb8P6pRuP+XLpQ1bEwhX8aaof3ZNd8PYQndJORjTl3j8W7 LFYYfFZbCNlT5QlbQFoD51j46tGJjXVTdDKEArVmtGzIL5a5FijfbVrljYjEjaqfB+R6mB b3xErEq2gtamNmeFC4LruNkw/oGx7+3EEnGPKN/AU7zU+0gJ3isX53wnW+/TaEdrBefkOH 1L6WFAdRGQd+NpC+0RMHhqIfSbhqeCQCbRHgTibTxlP/SYgymgVmADv+DiPKg6MyQBckOT 75wuIqb/MmBYrv+0i5eeUG6iDYDx7rwTDjHsQCoZf0uADgrnAkOJcmQ0Saz0fw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474773; 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=BQcDvyPBd3Yn6G1pbfD87ttNQXsvA/N+z1ElQbWSwEg=; b=oXlff7dYwDRIjtCjCa9a7lZspOyAAKnSgQtoWmEZMYHbzv6EGiI0NJ1iu0qKU3ARXQYNFK x+/nbfmi0ZfhbLxHtVnEflL/GDRKgY392kijsCKlhGYnDr2t24vpKp7qv9mHvYf8v6NJe8 WskLdvuURaLdYlMBKCwOf8b66NtPQrs/NEDJplAxEDleRU43GiqJhl0XQ5yDIqFgeYvr17 3eOytPPuz5g3fnvEulGpsrBN7zsAnM9rvngpYU+tHpxjNAnBxpB66LjgLfi+SnQZFPIR2W 1goxBz4lI2Gv2oZrPNmazzI/Zs0UVIjbeqcEY1vScj5dhG1fjdUySxkWWVRvHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJP3Zw6z2rt for ; Sat, 18 Apr 2026 01:12:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 467e9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 125b09de09ec - main - net80211: radiotap: add more VHT flags, and struct List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 125b09de09ec5ca1939de0207090513453b5908e Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:53 +0000 Message-Id: <69e2da95.467e9.4e3d870c@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=125b09de09ec5ca1939de0207090513453b5908e commit 125b09de09ec5ca1939de0207090513453b5908e Author: Bjoern A. Zeeb AuthorDate: 2026-04-14 15:21:27 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:12 +0000 net80211: radiotap: add more VHT flags, and struct Add the struct for VHT information and flags for the known and flag field as documented on radiotap.org. iwlwifi has started filling in these details. While here, add Copyright information for all the additions in the last years. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/net80211/ieee80211_radiotap.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sys/net80211/ieee80211_radiotap.h b/sys/net80211/ieee80211_radiotap.h index d729323fce3a..ce5350feac96 100644 --- a/sys/net80211/ieee80211_radiotap.h +++ b/sys/net80211/ieee80211_radiotap.h @@ -4,6 +4,10 @@ * SPDX-License-Identifier: BSD-3-Clause * * Copyright (c) 2003, 2004 David Young. All rights reserved. + * Copyright (c) 2021-2026 The FreeBSD Foundation + * + * Portions of this software were developed by Björn Zeeb + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -377,7 +381,19 @@ enum ieee80211_radiotap_type { /* https://www.radiotap.org/fields/VHT.html */ #define IEEE80211_RADIOTAP_VHT_KNOWN_STBC 0x0001 /* net80211::IEEE80211_RADIOTAP_VHT_HAVE_STBC */ +#define IEEE80211_RADIOTAP_VHT_KNOWN_GI 0x0004 +#define IEEE80211_RADIOTAP_VHT_KNOWN_SGI_NSYM_DIS 0x0008 +#define IEEE80211_RADIOTAP_VHT_KNOWN_LDPC_EXTRA_OFDM_SYM 0x0010 #define IEEE80211_RADIOTAP_VHT_KNOWN_BEAMFORMED 0x0020 /* net80211::IEEE80211_RADIOTAP_VHT_HAVE_BF */ +#define IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH 0x0040 +#define IEEE80211_RADIOTAP_VHT_KNOWN_GROUP_ID 0x0080 +#define IEEE80211_RADIOTAP_VHT_KNOWN_PARTIAL_AID 0x0100 + +#define IEEE80211_RADIOTAP_VHT_FLAG_STBC 0x01 +#define IEEE80211_RADIOTAP_VHT_FLAG_SGI 0x04 +#define IEEE80211_RADIOTAP_VHT_FLAG_SGI_NSYM_M10_9 0x08 +#define IEEE80211_RADIOTAP_VHT_FLAG_LDPC_EXTRA_OFDM_SYM 0x10 +#define IEEE80211_RADIOTAP_VHT_FLAG_BEAMFORMED 0x20 /* https://www.radiotap.org/fields/0-length-PSDU.html */ #define IEEE80211_RADIOTAP_ZERO_LEN_PSDU_SOUNDING 0x00 @@ -399,6 +415,17 @@ struct ieee80211_radiotap_vendor_content { uint8_t data[]; } __packed; +/* https://www.radiotap.org/fields/VHT.html */ +struct ieee80211_radiotap_vht { + uint16_t known; + uint8_t flags; + uint8_t bandwidth; + uint8_t mcs_nss[4]; + uint8_t coding; + uint8_t group_id; + uint16_t partial_aid; +} __packed; + /* https://www.radiotap.org/fields/HE.html */ struct ieee80211_radiotap_he { uint16_t data1, data2, data3, data4, data5, data6; From nobody Sat Apr 18 01:12:54 2026 X-Original-To: dev-commits-src-main@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 4fyDJR0l7Tz6ZTk8 for ; Sat, 18 Apr 2026 01:12:55 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJQ4tknz3ngX for ; Sat, 18 Apr 2026 01:12:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474774; 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=rO2BXq4q+8K31EBSutYN5K+/DZnHAbZ5plZvpyMbzjE=; b=OC93yqcUXPSYvJGRtwD21ylcsNV7qrDuo12zjPUkp0qSkWROdqz94XkjKMHg+24QZb9gbH v2HrtJ5Uv/F/uffRcwTPqDYXzBvGWBuUjSc4S8kFGKGJtnVZSVIqPgYXdCzJbbu7VKQTia 7t5kKnTlabz2gFJBRjev+XepNJuBcOVChhTxEQ5ThmQxMG8xp4+WZBpeGSxPlMvZUftn90 /0agOokFDiCzs6N0dWRKx6QoJOW9/JRkKF2Inf/kmNLB2T4JbdhEiXoQt1t5Q0zBCQG6yz iixMNkWhbWWex0LLBI9r8m5pmJ+s27xQV6nB9NvSyNB9d1L/kf6BdJXYvD+Mqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474774; a=rsa-sha256; cv=none; b=qXHU1l+igEttxTYQe/ucTVrY27JezDgfpAmnBq2yX47kAKgNBCTvfvt9N5lgsNMK8RATp1 hku4WFOcV9sfbWoQgt99QOcRoUp4bl69PCtVk44tTyy2h+MXX7ZsgpIUEWXmPwxL8MSDIS DDDn7wbnp4I5VZPkvcv+rakdwko9X8wPjm/IWkY5iuIz0p65u2JpEMSpzbBXz0ybZ/Wpax Cd5N8JjU1zM0elni5p1KC+hxlD0R8ag+0CzsgNcw/vzUFcUtH2ilRquXrJOCKFf5P0oGz7 Q1ArZ8u/ckOiPu8k+c2tkAIBXBxdolkToVErkYpP4JVCceeqdU19mZrxsiq8HQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474774; 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=rO2BXq4q+8K31EBSutYN5K+/DZnHAbZ5plZvpyMbzjE=; b=pAURo63+/38p0RX4hdQ/zrbauK392EDMc1iwyvfCz7ACthCbjGOCRIiINdAmkulE3P2GFw lOWzcmh7wP5dqEIDdQgGLB5CZuObb8mpx/wokY9luFeMBcod3kJbuGtXfMgFCbbLMoXR5X W8DHpTVCR6KpqBB3kqnxt0mzhMr5yTAELLYWJamXEJl9v6ctU1GyacW8QEIhV/la4oVKlX E9DCiXiEbJDsENsZjNslanzW4u8e/OtDKYwhOSFyQCAev11BoQotm9Xf3Ukasf/I3QPvTu 0bcijQECbHWHZQJlCplgXRdfahHHHhVjLc89Ve0swdFdtfNHlga3wx9vVf2rWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJQ47gNz2rv for ; Sat, 18 Apr 2026 01:12:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46520 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:54 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 98297ff3cfbb - main - LinuxKPI: move hex2bin() from kernel.h to new hex.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98297ff3cfbb42df86fa7af51a2740d5aa7236eb Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:54 +0000 Message-Id: <69e2da96.46520.37e60d99@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=98297ff3cfbb42df86fa7af51a2740d5aa7236eb commit 98297ff3cfbb42df86fa7af51a2740d5aa7236eb Author: Bjoern A. Zeeb AuthorDate: 2026-04-14 13:36:40 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:12 +0000 LinuxKPI: move hex2bin() from kernel.h to new hex.h New Linux v7.0 drivers include hex.h. Rather than adding a dummy header, migrate the kernel.h hex2bin() into hex.h, where it belongs. Care needs to be taken as the _h2b() helper function is still used by other bits in kernel.h. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste, dumbbell Differential Revision: https://reviews.freebsd.org/D56391 --- sys/compat/linuxkpi/common/include/linux/hex.h | 44 +++++++++++++++++++++++ sys/compat/linuxkpi/common/include/linux/kernel.h | 32 +---------------- 2 files changed, 45 insertions(+), 31 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/hex.h b/sys/compat/linuxkpi/common/include/linux/hex.h new file mode 100644 index 000000000000..7e9f499cfb1b --- /dev/null +++ b/sys/compat/linuxkpi/common/include/linux/hex.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2022-2026 Bjoern A. Zeeb + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#ifndef _LINUXKPI_LINUX_HEX_H_ +#define _LINUXKPI_LINUX_HEX_H_ + +#include +#include + +static inline int +_h2b(const char c) +{ + + if (c >= '0' && c <= '9') + return (c - '0'); + if (c >= 'a' && c <= 'f') + return (10 + c - 'a'); + if (c >= 'A' && c <= 'F') + return (10 + c - 'A'); + return (-EINVAL); +} + +static inline int +hex2bin(uint8_t *bindst, const char *hexsrc, size_t binlen) +{ + int hi4, lo4; + + while (binlen > 0) { + hi4 = _h2b(*hexsrc++); + lo4 = _h2b(*hexsrc++); + if (hi4 < 0 || lo4 < 0) + return (-EINVAL); + + *bindst++ = (hi4 << 4) | lo4; + binlen--; + } + + return (0); +} + +#endif /* _LINUXKPI_LINUX_HEX_H_ */ diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 880d2f67c517..2430b25c6915 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -56,6 +56,7 @@ #include #include #include +#include #include #include @@ -305,37 +306,6 @@ linux_ratelimited(linux_ratelimit_t *rl) #define add_taint(x,y) do { \ } while (0) -static inline int -_h2b(const char c) -{ - - if (c >= '0' && c <= '9') - return (c - '0'); - if (c >= 'a' && c <= 'f') - return (10 + c - 'a'); - if (c >= 'A' && c <= 'F') - return (10 + c - 'A'); - return (-EINVAL); -} - -static inline int -hex2bin(uint8_t *bindst, const char *hexsrc, size_t binlen) -{ - int hi4, lo4; - - while (binlen > 0) { - hi4 = _h2b(*hexsrc++); - lo4 = _h2b(*hexsrc++); - if (hi4 < 0 || lo4 < 0) - return (-EINVAL); - - *bindst++ = (hi4 << 4) | lo4; - binlen--; - } - - return (0); -} - static inline bool mac_pton(const char *macin, uint8_t *macout) { From nobody Sat Apr 18 01:12:56 2026 X-Original-To: dev-commits-src-main@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 4fyDJT23Hsz6ZTmm for ; Sat, 18 Apr 2026 01:12:57 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJS66dvz3nh2 for ; Sat, 18 Apr 2026 01:12:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474776; 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=YJo2A/ABmjTQpR5HJnej4fyl+PO7+4it+lh8j+bzuKw=; b=OcxmAeBLs6ziu8Ea2BH8fTkyigkVKlAFdIbTN9SqCK9DsSBbVLF4CbCy3K3IuYdnzTiYSv 89XycdRsm3C1mBivRhuhZxzdB+9N5wNidgtUl+25GtlPeX7eb7UQZfyjCZ9ukeuWkJSvIe JmL911GrGGzyoCktZ7cOHGkE1//mR8AIRWgNufCsV3IGj9qX/zbQ5UKUu/VefYlewPrf8y UjzZjhM9fwtKh8ONs1/ymZBck8ywS7nIkH0vPXuQa/ojY2nzgvkyuvY2xX046qR8vOJhZS M9iowUhpFtRk172k81Ol5WqjAOFOlyewslC+QsQtYbzV5l/x3oK/HnDid0qQag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474776; a=rsa-sha256; cv=none; b=q7rE22BSRVcZZKuCk0vYyMlIIAXQnF+Fb4jVSQXbRVzDkWMumASnWPh5lul5P/+IDV6Yb7 8PGEROXOB1KmGov1i0G0uES9PrkMBJxRwTUJs0kES725LvKB7lNlQ41qqUFsk+Xs6MpbKi 2anXwdpEGETpO+bt1VR3WRU/50Jz/mkH/Jzqk35Wg4lM2SpHMeH1X8iXerB7FHOs18boWP l9wu2bMtHK5rshpxigSigBmE0nlptJ/IZXjOV4IhS0vIW/U5P6j1qYhABHZy6zK+E1pW5z e9UKxH7eJTDo/t8Qs6u/AWYN1Nnj8qjhRX1QC+ypkdSmALgcKInxtR7h6o8A/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474776; 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=YJo2A/ABmjTQpR5HJnej4fyl+PO7+4it+lh8j+bzuKw=; b=ezHQzRG8nGY4rY/EN1qct4CNxmvJtZCdWi0qTQTvBpMwvFTtNspr8b99GbuNtPsB3VtZtP 7xQJ06+a5QEIYqK1kAyvJz4perzhaUv2s4FL7c/mNnqxZdIS/C1YdxQiVVwzeGjkCkRNVM cNiKJFXR7bcOEhegAQ8dCUtNQ8b4Njsxv/rTnhLH0XOV1XyNeZxtQZ+fHWFEoEr+jxclJG uDCovZcAQdu7F5Y4HzzrJ2hwz4NaDfMiSgDA6qi1KY0J3QbUmojpnMqM1Kq7O6McI0OymV ONv5nAVucnQxCqvzh0bfolHThJ7DIfqIfRbEXyQCrvtnvM6yFjyoP7Hcf2tHFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJS5KlMz3Km for ; Sat, 18 Apr 2026 01:12:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 466c6 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 524df650a92f - main - LinuxKPI: conditionally add __flex_counter() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 524df650a92f648e19ba27d6727bdc79c8efdbbb Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:56 +0000 Message-Id: <69e2da98.466c6.18a2eb93@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=524df650a92f648e19ba27d6727bdc79c8efdbbb commit 524df650a92f648e19ba27d6727bdc79c8efdbbb Author: Bjoern A. Zeeb AuthorDate: 2026-04-14 15:06:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:12 +0000 LinuxKPI: conditionally add __flex_counter() __flex_counter() is used by overflow.h and needed for "flex allocations". It is either a void * typed 0 (NULL) (like this for _Generic checks), or uses __builtin_counted_by_ref. The latter was added to gcc and llvm fairly recently and while for gcc the __has_builtin() check suffices, clang had parts broken until recently so needs an extra check for the next major version. The fixed hash is currently not part of any tag to use, so we play it save (and hope 23 will have it). It will be a while until we will see the builting to be used but at least we will be prepared for it. See inline comments for the commit hashes and versions which added the feature. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D56393 --- sys/compat/linuxkpi/common/include/linux/compiler_types.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/compiler_types.h b/sys/compat/linuxkpi/common/include/linux/compiler_types.h index 7151c03de690..25e69f5afd8e 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler_types.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler_types.h @@ -42,4 +42,17 @@ #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) +/* + * __builtin_counted_by_ref was introduced to + * - gcc in e7380688fa59 with a first release tag of gcc-15.1.0, + * - llvm in 7475156d49406 with a first release tag of llvmorg-20.1.0-rc1 + * but cannot be used before 23 (22.x.y possibly) (see 09a3d830a888). + */ +#if (__has_builtin(__builtin_counted_by_ref)) && \ + (!defined(__clang__) || (__clang_major__ >= 23)) +#define __flex_counter(_field) __builtin_counted_by_ref(_field) +#else +#define __flex_counter(_field) ((void *)NULL) +#endif + #endif From nobody Sat Apr 18 01:12:55 2026 X-Original-To: dev-commits-src-main@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 4fyDJS0R0Xz6ZTcp for ; Sat, 18 Apr 2026 01:12:56 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJR5FGtz3nbP for ; Sat, 18 Apr 2026 01:12:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474775; 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=RxF5f4hp8tEPSxnNHvroRsM39qI+TiqmFCDVXxfRA1I=; b=Lr83TnuXxt9jml94sROKRQTe0gsu76oPcSGpAfufcc/ywpxrNVF6Lje4y1CzMdZRacLOyu IADqsueB1jYbwhstCUeJpbn0fFFMB89KyMgnSmmLJ9/WrnApOZXZSjjOpZGmAINEJutdM7 vhb/i7V8Bpl5dLeseX83EJhpy+7BLCIu7E2QbL+C6DzARoUmHYVSC3TE2lNxEG+sf9JQx8 t44kw/FMqNJni7Trs4afuWGG2r6Dg/1qB844XmOWXDfK23aIiIwkpbWzrA5Sv5RiCvmdhB dY/wAo2zr8oSrX3K7bYGEYgSl3wuZSBYO0aNW3FFAR1uHjvOlCFJNaJg3ERDmw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474775; a=rsa-sha256; cv=none; b=Ag+QVf2SVoe/m7r0QuIFURg1eMeIE95gscmk+x3Tdf7e0/Z0eqy8JJOXTX00POjg/yYUJI CvBgUqLluEx5DcTjrngA79hwfdLqHGFOOxMJpVX083WOVFsIb6odsm4lFITB2o6eBNPx0B ictluQ3N+QftgyBgQgmPBMFbejB/i8ytEw+e+9sxa9xucOW+sALPJ0XrZ5+Y3L1NXKPch6 ySwvjNl7KWHXXQspAG16d4dQA0rvKR3sNtceFoWNcvJj4jE/8nJwLk5WHxa6mjlceahfWZ zlyOOnQ5BJJ63ACTdcUg2falOdNZeBFrQ5mYQyRmCN8EO4G5Qa4j63vAUQSVPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474775; 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=RxF5f4hp8tEPSxnNHvroRsM39qI+TiqmFCDVXxfRA1I=; b=d/xttDzPZfKZniKNY9fjWukA2L57asPNkqVkRuViIZpObc7Zmj0e63BrdOAv3jJOhWShh2 iY2VLf0EN6+WvWxISN+pl2fqUn3H1XfnDP/V1L1BznR2+6TfGH4w3TfUGnzt9i4/pn2aza DieqXYJujrffJRtpojmuPhFzo75H4On8U6g0sYOHIYockTJeYvmMcO2HCYZ+ufkYo/Zr+E CWGcxXKplR4OPRdnGql4ZZXqoz5KpZMg643MvUJQrYaPzhDetUVWf7xSG8rXos1TGlYHKo SMDiJwgMqYsPcWq0bhBZ46r+cjoHLMMk2I4CV+Bu7yNbSIs2WGJNX2O92hJqIg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJR4bpkz3Kl for ; Sat, 18 Apr 2026 01:12:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 464b3 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 35b90c21f480 - main - LinuxKPI: add default_gfp() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 35b90c21f48056e85b70dbbe2209b6c3a4927315 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:55 +0000 Message-Id: <69e2da97.464b3.4632ebe1@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=35b90c21f48056e85b70dbbe2209b6c3a4927315 commit 35b90c21f48056e85b70dbbe2209b6c3a4927315 Author: Bjoern A. Zeeb AuthorDate: 2026-04-14 13:40:24 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:12 +0000 LinuxKPI: add default_gfp() Various new allocation macros can take an optional gfp_t argument. If the argument is not given we need to set the GFP_KERNEL default. While this is only internally used and I initialy called it differently, should this spread elsewhere having the same name as in Linux will be good. Sponsored by: The FreeBSD Foundaton MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D56392 --- sys/compat/linuxkpi/common/include/linux/gfp.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/gfp.h b/sys/compat/linuxkpi/common/include/linux/gfp.h index 7a32e7862338..af7cdb422fcb 100644 --- a/sys/compat/linuxkpi/common/include/linux/gfp.h +++ b/sys/compat/linuxkpi/common/include/linux/gfp.h @@ -80,6 +80,9 @@ CTASSERT((__GFP_DMA32 & GFP_NATIVE_MASK) == 0); CTASSERT((__GFP_BITS_MASK & GFP_NATIVE_MASK) == GFP_NATIVE_MASK); +#define __default_gfp(_discard, _arg_or_default, ...) _arg_or_default +#define default_gfp(...) __default_gfp(, ##__VA_ARGS__, GFP_KERNEL) + struct page_frag_cache { void *va; int pagecnt_bias; From nobody Sat Apr 18 01:12:57 2026 X-Original-To: dev-commits-src-main@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 4fyDJV3zx3z6ZTf9 for ; Sat, 18 Apr 2026 01:12:58 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJT6PXbz3nY4 for ; Sat, 18 Apr 2026 01:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474777; 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=HYnZKJ+GfAQsolz88YAT9Tx5yI0EXaP61CgRNQzAIGM=; b=Fabz4on/sF/XL8pRKiHqxH1h2K6udxltvPu/iQVAA3UBY6/WIKVHbxdw9eSYc6kSwwACnU b/nAUUjFCKpUSimSuKPt3Z1Sv/dMN2G8vSEgNHAMqy7+r29x7tHbPuC8x+suWcyxAknrdv mJWtAbKgaAhgYGV57HaXmnOVS9zKBFrrqWhLkkZbX9VqZyyClp1W2/xGHW0qoNWLoQZC3Z 45HSW+Ltl4Qnhku7YL5S3MHayye2tVLyXgmpdMQlSXbC49tzzmfgMc2Gqz/qq15sSdTY7M uR4XWpobLs/Af/0UHEtTVDKmDskkDeSQzDIv6TVgg4QlP2wy2Ww5LKXAuC/zhw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474777; a=rsa-sha256; cv=none; b=dODRAb91W9U4seAeb2gGyETbSym67RS53/EOmTRFji5G0ZkJUm2dAx0F7JcdmAjD5BCvHF Al/eRzch6r2yr4cZ8a0d79WOaWR8TE8eO3OaHBEB801KMbNFW0uxWyLnOu9E4xOgVz03GB Zark5pyuj1y2hZ3PpesYQrwk3VA961bWWsC2A309y3DDV8c7yFyNROpAVvgIzeUIOF+Ea3 +FNl5hCyotbrRojTcUkuEe6PykKmFHRIjzem3nBoFNhuHUpc7yVTg9eAyuGty5UVOUPTJR QI9NV/i/6eEblIbNwSwPRFP6hSe+RtOpbg9+ZyzgpL29geRlrTEH74yMIGHNUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474777; 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=HYnZKJ+GfAQsolz88YAT9Tx5yI0EXaP61CgRNQzAIGM=; b=jjoq+89ff9lkfVB3iIWZ1E+J1XpjmaJApOFYIA9wXJcE7AW8lv3vhA6OLd7aKBEFKrqa1S +N3YRPazAdyq8/kI5Fvx38lHGcdu8DX5xHEhIgFmVrhGbns+pba9FE8z9OfqoR/ilo6E0F 36RQyoemMvAqNjkXDAIncidVCxqh9Cbq2Dk5aMwycGMAdHJOHdaawAmb0DwvK4olEVG3x+ LbLbHf9WHKYT5NNeepbdZ7hrT+uoa/SlCcxKx5ceXmM8OajBZ8pJOg8uRjytrshFcVza5b o8e58KLMr7YiJCkg8KIuF8quonv1+P2p0tj3QwQw+MzkjjR9FoTGwIF5DGeitw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJT5z88z33F for ; Sat, 18 Apr 2026 01:12:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 444e2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: d2c85255d4fc - main - LinuxKPI: sync overflow.h from Linux v7.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d2c85255d4fca37ec9774f85f867f8fc89a51269 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:57 +0000 Message-Id: <69e2da99.444e2.4a2fdbfd@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d2c85255d4fca37ec9774f85f867f8fc89a51269 commit d2c85255d4fca37ec9774f85f867f8fc89a51269 Author: Bjoern A. Zeeb AuthorDate: 2026-04-14 13:50:44 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:13 +0000 LinuxKPI: sync overflow.h from Linux v7.0 overflow.h was imported directly from Linux in 3208d4ad2b8320a. Update the file to the newer version as needed for v7.0 driver updates. Sponsored by: The FreeBSD Foundation MFC after: 3 days Obtained from: git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 028ef9c96e96197026887c0f092424679298aae8 (tag: v7.0) Reviewed by: emaste, dumbbell Differential Revision: https://reviews.freebsd.org/D56394 --- .../linuxkpi/common/include/linux/overflow.h | 144 +++++++++++++++++++-- 1 file changed, 130 insertions(+), 14 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/overflow.h b/sys/compat/linuxkpi/common/include/linux/overflow.h index e811037b8ecc..4326f05e6d07 100644 --- a/sys/compat/linuxkpi/common/include/linux/overflow.h +++ b/sys/compat/linuxkpi/common/include/linux/overflow.h @@ -4,9 +4,7 @@ #include #include -#ifdef __linux__ #include -#endif /* * We need to compute the minimum and maximum values representable in a given @@ -38,19 +36,13 @@ #define __type_min(T) ((T)((T)-type_max(T)-(T)1)) #define type_min(t) __type_min(typeof(t)) -/* - * Avoids triggering -Wtype-limits compilation warning, - * while using unsigned data types to check a < 0. - */ -#define is_non_negative(a) ((a) > 0 || (a) == 0) -#define is_negative(a) (!(is_non_negative(a))) /* * Allows for effectively applying __must_check to a macro so we can have * both the type-agnostic benefits of the macros while also being able to * enforce that the return value is, in fact, checked. */ -static inline bool __must_check __must_check_overflow(bool overflow) +static __always_inline bool __must_check __must_check_overflow(bool overflow) { return unlikely(overflow); } @@ -203,9 +195,9 @@ static inline bool __must_check __must_check_overflow(bool overflow) typeof(d) _d = d; \ unsigned long long _a_full = _a; \ unsigned int _to_shift = \ - is_non_negative(_s) && _s < 8 * sizeof(*d) ? _s : 0; \ + _s >= 0 && _s < 8 * sizeof(*d) ? _s : 0; \ *_d = (_a_full << _to_shift); \ - (_to_shift != _s || is_negative(*_d) || is_negative(_a) || \ + (_to_shift != _s || *_d < 0 || _a < 0 || \ (*_d >> _to_shift) != _a); \ })) @@ -240,6 +232,76 @@ static inline bool __must_check __must_check_overflow(bool overflow) __overflows_type_constexpr(n, T), \ __overflows_type(n, T)) +/** + * range_overflows() - Check if a range is out of bounds + * @start: Start of the range. + * @size: Size of the range. + * @max: Exclusive upper boundary. + * + * A strict check to determine if the range [@start, @start + @size) is + * invalid with respect to the allowable range [0, @max). Any range + * starting at or beyond @max is considered an overflow, even if @size is 0. + * + * Returns: true if the range is out of bounds. + */ +#define range_overflows(start, size, max) ({ \ + typeof(start) start__ = (start); \ + typeof(size) size__ = (size); \ + typeof(max) max__ = (max); \ + (void)(&start__ == &size__); \ + (void)(&start__ == &max__); \ + start__ >= max__ || size__ > max__ - start__; \ +}) + +/** + * range_overflows_t() - Check if a range is out of bounds + * @type: Data type to use. + * @start: Start of the range. + * @size: Size of the range. + * @max: Exclusive upper boundary. + * + * Same as range_overflows() but forcing the parameters to @type. + * + * Returns: true if the range is out of bounds. + */ +#define range_overflows_t(type, start, size, max) \ + range_overflows((type)(start), (type)(size), (type)(max)) + +/** + * range_end_overflows() - Check if a range's endpoint is out of bounds + * @start: Start of the range. + * @size: Size of the range. + * @max: Exclusive upper boundary. + * + * Checks only if the endpoint of a range (@start + @size) exceeds @max. + * Unlike range_overflows(), a zero-sized range at the boundary (@start == @max) + * is not considered an overflow. Useful for iterator-style checks. + * + * Returns: true if the endpoint exceeds the boundary. + */ +#define range_end_overflows(start, size, max) ({ \ + typeof(start) start__ = (start); \ + typeof(size) size__ = (size); \ + typeof(max) max__ = (max); \ + (void)(&start__ == &size__); \ + (void)(&start__ == &max__); \ + start__ > max__ || size__ > max__ - start__; \ +}) + +/** + * range_end_overflows_t() - Check if a range's endpoint is out of bounds + * @type: Data type to use. + * @start: Start of the range. + * @size: Size of the range. + * @max: Exclusive upper boundary. + * + * Same as range_end_overflows() but forcing the parameters to @type. + * + * Returns: true if the endpoint exceeds the boundary. + */ +#define range_end_overflows_t(type, start, size, max) \ + range_end_overflows((type)(start), (type)(size), (type)(max)) + /** * castable_to_type - like __same_type(), but also allows for casted literals * @@ -265,7 +327,7 @@ static inline bool __must_check __must_check_overflow(bool overflow) * with any overflow causing the return value to be SIZE_MAX. The * lvalue must be size_t to avoid implicit type conversion. */ -static inline size_t __must_check size_mul(size_t factor1, size_t factor2) +static __always_inline size_t __must_check size_mul(size_t factor1, size_t factor2) { size_t bytes; @@ -284,7 +346,7 @@ static inline size_t __must_check size_mul(size_t factor1, size_t factor2) * with any overflow causing the return value to be SIZE_MAX. The * lvalue must be size_t to avoid implicit type conversion. */ -static inline size_t __must_check size_add(size_t addend1, size_t addend2) +static __always_inline size_t __must_check size_add(size_t addend1, size_t addend2) { size_t bytes; @@ -305,7 +367,7 @@ static inline size_t __must_check size_add(size_t addend1, size_t addend2) * argument may be SIZE_MAX (or the result with be forced to SIZE_MAX). * The lvalue must be size_t to avoid implicit type conversion. */ -static inline size_t __must_check size_sub(size_t minuend, size_t subtrahend) +static __always_inline size_t __must_check size_sub(size_t minuend, size_t subtrahend) { size_t bytes; @@ -390,6 +452,18 @@ static inline size_t __must_check size_sub(size_t minuend, size_t subtrahend) #define struct_size_t(type, member, count) \ struct_size((type *)NULL, member, count) +/** + * struct_offset() - Calculate the offset of a member within a struct + * @p: Pointer to the struct + * @member: Name of the member to get the offset of + * + * Calculates the offset of a particular @member of the structure pointed + * to by @p. + * + * Return: number of bytes to the location of @member. + */ +#define struct_offset(p, member) (offsetof(typeof(*(p)), member)) + /** * __DEFINE_FLEX() - helper macro for DEFINE_FLEX() family. * Enables caller macro to pass arbitrary trailing expressions @@ -472,4 +546,46 @@ static inline size_t __must_check size_sub(size_t minuend, size_t subtrahend) (__member_size((name)->array) / sizeof(*(name)->array) + \ __must_be_array((name)->array)) +/** + * typeof_flex_counter() - Return the type of the counter variable of a given + * flexible array member annotated by __counted_by(). + * @FAM: Instance of flexible array member within a given struct. + * + * Returns: "size_t" if no annotation exists. + */ +#define typeof_flex_counter(FAM) \ + typeof(_Generic(__flex_counter(FAM), \ + void *: (size_t)0, \ + default: *__flex_counter(FAM))) + +/** + * overflows_flex_counter_type() - Check if the counter associated with the + * given flexible array member can represent + * a value. + * @TYPE: Type of the struct that contains the @FAM. + * @FAM: Member name of the FAM within @TYPE. + * @COUNT: Value to check against the __counted_by annotated @FAM's counter. + * + * Returns: true if @COUNT can be represented in the @FAM's counter. When + * @FAM is not annotated with __counted_by(), always returns true. + */ +#define overflows_flex_counter_type(TYPE, FAM, COUNT) \ + (overflows_type(COUNT, typeof_flex_counter(((TYPE *)NULL)->FAM))) + +/** + * __set_flex_counter() - Set the counter associated with the given flexible + * array member that has been annoated by __counted_by(). + * @FAM: Instance of flexible array member within a given struct. + * @COUNT: Value to store to the __counted_by annotated @FAM_PTR's counter. + * + * This is a no-op if no annotation exists. Count needs to be checked with + * overflows_flex_counter_type() before using this function. + */ +#define __set_flex_counter(FAM, COUNT) \ +({ \ + *_Generic(__flex_counter(FAM), \ + void *: &(size_t){ 0 }, \ + default: __flex_counter(FAM)) = (COUNT); \ +}) + #endif /* _LINUXKPI_LINUX_OVERFLOW_H */ From nobody Sat Apr 18 01:12:58 2026 X-Original-To: dev-commits-src-main@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 4fyDJW3jrKz6ZTms for ; Sat, 18 Apr 2026 01:12:59 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJV739xz3nhR for ; Sat, 18 Apr 2026 01:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474779; 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=5vGJP/qt6HDF0hmSpkkKjZjj2YHhT2IBX3/QGeGjggE=; b=kX2BIR67Bho2bBUt12YN0gQ1mhCY6vSlZBImlLPXxBxi01bxEDUJr8ClRSNNBYZb9uCXz9 IO0E8QfWd2+nLYZwJsQP8+Zc5UZL20xa8hqD7ritQd3KSMHY0pyUcAkQN1U7HBT/k/dZba 6Y1wVwh+qvTF9gTCUilfk+l0lZhXW37rt3GMwbgZ6kIvquSeYvWHLehY94W6OTMh+x16wM IXuaLL0s/L/40TdFBW9X77xGjttmYtIxMXM/N/gL8JchqBuZFCVuityGGkuM8rNfqbQ8fB VPjdncA3ojZeIormBdaAzyHyDHrp4R7aegABYY3mL0fHT6PA6y28NSDokcJiKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474779; a=rsa-sha256; cv=none; b=LnIK5+7uG7AjnuqIUD+7dvaRcJy388HJ0GT7F0QSyqlO57HFT8nifm8ayyYZN7/uPRn6I7 lFqxel/57Y1XI6z0chMTGmJ3SkxFjGSl7fXZ3vqfvIWw4uLDE1T0awS6zKhWvj+5LUL60I 2n9JrDE9+5vmtJIV0EXGLTHfmfI2E0BWxd0hlg0MCDZoJ1ccqoATRdluc5U8PVHTBySJMZ i5pq20qogo7p8c1va2D06P831GO4axsrH7qX97z7tM2ZEukTgTTjNzl+pFPVjSQMe7SLER D6KZi/QqphYHZcnw9MLSo9EZdh8tsx3Z86WW161s3NHBQ4Psp/27TAY8dQvScA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474779; 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=5vGJP/qt6HDF0hmSpkkKjZjj2YHhT2IBX3/QGeGjggE=; b=a37rMM1C/+Bd75v/ONcjaS+LG+MUtzieyqGw/rSFt6XaPy49sE2BJzqfcaMbWhf9UY7gtv MbMyv3wGQvmBbjyAUod2U5DvF00UExkvarsTPPuE3uPyvaFK4nJLyEaF8WiBncRZ5YCZAq YOjjPxwcx+TLZn7gaI61kd9pw+R8On//3Dh0eg20qpNgHoh3UN8our0EqeUk14yUrX9vdx urregm7voxJoa+SokWY8bIkKASBz2/D+7Ypx1cN3V692NPCVnWXpRbOd3EXK/k5eXnLP+/ 5GqMKbb1DRph1MqlRcvsdKyaWQC2MnpKwsEs2GwuieCsugdgggUEyI/h8aH01w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJV6ZhFz28L for ; Sat, 18 Apr 2026 01:12:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 466ca by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:58 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: c72ac6af0869 - main - LinuxKPI: add kmalloc_obj[s], kzalloc_obj[s], and kzalloc_flex List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c72ac6af086962d236f4712761abacac0c62b48e Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:58 +0000 Message-Id: <69e2da9a.466ca.10abc584@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c72ac6af086962d236f4712761abacac0c62b48e commit c72ac6af086962d236f4712761abacac0c62b48e Author: Bjoern A. Zeeb AuthorDate: 2026-04-14 15:13:18 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:13 +0000 LinuxKPI: add kmalloc_obj[s], kzalloc_obj[s], and kzalloc_flex Drivers in Linux v7.0 seem to have changed to the new allocation macros using a sweep. Add the ones I encountered with wireless drivers so far. They all take an optional argument for a gfp_t, which default_gfp() deals with. The plural version "objs" takes an extra nitems argument in addition to the size. We use size_mul() to possibly detect overflows. The "flex" version uses an extra variable to track the variable sized array allocations and if supported by the compiler will use __builtin_counted_by_ref() to properly track bounds. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D56395 --- sys/compat/linuxkpi/common/include/linux/slab.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h index 0e649e1e3c4a..6c05c77819a5 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -4,7 +4,7 @@ * Copyright (c) 2010 Panasas, Inc. * Copyright (c) 2013-2021 Mellanox Technologies, Ltd. * All rights reserved. - * Copyright (c) 2024-2025 The FreeBSD Foundation + * Copyright (c) 2024-2026 The FreeBSD Foundation * * Portions of this software were developed by Björn Zeeb * under sponsorship from the FreeBSD Foundation. @@ -51,6 +51,22 @@ MALLOC_DECLARE(M_KMALLOC); #define kvcalloc(n, size, flags) kvmalloc_array(n, size, (flags) | __GFP_ZERO) #define kzalloc(size, flags) kmalloc(size, (flags) | __GFP_ZERO) #define kzalloc_node(size, flags, node) kmalloc_node(size, (flags) | __GFP_ZERO, node) +#define kzalloc_obj(_p, ...) \ + kzalloc(sizeof(typeof(_p)), default_gfp(__VA_ARGS__)) +#define kzalloc_objs(_p, _n, ...) \ + kzalloc(size_mul((_n), sizeof(typeof(_p))), default_gfp(__VA_ARGS__)) +#define kzalloc_flex(_p, _field, _n, ...) \ +({ \ + const size_t __n = (_n); \ + const size_t __psize = struct_size_t(typeof(_p), _field, __n); \ + typeof(_p) *__p_obj; \ + \ + __p_obj = kzalloc(__psize, default_gfp(__VA_ARGS__)); \ + if (__p_obj != NULL) \ + __set_flex_counter(__p_obj->_field, __n); \ + \ + __p_obj; \ +}) #define kfree_const(ptr) kfree(ptr) #define kfree_async(ptr) kfree(ptr) /* drm-kmod 5.4 compat */ #define vzalloc(size) __vmalloc(size, GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO, 0) @@ -143,6 +159,12 @@ kmalloc_node(size_t size, gfp_t flags, int node) return (lkpi___kmalloc_node(size, flags, node)); } +#define kmalloc_obj(_p, ...) \ + kmalloc(sizeof(typeof(_p)), default_gfp(__VA_ARGS__)) + +#define kmalloc_objs(_p, _n, ...) \ + kmalloc(size_mul((_n) * sizeof(typeof(_p))), default_gfp(__VA_ARGS__)) + static inline void * krealloc(void *ptr, size_t size, gfp_t flags) { From nobody Sat Apr 18 01:12:59 2026 X-Original-To: dev-commits-src-main@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 4fyDJX3rJCz6ZTkL for ; Sat, 18 Apr 2026 01:13:00 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyDJX0TNrz3nhh for ; Sat, 18 Apr 2026 01:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474780; 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=Rb0wmOyXE6Tr7qSX9lYesomr6dUe970P9m2w9j85EV4=; b=WY5ZZM8t26iOqKsCb+UILUudgCZL3UzZuoTzfo0hfUwnwsQzeyVIOn5Y+U+05khJStfRIC OJQWos5Pj3be2CsbQZ5ucGw2u+Zm5MjEjLPI5fXosQXR1s5vPxoJ9YNduF9Js0SaZDWXnv Qt8Pk2n2Jfq526w9qRRngi6xFKmsnyUxY4Jb+qiYfWp9pE3dEKCyugdfQdgBgaaxi42mrR h4qMe2XnHwHuU903B3oGTTOlyR69Un0cFv/dwfhaB361a/x5uU6EhVRp87UgMkT4xiIH5g kZ6cL4igtca86PTRc/jGqY+icx1eiJcONX4Aelof/iCxghoI3yKMFS2clQjjMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776474780; a=rsa-sha256; cv=none; b=otooVw59Us1/xzcYjVi40Q+19HB40maMs1epmTgyfiwxvrBxUqaovphh7/MOEpkdKs/77B 1o4WZaJeBMdPaL033bQ07GnqCrxsVy/2bjhdKS3OlCG+NfYE6jBga7mXYU9KG397403D2W Dl/R2IiZPvjdLqY+iD8Ii9kOuvT0mpB8TU3qMjDtOxRHvea2AEeGORhnQX3tMra92IDZmF EMGS6bMmHRZPG1gkMkBqkt0jHryDmmJb8wFB660IFhp69xdAozWqOxqhfBFHvE66lS+Qv+ cP11pDsOsC0tMwibSv4tCG8H8Ze9cNRBWlcJd0xn32aakS+AumNRJ/vRiBcLuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776474780; 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=Rb0wmOyXE6Tr7qSX9lYesomr6dUe970P9m2w9j85EV4=; b=OmIL2gWib0BJRVNHZMxukue2O9ymp2IOKGs2Y+4sb3t8dV/DgES098n5hfEYk92DevHpyw Lu6DGX0LfNsCia97dFIB42rm/DRbmRN9UWhb/9kUsSGpMhuS2XyPWZri/dWgWTDZWGhVxQ bkYEEwP7lqQCqB47+LyggmJiWss+Si1ax7PY89bsuOJdIjqS4gt1QjRVn5uMRm+Dy1ksTu pny+fFMMWQL4xv4dtiKPVv/UTDlyyMUHD6BlQGt2z7ZBnL3NuKjw/e8bG5PxbauKoqLQA4 MwaL/4Wtjc9tbJ/esCKxcpHfWTsh0yDYaw4sFqQUCLBM3mM++LkmNDBBsjQwog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyDJX00PRz32Z for ; Sat, 18 Apr 2026 01:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46b1e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 01:12:59 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: f1834d03af61 - main - LinuxKPI: implement devm_kmemdup_array() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1834d03af617a93993056bb902082452673f89f Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 01:12:59 +0000 Message-Id: <69e2da9b.46b1e.a20b388@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f1834d03af617a93993056bb902082452673f89f commit f1834d03af617a93993056bb902082452673f89f Author: Bjoern A. Zeeb AuthorDate: 2026-04-14 13:35:36 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 01:12:14 +0000 LinuxKPI: implement devm_kmemdup_array() Implement devm_kmemdup_array() using devm_kmemdup() in order to prepare for Linux v7.0 based drivers. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dumbbell Differential Revision: https://reviews.freebsd.org/D56396 --- sys/compat/linuxkpi/common/include/linux/device.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index 8834f1799e61..030e9b127540 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -701,6 +701,13 @@ devm_kmemdup(struct device *dev, const void *src, size_t len, gfp_t gfp) return (dst); } +static inline void * +devm_kmemdup_array(struct device *dev, const void *src, size_t n, size_t len, + gfp_t gfp) +{ + return (devm_kmemdup(dev, src, size_mul(n, len), gfp)); +} + #define devm_kzalloc(_dev, _size, _gfp) \ devm_kmalloc((_dev), (_size), (_gfp) | __GFP_ZERO) From nobody Sat Apr 18 02:42:57 2026 X-Original-To: dev-commits-src-main@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 4fyGJK2585z6Zcp4 for ; Sat, 18 Apr 2026 02:42:57 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyGJK1qbCz498m for ; Sat, 18 Apr 2026 02:42:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776480177; 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=XDgP+RcWkJcn4zQWzen7C9rcvRnGFFbjuZg9rE5HIlA=; b=WLj260uvBga6SVmO9P64cK8eByTDB6hNjjR8cq61TkVw/+J0ndl9cbd7Lc0E3a/PCov+XF a2qsPj2zAGVRbXd9/QRZmMxNYfC+UExkXkhmpCbwTy9yqQqT431CM8zCWQmDVGUUwfMSWY gz5Ov7DHz/LcquntQ+x6katWLYKa7NcLWg/Rcgfu5eed+rKjEXV15+mPga53myMqZyWmwy RmOxHPiB/0+xaKIEK4wdxee5LWxsbfCX657b2h3qALS/Go2u44j9zMRj5UNIQqjGjjJF6n OogLTerQ1N+8/76d1cdWJEDGxzctF4sg5MOGPyMxVkeVOHRbBGeXsCrdWlYqFg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776480177; a=rsa-sha256; cv=none; b=mMSdUiS/iOkuq3qp7M30CXi8+HsKeNM0mpeV0/nsEKIFakQFxVZ1JwFXksLcBtq18Cg8Va hgT6sHPUKJ7RJBDrhHCv2JNylw7oGbjNt6W6tF3uH5bZrvt0BV7DOuOQYTY4mhl7XxWrAa ZBH2c4K/bBlrJ3HAvXW4NDDBBjVB8MW/W7SmE9dSDeb+k1wwAmPMXsBgb1N+dweN1Igba2 drATP6q9pS/Iy3bXxofC2mfgG70BrNga6R+dmDeR/pUNf9vW4jhjZkohpxn7brTNkcC7yl oerwR3QL17wxMm/ra00Axs76fdTuxdYfMh4WPn/0uwYWdeK+U1Cozh6hu2USDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776480177; 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=XDgP+RcWkJcn4zQWzen7C9rcvRnGFFbjuZg9rE5HIlA=; b=Ywds/6HzkOMJ/DLR4rqRy2Q8PdoBTDhefHZkeYTrzpK4SV04KINiNJMVmehjpHWWtE1e5/ vxl+KSEjuKRvpH4ooU2bbCZreUHmto+dUdJO57LJLenrEpEBHuTPl20nCD9IvTstweSwni GV1BCJ20zWhgaia7lO/nIsop5n0e6Z9cX10twhmD+16A2Ms6i1fpYCWkVRYBpevWKq4D8S uWvW3trpxSs9W7eyalTUhluECGhYgSLe1X0DH449qhK50bg/0EN2k5bKi7N05Q1GZ78Lrz cszZTE3ClmgfwxrwSc7De6nMR+XUwqmUdLT3x5aDcntWkATtoS0U9eS/BgqcpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyGJK1QNKz5Q8 for ; Sat, 18 Apr 2026 02:42:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 21b3b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 02:42:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 4ed20e0236dd - main - kshim/usb: Add build option. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4ed20e0236dd0ce64aa4d79659288a56e1b1344b Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 02:42:57 +0000 Message-Id: <69e2efb1.21b3b.32f0016@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4ed20e0236dd0ce64aa4d79659288a56e1b1344b commit 4ed20e0236dd0ce64aa4d79659288a56e1b1344b Author: Warner Losh AuthorDate: 2026-04-18 02:41:26 +0000 Commit: Warner Losh CommitDate: 2026-04-18 02:41:43 +0000 kshim/usb: Add build option. Add WITH{,OUT}_LOADER_USB to build the kshim usb library. Nothing in-tree uses it, but this will make it easier to keep building. Updated src.conf.5 with a few extra changes... Sponsored by: Netflix --- share/man/man5/src.conf.5 | 445 +++++++++++++++++++++++++++++++++++- share/mk/src.opts.mk | 3 +- stand/Makefile | 1 + tools/build/options/WITH_LOADER_USB | 2 + 4 files changed, 443 insertions(+), 8 deletions(-) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index 65fbcf2e69a4..79f75d87e3d5 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,5 +1,5 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. -.Dd April 10, 2026 +.Dd April 17, 2026 .Dt SRC.CONF 5 .Os .Sh NAME @@ -121,6 +121,8 @@ When set, it enforces these options: .Pp .Bl -item -compact .It +.Va WITH_CASPER +.It .Va WITH_LLVM_BINUTILS .El .It Va WITHOUT_ASSERT_DEBUG @@ -178,6 +180,13 @@ everybody impossible. See also .Va WITH_LOADER_PXEBOOT for other considerations. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El +.Pp When set, these options are also in effect: .Pp .Bl -inset -compact @@ -211,6 +220,12 @@ and .Xr bhyvectl 8 . .Pp This option only affects amd64/amd64. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_BIND_NOW Build all binaries with the .Dv DF_BIND_NOW @@ -223,6 +238,12 @@ and options provide "full" Relocation Read-Only (RELRO) support. With full RELRO the entire GOT is made read-only after performing relocation at startup, avoiding GOT overwrite attacks. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_BLACKLIST This option has been renamed to .Va WITHOUT_BLOCKLIST . @@ -306,6 +327,12 @@ Build with branch protection enabled. On arm64 enable the use of pointer authentication and branch target identification instructions on arm64. These can be used to help mitigate some exploit techniques. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_BSDINSTALL Do not build .Xr bsdinstall 8 , @@ -369,6 +396,12 @@ CCACHE_BASEDIR='${SRCTOP:H}' MAKEOBJDIRPREFIX='${SRCTOP:H}/obj' See .Xr ccache 1 for more configuration options. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_CCD Do not build .Xr geom_ccd 4 @@ -436,8 +469,20 @@ enabled unless an alternate compiler is provided via XCC. .It Va WITH_CLANG_EXTRAS Build additional clang and llvm tools, such as bugpoint and clang-format. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_CLANG_FORMAT Build clang-format. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_CLANG_FULL Avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. @@ -446,6 +491,13 @@ Clean before building world and/or kernel. Note that recording a new epoch in .Pa .clean_build_epoch in the root of the source tree will also force a clean world build. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El +.Pp When set, these options are also in effect: .Pp .Bl -inset -compact @@ -527,6 +579,12 @@ is set explicitly) Compile with CTF (Compact C Type Format) data. CTF data encapsulates a reduced form of debugging information similar to DWARF and the venerable stabs and is required for DTrace. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_CUSE Do not build CUSE-related programs and libraries. .It Va WITHOUT_CXGBETOOL @@ -541,6 +599,12 @@ Build .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and powerpc/powerpc64le. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_DEBUG_FILES Avoid building or installing standalone debug files for each executable binary and shared library. @@ -552,6 +616,12 @@ build options, but may cause the build to inexplicably fail or produce non-functioning binaries. .It Va WITH_DETECT_TZ_CHANGES Make the time handling code detect changes to the timezone files. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_DIALOG Do build .Xr dialog 1 , @@ -559,6 +629,12 @@ Do build .Xr dpv 1 , and .Xr dpv 3 . +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_DICT Do not build the Webster dictionary files. .It Va WITH_DIRDEPS_BUILD @@ -608,6 +684,8 @@ When set, it enforces these options: .Pp .Bl -item -compact .It +.Va WITH_CASPER +.It .Va WITH_INSTALL_AS_USER .El .Pp @@ -649,6 +727,12 @@ Cache result of dirdeps.mk which can save significant time for subsequent builds. Depends on .Va WITH_DIRDEPS_BUILD . +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , @@ -661,6 +745,12 @@ Build and .Xr mkimg 1 as bootstrap tools. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_DMAGENT Do not build dma Mail Transport Agent. .It Va WITHOUT_DOCCOMPRESS @@ -679,11 +769,23 @@ Compile userspace DTrace code (libdtrace, dtrace(1), lockstat(1), plockstat(1)) with address and undefined behavior sanitizers. Requires that Clang be used as the base system compiler and that the runtime support library is available. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_DTRACE_TESTS Build and install the DTrace test suite in .Pa /usr/tests/cddl/usr.sbin/dtrace . This test suite is considered experimental on architectures other than amd64/amd64 and running it may cause system instability. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_DYNAMICROOT Set this if you do not want to link .Pa /bin @@ -711,6 +813,12 @@ and .Pp This is a default setting on amd64/amd64, arm/armv7, arm64/aarch64 and riscv/riscv64. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_ELFTOOLCHAIN_BOOTSTRAP Do not build ELF Tool Chain tools (addr2line, nm, size, strings and strip) @@ -733,6 +841,12 @@ This includes the device tree compiler (dtc) and libfdt support library. .Pp This is a default setting on arm/armv7, arm64/aarch64, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_FILE Do not build .Xr file 1 @@ -775,6 +889,12 @@ Do not build and related utilities. .It Va WITH_HESIOD Build Hesiod support. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_HTML Do not build HTML docs. .It Va WITHOUT_HYPERV @@ -787,6 +907,12 @@ Build or install HyperV utilities. .Pp This is a default setting on amd64/amd64, arm64/aarch64 and i386/i386. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_ICONV Do not build iconv as part of libc. .It Va WITHOUT_INCLUDES @@ -837,12 +963,24 @@ command. The user still must set the .Va DESTDIR variable to point to a directory where the user has write permissions. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_IPFILTER Do not build IP Filter package. .It Va WITH_IPFILTER_IPFS Enable building the .Xr ipfs 8 tool to save and restore IPFilter state tables. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_IPFW Do not build IPFW tools. .It Va WITHOUT_IPSEC_SUPPORT @@ -896,9 +1034,21 @@ Usually this will be added to the kernel config file with: makeoptions WITH_KERNEL_BIN=1 though it can also be used on the command line. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_KERNEL_RETPOLINE Enable the "retpoline" mitigation for CVE-2017-5715 in the kernel build. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_KERNEL_SYMBOLS Do not install standalone kernel debug symbol files. This option has no effect at build time. @@ -955,6 +1105,12 @@ runtime linker. .Pp This is a default setting on amd64/amd64, arm64/aarch64 and powerpc/powerpc64. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_LLD Do not build LLVM's lld linker. .It Va WITHOUT_LLDB @@ -967,6 +1123,12 @@ Build the LLDB debugger. .Pp This is a default setting on amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc64 and powerpc/powerpc64le. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_LLD_BOOTSTRAP Do not build the LLD linker during the bootstrap phase of the build. @@ -1010,6 +1172,12 @@ tool. .It Va WITH_LLVM_FULL_DEBUGINFO Generate full debug information for LLVM libraries and tools, which uses more disk space and build resources, but allows for easier debugging. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_LLVM_LINK_STATIC_LIBRARIES Link LLVM libraries (libllvm, libclang, liblldb) statically into each of the binaries that use them. @@ -1017,6 +1185,12 @@ the binaries that use them. This means that binaries linked against these libraries, such as clang, ld.lld and lldb will be much larger and position dependent, but will start more quickly. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_LLVM_TARGET_AARCH64 Do not build LLVM target support for AArch64. The @@ -1055,11 +1229,23 @@ Build LLVM target support for BPF. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_LLVM_TARGET_MIPS Build LLVM target support for MIPS. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_LLVM_TARGET_POWERPC Do not build LLVM target support for PowerPC. The @@ -1082,16 +1268,28 @@ boot loader. Enable building .Xr loader 8 with support for verification based on certificates obtained from UEFI. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_LOADER_GELI Disable inclusion of GELI crypto support in the boot chain binaries. .Pp This is a default setting on -powerpc/powerpc64 and powerpc/powerpc64le. +powerpc/powerpc64. .It Va WITH_LOADER_GELI Build GELI bootloader support. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. +amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc64le and riscv/riscv64. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_LOADER_IA32 Do not build the 32-bit UEFI loader. .Pp @@ -1102,26 +1300,44 @@ Build the 32-bit UEFI loader. .Pp This is a default setting on amd64/amd64. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_LOADER_KBOOT Do not build kboot, a linuxboot environment loader .Pp This is a default setting on -arm/armv7, i386/i386, powerpc/powerpc64le and riscv/riscv64. +arm/armv7, i386/i386 and riscv/riscv64. .It Va WITH_LOADER_KBOOT Build kboot, a linuxboot environment loader .Pp This is a default setting on -amd64/amd64, arm64/aarch64 and powerpc/powerpc64. +amd64/amd64, arm64/aarch64, powerpc/powerpc64 and powerpc/powerpc64le. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_LOADER_LUA Do not build LUA bindings for the boot loader. .Pp This is a default setting on -powerpc/powerpc64 and powerpc/powerpc64le. +powerpc/powerpc64. .It Va WITH_LOADER_LUA Build LUA bindings for the boot loader. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. +amd64/amd64, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc64le and riscv/riscv64. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_LOADER_OFW Disable building of openfirmware bootloader components. .Pp @@ -1132,6 +1348,12 @@ Build openfirmware bootloader components. .Pp This is a default setting on powerpc/powerpc64 and powerpc/powerpc64le. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_LOADER_PXEBOOT Do not build pxeboot on i386/amd64. When the pxeboot is too large, or unneeded, it may be disabled with this option. @@ -1153,10 +1375,31 @@ Build ubldr. .Pp This is a default setting on arm/armv7 and powerpc/powerpc64. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El +.It Va WITH_LOADER_USB +Build the usb/kshim library + +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_LOADER_VERBOSE Build with extra verbose debugging in the loader. May explode already nearly too large loader over the limit. Use with care. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_LOADER_VERIEXEC Enable building .Xr loader 8 @@ -1166,6 +1409,13 @@ Depends on .Va WITH_BEARSSL . May require a larger .Va LOADERSIZE . +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El +.Pp When set, these options are also in effect: .Pp .Bl -inset -compact @@ -1186,6 +1436,12 @@ The kernel has to be built with a module to parse the manifest. .Pp Depends on .Va WITH_LOADER_VERIEXEC . +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_LOADER_VERIEXEC_VECTX Enable building .Xr loader 8 @@ -1194,6 +1450,12 @@ of loading. .Pp Depends on .Va WITH_LOADER_VERIEXEC . +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_LOADER_ZFS Do not build ZFS file system boot loader support. .It Va WITHOUT_LOCALES @@ -1252,6 +1514,12 @@ The run-time options and .Dv opt.junk also default to false. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_MAN Do not build manual pages. When set, these options are also in effect: @@ -1267,6 +1535,12 @@ Do not install compressed man pages. Only the uncompressed versions will be installed. .It Va WITH_MANSPLITPKG Split man pages into their own packages during make package. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_MAN_UTILS Do not build utilities for manual pages, .Xr apropos 1 , @@ -1289,6 +1563,12 @@ Depends on This default when .Va WITH_DIRDEPS_BUILD is set. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , @@ -1345,6 +1625,12 @@ The build operates as it normally would otherwise. This option originally invoked a different build system but that was renamed to .Va WITH_DIRDEPS_BUILD . +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , @@ -1364,6 +1650,12 @@ Build .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64 and powerpc/powerpc64le. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_NETCAT Do not build .Xr nc 1 @@ -1450,12 +1742,30 @@ InfiniBand software stack, including kernel modules and userspace libraries. .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_OFED_EXTRA Build the non-essential components of the .Dq "OpenFabrics Enterprise Distribution" Infiniband software stack, mostly examples. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_OPENLDAP Enable building LDAP support for kerberos using an openldap client from ports. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_OPENMP Do not build LLVM's OpenMP runtime. .Pp @@ -1466,6 +1776,12 @@ Build LLVM's OpenMP runtime. .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_OPENSSH Do not build OpenSSH. .It Va WITHOUT_OPENSSL @@ -1517,6 +1833,12 @@ Include kernel TLS support in OpenSSL. .Pp This is a default setting on amd64/amd64, arm64/aarch64, powerpc/powerpc64 and powerpc/powerpc64le. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_PAM Do not build PAM library and modules. .Bf -symbolic @@ -1554,6 +1876,12 @@ Position-Independent Executable (PIE). .Pp This is a default setting on amd64/amd64, arm64/aarch64, powerpc/powerpc64, powerpc/powerpc64le and riscv/riscv64. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_PKGBOOTSTRAP Do not build .Xr pkg 7 @@ -1592,6 +1920,12 @@ and support in .Xr ifconfig 8 , by proxy. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_RBOOTD Do not build or install .Xr rbootd 8 . @@ -1606,6 +1940,12 @@ from the kernel, boot loaders, and .Xr uname 1 output, so that builds produce bit-for-bit identical output. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_REPRODUCIBLE_PATHS Modify the paths encoded in binary artifacts to be standard path @@ -1613,12 +1953,24 @@ Normally, the actual path is encoded in the binary. However, this makes the build differ depending on the path it was built from. With this option enabled, the paths recorded are /usr/src, regardless of the actual path. With this option disabled, the actual paths are recorded. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_RESCUE Do not build .Xr rescue 8 . .It Va WITH_RETPOLINE Build the base system with the retpoline speculative execution vulnerability mitigation for CVE-2017-5715. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_ROUTED Do not build .Xr routed 8 @@ -1627,8 +1979,20 @@ utility. Build .Xr rpcbind 8 with warmstart support. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_RUN_TESTS Run tests as part of the build. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_SCTP_SUPPORT Disable support in the kernel for the .Xr sctp 4 @@ -1652,6 +2016,12 @@ legacy docs. .It Va WITH_SORT_THREADS Enable threads in .Xr sort 1 . +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_SOUND Do not build userland sound utilities such as .Xr beep 1 @@ -1693,6 +2063,13 @@ This can be best thought of as auto-install to with some extra meta data to ensure dependencies can be tracked. Depends on .Va WITH_DIRDEPS_BUILD . +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El +.Pp When set, these options are also in effect: .Pp .Bl -inset -compact @@ -1712,10 +2089,28 @@ not .Pa /etc/src.conf . .It Va WITH_STAGING_MAN Enable staging of man pages to stage tree. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_STAGING_PROG Enable staging of PROGs to stage tree. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITH_STALE_STAGED Check staged files are not stale. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_STATS Neither build nor install .Lb libstats @@ -1728,6 +2123,12 @@ support files such as keyboard maps, fonts, and screen output maps. Enable use of sysroot during build. Depends on .Va WITH_DIRDEPS_BUILD . +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , @@ -1857,6 +2258,12 @@ Build the base system with Undefined Behavior Sanitizer (UBSan) to detect various kinds of undefined behavior at runtime. Requires that Clang be used as the base system compiler and that the runtime support library is available +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_UNBOUND Do not build .Xr unbound 8 @@ -1866,6 +2273,12 @@ Link libraries with --undefined-version which permits version maps to contain symbols that are not present in the library. If this is necessary to build a particular configuration, a bug is present and the configuration should be reported. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_UNIFIED_OBJDIR Use the historical object directory format for .Xr build 7 @@ -1915,6 +2328,12 @@ for use by .Pp Depends on .Va WITH_BEARSSL . +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_VI Do not build and install vi, view, ex and related programs. .It Va WITHOUT_VT @@ -1957,6 +2376,12 @@ Build the basesystem with code to zero caller-used register contents on function return. This prevents leaking temporary values for side channel attacks. Additionally this reduces the number of usable ROP gadgets for attackers. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .It Va WITHOUT_ZFS Do not build the ZFS file system kernel module, libraries such as .Xr libbe 3 , @@ -1989,6 +2414,12 @@ This option violates and all other applicable standards, and is known to cause unexpected issues with date/time handling in many applications and programming languages. +When set, it enforces these options: +.Pp +.Bl -item -compact +.It +.Va WITH_CASPER +.El .El .Pp The following options accept a single value from a list of valid values. diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index ab774d44c283..a5fdc4730cd8 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -127,12 +127,12 @@ __DEFAULT_YES_OPTIONS = \ LLVM_COV \ LOADER_BIOS_TEXTONLY \ LOADER_GELI \ + LOADER_IA32 \ LOADER_KBOOT \ LOADER_LUA \ LOADER_OFW \ LOADER_PXEBOOT \ LOADER_UBOOT \ - LOADER_IA32 \ LOCALES \ LOCATE \ LPR \ @@ -208,6 +208,7 @@ __DEFAULT_NO_OPTIONS = \ DTRACE_TESTS \ HESIOD \ IPFILTER_IPFS \ + LOADER_USB \ LOADER_VERBOSE \ LOADER_VERIEXEC_PASS_MANIFEST \ LLVM_FULL_DEBUGINFO \ diff --git a/stand/Makefile b/stand/Makefile index f5ce6ca3db71..752e81ec22a0 100644 --- a/stand/Makefile +++ b/stand/Makefile @@ -39,6 +39,7 @@ INTERP_DEPENDS+= lua S.${MK_EFI}+= efi S.${MK_LOADER_KBOOT}+= kboot S.${MK_LOADER_UBOOT}+= uboot +S.${MK_LOADER_USB}+= usb .if defined(LIB32LIST) LIB32DEPENDS= ${LIB32LIST:S/$/32/} diff --git a/tools/build/options/WITH_LOADER_USB b/tools/build/options/WITH_LOADER_USB new file mode 100644 index 000000000000..be0bcf4c5bbd --- /dev/null +++ b/tools/build/options/WITH_LOADER_USB @@ -0,0 +1,2 @@ +Build the usb/kshim library + From nobody Sat Apr 18 08:22:24 2026 X-Original-To: dev-commits-src-main@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 4fyPr15MlKz6ZDQq for ; Sat, 18 Apr 2026 08:22:25 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyPr02fNNz3npf for ; Sat, 18 Apr 2026 08:22:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776500544; 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=PfVDPVTs1lHkJoCt99eEbZmoGWixmtV6f6B80VL33k4=; b=lu+oYbrx6wSufeYe+Fi8lH26fxw0BBy8I3TJXtAG42PnXenoMNF/jRvcm0OEUMudXZeO0n 5+2t7hZn5sy3DvhmI5ZXyuLy29b3G1dhPutc5itqB65Ob70VtrIJIP8zZvO+JZtV7KcHjT MhqdlTJiTQgYIePAbh/JyfD+YKVgdRWn2PHkehNQSz8UmbKGijl8XjTTKeJ/xQrPmmhXxx /6582Sj9JZPQmHFcBYp7EyIqLe0hJtURhzSvMFAzMq7JrcKuZDuXjhf7DG/iKTkcS2jecg CUOa7Oc6BSt+1Qv3F4ABiAoCgV8WSBKdtBkct99xImKbEHylepgwGa7Asdo3BQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776500544; a=rsa-sha256; cv=none; b=agUVgrK0qxPTWaGdUMLWNR3eJy4KZ64AqYlXw4GYaNlUl90wKoUg73S4+a/TEZVs7Rxm0u evyI5z9i/746kwn3NrFjFr7l8bCEi0G4smSnBbFFl1yE+0n6qk27ruJ9nPkKRvnMXmNTHY 7PVXP9WkkG/rtU+nqplIzQNnYqZH0UXZFmSMvNCtt+3jYpLUVzE2xhcQSlPlMv5cne4srt UHVLiMs2Sc7D0wnfsujbMVxwq9DzsvmC+DKFNqxOe68qvdR68LAXHFbRfjMtn1ebWVCCpK +u9UpZJBW/zAXpfhlPe+bebUcOGYwYDPPX5IaBqrxRpzOXXJbrQL0uoPWmurUQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776500544; 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=PfVDPVTs1lHkJoCt99eEbZmoGWixmtV6f6B80VL33k4=; b=EHJx9NwdgKzJBg0GHXrPjdVRkj2o772JT2TqQkuH3oa0RRVpXYntJgl3tARTUYDjC2/AKY hjRb0knc4PmLZ7HlJfsol2T57osB/Fq8IMjcEHSZ+nue0/oLLVE8JqMgvO36FPoWvD+Pez 2SpgUNP/N+R6H8La9VL+Nz2tifRXk5Jz8P0Cb2JHbX87cCqH0kNq65tWh55aP/eUsFmNcC yRomzWpu5ltQKW7j+8pvH7v5+pOhdztyJDxh8LLSE+adc+iggDoWBxGRY4S3Tsz0Jj31zJ nX91LRmSHLuQ+85OeXkF3Lk3mbEOmIir1JbvbNaptvH9+Idp+4nO6lMcGl6Cpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyPr02Db8zYRS for ; Sat, 18 Apr 2026 08:22:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1cc0b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 08:22:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 8c94a1ea1555 - main - pipe: retire the unused PIPE_LWANT macro List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org 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: 8c94a1ea155586a70369f263a5e01b26a1b37d58 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 08:22:24 +0000 Message-Id: <69e33f40.1cc0b.6aae4240@gitrepo.freebsd.org> The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=8c94a1ea155586a70369f263a5e01b26a1b37d58 commit 8c94a1ea155586a70369f263a5e01b26a1b37d58 Author: Mateusz Guzik AuthorDate: 2026-04-18 08:17:56 +0000 Commit: Mateusz Guzik CommitDate: 2026-04-18 08:17:56 +0000 pipe: retire the unused PIPE_LWANT macro --- sys/sys/pipe.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/sys/pipe.h b/sys/sys/pipe.h index a83ea800c677..bcb19adc3e37 100644 --- a/sys/sys/pipe.h +++ b/sys/sys/pipe.h @@ -88,7 +88,6 @@ struct pipemapping { #define PIPE_SEL 0x040 /* Pipe has a select active. */ #define PIPE_EOF 0x080 /* Pipe is in EOF condition. */ #define PIPE_LOCKFL 0x100 /* Process has exclusive access to pointers/data. */ -#define PIPE_LWANT 0x200 /* Process wants exclusive access to pointers/data. */ #define PIPE_DIRECTW 0x400 /* Pipe direct write active. */ #define PIPE_DIRECTOK 0x800 /* Direct mode ok. */ From nobody Sat Apr 18 08:25:41 2026 X-Original-To: dev-commits-src-main@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 4fyPvp2ppJz6ZDXg for ; Sat, 18 Apr 2026 08:25:42 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyPvp0yJQz3p6G for ; Sat, 18 Apr 2026 08:25:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776500742; 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=WNfiWLL3DEtfRsW56lLT3owCDODtWVxuU7zKw9+u/ng=; b=M1ahFPtv3It8JApbfUTL/MP08o1hlYwS0Wvw4JiqRD41+fQfg5t2OZY/idRTKbCCdS6XST Zyc5dRFTOXzdClyGCAuWgzvKg5AHBeE5mRwL/PcRjbqFOMiizcnPoIKTzzss2F4X/qQCnS 7KXzZpOYh6B4IvBBKoeTau7cSxRNFOICcH/53cC9j1N4WTvvsZ1QPky7mMjRQMfEQI7WQr r1tr8a6NiwR1Imt+XuT+/aWGHRZEt5QzptrDKC+TdUbl+CwdDGDTmJOYZQThTKpqqOOPl6 tzBekbLqyI+a8d5QGNJSiUdd+OzwjzMJb0cmvJeewbPxFx6ONdpLbnrqZsl8hw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776500742; a=rsa-sha256; cv=none; b=HOWb1M38a1Ot7ZBJJUFpFGVMTSHtIUb+z0otqBttn33LTieBFxS0AvHi4ckZy+huVo9cF9 m23dF7Yc5botGPys+uXyYbjKuZtcKJSbIKRSz3Kzk8hGHA9soD94fvobI0Ips2nj7YfB4K YkZpKh3V8DttwiiAG88Q6JL6AqyHlwMNR61X/nVoOf9SZi8hUr63vkQ4kYYijK6LLXUqW5 yzApollWYHXCHjqmtOtTHCdHy1IqAP8I6HH8H62HQiNlcx8nmwIU/SttckXt22TZd1pbXn ihMU6hcTsF+DTAGMVNBnciTXvTl2yw3LBEiuz82aShLRDM1s28RVviOwT2zzBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776500742; 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=WNfiWLL3DEtfRsW56lLT3owCDODtWVxuU7zKw9+u/ng=; b=PKx2TspWfznFqo4NoilXM19k/1TQ2roKsFtuEulCnJsm24jgSO6TwpuPeSJJcFcroi8Zyz f2IYK+sJA6NO2b7+dcmyl4BRvGwVmEAO8KQp4VCGdYryb/Nt6YuzgNvkgl3cxG5YnAUUXl oiln7C7civ+IwYThxYOubl/Y8QHDsCf0ti9o8HQon/935Int30AvtDwVIZ3XHsqwkt5jdw OUmhmrt+8DNg012UQtsIkbqfx+09OxnqPlBw4NaN//yiRkB0QPSOm4pjaHiaKSbCGsBmJa EjHQquHXpVteS/JFYt4B1K6awE12te/ISI1RCc9mWzw7QyM0lqiA22/bJ6xP1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyPvn5qnLzXW7 for ; Sat, 18 Apr 2026 08:25:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 19e6f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 08:25:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 05bbe5e38834 - main - libarchive: Update configuration List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 05bbe5e3883492dd2afa52039da1fac45c5059a0 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 08:25:41 +0000 Message-Id: <69e34005.19e6f.3cdcf154@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=05bbe5e3883492dd2afa52039da1fac45c5059a0 commit 05bbe5e3883492dd2afa52039da1fac45c5059a0 Author: Dag-Erling Smørgrav AuthorDate: 2026-04-18 08:25:31 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-04-18 08:25:31 +0000 libarchive: Update configuration PR: 294577 MFC after: 1 week Reviewed by: mm Differential Revision: https://reviews.freebsd.org/D56468 --- lib/libarchive/config_freebsd.h | 126 ++++++++++++++++++++++++++++------------ 1 file changed, 89 insertions(+), 37 deletions(-) diff --git a/lib/libarchive/config_freebsd.h b/lib/libarchive/config_freebsd.h index 1601adddd0de..41d91cea9bd3 100644 --- a/lib/libarchive/config_freebsd.h +++ b/lib/libarchive/config_freebsd.h @@ -26,30 +26,11 @@ */ #define __LIBARCHIVE_CONFIG_H_INCLUDED 1 -#include - -/* FreeBSD 5.0 and later has ACL and extattr support. */ -#if __FreeBSD__ > 4 -#define ARCHIVE_ACL_FREEBSD 1 -#define ARCHIVE_XATTR_FREEBSD 1 -#define HAVE_ACL_GET_PERM_NP 1 -#define HAVE_ARC4RANDOM_BUF 1 -#define HAVE_STRUCT_XVFSCONF 1 -#define HAVE_SYS_ACL_H 1 -#define HAVE_SYS_EXTATTR_H 1 -#if __FreeBSD__ > 7 -/* FreeBSD 8.0 and later has NFSv4 ACL support */ -#define ARCHIVE_ACL_FREEBSD_NFS4 1 -#define HAVE_ACL_GET_LINK_NP 1 -#define HAVE_ACL_IS_TRIVIAL_NP 1 -#define HAVE_ACL_SET_LINK_NP 1 -#endif /* __FreeBSD__ > 7 */ -#endif /* __FreeBSD__ > 4 */ - #ifdef WITH_OPENSSL #define HAVE_LIBCRYPTO 1 #define HAVE_OPENSSL_EVP_H 1 #define HAVE_OPENSSL_MD5_H 1 +#define HAVE_OPENSSL_OPENSSLV_H 1 #define HAVE_OPENSSL_RIPEMD_H 1 #define HAVE_OPENSSL_SHA_H 1 #define HAVE_OPENSSL_SHA256_INIT 1 @@ -75,13 +56,59 @@ #define HAVE_SHA512_INIT 1 #endif +#define ARCHIVE_ACL_FREEBSD 1 +#define ARCHIVE_ACL_FREEBSD_NFS4 1 +#define ARCHIVE_XATTR_FREEBSD 1 +#define HAVE_ACL_ADD_FLAG_NP 1 +#define HAVE_ACL_ADD_PERM 1 +#define HAVE_ACL_CLEAR_FLAGS_NP 1 +#define HAVE_ACL_CLEAR_PERMS 1 +#define HAVE_ACL_CREATE_ENTRY 1 +#define HAVE_ACL_DELETE_DEF_FILE 1 +#define HAVE_ACL_ENTRY_T 1 +#define HAVE_ACL_FREE 1 +#define HAVE_ACL_GET_BRAND_NP 1 +#define HAVE_ACL_GET_ENTRY 1 +#define HAVE_ACL_GET_ENTRY_TYPE_NP 1 +#define HAVE_ACL_GET_FD 1 +#define HAVE_ACL_GET_FD_NP 1 +#define HAVE_ACL_GET_FILE 1 +#define HAVE_ACL_GET_FLAGSET_NP 1 +#define HAVE_ACL_GET_FLAG_NP 1 +#define HAVE_ACL_GET_LINK_NP 1 +#define HAVE_ACL_GET_PERMSET 1 +#define HAVE_ACL_GET_PERM_NP 1 +#define HAVE_ACL_GET_QUALIFIER 1 +#define HAVE_ACL_GET_TAG_TYPE 1 +#define HAVE_ACL_INIT 1 +#define HAVE_ACL_IS_TRIVIAL_NP 1 +#define HAVE_ACL_PERMSET_T 1 +#define HAVE_ACL_SET_ENTRY_TYPE_NP 1 +#define HAVE_ACL_SET_FD 1 +#define HAVE_ACL_SET_FD_NP 1 +#define HAVE_ACL_SET_FILE 1 +#define HAVE_ACL_SET_LINK_NP 1 +#define HAVE_ACL_SET_QUALIFIER 1 +#define HAVE_ACL_SET_TAG_TYPE 1 +#define HAVE_ACL_T 1 +#define HAVE_ACL_TAG_T 1 +#define HAVE_ARC4RANDOM_BUF 1 #define HAVE_BSDXML_H 1 #define HAVE_BZLIB_H 1 #define HAVE_CHFLAGS 1 #define HAVE_CHOWN 1 #define HAVE_CHROOT 1 +#define HAVE_CLOSEFROM 1 +#define HAVE_CLOSE_RANGE 1 #define HAVE_CTIME_R 1 #define HAVE_CTYPE_H 1 +#ifndef __linux__ +#define HAVE_D_MD_ORDER 1 +#endif +#define HAVE_DECL_ACL_SYNCHRONIZE 1 +#define HAVE_DECL_ACL_TYPE_EXTENDED 0 +#define HAVE_DECL_ACL_TYPE_NFS4 1 +#define HAVE_DECL_ACL_USER 1 #define HAVE_DECL_EXTATTR_NAMESPACE_USER 1 #define HAVE_DECL_INT32_MAX 1 #define HAVE_DECL_INT32_MIN 1 @@ -95,15 +122,21 @@ #define HAVE_DECL_UINT32_MAX 1 #define HAVE_DECL_UINT64_MAX 1 #define HAVE_DECL_UINTMAX_MAX 1 +#define HAVE_DECL_XATTR_NOFOLLOW 0 #define HAVE_DIRENT_H 1 #define HAVE_DIRFD 1 #define HAVE_DLFCN_H 1 -#ifndef __linux__ -#define HAVE_D_MD_ORDER 1 -#endif #define HAVE_EFTYPE 1 #define HAVE_EILSEQ 1 #define HAVE_ERRNO_H 1 +#define HAVE_EXTATTR_GET_FD 1 +#define HAVE_EXTATTR_GET_FILE 1 +#define HAVE_EXTATTR_GET_LINK 1 +#define HAVE_EXTATTR_LIST_FD 1 +#define HAVE_EXTATTR_LIST_FILE 1 +#define HAVE_EXTATTR_LIST_LINK 1 +#define HAVE_EXTATTR_SET_FD 1 +#define HAVE_EXTATTR_SET_LINK 1 #define HAVE_FCHDIR 1 #define HAVE_FCHFLAGS 1 #define HAVE_FCHMOD 1 @@ -120,26 +153,33 @@ #define HAVE_FSTATFS 1 #define HAVE_FSTATVFS 1 #define HAVE_FTRUNCATE 1 +#define HAVE_FUTIMENS 1 #define HAVE_FUTIMES 1 #define HAVE_FUTIMESAT 1 +#define HAVE_GETEGID 1 #define HAVE_GETEUID 1 #define HAVE_GETGRGID_R 1 #define HAVE_GETGRNAM_R 1 #define HAVE_GETLINE 1 -#define HAVE_GETOPT_OPTRESET 1 #define HAVE_GETPID 1 #define HAVE_GETPWNAM_R 1 #define HAVE_GETPWUID_R 1 +#define HAVE_GETRESGID 1 +#define HAVE_GETRESUID 1 #define HAVE_GETVFSBYNAME 1 #define HAVE_GMTIME_R 1 #define HAVE_GRP_H 1 #define HAVE_INTMAX_T 1 #define HAVE_INTTYPES_H 1 +#define HAVE_ISSETUGID 1 #define HAVE_LANGINFO_H 1 #define HAVE_LCHFLAGS 1 #define HAVE_LCHMOD 1 #define HAVE_LCHOWN 1 +#define HAVE_LIBBZ2 1 +#define HAVE_LIBLZMA 1 #define HAVE_LIBZ 1 +#define HAVE_LIBZSTD 1 #define HAVE_LIMITS_H 1 #define HAVE_LINK 1 #define HAVE_LINKAT 1 @@ -148,9 +188,10 @@ #define HAVE_LONG_LONG_INT 1 #define HAVE_LSTAT 1 #define HAVE_LUTIMES 1 +#define HAVE_LZMA_H 1 +#define HAVE_LZMA_STREAM_ENCODER_MT 1 #define HAVE_MBRTOWC 1 #define HAVE_MEMMOVE 1 -#define HAVE_MEMORY_H 1 #define HAVE_MEMSET 1 #define HAVE_MKDIR 1 #define HAVE_MKFIFO 1 @@ -162,7 +203,16 @@ #define HAVE_PIPE 1 #define HAVE_POLL 1 #define HAVE_POLL_H 1 +#if 0 +/* + * FreeBSD does have posix_spawn() and posix_spawnp(), but they are + * wrappers around fork() + execve() and fork() + execvp() respectively, + * so there is no reason to prefer them to the simpler alternatives, + * unlike e.g. Darwin where posix_spawn() is a system call. + */ +#define HAVE_POSIX_SPAWN 1 #define HAVE_POSIX_SPAWNP 1 +#endif #define HAVE_PTHREAD_H 1 #define HAVE_PWD_H 1 #define HAVE_READLINK 1 @@ -182,6 +232,7 @@ #define HAVE_STATVFS 1 #define HAVE_STDARG_H 1 #define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 #define HAVE_STDLIB_H 1 #define HAVE_STRCHR 1 #define HAVE_STRDUP 1 @@ -192,6 +243,8 @@ #define HAVE_STRING_H 1 #define HAVE_STRNLEN 1 #define HAVE_STRRCHR 1 +#define HAVE_STRUCT_STATFS 1 +#define HAVE_STRUCT_STATFS_F_IOSIZE 1 #define HAVE_STRUCT_STATFS_F_NAMEMAX 1 #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 #define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1 @@ -200,13 +253,17 @@ #define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1 #define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 #define HAVE_STRUCT_TM_TM_GMTOFF 1 +#define HAVE_STRUCT_VFSCONF 1 +#define HAVE_STRUCT_XVFSCONF 1 #define HAVE_SYMLINK 1 +#define HAVE_SYSCONF 1 +#define HAVE_SYS_ACL_H 1 #define HAVE_SYS_CDEFS_H 1 +#define HAVE_SYS_EXTATTR_H 1 #define HAVE_SYS_IOCTL_H 1 #define HAVE_SYS_MOUNT_H 1 #define HAVE_SYS_PARAM_H 1 #define HAVE_SYS_POLL_H 1 -#define HAVE_SYS_QUEUE_H 1 #define HAVE_SYS_SELECT_H 1 #define HAVE_SYS_STATVFS_H 1 #define HAVE_SYS_STAT_H 1 @@ -214,6 +271,8 @@ #define HAVE_SYS_TYPES_H 1 #define HAVE_SYS_UTSNAME_H 1 #define HAVE_SYS_WAIT_H 1 +#define HAVE_TCGETATTR 1 +#define HAVE_TCSETATTR 1 #define HAVE_TIMEGM 1 #define HAVE_TIME_H 1 #define HAVE_TZSET 1 @@ -224,6 +283,7 @@ #define HAVE_UNSIGNED_LONG_LONG 1 #define HAVE_UNSIGNED_LONG_LONG_INT 1 #define HAVE_UTIME 1 +#define HAVE_UTIMENSAT 1 #define HAVE_UTIMES 1 #define HAVE_UTIME_H 1 #define HAVE_VFORK 1 @@ -240,19 +300,11 @@ #define HAVE_WMEMCPY 1 #define HAVE_WMEMMOVE 1 #define HAVE_ZLIB_H 1 +#define HAVE_ZSTD_H 1 +#define HAVE_ZSTD_compressStream 1 +#define HAVE_ZSTD_minCLevel 1 #define TIME_WITH_SYS_TIME 1 -#if __FreeBSD_version >= 1100056 -#define HAVE_FUTIMENS 1 -#define HAVE_UTIMENSAT 1 -#endif - -/* FreeBSD 4 and earlier lack intmax_t/uintmax_t */ -#if __FreeBSD__ < 5 -#define intmax_t int64_t -#define uintmax_t uint64_t -#endif - /* FreeBSD defines for archive_hash.h */ #ifdef WITH_OPENSSL #define ARCHIVE_CRYPTO_MD5_OPENSSL 1 From nobody Sat Apr 18 08:25:42 2026 X-Original-To: dev-commits-src-main@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 4fyPvq4qS9z6ZDFq for ; Sat, 18 Apr 2026 08:25:43 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyPvq2cSFz3p3k for ; Sat, 18 Apr 2026 08:25:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776500743; 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=IZ6rdFUaV7JArL4qsVVOPx5XGr2r3PGiyhkrlglgppw=; b=uImsFsAe0kypvtBDSeqetf+p1g9Fqmc3ipZyvSqs6olC2XbGGJsJi3pQed4B7OdAaMycFb 9xpWPlAP5nznpRyXJB12UsmatXK944xn+BxTOp5cF5Xk/H3KKh16YcuOK3cnq6QxXg0V1B rajkmwmNtiPKcC0z2n6HaSJtANeyp/EF3iF1AT5hm7l8xZHJVKzoVIiFz+ovRRCC8ddB1K 8LHvs7KKguoUVJ6TacXWElobCzGXPLkT4Wh3RZIg8oSj5qfkYfoK4Cr7lhXvStwLeaQ31Z JDIDfHEfhZciSZLr3LjSJgvUwSzJ3esBRG27GpKdyvDpQw0+ESVq/Sjw61y8tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776500743; a=rsa-sha256; cv=none; b=mJxLXsIytZxdNWuN59gMzHt1ZDZm+8fV8De3icIwbGMCZaiqqCXDXAYx8eKP1kU9kdR+ht Yk6QZc32eQAgUPAsn+20flJhkUlOnzqEMYePfLPrAilbAxvu+XxXBR/9Dcph3sPclnM0mi Tzem56Lt/we/Onw24CBT2Egpa4WOEXYPFShyHUlOgitHyxKZ/kYgfXTzygS7enulUwqP5/ V9oH6O9YuzFNDJu7fQAIkFnzRG0lthtiAnt/FugmsZmvW1X+Ab3ETlzLqcylet44B3CIgk zKhQUPWjTC2HtT3CxDucf5uJfGK4MUhYbBqVRReQvOShJ0Fk9wCsBYK+gEwzlA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776500743; 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=IZ6rdFUaV7JArL4qsVVOPx5XGr2r3PGiyhkrlglgppw=; b=IhefkXOrzRc30lmKNvx0MEgTUEeVahPtyw1RKlAqTcB5K1VkEMX+YHfbftNkqxp+PMwbkI 1syaob1ZNbvgOCcJ5Op8MJKB03EAOuP8WxgKWZdY0xLYW852DwmcL7wzTTEuw9njjsNU39 7TJPdyYYbgBAmF+O/AbUJdnfYdzsUm73agdqqFGH+yRCF93MIXbxgF6hO7/3+KntrNDetx bK0utMjvzuknzpbqXIUlstaDj5/M3FeAco69XQTkdhCcRjk700aVxclDCzlHw9rJQw/1DA BPKlHw/PCJuZTVj6XVWVozL2wGCBWk/JzeBJDw6AeJhk0cHPpa/8VN511i2tZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyPvp6kWTzXW8 for ; Sat, 18 Apr 2026 08:25:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d605 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 08:25:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 7e9d974bc023 - main - libarchive: Staticize some variables List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7e9d974bc023755161742f66c8c77546bab88586 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 08:25:42 +0000 Message-Id: <69e34006.1d605.24d12a35@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=7e9d974bc023755161742f66c8c77546bab88586 commit 7e9d974bc023755161742f66c8c77546bab88586 Author: Dag-Erling Smørgrav AuthorDate: 2026-04-18 08:25:35 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-04-18 08:25:35 +0000 libarchive: Staticize some variables This code was not being built due to errors in our libarchive configuration. Now that those have been addressed, staticize some variables that trip a “no previous extern declaration” error. This is a subset of upstream PR 2962. MFC after: 1 week Reviewed by: mm Differential Revision: https://reviews.freebsd.org/D56471 --- contrib/libarchive/test_utils/test_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/libarchive/test_utils/test_main.c b/contrib/libarchive/test_utils/test_main.c index 1f641bbe8db7..f7364c0ba4e8 100644 --- a/contrib/libarchive/test_utils/test_main.c +++ b/contrib/libarchive/test_utils/test_main.c @@ -187,10 +187,10 @@ const char *testprog; #ifdef RUN_TEST_UNPRIV /* Unprivileged user to run as */ -const char *tuser = "nobody"; +static const char *tuser = "nobody"; /* Original and test credentials */ -uid_t ouid, tuid; -uid_t ogid, tgid; +static uid_t ouid, tuid; +static uid_t ogid, tgid; #endif #if defined(_WIN32) && !defined(__CYGWIN__) From nobody Sat Apr 18 08:33:10 2026 X-Original-To: dev-commits-src-main@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 4fyQ4R48Ntz6ZF5X; Sat, 18 Apr 2026 08:33:11 +0000 (UTC) (envelope-from des@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyQ4R3GXpz3qf1; Sat, 18 Apr 2026 08:33:11 +0000 (UTC) (envelope-from des@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776501191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9Yil1xdB2AhEPAXyAbpbR1qx4e3J0l6A+8mpBtzaa5Q=; b=ekC+9t0yIox58ElhFABfMntv5Gqv2E5TpnOvB2+C/lA75lIAe9xS5a+nob/NPkRU+4+wN6 N2GyikSis5Hukv2t6yN7nGCZEg5TLoFKflmQ0hRtWOVh+TOA9leI+da5HQvkZi2SyA5cS+ Oymv+aPqJ8a21YJtBfu46Fo/jlJRqLoPuO2FcRMDL0KOSf9u7C2X6wmyoh1rX8D12OT4uL OP87cFNlzm/rSTDf50wwhuj3wCH++vQP5jWP9rLnoF4A3f6H9n5dOcZP1XzFdK7W2GCN+d 7Fq033UqbmeYmJl3RnsQvtpsAoD4szNMGgvwNTkN4xnW9OW/Sawyg2nwi8xLqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776501191; a=rsa-sha256; cv=none; b=lts5T6xAYWMVBXgFaAJfQrnzzExFBPOlNSHV6bqLcST37bW91oY5QTozGw8AR8tm+G7/xc CDtmZf9/mTdSzfJQO6YTkRkgEnPM0bKVMOOaxi6XKXDy26IKyd4r6gIqP3IHI+C/xd1J0o 0jSyqHI+25jv4y2ReCTByWQmQbS4Nw5efoGCKs/y1GUq6OTnPvIq/SDpb3tWSmXQkhrTSL 3oYnYORVeDlCQGr6MqNbEv55EfHPHDIek+vUo7nHCwB5qf9FcaPCd8zCZlyIG+5Ev4Baax HORQq6PlkhvU3Vr1dp6yfPtufCA9Uy3qzVjy34r7z9XThEV1PoD2zHfusB6riQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776501191; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9Yil1xdB2AhEPAXyAbpbR1qx4e3J0l6A+8mpBtzaa5Q=; b=LdHghHISERtAyZgfrhrOhps6SbExDHAhSLE1ug1smwSZDUf1Fz+O8EnXc+LpEZV/ICcBXZ N/1KKIfasicCLZNZnhvCWq0rmE1KZbEfgZgCCUhX2tS7WxiYhDGvydfnOYbq9xRHsxvnwS waPlAKQu138eBdeUBSsb8n9A1bGxyGjWCgmbkB9/kzG0ABHLlEtPqJnXI7ODVeofgIMU3C KyVUh8VIu7TyaC+gKs56gwRW7bY65EcYw2PX/1IuBvclWN1hUY7PW1giU+T5FoTzfZ2zdB 7tNoXrej0EKiQGPjkmx4cIca4j2AaDSO+0ZHaNJ7DVAdD4c78+3Mkor585HWKQ== Received: from ltc.des.dev (2a01cb0585090500922e16fffef1acef.ipv6.abo.wanadoo.fr [IPv6:2a01:cb05:8509:500:922e:16ff:fef1:acef]) (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) (Authenticated sender: des/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fyQ4R1vk2z4Rw; Sat, 18 Apr 2026 08:33:11 +0000 (UTC) (envelope-from des@freebsd.org) Received: by ltc.des.dev (Postfix, from userid 1001) id 1D31FF997; Sat, 18 Apr 2026 10:33:10 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Warner Losh Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 4ed20e0236dd - main - kshim/usb: Add build option. In-Reply-To: <69e2efb1.21b3b.32f0016@gitrepo.freebsd.org> (Warner Losh's message of "Sat, 18 Apr 2026 02:42:57 +0000") References: <69e2efb1.21b3b.32f0016@gitrepo.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Sat, 18 Apr 2026 10:33:10 +0200 Message-ID: <86se8sd5x5.fsf@ltc.des.dev> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Warner Losh writes: > diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk > index ab774d44c283..a5fdc4730cd8 100644 > --- a/share/mk/src.opts.mk > +++ b/share/mk/src.opts.mk > @@ -208,6 +208,7 @@ __DEFAULT_NO_OPTIONS =3D \ > DTRACE_TESTS \ > HESIOD \ > IPFILTER_IPFS \ > + LOADER_USB \ > LOADER_VERBOSE \ > LOADER_VERIEXEC_PASS_MANIFEST \ > LLVM_FULL_DEBUGINFO \ LO comes after LL DES --=20 Dag-Erling Sm=C3=B8rgrav - des@FreeBSD.org From nobody Sat Apr 18 10:50:36 2026 X-Original-To: dev-commits-src-main@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 4fyT703P2Dz6ZTdM for ; Sat, 18 Apr 2026 10:50:36 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyT702kg9z46bv for ; Sat, 18 Apr 2026 10:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776509436; 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=96pEWjlKEA3tWecNGC3qP80ofQ4tF0dQEHZuv/nHxyo=; b=LlqM+kF3ORxuWYxve1ob0lGYPdSYCZI3ft+3gbJLLqF8mtg83J0AV0V8xiw4bc2D9feKcZ zO4ine8buYea28xUK+MeR+yXKVQ+qcKwPj17CJPWEp7qp1y+BemF7S+EtQxclS6MVX2IAa P3TjaWcg54uU6RvpK3rigyc8JML6zZB1QxxufXYjzH0QFW71dY7qJmu18VOZJL4a4xYiZx xbYQwMwT/ltucUr7rtYc/xcbB7LYx9uzYspazYZXOalRH4Xd8BMQBq5vUkIktsgsehc0ON ZkSHmhKI+Y/le6y2KN/dEZYKMO4zUMG3BKwinzTfaTjcbpr4uAXB6Z+kCu+H6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776509436; a=rsa-sha256; cv=none; b=iWa7FOA138AHgUIdeNJkys1aRa4Z2+f98n2QI+3LWMYTjYIh0Ej7ZSpC0JpXWIahT0GmVz chjdU6m7skrm8zQ7/VomvOlglaaaPSi9oTC8Wp8YjiDl+m2ufOj6IwrMHjG8Utg3dmP3Gk FJb8rYpAiNs5zFO3OYbnH1IxkjPtp4URL1tAIB9elC5Od1k+W45waL4d3ryXM+2/jY9HcE uuz/F/bzvLsXZ4Tdo1uM5gFIvLQTQ1h0xdlnVn8g+4hSRhMgNdAKn+FDvsWjdE2xRCOnkF Vl2hsuU63tdAA7/+L+Kvam3hS/boyvSoEROkzHVIsTHhdOkC1Z/fIcH+xnqXhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776509436; 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=96pEWjlKEA3tWecNGC3qP80ofQ4tF0dQEHZuv/nHxyo=; b=DUV+szRKOR/sb4LGO4RoXt6kMPIJboA4cpBE7evAEBtprBXNJmJox3uonHSuQxYdFTpYQc H6k3AoxjT06rOlL5KxIrqCcCpUiTigR1dGhVA9A8GBZnJ6K4GWjToduxYqqIwqLATrcoCe 5iXdwY/Wzh1c1GnNJFwpIBCufmnUURmcG+N3uVhfFDlp9Hnt2vebSMbUrbOAMX5082NzyY o+vrNdWz7mIfmX+WJ+5XwQzzSg/3aCZkK7DN2sIvPg2g5shFPCrFnUczsJLPJfyBC32k0N U8qowjmzVG3KWrOfmmbw2X7LkX0tcuwC5Tx9003OGlSgNAzRKZpv6Z0uNXb7AQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyT702KSRzdMD for ; Sat, 18 Apr 2026 10:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 325ed by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 10:50:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 602249f033d1 - main - sound: Remove some forward declarations from sound.h and uaudio.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 602249f033d146d9c731d8b1cb4b2e0899c61ad9 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 10:50:36 +0000 Message-Id: <69e361fc.325ed.76cd59ea@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=602249f033d146d9c731d8b1cb4b2e0899c61ad9 commit 602249f033d146d9c731d8b1cb4b2e0899c61ad9 Author: Christos Margiolis AuthorDate: 2026-04-18 10:50:03 +0000 Commit: Christos Margiolis CommitDate: 2026-04-18 10:50:03 +0000 sound: Remove some forward declarations from sound.h and uaudio.h Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/dev/sound/pcm/sound.h | 5 +---- sys/dev/sound/usb/uaudio.h | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index de9af6bd5324..56ef6af8e546 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -75,15 +75,12 @@ #include #include -struct pcm_channel; -struct pcm_feeder; -struct snd_dbuf; struct snd_mixer; -#include #include #include #include +#include #include #include diff --git a/sys/dev/sound/usb/uaudio.h b/sys/dev/sound/usb/uaudio.h index 54b31a4e7bd2..05858473eb00 100644 --- a/sys/dev/sound/usb/uaudio.h +++ b/sys/dev/sound/usb/uaudio.h @@ -33,9 +33,7 @@ struct uaudio_chan; struct uaudio_softc; -struct snd_dbuf; struct snd_mixer; -struct pcm_channel; extern int uaudio_attach_sub(device_t dev, kobj_class_t mixer_class, kobj_class_t chan_class); From nobody Sat Apr 18 11:30:30 2026 X-Original-To: dev-commits-src-main@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 4fyV172Pzkz6ZXvc for ; Sat, 18 Apr 2026 11:30:35 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyV1715Hpz4CkP for ; Sat, 18 Apr 2026 11:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776511835; 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=3DgxUAGVeSSvbHtsOCCc4T0+wZ8Q8SGLQ33Dy0mfQxU=; b=iwTTWt8AXhiWQ2jS4ZOASA9fR7POWE1KZJtjQLUvN11tsjj646zQZlXsE/xno8QSROqhoS 1GZ62cdiPPZd4wuLIBp+KjJSoquKpScg4Ubr18e7X886g0JMdFti6enp4L2HRXUvOzM4BW FypOM/NpmD7KhkN/VK8Y+oKr2fi3JsyiqrxXp8y3eg4xiXn5QZiRMCjvUoPoXZQQmYYlXX ZfumaLltnCJXmBuBxCKY2YiZbdeMEiO/RtUQDxnYJeuixH+BopeqAvNM+UvQj+y9h5mNFL e2vhdi3xlUrg0zFz960RcJtxf+esLLsiw9YDpvZFZV0XGprVoyW0DXG9TtwBYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776511835; a=rsa-sha256; cv=none; b=ED6wwlEKNx6AIZYVcxILh5lTEohf2yKKR/a1kNDsHNVyo+Hwefv3tGF+OBCSpfOP9/DCu4 cKCSdylFgy9aH0yVa5i3GPHHmNd1Pro1xZRq19WKsO7n+APZwPZ1pDRQaUlPLrA+5xZaxG RnQEg4ilZakDFDm0vXForV7Lte6QAERJwRkq6qntAZvdtw5XyTCpBJFFeYd3EHtL+3Muos lZoTq1kQqz7Q3fUsMg2Esox0E1e3W8g/aLliTYVhbPNUUq3DG3xb8OMiKFBJVSmavCANjJ pVPeP8P6sVOxFwo87b0QCQ/yUUm3TiT7sfxNfQYOKVVp+raNMSTHJc8B0zD8gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776511835; 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=3DgxUAGVeSSvbHtsOCCc4T0+wZ8Q8SGLQ33Dy0mfQxU=; b=vsuNOeV+Q2glNEMUpVHAYcYcSuDLlB3vtHyQBb2fjJSzzmOgqv2AS1qPjh4JXaLzbDM6kj jJMK/0eoQ9T5WphaqSr/YkB6ODPha1tca0guzFUOyGy3RVJBHrqyjLW14YznNljcOVWzZO gQ4bCkLHMvBPxJj31ewH6dOnwiT/1QhYnPRp6IDYCbg4bh0CF/Ixe1tLAx3QJ9xwGhKhD1 7lbG6xf1cJIbtVs1S/+G/12qynRWCK2KqJA3nGYdJtrTsMQ6DeaYswNntswkHDiW4VmbDb vg5P7ru8AZEGBw24Tqv7t0R21JP5CKKPFrHlPcni2eEyKpBfFZKL42uRZNftog== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyV170Sspzddc for ; Sat, 18 Apr 2026 11:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37d45 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 11:30:30 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: ec077230fd94 - main - Revert "sound: Remove some forward declarations from sound.h and uaudio.h" List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec077230fd941336c37f8bfdce3bb3e4c9d809b4 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 11:30:30 +0000 Message-Id: <69e36b56.37d45.73fdabd2@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ec077230fd941336c37f8bfdce3bb3e4c9d809b4 commit ec077230fd941336c37f8bfdce3bb3e4c9d809b4 Author: Christos Margiolis AuthorDate: 2026-04-18 11:30:20 +0000 Commit: Christos Margiolis CommitDate: 2026-04-18 11:30:20 +0000 Revert "sound: Remove some forward declarations from sound.h and uaudio.h" This reverts commit 602249f033d146d9c731d8b1cb4b2e0899c61ad9. --- sys/dev/sound/pcm/sound.h | 5 ++++- sys/dev/sound/usb/uaudio.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 56ef6af8e546..de9af6bd5324 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -75,12 +75,15 @@ #include #include +struct pcm_channel; +struct pcm_feeder; +struct snd_dbuf; struct snd_mixer; +#include #include #include #include -#include #include #include diff --git a/sys/dev/sound/usb/uaudio.h b/sys/dev/sound/usb/uaudio.h index 05858473eb00..54b31a4e7bd2 100644 --- a/sys/dev/sound/usb/uaudio.h +++ b/sys/dev/sound/usb/uaudio.h @@ -33,7 +33,9 @@ struct uaudio_chan; struct uaudio_softc; +struct snd_dbuf; struct snd_mixer; +struct pcm_channel; extern int uaudio_attach_sub(device_t dev, kobj_class_t mixer_class, kobj_class_t chan_class); From nobody Sat Apr 18 11:50:31 2026 X-Original-To: dev-commits-src-main@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 4fyVS75gVzz6ZZYW for ; Sat, 18 Apr 2026 11:50:31 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyVS74fkwz4Fy5 for ; Sat, 18 Apr 2026 11:50:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776513031; 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=jDSkPR/dvzbTJ6DPJrdNQ7JlZo0PKN0o2rEm0PDaPQ4=; b=h/Up/72BjYd7x9KSTTApfmB90KKsr9Y0043T5uWsevaY+COY9uEUq4DXE+X5iH0R4Od5ul uYhmyO+tMl3AtAPwGgaAVXlYhWbuukj/YzEpo1GmclkSFBCzDTNAUhaSPzIaRLrna/ROps PHHP8txp7XyzD5C9WepC/Kjdveci5iOWH8OwAedIF7sAArGxDEilVY1vkKy1OjP0iptKYK V/k6aRNNxiXjORJPGy6z5aXqbrtdjOad3IlvO+J1n8tIXFs8bWPQnJvAKZuLhP7rbR2yxX ft4Uy4nGBjkHSIfFUccl1KbRb1/P3qwndYmKNPM3vJtcdOJG/cqDkA4cAchPzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776513031; a=rsa-sha256; cv=none; b=s5gRyk70/9oAyyQSVZqcnnO0IhNGPQGEAkmqX/WFOvfaYZS1kMlZ0YFeRQuLI2+aTkL/vR ZdCgl1LyUwKoBvOAkkxkZtTi1kDZVNjRpCniDEIOeLZ8w7CZ1xAwsr87rpu29UMawy7p+h q5ybI7UUjedyCFLJWJqdBx8sn+37bWW2wKtcNGTVfMmyEWBBK97xPKVTJbQXs2Vkf7kKBG tkP1UecDP3QHOnsPaLrfR2WE++3TJzrZBFxJM9u907wt5iPI3GMEJaAWEBMp+eHE9k5UxZ gAZkTxR24DDobmX+aQRTbI12D/4ed3nUY2O5Bk3KJ17pAK50dije0NfHNxXmKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776513031; 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=jDSkPR/dvzbTJ6DPJrdNQ7JlZo0PKN0o2rEm0PDaPQ4=; b=ElPHofGbRpOm3MrFK7qUsSjUb08zAvcSbUNEvbzoURJJ5ZrVGhcgvJ4a2Y3RKJFpA5YocR RPXmVDlMKrbtWADPWDl5yvNmafExjWVVk1FUivpbpgY7uNd8i+LD0JC5B3+8TIjJpfJaVF jI+5wMhSGmhwgwYL7TH5SiHBylCjroIm8Dg14Vy2Z9kzO9ZBol6fS8TIGcIyjEM8PerVno MvuvBEx/q+o92ZSy7udjVquzDLTJORkV4VsbfGBDM4G2MtNVD54bQ0FgE5z4z9HpaAgzws 5+5dQKoT1hbq/UKLphEspbZO8xuXYEIHvTE3NTbbOxnzYRJzNsBzhNKHUOjaFA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyVS74GGPzfcJ for ; Sat, 18 Apr 2026 11:50:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3ac24 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 11:50:31 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: c39237a4fd2b - main - mixer(3): Rename _mixer_readvol() to mixer_readvol() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c39237a4fd2b1472e452052103156c915942d070 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 11:50:31 +0000 Message-Id: <69e37007.3ac24.49f12ad4@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=c39237a4fd2b1472e452052103156c915942d070 commit c39237a4fd2b1472e452052103156c915942d070 Author: Christos Margiolis AuthorDate: 2026-04-18 11:50:04 +0000 Commit: Christos Margiolis CommitDate: 2026-04-18 11:50:04 +0000 mixer(3): Rename _mixer_readvol() to mixer_readvol() No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- lib/libmixer/mixer.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/libmixer/mixer.c b/lib/libmixer/mixer.c index 2be3a48eb755..d4c3bf5adf52 100644 --- a/lib/libmixer/mixer.c +++ b/lib/libmixer/mixer.c @@ -35,13 +35,11 @@ #define BASEPATH "/dev/mixer" -static int _mixer_readvol(struct mix_dev *); - /* * Fetch volume from the device. */ static int -_mixer_readvol(struct mix_dev *dev) +mixer_readvol(struct mix_dev *dev) { int v; @@ -120,7 +118,7 @@ dunit: dp->parent_mixer = m; dp->devno = i; dp->nctl = 0; - if (MIX_ISDEV(m, i) && _mixer_readvol(dp) < 0) + if (MIX_ISDEV(m, i) && mixer_readvol(dp) < 0) goto fail; (void)strlcpy(dp->name, names[i], sizeof(dp->name)); TAILQ_INIT(&dp->ctls); @@ -334,7 +332,7 @@ mixer_set_vol(struct mixer *m, mix_volume_t vol) v = MIX_VOLDENORM(vol.left) | MIX_VOLDENORM(vol.right) << 8; if (ioctl(m->fd, MIXER_WRITE(m->dev->devno), &v) < 0) return (-1); - if (_mixer_readvol(m->dev) < 0) + if (mixer_readvol(m->dev) < 0) return (-1); return (0); From nobody Sat Apr 18 12:00:14 2026 X-Original-To: dev-commits-src-main@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 4fyVgL1zQNz6ZbPQ for ; Sat, 18 Apr 2026 12:00:14 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyVgL1JDSz4GyL for ; Sat, 18 Apr 2026 12:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776513614; 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=61IHZ8ar82D/sedvlUzPgavBWLrM0CgN9yjN9kkFMAs=; b=iIFec2SM+Mh46H0kraJeVeG3pf/YPzh7reNrdJqrYX69AorT9PvaoKa2zFc1splrVazS1f 9hSBY2FgeDg5aOrt2+/Kael0ibF88dpnEMA/ii7dsIIfUa7pSJ9jlcEwB/pP4YBmjL8PXl tSrx8feJrTMTEUyrZGoXXS2uNx+SPy06A3dAzCTpPeBN850wYAJHOJ8gA3WQu/BsKEJu1f 52iDbjTB3FbuE2wONaYGaKjoGui+Xw+Sc85TLTcWasLmj2ieqn1Zt/3GuC4Wf17oYO1944 eUr5g5RKYC1HPnEssE3mHqXrcfoj2P0zu8s++JpBrkCYvelKAHIAfJHghMkouA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776513614; a=rsa-sha256; cv=none; b=hpwTPUJjDtoAv8zV26dR6fr3nPv01Y3IXgcwGm+VoDeCSMlJ7KFAlWzAdcwQQrfs9jR3f6 fIzWzkBQWfNfIB20yFNBIDbjEcIhVYet6CeXHttVJxHlJtoofCXEq5C8ZtarD8uYQ5etoY ieG5AO2gpxk+OqEgheERcvguy/yhGMnpq3qTcmiYoVCkXqwaiOCWGlVDr5VhSxCX69Bjkk XKI04VCxn+EnDbGH3VGXp+UcNt8359bY1dXiVY5qi3bGJ+R0gsHMjckRgyxjbcNaRlgNNs 9tIe9CzKp8NxgWwZ+QKsBeM9kTq9pwNcwAB/B9mec3ReqIRS69J2K59imMGqAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776513614; 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=61IHZ8ar82D/sedvlUzPgavBWLrM0CgN9yjN9kkFMAs=; b=hi7OpR6aaCaLZW7eZ+48Bcc8HgkScL/9wSvWfgFFfxl8v9nd6OBuWugcKQdaL1z05a1DH9 xypgqI/uTiWYsK+HiIa8tdERj3NnKExOu2d3UPqLGFgPUCUJhBbZ6vriOP3Vj8XWatUi+5 cPls5gTn+X1fK3qRqBgbneoiwk+Rk8NT/tqmjYnU3lHhN4fFifiXLb1PjLfMcBSSuP5mu4 CUZLBI81rhJfJK31sPNLl9MswWCn9fG2FuewTbuh8WfllsGW9Z0tna0oti17xscnI/NPEq mFsiN0va+F0aPEiQ1MTVFO1tivB2yhKme58GJoRFpiTi3gS1kR8uI4OnsYtewA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyVgL0rCLzg2C for ; Sat, 18 Apr 2026 12:00:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3bb2b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 12:00:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: f252ce00898d - main - LinuxKPI: 802.11: set IEEE80211_MIN_ACTION_SIZE according to struct List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f252ce00898d17f4892534934b8097cd7ccb9e26 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 12:00:14 +0000 Message-Id: <69e3724e.3bb2b.348c89ec@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=f252ce00898d17f4892534934b8097cd7ccb9e26 commit f252ce00898d17f4892534934b8097cd7ccb9e26 Author: Bjoern A. Zeeb AuthorDate: 2026-04-15 07:50:35 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 12:00:00 +0000 LinuxKPI: 802.11: set IEEE80211_MIN_ACTION_SIZE according to struct IEEE80211_MIN_ACTION_SIZE came up in the mt76 vendor subtree merge as one of the non-mechanical changes which made me look. Rather than (incorrectly) hand counting the offset from the beginning of a frame, use the offset from the beginning of struct ieee80211_mgmt. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/linux/ieee80211.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/ieee80211.h b/sys/compat/linuxkpi/common/include/linux/ieee80211.h index d1eba94a3ad8..b8f29560f200 100644 --- a/sys/compat/linuxkpi/common/include/linux/ieee80211.h +++ b/sys/compat/linuxkpi/common/include/linux/ieee80211.h @@ -100,8 +100,6 @@ struct ieee80211_mmie_16 { #define IEEE80211_MAX_RTS_THRESHOLD 2346 /* net80211::IEEE80211_RTS_MAX */ -#define IEEE80211_MIN_ACTION_SIZE 23 /* ? */ - /* Wi-Fi Peer-to-Peer (P2P) Technical Specification */ #define IEEE80211_P2P_OPPPS_CTWINDOW_MASK 0x7f #define IEEE80211_P2P_OPPPS_ENABLE_BIT BIT(7) @@ -622,6 +620,8 @@ struct ieee80211_mgmt { } u; } __packed __aligned(2); +#define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u) + struct ieee80211_cts { /* net80211::ieee80211_frame_cts */ __le16 frame_control; __le16 duration; From nobody Sat Apr 18 12:00:15 2026 X-Original-To: dev-commits-src-main@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 4fyVgM3Lyyz6ZbZy for ; Sat, 18 Apr 2026 12:00:15 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyVgM26kCz4HC6 for ; Sat, 18 Apr 2026 12:00:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776513615; 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=KRqSfMlaSCNPKdG1+evERh+nKj0uyvnS5h0bWJfzfEE=; b=Mnf6K6l09hNWUk3A0GNhHO6Yz7xf0pZBMJPgCeb+JHoc99ueFj/cg9EleUNPVICNJ2dPDF ZgkkZel4E1P9IlyrBmdPlhJxZE8LcN03GGwbMCW0E+ae5G+6QKKaMGtvi7uKi1easX7r0D w7g5SzAFBRvcZ4SX15oiPgl7mWpkrbNsB6WGFir44f9UkVodAEdgTCpv2eiSBUYu+atdFa 3hsO9CBmXrwFKjeJ68ZUOEvRaEpplB44o4leslyhoAfEtblnHMZiZ9Zdt3LE5BgBvSuihs xPhRxb4IQ3Xn6n2dnhed+tlFnEG3Ks2JnQ3YAdccgrRQ5ToqsmgnAcdZsx7Iiw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776513615; a=rsa-sha256; cv=none; b=ecvyZACLMu8IUF+yDIFHCgpzs7KkCvDWC+O2TcrXIyHMQWDOdLgTqiHQAtLIyWTNJGTESZ n9Qyku3ZsZSbWyigFXKy00egO2zorC2pXSc7ECMyk7Cq3MzLt/lnxRfB+B/QPdud+zHcrw bmyeJYQbnw8eCpmLJ7D6V97LKD1bSS0NJSpkd+uQivp52BCZ9NqSx9o5RL9WQIrYl5uXhV WYaAuOGBOO6V7VA/0iSAY5yCHPYkMTHC42gGUOYQEv8dG105bV5AYc54a+lEkyULzZFjoX Dhnwtu9vEQ2Cj0GaIK9OLw8TiIUjBfFK7Ijw/LX1WiZE8TyJP+rhrwj1sgCLbQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776513615; 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=KRqSfMlaSCNPKdG1+evERh+nKj0uyvnS5h0bWJfzfEE=; b=Hv8VvNlGAl2ybjm+bweAd0r7W/yrVD9xtDJFWQMvDj5BWthhPTyAa0Lddq7vUFXUVCxWwI 6sfGWzjVOmshmzni4W5Vm519YHPu2CH86ZXw/uNmQgE8y3gF/LYVvw/nLdm09ulfpTiLDE QsyvXiRxj9T9kiZtC5tCnFwkux7ZDLLaohqW3katlhCev+87vnb8W1DgPSyYwrEo714ZN7 ZxevEvesIx2ZgXkfEZbr1LZQFujbADlrlxmQLOus4d0kCHBcc6murspAIMLKkmWhpY21To OE4p8g3oyvUnCpbVjl9hZGsubh6gRLpcKeZ89dFi0jf6MoiQW5zyzWuYMZklgQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyVgM1Rxpzfng for ; Sat, 18 Apr 2026 12:00:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3be93 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 12:00:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: a0112b013f93 - main - LinuxKPI: 802.11: Add structures and functions for NAN support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a0112b013f93a47489051fed54ea48c077e59de4 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 12:00:15 +0000 Message-Id: <69e3724f.3be93.678515b8@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=a0112b013f93a47489051fed54ea48c077e59de4 commit a0112b013f93a47489051fed54ea48c077e59de4 Author: Bjoern A. Zeeb AuthorDate: 2026-04-18 11:26:59 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 12:00:00 +0000 LinuxKPI: 802.11: Add structures and functions for NAN support In Linux v7.0 iwlwifi(4) started to add support for Wi-Fi Aware(tm) also known as Neighbor Awareness Networking (NAN). Add structures and fields for this as needed so far to keep the driver compiling. net80211 has no support for it as a new mode. We may consider a dedicated header file for these parts in the future depending on how much more is to come. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 66 +++++++++++++++++++++++ sys/compat/linuxkpi/common/include/net/mac80211.h | 11 ++++ 2 files changed, 77 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 5c8c914bdee7..24b57ea1f001 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -328,6 +328,53 @@ struct cfg80211_chan_def { uint16_t punctured; }; +struct cfg80211_nan_band_config { + /* XXX TODO */ + struct linuxkpi_ieee80211_channel *chan; + uint8_t rssi_middle; + uint8_t rssi_close; + uint8_t awake_dw_interval; +}; + +struct cfg80211_nan_conf { + uint8_t bands; + uint8_t discovery_beacon_interval; + uint8_t master_pref; + bool enable_dw_notification; + + uint16_t scan_dwell_time; + uint16_t scan_period; + uint16_t extra_nan_attrs_len; + uint16_t vendor_elems_len; + + uint8_t *cluster_id; + struct cfg80211_nan_band_config band_cfgs[NUM_NL80211_BANDS]; + uint8_t *extra_nan_attrs; + uint8_t *vendor_elems; +}; + +enum wiphy_nan_flags { + WIPHY_NAN_FLAGS_CONFIGURABLE_SYNC = BIT(0), + WIPHY_NAN_FLAGS_USERSPACE_DE = BIT(1), +}; + +/* Wi-Fi Aware (TM) specification, 9.5.15 Device Capability attribute. */ +/* Misplaced here for the moment. */ +#define NAN_OP_MODE_PHY_MODE_MASK 0x11 /* b0 0=HT, 1=VHT, b4=1 HE supported */ +#define NAN_OP_MODE_80P80MHZ 0x2 /* b1 */ +#define NAN_OP_MODE_160MHZ 0x4 /* b2 */ + +#define NAN_DEV_CAPA_EXT_KEY_ID_SUPPORTED 0x2 /* b1 */ +#define NAN_DEV_CAPA_NDPE_SUPPORTED 0x8 /* b3 */ + +struct wiphy_nan_capa { + uint32_t flags; /* enum wiphy_nan_flags */ + uint8_t op_mode; + uint8_t dev_capabilities; + uint8_t n_antennas; /* Tx/Rx bitmask, e.g., 0x22 */ + uint16_t max_channel_switch_time; +}; + struct cfg80211_ftm_responder_stats { /* XXX TODO */ int asap_num, failed_num, filled, non_asap_num, out_of_window_triggers_num, partial_num, reschedule_requests_num, success_num, total_duration_ms, unknown_triggers_num; @@ -1152,6 +1199,9 @@ struct wiphy { uint32_t bss_param_support; /* enum wiphy_bss_param_flags */ + uint8_t nan_supported_bands; + struct wiphy_nan_capa nan_capa; + int features, hw_version; int interface_modes, max_match_sets, max_remain_on_channel_duration, max_scan_ssids, max_sched_scan_ie_len, max_sched_scan_plan_interval, max_sched_scan_plan_iterations, max_sched_scan_plans, max_sched_scan_reqs, max_sched_scan_ssids; int num_iftype_ext_capab; @@ -2207,6 +2257,22 @@ cfg80211_cqm_rssi_notify(struct net_device *dev, /* -------------------------------------------------------------------------- */ +static inline void +cfg80211_nan_cluster_joined(struct wireless_dev *wdev, const uint8_t *cluster_id, + bool new_cluster, gfp_t gfp) +{ + TODO("NAN"); +} + +static inline void +cfg80211_next_nan_dw_notif(struct wireless_dev *wdev, + struct linuxkpi_ieee80211_channel *chan, gfp_t gfp) +{ + TODO("NAN"); +} + +/* -------------------------------------------------------------------------- */ + static inline void wiphy_work_init(struct wiphy_work *wwk, wiphy_work_fn fn) { diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index c637e13a496d..4943570d6c40 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -1104,6 +1104,10 @@ struct ieee80211_ops { int (*net_fill_forward_path)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct net_device_path_ctx *, struct net_device_path *); + int (*start_nan)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_nan_conf *); + int (*stop_nan)(struct ieee80211_hw *, struct ieee80211_vif *); + int (*nan_change_conf)(struct ieee80211_hw *, struct ieee80211_vif *, struct cfg80211_nan_conf *, uint32_t changes); + /* #ifdef CONFIG_MAC80211_DEBUGFS */ /* Do not change depending on compile-time option. */ void (*sta_add_debugfs)(struct ieee80211_hw *, struct ieee80211_vif *, struct ieee80211_sta *, struct dentry *); void (*vif_add_debugfs)(struct ieee80211_hw *, struct ieee80211_vif *); @@ -2650,4 +2654,11 @@ ieee80211_cqm_beacon_loss_notify(struct ieee80211_vif *vif, gfp_t gfp __unused) /* -------------------------------------------------------------------------- */ +static inline bool +ieee80211_vif_nan_started(struct ieee80211_vif *vif) +{ + IMPROVE("NAN"); + return (false); +} + #endif /* _LINUXKPI_NET_MAC80211_H */ From nobody Sat Apr 18 12:00:16 2026 X-Original-To: dev-commits-src-main@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 4fyVgN41vYz6Zbgx for ; Sat, 18 Apr 2026 12:00:16 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyVgN2cTvz4HF0 for ; Sat, 18 Apr 2026 12:00:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776513616; 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=RVwiPWLEQQBrHWJU8GcsMnAzlhhxpxZWgnMizpfHlQw=; b=LVRAkPfyHKM8KeZJQy6gx2sCSXRPBnmsUkaq6eGCxuJ+3w7/GZMFkID2cyavZtMYRy9zsy lHHPDoCJidZZWD/PqBLI42mha8K00xFoaRxuRnF8M/TDHXKcAaceNFN2LVwxbNg43aYKHz xC6q4hLRKqw5yVv4yOoQAg30n7GU00ZYHd0IGRP4WtkoLGXJ85RjxM8DJOyRBAF02Xi7Uk TxurDofqAUp9Cz79nyDkkSe3SXJ9UGZqMM2jPCkQ6a8kzK5TCY20TkDpfijN/vslfKcCvp VH5rnkYlunsIJf0NSJ+QhEOZYKtDK04Qz9VTRNK9DOJImm/rS3VHgQVW64jF/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776513616; a=rsa-sha256; cv=none; b=FwqHITLCzN01YoCYSWKw2UZy0vnRlW4uU4iz9FtrF64tFH8LNEvxe6PJoGRNnCVAy3Txfa IMnSOW1va7wGfLWmROGW/WUqIi0/HGD8wKE2AEevyHAwXdUSdKDrGob9pCzBz3BJKQCby+ FbWP1rkVw8DI3C8+rdhzbKPqARD+YLvM9bOYejlTsIuQJ5vq9m3ujoC4W54uovd303Ps1l oMjowKLiaY7SQbjjxJD9Ax9xE6/R4mi8zJrt5eyew3nDx+6xV6rDDmnRDtBR1SvvTT9pJ0 bueedDLiPeweSOCBlebbTbNjXzSYbylMn8sXWOlme93GBLBtMq+eCJJj3zHltQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776513616; 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=RVwiPWLEQQBrHWJU8GcsMnAzlhhxpxZWgnMizpfHlQw=; b=KxOVBeho5UsJf9IyG5BBF2hwgAcO8572V0fkeWJGrEJfla6vW8T2D2sDgF4Iiog1X1WZKp oK6yN2zPeWT+IG3zk64fMy4Mf2beTpfCLg6O9cOgLG7w9CK1SHbOeu2XHnlzeszCHSQTpV 9I2r+ky88jlXkJvGWE+/IBVfw9raXBqnnbPxxa1Iw0xilGbDg76gO/2V/CyfLBySaMSttn udmAgczitLUrw3kLaPK68bGnShjcCvbfolAgSTkua7G6kfqxliWKvGLhZvrUvxgzVQAQJU 3e+FKuWdjFn1wp0hNhwhw5vOLR9cWzU7dkO2L6VQIwwIZLIMvw8tx1n8LY6ebg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyVgN1sl9zfKY for ; Sat, 18 Apr 2026 12:00:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3bb2f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 12:00:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 25e776a54380 - main - LinuxKPI: 802.11: add struct/fields and functions for v7.0 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 25e776a5438005db59c6d474b5d47c42d2a341b9 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 12:00:16 +0000 Message-Id: <69e37250.3bb2f.26d28038@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=25e776a5438005db59c6d474b5d47c42d2a341b9 commit 25e776a5438005db59c6d474b5d47c42d2a341b9 Author: Bjoern A. Zeeb AuthorDate: 2026-04-14 15:23:31 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 12:00:00 +0000 LinuxKPI: 802.11: add struct/fields and functions for v7.0 Add 802.11 struct fields and functions support for Linux v7.0 based wireless drivers (at least iwlwifi, rtw88, rtw89). While here cleanup some other bits. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/include/net/cfg80211.h | 13 +++++++++---- sys/compat/linuxkpi/common/include/net/mac80211.h | 12 +++++++++++- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/cfg80211.h b/sys/compat/linuxkpi/common/include/net/cfg80211.h index 24b57ea1f001..dedf687d6530 100644 --- a/sys/compat/linuxkpi/common/include/net/cfg80211.h +++ b/sys/compat/linuxkpi/common/include/net/cfg80211.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2020-2025 The FreeBSD Foundation + * Copyright (c) 2020-2026 The FreeBSD Foundation * Copyright (c) 2021-2022 Bjoern A. Zeeb * * This software was developed by Björn Zeeb under sponsorship from @@ -165,7 +165,9 @@ struct cfg80211_bitrate_mask { uint16_t eht_mcs[NL80211_EHT_NSS_MAX]; enum nl80211_txrate_gi gi; enum nl80211_he_gi he_gi; - uint8_t he_ltf; /* XXX enum? */ + enum nl80211_he_ltf he_ltf; + enum nl80211_eht_gi eht_gi; + uint8_t eht_ltf; /* XXX enum? */ } control[NUM_NL80211_BANDS]; }; @@ -1359,8 +1361,11 @@ wiphy_dev(struct wiphy *wiphy) return (wiphy->dev); } -#define wiphy_dereference(_w, p) \ - rcu_dereference_check(p, lockdep_is_held(&(_w)->mtx)) +#define wiphy_dereference(_w, _p) \ + rcu_dereference_protected(_p, lockdep_is_held(&(_w)->mtx)) + +#define rcu_dereference_wiphy(_w, _p) \ + rcu_dereference_check(_p, lockdep_is_held(&(_w)->mtx)) #define wiphy_lock(_w) mutex_lock(&(_w)->mtx) #define wiphy_unlock(_w) mutex_unlock(&(_w)->mtx) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 4943570d6c40..3c783d1f3c8a 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -603,7 +603,7 @@ enum ieee80211_rx_status_flags { RX_FLAG_AMPDU_IS_LAST = BIT(21), RX_FLAG_AMPDU_LAST_KNOWN = BIT(22), RX_FLAG_AMSDU_MORE = BIT(23), - /* = BIT(24), */ + RX_FLAG_RADIOTAP_VHT = BIT(24), RX_FLAG_ONLY_MONITOR = BIT(25), RX_FLAG_SKIP_MONITOR = BIT(26), RX_FLAG_8023 = BIT(27), @@ -1581,6 +1581,16 @@ ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw, linuxkpi_ieee80211_iterate_stations_atomic(hw, iterfunc, arg); } +static inline void +ieee80211_iterate_stations_mtx(struct ieee80211_hw *hw, + void (*iterfunc)(void *, struct ieee80211_sta *), void *arg) +{ + + lockdep_assert_wiphy(hw->wiphy); + IMPROVE("we could simplify this if we had a sta list on the lhw"); + linuxkpi_ieee80211_iterate_stations_atomic(hw, iterfunc, arg); +} + static __inline struct wireless_dev * ieee80211_vif_to_wdev(struct ieee80211_vif *vif) { From nobody Sat Apr 18 12:04:31 2026 X-Original-To: dev-commits-src-main@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 4fyVmT1bhNz6Zbcj; Sat, 18 Apr 2026 12:04:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyVmT0czWz4JYn; Sat, 18 Apr 2026 12:04:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776513881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tqMQELhs7bAK/9avVLaaBGN+SdXLT1Kx8JNbwUH6ccY=; b=Jgop1ba6/YoqwuTUA/lRDRrTbjKlok0lSU6OqEXhnejpuWapw8ayibF+3ZXm8bQyRWjk50 IToTAz9gnlHLsNvMfWoD86yAgbrnO6G5xEggcVl2ROmNaj4O3mdIvr8AN1slSJ+HqIk/th jgMhtd9TT16K7ohgil6bo4vrQQa/rYu0KUiTDsq4UjF9ur2xuMlNf1AQ54+CFu05/GzKOo mCjld5JjB+T3Ktt9KG8o/o94fSzIi3okUU+MxAeyeB03jH1y3lZzg0hwzb2zavPdJ/RkDI X5i6r+PS2U6+Eurz1oWPdNWPX2ubmCG5v+xbFbN+VeVVu5vCZDxTK6gFiWWNKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776513881; a=rsa-sha256; cv=none; b=pc6uLMhzQGAjZudXKs7Xn6dTrIHC4v90UPschvMzcYTPC60zvXA8rSEmViGDIJIEbaAcTq i62pwchcpMzSjf2ClOKWivD6DUFvZX5zia/bu4+bv0Rq8BYMKR5FbOBEQtvgbVH67FDro9 a319hzARvt0NYWVQze91PDN0Ol5rXWM0rA7LjfQdn99cmeONvcDHzX6NVsLtvdvNGtM9v1 mxNa/T8TfRfVmHtXR2hoTzp0FB0Q7AQ5LKLMBvlrWGvbrFY3UOMThh5mfwDNXatDOF4IbO 4mVJu74CRKa1H2LtcjcujPeOoOEjAbI28HEtaddw/Y53Vzi77YzaUTVUmKkpPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776513881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tqMQELhs7bAK/9avVLaaBGN+SdXLT1Kx8JNbwUH6ccY=; b=VOHbRqB/C/1guRsY52jybAptlLQDjiv+XntlnfYFZwNDbB/ET7+aeITTYZZ6L5zad2vYO/ jCHt7/vQFvGPR8t9LzgLADuCJjOR2m49m1hwRfnpboYmBWgytdovE4pS9D1i/7DoR1Jwgr 2vS02eFBty5QmBEWH4hXbPY/ihL6/GvjRg4Abin3820UitSsPRkrZECmAPLR1TZjpoXqq0 1roJgTpssPW4y0qEf0xUW0HJM8VGB1vGJICSeuhb+uXXNx+2JiC5hSnuAcKaEc0DuTxz9W fJV/xGivk8nspLkNXBAE+tia+w/hoeKDTb/VnHSq+Q2HKT+E8ZBClhwWRwt0hw== Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (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 ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E7" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fyVmS67jpz7gP; Sat, 18 Apr 2026 12:04:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 0B138A64805; Sat, 18 Apr 2026 12:04:12 +0000 (UTC) Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (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) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 197C72D029E9; Sat, 18 Apr 2026 12:04:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id ADx2p70qhZ0s; Sat, 18 Apr 2026 12:04:33 +0000 (UTC) Received: from nv.t4-02.sbone.de (nv.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:22]) (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) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 041422D029D8; Sat, 18 Apr 2026 12:04:32 +0000 (UTC) Date: Sat, 18 Apr 2026 12:04:31 +0000 (UTC) From: "Bjoern A. Zeeb" To: Xin LI cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c0d9a07101a1 - main - MFV: zstd 1.5.7. In-Reply-To: <69d6c795.18adf.7af84449@gitrepo.freebsd.org> Message-ID: <12q2q88-nopo-o5o7-2450-s943p46951n@mnoonqbm.arg> References: <69d6c795.18adf.7af84449@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Wed, 8 Apr 2026, Xin LI wrote: > The branch main has been updated by delphij: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c0d9a07101a1e72769ee0619a583f63a078fb391 > > commit c0d9a07101a1e72769ee0619a583f63a078fb391 > Merge: dd201e407e48 7e509d50854e > Author: Xin LI > AuthorDate: 2026-04-08 21:22:45 +0000 > Commit: Xin LI > CommitDate: 2026-04-08 21:22:45 +0000 > > MFV: zstd 1.5.7. > > MFC after: 2 weeks > Relnotes: yes gcc buildworld (not kernel) complains about 310962 /usr/local/bin/x86_64-unknown-freebsd14.3-ld: /obj/freebsd-src/amd64.amd64/tmp/usr/lib/libzpool.so: undefined reference to `ZSTD_XXH64' 310963 /usr/local/bin/x86_64-unknown-freebsd14.3-ld: /obj/freebsd-src/amd64.amd64/tmp/usr/lib/libzpool.so: undefined reference to `ZSTD_XXH64_digest' 310964 /usr/local/bin/x86_64-unknown-freebsd14.3-ld: /obj/freebsd-src/amd64.amd64/tmp/usr/lib/libzpool.so: undefined reference to `ZSTD_XXH64_reset' 310965 /usr/local/bin/x86_64-unknown-freebsd14.3-ld: /obj/freebsd-src/amd64.amd64/tmp/usr/lib/libzpool.so: undefined reference to `ZSTD_XXH64_update' 310966 /usr/local/bin/x86_64-unknown-freebsd14.3-ld: /obj/freebsd-src/amd64.amd64/tmp/usr/lib/libzpool.so: undefined reference to `ZSTD_isError' Do we need to add them to sys/contrib/zstd/lib/common/xxhash.h or how do we get them exported? -- Bjoern A. Zeeb r15:7 From nobody Sat Apr 18 12:08:21 2026 X-Original-To: dev-commits-src-main@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 4fyVrk0kmxz6ZcFy for ; Sat, 18 Apr 2026 12:08:22 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyVrj4hgPz4L81 for ; Sat, 18 Apr 2026 12:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776514101; 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=uh2Rki4MBUlq+i6q1sZjBpBcO30k+FKomJlk53j642k=; b=DUAgkmvkeaXop6UG2xO1k7w80O8KONGtg5z2bxVn0zpYyjEKbm/vAEfvHNontoeDxqxvIj nJvwBobKilyEVXZcccGoVXWrIGQcGylPUfkqQLFC57rW7pugHLeHpWGs1iSIMGbB7iuePr dbOZuNEoEDQD7f3XTuGyLMoC3wXU25d4pE//oxzrkI8TqD8VtnnTrip48VgyPI8E5b1ZM/ JXU2mhxn8j5MTd1XuYIFG/FEYpuouD4RFWEqdLGhj8BQV/8Kg9hD4eAYaj6VH8BuMjOQBV LONDoPmKhZ1PefhMJ5Em/SMEyJ4RA4xzO5P7cA0QaUQP0T44IUPy6wUKcRdZLA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776514101; a=rsa-sha256; cv=none; b=gZ4DrL4TZTw9yk7x8T6GHHFUqjHYJgMmAqcvlxc2QoAtDZtDjm1/KWqexNtT5JLZ0YTSnu OAPX3Oeg1gK0pNbX+OwyRzYujy+TNnoJ2J4eORIgrDCvy/ez447Niryq3saoHke1t2QFgl So3GF6gD0OmWBidSwI2PG1bdYBve/3Ovq+Kay4rOJH4zftBwxxfTOXdzCaxs4LiyymTJaN yJV+TnY8x0sl3fjKGEsFbf1JqI6zl4k3+Kk5vN7uxOpgMpswa0M5gwxqkzbZXBuedmtZ/x toy20DkEiPk33Otf5UCNR9WLHas1F4hKrq5ondq1rfYXl0XZyDOb3DmGfZxk/g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776514101; 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=uh2Rki4MBUlq+i6q1sZjBpBcO30k+FKomJlk53j642k=; b=oe5hX1hgFa5QFx4BCGutYMO5UKbrZ3PBSyy6FbiOLKnM/6ERYU3zLmd5lGUcmYURlQeW0w NZD83q3n9TAFJ/6bPxLC/icZOmf2uzNInXJR0Z8t4KNXsMyB8cQRe9Ylbm8K7mO6vrcrYI aapDZhDZSTCdZvtwQ0HkgzVlRVE/lYFVv2++vBHeGharIfHI6Ig6+kTwj/lr8FgwGensqe 1qvM42smmkWDYzVSbQuqRsKMr2+u5DkOAI6oyp4Ogjd353r4Mss/qpvcRWPmjFSOytuyXR LQa+Cg4Jq1WPZ3V9NFF4wx7gFc+ayKI2T+vz55CtCL5YLRwGwgr0EknvSQQROA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyVrj3dCxzg7s for ; Sat, 18 Apr 2026 12:08:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b47e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 12:08:21 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: ba94d7574972 - main - stand/common/load_elf: Do kernel module relocations for PPC List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba94d75749721fae999f756cb227638f9d4398a8 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 12:08:21 +0000 Message-Id: <69e37435.3b47e.5048e12@gitrepo.freebsd.org> The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=ba94d75749721fae999f756cb227638f9d4398a8 commit ba94d75749721fae999f756cb227638f9d4398a8 Author: Lexi Winter AuthorDate: 2026-04-18 12:07:10 +0000 Commit: Lexi Winter CommitDate: 2026-04-18 12:07:10 +0000 stand/common/load_elf: Do kernel module relocations for PPC reloc_ptr() skips relocations for the kernel module, because on most platforms the kernel is ET_EXEC and this is not required. On PPC, the kernel is ET_DYN and we need to relocate here, otherwise the module metadata will not be loaded properly and the kernel module will have an incorrect version, preventing module dependencies from resolving. This fixes loading kernel modules from loader.conf on powerpc. Diagnosed by: jrtc27 Reviewed by: jrtc27, adrian Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D56457 --- stand/common/load_elf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c index 10131f7ccb88..a6ea60c74b84 100644 --- a/stand/common/load_elf.c +++ b/stand/common/load_elf.c @@ -1282,10 +1282,11 @@ __elfN(reloc_ptr)(struct preloaded_file *mp, elf_file_t ef, int error; /* - * The kernel is already relocated, but we still want to apply - * offset adjustments. + * On most platforms, the kernel is already relocated, but we still + * want to apply offset adjustments. For PowerPC, the kernel is + * ET_DYN rather than ET_EXEC and we still need to relocate here. */ - if (ef->kernel) + if (ef->kernel && ef->ehdr->e_type != ET_DYN) return (EOPNOTSUPP); for (n = 0; n < ef->relsz / sizeof(r); n++) { From nobody Sat Apr 18 12:32:26 2026 X-Original-To: dev-commits-src-main@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 4fyWNV5yWPz6ZfcJ for ; Sat, 18 Apr 2026 12:32:26 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyWNV2whtz4Nc0 for ; Sat, 18 Apr 2026 12:32:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776515546; 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=DP9oagxwbn3UNddH9WcrKTeuOZEazWlP6stI57zgL8o=; b=DBH/z5X2eKazPC+cu8+i96NAsn/mux1CC/fDEEvYXC4m9FxHZCpTvnTfFZ4PZ9rgCpIs0D eVywlznFq8lgiug1U+4PdHgHfZiUWxu0uKYjxLn+tDB5TpVVXtPIyQi3Q1+WXk02KfY6Jn 0fbxlDWsEOkaLRTpKmOswBXOTyFx/wqM5fPILwIh2BkOhfiR6Ko5Y8y3aqL3mSQYRA+Gl4 y1d0+p2ugs+7jCVt53mqcWTpqlA4vSSp2D1THQ2gwB239U+mJmdo0HGvlWWVRVEC0s0z4l kEk4pnO+QaGSnzv9DU4Q3g9PvLLZ8cQWeokHyNImI3sDln3RyQc5hb3uTbSDPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776515546; a=rsa-sha256; cv=none; b=mTTWnzMnFLEsJOrRmd6adJzLUAUNEIemOHJd5Y1I+za+Qj75FMNiC8E1+SMYwNn48I/wgY gIAPKPQu/3uQWmiEDMrq6JaRM7/4uUT3OOVQ1WBjJEgB7SsK+qAavzs8OvImkR+Fd/tfj9 MSkV9lgcZzJL1d20WzV3rHkemoSZAAaw4L2j/Hv1I3ZMbyTGQGcqP4N5z6qIQgYhssFoOf KVrjz1E3rV44LkfFqUIl+aPpYHMLfy+HU5tsQvdpjIfDny4AavivrI0509rRceO264Yi0z Rpt0MVRjS78RfDbWIOV+7ZGv99smQzA43BIXcw70A6KjMCadm9uEdj16bQrBfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776515546; 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=DP9oagxwbn3UNddH9WcrKTeuOZEazWlP6stI57zgL8o=; b=LwvIy4WUtj4o5X6hdo+IVmq8axrfKlwBgDwIoOEBDIUgN85zxvYLqXCboZW0WvWwPeHeVX tBSp5ZebqSQBwfyJXc71oYZYoltFwCtpGPnt64o7OKfRTUsOkXOD2blQ060JgtqEyAH34K muXGrDySL0d2xq5nn1vJpdie4wU24k3gMpXP5NHA8eVFCBYLH1pcq3UdNSf4x1UxL+GCSI voKuQ5Qrr8zzIdY0kXW1kEZPsbw3vTNkpkwdjoyIUCW62BdwLbRQE/hqcPRKKINkmDhI2s /u4VCXpR9HqoRHPbKxmObzUgcuYxz6WZDodo/PWGVHaIcDX2Y7Hbgr1g2t2tNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyWNV2TD4zgG8 for ; Sat, 18 Apr 2026 12:32:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e95f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 12:32:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 2b264cb802b9 - main - routing: Initialize V_rt_numfibs earlier during boot List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b264cb802b9b45306b1f3dfd3e9d4edfb23b2f6 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 12:32:26 +0000 Message-Id: <69e379da.3e95f.60e70da7@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2b264cb802b9b45306b1f3dfd3e9d4edfb23b2f6 commit 2b264cb802b9b45306b1f3dfd3e9d4edfb23b2f6 Author: Mark Johnston AuthorDate: 2026-04-18 12:20:00 +0000 Commit: Mark Johnston CommitDate: 2026-04-18 12:26:16 +0000 routing: Initialize V_rt_numfibs earlier during boot V_rt_numfibs can be set at compile time (with the ROUTETABLES kernel config option) or boot time (with the net.fibs tunable). vnet_rtables_init(), running during SI_PROTO_DOMAIN, was checking the tunable and updating V_rt_numfibs accordingly, but that means that earlier SYSINITs, such as vnet_mroute_init(), see the compile-time value for V_rt_numfibs before it gets corrected in vnet_rtables_init(). Fix this by initializing V_rt_numfibs earlier, so that SYSINITs are less likely to use the wrong value. Add a comment describing the weird, preexisting semantic of resetting rt_numfibs to 1 in VNET jails. PR: 294510 Reviewed by: glebius, zlei, pouria MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56473 --- sys/net/route/route_tables.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/sys/net/route/route_tables.c b/sys/net/route/route_tables.c index 571f1db9c40d..0a865079f6f2 100644 --- a/sys/net/route/route_tables.c +++ b/sys/net/route/route_tables.c @@ -83,7 +83,7 @@ VNET_DEFINE_STATIC(struct sx, rtables_lock); VNET_DEFINE_STATIC(struct rib_head **, rt_tables); #define V_rt_tables VNET(rt_tables) -VNET_DEFINE(uint32_t, _rt_numfibs) = RT_NUMFIBS; +VNET_DEFINE(uint32_t, _rt_numfibs) = 1; /* * Handler for net.my_fibnum. @@ -290,17 +290,25 @@ grow_rtables(uint32_t num_tables) } static void -vnet_rtables_init(const void *unused __unused) +rtnumfibs_init(const void *unused __unused) { int num_rtables_base; - if (IS_DEFAULT_VNET(curvnet)) { - num_rtables_base = RT_NUMFIBS; - TUNABLE_INT_FETCH("net.fibs", &num_rtables_base); - V_rt_numfibs = normalize_num_rtables(num_rtables_base); - } else - V_rt_numfibs = 1; + /* + * Set the number of FIBs based on compile-time and boot-time settings. + * For some reason, VNET jails do not inherit this parameter, so they + * must set net.fibs manually. + */ + num_rtables_base = RT_NUMFIBS; + TUNABLE_INT_FETCH("net.fibs", &num_rtables_base); + V_rt_numfibs = normalize_num_rtables(num_rtables_base); +} +SYSINIT(rtnumfibs_init, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, rtnumfibs_init, + NULL); +static void +vnet_rtables_init(const void *unused __unused) +{ vnet_rtzone_init(); #ifdef FIB_ALGO vnet_fib_init(); From nobody Sat Apr 18 12:32:27 2026 X-Original-To: dev-commits-src-main@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 4fyWNW5pn4z6ZfQD for ; Sat, 18 Apr 2026 12:32: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyWNW3dk9z4NhP for ; Sat, 18 Apr 2026 12:32:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776515547; 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=JCMvxJPh/w/wvuwHOMC6+Dhh5KFexSfpQRt12gWQTeA=; b=oEL39DVTdtrNoxNfDXFBGSmIWwg+vWnETpfoTWvvxyZDt7Jsm28wjE3HaF5gcYeeCkd03N rY1m8C+ZQSqnX4PPehzUt3p7KVS/fEEwtqp1vIruiqX5FgjWFPLupFfqLeSB/JMhn25s/o Eq935EtFyLGiTWil95qG1iVozTJtWNcPO7eylVxLPccdJQp7lb0n+lqRj8tIxcVx6iVZrA wBzMGAUUzMIfeMlXeRqcy+eIHODAZunLohhWhczEIIYu5crUvjRyXKtqMgUVlb8SoU8DGK NtsQkXE6L6xXsz6ilcZ025WZLMXifXHcKg5rhKGTCU3bh190sqRagW0OcTTgUg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776515547; a=rsa-sha256; cv=none; b=Gu9/Pi34iC7REPXFR6D0ngmn67dF/BcucCcVCyBG5GxSflbXvAySloHwfBATEXKHnB/uqa c2R64lo1doMcUGSVekFIo+ODJlDYcwubcMVjBqZ+f0+DvAqz2f7urye8U0WLb9FJEWoMyG jV1a0wzs8UaXynS4R8tMkxAys2yROGG95IXsB4S/JvZ980wgBsnENnPt5yCeEDDxy8lq0q h87mGFuKsu74d6HflzgVf1XHX6i8Y6cNXOxX6Dq5+ka+8K5XKUjs3F2O8oIQg2xw+cw1Ey MIMoEGnlLXzLRBKYnlvhYJ41TOIXZI/fNEQ8pS+OB7m+ZI21LlypfQByaQsuug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776515547; 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=JCMvxJPh/w/wvuwHOMC6+Dhh5KFexSfpQRt12gWQTeA=; b=C0XELGJZBmjWJmtWWZFiqJB+9HyNn1PIafHbebf9GVW0V4gIuAV3gxJcaeGWeF+tHjw3d+ z/y3Z7kdH5gecySzoXe7K9QR8JF+5i80DSiRRxKjT1aE8GcvQ3ZmuMLe58p1lnRWToycGa uqryI07Y1V/oxMdIVJH0Es2rEOwaG3O3aRfzHEQ8M9sHW7EIwlOp4+PuEz0zgpF9LRT5R/ wJieGlW1Y2lRrojdNy++dSZq74nBQ0ROyKSvGsHmOHFXrZGds0ZbSj9jKqFxhRPv72hddd gDIXsniABD+huyoRSALE8UrEWkAIGKZIJpHn/o3MOirYDfaBfi9NMXowcSaaJw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyWNW397hzgvy for ; Sat, 18 Apr 2026 12:32:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3de3d by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 12:32:27 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 8de0fc10a1c2 - main - routing: Use a better error number in sysctl_fibs() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8de0fc10a1c2d65bdb39eff862266ab1f87902c8 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 12:32:27 +0000 Message-Id: <69e379db.3de3d.3e686782@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8de0fc10a1c2d65bdb39eff862266ab1f87902c8 commit 8de0fc10a1c2d65bdb39eff862266ab1f87902c8 Author: Mark Johnston AuthorDate: 2026-04-18 12:21:22 +0000 Commit: Mark Johnston CommitDate: 2026-04-18 12:26:29 +0000 routing: Use a better error number in sysctl_fibs() ENOTCAPABLE is for capsicum and its use here is inappropriate. In particular, note that syscallret() treats this value specially. Reviewed by: glebius, pouria, zlei MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56481 --- sys/net/route/route_tables.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/route/route_tables.c b/sys/net/route/route_tables.c index 0a865079f6f2..59c7b6c61a93 100644 --- a/sys/net/route/route_tables.c +++ b/sys/net/route/route_tables.c @@ -132,7 +132,7 @@ sysctl_fibs(SYSCTL_HANDLER_ARGS) new_fibs = normalize_num_rtables(new_fibs); if (new_fibs < V_rt_numfibs) - error = ENOTCAPABLE; + error = EINVAL; if (new_fibs > V_rt_numfibs) grow_rtables(new_fibs); } From nobody Sat Apr 18 12:32:28 2026 X-Original-To: dev-commits-src-main@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 4fyWNX6mwWz6ZfL7 for ; Sat, 18 Apr 2026 12:32:28 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyWNX5bg5z4NhQ for ; Sat, 18 Apr 2026 12:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776515548; 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=SWOaJqc1PHE8CjK5vtxPI+qBMJBmr2FqlOGDz5Gnryw=; b=SBwyWoReLGcFUwZgn6RCRl1xuU9MJTN/bZ00PzGjtJH1NG2gsQyuRJ4T2Gh4rj4FCHwFKY dml0dIiNnVOngSLZZR2TbnhujmtOz8YjxS6ti59jUeZnvVA9ShSqttUEAJSIZlenZeAI05 PUiFkPz5NHkWCRp10zwRTOqoXyHfj5KdtxTN1uEkXoLI6R01Sp+/cd6w6iiDCLS/lOFNb4 dBPbTUsN16koZ4XxOkI/mTPWmbcupfg3lttQncGj2OUzQOEYsQXepa8CW8gtOWOo1/iQAV lwWWbWKJhbAMSkTsgYmtd5OkB/TDgGgR2vXiRo/g8A9RGq03vVUREcxAeOMOdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776515548; a=rsa-sha256; cv=none; b=Dmdf07AjQ6pT0eAQpTEvMNxcKGtTg3Uqn6ERPIaP4ehSz2vn1nMYsMU68kobT70wvY0dgX QxWlNyM9ai8MzmLaHgUTR2ZVXxG6eGlz4NGNzb5hN64IHHfaGAj9Dj+kRnSoyNQSUES2gr fy+x6XFw2izM+Of6sHu+fb6k4es12TzgF9+guTrk6xgww2Z+Xwgcmd9eMnguUEqmrgbuw6 Lh+SLXwpVG8b8WqahvkrSl59SHkBNADMI+86i/oEUZUjbx5dTq4WoOJcY9l/XvWGOdo3i3 Zlz/n+GP4uJopSsg//V0ROW/OI6cOqN5nh59uMCmuInKirTlhPmD0R9lsQchqA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776515548; 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=SWOaJqc1PHE8CjK5vtxPI+qBMJBmr2FqlOGDz5Gnryw=; b=F5eVCLcdsokmV+dBiO7R4oaw8EcPT2FXxkOMOK5LAfq3MN7eU74fW7bSwY6FhJnoXTzxLA 17Qy3JAy9qqLez6VU7qR6ndaRC57FVu+lVtGlUs94DntzfWUHpp90WLbv742hPNrwbJeYQ EzDjZIEQhzEnTM4doqJ+gga3H+A06hAycv0twMtm6iYm00TGD83u1mAKzIeBSs4AApUNKv DGuLpHyLERe/6FprOfTCdALgv+8v86Ix8vtkOovqr1F6t+/A67vshTc4cU3H75E4nAJKj6 BLRLdQIwNZQgOZQs7TnDJv4MuBAk8MNyXpV5oTmcMKJK5+cacLZRJrZS1Jtm/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyWNX3ztczh6F for ; Sat, 18 Apr 2026 12:32:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3f305 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 12:32:28 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 9899c8da0c19 - main - gdb: Print a stack trace if a python command raises an error List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9899c8da0c19e66bedf37dd914e13880089877e2 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 12:32:28 +0000 Message-Id: <69e379dc.3f305.1d051370@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9899c8da0c19e66bedf37dd914e13880089877e2 commit 9899c8da0c19e66bedf37dd914e13880089877e2 Author: Mark Johnston AuthorDate: 2026-04-18 12:23:18 +0000 Commit: Mark Johnston CommitDate: 2026-04-18 12:26:29 +0000 gdb: Print a stack trace if a python command raises an error MFC after: 1 week --- sys/tools/kernel-gdb.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/tools/kernel-gdb.py b/sys/tools/kernel-gdb.py index 990bdaf31fda..a8d63fab63cc 100644 --- a/sys/tools/kernel-gdb.py +++ b/sys/tools/kernel-gdb.py @@ -8,6 +8,8 @@ import importlib import os import sys +gdb.set_parameter("python print-stack", "full") + sys.path.append(os.path.join(os.path.dirname(__file__), "gdb")) modules = [ From nobody Sat Apr 18 12:48:11 2026 X-Original-To: dev-commits-src-main@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 4fyWkh0Qz7z6ZgnQ for ; Sat, 18 Apr 2026 12:48:12 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyWkg6RVJz4QNN for ; Sat, 18 Apr 2026 12:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776516491; 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=zBKOc2GULzWsgJKyi0cGCJr2bswSHhlTXMHWYZXrh0Y=; b=c2tSciNuHj3dXxY7700cvmxIbloqiFStQtu6u7vh8yDbLgrpfyktkNkxFwhlI3MednzWv8 bNbVIVttB4Nl+lS52EZj4Kfmm3DzhOUfENY5vHn/mjoZT1iGFFjpON0lLSs5FNuSL/wxoY Lilp8K4AAH51CuxSlwp3w9GWWUYcMxKxOioWNFqmQdApCTLUX61FRGICx1BvWJiJ0fPMvt onp+9efi0Xofj1pn6drD18mMI/yudWApO1oAG3CDfHy0/Op5x57Ik9EydBOvoZLqBVgr9k DSxx3QmU8BQxd8Hd7JdKBBmhe3A1BOHmDt1UBcGEUUaUZ+n7DdBg1tmNIFB2lQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776516491; a=rsa-sha256; cv=none; b=TExiwxq1spyWfhgkmAEoGaUWnJf0uMm7/kKomiPY26a9PG4Rkw716XJiWse0EaeskwGS0I StmffALbK+na1zdmCq2I4+vhz73xZUVu5ccpJ6bYkl7pqQmQdgLUD1wvOOYL18cJgZjpZo D/QioOvyRJQS5wYLJfc0aPeOefjINVj0IbQuha0IR5xm5iwDw7RUBcSKxNOp9cZf2Y/p2k T7vyDZ+EU545cOrMhS0kMTTIqp2tpEz42AaB1ieyUeu8kTLQ1X/JOxLdNGfKALVb4AbTc6 ctE3LZO20CAb5X7BgLv0HA9D+p8RPuygsymkZ3CpNl+YBP1jG77hEdTUMHk4SQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776516491; 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=zBKOc2GULzWsgJKyi0cGCJr2bswSHhlTXMHWYZXrh0Y=; b=Vtx+/9gjNMOrE+1MMy5XL+eLcmSvjkfXwwyzFPXGuZsaz5hAml3lmprX8KQC5usrvFRwFh 2k5ndPCd8AoeCCsmwCXccUWIpv0zLTlq2yGdWvdbm6XcxBu2C3X2motw9d0HaxGvLNOEAc jRBiicFadWPJ5xsbGD4i38pDNqQHVaJ/YR7bHG9Gxq1IyOTKLP5NBMQLdbbSyACHa0B/uX MW+QS04IEghcfIq6ek+WGWvDHTzZeV/KIfQhcqgq4+CDCjmDTvMsnJF+d9zbO/fa3gAzSe pKFSA+SANCj944HBP6QAm84Rp5nzVpQvGbYs8YKI5p2nEjBeKhqb3LT3UI2Rpw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyWkg62RrzhLr for ; Sat, 18 Apr 2026 12:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3fa24 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 12:48:11 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: d618ba314d14 - main - du: Set BLOCKSIZE before running tests List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d618ba314d1452c1cb4360e15ae1c80adac48306 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 12:48:11 +0000 Message-Id: <69e37d8b.3fa24.4766b22@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d618ba314d1452c1cb4360e15ae1c80adac48306 commit d618ba314d1452c1cb4360e15ae1c80adac48306 Author: Dag-Erling Smørgrav AuthorDate: 2026-04-18 12:48:04 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-04-18 12:48:04 +0000 du: Set BLOCKSIZE before running tests Several testcases assume BLOCKSIZE=K, so set it at the top of the script. This fixes an issue where the tests would sometimes fail when run under sudo. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D56476 --- usr.bin/du/tests/du_test.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.bin/du/tests/du_test.sh b/usr.bin/du/tests/du_test.sh index 58ff1c3ecbd8..16accdcb42a1 100755 --- a/usr.bin/du/tests/du_test.sh +++ b/usr.bin/du/tests/du_test.sh @@ -23,6 +23,10 @@ # SUCH DAMAGE. # +# This is the default in a FreeBSD login session, but may be unset if +# run under sudo or in a different environment. +export BLOCKSIZE=K + require_sparse_file_support() { if ! getconf MIN_HOLE_SIZE "$(pwd)"; then From nobody Sat Apr 18 14:12:49 2026 X-Original-To: dev-commits-src-main@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 4fyYcK5bxJz6ZnrW for ; Sat, 18 Apr 2026 14:12:49 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyYcK52TTz3MTS for ; Sat, 18 Apr 2026 14:12:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776521569; 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=JakZGPlgQ2UZR1kM1giK2lhL4AOq4v+LaC3F9uInUFY=; b=Fem3rSVavUtQFfFvY3uqgPTaYXq8jiUb/lHqgw/nqD8s4fQoKKrDyQkzpPEiHEfkusBaR8 nqOJSoZvs8rcb0IowgAD8AQdK2/n9i51pk5W99hMcSoLGVk29mUfj4HYNZZDhtxpgufLgn 9kji+CyHaw4WAcSQrirkfxQaLBbyLyUCYfXa3Oln18kHQKCUbdWevBTt/KKHLexEWWF2zq yX2NwYN1CaVpsZx+0heUDh0QeHoiRbCoxlelbU9yWohhn038TEgoxBYjd/eU5zBTKHpRy9 OTYBK3T13i0IQfbe7F7Q/y8NNNDsJ0TLrq1kCtP2PA7h4dtGz3geGUNqZuZYpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776521569; a=rsa-sha256; cv=none; b=s8wd7kkAHF8jjDA8WxuKw02KwcJRprq+U+MtCfrGk1Y59voIGGJhsbiQDgzfBh9yzbOEeF Y6386EitLOKBr4FxiyVXOXEbSK1InPBpdOGOYQkKsx/FMZ727irxgjH0uT//MbKMigOmCm GePyA3yF512vWM+MRkrDjlcKPcmWyTVWAUVF/AgG1PH59MnwFMlOs3wdyrQSxwxUXXmeZE k5ADZ+j7Xb8F0FwnUrFI3QYqOEEvT+55CxF4hR3M902asmnm8oQaMgrwnQgYuYy72jn44o ZUz3GDAgBCI/oghtgbnT9Y7Zcwm4GXVzEHk/94gYsiXmQJJRuuZkGNXrppioAQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776521569; 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=JakZGPlgQ2UZR1kM1giK2lhL4AOq4v+LaC3F9uInUFY=; b=e1uoHjgifeLK9jOFHVi+OPbaxl4NdVc69CoTbJkhD/KYDlzTlRZxhPmUOkOlNV5WibcD5I BqCTK6CQ930sc8r/wtg8kJJMk9Smat1F5TITNXVUiAfZA54gwBgPcOGfa89lBg/nvm9SXi sFmuoPshUXuBXRjdB9Y24tLXMztuYsa+MKdJ0N2HfOm92YgDzfMxVQBCQDoQp2TlY6s08R 9FhxmWb+WkD5+fRAWyyNYL+MXxgI7Ej9btXgGV+hmgxyJjdO8KKJJdajuIMer5vZOtbikS NVoGen4cO6zQNlcJQQpksxzC59inRXEq2suIAdsB4DY0/RO6h7oWBnG6ZVs81Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyYcK4Yg0zkR3 for ; Sat, 18 Apr 2026 14:12:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2134f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 14:12:49 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav Subject: git: 480ba21efdc7 - main - README: Update and harmonize List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 480ba21efdc7df5d972083e64c88c39357877c0b Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 14:12:49 +0000 Message-Id: <69e39161.2134f.1de2c53c@gitrepo.freebsd.org> The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=480ba21efdc7df5d972083e64c88c39357877c0b commit 480ba21efdc7df5d972083e64c88c39357877c0b Author: Dag-Erling Smørgrav AuthorDate: 2026-04-18 14:12:32 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2026-04-18 14:12:32 +0000 README: Update and harmonize MFC after: 1 week Reviewed by: imp, markj, jhb Differential Revision: https://reviews.freebsd.org/D56499 --- README.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index bb0c34d39ec4..737afe1566ec 100644 --- a/README.md +++ b/README.md @@ -22,25 +22,26 @@ Source Roadmap: | Directory | Description | | --------- | ----------- | | bin | System/user commands. | -| cddl | Various commands and libraries under the Common Development and Distribution License. | -| contrib | Packages contributed by 3rd parties. | -| crypto | Cryptography stuff (see [crypto/README](crypto/README)). | +| cddl | Source code for third-party software under the Common Development and Distribution License. | +| contrib | Source code for third-party software. | +| crypto | Source code for cryptographic libraries and commands (see [crypto/README](crypto/README)). | | etc | Template files for /etc. | -| gnu | Commands and libraries under the GNU General Public License (GPL) or Lesser General Public License (LGPL). Please see [gnu/COPYING](gnu/COPYING) and [gnu/COPYING.LIB](gnu/COPYING.LIB) for more information. | +| gnu | Source code for third-party software under the GNU General Public License (GPL) or Lesser General Public License (LGPL). Please see [gnu/COPYING](gnu/COPYING) and [gnu/COPYING.LIB](gnu/COPYING.LIB) for more information. | | include | System include files. | -| kerberos5 | Kerberos5 (Heimdal) package. | +| kerberos5 | Build system for Kerberos 5 (Heimdal). | +| krb5 | Build system for Kerberos 5 (MIT). | | lib | System libraries. | -| libexec | System daemons. | -| release | Release building Makefile & associated tools. | -| rescue | Build system for statically linked /rescue utilities. | +| libexec | System commands intended to be executed by other commands or daemons. | +| release | Makefiles and scripts used for building releases and VM images. | +| rescue | Build system for statically linked /rescue commands. | | sbin | System commands. | -| secure | Cryptographic libraries and commands. | +| secure | Build system for cryptographic libraries and commands (excluding Kerberos). | | share | Shared resources. | | stand | Boot loader sources. | | sys | Kernel sources (see [sys/README.md](sys/README.md)). | | targets | Support for experimental `DIRDEPS_BUILD` | -| tests | Regression tests which can be run by Kyua. See [tests/README](tests/README) for additional information. | -| tools | Utilities for regression testing and miscellaneous tasks. | +| tests | Tests which can be run by Kyua. See [tests/README](tests/README) for additional information. | +| tools | Ancillary utilities and tests (not included in the build). | | usr.bin | User commands. | | usr.sbin | System administration commands. | From nobody Sat Apr 18 14:22:09 2026 X-Original-To: dev-commits-src-main@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 4fyYq56DHMz6Zpvg for ; Sat, 18 Apr 2026 14:22:09 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyYq53D11z3NfR for ; Sat, 18 Apr 2026 14:22:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776522129; 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=xlw8uZOkVhCxNiVIaLfzQvKBsJ6SMuBPdwWVsK5L3Yo=; b=aQ9oitUG59gi1rfDtFmjKy6Rm4O6i/CoFz6zdMeFYXi5B6IzUV5avJqtzSCCnHqCLc4o5c /1nGqFM96EC02bUqamYSRvh4cAZmi3Yp/H0AXtohuaqPsQvNLVb5wup0dSKRmSgKhvgVIk solUjFYkNIUHByMU8pVFvl1EVYqqUpcpBv9n66tcf1oYHYbrsbgo+MfmUDBPgdggXQ5tH0 /fMk4mZWtwUcFmxBnRV1tzI8x/65nAEBp9wtQhxJmXFq08D73DvO3OVOUmDFq9Y2EP/sA1 V9oo0fGBoyxLMOU4xduMb9erZ+pLZ2nkcJW+QYxHYf5nJT6hxyuZ7AyVehQ1Yg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776522129; a=rsa-sha256; cv=none; b=NHghaFYLtBIDFsKSBigbTi6EviFAkTdGavrmHrxyjpBKAErLD+CxkfTMxEjYVOJqudESKN FdVRUtWeUFAAwHuelFNoqmM9FOiSSCIYipl4fZe0QFcO9rKINa9MELqsA7JJOesWLMp++B uqs2HejRV7Y6yu0Mp2uBq9ZYrJqpjxCz+XkHT/9RT3J4b8ON0mjxdhU66ByzHFLAoMR7kd CJBCExVcQVFd9iLpyK1Gb90euaiMkpDOrZNcuohtiwoIXVIPIOdFrGhUrot7QkyB04CRaC 1NASr3RGZPap8Jgv5ranxjTtM0dl1eX0Kb0GGXy8WOilNG1xZRrE30//pH9xtg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776522129; 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=xlw8uZOkVhCxNiVIaLfzQvKBsJ6SMuBPdwWVsK5L3Yo=; b=QNV0AkCBtsSKobk+QJdnPI3dRBiJt/lJ+utHQpcta5Wqaiz3fnohUKg3Z576d5l8MyT4Ga 17wppSNDKk1Wl/WPsy4t5Z0SfRyYcJAl6SvNCKM81k14GKShZeMRi7797ufj0CB5gHaL8B cNXehO8FN+E7FG0ADIhMSdCLSGl0rUyBPKNlVK9WNUtv4kuLHCVA96mRIC+eRAODnznU1h Hnmiy6y/+UOYY3OAtWzUC+lGcNlN4BQDeNBNMN6JaBrcjMUj48/4HuKbXSy9m55RcTNkpD zVYQmtUUj1um+gp7u2Y61zhtWaWEmsqFGQ1zIDosNF+u5Bv5pDleDGryXUAJ/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyYq52n0RzkS4 for ; Sat, 18 Apr 2026 14:22:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22564 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 14:22:09 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 90383181aae9 - main - rtw88: update module Makefile for v7.0 driver version List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90383181aae908d2c696f8d66c19645011b4c388 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 14:22:09 +0000 Message-Id: <69e39391.22564.328a595b@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=90383181aae908d2c696f8d66c19645011b4c388 commit 90383181aae908d2c696f8d66c19645011b4c388 Author: Bjoern A. Zeeb AuthorDate: 2026-04-18 13:40:21 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 14:21:36 +0000 rtw88: update module Makefile for v7.0 driver version Update LINUXKPI_VERSION to reflect that the driver is based on Linux v7.0. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/modules/rtw88/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/rtw88/Makefile b/sys/modules/rtw88/Makefile index 04000dd66e95..1978e2392da9 100644 --- a/sys/modules/rtw88/Makefile +++ b/sys/modules/rtw88/Makefile @@ -90,6 +90,6 @@ CFLAGS+= ${LINUXKPI_INCLUDES} CFLAGS+= -DCONFIG_RTW88_DEBUG CFLAGS+= -DKBUILD_MODNAME='"rtw88"' -CFLAGS+= -DLINUXKPI_VERSION=61900 +CFLAGS+= -DLINUXKPI_VERSION=70000 .include From nobody Sat Apr 18 14:22:08 2026 X-Original-To: dev-commits-src-main@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 4fyYq966s6z6Zpp3 for ; Sat, 18 Apr 2026 14:22:13 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyYq932rlz3NT2 for ; Sat, 18 Apr 2026 14:22:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776522133; 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=/oYzY9FEBr4WWi7HrqwktUw5zhaKRmZYXdJ4YBhvtHo=; b=o25GsGLq65u+GYUlxeKSsE5TtcSEPBcdXVcyu42RKZjoPax/c3WjnFFcS/w8xfxphBySR8 f7KRHU/K1cngXkM5/kP3g/32gzKLOIwVq+4a+SUFuEtJaa1YUcpmlrkQD5XSjb0V93U/Ao B3mqyKzA5/HB8RbW4GU4Iqadem9nqHvlxr+TkWmK5Qr+lFcNcJtALenRBDJpc4EK9lE5Kv qM6Zg5rP/8AJtsnHUDbohpKLcJ80QI5gg/xlWG3ah+iZv7wFtR/9T01i9BwfmsLEFcupIM qVY7MSObuHalA8R+zVfKWkszFuGd7NC+equHskC7H1FqWh7mQQglN6Z3Z1C1Jg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776522133; a=rsa-sha256; cv=none; b=uKyQqohDUEhTP+Vx2unlYOtD8wUPPizsc5MGJdMsFZ/1N/FCxBUt2ztD+6k7DIXqtZC++x zxOm3NeS0+AW+8gAgy7DpC8xM+mfQ6XdDAQcC/3eeYLN8jQipCCrVtQLXnomq8VrhxsQHV VkDWc7j4v6rDI7Zg3HSX/eVwQ+CwPWgM84pEAWn7U1KaU7c73gwidAPX06lcCCoz9M5Tuh JKhPcp7qFk+T0VF6rUHEL/1w6SvxhrvN8i2poxfE5dBR3/96NNlOPSVm1dj3Hzc4C6IShU cOff9FB6t7gAkarFy9qkHM6GzarImgBobRyb+S1cNdof36mrKsaeGKlWRMlf8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776522133; 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=/oYzY9FEBr4WWi7HrqwktUw5zhaKRmZYXdJ4YBhvtHo=; b=lklLOX3OQBljAVTcB+rb6zTvJhhqb0jNz7vM3cggyT2PwHdeQpRcddDvpctXP8JIY2bpJE JpBU3IOglkkmOugtU/xj+x/AIKL59PfELVp48hZthgJ+o8qKATpFT1dzjzc/VKIFC3dFmp uD4fRl8DHw4RsEqQ+rAI2dgs2Oe94akaB/DySoXr7l9if0u9EK7RNINkIYkEIA8JXtTjP3 JrnR4JzqUMLpLlzrcU7VNye+77pBT5rqMra5fyG1ZyKMW4jw/PFfSdkM37M7dVefGnyXDx 0Ve2K0DuAjkEvs9HDZelKlnjsxDgphoOyHep7Pbvb4GbnQDuFDlcflyDa8jlIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyYq92Yp2zkhQ for ; Sat, 18 Apr 2026 14:22:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22a69 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 14:22:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 41b641cc0537 - main - rtw88: update Realtek's rtw88 driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41b641cc0537d1288cc05332bb4c5de3dcb12589 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 14:22:08 +0000 Message-Id: <69e39390.22a69.6427e8b@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=41b641cc0537d1288cc05332bb4c5de3dcb12589 commit 41b641cc0537d1288cc05332bb4c5de3dcb12589 Merge: 480ba21efdc7 29163571ee4d Author: Bjoern A. Zeeb AuthorDate: 2026-04-18 14:21:04 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 14:21:04 +0000 rtw88: update Realtek's rtw88 driver This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ). Sponsored by: The FreeBSD Foundation MFC after: 3 days sys/contrib/dev/rtw88/fw.c | 2 +- sys/contrib/dev/rtw88/main.c | 54 +++++++++++++++++++++++++++------------ sys/contrib/dev/rtw88/main.h | 2 +- sys/contrib/dev/rtw88/phy.c | 20 +++++++++++++++ sys/contrib/dev/rtw88/phy.h | 2 ++ sys/contrib/dev/rtw88/rtw8723cs.c | 2 +- sys/contrib/dev/rtw88/rtw8723ds.c | 2 +- sys/contrib/dev/rtw88/rtw8821cs.c | 2 +- sys/contrib/dev/rtw88/rtw8821cu.c | 2 ++ sys/contrib/dev/rtw88/rtw8822b.c | 3 ++- sys/contrib/dev/rtw88/rtw8822bs.c | 2 +- sys/contrib/dev/rtw88/rtw8822cs.c | 2 +- sys/contrib/dev/rtw88/sdio.c | 6 ++--- sys/contrib/dev/rtw88/sdio.h | 2 +- sys/contrib/dev/rtw88/usb.c | 5 ++-- sys/contrib/dev/rtw88/util.c | 4 +-- 16 files changed, 78 insertions(+), 34 deletions(-) diff --cc sys/contrib/dev/rtw88/fw.c index 5ce4a6bcffb6,000000000000..1574b2422240 mode 100644,000000..100644 --- a/sys/contrib/dev/rtw88/fw.c +++ b/sys/contrib/dev/rtw88/fw.c @@@ -1,2471 -1,0 +1,2471 @@@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause +/* Copyright(c) 2018-2019 Realtek Corporation + */ + +#include + +#include "main.h" +#include "coex.h" +#include "fw.h" +#include "tx.h" +#include "reg.h" +#include "sec.h" +#include "debug.h" +#include "util.h" +#include "wow.h" +#include "ps.h" +#include "phy.h" +#include "mac.h" + +static const struct rtw_hw_reg_desc fw_h2c_regs[] = { + {REG_FWIMR, MASKDWORD, "FWIMR"}, + {REG_FWIMR, BIT_FS_H2CCMD_INT_EN, "FWIMR enable"}, + {REG_FWISR, MASKDWORD, "FWISR"}, + {REG_FWISR, BIT_FS_H2CCMD_INT, "FWISR enable"}, + {REG_HMETFR, BIT_INT_BOX_ALL, "BoxBitMap"}, + {REG_HMEBOX0, MASKDWORD, "MSG 0"}, + {REG_HMEBOX0_EX, MASKDWORD, "MSG_EX 0"}, + {REG_HMEBOX1, MASKDWORD, "MSG 1"}, + {REG_HMEBOX1_EX, MASKDWORD, "MSG_EX 1"}, + {REG_HMEBOX2, MASKDWORD, "MSG 2"}, + {REG_HMEBOX2_EX, MASKDWORD, "MSG_EX 2"}, + {REG_HMEBOX3, MASKDWORD, "MSG 3"}, + {REG_HMEBOX3_EX, MASKDWORD, "MSG_EX 3"}, + {REG_FT1IMR, MASKDWORD, "FT1IMR"}, + {REG_FT1IMR, BIT_FS_H2C_CMD_OK_INT_EN, "FT1IMR enable"}, + {REG_FT1ISR, MASKDWORD, "FT1ISR"}, + {REG_FT1ISR, BIT_FS_H2C_CMD_OK_INT, "FT1ISR enable "}, +}; + +static const struct rtw_hw_reg_desc fw_c2h_regs[] = { + {REG_FWIMR, MASKDWORD, "FWIMR"}, + {REG_FWIMR, BIT_FS_H2CCMD_INT_EN, "CPWM"}, + {REG_FWIMR, BIT_FS_HRCV_INT_EN, "HRECV"}, + {REG_FWISR, MASKDWORD, "FWISR"}, + {REG_FWISR, BIT_FS_H2CCMD_INT, "CPWM"}, + {REG_FWISR, BIT_FS_HRCV_INT, "HRECV"}, + {REG_CPWM, MASKDWORD, "REG_CPWM"}, +}; + +static const struct rtw_hw_reg_desc fw_core_regs[] = { + {REG_ARFR2_V1, MASKDWORD, "EPC"}, + {REG_ARFRH2_V1, MASKDWORD, "BADADDR"}, + {REG_ARFR3_V1, MASKDWORD, "CAUSE"}, + {REG_ARFR3_V1, BIT_EXC_CODE, "ExcCode"}, + {REG_ARFRH3_V1, MASKDWORD, "Status"}, + {REG_ARFR4, MASKDWORD, "SP"}, + {REG_ARFRH4, MASKDWORD, "RA"}, + {REG_FW_DBG6, MASKDWORD, "DBG 6"}, + {REG_FW_DBG7, MASKDWORD, "DBG 7"}, +}; + +static void _rtw_fw_dump_dbg_info(struct rtw_dev *rtwdev, + const struct rtw_hw_reg_desc regs[], u32 size) +{ + const struct rtw_hw_reg_desc *reg; + u32 val; + int i; + + for (i = 0; i < size; i++) { + reg = ®s[i]; + val = rtw_read32_mask(rtwdev, reg->addr, reg->mask); + + rtw_dbg(rtwdev, RTW_DBG_FW, "[%s]addr:0x%x mask:0x%x value:0x%x\n", + reg->desc, reg->addr, reg->mask, val); + } +} + +void rtw_fw_dump_dbg_info(struct rtw_dev *rtwdev) +{ + int i; + + if (!rtw_dbg_is_enabled(rtwdev, RTW_DBG_FW)) + return; + + _rtw_fw_dump_dbg_info(rtwdev, fw_h2c_regs, ARRAY_SIZE(fw_h2c_regs)); + _rtw_fw_dump_dbg_info(rtwdev, fw_c2h_regs, ARRAY_SIZE(fw_c2h_regs)); + for (i = 0 ; i < RTW_DEBUG_DUMP_TIMES; i++) { + rtw_dbg(rtwdev, RTW_DBG_FW, "Firmware Coredump %dth\n", i + 1); + _rtw_fw_dump_dbg_info(rtwdev, fw_core_regs, ARRAY_SIZE(fw_core_regs)); + } +} + +static void rtw_fw_c2h_cmd_handle_ext(struct rtw_dev *rtwdev, + struct sk_buff *skb) +{ + struct rtw_c2h_cmd *c2h; + u8 sub_cmd_id; + + c2h = get_c2h_from_skb(skb); + sub_cmd_id = c2h->payload[0]; + + switch (sub_cmd_id) { + case C2H_CCX_RPT: + rtw_tx_report_handle(rtwdev, skb, C2H_CCX_RPT); + break; + case C2H_SCAN_STATUS_RPT: + rtw_hw_scan_status_report(rtwdev, skb); + break; + case C2H_CHAN_SWITCH: + rtw_hw_scan_chan_switch(rtwdev, skb); + break; + default: + break; + } +} + +static u16 get_max_amsdu_len(u32 bit_rate) +{ + /* lower than ofdm, do not aggregate */ + if (bit_rate < 550) + return 1; + + /* lower than 20M 2ss mcs8, make it small */ + if (bit_rate < 1800) + return 1200; + + /* lower than 40M 2ss mcs9, make it medium */ + if (bit_rate < 4000) + return 2600; + + /* not yet 80M 2ss mcs8/9, make it twice regular packet size */ + if (bit_rate < 7000) + return 3500; + + /* unlimited */ + return 0; +} + +struct rtw_fw_iter_ra_data { + struct rtw_dev *rtwdev; + u8 *payload; + u8 length; +}; + +static void rtw_fw_ra_report_iter(void *data, struct ieee80211_sta *sta) +{ + struct rtw_fw_iter_ra_data *ra_data = data; + struct rtw_c2h_ra_rpt *ra_rpt = (struct rtw_c2h_ra_rpt *)ra_data->payload; + struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv; + u8 mac_id, rate, sgi, bw; + u8 mcs, nss; + u32 bit_rate; + + mac_id = ra_rpt->mac_id; + if (si->mac_id != mac_id) + return; + + si->ra_report.txrate.flags = 0; + + rate = u8_get_bits(ra_rpt->rate_sgi, RTW_C2H_RA_RPT_RATE); + sgi = u8_get_bits(ra_rpt->rate_sgi, RTW_C2H_RA_RPT_SGI); + if (ra_data->length >= offsetofend(typeof(*ra_rpt), bw)) + bw = ra_rpt->bw; + else + bw = si->bw_mode; + + if (rate < DESC_RATEMCS0) { + si->ra_report.txrate.legacy = rtw_desc_to_bitrate(rate); + goto legacy; + } + + rtw_desc_to_mcsrate(rate, &mcs, &nss); + if (rate >= DESC_RATEVHT1SS_MCS0) + si->ra_report.txrate.flags |= RATE_INFO_FLAGS_VHT_MCS; + else if (rate >= DESC_RATEMCS0) + si->ra_report.txrate.flags |= RATE_INFO_FLAGS_MCS; + + if (rate >= DESC_RATEMCS0) { + si->ra_report.txrate.mcs = mcs; + si->ra_report.txrate.nss = nss; + } + + if (sgi) + si->ra_report.txrate.flags |= RATE_INFO_FLAGS_SHORT_GI; + + if (bw == RTW_CHANNEL_WIDTH_80) + si->ra_report.txrate.bw = RATE_INFO_BW_80; + else if (bw == RTW_CHANNEL_WIDTH_40) + si->ra_report.txrate.bw = RATE_INFO_BW_40; + else + si->ra_report.txrate.bw = RATE_INFO_BW_20; + +legacy: + bit_rate = cfg80211_calculate_bitrate(&si->ra_report.txrate); + + si->ra_report.desc_rate = rate; + si->ra_report.bit_rate = bit_rate; + + sta->deflink.agg.max_rc_amsdu_len = get_max_amsdu_len(bit_rate); +} + +static void rtw_fw_ra_report_handle(struct rtw_dev *rtwdev, u8 *payload, + u8 length) +{ + struct rtw_c2h_ra_rpt *ra_rpt = (struct rtw_c2h_ra_rpt *)payload; + struct rtw_fw_iter_ra_data ra_data; + + if (WARN(length < rtwdev->chip->c2h_ra_report_size, + "invalid ra report c2h length %d\n", length)) + return; + + rtwdev->dm_info.tx_rate = u8_get_bits(ra_rpt->rate_sgi, + RTW_C2H_RA_RPT_RATE); + ra_data.rtwdev = rtwdev; + ra_data.payload = payload; + ra_data.length = length; + rtw_iterate_stas_atomic(rtwdev, rtw_fw_ra_report_iter, &ra_data); +} + +struct rtw_beacon_filter_iter_data { + struct rtw_dev *rtwdev; + u8 *payload; +}; + +static void rtw_fw_bcn_filter_notify_vif_iter(void *data, + struct ieee80211_vif *vif) +{ + struct rtw_beacon_filter_iter_data *iter_data = data; + struct rtw_dev *rtwdev = iter_data->rtwdev; + u8 *payload = iter_data->payload; + u8 type = GET_BCN_FILTER_NOTIFY_TYPE(payload); + u8 event = GET_BCN_FILTER_NOTIFY_EVENT(payload); + s8 sig = (s8)GET_BCN_FILTER_NOTIFY_RSSI(payload); + + switch (type) { + case BCN_FILTER_NOTIFY_SIGNAL_CHANGE: + event = event ? NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH : + NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW; + ieee80211_cqm_rssi_notify(vif, event, sig, GFP_KERNEL); + break; + case BCN_FILTER_CONNECTION_LOSS: + ieee80211_connection_loss(vif); + break; + case BCN_FILTER_CONNECTED: + rtwdev->beacon_loss = false; + break; + case BCN_FILTER_NOTIFY_BEACON_LOSS: + rtwdev->beacon_loss = true; + rtw_leave_lps(rtwdev); + break; + } +} + +static void rtw_fw_bcn_filter_notify(struct rtw_dev *rtwdev, u8 *payload, + u8 length) +{ + struct rtw_beacon_filter_iter_data dev_iter_data; + + dev_iter_data.rtwdev = rtwdev; + dev_iter_data.payload = payload; + rtw_iterate_vifs(rtwdev, rtw_fw_bcn_filter_notify_vif_iter, + &dev_iter_data); +} + +static void rtw_fw_scan_result(struct rtw_dev *rtwdev, u8 *payload, + u8 length) +{ + struct rtw_dm_info *dm_info = &rtwdev->dm_info; + + dm_info->scan_density = payload[0]; + + rtw_dbg(rtwdev, RTW_DBG_FW, "scan.density = %x\n", + dm_info->scan_density); +} + +static void rtw_fw_adaptivity_result(struct rtw_dev *rtwdev, u8 *payload, + u8 length) +{ + const struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th; + struct rtw_c2h_adaptivity *result = (struct rtw_c2h_adaptivity *)payload; + + rtw_dbg(rtwdev, RTW_DBG_ADAPTIVITY, + "Adaptivity: density %x igi %x l2h_th_init %x l2h %x h2l %x option %x\n", + result->density, result->igi, result->l2h_th_init, result->l2h, + result->h2l, result->option); + + rtw_dbg(rtwdev, RTW_DBG_ADAPTIVITY, "Reg Setting: L2H %x H2L %x\n", + rtw_read32_mask(rtwdev, edcca_th[EDCCA_TH_L2H_IDX].hw_reg.addr, + edcca_th[EDCCA_TH_L2H_IDX].hw_reg.mask), + rtw_read32_mask(rtwdev, edcca_th[EDCCA_TH_H2L_IDX].hw_reg.addr, + edcca_th[EDCCA_TH_H2L_IDX].hw_reg.mask)); + + rtw_dbg(rtwdev, RTW_DBG_ADAPTIVITY, "EDCCA Flag %s\n", + rtw_read32_mask(rtwdev, REG_EDCCA_REPORT, BIT_EDCCA_FLAG) ? + "Set" : "Unset"); +} + +void rtw_fw_c2h_cmd_handle(struct rtw_dev *rtwdev, struct sk_buff *skb) +{ + struct rtw_c2h_cmd *c2h; + u32 pkt_offset; + u8 len; + + pkt_offset = *((u32 *)skb->cb); + c2h = (struct rtw_c2h_cmd *)(skb->data + pkt_offset); + len = skb->len - pkt_offset - 2; + + mutex_lock(&rtwdev->mutex); + + if (!test_bit(RTW_FLAG_RUNNING, rtwdev->flags)) + goto unlock; + + switch (c2h->id) { + case C2H_CCX_TX_RPT: + rtw_tx_report_handle(rtwdev, skb, C2H_CCX_TX_RPT); + break; + case C2H_BT_INFO: + rtw_coex_bt_info_notify(rtwdev, c2h->payload, len); + break; + case C2H_BT_HID_INFO: + rtw_coex_bt_hid_info_notify(rtwdev, c2h->payload, len); + break; + case C2H_WLAN_INFO: + rtw_coex_wl_fwdbginfo_notify(rtwdev, c2h->payload, len); + break; + case C2H_BCN_FILTER_NOTIFY: + rtw_fw_bcn_filter_notify(rtwdev, c2h->payload, len); + break; + case C2H_HALMAC: + rtw_fw_c2h_cmd_handle_ext(rtwdev, skb); + break; + case C2H_RA_RPT: + rtw_fw_ra_report_handle(rtwdev, c2h->payload, len); + break; + case C2H_ADAPTIVITY: + rtw_fw_adaptivity_result(rtwdev, c2h->payload, len); + break; + default: + rtw_dbg(rtwdev, RTW_DBG_FW, "C2H 0x%x isn't handled\n", c2h->id); + break; + } + +unlock: + mutex_unlock(&rtwdev->mutex); +} + +void rtw_fw_c2h_cmd_rx_irqsafe(struct rtw_dev *rtwdev, u32 pkt_offset, + struct sk_buff *skb) +{ + struct rtw_c2h_cmd *c2h; + u8 len; + + c2h = (struct rtw_c2h_cmd *)(skb->data + pkt_offset); + len = skb->len - pkt_offset - 2; + *((u32 *)skb->cb) = pkt_offset; + + rtw_dbg(rtwdev, RTW_DBG_FW, "recv C2H, id=0x%02x, seq=0x%02x, len=%d\n", + c2h->id, c2h->seq, len); + + switch (c2h->id) { + case C2H_BT_MP_INFO: + rtw_coex_info_response(rtwdev, skb); + break; + case C2H_WLAN_RFON: + complete(&rtwdev->lps_leave_check); + dev_kfree_skb_any(skb); + break; + case C2H_SCAN_RESULT: + complete(&rtwdev->fw_scan_density); + rtw_fw_scan_result(rtwdev, c2h->payload, len); + dev_kfree_skb_any(skb); + break; + default: + /* pass offset for further operation */ + *((u32 *)skb->cb) = pkt_offset; + skb_queue_tail(&rtwdev->c2h_queue, skb); + ieee80211_queue_work(rtwdev->hw, &rtwdev->c2h_work); + break; + } +} +EXPORT_SYMBOL(rtw_fw_c2h_cmd_rx_irqsafe); + +void rtw_fw_c2h_cmd_isr(struct rtw_dev *rtwdev) +{ + if (rtw_read8(rtwdev, REG_MCU_TST_CFG) == VAL_FW_TRIGGER) + rtw_fw_recovery(rtwdev); + else + rtw_warn(rtwdev, "unhandled firmware c2h interrupt\n"); +} +EXPORT_SYMBOL(rtw_fw_c2h_cmd_isr); + +static void rtw_fw_send_h2c_command_register(struct rtw_dev *rtwdev, + struct rtw_h2c_register *h2c) +{ + u32 box_reg, box_ex_reg; + u8 box_state, box; + int ret; + + rtw_dbg(rtwdev, RTW_DBG_FW, "send H2C content %08x %08x\n", h2c->w0, + h2c->w1); + + lockdep_assert_held(&rtwdev->mutex); + + box = rtwdev->h2c.last_box_num; + switch (box) { + case 0: + box_reg = REG_HMEBOX0; + box_ex_reg = REG_HMEBOX0_EX; + break; + case 1: + box_reg = REG_HMEBOX1; + box_ex_reg = REG_HMEBOX1_EX; + break; + case 2: + box_reg = REG_HMEBOX2; + box_ex_reg = REG_HMEBOX2_EX; + break; + case 3: + box_reg = REG_HMEBOX3; + box_ex_reg = REG_HMEBOX3_EX; + break; + default: + WARN(1, "invalid h2c mail box number\n"); + return; + } + + ret = read_poll_timeout_atomic(rtw_read8, box_state, + !((box_state >> box) & 0x1), 100, 3000, + false, rtwdev, REG_HMETFR); + + if (ret) { + rtw_err(rtwdev, "failed to send h2c command\n"); + rtw_fw_dump_dbg_info(rtwdev); + return; + } + + rtw_write32(rtwdev, box_ex_reg, h2c->w1); + rtw_write32(rtwdev, box_reg, h2c->w0); + + if (++rtwdev->h2c.last_box_num >= 4) + rtwdev->h2c.last_box_num = 0; +} + +static void rtw_fw_send_h2c_command(struct rtw_dev *rtwdev, + u8 *h2c) +{ + struct rtw_h2c_cmd *h2c_cmd = (struct rtw_h2c_cmd *)h2c; + u8 box; + u8 box_state; + u32 box_reg, box_ex_reg; + int ret; + + rtw_dbg(rtwdev, RTW_DBG_FW, + "send H2C content %02x%02x%02x%02x %02x%02x%02x%02x\n", + h2c[3], h2c[2], h2c[1], h2c[0], + h2c[7], h2c[6], h2c[5], h2c[4]); + + lockdep_assert_held(&rtwdev->mutex); + + box = rtwdev->h2c.last_box_num; + switch (box) { + case 0: + box_reg = REG_HMEBOX0; + box_ex_reg = REG_HMEBOX0_EX; + break; + case 1: + box_reg = REG_HMEBOX1; + box_ex_reg = REG_HMEBOX1_EX; + break; + case 2: + box_reg = REG_HMEBOX2; + box_ex_reg = REG_HMEBOX2_EX; + break; + case 3: + box_reg = REG_HMEBOX3; + box_ex_reg = REG_HMEBOX3_EX; + break; + default: + WARN(1, "invalid h2c mail box number\n"); + return; + } + + ret = read_poll_timeout_atomic(rtw_read8, box_state, + !((box_state >> box) & 0x1), 100, 3000, + false, rtwdev, REG_HMETFR); + + if (ret) { + rtw_err(rtwdev, "failed to send h2c command\n"); + return; + } + + rtw_write32(rtwdev, box_ex_reg, le32_to_cpu(h2c_cmd->msg_ext)); + rtw_write32(rtwdev, box_reg, le32_to_cpu(h2c_cmd->msg)); + + if (++rtwdev->h2c.last_box_num >= 4) + rtwdev->h2c.last_box_num = 0; +} + +void rtw_fw_h2c_cmd_dbg(struct rtw_dev *rtwdev, u8 *h2c) +{ + rtw_fw_send_h2c_command(rtwdev, h2c); +} + +static void rtw_fw_send_h2c_packet(struct rtw_dev *rtwdev, u8 *h2c_pkt) +{ + int ret; + + lockdep_assert_held(&rtwdev->mutex); + + FW_OFFLOAD_H2C_SET_SEQ_NUM(h2c_pkt, rtwdev->h2c.seq); + ret = rtw_hci_write_data_h2c(rtwdev, h2c_pkt, H2C_PKT_SIZE); + if (ret) + rtw_err(rtwdev, "failed to send h2c packet\n"); + rtwdev->h2c.seq++; +} + +void +rtw_fw_send_general_info(struct rtw_dev *rtwdev) +{ + struct rtw_fifo_conf *fifo = &rtwdev->fifo; + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + u16 total_size = H2C_PKT_HDR_SIZE + 4; + + if (rtw_chip_wcpu_8051(rtwdev)) + return; + + rtw_h2c_pkt_set_header(h2c_pkt, H2C_PKT_GENERAL_INFO); + + SET_PKT_H2C_TOTAL_LEN(h2c_pkt, total_size); + + GENERAL_INFO_SET_FW_TX_BOUNDARY(h2c_pkt, + fifo->rsvd_fw_txbuf_addr - + fifo->rsvd_boundary); + + rtw_fw_send_h2c_packet(rtwdev, h2c_pkt); +} + +void +rtw_fw_send_phydm_info(struct rtw_dev *rtwdev) +{ + struct rtw_hal *hal = &rtwdev->hal; + struct rtw_efuse *efuse = &rtwdev->efuse; + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + u16 total_size = H2C_PKT_HDR_SIZE + 8; + u8 fw_rf_type = 0; + + if (rtw_chip_wcpu_8051(rtwdev)) + return; + + if (hal->rf_type == RF_1T1R) + fw_rf_type = FW_RF_1T1R; + else if (hal->rf_type == RF_2T2R) + fw_rf_type = FW_RF_2T2R; + + rtw_h2c_pkt_set_header(h2c_pkt, H2C_PKT_PHYDM_INFO); + + SET_PKT_H2C_TOTAL_LEN(h2c_pkt, total_size); + PHYDM_INFO_SET_REF_TYPE(h2c_pkt, efuse->rfe_option); + PHYDM_INFO_SET_RF_TYPE(h2c_pkt, fw_rf_type); + PHYDM_INFO_SET_CUT_VER(h2c_pkt, hal->cut_version); + PHYDM_INFO_SET_RX_ANT_STATUS(h2c_pkt, hal->antenna_tx); + PHYDM_INFO_SET_TX_ANT_STATUS(h2c_pkt, hal->antenna_rx); + + rtw_fw_send_h2c_packet(rtwdev, h2c_pkt); +} + +void rtw_fw_do_iqk(struct rtw_dev *rtwdev, struct rtw_iqk_para *para) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + u16 total_size = H2C_PKT_HDR_SIZE + 1; + + rtw_h2c_pkt_set_header(h2c_pkt, H2C_PKT_IQK); + SET_PKT_H2C_TOTAL_LEN(h2c_pkt, total_size); + IQK_SET_CLEAR(h2c_pkt, para->clear); + IQK_SET_SEGMENT_IQK(h2c_pkt, para->segment_iqk); + + rtw_fw_send_h2c_packet(rtwdev, h2c_pkt); +} +EXPORT_SYMBOL(rtw_fw_do_iqk); + +void rtw_fw_inform_rfk_status(struct rtw_dev *rtwdev, bool start) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_WIFI_CALIBRATION); + + RFK_SET_INFORM_START(h2c_pkt, start); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} +EXPORT_SYMBOL(rtw_fw_inform_rfk_status); + +void rtw_fw_query_bt_info(struct rtw_dev *rtwdev) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_QUERY_BT_INFO); + + SET_QUERY_BT_INFO(h2c_pkt, true); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_default_port(struct rtw_dev *rtwdev, struct rtw_vif *rtwvif) +{ + struct rtw_h2c_register h2c = {}; + + if (rtwvif->net_type != RTW_NET_MGD_LINKED) + return; + + /* Leave LPS before default port H2C so FW timer is correct */ + rtw_leave_lps(rtwdev); + + h2c.w0 = u32_encode_bits(H2C_CMD_DEFAULT_PORT, RTW_H2C_W0_CMDID) | + u32_encode_bits(rtwvif->port, RTW_H2C_DEFAULT_PORT_W0_PORTID) | + u32_encode_bits(rtwvif->mac_id, RTW_H2C_DEFAULT_PORT_W0_MACID); + + rtw_fw_send_h2c_command_register(rtwdev, &h2c); +} + +void rtw_fw_wl_ch_info(struct rtw_dev *rtwdev, u8 link, u8 ch, u8 bw) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_WL_CH_INFO); + + SET_WL_CH_INFO_LINK(h2c_pkt, link); + SET_WL_CH_INFO_CHNL(h2c_pkt, ch); + SET_WL_CH_INFO_BW(h2c_pkt, bw); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_query_bt_mp_info(struct rtw_dev *rtwdev, + struct rtw_coex_info_req *req) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_QUERY_BT_MP_INFO); + + SET_BT_MP_INFO_SEQ(h2c_pkt, req->seq); + SET_BT_MP_INFO_OP_CODE(h2c_pkt, req->op_code); + SET_BT_MP_INFO_PARA1(h2c_pkt, req->para1); + SET_BT_MP_INFO_PARA2(h2c_pkt, req->para2); + SET_BT_MP_INFO_PARA3(h2c_pkt, req->para3); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_force_bt_tx_power(struct rtw_dev *rtwdev, u8 bt_pwr_dec_lvl) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + u8 index = 0 - bt_pwr_dec_lvl; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_FORCE_BT_TX_POWER); + + SET_BT_TX_POWER_INDEX(h2c_pkt, index); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_bt_ignore_wlan_action(struct rtw_dev *rtwdev, bool enable) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_IGNORE_WLAN_ACTION); + + SET_IGNORE_WLAN_ACTION_EN(h2c_pkt, enable); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_coex_tdma_type(struct rtw_dev *rtwdev, + u8 para1, u8 para2, u8 para3, u8 para4, u8 para5) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_COEX_TDMA_TYPE); + + SET_COEX_TDMA_TYPE_PARA1(h2c_pkt, para1); + SET_COEX_TDMA_TYPE_PARA2(h2c_pkt, para2); + SET_COEX_TDMA_TYPE_PARA3(h2c_pkt, para3); + SET_COEX_TDMA_TYPE_PARA4(h2c_pkt, para4); + SET_COEX_TDMA_TYPE_PARA5(h2c_pkt, para5); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_coex_query_hid_info(struct rtw_dev *rtwdev, u8 sub_id, u8 data) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_QUERY_BT_HID_INFO); + + SET_COEX_QUERY_HID_INFO_SUBID(h2c_pkt, sub_id); + SET_COEX_QUERY_HID_INFO_DATA1(h2c_pkt, data); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_bt_wifi_control(struct rtw_dev *rtwdev, u8 op_code, u8 *data) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_BT_WIFI_CONTROL); + + SET_BT_WIFI_CONTROL_OP_CODE(h2c_pkt, op_code); + + SET_BT_WIFI_CONTROL_DATA1(h2c_pkt, *data); + SET_BT_WIFI_CONTROL_DATA2(h2c_pkt, *(data + 1)); + SET_BT_WIFI_CONTROL_DATA3(h2c_pkt, *(data + 2)); + SET_BT_WIFI_CONTROL_DATA4(h2c_pkt, *(data + 3)); + SET_BT_WIFI_CONTROL_DATA5(h2c_pkt, *(data + 4)); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_send_rssi_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + u8 rssi = ewma_rssi_read(&si->avg_rssi); + bool stbc_en = si->stbc_en ? true : false; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_RSSI_MONITOR); + + SET_RSSI_INFO_MACID(h2c_pkt, si->mac_id); + SET_RSSI_INFO_RSSI(h2c_pkt, rssi); + SET_RSSI_INFO_STBC(h2c_pkt, stbc_en); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_send_ra_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si, + bool reset_ra_mask) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + bool disable_pt = true; + u32 mask_hi; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_RA_INFO); + + SET_RA_INFO_MACID(h2c_pkt, si->mac_id); + SET_RA_INFO_RATE_ID(h2c_pkt, si->rate_id); + SET_RA_INFO_INIT_RA_LVL(h2c_pkt, si->init_ra_lv); + SET_RA_INFO_SGI_EN(h2c_pkt, si->sgi_enable); + SET_RA_INFO_BW_MODE(h2c_pkt, si->bw_mode); + SET_RA_INFO_LDPC(h2c_pkt, !!si->ldpc_en); + SET_RA_INFO_NO_UPDATE(h2c_pkt, !reset_ra_mask); + SET_RA_INFO_VHT_EN(h2c_pkt, si->vht_enable); + SET_RA_INFO_DIS_PT(h2c_pkt, disable_pt); + SET_RA_INFO_RA_MASK0(h2c_pkt, (si->ra_mask & 0xff)); + SET_RA_INFO_RA_MASK1(h2c_pkt, (si->ra_mask & 0xff00) >> 8); + SET_RA_INFO_RA_MASK2(h2c_pkt, (si->ra_mask & 0xff0000) >> 16); + SET_RA_INFO_RA_MASK3(h2c_pkt, (si->ra_mask & 0xff000000) >> 24); + + si->init_ra_lv = 0; + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); + + if (rtwdev->chip->id != RTW_CHIP_TYPE_8814A) + return; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_RA_INFO_HI); + + mask_hi = si->ra_mask >> 32; + + SET_RA_INFO_RA_MASK0(h2c_pkt, (mask_hi & 0xff)); + SET_RA_INFO_RA_MASK1(h2c_pkt, (mask_hi & 0xff00) >> 8); + SET_RA_INFO_RA_MASK2(h2c_pkt, (mask_hi & 0xff0000) >> 16); + SET_RA_INFO_RA_MASK3(h2c_pkt, (mask_hi & 0xff000000) >> 24); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_media_status_report(struct rtw_dev *rtwdev, u8 mac_id, bool connect) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_MEDIA_STATUS_RPT); + MEDIA_STATUS_RPT_SET_OP_MODE(h2c_pkt, connect); + MEDIA_STATUS_RPT_SET_MACID(h2c_pkt, mac_id); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_update_wl_phy_info(struct rtw_dev *rtwdev) +{ + struct rtw_traffic_stats *stats = &rtwdev->stats; + struct rtw_dm_info *dm_info = &rtwdev->dm_info; + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_WL_PHY_INFO); + SET_WL_PHY_INFO_TX_TP(h2c_pkt, stats->tx_throughput); + SET_WL_PHY_INFO_RX_TP(h2c_pkt, stats->rx_throughput); + SET_WL_PHY_INFO_TX_RATE_DESC(h2c_pkt, dm_info->tx_rate); + SET_WL_PHY_INFO_RX_RATE_DESC(h2c_pkt, dm_info->curr_rx_rate); + SET_WL_PHY_INFO_RX_EVM(h2c_pkt, dm_info->rx_evm_dbm[RF_PATH_A]); + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_beacon_filter_config(struct rtw_dev *rtwdev, bool connect, + struct ieee80211_vif *vif) +{ + struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; + struct ieee80211_sta *sta = ieee80211_find_sta(vif, bss_conf->bssid); + static const u8 rssi_min = 0, rssi_max = 100, rssi_offset = 100; + struct rtw_sta_info *si = + sta ? (struct rtw_sta_info *)sta->drv_priv : NULL; + s32 thold = RTW_DEFAULT_CQM_THOLD; + u32 hyst = RTW_DEFAULT_CQM_HYST; + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + + if (!rtw_fw_feature_check(&rtwdev->fw, FW_FEATURE_BCN_FILTER)) + return; + + if (bss_conf->cqm_rssi_thold) + thold = bss_conf->cqm_rssi_thold; + if (bss_conf->cqm_rssi_hyst) + hyst = bss_conf->cqm_rssi_hyst; + + if (!connect) { + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_BCN_FILTER_OFFLOAD_P1); + SET_BCN_FILTER_OFFLOAD_P1_ENABLE(h2c_pkt, connect); + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); + + return; + } + + if (!si) + return; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_BCN_FILTER_OFFLOAD_P0); + ether_addr_copy(&h2c_pkt[1], bss_conf->bssid); + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); + + memset(h2c_pkt, 0, sizeof(h2c_pkt)); + thold = clamp_t(s32, thold + rssi_offset, rssi_min, rssi_max); + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_BCN_FILTER_OFFLOAD_P1); + SET_BCN_FILTER_OFFLOAD_P1_ENABLE(h2c_pkt, connect); + SET_BCN_FILTER_OFFLOAD_P1_OFFLOAD_MODE(h2c_pkt, + BCN_FILTER_OFFLOAD_MODE_DEFAULT); + SET_BCN_FILTER_OFFLOAD_P1_THRESHOLD(h2c_pkt, thold); + SET_BCN_FILTER_OFFLOAD_P1_BCN_LOSS_CNT(h2c_pkt, BCN_LOSS_CNT); + SET_BCN_FILTER_OFFLOAD_P1_MACID(h2c_pkt, si->mac_id); + SET_BCN_FILTER_OFFLOAD_P1_HYST(h2c_pkt, hyst); + SET_BCN_FILTER_OFFLOAD_P1_BCN_INTERVAL(h2c_pkt, bss_conf->beacon_int); + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_set_pwr_mode(struct rtw_dev *rtwdev) +{ + struct rtw_lps_conf *conf = &rtwdev->lps_conf; + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_SET_PWR_MODE); + + SET_PWR_MODE_SET_MODE(h2c_pkt, conf->mode); + SET_PWR_MODE_SET_RLBM(h2c_pkt, conf->rlbm); + SET_PWR_MODE_SET_SMART_PS(h2c_pkt, conf->smart_ps); + SET_PWR_MODE_SET_AWAKE_INTERVAL(h2c_pkt, conf->awake_interval); + SET_PWR_MODE_SET_PORT_ID(h2c_pkt, conf->port_id); + SET_PWR_MODE_SET_PWR_STATE(h2c_pkt, conf->state); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_set_keep_alive_cmd(struct rtw_dev *rtwdev, bool enable) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + struct rtw_fw_wow_keep_alive_para mode = { + .adopt = true, + .pkt_type = KEEP_ALIVE_NULL_PKT, + .period = 5, + }; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_KEEP_ALIVE); + SET_KEEP_ALIVE_ENABLE(h2c_pkt, enable); + SET_KEEP_ALIVE_ADOPT(h2c_pkt, mode.adopt); + SET_KEEP_ALIVE_PKT_TYPE(h2c_pkt, mode.pkt_type); + SET_KEEP_ALIVE_CHECK_PERIOD(h2c_pkt, mode.period); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_set_disconnect_decision_cmd(struct rtw_dev *rtwdev, bool enable) +{ + struct rtw_wow_param *rtw_wow = &rtwdev->wow; + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + struct rtw_fw_wow_disconnect_para mode = { + .adopt = true, + .period = 30, + .retry_count = 5, + }; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_DISCONNECT_DECISION); + + if (test_bit(RTW_WOW_FLAG_EN_DISCONNECT, rtw_wow->flags)) { + SET_DISCONNECT_DECISION_ENABLE(h2c_pkt, enable); + SET_DISCONNECT_DECISION_ADOPT(h2c_pkt, mode.adopt); + SET_DISCONNECT_DECISION_CHECK_PERIOD(h2c_pkt, mode.period); + SET_DISCONNECT_DECISION_TRY_PKT_NUM(h2c_pkt, mode.retry_count); + } + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_set_wowlan_ctrl_cmd(struct rtw_dev *rtwdev, bool enable) +{ + struct rtw_wow_param *rtw_wow = &rtwdev->wow; + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_WOWLAN); + + SET_WOWLAN_FUNC_ENABLE(h2c_pkt, enable); + if (rtw_wow_mgd_linked(rtwdev)) { + if (test_bit(RTW_WOW_FLAG_EN_MAGIC_PKT, rtw_wow->flags)) + SET_WOWLAN_MAGIC_PKT_ENABLE(h2c_pkt, enable); + if (test_bit(RTW_WOW_FLAG_EN_DISCONNECT, rtw_wow->flags)) + SET_WOWLAN_DEAUTH_WAKEUP_ENABLE(h2c_pkt, enable); + if (test_bit(RTW_WOW_FLAG_EN_REKEY_PKT, rtw_wow->flags)) + SET_WOWLAN_REKEY_WAKEUP_ENABLE(h2c_pkt, enable); + if (rtw_wow->pattern_cnt) + SET_WOWLAN_PATTERN_MATCH_ENABLE(h2c_pkt, enable); + } + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_set_aoac_global_info_cmd(struct rtw_dev *rtwdev, + u8 pairwise_key_enc, + u8 group_key_enc) +{ + u8 h2c_pkt[H2C_PKT_SIZE] = {0}; + + SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_AOAC_GLOBAL_INFO); + + SET_AOAC_GLOBAL_INFO_PAIRWISE_ENC_ALG(h2c_pkt, pairwise_key_enc); + SET_AOAC_GLOBAL_INFO_GROUP_ENC_ALG(h2c_pkt, group_key_enc); + + rtw_fw_send_h2c_command(rtwdev, h2c_pkt); +} + +void rtw_fw_set_remote_wake_ctrl_cmd(struct rtw_dev *rtwdev, bool enable) *** 7865 LINES SKIPPED *** From nobody Sat Apr 18 19:09:57 2026 X-Original-To: dev-commits-src-main@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 4fyhCB0RmVz6WrPl for ; Sat, 18 Apr 2026 19:09:58 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyhC96qgXz42nK for ; Sat, 18 Apr 2026 19:09:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776539398; 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=kjncSr/XxcqsTp7RUGtgJ8RASCr1RiBoRY7/UNJBemU=; b=x+3ToJ9mhjaVwNBPjjcs4iGUuepk2fm87WZCjdDVPzR1QmMNzh/nszKToZw2E0fBV8tEyI Fg8DE3okY/1WvR5BDao9YwFq2skcPyYH79EKrjMwEEjkyCNIiQMrxjvqaIHZpY3qXZGlvn gzDj3OxdjWuP8oLtuoe7HHWAV9j/mseAHWn5NangdOot5Ww7hulCEPRJZmVPBmXmqZp68u YziSRsCCdqVnyuc1hzzSilsfgCnB6NDrf31dw8hbPC0qGkZG2kNuMx82ugMPdychbrrUeC 0lBqO3qdy6wYvhETxpbNzogiYY6nis/e6Q+YBxBQDDXKndcSngBloUIe9+Aefg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776539398; a=rsa-sha256; cv=none; b=sL3HYfKLhkgYeltqVwsO1EGcuMnLWLxMAFyIhD9m2RDlkBY11vWVf8DkhyzO95kvfjOJq0 9LyDF861J2HEyf9Q0cfSGvhAeYygFYP61lCJV9XsODQVYVJ9bzn13G8R1yBRPW31w7LwYc PrKzQmZhinxcj/UqJzmfk7ghBU10nkYv1eTWmcMVmZX+8f5BWB+LRScvsJLoMCCWLxo9pY ixczT2I566IOvgPdFXkD7qMe0pZJRZfQea/BaBz/rxvLMefqsjmAfwPBI7Iv+8zJ63oGBf 9rtAsoAknnAMHOqd3nac+3afv2qmzts66qOqaa275FkSF4EO8Ftv0zPkVmr53w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776539398; 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=kjncSr/XxcqsTp7RUGtgJ8RASCr1RiBoRY7/UNJBemU=; b=k4alMd6QiRclpjPfnnFIf21ftxdPumYa/9tIKdFj3JO1lcHwL3W4EZ8UdjM2CWVIATfWOU iryyYIikfsghr8fgFTnTvEynItkUX3azWcg/R/bmHmfiRnUcOENWuOUK1F+rTsiorj4tXK CPG3LLdb5X2LiwYeT275L6KG2T6O3lj5ydNL01VppCNUNjidCBFZCxAvAeeQf9xu2xfPcE z8F4hztXtKgBQiVv5WfBcJNOXDjOBxl7qnsHJ1qqabwZODOoflXUtqOM22sFshjK2Q+3ht OwM4NqneeDmFrPhkrUo31XGRk3dtrkMZsPjXq6ALUSDL74el/Nxu1BhpMFx2Sw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyhC96L3Szslr for ; Sat, 18 Apr 2026 19:09:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47a27 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 19:09:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Gallatin Subject: git: 29336f1c9d25 - main - tcp: Allocate t_tcpreq_info on demand List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gallatin X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29336f1c9d25c32896620a00a6218c332b37c4b7 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 19:09:57 +0000 Message-Id: <69e3d705.47a27.44829a14@gitrepo.freebsd.org> The branch main has been updated by gallatin: URL: https://cgit.FreeBSD.org/src/commit/?id=29336f1c9d25c32896620a00a6218c332b37c4b7 commit 29336f1c9d25c32896620a00a6218c332b37c4b7 Author: Andrew Gallatin AuthorDate: 2026-04-17 20:01:36 +0000 Commit: Andrew Gallatin CommitDate: 2026-04-18 19:04:05 +0000 tcp: Allocate t_tcpreq_info on demand When TCP_REQUEST_TRK is enabled, the tcb grows by 600 bytes to accommodate the t_tcpreq_info[MAX_TCP_TRK_REQ] array. Even when the option is enabled, not every connection is using this feature. So let's allocate it on-demand, and save 600 bytes in the common case. Sponsored by: Netflix Reviewed by: rrs, tuexen Differential Revision: https://reviews.freebsd.org/D56484 --- sys/netinet/tcp_subr.c | 17 +++++++++++++++++ sys/netinet/tcp_var.h | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 4adc8d859f3e..9844ba176237 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1133,6 +1133,9 @@ tcp_default_fb_fini(struct tcpcb *tp, int tcb_is_purged) MALLOC_DEFINE(M_TCPLOG, "tcplog", "TCP address and flags print buffers"); MALLOC_DEFINE(M_TCPFUNCTIONS, "tcpfunc", "TCP function set memory"); +#ifdef TCP_REQUEST_TRK +MALLOC_DEFINE(M_TCPREQTRK, "tcpreqtrk", "TCP request tracking"); +#endif static struct mtx isn_mtx; @@ -2445,6 +2448,12 @@ tcp_discardcb(struct tcpcb *tp) #ifdef STATS stats_blob_destroy(tp->t_stats); #endif +#ifdef TCP_REQUEST_TRK + if (tp->t_tcpreq_info != NULL) { + free(tp->t_tcpreq_info, M_TCPREQTRK); + tp->t_tcpreq_info = NULL; + } +#endif CC_ALGO(tp) = NULL; if ((m = STAILQ_FIRST(&tp->t_inqueue)) != NULL) { @@ -4890,6 +4899,14 @@ tcp_req_alloc_req_full(struct tcpcb *tp, struct tcp_snd_req *req, uint64_t ts, i struct tcp_sendfile_track *fil; int i, allocated; + /* Allocate the request tracking array on demand */ + if (tp->t_tcpreq_info == NULL) { + tp->t_tcpreq_info = malloc( + sizeof(*tp->t_tcpreq_info) * MAX_TCP_TRK_REQ, + M_TCPREQTRK, M_NOWAIT | M_ZERO); + if (tp->t_tcpreq_info == NULL) + return (NULL); + } /* In case the stack does not check for completions do so now */ tcp_req_check_for_comp(tp, tp->snd_una); /* Check for stale entries */ diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 987bb98c19af..a1b0519ceac3 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -493,7 +493,7 @@ struct tcpcb { uint32_t tcp_hybrid_start; /* Num of times we started hybrid pacing */ uint32_t tcp_hybrid_stop; /* Num of times we stopped hybrid pacing */ uint32_t tcp_hybrid_error; /* Num of times we failed to start hybrid pacing */ - struct tcp_sendfile_track t_tcpreq_info[MAX_TCP_TRK_REQ]; + struct tcp_sendfile_track *t_tcpreq_info; #endif #ifdef TCP_ACCOUNTING uint64_t tcp_cnt_counters[TCP_NUM_CNT_COUNTERS]; From nobody Sat Apr 18 20:04:48 2026 X-Original-To: dev-commits-src-main@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 4fyjQS3Rx8z6ZBk4 for ; Sat, 18 Apr 2026 20:04:48 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyjQS2cLbz3K7s for ; Sat, 18 Apr 2026 20:04:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776542688; 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=WGPb1PJmknBDWS4jXwvPedzr2zwuw9ryXeuWgd5rv84=; b=D5W8FusD5RojncfjnjfU32ZQQbiFQvohx4rFaa8WSvhLhmjFnE0HHbuHMfKH5eJfFO3u/3 nVIanGJgEA3ttrURS2YdKJy//T3BJGSkoSzEZpc3xw4VHDf5RR460RumJPSZ/OK5dTLNUk p7zZ10hHYMj3EqLIofzDyVX6k0D0H4AUwhsBq2jIhkFnF33l41Qc8hXYZgVLGOucTPuGe1 7oZJlsaHaeGrxknfNZobGTijQegkqnEjyMZy/LtyCG+VNVKIu8OkvwLoXugqija91aVaJH 7s0ZP+rOns+ixpEcQr1stYNsKYcc3P6EGi0E6Zcs8aZORGecHjXFfjgqX+/QPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776542688; a=rsa-sha256; cv=none; b=Q7EIb1Lfl7Z/587eysBXHO9RU0Y/G6xfIMti9ju9fJrcMMnslkJuoFRw9YOE+nDSRw/DzD pYhTRcLD1stnACcTy3RwU8xja9O2D/sda6kb/rxBq91pjeVpJ0CoB94Ycm6cn/MEQsRTRP dOaggygFfKzDiB1dNweGOqPro4TVieEHuDXJp25x81nkEO/gEkjzFWZ91ssA1v8fuHVC8V ACbt6RTmoObXlaLAfoHfsbzMiJDkl5nqjFWYbJOwHJiRiCsfARDMjc4g3Z5f22zt5yN1EW mQZ58T1f7yyVAOMBVWM6oaZuFIJOs3MWbfZLQqwiwbpO+Ks6ezZAFWucwEuiPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776542688; 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=WGPb1PJmknBDWS4jXwvPedzr2zwuw9ryXeuWgd5rv84=; b=bRql7bNlJ+Ay9gfaoVVPxehUNMeWRccRrM1i0WZhf8BG4YFw75H2/MsnBiOudav6vy2Oyf 1U0ePGXCx+Kry/HrzRcCz8w+xX4Dlt+mDxhX0lIad7CrTjsGLeQxtSb1mDHW7iYcLPZMJW U3TCOQ9iCsZs+7JEjRHb0BJlGP9rz5ejD6lpOVs1GdFZly3DE6DznmFk56hJTDUoF5n17x +kDeT8I/AQiMJSoIXLlsse2t1551UMyt/2NLqZP0AzE4iXo7ukNZ6AaTf6WQbVIR2viKxf CSHJ1Yr4opIMCLfrskgweEBO4PP0dU4BK9Ucef+MmngYiR7EuqcTZ1U1akxe0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyjQS1hSnztRB for ; Sat, 18 Apr 2026 20:04:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1de4b by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 20:04:48 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: cca22c36c306 - main - iflib: fix book keeping List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cca22c36c306dfabe13b1d1de10e8d27ef3c3bce Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 20:04:48 +0000 Message-Id: <69e3e3e0.1de4b.27131961@gitrepo.freebsd.org> The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=cca22c36c306dfabe13b1d1de10e8d27ef3c3bce commit cca22c36c306dfabe13b1d1de10e8d27ef3c3bce Author: Michael Tuexen AuthorDate: 2026-04-18 19:57:40 +0000 Commit: Michael Tuexen CommitDate: 2026-04-18 19:57:40 +0000 iflib: fix book keeping iflib_txq_drain() returns the number of consumed entries. In the case of TSO, a single entry can contain multiple TCP packets. Reported by: Ricardo Branco, David Wolfskill Reviewed by: gallatin Fixes: 3fade68cfdf9 ("iflib: accurately count bytes/segments for TSO") Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D56509 --- sys/net/iflib.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sys/net/iflib.c b/sys/net/iflib.c index 1fd8d57f4ee9..f16355ab1460 100644 --- a/sys/net/iflib.c +++ b/sys/net/iflib.c @@ -3866,7 +3866,7 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx) if_ctx_t ctx = txq->ift_ctx; if_t ifp = ctx->ifc_ifp; struct mbuf *m, **mp; - int avail, bytes_sent, skipped, count, err, i; + int avail, bytes_sent, consumed, count, err, i; int mcast_sent, pkt_sent, reclaimed; bool do_prefetch, rang, ring; @@ -3906,7 +3906,7 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx) */ if (reclaimed) txq->ift_qstatus = IFLIB_QUEUE_IDLE; - skipped = mcast_sent = bytes_sent = pkt_sent = 0; + consumed = mcast_sent = bytes_sent = pkt_sent = 0; count = MIN(avail, TX_BATCH_SIZE); #ifdef INVARIANTS if (iflib_verbose_debug) @@ -3929,7 +3929,7 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx) * and skip them. */ if (__predict_false(*mp == (struct mbuf *)txq)) { - skipped++; + consumed++; continue; } err = iflib_encap(txq, mp, &bytes_sent, &pkt_sent); @@ -3937,10 +3937,11 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx) /* no room - bail out */ if (err == ENOBUFS) break; - skipped++; + consumed++; /* we can't send this packet - skip it */ continue; } + consumed++; m = *mp; DBG_COUNTER_INC(tx_sent); mcast_sent += !!(m->m_flags & M_MCAST); @@ -3960,9 +3961,9 @@ iflib_txq_drain(struct ifmp_ring *r, uint32_t cidx, uint32_t pidx) if_inc_counter(ifp, IFCOUNTER_OMCASTS, mcast_sent); #ifdef INVARIANTS if (iflib_verbose_debug) - printf("consumed=%d\n", skipped + pkt_sent); + printf("consumed=%d\n", consumed); #endif - return (skipped + pkt_sent); + return (consumed); } static uint32_t From nobody Sat Apr 18 20:16:25 2026 X-Original-To: dev-commits-src-main@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 4fyjgs5bP8z6ZCCQ for ; Sat, 18 Apr 2026 20:16:25 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fyjgs4BJzz3P3C for ; Sat, 18 Apr 2026 20:16:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776543385; 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=EElBw1WSdzSWzsLNqA7PE7RiBofZSzNTs+ks+UIu36s=; b=pdZ4VXie+qCTLCNB+GYB41RhQc2BtEHpakEoTVum2qyQyQr+2NtPIqymScYzaOBFGjZAiS RbGWCeowZDY4T1fEnNz20uKzR+2iiZcwNDKVkeVnGpD4bk140Dr/ml+l4pOUnYWr39pjD7 ypRx34glSaLS1jcH04p0gqwpxvBHm+WVZzezFKjwEUNNcRVIt3D3b1f4wZm4luCkxmQnpn jmzPMAjMNvV+7GpuAWW/auwAVi3zg/fOrhxIPJi15fRKvdtD8oKCzVrNtr2zZVQKtIzFFO L0NKCiBWK87m0/00F6xCEDkmIqYfSTZwsYpo5Gr9EF8uDNtzO13l6zRrVSTHyQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776543385; a=rsa-sha256; cv=none; b=BobyqGhGq0q+QqDZSScsAfstSEp1NodXnyrxKL3Gi6ZWTbVG4volBwSsKaR0+MG7iMg82E zUjCDmTnb9GtPeLcj+IlPdEDESyhVxeraCEpyCSbofuj6pV0Z4bKV/RxiWFWRb5dp4aJn4 Bbwik2gq1/bffKRub5U9QwUr5FyG6iLUOCv0VS0bkG215/GTYcFkAEz/IVoSMhdUfPP/x9 ok2mb3StCb43SQPvkt2PuTUm2o/0uQgVVMTSElL397TF9yQSaZBsvIo5iUTHQy7By/lWM1 fPVdb8L6kzLugcJbuNjeF0ptAEN7QowBmdeIlI0Dq/FAKddMQ/y6yMJMG0PIzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776543385; 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=EElBw1WSdzSWzsLNqA7PE7RiBofZSzNTs+ks+UIu36s=; b=dCD0FlEPgM+fRhF3evye+4/M7rC69o7+mhU6Fu7TwXXjJOqtWD4cmd1hy+HV1d6htriRWE LF/di/UO7yUltk/gQGBvNjxJ2baqe0TtP6TbKnzZeIH4e8YFJ4Ww/wqF98ITGORfZlrFtC u49oDSjWP7AyZpsaAscn+nYBxhG21UQVfrC39aU8EQV5R5LHapa2e5pM2IKXw3izyAhy79 plmaRobFOnLcenudW+jOANtn3wuI7IYAWroawXGN/FUrWky8KaHxCvT21Uv41CR7LiMhvr XYGXtutB6uwAq6zl7UfVaJaWnG4EyvgIf1RkNAUnN/vX9VlcGHXDB+rIQS0MRw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fyjgs3mmXzvsF for ; Sat, 18 Apr 2026 20:16:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 203a7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 20:16:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: aa0bc7cca153 - main - boot1.chrp: Specify --image-base List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa0bc7cca153f67f8becec8a8fb259ff5fd30fd0 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 20:16:25 +0000 Message-Id: <69e3e699.203a7.19cf8c4f@gitrepo.freebsd.org> The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=aa0bc7cca153f67f8becec8a8fb259ff5fd30fd0 commit aa0bc7cca153f67f8becec8a8fb259ff5fd30fd0 Author: Lexi Winter AuthorDate: 2026-04-18 20:07:40 +0000 Commit: Lexi Winter CommitDate: 2026-04-18 20:15:26 +0000 boot1.chrp: Specify --image-base This is required for LLVM 22's ld.lld to avoid a build error: ld.lld: error: section '.text' address (0x38000) is smaller than image base (0x10000000); specify --image-base ld.lld: error: section '.rodata' address (0x3b308) is smaller than image base (0x10000000); specify --image-base ld.lld: error: section '.data' address (0x3b610) is smaller than image base (0x10000000); specify --image-base ld.lld: error: section '.bss' address (0x3f618) is smaller than image base (0x10000000); specify --image-base Use 0x38000 for the image base, which is the address of the lowest (and only) LOAD segment in the file. Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D56459 --- stand/powerpc/boot1.chrp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/powerpc/boot1.chrp/Makefile b/stand/powerpc/boot1.chrp/Makefile index e67414584bc8..a693f775dde8 100644 --- a/stand/powerpc/boot1.chrp/Makefile +++ b/stand/powerpc/boot1.chrp/Makefile @@ -21,7 +21,7 @@ CFLAGS+=-I${LDRSRC} # boot1.elf defined in the HFS template, but sometimes boot1.elf is written # directly to the PReP partition. # -LDFLAGS=-nostdlib -static -Wl,-N -Wl,-Ttext=0x38000 +LDFLAGS=-nostdlib -static -Wl,-N -Wl,-Ttext=0x38000 -Wl,--image-base=0x38000 .PATH: ${SYSDIR}/libkern ${SRCTOP}/lib/libc/powerpc/gen ${.CURDIR} From nobody Sat Apr 18 20:47:14 2026 X-Original-To: dev-commits-src-main@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 4fykMR2XTyz6ZGTm for ; Sat, 18 Apr 2026 20:47:15 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fykMR2GNtz3SfW for ; Sat, 18 Apr 2026 20:47:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776545235; 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=X7Ht1HLium/7Jw9EFNDfvlBzz1WtLHyvMSxVzcWagcU=; b=u74vlCwemhDlXpaw+QPqJ8HihCNp8uIi6IAHAdrha3ODDiGE2zhmArp81oc8r8AxfOE5dY KNWDSAkixqwpN+g8oibva7qk1DRBNLd1FoKDUj2mvc6mk/HEUyP1AtwfQarDgb67YDw4HU 65ANktEbDe2R6Otv13sQqd/CWchUKfl3lvUJA5zmAh/3fqsFq7YMeiMSVSdNwQTos015/i 7pAzfTVb6PD10uUczxjPOXlU1iLwR9ivLPAo92ay2AmmMbr6AulXaaFIEE91pAYB+4EpuB 76i2BG2gjgH2GDdg+QNMqGjhZWoz5MbPwmCqXHY8CYNsB22HLxspTwbEDhg8UA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776545235; a=rsa-sha256; cv=none; b=eRh1TO5LwJmvxe1496XQ+fqfuQplveGvuo9ITp8536+BxvyckTNeAU8c7ELFwSHGRQlBYx ESNJi7GbI8gPjDNn7xCEFf3Y7pqxiqSE07hAKzav62yfWGxRtuZSoY77Gq3OkiJv8Vxhim NFQGsJvyoBcbZ3T5Ftzj5MysrtnMuLZXZirbHxYOP1SpB0ok5qt/qH7Fbqg4JZaSFy1wsn uMuG5f6IGbz+rP5dLtYGLGK2OMlkocP7xq5UXV4fxIGVYvLQcEq0G8Nlx96sEV1mGLJuFC irwKDTMr+0vhdbo83bMdLmvZ8nzEhZI2X5yFfl54BdJS1NmP50catTJh9lMXKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776545235; 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=X7Ht1HLium/7Jw9EFNDfvlBzz1WtLHyvMSxVzcWagcU=; b=baAMFPP4Cvv2bhKm49yyVPb00C9FhdcuwIxQQghyOspEtLLM2vYYOu3BCnunZm1PaBSsra RNfbQO2YUHbsJtthYzBTal2NnWAmQPokBsttWp8rUDVvlm6+zc/573N5oS0fBLOP7pmZmE yV9Nr8A6OjZDIH2bwEqnNKIE+Bh83Aa3LoD6EXUTFIEymmsTssSaC5pAaJFMasJ698qrtd oVomHZ+yQTse0ZePOxwYNa0r0xmjcwoQYyiiVI9GuWqhZ5gdbsUUKHHVdXIZZNKA14BEOq uTMzTrdGDNntdKnbQ9imPOQB3RmRzd80WlbUKJUCqK+wBGSCeZYEKGr3SZZnpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fykMR1rl4zwSG for ; Sat, 18 Apr 2026 20:47:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 218f7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 20:47:14 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: b2bd08185e49 - main - iwlwifi: update Intel's mvm/mld drivers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b2bd08185e4984c70179c195f712cef5a136d21b Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 20:47:14 +0000 Message-Id: <69e3edd2.218f7.48f6ad58@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=b2bd08185e4984c70179c195f712cef5a136d21b commit b2bd08185e4984c70179c195f712cef5a136d21b Merge: aa0bc7cca153 38f28119183e Author: Bjoern A. Zeeb AuthorDate: 2026-04-18 20:35:37 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 20:35:37 +0000 iwlwifi: update Intel's mvm/mld drivers This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ). Sponsored by: The FreeBSD Foundation MFC after: 3 days sys/contrib/dev/iwlwifi/cfg/bz.c | 12 - sys/contrib/dev/iwlwifi/cfg/rf-fm.c | 12 + sys/contrib/dev/iwlwifi/cfg/rf-pe.c | 1 - sys/contrib/dev/iwlwifi/fw/acpi.c | 117 +++++++--- sys/contrib/dev/iwlwifi/fw/api/commands.h | 5 + sys/contrib/dev/iwlwifi/fw/api/mac-cfg.h | 159 ++++++++++++- sys/contrib/dev/iwlwifi/fw/api/nvm-reg.h | 34 ++- sys/contrib/dev/iwlwifi/fw/api/power.h | 2 +- sys/contrib/dev/iwlwifi/fw/api/rs.h | 41 +++- sys/contrib/dev/iwlwifi/fw/api/rx.h | 95 +++++++- sys/contrib/dev/iwlwifi/fw/api/scan.h | 10 + sys/contrib/dev/iwlwifi/fw/dbg.c | 7 +- sys/contrib/dev/iwlwifi/fw/debugfs.c | 3 +- sys/contrib/dev/iwlwifi/fw/file.h | 2 + sys/contrib/dev/iwlwifi/fw/pnvm.c | 4 +- sys/contrib/dev/iwlwifi/fw/regulatory.c | 206 +---------------- sys/contrib/dev/iwlwifi/fw/regulatory.h | 9 +- sys/contrib/dev/iwlwifi/fw/runtime.h | 17 +- sys/contrib/dev/iwlwifi/fw/smem.c | 8 +- sys/contrib/dev/iwlwifi/fw/uefi.c | 72 ++++-- sys/contrib/dev/iwlwifi/fw/uefi.h | 2 +- sys/contrib/dev/iwlwifi/iwl-config.h | 1 - sys/contrib/dev/iwlwifi/iwl-dbg-tlv.c | 6 +- sys/contrib/dev/iwlwifi/iwl-drv.c | 6 +- sys/contrib/dev/iwlwifi/iwl-nvm-parse.c | 24 +- sys/contrib/dev/iwlwifi/iwl-phy-db.c | 15 +- sys/contrib/dev/iwlwifi/iwl-trans.c | 8 +- sys/contrib/dev/iwlwifi/iwl-trans.h | 6 +- sys/contrib/dev/iwlwifi/mld/Makefile | 2 +- sys/contrib/dev/iwlwifi/mld/d3.c | 20 +- sys/contrib/dev/iwlwifi/mld/debugfs.c | 7 +- sys/contrib/dev/iwlwifi/mld/iface.c | 124 ++++++---- sys/contrib/dev/iwlwifi/mld/iface.h | 2 + sys/contrib/dev/iwlwifi/mld/link.c | 2 +- sys/contrib/dev/iwlwifi/mld/low_latency.c | 4 +- sys/contrib/dev/iwlwifi/mld/mac80211.c | 136 +++++++++-- sys/contrib/dev/iwlwifi/mld/mld.c | 4 + sys/contrib/dev/iwlwifi/mld/mld.h | 3 + sys/contrib/dev/iwlwifi/mld/mlo.c | 63 ++++-- sys/contrib/dev/iwlwifi/mld/mlo.h | 5 + sys/contrib/dev/iwlwifi/mld/nan.c | 299 +++++++++++++++++++++++++ sys/contrib/dev/iwlwifi/mld/nan.h | 28 +++ sys/contrib/dev/iwlwifi/mld/notif.c | 20 +- sys/contrib/dev/iwlwifi/mld/notif.h | 1 + sys/contrib/dev/iwlwifi/mld/power.c | 37 ++- sys/contrib/dev/iwlwifi/mld/regulatory.c | 66 +++++- sys/contrib/dev/iwlwifi/mld/rx.c | 142 +++++++++++- sys/contrib/dev/iwlwifi/mld/scan.c | 47 +++- sys/contrib/dev/iwlwifi/mld/scan.h | 9 +- sys/contrib/dev/iwlwifi/mld/sta.c | 13 +- sys/contrib/dev/iwlwifi/mld/time_sync.c | 3 +- sys/contrib/dev/iwlwifi/mld/tlc.c | 85 +++++-- sys/contrib/dev/iwlwifi/mld/tx.c | 11 + sys/contrib/dev/iwlwifi/mvm/d3.c | 65 ++---- sys/contrib/dev/iwlwifi/mvm/debugfs.c | 1 + sys/contrib/dev/iwlwifi/mvm/ftm-initiator.c | 2 +- sys/contrib/dev/iwlwifi/mvm/fw.c | 205 ++++++++++++++++- sys/contrib/dev/iwlwifi/mvm/link.c | 22 -- sys/contrib/dev/iwlwifi/mvm/mac-ctxt.c | 27 ++- sys/contrib/dev/iwlwifi/mvm/mac80211.c | 73 +----- sys/contrib/dev/iwlwifi/mvm/mld-key.c | 6 +- sys/contrib/dev/iwlwifi/mvm/mld-mac.c | 29 --- sys/contrib/dev/iwlwifi/mvm/mld-mac80211.c | 203 +---------------- sys/contrib/dev/iwlwifi/mvm/mld-sta.c | 30 +-- sys/contrib/dev/iwlwifi/mvm/mvm.h | 61 +---- sys/contrib/dev/iwlwifi/mvm/ops.c | 4 +- sys/contrib/dev/iwlwifi/mvm/rxmq.c | 8 - sys/contrib/dev/iwlwifi/mvm/scan.c | 25 +-- sys/contrib/dev/iwlwifi/mvm/sta.c | 3 +- sys/contrib/dev/iwlwifi/mvm/tdls.c | 4 +- sys/contrib/dev/iwlwifi/mvm/time-event.c | 39 +--- sys/contrib/dev/iwlwifi/mvm/time-event.h | 4 +- sys/contrib/dev/iwlwifi/mvm/tx.c | 51 +---- sys/contrib/dev/iwlwifi/mvm/utils.c | 4 - sys/contrib/dev/iwlwifi/pcie/ctxt-info.c | 4 +- sys/contrib/dev/iwlwifi/pcie/gen1_2/internal.h | 5 +- sys/contrib/dev/iwlwifi/pcie/gen1_2/rx.c | 13 +- sys/contrib/dev/iwlwifi/pcie/gen1_2/trans.c | 8 +- sys/contrib/dev/iwlwifi/pcie/gen1_2/tx-gen2.c | 4 +- sys/contrib/dev/iwlwifi/pcie/gen1_2/tx.c | 11 +- 80 files changed, 1828 insertions(+), 1100 deletions(-) diff --cc sys/contrib/dev/iwlwifi/fw/api/rx.h index dbac7de00142,000000000000..3ebf64bbc264 mode 100644,000000..100644 --- a/sys/contrib/dev/iwlwifi/fw/api/rx.h +++ b/sys/contrib/dev/iwlwifi/fw/api/rx.h @@@ -1,1345 -1,0 +1,1432 @@@ +/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ +/* + * Copyright (C) 2012-2014, 2018-2025 Intel Corporation + * Copyright (C) 2013-2015 Intel Mobile Communications GmbH + * Copyright (C) 2015-2017 Intel Deutschland GmbH + */ +#ifndef __iwl_fw_api_rx_h__ +#define __iwl_fw_api_rx_h__ + +/* API for pre-9000 hardware */ + +#define IWL_RX_INFO_PHY_CNT 8 +#define IWL_RX_INFO_ENERGY_ANT_ABC_IDX 1 +#define IWL_RX_INFO_ENERGY_ANT_A_MSK 0x000000ff +#define IWL_RX_INFO_ENERGY_ANT_B_MSK 0x0000ff00 +#define IWL_RX_INFO_ENERGY_ANT_A_POS 0 +#define IWL_RX_INFO_ENERGY_ANT_B_POS 8 +#define IWL_RX_INFO_ENERGY_ANT_C_POS 16 + +enum iwl_mac_context_info { + MAC_CONTEXT_INFO_NONE, + MAC_CONTEXT_INFO_GSCAN, +}; + +/** + * struct iwl_rx_phy_info - phy info + * (REPLY_RX_PHY_CMD = 0xc0) + * @non_cfg_phy_cnt: non configurable DSP phy data byte count + * @cfg_phy_cnt: configurable DSP phy data byte count + * @stat_id: configurable DSP phy data set ID + * @reserved1: reserved + * @system_timestamp: GP2 at on air rise + * @timestamp: TSF at on air rise + * @beacon_time_stamp: beacon at on-air rise + * @phy_flags: general phy flags: band, modulation, ... + * @channel: channel number + * @non_cfg_phy: for various implementations of non_cfg_phy + * @rate_n_flags: RATE_MCS_* + * @byte_count: frame's byte-count + * @frame_time: frame's time on the air, based on byte count and frame rate + * calculation + * @mac_active_msk: what MACs were active when the frame was received + * @mac_context_info: additional info on the context in which the frame was + * received as defined in &enum iwl_mac_context_info + * + * Before each Rx, the device sends this data. It contains PHY information + * about the reception of the packet. + */ +struct iwl_rx_phy_info { + u8 non_cfg_phy_cnt; + u8 cfg_phy_cnt; + u8 stat_id; + u8 reserved1; + __le32 system_timestamp; + __le64 timestamp; + __le32 beacon_time_stamp; + __le16 phy_flags; + __le16 channel; + __le32 non_cfg_phy[IWL_RX_INFO_PHY_CNT]; + __le32 rate_n_flags; + __le32 byte_count; + u8 mac_active_msk; + u8 mac_context_info; + __le16 frame_time; +} __packed; + +/* + * TCP offload Rx assist info + * + * bits 0:3 - reserved + * bits 4:7 - MIC CRC length + * bits 8:12 - MAC header length + * bit 13 - Padding indication + * bit 14 - A-AMSDU indication + * bit 15 - Offload enabled + */ +enum iwl_csum_rx_assist_info { + CSUM_RXA_RESERVED_MASK = 0x000f, + CSUM_RXA_MICSIZE_MASK = 0x00f0, + CSUM_RXA_HEADERLEN_MASK = 0x1f00, + CSUM_RXA_PADD = BIT(13), + CSUM_RXA_AMSDU = BIT(14), + CSUM_RXA_ENA = BIT(15) +}; + +/** + * struct iwl_rx_mpdu_res_start - phy info + * @byte_count: byte count of the frame + * @assist: see &enum iwl_csum_rx_assist_info + */ +struct iwl_rx_mpdu_res_start { + __le16 byte_count; + __le16 assist; +} __packed; /* _RX_MPDU_RES_START_API_S_VER_2 */ + +/** + * enum iwl_rx_phy_flags - to parse %iwl_rx_phy_info phy_flags + * @RX_RES_PHY_FLAGS_BAND_24: true if the packet was received on 2.4 band + * @RX_RES_PHY_FLAGS_MOD_CCK: modulation is CCK + * @RX_RES_PHY_FLAGS_SHORT_PREAMBLE: true if packet's preamble was short + * @RX_RES_PHY_FLAGS_NARROW_BAND: narrow band (<20 MHz) receive + * @RX_RES_PHY_FLAGS_ANTENNA: antenna on which the packet was received + * @RX_RES_PHY_FLAGS_ANTENNA_POS: antenna bit position + * @RX_RES_PHY_FLAGS_AGG: set if the packet was part of an A-MPDU + * @RX_RES_PHY_FLAGS_OFDM_HT: The frame was an HT frame + * @RX_RES_PHY_FLAGS_OFDM_GF: The frame used GF preamble + * @RX_RES_PHY_FLAGS_OFDM_VHT: The frame was a VHT frame + */ +enum iwl_rx_phy_flags { + RX_RES_PHY_FLAGS_BAND_24 = BIT(0), + RX_RES_PHY_FLAGS_MOD_CCK = BIT(1), + RX_RES_PHY_FLAGS_SHORT_PREAMBLE = BIT(2), + RX_RES_PHY_FLAGS_NARROW_BAND = BIT(3), + RX_RES_PHY_FLAGS_ANTENNA = (0x7 << 4), + RX_RES_PHY_FLAGS_ANTENNA_POS = 4, + RX_RES_PHY_FLAGS_AGG = BIT(7), + RX_RES_PHY_FLAGS_OFDM_HT = BIT(8), + RX_RES_PHY_FLAGS_OFDM_GF = BIT(9), + RX_RES_PHY_FLAGS_OFDM_VHT = BIT(10), +}; + +/** + * enum iwl_mvm_rx_status - written by fw for each Rx packet + * @RX_MPDU_RES_STATUS_CRC_OK: CRC is fine + * @RX_MPDU_RES_STATUS_OVERRUN_OK: there was no RXE overflow + * @RX_MPDU_RES_STATUS_SRC_STA_FOUND: station was found + * @RX_MPDU_RES_STATUS_KEY_VALID: key was valid + * @RX_MPDU_RES_STATUS_ICV_OK: ICV is fine, if not, the packet is destroyed + * @RX_MPDU_RES_STATUS_MIC_OK: used for CCM alg only. TKIP MIC is checked + * in the driver. + * @RX_MPDU_RES_STATUS_TTAK_OK: TTAK is fine + * @RX_MPDU_RES_STATUS_MNG_FRAME_REPLAY_ERR: valid for alg = CCM_CMAC or + * alg = CCM only. Checks replay attack for 11w frames. + * @RX_MPDU_RES_STATUS_SEC_NO_ENC: this frame is not encrypted + * @RX_MPDU_RES_STATUS_SEC_WEP_ENC: this frame is encrypted using WEP + * @RX_MPDU_RES_STATUS_SEC_CCM_ENC: this frame is encrypted using CCM + * @RX_MPDU_RES_STATUS_SEC_TKIP_ENC: this frame is encrypted using TKIP + * @RX_MPDU_RES_STATUS_SEC_EXT_ENC: this frame is encrypted using extension + * algorithm + * @RX_MPDU_RES_STATUS_SEC_CMAC_GMAC_ENC: this frame is protected using + * CMAC or GMAC + * @RX_MPDU_RES_STATUS_SEC_ENC_ERR: this frame couldn't be decrypted + * @RX_MPDU_RES_STATUS_SEC_ENC_MSK: bitmask of the encryption algorithm + * @RX_MPDU_RES_STATUS_DEC_DONE: this frame has been successfully decrypted + * @RX_MPDU_RES_STATUS_CSUM_DONE: checksum was done by the hw + * @RX_MPDU_RES_STATUS_CSUM_OK: checksum found no errors + * @RX_MPDU_RES_STATUS_STA_ID_MSK: station ID mask + * @RX_MDPU_RES_STATUS_STA_ID_SHIFT: station ID bit shift + */ +enum iwl_mvm_rx_status { + RX_MPDU_RES_STATUS_CRC_OK = BIT(0), + RX_MPDU_RES_STATUS_OVERRUN_OK = BIT(1), + RX_MPDU_RES_STATUS_SRC_STA_FOUND = BIT(2), + RX_MPDU_RES_STATUS_KEY_VALID = BIT(3), + RX_MPDU_RES_STATUS_ICV_OK = BIT(5), + RX_MPDU_RES_STATUS_MIC_OK = BIT(6), + RX_MPDU_RES_STATUS_TTAK_OK = BIT(7), + RX_MPDU_RES_STATUS_MNG_FRAME_REPLAY_ERR = BIT(7), + RX_MPDU_RES_STATUS_SEC_NO_ENC = (0 << 8), + RX_MPDU_RES_STATUS_SEC_WEP_ENC = (1 << 8), + RX_MPDU_RES_STATUS_SEC_CCM_ENC = (2 << 8), + RX_MPDU_RES_STATUS_SEC_TKIP_ENC = (3 << 8), + RX_MPDU_RES_STATUS_SEC_EXT_ENC = (4 << 8), + RX_MPDU_RES_STATUS_SEC_CMAC_GMAC_ENC = (6 << 8), + RX_MPDU_RES_STATUS_SEC_ENC_ERR = (7 << 8), + RX_MPDU_RES_STATUS_SEC_ENC_MSK = (7 << 8), + RX_MPDU_RES_STATUS_DEC_DONE = BIT(11), + RX_MPDU_RES_STATUS_CSUM_DONE = BIT(16), + RX_MPDU_RES_STATUS_CSUM_OK = BIT(17), + RX_MDPU_RES_STATUS_STA_ID_SHIFT = 24, + RX_MPDU_RES_STATUS_STA_ID_MSK = 0x1f << RX_MDPU_RES_STATUS_STA_ID_SHIFT, +}; + +/* 9000 series API */ +enum iwl_rx_mpdu_mac_flags1 { + IWL_RX_MDPU_MFLG1_ADDRTYPE_MASK = 0x03, + IWL_RX_MPDU_MFLG1_MIC_CRC_LEN_MASK = 0xf0, + /* shift should be 4, but the length is measured in 2-byte + * words, so shifting only by 3 gives a byte result + */ + IWL_RX_MPDU_MFLG1_MIC_CRC_LEN_SHIFT = 3, +}; + +enum iwl_rx_mpdu_mac_flags2 { + /* in 2-byte words */ + IWL_RX_MPDU_MFLG2_HDR_LEN_MASK = 0x1f, + IWL_RX_MPDU_MFLG2_PAD = 0x20, + IWL_RX_MPDU_MFLG2_AMSDU = 0x40, +}; + +enum iwl_rx_mpdu_amsdu_info { + IWL_RX_MPDU_AMSDU_SUBFRAME_IDX_MASK = 0x7f, + IWL_RX_MPDU_AMSDU_LAST_SUBFRAME = 0x80, +}; + +enum iwl_rx_mpdu_mac_phy_band { + /* whether or not this is MAC or LINK depends on the API */ + IWL_RX_MPDU_MAC_PHY_BAND_MAC_MASK = 0x0f, + IWL_RX_MPDU_MAC_PHY_BAND_LINK_MASK = 0x0f, + IWL_RX_MPDU_MAC_PHY_BAND_PHY_MASK = 0x30, + IWL_RX_MPDU_MAC_PHY_BAND_BAND_MASK = 0xc0, +}; + +enum iwl_rx_l3_proto_values { + IWL_RX_L3_TYPE_NONE, + IWL_RX_L3_TYPE_IPV4, + IWL_RX_L3_TYPE_IPV4_FRAG, + IWL_RX_L3_TYPE_IPV6_FRAG, + IWL_RX_L3_TYPE_IPV6, + IWL_RX_L3_TYPE_IPV6_IN_IPV4, + IWL_RX_L3_TYPE_ARP, + IWL_RX_L3_TYPE_EAPOL, +}; + +#define IWL_RX_L3_PROTO_POS 4 + +enum iwl_rx_l3l4_flags { + IWL_RX_L3L4_IP_HDR_CSUM_OK = BIT(0), + IWL_RX_L3L4_TCP_UDP_CSUM_OK = BIT(1), + IWL_RX_L3L4_TCP_FIN_SYN_RST_PSH = BIT(2), + IWL_RX_L3L4_TCP_ACK = BIT(3), + IWL_RX_L3L4_L3_PROTO_MASK = 0xf << IWL_RX_L3_PROTO_POS, + IWL_RX_L3L4_L4_PROTO_MASK = 0xf << 8, + IWL_RX_L3L4_RSS_HASH_MASK = 0xf << 12, +}; + +enum iwl_rx_mpdu_status { + IWL_RX_MPDU_STATUS_CRC_OK = BIT(0), + IWL_RX_MPDU_STATUS_OVERRUN_OK = BIT(1), + IWL_RX_MPDU_STATUS_SRC_STA_FOUND = BIT(2), + IWL_RX_MPDU_STATUS_KEY_VALID = BIT(3), + IWL_RX_MPDU_STATUS_ICV_OK = BIT(5), + IWL_RX_MPDU_STATUS_MIC_OK = BIT(6), + IWL_RX_MPDU_RES_STATUS_TTAK_OK = BIT(7), + /* overlayed since IWL_UCODE_TLV_API_DEPRECATE_TTAK */ + IWL_RX_MPDU_STATUS_REPLAY_ERROR = BIT(7), + IWL_RX_MPDU_STATUS_SEC_MASK = 0x7 << 8, + IWL_RX_MPDU_STATUS_SEC_UNKNOWN = IWL_RX_MPDU_STATUS_SEC_MASK, + IWL_RX_MPDU_STATUS_SEC_NONE = 0x0 << 8, + IWL_RX_MPDU_STATUS_SEC_WEP = 0x1 << 8, + IWL_RX_MPDU_STATUS_SEC_CCM = 0x2 << 8, + IWL_RX_MPDU_STATUS_SEC_TKIP = 0x3 << 8, + IWL_RX_MPDU_STATUS_SEC_EXT_ENC = 0x4 << 8, + IWL_RX_MPDU_STATUS_SEC_GCM = 0x5 << 8, +#if defined(__FreeBSD__) + IWL_RX_MPDU_STATUS_SEC_ENC_ERR = 0x7 << 8, +#endif + IWL_RX_MPDU_STATUS_DECRYPTED = BIT(11), + IWL_RX_MPDU_STATUS_ROBUST_MNG_FRAME = BIT(15), + + IWL_RX_MPDU_STATUS_DUPLICATE = BIT(22), + + IWL_RX_MPDU_STATUS_STA_ID = 0x1f000000, +}; + +#define IWL_RX_REORDER_DATA_INVALID_BAID 0x7f + +enum iwl_rx_mpdu_reorder_data { + IWL_RX_MPDU_REORDER_NSSN_MASK = 0x00000fff, + IWL_RX_MPDU_REORDER_SN_MASK = 0x00fff000, + IWL_RX_MPDU_REORDER_SN_SHIFT = 12, + IWL_RX_MPDU_REORDER_BAID_MASK = 0x7f000000, + IWL_RX_MPDU_REORDER_BAID_SHIFT = 24, + IWL_RX_MPDU_REORDER_BA_OLD_SN = 0x80000000, +}; + +enum iwl_rx_mpdu_phy_info { + IWL_RX_MPDU_PHY_EOF_INDICATION = BIT(0), + IWL_RX_MPDU_PHY_AMPDU = BIT(5), + IWL_RX_MPDU_PHY_AMPDU_TOGGLE = BIT(6), + IWL_RX_MPDU_PHY_SHORT_PREAMBLE = BIT(7), + /* short preamble is only for CCK, for non-CCK overridden by this */ + IWL_RX_MPDU_PHY_NCCK_ADDTL_NTFY = BIT(7), + IWL_RX_MPDU_PHY_TSF_OVERLOAD = BIT(8), +}; + +enum iwl_rx_mpdu_mac_info { + IWL_RX_MPDU_PHY_MAC_INDEX_MASK = 0x0f, + IWL_RX_MPDU_PHY_PHY_INDEX_MASK = 0xf0, +}; + +/* TSF overload low dword */ +enum iwl_rx_phy_he_data0 { + /* info type: HE any */ + IWL_RX_PHY_DATA0_HE_BEAM_CHNG = 0x00000001, + IWL_RX_PHY_DATA0_HE_UPLINK = 0x00000002, + IWL_RX_PHY_DATA0_HE_BSS_COLOR_MASK = 0x000000fc, + IWL_RX_PHY_DATA0_HE_SPATIAL_REUSE_MASK = 0x00000f00, + /* 1 bit reserved */ + IWL_RX_PHY_DATA0_HE_TXOP_DUR_MASK = 0x000fe000, + IWL_RX_PHY_DATA0_HE_LDPC_EXT_SYM = 0x00100000, + IWL_RX_PHY_DATA0_HE_PRE_FEC_PAD_MASK = 0x00600000, + IWL_RX_PHY_DATA0_HE_PE_DISAMBIG = 0x00800000, + IWL_RX_PHY_DATA0_HE_DOPPLER = 0x01000000, + /* 6 bits reserved */ + IWL_RX_PHY_DATA0_HE_DELIM_EOF = 0x80000000, +}; + +/* TSF overload low dword */ +enum iwl_rx_phy_eht_data0 { + /* info type: EHT any */ + IWL_RX_PHY_DATA0_EHT_VALIDATE = BIT(0), + IWL_RX_PHY_DATA0_EHT_UPLINK = BIT(1), + IWL_RX_PHY_DATA0_EHT_BSS_COLOR_MASK = 0x000000fc, + IWL_RX_PHY_DATA0_ETH_SPATIAL_REUSE_MASK = 0x00000f00, + IWL_RX_PHY_DATA0_EHT_PS160 = BIT(12), + IWL_RX_PHY_DATA0_EHT_TXOP_DUR_MASK = 0x000fe000, + IWL_RX_PHY_DATA0_EHT_LDPC_EXT_SYM = BIT(20), + IWL_RX_PHY_DATA0_EHT_PRE_FEC_PAD_MASK = 0x00600000, + IWL_RX_PHY_DATA0_EHT_PE_DISAMBIG = BIT(23), + IWL_RX_PHY_DATA0_EHT_BW320_SLOT = BIT(24), + IWL_RX_PHY_DATA0_EHT_SIGA_CRC_OK = BIT(25), + IWL_RX_PHY_DATA0_EHT_PHY_VER = 0x1c000000, + /* 2 bits reserved */ + IWL_RX_PHY_DATA0_EHT_DELIM_EOF = BIT(31), +}; + +enum iwl_rx_phy_info_type { + IWL_RX_PHY_INFO_TYPE_NONE = 0, + IWL_RX_PHY_INFO_TYPE_CCK = 1, + IWL_RX_PHY_INFO_TYPE_OFDM_LGCY = 2, + IWL_RX_PHY_INFO_TYPE_HT = 3, + IWL_RX_PHY_INFO_TYPE_VHT_SU = 4, + IWL_RX_PHY_INFO_TYPE_VHT_MU = 5, + IWL_RX_PHY_INFO_TYPE_HE_SU = 6, + IWL_RX_PHY_INFO_TYPE_HE_MU = 7, + IWL_RX_PHY_INFO_TYPE_HE_TB = 8, + IWL_RX_PHY_INFO_TYPE_HE_MU_EXT = 9, + IWL_RX_PHY_INFO_TYPE_HE_TB_EXT = 10, + IWL_RX_PHY_INFO_TYPE_EHT_MU = 11, + IWL_RX_PHY_INFO_TYPE_EHT_TB = 12, + IWL_RX_PHY_INFO_TYPE_EHT_MU_EXT = 13, + IWL_RX_PHY_INFO_TYPE_EHT_TB_EXT = 14, +}; + +/* TSF overload high dword */ +enum iwl_rx_phy_common_data1 { + /* + * check this first - if TSF overload is set, + * see &enum iwl_rx_phy_info_type + */ + IWL_RX_PHY_DATA1_INFO_TYPE_MASK = 0xf0000000, + + /* info type: HT/VHT/HE/EHT any */ + IWL_RX_PHY_DATA1_LSIG_LEN_MASK = 0x0fff0000, +}; + +/* TSF overload high dword For HE rates*/ +enum iwl_rx_phy_he_data1 { + /* info type: HE MU/MU-EXT */ + IWL_RX_PHY_DATA1_HE_MU_SIGB_COMPRESSION = 0x00000001, + IWL_RX_PHY_DATA1_HE_MU_SIBG_SYM_OR_USER_NUM_MASK = 0x0000001e, + + /* info type: HE any */ + IWL_RX_PHY_DATA1_HE_LTF_NUM_MASK = 0x000000e0, + IWL_RX_PHY_DATA1_HE_RU_ALLOC_SEC80 = 0x00000100, + /* trigger encoded */ + IWL_RX_PHY_DATA1_HE_RU_ALLOC_MASK = 0x0000fe00, + + /* info type: HE TB/TX-EXT */ + IWL_RX_PHY_DATA1_HE_TB_PILOT_TYPE = 0x00000001, + IWL_RX_PHY_DATA1_HE_TB_LOW_SS_MASK = 0x0000000e, +}; + +/* TSF overload high dword For EHT-MU/TB rates*/ +enum iwl_rx_phy_eht_data1 { + /* info type: EHT-MU */ + IWL_RX_PHY_DATA1_EHT_MU_NUM_SIG_SYM_USIGA2 = 0x0000001f, + /* info type: EHT-TB */ + IWL_RX_PHY_DATA1_EHT_TB_PILOT_TYPE = BIT(0), + IWL_RX_PHY_DATA1_EHT_TB_LOW_SS = 0x0000001e, + + /* info type: EHT any */ + /* number of EHT-LTF symbols 0 - 1 EHT-LTF, 1 - 2 EHT-LTFs, 2 - 4 EHT-LTFs, + * 3 - 6 EHT-LTFs, 4 - 8 EHT-LTFs */ + IWL_RX_PHY_DATA1_EHT_SIG_LTF_NUM = 0x000000e0, + IWL_RX_PHY_DATA1_EHT_RU_ALLOC_B0 = 0x00000100, + IWL_RX_PHY_DATA1_EHT_RU_ALLOC_B1_B7 = 0x0000fe00, +}; + +/* goes into Metadata DW 7 (Qu) or 8 (So or higher) */ +enum iwl_rx_phy_he_data2 { + /* info type: HE MU-EXT */ + /* the a1/a2/... is what the PHY/firmware calls the values */ + IWL_RX_PHY_DATA2_HE_MU_EXT_CH1_RU0 = 0x000000ff, /* a1 */ + IWL_RX_PHY_DATA2_HE_MU_EXT_CH1_RU2 = 0x0000ff00, /* a2 */ + IWL_RX_PHY_DATA2_HE_MU_EXT_CH2_RU0 = 0x00ff0000, /* b1 */ + IWL_RX_PHY_DATA2_HE_MU_EXT_CH2_RU2 = 0xff000000, /* b2 */ + + /* info type: HE TB-EXT */ + IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE1 = 0x0000000f, + IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE2 = 0x000000f0, + IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE3 = 0x00000f00, + IWL_RX_PHY_DATA2_HE_TB_EXT_SPTL_REUSE4 = 0x0000f000, +}; + +/* goes into Metadata DW 8 (Qu) or 7 (So or higher) */ +enum iwl_rx_phy_he_data3 { + /* info type: HE MU-EXT */ + IWL_RX_PHY_DATA3_HE_MU_EXT_CH1_RU1 = 0x000000ff, /* c1 */ + IWL_RX_PHY_DATA3_HE_MU_EXT_CH1_RU3 = 0x0000ff00, /* c2 */ + IWL_RX_PHY_DATA3_HE_MU_EXT_CH2_RU1 = 0x00ff0000, /* d1 */ + IWL_RX_PHY_DATA3_HE_MU_EXT_CH2_RU3 = 0xff000000, /* d2 */ +}; + +/* goes into Metadata DW 4 high 16 bits */ +enum iwl_rx_phy_he_he_data4 { + /* info type: HE MU-EXT */ + IWL_RX_PHY_DATA4_HE_MU_EXT_CH1_CTR_RU = 0x0001, + IWL_RX_PHY_DATA4_HE_MU_EXT_CH2_CTR_RU = 0x0002, + IWL_RX_PHY_DATA4_HE_MU_EXT_CH1_CRC_OK = 0x0004, + IWL_RX_PHY_DATA4_HE_MU_EXT_CH2_CRC_OK = 0x0008, + IWL_RX_PHY_DATA4_HE_MU_EXT_SIGB_MCS_MASK = 0x00f0, + IWL_RX_PHY_DATA4_HE_MU_EXT_SIGB_DCM = 0x0100, + IWL_RX_PHY_DATA4_HE_MU_EXT_PREAMBLE_PUNC_TYPE_MASK = 0x0600, +}; + +/* goes into Metadata DW 8 (Qu has no EHT) */ +enum iwl_rx_phy_eht_data2 { + /* info type: EHT-MU-EXT */ + IWL_RX_PHY_DATA2_EHT_MU_EXT_RU_ALLOC_A1 = 0x000001ff, + IWL_RX_PHY_DATA2_EHT_MU_EXT_RU_ALLOC_A2 = 0x0003fe00, + IWL_RX_PHY_DATA2_EHT_MU_EXT_RU_ALLOC_B1 = 0x07fc0000, + + /* info type: EHT-TB-EXT */ + IWL_RX_PHY_DATA2_EHT_TB_EXT_TRIG_SIGA1 = 0xffffffff, +}; + +/* goes into Metadata DW 7 (Qu has no EHT) */ +enum iwl_rx_phy_eht_data3 { + /* note: low 8 bits cannot be used */ + /* info type: EHT-MU-EXT */ + IWL_RX_PHY_DATA3_EHT_MU_EXT_RU_ALLOC_C1 = 0x0003fe00, + IWL_RX_PHY_DATA3_EHT_MU_EXT_RU_ALLOC_C2 = 0x07fc0000, +}; + +/* goes into Metadata DW 4 */ +enum iwl_rx_phy_eht_data4 { + /* info type: EHT-MU-EXT */ + IWL_RX_PHY_DATA4_EHT_MU_EXT_RU_ALLOC_D1 = 0x000001ff, + IWL_RX_PHY_DATA4_EHT_MU_EXT_RU_ALLOC_D2 = 0x0003fe00, + IWL_RX_PHY_DATA4_EHT_MU_EXT_SIGB_MCS = 0x000c0000, + IWL_RX_PHY_DATA4_EHT_MU_EXT_RU_ALLOC_B2 = 0x1ff00000, +}; + +/* goes into Metadata DW 16 */ +enum iwl_rx_phy_data5 { + /* info type: EHT any */ + IWL_RX_PHY_DATA5_EHT_TYPE_AND_COMP = 0x00000003, + /* info type: EHT-TB */ + IWL_RX_PHY_DATA5_EHT_TB_SPATIAL_REUSE1 = 0x0000003c, + IWL_RX_PHY_DATA5_EHT_TB_SPATIAL_REUSE2 = 0x000003c0, + /* info type: EHT-MU */ + IWL_RX_PHY_DATA5_EHT_MU_PUNC_CH_CODE = 0x0000007c, + IWL_RX_PHY_DATA5_EHT_MU_STA_ID_USR = 0x0003ff80, + IWL_RX_PHY_DATA5_EHT_MU_NUM_USR_NON_OFDMA = 0x001c0000, + IWL_RX_PHY_DATA5_EHT_MU_SPATIAL_CONF_USR_FIELD = 0x0fe00000, +}; + +/** + * struct iwl_rx_mpdu_desc_v1 - RX MPDU descriptor + */ +struct iwl_rx_mpdu_desc_v1 { + /* DW7 - carries rss_hash only when rpa_en == 1 */ + union { + /** + * @rss_hash: RSS hash value + */ + __le32 rss_hash; + + /** + * @phy_data2: depends on info type (see @phy_data1) + */ + __le32 phy_data2; + }; + + /* DW8 - carries filter_match only when rpa_en == 1 */ + union { + /** + * @filter_match: filter match value + */ + __le32 filter_match; + + /** + * @phy_data3: depends on info type (see @phy_data1) + */ + __le32 phy_data3; + }; + + /* DW9 */ + /** + * @rate_n_flags: RX rate/flags encoding + */ + __le32 rate_n_flags; + /* DW10 */ + /** + * @energy_a: energy chain A + */ + u8 energy_a; + /** + * @energy_b: energy chain B + */ + u8 energy_b; + /** + * @channel: channel number + */ + u8 channel; + /** + * @mac_context: MAC context mask + */ + u8 mac_context; + /* DW11 */ + /** + * @gp2_on_air_rise: GP2 timer value on air rise (INA) + */ + __le32 gp2_on_air_rise; + /* DW12 & DW13 */ + union { + /** + * @tsf_on_air_rise: + * TSF value on air rise (INA), only valid if + * %IWL_RX_MPDU_PHY_TSF_OVERLOAD isn't set + */ + __le64 tsf_on_air_rise; + + struct { + /** + * @phy_data0: depends on info_type, see @phy_data1 + */ + __le32 phy_data0; + /** + * @phy_data1: valid only if + * %IWL_RX_MPDU_PHY_TSF_OVERLOAD is set, + * see &enum iwl_rx_phy_common_data1 or + * &enum iwl_rx_phy_he_data1 or + * &enum iwl_rx_phy_eht_data1. + */ + __le32 phy_data1; + }; + }; +} __packed; /* RX_MPDU_RES_START_API_S_VER_4 */ + +/** + * struct iwl_rx_mpdu_desc_v3 - RX MPDU descriptor + */ +struct iwl_rx_mpdu_desc_v3 { + /* DW7 - carries filter_match only when rpa_en == 1 */ + union { + /** + * @filter_match: filter match value + */ + __le32 filter_match; + + /** + * @phy_data3: depends on info type (see @phy_data1) + */ + __le32 phy_data3; + }; + + /* DW8 - carries rss_hash only when rpa_en == 1 */ + union { + /** + * @rss_hash: RSS hash value + */ + __le32 rss_hash; + + /** + * @phy_data2: depends on info type (see @phy_data1) + */ + __le32 phy_data2; + }; + /* DW9 */ + /** + * @partial_hash: 31:0 ip/tcp header hash + * w/o some fields (such as IP SRC addr) + */ + __le32 partial_hash; + /* DW10 */ + /** + * @raw_xsum: raw xsum value + */ + __be16 raw_xsum; + /** + * @reserved_xsum: reserved high bits in the raw checksum + */ + __le16 reserved_xsum; + /* DW11 */ + /** + * @rate_n_flags: RX rate/flags encoding + */ + __le32 rate_n_flags; + /* DW12 */ + /** + * @energy_a: energy chain A + */ + u8 energy_a; + /** + * @energy_b: energy chain B + */ + u8 energy_b; + /** + * @channel: channel number + */ + u8 channel; + /** + * @mac_context: MAC context mask + */ + u8 mac_context; + /* DW13 */ + /** + * @gp2_on_air_rise: GP2 timer value on air rise (INA) + */ + __le32 gp2_on_air_rise; + /* DW14 & DW15 */ + union { + /** + * @tsf_on_air_rise: + * TSF value on air rise (INA), only valid if + * %IWL_RX_MPDU_PHY_TSF_OVERLOAD isn't set + */ + __le64 tsf_on_air_rise; + + struct { + /** + * @phy_data0: depends on info_type, see @phy_data1 + */ + __le32 phy_data0; + /** + * @phy_data1: valid only if + * %IWL_RX_MPDU_PHY_TSF_OVERLOAD is set, + * see &enum iwl_rx_phy_data1. + */ + __le32 phy_data1; + }; + }; + /* DW16 */ + /** + * @phy_data5: valid only if + * %IWL_RX_MPDU_PHY_TSF_OVERLOAD is set, + * see &enum iwl_rx_phy_data5. + */ + __le32 phy_data5; + /* DW17 */ + /** + * @reserved: reserved + */ + __le32 reserved[1]; +} __packed; /* RX_MPDU_RES_START_API_S_VER_3, + * RX_MPDU_RES_START_API_S_VER_5, + * RX_MPDU_RES_START_API_S_VER_6 + */ + +/** + * struct iwl_rx_mpdu_desc - RX MPDU descriptor + */ +struct iwl_rx_mpdu_desc { + /* DW2 */ + /** + * @mpdu_len: MPDU length + */ + __le16 mpdu_len; + /** + * @mac_flags1: &enum iwl_rx_mpdu_mac_flags1 + */ + u8 mac_flags1; + /** + * @mac_flags2: &enum iwl_rx_mpdu_mac_flags2 + */ + u8 mac_flags2; + /* DW3 */ + /** + * @amsdu_info: &enum iwl_rx_mpdu_amsdu_info + */ + u8 amsdu_info; + /** + * @phy_info: &enum iwl_rx_mpdu_phy_info + */ + __le16 phy_info; + /** + * @mac_phy_band: MAC/link ID, PHY ID, band; + * see &enum iwl_rx_mpdu_mac_phy_band + */ + u8 mac_phy_band; + /* DW4 */ + union { + struct { + /* carries csum data only when rpa_en == 1 */ + /** + * @raw_csum: raw checksum (alledgedly unreliable) + */ + __le16 raw_csum; + + union { + /** + * @l3l4_flags: &enum iwl_rx_l3l4_flags + */ + __le16 l3l4_flags; + + /** + * @phy_data4: depends on info type, see phy_data1 + */ + __le16 phy_data4; + }; + }; + /** + * @phy_eht_data4: depends on info type, see phy_data1 + */ + __le32 phy_eht_data4; + }; + /* DW5 */ + /** + * @status: &enum iwl_rx_mpdu_status + */ + __le32 status; + + /* DW6 */ + /** + * @reorder_data: &enum iwl_rx_mpdu_reorder_data + */ + __le32 reorder_data; + + union { + /** + * @v1: version 1 of the remaining RX descriptor, + * see &struct iwl_rx_mpdu_desc_v1 + */ + struct iwl_rx_mpdu_desc_v1 v1; + /** + * @v3: version 3 of the remaining RX descriptor, + * see &struct iwl_rx_mpdu_desc_v3 + */ + struct iwl_rx_mpdu_desc_v3 v3; + }; +} __packed; /* RX_MPDU_RES_START_API_S_VER_3, + * RX_MPDU_RES_START_API_S_VER_4, + * RX_MPDU_RES_START_API_S_VER_5, + * RX_MPDU_RES_START_API_S_VER_6 + */ + +#define IWL_RX_DESC_SIZE_V1 offsetofend(struct iwl_rx_mpdu_desc, v1) + +#define RX_NO_DATA_CHAIN_A_POS 0 +#define RX_NO_DATA_CHAIN_A_MSK (0xff << RX_NO_DATA_CHAIN_A_POS) +#define RX_NO_DATA_CHAIN_B_POS 8 +#define RX_NO_DATA_CHAIN_B_MSK (0xff << RX_NO_DATA_CHAIN_B_POS) +#define RX_NO_DATA_CHANNEL_POS 16 +#define RX_NO_DATA_CHANNEL_MSK (0xff << RX_NO_DATA_CHANNEL_POS) + +#define RX_NO_DATA_INFO_TYPE_POS 0 +#define RX_NO_DATA_INFO_TYPE_MSK (0xff << RX_NO_DATA_INFO_TYPE_POS) +#define RX_NO_DATA_INFO_TYPE_NONE 0 +#define RX_NO_DATA_INFO_TYPE_RX_ERR 1 +#define RX_NO_DATA_INFO_TYPE_NDP 2 +#define RX_NO_DATA_INFO_TYPE_MU_UNMATCHED 3 +#define RX_NO_DATA_INFO_TYPE_TB_UNMATCHED 4 + +#define RX_NO_DATA_INFO_ERR_POS 8 +#define RX_NO_DATA_INFO_ERR_MSK (0xff << RX_NO_DATA_INFO_ERR_POS) +#define RX_NO_DATA_INFO_ERR_NONE 0 +#define RX_NO_DATA_INFO_ERR_BAD_PLCP 1 +#define RX_NO_DATA_INFO_ERR_UNSUPPORTED_RATE 2 +#define RX_NO_DATA_INFO_ERR_NO_DELIM 3 +#define RX_NO_DATA_INFO_ERR_BAD_MAC_HDR 4 +#define RX_NO_DATA_INFO_LOW_ENERGY 5 + +#define RX_NO_DATA_FRAME_TIME_POS 0 +#define RX_NO_DATA_FRAME_TIME_MSK (0xfffff << RX_NO_DATA_FRAME_TIME_POS) + +#define RX_NO_DATA_RX_VEC0_HE_NSTS_MSK 0x03800000 +#define RX_NO_DATA_RX_VEC0_VHT_NSTS_MSK 0x38000000 +#define RX_NO_DATA_RX_VEC2_EHT_NSTS_MSK 0x00f00000 + +/* content of OFDM_RX_VECTOR_USIG_A1_OUT */ +enum iwl_rx_usig_a1 { + IWL_RX_USIG_A1_ENHANCED_WIFI_VER_ID = 0x00000007, + IWL_RX_USIG_A1_BANDWIDTH = 0x00000038, + IWL_RX_USIG_A1_UL_FLAG = 0x00000040, + IWL_RX_USIG_A1_BSS_COLOR = 0x00001f80, + IWL_RX_USIG_A1_TXOP_DURATION = 0x000fe000, + IWL_RX_USIG_A1_DISREGARD = 0x01f00000, + IWL_RX_USIG_A1_VALIDATE = 0x02000000, + IWL_RX_USIG_A1_EHT_BW320_SLOT = 0x04000000, + IWL_RX_USIG_A1_EHT_TYPE = 0x18000000, + IWL_RX_USIG_A1_RDY = 0x80000000, +}; + +/* content of OFDM_RX_VECTOR_USIG_A2_EHT_OUT */ +enum iwl_rx_usig_a2_eht { + IWL_RX_USIG_A2_EHT_PPDU_TYPE = 0x00000003, + IWL_RX_USIG_A2_EHT_USIG2_VALIDATE_B2 = 0x00000004, + IWL_RX_USIG_A2_EHT_PUNC_CHANNEL = 0x000000f8, + IWL_RX_USIG_A2_EHT_USIG2_VALIDATE_B8 = 0x00000100, + IWL_RX_USIG_A2_EHT_SIG_MCS = 0x00000600, + IWL_RX_USIG_A2_EHT_SIG_SYM_NUM = 0x0000f800, + IWL_RX_USIG_A2_EHT_TRIG_SPATIAL_REUSE_1 = 0x000f0000, + IWL_RX_USIG_A2_EHT_TRIG_SPATIAL_REUSE_2 = 0x00f00000, + IWL_RX_USIG_A2_EHT_TRIG_USIG2_DISREGARD = 0x1f000000, + IWL_RX_USIG_A2_EHT_CRC_OK = 0x40000000, + IWL_RX_USIG_A2_EHT_RDY = 0x80000000, +}; + +/** + * struct iwl_rx_no_data - RX no data descriptor + * @info: 7:0 frame type, 15:8 RX error type + * @rssi: 7:0 energy chain-A, + * 15:8 chain-B, measured at FINA time (FINA_ENERGY), 16:23 channel + * @on_air_rise_time: GP2 during on air rise + * @fr_time: frame time + * @rate: rate/mcs of frame + * @phy_info: &enum iwl_rx_phy_he_data0 or &enum iwl_rx_phy_eht_data0 + * based on &enum iwl_rx_phy_info_type + * @rx_vec: DW-12:9 raw RX vectors from DSP according to modulation type. + * for VHT: OFDM_RX_VECTOR_SIGA1_OUT, OFDM_RX_VECTOR_SIGA2_OUT + * for HE: OFDM_RX_VECTOR_HE_SIGA1_OUT, OFDM_RX_VECTOR_HE_SIGA2_OUT + */ +struct iwl_rx_no_data { + __le32 info; + __le32 rssi; + __le32 on_air_rise_time; + __le32 fr_time; + __le32 rate; + __le32 phy_info[2]; + __le32 rx_vec[2]; +} __packed; /* RX_NO_DATA_NTFY_API_S_VER_1, + RX_NO_DATA_NTFY_API_S_VER_2 */ + +/** + * struct iwl_rx_no_data_ver_3 - RX no data descriptor + * @info: 7:0 frame type, 15:8 RX error type + * @rssi: 7:0 energy chain-A, + * 15:8 chain-B, measured at FINA time (FINA_ENERGY), 16:23 channel + * @on_air_rise_time: GP2 during on air rise + * @fr_time: frame time + * @rate: rate/mcs of frame, format depends on the notification version + * @phy_info: &enum iwl_rx_phy_eht_data0 and &enum iwl_rx_phy_info_type + * @rx_vec: DW-12:9 raw RX vectors from DSP according to modulation type. + * for VHT: OFDM_RX_VECTOR_SIGA1_OUT, OFDM_RX_VECTOR_SIGA2_OUT + * for HE: OFDM_RX_VECTOR_HE_SIGA1_OUT, OFDM_RX_VECTOR_HE_SIGA2_OUT + * for EHT: OFDM_RX_VECTOR_USIG_A1_OUT, OFDM_RX_VECTOR_USIG_A2_EHT_OUT, + * OFDM_RX_VECTOR_EHT_OUT, OFDM_RX_VECTOR_EHT_USER_FIELD_OUT + */ +struct iwl_rx_no_data_ver_3 { + __le32 info; + __le32 rssi; + __le32 on_air_rise_time; + __le32 fr_time; + __le32 rate; + __le32 phy_info[2]; + __le32 rx_vec[4]; +} __packed; /* RX_NO_DATA_NTFY_API_S_VER_3, _VER_4 */ + +struct iwl_frame_release { + u8 baid; + u8 reserved; + __le16 nssn; +}; + +/** + * enum iwl_bar_frame_release_sta_tid - STA/TID information for BAR release + * @IWL_BAR_FRAME_RELEASE_TID_MASK: TID mask + * @IWL_BAR_FRAME_RELEASE_STA_MASK: STA mask + */ +enum iwl_bar_frame_release_sta_tid { + IWL_BAR_FRAME_RELEASE_TID_MASK = 0x0000000f, + IWL_BAR_FRAME_RELEASE_STA_MASK = 0x000001f0, +}; + +/** + * enum iwl_bar_frame_release_ba_info - BA information for BAR release + * @IWL_BAR_FRAME_RELEASE_NSSN_MASK: NSSN mask + * @IWL_BAR_FRAME_RELEASE_SN_MASK: SN mask (ignored by driver) + * @IWL_BAR_FRAME_RELEASE_BAID_MASK: BAID mask + */ +enum iwl_bar_frame_release_ba_info { + IWL_BAR_FRAME_RELEASE_NSSN_MASK = 0x00000fff, + IWL_BAR_FRAME_RELEASE_SN_MASK = 0x00fff000, + IWL_BAR_FRAME_RELEASE_BAID_MASK = 0x3f000000, +}; + *** 18965 LINES SKIPPED *** From nobody Sat Apr 18 20:47:16 2026 X-Original-To: dev-commits-src-main@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 4fykMT0Dt5z6ZGgF for ; Sat, 18 Apr 2026 20:47:17 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fykMS3KYGz3SjF for ; Sat, 18 Apr 2026 20:47:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776545236; 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=lCB1hCHllX5i6kIpGEJnIs1nCSSQYHHaZkBDdx0Ucm8=; b=WDQdhKc7hY6sWpgwKhlXqySVUIKNtrjr88J0FkqJNEirySDZO845v8L0wu47Oe0ppxROMl SZMJwf3Vsij/vD09j2s6gN+rcdZWSgUTN3YestaXf2pF4dmjeXfyT9f47aZvNM/tdLSC+F fQGN6onbYQUYBH3dSbYUvW3y5YutzFowEiUpuJ9qyINi1R/BBQmPo/6k2Oej0Di+EDQqo1 ZhRTODJTj6Jy+4bDEXA5F/bEsL3NfxoEVI0yALaRjOWf07paWrl0I4DHo2yIrd1zHOkzPi Opy/D6ip72k0nW0rhHs06RavP+ojPJT8WIf6fkfiWf3dgvL97qYZW4KcUzHmMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776545236; a=rsa-sha256; cv=none; b=WQHZ+OYkTbmSi7NOg5JDIV6EObYJnrrCa7iI8ta1EGwh7lKVHe4LSsUWq27hMeRM5xqpAJ 3k/OsNMgqd1GTwCBnXF759peZkHghUJ4Cs59Ix2/SUpJaHrOaVlC1Y4VWMFEIAfkBOX+2Q LffYbLDn7dK1CJOzgnD7VTKZQ3B+6Ua/Zby93QejGLcQDtW7g3zWa9g6ktWvd8YFQxjhMq NcIAf9y5fehysbpbbgu4M9eMW7S0Bmhs9FHjFRBIGl5CJnxL3jLvxjurH3GqKeSNfPGGuA hCXfLYsNfPeBtau8Z+eSA4T3QrnaikU4zdhvChsQ5A5bvzv9XGiNFhgydyOdNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776545236; 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=lCB1hCHllX5i6kIpGEJnIs1nCSSQYHHaZkBDdx0Ucm8=; b=Bl4Hw8B2jkGYpTqO2N1ax2xJOZljL+eWk1V7gTCUGNif7Eb5qUzjEAZmTqIluxMHzKn43G C16zCpV6Z3eK+LPlDcG8YB1i+TNJnZIASN204u6nFdV/yHQYd1hvikGZHcTy1oFVJMwq4C kwuYVrUYW+ILHANjc0y6hcqTCK5rMmoT5IR9oww+BuLFIGXJwvBVKjAPZrUhwE++Mr7t44 ahrsRecvhFf0dBZvU9WvEXjy99s/bK2oHGJCSG95QY7h54/wb6Rb7ishqbU7J3876aUh+Z Ht8Yf9YjixPPXQFRkB9k8FdkPLAsnYAzne/0fpVl1vJ8XYxzAdrzcTCl19wpyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fykMS2g1JzwYC for ; Sat, 18 Apr 2026 20:47:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 22c76 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 20:47:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 9ed3331fb582 - main - iwlwifi: update module Makefile for v7.0 driver version List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ed3331fb5822b93313edae42cc529eb25e1a6cc Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 20:47:16 +0000 Message-Id: <69e3edd4.22c76.7ff3f7eb@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9ed3331fb5822b93313edae42cc529eb25e1a6cc commit 9ed3331fb5822b93313edae42cc529eb25e1a6cc Author: Bjoern A. Zeeb AuthorDate: 2026-04-18 20:37:11 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 20:38:51 +0000 iwlwifi: update module Makefile for v7.0 driver version Add the new file for nan in the mld subdriver. Update LINUXKPI_VERSION to reflect that the driver is based on Linux v7.0. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/modules/iwlwifi/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/modules/iwlwifi/Makefile b/sys/modules/iwlwifi/Makefile index 399e35b79d61..471509c2bb1c 100644 --- a/sys/modules/iwlwifi/Makefile +++ b/sys/modules/iwlwifi/Makefile @@ -44,7 +44,7 @@ SRCS+= mld/agg.c mld/ap.c mld/coex.c SRCS+= mld/ftm-initiator.c mld/fw.c mld/iface.c mld/key.c #SRCS+= mld/led.c SRCS+= mld/link.c mld/low_latency.c mld/mac80211.c mld/mcc.c mld/mld.c -SRCS+= mld/mlo.c mld/notif.c mld/phy.c mld/power.c mld/ptp.c +SRCS+= mld/mlo.c mld/nan.c mld/notif.c mld/phy.c mld/power.c mld/ptp.c SRCS+= mld/regulatory.c mld/roc.c mld/rx.c mld/scan.c SRCS+= mld/session-protect.c mld/sta.c mld/stats.c mld/thermal.c SRCS+= mld/time_sync.c mld/tlc.c mld/tx.c @@ -94,7 +94,7 @@ CFLAGS+= -DCONFIG_IWLWIFI_DEVICE_TRACING=1 #CFLAGS+= -DCONFIG_EFI=1 CFLAGS+= -DKBUILD_MODNAME='"iwlwifi"' -CFLAGS+= -DLINUXKPI_VERSION=61900 +CFLAGS+= -DLINUXKPI_VERSION=70000 CWARNFLAGS.clang.drv.c+= -Wno-initializer-overrides CWARNFLAGS.drv.c+= -Wno-override-init ${CWARNFLAGS.${COMPILER_TYPE}.${.IMPSRC:T}} From nobody Sat Apr 18 20:59:56 2026 X-Original-To: dev-commits-src-main@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 4fykf50TP6z6ZHd4 for ; Sat, 18 Apr 2026 20:59:57 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fykf46tR9z3VPk for ; Sat, 18 Apr 2026 20:59:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776545996; 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=QOS7xNrd326ukoaYwXk7S7Qvy8Wt7ROfFApbGtw76p8=; b=Arn6Xll2dhWWwoLye3E5vDOnRV0qUA1yB3t3Po7hWs8rV6X9X8whkSZRbt1fkxEGKdsELq nKJwh2TVrbGQpwsaz2QZOq3ng7xS396VV547ht5gaJNLCkcUoRc7qPGGt5E3+x6YBggMiL fa0CqSJkGXI9zIKUGMXxeI58jXrOJOlCUB8VFEHqLO3UjIaawPnHYIXfHmSbaHxCn1//we fszZcqrC29Pz1i/0ymgXnXozQEzFJDMYxHD1SEPg1VtejG7GQ8xxsQte1dCUrDYy2ZtrDU jbARw5tvvBuBuBgFLT01q0xwPjq6YJUZCbv3z3RsjhpxXkjmceiAn/B6By7tSg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776545996; a=rsa-sha256; cv=none; b=BQQazW52e8+p219WpnGyMPUIEhZwsoQl963nYPhjGxm7oqGZSBrn1SqA/W3oEAKBOT/+7Z 8M6hD86b+niOdliUP9n74jYkmh5zhCBeu40WG7pOkI9j09HzjMLssHDm+B5HrFBcPEf2Hb iLHX1NyO73M9XTGv3Q7UGYLWBcXaoQrqUWN1j0uQKr9bWT1ZePzMS1j4C9kC4Ih2q6iTua 11Nz/ls6RXevD/hd2pRjSatFtn8Fel3QMN/hpMRcu7DLEhtcMsRbb0RYla2TnM2HsyML2k xtMdcdOeGfZEiFHQZ0jVBA+rli3t/g7CbFZ8CqtC8e9BDG4HxOYYSXwphGJeSg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776545996; 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=QOS7xNrd326ukoaYwXk7S7Qvy8Wt7ROfFApbGtw76p8=; b=PYnaZKEpxrx04ZUVC2ZR9CFwrbFY/xeQKj5Ck+AhvhenxI+jeox6snOJPkK4i7ORgV4Up+ hxqnjFxFVIrmRb6ppuAfhYX50n0iyXG2dr8e374JtMwEXOR4aSWE8eSoUzrtcni2iHCPJR iG1Z4j6g/ZRSLmkJFK8ot5bZJ5sHDIM1GFdnivU3TFqvRSYgM51Ij3w316gdhK6YsocYHA d+/U0lJWs72RW7iD32ozOjmUZFIY2ObCbJ6c0LYEG/oXJZBG4zlWm7X9OAjlYChxDEcIwj Sxd3LB+/xwldq7LU74C7xlTSq5W6iu+xm5Q/ZCXgZFkhvBSvsiITOjQgVL7NAg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fykf46K2DzwWP for ; Sat, 18 Apr 2026 20:59:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2451c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 20:59:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 422e9c5d878e - main - rtw89: update Realtek's rtw89 driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 422e9c5d878e14ec16bb89ef6df65d964d5ce2f1 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 20:59:56 +0000 Message-Id: <69e3f0cc.2451c.5399c3c9@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=422e9c5d878e14ec16bb89ef6df65d964d5ce2f1 commit 422e9c5d878e14ec16bb89ef6df65d964d5ce2f1 Merge: 9ed3331fb582 777767fb72f8 Author: Bjoern A. Zeeb AuthorDate: 2026-04-18 20:48:44 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 20:48:44 +0000 rtw89: update Realtek's rtw89 driver This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ). Sponsored by: The FreeBSD Foundation MFC after: 3 days sys/contrib/dev/rtw89/acpi.c | 2 +- sys/contrib/dev/rtw89/cam.c | 136 +++- sys/contrib/dev/rtw89/cam.h | 129 ++++ sys/contrib/dev/rtw89/chan.c | 69 +- sys/contrib/dev/rtw89/chan.h | 2 + sys/contrib/dev/rtw89/core.c | 241 +++++- sys/contrib/dev/rtw89/core.h | 198 ++++- sys/contrib/dev/rtw89/debug.c | 165 ++++- sys/contrib/dev/rtw89/debug.h | 1 + sys/contrib/dev/rtw89/efuse.c | 4 - sys/contrib/dev/rtw89/efuse.h | 6 + sys/contrib/dev/rtw89/efuse_be.c | 26 + sys/contrib/dev/rtw89/fw.c | 1227 ++++++++++++++++++++++++++++--- sys/contrib/dev/rtw89/fw.h | 521 +++++++++++-- sys/contrib/dev/rtw89/mac.c | 199 ++++- sys/contrib/dev/rtw89/mac.h | 102 ++- sys/contrib/dev/rtw89/mac80211.c | 46 +- sys/contrib/dev/rtw89/mac_be.c | 696 ++++++++++++++++-- sys/contrib/dev/rtw89/pci.c | 22 +- sys/contrib/dev/rtw89/pci.h | 57 +- sys/contrib/dev/rtw89/pci_be.c | 138 +++- sys/contrib/dev/rtw89/phy.c | 430 +++++++++-- sys/contrib/dev/rtw89/phy.h | 36 +- sys/contrib/dev/rtw89/phy_be.c | 563 +++++++++++++- sys/contrib/dev/rtw89/ps.c | 4 +- sys/contrib/dev/rtw89/reg.h | 934 ++++++++++++++++++++++- sys/contrib/dev/rtw89/regd.c | 21 +- sys/contrib/dev/rtw89/rtw8851b.c | 10 +- sys/contrib/dev/rtw89/rtw8852a.c | 10 +- sys/contrib/dev/rtw89/rtw8852au.c | 4 + sys/contrib/dev/rtw89/rtw8852b.c | 32 +- sys/contrib/dev/rtw89/rtw8852b_common.c | 2 - sys/contrib/dev/rtw89/rtw8852bt.c | 8 + sys/contrib/dev/rtw89/rtw8852bu.c | 2 + sys/contrib/dev/rtw89/rtw8852c.c | 10 +- sys/contrib/dev/rtw89/rtw8852cu.c | 2 + sys/contrib/dev/rtw89/rtw8922a.c | 89 ++- sys/contrib/dev/rtw89/rtw8922a_rfk.c | 48 +- sys/contrib/dev/rtw89/sar.c | 2 +- sys/contrib/dev/rtw89/ser.c | 12 +- sys/contrib/dev/rtw89/txrx.h | 22 + sys/contrib/dev/rtw89/usb.c | 7 +- sys/contrib/dev/rtw89/wow.c | 16 +- sys/contrib/dev/rtw89/wow.h | 1 + 44 files changed, 5696 insertions(+), 556 deletions(-) diff --cc sys/contrib/dev/rtw89/acpi.c index fdba1ea46ec6,000000000000..86e5cf1825ba mode 100644,000000..100644 --- a/sys/contrib/dev/rtw89/acpi.c +++ b/sys/contrib/dev/rtw89/acpi.c @@@ -1,1289 -1,0 +1,1289 @@@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause +/* Copyright(c) 2021-2023 Realtek Corporation + */ + +#include +#include + +#include "acpi.h" +#include "debug.h" + +static const guid_t rtw89_guid = GUID_INIT(0xD2A8C3E8, 0x4B69, 0x4F00, + 0x82, 0xBD, 0xFE, 0x86, + 0x07, 0x80, 0x3A, 0xA7); + +static u32 rtw89_acpi_traversal_object(struct rtw89_dev *rtwdev, + const union acpi_object *obj, u8 *pos) +{ + const union acpi_object *elm; + unsigned int i; + u32 sub_len; + u32 len = 0; + u8 *tmp; + + switch (obj->type) { + case ACPI_TYPE_INTEGER: + if (pos) + pos[len] = obj->integer.value; + + len++; + break; + case ACPI_TYPE_BUFFER: + if (unlikely(obj->buffer.length == 0)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "%s: invalid buffer type\n", __func__); + goto err; + } + + if (pos) + memcpy(pos, obj->buffer.pointer, obj->buffer.length); + + len += obj->buffer.length; + break; + case ACPI_TYPE_PACKAGE: + if (unlikely(obj->package.count == 0)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "%s: invalid package type\n", __func__); + goto err; + } + + for (i = 0; i < obj->package.count; i++) { + elm = &obj->package.elements[i]; + tmp = pos ? pos + len : NULL; + + sub_len = rtw89_acpi_traversal_object(rtwdev, elm, tmp); + if (unlikely(sub_len == 0)) + goto err; + + len += sub_len; + } + break; + default: + rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: unhandled type: %d\n", + __func__, obj->type); + goto err; + } + + return len; + +err: + return 0; +} + +static u32 rtw89_acpi_calculate_object_length(struct rtw89_dev *rtwdev, + const union acpi_object *obj) +{ + return rtw89_acpi_traversal_object(rtwdev, obj, NULL); +} + +static struct rtw89_acpi_data * +rtw89_acpi_evaluate_method(struct rtw89_dev *rtwdev, const char *method) +{ + struct acpi_buffer buf = {ACPI_ALLOCATE_BUFFER, NULL}; + struct rtw89_acpi_data *data = NULL; + acpi_handle root, handle; + union acpi_object *obj; + acpi_status status; + u32 len; + + root = ACPI_HANDLE(rtwdev->dev); + if (!root) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "acpi (%s): failed to get root\n", method); + return NULL; + } + +#if defined(__linux__) + status = acpi_get_handle(root, (acpi_string)method, &handle); +#elif defined(__FreeBSD__) + status = acpi_get_handle(root, method, &handle); +#endif + if (ACPI_FAILURE(status)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "acpi (%s): failed to get handle\n", method); + return NULL; + } + + status = acpi_evaluate_object(handle, NULL, NULL, &buf); + if (ACPI_FAILURE(status)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "acpi (%s): failed to evaluate object\n", method); + return NULL; + } + + obj = buf.pointer; + len = rtw89_acpi_calculate_object_length(rtwdev, obj); + if (unlikely(len == 0)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "acpi (%s): failed to traversal obj len\n", method); + goto out; + } + - data = kzalloc(struct_size(data, buf, len), GFP_KERNEL); ++ data = kzalloc_flex(*data, buf, len); + if (!data) + goto out; + + data->len = len; + rtw89_acpi_traversal_object(rtwdev, obj, data->buf); + +out: + ACPI_FREE(obj); + return data; +} + +static +int rtw89_acpi_dsm_get_value(struct rtw89_dev *rtwdev, union acpi_object *obj, + u8 *value) +{ + if (obj->type != ACPI_TYPE_INTEGER) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "acpi: expect integer but type: %d\n", obj->type); + return -EINVAL; + } + + *value = (u8)obj->integer.value; + return 0; +} + +static bool chk_acpi_policy_6ghz_sig(const struct rtw89_acpi_policy_6ghz *p) +{ + return p->signature[0] == 0x00 && + p->signature[1] == 0xE0 && + p->signature[2] == 0x4C; +} + +static +int rtw89_acpi_dsm_get_policy_6ghz(struct rtw89_dev *rtwdev, + union acpi_object *obj, + struct rtw89_acpi_policy_6ghz **policy_6ghz) +{ + const struct rtw89_acpi_policy_6ghz *ptr; + u32 expect_len; + u32 len; + + if (obj->type != ACPI_TYPE_BUFFER) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "acpi: expect buffer but type: %d\n", obj->type); + return -EINVAL; + } + + len = obj->buffer.length; + if (len < sizeof(*ptr)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: invalid buffer length: %u\n", + __func__, len); + return -EINVAL; + } + + ptr = (typeof(ptr))obj->buffer.pointer; + if (!chk_acpi_policy_6ghz_sig(ptr)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: bad signature\n", __func__); + return -EINVAL; + } + + expect_len = struct_size(ptr, country_list, ptr->country_count); + if (len < expect_len) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: expect %u but length: %u\n", + __func__, expect_len, len); + return -EINVAL; + } + + *policy_6ghz = kmemdup(ptr, expect_len, GFP_KERNEL); + if (!*policy_6ghz) + return -ENOMEM; + + rtw89_hex_dump(rtwdev, RTW89_DBG_ACPI, "policy_6ghz: ", *policy_6ghz, + expect_len); + return 0; +} + +static bool chk_acpi_policy_6ghz_sp_sig(const struct rtw89_acpi_policy_6ghz_sp *p) +{ + return p->signature[0] == 0x52 && + p->signature[1] == 0x54 && + p->signature[2] == 0x4B && + p->signature[3] == 0x07; +} + +static +int rtw89_acpi_dsm_get_policy_6ghz_sp(struct rtw89_dev *rtwdev, + union acpi_object *obj, + struct rtw89_acpi_policy_6ghz_sp **policy) +{ + const struct rtw89_acpi_policy_6ghz_sp *ptr; + u32 buf_len; + + if (obj->type != ACPI_TYPE_BUFFER) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "acpi: expect buffer but type: %d\n", obj->type); + return -EINVAL; + } + + buf_len = obj->buffer.length; + if (buf_len < sizeof(*ptr)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: invalid buffer length: %u\n", + __func__, buf_len); + return -EINVAL; + } + + ptr = (typeof(ptr))obj->buffer.pointer; + if (!chk_acpi_policy_6ghz_sp_sig(ptr)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: bad signature\n", __func__); + return -EINVAL; + } + + *policy = kmemdup(ptr, sizeof(*ptr), GFP_KERNEL); + if (!*policy) + return -ENOMEM; + + rtw89_hex_dump(rtwdev, RTW89_DBG_ACPI, "policy_6ghz_sp: ", *policy, + sizeof(*ptr)); + return 0; +} + +static bool chk_acpi_policy_6ghz_vlp_sig(const struct rtw89_acpi_policy_6ghz_vlp *p) +{ + return p->signature[0] == 0x52 && + p->signature[1] == 0x54 && + p->signature[2] == 0x4B && + p->signature[3] == 0x0B; +} + +static +int rtw89_acpi_dsm_get_policy_6ghz_vlp(struct rtw89_dev *rtwdev, + union acpi_object *obj, + struct rtw89_acpi_policy_6ghz_vlp **policy) +{ + const struct rtw89_acpi_policy_6ghz_vlp *ptr; + u32 buf_len; + + if (obj->type != ACPI_TYPE_BUFFER) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "acpi: expect buffer but type: %d\n", obj->type); + return -EINVAL; + } + + buf_len = obj->buffer.length; + if (buf_len < sizeof(*ptr)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: invalid buffer length: %u\n", + __func__, buf_len); + return -EINVAL; + } + + ptr = (typeof(ptr))obj->buffer.pointer; + if (!chk_acpi_policy_6ghz_vlp_sig(ptr)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: bad signature\n", __func__); + return -EINVAL; + } + + *policy = kmemdup(ptr, sizeof(*ptr), GFP_KERNEL); + if (!*policy) + return -ENOMEM; + + rtw89_hex_dump(rtwdev, RTW89_DBG_ACPI, "policy_6ghz_vlp: ", *policy, + sizeof(*ptr)); + return 0; +} + +static bool chk_acpi_policy_tas_sig(const struct rtw89_acpi_policy_tas *p) +{ + return p->signature[0] == 0x52 && + p->signature[1] == 0x54 && + p->signature[2] == 0x4B && + p->signature[3] == 0x05; +} + +static int rtw89_acpi_dsm_get_policy_tas(struct rtw89_dev *rtwdev, + union acpi_object *obj, + struct rtw89_acpi_policy_tas **policy) +{ + const struct rtw89_acpi_policy_tas *ptr; + u32 buf_len; + + if (obj->type != ACPI_TYPE_BUFFER) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "acpi: expect buffer but type: %d\n", obj->type); + return -EINVAL; + } + + buf_len = obj->buffer.length; + if (buf_len < sizeof(*ptr)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: invalid buffer length: %u\n", + __func__, buf_len); + return -EINVAL; + } + + ptr = (typeof(ptr))obj->buffer.pointer; + if (!chk_acpi_policy_tas_sig(ptr)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: bad signature\n", __func__); + return -EINVAL; + } + + *policy = kmemdup(ptr, sizeof(*ptr), GFP_KERNEL); + if (!*policy) + return -ENOMEM; + + rtw89_hex_dump(rtwdev, RTW89_DBG_ACPI, "policy_tas: ", *policy, + sizeof(*ptr)); + return 0; +} + +static +bool chk_acpi_policy_reg_rules_sig(const struct rtw89_acpi_policy_reg_rules *p) +{ + return p->signature[0] == 0x52 && + p->signature[1] == 0x54 && + p->signature[2] == 0x4B && + p->signature[3] == 0x0A; +} + +static +int rtw89_acpi_dsm_get_policy_reg_rules(struct rtw89_dev *rtwdev, + union acpi_object *obj, + struct rtw89_acpi_policy_reg_rules **policy) +{ + const struct rtw89_acpi_policy_reg_rules *ptr; + u32 buf_len; + + if (obj->type != ACPI_TYPE_BUFFER) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "acpi: expect buffer but type: %d\n", obj->type); + return -EINVAL; + } + + buf_len = obj->buffer.length; + if (buf_len < sizeof(*ptr)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: invalid buffer length: %u\n", + __func__, buf_len); + return -EINVAL; + } + + ptr = (typeof(ptr))obj->buffer.pointer; + if (!chk_acpi_policy_reg_rules_sig(ptr)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: bad signature\n", __func__); + return -EINVAL; + } + + *policy = kmemdup(ptr, sizeof(*ptr), GFP_KERNEL); + if (!*policy) + return -ENOMEM; + + rtw89_hex_dump(rtwdev, RTW89_DBG_ACPI, "policy_reg_rules: ", *policy, + sizeof(*ptr)); + return 0; +} + +int rtw89_acpi_evaluate_dsm(struct rtw89_dev *rtwdev, + enum rtw89_acpi_dsm_func func, + struct rtw89_acpi_dsm_result *res) +{ + union acpi_object *obj; + int ret; + + obj = acpi_evaluate_dsm(ACPI_HANDLE(rtwdev->dev), &rtw89_guid, + 0, func, NULL); + if (!obj) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "acpi dsm fail to evaluate func: %d\n", func); + return -ENOENT; + } + + if (func == RTW89_ACPI_DSM_FUNC_6G_BP) + ret = rtw89_acpi_dsm_get_policy_6ghz(rtwdev, obj, + &res->u.policy_6ghz); + else if (func == RTW89_ACPI_DSM_FUNC_6GHZ_SP_SUP) + ret = rtw89_acpi_dsm_get_policy_6ghz_sp(rtwdev, obj, + &res->u.policy_6ghz_sp); + else if (func == RTW89_ACPI_DSM_FUNC_6GHZ_VLP_SUP) + ret = rtw89_acpi_dsm_get_policy_6ghz_vlp(rtwdev, obj, + &res->u.policy_6ghz_vlp); + else if (func == RTW89_ACPI_DSM_FUNC_TAS_EN) + ret = rtw89_acpi_dsm_get_policy_tas(rtwdev, obj, &res->u.policy_tas); + else if (func == RTW89_ACPI_DSM_FUNC_REG_RULES_EN) + ret = rtw89_acpi_dsm_get_policy_reg_rules(rtwdev, obj, + &res->u.policy_reg_rules); + else + ret = rtw89_acpi_dsm_get_value(rtwdev, obj, &res->u.value); + + ACPI_FREE(obj); + return ret; +} + +int rtw89_acpi_evaluate_rtag(struct rtw89_dev *rtwdev, + struct rtw89_acpi_rtag_result *res) +{ +#if defined(__linux__) + const struct rtw89_acpi_data *data; +#elif defined(__FreeBSD__) + struct rtw89_acpi_data *data; +#endif + u32 buf_len; + int ret = 0; + + data = rtw89_acpi_evaluate_method(rtwdev, "RTAG"); + if (!data) + return -EIO; + + buf_len = data->len; + if (buf_len != sizeof(*res)) { + rtw89_debug(rtwdev, RTW89_DBG_ACPI, "%s: invalid buffer length: %u\n", + __func__, buf_len); + ret = -EINVAL; + goto out; + } + + *res = *(struct rtw89_acpi_rtag_result *)data->buf; + + rtw89_hex_dump(rtwdev, RTW89_DBG_ACPI, "antenna_gain: ", res, sizeof(*res)); + +out: + kfree(data); + return ret; +} + +enum rtw89_acpi_sar_subband rtw89_acpi_sar_get_subband(struct rtw89_dev *rtwdev, + u32 center_freq) +{ + switch (center_freq) { + default: + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "center freq %u to ACPI SAR subband is unhandled\n", + center_freq); + fallthrough; + case 2412 ... 2484: + return RTW89_ACPI_SAR_2GHZ_SUBBAND; + case 5180 ... 5240: + return RTW89_ACPI_SAR_5GHZ_SUBBAND_1; + case 5250 ... 5320: + return RTW89_ACPI_SAR_5GHZ_SUBBAND_2; + case 5500 ... 5720: + return RTW89_ACPI_SAR_5GHZ_SUBBAND_2E; + case 5745 ... 5885: + return RTW89_ACPI_SAR_5GHZ_SUBBAND_3_4; + case 5955 ... 6155: + return RTW89_ACPI_SAR_6GHZ_SUBBAND_5_L; + case 6175 ... 6415: + return RTW89_ACPI_SAR_6GHZ_SUBBAND_5_H; + case 6435 ... 6515: + return RTW89_ACPI_SAR_6GHZ_SUBBAND_6; + case 6535 ... 6695: + return RTW89_ACPI_SAR_6GHZ_SUBBAND_7_L; + case 6715 ... 6855: + return RTW89_ACPI_SAR_6GHZ_SUBBAND_7_H; + + /* freq 6875 (ch 185, 20MHz) spans RTW89_ACPI_SAR_6GHZ_SUBBAND_7_H + * and RTW89_ACPI_SAR_6GHZ_SUBBAND_8, so directly describe it with + * struct rtw89_6ghz_span. + */ + + case 6895 ... 7115: + return RTW89_ACPI_SAR_6GHZ_SUBBAND_8; + } +} + +enum rtw89_band rtw89_acpi_sar_subband_to_band(struct rtw89_dev *rtwdev, + enum rtw89_acpi_sar_subband subband) +{ + switch (subband) { + default: + rtw89_debug(rtwdev, RTW89_DBG_ACPI, + "ACPI SAR subband %u to band is unhandled\n", subband); + fallthrough; + case RTW89_ACPI_SAR_2GHZ_SUBBAND: + return RTW89_BAND_2G; + case RTW89_ACPI_SAR_5GHZ_SUBBAND_1: + return RTW89_BAND_5G; + case RTW89_ACPI_SAR_5GHZ_SUBBAND_2: + return RTW89_BAND_5G; + case RTW89_ACPI_SAR_5GHZ_SUBBAND_2E: + return RTW89_BAND_5G; + case RTW89_ACPI_SAR_5GHZ_SUBBAND_3_4: + return RTW89_BAND_5G; + case RTW89_ACPI_SAR_6GHZ_SUBBAND_5_L: + return RTW89_BAND_6G; + case RTW89_ACPI_SAR_6GHZ_SUBBAND_5_H: + return RTW89_BAND_6G; + case RTW89_ACPI_SAR_6GHZ_SUBBAND_6: + return RTW89_BAND_6G; + case RTW89_ACPI_SAR_6GHZ_SUBBAND_7_L: + return RTW89_BAND_6G; + case RTW89_ACPI_SAR_6GHZ_SUBBAND_7_H: + return RTW89_BAND_6G; + case RTW89_ACPI_SAR_6GHZ_SUBBAND_8: + return RTW89_BAND_6G; + } +} + +static u8 rtw89_acpi_sar_rfpath_to_hp_antidx(enum rtw89_rf_path rfpath) +{ + switch (rfpath) { + default: + case RF_PATH_B: + return 0; + case RF_PATH_A: + return 1; + } +} + +static u8 rtw89_acpi_sar_rfpath_to_rt_antidx(enum rtw89_rf_path rfpath) +{ + switch (rfpath) { + default: + case RF_PATH_A: + return 0; + case RF_PATH_B: + return 1; + } +} + +static s16 rtw89_acpi_sar_normalize_hp_val(u8 v) +{ + static const u8 bias = 10; + static const u8 fct = 1; + u16 res; + + BUILD_BUG_ON(fct > TXPWR_FACTOR_OF_RTW89_ACPI_SAR); + + res = (bias << TXPWR_FACTOR_OF_RTW89_ACPI_SAR) + + (v << (TXPWR_FACTOR_OF_RTW89_ACPI_SAR - fct)); + + return min_t(s32, res, MAX_VAL_OF_RTW89_ACPI_SAR); +} + +static s16 rtw89_acpi_sar_normalize_rt_val(u8 v) +{ + static const u8 fct = 3; + u16 res; + + BUILD_BUG_ON(fct > TXPWR_FACTOR_OF_RTW89_ACPI_SAR); + + res = v << (TXPWR_FACTOR_OF_RTW89_ACPI_SAR - fct); + + return min_t(s32, res, MAX_VAL_OF_RTW89_ACPI_SAR); +} + +static +void rtw89_acpi_sar_load_std_legacy(struct rtw89_dev *rtwdev, + const struct rtw89_acpi_sar_recognition *rec, + const void *content, + struct rtw89_sar_entry_from_acpi *ent) +{ + const struct rtw89_acpi_sar_std_legacy *ptr = content; + enum rtw89_acpi_sar_subband subband; + enum rtw89_rf_path path; + + for (subband = 0; subband < NUM_OF_RTW89_ACPI_SAR_SUBBAND; subband++) { + for (path = 0; path < NUM_OF_RTW89_ACPI_SAR_RF_PATH; path++) { + u8 antidx = rec->rfpath_to_antidx(path); + + if (subband < RTW89_ACPI_SAR_SUBBAND_NR_LEGACY) + ent->v[subband][path] = + rec->normalize(ptr->v[antidx][subband]); + else + ent->v[subband][path] = MAX_VAL_OF_RTW89_ACPI_SAR; + } + } +} + +static +void rtw89_acpi_sar_load_std_has_6ghz(struct rtw89_dev *rtwdev, + const struct rtw89_acpi_sar_recognition *rec, + const void *content, + struct rtw89_sar_entry_from_acpi *ent) +{ + const struct rtw89_acpi_sar_std_has_6ghz *ptr = content; + enum rtw89_acpi_sar_subband subband; + enum rtw89_rf_path path; + + BUILD_BUG_ON(RTW89_ACPI_SAR_SUBBAND_NR_HAS_6GHZ != NUM_OF_RTW89_ACPI_SAR_SUBBAND); + + for (subband = 0; subband < NUM_OF_RTW89_ACPI_SAR_SUBBAND; subband++) { + for (path = 0; path < NUM_OF_RTW89_ACPI_SAR_RF_PATH; path++) { + u8 antidx = rec->rfpath_to_antidx(path); + + ent->v[subband][path] = rec->normalize(ptr->v[antidx][subband]); + } + } +} + +static +void rtw89_acpi_sar_load_sml_legacy(struct rtw89_dev *rtwdev, + const struct rtw89_acpi_sar_recognition *rec, + const void *content, + struct rtw89_sar_entry_from_acpi *ent) +{ + const struct rtw89_acpi_sar_sml_legacy *ptr = content; + enum rtw89_acpi_sar_subband subband; + enum rtw89_rf_path path; + + for (subband = 0; subband < NUM_OF_RTW89_ACPI_SAR_SUBBAND; subband++) { + for (path = 0; path < NUM_OF_RTW89_ACPI_SAR_RF_PATH; path++) { + u8 antidx = rec->rfpath_to_antidx(path); + + if (subband < RTW89_ACPI_SAR_SUBBAND_NR_LEGACY) + ent->v[subband][path] = + rec->normalize(ptr->v[antidx][subband]); + else + ent->v[subband][path] = MAX_VAL_OF_RTW89_ACPI_SAR; + } + } +} + +static +void rtw89_acpi_sar_load_sml_has_6ghz(struct rtw89_dev *rtwdev, + const struct rtw89_acpi_sar_recognition *rec, + const void *content, + struct rtw89_sar_entry_from_acpi *ent) +{ + const struct rtw89_acpi_sar_sml_has_6ghz *ptr = content; + enum rtw89_acpi_sar_subband subband; + enum rtw89_rf_path path; + + BUILD_BUG_ON(RTW89_ACPI_SAR_SUBBAND_NR_HAS_6GHZ != NUM_OF_RTW89_ACPI_SAR_SUBBAND); + + for (subband = 0; subband < NUM_OF_RTW89_ACPI_SAR_SUBBAND; subband++) { + for (path = 0; path < NUM_OF_RTW89_ACPI_SAR_RF_PATH; path++) { + u8 antidx = rec->rfpath_to_antidx(path); + + ent->v[subband][path] = rec->normalize(ptr->v[antidx][subband]); + } + } +} + +static s16 rtw89_acpi_geo_sar_normalize_delta(s8 delta) +{ + static const u8 fct = 1; + + BUILD_BUG_ON(fct > TXPWR_FACTOR_OF_RTW89_ACPI_SAR); + + return delta << (TXPWR_FACTOR_OF_RTW89_ACPI_SAR - fct); +} + +static enum rtw89_acpi_geo_sar_regd_hp +rtw89_acpi_geo_sar_regd_convert_hp_idx(enum rtw89_regulation_type regd) +{ + switch (regd) { + case RTW89_FCC: + case RTW89_IC: + case RTW89_NCC: + case RTW89_CHILE: + case RTW89_MEXICO: + return RTW89_ACPI_GEO_SAR_REGD_HP_FCC; + case RTW89_ETSI: + case RTW89_MKK: + case RTW89_ACMA: + return RTW89_ACPI_GEO_SAR_REGD_HP_ETSI; + default: + case RTW89_WW: + case RTW89_NA: + case RTW89_KCC: + return RTW89_ACPI_GEO_SAR_REGD_HP_WW; + } +} + +static enum rtw89_acpi_geo_sar_regd_rt +rtw89_acpi_geo_sar_regd_convert_rt_idx(enum rtw89_regulation_type regd) +{ + switch (regd) { + case RTW89_FCC: + case RTW89_NCC: + case RTW89_CHILE: + case RTW89_MEXICO: + return RTW89_ACPI_GEO_SAR_REGD_RT_FCC; + case RTW89_ETSI: + case RTW89_ACMA: + return RTW89_ACPI_GEO_SAR_REGD_RT_ETSI; + case RTW89_MKK: + return RTW89_ACPI_GEO_SAR_REGD_RT_MKK; + case RTW89_IC: + return RTW89_ACPI_GEO_SAR_REGD_RT_IC; + case RTW89_KCC: + return RTW89_ACPI_GEO_SAR_REGD_RT_KCC; + default: + case RTW89_WW: + case RTW89_NA: + return RTW89_ACPI_GEO_SAR_REGD_RT_WW; + } +} + +static +void rtw89_acpi_geo_sar_load_by_hp(struct rtw89_dev *rtwdev, + const struct rtw89_acpi_geo_sar_hp_val *ptr, + enum rtw89_rf_path path, s16 *val) +{ + u8 antidx = rtw89_acpi_sar_rfpath_to_hp_antidx(path); + s16 delta = rtw89_acpi_geo_sar_normalize_delta(ptr->delta[antidx]); + s16 max = rtw89_acpi_sar_normalize_hp_val(ptr->max); + + *val = clamp_t(s32, (*val) + delta, MIN_VAL_OF_RTW89_ACPI_SAR, max); +} + +static +void rtw89_acpi_geo_sar_load_by_rt(struct rtw89_dev *rtwdev, + const struct rtw89_acpi_geo_sar_rt_val *ptr, + s16 *val) +{ + s16 delta = rtw89_acpi_geo_sar_normalize_delta(ptr->delta); + s16 max = rtw89_acpi_sar_normalize_rt_val(ptr->max); + + *val = clamp_t(s32, (*val) + delta, MIN_VAL_OF_RTW89_ACPI_SAR, max); +} + +static +void rtw89_acpi_geo_sar_load_hp_legacy(struct rtw89_dev *rtwdev, + const void *content, + enum rtw89_regulation_type regd, + struct rtw89_sar_entry_from_acpi *ent) +{ + const struct rtw89_acpi_geo_sar_hp_legacy *ptr = content; + const struct rtw89_acpi_geo_sar_hp_legacy_entry *ptr_ent; + const struct rtw89_acpi_geo_sar_hp_val *ptr_ent_val; + enum rtw89_acpi_geo_sar_regd_hp geo_idx = + rtw89_acpi_geo_sar_regd_convert_hp_idx(regd); + enum rtw89_acpi_sar_subband subband; + enum rtw89_rf_path path; + enum rtw89_band band; + + ptr_ent = &ptr->entries[geo_idx]; + + for (subband = 0; subband < NUM_OF_RTW89_ACPI_SAR_SUBBAND; subband++) { + band = rtw89_acpi_sar_subband_to_band(rtwdev, subband); + switch (band) { + case RTW89_BAND_2G: + ptr_ent_val = &ptr_ent->val_2ghz; + break; + case RTW89_BAND_5G: + ptr_ent_val = &ptr_ent->val_5ghz; + break; + default: + case RTW89_BAND_6G: + ptr_ent_val = NULL; + break; + } + + if (!ptr_ent_val) + continue; + + for (path = 0; path < NUM_OF_RTW89_ACPI_SAR_RF_PATH; path++) + rtw89_acpi_geo_sar_load_by_hp(rtwdev, ptr_ent_val, path, + &ent->v[subband][path]); + } +} + +static +void rtw89_acpi_geo_sar_load_hp_has_6ghz(struct rtw89_dev *rtwdev, + const void *content, + enum rtw89_regulation_type regd, + struct rtw89_sar_entry_from_acpi *ent) +{ + const struct rtw89_acpi_geo_sar_hp_has_6ghz *ptr = content; + const struct rtw89_acpi_geo_sar_hp_has_6ghz_entry *ptr_ent; + const struct rtw89_acpi_geo_sar_hp_val *ptr_ent_val; + enum rtw89_acpi_geo_sar_regd_hp geo_idx = + rtw89_acpi_geo_sar_regd_convert_hp_idx(regd); + enum rtw89_acpi_sar_subband subband; + enum rtw89_rf_path path; + enum rtw89_band band; + + ptr_ent = &ptr->entries[geo_idx]; + + for (subband = 0; subband < NUM_OF_RTW89_ACPI_SAR_SUBBAND; subband++) { + band = rtw89_acpi_sar_subband_to_band(rtwdev, subband); + switch (band) { + case RTW89_BAND_2G: + ptr_ent_val = &ptr_ent->val_2ghz; + break; + case RTW89_BAND_5G: + ptr_ent_val = &ptr_ent->val_5ghz; + break; + case RTW89_BAND_6G: + ptr_ent_val = &ptr_ent->val_6ghz; + break; + default: + ptr_ent_val = NULL; + break; + } + + if (!ptr_ent_val) + continue; + + for (path = 0; path < NUM_OF_RTW89_ACPI_SAR_RF_PATH; path++) + rtw89_acpi_geo_sar_load_by_hp(rtwdev, ptr_ent_val, path, + &ent->v[subband][path]); + } +} + +static +void rtw89_acpi_geo_sar_load_rt_legacy(struct rtw89_dev *rtwdev, + const void *content, + enum rtw89_regulation_type regd, + struct rtw89_sar_entry_from_acpi *ent) +{ + const struct rtw89_acpi_geo_sar_rt_legacy *ptr = content; + const struct rtw89_acpi_geo_sar_rt_legacy_entry *ptr_ent; + const struct rtw89_acpi_geo_sar_rt_val *ptr_ent_val; + enum rtw89_acpi_geo_sar_regd_rt geo_idx = + rtw89_acpi_geo_sar_regd_convert_rt_idx(regd); + enum rtw89_acpi_sar_subband subband; + enum rtw89_rf_path path; + enum rtw89_band band; + + ptr_ent = &ptr->entries[geo_idx]; + + for (subband = 0; subband < NUM_OF_RTW89_ACPI_SAR_SUBBAND; subband++) { + band = rtw89_acpi_sar_subband_to_band(rtwdev, subband); + switch (band) { + case RTW89_BAND_2G: + ptr_ent_val = &ptr_ent->val_2ghz; + break; + case RTW89_BAND_5G: + ptr_ent_val = &ptr_ent->val_5ghz; + break; + default: + case RTW89_BAND_6G: + ptr_ent_val = NULL; + break; + } + + if (!ptr_ent_val) + continue; + + for (path = 0; path < NUM_OF_RTW89_ACPI_SAR_RF_PATH; path++) + rtw89_acpi_geo_sar_load_by_rt(rtwdev, ptr_ent_val, + &ent->v[subband][path]); + } +} + +static +void rtw89_acpi_geo_sar_load_rt_has_6ghz(struct rtw89_dev *rtwdev, + const void *content, + enum rtw89_regulation_type regd, + struct rtw89_sar_entry_from_acpi *ent) +{ + const struct rtw89_acpi_geo_sar_rt_has_6ghz *ptr = content; + const struct rtw89_acpi_geo_sar_rt_has_6ghz_entry *ptr_ent; + const struct rtw89_acpi_geo_sar_rt_val *ptr_ent_val; + enum rtw89_acpi_geo_sar_regd_rt geo_idx = + rtw89_acpi_geo_sar_regd_convert_rt_idx(regd); + enum rtw89_acpi_sar_subband subband; + enum rtw89_rf_path path; + enum rtw89_band band; + + ptr_ent = &ptr->entries[geo_idx]; + + for (subband = 0; subband < NUM_OF_RTW89_ACPI_SAR_SUBBAND; subband++) { + band = rtw89_acpi_sar_subband_to_band(rtwdev, subband); + switch (band) { + case RTW89_BAND_2G: + ptr_ent_val = &ptr_ent->val_2ghz; + break; + case RTW89_BAND_5G: + ptr_ent_val = &ptr_ent->val_5ghz; + break; + case RTW89_BAND_6G: + ptr_ent_val = &ptr_ent->val_6ghz; + break; + default: + ptr_ent_val = NULL; + break; + } + + if (!ptr_ent_val) + continue; + + for (path = 0; path < NUM_OF_RTW89_ACPI_SAR_RF_PATH; path++) + rtw89_acpi_geo_sar_load_by_rt(rtwdev, ptr_ent_val, + &ent->v[subband][path]); + } +} + +#define RTW89_ACPI_GEO_SAR_DECL_HANDLER(type) \ +static const struct rtw89_acpi_geo_sar_handler \ +rtw89_acpi_geo_sar_handler_ ## type = { \ + .data_size = RTW89_ACPI_GEO_SAR_SIZE_OF(type), \ + .load = rtw89_acpi_geo_sar_load_ ## type, \ +} + +RTW89_ACPI_GEO_SAR_DECL_HANDLER(hp_legacy); +RTW89_ACPI_GEO_SAR_DECL_HANDLER(hp_has_6ghz); +RTW89_ACPI_GEO_SAR_DECL_HANDLER(rt_legacy); +RTW89_ACPI_GEO_SAR_DECL_HANDLER(rt_has_6ghz); + +static const struct rtw89_acpi_sar_recognition rtw89_acpi_sar_recs[] = { + { + .id = { + .cid = RTW89_ACPI_SAR_CID_HP, *** 57505 LINES SKIPPED *** From nobody Sat Apr 18 20:59:57 2026 X-Original-To: dev-commits-src-main@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 4fykf61zVfz6ZHd5 for ; Sat, 18 Apr 2026 20:59:58 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fykf60Sqyz3V3j for ; Sat, 18 Apr 2026 20:59:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776545998; 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=+B24JSRglhXO9ZHQJ8PLuMuX5werrVBCmxonQzWCSWc=; b=sZB20uCkyViLgGUmzTwX+h/DxkMvhadtb/hP6eEY/LYjVkkHC5KWmvmzdJw99rBvK2k+a5 aO73cIx6nA0cTs8bZxJkkCQeJ/JaBzrs4IMv9BBDg3ky6qWI4hSpJ8Jk9h0WadvSwQs0jt 9vPSf9BK6yCCl6ewi3q+z8RDK5rm1DkcQFUOS597EY9TK4NlKomr5Yg5mxL0LRuH8QDMre CtYDx9+BkX/3jr/2dToWdJFd44pV0pLH/6JSzltso0lc/1PzIV2XJNNRq3fqh8WIcSeQ+Z jsape1rbBPWh6l/77Nvi/zhzDh4LYiamW+ACU4Ix4nA1BK/LahqpH3c3ddloaQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776545998; a=rsa-sha256; cv=none; b=bRfGG3OIss+7Hsnqbs1ywdwWaUbRSGCyeKpFD4JDXnctaLEtRK5n3DtTXm+c0wKDc1sDzn 7gmBFjQHIYY1w2mP50wuSo1ZsLXb1cY6Ia6KJVJwFlCXTmtqFoDb31ovZ/uqABpomwCckg 68GYaWbnZfsRYbhkLVC2IeiWdMdm5PaEV2MJAZihFtArrQvo1lLwg1px9SOEqVCVIntzuA ORMfktS/3Z+/h20SeY7qkLpqunVh1boUdPwiVRurIdrop+rkn72d0O3uGJ1P59JVLLaTEk NfmOzAsibLhFCPtnyhQf4WjkCwYMX8L+gCYXVbUk1QuW4BITxoRhnsFMnhVfAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776545998; 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=+B24JSRglhXO9ZHQJ8PLuMuX5werrVBCmxonQzWCSWc=; b=FOTGGQWIQ9YRONdEc2xKLNbe7jcZJWhfIz5XxZxBUGxWdMFb12QwNeX/n/TkC8WSkHDj5d tY45Hs644nx9zZTKHhx1VwGwnvOPDQfuLh44BW+2uwGKdsoTL5OOsoXOUSTNOCY+wFgCeC d9Q0IhgNH0rhGI+oN4uWihTKQTmWCvZTji7D7su+BERHNOgkNQRnK+LB0bReSqKvWgjgiR a0WHtXsNsyaQZK+/4qKPFrueVQKIs3FBhwwV0WZqi3TP0jowWJrs3ja4MtjswuCIqK1NiD 82rHEN9w+8q8d9Aid6Xp7o68/ZbGQywJfguwC4TIlxZgidfkysPJ1e4POXMSng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fykf575jCzwYk for ; Sat, 18 Apr 2026 20:59:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 222c2 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 20:59:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 3780e6f9db01 - main - rtw89: update module Makefile for v7.0 driver version List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3780e6f9db01cc4f7d53d67ed1fc992a8f64c53f Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 20:59:57 +0000 Message-Id: <69e3f0cd.222c2.64a05722@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3780e6f9db01cc4f7d53d67ed1fc992a8f64c53f commit 3780e6f9db01cc4f7d53d67ed1fc992a8f64c53f Author: Bjoern A. Zeeb AuthorDate: 2026-04-18 20:50:30 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 20:50:30 +0000 rtw89: update module Makefile for v7.0 driver version Update LINUXKPI_VERSION to reflect that the driver is based on Linux v7.0. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/modules/rtw89/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/rtw89/Makefile b/sys/modules/rtw89/Makefile index cb7c3ece7065..b7f8dc7a2c6e 100644 --- a/sys/modules/rtw89/Makefile +++ b/sys/modules/rtw89/Makefile @@ -83,6 +83,6 @@ CFLAGS+= ${LINUXKPI_INCLUDES} #CFLAGS+= -ferror-limit=0 -fmacro-backtrace-limit=0 CFLAGS+= -DKBUILD_MODNAME='"rtw89"' -CFLAGS+= -DLINUXKPI_VERSION=61900 +CFLAGS+= -DLINUXKPI_VERSION=70000 .include From nobody Sat Apr 18 21:03:37 2026 X-Original-To: dev-commits-src-main@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 4fykkK6SRGz6ZHy7 for ; Sat, 18 Apr 2026 21:03: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fykkK26FJz3WZy for ; Sat, 18 Apr 2026 21:03:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776546217; 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=OIXacPt8IAk77X+meinSSdMRBpvhLKOegTfYLOD6RRI=; b=jZQQD0WlbbqsHpSCHPDOMtV+ZP4BggaY+xQNVyceMJZcgWnZRoVZvGpFZz3+k/fkE8ed4h dps8ILiqzZ2XDgcnn2nVd8B9KsB+p2+IZ8GisiH+0ozgWg7bzt4AUjHPFcgAnshGdryhMj foYgWHAMj9xps52rLnqVRwXh4TtdLSjbHDYCHxg+gEiawGJ3psGSRUYqwwK325+XzdALW0 XLirtdNeo0psqxGM6nyXWeBG+M56AjQzFkHhrjr+eawOH3mWRwl1dx7FIv+1uEx4kVGlFF pAZ4DclGoyHVO+wM51Zw+GKoiV0WKfjarNNFoD8XsDiZRG0Ac5Ci6c5e9RluIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776546217; a=rsa-sha256; cv=none; b=FGSmkuU7yj4yFXJUcM06q5omXLR+xdJEQBO4fl9is3/Seez+vYRW98s/r3e2XqC9cd3GCg yAX9OBWdY77czzOanV/rNb3hozMZLteQT/Cy1kVFjtQIQ+52Z4aG+N1KWkk/wMoutJqg7y Ai/T16PkUnILZ0wVPZE4NR3viySzD1vGwyHR3z+bQeyxzziw9z/ChiFG2WCNqAiQH7JPl8 ODrg0AZ2yj77nuNao3KuAiYVHWEV4lBmMU+832yStxZ8mFPNO1krmvC1fhn9JDobAxg5j+ ab+n221r5bPrONx2Krfay1g0xBj1RWKRMyNAVzmcvNHwfuvpRl2byuNK9O734Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776546217; 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=OIXacPt8IAk77X+meinSSdMRBpvhLKOegTfYLOD6RRI=; b=f3CVWWeynb2SPBBAK1gK4BDSHOO7AkUSPOtKa7+5x8nLiNKRU2vC/dnrdMkFWzesr+QNq0 ayknrSvJGuTdT8uYKNeSWGoU+CsDTt9vhZR3KHT8LkWodav2KsvdEvK+cAIDBpUU42yK3d KypPHwELMCr+pFjP/U+f8AXUqAH0YcqnHstEjtfnvfoLyRRBn+BL6PJjO+c1ivIQQ+J/1D j0v+AumctujHsvNJxPhd/VZ3sy9cdOEcaexbhoWbs9SRbhek/kEf4KDuy1WkJ6D8RItv+D Ftkb0uOspYBWovJus+gE6jwXDK6csJTYN3zWDldjaC1RfO+w6aE0RNWVoCPzIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fykkK1WS0zwX4 for ; Sat, 18 Apr 2026 21:03:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 24cae by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 21:03:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 1c50cb1d7562 - main - mt76: update module Makefile for v7.0 driver version List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c50cb1d75625bea2ba928697ea1cbafa29dd245 Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 21:03:37 +0000 Message-Id: <69e3f1a9.24cae.13400f2f@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1c50cb1d75625bea2ba928697ea1cbafa29dd245 commit 1c50cb1d75625bea2ba928697ea1cbafa29dd245 Author: Bjoern A. Zeeb AuthorDate: 2026-04-18 21:02:57 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 21:02:57 +0000 mt76: update module Makefile for v7.0 driver version Update LINUXKPI_VERSION to reflect that the driver is based on Linux v7.0. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/modules/mt76/Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/modules/mt76/Makefile.inc b/sys/modules/mt76/Makefile.inc index b44dcd2e2e82..5aa19fe183af 100644 --- a/sys/modules/mt76/Makefile.inc +++ b/sys/modules/mt76/Makefile.inc @@ -45,5 +45,5 @@ CFLAGS+= ${LINUXKPI_INCLUDES} #CFLAGS+= -ferror-limit=0 CFLAGS+= -DKBUILD_MODNAME='"${MT76_DRIVER_NAME}"' -CFLAGS+= -DLINUXKPI_VERSION=61900 +CFLAGS+= -DLINUXKPI_VERSION=70000 From nobody Sat Apr 18 21:03:35 2026 X-Original-To: dev-commits-src-main@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 4fykkP4qT2z6ZJ7x for ; Sat, 18 Apr 2026 21:03:41 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fykkP1Pbpz3Wdw for ; Sat, 18 Apr 2026 21:03:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776546221; 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=OVPaW9NsP+e+FTx5+xcqn11uOIa/tNWVyZMVY5i0cBA=; b=bFgcqaj0tKfhF/6fA/W7KWhutw+eSGFyEU9PPMMZAO876lE7eEtKpYfe6peE2jCSWCtJh+ eDnnKMHlaV9k6YIOIJDHz6HZwEepq/MvQXNaM8BFSXxVRHn1MONP2ZJfjoRI+Ef5aTaebc i0ABxuVKqB3TmuoBz8fFk2HeZRzGPhfIVvFXnagjTn5DyB4rAyDbFA3tfI95VVbWqb+Fiy kdo9tqPupkZ95OsnEeETkGOrfxQHjsC35goKuo7zXlR4tDV138meXuUws/63OFqHsnQlVw cE0sRUbupR+rQ8pqj7WeQ36An1kGe1hdQklJ4wnXTN9JkcD0Bp0JrV5FZi8DAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776546221; a=rsa-sha256; cv=none; b=uqjJ51MagogIbcmCa5ZICLLr7CEkk/PIncexaAOBUbVJXYrughH5duP7VRUf3hy6fxP3/4 4ZpDJ2Z3ijf5x5LZe43+VsFSdiUKu5g1wTEklFrSBCpsawwLEpFpgTqFKMYuA5CCCasV0G 1V+NT69L5s38IAKbA/Us45BbPsjgb8C3fL0Q1Itnf37xPBGDriWQeFUqG4ihKuKfxYrUcd SgmDYSglS01drHCky/ES9yTzDT4XGWZ9FUiVTrfV+0kZt0ZGm+feAIxhfmVmWiHPF1Kb6P iqsomV1OD6gWSQ8LlRdIeLcbAWnxKDimjkcmJE+QKt3xyQjeedpphBkiiWwEuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776546221; 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=OVPaW9NsP+e+FTx5+xcqn11uOIa/tNWVyZMVY5i0cBA=; b=CCFRDX48Ch6pGbWzRxhv6Wr695sSr8VKflyJQUYjnXav5SAPS/DIyuvPiAM5WP75UtWvEY G5Zo6dO0RBQyjFQ70cVeOdyXI0tqeTMkX6Uko4FoNqOUFjADygJthxc8q+ys1D3fifhBXl HxM398PTWYdWaIdXrLKd9TT3dA3462LDV2H+81Ctae+eyuZ5XJVtgVXKjOmLGTVLZp3kJX qklO6gscwGE+rCitjyBX+aGSucF/qoX6oqC7rJyLLUmk83TlKOLypWovD0vNzMoYRUA9GX oScQxl2tYOPE+KVPg4QZ8dlgwAfwlJvmEEvasghKRXde2Ut210QbSxKmn+ylPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fykkP0sKBzwTY for ; Sat, 18 Apr 2026 21:03:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 263cf by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 18 Apr 2026 21:03:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 63a40b65c9be - main - mt76: update Mediatek's mt76 driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 63a40b65c9be74193bb07a76fd66c249bd562eae Auto-Submitted: auto-generated Date: Sat, 18 Apr 2026 21:03:35 +0000 Message-Id: <69e3f1a7.263cf.6ebf7817@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=63a40b65c9be74193bb07a76fd66c249bd562eae commit 63a40b65c9be74193bb07a76fd66c249bd562eae Merge: 3780e6f9db01 5927bf24daca Author: Bjoern A. Zeeb AuthorDate: 2026-04-18 21:01:39 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-18 21:01:39 +0000 mt76: update Mediatek's mt76 driver This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ). Sponsored by: The FreeBSD Foundation MFC after: 3 days sys/contrib/dev/mediatek/mt76/agg-rx.c | 2 +- sys/contrib/dev/mediatek/mt76/mt7615/mac.c | 2 +- sys/contrib/dev/mediatek/mt76/mt7615/mt7615.h | 1 + sys/contrib/dev/mediatek/mt76/mt76_connac_mac.c | 1 + sys/contrib/dev/mediatek/mt76/mt7925/mac.c | 1 + sys/contrib/dev/mediatek/mt76/mt7996/mac.c | 1 + sys/contrib/dev/mediatek/mt76/mt7996/main.c | 2 +- sys/contrib/dev/mediatek/mt76/mt7996/mcu.c | 2 +- sys/contrib/dev/mediatek/mt76/scan.c | 4 +--- 9 files changed, 9 insertions(+), 7 deletions(-) diff --cc sys/contrib/dev/mediatek/mt76/mt7615/mac.c index a4a252dc0186,000000000000..0ba8a0a6fe8f mode 100644,000000..100644 --- a/sys/contrib/dev/mediatek/mt76/mt7615/mac.c +++ b/sys/contrib/dev/mediatek/mt76/mt7615/mac.c @@@ -1,2371 -1,0 +1,2371 @@@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +/* Copyright (C) 2019 MediaTek Inc. + * + * Author: Ryder Lee + * Roy Luo + * Felix Fietkau + * Lorenzo Bianconi + */ + +#include +#include +#include +#if defined(__FreeBSD__) +#include +#endif +#include "mt7615.h" +#include "../trace.h" +#include "../dma.h" +#include "mt7615_trace.h" +#include "mac.h" +#include "mcu.h" + +#define to_rssi(field, rxv) ((FIELD_GET(field, rxv) - 220) / 2) + +static const struct mt7615_dfs_radar_spec etsi_radar_specs = { + .pulse_th = { 110, -10, -80, 40, 5200, 128, 5200 }, + .radar_pattern = { + [5] = { 1, 0, 6, 32, 28, 0, 17, 990, 5010, 1, 1 }, + [6] = { 1, 0, 9, 32, 28, 0, 27, 615, 5010, 1, 1 }, + [7] = { 1, 0, 15, 32, 28, 0, 27, 240, 445, 1, 1 }, + [8] = { 1, 0, 12, 32, 28, 0, 42, 240, 510, 1, 1 }, + [9] = { 1, 1, 0, 0, 0, 0, 14, 2490, 3343, 0, 0, 12, 32, 28 }, + [10] = { 1, 1, 0, 0, 0, 0, 14, 2490, 3343, 0, 0, 15, 32, 24 }, + [11] = { 1, 1, 0, 0, 0, 0, 14, 823, 2510, 0, 0, 18, 32, 28 }, + [12] = { 1, 1, 0, 0, 0, 0, 14, 823, 2510, 0, 0, 27, 32, 24 }, + }, +}; + +static const struct mt7615_dfs_radar_spec fcc_radar_specs = { + .pulse_th = { 110, -10, -80, 40, 5200, 128, 5200 }, + .radar_pattern = { + [0] = { 1, 0, 9, 32, 28, 0, 13, 508, 3076, 1, 1 }, + [1] = { 1, 0, 12, 32, 28, 0, 17, 140, 240, 1, 1 }, + [2] = { 1, 0, 8, 32, 28, 0, 22, 190, 510, 1, 1 }, + [3] = { 1, 0, 6, 32, 28, 0, 32, 190, 510, 1, 1 }, + [4] = { 1, 0, 9, 255, 28, 0, 13, 323, 343, 1, 32 }, + }, +}; + +static const struct mt7615_dfs_radar_spec jp_radar_specs = { + .pulse_th = { 110, -10, -80, 40, 5200, 128, 5200 }, + .radar_pattern = { + [0] = { 1, 0, 8, 32, 28, 0, 13, 508, 3076, 1, 1 }, + [1] = { 1, 0, 12, 32, 28, 0, 17, 140, 240, 1, 1 }, + [2] = { 1, 0, 8, 32, 28, 0, 22, 190, 510, 1, 1 }, + [3] = { 1, 0, 6, 32, 28, 0, 32, 190, 510, 1, 1 }, + [4] = { 1, 0, 9, 32, 28, 0, 13, 323, 343, 1, 32 }, + [13] = { 1, 0, 8, 32, 28, 0, 14, 3836, 3856, 1, 1 }, + [14] = { 1, 0, 8, 32, 28, 0, 14, 3990, 4010, 1, 1 }, + }, +}; + +static enum mt76_cipher_type +mt7615_mac_get_cipher(int cipher) +{ + switch (cipher) { + case WLAN_CIPHER_SUITE_WEP40: + return MT_CIPHER_WEP40; + case WLAN_CIPHER_SUITE_WEP104: + return MT_CIPHER_WEP104; + case WLAN_CIPHER_SUITE_TKIP: + return MT_CIPHER_TKIP; + case WLAN_CIPHER_SUITE_AES_CMAC: + return MT_CIPHER_BIP_CMAC_128; + case WLAN_CIPHER_SUITE_CCMP: + return MT_CIPHER_AES_CCMP; + case WLAN_CIPHER_SUITE_CCMP_256: + return MT_CIPHER_CCMP_256; + case WLAN_CIPHER_SUITE_GCMP: + return MT_CIPHER_GCMP; + case WLAN_CIPHER_SUITE_GCMP_256: + return MT_CIPHER_GCMP_256; + case WLAN_CIPHER_SUITE_SMS4: + return MT_CIPHER_WAPI; + default: + return MT_CIPHER_NONE; + } +} + +static struct mt76_wcid *mt7615_rx_get_wcid(struct mt7615_dev *dev, + u8 idx, bool unicast) +{ + struct mt7615_sta *sta; + struct mt76_wcid *wcid; + + wcid = mt76_wcid_ptr(dev, idx); + if (unicast || !wcid) + return wcid; + + if (!wcid->sta) + return NULL; + + sta = container_of(wcid, struct mt7615_sta, wcid); + if (!sta->vif) + return NULL; + + return &sta->vif->sta.wcid; +} + +void mt7615_mac_reset_counters(struct mt7615_phy *phy) +{ + struct mt7615_dev *dev = phy->dev; + int i; + + for (i = 0; i < 4; i++) { + mt76_rr(dev, MT_TX_AGG_CNT(0, i)); + mt76_rr(dev, MT_TX_AGG_CNT(1, i)); + } + + memset(phy->mt76->aggr_stats, 0, sizeof(phy->mt76->aggr_stats)); + phy->mt76->survey_time = ktime_get_boottime(); + + /* reset airtime counters */ + mt76_rr(dev, MT_MIB_SDR9(0)); + mt76_rr(dev, MT_MIB_SDR9(1)); + + mt76_rr(dev, MT_MIB_SDR36(0)); + mt76_rr(dev, MT_MIB_SDR36(1)); + + mt76_rr(dev, MT_MIB_SDR37(0)); + mt76_rr(dev, MT_MIB_SDR37(1)); + + mt76_set(dev, MT_WF_RMAC_MIB_TIME0, MT_WF_RMAC_MIB_RXTIME_CLR); + mt76_set(dev, MT_WF_RMAC_MIB_AIRTIME0, MT_WF_RMAC_MIB_RXTIME_CLR); +} + +void mt7615_mac_set_timing(struct mt7615_phy *phy) +{ + s16 coverage_class = phy->coverage_class; + struct mt7615_dev *dev = phy->dev; + bool ext_phy = phy != &dev->phy; + u32 val, reg_offset; + u32 cck = FIELD_PREP(MT_TIMEOUT_VAL_PLCP, 231) | + FIELD_PREP(MT_TIMEOUT_VAL_CCA, 48); + u32 ofdm = FIELD_PREP(MT_TIMEOUT_VAL_PLCP, 60) | + FIELD_PREP(MT_TIMEOUT_VAL_CCA, 28); + int sifs, offset; + bool is_5ghz = phy->mt76->chandef.chan->band == NL80211_BAND_5GHZ; + + if (!test_bit(MT76_STATE_RUNNING, &phy->mt76->state)) + return; + + if (is_5ghz) + sifs = 16; + else + sifs = 10; + + if (ext_phy) { + coverage_class = max_t(s16, dev->phy.coverage_class, + coverage_class); + mt76_set(dev, MT_ARB_SCR, + MT_ARB_SCR_TX1_DISABLE | MT_ARB_SCR_RX1_DISABLE); + } else { + struct mt7615_phy *phy_ext = mt7615_ext_phy(dev); + + if (phy_ext) + coverage_class = max_t(s16, phy_ext->coverage_class, + coverage_class); + mt76_set(dev, MT_ARB_SCR, + MT_ARB_SCR_TX0_DISABLE | MT_ARB_SCR_RX0_DISABLE); + } + udelay(1); + + offset = 3 * coverage_class; + reg_offset = FIELD_PREP(MT_TIMEOUT_VAL_PLCP, offset) | + FIELD_PREP(MT_TIMEOUT_VAL_CCA, offset); + mt76_wr(dev, MT_TMAC_CDTR, cck + reg_offset); + mt76_wr(dev, MT_TMAC_ODTR, ofdm + reg_offset); + + mt76_wr(dev, MT_TMAC_ICR(ext_phy), + FIELD_PREP(MT_IFS_EIFS, 360) | + FIELD_PREP(MT_IFS_RIFS, 2) | + FIELD_PREP(MT_IFS_SIFS, sifs) | + FIELD_PREP(MT_IFS_SLOT, phy->slottime)); + + if (phy->slottime < 20 || is_5ghz) + val = MT7615_CFEND_RATE_DEFAULT; + else + val = MT7615_CFEND_RATE_11B; + + mt76_rmw_field(dev, MT_AGG_ACR(ext_phy), MT_AGG_ACR_CFEND_RATE, val); + if (ext_phy) + mt76_clear(dev, MT_ARB_SCR, + MT_ARB_SCR_TX1_DISABLE | MT_ARB_SCR_RX1_DISABLE); + else + mt76_clear(dev, MT_ARB_SCR, + MT_ARB_SCR_TX0_DISABLE | MT_ARB_SCR_RX0_DISABLE); + +} + +static void +mt7615_get_status_freq_info(struct mt7615_dev *dev, struct mt76_phy *mphy, + struct mt76_rx_status *status, u8 chfreq) +{ + if (!test_bit(MT76_HW_SCANNING, &mphy->state) && + !test_bit(MT76_HW_SCHED_SCANNING, &mphy->state) && + !test_bit(MT76_STATE_ROC, &mphy->state)) { + status->freq = mphy->chandef.chan->center_freq; + status->band = mphy->chandef.chan->band; + return; + } + + status->band = chfreq <= 14 ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ; + status->freq = ieee80211_channel_to_frequency(chfreq, status->band); +} + +static void mt7615_mac_fill_tm_rx(struct mt7615_phy *phy, __le32 *rxv) +{ +#ifdef CONFIG_NL80211_TESTMODE + u32 rxv1 = le32_to_cpu(rxv[0]); + u32 rxv3 = le32_to_cpu(rxv[2]); + u32 rxv4 = le32_to_cpu(rxv[3]); + u32 rxv5 = le32_to_cpu(rxv[4]); + u8 cbw = FIELD_GET(MT_RXV1_FRAME_MODE, rxv1); + u8 mode = FIELD_GET(MT_RXV1_TX_MODE, rxv1); + s16 foe = FIELD_GET(MT_RXV5_FOE, rxv5); + u32 foe_const = (BIT(cbw + 1) & 0xf) * 10000; + + if (!mode) { + /* CCK */ + foe &= ~BIT(11); + foe *= 1000; + foe >>= 11; + } else { + if (foe > 2048) + foe -= 4096; + + foe = (foe * foe_const) >> 15; + } + + phy->test.last_freq_offset = foe; + phy->test.last_rcpi[0] = FIELD_GET(MT_RXV4_RCPI0, rxv4); + phy->test.last_rcpi[1] = FIELD_GET(MT_RXV4_RCPI1, rxv4); + phy->test.last_rcpi[2] = FIELD_GET(MT_RXV4_RCPI2, rxv4); + phy->test.last_rcpi[3] = FIELD_GET(MT_RXV4_RCPI3, rxv4); + phy->test.last_ib_rssi[0] = FIELD_GET(MT_RXV3_IB_RSSI, rxv3); + phy->test.last_wb_rssi[0] = FIELD_GET(MT_RXV3_WB_RSSI, rxv3); +#endif +} + +/* The HW does not translate the mac header to 802.3 for mesh point */ +static int mt7615_reverse_frag0_hdr_trans(struct sk_buff *skb, u16 hdr_gap) +{ + struct mt76_rx_status *status = (struct mt76_rx_status *)skb->cb; + struct ethhdr *eth_hdr = (struct ethhdr *)(skb->data + hdr_gap); + struct mt7615_sta *msta = (struct mt7615_sta *)status->wcid; + __le32 *rxd = (__le32 *)skb->data; + struct ieee80211_sta *sta; + struct ieee80211_vif *vif; + struct ieee80211_hdr hdr; + u16 frame_control; + + if (le32_get_bits(rxd[1], MT_RXD1_NORMAL_ADDR_TYPE) != + MT_RXD1_NORMAL_U2M) + return -EINVAL; + + if (!(le32_to_cpu(rxd[0]) & MT_RXD0_NORMAL_GROUP_4)) + return -EINVAL; + + if (!msta || !msta->vif) + return -EINVAL; + + sta = container_of((void *)msta, struct ieee80211_sta, drv_priv); + vif = container_of((void *)msta->vif, struct ieee80211_vif, drv_priv); + + /* store the info from RXD and ethhdr to avoid being overridden */ + frame_control = le32_get_bits(rxd[4], MT_RXD4_FRAME_CONTROL); + hdr.frame_control = cpu_to_le16(frame_control); + hdr.seq_ctrl = cpu_to_le16(le32_get_bits(rxd[6], MT_RXD6_SEQ_CTRL)); + hdr.duration_id = 0; + + ether_addr_copy(hdr.addr1, vif->addr); + ether_addr_copy(hdr.addr2, sta->addr); + switch (frame_control & (IEEE80211_FCTL_TODS | + IEEE80211_FCTL_FROMDS)) { + case 0: + ether_addr_copy(hdr.addr3, vif->bss_conf.bssid); + break; + case IEEE80211_FCTL_FROMDS: + ether_addr_copy(hdr.addr3, eth_hdr->h_source); + break; + case IEEE80211_FCTL_TODS: + ether_addr_copy(hdr.addr3, eth_hdr->h_dest); + break; + case IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS: + ether_addr_copy(hdr.addr3, eth_hdr->h_dest); + ether_addr_copy(hdr.addr4, eth_hdr->h_source); + break; + default: + break; + } + + skb_pull(skb, hdr_gap + sizeof(struct ethhdr) - 2); + if (eth_hdr->h_proto == cpu_to_be16(ETH_P_AARP) || + eth_hdr->h_proto == cpu_to_be16(ETH_P_IPX)) + ether_addr_copy(skb_push(skb, ETH_ALEN), bridge_tunnel_header); + else if (be16_to_cpu(eth_hdr->h_proto) >= ETH_P_802_3_MIN) + ether_addr_copy(skb_push(skb, ETH_ALEN), rfc1042_header); + else + skb_pull(skb, 2); + + if (ieee80211_has_order(hdr.frame_control)) + memcpy(skb_push(skb, IEEE80211_HT_CTL_LEN), &rxd[7], + IEEE80211_HT_CTL_LEN); + + if (ieee80211_is_data_qos(hdr.frame_control)) { + __le16 qos_ctrl; + + qos_ctrl = cpu_to_le16(le32_get_bits(rxd[6], MT_RXD6_QOS_CTL)); + memcpy(skb_push(skb, IEEE80211_QOS_CTL_LEN), &qos_ctrl, + IEEE80211_QOS_CTL_LEN); + } + + if (ieee80211_has_a4(hdr.frame_control)) + memcpy(skb_push(skb, sizeof(hdr)), &hdr, sizeof(hdr)); + else + memcpy(skb_push(skb, sizeof(hdr) - 6), &hdr, sizeof(hdr) - 6); + + status->flag &= ~(RX_FLAG_RADIOTAP_HE | RX_FLAG_RADIOTAP_HE_MU); + return 0; +} + +static int mt7615_mac_fill_rx(struct mt7615_dev *dev, struct sk_buff *skb) +{ + struct mt76_rx_status *status = (struct mt76_rx_status *)skb->cb; + struct mt76_phy *mphy = &dev->mt76.phy; + struct mt7615_phy *phy = &dev->phy; + struct ieee80211_supported_band *sband; + struct ieee80211_hdr *hdr; + struct mt7615_phy *phy2; + __le32 *rxd = (__le32 *)skb->data; + u32 rxd0 = le32_to_cpu(rxd[0]); + u32 rxd1 = le32_to_cpu(rxd[1]); + u32 rxd2 = le32_to_cpu(rxd[2]); + u32 csum_mask = MT_RXD0_NORMAL_IP_SUM | MT_RXD0_NORMAL_UDP_TCP_SUM; + u32 csum_status = *(u32 *)skb->cb; + bool unicast, hdr_trans, remove_pad, insert_ccmp_hdr = false; + u16 hdr_gap; + int phy_idx; + int i, idx; + u8 chfreq, amsdu_info, qos_ctl = 0; + u16 seq_ctrl = 0; + __le16 fc = 0; + + memset(status, 0, sizeof(*status)); + + chfreq = FIELD_GET(MT_RXD1_NORMAL_CH_FREQ, rxd1); + + phy2 = dev->mt76.phys[MT_BAND1] ? dev->mt76.phys[MT_BAND1]->priv : NULL; + if (!phy2) + phy_idx = 0; + else if (phy2->chfreq == phy->chfreq) + phy_idx = -1; + else if (phy->chfreq == chfreq) + phy_idx = 0; + else if (phy2->chfreq == chfreq) + phy_idx = 1; + else + phy_idx = -1; + + if (rxd2 & MT_RXD2_NORMAL_AMSDU_ERR) + return -EINVAL; + + hdr_trans = rxd1 & MT_RXD1_NORMAL_HDR_TRANS; + if (hdr_trans && (rxd2 & MT_RXD2_NORMAL_CM)) + return -EINVAL; + + /* ICV error or CCMP/BIP/WPI MIC error */ + if (rxd2 & MT_RXD2_NORMAL_ICV_ERR) + status->flag |= RX_FLAG_ONLY_MONITOR; + + unicast = (rxd1 & MT_RXD1_NORMAL_ADDR_TYPE) == MT_RXD1_NORMAL_U2M; + idx = FIELD_GET(MT_RXD2_NORMAL_WLAN_IDX, rxd2); + status->wcid = mt7615_rx_get_wcid(dev, idx, unicast); + + if (status->wcid) { + struct mt7615_sta *msta; + + msta = container_of(status->wcid, struct mt7615_sta, wcid); + mt76_wcid_add_poll(&dev->mt76, &msta->wcid); + } + + if (mt76_is_mmio(&dev->mt76) && (rxd0 & csum_mask) == csum_mask && + !(csum_status & (BIT(0) | BIT(2) | BIT(3)))) + skb->ip_summed = CHECKSUM_UNNECESSARY; + + if (rxd2 & MT_RXD2_NORMAL_FCS_ERR) + status->flag |= RX_FLAG_FAILED_FCS_CRC; + + if (rxd2 & MT_RXD2_NORMAL_TKIP_MIC_ERR) + status->flag |= RX_FLAG_MMIC_ERROR; + + if (FIELD_GET(MT_RXD2_NORMAL_SEC_MODE, rxd2) != 0 && + !(rxd2 & (MT_RXD2_NORMAL_CLM | MT_RXD2_NORMAL_CM))) { + status->flag |= RX_FLAG_DECRYPTED; + status->flag |= RX_FLAG_IV_STRIPPED; + status->flag |= RX_FLAG_MMIC_STRIPPED | RX_FLAG_MIC_STRIPPED; + } + + remove_pad = rxd1 & MT_RXD1_NORMAL_HDR_OFFSET; + + if (rxd2 & MT_RXD2_NORMAL_MAX_LEN_ERROR) + return -EINVAL; + + rxd += 4; + if (rxd0 & MT_RXD0_NORMAL_GROUP_4) { + u32 v0 = le32_to_cpu(rxd[0]); + u32 v2 = le32_to_cpu(rxd[2]); + + fc = cpu_to_le16(FIELD_GET(MT_RXD4_FRAME_CONTROL, v0)); + qos_ctl = FIELD_GET(MT_RXD6_QOS_CTL, v2); + seq_ctrl = FIELD_GET(MT_RXD6_SEQ_CTRL, v2); + + rxd += 4; + if ((u8 *)rxd - skb->data >= skb->len) + return -EINVAL; + } + + if (rxd0 & MT_RXD0_NORMAL_GROUP_1) { + u8 *data = (u8 *)rxd; + + if (status->flag & RX_FLAG_DECRYPTED) { + switch (FIELD_GET(MT_RXD2_NORMAL_SEC_MODE, rxd2)) { + case MT_CIPHER_AES_CCMP: + case MT_CIPHER_CCMP_CCX: + case MT_CIPHER_CCMP_256: + insert_ccmp_hdr = + FIELD_GET(MT_RXD2_NORMAL_FRAG, rxd2); + fallthrough; + case MT_CIPHER_TKIP: + case MT_CIPHER_TKIP_NO_MIC: + case MT_CIPHER_GCMP: + case MT_CIPHER_GCMP_256: + status->iv[0] = data[5]; + status->iv[1] = data[4]; + status->iv[2] = data[3]; + status->iv[3] = data[2]; + status->iv[4] = data[1]; + status->iv[5] = data[0]; + break; + default: + break; + } + } + rxd += 4; + if ((u8 *)rxd - skb->data >= skb->len) + return -EINVAL; + } + + if (rxd0 & MT_RXD0_NORMAL_GROUP_2) { + status->timestamp = le32_to_cpu(rxd[0]); + status->flag |= RX_FLAG_MACTIME_START; + + if (!(rxd2 & (MT_RXD2_NORMAL_NON_AMPDU_SUB | + MT_RXD2_NORMAL_NON_AMPDU))) { + status->flag |= RX_FLAG_AMPDU_DETAILS; + + /* all subframes of an A-MPDU have the same timestamp */ + if (phy->rx_ampdu_ts != status->timestamp) { + if (!++phy->ampdu_ref) + phy->ampdu_ref++; + } + phy->rx_ampdu_ts = status->timestamp; + + status->ampdu_ref = phy->ampdu_ref; + } + + rxd += 2; + if ((u8 *)rxd - skb->data >= skb->len) + return -EINVAL; + } + + if (rxd0 & MT_RXD0_NORMAL_GROUP_3) { + u32 rxdg5 = le32_to_cpu(rxd[5]); + + /* + * If both PHYs are on the same channel and we don't have a WCID, + * we need to figure out which PHY this packet was received on. + * On the primary PHY, the noise value for the chains belonging to the + * second PHY will be set to the noise value of the last packet from + * that PHY. + */ + if (phy_idx < 0) { + int first_chain = ffs(phy2->mt76->chainmask) - 1; + + phy_idx = ((rxdg5 >> (first_chain * 8)) & 0xff) == 0; + } + } + + if (phy_idx == 1 && phy2) { + mphy = dev->mt76.phys[MT_BAND1]; + phy = phy2; + status->phy_idx = phy_idx; + } + + if (!mt7615_firmware_offload(dev) && chfreq != phy->chfreq) + return -EINVAL; + + mt7615_get_status_freq_info(dev, mphy, status, chfreq); + if (status->band == NL80211_BAND_5GHZ) + sband = &mphy->sband_5g.sband; + else + sband = &mphy->sband_2g.sband; + + if (!test_bit(MT76_STATE_RUNNING, &mphy->state)) + return -EINVAL; + + if (!sband->channels) + return -EINVAL; + + if (rxd0 & MT_RXD0_NORMAL_GROUP_3) { + u32 rxdg0 = le32_to_cpu(rxd[0]); + u32 rxdg1 = le32_to_cpu(rxd[1]); + u32 rxdg3 = le32_to_cpu(rxd[3]); + u8 stbc = FIELD_GET(MT_RXV1_HT_STBC, rxdg0); + bool cck = false; + + i = FIELD_GET(MT_RXV1_TX_RATE, rxdg0); + switch (FIELD_GET(MT_RXV1_TX_MODE, rxdg0)) { + case MT_PHY_TYPE_CCK: + cck = true; + fallthrough; + case MT_PHY_TYPE_OFDM: + i = mt76_get_rate(&dev->mt76, sband, i, cck); + break; + case MT_PHY_TYPE_HT_GF: + case MT_PHY_TYPE_HT: + status->encoding = RX_ENC_HT; + if (i > 31) + return -EINVAL; + break; + case MT_PHY_TYPE_VHT: + status->nss = FIELD_GET(MT_RXV2_NSTS, rxdg1) + 1; + status->encoding = RX_ENC_VHT; + break; + default: + return -EINVAL; + } + status->rate_idx = i; + + switch (FIELD_GET(MT_RXV1_FRAME_MODE, rxdg0)) { + case MT_PHY_BW_20: + break; + case MT_PHY_BW_40: + status->bw = RATE_INFO_BW_40; + break; + case MT_PHY_BW_80: + status->bw = RATE_INFO_BW_80; + break; + case MT_PHY_BW_160: + status->bw = RATE_INFO_BW_160; + break; + default: + return -EINVAL; + } + + if (rxdg0 & MT_RXV1_HT_SHORT_GI) + status->enc_flags |= RX_ENC_FLAG_SHORT_GI; + if (rxdg0 & MT_RXV1_HT_AD_CODE) + status->enc_flags |= RX_ENC_FLAG_LDPC; + + status->enc_flags |= RX_ENC_FLAG_STBC_MASK * stbc; + + status->chains = mphy->antenna_mask; + status->chain_signal[0] = to_rssi(MT_RXV4_RCPI0, rxdg3); + status->chain_signal[1] = to_rssi(MT_RXV4_RCPI1, rxdg3); + status->chain_signal[2] = to_rssi(MT_RXV4_RCPI2, rxdg3); + status->chain_signal[3] = to_rssi(MT_RXV4_RCPI3, rxdg3); + + mt7615_mac_fill_tm_rx(mphy->priv, rxd); + + rxd += 6; + if ((u8 *)rxd - skb->data >= skb->len) + return -EINVAL; + } + + amsdu_info = FIELD_GET(MT_RXD1_NORMAL_PAYLOAD_FORMAT, rxd1); + status->amsdu = !!amsdu_info; + if (status->amsdu) { + status->first_amsdu = amsdu_info == MT_RXD1_FIRST_AMSDU_FRAME; + status->last_amsdu = amsdu_info == MT_RXD1_LAST_AMSDU_FRAME; + } + + hdr_gap = (u8 *)rxd - skb->data + 2 * remove_pad; + if (hdr_trans && ieee80211_has_morefrags(fc)) { + if (mt7615_reverse_frag0_hdr_trans(skb, hdr_gap)) + return -EINVAL; + hdr_trans = false; + } else { + int pad_start = 0; + + skb_pull(skb, hdr_gap); + if (!hdr_trans && status->amsdu) { + pad_start = ieee80211_get_hdrlen_from_skb(skb); + } else if (hdr_trans && (rxd2 & MT_RXD2_NORMAL_HDR_TRANS_ERROR)) { + /* + * When header translation failure is indicated, + * the hardware will insert an extra 2-byte field + * containing the data length after the protocol + * type field. This happens either when the LLC-SNAP + * pattern did not match, or if a VLAN header was + * detected. + */ + pad_start = 12; + if (get_unaligned_be16(skb->data + pad_start) == ETH_P_8021Q) + pad_start += 4; + else + pad_start = 0; + } + + if (pad_start) { + memmove(skb->data + 2, skb->data, pad_start); + skb_pull(skb, 2); + } + } + + if (insert_ccmp_hdr && !hdr_trans) { + u8 key_id = FIELD_GET(MT_RXD1_NORMAL_KEY_ID, rxd1); + + mt76_insert_ccmp_hdr(skb, key_id); + } + + if (!hdr_trans) { + hdr = (struct ieee80211_hdr *)skb->data; + fc = hdr->frame_control; + if (ieee80211_is_data_qos(fc)) { + seq_ctrl = le16_to_cpu(hdr->seq_ctrl); + qos_ctl = *ieee80211_get_qos_ctl(hdr); + } + } else { + status->flag |= RX_FLAG_8023; + } + + if (!status->wcid || !ieee80211_is_data_qos(fc)) + return 0; + + status->aggr = unicast && + !ieee80211_is_qos_nullfunc(fc); + status->qos_ctl = qos_ctl; + status->seqno = IEEE80211_SEQ_TO_SN(seq_ctrl); + + return 0; +} + +static u16 +mt7615_mac_tx_rate_val(struct mt7615_dev *dev, + struct mt76_phy *mphy, + const struct ieee80211_tx_rate *rate, + bool stbc, u8 *bw) +{ + u8 phy, nss, rate_idx; + u16 rateval = 0; + + *bw = 0; + + if (rate->flags & IEEE80211_TX_RC_VHT_MCS) { + rate_idx = ieee80211_rate_get_vht_mcs(rate); + nss = ieee80211_rate_get_vht_nss(rate); + phy = MT_PHY_TYPE_VHT; + if (rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH) + *bw = 1; + else if (rate->flags & IEEE80211_TX_RC_80_MHZ_WIDTH) + *bw = 2; + else if (rate->flags & IEEE80211_TX_RC_160_MHZ_WIDTH) + *bw = 3; + } else if (rate->flags & IEEE80211_TX_RC_MCS) { + rate_idx = rate->idx; + nss = 1 + (rate->idx >> 3); + phy = MT_PHY_TYPE_HT; + if (rate->flags & IEEE80211_TX_RC_GREEN_FIELD) + phy = MT_PHY_TYPE_HT_GF; + if (rate->flags & IEEE80211_TX_RC_40_MHZ_WIDTH) + *bw = 1; + } else { + const struct ieee80211_rate *r; + int band = mphy->chandef.chan->band; + u16 val; + + nss = 1; + r = &mphy->hw->wiphy->bands[band]->bitrates[rate->idx]; + if (rate->flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE) + val = r->hw_value_short; + else + val = r->hw_value; + + phy = val >> 8; + rate_idx = val & 0xff; + } + + if (stbc && nss == 1) { + nss++; + rateval |= MT_TX_RATE_STBC; + } + + rateval |= (FIELD_PREP(MT_TX_RATE_IDX, rate_idx) | + FIELD_PREP(MT_TX_RATE_MODE, phy) | + FIELD_PREP(MT_TX_RATE_NSS, nss - 1)); + + return rateval; +} + +int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi, + struct sk_buff *skb, struct mt76_wcid *wcid, + struct ieee80211_sta *sta, int pid, + struct ieee80211_key_conf *key, + enum mt76_txq_id qid, bool beacon) +{ + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + u8 fc_type, fc_stype, p_fmt, q_idx, omac_idx = 0, wmm_idx = 0; + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); + struct ieee80211_tx_rate *rate = &info->control.rates[0]; + u8 phy_idx = (info->hw_queue & MT_TX_HW_QUEUE_PHY) >> 2; + bool multicast = is_multicast_ether_addr(hdr->addr1); + struct ieee80211_vif *vif = info->control.vif; + bool is_mmio = mt76_is_mmio(&dev->mt76); + u32 val, sz_txd = is_mmio ? MT_TXD_SIZE : MT_USB_TXD_SIZE; + struct mt76_phy *mphy = &dev->mphy; + __le16 fc = hdr->frame_control; + int tx_count = 8; + u16 seqno = 0; + + if (vif) { + struct mt76_vif_link *mvif = (struct mt76_vif_link *)vif->drv_priv; + + omac_idx = mvif->omac_idx; + wmm_idx = mvif->wmm_idx; + } + + if (sta) { + struct mt7615_sta *msta = (struct mt7615_sta *)sta->drv_priv; + + tx_count = msta->rate_count; + } + + if (phy_idx && dev->mt76.phys[MT_BAND1]) + mphy = dev->mt76.phys[MT_BAND1]; + + fc_type = (le16_to_cpu(fc) & IEEE80211_FCTL_FTYPE) >> 2; + fc_stype = (le16_to_cpu(fc) & IEEE80211_FCTL_STYPE) >> 4; + + if (beacon) { + p_fmt = MT_TX_TYPE_FW; + q_idx = phy_idx ? MT_LMAC_BCN1 : MT_LMAC_BCN0; + } else if (qid >= MT_TXQ_PSD) { + p_fmt = is_mmio ? MT_TX_TYPE_CT : MT_TX_TYPE_SF; + q_idx = phy_idx ? MT_LMAC_ALTX1 : MT_LMAC_ALTX0; + } else { + p_fmt = is_mmio ? MT_TX_TYPE_CT : MT_TX_TYPE_SF; + q_idx = wmm_idx * MT7615_MAX_WMM_SETS + + mt7615_lmac_mapping(dev, skb_get_queue_mapping(skb)); + } + + val = FIELD_PREP(MT_TXD0_TX_BYTES, skb->len + sz_txd) | + FIELD_PREP(MT_TXD0_P_IDX, MT_TX_PORT_IDX_LMAC) | + FIELD_PREP(MT_TXD0_Q_IDX, q_idx); + txwi[0] = cpu_to_le32(val); + + val = MT_TXD1_LONG_FORMAT | + FIELD_PREP(MT_TXD1_WLAN_IDX, wcid->idx) | + FIELD_PREP(MT_TXD1_HDR_FORMAT, MT_HDR_FORMAT_802_11) | + FIELD_PREP(MT_TXD1_HDR_INFO, + ieee80211_get_hdrlen_from_skb(skb) / 2) | + FIELD_PREP(MT_TXD1_TID, + skb->priority & IEEE80211_QOS_CTL_TID_MASK) | + FIELD_PREP(MT_TXD1_PKT_FMT, p_fmt) | + FIELD_PREP(MT_TXD1_OWN_MAC, omac_idx); + txwi[1] = cpu_to_le32(val); + + val = FIELD_PREP(MT_TXD2_FRAME_TYPE, fc_type) | + FIELD_PREP(MT_TXD2_SUB_TYPE, fc_stype) | + FIELD_PREP(MT_TXD2_MULTICAST, multicast); + if (key) { + if (multicast && ieee80211_is_robust_mgmt_frame(skb) && + key->cipher == WLAN_CIPHER_SUITE_AES_CMAC) { + val |= MT_TXD2_BIP; + txwi[3] = 0; + } else { + txwi[3] = cpu_to_le32(MT_TXD3_PROTECT_FRAME); + } + } else { + txwi[3] = 0; + } + txwi[2] = cpu_to_le32(val); + + if (!(info->flags & IEEE80211_TX_CTL_AMPDU)) + txwi[2] |= cpu_to_le32(MT_TXD2_BA_DISABLE); + + txwi[4] = 0; + txwi[6] = 0; + + if (rate->idx >= 0 && rate->count && + !(info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE)) { + bool stbc = info->flags & IEEE80211_TX_CTL_STBC; + u8 bw; + u16 rateval = mt7615_mac_tx_rate_val(dev, mphy, rate, stbc, + &bw); + + txwi[2] |= cpu_to_le32(MT_TXD2_FIX_RATE); + + val = MT_TXD6_FIXED_BW | + FIELD_PREP(MT_TXD6_BW, bw) | + FIELD_PREP(MT_TXD6_TX_RATE, rateval); + txwi[6] |= cpu_to_le32(val); + + if (rate->flags & IEEE80211_TX_RC_SHORT_GI) + txwi[6] |= cpu_to_le32(MT_TXD6_SGI); + + if (info->flags & IEEE80211_TX_CTL_LDPC) + txwi[6] |= cpu_to_le32(MT_TXD6_LDPC); + + if (!(rate->flags & (IEEE80211_TX_RC_MCS | + IEEE80211_TX_RC_VHT_MCS))) + txwi[2] |= cpu_to_le32(MT_TXD2_BA_DISABLE); + + tx_count = rate->count; + } + + if (!ieee80211_is_beacon(fc)) { + struct ieee80211_hw *hw = mt76_hw(dev); + + val = MT_TXD5_TX_STATUS_HOST | FIELD_PREP(MT_TXD5_PID, pid); + if (!ieee80211_hw_check(hw, SUPPORTS_PS)) + val |= MT_TXD5_SW_POWER_MGMT; + txwi[5] = cpu_to_le32(val); + } else { + txwi[5] = 0; + /* use maximum tx count for beacons */ + tx_count = 0x1f; + } + + val = FIELD_PREP(MT_TXD3_REM_TX_COUNT, tx_count); + if (info->flags & IEEE80211_TX_CTL_INJECTED) { + seqno = le16_to_cpu(hdr->seq_ctrl); + + if (ieee80211_is_back_req(hdr->frame_control)) { + struct ieee80211_bar *bar; + + bar = (struct ieee80211_bar *)skb->data; + seqno = le16_to_cpu(bar->start_seq_num); + } + + val |= MT_TXD3_SN_VALID | + FIELD_PREP(MT_TXD3_SEQ, IEEE80211_SEQ_TO_SN(seqno)); + } + + txwi[3] |= cpu_to_le32(val); + + if (info->flags & IEEE80211_TX_CTL_NO_ACK) + txwi[3] |= cpu_to_le32(MT_TXD3_NO_ACK); + + val = FIELD_PREP(MT_TXD7_TYPE, fc_type) | + FIELD_PREP(MT_TXD7_SUB_TYPE, fc_stype) | + FIELD_PREP(MT_TXD7_SPE_IDX, 0x18); + txwi[7] = cpu_to_le32(val); + if (!is_mmio) { + val = FIELD_PREP(MT_TXD8_L_TYPE, fc_type) | + FIELD_PREP(MT_TXD8_L_SUB_TYPE, fc_stype); + txwi[8] = cpu_to_le32(val); + } + + return 0; +} +EXPORT_SYMBOL_GPL(mt7615_mac_write_txwi); + +bool mt7615_mac_wtbl_update(struct mt7615_dev *dev, int idx, u32 mask) +{ + mt76_rmw(dev, MT_WTBL_UPDATE, MT_WTBL_UPDATE_WLAN_IDX, + FIELD_PREP(MT_WTBL_UPDATE_WLAN_IDX, idx) | mask); + + return mt76_poll(dev, MT_WTBL_UPDATE, MT_WTBL_UPDATE_BUSY, + 0, 5000); +} + +void mt7615_mac_sta_poll(struct mt7615_dev *dev) +{ + static const u8 ac_to_tid[4] = { + [IEEE80211_AC_BE] = 0, + [IEEE80211_AC_BK] = 1, + [IEEE80211_AC_VI] = 4, + [IEEE80211_AC_VO] = 6 + }; + static const u8 hw_queue_map[] = { + [IEEE80211_AC_BK] = 0, + [IEEE80211_AC_BE] = 1, + [IEEE80211_AC_VI] = 2, + [IEEE80211_AC_VO] = 3, + }; + struct ieee80211_sta *sta; + struct mt7615_sta *msta; + u32 addr, tx_time[4], rx_time[4]; + struct list_head sta_poll_list; + int i; + + INIT_LIST_HEAD(&sta_poll_list); + spin_lock_bh(&dev->mt76.sta_poll_lock); + list_splice_init(&dev->mt76.sta_poll_list, &sta_poll_list); + spin_unlock_bh(&dev->mt76.sta_poll_lock); + + while (!list_empty(&sta_poll_list)) { + bool clear = false; + + msta = list_first_entry(&sta_poll_list, struct mt7615_sta, + wcid.poll_list); + + spin_lock_bh(&dev->mt76.sta_poll_lock); + list_del_init(&msta->wcid.poll_list); + spin_unlock_bh(&dev->mt76.sta_poll_lock); + + addr = mt7615_mac_wtbl_addr(dev, msta->wcid.idx) + 19 * 4; + + for (i = 0; i < 4; i++, addr += 8) { + u32 tx_last = msta->airtime_ac[i]; + u32 rx_last = msta->airtime_ac[i + 4]; + + msta->airtime_ac[i] = mt76_rr(dev, addr); + msta->airtime_ac[i + 4] = mt76_rr(dev, addr + 4); + tx_time[i] = msta->airtime_ac[i] - tx_last; + rx_time[i] = msta->airtime_ac[i + 4] - rx_last; + + if ((tx_last | rx_last) & BIT(30)) + clear = true; + } + + if (clear) { + mt7615_mac_wtbl_update(dev, msta->wcid.idx, + MT_WTBL_UPDATE_ADM_COUNT_CLEAR); + memset(msta->airtime_ac, 0, sizeof(msta->airtime_ac)); + } + + if (!msta->wcid.sta) + continue; + + sta = container_of((void *)msta, struct ieee80211_sta, + drv_priv); + for (i = 0; i < 4; i++) { + u32 tx_cur = tx_time[i]; + u32 rx_cur = rx_time[hw_queue_map[i]]; + u8 tid = ac_to_tid[i]; + + if (!tx_cur && !rx_cur) *** 11205 LINES SKIPPED *** From nobody Sun Apr 19 07:53:08 2026 X-Original-To: dev-commits-src-main@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 4fz17n1KYLz6b8GZ for ; Sun, 19 Apr 2026 07:53:09 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fz17n0DVfz3hS3 for ; Sun, 19 Apr 2026 07:53:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776585189; 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=YO52bxnM561geXC0PHwwu/oUGUtgldu0Y6fV2XJlp/M=; b=r8OcmHL8b8D+2ix645GTuaoJOABoOaV2kpdJzKBnhAe/9n2i3gDg0wY6pkxnsnbhjpryfn lOnWFLOS0wqeHBJw12BMaONs3LCvBM4TcGR3exYwzjR1sPQpcrCg3wh3s9ni4QC1LENcay OgPCY8b+reIkPE8dJZTvAwkx91lgN2bXHpSGdIwhY7t4HXSUcFS5CshInOd8L8kNloLJ+f VZAqoIq0Qa8fzswEdVMaEGu3Na+yZ0mRT7lu/OxB9kJ38MlEUYW+iDoFHZRNo0gddhZsYl vZmxHfqPVi7A6PkDoJYB3Kp3nVmYCisYUDLYnOV4ksWRMwqjZoIv/c41Vp2Bag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776585189; a=rsa-sha256; cv=none; b=CxYnttlHDpbK3pjKYsH5OcE/uk2GYo9zOKl7bCW4Fff74lUCwJPZzPJMXQJYC9qqHiUz6A /xDn2jQJqtsURdDJATjf0Nw9jTySlCCPazRCjXQmAKOidCPGbwYuP0pBCfo8fjkg6JqT9r M0kCyQJ6pFZcP5/K/3P4y5fonVhwb80dgRPtZWwjeU0XIncZfUE8Oe4E2mccFD8pSWYGfa 0AnNTyr7k9rY65FP8ZsgTJKPK5HvPjHEzHo/QVsMjAzbyoFYnI3bbYU5DY3U5UMDZa2qM0 aRT3+WCRBn9eZozVXeUB2bRHm3dgoBCxN+PH3wDcsGm28PPlnqqCZH8WCHYGZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776585189; 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=YO52bxnM561geXC0PHwwu/oUGUtgldu0Y6fV2XJlp/M=; b=qLUH+5U8Kx7OTDFqrO3Tm0zriScFKxDTBX3Qp8m0prO8VJ6xHnr9y9yy/uW5Is63b7GCxm Ylto6mYo4jo/nj2K9KJtvcUUThZB2/O+9GrMp+LzE9zXvp0PeCNX6zeup/+OQrzu5djh+z J3Nb4mpfPaGbsMR2y2BEvLAPCs/8X/Oe+c3x4T6cWpUtB44ZNZTNMA7kbEpQSxW+nfn9DK J/+lArvyZC28kqeQv4xX42QVIW1d50+/9IxUL0uU53np7rYxdle5eHVcSJc7of5DW+LvXZ vhicgZZV3uzh9i02ZvD8giu/DKTlgQH0YsVZnxweWC4nNz7NLKwQ/+l9dzUBAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fz17m6ttyz1HDT for ; Sun, 19 Apr 2026 07:53:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 18a32 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 07:53:08 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: d8fbbd371ca1 - main - zfs: merge openzfs/zfs@1644e2ffd List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8fbbd371ca11d9ad4b29b9d3a316885a5da0b15 Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 07:53:08 +0000 Message-Id: <69e489e4.18a32.645fb2c3@gitrepo.freebsd.org> The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=d8fbbd371ca11d9ad4b29b9d3a316885a5da0b15 commit d8fbbd371ca11d9ad4b29b9d3a316885a5da0b15 Merge: 1c50cb1d7562 1644e2ffd264 Author: Martin Matuska AuthorDate: 2026-04-18 22:21:01 +0000 Commit: Martin Matuska CommitDate: 2026-04-18 22:22:45 +0000 zfs: merge openzfs/zfs@1644e2ffd Notable upstream pull request merges: #18148 d1b0a6982 draid: add failure domains support #18167 f203fedde Add zoned_uid property with additive least privilege authorization #18191 -multiple FreeBSD: Fix a couple of races involving zvol creation and teardown #18213 33ed68fc2 zpool create: report which device caused failure #18235 931deb290 Prevent range tree corruption race by updating dnode_sync() #18282 b44a3ecf4 zpool: Change zpool offline spares policy #18310 -multiple Fix s_active leak in zfsvfs_hold() when z_unmounted is true #18351 ce837a28e Bridge speculative and prescient prefetchers #18380 fc659bd6d draid: fix import failure after disks replacements #18385 16858492e FreeBSD: Implement relatime property #18390 a22b3f670 abd: Fix stats asymmetry in case of Direct I/O #18399 7b1682a82 Add support for POSIX_FADV_DONTNEED #18403 5cb95ad89 fix memleak in spa_errlog.c #18405 0752cf067 draid: allow seq resilver reads from degraded vdevs #18407 e635d27eb Add ability to set user properties while changing encryption key #18414 2abf469be draid: fix cksum errors after rebuild with degraded disks #18415 -multiple Fix snapshot automount deadlock during concurrent zfs recv #18421 1644e2ffd Fix read corruption after block clone after truncate Obtained from: OpenZFS OpenZFS commit: 1644e2ffd2640fa3e2c191ceaf048a5fc8399493 .../openzfs/.github/workflows/checkstyle.yaml | 7 +- sys/contrib/openzfs/.github/workflows/codeql.yml | 2 +- .../.github/workflows/scripts/generate-ci-type.py | 33 +- .../.github/workflows/scripts/qemu-1-setup.sh | 21 + .../.github/workflows/scripts/qemu-2-start.sh | 8 +- .../.github/workflows/scripts/qemu-3-deps-vm.sh | 22 +- .../.github/workflows/scripts/qemu-4-build-vm.sh | 11 +- .../.github/workflows/scripts/qemu-7-prepare.sh | 22 +- .../workflows/scripts/qemu-9-summary-page.sh | 4 +- sys/contrib/openzfs/.github/workflows/smatch.yml | 4 +- sys/contrib/openzfs/.github/workflows/zfs-arm.yml | 40 ++ .../.github/workflows/zfs-qemu-packages.yml | 23 +- sys/contrib/openzfs/.github/workflows/zfs-qemu.yml | 42 +- sys/contrib/openzfs/.github/workflows/zloop.yml | 7 +- sys/contrib/openzfs/AUTHORS | 1 + sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c | 4 +- sys/contrib/openzfs/cmd/zed/agents/zfs_retire.c | 146 +++++- sys/contrib/openzfs/cmd/zfs/zfs_main.c | 7 +- sys/contrib/openzfs/cmd/zinject/translate.c | 35 +- sys/contrib/openzfs/cmd/zinject/zinject.c | 4 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 21 +- sys/contrib/openzfs/cmd/zpool/zpool_vdev.c | 234 ++++++++-- sys/contrib/openzfs/cmd/ztest.c | 11 +- sys/contrib/openzfs/config/deb.am | 20 +- .../config/kernel-copy-from-user-inatomic.m4 | 30 -- sys/contrib/openzfs/config/kernel.m4 | 2 - .../contrib/debian/openzfs-zfsutils.install | 1 + .../contrib/pyzfs/libzfs_core/_constants.py | 4 + sys/contrib/openzfs/contrib/pyzfs/setup.py.in | 4 +- sys/contrib/openzfs/include/libzfs.h | 2 + .../openzfs/include/os/freebsd/spl/sys/zone.h | 73 +++ .../include/os/freebsd/zfs/sys/zfs_vfsops_os.h | 1 + .../include/os/freebsd/zfs/sys/zfs_znode_impl.h | 4 +- .../openzfs/include/os/linux/spl/sys/zone.h | 58 +++ .../include/os/linux/zfs/sys/zfs_vfsops_os.h | 14 +- sys/contrib/openzfs/include/sys/dbuf.h | 2 + sys/contrib/openzfs/include/sys/dmu.h | 6 + sys/contrib/openzfs/include/sys/dmu_zfetch.h | 1 + sys/contrib/openzfs/include/sys/dnode.h | 13 + sys/contrib/openzfs/include/sys/dsl_crypt.h | 3 +- sys/contrib/openzfs/include/sys/fs/zfs.h | 8 + sys/contrib/openzfs/include/sys/spa.h | 2 +- sys/contrib/openzfs/include/sys/spa_impl.h | 1 + sys/contrib/openzfs/include/sys/vdev_draid.h | 7 +- sys/contrib/openzfs/include/sys/vdev_raidz_impl.h | 1 + sys/contrib/openzfs/include/zfeature_common.h | 1 + sys/contrib/openzfs/lib/libzfs/libzfs.abi | 43 +- sys/contrib/openzfs/lib/libzfs/libzfs_crypto.c | 52 ++- sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 10 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 170 +++++-- sys/contrib/openzfs/lib/libzfs/libzfs_status.c | 43 +- sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 6 + .../openzfs/lib/libzfs/os/linux/libzfs_pool_os.c | 19 +- sys/contrib/openzfs/man/Makefile.am | 16 +- sys/contrib/openzfs/man/man1/dbufstat.1 | 233 ++++++++++ sys/contrib/openzfs/man/man4/zfs.4 | 11 + sys/contrib/openzfs/man/man7/vdevprops.7 | 26 +- sys/contrib/openzfs/man/man7/zfsprops.7 | 92 ++++ sys/contrib/openzfs/man/man7/zpool-features.7 | 27 ++ sys/contrib/openzfs/man/man7/zpoolconcepts.7 | 36 +- sys/contrib/openzfs/man/man8/zfs-load-key.8 | 9 +- sys/contrib/openzfs/man/man8/zfs-set.8 | 20 +- sys/contrib/openzfs/man/man8/zfs-zone.8 | 15 +- sys/contrib/openzfs/man/man8/zinject.8 | 10 +- sys/contrib/openzfs/man/man8/zpool-create.8 | 35 ++ sys/contrib/openzfs/man/man8/zpool-list.8 | 4 +- sys/contrib/openzfs/man/man8/zpool-offline.8 | 7 +- sys/contrib/openzfs/man/man8/zpool-resilver.8 | 3 + sys/contrib/openzfs/man/man8/zpool-scrub.8 | 4 +- sys/contrib/openzfs/man/man8/zpool-status.8 | 4 +- .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 8 + .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 4 +- .../openzfs/module/os/freebsd/zfs/zfs_znode_os.c | 43 ++ .../openzfs/module/os/freebsd/zfs/zvol_os.c | 84 ++-- sys/contrib/openzfs/module/os/linux/spl/spl-zone.c | 413 +++++++++++++++-- .../openzfs/module/os/linux/zfs/spa_misc_os.c | 50 +- .../openzfs/module/os/linux/zfs/zfs_ctldir.c | 57 ++- .../openzfs/module/os/linux/zfs/zfs_ioctl_os.c | 4 + .../openzfs/module/os/linux/zfs/zfs_vfsops.c | 240 +--------- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 39 +- .../openzfs/module/os/linux/zfs/zpl_super.c | 509 ++++++++++++++++++++- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 2 +- .../openzfs/module/zcommon/zfeature_common.c | 13 + sys/contrib/openzfs/module/zcommon/zfs_prop.c | 15 +- sys/contrib/openzfs/module/zcommon/zpool_prop.c | 6 + sys/contrib/openzfs/module/zfs/abd.c | 3 +- sys/contrib/openzfs/module/zfs/dbuf.c | 78 +++- sys/contrib/openzfs/module/zfs/ddt_log.c | 3 +- sys/contrib/openzfs/module/zfs/dmu.c | 79 ++++ sys/contrib/openzfs/module/zfs/dmu_zfetch.c | 69 ++- sys/contrib/openzfs/module/zfs/dnode.c | 2 + sys/contrib/openzfs/module/zfs/dnode_sync.c | 105 +++-- sys/contrib/openzfs/module/zfs/dsl_crypt.c | 15 +- sys/contrib/openzfs/module/zfs/dsl_deleg.c | 13 +- sys/contrib/openzfs/module/zfs/spa.c | 58 ++- sys/contrib/openzfs/module/zfs/spa_errlog.c | 2 +- sys/contrib/openzfs/module/zfs/spa_log_spacemap.c | 8 +- sys/contrib/openzfs/module/zfs/space_map.c | 3 +- sys/contrib/openzfs/module/zfs/vdev.c | 68 ++- sys/contrib/openzfs/module/zfs/vdev_draid.c | 423 +++++++++++++---- sys/contrib/openzfs/module/zfs/vdev_label.c | 23 +- sys/contrib/openzfs/module/zfs/vdev_mirror.c | 13 +- sys/contrib/openzfs/module/zfs/vdev_raidz.c | 65 ++- sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 318 ++++++++++++- sys/contrib/openzfs/module/zfs/zio.c | 6 +- sys/contrib/openzfs/module/zfs/zvol.c | 51 ++- sys/contrib/openzfs/rpm/generic/zfs.spec.in | 6 + sys/contrib/openzfs/scripts/spdxcheck.pl | 1 - sys/contrib/openzfs/tests/runfiles/common.run | 40 +- sys/contrib/openzfs/tests/runfiles/linux.run | 7 +- sys/contrib/openzfs/tests/runfiles/sanity.run | 6 +- .../openzfs/tests/test-runner/bin/zts-report.py.in | 6 +- sys/contrib/openzfs/tests/zfs-tests/cmd/.gitignore | 1 + .../openzfs/tests/zfs-tests/cmd/Makefile.am | 2 + .../tests/zfs-tests/cmd/clone_after_trunc.c | 117 +++++ .../openzfs/tests/zfs-tests/include/commands.cfg | 2 + .../openzfs/tests/zfs-tests/tests/Makefile.am | 46 ++ .../block_cloning/block_cloning_after_trunc.ksh | 31 ++ .../zfs_change-key/zfs_change-key_userprop.ksh | 72 +++ .../zpool_create/zpool_create_draid_005_pos.ksh | 149 ++++++ .../zpool_create/zpool_create_errinfo_001_neg.ksh | 103 +++++ .../functional/cli_root/zpool_get/vdev_get.cfg | 2 + .../functional/cli_root/zpool_get/zpool_get.cfg | 1 + .../cli_root/zpool_offline/zpool_offline_spare.ksh | 84 ++++ .../tests/functional/fadvise/fadvise_dontneed.ksh | 63 +++ .../functional/fault/auto_offline_001_pos.ksh | 5 +- .../functional/fault/suspend_draid_fgroups.ksh | 163 +++++++ .../tests/functional/redundancy/redundancy.kshlib | 65 ++- .../redundancy/redundancy_draid_degraded1.ksh | 141 ++++++ .../redundancy/redundancy_draid_degraded2.ksh | 157 +++++++ .../redundancy/redundancy_draid_spare4.ksh | 152 ++++++ .../redundancy/redundancy_draid_width.ksh | 91 ++++ .../tests/functional/rsend/send_raw_ashift.ksh | 3 - .../tests/functional/zoned_uid/cleanup.ksh | 46 ++ .../zfs-tests/tests/functional/zoned_uid/setup.ksh | 99 ++++ .../tests/functional/zoned_uid/zoned_uid.cfg | 33 ++ .../functional/zoned_uid/zoned_uid_001_pos.ksh | 85 ++++ .../functional/zoned_uid/zoned_uid_002_pos.ksh | 83 ++++ .../functional/zoned_uid/zoned_uid_003_pos.ksh | 100 ++++ .../functional/zoned_uid/zoned_uid_004_pos.ksh | 91 ++++ .../functional/zoned_uid/zoned_uid_005_neg.ksh | 72 +++ .../functional/zoned_uid/zoned_uid_006_pos.ksh | 109 +++++ .../functional/zoned_uid/zoned_uid_007_pos.ksh | 110 +++++ .../functional/zoned_uid/zoned_uid_008_pos.ksh | 128 ++++++ .../functional/zoned_uid/zoned_uid_009_pos.ksh | 149 ++++++ .../functional/zoned_uid/zoned_uid_010_pos.ksh | 157 +++++++ .../functional/zoned_uid/zoned_uid_011_neg.ksh | 153 +++++++ .../functional/zoned_uid/zoned_uid_012_pos.ksh | 120 +++++ .../functional/zoned_uid/zoned_uid_013_pos.ksh | 122 +++++ .../functional/zoned_uid/zoned_uid_014_pos.ksh | 116 +++++ .../functional/zoned_uid/zoned_uid_015_pos.ksh | 114 +++++ .../functional/zoned_uid/zoned_uid_016_pos.ksh | 132 ++++++ .../functional/zoned_uid/zoned_uid_017_neg.ksh | 125 +++++ .../functional/zoned_uid/zoned_uid_018_pos.ksh | 129 ++++++ .../functional/zoned_uid/zoned_uid_019_neg.ksh | 141 ++++++ .../functional/zoned_uid/zoned_uid_020_neg.ksh | 171 +++++++ .../functional/zoned_uid/zoned_uid_021_neg.ksh | 109 +++++ .../functional/zoned_uid/zoned_uid_022_neg.ksh | 154 +++++++ .../functional/zoned_uid/zoned_uid_023_pos.ksh | 131 ++++++ .../functional/zoned_uid/zoned_uid_024_neg.ksh | 144 ++++++ .../functional/zoned_uid/zoned_uid_025_pos.ksh | 102 +++++ .../functional/zoned_uid/zoned_uid_026_pos.ksh | 112 +++++ .../functional/zoned_uid/zoned_uid_027_pos.ksh | 103 +++++ .../functional/zoned_uid/zoned_uid_028_neg.ksh | 103 +++++ .../functional/zoned_uid/zoned_uid_029_neg.ksh | 120 +++++ .../functional/zoned_uid/zoned_uid_030_pos.ksh | 183 ++++++++ .../functional/zoned_uid/zoned_uid_031_pos.ksh | 110 +++++ .../functional/zoned_uid/zoned_uid_common.kshlib | 237 ++++++++++ sys/modules/zfs/zfs_config.h | 4 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 170 files changed, 9623 insertions(+), 846 deletions(-) diff --cc sys/contrib/openzfs/.github/workflows/zfs-arm.yml index 000000000000,6039e4736c42..6039e4736c42 mode 000000,100644..100644 --- a/sys/contrib/openzfs/.github/workflows/zfs-arm.yml +++ b/sys/contrib/openzfs/.github/workflows/zfs-arm.yml diff --cc sys/contrib/openzfs/include/os/freebsd/spl/sys/zone.h index cfe63946706b,000000000000..12c80b39dfac mode 100644,000000..100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/zone.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/zone.h @@@ -1,68 -1,0 +1,141 @@@ +// SPDX-License-Identifier: BSD-2-Clause +/* + * Copyright (c) 2007 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_SYS_ZONE_H_ +#define _OPENSOLARIS_SYS_ZONE_H_ + +#include ++#include + +/* + * Macros to help with zone visibility restrictions. + */ + +#define GLOBAL_ZONEID 0 + +/* + * Is proc in the global zone? + */ +#define INGLOBALZONE(proc) (!jailed((proc)->p_ucred)) + +/* + * Attach the given dataset to the given jail. + */ +extern int zone_dataset_attach(struct ucred *, const char *, int); + +/* + * Detach the given dataset to the given jail. + */ +extern int zone_dataset_detach(struct ucred *, const char *, int); + +/* + * Returns true if the named pool/dataset is visible in the current zone. + */ +extern int zone_dataset_visible(const char *, int *); + +/* + * Safely get the hostid of the specified zone (defaults to machine's hostid + * if the specified zone doesn't emulate a hostid). Passing NULL retrieves + * the global zone's (i.e., physical system's) hostid. + */ +extern uint32_t zone_get_hostid(void *); + ++/* ++ * Operations that can be authorized via zoned_uid delegation. ++ * Shared with Linux; on FreeBSD these are defined but the check ++ * always returns NOT_APPLICABLE (no user namespace support). ++ */ ++typedef enum zone_uid_op { ++ ZONE_OP_CREATE, ++ ZONE_OP_SNAPSHOT, ++ ZONE_OP_CLONE, ++ ZONE_OP_DESTROY, ++ ZONE_OP_RENAME, ++ ZONE_OP_SETPROP ++} zone_uid_op_t; ++ ++typedef enum zone_admin_result { ++ ZONE_ADMIN_NOT_APPLICABLE, ++ ZONE_ADMIN_ALLOWED, ++ ZONE_ADMIN_DENIED ++} zone_admin_result_t; ++ ++/* ++ * FreeBSD stub: zoned_uid delegation is not applicable (no user namespaces). ++ * Always returns NOT_APPLICABLE so callers fall through to existing ++ * jail-based permission checks. ++ */ ++static inline zone_admin_result_t ++zone_dataset_admin_check(const char *dataset, zone_uid_op_t op, ++ const char *aux_dataset) ++{ ++ (void) dataset, (void) op, (void) aux_dataset; ++ return (ZONE_ADMIN_NOT_APPLICABLE); ++} ++ ++/* ++ * Callback type for looking up zoned_uid property. ++ */ ++typedef uid_t (*zone_get_zoned_uid_fn_t)(const char *dataset, ++ char *root_out, size_t root_size); ++ ++/* ++ * FreeBSD stubs: zoned_uid attach/detach require user namespaces ++ * which FreeBSD does not have. Return ENXIO (consistent with the ++ * Linux fallback when CONFIG_USER_NS is not defined). ++ */ ++static inline int ++zone_dataset_attach_uid(struct ucred *cred, const char *dataset, uid_t uid) ++{ ++ (void) cred, (void) dataset, (void) uid; ++ return (ENXIO); ++} ++ ++static inline int ++zone_dataset_detach_uid(struct ucred *cred, const char *dataset, uid_t uid) ++{ ++ (void) cred, (void) dataset, (void) uid; ++ return (ENXIO); ++} ++ ++/* ++ * FreeBSD stubs: no-op since zoned_uid delegation requires user namespaces. ++ */ ++static inline void ++zone_register_zoned_uid_callback(zone_get_zoned_uid_fn_t fn) ++{ ++ (void) fn; ++} ++ ++static inline void ++zone_unregister_zoned_uid_callback(void) ++{ ++} ++ +#endif /* !_OPENSOLARIS_SYS_ZONE_H_ */ diff --cc sys/contrib/openzfs/man/man1/dbufstat.1 index 000000000000,311af5e76a98..311af5e76a98 mode 000000,100644..100644 --- a/sys/contrib/openzfs/man/man1/dbufstat.1 +++ b/sys/contrib/openzfs/man/man1/dbufstat.1 diff --cc sys/contrib/openzfs/module/zfs/vdev.c index 9def59b06727,000000000000..30639d7f4c7f mode 100644,000000..100644 --- a/sys/contrib/openzfs/module/zfs/vdev.c +++ b/sys/contrib/openzfs/module/zfs/vdev.c @@@ -1,6866 -1,0 +1,6922 @@@ +// SPDX-License-Identifier: CDDL-1.0 +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or https://opensource.org/licenses/CDDL-1.0. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ + +/* + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2021 by Delphix. All rights reserved. + * Copyright 2017 Nexenta Systems, Inc. + * Copyright (c) 2014 Integros [integros.com] + * Copyright 2016 Toomas Soome + * Copyright 2017 Joyent, Inc. + * Copyright (c) 2017, Intel Corporation. + * Copyright (c) 2019, Datto Inc. All rights reserved. + * Copyright (c) 2021, 2025, Klara, Inc. + * Copyright (c) 2021, 2023 Hewlett Packard Enterprise Development LP. + * Copyright (c) 2026, Seagate Technology, LLC. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "zfs_prop.h" + +/* + * One metaslab from each (normal-class) vdev is used by the ZIL. These are + * called "embedded slog metaslabs", are referenced by vdev_log_mg, and are + * part of the spa_embedded_log_class. The metaslab with the most free space + * in each vdev is selected for this purpose when the pool is opened (or a + * vdev is added). See vdev_metaslab_init(). + * + * Log blocks can be allocated from the following locations. Each one is tried + * in order until the allocation succeeds: + * 1. dedicated log vdevs, aka "slog" (spa_log_class) + * 2. embedded slog metaslabs (spa_embedded_log_class) + * 3. other metaslabs in normal vdevs (spa_normal_class) + * + * zfs_embedded_slog_min_ms disables the embedded slog if there are fewer + * than this number of metaslabs in the vdev. This ensures that we don't set + * aside an unreasonable amount of space for the ZIL. If set to less than + * 1 << (spa_slop_shift + 1), on small pools the usable space may be reduced + * (by more than 1<vdev_path != NULL) { + zfs_dbgmsg("%s vdev '%s': %s", vd->vdev_ops->vdev_op_type, + vd->vdev_path, buf); + } else { + zfs_dbgmsg("%s-%llu vdev (guid %llu): %s", + vd->vdev_ops->vdev_op_type, + (u_longlong_t)vd->vdev_id, + (u_longlong_t)vd->vdev_guid, buf); + } +} + +void +vdev_dbgmsg_print_tree(vdev_t *vd, int indent) +{ + char state[20]; + + if (vd->vdev_ishole || vd->vdev_ops == &vdev_missing_ops) { + zfs_dbgmsg("%*svdev %llu: %s", indent, "", + (u_longlong_t)vd->vdev_id, + vd->vdev_ops->vdev_op_type); + return; + } + + switch (vd->vdev_state) { + case VDEV_STATE_UNKNOWN: + (void) snprintf(state, sizeof (state), "unknown"); + break; + case VDEV_STATE_CLOSED: + (void) snprintf(state, sizeof (state), "closed"); + break; + case VDEV_STATE_OFFLINE: + (void) snprintf(state, sizeof (state), "offline"); + break; + case VDEV_STATE_REMOVED: + (void) snprintf(state, sizeof (state), "removed"); + break; + case VDEV_STATE_CANT_OPEN: + (void) snprintf(state, sizeof (state), "can't open"); + break; + case VDEV_STATE_FAULTED: + (void) snprintf(state, sizeof (state), "faulted"); + break; + case VDEV_STATE_DEGRADED: + (void) snprintf(state, sizeof (state), "degraded"); + break; + case VDEV_STATE_HEALTHY: + (void) snprintf(state, sizeof (state), "healthy"); + break; + default: + (void) snprintf(state, sizeof (state), "", + (uint_t)vd->vdev_state); + } + + zfs_dbgmsg("%*svdev %u: %s%s, guid: %llu, path: %s, %s", indent, + "", (int)vd->vdev_id, vd->vdev_ops->vdev_op_type, + vd->vdev_islog ? " (log)" : "", + (u_longlong_t)vd->vdev_guid, + vd->vdev_path ? vd->vdev_path : "N/A", state); + + for (uint64_t i = 0; i < vd->vdev_children; i++) + vdev_dbgmsg_print_tree(vd->vdev_child[i], indent + 2); +} + +char * +vdev_rt_name(vdev_t *vd, const char *name) +{ + return (kmem_asprintf("{spa=%s vdev_guid=%llu %s}", + spa_name(vd->vdev_spa), + (u_longlong_t)vd->vdev_guid, + name)); +} + +static char * +vdev_rt_name_dtl(vdev_t *vd, const char *name, vdev_dtl_type_t dtl_type) +{ + return (kmem_asprintf("{spa=%s vdev_guid=%llu %s[%d]}", + spa_name(vd->vdev_spa), + (u_longlong_t)vd->vdev_guid, + name, + dtl_type)); +} + +/* + * Virtual device management. + */ + +static vdev_ops_t *const vdev_ops_table[] = { + &vdev_root_ops, + &vdev_raidz_ops, + &vdev_draid_ops, + &vdev_draid_spare_ops, + &vdev_mirror_ops, + &vdev_replacing_ops, + &vdev_spare_ops, + &vdev_disk_ops, + &vdev_file_ops, + &vdev_missing_ops, + &vdev_hole_ops, + &vdev_indirect_ops, + NULL +}; + +/* + * Given a vdev type, return the appropriate ops vector. + */ +static vdev_ops_t * +vdev_getops(const char *type) +{ + vdev_ops_t *ops, *const *opspp; + + for (opspp = vdev_ops_table; (ops = *opspp) != NULL; opspp++) + if (strcmp(ops->vdev_op_type, type) == 0) + break; + + return (ops); +} + +/* + * Given a vdev and a metaslab class, find which metaslab group we're + * interested in. All vdevs may belong to two different metaslab classes. + * Dedicated slog devices use only the primary metaslab group, rather than a + * separate log group. For embedded slogs, vdev_log_mg will be non-NULL and + * will point to a metaslab group of either embedded_log_class (for normal + * vdevs) or special_embedded_log_class (for special vdevs). + */ +metaslab_group_t * +vdev_get_mg(vdev_t *vd, metaslab_class_t *mc) +{ + if ((mc == spa_embedded_log_class(vd->vdev_spa) || + mc == spa_special_embedded_log_class(vd->vdev_spa)) && + vd->vdev_log_mg != NULL) + return (vd->vdev_log_mg); + else + return (vd->vdev_mg); +} + +void +vdev_default_xlate(vdev_t *vd, const zfs_range_seg64_t *logical_rs, + zfs_range_seg64_t *physical_rs, zfs_range_seg64_t *remain_rs) +{ + (void) vd, (void) remain_rs; + + physical_rs->rs_start = logical_rs->rs_start; + physical_rs->rs_end = logical_rs->rs_end; +} + +/* + * Derive the enumerated allocation bias from string input. + * String origin is either the per-vdev zap or zpool(8). + */ +static vdev_alloc_bias_t +vdev_derive_alloc_bias(const char *bias) +{ + vdev_alloc_bias_t alloc_bias = VDEV_BIAS_NONE; + + if (strcmp(bias, VDEV_ALLOC_BIAS_LOG) == 0) + alloc_bias = VDEV_BIAS_LOG; + else if (strcmp(bias, VDEV_ALLOC_BIAS_SPECIAL) == 0) + alloc_bias = VDEV_BIAS_SPECIAL; + else if (strcmp(bias, VDEV_ALLOC_BIAS_DEDUP) == 0) + alloc_bias = VDEV_BIAS_DEDUP; + + return (alloc_bias); +} + +uint64_t +vdev_default_psize(vdev_t *vd, uint64_t asize, uint64_t txg) +{ + ASSERT0(asize % (1ULL << vd->vdev_top->vdev_ashift)); + uint64_t csize, psize = asize; + for (int c = 0; c < vd->vdev_children; c++) { + csize = vdev_asize_to_psize_txg(vd->vdev_child[c], asize, txg); + psize = MIN(psize, csize); + } + + return (psize); +} + +/* + * Default asize function: return the MAX of psize with the asize of + * all children. This is what's used by anything other than RAID-Z. + */ +uint64_t +vdev_default_asize(vdev_t *vd, uint64_t psize, uint64_t txg) +{ + uint64_t asize = P2ROUNDUP(psize, 1ULL << vd->vdev_top->vdev_ashift); + uint64_t csize; + + for (int c = 0; c < vd->vdev_children; c++) { + csize = vdev_psize_to_asize_txg(vd->vdev_child[c], psize, txg); + asize = MAX(asize, csize); + } + + return (asize); +} + +uint64_t +vdev_default_min_asize(vdev_t *vd) +{ + return (vd->vdev_min_asize); +} + +/* + * Get the minimum allocatable size. We define the allocatable size as + * the vdev's asize rounded to the nearest metaslab. This allows us to + * replace or attach devices which don't have the same physical size but + * can still satisfy the same number of allocations. + */ +uint64_t +vdev_get_min_asize(vdev_t *vd) +{ + vdev_t *pvd = vd->vdev_parent; + + /* + * If our parent is NULL (inactive spare or cache) or is the root, + * just return our own asize. + */ + if (pvd == NULL) + return (vd->vdev_asize); + + /* + * The top-level vdev just returns the allocatable size rounded + * to the nearest metaslab. + */ + if (vd == vd->vdev_top) + return (P2ALIGN_TYPED(vd->vdev_asize, 1ULL << vd->vdev_ms_shift, + uint64_t)); + + return (pvd->vdev_ops->vdev_op_min_asize(pvd)); +} + +void +vdev_set_min_asize(vdev_t *vd) +{ + vd->vdev_min_asize = vdev_get_min_asize(vd); + + for (int c = 0; c < vd->vdev_children; c++) + vdev_set_min_asize(vd->vdev_child[c]); +} + +/* + * Get the minimal allocation size for the top-level vdev. + */ +uint64_t +vdev_get_min_alloc(vdev_t *vd) +{ + uint64_t min_alloc = 1ULL << vd->vdev_ashift; + + if (vd->vdev_ops->vdev_op_min_alloc != NULL) + min_alloc = vd->vdev_ops->vdev_op_min_alloc(vd); + + return (min_alloc); +} + +/* + * Get the parity level for a top-level vdev. + */ +uint64_t +vdev_get_nparity(vdev_t *vd) +{ + uint64_t nparity = 0; + + if (vd->vdev_ops->vdev_op_nparity != NULL) + nparity = vd->vdev_ops->vdev_op_nparity(vd); + + return (nparity); +} + +static int +vdev_prop_get_objid(vdev_t *vd, uint64_t *objid) +{ + + if (vd->vdev_root_zap != 0) { + *objid = vd->vdev_root_zap; + } else if (vd->vdev_top_zap != 0) { + *objid = vd->vdev_top_zap; + } else if (vd->vdev_leaf_zap != 0) { + *objid = vd->vdev_leaf_zap; + } else { + return (EINVAL); + } + + return (0); +} + +static int +vdev_prop_get_int(vdev_t *vd, vdev_prop_t prop, uint64_t *value) +{ + spa_t *spa = vd->vdev_spa; + objset_t *mos = spa->spa_meta_objset; + uint64_t objid; + int err; + + if (vdev_prop_get_objid(vd, &objid) != 0) + return (EINVAL); + + err = zap_lookup(mos, objid, vdev_prop_to_name(prop), + sizeof (uint64_t), 1, value); + if (err == ENOENT) + *value = vdev_prop_default_numeric(prop); + + return (err); +} + +static int +vdev_prop_get_bool(vdev_t *vd, vdev_prop_t prop, boolean_t *bvalue) +{ + int err; + uint64_t ivalue; + + err = vdev_prop_get_int(vd, prop, &ivalue); + *bvalue = ivalue != 0; + + return (err); +} + +/* + * Get the number of data disks for a top-level vdev. + */ +uint64_t +vdev_get_ndisks(vdev_t *vd) +{ + uint64_t ndisks = 1; + + if (vd->vdev_ops->vdev_op_ndisks != NULL) + ndisks = vd->vdev_ops->vdev_op_ndisks(vd); + + return (ndisks); +} + +vdev_t * +vdev_lookup_top(spa_t *spa, uint64_t vdev) +{ + vdev_t *rvd = spa->spa_root_vdev; + + ASSERT(spa_config_held(spa, SCL_ALL, RW_READER) != 0); + + if (vdev < rvd->vdev_children) { + ASSERT(rvd->vdev_child[vdev] != NULL); + return (rvd->vdev_child[vdev]); + } + + return (NULL); +} + +vdev_t * +vdev_lookup_by_guid(vdev_t *vd, uint64_t guid) +{ + vdev_t *mvd; + + if (vd->vdev_guid == guid) + return (vd); + + for (int c = 0; c < vd->vdev_children; c++) + if ((mvd = vdev_lookup_by_guid(vd->vdev_child[c], guid)) != + NULL) + return (mvd); + + return (NULL); +} + +static int +vdev_count_leaves_impl(vdev_t *vd) +{ + int n = 0; + + if (vd->vdev_ops->vdev_op_leaf) + return (1); + + for (int c = 0; c < vd->vdev_children; c++) + n += vdev_count_leaves_impl(vd->vdev_child[c]); + + return (n); +} + +int +vdev_count_leaves(spa_t *spa) +{ + int rc; + + spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER); + rc = vdev_count_leaves_impl(spa->spa_root_vdev); + spa_config_exit(spa, SCL_VDEV, FTAG); + + return (rc); +} + +void +vdev_add_child(vdev_t *pvd, vdev_t *cvd) +{ + size_t oldsize, newsize; + uint64_t id = cvd->vdev_id; + vdev_t **newchild; + + ASSERT(spa_config_held(cvd->vdev_spa, SCL_ALL, RW_WRITER) == SCL_ALL); + ASSERT0P(cvd->vdev_parent); + + cvd->vdev_parent = pvd; + + if (pvd == NULL) + return; + + ASSERT(id >= pvd->vdev_children || pvd->vdev_child[id] == NULL); + + oldsize = pvd->vdev_children * sizeof (vdev_t *); + pvd->vdev_children = MAX(pvd->vdev_children, id + 1); + newsize = pvd->vdev_children * sizeof (vdev_t *); + + newchild = kmem_alloc(newsize, KM_SLEEP); + if (pvd->vdev_child != NULL) { + memcpy(newchild, pvd->vdev_child, oldsize); + kmem_free(pvd->vdev_child, oldsize); + } + + pvd->vdev_child = newchild; + pvd->vdev_child[id] = cvd; + pvd->vdev_nonrot &= cvd->vdev_nonrot; + + cvd->vdev_top = (pvd->vdev_top ? pvd->vdev_top: cvd); + ASSERT0P(cvd->vdev_top->vdev_parent->vdev_parent); + + /* + * Walk up all ancestors to update guid sum. + */ + for (; pvd != NULL; pvd = pvd->vdev_parent) + pvd->vdev_guid_sum += cvd->vdev_guid_sum; + + if (cvd->vdev_ops->vdev_op_leaf) { *** 7530 LINES SKIPPED *** From nobody Sun Apr 19 08:12:19 2026 X-Original-To: dev-commits-src-main@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 4fz1Yv3BQsz6b9MW for ; Sun, 19 Apr 2026 08:12:19 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fz1Yv1tMRz3kNR for ; Sun, 19 Apr 2026 08:12:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776586339; 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=ueEIgxNbVd16KrN6wUIzypURbadeMNTqTy+pm55XOgU=; b=dCyqEFHR7u74ncABrGHYqpnapOoKXLUcE39hOmQ+dOEaBXRUgCPtfAhJlvTot9ycTdh568 cGrOF0lD+9vibSxnhU/1NJDGInLBfHObxnZNMKUpfYAY5MJtnI+ZYb0mYvgU00L7MuxEmq OFvDgC3rPGe7F2kwYL4C7GToiaMAPjXqt/6GWr1PO+Xw8mqZkGyUN4Mzvma4j3qWqycOOQ fWU49GFQR2G4eFZBJKVmwLM/n/i1G7kclSxv/rNv7IGxlLvPBUbnN0NIY51FPVsUOIQdxI th0AOL7UeNL/C/92RGwJfjy0vu04WItjm0lVvPS3YLk/y0avGtcINTaKnGkv+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776586339; a=rsa-sha256; cv=none; b=IjELnaaoNLBQbkYZz79V0nlU9YJkOUOoKYM7IoV1NNR7xZLxLEW1mBxmJHanBYYcjQOKB3 PaLOR87Gs5GXVjfKISdA7P7AeGqAmRt6i4YXmw5l+xcZHUHkZJ2YRPgXVmLAVz1UqcKKNw mCswVdCGY0pNo1PktB6nQpaE6MoXjKrwzPhyEPiRA1U76E+oOdQ40Vsf3mn4dELd7nNZtt 4viBkEANPN9GN1UAf6U/gQ3ek9SFbL9ckaAvJPbeknLctSijWQpjdQK3lYZj05UPVLbFEQ YD+CziUqN4wFmUaz/hYbW3TrHgSv0zeGx+LFCFMWQ+w1fKCBKuDHR8rDfqfwnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776586339; 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=ueEIgxNbVd16KrN6wUIzypURbadeMNTqTy+pm55XOgU=; b=xjrzdAKvuxTmcoXJXB7dTiSYA1QDLwlUp+tAXgQpcGh1e7DPT9iCi3VMfdXOYSsrU8HIr0 l0aQ/2qHiA8Tfina+rV+VAT7sj4AchAyJWv5hb8OVUSX8su8IQmtsl57wxfTrftXk2iV4m SJiht9Iz96aRa+pQo+g5qctSpjQqRorSffbH8ymgEDv09SoD+1AAcFXY9ZTYVUmr62YMST oPbygvXquVKk9CC36W5IBhN9j7RfoY7A3yI0U2zcXn8o3bI6u6UDbAjsdeHqAZurpnQUOs w+Nef5+2r3Vz83gp49W5i21SDIADE1ElbZTGCxszO/20B0uS+q2y94qKIspe0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fz1Yv1VByz1HSb for ; Sun, 19 Apr 2026 08:12:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 194ed by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 08:12:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 96246330c1c4 - main - msdosfs(4): Fix two typos in source code comments List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 96246330c1c47ea06b7e781ddd87de45d541494f Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 08:12:19 +0000 Message-Id: <69e48e63.194ed.4231fda5@gitrepo.freebsd.org> The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=96246330c1c47ea06b7e781ddd87de45d541494f commit 96246330c1c47ea06b7e781ddd87de45d541494f Author: Gordon Bergling AuthorDate: 2026-04-19 08:06:45 +0000 Commit: Gordon Bergling CommitDate: 2026-04-19 08:12:02 +0000 msdosfs(4): Fix two typos in source code comments - s/unititialized/uninitialized/ MFC after: 3 days --- sys/fs/msdosfs/msdosfs_fat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c index bfaff417f677..ef8496d21a48 100644 --- a/sys/fs/msdosfs/msdosfs_fat.c +++ b/sys/fs/msdosfs/msdosfs_fat.c @@ -134,7 +134,7 @@ pcbmap(struct denode *dep, u_long findcn, daddr_t *bnp, u_long *cnp, int *sp) int error; u_long i; u_long cn; - u_long prevcn = 0; /* XXX: prevcn could be used unititialized */ + u_long prevcn = 0; /* XXX: prevcn could be used uninitialized */ u_long byteoffset; u_long bn; u_long bo; @@ -761,7 +761,7 @@ clusteralloc1(struct msdosfsmount *pmp, u_long start, u_long count, { u_long idx; u_long len, newst, foundl, cn, l; - u_long foundcn = 0; /* XXX: foundcn could be used unititialized */ + u_long foundcn = 0; /* XXX: foundcn could be used uninitialized */ u_int map; MSDOSFS_ASSERT_MP_LOCKED(pmp); From nobody Sun Apr 19 08:12:20 2026 X-Original-To: dev-commits-src-main@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 4fz1Yw3rWvz6b9Tb for ; Sun, 19 Apr 2026 08:12:20 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fz1Yw2mZ5z3kNT for ; Sun, 19 Apr 2026 08:12:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776586340; 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=E9R5ncTm0ulZ9U8dPQ7B52BIlseUQo1XmgK/0IqsEDY=; b=LkQ3xBTkSsww69B0nmukm+GRfugTlxMO1pg8CDResZz8fzLC8PS+Wyq2mx1Zvbz2VsxQzl Nk8vWlDru1m+4zO1t0q7uws51MVnpvBdTSlUY7aV+WACtuW5KPIYuKxrZizNJ6KjJFnDIC bVps8sx/1tsQbKg5qyHxkQoDfCUhV97X+6SwSHu8QOKpEzz5q2q1LP4aa6csMs54XVRQqK ur2FIKIszSOdVSHTXcuL5l3wWWls6akOTb79Fw3lkdyl3Scv1mSXxIehbC7pDJV/IxwzVI RHilEAwKTVX/oft94gGSL8pLxAocUbKCMC7+38l4wFzRS/UQaOnVBwU4C9DIKA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776586340; a=rsa-sha256; cv=none; b=Izd/e9YLzFLJ6vM8yvNGeVk62Qc9axYEtzbhvp+HWnJZIVJIOtEbC/ADQumwAjNO5pg48T EGW8byBKMvu/IMw0ZCtEyzNHUMXxcgH6z2MCHys99KXUndcee6JLNtnzdi7CdcPGJo3cCh jJcKZ28XzB6vTyqsEZ0Sm8yti9OKgW99rmsBo1UP9yX86Ek2rA2dbIkPxudCdJAxOjvWOc avOs1zUzVECal6JxmA54VrKNce+eDlERl48pxhKV0YoDVPdWojjcfh3dMOYcBqT7NmmdcP RVEaNNvxKLFUlcFzdPZ3IKZGASFKUajQOgVkxhs+plTaxFbv2QZIxcJL+I36mQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776586340; 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=E9R5ncTm0ulZ9U8dPQ7B52BIlseUQo1XmgK/0IqsEDY=; b=CgtSb9J0/hgifzYS9AXEnyxXr4OshFr2J4igQWkJYx2txNdaxCbtRxWSdBfhIXP9yJSe0e 9rTZfC1PL7Eli19Bi/UJBoTNPvZ/K4G8rFUDlfYRK8fyl2j/3Vutq6uFY0sL1UKYLX1kKL NO5oVxl3D2TETT+8mHaAhWva4HEN8rYsEco/kTGv73PQUPdAQOfld5pfYjRaNvarhPbkYe n6frAOodX5D+7lP53TipIVySCj2MfeeSXGqrCMWEb7cyFnidTHpz4+GaLvMOHopv1rX9hX lpWjVqJ3l34y4/FXyLe6uZeB5lPKOVLBIbhzMcPWJaeovcgrD/DcMybPuGOWyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fz1Yw2HKXz1HJT for ; Sun, 19 Apr 2026 08:12:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d0ae by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 08:12:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 6323e2be6102 - main - rpcsec_gss(3): Fix a typo in a source code comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6323e2be6102e2a152b4420db272f7e880017cf0 Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 08:12:20 +0000 Message-Id: <69e48e64.1d0ae.7e2b5913@gitrepo.freebsd.org> The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=6323e2be6102e2a152b4420db272f7e880017cf0 commit 6323e2be6102e2a152b4420db272f7e880017cf0 Author: Gordon Bergling AuthorDate: 2026-04-19 08:08:56 +0000 Commit: Gordon Bergling CommitDate: 2026-04-19 08:12:02 +0000 rpcsec_gss(3): Fix a typo in a source code comment - s/verfier/verifier/ MFC after: 3 days --- sys/rpc/rpcsec_gss/rpcsec_gss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/rpc/rpcsec_gss/rpcsec_gss.c b/sys/rpc/rpcsec_gss/rpcsec_gss.c index 89d1c56f7cc2..4d5c53e2545e 100644 --- a/sys/rpc/rpcsec_gss/rpcsec_gss.c +++ b/sys/rpc/rpcsec_gss/rpcsec_gss.c @@ -128,7 +128,7 @@ struct rpc_gss_data { rpc_gss_options_req_t gd_options; /* GSS context options */ enum rpcsec_gss_state gd_state; /* connection state */ gss_buffer_desc gd_verf; /* save GSS_S_COMPLETE - * NULL RPC verfier to + * NULL RPC verifier to * process at end of * context negotiation */ CLIENT *gd_clnt; /* client handle */ From nobody Sun Apr 19 08:12:18 2026 X-Original-To: dev-commits-src-main@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 4fz1Yt2Cb6z6b9PX for ; Sun, 19 Apr 2026 08:12:18 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fz1Yt1Dm4z3kbR for ; Sun, 19 Apr 2026 08:12:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776586338; 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=2j1N+EN64ZOnrrZy27ezdnf0uB1rPrXnnVChMo06S0Q=; b=NLKZVu4yN5a2uUWpN0GreH2HCVtmvrAAHHLGkD0UiyBkezTofsfo4w2UtMHmcoEmfqqXDg mUpk7JPnFM/5F5OI8ah2Il9t2zS7bpYffHb3OZ8TexFGs8UqWsMQ03WF57xWoMn/NDN/1G tFMcU7S/2R0V1DQwgvOTJlTKajyAMqg59EuK4Qh19kMbdPKSDm2EWkoFEqqDsD8X+INcyr uHVlXBQh+Y4ccNJG5Zh8CRJYtZD7XVMMwDv5D8ZPTYk5Zxk7PWsrg2CBY1jve++dKkU8OX KRmskE5SfcONVDke1/bK85EJ5rZs5pjqgOYoPNpSaGE9QRGhw6a9vZzEuFiMWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776586338; a=rsa-sha256; cv=none; b=opd24Ilrj+fUPn/XBjGhQsEN3dADtZ0Pd2KAnPNNZVzCNvqIMK4m39DRdbBUpHkbiFUpcy bpx94QfnoFyXJax28ayxYKlLdM1UJ24C6NyW9s72aSogDWaQEJ6ftLusHkRWAQvEZUB/Dy wRMUI06Q/jF9JibeuEE1m8tzWjVNNXG7n1q8AW5ICICf1bSpO+oANQ+gK6dQWDsSI8cE3f jvc+xyOEwQ+dXXbshYen9O3nKttCvneFjUp+M1ckAqz59Ao9ge8rQTOQAGGR7TfNoYm/91 y/yVl0q8hWIAEhSJTx7+/G40BewrDZiqKDdvja5QNJG3r/hODPlo23m3W07EcQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776586338; 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=2j1N+EN64ZOnrrZy27ezdnf0uB1rPrXnnVChMo06S0Q=; b=YgxaGZK4QBFOpD51hbAECfXc6Cad9m3nH6f9JqT/edeaFF5aXf5ojZ+789kuem1qA58Iao jNq3lQq/i+ml48FIb56MXlywAryaYliUV+S/oBAWKEOFEKm8wrUkuqdmYoN4l4FRyL2azt UgVNzPUelytKPndrw+n57U4UVgQsxAP4CqxnlA2kK5YnY+A5wwHHd/UDt80NhZgo/mX/H0 QjIz+yvCfjU9LB5HfbCoyq+XmjysIXD/lVPn1dhdHPJnivmJYvacafyTFQObu+3TWktD7G HZu4qlMqRINmKF9NivV4uWSlqieizi7LBdgJTAXopD0nt79xmmLIF9S78n7qeg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fz1Yt0jSLz1H4M for ; Sun, 19 Apr 2026 08:12:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1d5fb by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 08:12:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 33e0180a306b - main - thunderbolt: Fix a typo in a source code comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33e0180a306b9ed60df5eae1818c40ef65750525 Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 08:12:18 +0000 Message-Id: <69e48e62.1d5fb.56158ad8@gitrepo.freebsd.org> The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=33e0180a306b9ed60df5eae1818c40ef65750525 commit 33e0180a306b9ed60df5eae1818c40ef65750525 Author: Gordon Bergling AuthorDate: 2026-04-19 08:04:12 +0000 Commit: Gordon Bergling CommitDate: 2026-04-19 08:12:02 +0000 thunderbolt: Fix a typo in a source code comment - s/Inititalize/Initialize/ MFC after: 3 days --- sys/dev/thunderbolt/nhi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/thunderbolt/nhi.c b/sys/dev/thunderbolt/nhi.c index 74cefbb50ca1..9550de258dab 100644 --- a/sys/dev/thunderbolt/nhi.c +++ b/sys/dev/thunderbolt/nhi.c @@ -571,7 +571,7 @@ nhi_alloc_ring0(struct nhi_softc *sc) TAILQ_INSERT_TAIL(&r->rx_head, cmd, cm_link); } - /* Inititalize the TX frames */ + /* Initialize the TX frames */ for ( ; i < r->tx_ring_depth + r->rx_ring_depth - 1; i++) { cmd = &sc->ring0_cmds[i]; cmd->data = (uint32_t *)(frames + NHI_RING0_FRAME_SIZE * i); From nobody Sun Apr 19 08:12:15 2026 X-Original-To: dev-commits-src-main@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 4fz1Yr2z2Jz6b9GH for ; Sun, 19 Apr 2026 08:12:16 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fz1Yq6bnnz3kGM for ; Sun, 19 Apr 2026 08:12:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776586335; 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=QLrFsZS02eLcZGr0X3gsXdq4mFN6Qcu7AhvVHGfnwWI=; b=xkAqB64HVbCLuFHn26VLZLz8RcI3xqkz0Hz7hxHJ8eewW6nb+w2LvMW0+GmB2ZXDbpCRXF Xsb1EUeFVdymDxY97hZElT7dwLv4ogpaGztW1Q+0puuyXOeBYTQBzX3peYnZSdfalOg0cO OivDpsfgx4oJFa2/txvP8KAgyg5elq/EI4QSjtbnMVVmTI52A1CvCz60NSANhxVRKOJ7FP XReMD5gt4VZOskbjwD0tZMVSHBJaChTjOVpWHZcdfeVFHiXCOMjYPbbfpfJ3SPRaA6wApv BgJzozL4x6eh+sFgBMlVhjtrJp9s8mloQW7P1S3Twd1cL/VlYroLClUR/+eRHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776586335; a=rsa-sha256; cv=none; b=s+P2L7w35pmjp3MRp/aMQ+5loWGXx2AejU9eCUd0Nks/v/Zaa1o8grV6M1X2KBXcL76lbi 1Z3CNYOIggcs5HQiT3wXw7AHVs5nHE4fqOPwKiCtaljmairygOd8QfoJloXynjP44vP90y a3xGTWnugsKUWn4EemMbjFZOR/Ska6HRUBqf9rDu1OxTqvjzu4oUYxMm+7XvzbtcVk/Rbo xFKsgSguCkCCnLuLcecvE9j2WSDLAe/yGXY6dBWJhOTp/7TRh41nOof6hMJEeUlAlEYiJi 8oGXybPneUkkZV86VnNI9R80jyFzQVfRhikZviiPMOKlGcrbfFd+3rIa+lxAKg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776586335; 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=QLrFsZS02eLcZGr0X3gsXdq4mFN6Qcu7AhvVHGfnwWI=; b=E7SDDcKx6rjzIwlHU2tGngbDRQIBAeGdtVzpzFgMU6O+k5T7bna+ETD7Q3XovfBHPixJn0 tPDvZUWGEVD9jq9J+Q0kDfygcm9kIfKpWRBcgyMr+Vu+nfqY+MY/LdZiIZToKgjyvHPHcl Z+BkaHf8trUQflWA60Vw4j6DVN3RdFCzO8MKIpIHlkYxkfhUzZlTMLeV4IDdy8AKv5xhnh lmCQKgF/08eB6s4ye/u2YTL2ln2YEGzUzLOPHrRBl1aM1aRNKX6Bq7a/4CXzA6Cw11lH3c /Fk5m4ym2Z6dWxriK4ppktUgw9SuX7ghiZ3NlaKALucMyV5b2OlMN+X6K2p8PQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fz1Yq69Wfz1HTP for ; Sun, 19 Apr 2026 08:12:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c796 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 08:12:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 59dacd7f008f - main - librpcsec_gss: Fix a typo in a source code comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59dacd7f008f54a335ec49e747bb8ddac67b0a83 Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 08:12:15 +0000 Message-Id: <69e48e5f.1c796.6c3d3363@gitrepo.freebsd.org> The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=59dacd7f008f54a335ec49e747bb8ddac67b0a83 commit 59dacd7f008f54a335ec49e747bb8ddac67b0a83 Author: Gordon Bergling AuthorDate: 2026-04-19 07:57:03 +0000 Commit: Gordon Bergling CommitDate: 2026-04-19 08:12:02 +0000 librpcsec_gss: Fix a typo in a source code comment - s/verfier/verifier/ MFC after: 3 days --- lib/librpcsec_gss/rpcsec_gss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librpcsec_gss/rpcsec_gss.c b/lib/librpcsec_gss/rpcsec_gss.c index 4a0de8b70b67..276fa1423b0f 100644 --- a/lib/librpcsec_gss/rpcsec_gss.c +++ b/lib/librpcsec_gss/rpcsec_gss.c @@ -100,7 +100,7 @@ struct rpc_gss_data { rpc_gss_options_req_t gd_options; /* GSS context options */ enum rpcsec_gss_state gd_state; /* connection state */ gss_buffer_desc gd_verf; /* save GSS_S_COMPLETE - * NULL RPC verfier to + * NULL RPC verifier to * process at end of * context negotiation */ CLIENT *gd_clnt; /* client handle */ From nobody Sun Apr 19 08:12:16 2026 X-Original-To: dev-commits-src-main@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 4fz1Ys22Xcz6b99h for ; Sun, 19 Apr 2026 08:12:17 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fz1Ys0MMGz3kNQ for ; Sun, 19 Apr 2026 08:12:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776586337; 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=w1RB9EW0GElP2COP5cxw0Nga7pJrRMMYOY2mnhThzIE=; b=Ly/VTgpVjjv/bbTGpNmokAWj+29espcCvsUnv8Ou+SisSWNzEMYwYBvV0LK4LNhd/AfkfN J2G2igsrFFrZHSeeDqZ2Dpfu6tyqGnGxx6Rc1rvjcU5HV6Xz1M4zSL2BkoNvO803JUA9lC wB1LVXFTLOr2Rza6WrvgHxq9RTiI26JgIxz73Qc3KOEINUc5cVUL+UDBRkuWUfAGxagBFV IXJGXqabpZcJYvBEqbFZYL21Rc3iy/lpCivbOedg8xIWi2G0SVyJ9vMXY6KCgQqgSqKepH a6CZt/UGuzKr/5bUnSkVLCYU+Vtbw52rQ3F0zhEFtY064SEGdXumihNSKCsdPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776586337; a=rsa-sha256; cv=none; b=jkMSAfdZofRvHY/QhZ1e2UDPn75lwOjy35rGU8jpz/q82KWJcJIQyPRUYojgi5PfuSp/Iz QD3cc4oDRX/kDiieQc9OUjEajC6MMyUiByYOUOJGa5klE+kqBTkTKeSRAsoIMQrFuMW2Cx ZG4N4Gp/yPGO7meB2qyJYWobT1CRS9GMwqta6wUsrqPlI8vC5dN/i9Z49/A0xPyfFaHJvo FuXUiJfe4CRiQgOJp2Hoj5eSQ+lJIoQyAOJm96vNW96r4PnmAsTx9Dsp1b0wHFywj/ighi u241BxGD71n5YVC7Rfd9lCns88pxeJdQe2kjMjL0O5XI+3Y65DnkpujbSjslEQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776586337; 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=w1RB9EW0GElP2COP5cxw0Nga7pJrRMMYOY2mnhThzIE=; b=v2Jyto8JbLi7MtUS57JICnHAMhYWB/7phvUtDHf1X0/vdRLGJanUQ343yWO2jerenAZ5nM m5aVyGyAcAonOp38NKVgOodBuywKPwLmghDRgE2TlorkfyFSfmHzeVOcksg33YvHYlzHt3 Z9AWHf9ywgIO92s2pGCXwFH+hhJKiAxuXtoUVxZEuw+PtpyqY1FYpYpvRH/5+REdR3Aey8 HlT8mPkHeZyRh7Ju/A+RfsKtq1aO76yCL8DDecGGpdB4ECYWhQuhbQu0nXA4CssoGwcsXy UtNjFb97RzO+njDw7DHZT1PNAuEXbE5hNdadyREaUQJoAVMocU2qtVUPABnW6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fz1Yr6zNlz1HlL for ; Sun, 19 Apr 2026 08:12:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1ca06 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 08:12:16 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Gordon Bergling Subject: git: 4177af3b0e2d - main - stand/powerpc: Fix a typo in a source code comment List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4177af3b0e2db36238bbd6f973943f830d1ff46f Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 08:12:16 +0000 Message-Id: <69e48e60.1ca06.717aa519@gitrepo.freebsd.org> The branch main has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=4177af3b0e2db36238bbd6f973943f830d1ff46f commit 4177af3b0e2db36238bbd6f973943f830d1ff46f Author: Gordon Bergling AuthorDate: 2026-04-19 08:01:18 +0000 Commit: Gordon Bergling CommitDate: 2026-04-19 08:12:02 +0000 stand/powerpc: Fix a typo in a source code comment - s/limitiations/limitations/ MFC after: 3 days --- stand/powerpc/boot1.chrp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/powerpc/boot1.chrp/Makefile b/stand/powerpc/boot1.chrp/Makefile index a693f775dde8..0b77bce2b097 100644 --- a/stand/powerpc/boot1.chrp/Makefile +++ b/stand/powerpc/boot1.chrp/Makefile @@ -10,7 +10,7 @@ SRCS= boot1.c ashldi3.c syncicache.c memset.c CFLAGS+=-I${LDRSRC} # Load boot1.elf below kernel. # -# Due to limitiations in the way we load stuff, we have to avoid reusing +# Due to limitations in the way we load stuff, we have to avoid reusing # memory until the kernel MMU code has taken over. # # 0x38000 is high enough to not interfere with the trap area, but low From nobody Sun Apr 19 10:42:42 2026 X-Original-To: dev-commits-src-main@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 4fz4vQ4qxXz6bNTF for ; Sun, 19 Apr 2026 10:42:42 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fz4vQ34v3z3C4x for ; Sun, 19 Apr 2026 10:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776595362; 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=4C2noShpMsCKEfdLPRrQ5aWODu7qiDelnirx/O4MehI=; b=T1DfURirrfNCMC8FxNLIeZorK1wwxMv3qTZgZZOKOha+BDGoimRkdam48X99JgiPF3p8sd tddqgHsJsfYdyJNuQfRDZiDKj2nlidam2MPJaYGYUNZyDMpBDjXBQbv7tas0A0sc6dtOzZ STYXUuO2EK3FuqwVYtvtZk7ygsxGkLwlx3P+UDEMjR2EDuuW+g5L81AbwLK8hPgWoY7PAy hWKg4xKbVQJbcgEu6kiRez3Q+roh1CekPJmLzmfFPor1xzanHSSLLSOjownqWjpFWNan4F FThztI5zNo2584Ol5yX0Ezl2rL9hRXgul/scC3OoszcgrpvL5f5LfljTKk1vqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776595362; a=rsa-sha256; cv=none; b=pPb7KkUVkzfpx3E2aP2Hm3AJTfC2Amm+kAAZi1qf+aPo8JIkBRYPvQaJR0xhovuxcDfHRm vs+kL/csf9Y4W76P9A/XnHy4IItuKR5jkfUJMd4c2bc/lmGMc6hrAtZnc9ZvZl4aeny1ua 3jmgpiClzPe6EtX1Cq2Ora+B8IZ00/ts4grhaN6R7+zi4Al78azDEcjqrK886QpFpnCTui GjViwd4x201GJxqAMSt8tZ3mOppNx3K22yD+gvKJMaMdmtpwH+ZlTmzCwXXkcW/h3L98Xh xebWrxXsSKFKGnXAQoM5s7qofXUesVulBXx1GKLw3UH114CWlyD5mGzQ0Czh+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776595362; 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=4C2noShpMsCKEfdLPRrQ5aWODu7qiDelnirx/O4MehI=; b=OdtoDAfX+gy79a9HjlGVdEcfFpZuJqSDMhHYHmY3rLJwBeyDTthKPEBU+T9h9tTuppr6xk uvDyofKxb59mUe6tn+MBtfkRXtJ8P3XRh4L7BY3DtQqv4Qy3R+KvKeLMfpcv3UyQJ2j9xe 5QkVJCs5sTF10skugTrh6UkwOzkL/jnD1LDlIcLwZXf11AhIZZkaCtph7i1BZWZdlTfiZP JlDONQ+QlIrtLBbJg9ZecoTCChxYOLd0ciNmjG9QwbazyvVBVXtLts50DhniIV8n8wt27F oQrCoBBey7sJFAp6oDXtS9J2HkOm7PkgLQw6Llm9+NPPyJMYhUJEQyehT+C/oA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fz4vQ2cczz1MH3 for ; Sun, 19 Apr 2026 10:42:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 337f9 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 10:42:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 554f5aa52626 - main - service(8): Replace indentation in usage() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 554f5aa526266057672740e22af0a75cc32bddd5 Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 10:42:42 +0000 Message-Id: <69e4b1a2.337f9.70abf203@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=554f5aa526266057672740e22af0a75cc32bddd5 commit 554f5aa526266057672740e22af0a75cc32bddd5 Author: Christos Margiolis AuthorDate: 2026-04-19 10:40:31 +0000 Commit: Christos Margiolis CommitDate: 2026-04-19 10:40:31 +0000 service(8): Replace indentation in usage() The -d option was indented with spaces instead of tabs, and this broke formatting. Before: -d Enable debugging of rc.d scripts -j Perform actions within the named jail After: -d Enable debugging of rc.d scripts -j Perform actions within the named jail MFC after: 1 week --- usr.sbin/service/service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/service/service.sh b/usr.sbin/service/service.sh index 9387a49051d6..5ae1b2bee933 100755 --- a/usr.sbin/service/service.sh +++ b/usr.sbin/service/service.sh @@ -39,7 +39,7 @@ usage () { echo "${0##*/} [-j ] [-dqv] [-E var=value] start|stop|etc." echo "${0##*/} -h" echo '' - echo "-d Enable debugging of rc.d scripts" + echo "-d Enable debugging of rc.d scripts" echo "-j Perform actions within the named jail" echo "-E n=val Set variable n to val before executing the rc.d script" echo '-e Show services that are enabled' From nobody Sun Apr 19 12:47:51 2026 X-Original-To: dev-commits-src-main@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 4fz7gr056Rz6bYcr for ; Sun, 19 Apr 2026 12:47:52 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fz7gq4tVXz3l8K for ; Sun, 19 Apr 2026 12:47:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776602871; 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=haMMqYIhNMN6Jr3Y1nWYbHwU7tu7QhS8Uu0L80/jA88=; b=SZ4wjppHe8t96gi1LxDX8yYVedbHmKacnJguRAu5abzAjkh86e5lRADogVAycgB1Z6YLiH JNbR0EIQyQszBK1PnOmqoOzGC6htbhr15UCsp9SJGiX7C+CToToPX1bPLh/gBqioYOhqI/ NVAfJ1f3xdOQSM2ck1RUy0XZsEeijsag+PejWa6izEuzkkVgbNOQBV3yzoVMUlCexT5Nki liBrKA2SMhGWs269/VLO6lpfyT1CNthuDz+qPhM2/yY3KgJjDc4S+3DdcZAgMZeqVd3l8u 2kZEDRoia2oSZnFHDeLHBMsChSBLOSE+yXt/gy68CmykUPWJaz568DX5JLJiEA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776602871; a=rsa-sha256; cv=none; b=ayCmQWRSkMgyaI6BKrFMtz5gYCF96HinUsQvSk90xjPwRbmkmfxmWQIluzLWkfJNqKUlI7 zoLKfGNi3XZukzuYZygIGPbmB79J5wpW/qZ2jdbzGChW+ZxucJ9bB0RELesgWc+ycQX2FO fmIvlMUf9GZFg/TC8Dlg4SgBBLPFmFLHw6Yf+nQjJdGTTHgN0q9Aq9K2LbC2eg8nGI66Po Z0UlV+pszYT/Jry87y/F/mhj4nTo8wshMpdN3aAf290zrdlUq1+bUIQGMa3LrP+Mngf6T5 GW1Ag25ZdDg9OUxF4TiKd256ZfmELeV5o96nitLyE3PNBX8mpsxXzcZsq81+ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776602871; 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=haMMqYIhNMN6Jr3Y1nWYbHwU7tu7QhS8Uu0L80/jA88=; b=hvPh/vld8R0jKus0yi5JkR1qrLWZbenXEcHKbHT2voVU4VKEN86NIjMv1siy/VNkbOQjlR S9e44/0Rv34Fb6Wym5Vk7psUuESXZEsvUcQvNS0xnsWD2sfua52fsKvqYHMwcmKFq+q60A YPaOAYHes569KE/TSXRLkMEMLcR8hRsyrdc3riPJr+vlJkivFgZnXRdb6+mkGe6QvLLp4M dipY8RobpVT2T1WoWRKSdgKb0sqEzpdBUST1PCvJAC9iYoT1y3POob1BhRn1dDqG22/kPV UJF7TYmZnR60xj6dXWMz59jUrc6hfnALaAHF3uxiqfXni9fxzIyoqg7TLOxW/A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fz7gq4BKyz1QMc for ; Sun, 19 Apr 2026 12:47:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 18a11 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 12:47:51 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Leidinger Subject: git: 315f665fe1ac - main - Doxygen subsystem config: exclude the content of the .git directory List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: netchild X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 315f665fe1ac97ea2ca946e51ced24f7b21fb22e Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 12:47:51 +0000 Message-Id: <69e4cef7.18a11.a831756@gitrepo.freebsd.org> The branch main has been updated by netchild: URL: https://cgit.FreeBSD.org/src/commit/?id=315f665fe1ac97ea2ca946e51ced24f7b21fb22e commit 315f665fe1ac97ea2ca946e51ced24f7b21fb22e Author: Alexander Leidinger AuthorDate: 2026-04-19 12:46:35 +0000 Commit: Alexander Leidinger CommitDate: 2026-04-19 12:46:35 +0000 Doxygen subsystem config: exclude the content of the .git directory --- tools/kerneldoc/subsys/common-Doxyfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kerneldoc/subsys/common-Doxyfile b/tools/kerneldoc/subsys/common-Doxyfile index 8e194c85e621..2df0506145fe 100644 --- a/tools/kerneldoc/subsys/common-Doxyfile +++ b/tools/kerneldoc/subsys/common-Doxyfile @@ -121,7 +121,7 @@ FILE_PATTERNS = *.c \ RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = */.\#* */.svn/* +EXCLUDE_PATTERNS = */.\#* */.svn/* */.git/* EXCLUDE_SYMBOLS = EXAMPLE_PATH = EXAMPLE_PATTERNS = * From nobody Sun Apr 19 15:08:39 2026 X-Original-To: dev-commits-src-main@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 4fzBpK68YYz675hf for ; Sun, 19 Apr 2026 15:08:41 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fzBpK5H7Xz44SF for ; Sun, 19 Apr 2026 15:08:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776611321; 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=/XUOmN+QyhCvI8zirPLHn7XQM1eFyEMHhuH9qezRkoE=; b=nSZphkqd4qQnmZHf+c4fmGmyZWSmL7k4jOCLy3pZs1AqoRLUQMB73BPROOsBQdY7iVCOAt DU2YzCHqyeHijuH5O5131LDAkWO+AGYnoNjOlVIY+p+EUnixXv5IGq7z9r6EaxADslAjLA eMMsdgKWB7x/S4VKAKtqPjz1utc7HaUciHxr6+FQsRkFzDiv6mGEhCNnvARxRH0HrbQgjb aheqqd8ouQALRP4CX8yeoE94B713JSaPc56jzTRwrfc8YBFWxihvhlT7U79G730Tbm65T7 IXbtz5cKTzaD2kFZ7X+HVIFIMuiUxyfUOetWSSbwrXksqydPEvM30mxZfpLJ5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776611321; a=rsa-sha256; cv=none; b=TdZn1wx6Oye11jvoZfIF+VwCnjTRKFr44BalE2f9kNwaMp/SGAIj9j4Hr1Yal+vv2SxE7X 0IdbzreweCWS02r5MaBpVlh0Wys97neQF2GTPyHOtsfYmpwylKjEbIy0uLJI0ROle0JamJ aikOtpjwJSH35i0IkxFZK3XEk2+iQPTnNQLuPAZCZpoGsX3ZUsFZWYnPVhaLSFzknCZN0I bHWoOTZT2qVxltqyA/dqfhUwBcXjKXXCp/mq+AgWjZf/raSV5ip19FyzcoaOs7mAGG6QJ+ dT7jJnmx731USVl13GQHIvgOQZA6AIlbWmlby+88qpgkHkdzZLeSJ+6jI+nmrQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776611321; 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=/XUOmN+QyhCvI8zirPLHn7XQM1eFyEMHhuH9qezRkoE=; b=pCtlAtS3qfppaMbRX7YJaf6XgmydutaJ+49foruWbKIpIf02P36K+QdPyJkUkQRaMttAby s75447Mi/zI6oJWUX5H7u5lUP92agjfBDjZ4ZqiwVBTvkcxhS440i0hkNQA+jjADJ38wKy nTKndcPulaOojK+Uydj4LVqijegcuyZd2T+IaMQshPtorIZnQY5H17DgmVO0wo5ZdLlyVp TopZ3x1iNHnTDYSpHtTaCP0qdZiCuxqIa/vQ5wAdICIv3YjEVO9ArlEEQ/KqO2p5mQjpRf BCg9g47z/A9PbX25Ik/QCXXTm3dLUZOgcO3l7aHQns3/a+O8fm2zt7TPK26G5g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fzBpK4pKgz1T1 for ; Sun, 19 Apr 2026 15:08:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26472 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 15:08:39 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: ff18554fd6e6 - main - ath-common: update common Atheros/QCA code List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff18554fd6e616f5d965322be477dc406a2906bc Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 15:08:39 +0000 Message-Id: <69e4eff7.26472.12e867d6@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=ff18554fd6e616f5d965322be477dc406a2906bc commit ff18554fd6e616f5d965322be477dc406a2906bc Merge: 315f665fe1ac 18b3ba7a3f35 Author: Bjoern A. Zeeb AuthorDate: 2026-04-19 15:07:36 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-19 15:07:36 +0000 ath-common: update common Atheros/QCA code This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ). Sponsored by: The FreeBSD Foundation MFC after: 3 days sys/contrib/dev/athk/dfs_pattern_detector.c | 4 ++-- sys/contrib/dev/athk/dfs_pri_detector.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) From nobody Sun Apr 19 15:10:43 2026 X-Original-To: dev-commits-src-main@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 4fzBrh2tlJz675ZZ for ; Sun, 19 Apr 2026 15:10:44 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fzBrh1cM8z452Q for ; Sun, 19 Apr 2026 15:10:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776611444; 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=1BR0HGAem4lscDnz9zE8a2XzzZcdS1vEKMX2gcuBdNc=; b=Ed37J55bVIcbChIqKyzdiPpqvk3baCgumb99bccEPS64BLH5gVnBtO1f/SvNoSkEmtuy+0 E2kGh7+7q2h5W2Y5dP9khj08wg2kZOrcJHNCQOLI0B/oXgVf9V6RVzBb/tzwZGYeqxoTqn XzA7MsO+UTaB1OGc0Py/C0NUUcQju7rDttc0hrC1vJjNGEvQuQ1wQwvPLuFLTdmpqL9Mqk mIsZ/Z72p6r/qMdS2pnl91YO8PyEHNkSgZPrESpA4i+yiQH9D/SSiVDz82NsNRwyKd8f8G ObXYt++8Qz0TwQkyFVTQ6tUe4OjAUzDEND+s3vSvwMRsRMEQ4q/y7/d3JKmucg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776611444; a=rsa-sha256; cv=none; b=OBL/pRLCm/+s8+7GpD25w7VNOadTYhB+y3+t+SHknhaQjrdRATgqOHUlcIBQbVkDDLThR5 fMzYXmR/ksDKyB0DYHWYj3ET2tvStaiVpKT4S6XYaE6H6zq4uwQxdc7A1WeMaFnTTARiZ8 CquHbMHDN4iv8PJUbsMvgBPjDMJkjs0i51lW7vFDZ4k03Kd51S2pZn8YAXimUmCwSc7qQa 8ebiSRh8FxYD1mccbaR/1Ztsot54Kl32Yf94PzYEls8rCZ8+SjXcUEmNiloSiP8bUDHFLu 4HTS25vbOdFSJ7TK4FDV49Ndod93aQEioLPxn1mCF2qqA0Iu0ngwbY87LGjE7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776611444; 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=1BR0HGAem4lscDnz9zE8a2XzzZcdS1vEKMX2gcuBdNc=; b=dgkLi6XDs5CbWSbJQhYBtCpeej/rNSGs09VFyK9tFHkl1opkC7y2NRAVpruyx3XKuvH486 I39dUhP3Sx749+OxDUCIZKl7+R1xmFtlIK2bgBYWpLqqYP0pi7Zv/aBye08HLtsvUHiFJR HTEUoXyECTahwNzqB+H8qvq0JafBx8Ja6WStaHzoOifq/nxdw+dMrCYF90Kj3UWfFt/B7t smAw7EXcR/zIHQwJX6c0aU6eggU6Idnb74IvA3gGMUs9eWWyA4DqOxovrXR6+KmZRzn4Xm rNULKZASjdzPx38d4gniIyPK36z2Rr8Z/hBGXvV/JfstZHoySZ/HzqryHHL69Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fzBrh14gBz1Hn for ; Sun, 19 Apr 2026 15:10:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3163e by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 15:10:43 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 02b46313fd14 - main - ath10k: update Atheros/QCA's ath10k driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02b46313fd1461338703a1e02c667b8dbcc36237 Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 15:10:43 +0000 Message-Id: <69e4f073.3163e.30561a28@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=02b46313fd1461338703a1e02c667b8dbcc36237 commit 02b46313fd1461338703a1e02c667b8dbcc36237 Merge: ff18554fd6e6 bbc9d102496a Author: Bjoern A. Zeeb AuthorDate: 2026-04-19 15:09:30 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-19 15:09:30 +0000 ath10k: update Atheros/QCA's ath10k driver This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ). Sponsored by: The FreeBSD Foundation MFC after: 3 days sys/contrib/dev/athk/ath10k/ce.c | 12 +++----- sys/contrib/dev/athk/ath10k/htt_rx.c | 3 +- sys/contrib/dev/athk/ath10k/mac.c | 10 +++---- sys/contrib/dev/athk/ath10k/qmi.c | 10 +++---- sys/contrib/dev/athk/ath10k/sdio.c | 10 +++++-- sys/contrib/dev/athk/ath10k/snoc.c | 53 +++++++++++++++++++++++++++++++++-- sys/contrib/dev/athk/ath10k/snoc.h | 3 ++ sys/contrib/dev/athk/ath10k/txrx.c | 2 +- sys/contrib/dev/athk/ath10k/usb.c | 2 +- sys/contrib/dev/athk/ath10k/wmi-tlv.c | 10 +++---- sys/contrib/dev/athk/ath10k/wmi.c | 32 ++++++++++----------- sys/contrib/dev/athk/ath10k/wow.c | 4 +-- 12 files changed, 100 insertions(+), 51 deletions(-) diff --cc sys/contrib/dev/athk/ath10k/ce.c index d53ecebcf992,000000000000..5535f0348499 mode 100644,000000..100644 --- a/sys/contrib/dev/athk/ath10k/ce.c +++ b/sys/contrib/dev/athk/ath10k/ce.c @@@ -1,1975 -1,0 +1,1971 @@@ +// SPDX-License-Identifier: ISC +/* + * Copyright (c) 2005-2011 Atheros Communications Inc. + * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. + * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#include +#include "hif.h" +#include "ce.h" +#include "debug.h" + +/* + * Support for Copy Engine hardware, which is mainly used for + * communication between Host and Target over a PCIe interconnect. + */ + +/* + * A single CopyEngine (CE) comprises two "rings": + * a source ring + * a destination ring + * + * Each ring consists of a number of descriptors which specify + * an address, length, and meta-data. + * + * Typically, one side of the PCIe/AHB/SNOC interconnect (Host or Target) + * controls one ring and the other side controls the other ring. + * The source side chooses when to initiate a transfer and it + * chooses what to send (buffer address, length). The destination + * side keeps a supply of "anonymous receive buffers" available and + * it handles incoming data as it arrives (when the destination + * receives an interrupt). + * + * The sender may send a simple buffer (address/length) or it may + * send a small list of buffers. When a small list is sent, hardware + * "gathers" these and they end up in a single destination buffer + * with a single interrupt. + * + * There are several "contexts" managed by this layer -- more, it + * may seem -- than should be needed. These are provided mainly for + * maximum flexibility and especially to facilitate a simpler HIF + * implementation. There are per-CopyEngine recv, send, and watermark + * contexts. These are supplied by the caller when a recv, send, + * or watermark handler is established and they are echoed back to + * the caller when the respective callbacks are invoked. There is + * also a per-transfer context supplied by the caller when a buffer + * (or sendlist) is sent and when a buffer is enqueued for recv. + * These per-transfer contexts are echoed back to the caller when + * the buffer is sent/received. + */ + +static inline u32 shadow_sr_wr_ind_addr(struct ath10k *ar, + struct ath10k_ce_pipe *ce_state) +{ + u32 ce_id = ce_state->id; + u32 addr = 0; + + switch (ce_id) { + case 0: + addr = 0x00032000; + break; + case 3: + addr = 0x0003200C; + break; + case 4: + addr = 0x00032010; + break; + case 5: + addr = 0x00032014; + break; + case 7: + addr = 0x0003201C; + break; + default: + ath10k_warn(ar, "invalid CE id: %d", ce_id); + break; + } + return addr; +} + +static inline unsigned int +ath10k_set_ring_byte(unsigned int offset, + const struct ath10k_hw_ce_regs_addr_map *addr_map) +{ + return ((offset << addr_map->lsb) & addr_map->mask); +} + +static inline u32 ath10k_ce_read32(struct ath10k *ar, u32 offset) +{ + struct ath10k_ce *ce = ath10k_ce_priv(ar); + + return ce->bus_ops->read32(ar, offset); +} + +static inline void ath10k_ce_write32(struct ath10k *ar, u32 offset, u32 value) +{ + struct ath10k_ce *ce = ath10k_ce_priv(ar); + + ce->bus_ops->write32(ar, offset, value); +} + +static inline void ath10k_ce_dest_ring_write_index_set(struct ath10k *ar, + u32 ce_ctrl_addr, + unsigned int n) +{ + ath10k_ce_write32(ar, ce_ctrl_addr + + ar->hw_ce_regs->dst_wr_index_addr, n); +} + +static inline u32 ath10k_ce_dest_ring_write_index_get(struct ath10k *ar, + u32 ce_ctrl_addr) +{ + return ath10k_ce_read32(ar, ce_ctrl_addr + + ar->hw_ce_regs->dst_wr_index_addr); +} + +static inline void ath10k_ce_src_ring_write_index_set(struct ath10k *ar, + u32 ce_ctrl_addr, + unsigned int n) +{ + ath10k_ce_write32(ar, ce_ctrl_addr + + ar->hw_ce_regs->sr_wr_index_addr, n); +} + +static inline u32 ath10k_ce_src_ring_write_index_get(struct ath10k *ar, + u32 ce_ctrl_addr) +{ + return ath10k_ce_read32(ar, ce_ctrl_addr + + ar->hw_ce_regs->sr_wr_index_addr); +} + +static inline u32 ath10k_ce_src_ring_read_index_from_ddr(struct ath10k *ar, + u32 ce_id) +{ + struct ath10k_ce *ce = ath10k_ce_priv(ar); + + return ce->vaddr_rri[ce_id] & CE_DDR_RRI_MASK; +} + +static inline u32 ath10k_ce_src_ring_read_index_get(struct ath10k *ar, + u32 ce_ctrl_addr) +{ + struct ath10k_ce *ce = ath10k_ce_priv(ar); + u32 ce_id = COPY_ENGINE_ID(ce_ctrl_addr); + struct ath10k_ce_pipe *ce_state = &ce->ce_states[ce_id]; + u32 index; + + if (ar->hw_params.rri_on_ddr && + (ce_state->attr_flags & CE_ATTR_DIS_INTR)) + index = ath10k_ce_src_ring_read_index_from_ddr(ar, ce_id); + else + index = ath10k_ce_read32(ar, ce_ctrl_addr + + ar->hw_ce_regs->current_srri_addr); + + return index; +} + +static inline void +ath10k_ce_shadow_src_ring_write_index_set(struct ath10k *ar, + struct ath10k_ce_pipe *ce_state, + unsigned int value) +{ + ath10k_ce_write32(ar, shadow_sr_wr_ind_addr(ar, ce_state), value); +} + +static inline void ath10k_ce_src_ring_base_addr_set(struct ath10k *ar, + u32 ce_id, + u64 addr) +{ + struct ath10k_ce *ce = ath10k_ce_priv(ar); + struct ath10k_ce_pipe *ce_state = &ce->ce_states[ce_id]; + u32 ce_ctrl_addr = ath10k_ce_base_address(ar, ce_id); + u32 addr_lo = lower_32_bits(addr); + + ath10k_ce_write32(ar, ce_ctrl_addr + + ar->hw_ce_regs->sr_base_addr_lo, addr_lo); + + if (ce_state->ops->ce_set_src_ring_base_addr_hi) { + ce_state->ops->ce_set_src_ring_base_addr_hi(ar, ce_ctrl_addr, + addr); + } +} + +static void ath10k_ce_set_src_ring_base_addr_hi(struct ath10k *ar, + u32 ce_ctrl_addr, + u64 addr) +{ + u32 addr_hi = upper_32_bits(addr) & CE_DESC_ADDR_HI_MASK; + + ath10k_ce_write32(ar, ce_ctrl_addr + + ar->hw_ce_regs->sr_base_addr_hi, addr_hi); +} + +static inline void ath10k_ce_src_ring_size_set(struct ath10k *ar, + u32 ce_ctrl_addr, + unsigned int n) +{ + ath10k_ce_write32(ar, ce_ctrl_addr + + ar->hw_ce_regs->sr_size_addr, n); +} + +static inline void ath10k_ce_src_ring_dmax_set(struct ath10k *ar, + u32 ce_ctrl_addr, + unsigned int n) +{ + const struct ath10k_hw_ce_ctrl1 *ctrl_regs = ar->hw_ce_regs->ctrl1_regs; + + u32 ctrl1_addr = ath10k_ce_read32(ar, ce_ctrl_addr + + ctrl_regs->addr); + + ath10k_ce_write32(ar, ce_ctrl_addr + ctrl_regs->addr, + (ctrl1_addr & ~(ctrl_regs->dmax->mask)) | + ath10k_set_ring_byte(n, ctrl_regs->dmax)); +} + +static inline void ath10k_ce_src_ring_byte_swap_set(struct ath10k *ar, + u32 ce_ctrl_addr, + unsigned int n) +{ + const struct ath10k_hw_ce_ctrl1 *ctrl_regs = ar->hw_ce_regs->ctrl1_regs; + + u32 ctrl1_addr = ath10k_ce_read32(ar, ce_ctrl_addr + + ctrl_regs->addr); + + ath10k_ce_write32(ar, ce_ctrl_addr + ctrl_regs->addr, + (ctrl1_addr & ~(ctrl_regs->src_ring->mask)) | + ath10k_set_ring_byte(n, ctrl_regs->src_ring)); +} + +static inline void ath10k_ce_dest_ring_byte_swap_set(struct ath10k *ar, + u32 ce_ctrl_addr, + unsigned int n) +{ + const struct ath10k_hw_ce_ctrl1 *ctrl_regs = ar->hw_ce_regs->ctrl1_regs; + + u32 ctrl1_addr = ath10k_ce_read32(ar, ce_ctrl_addr + + ctrl_regs->addr); + + ath10k_ce_write32(ar, ce_ctrl_addr + ctrl_regs->addr, + (ctrl1_addr & ~(ctrl_regs->dst_ring->mask)) | + ath10k_set_ring_byte(n, ctrl_regs->dst_ring)); +} + +static inline + u32 ath10k_ce_dest_ring_read_index_from_ddr(struct ath10k *ar, u32 ce_id) +{ + struct ath10k_ce *ce = ath10k_ce_priv(ar); + + return (ce->vaddr_rri[ce_id] >> CE_DDR_DRRI_SHIFT) & + CE_DDR_RRI_MASK; +} + +static inline u32 ath10k_ce_dest_ring_read_index_get(struct ath10k *ar, + u32 ce_ctrl_addr) +{ + struct ath10k_ce *ce = ath10k_ce_priv(ar); + u32 ce_id = COPY_ENGINE_ID(ce_ctrl_addr); + struct ath10k_ce_pipe *ce_state = &ce->ce_states[ce_id]; + u32 index; + + if (ar->hw_params.rri_on_ddr && + (ce_state->attr_flags & CE_ATTR_DIS_INTR)) + index = ath10k_ce_dest_ring_read_index_from_ddr(ar, ce_id); + else + index = ath10k_ce_read32(ar, ce_ctrl_addr + + ar->hw_ce_regs->current_drri_addr); + + return index; +} + +static inline void ath10k_ce_dest_ring_base_addr_set(struct ath10k *ar, + u32 ce_id, + u64 addr) +{ + struct ath10k_ce *ce = ath10k_ce_priv(ar); + struct ath10k_ce_pipe *ce_state = &ce->ce_states[ce_id]; + u32 ce_ctrl_addr = ath10k_ce_base_address(ar, ce_id); + u32 addr_lo = lower_32_bits(addr); + + ath10k_ce_write32(ar, ce_ctrl_addr + + ar->hw_ce_regs->dr_base_addr_lo, addr_lo); + + if (ce_state->ops->ce_set_dest_ring_base_addr_hi) { + ce_state->ops->ce_set_dest_ring_base_addr_hi(ar, ce_ctrl_addr, + addr); + } +} + +static void ath10k_ce_set_dest_ring_base_addr_hi(struct ath10k *ar, + u32 ce_ctrl_addr, + u64 addr) +{ + u32 addr_hi = upper_32_bits(addr) & CE_DESC_ADDR_HI_MASK; + u32 reg_value; + + reg_value = ath10k_ce_read32(ar, ce_ctrl_addr + + ar->hw_ce_regs->dr_base_addr_hi); + reg_value &= ~CE_DESC_ADDR_HI_MASK; + reg_value |= addr_hi; + ath10k_ce_write32(ar, ce_ctrl_addr + + ar->hw_ce_regs->dr_base_addr_hi, reg_value); +} + +static inline void ath10k_ce_dest_ring_size_set(struct ath10k *ar, + u32 ce_ctrl_addr, + unsigned int n) +{ + ath10k_ce_write32(ar, ce_ctrl_addr + + ar->hw_ce_regs->dr_size_addr, n); +} + +static inline void ath10k_ce_src_ring_highmark_set(struct ath10k *ar, + u32 ce_ctrl_addr, + unsigned int n) +{ + const struct ath10k_hw_ce_dst_src_wm_regs *srcr_wm = ar->hw_ce_regs->wm_srcr; + u32 addr = ath10k_ce_read32(ar, ce_ctrl_addr + srcr_wm->addr); + + ath10k_ce_write32(ar, ce_ctrl_addr + srcr_wm->addr, + (addr & ~(srcr_wm->wm_high->mask)) | + (ath10k_set_ring_byte(n, srcr_wm->wm_high))); +} + +static inline void ath10k_ce_src_ring_lowmark_set(struct ath10k *ar, + u32 ce_ctrl_addr, + unsigned int n) +{ + const struct ath10k_hw_ce_dst_src_wm_regs *srcr_wm = ar->hw_ce_regs->wm_srcr; + u32 addr = ath10k_ce_read32(ar, ce_ctrl_addr + srcr_wm->addr); + + ath10k_ce_write32(ar, ce_ctrl_addr + srcr_wm->addr, + (addr & ~(srcr_wm->wm_low->mask)) | + (ath10k_set_ring_byte(n, srcr_wm->wm_low))); +} + +static inline void ath10k_ce_dest_ring_highmark_set(struct ath10k *ar, + u32 ce_ctrl_addr, + unsigned int n) +{ + const struct ath10k_hw_ce_dst_src_wm_regs *dstr_wm = ar->hw_ce_regs->wm_dstr; + u32 addr = ath10k_ce_read32(ar, ce_ctrl_addr + dstr_wm->addr); + + ath10k_ce_write32(ar, ce_ctrl_addr + dstr_wm->addr, + (addr & ~(dstr_wm->wm_high->mask)) | + (ath10k_set_ring_byte(n, dstr_wm->wm_high))); +} + +static inline void ath10k_ce_dest_ring_lowmark_set(struct ath10k *ar, + u32 ce_ctrl_addr, + unsigned int n) +{ + const struct ath10k_hw_ce_dst_src_wm_regs *dstr_wm = ar->hw_ce_regs->wm_dstr; + u32 addr = ath10k_ce_read32(ar, ce_ctrl_addr + dstr_wm->addr); + + ath10k_ce_write32(ar, ce_ctrl_addr + dstr_wm->addr, + (addr & ~(dstr_wm->wm_low->mask)) | + (ath10k_set_ring_byte(n, dstr_wm->wm_low))); +} + +static inline void ath10k_ce_copy_complete_inter_enable(struct ath10k *ar, + u32 ce_ctrl_addr) +{ + const struct ath10k_hw_ce_host_ie *host_ie = ar->hw_ce_regs->host_ie; + + u32 host_ie_addr = ath10k_ce_read32(ar, ce_ctrl_addr + + ar->hw_ce_regs->host_ie_addr); + + ath10k_ce_write32(ar, ce_ctrl_addr + ar->hw_ce_regs->host_ie_addr, + host_ie_addr | host_ie->copy_complete->mask); +} + +static inline void ath10k_ce_copy_complete_intr_disable(struct ath10k *ar, + u32 ce_ctrl_addr) +{ + const struct ath10k_hw_ce_host_ie *host_ie = ar->hw_ce_regs->host_ie; + + u32 host_ie_addr = ath10k_ce_read32(ar, ce_ctrl_addr + + ar->hw_ce_regs->host_ie_addr); + + ath10k_ce_write32(ar, ce_ctrl_addr + ar->hw_ce_regs->host_ie_addr, + host_ie_addr & ~(host_ie->copy_complete->mask)); +} + +static inline void ath10k_ce_watermark_intr_disable(struct ath10k *ar, + u32 ce_ctrl_addr) +{ + const struct ath10k_hw_ce_host_wm_regs *wm_regs = ar->hw_ce_regs->wm_regs; + + u32 host_ie_addr = ath10k_ce_read32(ar, ce_ctrl_addr + + ar->hw_ce_regs->host_ie_addr); + + ath10k_ce_write32(ar, ce_ctrl_addr + ar->hw_ce_regs->host_ie_addr, + host_ie_addr & ~(wm_regs->wm_mask)); +} + +static inline void ath10k_ce_error_intr_disable(struct ath10k *ar, + u32 ce_ctrl_addr) +{ + const struct ath10k_hw_ce_misc_regs *misc_regs = ar->hw_ce_regs->misc_regs; + + u32 misc_ie_addr = ath10k_ce_read32(ar, + ce_ctrl_addr + ar->hw_ce_regs->misc_ie_addr); + + ath10k_ce_write32(ar, + ce_ctrl_addr + ar->hw_ce_regs->misc_ie_addr, + misc_ie_addr & ~(misc_regs->err_mask)); +} + +static inline void ath10k_ce_engine_int_status_clear(struct ath10k *ar, + u32 ce_ctrl_addr, + unsigned int mask) +{ + const struct ath10k_hw_ce_host_wm_regs *wm_regs = ar->hw_ce_regs->wm_regs; + + ath10k_ce_write32(ar, ce_ctrl_addr + wm_regs->addr, mask); +} + +/* + * Guts of ath10k_ce_send. + * The caller takes responsibility for any needed locking. + */ +static int _ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state, + void *per_transfer_context, + dma_addr_t buffer, + unsigned int nbytes, + unsigned int transfer_id, + unsigned int flags) +{ + struct ath10k *ar = ce_state->ar; + struct ath10k_ce_ring *src_ring = ce_state->src_ring; + struct ce_desc *desc, sdesc; + unsigned int nentries_mask = src_ring->nentries_mask; + unsigned int sw_index = src_ring->sw_index; + unsigned int write_index = src_ring->write_index; + u32 ctrl_addr = ce_state->ctrl_addr; + u32 desc_flags = 0; + int ret = 0; + + if (nbytes > ce_state->src_sz_max) + ath10k_warn(ar, "%s: send more we can (nbytes: %d, max: %d)\n", + __func__, nbytes, ce_state->src_sz_max); + + if (unlikely(CE_RING_DELTA(nentries_mask, + write_index, sw_index - 1) <= 0)) { + ret = -ENOSR; + goto exit; + } + + desc = CE_SRC_RING_TO_DESC(src_ring->base_addr_owner_space, + write_index); + + desc_flags |= SM(transfer_id, CE_DESC_FLAGS_META_DATA); + + if (flags & CE_SEND_FLAG_GATHER) + desc_flags |= CE_DESC_FLAGS_GATHER; + if (flags & CE_SEND_FLAG_BYTE_SWAP) + desc_flags |= CE_DESC_FLAGS_BYTE_SWAP; + + sdesc.addr = __cpu_to_le32(buffer); + sdesc.nbytes = __cpu_to_le16(nbytes); + sdesc.flags = __cpu_to_le16(desc_flags); + + *desc = sdesc; + + src_ring->per_transfer_context[write_index] = per_transfer_context; + + /* Update Source Ring Write Index */ + write_index = CE_RING_IDX_INCR(nentries_mask, write_index); + + /* WORKAROUND */ + if (!(flags & CE_SEND_FLAG_GATHER)) + ath10k_ce_src_ring_write_index_set(ar, ctrl_addr, write_index); + + src_ring->write_index = write_index; +exit: + return ret; +} + +static int _ath10k_ce_send_nolock_64(struct ath10k_ce_pipe *ce_state, + void *per_transfer_context, + dma_addr_t buffer, + unsigned int nbytes, + unsigned int transfer_id, + unsigned int flags) +{ + struct ath10k *ar = ce_state->ar; + struct ath10k_ce_ring *src_ring = ce_state->src_ring; + struct ce_desc_64 *desc, sdesc; + unsigned int nentries_mask = src_ring->nentries_mask; + unsigned int sw_index; + unsigned int write_index = src_ring->write_index; + u32 ctrl_addr = ce_state->ctrl_addr; + __le32 *addr; + u32 desc_flags = 0; + int ret = 0; + + if (test_bit(ATH10K_FLAG_CRASH_FLUSH, &ar->dev_flags)) + return -ESHUTDOWN; + + if (nbytes > ce_state->src_sz_max) + ath10k_warn(ar, "%s: send more we can (nbytes: %d, max: %d)\n", + __func__, nbytes, ce_state->src_sz_max); + + if (ar->hw_params.rri_on_ddr) + sw_index = ath10k_ce_src_ring_read_index_from_ddr(ar, ce_state->id); + else + sw_index = src_ring->sw_index; + + if (unlikely(CE_RING_DELTA(nentries_mask, + write_index, sw_index - 1) <= 0)) { + ret = -ENOSR; + goto exit; + } + + desc = CE_SRC_RING_TO_DESC_64(src_ring->base_addr_owner_space, + write_index); + + desc_flags |= SM(transfer_id, CE_DESC_FLAGS_META_DATA); + + if (flags & CE_SEND_FLAG_GATHER) + desc_flags |= CE_DESC_FLAGS_GATHER; + + if (flags & CE_SEND_FLAG_BYTE_SWAP) + desc_flags |= CE_DESC_FLAGS_BYTE_SWAP; + + addr = (__le32 *)&sdesc.addr; + + flags |= upper_32_bits(buffer) & CE_DESC_ADDR_HI_MASK; + addr[0] = __cpu_to_le32(buffer); + addr[1] = __cpu_to_le32(flags); + if (flags & CE_SEND_FLAG_GATHER) + addr[1] |= __cpu_to_le32(CE_WCN3990_DESC_FLAGS_GATHER); + else + addr[1] &= ~(__cpu_to_le32(CE_WCN3990_DESC_FLAGS_GATHER)); + + sdesc.nbytes = __cpu_to_le16(nbytes); + sdesc.flags = __cpu_to_le16(desc_flags); + + *desc = sdesc; + + src_ring->per_transfer_context[write_index] = per_transfer_context; + + /* Update Source Ring Write Index */ + write_index = CE_RING_IDX_INCR(nentries_mask, write_index); + + if (!(flags & CE_SEND_FLAG_GATHER)) { + if (ar->hw_params.shadow_reg_support) + ath10k_ce_shadow_src_ring_write_index_set(ar, ce_state, + write_index); + else + ath10k_ce_src_ring_write_index_set(ar, ctrl_addr, + write_index); + } + + src_ring->write_index = write_index; +exit: + return ret; +} + +int ath10k_ce_send_nolock(struct ath10k_ce_pipe *ce_state, + void *per_transfer_context, + dma_addr_t buffer, + unsigned int nbytes, + unsigned int transfer_id, + unsigned int flags) +{ + return ce_state->ops->ce_send_nolock(ce_state, per_transfer_context, + buffer, nbytes, transfer_id, flags); +} +EXPORT_SYMBOL(ath10k_ce_send_nolock); + +void __ath10k_ce_send_revert(struct ath10k_ce_pipe *pipe) +{ + struct ath10k *ar = pipe->ar; + struct ath10k_ce *ce = ath10k_ce_priv(ar); + struct ath10k_ce_ring *src_ring = pipe->src_ring; + u32 ctrl_addr = pipe->ctrl_addr; + + lockdep_assert_held(&ce->ce_lock); + + /* + * This function must be called only if there is an incomplete + * scatter-gather transfer (before index register is updated) + * that needs to be cleaned up. + */ + if (WARN_ON_ONCE(src_ring->write_index == src_ring->sw_index)) + return; + + if (WARN_ON_ONCE(src_ring->write_index == + ath10k_ce_src_ring_write_index_get(ar, ctrl_addr))) + return; + + src_ring->write_index--; + src_ring->write_index &= src_ring->nentries_mask; + + src_ring->per_transfer_context[src_ring->write_index] = NULL; +} +EXPORT_SYMBOL(__ath10k_ce_send_revert); + +int ath10k_ce_send(struct ath10k_ce_pipe *ce_state, + void *per_transfer_context, + dma_addr_t buffer, + unsigned int nbytes, + unsigned int transfer_id, + unsigned int flags) +{ + struct ath10k *ar = ce_state->ar; + struct ath10k_ce *ce = ath10k_ce_priv(ar); + int ret; + + spin_lock_bh(&ce->ce_lock); + ret = ath10k_ce_send_nolock(ce_state, per_transfer_context, + buffer, nbytes, transfer_id, flags); + spin_unlock_bh(&ce->ce_lock); + + return ret; +} +EXPORT_SYMBOL(ath10k_ce_send); + +int ath10k_ce_num_free_src_entries(struct ath10k_ce_pipe *pipe) +{ + struct ath10k *ar = pipe->ar; + struct ath10k_ce *ce = ath10k_ce_priv(ar); + int delta; + + spin_lock_bh(&ce->ce_lock); + delta = CE_RING_DELTA(pipe->src_ring->nentries_mask, + pipe->src_ring->write_index, + pipe->src_ring->sw_index - 1); + spin_unlock_bh(&ce->ce_lock); + + return delta; +} +EXPORT_SYMBOL(ath10k_ce_num_free_src_entries); + +int __ath10k_ce_rx_num_free_bufs(struct ath10k_ce_pipe *pipe) +{ + struct ath10k *ar = pipe->ar; + struct ath10k_ce *ce = ath10k_ce_priv(ar); + struct ath10k_ce_ring *dest_ring = pipe->dest_ring; + unsigned int nentries_mask = dest_ring->nentries_mask; + unsigned int write_index = dest_ring->write_index; + unsigned int sw_index = dest_ring->sw_index; + + lockdep_assert_held(&ce->ce_lock); + + return CE_RING_DELTA(nentries_mask, write_index, sw_index - 1); +} +EXPORT_SYMBOL(__ath10k_ce_rx_num_free_bufs); + +static int __ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, + dma_addr_t paddr) +{ + struct ath10k *ar = pipe->ar; + struct ath10k_ce *ce = ath10k_ce_priv(ar); + struct ath10k_ce_ring *dest_ring = pipe->dest_ring; + unsigned int nentries_mask = dest_ring->nentries_mask; + unsigned int write_index = dest_ring->write_index; + unsigned int sw_index = dest_ring->sw_index; + struct ce_desc *base = dest_ring->base_addr_owner_space; + struct ce_desc *desc = CE_DEST_RING_TO_DESC(base, write_index); + u32 ctrl_addr = pipe->ctrl_addr; + + lockdep_assert_held(&ce->ce_lock); + + if ((pipe->id != 5) && + CE_RING_DELTA(nentries_mask, write_index, sw_index - 1) == 0) + return -ENOSPC; + + desc->addr = __cpu_to_le32(paddr); + desc->nbytes = 0; + + dest_ring->per_transfer_context[write_index] = ctx; + write_index = CE_RING_IDX_INCR(nentries_mask, write_index); + ath10k_ce_dest_ring_write_index_set(ar, ctrl_addr, write_index); + dest_ring->write_index = write_index; + + return 0; +} + +static int __ath10k_ce_rx_post_buf_64(struct ath10k_ce_pipe *pipe, + void *ctx, + dma_addr_t paddr) +{ + struct ath10k *ar = pipe->ar; + struct ath10k_ce *ce = ath10k_ce_priv(ar); + struct ath10k_ce_ring *dest_ring = pipe->dest_ring; + unsigned int nentries_mask = dest_ring->nentries_mask; + unsigned int write_index = dest_ring->write_index; + unsigned int sw_index = dest_ring->sw_index; + struct ce_desc_64 *base = dest_ring->base_addr_owner_space; + struct ce_desc_64 *desc = + CE_DEST_RING_TO_DESC_64(base, write_index); + u32 ctrl_addr = pipe->ctrl_addr; + + lockdep_assert_held(&ce->ce_lock); + + if (CE_RING_DELTA(nentries_mask, write_index, sw_index - 1) == 0) + return -ENOSPC; + + desc->addr = __cpu_to_le64(paddr); + desc->addr &= __cpu_to_le64(CE_DESC_ADDR_MASK); + + desc->nbytes = 0; + + dest_ring->per_transfer_context[write_index] = ctx; + write_index = CE_RING_IDX_INCR(nentries_mask, write_index); + ath10k_ce_dest_ring_write_index_set(ar, ctrl_addr, write_index); + dest_ring->write_index = write_index; + + return 0; +} + +void ath10k_ce_rx_update_write_idx(struct ath10k_ce_pipe *pipe, u32 nentries) +{ + struct ath10k *ar = pipe->ar; + struct ath10k_ce_ring *dest_ring = pipe->dest_ring; + unsigned int nentries_mask = dest_ring->nentries_mask; + unsigned int write_index = dest_ring->write_index; + u32 ctrl_addr = pipe->ctrl_addr; + u32 cur_write_idx = ath10k_ce_dest_ring_write_index_get(ar, ctrl_addr); + + /* Prevent CE ring stuck issue that will occur when ring is full. + * Make sure that write index is 1 less than read index. + */ + if (((cur_write_idx + nentries) & nentries_mask) == dest_ring->sw_index) + nentries -= 1; + + write_index = CE_RING_IDX_ADD(nentries_mask, write_index, nentries); + ath10k_ce_dest_ring_write_index_set(ar, ctrl_addr, write_index); + dest_ring->write_index = write_index; +} +EXPORT_SYMBOL(ath10k_ce_rx_update_write_idx); + +int ath10k_ce_rx_post_buf(struct ath10k_ce_pipe *pipe, void *ctx, + dma_addr_t paddr) +{ + struct ath10k *ar = pipe->ar; + struct ath10k_ce *ce = ath10k_ce_priv(ar); + int ret; + + spin_lock_bh(&ce->ce_lock); + ret = pipe->ops->ce_rx_post_buf(pipe, ctx, paddr); + spin_unlock_bh(&ce->ce_lock); + + return ret; +} +EXPORT_SYMBOL(ath10k_ce_rx_post_buf); + +/* + * Guts of ath10k_ce_completed_recv_next. + * The caller takes responsibility for any necessary locking. + */ +static int + _ath10k_ce_completed_recv_next_nolock(struct ath10k_ce_pipe *ce_state, + void **per_transfer_contextp, + unsigned int *nbytesp) +{ + struct ath10k_ce_ring *dest_ring = ce_state->dest_ring; + unsigned int nentries_mask = dest_ring->nentries_mask; + unsigned int sw_index = dest_ring->sw_index; + + struct ce_desc *base = dest_ring->base_addr_owner_space; + struct ce_desc *desc = CE_DEST_RING_TO_DESC(base, sw_index); + struct ce_desc sdesc; + u16 nbytes; + + /* Copy in one go for performance reasons */ + sdesc = *desc; + + nbytes = __le16_to_cpu(sdesc.nbytes); + if (nbytes == 0) { + /* + * This closes a relatively unusual race where the Host + * sees the updated DRRI before the update to the + * corresponding descriptor has completed. We treat this + * as a descriptor that is not yet done. + */ + return -EIO; + } + + desc->nbytes = 0; + + /* Return data from completed destination descriptor */ + *nbytesp = nbytes; + + if (per_transfer_contextp) + *per_transfer_contextp = + dest_ring->per_transfer_context[sw_index]; + + /* Copy engine 5 (HTT Rx) will reuse the same transfer context. + * So update transfer context all CEs except CE5. + */ + if (ce_state->id != 5) + dest_ring->per_transfer_context[sw_index] = NULL; + + /* Update sw_index */ + sw_index = CE_RING_IDX_INCR(nentries_mask, sw_index); + dest_ring->sw_index = sw_index; + + return 0; +} + +static int +_ath10k_ce_completed_recv_next_nolock_64(struct ath10k_ce_pipe *ce_state, + void **per_transfer_contextp, + unsigned int *nbytesp) +{ + struct ath10k_ce_ring *dest_ring = ce_state->dest_ring; + unsigned int nentries_mask = dest_ring->nentries_mask; + unsigned int sw_index = dest_ring->sw_index; + struct ce_desc_64 *base = dest_ring->base_addr_owner_space; + struct ce_desc_64 *desc = + CE_DEST_RING_TO_DESC_64(base, sw_index); + struct ce_desc_64 sdesc; + u16 nbytes; + + /* Copy in one go for performance reasons */ + sdesc = *desc; + + nbytes = __le16_to_cpu(sdesc.nbytes); + if (nbytes == 0) { + /* This closes a relatively unusual race where the Host + * sees the updated DRRI before the update to the + * corresponding descriptor has completed. We treat this + * as a descriptor that is not yet done. + */ + return -EIO; + } + + desc->nbytes = 0; + + /* Return data from completed destination descriptor */ + *nbytesp = nbytes; + + if (per_transfer_contextp) + *per_transfer_contextp = + dest_ring->per_transfer_context[sw_index]; + + /* Copy engine 5 (HTT Rx) will reuse the same transfer context. + * So update transfer context all CEs except CE5. + */ + if (ce_state->id != 5) + dest_ring->per_transfer_context[sw_index] = NULL; + + /* Update sw_index */ + sw_index = CE_RING_IDX_INCR(nentries_mask, sw_index); + dest_ring->sw_index = sw_index; + + return 0; +} + +int ath10k_ce_completed_recv_next_nolock(struct ath10k_ce_pipe *ce_state, + void **per_transfer_ctx, + unsigned int *nbytesp) +{ + return ce_state->ops->ce_completed_recv_next_nolock(ce_state, + per_transfer_ctx, + nbytesp); +} +EXPORT_SYMBOL(ath10k_ce_completed_recv_next_nolock); + +int ath10k_ce_completed_recv_next(struct ath10k_ce_pipe *ce_state, + void **per_transfer_contextp, + unsigned int *nbytesp) +{ + struct ath10k *ar = ce_state->ar; + struct ath10k_ce *ce = ath10k_ce_priv(ar); + int ret; + + spin_lock_bh(&ce->ce_lock); + ret = ce_state->ops->ce_completed_recv_next_nolock(ce_state, + per_transfer_contextp, + nbytesp); + + spin_unlock_bh(&ce->ce_lock); + + return ret; +} +EXPORT_SYMBOL(ath10k_ce_completed_recv_next); + +static int _ath10k_ce_revoke_recv_next(struct ath10k_ce_pipe *ce_state, + void **per_transfer_contextp, + dma_addr_t *bufferp) +{ + struct ath10k_ce_ring *dest_ring; + unsigned int nentries_mask; + unsigned int sw_index; + unsigned int write_index; + int ret; + struct ath10k *ar; + struct ath10k_ce *ce; + + dest_ring = ce_state->dest_ring; + + if (!dest_ring) + return -EIO; + + ar = ce_state->ar; + ce = ath10k_ce_priv(ar); + + spin_lock_bh(&ce->ce_lock); + + nentries_mask = dest_ring->nentries_mask; + sw_index = dest_ring->sw_index; + write_index = dest_ring->write_index; + if (write_index != sw_index) { + struct ce_desc *base = dest_ring->base_addr_owner_space; + struct ce_desc *desc = CE_DEST_RING_TO_DESC(base, sw_index); + + /* Return data from completed destination descriptor */ + *bufferp = __le32_to_cpu(desc->addr); + + if (per_transfer_contextp) + *per_transfer_contextp = + dest_ring->per_transfer_context[sw_index]; + + /* sanity */ + dest_ring->per_transfer_context[sw_index] = NULL; + desc->nbytes = 0; + + /* Update sw_index */ + sw_index = CE_RING_IDX_INCR(nentries_mask, sw_index); + dest_ring->sw_index = sw_index; + ret = 0; + } else { + ret = -EIO; + } + + spin_unlock_bh(&ce->ce_lock); + + return ret; +} + +static int _ath10k_ce_revoke_recv_next_64(struct ath10k_ce_pipe *ce_state, + void **per_transfer_contextp, + dma_addr_t *bufferp) +{ + struct ath10k_ce_ring *dest_ring; + unsigned int nentries_mask; + unsigned int sw_index; + unsigned int write_index; + int ret; + struct ath10k *ar; + struct ath10k_ce *ce; *** 22407 LINES SKIPPED *** From nobody Sun Apr 19 15:13:04 2026 X-Original-To: dev-commits-src-main@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 4fzBvN64Slz675pS for ; Sun, 19 Apr 2026 15:13:04 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fzBvN4vm1z45wr for ; Sun, 19 Apr 2026 15:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776611584; 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=ZPDdKRT9NTB46WqIFRd6737sq4Esfz/FNMw+Fi/sx84=; b=dJulvtqtJZwH3lYjzM1Wgoo0KEfePX4YdkB+XjYZdUdywPTzzgBt1Ewf6TNKKKwb24cijl usXTuFUpWhAxmPI2etXAsUMIWJfFx8wjEIHbleGQ0qpFaw/kQTpcYeB+VgjF0wWDo1QG4u PvkBanR5AYZSQqCw0Fonz6xck7hzuwRJhBTJMoZyJvY7lMfE0tvUjd5IYQYUPnhn7kWnKI cthkpPc8QZzTSehI5zEqovjiR/mrv8a+U3a3bD+rqj/YWX1ciGdAk8RXWi4ypz7B5HRTK0 8aeaeFn5xX/JQiMkJkDr61dyZMn0qPn1nIhkKtlSYWIZ60PPR+e5hh8vu2xf4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776611584; a=rsa-sha256; cv=none; b=K6XaBL0mWfO9iNBdJORwr3NUp1SbR69sCe0FLkAhGE9Q38JWD2iR1oWDj27jpSbg9l8jnA oNZtML8p5jWmcvYqiCmhXWMOqtPTKCg4vTqqJkSqenUtwptVU6yr4k5yA2zsTi+XSdK85D JyFvCuWvy2PoRLT69tEy4rPABhhRZPstWtRuY0EOVHkYWB+MOOjgwuhj6+/+4Iug8+cTpX BrUFHj5HzSU788Vgnh2aJ4Mx22iFdFH7dI7igWMK+OhtUrLlWu7QJLAwd2kNi4qTuzZPZC EGFEhj6LcAp4DTUmo0wx3mq7p3Qp/+EsyK9xb3P9izknoz2QIlcDGG9/1cfVZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776611584; 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=ZPDdKRT9NTB46WqIFRd6737sq4Esfz/FNMw+Fi/sx84=; b=r6bkzUIvkzNtXuri+ih7/Sn2DUENLf+TApnjixX4Up96qrlX+tUKcAlXm1rIoiheIRJP4o aS60LomMJ8SozkDdX2+uO6dOzlzcHvSwyxDvCYEECvUiu9PDKwcOahRGU37nbYCv3ojipb ZUhV1jIQMJltBcv9VwMqOT9/6khE4BzPzCRun9rqbVNUnlL+XhMNYblH703iSe175tVVfx uE95cieWeWwmceKuAfAbZKEOUd7766XWuQ2FUTuwW5c+dD6TQMxR4pBj75tmaJBueiOVCG +z743UlxuObEOnVapF7I620Svs86a26HVgCMetCkhiqJtEtsFWHjkTwohn448g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fzBvN4M7Xz1tt for ; Sun, 19 Apr 2026 15:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 31c13 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 15:13:04 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 4546eb0c27f2 - main - athk_common / ath10k: update module Makefiles for v7.0 driver version List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4546eb0c27f22236be8179616e1f0a3e88ddfbbe Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 15:13:04 +0000 Message-Id: <69e4f100.31c13.794cb2a0@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4546eb0c27f22236be8179616e1f0a3e88ddfbbe commit 4546eb0c27f22236be8179616e1f0a3e88ddfbbe Author: Bjoern A. Zeeb AuthorDate: 2026-04-19 15:12:15 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-19 15:12:15 +0000 athk_common / ath10k: update module Makefiles for v7.0 driver version Update LINUXKPI_VERSION to reflect that the driver is based on Linux v7.0. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/modules/ath10k/Makefile | 2 +- sys/modules/athk_common/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/modules/ath10k/Makefile b/sys/modules/ath10k/Makefile index 2ffa8532ff47..b28df768c3d5 100644 --- a/sys/modules/ath10k/Makefile +++ b/sys/modules/ath10k/Makefile @@ -65,6 +65,6 @@ CFLAGS+= ${LINUXKPI_INCLUDES} #CFLAGS+= -DCONFIG_THERMAL CFLAGS+= -DKBUILD_MODNAME='"ath10k"' -CFLAGS+= -DLINUXKPI_VERSION=61900 +CFLAGS+= -DLINUXKPI_VERSION=70000 .include diff --git a/sys/modules/athk_common/Makefile b/sys/modules/athk_common/Makefile index d058d19cbe80..579ae7474891 100644 --- a/sys/modules/athk_common/Makefile +++ b/sys/modules/athk_common/Makefile @@ -31,6 +31,6 @@ CFLAGS+= ${LINUXKPI_INCLUDES} #CFLAGS+= -ferror-limit=0 CFLAGS+= -DKBUILD_MODNAME='"athk_common"' -CFLAGS+= -DLINUXKPI_VERSION=61900 +CFLAGS+= -DLINUXKPI_VERSION=70000 .include From nobody Sun Apr 19 15:18:17 2026 X-Original-To: dev-commits-src-main@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 4fzC1Q4Vhgz6769k for ; Sun, 19 Apr 2026 15:18:18 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fzC1Q0Kkzz46Lc for ; Sun, 19 Apr 2026 15:18:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776611898; 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=w7jcqrcvh5oXy9vzQdQRfnaOI6wbIXxFyZ8LouCwDCI=; b=EPKk4TRgYEkKpWtK/XRcJPxsrvdmBMMQkyK/QWqPiGjBEefHaQtWewihQFmTiQvEkcQN4b mfBJ/FJLDx9MxxR1qEpU8KFCVl/iz9BGv6v8q5suk6WBMAfUwieW32Bp0gmQ3K58iGggSq O5vgctBMy3nktZjV917jqvo0NjA690f7UGzaytsug9CQjebYxCrty74ztrqO4aLTnP3E7Z ay79z5uCH6MTNPkVIiN2uG1eA5Fuj77F+7M6wWHb2/p6vaEUHbulayQhXK6vH1TDX1oLWE T0Urq5/+tfaoetFAnIQEHsw64O01fDTfPaZy/Gu0s5/+YEK4opLeRD62/iIP9g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776611898; a=rsa-sha256; cv=none; b=ggbmKT5pE77AYSLaFQV+PGFcc89ZXrh3doEwQm2FB5VjuOdUcF8Qd9dEDMoazCEUEUheWB gv+JaZkuhvksaw/qoup/b7tsFovx3St5BQOFClxNJlwlV/05rY/fTpoDqiKjXcUO60Clva r7A3ZG2feQT53JkBUZHsWt2eimZU3bDhxjQx1ELzxMZ/EtgqW252Nd/kGwZyG2OIlhvhJE IoBvsaTezx+84rSCqjjFX+6lOM4gnRVDwWuPppVyMhKRr0aGTWA5sn3NnLqWtWEBITJU4+ tdjsrnM2zSskpnRnkW+r6g7TcVXx1MjXYbNSc9LkQDoly7KzATziDcqQTMvmnA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776611898; 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=w7jcqrcvh5oXy9vzQdQRfnaOI6wbIXxFyZ8LouCwDCI=; b=Jxb4HIvzckcDGb7bRQ5i2WyoJ3LX25TOwGDHXVe6/B+Zgffwop+ochz1IedWEOazev+/75 Wh1PLxsYO6mx/y8ZyN5Vaoi+i1ZQuTthURnwAGwrdZMkGOw4Za+pq0UITCIOkEJlYd1rrd bf5umMG1mUMS9GzzDe8IFy8UFZfmW132UIuOX1H5xCqrt7dyig6TMQ4ZECNW7RE4soaj1w c/SB9NfwkxS5GwBdL2bzKP1qAtSUYVkrtFxCuAGweQs/NGUVQuiBDxlC220yxUSgBiW3zO bSYIOs/DM92RBIhDi3psuT/hYi/keqRT9jGkZr8BmAojpLOHL5B8ioPK7Zl9dA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fzC1P6JM9z1Wy for ; Sun, 19 Apr 2026 15:18:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3149c by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 15:18:17 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 117d9331fede - main - brcm80211: update Broadcom wireless brcmsmac and brcmfmac drivers List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 117d9331fedeb5c5657a796423c4f7b311f40770 Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 15:18:17 +0000 Message-Id: <69e4f239.3149c.575a5c1d@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=117d9331fedeb5c5657a796423c4f7b311f40770 commit 117d9331fedeb5c5657a796423c4f7b311f40770 Merge: 4546eb0c27f2 bc66030cad2b Author: Bjoern A. Zeeb AuthorDate: 2026-04-19 15:16:04 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-19 15:16:04 +0000 brcm80211: update Broadcom wireless brcmsmac and brcmfmac drivers This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ). Sponsored by: The FreeBSD Foundation MFC after: 3 days .../dev/broadcom/brcm80211/brcmfmac/bca/core.c | 3 +-- sys/contrib/dev/broadcom/brcm80211/brcmfmac/bcdc.c | 2 +- .../dev/broadcom/brcm80211/brcmfmac/bcmsdh.c | 13 +++++----- .../dev/broadcom/brcm80211/brcmfmac/btcoex.c | 2 +- .../dev/broadcom/brcm80211/brcmfmac/cfg80211.c | 27 ++++++++++---------- .../dev/broadcom/brcm80211/brcmfmac/cfg80211.h | 8 ++++-- sys/contrib/dev/broadcom/brcm80211/brcmfmac/chip.c | 4 +-- .../dev/broadcom/brcm80211/brcmfmac/common.c | 5 ++-- sys/contrib/dev/broadcom/brcm80211/brcmfmac/core.c | 6 ++--- .../dev/broadcom/brcm80211/brcmfmac/cyw/core.c | 3 +-- .../dev/broadcom/brcm80211/brcmfmac/firmware.c | 4 +-- .../dev/broadcom/brcm80211/brcmfmac/flowring.c | 9 +++---- sys/contrib/dev/broadcom/brcm80211/brcmfmac/fweh.c | 7 +++++- .../dev/broadcom/brcm80211/brcmfmac/fwsignal.c | 5 ++-- .../dev/broadcom/brcm80211/brcmfmac/msgbuf.c | 12 ++++----- sys/contrib/dev/broadcom/brcm80211/brcmfmac/pcie.c | 15 ++++++----- sys/contrib/dev/broadcom/brcm80211/brcmfmac/pno.c | 4 +-- .../dev/broadcom/brcm80211/brcmfmac/proto.c | 2 +- sys/contrib/dev/broadcom/brcm80211/brcmfmac/sdio.c | 9 ++++--- sys/contrib/dev/broadcom/brcm80211/brcmfmac/sdio.h | 2 +- sys/contrib/dev/broadcom/brcm80211/brcmfmac/usb.c | 6 ++--- .../dev/broadcom/brcm80211/brcmfmac/wcc/core.c | 3 +-- .../dev/broadcom/brcm80211/brcmsmac/aiutils.c | 2 +- .../dev/broadcom/brcm80211/brcmsmac/ampdu.c | 2 +- .../dev/broadcom/brcm80211/brcmsmac/antsel.c | 2 +- .../dev/broadcom/brcm80211/brcmsmac/channel.c | 2 +- sys/contrib/dev/broadcom/brcm80211/brcmsmac/dma.c | 4 +-- .../dev/broadcom/brcm80211/brcmsmac/mac80211_if.c | 2 +- sys/contrib/dev/broadcom/brcm80211/brcmsmac/main.c | 29 +++++++++++----------- .../dev/broadcom/brcm80211/brcmsmac/phy/phy_cmn.c | 4 +-- .../dev/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c | 15 ++++------- .../dev/broadcom/brcm80211/brcmsmac/phy/phy_n.c | 3 +-- .../dev/broadcom/brcm80211/brcmsmac/phy_shim.c | 2 +- 33 files changed, 106 insertions(+), 112 deletions(-) diff --cc sys/contrib/dev/broadcom/brcm80211/brcmfmac/common.c index 17e408b7fa23,000000000000..ef16fa2747b9 mode 100644,000000..100644 --- a/sys/contrib/dev/broadcom/brcm80211/brcmfmac/common.c +++ b/sys/contrib/dev/broadcom/brcm80211/brcmfmac/common.c @@@ -1,672 -1,0 +1,671 @@@ +// SPDX-License-Identifier: ISC +/* + * Copyright (c) 2010 Broadcom Corporation + */ + +#if defined(__FreeBSD__) +#define LINUXKPI_PARAM_PREFIX brcmfmac_ +#endif + +#include +#include +#include +#include +#include +#include +#include +#include "core.h" +#include "bus.h" +#include "debug.h" +#include "fwil.h" +#include "fwil_types.h" +#include "tracepoint.h" +#include "common.h" +#include "of.h" +#include "firmware.h" +#include "chip.h" + +MODULE_AUTHOR("Broadcom Corporation"); +MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver."); +MODULE_LICENSE("Dual BSD/GPL"); +#if defined(__FreeBSD__) +MODULE_DEPEND(brcmfmac, brcmutil, 1, 1, 1); +MODULE_DEPEND(brcmfmac, linuxkpi, 1, 1, 1); +MODULE_DEPEND(brcmfmac, linuxkpi_wlan, 1, 1, 1); +MODULE_DEPEND(brcmfmac, lindebugfs, 1, 1, 1); /* XXX-BZ someone should fix this */ +#endif + +#define BRCMF_DEFAULT_SCAN_CHANNEL_TIME 40 +#define BRCMF_DEFAULT_SCAN_UNASSOC_TIME 40 + +/* default boost value for RSSI_DELTA in preferred join selection */ +#define BRCMF_JOIN_PREF_RSSI_BOOST 8 + +#define BRCMF_DEFAULT_TXGLOM_SIZE 32 /* max tx frames in glom chain */ + +static int brcmf_sdiod_txglomsz = BRCMF_DEFAULT_TXGLOM_SIZE; +module_param_named(txglomsz, brcmf_sdiod_txglomsz, int, 0); +MODULE_PARM_DESC(txglomsz, "Maximum tx packet chain size [SDIO]"); + +/* Debug level configuration. See debug.h for bits, sysfs modifiable */ +int brcmf_msg_level; +module_param_named(debug, brcmf_msg_level, int, 0600); +MODULE_PARM_DESC(debug, "Level of debug output"); + +static int brcmf_p2p_enable; +module_param_named(p2pon, brcmf_p2p_enable, int, 0); +MODULE_PARM_DESC(p2pon, "Enable legacy p2p management functionality"); + +static int brcmf_feature_disable; +module_param_named(feature_disable, brcmf_feature_disable, int, 0); +MODULE_PARM_DESC(feature_disable, "Disable features"); + +static char brcmf_firmware_path[BRCMF_FW_ALTPATH_LEN]; +module_param_string(alternative_fw_path, brcmf_firmware_path, + BRCMF_FW_ALTPATH_LEN, 0400); +MODULE_PARM_DESC(alternative_fw_path, "Alternative firmware path"); + +static int brcmf_fcmode; +module_param_named(fcmode, brcmf_fcmode, int, 0); +MODULE_PARM_DESC(fcmode, "Mode of firmware signalled flow control"); + +static int brcmf_roamoff; +module_param_named(roamoff, brcmf_roamoff, int, 0400); +MODULE_PARM_DESC(roamoff, "Do not use internal roaming engine"); + +static int brcmf_iapp_enable; +module_param_named(iapp, brcmf_iapp_enable, int, 0); +MODULE_PARM_DESC(iapp, "Enable partial support for the obsoleted Inter-Access Point Protocol"); + +#ifdef DEBUG +/* always succeed brcmf_bus_started() */ +static int brcmf_ignore_probe_fail; +module_param_named(ignore_probe_fail, brcmf_ignore_probe_fail, int, 0); +MODULE_PARM_DESC(ignore_probe_fail, "always succeed probe for debugging"); +#endif + +static struct brcmfmac_platform_data *brcmfmac_pdata; +struct brcmf_mp_global_t brcmf_mp_global; + +void brcmf_c_set_joinpref_default(struct brcmf_if *ifp) +{ + struct brcmf_pub *drvr = ifp->drvr; + struct brcmf_join_pref_params join_pref_params[2]; + int err; + + /* Setup join_pref to select target by RSSI (boost on 5GHz) */ + join_pref_params[0].type = BRCMF_JOIN_PREF_RSSI_DELTA; + join_pref_params[0].len = 2; + join_pref_params[0].rssi_gain = BRCMF_JOIN_PREF_RSSI_BOOST; + join_pref_params[0].band = WLC_BAND_5G; + + join_pref_params[1].type = BRCMF_JOIN_PREF_RSSI; + join_pref_params[1].len = 2; + join_pref_params[1].rssi_gain = 0; + join_pref_params[1].band = 0; + err = brcmf_fil_iovar_data_set(ifp, "join_pref", join_pref_params, + sizeof(join_pref_params)); + if (err) + bphy_err(drvr, "Set join_pref error (%d)\n", err); +} + +static int brcmf_c_download(struct brcmf_if *ifp, u16 flag, + struct brcmf_dload_data_le *dload_buf, + u32 len, const char *var) +{ + s32 err; + + flag |= (DLOAD_HANDLER_VER << DLOAD_FLAG_VER_SHIFT); + dload_buf->flag = cpu_to_le16(flag); + dload_buf->dload_type = cpu_to_le16(DL_TYPE_CLM); + dload_buf->len = cpu_to_le32(len); + dload_buf->crc = cpu_to_le32(0); + + err = brcmf_fil_iovar_data_set(ifp, var, dload_buf, + struct_size(dload_buf, data, len)); + + return err; +} + +static int brcmf_c_download_blob(struct brcmf_if *ifp, +#if defined(__linux__) + const void *data, size_t size, +#elif defined(__FreeBSD__) + const u8 *data, size_t size, +#endif + const char *loadvar, const char *statvar) +{ + struct brcmf_pub *drvr = ifp->drvr; + struct brcmf_dload_data_le *chunk_buf; + u32 chunk_len; + u32 datalen; + u32 cumulative_len; + u16 dl_flag = DL_BEGIN; + u32 status; + s32 err; + + brcmf_dbg(TRACE, "Enter\n"); + - chunk_buf = kzalloc(struct_size(chunk_buf, data, MAX_CHUNK_LEN), - GFP_KERNEL); ++ chunk_buf = kzalloc_flex(*chunk_buf, data, MAX_CHUNK_LEN); + if (!chunk_buf) { + err = -ENOMEM; + return -ENOMEM; + } + + datalen = size; + cumulative_len = 0; + do { + if (datalen > MAX_CHUNK_LEN) { + chunk_len = MAX_CHUNK_LEN; + } else { + chunk_len = datalen; + dl_flag |= DL_END; + } + memcpy(chunk_buf->data, data + cumulative_len, chunk_len); + + err = brcmf_c_download(ifp, dl_flag, chunk_buf, chunk_len, + loadvar); + + dl_flag &= ~DL_BEGIN; + + cumulative_len += chunk_len; + datalen -= chunk_len; + } while ((datalen > 0) && (err == 0)); + + if (err) { + bphy_err(drvr, "%s (%zu byte file) failed (%d)\n", + loadvar, size, err); + /* Retrieve status and print */ + err = brcmf_fil_iovar_int_get(ifp, statvar, &status); + if (err) + bphy_err(drvr, "get %s failed (%d)\n", statvar, err); + else + brcmf_dbg(INFO, "%s=%d\n", statvar, status); + err = -EIO; + } + + kfree(chunk_buf); + return err; +} + +static int brcmf_c_process_clm_blob(struct brcmf_if *ifp) +{ + struct brcmf_pub *drvr = ifp->drvr; + struct brcmf_bus *bus = drvr->bus_if; + const struct firmware *fw = NULL; + s32 err; + + brcmf_dbg(TRACE, "Enter\n"); + + err = brcmf_bus_get_blob(bus, &fw, BRCMF_BLOB_CLM); + if (err || !fw) { + brcmf_info("no clm_blob available (err=%d), device may have limited channels available\n", + err); + return 0; + } + + err = brcmf_c_download_blob(ifp, fw->data, fw->size, + "clmload", "clmload_status"); + + release_firmware(fw); + return err; +} + +static int brcmf_c_process_txcap_blob(struct brcmf_if *ifp) +{ + struct brcmf_pub *drvr = ifp->drvr; + struct brcmf_bus *bus = drvr->bus_if; + const struct firmware *fw = NULL; + s32 err; + + brcmf_dbg(TRACE, "Enter\n"); + + err = brcmf_bus_get_blob(bus, &fw, BRCMF_BLOB_TXCAP); + if (err || !fw) { + brcmf_info("no txcap_blob available (err=%d)\n", err); + return 0; + } + + brcmf_info("TxCap blob found, loading\n"); + err = brcmf_c_download_blob(ifp, fw->data, fw->size, + "txcapload", "txcapload_status"); + + release_firmware(fw); + return err; +} + +int brcmf_c_set_cur_etheraddr(struct brcmf_if *ifp, const u8 *addr) +{ + s32 err; + + err = brcmf_fil_iovar_data_set(ifp, "cur_etheraddr", addr, ETH_ALEN); + if (err < 0) + bphy_err(ifp->drvr, "Setting cur_etheraddr failed, %d\n", err); + + return err; +} + +/* On some boards there is no eeprom to hold the nvram, in this case instead + * a board specific nvram is loaded from /lib/firmware. On most boards the + * macaddr setting in the /lib/firmware nvram file is ignored because the + * wifibt chip has a unique MAC programmed into the chip itself. + * But in some cases the actual MAC from the /lib/firmware nvram file gets + * used, leading to MAC conflicts. + * The MAC addresses in the troublesome nvram files seem to all come from + * the same nvram file template, so we only need to check for 1 known + * address to detect this. + */ +static const u8 brcmf_default_mac_address[ETH_ALEN] = { + 0x00, 0x90, 0x4c, 0xc5, 0x12, 0x38 +}; + +static int brcmf_c_process_cal_blob(struct brcmf_if *ifp) +{ + struct brcmf_pub *drvr = ifp->drvr; + struct brcmf_mp_device *settings = drvr->settings; + s32 err; + + brcmf_dbg(TRACE, "Enter\n"); + + if (!settings->cal_blob || !settings->cal_size) + return 0; + + brcmf_info("Calibration blob provided by platform, loading\n"); + err = brcmf_c_download_blob(ifp, settings->cal_blob, settings->cal_size, + "calload", "calload_status"); + return err; +} + +int brcmf_c_preinit_dcmds(struct brcmf_if *ifp) +{ + struct brcmf_pub *drvr = ifp->drvr; + struct brcmf_fweh_info *fweh = drvr->fweh; + u8 buf[BRCMF_DCMD_SMLEN]; + struct brcmf_bus *bus; + struct brcmf_rev_info_le revinfo; + struct brcmf_rev_info *ri; + char *clmver; + char *ptr; + s32 err; + + if (is_valid_ether_addr(ifp->mac_addr)) { + /* set mac address */ + err = brcmf_c_set_cur_etheraddr(ifp, ifp->mac_addr); + if (err < 0) + goto done; + } else { + /* retrieve mac address */ + err = brcmf_fil_iovar_data_get(ifp, "cur_etheraddr", ifp->mac_addr, + sizeof(ifp->mac_addr)); + if (err < 0) { + bphy_err(drvr, "Retrieving cur_etheraddr failed, %d\n", err); + goto done; + } + + if (ether_addr_equal_unaligned(ifp->mac_addr, brcmf_default_mac_address)) { + bphy_err(drvr, "Default MAC is used, replacing with random MAC to avoid conflicts\n"); + eth_random_addr(ifp->mac_addr); + ifp->ndev->addr_assign_type = NET_ADDR_RANDOM; + err = brcmf_c_set_cur_etheraddr(ifp, ifp->mac_addr); + if (err < 0) + goto done; + } + } + + memcpy(ifp->drvr->mac, ifp->mac_addr, sizeof(ifp->drvr->mac)); + memcpy(ifp->drvr->wiphy->perm_addr, ifp->drvr->mac, ETH_ALEN); + + bus = ifp->drvr->bus_if; + ri = &ifp->drvr->revinfo; + + err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_REVINFO, + &revinfo, sizeof(revinfo)); + if (err < 0) { + bphy_err(drvr, "retrieving revision info failed, %d\n", err); + strscpy(ri->chipname, "UNKNOWN", sizeof(ri->chipname)); + } else { + ri->vendorid = le32_to_cpu(revinfo.vendorid); + ri->deviceid = le32_to_cpu(revinfo.deviceid); + ri->radiorev = le32_to_cpu(revinfo.radiorev); + ri->corerev = le32_to_cpu(revinfo.corerev); + ri->boardid = le32_to_cpu(revinfo.boardid); + ri->boardvendor = le32_to_cpu(revinfo.boardvendor); + ri->boardrev = le32_to_cpu(revinfo.boardrev); + ri->driverrev = le32_to_cpu(revinfo.driverrev); + ri->ucoderev = le32_to_cpu(revinfo.ucoderev); + ri->bus = le32_to_cpu(revinfo.bus); + ri->phytype = le32_to_cpu(revinfo.phytype); + ri->phyrev = le32_to_cpu(revinfo.phyrev); + ri->anarev = le32_to_cpu(revinfo.anarev); + ri->chippkg = le32_to_cpu(revinfo.chippkg); + ri->nvramrev = le32_to_cpu(revinfo.nvramrev); + + /* use revinfo if not known yet */ + if (!bus->chip) { + bus->chip = le32_to_cpu(revinfo.chipnum); + bus->chiprev = le32_to_cpu(revinfo.chiprev); + } + } + ri->result = err; + + if (bus->chip) + brcmf_chip_name(bus->chip, bus->chiprev, + ri->chipname, sizeof(ri->chipname)); + + /* Do any CLM downloading */ + err = brcmf_c_process_clm_blob(ifp); + if (err < 0) { + bphy_err(drvr, "download CLM blob file failed, %d\n", err); + goto done; + } + + /* Do TxCap downloading, if needed */ + err = brcmf_c_process_txcap_blob(ifp); + if (err < 0) { + bphy_err(drvr, "download TxCap blob file failed, %d\n", err); + goto done; + } + + /* Download external calibration blob, if available */ + err = brcmf_c_process_cal_blob(ifp); + if (err < 0) { + bphy_err(drvr, "download calibration blob file failed, %d\n", err); + goto done; + } + + /* query for 'ver' to get version info from firmware */ + memset(buf, 0, sizeof(buf)); + err = brcmf_fil_iovar_data_get(ifp, "ver", buf, sizeof(buf)); + if (err < 0) { + bphy_err(drvr, "Retrieving version information failed, %d\n", + err); + goto done; + } + buf[sizeof(buf) - 1] = '\0'; + ptr = (char *)buf; + strsep(&ptr, "\n"); + + /* Print fw version info */ + brcmf_info("Firmware: %s %s\n", ri->chipname, buf); + + /* locate firmware version number for ethtool */ + ptr = strrchr(buf, ' '); + if (!ptr) { + bphy_err(drvr, "Retrieving version number failed"); + goto done; + } + strscpy(ifp->drvr->fwver, ptr + 1, sizeof(ifp->drvr->fwver)); + + /* Query for 'clmver' to get CLM version info from firmware */ + memset(buf, 0, sizeof(buf)); + err = brcmf_fil_iovar_data_get(ifp, "clmver", buf, sizeof(buf)); + if (err) { + brcmf_dbg(TRACE, "retrieving clmver failed, %d\n", err); + } else { + buf[sizeof(buf) - 1] = '\0'; + clmver = (char *)buf; + + /* Replace all newline/linefeed characters with space + * character + */ + strreplace(clmver, '\n', ' '); + + /* store CLM version for adding it to revinfo debugfs file */ + memcpy(ifp->drvr->clmver, clmver, sizeof(ifp->drvr->clmver)); + + brcmf_dbg(INFO, "CLM version = %s\n", clmver); + } + + /* set mpc */ + err = brcmf_fil_iovar_int_set(ifp, "mpc", 1); + if (err) { + bphy_err(drvr, "failed setting mpc\n"); + goto done; + } + + brcmf_c_set_joinpref_default(ifp); + + /* Setup event_msgs, enable E_IF */ + err = brcmf_fil_iovar_data_get(ifp, "event_msgs", fweh->event_mask, + fweh->event_mask_len); + if (err) { + bphy_err(drvr, "Get event_msgs error (%d)\n", err); + goto done; + } + /* + * BRCMF_E_IF can safely be used to set the appropriate bit + * in the event_mask as the firmware event code is guaranteed + * to match the value of BRCMF_E_IF because it is old cruft + * that all vendors have. + */ + setbit(fweh->event_mask, BRCMF_E_IF); + err = brcmf_fil_iovar_data_set(ifp, "event_msgs", fweh->event_mask, + fweh->event_mask_len); + if (err) { + bphy_err(drvr, "Set event_msgs error (%d)\n", err); + goto done; + } + + /* Setup default scan channel time */ + err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_CHANNEL_TIME, + BRCMF_DEFAULT_SCAN_CHANNEL_TIME); + if (err) { + bphy_err(drvr, "BRCMF_C_SET_SCAN_CHANNEL_TIME error (%d)\n", + err); + goto done; + } + + /* Setup default scan unassoc time */ + err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_SCAN_UNASSOC_TIME, + BRCMF_DEFAULT_SCAN_UNASSOC_TIME); + if (err) { + bphy_err(drvr, "BRCMF_C_SET_SCAN_UNASSOC_TIME error (%d)\n", + err); + goto done; + } + + /* Enable tx beamforming, errors can be ignored (not supported) */ + (void)brcmf_fil_iovar_int_set(ifp, "txbf", 1); +done: + return err; +} + +#ifndef CONFIG_BRCM_TRACING +void __brcmf_err(struct brcmf_bus *bus, const char *func, const char *fmt, ...) +{ + struct va_format vaf; + va_list args; + + va_start(args, fmt); + + vaf.fmt = fmt; + vaf.va = &args; +#if defined(__linux__) + if (bus) + dev_err(bus->dev, "%s: %pV", func, &vaf); + else + pr_err("%s: %pV", func, &vaf); +#elif defined(__FreeBSD__) + { + char *str; + vasprintf(&str, M_KMALLOC, vaf.fmt, args); + if (bus) + dev_err(bus->dev, "ERROR: %s: %s", func, str); + else + pr_err("ERROR: %s: %s", func, str); + free(str, M_KMALLOC); + } +#endif + + va_end(args); +} +#endif + +#if defined(CONFIG_BRCM_TRACING) || defined(CONFIG_BRCMDBG) +void __brcmf_dbg(u32 level, const char *func, const char *fmt, ...) +{ + struct va_format vaf = { + .fmt = fmt, + }; + va_list args; + + va_start(args, fmt); + vaf.va = &args; + if (brcmf_msg_level & level) +#if defined(__linux__) + pr_debug("%s %pV", func, &vaf); +#elif defined(__FreeBSD__) + { + char *str; + vasprintf(&str, M_KMALLOC, vaf.fmt, args); + pr_debug("%s %s", func, str); + free(str, M_KMALLOC); + } +#endif + trace_brcmf_dbg(level, func, &vaf); + va_end(args); +} +BRCMF_EXPORT_SYMBOL_GPL(__brcmf_dbg); +#endif + +static void brcmf_mp_attach(void) +{ + /* If module param firmware path is set then this will always be used, + * if not set then if available use the platform data version. To make + * sure it gets initialized at all, always copy the module param version + */ + strscpy(brcmf_mp_global.firmware_path, brcmf_firmware_path, + BRCMF_FW_ALTPATH_LEN); + if ((brcmfmac_pdata) && (brcmfmac_pdata->fw_alternative_path) && + (brcmf_mp_global.firmware_path[0] == '\0')) { + strscpy(brcmf_mp_global.firmware_path, + brcmfmac_pdata->fw_alternative_path, + BRCMF_FW_ALTPATH_LEN); + } +} + +struct brcmf_mp_device *brcmf_get_module_param(struct device *dev, + enum brcmf_bus_type bus_type, + u32 chip, u32 chiprev) +{ + struct brcmf_mp_device *settings; + struct brcmfmac_pd_device *device_pd; + bool found; + int i; + + brcmf_dbg(INFO, "Enter, bus=%d, chip=%d, rev=%d\n", bus_type, chip, + chiprev); - settings = kzalloc(sizeof(*settings), GFP_ATOMIC); ++ settings = kzalloc_obj(*settings, GFP_ATOMIC); + if (!settings) + return NULL; + + /* start by using the module parameters */ + settings->p2p_enable = !!brcmf_p2p_enable; + settings->feature_disable = brcmf_feature_disable; + settings->fcmode = brcmf_fcmode; + settings->roamoff = !!brcmf_roamoff; + settings->iapp = !!brcmf_iapp_enable; +#ifdef DEBUG + settings->ignore_probe_fail = !!brcmf_ignore_probe_fail; +#endif + + if (bus_type == BRCMF_BUSTYPE_SDIO) + settings->bus.sdio.txglomsz = brcmf_sdiod_txglomsz; + + /* See if there is any device specific platform data configured */ + found = false; + if (brcmfmac_pdata) { + for (i = 0; i < brcmfmac_pdata->device_count; i++) { + device_pd = &brcmfmac_pdata->devices[i]; + if ((device_pd->bus_type == bus_type) && + (device_pd->id == chip) && + ((device_pd->rev == chiprev) || + (device_pd->rev == -1))) { + brcmf_dbg(INFO, "Platform data for device found\n"); + settings->country_codes = + device_pd->country_codes; + if (device_pd->bus_type == BRCMF_BUSTYPE_SDIO) + memcpy(&settings->bus.sdio, + &device_pd->bus.sdio, + sizeof(settings->bus.sdio)); + found = true; + break; + } + } + } + if (!found) { + /* No platform data for this device, try OF and DMI data */ + brcmf_dmi_probe(settings, chip, chiprev); + if (brcmf_of_probe(dev, bus_type, settings) == -EPROBE_DEFER) { + kfree(settings); + return ERR_PTR(-EPROBE_DEFER); + } + brcmf_acpi_probe(dev, bus_type, settings); + } + return settings; +} + +void brcmf_release_module_param(struct brcmf_mp_device *module_param) +{ + kfree(module_param); +} + +static int __init brcmf_common_pd_probe(struct platform_device *pdev) +{ + brcmf_dbg(INFO, "Enter\n"); + + brcmfmac_pdata = dev_get_platdata(&pdev->dev); + + if (brcmfmac_pdata->power_on) + brcmfmac_pdata->power_on(); + + return 0; +} + +static void brcmf_common_pd_remove(struct platform_device *pdev) +{ + brcmf_dbg(INFO, "Enter\n"); + + if (brcmfmac_pdata->power_off) + brcmfmac_pdata->power_off(); +} + +static struct platform_driver brcmf_pd = { + .remove = brcmf_common_pd_remove, + .driver = { + .name = BRCMFMAC_PDATA_NAME, + } +}; + +static int __init brcmfmac_module_init(void) +{ + int err; + + /* Get the platform data (if available) for our devices */ + err = platform_driver_probe(&brcmf_pd, brcmf_common_pd_probe); + if (err == -ENODEV) + brcmf_dbg(INFO, "No platform data available.\n"); + + /* Initialize global module parameters */ + brcmf_mp_attach(); + + /* Continue the initialization by registering the different busses */ + err = brcmf_core_init(); + if (err) { + if (brcmfmac_pdata) + platform_driver_unregister(&brcmf_pd); + } + + return err; +} + +static void __exit brcmfmac_module_exit(void) +{ + brcmf_core_exit(); + if (brcmfmac_pdata) + platform_driver_unregister(&brcmf_pd); +} + +module_init(brcmfmac_module_init); +module_exit(brcmfmac_module_exit); + diff --cc sys/contrib/dev/broadcom/brcm80211/brcmfmac/firmware.c index 0ad9abd67fd6,000000000000..315573ba35b4 mode 100644,000000..100644 --- a/sys/contrib/dev/broadcom/brcm80211/brcmfmac/firmware.c +++ b/sys/contrib/dev/broadcom/brcm80211/brcmfmac/firmware.c @@@ -1,887 -1,0 +1,887 @@@ +// SPDX-License-Identifier: ISC +/* + * Copyright (c) 2013 Broadcom Corporation + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "debug.h" +#include "firmware.h" +#include "core.h" +#include "common.h" +#include "chip.h" + +#define BRCMF_FW_MAX_NVRAM_SIZE 64000 +#define BRCMF_FW_NVRAM_DEVPATH_LEN 19 /* devpath0=pcie/1/4/ */ +#define BRCMF_FW_NVRAM_PCIEDEV_LEN 20 /* pcie/1/4/ + \0 */ +#define BRCMF_FW_DEFAULT_BOARDREV "boardrev=0xff" +#define BRCMF_FW_MACADDR_FMT "macaddr=%pM" +#define BRCMF_FW_MACADDR_LEN (7 + ETH_ALEN * 3) + +enum nvram_parser_state { + IDLE, + KEY, + VALUE, + COMMENT, + END +}; + +/** + * struct nvram_parser - internal info for parser. + * + * @state: current parser state. + * @data: input buffer being parsed. + * @nvram: output buffer with parse result. + * @nvram_len: length of parse result. + * @line: current line. + * @column: current column in line. + * @pos: byte offset in input buffer. + * @entry: start position of key,value entry. + * @multi_dev_v1: detect pcie multi device v1 (compressed). + * @multi_dev_v2: detect pcie multi device v2. + * @boardrev_found: nvram contains boardrev information. + * @strip_mac: strip the MAC address. + */ +struct nvram_parser { + enum nvram_parser_state state; + const u8 *data; + u8 *nvram; + u32 nvram_len; + u32 line; + u32 column; + u32 pos; + u32 entry; + bool multi_dev_v1; + bool multi_dev_v2; + bool boardrev_found; + bool strip_mac; +}; + +/* + * is_nvram_char() - check if char is a valid one for NVRAM entry + * + * It accepts all printable ASCII chars except for '#' which opens a comment. + * Please note that ' ' (space) while accepted is not a valid key name char. + */ +static bool is_nvram_char(char c) +{ + /* comment marker excluded */ + if (c == '#') + return false; + + /* key and value may have any other readable character */ + return (c >= 0x20 && c < 0x7f); +} + +static bool is_whitespace(char c) +{ + return (c == ' ' || c == '\r' || c == '\n' || c == '\t'); +} + +static enum nvram_parser_state brcmf_nvram_handle_idle(struct nvram_parser *nvp) +{ + char c; + + c = nvp->data[nvp->pos]; + if (c == '\n') + return COMMENT; + if (is_whitespace(c) || c == '\0') + goto proceed; + if (c == '#') + return COMMENT; + if (is_nvram_char(c)) { + nvp->entry = nvp->pos; + return KEY; + } + brcmf_dbg(INFO, "warning: ln=%d:col=%d: ignoring invalid character\n", + nvp->line, nvp->column); +proceed: + nvp->column++; + nvp->pos++; + return IDLE; +} + +static enum nvram_parser_state brcmf_nvram_handle_key(struct nvram_parser *nvp) +{ + enum nvram_parser_state st = nvp->state; + char c; + + c = nvp->data[nvp->pos]; + if (c == '=') { + /* ignore RAW1 by treating as comment */ + if (strncmp(&nvp->data[nvp->entry], "RAW1", 4) == 0) + st = COMMENT; + else + st = VALUE; + if (strncmp(&nvp->data[nvp->entry], "devpath", 7) == 0) + nvp->multi_dev_v1 = true; + if (strncmp(&nvp->data[nvp->entry], "pcie/", 5) == 0) + nvp->multi_dev_v2 = true; + if (strncmp(&nvp->data[nvp->entry], "boardrev", 8) == 0) + nvp->boardrev_found = true; + /* strip macaddr if platform MAC overrides */ + if (nvp->strip_mac && + strncmp(&nvp->data[nvp->entry], "macaddr", 7) == 0) + st = COMMENT; + } else if (!is_nvram_char(c) || c == ' ') { + brcmf_dbg(INFO, "warning: ln=%d:col=%d: '=' expected, skip invalid key entry\n", + nvp->line, nvp->column); + return COMMENT; + } + + nvp->column++; + nvp->pos++; + return st; +} + +static enum nvram_parser_state +brcmf_nvram_handle_value(struct nvram_parser *nvp) +{ + char c; +#if defined(__linux__) + char *skv; + char *ekv; +#elif defined(__FreeBSD__) + const char *skv; + const char *ekv; +#endif + u32 cplen; + + c = nvp->data[nvp->pos]; + if (!is_nvram_char(c)) { + /* key,value pair complete */ +#if defined(__linux__) + ekv = (u8 *)&nvp->data[nvp->pos]; + skv = (u8 *)&nvp->data[nvp->entry]; +#elif defined(__FreeBSD__) + ekv = &nvp->data[nvp->pos]; + skv = &nvp->data[nvp->entry]; +#endif + cplen = ekv - skv; + if (nvp->nvram_len + cplen + 1 >= BRCMF_FW_MAX_NVRAM_SIZE) + return END; + /* copy to output buffer */ + memcpy(&nvp->nvram[nvp->nvram_len], skv, cplen); + nvp->nvram_len += cplen; + nvp->nvram[nvp->nvram_len] = '\0'; + nvp->nvram_len++; + return IDLE; + } + nvp->pos++; + nvp->column++; + return VALUE; +} + +static enum nvram_parser_state +brcmf_nvram_handle_comment(struct nvram_parser *nvp) +{ +#if defined(__linux__) + char *eoc, *sol; + + sol = (char *)&nvp->data[nvp->pos]; +#elif defined(__FreeBSD__) + const char *eoc, *sol; + + sol = &nvp->data[nvp->pos]; +#endif + eoc = strchr(sol, '\n'); + if (!eoc) { + eoc = strchr(sol, '\0'); + if (!eoc) + return END; + } + + /* eat all moving to next line */ + nvp->line++; + nvp->column = 1; + nvp->pos += (eoc - sol) + 1; + return IDLE; +} + +static enum nvram_parser_state brcmf_nvram_handle_end(struct nvram_parser *nvp) +{ + /* final state */ + return END; +} + +static enum nvram_parser_state +(*nv_parser_states[])(struct nvram_parser *nvp) = { + brcmf_nvram_handle_idle, + brcmf_nvram_handle_key, + brcmf_nvram_handle_value, + brcmf_nvram_handle_comment, + brcmf_nvram_handle_end +}; + +static int brcmf_init_nvram_parser(struct nvram_parser *nvp, + const u8 *data, size_t data_len) +{ + size_t size; + + memset(nvp, 0, sizeof(*nvp)); + nvp->data = data; + /* Limit size to MAX_NVRAM_SIZE, some files contain lot of comment */ + if (data_len > BRCMF_FW_MAX_NVRAM_SIZE) + size = BRCMF_FW_MAX_NVRAM_SIZE; + else + size = data_len; + /* Add space for properties we may add */ + size += strlen(BRCMF_FW_DEFAULT_BOARDREV) + 1; + size += BRCMF_FW_MACADDR_LEN + 1; + /* Alloc for extra 0 byte + roundup by 4 + length field */ + size += 1 + 3 + sizeof(u32); + nvp->nvram = kzalloc(size, GFP_KERNEL); + if (!nvp->nvram) + return -ENOMEM; + + nvp->line = 1; + nvp->column = 1; + return 0; +} *** 2308 LINES SKIPPED *** From nobody Sun Apr 19 15:18:19 2026 X-Original-To: dev-commits-src-main@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 4fzC1R2gvrz676T2 for ; Sun, 19 Apr 2026 15:18:19 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fzC1R0vDnz46TD for ; Sun, 19 Apr 2026 15:18:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776611899; 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=Zr/FArQDKnjKX8xtpV+6l/YzsSjAuQgNL9rjR5gpgUs=; b=BcHKqI6njk/o0MF2QG8f5MkJiCtOY7RL5CmS3ToeHoRL7zRh5oPf/BUqIrurYJM9IRp3n4 Dspc63lyR65WIvvUFN3evOXaMUooYOKPVVRBnChuIBx2KZhg0tiUTqX0UWN2Hg0kr9d7vd q72Pjl6xvpsAPOp/Zy+il5WdZICutriWjqOtuKHshAgMH5qo/kQUfRk6FzlybNagaooGen 4btggxLEliSzD278ebXJRw9fVA88JenrgofJdVjTV+Ux7kH+jwhc8KdWBGNHPfp/92lQMu 0pdUbxwErsV/6fOjnHAEpzTKZa5e21cm2ojIPRHy8551xFuRmBCUz508Dew3Ig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776611899; a=rsa-sha256; cv=none; b=HdDUmWEJU+/+xQFbXQ9gQiaNOI8cZIfDbKYppEOKHU5gqYRtnkX9/3oCK0WErkPi+b7TeD e+D11pYJEQfPd6jxBcBiPBmza/tnmDSYfrelqPv7JSkn9R+PxWUElVsZeHEd20WaQaVS7I JVG0BIJcOdjQz0Kp43cPEzJooSuX1cs1rwoF25rZDOanqoiz4Gq+YpolFi/IvJDayrn4Kf qtyBW2xwSDUYdSWXm7JGnu/VdPALU+jmGHcWDVFXHJAQg0Z+Z1aCbt9g/C2ihspccBh3bJ BkDzV4qWmWZkR3AJXpl1hajs4nngtSLlYC3rPZWIgpKbBwv5t5x7uyxqvMlL2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776611899; 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=Zr/FArQDKnjKX8xtpV+6l/YzsSjAuQgNL9rjR5gpgUs=; b=ag29zNaJKj76y8AccfwIjI4RhKOKUxs+WWcgT7mhdtdjWB+OgCioNPusab8ARceHF7XGe/ m16+4wiKl6WmiYOMWIs0LncehKCCgIZSDLKZy2jUOeyPbhrUrUAIk2AhHqYGneSGyruXRw rpfQCyz3TGBjrByVbux9weLtIQpGmSWNbYblPJ5ZrRLw3vHiNBhyqlJQaLEr/wlbFIdsYL 3a5jdfoG6ChTbgy9wkzYf9bKT/D5/kWPgNVYbqU8qKIgDMgRKVGTuaNPNOfV//6HlCVx8W mzZ1b3dBXOqOSCECNPhLBS9DL4jfV7s95V3qYlmCaO87hA5gbeshXE93m+ydAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fzC1R03W4z1tw for ; Sun, 19 Apr 2026 15:18:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30cd7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 15:18:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 634a48f3673f - main - brcm80211: update module Makefiles for v7.0 driver version List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 634a48f3673ff8af9848846a6bff1a8c068d205d Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 15:18:19 +0000 Message-Id: <69e4f23b.30cd7.34ae3efb@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=634a48f3673ff8af9848846a6bff1a8c068d205d commit 634a48f3673ff8af9848846a6bff1a8c068d205d Author: Bjoern A. Zeeb AuthorDate: 2026-04-19 15:17:29 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-19 15:17:29 +0000 brcm80211: update module Makefiles for v7.0 driver version Update LINUXKPI_VERSION to reflect that the driver is based on Linux v7.0. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/modules/brcm80211/brcmfmac/Makefile | 2 +- sys/modules/brcm80211/brcmutil/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/modules/brcm80211/brcmfmac/Makefile b/sys/modules/brcm80211/brcmfmac/Makefile index 107914c2dc27..656556445a31 100644 --- a/sys/modules/brcm80211/brcmfmac/Makefile +++ b/sys/modules/brcm80211/brcmfmac/Makefile @@ -93,6 +93,6 @@ CFLAGS+= ${LINUXKPI_INCLUDES} #CFLAGS+= -DCONFIG_IPV6=0 CFLAGS+= -DKBUILD_MODNAME='"brcmfmac"' -CFLAGS+= -DLINUXKPI_VERSION=61900 +CFLAGS+= -DLINUXKPI_VERSION=70000 .include diff --git a/sys/modules/brcm80211/brcmutil/Makefile b/sys/modules/brcm80211/brcmutil/Makefile index 7ef89be18bf9..fe97b18aa718 100644 --- a/sys/modules/brcm80211/brcmutil/Makefile +++ b/sys/modules/brcm80211/brcmutil/Makefile @@ -23,6 +23,6 @@ CFLAGS+= ${LINUXKPI_INCLUDES} #CFLAGS+= -ferror-limit=0 CFLAGS+= -DKBUILD_MODNAME='"brcmutil"' -CFLAGS+= -DLINUXKPI_VERSION=61900 +CFLAGS+= -DLINUXKPI_VERSION=70000 .include From nobody Sun Apr 19 15:30:34 2026 X-Original-To: dev-commits-src-main@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 4fzCHb45Ntz6778r for ; Sun, 19 Apr 2026 15:30:35 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fzCHb2yQDz49V3 for ; Sun, 19 Apr 2026 15:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776612635; 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=AjRQWoXDJq8aAabtDLQV0RQkSMakcUtBi9DNxtTwTfk=; b=m1h3NIUkLdEBlaklRrX9F56VLuDCiJyA43ychacb20Da8v7mjVlFauDQqmiZwVt51SsHJM y6chA2uYa1ImCrXYHIbbese1qnDqXgw+NVCdYRGUxBAwZegkAWocHNG8Vh5MZHcOSWgsDf zVruKdjQUtaCZLgC29qSk/xkzHR8zZ10fK3N46eq/6i5lpuVI0YqY4US2xuPgNG9NgB2UL eHxBFnPcXTQ5kVZyzW2pO8JEFJs0QL+4Hza2nf8tnEcixcPguwkp2F6yqrGeZ2px77qxYP pcETSRXxn4s4vdg1E5xEE6YeuxxPJXtCmglFooajcRlSxzpPBHBPLer/7OJy/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776612635; a=rsa-sha256; cv=none; b=byxSoL6XwalTFNN8lWixx93fgNl5A1/kPhZCdazlCWXmKmGaV/vXX2BFQ00PMjsaRAOBMt Mzdy4TjPltsLM6wz+mzAmQxb3RM7ra0YJ8RbKIBaRu6hEN6AR+mudZx4N1q+z2ePQmUo4G +hqcu4InUbuhUJdRjZ1XlUFfs76ETPOYmvuT/9V4L6M/O3SsYUWLi7oRHNOMgxYTOMCNls ohSP4ke01ge5stT7Btt7XYPN4Vp5rYfPorOS4dnlXAQEf4hIW9KHVIuW2jzwNMP+kbsdbE 3DlDrYKOUF2AwdMhfyARtn7bPReMboY1BWsJSCZlAdTdr+GZBb88Ge8MtLZ+KA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776612635; 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=AjRQWoXDJq8aAabtDLQV0RQkSMakcUtBi9DNxtTwTfk=; b=TBzW8CImuU6hPO8tqJxFjqns6ofXNTNV6v/vk6uzpWMH8JKPony4hxBKUSYFhkjszRFKa2 sE9QOvrw4E0Yyph2xQZ4b0TmunYVpYOEqrfoxqGnxp94cInQtJdk0Gizs3L9YHsN7dU8bQ gpiKRw1Dy8mmYkERbO14UHOYBrCDipUeazGd1j4NIMI6rLl+dB1XGtrwZABuQSDQbJ6GtG 8lytJMYRSynqQ8kOP5QBSd3rwqoixnpmcH9pJtVf3Al0fcreve76qqGJt77zLGrc8kCaNU SwK0frU4c3GNadhht1k/3mn5OmkoWpL5Okb0Ivz7Eu2DxGvnjnImICik4p0mtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fzCHb2Yq9z1Xt for ; Sun, 19 Apr 2026 15:30:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 32b35 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 15:30:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 4ed5b949d5e2 - main - ath11k: update Atheros/QCA's ath11k driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4ed5b949d5e25456124a4d280d27e9719f90e9be Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 15:30:34 +0000 Message-Id: <69e4f51a.32b35.4de1fcf9@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4ed5b949d5e25456124a4d280d27e9719f90e9be commit 4ed5b949d5e25456124a4d280d27e9719f90e9be Merge: 634a48f3673f c3e04a1cd3b6 Author: Bjoern A. Zeeb AuthorDate: 2026-04-19 15:27:01 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-19 15:27:27 +0000 ath11k: update Atheros/QCA's ath11k driver This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ). Sponsored by: The FreeBSD Foundation MFC after: 3 days sys/contrib/dev/athk/ath11k/Kconfig | 11 + sys/contrib/dev/athk/ath11k/Makefile | 1 + sys/contrib/dev/athk/ath11k/ce.c | 2 +- sys/contrib/dev/athk/ath11k/cfr.c | 1022 +++++++++++++++++++++++++++++ sys/contrib/dev/athk/ath11k/cfr.h | 308 +++++++++ sys/contrib/dev/athk/ath11k/core.c | 108 ++- sys/contrib/dev/athk/ath11k/core.h | 23 +- sys/contrib/dev/athk/ath11k/dbring.c | 52 +- sys/contrib/dev/athk/ath11k/dbring.h | 8 +- sys/contrib/dev/athk/ath11k/debug.h | 8 +- sys/contrib/dev/athk/ath11k/debugfs.c | 10 +- sys/contrib/dev/athk/ath11k/debugfs_sta.c | 142 +++- sys/contrib/dev/athk/ath11k/dp.c | 12 +- sys/contrib/dev/athk/ath11k/dp.h | 1 - sys/contrib/dev/athk/ath11k/dp_rx.c | 21 +- sys/contrib/dev/athk/ath11k/dp_tx.c | 11 +- sys/contrib/dev/athk/ath11k/hal.c | 3 +- sys/contrib/dev/athk/ath11k/hw.c | 19 +- sys/contrib/dev/athk/ath11k/hw.h | 8 +- sys/contrib/dev/athk/ath11k/mac.c | 39 +- sys/contrib/dev/athk/ath11k/mhi.c | 6 +- sys/contrib/dev/athk/ath11k/peer.c | 2 +- sys/contrib/dev/athk/ath11k/qmi.c | 12 +- sys/contrib/dev/athk/ath11k/reg.c | 12 +- sys/contrib/dev/athk/ath11k/wmi.c | 167 ++++- sys/contrib/dev/athk/ath11k/wmi.h | 97 ++- sys/contrib/dev/athk/ath11k/wow.c | 4 +- 27 files changed, 1999 insertions(+), 110 deletions(-) diff --cc sys/contrib/dev/athk/ath11k/Makefile index d9092414b362,000000000000..b1435fcf3e1b mode 100644,000000..100644 --- a/sys/contrib/dev/athk/ath11k/Makefile +++ b/sys/contrib/dev/athk/ath11k/Makefile @@@ -1,39 -1,0 +1,40 @@@ +# SPDX-License-Identifier: BSD-3-Clause-Clear +obj-$(CONFIG_ATH11K) += ath11k.o +ath11k-y += core.o \ + hal.o \ + hal_tx.o \ + hal_rx.o \ + wmi.o \ + mac.o \ + reg.o \ + htc.o \ + qmi.o \ + dp.o \ + dp_tx.o \ + dp_rx.o \ + debug.o \ + ce.o \ + peer.o \ + dbring.o \ + hw.o \ + pcic.o \ + fw.o \ + p2p.o + +ath11k-$(CONFIG_ATH11K_DEBUGFS) += debugfs.o debugfs_htt_stats.o debugfs_sta.o +ath11k-$(CONFIG_NL80211_TESTMODE) += testmode.o +ath11k-$(CONFIG_ATH11K_TRACING) += trace.o +ath11k-$(CONFIG_THERMAL) += thermal.o +ath11k-$(CONFIG_ATH11K_SPECTRAL) += spectral.o +ath11k-$(CONFIG_PM) += wow.o +ath11k-$(CONFIG_DEV_COREDUMP) += coredump.o ++ath11k-$(CONFIG_ATH11K_CFR) += cfr.o + +obj-$(CONFIG_ATH11K_AHB) += ath11k_ahb.o +ath11k_ahb-y += ahb.o + +obj-$(CONFIG_ATH11K_PCI) += ath11k_pci.o +ath11k_pci-y += mhi.o pci.o + +# for tracing framework to find trace.h +CFLAGS_trace.o := -I$(src) diff --cc sys/contrib/dev/athk/ath11k/ce.c index 1c1bf303ad77,000000000000..6a3ef2050bdf mode 100644,000000..100644 --- a/sys/contrib/dev/athk/ath11k/ce.c +++ b/sys/contrib/dev/athk/ath11k/ce.c @@@ -1,1088 -1,0 +1,1088 @@@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +/* + * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#include +#include "dp_rx.h" +#include "debug.h" +#include "hif.h" + +const struct ce_attr ath11k_host_ce_config_ipq8074[] = { + /* CE0: host->target HTC control and raw streams */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 16, + .src_sz_max = 2048, + .dest_nentries = 0, + .send_cb = ath11k_htc_tx_completion_handler, + }, + + /* CE1: target->host HTT + HTC control */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 2048, + .dest_nentries = 512, + .recv_cb = ath11k_htc_rx_completion_handler, + }, + + /* CE2: target->host WMI */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 2048, + .dest_nentries = 512, + .recv_cb = ath11k_htc_rx_completion_handler, + }, + + /* CE3: host->target WMI (mac0) */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 32, + .src_sz_max = 2048, + .dest_nentries = 0, + .send_cb = ath11k_htc_tx_completion_handler, + }, + + /* CE4: host->target HTT */ + { + .flags = CE_ATTR_FLAGS | CE_ATTR_DIS_INTR, + .src_nentries = 2048, + .src_sz_max = 256, + .dest_nentries = 0, + }, + + /* CE5: target->host pktlog */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 2048, + .dest_nentries = 512, + .recv_cb = ath11k_dp_htt_htc_t2h_msg_handler, + }, + + /* CE6: target autonomous hif_memcpy */ + { + .flags = CE_ATTR_FLAGS | CE_ATTR_DIS_INTR, + .src_nentries = 0, + .src_sz_max = 0, + .dest_nentries = 0, + }, + + /* CE7: host->target WMI (mac1) */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 32, + .src_sz_max = 2048, + .dest_nentries = 0, + .send_cb = ath11k_htc_tx_completion_handler, + }, + + /* CE8: target autonomous hif_memcpy */ + { + .flags = CE_ATTR_FLAGS | CE_ATTR_DIS_INTR, + .src_nentries = 0, + .src_sz_max = 0, + .dest_nentries = 0, + }, + + /* CE9: host->target WMI (mac2) */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 32, + .src_sz_max = 2048, + .dest_nentries = 0, + .send_cb = ath11k_htc_tx_completion_handler, + }, + + /* CE10: target->host HTT */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 2048, + .dest_nentries = 512, + .recv_cb = ath11k_htc_rx_completion_handler, + }, + + /* CE11: Not used */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 0, + .dest_nentries = 0, + }, +}; + +const struct ce_attr ath11k_host_ce_config_qca6390[] = { + /* CE0: host->target HTC control and raw streams */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 16, + .src_sz_max = 2048, + .dest_nentries = 0, + }, + + /* CE1: target->host HTT + HTC control */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 2048, + .dest_nentries = 512, + .recv_cb = ath11k_htc_rx_completion_handler, + }, + + /* CE2: target->host WMI */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 2048, + .dest_nentries = 512, + .recv_cb = ath11k_htc_rx_completion_handler, + }, + + /* CE3: host->target WMI (mac0) */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 32, + .src_sz_max = 2048, + .dest_nentries = 0, + .send_cb = ath11k_htc_tx_completion_handler, + }, + + /* CE4: host->target HTT */ + { + .flags = CE_ATTR_FLAGS | CE_ATTR_DIS_INTR, + .src_nentries = 2048, + .src_sz_max = 256, + .dest_nentries = 0, + }, + + /* CE5: target->host pktlog */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 2048, + .dest_nentries = 512, + .recv_cb = ath11k_dp_htt_htc_t2h_msg_handler, + }, + + /* CE6: target autonomous hif_memcpy */ + { + .flags = CE_ATTR_FLAGS | CE_ATTR_DIS_INTR, + .src_nentries = 0, + .src_sz_max = 0, + .dest_nentries = 0, + }, + + /* CE7: host->target WMI (mac1) */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 32, + .src_sz_max = 2048, + .dest_nentries = 0, + .send_cb = ath11k_htc_tx_completion_handler, + }, + + /* CE8: target autonomous hif_memcpy */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 0, + .dest_nentries = 0, + }, + +}; + +const struct ce_attr ath11k_host_ce_config_qcn9074[] = { + /* CE0: host->target HTC control and raw streams */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 16, + .src_sz_max = 2048, + .dest_nentries = 0, + }, + + /* CE1: target->host HTT + HTC control */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 2048, + .dest_nentries = 512, + .recv_cb = ath11k_htc_rx_completion_handler, + }, + + /* CE2: target->host WMI */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 2048, + .dest_nentries = 32, + .recv_cb = ath11k_htc_rx_completion_handler, + }, + + /* CE3: host->target WMI (mac0) */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 32, + .src_sz_max = 2048, + .dest_nentries = 0, + .send_cb = ath11k_htc_tx_completion_handler, + }, + + /* CE4: host->target HTT */ + { + .flags = CE_ATTR_FLAGS | CE_ATTR_DIS_INTR, + .src_nentries = 2048, + .src_sz_max = 256, + .dest_nentries = 0, + }, + + /* CE5: target->host pktlog */ + { + .flags = CE_ATTR_FLAGS, + .src_nentries = 0, + .src_sz_max = 2048, + .dest_nentries = 512, + .recv_cb = ath11k_dp_htt_htc_t2h_msg_handler, + }, +}; + +static bool ath11k_ce_need_shadow_fix(int ce_id) +{ + /* only ce4 needs shadow workaround */ + if (ce_id == 4) + return true; + return false; +} + +void ath11k_ce_stop_shadow_timers(struct ath11k_base *ab) +{ + int i; + + if (!ab->hw_params.supports_shadow_regs) + return; + + for (i = 0; i < ab->hw_params.ce_count; i++) + if (ath11k_ce_need_shadow_fix(i)) + ath11k_dp_shadow_stop_timer(ab, &ab->ce.hp_timer[i]); +} + +static int ath11k_ce_rx_buf_enqueue_pipe(struct ath11k_ce_pipe *pipe, + struct sk_buff *skb, dma_addr_t paddr) +{ + struct ath11k_base *ab = pipe->ab; + struct ath11k_ce_ring *ring = pipe->dest_ring; + struct hal_srng *srng; + unsigned int write_index; + unsigned int nentries_mask = ring->nentries_mask; + u32 *desc; + int ret; + + lockdep_assert_held(&ab->ce.ce_lock); + + write_index = ring->write_index; + + srng = &ab->hal.srng_list[ring->hal_ring_id]; + + spin_lock_bh(&srng->lock); + + ath11k_hal_srng_access_begin(ab, srng); + + if (unlikely(ath11k_hal_srng_src_num_free(ab, srng, false) < 1)) { + ret = -ENOSPC; + goto exit; + } + + desc = ath11k_hal_srng_src_get_next_entry(ab, srng); + if (!desc) { + ret = -ENOSPC; + goto exit; + } + + ath11k_hal_ce_dst_set_desc(desc, paddr); + + ring->skb[write_index] = skb; + write_index = CE_RING_IDX_INCR(nentries_mask, write_index); + ring->write_index = write_index; + + pipe->rx_buf_needed--; + + ret = 0; +exit: + ath11k_hal_srng_access_end(ab, srng); + + spin_unlock_bh(&srng->lock); + + return ret; +} + +static int ath11k_ce_rx_post_pipe(struct ath11k_ce_pipe *pipe) +{ + struct ath11k_base *ab = pipe->ab; + struct sk_buff *skb; + dma_addr_t paddr; + int ret = 0; + + if (!(pipe->dest_ring || pipe->status_ring)) + return 0; + + spin_lock_bh(&ab->ce.ce_lock); + while (pipe->rx_buf_needed) { + skb = dev_alloc_skb(pipe->buf_sz); + if (!skb) { + ret = -ENOMEM; + goto exit; + } + + WARN_ON_ONCE(!IS_ALIGNED((unsigned long)skb->data, 4)); + + paddr = dma_map_single(ab->dev, skb->data, + skb->len + skb_tailroom(skb), + DMA_FROM_DEVICE); + if (unlikely(dma_mapping_error(ab->dev, paddr))) { + ath11k_warn(ab, "failed to dma map ce rx buf\n"); + dev_kfree_skb_any(skb); + ret = -EIO; + goto exit; + } + + ATH11K_SKB_RXCB(skb)->paddr = paddr; + + ret = ath11k_ce_rx_buf_enqueue_pipe(pipe, skb, paddr); + + if (ret) { + ath11k_dbg(ab, ATH11K_DBG_CE, "failed to enqueue rx buf: %d\n", + ret); + dma_unmap_single(ab->dev, paddr, + skb->len + skb_tailroom(skb), + DMA_FROM_DEVICE); + dev_kfree_skb_any(skb); + goto exit; + } + } + +exit: + spin_unlock_bh(&ab->ce.ce_lock); + return ret; +} + +static int ath11k_ce_completed_recv_next(struct ath11k_ce_pipe *pipe, + struct sk_buff **skb, int *nbytes) +{ + struct ath11k_base *ab = pipe->ab; + struct hal_srng *srng; + unsigned int sw_index; + unsigned int nentries_mask; + u32 *desc; + int ret = 0; + + spin_lock_bh(&ab->ce.ce_lock); + + sw_index = pipe->dest_ring->sw_index; + nentries_mask = pipe->dest_ring->nentries_mask; + + srng = &ab->hal.srng_list[pipe->status_ring->hal_ring_id]; + + spin_lock_bh(&srng->lock); + + ath11k_hal_srng_access_begin(ab, srng); + + desc = ath11k_hal_srng_dst_get_next_entry(ab, srng); + if (!desc) { + ret = -EIO; + goto err; + } + + *nbytes = ath11k_hal_ce_dst_status_get_length(desc); + + *skb = pipe->dest_ring->skb[sw_index]; + pipe->dest_ring->skb[sw_index] = NULL; + + sw_index = CE_RING_IDX_INCR(nentries_mask, sw_index); + pipe->dest_ring->sw_index = sw_index; + + pipe->rx_buf_needed++; +err: + ath11k_hal_srng_access_end(ab, srng); + + spin_unlock_bh(&srng->lock); + + spin_unlock_bh(&ab->ce.ce_lock); + + return ret; +} + +static void ath11k_ce_recv_process_cb(struct ath11k_ce_pipe *pipe) +{ + struct ath11k_base *ab = pipe->ab; + struct sk_buff *skb; + struct sk_buff_head list; + unsigned int nbytes, max_nbytes; + int ret; + + __skb_queue_head_init(&list); + while (ath11k_ce_completed_recv_next(pipe, &skb, &nbytes) == 0) { + max_nbytes = skb->len + skb_tailroom(skb); + dma_unmap_single(ab->dev, ATH11K_SKB_RXCB(skb)->paddr, + max_nbytes, DMA_FROM_DEVICE); + + if (unlikely(max_nbytes < nbytes || nbytes == 0)) { + ath11k_warn(ab, "unexpected rx length (nbytes %d, max %d)", + nbytes, max_nbytes); + dev_kfree_skb_any(skb); + continue; + } + + skb_put(skb, nbytes); + __skb_queue_tail(&list, skb); + } + + while ((skb = __skb_dequeue(&list))) { + ath11k_dbg(ab, ATH11K_DBG_CE, "rx ce pipe %d len %d\n", + pipe->pipe_num, skb->len); + pipe->recv_cb(ab, skb); + } + + ret = ath11k_ce_rx_post_pipe(pipe); + if (ret && ret != -ENOSPC) { + ath11k_warn(ab, "failed to post rx buf to pipe: %d err: %d\n", + pipe->pipe_num, ret); + mod_timer(&ab->rx_replenish_retry, + jiffies + ATH11K_CE_RX_POST_RETRY_JIFFIES); + } +} + +static struct sk_buff *ath11k_ce_completed_send_next(struct ath11k_ce_pipe *pipe) +{ + struct ath11k_base *ab = pipe->ab; + struct hal_srng *srng; + unsigned int sw_index; + unsigned int nentries_mask; + struct sk_buff *skb; + u32 *desc; + + spin_lock_bh(&ab->ce.ce_lock); + + sw_index = pipe->src_ring->sw_index; + nentries_mask = pipe->src_ring->nentries_mask; + + srng = &ab->hal.srng_list[pipe->src_ring->hal_ring_id]; + + spin_lock_bh(&srng->lock); + + ath11k_hal_srng_access_begin(ab, srng); + + desc = ath11k_hal_srng_src_reap_next(ab, srng); + if (!desc) { + skb = ERR_PTR(-EIO); + goto err_unlock; + } + + skb = pipe->src_ring->skb[sw_index]; + + pipe->src_ring->skb[sw_index] = NULL; + + sw_index = CE_RING_IDX_INCR(nentries_mask, sw_index); + pipe->src_ring->sw_index = sw_index; + +err_unlock: + spin_unlock_bh(&srng->lock); + + spin_unlock_bh(&ab->ce.ce_lock); + + return skb; +} + +static void ath11k_ce_tx_process_cb(struct ath11k_ce_pipe *pipe) +{ + struct ath11k_base *ab = pipe->ab; + struct sk_buff *skb; + struct sk_buff_head list; + + __skb_queue_head_init(&list); + while (!IS_ERR(skb = ath11k_ce_completed_send_next(pipe))) { + if (!skb) + continue; + + dma_unmap_single(ab->dev, ATH11K_SKB_CB(skb)->paddr, skb->len, + DMA_TO_DEVICE); + + if ((!pipe->send_cb) || ab->hw_params.credit_flow) { + dev_kfree_skb_any(skb); + continue; + } + + __skb_queue_tail(&list, skb); + } + + while ((skb = __skb_dequeue(&list))) { + ath11k_dbg(ab, ATH11K_DBG_CE, "tx ce pipe %d len %d\n", + pipe->pipe_num, skb->len); + pipe->send_cb(ab, skb); + } +} + +static void ath11k_ce_srng_msi_ring_params_setup(struct ath11k_base *ab, u32 ce_id, + struct hal_srng_params *ring_params) +{ + u32 msi_data_start; + u32 msi_data_count, msi_data_idx; + u32 msi_irq_start; + u32 addr_lo; + u32 addr_hi; + int ret; + + ret = ath11k_get_user_msi_vector(ab, "CE", + &msi_data_count, &msi_data_start, + &msi_irq_start); + + if (ret) + return; + + ath11k_get_msi_address(ab, &addr_lo, &addr_hi); + ath11k_get_ce_msi_idx(ab, ce_id, &msi_data_idx); + + ring_params->msi_addr = addr_lo; + ring_params->msi_addr |= (dma_addr_t)(((uint64_t)addr_hi) << 32); + ring_params->msi_data = (msi_data_idx % msi_data_count) + msi_data_start; + ring_params->flags |= HAL_SRNG_FLAGS_MSI_INTR; +} + +static int ath11k_ce_init_ring(struct ath11k_base *ab, + struct ath11k_ce_ring *ce_ring, + int ce_id, enum hal_ring_type type) +{ + struct hal_srng_params params = {}; + int ret; + + params.ring_base_paddr = ce_ring->base_addr_ce_space; + params.ring_base_vaddr = ce_ring->base_addr_owner_space; + params.num_entries = ce_ring->nentries; + + if (!(CE_ATTR_DIS_INTR & ab->hw_params.host_ce_config[ce_id].flags)) + ath11k_ce_srng_msi_ring_params_setup(ab, ce_id, ¶ms); + + switch (type) { + case HAL_CE_SRC: + if (!(CE_ATTR_DIS_INTR & ab->hw_params.host_ce_config[ce_id].flags)) + params.intr_batch_cntr_thres_entries = 1; + break; + case HAL_CE_DST: + params.max_buffer_len = ab->hw_params.host_ce_config[ce_id].src_sz_max; + if (!(ab->hw_params.host_ce_config[ce_id].flags & CE_ATTR_DIS_INTR)) { + params.intr_timer_thres_us = 1024; + params.flags |= HAL_SRNG_FLAGS_LOW_THRESH_INTR_EN; + params.low_threshold = ce_ring->nentries - 3; + } + break; + case HAL_CE_DST_STATUS: + if (!(ab->hw_params.host_ce_config[ce_id].flags & CE_ATTR_DIS_INTR)) { + params.intr_batch_cntr_thres_entries = 1; + params.intr_timer_thres_us = 0x1000; + } + break; + default: + ath11k_warn(ab, "Invalid CE ring type %d\n", type); + return -EINVAL; + } + + /* TODO: Init other params needed by HAL to init the ring */ + + ret = ath11k_hal_srng_setup(ab, type, ce_id, 0, ¶ms); + if (ret < 0) { + ath11k_warn(ab, "failed to setup srng: %d ring_id %d\n", + ret, ce_id); + return ret; + } + + ce_ring->hal_ring_id = ret; + + if (ab->hw_params.supports_shadow_regs && + ath11k_ce_need_shadow_fix(ce_id)) + ath11k_dp_shadow_init_timer(ab, &ab->ce.hp_timer[ce_id], + ATH11K_SHADOW_CTRL_TIMER_INTERVAL, + ce_ring->hal_ring_id); + + return 0; +} + +static struct ath11k_ce_ring * +ath11k_ce_alloc_ring(struct ath11k_base *ab, int nentries, int desc_sz) +{ + struct ath11k_ce_ring *ce_ring; + dma_addr_t base_addr; + - ce_ring = kzalloc(struct_size(ce_ring, skb, nentries), GFP_KERNEL); ++ ce_ring = kzalloc_flex(*ce_ring, skb, nentries); + if (ce_ring == NULL) + return ERR_PTR(-ENOMEM); + + ce_ring->nentries = nentries; + ce_ring->nentries_mask = nentries - 1; + + /* Legacy platforms that do not support cache + * coherent DMA are unsupported + */ + ce_ring->base_addr_owner_space_unaligned = + dma_alloc_coherent(ab->dev, + nentries * desc_sz + CE_DESC_RING_ALIGN, + &base_addr, GFP_KERNEL); + if (!ce_ring->base_addr_owner_space_unaligned) { + kfree(ce_ring); + return ERR_PTR(-ENOMEM); + } + + ce_ring->base_addr_ce_space_unaligned = base_addr; + + ce_ring->base_addr_owner_space = PTR_ALIGN( + ce_ring->base_addr_owner_space_unaligned, + CE_DESC_RING_ALIGN); + ce_ring->base_addr_ce_space = ALIGN( + ce_ring->base_addr_ce_space_unaligned, + CE_DESC_RING_ALIGN); + + return ce_ring; +} + +static int ath11k_ce_alloc_pipe(struct ath11k_base *ab, int ce_id) +{ + struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[ce_id]; + const struct ce_attr *attr = &ab->hw_params.host_ce_config[ce_id]; + struct ath11k_ce_ring *ring; + int nentries; + int desc_sz; + + pipe->attr_flags = attr->flags; + + if (attr->src_nentries) { + pipe->send_cb = attr->send_cb; + nentries = roundup_pow_of_two(attr->src_nentries); + desc_sz = ath11k_hal_ce_get_desc_size(HAL_CE_DESC_SRC); + ring = ath11k_ce_alloc_ring(ab, nentries, desc_sz); + if (IS_ERR(ring)) + return PTR_ERR(ring); + pipe->src_ring = ring; + } + + if (attr->dest_nentries) { + pipe->recv_cb = attr->recv_cb; + nentries = roundup_pow_of_two(attr->dest_nentries); + desc_sz = ath11k_hal_ce_get_desc_size(HAL_CE_DESC_DST); + ring = ath11k_ce_alloc_ring(ab, nentries, desc_sz); + if (IS_ERR(ring)) + return PTR_ERR(ring); + pipe->dest_ring = ring; + + desc_sz = ath11k_hal_ce_get_desc_size(HAL_CE_DESC_DST_STATUS); + ring = ath11k_ce_alloc_ring(ab, nentries, desc_sz); + if (IS_ERR(ring)) + return PTR_ERR(ring); + pipe->status_ring = ring; + } + + return 0; +} + +void ath11k_ce_per_engine_service(struct ath11k_base *ab, u16 ce_id) +{ + struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[ce_id]; + const struct ce_attr *attr = &ab->hw_params.host_ce_config[ce_id]; + + if (attr->src_nentries) + ath11k_ce_tx_process_cb(pipe); + + if (pipe->recv_cb) + ath11k_ce_recv_process_cb(pipe); +} + +void ath11k_ce_poll_send_completed(struct ath11k_base *ab, u8 pipe_id) +{ + struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[pipe_id]; + const struct ce_attr *attr = &ab->hw_params.host_ce_config[pipe_id]; + + if ((pipe->attr_flags & CE_ATTR_DIS_INTR) && attr->src_nentries) + ath11k_ce_tx_process_cb(pipe); +} +EXPORT_SYMBOL(ath11k_ce_per_engine_service); + +int ath11k_ce_send(struct ath11k_base *ab, struct sk_buff *skb, u8 pipe_id, + u16 transfer_id) +{ + struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[pipe_id]; + struct hal_srng *srng; + u32 *desc; + unsigned int write_index, sw_index; + unsigned int nentries_mask; + int ret = 0; + u8 byte_swap_data = 0; + int num_used; + + /* Check if some entries could be regained by handling tx completion if + * the CE has interrupts disabled and the used entries is more than the + * defined usage threshold. + */ + if (pipe->attr_flags & CE_ATTR_DIS_INTR) { + spin_lock_bh(&ab->ce.ce_lock); + write_index = pipe->src_ring->write_index; + + sw_index = pipe->src_ring->sw_index; + + if (write_index >= sw_index) + num_used = write_index - sw_index; + else + num_used = pipe->src_ring->nentries - sw_index + + write_index; + + spin_unlock_bh(&ab->ce.ce_lock); + + if (num_used > ATH11K_CE_USAGE_THRESHOLD) + ath11k_ce_poll_send_completed(ab, pipe->pipe_num); + } + + if (test_bit(ATH11K_FLAG_CRASH_FLUSH, &ab->dev_flags)) + return -ESHUTDOWN; + + spin_lock_bh(&ab->ce.ce_lock); + + write_index = pipe->src_ring->write_index; + nentries_mask = pipe->src_ring->nentries_mask; + + srng = &ab->hal.srng_list[pipe->src_ring->hal_ring_id]; + + spin_lock_bh(&srng->lock); + + ath11k_hal_srng_access_begin(ab, srng); + + if (unlikely(ath11k_hal_srng_src_num_free(ab, srng, false) < 1)) { + ath11k_hal_srng_access_end(ab, srng); + ret = -ENOBUFS; + goto err_unlock; + } + + desc = ath11k_hal_srng_src_get_next_reaped(ab, srng); + if (!desc) { + ath11k_hal_srng_access_end(ab, srng); + ret = -ENOBUFS; + goto err_unlock; + } + + if (pipe->attr_flags & CE_ATTR_BYTE_SWAP_DATA) + byte_swap_data = 1; + + ath11k_hal_ce_src_set_desc(desc, ATH11K_SKB_CB(skb)->paddr, + skb->len, transfer_id, byte_swap_data); + + pipe->src_ring->skb[write_index] = skb; + pipe->src_ring->write_index = CE_RING_IDX_INCR(nentries_mask, + write_index); + + ath11k_hal_srng_access_end(ab, srng); + + if (ath11k_ce_need_shadow_fix(pipe_id)) + ath11k_dp_shadow_start_timer(ab, srng, &ab->ce.hp_timer[pipe_id]); + + spin_unlock_bh(&srng->lock); + + spin_unlock_bh(&ab->ce.ce_lock); + + return 0; + +err_unlock: + spin_unlock_bh(&srng->lock); + + spin_unlock_bh(&ab->ce.ce_lock); + + return ret; +} + +static void ath11k_ce_rx_pipe_cleanup(struct ath11k_ce_pipe *pipe) +{ + struct ath11k_base *ab = pipe->ab; + struct ath11k_ce_ring *ring = pipe->dest_ring; + struct sk_buff *skb; + int i; + + if (!(ring && pipe->buf_sz)) + return; + + for (i = 0; i < ring->nentries; i++) { + skb = ring->skb[i]; + if (!skb) + continue; + + ring->skb[i] = NULL; + dma_unmap_single(ab->dev, ATH11K_SKB_RXCB(skb)->paddr, + skb->len + skb_tailroom(skb), DMA_FROM_DEVICE); + dev_kfree_skb_any(skb); + } +} + +static void ath11k_ce_shadow_config(struct ath11k_base *ab) +{ + int i; + + for (i = 0; i < ab->hw_params.ce_count; i++) { + if (ab->hw_params.host_ce_config[i].src_nentries) + ath11k_hal_srng_update_shadow_config(ab, + HAL_CE_SRC, i); + + if (ab->hw_params.host_ce_config[i].dest_nentries) { + ath11k_hal_srng_update_shadow_config(ab, + HAL_CE_DST, i); + + ath11k_hal_srng_update_shadow_config(ab, + HAL_CE_DST_STATUS, i); + } + } +} + +void ath11k_ce_get_shadow_config(struct ath11k_base *ab, + u32 **shadow_cfg, u32 *shadow_cfg_len) +{ + if (!ab->hw_params.supports_shadow_regs) + return; + + ath11k_hal_srng_get_shadow_config(ab, shadow_cfg, shadow_cfg_len); + + /* shadow is already configured */ + if (*shadow_cfg_len) + return; + + /* shadow isn't configured yet, configure now. + * non-CE srngs are configured firstly, then + * all CE srngs. + */ + ath11k_hal_srng_shadow_config(ab); + ath11k_ce_shadow_config(ab); + + /* get the shadow configuration */ + ath11k_hal_srng_get_shadow_config(ab, shadow_cfg, shadow_cfg_len); +} +EXPORT_SYMBOL(ath11k_ce_get_shadow_config); + +void ath11k_ce_cleanup_pipes(struct ath11k_base *ab) +{ + struct ath11k_ce_pipe *pipe; + int pipe_num; + + ath11k_ce_stop_shadow_timers(ab); + + for (pipe_num = 0; pipe_num < ab->hw_params.ce_count; pipe_num++) { + pipe = &ab->ce.ce_pipe[pipe_num]; + ath11k_ce_rx_pipe_cleanup(pipe); + + /* Cleanup any src CE's which have interrupts disabled */ + ath11k_ce_poll_send_completed(ab, pipe_num); + + /* NOTE: Should we also clean up tx buffer in all pipes? */ + } +} +EXPORT_SYMBOL(ath11k_ce_cleanup_pipes); + +void ath11k_ce_rx_post_buf(struct ath11k_base *ab) +{ *** 38776 LINES SKIPPED *** From nobody Sun Apr 19 15:30:36 2026 X-Original-To: dev-commits-src-main@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 4fzCHd1XtFz677PP for ; Sun, 19 Apr 2026 15:30: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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fzCHc4NMsz49c3 for ; Sun, 19 Apr 2026 15:30:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776612636; 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=EjFDBFeLb9eaN0Ts3nEaqgDllGM5vjNhVCIx4Sty0a4=; b=KPTS0tTGYJpTodrltwSVW9mYyu8PO6XGVgF9SRHLa4OJ6szIHmvCEw8b/+oIQPAyNvr9QR 2El9wAT27gMr3P9aiVkHH4saxEmwtAEVExhA9vbO0HtEIDmsH0Z4nUh7Jv222dTS5aLAR9 AsCvZshggQzG92QFngKaqcHqbJ/wIBu0jkq6nUhK1Y4ooE6QD5SBa/+S5KLSwmnWm8h8vo pXIuAni3AePgEyCmx8paFXut8bhxfjrbXIOOVWCUPfgTbKXKI2shFn0bjabudfW1K09LNv wBX25dJeTC4lH1p5nttN7wv+YHFeMZ3FKaaE3U0MBmbC/S9XokXQv25f0mmyVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776612636; a=rsa-sha256; cv=none; b=jSvB3DEmQOnzjhMMclipgSk+4/UzfuxONTa/NUzC79gyECpiaysyzAm8SzN8lRAhla8OYr yo2pm11lVEWSY3F/Otnsw9FUzd+PXs0gGS+6Bt5VLmlyXDl1XEOt9O4CajdxN7Xygr1xuM N8cQNX8zceSh/zQvnEdR7yiYSBmWIMY37zxCLIdAKs/cHJPPM8RcvsS8iGsfqw9oTDi6vU HiSG2WeBSLVxRWyZpxf+8iodYeUQZ0EaslES211s56A8vAfuSCdqQ1G5fWbhQ4/f6RnLWt AsIbUouThNGsZKGtEetEF3MLMOowT5iyqGz0/7Gd3GR1fXBcWoRXBdMr0wLwQQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776612636; 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=EjFDBFeLb9eaN0Ts3nEaqgDllGM5vjNhVCIx4Sty0a4=; b=Mo+BHd+50+tRuFmGqld7/29mgt6Jm5GxFD1fabt0uKZ0HEXCIHIREHKFR+lWP82VrCzNvq aoIbb+gO5CtecTtoTI2Sr6DpLmEuGHQ0IsfUo8wL0PfwRdSv4F4xZWf9A1P9JctyzjPc0b 4JdC4adLnedjFrd/7uYFbPYPYZlZtRuYqkMgyG7UepM+s5KRbhEKCrjWUx8fQPXApn6paN XG4zzmYZO5ek4HnxG2c8BMWzNP8xYgEdtgaTa8vkcTzyfR9dlpVzpDDhz1iR9WPu7gvkNb nNhMwJ1EnHx9SenybtsThwXmHtPuTuoqgHdTuY0nMW7+GnN7JLhuTwyCh4JHsg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fzCHc3Q3Dz1Xv for ; Sun, 19 Apr 2026 15:30:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 329dc by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 15:30:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 20cf11812ac7 - main - ath11k: update module Makefiles for v7.0 driver version List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 20cf11812ac722852322f2f2994698d7a5fa8dc6 Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 15:30:36 +0000 Message-Id: <69e4f51c.329dc.413fab22@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=20cf11812ac722852322f2f2994698d7a5fa8dc6 commit 20cf11812ac722852322f2f2994698d7a5fa8dc6 Author: Bjoern A. Zeeb AuthorDate: 2026-04-19 15:28:50 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-19 15:30:08 +0000 ath11k: update module Makefiles for v7.0 driver version Update LINUXKPI_VERSION to reflect that the driver is based on Linux v7.0. Add optional support for the new cfr (channel frequency response) file/option. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/modules/ath11k/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/modules/ath11k/Makefile b/sys/modules/ath11k/Makefile index b1eb2422cc3d..a2f0064c2ae9 100644 --- a/sys/modules/ath11k/Makefile +++ b/sys/modules/ath11k/Makefile @@ -5,6 +5,7 @@ DEVATH11KDIR= ${SRCTOP}/sys/contrib/dev/athk/ath11k ATH11K_PCI= 1 ATH11K_AHB= 0 +ATH11K_CFR= 0 ATH11K_DEBUGFS= 0 ATH11K_TRACE= 0 ATH11K_THERMAL= 0 @@ -31,6 +32,11 @@ SRCS+= ahb.c CFLAGS+= -DCONFIG_ATH11K_AHB .endif +.if defined(ATH11K_CFR) && ${ATH11K_CFR} > 0 +SRCS+= cfr.c +CFLAGS+= -DCONFIG_ATH11K_CFR +.endif + .if defined(ATH11K_DEBUGFS) && ${ATH11K_DEBUGFS} > 0 SRCS+= debugfs.c debugfs_htt_stats.c debugfs_sta.c CFLAGS+= -DCONFIG_ATH11K_DEBUGFS @@ -75,6 +81,6 @@ CFLAGS+= ${LINUXKPI_INCLUDES} CFLAGS+= -DCONFIG_ATH11K_DEBUG CFLAGS+= -DKBUILD_MODNAME='"ath11k"' -CFLAGS+= -DLINUXKPI_VERSION=61900 +CFLAGS+= -DLINUXKPI_VERSION=70000 .include From nobody Sun Apr 19 15:39:19 2026 X-Original-To: dev-commits-src-main@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 4fzCTh0RMzz678Qb for ; Sun, 19 Apr 2026 15:39:20 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fzCTg5kTMz3CRW for ; Sun, 19 Apr 2026 15:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776613159; 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=nIjvpdGmmeDGQw7srCOhn8sHJatwHNG6wXJEUQ5bWaE=; b=EKvxskqKV76Vqri69wfPXLcSTeZm/YzAFI2nBjgyR9fk22uRw4EUoDtrZNiSro/JuvEjVQ PWzRS0VJDRj6Qu9dkej/bTENAbVrqUSbg4sB/3iGj6XOiucSXS8N/8FMX1Rrlb8jTeSHbk aSWrOqJIKnORDgVCsCK68J+YrdRKT/Fq0DitfOp3f8h+epioUkrhhpsMLYkFqKyG/mIvy1 ugCClndGh26L51z+sf1KUQoq3wOzFI5+GZGgaLNslvODvo4jUhfo12MMsUMWMA6z3nlljE VaxSLOWJUYmxh+G4ZLwp++RoeS2KcbtlbNxjic1krpe4I/oD/459s0WYvFR/mA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776613159; a=rsa-sha256; cv=none; b=wS5Vjz30mKota1B+B4feJFaUMrXbooZ1oZ1Qv+ys6XAjUu3LFECkmXyifqOiP04i6KdZ3L PPg7vtNPKyCU4tNz/b4R5S0sfYfsKQqHTNC5BPuCQPns1ihYlHbwdwTTKJf9ZDhZR+pn1L 07B4Ddh9/CY7JPdSOvwr5IeahwTmZZZg8haUdY1bHKndw1gK2u4IO0JwuKcdZKpAvofLvK V31l7U9WYnuuNh49UWC6IeyAPvEDTKl2pN2hV811fdwFc3J6Rd3IKQrgKJIEiQgNjHb8Oy 2HIkfBrJUlHyueudMqBBZ8HSktYkbLh4koeHXspRH7J2El8BWdGCwbP7Do0S2Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776613159; 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=nIjvpdGmmeDGQw7srCOhn8sHJatwHNG6wXJEUQ5bWaE=; b=e2pxBlH0XFZoVJaxQpsrz9WF9W94n8NGbQScYVZySfpmrVnpsUVnGJulgJpg5cBqlJKDYl Mqr2h1sZjfLXAMfybzJE/OJED0qCadNqmTu6INplQFb3dUlI/tzx5UnuXSdFBgf3l5uYVP MaW6nmQFoToqNAxxo1GgtG1CnEEWDpl+PjF5kE3PVUCVsrROskpu+ZAEq4Jeh27V6ydkgS LNz0I5pwDgv0JJTlyEVnl4t0UN4FGq4LBuM8SB5SFCigmPKsbaEJVFDBWYt4ws5mMzKsVP FSexnAAHuNpf834xZEYnUkBcqwim/0gtb+PPBYaNyzLAUCO4o5mmRUG26uRXKw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fzCTg5B42z2Qs for ; Sun, 19 Apr 2026 15:39:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 314f7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 15:39:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 60bac4d6438b - main - ath12k: update Atheros/QCA's ath12k driver List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 60bac4d6438b6bcb3d7b439684211d05396d90ce Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 15:39:19 +0000 Message-Id: <69e4f727.314f7.4c24b36c@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=60bac4d6438b6bcb3d7b439684211d05396d90ce commit 60bac4d6438b6bcb3d7b439684211d05396d90ce Merge: 20cf11812ac7 80f1906e3b91 Author: Bjoern A. Zeeb AuthorDate: 2026-04-19 15:38:33 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-19 15:38:33 +0000 ath12k: update Atheros/QCA's ath12k driver This version is based on git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 028ef9c96e96197026887c0f092424679298aae8 ( tag: v7.0 ). Sponsored by: The FreeBSD Foundation MFC after: 3 days sys/contrib/dev/athk/ath12k/Makefile | 8 +- sys/contrib/dev/athk/ath12k/ahb.c | 165 +- sys/contrib/dev/athk/ath12k/ahb.h | 31 +- sys/contrib/dev/athk/ath12k/ce.c | 328 +- sys/contrib/dev/athk/ath12k/ce.h | 7 +- sys/contrib/dev/athk/ath12k/cmn_defs.h | 20 + sys/contrib/dev/athk/ath12k/core.c | 77 +- sys/contrib/dev/athk/ath12k/core.h | 209 +- sys/contrib/dev/athk/ath12k/dbring.c | 6 +- sys/contrib/dev/athk/ath12k/debug.c | 8 +- sys/contrib/dev/athk/ath12k/debugfs.c | 8 +- sys/contrib/dev/athk/ath12k/debugfs_htt_stats.c | 197 +- sys/contrib/dev/athk/ath12k/debugfs_htt_stats.h | 85 +- sys/contrib/dev/athk/ath12k/debugfs_sta.c | 62 +- sys/contrib/dev/athk/ath12k/dp.c | 586 +--- sys/contrib/dev/athk/ath12k/dp.h | 1746 ++-------- sys/contrib/dev/athk/ath12k/dp_cmn.h | 106 + sys/contrib/dev/athk/ath12k/dp_htt.c | 1353 +++++++ sys/contrib/dev/athk/ath12k/dp_htt.h | 1546 ++++++++ sys/contrib/dev/athk/ath12k/dp_mon.c | 3685 +------------------- sys/contrib/dev/athk/ath12k/dp_mon.h | 58 +- sys/contrib/dev/athk/ath12k/dp_peer.c | 690 ++++ sys/contrib/dev/athk/ath12k/dp_peer.h | 182 + sys/contrib/dev/athk/ath12k/dp_rx.c | 3544 ++----------------- sys/contrib/dev/athk/ath12k/dp_rx.h | 191 +- sys/contrib/dev/athk/ath12k/dp_tx.c | 1634 +-------- sys/contrib/dev/athk/ath12k/dp_tx.h | 39 +- sys/contrib/dev/athk/ath12k/fw.c | 10 +- sys/contrib/dev/athk/ath12k/fw.h | 3 +- sys/contrib/dev/athk/ath12k/hal.c | 2147 +----------- sys/contrib/dev/athk/ath12k/hal.h | 1523 +++++--- sys/contrib/dev/athk/ath12k/htc.c | 3 +- sys/contrib/dev/athk/ath12k/hw.c | 1680 --------- sys/contrib/dev/athk/ath12k/hw.h | 96 +- sys/contrib/dev/athk/ath12k/mac.c | 1294 ++++--- sys/contrib/dev/athk/ath12k/mac.h | 142 +- sys/contrib/dev/athk/ath12k/mhi.c | 134 +- sys/contrib/dev/athk/ath12k/mhi.h | 5 +- sys/contrib/dev/athk/ath12k/pci.c | 261 +- sys/contrib/dev/athk/ath12k/pci.h | 49 +- sys/contrib/dev/athk/ath12k/peer.c | 453 +-- sys/contrib/dev/athk/ath12k/peer.h | 112 +- sys/contrib/dev/athk/ath12k/qmi.c | 192 +- sys/contrib/dev/athk/ath12k/qmi.h | 16 + sys/contrib/dev/athk/ath12k/reg.c | 2 +- sys/contrib/dev/athk/ath12k/testmode.c | 3 +- sys/contrib/dev/athk/ath12k/wifi7/Makefile | 20 + sys/contrib/dev/athk/ath12k/wifi7/ahb.c | 75 + sys/contrib/dev/athk/ath12k/wifi7/ahb.h | 20 + sys/contrib/dev/athk/ath12k/wifi7/ce.c | 973 ++++++ sys/contrib/dev/athk/ath12k/wifi7/ce.h | 22 + sys/contrib/dev/athk/ath12k/wifi7/core.c | 68 + sys/contrib/dev/athk/ath12k/wifi7/core.h | 11 + sys/contrib/dev/athk/ath12k/wifi7/dp.c | 181 + sys/contrib/dev/athk/ath12k/wifi7/dp.h | 20 + sys/contrib/dev/athk/ath12k/wifi7/dp_mon.c | 3385 ++++++++++++++++++ sys/contrib/dev/athk/ath12k/wifi7/dp_mon.h | 23 + sys/contrib/dev/athk/ath12k/wifi7/dp_rx.c | 2246 ++++++++++++ sys/contrib/dev/athk/ath12k/wifi7/dp_rx.h | 60 + sys/contrib/dev/athk/ath12k/wifi7/dp_tx.c | 978 ++++++ sys/contrib/dev/athk/ath12k/wifi7/dp_tx.h | 16 + sys/contrib/dev/athk/ath12k/wifi7/hal.c | 713 ++++ sys/contrib/dev/athk/ath12k/wifi7/hal.h | 561 +++ sys/contrib/dev/athk/ath12k/{ => wifi7}/hal_desc.h | 331 +- sys/contrib/dev/athk/ath12k/wifi7/hal_qcc2072.c | 503 +++ sys/contrib/dev/athk/ath12k/wifi7/hal_qcc2072.h | 13 + sys/contrib/dev/athk/ath12k/wifi7/hal_qcn9274.c | 1038 ++++++ sys/contrib/dev/athk/ath12k/wifi7/hal_qcn9274.h | 45 + sys/contrib/dev/athk/ath12k/{ => wifi7}/hal_rx.c | 284 +- sys/contrib/dev/athk/ath12k/{ => wifi7}/hal_rx.h | 424 +-- .../athk/ath12k/{rx_desc.h => wifi7/hal_rx_desc.h} | 72 +- sys/contrib/dev/athk/ath12k/{ => wifi7}/hal_tx.c | 23 +- sys/contrib/dev/athk/ath12k/{ => wifi7}/hal_tx.h | 30 +- sys/contrib/dev/athk/ath12k/wifi7/hal_wcn7850.c | 809 +++++ sys/contrib/dev/athk/ath12k/wifi7/hal_wcn7850.h | 40 + sys/contrib/dev/athk/ath12k/wifi7/hw.c | 1049 ++++++ sys/contrib/dev/athk/ath12k/wifi7/hw.h | 13 + sys/contrib/dev/athk/ath12k/wifi7/mhi.c | 134 + sys/contrib/dev/athk/ath12k/wifi7/mhi.h | 11 + sys/contrib/dev/athk/ath12k/wifi7/pci.c | 215 ++ sys/contrib/dev/athk/ath12k/wifi7/pci.h | 12 + sys/contrib/dev/athk/ath12k/wifi7/wmi.c | 110 + sys/contrib/dev/athk/ath12k/wifi7/wmi.h | 15 + sys/contrib/dev/athk/ath12k/wmi.c | 383 +- sys/contrib/dev/athk/ath12k/wmi.h | 61 +- sys/contrib/dev/athk/ath12k/wow.c | 27 +- 86 files changed, 22058 insertions(+), 17652 deletions(-) diff --cc sys/contrib/dev/athk/ath12k/Makefile index d95ee525a6cd,000000000000..3ba1236956cc mode 100644,000000..100644 --- a/sys/contrib/dev/athk/ath12k/Makefile +++ b/sys/contrib/dev/athk/ath12k/Makefile @@@ -1,35 -1,0 +1,37 @@@ +# SPDX-License-Identifier: BSD-3-Clause-Clear +obj-$(CONFIG_ATH12K) += ath12k.o +ath12k-y += core.o \ + hal.o \ - hal_tx.o \ - hal_rx.o \ + wmi.o \ + mac.o \ + reg.o \ + htc.o \ + qmi.o \ + dp.o \ + dp_tx.o \ + dp_rx.o \ ++ dp_htt.o \ ++ dp_peer.o \ + debug.o \ + ce.o \ + peer.o \ + dbring.o \ - hw.o \ + mhi.o \ + pci.o \ + dp_mon.o \ + fw.o \ + p2p.o + +ath12k-$(CONFIG_ATH12K_AHB) += ahb.o ++ ++obj-$(CONFIG_ATH12K) += wifi7/ ++ +ath12k-$(CONFIG_ATH12K_DEBUGFS) += debugfs.o debugfs_htt_stats.o debugfs_sta.o +ath12k-$(CONFIG_ACPI) += acpi.o +ath12k-$(CONFIG_ATH12K_TRACING) += trace.o +ath12k-$(CONFIG_PM) += wow.o +ath12k-$(CONFIG_ATH12K_COREDUMP) += coredump.o +ath12k-$(CONFIG_NL80211_TESTMODE) += testmode.o + +# for tracing framework to find trace.h +CFLAGS_trace.o := -I$(src) diff --cc sys/contrib/dev/athk/ath12k/cmn_defs.h index 000000000000,20208ffea1c9..20208ffea1c9 mode 000000,100644..100644 --- a/sys/contrib/dev/athk/ath12k/cmn_defs.h +++ b/sys/contrib/dev/athk/ath12k/cmn_defs.h diff --cc sys/contrib/dev/athk/ath12k/core.c index 9836d0aeba79,000000000000..1763b3b837e5 mode 100644,000000..100644 --- a/sys/contrib/dev/athk/ath12k/core.c +++ b/sys/contrib/dev/athk/ath12k/core.c @@@ -1,2344 -1,0 +1,2327 @@@ +// SPDX-License-Identifier: BSD-3-Clause-Clear +/* + * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. + */ + +#if defined(__FreeBSD__) +#define LINUXKPI_PARAM_PREFIX ath12k_core_ +#endif + +#include +#include +#include +#include +#include +#include +#if defined(__FreeBSD__) +#include +#endif +#include +#include "ahb.h" +#include "core.h" +#include "dp_tx.h" +#include "dp_rx.h" +#include "debug.h" +#include "debugfs.h" +#include "fw.h" +#include "hif.h" +#include "pci.h" +#include "wow.h" ++#include "dp_cmn.h" ++#include "peer.h" + - static int ahb_err, pci_err; +unsigned int ath12k_debug_mask; +module_param_named(debug_mask, ath12k_debug_mask, uint, 0644); +MODULE_PARM_DESC(debug_mask, "Debugging mask"); ++EXPORT_SYMBOL(ath12k_debug_mask); + +bool ath12k_ftm_mode; +module_param_named(ftm_mode, ath12k_ftm_mode, bool, 0444); +MODULE_PARM_DESC(ftm_mode, "Boots up in factory test mode"); ++EXPORT_SYMBOL(ath12k_ftm_mode); + +/* protected with ath12k_hw_group_mutex */ +static struct list_head ath12k_hw_group_list = LIST_HEAD_INIT(ath12k_hw_group_list); + +static DEFINE_MUTEX(ath12k_hw_group_mutex); + +static const struct +ath12k_mem_profile_based_param ath12k_mem_profile_based_param[] = { +[ATH12K_QMI_MEMORY_MODE_DEFAULT] = { + .num_vdevs = 17, + .max_client_single = 512, + .max_client_dbs = 128, + .max_client_dbs_sbs = 128, + .dp_params = { + .tx_comp_ring_size = 32768, + .rxdma_monitor_buf_ring_size = 4096, + .rxdma_monitor_dst_ring_size = 8092, + .num_pool_tx_desc = 32768, + .rx_desc_count = 12288, + }, + }, +[ATH12K_QMI_MEMORY_MODE_LOW_512_M] = { + .num_vdevs = 9, + .max_client_single = 128, + .max_client_dbs = 64, + .max_client_dbs_sbs = 64, + .dp_params = { + .tx_comp_ring_size = 16384, + .rxdma_monitor_buf_ring_size = 256, + .rxdma_monitor_dst_ring_size = 512, + .num_pool_tx_desc = 16384, + .rx_desc_count = 6144, + }, + }, +}; + +static int ath12k_core_rfkill_config(struct ath12k_base *ab) +{ + struct ath12k *ar; + int ret = 0, i; + + if (!(ab->target_caps.sys_cap_info & WMI_SYS_CAP_INFO_RFKILL)) + return 0; + + if (ath12k_acpi_get_disable_rfkill(ab)) + return 0; + + for (i = 0; i < ab->num_radios; i++) { + ar = ab->pdevs[i].ar; + + ret = ath12k_mac_rfkill_config(ar); + if (ret && ret != -EOPNOTSUPP) { + ath12k_warn(ab, "failed to configure rfkill: %d", ret); + return ret; + } + } + + return ret; +} + +/* Check if we need to continue with suspend/resume operation. + * Return: + * a negative value: error happens and don't continue. + * 0: no error but don't continue. + * positive value: no error and do continue. + */ +static int ath12k_core_continue_suspend_resume(struct ath12k_base *ab) +{ + struct ath12k *ar; + + if (!ab->hw_params->supports_suspend) + return -EOPNOTSUPP; + + /* so far single_pdev_only chips have supports_suspend as true + * so pass 0 as a dummy pdev_id here. + */ + ar = ab->pdevs[0].ar; + if (!ar || !ar->ah || ar->ah->state != ATH12K_HW_STATE_OFF) + return 0; + + return 1; +} + +int ath12k_core_suspend(struct ath12k_base *ab) +{ + struct ath12k *ar; + int ret, i; + + ret = ath12k_core_continue_suspend_resume(ab); + if (ret <= 0) + return ret; + + for (i = 0; i < ab->num_radios; i++) { + ar = ab->pdevs[i].ar; + if (!ar) + continue; + + wiphy_lock(ath12k_ar_to_hw(ar)->wiphy); + + ret = ath12k_mac_wait_tx_complete(ar); + if (ret) { + wiphy_unlock(ath12k_ar_to_hw(ar)->wiphy); + ath12k_warn(ab, "failed to wait tx complete: %d\n", ret); + return ret; + } + + wiphy_unlock(ath12k_ar_to_hw(ar)->wiphy); + } + + /* PM framework skips suspend_late/resume_early callbacks + * if other devices report errors in their suspend callbacks. + * However ath12k_core_resume() would still be called because + * here we return success thus kernel put us on dpm_suspended_list. + * Since we won't go through a power down/up cycle, there is + * no chance to call complete(&ab->restart_completed) in + * ath12k_core_restart(), making ath12k_core_resume() timeout. + * So call it here to avoid this issue. This also works in case + * no error happens thus suspend_late/resume_early get called, + * because it will be reinitialized in ath12k_core_resume_early(). + */ + complete(&ab->restart_completed); + + return 0; +} +EXPORT_SYMBOL(ath12k_core_suspend); + +int ath12k_core_suspend_late(struct ath12k_base *ab) +{ + int ret; + + ret = ath12k_core_continue_suspend_resume(ab); + if (ret <= 0) + return ret; + + ath12k_acpi_stop(ab); + + ath12k_hif_irq_disable(ab); + ath12k_hif_ce_irq_disable(ab); + + ath12k_hif_power_down(ab, true); + + return 0; +} +EXPORT_SYMBOL(ath12k_core_suspend_late); + +int ath12k_core_resume_early(struct ath12k_base *ab) +{ + int ret; + + ret = ath12k_core_continue_suspend_resume(ab); + if (ret <= 0) + return ret; + + reinit_completion(&ab->restart_completed); + ret = ath12k_hif_power_up(ab); + if (ret) + ath12k_warn(ab, "failed to power up hif during resume: %d\n", ret); + + return ret; +} +EXPORT_SYMBOL(ath12k_core_resume_early); + +int ath12k_core_resume(struct ath12k_base *ab) +{ + long time_left; + int ret; + + ret = ath12k_core_continue_suspend_resume(ab); + if (ret <= 0) + return ret; + + time_left = wait_for_completion_timeout(&ab->restart_completed, + ATH12K_RESET_TIMEOUT_HZ); + if (time_left == 0) { + ath12k_warn(ab, "timeout while waiting for restart complete"); + return -ETIMEDOUT; + } + + return 0; +} +EXPORT_SYMBOL(ath12k_core_resume); + +static int __ath12k_core_create_board_name(struct ath12k_base *ab, char *name, + size_t name_len, bool with_variant, + bool bus_type_mode, bool with_default) +{ + /* strlen(',variant=') + strlen(ab->qmi.target.bdf_ext) */ + char variant[9 + ATH12K_QMI_BDF_EXT_STR_LENGTH] = {}; + + if (with_variant && ab->qmi.target.bdf_ext[0] != '\0') + scnprintf(variant, sizeof(variant), ",variant=%s", + ab->qmi.target.bdf_ext); + + switch (ab->id.bdf_search) { + case ATH12K_BDF_SEARCH_BUS_AND_BOARD: + if (bus_type_mode) + scnprintf(name, name_len, + "bus=%s", + ath12k_bus_str(ab->hif.bus)); + else + scnprintf(name, name_len, + "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x,qmi-chip-id=%d,qmi-board-id=%d%s", + ath12k_bus_str(ab->hif.bus), + ab->id.vendor, ab->id.device, + ab->id.subsystem_vendor, + ab->id.subsystem_device, + ab->qmi.target.chip_id, + ab->qmi.target.board_id, + variant); + break; + default: + scnprintf(name, name_len, + "bus=%s,qmi-chip-id=%d,qmi-board-id=%d%s", + ath12k_bus_str(ab->hif.bus), + ab->qmi.target.chip_id, + with_default ? + ATH12K_BOARD_ID_DEFAULT : ab->qmi.target.board_id, + variant); + break; + } + + ath12k_dbg(ab, ATH12K_DBG_BOOT, "boot using board name '%s'\n", name); + + return 0; +} + +static int ath12k_core_create_board_name(struct ath12k_base *ab, char *name, + size_t name_len) +{ + return __ath12k_core_create_board_name(ab, name, name_len, true, false, false); +} + +static int ath12k_core_create_fallback_board_name(struct ath12k_base *ab, char *name, + size_t name_len) +{ + return __ath12k_core_create_board_name(ab, name, name_len, false, false, true); +} + +static int ath12k_core_create_bus_type_board_name(struct ath12k_base *ab, char *name, + size_t name_len) +{ + return __ath12k_core_create_board_name(ab, name, name_len, false, true, true); +} + +const struct firmware *ath12k_core_firmware_request(struct ath12k_base *ab, + const char *file) +{ + const struct firmware *fw; + char path[100]; + int ret; + + if (!file) + return ERR_PTR(-ENOENT); + + ath12k_core_create_firmware_path(ab, file, path, sizeof(path)); + + ret = firmware_request_nowarn(&fw, path, ab->dev); + if (ret) + return ERR_PTR(ret); + + ath12k_dbg(ab, ATH12K_DBG_BOOT, "boot firmware request %s size %zu\n", + path, fw->size); + + return fw; +} + +void ath12k_core_free_bdf(struct ath12k_base *ab, struct ath12k_board_data *bd) +{ + if (!IS_ERR(bd->fw)) + release_firmware(bd->fw); + + memset(bd, 0, sizeof(*bd)); +} + +static int ath12k_core_parse_bd_ie_board(struct ath12k_base *ab, + struct ath12k_board_data *bd, +#if defined(__linux__) + const void *buf, size_t buf_len, +#elif defined(__FreeBSD__) + const u8 *buf, size_t buf_len, +#endif + const char *boardname, + int ie_id, + int name_id, + int data_id) +{ + const struct ath12k_fw_ie *hdr; + bool name_match_found; + int ret, board_ie_id; + size_t board_ie_len; + const void *board_ie_data; + + name_match_found = false; + + /* go through ATH12K_BD_IE_BOARD_/ATH12K_BD_IE_REGDB_ elements */ + while (buf_len > sizeof(struct ath12k_fw_ie)) { +#if defined(__linux__) + hdr = buf; +#elif defined(__FreeBSD__) + hdr = (const struct ath12k_fw_ie *)buf; +#endif + board_ie_id = le32_to_cpu(hdr->id); + board_ie_len = le32_to_cpu(hdr->len); + board_ie_data = hdr->data; + + buf_len -= sizeof(*hdr); + buf += sizeof(*hdr); + + if (buf_len < ALIGN(board_ie_len, 4)) { + ath12k_err(ab, "invalid %s length: %zu < %zu\n", + ath12k_bd_ie_type_str(ie_id), + buf_len, ALIGN(board_ie_len, 4)); + ret = -EINVAL; + goto out; + } + + if (board_ie_id == name_id) { + ath12k_dbg_dump(ab, ATH12K_DBG_BOOT, "board name", "", + board_ie_data, board_ie_len); + + if (board_ie_len != strlen(boardname)) + goto next; + + ret = memcmp(board_ie_data, boardname, strlen(boardname)); + if (ret) + goto next; + + name_match_found = true; + ath12k_dbg(ab, ATH12K_DBG_BOOT, + "boot found match %s for name '%s'", + ath12k_bd_ie_type_str(ie_id), + boardname); + } else if (board_ie_id == data_id) { + if (!name_match_found) + /* no match found */ + goto next; + + ath12k_dbg(ab, ATH12K_DBG_BOOT, + "boot found %s for '%s'", + ath12k_bd_ie_type_str(ie_id), + boardname); + + bd->data = board_ie_data; + bd->len = board_ie_len; + + ret = 0; + goto out; + } else { + ath12k_warn(ab, "unknown %s id found: %d\n", + ath12k_bd_ie_type_str(ie_id), + board_ie_id); + } +next: + /* jump over the padding */ + board_ie_len = ALIGN(board_ie_len, 4); + + buf_len -= board_ie_len; + buf += board_ie_len; + } + + /* no match found */ + ret = -ENOENT; + +out: + return ret; +} + +static int ath12k_core_fetch_board_data_api_n(struct ath12k_base *ab, + struct ath12k_board_data *bd, + const char *boardname, + int ie_id_match, + int name_id, + int data_id) +{ + size_t len, magic_len; + const u8 *data; + char *filename, filepath[100]; + size_t ie_len; +#if defined(__linux__) + struct ath12k_fw_ie *hdr; +#elif defined(__FreeBSD__) + const struct ath12k_fw_ie *hdr; +#endif + int ret, ie_id; + + filename = ATH12K_BOARD_API2_FILE; + + if (!bd->fw) + bd->fw = ath12k_core_firmware_request(ab, filename); + + if (IS_ERR(bd->fw)) + return PTR_ERR(bd->fw); + + data = bd->fw->data; + len = bd->fw->size; + + ath12k_core_create_firmware_path(ab, filename, + filepath, sizeof(filepath)); + + /* magic has extra null byte padded */ + magic_len = strlen(ATH12K_BOARD_MAGIC) + 1; + if (len < magic_len) { + ath12k_err(ab, "failed to find magic value in %s, file too short: %zu\n", + filepath, len); + ret = -EINVAL; + goto err; + } + + if (memcmp(data, ATH12K_BOARD_MAGIC, magic_len)) { + ath12k_err(ab, "found invalid board magic\n"); + ret = -EINVAL; + goto err; + } + + /* magic is padded to 4 bytes */ + magic_len = ALIGN(magic_len, 4); + if (len < magic_len) { + ath12k_err(ab, "failed: %s too small to contain board data, len: %zu\n", + filepath, len); + ret = -EINVAL; + goto err; + } + + data += magic_len; + len -= magic_len; + + while (len > sizeof(struct ath12k_fw_ie)) { +#if defined(__linux__) + hdr = (struct ath12k_fw_ie *)data; +#elif defined(__FreeBSD__) + hdr = (const struct ath12k_fw_ie *)data; +#endif + ie_id = le32_to_cpu(hdr->id); + ie_len = le32_to_cpu(hdr->len); + + len -= sizeof(*hdr); + data = hdr->data; + + if (len < ALIGN(ie_len, 4)) { + ath12k_err(ab, "invalid length for board ie_id %d ie_len %zu len %zu\n", + ie_id, ie_len, len); + ret = -EINVAL; + goto err; + } + + if (ie_id == ie_id_match) { + ret = ath12k_core_parse_bd_ie_board(ab, bd, data, + ie_len, + boardname, + ie_id_match, + name_id, + data_id); + if (ret == -ENOENT) + /* no match found, continue */ + goto next; + else if (ret) + /* there was an error, bail out */ + goto err; + /* either found or error, so stop searching */ + goto out; + } +next: + /* jump over the padding */ + ie_len = ALIGN(ie_len, 4); + + len -= ie_len; + data += ie_len; + } + +out: + if (!bd->data || !bd->len) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, + "failed to fetch %s for %s from %s\n", + ath12k_bd_ie_type_str(ie_id_match), + boardname, filepath); + ret = -ENODATA; + goto err; + } + + return 0; + +err: + ath12k_core_free_bdf(ab, bd); + return ret; +} + +int ath12k_core_fetch_board_data_api_1(struct ath12k_base *ab, + struct ath12k_board_data *bd, + char *filename) +{ + bd->fw = ath12k_core_firmware_request(ab, filename); + if (IS_ERR(bd->fw)) + return PTR_ERR(bd->fw); + + bd->data = bd->fw->data; + bd->len = bd->fw->size; + + return 0; +} + +#define BOARD_NAME_SIZE 200 +int ath12k_core_fetch_bdf(struct ath12k_base *ab, struct ath12k_board_data *bd) +{ + char boardname[BOARD_NAME_SIZE], fallback_boardname[BOARD_NAME_SIZE]; + char *filename, filepath[100]; + int bd_api; + int ret; + + filename = ATH12K_BOARD_API2_FILE; + + ret = ath12k_core_create_board_name(ab, boardname, sizeof(boardname)); + if (ret) { + ath12k_err(ab, "failed to create board name: %d", ret); + return ret; + } + + bd_api = 2; + ret = ath12k_core_fetch_board_data_api_n(ab, bd, boardname, + ATH12K_BD_IE_BOARD, + ATH12K_BD_IE_BOARD_NAME, + ATH12K_BD_IE_BOARD_DATA); + if (!ret) + goto success; + + ret = ath12k_core_create_fallback_board_name(ab, fallback_boardname, + sizeof(fallback_boardname)); + if (ret) { + ath12k_err(ab, "failed to create fallback board name: %d", ret); + return ret; + } + + ret = ath12k_core_fetch_board_data_api_n(ab, bd, fallback_boardname, + ATH12K_BD_IE_BOARD, + ATH12K_BD_IE_BOARD_NAME, + ATH12K_BD_IE_BOARD_DATA); + if (!ret) + goto success; + + bd_api = 1; + ret = ath12k_core_fetch_board_data_api_1(ab, bd, ATH12K_DEFAULT_BOARD_FILE); + if (ret) { + ath12k_core_create_firmware_path(ab, filename, + filepath, sizeof(filepath)); + ath12k_err(ab, "failed to fetch board data for %s from %s\n", + boardname, filepath); + if (memcmp(boardname, fallback_boardname, strlen(boardname))) + ath12k_err(ab, "failed to fetch board data for %s from %s\n", + fallback_boardname, filepath); + + ath12k_err(ab, "failed to fetch board.bin from %s\n", + ab->hw_params->fw.dir); + return ret; + } + +success: + ath12k_dbg(ab, ATH12K_DBG_BOOT, "using board api %d\n", bd_api); + return 0; +} + +int ath12k_core_fetch_regdb(struct ath12k_base *ab, struct ath12k_board_data *bd) +{ + char boardname[BOARD_NAME_SIZE], default_boardname[BOARD_NAME_SIZE]; + int ret; + + ret = ath12k_core_create_board_name(ab, boardname, BOARD_NAME_SIZE); + if (ret) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, + "failed to create board name for regdb: %d", ret); + goto exit; + } + + ret = ath12k_core_fetch_board_data_api_n(ab, bd, boardname, + ATH12K_BD_IE_REGDB, + ATH12K_BD_IE_REGDB_NAME, + ATH12K_BD_IE_REGDB_DATA); + if (!ret) + goto exit; + + ret = ath12k_core_create_bus_type_board_name(ab, default_boardname, + BOARD_NAME_SIZE); + if (ret) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, + "failed to create default board name for regdb: %d", ret); + goto exit; + } + + ret = ath12k_core_fetch_board_data_api_n(ab, bd, default_boardname, + ATH12K_BD_IE_REGDB, + ATH12K_BD_IE_REGDB_NAME, + ATH12K_BD_IE_REGDB_DATA); + if (!ret) + goto exit; + + ret = ath12k_core_fetch_board_data_api_1(ab, bd, ATH12K_REGDB_FILE_NAME); + if (ret) + ath12k_dbg(ab, ATH12K_DBG_BOOT, "failed to fetch %s from %s\n", + ATH12K_REGDB_FILE_NAME, ab->hw_params->fw.dir); + +exit: + if (!ret) + ath12k_dbg(ab, ATH12K_DBG_BOOT, "fetched regdb\n"); + + return ret; +} + +u32 ath12k_core_get_max_station_per_radio(struct ath12k_base *ab) +{ + if (ab->num_radios == 2) + return TARGET_NUM_STATIONS(ab, DBS); + if (ab->num_radios == 3) + return TARGET_NUM_STATIONS(ab, DBS_SBS); + return TARGET_NUM_STATIONS(ab, SINGLE); +} + +u32 ath12k_core_get_max_peers_per_radio(struct ath12k_base *ab) +{ + return ath12k_core_get_max_station_per_radio(ab) + TARGET_NUM_VDEVS(ab); +} ++EXPORT_SYMBOL(ath12k_core_get_max_peers_per_radio); + +struct reserved_mem *ath12k_core_get_reserved_mem(struct ath12k_base *ab, + int index) +{ + struct device *dev = ab->dev; + struct reserved_mem *rmem; + struct device_node *node; + + node = of_parse_phandle(dev->of_node, "memory-region", index); + if (!node) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, + "failed to parse memory-region for index %d\n", index); + return NULL; + } + + rmem = of_reserved_mem_lookup(node); + of_node_put(node); + if (!rmem) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, + "unable to get memory-region for index %d\n", index); + return NULL; + } + + return rmem; +} + +static inline +void ath12k_core_to_group_ref_get(struct ath12k_base *ab) +{ + struct ath12k_hw_group *ag = ab->ag; + + lockdep_assert_held(&ag->mutex); + + if (ab->hw_group_ref) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, "core already attached to group %d\n", + ag->id); + return; + } + + ab->hw_group_ref = true; + ag->num_started++; + + ath12k_dbg(ab, ATH12K_DBG_BOOT, "core attached to group %d, num_started %d\n", + ag->id, ag->num_started); +} + +static inline +void ath12k_core_to_group_ref_put(struct ath12k_base *ab) +{ + struct ath12k_hw_group *ag = ab->ag; + + lockdep_assert_held(&ag->mutex); + + if (!ab->hw_group_ref) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, "core already de-attached from group %d\n", + ag->id); + return; + } + + ab->hw_group_ref = false; + ag->num_started--; + + ath12k_dbg(ab, ATH12K_DBG_BOOT, "core de-attached from group %d, num_started %d\n", + ag->id, ag->num_started); +} + +static void ath12k_core_stop(struct ath12k_base *ab) +{ ++ ath12k_link_sta_rhash_tbl_destroy(ab); ++ + ath12k_core_to_group_ref_put(ab); + + if (!test_bit(ATH12K_FLAG_CRASH_FLUSH, &ab->dev_flags)) + ath12k_qmi_firmware_stop(ab); + + ath12k_acpi_stop(ab); + + ath12k_dp_rx_pdev_reo_cleanup(ab); + ath12k_hif_stop(ab); + ath12k_wmi_detach(ab); - ath12k_dp_free(ab); ++ ath12k_dp_cmn_device_deinit(ath12k_ab_to_dp(ab)); + + /* De-Init of components as needed */ +} + +static void ath12k_core_check_cc_code_bdfext(const struct dmi_header *hdr, void *data) +{ + struct ath12k_base *ab = data; + const char *magic = ATH12K_SMBIOS_BDF_EXT_MAGIC; + struct ath12k_smbios_bdf *smbios = (struct ath12k_smbios_bdf *)hdr; + ssize_t copied; + size_t len; + int i; + + if (ab->qmi.target.bdf_ext[0] != '\0') + return; + + if (hdr->type != ATH12K_SMBIOS_BDF_EXT_TYPE) + return; + + if (hdr->length != ATH12K_SMBIOS_BDF_EXT_LENGTH) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, + "wrong smbios bdf ext type length (%d).\n", + hdr->length); + return; + } + + spin_lock_bh(&ab->base_lock); + + switch (smbios->country_code_flag) { + case ATH12K_SMBIOS_CC_ISO: + ab->new_alpha2[0] = u16_get_bits(smbios->cc_code >> 8, 0xff); + ab->new_alpha2[1] = u16_get_bits(smbios->cc_code, 0xff); + ath12k_dbg(ab, ATH12K_DBG_BOOT, "boot smbios cc_code %c%c\n", + ab->new_alpha2[0], ab->new_alpha2[1]); + break; + case ATH12K_SMBIOS_CC_WW: + ab->new_alpha2[0] = '0'; + ab->new_alpha2[1] = '0'; + ath12k_dbg(ab, ATH12K_DBG_BOOT, "boot smbios worldwide regdomain\n"); + break; + default: + ath12k_dbg(ab, ATH12K_DBG_BOOT, "boot ignore smbios country code setting %d\n", + smbios->country_code_flag); + break; + } + + spin_unlock_bh(&ab->base_lock); + + if (!smbios->bdf_enabled) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, "bdf variant name not found.\n"); + return; + } + + /* Only one string exists (per spec) */ + if (memcmp(smbios->bdf_ext, magic, strlen(magic)) != 0) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, + "bdf variant magic does not match.\n"); + return; + } + + len = min_t(size_t, + strlen(smbios->bdf_ext), sizeof(ab->qmi.target.bdf_ext)); + for (i = 0; i < len; i++) { + if (!isascii(smbios->bdf_ext[i]) || !isprint(smbios->bdf_ext[i])) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, + "bdf variant name contains non ascii chars.\n"); + return; + } + } + + /* Copy extension name without magic prefix */ + copied = strscpy(ab->qmi.target.bdf_ext, smbios->bdf_ext + strlen(magic), + sizeof(ab->qmi.target.bdf_ext)); + if (copied < 0) { + ath12k_dbg(ab, ATH12K_DBG_BOOT, + "bdf variant string is longer than the buffer can accommodate\n"); + return; + } *** 26940 LINES SKIPPED *** From nobody Sun Apr 19 15:50:34 2026 X-Original-To: dev-commits-src-main@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 4fzCkg1c32z679Qy for ; Sun, 19 Apr 2026 15:50:35 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fzCkg013qz3FD2 for ; Sun, 19 Apr 2026 15:50:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776613835; 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=HN/6GMhdTSbTmooXe0yDbaMw0u+nJCRjatyTWg7p1GY=; b=ocIf8b1xsbqOPypkh+UUSzed781+80dqmaANxbIdEHS9xSeJBBYzeX623v6H3XQtQdvuJH jILUCF7FZoj1MyBgoTztWdaflw44vsqTXqxqhCnLUuk9fkmT5OVrPSi+GAi2Enz7p9eM6c hAZ7FMSj2kjJTXlTcGAfQFm/nHOyNpfIxr7+ZtijhYfQXlXuhK1K9TSBJvJvd37twJN5mE eftAFEdS813iNby2DQSXYVXdMPLny6tELEgtyoJRv5o1UL9xf8wNwdb9arSJsy7l3cpqIJ QIX7PkruarbIXDzUnr3YoScp4Ol23QkJaJSGMvwDK25lrpDPGLCbbzrcjX2+MQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776613835; a=rsa-sha256; cv=none; b=a9RTD1o7FzNjT3OAS2XHpFw4bL++G//E/QvnLNTvRvllaep+l43vSlx8mTTEfRsjSyWp/x 71dPlOAFlZuU50jOV3bn8qETwW3VBTmjE6cIIAyKPgXmnVpYs7lH0rjx8djJfAmhwrNwY2 Fz0FCWLYeYDxOFb0tDolL4D5SvJCuEobRUYZps1T+hW4Lw0MSKXEpuo1T/uReNZm1kj9ea 6U+LsiOyqAgLaqZc4yU7s8IV2lS1sXqzSyfWERDux/TqKr1wptXiz6DrfEmfc2QXk3oYbr 0126dfy8PpDGcvZ4K9VfX0btYj1wSGeCvnEib0vLbOwPAfDpYtKipLUHzJScOQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776613835; 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=HN/6GMhdTSbTmooXe0yDbaMw0u+nJCRjatyTWg7p1GY=; b=JQX1n4CJvL1YnC/BsTjOYKl0sne8LSc6T5+1GIYF8azPOP6eoE9l0GbYcYffScp3LWixJA Z1X4XOvrwMIuKdxnJer8cWHp9l6RpRlNcC+hrHWzWCwrTU7VVkprKVAK4EOeAFPjEQot9E GFoHdKPv7XRuzerY3N7mNOqGg1aJ880Fvwo0dyYxLcOab1OMtN+KFna9kbL8KYp8PfL2DU g2g/ek6cQAK440s1o9GDZkdhK5A2TbpeFet4zdVeKWmdkt3/TB9CdG+L7r4C7DpCMdtjwd p/pFLy6gdwQR6sbSF2xu4TQpdp9R3+9GCDA7GIn8kxwfRXGy8j4FLc/00TLWcQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fzCkf65zmz2DN for ; Sun, 19 Apr 2026 15:50:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 34150 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 15:50:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bjoern A. Zeeb Subject: git: 5cfadb663312 - main - ath12k: update module Makefiles for v7.0 driver version List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5cfadb6633128dccc32b1e4f84386ad705adc721 Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 15:50:34 +0000 Message-Id: <69e4f9ca.34150.2f90f689@gitrepo.freebsd.org> The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5cfadb6633128dccc32b1e4f84386ad705adc721 commit 5cfadb6633128dccc32b1e4f84386ad705adc721 Author: Bjoern A. Zeeb AuthorDate: 2026-04-19 15:48:58 +0000 Commit: Bjoern A. Zeeb CommitDate: 2026-04-19 15:50:19 +0000 ath12k: update module Makefiles for v7.0 driver version Update LINUXKPI_VERSION to reflect that the driver is based on Linux v7.0. Handle the file changes and the extra wifi7/ subdirectory. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/modules/ath12k/Makefile | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/modules/ath12k/Makefile b/sys/modules/ath12k/Makefile index 018504812995..ecca0bc3b409 100644 --- a/sys/modules/ath12k/Makefile +++ b/sys/modules/ath12k/Makefile @@ -13,13 +13,21 @@ ATH12K_TRACING= 0 KMOD= if_ath12k -SRCS+= core.c hal.c hal_tx.c hal_rx.c +SRCS+= core.c hal.c SRCS+= wmi.c mac.c reg.c htc.c qmi.c SRCS+= dp.c dp_tx.c dp_rx.c dp_mon.c debug.c -SRCS+= ce.c peer.c dbring.c hw.c fw.c p2p.c +SRCS+= ce.c peer.c dbring.c fw.c p2p.c +SRCS+= dp_htt.c dp_peer.c + +SRCS+= wifi7/ce.c wifi7/core.c +SRCS+= wifi7/dp.c wifi7/dp_mon.c wifi7/dp_rx.c wifi7/dp_tx.c +SRCS+= wifif/hal.c wifi7/hal_tx.c wifi7/hal_rx.c +SRCS+= wifi7/hal_qcc2072.c wifi7/hal_qcn9274.c wifi7/hal_wcn7850.c +SRCS+= wifi7/hw.c wifi7/wmi.c .if defined(ATH12K_PCI) && ${ATH12K_PCI} > 0 && ${KERN_OPTS:MDEV_PCI} SRCS+= mhi.c pci.c +SRCS+= wifi7/mhi.c wifi7/pci.c .else .error ath12k requires PCI support compiled in at this point .endif @@ -27,6 +35,7 @@ SRCS+= mhi.c pci.c .if defined(ATH12K_AHB) && ${ATH12K_AHB} > 0 CFLAGS+= -DCONFIG_ATH12K_AHB SRCS+= ahb.c +SRCS+= wifi7/ahb.c .endif .if defined(ATH12K_DEBUGFS) && ${ATH12K_DEBUGFS} > 0 CFLAGS+= -DCONFIG_ATH12K_DEBUGFS @@ -62,6 +71,6 @@ CFLAGS+= ${LINUXKPI_INCLUDES} CFLAGS+= -DCONFIG_ATH12K_DEBUG CFLAGS+= -DKBUILD_MODNAME='"ath12k"' -CFLAGS+= -DLINUXKPI_VERSION=61900 +CFLAGS+= -DLINUXKPI_VERSION=70000 .include From nobody Sun Apr 19 16:03:53 2026 X-Original-To: dev-commits-src-main@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 4fzD216wFkz67BN5 for ; Sun, 19 Apr 2026 16:03:53 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fzD215cbyz3HJ6 for ; Sun, 19 Apr 2026 16:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776614633; 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=qck0I7pMCCUZYuLTw6Jo0N/yio/z232hElHwXhw7VUQ=; b=ITOy33lI5Lv0EqB4HK8cf4nGaXRX6NVZCJvC9aOp8hq06LJmfczeGNW8wj1L9LfXCSHuD8 MITkxEQ1rOiPYwWNnl567OyhR8foOnXx7YzhFLhgfNTBuzwt9ab7/cEDojmZIHzfcMDbv/ eQeK9O7ivOyGQSkhpxaw4ozlo8360bH2W0Hg+jdm8sBQT9SNz3kAAm/I9xF8KpBMa6ZHI8 a6XfoW5VOU5qHHeYp1MYa5WjzswNIHremRoGrn2UrcLcuYzYGZZEFS6WbE7FVdQlhAh4q6 kDXMFIKOTHigYvQD0mJE1WjVGiphJTLk6lPR9K2tgzjSmBLOOojNGGFmKKJYtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776614633; a=rsa-sha256; cv=none; b=r/RWRWM/q3uK1cu7dlK2jgrrYOEmnpBZqR2/hDfqYZyKQ4pM3JqJJifYAb5yS4EybmFuAU /IAw9Pjgmm0y1CHf265ROWr+3+qCDE4s+4d8ymT6udBNAyxDOo+KLwFLq6GaBnPlNakIBB kYMZRIgDfooAMw2oFhQnHUoarB4KdVNZOsaTjDNz122clFRfyIKQtVULebjpsNvqD2GF8n vDbnl5iIJzy4+d1NQ8gXhiHolTWQrseieaxCXw4iG9sYFOnPd7nVtx53hcU42jqEFrG7WC e7/GH+3amQEB2sSdP1OX0B6HyXC6jB8Ib23x5Bfw+50EGfSIk2xIC8rofymluQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776614633; 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=qck0I7pMCCUZYuLTw6Jo0N/yio/z232hElHwXhw7VUQ=; b=mj/5SqkAwlWm9vehcXeMf2h12PESvIU1dB1WrR7uW22zoBo9U1fnJsnT3+2HA0x7Uxgwda OGoBbatwFOmMd+TZFv7iojxIq5vsbOhOMd8FejeRGzGFRnq4iuHZQKKynuAe+019R/SQtg wMDUniFWHIX+iZ/FNiVCAL0dW9AWoG19Ox+rnMw1aq27zv/x/ci8wExxZfn5kWWhaFjyfo aZVCZxRyyc/gT6kyHRbhFVu/AA7n/oj2S5qYEwQ+FjnkuejUftixnpDe5sjJhMfkdXIysP QDwU0vyN2S38VJba3m1LxtwvRiFmMH1q+slzRGr5umTNT85FPm640GBBg/TPQg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fzD215CJZz35g for ; Sun, 19 Apr 2026 16:03:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 37572 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 16:03:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 9d39213d2223 - main - pdfork.2: correct pdrfork's HISTORY section List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9d39213d222395eb40323102db018cbedf773ddf Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 16:03:53 +0000 Message-Id: <69e4fce9.37572.514f4cb4@gitrepo.freebsd.org> The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=9d39213d222395eb40323102db018cbedf773ddf commit 9d39213d222395eb40323102db018cbedf773ddf Author: Alan Somers AuthorDate: 2026-04-19 15:26:50 +0000 Commit: Alan Somers CommitDate: 2026-04-19 16:03:13 +0000 pdfork.2: correct pdrfork's HISTORY section Since pdrfork will be included in FreeBSD 15.1 Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D56513 --- lib/libsys/pdfork.2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libsys/pdfork.2 b/lib/libsys/pdfork.2 index 49226cf069de..3997570d2125 100644 --- a/lib/libsys/pdfork.2 +++ b/lib/libsys/pdfork.2 @@ -30,7 +30,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd January 20, 2026 +.Dd April 19, 2026 .Dt PDFORK 2 .Os .Sh NAME @@ -256,7 +256,7 @@ The and .Fn pdwait system calls first appeared in -.Fx 16.0 . +.Fx 15.1 . .Pp Support for process descriptors mode was developed as part of the .Tn TrustedBSD From nobody Sun Apr 19 18:12:15 2026 X-Original-To: dev-commits-src-main@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 4fzGt72Rzxz6WwVK for ; Sun, 19 Apr 2026 18:12:15 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fzGt71R3Rz3nlC for ; Sun, 19 Apr 2026 18:12:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776622335; 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=/OvLnBAY+zxH5McmqqKuby9XPBixR0si3O5hCDmPVek=; b=qVjhg+nzCAh54aMtAPn+oputqSsN9mgOx1+KmEN0PC11Egq1HHRqOHGpEUHRqGkH6cZ5Fh qEmCKGemOLrX23Uwsh4c1ZeQinZquiVU6QNQd/Q9/t74Tqlin7yp711C6+7f3P+PmcsUEc 5wBvSHDYjqcsl/wGRkjK9dfQPjLiPiodWCFmZQBInTsuX/R7ZQY1H4Yw3x1TF5TzksGpK4 1SI62MQB0mi53OqbzksbqQgt17fod5Xn/HfcY+ZMkfEiJYjizXFQHy/YivcBMqb4hdFrg4 gCW2yRGK/3uhomXprHXQlxsKrZHuyBNH/XzHCHm3ENoVEXRoJtuFenwjz7Iliw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776622335; a=rsa-sha256; cv=none; b=AZhT0BH+XPem6AoNb/JffPqDDOvyTGQTvweNYpEFH0ucj3FBbvt8BpBCMb4wFkqjLCrYo5 OCw0HzqPpXKceZA4NQ7sM2JWBjkYjNAK+aH9Shja3HFCMTudmme8UdjPwRZd+u0VwHLBqA gWbNw96dlddsnDqswQnR4wCYf+wpQouyIs7byiFnxN45CsuZWzCmngfjm/r3bcP+er9j0M ZRcMvy0qfKCu98RnSCxKVkWuwY5r6UrmkYnEUCEoIXMWrv3DR4D6ZG4UqfLQpXf6tK+gNf eZ7WLN8BJIqYSwI5nmCeKh8BnTAjPta25NzEI6A/ZwR0NyUgFXsXvO5BsMOASQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776622335; 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=/OvLnBAY+zxH5McmqqKuby9XPBixR0si3O5hCDmPVek=; b=rUnbiGgw9HAYphhVTzxxSW6PHWaFgCs0Pxxd1USg6UiZqGqviS7Orecrt/3Fdj1tuNZVmy s/02aGDqEvW/OFeNoH8wfQJLOnTrl197Z6G1Hx05gKc1QVc/SVXZtWWf0iXvFFe+3c+6Qr ZyR0rL3LFd+GEZnfJRXZTxadK98HRCXi1O0ZYPLJtazMuGJpRLcgAMY+uLYF3c95eOMFRQ 9RvGp6+AJBr23Iq9kYDN7mu4dLTm9JyejwtBgFXTWbFRXXKHuJKz/RBCR6NUugyZs7rPlz WbbwZUai143i4TC5u8C0HmPvwCle/8+1ouEBrA7NDHo2ZYW0iDUM8ISXw7p+8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fzGt712hvz5mM for ; Sun, 19 Apr 2026 18:12:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 41ce8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 19 Apr 2026 18:12:15 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dmitry Salychev Subject: git: 4a6d7fc1a00b - main - dpaa2: Extract checksum statuses on ingress List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dsl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a6d7fc1a00b69925b3edc39acef0391487a8e3e Auto-Submitted: auto-generated Date: Sun, 19 Apr 2026 18:12:15 +0000 Message-Id: <69e51aff.41ce8.39522d6b@gitrepo.freebsd.org> The branch main has been updated by dsl: URL: https://cgit.FreeBSD.org/src/commit/?id=4a6d7fc1a00b69925b3edc39acef0391487a8e3e commit 4a6d7fc1a00b69925b3edc39acef0391487a8e3e Author: Dmitry Salychev AuthorDate: 2026-04-13 12:46:49 +0000 Commit: Dmitry Salychev CommitDate: 2026-04-19 18:11:41 +0000 dpaa2: Extract checksum statuses on ingress In order to enable RX checksum offloading we need to check the meta-information for the (good) frames to see if the L3/4 checksums were calculated and if there was an error. The way the buffere are setup, the needed frame meta-information is already requested. All we have to do is make sure it is really part of the RX frame, that it is valid, and if the respective bits are set. Also do not forget to set the (dummy) csum_data as otherwise upper layers will just be cranky. An artefact of the past which likely should disappear. PR: 292006 Reviewed by: bz, tuexen Tested by: bz, tuexen Approved by: tuexen Obtained from: bz (initial version, D55320) MFC after: 3 days Sponsored by: Traverse Technologies (providing Ten64 HW for testing) Differential Revision: https://reviews.freebsd.org/D56383 --- sys/dev/dpaa2/dpaa2_frame.c | 100 ++++++++++++++++++++++++++++++++++++++------ sys/dev/dpaa2/dpaa2_frame.h | 63 +++++++++++++++++++++++++++- sys/dev/dpaa2/dpaa2_ni.c | 76 ++++++++++++++++++++++++++++++++- sys/dev/dpaa2/dpaa2_ni.h | 6 ++- 4 files changed, 227 insertions(+), 18 deletions(-) diff --git a/sys/dev/dpaa2/dpaa2_frame.c b/sys/dev/dpaa2/dpaa2_frame.c index 4a155f7cb32f..005708228058 100644 --- a/sys/dev/dpaa2/dpaa2_frame.c +++ b/sys/dev/dpaa2/dpaa2_frame.c @@ -1,7 +1,8 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright © 2026 Dmitry Salychev + * Copyright (c) 2026 Dmitry Salychev + * Copyright (c) 2026 Bjoern A. Zeeb * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -29,6 +30,7 @@ #include #include +#include #include #include @@ -138,28 +140,102 @@ dpaa2_fd_offset(struct dpaa2_fd *fd) return (fd->offset_fmt_sl & DPAA2_FD_OFFSET_MASK); } +uint32_t +dpaa2_fd_get_frc(struct dpaa2_fd *fd) +{ + /* TODO: Convert endiannes in the other functions as well. */ + return (le32toh(fd->frame_ctx)); +} + +#ifdef _not_yet_ +void +dpaa2_fd_set_frc(struct dpaa2_fd *fd, uint32_t frc) +{ + /* TODO: Convert endiannes in the other functions as well. */ + fd->frame_ctx = htole32(frc); +} +#endif + int dpaa2_fa_get_swa(struct dpaa2_fd *fd, struct dpaa2_swa **swa) { - int rc; - - if (fd == NULL || swa == NULL) + if (__predict_false(fd == NULL || swa == NULL)) return (EINVAL); - if (((fd->ctrl >> DPAA2_FD_PTAC_SHIFT) & DPAA2_FD_PTAC_MASK) >= 0x4u) { - *swa = (struct dpaa2_swa *)PHYS_TO_DMAP((bus_addr_t)fd->addr); - rc = 0; - } else { + if (((fd->ctrl >> DPAA2_FD_PTAC_SHIFT) & DPAA2_FD_PTAC_PTA_MASK) == 0u) { *swa = NULL; - rc = ENOENT; + return (ENOENT); } - return (rc); + *swa = (struct dpaa2_swa *)PHYS_TO_DMAP((bus_addr_t)fd->addr); + + return (0); } int dpaa2_fa_get_hwa(struct dpaa2_fd *fd, struct dpaa2_hwa **hwa) { - /* TODO: To be implemented next. */ - return (ENOENT); + uint8_t *buf; + uint32_t hwo; /* HW annotation offset */ + + if (__predict_false(fd == NULL || hwa == NULL)) + return (EINVAL); + + /* + * As soon as the ASAL is in the 64-byte units, we don't need to + * calculate the exact length, but make sure that it isn't 0. + */ + if (((fd->ctrl >> DPAA2_FD_ASAL_SHIFT) & DPAA2_FD_ASAL_MASK) == 0u) { + *hwa = NULL; + return (ENOENT); + } + + buf = (uint8_t *)PHYS_TO_DMAP((bus_addr_t)fd->addr); + hwo = ((fd->ctrl >> DPAA2_FD_PTAC_SHIFT) & DPAA2_FD_PTAC_PTA_MASK) > 0u + ? DPAA2_FA_SWA_SIZE : 0u; + *hwa = (struct dpaa2_hwa *)(buf + hwo); + + return (0); +} + +int +dpaa2_fa_get_fas(struct dpaa2_fd *fd, struct dpaa2_hwa_fas *fas) +{ + struct dpaa2_hwa *hwa; + struct dpaa2_hwa_fas *fasp; + int rc; + + if (__predict_false(fd == NULL || fas == NULL)) + return (EINVAL); + + rc = dpaa2_fa_get_hwa(fd, &hwa); + if (__predict_false(rc != 0)) + return (rc); + + fasp = (struct dpaa2_hwa_fas *)&hwa->fas; + *fas = *fasp; + + return (rc); +} + +#ifdef _not_yet_ +int +dpaa2_fa_set_fas(struct dpaa2_fd *fd, struct dpaa2_hwa_fas *fas) +{ + struct dpaa2_hwa *hwa; + uint64_t *valp; + int rc; + + if (__predict_false(fd == NULL || fas == NULL)) + return (EINVAL); + + rc = dpaa2_fa_get_hwa(fd, &hwa); + if (__predict_false(rc != 0)) + return (rc); + + valp = (uint64_t *)fas; + hwa->fas = *valp; + + return (rc); } +#endif diff --git a/sys/dev/dpaa2/dpaa2_frame.h b/sys/dev/dpaa2/dpaa2_frame.h index 0b2a5a7d8e74..ab83b402efa4 100644 --- a/sys/dev/dpaa2/dpaa2_frame.h +++ b/sys/dev/dpaa2/dpaa2_frame.h @@ -1,7 +1,8 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright © 2026 Dmitry Salychev + * Copyright (c) 2026 Dmitry Salychev + * Copyright (c) 2026 Bjoern A. Zeeb * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -56,8 +57,13 @@ #define DPAA2_FD_SL_SHIFT (14) #define DPAA2_FD_LEN_MASK (0x3FFFFu) #define DPAA2_FD_OFFSET_MASK (0x0FFFu) +#define DPAA2_FD_PTAC_PTV2_MASK (0x1u) +#define DPAA2_FD_PTAC_PTV1_MASK (0x2u) +#define DPAA2_FD_PTAC_PTA_MASK (0x4u) #define DPAA2_FD_PTAC_MASK (0x7u) #define DPAA2_FD_PTAC_SHIFT (21) +#define DPAA2_FD_ASAL_MASK (0xFu) +#define DPAA2_FD_ASAL_SHIFT (16) /* * DPAA2 frame annotation sizes @@ -73,6 +79,31 @@ #define DPAA2_FA_SWA_SIZE 64u /* SW frame annotation */ #define DPAA2_FA_HWA_SIZE 128u /* HW frame annotation */ #define DPAA2_FA_WRIOP_SIZE 128u /* WRIOP HW annotation */ +#define DPAA2_FA_HWA_FAS_SIZE 8u /* Frame annotation status */ + +/* + * DPAA2 annotation valid bits in FD[FRC]. + * + * See 7.31.2 WRIOP FD frame context (FRC), + * LX2160A DPAA2 Low-Level Hardware Reference Manual, Rev. 0, 06/2020 + */ +#define DPAA2_FD_FRC_FASV (1 << 15) +#define DPAA2_FD_FRC_FAEADV (1 << 14) +#define DPAA2_FD_FRC_FAPRV (1 << 13) +#define DPAA2_FD_FRC_FAIADV (1 << 12) +#define DPAA2_FD_FRC_FASWOV (1 << 11) +#define DPAA2_FD_FRC_FAICFDV (1 << 10) + +/* + * DPAA2 Frame annotation status word. + * + * See 7.34.3 Frame annotation status word (FAS), + * LX2160A DPAA2 Low-Level Hardware Reference Manual, Rev. 0, 06/2020 + */ +#define DPAA2_FAS_L3CV (1 << 3) /* L3 csum validated */ +#define DPAA2_FAS_L3CE (1 << 2) /* L3 csum error */ +#define DPAA2_FAS_L4CV (1 << 1) /* L4 csum validated*/ +#define DPAA2_FAS_L4CE (1 << 0) /* L4 csum error */ /** * @brief DPAA2 frame descriptor. @@ -126,13 +157,18 @@ struct dpaa2_hwa_wriop { CTASSERT(sizeof(struct dpaa2_hwa_wriop) == DPAA2_FA_WRIOP_SIZE); /** - * @brief DPAA2 hardware frame annotation (accelerator-specific annotation). + * @brief DPAA2 hardware frame annotation. * * See 3.4.1.2 Accelerator-specific annotation, * LX2160A DPAA2 Low-Level Hardware Reference Manual, Rev. 0, 06/2020 */ struct dpaa2_hwa { union { + /* Keep fields common to all accelerators at the top. */ + struct { + uint64_t fas; + } __packed; + /* Keep accelerator-specific annotations below. */ struct dpaa2_hwa_wriop wriop; }; } __packed; @@ -159,6 +195,20 @@ struct dpaa2_swa { } __packed; CTASSERT(sizeof(struct dpaa2_swa) == DPAA2_FA_SWA_SIZE); +/** + * @brief Frame annotation status word. + * + * See 7.34.3 Frame annotation status word (FAS), + * LX2160A DPAA2 Low-Level Hardware Reference Manual, Rev. 0, 06/2020 + */ +struct dpaa2_hwa_fas { + uint8_t _reserved1; + uint8_t ppid; + uint16_t ifpid; + uint32_t status; +} __packed; +CTASSERT(sizeof(struct dpaa2_hwa_fas) == DPAA2_FA_HWA_FAS_SIZE); + int dpaa2_fd_build(device_t, const uint16_t, struct dpaa2_buf *, bus_dma_segment_t *, const int, struct dpaa2_fd *); @@ -168,7 +218,16 @@ int dpaa2_fd_format(struct dpaa2_fd *); bool dpaa2_fd_short_len(struct dpaa2_fd *); int dpaa2_fd_offset(struct dpaa2_fd *); +uint32_t dpaa2_fd_get_frc(struct dpaa2_fd *); +#ifdef _not_yet_ +void dpaa2_fd_set_frc(struct dpaa2_fd *, uint32_t); +#endif + int dpaa2_fa_get_swa(struct dpaa2_fd *, struct dpaa2_swa **); int dpaa2_fa_get_hwa(struct dpaa2_fd *, struct dpaa2_hwa **); +int dpaa2_fa_get_fas(struct dpaa2_fd *, struct dpaa2_hwa_fas *); +#ifdef _not_yet_ +int dpaa2_fa_set_fas(struct dpaa2_fd *, struct dpaa2_hwa_fas *); +#endif #endif /* _DPAA2_FRAME_H */ diff --git a/sys/dev/dpaa2/dpaa2_ni.c b/sys/dev/dpaa2/dpaa2_ni.c index 5017b5113109..3be33cd18b66 100644 --- a/sys/dev/dpaa2/dpaa2_ni.c +++ b/sys/dev/dpaa2/dpaa2_ni.c @@ -1,8 +1,9 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright © 2021-2023 Dmitry Salychev - * Copyright © 2022 Mathew McBride + * Copyright (c) 2021-2026 Dmitry Salychev + * Copyright (c) 2022 Mathew McBride + * Copyright (c) 2026 Bjoern A. Zeeb * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -415,6 +416,7 @@ static int dpaa2_ni_set_dist_key(device_t, enum dpaa2_ni_dist_mode, uint64_t); /* Various subroutines */ static int dpaa2_ni_cmp_api_version(struct dpaa2_ni_softc *, uint16_t, uint16_t); static int dpaa2_ni_prepare_key_cfg(struct dpkg_profile_cfg *, uint8_t *); +static int dpaa2_ni_update_csum_flags(struct dpaa2_fd *, struct mbuf *); /* Network interface routines */ static void dpaa2_ni_init(void *); @@ -494,6 +496,7 @@ dpaa2_ni_attach(device_t dev) sc->rx_sg_buf_frames = 0; sc->rx_enq_rej_frames = 0; sc->rx_ieoi_err_frames = 0; + sc->rx_other_err_frames = 0; sc->tx_single_buf_frames = 0; sc->tx_sg_frames = 0; @@ -1741,6 +1744,9 @@ dpaa2_ni_setup_sysctls(struct dpaa2_ni_softc *sc) SYSCTL_ADD_UQUAD(ctx, parent, OID_AUTO, "rx_ieoi_err_frames", CTLFLAG_RD, &sc->rx_ieoi_err_frames, "QMan IEOI error"); + SYSCTL_ADD_UQUAD(ctx, parent, OID_AUTO, "rx_other_err_frames", + CTLFLAG_RD, &sc->rx_other_err_frames, + "Other Rx frames with errors"); SYSCTL_ADD_UQUAD(ctx, parent, OID_AUTO, "tx_single_buf_frames", CTLFLAG_RD, &sc->tx_single_buf_frames, "Tx single buffer frames"); @@ -3124,6 +3130,7 @@ dpaa2_ni_rx(struct dpaa2_channel *ch, struct dpaa2_ni_fq *fq, bus_addr_t released[DPAA2_SWP_BUFS_PER_CMD]; void *buf_data; int buf_len, error, released_n = 0; + bool update_csum_flags; error = dpaa2_fa_get_swa(fd, &swa); if (__predict_false(error != 0)) @@ -3134,6 +3141,7 @@ dpaa2_ni_rx(struct dpaa2_channel *ch, struct dpaa2_ni_fq *fq, buf = swa->buf; bch = (struct dpaa2_channel *)buf->opt; sc = device_get_softc(bch->ni_dev); + update_csum_flags = true; KASSERT(swa->magic == DPAA2_MAGIC, ("%s: wrong magic", __func__)); /* @@ -3148,6 +3156,14 @@ dpaa2_ni_rx(struct dpaa2_channel *ch, struct dpaa2_ni_fq *fq, } switch (dpaa2_fd_err(fd)) { + case 0: + /* + * FD[ERR] = 0 value is reserved to indicate that there is no + * error encoded in this field. See 3.4.5 Error handling, + * LX2160A DPAA2 Low-Level Hardware Reference Manual, Rev. 0, + * 06/2020. + */ + break; case 1: /* Enqueue rejected by QMan */ sc->rx_enq_rej_frames++; break; @@ -3155,8 +3171,10 @@ dpaa2_ni_rx(struct dpaa2_channel *ch, struct dpaa2_ni_fq *fq, sc->rx_ieoi_err_frames++; break; default: + sc->rx_other_err_frames++; break; } + switch (dpaa2_fd_format(fd)) { case DPAA2_FD_SINGLE: sc->rx_single_buf_frames++; @@ -3165,6 +3183,7 @@ dpaa2_ni_rx(struct dpaa2_channel *ch, struct dpaa2_ni_fq *fq, sc->rx_sg_buf_frames++; break; default: + update_csum_flags = false; break; } @@ -3197,6 +3216,14 @@ dpaa2_ni_rx(struct dpaa2_channel *ch, struct dpaa2_ni_fq *fq, M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); if_inc_counter(sc->ifp, IFCOUNTER_IPACKETS, 1); + if (update_csum_flags && ((if_getcapenable(sc->ifp) & (IFCAP_RXCSUM | + IFCAP_RXCSUM_IPV6)) != 0)) { + error = dpaa2_ni_update_csum_flags(fd, m); + if (error != 0) + device_printf(sc->dev, "%s: failed to update checksum " + "flags: error=%d\n", __func__, error); + } + if (ctx->head == NULL) { KASSERT(ctx->tail == NULL, ("%s: tail already given?", __func__)); ctx->head = m; @@ -3638,6 +3665,51 @@ dpaa2_ni_prepare_key_cfg(struct dpkg_profile_cfg *cfg, uint8_t *key_cfg_buf) return (0); } +static int +dpaa2_ni_update_csum_flags(struct dpaa2_fd *fd, struct mbuf *m) +{ + struct dpaa2_hwa_fas fas; + uint32_t status; + int rc; + + if (__predict_false((dpaa2_fd_get_frc(fd) & DPAA2_FD_FRC_FASV)) == 0u) + return (EINVAL); + + /* + * XXX-DSL: Frame context of the frame descriptor (FD[FRC]) contains + * an Accelerator ID in the MSbits on some SoCs (e.g. LS1088A), + * but a frame ParseSummary on the others (e.g. LX2160A). + * However, frame annotation valid bits seem to be at the + * same offsets. This is the reason why different accelerators + * are treated the same here. It isn't clear whether this is + * a hardware limitation of the SoCs, version of the firmware + * or DPL configuration. + */ + + rc = dpaa2_fa_get_fas(fd, &fas); + if (rc != 0) + return (rc); + + status = le32toh(fas.status); + rc = 0; + + /* L3 */ + if ((status & DPAA2_FAS_L3CV) != 0) { + m->m_pkthdr.csum_flags |= CSUM_L3_CALC; + if ((status & DPAA2_FAS_L3CE) == 0) + m->m_pkthdr.csum_flags |= CSUM_L3_VALID; + } + /* L4 */ + if ((status & DPAA2_FAS_L4CV) != 0) { + m->m_pkthdr.csum_flags |= CSUM_L4_CALC; + m->m_pkthdr.csum_data = 0xffff; + if ((status & DPAA2_FAS_L4CE) == 0) + m->m_pkthdr.csum_flags |= CSUM_L4_VALID; + } + + return (rc); +} + static device_method_t dpaa2_ni_methods[] = { /* Device interface */ DEVMETHOD(device_probe, dpaa2_ni_probe), diff --git a/sys/dev/dpaa2/dpaa2_ni.h b/sys/dev/dpaa2/dpaa2_ni.h index fcd37501ebd0..9b1397fc544d 100644 --- a/sys/dev/dpaa2/dpaa2_ni.h +++ b/sys/dev/dpaa2/dpaa2_ni.h @@ -1,8 +1,9 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright © 2021-2023 Dmitry Salychev - * Copyright © 2022 Mathew McBride + * Copyright (c) 2021-2023 Dmitry Salychev + * Copyright (c) 2022 Mathew McBride + * Copyright (c) 2026 Bjoern A. Zeeb * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -466,6 +467,7 @@ struct dpaa2_ni_softc { uint64_t rx_sg_buf_frames; uint64_t rx_enq_rej_frames; uint64_t rx_ieoi_err_frames; + uint64_t rx_other_err_frames; uint64_t tx_single_buf_frames; uint64_t tx_sg_frames;