From nobody Mon Jul 22 00:55:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zT6ntYz5QwTG; Mon, 22 Jul 2024 00:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zT6FKtz4j16; Mon, 22 Jul 2024 00:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721609733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2VEXFRgOQ+hKKMSY16R4k5gJRyu7lr5IPOE5SrAi8WE=; b=Q/Fc9IjuOMvtYZrf0wtCGPVsQGIptpm/xjCtmXQFGhzK/by2A8t9T2eMsmZVYDt44qA3oM 16Qtkl7xJsvvGXIGJaP6Y6Nr+jXs1SQa/CafMg3NESEAiuYWoMbnzufcCthwKKHk4EdHmL C6WKgEXvLjaKOccnIkMNh4OmPmRph9TAQPKmxaNiX3Bg21us03Y76QhCvSGyEQhOE/93+M g0Y1eax0ZF8z0a/o1LdUSxgvjK29sPgJu22Ulun31xPzk4z5o+U5WiIYewX0CycbQlZ9Cu IFr9s6PHn7WMq67ygneNfLvQEP9DaCneK7JF4OVq4+f0FWUBkrzDZu+zyQ9LFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609733; a=rsa-sha256; cv=none; b=gZn+yblWGhTUmx5jDbuxZ2DJLTnDHXrcXH83SpEZcq5VhYYE2DEqpR2Hao3UigGNWlrccN 4S31Wda+dZ3+inyKyeqluAqIccrTz8FF0gAGg/6cOiMG6lFFTTieHkfLzFIZ283GWK32hB s0lyJYCaY7pNCf5srXp9nQtpHSJiNGP9PRn6ialoMy4PYPtAV3Z7FpKAbSxgwHWRJA6NRH Bo0Fi/DH6PHKMq6zhXsbvUuPCEW9ZaB7L0+PEf4+FsmrUQfh+erKSV7eAtfQGBAi57yH79 2y3rXdbcTgd/vaLCyBgVnp1y3Dvs0AEoRk3QrMQnQ2xe09uYyPaVL650zZ/iSQ== 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=1721609733; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2VEXFRgOQ+hKKMSY16R4k5gJRyu7lr5IPOE5SrAi8WE=; b=CrJSC9PCDbc0iik7fihGSsZAM/wKJZBpBvDAzthR4/aQ+lY55Ey9T9S5y1cF2BeXcazfrd kldgt4SuyhOjvYrJ6cpKyDh/Ox1hje0H3+rwztjvZOh+VW3GuJTwJOYyUQ/oVgHCII+Fjp GlkFI3JCkB7H1bpPXQZlXYB1inEHYbmYIBM+yOfnq1UMCPBN4tjIsBifdzdfsEp28z4ix6 De4Kde3Xrt4Be3skMaH0/rxIKdWoDESgndZ1K5iLp2Mymin3FzlKxpgkF8Q66eGwOM8ul5 WHadPR7QGB7BLhNaA8QKvBabHtsVnrzhZZ0+8PDpLFxk9XuLU+Sz3RUpHCbyiQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zT5rxnzNb6; Mon, 22 Jul 2024 00:55:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0tXNo007153; Mon, 22 Jul 2024 00:55:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0tXj3007150; Mon, 22 Jul 2024 00:55:33 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:33 GMT Message-Id: <202407220055.46M0tXj3007150@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: dc1f4c3d9aab - stable/14 - libdtrace: Use designated initializers for modules ops tables List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: dc1f4c3d9aab6524b06630e2168a1ca6525674bf Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=dc1f4c3d9aab6524b06630e2168a1ca6525674bf commit dc1f4c3d9aab6524b06630e2168a1ca6525674bf Author: Mark Johnston AuthorDate: 2024-07-10 21:17:38 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:27 +0000 libdtrace: Use designated initializers for modules ops tables No functional change intended. MFC after: 1 week Sponsored by: Innovate UK (cherry picked from commit f6372351da07ae101d5a22a2bb2bdb2753da2b40) --- .../contrib/opensolaris/lib/libdtrace/common/dt_module.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c index 281c787de533..6fb9b0f84769 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c @@ -452,17 +452,17 @@ dt_module_symaddr64(dt_module_t *dmp, GElf_Addr addr, } static const dt_modops_t dt_modops_32 = { - dt_module_syminit32, - dt_module_symsort32, - dt_module_symname32, - dt_module_symaddr32 + .do_syminit = dt_module_syminit32, + .do_symsort = dt_module_symsort32, + .do_symname = dt_module_symname32, + .do_symaddr = dt_module_symaddr32 }; static const dt_modops_t dt_modops_64 = { - dt_module_syminit64, - dt_module_symsort64, - dt_module_symname64, - dt_module_symaddr64 + .do_syminit = dt_module_syminit64, + .do_symsort = dt_module_symsort64, + .do_symname = dt_module_symname64, + .do_symaddr = dt_module_symaddr64 }; dt_module_t * From nobody Mon Jul 22 00:55:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zW1zGgz5QwlK; Mon, 22 Jul 2024 00:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zV6t08z4hvQ; Mon, 22 Jul 2024 00:55:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721609735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5JTqRmrJQ0c5BJ5l2U7N3yrYDqpkLK5CFPh1uGd3Wk8=; b=bEYFIS4EHTym3aU5Fz8hXvzLJyWVI0uHpu/zP9vo7m1vKJ+uo+JuC2ulpA8vyJk8lGczc/ nCj6KWbLH7Ez19d0KMl169KSusIO0bjPECvtWUxC7NJk3SYhiL5RHdV/JbvrpvBZhaZ2Mi 3r4nZGEtKQ7LJ9F8378oTdwKBPmLelUUoipXn065412OEonL8+HX+RpraVzgC5hO2TE/iJ aVHn+ehKM31/y6hTSx6gV8w2xs1QgFfup1CCikS0l97WVAZ0DaMUpMRgrsQWb8pZTah7L7 O0OLBaiRV/N/WwUZZF+Nr5UtVdPB5eBDsBGSS//rYipj28aJWd2h2Ew0Tqh3Ug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609735; a=rsa-sha256; cv=none; b=O6B/cjIBx3Jlk97K6E4OWNkNfLqpxpkDt/2s8VjbNvCkYkdEOQetdVF/7YKiLHiiIXdDb4 fElgdNoJ0RjPi3y5LrTh3oiSjiFCbwbXL3prcS00AnpJ7uuqgBlhvbv0fv7PGxlulVmdiR MW3aNs20aWbFLtFLPirz6Wq/itzHYdP/qtlTbrZkWDQpy7XXnm6Oh6v7OBWJ0q2bDVJlPW CSgPJAlf6AkXPXQlDMH1tfRm2gRiukERKpx2bXhrQOetNVQVhowdWG9GALGrribkm42lK8 L8bohI79baOMlEcggFwubpTudfHS5yr+N11Duj7MTrwMXPD6fPNd8HNeuI0D1w== 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=1721609735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5JTqRmrJQ0c5BJ5l2U7N3yrYDqpkLK5CFPh1uGd3Wk8=; b=iHVaQk6dnT+D60/zYxUGSWLz1cqnhHOQc8+b6hdetgSYgMsumtWBaMeKvvv4JwekaxD09f yPdTw1jnkozONuwMVJ0P2mfl/v/JFojm8fAyXuwl6peXrbnbijL4M8cJfzNG60N70/rYde cFdlRJpJHU8iNcu+xlNk72R5b40me1brsh0OGz8Zn3aFKdAJ/bX7Fofcx6sbb4J8jswuxT UvLb5qOTnYZm5JWBrcd+epI46UZwltlb67gMbOkYmjDoyfGUk+A939831eCcVCDskyQCGR 1U2hZkfs5sQ4pX5dzytwCVkxowVLn159ul2F601lrZTasfp+HuloWV0Ff3wA3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zV6VGkzNb7; Mon, 22 Jul 2024 00:55:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0tYRd007201; Mon, 22 Jul 2024 00:55:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0tYVO007198; Mon, 22 Jul 2024 00:55:34 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:34 GMT Message-Id: <202407220055.46M0tYVO007198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 7d521f0a61ff - stable/14 - buf_ring: Make buf_ring.h amenable to userspace compilation List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7d521f0a61ff8be5778979d97e71760fe8559e14 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7d521f0a61ff8be5778979d97e71760fe8559e14 commit 7d521f0a61ff8be5778979d97e71760fe8559e14 Author: Mark Johnston AuthorDate: 2024-07-11 18:55:11 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:27 +0000 buf_ring: Make buf_ring.h amenable to userspace compilation This will be useful for adding test cases. Reviewed by: andrew MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45869 (cherry picked from commit a161269b2451140a45de2d0cae0dad84f9e7b439) --- sys/sys/buf_ring.h | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/sys/sys/buf_ring.h b/sys/sys/buf_ring.h index 32c9f5b15f22..cb18175c3a75 100644 --- a/sys/sys/buf_ring.h +++ b/sys/sys/buf_ring.h @@ -30,11 +30,18 @@ #ifndef _SYS_BUF_RING_H_ #define _SYS_BUF_RING_H_ +#include +#include +#include #include #ifdef DEBUG_BUFRING +#ifdef _KERNEL #include #include +#else +#error "DEBUG_BUFRING is only supported in kernel" +#endif #endif struct buf_ring { @@ -361,8 +368,36 @@ buf_ring_count(struct buf_ring *br) & br->br_prod_mask); } +#ifdef _KERNEL struct buf_ring *buf_ring_alloc(int count, struct malloc_type *type, int flags, struct mtx *); void buf_ring_free(struct buf_ring *br, struct malloc_type *type); +#else -#endif +#include + +static inline struct buf_ring * +buf_ring_alloc(int count) +{ + struct buf_ring *br; + + KASSERT(powerof2(count), ("buf ring must be size power of 2")); + + br = calloc(1, sizeof(struct buf_ring) + count * sizeof(void *)); + if (br == NULL) + return (NULL); + br->br_prod_size = br->br_cons_size = count; + br->br_prod_mask = br->br_cons_mask = count - 1; + br->br_prod_head = br->br_cons_head = 0; + br->br_prod_tail = br->br_cons_tail = 0; + return (br); +} + +static inline void +buf_ring_free(struct buf_ring *br) +{ + free(br); +} + +#endif /* !_KERNEL */ +#endif /* _SYS_BUF_RING_H_ */ From nobody Mon Jul 22 00:55:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zX3KKxz5Qwjw; Mon, 22 Jul 2024 00:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zX0zyzz4j17; Mon, 22 Jul 2024 00:55:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721609736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zi8ajJC420nGpve2eNNwKHw6DkY8d6k/2vgGvcaZV9s=; b=wy8o1EOvwSztX6Ep6cE033H8deqsOmbWYRMaquX/0Mh/GWs3PsCVyUgnoj92mEekKFyPQk FYwz/+1/0beUyj4LeySO+Psl1n3qwZguovjHwC/xeFJYP59EbfdxkVgPVVmHDqfM21um95 QpT1V+HZmicfAkOJN8E5AhtXypovKyiAEJLZG1J7xY+qOPbSns6dP7cqiDf8VZKDGn4NJe zQAltVsWIaZw48NZiSIcjNsR57GxB9jN7Gik/zXw81FAaMDd+U5sfWvTVI7MEC/PdpWSZR mTAy+4sweNvFuPmUjE0x95lrJd7G3PWYebgUS3VaPb2fPOYNsg6/VpfazaFHTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609736; a=rsa-sha256; cv=none; b=NN895ZJl7lcAA9FgbkRlCCBp7/EzWf9nXECCsXCyMN+/Uyw4GDkEgVWnuo/5mIk6Rysh1R Qwr6dmeIcDObZ25w6c/qRNK2BpUbOtq7agyz9dbBBuRW7h5OCBQRIz6FKfSSfgvUph2kal 1Q2Tn07bleeFgKy1TUvj6FyT7jZRrjAu/NN3rri+gWzonJymq5mA1TNb48cDqOKOkRBLdD LyaDijyKof/rNwsMXCJhzySO/DKCC1NqAcqb0aNq1wDlLExwy4jjd8Y2Q8RKrSeOBFAChP udEemvo+nktukkY++7lFkwZgW8bypPxwAlUYhV9qIco7GkS8i+gI5+7yWkjtmw== 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=1721609736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zi8ajJC420nGpve2eNNwKHw6DkY8d6k/2vgGvcaZV9s=; b=K28Z/liz3Kt/QO2OfTYXKCypVKSvzwhMEonmNVSUW3jKtfWfmnaEEwvzPSZ4ilrCvRsGma 7LeXMepBTBeMO+uxAkcIgGxQRnDKfCTlX86maxo8QmMMQi2Xck41rJDq8776JlKkZ5Uo8S tXkPfhHwL7NLHPW/HoVEnecPBe/CJuw1ttsU0cHqzCPILMuGzE6toZJu5oeb0U2n1y+P3D u34HS5bgLTpOjhBnvv4eogOMXvwtKAT9YmAWQtAS1YzoXgeEN2mxtreXs1mhQD8iDvkSrd M8h219CljspNC2KxADbdwySmfJsbXwK7Pg4asIzu6by6VYfaBC+orRbqkoSpqA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zX0b9rzNcY; Mon, 22 Jul 2024 00:55:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0tZhW007244; Mon, 22 Jul 2024 00:55:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0tZQd007241; Mon, 22 Jul 2024 00:55:35 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:35 GMT Message-Id: <202407220055.46M0tZQd007241@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 3985e96ac5c6 - stable/14 - route: Wrap long lines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 3985e96ac5c6cf407642e9ccfdd3094989508121 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=3985e96ac5c6cf407642e9ccfdd3094989508121 commit 3985e96ac5c6cf407642e9ccfdd3094989508121 Author: Mark Johnston AuthorDate: 2024-07-14 16:20:48 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:27 +0000 route: Wrap long lines No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. (cherry picked from commit ec1b18c7353ad20d2d373e58931aeccfccd5599d) --- sys/net/route/route_debug.h | 36 +++++++++++++++++++++++------------- sys/net/rtsock.c | 4 +++- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/sys/net/route/route_debug.h b/sys/net/route/route_debug.h index b00fbf1784e7..ebf0d9408171 100644 --- a/sys/net/route/route_debug.h +++ b/sys/net/route/route_debug.h @@ -78,33 +78,42 @@ SYSCTL_DECL(_net_route_debug); * This is NOT compiled in by default. Turning it on should NOT seriously impact performance * LOG_DEBUG3 - last debug level. Per-item large debug outputs. * This is NOT compiled in by default. All performance bets are off. - * */ -#define _output printf +#define _output printf #define _DEBUG_PASS_MSG(_l) (DEBUG_VAR_NAME >= (_l)) -#define IF_DEBUG_LEVEL(_l) if ((DEBUG_MAX_LEVEL >= (_l)) && (__predict_false(DEBUG_VAR_NAME >= (_l)))) +#define IF_DEBUG_LEVEL(_l) \ + if ((DEBUG_MAX_LEVEL >= (_l)) && (__predict_false(DEBUG_VAR_NAME >= (_l)))) /* * Logging for events specific for particular family and fib - * Example: [nhop_neigh] inet.0 find_lle: nhop nh#4/inet/vtnet0/10.0.0.1: mapped to lle NULL + * Example: [nhop_neigh] inet.0 find_lle: */ -#define FIB_LOG(_l, _fib, _fam, _fmt, ...) FIB_LOG_##_l(_l, _fib, _fam, _fmt, ## __VA_ARGS__) -#define _FIB_LOG(_l, _fib, _fam, _fmt, ...) if (_DEBUG_PASS_MSG(_l)) { \ - _output("[" DEBUG_PREFIX_NAME "] %s.%u %s: " _fmt "\n", rib_print_family(_fam), _fib, __func__, ##__VA_ARGS__); \ -} +#define FIB_LOG(_l, _fib, _fam, _fmt, ...) \ + FIB_LOG_##_l(_l, _fib, _fam, _fmt, ## __VA_ARGS__) +#define _FIB_LOG(_l, _fib, _fam, _fmt, ...) \ + if (_DEBUG_PASS_MSG(_l)) { \ + _output("[" DEBUG_PREFIX_NAME "] %s.%u %s: " _fmt "\n", \ + rib_print_family(_fam), _fib, __func__, ##__VA_ARGS__); \ + } /* Same as FIB_LOG, but uses nhop to get fib and family */ -#define FIB_NH_LOG(_l, _nh, _fmt, ...) FIB_LOG_##_l(_l, nhop_get_fibnum(_nh), nhop_get_upper_family(_nh), _fmt, ## __VA_ARGS__) +#define FIB_NH_LOG(_l, _nh, _fmt, ...) \ + FIB_LOG_##_l(_l, nhop_get_fibnum(_nh), nhop_get_upper_family(_nh), \ + _fmt, ## __VA_ARGS__) /* Same as FIB_LOG, but uses rib_head to get fib and family */ -#define FIB_RH_LOG(_l, _rh, _fmt, ...) FIB_LOG_##_l(_l, (_rh)->rib_fibnum, (_rh)->rib_family, _fmt, ## __VA_ARGS__) +#define FIB_RH_LOG(_l, _rh, _fmt, ...) \ + FIB_LOG_##_l(_l, (_rh)->rib_fibnum, (_rh)->rib_family, _fmt, \ + ## __VA_ARGS__) /* Same as FIB_LOG, but uses nh_control to get fib and family from linked rib */ -#define FIB_CTL_LOG(_l, _ctl, _fmt, ...) FIB_LOG_##_l(_l, (_ctl)->ctl_rh->rib_fibnum, (_ctl)->ctl_rh->rib_family, _fmt, ## __VA_ARGS__) +#define FIB_CTL_LOG(_l, _ctl, _fmt, ...) \ + FIB_LOG_##_l(_l, (_ctl)->ctl_rh->rib_fibnum, \ + (_ctl)->ctl_rh->rib_family, _fmt, ## __VA_ARGS__) /* * Generic logging for routing subsystem - * Example: [nhop_neigh] nhops_update_neigh: L2 prepend update from lle/inet/valid/vtnet0/10.0.0.157 + * Example: [nhop_neigh] nhops_update_neigh: */ #define RT_LOG(_l, _fmt, ...) RT_LOG_##_l(_l, _fmt, ## __VA_ARGS__) #define _RT_LOG(_l, _fmt, ...) if (_DEBUG_PASS_MSG(_l)) { \ @@ -113,7 +122,8 @@ SYSCTL_DECL(_net_route_debug); /* - * Wrapper logic to avoid compiling high levels of debugging messages for production systems. + * Wrapper logic to avoid compiling high levels of debugging messages for + * production systems. */ #if DEBUG_MAX_LEVEL>=LOG_DEBUG3 #define FIB_LOG_LOG_DEBUG3 _FIB_LOG diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index caee9bd6e83f..3905584e431d 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -138,7 +138,9 @@ struct linear_buffer { }; #define SCRATCH_BUFFER_SIZE 1024 -#define RTS_PID_LOG(_l, _fmt, ...) RT_LOG_##_l(_l, "PID %d: " _fmt, curproc ? curproc->p_pid : 0, ## __VA_ARGS__) +#define RTS_PID_LOG(_l, _fmt, ...) \ + RT_LOG_##_l(_l, "PID %d: " _fmt, curproc ? curproc->p_pid : 0, \ + ## __VA_ARGS__) MALLOC_DEFINE(M_RTABLE, "routetbl", "routing tables"); From nobody Mon Jul 22 00:55:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zb6hvsz5Qwr8; Mon, 22 Jul 2024 00:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zb3KZtz4hsB; Mon, 22 Jul 2024 00:55:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721609739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HJIOMVYuMAyHwYu2jZXzmSLiQ64XmmcJoMGKRyfd30s=; b=QZRFZajGWKMXiLc0LP3RSoVhuRROeTghbP2HxWJXH/O2No011ZND/kas5DguoMsYzT0INM r1T2GLyJP953UTR/GNlU2jy65+jeFf5Lawtj4yn6Ah+juwq+m43j6CuqguOwtOOxngLbFZ tG5TgIDEMoHtnyZy3tFlhiLri/wGUtLA4pcmXTpxFXj6qmIpMObUi616tRQpXuTJaftman xp0itubC4IExOhB+3EhTDhPpyf4VFimtR/DCIOBOGSNvhbt0VgO+I8+qlbEuvlVjQoWx3j nw/6702FxhTvZZeenrP+5dyHgNa5FUUnpqYrL2QhnmQ058wK6bG+TUfQT/YlLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609739; a=rsa-sha256; cv=none; b=JMqACIbSoS34dm3YQiNt7PqOCBSEC1yjq2NEuUQzu+XxGin8HkrQ+IW8BNeo+qfZKeO6QD 65rddRDb1Dy0wkMUj0fy3691nv6YK9cs2EmWyPkOOK+9Mf3iKrHNXwCQd5xgmX3BrzBGMH ITZmRrtJ5I0UNmf8Cr9ChRxQr6tnQF058M8Ex+g7/E7JxXx4bS3aeB62vG/nkp1OaDOsT3 dfPpAxPTV6r0IqR2eve0qFvwceQt1QQtJBtAojpbc5BREQNp71YZ8pr5nZt6sEk4Jv0HNA RwnOziDs4acbOAqjNYnqETQj40e4+m1Hs4CwaQ7rUmuLmEkZ5GmNAvz3mtjukg== 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=1721609739; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HJIOMVYuMAyHwYu2jZXzmSLiQ64XmmcJoMGKRyfd30s=; b=vyj3QweJEo5r0R8j6ATy9uj7SKxquYdJ2TSgj7YDzXsVzpxQxUAbSEvV0CqYO5AqShcvS8 RvrNq+wQNRJ5hav5XfMMRBvfl/i1nrTsuGoGXd5omN0zhMVkXyzCSGn7mXxAx7A+ZCPjHj HDhHf9wLhDbUILHjxROjQIN9k8nFNSqd6yevaSa1oLiWgq8illImf7r8BMDHoljHFXm6Mr StfYImWTySKKZZF1UIoLFbm5IKF+tVKR4aVgX1oPKMC2YRKkB+dwihv0NtiJQbR4zboHkR yWKrkytM1dt1d/lV0YAXnhJ3gnlHk1mGMXcdjAubKQNRETRTNk8Ym08wGgpUeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zb2wcqzN8f; Mon, 22 Jul 2024 00:55:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0tdjh007380; Mon, 22 Jul 2024 00:55:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0tdq1007377; Mon, 22 Jul 2024 00:55:39 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:39 GMT Message-Id: <202407220055.46M0tdq1007377@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c1dd895406a8 - stable/14 - sched tests: Avoid underflow when maxcpuid == 0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c1dd895406a849bebeceaac6e6f48c4983c37268 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c1dd895406a849bebeceaac6e6f48c4983c37268 commit c1dd895406a849bebeceaac6e6f48c4983c37268 Author: Mark Johnston AuthorDate: 2024-07-14 16:12:32 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:27 +0000 sched tests: Avoid underflow when maxcpuid == 0 MFC after: 1 week (cherry picked from commit 5b98bd30686a358b2a20728a4a6b5cecb7e28dc9) --- tests/sys/kern/sched_affinity.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/sys/kern/sched_affinity.c b/tests/sys/kern/sched_affinity.c index dce8678bcf6e..44802c5ac8e1 100644 --- a/tests/sys/kern/sched_affinity.c +++ b/tests/sys/kern/sched_affinity.c @@ -67,13 +67,16 @@ ATF_TC_BODY(test_setinvalidcpu, tc) { size_t cpusetsize; cpuset_t *set; + int cpu; + + cpu = maxcpuid > 1 ? maxcpuid - 1 : 0; cpusetsize = CPU_ALLOC_SIZE(maxcpuid + 1); set = CPU_ALLOC(maxcpuid + 1); ATF_REQUIRE(set != NULL); CPU_ZERO_S(cpusetsize, set); CPU_SET_S(maxcpuid + 1, cpusetsize, set); - CPU_SET_S(maxcpuid - 1, cpusetsize, set); + CPU_SET_S(cpu, cpusetsize, set); ATF_REQUIRE(sched_setaffinity(0, cpusetsize, set) == 0); CPU_FREE(set); @@ -82,7 +85,7 @@ ATF_TC_BODY(test_setinvalidcpu, tc) ATF_REQUIRE(set != NULL); CPU_ZERO_S(cpusetsize, set); CPU_SET_S(maxcpuid + 1, cpusetsize, set); - CPU_SET_S(maxcpuid - 1, cpusetsize, set); + CPU_SET_S(cpu, cpusetsize, set); ATF_REQUIRE(cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, cpusetsize, set) == -1); ATF_REQUIRE_EQ(errno, EINVAL); From nobody Mon Jul 22 00:55:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zY416bz5QwB2; Mon, 22 Jul 2024 00:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zY1Zrnz4hvS; Mon, 22 Jul 2024 00:55:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721609737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ChuWT3I2yjng/bUgKkXPCm30DuCNAXyLQ1gLcL3r+0=; b=tkeVVqdzFv28vlq0TZgJiUj9bI2xOaGIUXYgG/q8Ql8p4hRjriZson/gW/9B8/BxlHLXa/ WpODfBtAqKjCbh2+XXuLf4PUs0zuMEIIoETMUBdflYi1mYr2pWkSYfXUWi7l4vBlGFhvry r3F+c8po05oyuT+WUe/Kh4F5ZLUWd+zdbrfnv+aoGhtYDfLyrgolnMfrng04TDXJ1akL5J ffvtR1Hb3SYkarKnPVQ8hWGe7YxY91XcUwgDwqI00VlCn68mXlvR1RvK/jUpSoVrhvICKU iR2yFMBELRXg7lpCfzwHIPWEWf/hd13UjCAtTeBk3N6+btvAxgAfuySgmJ8OhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609737; a=rsa-sha256; cv=none; b=DM5rWO7EUOo9HxdzF6/iVLH204eM6pjZLz3zvMs81UgP/qC1ofrbedvU6ywcXULsf13e26 jh2SQGHmayNqvHKdXXhZE4lwc2kz4kWo7CBhrs5quwIb8Yi/wC+zNXEnBFdenQUPg0VjiR j9cEjLsdawkCTaidMUyetV668o39aaLpZroDaUQpXglkPp2H4EBztSLZHh52CEZBUutxjf LsdGH+sd1FpA4HmKg2F9apg0NELqrVQjWYxhppyaED1pr2bXL+LIn/S+O4FMHTdpMn0HC1 3vMvbWGjiar8oZ9shJjBixPh3EC0gxkfA/uJrKe48Xk4SBaOiYhRpLze9D3hNg== 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=1721609737; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4ChuWT3I2yjng/bUgKkXPCm30DuCNAXyLQ1gLcL3r+0=; b=ts0GULkZ+JQ6zGk/eG3RyG02Thu/+evVw7qeQHYrt9WajPujfEdZTaG7FZVOloLvGNJnw4 5wtl6KJrW9Mm3WbWwxovOiOCO73jzDVeFeA1yPMGjIzFB3IUKwddVGo4fAx23ypy67FaVY Oxk1CSdWzmDAEycNAAToNi7TIMRXirtX+RC/CWqQZ6l0a10kKeKM9VlqfmCOzvoOqwH2dW iWces6s5wiMEfN96+sJ/NEIpZRJQ4lA6ZSo4/qqsZBalqFqFY1OCBRYedUMxWM4bY7Qjp4 SfgRFyXvrnT+KJCJYOTjPO4IfnofQhXDr/Kita+cbB85INoIbohIQvQCwZZR6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zY1CFgzNcZ; Mon, 22 Jul 2024 00:55:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0tbkg007280; Mon, 22 Jul 2024 00:55:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0tbuX007277; Mon, 22 Jul 2024 00:55:37 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:37 GMT Message-Id: <202407220055.46M0tbuX007277@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 239c9c6de125 - stable/14 - hptiop: Use device_set_descf() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 239c9c6de1250cc53f9f063fe9c698373aa9709c Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=239c9c6de1250cc53f9f063fe9c698373aa9709c commit 239c9c6de1250cc53f9f063fe9c698373aa9709c Author: Mark Johnston AuthorDate: 2024-07-14 16:18:27 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:27 +0000 hptiop: Use device_set_descf() No functional change intended. MFC after: 1 week (cherry picked from commit 1c64b3aba3d0e2910ac52c18e3c240348eb3e36e) --- sys/dev/hptiop/hptiop.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/dev/hptiop/hptiop.c b/sys/dev/hptiop/hptiop.c index aa1251796bf1..bdb545be5b7e 100644 --- a/sys/dev/hptiop/hptiop.c +++ b/sys/dev/hptiop/hptiop.c @@ -1799,7 +1799,6 @@ static int hptiop_probe(device_t dev) { struct hpt_iop_hba *hba; u_int32_t id; - static char buf[256]; int sas = 0; struct hptiop_adapter_ops *ops; @@ -1852,9 +1851,8 @@ static int hptiop_probe(device_t dev) pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev)); - sprintf(buf, "RocketRAID %x %s Controller\n", - id, sas ? "SAS" : "SATA"); - device_set_desc_copy(dev, buf); + device_set_descf(dev, "RocketRAID %x %s Controller", + id, sas ? "SAS" : "SATA"); hba = (struct hpt_iop_hba *)device_get_softc(dev); bzero(hba, sizeof(struct hpt_iop_hba)); From nobody Mon Jul 22 00:55:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zZ60qzz5Qwr7; Mon, 22 Jul 2024 00:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zZ2cSMz4jDV; Mon, 22 Jul 2024 00:55:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721609738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/boUohqG21H0op7wiTDg8FaZyDou3UlhCh7TahOH5To=; b=XK/NLD7LvceBsyQlupgPVzxGNsuPw7+hm2YP2Y35Zk39MxOsO8txVhhik83c48hO4h3mCj 09R3x4ym4/SHeCZFRnbwJmkonckZlmBa2ol903eZncIX6X89oZPKYDb7Ac/MUVwXPTYLRf uhokKY+9i8isfRYFXGAeu1zih7PRXG4H2SrkEFPiss/aC5NmKCA4spghK7IkACXuwXTOHY 06+wvkLlWEDTH2U0kANamKTs0uBy+yTmTM4QZFk/w0hjw19dnWRBNM5xqyJIXWrVKW9hZk wttiHjqJFIBkJtPq3yToh4Ey59NYvnwMmp8LJri9yO/Z/YRMKfWmwSntVBI1+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609738; a=rsa-sha256; cv=none; b=D8U8NDcd3IEnLf/OACF5HLWo5WCU8nCXv04OB9c85qv8xEv8qrrDfIFa8gRcCZ+E02WpFl 8LAZpog6WxGvzDKgfaQRObrQDwHSrnCwLbTQL/VTrEJk0lDD13LcLtp6MfpPvVSUEI44SR 66wS48M/i5CzSLz7IMrwfUk6+H6uCTPDLyqwzS+3o5j9t0TiLx9BFSP6J4f1S/Iu+Md66G YNNN45BWqK9pchf/SQa/IStNovXO2wL2gp6ZdPJ7TQ8qE1URGQ1M1UlfyAwUTmXi6rhs+j jgEUITiTOejaIFcRE/sEaZBj6pEzyvZ4D+NP7AhDvhivnuSRKvOe8p7G1LPm3w== 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=1721609738; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/boUohqG21H0op7wiTDg8FaZyDou3UlhCh7TahOH5To=; b=NAJa3tXQApcS+h2u6LNoPuLGCTsq9kyzlTEIB9mpEDu2oDikKz/K8N1UM8Ak3todBRGdiF ZoT68EUCbFl4BIdoY0d10F8V4UXN5qiXp8xAKhpXh/R7wXsXDwJra2SUC19U1zwLO975li 4cQzAn+Js9r71VFwuuT3x+oulKTyEND2DdISfHfmLP2lF4xvL+qKbKHwbHlWJ/0loLEnXs xSx26D16Ad6HIW4qIIjgfUTdp1GBEGdmkk6Syvis5lcDkXgrex99KwtJ4/SlqFGmrMTSjL P/RxW4pRaxSfLhO0+Uf1+GA2uuml2pMVF6JxMW9P2v1U4dNLxf4wlOv+YoPnCw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zZ2D4lzNcb; Mon, 22 Jul 2024 00:55:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0tcCK007322; Mon, 22 Jul 2024 00:55:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0tc12007319; Mon, 22 Jul 2024 00:55:38 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:38 GMT Message-Id: <202407220055.46M0tc12007319@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: a8a1633e34f1 - stable/14 - lockf tests: Fix a race List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a8a1633e34f1961f724c5ede96cdb435702b194d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a8a1633e34f1961f724c5ede96cdb435702b194d commit a8a1633e34f1961f724c5ede96cdb435702b194d Author: Mark Johnston AuthorDate: 2024-07-14 16:13:13 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:27 +0000 lockf tests: Fix a race The test launches lockf(1) in the background and races with it, so it shouldn't be using atf_check to check that lockf won the race. MFC after: 1 week (cherry picked from commit 498b3b494b8b3e500e555a9653d950b9e25a2f1a) --- usr.bin/lockf/tests/lockf_test.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/lockf/tests/lockf_test.sh b/usr.bin/lockf/tests/lockf_test.sh index cc6938d2306e..d73c7590653d 100644 --- a/usr.bin/lockf/tests/lockf_test.sh +++ b/usr.bin/lockf/tests/lockf_test.sh @@ -47,7 +47,9 @@ basic_body() lpid=$! # Make sure that the lock exists... - atf_check test -e "testlock" + while ! test -e "testlock"; do + sleep 0.1 + done # Attempt both verbose and silent re-lock atf_check -s exit:${EX_TEMPFAIL} -e not-empty \ From nobody Mon Jul 22 00:55:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zh5TRNz5Qwnk; Mon, 22 Jul 2024 00: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zc58vwz4jF0; Mon, 22 Jul 2024 00: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=1721609740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dKmNzECsxqmrEPedlPS/hPQjJPu82D1WdZ1/F3sYrxU=; b=qWYwG2gDjGJ9wRcjEkMOwq7Q9jeSgggDkKOolPc22njkdGesZnbSRofw7bUyryJF2JFJlH 3FuPIM0ndNxb7HdkDqsgq6ojCx4oa+Zn+1h7P0tn26rl/7J3NSzTJGrt9ecqc/K8ruKmMb x7z8lhG3LnGAVHqdveMIKV9jRLQ74XlNyeaKpFHel92asJMRw6XGKzcxGJ5KQBvAocxrZ5 kSaJ75w/OLLibv5CbTB9VkPByyFQ3+CNjV9I/gIxhyRQyN0vUJIhqXKv+mtXeKMzapCpLu dbaVJKFpl7mGvjoTvjpeJ1ROE7p48hrCvUXUTeyTT3pINXfMS6UqfUosembHzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609740; a=rsa-sha256; cv=none; b=wWN2lk2jh2v+ZxQsozeeNmbcIE7smEmrJmpSLWiuQ50IgRxRpvhvPhODn9XYi7wrPZPSDF rqIrXthKkHkhWk6wZyZHxiNARdCMKNTYV2SNSyoWc1wfIkQmcwt751pAz59Q4ObegQByZA olyE1mTe/6Fi2QyMQ+gJs2GD3J1ElXp21mR+h5DghtxIxH3k7zBKWxOH3XJ2LLsPxSHLWu ibxYCWCVHSoTtda8O+vIyfYpzbu0E9iGVzUNR+avyHd7JaMaYMvSK5u4p2JYOUENVjC4hR 0KHABVpWcVSfNrHS4Pk7iJZpO9E7KYo7GqqivI6ztts+Qfi8uqp2yx9rL0mUcw== 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=1721609740; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dKmNzECsxqmrEPedlPS/hPQjJPu82D1WdZ1/F3sYrxU=; b=YTk/nmP8UFtB0b7W0fnbxtJ6WYMakQIDDYb367pt69BlReUSqpQ+tMhaAJiLzOyvnh3PqA +g9NbgrmZofLYjmFBJrVIvbwolLNPxYiaEFxxi6ZcMv3Ub0Kc8RJKlol3vaw7JFtJn0RF6 A99xSWOajZGBBR70KikHQWXLIUD4P04h9k21Zf5sCuOOoblsKe9qhYfzVhtFzDy7FKD+3l xrCeMBb68DTLpG5seB7TzqOqfscW/SFZeqGfI+kEx4yCMBfVC+nKMlGXFBH706SZriQoxp 0c8fx1XUciuebBDgxxPdl1emuQSgsbO/QIxNsEwN/nZZa14xC1Uvl3agBB7kYQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zc4CjqzN8g; Mon, 22 Jul 2024 00:55:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0teWa007419; Mon, 22 Jul 2024 00:55:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0te0x007416; Mon, 22 Jul 2024 00:55:40 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:40 GMT Message-Id: <202407220055.46M0te0x007416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 73ee1909bfcf - stable/14 - netlink: Wrap long lines List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 73ee1909bfcf7432ef48ef0411c3d0036520417d Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=73ee1909bfcf7432ef48ef0411c3d0036520417d commit 73ee1909bfcf7432ef48ef0411c3d0036520417d Author: Mark Johnston AuthorDate: 2024-07-14 16:20:18 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:27 +0000 netlink: Wrap long lines No functional change intended. MFC after: 1 week Sponsored by: Klara, Inc. (cherry picked from commit e536b197c0cf5c245e0b65f1b73447d53f3656f2) --- sys/netlink/netlink_debug.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/netlink/netlink_debug.h b/sys/netlink/netlink_debug.h index 0d8423d4933a..db987b26b6d7 100644 --- a/sys/netlink/netlink_debug.h +++ b/sys/netlink/netlink_debug.h @@ -46,12 +46,16 @@ SYSCTL_DECL(_net_netlink_debug); * Logging for events specific for particular process * Example: [nl_domain] PID 4834 fdump_sa: unsupported family: 45 */ -#define NL_RAW_PID_LOG(_l, _pid, _fmt, ...) NL_RAW_PID_LOG_##_l(_l, _pid, _fmt, ## __VA_ARGS__) -#define _NL_RAW_PID_LOG(_l, _pid, _fmt, ...) if (_DEBUG_PASS_MSG(_l)) { \ - _output("[" DEBUG_PREFIX_NAME "] PID %u %s: " _fmt "\n", _pid, __func__, ##__VA_ARGS__); \ -} +#define NL_RAW_PID_LOG(_l, _pid, _fmt, ...) \ + NL_RAW_PID_LOG_##_l(_l, _pid, _fmt, ## __VA_ARGS__) +#define _NL_RAW_PID_LOG(_l, _pid, _fmt, ...) \ + if (_DEBUG_PASS_MSG(_l)) { \ + _output("[" DEBUG_PREFIX_NAME "] PID %u %s: " _fmt "\n", _pid, \ + __func__, ##__VA_ARGS__); \ + } -#define NLP_LOG(_l, _nlp, _fmt, ...) NL_RAW_PID_LOG_##_l(_l, nlp_get_pid(_nlp), _fmt, ## __VA_ARGS__) +#define NLP_LOG(_l, _nlp, _fmt, ...) \ + NL_RAW_PID_LOG_##_l(_l, nlp_get_pid(_nlp), _fmt, ## __VA_ARGS__) #if DEBUG_MAX_LEVEL>=LOG_DEBUG3 #define NL_RAW_PID_LOG_LOG_DEBUG3 _NL_RAW_PID_LOG @@ -77,7 +81,5 @@ SYSCTL_DECL(_net_netlink_debug); #define NL_RAW_PID_LOG_LOG_ERR _NL_RAW_PID_LOG #define NL_RAW_PID_LOG_LOG_WARNING _NL_RAW_PID_LOG - - -#endif -#endif +#endif /* _KERNEL */ +#endif /* !_NETLINK_NETLINK_DEBUG_H_ */ From nobody Mon Jul 22 00:55:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS1zj0bdBz5QwJ8; Mon, 22 Jul 2024 00: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS1zd5zw7z4hpk; Mon, 22 Jul 2024 00: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=1721609741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UtXC8eTvpUr2HmaEk+1U52Ip6FQWSiJUGHsutD966G8=; b=W24xRwtYoE2rF67yWRa0PppI5b8ptd6EWBYbb6Eauuu1XXV9s8LWAntVdPQIF/c211wFV9 YR4dI2+MXyOZOXAm+8DCzhOGxGwR1Ic0f4ElQCVBHdkUWfEUxpjHFgM1SGsXKNfC27RQcU lrGJaXhCYUhq1v301h4j1innXwPLk+k9pYy0or8f4jh1LqOfZk2T1wM4q++iIW8es4Gvot TD5U1vlwdUk9e9LYzwh3HsveacdKnjEB+J8nlb4NPmrpnAnHnyvwOVsojI+eJkml1ZZwKF yd5C7PfbVcQrh3X3fBaqpA8w+Mg8ZR6tZvwp8O/B+Y6W9WKkjYX+AOQuYtRONA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721609741; a=rsa-sha256; cv=none; b=fhhbQbwHpZFIM2XHAVlPKmsgM7RlwfesiuhB7b/x70JFD8KI9JWbYGnpEdX5jqRK1GgDWG Sz1C9Qa7NWkQyCcF9qf9Nw4UP+9VJhJCPLdclY2q0PQlwKpKQyu6qf2iWr3JTAnrq3kX6c PlCAyZwLPJnq/xcsLy9aGGjb/zUsGY61nrPd/0XT56jTmWaE1wDE38dkaxzWEtgcSDEuoD KoW6tEVtTKCvl0MffFPQbSaOq72E07tL+5CFailtv+yQtrHASKfC8JjA/2TviRGAGCcso6 WznqsUjUYAGa2tk8l1Cj/JeOqwnwYgMgiI5kzrrsQAF0Pnhu1+3fVwEt08eYrg== 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=1721609741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UtXC8eTvpUr2HmaEk+1U52Ip6FQWSiJUGHsutD966G8=; b=p1ss+F4G3p6bQtt28vo9xmB/5oKUGxQlvo8DYykJ7W3AW8uBfJETKAye2m1yI2aJaIlRRu 6FLu936uRvMwtZy+3CsOsEJMOVbOGFUCncBvfV3KutBYsVpEwl/mFwTCf8heOxYgvyS6B7 ptvEE2VI2bGQ48AgON7tLZryJZHG+J6yC433j9D0eyijVgE8IlhVNbbVDCOuFmJ4G4FF8L RhKaxy08dK8F8LapANtFjCiwGwwkXQ1Y4D+5+b8vRexGYJdr+TiivDohuj64Hz0AqJGDUl CrTMx1VnzHrPE2KIj0I+S12/oXUBmTUvQQCFUP1ceh18msT7Y8oXMT4KFjGbHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS1zd5DMJzNQW; Mon, 22 Jul 2024 00:55:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M0tfAL007467; Mon, 22 Jul 2024 00:55:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M0tfeo007464; Mon, 22 Jul 2024 00:55:41 GMT (envelope-from git) Date: Mon, 22 Jul 2024 00:55:41 GMT Message-Id: <202407220055.46M0tfeo007464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f48bfa248f39 - stable/14 - axgbe: Remove a nonsensical use of kernel_sysctlbyname() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f48bfa248f3991f4a6d9b99b4dcc5099886855b4 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f48bfa248f3991f4a6d9b99b4dcc5099886855b4 commit f48bfa248f3991f4a6d9b99b4dcc5099886855b4 Author: Mark Johnston AuthorDate: 2024-07-14 16:15:23 +0000 Commit: Mark Johnston CommitDate: 2024-07-22 00:55:28 +0000 axgbe: Remove a nonsensical use of kernel_sysctlbyname() No functional change intended. MFC after: 1 week (cherry picked from commit d254651de392538fa7f5c0020093dde0ca06c614) --- sys/dev/axgbe/if_axgbe_pci.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sys/dev/axgbe/if_axgbe_pci.c b/sys/dev/axgbe/if_axgbe_pci.c index 7f661e6d9c98..7a7c8539405c 100644 --- a/sys/dev/axgbe/if_axgbe_pci.c +++ b/sys/dev/axgbe/if_axgbe_pci.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -589,8 +590,6 @@ axgbe_set_counts(if_ctx_t ctx) struct axgbe_if_softc *sc = iflib_get_softc(ctx); struct xgbe_prv_data *pdata = &sc->pdata; cpuset_t lcpus; - int cpu_count, err; - size_t len; /* Set all function pointers */ xgbe_init_all_fptrs(pdata); @@ -617,21 +616,12 @@ axgbe_set_counts(if_ctx_t ctx) * number of Rx queues or maximum allowed */ - /* Get cpu count from sysctl */ - len = sizeof(cpu_count); - err = kernel_sysctlbyname(curthread, "hw.ncpu", &cpu_count, &len, NULL, - 0, NULL, 0); - if (err) { - axgbe_error("Unable to fetch number of cpus\n"); - cpu_count = 1; - } - if (bus_get_cpus(pdata->dev, INTR_CPUS, sizeof(lcpus), &lcpus) != 0) { axgbe_error("Unable to fetch CPU list\n"); /* TODO - handle CPU_COPY(&all_cpus, &lcpus); */ } - DBGPR("ncpu %d intrcpu %d\n", cpu_count, CPU_COUNT(&lcpus)); + DBGPR("ncpu %d intrcpu %d\n", mp_ncpus, CPU_COUNT(&lcpus)); pdata->tx_ring_count = min(CPU_COUNT(&lcpus), pdata->hw_feat.tx_ch_cnt); pdata->tx_ring_count = min(pdata->tx_ring_count, From nobody Mon Jul 22 01:39:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS2y36kbfz5R14x; Mon, 22 Jul 2024 01:39: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS2y367ksz4nJJ; Mon, 22 Jul 2024 01:39:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721612363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=usNLBVnzzkwrp6LjcPhyzC/Ty4DmIs2CeO58HcFhK4k=; b=jgV4rNYjsw9iHG5NjEnVGxSkfbWfbKXPlOqXszq+VUe7xz/9u8klfFYIcljd05QKauMGxM aQGiz9VDIYP+Ug/EmyQaYRJgR00nnpnduoevn4CnPpGLIPz3vLsRtZduFShBnduJYMKszm FN9JRxRCGEY5o+qCVMHqHfvq8kUstdggFFkNTi0T1r/EV5mYSbu2dzELOTZRh+5lbtb3ty NgkOx6vW3i+hibsYHD/5sO0nQOekoKMz2UbGxTaaBGtgGDPsqWpcTr4oQWWKsU/+WLCLlr Jro5lRi208eLgLrmd2QrYdyv1OBlt+ypOPwm02CrTR/zVwMUDorwKbYtI8eh+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721612363; a=rsa-sha256; cv=none; b=xtmCv9sKNwwIf2ELLLUC+ZRl5efOnwEbN5GtVV54hRHn03hPiFJwPYAlWM6ayfbadHyhCW hjywsqdqZIkgTWqqaGeylGVABhoWz9jzzVDrlENBqsAsRCV+gRIvRTx77yKX2Ho5p7GSuE WRyHIwGvvUtSEcwKdJ/I66+hEYQmBARV0YzgiUy6H+i1gzKwIcnly3JeKLvR3b86cLvnXy NKWY2yRHjPvNr3OEqA/DAqTbIc0RxreG6f0jG6CIEHY6VoKsGajREwpWehgtiZYTMwsh29 qxXLdIHreoNd7B7MTq/lSG42wDrrqgOaH0sbctdsr88Yp96nqEVKQ/SEdvEk7Q== 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=1721612363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=usNLBVnzzkwrp6LjcPhyzC/Ty4DmIs2CeO58HcFhK4k=; b=EjuOOPraiz/3XcWmPXhKw5zJLNzxGN9OfeNjT1L2ZAleBaw0VUEe1NEP6XaWe1MlX90UQ9 MNmP1qhnAaG6uv5PUO6yzNZLD+XGL7SCpdgZnlfPUYAFq+oKvQHc60p3OoDiMB6VRgZDWF CEDrhd4aHnfCOpXuPADUjiVz15HOLlPt9fDJJcMqjwt8SQqG35ExvaHrce17Khsa1NXOxi 38o0uQHAv/XkSrvHclvnhOebnj+PFT6OMD0mkSYSfvj7i0WH0nu3iU1BC1AZUZ7ocyJ1Kp hFDr3tLUmxITwygLq9w5fhD4rwVqYECzzzp2pizrtPqKaqudxeG8SJKMiTIGyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS2y35g6rzP2X; Mon, 22 Jul 2024 01:39:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M1dNoP075773; Mon, 22 Jul 2024 01:39:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M1dNas075770; Mon, 22 Jul 2024 01:39:23 GMT (envelope-from git) Date: Mon, 22 Jul 2024 01:39:23 GMT Message-Id: <202407220139.46M1dNas075770@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: c664b786ccd1 - stable/13 - nfsd: Fix nfsrv_cleanclient so that it can be called with a mutex List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c664b786ccd18bd186c59279e26fd19c6a212be4 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c664b786ccd18bd186c59279e26fd19c6a212be4 commit c664b786ccd18bd186c59279e26fd19c6a212be4 Author: Rick Macklem AuthorDate: 2024-06-21 22:08:48 +0000 Commit: Rick Macklem CommitDate: 2024-07-21 23:30:11 +0000 nfsd: Fix nfsrv_cleanclient so that it can be called with a mutex On Feb. 28, a problem was reported on freebsd-stable@ where a nfsd thread processing an ExchangeID operation was blocked for a long time by another nfsd thread performing a copy_file_range. This occurred because the copy_file_range was taking a long time, but also because handling a clientID requires that all other nfsd threads be blocked via an exclusive lock, as required by ExchangeID. This patch adds two arguments to nfsv4_cleanclient() so that it can optionally be called with a mutex held. For this patch, the first of these arguments is "false" and, as such, there is no change in semantics. However, this change will allow a future commit to modify handling of the clientID so that it can be done with a mutex held while other nfsd threads continue to process NFS RPCs. (cherry picked from commit a7de51068502ad1e2851d4a855ed28b27573bb36) --- sys/fs/nfs/nfsrvstate.h | 2 +- sys/fs/nfsserver/nfs_nfsdsocket.c | 2 +- sys/fs/nfsserver/nfs_nfsdstate.c | 53 +++++++++++++++++++++++---------------- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/sys/fs/nfs/nfsrvstate.h b/sys/fs/nfs/nfsrvstate.h index 3652e2c2db2f..c196f43aac04 100644 --- a/sys/fs/nfs/nfsrvstate.h +++ b/sys/fs/nfs/nfsrvstate.h @@ -331,7 +331,7 @@ struct nfsf_rec { u_int32_t numboots; /* Number of boottimes */ }; -void nfsrv_cleanclient(struct nfsclient *, NFSPROC_T *); +void nfsrv_cleanclient(struct nfsclient *, NFSPROC_T *, bool, SVCXPRT **); void nfsrv_freedeleglist(struct nfsstatehead *); /* diff --git a/sys/fs/nfsserver/nfs_nfsdsocket.c b/sys/fs/nfsserver/nfs_nfsdsocket.c index da92b7b0047c..94369c575e52 100644 --- a/sys/fs/nfsserver/nfs_nfsdsocket.c +++ b/sys/fs/nfsserver/nfs_nfsdsocket.c @@ -792,7 +792,7 @@ nfsrvd_compound(struct nfsrv_descript *nd, int isdgram, u_char *tag, !LIST_EMPTY(&clp->lc_deleg)) nfsrv_writestable(clp->lc_id, clp->lc_idlen, NFSNST_REVOKE, p); - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); LIST_REMOVE(clp, lc_hash); diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 06d0b79f10d5..911f5053bd3c 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -203,7 +203,8 @@ static void nfsrv_locallock_commit(struct nfslockfile *lfp, int flags, static void nfsrv_locklf(struct nfslockfile *lfp); static void nfsrv_unlocklf(struct nfslockfile *lfp); static struct nfsdsession *nfsrv_findsession(uint8_t *sessionid); -static int nfsrv_freesession(struct nfsdsession *sep, uint8_t *sessionid); +static int nfsrv_freesession(struct nfsdsession *sep, uint8_t *sessionid, + bool locked, SVCXPRT **old_xprtp); static int nfsv4_setcbsequence(struct nfsrv_descript *nd, struct nfsclient *clp, int dont_replycache, struct nfsdsession **sepp, int *slotposp); static int nfsv4_getcbsession(struct nfsclient *clp, struct nfsdsession **sepp); @@ -329,7 +330,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ if (i != nfsrv_clienthashsize) { LIST_REMOVE(clp, lc_hash); - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); zapit = 1; @@ -382,7 +383,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ if (clp->lc_expiry < NFSD_MONOSEC && (!LIST_EMPTY(&clp->lc_open) || !LIST_EMPTY(&clp->lc_deleg))) { - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); } @@ -445,7 +446,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, /* Get rid of all sessions on this clientid. */ LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) { - ret = nfsrv_freesession(sep, NULL); + ret = nfsrv_freesession(sep, NULL, false, NULL); if (ret != 0) printf("nfsrv_setclient: verifier changed free" " session failed=%d\n", ret); @@ -715,7 +716,7 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, * for an Open with CLAIM_DELEGATE_PREV unless in * grace, but get rid of the rest of the state. */ - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_olddeleg); if (nfsrv_checkgrace(nd, clp, 0)) { /* In grace, so just delete delegations */ @@ -874,7 +875,7 @@ nfsrv_destroyclient(nfsquad_t clientid, NFSPROC_T *p) } /* Destroy the clientid and return ok. */ - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); LIST_REMOVE(clp, lc_hash); @@ -943,7 +944,7 @@ nfsrv_adminrevoke(struct nfsd_clid *revokep, NFSPROC_T *p) */ clp->lc_flags &= ~LCL_CALLBACKSON; clp->lc_flags |= LCL_ADMINREVOKED; - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); NFSLOCKV4ROOTMUTEX(); @@ -1363,7 +1364,8 @@ nfsrv_servertimer(void *arg __unused) * there are no other active nfsd threads. */ void -nfsrv_cleanclient(struct nfsclient *clp, NFSPROC_T *p) +nfsrv_cleanclient(struct nfsclient *clp, NFSPROC_T *p, bool locked, + SVCXPRT **old_xprtp) { struct nfsstate *stp, *nstp; struct nfsdsession *sep, *nsep; @@ -1372,7 +1374,7 @@ nfsrv_cleanclient(struct nfsclient *clp, NFSPROC_T *p) nfsrv_freeopenowner(stp, 1, p); if ((clp->lc_flags & LCL_ADMINREVOKED) == 0) LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) - (void)nfsrv_freesession(sep, NULL); + (void)nfsrv_freesession(sep, NULL, locked, old_xprtp); } /* @@ -4603,7 +4605,7 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, if (procnum != NFSV4PROC_CBNULL) nfsv4_freeslot(&sep->sess_cbsess, slotpos, true); - nfsrv_freesession(sep, NULL); + nfsrv_freesession(sep, NULL, false, NULL); } else if (nd->nd_procnum == NFSV4PROC_CBNULL) error = newnfs_connect(NULL, &clp->lc_req, cred, NULL, 1, dotls, &clp->lc_req.nr_client); @@ -4652,7 +4654,7 @@ nfsrv_docallback(struct nfsclient *clp, int procnum, nfsv4stateid_t *stateidp, nfsv4_freeslot(&sep->sess_cbsess, slotpos, true); } - nfsrv_freesession(sep, NULL); + nfsrv_freesession(sep, NULL, false, NULL); } else error = newnfs_request(nd, NULL, clp, &clp->lc_req, NULL, NULL, cred, clp->lc_program, @@ -5250,7 +5252,7 @@ nfsrv_clientconflict(struct nfsclient *clp, int *haslockp, vnode_t vp, */ nfsrv_writestable(clp->lc_id, clp->lc_idlen, NFSNST_REVOKE, p); nfsrv_backupstable(); - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); LIST_REMOVE(clp, lc_hash); @@ -5442,7 +5444,7 @@ nfsrv_delegconflict(struct nfsstate *stp, int *haslockp, NFSPROC_T *p, nfsrv_writestable(clp->lc_id, clp->lc_idlen, NFSNST_REVOKE, p); nfsrv_backupstable(); if (clp->lc_expiry < NFSD_MONOSEC) { - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); LIST_REMOVE(clp, lc_hash); @@ -6243,7 +6245,7 @@ nfsrv_throwawayallstate(NFSPROC_T *p) for (i = 0; i < nfsrv_clienthashsize; i++) { LIST_FOREACH_SAFE(clp, &NFSD_VNET(nfsclienthash)[i], lc_hash, nclp) { - nfsrv_cleanclient(clp, p); + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); free(clp->lc_stateid, M_NFSDCLIENT); @@ -6456,7 +6458,7 @@ nfsrv_destroysession(struct nfsrv_descript *nd, uint8_t *sessionid) } while (igotlock == 0); NFSUNLOCKV4ROOTMUTEX(); - error = nfsrv_freesession(NULL, sessionid); + error = nfsrv_freesession(NULL, sessionid, false, NULL); if (error == 0 && samesess != 0) nd->nd_flag &= ~ND_HASSEQUENCE; @@ -6547,12 +6549,14 @@ nfsrv_bindconnsess(struct nfsrv_descript *nd, uint8_t *sessionid, int *foreaftp) * Free up a session structure. */ static int -nfsrv_freesession(struct nfsdsession *sep, uint8_t *sessionid) +nfsrv_freesession(struct nfsdsession *sep, uint8_t *sessionid, + bool locked, SVCXPRT **old_xprtp) { struct nfssessionhash *shp; int i; - NFSLOCKSTATE(); + if (!locked) + NFSLOCKSTATE(); if (sep == NULL) { shp = NFSSESSIONHASH(sessionid); NFSLOCKSESSION(shp); @@ -6565,21 +6569,28 @@ nfsrv_freesession(struct nfsdsession *sep, uint8_t *sessionid) sep->sess_refcnt--; if (sep->sess_refcnt > 0) { NFSUNLOCKSESSION(shp); - NFSUNLOCKSTATE(); + if (!locked) + NFSUNLOCKSTATE(); return (NFSERR_BACKCHANBUSY); } LIST_REMOVE(sep, sess_hash); LIST_REMOVE(sep, sess_list); } NFSUNLOCKSESSION(shp); - NFSUNLOCKSTATE(); + if (!locked) + NFSUNLOCKSTATE(); if (sep == NULL) return (NFSERR_BADSESSION); for (i = 0; i < NFSV4_SLOTS; i++) if (sep->sess_slots[i].nfssl_reply != NULL) m_freem(sep->sess_slots[i].nfssl_reply); - if (sep->sess_cbsess.nfsess_xprt != NULL) - SVC_RELEASE(sep->sess_cbsess.nfsess_xprt); + if (!locked) { + if (sep->sess_cbsess.nfsess_xprt != NULL) + SVC_RELEASE(sep->sess_cbsess.nfsess_xprt); + if (old_xprtp != NULL) + *old_xprtp = NULL; + } else if (old_xprtp != NULL) + *old_xprtp = sep->sess_cbsess.nfsess_xprt; free(sep, M_NFSDSESSION); return (0); } From nobody Mon Jul 22 02:36:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS4D84yl0z5R6GV; Mon, 22 Jul 2024 02:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS4D84NrRz4rwX; Mon, 22 Jul 2024 02:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721615800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZHnBb7krYdkLyMpkjstpBdYa0/or+JGHhPaj3QhgjzA=; b=cFhaiE8a+MvuIHDZVWZPG4SbfUjMCzD3OmgA6w62OqkOpj5agxC+CK5oaCgXAj3KanOt7J 1zgHcaZq3Hrm2GDXAWCsdLQUHSj2e4YJGbVy8x8zB9Q76eEydfeFPL+shDtqg635GjF2bf hKG8dQU7t99QF4t0rmV6kxdGItzWv0kdSPN/ZsDMmyK6lKU3ABX3vjR9UWMAnynVzp/hcJ hf/bHa8q+Dwnb5r1RIW27JPF/sJ7wiyybw4WMKfL9dGcyg8uyAC3EpkpcEq9O0TQMTbJOJ /2yRUiuDinL9OvggacMTmtz1CIRhix9DJEGn2ZcsqXH3W3KMcRbt7MyQoXelYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721615800; a=rsa-sha256; cv=none; b=fVY4J4NVuI7R6pNQAre6lu9aQYDmuaOJxDk0lJVUB3jHyHN3fAuIUT/Owg9Plm8RRPTAk6 fn4d7ROscLgm0NdrmmOiVgibKQT/cUNt5EAOxuflVGr7g1oX2X5fxZpDWF/gGIfwS70Bni M0WOXSThGOf4HixpZka6mygjgWV/doEQnXNzLyotzczoW0fQWo7lUowD61Jws/5pND7CMU Obq88lEFg3t4HdSniOcrDvGV33RzDMZIFRiWyHxR29A4rphqZ4wZGnadxj9SrHyGYBgPWq AXUIc2+CrXHwrnsq30Sjt6w/shIM1YsJ4O89Vrl2EXx2+MA3p84L+LGqpecfOA== 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=1721615800; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZHnBb7krYdkLyMpkjstpBdYa0/or+JGHhPaj3QhgjzA=; b=tvpCSjSQZKrPLkzrG06zZrApRrMKvfJO5hgSS9+XgiXnvbZkNDe/dvgGgIg1fXFk/2oyWf SxgMTbCAyVStcFwoqodnHX5kRr5tRAYFtEb6TzwldupaM3MmnulYdwIMExXnUsFGeBPn7y RF70z23Oeoc+sn77jz6fy3rjcYV71n+bwfSmBnw26bq/lCltDsafvz28cAhvFIflaR/kgN TTqPl58xTPvOYDhKdEYBcb+kCp1P2tW0tm9T/P35FxxU2TbfPz9BXf6n/612SlSYSKFsGb rSSd/SinSwliDqDXaljMprdQkFz+GQI95LQkds+1x9M2AB5aZ9IfjNf9aciwYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS4D840D3zRFy; Mon, 22 Jul 2024 02:36:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M2aeCB076829; Mon, 22 Jul 2024 02:36:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M2aewL076826; Mon, 22 Jul 2024 02:36:40 GMT (envelope-from git) Date: Mon, 22 Jul 2024 02:36:40 GMT Message-Id: <202407220236.46M2aewL076826@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 13f9c4addb6e - stable/14 - rc.conf: Leap-seconds sources: Add IANA back List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 13f9c4addb6ed36221d89e61194ea9fe5f8f3aaf Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=13f9c4addb6ed36221d89e61194ea9fe5f8f3aaf commit 13f9c4addb6ed36221d89e61194ea9fe5f8f3aaf Author: Cy Schubert AuthorDate: 2024-07-19 18:04:43 +0000 Commit: Cy Schubert CommitDate: 2024-07-22 02:36:30 +0000 rc.conf: Leap-seconds sources: Add IANA back 11da791920ba switched Leap-seconds source from IANA to IERS, as IERS is the canonoical source. The problem ist that IERS is not accessible from IPv6 only networks. To work around this we must add IANA back in order to provide IPv6-only users a source for leap-seconds fetch. PR: 279413 Fixes: 11da791920ba (cherry picked from commit 66f360515d2829d261c0ad7bd516e9dd18c2dd83) --- 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 a7b149bb0cd4..5073718e91f4 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -424,7 +424,7 @@ ntp_src_leapfile="/etc/ntp/leap-seconds" # Initial source for ntpd leapfile ntp_db_leapfile="/var/db/ntpd.leap-seconds.list" # Canonical place to get the leap seconds from -ntp_leapfile_sources="https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list" +ntp_leapfile_sources="https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list https://data.iana.org/time-zones/tzdb/leap-seconds.list" # Source from which to fetch leapfile ntp_leapfile_fetch_opts="-mq" # Options to use for ntp leapfile fetch, # e.g. --no-verify-peer From nobody Mon Jul 22 02:36:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS4D95sQqz5R68F; Mon, 22 Jul 2024 02:36: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS4D95S16z4rr1; Mon, 22 Jul 2024 02:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721615801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SDrqy4fuE1TmuPhQ1R4i6Glm5oSkDDs7YH/GzmqO8rs=; b=De2nKdxgWWaiFMkzIADQW6X+k95y3TrCaBfUsB7tWcJRANXLYZF9OxBxFo2q9cp4HMoWUS zZTmyiQjWB1bVOEjrdXYF2D7ibAy0NoM5JP4XgDyfTDYvpndVwDJYb5K6iE8HBvrIxqonE EcjK6DJd9dpT3Qz7FePfI2VRNlE89DMw4scNUSldLXkVc0H6fXiCGnmS6jRzhfaOImvMqM zej4z3qO7Mmb2PW8B0eai/0uosvXswccJ0GYFouA2NSNAQCRh6e1EypMed5Q4YhU787q6K dCgF+DfFTwXUVWclnQlb936N/01h5jbmWWaEJsORrHnTmI94QzWTeEFVB8yUHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721615801; a=rsa-sha256; cv=none; b=pjYAXtaImakqQ9Uhja1u6PXBv+/O6zuIBSZ0deZgUI6XNXdSeJzCTObSxl7bVbjEl6HPmi MMXO8bcISx+xFqRGiu+gQrme95kuKKc/yd+pN/2lV9HqhM0uKdZflMQKmtaKWxfpAsTM+0 /vOzemokSgiBxUHvcLRieR2cHX0D903xkGx0T1AI4AFK69NI0m1Vf/6V3LBP0EGJLE4ktR rudLBKpn9NcNQc0grO7kgfkbSvK9mOWHoGbwSG9UWvoInFoGnsWYWge4678mGqEmi+A1Xk PKxJQndz7dxkw76M4gWWDvt6SbM+LzhpA/j1ZzFVruzg425ZVhDKne+CwfyqFw== 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=1721615801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SDrqy4fuE1TmuPhQ1R4i6Glm5oSkDDs7YH/GzmqO8rs=; b=TYdfxMzZ8vhTn+k0eP+9xmW5d1X+nfotPctX6hlPmP7e0g/c0ClMTYwfzLEil0WTnhgXKq rinvOe+zLHzGIEdt9wUNtwlp4wqFjQDHf8B8vcTgSwZxED+3fTqXPRHGd59ye/2JeFGrpH eGjJiCcElrxX3N+rPDcEzZ2KcBtFfTWWikRUVjiXihlcnBuUem3aAmkpAylBgRh4HhokOt JCFGewjHFqIiFqYhXcmL8G7FyhvAofsen7XLYHeHHnwNvf0PjngrgTyL1/H24aZiHf/zog pdlnwpsB4OhhT28IOmBfsL+PEmxOJX+v25C9b33T2eXpVO/nylZo5XzSDYKIoQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS4D952LbzQf0; Mon, 22 Jul 2024 02:36:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M2afFE076880; Mon, 22 Jul 2024 02:36:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M2afeG076877; Mon, 22 Jul 2024 02:36:41 GMT (envelope-from git) Date: Mon, 22 Jul 2024 02:36:41 GMT Message-Id: <202407220236.46M2afeG076877@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 12f2e9525bd8 - stable/14 - leap-seconds: Update to leap-seconds 3960057600 obtained from IERS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 12f2e9525bd8be328febbc5839f763e4a271c05d Auto-Submitted: auto-generated The branch stable/14 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=12f2e9525bd8be328febbc5839f763e4a271c05d commit 12f2e9525bd8be328febbc5839f763e4a271c05d Author: Cy Schubert AuthorDate: 2024-07-21 01:41:09 +0000 Commit: Cy Schubert CommitDate: 2024-07-22 02:36:30 +0000 leap-seconds: Update to leap-seconds 3960057600 obtained from IERS IERS is the canonical source of leap-seconds. IANA, NIST and USNO obtain their leap-second updates from IERS. This resolves an issue for IPv6-only hosts as IERS is not accessible via IPv6, requiring IPv6-only host to rely on some other source, above. From this point forward we should fetch the file from IERS, the organization responsible for deciding when to insert leap-seconds. PR: 279413 Obtained from: https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list Discussed with: imp (cherry picked from commit 04b4dcf04fc345b29b78e5061768091648b8ee2a) --- usr.sbin/ntp/ntpd/leap-seconds | 373 +++++++++++++---------------------------- 1 file changed, 119 insertions(+), 254 deletions(-) diff --git a/usr.sbin/ntp/ntpd/leap-seconds b/usr.sbin/ntp/ntpd/leap-seconds index c5a95aa51799..da0efc8c8566 100644 --- a/usr.sbin/ntp/ntpd/leap-seconds +++ b/usr.sbin/ntp/ntpd/leap-seconds @@ -1,255 +1,120 @@ +# ATOMIC TIME +# Coordinated Universal Time (UTC) is the reference time scale derived +# from The "Temps Atomique International" (TAI) calculated by the Bureau +# International des Poids et Mesures (BIPM) using a worldwide network of atomic +# clocks. UTC differs from TAI by an integer number of seconds; it is the basis +# of all activities in the world. # -# In the following text, the symbol '#' introduces -# a comment, which continues from that symbol until -# the end of the line. A plain comment line has a -# whitespace character following the comment indicator. -# There are also special comment lines defined below. -# A special comment will always have a non-whitespace -# character in column 2. -# -# A blank line should be ignored. -# -# The following table shows the corrections that must -# be applied to compute International Atomic Time (TAI) -# from the Coordinated Universal Time (UTC) values that -# are transmitted by almost all time services. -# -# The first column shows an epoch as a number of seconds -# since 1 January 1900, 00:00:00 (1900.0 is also used to -# indicate the same epoch.) Both of these time stamp formats -# ignore the complexities of the time scales that were -# used before the current definition of UTC at the start -# of 1972. (See note 3 below.) -# The second column shows the number of seconds that -# must be added to UTC to compute TAI for any timestamp -# at or after that epoch. The value on each line is -# valid from the indicated initial instant until the -# epoch given on the next one or indefinitely into the -# future if there is no next line. -# (The comment on each line shows the representation of -# the corresponding initial epoch in the usual -# day-month-year format. The epoch always begins at -# 00:00:00 UTC on the indicated day. See Note 5 below.) -# -# Important notes: -# -# 1. Coordinated Universal Time (UTC) is often referred to -# as Greenwich Mean Time (GMT). The GMT time scale is no -# longer used, and the use of GMT to designate UTC is -# discouraged. -# -# 2. The UTC time scale is realized by many national -# laboratories and timing centers. Each laboratory -# identifies its realization with its name: Thus -# UTC(NIST), UTC(USNO), etc. The differences among -# these different realizations are typically on the -# order of a few nanoseconds (i.e., 0.000 000 00x s) -# and can be ignored for many purposes. These differences -# are tabulated in Circular T, which is published monthly -# by the International Bureau of Weights and Measures -# (BIPM). See www.bipm.org for more information. -# -# 3. The current definition of the relationship between UTC -# and TAI dates from 1 January 1972. A number of different -# time scales were in use before that epoch, and it can be -# quite difficult to compute precise timestamps and time -# intervals in those "prehistoric" days. For more information, -# consult: -# -# The Explanatory Supplement to the Astronomical -# Ephemeris. -# or -# Terry Quinn, "The BIPM and the Accurate Measurement -# of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, -# July, 1991. -# reprinted in: -# Christine Hackman and Donald B Sullivan (eds.) -# Time and Frequency Measurement -# American Association of Physics Teachers (1996) -# , pp. 75-86 -# -# 4. The decision to insert a leap second into UTC is currently -# the responsibility of the International Earth Rotation and -# Reference Systems Service. (The name was changed from the -# International Earth Rotation Service, but the acronym IERS -# is still used.) -# -# Leap seconds are announced by the IERS in its Bulletin C. -# -# See www.iers.org for more details. -# -# Every national laboratory and timing center uses the -# data from the BIPM and the IERS to construct UTC(lab), -# their local realization of UTC. -# -# Although the definition also includes the possibility -# of dropping seconds ("negative" leap seconds), this has -# never been done and is unlikely to be necessary in the -# foreseeable future. -# -# 5. If your system keeps time as the number of seconds since -# some epoch (e.g., NTP timestamps), then the algorithm for -# assigning a UTC time stamp to an event that happens during a positive -# leap second is not well defined. The official name of that leap -# second is 23:59:60, but there is no way of representing that time -# in these systems. -# Many systems of this type effectively stop the system clock for -# one second during the leap second and use a time that is equivalent -# to 23:59:59 UTC twice. For these systems, the corresponding TAI -# timestamp would be obtained by advancing to the next entry in the -# following table when the time equivalent to 23:59:59 UTC -# is used for the second time. Thus the leap second which -# occurred on 30 June 1972 at 23:59:59 UTC would have TAI -# timestamps computed as follows: -# -# ... -# 30 June 1972 23:59:59 (2287785599, first time): TAI= UTC + 10 seconds -# 30 June 1972 23:59:60 (2287785599,second time): TAI= UTC + 11 seconds -# 1 July 1972 00:00:00 (2287785600) TAI= UTC + 11 seconds -# ... -# -# If your system realizes the leap second by repeating 00:00:00 UTC twice -# (this is possible but not usual), then the advance to the next entry -# in the table must occur the second time that a time equivalent to -# 00:00:00 UTC is used. Thus, using the same example as above: -# -# ... -# 30 June 1972 23:59:59 (2287785599): TAI= UTC + 10 seconds -# 30 June 1972 23:59:60 (2287785600, first time): TAI= UTC + 10 seconds -# 1 July 1972 00:00:00 (2287785600,second time): TAI= UTC + 11 seconds -# ... -# -# in both cases the use of timestamps based on TAI produces a smooth -# time scale with no discontinuity in the time interval. However, -# although the long-term behavior of the time scale is correct in both -# methods, the second method is technically not correct because it adds -# the extra second to the wrong day. -# -# This complexity would not be needed for negative leap seconds (if they -# are ever used). The UTC time would skip 23:59:59 and advance from -# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by -# 1 second at the same instant. This is a much easier situation to deal -# with, since the difficulty of unambiguously representing the epoch -# during the leap second does not arise. -# -# Some systems implement leap seconds by amortizing the leap second -# over the last few minutes of the day. The frequency of the local -# clock is decreased (or increased) to realize the positive (or -# negative) leap second. This method removes the time step described -# above. Although the long-term behavior of the time scale is correct -# in this case, this method introduces an error during the adjustment -# period both in time and in frequency with respect to the official -# definition of UTC. -# -# Questions or comments to: -# Judah Levine -# Time and Frequency Division -# NIST -# Boulder, Colorado -# Judah.Levine@nist.gov -# -# Last Update of leap second values: 8 July 2016 -# -# The following line shows this last update date in NTP timestamp -# format. This is the date on which the most recent change to -# the leap second data was added to the file. This line can -# be identified by the unique pair of characters in the first two -# columns as shown below. -# -#$ 3676924800 -# -# The NTP timestamps are in units of seconds since the NTP epoch, -# which is 1 January 1900, 00:00:00. The Modified Julian Day number -# corresponding to the NTP time stamp, X, can be computed as -# -# X/86400 + 15020 -# -# where the first term converts seconds to days and the second -# term adds the MJD corresponding to the time origin defined above. -# The integer portion of the result is the integer MJD for that -# day, and any remainder is the time of day, expressed as the -# fraction of the day since 0 hours UTC. The conversion from day -# fraction to seconds or to hours, minutes, and seconds may involve -# rounding or truncation, depending on the method used in the -# computation. -# -# The data in this file will be updated periodically as new leap -# seconds are announced. In addition to being entered on the line -# above, the update time (in NTP format) will be added to the basic -# file name leap-seconds to form the name leap-seconds.. -# In addition, the generic name leap-seconds.list will always point to -# the most recent version of the file. -# -# This update procedure will be performed only when a new leap second -# is announced. -# -# The following entry specifies the expiration date of the data -# in this file in units of seconds since the origin at the instant -# 1 January 1900, 00:00:00. This expiration date will be changed -# at least twice per year whether or not a new leap second is -# announced. These semi-annual changes will be made no later -# than 1 June and 1 December of each year to indicate what -# action (if any) is to be taken on 30 June and 31 December, -# respectively. (These are the customary effective dates for new -# leap seconds.) This expiration date will be identified by a -# unique pair of characters in columns 1 and 2 as shown below. -# In the unlikely event that a leap second is announced with an -# effective date other than 30 June or 31 December, then this -# file will be edited to include that leap second as soon as it is -# announced or at least one month before the effective date -# (whichever is later). -# If an announcement by the IERS specifies that no leap second is -# scheduled, then only the expiration date of the file will -# be advanced to show that the information in the file is still -# current -- the update time stamp, the data and the name of the file -# will not change. -# -# Updated through IERS Bulletin C67 -# File expires on: 28 December 2024 -# -#@ 3944332800 -# -2272060800 10 # 1 Jan 1972 -2287785600 11 # 1 Jul 1972 -2303683200 12 # 1 Jan 1973 -2335219200 13 # 1 Jan 1974 -2366755200 14 # 1 Jan 1975 -2398291200 15 # 1 Jan 1976 -2429913600 16 # 1 Jan 1977 -2461449600 17 # 1 Jan 1978 -2492985600 18 # 1 Jan 1979 -2524521600 19 # 1 Jan 1980 -2571782400 20 # 1 Jul 1981 -2603318400 21 # 1 Jul 1982 -2634854400 22 # 1 Jul 1983 -2698012800 23 # 1 Jul 1985 -2776982400 24 # 1 Jan 1988 -2840140800 25 # 1 Jan 1990 -2871676800 26 # 1 Jan 1991 -2918937600 27 # 1 Jul 1992 -2950473600 28 # 1 Jul 1993 -2982009600 29 # 1 Jul 1994 -3029443200 30 # 1 Jan 1996 -3076704000 31 # 1 Jul 1997 -3124137600 32 # 1 Jan 1999 -3345062400 33 # 1 Jan 2006 -3439756800 34 # 1 Jan 2009 -3550089600 35 # 1 Jul 2012 -3644697600 36 # 1 Jul 2015 -3692217600 37 # 1 Jan 2017 -# -# the following special comment contains the -# hash value of the data in this file computed -# use the secure hash algorithm as specified -# by FIPS 180-1. See the files in ~/pub/sha for -# the details of how this hash value is -# computed. Note that the hash computation -# ignores comments and whitespace characters -# in data lines. It includes the NTP values -# of both the last modification time and the -# expiration time of the file, but not the -# white space on those lines. -# the hash line is also ignored in the -# computation. -# -#h 199a9d45 3f630d2f e47cb9cc c2f0fa47 96932227 +# +# ASTRONOMICAL TIME (UT1) is the time scale based on the rate of rotation of the earth. +# It is now mainly derived from Very Long Baseline Interferometry (VLBI). The various +# irregular fluctuations progressively detected in the rotation rate of the Earth led +# in 1972 to the replacement of UT1 by UTC as the reference time scale. +# +# +# LEAP SECOND +# Atomic clocks are more stable than the rate of the earth's rotation since the latter +# undergoes a full range of geophysical perturbations at various time scales: lunisolar +# and core-mantle torques, atmospheric and oceanic effects, etc. +# Leap seconds are needed to keep the two time scales in agreement, i.e. UT1-UTC smaller +# than 0.9 seconds. Therefore, when necessary a "leap second" is applied to UTC. +# Since the adoption of this system in 1972 it has been necessary to add a number of seconds to UTC, +# firstly due to the initial choice of the value of the second (1/86400 mean solar day of +# the year 1820) and secondly to the general slowing down of the Earth's rotation. It is +# theoretically possible to have a negative leap second (a second removed from UTC), but so far, +# all leap seconds have been positive (a second has been added to UTC). Based on what we know about +# the earth's rotation, it is unlikely that we will ever have a negative leap second. +# +# +# HISTORY +# The first leap second was added on June 30, 1972. Until the year 2000, it was necessary in average to add a +# leap second at a rate of 1 to 2 years. Since the year 2000 leap seconds are introduced with an +# average interval of 3 to 4 years due to the acceleration of the Earth's rotation speed. +# +# +# RESPONSIBILITY OF THE DECISION TO INTRODUCE A LEAP SECOND IN UTC +# The decision to introduce a leap second in UTC is the responsibility of the Earth Orientation Center of +# the International Earth Rotation and reference System Service (IERS). This center is located at Paris +# Observatory. According to international agreements, leap seconds should be scheduled only for certain dates: +# first preference is given to the end of December and June, and second preference at the end of March +# and September. Since the introduction of leap seconds in 1972, only dates in June and December were used. +# +# Questions or comments to: +# Christian Bizouard: christian.bizouard@obspm.fr +# Earth orientation Center of the IERS +# Paris Observatory, France +# +# +# +# COPYRIGHT STATUS OF THIS FILE +# This file is in the public domain. +# +# +# VALIDITY OF THE FILE +# It is important to express the validity of the file. These next two dates are +# given in units of seconds since 1900.0. +# +# 1) Last update of the file. +# +# Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) +# +# The following line shows the last update of this file in NTP timestamp: +# +#$ 3929093563 +# +# 2) Expiration date of the file given on a semi-annual basis: last June or last December +# +# File expires on 28 June 2025 +# +# Expire date in NTP timestamp: +# +#@ 3960057600 +# +# +# LIST OF LEAP SECONDS +# NTP timestamp (X parameter) is the number of seconds since 1900.0 +# +# MJD: The Modified Julian Day number. MJD = X/86400 + 15020 +# +# DTAI: The difference DTAI= TAI-UTC in units of seconds +# It is the quantity to add to UTC to get the time in TAI +# +# Day Month Year : epoch in clear +# +#NTP Time DTAI Day Month Year +# +2272060800 10 # 1 Jan 1972 +2287785600 11 # 1 Jul 1972 +2303683200 12 # 1 Jan 1973 +2335219200 13 # 1 Jan 1974 +2366755200 14 # 1 Jan 1975 +2398291200 15 # 1 Jan 1976 +2429913600 16 # 1 Jan 1977 +2461449600 17 # 1 Jan 1978 +2492985600 18 # 1 Jan 1979 +2524521600 19 # 1 Jan 1980 +2571782400 20 # 1 Jul 1981 +2603318400 21 # 1 Jul 1982 +2634854400 22 # 1 Jul 1983 +2698012800 23 # 1 Jul 1985 +2776982400 24 # 1 Jan 1988 +2840140800 25 # 1 Jan 1990 +2871676800 26 # 1 Jan 1991 +2918937600 27 # 1 Jul 1992 +2950473600 28 # 1 Jul 1993 +2982009600 29 # 1 Jul 1994 +3029443200 30 # 1 Jan 1996 +3076704000 31 # 1 Jul 1997 +3124137600 32 # 1 Jan 1999 +3345062400 33 # 1 Jan 2006 +3439756800 34 # 1 Jan 2009 +3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 +3692217600 37 # 1 Jan 2017 +# +# A hash code has been generated to be able to verify the integrity +# of this file. For more information about using this hash code, +# please see the readme file in the 'source' directory : +# https://hpiers.obspm.fr/iers/bul/bulc/ntp/sources/README +# +#h be738595 57b0cf1b b0218343 fb77062f 5a775e7 From nobody Mon Jul 22 02:37:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS4Dh2ncPz5R6DK; Mon, 22 Jul 2024 02:37: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS4Dh1xtPz4sgx; Mon, 22 Jul 2024 02:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721615828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nWJrC+0w2DP/FHOhFQnRDYDeGgCS//2ccVucu7FLCU8=; b=vrOd/XDD+c4tnGfoVHKnyXBYHWb8Ac7lWhtluKUWWtTCOflFFm4gTM/Xr0dzCylLhZPZHU BQcSYN9byzLztGSTwwODxrHgUlyZS5K9Pl27+62RNosG21zgt2Qg8RI9R0Ench4WEdZzNb vz4M2bbN1O23UGKQt3D8hBJsTGfa/thTENBMCRg9DCdQJ44KQ/UA7RncHy3hnT4ZyIZOTr XElArBkz2TvMvoHDReTXuj/PnlOTZVId4uY9u4mg96xMHJB/OjU3zkh4YfNODwjM6f/7EY 9VFy/F+dzvu4m7FXmXvfQX5f8qzDwZpSlLHj4lu+3i1V3wtIHHcOTbDMSKnISg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721615828; a=rsa-sha256; cv=none; b=Qvq+JayfO24DGX6Mog3VulnlrRmpMyunibaAoH576sX2ydUZ+hVB3lzoMLLJOlgeepbQkJ ayrZzhmQAwsWoiOKP0dXKONBafJL81IGQ0CadcZnumZ72kgRMeDhv3sfx0RFEbGOcOoOex ZANP1czsRaynwBAttwwfVKZpOAoHyrbU2d0OFgAdONoxgZ676ZMS4A+Il/eT6uBxS9tXC0 vfrAth6y1Xn4dZPEQThHN4rhcSaYogKzpO6tYoKDYmeYyDyw68ypXIkuGbcVRjNwRNzg25 kyPdinTjh5i5RoI08xZwXJJ1Ci42bOCMPCQfQFuRngww91WH2HcBCBC7pBxkfA== 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=1721615828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nWJrC+0w2DP/FHOhFQnRDYDeGgCS//2ccVucu7FLCU8=; b=DdkRBymp69ZJf2mvQc8tjHxB+3m9ayeuB2Xm2LE/PQyl2Q0Rt71LzCYOvVX40HM2XYDmoL J+eBMTQqtk7mnoxHHnoCjky5XlrjzjwU+Fucjjx8vMEtA/zcrjiyI3v4vqzpAgTX+N9NFz Kd6U7njgfTmGvzRMLRwbKiRRi7VuK10xVH2DW4VNRakCcdlz8EyfHXBB0ZpbVP4doOZ4xf uP/kMtebQhZ2dmSfNZZBKmidSXmCM5+BGkaQDRpD1O3vX5cUwObvpKn274y7gC3O4YIWTE jNH67poDnWU6UxRBxydAePdJbLvuozXBnEB1Heasj1dgNaO/8wZfTNlFs6ORQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS4Dh1Wr6zQf1; Mon, 22 Jul 2024 02:37:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M2b8PZ077081; Mon, 22 Jul 2024 02:37:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M2b8Sp077078; Mon, 22 Jul 2024 02:37:08 GMT (envelope-from git) Date: Mon, 22 Jul 2024 02:37:08 GMT Message-Id: <202407220237.46M2b8Sp077078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 176f8488e167 - stable/13 - rc.conf: Leap-seconds sources: Add IANA back List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 176f8488e167ec3943108965c7c0e3e98fe167da Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=176f8488e167ec3943108965c7c0e3e98fe167da commit 176f8488e167ec3943108965c7c0e3e98fe167da Author: Cy Schubert AuthorDate: 2024-07-19 18:04:43 +0000 Commit: Cy Schubert CommitDate: 2024-07-22 02:37:03 +0000 rc.conf: Leap-seconds sources: Add IANA back 11da791920ba switched Leap-seconds source from IANA to IERS, as IERS is the canonoical source. The problem ist that IERS is not accessible from IPv6 only networks. To work around this we must add IANA back in order to provide IPv6-only users a source for leap-seconds fetch. PR: 279413 Fixes: 11da791920ba (cherry picked from commit 66f360515d2829d261c0ad7bd516e9dd18c2dd83) --- 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 16c44baaa68a..fab8ffb4fff9 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -421,7 +421,7 @@ ntp_src_leapfile="/etc/ntp/leap-seconds" # Initial source for ntpd leapfile ntp_db_leapfile="/var/db/ntpd.leap-seconds.list" # Canonical place to get the leap seconds from -ntp_leapfile_sources="https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list" +ntp_leapfile_sources="https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list https://data.iana.org/time-zones/tzdb/leap-seconds.list" # Source from which to fetch leapfile ntp_leapfile_fetch_opts="-mq" # Options to use for ntp leapfile fetch, # e.g. --no-verify-peer From nobody Mon Jul 22 02:37:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS4Dj2vXHz5R6B0; Mon, 22 Jul 2024 02:37: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS4Dj2KDZz4scR; Mon, 22 Jul 2024 02:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721615829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gSJYpYgcMeXzR+D/hOD3r3w/CIQZpRQ42ml7Fd88FEk=; b=LMWGWyhYBdF7WKuWGVbJVzFlKqMZkKthxuyfLRW5b2bnNtI+izUIc2tNewzDd/ZsQwGtzb U86Xb2L1eJmauoN7UkOizPQZBk9TluuWhK9gwEroitNiETtpERHZOHQnWd1PreNfuEvQua 4Ez8ZC1esqWYBiXQAAvwOTmrReL7zHrX0XGHYgfCzZuFwfumXzaBHyqhD1SXe9ZD8udBTW enmTbzt3gesweE0odb5wryh+mAz2maeTM+Bi3v0NEoDqwW1sYCTrF0AV+3IYA5VOOr/q7x J2eivIHHY0D2FBqc013qOSph3a4YnkEmOQ9PHjC9qGNTHfRo4Vo5IEIWlb0uEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721615829; a=rsa-sha256; cv=none; b=FweWHJYiYCnPusFW42eaon/ItZcl0zZ3dxR+NzEuqzvtAKKI4oXk74utIX4EcFg8doQ9ZE tv7Yexc7AfyvlOGZ0Ud8psS14GLddheu5BZUvqfau+e6i3pyNQfV1F6wAjSEr3dWgoSViL +FriZI4QWU98IMd1r0qOlFTVbFCAuInAtFCZ+URsVIJmfkyFXNUIIWzp92EyVsR1XR4E8X wPfbgMYJa7k/+KXzSuk3YQ3opteq9t1dt+TcTu/f/LJGqbDqLuqziNGRN9bTF4BnhXCu8c u3ZgwBOCwLMgMoqRpJkwVWG2vW5qClgVMm4hVgfHvf4bEdNUBsOj3Vvp0HfGSQ== 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=1721615829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gSJYpYgcMeXzR+D/hOD3r3w/CIQZpRQ42ml7Fd88FEk=; b=cme7j5gELTnkRLDPQrqdggxvw1sq123ZbnIrxAxTTxGKbfdpYVObZmmHFEYpo02/g0zT+j kSp5qBgufFY4SQVP48XvyjcJiNR79nqbGcYtA6yKbITr1fRkgF1rwOW45Ni+1U2ZRhOKin b16D3iwlXOtj9682aUB6iActJjsaCr+crJVJLbkiBxWeI3JYABY5+Lif77o1uZyGAZcucw fg82Vq5+2J5PilN5LZb/RYSpKWaBP8tCMHNu7QZRcY4EdiQ0RWypDAM0GnlnByb7C0l132 O4xmduSyl6AkG7+Yl+wgqPuFd/kfDfCQ1F6yDvPEiNT5DeKsL00KfkalW4TvtQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS4Dj1wqJzQwT; Mon, 22 Jul 2024 02:37:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M2b9xw077136; Mon, 22 Jul 2024 02:37:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M2b92A077133; Mon, 22 Jul 2024 02:37:09 GMT (envelope-from git) Date: Mon, 22 Jul 2024 02:37:09 GMT Message-Id: <202407220237.46M2b92A077133@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: fad8955b97cc - stable/13 - leap-seconds: Update to leap-seconds 3960057600 obtained from IERS List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fad8955b97cc2d29c2d66b63c4346611715eff6e Auto-Submitted: auto-generated The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=fad8955b97cc2d29c2d66b63c4346611715eff6e commit fad8955b97cc2d29c2d66b63c4346611715eff6e Author: Cy Schubert AuthorDate: 2024-07-21 01:41:09 +0000 Commit: Cy Schubert CommitDate: 2024-07-22 02:37:03 +0000 leap-seconds: Update to leap-seconds 3960057600 obtained from IERS IERS is the canonical source of leap-seconds. IANA, NIST and USNO obtain their leap-second updates from IERS. This resolves an issue for IPv6-only hosts as IERS is not accessible via IPv6, requiring IPv6-only host to rely on some other source, above. From this point forward we should fetch the file from IERS, the organization responsible for deciding when to insert leap-seconds. PR: 279413 Obtained from: https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list Discussed with: imp (cherry picked from commit 04b4dcf04fc345b29b78e5061768091648b8ee2a) --- usr.sbin/ntp/ntpd/leap-seconds | 373 +++++++++++++---------------------------- 1 file changed, 119 insertions(+), 254 deletions(-) diff --git a/usr.sbin/ntp/ntpd/leap-seconds b/usr.sbin/ntp/ntpd/leap-seconds index c5a95aa51799..da0efc8c8566 100644 --- a/usr.sbin/ntp/ntpd/leap-seconds +++ b/usr.sbin/ntp/ntpd/leap-seconds @@ -1,255 +1,120 @@ +# ATOMIC TIME +# Coordinated Universal Time (UTC) is the reference time scale derived +# from The "Temps Atomique International" (TAI) calculated by the Bureau +# International des Poids et Mesures (BIPM) using a worldwide network of atomic +# clocks. UTC differs from TAI by an integer number of seconds; it is the basis +# of all activities in the world. # -# In the following text, the symbol '#' introduces -# a comment, which continues from that symbol until -# the end of the line. A plain comment line has a -# whitespace character following the comment indicator. -# There are also special comment lines defined below. -# A special comment will always have a non-whitespace -# character in column 2. -# -# A blank line should be ignored. -# -# The following table shows the corrections that must -# be applied to compute International Atomic Time (TAI) -# from the Coordinated Universal Time (UTC) values that -# are transmitted by almost all time services. -# -# The first column shows an epoch as a number of seconds -# since 1 January 1900, 00:00:00 (1900.0 is also used to -# indicate the same epoch.) Both of these time stamp formats -# ignore the complexities of the time scales that were -# used before the current definition of UTC at the start -# of 1972. (See note 3 below.) -# The second column shows the number of seconds that -# must be added to UTC to compute TAI for any timestamp -# at or after that epoch. The value on each line is -# valid from the indicated initial instant until the -# epoch given on the next one or indefinitely into the -# future if there is no next line. -# (The comment on each line shows the representation of -# the corresponding initial epoch in the usual -# day-month-year format. The epoch always begins at -# 00:00:00 UTC on the indicated day. See Note 5 below.) -# -# Important notes: -# -# 1. Coordinated Universal Time (UTC) is often referred to -# as Greenwich Mean Time (GMT). The GMT time scale is no -# longer used, and the use of GMT to designate UTC is -# discouraged. -# -# 2. The UTC time scale is realized by many national -# laboratories and timing centers. Each laboratory -# identifies its realization with its name: Thus -# UTC(NIST), UTC(USNO), etc. The differences among -# these different realizations are typically on the -# order of a few nanoseconds (i.e., 0.000 000 00x s) -# and can be ignored for many purposes. These differences -# are tabulated in Circular T, which is published monthly -# by the International Bureau of Weights and Measures -# (BIPM). See www.bipm.org for more information. -# -# 3. The current definition of the relationship between UTC -# and TAI dates from 1 January 1972. A number of different -# time scales were in use before that epoch, and it can be -# quite difficult to compute precise timestamps and time -# intervals in those "prehistoric" days. For more information, -# consult: -# -# The Explanatory Supplement to the Astronomical -# Ephemeris. -# or -# Terry Quinn, "The BIPM and the Accurate Measurement -# of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, -# July, 1991. -# reprinted in: -# Christine Hackman and Donald B Sullivan (eds.) -# Time and Frequency Measurement -# American Association of Physics Teachers (1996) -# , pp. 75-86 -# -# 4. The decision to insert a leap second into UTC is currently -# the responsibility of the International Earth Rotation and -# Reference Systems Service. (The name was changed from the -# International Earth Rotation Service, but the acronym IERS -# is still used.) -# -# Leap seconds are announced by the IERS in its Bulletin C. -# -# See www.iers.org for more details. -# -# Every national laboratory and timing center uses the -# data from the BIPM and the IERS to construct UTC(lab), -# their local realization of UTC. -# -# Although the definition also includes the possibility -# of dropping seconds ("negative" leap seconds), this has -# never been done and is unlikely to be necessary in the -# foreseeable future. -# -# 5. If your system keeps time as the number of seconds since -# some epoch (e.g., NTP timestamps), then the algorithm for -# assigning a UTC time stamp to an event that happens during a positive -# leap second is not well defined. The official name of that leap -# second is 23:59:60, but there is no way of representing that time -# in these systems. -# Many systems of this type effectively stop the system clock for -# one second during the leap second and use a time that is equivalent -# to 23:59:59 UTC twice. For these systems, the corresponding TAI -# timestamp would be obtained by advancing to the next entry in the -# following table when the time equivalent to 23:59:59 UTC -# is used for the second time. Thus the leap second which -# occurred on 30 June 1972 at 23:59:59 UTC would have TAI -# timestamps computed as follows: -# -# ... -# 30 June 1972 23:59:59 (2287785599, first time): TAI= UTC + 10 seconds -# 30 June 1972 23:59:60 (2287785599,second time): TAI= UTC + 11 seconds -# 1 July 1972 00:00:00 (2287785600) TAI= UTC + 11 seconds -# ... -# -# If your system realizes the leap second by repeating 00:00:00 UTC twice -# (this is possible but not usual), then the advance to the next entry -# in the table must occur the second time that a time equivalent to -# 00:00:00 UTC is used. Thus, using the same example as above: -# -# ... -# 30 June 1972 23:59:59 (2287785599): TAI= UTC + 10 seconds -# 30 June 1972 23:59:60 (2287785600, first time): TAI= UTC + 10 seconds -# 1 July 1972 00:00:00 (2287785600,second time): TAI= UTC + 11 seconds -# ... -# -# in both cases the use of timestamps based on TAI produces a smooth -# time scale with no discontinuity in the time interval. However, -# although the long-term behavior of the time scale is correct in both -# methods, the second method is technically not correct because it adds -# the extra second to the wrong day. -# -# This complexity would not be needed for negative leap seconds (if they -# are ever used). The UTC time would skip 23:59:59 and advance from -# 23:59:58 to 00:00:00 in that case. The TAI offset would decrease by -# 1 second at the same instant. This is a much easier situation to deal -# with, since the difficulty of unambiguously representing the epoch -# during the leap second does not arise. -# -# Some systems implement leap seconds by amortizing the leap second -# over the last few minutes of the day. The frequency of the local -# clock is decreased (or increased) to realize the positive (or -# negative) leap second. This method removes the time step described -# above. Although the long-term behavior of the time scale is correct -# in this case, this method introduces an error during the adjustment -# period both in time and in frequency with respect to the official -# definition of UTC. -# -# Questions or comments to: -# Judah Levine -# Time and Frequency Division -# NIST -# Boulder, Colorado -# Judah.Levine@nist.gov -# -# Last Update of leap second values: 8 July 2016 -# -# The following line shows this last update date in NTP timestamp -# format. This is the date on which the most recent change to -# the leap second data was added to the file. This line can -# be identified by the unique pair of characters in the first two -# columns as shown below. -# -#$ 3676924800 -# -# The NTP timestamps are in units of seconds since the NTP epoch, -# which is 1 January 1900, 00:00:00. The Modified Julian Day number -# corresponding to the NTP time stamp, X, can be computed as -# -# X/86400 + 15020 -# -# where the first term converts seconds to days and the second -# term adds the MJD corresponding to the time origin defined above. -# The integer portion of the result is the integer MJD for that -# day, and any remainder is the time of day, expressed as the -# fraction of the day since 0 hours UTC. The conversion from day -# fraction to seconds or to hours, minutes, and seconds may involve -# rounding or truncation, depending on the method used in the -# computation. -# -# The data in this file will be updated periodically as new leap -# seconds are announced. In addition to being entered on the line -# above, the update time (in NTP format) will be added to the basic -# file name leap-seconds to form the name leap-seconds.. -# In addition, the generic name leap-seconds.list will always point to -# the most recent version of the file. -# -# This update procedure will be performed only when a new leap second -# is announced. -# -# The following entry specifies the expiration date of the data -# in this file in units of seconds since the origin at the instant -# 1 January 1900, 00:00:00. This expiration date will be changed -# at least twice per year whether or not a new leap second is -# announced. These semi-annual changes will be made no later -# than 1 June and 1 December of each year to indicate what -# action (if any) is to be taken on 30 June and 31 December, -# respectively. (These are the customary effective dates for new -# leap seconds.) This expiration date will be identified by a -# unique pair of characters in columns 1 and 2 as shown below. -# In the unlikely event that a leap second is announced with an -# effective date other than 30 June or 31 December, then this -# file will be edited to include that leap second as soon as it is -# announced or at least one month before the effective date -# (whichever is later). -# If an announcement by the IERS specifies that no leap second is -# scheduled, then only the expiration date of the file will -# be advanced to show that the information in the file is still -# current -- the update time stamp, the data and the name of the file -# will not change. -# -# Updated through IERS Bulletin C67 -# File expires on: 28 December 2024 -# -#@ 3944332800 -# -2272060800 10 # 1 Jan 1972 -2287785600 11 # 1 Jul 1972 -2303683200 12 # 1 Jan 1973 -2335219200 13 # 1 Jan 1974 -2366755200 14 # 1 Jan 1975 -2398291200 15 # 1 Jan 1976 -2429913600 16 # 1 Jan 1977 -2461449600 17 # 1 Jan 1978 -2492985600 18 # 1 Jan 1979 -2524521600 19 # 1 Jan 1980 -2571782400 20 # 1 Jul 1981 -2603318400 21 # 1 Jul 1982 -2634854400 22 # 1 Jul 1983 -2698012800 23 # 1 Jul 1985 -2776982400 24 # 1 Jan 1988 -2840140800 25 # 1 Jan 1990 -2871676800 26 # 1 Jan 1991 -2918937600 27 # 1 Jul 1992 -2950473600 28 # 1 Jul 1993 -2982009600 29 # 1 Jul 1994 -3029443200 30 # 1 Jan 1996 -3076704000 31 # 1 Jul 1997 -3124137600 32 # 1 Jan 1999 -3345062400 33 # 1 Jan 2006 -3439756800 34 # 1 Jan 2009 -3550089600 35 # 1 Jul 2012 -3644697600 36 # 1 Jul 2015 -3692217600 37 # 1 Jan 2017 -# -# the following special comment contains the -# hash value of the data in this file computed -# use the secure hash algorithm as specified -# by FIPS 180-1. See the files in ~/pub/sha for -# the details of how this hash value is -# computed. Note that the hash computation -# ignores comments and whitespace characters -# in data lines. It includes the NTP values -# of both the last modification time and the -# expiration time of the file, but not the -# white space on those lines. -# the hash line is also ignored in the -# computation. -# -#h 199a9d45 3f630d2f e47cb9cc c2f0fa47 96932227 +# +# ASTRONOMICAL TIME (UT1) is the time scale based on the rate of rotation of the earth. +# It is now mainly derived from Very Long Baseline Interferometry (VLBI). The various +# irregular fluctuations progressively detected in the rotation rate of the Earth led +# in 1972 to the replacement of UT1 by UTC as the reference time scale. +# +# +# LEAP SECOND +# Atomic clocks are more stable than the rate of the earth's rotation since the latter +# undergoes a full range of geophysical perturbations at various time scales: lunisolar +# and core-mantle torques, atmospheric and oceanic effects, etc. +# Leap seconds are needed to keep the two time scales in agreement, i.e. UT1-UTC smaller +# than 0.9 seconds. Therefore, when necessary a "leap second" is applied to UTC. +# Since the adoption of this system in 1972 it has been necessary to add a number of seconds to UTC, +# firstly due to the initial choice of the value of the second (1/86400 mean solar day of +# the year 1820) and secondly to the general slowing down of the Earth's rotation. It is +# theoretically possible to have a negative leap second (a second removed from UTC), but so far, +# all leap seconds have been positive (a second has been added to UTC). Based on what we know about +# the earth's rotation, it is unlikely that we will ever have a negative leap second. +# +# +# HISTORY +# The first leap second was added on June 30, 1972. Until the year 2000, it was necessary in average to add a +# leap second at a rate of 1 to 2 years. Since the year 2000 leap seconds are introduced with an +# average interval of 3 to 4 years due to the acceleration of the Earth's rotation speed. +# +# +# RESPONSIBILITY OF THE DECISION TO INTRODUCE A LEAP SECOND IN UTC +# The decision to introduce a leap second in UTC is the responsibility of the Earth Orientation Center of +# the International Earth Rotation and reference System Service (IERS). This center is located at Paris +# Observatory. According to international agreements, leap seconds should be scheduled only for certain dates: +# first preference is given to the end of December and June, and second preference at the end of March +# and September. Since the introduction of leap seconds in 1972, only dates in June and December were used. +# +# Questions or comments to: +# Christian Bizouard: christian.bizouard@obspm.fr +# Earth orientation Center of the IERS +# Paris Observatory, France +# +# +# +# COPYRIGHT STATUS OF THIS FILE +# This file is in the public domain. +# +# +# VALIDITY OF THE FILE +# It is important to express the validity of the file. These next two dates are +# given in units of seconds since 1900.0. +# +# 1) Last update of the file. +# +# Updated through IERS Bulletin C (https://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat) +# +# The following line shows the last update of this file in NTP timestamp: +# +#$ 3929093563 +# +# 2) Expiration date of the file given on a semi-annual basis: last June or last December +# +# File expires on 28 June 2025 +# +# Expire date in NTP timestamp: +# +#@ 3960057600 +# +# +# LIST OF LEAP SECONDS +# NTP timestamp (X parameter) is the number of seconds since 1900.0 +# +# MJD: The Modified Julian Day number. MJD = X/86400 + 15020 +# +# DTAI: The difference DTAI= TAI-UTC in units of seconds +# It is the quantity to add to UTC to get the time in TAI +# +# Day Month Year : epoch in clear +# +#NTP Time DTAI Day Month Year +# +2272060800 10 # 1 Jan 1972 +2287785600 11 # 1 Jul 1972 +2303683200 12 # 1 Jan 1973 +2335219200 13 # 1 Jan 1974 +2366755200 14 # 1 Jan 1975 +2398291200 15 # 1 Jan 1976 +2429913600 16 # 1 Jan 1977 +2461449600 17 # 1 Jan 1978 +2492985600 18 # 1 Jan 1979 +2524521600 19 # 1 Jan 1980 +2571782400 20 # 1 Jul 1981 +2603318400 21 # 1 Jul 1982 +2634854400 22 # 1 Jul 1983 +2698012800 23 # 1 Jul 1985 +2776982400 24 # 1 Jan 1988 +2840140800 25 # 1 Jan 1990 +2871676800 26 # 1 Jan 1991 +2918937600 27 # 1 Jul 1992 +2950473600 28 # 1 Jul 1993 +2982009600 29 # 1 Jul 1994 +3029443200 30 # 1 Jan 1996 +3076704000 31 # 1 Jul 1997 +3124137600 32 # 1 Jan 1999 +3345062400 33 # 1 Jan 2006 +3439756800 34 # 1 Jan 2009 +3550089600 35 # 1 Jul 2012 +3644697600 36 # 1 Jul 2015 +3692217600 37 # 1 Jan 2017 +# +# A hash code has been generated to be able to verify the integrity +# of this file. For more information about using this hash code, +# please see the readme file in the 'source' directory : +# https://hpiers.obspm.fr/iers/bul/bulc/ntp/sources/README +# +#h be738595 57b0cf1b b0218343 fb77062f 5a775e7 From nobody Mon Jul 22 03:57:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS61L2JWgz5RDgP; Mon, 22 Jul 2024 03:57: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS61L22XNz41Pd; Mon, 22 Jul 2024 03:57:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721620646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uf25q/OGb5nNuax/2ga3HFAzD7fSN80m1Cmsy76dGhw=; b=sBd00+jALXGqdVwh/PeUb+usie2fqxAXn2RpkH9Nztp3ekhS/LdAdCxH2owbUbDTY3GjyI WgxHWQ6WpyooVnPxmgp7umtqSi5WHTHsP1OGotaLcoAWSmmhQkjBphURV1ZDe4SCym+0oN BXBAFmZ8WUBLXZ+m35CBpSdX9d7BnhsmSaWqwZHo/gh4/XYXK+Bs6l8OJRNcm2ev8J2zEo ER23KL20PWu75Yz98Zk/8tRus7BloMFStmRS+2GHMDH8O8RCdMcqiC8f8ScveGgdt4egb/ oLsZEDXdzSjXPrQI7xfzRTcL1GnM1QY9pFQVqPKet/UrBpT9OmbaiTVQHEj0QA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721620646; a=rsa-sha256; cv=none; b=knG+PPisC19r+B7lSU07MYdX593w1rpH+e40DhnwwsyIQzlmZrALXDfeHNCKML1BVAgeTK gNeyvpleZ32DYUFUJpa1GD914cQfHJEOy822vmt9a4ExVWXC6ibzRHLNrvZXJLKN02AkrE ExkUzhQBUl8EDorbqj/y9RbriiH9laZUg5C6FG7Hx766TkHc1nlthvclcnwkrgC8PZ8i/2 c5Km2fr2BkE7Ha10+cwXhwHjLGomA9hlM1HSRAcmMRtRlbwR13krbP3rPkatfupEOj62gA AGuaLFXQG7Q2S4leeEoAXn4EWkMB2jDkgUbnnaGUTou5Ef76xQcJy/GhvPPzIQ== 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=1721620646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uf25q/OGb5nNuax/2ga3HFAzD7fSN80m1Cmsy76dGhw=; b=bK2kg82agFbwUEjL0+rsSTWsPYBXdJjALaUzz5SyFL4Fj++xOZDaItCMrQ4n+y1Ubrt5Bj YHMJ4A5YKTpM8IIt4OgYTcI41i25XfEKAyggPffICK3Ody8TDHMyl5YEP6LSYKw5GlrjNl rz/amfR0WubyXaKxRWIGqXWZka4lbKU8C1zT5DzU/9tdgA+z8pR8YS2RrpXW+I3X1ydBVR aRCV8WnbvrcbYiWwaSDjILuiA0QDN9xuI0tW87E0rIVXHmfZw4/qkuIXKyV5ykFp8NHgec ypcgcfTUrNnWv2J4ShqLjqk+4DG1Bz/k7N9kTRq0m+5ukGji5pOLKyFlqVaGmg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS61L1YRKzTDM; Mon, 22 Jul 2024 03:57:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M3vQdp014875; Mon, 22 Jul 2024 03:57:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M3vQx0014872; Mon, 22 Jul 2024 03:57:26 GMT (envelope-from git) Date: Mon, 22 Jul 2024 03:57:26 GMT Message-Id: <202407220357.46M3vQx0014872@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 5241b210a4e1 - main - cxgbe(4): Basic infrastructure for ULDs to participate in adapter reset. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5241b210a4e1029f3005faf82cd74965645c401b Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=5241b210a4e1029f3005faf82cd74965645c401b commit 5241b210a4e1029f3005faf82cd74965645c401b Author: Navdeep Parhar AuthorDate: 2024-07-08 17:42:49 +0000 Commit: Navdeep Parhar CommitDate: 2024-07-22 03:24:03 +0000 cxgbe(4): Basic infrastructure for ULDs to participate in adapter reset. The suspend/resume/reset implementation in the base driver (LLD) currently works when only stateless features are in use. This commit adds basic infrastructure for stateful upper layer drivers (ULDs) to participate in suspend/resume/reset. * Add a uld_restart to indicate that the adapter has been restarted after a stop and the ULD should resume operations. * Move the existing functionality in t4_suspend/t4_resume to stop_lld and restart_lld. Use these and the new uld restart routines everywhere the adapter has to be stopped abruptly and restarted, namely: 1. PCIE bus suspend/resume/reset methods invoked by the kernel. 2. Manual internal-reset using driver sysctl. 3. Automatic internal-reset on a fatal error. * Implement an alternate internal-reset for use in VMs and for testing. Typical reset sequence is: stop_adapter(sc); stop_lld(sc); stop_all_uld(sc); set_adapter_hwstatus(sc, false); /* hw reset takes place here. */ restart_adapter(sc); restart_lld(sc); set_adapter_hwstatus(sc, true); restart_all_uld(sc); MFC after: 1 month Sponsored by: Chelsio Communications --- sys/dev/cxgbe/adapter.h | 10 +- sys/dev/cxgbe/offload.h | 1 + sys/dev/cxgbe/t4_main.c | 334 ++++++++++++++++++++++++++---------------------- 3 files changed, 191 insertions(+), 154 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 36529601dffa..0d731e736823 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -1122,11 +1122,19 @@ forwarding_intr_to_fwq(struct adapter *sc) static inline bool hw_off_limits(struct adapter *sc) { - int off_limits = atomic_load_int(&sc->error_flags) & HW_OFF_LIMITS; + const int off_limits = atomic_load_int(&sc->error_flags) & HW_OFF_LIMITS; return (__predict_false(off_limits != 0)); } +static inline bool +adapter_stopped(struct adapter *sc) +{ + const int stopped = atomic_load_int(&sc->error_flags) & ADAP_STOPPED; + + return (__predict_false(stopped != 0)); +} + static inline int mbuf_nsegs(struct mbuf *m) { diff --git a/sys/dev/cxgbe/offload.h b/sys/dev/cxgbe/offload.h index a55d6f45cabf..877fdb6b0a89 100644 --- a/sys/dev/cxgbe/offload.h +++ b/sys/dev/cxgbe/offload.h @@ -212,6 +212,7 @@ struct uld_info { int (*uld_activate)(struct adapter *); int (*uld_deactivate)(struct adapter *); int (*uld_stop)(struct adapter *); + int (*uld_restart)(struct adapter *); }; struct tom_tunables { diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 9ff56b93a0e6..1fb560124fb0 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -861,10 +861,16 @@ static int read_i2c(struct adapter *, struct t4_i2c_data *); static int clear_stats(struct adapter *, u_int); static int hold_clip_addr(struct adapter *, struct t4_clip_addr *); static int release_clip_addr(struct adapter *, struct t4_clip_addr *); +static inline int stop_adapter(struct adapter *); +static inline void set_adapter_hwstatus(struct adapter *, const bool); +static int stop_lld(struct adapter *); +static inline int restart_adapter(struct adapter *); +static int restart_lld(struct adapter *); #ifdef TCP_OFFLOAD static int toe_capability(struct vi_info *, bool); -static int t4_deactivate_all_uld(struct adapter *); +static int deactivate_all_uld(struct adapter *); static void stop_all_uld(struct adapter *); +static void restart_all_uld(struct adapter *); #endif #ifdef KERN_TLS static int ktls_capability(struct adapter *, bool); @@ -1764,7 +1770,7 @@ t4_detach_common(device_t dev) sc = device_get_softc(dev); #ifdef TCP_OFFLOAD - rc = t4_deactivate_all_uld(sc); + rc = deactivate_all_uld(sc); if (rc) { device_printf(dev, "failed to detach upper layer drivers: %d\n", rc); @@ -1909,57 +1915,77 @@ t4_detach_common(device_t dev) return (0); } -static inline bool -ok_to_reset(struct adapter *sc) +static inline int +stop_adapter(struct adapter *sc) { - struct tid_info *t = &sc->tids; - struct port_info *pi; - struct vi_info *vi; - int i, j; - int caps = IFCAP_TOE | IFCAP_NETMAP | IFCAP_TXRTLMT; - - if (is_t6(sc)) - caps |= IFCAP_TXTLS; + if (atomic_testandset_int(&sc->error_flags, ilog2(ADAP_STOPPED))) { + CH_ALERT(sc, "%s from %p, flags 0x%08x,0x%08x, EALREADY\n", + __func__, curthread, sc->flags, sc->error_flags); + return (EALREADY); + } + CH_ALERT(sc, "%s from %p, flags 0x%08x,0x%08x\n", __func__, curthread, + sc->flags, sc->error_flags); + return (t4_shutdown_adapter(sc)); +} - ASSERT_SYNCHRONIZED_OP(sc); - MPASS(!(sc->flags & IS_VF)); +static inline int +restart_adapter(struct adapter *sc) +{ + uint32_t val; - for_each_port(sc, i) { - pi = sc->port[i]; - for_each_vi(pi, j, vi) { - if (if_getcapenable(vi->ifp) & caps) - return (false); - } + if (!atomic_testandclear_int(&sc->error_flags, ilog2(ADAP_STOPPED))) { + CH_ALERT(sc, "%s from %p, flags 0x%08x,0x%08x, EALREADY\n", + __func__, curthread, sc->flags, sc->error_flags); + return (EALREADY); } + CH_ALERT(sc, "%s from %p, flags 0x%08x,0x%08x\n", __func__, curthread, + sc->flags, sc->error_flags); + + MPASS(hw_off_limits(sc)); + MPASS((sc->flags & FW_OK) == 0); + MPASS((sc->flags & MASTER_PF) == 0); + MPASS(sc->reset_thread == NULL); - if (atomic_load_int(&t->tids_in_use) > 0) - return (false); - if (atomic_load_int(&t->stids_in_use) > 0) - return (false); - if (atomic_load_int(&t->atids_in_use) > 0) - return (false); - if (atomic_load_int(&t->ftids_in_use) > 0) - return (false); - if (atomic_load_int(&t->hpftids_in_use) > 0) - return (false); - if (atomic_load_int(&t->etids_in_use) > 0) - return (false); + /* + * The adapter is supposed to be back on PCIE with its config space and + * BARs restored to their state before reset. Register access via + * t4_read_reg BAR0 should just work. + */ + sc->reset_thread = curthread; + val = t4_read_reg(sc, A_PL_WHOAMI); + if (val == 0xffffffff || val == 0xeeeeeeee) { + CH_ERR(sc, "%s: device registers not readable.\n", __func__); + sc->reset_thread = NULL; + atomic_set_int(&sc->error_flags, ADAP_STOPPED); + return (ENXIO); + } + atomic_clear_int(&sc->error_flags, ADAP_FATAL_ERR); + atomic_add_int(&sc->incarnation, 1); + atomic_add_int(&sc->num_resets, 1); - return (true); + return (0); } -static inline int -stop_adapter(struct adapter *sc) +static inline void +set_adapter_hwstatus(struct adapter *sc, const bool usable) { - if (atomic_testandset_int(&sc->error_flags, ilog2(ADAP_STOPPED))) - return (1); /* Already stopped. */ - return (t4_shutdown_adapter(sc)); + mtx_lock(&sc->reg_lock); + if (usable) { + /* Must be marked reusable by the designated thread. */ + MPASS(sc->reset_thread == curthread); + atomic_clear_int(&sc->error_flags, HW_OFF_LIMITS); + } else { + /* Mark the adapter totally off limits. */ + atomic_set_int(&sc->error_flags, HW_OFF_LIMITS); + sc->flags &= ~(FW_OK | MASTER_PF); + sc->reset_thread = NULL; + } + mtx_unlock(&sc->reg_lock); } static int -t4_suspend(device_t dev) +stop_lld(struct adapter *sc) { - struct adapter *sc = device_get_softc(dev); struct port_info *pi; struct vi_info *vi; if_t ifp; @@ -1974,25 +2000,20 @@ t4_suspend(device_t dev) #endif int rc, i, j, k; - CH_ALERT(sc, "suspend requested\n"); - - rc = begin_synchronized_op(sc, NULL, SLEEP_OK, "t4sus"); + /* + * XXX: Can there be a synch_op in progress that will hang because + * hardware has been stopped? We'll hang too and the solution will be + * to use a version of begin_synch_op that wakes up existing synch_op + * with errors. Maybe stop_adapter should do this wakeup? + * + * I don't think any synch_op could get stranded waiting for DMA or + * interrupt so I think we're okay here. Remove this comment block + * after testing. + */ + rc = begin_synchronized_op(sc, NULL, SLEEP_OK, "t4slld"); if (rc != 0) return (ENXIO); - /* XXX: Can the kernel call suspend repeatedly without resume? */ - MPASS(!hw_off_limits(sc)); - - if (!ok_to_reset(sc)) { - /* XXX: should list what resource is preventing suspend. */ - CH_ERR(sc, "not safe to suspend.\n"); - rc = EBUSY; - goto done; - } - - /* No more DMA or interrupts. */ - stop_adapter(sc); - /* Quiesce all activity. */ for_each_port(sc, i) { pi = sc->port[i]; @@ -2069,25 +2090,33 @@ t4_suspend(device_t dev) callout_stop(&sc->cal_callout); callout_drain(&sc->cal_callout); - /* Mark the adapter totally off limits. */ - mtx_lock(&sc->reg_lock); - atomic_set_int(&sc->error_flags, HW_OFF_LIMITS); - sc->flags &= ~(FW_OK | MASTER_PF); - sc->reset_thread = NULL; - mtx_unlock(&sc->reg_lock); - if (t4_clock_gate_on_suspend) { t4_set_reg_field(sc, A_PMU_PART_CG_PWRMODE, F_MA_PART_CGEN | F_LE_PART_CGEN | F_EDC1_PART_CGEN | F_EDC0_PART_CGEN | F_TP_PART_CGEN | F_PDP_PART_CGEN | F_SGE_PART_CGEN, 0); } - CH_ALERT(sc, "suspend completed.\n"); -done: end_synchronized_op(sc, 0); return (rc); } +static int +t4_suspend(device_t dev) +{ + struct adapter *sc = device_get_softc(dev); + + CH_ALERT(sc, "%s from thread %p.\n", __func__, curthread); + stop_adapter(sc); + stop_lld(sc); +#ifdef TCP_OFFLOAD + stop_all_uld(sc); +#endif + set_adapter_hwstatus(sc, false); + CH_ALERT(sc, "%s end (thread %p).\n", __func__, curthread); + + return (0); +} + struct adapter_pre_reset_state { u_int flags; uint16_t nbmcaps; @@ -2240,9 +2269,8 @@ compare_caps_and_params(struct adapter *sc, struct adapter_pre_reset_state *o) } static int -t4_resume(device_t dev) +restart_lld(struct adapter *sc) { - struct adapter *sc = device_get_softc(dev); struct adapter_pre_reset_state *old_state = NULL; struct port_info *pi; struct vi_info *vi; @@ -2250,37 +2278,18 @@ t4_resume(device_t dev) struct sge_txq *txq; int rc, i, j, k; - CH_ALERT(sc, "resume requested.\n"); - - rc = begin_synchronized_op(sc, NULL, SLEEP_OK, "t4res"); + rc = begin_synchronized_op(sc, NULL, SLEEP_OK, "t4rlld"); if (rc != 0) return (ENXIO); - MPASS(hw_off_limits(sc)); - MPASS((sc->flags & FW_OK) == 0); - MPASS((sc->flags & MASTER_PF) == 0); - MPASS(sc->reset_thread == NULL); - sc->reset_thread = curthread; - - /* Register access is expected to work by the time we're here. */ - if (t4_read_reg(sc, A_PL_WHOAMI) == 0xffffffff) { - CH_ERR(sc, "%s: can't read device registers\n", __func__); - rc = ENXIO; - goto done; - } - - /* Note that HW_OFF_LIMITS is cleared a bit later. */ - atomic_clear_int(&sc->error_flags, ADAP_FATAL_ERR | ADAP_STOPPED); /* Restore memory window. */ setup_memwin(sc); /* Go no further if recovery mode has been requested. */ if (TUNABLE_INT_FETCH("hw.cxgbe.sos", &i) && i != 0) { - CH_ALERT(sc, "recovery mode on resume.\n"); + CH_ALERT(sc, "%s: recovery mode during restart.\n", __func__); rc = 0; - mtx_lock(&sc->reg_lock); - atomic_clear_int(&sc->error_flags, HW_OFF_LIMITS); - mtx_unlock(&sc->reg_lock); + set_adapter_hwstatus(sc, true); goto done; } @@ -2346,9 +2355,7 @@ t4_resume(device_t dev) * want to access the hardware too. It is safe to do so. Note that * this thread is still in the middle of a synchronized_op. */ - mtx_lock(&sc->reg_lock); - atomic_clear_int(&sc->error_flags, HW_OFF_LIMITS); - mtx_unlock(&sc->reg_lock); + set_adapter_hwstatus(sc, true); if (sc->flags & FULL_INIT_DONE) { rc = adapter_full_init(sc); @@ -2437,95 +2444,101 @@ t4_resume(device_t dev) /* Reset all calibration */ t4_calibration_start(sc); - done: - if (rc == 0) { - sc->incarnation++; - CH_ALERT(sc, "resume completed.\n"); - } end_synchronized_op(sc, 0); free(old_state, M_CXGBE); return (rc); } static int -t4_reset_prepare(device_t dev, device_t child) +t4_resume(device_t dev) { struct adapter *sc = device_get_softc(dev); - CH_ALERT(sc, "reset_prepare.\n"); + CH_ALERT(sc, "%s from thread %p.\n", __func__, curthread); + restart_adapter(sc); + restart_lld(sc); +#ifdef TCP_OFFLOAD + restart_all_uld(sc); +#endif + CH_ALERT(sc, "%s end (thread %p).\n", __func__, curthread); + return (0); } static int -t4_reset_post(device_t dev, device_t child) +t4_reset_prepare(device_t dev, device_t child) { struct adapter *sc = device_get_softc(dev); - CH_ALERT(sc, "reset_post.\n"); + CH_ALERT(sc, "%s from thread %p.\n", __func__, curthread); return (0); } static int -reset_adapter(struct adapter *sc) +t4_reset_post(device_t dev, device_t child) { - int rc, oldinc, error_flags; - - CH_ALERT(sc, "reset requested.\n"); - - rc = begin_synchronized_op(sc, NULL, SLEEP_OK, "t4rst1"); - if (rc != 0) - return (EBUSY); - - if (hw_off_limits(sc)) { - CH_ERR(sc, "adapter is suspended, use resume (not reset).\n"); - rc = ENXIO; - goto done; - } + struct adapter *sc = device_get_softc(dev); - if (!ok_to_reset(sc)) { - /* XXX: should list what resource is preventing reset. */ - CH_ERR(sc, "not safe to reset.\n"); - rc = EBUSY; - goto done; - } + CH_ALERT(sc, "%s from thread %p.\n", __func__, curthread); + return (0); +} -done: - oldinc = sc->incarnation; - end_synchronized_op(sc, 0); - if (rc != 0) - return (rc); /* Error logged already. */ +static int +reset_adapter_with_pci_bus_reset(struct adapter *sc) +{ + int rc; - atomic_add_int(&sc->num_resets, 1); mtx_lock(&Giant); rc = BUS_RESET_CHILD(device_get_parent(sc->dev), sc->dev, 0); mtx_unlock(&Giant); - if (rc != 0) - CH_ERR(sc, "bus_reset_child failed: %d.\n", rc); - else { - rc = begin_synchronized_op(sc, NULL, SLEEP_OK, "t4rst2"); - if (rc != 0) - return (EBUSY); - error_flags = atomic_load_int(&sc->error_flags); - if (sc->incarnation > oldinc && error_flags == 0) { - CH_ALERT(sc, "bus_reset_child succeeded.\n"); - } else { - CH_ERR(sc, "adapter did not reset properly, flags " - "0x%08x, error_flags 0x%08x.\n", sc->flags, - error_flags); - rc = ENXIO; - } - end_synchronized_op(sc, 0); - } - return (rc); } +static int +reset_adapter_with_pl_rst(struct adapter *sc) +{ + stop_adapter(sc); + stop_lld(sc); +#ifdef TCP_OFFLOAD + stop_all_uld(sc); +#endif + set_adapter_hwstatus(sc, false); + + /* This is a t4_write_reg without the hw_off_limits check. */ + MPASS(sc->error_flags & HW_OFF_LIMITS); + bus_space_write_4(sc->bt, sc->bh, A_PL_RST, + F_PIORSTMODE | F_PIORST | F_AUTOPCIEPAUSE); + pause("pl_rst", 1 * hz); /* Wait 1s for reset */ + + restart_adapter(sc); + restart_lld(sc); +#ifdef TCP_OFFLOAD + restart_all_uld(sc); +#endif + + return (0); +} + static void reset_adapter_task(void *arg, int pending) { - /* XXX: t4_async_event here? */ - reset_adapter(arg); + struct adapter *sc = arg; + const int flags = sc->flags; + const int eflags = sc->error_flags; + int rc; + + if (pending > 1) + CH_ALERT(sc, "%s: pending %d\n", __func__, pending); + if (vm_guest == 0) + rc = reset_adapter_with_pci_bus_reset(sc); + else + rc = reset_adapter_with_pl_rst(sc); + if (rc != 0) { + CH_ERR(sc, "adapter did not reset properly, rc = %d, " + "flags 0x%08x -> 0x%08x, err_flags 0x%08x -> 0x%08x.\n", + rc, flags, sc->flags, eflags, sc->error_flags); + } } static int @@ -3615,9 +3628,6 @@ fatal_error_task(void *arg, int pending) struct adapter *sc = arg; int rc; -#ifdef TCP_OFFLOAD - stop_all_uld(sc); -#endif if (atomic_testandclear_int(&sc->error_flags, ilog2(ADAP_CIM_ERR))) { dump_cim_regs(sc); dump_cimla(sc); @@ -3625,8 +3635,8 @@ fatal_error_task(void *arg, int pending) } if (t4_reset_on_fatal_err) { - CH_ALERT(sc, "resetting on fatal error.\n"); - rc = reset_adapter(sc); + CH_ALERT(sc, "resetting adapter after fatal error.\n"); + rc = reset_adapter_with_pci_bus_reset(sc); if (rc == 0 && t4_panic_on_fatal_err) { CH_ALERT(sc, "reset was successful, " "system will NOT panic.\n"); @@ -12484,7 +12494,7 @@ t4_deactivate_uld(struct adapter *sc, int id) } static int -t4_deactivate_all_uld(struct adapter *sc) +deactivate_all_uld(struct adapter *sc) { int i, rc; @@ -12524,6 +12534,24 @@ stop_all_uld(struct adapter *sc) end_synchronized_op(sc, 0); } +static void +restart_all_uld(struct adapter *sc) +{ + int i; + + if (begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4uldre") != 0) + return; + sx_slock(&t4_uld_list_lock); + for (i = 0; i <= ULD_MAX; i++) { + if (t4_uld_list[i] == NULL || !uld_active(sc, i) || + t4_uld_list[i]->uld_restart == NULL) + continue; + (void) t4_uld_list[i]->uld_restart(sc); + } + sx_sunlock(&t4_uld_list_lock); + end_synchronized_op(sc, 0); +} + int uld_active(struct adapter *sc, int id) { From nobody Mon Jul 22 03:57:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS61M4wsSz5RDY4; Mon, 22 Jul 2024 03:57: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS61M2dThz41JY; Mon, 22 Jul 2024 03:57:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721620647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CpFAHjFInBQ2N0Kc27GhxCtYHwk9ZQfJ5Ji5OUx7hhc=; b=H8jNq81nMjp2JzcOdI+u2BuJgdYnf6+HVha1OOr2feEKoroHAIEOpXguxTLMOnFGSeKZMp tHIj69t5umgoWxMVwY8yxZyhB3W40jPgKoEFJHOax5kcOXP3unFZDG2p2ym95u7QBfkz1I QUZbM/Ee/37sc0QEJ6ybe9RP9Iej127+iD+FrdwiIYNRvH2lKk9zu8buVlrMSefuGTVnLy YCdOfihcMnZQz5f1ALucj1KGA9Fpd7G4TKvCtV8p8Bk6wZtC64AoQ+5VlLE87MlMgMcIQb dd3yCs6ZkKQwUym+d38dTGrm88/Ws3YblGg5cuDzZcExmDlkLVzu/J3gGjcnog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721620647; a=rsa-sha256; cv=none; b=YnzocOGCMcfKPhb6yfWUFThL7Y+mgysHbRroFH1x8hMxrCsAD0Rlrz1/HaUzljMs5RVjF3 6kn/zfCvssI1UrcbJbxm/3kU/G7UGf1S02+WHWs+Vbw3U0dtNMKIju8ZaTweb76I46vexZ pJiQiRdnJ9NEsiPnTViu/1BFipnCDQvYfO4HLGjhGsSnmOOz5DB4cLYzdb5p7KVB/C71Ac leHz+7dltqRVlvHQhXasMPhCYUJ7JXT8iVYI18XkWK+2MP03IctK7H/7nE5+5G/HBVcZrG 4vMk/rNoC3T9SHqSNgvr0IKxJ4q9lkV4VaWnV3OhRhUi9rGjU99FjXFnwTOZUA== 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=1721620647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CpFAHjFInBQ2N0Kc27GhxCtYHwk9ZQfJ5Ji5OUx7hhc=; b=SDEkEgcFiRu7kx8sR43Ovlvi637SSDJtgifYWIYxx3yn2+5VCjxsZttmVEeuQCWDAw0Y6H 41fBx7AaU2CKlEVIk347BjMVq1Mss7THAWTGWagGm40EhdduuN86KWQwnR+P6fi7PuGbkm kPDtwlBDx7WnizpB3v8MK0TIAeenFB36vvp96VKPKBbvplAWonl0XY4ethFsxhSthhZ7Rf 7kxUbVDP7Sqa2wDZcL+sfC0jmYGh3eienyDjjIMZMcAREhPQuAbXnh2Tmgz64Y4SiFocIY 14JTd4MZWL07vH9G8s+itmFrTqfm4U7RnMjCCUYpQrhrFT6Pcb95YzIDvbDDaw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS61M2DgLzSvk; Mon, 22 Jul 2024 03:57:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M3vRH8014933; Mon, 22 Jul 2024 03:57:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M3vRxa014930; Mon, 22 Jul 2024 03:57:27 GMT (envelope-from git) Date: Mon, 22 Jul 2024 03:57:27 GMT Message-Id: <202407220357.46M3vRxa014930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: fd3aca5b4196 - main - cxgbe(4): Stop and restart the atid allocator with the LLD. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd3aca5b41968421f243b760ac5733f39f25cc56 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=fd3aca5b41968421f243b760ac5733f39f25cc56 commit fd3aca5b41968421f243b760ac5733f39f25cc56 Author: Navdeep Parhar AuthorDate: 2024-07-12 23:53:22 +0000 Commit: Navdeep Parhar CommitDate: 2024-07-22 03:26:42 +0000 cxgbe(4): Stop and restart the atid allocator with the LLD. atids are used by both filters and TOE and the atid table is in the base driver (LLD). New atids cannot be allocated when the allocator is stopped but existing ones can still be freed. It is expected that the owners of outstanding atids will release them in their own stop processing, before the adapter is restarted. MFC after: 1 month Sponsored by: Chelsio Communications --- sys/dev/cxgbe/offload.h | 1 + sys/dev/cxgbe/t4_main.c | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/offload.h b/sys/dev/cxgbe/offload.h index 877fdb6b0a89..b17056dc0338 100644 --- a/sys/dev/cxgbe/offload.h +++ b/sys/dev/cxgbe/offload.h @@ -151,6 +151,7 @@ struct tid_info { union aopen_entry *atid_tab; union aopen_entry *afree; u_int atids_in_use; + bool atid_alloc_stopped; /* High priority filters and normal filters share the lock and cv. */ struct mtx ftid_lock __aligned(CACHE_LINE_SIZE); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 1fb560124fb0..f1f4b2d26fdf 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -780,6 +780,8 @@ static int t4_alloc_irq(struct adapter *, struct irq *, int rid, static int t4_free_irq(struct adapter *, struct irq *); static void t4_init_atid_table(struct adapter *); static void t4_free_atid_table(struct adapter *); +static void stop_atid_allocator(struct adapter *); +static void restart_atid_allocator(struct adapter *); static void get_regs(struct adapter *, struct t4_regdump *, uint8_t *); static void vi_refresh_stats(struct vi_info *); static void cxgbe_refresh_stats(struct vi_info *); @@ -2097,6 +2099,9 @@ stop_lld(struct adapter *sc) } end_synchronized_op(sc, 0); + + stop_atid_allocator(sc); + return (rc); } @@ -2447,6 +2452,9 @@ restart_lld(struct adapter *sc) done: end_synchronized_op(sc, 0); free(old_state, M_CXGBE); + + restart_atid_allocator(sc); + return (rc); } @@ -3941,6 +3949,7 @@ t4_init_atid_table(struct adapter *sc) mtx_init(&t->atid_lock, "atid lock", NULL, MTX_DEF); t->afree = t->atid_tab; t->atids_in_use = 0; + t->atid_alloc_stopped = false; for (i = 1; i < t->natids; i++) t->atid_tab[i - 1].next = &t->atid_tab[i]; t->atid_tab[t->natids - 1].next = NULL; @@ -3962,6 +3971,28 @@ t4_free_atid_table(struct adapter *sc) t->atid_tab = NULL; } +static void +stop_atid_allocator(struct adapter *sc) +{ + struct tid_info *t = &sc->tids; + + mtx_lock(&t->atid_lock); + t->atid_alloc_stopped = true; + mtx_unlock(&t->atid_lock); +} + +static void +restart_atid_allocator(struct adapter *sc) +{ + struct tid_info *t = &sc->tids; + + mtx_lock(&t->atid_lock); + KASSERT(t->atids_in_use == 0, + ("%s: %d atids still in use.", __func__, t->atids_in_use)); + t->atid_alloc_stopped = false; + mtx_unlock(&t->atid_lock); +} + int alloc_atid(struct adapter *sc, void *ctx) { @@ -3969,7 +4000,7 @@ alloc_atid(struct adapter *sc, void *ctx) int atid = -1; mtx_lock(&t->atid_lock); - if (t->afree) { + if (t->afree && !t->atid_alloc_stopped) { union aopen_entry *p = t->afree; atid = p - t->atid_tab; From nobody Mon Jul 22 03:57:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS61N5XpSz5RDgQ; Mon, 22 Jul 2024 03:57: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS61N3hryz41Cf; Mon, 22 Jul 2024 03:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721620648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d6tJKvqlESv2g54MSleqssM40HF4RJv3ITfAz7XKhCU=; b=GF9SXob1EvtQ+u41feMH0LgYkuHs/UZROJk06MZ/HjwPlco47tsCOiDOnUACyJY5k0Qfax Px1MJ0cSVV3+1VGC7qfTKZaHYjhwpTULLvmQpEUNN1G2SXN4QGnO7ViSiNteRhm0F+LVmk cykZR4W+aVpMQtMKdK0ZdedsryUiKyBT2zs0X0roQOz8Op1P3wxBFnOxEC3Yi3EQmF9dEB Vjg8txVUmTk2krlM4QVEczAjX9RRCXmDN6lBxvi/s9Wl5zUMal2f5wjwT13cFH3Kw+C4XO UbFhU1di6FM9FPDVKZ27/oDEYx21isOtKZXnwYcYFNZlsCAVzsPqo0uYZGsvQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721620648; a=rsa-sha256; cv=none; b=iASKwmF53Tam+qT3W++ur1QY99WQ1dBaJDxz6Zkl81Deo2y0E1wakoBx1lkIaBB4var8v0 JCbv8D0WQ3DQHv6HF4kVnjLPgrnQZDS3gXA6/n07jxzX/UE+fW41JrVYFUABbODBsqWafh ubdGzLpAKKL1+Djw2EMnGMQzGjOjy1u1aobu/WwwmMud0a5TT8L34UR/9ud5fNfJ31V5eX XXj9g5MWHIY2uQ4sIHs3uLpt4zaVBN40H0fjY8U6vLDEQ7MGEyyNfOcbaPkdcHsoXPcRjC H+vltnb9352mwlw8uFB3Cv/zo5vXVpqlDaOr3OAU+rJ9xX6Z1NDWelCnpNhNSg== 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=1721620648; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d6tJKvqlESv2g54MSleqssM40HF4RJv3ITfAz7XKhCU=; b=aslnnizen0FURn0fevksYBsZurKxzqrJhpmh7zOZgd5Juo/jsEkyuJT+cap13iY/K4ZCDO 5E4zrG7cLCwP6aZqfvUF70osCHEg9VRQ85W2dITkUIGRkfX/HskOr7vuvxf0gG1u55NkJf zl6Jgm0NY7UCqvwhipPVZ0WZ0dsDMci0ag7ScQjQF/oxcAwuIcUzUj74XqGZUAzXcH658x 43EsyCEGeHSPM8nemDYHNCy+yeunPW1MhKeULVzW1fSRv/ApSTtb+C5e8KeU3qxPC/4eBP JrHzA1HQHWyt2gULm6ohKHrZ7PNlCOwsw0791gpBSLUBGI8ddCSQu/y858xxcg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS61N3JjNzSvl; Mon, 22 Jul 2024 03:57:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M3vS8E014997; Mon, 22 Jul 2024 03:57:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M3vS2v014994; Mon, 22 Jul 2024 03:57:28 GMT (envelope-from git) Date: Mon, 22 Jul 2024 03:57:28 GMT Message-Id: <202407220357.46M3vS2v014994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: cd93fdee5c8b - main - cxgbe(4): Stop and restart the L2T allocator with the LLD. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd93fdee5c8bbdb00d10f8a1fa43f30f151a1ef7 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=cd93fdee5c8bbdb00d10f8a1fa43f30f151a1ef7 commit cd93fdee5c8bbdb00d10f8a1fa43f30f151a1ef7 Author: Navdeep Parhar AuthorDate: 2024-07-19 16:40:44 +0000 Commit: Navdeep Parhar CommitDate: 2024-07-22 03:29:26 +0000 cxgbe(4): Stop and restart the L2T allocator with the LLD. L2T entries are used by both filters and TOE and the L2T is shared between the base driver (LLD) and the TOM ULD. Add a flag to indicate that the L2T is stopped, which means: * t4_alloc_l2e and t4_l2t_alloc_switching will not allocate new entries. * t4_tom will ignore all ARP/NDP updates from the kernel. * Previously allocated L2T entries can still be freed. MFC after: 1 month Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_l2t.c | 36 +++++++++++++++++++++++++++++++++--- sys/dev/cxgbe/t4_l2t.h | 5 ++++- sys/dev/cxgbe/t4_main.c | 4 +++- sys/dev/cxgbe/tom/t4_tom_l2t.c | 7 +++++++ 4 files changed, 47 insertions(+), 5 deletions(-) diff --git a/sys/dev/cxgbe/t4_l2t.c b/sys/dev/cxgbe/t4_l2t.c index 90f184f5e666..b210003cfac0 100644 --- a/sys/dev/cxgbe/t4_l2t.c +++ b/sys/dev/cxgbe/t4_l2t.c @@ -73,7 +73,8 @@ t4_alloc_l2e(struct l2t_data *d) struct l2t_entry *end, *e, **p; rw_assert(&d->lock, RA_WLOCKED); - + if (__predict_false(d->l2t_stopped)) + return (NULL); if (!atomic_load_acq_int(&d->nfree)) return (NULL); @@ -291,7 +292,10 @@ t4_l2t_alloc_switching(struct adapter *sc, uint16_t vlan, uint8_t port, int rc; rw_wlock(&d->lock); - e = find_or_alloc_l2e(d, vlan, port, eth_addr); + if (__predict_false(d->l2t_stopped)) + e = NULL; + else + e = find_or_alloc_l2e(d, vlan, port, eth_addr); if (e) { if (atomic_load_acq_int(&e->refcnt) == 0) { mtx_lock(&e->lock); /* avoid race with t4_l2t_free */ @@ -333,6 +337,7 @@ t4_init_l2t(struct adapter *sc, int flags) return (ENOMEM); d->l2t_size = l2t_size; + d->l2t_stopped = false; d->rover = d->l2tab; atomic_store_rel_int(&d->nfree, l2t_size); rw_init(&d->lock, "L2T"); @@ -353,8 +358,9 @@ t4_init_l2t(struct adapter *sc, int flags) } int -t4_free_l2t(struct l2t_data *d) +t4_free_l2t(struct adapter *sc) { + struct l2t_data *d = sc->l2t; int i; for (i = 0; i < d->l2t_size; i++) @@ -365,6 +371,30 @@ t4_free_l2t(struct l2t_data *d) return (0); } +int +t4_stop_l2t(struct adapter *sc) +{ + struct l2t_data *d = sc->l2t; + + rw_wlock(&d->lock); + d->l2t_stopped = true; + rw_wunlock(&d->lock); + + return (0); +} + +int +t4_restart_l2t(struct adapter *sc) +{ + struct l2t_data *d = sc->l2t; + + rw_wlock(&d->lock); + d->l2t_stopped = false; + rw_wunlock(&d->lock); + + return (0); +} + int do_l2t_write_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) diff --git a/sys/dev/cxgbe/t4_l2t.h b/sys/dev/cxgbe/t4_l2t.h index 991b4476eb61..f8681a4ab556 100644 --- a/sys/dev/cxgbe/t4_l2t.h +++ b/sys/dev/cxgbe/t4_l2t.h @@ -79,6 +79,7 @@ struct l2t_entry { struct l2t_data { struct rwlock lock; u_int l2t_size; + bool l2t_stopped; volatile int nfree; /* number of free entries */ struct l2t_entry *rover;/* starting point for next allocation */ struct l2t_entry l2tab[]; @@ -86,7 +87,9 @@ struct l2t_data { int t4_init_l2t(struct adapter *, int); -int t4_free_l2t(struct l2t_data *); +int t4_free_l2t(struct adapter *); +int t4_stop_l2t(struct adapter *); +int t4_restart_l2t(struct adapter *); struct l2t_entry *t4_alloc_l2e(struct l2t_data *); struct l2t_entry *t4_l2t_alloc_switching(struct adapter *, uint16_t, uint8_t, uint8_t *); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index f1f4b2d26fdf..3baa2d5ac0f7 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1847,7 +1847,7 @@ t4_detach_common(device_t dev) sc->msix_res); if (sc->l2t) - t4_free_l2t(sc->l2t); + t4_free_l2t(sc); if (sc->smt) t4_free_smt(sc->smt); t4_free_atid_table(sc); @@ -2101,6 +2101,7 @@ stop_lld(struct adapter *sc) end_synchronized_op(sc, 0); stop_atid_allocator(sc); + t4_stop_l2t(sc); return (rc); } @@ -2454,6 +2455,7 @@ done: free(old_state, M_CXGBE); restart_atid_allocator(sc); + t4_restart_l2t(sc); return (rc); } diff --git a/sys/dev/cxgbe/tom/t4_tom_l2t.c b/sys/dev/cxgbe/tom/t4_tom_l2t.c index ee442f023970..749e5704863e 100644 --- a/sys/dev/cxgbe/tom/t4_tom_l2t.c +++ b/sys/dev/cxgbe/tom/t4_tom_l2t.c @@ -380,6 +380,10 @@ t4_l2t_get(struct port_info *pi, if_t ifp, struct sockaddr *sa) hash = l2_hash(d, sa, if_getindex(ifp)); rw_wlock(&d->lock); + if (__predict_false(d->l2t_stopped)) { + e = NULL; + goto done; + } for (e = d->l2tab[hash].first; e; e = e->next) { if (l2_cmp(sa, e) == 0 && e->ifp == ifp && e->vlan == vtag && e->smt_idx == smt_idx) { @@ -429,6 +433,8 @@ t4_l2_update(struct toedev *tod, if_t ifp, struct sockaddr *sa, hash = l2_hash(d, sa, if_getindex(ifp)); rw_rlock(&d->lock); + if (__predict_false(d->l2t_stopped)) + goto done; for (e = d->l2tab[hash].first; e; e = e->next) { if (l2_cmp(sa, e) == 0 && e->ifp == ifp) { mtx_lock(&e->lock); @@ -439,6 +445,7 @@ t4_l2_update(struct toedev *tod, if_t ifp, struct sockaddr *sa, break; } } +done: rw_runlock(&d->lock); /* From nobody Mon Jul 22 04:06:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS6Cj1vt0z5RF8X; Mon, 22 Jul 2024 04: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS6Cj1BZhz440R; Mon, 22 Jul 2024 04: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=1721621185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ztkNl83e26drTvdQG6cEuQkot2tb886xMS25doQ0EZw=; b=TooCiyNB6rJuPkNFy8itNBsLZutWPivB7Slv77x5G8J4ojtdO0X+Al4vT5xe0CzfPT4cUn v65Kdi74E/XHy1zMnCeXRSQyxAdSw5x4XPN36pw/gge4nnHZr0pqq3wATvtp7N4/HDutLN FtIWxTvLP9jeyVJwojhY639Nfo8b0l+7IC+bhYLSnfvdDLtpiy+12s65Rta98Z4kmQbDdS sUDrpDQfbPIxKP8c8HJEwTpJcgmu1/hcWnadx9SWDn+KvDrcV25CUFjxiKADqB8XSUf4C/ v4D9MbUU0T99ft4jGre9wducA2iQUZeAziyIcsQru+Rsb1B/OwpgZZ2rVtlJ2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721621185; a=rsa-sha256; cv=none; b=U+hlW6I0f+IjHPUDq2D7xATqFmplxoAHtEgpMlmWAnlCjZrfjmhqNNu7SkiZk6fNOtlfAz YQ2RXjbnbyC5/GCrKscrJeZG7+tmvABgmuE6zjBdZmxsF6gqR6rHdLsRi3O5i3oP7SSZX2 1wT0zEvVq1BEKbbNv4aVsgoB/V5gQU3UipL5UPba3AeGJ8sPyqNdRCrF4DM5Ogg11Eub9O 1BCMrrYYiXABDIKNHGSUpb9gs2Rpydnj6F6vPBjCv+YmSVHmBVacyFAzjkJ8+2YqaIC2wU kv2nGsnTf2wXi171KzB8yu47Tzlg7C1zzQcSNNZCGb/8d51lPuBoAkWFPWsw9Q== 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=1721621185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ztkNl83e26drTvdQG6cEuQkot2tb886xMS25doQ0EZw=; b=AitsB/yHRl5bBIN+cwMfzYK/6SJ3uozhmzba7hH0bhs+HenHj7MfzcKKLp4loufLWtGW94 zvcmZMc35QqEHOxA5B8l3tyjOn+rXgVVSEJCirAILFPglamPxksTsxMHN/i8c0Fk5AJr9U BtfFhXCkQa9fO9KyU1F4Ok8ZoEkKq/TeMxOZ6uvOrjLmlXEiy9UqnsYLkUoTy/jQcYRG6X Z85Jay7H93Upbp/GpceT7qw0icJzcdKFIOEe59DBWs4ynwCsXk2xugluwqP4qWiC6/nz7y VsY+B8MVyZjIOb3pfiodoc97sLe6bfFcJVqY3CmyNRUkjiPWAsG2ml4B/DOO3g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS6Cj0p5PzTrm; Mon, 22 Jul 2024 04:06:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M46PHu032729; Mon, 22 Jul 2024 04:06:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M46PYQ032726; Mon, 22 Jul 2024 04:06:25 GMT (envelope-from git) Date: Mon, 22 Jul 2024 04:06:25 GMT Message-Id: <202407220406.46M46PYQ032726@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 283333c0e329 - main - cxgbe/t4_tom: Track all synq entries in a per-adapter list. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 283333c0e329fd7aceff16fa3bf2b9892744d883 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=283333c0e329fd7aceff16fa3bf2b9892744d883 commit 283333c0e329fd7aceff16fa3bf2b9892744d883 Author: Navdeep Parhar AuthorDate: 2024-07-20 19:38:42 +0000 Commit: Navdeep Parhar CommitDate: 2024-07-22 04:02:34 +0000 cxgbe/t4_tom: Track all synq entries in a per-adapter list. Live tid entries in tid_tab are either full fledged connections or synq entries. toep_list tracks the connections already and this change adds a synqe_list to track the synq entries. These two lists can be used to enumerate and iterate over all live tids. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/tom/t4_listen.c | 12 ++++++++++++ sys/dev/cxgbe/tom/t4_tom.c | 2 ++ sys/dev/cxgbe/tom/t4_tom.h | 2 ++ 3 files changed, 16 insertions(+) diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c index d25c161d3f8d..6e8361734db7 100644 --- a/sys/dev/cxgbe/tom/t4_listen.c +++ b/sys/dev/cxgbe/tom/t4_listen.c @@ -849,6 +849,7 @@ do_close_server_rpl(struct sge_iq *iq, const struct rss_header *rss, static void done_with_synqe(struct adapter *sc, struct synq_entry *synqe) { + struct tom_data *td = sc->tom_softc; struct listen_ctx *lctx = synqe->lctx; struct inpcb *inp = lctx->inp; struct l2t_entry *e = &sc->l2t->l2tab[synqe->params.l2t_idx]; @@ -858,6 +859,9 @@ done_with_synqe(struct adapter *sc, struct synq_entry *synqe) ntids = inp->inp_vflag & INP_IPV6 ? 2 : 1; remove_tid(sc, synqe->tid, ntids); + mtx_lock(&td->toep_list_lock); + TAILQ_REMOVE(&td->synqe_list, synqe, link); + mtx_unlock(&td->toep_list_lock); release_tid(sc, synqe->tid, lctx->ctrlq); t4_l2t_release(e); inp = release_synqe(sc, synqe); @@ -961,6 +965,7 @@ void t4_offload_socket(struct toedev *tod, void *arg, struct socket *so) { struct adapter *sc = tod->tod_softc; + struct tom_data *td = sc->tom_softc; struct synq_entry *synqe = arg; struct inpcb *inp = sotoinpcb(so); struct toepcb *toep = synqe->toep; @@ -976,6 +981,9 @@ t4_offload_socket(struct toedev *tod, void *arg, struct socket *so) toep->flags |= TPF_CPL_PENDING; update_tid(sc, synqe->tid, toep); synqe->flags |= TPF_SYNQE_EXPANDED; + mtx_lock(&td->toep_list_lock); + TAILQ_REMOVE(&td->synqe_list, synqe, link); + mtx_unlock(&td->toep_list_lock); inp->inp_flowtype = (inp->inp_vflag & INP_IPV6) ? M_HASHTYPE_RSS_TCP_IPV6 : M_HASHTYPE_RSS_TCP_IPV4; inp->inp_flowid = synqe->rss_hash; @@ -1177,6 +1185,7 @@ do_pass_accept_req(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) { struct adapter *sc = iq->adapter; + struct tom_data *td = sc->tom_softc; struct toedev *tod; const struct cpl_pass_accept_req *cpl = mtod(m, const void *); unsigned int stid = G_PASS_OPEN_TID(be32toh(cpl->tos_stid)); @@ -1383,6 +1392,9 @@ found: REJECT_PASS_ACCEPT_REQ(true); } + mtx_lock(&td->toep_list_lock); + TAILQ_INSERT_TAIL(&td->synqe_list, synqe, link); + mtx_unlock(&td->toep_list_lock); CTR6(KTR_CXGBE, "%s: stid %u, tid %u, synqe %p, opt0 %#016lx, opt2 %#08x", __func__, stid, tid, synqe, be64toh(opt0), be32toh(opt2)); diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index f9d8dcd706b7..fb92c88aa358 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -1831,6 +1831,7 @@ t4_tom_activate(struct adapter *sc) /* List of TOE PCBs and associated lock */ mtx_init(&td->toep_list_lock, "PCB list lock", NULL, MTX_DEF); TAILQ_INIT(&td->toep_list); + TAILQ_INIT(&td->synqe_list); /* Listen context */ mtx_init(&td->lctx_hash_lock, "lctx hash lock", NULL, MTX_DEF); @@ -1915,6 +1916,7 @@ t4_tom_deactivate(struct adapter *sc) mtx_lock(&td->toep_list_lock); if (!TAILQ_EMPTY(&td->toep_list)) rc = EBUSY; + MPASS(TAILQ_EMPTY(&td->synqe_list)); mtx_unlock(&td->toep_list_lock); mtx_lock(&td->lctx_hash_lock); diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index fb74642d61f7..0bc368fe3d56 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -269,6 +269,7 @@ struct synq_entry { struct listen_ctx *lctx; /* backpointer to listen ctx */ struct mbuf *syn; int flags; /* same as toepcb's tp_flags */ + TAILQ_ENTRY(synq_entry) link; /* synqe_list */ volatile int ok_to_respond; volatile u_int refcnt; int tid; @@ -329,6 +330,7 @@ struct tom_data { /* toepcb's associated with this TOE device */ struct mtx toep_list_lock; TAILQ_HEAD(, toepcb) toep_list; + TAILQ_HEAD(, synq_entry) synqe_list; struct mtx lctx_hash_lock; LIST_HEAD(, listen_ctx) *listen_hash; From nobody Mon Jul 22 05:39:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS8Gd30jpz5PvKf; Mon, 22 Jul 2024 05:39: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS8Gd2kwDz4DYS; Mon, 22 Jul 2024 05:39:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721626745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uGBPaw2AjUNmY8i1WfXVIViBWEjUNHYYd3TkUXP7jHs=; b=PogirAsAlJd7xc6NgL6KtgxMyApaWdW+deP1Y6Jeo7nUh4VMiKq7c1ss4k/3h65yJ0731U /rFXdNaeCcKj70kYZB5DHGmS6KTk+xhcZuyqNT3sMQqDQjWvr+ci+Yk4wu//GCFuDZbPeq hC3UkYvr0824Ztbcr+lZVFtrn+GvsgnG2tgdnBYsdP52+6j0ka+Xp6UJcCdst/f8M6rpH8 KxrFTmtPjSkb/YwhTA2G4PPIcoJu/D5FGAinjRhzIgiJLvdRo/lOGXJpa+dR7t7UIyirk7 3jF7+Kd5Ht0fKP47BmMM328Gllg8eIz+AieRhWBM9pe/mi6S/AhAnWkbUA5YPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721626745; a=rsa-sha256; cv=none; b=jGGC1pqcFn4FwhLwaBfO5HBgglfHG/nJ/o1Zn25jWY96eRtf4piqD+8/SIR1tzW84GDhGN 2dHi+c1X/Yt7PEF1WbSin+JOKi8O9NFKlLbA6jqQjt5+p4l3CBdxNEl7LJ3GLeazQt8iOY 6rSvkk5UyLspEC7f5doAf0+bDXCIdQmGggP1QaXCXq3uHDNO30lchXdIlxjaE4+3KEWXzq DYrzXzRFM3EPWCVxt+WsvsmOiwPiDB9UKGmZPE6R+WlITwvkaRsBEWziyDX11Nar6nj0Au 2sZ0KOmchVhjF3e29PwT96SOhTE3fDI83Zb40sTWkkJIS0uEG6NUX//GYEpRng== 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=1721626745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uGBPaw2AjUNmY8i1WfXVIViBWEjUNHYYd3TkUXP7jHs=; b=II7ohYJthkBFXXgsD4buTHGkwGUnhOxHbyGBAdCXAIROE1IeGa6ZE4j8Yjwx+uqlT8bcOy JcGLWqSP/21Ie5KfmOOMfLtrEmAKGXZPqQ8KcVRr64nByF82m78FLtUHgq2fGN3SUw3dy+ 35Yit4qk0HMHAy3twsu4+xkp0icDO47UrPXPoIS7OObqFz4kskSp5lzx8XoKYAQhTAIjGl rLlMMIvHXIFhVsL8bFGA7cgGyPeOXjU+XOm78Ct64vpeyLOOC2Y9Z+b8PIGMpHIVkIzqxD NAPv1lZotGJqBlfdvTiCMKVoXBxAxQAf+AaIInYnA+8Uk9pXTbmee+qCbugpyw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS8Gd2KxFzXMw; Mon, 22 Jul 2024 05:39:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M5d5sD084264; Mon, 22 Jul 2024 05:39:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M5d533084261; Mon, 22 Jul 2024 05:39:05 GMT (envelope-from git) Date: Mon, 22 Jul 2024 05:39:05 GMT Message-Id: <202407220539.46M5d533084261@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: c1c524852f62 - main - cxgbe/t4_tom: Implement uld_stop and uld_restart for ULD_TOM. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1c524852f625cf5f420653f7850d1fe3ff6b4ca Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=c1c524852f625cf5f420653f7850d1fe3ff6b4ca commit c1c524852f625cf5f420653f7850d1fe3ff6b4ca Author: Navdeep Parhar AuthorDate: 2024-07-12 23:56:15 +0000 Commit: Navdeep Parhar CommitDate: 2024-07-22 05:20:21 +0000 cxgbe/t4_tom: Implement uld_stop and uld_restart for ULD_TOM. This allows the adapter to be suspended or reset even when stateful TOE is active, in some limited configurations. The LLD has already stopped the adapter hardware and all its queues by the time these ULD routines get called. The general approach in t4_tom is to purge the lookup tables immediately so that they are ready for operation by the time the adapter resumes, and park all the resources left hanging by the stopped hardware into separate "stranded" queues that can be dealt with at leisure. Outstanding active opens, live connections, and synq entries (for connections in the middle of the 3-way handshake) are all treated as if the hardware had reported an abrupt error for the tid. The servers/listeners are a bit different in that no error is reported. They're just noted as non-functional when the hardware stops and are recreated by the driver during restart. MFC after: 1 month Sponsored by: Chelsio Communications --- sys/dev/cxgbe/offload.h | 1 + sys/dev/cxgbe/tom/t4_connect.c | 11 +- sys/dev/cxgbe/tom/t4_listen.c | 136 ++++++++++++++++-- sys/dev/cxgbe/tom/t4_tom.c | 314 ++++++++++++++++++++++++++++++++++------- sys/dev/cxgbe/tom/t4_tom.h | 19 ++- 5 files changed, 409 insertions(+), 72 deletions(-) diff --git a/sys/dev/cxgbe/offload.h b/sys/dev/cxgbe/offload.h index b17056dc0338..c13901ee1a59 100644 --- a/sys/dev/cxgbe/offload.h +++ b/sys/dev/cxgbe/offload.h @@ -146,6 +146,7 @@ struct tid_info { u_int stids_in_use; u_int nstids_free_head; /* # of available stids at the beginning */ struct stid_head stids; + bool stid_tab_stopped; struct mtx atid_lock __aligned(CACHE_LINE_SIZE); union aopen_entry *atid_tab; diff --git a/sys/dev/cxgbe/tom/t4_connect.c b/sys/dev/cxgbe/tom/t4_connect.c index 4e81f23dc267..1c98e70a4df5 100644 --- a/sys/dev/cxgbe/tom/t4_connect.c +++ b/sys/dev/cxgbe/tom/t4_connect.c @@ -110,15 +110,16 @@ done: } void -act_open_failure_cleanup(struct adapter *sc, u_int atid, u_int status) +act_open_failure_cleanup(struct adapter *sc, struct toepcb *toep, u_int status) { - struct toepcb *toep = lookup_atid(sc, atid); struct inpcb *inp = toep->inp; struct toedev *tod = &toep->td->tod; struct epoch_tracker et; - free_atid(sc, atid); - toep->tid = -1; + if (toep->tid >= 0) { + free_atid(sc, toep->tid); + toep->tid = -1; + } CURVNET_SET(toep->vnet); if (status != EAGAIN) @@ -158,7 +159,7 @@ do_act_open_rpl(struct sge_iq *iq, const struct rss_header *rss, release_tid(sc, GET_TID(cpl), toep->ctrlq); rc = act_open_rpl_status_to_errno(status); - act_open_failure_cleanup(sc, atid, rc); + act_open_failure_cleanup(sc, toep, rc); return (0); } diff --git a/sys/dev/cxgbe/tom/t4_listen.c b/sys/dev/cxgbe/tom/t4_listen.c index 6e8361734db7..897c5bcaab1e 100644 --- a/sys/dev/cxgbe/tom/t4_listen.c +++ b/sys/dev/cxgbe/tom/t4_listen.c @@ -88,6 +88,111 @@ static struct inpcb *release_lctx(struct adapter *, struct listen_ctx *); static void send_abort_rpl_synqe(struct toedev *, struct synq_entry *, int); +static int create_server6(struct adapter *, struct listen_ctx *); +static int create_server(struct adapter *, struct listen_ctx *); + +int +alloc_stid_tab(struct adapter *sc) +{ + struct tid_info *t = &sc->tids; + + MPASS(t->nstids > 0); + MPASS(t->stid_tab == NULL); + + t->stid_tab = malloc(t->nstids * sizeof(*t->stid_tab), M_CXGBE, + M_ZERO | M_NOWAIT); + if (t->stid_tab == NULL) + return (ENOMEM); + mtx_init(&t->stid_lock, "stid lock", NULL, MTX_DEF); + t->stids_in_use = 0; + TAILQ_INIT(&t->stids); + t->nstids_free_head = t->nstids; + + return (0); +} + +void +free_stid_tab(struct adapter *sc) +{ + struct tid_info *t = &sc->tids; + + KASSERT(t->stids_in_use == 0, + ("%s: %d tids still in use.", __func__, t->stids_in_use)); + + if (mtx_initialized(&t->stid_lock)) + mtx_destroy(&t->stid_lock); + free(t->stid_tab, M_CXGBE); + t->stid_tab = NULL; +} + +void +stop_stid_tab(struct adapter *sc) +{ + struct tid_info *t = &sc->tids; + struct tom_data *td = sc->tom_softc; + struct listen_ctx *lctx; + struct synq_entry *synqe; + int i, ntids; + + mtx_lock(&t->stid_lock); + t->stid_tab_stopped = true; + mtx_unlock(&t->stid_lock); + + mtx_lock(&td->lctx_hash_lock); + for (i = 0; i <= td->listen_mask; i++) { + LIST_FOREACH(lctx, &td->listen_hash[i], link) + lctx->flags &= ~(LCTX_RPL_PENDING | LCTX_SETUP_IN_HW); + } + mtx_unlock(&td->lctx_hash_lock); + + mtx_lock(&td->toep_list_lock); + TAILQ_FOREACH(synqe, &td->synqe_list, link) { + MPASS(sc->incarnation == synqe->incarnation); + MPASS(synqe->tid >= 0); + MPASS(synqe == lookup_tid(sc, synqe->tid)); + /* Remove tid from the lookup table immediately. */ + CTR(KTR_CXGBE, "%s: tid %d@%d STRANDED, removed from table", + __func__, synqe->tid, synqe->incarnation); + ntids = synqe->lctx->inp->inp_vflag & INP_IPV6 ? 2 : 1; + remove_tid(sc, synqe->tid, ntids); +#if 0 + /* synqe->tid is stale now but left alone for debug. */ + synqe->tid = -1; +#endif + } + MPASS(TAILQ_EMPTY(&td->stranded_synqe)); + TAILQ_CONCAT(&td->stranded_synqe, &td->synqe_list, link); + MPASS(TAILQ_EMPTY(&td->synqe_list)); + mtx_unlock(&td->toep_list_lock); +} + +void +restart_stid_tab(struct adapter *sc) +{ + struct tid_info *t = &sc->tids; + struct tom_data *td = sc->tom_softc; + struct listen_ctx *lctx; + int i; + + mtx_lock(&td->lctx_hash_lock); + for (i = 0; i <= td->listen_mask; i++) { + LIST_FOREACH(lctx, &td->listen_hash[i], link) { + MPASS((lctx->flags & (LCTX_RPL_PENDING | LCTX_SETUP_IN_HW)) == 0); + lctx->flags |= LCTX_RPL_PENDING; + if (lctx->inp->inp_vflag & INP_IPV6) + create_server6(sc, lctx); + else + create_server(sc, lctx); + } + } + mtx_unlock(&td->lctx_hash_lock); + + mtx_lock(&t->stid_lock); + t->stid_tab_stopped = false; + mtx_unlock(&t->stid_lock); + +} + static int alloc_stid(struct adapter *sc, struct listen_ctx *lctx, int isipv6) { @@ -107,7 +212,7 @@ alloc_stid(struct adapter *sc, struct listen_ctx *lctx, int isipv6) __func__, t->stid_base, t->nstids, n)); mtx_lock(&t->stid_lock); - if (n > t->nstids - t->stids_in_use) { + if (n > t->nstids - t->stids_in_use || t->stid_tab_stopped) { mtx_unlock(&t->stid_lock); return (-1); } @@ -632,12 +737,13 @@ t4_listen_stop(struct toedev *tod, struct tcpcb *tp) return (EINPROGRESS); } - destroy_server(sc, lctx); + if (lctx->flags & LCTX_SETUP_IN_HW) + destroy_server(sc, lctx); return (0); } static inline struct synq_entry * -alloc_synqe(struct adapter *sc __unused, struct listen_ctx *lctx, int flags) +alloc_synqe(struct adapter *sc, struct listen_ctx *lctx, int flags) { struct synq_entry *synqe; @@ -647,6 +753,7 @@ alloc_synqe(struct adapter *sc __unused, struct listen_ctx *lctx, int flags) synqe = malloc(sizeof(*synqe), M_CXGBE, flags); if (__predict_true(synqe != NULL)) { synqe->flags = TPF_SYNQE; + synqe->incarnation = sc->incarnation; refcount_init(&synqe->refcnt, 1); synqe->lctx = lctx; hold_lctx(lctx); /* Every synqe has a ref on its lctx. */ @@ -761,8 +868,9 @@ do_pass_open_rpl(struct sge_iq *iq, const struct rss_header *rss, __func__, stid, status, lctx->flags); lctx->flags &= ~LCTX_RPL_PENDING; - - if (status != CPL_ERR_NONE) + if (status == CPL_ERR_NONE) + lctx->flags |= LCTX_SETUP_IN_HW; + else log(LOG_ERR, "listener (stid %u) failed: %d\n", stid, status); #ifdef INVARIANTS @@ -856,13 +964,15 @@ done_with_synqe(struct adapter *sc, struct synq_entry *synqe) int ntids; INP_WLOCK_ASSERT(inp); - ntids = inp->inp_vflag & INP_IPV6 ? 2 : 1; - remove_tid(sc, synqe->tid, ntids); - mtx_lock(&td->toep_list_lock); - TAILQ_REMOVE(&td->synqe_list, synqe, link); - mtx_unlock(&td->toep_list_lock); - release_tid(sc, synqe->tid, lctx->ctrlq); + if (synqe->tid != -1) { + ntids = inp->inp_vflag & INP_IPV6 ? 2 : 1; + remove_tid(sc, synqe->tid, ntids); + mtx_lock(&td->toep_list_lock); + TAILQ_REMOVE(&td->synqe_list, synqe, link); + mtx_unlock(&td->toep_list_lock); + release_tid(sc, synqe->tid, lctx->ctrlq); + } t4_l2t_release(e); inp = release_synqe(sc, synqe); if (inp) @@ -870,10 +980,8 @@ done_with_synqe(struct adapter *sc, struct synq_entry *synqe) } void -synack_failure_cleanup(struct adapter *sc, int tid) +synack_failure_cleanup(struct adapter *sc, struct synq_entry *synqe) { - struct synq_entry *synqe = lookup_tid(sc, tid); - INP_WLOCK(synqe->lctx->inp); done_with_synqe(sc, synqe); } diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index fb92c88aa358..58a77ff93c86 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -89,18 +89,23 @@ static int t4_tom_modevent(module_t, int, void *); /* ULD ops and helpers */ static int t4_tom_activate(struct adapter *); static int t4_tom_deactivate(struct adapter *); +static int t4_tom_stop(struct adapter *); +static int t4_tom_restart(struct adapter *); static struct uld_info tom_uld_info = { .uld_activate = t4_tom_activate, .uld_deactivate = t4_tom_deactivate, + .uld_stop = t4_tom_stop, + .uld_restart = t4_tom_restart, }; static void release_offload_resources(struct toepcb *); static void done_with_toepcb(struct toepcb *); -static int alloc_tid_tabs(struct tid_info *); -static void free_tid_tabs(struct tid_info *); +static int alloc_tid_tabs(struct adapter *); +static void free_tid_tabs(struct adapter *); static void free_tom_data(struct adapter *, struct tom_data *); static void reclaim_wr_resources(void *, int); +static void cleanup_stranded_tids(void *, int); struct toepcb * alloc_toepcb(struct vi_info *vi, int flags) @@ -135,6 +140,7 @@ alloc_toepcb(struct vi_info *vi, int flags) refcount_init(&toep->refcount, 1); toep->td = sc->tom_softc; + toep->incarnation = sc->incarnation; toep->vi = vi; toep->tid = -1; toep->tx_total = tx_credits; @@ -254,6 +260,7 @@ offload_socket(struct socket *so, struct toepcb *toep) /* Add the TOE PCB to the active list */ mtx_lock(&td->toep_list_lock); TAILQ_INSERT_HEAD(&td->toep_list, toep, link); + toep->flags |= TPF_IN_TOEP_LIST; mtx_unlock(&td->toep_list_lock); } @@ -298,6 +305,7 @@ undo_offload_socket(struct socket *so) panic("%s: inp freed.", __func__); mtx_lock(&td->toep_list_lock); + toep->flags &= ~TPF_IN_TOEP_LIST; TAILQ_REMOVE(&td->toep_list, toep, link); mtx_unlock(&td->toep_list_lock); } @@ -364,7 +372,10 @@ done_with_toepcb(struct toepcb *toep) MPASS(toep->ce == NULL); mtx_lock(&td->toep_list_lock); - TAILQ_REMOVE(&td->toep_list, toep, link); + if (toep->flags & TPF_IN_TOEP_LIST) { + toep->flags &= ~TPF_IN_TOEP_LIST; + TAILQ_REMOVE(&td->toep_list, toep, link); + } mtx_unlock(&td->toep_list_lock); free_toepcb(toep); @@ -1449,14 +1460,15 @@ negative_advice(int status) } static int -alloc_tid_tab(struct tid_info *t, int flags) +alloc_tid_tab(struct adapter *sc) { + struct tid_info *t = &sc->tids; MPASS(t->ntids > 0); MPASS(t->tid_tab == NULL); t->tid_tab = malloc(t->ntids * sizeof(*t->tid_tab), M_CXGBE, - M_ZERO | flags); + M_ZERO | M_NOWAIT); if (t->tid_tab == NULL) return (ENOMEM); atomic_store_rel_int(&t->tids_in_use, 0); @@ -1465,8 +1477,9 @@ alloc_tid_tab(struct tid_info *t, int flags) } static void -free_tid_tab(struct tid_info *t) +free_tid_tab(struct adapter *sc) { + struct tid_info *t = &sc->tids; KASSERT(t->tids_in_use == 0, ("%s: %d tids still in use.", __func__, t->tids_in_use)); @@ -1475,62 +1488,29 @@ free_tid_tab(struct tid_info *t) t->tid_tab = NULL; } -static int -alloc_stid_tab(struct tid_info *t, int flags) -{ - - MPASS(t->nstids > 0); - MPASS(t->stid_tab == NULL); - - t->stid_tab = malloc(t->nstids * sizeof(*t->stid_tab), M_CXGBE, - M_ZERO | flags); - if (t->stid_tab == NULL) - return (ENOMEM); - mtx_init(&t->stid_lock, "stid lock", NULL, MTX_DEF); - t->stids_in_use = 0; - TAILQ_INIT(&t->stids); - t->nstids_free_head = t->nstids; - - return (0); -} - static void -free_stid_tab(struct tid_info *t) +free_tid_tabs(struct adapter *sc) { - - KASSERT(t->stids_in_use == 0, - ("%s: %d tids still in use.", __func__, t->stids_in_use)); - - if (mtx_initialized(&t->stid_lock)) - mtx_destroy(&t->stid_lock); - free(t->stid_tab, M_CXGBE); - t->stid_tab = NULL; -} - -static void -free_tid_tabs(struct tid_info *t) -{ - - free_tid_tab(t); - free_stid_tab(t); + free_tid_tab(sc); + free_stid_tab(sc); } static int -alloc_tid_tabs(struct tid_info *t) +alloc_tid_tabs(struct adapter *sc) { int rc; - rc = alloc_tid_tab(t, M_NOWAIT); + rc = alloc_tid_tab(sc); if (rc != 0) goto failed; - rc = alloc_stid_tab(t, M_NOWAIT); + rc = alloc_stid_tab(sc); if (rc != 0) goto failed; return (0); failed: - free_tid_tabs(t); + free_tid_tabs(sc); return (rc); } @@ -1587,7 +1567,7 @@ free_tom_data(struct adapter *sc, struct tom_data *td) mtx_destroy(&td->toep_list_lock); free_tcb_history(sc, td); - free_tid_tabs(&sc->tids); + free_tid_tabs(sc); free(td, M_CXGBE); } @@ -1792,13 +1772,14 @@ reclaim_wr_resources(void *arg, int count) case CPL_ACT_OPEN_REQ6: atid = G_TID_TID(be32toh(OPCODE_TID(cpl))); CTR2(KTR_CXGBE, "%s: atid %u ", __func__, atid); - act_open_failure_cleanup(sc, atid, EHOSTUNREACH); + act_open_failure_cleanup(sc, lookup_atid(sc, atid), + EHOSTUNREACH); free(wr, M_CXGBE); break; case CPL_PASS_ACCEPT_RPL: tid = GET_TID(cpl); CTR2(KTR_CXGBE, "%s: tid %u ", __func__, tid); - synack_failure_cleanup(sc, tid); + synack_failure_cleanup(sc, lookup_tid(sc, tid)); free(wr, M_CXGBE); break; default: @@ -1809,6 +1790,83 @@ reclaim_wr_resources(void *arg, int count) } } +/* + * Based on do_abort_req. We treat an abrupt hardware stop as a connection + * abort from the hardware. + */ +static void +live_tid_failure_cleanup(struct adapter *sc, struct toepcb *toep, u_int status) +{ + struct inpcb *inp; + struct tcpcb *tp; + struct epoch_tracker et; + + MPASS(!(toep->flags & TPF_SYNQE)); + + inp = toep->inp; + CURVNET_SET(toep->vnet); + NET_EPOCH_ENTER(et); /* for tcp_close */ + INP_WLOCK(inp); + tp = intotcpcb(inp); + toep->flags |= TPF_ABORT_SHUTDOWN; + if ((inp->inp_flags & INP_DROPPED) == 0) { + struct socket *so = inp->inp_socket; + + if (so != NULL) + so_error_set(so, status); + tp = tcp_close(tp); + if (tp == NULL) + INP_WLOCK(inp); /* re-acquire */ + } + final_cpl_received(toep); + NET_EPOCH_EXIT(et); + CURVNET_RESTORE(); +} + +static void +cleanup_stranded_tids(void *arg, int count) +{ + TAILQ_HEAD(, toepcb) tlist = TAILQ_HEAD_INITIALIZER(tlist); + TAILQ_HEAD(, synq_entry) slist = TAILQ_HEAD_INITIALIZER(slist); + struct tom_data *td = arg; + struct adapter *sc = td_adapter(td); + struct toepcb *toep; + struct synq_entry *synqe; + + /* Clean up synq entries. */ + mtx_lock(&td->toep_list_lock); + TAILQ_SWAP(&td->stranded_synqe, &slist, synq_entry, link); + mtx_unlock(&td->toep_list_lock); + while ((synqe = TAILQ_FIRST(&slist)) != NULL) { + TAILQ_REMOVE(&slist, synqe, link); + MPASS(synqe->tid >= 0); /* stale, was kept around for debug */ + synqe->tid = -1; + synack_failure_cleanup(sc, synqe); + } + + /* Clean up in-flight active opens. */ + mtx_lock(&td->toep_list_lock); + TAILQ_SWAP(&td->stranded_atids, &tlist, toepcb, link); + mtx_unlock(&td->toep_list_lock); + while ((toep = TAILQ_FIRST(&tlist)) != NULL) { + TAILQ_REMOVE(&tlist, toep, link); + MPASS(toep->tid >= 0); /* stale, was kept around for debug */ + toep->tid = -1; + act_open_failure_cleanup(sc, toep, EHOSTUNREACH); + } + + /* Clean up live connections. */ + mtx_lock(&td->toep_list_lock); + TAILQ_SWAP(&td->stranded_tids, &tlist, toepcb, link); + mtx_unlock(&td->toep_list_lock); + while ((toep = TAILQ_FIRST(&tlist)) != NULL) { + TAILQ_REMOVE(&tlist, toep, link); + MPASS(toep->tid >= 0); /* stale, was kept around for debug */ + toep->tid = -1; + live_tid_failure_cleanup(sc, toep, ECONNABORTED); + } +} + /* * Ground control to Major TOM * Commencing countdown, engines on @@ -1832,6 +1890,9 @@ t4_tom_activate(struct adapter *sc) mtx_init(&td->toep_list_lock, "PCB list lock", NULL, MTX_DEF); TAILQ_INIT(&td->toep_list); TAILQ_INIT(&td->synqe_list); + TAILQ_INIT(&td->stranded_atids); + TAILQ_INIT(&td->stranded_tids); + TASK_INIT(&td->cleanup_stranded_tids, 0, cleanup_stranded_tids, td); /* Listen context */ mtx_init(&td->lctx_hash_lock, "lctx hash lock", NULL, MTX_DEF); @@ -1844,7 +1905,7 @@ t4_tom_activate(struct adapter *sc) TASK_INIT(&td->reclaim_wr_resources, 0, reclaim_wr_resources, td); /* TID tables */ - rc = alloc_tid_tabs(&sc->tids); + rc = alloc_tid_tabs(sc); if (rc != 0) goto done; @@ -1917,6 +1978,8 @@ t4_tom_deactivate(struct adapter *sc) if (!TAILQ_EMPTY(&td->toep_list)) rc = EBUSY; MPASS(TAILQ_EMPTY(&td->synqe_list)); + MPASS(TAILQ_EMPTY(&td->stranded_tids)); + mtx_unlock(&td->toep_list_lock); mtx_unlock(&td->toep_list_lock); mtx_lock(&td->lctx_hash_lock); @@ -1925,6 +1988,7 @@ t4_tom_deactivate(struct adapter *sc) mtx_unlock(&td->lctx_hash_lock); taskqueue_drain(taskqueue_thread, &td->reclaim_wr_resources); + taskqueue_drain(taskqueue_thread, &td->cleanup_stranded_tids); mtx_lock(&td->unsent_wr_lock); if (!STAILQ_EMPTY(&td->unsent_wr_list)) rc = EBUSY; @@ -1939,6 +2003,156 @@ t4_tom_deactivate(struct adapter *sc) return (rc); } +static void +stop_atids(struct adapter *sc) +{ + struct tom_data *td = sc->tom_softc; + struct tid_info *t = &sc->tids; + struct toepcb *toep; + int atid; + + /* + * Hashfilters and T6-KTLS are the only other users of atids but they're + * both mutually exclusive with TOE. That means t4_tom owns all the + * atids in the table. + */ + MPASS(!is_hashfilter(sc)); + if (is_t6(sc)) + MPASS(!(sc->flags & KERN_TLS_ON)); + + /* New atids are not being allocated. */ +#ifdef INVARIANTS + mtx_lock(&t->atid_lock); + MPASS(t->atid_alloc_stopped == true); + mtx_unlock(&t->atid_lock); +#endif + + /* + * In-use atids fall in one of these two categories: + * a) Those waiting for L2 resolution before being submitted to + * hardware. + * b) Those that have been submitted to hardware and are awaiting + * replies that will never arrive because the LLD is stopped. + */ + for (atid = 0; atid < t->natids; atid++) { + toep = lookup_atid(sc, atid); + if ((uintptr_t)toep >= (uintptr_t)&t->atid_tab[0] && + (uintptr_t)toep < (uintptr_t)&t->atid_tab[t->natids]) + continue; + MPASS(toep->tid == atid); + MPASS(toep->incarnation == sc->incarnation); + /* + * Take the atid out of the lookup table. toep->tid is stale + * after this but useful for debug. + */ + CTR(KTR_CXGBE, "%s: atid %d@%d STRANDED, removed from table", + __func__, atid, toep->incarnation); + free_atid(sc, toep->tid); +#if 0 + toep->tid = -1; +#endif + mtx_lock(&td->toep_list_lock); + TAILQ_INSERT_TAIL(&td->stranded_atids, toep, link); + mtx_unlock(&td->toep_list_lock); + } + MPASS(atomic_load_int(&t->atids_in_use) == 0); +} + +static void +stop_tids(struct adapter *sc) +{ + struct tom_data *td = sc->tom_softc; + struct toepcb *toep; +#ifdef INVARIANTS + struct tid_info *t = &sc->tids; +#endif + + /* + * The LLD's offload queues are stopped so do_act_establish and + * do_pass_accept_req cannot run and insert tids in parallel with this + * thread. stop_stid_tab has also run and removed the synq entries' + * tids from the table. The only tids in the table are for connections + * at or beyond ESTABLISHED that are still waiting for the final CPL. + */ + mtx_lock(&td->toep_list_lock); + TAILQ_FOREACH(toep, &td->toep_list, link) { + MPASS(sc->incarnation == toep->incarnation); + MPASS(toep->tid >= 0); + MPASS(toep == lookup_tid(sc, toep->tid)); + /* Remove tid from the lookup table immediately. */ + CTR(KTR_CXGBE, "%s: tid %d@%d STRANDED, removed from table", + __func__, toep->tid, toep->incarnation); + remove_tid(sc, toep->tid, toep->ce ? 2 : 1); +#if 0 + /* toep->tid is stale now but left alone for debug. */ + toep->tid = -1; +#endif + /* All toep in this list will get bulk moved to stranded_tids */ + toep->flags &= ~TPF_IN_TOEP_LIST; + } + MPASS(TAILQ_EMPTY(&td->stranded_tids)); + TAILQ_CONCAT(&td->stranded_tids, &td->toep_list, link); + MPASS(TAILQ_EMPTY(&td->toep_list)); + mtx_unlock(&td->toep_list_lock); + + MPASS(atomic_load_int(&t->tids_in_use) == 0); +} + +/* + * L2T is stable because + * 1. stop_lld stopped all new allocations. + * 2. stop_lld also stopped the tx wrq so nothing is enqueueing new WRs to the + * queue or to l2t_entry->wr_list. + * 3. t4_l2t_update is ignoring all L2 updates. + */ +static void +stop_tom_l2t(struct adapter *sc) +{ + struct l2t_data *d = sc->l2t; + struct l2t_entry *e; + int i; + + for (i = 0; i < d->l2t_size; i++) { + e = &d->l2tab[i]; + mtx_lock(&e->lock); + if (e->state == L2T_STATE_VALID) + e->state = L2T_STATE_RESOLVING; + if (!STAILQ_EMPTY(&e->wr_list)) + CXGBE_UNIMPLEMENTED("l2t e->wr_list"); + mtx_unlock(&e->lock); + } +} + +static int +t4_tom_stop(struct adapter *sc) +{ + struct tid_info *t = &sc->tids; + struct tom_data *td = sc->tom_softc; + + ASSERT_SYNCHRONIZED_OP(sc); + + stop_tom_l2t(sc); + if (atomic_load_int(&t->atids_in_use) > 0) + stop_atids(sc); + if (atomic_load_int(&t->stids_in_use) > 0) + stop_stid_tab(sc); + if (atomic_load_int(&t->tids_in_use) > 0) + stop_tids(sc); + taskqueue_enqueue(taskqueue_thread, &td->cleanup_stranded_tids); + + return (0); +} + +static int +t4_tom_restart(struct adapter *sc) +{ + ASSERT_SYNCHRONIZED_OP(sc); + + restart_stid_tab(sc); + + return (0); +} + static int t4_ctloutput_tom(struct socket *so, struct sockopt *sopt) { diff --git a/sys/dev/cxgbe/tom/t4_tom.h b/sys/dev/cxgbe/tom/t4_tom.h index 0bc368fe3d56..8debab4940b1 100644 --- a/sys/dev/cxgbe/tom/t4_tom.h +++ b/sys/dev/cxgbe/tom/t4_tom.h @@ -76,6 +76,7 @@ enum { TPF_TLS_RX_QUIESCING = (1 << 14), /* RX quiesced for TLS RX startup */ TPF_TLS_RX_QUIESCED = (1 << 15), /* RX quiesced for TLS RX startup */ TPF_WAITING_FOR_FINAL = (1<< 16), /* waiting for wakeup on final CPL */ + TPF_IN_TOEP_LIST = (1 << 17), /* toep is in the main td->toep_list */ }; enum { @@ -210,7 +211,7 @@ struct toepcb { struct tom_data *td; struct inpcb *inp; /* backpointer to host stack's PCB */ u_int flags; /* miscellaneous flags */ - TAILQ_ENTRY(toepcb) link; /* toep_list */ + TAILQ_ENTRY(toepcb) link; /* toep_list or stranded_toep_list */ int refcount; struct vnet *vnet; struct vi_info *vi; /* virtual interface */ @@ -220,6 +221,7 @@ struct toepcb { struct l2t_entry *l2te; /* L2 table entry used by this connection */ struct clip_entry *ce; /* CLIP table entry used by this tid */ int tid; /* Connection identifier */ + int incarnation; /* sc->incarnation when toepcb was allocated */ /* tx credit handling */ u_int tx_total; /* total tx WR credits (in 16B units) */ @@ -278,6 +280,7 @@ struct synq_entry { uint32_t ts; uint32_t rss_hash; __be16 tcp_opt; /* from cpl_pass_establish */ + int incarnation; struct toepcb *toep; struct conn_params params; @@ -285,6 +288,7 @@ struct synq_entry { /* listen_ctx flags */ #define LCTX_RPL_PENDING 1 /* waiting for a CPL_PASS_OPEN_RPL */ +#define LCTX_SETUP_IN_HW 2 /* stid entry is setup in hardware */ struct listen_ctx { LIST_ENTRY(listen_ctx) link; /* listen hash linkage */ @@ -331,6 +335,11 @@ struct tom_data { struct mtx toep_list_lock; TAILQ_HEAD(, toepcb) toep_list; TAILQ_HEAD(, synq_entry) synqe_list; + /* List of tids left stranded because hw stopped abruptly. */ + TAILQ_HEAD(, toepcb) stranded_atids; + TAILQ_HEAD(, toepcb) stranded_tids; + TAILQ_HEAD(, synq_entry) stranded_synqe; + struct task cleanup_stranded_tids; struct mtx lctx_hash_lock; LIST_HEAD(, listen_ctx) *listen_hash; @@ -477,7 +486,7 @@ void t4_init_connect_cpl_handlers(void); void t4_uninit_connect_cpl_handlers(void); int t4_connect(struct toedev *, struct socket *, struct nhop_object *, struct sockaddr *); -void act_open_failure_cleanup(struct adapter *, u_int, u_int); +void act_open_failure_cleanup(struct adapter *, struct toepcb *, u_int); /* t4_listen.c */ void t4_init_listen_cpl_handlers(void); @@ -492,7 +501,11 @@ int do_abort_req_synqe(struct sge_iq *, const struct rss_header *, int do_abort_rpl_synqe(struct sge_iq *, const struct rss_header *, struct mbuf *); void t4_offload_socket(struct toedev *, void *, struct socket *); -void synack_failure_cleanup(struct adapter *, int); +void synack_failure_cleanup(struct adapter *, struct synq_entry *); +int alloc_stid_tab(struct adapter *); +void free_stid_tab(struct adapter *); +void stop_stid_tab(struct adapter *); +void restart_stid_tab(struct adapter *); /* t4_cpl_io.c */ void aiotx_init_toep(struct toepcb *); From nobody Mon Jul 22 05:39:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WS8Gf4k2Mz5PvN2; Mon, 22 Jul 2024 05:39: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WS8Gf3hsNz4DYT; Mon, 22 Jul 2024 05:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721626746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=96f93lWfWw2o1BvhTjRARakOVdEvjW5Ey+tYARjslhI=; b=CkkwkbGXIGGSu8QGVumkV88dh9sLzkULYl9xSiY5b01Da17WeAEEjxmYt9e5d61XCHXuUA bRGnIpxBNZ86obVnYsq4Ei8MxjSU50F7sqEfYB/QtVnly6HY/oG9mgJ2k0X5WsTVxZmGwd daZkVXu7oGHc6rnBvIP87Nk8bNjiKuhZjU6QLTURsCbcVA4vyr46FsnvPzRuzN6oVYlKay ha1T+dYbVeRDtr8dMIKr0aoxWAI2o5dZZ6J2ExiG125zuyad9floVyVeCu9khaMg6+Yv3f H5I19pzRtyY7/USNculWSCOCikb2RyIgwzNQyqrsF5I+xkDxwsmMkRx7duilOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721626746; a=rsa-sha256; cv=none; b=SWXY3rnel2KEKoZ3yXneXdk0AA3BxkkMs/cKmWyQM4tP3U29kpfGXJAPBBR9qhho3KNoXW l+i59KyXH/jbjnQ4n1xs4zaRucFIsYuRR6Flc5LWiSWJ1RBAadzT0+EnUpBmdBJ9rtdrak TF89ZEDe4LoPb392rZtGgtFqq32atUUgQcakH4EH5g4Z+B7fpcxq8fT4XrwdVX24Wiq7IY iJpJNiH+Gk8ZD1Th+S8fincslxeJ/1l2xmgMRlJ914EyZhZB/zQ7Au4KQLRWSR4sl2/PVD SQi4Di8ICA50E7Sf/SKg1zwkD+EIHSyfOLvILEuWeTEeobkrvgmN+PSImII0PQ== 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=1721626746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=96f93lWfWw2o1BvhTjRARakOVdEvjW5Ey+tYARjslhI=; b=yUqWkdpg8/VfR7tGRSonHTANX5zLD6umpIvkyfCKjEiulCuHjfpZdCpTSQ8sgbJ55mN9T6 VvqKvjaopKsPrWM1iDeLOFwWdpRfkKnboT0nMiQbQVDFjxPWzfFy8FJim+tNyCQfSUz1YL Y43NvHAQJ+V5NnVqM6ogcT/HtRgeu/gS6ASWU1rJEtYJXW3++AMxadzI+k7CbqDfp9U+9C hrmsfInLtUL6fvrpnjv2qsqqQ1ZbaUKoFvgHRr3KsKOMmVwAZIwO3aiVXTax6A9wS0NLer mUQQKJ++9hJalwqTRfT/1jBK89M+E4UAL6AUrEnQRiFQcD+sAQ040G5WlWCt1g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WS8Gf3JPrzXMx; Mon, 22 Jul 2024 05:39:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M5d6DR084310; Mon, 22 Jul 2024 05:39:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M5d6Zs084307; Mon, 22 Jul 2024 05:39:06 GMT (envelope-from git) Date: Mon, 22 Jul 2024 05:39:06 GMT Message-Id: <202407220539.46M5d6Zs084307@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: f1c4ed150334 - main - cxgbe/iw_cxgbe: Add a placeholder uld_restart. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f1c4ed150334ae2844810a58b7384cb0e3abe664 Auto-Submitted: auto-generated The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=f1c4ed150334ae2844810a58b7384cb0e3abe664 commit f1c4ed150334ae2844810a58b7384cb0e3abe664 Author: Navdeep Parhar AuthorDate: 2024-07-07 00:15:22 +0000 Commit: Navdeep Parhar CommitDate: 2024-07-22 05:25:08 +0000 cxgbe/iw_cxgbe: Add a placeholder uld_restart. MFC after: 1 month Sponsored by: Chelsio Communications --- sys/dev/cxgbe/iw_cxgbe/device.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/cxgbe/iw_cxgbe/device.c b/sys/dev/cxgbe/iw_cxgbe/device.c index 28d6d0f2d00c..279bdb20d511 100644 --- a/sys/dev/cxgbe/iw_cxgbe/device.c +++ b/sys/dev/cxgbe/iw_cxgbe/device.c @@ -260,11 +260,13 @@ static int c4iw_mod_unload(void); static int c4iw_activate(struct adapter *); static int c4iw_deactivate(struct adapter *); static int c4iw_stop(struct adapter *); +static int c4iw_restart(struct adapter *); static struct uld_info c4iw_uld_info = { .uld_activate = c4iw_activate, .uld_deactivate = c4iw_deactivate, .uld_stop = c4iw_stop, + .uld_restart = c4iw_restart, }; static int @@ -344,6 +346,12 @@ c4iw_stop(struct adapter *sc) return (0); } +static int +c4iw_restart(struct adapter *sc) +{ + return (0); +} + static void c4iw_activate_all(struct adapter *sc, void *arg __unused) { From nobody Mon Jul 22 07:15:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSBPR1FF2z5Q4YJ; Mon, 22 Jul 2024 07:15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSBPR0hzBz4LbJ; Mon, 22 Jul 2024 07:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721632507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d+nqcFSLd1pPWoEM4INRPI3VnR/jg0jYMNoDpKtpbWg=; b=xDq9noXP619eOyqFqX3s8z8xAVVF2hob7CurbMoj48lDayOQ/K0yWrVJAQt2Xmyhqhqb5a gFE3TCUsOGNAMfsWzdZ/oUZJFMzmPHhsmMHUOU6aKbOrY6mq8STIjB0rhY2sm0YJnb5xu4 eoP9/Hx06gqGSI0pm61NqQ5Spp2LHT9d0O/Wmaz/n/estU7OwzFUoIliAQB+4djJ39t3f3 vrC/ITEHki1V4DpQNVx/smFxNTP2M1gh603HFwUKsvuzF0QO+AnKpDgRjLiV0ONEqN1+E2 /LnOff8v8k1yol8ctxsaWoxN1J8RKgiJg6rWeXiYSvR8xvyVnZoYo5NwXqyZvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721632507; a=rsa-sha256; cv=none; b=cr6dZAi3pq92lxPDce4JMavnCu2uojPqkec90E9Z1bErXVVjnCcYb9zrKU6WT9QNo5c6cr GPsThI1lcPGebQ6baR7PoY/KxRmGkUhZvN3IytijfAe85msQ96GTZnpdkby/Uz5qQoRjSQ XBq0AU3rtPp0uGtENSfahwPfYjuuoaBZzTCeQb/LQFYcCV59sBXEYNTlTxNir/A5csUfZw zpAZbBy4O37/ZYMdLXDBorpbm5fMrXccRytesFrflU4sGd24UYedtQ0Tdi5/G1sYD8iyl3 8b9dql+iIygEO8joQfCR1vPOSWC/vSC7iBD2gb6w/FrdmzbSYxchyXLE/PSziQ== 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=1721632507; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d+nqcFSLd1pPWoEM4INRPI3VnR/jg0jYMNoDpKtpbWg=; b=uWEq/SfVHP63+dYT8uQ1QicrcpQIdXZxkAvLNpmfsrSenJRxStO4hkHVZ5GGSuvqs3shOl k6ngI6IOV0BeoZcaa+P6rDs76+VydsxaxzYXHofQfTUbKMohbKeFFr9y3rEUAw+O7pElXU zaTQlM+PmsXnUMq7jTDJFciAednd7uWSGNJk+x6T/ro45okf5WwO5OfMbIFVyfjPGEqGld BUfliDd1Z0nBwHjjScsxZEynPocNjKMgK4mJXq4LjJlIdT/xH0UpVtNhueEiMVZwpmkO/W GFgXNA0uwqbKWh040u60DCtbwjwJT6pNl3L3PO7odYbLfmwFxwNBGLQ+R1yBAA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSBPR0JM8zbcx; Mon, 22 Jul 2024 07:15:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M7F6iY052894; Mon, 22 Jul 2024 07:15:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M7F6hx052891; Mon, 22 Jul 2024 07:15:06 GMT (envelope-from git) Date: Mon, 22 Jul 2024 07:15:06 GMT Message-Id: <202407220715.46M7F6hx052891@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 644b7b5a2e31 - main - pf: convert DIOCGETADDRS to netlink List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 644b7b5a2e31fc1d21e7e90764a7b043e5b66d1a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=644b7b5a2e31fc1d21e7e90764a7b043e5b66d1a commit 644b7b5a2e31fc1d21e7e90764a7b043e5b66d1a Author: Kristof Provost AuthorDate: 2024-07-19 12:15:30 +0000 Commit: Kristof Provost CommitDate: 2024-07-22 07:11:49 +0000 pf: convert DIOCGETADDRS to netlink Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libpfctl/libpfctl.c | 44 +++++++++++++++++++++++++++++++++++++ lib/libpfctl/libpfctl.h | 2 ++ sbin/pfctl/pfctl.c | 2 +- sys/net/pfvar.h | 1 + sys/netpfil/pf/pf_ioctl.c | 42 +++++++++++++++++++++-------------- sys/netpfil/pf/pf_nl.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++ sys/netpfil/pf/pf_nl.h | 1 + 7 files changed, 131 insertions(+), 17 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index 398595c4715f..c2e842d65b11 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -2789,3 +2789,47 @@ pfctl_add_addr(struct pfctl_handle *h, const struct pfioc_pooladdr *pa) return (e.error); } + +static const struct snl_attr_parser ap_get_addrs[] = { + { .type = PF_AA_NR, .off = 0, .cb = snl_attr_get_uint32 }, +}; +static struct snl_field_parser fp_get_addrs[] = {}; +SNL_DECLARE_PARSER(get_addrs_parser, struct genlmsghdr, fp_get_addrs, ap_get_addrs); + +int +pfctl_get_addrs(struct pfctl_handle *h, uint32_t ticket, uint32_t r_num, + uint8_t r_action, const char *anchor, uint32_t *nr) +{ + struct snl_writer nw; + struct snl_errmsg_data e = {}; + struct nlmsghdr *hdr; + uint32_t seq_id; + int family_id; + + family_id = snl_get_genl_family(&h->ss, PFNL_FAMILY_NAME); + if (family_id == 0) + return (ENOTSUP); + + snl_init_writer(&h->ss, &nw); + hdr = snl_create_genl_msg_request(&nw, family_id, PFNL_CMD_GET_ADDRS); + + snl_add_msg_attr_u32(&nw, PF_AA_TICKET, ticket); + snl_add_msg_attr_u32(&nw, PF_AA_R_NUM, r_num); + snl_add_msg_attr_u8(&nw, PF_AA_R_ACTION, r_action); + snl_add_msg_attr_string(&nw, PF_AA_ANCHOR, anchor); + + if ((hdr = snl_finalize_msg(&nw)) == NULL) + return (ENXIO); + + seq_id = hdr->nlmsg_seq; + + if (! snl_send_message(&h->ss, hdr)) + return (ENXIO); + + while ((hdr = snl_read_reply_multi(&h->ss, seq_id, &e)) != NULL) { + if (! snl_parse_nlmsg(&h->ss, hdr, &get_addrs_parser, nr)) + continue; + } + + return (e.error); +} diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index dd09b061efea..22db0b2d90b5 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -499,5 +499,7 @@ int pfctl_set_limit(struct pfctl_handle *h, const int index, const uint limit); int pfctl_get_limit(struct pfctl_handle *h, const int index, uint *limit); int pfctl_begin_addrs(struct pfctl_handle *h, uint32_t *ticket); int pfctl_add_addr(struct pfctl_handle *h, const struct pfioc_pooladdr *pa); +int pfctl_get_addrs(struct pfctl_handle *h, uint32_t ticket, uint32_t r_num, + uint8_t r_action, const char *anchor, uint32_t *nr); #endif diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index a49e82809f9e..f9522484cdc7 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -968,7 +968,7 @@ pfctl_get_pool(int dev, struct pfctl_pool *pool, u_int32_t nr, pp.r_action = r_action; pp.r_num = nr; pp.ticket = ticket; - if (ioctl(dev, DIOCGETADDRS, &pp)) { + if (pfctl_get_addrs(pfh, ticket, nr, r_action, anchorname, &pp.nr) != 0) { warn("DIOCGETADDRS"); return (-1); } diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index b38a1bebcc1f..291acce19327 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2528,6 +2528,7 @@ int pf_ioctl_get_limit(int, unsigned int *); int pf_ioctl_set_limit(int, unsigned int, unsigned int *); int pf_ioctl_begin_addrs(uint32_t *); int pf_ioctl_add_addr(struct pfioc_pooladdr *); +int pf_ioctl_get_addrs(struct pfioc_pooladdr *); void pf_krule_free(struct pf_krule *); void pf_krule_clear_counters(struct pf_krule *); diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index f5a216666076..4ea0301cd3c4 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2589,6 +2589,31 @@ out: return (error); } +int +pf_ioctl_get_addrs(struct pfioc_pooladdr *pp) +{ + struct pf_kpool *pool; + struct pf_kpooladdr *pa; + + PF_RULES_RLOCK_TRACKER; + + pp->anchor[sizeof(pp->anchor) - 1] = 0; + pp->nr = 0; + + PF_RULES_RLOCK(); + pool = pf_get_kpool(pp->anchor, pp->ticket, pp->r_action, + pp->r_num, 0, 1, 0); + if (pool == NULL) { + PF_RULES_RUNLOCK(); + return (EBUSY); + } + TAILQ_FOREACH(pa, &pool->list, entries) + pp->nr++; + PF_RULES_RUNLOCK(); + + return (0); +} + static int pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { @@ -4267,23 +4292,8 @@ DIOCGETSTATESV2_full: case DIOCGETADDRS: { struct pfioc_pooladdr *pp = (struct pfioc_pooladdr *)addr; - struct pf_kpool *pool; - struct pf_kpooladdr *pa; - pp->anchor[sizeof(pp->anchor) - 1] = 0; - pp->nr = 0; - - PF_RULES_RLOCK(); - pool = pf_get_kpool(pp->anchor, pp->ticket, pp->r_action, - pp->r_num, 0, 1, 0); - if (pool == NULL) { - PF_RULES_RUNLOCK(); - error = EBUSY; - break; - } - TAILQ_FOREACH(pa, &pool->list, entries) - pp->nr++; - PF_RULES_RUNLOCK(); + error = pf_ioctl_get_addrs(pp); break; } diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 6c98a50d8e06..79aa76f625e3 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -1509,6 +1509,21 @@ pf_handle_begin_addrs(struct nlmsghdr *hdr, struct nl_pstate *npt) return (0); } +static bool +nlattr_add_pool_addr(struct nl_writer *nw, int attrtype, struct pf_pooladdr *a) +{ + int off; + + off = nlattr_add_nested(nw, attrtype); + + nlattr_add_addr_wrap(nw, PF_PA_ADDR, &a->addr); + nlattr_add_string(nw, PF_PA_IFNAME, a->ifname); + + nlattr_set_len(nw, off); + + return (true); +} + #define _OUT(_field) offsetof(struct pf_pooladdr, _field) static const struct nlattr_parser nla_p_pool_addr[] = { { .type = PF_PA_ADDR, .off = _OUT(addr), .arg = &addr_wrap_parser, .cb = nlattr_get_nested }, @@ -1548,6 +1563,40 @@ pf_handle_add_addr(struct nlmsghdr *hdr, struct nl_pstate *npt) return (error); } +static int +pf_handle_get_addrs(struct nlmsghdr *hdr, struct nl_pstate *npt) +{ + struct pfioc_pooladdr attrs = { 0 }; + struct nl_writer *nw = npt->nw; + struct genlmsghdr *ghdr_new; + int error; + + error = nl_parse_nlmsg(hdr, &add_addr_parser, npt, &attrs); + if (error != 0) + return (error); + + error = pf_ioctl_get_addrs(&attrs); + if (error != 0) + return (error); + + if (!nlmsg_reply(nw, hdr, sizeof(struct genlmsghdr))) + return (ENOMEM); + + ghdr_new = nlmsg_reserve_object(nw, struct genlmsghdr); + ghdr_new->cmd = PFNL_CMD_GET_ADDRS; + ghdr_new->version = 0; + ghdr_new->reserved = 0; + + nlattr_add_u32(nw, PF_AA_NR, attrs.nr); + + if (!nlmsg_end(nw)) { + nlmsg_abort(nw); + return (ENOMEM); + } + + return (error); +} + static const struct nlhdr_parser *all_parsers[] = { &state_parser, &addrule_parser, @@ -1705,6 +1754,13 @@ static const struct genl_cmd pf_cmds[] = { .cmd_flags = GENL_CMD_CAP_DO | GENL_CMD_CAP_HASPOL, .cmd_priv = PRIV_NETINET_PF, }, + { + .cmd_num = PFNL_CMD_GET_ADDRS, + .cmd_name = "GET_ADDRS", + .cmd_cb = pf_handle_get_addrs, + .cmd_flags = GENL_CMD_CAP_DUMP | GENL_CMD_CAP_HASPOL, + .cmd_priv = PRIV_NETINET_PF, + }, }; void diff --git a/sys/netpfil/pf/pf_nl.h b/sys/netpfil/pf/pf_nl.h index 2459fdc15a63..013a7e1e0ef0 100644 --- a/sys/netpfil/pf/pf_nl.h +++ b/sys/netpfil/pf/pf_nl.h @@ -56,6 +56,7 @@ enum { PFNL_CMD_GET_LIMIT = 18, PFNL_CMD_BEGIN_ADDRS = 19, PFNL_CMD_ADD_ADDR = 20, + PFNL_CMD_GET_ADDRS = 21, __PFNL_CMD_MAX, }; #define PFNL_CMD_MAX (__PFNL_CMD_MAX -1) From nobody Mon Jul 22 07:15:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSBPS21WDz5Q4Qd; Mon, 22 Jul 2024 07:15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSBPS1K6vz4Ln0; Mon, 22 Jul 2024 07:15:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721632508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=miX8zYUN3WLxmEfz0GZf92e4iQlEeY8RCZqCDPAMkRQ=; b=B0ZiXauKeyGKoepcbqlRqKMd+xrN+q/efExru0Cmia8ymp8Y6+NmujpWOsnMntpCf26NjL evUBX1ZbY6OjQfwfI1zP8s5Cp4xKz1cqRRxhSlSufCeALEe7tC8muJ7kNxJRFZ2nzbg7Ov rTXsv8mABZ9KSm4ZFD8wiuCVMcdNvXe7FeZeANRgPM18W/VHS6UJx7n49+rP/zTwxEmZPD 7seOFOHJW20aTIuf/rkZF4cyhEGA/D0yAkr9lRipSNbOmqvlb3B39IIPYg9lBQdsA6Ljf8 rHIuSJFDrkkfKHVWqN5IhHOY4fd7KJ3kJEQOgxHF9yqSbdl58Qe7sv44R30ngw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721632508; a=rsa-sha256; cv=none; b=lGPJ4alfzqbri1n5XzMi/ZGY4d2b7mKunw3hnwARZj9ZBVhG821Y0fWtaTBiP7xPAIOWUE dGfSQqBHeYlq8tekpxPBzeVXqBNI2agrmtVYjFKbfKE270xhOnOmqiNLJ8+ZEaPuxLU/Gp 1aADNyJ/79AuoWLcHhxt+c93CpqXD2SnA2KtFTof/Sa/ZZXQoFTo8uarG7rEd7yPTBoBrq z9zzqcKP3TVI/8NPPrO63BilUMZ7EnqKGSSuwbjcYmNAj7fdr6OZiGm5trSfBAn9MgJRCB 3ouTwRw6K24nJTGnWdPRsWPWvfwD2WO7HyHRkvB2+G1PUSs5GTeUGSafHEDv8Q== 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=1721632508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=miX8zYUN3WLxmEfz0GZf92e4iQlEeY8RCZqCDPAMkRQ=; b=d0VXXPTZBiXQPn9nsBBLEMy2KmcRfAlW8DhVZir80St+9UvENfrz/QRYnrVhYh9ws9uysu 3K5DLxXmuY9Fe8ktm1YpG820uvRZ/aRHGzl1UYt0gRHJtJV0gH9TPoi48UrRfyVA51cJge 3Q4t9jC/oKYMWci74Qh01v26fpNVS6zPEIE2bKkdlv9Vtx4GvrR1QdacPPjg4K/7RUyH+A 4Eq+0mkUJlecrHEzEYJDK2TL5S+CknasKYzDKPdbMmu6eoKvsGjycMe6bakCRIqKJAeg6Y cqkQgoHo158aywuQf4XRGx4moCdPtDtuXPdE9Jqn0a15dcCmLhnt+C0BivL+8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSBPS0wNqzbZh; Mon, 22 Jul 2024 07:15:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M7F8Le052943; Mon, 22 Jul 2024 07:15:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M7F8kZ052940; Mon, 22 Jul 2024 07:15:08 GMT (envelope-from git) Date: Mon, 22 Jul 2024 07:15:08 GMT Message-Id: <202407220715.46M7F8kZ052940@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 9ae91f59c500 - main - pf: convert DIOCGETADDR to netlink List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ae91f59c50030ff721ad4105a7545129d4c91b9 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=9ae91f59c50030ff721ad4105a7545129d4c91b9 commit 9ae91f59c50030ff721ad4105a7545129d4c91b9 Author: Kristof Provost AuthorDate: 2024-07-19 15:48:25 +0000 Commit: Kristof Provost CommitDate: 2024-07-22 07:11:49 +0000 pf: convert DIOCGETADDR to netlink Sponsored by: Rubicon Communications, LLC ("Netgate") --- lib/libpfctl/libpfctl.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++ lib/libpfctl/libpfctl.h | 2 ++ sbin/pfctl/pfctl.c | 11 +++------ sys/net/pfvar.h | 1 + sys/netpfil/pf/pf_ioctl.c | 61 ++++++++++++++++++++++++++------------------- sys/netpfil/pf/pf_nl.c | 49 ++++++++++++++++++++++++++++++++++++ sys/netpfil/pf/pf_nl.h | 1 + 7 files changed, 154 insertions(+), 34 deletions(-) diff --git a/lib/libpfctl/libpfctl.c b/lib/libpfctl/libpfctl.c index c2e842d65b11..c7b2cd17bc29 100644 --- a/lib/libpfctl/libpfctl.c +++ b/lib/libpfctl/libpfctl.c @@ -2833,3 +2833,66 @@ pfctl_get_addrs(struct pfctl_handle *h, uint32_t ticket, uint32_t r_num, return (e.error); } + +#define _OUT(_field) offsetof(struct pf_pooladdr, _field) +static const struct snl_attr_parser ap_pool_addr[] = { + { .type = PF_PA_ADDR, .off = _OUT(addr), .arg = &addr_wrap_parser, .cb = snl_attr_get_nested }, + { .type = PF_PA_IFNAME, .off = _OUT(ifname), .arg_u32 = IFNAMSIZ, .cb = snl_attr_copy_string }, +}; +SNL_DECLARE_ATTR_PARSER(pool_addr_parser, ap_pool_addr); +#undef _OUT + +#define _OUT(_field) offsetof(struct pfioc_pooladdr, _field) +static const struct snl_attr_parser ap_get_addr[] = { + { .type = PF_AA_ACTION, .off = _OUT(action), .cb = snl_attr_get_uint32 }, + { .type = PF_AA_TICKET, .off = _OUT(ticket), .cb = snl_attr_get_uint32 }, + { .type = PF_AA_NR, .off = _OUT(nr), .cb = snl_attr_get_uint32 }, + { .type = PF_AA_R_NUM, .off = _OUT(r_num), .cb = snl_attr_get_uint32 }, + { .type = PF_AA_R_ACTION, .off = _OUT(r_action), .cb = snl_attr_get_uint8 }, + { .type = PF_AA_R_LAST, .off = _OUT(r_last), .cb = snl_attr_get_uint8 }, + { .type = PF_AA_AF, .off = _OUT(af), .cb = snl_attr_get_uint8 }, + { .type = PF_AA_ANCHOR, .off = _OUT(anchor), .arg_u32 = MAXPATHLEN, .cb = snl_attr_copy_string }, + { .type = PF_AA_ADDR, .off = _OUT(addr), .arg = &pool_addr_parser, .cb = snl_attr_get_nested }, +}; +static struct snl_field_parser fp_get_addr[] = {}; +SNL_DECLARE_PARSER(get_addr_parser, struct genlmsghdr, fp_get_addr, ap_get_addr); +#undef _OUT + +int +pfctl_get_addr(struct pfctl_handle *h, uint32_t ticket, uint32_t r_num, + uint8_t r_action, const char *anchor, uint32_t nr, struct pfioc_pooladdr *pa) +{ + struct snl_writer nw; + struct snl_errmsg_data e = {}; + struct nlmsghdr *hdr; + uint32_t seq_id; + int family_id; + + family_id =snl_get_genl_family(&h->ss, PFNL_FAMILY_NAME); + if (family_id == 0) + return (ENOTSUP); + + snl_init_writer(&h->ss, &nw); + hdr = snl_create_genl_msg_request(&nw, family_id, PFNL_CMD_GET_ADDR); + + snl_add_msg_attr_u32(&nw, PF_AA_TICKET, ticket); + snl_add_msg_attr_u32(&nw, PF_AA_R_NUM, r_num); + snl_add_msg_attr_u8(&nw, PF_AA_R_ACTION, r_action); + snl_add_msg_attr_string(&nw, PF_AA_ANCHOR, anchor); + snl_add_msg_attr_u32(&nw, PF_AA_NR, nr); + + if ((hdr = snl_finalize_msg(&nw)) == NULL) + return (ENXIO); + + seq_id = hdr->nlmsg_seq; + + if (! snl_send_message(&h->ss, hdr)) + return (ENXIO); + + while ((hdr = snl_read_reply_multi(&h->ss, seq_id, &e)) != NULL) { + if (! snl_parse_nlmsg(&h->ss, hdr, &get_addr_parser, pa)) + continue; + } + + return (0); +} diff --git a/lib/libpfctl/libpfctl.h b/lib/libpfctl/libpfctl.h index 22db0b2d90b5..33d7d0f113ac 100644 --- a/lib/libpfctl/libpfctl.h +++ b/lib/libpfctl/libpfctl.h @@ -501,5 +501,7 @@ int pfctl_begin_addrs(struct pfctl_handle *h, uint32_t *ticket); int pfctl_add_addr(struct pfctl_handle *h, const struct pfioc_pooladdr *pa); int pfctl_get_addrs(struct pfctl_handle *h, uint32_t ticket, uint32_t r_num, uint8_t r_action, const char *anchor, uint32_t *nr); +int pfctl_get_addr(struct pfctl_handle *h, uint32_t ticket, uint32_t r_num, + uint8_t r_action, const char *anchor, uint32_t nr, struct pfioc_pooladdr *pa); #endif diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index f9522484cdc7..39c6d684a317 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -964,19 +964,14 @@ pfctl_get_pool(int dev, struct pfctl_pool *pool, u_int32_t nr, u_int32_t pnr, mpnr; memset(&pp, 0, sizeof(pp)); - memcpy(pp.anchor, anchorname, sizeof(pp.anchor)); - pp.r_action = r_action; - pp.r_num = nr; - pp.ticket = ticket; - if (pfctl_get_addrs(pfh, ticket, nr, r_action, anchorname, &pp.nr) != 0) { + if (pfctl_get_addrs(pfh, ticket, nr, r_action, anchorname, &mpnr) != 0) { warn("DIOCGETADDRS"); return (-1); } - mpnr = pp.nr; + TAILQ_INIT(&pool->list); for (pnr = 0; pnr < mpnr; ++pnr) { - pp.nr = pnr; - if (ioctl(dev, DIOCGETADDR, &pp)) { + if (pfctl_get_addr(pfh, ticket, nr, r_action, anchorname, pnr, &pp) != 0) { warn("DIOCGETADDR"); return (-1); } diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 291acce19327..eecd61f960c8 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2529,6 +2529,7 @@ int pf_ioctl_set_limit(int, unsigned int, unsigned int *); int pf_ioctl_begin_addrs(uint32_t *); int pf_ioctl_add_addr(struct pfioc_pooladdr *); int pf_ioctl_get_addrs(struct pfioc_pooladdr *); +int pf_ioctl_get_addr(struct pfioc_pooladdr *); void pf_krule_free(struct pf_krule *); void pf_krule_clear_counters(struct pf_krule *); diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 4ea0301cd3c4..959ebdf94cd4 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2614,6 +2614,40 @@ pf_ioctl_get_addrs(struct pfioc_pooladdr *pp) return (0); } +int +pf_ioctl_get_addr(struct pfioc_pooladdr *pp) +{ + struct pf_kpool *pool; + struct pf_kpooladdr *pa; + u_int32_t nr = 0; + + PF_RULES_RLOCK_TRACKER; + + pp->anchor[sizeof(pp->anchor) - 1] = 0; + + PF_RULES_RLOCK(); + pool = pf_get_kpool(pp->anchor, pp->ticket, pp->r_action, + pp->r_num, 0, 1, 1); + if (pool == NULL) { + PF_RULES_RUNLOCK(); + return (EBUSY); + } + pa = TAILQ_FIRST(&pool->list); + while ((pa != NULL) && (nr < pp->nr)) { + pa = TAILQ_NEXT(pa, entries); + nr++; + } + if (pa == NULL) { + PF_RULES_RUNLOCK(); + return (EBUSY); + } + pf_kpooladdr_to_pooladdr(pa, &pp->addr); + pf_addr_copyout(&pp->addr.addr); + PF_RULES_RUNLOCK(); + + return (0); +} + static int pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { @@ -4299,33 +4333,8 @@ DIOCGETSTATESV2_full: case DIOCGETADDR: { struct pfioc_pooladdr *pp = (struct pfioc_pooladdr *)addr; - struct pf_kpool *pool; - struct pf_kpooladdr *pa; - u_int32_t nr = 0; - - pp->anchor[sizeof(pp->anchor) - 1] = 0; - PF_RULES_RLOCK(); - pool = pf_get_kpool(pp->anchor, pp->ticket, pp->r_action, - pp->r_num, 0, 1, 1); - if (pool == NULL) { - PF_RULES_RUNLOCK(); - error = EBUSY; - break; - } - pa = TAILQ_FIRST(&pool->list); - while ((pa != NULL) && (nr < pp->nr)) { - pa = TAILQ_NEXT(pa, entries); - nr++; - } - if (pa == NULL) { - PF_RULES_RUNLOCK(); - error = EBUSY; - break; - } - pf_kpooladdr_to_pooladdr(pa, &pp->addr); - pf_addr_copyout(&pp->addr.addr); - PF_RULES_RUNLOCK(); + error = pf_ioctl_get_addr(pp); break; } diff --git a/sys/netpfil/pf/pf_nl.c b/sys/netpfil/pf/pf_nl.c index 79aa76f625e3..060cd5e39852 100644 --- a/sys/netpfil/pf/pf_nl.c +++ b/sys/netpfil/pf/pf_nl.c @@ -1597,6 +1597,48 @@ pf_handle_get_addrs(struct nlmsghdr *hdr, struct nl_pstate *npt) return (error); } +static int +pf_handle_get_addr(struct nlmsghdr *hdr, struct nl_pstate *npt) +{ + struct pfioc_pooladdr attrs = { 0 }; + struct nl_writer *nw = npt->nw; + struct genlmsghdr *ghdr_new; + int error; + + error = nl_parse_nlmsg(hdr, &add_addr_parser, npt, &attrs); + if (error != 0) + return (error); + + error = pf_ioctl_get_addr(&attrs); + if (error != 0) + return (error); + + if (!nlmsg_reply(nw, hdr, sizeof(struct genlmsghdr))) + return (ENOMEM); + + ghdr_new = nlmsg_reserve_object(nw, struct genlmsghdr); + ghdr_new->cmd = PFNL_CMD_GET_ADDRS; + ghdr_new->version = 0; + ghdr_new->reserved = 0; + + nlattr_add_u32(nw, PF_AA_ACTION, attrs.action); + nlattr_add_u32(nw, PF_AA_TICKET, attrs.ticket); + nlattr_add_u32(nw, PF_AA_NR, attrs.nr); + nlattr_add_u32(nw, PF_AA_R_NUM, attrs.r_num); + nlattr_add_u8(nw, PF_AA_R_ACTION, attrs.r_action); + nlattr_add_u8(nw, PF_AA_R_LAST, attrs.r_last); + nlattr_add_u8(nw, PF_AA_AF, attrs.af); + nlattr_add_string(nw, PF_AA_ANCHOR, attrs.anchor); + nlattr_add_pool_addr(nw, PF_AA_ADDR, &attrs.addr); + + if (!nlmsg_end(nw)) { + nlmsg_abort(nw); + return (ENOMEM); + } + + return (0); +} + static const struct nlhdr_parser *all_parsers[] = { &state_parser, &addrule_parser, @@ -1761,6 +1803,13 @@ static const struct genl_cmd pf_cmds[] = { .cmd_flags = GENL_CMD_CAP_DUMP | GENL_CMD_CAP_HASPOL, .cmd_priv = PRIV_NETINET_PF, }, + { + .cmd_num = PFNL_CMD_GET_ADDR, + .cmd_name = "GET_ADDRS", + .cmd_cb = pf_handle_get_addr, + .cmd_flags = GENL_CMD_CAP_DUMP | GENL_CMD_CAP_HASPOL, + .cmd_priv = PRIV_NETINET_PF, + }, }; void diff --git a/sys/netpfil/pf/pf_nl.h b/sys/netpfil/pf/pf_nl.h index 013a7e1e0ef0..cfe81cf142ab 100644 --- a/sys/netpfil/pf/pf_nl.h +++ b/sys/netpfil/pf/pf_nl.h @@ -57,6 +57,7 @@ enum { PFNL_CMD_BEGIN_ADDRS = 19, PFNL_CMD_ADD_ADDR = 20, PFNL_CMD_GET_ADDRS = 21, + PFNL_CMD_GET_ADDR = 22, __PFNL_CMD_MAX, }; #define PFNL_CMD_MAX (__PFNL_CMD_MAX -1) From nobody Mon Jul 22 09:54:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSFxM5Xp7z5QL7s; Mon, 22 Jul 2024 09:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSFxM4dxGz4dDJ; Mon, 22 Jul 2024 09:54:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721642071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uRo+I6BTNnBOWzV2Pa+pyaNM4CSSAw570akNosGcZCs=; b=l6Rxi8YLsgS/uwktwVdXHV9dsGGq3BXezAslGn23tjRQB9SGYEZlA0FJN2bEQBSJlB7fE8 Y8wIXARa7fGYEYd4rZw0Bji6VUefMjCWB8pSUqhZKekh29eFHp4fUkScJIMW568StKP+LC KIFzPdaTfi6ATq4Jk9UnZNeEtJtvZsWZqbKaadfTK7IweuQTOBgLpBViMd+oqoBnmfOJjV +QdAgv1cYK6odlG7ZhGAELsi9HwWEkiSgIlKidbM54ACOHqr6GYbdaEmpPKiVW7kItsFaF xWwenGFsnTmxu1V+84J/uiwXnAG0ckquXD3NX0qLNbpjUyNIWczFuOtvHSv5iQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721642071; a=rsa-sha256; cv=none; b=F9/5StqLKUBa57bKoHxkeH3f51RHUR8oHwIFWGU4mpEXNlpWQVtNuZcYavoIq+32t5MGnu VsDXNW4XWMnF0EUOLKoO3N5aD/s2yplTTK5RYYCj6Wy45MeYuAhTGIGVmoJaZhdBwRNGX7 Xu6e+0M1VlDqX3lJUrA3J3JaBubhog9MpghP2Z8BKtdqEbKYpBNGUsgN/Fq0DLGPY/PK+x R66eVe4lowgDTIhG7Sz7/yC/TIKOjSSLNF+EZoptcEaXXIeMlPCpb3zykSnuipIBTI7Fgc tqTZD0FRG37A7VyhTkTB5bms9la7/BnkAZvOMPHK4n4hzmKf8jn7wJARiUWXyA== 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=1721642071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uRo+I6BTNnBOWzV2Pa+pyaNM4CSSAw570akNosGcZCs=; b=B2iogqMJBY4h96kGkhXj9K5rrT8DwuhNRAT2meOUUFSUwjKDh1xfcvFqKAbOSHpnY9T7yg JjZxb8MNGgJ1SrcuB13ibukxTCH1ru4UC172Ner6TBkgFS/MrxJiGV7DjlzWkL9AlteuwB I1ENZjQJoBRHMAoMYU+0eoKB4/legKjiuprNmBlmpHNZFjQ6ZF70uHmakWzr0co0sVD8GM dOfysnjtNxzfQ+l2zcFCbqFj+YSYfWSynLber7kmpL5XnvFNqMp1Mb8dMFZRLwqV4qNmA1 EyE+Fv21qQAzb4CzKAWj9JE8pGu9LOzUQed1KE7wT+eAsNTUdYvAZ5l+2ok/Ww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSFxM4F3YzgT0; Mon, 22 Jul 2024 09:54:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46M9sVEq024828; Mon, 22 Jul 2024 09:54:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46M9sVm0024825; Mon, 22 Jul 2024 09:54:31 GMT (envelope-from git) Date: Mon, 22 Jul 2024 09:54:31 GMT Message-Id: <202407220954.46M9sVm0024825@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konrad Witaszczyk Subject: git: 5688843dc9c5 - main - sys: Index netlink/ files with the cscope target List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: def X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5688843dc9c5fd8d3fe0c0915a6240d680e0b506 Auto-Submitted: auto-generated The branch main has been updated by def: URL: https://cgit.FreeBSD.org/src/commit/?id=5688843dc9c5fd8d3fe0c0915a6240d680e0b506 commit 5688843dc9c5fd8d3fe0c0915a6240d680e0b506 Author: Konrad Witaszczyk AuthorDate: 2024-07-09 14:16:56 +0000 Commit: Konrad Witaszczyk CommitDate: 2024-07-22 09:50:43 +0000 sys: Index netlink/ files with the cscope target Reviewed by: oshogbo Approved by: oshogbo (mentor) Differential Revision: https://reviews.freebsd.org/D45934 --- sys/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/Makefile b/sys/Makefile index e62c085b4a5c..e05016045833 100644 --- a/sys/Makefile +++ b/sys/Makefile @@ -1,7 +1,7 @@ # Directories to include in cscope name file and TAGS. CSCOPEDIRS= bsm cam cddl compat conf contrib crypto ddb dev fs gdb \ geom gnu isa kern libkern modules net net80211 \ - netgraph netinet netinet6 netipsec netpfil \ + netgraph netinet netinet6 netipsec netlink netpfil \ netsmb nfs nfsclient nfsserver nlm ofed opencrypto \ rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} .if !defined(CSCOPE_ARCHDIR) From nobody Mon Jul 22 10:02:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSG6S64Mlz5QM39; Mon, 22 Jul 2024 10:02: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSG6S2ghcz4dpH; Mon, 22 Jul 2024 10:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721642544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y1OSkzY0hoM7Vr+LsAJHohNeF7HMjwcXzAklojhP0Lg=; b=ggj30g/31gP0ul5x1Fyg2BkQfoHi8hIEj5RV+2ldN/yWZovSCrVKBWd9YpbosODGN2+sPS ql+F8jFMCZuxky01o1eNkgybjzD8nhRrgoV3iUbINkzVjlemyDp7bGKLqSCUo+WEq98eDO iC27qXPxtXlVhXQlDtiXrsVweX+YJrZNBSS6yj/a4cTdw6IaxoyHGDplycZNN35GWT3VtC sxCQ42gI/7QKqYZFQbELudYDMPxIWJ9FZzGWHYDKJEs48/RRhPqU6QmD2cTPxSmS7o4Oua Gip7SfkWzFR98X72VGxCS15GmwQtgKeXYQRob+uaiNv9ps69TxDiVGXutcy6Ag== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721642544; a=rsa-sha256; cv=none; b=vq2PYiTPeB9XoTrgjeemA08eU60uexwVxTPjvO4I1QdJnfyrBe28m8SMpRgj+VzCLfnrLz tmk+TkdI+HN+fkLWnUsBNauBqSN2DCg1HKRYvLe6h72/R659jHG3Hp4u4ryR2L32WJQtlH sy5dvqARIHWvWawlll71q/upJ3VlO5+7/MotyQbpXiAP/V74QYMZxhI/wqOOjNrjGS0Z3q CJQRiJAyAxJarc4Bla4d4VEw/6CScXW7BOKL5weC84TIz+XT5/WfKsb6hS69cnUfeh5Bue 1H0W0dFtAUv0KBUQKGM4Ea7vPevJDn2rto6HBoGQkFmaeuhPEMwHtqXAJhOTdg== 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=1721642544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=y1OSkzY0hoM7Vr+LsAJHohNeF7HMjwcXzAklojhP0Lg=; b=FTR0M8WZ/KR6OE1J2evJOdnU/ZN1xFWTpP682w056nm1eiV8yBFaQF98l+5NEPb8XBgl4R uteHpZzCO4ceNFFG0JbS/TS6D5mLOM6zHa79+SfuG/HWJ1aUHv39nNLMu9/wXWbBufproW /5lmDJOHucOZsv8Q1MkZlU99ANqsMLSY+qXFojrkA9+3dbSJvf5VgxkTsSPkCOczbVIr5+ /v2zmROq3b6YEBaZFrL4uqJGEQFx+xGggcdSNs5Yl5nw11QdU6frtdO+qTgx1RyraIql5s sl+5eg0aJmCSElFONaVtqEhnW1iZ8i0pQFtveAouSehpNhC6Gybp2GKLm6ZxXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSG6S2HzYzgjd; Mon, 22 Jul 2024 10:02:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MA2Odb042295; Mon, 22 Jul 2024 10:02:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MA2OST042292; Mon, 22 Jul 2024 10:02:24 GMT (envelope-from git) Date: Mon, 22 Jul 2024 10:02:24 GMT Message-Id: <202407221002.46MA2OST042292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konrad Witaszczyk Subject: git: bb8fa2ef83c9 - main - sbin/nos-tun: correct SIOCDIFADDR calls to use ifreq List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: def X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb8fa2ef83c91d4bd5538f4f445b4100ac141419 Auto-Submitted: auto-generated The branch main has been updated by def: URL: https://cgit.FreeBSD.org/src/commit/?id=bb8fa2ef83c91d4bd5538f4f445b4100ac141419 commit bb8fa2ef83c91d4bd5538f4f445b4100ac141419 Author: Konrad Witaszczyk AuthorDate: 2024-06-28 10:28:55 +0000 Commit: Konrad Witaszczyk CommitDate: 2024-07-22 09:58:37 +0000 sbin/nos-tun: correct SIOCDIFADDR calls to use ifreq The SIOCDIFADDR ioctl takes an ifreq structure object, not an ifaliasreq structure object, as its argument. Reviewed by: brooks, jhb, oshogbo Approved by: oshogbo (mentor) Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D46017 --- sbin/nos-tun/nos-tun.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sbin/nos-tun/nos-tun.c b/sbin/nos-tun/nos-tun.c index f3af62db265b..ca0e33b2509a 100644 --- a/sbin/nos-tun/nos-tun.c +++ b/sbin/nos-tun/nos-tun.c @@ -141,7 +141,7 @@ tun_open(char *dev_name, struct sockaddr *ouraddr, char *theiraddr) * when tunN have no addresses, so - log and ignore it. * */ - if (ioctl(s, SIOCDIFADDR, &ifra) < 0) { + if (ioctl(s, SIOCDIFADDR, &ifrq) < 0) { syslog(LOG_ERR,"SIOCDIFADDR - %m"); } @@ -220,10 +220,8 @@ Finish(int signum) /* * Delete addresses for interface */ - bzero(&ifra.ifra_addr, sizeof(ifra.ifra_addr)); - bzero(&ifra.ifra_broadaddr, sizeof(ifra.ifra_addr)); - bzero(&ifra.ifra_mask, sizeof(ifra.ifra_addr)); - if (ioctl(s, SIOCDIFADDR, &ifra) < 0) { + bzero(&ifrq.ifr_addr, sizeof(ifrq.ifr_addr)); + if (ioctl(s, SIOCDIFADDR, &ifrq) < 0) { syslog(LOG_ERR,"can't delete interface's addresses - %m"); } closing_fds: From nobody Mon Jul 22 10:07:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSGCx18Dsz5QMXV; Mon, 22 Jul 2024 10:07: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSGCx0gPpz4fpC; Mon, 22 Jul 2024 10:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721642829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ww5NmCW+ge6EvEmoo7LH7BS+2wm1TZlJX3bTsbZ7IB8=; b=okIBwJ0hZsrr0SPnQiL8W0yIZcxiRVxqu++b5yzHRSO9lB2nXsAbbMrYufH+yYR85U93SZ 4sXscTSyvyE9lykIBph8a0nFw2W5QD6groRqiLU0YjEBkbYmd9rHG97oZaY7OS2S17Y9CM rsMVvZhjdHBv2MzYDF/tlExTfVBhpMNGTun4EFsk46IN6iCJ7N7h36YpW/jGNcszPRAv7D JQdimJE41GkokkH8O2kZRAE1Ij7sP/ugXAfVnH+MrsWZB8ChnE7pVi0Fn5dninjGteFpgl ipJIvG4PTH17+IfpF1Jh4zP/AvFv1mHD7Rj7V2ND6ezHjfybTTWZNIt8XVYM0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721642829; a=rsa-sha256; cv=none; b=jsjUV4eV01Z7RhyvcRpiVCk5f95qfHdRh0Cbn4oi+GVpKCIMmcv8MYQQO8f9J8L2g44tA6 +Tc4RQot2OF27LQcIyiwkxsvCcdPYjO5INWGhB2mL5tAl8dEvj2URKExszcEmyOgPbzo6o rSEWEBdyfjXO9v2qHM5rDScvfjCr04QkBlXEr5qC2keJwdxf5zJzLTsnH04ElhaRfiSUqZ cDqCVtfcLVpdL96tmD+5364511KIs0WNwFuAZXGfqz51PhmhVHasXali3sKwQvCPtyzNs3 YjMgo6nGOdF0aILLHsu/m5ctEZsVB1/fbmbMmP3xWy3hAK64DjqqOpWHL80GGA== 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=1721642829; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ww5NmCW+ge6EvEmoo7LH7BS+2wm1TZlJX3bTsbZ7IB8=; b=OdpV4Jen7ww2TmW3KMOfDUgaft2HrGc/btEQ/euACUnZrpPlZgTeeEOpk8hLXcTyVzNz3H TyoJCNF770jGkdPQX1VRWC3BMTBGLYbd4NECEF7cZmfaGUXEJTjR6CJb6MipJhnuUfiYDR UcLpdWq4LNawgtSyeeMT+xn4c9yZ6fFQi3D07XttdPibo2lRzE+s5HDOs9B40pxp05/5iY xMuSqJSRbTNmPt69/nBeBwhmnDt2XPFJtWWJ1Kn8hH+hGOza7jbkwemBz4obxG3qMr1PCD xNBLL/k/4mW/bScV75zjzawJbkiT//6iaj9ReR5EqlfG1JzyboWVFnF8EWGSpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSGCx0CQmzg6r; Mon, 22 Jul 2024 10:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MA78UZ043111; Mon, 22 Jul 2024 10:07:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MA7884043108; Mon, 22 Jul 2024 10:07:08 GMT (envelope-from git) Date: Mon, 22 Jul 2024 10:07:08 GMT Message-Id: <202407221007.46MA7884043108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konrad Witaszczyk Subject: git: 2ab551500190 - main - usr.sbin/ppp: correct SIOCDIFADDR{,_IN6} calls to use {,in6_}ifreq List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: def X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2ab5515001905576d4f9642691ae99d3ef672fc7 Auto-Submitted: auto-generated The branch main has been updated by def: URL: https://cgit.FreeBSD.org/src/commit/?id=2ab5515001905576d4f9642691ae99d3ef672fc7 commit 2ab5515001905576d4f9642691ae99d3ef672fc7 Author: Konrad Witaszczyk AuthorDate: 2024-06-28 10:29:04 +0000 Commit: Konrad Witaszczyk CommitDate: 2024-07-22 10:03:37 +0000 usr.sbin/ppp: correct SIOCDIFADDR{,_IN6} calls to use {,in6_}ifreq The SIOCDIFADDR{,_IN6} ioctls take an ifreq structure object, not an ifaliasreq structure object, as their argument. Reviewed by: brooks, jhb, oshogbo Approved by: oshogbo (mentor) Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D46018 --- usr.sbin/ppp/iface.c | 50 ++++++++++++++------------------------------------ 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/usr.sbin/ppp/iface.c b/usr.sbin/ppp/iface.c index ad9f81b062f7..160370e6de44 100644 --- a/usr.sbin/ppp/iface.c +++ b/usr.sbin/ppp/iface.c @@ -201,64 +201,42 @@ iface_Create(const char *name) static int iface_addr_Zap(const char *name, struct iface_addr *addr, int s) { - struct ifaliasreq ifra; + struct ifreq ifr; #ifndef NOINET6 - struct in6_aliasreq ifra6; + struct in6_ifreq ifr6; #endif - struct sockaddr_in *me4, *msk4, *peer4; - struct sockaddr_storage ssme, sspeer, ssmsk; + struct sockaddr_in *me4; + struct sockaddr_storage ssme; int res, saved_errno; - ncprange_getsa(&addr->ifa, &ssme, &ssmsk); - ncpaddr_getsa(&addr->peer, &sspeer); + ncprange_getsa(&addr->ifa, &ssme, NULL); res = 0; switch (ncprange_family(&addr->ifa)) { case AF_INET: - memset(&ifra, '\0', sizeof ifra); - strncpy(ifra.ifra_name, name, sizeof ifra.ifra_name - 1); - - me4 = (struct sockaddr_in *)&ifra.ifra_addr; + memset(&ifr, '\0', sizeof ifr); + strncpy(ifr.ifr_name, name, sizeof ifr.ifr_name - 1); + me4 = (struct sockaddr_in *)&ifr.ifr_addr; memcpy(me4, &ssme, sizeof *me4); - msk4 = (struct sockaddr_in *)&ifra.ifra_mask; - memcpy(msk4, &ssmsk, sizeof *msk4); - - peer4 = (struct sockaddr_in *)&ifra.ifra_broadaddr; - if (ncpaddr_family(&addr->peer) == AF_UNSPEC) { - peer4->sin_family = AF_INET; - peer4->sin_len = sizeof(*peer4); - peer4->sin_addr.s_addr = INADDR_NONE; - } else - memcpy(peer4, &sspeer, sizeof *peer4); - - res = ID0ioctl(s, SIOCDIFADDR, &ifra); + res = ID0ioctl(s, SIOCDIFADDR, &ifr); saved_errno = errno; if (log_IsKept(LogDEBUG)) { char buf[NCP_ASCIIBUFFERSIZE]; snprintf(buf, sizeof buf, "%s", ncprange_ntoa(&addr->ifa)); log_Printf(LogWARN, "%s: DIFADDR %s -> %s returns %d\n", - ifra.ifra_name, buf, ncpaddr_ntoa(&addr->peer), res); + ifr.ifr_name, buf, ncpaddr_ntoa(&addr->peer), res); } break; #ifndef NOINET6 case AF_INET6: - memset(&ifra6, '\0', sizeof ifra6); - strncpy(ifra6.ifra_name, name, sizeof ifra6.ifra_name - 1); - - memcpy(&ifra6.ifra_addr, &ssme, sizeof ifra6.ifra_addr); - memcpy(&ifra6.ifra_prefixmask, &ssmsk, sizeof ifra6.ifra_prefixmask); - ifra6.ifra_prefixmask.sin6_family = AF_UNSPEC; - if (ncpaddr_family(&addr->peer) == AF_UNSPEC) - ifra6.ifra_dstaddr.sin6_family = AF_UNSPEC; - else - memcpy(&ifra6.ifra_dstaddr, &sspeer, sizeof ifra6.ifra_dstaddr); - ifra6.ifra_lifetime.ia6t_vltime = ND6_INFINITE_LIFETIME; - ifra6.ifra_lifetime.ia6t_pltime = ND6_INFINITE_LIFETIME; + memset(&ifr6, '\0', sizeof ifr6); + strncpy(ifr6.ifr_name, name, sizeof ifr6.ifr_name - 1); + memcpy(&ifr6.ifr_addr, &ssme, sizeof ifr6.ifr_addr); - res = ID0ioctl(s, SIOCDIFADDR_IN6, &ifra6); + res = ID0ioctl(s, SIOCDIFADDR_IN6, &ifr6); saved_errno = errno; break; #endif From nobody Mon Jul 22 14:00:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSMPg42ffz5Qyhw; Mon, 22 Jul 2024 14:00:55 +0000 (UTC) (envelope-from jhb@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSMPg3Qcvz51wJ; Mon, 22 Jul 2024 14:00:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721656855; 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=orPlCVsO3nrvz16tu1PXpxsfoskUF6iAFfwwyfWqav0=; b=Pzl4OApQrVXZ5Hmq2oDuVYZIn/qvOuHbgYB0Ee9CrE0KTLAqaJPc1mONRJMk6TJ+LRfho5 Am0tuTAtwy154gEE5tN13K6ZTvaFd4S72oncEzsDdN5dQtACU4k4WLYhA3I0gCGHFNxo89 U6Rk4TzsIJeLDDpTBhilP0YdEH/PYjifkdqPM6gS0uBDWopOOK2JkcbXU4HpHxEiirW0T0 p81yVDdWOgYenTPaLFapfAIHrtb5xT8JLFCRx8s8p4EAalDO4fqNlU7hhBP/uC2+hb93uO gsDYQ4oD59VhPQHtI0tGr5VYtBLRPg4NM/uRZIquQuHnGkrJDnzYRUYvIlzP/g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721656855; a=rsa-sha256; cv=none; b=Mehkz+xjmkRw8RH9DLUfx54Q/i4wGSmzBin2xrfJ8AeCpFdhkXLu9oIGNQ9rlUt/eyezVc icgJjzTfU34q0t00SBR1HhAazJqRfVHa1TmrZ4i6rCEq3O0srQuMEJTE8NZjyhIRZRBhEQ 4JjKrxppPSE1dVxu4J5k8Jxz7reuAqPnLUuRvDRR99+5xKCuOevWXjz3z6GJCVr0GqCG2I XB7ufSs59lIoA4RtlzryIYeXsbYj9jgcTYk0loJs5y0QgjKaKO/c4FMhr27B/i5pNMtEgF sjDn4Pd3OHbQYaqq1Fsr+WIhU6k5rVkO/pDL2a355qoR7jkrrwCkLs6R1t1BGQ== 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=1721656855; 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=orPlCVsO3nrvz16tu1PXpxsfoskUF6iAFfwwyfWqav0=; b=g7D7EE6f4ZeB2IfC0Dxjm0WjeKjy8TYDfNrVZg/wIhpKmKw/vqpV7h0aZOIWHCr6jtcf6x tMhXtIGEVvTRPLqiClu+Dl7B4hziqG+BFCed00E3ARtNzpyzjPBHcRXr7nsRQOVV00Bt9Z CBkVn7V2u8pssvJUoeDW3rzMkca6TQt8V61jOzBwmNs/hTnWTRKY+hXyXN9SsP5ehXt4un ITegsWAfP2j3AceG9KQ1bgb7gl5sH2CmJ6mXIwCQsLcFkF8eU+lssfZYDKDLn6KsGQNdZe 3AEYwoHqOEbsIdKAqpnOfFO0/BJE0ps2HFNBZwzHHRi+5xozuPz1brx9tB1qDg== Received: from [IPV6:2601:5c0:4200:b830:d405:43d2:f72c:28bf] (unknown [IPv6:2601:5c0:4200:b830:d405:43d2:f72c:28bf]) (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 4WSMPg1KDjzbRy; Mon, 22 Jul 2024 14:00:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Mon, 22 Jul 2024 10:00:54 -0400 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 6677621bad00 - main - cdefs.h: Fallback to printf0 for __printf0like Content-Language: en-US To: Warner Losh Cc: Warner Losh , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202407061944.466JiiQ3026410@gitrepo.freebsd.org> From: John Baldwin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 7/19/24 17:20, Warner Losh wrote: > On Wed, Jul 10, 2024 at 12:19 PM John Baldwin wrote: > >> On 7/6/24 17:56, John Baldwin wrote: >>> On 7/6/24 15:44, Warner Losh wrote: >>>> The branch main has been updated by imp: >>>> >>>> URL: >> https://cgit.FreeBSD.org/src/commit/?id=6677621bad00191dfec1b0a20ae1618b92745d9b >>>> >>>> commit 6677621bad00191dfec1b0a20ae1618b92745d9b >>>> Author: Warner Losh >>>> AuthorDate: 2024-07-06 19:42:37 +0000 >>>> Commit: Warner Losh >>>> CommitDate: 2024-07-06 19:45:03 +0000 >>>> >>>> cdefs.h: Fallback to printf0 for __printf0like >>>> >>>> For some reason, my tests were fine with this like it was, but CI >> for >>>> gcc12 and gcc13 is complaining. Revert to the old form until that >> can be >>>> worked out why the mismatch. >>>> >>>> Fixes: 0b82dac337e7 >>>> Sponsored by: Netflix >>>> --- >>>> sys/sys/cdefs.h | 7 +++++-- >>>> 1 file changed, 5 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h >>>> index 6b861b1903f6..a56839d57c7a 100644 >>>> --- a/sys/sys/cdefs.h >>>> +++ b/sys/sys/cdefs.h >>>> @@ -356,9 +356,12 @@ >>>> * Clang has always had printf and printf0 as aliases. gcc 11.0 now >> follows >>>> * clang. So now this is an alias for __printflike, or nothing. In >> the future >>>> * _Nullable or _Nonnull will replace this. >>>> + * XXX Except that doesn't work, so for now revert to printf0 for >> clang and >>>> + * the FreeBSD gcc until I can work this out. >>>> */ >>>> -#if defined(__clang__) || __GNUC_PREREQ__(11, 0) >>>> -#define __printf0like(fmtarg, firstvararg) __printflike(fmtarg, >> firstvararg) >>>> +#if defined(__clang__) || (defined(__GNUC__) && defined >> (__FreeBSD_cc_version)) >>>> +#define __printf0like(fmtarg, firstvararg) \ >>>> + __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) >>>> #else >>>> #define __printf0like(fmtarg, firstvararg) >>>> #endif >>> >>> It's because my patch for devel/freebsd-gcc{12,13} is kind of wrong. I >> had a mismerge >>> when updating the printf0 patch from gcc9 to gcc12 that ended up >> re-adding the >>> warn on NULL. I need to update the ports to remove that part of the >> patch. I will >>> probably leave printf0 working for now in the ports just as an alias for >> regular >>> printf to give us some transition time. >> >> FYI, I have merged this fix to the ports, but not sure how we want to >> manage doing >> the patch to cdefs.h. I kind of think we should apply the change to >> cdefs.h in >> main in another week or so. I'm less certain of what to do for stable >> branches. >> > > I hadn't planned on merging this to stable branches. Is that your concern? Yes, just if we wanted to merge the printf0 change in sys/cdefs.h to stable branches. I think it's fine to fix cdefs.h in main now. -- John Baldwin From nobody Mon Jul 22 14:22:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSMtk4clRz5R1lr; Mon, 22 Jul 2024 14:22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSMtk3mDyz553n; Mon, 22 Jul 2024 14:22:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721658158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/3fVgOBOrpLk9FoMqH8Xt8gJpv0l8DTx7v+g+14cwEY=; b=NMH0XQusK++s2qUwTuVt8ch/r/pcLdK4ER3Jt6dGID8iTvX/mOvUgTTDDGb8loKt9n3u2J licPZLOytff0V0UvvtqwHFKMQsnQ3z+RZcAZ2eTdzMYVcIjRac0PAGIhXFD0NZ/oorIheT axKacjaTKjdCNC9UkARQ+xp+tt9M4bBpSLkg496tGogaHAwqJtMlNEPE16ei1tiC/3qnyN 9+EAem548fz7NdqnPL4KFxFqF/unHSdmYRYIN0uuKV/0L+zOl99NJAvxfyYdG4gb8Oqtzq txuvkLMtHmkZyjQRWayPATXPdWwxin5pMvrM8BkrJ9sP/ZIZdK5zSu/0GkAyYw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721658158; a=rsa-sha256; cv=none; b=QASh01Cgykwucq9oVsVQaQdQ/89yJkZWkCXDcMIA8eeO0gl7gp461VV2OgaXABNVe0BzKx gCh/ygoKqx3JjehhfXoyELYgi99BwuWn3S5qe5rySfrv+uzN0gfJ7+PY3Vt9X+NZPcgGGh nq6n3MKt2OIK8hhcnwq2wTC3rZ4QsK6nEtOzCVp7HjM4Q8d6zdSSyz0KtjcWYYWp+qD65I JkhA31vD8rg2hUaHZi/VI13k8HKihCHSgb7LriCRJ58/eh+/CjnZQApg3JNX02JfO78htk KOx6rK8+DhdO6ittQLfnTjSxGGEMy2uZ83PBgCuhEEKhIY1zYsVs0TWw4/zX7Q== 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=1721658158; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/3fVgOBOrpLk9FoMqH8Xt8gJpv0l8DTx7v+g+14cwEY=; b=q28FUSuverIyvlnYzTDgygLsOwXi5n45G9YtV+TA6d4Wg8+A6t+7OmNbKSWThbtrDiFb2H ddh0g0xUXkv/OzanXsKmkrmaU9pSKZlFUthJGCPNkoqI68BVYpb6FCSLGVnDQwT7fKfK0U rtQ9XbHu+9A4Pi+KeM2EaLCZRSkItRcwmlfDKSfzOo0ecA7ER8mpddhRy1JLyWPlLQWPMH MYzOZqSmv2ar3rRj/M0us8eVAbokk780deyki7BqZByLKYP5nZ3TjvAuMgPQzpK3ZgEWBW OusFb2YsNoPQTjW09zU797Z7zL36I0Lq+cTyCuPu+HHWxVSupCYWLqxRFhkdNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSMtk3LMzznqv; Mon, 22 Jul 2024 14:22:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MEMcAv081948; Mon, 22 Jul 2024 14:22:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MEMcFf081945; Mon, 22 Jul 2024 14:22:38 GMT (envelope-from git) Date: Mon, 22 Jul 2024 14:22:38 GMT Message-Id: <202407221422.46MEMcFf081945@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konrad Witaszczyk Subject: git: bc06c51419b3 - main - netinet: correct SIOCDIFADDR{,_IN6} calls to use {,in6_}ifreq List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: def X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc06c51419b338c3d6efa6543308f9905c12c79b Auto-Submitted: auto-generated The branch main has been updated by def: URL: https://cgit.FreeBSD.org/src/commit/?id=bc06c51419b338c3d6efa6543308f9905c12c79b commit bc06c51419b338c3d6efa6543308f9905c12c79b Author: Konrad Witaszczyk AuthorDate: 2024-06-27 12:54:14 +0000 Commit: Konrad Witaszczyk CommitDate: 2024-07-22 14:17:21 +0000 netinet: correct SIOCDIFADDR{,_IN6} calls to use {,in6_}ifreq The SIOCDIFADDR{,_IN6} ioctls take an ifreq structure object, not an ifaliasreq/in_aliasreq/in6_aliasreq structure object, as their argument. As opposed to ifaliasreq/in_aliasreq/in6_aliasreq used by SIOCAIFADDR{,_IN6}, the ifreq/in6_ifreq structures used by the SIOCDIFADDR{,_IN6} ioctls do not include a separate field for a broadcast address and other values required to add an address to a network interface with SIOCAIFADDR{,_IN6}. Whilst this issue is not specific to CHERI-extended architectures, it was first observed on CheriBSD running on Arm Morello. For example, incorrect calls using the in6_aliasreq object result in CHERI capability violations. A pointer to the ifra_addr field in in6_aliasreq cast to the ifru_addr union member of in6_ifreq results in bounds being set to the union's larger size. Such bounds exceed the bounds of of in6_aliasreq object and the bounds-setting instruction clears a tag of the object's capability. Reviewed by: brooks, kp, oshogbo Accepted by: oshogbo (mentor) Reported by: CHERI Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D46016 --- sys/net/if.c | 6 ++---- sys/netinet/in.c | 6 ++---- sys/netlink/route/iface.c | 6 +++--- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 604a93aa7cba..c71643a41bc5 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1037,12 +1037,10 @@ if_purgeaddrs(struct ifnet *ifp) #ifdef INET /* XXX: Ugly!! ad hoc just for INET */ if (ifa->ifa_addr->sa_family == AF_INET) { - struct ifaliasreq ifr; + struct ifreq ifr; bzero(&ifr, sizeof(ifr)); - ifr.ifra_addr = *ifa->ifa_addr; - if (ifa->ifa_dstaddr) - ifr.ifra_broadaddr = *ifa->ifa_dstaddr; + ifr.ifr_addr = *ifa->ifa_addr; if (in_control(NULL, SIOCDIFADDR, (caddr_t)&ifr, ifp, NULL) == 0) continue; diff --git a/sys/netinet/in.c b/sys/netinet/in.c index cc2f37863ea1..c78f0f5758f7 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -1222,7 +1222,7 @@ in_ifscrub_all(void) { struct ifnet *ifp; struct ifaddr *ifa, *nifa; - struct ifaliasreq ifr; + struct ifreq ifr; IFNET_RLOCK(); CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) { @@ -1237,9 +1237,7 @@ in_ifscrub_all(void) * cleanly remove addresses and everything attached. */ bzero(&ifr, sizeof(ifr)); - ifr.ifra_addr = *ifa->ifa_addr; - if (ifa->ifa_dstaddr) - ifr.ifra_broadaddr = *ifa->ifa_dstaddr; + ifr.ifr_addr = *ifa->ifa_addr; (void)in_control(NULL, SIOCDIFADDR, (caddr_t)&ifr, ifp, NULL); } diff --git a/sys/netlink/route/iface.c b/sys/netlink/route/iface.c index 81db54ab12d4..7d33c89a396a 100644 --- a/sys/netlink/route/iface.c +++ b/sys/netlink/route/iface.c @@ -1194,17 +1194,17 @@ static int handle_deladdr_inet(struct nlmsghdr *hdr, struct nl_parsed_ifa *attrs, if_t ifp, struct nlpcb *nlp, struct nl_pstate *npt) { - struct sockaddr_in *addr = (struct sockaddr_in *)attrs->ifa_local; + struct sockaddr *addr = attrs->ifa_local; if (addr == NULL) - addr = (struct sockaddr_in *)attrs->ifa_address; + addr = attrs->ifa_address; if (addr == NULL) { nlmsg_report_err_msg(npt, "empty IFA_ADDRESS/IFA_LOCAL"); return (EINVAL); } - struct ifreq req = { .ifr_addr = *(struct sockaddr *)addr }; + struct ifreq req = { .ifr_addr = *addr }; return (in_control_ioctl(SIOCDIFADDR, &req, ifp, nlp_get_cred(nlp))); } From nobody Mon Jul 22 14:59:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSNjk2YF7z5R5R0; Mon, 22 Jul 2024 14:59: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSNjk21scz57c3; Mon, 22 Jul 2024 14:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721660394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zRBUH4xLe6jcgOsCsXrg6IpFaK+TBMGyGD3fdsZAHLQ=; b=u80iQ7IoRkSFnUlzNi1irNMXnkOkJGWzWsGarZ8kUcRK1sPkLdVM1BtCclqGbJ7e6yrPge 1I7GaB3CW5/KYJ+Ed2ppn+kzjNERTCrlwsQtD0xg6q/KH+Cq6dA6PTkk0lqNnAf95dYDfj dHb1HqQ1Y6N9EOwImr+sduek3D1fPadlwu7KwrUqNpw5iVaat3249p6eF/tZDR7w5dGsH5 cSs0wX7pkvuSTl1NX+OCEWRI8QhPxkBPJY1q5TbBrvRRBSprv6e+0osjGe3q5yBz1em9/5 jFVEi8IlweM6wnSCGf213hIWJWyTV/mcxcnq15JPeiHT0b4ero3VsJKps8scXQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721660394; a=rsa-sha256; cv=none; b=bN2+6SQ+zyKGun1xJBehjwPkvz4m382WGBRdRRXdiyi4+VOReIcArTW2x4/WM2oAvcwfwp 0bfwuYTl2rAOtqgYTXYVM1Jl5CheOxjY7b1i9nsj6A8wTfPTk5V3cNbc8D8KaG5RMAfabV ae8mpo+zldwMxffaS9Nb21pAu5U/V44OmLa8XfGf2tc93PMGIbcKa+OeW0EPws7qPxne2f yUHOMu8OUBK/imEFPjYcRVi10gdfNlOGnytjPH2vkF29cF1v0nqBwIqM4OZERQkilep7Av 4d9GWDBlHM/54h2UpvDkWQtF6fvZnyyOb5YyoI2NS6o5yVPzsbeATz8QFCdoGQ== 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=1721660394; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zRBUH4xLe6jcgOsCsXrg6IpFaK+TBMGyGD3fdsZAHLQ=; b=yhTJtpo26qO66hAKgktOY1Z1ILfi5y00IxfzXtX54s1E4d0bxGCerbrUwi7VKGNCIJR1Wz o5VHJg9IEuRrOaC12xeIV1qpMCXJRqLcfT7rTHg+qNBVoC1pQw8gw3ECkTBkh6n7jGJP0f FXXZT3+a3DZf5ah9xbp70E+ysqO6DQDAjxH8UDrw0H/bHsTJfYgYalLBKOcLp/UGdM4L3T oyEeVsbQyPQJcNNBht2KYNYshN+9zBS4YltI2KkuN7Zjgi9g12vPTtz0vmHycP5sefzfYT dCz5s1xc8KcaqvhlG5q5JPQxdye8z43OKk9OXuOPQHeaM97wyojmwxlCGcRv0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSNjk1WXLzpTD; Mon, 22 Jul 2024 14:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MExsig033061; Mon, 22 Jul 2024 14:59:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MExskr033058; Mon, 22 Jul 2024 14:59:54 GMT (envelope-from git) Date: Mon, 22 Jul 2024 14:59:54 GMT Message-Id: <202407221459.46MExskr033058@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konrad Witaszczyk Subject: git: c74a4cea0dc9 - main - usr.sbin/uhsoctl: correct SIOCDIFADDR calls to use ifreq List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: def X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c74a4cea0dc9dddf996179b1586fb6e9fbf6b702 Auto-Submitted: auto-generated The branch main has been updated by def: URL: https://cgit.FreeBSD.org/src/commit/?id=c74a4cea0dc9dddf996179b1586fb6e9fbf6b702 commit c74a4cea0dc9dddf996179b1586fb6e9fbf6b702 Author: Konrad Witaszczyk AuthorDate: 2024-06-28 10:29:15 +0000 Commit: Konrad Witaszczyk CommitDate: 2024-07-22 14:58:19 +0000 usr.sbin/uhsoctl: correct SIOCDIFADDR calls to use ifreq The SIOCDIFADDR ioctl takes an ifreq structure object, not an ifaliasreq structure object, as its argument. The ifreq structure does not include a separate mask field and the SIOCDIFADDR ioctl handler does not require a network mask as opposed to the ifaliasreq structure and the SIOCAIFADDR ioctl. Given that SIOCAIFADDR and SIOCDIFADDR ioctls significantly differ and use different structures for ioctl arguments, remove ifaddr_add() and move its logic handling these ioctls to ifaddr_add()'s callers. Reviewed by: brooks, jhb, oshogbo Accepted by: oshogbo (mentor) Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D46019 --- usr.sbin/uhsoctl/uhsoctl.c | 68 ++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/usr.sbin/uhsoctl/uhsoctl.c b/usr.sbin/uhsoctl/uhsoctl.c index 992858eb45ca..b7aa1a45c667 100644 --- a/usr.sbin/uhsoctl/uhsoctl.c +++ b/usr.sbin/uhsoctl/uhsoctl.c @@ -356,27 +356,6 @@ logger(int pri, const char *fmt, ...) va_end(ap); } -/* Add/remove IP address from an interface */ -static int -ifaddr_ad(unsigned long d, const char *ifnam, struct sockaddr *sa, struct sockaddr *mask) -{ - struct ifaliasreq req; - int fd, error; - - fd = socket(AF_INET, SOCK_DGRAM, 0); - if (fd < 0) - return (-1); - - memset(&req, 0, sizeof(struct ifaliasreq)); - strlcpy(req.ifra_name, ifnam, sizeof(req.ifra_name)); - memcpy(&req.ifra_addr, sa, sa->sa_len); - memcpy(&req.ifra_mask, mask, mask->sa_len); - - error = ioctl(fd, d, (char *)&req); - close(fd); - return (error); -} - #define if_ifup(ifnam) if_setflags(ifnam, IFF_UP) #define if_ifdown(ifnam) if_setflags(ifnam, -IFF_UP) @@ -418,22 +397,45 @@ if_setflags(const char *ifnam, int flags) static int ifaddr_add(const char *ifnam, struct sockaddr *sa, struct sockaddr *mask) { - int error; + struct ifaliasreq ifra; + int error, fd; + + memset(&ifra, 0, sizeof(ifra)); + strlcpy(ifra.ifra_name, ifnam, sizeof(ifra.ifra_name)); + memcpy(&ifra.ifra_addr, sa, sa->sa_len); + memcpy(&ifra.ifra_mask, mask, mask->sa_len); + + fd = socket(AF_INET, SOCK_DGRAM, 0); + if (fd < 0) + return (-1); - error = ifaddr_ad(SIOCAIFADDR, ifnam, sa, mask); + error = ioctl(fd, SIOCAIFADDR, (caddr_t)&ifra); if (error != 0) warn("ioctl SIOCAIFADDR"); + + close(fd); return (error); } static int -ifaddr_del(const char *ifnam, struct sockaddr *sa, struct sockaddr *mask) +ifaddr_del(const char *ifnam, struct sockaddr *sa) { - int error; + struct ifreq ifr; + int error, fd; + + memset(&ifr, 0, sizeof(ifr)); + strlcpy(ifr.ifr_name, ifnam, sizeof(ifr.ifr_name)); + memcpy(&ifr.ifr_addr, sa, sa->sa_len); - error = ifaddr_ad(SIOCDIFADDR, ifnam, sa, mask); + fd = socket(AF_INET, SOCK_DGRAM, 0); + if (fd < 0) + return (-1); + + error = ioctl(fd, SIOCDIFADDR, (caddr_t)&ifr); if (error != 0) warn("ioctl SIOCDIFADDR"); + + close(fd); return (error); } @@ -897,8 +899,7 @@ at_async_owandata(void *arg, const char *resp) if (ctx->flags & IPASSIGNED) { memcpy(&sin.sin_addr.s_addr, &ctx->ip.s_addr, sizeof(sin.sin_addr.s_addr)); - ifaddr_del(ctx->ifnam, (struct sockaddr *)&sin, - (struct sockaddr *)&mask); + ifaddr_del(ctx->ifnam, (struct sockaddr *)&sin); } inet_pton(AF_INET, ip, &ctx->ip.s_addr); memcpy(&sin.sin_addr.s_addr, &ctx->ip.s_addr, @@ -1258,7 +1259,7 @@ do_connect(struct ctx *ctx, const char *tty) static void do_disconnect(struct ctx *ctx) { - struct sockaddr_in sin, mask; + struct sockaddr_in sin; /* Disconnect */ at_cmd(ctx, NULL, NULL, NULL, "AT_OWANCALL=%d,0,0\r\n", @@ -1267,14 +1268,11 @@ do_disconnect(struct ctx *ctx) /* Remove ip-address from interface */ if (ctx->flags & IPASSIGNED) { - sin.sin_len = mask.sin_len = sizeof(struct sockaddr_in); - memset(&mask.sin_addr.s_addr, 0xff, - sizeof(mask.sin_addr.s_addr)); - sin.sin_family = mask.sin_family = AF_INET; + sin.sin_len = sizeof(struct sockaddr_in); + sin.sin_family = AF_INET; memcpy(&sin.sin_addr.s_addr, &ctx->ip.s_addr, sizeof(sin.sin_addr.s_addr)); - ifaddr_del(ctx->ifnam, (struct sockaddr *)&sin, - (struct sockaddr *)&mask); + ifaddr_del(ctx->ifnam, (struct sockaddr *)&sin); if_ifdown(ctx->ifnam); ctx->flags &= ~IPASSIGNED; From nobody Mon Jul 22 17:15:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSRkl0t5nz5RJQ1; Mon, 22 Jul 2024 17:15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSRkl0PBtz4D7T; Mon, 22 Jul 2024 17:15:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721668559; h=from:from:reply-to:subject:subject: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/rToIdaIatcYBrjZN4WpLCWlsP9X7M38MSD6W/0WYM=; b=vwvc+M134qdPEqKSunpLLMYfURiwBWLsb1n6GQoXZCpY9bZkWANKsAuSjSqJxWDOOqa8IK u/8IEzgRxy8Gy7+kMvbKbUcTMeYtE/Y9j4CWkxXjVnMFfYP+pwKwI6cr/wok5GRiZvN5+J mQ7KYyfMLxsciRR49K7E3kXE5cLHRdXHf61G5H5zxH99Z0kq4GpvBGsa/nj5WsvAKwad+2 eEVdIqNZvtTmrQzPbBMp76Ha1qjul7JyL/Y+JKN395CGHNx+UBF9sKappRbY0pVcQwpCxR 4MKmQu+o0BmvTwLgNeXhka8B8JtkAmHH4u4mPRs86VIeVVmZ6630VEA7bPhhbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721668559; a=rsa-sha256; cv=none; b=nTWYzvmjtZhil20eka56TTGw6rgQ67dC5MOOeQxj1eOKNQQ3S2jQOBa6A9Zxu7ac+5NCu0 PqK4ApREUBvazRmvJb9Tb3aM2VXXMXxsjdYXCfYrlhdaXRi1d9JG1yW6keW+bFg0/uIbx/ u9rrDIWxqALe8xIFgCW0SMSNNGB2KxZveRS97c3Fsk1TBQMK/cS/ISJZs/ihqHr3jeDzkZ dALcijdZq5ASHUPXrJRmlAdDg6U3T0OcxBwG26zqSo0zYVEW88CzJALxS9pGYIgbR38ZK9 GgPHXflYlGhS6grPqWsIqlqsoNgxesfDe6qP0e8SpEwMlN/k8oR8euqh8AjxSA== 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=1721668559; h=from:from:reply-to:subject:subject: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/rToIdaIatcYBrjZN4WpLCWlsP9X7M38MSD6W/0WYM=; b=Ql3tNtehmDxcN71hWA0F6VlnTucvs6dAJ4FKaZqYfUqF8xgVfUhQr8AZxIsd6rr9mtvhKt NKw+NScXo8ES8WSL864IlyQRlco2G1GQrm2P7yOJgdV5Ru21XsMWTozmWLWvxnpQvCQRjd uL/Bp/tTTkOJ2ltR5kMqiWc4L22lj6IZwdxyQU0vWh1Z0ha5qOIXQAJlSpJJBzCrkB7CWl S1+0YDKpQgaUggeCSA9yAqhIfBM+a6T7Ek/u4O8fazXtcr+yxQKpc5sFgBOq5sxIciEYxK kz5iY7yi3ChHaiwgjTIrJ8IWvGyp6VbDe8V0MQBlrsCEKJ23uMRxTCx90BkLVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSRkl00qqztV5; Mon, 22 Jul 2024 17:15:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MHFwH8071699; Mon, 22 Jul 2024 17:15:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MHFw0e071696; Mon, 22 Jul 2024 17:15:58 GMT (envelope-from git) Date: Mon, 22 Jul 2024 17:15:58 GMT Message-Id: <202407221715.46MHFw0e071696@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 37b3e6a660f5 - main - tcp: use TCP_MAXWIN instead of 65535 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 37b3e6a660f551ceda412e2115748f3b97b2e615 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=37b3e6a660f551ceda412e2115748f3b97b2e615 commit 37b3e6a660f551ceda412e2115748f3b97b2e615 Author: Michael Tuexen AuthorDate: 2024-07-22 06:52:12 +0000 Commit: Michael Tuexen CommitDate: 2024-07-22 06:52:12 +0000 tcp: use TCP_MAXWIN instead of 65535 This is suggested by cc@. No functional change. Sponsored by: Netflix, Inc. --- sys/netinet/tcp_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index ef24f20f784a..ad17a9fdfb93 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2443,7 +2443,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, /* * Ack processing. */ - if (SEQ_GEQ(tp->snd_una, tp->iss + (65535 << tp->snd_scale))) { + if (SEQ_GEQ(tp->snd_una, tp->iss + (TCP_MAXWIN << tp->snd_scale))) { /* Checking SEG.ACK against ISS is definitely redundant. */ tp->t_flags2 |= TF2_NO_ISS_CHECK; } From nobody Mon Jul 22 17:23:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSRty3J5xz5RK51; Mon, 22 Jul 2024 17: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSRty2pYLz4F49; Mon, 22 Jul 2024 17: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=1721668986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xxvVb9zs//lCyx0cxgl/Ew0Tv4Mzn3OSUSBmHpEtDWk=; b=t9GqO7UplEM76OO+sRnPkwOLhx53+YoI8FpNhfc/UXYvfDc0IlAbnc8q7N5M4YJsN76NrC AUeZkiwd+Cdr/CAdScvtzl86oE4rqsTIwQzA00fm+fGmXQJFLgWNh5Ew8ogZZK3xU4wJfE YV5MSvTkoAUBTeMiSRRvFp8y4+4CrbEiS5Sv5SB5XZ0m71cFx+fQMcu7iGc2mXwqpsHb8W mBXUn4vmrR6H+qyJc+dK5pJvqd886+iV0ocPh1z8VOedITXPW9I5V4by5U3iNrTIgGAYkG Vu9V41gM/a2tZgz0NpjodylN0SpmLJ6ziJvPj/ZR6KvAXh5JapJXHNgGmgUQzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721668986; a=rsa-sha256; cv=none; b=FO2rPyqbAco0yEoD/WY+wOzZP5/1aI3ZWzbtC4z2mYWDNfTP4lUNxzz6rin6eiYBNf0XTS FBdFRKUskRcBF6ZzUjM8ltxYWYmrdgI4UJIc8+ERa5BwPtexZJWe6/rx8lK8TYJcswXXvA cdsjVY6nw/NJx0IJ6I8yR5xpWWjeJcYCkdzt3zzsvLFyVPtL0mwYnKfWr9VImAGvQH7sqT /vwd52CTAEGC4/fkMFUTNJ6XgpIul0Bsmvz1TbyUX5K7/jp9g5E2YcGzn92w6hUZLLbJ4Z FncYDoPg5ROs49xxlY/y0FcbZBj1cYADt3d2J0kxuvGcTNPpy2+LKAGYz0KbvQ== 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=1721668986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xxvVb9zs//lCyx0cxgl/Ew0Tv4Mzn3OSUSBmHpEtDWk=; b=dMyOXL/GxeGFhKFbeXGgYtZ1P6iwu0E9sMB9IgFnvahXQIL2INuZTS4EjanY4m1db43XVM WhBPRtG3Btcr0DlMNv9JaBnstJEFQ1CuLbCfxjGqRzaJ6RED8A+rPnnPgI2EBEY/UY6tpG d4CH5R1M/rV/0m8b9q6ZeqkAowJVlfXfK/3XwMFC4xffgHROH4EvhBSkXpdjeWLZgfUEqi aw/1s4XQUYN2Jb68I6aXf8uMycGzcjuRgMKFQkGeyHloD/kl4ElBbwb7zwaj+y70DiznMk 8izmq7rhuWFp5FFgSE5afCpL0BmVwT8x+r7uKAMONxF3aLXPzkHhgUQ7nxcTCA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSRty2PszztdX; Mon, 22 Jul 2024 17:23:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MHN6gn088330; Mon, 22 Jul 2024 17:23:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MHN6cb088327; Mon, 22 Jul 2024 17:23:06 GMT (envelope-from git) Date: Mon, 22 Jul 2024 17:23:06 GMT Message-Id: <202407221723.46MHN6cb088327@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 7f2411b181d4 - main - tcp: improve whitespace consistency List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f2411b181d433a2fe363109e0e8ca3c908171ef Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=7f2411b181d433a2fe363109e0e8ca3c908171ef commit 7f2411b181d433a2fe363109e0e8ca3c908171ef Author: Michael Tuexen AuthorDate: 2024-07-22 06:59:45 +0000 Commit: Michael Tuexen CommitDate: 2024-07-22 06:59:45 +0000 tcp: improve whitespace consistency No functional change. Sponsored by: Netflix, Inc. --- sys/netinet/tcp_var.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 52fd0f181e01..c06efa601a81 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -847,8 +847,8 @@ tcp_packets_this_ack(struct tcpcb *tp, tcp_seq ack) #define TF2_MBUF_QUEUE_READY 0x00020000 /* Inputs can be queued */ #define TF2_DONT_SACK_QUEUE 0x00040000 /* Don't wake on sack */ #define TF2_CANNOT_DO_ECN 0x00080000 /* The stack does not do ECN */ -#define TF2_PROC_SACK_PROHIBIT 0x00100000 /* Due to small MSS size do not process sack's */ -#define TF2_IPSEC_TSO 0x00200000 /* IPSEC + TSO supported */ +#define TF2_PROC_SACK_PROHIBIT 0x00100000 /* Due to small MSS size do not process sack's */ +#define TF2_IPSEC_TSO 0x00200000 /* IPSEC + TSO supported */ #define TF2_NO_ISS_CHECK 0x00200000 /* Don't check SEG.ACK against ISS */ /* From nobody Mon Jul 22 18:55:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSTx74GRpz5Pxyy; Mon, 22 Jul 2024 18:55:07 +0000 (UTC) (envelope-from bz@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSTx73WFhz4PmH; Mon, 22 Jul 2024 18:55:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721674507; 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=AegOR7ekMFPoFmj+S8GuvN+MLxpbMsjQANOb4wr74Ss=; b=Q6O2xTKMVCmViE0JdhUWDl75B5AE3eWjoHX1SWeh1LWItNiow8txgayTKnoRggaRLauqBq ecQNSxXrpKFg7rIM6qW7/ENtbpl1JJXSCLmVVXsqw4Ou+zei/+cESDrtruDSuk6Kq5cOIm 5+T5wzBvtv8oLwNRxOUh/k06b93FprCIW7Hl4UjX9Np7ZbNyUmLmmUTplIA2EwjEXlf9/R lR4eL34s4GT+sIYqEDMSkip+bR7wz+o4B1tekfMsGpsE1YEAHiBGCNOPolcaJul98BgkGY ftAvOAr92S8TWPmvPi56TLD79NAfIxi5lK0VUxqAExEOJhjBP7I2i/xeVMksmQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721674507; a=rsa-sha256; cv=none; b=Ubqk9xOcpHHiS8Lrav9S3xvPWu0IdGWSyjm5mVHxTCVRcCnexwRYTwxogp9b9zfVGXjTWz sPHvwj17Jn2mWUD9Gg1E3zaKkcOiIn9sriRoLhOox+xvbRtDMv1GA0Zi1VLDTXrQXDFs5J +HvDwiYYlvUVCqauFZvkVcD6BQ4egVqM8rrIo+fHqYXUmHIiG6OlQQoTcLHY9zPxI2U9rq g3Ae/vyyYk/jmtgTx98DoS3jccEY5IrhN2RPQ7O2u7+3V5xCExlq9Z8GZIBdRzWylZIdxN QMMQs9FPBlQ7YxOH+Z5bZNDWOR2T16gedYZ/wpa74Bom/tN+NwbyjdROLmUs9w== 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=1721674507; 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=AegOR7ekMFPoFmj+S8GuvN+MLxpbMsjQANOb4wr74Ss=; b=FEn2z85ZSVr7bIsCNtr1WPnkhIb8vfXYJiAjG/byKeB2fr+Fknr2jbBlNUoSMBm+ULZQPn /wf4foX9vyYWytyzJEdbdoCdP1ahmuhYVvLcmJKyu+Ox95t5PW17v6Goyv8emBZXDSMa1m r1NFdo+ZLrQx6bwhmYD3JKWciNGXDQDOyGrBhhIi1GTtM/ZdpHC8m1xYzVEu5ztORDwhuY Ns2hhUVAP1zHi8csACUHPRu4JFdnNEG55IEsMI45gffnON6VmHYWw4pV8YQgUywKMY1zKN hlzzbv8iKgmtlEChCWsXbind6uNDWZWMoPJfK2qxEaSTL7eBl7Yp2FFLvVBzTw== 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 (P-256) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WSTx726MWzjS7; Mon, 22 Jul 2024 18:55:07 +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 9AFFCA64808; Mon, 22 Jul 2024 18:55:04 +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 672862D029D8; Mon, 22 Jul 2024 18:55:05 +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 nliK2pKPRak0; Mon, 22 Jul 2024 18:55:04 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:b66b:fcff:fef3:e3d2]) (using 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 6F7F22D029D2; Mon, 22 Jul 2024 18:55:04 +0000 (UTC) Date: Mon, 22 Jul 2024 18:55:03 +0000 (UTC) From: "Bjoern A. Zeeb" To: Vladimir Kondratyev cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a1181662d370 - main - LinuxKPI: Add devm_device_add_group to linux/device.h In-Reply-To: <202407211314.46LDEoW4023107@gitrepo.freebsd.org> Message-ID: <0964qqop-qrsn-2rpq-1n4s-snr76ps12no9@SerrOFQ.bet> References: <202407211314.46LDEoW4023107@gitrepo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Sun, 21 Jul 2024, Vladimir Kondratyev wrote: > The branch main has been updated by wulf: > > URL: https://cgit.FreeBSD.org/src/commit/?id=a1181662d3707d8165d7153a0aa5d76ea1ddc11a > > commit a1181662d3707d8165d7153a0aa5d76ea1ddc11a > Author: Vladimir Kondratyev > AuthorDate: 2024-07-21 13:09:12 +0000 > Commit: Vladimir Kondratyev > CommitDate: 2024-07-21 13:09:12 +0000 > > LinuxKPI: Add devm_device_add_group to linux/device.h > > devm_device_add_group creates a managed attribute group for a device. > > Sponsored by: Serenity Cyber Security, LLC > MFC after: 1 week > Reviewed by: manu > Differential Revision: https://reviews.freebsd.org/D45845 > --- > sys/compat/linuxkpi/common/include/linux/device.h | 4 +++ > sys/compat/linuxkpi/common/src/linux_compat.c | 30 +++++++++++++++++++++++ > 2 files changed, 34 insertions(+) > > diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h > index 00c55b31b248..912be8fbae8b 100644 > --- a/sys/compat/linuxkpi/common/include/linux/device.h > +++ b/sys/compat/linuxkpi/common/include/linux/device.h > @@ -701,4 +701,8 @@ int lkpi_devm_add_action_or_reset(struct device *dev, void (*action)(void *), vo > #define devm_add_action_or_reset(dev, action, data) \ > lkpi_devm_add_action_or_reset(dev, action, data) > > +int lkpi_devm_device_add_group(struct device *dev, const struct attribute_group *group); > +#define devm_device_add_group(dev, group) \ > + lkpi_devm_device_add_group(dev, group) I thought we would use linuxkpi_ as prefix for publicly exposed LinuxKPI related functions and lkpi_ for "internal" FreeBSD specific code which does not follow Linux KPI? Can this be fixed before MFC? -- Bjoern A. Zeeb r15:7 From nobody Mon Jul 22 20:59:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSXhR594Gz5QB0Q; Mon, 22 Jul 2024 20:59: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSXhR4QBtz4cxV; Mon, 22 Jul 2024 20:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721681959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/s40MCURfwhhtHPVa0Q31k1PUW5GMBh+4F1ZIAfafCw=; b=cgO6LpBIFgCsyBumF6eswDV16uRSCzmUz+ELPml0ue9gAqYpPFTLq1q+rBdFCp0jhR/+6n wSVMkdZjDvX6o+SqMnGI9iEYbL4bgSHQflmJwBDxGYQM1XVt/EzNnfQXD436MHEuoJBlND 3FnYAZ8gp8tu4pqvBFvAF1MNt7/jXP1ZId+wZDGT71fLeOlQLugQkG8v8TifQxze+QEJzF yM1bb2bz/ni4ScnSG3jqdgG2HoHJX3szv4v3xFGWcm7yY+G/VoRCz1B1dve1kkfWOoBgYl Ov/549N2vkN0qc1+GK2MDDkoGa34ygiuJ9eazUHgAo6dDpCjpbiaXUbdSPZp8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721681959; a=rsa-sha256; cv=none; b=ymdw6gBtTbDm7f0BO5BKsC0duFJLoI3pDCeM0RK2qA7oIXW228CFkIPJSUu4fGaTnz8SA+ gGODg9Yl5RQIvkyoxK6Aa3sza0hoXgNsHHDl1ww+wW2fQhYGLElXciPDrd7U+ZfOTtyc7X GkiaYK7tVX5slSaQq/wrwmwVshvZ02CLERlHLX4BZmrM9TvWp6dX0JQGBs5fu0bUNavzFH hJqU4sGRUiNv67TCNA9FidMzQcLYsE896rlaImty9doKzJeiZygYYPMjX835Gx6iRg8TTv Uqm07fjf1fhh/Cqw8KdO/6xfh8WOsW3OTVTKSOpxfoqG1xyTzjtoNnv2fofjKA== 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=1721681959; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/s40MCURfwhhtHPVa0Q31k1PUW5GMBh+4F1ZIAfafCw=; b=BjHwjnlDYkU3WXu4R34lB47tzWKE1S877yPEE7UBljdrAD7B9CTboHCq0IyGLnM1Kkhel1 cSo50rmAod4Jb1lZIuxfHASO4Azu3riZyYQTc2aUAwxUs7r0hvKm9yNni1fBkcN1D7d/js 6biOck/gtsCOa5g95piJbh8dkqA6QouNm9XaNh5Y/Apdy2lD32W7bWoNRy/XG6ikkek2RV IdamtegksdGnYEztHeXvRQPdJDd7ZG5eSq0T8pfN667RaTRDHeYd4qVkSnmh3W9zMApYS1 b19IExEkO9i5s5nYf2kXIxub25yDYj2AdoFxBpjB4+BfN75E3xPYsPDK8+dUsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSXhR3v6zz106d; Mon, 22 Jul 2024 20:59:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MKxJoN045245; Mon, 22 Jul 2024 20:59:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MKxJNS045242; Mon, 22 Jul 2024 20:59:19 GMT (envelope-from git) Date: Mon, 22 Jul 2024 20:59:19 GMT Message-Id: <202407222059.46MKxJNS045242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4ba4cfaf9f29 - stable/14 - acpi: Narrow workaround for broken interrupt settings on x86 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4ba4cfaf9f2991fea0d438e915df8b681a47facf Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4ba4cfaf9f2991fea0d438e915df8b681a47facf commit 4ba4cfaf9f2991fea0d438e915df8b681a47facf Author: John Baldwin AuthorDate: 2024-07-15 19:13:08 +0000 Commit: John Baldwin CommitDate: 2024-07-22 19:54:14 +0000 acpi: Narrow workaround for broken interrupt settings on x86 Commit 9a7bf07ccdc1 from 2016 introduced a workaround for some broken BIOSes that specified active-lo instead of active-hi polarity for ISA IRQs for UARTs. The workaround assumed that edge-sensitive ISA IRQs on x86 should always be active-hi. However, some recent AMD systems actually use active-lo edge-sensitive ISA IRQs (and not just for UARTs, but also for the keyboard and PS/2 mouse devices) and the override causes interrupts to be dropped resulting in boot time hangs, non-working keyboards, etc. Add a hw.acpi.override_isa_irq_polarity tunable (readable as a sysctl post-boot) to control this quirk. It can be set to 1 to force enable the override and 0 to disable it. The log of original message mentions an Intel motherboard as the sample case, so default the tunable to 1 on systems with an Intel CPU and 0 otherwise. Special thanks to Matthias Lanter for tracking down boot time issues on recent AMD systems to mismatched interrupt polarity. PR: 270707 Reported by: aixdroix_OSS@protonmail.com, Michael Dexter Reported by: mfw_burn@pm.me, Hannes Hfauswedell Reported by: Matthias Lanter Reported by: William Bulley Reviewed by: imp, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45554 (cherry picked from commit 0a34d050ae8ea14feddd3d2a62fd2f612613b2c5) --- share/man/man4/acpi.4 | 8 +++++++- sys/dev/acpica/acpi.c | 19 +++++++++++++++++++ sys/dev/acpica/acpi_resource.c | 11 ++++------- sys/dev/acpica/acpivar.h | 12 ++++++++++++ 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/share/man/man4/acpi.4 b/share/man/man4/acpi.4 index 434e97d529f5..cdad3ceeedfc 100644 --- a/share/man/man4/acpi.4 +++ b/share/man/man4/acpi.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd October 12, 2021 +.Dd July 15, 2024 .Dt ACPI 4 .Os .Sh NAME @@ -256,6 +256,12 @@ is a valid list of two interfaces .Qq Li FreeBSD and .Qq Li Linux . +.It Va hw.acpi.hw.acpi.override_isa_irq_polarity (x86) +Forces active-lo polarity for edge-triggered ISA interrupts. +Some older systems incorrectly specify active-lo polarity for ISA +interrupts and this override fixes those systems. +This override is enabled by default on systems with Intel CPUs, +but can be enabled or disabled by setting the tunable explicitly. .It Va hw.acpi.reset_video Enables calling the VESA reset BIOS vector on the resume path. This can fix some graphics cards that have problems such as LCD white-out diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 0894f4464162..71b19067707b 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -55,6 +55,8 @@ #if defined(__i386__) || defined(__amd64__) #include #include +#include +#include #endif #include #include @@ -289,6 +291,10 @@ int acpi_susp_bounce; SYSCTL_INT(_debug_acpi, OID_AUTO, suspend_bounce, CTLFLAG_RW, &acpi_susp_bounce, 0, "Don't actually suspend, just test devices."); +#if defined(__amd64__) || defined(__i386__) +int acpi_override_isa_irq_polarity; +#endif + /* * ACPI standard UUID for Device Specific Data Package * "Device Properties UUID for _DSD" Rev. 2.0 @@ -601,6 +607,19 @@ acpi_attach(device_t dev) OID_AUTO, "handle_reboot", CTLFLAG_RW, &sc->acpi_handle_reboot, 0, "Use ACPI Reset Register to reboot"); +#if defined(__amd64__) || defined(__i386__) + /* + * Enable workaround for incorrect ISA IRQ polarity by default on + * systems with Intel CPUs. + */ + if (cpu_vendor_id == CPU_VENDOR_INTEL) + acpi_override_isa_irq_polarity = 1; + SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), + OID_AUTO, "override_isa_irq_polarity", CTLFLAG_RDTUN, + &acpi_override_isa_irq_polarity, 0, + "Force active-hi polarity for edge-triggered ISA IRQs"); +#endif + /* * Default to 1 second before sleeping to give some machines time to * stabilize. diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c index e17b891d7974..8d81d61989a8 100644 --- a/sys/dev/acpica/acpi_resource.c +++ b/sys/dev/acpica/acpi_resource.c @@ -159,14 +159,11 @@ acpi_config_intr(device_t dev, ACPI_RESOURCE *res) } #if defined(__amd64__) || defined(__i386__) - /* - * XXX: Certain BIOSes have buggy AML that specify an IRQ that is - * edge-sensitive and active-lo. However, edge-sensitive IRQs - * should be active-hi. Force IRQs with an ISA IRQ value to be - * active-hi instead. - */ - if (irq < 16 && trig == ACPI_EDGE_SENSITIVE && pol == ACPI_ACTIVE_LOW) + if (irq < 16 && trig == ACPI_EDGE_SENSITIVE && pol == ACPI_ACTIVE_LOW && + acpi_override_isa_irq_polarity) { + device_printf(dev, "forcing active-hi polarity for IRQ %u\n", irq); pol = ACPI_ACTIVE_HIGH; + } #endif BUS_CONFIG_INTR(dev, irq, (trig == ACPI_EDGE_SENSITIVE) ? INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, (pol == ACPI_ACTIVE_HIGH) ? diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index bb969821b945..afb0a6909e1a 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -231,6 +231,18 @@ extern int acpi_quirks; #define ACPI_Q_TIMER (1 << 1) #define ACPI_Q_MADT_IRQ0 (1 << 2) +#if defined(__amd64__) || defined(__i386__) +/* + * Certain Intel BIOSes have buggy AML that specify an IRQ that is + * edge-sensitive and active-lo. Normally, edge-sensitive IRQs should + * be active-hi. If this value is non-zero, edge-sensitive ISA IRQs + * are forced to be active-hi instead. At least some AMD systems use + * active-lo edge-sensitive ISA IRQs, so this setting is only enabled + * by default on systems with Intel CPUs. + */ +extern int acpi_override_isa_irq_polarity; +#endif + /* * Plug and play information for device matching. Matching table format * is compatible with ids parameter of ACPI_ID_PROBE bus method. From nobody Mon Jul 22 20:59:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSXhS5qrpz5Q9pd; Mon, 22 Jul 2024 20:59: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSXhS51rTz4cxW; Mon, 22 Jul 2024 20:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721681960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MRkz49nO3m6two7up26geeg5s7iJins3P+e6a302wM4=; b=PuxxsZyn1JSRbJgbEI0unvOYqxGC6bgk66neu5sWej/2q0m7c39XHANUh7tRKcRt8Ukp9L PIzotS3kxxON6B3hgwq6/CvyRrB840cdBrPrJl39GxWAzEuaDfGiqDsjjPvzL2E5GsAqJX GR/hxR3lZf2vTth3hIgVhQTJ/J2zoE9E5w48akx2cOp+9WceFievUpXZ5g9kdsVwJQ03gK 7ZE1TqNZlCwu2NXnZ7LqwWeAi6oE0U+tr4W0ZjXgrLyDnb0/sSVcaxMR0W7g98tl/mSKw9 hBltaIOn5Q9SC7SLhwjGC14d8sBp8z4I01qBPW1eII/kwejYCKP2Y4tL6zl3Qg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721681960; a=rsa-sha256; cv=none; b=LD7VPPWm4nv76PJNmgZMYe5wUNa48w+szUI2uYqytsNPkUsBtMHTxA/plj9fksRXT+0WL0 tTMxPGn3EXypGI57LgpQPgHSqHou5fZAQvZgS7Th0nUu1JFJTy6KY1k1gNlYnrfKzCWG32 iWBr+sq0RivHTh4WykismD24KYFJILPNOx5IamlQGWe+zGzY4nmCoiNPLoDvnx9SjeOgaO rmm6+UUTF/duP0j7CML58qn/RF5bPU4r4vkshwxgyDetMrS9qW3BtFdFMF2riKrkpAc6Qk MK/j9Krn7AW2bkgjlgnjBd/T9q2bLj49SD8fo+HznpLpaGNilOrpeJi57gT5qw== 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=1721681960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MRkz49nO3m6two7up26geeg5s7iJins3P+e6a302wM4=; b=g+mZigkG1j5aROcZ01NIOCsLF7C3sPctib4/Jx00mg45O4yKl3DCnbiP14ZIMFWaQqIgR6 qqRVQc3ZIy219uRzLvJ11I3trBZE9KwPoGRpYJcMXt2PIZ8iNpTk/KIJGWNEYN5ICeoL63 UaXYt4U7rZ6QAh+78+YdvdQLvf36AkzrtFqI9luzLYpiwOmawwfF7P7+VvankVT7DEvMzI UKI5WFvZOhKu1ERjDU6xTUesdukk4kzG50w/2zN1LwaB2k0TfyE0UplqhF3xGP6ZkV40Ok ztBVXhI0Ormx1WP58MnjrxEE0mIiVSqCfjGDUM9YnuMtr9GuUe3rS6wZPRSn6A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSXhS4f6Sz10Np; Mon, 22 Jul 2024 20:59:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MKxKKH045296; Mon, 22 Jul 2024 20:59:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MKxKtA045293; Mon, 22 Jul 2024 20:59:20 GMT (envelope-from git) Date: Mon, 22 Jul 2024 20:59:20 GMT Message-Id: <202407222059.46MKxKtA045293@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 4efd13ffd63d - stable/14 - amd64 GENERIC: Drop hints for fdc0 and ppc0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4efd13ffd63db60191a2dac696646b93c01091bb Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4efd13ffd63db60191a2dac696646b93c01091bb commit 4efd13ffd63db60191a2dac696646b93c01091bb Author: John Baldwin AuthorDate: 2024-07-15 14:16:39 +0000 Commit: John Baldwin CommitDate: 2024-07-22 19:55:58 +0000 amd64 GENERIC: Drop hints for fdc0 and ppc0 Modern x86 systems do not ship with ISA floppy disk controllers or LPT ports. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45946 (cherry picked from commit 480cc750a2a8f92d078803f15eecb1f8a084a1ea) --- sys/amd64/conf/GENERIC.hints | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sys/amd64/conf/GENERIC.hints b/sys/amd64/conf/GENERIC.hints index be3f59cd1950..7c2a3f28b9ce 100644 --- a/sys/amd64/conf/GENERIC.hints +++ b/sys/amd64/conf/GENERIC.hints @@ -1,11 +1,3 @@ -hint.fdc.0.at="isa" -hint.fdc.0.port="0x3F0" -hint.fdc.0.irq="6" -hint.fdc.0.drq="2" -hint.fd.0.at="fdc0" -hint.fd.0.drive="0" -hint.fd.1.at="fdc0" -hint.fd.1.drive="1" hint.atkbdc.0.at="isa" hint.atkbdc.0.port="0x060" hint.atkbd.0.at="atkbdc" @@ -21,8 +13,6 @@ hint.uart.0.irq="4" hint.uart.1.at="isa" hint.uart.1.port="0x2F8" hint.uart.1.irq="3" -hint.ppc.0.at="isa" -hint.ppc.0.irq="7" hint.atrtc.0.at="isa" hint.atrtc.0.port="0x70" hint.atrtc.0.irq="8" From nobody Mon Jul 22 20:59:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSXhV0Rc2z5Q9rC; Mon, 22 Jul 2024 20:59: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSXhT6B56z4csC; Mon, 22 Jul 2024 20:59:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721681961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d6sRtH/pdiU/XaKhqBytkEscGAO8d1BBPVr5b11lk+0=; b=hKepXO8za6j1Vur+nSf8UXYlCQV2rX41cFmdmjoMU4VOz0m7xStGs2WC5H4vjP+SJNe9TP I120k63prqmrbNk5blt/XEWrEemIWpjKrY/K9vNxKQ++xIULk7xG0LNaQkr6XE2apvR0iG Ztac+hs3IpgZtQw/YtyV5fRczdGTKvTRLkwiGfFIN88zIEq7iF66qLAs7AYS1C+6BEjvVa bHBdWzwtprYuTnCb3mQpE5TNw65XbsOKe7Fx+Xs0S2EI6BoZ+sITRE6RD7GKDYkGXOUQow qRuyV7JRs7CVkndBXPrsiCJnHeTvt5tCRJIBjATGgCT/Lxdbz3MndH522LMfpA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721681961; a=rsa-sha256; cv=none; b=Y3CF5ou0E9YsiSEKr5J2YUtdStlY0s9QAQ1G/1nBxdO9VANqnVL4ZFueiv7Mw/GY/8mhhx +e9Pn0lRUWcuLvejY3EoIkcwOFW/V68V8Z9k+HozpR1ziY1vKNnDI0JK8h3fSZSWSL441P ETSydjuSEnJq+IliybtDQX5aQ+uMP+7REjVNdYxX3ZSmbNNh5uTGzhCqnBIdRD21d1mOJd ZYkUfFtmrKnInrMVZC8Sd20azFbiEv1e/MOJJofRzHoe59BJBe8e2WZ/mX4gCOyY+9ZuXn xQnXOG6tehodBux1WEQsFb+yciYpvVt14tRY6hWTZ2pd3x99LGsjlLIdxDlhEQ== 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=1721681961; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d6sRtH/pdiU/XaKhqBytkEscGAO8d1BBPVr5b11lk+0=; b=ATzsaVRUPrJ1kWAGK8hjFk0jLFphgPLXD0mt4tIuEInkfgWv8g+2xsdbnpnZAcBoPqex2U 5GMYtjHHRjLYVqc6ZW4JbbGP1VJFhufueD4sT9doesMg0rQPBLH5EPXxAnPnLMLrhWMLvb lEKRVeLZ1cAAAk5cwE0AUA8/FtulL23MtEceyRxpL8xoRLQnRqy02QXRMEaPlcIZlnkF3H eHadfbcSUHQmzUMqmhw6loSrKcgkdbOi32MxgCAScE5HA+ph8OQFFStHbNnm2F+jCJ+aE+ RgXn39bRWftlahAjJH797Tw64Zm3uE3Hs2s6skSuDPseoc6j6CnGTpjH5yb01w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSXhT5lBsz10dn; Mon, 22 Jul 2024 20:59:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MKxL00045350; Mon, 22 Jul 2024 20:59:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MKxLa2045347; Mon, 22 Jul 2024 20:59:21 GMT (envelope-from git) Date: Mon, 22 Jul 2024 20:59:21 GMT Message-Id: <202407222059.46MKxLa2045347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 74b9fc7adcf4 - stable/14 - amd64 GENERIC: Switch uart hints from "isa" to "acpi" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 74b9fc7adcf4afb1c3039267e338c3cfdf022957 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=74b9fc7adcf4afb1c3039267e338c3cfdf022957 commit 74b9fc7adcf4afb1c3039267e338c3cfdf022957 Author: John Baldwin AuthorDate: 2024-07-15 19:14:01 +0000 Commit: John Baldwin CommitDate: 2024-07-22 19:56:00 +0000 amd64 GENERIC: Switch uart hints from "isa" to "acpi" This causes these hints to be only used to wire device unit numbers for serial ports enumerated by ACPI but will not create ISA device nodes if ACPI doesn't enumerate them. Note that IRQ hints are not used for wiring so have been removed. PR: 270707 Reported by: aixdroix_OSS@protonmail.com, Michael Dexter Reported by: mfw_burn@pm.me, Hannes Hfauswedell Reported by: Matthias Lanter Reported by: William Bulley Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45945 (cherry picked from commit 9cc06bf7aa2846c35483de567779bb8afc289f53) --- sys/amd64/conf/GENERIC.hints | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/amd64/conf/GENERIC.hints b/sys/amd64/conf/GENERIC.hints index 7c2a3f28b9ce..4f6121c7cf77 100644 --- a/sys/amd64/conf/GENERIC.hints +++ b/sys/amd64/conf/GENERIC.hints @@ -6,13 +6,11 @@ hint.psm.0.at="atkbdc" hint.psm.0.irq="12" hint.sc.0.at="isa" hint.sc.0.flags="0x100" -hint.uart.0.at="isa" +hint.uart.0.at="acpi" hint.uart.0.port="0x3F8" hint.uart.0.flags="0x10" -hint.uart.0.irq="4" -hint.uart.1.at="isa" +hint.uart.1.at="acpi" hint.uart.1.port="0x2F8" -hint.uart.1.irq="3" hint.atrtc.0.at="isa" hint.atrtc.0.port="0x70" hint.atrtc.0.irq="8" From nobody Mon Jul 22 21:06:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSXs32Hzdz5QBc6; Mon, 22 Jul 2024 21:06: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSXs30V9Yz4drl; Mon, 22 Jul 2024 21:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721682407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2tRDl9SbJXxE/Mi0iSLRfDnUCNZDcy2t9ESqom6YmtU=; b=kzVCgRgBwQWIlRdo5HAPb6HkwUwL+FsVKrbjG43b87+v+f0B4J170b4H8yaCFn1VE3WxiM A94cuAPBWMbbJCNazkwu87YqG+MGXcIdBa6CeLO8Os5oF40nYXIqPQiEk0c8Z8+YAQonm1 pD0JBi0swCxrl6iL1ITDOr6fW1EO5jiLQSJMqxgPLGh+Jg4OF8ZNf91VztclwjlSjNH7BI 8OTzW6ZHAi1X9fvBjxJJstv/UkarHgSIkYa3/Fm4vEG93q43UIjOlLINtn7FPVcsFCwI6w HtHQ7P2ZCZNU9MJU9Yx3hYvnyXg2LddzxzmCS1N7IPhhkbOzS+LCwxjlNhVJkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721682407; a=rsa-sha256; cv=none; b=OMVaFkCimlZcA99CYGmhcqAg17vSPEnznWRHZqi0e2WEoKHz2kSZ+ttLWtGa4t7Nerqkog ODAL79XRJ486iisyz1myV0j+hOXt3WT/RcoWpg+BCCyX+S4APO0tFagw+3zwAYoa5fvaQG W4jbIprE/wI9LgGhdNerIaq7KM7TO4H6ZxkpDkb3pvTvw+5x4E1WHp/vA9zIxYwd3pB2Sm URi3WlInhOGKkUZWcsSG0RL2NzY1Bu/I7/QOcznRA704NyD7japjRkz0N14wG3xQX4uSk5 qJ6hSk4VqXlvBAINAnF4Bpx2mOpco+p4/3qxdtnPbToeBomVDXxnHkM3LvBIoQ== 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=1721682407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2tRDl9SbJXxE/Mi0iSLRfDnUCNZDcy2t9ESqom6YmtU=; b=vtDGGL8iIu/Yx+WywTbstQF39kNMMG13ZhfjyaEzoDogb6VuEezC1HFwNsM0ndITKn68ss 5+mbiSeHxi5WgJIvTSXODYkMsjhDOk6x5YfKMhp0oLJcFNouAOiDQNBtDUFKuwY37nH1k9 11y0B4P+JqbhHgDTmLosnaT7g4pH1c0SN2plTNkeMHyQ+cIQF8835XpZxcANfz66cloYQz PLT061n88CJWABJ8xPhHu5td/BfaSeneoNJdTrqrf8GMyrpCipzh/knqkLnOcBCqw/YEc/ o5Cw2n4TVCS5B9GjVfMie81wxXd3qQBrA4oo5HfceP6ux0AOGCf25/Uav7YmNQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSXs305jGz10qt; Mon, 22 Jul 2024 21:06:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46ML6kZd063109; Mon, 22 Jul 2024 21:06:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46ML6kJl063106; Mon, 22 Jul 2024 21:06:46 GMT (envelope-from git) Date: Mon, 22 Jul 2024 21:06:46 GMT Message-Id: <202407222106.46ML6kJl063106@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 43d45f26413a - main - nvmf_tcp: Don't require a data digest for PDUs without data List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43d45f26413aa98e41994d0d0f06c49c7eca430e Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=43d45f26413aa98e41994d0d0f06c49c7eca430e commit 43d45f26413aa98e41994d0d0f06c49c7eca430e Author: John Baldwin AuthorDate: 2024-07-22 19:38:12 +0000 Commit: John Baldwin CommitDate: 2024-07-22 21:05:55 +0000 nvmf_tcp: Don't require a data digest for PDUs without data If a PDU (such as a Command Capsule PDU) on a connection that has enabled data digests does not have a data section, it will not have the the PDU data digest flag set. The previous check was requiring this flag to be present on all PDU types that support data sections even if no data was included in the PDU. Sponsored by: Chelsio Communications --- sys/dev/nvmf/nvmf_tcp.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/sys/dev/nvmf/nvmf_tcp.h b/sys/dev/nvmf/nvmf_tcp.h index 78d6cf17a977..c60be0bc1024 100644 --- a/sys/dev/nvmf/nvmf_tcp.h +++ b/sys/dev/nvmf/nvmf_tcp.h @@ -41,6 +41,13 @@ nvmf_tcp_validate_pdu_header(const struct nvme_tcp_common_pdu_hdr *ch, uint8_t digest_flags, valid_flags; plen = le32toh(ch->plen); + full_hlen = ch->hlen; + if ((ch->flags & NVME_TCP_CH_FLAGS_HDGSTF) != 0) + full_hlen += sizeof(uint32_t); + if (plen == full_hlen) + data_len = 0; + else + data_len = plen - ch->pdo; /* * Errors must be reported for the lowest incorrect field @@ -125,11 +132,15 @@ nvmf_tcp_validate_pdu_header(const struct nvme_tcp_common_pdu_hdr *ch, return (EBADMSG); } - /* Verify that digests are present iff enabled. */ + /* + * Verify that digests are present iff enabled. Note that the + * data digest will not be present if there is no data + * payload. + */ digest_flags = 0; if (header_digests) digest_flags |= NVME_TCP_CH_FLAGS_HDGSTF; - if (data_digests) + if (data_digests && data_len != 0) digest_flags |= NVME_TCP_CH_FLAGS_DDGSTF; if ((digest_flags & valid_flags) != (ch->flags & (NVME_TCP_CH_FLAGS_HDGSTF | @@ -184,9 +195,6 @@ nvmf_tcp_validate_pdu_header(const struct nvme_tcp_common_pdu_hdr *ch, } /* Validate pdo. */ - full_hlen = ch->hlen; - if ((ch->flags & NVME_TCP_CH_FLAGS_HDGSTF) != 0) - full_hlen += sizeof(uint32_t); switch (ch->pdu_type) { default: __assert_unreachable(); @@ -207,7 +215,7 @@ nvmf_tcp_validate_pdu_header(const struct nvme_tcp_common_pdu_hdr *ch, case NVME_TCP_PDU_TYPE_H2C_DATA: case NVME_TCP_PDU_TYPE_C2H_DATA: /* Permit PDO of 0 if there is no data. */ - if (full_hlen == plen && ch->pdo == 0) + if (data_len == 0 && ch->pdo == 0) break; if (ch->pdo < full_hlen || ch->pdo > plen || @@ -229,10 +237,6 @@ nvmf_tcp_validate_pdu_header(const struct nvme_tcp_common_pdu_hdr *ch, return (EBADMSG); } - if (plen == full_hlen) - data_len = 0; - else - data_len = plen - ch->pdo; switch (ch->pdu_type) { default: __assert_unreachable(); From nobody Mon Jul 22 22:09:34 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSZFV56HPz5QHDk; Mon, 22 Jul 2024 22:09: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSZFV4Stkz4l0b; Mon, 22 Jul 2024 22:09:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721686174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D/aIrBo1Bx8tKzs3rGnE/8G/9LsAm3riwkIpL2bPGNQ=; b=e07VOhGawARohliI/vG7q4X+aR4IqV3Hl+GsshSax+wGuTJ2AgeYWLkzL35UGuGneG2okM vIa8SxPlAxk5A2pbL7TtVSqWHU4RIi2Y4jbUxGb6IGjD0v/vQpUmjSuSpzJwN3JCCzGY/o 3yUtCyn9q8Eiby0YNoiUPuV2H5j17WGB0gFPlT7Bw5Iaj0EJVW10B9ZJw2uMXDg4Dz5PGR CSRtNZS+25VJ6JN3NaH8fLTzfqX1/s0xwrMk0CuLNja496+1u1BmB2ANJnNA1yQXqSh3qL y9+VVygSpVT33U8kIdsxH3l4Z9vKDlt6Sob63Gr6OLzLmBqXCaKN0abvzT59zA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721686174; a=rsa-sha256; cv=none; b=q7czgsrB0ypVZXb+I7y3/aRMh4UiR9avqzPVbedHck5SDWKt5phwNWQtT67ZBo5fsXY3Xb JE1m4vur2zxSzvBS+qcD7DWF4oq+3MeJdsOjmsm044vMV1Mw1zEmLfV6LKMw9huS7jh9Sr WptK/iwn5jQU49PCIfWf2HBWscMPfHmMliY25MWMFROVkAL7ampqTfwGjS+IxInafmFruH uViBMVnnfgSD4x1LaKLQ/Ef166uXhEgvCW180SDa31opejS5GEaB0eEpuEOwoupa66egLp RZoK+nv9q4ml2kR6IPTKetPXz4jIroq5NCNOrIC3eQUryOEGyZUw6iZxOJVqxg== 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=1721686174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D/aIrBo1Bx8tKzs3rGnE/8G/9LsAm3riwkIpL2bPGNQ=; b=wfnPQkQJCMIEykMB6sQu51vMzHPT+OFJdpdHXOjryL9l4baAe7KZdHqifoHtgCP6xkWe93 zcMbwsjsK3NkBuUkvvh3N2aCZ1wRDgbe4FoWdqXrAyp2vYRc34ff8NyCQ+dNp4GBaokEkF KxGngF7ozx8z69X69sUTRtHig9QsbH5GsA1wN/+o9eYJXSkZopxoJoFG6zIHW3uhqpirAP YBVmmo9ZowREhjIpgV5i0WBHfh73MzCPYc/uW7sUvzAXEndNdsEOpZ5VnU/8ITq3GvkbgS OK0ZPpSViF9XCYkm7EJy1heiWGj5MCZ3ezoLfZZJ0cnrgVtfppAVAxEl8SvRFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSZFV3t81z12ZJ; Mon, 22 Jul 2024 22:09:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MM9Ymh064182; Mon, 22 Jul 2024 22:09:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MM9YSj064179; Mon, 22 Jul 2024 22:09:34 GMT (envelope-from git) Date: Mon, 22 Jul 2024 22:09:34 GMT Message-Id: <202407222209.46MM9YSj064179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 7a76f3591036 - stable/14 - nfsd: Allow a mutex lock for clientID handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7a76f3591036af124998a03c048d69deb3a554a4 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=7a76f3591036af124998a03c048d69deb3a554a4 commit 7a76f3591036af124998a03c048d69deb3a554a4 Author: Rick Macklem AuthorDate: 2024-06-22 22:56:40 +0000 Commit: Rick Macklem CommitDate: 2024-07-22 21:57:56 +0000 nfsd: Allow a mutex lock for clientID handling On Feb. 28, a problem was reported on freebsd-stable@ where a nfsd thread processing an ExchangeID operation was blocked for a long time by another nfsd thread performing a copy_file_range. This occurred because the copy_file_range was taking a long time, but also because handling a clientID requires that all other nfsd threads be blocked via an exclusive lock, as required by ExchangeID. This patch allows clientID handling to be done with only a mutex held (instead of an exclusive lock that blocks all other nfsd threads) when vfs.nfsd.enable_locallocks is 0. For the case of vfs.nfsd.enable_locallocks set to 1, the exclusive lock that blocks all nfsd threads is still required. This patch does make changing the value of vfs.nfsd.enable_locallocks somewhat racy. A future commit will ensure any change is done when all nfsd threads are blocked to avoid this racyness. (cherry picked from commit dfaeeacc2cc29d0497ecd4cd5b7fd0d5ab61fcd5) --- sys/fs/nfsserver/nfs_nfsdstate.c | 245 ++++++++++++++++++++++++++------------- 1 file changed, 162 insertions(+), 83 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 7a28e51e21fc..6b40e0f64141 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -245,6 +245,45 @@ static void nfsrv_issuedelegation(struct vnode *vp, struct nfsclient *clp, u_quad_t filerev, uint64_t rdonly, struct nfsstate **new_delegp, struct nfsstate *new_stp, struct nfslockfile *lfp, uint32_t *rflagsp, nfsv4stateid_t *delegstateidp); +static void nfsrv_clientlock(bool mlocked); +static void nfsrv_clientunlock(bool mlocked); + +/* + * Lock the client structure, either with the mutex or the exclusive nfsd lock. + */ +static void +nfsrv_clientlock(bool mlocked) +{ + int igotlock; + + if (mlocked) { + NFSLOCKSTATE(); + } else { + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsv4rootfs_lock); + do { + igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, + NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (!igotlock); + NFSUNLOCKV4ROOTMUTEX(); + } +} + +/* + * Unlock the client structure. + */ +static void +nfsrv_clientunlock(bool mlocked) +{ + + if (mlocked) { + NFSUNLOCKSTATE(); + } else { + NFSLOCKV4ROOTMUTEX(); + nfsv4_unlock(&nfsv4rootfs_lock, 1); + NFSUNLOCKV4ROOTMUTEX(); + } +} /* * Scan the client list for a match and either return the current one, @@ -266,7 +305,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, struct sockaddr_in6 *sin6, *rin6; #endif struct nfsdsession *sep, *nsep; - int zapit = 0, gotit, hasstate = 0, igotlock; + SVCXPRT *old_xprt; + struct nfssessionhead old_sess; + int zapit = 0, gotit, hasstate = 0; + bool mlocked; static u_int64_t confirm_index = 0; /* @@ -294,14 +336,11 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ new_clp->lc_program = 0; + mlocked = true; + if (nfsrv_dolocallocks != 0) + mlocked = false; /* Lock out other nfsd threads */ - NFSLOCKV4ROOTMUTEX(); - nfsv4_relref(&nfsv4rootfs_lock); - do { - igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, - NFSV4ROOTLOCKMUTEXPTR, NULL); - } while (!igotlock); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientlock(mlocked); /* * Search for a match in the client list. @@ -318,6 +357,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, if (gotit == 0) i++; } + old_xprt = NULL; if (!gotit || (clp->lc_flags & (LCL_NEEDSCONFIRM | LCL_ADMINREVOKED))) { if ((nd->nd_flag & ND_NFSV41) != 0 && confirmp->lval[1] != 0) { @@ -325,9 +365,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, * For NFSv4.1, if confirmp->lval[1] is non-zero, the * client is trying to update a confirmed clientid. */ - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); confirmp->lval[1] = 0; error = NFSERR_NOENT; goto out; @@ -337,7 +375,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ if (i != nfsrv_clienthashsize) { LIST_REMOVE(clp, lc_hash); - nfsrv_cleanclient(clp, p, false, NULL); + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); zapit = 1; @@ -372,11 +413,12 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, NFSD_VNET(nfsstatsv1_p)->srvclients++; nfsrv_openpluslock++; nfsrv_clients++; - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); - if (zapit) + nfsrv_clientunlock(mlocked); + if (zapit != 0) { + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); nfsrv_zapclient(clp, p); + } *new_clpp = NULL; goto out; } @@ -390,7 +432,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ if (clp->lc_expiry < NFSD_MONOSEC && (!LIST_EMPTY(&clp->lc_open) || !LIST_EMPTY(&clp->lc_deleg))) { - nfsrv_cleanclient(clp, p, false, NULL); + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); } @@ -435,9 +480,9 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, break; #endif } - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); error = NFSERR_CLIDINUSE; goto out; } @@ -452,13 +497,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ LIST_REMOVE(clp, lc_hash); - /* Get rid of all sessions on this clientid. */ - LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) { - ret = nfsrv_freesession(NULL, sep, NULL, false, NULL); - if (ret != 0) - printf("nfsrv_setclient: verifier changed free" - " session failed=%d\n", ret); - } + LIST_NEWHEAD(&old_sess, &clp->lc_session, sess_list); new_clp->lc_flags |= LCL_NEEDSCONFIRM; if ((nd->nd_flag & ND_NFSV41) != 0) { @@ -502,21 +541,31 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, NFSD_VNET(nfsstatsv1_p)->srvclients++; nfsrv_openpluslock++; nfsrv_clients++; - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + if (!mlocked) { + nfsrv_clientunlock(mlocked); + NFSLOCKSTATE(); + } /* * Must wait until any outstanding callback on the old clp * completes. */ - NFSLOCKSTATE(); while (clp->lc_cbref) { clp->lc_flags |= LCL_WAKEUPWANTED; (void)mtx_sleep(clp, NFSSTATEMUTEXPTR, PZERO - 1, "nfsd clp", 10 * hz); } NFSUNLOCKSTATE(); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); + /* Get rid of all sessions on this clientid. */ + LIST_FOREACH_SAFE(sep, &old_sess, sess_list, nsep) { + ret = nfsrv_freesession(NULL, sep, NULL, false, NULL); + if (ret != 0) + printf("nfsrv_setclient: verifier changed free" + " session failed=%d\n", ret); + } + nfsrv_zapclient(clp, p); *new_clpp = NULL; goto out; @@ -568,24 +617,31 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, nfsrv_openpluslock++; nfsrv_clients++; } - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + if (!mlocked) + nfsrv_clientunlock(mlocked); if ((nd->nd_flag & ND_NFSV41) == 0) { /* * Must wait until any outstanding callback on the old clp * completes. */ - NFSLOCKSTATE(); + if (!mlocked) + NFSLOCKSTATE(); while (clp->lc_cbref) { clp->lc_flags |= LCL_WAKEUPWANTED; (void)mtx_sleep(clp, NFSSTATEMUTEXPTR, PZERO - 1, "nfsdclp", 10 * hz); } NFSUNLOCKSTATE(); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); nfsrv_zapclient(clp, p); *new_clpp = NULL; + } else { + if (mlocked) + NFSUNLOCKSTATE(); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); } out: @@ -605,11 +661,13 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, struct nfsstate *stp; int i; struct nfsclienthashhead *hp; - int error = 0, igotlock, doneok; + int error = 0, doneok, igotlock; struct nfssessionhash *shp; struct nfsdsession *sep; uint64_t sessid[2]; - bool sess_replay; + CLIENT *client; + SVCXPRT *old_xprt; + bool mlocked, sess_replay; static uint64_t next_sess = 0; if (clpp) @@ -626,13 +684,27 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, * already held. Otherwise, we need to get either that or, * for the case of Confirm, lock out the nfsd threads. */ + client = NULL; + old_xprt = NULL; + mlocked = true; + if (nfsrv_dolocallocks != 0) + mlocked = false; if (opflags & CLOPS_CONFIRM) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_relref(&nfsv4rootfs_lock); - do { - igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, - NFSV4ROOTLOCKMUTEXPTR, NULL); - } while (!igotlock); + if (nsep != NULL && + (nsep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0) + client = (struct __rpc_client *) + clnt_bck_create(nd->nd_xprt->xp_socket, + cbprogram, NFSV4_CBVERS); + if (mlocked) { + nfsrv_clientlock(mlocked); + } else { + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsv4rootfs_lock); + do { + igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, + NULL, NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (!igotlock); + } /* * Create a new sessionid here, since we need to do it where * there is a mutex held to serialize update of next_sess. @@ -641,7 +713,8 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, sessid[0] = ++next_sess; sessid[1] = clientid.qval; } - NFSUNLOCKV4ROOTMUTEX(); + if (!mlocked) + NFSUNLOCKV4ROOTMUTEX(); } else if (opflags != CLOPS_RENEW) { NFSLOCKSTATE(); } @@ -678,9 +751,9 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, } if (error) { if (opflags & CLOPS_CONFIRM) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (client != NULL) + CLNT_RELEASE(client); } else if (opflags != CLOPS_RENEW) { NFSUNLOCKSTATE(); } @@ -725,7 +798,10 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, * for an Open with CLAIM_DELEGATE_PREV unless in * grace, but get rid of the rest of the state. */ - nfsrv_cleanclient(clp, p, false, NULL); + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_olddeleg); if (nfsrv_checkgrace(nd, clp, 0)) { /* In grace, so just delete delegations */ @@ -749,10 +825,10 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, /* Hold a reference on the xprt for a backchannel. */ if ((nsep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0 && !sess_replay) { - if (clp->lc_req.nr_client == NULL) - clp->lc_req.nr_client = (struct __rpc_client *) - clnt_bck_create(nd->nd_xprt->xp_socket, - cbprogram, NFSV4_CBVERS); + if (clp->lc_req.nr_client == NULL) { + clp->lc_req.nr_client = client; + client = NULL; + } if (clp->lc_req.nr_client != NULL) { SVC_ACQUIRE(nd->nd_xprt); CLNT_ACQUIRE(clp->lc_req.nr_client); @@ -769,13 +845,15 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, NFSX_V4SESSIONID); if (!sess_replay) { shp = NFSSESSIONHASH(nsep->sess_sessionid); - NFSLOCKSTATE(); + if (!mlocked) + NFSLOCKSTATE(); NFSLOCKSESSION(shp); LIST_INSERT_HEAD(&shp->list, nsep, sess_hash); LIST_INSERT_HEAD(&clp->lc_session, nsep, sess_list); nsep->sess_clp = clp; NFSUNLOCKSESSION(shp); - NFSUNLOCKSTATE(); + if (!mlocked) + NFSUNLOCKSTATE(); } } } @@ -809,9 +887,11 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, clp->lc_expiry = nfsrv_leaseexpiry(); } if (opflags & CLOPS_CONFIRM) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (client != NULL) + CLNT_RELEASE(client); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); } else if (opflags != CLOPS_RENEW) { NFSUNLOCKSTATE(); } @@ -831,21 +911,20 @@ nfsrv_destroyclient(struct nfsrv_descript *nd, nfsquad_t clientid, NFSPROC_T *p) { struct nfsclient *clp; struct nfsclienthashhead *hp; - int error = 0, i, igotlock; + SVCXPRT *old_xprt; + int error = 0, i; + bool mlocked; if (NFSD_VNET(nfsrvboottime) != clientid.lval[0]) { error = NFSERR_STALECLIENTID; goto out; } + mlocked = true; + if (nfsrv_dolocallocks != 0) + mlocked = false; /* Lock out other nfsd threads */ - NFSLOCKV4ROOTMUTEX(); - nfsv4_relref(&nfsv4rootfs_lock); - do { - igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, - NFSV4ROOTLOCKMUTEXPTR, NULL); - } while (igotlock == 0); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientlock(mlocked); hp = NFSCLIENTHASH(clientid); LIST_FOREACH(clp, hp, lc_hash) { @@ -853,9 +932,7 @@ nfsrv_destroyclient(struct nfsrv_descript *nd, nfsquad_t clientid, NFSPROC_T *p) break; } if (clp == NULL) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); /* Just return ok, since it is gone. */ goto out; } @@ -863,9 +940,7 @@ nfsrv_destroyclient(struct nfsrv_descript *nd, nfsquad_t clientid, NFSPROC_T *p) /* Check for the SP4_MACH_CRED case. */ error = nfsrv_checkmachcred(NFSV4OP_DESTROYCLIENTID, nd, clp); if (error != 0) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); goto out; } @@ -878,28 +953,28 @@ nfsrv_destroyclient(struct nfsrv_descript *nd, nfsquad_t clientid, NFSPROC_T *p) /* Scan for state on the clientid. */ for (i = 0; i < nfsrv_statehashsize; i++) if (!LIST_EMPTY(&clp->lc_stateid[i])) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); error = NFSERR_CLIENTIDBUSY; goto out; } if (!LIST_EMPTY(&clp->lc_session) || !LIST_EMPTY(&clp->lc_deleg)) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); error = NFSERR_CLIENTIDBUSY; goto out; } /* Destroy the clientid and return ok. */ - nfsrv_cleanclient(clp, p, false, NULL); + old_xprt = NULL; + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); LIST_REMOVE(clp, lc_hash); - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); nfsrv_zapclient(clp, p); out: NFSEXITCODE2(error, nd); @@ -1388,8 +1463,12 @@ nfsrv_cleanclient(struct nfsclient *clp, NFSPROC_T *p, bool locked, struct nfsstate *stp, *nstp; struct nfsdsession *sep, *nsep; - LIST_FOREACH_SAFE(stp, &clp->lc_open, ls_list, nstp) - nfsrv_freeopenowner(stp, 1, p); + LIST_FOREACH_SAFE(stp, &clp->lc_open, ls_list, nstp) { + if (locked) + nfsrv_freeopenowner(stp, 0, p); + else + nfsrv_freeopenowner(stp, 1, p); + } if ((clp->lc_flags & LCL_ADMINREVOKED) == 0) LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) (void)nfsrv_freesession(NULL, sep, NULL, locked, From nobody Mon Jul 22 23:33:21 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSc692sycz5QQWw; Mon, 22 Jul 2024 23:33: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSc692gCzz4tg8; Mon, 22 Jul 2024 23:33:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721691201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BdgEHL2oOgJ3gUk1fV4LquRBc6obB9uAcWZzV6vX6ic=; b=f1rzvY+fYq4S26wmpiGa5+UMn9RxN3sau8bD5iuIHgPza3VtlIyn7BFd/b4NukEerjxX5O IGGyYUiLXmfiEWzy2OgzZTKLFA9I8pP9yD3eHaf5U9CrY4+sqYnw3SQVQ0VpejQxcSmxzY SxTGDDPxvM7c7Sh54PqD7oVz/o/0QYvS/MdMqvjIN961+s+XKC15PQkOdYXVzEPPMjoyYQ SCmaotQquomncufGbSRQNjB1C17qAuLkLsgvvCnJJf3b0kfPVaQAya5YPM3vj+jlvQFP1F EvFWl8Bmf03hm6g30UZhnDyRMhR4+gcxxLosBLmmGooe2An6o8IuAJzhE6/QgA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721691201; a=rsa-sha256; cv=none; b=XLv4ZAlx+xxbiEeOZtGz5onn+CgOIdWveRjIV9R1OLqSN/C7pritupYUkNBAYr3W0nF4sE y8gQYHaL3hIHWz1Cx/q14SJmAbwXhNlwEuY3HYveETLs0i/vrVhn5YGoCzVsZG4KmGhbF6 ZNza5O/+K5URSKrVNSPN6edF+qWJNK27A8qAwM7LQ0+LErw/aggsO2RuWhO8XRZzZPtwAV +yAC7MMfDc/+fpKPMDLYorOR3E43nkAswc2P1isv7KK70TgHORv4CYylAUcE2/qyCOXyOh Ss497N4I2m7PsKMMiQKNS728a9ykxLjYqmqXBS6SCx0+kKbUC7j0bNlL9/YNtQ== 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=1721691201; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BdgEHL2oOgJ3gUk1fV4LquRBc6obB9uAcWZzV6vX6ic=; b=cZ8TlirlsEFa49BbZzpELEf7wfE1NrMtkGuT+fMdpFCKQTDUoCYxDgUXdGQfo5pajmzvww xIwAi01Corjf1y8VCJC/xmvADiFtBfbX7RV7anWP1HIqSNBlw0bj+frIzlgr9m8ipWJCCi mCFNV1rRELWStOJdklQ4+BiVDAtYC9GF8Nq42zfL/F/Jsz0ZWERdB8PVAd5HmprDpArjg9 zNzzv2uQfdiJ+HBLAzy0f4C5qE3nAXru8K6nPSN0k03U/MV/+9QbSC8hwbvvLztz3jR53U DwZX9xe8FPNFQMFm1SP2jAMvzLN1CF0rjGwqphEczbiJLVxDs/8g4n8ZqIprpQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSc692BJtz14b3; Mon, 22 Jul 2024 23:33:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46MNXLdI015421; Mon, 22 Jul 2024 23:33:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46MNXLSI015418; Mon, 22 Jul 2024 23:33:21 GMT (envelope-from git) Date: Mon, 22 Jul 2024 23:33:21 GMT Message-Id: <202407222333.46MNXLSI015418@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: e6d78780c9cc - stable/13 - nfsd: Allow a mutex lock for clientID handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e6d78780c9cc13f5c4f353404b54292cd060251c Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=e6d78780c9cc13f5c4f353404b54292cd060251c commit e6d78780c9cc13f5c4f353404b54292cd060251c Author: Rick Macklem AuthorDate: 2024-06-22 22:56:40 +0000 Commit: Rick Macklem CommitDate: 2024-07-22 22:18:16 +0000 nfsd: Allow a mutex lock for clientID handling On Feb. 28, a problem was reported on freebsd-stable@ where a nfsd thread processing an ExchangeID operation was blocked for a long time by another nfsd thread performing a copy_file_range. This occurred because the copy_file_range was taking a long time, but also because handling a clientID requires that all other nfsd threads be blocked via an exclusive lock, as required by ExchangeID. This patch allows clientID handling to be done with only a mutex held (instead of an exclusive lock that blocks all other nfsd threads) when vfs.nfsd.enable_locallocks is 0. For the case of vfs.nfsd.enable_locallocks set to 1, the exclusive lock that blocks all nfsd threads is still required. This patch does make changing the value of vfs.nfsd.enable_locallocks somewhat racy. A future commit will ensure any change is done when all nfsd threads are blocked to avoid this racyness. (cherry picked from commit dfaeeacc2cc29d0497ecd4cd5b7fd0d5ab61fcd5) --- sys/fs/nfsserver/nfs_nfsdstate.c | 241 ++++++++++++++++++++++++++------------- 1 file changed, 161 insertions(+), 80 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdstate.c b/sys/fs/nfsserver/nfs_nfsdstate.c index 911f5053bd3c..44f8aeb2a70d 100644 --- a/sys/fs/nfsserver/nfs_nfsdstate.c +++ b/sys/fs/nfsserver/nfs_nfsdstate.c @@ -238,6 +238,45 @@ static int nfsrv_createdsfile(vnode_t vp, fhandle_t *fhp, struct pnfsdsfile *pf, vnode_t dvp, struct nfsdevice *ds, struct ucred *cred, NFSPROC_T *p, vnode_t *tvpp); static struct nfsdevice *nfsrv_findmirroredds(struct nfsmount *nmp); +static void nfsrv_clientlock(bool mlocked); +static void nfsrv_clientunlock(bool mlocked); + +/* + * Lock the client structure, either with the mutex or the exclusive nfsd lock. + */ +static void +nfsrv_clientlock(bool mlocked) +{ + int igotlock; + + if (mlocked) { + NFSLOCKSTATE(); + } else { + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsv4rootfs_lock); + do { + igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, + NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (!igotlock); + NFSUNLOCKV4ROOTMUTEX(); + } +} + +/* + * Unlock the client structure. + */ +static void +nfsrv_clientunlock(bool mlocked) +{ + + if (mlocked) { + NFSUNLOCKSTATE(); + } else { + NFSLOCKV4ROOTMUTEX(); + nfsv4_unlock(&nfsv4rootfs_lock, 1); + NFSUNLOCKV4ROOTMUTEX(); + } +} /* * Scan the client list for a match and either return the current one, @@ -259,7 +298,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, struct sockaddr_in6 *sin6, *rin6; #endif struct nfsdsession *sep, *nsep; - int zapit = 0, gotit, hasstate = 0, igotlock; + SVCXPRT *old_xprt; + struct nfssessionhead old_sess; + int zapit = 0, gotit, hasstate = 0; + bool mlocked; static u_int64_t confirm_index = 0; /* @@ -287,14 +329,11 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ new_clp->lc_program = 0; + mlocked = true; + if (nfsrv_dolocallocks != 0) + mlocked = false; /* Lock out other nfsd threads */ - NFSLOCKV4ROOTMUTEX(); - nfsv4_relref(&nfsv4rootfs_lock); - do { - igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, - NFSV4ROOTLOCKMUTEXPTR, NULL); - } while (!igotlock); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientlock(mlocked); /* * Search for a match in the client list. @@ -311,6 +350,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, if (gotit == 0) i++; } + old_xprt = NULL; if (!gotit || (clp->lc_flags & (LCL_NEEDSCONFIRM | LCL_ADMINREVOKED))) { if ((nd->nd_flag & ND_NFSV41) != 0 && confirmp->lval[1] != 0) { @@ -318,9 +358,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, * For NFSv4.1, if confirmp->lval[1] is non-zero, the * client is trying to update a confirmed clientid. */ - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); confirmp->lval[1] = 0; error = NFSERR_NOENT; goto out; @@ -330,7 +368,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ if (i != nfsrv_clienthashsize) { LIST_REMOVE(clp, lc_hash); - nfsrv_cleanclient(clp, p, false, NULL); + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); zapit = 1; @@ -365,11 +406,12 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, NFSD_VNET(nfsstatsv1_p)->srvclients++; nfsrv_openpluslock++; nfsrv_clients++; - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); - if (zapit) + nfsrv_clientunlock(mlocked); + if (zapit != 0) { + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); nfsrv_zapclient(clp, p); + } *new_clpp = NULL; goto out; } @@ -383,7 +425,10 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ if (clp->lc_expiry < NFSD_MONOSEC && (!LIST_EMPTY(&clp->lc_open) || !LIST_EMPTY(&clp->lc_deleg))) { - nfsrv_cleanclient(clp, p, false, NULL); + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); } @@ -428,9 +473,9 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, break; #endif } - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); error = NFSERR_CLIDINUSE; goto out; } @@ -444,13 +489,7 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, */ LIST_REMOVE(clp, lc_hash); - /* Get rid of all sessions on this clientid. */ - LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) { - ret = nfsrv_freesession(sep, NULL, false, NULL); - if (ret != 0) - printf("nfsrv_setclient: verifier changed free" - " session failed=%d\n", ret); - } + LIST_NEWHEAD(&old_sess, &clp->lc_session, sess_list); new_clp->lc_flags |= LCL_NEEDSCONFIRM; if ((nd->nd_flag & ND_NFSV41) != 0) { @@ -494,21 +533,31 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, NFSD_VNET(nfsstatsv1_p)->srvclients++; nfsrv_openpluslock++; nfsrv_clients++; - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + if (!mlocked) { + nfsrv_clientunlock(mlocked); + NFSLOCKSTATE(); + } /* * Must wait until any outstanding callback on the old clp * completes. */ - NFSLOCKSTATE(); while (clp->lc_cbref) { clp->lc_flags |= LCL_WAKEUPWANTED; (void)mtx_sleep(clp, NFSSTATEMUTEXPTR, PZERO - 1, "nfsd clp", 10 * hz); } NFSUNLOCKSTATE(); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); + /* Get rid of all sessions on this clientid. */ + LIST_FOREACH_SAFE(sep, &old_sess, sess_list, nsep) { + ret = nfsrv_freesession(sep, NULL, false, NULL); + if (ret != 0) + printf("nfsrv_setclient: verifier changed free" + " session failed=%d\n", ret); + } + nfsrv_zapclient(clp, p); *new_clpp = NULL; goto out; @@ -560,24 +609,31 @@ nfsrv_setclient(struct nfsrv_descript *nd, struct nfsclient **new_clpp, nfsrv_openpluslock++; nfsrv_clients++; } - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + if (!mlocked) + nfsrv_clientunlock(mlocked); if ((nd->nd_flag & ND_NFSV41) == 0) { /* * Must wait until any outstanding callback on the old clp * completes. */ - NFSLOCKSTATE(); + if (!mlocked) + NFSLOCKSTATE(); while (clp->lc_cbref) { clp->lc_flags |= LCL_WAKEUPWANTED; (void)mtx_sleep(clp, NFSSTATEMUTEXPTR, PZERO - 1, "nfsdclp", 10 * hz); } NFSUNLOCKSTATE(); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); nfsrv_zapclient(clp, p); *new_clpp = NULL; + } else { + if (mlocked) + NFSUNLOCKSTATE(); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); } out: @@ -597,11 +653,13 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, struct nfsstate *stp; int i; struct nfsclienthashhead *hp; - int error = 0, igotlock, doneok; + int error = 0, doneok, igotlock; struct nfssessionhash *shp; struct nfsdsession *sep; uint64_t sessid[2]; - bool sess_replay; + CLIENT *client; + SVCXPRT *old_xprt; + bool mlocked, sess_replay; static uint64_t next_sess = 0; if (clpp) @@ -618,13 +676,27 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, * already held. Otherwise, we need to get either that or, * for the case of Confirm, lock out the nfsd threads. */ + client = NULL; + old_xprt = NULL; + mlocked = true; + if (nfsrv_dolocallocks != 0) + mlocked = false; if (opflags & CLOPS_CONFIRM) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_relref(&nfsv4rootfs_lock); - do { - igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, - NFSV4ROOTLOCKMUTEXPTR, NULL); - } while (!igotlock); + if (nsep != NULL && + (nsep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0) + client = (struct __rpc_client *) + clnt_bck_create(nd->nd_xprt->xp_socket, + cbprogram, NFSV4_CBVERS); + if (mlocked) { + nfsrv_clientlock(mlocked); + } else { + NFSLOCKV4ROOTMUTEX(); + nfsv4_relref(&nfsv4rootfs_lock); + do { + igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, + NULL, NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (!igotlock); + } /* * Create a new sessionid here, since we need to do it where * there is a mutex held to serialize update of next_sess. @@ -633,7 +705,8 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, sessid[0] = ++next_sess; sessid[1] = clientid.qval; } - NFSUNLOCKV4ROOTMUTEX(); + if (!mlocked) + NFSUNLOCKV4ROOTMUTEX(); } else if (opflags != CLOPS_RENEW) { NFSLOCKSTATE(); } @@ -670,9 +743,9 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, } if (error) { if (opflags & CLOPS_CONFIRM) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (client != NULL) + CLNT_RELEASE(client); } else if (opflags != CLOPS_RENEW) { NFSUNLOCKSTATE(); } @@ -716,7 +789,10 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, * for an Open with CLAIM_DELEGATE_PREV unless in * grace, but get rid of the rest of the state. */ - nfsrv_cleanclient(clp, p, false, NULL); + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_olddeleg); if (nfsrv_checkgrace(nd, clp, 0)) { /* In grace, so just delete delegations */ @@ -740,10 +816,10 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, /* Hold a reference on the xprt for a backchannel. */ if ((nsep->sess_crflags & NFSV4CRSESS_CONNBACKCHAN) != 0 && !sess_replay) { - if (clp->lc_req.nr_client == NULL) - clp->lc_req.nr_client = (struct __rpc_client *) - clnt_bck_create(nd->nd_xprt->xp_socket, - cbprogram, NFSV4_CBVERS); + if (clp->lc_req.nr_client == NULL) { + clp->lc_req.nr_client = client; + client = NULL; + } if (clp->lc_req.nr_client != NULL) { SVC_ACQUIRE(nd->nd_xprt); CLNT_ACQUIRE(clp->lc_req.nr_client); @@ -760,13 +836,15 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, NFSX_V4SESSIONID); if (!sess_replay) { shp = NFSSESSIONHASH(nsep->sess_sessionid); - NFSLOCKSTATE(); + if (!mlocked) + NFSLOCKSTATE(); NFSLOCKSESSION(shp); LIST_INSERT_HEAD(&shp->list, nsep, sess_hash); LIST_INSERT_HEAD(&clp->lc_session, nsep, sess_list); nsep->sess_clp = clp; NFSUNLOCKSESSION(shp); - NFSUNLOCKSTATE(); + if (!mlocked) + NFSUNLOCKSTATE(); } } } @@ -800,9 +878,11 @@ nfsrv_getclient(nfsquad_t clientid, int opflags, struct nfsclient **clpp, clp->lc_expiry = nfsrv_leaseexpiry(); } if (opflags & CLOPS_CONFIRM) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (client != NULL) + CLNT_RELEASE(client); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); } else if (opflags != CLOPS_RENEW) { NFSUNLOCKSTATE(); } @@ -822,21 +902,20 @@ nfsrv_destroyclient(nfsquad_t clientid, NFSPROC_T *p) { struct nfsclient *clp; struct nfsclienthashhead *hp; - int error = 0, i, igotlock; + SVCXPRT *old_xprt; + int error = 0, i; + bool mlocked; if (NFSD_VNET(nfsrvboottime) != clientid.lval[0]) { error = NFSERR_STALECLIENTID; goto out; } + mlocked = true; + if (nfsrv_dolocallocks != 0) + mlocked = false; /* Lock out other nfsd threads */ - NFSLOCKV4ROOTMUTEX(); - nfsv4_relref(&nfsv4rootfs_lock); - do { - igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, - NFSV4ROOTLOCKMUTEXPTR, NULL); - } while (igotlock == 0); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientlock(mlocked); hp = NFSCLIENTHASH(clientid); LIST_FOREACH(clp, hp, lc_hash) { @@ -844,9 +923,7 @@ nfsrv_destroyclient(nfsquad_t clientid, NFSPROC_T *p) break; } if (clp == NULL) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); /* Just return ok, since it is gone. */ goto out; } @@ -860,28 +937,28 @@ nfsrv_destroyclient(nfsquad_t clientid, NFSPROC_T *p) /* Scan for state on the clientid. */ for (i = 0; i < nfsrv_statehashsize; i++) if (!LIST_EMPTY(&clp->lc_stateid[i])) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); error = NFSERR_CLIENTIDBUSY; goto out; } if (!LIST_EMPTY(&clp->lc_session) || !LIST_EMPTY(&clp->lc_deleg)) { - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); error = NFSERR_CLIENTIDBUSY; goto out; } /* Destroy the clientid and return ok. */ - nfsrv_cleanclient(clp, p, false, NULL); + old_xprt = NULL; + if (mlocked) + nfsrv_cleanclient(clp, p, true, &old_xprt); + else + nfsrv_cleanclient(clp, p, false, NULL); nfsrv_freedeleglist(&clp->lc_deleg); nfsrv_freedeleglist(&clp->lc_olddeleg); LIST_REMOVE(clp, lc_hash); - NFSLOCKV4ROOTMUTEX(); - nfsv4_unlock(&nfsv4rootfs_lock, 1); - NFSUNLOCKV4ROOTMUTEX(); + nfsrv_clientunlock(mlocked); + if (old_xprt != NULL) + SVC_RELEASE(old_xprt); nfsrv_zapclient(clp, p); out: NFSEXITCODE2(error, nd); @@ -1370,8 +1447,12 @@ nfsrv_cleanclient(struct nfsclient *clp, NFSPROC_T *p, bool locked, struct nfsstate *stp, *nstp; struct nfsdsession *sep, *nsep; - LIST_FOREACH_SAFE(stp, &clp->lc_open, ls_list, nstp) - nfsrv_freeopenowner(stp, 1, p); + LIST_FOREACH_SAFE(stp, &clp->lc_open, ls_list, nstp) { + if (locked) + nfsrv_freeopenowner(stp, 0, p); + else + nfsrv_freeopenowner(stp, 1, p); + } if ((clp->lc_flags & LCL_ADMINREVOKED) == 0) LIST_FOREACH_SAFE(sep, &clp->lc_session, sess_list, nsep) (void)nfsrv_freesession(sep, NULL, locked, old_xprtp); From nobody Tue Jul 23 00:30:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSdNd64jkz5QVtL; Tue, 23 Jul 2024 00:30: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSdNd5XlNz3yBc; Tue, 23 Jul 2024 00:30:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721694657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IgnblNA3ahz+0pmD9Aw6hvf92xfAW2eYDRZciB9PRYw=; b=MSHNr1+vPYPe89a6OMjVMX/VSsQRqZZSEbI//MhmG3BfKI+UgBjPvrm0LpJt1vlFE5sLXJ QDZzuTE2gvm+Atapa7GP0TMcOorbWMYsixQaB9jNuFLlXFVSMmKDNBcxyGGFOaXEL2KqP7 sP99S+ZtqltTbU9u9RaI1PzctqIRJaYm/B55heOZH49xpgde6zjKJkzkIgOAq4bbxuUq4j QlOmSbIvwjhvMuC/HupRsbQCakQKoO2keK0NgBlKOSp34Og4OZ28N34aaf7jzszd8P9Kw/ ILH982qFO0EpgEpjFd49EjwTpMQqbH9ISIy/DXtw9OjaKBFq2wWLJqkNQbh42g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721694657; a=rsa-sha256; cv=none; b=QSB7T+s7yw9ucAX2xEHwFwZ7QzvsPatUjFYc27r0qGyXnid+jVj/0U1coQgr2xXUWJmTTC C5m8AIFPS4f/5MH5+APtZcwAlKZt+dTrN0wmUCJ2ITNPuHMmGSfm79fN2Rg9C1FdkYW0nQ V5VNy9h/N0r6AvfShS39oTZSFdDOIhsR0uYUIbRvZz62Vn3qWc2PQlM5+Us0MrBBg6kJck kdMxXu0S0fmFb8CQUsOv2d+NbmTm01xPW+X0/Jamd0k1g+9V5hmSxfPt4g92bqMRIAECJ8 7RYMYdKdwvDJvT1fJgYyyziA29yrf3QABF90S+E6ct48xwd0vbKQQ1DQ3vYcmQ== 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=1721694657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IgnblNA3ahz+0pmD9Aw6hvf92xfAW2eYDRZciB9PRYw=; b=BiSDYwdqfwxTKSh4EN/iMuNxVj/cBtBrQdQzlBfPiTnH5aJm3UDRd6kKaqtUtvvXtRZXyi 4woNguKKySe2nM2oaJjTDx1aCL/77BgQdfQGONFgbfmkfRFua97dRFB9e7PvLTjZ5WZfg5 ko1eC5G2tGG1kpLWPd7xRRFEVaJKPifO1bGfqLsyEfz8Jix3wz6M1jsZYgdT5O/jQT6rVj tds+eRu1DzJ1nZ6choQJLoKVT+xkOukrhl2xrCjNloBWx1qFd26a8UTDBKWY4m8hzvvhqr a0E80nULY8mwUV6yxxgN/DuZSCmiDzTgdGDgYQf01nbPSDhX3tn1fUmsXK5egw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSdNd57qnz169S; Tue, 23 Jul 2024 00:30:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46N0UvhZ008842; Tue, 23 Jul 2024 00:30:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46N0Uvm0008839; Tue, 23 Jul 2024 00:30:57 GMT (envelope-from git) Date: Tue, 23 Jul 2024 00:30:57 GMT Message-Id: <202407230030.46N0Uvm0008839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: d5ae681d2e74 - stable/14 - nfsd: Make modifying vfs.nfsd.enable_locallocks safe List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d5ae681d2e747e28076f670ca2b3deb27b00acf6 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=d5ae681d2e747e28076f670ca2b3deb27b00acf6 commit d5ae681d2e747e28076f670ca2b3deb27b00acf6 Author: Rick Macklem AuthorDate: 2024-06-23 22:47:22 +0000 Commit: Rick Macklem CommitDate: 2024-07-23 00:29:54 +0000 nfsd: Make modifying vfs.nfsd.enable_locallocks safe Commit dfaeeacc2cc2 modified clientID handling so that it could be done with only a mutex lock held when vfs.nfsd.enable_locallocks is 0. This makes it unsafe to change the setting of vfs.nfsd.enable_locallocks when nfsd threads are active. This patch forces all nfsd threads to be blocked when the value of vfs.nfsd.enable_locallocks is changed, so that it is done safely. (cherry picked from commit 67284d32e5e0d5f015d73eeac4342974277263f5) --- sys/fs/nfsserver/nfs_nfsdport.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index f4679309657b..3769fdc4ff73 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -70,6 +70,7 @@ extern int nfsrv_maxpnfsmirror; extern uint32_t nfs_srvmaxio; extern int nfs_bufpackets; extern u_long sb_max_adj; +extern struct nfsv4lock nfsv4rootfs_lock; NFSD_VNET_DECLARE(int, nfsrv_numnfsd); NFSD_VNET_DECLARE(struct nfsrv_stablefirst, nfsrv_stablefirst); @@ -179,8 +180,6 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, commit_miss, CTLFLAG_RW, &nfs_commit_miss, 0, ""); SYSCTL_INT(_vfs_nfsd, OID_AUTO, issue_delegations, CTLFLAG_RW, &nfsrv_issuedelegs, 0, "Enable nfsd to issue delegations"); -SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_locallocks, CTLFLAG_RW, - &nfsrv_dolocallocks, 0, "Enable nfsd to acquire local locks on files"); SYSCTL_INT(_vfs_nfsd, OID_AUTO, debuglevel, CTLFLAG_RW, &nfsd_debuglevel, 0, "Debug level for NFS server"); NFSD_VNET_DECLARE(int, nfsd_enable_stringtouid); @@ -295,6 +294,38 @@ SYSCTL_PROC(_vfs_nfsd, OID_AUTO, srvmaxio, CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_srvmaxio, "IU", "Maximum I/O size in bytes"); +static int +sysctl_dolocallocks(SYSCTL_HANDLER_ARGS) +{ + int error, igotlock, newdolocallocks; + + newdolocallocks = nfsrv_dolocallocks; + error = sysctl_handle_int(oidp, &newdolocallocks, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (newdolocallocks == nfsrv_dolocallocks) + return (0); + if (jailed(curthread->td_ucred)) + return (EINVAL); + + NFSLOCKV4ROOTMUTEX(); + do { + igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, + NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (!igotlock); + NFSUNLOCKV4ROOTMUTEX(); + + nfsrv_dolocallocks = newdolocallocks; + + NFSLOCKV4ROOTMUTEX(); + nfsv4_unlock(&nfsv4rootfs_lock, 0); + NFSUNLOCKV4ROOTMUTEX(); + return (0); +} +SYSCTL_PROC(_vfs_nfsd, OID_AUTO, enable_locallocks, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, + sysctl_dolocallocks, "IU", "Enable nfsd to acquire local locks on files"); + #define MAX_REORDERED_RPC 16 #define NUM_HEURISTIC 1031 #define NHUSE_INIT 64 From nobody Tue Jul 23 00:55:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSdws5bJ6z5QYQP; Tue, 23 Jul 2024 00:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSdws51rZz42XY; Tue, 23 Jul 2024 00:55:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721696125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/wceRLETung1fifr5VeAfDAkSPFeLltQjx4NVrwQ9f0=; b=JMYM6dr7nbzmGJ5DfSI7LlxTeU86I+iibq0CdhwNdYY1TLuHxBJGWj5CRyaIsKyybN/PLW eD3Xvd1o3vvsXVGOJZz44a0X5G/BFTDA9zpbLCbBG2GGAKhRkUnyYlNODJZqff7oCNuFAi um2sU9G1KT6woeKXsVvvSDO/ugRZS/0ps7llczC7OpHdU7ZJ5Z8PIrGyxS/Vg5z5ZH1/6G 46yP6D7itNUSPOex66d/y+QIsSm+AVy/S8c5FK2+50kAJteiR9uV0wKp5VxbiPyxIsPnKd lqh6B5KU4b4mnKFkJF76U5IHWWL1oDjNogOYNqLsb0IFiky2qfKTa9fEOgvAJg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721696125; a=rsa-sha256; cv=none; b=WSMurWAeSsQL2XPo8RKAIuOXVlDNBdldcGNKPiLV1F0pf2B5Vy1dpLV0jK2wzrHZr3abik JMpEaIPSlAwFLSCMFKzNBCAayhs9MQAKiHZeQXIDi+sIr67DaGnpHNn/WwR3qdhrPuxtlM SxVeUfYQejR6pxlbqmJ/BarOJpHi6o/GHD9/cdDa6LM8+P6iaJyN/HCL/yWH8CMFYVk/bl fUW4ekSbSMnSkUVpH3nvT02qFXqWBkAXIs1mOKJMAP4FdvJW9sqVB8Aty7tWB60g+jJ5+0 XiAifLQd27D9iQuQpbCW+Ck5lfalUe68BQAN1NQNOoscTCpTAp3ojaP4ExyfvQ== 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=1721696125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/wceRLETung1fifr5VeAfDAkSPFeLltQjx4NVrwQ9f0=; b=w8ITWNL7HXQYP58ouImhej5zrIv2V4Y9nmyB5iig6dPZUiLkXdOLkbyl/LDHIPmqemDQqH zkThShDkYz0Ra3yJFWJJnMKBGXDA55c/8lCmYKgq3LT+c3cyLsH4PVkYKqQWEoNYZ6HkCZ xltruzfQMsi4qa9ZEkRJdu4zx5iyo7l7zQshGzvXZXIkIaphINZJYsIsEM2ueUosJixhvg 4B5qDmh/v3WPnIBcCSxN7X9NdFdTs8YhgrpI20J7GGmz31U41vUdbHeFgx7rJhg6eioyah SWb+PV/WxcPDoym8Y/neTBVkdjz1rO+RVRqqJZOmm+q/xLDAvbXivQGFfhl4Xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSdws4QbZz16Cd; Tue, 23 Jul 2024 00:55:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46N0tP0P050588; Tue, 23 Jul 2024 00:55:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46N0tP28050585; Tue, 23 Jul 2024 00:55:25 GMT (envelope-from git) Date: Tue, 23 Jul 2024 00:55:25 GMT Message-Id: <202407230055.46N0tP28050585@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: f84ac01e1829 - stable/13 - nfsd: Make modifying vfs.nfsd.enable_locallocks safe List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f84ac01e1829a6f3e48af076041120692c00ccb0 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f84ac01e1829a6f3e48af076041120692c00ccb0 commit f84ac01e1829a6f3e48af076041120692c00ccb0 Author: Rick Macklem AuthorDate: 2024-06-23 22:47:22 +0000 Commit: Rick Macklem CommitDate: 2024-07-23 00:35:02 +0000 nfsd: Make modifying vfs.nfsd.enable_locallocks safe Commit dfaeeacc2cc2 modified clientID handling so that it could be done with only a mutex lock held when vfs.nfsd.enable_locallocks is 0. This makes it unsafe to change the setting of vfs.nfsd.enable_locallocks when nfsd threads are active. This patch forces all nfsd threads to be blocked when the value of vfs.nfsd.enable_locallocks is changed, so that it is done safely. (cherry picked from commit 67284d32e5e0d5f015d73eeac4342974277263f5) --- sys/fs/nfsserver/nfs_nfsdport.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 46be3e051056..f412451e4e35 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -70,6 +70,7 @@ extern int nfsrv_maxpnfsmirror; extern uint32_t nfs_srvmaxio; extern int nfs_bufpackets; extern u_long sb_max_adj; +extern struct nfsv4lock nfsv4rootfs_lock; NFSD_VNET_DECLARE(int, nfsrv_numnfsd); NFSD_VNET_DECLARE(struct nfsrv_stablefirst, nfsrv_stablefirst); @@ -177,8 +178,6 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, commit_miss, CTLFLAG_RW, &nfs_commit_miss, 0, ""); SYSCTL_INT(_vfs_nfsd, OID_AUTO, issue_delegations, CTLFLAG_RW, &nfsrv_issuedelegs, 0, "Enable nfsd to issue delegations"); -SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_locallocks, CTLFLAG_RW, - &nfsrv_dolocallocks, 0, "Enable nfsd to acquire local locks on files"); SYSCTL_INT(_vfs_nfsd, OID_AUTO, debuglevel, CTLFLAG_RW, &nfsd_debuglevel, 0, "Debug level for NFS server"); NFSD_VNET_DECLARE(int, nfsd_enable_stringtouid); @@ -293,6 +292,38 @@ SYSCTL_PROC(_vfs_nfsd, OID_AUTO, srvmaxio, CTLTYPE_UINT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, sysctl_srvmaxio, "IU", "Maximum I/O size in bytes"); +static int +sysctl_dolocallocks(SYSCTL_HANDLER_ARGS) +{ + int error, igotlock, newdolocallocks; + + newdolocallocks = nfsrv_dolocallocks; + error = sysctl_handle_int(oidp, &newdolocallocks, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + if (newdolocallocks == nfsrv_dolocallocks) + return (0); + if (jailed(curthread->td_ucred)) + return (EINVAL); + + NFSLOCKV4ROOTMUTEX(); + do { + igotlock = nfsv4_lock(&nfsv4rootfs_lock, 1, NULL, + NFSV4ROOTLOCKMUTEXPTR, NULL); + } while (!igotlock); + NFSUNLOCKV4ROOTMUTEX(); + + nfsrv_dolocallocks = newdolocallocks; + + NFSLOCKV4ROOTMUTEX(); + nfsv4_unlock(&nfsv4rootfs_lock, 0); + NFSUNLOCKV4ROOTMUTEX(); + return (0); +} +SYSCTL_PROC(_vfs_nfsd, OID_AUTO, enable_locallocks, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, NULL, 0, + sysctl_dolocallocks, "IU", "Enable nfsd to acquire local locks on files"); + #define MAX_REORDERED_RPC 16 #define NUM_HEURISTIC 1031 #define NHUSE_INIT 64 From nobody Tue Jul 23 09:52:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSsr74ckZz5RdxN; Tue, 23 Jul 2024 09:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSsr74B98z4tnL; Tue, 23 Jul 2024 09:52:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721728327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YMfyr7+eIjhlsJLzEugHlmQDuVLF+vQAhJDO42gyit4=; b=Fwg56+9VUHp0+xNDOe8Pz7Na6UzQYwg4Fbkhq/bqsNi4And23K9UE6RSLeUOfimYrq5dL9 9hBS3u3TW2HteiNrPL0TLGV5AmtAgnqJ5Yx1DUoj4OH8RqvGB2sO/qfttiYrfrVrt2e5/x RuQlf82H/Y8NE7RAgspY4uHescVVswsrlfCSwrCusVFudQIuJ/kALf3i6QcXUhFMraZ5+N nqrYDW9FBduhk/2mGRjaNoKCpX/UXDJDkGdkXV0gF/m4yKgqTl2lya+oaeEDjUBzTEbFKj +p5bYp25ERYD4+MnGcSpG63AqNeZcihQZV9xbGDGbDjBivXCkNnFUOqpxDXKDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721728327; a=rsa-sha256; cv=none; b=nQOsxVqykkjH3lDUpgbyHTVbbL2VkC6+l/dh5Ib8gKRUkn8wPJtKyk1n1fDTqv3Fq/Bl0C EVDAYj/O0dkkCcEif9WyCeT5c7VRpyiFLR2rq3QndeSGpfRalRHb/c6C0NSjNl7Owxafuy UtcfYhyfbrQFfOOQwFXv5kQyVk29AI5HPCHWJTWEzTaexZ90LQws6AIkHdNjZm4iWq2iWX wfTtoEH/INFvRwNdxHrocP0UPp0EAhEUc3w8BeC2eaKIx3lcli4BerW+LyrBaSQFSlyg4N Yb7vzs25EglKefkWQj/XT1cggJ+HJN/GUGf3cEHOIE9AFj2gka3K+chbMbPxKA== 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=1721728327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YMfyr7+eIjhlsJLzEugHlmQDuVLF+vQAhJDO42gyit4=; b=xh9LaWfXBij4G9+6kG2Bj1Kd2IR8wKKwApLwB5dc0dmw13FkWSfYugJmosUazURYvDO6Xv uEFM+WqtWH9/L7EfZLu360a13VnI+zFpgCAFNIvKDddnWuZtwRnqnxxfB0UW23eXbtytAf ojIZ588qiLkmU8ljT0e6j4roTxC6mq1SWH6zmeZWiIGpgxFQuYd4mIfBnQaBCOFC+q3SDU vmRvNMqt3LrQMRDtw+q0jX5P59K12/2bA+ZPBsiQ2KCSTM4j1ajheFmgl6ur5+wpgkT4WB 2UjkSqF8JfbY+H30++rMMM7+cuIXd5G0Wkw6OJ3F49aTbZ2TqxUOT/LQNdVIAw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSsr73njPzNZt; Tue, 23 Jul 2024 09:52:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46N9q7QT060987; Tue, 23 Jul 2024 09:52:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46N9q7jY060984; Tue, 23 Jul 2024 09:52:07 GMT (envelope-from git) Date: Tue, 23 Jul 2024 09:52:07 GMT Message-Id: <202407230952.46N9q7jY060984@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 47361851bc2e - main - arm64: Add EL1 and EL12 register alt names List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 47361851bc2e292bd7c723ba5f57792a7794f1b4 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=47361851bc2e292bd7c723ba5f57792a7794f1b4 commit 47361851bc2e292bd7c723ba5f57792a7794f1b4 Author: Andrew Turner AuthorDate: 2024-07-23 09:17:52 +0000 Commit: Andrew Turner CommitDate: 2024-07-23 09:25:05 +0000 arm64: Add EL1 and EL12 register alt names When adding VHE support we may need to access these registers using the _EL12 or _EL1 name depending on if VHE is enabled or not. Add the registers we will likely need to access from VHE so these can be updated in the guest switcher code. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45525 --- sys/arm64/include/armreg.h | 222 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 222 insertions(+) diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 194731c98902..b2ab472dad0d 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -77,6 +77,54 @@ #define UL(x) UINT64_C(x) +/* AFSR0_EL1 - Auxiliary Fault Status Register 0 */ +#define AFSR0_EL1_REG MRS_REG_ALT_NAME(AFSR0_EL1) +#define AFSR0_EL1_op0 3 +#define AFSR0_EL1_op1 0 +#define AFSR0_EL1_CRn 5 +#define AFSR0_EL1_CRm 1 +#define AFSR0_EL1_op2 0 + +/* AFSR0_EL12 */ +#define AFSR0_EL12_REG MRS_REG_ALT_NAME(AFSR0_EL12) +#define AFSR0_EL12_op0 3 +#define AFSR0_EL12_op1 5 +#define AFSR0_EL12_CRn 5 +#define AFSR0_EL12_CRm 1 +#define AFSR0_EL12_op2 0 + +/* AFSR1_EL1 - Auxiliary Fault Status Register 1 */ +#define AFSR1_EL1_REG MRS_REG_ALT_NAME(AFSR1_EL1) +#define AFSR1_EL1_op0 3 +#define AFSR1_EL1_op1 0 +#define AFSR1_EL1_CRn 5 +#define AFSR1_EL1_CRm 1 +#define AFSR1_EL1_op2 1 + +/* AFSR1_EL12 */ +#define AFSR1_EL12_REG MRS_REG_ALT_NAME(AFSR1_EL12) +#define AFSR1_EL12_op0 3 +#define AFSR1_EL12_op1 5 +#define AFSR1_EL12_CRn 5 +#define AFSR1_EL12_CRm 1 +#define AFSR1_EL12_op2 1 + +/* AMAIR_EL1 - Auxiliary Memory Attribute Indirection Register */ +#define AMAIR_EL1_REG MRS_REG_ALT_NAME(AMAIR_EL1) +#define AMAIR_EL1_op0 3 +#define AMAIR_EL1_op1 0 +#define AMAIR_EL1_CRn 10 +#define AMAIR_EL1_CRm 3 +#define AMAIR_EL1_op2 0 + +/* AMAIR_EL12 */ +#define AMAIR_EL12_REG MRS_REG_ALT_NAME(AMAIR_EL12) +#define AMAIR_EL12_op0 3 +#define AMAIR_EL12_op1 5 +#define AMAIR_EL12_CRn 10 +#define AMAIR_EL12_CRm 3 +#define AMAIR_EL12_op2 0 + /* APDAKeyHi_EL1 */ #define APDAKeyHi_EL1_REG MRS_REG_ALT_NAME(APDAKeyHi_EL1) #define APDAKeyHi_EL1_op0 3 @@ -227,7 +275,21 @@ #define CONTEXTIDR_EL1_CRm 0 #define CONTEXTIDR_EL1_op2 1 +/* CONTEXTIDR_EL12 */ +#define CONTEXTIDR_EL12_REG MRS_REG_ALT_NAME(CONTEXTIDR_EL12) +#define CONTEXTIDR_EL12_op0 3 +#define CONTEXTIDR_EL12_op1 5 +#define CONTEXTIDR_EL12_CRn 13 +#define CONTEXTIDR_EL12_CRm 0 +#define CONTEXTIDR_EL12_op2 1 + /* CPACR_EL1 */ +#define CPACR_EL1_REG MRS_REG_ALT_NAME(CPACR_EL1) +#define CPACR_EL1_op0 3 +#define CPACR_EL1_op1 0 +#define CPACR_EL1_CRn 1 +#define CPACR_EL1_CRm 0 +#define CPACR_EL1_op2 2 #define CPACR_ZEN_MASK (0x3 << 16) #define CPACR_ZEN_TRAP_ALL1 (0x0 << 16) /* Traps from EL0 and EL1 */ #define CPACR_ZEN_TRAP_EL0 (0x1 << 16) /* Traps from EL0 */ @@ -240,6 +302,14 @@ #define CPACR_FPEN_TRAP_NONE (0x3 << 20) /* No traps */ #define CPACR_TTA (0x1 << 28) +/* CPACR_EL12 */ +#define CPACR_EL12_REG MRS_REG_ALT_NAME(CPACR_EL12) +#define CPACR_EL12_op0 3 +#define CPACR_EL12_op1 5 +#define CPACR_EL12_CRn 1 +#define CPACR_EL12_CRm 0 +#define CPACR_EL12_op2 2 + /* CSSELR_EL1 - Cache size selection register */ #define CSSELR_Level(i) (i << 1) #define CSSELR_InD 0x00000001 @@ -396,6 +466,22 @@ #define DBGPRCR_EL1_CRm 4 #define DBGPRCR_EL1_op2 4 +/* ELR_EL1 */ +#define ELR_EL1_REG MRS_REG_ALT_NAME(ELR_EL1) +#define ELR_EL1_op0 3 +#define ELR_EL1_op1 0 +#define ELR_EL1_CRn 4 +#define ELR_EL1_CRm 0 +#define ELR_EL1_op2 1 + +/* ELR_EL12 */ +#define ELR_EL12_REG MRS_REG_ALT_NAME(ELR_EL12) +#define ELR_EL12_op0 3 +#define ELR_EL12_op1 5 +#define ELR_EL12_CRn 4 +#define ELR_EL12_CRm 0 +#define ELR_EL12_op2 1 + /* ESR_ELx */ #define ESR_ELx_ISS_MASK 0x01ffffff #define ISS_FP_TFV_SHIFT 23 @@ -536,6 +622,38 @@ #define EXCP_BRKPT_32 0x38 /* 32bits breakpoint */ #define EXCP_BRK 0x3c /* Breakpoint */ +/* ESR_EL1 */ +#define ESR_EL1_REG MRS_REG_ALT_NAME(ESR_EL1) +#define ESR_EL1_op0 3 +#define ESR_EL1_op1 0 +#define ESR_EL1_CRn 5 +#define ESR_EL1_CRm 2 +#define ESR_EL1_op2 1 + +/* ESR_EL12 */ +#define ESR_EL12_REG MRS_REG_ALT_NAME(ESR_EL12) +#define ESR_EL12_op0 3 +#define ESR_EL12_op1 5 +#define ESR_EL12_CRn 5 +#define ESR_EL12_CRm 2 +#define ESR_EL12_op2 0 + +/* FAR_EL1 */ +#define FAR_EL1_REG MRS_REG_ALT_NAME(FAR_EL1) +#define FAR_EL1_op0 3 +#define FAR_EL1_op1 0 +#define FAR_EL1_CRn 6 +#define FAR_EL1_CRm 0 +#define FAR_EL1_op2 0 + +/* FAR_EL12 */ +#define FAR_EL12_REG MRS_REG_ALT_NAME(FAR_EL12) +#define FAR_EL12_op0 3 +#define FAR_EL12_op1 5 +#define FAR_EL12_CRn 6 +#define FAR_EL12_CRm 0 +#define FAR_EL12_op2 0 + /* ICC_CTLR_EL1 */ #define ICC_CTLR_EL1_EOIMODE (1U << 1) @@ -1505,6 +1623,12 @@ #define ID_ISAR5_VCMA_IMPL (UL(0x1) << ID_ISAR5_VCMA_SHIFT) /* MAIR_EL1 - Memory Attribute Indirection Register */ +#define MAIR_EL1_REG MRS_REG_ALT_NAME(MAIR_EL1) +#define MAIR_EL1_op0 3 +#define MAIR_EL1_op1 0 +#define MAIR_EL1_CRn 10 +#define MAIR_EL1_CRm 2 +#define MAIR_EL1_op2 0 #define MAIR_ATTR_MASK(idx) (UL(0xff) << ((n)* 8)) #define MAIR_ATTR(attr, idx) ((attr) << ((idx) * 8)) #define MAIR_DEVICE_nGnRnE UL(0x00) @@ -1513,6 +1637,14 @@ #define MAIR_NORMAL_WT UL(0xbb) #define MAIR_NORMAL_WB UL(0xff) +/* MAIR_EL12 */ +#define MAIR_EL12_REG MRS_REG_ALT_NAME(MAIR_EL12) +#define MAIR_EL12_op0 3 +#define MAIR_EL12_op1 5 +#define MAIR_EL12_CRn 10 +#define MAIR_EL12_CRm 2 +#define MAIR_EL12_op2 0 + /* MDCCINT_EL1 */ #define MDCCINT_EL1 MRS_REG(MDCCINT_EL1) #define MDCCINT_EL1_op0 2 @@ -2124,6 +2256,12 @@ #define RNDRRS_op2 1 /* SCTLR_EL1 - System Control Register */ +#define SCTLR_EL1_REG MRS_REG_ALT_NAME(SCTLR_EL1) +#define SCTLR_EL1_op0 3 +#define SCTLR_EL1_op1 0 +#define SCTLR_EL1_CRn 1 +#define SCTLR_EL1_CRm 0 +#define SCTLR_EL1_op2 0 #define SCTLR_RES1 0x30d00800 /* Reserved ARMv8.0, write 1 */ #define SCTLR_M (UL(0x1) << 0) #define SCTLR_A (UL(0x1) << 1) @@ -2174,7 +2312,21 @@ #define SCTLR_EnALS (UL(0x1) << 56) #define SCTLR_EPAN (UL(0x1) << 57) +/* SCTLR_EL12 */ +#define SCTLR_EL12_REG MRS_REG_ALT_NAME(SCTLR_EL12) +#define SCTLR_EL12_op0 3 +#define SCTLR_EL12_op1 5 +#define SCTLR_EL12_CRn 1 +#define SCTLR_EL12_CRm 0 +#define SCTLR_EL12_op2 0 + /* SPSR_EL1 */ +#define SPSR_EL1_REG MRS_REG_ALT_NAME(SPSR_EL1) +#define SPSR_EL1_op0 3 +#define SPSR_EL1_op1 0 +#define SPSR_EL1_CRn 4 +#define SPSR_EL1_CRm 0 +#define SPSR_EL1_op2 0 /* * When the exception is taken in AArch64: * M[3:2] is the exception level @@ -2220,6 +2372,14 @@ #define PSR_SETTABLE_32 PSR_FLAGS #define PSR_SETTABLE_64 (PSR_FLAGS | PSR_SS) +/* SPSR_EL12 */ +#define SPSR_EL12_REG MRS_REG_ALT_NAME(SPSR_EL12) +#define SPSR_EL12_op0 3 +#define SPSR_EL12_op1 5 +#define SPSR_EL12_CRn 4 +#define SPSR_EL12_CRm 0 +#define SPSR_EL12_op2 0 + /* REVIDR_EL1 - Revision ID Register */ #define REVIDR_EL1 MRS_REG(REVIDR_EL1) #define REVIDR_EL1_op0 3 @@ -2229,6 +2389,12 @@ #define REVIDR_EL1_op2 6 /* TCR_EL1 - Translation Control Register */ +#define TCR_EL1_REG MRS_REG_ALT_NAME(TCR_EL1) +#define TCR_EL1_op0 3 +#define TCR_EL1_op1 0 +#define TCR_EL1_CRn 2 +#define TCR_EL1_CRm 0 +#define TCR_EL1_op2 2 /* Bits 63:59 are reserved */ #define TCR_TCMA1_SHIFT 58 #define TCR_TCMA1 (UL(1) << TCR_TCMA1_SHIFT) @@ -2335,6 +2501,14 @@ #define TCR_SMP_ATTRS 0 #endif +/* TCR_EL12 */ +#define TCR_EL12_REG MRS_REG_ALT_NAME(TCR_EL12) +#define TCR_EL12_op0 3 +#define TCR_EL12_op1 5 +#define TCR_EL12_CRn 2 +#define TCR_EL12_CRm 0 +#define TCR_EL12_op2 2 + /* TTBR0_EL1 & TTBR1_EL1 - Translation Table Base Register 0 & 1 */ #define TTBR_ASID_SHIFT 48 #define TTBR_ASID_MASK (0xfffful << TTBR_ASID_SHIFT) @@ -2342,6 +2516,54 @@ #define TTBR_CnP_SHIFT 0 #define TTBR_CnP (1ul << TTBR_CnP_SHIFT) +/* TTBR0_EL1 */ +#define TTBR0_EL1_REG MRS_REG_ALT_NAME(TTBR0_EL1) +#define TTBR0_EL1_op0 3 +#define TTBR0_EL1_op1 0 +#define TTBR0_EL1_CRn 2 +#define TTBR0_EL1_CRm 0 +#define TTBR0_EL1_op2 0 + +/* TTBR0_EL12 */ +#define TTBR0_EL12_REG MRS_REG_ALT_NAME(TTBR0_EL12) +#define TTBR0_EL12_op0 3 +#define TTBR0_EL12_op1 5 +#define TTBR0_EL12_CRn 2 +#define TTBR0_EL12_CRm 0 +#define TTBR0_EL12_op2 0 + +/* TTBR1_EL1 */ +#define TTBR1_EL1_REG MRS_REG_ALT_NAME(TTBR1_EL1) +#define TTBR1_EL1_op0 3 +#define TTBR1_EL1_op1 0 +#define TTBR1_EL1_CRn 2 +#define TTBR1_EL1_CRm 0 +#define TTBR1_EL1_op2 1 + +/* TTBR1_EL12 */ +#define TTBR1_EL12_REG MRS_REG_ALT_NAME(TTBR1_EL12) +#define TTBR1_EL12_op0 3 +#define TTBR1_EL12_op1 5 +#define TTBR1_EL12_CRn 2 +#define TTBR1_EL12_CRm 0 +#define TTBR1_EL12_op2 1 + +/* VBAR_EL1 */ +#define VBAR_EL1_REG MRS_REG_ALT_NAME(VBAR_EL1) +#define VBAR_EL1_op0 3 +#define VBAR_EL1_op1 0 +#define VBAR_EL1_CRn 12 +#define VBAR_EL1_CRm 0 +#define VBAR_EL1_op2 0 + +/* VBAR_EL12 */ +#define VBAR_EL12_REG MRS_REG_ALT_NAME(VBAR_EL12) +#define VBAR_EL12_op0 3 +#define VBAR_EL12_op1 5 +#define VBAR_EL12_CRn 12 +#define VBAR_EL12_CRm 0 +#define VBAR_EL12_op2 0 + /* ZCR_EL1 - SVE Control Register */ #define ZCR_LEN_SHIFT 0 #define ZCR_LEN_MASK (0xf << ZCR_LEN_SHIFT) From nobody Tue Jul 23 09:52:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSsr8664zz5Rf2G; Tue, 23 Jul 2024 09:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSsr85Cxsz4v4N; Tue, 23 Jul 2024 09:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721728328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m3WpA17tKKkJw5T8BcMRm3EK2EsTdKf2pvGeNxdWNzo=; b=laFTlWHlrt9e2hXpyxBew/ok1K8mVI4G9sj00L8rbsftB2ZQ/2mYjOEkzLu/Dey8PIyyq1 sWfGpCNzaywIyOi/Lxk7y4c4txaHiDhUC1/Hr2an+A8zAgVScHU+qJrZs6gFSfBnP1PmZM fB404n3JZ/GllCqRA3IzTkRiKEfWFaAKkiPcCMgoZRFk/1foKnBArJXP+OqEpuRPs8EmLp 4cKqqLvlaUR7BuViCvSMJ7IEC7pwnDK7N6U//spkGanYHdZUY5SntAfe2o3tws4tcngdfb EpZEw9fnNwOmzNoU76IvpQQyOId200KhElA2zkMp0y8Jb2HWDpFJ3vM6q97pOg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721728328; a=rsa-sha256; cv=none; b=TFYzKhF3HdmraRvd/L9TjTtel86f2u6UgNOTUtkYrxQd/Rkt06lI3HmG+5hWIXhFHzFfo3 3QW+HPJkoHBVXXa8fzIbXMzWlDJC6KO44rneRc9PxvM1H73D3ez065nH0jwZRWzxcRK27S 7QfYHx6xphwYZQ+dFQ6utLbQflkvIRy/AVhQymZBU/9mRxXbL5TYOaS/hfdPEErD5dCM8i hrk6ZjkdzoxBNE0YadPD/aBzCfX0g4UkPz3nSqxMsqTfqMsNbaPZlELZZ6UIuhzmp4ekxc QaQGeSRL3HVuSclSAMbt8A0xayQyJhv7kpj2yF2l8fYuTXDkmioONgEVNCPPNg== 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=1721728328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m3WpA17tKKkJw5T8BcMRm3EK2EsTdKf2pvGeNxdWNzo=; b=WS9DqV/PCXtbB+gwIfsMkPwwA6EUfimMRncPWrtmiNKIobVyEZmRqN81yvzsigukH+ivKv 7heZiDBIeABBY3NnUtVNTSSKAgaHz7cLY+Fa8Mo/3P78duVZCtiPEdE80gvDnppKUiAzy1 a4SSVOqAJYc6JHjujcYLf2FNfrLxMzoDKBauJrSAAMC9ifAv1LSJw2ZGt2pwofXGq0rVj8 o43ISXjz3pQupLpDXa2c40XXb3SyL6HXAWgXfEKBMbuVIFlMgUNIDLipsxBf4xVCfi631i 8yLOg6E5/A4KEH7nyBt9A9LVuN8VX7OZBNi3tRbW2wu7Hs8M3vpykpLwtMDZIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSsr84qCkzPFR; Tue, 23 Jul 2024 09:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46N9q8qS061032; Tue, 23 Jul 2024 09:52:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46N9q8ex061029; Tue, 23 Jul 2024 09:52:08 GMT (envelope-from git) Date: Tue, 23 Jul 2024 09:52:08 GMT Message-Id: <202407230952.46N9q8ex061029@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 997511dffe65 - main - arm64: Support counter access with E2H List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 997511dffe651e1d2d708f37f2ced430a6ab3349 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=997511dffe651e1d2d708f37f2ced430a6ab3349 commit 997511dffe651e1d2d708f37f2ced430a6ab3349 Author: Andrew Turner AuthorDate: 2024-07-23 09:18:00 +0000 Commit: Andrew Turner CommitDate: 2024-07-23 09:25:05 +0000 arm64: Support counter access with E2H When entering the kernel with the E2H field set the layout of the cnthctl_el2 register changes. Use the correct field locations to enable access to the counter and timer registers from EL1. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45529 --- sys/arm64/arm64/locore.S | 6 ++++-- sys/arm64/include/hypervisor.h | 9 +++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index d1120e0476a2..2680669c61f8 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -365,8 +365,10 @@ LENTRY(enter_kernel_el) msr hstr_el2, xzr /* Enable access to the physical timers at EL1 */ - mrs x2, cnthctl_el2 - orr x2, x2, #(CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN) + tst x4, #HCR_E2H + ldr x3, =(CNTHCTL_EL1PCTEN | CNTHCTL_EL1PCEN) + ldr x5, =(CNTHCTL_E2H_EL1PCTEN | CNTHCTL_E2H_EL1PTEN) + csel x2, x3, x5, eq msr cnthctl_el2, x2 /* Set the counter offset to a known value */ diff --git a/sys/arm64/include/hypervisor.h b/sys/arm64/include/hypervisor.h index 85ac5cda7037..418047cb22f2 100644 --- a/sys/arm64/include/hypervisor.h +++ b/sys/arm64/include/hypervisor.h @@ -37,10 +37,15 @@ /* CNTHCTL_EL2 - Counter-timer Hypervisor Control register */ #define CNTHCTL_EVNTI_MASK (0xf << 4) /* Bit to trigger event stream */ +/* Valid if HCR_EL2.E2H == 0 */ +#define CNTHCTL_EL1PCTEN (1 << 0) /* Allow physical counter access */ +#define CNTHCTL_EL1PCEN (1 << 1) /* Allow physical timer access */ +/* Valid if HCR_EL2.E2H == 1 */ +#define CNTHCTL_E2H_EL1PCTEN (1 << 10) /* Allow physical counter access */ +#define CNTHCTL_E2H_EL1PTEN (1 << 11) /* Allow physical timer access */ +/* Unconditionally valid */ #define CNTHCTL_EVNTDIR (1 << 3) /* Control transition trigger bit */ #define CNTHCTL_EVNTEN (1 << 2) /* Enable event stream */ -#define CNTHCTL_EL1PCEN (1 << 1) /* Allow EL0/1 physical timer access */ -#define CNTHCTL_EL1PCTEN (1 << 0) /*Allow EL0/1 physical counter access*/ /* CPTR_EL2 - Architecture feature trap register */ /* Valid if HCR_EL2.E2H == 0 */ From nobody Tue Jul 23 09:52:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSsrB21Sfz5Rdp2; Tue, 23 Jul 2024 09:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSsr96BxQz4v1y; Tue, 23 Jul 2024 09:52:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721728329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wjr92QKcP8inrdc12oJQUk7BC8rFR0qdL9mBN7603x0=; b=IMRcVWeQfmvihmJsv63eby5YRIqy5pehLilQYTrhHYScRBd3dpywCy0D7H/s4bgrNCVYM5 X2fDN3LxJi0ZfVDBNurivZ/hvraXYxM3gcAavah2xZWBXyo5FKWWgIkJmtQ8m+MjnpVLfl lxbVdkB2MB6/wXLHoVf9dmPW0grOnA5PpxGTEMT0pZuV5jHP031T+nvSauVSG0EQdLZxUK WSifEtrcMHmSZD9HztxsPvkHtOhwieJxtic4TOqS7gW8IbVXjxZVHlGSjicZg+oQMjCahi V4QJBpQSvq4N3ZWH3gZRlXNd8jfJi1afJhTMT8vCLgxLOqWDCb0Ac724AT/mQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721728329; a=rsa-sha256; cv=none; b=l21s8txc82BK4sgDmxUmb2/SyOxz+1M2wwB4hJEkH+qwdbDn52+T0Mb8d/ypiDGBoJO+cp J5DgrrtMh56p3k0kgO0xoCXYBJ4v509mLe9ZcGTmr0bd0wsodJVSU2nujLjKxTXu4rDnMf KSFiYSS37X87O51ol93c+pGlHly6bE+FGMAZL2LxOVbMGSD58ZHXClCZifMyBYjrLopwlp 6HLW8aM6nFlH+tjpycxzBGtN4nqAXKsX2ieXlc60xcr2+5ydxktyPapVB2nEtKAO3L/hAm bBBj1onDFvgdouge/pxPd+kKf4+IFXP9dQDDGEpnAyH2UA5Dq0QYqQJNm/XjtQ== 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=1721728329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wjr92QKcP8inrdc12oJQUk7BC8rFR0qdL9mBN7603x0=; b=pqN21m13j/k6jcoEAPaOGxTsBeKSptKlAue1RvzyMsGWl8by03wW6vI6tU2Z3iyzKZkYiA YVy0KPdls70MxzbLADZXRUP/x8XjvAAKKmceYzkdJ1Hqx45V7A5dbNN8H8VzQME/tM43e/ LTi09TVgznfzhzOdLP302LAoZWMV4siMhAS6+Y23OsxqGlXKamWa0AwSPAoHIPyjjl16yZ ZPmnh/Kt/7kXpdqr0LHSbTumG8m1bEf43qUkdMup1dqtZ2oPd5+auap6jpcufHlq6BzT3B VezFm4VN+DzdX7VKf8L5AHQr1YGOvr6+yTeXY4QxiO8ZQ6uMjIwPeke7RwSs3A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSsr95qJgzPBx; Tue, 23 Jul 2024 09:52:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46N9q9UN061080; Tue, 23 Jul 2024 09:52:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46N9q9Zg061077; Tue, 23 Jul 2024 09:52:09 GMT (envelope-from git) Date: Tue, 23 Jul 2024 09:52:09 GMT Message-Id: <202407230952.46N9q9Zg061077@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 57ef7935eb11 - main - arm64: Fix the gicv3 check in locore.S List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 57ef7935eb114e98e7e554c5ffbded68fd038c04 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=57ef7935eb114e98e7e554c5ffbded68fd038c04 commit 57ef7935eb114e98e7e554c5ffbded68fd038c04 Author: Andrew Turner AuthorDate: 2024-07-23 09:18:08 +0000 Commit: Andrew Turner CommitDate: 2024-07-23 09:25:05 +0000 arm64: Fix the gicv3 check in locore.S In locore.S we need to configure access to the GICv3. To check if it's available we read the id_aa64pfr0_el1 register, however we then only check if a GICv3.0 or 4.0 is present. If the system has a GICv4.1 this check would fail. Move to checking if the GICV3+ is not absent so this will still work if the field is updated again. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45530 --- sys/arm64/arm64/locore.S | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 2680669c61f8..3dcb01fd2a6e 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -389,9 +389,8 @@ LENTRY(enter_kernel_el) mrs x2, id_aa64pfr0_el1 /* Extract GIC bits from the register */ ubfx x2, x2, #ID_AA64PFR0_GIC_SHIFT, #ID_AA64PFR0_GIC_BITS - /* GIC[3:0] == 0001 - GIC CPU interface via special regs. supported */ - cmp x2, #(ID_AA64PFR0_GIC_CPUIF_EN >> ID_AA64PFR0_GIC_SHIFT) - b.ne 2f + /* GIC[3:0] != 0000 - GIC CPU interface via special regs. supported */ + cbz x2, 2f mrs x2, icc_sre_el2 orr x2, x2, #ICC_SRE_EL2_EN /* Enable access from insecure EL1 */ From nobody Tue Jul 23 09:52:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSsrC1M3bz5RdxR; Tue, 23 Jul 2024 09:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSsrB6lCxz4thy; Tue, 23 Jul 2024 09:52:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721728330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6dLhwMH+lhkR4x8uHCIPpBLixwaKWL/e91jm6uQ/I5s=; b=n3IngwWA6Ui+DUeFkIyXL1q6ftUFRgqpBuYLWEfxkG/5smzCDM0o8gsayCsn1JRIX90WR8 RrUXeromIB14rlv587KMQ1FrBOa5c5lUTBsjnICVA1Nl/Ry+suy94n/oZUmXW5TaJ7M+J5 LcOtSIkluishFrtSFPVNN+YoxOcglnWx360J0BckEU82t/p5a3L9l2loAg3evmGOK0uPLx iLjSV3u5JB98a/ve5x/NXgmZ6/t41Z9NYJ5CkFuDfJm25lRc6md6j2nGzfrw0BBAEL0kZF nmF8SekdS4cXftkaVWDTLnjlkDBl75mG7lgzFNN1gZeZzNOyHSRlC2MLPiiC/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721728330; a=rsa-sha256; cv=none; b=b5vw+1J5YL3dpLNRHSTurL1SbRqinUW2KLo/+We+nmU1VXrS7eJFSmhzmjGLQ0ZKyb9jdg wft9HRlPNEtFLzY5j8KEAM5tn/WhIoQXqDRS7ovnbt1xtJRNaFUQL1VjiMznhidA6+it0j AXOAd/aIgs80i+W4SlIwSIIXPoh37iZjI6OOrl38Jb7+hoQd+rzVTYolnIxhFxuI6SynRn 51fQY8N5NPN88qJ5LcgAih7HokdV6qFp9zrNPUMe/xjqbcrRTGsN6ueib2TTlZBjX0LF9X cTODvIFEw+Ps0SWJIRaiRhquwc1cl039q01kLLzkMeGGGDSk4iuy86l/2tmbLw== 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=1721728330; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6dLhwMH+lhkR4x8uHCIPpBLixwaKWL/e91jm6uQ/I5s=; b=mXFl4IZavFaQTx4KreFOf2bWtYiNwTbti8vJWTRyvOPZXviFsX3JkJDTPgZHCARTZo7n+C SX0mP5uEEvh4wT6RjbGzzt00fppx2EmHkW3zT17rApIqZ28SjGuqAW0xrHKVGKnjk6diB+ W9gx5zRzWiCljgp7CaoJGoD5y96l3PlMjEMRNJks1wIuP58/uamhG/GJ17lKBz1b1FRDCq 4irxzQGAxHY+qhKihc45Fn0ICI+p/mdODyHwlfH+whtllrNDYIMh7PWb6Wig8oSgvnwhan 4TuVIwSBAZ9l827jG4CzHKxQY+0CN+QibPlq/dDSkt4z5zh76IlsVIajL7jAxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSsrB68rbzPFV; Tue, 23 Jul 2024 09:52:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46N9qAH0061147; Tue, 23 Jul 2024 09:52:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46N9qAZm061144; Tue, 23 Jul 2024 09:52:10 GMT (envelope-from git) Date: Tue, 23 Jul 2024 09:52:10 GMT Message-Id: <202407230952.46N9qAZm061144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 034c83fd7d85 - main - arm64: Ensure sctlr and pstate are in known states List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 034c83fd7d85f57193850a73cc0ac957a211f725 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=034c83fd7d85f57193850a73cc0ac957a211f725 commit 034c83fd7d85f57193850a73cc0ac957a211f725 Author: Andrew Turner AuthorDate: 2024-07-23 09:18:24 +0000 Commit: Andrew Turner CommitDate: 2024-07-23 09:25:05 +0000 arm64: Ensure sctlr and pstate are in known states Before entering the kernel exception level ensure sctlr_el2 and sctlr_el1 are in a known state. The EOS flag needs to be set to ensure an eret instruction is a context synchronization event. Set spcr_el1 when entering the kernel from EL1 and use an eret instruction to return to the caller. This ensures the CPU pstate is consistent with the value in spcr_el1 as it is the only way to set it directly. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45528 --- sys/arm64/arm64/locore.S | 52 ++++++++++++++++++++++-------------------- sys/arm64/include/hypervisor.h | 4 ++++ 2 files changed, 31 insertions(+), 25 deletions(-) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 3dcb01fd2a6e..4252ea3f59f8 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -67,19 +67,6 @@ ENTRY(_start) /* Enter the kernel exception level */ bl enter_kernel_el - /* - * Disable the MMU. We may have entered the kernel with it on and - * will need to update the tables later. If this has been set up - * with anything other than a VA == PA map then this will fail, - * but in this case the code to find where we are running from - * would have also failed. - */ - dsb sy - mrs x2, sctlr_el1 - bic x2, x2, SCTLR_M - msr sctlr_el1, x2 - isb - /* Set the context id */ msr contextidr_el1, xzr @@ -314,19 +301,37 @@ LEND(mpentry_common) * registers and drop to EL1. */ LENTRY(enter_kernel_el) +#define INIT_SCTLR_EL1 (SCTLR_LSMAOE | SCTLR_nTLSMD | SCTLR_EIS | \ + SCTLR_TSCXT | SCTLR_EOS) mrs x23, CurrentEL and x23, x23, #(CURRENTEL_EL_MASK) cmp x23, #(CURRENTEL_EL_EL2) b.eq 1f - ret + + ldr x2, =INIT_SCTLR_EL1 + msr sctlr_el1, x2 + /* SCTLR_EOS is set so eret is a context synchronizing event so we + * need an isb here to ensure it's observed by later instructions, + * but don't need it in the eret below. + */ + isb + + /* Ensure SPSR_EL1 and pstate are in sync. The only wat to set the + * latter is to set the former and return from an exception with eret. + */ + mov x2, #(PSR_DAIF | PSR_M_EL1h) + msr spsr_el1, x2 + msr elr_el1, lr + eret + 1: + dsb sy /* - * Disable the MMU. If the HCR_EL2.E2H field is set we will clear it - * which may break address translation. + * Set just the reserved bits in sctlr_el2. This will disable the + * MMU which may have broken the kernel if we enter the kernel in + * EL2, e.g. when using VHE. */ - dsb sy - mrs x2, sctlr_el2 - bic x2, x2, SCTLR_M + ldr x2, =(SCTLR_EL2_RES1 | SCTLR_EL2_EIS | SCTLR_EL2_EOS) msr sctlr_el2, x2 isb @@ -346,8 +351,8 @@ LENTRY(enter_kernel_el) mrs x2, mpidr_el1 msr vmpidr_el2, x2 - /* Set the bits that need to be 1 in sctlr_el1 */ - ldr x2, .Lsctlr_res1 + /* Set the initial sctlr_el1 */ + ldr x2, =INIT_SCTLR_EL1 msr sctlr_el1, x2 /* @@ -403,10 +408,7 @@ LENTRY(enter_kernel_el) isb eret - - .align 3 -.Lsctlr_res1: - .quad SCTLR_RES1 +#undef INIT_SCTLR_EL1 LEND(enter_kernel_el) /* diff --git a/sys/arm64/include/hypervisor.h b/sys/arm64/include/hypervisor.h index 418047cb22f2..011f86e83fdf 100644 --- a/sys/arm64/include/hypervisor.h +++ b/sys/arm64/include/hypervisor.h @@ -148,10 +148,14 @@ #define SCTLR_EL2_C (0x1UL << SCTLR_EL2_C_SHIFT) #define SCTLR_EL2_SA_SHIFT 3 #define SCTLR_EL2_SA (0x1UL << SCTLR_EL2_SA_SHIFT) +#define SCTLR_EL2_EOS_SHIFT 11 +#define SCTLR_EL2_EOS (0x1UL << SCTLR_EL2_EOS_SHIFT) #define SCTLR_EL2_I_SHIFT 12 #define SCTLR_EL2_I (0x1UL << SCTLR_EL2_I_SHIFT) #define SCTLR_EL2_WXN_SHIFT 19 #define SCTLR_EL2_WXN (0x1UL << SCTLR_EL2_WXN_SHIFT) +#define SCTLR_EL2_EIS_SHIFT 22 +#define SCTLR_EL2_EIS (0x1UL << SCTLR_EL2_EIS_SHIFT) #define SCTLR_EL2_EE_SHIFT 25 #define SCTLR_EL2_EE (0x1UL << SCTLR_EL2_EE_SHIFT) From nobody Tue Jul 23 09:52:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSsrD4kZYz5RdjB; Tue, 23 Jul 2024 09:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSsrD0qkJz4v2V; Tue, 23 Jul 2024 09:52:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721728332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tev4nrzMn53ahOEoFt5tSE+ag66qrwvQeOD6VFqCx9U=; b=dbG6xYlzQe7M2+2/gEB78nB2XPiWJ3eGi23ceTHQRTDFi4Luc6vEN/RSrJNlVX6i48Wt62 LZLbRiSNj4UuY/m8H6CX7hIW9btfmEE/A+u6Jow6/KUL8whmzSjZgECfXAcwRawowkS8W4 +bBWxqwe0auG3d0Dlw13PAwAcgHLuPvnwYfOofrW4ZU7tKWRZXp8KdrGteMA8VEnXsVceO HgzaIinVBYzEC4UReZlE+ShIZaXaMbrc/BmVf8JH07rAY1Xwh6iAUXKJTfTrS9sxd/2d4q hxgVOH6CDyBApXWRw4PwUHn+t7zsaW0dEAPUYBmEbP90YhC9IOKkw6TuNpR/xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721728332; a=rsa-sha256; cv=none; b=Q1MYIF1/Go33hDa/rPePEn5WZHgyVcIqJg3TiyTbrBvMJOYdxFPkE+UqlCFlJqJXnqCmQl 0CkWPSlRdLaCguKq3juyr9altFP0HYt6oY3+GY3rv5sRB1lcP3wKIYq7IRvvf9NfG6u87U f+05XLEL4DvYw6qGHXLeC1Wrla/UgqGDvb6hYLdAD8JxN5OoQwUFPzx7CYEZW4vWvR5v6z yF6De6n48K1dhNcMzNR6XOfDwx/GrE3sZl3x/Bix9TCTsGgRqjBsPLDJf0k2d7N/uWItgc 4F7X3LgEx1wM1pSVCbD4aD41vurruaGoqDhs3SV5GkZSOfFPTpfJO73vBaG+bQ== 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=1721728332; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tev4nrzMn53ahOEoFt5tSE+ag66qrwvQeOD6VFqCx9U=; b=guPj9yoY4G6Y8IkJLJg2/91k0IAZ2ww/iCvD928U6TAPkTk8+p8HoExnLs49I8/WX4793Y dldT1U89cjD13iBAhdawpwvz6fn59Z4RBVXgZEteYhgfJfMKVn403wreBVIl0jTdy1skiu w9eGH4oeDyhyT9hP4NhXiwVemi8d30D2IuJzWF0L2JJD0pOM3CkmzEbdFNkZlRppNPVQJi BPa9t6X0FJO5VCZuQkub6KJKWXhNxu6srj8oChm+WFHKRULrl2CW5G/im+Gr72bmg5hzS+ iod7Pt0N5oYnIVH/iFzWggVwX/a/eyBrONF5+Gfyy2z9k7EAQJ8DDjhMK4C6lw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSsrD07PMzPFW; Tue, 23 Jul 2024 09:52:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46N9qBTF061201; Tue, 23 Jul 2024 09:52:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46N9qBHx061198; Tue, 23 Jul 2024 09:52:11 GMT (envelope-from git) Date: Tue, 23 Jul 2024 09:52:11 GMT Message-Id: <202407230952.46N9qBHx061198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 9840598aa31f - main - dev/uart: Add APMC0D08 as found in the Intel E2100 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9840598aa31f2a89272f5bef6545e316f254f0c6 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=9840598aa31f2a89272f5bef6545e316f254f0c6 commit 9840598aa31f2a89272f5bef6545e316f254f0c6 Author: Andrew Turner AuthorDate: 2024-07-23 09:18:36 +0000 Commit: Andrew Turner CommitDate: 2024-07-23 09:25:05 +0000 dev/uart: Add APMC0D08 as found in the Intel E2100 This uart has the requirement for 32-bit sized and aligned memory accesses. It is also described in the Serial Port Console Redirection Table (SPCR) with a different interface type value. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D45834 --- sys/dev/uart/uart_dev_ns8250.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c index 16c3cb2fc5a9..1a58600c8039 100644 --- a/sys/dev/uart/uart_dev_ns8250.c +++ b/sys/dev/uart/uart_dev_ns8250.c @@ -460,6 +460,7 @@ UART_CLASS(uart_ns8250_class); static struct acpi_uart_compat_data acpi_compat_data[] = { {"AMD0020", &uart_ns8250_class, 0, 2, 0, 48000000, UART_F_BUSY_DETECT, "AMD / Synopsys Designware UART"}, {"AMDI0020", &uart_ns8250_class, 0, 2, 0, 48000000, UART_F_BUSY_DETECT, "AMD / Synopsys Designware UART"}, + {"APMC0D08", &uart_ns8250_class, ACPI_DBG2_16550_COMPATIBLE, 2, 4, 0, 0, "APM compatible UART"}, {"MRVL0001", &uart_ns8250_class, ACPI_DBG2_16550_SUBSET, 2, 0, 200000000, UART_F_BUSY_DETECT, "Marvell / Synopsys Designware UART"}, {"SCX0006", &uart_ns8250_class, 0, 2, 0, 62500000, UART_F_BUSY_DETECT, "SynQuacer / Synopsys Designware UART"}, {"HISI0031", &uart_ns8250_class, 0, 2, 0, 200000000, UART_F_BUSY_DETECT, "HiSilicon / Synopsys Designware UART"}, From nobody Tue Jul 23 13:04:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSy5s273Wz5Rvdx; Tue, 23 Jul 2024 13:04: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSy5s1jV6z4Fy8; Tue, 23 Jul 2024 13:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721739857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J52obvdbpaN8HjmB+FmWFaHac6l5vXopkhsQLjMqbyk=; b=mxPVYYFtcA8kBKYFtlSjS+HHyvA+cV7r17HU8u6tS0EHsdCos/ASw/8zDPqtVB6B/ReHXn eHKY0gDunpzotMrdSMM5C8aDmMlMSrrE1Cck3k8j9Xz5+1nt2kmhR8riErk/OXy/EnfAoV aQMPES6XFS3tIhY70aiUf1VJalzhsf3u+LaAbodLDGMGK1U3KxykbusB9i9ROOZtKjZ1i/ riuZjy96/2szpPzu/J0XmjoIrjvUwZvUhC9+JEcDGog0uNNnOzFmtw4llrf3ipcmoRwfJ0 0ES+aY31RnBcpkS2af1zE4WHGAPYcxGSLmOoM2gWDbt/qJ785sXQsiXSiVI4Wg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721739857; a=rsa-sha256; cv=none; b=UyLmtfClDEOjPPOB/YUQyQSFXwRBBclA3E2kYThioQwxopm6LT3BIRzoyu9lOD0yUrKrI5 6bv4UZjmt2ermocnz793bxuLz3V87hQJYUr6pfPXKeZJSvONTrYcml1eiSZo4mQ+ZMz+G2 Ynn2TBx32UPyHyp64RoKGZrOu2Hv0oVoyZP88wl1OL/z6DpZlYWc0HnSSPUdqa0XWCxXQr EHEzo8z1nbheKyThaoenceZZZ2ECvoTkjY6xGxsw9MkbfS5PHVRsH3v/N2Vn6a0yAdQseW 7V4M9mIyfLNoe7+0fEtiYFK6KyqGWKxiCESlEGiY5T8hSHUWgql+jGPCaWrjvw== 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=1721739857; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=J52obvdbpaN8HjmB+FmWFaHac6l5vXopkhsQLjMqbyk=; b=XjTrZZcuoVQ+LCfuTB7qhxMr/0JC2cWpZozA8eLLtQVVBUmEOQYyRMViMApvcmfmuZkTWZ agJi7rKmGBqKMvBtxHB/gZUqIcjPCVyNp2KB65lAYkLR6bIY0/uDTa1hkBvofKto95S1Bi abngLolaAeDK5laiXqUn18RDcaozXNVKrZmd2HA3bsGWAfIqrUONwQaIf8W/IBCvolvrGZ okGu+gDPn6d0U2GCKUec57TbFvxA4oqi4msg9xxRI77vwmpQpBlMztb9h+CctuLbqUHC6J 4K1D1m1lxZ53w4NOFSfeakdrafG9LhkI+/ejW4CODFwz2KjDftU2MPuQ3EOwjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSy5s11nkzTS5; Tue, 23 Jul 2024 13:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46ND4HGi086202; Tue, 23 Jul 2024 13:04:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46ND4H3v086199; Tue, 23 Jul 2024 13:04:17 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:04:17 GMT Message-Id: <202407231304.46ND4H3v086199@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 7b73ecfe6484 - main - nuageinit: Accept plain text passwords List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b73ecfe648487c7706ac2b854dcf1435e60e4ca Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=7b73ecfe648487c7706ac2b854dcf1435e60e4ca commit 7b73ecfe648487c7706ac2b854dcf1435e60e4ca Author: Jose Luis Duran AuthorDate: 2024-07-23 03:49:36 +0000 Commit: Baptiste Daroussin CommitDate: 2024-07-23 13:01:54 +0000 nuageinit: Accept plain text passwords Per pw(8), when -H is set, the password should be supplied already encrypted in a form suitable for writing directly to the password database (passwd in cloud-init tems); -h provides a special interface by which interactive scripts can set an account password using pw(8) in plain text (plain_text_passwd in cloud-init terms). The default user (freebsd) is defined with a plain_text_passwd (freebsd), not with an encrypted one. --- libexec/nuageinit/nuage.lua | 2 +- libexec/nuageinit/tests/nuageinit.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index ca70c778791b..81fb40c0d8eb 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -112,7 +112,7 @@ local function adduser(pwd) postcmd = " -H 0 " elseif pwd.plain_text_passwd then precmd = "echo "..pwd.plain_text_passwd .. "| " - postcmd = " -H 0 " + postcmd = " -h 0 " end cmd = precmd .. "pw " if root then diff --git a/libexec/nuageinit/tests/nuageinit.sh b/libexec/nuageinit/tests/nuageinit.sh index 54c88ceb539a..c6a86bc15486 100644 --- a/libexec/nuageinit/tests/nuageinit.sh +++ b/libexec/nuageinit/tests/nuageinit.sh @@ -104,6 +104,7 @@ sys:*:1:0::0:0:Sys:/home/sys:/bin/csh freebsd:freebsd:1001:1003::0:0:FreeBSD User:/home/freebsd:/bin/sh foobar:H/1LT4f9/N3wpgNunhsIqtMj62OKiS3nyNwuizouQc3u7MbYCarYeAHWYPYb2FT.lbioDm2RrkJPb9BZMN1O/:1002:1004::0:0:Foo B. Bar:/home/foobar:/bin/sh EOF + sed -i "" "s/freebsd:.*:1001/freebsd:freebsd:1001/" ${here}/etc/master.passwd atf_check -o file:expectedpasswd cat ${here}/etc/master.passwd atf_check -o file:expectedgroup cat ${here}/etc/group } From nobody Tue Jul 23 13:19:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSyRQ5p8fz5Rx2x; Tue, 23 Jul 2024 13:19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSyRQ5DJ9z4Hn7; Tue, 23 Jul 2024 13:19:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721740770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e/+TZaJU35mPQRzh1iPZ5VX43sYad8+f3tlzgV4jFTQ=; b=kAoKrx9xl/ta8RVD5vDuWAOT/n0oYQU++nHYK4FR3WgqAdT5YJDVpp925/HR4oLr6v5XNT aaj5/pU95k/SqjuYVyk+kokTy7uT1IjVNHzI0IhTiK5uF5VKy3Bc/osG1BDY4Z/UPlkDC3 9WhkQuKBlaQmV3vachgKAoSOa52STlI4MbsHqX55WAjPO6F6Qnx4JOJT81b6PxTGZcg/MZ 0R2/S8GCmv5jPbxUrB5jxRTQ2hNZOzSrVjs+2U/Ru/NX98OYIfOyjb25rgW2+LdCZFcWsY 2RPNaM9/bA9gYaTneY5G8+3neJdYTVsBYJfgO+6RDsrauIKAym5ARjsrYhyQFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721740770; a=rsa-sha256; cv=none; b=VtdMTXkqLidpO5tSS2jWZoSRuEqsqAOxeSAJkOKBKGtJ1tOR0ndJKy54NubjXEXp3b0SSB gdaf8Eh2JQ0sc2YkNe/9YgR85XbDxTPp33D+uQEIi/5uJbX4ofDeFRIPxiYIrD8IJUVzGC 9jE/3q8EjWhPWQDnvvBulUxl2f/koHFBbj/W2epRvCmReTMQSrU9ApJiMCxmbgDbXG/5xx 27itMhr26xIFpiIYTXys76S42V1cY05VrGweH9FxHmNUwO8TLGd2qy7Qk2zlLbhXJZynQY LEnaQV45TStcDTtEqxMb9tnlE3VoEqPwqoLj39g/6LBzTWCxnEYP45va3Sq13Q== 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=1721740770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e/+TZaJU35mPQRzh1iPZ5VX43sYad8+f3tlzgV4jFTQ=; b=H7siixc6RoMAyYpLBoW2BUwvQy0WnMHaTahwiGTb4dE1v72JqmlFvidah9+uX3a0sUnXcb Yw+VsbJqECIYyJqCHyi2GmburvFt5UEjV38GiAiO0UOKEfDtRZHSrtW773XYa+NIQ9dga4 HE8IJxaVJnlxwD19ctrgDaAxi3GLKcxvlJOE9p079uDnlxkrrWm/fJAZxaHXhJ+7hXy/xC CK6QZhdA11rtJh0C77KDXcPdrVuw8sumEwo0HGYsNEeRPqQJYNAxI21Ncd4amhEEJjTfot jjBgBdTP0+NhzbWHKWudj6GenWsljzIZjAvpps3Baj2gvFcD7xcM7c9+7SGPpA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSyRQ4kmkzVvK; Tue, 23 Jul 2024 13:19:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDJUu5004216; Tue, 23 Jul 2024 13:19:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDJUrB004213; Tue, 23 Jul 2024 13:19:30 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:19:30 GMT Message-Id: <202407231319.46NDJUrB004213@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 88c041e4870c - stable/14 - socket: Pass capsicum rights down to socket option handlers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 88c041e4870c278fe7c326e8ac0880cb76586c29 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=88c041e4870c278fe7c326e8ac0880cb76586c29 commit 88c041e4870c278fe7c326e8ac0880cb76586c29 Author: Mark Johnston AuthorDate: 2024-07-08 15:46:33 +0000 Commit: Mark Johnston CommitDate: 2024-07-23 13:01:29 +0000 socket: Pass capsicum rights down to socket option handlers One needs the CAP_GETSOCKOPT and CAP_SETSOCKOPT rights to call getsockopt(2) and setsockopt(2) on a socket descriptor, respectively. The syscall layer checks this, but individual socket option handlers have no access to the file descriptor and so can't check for additional rights, should the want to do so. In particular, a forthcoming implementation of SO_SPLICE logically requires at least CAP_RECV and CAP_SEND rights. Modify the syscall layer to look up Capsicum rights on the descriptor and pass that along to socket option handlers; this way, the handlers can check for additional rights if they need to. Reviewed by: gallatin, glebius MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D45673 (cherry picked from commit e2e771deeca7c10eaa46f380a9b64079468ec209) --- sys/kern/uipc_syscalls.c | 9 +++++++-- sys/sys/sockopt.h | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 6c13740d8094..6121bde4c574 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1236,6 +1236,7 @@ kern_setsockopt(struct thread *td, int s, int level, int name, const void *val, { struct socket *so; struct file *fp; + struct filecaps fcaps; struct sockopt sopt; int error; @@ -1261,8 +1262,10 @@ kern_setsockopt(struct thread *td, int s, int level, int name, const void *val, } AUDIT_ARG_FD(s); - error = getsock(td, s, &cap_setsockopt_rights, &fp); + error = getsock_cap(td, s, &cap_setsockopt_rights, &fp, + &fcaps); if (error == 0) { + sopt.sopt_rights = &fcaps.fc_rights; so = fp->f_data; error = sosetopt(so, &sopt); fdrop(fp, td); @@ -1300,6 +1303,7 @@ kern_getsockopt(struct thread *td, int s, int level, int name, void *val, { struct socket *so; struct file *fp; + struct filecaps fcaps; struct sockopt sopt; int error; @@ -1325,8 +1329,9 @@ kern_getsockopt(struct thread *td, int s, int level, int name, void *val, } AUDIT_ARG_FD(s); - error = getsock(td, s, &cap_getsockopt_rights, &fp); + error = getsock_cap(td, s, &cap_getsockopt_rights, &fp, &fcaps); if (error == 0) { + sopt.sopt_rights = &fcaps.fc_rights; so = fp->f_data; error = sogetopt(so, &sopt); *valsize = sopt.sopt_valsize; diff --git a/sys/sys/sockopt.h b/sys/sys/sockopt.h index 11799dde4883..b139062cf492 100644 --- a/sys/sys/sockopt.h +++ b/sys/sys/sockopt.h @@ -37,6 +37,7 @@ #error "no user-serviceable parts inside" #endif +struct cap_rights; struct thread; struct socket; @@ -52,6 +53,7 @@ struct sockopt { int sopt_name; /* third arg of [gs]etsockopt */ void *sopt_val; /* fourth arg of [gs]etsockopt */ size_t sopt_valsize; /* (almost) fifth arg of [gs]etsockopt */ + struct cap_rights *sopt_rights; /* Capsicum rights attached to the fd */ struct thread *sopt_td; /* calling thread or null if kernel */ }; From nobody Tue Jul 23 13:19:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSyRR6ThNz5Rwrn; Tue, 23 Jul 2024 13:19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSyRR63K3z4HSW; Tue, 23 Jul 2024 13:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721740771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VPgLLaQ7wFaHEWTLl73zRD5dK+k6NGGQxxqhRXqTdtg=; b=n85lkuJZsDBa0adqpFqdrvZSZ1ulSRKAKRfGx0whweinFPqkSAMPYLVl9IAKaJToNkmkJY W37d67ZxtUTk8J2seT1ez/G+uWrUaTGJiWaSCRPwdp5M9fKhjL2QOii98trUHNvQ2YT3tP hgpbtyVr9CZQd35/4qDOsYCy3jmbO0X2UO+DygDW/x9hHI97lFWSZaQXQJIL0v/PhF2LQF BILvKNINkT8IFXqXgbakg5mLfWL6B7hC0YJxBDN8U5d7zLJAVG8cwtPwn6KJhmBbdm3yp5 nRzsIy5uX3eWTYjo6Zn3/wFKtgSxpOg/zlmvZD0xLJce+5oQRBY6APF4a72qQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721740771; a=rsa-sha256; cv=none; b=SFYlDFQ7mS/mEMGGqKB5Fvuiait9rhwZyY7wDVcHEtPX2Yi6CmW06JopNuhFBQzmIg2foP SiaGzHQ1varjC5XlwKCf8HhaRl22p5dUFPkRmMpUY9IAYB6TzJzlOX8YHJIeig0zTEr3rM kOLb+CBm1c4IBl0S2ah8lAF4I5wLYor7vXT5/9q8Hl04iY1zRjnlYzHVKdctU9Gl9LS3if m8l8DrVkKLwPOdPsiPmlC//psilyCiGDLal8QrH3EXD6e7Nce1tDUcBF+yTpPHaYBp9l1s VkGvQSrmp4rW4HiTkThLsspzySlhWWpigIH1dm9vLmKvgEeLaiZTE4joR7GC0g== 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=1721740771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VPgLLaQ7wFaHEWTLl73zRD5dK+k6NGGQxxqhRXqTdtg=; b=reE9IznP43dJCb8x9AkChFJt6/1iqxdtsz1erD49L02jU2f1DWvY9VfM4zVn2Auhnge2ZF YYigcpIf2nlkxtM3ZCA0WY5sK0U8aJuj+sEU+BiHtvCQ2V/Hc/JXLhVK9H8vHRYk1hlM+k WcJ5Qk/AhIYrFjXRro46y0XhWDwJKwO1W+HvkfvzgJpb84HP+vt3GCSfctd6bpXzcV8NQZ FkLON6jJYqKONO4GZN5Ci7Mv5f+6thdIAS1b024ORMHlBWQHIKnxJUm/9RH/RAz4RY9k+m X5RlTddBcvNo7cLSIryNA5LQ0PelvzqysUOEE9lPEwDZvFV7WlbOwo4qqViNIw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSyRR5ggbzVvL; Tue, 23 Jul 2024 13:19:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDJVMl004272; Tue, 23 Jul 2024 13:19:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDJVlw004269; Tue, 23 Jul 2024 13:19:31 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:19:31 GMT Message-Id: <202407231319.46NDJVlw004269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4d8e3fafda19 - stable/14 - ndp: Fix libxo formatting for the prefix expiry string List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4d8e3fafda19cede6b0bd8f4f3497a83e0c0287b Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4d8e3fafda19cede6b0bd8f4f3497a83e0c0287b commit 4d8e3fafda19cede6b0bd8f4f3497a83e0c0287b Author: Mark Johnston AuthorDate: 2024-07-15 20:06:24 +0000 Commit: Mark Johnston CommitDate: 2024-07-23 13:01:29 +0000 ndp: Fix libxo formatting for the prefix expiry string Fixes: e1c7783e220b ("ndp(8): add structured output formatting via libxo") MFC after: 1 week Sponsored by: Klara, Inc. Sponsored by: Bell Tower Integration (cherry picked from commit b3877767883e9b26fbcce47c015ba3eab323bf1b) --- usr.sbin/ndp/ndp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c index b7bc25dd7aa4..4f7c32f0fdf7 100644 --- a/usr.sbin/ndp/ndp.c +++ b/usr.sbin/ndp/ndp.c @@ -1329,7 +1329,7 @@ plist(void) if (p->expire == 0) xo_emit(", expire=Never{en:permanent/true}"); else if (p->expire >= now.tv_sec) - xo_emit(", expire=%s{e:expires_sec/%d}", + xo_emit(", expire={:expires/%s}{e:expires_sec/%d}", sec2str(expire_in), expire_in); else xo_emit(", expired{e:expires_sec/%d}", expire_in); From nobody Tue Jul 23 13:19:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSyRT1xxNz5Rwmg; Tue, 23 Jul 2024 13:19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSyRS6h3bz4HSh; Tue, 23 Jul 2024 13:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721740772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ia16fY8bdz1qXdq/Ii2d7nyJrCQ6evZdXMHIl9l3yxg=; b=oAI+G9/pQPAQQUKqcJQd3CWv182b/CI5Z9OpzGDq92ULd0valEVEGv8QEFHJZKM/rRK0Y4 PzWg2FpJzxAooKdjJuU4iqay59sMgaG2zNvzkfP6WjRh8b5AEyrUYvsZT0rlC7ZuiNZJlR euf7iuTRetDnmyKsy+POf6v9wmgYUrW8BWKp/rViSb2vT6KrEvVhxCkLsoh3xp1c/0p3pF oHhhRM4HP7bXwjeu2Ti1GdyX2fxf5lgRNX2IK7KvsETmpv8Sa0Ar+rtgqKTGX9UYKOyDbn W204XbTuRsqc3ACvJoCCaNcQbMurs55gMXrWqb2baXG59sQN/eYZKNkZBpXaUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721740772; a=rsa-sha256; cv=none; b=EczwTdCmFuIuAkgEew0W1mwcmIbGVPsrCQRL34jJbYmmSPx3A+dkOz7XyaFv4Mk6+4PkSp ChF6SSZmQ0CUtZgBi7tZ1H/FM0+xoDisYqEU8Dqa+3Jq5rLhaLYJ1Tf2ZLucm+g/E4QJwZ z16UMg23XvkEpaDq0IvDpTt8ZAzk6dyI8DNiwGjfRIB0PCNMZanvhyWGtXDg+au/H8ofyk ITMM1FcRVKj+Xmhnvc5WNVI/P+a0wCRDRdPKV3WfAEKHuTDBdaGIzG7VD3FL8JqbMe8qs8 rLO08iyUU6GkdMZaY3ExhoH12+rp2Cut0XiFvYzQ7ixM0hdhAqymELaQVgrMFw== 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=1721740772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ia16fY8bdz1qXdq/Ii2d7nyJrCQ6evZdXMHIl9l3yxg=; b=ROgeusmPVdmMAgGqeXK/qtwoUCw27K+jf/zcrcO3YH8zC5h2F7qnIhXozu0sMIGOu5j6nF VNwYrCG5+otEnwKmnD1vacAsLO4MuoJnQQyFHt5p0pkd5aN3j+PCNpgCd0F37JVwTDEiLa jCSVrZ0fGw7uPPPu2e/nqvH6/VdACh4auTTr7XZmTBGFoN3djii43xfPA/JtVz9aJ4IGNe UTUX5Qn7VpMduur2fljTmcg3SFuGLU4DbadHICG/x20DPVFRhEWyTRNFSi4jtnegi4rHuQ SrPvN3Lhl4ZEFrKiv3AVMw/eWG8xnPqMWh9ZgLHutWZ6e4YLtDnWl00ijXND6w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSyRS6HJLzVT2; Tue, 23 Jul 2024 13:19:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDJW6f004324; Tue, 23 Jul 2024 13:19:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDJWEf004321; Tue, 23 Jul 2024 13:19:32 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:19:32 GMT Message-Id: <202407231319.46NDJWEf004321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 97d88163d468 - stable/14 - ktls: Remove the socket parameter to ktls_ocf_try() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 97d88163d4685b57b3f50e7788691454256c5182 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=97d88163d4685b57b3f50e7788691454256c5182 commit 97d88163d4685b57b3f50e7788691454256c5182 Author: Mark Johnston AuthorDate: 2024-07-08 15:52:07 +0000 Commit: Mark Johnston CommitDate: 2024-07-23 13:01:30 +0000 ktls: Remove the socket parameter to ktls_ocf_try() The socket is unused, and not passing it means that there's less to think about when considering how KTLS is synchronized with the rest of the socket code. No functional change intended. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D45675 (cherry picked from commit 5dfca6c375d530908eedb7f103681c2493cf0ca3) --- sys/kern/uipc_ktls.c | 10 +++++----- sys/opencrypto/ktls.h | 2 +- sys/opencrypto/ktls_ocf.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 91dfb8516308..b4b169c4daf2 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -1076,11 +1076,11 @@ ktls_use_sw(struct ktls_session *tls) } static int -ktls_try_sw(struct socket *so, struct ktls_session *tls, int direction) +ktls_try_sw(struct ktls_session *tls, int direction) { int error; - error = ktls_ocf_try(so, tls, direction); + error = ktls_ocf_try(tls, direction); if (error) return (error); ktls_use_sw(tls); @@ -1237,7 +1237,7 @@ ktls_enable_rx(struct socket *so, struct tls_enable *en) if (error) return (error); - error = ktls_ocf_try(so, tls, KTLS_RX); + error = ktls_ocf_try(tls, KTLS_RX); if (error) { ktls_free(tls); return (error); @@ -1318,7 +1318,7 @@ ktls_enable_tx(struct socket *so, struct tls_enable *en) #endif error = ktls_try_ifnet(so, tls, KTLS_TX, false); if (error) - error = ktls_try_sw(so, tls, KTLS_TX); + error = ktls_try_sw(tls, KTLS_TX); if (error) { ktls_free(tls); @@ -1503,7 +1503,7 @@ ktls_set_tx_mode(struct socket *so, int mode) if (mode == TCP_TLS_MODE_IFNET) error = ktls_try_ifnet(so, tls_new, KTLS_TX, true); else - error = ktls_try_sw(so, tls_new, KTLS_TX); + error = ktls_try_sw(tls_new, KTLS_TX); if (error) { counter_u64_add(ktls_switch_failed, 1); ktls_free(tls_new); diff --git a/sys/opencrypto/ktls.h b/sys/opencrypto/ktls.h index 0fe02b7f50f5..efba25e17013 100644 --- a/sys/opencrypto/ktls.h +++ b/sys/opencrypto/ktls.h @@ -48,7 +48,7 @@ struct ktls_ocf_encrypt_state { void ktls_encrypt_cb(struct ktls_ocf_encrypt_state *state, int error); void ktls_ocf_free(struct ktls_session *tls); -int ktls_ocf_try(struct socket *so, struct ktls_session *tls, int direction); +int ktls_ocf_try(struct ktls_session *tls, int direction); int ktls_ocf_encrypt(struct ktls_ocf_encrypt_state *state, struct ktls_session *tls, struct mbuf *m, struct iovec *outiov, int outiovcnt); diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index 0b9a07a9c83e..f61fb7f73b5d 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -983,7 +983,7 @@ ktls_ocf_free(struct ktls_session *tls) } int -ktls_ocf_try(struct socket *so, struct ktls_session *tls, int direction) +ktls_ocf_try(struct ktls_session *tls, int direction) { struct crypto_session_params csp, mac_csp, recrypt_csp; struct ktls_ocf_session *os; From nobody Tue Jul 23 13:19:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSyRV2Phtz5Rx09; Tue, 23 Jul 2024 13:19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSyRV0cd6z4Hxq; Tue, 23 Jul 2024 13:19:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721740774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1UNWTWH/tinUasOW/tx3sav2rne2qteBkScdp1J1Q0I=; b=AO69R2b4Ps/wlO7yxZL9LGOPkIUKoKLieyi87MSrY3dzgANeW5s/nbnBSWU8E3vx0odSRj sJbfcZPC/NDUZe8Euju2n3TNqbSsspPf/pH0zveHqVJvSPUBRiRDwZ2Ie6NX6bBU7DypQ5 zx4X2pWRjeMMeHewkPCKm71qUrVlJEhYDJxnTORMQpdk61NqVgZA/XrPM6MK4ZiFBAYsJ/ PrZ3KTsHr9IcmTL9W6bgVZAwoDl39AoIbMVYRvFfQk0Ryi5xLTieefEnLU9LIYM1CrFOrT wh2lX9p8lXwuF6nC3uatxj404jc1hOBNnjwlLlyN3HpW+HuEMwzkqI7IvP/rdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721740774; a=rsa-sha256; cv=none; b=VTYHGXUc6tqHYi3tB1t/QsBBD55qczUug/Fha13imNYOtyuuhiJCKZ81fwaZxfgC/PSrrq A92hb1scSYI5f4PzYLgllBzDY90k+x/w8tumtU6YX3PkhGNRU7rRkytkUjk1g4jhQptd6M PasC+YKsMyQYSGmBYYl40PY7ZKvz5+VC2oXl6yFyaSdPol5Rm+Dyl0MaZAIZGefYk5sE0/ VOPbaruAtWzdigVm4chKlKiieviF6N9FMclAhs7nPRvI/rMN5OP21GCWmXwUghswYqV2K9 TQs5LF82Q04pnzTOPP774/CMliFE6AwlTtUAJT9RabOLLtRghX2o0KDOAeQJVg== 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=1721740774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1UNWTWH/tinUasOW/tx3sav2rne2qteBkScdp1J1Q0I=; b=u8F56yqHqglsHyX62yiECMFOoJ7h2dQ0k78+Is9s7HIN/4imqc193YvtfGkMvOM/JuGN6Z f/uE64f4jpOxAF3VfM7LmyiArUYq8O3xCrcucy6BJ8SMYvNfe9KO+KDMG37lRS8l9CXoIa 6vcRdavahkyhXONBm3Gdg6acRZZKUvnrn5bVhw3U0+PS3o5WHXFGj+ip2RfY8w3ecEyurS fBo3xf7b0QANF1mytAcS1cxwPg6WA09W1sDsOpeV6yNSau7fDYA+Vev3k2VNbTnICeypMb QFsCjtK+5BUkoUOy26kLYpkKOy++SD7yrxttwsW6nqnF9tEQypsctqeq9Rrikg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSyRV0CddzTcN; Tue, 23 Jul 2024 13:19:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDJX4K004382; Tue, 23 Jul 2024 13:19:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDJXfu004379; Tue, 23 Jul 2024 13:19:33 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:19:33 GMT Message-Id: <202407231319.46NDJXfu004379@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: b14a49128381 - stable/14 - ktls: Fix races that can lead to double initialization List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b14a491283816864e4b8ec88744efbfd7d4e2bc7 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b14a491283816864e4b8ec88744efbfd7d4e2bc7 commit b14a491283816864e4b8ec88744efbfd7d4e2bc7 Author: Mark Johnston AuthorDate: 2024-07-08 15:49:29 +0000 Commit: Mark Johnston CommitDate: 2024-07-23 13:01:30 +0000 ktls: Fix races that can lead to double initialization ktls_enable_rx() and ktls_enable_tx() have checks to return EALREADY if the socket already has KTLS enabled. However, these are done without any locks held and nothing blocks concurrent attempts to set the socket option. I believe the worst outcome of the race is leaked memory. Fix the problem by rechecking under the sockbuf lock. While here, unify the locking protocol for sb_tls_info: require both the sockbuf and socket I/O locks in order to enable KTLS. This means that either lock is sufficient for checking whether KTLS is enabled in a given sockbuf, which simplifies some refactoring further down the road. Note that the SOLISTENING() check can go away because SOCK_IO_RECV_LOCK() atomically locks the socket buffer and checks whether the socket is a listening socket. This changes the returned errno value, so update a test which checks it. Reviewed by: gallatin MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D45674 (cherry picked from commit 163cdf6a32b9a0f84226a70101d143c10707336f) --- sys/kern/uipc_ktls.c | 23 +++++++++++++++++++++-- sys/sys/sockbuf.h | 3 ++- tests/sys/kern/ktls_test.c | 2 +- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index b4b169c4daf2..294a196db60d 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -1243,12 +1243,23 @@ ktls_enable_rx(struct socket *so, struct tls_enable *en) return (error); } + /* + * Serialize with soreceive_generic() and make sure that we're not + * operating on a listening socket. + */ + error = SOCK_IO_RECV_LOCK(so, SBL_WAIT); + if (error) { + ktls_free(tls); + return (error); + } + /* Mark the socket as using TLS offload. */ SOCK_RECVBUF_LOCK(so); - if (SOLISTENING(so)) { + if (__predict_false(so->so_rcv.sb_tls_info != NULL)) { SOCK_RECVBUF_UNLOCK(so); + SOCK_IO_RECV_UNLOCK(so); ktls_free(tls); - return (EINVAL); + return (EALREADY); } so->so_rcv.sb_tls_seqno = be64dec(en->rec_seq); so->so_rcv.sb_tls_info = tls; @@ -1258,6 +1269,7 @@ ktls_enable_rx(struct socket *so, struct tls_enable *en) sb_mark_notready(&so->so_rcv); ktls_check_rx(&so->so_rcv); SOCK_RECVBUF_UNLOCK(so); + SOCK_IO_RECV_UNLOCK(so); /* Prefer TOE -> ifnet TLS -> software TLS. */ #ifdef TCP_OFFLOAD @@ -1343,6 +1355,13 @@ ktls_enable_tx(struct socket *so, struct tls_enable *en) inp = so->so_pcb; INP_WLOCK(inp); SOCK_SENDBUF_LOCK(so); + if (__predict_false(so->so_snd.sb_tls_info != NULL)) { + SOCK_SENDBUF_UNLOCK(so); + INP_WUNLOCK(inp); + SOCK_IO_SEND_UNLOCK(so); + ktls_free(tls); + return (EALREADY); + } so->so_snd.sb_tls_seqno = be64dec(en->rec_seq); so->so_snd.sb_tls_info = tls; if (tls->mode != TCP_TLS_MODE_SW) { diff --git a/sys/sys/sockbuf.h b/sys/sys/sockbuf.h index 14107f5b2a10..a6ec72975252 100644 --- a/sys/sys/sockbuf.h +++ b/sys/sys/sockbuf.h @@ -130,7 +130,8 @@ struct sockbuf { struct mbuf *sb_mtls; /* TLS mbuf chain */ struct mbuf *sb_mtlstail; /* last mbuf in TLS chain */ uint64_t sb_tls_seqno; /* TLS seqno */ - struct ktls_session *sb_tls_info; /* TLS state */ + /* TLS state, locked by sockbuf and sock I/O mutexes. */ + struct ktls_session *sb_tls_info; }; /* * PF_UNIX/SOCK_DGRAM diff --git a/tests/sys/kern/ktls_test.c b/tests/sys/kern/ktls_test.c index f57ae74112a2..72497196b945 100644 --- a/tests/sys/kern/ktls_test.c +++ b/tests/sys/kern/ktls_test.c @@ -2812,7 +2812,7 @@ ATF_TC_BODY(ktls_listening_socket, tc) TLS_MINOR_VER_THREE, (uint64_t)random(), &en); ATF_REQUIRE_ERRNO(ENOTCONN, setsockopt(s, IPPROTO_TCP, TCP_TXTLS_ENABLE, &en, sizeof(en)) != 0); - ATF_REQUIRE_ERRNO(EINVAL, + ATF_REQUIRE_ERRNO(ENOTCONN, setsockopt(s, IPPROTO_TCP, TCP_RXTLS_ENABLE, &en, sizeof(en)) != 0); ATF_REQUIRE(close(s) == 0); } From nobody Tue Jul 23 13:19:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSyRW3J22z5Rwrs; Tue, 23 Jul 2024 13:19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSyRW2DK7z4HyD; Tue, 23 Jul 2024 13:19:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721740775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d/OjInUEY2RocD7YTqE6sh0mLepnIBWukR11EPRdcOw=; b=fNITH3/y2tA6/E63719ohnB6ccmrdZq9JXugXyelKFeY9gTLE56a+8ayC6W5cZ0KURhTOq 5Nn93PAr0HGw4rb1ApXzC0l00XU6OKWj5hrPMKnCR0wXTrkBxt61M0O7SQfUkifkXemdG1 0DA8XG7ZV1RzKFCDZzbsTQWI0QWX3xZfkobnXqEhM4sPAatxbwYLFmlhKFNgassL0H2y2p 91x7Fa0XKR8sTz+kLLIQhLtzqIiKUvIssWP1SbkvjAVe1wzcPiaka3tzwqure9YJ0B6fjS bVwzndstEi+wUsSfcikg+VzKMwkyKXJl7bL+lrDypaIeDH75FP9VVhPvm+G8oQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721740775; a=rsa-sha256; cv=none; b=KALZsIuHZ7Av5Ij3xwtAYuc6raIxuIK6nEVg2EoETMNOop4yDs+Wz1H8qyfs8wi7dyZZW+ JqJ8j/4G4bH9KSpHqcDJoroHqDborqsrrNvjDUpNoDNt+tQq6Eu086sI391qTAoFyguUWg 9uvsTuc8xEQrAQAzokeQta0qgri82u7tqgpY+736GE2DHQdxDf1SOi5QvGkums+7HIiR8M Vb688aOISId8n7R5cLcy9djaskjtNKFSB6e+uYSGN1jVPSbfpg6suh7jg02AwuitFNq4JX U/h6hZ/vWRRQOJJ4+2O0HjZMmtC8wX9kfIJpTyjNjGmQlfXGh6VL7P6XzQQK9w== 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=1721740775; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d/OjInUEY2RocD7YTqE6sh0mLepnIBWukR11EPRdcOw=; b=MlL8EEkNZNLKrR1j1urLD016bFanZHIlFVmb6wu4zcKt+i+9JPWvJ1OLS0F7kuLkSyybc9 6w62EfMQy/L4n6tOB5ZcVb9dubCoGdMAlu/tEeK9uO5OiCBqR3Myw4GR8WosSextKGa8xv f9M71zer3dV9NAMr/IFa7UWE4MLebGYOmsf3T3CUDP0Sj07HwYUiSqQRmtnqzqA7vjY9Jj nfprfvZ+ZSm8kLWbejbAvXcu+sb8whM7EwDFe8l7q2z6zDU23YaDuZcqkmKsQMs4sVOHYc fpM4h0FKLl4YZ0fuCgWpEQZmUEDhCAU53R88DC5bc4sQNpZ7uJKPbMPcq4jC0A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSyRW1FG4zTcP; Tue, 23 Jul 2024 13:19:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDJZ8K004436; Tue, 23 Jul 2024 13:19:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDJZMG004433; Tue, 23 Jul 2024 13:19:35 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:19:35 GMT Message-Id: <202407231319.46NDJZMG004433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 030cbcc4c231 - stable/14 - if_urndis: Organize buffer layouts more naturally List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 030cbcc4c231be94b5ded668930e5be17cb9d3d5 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=030cbcc4c231be94b5ded668930e5be17cb9d3d5 commit 030cbcc4c231be94b5ded668930e5be17cb9d3d5 Author: Mark Johnston AuthorDate: 2024-07-09 14:10:45 +0000 Commit: Mark Johnston CommitDate: 2024-07-23 13:01:37 +0000 if_urndis: Organize buffer layouts more naturally - Group the request header and I/O buffer in one structure, rather than assuming that both request structures have the same size. - Pass a pointer to the whole structure to urndis_ctrl_query() and urndis_ctrl_set() rather than just the header. Otherwise, on CHERI platforms, these functions violate subobject bounds since they modify the buffer following the header. While here, there is no apparent reason for the request structure used in urndis_attach() to be allocated statically. Change it so that it's allocated on the stack. No functional change intended. Reviewed by: jhb MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D45866 (cherry picked from commit 5dc4682c32691b9d0a20abdc5479d6ce2b36915e) --- sys/dev/usb/net/if_urndis.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sys/dev/usb/net/if_urndis.c b/sys/dev/usb/net/if_urndis.c index 824609aa869f..0a7cb3fed953 100644 --- a/sys/dev/usb/net/if_urndis.c +++ b/sys/dev/usb/net/if_urndis.c @@ -214,15 +214,15 @@ urndis_attach_post(struct usb_ether *ue) static int urndis_attach(device_t dev) { - static struct { - union { + union { + struct { struct rndis_query_req query; + uint8_t addr[ETHER_ADDR_LEN]; + } eaddr; + struct { struct rndis_set_req set; - } hdr; - union { - uint8_t eaddr[ETHER_ADDR_LEN]; uint32_t filter; - } ibuf; + } filter; } msg; struct urndis_softc *sc = device_get_softc(dev); struct usb_ether *ue = &sc->sc_ue; @@ -278,10 +278,10 @@ urndis_attach(device_t dev) } /* Determine MAC address */ - memset(msg.ibuf.eaddr, 0, sizeof(msg.ibuf.eaddr)); + memset(msg.eaddr.addr, 0, sizeof(msg.eaddr.addr)); URNDIS_LOCK(sc); error = urndis_ctrl_query(sc, OID_802_3_PERMANENT_ADDRESS, - &msg.hdr.query, sizeof(msg.hdr.query) + sizeof(msg.ibuf.eaddr), + (struct rndis_query_req *)&msg.eaddr, sizeof(msg.eaddr), &buf, &bufsz); URNDIS_UNLOCK(sc); if (error != (int)RNDIS_STATUS_SUCCESS) { @@ -297,10 +297,10 @@ urndis_attach(device_t dev) /* Initialize packet filter */ sc->sc_filter = NDIS_PACKET_TYPE_BROADCAST | NDIS_PACKET_TYPE_ALL_MULTICAST; - msg.ibuf.filter = htole32(sc->sc_filter); + msg.filter.filter = htole32(sc->sc_filter); URNDIS_LOCK(sc); error = urndis_ctrl_set(sc, OID_GEN_CURRENT_PACKET_FILTER, - &msg.hdr.set, sizeof(msg.hdr.set) + sizeof(msg.ibuf.filter)); + (struct rndis_set_req *)&msg.filter, sizeof(msg.filter)); URNDIS_UNLOCK(sc); if (error != (int)RNDIS_STATUS_SUCCESS) { device_printf(dev, "Unable to set data filters\n"); @@ -641,7 +641,7 @@ urndis_ctrl_handle_reset(struct urndis_softc *sc, msg_filter.filter = htole32(sc->sc_filter); rval = urndis_ctrl_set(sc, OID_GEN_CURRENT_PACKET_FILTER, - &msg_filter.hdr, sizeof(msg_filter)); + (struct rndis_set_req *)&msg_filter, sizeof(msg_filter)); if (rval != RNDIS_STATUS_SUCCESS) { DPRINTF("unable to reset data filters\n"); From nobody Tue Jul 23 13:19:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSyRX3bXzz5Rx7K; Tue, 23 Jul 2024 13:19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSyRX2hnXz4HfV; Tue, 23 Jul 2024 13:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721740776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C7/j+s2uQzJ/rhMYfFJ6Th2hX2/wMH6IqcZ2QrcL3ss=; b=efXoFm86G/OlGKM3hRDHClRCjinQ6XOPFCMVoxlFPMIaV7dpYx2+DPczvoZCWzbXw53ub2 pAmGiMiHRyHqUWKNEUtN2TvjMGV2qWORWvyJhW9PWzKliWlhhg/gtCEFpehZe17E12DPlp 8ncSlDHas+Rzs4gc19qpWt5jg8iYYTX58YN7+IPKsCfjtO0FVtKlQJHIMpyS/XZTZayLUm sFFflGnVYsnJD0PFYxlr0eWmUc4Wby+y3gZbGaVpJntJ4KYUJTiyTfMpldo1DJXnomHbCB SxW0eZif6pV31WHdVDu+huXqFYEM0x0JmAjbk+8MHcNGbfXd5J7j6g4lqMud0g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721740776; a=rsa-sha256; cv=none; b=nR6P60m/08d/JxnBeyOiVTREwttUUq6itTIcQBVWD4k3DOIgqIihRFwQ3n8W0IDYlWfdsX vKh2FjLBVUXCknZ2TBbDTN8O0Hq2ujA8URg4/z/uneXKQ7BUJqbVC24M4ceT6SQTSe/V7u 94Yf4kZsEQiXKs5JKurkCO9gkLBVx+h0qirlc37jH3dwaaCuhSj11bgPT49k09FhBRpjPS oT87sivKU6MqA5pJFwp4dAHyDdUcamfFnT33OGvZoSvX9hWjcVl3SzOPuoEzf2jwX9v9mJ tIpWvFgAjKbs0gJEZ5w7DGgiDFeHP02TbIrD7RQ94yXzZllyRpxszl8IgIfOSw== 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=1721740776; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C7/j+s2uQzJ/rhMYfFJ6Th2hX2/wMH6IqcZ2QrcL3ss=; b=Pu64Bb+kLmmDrishkJQSyIGZJU5cDJU15Eod6xrujhbm9E26udCEh3NeCcXy4YrJn0dQ6l 8342h63gcRKH/9J684IeUVXtUQssqErqjWWz+5rC9gefFzZZIhTrX5oZdsi1CCbhUBbwEb 7lpjyOiHUcq7pGZCRp1GK3LNvhacg+z5fntZEe0wSAvh867ZI+Jc/0oojJZNU7TjWYlKiI Nyz7g8xK27AadyFfe27DZ5C69SDMMZk85dmMy4NIFVO/rtAcaUeXAAjt/InIvIow34dkan pPXwcAW3WjKVJ8PUWwoLK8DCUnJ8Nxa6Qq1oMjnkFfNUi5gFQCGJrAyp0KFcFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSyRX20SJzW3Z; Tue, 23 Jul 2024 13:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDJag6004478; Tue, 23 Jul 2024 13:19:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDJaob004475; Tue, 23 Jul 2024 13:19:36 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:19:36 GMT Message-Id: <202407231319.46NDJaob004475@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: f5fabf3dcfb6 - stable/14 - socket: Simplify synchronization in soreceive_stream() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f5fabf3dcfb67434d13890b9143a361478e731e2 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=f5fabf3dcfb67434d13890b9143a361478e731e2 commit f5fabf3dcfb67434d13890b9143a361478e731e2 Author: Mark Johnston AuthorDate: 2024-07-09 14:33:53 +0000 Commit: Mark Johnston CommitDate: 2024-07-23 13:01:53 +0000 socket: Simplify synchronization in soreceive_stream() Now that the socket recv I/O lock is required in order to enable receive-side KTLS, we can move a check from out of the socket buffer lock, which in turn will simplify some further refactoring. Add a __predict_false annotation while here since we already perform a lockless check before acquiring any locks. Reviewed by: gallatin, jhb MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D45922 (cherry picked from commit 30f30ccae71ce6b3bbe7b2719a3d588cb46f97ba) --- sys/kern/uipc_socket.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 32a6ff14bb43..479184a87a5e 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2560,17 +2560,15 @@ soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(flags)); if (error) return (error); - SOCKBUF_LOCK(sb); - #ifdef KERN_TLS - if (sb->sb_tls_info != NULL) { - SOCKBUF_UNLOCK(sb); + if (__predict_false(sb->sb_tls_info != NULL)) { SOCK_IO_RECV_UNLOCK(so); return (soreceive_generic(so, psa, uio, mp0, controlp, flagsp)); } #endif + SOCKBUF_LOCK(sb); /* Easy one, no space to copyout anything. */ if (uio->uio_resid == 0) { error = EINVAL; From nobody Tue Jul 23 13:55:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSzDb6jfHz5S0Zs; Tue, 23 Jul 2024 13:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSzDb6DCKz4Mb7; Tue, 23 Jul 2024 13:55:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721742911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D9sJcsbICJaSp7DHFks25Z45ZvsrEFnoKQrr+f2PbZc=; b=uDdvXbABl6Ok8ub5ndyyqlnmP6LoSxbXZP5E37+mZr0ZlcpDDIhouSYeV4xZTkeLQEsz/c OR00sWZR/BRnPbjT3DySnJcb2N/XK0M5uL/EHjS4sWpOD4/AaWhcNRvArGNts9EJpRbGex hOwiO4zz9TwX3un5nBoHtqL0nTtNlmrokKF4z+dlTmBNdr+sl6HljiaI85GkXDJP5034JM aOHglnw4pTsC/D5MSIybQZ1uCwIIABRvdu4AWqKW1j9ksh+zPlF+5NXmj+6yYzzzeKmpux IJcgJUotr5g5zje4EI+qEuKCaJKgyHZiubSiOmiERBo2ocIJx13J8DRziXPhfQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721742911; a=rsa-sha256; cv=none; b=s2Rsv1JEODrfyS5IEwGPfzbLFKX2n6EHYwHdAgdO5eLmp8v/rvYnE+O0g2k6ov2Ge3vSfG /mBtiKBm0rzA5vw5nSGT511OTjfQ++yVsSHXEGvNcP1UyLIfMqMBteGZaOxf9ISV64CCBd uQigplxFuzFXWp5QQ59nk3AUxF/8Z70iV3jgt+dIxQ3cMXHEzt2e2ZmWUzruzq5z/PVQ4+ 3OuLrcquFnmblnafASK2jFUeOErPJn7AzlmfiqE/7Se14QivLHuOOlXA2JnyasNSP4z5dV pdjeQqkPGBiqsajLZrCREzoc1wVuPDFJPOcmLQ+RIZhTGSJ38RqzkBEmOntxLg== 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=1721742911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D9sJcsbICJaSp7DHFks25Z45ZvsrEFnoKQrr+f2PbZc=; b=fUgmanRremk5v+zDcnFSplfGphPouRgRrlTO6JZ2m/hVJy6OvqIYKhHWEUudSNWoYct35c EGvBSHry98uf378tX93Q+EN0AGG5Y68cFv/VFaL8p3Q8+kkq3wa5NtSFjdmKehXbcQEWKw 8zuCeI+/evlAxytvgVZdwxjkq0dRbh3u9aOfhZj56s0RXmbv43O9lFtuDN9CxLFaR9Q1IP sE37e24oKAmeK3/lG12haw4+c+m/avELNVAms+dJxTNic9PPfbVoqhCpUty5gi1CgDxxtT Sl22CsnBYTAhQgSg54O9kFRDfTDZZ2TOUtlp55qNyy9ofQCWFRgNiuRCcSe1wA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSzDb5QzPzX87; Tue, 23 Jul 2024 13:55:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDtB6o070928; Tue, 23 Jul 2024 13:55:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDtBfa070925; Tue, 23 Jul 2024 13:55:11 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:55:11 GMT Message-Id: <202407231355.46NDtBfa070925@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 17c6c686eda8 - stable/13 - acpi: Narrow workaround for broken interrupt settings on x86 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 17c6c686eda814c52218ea6b393c8388bc6bc1b4 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=17c6c686eda814c52218ea6b393c8388bc6bc1b4 commit 17c6c686eda814c52218ea6b393c8388bc6bc1b4 Author: John Baldwin AuthorDate: 2024-07-15 19:13:08 +0000 Commit: John Baldwin CommitDate: 2024-07-23 13:29:17 +0000 acpi: Narrow workaround for broken interrupt settings on x86 Commit 9a7bf07ccdc1 from 2016 introduced a workaround for some broken BIOSes that specified active-lo instead of active-hi polarity for ISA IRQs for UARTs. The workaround assumed that edge-sensitive ISA IRQs on x86 should always be active-hi. However, some recent AMD systems actually use active-lo edge-sensitive ISA IRQs (and not just for UARTs, but also for the keyboard and PS/2 mouse devices) and the override causes interrupts to be dropped resulting in boot time hangs, non-working keyboards, etc. Add a hw.acpi.override_isa_irq_polarity tunable (readable as a sysctl post-boot) to control this quirk. It can be set to 1 to force enable the override and 0 to disable it. The log of original message mentions an Intel motherboard as the sample case, so default the tunable to 1 on systems with an Intel CPU and 0 otherwise. Special thanks to Matthias Lanter for tracking down boot time issues on recent AMD systems to mismatched interrupt polarity. PR: 270707 Reported by: aixdroix_OSS@protonmail.com, Michael Dexter Reported by: mfw_burn@pm.me, Hannes Hfauswedell Reported by: Matthias Lanter Reported by: William Bulley Reviewed by: imp, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45554 (cherry picked from commit 0a34d050ae8ea14feddd3d2a62fd2f612613b2c5) --- share/man/man4/acpi.4 | 8 +++++++- sys/dev/acpica/acpi.c | 19 +++++++++++++++++++ sys/dev/acpica/acpi_resource.c | 11 ++++------- sys/dev/acpica/acpivar.h | 12 ++++++++++++ 4 files changed, 42 insertions(+), 8 deletions(-) diff --git a/share/man/man4/acpi.4 b/share/man/man4/acpi.4 index 53ed47fdfaee..cdad3ceeedfc 100644 --- a/share/man/man4/acpi.4 +++ b/share/man/man4/acpi.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 24, 2021 +.Dd July 15, 2024 .Dt ACPI 4 .Os .Sh NAME @@ -256,6 +256,12 @@ is a valid list of two interfaces .Qq Li FreeBSD and .Qq Li Linux . +.It Va hw.acpi.hw.acpi.override_isa_irq_polarity (x86) +Forces active-lo polarity for edge-triggered ISA interrupts. +Some older systems incorrectly specify active-lo polarity for ISA +interrupts and this override fixes those systems. +This override is enabled by default on systems with Intel CPUs, +but can be enabled or disabled by setting the tunable explicitly. .It Va hw.acpi.reset_video Enables calling the VESA reset BIOS vector on the resume path. This can fix some graphics cards that have problems such as LCD white-out diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 1706938e49a3..0dd75166c5d2 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -55,6 +55,8 @@ #if defined(__i386__) || defined(__amd64__) #include #include +#include +#include #endif #include #include @@ -301,6 +303,10 @@ int acpi_susp_bounce; SYSCTL_INT(_debug_acpi, OID_AUTO, suspend_bounce, CTLFLAG_RW, &acpi_susp_bounce, 0, "Don't actually suspend, just test devices."); +#if defined(__amd64__) || defined(__i386__) +int acpi_override_isa_irq_polarity; +#endif + /* * ACPI standard UUID for Device Specific Data Package * "Device Properties UUID for _DSD" Rev. 2.0 @@ -613,6 +619,19 @@ acpi_attach(device_t dev) OID_AUTO, "handle_reboot", CTLFLAG_RW, &sc->acpi_handle_reboot, 0, "Use ACPI Reset Register to reboot"); +#if defined(__amd64__) || defined(__i386__) + /* + * Enable workaround for incorrect ISA IRQ polarity by default on + * systems with Intel CPUs. + */ + if (cpu_vendor_id == CPU_VENDOR_INTEL) + acpi_override_isa_irq_polarity = 1; + SYSCTL_ADD_INT(&sc->acpi_sysctl_ctx, SYSCTL_CHILDREN(sc->acpi_sysctl_tree), + OID_AUTO, "override_isa_irq_polarity", CTLFLAG_RDTUN, + &acpi_override_isa_irq_polarity, 0, + "Force active-hi polarity for edge-triggered ISA IRQs"); +#endif + /* * Default to 1 second before sleeping to give some machines time to * stabilize. diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c index e81b5ec53f2d..ebfcc7447677 100644 --- a/sys/dev/acpica/acpi_resource.c +++ b/sys/dev/acpica/acpi_resource.c @@ -159,14 +159,11 @@ acpi_config_intr(device_t dev, ACPI_RESOURCE *res) } #if defined(__amd64__) || defined(__i386__) - /* - * XXX: Certain BIOSes have buggy AML that specify an IRQ that is - * edge-sensitive and active-lo. However, edge-sensitive IRQs - * should be active-hi. Force IRQs with an ISA IRQ value to be - * active-hi instead. - */ - if (irq < 16 && trig == ACPI_EDGE_SENSITIVE && pol == ACPI_ACTIVE_LOW) + if (irq < 16 && trig == ACPI_EDGE_SENSITIVE && pol == ACPI_ACTIVE_LOW && + acpi_override_isa_irq_polarity) { + device_printf(dev, "forcing active-hi polarity for IRQ %u\n", irq); pol = ACPI_ACTIVE_HIGH; + } #endif BUS_CONFIG_INTR(dev, irq, (trig == ACPI_EDGE_SENSITIVE) ? INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, (pol == ACPI_ACTIVE_HIGH) ? diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index 362538e47bfc..2410dcb14993 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -231,6 +231,18 @@ extern int acpi_quirks; #define ACPI_Q_TIMER (1 << 1) #define ACPI_Q_MADT_IRQ0 (1 << 2) +#if defined(__amd64__) || defined(__i386__) +/* + * Certain Intel BIOSes have buggy AML that specify an IRQ that is + * edge-sensitive and active-lo. Normally, edge-sensitive IRQs should + * be active-hi. If this value is non-zero, edge-sensitive ISA IRQs + * are forced to be active-hi instead. At least some AMD systems use + * active-lo edge-sensitive ISA IRQs, so this setting is only enabled + * by default on systems with Intel CPUs. + */ +extern int acpi_override_isa_irq_polarity; +#endif + /* * Plug and play information for device matching. Matching table format * is compatible with ids parameter of ACPI_ID_PROBE bus method. From nobody Tue Jul 23 13:55:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSzDc6zyBz5S0Zw; Tue, 23 Jul 2024 13:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSzDc6KW9z4Mk1; Tue, 23 Jul 2024 13:55:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721742912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vWGAC/0Y+Arh6Pj+5yh3AQXBFwZwqkZpJdIsUXNsxig=; b=h4cccFWfjjo2zg3QdyERdpyEaV8VgZ8NOPeKYhToFRiFyslVHpYcV+NozybuLzW6tntFmA tclmr5cINhuJ1pJc9eqVH6B6Rw2dadlN7zzHP0/k8aN8ymvE4xinfs1BaDRcBy7OM8pomt XKfddXAPqqxsBOuV/dWT+3O7uSYNGiM7vye0OBPGHlrWGn9GYN25nuiPVajbVMc6UCs2sS tl9vyznfSCPDZ6vTB9uCQ+ArJr3jhlTYyckSxwf+qfJDeNFtvxIHJuYXMlHzWeK5nrca59 W2cUiyLFpqkFzAz2VkYZOU4o7lz7fpWSB7/KJnuoig8C/9vqF7FpCH+cobbwwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721742912; a=rsa-sha256; cv=none; b=xy2Vix91UDOa73ug3idrCHNFek7zk63c2tpSk1Qy8FLlNA4UoM/Uk9E92Et/idunPjVDKX DvnBewiQ4PVoWWqcOxQ5LYqgwkBEYeiSt5Yi+kEeP9ZZohw++O5JcKrgxXHQFhIexholhG wE28a+EiZq1jpNG4gLtpOm4Y5XVSKd5VIMwTVu/Fp3Ee7uEDXMvZWToz6KvZ6HkJ0TZdPZ 8pcASXb+PaDWn4NkJzURZuPLbOEhfrsgRynYmQpCDHDEJKGDmNJIQ0z3wuasqnZG8otZ3H 9asl4PYJs1bOWN0VoW8iteykIAyxwsEbKF1/WUTs7GSiZhKHA6mob41N+426/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=1721742912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vWGAC/0Y+Arh6Pj+5yh3AQXBFwZwqkZpJdIsUXNsxig=; b=QpZhUjOkdS56Oxv1uy8ZfJRG97wNhb/36tDUfWdkVAeNW9eP4zNuAyxTvgX2DFWcwyPpUC rVt5XlNUoe4XZn6XPVHicVxZMbP4TIMkmYyLqJPGWfNa8c7CfMXYIG3NESt9LEtVek0AWT lI4i7980qWvimjvg6yZ+biNrpsfNWy2mSs0obWMBdvM+f0DvH9dIKl6Fjvh/XtR3DezdBc lSfJ8yMHAy1Hq0LSor/0OjmrcbNmtt38aNnxh4smC/Y/TD8bGs6whmp7MexWKYExLt+sl1 l7FMpWWwezjE3U1MLI91Lp8E77aTSa4NNGc8lJKbt/QMYNTiZNUf9yX5T0+5Jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSzDc5wmpzXJ2; Tue, 23 Jul 2024 13:55:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDtC2P070979; Tue, 23 Jul 2024 13:55:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDtCDG070976; Tue, 23 Jul 2024 13:55:12 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:55:12 GMT Message-Id: <202407231355.46NDtCDG070976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 60e1c72afd02 - stable/13 - amd64 GENERIC: Drop hints for fdc0 and ppc0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 60e1c72afd02a2e1f09800f0fb070d1447c5aa84 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=60e1c72afd02a2e1f09800f0fb070d1447c5aa84 commit 60e1c72afd02a2e1f09800f0fb070d1447c5aa84 Author: John Baldwin AuthorDate: 2024-07-15 14:16:39 +0000 Commit: John Baldwin CommitDate: 2024-07-23 13:29:17 +0000 amd64 GENERIC: Drop hints for fdc0 and ppc0 Modern x86 systems do not ship with ISA floppy disk controllers or LPT ports. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D45946 (cherry picked from commit 480cc750a2a8f92d078803f15eecb1f8a084a1ea) --- sys/amd64/conf/GENERIC.hints | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sys/amd64/conf/GENERIC.hints b/sys/amd64/conf/GENERIC.hints index be3f59cd1950..7c2a3f28b9ce 100644 --- a/sys/amd64/conf/GENERIC.hints +++ b/sys/amd64/conf/GENERIC.hints @@ -1,11 +1,3 @@ -hint.fdc.0.at="isa" -hint.fdc.0.port="0x3F0" -hint.fdc.0.irq="6" -hint.fdc.0.drq="2" -hint.fd.0.at="fdc0" -hint.fd.0.drive="0" -hint.fd.1.at="fdc0" -hint.fd.1.drive="1" hint.atkbdc.0.at="isa" hint.atkbdc.0.port="0x060" hint.atkbd.0.at="atkbdc" @@ -21,8 +13,6 @@ hint.uart.0.irq="4" hint.uart.1.at="isa" hint.uart.1.port="0x2F8" hint.uart.1.irq="3" -hint.ppc.0.at="isa" -hint.ppc.0.irq="7" hint.atrtc.0.at="isa" hint.atrtc.0.port="0x70" hint.atrtc.0.irq="8" From nobody Tue Jul 23 13:55:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WSzDf48Z5z5S0Pq; Tue, 23 Jul 2024 13:55: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WSzDf08b7z4MhJ; Tue, 23 Jul 2024 13:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721742914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E/BKnFIFJlkIPWWj8V5oO1EkJK5yeubUp4CG5FlSqyg=; b=XI2D7A2rws8/JE3stSGqbxjLQkAy2uRFilJzv9Gdr99aEYnqElBKgCoqBoky7az5L33+xQ l1CxPt30nC+XchMPmQ7Feypdb7rqdeCB2Akh29bP82DldGJCbVPsUy1RB4Dw2NDBtI/pJD Tk2lN8jD5TCFa/SP80n2En7klwWkb3muKfUn62XrzpweKUCmkzhHJRuNfvJlZYSM+o45kb juvpcFZG8/zA+Nmf8SSyAJA05YFPRL6dji+UnO7gdD/Fow51ibn/QmyhGL4QMBkwavk5P+ 8yXBxKcyjcJyvMorkjDk0yYBzcNIj26eTsydzF0q94bTJPgXXQQR55Qo+LLL0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721742914; a=rsa-sha256; cv=none; b=Yx2X4Op19XFRj4z/vOSzTibj9vAldzB2ioX2EHaehqlEhDAkeNElJ7yHiuyKKThfJnqLc1 zZp/G0vae1MgWiDwz3fauhsPeI92Ss1zwgSADhIqAg/00BtJwsRvD1ULGfck6Yhv3R7nRQ eimpBXPX19DaeqrvjQQP/JsnJVYvKhAH1JnGXeVHbt8WST38TQMftZb5Czpe8zmXFqNRsy s5o+CadVFq+bH5BnBH5f38irannQ+tyx3vBD4YweCsoUvVcoG2DbzW1YBR8D9DNRHqcDi4 zdlSloBvPuZYS2ELtqYSjmO0I2agbL/9Bu2X2UeeQAUsHkm8C5/5B5UCjWW18g== 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=1721742914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E/BKnFIFJlkIPWWj8V5oO1EkJK5yeubUp4CG5FlSqyg=; b=TOgsmM4sJ9HdlXpenZ+VR8gCmgpTOsnsK5Nxpnc5ghYzYBmT4ZvEsoLIgP8stZfASJRcbi /Pozy2zTJuDuDIC+bOeqxu4dooftOYTGdtzX2ZiIgmx7ZGt/+LUct3VJULKR5xSgkKk/kO lLf5jMuFb9XgMuZ8NqFNbiXntyypHvf5X/4R9qmpcZTRrrYJQR37Y+uMxx18jkqSbttbXd NSQa78oZ+uHxcvdQ3vVr/x/8qX38OYhV39B1DbdS4RTsgiYJyaQNYq22ByX24VbWrb08MV SNdMy+rmUmRPRxoGuyYoYeGcApP28F4X++Mf/E2VYiV8VnZGK+v5bpxXhuBdmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WSzDd6ZyHzXKx; Tue, 23 Jul 2024 13:55:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NDtDXo071033; Tue, 23 Jul 2024 13:55:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NDtD8v071030; Tue, 23 Jul 2024 13:55:13 GMT (envelope-from git) Date: Tue, 23 Jul 2024 13:55:13 GMT Message-Id: <202407231355.46NDtD8v071030@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 8e9992f7e326 - stable/13 - amd64 GENERIC: Switch uart hints from "isa" to "acpi" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8e9992f7e32647a4b73a215e7cb6a7c159403988 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8e9992f7e32647a4b73a215e7cb6a7c159403988 commit 8e9992f7e32647a4b73a215e7cb6a7c159403988 Author: John Baldwin AuthorDate: 2024-07-15 19:14:01 +0000 Commit: John Baldwin CommitDate: 2024-07-23 13:29:17 +0000 amd64 GENERIC: Switch uart hints from "isa" to "acpi" This causes these hints to be only used to wire device unit numbers for serial ports enumerated by ACPI but will not create ISA device nodes if ACPI doesn't enumerate them. Note that IRQ hints are not used for wiring so have been removed. PR: 270707 Reported by: aixdroix_OSS@protonmail.com, Michael Dexter Reported by: mfw_burn@pm.me, Hannes Hfauswedell Reported by: Matthias Lanter Reported by: William Bulley Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45945 (cherry picked from commit 9cc06bf7aa2846c35483de567779bb8afc289f53) --- sys/amd64/conf/GENERIC.hints | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/amd64/conf/GENERIC.hints b/sys/amd64/conf/GENERIC.hints index 7c2a3f28b9ce..4f6121c7cf77 100644 --- a/sys/amd64/conf/GENERIC.hints +++ b/sys/amd64/conf/GENERIC.hints @@ -6,13 +6,11 @@ hint.psm.0.at="atkbdc" hint.psm.0.irq="12" hint.sc.0.at="isa" hint.sc.0.flags="0x100" -hint.uart.0.at="isa" +hint.uart.0.at="acpi" hint.uart.0.port="0x3F8" hint.uart.0.flags="0x10" -hint.uart.0.irq="4" -hint.uart.1.at="isa" +hint.uart.1.at="acpi" hint.uart.1.port="0x2F8" -hint.uart.1.irq="3" hint.atrtc.0.at="isa" hint.atrtc.0.port="0x70" hint.atrtc.0.irq="8" From nobody Tue Jul 23 15:00:08 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WT0gX4d34z5S54g; Tue, 23 Jul 2024 15:00: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WT0gX47Bfz4V0w; Tue, 23 Jul 2024 15:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721746808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BYs5iyUw2MbzLWywTP3XCdPjBwLwTDQvKZ6TZkCh0w0=; b=I4YF3fwZCXwVcgft1N1JQI/Fs6YfvlIUK25kf8t66+Gstc3EvYHDfPaOgfT8CgYx83TMgT bhqcXx5IY9LnF4eTGLdZftRloWP7wKZefhShuZ/u4PPkMr/1/m6TmE+xnED9+G9fN3K6wx 2RULWlTavNb4LaL2fTs7/fOdOhBWCkqUWEeo2AQkKe+ZZuJc9YJFIT8FivwA/O6SRek2l4 B38yeoWOD1NmlmZPxXAj9FHtkTHCd0pECSZO29WbevPb9mZJb2GMGAytcTGP5sgZLih0Za nTVvbtFE2IIlJWBsnEIkPkCiVbUnCAqgJbsDU33hmHW7dYAQxotqV6JUT5N5qg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721746808; a=rsa-sha256; cv=none; b=rFubcyHCK3tua4ZJCIbUhRWSoPAXnO20N/LraRqTca/z8IH7a+7MK856E0L6GN6kKxKHEI tCsYJUuqDs+0XyN+DaC1IJYZluwzQ7iun+QDDUSfJFaGZWhqCNstTL4XF2YofA3aq46ugU WfqnnRBpA3tghwebh6+zUcH+bGP3XcLGI7OzXkpUCDiCnJZ8NNulBE0+Vlomec55qe/VJC 6QgCS5pdoceiW3jcq/WSaj0Xwn3QL5Mms/mTRH0hYjyP8Oks15aEVUhNOIOe6bbeTASFzJ Hho22fWZIggGy0lk6W97dQkQa0fyfPHVDkiCa0F+B9WRoSwHGbbhMJcban1u/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=1721746808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=BYs5iyUw2MbzLWywTP3XCdPjBwLwTDQvKZ6TZkCh0w0=; b=q5okBdHln72cZJA0DHinvitj2hxB8Y9dAxdK27lfmPi9Gymcfhm4w+MdzLwZsD9neIz/Eb uJdV4Tvx6x/y3COHhOCuK/NY0jWHrmYM3Zq8thE9H0HoA6h6PT11j9Wwy/9vQrgGrpOIFe QsMhr/tLd8BUIoWOtSWMWCbgTnd9i2X04YRi7TQebn6lyFvwDPFvkaqKdrvMi0Owf98ds9 hmjf85VqGe7+9DUX1dUdFp1o4Ohzf9TIJLZLa7dt9wLFcE8jI/9CFUXLo4CuoGR4yamLWP WKVxyKJdEBiyxcSro7HbjQNLxACEzE1kG1NtoeDzu9rAGwLGLa7LWnSH0o5nyQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WT0gX3jphzY98; Tue, 23 Jul 2024 15:00:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NF08ht078763; Tue, 23 Jul 2024 15:00:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NF084p078758; Tue, 23 Jul 2024 15:00:08 GMT (envelope-from git) Date: Tue, 23 Jul 2024 15:00:08 GMT Message-Id: <202407231500.46NF084p078758@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: ae8d58814089 - main - vnet tests: verify that we can load if_epair and if_bridge List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ae8d58814089308028046ac80aeeb9cbb784bd0a Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=ae8d58814089308028046ac80aeeb9cbb784bd0a commit ae8d58814089308028046ac80aeeb9cbb784bd0a Author: Kristof Provost AuthorDate: 2024-07-18 20:36:55 +0000 Commit: Kristof Provost CommitDate: 2024-07-23 13:57:25 +0000 vnet tests: verify that we can load if_epair and if_bridge We're going to start running many of the vnet tests in nested jails (so they can run in parallel). That means the tests won't be able to load kernel modules, which we commonly do for if_epair and if_bridge. Just assume that all vnet tests need this, because so many of them do that we don't want to manually annotate all of them. This is essentially a no-op on non-nested tests. Do the same for the python test framework. While here also have pflog_init actually call pft_init. While having pflog loaded implies we have pf too pft_init also checks for vimage support, and now for if_epair. Reviewed by: markj MFC after: 1 month Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46039 --- tests/atf_python/sys/net/vnet.py | 6 ++++++ tests/sys/common/vnet.subr | 21 +++++++++++++++++++++ tests/sys/netpfil/pf/utils.subr | 2 ++ 3 files changed, 29 insertions(+) diff --git a/tests/atf_python/sys/net/vnet.py b/tests/atf_python/sys/net/vnet.py index 67fe15fff69c..6da5f2625990 100644 --- a/tests/atf_python/sys/net/vnet.py +++ b/tests/atf_python/sys/net/vnet.py @@ -334,6 +334,10 @@ class VnetTestTemplate(BaseTest): NEED_ROOT: bool = True TOPOLOGY = {} + def _require_default_modules(self): + libc.kldload("if_epair.ko") + self.require_module("if_epair") + def _get_vnet_handler(self, vnet_alias: str): handler_name = "{}_handler".format(vnet_alias) return getattr(self, handler_name, None) @@ -451,6 +455,8 @@ class VnetTestTemplate(BaseTest): def setup_method(self, _method): """Sets up all the required topology and handlers for the given test""" super().setup_method(_method) + self._require_default_modules() + # TestIP6Output.test_output6_pktinfo[ipandif] topology_id = get_topology_id(self.test_id) topology = self.TOPOLOGY diff --git a/tests/sys/common/vnet.subr b/tests/sys/common/vnet.subr index fd67385655fc..bd98b02da33f 100644 --- a/tests/sys/common/vnet.subr +++ b/tests/sys/common/vnet.subr @@ -11,11 +11,32 @@ unlist_interface() sed -i "" /^$1\$/d created_interfaces.lst } +_vnet_check_req() +{ + type=$1 + + if kldstat -q -n if_${type}.ko; then + return + fi + + if ! kldload -n -q if_${type}; then + atf_skip "if_${type}.ko is required to run this test." + return + fi +} + vnet_init() { if [ "`sysctl -i -n kern.features.vimage`" != 1 ]; then atf_skip "This test requires VIMAGE" fi + + # Check if we can create if_epair or if_bridge interfaces. + # We may be running in a jail already, unable to load modules. + # If so, skip this test because it very likely (but not certainly) + # wants at least one of those + _vnet_check_req epair + _vnet_check_req bridge } vnet_mkepair() diff --git a/tests/sys/netpfil/pf/utils.subr b/tests/sys/netpfil/pf/utils.subr index 25720c1bcb66..f02dfc22049f 100644 --- a/tests/sys/netpfil/pf/utils.subr +++ b/tests/sys/netpfil/pf/utils.subr @@ -83,6 +83,8 @@ pfsynct_init() pflog_init() { + pft_init + if ! kldstat -q -m pflog; then atf_skip "This test requires pflog" fi From nobody Tue Jul 23 15:00:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WT0gY5252z5S54h; Tue, 23 Jul 2024 15:00: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WT0gY4XGVz4TVR; Tue, 23 Jul 2024 15:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721746809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S0PCKdYJ46mXK3cxa6E+uldgAJnaMyZjQ7UkpwmWHms=; b=u8Ek4pLgZ2F/GDWUmuv89zkC4WHEtPGjrX2d2RJJr0HEwBNF4rRDyAkVffYE2LM9VwX0E4 l98l3uV1wMRbMove3NG1lOgI8GRe9V9tEmMXGoZ0v7jMtVAFqqOHT5S3QLo/rRmdqgBSfo HPQdDQBqFFGJhl4Ex06BdWIhWjGAX3mMxa8W8iGxaJ+GOzPR/7BKV17jiP7TnDBJl+Zuo3 fJZT4D3lAbXXrv7viBy033j6AD3l6N11OpnrbLqU61KHwnSD7erMph2E91mWXgUYvYKZh9 t6NPgjrEfqh/pExbtDAbnrw/7XGrAjzmgBNtTYOPbdkOv335GBuWWkCGv+bQ9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721746809; a=rsa-sha256; cv=none; b=o9ptGa7YgGH99tAYIJP4lTleZDNG+EUDUgFKN7gSKmWTAhIpQ7Xb2/I4Z/pUnlCDmbXqaC 1WDWs+nlm8IqE8Vzy6W1NU9IPYWMZlVudYkDduhho/ByTcR+2b0Ys9eMeLPLZbdOhQmPam QCulS2Mh05kdOnohs3gBB+m6sPfJtz21b9QG7/L+e59ANphOVNlZ7rHj91i9MooqU06qVG GO8qDTRIjLN5fDIdbiNztU5BOYOYCwlLlgFNUtBG1gR69vFddWexaloK0g9XUvXDm3ocPr 70qo3VdhvJ/624/v7LYXhyPj4gAX6COxKDwdfM7WKaIBjDrhksD8dLVvguso/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=1721746809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=S0PCKdYJ46mXK3cxa6E+uldgAJnaMyZjQ7UkpwmWHms=; b=HHD0n8pW9aIdvHM0TU453UzG25px1rbsPCD3//P9YE+PizYn4dWvg186viLsygKJdPkRqb LnIzJ6heXoHSsTeTle5vzo97thNiLjHEQjDSn699BfIwKKQs8Xeg6XeKDDEsQDv8tTbqH/ VVFhMQqWvmGjg536gtFK4v6M5p2Yy2ri7Zyh7ZBaapqpdxwFjeWwPfRYfOAtOCFtel/CR3 rhJvHc9MvLknMZO4tlbR5y2DZdq1xKhTO65vm7fw/w3d1TSWQIqwMAhpqA3sLy+C5PwYjc 4jRgwvTPHy5MqeHlAmTfvnjOltLXcZq1aDdYn+c/uGkYc5r0/+9OhNBVoLkpNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WT0gY481GzY99; Tue, 23 Jul 2024 15:00:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NF09Tw079152; Tue, 23 Jul 2024 15:00:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NF09lV079140; Tue, 23 Jul 2024 15:00:09 GMT (envelope-from git) Date: Tue, 23 Jul 2024 15:00:09 GMT Message-Id: <202407231500.46NF09lV079140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: b0fcf4d5222b - main - pf tests: ensure temporary files end up in the atf working directory List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b0fcf4d5222bfdbbc0e2af2b14f0d73704706aa0 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b0fcf4d5222bfdbbc0e2af2b14f0d73704706aa0 commit b0fcf4d5222bfdbbc0e2af2b14f0d73704706aa0 Author: Kristof Provost AuthorDate: 2024-07-19 13:13:33 +0000 Commit: Kristof Provost CommitDate: 2024-07-23 14:59:31 +0000 pf tests: ensure temporary files end up in the atf working directory Many of the tests create temporary files. pid files, log files, tcpdump captures, ... We should take care to ensure they're stored in the temporary working directory Kyua creates rather than in the root directory. This ensures there are no conflicts between simultaneously running tests, and also keeps the root directory clean. MFC after: 1 month Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/common/dummynet.sh | 4 ++-- tests/sys/netpfil/pf/altq.sh | 2 +- tests/sys/netpfil/pf/ether.sh | 4 ++-- tests/sys/netpfil/pf/killstate.sh | 2 +- tests/sys/netpfil/pf/map_e.sh | 3 +-- tests/sys/netpfil/pf/nat.sh | 3 +-- tests/sys/netpfil/pf/proxy.sh | 2 +- tests/sys/netpfil/pf/rdr.sh | 4 ++-- tests/sys/netpfil/pf/ridentifier.sh | 16 +++++++--------- tests/sys/netpfil/pf/route_to.sh | 3 +-- tests/sys/netpfil/pf/syncookie.sh | 15 ++++++--------- tests/sys/netpfil/pf/synproxy.sh | 9 +++------ 12 files changed, 28 insertions(+), 39 deletions(-) diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh index 0df0db4546c8..126240f00384 100644 --- a/tests/sys/netpfil/common/dummynet.sh +++ b/tests/sys/netpfil/common/dummynet.sh @@ -277,7 +277,7 @@ queue_body() ifconfig ${epair}a 192.0.2.1/24 up jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up - jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + jexec alcatraz /usr/sbin/inetd -p ${PWD}/inetd-alcatraz.pid \ $(atf_get_srcdir)/../pf/echo_inetd.conf # Sanity check @@ -385,7 +385,7 @@ queue_v6_body() ifconfig ${epair}a inet6 2001:db8:42::1/64 no_dad up jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2 no_dad up - jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + jexec alcatraz /usr/sbin/inetd -p ${PWD}/inetd-alcatraz.pid \ $(atf_get_srcdir)/../pf/echo_inetd.conf jexec alcatraz sysctl net.inet6.icmp6.errppslimit=0 diff --git a/tests/sys/netpfil/pf/altq.sh b/tests/sys/netpfil/pf/altq.sh index a902c7caaf4f..416a55777849 100644 --- a/tests/sys/netpfil/pf/altq.sh +++ b/tests/sys/netpfil/pf/altq.sh @@ -212,7 +212,7 @@ prioritise_body() ifconfig ${epair}a 192.0.2.1/24 up jexec altq_prioritise ifconfig ${epair}b 192.0.2.2/24 up - jexec altq_prioritise /usr/sbin/inetd -p inetd-altq.pid \ + jexec altq_prioritise /usr/sbin/inetd -p ${PWD}/inetd-altq.pid \ $(atf_get_srcdir)/../pf/echo_inetd.conf # Sanity check diff --git a/tests/sys/netpfil/pf/ether.sh b/tests/sys/netpfil/pf/ether.sh index e1855949476b..0369e0e57ee6 100644 --- a/tests/sys/netpfil/pf/ether.sh +++ b/tests/sys/netpfil/pf/ether.sh @@ -362,8 +362,8 @@ captive_long_body() # ICMP should still work, because we don't redirect it. atf_check -s exit:0 -o ignore ping -c 1 -t 1 198.51.100.2 - jexec gw /usr/sbin/inetd -p gw.pid $(atf_get_srcdir)/echo_inetd.conf - jexec srv /usr/sbin/inetd -p srv.pid $(atf_get_srcdir)/daytime_inetd.conf + jexec gw /usr/sbin/inetd -p ${PWD}/gw.pid $(atf_get_srcdir)/echo_inetd.conf + jexec srv /usr/sbin/inetd -p ${PWD}/srv.pid $(atf_get_srcdir)/daytime_inetd.conf echo foo | nc -N 198.51.100.2 13 diff --git a/tests/sys/netpfil/pf/killstate.sh b/tests/sys/netpfil/pf/killstate.sh index 046d640ed355..36743b1d8016 100644 --- a/tests/sys/netpfil/pf/killstate.sh +++ b/tests/sys/netpfil/pf/killstate.sh @@ -410,7 +410,7 @@ match_body() vnet_mkjail singsing ${epair_two}b jexec singsing ifconfig ${epair_two}b 198.51.100.2/24 up jexec singsing route add default 198.51.100.1 - jexec singsing /usr/sbin/inetd -p inetd-echo.pid \ + jexec singsing /usr/sbin/inetd -p ${PWD}/inetd-echo.pid \ $(atf_get_srcdir)/echo_inetd.conf route add 198.51.100.0/24 192.0.2.2 diff --git a/tests/sys/netpfil/pf/map_e.sh b/tests/sys/netpfil/pf/map_e.sh index 742264dcf547..59f9e7f7e14c 100644 --- a/tests/sys/netpfil/pf/map_e.sh +++ b/tests/sys/netpfil/pf/map_e.sh @@ -53,7 +53,7 @@ map_e_body() jexec map_e sysctl net.inet.ip.forwarding=1 jexec echo ifconfig ${epair_echo}b 198.51.100.2/24 up - jexec echo /usr/sbin/inetd -p inetd-echo.pid $(atf_get_srcdir)/echo_inetd.conf + jexec echo /usr/sbin/inetd -p ${PWD}/inetd-echo.pid $(atf_get_srcdir)/echo_inetd.conf # Enable pf! jexec map_e pfctl -e @@ -81,7 +81,6 @@ map_e_body() map_e_cleanup() { - rm -f inetd-echo.pid pft_cleanup } diff --git a/tests/sys/netpfil/pf/nat.sh b/tests/sys/netpfil/pf/nat.sh index 7cc0d8f35c96..513abfa5e040 100644 --- a/tests/sys/netpfil/pf/nat.sh +++ b/tests/sys/netpfil/pf/nat.sh @@ -51,7 +51,7 @@ exhaust_body() jexec nat sysctl net.inet.ip.forwarding=1 jexec echo ifconfig ${epair_echo}b 198.51.100.2/24 up - jexec echo /usr/sbin/inetd -p inetd-echo.pid $(atf_get_srcdir)/echo_inetd.conf + jexec echo /usr/sbin/inetd -p ${PWD}/inetd-echo.pid $(atf_get_srcdir)/echo_inetd.conf # Enable pf! jexec nat pfctl -e @@ -79,7 +79,6 @@ exhaust_body() exhaust_cleanup() { - rm -f inetd-echo.pid pft_cleanup } diff --git a/tests/sys/netpfil/pf/proxy.sh b/tests/sys/netpfil/pf/proxy.sh index 4a7ea00a0cd4..b112001ef2b4 100644 --- a/tests/sys/netpfil/pf/proxy.sh +++ b/tests/sys/netpfil/pf/proxy.sh @@ -57,7 +57,7 @@ ftp_body() jexec srv route add default 198.51.100.1 # Start FTP server in srv - jexec srv twistd ftp -r `pwd` -p 21 + jexec srv twistd --logfile=/dev/null ftp -r `pwd` -p 21 # Sanity check atf_check -s exit:0 -o ignore ping -c 1 198.51.100.2 diff --git a/tests/sys/netpfil/pf/rdr.sh b/tests/sys/netpfil/pf/rdr.sh index 5e60b97c653b..b7ec80b4d85e 100644 --- a/tests/sys/netpfil/pf/rdr.sh +++ b/tests/sys/netpfil/pf/rdr.sh @@ -92,7 +92,7 @@ tcp_v6_body() jexec ${j}a ping -6 -c 1 2001:db8:b::2 # capture packets on c so we can look for incorrect checksums - jexec ${j}c tcpdump --immediate-mode -w ${j}.pcap tcp and port 8000 & + jexec ${j}c tcpdump --immediate-mode -w ${PWD}/${j}.pcap tcp and port 8000 & tcpdumppid=$! # start a web server and give it a second to start @@ -112,7 +112,7 @@ tcp_v6_body() # Check for 'incorrect' in packet capture, this should tell us if # checksums are bad with rdr rules - count=$(jexec ${j}c tcpdump -vvvv -r ${j}.pcap | grep incorrect | wc -l) + count=$(jexec ${j}c tcpdump -vvvv -r ${PWD}/${j}.pcap | grep incorrect | wc -l) atf_check_equal " 0" "$count" } diff --git a/tests/sys/netpfil/pf/ridentifier.sh b/tests/sys/netpfil/pf/ridentifier.sh index c456d2111e20..8d83bcfb8213 100644 --- a/tests/sys/netpfil/pf/ridentifier.sh +++ b/tests/sys/netpfil/pf/ridentifier.sh @@ -45,7 +45,7 @@ basic_body() vnet_mkjail alcatraz ${epair}b jexec alcatraz ifconfig lo0 up jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up - jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid $(atf_get_srcdir)/echo_inetd.conf + jexec alcatraz /usr/sbin/inetd -p ${PWD}/inetd-alcatraz.pid $(atf_get_srcdir)/echo_inetd.conf # Sanity check atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 @@ -56,7 +56,7 @@ basic_body() "pass in log" \ "pass in log proto tcp ridentifier 1234" - jexec alcatraz tcpdump --immediate-mode -n -e -i pflog0 > tcpdump.log & + jexec alcatraz tcpdump --immediate-mode -n -e -i pflog0 > ${PWD}/tcpdump.log & sleep 1 echo "test" | nc -N 192.0.2.2 7 @@ -67,17 +67,17 @@ basic_body() # Make sure we spotted the ridentifier atf_check -s exit:0 -o ignore \ - grep 'rule 1/0.*ridentifier 1234' tcpdump.log + grep 'rule 1/0.*ridentifier 1234' ${PWD}/tcpdump.log # But not on the !TCP traffic atf_check -s exit:1 -o ignore \ - grep 'rule 0/0.*ridentifier' tcpdump.log + grep 'rule 0/0.*ridentifier' ${PWD}/tcpdump.log # Now try with antispoof rules pft_set_rules alcatraz \ "pass in log" \ "antispoof log for ${epair}b ridentifier 4321" - jexec alcatraz tcpdump --immediate-mode -n -e -i pflog0 > tcpdump.log & + jexec alcatraz tcpdump --immediate-mode -n -e -i pflog0 > ${PWD}/tcpdump.log & sleep 1 # Without explicit rules for lo0 we're going to drop packets to ourself @@ -87,18 +87,16 @@ basic_body() sleep 1 jexec alcatraz killall tcpdump - cat tcpdump.log + cat ${PWD}/tcpdump.log # Make sure we spotted the ridentifier atf_check -s exit:0 -o ignore \ - grep 'rule 2/0.*ridentifier 4321' tcpdump.log + grep 'rule 2/0.*ridentifier 4321' ${PWD}/tcpdump.log } basic_cleanup() { pft_cleanup - rm -f inetd-alcatraz.pid - rm -f tcpdump.log } atf_init_test_cases() diff --git a/tests/sys/netpfil/pf/route_to.sh b/tests/sys/netpfil/pf/route_to.sh index df95eaecc12e..5f47cea39b01 100644 --- a/tests/sys/netpfil/pf/route_to.sh +++ b/tests/sys/netpfil/pf/route_to.sh @@ -140,7 +140,7 @@ multiwan_body() jexec srv sysctl net.inet.ip.forwarding=1 # Run echo server in srv jail - jexec srv /usr/sbin/inetd -p multiwan.pid $(atf_get_srcdir)/echo_inetd.conf + jexec srv /usr/sbin/inetd -p ${PWD}/multiwan.pid $(atf_get_srcdir)/echo_inetd.conf jexec srv pfctl -e pft_set_rules srv \ @@ -178,7 +178,6 @@ multiwan_body() multiwan_cleanup() { - rm -f multiwan.pid pft_cleanup } diff --git a/tests/sys/netpfil/pf/syncookie.sh b/tests/sys/netpfil/pf/syncookie.sh index 8feb2816f589..ac7483bc258b 100644 --- a/tests/sys/netpfil/pf/syncookie.sh +++ b/tests/sys/netpfil/pf/syncookie.sh @@ -51,7 +51,7 @@ basic_body() vnet_mkjail alcatraz ${epair}b jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up - jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + jexec alcatraz /usr/sbin/inetd -p ${PWD}/inetd-alcatraz.pid \ $(atf_get_srcdir)/echo_inetd.conf ifconfig ${epair}a 192.0.2.2/24 up @@ -81,7 +81,7 @@ basic_body() basic_cleanup() { - rm -f inetd-alcatraz.pid + rm -f ${PWD}/inetd-alcatraz.pid pft_cleanup } @@ -100,7 +100,7 @@ basic_v6_body() vnet_mkjail alcatraz ${epair}b jexec alcatraz ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad - jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + jexec alcatraz /usr/sbin/inetd -p ${PWD}/inetd-alcatraz.pid \ $(atf_get_srcdir)/echo_inetd.conf ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad @@ -130,7 +130,6 @@ basic_v6_body() basic_v6_cleanup() { - rm -f inetd-alcatraz.pid pft_cleanup } @@ -157,7 +156,7 @@ forward_body() jexec srv ifconfig ${epair_out}b 198.51.100.2/24 up jexec srv route add default 198.51.100.1 - jexec srv /usr/sbin/inetd -p inetd-alcatraz.pid \ + jexec srv /usr/sbin/inetd -p ${PWD}/inetd-alcatraz.pid \ $(atf_get_srcdir)/echo_inetd.conf ifconfig ${epair_in}a 192.0.2.2/24 up @@ -181,7 +180,6 @@ forward_body() forward_cleanup() { - rm -f inetd-alcatraz.pid pft_cleanup } @@ -208,7 +206,7 @@ forward_v6_body() jexec srv ifconfig ${epair_out}b inet6 2001:db8:1::2/64 up no_dad jexec srv route -6 add default 2001:db8:1::1 - jexec srv /usr/sbin/inetd -p inetd-alcatraz.pid \ + jexec srv /usr/sbin/inetd -p ${PWD}/inetd-alcatraz.pid \ $(atf_get_srcdir)/echo_inetd.conf ifconfig ${epair_in}a inet6 2001:db8::2/64 up no_dad @@ -232,7 +230,6 @@ forward_v6_body() forward_v6_cleanup() { - rm -f inetd-alcatraz.pid pft_cleanup } @@ -440,7 +437,7 @@ port_reuse_body() vnet_mkjail alcatraz ${epair}b vnet_mkjail singsing jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up - jexec alcatraz /usr/sbin/inetd -p ${HOME}/inetd-alcatraz.pid \ + jexec alcatraz /usr/sbin/inetd -p ${PWD}/inetd-alcatraz.pid \ $(atf_get_srcdir)/echo_inetd.conf ifconfig ${epair}a 192.0.2.2/24 up diff --git a/tests/sys/netpfil/pf/synproxy.sh b/tests/sys/netpfil/pf/synproxy.sh index 3b3dc62b8993..617fa6ba2afc 100644 --- a/tests/sys/netpfil/pf/synproxy.sh +++ b/tests/sys/netpfil/pf/synproxy.sh @@ -52,7 +52,7 @@ synproxy_body() jexec singsing ifconfig ${link}b 198.51.100.2/24 up jexec singsing route add default 198.51.100.1 - jexec singsing /usr/sbin/inetd -p inetd-singsing.pid $(atf_get_srcdir)/echo_inetd.conf + jexec singsing /usr/sbin/inetd -p ${PWD}/inetd-singsing.pid $(atf_get_srcdir)/echo_inetd.conf jexec alcatraz pfctl -e pft_set_rules alcatraz "set fail-policy return" \ @@ -74,7 +74,6 @@ synproxy_body() synproxy_cleanup() { - rm -f inetd-singsing.pid pft_cleanup } @@ -94,7 +93,7 @@ local_body() vnet_mkjail alcatraz ${epair}b jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up - jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + jexec alcatraz /usr/sbin/inetd -p ${PWD}/inetd-alcatraz.pid \ $(atf_get_srcdir)/echo_inetd.conf jexec alcatraz pfctl -e @@ -115,7 +114,6 @@ local_body() local_cleanup() { - rm -f inetd-alcatraz.pid pft_cleanup } @@ -135,7 +133,7 @@ local_v6_body() vnet_mkjail alcatraz ${epair}b jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2/64 up - jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + jexec alcatraz /usr/sbin/inetd -p ${PWD}/inetd-alcatraz.pid \ $(atf_get_srcdir)/echo_inetd.conf jexec alcatraz pfctl -e @@ -155,7 +153,6 @@ local_v6_body() local_v6_cleanup() { - rm -f inetd-alcatraz.pid pft_cleanup } From nobody Tue Jul 23 15:00:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WT0gb0NJmz5S4tY; Tue, 23 Jul 2024 15:00: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WT0gZ5S3fz4Txy; Tue, 23 Jul 2024 15:00:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721746810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mdSxhg6HJbbwTLZTbwwDukWDiiDV0RVGH3X1gtf6fOY=; b=Tj+67dsnGmSjHJ473rRagDjiHOYFj6E5dcdpgFvSisJsmoLWT+b6WbC8XG09r2q/jaJQO1 CQz9QHmnIGiTU66LWhS7a27hkWbCDpG/E4krXUMj+gQHyy4Ic/Vi8eZ+/fm3KGQRuI26xc 2biAg0Seeu/O+6+/Qk8o/TmkahsqYgmZDD9XwAa6EI+JudlYH0xcD/Oe0HIvj+AKspwWS5 FEEbRHa7nuan4RKyHnWhOwYY3DidJLoH4zhhS3YmxZvPfvuLNY1Xl1bu6TpvNusI8RVXKb eGoqMUQccoE+yIJ7zXKm9fv4ZTjFX6LLGEpTA/pjvROiJJc2J5xKpeBS30pe+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721746810; a=rsa-sha256; cv=none; b=QCZeihkbMJqfvAWSVcUfdw4uUEwSom3RCF/SeV/LkcIZlzovoElib4bzf9wH4GwNwcUupK 15807MfqzPSyFSiCZUQj3HCVQhy2AJXnsUcb2M4ZKWuMp9wNFxa6b3x8Wzdcri8Lq1emVz SlgDXI5sR/xZW9/kbdtS6n+mRs02pQB88fqbqw3XLdYgI6XK6zsRSCBzBKmrf1gc3fjLUY NBpROAx6yGJUpe4PCAqB5n3hP+ewPu0CM2HteAmfoaGER5KAHaZTmqsBv5NmfyWiar2mCc e82/15lQUhaA19AJQahO1e0rwXIqgngchib7LTwdSrBq76gW1coV3KHTDMMRsA== 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=1721746810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mdSxhg6HJbbwTLZTbwwDukWDiiDV0RVGH3X1gtf6fOY=; b=PLfbY2CSH0fxWRQNHXw167pYXetkkIzE3xrEzXh7HEPrZzGbTvPzOUEdy7U3KqjzkZhfiO TaOnpLJkoPJB92k9kTqZDXIqEzYLuBBD/gL9pKLslMIrlS/nUbdwJrSe4enA7jlXvyEMhE /a7fZ2ym27X48qiiibazsD+HCdtIUUNSSS2bF0xvEh7sMt55uUDIOlmYoiIMC9MV2WuPiE jqQPAy/J+nlg0HedDVwgfbew49s5HcjFdI8ZhC1x/NQIF5PdLXf43mX8zlIwpbMHG6iSey l8z0oKgqFeemxcKINS2VLsWced54hOymfHrZe68AnIffCL73nYxPBcH17/EYEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WT0gZ4y8HzXv5; Tue, 23 Jul 2024 15:00:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NF0AXi079804; Tue, 23 Jul 2024 15:00:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NF0AGe079800; Tue, 23 Jul 2024 15:00:10 GMT (envelope-from git) Date: Tue, 23 Jul 2024 15:00:10 GMT Message-Id: <202407231500.46NF0AGe079800@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 4f752a1583dc - main - netpfil tests: run in parallel List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4f752a1583dc97d166caae7f844bf42715e99978 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4f752a1583dc97d166caae7f844bf42715e99978 commit 4f752a1583dc97d166caae7f844bf42715e99978 Author: Kristof Provost AuthorDate: 2024-07-19 08:03:30 +0000 Commit: Kristof Provost CommitDate: 2024-07-23 14:59:44 +0000 netpfil tests: run in parallel Run these tests in their own (vnet) jail so we don't have to worry about IP range or jail name conflicts. Reviewed by: markj Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46040 --- tests/sys/netpfil/common/Makefile | 5 +++-- tests/sys/netpfil/ipfw/Makefile | 4 ++++ tests/sys/netpfil/pf/Makefile | 5 +++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/sys/netpfil/common/Makefile b/tests/sys/netpfil/common/Makefile index 320e61f3fb83..4cd3f1a8a156 100644 --- a/tests/sys/netpfil/common/Makefile +++ b/tests/sys/netpfil/common/Makefile @@ -12,8 +12,9 @@ ATF_TESTS_SH+= \ fragments \ forward -# Tests reuse jail names and so cannot run in parallel. -TEST_METADATA+= is_exclusive=true +# Allow tests to run in parallel in their own jails +TEST_METADATA+= execenv="jail" +TEST_METADATA+= execenv_jail_params="vnet allow.raw_sockets" ${PACKAGE}FILES+= \ utils.subr \ diff --git a/tests/sys/netpfil/ipfw/Makefile b/tests/sys/netpfil/ipfw/Makefile index 1d4629c0e738..78882ef51aec 100644 --- a/tests/sys/netpfil/ipfw/Makefile +++ b/tests/sys/netpfil/ipfw/Makefile @@ -5,4 +5,8 @@ TESTSDIR= ${TESTSBASE}/sys/netpfil/ipfw ATF_TESTS_SH+= fwd ${PACKAGE}FILES+= fwd_inetd.conf +# Allow tests to run in parallel in their own jails +TEST_METADATA+= execenv="jail" +TEST_METADATA+= execenv_jail_params="vnet allow.raw_sockets" + .include diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index c3e77415e995..6b57260796ed 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -54,8 +54,9 @@ ATF_TESTS_PYTEST+= frag6.py ATF_TESTS_PYTEST+= nat66.py ATF_TESTS_PYTEST+= sctp.py -# Tests reuse jail names and so cannot run in parallel. -TEST_METADATA+= is_exclusive=true +# Allow tests to run in parallel in their own jails +TEST_METADATA+= execenv="jail" +TEST_METADATA+= execenv_jail_params="vnet allow.raw_sockets" PROGS= divapp From nobody Tue Jul 23 15:46:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WT1jC0xjgz5S85s; Tue, 23 Jul 2024 15:46: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WT1jC0Rh3z4Ym3; Tue, 23 Jul 2024 15:46:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721749599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qFDYObOxKtz7eANvxLg2SitTh59OMg7lnAx1APcZHVQ=; b=Ak5hJ1RfJ1w7/odAhRhTFwM8ze9phbnM8bfHkXJJ+bcJjSkBXCLxWwlvmIRvgrdzEfxFox fEvn2vnUODET2u3g1D9CALS4HLMRj59ouUd03tksOD3eQeIhCKAYQHdVsxiQUA9yMHJpt0 UN/R8IH8i2uWuZaIMIFFjKC2j/kcNqQ+DxIGO7UBLwX+ocE+bUBGcVjr+BYpYFCfZoESZR hxizvKZnApcCRWkFXBQEcopHVa+OOehUhu2nUyr9brzEX76yFCbIXuFGN63MIHtdD+2ZBo Rpeb4IIvFKrBD0W4C0mdACqv3ARdn8Lc8wMy29yocKJyISuimqU0XmNO+nLeCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721749599; a=rsa-sha256; cv=none; b=XAte0X6NkA+kPs3/dplnEbWPBrFVUP4Qb6L3F0reYq9q0rdk9L8G7/KaXpFGzNADbOC7Tq ALEU3sZdHGElLwS5ep5oAYimW2xxF5I/2uK5pwFOnJZDb7cF9ULNSYOoan7LiFVPaqlgHQ 8mkYHR2ueZ9qRhSPAxN2mZ+tsZ1z60jjObJ9PKkjE+JRSLiVG2pCAlfSGyecoyugqFcyp+ 3AiZICo7R3gqqzaQHU8MGYCK514r7SqeTeLALZyn6PNq3YqmvC+qcFqSSwi1pKNEKo4eo/ 4sTJBrQ5miM03wOav/DsGfLebX/1/6rV8NZpcaykclg7LBvO2dpkF021X5NnNw== 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=1721749599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qFDYObOxKtz7eANvxLg2SitTh59OMg7lnAx1APcZHVQ=; b=dl2EjeWL6JLT42h60WJGUtAgpR25MJ982O3IMwznCzL/AxvlmQLHcz7L4cUdFIe+s+IPZy /rIOmIUn76EIDHgSheEILIjwmCEegJky2+vwJlK8tWIz9MZY5Ick/lfyIgnarIV/yMt0D1 cfqquuCtzYYB3+MMVJm6nh5/VziAVpDkOR8cNsRE2+EL5syRfjDychuEfEU12Hmr+AlW8o xjuDrvdD9i6aLJU7b3C4aLG5fRXzMrXYAeU3HYW7TbLf9FYe+xh83aS2ySAlpBTmMcocpa aiyvT7E5yfjvHIVVJ3LM8+ZnRhKbVRnO4MVyoxI0YnvtT0uoZ2VRSzqiAZLM7Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WT1jC02qMzb5C; Tue, 23 Jul 2024 15:46:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NFkcQ4059268; Tue, 23 Jul 2024 15:46:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NFkcLb059265; Tue, 23 Jul 2024 15:46:38 GMT (envelope-from git) Date: Tue, 23 Jul 2024 15:46:38 GMT Message-Id: <202407231546.46NFkcLb059265@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: dcfa6669a33f - main - nvmft: Handle qpair allocation failures during handoff List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dcfa6669a33f1bf3dd347f3ab3bef79b5625b4b3 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=dcfa6669a33f1bf3dd347f3ab3bef79b5625b4b3 commit dcfa6669a33f1bf3dd347f3ab3bef79b5625b4b3 Author: John Baldwin AuthorDate: 2024-07-23 15:46:19 +0000 Commit: John Baldwin CommitDate: 2024-07-23 15:46:19 +0000 nvmft: Handle qpair allocation failures during handoff If the transport fails to create a queue pair, fail with an error rather than dereferencing a NULL pointer. Sponsored by: Chelsio Communications --- sys/dev/nvmf/controller/nvmft_controller.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/dev/nvmf/controller/nvmft_controller.c b/sys/dev/nvmf/controller/nvmft_controller.c index f3783eac1275..dee4d8c92d3d 100644 --- a/sys/dev/nvmf/controller/nvmft_controller.c +++ b/sys/dev/nvmf/controller/nvmft_controller.c @@ -122,6 +122,11 @@ nvmft_handoff_admin_queue(struct nvmft_port *np, qp = nvmft_qpair_init(handoff->trtype, &handoff->params, 0, "admin queue"); + if (qp == NULL) { + printf("NVMFT: Failed to setup admin queue from %.*s\n", + (int)sizeof(data->hostnqn), data->hostnqn); + return (ENXIO); + } sx_xlock(&np->lock); cntlid = alloc_unr(np->ids); @@ -187,6 +192,11 @@ nvmft_handoff_io_queue(struct nvmft_port *np, snprintf(name, sizeof(name), "I/O queue %u", qid); qp = nvmft_qpair_init(handoff->trtype, &handoff->params, qid, name); + if (qp == NULL) { + printf("NVMFT: Failed to setup I/O queue %u from %.*s\n", qid, + (int)sizeof(data->hostnqn), data->hostnqn); + return (ENXIO); + } sx_slock(&np->lock); TAILQ_FOREACH(ctrlr, &np->controllers, link) { From nobody Tue Jul 23 19:53:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WT79x1YcHz5QJLD; Tue, 23 Jul 2024 19:53: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WT79x0l6sz463Y; Tue, 23 Jul 2024 19:53:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721764405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qbaJU7oaPHqONn4UFfyhpB9rcC6nghxsyRsHdeBW+gc=; b=Gu5+0pstaM/Hc1RtXJToP3dTF9tQ4/cpPbaV83n2u6a5QtLJIiqOFzvdakgTjzWCA2aqfG AarJeBwennyGzLpbtXDMWC0NXg0Yi3ZB4w2FAYjpHL5R1MtOgoHC9/L9dJiX9SSk89Ozz3 r65/zxlX/ciXFVOy3pwkAIu5xsxXbPOGUsjKj8Vd7/tEJpBEipGdjupGL1jhyWk40VryuJ AhT4S3BoLs5eTfN1FbWh0r1Q8qF59slTOuO+h34yxv7KgsDVt4xOKoqVqeJd1thXcXv/fa ANaXugwsPXkaCabK8LyJY4MqV+/gR++U7+iEsj3r/Qd6pv8bBhzRt14u5t2zAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721764405; a=rsa-sha256; cv=none; b=By04tuVxS/11WrewLWqSMwhU1TluItwR0e6EWhYqRT2N6V6D4r03aSd7JM8Bl/Ql5xAHH5 5h4xmqNJv/k6Ts3fjdA0SHOzReONaVM6MhtGeMQz7dx5HVwQnVOwQRw7gf27Oqc4bVBHWs XUJQKyyLJLAQBqigtBLfw4k9rMSKNizAmZfWPaRbNCftVS55n8ZBeVhhbSob3gHef37dhG xLyx+i1eX71oRn9yQ5pP8egYbOC1bGfODesCvLAlCPOxXxyPFUBWslnEKyDQEWUkiPgoaI USAXPbL4d0tEBbiafq/L4YFmriWAlK5m7Gt5bmw9fBqOa6xrjubsYEnKGXh4zQ== 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=1721764405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qbaJU7oaPHqONn4UFfyhpB9rcC6nghxsyRsHdeBW+gc=; b=EvKqHbTRIiUpeDb43AGqrQ+hNWBRkZfa0VyR8EDJAhrXWbVfj5i5T0IzvTizLlTz2fwsyG abd8ituDDOSCMNvR+tXz7P1mEEJYrwpV3M2KLGHhv6UBDglir7TJkxjOKW4LxsugvDqseQ J1wc2PnBHrOECLAhouUGUv/D9Akkz4OAKEXaYbWJi5vOtp853kW5c9ZhthWoZoSDSsFNaa D16gdNKAn5Y1tX56LEXw+8JlOCR0N35H/x50Y/2rtsC2BZRdlDwc1hE3gOx55tBaMHv0wl oF2qrwoc//q9SiNbwMXMiD2o2gC5T5n+aPc3hAFY/55wDEcWP/VlK2ZAkz1p/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WT79x0LKmzj0f; Tue, 23 Jul 2024 19:53:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NJrOus084996; Tue, 23 Jul 2024 19:53:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NJrOdw084993; Tue, 23 Jul 2024 19:53:24 GMT (envelope-from git) Date: Tue, 23 Jul 2024 19:53:24 GMT Message-Id: <202407231953.46NJrOdw084993@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: a90b9d015907 - main - wpa: Import 2.11 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a90b9d0159070121c221b966469c3e36d912bf82 Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=a90b9d0159070121c221b966469c3e36d912bf82 commit a90b9d0159070121c221b966469c3e36d912bf82 Merge: dcfa6669a33f 6377230b3cf4 Author: Cy Schubert AuthorDate: 2024-07-21 18:59:44 +0000 Commit: Cy Schubert CommitDate: 2024-07-23 19:49:40 +0000 wpa: Import 2.11 Following is a changelog of new features and fixes to wpa: hostapd: * Wi-Fi Easy Connect - add support for DPP release 3 - allow Configurator parameters to be provided during config exchange * HE/IEEE 802.11ax/Wi-Fi 6 - various fixes * EHT/IEEE 802.11be/Wi-Fi 7 - add preliminary support * SAE: add support for fetching the password from a RADIUS server * support OpenSSL 3.0 API changes * support background radar detection and CAC with some additional drivers * support RADIUS ACL/PSK check during 4-way handshake (wpa_psk_radius=3) * EAP-SIM/AKA: support IMSI privacy * improve 4-way handshake operations - use Secure=1 in message 3 during PTK rekeying * OCV: do not check Frequency Segment 1 Channel Number for 160 MHz cases to avoid interoperability issues * support new SAE AKM suites with variable length keys * support new AKM for 802.1X/EAP with SHA384 * extend PASN support for secure ranging * FT: Use SHA256 to derive PMKID for AKM 00-0F-AC:3 (FT-EAP) - this is based on additional details being added in the IEEE 802.11 standard - the new implementation is not backwards compatible * improved ACS to cover additional channel types/bandwidths * extended Multiple BSSID support * fix beacon protection with FT protocol (incorrect BIGTK was provided) * support unsynchronized service discovery (USD) * add preliminary support for RADIUS/TLS * add support for explicit SSID protection in 4-way handshake (a mitigation for CVE-2023-52424; disabled by default for now, can be enabled with ssid_protection=1) * fix SAE H2E rejected groups validation to avoid downgrade attacks * use stricter validation for some RADIUS messages * a large number of other fixes, cleanup, and extensions wpa_supplicant: * Wi-Fi Easy Connect - add support for DPP release 3 - allow Configurator parameters to be provided during config exchange * MACsec - add support for GCM-AES-256 cipher suite - remove incorrect EAP Session-Id length constraint - add hardware offload support for additional drivers * HE/IEEE 802.11ax/Wi-Fi 6 - support BSS color updates - various fixes * EHT/IEEE 802.11be/Wi-Fi 7 - add preliminary support * support OpenSSL 3.0 API changes * improve EAP-TLS support for TLSv1.3 * EAP-SIM/AKA: support IMSI privacy * improve mitigation against DoS attacks when PMF is used * improve 4-way handshake operations - discard unencrypted EAPOL frames in additional cases - use Secure=1 in message 2 during PTK rekeying * OCV: do not check Frequency Segment 1 Channel Number for 160 MHz cases to avoid interoperability issues * support new SAE AKM suites with variable length keys * support new AKM for 802.1X/EAP with SHA384 * improve cross-AKM roaming with driver-based SME/BSS selection * PASN - extend support for secure ranging - allow PASN implementation to be used with external programs for Wi-Fi Aware * FT: Use SHA256 to derive PMKID for AKM 00-0F-AC:3 (FT-EAP) - this is based on additional details being added in the IEEE 802.11 standard - the new implementation is not backwards compatible, but PMKSA caching with FT-EAP was, and still is, disabled by default * support a pregenerated MAC (mac_addr=3) as an alternative mechanism for using per-network random MAC addresses * EAP-PEAP: require Phase 2 authentication by default (phase2_auth=1) to improve security for still unfortunately common invalid configurations that do not set ca_cert * extend SCS support for QoS Characteristics * extend MSCS support * support unsynchronized service discovery (USD) * add support for explicit SSID protection in 4-way handshake (a mitigation for CVE-2023-52424; disabled by default for now, can be enabled with ssid_protection=1) - in addition, verify SSID after key setup when beacon protection is used * fix SAE H2E rejected groups validation to avoid downgrade attacks * a large number of other fixes, cleanup, and extensions MFC after: 2 months Merge commit '6377230b3cf4f238dcd0dc2d76ff25943d3040e5' contrib/wpa/CONTRIBUTIONS | 2 +- contrib/wpa/README | 2 +- contrib/wpa/hostapd/Android.mk | 28 +- contrib/wpa/hostapd/ChangeLog | 37 + contrib/wpa/hostapd/Makefile | 30 +- contrib/wpa/hostapd/README | 2 +- contrib/wpa/hostapd/android.config | 6 + contrib/wpa/hostapd/config_file.c | 481 +- contrib/wpa/hostapd/config_file.h | 7 +- contrib/wpa/hostapd/ctrl_iface.c | 1460 +++-- contrib/wpa/hostapd/defconfig | 21 +- contrib/wpa/hostapd/hostapd.conf | 356 +- contrib/wpa/hostapd/hostapd.eap_user | 4 +- contrib/wpa/hostapd/hostapd_cli.c | 217 +- contrib/wpa/hostapd/logwatch/hostapd | 65 - contrib/wpa/hostapd/main.c | 142 +- contrib/wpa/hs20/client/Android.mk | 10 + contrib/wpa/hs20/client/est.c | 37 +- contrib/wpa/hs20/client/osu_client.c | 115 +- contrib/wpa/hs20/client/spp_client.c | 1 - contrib/wpa/src/Makefile | 2 +- contrib/wpa/src/ap/acs.c | 568 +- contrib/wpa/src/ap/acs.h | 3 + contrib/wpa/src/ap/airtime_policy.c | 2 +- contrib/wpa/src/ap/ap_config.c | 205 +- contrib/wpa/src/ap/ap_config.h | 226 +- contrib/wpa/src/ap/ap_drv_ops.c | 359 +- contrib/wpa/src/ap/ap_drv_ops.h | 84 +- contrib/wpa/src/ap/ap_list.c | 6 +- contrib/wpa/src/ap/ap_mlme.c | 4 +- contrib/wpa/src/ap/authsrv.c | 94 + contrib/wpa/src/ap/beacon.c | 1212 +++- contrib/wpa/src/ap/beacon.h | 4 + contrib/wpa/src/ap/bss_load.c | 2 +- contrib/wpa/src/ap/comeback_token.c | 139 + contrib/wpa/src/ap/comeback_token.h | 21 + contrib/wpa/src/ap/ctrl_iface_ap.c | 599 +- contrib/wpa/src/ap/ctrl_iface_ap.h | 17 + contrib/wpa/src/ap/dfs.c | 608 +- contrib/wpa/src/ap/dpp_hostapd.c | 1417 ++++- contrib/wpa/src/ap/dpp_hostapd.h | 5 + contrib/wpa/src/ap/drv_callbacks.c | 881 ++- contrib/wpa/src/ap/fils_hlp.c | 10 +- contrib/wpa/src/ap/gas_query_ap.c | 10 +- contrib/wpa/src/ap/gas_serv.c | 11 +- contrib/wpa/src/ap/gas_serv.h | 2 +- contrib/wpa/src/ap/hostapd.c | 1441 ++++- contrib/wpa/src/ap/hostapd.h | 169 +- contrib/wpa/src/ap/hw_features.c | 233 +- contrib/wpa/src/ap/hw_features.h | 12 + contrib/wpa/src/ap/ieee802_11.c | 4030 ++++++++----- contrib/wpa/src/ap/ieee802_11.h | 83 +- contrib/wpa/src/ap/ieee802_11_auth.c | 162 +- contrib/wpa/src/ap/ieee802_11_auth.h | 5 +- contrib/wpa/src/ap/ieee802_11_eht.c | 1405 +++++ contrib/wpa/src/ap/ieee802_11_he.c | 87 +- contrib/wpa/src/ap/ieee802_11_ht.c | 5 +- contrib/wpa/src/ap/ieee802_11_shared.c | 215 +- contrib/wpa/src/ap/ieee802_11_vht.c | 32 +- contrib/wpa/src/ap/ieee802_1x.c | 233 +- contrib/wpa/src/ap/ieee802_1x.h | 2 +- contrib/wpa/src/ap/nan_usd_ap.c | 267 + contrib/wpa/src/ap/nan_usd_ap.h | 46 + contrib/wpa/src/ap/ndisc_snoop.c | 1 + contrib/wpa/src/ap/neighbor_db.c | 74 +- contrib/wpa/src/ap/neighbor_db.h | 1 + contrib/wpa/src/ap/pmksa_cache_auth.c | 32 +- contrib/wpa/src/ap/pmksa_cache_auth.h | 4 + contrib/wpa/src/ap/preauth_auth.c | 4 +- contrib/wpa/src/ap/rrm.c | 121 + contrib/wpa/src/ap/rrm.h | 2 + contrib/wpa/src/ap/sta_info.c | 469 +- contrib/wpa/src/ap/sta_info.h | 96 +- contrib/wpa/src/ap/utils.c | 14 +- contrib/wpa/src/ap/wmm.c | 7 - contrib/wpa/src/ap/wnm_ap.c | 216 +- contrib/wpa/src/ap/wpa_auth.c | 2459 ++++++-- contrib/wpa/src/ap/wpa_auth.h | 103 +- contrib/wpa/src/ap/wpa_auth_ft.c | 615 +- contrib/wpa/src/ap/wpa_auth_glue.c | 269 +- contrib/wpa/src/ap/wpa_auth_i.h | 47 +- contrib/wpa/src/ap/wpa_auth_ie.c | 95 +- contrib/wpa/src/ap/wpa_auth_kay.c | 45 +- contrib/wpa/src/ap/wps_hostapd.c | 5 +- contrib/wpa/src/ap/x_snoop.c | 5 + contrib/wpa/src/build.rules | 2 +- contrib/wpa/src/common/brcm_vendor.h | 8 +- contrib/wpa/src/common/common_module_tests.c | 2 +- contrib/wpa/src/common/defs.h | 67 +- contrib/wpa/src/common/dpp.c | 883 ++- contrib/wpa/src/common/dpp.h | 132 +- contrib/wpa/src/common/dpp_crypto.c | 239 +- contrib/wpa/src/common/dpp_i.h | 19 +- contrib/wpa/src/common/dpp_pkex.c | 59 +- contrib/wpa/src/common/dpp_reconfig.c | 18 +- contrib/wpa/src/common/dpp_tcp.c | 916 ++- contrib/wpa/src/common/dragonfly.c | 9 +- contrib/wpa/src/common/gas_server.c | 79 +- contrib/wpa/src/common/gas_server.h | 5 +- contrib/wpa/src/common/hw_features_common.c | 303 +- contrib/wpa/src/common/hw_features_common.h | 12 +- contrib/wpa/src/common/ieee802_11_common.c | 1090 +++- contrib/wpa/src/common/ieee802_11_common.h | 89 +- contrib/wpa/src/common/ieee802_11_defs.h | 722 ++- contrib/wpa/src/common/nan.h | 98 + contrib/wpa/src/common/nan_de.c | 1395 +++++ contrib/wpa/src/common/nan_de.h | 145 + contrib/wpa/src/common/ocv.c | 5 +- contrib/wpa/src/common/ptksa_cache.c | 74 +- contrib/wpa/src/common/ptksa_cache.h | 47 +- contrib/wpa/src/common/qca-vendor.h | 6323 +++++++++++++++++++- contrib/wpa/src/common/sae.c | 139 +- contrib/wpa/src/common/sae.h | 14 +- contrib/wpa/src/common/version.h | 2 +- contrib/wpa/src/common/wpa_common.c | 995 ++- contrib/wpa/src/common/wpa_common.h | 134 +- contrib/wpa/src/common/wpa_ctrl.c | 16 +- contrib/wpa/src/common/wpa_ctrl.h | 36 + contrib/wpa/src/crypto/crypto.h | 117 +- contrib/wpa/src/crypto/crypto_gnutls.c | 5 + contrib/wpa/src/crypto/crypto_internal.c | 5 + contrib/wpa/src/crypto/crypto_libtomcrypt.c | 5 + contrib/wpa/src/crypto/crypto_linux.c | 5 + contrib/wpa/src/crypto/crypto_module_tests.c | 281 + contrib/wpa/src/crypto/crypto_nettle.c | 5 + contrib/wpa/src/crypto/crypto_none.c | 5 + contrib/wpa/src/crypto/crypto_openssl.c | 2622 +++++++- contrib/wpa/src/crypto/crypto_wolfssl.c | 2043 ++++++- contrib/wpa/src/crypto/fips_prf_internal.c | 11 +- contrib/wpa/src/crypto/fips_prf_openssl.c | 15 + contrib/wpa/src/crypto/sha1-pbkdf2.c | 3 + contrib/wpa/src/crypto/sha256-internal.c | 3 - contrib/wpa/src/crypto/sha256.c | 21 +- contrib/wpa/src/crypto/sha384.c | 6 +- contrib/wpa/src/crypto/sha512-internal.c | 3 - contrib/wpa/src/crypto/sha512.c | 6 +- contrib/wpa/src/crypto/tls.h | 18 +- contrib/wpa/src/crypto/tls_gnutls.c | 1 + contrib/wpa/src/crypto/tls_internal.c | 11 +- contrib/wpa/src/crypto/tls_none.c | 1 + contrib/wpa/src/crypto/tls_openssl.c | 564 +- contrib/wpa/src/crypto/tls_openssl_ocsp.c | 26 +- contrib/wpa/src/crypto/tls_wolfssl.c | 284 +- contrib/wpa/src/drivers/driver.h | 964 ++- contrib/wpa/src/drivers/driver_atheros.c | 31 +- contrib/wpa/src/drivers/driver_bsd.c | 16 +- contrib/wpa/src/drivers/driver_common.c | 44 + contrib/wpa/src/drivers/driver_hostap.c | 20 +- contrib/wpa/src/drivers/driver_macsec_linux.c | 76 +- contrib/wpa/src/drivers/driver_macsec_qca.c | 4 +- contrib/wpa/src/drivers/driver_ndis.c | 8 +- contrib/wpa/src/drivers/driver_nl80211.c | 3443 ++++++++--- contrib/wpa/src/drivers/driver_nl80211.h | 113 +- contrib/wpa/src/drivers/driver_nl80211_capa.c | 354 +- contrib/wpa/src/drivers/driver_nl80211_event.c | 1291 +++- contrib/wpa/src/drivers/driver_nl80211_scan.c | 127 +- contrib/wpa/src/drivers/driver_roboswitch.c | 2 +- contrib/wpa/src/drivers/driver_wext.c | 11 +- contrib/wpa/src/drivers/driver_wired.c | 2 +- contrib/wpa/src/drivers/linux_ioctl.c | 11 +- contrib/wpa/src/drivers/ndis_events.c | 5 +- contrib/wpa/src/drivers/netlink.c | 6 +- contrib/wpa/src/drivers/nl80211_copy.h | 626 +- contrib/wpa/src/eap_common/eap_defs.h | 2 +- contrib/wpa/src/eap_common/eap_pwd_common.c | 23 +- contrib/wpa/src/eap_common/eap_sake_common.c | 19 +- contrib/wpa/src/eap_peer/eap.c | 44 + contrib/wpa/src/eap_peer/eap_aka.c | 198 +- contrib/wpa/src/eap_peer/eap_config.h | 46 +- contrib/wpa/src/eap_peer/eap_fast.c | 14 +- contrib/wpa/src/eap_peer/eap_i.h | 9 + contrib/wpa/src/eap_peer/eap_mschapv2.c | 30 +- contrib/wpa/src/eap_peer/eap_peap.c | 40 +- contrib/wpa/src/eap_peer/eap_pwd.c | 33 +- contrib/wpa/src/eap_peer/eap_sim.c | 202 +- contrib/wpa/src/eap_peer/eap_teap.c | 61 +- contrib/wpa/src/eap_peer/eap_tls.c | 15 +- contrib/wpa/src/eap_peer/eap_tls_common.c | 27 +- contrib/wpa/src/eap_peer/eap_tls_common.h | 5 + contrib/wpa/src/eap_peer/eap_ttls.c | 32 +- contrib/wpa/src/eap_peer/eap_wsc.c | 14 +- contrib/wpa/src/eap_server/eap.h | 12 + contrib/wpa/src/eap_server/eap_i.h | 7 + contrib/wpa/src/eap_server/eap_server_aka.c | 126 +- contrib/wpa/src/eap_server/eap_server_eke.c | 1 + contrib/wpa/src/eap_server/eap_server_fast.c | 14 +- contrib/wpa/src/eap_server/eap_server_mschapv2.c | 28 +- contrib/wpa/src/eap_server/eap_server_peap.c | 18 + contrib/wpa/src/eap_server/eap_server_pwd.c | 33 +- contrib/wpa/src/eap_server/eap_server_sim.c | 133 +- contrib/wpa/src/eap_server/eap_server_teap.c | 39 +- contrib/wpa/src/eap_server/eap_server_tls.c | 10 +- contrib/wpa/src/eap_server/eap_server_tls_common.c | 18 +- contrib/wpa/src/eap_server/eap_server_ttls.c | 3 +- contrib/wpa/src/eap_server/eap_tls_common.h | 2 + contrib/wpa/src/eapol_auth/eapol_auth_sm.c | 26 +- contrib/wpa/src/eapol_auth/eapol_auth_sm.h | 5 +- contrib/wpa/src/eapol_auth/eapol_auth_sm_i.h | 4 + contrib/wpa/src/eapol_supp/eapol_supp_sm.c | 17 +- contrib/wpa/src/eapol_supp/eapol_supp_sm.h | 18 +- contrib/wpa/src/fst/fst_group.c | 12 +- contrib/wpa/src/fst/fst_iface.c | 2 +- contrib/wpa/src/fst/fst_session.c | 6 +- contrib/wpa/src/l2_packet/l2_packet_freebsd.c | 9 +- contrib/wpa/src/l2_packet/l2_packet_linux.c | 4 +- contrib/wpa/src/p2p/p2p.c | 123 +- contrib/wpa/src/p2p/p2p.h | 12 +- contrib/wpa/src/p2p/p2p_build.c | 20 +- contrib/wpa/src/p2p/p2p_dev_disc.c | 10 +- contrib/wpa/src/p2p/p2p_go_neg.c | 121 +- contrib/wpa/src/p2p/p2p_group.c | 14 +- contrib/wpa/src/p2p/p2p_i.h | 19 +- contrib/wpa/src/p2p/p2p_invitation.c | 31 +- contrib/wpa/src/p2p/p2p_parse.c | 27 +- contrib/wpa/src/p2p/p2p_pd.c | 43 +- contrib/wpa/src/p2p/p2p_sd.c | 23 +- contrib/wpa/src/p2p/p2p_utils.c | 84 +- contrib/wpa/src/pae/ieee802_1x_cp.c | 15 +- contrib/wpa/src/pae/ieee802_1x_kay.c | 74 +- contrib/wpa/src/pae/ieee802_1x_kay.h | 5 +- contrib/wpa/src/pae/ieee802_1x_secy_ops.c | 20 + contrib/wpa/src/pae/ieee802_1x_secy_ops.h | 1 + contrib/wpa/src/pasn/Makefile | 16 + contrib/wpa/src/pasn/pasn_common.c | 232 + contrib/wpa/src/pasn/pasn_common.h | 228 + contrib/wpa/src/pasn/pasn_initiator.c | 1406 +++++ contrib/wpa/src/pasn/pasn_responder.c | 1032 ++++ contrib/wpa/src/radius/radius.c | 297 +- contrib/wpa/src/radius/radius.h | 35 +- contrib/wpa/src/radius/radius_client.c | 789 ++- contrib/wpa/src/radius/radius_client.h | 27 +- contrib/wpa/src/radius/radius_das.c | 10 + contrib/wpa/src/radius/radius_server.c | 15 + contrib/wpa/src/rsn_supp/pmksa_cache.c | 260 +- contrib/wpa/src/rsn_supp/pmksa_cache.h | 105 +- contrib/wpa/src/rsn_supp/preauth.c | 19 +- contrib/wpa/src/rsn_supp/tdls.c | 332 +- contrib/wpa/src/rsn_supp/wpa.c | 2190 +++++-- contrib/wpa/src/rsn_supp/wpa.h | 88 +- contrib/wpa/src/rsn_supp/wpa_ft.c | 328 +- contrib/wpa/src/rsn_supp/wpa_i.h | 65 +- contrib/wpa/src/rsn_supp/wpa_ie.c | 36 +- contrib/wpa/src/tls/libtommath.c | 8 - contrib/wpa/src/tls/pkcs1.c | 6 +- contrib/wpa/src/tls/tlsv1_client_read.c | 3 +- contrib/wpa/src/tls/tlsv1_common.c | 6 +- contrib/wpa/src/tls/tlsv1_common.h | 3 +- contrib/wpa/src/tls/tlsv1_server_write.c | 2 +- contrib/wpa/src/utils/browser.c | 10 + contrib/wpa/src/utils/common.c | 15 +- contrib/wpa/src/utils/common.h | 38 + contrib/wpa/src/utils/crc32.c | 2 +- contrib/wpa/src/utils/crc32.h | 2 +- contrib/wpa/src/utils/http-utils.h | 1 + contrib/wpa/src/utils/http_curl.c | 73 +- contrib/wpa/src/utils/ip_addr.c | 19 + contrib/wpa/src/utils/ip_addr.h | 2 + contrib/wpa/src/utils/os.h | 42 +- contrib/wpa/src/utils/os_unix.c | 195 +- contrib/wpa/src/utils/trace.c | 6 +- contrib/wpa/src/utils/wpa_debug.c | 10 +- contrib/wpa/src/utils/wpa_debug.h | 1 + contrib/wpa/src/utils/wpabuf.h | 6 + contrib/wpa/src/wps/ndef.c | 6 + contrib/wpa/src/wps/wps.c | 5 +- contrib/wpa/src/wps/wps.h | 5 + contrib/wpa/src/wps/wps_attr_parse.c | 13 +- contrib/wpa/src/wps/wps_enrollee.c | 6 +- contrib/wpa/src/wps/wps_er.c | 4 +- contrib/wpa/src/wps/wps_i.h | 1 + contrib/wpa/src/wps/wps_registrar.c | 15 +- contrib/wpa/wpa_supplicant/Android.mk | 228 +- contrib/wpa/wpa_supplicant/ChangeLog | 50 + contrib/wpa/wpa_supplicant/Makefile | 308 +- contrib/wpa/wpa_supplicant/README | 4 +- contrib/wpa/wpa_supplicant/README-HS20 | 33 +- contrib/wpa/wpa_supplicant/README-NAN-USD | 147 + contrib/wpa/wpa_supplicant/README-WPS | 24 +- contrib/wpa/wpa_supplicant/android.config | 15 + contrib/wpa/wpa_supplicant/ap.c | 293 +- contrib/wpa/wpa_supplicant/ap.h | 24 +- contrib/wpa/wpa_supplicant/bgscan.h | 2 +- contrib/wpa/wpa_supplicant/bgscan_learn.c | 10 +- contrib/wpa/wpa_supplicant/bgscan_simple.c | 64 +- contrib/wpa/wpa_supplicant/bss.c | 563 +- contrib/wpa/wpa_supplicant/bss.h | 29 + contrib/wpa/wpa_supplicant/bssid_ignore.c | 30 +- contrib/wpa/wpa_supplicant/config.c | 487 +- contrib/wpa/wpa_supplicant/config.h | 150 +- contrib/wpa/wpa_supplicant/config_file.c | 108 +- contrib/wpa/wpa_supplicant/config_none.c | 3 +- contrib/wpa/wpa_supplicant/config_ssid.h | 114 +- contrib/wpa/wpa_supplicant/config_winreg.c | 5 +- contrib/wpa/wpa_supplicant/ctrl_iface.c | 1707 +++++- contrib/wpa/wpa_supplicant/ctrl_iface.h | 2 + contrib/wpa/wpa_supplicant/ctrl_iface_unix.c | 3 + .../wpa/wpa_supplicant/dbus/dbus_dict_helpers.c | 100 + .../wpa/wpa_supplicant/dbus/dbus_dict_helpers.h | 9 + contrib/wpa/wpa_supplicant/dbus/dbus_new.c | 142 +- contrib/wpa/wpa_supplicant/dbus/dbus_new.h | 24 + .../wpa/wpa_supplicant/dbus/dbus_new_handlers.c | 784 ++- .../wpa/wpa_supplicant/dbus/dbus_new_handlers.h | 7 + .../wpa_supplicant/dbus/dbus_new_handlers_p2p.c | 94 +- contrib/wpa/wpa_supplicant/dbus/dbus_new_helpers.c | 209 +- contrib/wpa/wpa_supplicant/dbus/dbus_new_helpers.h | 5 + .../wpa/wpa_supplicant/dbus/dbus_new_introspect.c | 2 +- contrib/wpa/wpa_supplicant/defconfig | 53 + .../wpa_supplicant/doc/docbook/wpa_supplicant.sgml | 48 +- contrib/wpa/wpa_supplicant/dpp_supplicant.c | 2184 ++++++- contrib/wpa/wpa_supplicant/dpp_supplicant.h | 5 + contrib/wpa/wpa_supplicant/driver_i.h | 124 +- contrib/wpa/wpa_supplicant/eapol_test.c | 146 +- contrib/wpa/wpa_supplicant/events.c | 1741 +++++- contrib/wpa/wpa_supplicant/examples/dpp-nfc.py | 10 +- contrib/wpa/wpa_supplicant/gas_query.c | 56 +- contrib/wpa/wpa_supplicant/hs20_supplicant.c | 17 +- contrib/wpa/wpa_supplicant/ibss_rsn.c | 32 +- contrib/wpa/wpa_supplicant/ibss_rsn.h | 3 +- contrib/wpa/wpa_supplicant/interworking.c | 124 +- contrib/wpa/wpa_supplicant/main.c | 2 + contrib/wpa/wpa_supplicant/mbo.c | 25 +- contrib/wpa/wpa_supplicant/mesh.c | 16 +- contrib/wpa/wpa_supplicant/mesh_mpm.c | 74 +- contrib/wpa/wpa_supplicant/mesh_rsn.c | 27 +- contrib/wpa/wpa_supplicant/nan_usd.c | 513 ++ contrib/wpa/wpa_supplicant/nan_usd.h | 46 + contrib/wpa/wpa_supplicant/notify.c | 103 +- contrib/wpa/wpa_supplicant/notify.h | 14 +- contrib/wpa/wpa_supplicant/offchannel.c | 10 +- contrib/wpa/wpa_supplicant/op_classes.c | 150 +- contrib/wpa/wpa_supplicant/p2p_supplicant.c | 483 +- contrib/wpa/wpa_supplicant/p2p_supplicant.h | 13 +- contrib/wpa/wpa_supplicant/p2p_supplicant_sd.c | 14 +- contrib/wpa/wpa_supplicant/pasn_supplicant.c | 1712 ++---- contrib/wpa/wpa_supplicant/preauth_test.c | 8 +- contrib/wpa/wpa_supplicant/robust_av.c | 341 +- contrib/wpa/wpa_supplicant/rrm.c | 132 +- contrib/wpa/wpa_supplicant/scan.c | 774 ++- contrib/wpa/wpa_supplicant/scan.h | 30 +- contrib/wpa/wpa_supplicant/sme.c | 948 ++- contrib/wpa/wpa_supplicant/sme.h | 14 +- .../systemd/wpa_supplicant-nl80211.service.arg.in | 2 +- .../systemd/wpa_supplicant.service.arg.in | 2 +- contrib/wpa/wpa_supplicant/utils/log2pcap.py | 9 +- contrib/wpa/wpa_supplicant/wmm_ac.c | 6 +- contrib/wpa/wpa_supplicant/wnm_sta.c | 532 +- contrib/wpa/wpa_supplicant/wnm_sta.h | 30 +- contrib/wpa/wpa_supplicant/wpa_cli.c | 144 +- contrib/wpa/wpa_supplicant/wpa_passphrase.c | 25 +- contrib/wpa/wpa_supplicant/wpa_priv.c | 11 +- contrib/wpa/wpa_supplicant/wpa_supplicant.c | 1679 ++++-- contrib/wpa/wpa_supplicant/wpa_supplicant.conf | 109 +- contrib/wpa/wpa_supplicant/wpa_supplicant_i.h | 286 +- .../wpa_supplicant/wpa_supplicant_template.conf | 2 + contrib/wpa/wpa_supplicant/wpas_glue.c | 159 +- contrib/wpa/wpa_supplicant/wpas_glue.h | 2 + contrib/wpa/wpa_supplicant/wpas_kay.c | 53 +- contrib/wpa/wpa_supplicant/wpas_module_tests.c | 3 + contrib/wpa/wpa_supplicant/wps_supplicant.c | 166 +- contrib/wpa/wpa_supplicant/wps_supplicant.h | 13 + share/mk/src.libnames.mk | 4 + usr.sbin/wpa/Makefile.inc | 1 - usr.sbin/wpa/hostapd/Makefile | 3 +- usr.sbin/wpa/src/Makefile | 1 + usr.sbin/wpa/src/pasn/Makefile | 20 + usr.sbin/wpa/wpa_supplicant/Makefile | 2 +- 366 files changed, 66259 insertions(+), 12716 deletions(-) diff --cc contrib/wpa/src/ap/comeback_token.c index 000000000000,8d9f21b1eae0..8d9f21b1eae0 mode 000000,100644..100644 --- a/contrib/wpa/src/ap/comeback_token.c +++ b/contrib/wpa/src/ap/comeback_token.c diff --cc contrib/wpa/src/ap/comeback_token.h index 000000000000,d5de9e684b49..d5de9e684b49 mode 000000,100644..100644 --- a/contrib/wpa/src/ap/comeback_token.h +++ b/contrib/wpa/src/ap/comeback_token.h diff --cc contrib/wpa/src/ap/hostapd.c index a5cabc01f163,a05de030d91f..6ecf6ca7834e --- a/contrib/wpa/src/ap/hostapd.c +++ b/contrib/wpa/src/ap/hostapd.c @@@ -1697,21 -2142,8 +2142,22 @@@ static void hostapd_set_6ghz_sec_chan(s static int setup_interface2(struct hostapd_iface *iface) { iface->wait_channel_update = 0; + iface->is_no_ir = false; +#ifdef __FreeBSD + /* XXX hostapd_get_hw_features() is an inline that always returns -1 + * because MLME will not build under FreeBSD due to its use of + * Linux definitions. Normally FreeBSD would uncondionally execute the + * "Not all drivers support..." block. Instead we #ifdef out the entire + * block of code instead of maintaining the fallacy that + * hostapd_get_hw_features() returns anything meaninful. + * + * Ideally WANT_AP_MLME should be taught about FreeBSD data structures + * and defintions. Instead we do this to enable channel selection in + * hostapd.conf. + */ + iface->freq = iface->conf->channel; +#else if (hostapd_get_hw_features(iface)) { /* Not all drivers support this yet, so continue without hw * feature data. */ diff --cc contrib/wpa/src/ap/ieee802_11_eht.c index 000000000000,b935ee889a89..b935ee889a89 mode 000000,100644..100644 --- a/contrib/wpa/src/ap/ieee802_11_eht.c +++ b/contrib/wpa/src/ap/ieee802_11_eht.c diff --cc contrib/wpa/src/ap/nan_usd_ap.c index 000000000000,52a967a4ec41..52a967a4ec41 mode 000000,100644..100644 --- a/contrib/wpa/src/ap/nan_usd_ap.c +++ b/contrib/wpa/src/ap/nan_usd_ap.c diff --cc contrib/wpa/src/ap/nan_usd_ap.h index 000000000000,58ff5fc4808b..58ff5fc4808b mode 000000,100644..100644 --- a/contrib/wpa/src/ap/nan_usd_ap.h +++ b/contrib/wpa/src/ap/nan_usd_ap.h diff --cc contrib/wpa/src/common/nan.h index 000000000000,19ab7468711e..19ab7468711e mode 000000,100644..100644 --- a/contrib/wpa/src/common/nan.h +++ b/contrib/wpa/src/common/nan.h diff --cc contrib/wpa/src/common/nan_de.c index 000000000000,12fad3112bdc..12fad3112bdc mode 000000,100644..100644 --- a/contrib/wpa/src/common/nan_de.c +++ b/contrib/wpa/src/common/nan_de.c diff --cc contrib/wpa/src/common/nan_de.h index 000000000000,62235064b075..62235064b075 mode 000000,100644..100644 --- a/contrib/wpa/src/common/nan_de.h +++ b/contrib/wpa/src/common/nan_de.h diff --cc contrib/wpa/src/l2_packet/l2_packet_freebsd.c index 156a09a32a84,481c8ca4d5d6..504456360e4b --- a/contrib/wpa/src/l2_packet/l2_packet_freebsd.c +++ b/contrib/wpa/src/l2_packet/l2_packet_freebsd.c @@@ -96,12 -94,14 +99,14 @@@ static void l2_packet_receive(int sock ethhdr = (struct l2_ethhdr *) packet; if (l2->l2_hdr) { buf = (unsigned char *) ethhdr; - len = hdr.caplen; + len = hdr->caplen; } else { buf = (unsigned char *) (ethhdr + 1); - len = hdr.caplen - sizeof(*ethhdr); + len = hdr->caplen - sizeof(*ethhdr); - /* handle 8021Q encapsulated frames */ - if (ethhdr->h_proto == htons(ETH_P_8021Q)) { + + /* Handle IEEE 802.1Q encapsulated frames */ + if (len >= ETHER_VLAN_ENCAP_LEN && + ethhdr->h_proto == htons(ETH_P_8021Q)) { buf += ETHER_VLAN_ENCAP_LEN; len -= ETHER_VLAN_ENCAP_LEN; } diff --cc contrib/wpa/src/pasn/Makefile index 000000000000,a5b2c6b3f672..a5b2c6b3f672 mode 000000,100644..100644 --- a/contrib/wpa/src/pasn/Makefile +++ b/contrib/wpa/src/pasn/Makefile diff --cc contrib/wpa/src/pasn/pasn_common.c index 000000000000,e2c668136300..e2c668136300 mode 000000,100644..100644 --- a/contrib/wpa/src/pasn/pasn_common.c +++ b/contrib/wpa/src/pasn/pasn_common.c diff --cc contrib/wpa/src/pasn/pasn_common.h index 000000000000,36710c2b70e9..36710c2b70e9 mode 000000,100644..100644 --- a/contrib/wpa/src/pasn/pasn_common.h +++ b/contrib/wpa/src/pasn/pasn_common.h diff --cc contrib/wpa/src/pasn/pasn_initiator.c index 000000000000,d273067b7078..d273067b7078 mode 000000,100644..100644 --- a/contrib/wpa/src/pasn/pasn_initiator.c +++ b/contrib/wpa/src/pasn/pasn_initiator.c diff --cc contrib/wpa/src/pasn/pasn_responder.c index 000000000000,b99136492fa6..b99136492fa6 mode 000000,100644..100644 --- a/contrib/wpa/src/pasn/pasn_responder.c +++ b/contrib/wpa/src/pasn/pasn_responder.c diff --cc contrib/wpa/wpa_supplicant/README-NAN-USD index 000000000000,72c379fc976a..72c379fc976a mode 000000,100644..100644 --- a/contrib/wpa/wpa_supplicant/README-NAN-USD +++ b/contrib/wpa/wpa_supplicant/README-NAN-USD diff --cc contrib/wpa/wpa_supplicant/main.c index 7ab3a60442a5,000000000000..e13abc407a93 mode 100644,000000..100644 --- a/contrib/wpa/wpa_supplicant/main.c +++ b/contrib/wpa/wpa_supplicant/main.c @@@ -1,408 -1,0 +1,410 @@@ +/* + * WPA Supplicant / main() function for UNIX like OSes and MinGW + * Copyright (c) 2003-2013, Jouni Malinen + * + * This software may be distributed under the terms of the BSD license. + * See README for more details. + */ + +#include "includes.h" +#ifdef __linux__ +#include +#endif /* __linux__ */ + +#include "common.h" ++#include "crypto/crypto.h" +#include "fst/fst.h" +#include "wpa_supplicant_i.h" +#include "driver_i.h" +#include "p2p_supplicant.h" + + +static void usage(void) +{ + int i; + printf("%s\n\n%s\n" + "usage:\n" + " wpa_supplicant [-BddhKLqq" +#ifdef CONFIG_DEBUG_SYSLOG + "s" +#endif /* CONFIG_DEBUG_SYSLOG */ + "t" +#ifdef CONFIG_CTRL_IFACE_DBUS_NEW + "u" +#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ + "vW] [-P] " + "[-g] \\\n" + " [-G] \\\n" + " -i -c [-C] [-D] " + "[-p] \\\n" + " [-b] [-e]" +#ifdef CONFIG_DEBUG_FILE + " [-f]" +#endif /* CONFIG_DEBUG_FILE */ + " \\\n" + " [-o] [-O] \\\n" + " [-N -i -c [-C] " + "[-D] \\\n" +#ifdef CONFIG_P2P + " [-m] \\\n" +#endif /* CONFIG_P2P */ + " [-p] [-b] [-I] " + "...]\n" + "\n" + "drivers:\n", + wpa_supplicant_version, wpa_supplicant_license); + + for (i = 0; wpa_drivers[i]; i++) { + printf(" %s = %s\n", + wpa_drivers[i]->name, + wpa_drivers[i]->desc); + } + +#ifndef CONFIG_NO_STDOUT_DEBUG + printf("options:\n" + " -b = optional bridge interface name\n" + " -B = run daemon in the background\n" + " -c = Configuration file\n" + " -C = ctrl_interface parameter (only used if -c is not)\n" + " -d = increase debugging verbosity (-dd even more)\n" + " -D = driver name (can be multiple drivers: bsd,wired)\n" + " -e = entropy file\n" +#ifdef CONFIG_DEBUG_FILE + " -f = log output to debug file instead of stdout\n" +#endif /* CONFIG_DEBUG_FILE */ + " -g = global ctrl_interface\n" + " -G = global ctrl_interface group\n" + " -h = show this help text\n" + " -i = interface name\n" + " -I = additional configuration file\n" + " -K = include keys (passwords, etc.) in debug output\n" + " -L = show license (BSD)\n" +#ifdef CONFIG_P2P + " -m = Configuration file for the P2P Device interface\n" +#endif /* CONFIG_P2P */ +#ifdef CONFIG_MATCH_IFACE + " -M = start describing new matching interface\n" +#endif /* CONFIG_MATCH_IFACE */ + " -N = start describing new interface\n" + " -o = override driver parameter for new interfaces\n" + " -O = override ctrl_interface parameter for new interfaces\n" + " -p = driver parameters\n" + " -P = PID file\n" + " -q = decrease debugging verbosity (-qq even less)\n" +#ifdef CONFIG_DEBUG_SYSLOG + " -s = log output to syslog instead of stdout\n" +#endif /* CONFIG_DEBUG_SYSLOG */ + " -t = include timestamp in debug messages\n" +#ifdef CONFIG_DEBUG_LINUX_TRACING + " -T = record to Linux tracing in addition to logging\n" + " (records all messages regardless of debug verbosity)\n" +#endif /* CONFIG_DEBUG_LINUX_TRACING */ +#ifdef CONFIG_CTRL_IFACE_DBUS_NEW + " -u = enable DBus control interface\n" +#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ + " -v = show version\n" + " -W = wait for a control interface monitor before starting\n"); + + printf("example:\n" + " wpa_supplicant -Dbsd -iwlan0 -c/etc/wpa_supplicant.conf\n"); +#endif /* CONFIG_NO_STDOUT_DEBUG */ +} + + +static void license(void) +{ +#ifndef CONFIG_NO_STDOUT_DEBUG + printf("%s\n\n%s%s%s%s%s\n", + wpa_supplicant_version, + wpa_supplicant_full_license1, + wpa_supplicant_full_license2, + wpa_supplicant_full_license3, + wpa_supplicant_full_license4, + wpa_supplicant_full_license5); +#endif /* CONFIG_NO_STDOUT_DEBUG */ +} + + +static void wpa_supplicant_fd_workaround(int start) +{ +#ifdef __linux__ + static int fd[3] = { -1, -1, -1 }; + int i; + /* When started from pcmcia-cs scripts, wpa_supplicant might start with + * fd 0, 1, and 2 closed. This will cause some issues because many + * places in wpa_supplicant are still printing out to stdout. As a + * workaround, make sure that fd's 0, 1, and 2 are not used for other + * sockets. */ + if (start) { + for (i = 0; i < 3; i++) { + fd[i] = open("/dev/null", O_RDWR); + if (fd[i] > 2) { + close(fd[i]); + fd[i] = -1; + break; + } + } + } else { + for (i = 0; i < 3; i++) { + if (fd[i] >= 0) { + close(fd[i]); + fd[i] = -1; + } + } + } +#endif /* __linux__ */ +} + + +#ifdef CONFIG_MATCH_IFACE +static int wpa_supplicant_init_match(struct wpa_global *global) +{ + /* + * The assumption is that the first driver is the primary driver and + * will handle the arrival / departure of interfaces. + */ + if (wpa_drivers[0]->global_init && !global->drv_priv[0]) { + global->drv_priv[0] = wpa_drivers[0]->global_init(global); + if (!global->drv_priv[0]) { + wpa_printf(MSG_ERROR, + "Failed to initialize driver '%s'", + wpa_drivers[0]->name); + return -1; + } + } + + return 0; +} +#endif /* CONFIG_MATCH_IFACE */ + + +int main(int argc, char *argv[]) +{ + int c, i; + struct wpa_interface *ifaces, *iface; + int iface_count, exitcode = -1; + struct wpa_params params; + struct wpa_global *global; + + if (os_program_init()) + return -1; + + os_memset(¶ms, 0, sizeof(params)); + params.wpa_debug_level = MSG_INFO; + + iface = ifaces = os_zalloc(sizeof(struct wpa_interface)); + if (ifaces == NULL) + return -1; + iface_count = 1; + + wpa_supplicant_fd_workaround(1); + + for (;;) { + c = getopt(argc, argv, + "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW"); + if (c < 0) + break; + switch (c) { + case 'b': + iface->bridge_ifname = optarg; + break; + case 'B': + params.daemonize++; + break; + case 'c': + iface->confname = optarg; + break; + case 'C': + iface->ctrl_interface = optarg; + break; + case 'D': + iface->driver = optarg; + break; + case 'd': +#ifdef CONFIG_NO_STDOUT_DEBUG + printf("Debugging disabled with " + "CONFIG_NO_STDOUT_DEBUG=y build time " + "option.\n"); + goto out; +#else /* CONFIG_NO_STDOUT_DEBUG */ + params.wpa_debug_level--; + break; +#endif /* CONFIG_NO_STDOUT_DEBUG */ + case 'e': + params.entropy_file = optarg; + break; +#ifdef CONFIG_DEBUG_FILE + case 'f': + params.wpa_debug_file_path = optarg; + break; +#endif /* CONFIG_DEBUG_FILE */ + case 'g': + params.ctrl_interface = optarg; + break; + case 'G': + params.ctrl_interface_group = optarg; + break; + case 'h': + usage(); + exitcode = 0; + goto out; + case 'i': + iface->ifname = optarg; + break; + case 'I': + iface->confanother = optarg; + break; + case 'K': + params.wpa_debug_show_keys++; + break; + case 'L': + license(); + exitcode = 0; + goto out; +#ifdef CONFIG_P2P + case 'm': + params.conf_p2p_dev = optarg; + break; +#endif /* CONFIG_P2P */ + case 'o': + params.override_driver = optarg; + break; + case 'O': + params.override_ctrl_interface = optarg; + break; + case 'p': + iface->driver_param = optarg; + break; + case 'P': + os_free(params.pid_file); + params.pid_file = os_rel2abs_path(optarg); + break; + case 'q': + params.wpa_debug_level++; + break; +#ifdef CONFIG_DEBUG_SYSLOG + case 's': + params.wpa_debug_syslog++; + break; +#endif /* CONFIG_DEBUG_SYSLOG */ +#ifdef CONFIG_DEBUG_LINUX_TRACING + case 'T': + params.wpa_debug_tracing++; + break; +#endif /* CONFIG_DEBUG_LINUX_TRACING */ + case 't': + params.wpa_debug_timestamp++; + break; +#ifdef CONFIG_CTRL_IFACE_DBUS_NEW + case 'u': + params.dbus_ctrl_interface = 1; + break; +#endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ + case 'v': + printf("%s\n", wpa_supplicant_version); + exitcode = 0; + goto out; + case 'W': + params.wait_for_monitor++; + break; +#ifdef CONFIG_MATCH_IFACE + case 'M': + params.match_iface_count++; + iface = os_realloc_array(params.match_ifaces, + params.match_iface_count, + sizeof(struct wpa_interface)); + if (!iface) + goto out; + params.match_ifaces = iface; + iface = ¶ms.match_ifaces[params.match_iface_count - + 1]; + os_memset(iface, 0, sizeof(*iface)); + break; +#endif /* CONFIG_MATCH_IFACE */ + case 'N': + iface_count++; + iface = os_realloc_array(ifaces, iface_count, + sizeof(struct wpa_interface)); + if (iface == NULL) + goto out; + ifaces = iface; + iface = &ifaces[iface_count - 1]; + os_memset(iface, 0, sizeof(*iface)); + break; + default: + usage(); + exitcode = 0; + goto out; + } + } + + exitcode = 0; + global = wpa_supplicant_init(¶ms); + if (global == NULL) { + wpa_printf(MSG_ERROR, "Failed to initialize wpa_supplicant"); + exitcode = -1; + goto out; + } else { + wpa_printf(MSG_INFO, "Successfully initialized " + "wpa_supplicant"); + } + + if (fst_global_init()) { + wpa_printf(MSG_ERROR, "Failed to initialize FST"); + exitcode = -1; + goto out; + } + +#if defined(CONFIG_FST) && defined(CONFIG_CTRL_IFACE) + if (!fst_global_add_ctrl(fst_ctrl_cli)) + wpa_printf(MSG_WARNING, "Failed to add CLI FST ctrl"); +#endif + + for (i = 0; exitcode == 0 && i < iface_count; i++) { + struct wpa_supplicant *wpa_s; + + if ((ifaces[i].confname == NULL && + ifaces[i].ctrl_interface == NULL) || + ifaces[i].ifname == NULL) { + if (iface_count == 1 && (params.ctrl_interface || +#ifdef CONFIG_MATCH_IFACE + params.match_iface_count || +#endif /* CONFIG_MATCH_IFACE */ + params.dbus_ctrl_interface)) + break; + usage(); + exitcode = -1; + break; + } + wpa_s = wpa_supplicant_add_iface(global, &ifaces[i], NULL); + if (wpa_s == NULL) { + exitcode = -1; + break; + } + } + +#ifdef CONFIG_MATCH_IFACE + if (exitcode == 0) *** 1265 LINES SKIPPED *** From nobody Tue Jul 23 20:26:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WT7vd19cwz5QMQc; Tue, 23 Jul 2024 20:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WT7vd07GXz4J00; Tue, 23 Jul 2024 20:26:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721766365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TisWMLq5q9F4Jtl/7HJjmNfAYk2nWlFS12k1MvRx/z4=; b=xNsE6HJhySgm6QVr1fdPVPlaWXDO8NNo3QxN4mw9V/TZSCyqLHY4OgDdK/OuxWfAlxRMga OwD62zlY6s/oUccDGkhzZfP5tjQ91MDpNkYYfVfzdNP2Aygvl/OVzxHAU/rJnPX8+VN04w UeZXdxm4AsqRzEuKnRCjBpw8DiPq1yJXGXI381h7Q9OlSv8sPfBIlcVN/YSoDOhiKBfADd EXmyS4OgEknIZuOR3QTcPqsHbrQC5dhors9lIsWe9qPAFjUqneVwdVuGs10XkUzAD4l02k VPIthWMBdCCI9hkdxHvwzb8EvCPPJV1tyBaYrebqPPm7A9zYkE7mrTc9X8fJBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721766365; a=rsa-sha256; cv=none; b=lSQGiyagR8uod+HovCEtxjGHKlKdezosxq0sED87BhLQ/uqqncbb/32jB9UDPjqxbGJ/oh /D5p8QymQRUZNam6fxR+WMQtsP89Kek43tGyXIzM+E63tcPB14qeN1McnaB3zYwstCh8+m vrZv+HTma0AcMTCa5fyokbVf11IqwdxgzPvqYurb+8thokT7HH3lFqh0A54VJRgiiXJhwj IAxmLC5dw/XGi5CmwVoM0I4pH27DRHGtmUxXg+F7+9jI0r+SrOEY8fX3nqnq1gD7TorxaA x8rshDlqAD9o4NSpUwP7fy+kTIwQ9WFAL+xUSK4bkDJY4cjgE6mOdr4zqnKJnw== 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=1721766365; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TisWMLq5q9F4Jtl/7HJjmNfAYk2nWlFS12k1MvRx/z4=; b=gzm5//wKOZteT3smHKWDKuYPiH1VIY0rlDcrT/VZIv1SgZGV3+REBz4xS+10fa4EZ4sbLd KifrJGawQx2WiB8nWW03KzofKCWqSYg1ho7orNR8IcCrwX/+z39j05tFsFZKm6rf0Hf7JU shpy1SMXEZ0AK2JUMf/BlXmKjvnyh/X/lMC+Ru2iW33SVWf7gMs+ZomaD1mFuWXVvoh1KE Q6N5kj6MKIbp35jvmfnhC0VqBR0AcxFth1LrCPYFl710J9GGCu4zTrCmE59cKIezQ6J1UV lUgflZole2qSsXpcDDdIR3xEZA0nUm7ur1IJCjDngZzeLs15WBIGvxRwzoXYZg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WT7vc6kCRzj2F; Tue, 23 Jul 2024 20:26:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NKQ4f2036545; Tue, 23 Jul 2024 20:26:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NKQ4M1036542; Tue, 23 Jul 2024 20:26:04 GMT (envelope-from git) Date: Tue, 23 Jul 2024 20:26:04 GMT Message-Id: <202407232026.46NKQ4M1036542@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 158f319428c1 - main - route: avoid overlapping strcpy List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 158f319428c10143ce2ffe766416207c75578931 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=158f319428c10143ce2ffe766416207c75578931 commit 158f319428c10143ce2ffe766416207c75578931 Author: Kyle Evans AuthorDate: 2024-07-23 20:25:46 +0000 Commit: Kyle Evans CommitDate: 2024-07-23 20:25:56 +0000 route: avoid overlapping strcpy Passing overlapping buffers to strcpy yields an undefined result, so let's avoid it. The copy doesn't really need to happen anyways, we can just point to the domain part of the hostname. This was discovered with _FORTIFY_SOURCE. Sponsored by: Klara, Inc. Sponsored by: Stormshield Reviewed by: allanjude, emaste, imp, melifaro (all previous version) Differential Revision: https://reviews.freebsd.org/D32615 --- sbin/route/route.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/sbin/route/route.c b/sbin/route/route.c index 03844308fe84..cea63df3aa11 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -94,8 +94,8 @@ static u_long rtm_inits; static uid_t uid; static int defaultfib; static int numfibs; -static char domain[MAXHOSTNAMELEN + 1]; -static bool domain_initialized; +static char domain_storage[MAXHOSTNAMELEN + 1]; +static const char *domain; static char rt_line[NI_MAXHOST]; static char net_line[MAXHOSTNAMELEN + 1]; @@ -581,14 +581,16 @@ routename(struct sockaddr *sa) const char *cp; int n; - if (!domain_initialized) { - domain_initialized = true; - if (gethostname(domain, MAXHOSTNAMELEN) == 0 && - (cp = strchr(domain, '.'))) { - domain[MAXHOSTNAMELEN] = '\0'; - (void)strcpy(domain, cp + 1); - } else - domain[0] = '\0'; + if (domain == NULL) { + if (gethostname(domain_storage, + sizeof(domain_storage) - 1) == 0 && + (cp = strchr(domain_storage, '.')) != NULL) { + domain_storage[sizeof(domain_storage) - 1] = '\0'; + domain = cp + 1; + } else { + domain_storage[0] = '\0'; + domain = domain_storage; + } } /* If the address is zero-filled, use "default". */ From nobody Tue Jul 23 20:39:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WT8Bd3rqTz5QNJ4; Tue, 23 Jul 2024 20:39: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WT8Bd3CMhz4LBj; Tue, 23 Jul 2024 20:39:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721767145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ETYEhdGGqxVZNskg5EMBkQu1EGgZ9usnRI3Uglx/UcA=; b=fjhavr3sMIs35Y1IgVcpywHJc6huofkyxdjJIhbwvU2W7NW87wrd1NMf5mxvEvhE9Uhg0Y uIqQs1kF18zxNVaFkOcUMrGHz4IoFsnE05vVpZz5DdyB8NHP6j1OuMzNJ6V18snqV+VXy7 +WffvTjiGxT0YkiMnn9AugDWK4uNwQXlMbX69mxMexeRUJB+9DnRaZUcGTaImERAsc381Q JYg/aHEDF34AjSnPAeFgQ4h7B7x4NDDd2WOnYoN3r7LRSFDLOJCs7lhMS657qva3YV8qAu FmleWExC52GGOVCJnECTUq/GAC4Bq7ZbWoFZR7Wp9ZFz/E+r43QJfjQKdVe+GA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721767145; a=rsa-sha256; cv=none; b=p4v49eOEhKBkv0Coy7Kicyxb2VmH9MLltOWXlWXQ5JCeSQ7EjHeUAkqPQnjkRAhcs4n4Cu q3pjYLRYt719TNeSUFij84pXuULmWaq7l1ArWZ3FjBSqhGKu7iytP2QkTeeb4lAuV1rKPG cnEic3Yp2wnOED1dHJ5IFgbCG/rPdN84H4TCptPDs1BkTUmX7z5VwfRX0a6vVvMfJozeKs xmMb9ar3HTHrzRlMylXwed6Ohd3VK1/Y05SVIn/PEA1QlRgMCkK0n51xljP5/9Pgbhkga4 6E52nIszJ2we1XVG2/qV/6uduWIKCzEN3O6jmSGjM+7szen1Nbfn2eDDfCCzQA== 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=1721767145; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ETYEhdGGqxVZNskg5EMBkQu1EGgZ9usnRI3Uglx/UcA=; b=qUsYvB4tgUcLTGwQFMxUO0PEW9v3Tal58Lybt6xbyKp9vAVhPB7admNMCPuM5W2HlvNqn7 G2+2aPRpnMwvywAWyA2uuwa/XNvSF8UW7A1Vii5RlenUyrWIi0IHlZU4yyCWKLZ992/hS7 xo3XM2pa7IbQwOP3hgZOUHPAieYDp12GkSpluqI/8fkF4F8Sdvp/y9MB2+mbKphDnyFLl4 1wrRHsQI4AT3McRQsQpdFyZtkeTOA91pW1l+MwJBriV6mrmdI3hZhbbknZb/ofBLGkkN33 iDYcoTqKYL8K+Qsv7fLEXK8oxmmDE5kLF+mBLuppMmQoczhIFq48tKsYaZdEhw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WT8Bd2f62zj2h; Tue, 23 Jul 2024 20:39:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NKd5x0054605; Tue, 23 Jul 2024 20:39:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NKd5LU054602; Tue, 23 Jul 2024 20:39:05 GMT (envelope-from git) Date: Tue, 23 Jul 2024 20:39:05 GMT Message-Id: <202407232039.46NKd5LU054602@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 0ac6cc3fd747 - main - iichid: Soften "Interrupt setup failed" message List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0ac6cc3fd7473a7a8596fa73322a67fc1d78df53 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0ac6cc3fd7473a7a8596fa73322a67fc1d78df53 commit 0ac6cc3fd7473a7a8596fa73322a67fc1d78df53 Author: Ed Maste AuthorDate: 2024-07-23 17:37:15 +0000 Commit: Ed Maste CommitDate: 2024-07-23 20:38:16 +0000 iichid: Soften "Interrupt setup failed" message Users may interpret the message as a possible hardware error, but the issue is in fact unimplemented functionality. Reword the message to avoid implying it is an error. Reviewed by: wulf Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D46092 --- sys/dev/iicbus/iichid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/iicbus/iichid.c b/sys/dev/iicbus/iichid.c index 222f20842a04..1e0dac2ee5dd 100644 --- a/sys/dev/iicbus/iichid.c +++ b/sys/dev/iicbus/iichid.c @@ -1154,7 +1154,7 @@ iichid_attach(device_t dev) if (sc->irq_res == NULL || error != 0) { #ifdef IICHID_SAMPLING device_printf(sc->dev, - "Interrupt setup failed. Fallback to sampling\n"); + "Using sampling mode\n"); sc->sampling_rate_slow = IICHID_SAMPLING_RATE_SLOW; #else device_printf(sc->dev, "Interrupt setup failed\n"); From nobody Tue Jul 23 21:31:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WT9MB17KQz5Qxv8 for ; Tue, 23 Jul 2024 21:31: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WT9MB0bnlz4Skc; Tue, 23 Jul 2024 21:31:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721770294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=atPJ/2C6OtXvXG66sbToSy7yzmk1K2tDVm81+L85KxY=; b=LLUEVIU2bkYeWoFwOBJxDNeyDR5apFML1koDrWOzWZUr7qBhcZgy296ExHbjgKASkd3ln3 eM8YJfPODb5Xlf7u7QRChRe3lpypDIZrn4o1TELCefk2FoR3ihEvqU5R+/Cc1Pb3atH0Dj AwDf3r3uhThtpcr59trfuSH8V+HAFCEDHU8Ovnnx/4v4IiwHYoUPh8hA7hLJ7mp40/aXdn NePr9GzWJoWRUn3k9cQ8Je+62Bsh8JVUbDlvRbnXwSOXDPJ3ScD8PNomNMAl7/hWbXRD+p 6g0F6Ujrx+llfKpqwvI0hzDsoCp/3j+73f1rNyZK1JBplrAf5ZHeqL0HSvCThA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721770294; a=rsa-sha256; cv=none; b=phtAlcp6UyxF0+tQsV66uJVpBgoQCuC6zKRWGBFloZJal5t9VvVNmwHqsWBtIUWLXkR5cw wOWvJMB76HoffzoBQ+/7dFUBQqwWvSM0PE3UkRKiJo7IHAgvKOHMnLB3Knqa8Z07FXqFSJ 8hKcuypVEIFG13Kl+cR150AKufXYYK9HqiB2JcBLQfawBzm8QTDbBEwaOjLMYelGM/hdNL jtwH0/fuL2Q3r28P7v6LSNRziYKcdGYjG98gp7AUxA4ZnaW914gAfaKb+Ta541JMxoyLXB /BI2NVPZ6RZkK3uO3+bSt4y5/IpJ9M+AtzZIR+kQyr1O5oauNkEYEzAEQbbiNg== 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=1721770294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=atPJ/2C6OtXvXG66sbToSy7yzmk1K2tDVm81+L85KxY=; b=jS8K30wClHtDrV9Pj6z5hZrH2LK2l1HQvSpLmh7pfE77V8lBSspCMA7l59Ov8vEWorctLd k0o14jJsZ4hCYA8C+R1e0PX9DdPIgAHWEUN6GEFg/rtTNjj1tQW6xQuTW36DZi0jI0DtfJ uT68W5BItjyPHz9dngmZRGDOXFUHvx/93mX5n1ZF700Jt7m62elAYWh/HvJk61QpM/r3PE 17Tqhia6f9GYJbDTEpaP41Fapc4YLbljzb6yl1SUuFUDgZF0ktF6QjaAEAckJ0XvrYGo+2 dr/FzOmWLTbPfiCJD1mrtqzYhntXfOUnh6fCN8LuslyOCfv/NVIuQi6sUTh2Tw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WT9M960rjzlFQ; Tue, 23 Jul 2024 21:31:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NLVXbZ052620; Tue, 23 Jul 2024 21:31:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NLVX3S052619; Tue, 23 Jul 2024 21:31:33 GMT (envelope-from git) Date: Tue, 23 Jul 2024 21:31:33 GMT Message-Id: <202407232131.46NLVX3S052619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Warner Losh Subject: git: 887b27736b04..381c116afc1f - vendor/one-true-awk - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/vendor/one-true-awk X-Git-Reftype: branch X-Git-Commit: 381c116afc1f4a775483a1b1a864488d37cc4b8a X-Git-Oldrev: 887b27736b04cef8c4ce6f123c5f4bdc12a8bae4 X-Git-Newrev: 381c116afc1f4a775483a1b1a864488d37cc4b8a Auto-Submitted: auto-generated The branch vendor/one-true-awk has been updated by imp: URL: https://cgit.FreeBSD.org/src/log/?id=887b27736b04..381c116afc1f 381c116afc1f ota: Import 9f971fba471b from bsd-feature for 20240623 From nobody Tue Jul 23 21:44:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WT9dZ6fgqz5QyyY; Tue, 23 Jul 2024 21:44: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WT9dZ5txVz4V0R; Tue, 23 Jul 2024 21:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721771042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6AeVwLUFXC75lg2csA+hTQGTkR9ZiRDRgstJ9kFDzJA=; b=yWP6q3cfNM5Tfxr2Qsmvm2dHdyM9pRa49vITsf50wEfbMwO612PwKLAGBfu55HKJcVGs1i 3zGuYwh4XGnwTed/ydPXGdIVXQnK8JS4l70asa73+z1rwcdsyiR4dipdfTsH0xrPAaYkhA PMvC4f07x30WXY6bHowtP8PyFvpZ2IwxnJOJ/UgdVEwS8mSTIaiSLc6utMp/3ku211IZnB 8f4PqtaLz+Y5dGtkS+zPgK62ddHBDhnBZV9fYmzVtgVSEyDvcFmYOu91KJeZcUrX6iNL2H BpZVfFobt2CHNvKDZwJeN0wF8y4aGTWkkwfG+d1w/u/7FpoDqGxwI9+4sJwdKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721771042; a=rsa-sha256; cv=none; b=CM3FTvtrYGtjDfc62YbJq8rU+pLW16vBwWfoWUSDhxjAiQtnafugZ2EWbPjvHIQ1SBC89Z dNQG61oEzDtfN7vwLjU+jlt9eN4mdEaJL3pqnrglqXFoGmcqjurygHleoQg6NX6TNCGcSY VQQMkPt2BwYoIRmgoO25ibfhFpDocoYsX4xQjL1SHxb/8wdHpkS6llgznxHTZdyRmVSMmp ehxTAFQDCC6N0iHrSyee2thdBMDndZYP4GHLL+NbUNONvcxU8fvoPsh6/GMxVLXZjX6F2I xbkbSND4ip3/CeBcY8VssyMldXC1p3gWmh9Z4SKliLs5nTfZxl+nIoJmcd51Jw== 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=1721771042; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6AeVwLUFXC75lg2csA+hTQGTkR9ZiRDRgstJ9kFDzJA=; b=DKDCujFbS4/ovyWKnya47XKMd9jNV/DUzCoguMqbzyRtoPxLt8LRYVmRNa9XYkz9qfuJJZ gmdcCrZvgCHyJMUlWvDMhxvgTysoU+F9bJSql5UcUERk/46ADVFSy7hm5HUyvYtazMthRf Mkb0ElW8jqJwvvSxkLxa3rcf2FYkqo/mQ88Gqqd1gAA/vPqonladr6Fsoyu0RcQXtyBBRU rBEIeVdZmOskQ3mkwFkRafCX2pexukjQYsmk4uHwG6pJgrMEl/L2q8LzvMPpbamlbJlbJA 68lkZ5igrO8lkhX2VSIGPzpJhWAtUZk9Kxf2if9VAgo3e4xsH0IF+y4mkkLCxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WT9dZ5VBSzlT3; Tue, 23 Jul 2024 21:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NLi2C5072123; Tue, 23 Jul 2024 21:44:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NLi2c5072120; Tue, 23 Jul 2024 21:44:02 GMT (envelope-from git) Date: Tue, 23 Jul 2024 21:44:02 GMT Message-Id: <202407232144.46NLi2c5072120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: cade8f6c118f - main - ELF auxargs: reserve a slot for CheriABI use List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cade8f6c118f304eb7c91a1d423b4a97ee466284 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=cade8f6c118f304eb7c91a1d423b4a97ee466284 commit cade8f6c118f304eb7c91a1d423b4a97ee466284 Author: Brooks Davis AuthorDate: 2024-07-23 21:31:44 +0000 Commit: Brooks Davis CommitDate: 2024-07-23 21:31:44 +0000 ELF auxargs: reserve a slot for CheriABI use Reserve slot 37 to avoid flag days downstream. We currently use this slot in CheriBSD to maintain counters in userspace while providing access to them vis sysctl. CHERI support isn't landing in FreeBSD quite yet (probably for 16 unless hardware access accelerates radically), but it seems highly likely at this point so reserving slots will limit future diffs in both directions. Reviewed by: jhb Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D46060 --- sys/sys/elf_common.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/sys/elf_common.h b/sys/sys/elf_common.h index b9e82cb8fa35..6cb92d1011fe 100644 --- a/sys/sys/elf_common.h +++ b/sys/sys/elf_common.h @@ -990,8 +990,9 @@ typedef struct { #define AT_KPRELOAD 34 /* Base of vdso, preloaded by rtld */ #define AT_USRSTACKBASE 35 /* Top of user stack */ #define AT_USRSTACKLIM 36 /* Grow limit of user stack */ +#define AT_CHERI_STATS 37 /* Reserved */ -#define AT_COUNT 37 /* Count of defined aux entry types. */ +#define AT_COUNT 38 /* Count of defined aux entry types. */ /* * Relocation types. From nobody Tue Jul 23 21:50:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WT9mv5y8Zz5R0Rx; Tue, 23 Jul 2024 21:50:23 +0000 (UTC) (envelope-from brooks@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WT9mv5RNCz4W3b; Tue, 23 Jul 2024 21:50:23 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721771423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QD1IZ7p0MQUHXqQa1+wdiISsi3SPaUI9QYfIXuNhezk=; b=H3swi+om9zCHvldM9V6oXsz5nNb6bKub5sOLAw9hAscL9NzN3y8xboF+vpOIOqEFZ1wPI0 6H5kLYvYcV90s2SuLve1gmYQS73StlISpPSwgNAkoLuZO0u5fRcMV/3IkfmYgEhlKj/QBt L0/RWWjDUMWqg2lxEXMQoDd+Dwl/AzWqvcFR5rBrSlcmIp/a3LuxXSCmIrcy5MxYwMr8oR juB6xniy8uLkyP25nf7uhAOzaFimwxJIJT57D8pC/+MqOcHdT21UfuW53ZD/cW+qRycduu dT7Xn9fPzXxQ+9SqJGwPFiH2MFbSbaK2PbBQjZwCc8ThjZbig92jlvXscBvmAg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721771423; a=rsa-sha256; cv=none; b=FwlU7UQjV9TNVWuKDxL+NL1Lpyjvjw8QsCA7h+VQywyblq0fgf3btd/APPnh2WO0RXIPzx SSa3gzbr2VZ25hIiVtA5xUOqJ98kFP8kqlna9WxY4RpxnhgmC0JyNBXxLeaJsc+f5gNs7R TScJjXNRelcaWCSXP58/gK313cky05AIZ74Cmzz8hu3ib4PUwz4OSG8G+SRQLxmjx1mmYQ FgiNFJjUBZJXoTmah+a6VMYsLsoj26WeJAesEXeYLOyxxErrRJwP0a4H41dKOF72GyF/Ug IQ2TlzEck76FU+g9NEsOm5pJEew9b2c5+2UEaExKQWVGC77SVlNIdxOoXNxrsw== 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=1721771423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QD1IZ7p0MQUHXqQa1+wdiISsi3SPaUI9QYfIXuNhezk=; b=f3W80GLi4LI8SH96EFgYgdriuCf4pJhTLyBh7jA8mlvCaxfIY/3Wnbmr1obAU/vJb6GWSR lTt9sRAIXa5kznIRgOAzNCEtnWEfdofqaE3bihpysP1X7GT67nBN4bAcdZkhHVraDJI37+ EEXl0fuiM2AyNh7MxpBr+FFf1fGWkXAx036sA+g/Ebph/bCWeHCDaDritIcSMGKjWKI3ZB 81JDjt+hNDRUj+dpVPRDIrVRIexgjoHhgfLzlMcLmd+kDNm4RTAz9ZQmptCWwNKOBtrGyo xM3PumVCX4hCuAg2HQvwOSOMHv8LOOWAmU+dFmmUDJjd4Y1PMr0qrEnnxEBHdQ== Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.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: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WT9mv4pPqzHjV; Tue, 23 Jul 2024 21:50:23 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 6AFE13C019B; Tue, 23 Jul 2024 21:50:23 +0000 (UTC) Date: Tue, 23 Jul 2024 21:50:23 +0000 From: Brooks Davis To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: cade8f6c118f - main - ELF auxargs: reserve a slot for CheriABI use Message-ID: References: <202407232144.46NLi2c5072120@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202407232144.46NLi2c5072120@gitrepo.freebsd.org> On Tue, Jul 23, 2024 at 09:44:02PM +0000, Brooks Davis wrote: > The branch main has been updated by brooks: > > URL: https://cgit.FreeBSD.org/src/commit/?id=cade8f6c118f304eb7c91a1d423b4a97ee466284 > > commit cade8f6c118f304eb7c91a1d423b4a97ee466284 > Author: Brooks Davis > AuthorDate: 2024-07-23 21:31:44 +0000 > Commit: Brooks Davis > CommitDate: 2024-07-23 21:31:44 +0000 > > ELF auxargs: reserve a slot for CheriABI use > > Reserve slot 37 to avoid flag days downstream. > > We currently use this slot in CheriBSD to maintain counters in userspace > while providing access to them vis sysctl. CHERI support isn't landing > in FreeBSD quite yet (probably for 16 unless hardware access accelerates > radically), but it seems highly likely at this point so reserving slots > will limit future diffs in both directions. In anticipation of merging CHERI support over the next few years, we're going to start reserving values like this where we're confident in the functionality they represent and that the values will hold (either because they are under our control or because some upstream standards body like RISC-V International has allocated them.) I've started here because andrew@ noticed that Linux now has AT_HWCAP{3,4} defines and it would be disruptive for us downstream if there was a collision. -- Brooks From nobody Tue Jul 23 22:02:37 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTB344SThz5R1qs; Tue, 23 Jul 2024 22:02: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTB343vVPz4X1P; Tue, 23 Jul 2024 22:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721772160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7MMLFHOywzmHb72K5sRz7V3WejtESgWVsPJ0OvFKODs=; b=p9SvV0EDCB4gl+m/t8BlwAiDqnkgNui2Dm87U7huJBl6VUC0/RCZe4RYrv62pjw6FSVKUA L84okBZd60xYfk62+uIP8LGNezaZ0nYiDfTFV/5UE8IQu4DVw/zix4g+vPrWEWLJq+AhZi F5P1BJGEmNQX9C4u+M3AaqK1AILMmjkQvGAybUcr+r/bFOUhhAbUeJwBWsG4zFX6hXZ+Z3 M2+g4inJhf8s83hCig00P6svr00ewCiuGyRQqdKxJd3tTSLutssxx2RFgCtJMNkFjHc+Br BsJ/OinCLKojmV7C0PC36wJXDy8cZ7EKO5yYeCWCuxtBlvPHdERoZvM7Tr3xWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721772160; a=rsa-sha256; cv=none; b=h53/0SBfUKMkDWD3F2koqKvI9c3TttM+/ow19Z9aGj6zgsbpNQ5wu1Sc+tUL+VJhbLVeYj QcrMtLo6fFeSCrsypgR+YbYr2/Ou04e18XzP9Gc3esRMg5l3cMdRh7++TY7fbA0/PiNn3G J6f9mZ4RVet6J7aa/hskQOremer27JoG+L4okb7ZYLvrgQ3cJldU2LTqP7yeUVMoaJbfgB 6q+8SrtRU4Tu1kaC2KflJJ4CsS6HuPn6LVDNgXfdeya/2YhoHf2WRAftfGi/g2r1a02oH0 cKgAfeDxXCwDXvIdswubrbN2nwsHSduWJEHJ8ymOAdR9g5tOIOwue4+QgWTEPA== 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=1721772160; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7MMLFHOywzmHb72K5sRz7V3WejtESgWVsPJ0OvFKODs=; b=xNcNenzYMh22UVKJ9ciuqQ7+3EmahlgKwY+/I4+LsnSDht0qaqpDx41w7lXMvAEv8AFiy2 WNom/Tbrpg3GTtQwyaVSruHAhj5fP4fmG2fhHNoj1fdIt4OTx9ewjZIscN3QxJ1n+m2o5y ldUBQ1yr3YjTNB5s7rKtUAHzcqIze+Lb6f8EU6NHCXoRbzJhQVfamjJgY+Ul13FiQD/J3r So8+2Z4cBfI+FMK7C840xvUx71f3gE3a7o5P774mmDb0oXToovpLjDGRBvc0zKgthd8Fk1 xBG+qgbuGrKv2kp6THKjnniWkNz+6fWwKqSTbFdyV4E4t5dZ24UsvoUr1MB3nQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTB343VpLzm9b; Tue, 23 Jul 2024 22:02:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NM2eM9006411; Tue, 23 Jul 2024 22:02:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NM2b5A006393; Tue, 23 Jul 2024 22:02:37 GMT (envelope-from git) Date: Tue, 23 Jul 2024 22:02:37 GMT Message-Id: <202407232202.46NM2b5A006393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 17853db4b0dc - main - ota: Merge 20240623 (bsd-features) from ota 9f971fba471b List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 17853db4b0dc36ed32af039cd803f13b692913da Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=17853db4b0dc36ed32af039cd803f13b692913da commit 17853db4b0dc36ed32af039cd803f13b692913da Merge: cade8f6c118f 381c116afc1f Author: Warner Losh AuthorDate: 2024-07-23 21:17:58 +0000 Commit: Warner Losh CommitDate: 2024-07-23 22:01:50 +0000 ota: Merge 20240623 (bsd-features) from ota 9f971fba471b Merge from upstream. The system-status test was modifed upstream, but it still doesn't fit into ATF, so those changes weren't brought in. From FIXES: Jun 23, 2024 Fix signal for system-status test. Thanks to Tim van der Molen. Rewrite if-else chain as switch. Thanks to Andrew Sukach. May 27, 2024 Spelling fixes and removal of unneeded prototypes and extern. Thanks to Jonathan Gray. May 4, 2024 Fixed a use-after-free bug with ARGV for "delete ARGV". Also ENVtab is no longer global. Thanks to Benjamin Sturz for spotting the ARGV issue and Todd Miller for the fix. May 3, 2024: Remove warnings when compiling with g++. Thanks to Arnold Robbins. Sponsored by: Netflix contrib/one-true-awk/FIXES | 26 ++++++++--- contrib/one-true-awk/FIXES.1e | 4 +- contrib/one-true-awk/README.md | 2 +- contrib/one-true-awk/TODO | 2 +- contrib/one-true-awk/awk.h | 1 - contrib/one-true-awk/b.c | 55 ++++++++++++++--------- contrib/one-true-awk/bugs-fixed/ofs-rebuild.awk | 2 +- contrib/one-true-awk/bugs-fixed/system-status.ok2 | 2 +- contrib/one-true-awk/lex.c | 2 +- contrib/one-true-awk/lib.c | 8 ++-- contrib/one-true-awk/main.c | 48 ++++++++++++++------ contrib/one-true-awk/makefile | 1 + contrib/one-true-awk/proto.h | 4 -- contrib/one-true-awk/run.c | 6 +-- contrib/one-true-awk/testdir/T.argv | 23 ++++++++++ contrib/one-true-awk/testdir/T.csconcat | 2 +- contrib/one-true-awk/tran.c | 22 ++++----- 17 files changed, 141 insertions(+), 69 deletions(-) diff --cc contrib/one-true-awk/README.md index a41fb3c3b128,000000000000..aba057228b15 mode 100644,000000..100644 --- a/contrib/one-true-awk/README.md +++ b/contrib/one-true-awk/README.md @@@ -1,149 -1,0 +1,149 @@@ +# The One True Awk + +This is the version of `awk` described in _The AWK Programming Language_, +Second Edition, by Al Aho, Brian Kernighan, and Peter Weinberger +(Addison-Wesley, 2024, ISBN-13 978-0138269722, ISBN-10 0138269726). + +## What's New? ## + +This version of Awk handles UTF-8 and comma-separated values (CSV) input. + +### Strings ### + +Functions that process strings now count Unicode code points, not bytes; +this affects `length`, `substr`, `index`, `match`, `split`, +`sub`, `gsub`, and others. Note that code +points are not necessarily characters. + +UTF-8 sequences may appear in literal strings and regular expressions. - Aribtrary characters may be included with `\u` followed by 1 to 8 hexadecimal digits. ++Arbitrary characters may be included with `\u` followed by 1 to 8 hexadecimal digits. + +### Regular expressions ### + +Regular expressions may include UTF-8 code points, including `\u`. + +### CSV ### + +The option `--csv` turns on CSV processing of input: +fields are separated by commas, fields may be quoted with +double-quote (`"`) characters, quoted fields may contain embedded newlines. +Double-quotes in fields have to be doubled and enclosed in quoted fields. +In CSV mode, `FS` is ignored. + +If no explicit separator argument is provided, +field-splitting in `split` is determined by CSV mode. + +## Copyright + +Copyright (C) Lucent Technologies 1997
+All Rights Reserved + +Permission to use, copy, modify, and distribute this software and +its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the name Lucent Technologies or any of +its entities not be used in advertising or publicity pertaining +to distribution of the software without specific, written prior +permission. + +LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. +IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +THIS SOFTWARE. + +## Distribution and Reporting Problems + +Changes, mostly bug fixes and occasional enhancements, are listed +in `FIXES`. If you distribute this code further, please please please +distribute `FIXES` with it. + +If you find errors, please report them +to the current maintainer, ozan.yigit@gmail.com. +Please _also_ open an issue in the GitHub issue tracker, to make +it easy to track issues. +Thanks. + +## Submitting Pull Requests + +Pull requests are welcome. Some guidelines: + +* Please do not use functions or facilities that are not standard (e.g., +`strlcpy()`, `fpurge()`). + +* Please run the test suite and make sure that your changes pass before +posting the pull request. To do so: + + 1. Save the previous version of `awk` somewhere in your path. Call it `nawk` (for example). + 1. Run `oldawk=nawk make check > check.out 2>&1`. + 1. Search for `BAD` or `error` in the result. In general, look over it manually to make sure there are no errors. + +* Please create the pull request with a request +to merge into the `staging` branch instead of into the `master` branch. +This allows us to do testing, and to make any additional edits or changes +after the merge but before merging to `master`. + +## Building + +The program itself is created by + + make + +which should produce a sequence of messages roughly like this: + + bison -d awkgram.y + awkgram.y: warning: 44 shift/reduce conflicts [-Wconflicts-sr] + awkgram.y: warning: 85 reduce/reduce conflicts [-Wconflicts-rr] + awkgram.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples + gcc -g -Wall -pedantic -Wcast-qual -O2 -c -o awkgram.tab.o awkgram.tab.c + gcc -g -Wall -pedantic -Wcast-qual -O2 -c -o b.o b.c + gcc -g -Wall -pedantic -Wcast-qual -O2 -c -o main.o main.c + gcc -g -Wall -pedantic -Wcast-qual -O2 -c -o parse.o parse.c + gcc -g -Wall -pedantic -Wcast-qual -O2 maketab.c -o maketab + ./maketab awkgram.tab.h >proctab.c + gcc -g -Wall -pedantic -Wcast-qual -O2 -c -o proctab.o proctab.c + gcc -g -Wall -pedantic -Wcast-qual -O2 -c -o tran.o tran.c + gcc -g -Wall -pedantic -Wcast-qual -O2 -c -o lib.o lib.c + gcc -g -Wall -pedantic -Wcast-qual -O2 -c -o run.o run.c + gcc -g -Wall -pedantic -Wcast-qual -O2 -c -o lex.o lex.c + gcc -g -Wall -pedantic -Wcast-qual -O2 awkgram.tab.o b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o -lm + +This produces an executable `a.out`; you will eventually want to +move this to some place like `/usr/bin/awk`. + +If your system does not have `yacc` or `bison` (the GNU +equivalent), you need to install one of them first. +The default in the `makefile` is `bison`; you will have +to edit the `makefile` to use `yacc`. + +NOTE: This version uses ISO/IEC C99, as you should also. We have +compiled this without any changes using `gcc -Wall` and/or local C +compilers on a variety of systems, but new systems or compilers +may raise some new complaint; reports of difficulties are +welcome. + +This compiles without change on Macintosh OS X using `gcc` and +the standard developer tools. + +You can also use `make CC=g++` to build with the GNU C++ compiler, +should you choose to do so. + +## A Note About Releases + +We don't usually do releases. + +## A Note About Maintenance + +NOTICE! Maintenance of this program is on a ''best effort'' +basis. We try to get to issues and pull requests as quickly +as we can. Unfortunately, however, keeping this program going +is not at the top of our priority list. + +#### Last Updated + +Mon 05 Feb 2024 08:46:55 IST From nobody Tue Jul 23 22:21:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTBSK6ZK3z5R2pK; Tue, 23 Jul 2024 22:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTBSK625Vz4YJr; Tue, 23 Jul 2024 22:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721773265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yXIMzGZpRhnbzUbAprCvFbcKLxGx8vQuaZoubtYxwp4=; b=mAZHhkHM2FBQF+uaFzKCTUZOrlNk1q55yl9YF6m649dwflp+pmu48aHbzi+NwPpYJxZFgW iDpw8RfK24TxmHmtVHz1Eh9cRmzP3/FlhIil3V5+aYIqhTIlSiUdy0+STD8FE4qH+wYGme zvFVz2BgQT9JBOXwA3DeJlFC8fCdPV7Wkh7Cno0FAepj9bVU0aFdRxxzaHlmtPrasCcrZS fSxmvTlRnVKBHX+cCfMBpvtw9eeAk5PUtsd+taMLU6WNr6cyc2uH8hRq0s1U8V6ONHlvxW TMEq/PUAPLOJy044VjhF6rK16MVv/hpJNlWGqMqxLbAUiLWhDsEdPbvkJUj4NQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721773265; a=rsa-sha256; cv=none; b=cX51qaI4M5H+qZ+BjZ8i63EPu+vV/ElJP+NLZuuqUIOBHBYPh9eatVzWsbjjs0ISKN4dXi osCOW5xH88Neig/2LyKT8PPHoZB/DAvtzd6CbIHXQr+sLLATzJ5KTq548GssXgVwP9b+Az GbV3VHOv08PPAuYuvqsf/uvitNYQrM13CcZEOUmZ3l11jv8K/ycJEGCKRamAiTRzJatgsj E1hE9ZkJfvmiML0uw/ZjGSVeF4YVCAVIU6MHaba2QTtGB/kmIZ6+MIYZMJ6umDv//ito3L dmC2QfroiPiXYciVZLwFfM9GMWpavMygICF94J3k5pJCPKtjMjpdh09wGfpyRA== 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=1721773265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yXIMzGZpRhnbzUbAprCvFbcKLxGx8vQuaZoubtYxwp4=; b=GSJ/S6PHsTqZpgBOPnXLE2yDZYOyFdQFx1WkGTu+284E4igqvvQ8tXE7ioVSVDcnzFmLt0 wqx4GMtLpJdbKJsL+QBRBBi4y/ZRCBj81jHB7G9LvHnJLb8KRgJMp/HuETYD6UhxWJnu9X +CUbT5UTsJVyN8Fdx3hYRu0YDewJtjKo2xCHFclq97e2J5I9k76Srv4FsT3jhEvKRIzkvo PVqaBL/S/iXYkq4R354rpclmm1NOFrX5dUjHLZRj5qyCx24WwY5VoQapoUSHQkk9axxRYW siehmTtAmMqzOaAzF6R3/IPJqUTsckulkNbLX2OnRHEsDodPpG1MHuGGFMDjWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTBSK5dNLzmh6; Tue, 23 Jul 2024 22:21:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NML5NQ034583; Tue, 23 Jul 2024 22:21:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NML59Y034580; Tue, 23 Jul 2024 22:21:05 GMT (envelope-from git) Date: Tue, 23 Jul 2024 22:21:05 GMT Message-Id: <202407232221.46NML59Y034580@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 8f77be22904a - main - mitigations(7): note that FORTIFY_SOURCE must be set in the env List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8f77be22904a91014bb14af30c7d88a5d31f2c51 Auto-Submitted: auto-generated The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=8f77be22904a91014bb14af30c7d88a5d31f2c51 commit 8f77be22904a91014bb14af30c7d88a5d31f2c51 Author: Kyle Evans AuthorDate: 2024-07-23 22:20:53 +0000 Commit: Kyle Evans CommitDate: 2024-07-23 22:20:53 +0000 mitigations(7): note that FORTIFY_SOURCE must be set in the env Some parts of the build will need to be able to override it, so it must be set either in the environment or src-env.conf -- NOT src.conf. Reviewed by: imp, markj Sponsored by: Klara, Inc. Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D46070 --- share/man/man7/mitigations.7 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/man/man7/mitigations.7 b/share/man/man7/mitigations.7 index e5ff439455e3..75decbe2d026 100644 --- a/share/man/man7/mitigations.7 +++ b/share/man/man7/mitigations.7 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 1, 2024 +.Dd July 23, 2024 .Dt MITIGATIONS 7 .Os .Sh NAME @@ -275,6 +275,8 @@ headers. .Fx world builds can set .Va FORTIFY_SOURCE +in the environment or +.Pa /etc/src-env.conf to provide a default value for .Va _FORTIFY_SOURCE . When enabled, From nobody Tue Jul 23 23:03:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTCPQ6TPhz5R6Wk; Tue, 23 Jul 2024 23:03: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTCPQ5zqcz4bks; Tue, 23 Jul 2024 23:03:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721775818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=asjD80b8K3cIQY4OuGra18oPr+N/FMqElR5rTEmO+OA=; b=W9BRA/WKBHIT0vcUo9pzrOkPXHaWD5xQbUxCx666scNo56pxVs/tx78+4IwP5I5PtbXgaa wWt3fxwX+1xYsCRNuRt5w/Da4RHbuTlbm1zHUqcyEHGZpVBkiLpeh8BeFuTrUPY4aqxksX GNPRCkqdx8B+/8O6z6161htelQf6tHJry6ygZGkwf9z6M+8aaqzO4F39KQYDMQXuUT9Qm7 hNdMfTdgN+0PNcorLUT4wzp9JQnX6nEddzRb5StZjWFIAyagSx8uNtIMrwgDtbqPUE/r2z Cb6o5QUYom2S4uO2GnyodZaJW2mSaBi9sLSWSi7Bk0X143kKSFvNgzTOvTnieA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721775818; a=rsa-sha256; cv=none; b=azTwm8+LsJzYRklg0OpUx5NVG+gt5g2Ae3FFICyyGD8ByIFk34pcZ7dhCK5coTCvSnBBgP Eos59sPZzYlDJNzhUf9jIcXeLFg/VwO/X2i/cVY+CTjX6gY9mv9myA95VsNEIxRCRndf8r TngzmBrZhB1x8kwpB31P6wRpiiN6RqdMztrLE74r+WeOk0OLBRXe7rAxUTMfDkj6n8vwIK 5K+dK7fZUQfwcFoeQ+MaNeza0IssLhGTUYPwIaTHAhVy7gpFqAaiQk4TRW6VxiPFGdqYKe PnsRBoXQKWGrqHR24v4I8qtecsnEr8VIxiZOeF6B6x9/pTWY6PjvjCrrbBpUGw== 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=1721775818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=asjD80b8K3cIQY4OuGra18oPr+N/FMqElR5rTEmO+OA=; b=LS0PQ8iDbWEr36B8Y2SkfBHUfKCCjR3abAAgFDiaU1tvPXcJJm4/6xWufYakX04ssbTyJv 5hPf71l9i2RCveAh1Bn8ekIw5jwlKXdoSy6GXw5U+ykFLp+Jxhr6pKSszLPd/HDPHR1coc cx13f+f/tgzWmx4OVcodjxwPLJa1L7/bXWk2J5FRMb7AeMpxRsPwd2to10PIffL6/wWOvA 7V7o/bzonDt06rUixJjTtZPJ9d0tkAMfcPT0YqWEBjiX15cGJBKQUsw90Ygl/mYWZpb7Sr hJ7sWAHXolzpEhwvgp/dLurwdLqgzFfIn4aWE5+bLylg4hcNbAomOA3uUPDhoA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTCPQ5bNTznfL; Tue, 23 Jul 2024 23:03:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NN3cWa008221; Tue, 23 Jul 2024 23:03:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NN3cea008218; Tue, 23 Jul 2024 23:03:38 GMT (envelope-from git) Date: Tue, 23 Jul 2024 23:03:38 GMT Message-Id: <202407232303.46NN3cea008218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 86909f7aeb68 - main - nvme: Always lock and only avoid processing for recovery state List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 86909f7aeb68a5689e84829b0d7488f77b539846 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=86909f7aeb68a5689e84829b0d7488f77b539846 commit 86909f7aeb68a5689e84829b0d7488f77b539846 Author: Warner Losh AuthorDate: 2024-07-23 23:01:46 +0000 Commit: Warner Losh CommitDate: 2024-07-23 23:04:02 +0000 nvme: Always lock and only avoid processing for recovery state When we lose a race with the timeout code, shift towards waiting for that timeout code to complete so we can acquire the lock. This way we can make sure we're in 'normal' mode before processing I/O completions. If we're not in 'normal' mode, then we're resetting and we should avoid completions. Sponsored by: Netflix Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D46024 --- sys/dev/nvme/nvme_qpair.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 755be993cee0..8d9fb4d647c6 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -690,7 +690,7 @@ _nvme_qpair_process_completions(struct nvme_qpair *qpair) bool nvme_qpair_process_completions(struct nvme_qpair *qpair) { - bool done; + bool done = false; /* * Interlock with reset / recovery code. This is an usually uncontended @@ -698,12 +698,12 @@ nvme_qpair_process_completions(struct nvme_qpair *qpair) * and to prevent races with the recovery process called from a timeout * context. */ - if (!mtx_trylock(&qpair->recovery)) { - qpair->num_recovery_nolock++; - return (false); - } + mtx_lock(&qpair->recovery); - done = _nvme_qpair_process_completions(qpair); + if (__predict_true(qpair->recovery_state == RECOVERY_NONE)) + done = _nvme_qpair_process_completions(qpair); + else + qpair->num_recovery_nolock++; // XXX likely need to rename mtx_unlock(&qpair->recovery); From nobody Tue Jul 23 23:03:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTCPS0sCLz5R6fw; Tue, 23 Jul 2024 23:03: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTCPR6zz2z4bh3; Tue, 23 Jul 2024 23:03:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721775820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tfVNWpJ2YICm9+xCpIxcdvVwTMHVN54XWd9vwzsvRJE=; b=kxuDL28/wK0DwtSDd+20Bubkqgev0+d46sQNNI1P0osl609tE2+3HizrRDS5S43U2S8r6s Ooo7IKO3lAKC+ObTkUBW0neciB4VYhSyyVl2BRSsTaWqFUnevlTsVPU7MXRVFSMtGmiv3i FafRO9fi8Wcutqi5uys8zaLmHj5zPy6FV1rTHdPl25sWIP+JszmOfsEQUpY71Cp/ygYtFr c+E6YjtMlFXOZIVwBgyxuv8+sYWPfOb6Xmls737wgzNGf3mviBecDHkYRPwa+ZBleJSRGS WNrJfitztDW36UhJ2VdK04C/f8xriHxx9/Cl/k4auCdpMZOC+ZBkwfYPdHOSWA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721775820; a=rsa-sha256; cv=none; b=oHyqueTy+fiqm8XHj5HLEGdYjwEuolSs8KG+487/Kq3gDFF/inhegr6Bd6WH+JLKmVUny3 KF27OoEM2bRGgguKK28sSSdSlO66/yXdweGzz5x7H4jdVFMzNGpSV4nteHDB0apBUUOd8n S8RP7K8HxlD9j5DxGuqgTlqOEZLosPgih+LogxBrqxziSe+SLrwh293tPqT7uRy950UfcW hfpyCAXUYRSDdH4B/IDB7DvZb3Pnb4gAfo0/amcImUKbIe1TD+C/uXai5sQBq9FTyZHEPw nyH65fmHjDYLuiI7X8L+Wl8jouLtuTjT1tke+vejqY8RRZEkDkUCnJKa6fsSXg== 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=1721775820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tfVNWpJ2YICm9+xCpIxcdvVwTMHVN54XWd9vwzsvRJE=; b=JVIPv8qRmsBbAq+f2EQHp/r7FteQOXVlm7W2qyxvR2Jte71qQYauHb2ZJHFveNUPJoQH6p W8bcmdz9SWdY+5ms1NA3TZrq5HQFzyXzL2fZ+Yynbzhc7QYC/gv/uFeNdrt+s66qOFBSHg IQTHRV/ZjTELv2+EwHVrDEQrAzIyqjWJ8ft25z8UqyI65oIzCuPZ5bNuSWLPjvJIbYEePE LdwBWghUEJ2bSU6D5dyUtXyFdZ6Te/0Awm/YVBjv4Y/CFZPch7giA1ko1XnGHMe/Piw8j7 VLPG68lYSelH1G0qFIDxnNvvYjQdnIS5cWu40V7gTMcqrJQzdZhH3JbeM6ZTSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTCPR6cRMzmxm; Tue, 23 Jul 2024 23:03:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NN3dCQ008272; Tue, 23 Jul 2024 23:03:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NN3djK008269; Tue, 23 Jul 2024 23:03:39 GMT (envelope-from git) Date: Tue, 23 Jul 2024 23:03:39 GMT Message-Id: <202407232303.46NN3djK008269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: e6d3ba4be27d - main - nvme: Lock when processing an abort completion command. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6d3ba4be27d86c0ade250b52cf9af380f7b4c34 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=e6d3ba4be27d86c0ade250b52cf9af380f7b4c34 commit e6d3ba4be27d86c0ade250b52cf9af380f7b4c34 Author: Warner Losh AuthorDate: 2024-07-23 23:01:57 +0000 Commit: Warner Losh CommitDate: 2024-07-23 23:04:02 +0000 nvme: Lock when processing an abort completion command. When processing an abort completion command, we have to lock. But we have to lock the qpair of the original transaction (not the abort we're completing). We do this to avoid races with checking the completion id to tr mapping array, as well as to manually complete it. Note: we don't handle the completion status of 'Asked to abort too many transactions at once.' That will be fixed on subsequent commits. Add a note to that effect for now since it's a harder problem to solve. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D46025 --- sys/dev/nvme/nvme_qpair.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index 8d9fb4d647c6..e4286b61a3fc 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -1007,22 +1007,35 @@ nvme_abort_complete(void *arg, const struct nvme_completion *status) struct nvme_tracker *tr = arg; /* - * If cdw0 == 1, the controller was not able to abort the command - * we requested. We still need to check the active tracker array, - * to cover race where I/O timed out at same time controller was - * completing the I/O. + * If cdw0 bit 0 == 1, the controller was not able to abort the command + * we requested. We still need to check the active tracker array, to + * cover race where I/O timed out at same time controller was completing + * the I/O. An abort command always is on the admin queue, but affects + * either an admin or an I/O queue, so take the appropriate qpair lock + * for the original command's queue, since we'll need it to avoid races + * with the completion code and to complete the command manually. */ - if (status->cdw0 == 1 && tr->qpair->act_tr[tr->cid] != NULL) { + mtx_lock(&tr->qpair->lock); + if ((status->cdw0 & 1) == 1 && tr->qpair->act_tr[tr->cid] != NULL) { /* - * An I/O has timed out, and the controller was unable to - * abort it for some reason. Construct a fake completion - * status, and then complete the I/O's tracker manually. + * An I/O has timed out, and the controller was unable to abort + * it for some reason. And we've not processed a completion for + * it yet. Construct a fake completion status, and then complete + * the I/O's tracker manually. */ nvme_printf(tr->qpair->ctrlr, "abort command failed, aborting command manually\n"); nvme_qpair_manual_complete_tracker(tr, NVME_SCT_GENERIC, NVME_SC_ABORTED_BY_REQUEST, 0, ERROR_PRINT_ALL); } + /* + * XXX We don't check status for the possible 'Could not abort because + * excess aborts were submitted to the controller'. We don't prevent + * that, either. Document for the future here, since the standard is + * squishy and only says 'may generate' but implies anything is possible + * including hangs if you exceed the ACL. + */ + mtx_unlock(&tr->qpair->lock); } static void From nobody Tue Jul 23 23:03:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTCPT2ZsBz5R6VS; Tue, 23 Jul 2024 23: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTCPT19DKz4byv; Tue, 23 Jul 2024 23: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=1721775821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ROGzW1NyMKfu55mvfbmTqQEEkjZEuxCXn18sw3pGAAA=; b=CJfnSteNyURHhaHBCNxwLgirv8CFHlP2Vmu+UglV0KHifAEpycT/TDPALqE5r/8BDjEYjZ wIhxwoWZQ3p1ZQ8F3OqaIMt5B8sNkP3Wjwf3n5wtLGvgCKLPD0Au6g/uBm3B6qHBTsISKO Hj/1OPPkRG6nY0LAYeH16Xk2N8cHmcte7q869Cz8vsWMWOb2Q3fKj/tRMHpPbjTP7/lz+P 7CEib6yRe6jM0CeC2fkjoS0S6Lw3unNuew5mHS/ZAxBUeYQstP7akLe6QzozL5FxHJiw3x khPGk7IQ04jtWrHmUMWPyxY/RXJvukn27ShmcJlmsPzrjFKn3O+R0fOLWHeZzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721775821; a=rsa-sha256; cv=none; b=OlDbkbAom25A14arrlYsb5/mysuTYxB/oXuJsbjDT0r+ks0BEw6VeZJ+H0tkGzi37fyK1l W2fknKxTwFxBhgTxbOsR0OMcCd9LuXRlJ/GEYbebvggVNjJXjeR6iiPG1pDqBLeoTiXaCi MKjHO3j4PLm+7VuxsnDU9f0GXGGtsBzruw+la2QBmrX4tThro9knQHeFvZtfxdZzYpHiq9 pNCnFEqroxqmj+R9RORZtBDWSav1d9U9BC9STFd4FV9T2jd3VO6qTcoPqcOnONzrrf9nKp pBunJeg89sXUjUoKqM0QVz+rM8lryPVcQfU6xiwgC4kIzOo3Jfv0YBiYtwgYEg== 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=1721775821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ROGzW1NyMKfu55mvfbmTqQEEkjZEuxCXn18sw3pGAAA=; b=elbTCPGAy/nxv1mZFoPzwVwk4SN33cpmvcm1oWso6OzGdm1ElFdfCPNB7sfn+kQ4GbbgEK 0aJCOMV7hdAELNqdGNcz1vi/aPrD6j9PXXwlFbakPjR9s0MxMi19Ee57QgLHQ+DzgWpesA gTGhhX6L73yc6H21itnemNMEUw4Rx1hYqDMQvAPuSKoxq9oPuT6EGYE1sW0faAdCTTXAoq w8OyePm8tqQLtzeUnvtvWmV9etItxTpTdvf81AbY/OK9JDnB6hWEH3scfzdeOXeE8IjyIh CgP4uhO+hqtJybcPvbXung3RwFGf0rlHvz2cGJLrv56Gt1sr8PwwmgSkf9v4aQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTCPT0V01zmmS; Tue, 23 Jul 2024 23:03:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NN3ejA008314; Tue, 23 Jul 2024 23:03:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NN3eRq008311; Tue, 23 Jul 2024 23:03:40 GMT (envelope-from git) Date: Tue, 23 Jul 2024 23:03:40 GMT Message-Id: <202407232303.46NN3eRq008311@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: aa41354349c1 - main - nvme: Optimize timeout code further List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aa41354349c16ea7220893010df78b47d67d0f74 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=aa41354349c16ea7220893010df78b47d67d0f74 commit aa41354349c16ea7220893010df78b47d67d0f74 Author: Warner Losh AuthorDate: 2024-07-23 23:02:03 +0000 Commit: Warner Losh CommitDate: 2024-07-23 23:04:02 +0000 nvme: Optimize timeout code further Optimize timeout code based on three observations. (1) The tr queues are sorted in order of submission, so the first one that could time out is the first "real" one on the list. (2) Timeouts for a given queue are all the same length (well, except at startup, where timeout doesn't matter, and when you change it at runtime, where timeouts will still happen eventually and the difference isn't worth optimizing for). (3) Calling the ISR races the real ISR and we should avoid that better. So now, after checking to see if the card is there and working, the timeout routine scans the pending tracker list until it finds a non-AER tracker. If the deadline hasn't passed, we return, doing nothing further. Otherwise, we call poll completions and then process the list looking for timed out items. This should move the timeout routine to touching hardware only when it's really necessary. It thus avoids racing the normal ISR, while still timig out stuck transactions quickly enough. There was also some minor code motion to make all of the above flow more nicely for the reader. When interrupts aren't working at all, then this will increase latency somewhat. But when interrupts aren't working at all, there's bigger problems and we should poll quite often in that case. That will be handled in future commits. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D46026 --- sys/dev/nvme/nvme_qpair.c | 138 ++++++++++++++++++++++++++++++---------------- 1 file changed, 90 insertions(+), 48 deletions(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index e4286b61a3fc..c917b34dbe43 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -1045,8 +1045,8 @@ nvme_qpair_timeout(void *arg) struct nvme_controller *ctrlr = qpair->ctrlr; struct nvme_tracker *tr; sbintime_t now; - bool idle = false; - bool needs_reset; + bool idle = true; + bool fast; uint32_t csts; uint8_t cfs; @@ -1092,23 +1092,69 @@ nvme_qpair_timeout(void *arg) */ csts = nvme_mmio_read_4(ctrlr, csts); cfs = NVMEV(NVME_CSTS_REG_CFS, csts); - if (csts == NVME_GONE || cfs == 1) - goto do_reset; + if (csts == NVME_GONE || cfs == 1) { + /* + * We've had a command timeout that we weren't able to + * abort or we have aborts disabled and any command + * timed out. + * + * If we get here due to a possible surprise hot-unplug + * event, then we let nvme_ctrlr_reset confirm and fail + * the controller. + */ +do_reset: + nvme_printf(ctrlr, "Resetting controller due to a timeout%s.\n", + (csts == 0xffffffff) ? " and possible hot unplug" : + (cfs ? " and fatal error status" : "")); + qpair->recovery_state = RECOVERY_WAITING; + nvme_ctrlr_reset(ctrlr); + idle = false; + break; + } + /* - * Process completions. We already have the recovery lock, so - * call the locked version. + * See if there's any recovery needed. First, do a fast check to + * see if anything could have timed out. If not, then skip + * everything else. + */ + fast = false; + mtx_lock(&qpair->lock); + now = getsbinuptime(); + TAILQ_FOREACH(tr, &qpair->outstanding_tr, tailq) { + /* + * Skip async commands, they are posted to the card for + * an indefinite amount of time and have no deadline. + */ + if (tr->deadline == SBT_MAX) + continue; + + /* + * If the first real transaction is not in timeout, then + * we're done. Otherwise, we try recovery. + */ + idle = false; + if (now <= tr->deadline) + fast = true; + break; + } + mtx_unlock(&qpair->lock); + if (idle || fast) + break; + + /* + * There's a stale transaction at the start of the queue whose + * deadline has passed. Poll the competions as a last-ditch + * effort in case an interrupt has been missed. */ _nvme_qpair_process_completions(qpair); /* - * Check to see if we need to timeout any commands. If we do, then - * we also enter a recovery phase. + * Now that we've run the ISR, re-rheck to see if there's any + * timed out commands and abort them or reset the card if so. */ - now = getsbinuptime(); - needs_reset = false; - idle = true; mtx_lock(&qpair->lock); + idle = true; TAILQ_FOREACH(tr, &qpair->outstanding_tr, tailq) { /* * Skip async commands, they are posted to the card for @@ -1116,48 +1162,44 @@ nvme_qpair_timeout(void *arg) */ if (tr->deadline == SBT_MAX) continue; - if (now > tr->deadline) { - if (tr->req->cb_fn != nvme_abort_complete && - ctrlr->enable_aborts) { - /* - * This isn't an abort command, ask - * for a hardware abort. - */ - nvme_ctrlr_cmd_abort(ctrlr, tr->cid, - qpair->id, nvme_abort_complete, tr); - } else { - /* - * Otherwise we have a live command in - * the card (either one we couldn't - * abort, or aborts weren't enabled). - * The only safe way to proceed is to do - * a reset. - */ - needs_reset = true; - } + + /* + * If we know this tracker hasn't timed out, we also + * know all subsequent ones haven't timed out. The tr + * queue is in submission order and all normal commands + * in a queue have the same timeout (or the timeout was + * changed by the user, but we eventually timeout then). + */ + idle = false; + if (now <= tr->deadline) + break; + + /* + * Timeout expired, abort it or reset controller. + */ + if (ctrlr->enable_aborts && + tr->req->cb_fn != nvme_abort_complete) { + /* + * This isn't an abort command, ask for a + * hardware abort. This goes to the admin + * queue which will reset the card if it + * times out. + */ + nvme_ctrlr_cmd_abort(ctrlr, tr->cid, qpair->id, + nvme_abort_complete, tr); } else { - idle = false; + /* + * We have a live command in the card (either + * one we couldn't abort, or aborts weren't + * enabled). We can only reset. + */ + mtx_unlock(&qpair->lock); + goto do_reset; } } mtx_unlock(&qpair->lock); - if (!needs_reset) - break; - - /* - * We've had a command timeout that we weren't able to abort - * - * If we get here due to a possible surprise hot-unplug event, - * then we let nvme_ctrlr_reset confirm and fail the - * controller. - */ - do_reset: - nvme_printf(ctrlr, "Resetting controller due to a timeout%s.\n", - (csts == 0xffffffff) ? " and possible hot unplug" : - (cfs ? " and fatal error status" : "")); - qpair->recovery_state = RECOVERY_WAITING; - nvme_ctrlr_reset(ctrlr); - idle = false; /* We want to keep polling */ break; + case RECOVERY_WAITING: /* * These messages aren't interesting while we're suspended. We From nobody Tue Jul 23 23:03:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTCPV3QKpz5R6ZN; Tue, 23 Jul 2024 23:03: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTCPV1zf0z4c32; Tue, 23 Jul 2024 23:03:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721775822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fpf7qdIjz8lMhXxk5kea1fEMR3E/dvvmfUr0OqjUvo8=; b=D4ycHmpRkyxJ6XMSfw5tOo1CX4X50YnHjYvSzmJ/cnfrYQzYcbODsIOjshfiFB9y3jw0je zi9avuW54tgkyP/MtDBcpSvISzUDIOFaErMxqPYoCOCwkUiNAvYQH/aoia7wPB1YejnJpt dDEpVi1Q341+/k9AgxB+8NRTEZuQ77+Mcn2t9q2qxu23B7bsCB2HxfecLrr8LQ52GMA4M8 DDnWDDhkvNkcMq/ZhYORf65cH2f4tU3d19SMW85vZzH3u1RPKxjVPkCUtcUBGsBAteGXcm i3aX1XkTr8UZ4qPw7/icuWRAg/jz1TdTpeN1HUaPR/Bhxgxta7Kfm75GPREj+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721775822; a=rsa-sha256; cv=none; b=Zo4tsZST8q0EAVDlxXvEtSo1O7MW7T86cCJkPeP4RJ8JceAkR7On+61CwMkZytT9R1ArfN /EIIfI0L+fAIBndL9XjdI3x3j32fcU7DWwbc0Nmopd33mrYyuKOdjqR7npNU08i3EZryH/ hp3PWJXF95OYi0Jc0Aybnc8BqqcxanbktXek4/kwxD9l/cyZu5mMr4OLWLHNAKvt5LtM5/ ql41IrPZNeBy0Pxe9Rn9Ap7elasmhOIlap+84qqLhigNqi/YOpllXYgrlV5BK0A9+/bEXS 2QOjIVErvz7JCwZaegEZaHXZ4FOeZhdon4Vv1tRhQ3mRdjW7CwulkuEkmJ5/0Q== 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=1721775822; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Fpf7qdIjz8lMhXxk5kea1fEMR3E/dvvmfUr0OqjUvo8=; b=wFVpVTZLea9pzCEIvyNhG365IAT3zXQ0O4MT2b1wT+4zJgO13D0uNLL2Dd7p8bYGPkUQ9Q gTgcJ/tqYG+eFXA/QsgpGpsdjmtgVZlYdqfIpgYMU/FT0ZgAkBYrTGsMPSfnEk1T2Cn05S XAaM2M1HVYqoeVUaNawtFikYk14UVYP2PRejlfiKq8oyPI5rARaeQgZtIvfbZyfSQstVMl F9VNDrb3PboXaWcvr+BACj6ANgyiaBivPqPFjzfyhDpeo3lNJXKTvmDNqxsDolPQus0/Dm 7EuU1sY8nxnRnl1ZV5kVxrZwrL8x1+k0LcvI0OhVBakINUjyRBwauLnmPRwUfw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTCPV1WBcznP8; Tue, 23 Jul 2024 23:03:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46NN3gDr008362; Tue, 23 Jul 2024 23:03:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46NN3gwY008359; Tue, 23 Jul 2024 23:03:42 GMT (envelope-from git) Date: Tue, 23 Jul 2024 23:03:42 GMT Message-Id: <202407232303.46NN3gwY008359@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: bb7f7d5b5201 - main - nvme: Warn if there's system interrupt issues. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bb7f7d5b5201cfe569fce79b0f325bec2cf38ad2 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=bb7f7d5b5201cfe569fce79b0f325bec2cf38ad2 commit bb7f7d5b5201cfe569fce79b0f325bec2cf38ad2 Author: Warner Losh AuthorDate: 2024-07-23 23:02:33 +0000 Commit: Warner Losh CommitDate: 2024-07-23 23:04:03 +0000 nvme: Warn if there's system interrupt issues. Issue a warning if we have system interrupt issues. If you get this warning, then we submitted a request, it timed out without an interrupt being posted, but when we polled the card's completion, we found completion events. This indicates that we're missing interrupts, and to date all the times I've helped people track issues like this down it has been a system issue, not an NVMe driver isseue. Sponsored by: Netflix Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D46031 --- share/man/man4/nvme.4 | 9 +++++++++ sys/dev/nvme/nvme_private.h | 1 + sys/dev/nvme/nvme_qpair.c | 9 +++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/share/man/man4/nvme.4 b/share/man/man4/nvme.4 index 011ff483c839..dcd2ec86f5fa 100644 --- a/share/man/man4/nvme.4 +++ b/share/man/man4/nvme.4 @@ -239,6 +239,15 @@ detects that the AHCI device supports RST and when it is enabled. See .Xr ahci 4 for more details. +.Sh DIAGNOSTICS +.Bl -diag +.It "nvme%d: System interrupt issues?" +The driver found a timed-out transaction had a pending completion record, +indicating an interrupt had not been delivered. +The system is either not configuring interrupts properly, or the system drops +them under load. +This message will appear at most once per boot per controller. +.El .Sh SEE ALSO .Xr nda 4 , .Xr nvd 4 , diff --git a/sys/dev/nvme/nvme_private.h b/sys/dev/nvme/nvme_private.h index ff08f6581db5..05b5f3189eb2 100644 --- a/sys/dev/nvme/nvme_private.h +++ b/sys/dev/nvme/nvme_private.h @@ -303,6 +303,7 @@ struct nvme_controller { bool is_failed; bool is_dying; + bool isr_warned; STAILQ_HEAD(, nvme_request) fail_req; /* Host Memory Buffer */ diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index c917b34dbe43..0c3a36d4d76f 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -1145,9 +1145,14 @@ do_reset: /* * There's a stale transaction at the start of the queue whose * deadline has passed. Poll the competions as a last-ditch - * effort in case an interrupt has been missed. + * effort in case an interrupt has been missed. Warn the user if + * transactions were found of possible interrupt issues, but + * just once per controller. */ - _nvme_qpair_process_completions(qpair); + if (_nvme_qpair_process_completions(qpair) && !ctrlr->isr_warned) { + nvme_printf(ctrlr, "System interrupt issues?\n"); + ctrlr->isr_warned = true; + } /* * Now that we've run the ISR, re-rheck to see if there's any From nobody Tue Jul 23 23:46:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTDMs2rSZz5RB48; Tue, 23 Jul 2024 23:47:21 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Received: from corp.infotel.ru (corp.infotel.ru [195.170.219.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4WTDMr1FpYz4hNP; Tue, 23 Jul 2024 23:47:20 +0000 (UTC) (envelope-from vladimir@kondratyev.su) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of vladimir@kondratyev.su has no SPF policy when checking 195.170.219.3) smtp.mailfrom=vladimir@kondratyev.su Received: from corp (corp.infotel.ru [195.170.219.3]) by corp.infotel.ru (Postfix) with ESMTP id 5B5E44EA113; Wed, 24 Jul 2024 02:47:12 +0300 (MSK) X-Virus-Scanned: amavisd-new at corp.infotel.ru Received: from corp.infotel.ru ([195.170.219.3]) by corp (corp.infotel.ru [195.170.219.3]) (amavisd-new, port 10024) with ESMTP id LCqpMAGwf5ZW; Wed, 24 Jul 2024 02:47:07 +0300 (MSK) Received: from mail.cicgroup.ru (unknown [195.170.219.74]) by corp.infotel.ru (Postfix) with ESMTP id 07F424E9CDC; Wed, 24 Jul 2024 02:47:07 +0300 (MSK) Received: from mail.cicgroup.ru (localhost [127.0.0.1]) by mail.cicgroup.ru (Postfix) with ESMTP id D711642211F; Wed, 24 Jul 2024 02:46:51 +0300 (MSK) Received: from mail.cicgroup.ru ([127.0.0.1]) by mail.cicgroup.ru (mail.cicgroup.ru [127.0.0.1]) (amavisd-new, port 10024) with SMTP id sHxgqrAW6Gw5; Wed, 24 Jul 2024 02:46:49 +0300 (MSK) Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail.cicgroup.ru (Postfix) with ESMTPA id E093742211C; Wed, 24 Jul 2024 02:46:48 +0300 (MSK) Message-ID: <75796855-cf79-4538-81c5-ae6f7765d2d3@kondratyev.su> Date: Wed, 24 Jul 2024 02:46:47 +0300 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: a1181662d370 - main - LinuxKPI: Add devm_device_add_group to linux/device.h To: "Bjoern A. Zeeb" Cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202407211314.46LDEoW4023107@gitrepo.freebsd.org> <0964qqop-qrsn-2rpq-1n4s-snr76ps12no9@SerrOFQ.bet> Content-Language: en-US From: Vladimir Kondratyev In-Reply-To: <0964qqop-qrsn-2rpq-1n4s-snr76ps12no9@SerrOFQ.bet> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: - X-Spamd-Result: default: False [-1.53 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.54)[-0.537]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; XM_UA_NO_VERSION(0.01)[]; ASN(0.00)[asn:8299, ipnet:195.170.192.0/19, country:RU]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MLMMJ_DEST(0.00)[dev-commits-src-all@FreeBSD.org,dev-commits-src-main@FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; DMARC_NA(0.00)[kondratyev.su]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[4] X-Rspamd-Queue-Id: 4WTDMr1FpYz4hNP On 22.07.2024 21:55, Bjoern A. Zeeb wrote: > On Sun, 21 Jul 2024, Vladimir Kondratyev wrote: >=20 >> The branch main has been updated by wulf: >> >> URL:=20 >> https://cgit.FreeBSD.org/src/commit/?id=3Da1181662d3707d8165d7153a0aa5= d76ea1ddc11a >> >> commit a1181662d3707d8165d7153a0aa5d76ea1ddc11a >> Author:=C2=A0=C2=A0=C2=A0=C2=A0 Vladimir Kondratyev >> AuthorDate: 2024-07-21 13:09:12 +0000 >> Commit:=C2=A0=C2=A0=C2=A0=C2=A0 Vladimir Kondratyev >> CommitDate: 2024-07-21 13:09:12 +0000 >> >> =C2=A0=C2=A0 LinuxKPI: Add devm_device_add_group to linux/device.h >> >> =C2=A0=C2=A0 devm_device_add_group creates a managed attribute group f= or a device. >> >> =C2=A0=C2=A0 Sponsored by:=C2=A0=C2=A0 Serenity Cyber Security, LLC >> =C2=A0=C2=A0 MFC after:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 1 week >> =C2=A0=C2=A0 Reviewed by:=C2=A0=C2=A0=C2=A0 manu >> =C2=A0=C2=A0 Differential Revision:=C2=A0 https://reviews.freebsd.org/= D45845 >> --- >> sys/compat/linuxkpi/common/include/linux/device.h |=C2=A0 4 +++ >> sys/compat/linuxkpi/common/src/linux_compat.c=C2=A0=C2=A0=C2=A0=C2=A0 = | 30 +++++++++++++++++++++++ >> 2 files changed, 34 insertions(+) >> >> diff --git a/sys/compat/linuxkpi/common/include/linux/device.h=20 >> b/sys/compat/linuxkpi/common/include/linux/device.h >> index 00c55b31b248..912be8fbae8b 100644 >> --- a/sys/compat/linuxkpi/common/include/linux/device.h >> +++ b/sys/compat/linuxkpi/common/include/linux/device.h >> @@ -701,4 +701,8 @@ int lkpi_devm_add_action_or_reset(struct device *d= ev, void=20 >> (*action)(void *), vo >> #define=C2=A0=C2=A0=C2=A0 devm_add_action_or_reset(dev, action, data)=C2= =A0=C2=A0=C2=A0 \ >> =C2=A0=C2=A0=C2=A0=C2=A0lkpi_devm_add_action_or_reset(dev, action, dat= a) >> >> +int lkpi_devm_device_add_group(struct device *dev, const struct=20 >> attribute_group *group); >> +#define=C2=A0=C2=A0=C2=A0 devm_device_add_group(dev, group)=C2=A0=C2=A0= =C2=A0 \ >> +=C2=A0=C2=A0=C2=A0 lkpi_devm_device_add_group(dev, group) >=20 > I thought we would use linuxkpi_ as prefix for publicly exposed LinuxKP= I > related functions and lkpi_ for "internal" FreeBSD specific code which > does not follow Linux KPI? >=20 And I thought that we use lkpi_ as HPS told me that once. And really if we take a look at sys/compat/linuxkpi/common/src % grep ^linux_ * | wc -l 247 % grep ^lkpi_ * | wc -l 228 % grep ^linuxkpi_ * | wc -l 99 lkpi_ is used twice more times. I would prefer to use lkpi_ as prefix for publicly exposed functions and = _lkpi_=20 or __lkpi_ for internal code as lkpi is four symbols shorter. > Can this be fixed before MFC? >=20 Yes if you insist on that. --=20 WBR Vladimir Kondratyev From nobody Wed Jul 24 10:15:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTVJN1DYKz5RgWS; Wed, 24 Jul 2024 10:15:16 +0000 (UTC) (envelope-from bz@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTVJN0hGPz4NR0; Wed, 24 Jul 2024 10:15:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721816116; 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=Gkb4aJMTRCZor2eiyxQ4mg96Xxni61lKe/O21sIP0o4=; b=evmbQk/o9UYKM+54ds06bWbGVXO80/Vy5bZtXx+kOZtVN3F8QUKMz3SbmsNqhGN6Kau1tY FuTQhynB3aMLUEU1CVyV+HxP4h+UDKqATeMgD25wF8Cfn+K+Sz32JHApHDdw/kB5lSosQP s1i2TkjIYIpcAPL1VvwkakhBzvcY27tUbJK3dMbNR6wGDkcLjLLg7kLvvAwehj0KM3/AnO JVKi6Kr50iHzDy0E6FnjUBBrGk85QIBGf0OGhN1bqURE274gxmFIqeBHoxLMdjiCv8TX45 fNL5wR/P6mTSmjsn7O7mRHSyIwb+jqbxNofRNXPmXxu3SAoXFd+TSrhrg+WtgQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721816116; a=rsa-sha256; cv=none; b=mFNI89kZef3GJ0MUS7OOBh0h8FLrtUIvrYWTzdUVHu98jcbqTxPBQjrBk0v+t8l5yOak/t aIETag5yAkJ8EE2c8VBvHJo6ZD6ImiNQ/KXsQmP7eb3sE3w14KPm/OOzD5O9RTE2ouXX/y 3MwLIVLA9qspgMgtEYw2XqoMOrHlwvDdtYjNRN0GpuRkW/QJCT7oMNYmnpeCoIH0ZTC1NZ hxBsYHSDuW7EiVFwqPArLSe0mqQOmRqDWSWzrgGC/ZRuWhlSWP0BpAT3glgZzH1cMEmGmj 0NK3BObhXqzklbKXTNC+kBoYLZYhPMtAPFpqIM59C8h9fL8k/eFw5MPtukaA/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=1721816116; 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=Gkb4aJMTRCZor2eiyxQ4mg96Xxni61lKe/O21sIP0o4=; b=ym2r8EyYNUj/4828Nzkl7SNffzUAzzPzoIOTCOsnJdpmrfx3nPFfDs4EZ2A9jxOuMZuVee zM5pcK3awh60lmMoT+HeB7+Vet9vh1Gkxbp2kLkCN+MP9Q7kSw9Vev6+q3np3mFD18H7nW cmA0iGxsgWxBmBw/J+rNR0vd2+h4jFog73NMApQltlitQvLVLKsqg/pL4IP83Py9N/AZwM 7GQNUdTffYrC9KsTysFbHes1oGUjIcJz1BkdtTgT0oriC3Dh8sGo6s5QtsS2ZMIuReFL0l W/r9ouS7fnGvbPvMlUqFXyciNjK8CXg+9BfNX3Jjcgk0GUJWnq9XD3DsCoU60w== 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 (P-256) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WTVJM6JqBzXjg; Wed, 24 Jul 2024 10:15:15 +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 03DD0A64806; Wed, 24 Jul 2024 10:15:10 +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 E30FB2D029D8; Wed, 24 Jul 2024 10:15:11 +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 oGSF2wdKOuGG; Wed, 24 Jul 2024 10:15:11 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:b66b:fcff:fef3:e3d2]) (using 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 CE6D82D029D2; Wed, 24 Jul 2024 10:15:10 +0000 (UTC) Date: Wed, 24 Jul 2024 10:15:09 +0000 (UTC) From: "Bjoern A. Zeeb" To: Vladimir Kondratyev cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: a1181662d370 - main - LinuxKPI: Add devm_device_add_group to linux/device.h In-Reply-To: <75796855-cf79-4538-81c5-ae6f7765d2d3@kondratyev.su> Message-ID: References: <202407211314.46LDEoW4023107@gitrepo.freebsd.org> <0964qqop-qrsn-2rpq-1n4s-snr76ps12no9@SerrOFQ.bet> <75796855-cf79-4538-81c5-ae6f7765d2d3@kondratyev.su> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed On Wed, 24 Jul 2024, Vladimir Kondratyev wrote: Hi, I think what we really need it to write it down once and for all and the 4-5 people working on it agree to it and put it into the tree as a document so it is clear. Hence a small malinging list and other bits to coordinate would be helpful. I know I documented the last state I had been told at the top of linux_80211.c but I do see that for other (public) bits I was asked to use lkpi_ as well in the past and not just linuxkpi_ and both of us had started using linux_* still for our early commits (which I never liked as it collides with linuxolator). >> Can this be fixed before MFC? >> > > Yes if you insist on that. No, I don't anymore I think. But I would really hope we could cleanup all of them and document the one way then. I had once proposed a README for sys/compat/linuxkpi but it found little response back then. I'll dig it up and restart the thread with the current set of people. /bz -- Bjoern A. Zeeb r15:7 From nobody Wed Jul 24 10:19:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTVPP0wGcz5RgrK; Wed, 24 Jul 2024 10:19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTVPN5cbvz4P1G; Wed, 24 Jul 2024 10:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721816376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Okyk/lTPzrT4hlgRLhTuQi7Tg7QqAyIkn/6rxJ6dU4=; b=QaGOtMsqAwCqv/iXMKJTE6v46KQI4vOiNqMxj4KlIx7xSXt1JxwuR8aUcCibXmiGbl2G/u QJRHeGC8+TT/22NUw1aogdsAVTHB92sjLI7G6NkTy/XE5DFOa1dI85jyDrQQG5GO+UUxXk wqFpTA6sZWVbNw+20bq7Iqdw0EmJOcIa62BBtLdqxHXTBL19DNfVte7IWqw6DjYYSZzBeO o2nYtosZHqcUCxE9fVJpvaSrrw7eEhPdd8PHNPijM/n6sVbG+kjOsuwM274+A1LprNCzTn LiNtNqz2i9Va9TDYgc5zImK8XmLORUMTNAsYsgjdZxKlx7kHKguu4KUd3wGu3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721816376; a=rsa-sha256; cv=none; b=QXQx6sLt6Dnzu8X8c95xo5r8CaXSwspKuO9G9Ry7bdeeDnjqxNE6tHupTTuGtFvzgUkCNA kTdpt3EkY/HhLmsnTCcsv5mi1NHCNCyNpRIIyGidgJWyffwqYUubf/1yO6qyAzesFZ9Upt W5xAMsEOdA5e8NHRD1CpXGeswkZgIlNCaJ9Ulqbmjl6aPJlFoNcAdgffsJO+xd4gnE2x9R lUMhxUUaWcO5a+DwxD0FjZAcrF4JtWKUmijhGJqyemxiYSgNiq6+j/2xF3eHtdQZJYKHSS WaY+Jlbyg1JSppuF7lI22RKGoFF2akau45yHCuHDx6BT8/60bwsbynoOM5caiQ== 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=1721816376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/Okyk/lTPzrT4hlgRLhTuQi7Tg7QqAyIkn/6rxJ6dU4=; b=vdKuHD+EOT/pSSPfoV8/RQip/NtIcgP1P6B1VX4apbz+5TDk/9h40eVkecgzLpfafd6vr2 fs1aBgsjUBZ00IylZm1NOU47GIfiFQLow5rflqqJv72xO1h0KoudqjnnBWArJ+3sG1yYzJ AemsJHrAR9Txnv3Av9mnNW6J+bb2CP+SpPCH3DJ3U/lHvPdR8zhXc8t+IzIRQZCO24ABzk 1mtCSmGp847X9pHfHO1iMFgqXIribENPogZbYDChhRN3MtqTKKTVCDfbYR1B5tR1b7vlm6 mVLrn1PffXLJizP3lfS2OcGAg+BM6gUbRYH3ToxeClikdyQiddr9sFJKxbpmLQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTVPN4pvLz16db; Wed, 24 Jul 2024 10:19:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46OAJar4043035; Wed, 24 Jul 2024 10:19:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46OAJarI043032; Wed, 24 Jul 2024 10:19:36 GMT (envelope-from git) Date: Wed, 24 Jul 2024 10:19:36 GMT Message-Id: <202407241019.46OAJarI043032@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9e6544dd6e02 - main - malloc(9): extend contigmalloc(9) by a "slab cookie" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9e6544dd6e02c46b805d11ab925c4f3b18ad7a4b Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9e6544dd6e02c46b805d11ab925c4f3b18ad7a4b commit 9e6544dd6e02c46b805d11ab925c4f3b18ad7a4b Author: Bjoern A. Zeeb AuthorDate: 2024-06-30 19:00:44 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-07-24 10:17:31 +0000 malloc(9): extend contigmalloc(9) by a "slab cookie" Extend kern_malloc.c internals to also cover contigmalloc(9) by a "slab cookie" and not just malloc/malloc_large. This allows us to call free(9) even on contigmalloc(9) addresses and deprecate contigfree(9). Update the contigmalloc(9) man page accordingly. The way this is done (free(9) working for contigmalloc) will hide the UMA/VM bits from a consumer which may otherwise need to know whether the original allocation was by malloc or contigmalloc by looking at the cookie (likely via an accessor function). This simplifies the implementation of consumers of mixed environments a lot. This is preliminary work to allow LinuxKPI to be adjusted to better play by the rules Linux puts out for various allocations. Most of this was described/explained to me by jhb. One may observe that realloc(9) is currently unchanged (and contrary to [contig]malloc/[contig]free an implementation may need access the "slab cookie" information given it will likely be implementation dependent which allocation type to use if size changes beyond the usable size of the initial allocation). Described by: jhb Sponsored by: The FreeBSD Foundation MFC after: 10 days Reviewed by: markj, kib Differential Revision: https://reviews.freebsd.org/D45812 --- share/man/man9/contigmalloc.9 | 9 ++- sys/kern/kern_malloc.c | 128 +++++++++++++++++++++++++++++++++--------- 2 files changed, 108 insertions(+), 29 deletions(-) diff --git a/share/man/man9/contigmalloc.9 b/share/man/man9/contigmalloc.9 index f52cb7bde0ed..9e7086885870 100644 --- a/share/man/man9/contigmalloc.9 +++ b/share/man/man9/contigmalloc.9 @@ -23,7 +23,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 30, 2018 +.Dd July 22, 2024 .Dt CONTIGMALLOC 9 .Os .Sh NAME @@ -113,6 +113,13 @@ function deallocates memory allocated by a previous call to .Fn contigmalloc or .Fn contigmalloc_domainset . +Its use is deprecated in favor of +.Xr free 9 +which no longer requires the caller to know the +.Fa size +and also accepts +.Dv NULL +as an address. .Sh IMPLEMENTATION NOTES The .Fn contigmalloc diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 20c406a6abf5..457d5e1eb3f7 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -116,6 +116,16 @@ dtrace_malloc_probe_func_t __read_mostly dtrace_malloc_probe; #define DEBUG_REDZONE_ARG #endif +typedef enum { + SLAB_COOKIE_SLAB_PTR = 0x0, + SLAB_COOKIE_MALLOC_LARGE = 0x1, + SLAB_COOKIE_CONTIG_MALLOC = 0x2, +} slab_cookie_t; +#define SLAB_COOKIE_MASK 0x3 +#define SLAB_COOKIE_SHIFT 2 +#define GET_SLAB_COOKIE(_slab) \ + ((slab_cookie_t)(uintptr_t)(_slab) & SLAB_COOKIE_MASK) + /* * When realloc() is called, if the new size is sufficiently smaller than * the old size, realloc() will allocate a new, smaller block to avoid @@ -451,6 +461,21 @@ malloc_type_freed(struct malloc_type *mtp, unsigned long size) * If M_NOWAIT is set, this routine will not block and return NULL if * the allocation fails. */ +#define IS_CONTIG_MALLOC(_slab) \ + (GET_SLAB_COOKIE(_slab) == SLAB_COOKIE_CONTIG_MALLOC) +#define CONTIG_MALLOC_SLAB(_size) \ + ((void *)(((_size) << SLAB_COOKIE_SHIFT) | SLAB_COOKIE_CONTIG_MALLOC)) +static inline size_t +contigmalloc_size(uma_slab_t slab) +{ + uintptr_t va; + + KASSERT(IS_CONTIG_MALLOC(slab), + ("%s: called on non-contigmalloc allocation: %p", __func__, slab)); + va = (uintptr_t)slab; + return (va >> SLAB_COOKIE_SHIFT); +} + void * contigmalloc(unsigned long size, struct malloc_type *type, int flags, vm_paddr_t low, vm_paddr_t high, unsigned long alignment, @@ -460,8 +485,11 @@ contigmalloc(unsigned long size, struct malloc_type *type, int flags, ret = (void *)kmem_alloc_contig(size, flags, low, high, alignment, boundary, VM_MEMATTR_DEFAULT); - if (ret != NULL) + if (ret != NULL) { + /* Use low bits unused for slab pointers. */ + vsetzoneslab((uintptr_t)ret, NULL, CONTIG_MALLOC_SLAB(size)); malloc_type_allocated(type, round_page(size)); + } return (ret); } @@ -474,25 +502,28 @@ contigmalloc_domainset(unsigned long size, struct malloc_type *type, ret = (void *)kmem_alloc_contig_domainset(ds, size, flags, low, high, alignment, boundary, VM_MEMATTR_DEFAULT); - if (ret != NULL) + if (ret != NULL) { + /* Use low bits unused for slab pointers. */ + vsetzoneslab((uintptr_t)ret, NULL, CONTIG_MALLOC_SLAB(size)); malloc_type_allocated(type, round_page(size)); + } return (ret); } /* - * contigfree: + * contigfree (deprecated). * * Free a block of memory allocated by contigmalloc. * * This routine may not block. */ void -contigfree(void *addr, unsigned long size, struct malloc_type *type) +contigfree(void *addr, unsigned long size __unused, struct malloc_type *type) { - - kmem_free(addr, size); - malloc_type_freed(type, round_page(size)); + free(addr, type); } +#undef IS_CONTIG_MALLOC +#undef CONTIG_MALLOC_SLAB #ifdef MALLOC_DEBUG static int @@ -562,22 +593,19 @@ malloc_dbg(caddr_t *vap, size_t *sizep, struct malloc_type *mtp, /* * Handle large allocations and frees by using kmem_malloc directly. */ -static inline bool -malloc_large_slab(uma_slab_t slab) -{ - uintptr_t va; - - va = (uintptr_t)slab; - return ((va & 1) != 0); -} - +#define IS_MALLOC_LARGE(_slab) \ + (GET_SLAB_COOKIE(_slab) == SLAB_COOKIE_MALLOC_LARGE) +#define MALLOC_LARGE_SLAB(_size) \ + ((void *)(((_size) << SLAB_COOKIE_SHIFT) | SLAB_COOKIE_MALLOC_LARGE)) static inline size_t malloc_large_size(uma_slab_t slab) { uintptr_t va; va = (uintptr_t)slab; - return (va >> 1); + KASSERT(IS_MALLOC_LARGE(slab), + ("%s: called on non-malloc_large allocation: %p", __func__, slab)); + return (va >> SLAB_COOKIE_SHIFT); } static caddr_t __noinline @@ -589,8 +617,8 @@ malloc_large(size_t size, struct malloc_type *mtp, struct domainset *policy, size = roundup(size, PAGE_SIZE); va = kmem_malloc_domainset(policy, size, flags); if (va != NULL) { - /* The low bit is unused for slab pointers. */ - vsetzoneslab((uintptr_t)va, NULL, (void *)((size << 1) | 1)); + /* Use low bits unused for slab pointers. */ + vsetzoneslab((uintptr_t)va, NULL, MALLOC_LARGE_SLAB(size)); uma_total_inc(size); } malloc_type_allocated(mtp, va == NULL ? 0 : size); @@ -613,6 +641,8 @@ free_large(void *addr, size_t size) kmem_free(addr, size); uma_total_dec(size); } +#undef IS_MALLOC_LARGE +#undef MALLOC_LARGE_SLAB /* * malloc: @@ -914,18 +944,30 @@ free(void *addr, struct malloc_type *mtp) vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab); if (slab == NULL) - panic("free: address %p(%p) has not been allocated.\n", + panic("free: address %p(%p) has not been allocated", addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); - if (__predict_true(!malloc_large_slab(slab))) { + switch (GET_SLAB_COOKIE(slab)) { + case __predict_true(SLAB_COOKIE_SLAB_PTR): size = zone->uz_size; #if defined(INVARIANTS) && !defined(KASAN) free_save_type(addr, mtp, size); #endif uma_zfree_arg(zone, addr, slab); - } else { + break; + case SLAB_COOKIE_MALLOC_LARGE: size = malloc_large_size(slab); free_large(addr, size); + break; + case SLAB_COOKIE_CONTIG_MALLOC: + size = contigmalloc_size(slab); + kmem_free(addr, size); + size = round_page(size); + break; + default: + panic("%s: addr %p slab %p with unknown cookie %d", __func__, + addr, slab, GET_SLAB_COOKIE(slab)); + /* NOTREACHED */ } malloc_type_freed(mtp, size); } @@ -957,7 +999,8 @@ zfree(void *addr, struct malloc_type *mtp) panic("free: address %p(%p) has not been allocated.\n", addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); - if (__predict_true(!malloc_large_slab(slab))) { + switch (GET_SLAB_COOKIE(slab)) { + case __predict_true(SLAB_COOKIE_SLAB_PTR): size = zone->uz_size; #if defined(INVARIANTS) && !defined(KASAN) free_save_type(addr, mtp, size); @@ -965,11 +1008,22 @@ zfree(void *addr, struct malloc_type *mtp) kasan_mark(addr, size, size, 0); explicit_bzero(addr, size); uma_zfree_arg(zone, addr, slab); - } else { + break; + case SLAB_COOKIE_MALLOC_LARGE: size = malloc_large_size(slab); kasan_mark(addr, size, size, 0); explicit_bzero(addr, size); free_large(addr, size); + break; + case SLAB_COOKIE_CONTIG_MALLOC: + size = round_page(contigmalloc_size(slab)); + explicit_bzero(addr, size); + kmem_free(addr, size); + break; + default: + panic("%s: addr %p slab %p with unknown cookie %d", __func__, + addr, slab, GET_SLAB_COOKIE(slab)); + /* NOTREACHED */ } malloc_type_freed(mtp, size); } @@ -1016,10 +1070,20 @@ realloc(void *addr, size_t size, struct malloc_type *mtp, int flags) ("realloc: address %p out of range", (void *)addr)); /* Get the size of the original block */ - if (!malloc_large_slab(slab)) + switch (GET_SLAB_COOKIE(slab)) { + case __predict_true(SLAB_COOKIE_SLAB_PTR): alloc = zone->uz_size; - else + break; + case SLAB_COOKIE_MALLOC_LARGE: alloc = malloc_large_size(slab); + break; + default: +#ifdef INVARIANTS + panic("%s: called for addr %p of unsupported allocation type; " + "slab %p cookie %d", __func__, addr, slab, GET_SLAB_COOKIE(slab)); +#endif + return (NULL); + } /* Reuse the original block if appropriate */ if (size <= alloc && @@ -1101,10 +1165,18 @@ malloc_usable_size(const void *addr) panic("malloc_usable_size: address %p(%p) is not allocated.\n", addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); - if (!malloc_large_slab(slab)) + switch (GET_SLAB_COOKIE(slab)) { + case __predict_true(SLAB_COOKIE_SLAB_PTR): size = zone->uz_size; - else + break; + case SLAB_COOKIE_MALLOC_LARGE: size = malloc_large_size(slab); + break; + default: + __assert_unreachable(); + size = 0; + break; + } #endif /* From nobody Wed Jul 24 10:20:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTVQH30mzz5RgpK; Wed, 24 Jul 2024 10:20: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTVQH2MDRz4PR5; Wed, 24 Jul 2024 10:20:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721816423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pqQoekktodaIcygk4lFMgAAXgMPSVCHveLR1uYtNjdk=; b=ZkjR0S9hVeapcH2BARKEFe0JNQ6WKCYB0TmF+XuHq1gxwWYsD+MgNMmoG0QNVx4+Qa0Msf lPeGE90h+q1IWoos9OnfWZ3WPozok7XGgTEiDeDpp0JYOcpuItzop3zN9UR39rVvp242k1 3uXQYTscNWw/B53fwbueYWjMJ6obprAw/NAI/e7vZXrMEZvAAk7KjmksN74j56PXq9ByLW pBbAGleaZZ7ivP+WCgcZDEgRD1PgGiDZBvRGMjwXZuiuNsJURYJb216kSg0vAoGjC3FN+K wE04aR5VTcbo+DMkOYHdUIxhpx+saOACk0tq/NgTA0sB7RF9mlY1W95BdNC2pw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721816423; a=rsa-sha256; cv=none; b=x+sVpen/zZI5LNoqflZuWZPFh/t/jsLdhzQAfJCn+gWvsIehjvLMLRqvyTCw+Iaa+6WpcE nARL7EPsLpcPLJS5hT2n7UQ5TrcQBY0PASGVUrJ0FhHWIHrFKy/K14w7df+zv5FP4EnWtS TpcTh3dNzRgf6VEsNSNpeHv2ghouEvXzee3QLG88vHW/H7M96rHgZrAiiGGfGdx1J4nH6o /mzZQw0yiXZGfUrSeMi0Ai105wYgVkeDBGmUY3J077Q2Ilb1pOjps8xuHQ1GqgaLLBOT8X gP+m2ohbnHqvFVzDnezP2QGbcGq4Oid1jNUA/oPHPFJxAegm5Y4KNLQMjYcUUw== 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=1721816423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pqQoekktodaIcygk4lFMgAAXgMPSVCHveLR1uYtNjdk=; b=c2TaQgonKiPTBqjUCI5Uu6d4SW9eudA0JPvfXJzgO3ZgIzaqCn7KflO71nPxx7f6SpwFyF XDgrKJ6E5XjuuQWsr1xNvxh1KU5zqFVisCq7h2XkOB3F7PyGwFLDEUs08oA0/Cor9SZyrH YWhICBewDBXE8VmVwCGOgpsdaei1OJBNDFZH5NL5lIK3yvXvQlBFSL/GWrLPHry6N4RmSA 5WwKEsR8feRiZF8411OzizXD99sfZydQ1tnL/kgjsebqywtUo8gX/HF9jDJMDS5hR6SNUW XV2gWcXqm3aRb6HZqZGyzgDgGCEJnRYjMriM3eqAnqAOwE0cSpAy15WjnhaMSA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTVQH1tbbz176F; Wed, 24 Jul 2024 10:20:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46OAKNpV051844; Wed, 24 Jul 2024 10:20:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46OAKNpe051841; Wed, 24 Jul 2024 10:20:23 GMT (envelope-from git) Date: Wed, 24 Jul 2024 10:20:23 GMT Message-Id: <202407241020.46OAKNpe051841@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c0df224ba5b1 - main - kern_malloc: remove '.' and '\n' from KASSERT/panic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c0df224ba5b1fe6257dd197f8298bf59fb6e520f Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c0df224ba5b1fe6257dd197f8298bf59fb6e520f commit c0df224ba5b1fe6257dd197f8298bf59fb6e520f Author: Bjoern A. Zeeb AuthorDate: 2024-07-23 18:27:46 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-07-24 10:19:49 +0000 kern_malloc: remove '.' and '\n' from KASSERT/panic KASSERT and panic calls should not have a '.' at the end of the message and do not need '\n'. Remove these. No functional changes. Reported by: markj (during review of D45812) Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: markj, kib Differential Revision: https://reviews.freebsd.org/D46093 --- sys/kern/kern_malloc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 457d5e1eb3f7..b9460515bc14 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -713,7 +713,7 @@ malloc_domain(size_t *sizep, int *indxp, struct malloc_type *mtp, int domain, size = *sizep; KASSERT(size <= kmem_zmax && (flags & M_EXEC) == 0, - ("malloc_domain: Called with bad flag / size combination.")); + ("malloc_domain: Called with bad flag / size combination")); if (size & KMEM_ZMASK) size = (size & ~KMEM_ZMASK) + KMEM_ZBASE; indx = kmemsize[size >> KMEM_ZSHIFT]; @@ -996,7 +996,7 @@ zfree(void *addr, struct malloc_type *mtp) vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab); if (slab == NULL) - panic("free: address %p(%p) has not been allocated.\n", + panic("free: address %p(%p) has not been allocated", addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); switch (GET_SLAB_COOKIE(slab)) { @@ -1162,7 +1162,7 @@ malloc_usable_size(const void *addr) #else vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab); if (slab == NULL) - panic("malloc_usable_size: address %p(%p) is not allocated.\n", + panic("malloc_usable_size: address %p(%p) is not allocated", addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); switch (GET_SLAB_COOKIE(slab)) { From nobody Wed Jul 24 11:32:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTX223g2xz5RnN9; Wed, 24 Jul 2024 11:32: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTX2235p8z4YdS; Wed, 24 Jul 2024 11:32:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721820778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bYDw2oEHtmXr2mioOLbApmrpHTLDrpG3OQc3m4b0ryc=; b=kccal4+XoiNascFqoY9gba9VnJI1mj+178CQQJWv45K1eddve4hhbOOo/eISBWfqDRYsPm YiN4L4ZMRFPJOMBOHLjP5zay9Mf1HTnVvDVepyo1VHO2vQQT4ERrg++IuqCZIxZLpggMeM ZhbEqjF0L8Pq89kRdsjVrVfgTaPhhlkjZ1591Ka1TTlVbOx7Tp7y/sJ8FjuO96UbHTXl5W lON3FXaRnywLWd1PSszENNNM+mh54v/syeCfkIPmq5XWV+whyc/cFVqDfP7d7Vqc17HLGi Owt/OCm3dSIa0MWGkTgax/rn7nH2PNaAdolkpsCKGLygrZVc+9KbX2CKrENzoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721820778; a=rsa-sha256; cv=none; b=dCGpTFA6LnHgG74fbw8hiJX/pcwTkt0WoO5Fvou/p/3E5BsRrg7yaBDCgsoGZ/R1L4ROZH UMSB/lYcviDVH/zmmD6X9Fg+8P5l0iMCof7Ym2KAEOm+z8VrLe/DENH0TSoSnsPPFQWis4 4Y7FoqEiziAJG2sIucNL30lyQctAq08J1vS63ZJPTsTjeKe+IRUT9Yc8/utNg6joIaSTcK klYrvRv8UpgvmYEvl7o+RUN6qV72aCNoo2w2LZQLO9rDXG6YBjINeoTG0wxv62LT0Kanvk Iq8V6sdUhVDJ6l99QHU2hx5hiFVood20Z/azxGhTsId9rzuR5FSPiolHQoDU4w== 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=1721820778; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bYDw2oEHtmXr2mioOLbApmrpHTLDrpG3OQc3m4b0ryc=; b=wnEzF+QlVq5JjBZpzt1mNuebRS2pHDjFJV3VyIC3i81l/5TlRn0wqR49blKQr5VSZvC+YU EdvuVlubpECauWQ80MuS7nlF9fsVlCUY5l836Ayzupm9S5iCGAiGP7PZOCkdhFDwPYbFai nqnxu5HEpkI7B9fpmzxriiPve3xxSgFJH6R3JuqTxdZNspVpq9Y+9lJ9TfKtaUkg64KTW3 Z8zTJW9MjDnZVvzekK6/IHoe0LFhd77BmzglQbgFzCTQ8jabecAYs6t7V9yZP+959zmWTZ KuNzKUsLUqkkvm3htJ+/ZxfMJ8Pv9r1s37VTcN22THUZYSkIlHOnlw85R/BXVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTX222c5Cz18q9; Wed, 24 Jul 2024 11:32:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46OBWwlh076616; Wed, 24 Jul 2024 11:32:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46OBWwQa076613; Wed, 24 Jul 2024 11:32:58 GMT (envelope-from git) Date: Wed, 24 Jul 2024 11:32:58 GMT Message-Id: <202407241132.46OBWwQa076613@gitrepo.freebsd.org> 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=B8rgrav?= Subject: git: 124ae0e8af8f - main - tarfs: Fix typo. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 124ae0e8af8fbc8384a660583f47f112f392395e Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=124ae0e8af8fbc8384a660583f47f112f392395e commit 124ae0e8af8fbc8384a660583f47f112f392395e Author: Trond Endrestøl AuthorDate: 2024-07-24 11:30:32 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-07-24 11:32:43 +0000 tarfs: Fix typo. MFC after: 3 days PR: 280354 --- share/man/man4/tarfs.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/tarfs.4 b/share/man/man4/tarfs.4 index 50cd287b3302..1a2944de9063 100644 --- a/share/man/man4/tarfs.4 +++ b/share/man/man4/tarfs.4 @@ -72,7 +72,7 @@ When using to create the tar file, this can be achieved using the .Cm zstd:max-frame-size and -.Cm ztsd:frame-per-file +.Cm zstd:frame-per-file options. Sensible frame sizes are powers of 2 between the system's base page size (see From nobody Wed Jul 24 17:00:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTgJB24GXz5SGhD; Wed, 24 Jul 2024 17:00: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTgJB0L77z4C3n; Wed, 24 Jul 2024 17:00:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721840442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ILXHNVeO+K2M4i3SYPA76WoPRXpp6p/kgc8Kjt+9xGA=; b=TgXFOvgNZcrogjRf76Rz6eyfEUKh9GJn+6A5+Km3PMWHYrml4WjTKI67UpUOWVQXMW2RIr 1oznjpGogW+NJ2M8UfkSJslvamHM5WB3HwhU4uq+hNk/18CyjPz9QNcnVuoBdlCqVfqvFv jy0sr+R8NJkib9EZA67aNaAzXsHeBcTSutSw4nwGXGSgu9JQiz0+4sSByHSIhOIAXjLZko Q0EtOIhae+O0zpSEkolvUm8RTLEvIK+jUJbrGy8d8ySNR8cbgGaNyLq0QudrqcK2F3vnFv IyFKxBWth4bQeViepyvJ1jIw47CnolcLhl5fvmg2y8dpIcuNTude8RTUC0zNQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721840442; a=rsa-sha256; cv=none; b=YVFOslGjSi/NgCK8OG+PWDyVypZ8cztrwuWQ5Zvf2bSsS6F8N8Q+K7rY7T+Im3aurcOUXX 1Ee1cHXySf9E/ngePs+iwJwIXK+pGo2OL2ccZd5NINlbY4GwR9zro0TeKccx+s4J0kKPtz xKqEB2MjmMbmwUFQYy/pc/EUkwnyScSoeKTy9nKzIATCSkK4wF61/D5nXzeGzsFA/yQPjH XG5+K4MOuQbprQM13Sr5uDzkap85QEE6uLROUl+ZIqPjGSWzWm6KqtArmQfSZwzepi+iVw kiDmreU4G3/iw+ecU0Ok7ruTyzEPynAuX4qSvmbfaaS10ovgDi14fc9zvb371g== 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=1721840442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ILXHNVeO+K2M4i3SYPA76WoPRXpp6p/kgc8Kjt+9xGA=; b=gN4tKQrcS8b5lEam86C5eFcVM42vU5jyASYq+TJLXbYnhwPpIsv9og5j+F+Z8tBifHT8pm zM65X+4QMdXsedOpsg+L9qdy0Bh4V/kcu+OJ7/q7yEFrOm6HmMnZcXb9yfIqrTs/17YGdn QCbcLvTqqhXENzTMYtPdSXNFGDkIF1RCBXVRfwcBlAkrT2uUZReBOVIPCw53Hx1JBjyYZ0 JoQayQHmrUsAKjLghw4KpcikcvgHZhNmwEF8McT3vD9P2eErJn2psI+fLF3H+Vnu5K50jr VSGlil7LSgF25d+nI9s3ujeb5fa036K34IzMycySP/FPNi+vdGw6kghdfApGBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTgJ973Y0zJrH; Wed, 24 Jul 2024 17:00:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46OH0ftE032266; Wed, 24 Jul 2024 17:00:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46OH0fC3032263; Wed, 24 Jul 2024 17:00:41 GMT (envelope-from git) Date: Wed, 24 Jul 2024 17:00:41 GMT Message-Id: <202407241700.46OH0fC3032263@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: 8880825df1f8 - main - wpa: Fix gcc build List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8880825df1f805fc02dbb8476df8183d4ec3781c Auto-Submitted: auto-generated The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=8880825df1f805fc02dbb8476df8183d4ec3781c commit 8880825df1f805fc02dbb8476df8183d4ec3781c Author: Cy Schubert AuthorDate: 2024-07-24 15:04:33 +0000 Commit: Cy Schubert CommitDate: 2024-07-24 15:04:33 +0000 wpa: Fix gcc build Order of libraries still matters with GCC toolchains. Moving the wpapasn library before the wpacommon specification resolves the link problem. This issue was not detected by make universe. Fixes: a90b9d015907 MFC after: 2 months X-MFC with: a90b9d015907 --- usr.sbin/wpa/wpa_supplicant/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile b/usr.sbin/wpa/wpa_supplicant/Makefile index ba7f1fb873ab..ab69009e5e43 100644 --- a/usr.sbin/wpa/wpa_supplicant/Makefile +++ b/usr.sbin/wpa/wpa_supplicant/Makefile @@ -51,7 +51,7 @@ CFLAGS+=-DCONFIG_BACKEND_FILE LIBADD+=pcap util wpadrivers wpaeapol_supp \ wpaeap_server \ wpaeap_peer wpaeap_common wpal2_packet wparsn_supp wpatls wpawps \ - wpacommon wpacrypto wpautils wpapasn + wpapasn wpacommon wpacrypto wpautils # User customizations to the wpa_supplicant build environment CFLAGS+=${WPA_SUPPLICANT_CFLAGS} From nobody Wed Jul 24 19:32:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTkgD70mdz5QJ3M; Wed, 24 Jul 2024 19:32: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTkgD6W4sz4T9r; Wed, 24 Jul 2024 19:32:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721849544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EhBlRMwpWv1YUOm+ByWZLmW/awKXWeCGuxaNh4P299E=; b=bXcEDRWx2JLja8lbRcyi8XxZ5ECzrDQkqERSXnQFlrMQ9UKQDbyYzPlze9nw4vmOzIO1zb TS5dP/DNYecbBinVxjVDAy3vABptdw0UvgLi0FHJKL2NGIpb5uNKgiwoTppl9EOzSDipV3 8IUyj3D3mcWLjbhzrRRjR4TpI5snYQMOijUBaea5fwDbIVGkSdkvNdS65JalzMNMHrYJho 9mYWAu9wdrp4uV3W9Gjwp/TdB4LqjIc9OgaMHDnsK23tHaFOAR6r97BRFIng7DWv8/61aR uYPTzPVZdFR/WnQHfBEiWxDga1DmIpU0RqJcrisbg2lKn3MZR+/L1UQD7QppEw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721849544; a=rsa-sha256; cv=none; b=bmotuYNnpr96KnS7qX3MULAU+R7/ZCs/vBZTjiE94ACmFjy+wmbGPo2CEgHNMbfDB5LA7X KeCnYp+AtRDQtCE4M8loirBIxiY3Z4FweZbK6FTUzTq65OSz1aJYRVIKy9MpLewlY3cOXZ 7w5TxZs6mGH0f7Qi8WiLDTp3GJu4ITXb45Lrdm/slLkarW2OTNIn7EdTqxpCbrPERMTmR4 FSxhDZdqvC924a4HiS5Nv/FH816XYkD3SvzpIz0d/yPK6RwnHZwqfPzSeRKMFsHpYBPhZ3 8xsEKOGQmOdO9lZFGiVuy/pdVK79MrZK67//n0smQ29YNoL/4s2ikvg/UswOBQ== 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=1721849544; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EhBlRMwpWv1YUOm+ByWZLmW/awKXWeCGuxaNh4P299E=; b=rH678ceWM9Mh+DKF/iH1bpC9xmIKYT4v748JwMAuASNzKcxUxdc7jteATUQKSUHUKy+Lvs zz5tHctT7tMSqlG5ilLda4dJbzHY+P8W21Mllhw7GJZWK2ybhoaMV9TAQFbqRjB72bzSnj xr0n84j7M+GiA8Ikb4kOursZj/oSw/YH56NTaUJIXcCeYw0JuMFrKc+PWQ6+ZscSPCTT1c Ln/pN+JT8f8J82T2dvS+4JDSEJrfGLTp///vbGWFKwMxxZ3AlY02MFzVirTPDoZfBubbLI u6WXufsgNa2DNyRPsP8UPYpd0XRvUojZJ+GB6x2Y/w+3EIrGrMWKQnCC8Rx1Gw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTkgD66CBzNt0; Wed, 24 Jul 2024 19:32:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46OJWOY8093580; Wed, 24 Jul 2024 19:32:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46OJWO9w093577; Wed, 24 Jul 2024 19:32:24 GMT (envelope-from git) Date: Wed, 24 Jul 2024 19:32:24 GMT Message-Id: <202407241932.46OJWO9w093577@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: cd836f600418 - main - vm: Retire kmem_arena List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd836f600418e892869d23cee857ce1a6cd5b863 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=cd836f600418e892869d23cee857ce1a6cd5b863 commit cd836f600418e892869d23cee857ce1a6cd5b863 Author: Alan Cox AuthorDate: 2024-07-21 19:50:47 +0000 Commit: Alan Cox CommitDate: 2024-07-24 19:31:40 +0000 vm: Retire kmem_arena It has simply been an alias for the kernel_arena for many years now. Enough time has passed to retire it. Any out-of-tree kernel modules that directly use kmem_arena should switch to kernel_arena. Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D46057 --- sys/arm/nvidia/drm2/tegra_bo.c | 4 ++-- sys/kern/subr_vmem.c | 2 -- sys/vm/vm_kern.h | 1 - 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/arm/nvidia/drm2/tegra_bo.c b/sys/arm/nvidia/drm2/tegra_bo.c index c27b9f39c508..08cd3de6a3fe 100644 --- a/sys/arm/nvidia/drm2/tegra_bo.c +++ b/sys/arm/nvidia/drm2/tegra_bo.c @@ -71,7 +71,7 @@ tegra_bo_destruct(struct tegra_bo *bo) vm_object_deallocate(bo->cdev_pager); if (bo->vbase != 0) - vmem_free(kmem_arena, bo->vbase, size); + vmem_free(kernel_arena, bo->vbase, size); } static void @@ -137,7 +137,7 @@ tegra_bo_init_pager(struct tegra_bo *bo) size = round_page(bo->gem_obj.size); bo->pbase = VM_PAGE_TO_PHYS(bo->m[0]); - if (vmem_alloc(kmem_arena, size, M_WAITOK | M_BESTFIT, &bo->vbase)) + if (vmem_alloc(kernel_arena, size, M_WAITOK | M_BESTFIT, &bo->vbase)) return (ENOMEM); VM_OBJECT_WLOCK(bo->cdev_pager); diff --git a/sys/kern/subr_vmem.c b/sys/kern/subr_vmem.c index a706d944dc3f..9288b0935441 100644 --- a/sys/kern/subr_vmem.c +++ b/sys/kern/subr_vmem.c @@ -236,9 +236,7 @@ static uma_zone_t vmem_bt_zone; static struct vmem kernel_arena_storage; static struct vmem buffer_arena_storage; static struct vmem transient_arena_storage; -/* kernel and kmem arenas are aliased for backwards KPI compat. */ vmem_t *kernel_arena = &kernel_arena_storage; -vmem_t *kmem_arena = &kernel_arena_storage; vmem_t *buffer_arena = &buffer_arena_storage; vmem_t *transient_arena = &transient_arena_storage; diff --git a/sys/vm/vm_kern.h b/sys/vm/vm_kern.h index 848f28fe90b8..942c03480364 100644 --- a/sys/vm/vm_kern.h +++ b/sys/vm/vm_kern.h @@ -69,7 +69,6 @@ extern struct vm_map exec_map_store; extern struct vm_map pipe_map_store; #define pipe_map (&pipe_map_store) extern struct vmem *kernel_arena; -extern struct vmem *kmem_arena; extern struct vmem *buffer_arena; extern struct vmem *transient_arena; extern struct vmem *memguard_arena; From nobody Wed Jul 24 19:32:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTkgG2Hs4z5QJ3P; Wed, 24 Jul 2024 19: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTkgG0WKqz4T0g; Wed, 24 Jul 2024 19: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=1721849546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ewmU2/xR/crj87bzIhTacg24QR98tA0ky9NnuSeVo58=; b=YFVdpPS84lKMycJs4tFcd6DIed9cxOf69skgQc/YorHcEaBrvxr5DQXsWhHcxcJm7BFsFX OViyge4QWLWGX2oQ/cU0u2Z8dGUmt4+ArsLF0CpuCZ6SGfsBqSvN9BLFRNZdQwmqdjwjyJ GKi8VirV2ZnN4BynOPb4IEaDArq7eM3iH3/hjYRA3f/2Ui5jOUoDezLUGQpLRRkvvS6zuX tY36IY3lwBi8rwMIfYxYUs6Bkd0mijZx1aCSoUWDelzhSC7bDuyDsDjIKStLDRlviaDlpH nTmhp4WX1wQ1vRxxVIEh2ed8eAAvv24NYq891CCBdF+CWlqPD56u2Zri+rQprg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721849546; a=rsa-sha256; cv=none; b=MEjpq9m30MJHt7dRInaHvzTmWD0t+nmiJGSfn4tr0S41DlCB/ElCBup2n9npJRBKHKcyDy zeZ5+B13yCd+QQa9cTB5DNi2a5q4z450jQVyRVJiA8ZIDjBt7GcA+bX2kOBrUBdmWHNFmi ggEJkIUh2C9eQ1hLfjI4pFZ06WZA8wt1ZYlGzuNU920Hz3WZug8bc2kV6CWnbhHX2var/P 06vGvnGPtZpKitQRuAxr94ywFQEmxTNmLyRMgHWMhfAgbWDDj3vX5M/+1NR6iheKBc7f+2 AtDN6/bDOBVnGosXo5F2eu51tvqawaYWC5reg+7dMeS1/uRpaFhz4S9I/x8TsA== 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=1721849546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ewmU2/xR/crj87bzIhTacg24QR98tA0ky9NnuSeVo58=; b=U9+uiW4GASC2IDls0OhtAaCofdtWdYz4mOOcq+GU4HdqzW2Iv3IwOWJAlAz/1XTsTUpBua N85ZG2uyI6a9JJ+mSlUSag0BPYCaXjnHMkqArPPD2n5jP1sO3cAKOxrja7ZEgp6KhXJEde eyBwxoRSa4efmZOBLZaQB7lb/lFK4bY1PB4sHRulYshsKFCdqlsAtFqon+n26N4SJeDMSE hHCfUWp1cPk6gC6f6U+js0NJcGokBBtjxQ6eqz2IciBhoFe2zMdnO/WTLeVuvBsqp58SOA IIZn7cZFt228KygUXudn554cXPhdkKNw98+JKNfuTtlxbzVM5ddixC5+5yVJ2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTkgG06k5zP9Y; Wed, 24 Jul 2024 19:32:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46OJWPwi093616; Wed, 24 Jul 2024 19:32:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46OJWPV7093613; Wed, 24 Jul 2024 19:32:25 GMT (envelope-from git) Date: Wed, 24 Jul 2024 19:32:25 GMT Message-Id: <202407241932.46OJWPV7093613@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 096dfa338d73 - main - vm: Retire vm_page_alloc_freelist{,_domain}() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 096dfa338d7391cc957dba9cca44ceb7f78cb891 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=096dfa338d7391cc957dba9cca44ceb7f78cb891 commit 096dfa338d7391cc957dba9cca44ceb7f78cb891 Author: Alan Cox AuthorDate: 2024-07-23 07:14:31 +0000 Commit: Alan Cox CommitDate: 2024-07-24 19:31:40 +0000 vm: Retire vm_page_alloc_freelist{,_domain}() Once upon a time, I created vm_page_alloc_freelist{,_domain}() to support faster allocation of pages that were mapped by the partial direct map on 32-bit MIPS. At the time, I expected that these functions might find other uses too, but those other uses never materialized. So, these functions have not been used for some time now. Instead, people use the more general vm_page_alloc_contig(). Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D46063 --- ObsoleteFiles.inc | 4 ++++ share/man/man9/Makefile | 2 -- share/man/man9/vm_page_alloc.9 | 26 +-------------------- sys/vm/vm_page.c | 51 +++++------------------------------------- sys/vm/vm_page.h | 2 -- 5 files changed, 11 insertions(+), 74 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index f8f0309d6ccf..02a34a2541eb 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20240721: retire vm_page_alloc_freelist +OLD_FILES+=usr/share/man/man9/vm_page_alloc_freelist.9.gz +OLD_FILES+=usr/share/man/man9/vm_page_alloc_freelist_domain.9.gz + # 20240716: retire mergemaster OLD_FILES+=usr/sbin/mergemaster OLD_FILES+=usr/share/man/man8/mergemaster.8.gz diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 9880b7b2f5e4..f7c21ab541b6 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -2384,8 +2384,6 @@ MLINKS+=vm_page_alloc.9 vm_page_alloc_after.9 \ vm_page_alloc.9 vm_page_alloc_contig_domain.9 \ vm_page_alloc.9 vm_page_alloc_domain.9 \ vm_page_alloc.9 vm_page_alloc_domain_after.9 \ - vm_page_alloc.9 vm_page_alloc_freelist.9 \ - vm_page_alloc.9 vm_page_alloc_freelist_domain.9 \ vm_page_alloc.9 vm_page_alloc_noobj.9 \ vm_page_alloc.9 vm_page_alloc_noobj_contig.9 \ vm_page_alloc.9 vm_page_alloc_noobj_contig_domain.9 \ diff --git a/share/man/man9/vm_page_alloc.9 b/share/man/man9/vm_page_alloc.9 index de225e05d707..7d6cf1692bb1 100644 --- a/share/man/man9/vm_page_alloc.9 +++ b/share/man/man9/vm_page_alloc.9 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH .\" DAMAGE. .\" -.Dd November 11, 2021 +.Dd July 21, 2024 .Dt VM_PAGE_ALLOC 9 .Os .Sh NAME @@ -87,17 +87,6 @@ .Fa "vm_page_t mpred" .Fc .Ft vm_page_t -.Fo vm_page_alloc_freelist -.Fa "int freelist" -.Fa "int req" -.Fc -.Ft vm_page_t -.Fo vm_page_alloc_freelist_domain -.Fa "int domain" -.Fa "int freelist" -.Fa "int req" -.Fc -.Ft vm_page_t .Fo vm_page_alloc_noobj .Fa "int req" .Fc @@ -212,19 +201,6 @@ or will carry the machine-dependent encoding of the memory attribute. Additionally, the direct mapping of the page, if any, will be updated to reflect the requested memory attribute. -.Pp -The -.Fn vm_page_alloc_freelist -and -.Fn vm_page_alloc_freelist_domain -functions behave identically to -.Fn vm_page_alloc_noobj -and -.Fn vm_page_alloc_noobj_domain , -respectively, except that a successful allocation will return a page from the -specified physical memory freelist. -These functions are not intended for use outside of the virtual memory -subsystem and exist only to support the requirements of certain platforms. .Sh REQUEST FLAGS All page allocator functions accept a .Fa req diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index c9ac79330696..64413ba10bfa 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -2406,11 +2406,10 @@ vm_page_alloc_contig_domain(vm_object_t object, vm_pindex_t pindex, int domain, /* * Allocate a physical page that is not intended to be inserted into a VM - * object. If the "freelist" parameter is not equal to VM_NFREELIST, then only - * pages from the specified vm_phys freelist will be returned. + * object. */ -static __always_inline vm_page_t -_vm_page_alloc_noobj_domain(int domain, const int freelist, int req) +vm_page_t +vm_page_alloc_noobj_domain(int domain, int req) { struct vm_domain *vmd; vm_page_t m; @@ -2426,8 +2425,7 @@ _vm_page_alloc_noobj_domain(int domain, const int freelist, int req) flags = (req & VM_ALLOC_NODUMP) != 0 ? PG_NODUMP : 0; vmd = VM_DOMAIN(domain); again: - if (freelist == VM_NFREELIST && - vmd->vmd_pgcache[VM_FREEPOOL_DIRECT].zone != NULL) { + if (vmd->vmd_pgcache[VM_FREEPOOL_DIRECT].zone != NULL) { m = uma_zalloc(vmd->vmd_pgcache[VM_FREEPOOL_DIRECT].zone, M_NOWAIT | M_NOVM); if (m != NULL) { @@ -2438,17 +2436,12 @@ again: if (vm_domain_allocate(vmd, req, 1)) { vm_domain_free_lock(vmd); - if (freelist == VM_NFREELIST) - m = vm_phys_alloc_pages(domain, VM_FREEPOOL_DIRECT, 0); - else - m = vm_phys_alloc_freelist_pages(domain, freelist, - VM_FREEPOOL_DIRECT, 0); + m = vm_phys_alloc_pages(domain, VM_FREEPOOL_DIRECT, 0); vm_domain_free_unlock(vmd); if (m == NULL) { vm_domain_freecnt_inc(vmd, 1); #if VM_NRESERVLEVEL > 0 - if (freelist == VM_NFREELIST && - vm_reserv_reclaim_inactive(domain)) + if (vm_reserv_reclaim_inactive(domain)) goto again; #endif } @@ -2482,32 +2475,6 @@ found: return (m); } -vm_page_t -vm_page_alloc_freelist(int freelist, int req) -{ - struct vm_domainset_iter di; - vm_page_t m; - int domain; - - vm_domainset_iter_page_init(&di, NULL, 0, &domain, &req); - do { - m = vm_page_alloc_freelist_domain(domain, freelist, req); - if (m != NULL) - break; - } while (vm_domainset_iter_page(&di, NULL, &domain) == 0); - - return (m); -} - -vm_page_t -vm_page_alloc_freelist_domain(int domain, int freelist, int req) -{ - KASSERT(freelist >= 0 && freelist < VM_NFREELIST, - ("%s: invalid freelist %d", __func__, freelist)); - - return (_vm_page_alloc_noobj_domain(domain, freelist, req)); -} - vm_page_t vm_page_alloc_noobj(int req) { @@ -2525,12 +2492,6 @@ vm_page_alloc_noobj(int req) return (m); } -vm_page_t -vm_page_alloc_noobj_domain(int domain, int req) -{ - return (_vm_page_alloc_noobj_domain(domain, VM_NFREELIST, req)); -} - vm_page_t vm_page_alloc_noobj_contig(int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 49f4c0fbc0cb..61a0228273c2 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -614,8 +614,6 @@ vm_page_t vm_page_alloc_contig_domain(vm_object_t object, vm_pindex_t pindex, int domain, int req, u_long npages, vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary, vm_memattr_t memattr); -vm_page_t vm_page_alloc_freelist(int, int); -vm_page_t vm_page_alloc_freelist_domain(int, int, int); vm_page_t vm_page_alloc_noobj(int); vm_page_t vm_page_alloc_noobj_domain(int, int); vm_page_t vm_page_alloc_noobj_contig(int req, u_long npages, vm_paddr_t low, From nobody Wed Jul 24 19:43:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTkwZ0dBhz5QJts; Wed, 24 Jul 2024 19:43: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTkwZ06Xcz4Vbg; Wed, 24 Jul 2024 19:43:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721850238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yhR7WBqC1LdUZkOYA7pBVN5uDCwWOONqTO9Wyww9K20=; b=OC+sYwps6JiBbDN8QKi3zw0TWqbkMlGPlKcD3YuMNTTvvtbtw/IJATcNeKFwntyll991Jm eiqg3NqiyI9bOS7IOD/awORRhQfcZmx7wpObbshUiX231ikmWQ1Tr8xOb82EM7v0HW8ivJ kwK/aSndE3IQ2tvVid8YsbRRwoZY89so696hQc6qWCpYvd3/52hjB8h3OUJ6sLWloAFTWS FOONbrSadjL7HVDTT6tSJARtsaIZua0nr6t4x2dNPa7iqqKjmteRfEKe55zpoIDJmdmRkp Ceja8cVzD5HjJH0ikX2qUoC1yj0PwUvoSI6QK31O2rUeHWILEVqJDB2hDVxRwQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721850238; a=rsa-sha256; cv=none; b=mufWW8IRWUOEcMzNsb+gmeZrXHPFAqR1l5nfVo5DVqs6qrcZKAEaNQCsQW/tRvW4obMXZ9 tGGxTBl0djCHLLg+4FNsefNKz7OF74OTDVhESXzUdGn8+dvI7QLPEe0ZHSYHK/SE4MVol8 EOrqnc9Sk1Fd30fXKSctMCP0QE8fdoUpx/YAD4IyA1MmserAaa1m57HV07z85JLRVA/ufW +onR6I6zrXr0EpMo2reu2paGHFWJNgZZOCyEhA11JHX5u/EVjCIjoU3gMYXB54DVr3Mry1 duxK3SkoI7S5TmCE4lD19GIvSk6VW2bJSbm4D/c2+Yc+1IVvp5xo6dJGCItSyA== 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=1721850238; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yhR7WBqC1LdUZkOYA7pBVN5uDCwWOONqTO9Wyww9K20=; b=N9Z6ccPsKIN2U20Ow/OHEI+NKpH+rTHOPbi9u40EUPwNov/cJFI50xWaeZRiJ2KztObnTe o/CjUncKTU4jHmA5xKtobP6yeTj2kRQOp6Cl9RdFNo57NqFzEgb5XhTiQPnKNKb/8nrsKo o0PsOFVVwNmaj00PlZ3rFzgn3Ksma0MCR6UTicfyjV5DtvGmuJfHjWgnFyBr4YOGsVV2ED vCEr1IVaKzjJHsGVi5jgv6RUIgXSMf3UV7zKFIEiCxgIWGvGoXoT0Z8QBPG4CR3XCU8gbb 8BB5L/T/njcsa3gH8eX46/L1a+OhVitcJX8rAUIY7y+6xiIX80wDb4nO6WwFsA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTkwY6qX9zPtF; Wed, 24 Jul 2024 19:43:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46OJhvbu010944; Wed, 24 Jul 2024 19:43:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46OJhvgR010941; Wed, 24 Jul 2024 19:43:57 GMT (envelope-from git) Date: Wed, 24 Jul 2024 19:43:57 GMT Message-Id: <202407241943.46OJhvgR010941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 2c75d993783c - stable/14 - Fix llvm register allocator for native/cross build differences List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2c75d993783ca4b0d1bf8dcdf424643781326e4b Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=2c75d993783ca4b0d1bf8dcdf424643781326e4b commit 2c75d993783ca4b0d1bf8dcdf424643781326e4b Author: Dimitry Andric AuthorDate: 2024-07-21 20:37:27 +0000 Commit: Dimitry Andric CommitDate: 2024-07-24 19:25:53 +0000 Fix llvm register allocator for native/cross build differences Work around an issue in LLVM's register allocator, which can cause slightly different i386 object files, when produced by a native or cross build of clang. This adds another volatile qualifier to a float variable declaration in the weightCalcHelper() function, which otherwise produces slightly different float results on amd64 and i386 hosts. In turn, this can lead to different (but equivalent) register choices, and thus non-identical assembly code. See https://github.com/llvm/llvm-project/issues/99396 for more details. Note this is a temporary fix, meant to merge in time for 13.4. As soon as upstream has a permanent solution we will import that. PR: 276961 Reported by: cperciva MFC after: 3 days (cherry picked from commit 397c2693fa66508cb5e6b173650a1f3bc6c4dd4f) --- contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp index f3cb7fa5af61..afde8d001f88 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp @@ -256,7 +256,12 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, return -1.0f; } - float Weight = 1.0f; + // FreeBSD customization: similar to the HWeight declaration below, add a + // volatile qualifier to avoid slightly different weight results on amd64 + // and i386 hosts, and possibly choosing different registers in the register + // allocator. See for + // more details. + volatile float Weight = 1.0f; if (IsSpillable) { // Get loop info for mi. if (MI->getParent() != MBB) { From nobody Wed Jul 24 19:44:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTkwn5ZWTz5QKPQ; Wed, 24 Jul 2024 19:44: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTkwn53cnz4Vtb; Wed, 24 Jul 2024 19:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721850249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DbS3jkG0L8XoCNCzi+8p2Ct1l4cvzpXktOT9S3XaZkI=; b=BnoQ/0IxTkEqg5yfBwHjow0QCWtC+t7Iz6GVNBViJj05qCch3vTemG0up7mYKfNbi2JPHp IdJf3G153XKP/tWgdMejXkmxa2HCoC8+WaMyg9zSScy8zJeVWSPWGXmCdiHP34XSB0rH7/ +0JmNfOx3TCt1UjOQTh9zXK7j3ZiYkwRSaWZWxpYOVofYifJ6DzcKZZ/Wie7qaGgZ3XCk1 OAi2qaB5K5yNHBdVls9nrzQ+bBx2IQf0LZc9Ola2jh6JK/sTO1iDr0Z/SQL5vgNjbp62xc JUyr9fsbFvHVKH0BhD42snGl6wR0BiQM/668Fk5QqA0fDdkRAfv8goqodCgsYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721850249; a=rsa-sha256; cv=none; b=qVIpjw0iKbC9UBLDpkiysI/1tmzBmqp/qtJPZiqi40jKksQ74b9dCx4ujd0+zvciSf7Ltv AB1vKv6oKga0VA3qMzT45YXyUM1vKLJwX3DxmcN/IB0haqPWCslPAvR3oMm9somf1LC7lh 89fJt6gFZ8TRmXySXIcsOX4NJDE3zubhxTtoBmKwwU6bfvqKHAtKh71ktwUsSwOfRH/dcC 7lzSVTotmslCi2irouHOvJD47sHVzAzQHxKgwfHz4BnBuQy7WlH260Gtcav6aSy2eF/Goa B5lrE9c5kTYXSCFowJEfTjB+phZIdxleEdqxw1UNQfvT1w2bYzNG4iZn5ilDIQ== 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=1721850249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DbS3jkG0L8XoCNCzi+8p2Ct1l4cvzpXktOT9S3XaZkI=; b=Nd+radwFXSpF6wr2Wrb6MrJJ0zfajnWdQcFBG2+TldMIAGIgX/Y/bggWhaEZ2ouX70z9PA znwntOXfOVSfuhBR+Ug+FPKvrh85ufBOjFg+Ku1X23udP0zrVBz12SB9x0O7rNYUaNLLN/ Yh2YrnOB1FBHPOmWh1YUczWCaQ5dl44r7GVG/TnbPIdOpAp+NhwUzjpE8muja7zvfSTBeW IwuSDuFgo8wZjxJPnXwUCoIfOusSdtNZVWpvSx3nLwuZH1AcaNZkQW8F0YZETacYEz4AL8 NMEqF92QCXVx6jLTnERqSblSKnFXoe1t3w16VJRBUTNMlCx4FTvvM+BDgzML2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTkwn4flWzPfM; Wed, 24 Jul 2024 19:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46OJi9S1011146; Wed, 24 Jul 2024 19:44:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46OJi92Z011143; Wed, 24 Jul 2024 19:44:09 GMT (envelope-from git) Date: Wed, 24 Jul 2024 19:44:09 GMT Message-Id: <202407241944.46OJi92Z011143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 8d87e47b8d10 - stable/13 - Fix llvm register allocator for native/cross build differences List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8d87e47b8d1093a264ca954620b9e58b81fb9b34 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=8d87e47b8d1093a264ca954620b9e58b81fb9b34 commit 8d87e47b8d1093a264ca954620b9e58b81fb9b34 Author: Dimitry Andric AuthorDate: 2024-07-21 20:37:27 +0000 Commit: Dimitry Andric CommitDate: 2024-07-24 19:26:11 +0000 Fix llvm register allocator for native/cross build differences Work around an issue in LLVM's register allocator, which can cause slightly different i386 object files, when produced by a native or cross build of clang. This adds another volatile qualifier to a float variable declaration in the weightCalcHelper() function, which otherwise produces slightly different float results on amd64 and i386 hosts. In turn, this can lead to different (but equivalent) register choices, and thus non-identical assembly code. See https://github.com/llvm/llvm-project/issues/99396 for more details. Note this is a temporary fix, meant to merge in time for 13.4. As soon as upstream has a permanent solution we will import that. PR: 276961 Reported by: cperciva MFC after: 3 days (cherry picked from commit 397c2693fa66508cb5e6b173650a1f3bc6c4dd4f) --- contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp index f3cb7fa5af61..afde8d001f88 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp @@ -256,7 +256,12 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, return -1.0f; } - float Weight = 1.0f; + // FreeBSD customization: similar to the HWeight declaration below, add a + // volatile qualifier to avoid slightly different weight results on amd64 + // and i386 hosts, and possibly choosing different registers in the register + // allocator. See for + // more details. + volatile float Weight = 1.0f; if (IsSpillable) { // Get loop info for mi. if (MI->getParent() != MBB) { From nobody Wed Jul 24 20:07:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTlRK6Y2sz5QMbh; Wed, 24 Jul 2024 20:07: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTlRK5ymdz4Xdh; Wed, 24 Jul 2024 20:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721851629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+isKivb7WcT2rIVwhCC2Vd3EZGZWE5aHAjTenNcmiX0=; b=JbK1Mla5bod0DRU11c6009w0GKjlwHYpPbRHYAd77bDRbMjNHs5r/MWRJBnESJER0P9yMP qnpdzVxqUA5Kp9VhUOaBEl2AgAXY5ICSDG9lsR15GrjGO+wOfDa/Z3Pf+befqObSKY/KOC lUpUp+8LvOwlwZAiF0xjXirR+7Iwlsm2S42WskI8OYBQuYcTLnOTUzV+pGCcrKbZt2bdmY H4U6fBoC67Wuaz6/392+oMGhLXmrjYweJwQoJnF36QJQSjdJNRBuVXncuNh3kWvLwPwtCb zZrl1/floMK1s3iwe5AMFFyiEdtn3ZTSvppp8c1jdzJJWH5WltJfY5sUfWL6fQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721851629; a=rsa-sha256; cv=none; b=eMWFP7UUVtazUTE+cMapAYpceNN/7hD0U40wNcyb84QQI+kMDQQXVBUpW9LXRa8FKHeCm4 dRsn9F/6L3tnxZChO7ZXmHfcDNwm6sq3N/pkqyPRPH11uqDAiBGPDYo38iD+0QKhe85Y62 09cUOIyIVdwtDBaMONJuvm6gZJGuYd2FdY1a+KFtRreJUFWi6tFrTKf7d6oBYt/skT2II9 MkXt2hcNv4y6J1wQgsw1GZrMjvumd++XPj2cZq9Bt/NYo0bc8fhW5eVLP8Z7B9wd5YsSWZ CMfmZGeZ7Np/Qdhfzcg/QUPU5b9kCp0+hUrbkaZqOvawbOOP1O6g4sml//JQLA== 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=1721851629; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+isKivb7WcT2rIVwhCC2Vd3EZGZWE5aHAjTenNcmiX0=; b=podm+IzskV+1d8BNEuhVAI/XRsabtq0MveiUF/qqxoTp5AgtssuqCxga6ADJb0V3L7YOWO /rUBEwAK52iur0C7fenUZWmCl6+U3/Z/l1FGXgHIFUcTrZGtXSv3VFjdxm4ZNtheC/gq6P v7MJZGQGs6QJjiH3lawIRsUvYJaF1uCP/FDP7EA8BcZZXq3zUPXAW32YzEf2QiQKg305kZ hVMCHkMtn1Y5rpPWGh6ek5/pJ7h0/0790LvhnEcd4OVTnBQPA2MxORcj+4bT16NU4kEng2 Fbrq8Fz67T9dX0HJCdB6cQISCnJlu9GGzgfj9PTJ7LD44n1/xgIXquc/K2cA4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTlRK5XqkzQHP; Wed, 24 Jul 2024 20:07:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46OK7938046014; Wed, 24 Jul 2024 20:07:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46OK79NT046011; Wed, 24 Jul 2024 20:07:09 GMT (envelope-from git) Date: Wed, 24 Jul 2024 20:07:09 GMT Message-Id: <202407242007.46OK79NT046011@gitrepo.freebsd.org> 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=B8rgrav?= Subject: git: 647d4a8cafd2 - main - ls: Make -, apply to -s as well as -l. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 647d4a8cafd2c9b291cab388191bc7fcfe12a66b Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=647d4a8cafd2c9b291cab388191bc7fcfe12a66b commit 647d4a8cafd2c9b291cab388191bc7fcfe12a66b Author: Dag-Erling Smørgrav AuthorDate: 2024-07-24 20:06:39 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-07-24 20:07:06 +0000 ls: Make -, apply to -s as well as -l. While here, remove a bogus comment about a gcc bug. The bug was in ls, which used an incorrect format string, and in libc, which accepted it. MFC after: 1 week Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D46067 --- bin/ls/ls.1 | 4 +++- bin/ls/ls.c | 3 ++- bin/ls/print.c | 14 ++++++-------- bin/ls/tests/ls_tests.sh | 16 ++++++++++++++++ 4 files changed, 27 insertions(+), 10 deletions(-) diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index 9d4c55b9b17d..d86250b82db2 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 21, 2024 +.Dd July 22, 2024 .Dt LS 1 .Os .Sh NAME @@ -434,6 +434,8 @@ output is not to a terminal. .It Fl , (Comma) When the .Fl l +or +.Fl s option is set, print file sizes grouped and separated by thousands using the non-monetary separator returned by .Xr localeconv 3 , diff --git a/bin/ls/ls.c b/bin/ls/ls.c index b5e3578f27bb..a285838e2ee1 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -969,7 +969,8 @@ label_out: d.maxlen = maxlen; if (needstats) { d.btotal = btotal; - d.s_block = snprintf(NULL, 0, "%lu", howmany(maxblock, blocksize)); + d.s_block = snprintf(NULL, 0, f_thousands ? "%'ld" : "%ld", + howmany(maxblock, blocksize)); d.s_flags = maxflags; d.s_label = maxlabelstr; d.s_group = maxgroup; diff --git a/bin/ls/print.c b/bin/ls/print.c index 979ad0ffc43e..f651dea5de90 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -221,7 +221,7 @@ printlong(const DISPLAY *dp) (void)printf("%*ju ", dp->s_inode, (uintmax_t)sp->st_ino); if (f_size) - (void)printf("%*jd ", + (void)printf(f_thousands ? "%'*jd " : "%*jd ", dp->s_block, howmany(sp->st_blocks, blocksize)); strmode(sp->st_mode, buf); aclmode(buf, p); @@ -400,7 +400,7 @@ printaname(const FTSENT *p, u_long inodefield, u_long sizefield) chcnt += printf("%*ju ", (int)inodefield, (uintmax_t)sp->st_ino); if (f_size) - chcnt += printf("%*jd ", + chcnt += printf(f_thousands ? "%'*jd " : "%*jd ", (int)sizefield, howmany(sp->st_blocks, blocksize)); #ifdef COLORLS if (f_color) @@ -753,12 +753,10 @@ printsize(size_t width, off_t bytes) humanize_number(buf, sizeof(buf), (int64_t)bytes, "", HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); (void)printf("%*s ", (u_int)width, buf); - } else if (f_thousands) { /* with commas */ - /* This format assignment needed to work round gcc bug. */ - const char *format = "%*j'd "; - (void)printf(format, (u_int)width, bytes); - } else - (void)printf("%*jd ", (u_int)width, bytes); + } else { + (void)printf(f_thousands ? "%'*jd " : "%*jd ", + (u_int)width, bytes); + } } /* diff --git a/bin/ls/tests/ls_tests.sh b/bin/ls/tests/ls_tests.sh index c82b4e8c8851..c732b60b21a4 100755 --- a/bin/ls/tests/ls_tests.sh +++ b/bin/ls/tests/ls_tests.sh @@ -800,6 +800,21 @@ s_flag_body() done } +atf_test_case scomma_flag +scomma_flag_head() +{ + atf_set "descr" "Verify that -s, prints out the size with ',' delimiters" +} + +scomma_flag_body() +{ + export LC_ALL=en_US.UTF-8 + atf_check -e ignore dd if=/dev/urandom of=file bs=65536 count=64 + blocks=$(stat -f "%b" file) + cblocks=$(printf "%'d" $blocks) + atf_check -e empty -o match:"$cblocks[[:space:]]+file" ls -s, file +} + atf_test_case t_flag t_flag_head() { @@ -972,6 +987,7 @@ atf_init_test_cases() atf_add_test_case q_flag_and_w_flag atf_add_test_case r_flag atf_add_test_case s_flag + atf_add_test_case scomma_flag atf_add_test_case t_flag atf_add_test_case u_flag atf_add_test_case v_flag From nobody Wed Jul 24 20:07:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTlRM0K6qz5QMq3; Wed, 24 Jul 2024 20:07: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTlRL6vwdz4Xxg; Wed, 24 Jul 2024 20:07:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721851631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U/9G+1X5fF/4O5iAb6klActF2NIX4PcRNqwhJz5uzK0=; b=OHEwIG1uCIXHrLT7XQ0+KCP0oukZ6n8dSXcwm2z/MSX/5Tu7X9EdTlpLtx0f+Os27rZwr0 o50jYtszPhKeYb0Ffyoj7UiYbD84FfzyKVePW9H0l4iM+Yavw9VbRPInpDlXQr9VJMoHfe rH1HlpiWtleVrhhe6mf3VNZJGi7UPRBWA7ADRhW/2OsZ+U8axPAmzjYnYsxR3Fqfi8QEcN BaSbA6nCTchkGIdJl9B4Wl6GKDhz3BC6jiyqLPajqpBsaYFuRuIeoYTzuGzrg8y1GjaQAD gKZCJPNWm2Edyp04KXa5xBuKwPjkIGOJm976i27qoVfOxMTfanxMIXlCQUkiaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721851631; a=rsa-sha256; cv=none; b=Fsnb66Ypev1vWXNPO6A1wzyjQrkbl2yQq7lV8NT0NiaS8PdmlwgvhVI4f7JlTZIqHdLZs/ 0YXnx20ECtAej6ONfcyRMsY+XRHjv/Eq1G2HCDvgiMBhUdnxH5wBK+bIX0+dvxE38KlCjE lQXL53VyNFiQs2t733qjq2n2uy5Uwak8Y7eiqTlMd+5pBG++2BdzyEqKVVx2HNXQ2YzVDK +niqIXDRFROj0UmR5EaFTeXOeRX6VkcdqRzG/thEsTxDr5t88HGmd4y5hqItkJ+vprNshX yZN+d/ilrcCS6mXxbmm4f8eCgoNVdPZU3rJj5LV6jf6yv8jxayWnmgq74hbytg== 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=1721851631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U/9G+1X5fF/4O5iAb6klActF2NIX4PcRNqwhJz5uzK0=; b=STAg2akqrWrK4rAVQOI8aCeFJwt6WRWMBGXNzCLpjaGjS09+HKK6Vjw4svGEKy10QeNOMG o2mtMHRlDSipFvxyHf6Q//m9Am3eTrjuEXt5i8jGF2cgyIdsctoN8iMVS1O+fKVDNJfIxJ p9jyXzcpAc+5MTpgbiOUQWrkEAZDtvyKSb2UYGSY3e8aoBXHtgS8LEAYRavrTtblIilDPL CRTAI/Edy/Lh5woY+ULMD1iCLP500eHOyS/URRY518mOnguVb+iBGuVaEV9hUtDzTJUldJ 3zzCCBIJcMoG5NqCgrTTeIHU5rUHBU++GUg7GLU/VXIDkaRnHrr67Owfz0wb8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTlRL6WMgzPvf; Wed, 24 Jul 2024 20:07:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46OK7AOu046074; Wed, 24 Jul 2024 20:07:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46OK7A4b046068; Wed, 24 Jul 2024 20:07:10 GMT (envelope-from git) Date: Wed, 24 Jul 2024 20:07:10 GMT Message-Id: <202407242007.46OK7A4b046068@gitrepo.freebsd.org> 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=B8rgrav?= Subject: git: f890020d43bf - main - pax: Clear arcn in each read function. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f890020d43bf2070f12ffec37bcd9579f6fb1347 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=f890020d43bf2070f12ffec37bcd9579f6fb1347 commit f890020d43bf2070f12ffec37bcd9579f6fb1347 Author: Dag-Erling Smørgrav AuthorDate: 2024-07-24 20:06:44 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-07-24 20:07:06 +0000 pax: Clear arcn in each read function. Instead of initializing individual fields to zero, clear the entire struct prior to populating it. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D46097 --- bin/pax/cpio.c | 12 +++--------- bin/pax/tar.c | 20 ++------------------ 2 files changed, 5 insertions(+), 27 deletions(-) diff --git a/bin/pax/cpio.c b/bin/pax/cpio.c index 8ae40f461343..8108dd11731f 100644 --- a/bin/pax/cpio.c +++ b/bin/pax/cpio.c @@ -274,13 +274,13 @@ cpio_rd(ARCHD *arcn, char *buf) */ if (cpio_id(buf, sizeof(HD_CPIO)) < 0) return(-1); + memset(arcn, 0, sizeof *arcn); hd = (HD_CPIO *)buf; /* * byte oriented cpio (posix) does not have padding! extract the octal * ascii fields from the header */ - arcn->pad = 0L; arcn->sb.st_dev = (dev_t)asc_ul(hd->c_dev, sizeof(hd->c_dev), OCT); arcn->sb.st_ino = (ino_t)asc_ul(hd->c_ino, sizeof(hd->c_ino), OCT); arcn->sb.st_mode = (mode_t)asc_ul(hd->c_mode, sizeof(hd->c_mode), OCT); @@ -309,8 +309,6 @@ cpio_rd(ARCHD *arcn, char *buf) /* * no link name to read for this file */ - arcn->ln_nlen = 0; - arcn->ln_name[0] = '\0'; return(com_rd(arcn)); } @@ -555,8 +553,8 @@ vcpio_rd(ARCHD *arcn, char *buf) return(-1); } + memset(arcn, 0, sizeof *arcn); hd = (HD_VCPIO *)buf; - arcn->pad = 0L; /* * extract the hex ascii fields from the header @@ -603,8 +601,6 @@ vcpio_rd(ARCHD *arcn, char *buf) /* * we have a valid header (not a link) */ - arcn->ln_nlen = 0; - arcn->ln_name[0] = '\0'; arcn->pad = VCPIO_PAD(arcn->sb.st_size); return(com_rd(arcn)); } @@ -851,7 +847,7 @@ bcpio_rd(ARCHD *arcn, char *buf) if (bcpio_id(buf, sizeof(HD_BCPIO)) < 0) return(-1); - arcn->pad = 0L; + memset(arcn, 0, sizeof *arcn); hd = (HD_BCPIO *)buf; if (swp_head) { /* @@ -913,8 +909,6 @@ bcpio_rd(ARCHD *arcn, char *buf) /* * we have a valid header (not a link) */ - arcn->ln_nlen = 0; - arcn->ln_name[0] = '\0'; arcn->pad = BCPIO_PAD(arcn->sb.st_size); return(com_rd(arcn)); } diff --git a/bin/pax/tar.c b/bin/pax/tar.c index 50a9a41623ca..8b551d84ccc3 100644 --- a/bin/pax/tar.c +++ b/bin/pax/tar.c @@ -367,9 +367,9 @@ tar_rd(ARCHD *arcn, char *buf) */ if (tar_id(buf, BLKMULT) < 0) return(-1); + memset(arcn, 0, sizeof *arcn); arcn->org_name = arcn->name; arcn->sb.st_nlink = 1; - arcn->pat = NULL; /* * copy out the name and values in the stat buffer @@ -396,8 +396,6 @@ tar_rd(ARCHD *arcn, char *buf) * to encode this as a directory */ pt = &(arcn->name[arcn->nlen - 1]); - arcn->pad = 0; - arcn->skip = 0; switch(hd->linkflag) { case SYMTYPE: /* @@ -434,8 +432,6 @@ tar_rd(ARCHD *arcn, char *buf) arcn->type = PAX_DIR; arcn->sb.st_mode |= S_IFDIR; arcn->sb.st_nlink = 2; - arcn->ln_name[0] = '\0'; - arcn->ln_nlen = 0; break; case AREGTYPE: case REGTYPE: @@ -443,8 +439,6 @@ tar_rd(ARCHD *arcn, char *buf) /* * If we have a trailing / this is a directory and NOT a file. */ - arcn->ln_name[0] = '\0'; - arcn->ln_nlen = 0; if (*pt == '/') { /* * it is a directory, set the mode for -v printing @@ -721,10 +715,9 @@ ustar_rd(ARCHD *arcn, char *buf) */ if (ustar_id(buf, BLKMULT) < 0) return(-1); + memset(arcn, 0, sizeof *arcn); arcn->org_name = arcn->name; arcn->sb.st_nlink = 1; - arcn->pat = NULL; - arcn->nlen = 0; hd = (HD_USTAR *)buf; /* @@ -771,15 +764,6 @@ ustar_rd(ARCHD *arcn, char *buf) if (uid_name(hd->uname, &(arcn->sb.st_uid)) < 0) arcn->sb.st_uid = (uid_t)asc_ul(hd->uid, sizeof(hd->uid), OCT); - /* - * set the defaults, these may be changed depending on the file type - */ - arcn->ln_name[0] = '\0'; - arcn->ln_nlen = 0; - arcn->pad = 0; - arcn->skip = 0; - arcn->sb.st_rdev = (dev_t)0; - /* * set the mode and PAX type according to the typeflag in the header */ From nobody Wed Jul 24 21:24:55 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTn9442C8z5R0mW; Wed, 24 Jul 2024 21:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTn940Tn5z4lRX; Wed, 24 Jul 2024 21:24:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721856296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4h/bHMSBisdSQ088eNxopmM3m4uiGa0lIxZpwByY5dY=; b=Rn/JegLkDv5Q/UP+IQJKDSES2KgGb5nXW8mA09wcAapNf/7ASidYGcqiqfIm3HOe6Ckdiz wIBbaomYayYhYo6hnxACUpxzllmbbyNoihgB1b/XQJgXl3OVAnHtaZZSfXhoP1yEJClVwt eE+5fhWNtJCcSBoPqXyJ4P60HsfU6KYaUgseCXh3x56oqUxIx0C5k8D2vicf/BluRh6hxD eaDJ9MGGKRiswCdWpil9VzSXtJnNKtPeuiv1hML/hn/1R5bWWOUBVlsvrdDATgDTYN0Qwp qgsI490sy0i2VygI7bpD3vNShiy6VyNILoDj1Q8Ht6f8Yk71ddqQOCo5PZQxTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721856296; a=rsa-sha256; cv=none; b=UddtDkeR5LFn0oM7ltkpC/uF0iAWD5q7RS/OnQe3oyHxOEyDRm4UhxRSGrOzut12SdQh4t oy/WJQPqm6/n8iO6iSPIVbQhReZBWFMF4bOO5xC//hfjuTXa9AWgV4370E1plmAggLKo1L x2V/SPbLTA6wyscBEWydDq3S6uJ78LGe/vqijWwmrUfD7qAs+cxna4riQhatxKoLWs507g 283XY+9M7xunT8WYxVtDsSGEHnYLy62+10kVF4zt3irAxW9VaOE55p7vkFxv0j5sQ+GXB7 w7JcfOAxoEc+kyPcssC6RSkeBub2kcrb7lF5J/3+mdT4cnKFfcl4JPtzmWSC3Q== 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=1721856296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4h/bHMSBisdSQ088eNxopmM3m4uiGa0lIxZpwByY5dY=; b=Q6e1fBTsuHVVfU5WOZ/aK6TJNx1bJbjW+GNyir5KRPaBPysD+QcPbzVAS7j91YFRHRa8Hx HUSYWA+qkQ/nrtztkroq/gwGN+8/Bsd72Wb0xv4QzTaWX/hTbMXHy6om6EeY5Xc+PyIHHQ xEp3EC3PYtcE6aybJvjK4gqJkokhRSj2REXfnXndb4jl2GgnFulvjNtAfn1alg0uRgYc3z 20kAmcFCv3+dJDmxE5P+dAZZEpjnKKxrNHb3NOVVSj3wl29hp2gZEQFcE2CHrQfCM9IqGv PX6SFV7f37pmhIovgwv6qsnprGAjiA36vbEfowFOY4SfQaxCbPKk5MYM1nSLDg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTn94065JzS23; Wed, 24 Jul 2024 21:24:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46OLOtj8083414; Wed, 24 Jul 2024 21:24:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46OLOtQs083411; Wed, 24 Jul 2024 21:24:55 GMT (envelope-from git) Date: Wed, 24 Jul 2024 21:24:55 GMT Message-Id: <202407242124.46OLOtQs083411@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 82283cad12a4 - main - dtrace: Avoid including dtrace_isa.c directly into dtrace.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 82283cad12a417abfb1469d899b2d7cfb1d38f77 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=82283cad12a417abfb1469d899b2d7cfb1d38f77 commit 82283cad12a417abfb1469d899b2d7cfb1d38f77 Author: Mark Johnston AuthorDate: 2024-07-24 20:10:33 +0000 Commit: Mark Johnston CommitDate: 2024-07-24 21:24:46 +0000 dtrace: Avoid including dtrace_isa.c directly into dtrace.c This was done in the original DTrace import, presumably because that made it a bit easier to handle includes. However, this can cause dtrace_getpcstack() to be inlined into dtrace_probe(), resulting in a missing frame in stack traces since dtrace_getpcstack() takes care to bump "aframes" to account for its own stack frame. To avoid this, compile dtrace_isa.c separately on all platforms. Add requisite includes. MFC after: 2 weeks Sponsored by: Innovate UK --- sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c | 1 - sys/cddl/dev/dtrace/aarch64/dtrace_isa.c | 3 +++ sys/cddl/dev/dtrace/amd64/dtrace_isa.c | 3 ++- sys/cddl/dev/dtrace/arm/dtrace_isa.c | 1 + sys/cddl/dev/dtrace/i386/dtrace_isa.c | 3 ++- sys/cddl/dev/dtrace/powerpc/dtrace_isa.c | 2 ++ sys/cddl/dev/dtrace/riscv/dtrace_isa.c | 1 + sys/cddl/dev/fbt/x86/fbt_isa.c | 2 +- sys/conf/files.arm | 1 + sys/conf/files.riscv | 1 + sys/modules/dtrace/dtrace/Makefile | 1 + 11 files changed, 15 insertions(+), 4 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c index ce02676e0dc1..d3e40e96e897 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c @@ -18446,7 +18446,6 @@ static struct cdevsw helper_cdevsw = { #include #include #include -#include SYSINIT(dtrace_load, SI_SUB_DTRACE, SI_ORDER_FIRST, dtrace_load, NULL); SYSUNINIT(dtrace_unload, SI_SUB_DTRACE, SI_ORDER_FIRST, dtrace_unload, NULL); diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c index 72944e8a5ae2..ff0e068006bd 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -46,6 +47,8 @@ #include #include +#include + #include "regset.h" #define MAX_USTACK_DEPTH 2048 diff --git a/sys/cddl/dev/dtrace/amd64/dtrace_isa.c b/sys/cddl/dev/dtrace/amd64/dtrace_isa.c index 0b7162998536..9db5a16190db 100644 --- a/sys/cddl/dev/dtrace/amd64/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/amd64/dtrace_isa.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -368,7 +369,7 @@ dtrace_getarg(int arg, int aframes) for (i = 1; i <= aframes; i++) { fp = fp->f_frame; - if (P2ROUNDUP(fp->f_retaddr, 16) == + if (roundup2(fp->f_retaddr, 16) == (long)dtrace_invop_callsite) { /* * In the case of amd64, we will use the pointer to the diff --git a/sys/cddl/dev/dtrace/arm/dtrace_isa.c b/sys/cddl/dev/dtrace/arm/dtrace_isa.c index c3783b77c2d4..ed03e5ca0006 100644 --- a/sys/cddl/dev/dtrace/arm/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/arm/dtrace_isa.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/sys/cddl/dev/dtrace/i386/dtrace_isa.c b/sys/cddl/dev/dtrace/i386/dtrace_isa.c index 64c8de2a8d3a..7a30587120ba 100644 --- a/sys/cddl/dev/dtrace/i386/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/i386/dtrace_isa.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -428,7 +429,7 @@ dtrace_getarg(int arg, int aframes) for (i = 1; i <= aframes; i++) { fp = fp->f_frame; - if (P2ROUNDUP(fp->f_retaddr, 4) == + if (roundup2(fp->f_retaddr, 4) == (long)dtrace_invop_callsite) { /* * If we pass through the invalid op handler, we will diff --git a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c index 7185a01c125d..acde4f0aeab2 100644 --- a/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/powerpc/dtrace_isa.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -37,6 +38,7 @@ #include #include #include +#include #include #include diff --git a/sys/cddl/dev/dtrace/riscv/dtrace_isa.c b/sys/cddl/dev/dtrace/riscv/dtrace_isa.c index 87f52b809dfa..7a66d93d4ba9 100644 --- a/sys/cddl/dev/dtrace/riscv/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/riscv/dtrace_isa.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include diff --git a/sys/cddl/dev/fbt/x86/fbt_isa.c b/sys/cddl/dev/fbt/x86/fbt_isa.c index 387a3f1582c3..ee05d37b383e 100644 --- a/sys/cddl/dev/fbt/x86/fbt_isa.c +++ b/sys/cddl/dev/fbt/x86/fbt_isa.c @@ -54,7 +54,7 @@ #define FBT_PATCHVAL 0xf0 #endif -#define FBT_AFRAMES 2 +#define FBT_AFRAMES 3 int fbt_invop(uintptr_t addr, struct trapframe *frame, uintptr_t scratch __unused) diff --git a/sys/conf/files.arm b/sys/conf/files.arm index 825680b73165..5ada97ccad30 100644 --- a/sys/conf/files.arm +++ b/sys/conf/files.arm @@ -76,6 +76,7 @@ arm/arm/unwind.c optional ddb | kdtrace_hooks | stack arm/arm/vm_machdep.c standard arm/arm/vfp.c optional vfp cddl/dev/dtrace/arm/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" +cddl/dev/dtrace/arm/dtrace_isa.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/dtrace/arm/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/arm/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" diff --git a/sys/conf/files.riscv b/sys/conf/files.riscv index 5b94eb327f93..89fb6f3cbe5a 100644 --- a/sys/conf/files.riscv +++ b/sys/conf/files.riscv @@ -1,4 +1,5 @@ cddl/dev/dtrace/riscv/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" +cddl/dev/dtrace/riscv/dtrace_isa.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/dtrace/riscv/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/dtrace/riscv/instr_size.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/riscv/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" diff --git a/sys/modules/dtrace/dtrace/Makefile b/sys/modules/dtrace/dtrace/Makefile index 765a8477f3f2..472de0ff944b 100644 --- a/sys/modules/dtrace/dtrace/Makefile +++ b/sys/modules/dtrace/dtrace/Makefile @@ -12,6 +12,7 @@ KMOD= dtrace SRCS= dtrace.c \ dtrace_xoroshiro128_plus.c \ dtrace_asm.S \ + dtrace_isa.c \ dtrace_subr.c .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" From nobody Wed Jul 24 21:24:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTn9332ysz5R0mV; Wed, 24 Jul 2024 21:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTn926TzKz4lJ6; Wed, 24 Jul 2024 21:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721856294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Vqmvl0J0C/6fPfxf+Zq9SlpfJAP444shOfJRaE8qPs=; b=oPAWyOWXfXskPeD8ZP0pa0+BmAL2FqpkCODZWE+mVtsl6+oTA3ITQkXT5f6pCoFY/Lm3a0 9YehygA9AvnRSIktNoOKZj4IFAUhFPkcsp91//hFPH9WQb/OKFzNRhhmNyrHdbEsGDLgzi dUrVqta4fYvkaSuXTcthO2c3Nmb5vqwe4ko4OqfGKC7meuOfXrb0SjEFFOL4BGz0WiUpQd DwirRWJ3lKG865pdGRjFuLHeENhHoB5Q/KXqrvto2/a+KZpFc/E/JlWJrdVoIti6MzvM+u ONqVKtjlHG7P7O2GTuzMHL6Q+bfYQtGUeu+S/OM0JhKZXdmnoefunqtl07+l4A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721856294; a=rsa-sha256; cv=none; b=GPSlcuPM4/zs+iYZIpsNkWQi8KUeF7mHREKeumoUlmAOtOsUj4J+XT9T7pk3jtrtBCuI2q Rvz4LgLzTaKrWnQgTy4UpXIYYpwa7OC7RZPrNNJpjT/6dlYLyI7AwXYLo4X+POSmydO9Sg IgeZdNcteBwAsQmEc4F5E+iRBMjvxuDMkdE73+x5USC2FUNe70K5RRnR68K5+6xmrh2q0S /bvJIstvtPKy2FGyFXNskyK/O30dWT8RfwKDxSMS2J13vay/gH4sDQVfajGdt6wF/pAK2A oaTBnDokdUoeBNAmIbCSuiGmSg4VKyddggloSLhjaeFqnic5IsoOhcuWXiqrjA== 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=1721856294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Vqmvl0J0C/6fPfxf+Zq9SlpfJAP444shOfJRaE8qPs=; b=SQwqXArho+j/boD8xmMZWsHGxsHhT4yC57OYwaC4HmY3L5FwJgyc933vkDgeH6j0yt41tq x/bwwySH5eAHC1qhsvyqFpz/sL1frwBUiNwJrYcJLVsZcok4PyC8W/MyficpTc5yHv32OV ICFhMeuh/06OOYTOZjBejrKHGdUdgFQpkre/p4uPyTKR8zxbYAoNv1CjOtsPaqU012GyCQ xeff1MWEF3893Mv8WUkNwCRKu/unEFU2PJuOC2s+MsUfTpGnGB0pNuoVtUYp80/atd0PsB 9Wqs7YoqsfnR6onZRMplm9ygLxomoM3OpnKGsY86/EitijMSBKg51xoZLTPmAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTn92663KzS22; Wed, 24 Jul 2024 21:24:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46OLOs4T083364; Wed, 24 Jul 2024 21:24:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46OLOsEx083361; Wed, 24 Jul 2024 21:24:54 GMT (envelope-from git) Date: Wed, 24 Jul 2024 21:24:54 GMT Message-Id: <202407242124.46OLOsEx083361@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 1c30cf95098e - main - malloc: Handle large malloc sizes in malloc_size() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c30cf95098e999ee24b2396763b4f65d021cdf0 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1c30cf95098e999ee24b2396763b4f65d021cdf0 commit 1c30cf95098e999ee24b2396763b4f65d021cdf0 Author: Mark Johnston AuthorDate: 2024-07-24 20:16:20 +0000 Commit: Mark Johnston CommitDate: 2024-07-24 21:24:46 +0000 malloc: Handle large malloc sizes in malloc_size() Reviewed by: kib, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45661 --- sys/kern/kern_malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index b9460515bc14..4d07581e6a5b 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -1130,7 +1130,7 @@ malloc_size(size_t size) int indx; if (size > kmem_zmax) - return (0); + return (round_page(size)); if (size & KMEM_ZMASK) size = (size & ~KMEM_ZMASK) + KMEM_ZBASE; indx = kmemsize[size >> KMEM_ZSHIFT]; From nobody Thu Jul 25 02:47:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTwJh4BqVz5RX6M; Thu, 25 Jul 2024 02:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTwJh3ZfYz4FL8; Thu, 25 Jul 2024 02:47:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721875620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eSByOOLEkwGY/UdssFThIW9G4+Mh8EqxD941c9oI2Kw=; b=Hmaeh8aojf5ofI46xmpMHyfSSm3AyppqHXCJ8249teR84sV+XidOjV7woKjkR7yNDcnFyD eS5BYxuVVKv4ExAmdaCYyEfuu/RDS6oYMYOrBljPt5ID98NpcMWDczt9/awl+Q0z2+6rSX cYS8HJKkFCseJRzRm4tEgLRwrcDYGX2x2nOSss1VDLAfMYQSCOmue8ds+jao9qFT8zE+hb UZ+8rswJ0vNrq+ojI/TRH6xd15SCDWWoUp5lwntd7Vjahba+hUeL8pFLCXDwSa6kZqxbnR Kgc3LwFtheJkAL25POwT4VFMyYc6cyshSTNXvQ0wzPJXxwj9MisfUKPYiStxBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721875620; a=rsa-sha256; cv=none; b=pE9o1XdQCilMcs2ahzZmtiX0DagR0/aO8ZhLRQ1bP5vwZw/noDIaVvVBJY1eQUtTD7ofIv TLXLWt6SY2u9DgUw7ihPHUS75zlwj6LpFrNVfVCWgi9E+EevJLa1q6JgILluI3iQGFMQoB pGE8bCNO050Hjzx8WtJDL8wgY6jg+BfCXA2SnLYbSQmp4VwYvWYQpkd3+RrcdNz3kXzyl2 8UOxUMUM9txckaAddqvM7HdZJXdEC9UYXm7A24JB3LCvGGFEc2jflkpoYBAUckixbyKPee YNOI3mXkcIPdY6mU+2k34Lds+g9ZaDSPDxV2o9DVl9dI0uN4gKUaNEG9OsKG5Q== 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=1721875620; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eSByOOLEkwGY/UdssFThIW9G4+Mh8EqxD941c9oI2Kw=; b=ctwELc5uZuYQRTICbbMc8IkwEZB6/v3xoXErxnF8FOYHl08JHjift/WVLmYjs1MHxt50zX 3DgZAV8kGN2gilFlaxpmyLzlNEWHaW0mhNXQiU9vlk2y+l2eCFb77sI2SHiRYrNxj845Q/ EiaWnSlycSdoKkTISWz/RbECI15dqw91ZwkJmTObnntOmAzQuYBXQFO7HUeBHeU0A08f78 CF7Ny3X75BqjVw0CKXv4JF7K8QxLS/5m9axIFwqsYYbC5aHCdzfsHVEECO+dqIkDPxIeS6 nwVJba/+X2QwJOv5fepSqI+Dsy1kHCVKUwOJ5ycwy4JbzETXXcPK0/RlCbKkEQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTwJh32xyzcbG; Thu, 25 Jul 2024 02:47:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P2l0Qh024979; Thu, 25 Jul 2024 02:47:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P2l0JL024976; Thu, 25 Jul 2024 02:47:00 GMT (envelope-from git) Date: Thu, 25 Jul 2024 02:47:00 GMT Message-Id: <202407250247.46P2l0JL024976@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: f68c4b4746f2 - main - nvme: Add bit names for nvme 2.0 for Async Events List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f68c4b4746f2fd24604374106c6bfc590e317f25 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=f68c4b4746f2fd24604374106c6bfc590e317f25 commit f68c4b4746f2fd24604374106c6bfc590e317f25 Author: Warner Losh AuthorDate: 2024-07-24 16:28:08 +0000 Commit: Warner Losh CommitDate: 2024-07-25 02:47:26 +0000 nvme: Add bit names for nvme 2.0 for Async Events NVME 2.0 has defined a number of new bits for async events. Add defines for them. Sponsored by: Netflix --- sys/dev/nvme/nvme.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 1db50d24c259..5a18d69c96f4 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -648,8 +648,16 @@ enum nvme_critical_warning_state { NVME_CRIT_WARN_ST_PERSISTENT_MEMORY_REGION = 0x20, }; #define NVME_CRIT_WARN_ST_RESERVED_MASK (0xC0) -#define NVME_ASYNC_EVENT_NS_ATTRIBUTE (0x100) -#define NVME_ASYNC_EVENT_FW_ACTIVATE (0x200) +#define NVME_ASYNC_EVENT_NS_ATTRIBUTE (1U << 8) +#define NVME_ASYNC_EVENT_FW_ACTIVATE (1U << 9) +#define NVME_ASYNC_EVENT_TELEMETRY_LOG (1U << 10) +#define NVME_ASYNC_EVENT_ASYM_NS_ACC (1U << 11) +#define NVME_ASYNC_EVENT_PRED_LAT_DELTA (1U << 12) +#define NVME_ASYNC_EVENT_LBA_STATUS (1U << 13) +#define NVME_ASYNC_EVENT_ENDURANCE_DELTA (1U << 14) +#define NVME_ASYNC_EVENT_NVM_SHUTDOWN (1U << 15) +#define NVME_ASYNC_EVENT_ZONE_DELTA (1U << 27) +#define NVME_ASYNC_EVENT_DISCOVERY_DELTA (1U << 31) /* slot for current FW */ #define NVME_FIRMWARE_PAGE_AFI_SLOT_SHIFT (0) From nobody Thu Jul 25 02:47:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTwJj4vwRz5RX6N; Thu, 25 Jul 2024 02:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTwJj4C7nz4FNC; Thu, 25 Jul 2024 02:47:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721875621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+HPB+pAuXpR6QWGHCQiyrDPiBrocKcxPwAeT1bXqSKc=; b=Fsyy+yrQ9D0ozeNhGJEjG+RIkj+DgIf8Z+jvcCpDmYaqcFd+ROtKxXvYdjQy498UpvV16J TORoVhS1wZdfshmqtDPySWt2epuanuykUTE1c+Gg/InT4M1bw8oa1sA9bnXuQaJV9Sy37b 3+6fWCTKv96+jKRju+URW9DXYURrbDTpwLroGciXc5NJ3uHbYGLkaZlD5Vq1wf2EClpuL/ bbXXP+I3IPdf03RbgyDCdLkgEN41gGMmcGHsGCFSDeENEMYbg56w0Rut/yEXSpHTDdyRwT KSIbPSAMGrR/UsbTOuIMHA9/RZ3AwF2pVXSy8xxBtQmxyx6AiM/3fjAfDGYnqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721875621; a=rsa-sha256; cv=none; b=mQ/GdPJbOZNpvRoZBybzEbRJAOzZUL7k6Nn2gGJmML54r0hNfoK6iloeJUsQIifZ+/FHVz fkkIHwKc85DiSWknMcbGil5/b8fR5IhndIzozdmqa9lRCwxs80UyhJSRI1/TXhNup3UGNJ JSQQSyxXQU1Vq2D8ipYpyi2bsDP3hQboyiVvi/fUToAd1kp8K5zTRVKXesca8vmvz6+nGd zS7xLWEZyhKGqhosDr5hq1AZQ4eoGBRvSjjT+eQaNCwbCQTwZWR7932jivNNPKC4FbPlNz bSBfErYhE0Y36kYC6AktxnMWQ9RF/CFUR4ymqMPl/K8V5NxTkEvaAUNOCX/NJg== 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=1721875621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+HPB+pAuXpR6QWGHCQiyrDPiBrocKcxPwAeT1bXqSKc=; b=kgLVqQQdEZtsmfoEi4vvWYTFLKyf96xGqMinQvL6lj95MTJmGLR2ftoZf0iu2rIapBqlYg C0AG7VhmYDx218vVKu0pYmzQqponpT9NGuC2eZAmf3+T5+vrAPKkBoY2l/oLB/18tRxQrK R7z9Sica7i49JOJhAFXCltmey7zr4PICO6hTtDlUXzBF/MF8Bhb+GRU1VdMxeyVTsgvVF/ pi9LUcPphIZWnmnSjKqJe4qxsEVB5xItDIbQF28DEF+ZOpJEUrzM3LbIkQscq6bzX9Rwo3 4JoDcNCB4D76IRWCBjjHpMFzhZZzyhU6SEj+AiF47ZpKo74iiupS+mpvY7tUjg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTwJj3p88zd20; Thu, 25 Jul 2024 02:47:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P2l1pE025032; Thu, 25 Jul 2024 02:47:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P2l1PY025029; Thu, 25 Jul 2024 02:47:01 GMT (envelope-from git) Date: Thu, 25 Jul 2024 02:47:01 GMT Message-Id: <202407250247.46P2l1PY025029@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 4a0b7955fd72 - main - cross-build: Move fcntl.h workaround to Linux specific file List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a0b7955fd727754b853f6a346b8379e21bcb81f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4a0b7955fd727754b853f6a346b8379e21bcb81f commit 4a0b7955fd727754b853f6a346b8379e21bcb81f Author: Warner Losh AuthorDate: 2024-07-25 02:46:35 +0000 Commit: Warner Losh CommitDate: 2024-07-25 02:47:26 +0000 cross-build: Move fcntl.h workaround to Linux specific file Move the cdefs.h inclusion to the Linux specific file. Either place will work, but it makes more sense to do it in the Linux specific file since it's a Linux specific workaround. Fixes: 4300e053618f Suggested by: arichards, jrtc27 Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D45373 --- tools/build/cross-build/include/linux/fcntl.h | 7 +++++++ tools/build/fcntl.h | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/build/cross-build/include/linux/fcntl.h b/tools/build/cross-build/include/linux/fcntl.h index aafcfe43a325..e5718ce5e3ed 100644 --- a/tools/build/cross-build/include/linux/fcntl.h +++ b/tools/build/cross-build/include/linux/fcntl.h @@ -44,3 +44,10 @@ #include "__unused_workaround_end.h" #include + +/* + * On FreeBSD fcntl.h indirectly brings in cdefs.h. On Linux with musl, it does + * not. It's needed in our fcntl.h for the cross build since we use + * __BEGIN_DECLS and __END_DECLS from it there. + */ +#include diff --git a/tools/build/fcntl.h b/tools/build/fcntl.h index f59f5f7fb20a..6aaf3eef2804 100644 --- a/tools/build/fcntl.h +++ b/tools/build/fcntl.h @@ -29,13 +29,6 @@ #include_next -/* - * On FreeBSD fcntl.h indirectly brings in cdefs.h. On Linux with musl, it does - * not. Unconditionally inlude it here since there's no harm in including it - * multiple times since we use __BEGIN_DECLS and __END_DECLS from it below. - */ -#include - struct spacectl_range { off_t r_offset; off_t r_len; From nobody Thu Jul 25 02:47:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTwJk62Z1z5RX6R; Thu, 25 Jul 2024 02:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTwJk4xNHz4FcT; Thu, 25 Jul 2024 02: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=1721875622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gRbpCKz6Jllz4TCU8T+zgJSOGXlDVIxU4H5MiBPhbVk=; b=Ie76GhtdC8sWGAAFMEzaWbTupzA52+eLh2fukcf8Z1gFgkediMrQ60LdRawowG/ST9DsVa qHxYs4WeUBLRtGXTIlZH3yyUoBCCfyftNQnQU4+BS4WFHEfCrKJ2wjuCbeQtEY2Kp9S/tZ gQhNyrXkG9ChTQjen+4IRUwz8m5oM35wQFPY/3H6EHTEqmgFBnAsEGoq0oLSPVQvVZdj/6 sb5wKHujj7U1otj6ys/5J2uSGbJVVQrIyAlpxzqbudmPjb6nGhOUk8WbfrY9g0Dl9w3gMI 1N/AIt+rqusfBuWec0gU8xeOS/ttrxFLr6uD9zzMwW73NiMAJkvC5APaKdvhog== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721875622; a=rsa-sha256; cv=none; b=l8l2N9pnhHMIYH1GZh0fjjVvtCAGefTn86B9+fWEjNzzaXgAOriFwgUzVggvOXBTuNPEmF UOqL9zHH7c9LXb8Elt4DNYQfsccdYxDSEoE5ZBOYG7csZCZZuRY1t9MtWklu7a4VBppDcj qvrYCn7ZPCRI6xUHim+bS/laePbsFMN6mQmNdDz/qPdRgsqNYVQsRfIaEAKKOHmKnYkbVb 9bQRI+gyTWyxa93tYxwnzzPo5CtjOK2+uoaVc0C9a3VpiIvYAxwSxWi7Etbzt+jlJIDjdK nwUzIhld1L9ezawoKEvmQwx1Q9JvBPAuvBAI0xqmoFBXJnwn9ej5PzqoeaFT2Q== 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=1721875622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gRbpCKz6Jllz4TCU8T+zgJSOGXlDVIxU4H5MiBPhbVk=; b=fnjuxs81mNDIvdCwwFwSP1kXY4vaTg+FSh7kxBqvr7FHFYfxcRCiX/XFbmPxGETTHR9gvm VA5peECVV278lUq8BdXF+fhnrIGCmi4VFd4gz56Wz62vTI2OuwWQ+I5FK09F8StzzN3z+7 +4EgfC3+5e1mI2//YFguSZqK9xIlUZaApZ3/VY+/gB93d7tKJT/Ksw9ksT6g0hHRj1M4/v 4+6vzMyjdOK2v/Q31nddZF/AtLGG+QbRTR8+K1HlvXZRYUh4aBIm/inEj4EwN8vGoWD7Fa JxGL2Yq2k6YD6+ArtuCbrs9QTj091TFswQjRJcHz+G/yAnoHWNPdSXL+9IKfdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTwJk4Xp3zd4H; Thu, 25 Jul 2024 02:47:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P2l2gw025092; Thu, 25 Jul 2024 02:47:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P2l2Aw025089; Thu, 25 Jul 2024 02:47:02 GMT (envelope-from git) Date: Thu, 25 Jul 2024 02:47:02 GMT Message-Id: <202407250247.46P2l2Aw025089@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 744991d495b2 - main - cross-build: progname.c is used only on linux, so no ifdefs needed List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 744991d495b28ea157a94e139224140687ec19ed Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=744991d495b28ea157a94e139224140687ec19ed commit 744991d495b28ea157a94e139224140687ec19ed Author: Warner Losh AuthorDate: 2024-07-25 02:46:43 +0000 Commit: Warner Losh CommitDate: 2024-07-25 02:47:26 +0000 cross-build: progname.c is used only on linux, so no ifdefs needed The logic in the makefile ensures this is only present on Linux, so no ifdef is needed. I overlooked comments to the effect in the original pull request somehow. Fixes: 0e03402139da Suggested by: arichards, jrtc27 Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D45374 --- tools/build/cross-build/progname.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/build/cross-build/progname.c b/tools/build/cross-build/progname.c index 6d396dadb67a..b7163f23fb2a 100644 --- a/tools/build/cross-build/progname.c +++ b/tools/build/cross-build/progname.c @@ -36,7 +36,6 @@ #include #include -#ifdef __linux__ extern const char *__progname; const char * getprogname(void) @@ -48,4 +47,3 @@ setprogname(const char *progname) { __progname = progname; } -#endif /* __linux__ */ From nobody Thu Jul 25 02:47:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTwJm1W5Vz5RX75; Thu, 25 Jul 2024 02:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTwJl5zqwz4Fcg; Thu, 25 Jul 2024 02:47:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721875623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eAdZ5AgTACo9t1DpTN5fbyVXIXhTlPRTJln1lk4RNdk=; b=ve38we0jTOGUvC6BV7XF+m6vxzvTc6OG6NtQC1L6K7Xhg4AuYvHJkibLf403+COR0vQ0yO lTyS+oDe0lDAQQ4iDLcPeomtNx/vdDhGhpwVa+mgXeog5DW0195P0YQX9+0GIBJPzLWQcY ZwBbpAif2NJfdsqPCxEsCEQ7X6WjHPrEngrfxxSMkE9hEltxZ3Sb+5d+d6YwIdCc/B90vy MJtygI0CuwFt3I4EhCrV8xgoTJbFhzjZ4hlg9GBB2J4FyngKaLMmdn+YnxNjpHlkewIIKp 0/f5ezpwD6LLEy9ACoA8+2YDu88QfXu2q+9p5uihRK8qqImszApqx3iIb+bNDQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721875623; a=rsa-sha256; cv=none; b=QzmZWoEj5Ev9ez2uqsVe7iDJUlCm/BjoFLIo/2o7ormdbnpKh3BF/T6td+aTMGdbBRHlhp N3oDCy0CnDSGuJCvyoDR5th7RXo183f60JaJGHYYlBvBKUxcl5F0mZVrLacdLv/1yElYn1 osm+cQOZgPIhLYbbZ1rf+LDyzWzk3XFAhPENXTGtOEMNLs5ZWJGK2ejK/2DXnP8qScbTiC nPGJpan/JUuqvNRIg9NtV7ob1ZT1t4KBJEFkECwAQXmATaYLa96HQ8t0ICz/QPcIsuE4sC nLC47V807fp3RXkbHpVJ9/sLC4FvvV5jKXxHbQ/WHIeu2HgHl+bazzcy/ImOcw== 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=1721875623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eAdZ5AgTACo9t1DpTN5fbyVXIXhTlPRTJln1lk4RNdk=; b=fF8JKsAiJOyxBvGmEaAmBhBOnM5k18Fz+2OuSRnVB+AxjXKLizN2jhhlfx8x+fXfxletmJ 6JGrFNqsepRVkq9OySt6T0XZiVAKrK/5Eb05PrSniv3qyPrjsd7arSRA1tkFf3ojXrkTk/ nPaJZAmXUFTFX96OjutirTEa81aUWCb/gC4iMV+qvsRN/x5p89t+r5BbXeDeEqF7V5Kp1g 0VEApva/TfW45ZWcBUxiQY4niGdpctJ0bXklOfEQaewkEmqea9M/9R6fOcxBTPHGv418Zj wtbG33Nojw2xloXYouleoyn9/NXYgxqXYoKHRH+4WiVP85pIug7lt5SJwnS9aQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTwJl5bzNzdJd; Thu, 25 Jul 2024 02:47:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P2l3aN025143; Thu, 25 Jul 2024 02:47:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P2l3ob025140; Thu, 25 Jul 2024 02:47:03 GMT (envelope-from git) Date: Thu, 25 Jul 2024 02:47:03 GMT Message-Id: <202407250247.46P2l3ob025140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 18cf1e502321 - main - cross-build: Define DEFFILEMODE and ALLPERMS if not defined List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 18cf1e502321f98f2391244c4b9de84fcaf11371 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=18cf1e502321f98f2391244c4b9de84fcaf11371 commit 18cf1e502321f98f2391244c4b9de84fcaf11371 Author: Warner Losh AuthorDate: 2024-07-25 02:46:49 +0000 Commit: Warner Losh CommitDate: 2024-07-25 02:47:26 +0000 cross-build: Define DEFFILEMODE and ALLPERMS if not defined GLIBC defines these, but MUSL does not. FreeBSD's bootstrap code uses these defines, so define them if they aren't yet defined. Co-authored-by: Val Packett Sponsored by: Netflix Pull Request: https://github.com/freebsd/freebsd-src/pull/1066 Differential Revision: https://reviews.freebsd.org/D45375 --- tools/build/cross-build/include/linux/sys/stat.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/build/cross-build/include/linux/sys/stat.h b/tools/build/cross-build/include/linux/sys/stat.h index fa40b7e747b6..5937920ce461 100644 --- a/tools/build/cross-build/include/linux/sys/stat.h +++ b/tools/build/cross-build/include/linux/sys/stat.h @@ -58,5 +58,13 @@ #define S_ISTXT S_ISVTX #endif +#ifndef DEFFILEMODE +#define DEFFILEMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) +#endif + +#ifndef ALLPERMS +#define ALLPERMS (S_ISUID | S_ISGID | S_ISTXT | S_IRWXU | S_IRWXG | S_IRWXO) +#endif + /* This include is needed for OpenZFS bootstrap */ #include From nobody Thu Jul 25 03:18:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTx1C00Hrz5RZr1; Thu, 25 Jul 2024 03:18: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTx1B6gTgz4JtB; Thu, 25 Jul 2024 03:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721877518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IlGIr8aP595s0bLmKoRwBEFmQ+NWFlVJ+tSEalIT95Q=; b=xFfmKljGUuXJL/q/jKvE7pMkz/aSzcYOqtAR7vgVYymCaqRy1ICineF2yrdtDD9rIwzTQj MGTN/i5nbSMS41vusydD8NFR2CFlbY1Lxu7Mw7EPJUsfwQTpnGEAjclt2nEOxjMdX/spcU jKFMmmkgN36XYHH46AtdlQ3Pk9WLJg4eabCcMu/ljGeYFj1RLy3dEqt5iF7q7VSP3yX8+q ptH89CDc7jbbrTrP4UivdY3ahYHxiIDeTN/iXmiFuYyiiTobSjkxH2A/fGRp5xZ4+oY9BJ SQbh5n9hAgxohAv3RHb5iC38zBUBEu6Q4j0X/SZzSRq+aWn8CVklTFZ7kgEp2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721877518; a=rsa-sha256; cv=none; b=wQvkzmjgts8H/RBPiDuKF9V88dRfGNrZ6qlCc6mtmGizLdKO+z+7nytzKajCi4Kip4YP8P EVPyS3N9EVDtsZaqwjk37VCAnYHylWUAwSbbi0cpVYLXVHGEHJzii0Ed1WS+praZ3+nV7/ MOJLoftp/tJzUeiQuImkB5Z+JSxYABvtK75ekUG0WI/8+ZDCVilf+kXO1nzQcvmAmdTSZA 9rygFC7CqB52DeK8oHSbMeHg7Bm8Gh6U9zZfPCEkRLgVRt6ox/h414L9+nMrEpV7MgDila EtLRFmppRZqzC/Qz61iugFgbiN3YzUnUreKhBVrqj08RenHWipRjuSrbaRWEIw== 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=1721877518; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IlGIr8aP595s0bLmKoRwBEFmQ+NWFlVJ+tSEalIT95Q=; b=GsjQUbzdVly9tzstAoG95A/kleCMNo+U2kesYd3uYf+Aw9sI20f7tr+Vw1dhfc+On29+JA vpvbPN0ieVOOiVxpSzrd035tHvUQgKjHeZf9B0AoZd+h6Qt8mpW9THB6j5It+T3MTfWwan u0Ic5LBST3MgKtHRL2jjkAFtrhB25iVewfZqnhSxeYGqGYWkkBSSCwbIni9lmO5vOvnq0Y 5YQja2sim/1qAnJ/gdMuox0FkkWc+RvQJ3m3yFx5UlJnTSh3978OnDHmUw12Pk2wMJeGtn TTFmgZlYLnDrWDwHGaH62bk6HGKkZ/y4HHBW//d29B1MnlCQLGy+zT0F0rGLig== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTx1B6HcRzdx5; Thu, 25 Jul 2024 03:18:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P3IcqM078242; Thu, 25 Jul 2024 03:18:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P3IcUC078239; Thu, 25 Jul 2024 03:18:38 GMT (envelope-from git) Date: Thu, 25 Jul 2024 03:18:38 GMT Message-Id: <202407250318.46P3IcUC078239@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 195a96f0b303 - main - stand: Stop building in fat, ext2fs, gzip and bzip to BIOS /boot/loader List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 195a96f0b303345818e09ad1d79dc80122804de8 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=195a96f0b303345818e09ad1d79dc80122804de8 commit 195a96f0b303345818e09ad1d79dc80122804de8 Author: Warner Losh AuthorDate: 2024-07-25 03:15:28 +0000 Commit: Warner Losh CommitDate: 2024-07-25 03:15:28 +0000 stand: Stop building in fat, ext2fs, gzip and bzip to BIOS /boot/loader This saves space to allow pxeboot to work again. Users desiring these features can turn them on for their custom build. While these are useful for some specialized applications, they aren't needed to boot the typical system, and we're low on space. text data bss dec hex filename Before: 465866 20740 31612 518218 0x7e84a loader_lua.bin After: 441535 17484 31092 490111 0x77a7f loader_lua.bin Savings: 28,107 bytes Sponsored by: Netflix Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D42416 --- stand/i386/loader/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile index ab446d67225b..a4aa3a3c4d45 100644 --- a/stand/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -4,11 +4,11 @@ LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes LOADER_TFTP_SUPPORT?= yes LOADER_CD9660_SUPPORT?= yes -LOADER_EXT2FS_SUPPORT?= yes -LOADER_MSDOS_SUPPORT?= yes +LOADER_EXT2FS_SUPPORT?= no +LOADER_MSDOS_SUPPORT?= no LOADER_UFS_SUPPORT?= yes -LOADER_GZIP_SUPPORT?= yes -LOADER_BZIP2_SUPPORT?= yes +LOADER_GZIP_SUPPORT?= no +LOADER_BZIP2_SUPPORT?= no .include From nobody Thu Jul 25 04:49:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTz1W2grZz5RFgp; Thu, 25 Jul 2024 04:49: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTz1W1Jpjz4WwZ; Thu, 25 Jul 2024 04:49:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721882943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4toVWPwWMfyik/CkKV7cSVeVnnAAfiz99xwSpWNG6cs=; b=oEZPbENZ+qhE6zv7XZcLisxAqqoW23gJFuIOVF1pkCIhLCRtaZjv7ZD4/JoD5p1sZp7fAJ 7YXqcmlc2yngB8+/LCM34t/HtJ1Ab0FU//NUDq3wJkOoy8JVJIWOETUcHsc8T5iM0u/Wwg 7Y+cM/6aJQ8DY7fLmWY4xVsWDmpsEGBQ8Jx0KncmpUr9s7tbwKkNRLwifPnWqq7+2Neosl au+XJcZnGg69uWsElPpemQ249rg1VW8kzmDYFf46qdIyBR2VFERLJQzziGM3jOqnoDoU/b UcryoSSTbrwbicrIAkEu2BrJXczSwcLQl4CEzHr8X7LEgVVgBcrVKXVz3RIxbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721882943; a=rsa-sha256; cv=none; b=q4R45XwxhnsHR3eO5GH1Qu3rjeVt2Ai+QpZI6I0a4NFWiQvdCBiJdmsEz8IGgLGP4cE2mH sviu+0nhpfZocKgKUEm3RJnWl2sv5H2EnbuA4+8rL8Yeid6FTFKdjrEYoiPDX46imLf3KM fWXfYUiYhqcGdybbl2DnA3UKeScgT9GdlFCHnn+KjE+Ok7CoLFRVG8aA1VsXSwoeslWiwn SPZXLsFgAr8HYJOE2x0gUZBOCrfQ2f1bQJ2+YHV4RfTeTquT+WRlyBCcWmAbcw0kM6Eu4Z oF9cpqzsa80fkVGgOBr0LWYZqySwXZFyt7wZ//MIVqZMmld41V7EHrxoVYX1eQ== 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=1721882943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4toVWPwWMfyik/CkKV7cSVeVnnAAfiz99xwSpWNG6cs=; b=HZoIg3MQUY0kmNmZbvKK5DE7jsLS1zl6aKTo37yWj3T9nYcPvrlws4yhy6y7YnJtORiF0u tgkXKwtg+ccVZ3NEGo2WK5NcXIW91qzciVeV7YOXkf/ib43rF63PBpjkCCySmx5EfDR+MJ ITXjehA/fxhfcA7+jLza/eGOdfWgp3peZPdcgZBTO6BLspVqyVgmY08/MnZFwy5tpahkSf JAQ+Ndi7T4Vsg/gzeiWUgSdSBdM+ukaxf8oT3o724e0/XDeZRHm/lVeojE5JoA3f77meqQ TBqEVULBdV3V6A4GxwQTaskcNn+dWkS40W9V0sJ/yoX5kewBzDkkM+hV5b89PA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTz1W0x79zgSK; Thu, 25 Jul 2024 04:49:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P4n34e031952; Thu, 25 Jul 2024 04:49:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P4n3I1031949; Thu, 25 Jul 2024 04:49:03 GMT (envelope-from git) Date: Thu, 25 Jul 2024 04:49:03 GMT Message-Id: <202407250449.46P4n3I1031949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 29d13f3d06de - main - newbus: Document new DEVICE_UNIT_ANY List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29d13f3d06dec06a2fc9636ca8308c0462f80cfc Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=29d13f3d06dec06a2fc9636ca8308c0462f80cfc commit 29d13f3d06dec06a2fc9636ca8308c0462f80cfc Author: Warner Losh AuthorDate: 2024-07-25 04:22:55 +0000 Commit: Warner Losh CommitDate: 2024-07-25 04:22:55 +0000 newbus: Document new DEVICE_UNIT_ANY In the past, device_add_child took a -1 to mean any unit. Document it now taking DEVICE_UNIT_ANY. Sponsored by: Netflix --- share/man/man9/device_add_child.9 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man9/device_add_child.9 b/share/man/man9/device_add_child.9 index 423869d6ff6b..dfd0d19049bc 100644 --- a/share/man/man9/device_add_child.9 +++ b/share/man/man9/device_add_child.9 @@ -51,7 +51,7 @@ arguments specify the name and unit number of the device. If the name is unknown then the caller should pass .Dv NULL . If the unit is unknown then the caller should pass -.Dv -1 +.Dv DEVICE_UNIT_ANY and the system will choose the next available unit number. .Pp The name of the device is used to determine which drivers might be @@ -70,7 +70,7 @@ be specified as the device name. .Pp Normally unit numbers will be chosen automatically by the system and a unit number of -.Dv -1 +.Dv DEVICE_UNIT_ANY should be given. When a specific unit number is desired (e.g.,\& for wiring a particular piece of hardware to a pre-configured unit number), that unit should From nobody Thu Jul 25 04:49:04 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTz1X4d2Vz5RF29; Thu, 25 Jul 2024 04:49: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTz1X32XWz4X1t; Thu, 25 Jul 2024 04:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721882944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QkC7WR0cD2P1BVJRIZnFMhQh7Sfi2MWplIlAhdUFUWY=; b=VYbCjPny3/1yPGMb4L2dyNFwE8Y+9gLHzamwxiZAD2ApxXM0R6QuflFF7k9uv4QT62JHg3 wBxdvAaoSiE4Y2QGeLit7psXzuho1OXJpm+MTH0AzP2oIfDjrly257B9JZdnKVn/t4/6Ay 1tKEXTLcnhTF0GB8BAJ2UcYRBhLQycYyrmao8uM6TVN9rzNuJBqmk/ZZdxa/bQvHya3nms ++76oYoZbDiIEbkRB1bwU+RBkXAFsOfgf8TpoZW5YmqWl6OrC+Fmc33lIMeyqSVb+mYIaO gFA/CyMESM+BWg9CWvnqZW4zoPu82z2oIAEU3aq/xrFhGO7ZsJdyByv46e/tLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721882944; a=rsa-sha256; cv=none; b=iGxBs5eABtiKfx6J84OF0uMopUeeI0w9moUNmumVFUaPP7e9DeD3zSbFTMnBA7alcq7pYc C32KAX3QhD0Bmxoz+oloepIFTf0179un4GtdCkf17ZC2cSv8yneOqEbQxRhTk0TwG3W3LP zlfVPWg7A5jjcwx58TOQ+yh59EOZ/0i6U/+T/yj89VPN5xp6+MOvzD115wCFfNXLFia7ib WD9WJp0UseB4iZGP+NzOBkRnENNzlEeegvQOz3iyQdKdFkdWyYdw/RxOaWS6+exfClfFNs M2NtToLVZ6UqzU5mLnk99VzxG9wKUSCLxr6ZMgpIs4p3UHun1nzYjYOQC1Vb8A== 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=1721882944; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QkC7WR0cD2P1BVJRIZnFMhQh7Sfi2MWplIlAhdUFUWY=; b=jfwhwxUIXSTB6F7/7xvMKzI2Q58IxmFN/YutSlcuiaT9+vZ3krW6WlitfX4GPsah+EjjNW 4eefEBsLNTG8u/3C/cBPdKdmUheo0iVYKDkC7HyTrj/YS0rFyc+n+Zm+miro59ZziX/Uf9 YfYNslkhm4fndhX0SYUEyuMOd2pQYfg8nDDYQQNdQfiJTGKjciTs63wgdl8CsGMvGroNay VipN+XeDCrECP96fqjwx9RryNwmrlGg7Wt9tGKJnksG+Ra+NQi3vaXmDCW4459AS4XdOGH 6iR2GIjQWsYXL+u9PdPj/aIFKWjMDbg1EviN9ruJ5ZlEYws4c+Yc6PDECt0VEw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTz1X2TYjzh8B; Thu, 25 Jul 2024 04:49:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P4n4Gv032004; Thu, 25 Jul 2024 04:49:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P4n4Dn032001; Thu, 25 Jul 2024 04:49:04 GMT (envelope-from git) Date: Thu, 25 Jul 2024 04:49:04 GMT Message-Id: <202407250449.46P4n4Dn032001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 5b56413d04e6 - main - newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANY List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b56413d04e608379c9a306373554a8e4d321bc0 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5b56413d04e608379c9a306373554a8e4d321bc0 commit 5b56413d04e608379c9a306373554a8e4d321bc0 Author: Warner Losh AuthorDate: 2024-07-25 04:22:58 +0000 Commit: Warner Losh CommitDate: 2024-07-25 04:22:58 +0000 newbus: globally replace device_add_child(..., -1) with DEVICE_UNIT_ANY Sponsored by: Netflix --- sys/arm/allwinner/aw_mmc.c | 2 +- sys/arm/allwinner/aw_rsb.c | 2 +- sys/arm/arm/gic_acpi.c | 2 +- sys/arm/arm/gic_fdt.c | 2 +- sys/arm/broadcom/bcm2835/bcm2835_bsc.c | 2 +- sys/arm/broadcom/bcm2835/bcm2835_spi.c | 2 +- sys/arm/broadcom/bcm2835/bcm2838_pci.c | 2 +- sys/arm/freescale/imx/imx_i2c.c | 2 +- sys/arm/freescale/imx/imx_spi.c | 2 +- sys/arm/freescale/vybrid/vf_ehci.c | 2 +- sys/arm/mv/a37x0_iic.c | 2 +- sys/arm/mv/a37x0_spi.c | 2 +- sys/arm/mv/mv_pci.c | 4 +- sys/arm/mv/mv_pci_ctrl.c | 2 +- sys/arm/mv/mv_spi.c | 2 +- sys/arm/nvidia/tegra_ehci.c | 2 +- sys/arm/nvidia/tegra_i2c.c | 2 +- sys/arm/nvidia/tegra_pcie.c | 2 +- sys/arm/nvidia/tegra_xhci.c | 2 +- sys/arm/ti/am335x/am335x_musb.c | 2 +- sys/arm/ti/am335x/am335x_scm.c | 2 +- sys/arm/ti/ti_spi.c | 2 +- sys/arm/ti/usb/omap_ehci.c | 2 +- sys/arm/xilinx/zy7_ehci.c | 2 +- sys/arm/xilinx/zy7_qspi.c | 2 +- sys/arm/xilinx/zy7_spi.c | 2 +- sys/arm64/arm64/gic_v3_acpi.c | 2 +- sys/arm64/arm64/gic_v3_fdt.c | 2 +- sys/arm64/broadcom/brcmmdio/mdio_mux_iproc.c | 2 +- sys/arm64/broadcom/brcmmdio/mdio_nexus_iproc.c | 2 +- sys/arm64/cavium/thunder_pcie_pem.c | 2 +- sys/arm64/rockchip/rk_pcie.c | 2 +- sys/dev/aac/aac.c | 2 +- sys/dev/aacraid/aacraid.c | 4 +- sys/dev/acpica/acpi_video.c | 2 +- sys/dev/adb/adb_bus.c | 2 +- sys/dev/agp/agp_i810.c | 2 +- sys/dev/ahci/ahci.c | 6 +- sys/dev/alpm/alpm.c | 2 +- sys/dev/amdpm/amdpm.c | 2 +- sys/dev/amdsmb/amdsmb.c | 2 +- sys/dev/amdsmn/amdsmn.c | 2 +- sys/dev/amdtemp/amdtemp.c | 2 +- sys/dev/ata/chipsets/ata-jmicron.c | 2 +- sys/dev/ata/chipsets/ata-marvell.c | 2 +- sys/dev/cardbus/cardbus.c | 2 +- sys/dev/cfi/cfi_core.c | 2 +- sys/dev/cxgbe/crypto/t4_crypto.c | 2 +- sys/dev/cxgbe/t4_main.c | 2 +- sys/dev/cxgbe/t4_vf.c | 2 +- sys/dev/drm2/drm_dp_iic_helper.c | 2 +- sys/dev/etherswitch/miiproxy.c | 2 +- sys/dev/exca/exca.c | 2 +- sys/dev/gpio/gpiobus.c | 2 +- sys/dev/gpio/gpioiic.c | 2 +- sys/dev/gpio/gpiospi.c | 2 +- sys/dev/gpio/ofw_gpiobus.c | 2 +- sys/dev/hyperv/pcib/vmbus_pcib.c | 2 +- sys/dev/hyperv/vmbus/vmbus.c | 5 +- sys/dev/hyperv/vmbus/vmbus_et.c | 2 +- sys/dev/ichiic/ig4_iic.c | 2 +- sys/dev/ida/ida.c | 2 +- sys/dev/iicbus/controller/opencores/iicoc_fdt.c | 2 +- sys/dev/iicbus/controller/opencores/iicoc_pci.c | 2 +- sys/dev/iicbus/controller/rockchip/rk_i2c.c | 2 +- sys/dev/iicbus/controller/vybrid/vf_i2c.c | 2 +- sys/dev/iicbus/iicbb.c | 2 +- sys/dev/iicbus/iichid.c | 2 +- sys/dev/iicbus/iicsmb.c | 2 +- sys/dev/iicbus/mux/iicmux.c | 4 +- sys/dev/iicbus/ofw_iicbus.c | 2 +- sys/dev/imcsmb/imcsmb.c | 2 +- sys/dev/imcsmb/imcsmb_pci.c | 2 +- sys/dev/intel/spi.c | 2 +- sys/dev/intpm/intpm.c | 2 +- sys/dev/ips/ips.c | 2 +- sys/dev/mfi/mfi.c | 2 +- sys/dev/mge/if_mge.c | 2 +- sys/dev/mii/mii.c | 4 +- sys/dev/mlx/mlx.c | 2 +- sys/dev/mmc/host/dwmmc.c | 2 +- sys/dev/mmc/mmc.c | 2 +- sys/dev/msk/if_msk.c | 4 +- sys/dev/mvs/mvs_pci.c | 2 +- sys/dev/mvs/mvs_soc.c | 2 +- sys/dev/neta/if_mvneta.c | 2 +- sys/dev/nfsmb/nfsmb.c | 6 +- sys/dev/ntb/ntb.c | 2 +- sys/dev/ntb/ntb_transport.c | 2 +- sys/dev/ofw/ofw_cpu.c | 2 +- sys/dev/ofw/ofw_pcib.c | 2 +- sys/dev/ow/ow.c | 2 +- sys/dev/ow/owc_gpiobus.c | 2 +- sys/dev/pccbb/pccbb_pci.c | 2 +- sys/dev/pci/controller/pci_n1sdp.c | 2 +- sys/dev/pci/hostb_pci.c | 2 +- sys/dev/pci/pci.c | 2 +- sys/dev/pci/pci_dw.c | 2 +- sys/dev/pci/pci_host_generic_acpi.c | 2 +- sys/dev/pci/pci_host_generic_fdt.c | 2 +- sys/dev/pci/pci_pci.c | 4 +- sys/dev/pci/vga_pci.c | 2 +- sys/dev/ppbus/lpbb.c | 2 +- sys/dev/ppc/ppc.c | 2 +- sys/dev/pst/pst-raid.c | 2 +- sys/dev/puc/puc.c | 2 +- sys/dev/pwm/controller/allwinner/aw_pwm.c | 2 +- sys/dev/pwm/controller/rockchip/rk_pwm.c | 2 +- sys/dev/quicc/quicc_core.c | 2 +- sys/dev/rtsx/rtsx.c | 2 +- sys/dev/scc/scc_core.c | 2 +- sys/dev/sdhci/sdhci.c | 2 +- sys/dev/sdio/sdiob.c | 2 +- sys/dev/siis/siis.c | 2 +- sys/dev/sk/if_sk.c | 4 +- sys/dev/sound/pci/csa.c | 4 +- sys/dev/sound/pci/emu10kx.c | 16 +- sys/dev/sound/pci/fm801.c | 2 +- sys/dev/sound/pci/hda/hdaa.c | 2 +- sys/dev/sound/pci/hda/hdac.c | 2 +- sys/dev/sound/pci/hda/hdacc.c | 2 +- sys/dev/sound/pci/hdspe.c | 2 +- sys/dev/sound/usb/uaudio.c | 2 +- sys/dev/spibus/controller/allwinner/aw_spi.c | 2 +- sys/dev/spibus/controller/rockchip/rk_spi.c | 2 +- sys/dev/spibus/ofw_spibus.c | 2 +- sys/dev/usb/controller/dwc3/dwc3.c | 2 +- sys/dev/usb/controller/dwc_otg.c | 2 +- sys/dev/usb/controller/dwc_otg_fdt.c | 2 +- sys/dev/usb/controller/ehci_fsl.c | 2 +- sys/dev/usb/controller/ehci_imx.c | 2 +- sys/dev/usb/controller/ehci_msm.c | 2 +- sys/dev/usb/controller/ehci_mv.c | 2 +- sys/dev/usb/controller/ehci_pci.c | 2 +- sys/dev/usb/controller/generic_ehci.c | 2 +- sys/dev/usb/controller/generic_ohci.c | 2 +- sys/dev/usb/controller/generic_xhci.c | 2 +- sys/dev/usb/controller/musb_otg_allwinner.c | 2 +- sys/dev/usb/controller/ohci_pci.c | 2 +- sys/dev/usb/controller/uhci_pci.c | 2 +- sys/dev/usb/controller/xhci_pci.c | 2 +- sys/dev/usb/input/usbhid.c | 2 +- sys/dev/usb/misc/cp2112.c | 6 +- sys/dev/usb/usb_device.c | 2 +- sys/dev/usb/video/udl.c | 2 +- sys/dev/viapm/viapm.c | 2 +- sys/dev/virtio/pci/virtio_pci.c | 2 +- sys/dev/vmd/vmd.c | 3 +- sys/dev/vnic/mrml_bridge.c | 2 +- sys/dev/vnic/thunder_mdio_fdt.c | 2 +- sys/dev/xen/pcifront/pcifront.c | 688 ++++++++++++++++++++++++ sys/isa/vga_isa.c | 2 +- sys/powerpc/mpc85xx/fsl_espi.c | 2 +- sys/powerpc/mpc85xx/i2c.c | 2 +- sys/powerpc/mpc85xx/lbc.c | 2 +- sys/powerpc/powermac/atibl.c | 2 +- sys/powerpc/powermac/cuda.c | 2 +- sys/powerpc/powermac/kiic.c | 2 +- sys/powerpc/powermac/macgpio.c | 2 +- sys/powerpc/powermac/macio.c | 2 +- sys/powerpc/powermac/nvbl.c | 2 +- sys/powerpc/powermac/pmu.c | 2 +- sys/powerpc/powermac/smu.c | 4 +- sys/powerpc/powermac/uninorth.c | 2 +- sys/powerpc/powernv/opal_console.c | 2 +- sys/powerpc/powernv/opal_dev.c | 2 +- sys/powerpc/powernv/opal_i2cm.c | 2 +- sys/powerpc/powernv/opal_sensor.c | 2 +- sys/powerpc/powernv/powernv_centaur.c | 2 +- sys/powerpc/powernv/powernv_xscom.c | 2 +- sys/powerpc/ps3/ehci_ps3.c | 2 +- sys/powerpc/ps3/ohci_ps3.c | 2 +- sys/powerpc/ps3/ps3bus.c | 6 +- sys/powerpc/pseries/vdevice.c | 2 +- sys/powerpc/psim/ata_iobus.c | 2 +- sys/powerpc/psim/iobus.c | 2 +- sys/riscv/sifive/sifive_spi.c | 2 +- sys/x86/pci/pci_bus.c | 2 +- sys/x86/pci/qpi.c | 2 +- sys/x86/x86/mptable_pci.c | 2 +- sys/xen/xenbus/xenbusb.c | 2 +- 181 files changed, 894 insertions(+), 206 deletions(-) diff --git a/sys/arm/allwinner/aw_mmc.c b/sys/arm/allwinner/aw_mmc.c index 929cbd8f3ed8..634afdfdfd46 100644 --- a/sys/arm/allwinner/aw_mmc.c +++ b/sys/arm/allwinner/aw_mmc.c @@ -328,7 +328,7 @@ aw_mmc_helper_cd_handler(device_t dev, bool present) if (__predict_false(aw_mmc_debug & AW_MMC_DEBUG_CARD)) device_printf(sc->aw_dev, "Card inserted\n"); - sc->child = device_add_child(sc->aw_dev, "mmc", -1); + sc->child = device_add_child(sc->aw_dev, "mmc", DEVICE_UNIT_ANY); AW_MMC_UNLOCK(sc); if (sc->child) { device_set_ivars(sc->child, sc); diff --git a/sys/arm/allwinner/aw_rsb.c b/sys/arm/allwinner/aw_rsb.c index fa599ddcb3dd..6ca6b3acbf8c 100644 --- a/sys/arm/allwinner/aw_rsb.c +++ b/sys/arm/allwinner/aw_rsb.c @@ -442,7 +442,7 @@ rsb_attach(device_t dev) /* Set the PMIC into RSB mode as ATF might have leave it in I2C mode */ RSB_WRITE(sc, RSB_PMCR, RSB_PMCR_REG(PMIC_MODE_REG) | RSB_PMCR_DATA(PMIC_MODE_RSB) | RSB_PMCR_START); - sc->iicbus = device_add_child(dev, "iicbus", -1); + sc->iicbus = device_add_child(dev, "iicbus", DEVICE_UNIT_ANY); if (sc->iicbus == NULL) { device_printf(dev, "cannot add iicbus child device\n"); error = ENXIO; diff --git a/sys/arm/arm/gic_acpi.c b/sys/arm/arm/gic_acpi.c index 8b79558da6e8..fa823320dcc9 100644 --- a/sys/arm/arm/gic_acpi.c +++ b/sys/arm/arm/gic_acpi.c @@ -280,7 +280,7 @@ madt_gicv2m_handler(ACPI_SUBTABLE_HEADER *entry, void *arg) device_printf(dev, "frame: %x %lx %x %u %u\n", msi->MsiFrameId, msi->BaseAddress, msi->Flags, msi->SpiCount, msi->SpiBase); - cdev = device_add_child(dev, NULL, -1); + cdev = device_add_child(dev, NULL, DEVICE_UNIT_ANY); if (cdev == NULL) return; diff --git a/sys/arm/arm/gic_fdt.c b/sys/arm/arm/gic_fdt.c index a8886abf1c18..7ebc4faaa862 100644 --- a/sys/arm/arm/gic_fdt.c +++ b/sys/arm/arm/gic_fdt.c @@ -292,7 +292,7 @@ arm_gic_add_children(device_t dev) ofw_bus_reg_to_rl(dev, child, sc->addr_cells, sc->size_cells, &dinfo->rl); - cdev = device_add_child(dev, NULL, -1); + cdev = device_add_child(dev, NULL, DEVICE_UNIT_ANY); if (cdev == NULL) { device_printf(dev, "<%s>: device_add_child failed\n", dinfo->obdinfo.obd_name); diff --git a/sys/arm/broadcom/bcm2835/bcm2835_bsc.c b/sys/arm/broadcom/bcm2835/bcm2835_bsc.c index 7d14a5c26c4d..6a9853a7b4f9 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_bsc.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_bsc.c @@ -342,7 +342,7 @@ bcm_bsc_attach(device_t dev) bcm_bsc_reset(sc); BCM_BSC_UNLOCK(sc); - sc->sc_iicbus = device_add_child(dev, "iicbus", -1); + sc->sc_iicbus = device_add_child(dev, "iicbus", DEVICE_UNIT_ANY); if (sc->sc_iicbus == NULL) { bcm_bsc_detach(dev); return (ENXIO); diff --git a/sys/arm/broadcom/bcm2835/bcm2835_spi.c b/sys/arm/broadcom/bcm2835/bcm2835_spi.c index fc488e349157..17419be0c8a7 100644 --- a/sys/arm/broadcom/bcm2835/bcm2835_spi.c +++ b/sys/arm/broadcom/bcm2835/bcm2835_spi.c @@ -298,7 +298,7 @@ bcm_spi_attach(device_t dev) bcm_spi_printr(dev); #endif - device_add_child(dev, "spibus", -1); + device_add_child(dev, "spibus", DEVICE_UNIT_ANY); return (bus_generic_attach(dev)); } diff --git a/sys/arm/broadcom/bcm2835/bcm2838_pci.c b/sys/arm/broadcom/bcm2835/bcm2838_pci.c index f5304525a6fb..0f41dcff37ca 100644 --- a/sys/arm/broadcom/bcm2835/bcm2838_pci.c +++ b/sys/arm/broadcom/bcm2835/bcm2838_pci.c @@ -744,7 +744,7 @@ bcm_pcib_attach(device_t dev) return (error); /* Done. */ - device_add_child(dev, "pci", -1); + device_add_child(dev, "pci", DEVICE_UNIT_ANY); return (bus_generic_attach(dev)); } diff --git a/sys/arm/freescale/imx/imx_i2c.c b/sys/arm/freescale/imx/imx_i2c.c index f8769d29e7f7..d8d7514c8c4b 100644 --- a/sys/arm/freescale/imx/imx_i2c.c +++ b/sys/arm/freescale/imx/imx_i2c.c @@ -413,7 +413,7 @@ i2c_attach(device_t dev) return (ENXIO); } - sc->iicbus = device_add_child(dev, "iicbus", -1); + sc->iicbus = device_add_child(dev, "iicbus", DEVICE_UNIT_ANY); if (sc->iicbus == NULL) { device_printf(dev, "could not add iicbus child"); return (ENXIO); diff --git a/sys/arm/freescale/imx/imx_spi.c b/sys/arm/freescale/imx/imx_spi.c index 0be15aa82771..388b25b7ec28 100644 --- a/sys/arm/freescale/imx/imx_spi.c +++ b/sys/arm/freescale/imx/imx_spi.c @@ -563,7 +563,7 @@ spi_attach(device_t dev) * devices as its children, and those devices may need to do IO during * their attach. We can't do IO until timers and interrupts are working. */ - sc->spibus = device_add_child(dev, "spibus", -1); + sc->spibus = device_add_child(dev, "spibus", DEVICE_UNIT_ANY); return (bus_delayed_attach_children(dev)); } diff --git a/sys/arm/freescale/vybrid/vf_ehci.c b/sys/arm/freescale/vybrid/vf_ehci.c index f9ee6ed17fc2..a3477c743997 100644 --- a/sys/arm/freescale/vybrid/vf_ehci.c +++ b/sys/arm/freescale/vybrid/vf_ehci.c @@ -331,7 +331,7 @@ vybrid_ehci_attach(device_t dev) } /* Add USB device */ - sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + sc->sc_bus.bdev = device_add_child(dev, "usbus", DEVICE_UNIT_ANY); if (!sc->sc_bus.bdev) { device_printf(dev, "Could not add USB device\n"); err = bus_teardown_intr(dev, esc->res[5], diff --git a/sys/arm/mv/a37x0_iic.c b/sys/arm/mv/a37x0_iic.c index 5b92175383f0..01fda1579bd6 100644 --- a/sys/arm/mv/a37x0_iic.c +++ b/sys/arm/mv/a37x0_iic.c @@ -230,7 +230,7 @@ a37x0_iic_attach(device_t dev) a37x0_iic_reset(sc); A37X0_IIC_UNLOCK(sc); - sc->sc_iicbus = device_add_child(dev, "iicbus", -1); + sc->sc_iicbus = device_add_child(dev, "iicbus", DEVICE_UNIT_ANY); if (sc->sc_iicbus == NULL) { a37x0_iic_detach(dev); return (ENXIO); diff --git a/sys/arm/mv/a37x0_spi.c b/sys/arm/mv/a37x0_spi.c index 4834eb095a17..4bcbbc503218 100644 --- a/sys/arm/mv/a37x0_spi.c +++ b/sys/arm/mv/a37x0_spi.c @@ -214,7 +214,7 @@ a37x0_spi_attach(device_t dev) maxfreq = 0; sc->sc_maxfreq = maxfreq; - device_add_child(dev, "spibus", -1); + device_add_child(dev, "spibus", DEVICE_UNIT_ANY); /* Probe and attach the spibus when interrupts are available. */ return (bus_delayed_attach_children(dev)); diff --git a/sys/arm/mv/mv_pci.c b/sys/arm/mv/mv_pci.c index 87c6fbae3ca4..69c72c074c67 100644 --- a/sys/arm/mv/mv_pci.c +++ b/sys/arm/mv/mv_pci.c @@ -553,12 +553,12 @@ mv_pcib_attach(device_t self) if (err) goto error; - device_add_child(self, "pci", -1); + device_add_child(self, "pci", DEVICE_UNIT_ANY); } else { sc->sc_devnr = 1; bus_space_write_4(sc->sc_bst, sc->sc_bsh, PCIE_REG_STATUS, 1 << PCIE_STATUS_DEV_OFFS); - device_add_child(self, "pci_ep", -1); + device_add_child(self, "pci_ep", DEVICE_UNIT_ANY); } mtx_init(&sc->sc_msi_mtx, "msi_mtx", NULL, MTX_DEF); diff --git a/sys/arm/mv/mv_pci_ctrl.c b/sys/arm/mv/mv_pci_ctrl.c index 0cff28e4ca76..e32d38281e9d 100644 --- a/sys/arm/mv/mv_pci_ctrl.c +++ b/sys/arm/mv/mv_pci_ctrl.c @@ -185,7 +185,7 @@ mv_pcib_ofw_bus_attach(device_t dev) continue; } - child = device_add_child(dev, NULL, -1); + child = device_add_child(dev, NULL, DEVICE_UNIT_ANY); if (child == NULL) { if (bootverbose) { device_printf(dev, diff --git a/sys/arm/mv/mv_spi.c b/sys/arm/mv/mv_spi.c index 4efaee68f75d..621594624b7b 100644 --- a/sys/arm/mv/mv_spi.c +++ b/sys/arm/mv/mv_spi.c @@ -168,7 +168,7 @@ mv_spi_attach(device_t dev) mtx_init(&sc->sc_mtx, "mv_spi", NULL, MTX_DEF); - device_add_child(dev, "spibus", -1); + device_add_child(dev, "spibus", DEVICE_UNIT_ANY); /* Probe and attach the spibus when interrupts are available. */ return (bus_delayed_attach_children(dev)); diff --git a/sys/arm/nvidia/tegra_ehci.c b/sys/arm/nvidia/tegra_ehci.c index e8126a88ba87..15f086a6c3c0 100644 --- a/sys/arm/nvidia/tegra_ehci.c +++ b/sys/arm/nvidia/tegra_ehci.c @@ -259,7 +259,7 @@ tegra_ehci_attach(device_t dev) } /* Add USB bus device. */ - esc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + esc->sc_bus.bdev = device_add_child(dev, "usbus", DEVICE_UNIT_ANY); if (esc->sc_bus.bdev == NULL) { device_printf(dev, "Could not add USB device\n"); goto out; diff --git a/sys/arm/nvidia/tegra_i2c.c b/sys/arm/nvidia/tegra_i2c.c index 1b959c5c5bbe..0fe1aa7ba48e 100644 --- a/sys/arm/nvidia/tegra_i2c.c +++ b/sys/arm/nvidia/tegra_i2c.c @@ -714,7 +714,7 @@ tegra_i2c_attach(device_t dev) } /* Attach the iicbus. */ - sc->iicbus = device_add_child(dev, "iicbus", -1); + sc->iicbus = device_add_child(dev, "iicbus", DEVICE_UNIT_ANY); if (sc->iicbus == NULL) { device_printf(dev, "Could not allocate iicbus instance.\n"); rv = ENXIO; diff --git a/sys/arm/nvidia/tegra_pcie.c b/sys/arm/nvidia/tegra_pcie.c index cb0c1c7ec4d4..2a91a81d40a9 100644 --- a/sys/arm/nvidia/tegra_pcie.c +++ b/sys/arm/nvidia/tegra_pcie.c @@ -1565,7 +1565,7 @@ tegra_pcib_attach(device_t dev) if (rv != 0) goto out; #endif - device_add_child(dev, "pci", -1); + device_add_child(dev, "pci", DEVICE_UNIT_ANY); return (bus_generic_attach(dev)); diff --git a/sys/arm/nvidia/tegra_xhci.c b/sys/arm/nvidia/tegra_xhci.c index f7d541fabee4..e3b4dd483189 100644 --- a/sys/arm/nvidia/tegra_xhci.c +++ b/sys/arm/nvidia/tegra_xhci.c @@ -1048,7 +1048,7 @@ tegra_xhci_attach(device_t dev) strlcpy(xsc->sc_vendor, "Nvidia", sizeof(xsc->sc_vendor)); /* Add USB bus device. */ - xsc->sc_bus.bdev = device_add_child(sc->dev, "usbus", -1); + xsc->sc_bus.bdev = device_add_child(sc->dev, "usbus", DEVICE_UNIT_ANY); if (xsc->sc_bus.bdev == NULL) { device_printf(sc->dev, "Could not add USB device\n"); rv = ENXIO; diff --git a/sys/arm/ti/am335x/am335x_musb.c b/sys/arm/ti/am335x/am335x_musb.c index 93cb7cef41b9..147602c4dbd3 100644 --- a/sys/arm/ti/am335x/am335x_musb.c +++ b/sys/arm/ti/am335x/am335x_musb.c @@ -327,7 +327,7 @@ musbotg_attach(device_t dev) sc->sc_otg.sc_io_size = rman_get_size(sc->sc_otg.sc_io_res); - sc->sc_otg.sc_bus.bdev = device_add_child(dev, "usbus", -1); + sc->sc_otg.sc_bus.bdev = device_add_child(dev, "usbus", DEVICE_UNIT_ANY); if (!(sc->sc_otg.sc_bus.bdev)) { device_printf(dev, "No busdev for musb\n"); goto error; diff --git a/sys/arm/ti/am335x/am335x_scm.c b/sys/arm/ti/am335x/am335x_scm.c index 214a9dfdf18b..8245f35617ad 100644 --- a/sys/arm/ti/am335x/am335x_scm.c +++ b/sys/arm/ti/am335x/am335x_scm.c @@ -89,7 +89,7 @@ am335x_scm_identify(driver_t *driver, device_t parent) if (device_find_child(parent, "am335x_scm", -1) != NULL) return; - child = device_add_child(parent, "am335x_scm", -1); + child = device_add_child(parent, "am335x_scm", DEVICE_UNIT_ANY); if (child == NULL) device_printf(parent, "cannot add ti_scm child\n"); } diff --git a/sys/arm/ti/ti_spi.c b/sys/arm/ti/ti_spi.c index b5616d36830c..9fabed46917d 100644 --- a/sys/arm/ti/ti_spi.c +++ b/sys/arm/ti/ti_spi.c @@ -263,7 +263,7 @@ ti_spi_attach(device_t dev) ti_spi_printr(dev); #endif - device_add_child(dev, "spibus", -1); + device_add_child(dev, "spibus", DEVICE_UNIT_ANY); return (bus_generic_attach(dev)); } diff --git a/sys/arm/ti/usb/omap_ehci.c b/sys/arm/ti/usb/omap_ehci.c index 9376be35c261..fee5f662963b 100644 --- a/sys/arm/ti/usb/omap_ehci.c +++ b/sys/arm/ti/usb/omap_ehci.c @@ -337,7 +337,7 @@ omap_ehci_attach(device_t dev) } /* Add this device as a child of the USBus device */ - sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + sc->sc_bus.bdev = device_add_child(dev, "usbus", DEVICE_UNIT_ANY); if (!sc->sc_bus.bdev) { device_printf(dev, "Error: could not add USB device\n"); goto error; diff --git a/sys/arm/xilinx/zy7_ehci.c b/sys/arm/xilinx/zy7_ehci.c index 57fe4115a86f..f2e1d8a9ec2b 100644 --- a/sys/arm/xilinx/zy7_ehci.c +++ b/sys/arm/xilinx/zy7_ehci.c @@ -258,7 +258,7 @@ zy7_ehci_attach(device_t dev) } /* Add USB device */ - sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + sc->sc_bus.bdev = device_add_child(dev, "usbus", DEVICE_UNIT_ANY); if (!sc->sc_bus.bdev) { device_printf(dev, "Could not add USB device\n"); zy7_ehci_detach(dev); diff --git a/sys/arm/xilinx/zy7_qspi.c b/sys/arm/xilinx/zy7_qspi.c index d639c0bb02cf..81ceb79e2bf6 100644 --- a/sys/arm/xilinx/zy7_qspi.c +++ b/sys/arm/xilinx/zy7_qspi.c @@ -598,7 +598,7 @@ zy7_qspi_attach(device_t dev) return (err); } - sc->child = device_add_child(dev, "spibus", -1); + sc->child = device_add_child(dev, "spibus", DEVICE_UNIT_ANY); zy7_qspi_add_sysctls(dev); diff --git a/sys/arm/xilinx/zy7_spi.c b/sys/arm/xilinx/zy7_spi.c index c2cbf266ad05..bb21ca6eec43 100644 --- a/sys/arm/xilinx/zy7_spi.c +++ b/sys/arm/xilinx/zy7_spi.c @@ -434,7 +434,7 @@ zy7_spi_attach(device_t dev) return (err); } - sc->child = device_add_child(dev, "spibus", -1); + sc->child = device_add_child(dev, "spibus", DEVICE_UNIT_ANY); zy7_spi_add_sysctls(dev); diff --git a/sys/arm64/arm64/gic_v3_acpi.c b/sys/arm64/arm64/gic_v3_acpi.c index f91a8f6078d9..180066b88930 100644 --- a/sys/arm64/arm64/gic_v3_acpi.c +++ b/sys/arm64/arm64/gic_v3_acpi.c @@ -406,7 +406,7 @@ gic_v3_add_children(ACPI_SUBTABLE_HEADER *entry, void *arg) return; } - child = device_add_child(dev, "its", -1); + child = device_add_child(dev, "its", DEVICE_UNIT_ANY); if (child == NULL) { free(di, M_GIC_V3); return; diff --git a/sys/arm64/arm64/gic_v3_fdt.c b/sys/arm64/arm64/gic_v3_fdt.c index 3a3647fc89a5..5637f6933956 100644 --- a/sys/arm64/arm64/gic_v3_fdt.c +++ b/sys/arm64/arm64/gic_v3_fdt.c @@ -339,7 +339,7 @@ gic_v3_ofw_bus_attach(device_t dev) /* Should not have any interrupts, so don't add any */ /* Add newbus device for this FDT node */ - child = device_add_child(dev, NULL, -1); + child = device_add_child(dev, NULL, DEVICE_UNIT_ANY); if (!child) { if (bootverbose) { device_printf(dev, diff --git a/sys/arm64/broadcom/brcmmdio/mdio_mux_iproc.c b/sys/arm64/broadcom/brcmmdio/mdio_mux_iproc.c index 9e73985ded0d..6e6b3ad97310 100644 --- a/sys/arm64/broadcom/brcmmdio/mdio_mux_iproc.c +++ b/sys/arm64/broadcom/brcmmdio/mdio_mux_iproc.c @@ -342,7 +342,7 @@ brcm_iproc_mdio_attach(device_t dev) ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); /* Add newbus device for this FDT node */ - child = device_add_child(dev, NULL, -1); + child = device_add_child(dev, NULL, DEVICE_UNIT_ANY); if (child == NULL) { printf("Failed to add child\n"); resource_list_free(&di->di_rl); diff --git a/sys/arm64/broadcom/brcmmdio/mdio_nexus_iproc.c b/sys/arm64/broadcom/brcmmdio/mdio_nexus_iproc.c index f1bf5ac38bf9..852bd8815e7f 100644 --- a/sys/arm64/broadcom/brcmmdio/mdio_nexus_iproc.c +++ b/sys/arm64/broadcom/brcmmdio/mdio_nexus_iproc.c @@ -215,7 +215,7 @@ brcm_mdionexus_ofw_bus_attach(device_t dev) ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); /* Add newbus device for this FDT node */ - child = device_add_child(dev, NULL, -1); + child = device_add_child(dev, NULL, DEVICE_UNIT_ANY); if (child == NULL) { resource_list_free(&di->di_rl); ofw_bus_gen_destroy_devinfo(&di->di_dinfo); diff --git a/sys/arm64/cavium/thunder_pcie_pem.c b/sys/arm64/cavium/thunder_pcie_pem.c index 89393d9701d0..6b57aeee0732 100644 --- a/sys/arm64/cavium/thunder_pcie_pem.c +++ b/sys/arm64/cavium/thunder_pcie_pem.c @@ -906,7 +906,7 @@ thunder_pem_attach(device_t dev) goto fail_io; } - device_add_child(dev, "pci", -1); + device_add_child(dev, "pci", DEVICE_UNIT_ANY); return (bus_generic_attach(dev)); diff --git a/sys/arm64/rockchip/rk_pcie.c b/sys/arm64/rockchip/rk_pcie.c index 69ae4254a235..54619ca5b1d8 100644 --- a/sys/arm64/rockchip/rk_pcie.c +++ b/sys/arm64/rockchip/rk_pcie.c @@ -1353,7 +1353,7 @@ rk_pcie_attach(device_t dev) APB_WR4(sc, PCIE_RC_CONFIG_LCS, val); DELAY(250000); - device_add_child(dev, "pci", -1); + device_add_child(dev, "pci", DEVICE_UNIT_ANY); return (bus_generic_attach(dev)); out_full: diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index 34dbb56a66f7..db434841f778 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -3785,7 +3785,7 @@ aac_get_bus_info(struct aac_softc *sc) break; } - child = device_add_child(sc->aac_dev, "aacp", -1); + child = device_add_child(sc->aac_dev, "aacp", DEVICE_UNIT_ANY); if (child == NULL) { device_printf(sc->aac_dev, "device_add_child failed for passthrough bus %d\n", diff --git a/sys/dev/aacraid/aacraid.c b/sys/dev/aacraid/aacraid.c index 031a13ef021b..3bebba01c1b1 100644 --- a/sys/dev/aacraid/aacraid.c +++ b/sys/dev/aacraid/aacraid.c @@ -3608,7 +3608,7 @@ aac_container_bus(struct aac_softc *sc) "No memory to add container bus\n"); panic("Out of memory?!"); } - child = device_add_child(sc->aac_dev, "aacraidp", -1); + child = device_add_child(sc->aac_dev, "aacraidp", DEVICE_UNIT_ANY); if (child == NULL) { device_printf(sc->aac_dev, "device_add_child failed for container bus\n"); @@ -3725,7 +3725,7 @@ aac_get_bus_info(struct aac_softc *sc) break; } - child = device_add_child(sc->aac_dev, "aacraidp", -1); + child = device_add_child(sc->aac_dev, "aacraidp", DEVICE_UNIT_ANY); if (child == NULL) { device_printf(sc->aac_dev, "device_add_child failed for passthrough bus %d\n", diff --git a/sys/dev/acpica/acpi_video.c b/sys/dev/acpica/acpi_video.c index da7c2a4d19cb..472a38d3eb56 100644 --- a/sys/dev/acpica/acpi_video.c +++ b/sys/dev/acpica/acpi_video.c @@ -275,7 +275,7 @@ acpi_video_identify(driver_t *driver, device_t parent) { if (device_find_child(parent, "acpi_video", -1) == NULL) - device_add_child(parent, "acpi_video", -1); + device_add_child(parent, "acpi_video", DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/adb/adb_bus.c b/sys/dev/adb/adb_bus.c index 395ed555fec5..8c805254a2e6 100644 --- a/sys/dev/adb/adb_bus.c +++ b/sys/dev/adb/adb_bus.c @@ -178,7 +178,7 @@ adb_bus_enumerate(void *xdev) for (i = 0; i < 16; i++) { if (sc->devinfo[i].default_address) { - sc->children[i] = device_add_child(dev, NULL, -1); + sc->children[i] = device_add_child(dev, NULL, DEVICE_UNIT_ANY); device_set_ivars(sc->children[i], &sc->devinfo[i]); } } diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c index df977889a9c0..b710a542a10f 100644 --- a/sys/dev/agp/agp_i810.c +++ b/sys/dev/agp/agp_i810.c @@ -682,7 +682,7 @@ agp_i810_identify(driver_t *driver, device_t parent) if (device_find_child(parent, "agp", -1) == NULL && agp_i810_match(parent)) - device_add_child(parent, "agp", -1); + device_add_child(parent, "agp", DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c index 2910247d9327..76d27dbe4953 100644 --- a/sys/dev/ahci/ahci.c +++ b/sys/dev/ahci/ahci.c @@ -354,7 +354,7 @@ ahci_attach(device_t dev) } /* Attach all channels on this controller */ for (unit = 0; unit < ctlr->channels; unit++) { - child = device_add_child(dev, "ahcich", -1); + child = device_add_child(dev, "ahcich", DEVICE_UNIT_ANY); if (child == NULL) { device_printf(dev, "failed to add channel device\n"); continue; @@ -365,7 +365,7 @@ ahci_attach(device_t dev) } /* Attach any remapped NVME device */ for (; unit < ctlr->channels + ctlr->remapped_devices; unit++) { - child = device_add_child(dev, "nvme", -1); + child = device_add_child(dev, "nvme", DEVICE_UNIT_ANY); if (child == NULL) { device_printf(dev, "failed to add remapped NVMe device"); continue; @@ -377,7 +377,7 @@ ahci_attach(device_t dev) resource_int_value(device_get_name(dev), device_get_unit(dev), "em", &em); if (em) { - child = device_add_child(dev, "ahciem", -1); + child = device_add_child(dev, "ahciem", DEVICE_UNIT_ANY); if (child == NULL) device_printf(dev, "failed to add enclosure device\n"); else diff --git a/sys/dev/alpm/alpm.c b/sys/dev/alpm/alpm.c index 6bd84c96d282..814cfcd86802 100644 --- a/sys/dev/alpm/alpm.c +++ b/sys/dev/alpm/alpm.c @@ -218,7 +218,7 @@ alpm_attach(device_t dev) mtx_init(&alpm->lock, device_get_nameunit(dev), "alpm", MTX_DEF); /* attach the smbus */ - alpm->smbus = device_add_child(dev, "smbus", -1); + alpm->smbus = device_add_child(dev, "smbus", DEVICE_UNIT_ANY); if (alpm->smbus == NULL) { alpm_detach(dev); return (EINVAL); diff --git a/sys/dev/amdpm/amdpm.c b/sys/dev/amdpm/amdpm.c index f479c0f5bcdd..4f8515f21e0d 100644 --- a/sys/dev/amdpm/amdpm.c +++ b/sys/dev/amdpm/amdpm.c @@ -214,7 +214,7 @@ amdpm_attach(device_t dev) mtx_init(&amdpm_sc->lock, device_get_nameunit(dev), "amdpm", MTX_DEF); /* Allocate a new smbus device */ - amdpm_sc->smbus = device_add_child(dev, "smbus", -1); + amdpm_sc->smbus = device_add_child(dev, "smbus", DEVICE_UNIT_ANY); if (!amdpm_sc->smbus) { amdpm_detach(dev); return (EINVAL); diff --git a/sys/dev/amdsmb/amdsmb.c b/sys/dev/amdsmb/amdsmb.c index 565e73cf1f64..57a9bccbf58b 100644 --- a/sys/dev/amdsmb/amdsmb.c +++ b/sys/dev/amdsmb/amdsmb.c @@ -159,7 +159,7 @@ amdsmb_attach(device_t dev) mtx_init(&amdsmb_sc->lock, device_get_nameunit(dev), "amdsmb", MTX_DEF); /* Allocate a new smbus device */ - amdsmb_sc->smbus = device_add_child(dev, "smbus", -1); + amdsmb_sc->smbus = device_add_child(dev, "smbus", DEVICE_UNIT_ANY); if (!amdsmb_sc->smbus) { amdsmb_detach(dev); return (EINVAL); diff --git a/sys/dev/amdsmn/amdsmn.c b/sys/dev/amdsmn/amdsmn.c index d657ab84924a..cb2ddbd86c2e 100644 --- a/sys/dev/amdsmn/amdsmn.c +++ b/sys/dev/amdsmn/amdsmn.c @@ -176,7 +176,7 @@ amdsmn_identify(driver_t *driver, device_t parent) if (!amdsmn_match(parent, NULL)) return; - child = device_add_child(parent, "amdsmn", -1); + child = device_add_child(parent, "amdsmn", DEVICE_UNIT_ANY); if (child == NULL) device_printf(parent, "add amdsmn child failed\n"); } diff --git a/sys/dev/amdtemp/amdtemp.c b/sys/dev/amdtemp/amdtemp.c index 56772432773e..9ff7388fd70c 100644 --- a/sys/dev/amdtemp/amdtemp.c +++ b/sys/dev/amdtemp/amdtemp.c @@ -280,7 +280,7 @@ amdtemp_identify(driver_t *driver, device_t parent) return; if (amdtemp_match(parent, NULL)) { - child = device_add_child(parent, "amdtemp", -1); + child = device_add_child(parent, "amdtemp", DEVICE_UNIT_ANY); if (child == NULL) device_printf(parent, "add amdtemp child failed\n"); } diff --git a/sys/dev/ata/chipsets/ata-jmicron.c b/sys/dev/ata/chipsets/ata-jmicron.c index 0ae80d2a85a1..7965e642869e 100644 --- a/sys/dev/ata/chipsets/ata-jmicron.c +++ b/sys/dev/ata/chipsets/ata-jmicron.c @@ -110,7 +110,7 @@ ata_jmicron_chipinit(device_t dev) pci_write_config(dev, 0x80, 0x01200000, 4); /* Create AHCI subdevice if AHCI part present. */ if (ctlr->chip->cfg1) { - child = device_add_child(dev, NULL, -1); + child = device_add_child(dev, NULL, DEVICE_UNIT_ANY); if (child != NULL) { device_set_ivars(child, (void *)(intptr_t)-1); bus_generic_attach(dev); diff --git a/sys/dev/ata/chipsets/ata-marvell.c b/sys/dev/ata/chipsets/ata-marvell.c index f1feacd3f085..1f5f12b951b5 100644 --- a/sys/dev/ata/chipsets/ata-marvell.c +++ b/sys/dev/ata/chipsets/ata-marvell.c @@ -125,7 +125,7 @@ ata_marvell_chipinit(device_t dev) return ENXIO; /* Create AHCI subdevice if AHCI part present. */ if (ctlr->chip->cfg1) { - child = device_add_child(dev, NULL, -1); + child = device_add_child(dev, NULL, DEVICE_UNIT_ANY); if (child != NULL) { device_set_ivars(child, (void *)(intptr_t)-1); bus_generic_attach(dev); diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index ff6a0992c6b9..f375eb112cce 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -198,7 +198,7 @@ cardbus_attach_card(device_t cbdev) if (dinfo->pci.cfg.mfdev) cardbusfunchigh = PCI_FUNCMAX; - child = device_add_child(cbdev, NULL, -1); + child = device_add_child(cbdev, NULL, DEVICE_UNIT_ANY); if (child == NULL) { DEVPRINTF((cbdev, "Cannot add child!\n")); pci_freecfg((struct pci_devinfo *)dinfo); diff --git a/sys/dev/cfi/cfi_core.c b/sys/dev/cfi/cfi_core.c index 9554a710d8f2..79e09b45909b 100644 --- a/sys/dev/cfi/cfi_core.c +++ b/sys/dev/cfi/cfi_core.c @@ -445,7 +445,7 @@ cfi_attach(device_t dev) } #endif - device_add_child(dev, "cfid", -1); + device_add_child(dev, "cfid", DEVICE_UNIT_ANY); bus_generic_attach(dev); return (0); diff --git a/sys/dev/cxgbe/crypto/t4_crypto.c b/sys/dev/cxgbe/crypto/t4_crypto.c index 4ea4ad1639eb..568a948a49f7 100644 --- a/sys/dev/cxgbe/crypto/t4_crypto.c +++ b/sys/dev/cxgbe/crypto/t4_crypto.c @@ -1805,7 +1805,7 @@ ccr_identify(driver_t *driver, device_t parent) sc = device_get_softc(parent); if (sc->cryptocaps & FW_CAPS_CONFIG_CRYPTO_LOOKASIDE && device_find_child(parent, "ccr", -1) == NULL) - device_add_child(parent, "ccr", -1); + device_add_child(parent, "ccr", DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 3baa2d5ac0f7..795c8d7e2e37 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2725,7 +2725,7 @@ cxgbe_attach(device_t dev) for_each_vi(pi, i, vi) { if (i == 0) continue; - vi->dev = device_add_child(dev, sc->names->vi_ifnet_name, -1); + vi->dev = device_add_child(dev, sc->names->vi_ifnet_name, DEVICE_UNIT_ANY); if (vi->dev == NULL) { device_printf(dev, "failed to add VI %d\n", i); continue; diff --git a/sys/dev/cxgbe/t4_vf.c b/sys/dev/cxgbe/t4_vf.c index 8ca6dd98a66f..e941b87d7182 100644 --- a/sys/dev/cxgbe/t4_vf.c +++ b/sys/dev/cxgbe/t4_vf.c @@ -673,7 +673,7 @@ t4vf_attach(device_t dev) ifmedia_init(&pi->media, IFM_IMASK, cxgbe_media_change, cxgbe_media_status); - pi->dev = device_add_child(dev, sc->names->vf_ifnet_name, -1); + pi->dev = device_add_child(dev, sc->names->vf_ifnet_name, DEVICE_UNIT_ANY); if (pi->dev == NULL) { device_printf(dev, "failed to add device for port %d.\n", i); diff --git a/sys/dev/drm2/drm_dp_iic_helper.c b/sys/dev/drm2/drm_dp_iic_helper.c index fd703494cd5e..06ee8c34f8bb 100644 --- a/sys/dev/drm2/drm_dp_iic_helper.c +++ b/sys/dev/drm2/drm_dp_iic_helper.c @@ -207,7 +207,7 @@ iic_dp_aux_attach(device_t idev) struct iic_dp_aux_data *aux_data; aux_data = device_get_softc(idev); - aux_data->port = device_add_child(idev, "iicbus", -1); + aux_data->port = device_add_child(idev, "iicbus", DEVICE_UNIT_ANY); if (aux_data->port == NULL) return (ENXIO); device_quiet(aux_data->port); diff --git a/sys/dev/etherswitch/miiproxy.c b/sys/dev/etherswitch/miiproxy.c index 97d4b7f6eb67..24822b15f89e 100644 --- a/sys/dev/etherswitch/miiproxy.c +++ b/sys/dev/etherswitch/miiproxy.c @@ -380,7 +380,7 @@ mii_attach_proxy(device_t dev) return (NULL); } - miiproxy = device_add_child(dev, miiproxy_driver.name, -1); + miiproxy = device_add_child(dev, miiproxy_driver.name, DEVICE_UNIT_ANY); error = bus_generic_attach(dev); if (error != 0) { device_printf(dev, "can't attach miiproxy\n"); diff --git a/sys/dev/exca/exca.c b/sys/dev/exca/exca.c index 98e0ffdf9d18..44cb399cd49e 100644 --- a/sys/dev/exca/exca.c +++ b/sys/dev/exca/exca.c @@ -643,7 +643,7 @@ exca_init(struct exca_softc *sc, device_t dev, sc->flags = 0; sc->getb = exca_mem_getb; sc->putb = exca_mem_putb; - sc->pccarddev = device_add_child(dev, "pccard", -1); + sc->pccarddev = device_add_child(dev, "pccard", DEVICE_UNIT_ANY); if (sc->pccarddev == NULL) DEVPRINTF(brdev, "WARNING: cannot add pccard bus.\n"); else if (device_probe_and_attach(sc->pccarddev) != 0) diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index c8fee7d400c1..8c64ee9e862d 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -299,7 +299,7 @@ gpiobus_attach_bus(device_t dev) { device_t busdev; - busdev = device_add_child(dev, "gpiobus", -1); + busdev = device_add_child(dev, "gpiobus", DEVICE_UNIT_ANY); if (busdev == NULL) return (NULL); if (device_add_child(dev, "gpioc", -1) == NULL) { diff --git a/sys/dev/gpio/gpioiic.c b/sys/dev/gpio/gpioiic.c index 4f24dac23e51..68068c0e7ec1 100644 --- a/sys/dev/gpio/gpioiic.c +++ b/sys/dev/gpio/gpioiic.c @@ -320,7 +320,7 @@ gpioiic_attach(device_t dev) #endif /* Add the bitbang driver as our only child; it will add iicbus. */ - device_add_child(sc->dev, "iicbb", -1); + device_add_child(sc->dev, "iicbb", DEVICE_UNIT_ANY); return (bus_generic_attach(dev)); } diff --git a/sys/dev/gpio/gpiospi.c b/sys/dev/gpio/gpiospi.c index 15517f74f0b3..1f58e7c79ce3 100644 --- a/sys/dev/gpio/gpiospi.c +++ b/sys/dev/gpio/gpiospi.c @@ -177,7 +177,7 @@ gpio_spi_attach(device_t dev) gpio_spi_chip_deactivate(sc, -1); - device_add_child(dev, "spibus", -1); + device_add_child(dev, "spibus", DEVICE_UNIT_ANY); return (bus_generic_attach(dev)); } diff --git a/sys/dev/gpio/ofw_gpiobus.c b/sys/dev/gpio/ofw_gpiobus.c index 9173bcd1500c..8cadc12934e0 100644 --- a/sys/dev/gpio/ofw_gpiobus.c +++ b/sys/dev/gpio/ofw_gpiobus.c @@ -157,7 +157,7 @@ ofw_gpiobus_add_fdt_child(device_t bus, const char *drvname, phandle_t child) /* * Set up the GPIO child and OFW bus layer devinfo and add it to bus. */ - childdev = device_add_child(bus, drvname, -1); + childdev = device_add_child(bus, drvname, DEVICE_UNIT_ANY); if (childdev == NULL) return (NULL); dinfo = ofw_gpiobus_setup_devinfo(bus, childdev, child); diff --git a/sys/dev/hyperv/pcib/vmbus_pcib.c b/sys/dev/hyperv/pcib/vmbus_pcib.c index 9aec2fac698a..7c596c724e52 100644 --- a/sys/dev/hyperv/pcib/vmbus_pcib.c +++ b/sys/dev/hyperv/pcib/vmbus_pcib.c @@ -1564,7 +1564,7 @@ vmbus_pcib_attach(device_t dev) vmbus_pcib_prepopulate_bars(hbus); - hbus->pci_bus = device_add_child(dev, "pci", -1); + hbus->pci_bus = device_add_child(dev, "pci", DEVICE_UNIT_ANY); if (!hbus->pci_bus) { device_printf(dev, "failed to create pci bus\n"); ret = ENXIO; diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c index 4157a4c41cea..774ba6da46e7 100644 *** 2469 LINES SKIPPED *** From nobody Thu Jul 25 04:49:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTz1Y4wSRz5RFh7; Thu, 25 Jul 2024 04:49: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTz1Y3WNXz4X4T; Thu, 25 Jul 2024 04:49:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721882945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XqfkrsP4o3t7mD9POvosFZ/VSNArNS6r14ndkzu0/OI=; b=L8QSJPPjAgMi4VMYtWWLebhTuToJsNGei+rSsx0TKbg239O9gT1uowjMhApuTfAf39nUwe /quZ6nMsHIJgUWAZiSlcKnwN0gw0lsotfe9HoXr5S7tf55dXEsWVR89BlXceIXiJqs0eid eCriZ4nyzsoNgAq8M/WwpatfSG1uRv8gcOAc/iMX6p8C9czC1fzIdvluJHOC2hVlmVDMHl JU6E70rgVarcQCtmUL1iYzao5s5SSDNYMUiV/exusl8robCN93NZCkCln2ZjRUA2FmjTe6 OQ7GTDQGNAW6wDbb1zsibF5idCHNEAjPtc1w6+Gy5sPmdFGGw5Xe16DNjAAZMw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721882945; a=rsa-sha256; cv=none; b=bDZK5A17VVczpdefZcw3D8dm/vGi82VzmuyNeeskDSu3sVmhKAcT+IUDYyjkNHdH+q5qLv FIhFIPLVWrta7NZqgwrj8f8TaQDC2teFZj6M0aL8CcWIlxFVa0nV5ISD60IPourxt1sfS0 kb4y7s/eKHSdo9YgBa4IHJb0aeDKwV5zcdMZCEZVzp7KFrUC0QuJv6mzhmZl2I7a4CZ9xv FX66qloHaPDQkp5wE+B5yZ1EA0UUfqfKdaKKg7oryTgwdgtR9Tre9ZalaxBJ9CrN1ABT7b 8zIinmMFDE84sbhUMBwuAOtYvmPIoRQzJ3mMqhRHCVjIoYLWJwdJ1hhNx2RIcA== 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=1721882945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XqfkrsP4o3t7mD9POvosFZ/VSNArNS6r14ndkzu0/OI=; b=WyB5v0JmctQYN624kthMWMfSC2XZe2MCQVya8z+yGtr3EY+PbZiu677AJd4vUf6AlLYy3F 0vogtuFOsCH60G1vKK6xn9vtbhyBdBiBhAAU40XrjS7WaB2mnYB0/3U7NGRZs8VwF1qCbt +pqooAf8aI4rZZtT22ofE64VmdxwDxZ+kq+KainT8BlzqY/BWuqCt/iAQ/LqOng/j7IX2F FNnjUCwitsX3oCKZ9GA1p21HKjJr/IFx9RCSOeZNZP4rajH8+OJbgDVY9/LLzef+D6/K+A 1EYnps5T8Tz4tR5UmlROKkNOgcFNWSe60ZQtjpBlcK9baQBqIP+fCntt+wefHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTz1Y36X9zh8C; Thu, 25 Jul 2024 04:49:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P4n5IS032054; Thu, 25 Jul 2024 04:49:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P4n5bq032051; Thu, 25 Jul 2024 04:49:05 GMT (envelope-from git) Date: Thu, 25 Jul 2024 04:49:05 GMT Message-Id: <202407250449.46P4n5bq032051@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a05a680469a7 - main - newbus: replace -1 in BUS_ADD_CHILD(...-1) with DEVICE_UNIT_ANY List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a05a680469a7ac77b195021fed74e3aa58152dd7 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a05a680469a7ac77b195021fed74e3aa58152dd7 commit a05a680469a7ac77b195021fed74e3aa58152dd7 Author: Warner Losh AuthorDate: 2024-07-25 04:23:02 +0000 Commit: Warner Losh CommitDate: 2024-07-25 04:23:02 +0000 newbus: replace -1 in BUS_ADD_CHILD(...-1) with DEVICE_UNIT_ANY Sponsored by: Netflix --- sys/arm64/nvidia/tegra210/max77620_rtc.c | 2 +- sys/crypto/openssl/ossl.c | 2 +- sys/dev/acpica/acpi.c | 2 +- sys/dev/amdsbwd/amdsbwd.c | 2 +- sys/dev/bhnd/bcma/bcma.c | 2 +- sys/dev/bhnd/bhndb/bhndb.c | 2 +- sys/dev/bhnd/cores/chipc/chipc.c | 12 ++++++------ sys/dev/bhnd/cores/chipc/chipc_spi.c | 2 +- sys/dev/bhnd/siba/siba.c | 2 +- sys/dev/cfe/cfe_resource.c | 2 +- sys/dev/chromebook_platform/chromebook_platform.c | 2 +- sys/dev/etherswitch/e6000sw/e6000sw.c | 2 +- sys/dev/etherswitch/etherswitch.c | 2 +- sys/dev/etherswitch/ip17x/ip17x.c | 2 +- sys/dev/etherswitch/miiproxy.c | 2 +- sys/dev/etherswitch/rtl8366/rtl8366rb.c | 2 +- sys/dev/firewire/firewire.c | 2 +- sys/dev/firewire/sbp.c | 2 +- sys/dev/hid/hidbus.c | 2 +- sys/dev/iicbus/acpi_iicbus.c | 2 +- sys/dev/iicbus/iic.c | 2 +- sys/dev/iicbus/iicsmb.c | 2 +- sys/dev/ipmi/ipmi_isa.c | 2 +- sys/dev/ipmi/ipmi_smbus.c | 2 +- sys/dev/isl/isl.c | 2 +- sys/dev/mdio/mdio.c | 2 +- sys/dev/nvdimm/nvdimm_acpi.c | 2 +- sys/dev/nvdimm/nvdimm_e820.c | 2 +- sys/dev/ppbus/if_plip.c | 2 +- sys/dev/ppbus/lpbb.c | 2 +- sys/dev/ppbus/lpt.c | 2 +- sys/dev/ppbus/pcfclock.c | 2 +- sys/dev/ppbus/ppi.c | 2 +- sys/dev/ppbus/pps.c | 2 +- sys/dev/smbios/smbios.c | 2 +- sys/dev/smbus/smb.c | 2 +- sys/dev/superio/superio.c | 2 +- sys/i386/bios/smapi.c | 2 +- sys/i386/i386/bios.c | 2 +- sys/isa/pnp.c | 2 +- sys/powerpc/mpc85xx/atpic.c | 2 +- sys/x86/bios/vpd.c | 2 +- sys/x86/isa/orm.c | 2 +- sys/x86/pci/qpi.c | 2 +- 44 files changed, 49 insertions(+), 49 deletions(-) diff --git a/sys/arm64/nvidia/tegra210/max77620_rtc.c b/sys/arm64/nvidia/tegra210/max77620_rtc.c index dc82d4b387b9..29808af27819 100644 --- a/sys/arm64/nvidia/tegra210/max77620_rtc.c +++ b/sys/arm64/nvidia/tegra210/max77620_rtc.c @@ -385,7 +385,7 @@ max77620_rtc_create(struct max77620_softc *sc, phandle_t node) parent = device_get_parent(sc->dev); - child = BUS_ADD_CHILD(parent, 0, NULL, -1); + child = BUS_ADD_CHILD(parent, 0, NULL, DEVICE_UNIT_ANY); if (child == NULL) { device_printf(sc->dev, "Cannot create MAX77620 RTC device.\n"); return (ENXIO); diff --git a/sys/crypto/openssl/ossl.c b/sys/crypto/openssl/ossl.c index 031f447e45a5..c2ca28133a78 100644 --- a/sys/crypto/openssl/ossl.c +++ b/sys/crypto/openssl/ossl.c @@ -57,7 +57,7 @@ ossl_identify(driver_t *driver, device_t parent) { if (device_find_child(parent, "ossl", -1) == NULL) - BUS_ADD_CHILD(parent, 10, "ossl", -1); + BUS_ADD_CHILD(parent, 10, "ossl", DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 91a1636f2808..b7d7277eb310 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -2396,7 +2396,7 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status) ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "scanning '%s'\n", handle_str)); order = level * 10 + ACPI_DEV_BASE_ORDER; acpi_probe_order(handle, &order); - child = BUS_ADD_CHILD(bus, order, NULL, -1); + child = BUS_ADD_CHILD(bus, order, NULL, DEVICE_UNIT_ANY); if (child == NULL) break; diff --git a/sys/dev/amdsbwd/amdsbwd.c b/sys/dev/amdsbwd/amdsbwd.c index 1dfe6c1b11bf..122fa2d58277 100644 --- a/sys/dev/amdsbwd/amdsbwd.c +++ b/sys/dev/amdsbwd/amdsbwd.c @@ -271,7 +271,7 @@ amdsbwd_identify(driver_t *driver, device_t parent) pci_get_devid(smb_dev) != HYGONCZ_SMBUS_DEVID) return; - child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "amdsbwd", -1); + child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "amdsbwd", DEVICE_UNIT_ANY); if (child == NULL) device_printf(parent, "add amdsbwd child failed\n"); } diff --git a/sys/dev/bhnd/bcma/bcma.c b/sys/dev/bhnd/bcma/bcma.c index c9df03cfb504..9ce4bf04a1c5 100644 --- a/sys/dev/bhnd/bcma/bcma.c +++ b/sys/dev/bhnd/bcma/bcma.c @@ -678,7 +678,7 @@ bcma_add_children(device_t bus) bcma_erom = (struct bcma_erom *)erom; while ((error = bcma_erom_next_corecfg(bcma_erom, &corecfg)) == 0) { /* Add the child device */ - child = BUS_ADD_CHILD(bus, 0, NULL, -1); + child = BUS_ADD_CHILD(bus, 0, NULL, DEVICE_UNIT_ANY); if (child == NULL) { error = ENXIO; goto cleanup; diff --git a/sys/dev/bhnd/bhndb/bhndb.c b/sys/dev/bhnd/bhndb/bhndb.c index af62057690ac..eeff088ffdde 100644 --- a/sys/dev/bhnd/bhndb/bhndb.c +++ b/sys/dev/bhnd/bhndb/bhndb.c @@ -558,7 +558,7 @@ bhndb_attach(device_t dev, struct bhnd_chipid *cid, } /* Add our bridged bus device */ - sc->bus_dev = BUS_ADD_CHILD(dev, BHND_PROBE_BUS, "bhnd", -1); + sc->bus_dev = BUS_ADD_CHILD(dev, BHND_PROBE_BUS, "bhnd", DEVICE_UNIT_ANY); if (sc->bus_dev == NULL) { error = ENXIO; goto failed; diff --git a/sys/dev/bhnd/cores/chipc/chipc.c b/sys/dev/bhnd/cores/chipc/chipc.c index 60cb04400cb0..a7da4ec9b7fc 100644 --- a/sys/dev/bhnd/cores/chipc/chipc.c +++ b/sys/dev/bhnd/cores/chipc/chipc.c @@ -270,7 +270,7 @@ chipc_add_children(struct chipc_softc *sc) if (sc->caps.nvram_src == BHND_NVRAM_SRC_SPROM || sc->caps.nvram_src == BHND_NVRAM_SRC_OTP) { - child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_nvram", -1); + child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_nvram", DEVICE_UNIT_ANY); if (child == NULL) { device_printf(sc->dev, "failed to add nvram device\n"); return (ENXIO); @@ -293,13 +293,13 @@ chipc_add_children(struct chipc_softc *sc) * attached directly to the bhnd(4) bus -- not chipc. */ if (sc->caps.pmu && !sc->caps.aob) { - child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_pmu", -1); + child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_pmu", DEVICE_UNIT_ANY); if (child == NULL) { device_printf(sc->dev, "failed to add pmu\n"); return (ENXIO); } } else if (sc->caps.pwr_ctrl) { - child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_pwrctl", -1); + child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_pwrctl", DEVICE_UNIT_ANY); if (child == NULL) { device_printf(sc->dev, "failed to add pwrctl\n"); return (ENXIO); @@ -307,7 +307,7 @@ chipc_add_children(struct chipc_softc *sc) } /* GPIO */ - child = BUS_ADD_CHILD(sc->dev, 0, "gpio", -1); + child = BUS_ADD_CHILD(sc->dev, 0, "gpio", DEVICE_UNIT_ANY); if (child == NULL) { device_printf(sc->dev, "failed to add gpio\n"); return (ENXIO); @@ -331,7 +331,7 @@ chipc_add_children(struct chipc_softc *sc) irq_rid = 0; mem_rid = 0; - child = BUS_ADD_CHILD(sc->dev, 0, "uart", -1); + child = BUS_ADD_CHILD(sc->dev, 0, "uart", DEVICE_UNIT_ANY); if (child == NULL) { device_printf(sc->dev, "failed to add uart%u\n", i); return (ENXIO); @@ -360,7 +360,7 @@ chipc_add_children(struct chipc_softc *sc) if (flash_bus != NULL) { int rid; - child = BUS_ADD_CHILD(sc->dev, 0, flash_bus, -1); + child = BUS_ADD_CHILD(sc->dev, 0, flash_bus, DEVICE_UNIT_ANY); if (child == NULL) { device_printf(sc->dev, "failed to add %s device\n", flash_bus); diff --git a/sys/dev/bhnd/cores/chipc/chipc_spi.c b/sys/dev/bhnd/cores/chipc/chipc_spi.c index 75e4b5cb7bc4..46b445cf0756 100644 --- a/sys/dev/bhnd/cores/chipc/chipc_spi.c +++ b/sys/dev/bhnd/cores/chipc/chipc_spi.c @@ -122,7 +122,7 @@ chipc_spi_attach(device_t dev) ccaps = BHND_CHIPC_GET_CAPS(device_get_parent(dev)); flash_name = chipc_sflash_device_name(ccaps->flash_type); if (flash_name != NULL) { - flash_dev = BUS_ADD_CHILD(spibus, 0, flash_name, -1); + flash_dev = BUS_ADD_CHILD(spibus, 0, flash_name, DEVICE_UNIT_ANY); if (flash_dev == NULL) { device_printf(dev, "failed to add %s\n", flash_name); error = ENXIO; diff --git a/sys/dev/bhnd/siba/siba.c b/sys/dev/bhnd/siba/siba.c index 2688f3415aa5..e693481f0819 100644 --- a/sys/dev/bhnd/siba/siba.c +++ b/sys/dev/bhnd/siba/siba.c @@ -1318,7 +1318,7 @@ siba_add_children(device_t dev) goto failed; /* Add the child device */ - child = BUS_ADD_CHILD(dev, 0, NULL, -1); + child = BUS_ADD_CHILD(dev, 0, NULL, DEVICE_UNIT_ANY); if (child == NULL) { error = ENXIO; goto failed; diff --git a/sys/dev/cfe/cfe_resource.c b/sys/dev/cfe/cfe_resource.c index d5047e045f37..78c5f149ba7d 100644 --- a/sys/dev/cfe/cfe_resource.c +++ b/sys/dev/cfe/cfe_resource.c @@ -81,7 +81,7 @@ cferes_identify(driver_t* driver, device_t parent) struct cferes_softc *sc; uint64_t addr, len, type; - child = BUS_ADD_CHILD(parent, 100, "cferes", -1); + child = BUS_ADD_CHILD(parent, 100, "cferes", DEVICE_UNIT_ANY); device_set_driver(child, driver); sc = device_get_softc(child); diff --git a/sys/dev/chromebook_platform/chromebook_platform.c b/sys/dev/chromebook_platform/chromebook_platform.c index cd5ad76a8701..935685d86955 100644 --- a/sys/dev/chromebook_platform/chromebook_platform.c +++ b/sys/dev/chromebook_platform/chromebook_platform.c @@ -74,7 +74,7 @@ chromebook_i2c_identify(driver_t *driver, device_t bus) continue; if (slaves[i].pci_id != pci_get_devid(controller)) continue; - child = BUS_ADD_CHILD(bus, 0, slaves[i].name, -1); + child = BUS_ADD_CHILD(bus, 0, slaves[i].name, DEVICE_UNIT_ANY); if (child != NULL) iicbus_set_addr(child, slaves[i].addr); } diff --git a/sys/dev/etherswitch/e6000sw/e6000sw.c b/sys/dev/etherswitch/e6000sw/e6000sw.c index 3b309f7f36f8..4e95287399e3 100644 --- a/sys/dev/etherswitch/e6000sw/e6000sw.c +++ b/sys/dev/etherswitch/e6000sw/e6000sw.c @@ -205,7 +205,7 @@ e6000sw_identify(driver_t *driver, device_t parent) { if (device_find_child(parent, "e6000sw", -1) == NULL) - BUS_ADD_CHILD(parent, 0, "e6000sw", -1); + BUS_ADD_CHILD(parent, 0, "e6000sw", DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/etherswitch/etherswitch.c b/sys/dev/etherswitch/etherswitch.c index 74afcd259007..c66918f77174 100644 --- a/sys/dev/etherswitch/etherswitch.c +++ b/sys/dev/etherswitch/etherswitch.c @@ -83,7 +83,7 @@ static void etherswitch_identify(driver_t *driver, device_t parent) { if (device_find_child(parent, "etherswitch", -1) == NULL) - BUS_ADD_CHILD(parent, 0, "etherswitch", -1); + BUS_ADD_CHILD(parent, 0, "etherswitch", DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/etherswitch/ip17x/ip17x.c b/sys/dev/etherswitch/ip17x/ip17x.c index 5e07e1f72b80..349dc59e09ae 100644 --- a/sys/dev/etherswitch/ip17x/ip17x.c +++ b/sys/dev/etherswitch/ip17x/ip17x.c @@ -84,7 +84,7 @@ static void ip17x_identify(driver_t *driver, device_t parent) { if (device_find_child(parent, "ip17x", -1) == NULL) - BUS_ADD_CHILD(parent, 0, "ip17x", -1); + BUS_ADD_CHILD(parent, 0, "ip17x", DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/etherswitch/miiproxy.c b/sys/dev/etherswitch/miiproxy.c index 24822b15f89e..3a621eae0875 100644 --- a/sys/dev/etherswitch/miiproxy.c +++ b/sys/dev/etherswitch/miiproxy.c @@ -331,7 +331,7 @@ static void mdioproxy_identify(driver_t *driver, device_t parent) { if (device_find_child(parent, driver->name, -1) == NULL) { - BUS_ADD_CHILD(parent, 0, driver->name, -1); + BUS_ADD_CHILD(parent, 0, driver->name, DEVICE_UNIT_ANY); } } diff --git a/sys/dev/etherswitch/rtl8366/rtl8366rb.c b/sys/dev/etherswitch/rtl8366/rtl8366rb.c index 761a96b0ec80..e57b11f3270f 100644 --- a/sys/dev/etherswitch/rtl8366/rtl8366rb.c +++ b/sys/dev/etherswitch/rtl8366/rtl8366rb.c @@ -134,7 +134,7 @@ rtl8366rb_identify(driver_t *driver, device_t parent) struct iicbus_ivar *devi; if (device_find_child(parent, "rtl8366rb", -1) == NULL) { - child = BUS_ADD_CHILD(parent, 0, "rtl8366rb", -1); + child = BUS_ADD_CHILD(parent, 0, "rtl8366rb", DEVICE_UNIT_ANY); devi = IICBUS_IVAR(child); devi->addr = RTL8366_IIC_ADDR; } diff --git a/sys/dev/firewire/firewire.c b/sys/dev/firewire/firewire.c index 4bb683cccfb7..93a414405c17 100644 --- a/sys/dev/firewire/firewire.c +++ b/sys/dev/firewire/firewire.c @@ -314,7 +314,7 @@ fw_asystart(struct fw_xfer *xfer) static void firewire_identify(driver_t *driver, device_t parent) { - BUS_ADD_CHILD(parent, 0, "firewire", -1); + BUS_ADD_CHILD(parent, 0, "firewire", DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c index 5f4ebb747057..2a91f6987e69 100644 --- a/sys/dev/firewire/sbp.c +++ b/sys/dev/firewire/sbp.c @@ -304,7 +304,7 @@ SBP_DEBUG(0) END_DEBUG if (device_find_child(parent, "sbp", -1) == NULL) - BUS_ADD_CHILD(parent, 0, "sbp", -1); + BUS_ADD_CHILD(parent, 0, "sbp", DEVICE_UNIT_ANY); } /* diff --git a/sys/dev/hid/hidbus.c b/sys/dev/hid/hidbus.c index 003017c0f3ea..548027b0320a 100644 --- a/sys/dev/hid/hidbus.c +++ b/sys/dev/hid/hidbus.c @@ -226,7 +226,7 @@ hidbus_enumerate_children(device_t dev, const void* data, hid_size_t len) while (hid_get_item(hd, &hi)) { if (hi.kind != hid_collection || hi.collevel != 1) continue; - child = BUS_ADD_CHILD(dev, 0, NULL, -1); + child = BUS_ADD_CHILD(dev, 0, NULL, DEVICE_UNIT_ANY); if (child == NULL) { device_printf(dev, "Could not add HID device\n"); continue; diff --git a/sys/dev/iicbus/acpi_iicbus.c b/sys/dev/iicbus/acpi_iicbus.c index 4b61387b0ed6..eb5f31d6132f 100644 --- a/sys/dev/iicbus/acpi_iicbus.c +++ b/sys/dev/iicbus/acpi_iicbus.c @@ -512,7 +512,7 @@ acpi_iicbus_enumerate_child(ACPI_HANDLE handle, UINT32 level, return (AE_OK); } - child = BUS_ADD_CHILD(iicbus, 0, NULL, -1); + child = BUS_ADD_CHILD(iicbus, 0, NULL, DEVICE_UNIT_ANY); if (child == NULL) { device_printf(iicbus, "add child failed\n"); return (AE_OK); diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c index 0d65bdea5782..ec37a6e19342 100644 --- a/sys/dev/iicbus/iic.c +++ b/sys/dev/iicbus/iic.c @@ -134,7 +134,7 @@ iic_identify(driver_t *driver, device_t parent) { if (device_find_child(parent, "iic", -1) == NULL) - BUS_ADD_CHILD(parent, 0, "iic", -1); + BUS_ADD_CHILD(parent, 0, "iic", DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/iicbus/iicsmb.c b/sys/dev/iicbus/iicsmb.c index 8576491b08a8..3e7e06a85f09 100644 --- a/sys/dev/iicbus/iicsmb.c +++ b/sys/dev/iicbus/iicsmb.c @@ -135,7 +135,7 @@ iicsmb_identify(driver_t *driver, device_t parent) { if (device_find_child(parent, "iicsmb", -1) == NULL) - BUS_ADD_CHILD(parent, 0, "iicsmb", -1); + BUS_ADD_CHILD(parent, 0, "iicsmb", DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/ipmi/ipmi_isa.c b/sys/dev/ipmi/ipmi_isa.c index 432c63b327ee..7ae55baf2f8f 100644 --- a/sys/dev/ipmi/ipmi_isa.c +++ b/sys/dev/ipmi/ipmi_isa.c @@ -70,7 +70,7 @@ ipmi_isa_identify(driver_t *driver, device_t parent) if (devid != 0xffffffff && ipmi_pci_match(devid & 0xffff, devid >> 16) != NULL) return; - BUS_ADD_CHILD(parent, 0, "ipmi", -1); + BUS_ADD_CHILD(parent, 0, "ipmi", DEVICE_UNIT_ANY); } } diff --git a/sys/dev/ipmi/ipmi_smbus.c b/sys/dev/ipmi/ipmi_smbus.c index 59b8dd76675a..1772d9313892 100644 --- a/sys/dev/ipmi/ipmi_smbus.c +++ b/sys/dev/ipmi/ipmi_smbus.c @@ -60,7 +60,7 @@ ipmi_smbus_identify(driver_t *driver, device_t parent) if (ipmi_smbios_identify(&info) && info.iface_type == SSIF_MODE && device_find_child(parent, "ipmi", -1) == NULL) - BUS_ADD_CHILD(parent, 0, "ipmi", -1); + BUS_ADD_CHILD(parent, 0, "ipmi", DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/isl/isl.c b/sys/dev/isl/isl.c index 558fc88975fa..009c02ad2b35 100644 --- a/sys/dev/isl/isl.c +++ b/sys/dev/isl/isl.c @@ -157,7 +157,7 @@ isl_identify(driver_t *driver, device_t parent) /* Check if we can communicate to our slave. */ if (init_device(dev, 0x88, 1) == 0) - BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "isl", -1); + BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "isl", DEVICE_UNIT_ANY); } #endif diff --git a/sys/dev/mdio/mdio.c b/sys/dev/mdio/mdio.c index 55122edd16cc..c34493254e0f 100644 --- a/sys/dev/mdio/mdio.c +++ b/sys/dev/mdio/mdio.c @@ -38,7 +38,7 @@ mdio_identify(driver_t *driver, device_t parent) { if (device_find_child(parent, mdio_driver.name, -1) == NULL) - BUS_ADD_CHILD(parent, 0, mdio_driver.name, -1); + BUS_ADD_CHILD(parent, 0, mdio_driver.name, DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/nvdimm/nvdimm_acpi.c b/sys/dev/nvdimm/nvdimm_acpi.c index 995e60e8b4ee..a8e5db0542f2 100644 --- a/sys/dev/nvdimm/nvdimm_acpi.c +++ b/sys/dev/nvdimm/nvdimm_acpi.c @@ -109,7 +109,7 @@ nvdimm_root_create_devs(device_t dev, ACPI_TABLE_NFIT *nfitbl) if (dimm_handle == NULL) continue; - child = BUS_ADD_CHILD(dev, 100, "nvdimm", -1); + child = BUS_ADD_CHILD(dev, 100, "nvdimm", DEVICE_UNIT_ANY); if (child == NULL) { device_printf(dev, "failed to create nvdimm\n"); return (ENXIO); diff --git a/sys/dev/nvdimm/nvdimm_e820.c b/sys/dev/nvdimm/nvdimm_e820.c index 3fbe2df31209..2a6f29ebad21 100644 --- a/sys/dev/nvdimm/nvdimm_e820.c +++ b/sys/dev/nvdimm/nvdimm_e820.c @@ -275,7 +275,7 @@ nvdimm_e820_identify(driver_t *driver, device_t parent) if (smapbase == NULL) return; - child = BUS_ADD_CHILD(parent, 0, driver->name, -1); + child = BUS_ADD_CHILD(parent, 0, driver->name, DEVICE_UNIT_ANY); if (child == NULL) device_printf(parent, "add %s child failed\n", driver->name); } diff --git a/sys/dev/ppbus/if_plip.c b/sys/dev/ppbus/if_plip.c index c2adcb602f6b..598c0c49b82e 100644 --- a/sys/dev/ppbus/if_plip.c +++ b/sys/dev/ppbus/if_plip.c @@ -216,7 +216,7 @@ lp_identify(driver_t *driver, device_t parent) dev = device_find_child(parent, "plip", -1); if (!dev) - BUS_ADD_CHILD(parent, 0, "plip", -1); + BUS_ADD_CHILD(parent, 0, "plip", DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/ppbus/lpbb.c b/sys/dev/ppbus/lpbb.c index ce16471e7629..3380cdfdaed4 100644 --- a/sys/dev/ppbus/lpbb.c +++ b/sys/dev/ppbus/lpbb.c @@ -63,7 +63,7 @@ lpbb_identify(driver_t *driver, device_t parent) dev = device_find_child(parent, "lpbb", -1); if (!dev) - BUS_ADD_CHILD(parent, 0, "lpbb", -1); + BUS_ADD_CHILD(parent, 0, "lpbb", DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c index 644e0f08008b..994adcc6a608 100644 --- a/sys/dev/ppbus/lpt.c +++ b/sys/dev/ppbus/lpt.c @@ -339,7 +339,7 @@ lpt_identify(driver_t *driver, device_t parent) dev = device_find_child(parent, LPT_NAME, -1); if (!dev) - BUS_ADD_CHILD(parent, 0, LPT_NAME, -1); + BUS_ADD_CHILD(parent, 0, LPT_NAME, DEVICE_UNIT_ANY); } /* diff --git a/sys/dev/ppbus/pcfclock.c b/sys/dev/ppbus/pcfclock.c index e0d2e71b49e5..7cee6692b367 100644 --- a/sys/dev/ppbus/pcfclock.c +++ b/sys/dev/ppbus/pcfclock.c @@ -113,7 +113,7 @@ pcfclock_identify(driver_t *driver, device_t parent) dev = device_find_child(parent, PCFCLOCK_NAME, -1); if (!dev) - BUS_ADD_CHILD(parent, 0, PCFCLOCK_NAME, -1); + BUS_ADD_CHILD(parent, 0, PCFCLOCK_NAME, DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/ppbus/ppi.c b/sys/dev/ppbus/ppi.c index 3789da6fbed5..65921b53e0c6 100644 --- a/sys/dev/ppbus/ppi.c +++ b/sys/dev/ppbus/ppi.c @@ -137,7 +137,7 @@ ppi_identify(driver_t *driver, device_t parent) dev = device_find_child(parent, "ppi", -1); if (!dev) - BUS_ADD_CHILD(parent, 0, "ppi", -1); + BUS_ADD_CHILD(parent, 0, "ppi", DEVICE_UNIT_ANY); } /* diff --git a/sys/dev/ppbus/pps.c b/sys/dev/ppbus/pps.c index a5c0a56d4f94..5a2791aa0335 100644 --- a/sys/dev/ppbus/pps.c +++ b/sys/dev/ppbus/pps.c @@ -78,7 +78,7 @@ ppsidentify(driver_t *driver, device_t parent) dev = device_find_child(parent, PPS_NAME, -1); if (!dev) - BUS_ADD_CHILD(parent, 0, PPS_NAME, -1); + BUS_ADD_CHILD(parent, 0, PPS_NAME, DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/smbios/smbios.c b/sys/dev/smbios/smbios.c index 883e8f501b59..dbf766b86422 100644 --- a/sys/dev/smbios/smbios.c +++ b/sys/dev/smbios/smbios.c @@ -145,7 +145,7 @@ smbios_identify (driver_t *driver, device_t parent) } } - child = BUS_ADD_CHILD(parent, 5, "smbios", -1); + child = BUS_ADD_CHILD(parent, 5, "smbios", DEVICE_UNIT_ANY); device_set_driver(child, driver); /* smuggle the phys addr into probe and attach */ diff --git a/sys/dev/smbus/smb.c b/sys/dev/smbus/smb.c index ee323c835f10..0efa93ae0e89 100644 --- a/sys/dev/smbus/smb.c +++ b/sys/dev/smbus/smb.c @@ -127,7 +127,7 @@ smb_identify(driver_t *driver, device_t parent) { if (device_find_child(parent, "smb", -1) == NULL) - BUS_ADD_CHILD(parent, 0, "smb", -1); + BUS_ADD_CHILD(parent, 0, "smb", DEVICE_UNIT_ANY); } static int diff --git a/sys/dev/superio/superio.c b/sys/dev/superio/superio.c index ddb06af93bec..960b89c0cdc0 100644 --- a/sys/dev/superio/superio.c +++ b/sys/dev/superio/superio.c @@ -685,7 +685,7 @@ superio_add_known_child(device_t dev, superio_dev_type_t type, uint8_t ldn) struct superio_devinfo *dinfo; device_t child; - child = BUS_ADD_CHILD(dev, 0, NULL, -1); + child = BUS_ADD_CHILD(dev, 0, NULL, DEVICE_UNIT_ANY); if (child == NULL) { device_printf(dev, "failed to add child for ldn %d, type %s\n", ldn, devtype_to_str(type)); diff --git a/sys/i386/bios/smapi.c b/sys/i386/bios/smapi.c index b73fb97e4365..b222e5e4cc61 100644 --- a/sys/i386/bios/smapi.c +++ b/sys/i386/bios/smapi.c @@ -151,7 +151,7 @@ smapi_identify (driver_t *driver, device_t parent) rid = 0; length = ADDR2HDR(addr)->length; - child = BUS_ADD_CHILD(parent, 5, "smapi", -1); + child = BUS_ADD_CHILD(parent, 5, "smapi", DEVICE_UNIT_ANY); device_set_driver(child, driver); bus_set_resource(child, SYS_RES_MEMORY, rid, addr, length); device_set_desc(child, "SMAPI BIOS"); diff --git a/sys/i386/i386/bios.c b/sys/i386/i386/bios.c index 0951fbe6a679..7f3e1546f236 100644 --- a/sys/i386/i386/bios.c +++ b/sys/i386/i386/bios.c @@ -642,7 +642,7 @@ pnpbios_identify(driver_t *driver, device_t parent) continue; /* Add the device and parse its resources */ - dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNPBIOS, NULL, -1); + dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNPBIOS, NULL, DEVICE_UNIT_ANY); isa_set_vendorid(dev, pd->devid); isa_set_logicalid(dev, pd->devid); /* diff --git a/sys/isa/pnp.c b/sys/isa/pnp.c index 877e2ed91d6f..0e711a93d1ce 100644 --- a/sys/isa/pnp.c +++ b/sys/isa/pnp.c @@ -469,7 +469,7 @@ pnp_create_devices(device_t parent, pnp_id *p, int csn, */ bcopy(resinfo, &logical_id, 4); pnp_check_quirks(p->vendor_id, logical_id, ldn, NULL); - dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNP, NULL, -1); + dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNP, NULL, DEVICE_UNIT_ANY); if (desc) device_set_desc_copy(dev, desc); else diff --git a/sys/powerpc/mpc85xx/atpic.c b/sys/powerpc/mpc85xx/atpic.c index fdee2177c970..8c69af8b4b4d 100644 --- a/sys/powerpc/mpc85xx/atpic.c +++ b/sys/powerpc/mpc85xx/atpic.c @@ -145,7 +145,7 @@ atpic_isa_identify(driver_t *drv, device_t parent) { device_t child; - child = BUS_ADD_CHILD(parent, ISA_ORDER_SENSITIVE, drv->name, -1); + child = BUS_ADD_CHILD(parent, ISA_ORDER_SENSITIVE, drv->name, DEVICE_UNIT_ANY); device_set_driver(child, drv); isa_set_logicalid(child, atpic_ids[0].ip_id); isa_set_vendorid(child, atpic_ids[0].ip_id); diff --git a/sys/x86/bios/vpd.c b/sys/x86/bios/vpd.c index 5ad194d28bba..8b68dcd39a66 100644 --- a/sys/x86/bios/vpd.c +++ b/sys/x86/bios/vpd.c @@ -141,7 +141,7 @@ vpd_identify (driver_t *driver, device_t parent) rid = 0; length = ADDR2VPD(addr)->Length; - child = BUS_ADD_CHILD(parent, 5, "vpd", -1); + child = BUS_ADD_CHILD(parent, 5, "vpd", DEVICE_UNIT_ANY); device_set_driver(child, driver); bus_set_resource(child, SYS_RES_MEMORY, rid, addr, length); device_set_desc(child, "Vital Product Data Area"); diff --git a/sys/x86/isa/orm.c b/sys/x86/isa/orm.c index f8afc17cac71..bb2663332550 100644 --- a/sys/x86/isa/orm.c +++ b/sys/x86/isa/orm.c @@ -94,7 +94,7 @@ orm_identify(driver_t* driver, device_t parent) if (resource_disabled("orm", 0)) return; - child = BUS_ADD_CHILD(parent, ISA_ORDER_SENSITIVE, "orm", -1); + child = BUS_ADD_CHILD(parent, ISA_ORDER_SENSITIVE, "orm", DEVICE_UNIT_ANY); device_set_driver(child, driver); isa_set_logicalid(child, ORM_ID); isa_set_vendorid(child, ORM_ID); diff --git a/sys/x86/pci/qpi.c b/sys/x86/pci/qpi.c index 085afd49852b..278489dfe10a 100644 --- a/sys/x86/pci/qpi.c +++ b/sys/x86/pci/qpi.c @@ -132,7 +132,7 @@ qpi_probe_pcib(device_t dev, int bus) return (ENXIO); } - child = BUS_ADD_CHILD(dev, 0, "pcib", -1); + child = BUS_ADD_CHILD(dev, 0, "pcib", DEVICE_UNIT_ANY); if (child == NULL) panic("%s: failed to add pci bus %d", device_get_nameunit(dev), bus); From nobody Thu Jul 25 04:49:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTz1Z5VgSz5RFp0; Thu, 25 Jul 2024 04:49: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTz1Z45gPz4Ws2; Thu, 25 Jul 2024 04:49:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721882946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F8ZKSlp3hko5vga9Vn0R4Zhn6G3490jH5h5vfTlYmjk=; b=vbFnnAN8hTG/mQRY4TVUddnOnUqAnK3m0/LVCQRfW8A7XI7ZsFmBeacsbwTcMZL0A28zbQ 0HY+SlqicX6kMyEKg4hFejpcSM3OU3FhQ2vMrJJFr5BtBYja505a78hdyXFL0dw5zt/XGk pzl58J07IIwhiY9VaA9Ogwn9OFVa/evG6UYpLbFrAWm3GTCHqAhOSKO31r1GrhSY8Gx86P BcBORAq+iiVwwxSpATvLRogtgmjupOv8W84Whby9JIih5BV8eRs8YUIfL+pemqfEgnbGMi vljHkZ1S+WSZG4R6SRKaLpGr2KtHLKaQgz3EnUAGy0TM435MF+/pDY7UFZd8WA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721882946; a=rsa-sha256; cv=none; b=FufeDADiwUIooBFazICeThAvhPTUutaPScwdzJRVNj+ikGBPMap+Q26zZhXP+iBxi1K25r zEusjreRXdzX56rvxCEpa6XkXesKUgBYPT0Up7EKJrqYQis9B3F5xvpQ79NEYcsupMWjzf cjkSWzS6ltgnOQagk1Ruy8dmB1ehFzi33oMyB8yGiRFZ+mqPL6nq9lZRu0uy6lSM9dY6vq VTReVZ4QaqHBUdDJ5vG05n07ZufMLm1/4hPFC3EropDiCvaMIgVFLnfWRa1JG1E3rrsizz VueHg3jkL0TKnzO00c/JuZ2g0jnZNnIzpCzETSLbo4yrsntzy5jj7BqH7aNtWg== 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=1721882946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=F8ZKSlp3hko5vga9Vn0R4Zhn6G3490jH5h5vfTlYmjk=; b=Ki+H+5/H0Kg7F9rKY6PZgK7vW6OtVYDqmHI/8vB8d1F29aK12OGxc8aNQgBb+7Pc9Cmbcx 5lKhM3SpcP1X3DQUkeEUiMvatJe3XLRzy8GUMo4taxkeTJp0hkmhgZolZwTdqYiMzuFihg Y1OcmiY/+Rw5QwsDCEyu37hsbyYILiY/QWAcOUlVso7E+WqrlZQOAoxTLamHITAN4mR6BW 7UiPC53x+TkV9TIbo4rDnN4/q351ug97Bbq4lPLJftXbXmPpdQfssSB7NN4MFhCxNUTSSA VWxUQ6+MuvHhP/ehzQglM7e4AvzSGb8TNbKTgX6K8Q0NMZjLjSEVSyp51Aqt8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTz1Z3jnHzgx4; Thu, 25 Jul 2024 04:49:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P4n6Rq032100; Thu, 25 Jul 2024 04:49:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P4n6q4032097; Thu, 25 Jul 2024 04:49:06 GMT (envelope-from git) Date: Thu, 25 Jul 2024 04:49:06 GMT Message-Id: <202407250449.46P4n6q4032097@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 0a59a6b02fcc - main - style: Allow C++ comments List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a59a6b02fccef82644439a5165b7e0b751049c3 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=0a59a6b02fccef82644439a5165b7e0b751049c3 commit 0a59a6b02fccef82644439a5165b7e0b751049c3 Author: Warner Losh AuthorDate: 2024-07-25 04:34:56 +0000 Commit: Warner Losh CommitDate: 2024-07-25 04:46:02 +0000 style: Allow C++ comments Attempt to craft the more-or-less conesnsus view on C++ BCPL-style comments. Allowing them seemed to have wide support. Consistent use was highly desired. What constituted consistent use, however, didn't have good consensus especially with multi-line comments. Craft something that's a little vague to allow what appears to be a range in common practices elsewhere and no good way to drive this do absolute agreement. We should revisit this point in 6-12 months after we get some experience with it. Sponsored by: Netflix Discussed with: many in the code reivew, see discussion there Differential Revision: https://reviews.freebsd.org/D35960 --- share/man/man9/style.9 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/share/man/man9/style.9 b/share/man/man9/style.9 index daddc57bfb1f..80099b67831c 100644 --- a/share/man/man9/style.9 +++ b/share/man/man9/style.9 @@ -52,11 +52,17 @@ is silent on an issue. /* Most single-line comments look like this. */ +// Although they may look like this. + /* * Multi-line comments look like this. Make them real sentences. Fill * them so they look like real paragraphs. */ .Ed +C++ comments may be used in C and C++ code. +Single-line comments should be consistently either C or C++ within a file. +Multi-line comments should also be consistently either C or C++, but may differ +from single-line comments. .Pp The copyright header should be a multi-line comment, with the first line of the comment having a dash after the star like so: From nobody Thu Jul 25 04:49:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTz1c0p3Rz5RFlf; Thu, 25 Jul 2024 04:49: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTz1b57Xvz4X4b; Thu, 25 Jul 2024 04:49:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721882947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PrMd70UsYWwGCK/XT1Zo0HIuJwAt3Ne3d4BCmwMRB7k=; b=dk2tED0P8Hw12nami29PblB3wB/tHsOZQEFX8okp8VOOHofMinedI27uARezShQZs4xiYT TP4JEnM9nIH6bz5YrjsBFIwINDSRGzuLG32xu5HNHdmhyfogTB21oMz+w3Hcowg2Rhubmx vmgykzkJDWnEnZssahY5GVNw/yBeScKXS+boXi1ZAFuedyVQjW1zh0Q2FMRFK4JH/uJZ/p 8hpyydU206ywGTHQZZrcrNirKhQo2pnyD3vw2abTRcAeBNFrei64bRcDKmJkZGBPIY5oOO m2/A/jhp1j1o9Enk2D31oRBLYYu0Ldf1uNpTz2XZu8nERZMwnjjbtkeJ17fglg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721882947; a=rsa-sha256; cv=none; b=gLw8+Wan9rO3P+MQyl8Us8wpvUCwDrFEi0P9rJmQRrHX9gZTg8Slbxe7GjHjrHBjqvhyz+ bS64HDDL99ysNGPfmjE2KJTW7e1UZFobjnWq7C6IVHZTTE9INuE56zhjHXo83t5/pf8CIf K5HHaKmXb+KiDCLys/Uo/E9FdAWOwMB8iLB66JR8r4OXQNekkcJPWKxOfEfcDot0qmddb8 SHQuZtSKV9EtNALnCUGZM8I85jli3RT/HEjwh49nZ9zkZ8n3mtSKlwf1ICF7Qh97V2GNsv 03qhbnsIv8209WDfTUTb88aBaBF0aa0vulbnzoYQbnEQwtH0pmpBrWUn25JSdQ== 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=1721882947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PrMd70UsYWwGCK/XT1Zo0HIuJwAt3Ne3d4BCmwMRB7k=; b=fk5fnm5aGu1hGd6j35nmk8CeRoxHR9QPscGuWhW3aoit0cZE/A/GUVetCU+LVY+ttw3ndf PMHbVDpss9WiQzpgqhUib4rkk1t8Hqfx1wqZJIuB281+rgLABPBY9CCIiw/imBho9+k1dT oO1sYa8CszNKnYXERiJE25A5y6Gdu7oJq2koGdkI37Ov6XrM2RRfP0dq8HzbbJMXBD0gKF zI5P2CxmcUkNhBPfbnHpLsOVhgGov93/xlA5qhZArSgempfm7rQzfrx6+bVVLeKpUkugin l/FwhVrtQTYE+RgevLe+BvX0ZuwYc0ISBcHLPODwRycetwyHzlh7XrmGJYRf4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTz1b4hn8zhKq; Thu, 25 Jul 2024 04:49:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P4n7L9032146; Thu, 25 Jul 2024 04:49:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P4n7ZO032143; Thu, 25 Jul 2024 04:49:07 GMT (envelope-from git) Date: Thu, 25 Jul 2024 04:49:07 GMT Message-Id: <202407250449.46P4n7ZO032143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 028b16e2088a - main - cam: better ioctl compatibility for cd List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 028b16e2088a682c1abfb74fa5eb7ff64405ffff Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=028b16e2088a682c1abfb74fa5eb7ff64405ffff commit 028b16e2088a682c1abfb74fa5eb7ff64405ffff Author: Warner Losh AuthorDate: 2024-07-25 04:47:45 +0000 Commit: Warner Losh CommitDate: 2024-07-25 04:47:45 +0000 cam: better ioctl compatibility for cd Unlike xpt and pass driver, there's no test for ENOTTY in cdioctl to try the compatbility ioctls. Add one. However, this is a disk ioctl, not a cdev ioctl. To get around this, we cast the struct disk * to a struct cdev * to pass through. We cast it back in a simple wrapper function. PR: 198336 Sponsored by: Netflix MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D42666 Differential Revision: https://reviews.freebsd.org/D35312 --- sys/cam/cam_compat.c | 6 ++++++ sys/cam/cam_periph.c | 22 +++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/sys/cam/cam_compat.c b/sys/cam/cam_compat.c index fdb4ee8717ec..896b071f86dc 100644 --- a/sys/cam/cam_compat.c +++ b/sys/cam/cam_compat.c @@ -49,6 +49,12 @@ #include +/* + * Note: struct cdev *dev parameter here is simply passed through. For cdioctl + * we need to pass down a struct periph * which has been cast to a cdev and that + * is cast back again in cdioctl_dev(). + */ + static int cam_compat_handle_0x17(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td, d_ioctl_t *cbfnp); static int cam_compat_handle_0x18(struct cdev *dev, u_long cmd, caddr_t addr, diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index e957edee67f1..ed90ef91abce 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1122,6 +1122,20 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) return (error); } +static int +cam_periph_ioctl_compat(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) +{ + struct cam_periph *periph; + + /* + * For compat, we need to cast struct periph * into struct cdev *dev and + * then back again. + */ + periph = (struct cam_periph *)(void *)dev; + cam_periph_assert(periph, MA_OWNED); + return (cam_periph_ioctl(periph, cmd, addr, cderror)); +} + int cam_periph_ioctl(struct cam_periph *periph, u_long cmd, caddr_t addr, int (*error_routine)(union ccb *ccb, @@ -1178,7 +1192,13 @@ cam_periph_ioctl(struct cam_periph *periph, u_long cmd, caddr_t addr, break; default: - error = ENOTTY; + /* + * We assume that the compat layer doesn't care about + * the dev parameter. It just passes it through, so + * cheat a little. + */ + error = cam_compat_ioctl((struct cdev *)(void *)periph, + cmd, addr, flag, td, cam_periph_ioctl_compat); break; } return(error); From nobody Thu Jul 25 05:13:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTzYd1rY9z5RHpC; Thu, 25 Jul 2024 05:13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTzYc6Wf1z4b02; Thu, 25 Jul 2024 05:13:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721884404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E5+131ZCWFDZmTiK6lD+jFcIH3jqKrQfAxy+QJfVPG8=; b=ZAOi74ZbmvSQj0NTyXirjS+tw3mhCZfB81FjNLcLq9pPxUv6hR2IQpZmzV7tG7M1zXLieT vcSuwKysjSfclTyNoJksTUJqU6Vg7BuyS40qh8WhbujJS7pEJhz4vvZpHeEZ15ZPF4DhLe qt5yMzXJ0p5dhHn3zXoFINmllTLKLTmxBr6ccvLUN5ZdMeEQCSd63ldmsV+Vxo+8EVrc38 ssEqpgCDd39c3KkUsPU+pGywVmaIsGbZ9mn9OHEq296WBnHO2ndjES4avPfeZaX48CJ9TU xIc66L99shPQVZ5NexTt2JctLC7Qaxs9cJkW/6YCTzN+smXsKfgRKDI35bmQ7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721884404; a=rsa-sha256; cv=none; b=mHYDvL4/SJGNFV8mSosS6MK0VNABw6hBMCXpqLqU+Om43+S2PTRQ2gMFlMmF3wy3NJjpp6 6KQqx2J1mX8mXJwHn/RqABLpEmPQAur0Yn5taSCCcjlDRWaBY3s/CEQQF28Ms3MZPZ/SAh olUJm94g1osl3V7eLr6sufnI8zY+54XxRmUIuDyG2WffgA0jLDCilcxBKYWc8bn7wayT0r Wpdnw7Wg1IwlweXcZeaBUyO0TZ2ntVE639yVBSuy555xboNlGJy1SgPKPMjoxN3HQbV7sP xPyI0iHHXAUfHUsGPxxVXR0HcHuwGn7KcwekWycH8po6nwLmWL+odOPLKf6bUg== 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=1721884404; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E5+131ZCWFDZmTiK6lD+jFcIH3jqKrQfAxy+QJfVPG8=; b=LzZEHs49VI7igb1ILCwewUcJK434tlLz/i6BrDrwQVpgbldQSkMQ6oZf8FUe73Qe1YHIVd B8X9pxstGaXVX88ucrXf0yRyz5I5hWLeCfb8cn9iUpY3ew1AFqLHmI2R5J4Rq7NIXFAkQT HA5HOWx45KPsMyyYmX1vyPVf1tfk95AGaUuntTTgCfGFUz64B+/9fYoTrLefhPw8c09cB6 sfqxcVogEV67k3YbhwaCXmnN7FpF7jYHswCbA8ML0XxahUb+IVyTOaEPZ3xMsha74GK483 MK3fYpbATBuxXerledx4otuO5Q8MqpoSga5YL8cILdM4+QVFIVSAscLDC657jg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTzYc67mtzhjj; Thu, 25 Jul 2024 05:13:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P5DOwV082494; Thu, 25 Jul 2024 05:13:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P5DOOG082491; Thu, 25 Jul 2024 05:13:24 GMT (envelope-from git) Date: Thu, 25 Jul 2024 05:13:24 GMT Message-Id: <202407250513.46P5DOOG082491@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 06326613afeb - main - smbios: Add length sanity checking List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06326613afebc645433c6bf8a2249cf978db9e71 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=06326613afebc645433c6bf8a2249cf978db9e71 commit 06326613afebc645433c6bf8a2249cf978db9e71 Author: Warner Losh AuthorDate: 2024-07-25 05:02:27 +0000 Commit: Warner Losh CommitDate: 2024-07-25 05:09:57 +0000 smbios: Add length sanity checking D28743 was commited, reverted and then f689cb23b2782 landed before it was recommitted. However, D28743 included an extra length check. Redo that functionality so we check both the number of entries as well as the length checks for wacky data. Sponsored by: Netflix Reviewed by: gallatin Differential Revision: https://reviews.freebsd.org/D45763 --- sys/dev/ipmi/ipmi_smbios.c | 4 ++-- sys/dev/smbios/smbios.h | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/dev/ipmi/ipmi_smbios.c b/sys/dev/ipmi/ipmi_smbios.c index 546db8f2677c..f9fc958d9739 100644 --- a/sys/dev/ipmi/ipmi_smbios.c +++ b/sys/dev/ipmi/ipmi_smbios.c @@ -192,8 +192,8 @@ ipmi_smbios_probe(struct ipmi_get_info *info) /* Now map the actual table and walk it looking for an IPMI entry. */ table = pmap_mapbios(header->structure_table_address, header->structure_table_length); - smbios_walk_table(table, header->number_structures, smbios_ipmi_info, - info); + smbios_walk_table(table, header->number_structures, + header->structure_table_length, smbios_ipmi_info, info); /* Unmap everything. */ pmap_unmapbios(table, header->structure_table_length); diff --git a/sys/dev/smbios/smbios.h b/sys/dev/smbios/smbios.h index 42b7e1181486..01e67556cfc0 100644 --- a/sys/dev/smbios/smbios.h +++ b/sys/dev/smbios/smbios.h @@ -80,11 +80,13 @@ struct smbios_structure_header { typedef void (*smbios_callback_t)(struct smbios_structure_header *, void *); static inline void -smbios_walk_table(uint8_t *p, int entries, smbios_callback_t cb, void *arg) +smbios_walk_table(uint8_t *p, int entries, vm_size_t len, + smbios_callback_t cb, void *arg) { struct smbios_structure_header *s; + uint8_t *endp = p + len; - while (entries--) { + while (entries-- && p < endp) { s = (struct smbios_structure_header *)p; cb(s, arg); @@ -93,7 +95,7 @@ smbios_walk_table(uint8_t *p, int entries, smbios_callback_t cb, void *arg) * formatted area of this structure. */ p += s->length; - while (!(p[0] == 0 && p[1] == 0)) + while (p + 1 < endp && !(p[0] == 0 && p[1] == 0)) p++; /* From nobody Thu Jul 25 05:13:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTzYc19bpz5RHcj; Thu, 25 Jul 2024 05:13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTzYb5nzFz4ZxJ; Thu, 25 Jul 2024 05:13:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721884403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LXP9q3PphF85AEnNjkWObcdqR5HHzsGFl7LH9QRfuwg=; b=U2cgqoouIRrBN1g5T420j6Ex8Q5A7YOITWZ38CIMVn8MsWlhmzanLOWklgW2AdztHfS+AN o+uZ/B7JAmbFL7RR/j0a4rNbmEuM8MqhKFlCkUiaTSKVtS0GoL+wvaANHo2Lp0Eww8Gz4R qZh2Zz2foOWMZlXHaD4qbNTiffrIpQ7A1bUsPunzlh7fyRuk1KUV3CBB9bSXb9qrGb26tN 2mdlxvIfvU9F5WpuXrip2p9f5fO+H9RacNuKUnhdutGzh2/d1iRUxiE7jY5Xuzt4iZHrCC eT6BLZdFvbCU1lkzJlGwytK0y3S/JqI+pfAgxiVFWr1VM+DT7Ytw4WQjHn/ARg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721884403; a=rsa-sha256; cv=none; b=A328QzmEZEanIkOY8/h0CMhIaYtPE7xB27mShKIRUL2gZGvJxhBn12h2djVsbdmhPRgXZe A3YUT/zqzjmeD8cWB2PU8JXSWApM6z6SO4PR3vUzOUCVGZePxg7tb5mEGbuAjwfh7uW5kY pE98SY3qCmz/CfYiwsN8E1OX8wa/cAqZNRfAk9zwqLtWy+SEj+D1kzSuXzffGTqFExIx/P nUBm4Au6En9FOmWtOMNqDfFQlSvkntKIUuoG0mScsiJ/1J+evAmGUxNLcLYo9EbzVQtYmR muJv8mcuIfmdwtflse9TU84rNnbPl4oCr0I0Zv41SrdgEdiH4CG/UibOUM0UAg== 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=1721884403; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LXP9q3PphF85AEnNjkWObcdqR5HHzsGFl7LH9QRfuwg=; b=TugDJq0LIzWAf/v9jY4tHOimMiQjbu7pc2oN6/GNiD7sog8Yc1H1TR89lpyGErrsnHwSyI DvOZGqYZLizG/HbiQT3mfEf6sPOYUifNkQaOV/qjKCFd4Zs2XFZyXTmNznHx4eQEE75D94 uX63M4ElsHTIH5LUtyJXvjUNtg/nE9ZXR7iPikgUJkwsGJjsPAfw2IpFtuzND6pdADjOTK 4ehuT5c7r6DQyOsWdPhrC1O4hENKpAmUwHnbLQw35oOfQ8+e5Q8/6qZIYSxkGGT8hn4VBu VayyVwcJ5gOqINwlpYgjls1kl3VQHDnVIUS4V5LaVKg+hhdQ5oSJLHz+cOxU/w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTzYb5PYWzhgj; Thu, 25 Jul 2024 05:13:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P5DN3T082451; Thu, 25 Jul 2024 05:13:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P5DNDx082448; Thu, 25 Jul 2024 05:13:23 GMT (envelope-from git) Date: Thu, 25 Jul 2024 05:13:23 GMT Message-Id: <202407250513.46P5DNDx082448@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: ce41bee0b4b8 - main - ipmi_smbios: Only search for the BIOS signature on x86 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ce41bee0b4b876a55a94ce7cfa77421e7b274a94 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ce41bee0b4b876a55a94ce7cfa77421e7b274a94 commit ce41bee0b4b876a55a94ce7cfa77421e7b274a94 Author: Warner Losh AuthorDate: 2024-07-25 05:09:21 +0000 Commit: Warner Losh CommitDate: 2024-07-25 05:09:57 +0000 ipmi_smbios: Only search for the BIOS signature on x86 Sponsored by: Netflix --- sys/dev/ipmi/ipmi_smbios.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/ipmi/ipmi_smbios.c b/sys/dev/ipmi/ipmi_smbios.c index b30328e3e616..546db8f2677c 100644 --- a/sys/dev/ipmi/ipmi_smbios.c +++ b/sys/dev/ipmi/ipmi_smbios.c @@ -166,10 +166,12 @@ ipmi_smbios_probe(struct ipmi_get_info *info) addr = (vm_paddr_t)addr_efi; #endif +#if defined(__amd64__) || defined(__i386__) if (addr == 0) /* Find the SMBIOS table header. */ addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, SMBIOS_STEP, SMBIOS_OFF); +#endif if (addr == 0) return; From nobody Thu Jul 25 05:13:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTzYf2fxTz5RHMC; Thu, 25 Jul 2024 05:13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTzYf0PfVz4ZxK; Thu, 25 Jul 2024 05:13:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721884406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FpxpzqXGDxgxhOAuL2stY5mun9nkAegy2+9c9EgYSUg=; b=C1Yee7kcud/AHc4CT/SO6yxT3+HgMVsbzFy7aU2AToEGE7HnvIP7DQuSBnniwTlbXvKOle qbUHd+JsPftX1vl4jvho4u29606rLeZXjYTtsOOAx0xJ2IKCaSPXEldzUe/HVuorCNow45 tUXuwO+8uYz7XTVMYduY7foH4nXFmBRMx5KeUhMaeerbbslbmlbNsb7UaeTp5hmqQr1rgg YLa6f2f+RQinkZ7owg12Upi9iaxtnD9Rb+VDwWUd2VNzneSa7tPYjD+4BH1JrPBa9FjL1B hdnTYMWK3mEPkjbOODt8lnZ1JEKuFbc34YPq7xmVdBdza2AGlQXMwR1DSuo+4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721884406; a=rsa-sha256; cv=none; b=IYfZ3FHEwtJumg8vFTYKZFtYJUHOan58/YQwrPPgJ4gaY79usAOCLuCcD1mgN1w53q97rS kpuMLQrHBQ9J0GHJ2pSza95hCxe4imzhNsh1t+nNBsGUjoXvBFp33N7XnmWiVOWgh3t4rq Kj+spWnGXUwg8Jb2V6lIabA7zpd4ebh7Wnzc85ZBy75pmQr14+Xshq9mpDUYj4YmiUGJtz 2bphkl/PThmSGi+kO+VSDo2d9gMNw3oDmLN/1HXYP0At4/5pHWSkyd6kpYHsvGrXldxXAD +mAoSSB10NI7w1i+PyyegOnwpFaRBvswhv7qUo5iHGycWSNEQbB0HjLkukj/ig== 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=1721884406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FpxpzqXGDxgxhOAuL2stY5mun9nkAegy2+9c9EgYSUg=; b=fp6LMAouznky/A7EY/i6N0OZRhfxYxT6LMq8wbkzjrQLpBW8cpxMmS2lHjftpT4j8iSpha yU+AcfogxWL6F0TweSA6RWO5IKndjF8LTKNEyysGddKJ6VDtcmmYUyUJh2laMAxiQbirHP tBOd66BljQLqDhAqlf1U6emit6YWIzaD1UXnWhGbJl96w2OGIg52JUttpNSrBx3wywGP92 YSKnXRSELE57lXIl7nDv3LNnh5Q/CCN/uRKTq+OeBFIM06FBXpYbF54eJabKiQK9r7prmc jE4ycGdRxtVrX8c+mKKR6XgaRaV70obXYTpe4xrxe20nBATt93uMpIF/xsjtmw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTzYf014Vzhxl; Thu, 25 Jul 2024 05:13:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P5DPM1082536; Thu, 25 Jul 2024 05:13:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P5DPSn082533; Thu, 25 Jul 2024 05:13:25 GMT (envelope-from git) Date: Thu, 25 Jul 2024 05:13:25 GMT Message-Id: <202407250513.46P5DPSn082533@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2e35684a0390 - main - arm64: Add smbios to kernel List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2e35684a0390d6554bc7eb086f071a7fd7ec2c5f Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2e35684a0390d6554bc7eb086f071a7fd7ec2c5f commit 2e35684a0390d6554bc7eb086f071a7fd7ec2c5f Author: Warner Losh AuthorDate: 2024-07-25 05:02:36 +0000 Commit: Warner Losh CommitDate: 2024-07-25 05:09:57 +0000 arm64: Add smbios to kernel Sponsored by: Netflix Reviewed by: gallatin, andrew Differential Revision: https://reviews.freebsd.org/D45764 --- sys/arm64/conf/std.arm64 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/arm64/conf/std.arm64 b/sys/arm64/conf/std.arm64 index 69f333e32ed9..c83e98c17a33 100644 --- a/sys/arm64/conf/std.arm64 +++ b/sys/arm64/conf/std.arm64 @@ -102,3 +102,6 @@ options PPS_SYNC # EFI devices device efidev # EFI pseudo-device device efirtc # EFI RTC + +# SMBIOS -- all EFI platforms +device smbios From nobody Thu Jul 25 05:13:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTzYh5XKWz5RHvG; Thu, 25 Jul 2024 05:13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTzYh2HtDz4bGY; Thu, 25 Jul 2024 05:13:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721884408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=286LEXV3MAjSNpTVJLSulHJQr/0JqPd/sToaFsSssqo=; b=u/kAf1CtsuYrWxzkMKyVAgE2DIX/ngQV6fBedDBRwhpTlt5w8qVjq6tSb6gOWXF8Ry7a8p X9FcPzWUyQO1cawU2m5syQi02+4nLEma1QHr6WgFd3EH/ecgqXCa95OChoCKGx5g3+FNX6 xBCcj2uHnBgHb2VvbIzwHNzOfR2RcsJBgosyxhE64CNZNUKEOUrDOnuISedSIY4diKIE7m aVrcpWoSp9h7KGk9p3NAAVgunhRENmXAbs/g9unBcB883u0ocyoQKhcjd7SP/eRs+pK0Zd S6u40d66xaEvD+oujCYtHCbSQ3A3T/jRMqG6+xrDVOAhNZAKncq1yw0YpOr8HQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721884408; a=rsa-sha256; cv=none; b=W2iw/oun9+NdfIsSL5dEpHBNBQ8UmmMuJXdYXR/H66ysH95vOqF66pG7ZbYeEkgKMbmnaO tculwgp2HFSCrYXsUS0m+kTe1MJTN7ypHgMUPHg5IqZMKDy+ZKGeZrcu61MDtf6MZVFxHE 0ruedyMUAS0Eqi66/pDL4QOwwmUxdWoREMmgcM1FZ4shExkDjREX2YlvcqQ7g6LNxNo6hw 3RZ7FYvTAG52dGuHUC620/58FuE6SvKEDGxzMGPPHvrSsS+y6dPe6jrgp56Dg4yjPlx1yx ul9eeRTLTwR0smoYiXLaZ3JavM03NgasLH+i1us5wZJH3/AD8/v5NqT5/UMupg== 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=1721884408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=286LEXV3MAjSNpTVJLSulHJQr/0JqPd/sToaFsSssqo=; b=xPvJBXOdmIEwepWMMkqirA9ApXS4sPpT6V/bzGxwEGGRMBHfx4GsfggTuR0gKTBVnLJUMz 406ezRR3LAK1Iy+QJKXE8/uBSpqTYDSzql1mtdFpZn2TQz8jOL0R+hKKxxf9bHI2nHBhro i2smygm7gqWG/z3qT+p1gCAng5N3r+jErZyvbdQkbRCuVtbID48h3DmHGx3ghbHX2L8sHS qIDYurodNrP3L5G0ksIDKYfT76/zhQo9beQDToFyey1F5Id2nthJZwglm0aFAX/YuUokz3 5HT9Grqw6whZi0cMH0qqzALhqkQPt2iTVSHVakdGHQ2VQCItyRh909T0tOhP8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTzYh1w37zhw5; Thu, 25 Jul 2024 05:13:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P5DSU9082623; Thu, 25 Jul 2024 05:13:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P5DSJT082620; Thu, 25 Jul 2024 05:13:28 GMT (envelope-from git) Date: Thu, 25 Jul 2024 05:13:28 GMT Message-Id: <202407250513.46P5DSJT082620@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 169d06911699 - main - smbios: Compile into the kernel more completely List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 169d069116996b5c7bc84b65d21adf1272f3b304 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=169d069116996b5c7bc84b65d21adf1272f3b304 commit 169d069116996b5c7bc84b65d21adf1272f3b304 Author: Allan Jude AuthorDate: 2024-07-25 05:02:47 +0000 Commit: Warner Losh CommitDate: 2024-07-25 05:09:57 +0000 smbios: Compile into the kernel more completely Compile more of the IPMI into the kernel, and include all the dependencies in ipmi.ko. Sponsored by: Netflix Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D45765 --- sys/conf/files.arm64 | 4 ++++ sys/modules/ipmi/Makefile | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index a6bd1a1ba60a..0ff18cc6dd99 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -383,7 +383,11 @@ dev/ipmi/ipmi.c optional ipmi dev/ipmi/ipmi_acpi.c optional ipmi acpi dev/ipmi/ipmi_bt.c optional ipmi dev/ipmi/ipmi_kcs.c optional ipmi +dev/ipmi/ipmi_pci.c optional ipmi pci +dev/ipmi/ipmi_smbios.c optional ipmi +dev/ipmi/ipmi_smbus.c optional ipmi smbus dev/ipmi/ipmi_smic.c optional ipmi +dev/ipmi/ipmi_ssif.c optional ipmi smbus dev/mailbox/arm/arm_doorbell.c optional fdt arm_doorbell dev/mbox/mbox_if.m optional soc_brcm_bcm2837 diff --git a/sys/modules/ipmi/Makefile b/sys/modules/ipmi/Makefile index 9419100cc01c..e143b264d083 100644 --- a/sys/modules/ipmi/Makefile +++ b/sys/modules/ipmi/Makefile @@ -12,12 +12,17 @@ SRCS+= ipmi_kcs.c ipmi_smic.c ipmi_bt.c SRCS+= ipmi_acpi.c SRCS+= opt_acpi.h SRCS+= acpi_if.h +SRCS+= ipmi_smbios.c +SRCS+= ipmi_ssif.c +SRCS+= ipmi_pci.c +SRCS+= ipmi_smbus.c +SRCS+= pci_if.h +SRCS+= smbus_if.h .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -SRCS+= ipmi_smbios.c ipmi_ssif.c -SRCS+= ipmi_isa.c ipmi_pci.c ipmi_smbus.c -SRCS+= isa_if.h pci_if.h smbus_if.h +SRCS+= ipmi_isa.c +SRCS+= isa_if.h SUBDIR+= ipmi_linux From nobody Thu Jul 25 05:13:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WTzYj5JPdz5RHcp; Thu, 25 Jul 2024 05:13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WTzYj31DHz4bGb; Thu, 25 Jul 2024 05:13:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721884409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OZ3RA4IvKDQRXe4TgTgCX0Zd+r2Fj8emIXMvZGtLl/Q=; b=Z/nMmoGwk9zu1sJ518vfdHMsnq3MYEwcJP0vtPCVMMh0xtjlRvsNrrghq3WZ7EqRf5FzWx Tg647ScVFLC40geot4A3BnP3LHnfPiC+XG9XBRtw915cRFUYlx5IowffDeWNlhjyMeZOJv /gNv/52KG0pRWC62Pg1E92OHBUXCgjJp/HF4THm0M8w+9EVrRz416xR6MMwYl4g4GrRKKc 3f9oTsbhj+U3zraLSdrKnKohjj9avOUEcZCwU5+vtO3iHnR9XGrmOiTdHhDOyemf9ujYrz rUm2L0CVZsFOMMo00b3jAyZylM5+T8Wchvg6lXtjdUcFDbF558Y4RX1T2D/Z7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721884409; a=rsa-sha256; cv=none; b=JPZVB0ETEvWEa/+dwKp4syfxHlpnBFb6iHHw9ViVPaDaUCVi87uljrUFdfF6RSBo1s4hC3 r0/7PDFgNJVEd81SmrpENsBrbtGKI4qTI+MU2pMQv02ScxJOwucESmBeRurykyTqUNHwlp 6sV0EcSnRjZCZqcAcoHT0p3fcuU9ybfiG1J3wjfLjx4eRHJXhIikdUovSXzhQFSsbT3uH3 63cziP2yrHmkns4zDUmrR4JXZDai2AXPPbbfmJZbJSQzW5bKC4gNONY63/9+WR9ohws+wi EECUCyqNETRXM8iM88sBZwwTvZQgk0KM6QHNCWl3esseT5M/Qp3WuvMSV3YboQ== 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=1721884409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OZ3RA4IvKDQRXe4TgTgCX0Zd+r2Fj8emIXMvZGtLl/Q=; b=qRoajqq47Ng7v0V8pRTXn1hBYuwr6RQj8gDc34O5bd9AC4frkoTbSwn7ZHClrY6XCO/Frp zjwOlIJAFAgPaslWIsw4H+sG9zJ7MjXyHrhbYXmy+SWH4wt64Zuyr2kKi2NP+YgE83HyOY swISrFVgaFGxMQriA3jAsywD5zuo5WXijRbFk6zmJ1raaRhQPUtXvbC4QbtuWMJg8+TwUu PGDU6D63vKRz5eSMloMX6pmWNfLZVUWsNEEGOXyML8QXOYXR77Xf6bCvIEFpuidBVahmEJ ANT4N18mh7dw00omQItTpHPYilJZ0H97RXFuv6rYMVVgWni4b9dCtwKEt191UA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WTzYj2dYfzhjk; Thu, 25 Jul 2024 05:13:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P5DT7L082676; Thu, 25 Jul 2024 05:13:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P5DTLp082673; Thu, 25 Jul 2024 05:13:29 GMT (envelope-from git) Date: Thu, 25 Jul 2024 05:13:29 GMT Message-Id: <202407250513.46P5DTLp082673@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 4eee292ab663 - main - Revert "cam: better ioctl compatibility for cd" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4eee292ab66316c01bae887e6d5a3468e1c27e77 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4eee292ab66316c01bae887e6d5a3468e1c27e77 commit 4eee292ab66316c01bae887e6d5a3468e1c27e77 Author: Warner Losh AuthorDate: 2024-07-25 05:03:41 +0000 Commit: Warner Losh CommitDate: 2024-07-25 05:09:57 +0000 Revert "cam: better ioctl compatibility for cd" This reverts commit 028b16e2088a682c1abfb74fa5eb7ff64405ffff. The wrong version wound up in my branch, revert while I find the right version. Sponsored by: Netflix --- sys/cam/cam_compat.c | 6 ------ sys/cam/cam_periph.c | 22 +--------------------- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/sys/cam/cam_compat.c b/sys/cam/cam_compat.c index 896b071f86dc..fdb4ee8717ec 100644 --- a/sys/cam/cam_compat.c +++ b/sys/cam/cam_compat.c @@ -49,12 +49,6 @@ #include -/* - * Note: struct cdev *dev parameter here is simply passed through. For cdioctl - * we need to pass down a struct periph * which has been cast to a cdev and that - * is cast back again in cdioctl_dev(). - */ - static int cam_compat_handle_0x17(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td, d_ioctl_t *cbfnp); static int cam_compat_handle_0x18(struct cdev *dev, u_long cmd, caddr_t addr, diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index ed90ef91abce..e957edee67f1 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1122,20 +1122,6 @@ cam_periph_unmapmem(union ccb *ccb, struct cam_periph_map_info *mapinfo) return (error); } -static int -cam_periph_ioctl_compat(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) -{ - struct cam_periph *periph; - - /* - * For compat, we need to cast struct periph * into struct cdev *dev and - * then back again. - */ - periph = (struct cam_periph *)(void *)dev; - cam_periph_assert(periph, MA_OWNED); - return (cam_periph_ioctl(periph, cmd, addr, cderror)); -} - int cam_periph_ioctl(struct cam_periph *periph, u_long cmd, caddr_t addr, int (*error_routine)(union ccb *ccb, @@ -1192,13 +1178,7 @@ cam_periph_ioctl(struct cam_periph *periph, u_long cmd, caddr_t addr, break; default: - /* - * We assume that the compat layer doesn't care about - * the dev parameter. It just passes it through, so - * cheat a little. - */ - error = cam_compat_ioctl((struct cdev *)(void *)periph, - cmd, addr, flag, td, cam_periph_ioctl_compat); + error = ENOTTY; break; } return(error); From nobody Thu Jul 25 06:11:00 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WV0r46VWpz5RNqw; Thu, 25 Jul 2024 06:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WV0r4645tz4gt1; Thu, 25 Jul 2024 06:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721887860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SsjsCg/3nsYuCRr5WOTsUrOYPcoqBFdZJlj7V7mlpYQ=; b=R4TGLocj+CEpNU/HZnQRugnAksVpQ4EGNt6UbAIbDM8bG1E5QnerBauhO5345zjohfVQ4v gEI+8kfjL17m5YYE5Qx0wGNp6cRGhpN8r45YgtPKbZENNhLblA1P67pVSakkqMPIqWK6xf arfATftTR7aFiCl2KnOaDBzcxCBjWZxwo0f9GwrdymEQwxuGeCA/ggJ8QrHu4y9VH8W/xm 7hdGg20DrGi6fL5ZugsZP49Zp7rtf4Zjp61n6We8C7H3VZN4kJX1LBLFJXoVfUsYfxC8M3 Q5SV+mRB9vj5t1FUsxZXnThcY1twUzDuhU5r9G8KMM6MiD0dfR2FmdVbu3PpTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721887860; a=rsa-sha256; cv=none; b=I9rIna7TGjzGEhRM8xPE9VbLRdnEicxS9ZQZ1nhFKrK7S8usjyR7ZjED9daUh29egWX4g1 mtr7T6VaHSgZ5fcOc8daClZ9yl5vVOPOENGkWNCAcDN9Vq1msebBOZGoUJSXr3Lr4DOA/z NMAuTm6Zyg+g0ybspQI2h7xZxagW3TVnh4Z+sVz1/regKQ00aCuGrBQ1t6fSwY4la0ILfg TcXEfTpSXTNCRy+jVWSnVVBQez4hOwgOfUcgh1pnDW4YVlfjBsXeEpN4Tw/ScAChwNVz4y 7JUyX4K9r4OBN/fQMQ3vB6m5VVjHn6n9TKWNSCvl90BmJJoWpl6o2f4VHQXBWw== 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=1721887860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SsjsCg/3nsYuCRr5WOTsUrOYPcoqBFdZJlj7V7mlpYQ=; b=Qdq+qAvkNjTrmIXZXuWf3GHFZHDM29hz6jXbRLNqESwY/ONh8GuQoXGgRUtTiwO4abPFAX UBmj3t4CeKI7OmFS3qy5gMh9fwDpwwtBF+oJqw90ic2UQFMYmC3OdluknR/HvyCjK8ykqp YdDbkhFAzoJYi2ctiRfmLovs2a1Z0r86IxT8QMjHK5Jp6NT877sl8mGvxPJWCEzzaFoVTP FNWNl+sZGCqimP0Psu55fKaqiRFNndUMKEkhGPjE3mBeKR9BF4kPFl7FH61WASN7v1Pxqj jAPTPoNMMuQCNLDIr7/z1oA3TzFzEmlfKz6r/5UJErNl7Xy69CbbldIvjkRawQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WV0r45gYtzk3B; Thu, 25 Jul 2024 06:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P6B0q5080946; Thu, 25 Jul 2024 06:11:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P6B0dT080943; Thu, 25 Jul 2024 06:11:00 GMT (envelope-from git) Date: Thu, 25 Jul 2024 06:11:00 GMT Message-Id: <202407250611.46P6B0dT080943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: cab41e0dd31d - main - Do not allow snapshots on UFS filesystems using gjournal. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cab41e0dd31d184bdb0d14403ca71a0f6c9a5e83 Auto-Submitted: auto-generated The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=cab41e0dd31d184bdb0d14403ca71a0f6c9a5e83 commit cab41e0dd31d184bdb0d14403ca71a0f6c9a5e83 Author: Kirk McKusick AuthorDate: 2024-07-25 06:09:58 +0000 Commit: Kirk McKusick CommitDate: 2024-07-25 06:10:47 +0000 Do not allow snapshots on UFS filesystems using gjournal. The gjournal implementation does not properly handle the freeing of blocks that may be part of a snapshot. Adding this support to gjournal would require considerable effort. For now we simply do not allow snapshots to be taken on filesystems using gjournal. Reported by: ant_mail@inbox.ru PR: 280216 MFC after: 1 week --- sys/ufs/ffs/ffs_snapshot.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index e0f87223942a..b0adb6c033c7 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -222,6 +222,15 @@ ffs_snapshot(struct mount *mp, char *snapfile) ump = VFSTOUFS(mp); fs = ump->um_fs; sn = NULL; + /* + * At the moment, filesystems using gjournal cannot support + * taking snapshots. + */ + if ((mp->mnt_flag & MNT_GJOURNAL) != 0) { + vfs_mount_error(mp, "%s: Snapshots are not yet supported when " + "using gjournal", fs->fs_fsmnt); + return (EOPNOTSUPP); + } MNT_ILOCK(mp); flag = mp->mnt_flag; MNT_IUNLOCK(mp); From nobody Thu Jul 25 06:47:39 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WV1fM2z0bz5RRpF; Thu, 25 Jul 2024 06:47: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WV1fM2RMLz4kqY; Thu, 25 Jul 2024 06:47:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721890059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K4NYDy957tixlm1/LartaLatPm2nWZt6Cy5sSp22ed0=; b=bJYhCfOFiNy5/TkqvAr2Xxe7M3z9OhC4+WMEzrjrbCYqgMghgClxWXZ4nBovLpP+pm+VJ6 iseZvAm1eY8u1XZgjqPRdQqpkRept6N0Q4Rt4A8uPz/e5Sz2FUBgBTTZfVP3AeJxL3wDW8 aa++nDRinPS0lu29KUnHo9kvdHZ3L/psZ235FAHjVSMDP9bRAbGcjKAlLKS2+MKXb8HjkE ZBzSAQOg2y6pX238MVH00ETvqw7diF6jZ2kCUDTFZ8nOlr5khsxBYUpw1KDDqtO/PM31Jw tLB2vvQvQu9d8n8YK6G8qxm+jhEUIl7LyOzutIVkW4cHbQR3ungAJKXH2HGoQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721890059; a=rsa-sha256; cv=none; b=QUTZ/ztWm5odaUlrpDqeapHppE83IHK+p7scEeers9Cfj4Abj+ZJWCz5PVKUMVUSb/s9pD sRBAbyj04W7Hr3/lqJ5htcNx2gjw3h3CHeLYFpdjPP0UAlAgkAGgRk2sgor0nKGr0DFCjA eUuuJQfN2idCXTWN+Kq/ItBY/h7IktXY/g1p0lqzl374+X+AoLfLl6+UOgni7pFXohQ7Tp DyFlnKYSHmZoroOHgh+/Tf+eBDHsbBeQpFYHJyfQQJlUoMbctmcQvHiJ/4zvyOud6g0Kiq 7+x0keeuAJcwMDkZK7y613ClZMKdDlJL5QKQwDwWDuQx4lT3RsErlq8lihVFwQ== 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=1721890059; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=K4NYDy957tixlm1/LartaLatPm2nWZt6Cy5sSp22ed0=; b=sbO4idg9qj60OCErjgd4H5NfuNF1EtC4W+xzpCF0v0c/1R7rt8DoO3Xa5m6pvCEUgNUFAe 6HZpmrC3FlulCL6wDvbVOyezP1I8AsJG/66IKjX5fTZQXe1/JUy3UAKx11ZqBWqqcHchVP rvgfjZEjJUxBXqbNlYXFv96w0wLhdVL4FDDLUdPmGWI8DyH1HJ1EeI0r4nNDPvr+wpnlMD 0o2FJ4rSxrBFJKfHh+taUMErC9nWsF3cnMUOfF52ebRs8p77Bqu8q/ugUSHnM+4Sv5aYdu VMMHPOGl2hW0a52QrBaRoZYxBQKCOt6zmMMYaduRyB+xtHoI+Yv6SaAG1Sw/kQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WV1fM22bTzl4r; Thu, 25 Jul 2024 06:47:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P6ldh3035277; Thu, 25 Jul 2024 06:47:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P6ldHN035274; Thu, 25 Jul 2024 06:47:39 GMT (envelope-from git) Date: Thu, 25 Jul 2024 06:47:39 GMT Message-Id: <202407250647.46P6ldHN035274@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 98dd639c94f7 - main - arm64 pmap: Eliminate an unnecessary conditional List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 98dd639c94f716858ae29958f484729b1d2fd387 Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=98dd639c94f716858ae29958f484729b1d2fd387 commit 98dd639c94f716858ae29958f484729b1d2fd387 Author: Alan Cox AuthorDate: 2024-07-24 22:32:32 +0000 Commit: Alan Cox CommitDate: 2024-07-25 06:46:47 +0000 arm64 pmap: Eliminate an unnecessary conditional Eliminate an unnecessary test whether a pointer is non-NULL from pmap_bti_same(). Reviewed by: dougm --- sys/arm64/arm64/pmap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index 2540b5eaf4b9..59de6ef37f09 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -9396,8 +9396,7 @@ pmap_bti_same(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, pt_entry_t *pte) return (false); rs = next_rs; } - if (rs != NULL) - *pte |= ATTR_S1_GP; + *pte |= ATTR_S1_GP; return (true); } From nobody Thu Jul 25 09:17:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WV4z01YXmz5RgRJ; Thu, 25 Jul 2024 09:17: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WV4z00m6Wz414C; Thu, 25 Jul 2024 09:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721899036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NlNesoJ+2RHKNAnSsUctwd3OlSmIXcTcH7/nMzsojak=; b=oUdEvmsAuFUvNaG5i5a8BV56wuMgX4N+Di/wOLIiVlOWiTUQPMGRyAuY3zaO4PDdy38FDw R0HChSyHHDY8Go/Awg830yjHNgBXh7myJ3tENHw8r+HyJo+GZQn/nZ17bHGjl8d3uZLTMS nTRZ/kML//Db3kOlWXyQQw1UBHPGqxSPvHrdP1d4VfEJumro2NiUK7hkUEb9WxcdDPBee0 E9aP5rvJVwyoPHrUsqYJOH9nBA0AGDlpk0CIhtw5hu9OupA5FJe3O7N0hIRpLgMtR8LQdf 7YmwISUZgFeGd6Ekr0nnQKA5dI1tU9ypggLuAxqny7rk93jdnV8LRe1GpOiyzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721899036; a=rsa-sha256; cv=none; b=AZI4xH+yXMZC9nmNwuPkBqfgtAw7GirdnajpuQjWTH2WcKMRM2vCeWbUXhnSMuAlnGBG8k cXPsokGSu/YMv+cE4xOQDis6OHWHoZOSIT0UOk1tFZ3dUxUztuKIY3G/wa3+sFAiE7xVdf +liAgyXu2EpdbVKcnvzw3sgXgcSGrEs/itK2LD7qppb+Fg9oupVusxVu5u1IqnbMMvQuWt ME/wuk2ty7Ml6bfG+XkezqNxu58cyJGDzNi1Il8OpGDcfMaE7Y38yQ5WdEMjlusakp7hqr BcnR7kubQCgj1ILYYS2NlY7bfN06yfIIIq7bj0JEoJUsXlTYpxmq42venvAjNw== 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=1721899036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NlNesoJ+2RHKNAnSsUctwd3OlSmIXcTcH7/nMzsojak=; b=Hm73EQY5/iXme9MEV4YhHszMoBvGq+IGYqNUL+u52eYFNH5K9C/16p1+DZmAkIqJ6ExrKN IFdh47lTuxr+hTCKFPr7vFnlJo4Kslw/wD+IMCZw6airJlUJ27eze/OTRr3wLs1lKudm/e IfqNyidM0SOY9xhUproB+XbY6oR1v4xx8xcF8+1DgrbqVDbQY/1f2eFyU+qczVckw7DT+U iOgOLi1eZmQmYw02E7rE3Cos4c7mtaa8CGe4sQBySMXYJmnEvcup9ztgq3VLKyWgp+Yqiu X5mounqnKuM6A+aqmou+u6PXNRo9UCrS3WRTVlR+YPAmy2kgeCchJYMmobHEYA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WV4z00FLhzq51; Thu, 25 Jul 2024 09:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P9HFTx089619; Thu, 25 Jul 2024 09:17:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P9HFVb089616; Thu, 25 Jul 2024 09:17:15 GMT (envelope-from git) Date: Thu, 25 Jul 2024 09:17:15 GMT Message-Id: <202407250917.46P9HFVb089616@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 1991946cff2a - main - CODEOWNERS: Add nuageinit List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1991946cff2a4c87c9272c2ccc1c2fb3b1cfba96 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=1991946cff2a4c87c9272c2ccc1c2fb3b1cfba96 commit 1991946cff2a4c87c9272c2ccc1c2fb3b1cfba96 Author: Jose Luis Duran AuthorDate: 2024-07-23 18:06:37 +0000 Commit: Baptiste Daroussin CommitDate: 2024-07-25 09:15:29 +0000 CODEOWNERS: Add nuageinit --- .github/CODEOWNERS | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a66910608d92..98ef1f5db2ce 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,7 +2,7 @@ # No locks listed here are valid. The only strict review requirements # are granted by core. These are documented in head/LOCKS and enforced # by svnadmin/conf/approvers. -# +# # The source tree is a community effort. However, some folks go to the # trouble of looking after particular areas of the tree. In return for # their active caretaking of the code it is polite to coordinate changes @@ -11,21 +11,21 @@ # committers can easily find somebody who is familiar with it. The notes # should specify if there is a 3rd party source tree involved or other # things that should be kept in mind. -# +# # However, this is not a 'big stick', it is an offer to help and a source # of guidance. It does not override the communal nature of the tree. # It is not a registry of 'turf' or private property. -# +# # *** # This list is prone to becoming stale quickly. The best way to find the recent # maintainer of a sub-system is to check recent logs for that directory or # sub-system. # *** -# +# # *** # Maintainers are encouraged to visit: # https://reviews.freebsd.org/herald -# +# # and configure Phabricator notifications for parts of the tree which they # maintain. Notifications can automatically be sent when someone proposes a # revision or makes a commit to the specified subtree. @@ -58,6 +58,7 @@ /lib/libsecureboot/ @stephane-rochoy-stormshield /lib/libveriexec/ @stephane-rochoy-stormshield /lib/libvmmapi @bsdjhb @grehan-freebsd +/libexec/nuageinit/ @bapt /libexec/rc/rc.d/rctl/ @trasz /sbin/ipf @cschuber /sbin/mount_fusefs @asomers From nobody Thu Jul 25 09:17:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WV4z13HvYz5Rgcc; Thu, 25 Jul 2024 09:17: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WV4z11Lqzz40n7; Thu, 25 Jul 2024 09:17:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721899037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LWnE5kAnr/di0A1gwudzvftKt1Cb4PuCxmedeCw1KkU=; b=v1TXEyuZQiZSrKZGqhe1f1yMx68UaDSYO9FgkAoTbVfZU4KDTsKAlMYefhm8hke5RJXMkQ 0tCkRWuVwhkYwys2tLeLtyswXkd61G9bQArKgis7aKvbbsZPRcCk0lOUMrGGvy5w9sgdrE mJuTwbx0bNQeOV/9yU5eZis7SiiuU+MwmBXi3cshvSFX7LASG+5jz3XPG4aeYmDpNFKQX7 AjGVXS+FrHR1f66oHB5xZUBUgVrmtw8EduJZIcg39/2obXAtT/dMkpVMKdhYSva+rupwrF XurL/w9ZoU+ZO41MnFL0us3rr0F0M3d2oLKs16dcWCT8Hp6dJG+7tpNEVASHIQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721899037; a=rsa-sha256; cv=none; b=Kr0Y2Rem2x3ILOHzfwBNUuhLIINFG6oQdo6KbciNAFtdlekGl9Jm8PY03lAHMTbM3RJnvZ hIdJhLgWGWyJE0XmJCM+VVgySwdhUlxz6YNL/aPuwgomtl/HgICi6EMwA2DZvfYWDIO4W6 yikBMZsNeM5O1FaB03lhmIHAdcW9ZmlpscZJma7zWlGePICDnIV4vR2kUGsofN4MpR43Mo j5mCUMTf7A9hdGOWNw4Gh0pvewEkGsgRoCMoZbViF38cHxH9RfBqL1m2vQCqL5WKfNHeEM FZ+69TYU/KurFSSyXlvd7AfIW5xfUaTqRp2gryanlDzXFZiqq86R1/0taOQrHg== 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=1721899037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LWnE5kAnr/di0A1gwudzvftKt1Cb4PuCxmedeCw1KkU=; b=osZ8NRns9YyXW9qTNliQ8z2cA+gG2UwgNjFqhRmD5nZzibF844mr2duyTep9H5TvWzTzN3 ULVOs/UkMCGcOxi8WHSchLd4YlSs4Ojylu34/LXRJ+9eZcXMFuI99n5ufiE4ywvnXF82jI Sfud4wY6Pg4IOnpKtRQPtxl+Rd/F9NIodP/jibo4VtIEnZkpMY+WfYRjMlCVIvOCt5fDtm YtNpTPR/7RyVTQ9BemJwKaN3MS7Hob3gOuYyxCuOnd4eMUM6yggqMQOLLBvfiPZkUSTPPT LOCl8jITpWO5IJUPR9KlgP+5MTbm01dLvEPDlWwMSBHBTUM8Obv6oDMha30zmA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WV4z10ytxzpLG; Thu, 25 Jul 2024 09:17:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P9HHNF089766; Thu, 25 Jul 2024 09:17:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P9HHu3089763; Thu, 25 Jul 2024 09:17:17 GMT (envelope-from git) Date: Thu, 25 Jul 2024 09:17:17 GMT Message-Id: <202407250917.46P9HHu3089763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 7aecd689e362 - main - nuageinit: Fix the homedir variable name List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7aecd689e362330a035a199afbe5707a8c4edc9c Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=7aecd689e362330a035a199afbe5707a8c4edc9c commit 7aecd689e362330a035a199afbe5707a8c4edc9c Author: Jose Luis Duran AuthorDate: 2024-07-23 19:54:54 +0000 Commit: Baptiste Daroussin CommitDate: 2024-07-25 09:15:29 +0000 nuageinit: Fix the homedir variable name cloud-init uses homedir, not home. --- libexec/nuageinit/nuage.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua index 10451dc0bdc4..cca1fe9b4678 100644 --- a/libexec/nuageinit/nuage.lua +++ b/libexec/nuageinit/nuage.lua @@ -86,8 +86,8 @@ local function adduser(pwd) if not pwd.gecos then pwd.gecos = pwd.name .. " User" end - if not pwd.home then - pwd.home = "/home/" .. pwd.name + if not pwd.homedir then + pwd.homedir = "/home/" .. pwd.name end local extraargs="" if pwd.groups then @@ -120,7 +120,7 @@ local function adduser(pwd) end cmd = cmd .. "useradd -n ".. pwd.name .. " -M 0755 -w none " cmd = cmd .. extraargs .. " -c '".. pwd.gecos - cmd = cmd .. "' -d '" .. pwd.home .. "' -s "..pwd.shell .. postcmd + cmd = cmd .. "' -d '" .. pwd.homedir .. "' -s "..pwd.shell .. postcmd local r = os.execute(cmd) if not r then @@ -136,7 +136,7 @@ local function adduser(pwd) cmd = cmd .. "lock " .. pwd.name os.execute(cmd) end - return pwd.home + return pwd.homedir end local function addgroup(grp) From nobody Thu Jul 25 09:17:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WV4z26FKkz5RgTV; Thu, 25 Jul 2024 09:17: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WV4z22r6kz40yJ; Thu, 25 Jul 2024 09:17:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721899038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rQaIwWJClxzttZSlVQqw8oUucWDB1JoVDXiOeydDals=; b=lnzH4ILCnQVYlIQ6fwQWXenx5iHTZwrWLLee4wvUXXSOYKZfmtmagRmP1R5LpW2rJihuDo hJHjM8LXkujrmh8DqPgsyJhO4I5NGyJhK47Nrt7lm+DG6ZItIPu74BizKFPLCV9VnqGx9c 77pmRQxPmS4ZGsDmU2tXauAVVc25h7wFQdtI5p+y+XrkkqWqTI8Z+RCb1DTgiov/YzUwiP i1+LclfKYJuVnyC3/nOopj4ZmI22bIWO++zP1wDjtQcCRHHx/eeTj6BSWfgLd/4JRqlYLr lvH+GvWsZlCG1c+SmpooBX/HreXqqq/SEnpa2n68tG0Hp/ZGfPRVmLP9QdY3qA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721899038; a=rsa-sha256; cv=none; b=ANkBSKEHFligP53UywvpLBBMrk9Gqelu1FqG4cu1UyxutCT9sxYHXFbXfWGZ0BtGZZ/3Ze +IDGBAqR9l9S0qG25Q1xzrhjMUL7r/N7KP+jpejM8MS1+8/PBkd9i5UxArxJnEKd2RvGR7 Snk/41LpnfyeHRxKwU1JiFNAy7dSTjA6AURe/mB8FYHfql35mk7/xqDSetleDyfVqE3A43 yyAu//IkHbuJMRCakZL675mhdPLOrOcTSh5ZQ/SXDrYoIo2labIoDqEMBRvO5mUT9PTwgr c9kPNWy0jR+IadmL8m2KR8loEMdVNbzjxCM0e/0JPQpNipdLBMXxJjWwk+TmOQ== 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=1721899038; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rQaIwWJClxzttZSlVQqw8oUucWDB1JoVDXiOeydDals=; b=UEGPv39sAvt4nTvpSRwiuGrQKboH2v1dNZFGZRsX3r+vq4hSlFw7ZHxUZGHHmtH9Cq0feM 8GBvmZiSslFm03tmmSo6dWTYst9nApT06ukMvfhe0xeforXeJuq1f7GHDSBMaVeFs4yhfW oeVKzq/gd4gRekbdzqVOvH4Id+F3A/McFTF+oQD8oMQT4gPWBbhSOCD2DEHPmM9iwKUR0n lCO4SG8DXdmeLr3yrMq2hC3o9/byPcPK7b4+2IE41HAqI3zUatBLDq2fQJjvQfVc86qCeW kENr0VihmkuhQ1kMpGWUFfXmAZWVWyWsbMaCG9Re3Btw36z0NW1ydXuvy/UOqw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WV4z21w9Dzpv6; Thu, 25 Jul 2024 09:17:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46P9HIHO089835; Thu, 25 Jul 2024 09:17:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46P9HIum089832; Thu, 25 Jul 2024 09:17:18 GMT (envelope-from git) Date: Thu, 25 Jul 2024 09:17:18 GMT Message-Id: <202407250917.46P9HIum089832@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 8edd6c07c8da - main - nuageinit: Fix tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8edd6c07c8dafcc5828bceb5fea0684c7d0d0775 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=8edd6c07c8dafcc5828bceb5fea0684c7d0d0775 commit 8edd6c07c8dafcc5828bceb5fea0684c7d0d0775 Author: Jose Luis Duran AuthorDate: 2024-07-23 22:28:45 +0000 Commit: Baptiste Daroussin CommitDate: 2024-07-25 09:15:29 +0000 nuageinit: Fix tests Commit 07d17ca189fcf3cc44b7706040b05ca8135c3b85 set the recommended permissions for the SSH authorized keys file and directory. The tests, however, were failing on CI. Use stat to check for the proper permissions. Fixes: 07d17ca189f nuageinit: Set recommended SSH permissions Reported by: Jenkins --- libexec/nuageinit/tests/nuage.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/nuageinit/tests/nuage.sh b/libexec/nuageinit/tests/nuage.sh index 531c171a3271..29842bff3d6b 100644 --- a/libexec/nuageinit/tests/nuage.sh +++ b/libexec/nuageinit/tests/nuage.sh @@ -17,8 +17,8 @@ addsshkey_body() { if [ ! -f .ssh/authorized_keys ]; then atf_fail "ssh key not added" fi - atf_check -o inline:".ssh: 040700 [drwx------ ] -> 040700 [drwx------ ]\n" chmod -vv 0700 .ssh - atf_check -o inline:".ssh/authorized_keys: 0100600 [-rw------- ] -> 0100600 [-rw------- ]\n" chmod -vv 0600 .ssh/authorized_keys + atf_check -o inline:"40700\n" stat -f %p .ssh + atf_check -o inline:"100600\n" stat -f %p .ssh/authorized_keys atf_check -o inline:"mykey\n" cat .ssh/authorized_keys atf_check /usr/libexec/flua $(atf_get_srcdir)/addsshkey.lua atf_check -o inline:"mykey\nmykey\n" cat .ssh/authorized_keys From nobody Thu Jul 25 12:44:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WV9YZ50gXz5S0c1; Thu, 25 Jul 2024 12:44: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WV9YZ4QYHz4MMk; Thu, 25 Jul 2024 12:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721911442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mkJsDdrFZHZKp1MJ7ubSiNXsRI6rf5gb65OkzcYZV9M=; b=i5pf40twsBsCw83vSm9NIFOPknVDbroXlCwaP9LBoNpeZFlxDX+tagWjBiIy/70pK0fk24 7NO2xJjR6GViQqk2zWMrq7AqGqIfqZXgaQvUBUivIUG559IvUgHq5CqzvG0+a8ZMInkgDQ m2PMQvFq+ZccgZl5NlUx4yRGOm1uue0Om72R77/CRTPS2KWNd0G+kJl8HXTenTNGxyPJx3 Wl+xlsszx28EjkvBLHrBAOFAEE/+qalko3mSQtwZcG97TieEyAWFQiMLnSqt+VZDSjW6po pmX3228XAebz3bdlkXFjLHS7E0qRJ5DoqZ7LtUapP4jbMAtGnP3+9E5RmxFldQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721911442; a=rsa-sha256; cv=none; b=C5ItN7nqOn6TqKvSiDjkYUEFPMDGOk0FXJp7Jq78LmdnsQHbqv9JwXxA3Pj5o19uniHSVl kEnFXHqHB4LP4C4b0uzU1yvDVWZH9TG/jucmDTbqNZseYH0jhQDVK0n1D/cKY1YCQZyQq+ a2tPtZqU07VM7YCoAhUOZO2rQCtb3yDvZniaLlNsY2p7nbHPdGiP2MAtnJHDuTFwFtZumo yC0U+B2wio/gfkfxxsHatH8H7TMyiRkdBIuNu7FMMACbQrK3TSVNzSbH5KhulaNPF1kHbk VGPOlCqlyKYsMXMA30w6kS1Rb/jaIOs0q4IijtsQEUI9cn4x5A9aTq2M2E+cAg== 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=1721911442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mkJsDdrFZHZKp1MJ7ubSiNXsRI6rf5gb65OkzcYZV9M=; b=furdXqhatPm+kI9FwsnNomarNLs3DTIkrOm++WyVpdriJUqRRZbFb50rXfCr39TqfgjJCD h6xl9iHh5upW00Uj2CtgqTUHTf58xAgUf5rw2qu5VSYfNq+w272bqUXwBL+uZQQgPxptS3 YfEH0uQfrSNwafQOBTPbccktLLEAtj5aUkHV1SUB/Y6h83YPJHdO/Com40ILH+z0Z4gRzO tmSG1i6kiIO01WKZzJJxBWA7fy7goP7KXlryHa563QMAEyli6nELJWBWZ2fBYsUKXGsWFw bQmZMMN0t6brQil3VrZwRxLc1KRaOSRQpgbb7u/xAYxbYNmOgD4gRiXVP0ha5Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WV9YZ4234zwJf; Thu, 25 Jul 2024 12:44:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PCi2uU044981; Thu, 25 Jul 2024 12:44:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PCi2VJ044978; Thu, 25 Jul 2024 12:44:02 GMT (envelope-from git) Date: Thu, 25 Jul 2024 12:44:02 GMT Message-Id: <202407251244.46PCi2VJ044978@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4d8c65b466fc - main - LinuxKPI: remove dummy kstrtox.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4d8c65b466fccc875a2ddf10b1c93fdb9a26d7bc Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4d8c65b466fccc875a2ddf10b1c93fdb9a26d7bc commit 4d8c65b466fccc875a2ddf10b1c93fdb9a26d7bc Author: Bjoern A. Zeeb AuthorDate: 2024-07-25 12:42:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-07-25 12:42:49 +0000 LinuxKPI: remove dummy kstrtox.h kstrtox.h has an implementation nowadays. Remove the dummy file which is no longer needed. Sponsored by: The FreeBSD Foundation --- sys/compat/linuxkpi/dummy/include/linux/kstrtox.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/sys/compat/linuxkpi/dummy/include/linux/kstrtox.h b/sys/compat/linuxkpi/dummy/include/linux/kstrtox.h deleted file mode 100644 index e69de29bb2d1..000000000000 From nobody Thu Jul 25 13:10:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVB8D0Tbtz5S2JH; Thu, 25 Jul 2024 13:10: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVB8D00rYz4P9S; Thu, 25 Jul 2024 13:10:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721913036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LLv8Gk/EMBowb32GpyWTlbcBY9cWSehqJiXB2qsn1DM=; b=NE1taiVEU7Siap969STxNGR0YDAk67zOOkNVjxortN8MMJHkH6pSPd1WzkaOJRtv0IoLE/ wMp3+fcEWhyoaZtgl4MGiNhDeK4Z24efF502qcQnfLtiUjGipzuA4XEkIxL8LqV6hmeoV6 nUmM+FnE/1Kqm5Tn6bshoOosXoIavuF9a8ALZtNEF2G1U9nYINwmzjHM2jR7/alFfw3ytb aNnCHD2Y6ANCa+nFGhd95WXrKZ8ggMmZuGsM5utzxs6GB1U9DTdTjSAMch/V84dIRPdbAS peVFdNj2gljqtJk8J+ZTneHAS9Mxrmn8vqy7pjYqhHKT80ct9yK/+d4NAzSXQg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721913036; a=rsa-sha256; cv=none; b=mvWzoPpJxXxnvCRczZnYeNfdAtMdTmZiRfhkkNUe0QNCLBpaROaAWuyQ+FBzgal/1hj5Pl C4nNJH6RFM0fAC/hiqWBh+Y56wLPEmourRo6lNlB+pvdHhR6eeB6Zk/AUtADf1gkrsQezh Hs4KBPdkv6YBbs/3XRFBdjsln8uRLwioqH0w2Zh+rAS/WrwCdJXXBon4R244bnFB+WzG/M qiSJZRD31PS+1/LIw41+oqKsdNsf6k4OUivnHq+anpSGncHeNd3YuSvpq21wS09gNUwbQb OfLKEaT1Bv+I0XeSeY9rdLUAg/+2H6HmIXxfyYeATlXhhHZmoa3QA81JOn9qKA== 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=1721913036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LLv8Gk/EMBowb32GpyWTlbcBY9cWSehqJiXB2qsn1DM=; b=XhH9MpZ9iB5dIu294Cgyi5w6C6RuVMtwp2/Db+8dY02/01wzugAwC7xNWaq9BgZwHBulaf 72Awu6AN73xRxSFdaUrkxyN1QTvB8LcWQ3DWecBn8Xjzj+M2E1NujOB5zyflsXxFEgMGEV C4wLyV92GW3+DpzYb7142Mmvii9aPtu9f7K9Jv1888oHTrziibR/Aj+yCWWHDtsxobGxZu IMmqqxqLLcMBbH14dPPVAq9F1RyW/tt4BBG9kOkQuNpVTaXFytnVfoU0T81sSBnFBJZ8jf OqzZFRF+mcCXsQBHsW6zhHNmt8Qw5cZX0T0jMcs6wG8GLMa1jK38xvCQIdZAiw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVB8C6fNxzwYh; Thu, 25 Jul 2024 13:10:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDAZYo089036; Thu, 25 Jul 2024 13:10:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDAZCW089031; Thu, 25 Jul 2024 13:10:35 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:10:35 GMT Message-Id: <202407251310.46PDAZCW089031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: a8a95277363b - main - pfctl: Allow a semicolon (;) as a comment List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8a95277363be2c92b3c06bd9cd1a32d1c6c6ecd Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a8a95277363be2c92b3c06bd9cd1a32d1c6c6ecd commit a8a95277363be2c92b3c06bd9cd1a32d1c6c6ecd Author: Juraj Lutter AuthorDate: 2024-07-25 08:07:50 +0000 Commit: Kristof Provost CommitDate: 2024-07-25 13:06:24 +0000 pfctl: Allow a semicolon (;) as a comment To make parsing of, for example, Spamhaus' drop.txt and similar files that contains semicolons as comments, allow them also in file-based tables. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D46088 --- sbin/pfctl/pfctl.8 | 4 +++- sbin/pfctl/pfctl_radix.c | 4 ++-- sbin/pfctl/tests/files/pf1020.in | 3 +++ sbin/pfctl/tests/files/pf1020.include | 4 ++++ sbin/pfctl/tests/files/pf1020.ok | 2 ++ sbin/pfctl/tests/pfctl_test_list.inc | 1 + 6 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sbin/pfctl/pfctl.8 b/sbin/pfctl/pfctl.8 index 6c9a9f3b2ca4..80fdc394a568 100644 --- a/sbin/pfctl/pfctl.8 +++ b/sbin/pfctl/pfctl.8 @@ -24,7 +24,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 20, 2023 +.Dd July 23, 2024 .Dt PFCTL 8 .Os .Sh NAME @@ -531,6 +531,8 @@ line and/or in an unformatted text file, using the flag. Comments starting with a .Sq # +or +.Sq \; are allowed in the text file. With these commands, the .Fl v diff --git a/sbin/pfctl/pfctl_radix.c b/sbin/pfctl/pfctl_radix.c index b1180b40dfee..cfe982a84e95 100644 --- a/sbin/pfctl/pfctl_radix.c +++ b/sbin/pfctl/pfctl_radix.c @@ -534,8 +534,8 @@ pfr_next_token(char buf[BUF_SIZE], FILE *fp) /* skip spaces */ while (isspace(next_ch) && !feof(fp)) next_ch = fgetc(fp); - /* remove from '#' until end of line */ - if (next_ch == '#') + /* remove from '#' or ';' until end of line */ + if (next_ch == '#' || next_ch == ';') while (!feof(fp)) { next_ch = fgetc(fp); if (next_ch == '\n') diff --git a/sbin/pfctl/tests/files/pf1020.in b/sbin/pfctl/tests/files/pf1020.in new file mode 100644 index 000000000000..7f98df69bd04 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1020.in @@ -0,0 +1,3 @@ +table file "./pf1020.include" + +block from diff --git a/sbin/pfctl/tests/files/pf1020.include b/sbin/pfctl/tests/files/pf1020.include new file mode 100644 index 000000000000..3fca07f64bfa --- /dev/null +++ b/sbin/pfctl/tests/files/pf1020.include @@ -0,0 +1,4 @@ +; comment1 +# comment2 +1.0.0.1/32 ; comment1 +2.0.0.2/32 # comment2 diff --git a/sbin/pfctl/tests/files/pf1020.ok b/sbin/pfctl/tests/files/pf1020.ok new file mode 100644 index 000000000000..16073b3d6987 --- /dev/null +++ b/sbin/pfctl/tests/files/pf1020.ok @@ -0,0 +1,2 @@ +table file "./pf1020.include" +block drop from to any diff --git a/sbin/pfctl/tests/pfctl_test_list.inc b/sbin/pfctl/tests/pfctl_test_list.inc index 2dcee80b6e93..5d1717200759 100644 --- a/sbin/pfctl/tests/pfctl_test_list.inc +++ b/sbin/pfctl/tests/pfctl_test_list.inc @@ -128,3 +128,4 @@ PFCTL_TEST(1016, "Ethernet rule with ridentifier and one label") PFCTL_TEST(1017, "Ethernet rule with ridentifier and several labels") PFCTL_TEST(1018, "Test dynamic address mask") PFCTL_TEST(1019, "Test pflow option") +PFCTL_TEST(1020, "Test hashmark and semicolon comment") From nobody Thu Jul 25 13:10:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVB8F1MMYz5S2bw; Thu, 25 Jul 2024 13:10: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVB8F0qwpz4PPj; Thu, 25 Jul 2024 13:10:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721913037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gAV6ytfvQYJWf7mES/uLrvascAw7glefJ3nDsadLiqE=; b=p3PtbgxUXSCx7a7H41KUwK9C8RYiGyDU7ayy09NcPA9BqASdt8qz8hiQozjm7Uleqbj34V qlTT6sJrmXXgpIxjR046Qu5AF/Gd65qp9SlRFqP21QtU4ZoZ07iiem7+OExZ79ciM4SZsF 7FH0AnAGrD0uVO2cY80HneO7UtKuQ6gB55YLE3WXlGB1bIyGe7pseGx3+kkjGIh4/CQd91 duxEpC1M/WJt8SxFAOnP0pVcHx/Cw+HQj/a+mkOGwsEv/37uPlwN/qcyGvYR+uCKoaiWuv teQQ+EXdPwHKuIUioBj9jXXuheGr9cGBFbqlfNc1UzMoj7naLawK4JkDyS0sZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721913037; a=rsa-sha256; cv=none; b=ruK4L2IbbRsA/3SK78nDNDcaPlxO8gd38emXsUxUdKTDsV4QfVEcwgKQnlI/DbNCxt5Uyi twKIYai1IkigrKBVaMdP3g1SJPfisPKXWHDmweWNUPQXOHni2mbYOVGE71nY2g2SGiCTpk SF5/ZAQZB494b3ALBQKgomNO7bh+JDveKKFtE5iFM5866smYoJM1gD1EAMT3AATeX1oQIO /kk6gDuApiu5/HZ8IO2XFjb6T94OFiifxHDqbM+M+rcw8n6yGHlGASo8tl89q7cphAhBgR Y0zP4t3tn4/IialSpfohPBtMNeqT14K4HK/Z36sCPiuEoKu84Tce/4lbTwIrPw== 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=1721913037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gAV6ytfvQYJWf7mES/uLrvascAw7glefJ3nDsadLiqE=; b=E1OBjjf7XrjMpmEklixxe+jv2TvYu3+NYNfrRIph0/cKOmMT6bMrP+rH1IqN8xWMFIOh/b DV1exAEphfnqg5Zqnqo4CrJUVMsWyVRAWOOkqbvCpMH2NtTRmM4POz9DLx9/XiWmaVgRai xbXH0Fde/Px47MyaVaLFS6qwnJ+rLju8VwkB5yijzj0HqfErywHvSM/3zU3KO1W951hupm 9dVPUbpoSvjobkwzgZHS5cIDPs1v7fEX27pQ6lpqViEpT24wmmfKoE7La8hyGlNRgQgz+j lNk8tMQMQJC1TN9tc1cevpc80o0gFopPsw1PvFT6kwKaf3E7eZIz90I8RZPdYw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVB8F0M3Hzwp2; Thu, 25 Jul 2024 13:10:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDAaDQ089078; Thu, 25 Jul 2024 13:10:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDAaoa089075; Thu, 25 Jul 2024 13:10:36 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:10:36 GMT Message-Id: <202407251310.46PDAaoa089075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 250e074e5f60 - main - pfctl tests: fix dependency List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 250e074e5f609194e0e4cd0775d99b0a616bfcf3 Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=250e074e5f609194e0e4cd0775d99b0a616bfcf3 commit 250e074e5f609194e0e4cd0775d99b0a616bfcf3 Author: Kristof Provost AuthorDate: 2024-07-25 12:06:27 +0000 Commit: Kristof Provost CommitDate: 2024-07-25 13:06:25 +0000 pfctl tests: fix dependency Ensure that we rebuild the test binary when we add tests (i.e. modify pfctl_test_list.inc). MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/tests/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sbin/pfctl/tests/Makefile b/sbin/pfctl/tests/Makefile index ed5f52758145..281cd97dee78 100644 --- a/sbin/pfctl/tests/Makefile +++ b/sbin/pfctl/tests/Makefile @@ -7,4 +7,6 @@ LIBADD+= sbuf SUBDIR+= files WARNS=6 +pfctl_test.o: pfctl_test_list.inc + .include From nobody Thu Jul 25 13:41:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVBrB725Qz5S4kk; Thu, 25 Jul 2024 13:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVBrB6f84z4S7T; Thu, 25 Jul 2024 13:41:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721914906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N89IyTO1fZ0a/O1PqBCJ83724+jk+b6DDy5wI3/Srfw=; b=eXwGS6Nu5ZyDPNVL65RpZpLYCBqFvALrMwp9DLU6yfSXbwm5kiEfmOCdGbwsQ1iy/Mskje QDorLq8mGmKndLjP17uxf2ZINqAGX3D+tt0quL0dRvcXIC6g+iP/IG8WpNVrNsAdy9fuyU HKSbOei8IyhGeOgSQ4S7msH2cnTE9fuLo9B9N6v8zunifH+fxiE6x83W5klEUGuK0IIqPE 4cHcjZo64S5N4k6Ru95dn7Upy5+sLxV9HRCRJDBNU2FE4jmg/xmIAdfjn2ESFzAhlun0HV 0B+eCJoVBcuzxewjlIei4u58UGSlKNuv8Wtj0AqKo1n4zw1tYfX/Mh13VRp6Mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721914906; a=rsa-sha256; cv=none; b=o2gCRz7ypfX2UUQx4S0APbgE2n9LokxqRWUyYT+VRce1bbBOxWVRUbKHF4SzgqMN/eZns2 hour3L0vF3Iey2Bo7JVxz9Wmh/ZpOy1+RoU8FjI3iNFpGIkyu+SMdtPDHpij/fgEis7lju kXjxWNkmQpwdaEZP/Q3jj9168sBLzMT1wfaZ1iu+bMGyR0weWByHSBDX80+s7TT8oPnUnf xXF7VSMVP1dzg73TcQQBGF77kGifyB1RcO4s9hdmAlDBDCf+lOq3WY7fuIRrGGwYL4eNdi gcujWUGEhMIWAT2rRF2ZKVAJE6Z+cVZva6RPurKHHfjfK8QwT4uRr8U/YTU8XQ== 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=1721914906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N89IyTO1fZ0a/O1PqBCJ83724+jk+b6DDy5wI3/Srfw=; b=H+EhhHuidvS0CmeGHc3o5Cmk+kViiyjdHLgJZuj94DlObdTCwb1IjqjhMpk/rdIHNy9ptH 2SWtj9J5jO/hx83Cz6Ac2Rtq00+l8z/F5+FbLCbyJeSTpMTea+KePEKvJZI0GWNLIoK3RX cbqiFhGQWQ9k2bowZ4j2Ue12AbTlI1kSypqSq0mGdGNG6FF+IcjpQyUb26/6LqcpXaV5mY juvV9Hvu4dy3GWxHlfyNRlgAnq+8/XuQpek6KGKLO1jnDvHtWDPKozsJbMzzjKzkjEXKfG Gyf3RqGpT4vyJv8w+t96SiW50Hbx0rZsWRloMmq8Qa0UwG5+NZZr+SpQx98Fjw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVBrB6FynzxhV; Thu, 25 Jul 2024 13:41:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDfkJ6044296; Thu, 25 Jul 2024 13:41:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDfkW6044292; Thu, 25 Jul 2024 13:41:46 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:41:46 GMT Message-Id: <202407251341.46PDfkW6044292@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 428b8c820265 - stable/13 - pf: vnet-ify pf_hashsize, pf_hashmask, pf_srchashsize and V_pf_srchashmask List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 428b8c8202654bddbfe871eb412e272c23f86802 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=428b8c8202654bddbfe871eb412e272c23f86802 commit 428b8c8202654bddbfe871eb412e272c23f86802 Author: Kristof Provost AuthorDate: 2024-07-17 13:52:13 +0000 Commit: Kristof Provost CommitDate: 2024-07-25 08:19:55 +0000 pf: vnet-ify pf_hashsize, pf_hashmask, pf_srchashsize and V_pf_srchashmask These variables are tunables, so in principle they never change at runtime. That would mean they don't need to be tracked per-vnet. However, they both can be decreased (back to their default values) if the memory allocations for their respective tables fail, and these allocations are per-vnet. That is, it's possible for a few vnets to be started and have the tuned size for the hash and srchash tables only to have later vnets fail the initial allocation and fall back to smaller allocations. That would confuse the previously created vnets (because their actual table size and size/mask variables would no longer match). Avoid this by turning these into per-vnet variables. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 271f146955641857c93705b5b1916b8004e5623c) --- sys/net/pfvar.h | 8 +++-- sys/netpfil/pf/if_pfsync.c | 12 +++++--- sys/netpfil/pf/pf.c | 74 ++++++++++++++++++++++++---------------------- sys/netpfil/pf/pf_ioctl.c | 22 +++++++------- 4 files changed, 62 insertions(+), 54 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 11bde6224eb3..5d72dabfe305 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1851,8 +1851,10 @@ struct pf_idhash { }; extern u_long pf_ioctl_maxcount; -extern u_long pf_hashmask; -extern u_long pf_srchashmask; +VNET_DECLARE(u_long, pf_hashmask); +#define V_pf_hashmask VNET(pf_hashmask) +VNET_DECLARE(u_long, pf_srchashmask); +#define V_pf_srchashmask VNET(pf_srchashmask) #define PF_HASHSIZ (131072) #define PF_SRCHASHSIZ (PF_HASHSIZ/4) VNET_DECLARE(struct pf_keyhash *, pf_keyhash); @@ -1862,7 +1864,7 @@ VNET_DECLARE(struct pf_idhash *, pf_idhash); VNET_DECLARE(struct pf_srchash *, pf_srchash); #define V_pf_srchash VNET(pf_srchash) -#define PF_IDHASH(s) (be64toh((s)->id) % (pf_hashmask + 1)) +#define PF_IDHASH(s) (be64toh((s)->id) % (V_pf_hashmask + 1)) VNET_DECLARE(void *, pf_swi_cookie); #define V_pf_swi_cookie VNET(pf_swi_cookie) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index b8632e1fd61b..6ca6db00e685 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -764,7 +764,7 @@ pfsync_in_clr(struct pfsync_pkt *pkt, struct mbuf *m, int offset, int count) pfi_kkif_find(clr[i].ifname) == NULL) continue; - for (int i = 0; i <= pf_hashmask; i++) { + for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_kstate *s; relock: @@ -1847,7 +1847,11 @@ pfsync_defer_tmo(void *arg) struct pfsync_softc *sc = pd->pd_sc; struct mbuf *m = pd->pd_m; struct pf_kstate *st = pd->pd_st; - struct pfsync_bucket *b = pfsync_get_bucket(sc, st); + struct pfsync_bucket *b; + + CURVNET_SET(sc->sc_ifp->if_vnet); + + b = pfsync_get_bucket(sc, st); PFSYNC_BUCKET_LOCK_ASSERT(b); @@ -1860,11 +1864,11 @@ pfsync_defer_tmo(void *arg) if (sc->sc_sync_if == NULL) { pf_release_state(st); m_freem(m); + CURVNET_RESTORE(); return; } NET_EPOCH_ENTER(et); - CURVNET_SET(sc->sc_sync_if->if_vnet); pfsync_tx(sc, m); @@ -2211,7 +2215,7 @@ pfsync_bulk_update(void *arg) else i = sc->sc_bulk_hashid; - for (; i <= pf_hashmask; i++) { + for (; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; if (s != NULL) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index e99886a2d120..0c3df612e3f8 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -431,16 +431,18 @@ VNET_DEFINE(struct pf_srchash *, pf_srchash); SYSCTL_NODE(_net, OID_AUTO, pf, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "pf(4)"); -u_long pf_hashmask; -u_long pf_srchashmask; -static u_long pf_hashsize; -static u_long pf_srchashsize; +VNET_DEFINE(u_long, pf_hashmask); +VNET_DEFINE(u_long, pf_srchashmask); +VNET_DEFINE_STATIC(u_long, pf_hashsize); +#define V_pf_hashsize VNET(pf_hashsize) +VNET_DEFINE_STATIC(u_long, pf_srchashsize); +#define V_pf_srchashsize VNET(pf_srchashsize) u_long pf_ioctl_maxcount = 65535; -SYSCTL_ULONG(_net_pf, OID_AUTO, states_hashsize, CTLFLAG_RDTUN, - &pf_hashsize, 0, "Size of pf(4) states hashtable"); -SYSCTL_ULONG(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_RDTUN, - &pf_srchashsize, 0, "Size of pf(4) source nodes hashtable"); +SYSCTL_ULONG(_net_pf, OID_AUTO, states_hashsize, CTLFLAG_VNET | CTLFLAG_RDTUN, + &VNET_NAME(pf_hashsize), 0, "Size of pf(4) states hashtable"); +SYSCTL_ULONG(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_VNET | CTLFLAG_RDTUN, + &VNET_NAME(pf_srchashsize), 0, "Size of pf(4) source nodes hashtable"); SYSCTL_ULONG(_net_pf, OID_AUTO, request_maxcount, CTLFLAG_RWTUN, &pf_ioctl_maxcount, 0, "Maximum number of tables, addresses, ... in a single ioctl() call"); @@ -607,7 +609,7 @@ pf_hashkey(struct pf_state_key *sk) sizeof(struct pf_state_key_cmp)/sizeof(uint32_t), V_pf_hashseed); - return (h & pf_hashmask); + return (h & V_pf_hashmask); } static __inline uint32_t @@ -628,7 +630,7 @@ pf_hashsrc(struct pf_addr *addr, sa_family_t af) panic("%s: unknown address family %u", __func__, af); } - return (h & pf_srchashmask); + return (h & V_pf_srchashmask); } #ifdef ALTQ @@ -829,7 +831,7 @@ pf_overload_task(void *v, int pending) return; } - for (int i = 0; i <= pf_hashmask; i++) { + for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_state_key *sk; struct pf_kstate *s; @@ -1009,10 +1011,10 @@ pf_initialize(void) struct pf_srchash *sh; u_int i; - if (pf_hashsize == 0 || !powerof2(pf_hashsize)) - pf_hashsize = PF_HASHSIZ; - if (pf_srchashsize == 0 || !powerof2(pf_srchashsize)) - pf_srchashsize = PF_SRCHASHSIZ; + if (V_pf_hashsize == 0 || !powerof2(V_pf_hashsize)) + V_pf_hashsize = PF_HASHSIZ; + if (V_pf_srchashsize == 0 || !powerof2(V_pf_srchashsize)) + V_pf_srchashsize = PF_SRCHASHSIZ; V_pf_hashseed = arc4random(); @@ -1027,26 +1029,26 @@ pf_initialize(void) sizeof(struct pf_state_key), pf_state_key_ctor, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - V_pf_keyhash = mallocarray(pf_hashsize, sizeof(struct pf_keyhash), + V_pf_keyhash = mallocarray(V_pf_hashsize, sizeof(struct pf_keyhash), M_PFHASH, M_NOWAIT | M_ZERO); - V_pf_idhash = mallocarray(pf_hashsize, sizeof(struct pf_idhash), + V_pf_idhash = mallocarray(V_pf_hashsize, sizeof(struct pf_idhash), M_PFHASH, M_NOWAIT | M_ZERO); if (V_pf_keyhash == NULL || V_pf_idhash == NULL) { printf("pf: Unable to allocate memory for " - "state_hashsize %lu.\n", pf_hashsize); + "state_hashsize %lu.\n", V_pf_hashsize); free(V_pf_keyhash, M_PFHASH); free(V_pf_idhash, M_PFHASH); - pf_hashsize = PF_HASHSIZ; - V_pf_keyhash = mallocarray(pf_hashsize, + V_pf_hashsize = PF_HASHSIZ; + V_pf_keyhash = mallocarray(V_pf_hashsize, sizeof(struct pf_keyhash), M_PFHASH, M_WAITOK | M_ZERO); - V_pf_idhash = mallocarray(pf_hashsize, + V_pf_idhash = mallocarray(V_pf_hashsize, sizeof(struct pf_idhash), M_PFHASH, M_WAITOK | M_ZERO); } - pf_hashmask = pf_hashsize - 1; - for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= pf_hashmask; + V_pf_hashmask = V_pf_hashsize - 1; + for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= V_pf_hashmask; i++, kh++, ih++) { mtx_init(&kh->lock, "pf_keyhash", NULL, MTX_DEF | MTX_DUPOK); mtx_init(&ih->lock, "pf_idhash", NULL, MTX_DEF); @@ -1060,19 +1062,19 @@ pf_initialize(void) uma_zone_set_max(V_pf_sources_z, PFSNODE_HIWAT); uma_zone_set_warning(V_pf_sources_z, "PF source nodes limit reached"); - V_pf_srchash = mallocarray(pf_srchashsize, + V_pf_srchash = mallocarray(V_pf_srchashsize, sizeof(struct pf_srchash), M_PFHASH, M_NOWAIT | M_ZERO); if (V_pf_srchash == NULL) { printf("pf: Unable to allocate memory for " - "source_hashsize %lu.\n", pf_srchashsize); + "source_hashsize %lu.\n", V_pf_srchashsize); - pf_srchashsize = PF_SRCHASHSIZ; - V_pf_srchash = mallocarray(pf_srchashsize, + V_pf_srchashsize = PF_SRCHASHSIZ; + V_pf_srchash = mallocarray(V_pf_srchashsize, sizeof(struct pf_srchash), M_PFHASH, M_WAITOK | M_ZERO); } - pf_srchashmask = pf_srchashsize - 1; - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) + V_pf_srchashmask = V_pf_srchashsize - 1; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) mtx_init(&sh->lock, "pf_srchash", NULL, MTX_DEF); /* ALTQ */ @@ -1111,7 +1113,7 @@ pf_cleanup(void) struct pf_send_entry *pfse, *next; u_int i; - for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= pf_hashmask; + for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= V_pf_hashmask; i++, kh++, ih++) { KASSERT(LIST_EMPTY(&kh->keys), ("%s: key hash not empty", __func__)); @@ -1123,7 +1125,7 @@ pf_cleanup(void) free(V_pf_keyhash, M_PFHASH); free(V_pf_idhash, M_PFHASH); - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) { + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { KASSERT(LIST_EMPTY(&sh->nodes), ("%s: source node hash not empty", __func__)); mtx_destroy(&sh->lock); @@ -1519,7 +1521,7 @@ pf_find_state_byid(uint64_t id, uint32_t creatorid) pf_counter_u64_add(&V_pf_status.fcounters[FCNT_STATE_SEARCH], 1); - ih = &V_pf_idhash[(be64toh(id) % (pf_hashmask + 1))]; + ih = &V_pf_idhash[(be64toh(id) % (V_pf_hashmask + 1))]; PF_HASHROW_LOCK(ih); LIST_FOREACH(s, &ih->states, entry) @@ -1901,7 +1903,7 @@ pf_purge_thread(void *unused __unused) * table every run. */ V_pf_purge_idx = - pf_purge_expired_states(V_pf_purge_idx, pf_hashmask / + pf_purge_expired_states(V_pf_purge_idx, V_pf_hashmask / (V_pf_default_rule.timeout[PFTM_INTERVAL] * 10)); /* @@ -1945,7 +1947,7 @@ pf_unload_vnet_purge(void) /* * Now purge everything. */ - pf_purge_expired_states(0, pf_hashmask); + pf_purge_expired_states(0, V_pf_hashmask); pf_purge_fragments(UINT_MAX); pf_purge_expired_src_nodes(); @@ -2005,7 +2007,7 @@ pf_purge_expired_src_nodes(void) int i; LIST_INIT(&freelist); - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) { + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH_SAFE(cur, &sh->nodes, entry, next) if (cur->states == 0 && cur->expire <= time_uptime) { @@ -2176,7 +2178,7 @@ relock: SDT_PROBE2(pf, purge, state, rowcount, i, count); /* Return when we hit end of hash. */ - if (++i > pf_hashmask) { + if (++i > V_pf_hashmask) { V_pf_status.states = uma_zone_get_cur(V_pf_state_z); return (0); } diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index a7f9f2604068..2ddb84642b7d 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2961,7 +2961,7 @@ DIOCCHANGERULE_error: sizeof(struct pfsync_state), M_TEMP, M_WAITOK | M_ZERO); nr = 0; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; DIOCGETSTATES_retry: @@ -3039,7 +3039,7 @@ DIOCGETSTATES_full: sizeof(struct pf_state_export), M_TEMP, M_WAITOK | M_ZERO); nr = 0; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; DIOCGETSTATESV2_retry: @@ -4637,7 +4637,7 @@ DIOCCHANGEADDR_error: struct pf_src_node *p, *pstore; uint32_t i, nr = 0; - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) @@ -4656,7 +4656,7 @@ DIOCCHANGEADDR_error: nr = 0; p = pstore = malloc(psn->psn_len, M_TEMP, M_WAITOK | M_ZERO); - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) { @@ -5068,7 +5068,7 @@ pf_clear_all_states(void) struct pf_kstate *s; u_int i; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; relock: PF_HASHROW_LOCK(ih); @@ -5104,7 +5104,7 @@ pf_clear_srcnodes(struct pf_ksrc_node *n) struct pf_kstate *s; int i; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; PF_HASHROW_LOCK(ih); @@ -5120,7 +5120,7 @@ pf_clear_srcnodes(struct pf_ksrc_node *n) if (n == NULL) { struct pf_srchash *sh; - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) { @@ -5142,7 +5142,7 @@ pf_kill_srcnodes(struct pfioc_src_node_kill *psnk) struct pf_ksrc_node_list kill; LIST_INIT(&kill); - for (int i = 0; i <= pf_srchashmask; i++) { + for (int i = 0; i <= V_pf_srchashmask; i++) { struct pf_srchash *sh = &V_pf_srchash[i]; struct pf_ksrc_node *sn, *tmp; @@ -5163,7 +5163,7 @@ pf_kill_srcnodes(struct pfioc_src_node_kill *psnk) PF_HASHROW_UNLOCK(sh); } - for (int i = 0; i <= pf_hashmask; i++) { + for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_kstate *s; @@ -5224,7 +5224,7 @@ pf_clear_states(const struct pf_kstate_kill *kill) int idx; unsigned int killed = 0, dir; - for (unsigned int i = 0; i <= pf_hashmask; i++) { + for (unsigned int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; relock_DIOCCLRSTATES: @@ -5298,7 +5298,7 @@ pf_killstates(struct pf_kstate_kill *kill, unsigned int *killed) return; } - for (unsigned int i = 0; i <= pf_hashmask; i++) + for (unsigned int i = 0; i <= V_pf_hashmask; i++) *killed += pf_killstates_row(kill, &V_pf_idhash[i]); return; From nobody Thu Jul 25 13:41:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVBrC50b9z5S4cY; Thu, 25 Jul 2024 13:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVBrC3PLRz4S5f; Thu, 25 Jul 2024 13:41:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721914907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bXWmvC4gczMjM+HRBcM6Tv/fkhRcGETJ35uGqnIqQI0=; b=kL//9HF7uTcAerITUoio/aR7hdECs1hTKQ0vLqVjWttGf1XN0pTkXOEMVdOTXpzfxpeIjl Pb6rVch4yhEBNemtCMMSFZ/f/lnKeYShRdW6FCd3Eb+dTPav+HvBplCxmIubm26OL8GCFl lZRHX//M8V8uCt2HA8B0/ViZeUNfcgAkZXyC5uhZWWog5JQMgOywzjmZiKTvBOkPj86Z0B 5ww75b4saKy3UUa1QY9b6DvDzq6yzSGnps3ZwmT2WBHDNr/R39NPBVyGlumzBos/n/xtrM JecHOpCWTjAsNPItuVX4cGCpHu2EpwZVCLBgeit/RYaRSMWv0lgx/aM/Mfbc4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721914907; a=rsa-sha256; cv=none; b=VO0M+A5M9U21BAByHC9VEsrG98cux4Yuqh1a6KlIdWxbkWVy6NSKZazKaSHWoAGDNFKqRe /stzwDZuRHNX4mowSqnZUxiS5UTVFo/2wH8yspBTtpT5NXkMF7miyUfFA3rmwRFdN7xVS/ T6foM5HFqZSXFOfA5of51R8nhVlSE8KhZOVYQb/iazK1CPdNzNtHADIk9ymwmPrze5bJDX 96Oqbz/r0hzIqiTS7U8LikOHz/gRfjPCSqvRk8bz2TD2WkyUSKzyo0HtNXy5baeLZvEvcY uAXnoFDISn9DBKPHiwBTwCdVp9PpQbY68PSUl1KtWt6gfDvZJW7uMVVp8kxhxw== 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=1721914907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bXWmvC4gczMjM+HRBcM6Tv/fkhRcGETJ35uGqnIqQI0=; b=OSJFA7M6do5vJWhlRdmfP3gHGOd9pNxoju76yETqU+Rm3ChvH91epNTWa9Ljn+5s303aOE Im4YeGFKo3ea91OlDUZolHL1UAGzEZw1LrJxXSDVtL7bUe1ny6qYEcoNyA6FsYJy7fynek c90qzmFXJXpXcuuOAYzjBKqAc/+1TCgOQqKPZsivSYIm7tiwOlX8twSPe/KdmsLoBLEUDg gZZdLkDR121FjTYFUOV8lzK+6sPtxqyh9uCXKASTRxEeWDqWx+BKUXEwjtvIrbOMnPk+52 xrmtrQHjeh3yojT1fjuFVo7Kj1XCmsb+n7mlvlPbqAvsKlBtDzD9QUT2hi/owQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVBrC1NCBzxn0; Thu, 25 Jul 2024 13:41:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDflIj044399; Thu, 25 Jul 2024 13:41:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDfl1J044396; Thu, 25 Jul 2024 13:41:47 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:41:47 GMT Message-Id: <202407251341.46PDfl1J044396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 4842a15fa43b - stable/14 - pf: vnet-ify pf_hashsize, pf_hashmask, pf_srchashsize and V_pf_srchashmask List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4842a15fa43ba66ec581daa51a1bbaa3a22f93fa Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4842a15fa43ba66ec581daa51a1bbaa3a22f93fa commit 4842a15fa43ba66ec581daa51a1bbaa3a22f93fa Author: Kristof Provost AuthorDate: 2024-07-17 13:52:13 +0000 Commit: Kristof Provost CommitDate: 2024-07-25 08:19:22 +0000 pf: vnet-ify pf_hashsize, pf_hashmask, pf_srchashsize and V_pf_srchashmask These variables are tunables, so in principle they never change at runtime. That would mean they don't need to be tracked per-vnet. However, they both can be decreased (back to their default values) if the memory allocations for their respective tables fail, and these allocations are per-vnet. That is, it's possible for a few vnets to be started and have the tuned size for the hash and srchash tables only to have later vnets fail the initial allocation and fall back to smaller allocations. That would confuse the previously created vnets (because their actual table size and size/mask variables would no longer match). Avoid this by turning these into per-vnet variables. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 271f146955641857c93705b5b1916b8004e5623c) --- sys/net/pfvar.h | 8 +++-- sys/netpfil/pf/if_pfsync.c | 12 +++++--- sys/netpfil/pf/pf.c | 74 ++++++++++++++++++++++++---------------------- sys/netpfil/pf/pf_ioctl.c | 22 +++++++------- 4 files changed, 62 insertions(+), 54 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 1c932026aeb3..4e2888b21a39 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2104,8 +2104,10 @@ struct pf_idhash { }; extern u_long pf_ioctl_maxcount; -extern u_long pf_hashmask; -extern u_long pf_srchashmask; +VNET_DECLARE(u_long, pf_hashmask); +#define V_pf_hashmask VNET(pf_hashmask) +VNET_DECLARE(u_long, pf_srchashmask); +#define V_pf_srchashmask VNET(pf_srchashmask) #define PF_HASHSIZ (131072) #define PF_SRCHASHSIZ (PF_HASHSIZ/4) VNET_DECLARE(struct pf_keyhash *, pf_keyhash); @@ -2115,7 +2117,7 @@ VNET_DECLARE(struct pf_idhash *, pf_idhash); VNET_DECLARE(struct pf_srchash *, pf_srchash); #define V_pf_srchash VNET(pf_srchash) -#define PF_IDHASH(s) (be64toh((s)->id) % (pf_hashmask + 1)) +#define PF_IDHASH(s) (be64toh((s)->id) % (V_pf_hashmask + 1)) VNET_DECLARE(void *, pf_swi_cookie); #define V_pf_swi_cookie VNET(pf_swi_cookie) diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c index 7af9ce8f468d..503bdab0c6ac 100644 --- a/sys/netpfil/pf/if_pfsync.c +++ b/sys/netpfil/pf/if_pfsync.c @@ -979,7 +979,7 @@ pfsync_in_clr(struct mbuf *m, int offset, int count, int flags, int action) pfi_kkif_find(clr[i].ifname) == NULL) continue; - for (int i = 0; i <= pf_hashmask; i++) { + for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_kstate *s; relock: @@ -2080,7 +2080,11 @@ pfsync_defer_tmo(void *arg) struct pfsync_softc *sc = pd->pd_sc; struct mbuf *m = pd->pd_m; struct pf_kstate *st = pd->pd_st; - struct pfsync_bucket *b = pfsync_get_bucket(sc, st); + struct pfsync_bucket *b; + + CURVNET_SET(sc->sc_ifp->if_vnet); + + b = pfsync_get_bucket(sc, st); PFSYNC_BUCKET_LOCK_ASSERT(b); @@ -2093,11 +2097,11 @@ pfsync_defer_tmo(void *arg) if (sc->sc_sync_if == NULL) { pf_release_state(st); m_freem(m); + CURVNET_RESTORE(); return; } NET_EPOCH_ENTER(et); - CURVNET_SET(sc->sc_sync_if->if_vnet); pfsync_tx(sc, m); @@ -2483,7 +2487,7 @@ pfsync_bulk_update(void *arg) else i = sc->sc_bulk_hashid; - for (; i <= pf_hashmask; i++) { + for (; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; if (s != NULL) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 4eed6dd31860..1a4ef22ce5de 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -459,16 +459,18 @@ VNET_DEFINE(struct pf_srchash *, pf_srchash); SYSCTL_NODE(_net, OID_AUTO, pf, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "pf(4)"); -u_long pf_hashmask; -u_long pf_srchashmask; -static u_long pf_hashsize; -static u_long pf_srchashsize; +VNET_DEFINE(u_long, pf_hashmask); +VNET_DEFINE(u_long, pf_srchashmask); +VNET_DEFINE_STATIC(u_long, pf_hashsize); +#define V_pf_hashsize VNET(pf_hashsize) +VNET_DEFINE_STATIC(u_long, pf_srchashsize); +#define V_pf_srchashsize VNET(pf_srchashsize) u_long pf_ioctl_maxcount = 65535; -SYSCTL_ULONG(_net_pf, OID_AUTO, states_hashsize, CTLFLAG_RDTUN, - &pf_hashsize, 0, "Size of pf(4) states hashtable"); -SYSCTL_ULONG(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_RDTUN, - &pf_srchashsize, 0, "Size of pf(4) source nodes hashtable"); +SYSCTL_ULONG(_net_pf, OID_AUTO, states_hashsize, CTLFLAG_VNET | CTLFLAG_RDTUN, + &VNET_NAME(pf_hashsize), 0, "Size of pf(4) states hashtable"); +SYSCTL_ULONG(_net_pf, OID_AUTO, source_nodes_hashsize, CTLFLAG_VNET | CTLFLAG_RDTUN, + &VNET_NAME(pf_srchashsize), 0, "Size of pf(4) source nodes hashtable"); SYSCTL_ULONG(_net_pf, OID_AUTO, request_maxcount, CTLFLAG_RWTUN, &pf_ioctl_maxcount, 0, "Maximum number of tables, addresses, ... in a single ioctl() call"); @@ -635,7 +637,7 @@ pf_hashkey(const struct pf_state_key *sk) sizeof(struct pf_state_key_cmp)/sizeof(uint32_t), V_pf_hashseed); - return (h & pf_hashmask); + return (h & V_pf_hashmask); } static __inline uint32_t @@ -656,7 +658,7 @@ pf_hashsrc(struct pf_addr *addr, sa_family_t af) panic("%s: unknown address family %u", __func__, af); } - return (h & pf_srchashmask); + return (h & V_pf_srchashmask); } #ifdef ALTQ @@ -861,7 +863,7 @@ pf_overload_task(void *v, int pending) return; } - for (int i = 0; i <= pf_hashmask; i++) { + for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_state_key *sk; struct pf_kstate *s; @@ -1051,10 +1053,10 @@ pf_initialize(void) struct pf_srchash *sh; u_int i; - if (pf_hashsize == 0 || !powerof2(pf_hashsize)) - pf_hashsize = PF_HASHSIZ; - if (pf_srchashsize == 0 || !powerof2(pf_srchashsize)) - pf_srchashsize = PF_SRCHASHSIZ; + if (V_pf_hashsize == 0 || !powerof2(V_pf_hashsize)) + V_pf_hashsize = PF_HASHSIZ; + if (V_pf_srchashsize == 0 || !powerof2(V_pf_srchashsize)) + V_pf_srchashsize = PF_SRCHASHSIZ; V_pf_hashseed = arc4random(); @@ -1069,26 +1071,26 @@ pf_initialize(void) sizeof(struct pf_state_key), pf_state_key_ctor, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - V_pf_keyhash = mallocarray(pf_hashsize, sizeof(struct pf_keyhash), + V_pf_keyhash = mallocarray(V_pf_hashsize, sizeof(struct pf_keyhash), M_PFHASH, M_NOWAIT | M_ZERO); - V_pf_idhash = mallocarray(pf_hashsize, sizeof(struct pf_idhash), + V_pf_idhash = mallocarray(V_pf_hashsize, sizeof(struct pf_idhash), M_PFHASH, M_NOWAIT | M_ZERO); if (V_pf_keyhash == NULL || V_pf_idhash == NULL) { printf("pf: Unable to allocate memory for " - "state_hashsize %lu.\n", pf_hashsize); + "state_hashsize %lu.\n", V_pf_hashsize); free(V_pf_keyhash, M_PFHASH); free(V_pf_idhash, M_PFHASH); - pf_hashsize = PF_HASHSIZ; - V_pf_keyhash = mallocarray(pf_hashsize, + V_pf_hashsize = PF_HASHSIZ; + V_pf_keyhash = mallocarray(V_pf_hashsize, sizeof(struct pf_keyhash), M_PFHASH, M_WAITOK | M_ZERO); - V_pf_idhash = mallocarray(pf_hashsize, + V_pf_idhash = mallocarray(V_pf_hashsize, sizeof(struct pf_idhash), M_PFHASH, M_WAITOK | M_ZERO); } - pf_hashmask = pf_hashsize - 1; - for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= pf_hashmask; + V_pf_hashmask = V_pf_hashsize - 1; + for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= V_pf_hashmask; i++, kh++, ih++) { mtx_init(&kh->lock, "pf_keyhash", NULL, MTX_DEF | MTX_DUPOK); mtx_init(&ih->lock, "pf_idhash", NULL, MTX_DEF); @@ -1102,19 +1104,19 @@ pf_initialize(void) uma_zone_set_max(V_pf_sources_z, PFSNODE_HIWAT); uma_zone_set_warning(V_pf_sources_z, "PF source nodes limit reached"); - V_pf_srchash = mallocarray(pf_srchashsize, + V_pf_srchash = mallocarray(V_pf_srchashsize, sizeof(struct pf_srchash), M_PFHASH, M_NOWAIT | M_ZERO); if (V_pf_srchash == NULL) { printf("pf: Unable to allocate memory for " - "source_hashsize %lu.\n", pf_srchashsize); + "source_hashsize %lu.\n", V_pf_srchashsize); - pf_srchashsize = PF_SRCHASHSIZ; - V_pf_srchash = mallocarray(pf_srchashsize, + V_pf_srchashsize = PF_SRCHASHSIZ; + V_pf_srchash = mallocarray(V_pf_srchashsize, sizeof(struct pf_srchash), M_PFHASH, M_WAITOK | M_ZERO); } - pf_srchashmask = pf_srchashsize - 1; - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) + V_pf_srchashmask = V_pf_srchashsize - 1; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) mtx_init(&sh->lock, "pf_srchash", NULL, MTX_DEF); /* ALTQ */ @@ -1153,7 +1155,7 @@ pf_cleanup(void) struct pf_send_entry *pfse, *next; u_int i; - for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= pf_hashmask; + for (i = 0, kh = V_pf_keyhash, ih = V_pf_idhash; i <= V_pf_hashmask; i++, kh++, ih++) { KASSERT(LIST_EMPTY(&kh->keys), ("%s: key hash not empty", __func__)); @@ -1165,7 +1167,7 @@ pf_cleanup(void) free(V_pf_keyhash, M_PFHASH); free(V_pf_idhash, M_PFHASH); - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) { + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { KASSERT(LIST_EMPTY(&sh->nodes), ("%s: source node hash not empty", __func__)); mtx_destroy(&sh->lock); @@ -1558,7 +1560,7 @@ pf_find_state_byid(uint64_t id, uint32_t creatorid) pf_counter_u64_add(&V_pf_status.fcounters[FCNT_STATE_SEARCH], 1); - ih = &V_pf_idhash[(be64toh(id) % (pf_hashmask + 1))]; + ih = &V_pf_idhash[(be64toh(id) % (V_pf_hashmask + 1))]; PF_HASHROW_LOCK(ih); LIST_FOREACH(s, &ih->states, entry) @@ -1947,7 +1949,7 @@ pf_purge_thread(void *unused __unused) * table every run. */ V_pf_purge_idx = - pf_purge_expired_states(V_pf_purge_idx, pf_hashmask / + pf_purge_expired_states(V_pf_purge_idx, V_pf_hashmask / (V_pf_default_rule.timeout[PFTM_INTERVAL] * 10)); /* @@ -1991,7 +1993,7 @@ pf_unload_vnet_purge(void) /* * Now purge everything. */ - pf_purge_expired_states(0, pf_hashmask); + pf_purge_expired_states(0, V_pf_hashmask); pf_purge_fragments(UINT_MAX); pf_purge_expired_src_nodes(); @@ -2051,7 +2053,7 @@ pf_purge_expired_src_nodes(void) int i; LIST_INIT(&freelist); - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; i++, sh++) { + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH_SAFE(cur, &sh->nodes, entry, next) if (cur->states == 0 && cur->expire <= time_uptime) { @@ -2225,7 +2227,7 @@ relock: SDT_PROBE2(pf, purge, state, rowcount, i, count); /* Return when we hit end of hash. */ - if (++i > pf_hashmask) { + if (++i > V_pf_hashmask) { V_pf_status.states = uma_zone_get_cur(V_pf_state_z); return (0); } diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 7c148d857144..04369a1aa9bb 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -3794,7 +3794,7 @@ DIOCCHANGERULE_error: sizeof(struct pfsync_state_1301), M_TEMP, M_WAITOK | M_ZERO); nr = 0; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; DIOCGETSTATES_retry: @@ -3873,7 +3873,7 @@ DIOCGETSTATES_full: sizeof(struct pf_state_export), M_TEMP, M_WAITOK | M_ZERO); nr = 0; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; DIOCGETSTATESV2_retry: @@ -5516,7 +5516,7 @@ DIOCCHANGEADDR_error: struct pf_src_node *p, *pstore; uint32_t i, nr = 0; - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) @@ -5535,7 +5535,7 @@ DIOCCHANGEADDR_error: nr = 0; p = pstore = malloc(psn->psn_len, M_TEMP, M_WAITOK | M_ZERO); - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) { @@ -6007,7 +6007,7 @@ pf_clear_all_states(void) struct pf_kstate *s; u_int i; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; relock: PF_HASHROW_LOCK(ih); @@ -6043,7 +6043,7 @@ pf_clear_srcnodes(struct pf_ksrc_node *n) struct pf_kstate *s; int i; - for (i = 0; i <= pf_hashmask; i++) { + for (i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; PF_HASHROW_LOCK(ih); @@ -6059,7 +6059,7 @@ pf_clear_srcnodes(struct pf_ksrc_node *n) if (n == NULL) { struct pf_srchash *sh; - for (i = 0, sh = V_pf_srchash; i <= pf_srchashmask; + for (i = 0, sh = V_pf_srchash; i <= V_pf_srchashmask; i++, sh++) { PF_HASHROW_LOCK(sh); LIST_FOREACH(n, &sh->nodes, entry) { @@ -6081,7 +6081,7 @@ pf_kill_srcnodes(struct pfioc_src_node_kill *psnk) struct pf_ksrc_node_list kill; LIST_INIT(&kill); - for (int i = 0; i <= pf_srchashmask; i++) { + for (int i = 0; i <= V_pf_srchashmask; i++) { struct pf_srchash *sh = &V_pf_srchash[i]; struct pf_ksrc_node *sn, *tmp; @@ -6102,7 +6102,7 @@ pf_kill_srcnodes(struct pfioc_src_node_kill *psnk) PF_HASHROW_UNLOCK(sh); } - for (int i = 0; i <= pf_hashmask; i++) { + for (int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; struct pf_kstate *s; @@ -6163,7 +6163,7 @@ pf_clear_states(const struct pf_kstate_kill *kill) int idx; unsigned int killed = 0, dir; - for (unsigned int i = 0; i <= pf_hashmask; i++) { + for (unsigned int i = 0; i <= V_pf_hashmask; i++) { struct pf_idhash *ih = &V_pf_idhash[i]; relock_DIOCCLRSTATES: @@ -6237,7 +6237,7 @@ pf_killstates(struct pf_kstate_kill *kill, unsigned int *killed) return; } - for (unsigned int i = 0; i <= pf_hashmask; i++) + for (unsigned int i = 0; i <= V_pf_hashmask; i++) *killed += pf_killstates_row(kill, &V_pf_idhash[i]); return; From nobody Thu Jul 25 13:41:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVBrD5702z5S4kq; Thu, 25 Jul 2024 13:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVBrD2wWSz4RqK; Thu, 25 Jul 2024 13:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721914908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1eoVKkVQM+SicojnyXaauJZpYjeE5yEMFSVsWt9TS1U=; b=yVng8l0OzjCZUFdJ3dbqHjIPPjnOEGy4hFLLY9jIaNGQ8IXRkTR1qbAQDpxsLt+APvrDOi to2o3Ea+HznbahYn6fC417ph5YZ1xNAUuHR8N968pGc2pVZFli/DEPDKkhheFR4gjuhAOa RpS/sy6q5WrCx/GuObUQPYzhrHU6TyYh32MbWNFj3sx7fduZ0Lo6Km2X8HrjIL/elsuOhP bCv3aIjhTKeIqIN6ILSSCMTLOP/mVRVnDBwoExJ/dXRk+wavxWQQYzgbFKOMVAOLcp+90b HRV9A3cdWkjfspIKOUtcbO7sZ4Azk6ENxS9v+ElnqnwQ4+W8EsPp2+u16CFoKw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721914908; a=rsa-sha256; cv=none; b=UcvSkhB8YkTXdp/R7Ivt4p9WyZWoILp17L65hVhWPPNgGsruvFIMFYxytT+qwtJ9X1zW3h r7IvnLacfYkmGlaNkB4npTIgpgU9mcDwtuISybaggeiFjF2cNaE3LGN0llng9fkE+bmfWT zUpYW8n6DHerAiHyerYqCunHsIh/tIp6F/vWfpFZwzYPXkkPu9z3ctuVdwxt3zWsplWArw TOqepjys2s5d5SAvHgpSPDeU05z01WSDYH6Wggd5DGkeG62aff6htT5JdGjM3uO7ON78c2 lsz+HshPEVwNfN8IUZUQinC6GVrnukWdiNBwBC7QX0/w8OM1n296nnPgaDI+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=1721914908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1eoVKkVQM+SicojnyXaauJZpYjeE5yEMFSVsWt9TS1U=; b=wZ/z+VCY9tLsI4bfUoN6R4s8Awe2IciHR1/BBZ1x7CzptkCae6c8ezc7Br+R1DeTTovGTG w4BkHBGQ776jJmGVZSU3tW8/5uLzSVppA03V2DD4mc8TWCNUUfgkdANoizCap+LHvB+VfK /1Cb80Jbg++Gks+CzY2hz1u8yEqeeVkJKNgtsOAwo5PFkc6ueA5xWRGZs4U4o5yCO48sSj WUSkdSIVK//rXlAYQOniCwp8JQKvktxlhFYWNbbR+zhJl+anZgLpE4YlMTXdOqST67Ep0g FqTWMyNhDvTE6oBWdoIjPU7es9hXSVIw0h2EvxOXqWEdLYGCfx3C5d/4X4SZQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVBrD2PFSzxXv; Thu, 25 Jul 2024 13:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDfmsZ044501; Thu, 25 Jul 2024 13:41:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDfmCQ044498; Thu, 25 Jul 2024 13:41:48 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:41:48 GMT Message-Id: <202407251341.46PDfmCQ044498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 5acd8ff56604 - stable/14 - pf tests: test setting and retrieving timeout values List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 5acd8ff56604d1a4263c3775d14024fa055c52f8 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=5acd8ff56604d1a4263c3775d14024fa055c52f8 commit 5acd8ff56604d1a4263c3775d14024fa055c52f8 Author: Kristof Provost AuthorDate: 2024-06-06 15:50:42 +0000 Commit: Kristof Provost CommitDate: 2024-07-25 08:23:29 +0000 pf tests: test setting and retrieving timeout values (cherry picked from commit 8ed5170c66ec4914e90c2f3657227ceb9e35193f) --- tests/sys/netpfil/pf/sctp.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index c6dba1719d00..c3e1301238b0 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -656,6 +656,37 @@ pfsync_cleanup() pfsynct_cleanup } +atf_test_case "timeout" "cleanup" +timeout_head() +{ + atf_set descr 'Test setting and retrieving timeout values' + atf_set require.user root +} + +timeout_body() +{ + sctp_init +} + +timeout_cleanup() +{ + pft_cleanup + + vnet_mkjail timeout + + pft_set_rules timeout \ + "set timeout sctp.first 13" \ + "set timeout sctp.opening 14" + + atf_check -s exit:0 -o match:"sctp.first.*13" \ + jexec timeout pfctl -st + atf_check -s exit:0 -o match:"sctp.opening.*14" \ + jexec timeout pfctl -st + # We've not changed other timeouts + atf_check -s exit:0 -o match:"sctp.established.*86400" \ + jexec timeout pfctl -st +} + atf_init_test_cases() { atf_add_test_case "basic_v4" @@ -666,4 +697,5 @@ atf_init_test_cases() atf_add_test_case "nat_v6" atf_add_test_case "rdr_v4" atf_add_test_case "pfsync" + atf_add_test_case "timeout" } From nobody Thu Jul 25 13:41:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVBrD2sBLz5S4mj; Thu, 25 Jul 2024 13:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVBrD0LzMz4RqG; Thu, 25 Jul 2024 13:41:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721914908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m3o7XEvnDeTlXuwRTLgptc3HVtd6HoXO0IGog8beBjc=; b=H99TIW6uFOtZjazF1mT+gQkfdImnnSwhOQul6aEtx1fSkC6EHl66UdHu7On9kaBAhgmEhk +CafUzso8WRELhYdwGOalwk/icmXuYvu043LMIhZtKGehDdn2DsW3yoUvYCdKP4VvKMH5U pK/zcPqcANya0KoqYSss+ZZhmNwqPNH4Clplphw9Qs+LcRH/hGeSYooNsAU33ZvL66oTrJ /EhAp1TsbRpByECJn6c2Pz9qCBwYf1xFpc2cVIDPPe8uq+5uJ6SBvYhT6My2HjHgyDx2i/ sEtDNqsuS5PtJK8Y3e209ox5HA1qDIIovoFAljIodCEKHMT5paBDjXDbgaTQYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721914908; a=rsa-sha256; cv=none; b=N1w+4mHhsZyf/C5R9lByGclJLbjKCwHHtQC4tLNag2N7lstP3MjlRXubegWTTvdvAFZeDt 7R6tSe4Id5EILZO6jsGjvOOxtiuu5i7SN2k+gcF++kpigU2/Bp6QR4bBGiSiV1G6GIWPYW UaUcTHtp5cLtvySyxZXdOqtyo8Teh4652pPJbrS9J18VMCpUba41P5LrN0J7OiUmjkYgVB kKZHf5UbJj7jenK90eUra81MggmHuUKuyqoBt45IoawfSYtLq48q9cBYNFkirVuvAkG1J7 T1TS33Mxzq5TcszV/+6011mUpT/Qz5mO2BvdelDdY2DDaDMK+m2Hj8lclb9zgw== 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=1721914908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=m3o7XEvnDeTlXuwRTLgptc3HVtd6HoXO0IGog8beBjc=; b=R2TOdR+liyN4QzoDIuqf5JnWX6udEidbmyqsGOLcbb6zzA3FGLKpaUw8GP2skpgNkuhRIT 4PprRGZ7kMOr1avBy39pJY5LUouq7ZLuZRU1eB0NhndWSwpZFenckESlVmwFrOC0MfGI42 +AYlOTCi7cyNaUg30wMnwl4gtZav82lnIhyVSglJp5UN781zxWd22W7CEXwUlSat36Vj24 cNEIdx5WUz5IJAV689zxqDwOLdZrI9iT2rjorH/9WwjgKWnQMO4Vmtnb6l845YL/YBSDnk Xkqnf+PDL4l6a/LN9VGbNGY8vCeHyohDqN6ybOaniElZzv8FU2wbnoxMbAElBQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVBrC6zKWzxkV; Thu, 25 Jul 2024 13:41:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDfl1W044450; Thu, 25 Jul 2024 13:41:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDfl2m044447; Thu, 25 Jul 2024 13:41:47 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:41:47 GMT Message-Id: <202407251341.46PDfl2m044447@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 193455c91b90 - stable/13 - pf tests: test setting and retrieving timeout values List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 193455c91b9065beef2b4a86956713f633041340 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=193455c91b9065beef2b4a86956713f633041340 commit 193455c91b9065beef2b4a86956713f633041340 Author: Kristof Provost AuthorDate: 2024-06-06 15:50:42 +0000 Commit: Kristof Provost CommitDate: 2024-07-25 08:23:35 +0000 pf tests: test setting and retrieving timeout values (cherry picked from commit 8ed5170c66ec4914e90c2f3657227ceb9e35193f) --- tests/sys/netpfil/pf/sctp.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index c6dba1719d00..c3e1301238b0 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -656,6 +656,37 @@ pfsync_cleanup() pfsynct_cleanup } +atf_test_case "timeout" "cleanup" +timeout_head() +{ + atf_set descr 'Test setting and retrieving timeout values' + atf_set require.user root +} + +timeout_body() +{ + sctp_init +} + +timeout_cleanup() +{ + pft_cleanup + + vnet_mkjail timeout + + pft_set_rules timeout \ + "set timeout sctp.first 13" \ + "set timeout sctp.opening 14" + + atf_check -s exit:0 -o match:"sctp.first.*13" \ + jexec timeout pfctl -st + atf_check -s exit:0 -o match:"sctp.opening.*14" \ + jexec timeout pfctl -st + # We've not changed other timeouts + atf_check -s exit:0 -o match:"sctp.established.*86400" \ + jexec timeout pfctl -st +} + atf_init_test_cases() { atf_add_test_case "basic_v4" @@ -666,4 +697,5 @@ atf_init_test_cases() atf_add_test_case "nat_v6" atf_add_test_case "rdr_v4" atf_add_test_case "pfsync" + atf_add_test_case "timeout" } From nobody Thu Jul 25 13:41:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVBrF6k0Cz5S4f8; Thu, 25 Jul 2024 13:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVBrF3yxnz4Rrt; Thu, 25 Jul 2024 13:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721914909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2tNrhhlCistSF+fapO6B67GZcvnjpqKOx3HPv9OQWPI=; b=LMtMltP2F4pcbl1bJnE+PavDr6qqyoi/pG9Bc7TgvnieO8ZTRDJKYpUlb6SlbgLAwfmn+Y ENCrA8uZb0YwnrA278S0B97mdK8bJLdlUCB9W740n3e5dfkKNgLe2Bm2uUn7WhpVZfgbDb Z3PZqPzOstlJX+8wHvmri3T9EraIJaHv5Ve/nMrko18L6hZtPkT6KGRN+ZziXiaHAP/5Me 4llWht64cNweX2lUd/fdeeJew2uctE+Xw0pks16A25IQawj2u4hPdZqEUb5G2UB2CsXpaY 9hY+jB94A3rOiKvGWBQkchwyyvVwnXWVSMw6raq4TS2vsOZSa5LRgmzomoSxmg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721914909; a=rsa-sha256; cv=none; b=ob3HuZDCopxTdfHu9l3WQhz2B76zzec1X8Yj4BRvwZpNO5VE7qOhB/phOSP2EJZ1gxB9Dn gGJGsc1lO/9YEp8W1A3u1Ha54LUkf/IPK2H5CKXV2sQkYeCYAXTP7V/Y9EGYZLTcCWXlSg TCX+lmlpHkKIyNkAeZebVdKEqiNQTbLiKR3ZClM1x5MHXe2prFmVTHPdfTgNQEv3Tdv4do eEdEJ8hxwAo3LdbQs1R+YtyK3PO/FAFPRH/hhBfaTUsnoeKwIeKnrLgMwAZZSoODC3RWH/ ZY1ejCsrVLIVUodeA8MrhRZg5NWejNRxa83cEV6454ld9D1FnmnKcIyryy9+Xw== 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=1721914909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2tNrhhlCistSF+fapO6B67GZcvnjpqKOx3HPv9OQWPI=; b=iunV6NcrObtjmHZy4mSxYhJ0TlPPEKnu00hRc5mzaNoXfVlCSMCp03R8z5qbt2h4kp7ij8 DigvqEIAk+zA+6llobjT0qrVjpT7j0Bnio06rJc89BAZTuABFqo9yWNff8/P/ODAAZH2V6 TW9CLNEXc0R7tiE4hSBBVf5FWLIm1otF2drabMs7/1RCiT1da3CLiF5E7tEAOF2vxeMWwJ grfTy2OS5meAfX2C8PKLU2q4Uk8xkVkHpZsPOvmQtz/M1Th3+2KPk/v0OxZPAJ+hewAY9I IQDjE61ELWwokuIxlSDDde3X9yYpPXrDZDHSrsoQbZZXsgiCsSQKJFyy9icrtg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVBrF3M78zx08; Thu, 25 Jul 2024 13:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDfnP1044597; Thu, 25 Jul 2024 13:41:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDfnK5044594; Thu, 25 Jul 2024 13:41:49 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:41:49 GMT Message-Id: <202407251341.46PDfnK5044594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 4f5440f2abe9 - stable/14 - pf tests: fix sctp:timeout test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4f5440f2abe9f3250b7852399ecfc1af51084373 Auto-Submitted: auto-generated The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4f5440f2abe9f3250b7852399ecfc1af51084373 commit 4f5440f2abe9f3250b7852399ecfc1af51084373 Author: Kristof Provost AuthorDate: 2024-07-17 13:56:49 +0000 Commit: Kristof Provost CommitDate: 2024-07-25 08:23:31 +0000 pf tests: fix sctp:timeout test The test body somehow wound up in the cleanup function. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit fe0c82a603ce069786ee81604315f499fd965546) --- tests/sys/netpfil/pf/sctp.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index c3e1301238b0..d07d1122048b 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -666,11 +666,6 @@ timeout_head() timeout_body() { sctp_init -} - -timeout_cleanup() -{ - pft_cleanup vnet_mkjail timeout @@ -687,6 +682,11 @@ timeout_cleanup() jexec timeout pfctl -st } +timeout_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic_v4" From nobody Thu Jul 25 13:41:48 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVBrF3MSdz5S4mk; Thu, 25 Jul 2024 13:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVBrF1y6Zz4S5y; Thu, 25 Jul 2024 13:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721914909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hoL28rXNQy4zeowxkAWZsfZltEooE0VWSLR1vWEcQx0=; b=XYILwzJubafUq0eWj6vxb+f+cJIHR3+JHOtwZVwQ9h9LOlhuGjYQbMe8YtCmIdK+AuWx3X xehJcNgcuqRWPEcNodNHuRzUVG1jArt4am2pcjxCK8R3ZPYkMAMrARAqXEQ4fBbx5Bw+hJ bsW4L8zmU8TfIgtT8cKnbiN/XzY+Y0GNiHdkNlfEgfXsSWlW69wPzYyIvB7ZWGvF3UjNdA gNpdLn0uRBWVh6F9yidfVGUuuC77z8MdQSLP36iCawn184duSobyEmolPG3m7F7IwNzkuL GNpJiX9A2P98XMpH+hq/go8i3/g80AgAO1eKZGY0444AGSEkshWpwoN4eLq61Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721914909; a=rsa-sha256; cv=none; b=nxluzCE7XxwOA6ifYtcm5OKLGk9RZvSNVz4I7uFQSuOIi1SMV2+EauVlAgsu2ZMD3ba80Z vI/3aesANGI+WaQgjNnbTW498q84OX5yGLQJKWuAcNghcAG6s8hbP+agwPjJK2709GOWFV DfNGwYlt1BbdnepFCdKhLIY4lVZkIjXpLA5B5YZgeFFUuiawG6tj/bWfe+MZfRCREwZAuI My/5WVHfLZvgArvBYS7cL3K5kpfg8PCGCHXvRnyCy73q8720yaSbCO9iT8UXVYeKsCq4BK 9w0c2J/XPSvLEDsLFbmeRdVuXO+USnMO2eQosMZM5IJeyivYQ4XBbyG5hB4JZQ== 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=1721914909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hoL28rXNQy4zeowxkAWZsfZltEooE0VWSLR1vWEcQx0=; b=XdNPpg01+AgOw/PCCllDN3wIR0dmOBSGi+D9ao4XAJtcIH1o8yX6z9ap5H7ut9+mWe8qWr Hl4IFn49zwx4Oseuz0abXnq7F6Lv4VwwcpAT2vDsLPceo1WwNJf/qfmSwPba8WB5aDfg1w sdSynbuogD2ijx4xJCnJRTWpniWu4wwyc4lZoVho6lYYtN2bAPte5xjP6fGku5pJPtjpcU 6ZwA9ZQuhYnCl6MjKhMlANmM3SR6GJHfOJZk3+b/D0Cf8WHdmc49VmCFUhTN+nxAPC8YCd I9qnEMI9kXdkYS9+4dHj5Ht/S8+yF9eDjRTpVr7H5MFT7i2+3KGv9XJhtYzHFQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVBrF1G0TzwbV; Thu, 25 Jul 2024 13:41:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDfnQt044554; Thu, 25 Jul 2024 13:41:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDfmC5044551; Thu, 25 Jul 2024 13:41:48 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:41:48 GMT Message-Id: <202407251341.46PDfmC5044551@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 35bde8969eb6 - stable/13 - pf tests: fix sctp:timeout test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 35bde8969eb6e63c9ca6ebdd4245588b4b8cb6c2 Auto-Submitted: auto-generated The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=35bde8969eb6e63c9ca6ebdd4245588b4b8cb6c2 commit 35bde8969eb6e63c9ca6ebdd4245588b4b8cb6c2 Author: Kristof Provost AuthorDate: 2024-07-17 13:56:49 +0000 Commit: Kristof Provost CommitDate: 2024-07-25 08:23:38 +0000 pf tests: fix sctp:timeout test The test body somehow wound up in the cleanup function. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit fe0c82a603ce069786ee81604315f499fd965546) --- tests/sys/netpfil/pf/sctp.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/sys/netpfil/pf/sctp.sh b/tests/sys/netpfil/pf/sctp.sh index c3e1301238b0..d07d1122048b 100644 --- a/tests/sys/netpfil/pf/sctp.sh +++ b/tests/sys/netpfil/pf/sctp.sh @@ -666,11 +666,6 @@ timeout_head() timeout_body() { sctp_init -} - -timeout_cleanup() -{ - pft_cleanup vnet_mkjail timeout @@ -687,6 +682,11 @@ timeout_cleanup() jexec timeout pfctl -st } +timeout_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "basic_v4" From nobody Thu Jul 25 13:53:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVC5t6qtDz5S5vK; Thu, 25 Jul 2024 13:53: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVC5t6NTTz4V2V; Thu, 25 Jul 2024 13:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721915618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pkm5L/yo6DbjeF6kqYcuAsuSyBc+Qq21DWKIUZZRwtc=; b=s6KwDQiQEXyrYHN1+kCN7n+zHET7+uQSUJq3LGTujb3lfd/QbIhSirFPQYvnQpLRMFdTuJ GgmzOkFGfNblQ2yZv3PUClulA4St5dhLpPSwedbH1yTHWDqOAiWt7J11DKhmAtDI4yoBtr Py66F3LBGSOHsShQEOrCLQ2KF65ChlyXFSdbq9o83YphEDHQPH3V6OKh+K2Cy72kSXP5Gv v885n9KhHgiV310q9n9RrO0SAtvDqH84GVQ1CuIrVVocKYWEfH4VTJuOBGgPgjTC06O2jp OfPfTOqyfAWnDI2ZnC42f6n0AYAMLQ5djSoAKdE6LjRySrj06Qo2yBcrFSxHnA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721915618; a=rsa-sha256; cv=none; b=bGIHfxXxsBVAOAL3cIGvwBcQZKEeOATNCuEn71eZwERDwS2lZFjBV1DlzZLEcaLAH+cJmE 5EBK56oT/Yct8CWwldCCIf7WT2gO6KXbg51nH3JMoq4rLCgufWYWngRiN/ZJJKVpQ+YSV4 cqzSNAWhnZ7RMwFBjWlmzvpxrfyxZMMzjf6Hc+EuEXHC8Zs/wxqVKqYeoZ24WdVh3t7dOG sVl8a/EtZCbi3o8H/2dGy24vOpBZ62aa9I/QIS0puW+2sGXUsremfTlMEKqSaXS4Zp+cZX BwZ//jOXrN5GL30SdUHnrl8U1VisY+KqflsiwPaEjnHKEOrDjhzdhsV4wAM6BQ== 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=1721915618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pkm5L/yo6DbjeF6kqYcuAsuSyBc+Qq21DWKIUZZRwtc=; b=IeeLKzdyDW8TVD7ucG/xGG5Wd0JyFjsrTljDINrfZ6udUGUHytuZ8N89AgP5SRJlP2OfzX yR6AiyJ14siiyWfqb8Cay2HbgEzzInrcQHSbMPH1qVPzkpUmCFLzqJgrbn7CKR1jDcMZYK DR10ntliPDywe/gWn2sH5VEFLHOBtW+U6u7OahMGrpT+aN88XA+2Co0eEHmKkOpLSMeNpb wqlFZawpsP7pR/xQjtD3ud3rgCSsf20xT50A9liuH3/T3O6Y2SvNgAj56UyR69j0217+Xm bZcpJ31fT5qYZcnDwLCSS69I/5aOKWjP83R9IKawUw4u5tWEDpDL65w77YaN1w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVC5t5gspzxZF; Thu, 25 Jul 2024 13:53:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PDrcZi064259; Thu, 25 Jul 2024 13:53:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PDrcFL064256; Thu, 25 Jul 2024 13:53:38 GMT (envelope-from git) Date: Thu, 25 Jul 2024 13:53:38 GMT Message-Id: <202407251353.46PDrcFL064256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: bd206a6f4a87 - main - LinuxKPI: 802.11: consistently spell TRACE-RX: as such List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd206a6f4a87214ae8c1b32f1051b07362080361 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=bd206a6f4a87214ae8c1b32f1051b07362080361 commit bd206a6f4a87214ae8c1b32f1051b07362080361 Author: Bjoern A. Zeeb AuthorDate: 2024-06-05 22:31:32 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-07-25 13:52:57 +0000 LinuxKPI: 802.11: consistently spell TRACE-RX: as such We have TRACE in one place and TRACE-RX in another. Spell it "TRACE-RX: %s: ..." everywhere. Helps with pattern matching. Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45818 --- sys/compat/linuxkpi/common/src/linux_80211.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 0578d1c05403..adef35ec2d5c 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -4996,7 +4996,7 @@ lkpi_80211_lhw_rxq_rx_one(struct lkpi_hw *lhw, struct mbuf *m) #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_RX) - printf("TRACE %s: handled frame type %#0x\n", __func__, ok); + printf("TRACE-RX: %s: handled frame type %#0x\n", __func__, ok); #endif } @@ -5011,8 +5011,8 @@ lkpi_80211_lhw_rxq_task(void *ctx, int pending) #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_RX) - printf("%s:%d lhw %p pending %d mbuf_qlen %d\n", - __func__, __LINE__, lhw, pending, mbufq_len(&lhw->rxq)); + printf("TRACE-RX: %s: lhw %p pending %d mbuf_qlen %d\n", + __func__, lhw, pending, mbufq_len(&lhw->rxq)); #endif mbufq_init(&mq, IFQ_MAXLEN); @@ -5094,7 +5094,7 @@ linuxkpi_ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, /* Implement a dump_rxcb() !!! */ if (linuxkpi_debug_80211 & D80211_TRACE_RX) - printf("TRACE %s: RXCB: %ju %ju %u, %#0x, %u, %#0x, %#0x, " + printf("TRACE-RX: %s: RXCB: %ju %ju %u, %#0x, %u, %#0x, %#0x, " "%u band %u, %u { %d %d %d %d }, %d, %#x %#x %#x %#x %u %u %u\n", __func__, (uintmax_t)rx_status->boottime_ns, @@ -5181,7 +5181,7 @@ no_trace_beacons: #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_RX) - printf("TRACE %s: sta %p lsta %p state %d ni %p vap %p%s\n", + printf("TRACE-RX: %s: sta %p lsta %p state %d ni %p vap %p%s\n", __func__, sta, lsta, (lsta != NULL) ? lsta->state : -1, ni, vap, is_beacon ? " beacon" : ""); #endif From nobody Thu Jul 25 14:27:49 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVCsK4kXJz5S88M; Thu, 25 Jul 2024 14:27: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVCsK46T5z4Xbn; Thu, 25 Jul 2024 14:27:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721917669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/lAP5segQIT2QSARLyATLlUk4Le3Jd/LCZyXwGYGaIY=; b=bVFS60cvwDq++bk3VxzXbCI0ME3CX8gWlN1WoxP7UPf7SxBd9DRoWIkj4TvcOtDZEvS8KM onQn2lXXC526w6j+NEv7QFEGBRI9vUB4uqL7rKTyVuR03rYqIpMnRcRLyTiBXewAPBzz9Z G6o2HIMo0qqXr2T5HMTFfOMXmEY1MdGgmIwQ2J+abxjbfpF6RIZ8SqDKRkIA+f6CxF+6Xf 9TJ1zDggLe3sNZUnKUrVj4hE7KhjK7fR7b4WGmK5HjtxWhiZO3dnvqKjZhM0NAk2CPTjpC TzL5dKaA62h126iAPiYZz6deoMOkyNzrx+97D1a1nC+pRcgo0hZCsCPp3yMYGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721917669; a=rsa-sha256; cv=none; b=nONIyiiB/43wC6Jg420JBuYZS4TH9xcW0ZmJtK/+yDxuUYkkweYXn9eEObJICGh10TM/pz honxvkgihYu0Gx4O+NclWXg8SHOVFu2HdIb3z1ArGx5ZxGWTWuAHCZOttajQdudZPMhy7M jrKXx6uPKVkCFn46R6wgsH5xBoIa+Q4SGYpjnIhdFIutkF+oZ5GCLP58Y7Fnr/ZTGnN26s RgCJ9lPihPZPnQASfSj5581rtwYnRJixvd83hjdNIchwWTUmS+mDvy0cL9dafBryYVWKNq sP+ywkeNupDRGkFLgPdWzubojtmtGVXBvqsk+evP7e6c5bu8/5TV5hEyaXeK7Q== 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=1721917669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/lAP5segQIT2QSARLyATLlUk4Le3Jd/LCZyXwGYGaIY=; b=QPel8bsiOY+W4oQFxIK5y9/PzBeCT41Q2s2aFuOvcomYN7xG/Q+pGo+kLOe6vvqnYn9f8n +v5szkgbSocAwkM7kiaEgicURclheK5hOSEP2WUjuzONhhH3jPi3ic/DiZvKHnM3dNbnbx r8zINXSmtL1bzTrhiPMZcRccyi7RnIigE7tYMB07br143QzIxODJjcI4b70bnfal06FW+g oTgAeqrsYpCTRYzychiGPQhAFLGGFMRbltsBDJY1RN+6c20lElhXg+uUrVvflgXD2dUUIy lJ7qjdZ7T8JWh0loP3epxkKlOm+0zYuHuXqEPYFXAdlWfJfsUR871GPo0viJOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVCsK3bCZzymg; Thu, 25 Jul 2024 14:27:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PERnTf016685; Thu, 25 Jul 2024 14:27:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PERnD5016682; Thu, 25 Jul 2024 14:27:49 GMT (envelope-from git) Date: Thu, 25 Jul 2024 14:27:49 GMT Message-Id: <202407251427.46PERnD5016682@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a48df53e4249 - main - nd6: Fix the routing table subscription List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a48df53e4249499be3e8779dd30888a405aa81ae Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a48df53e4249499be3e8779dd30888a405aa81ae commit a48df53e4249499be3e8779dd30888a405aa81ae Author: Mark Johnston AuthorDate: 2024-07-25 14:26:36 +0000 Commit: Mark Johnston CommitDate: 2024-07-25 14:27:39 +0000 nd6: Fix the routing table subscription The nd6 code listens for RTM_DELETE events so that it can mark the corresponding default router as inactive in the case where the default route is deleted. A subsequent RA from the router may then reinstall the default route. Commit fedeb08b6a58e broke this for non-multipath routes, as rib_decompose_notification() only invokes the callback for multipath routes. Restore the old behaviour. Also ensure that we update the router only for RTM_DELETE notifications, lost in commit 2259a03020fe0. Reviewed by: bz Fixes: fedeb08b6a58 ("Introduce scalable route multipath.") Fixes: 2259a03020fe ("Rework part of routing code to reduce difference to D26449.") MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Bell Tower Integration Differential Revision: https://reviews.freebsd.org/D46020 --- sys/netinet6/nd6.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 3eacb05f88d7..e1fd421060df 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -1614,8 +1614,7 @@ check_release_defrouter(const struct rib_cmd_info *rc, void *_cbdata) struct nhop_object *nh; nh = rc->rc_nh_old; - - if ((nh != NULL) && (nh->nh_flags & NHF_DEFAULT)) { + if (rc->rc_cmd == RTM_DELETE && (nh->nh_flags & NHF_DEFAULT) != 0) { dr = defrouter_lookup(&nh->gw6_sa.sin6_addr, nh->nh_ifp); if (dr != NULL) { dr->installed = 0; @@ -1627,9 +1626,10 @@ check_release_defrouter(const struct rib_cmd_info *rc, void *_cbdata) void nd6_subscription_cb(struct rib_head *rnh, struct rib_cmd_info *rc, void *arg) { - #ifdef ROUTE_MPATH rib_decompose_notification(rc, check_release_defrouter, NULL); + if (rc->rc_cmd == RTM_DELETE && !NH_IS_NHGRP(rc->rc_nh_old)) + check_release_defrouter(rc, NULL); #else check_release_defrouter(rc, NULL); #endif From nobody Thu Jul 25 15:04:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVDhD0WnLz5SBrP; Thu, 25 Jul 2024 15:05: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVDhD02PWz4bP5; Thu, 25 Jul 2024 15:05:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721919900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gN7197vcDcC7D2nejhYezsUELNPurLf6HxMask5uJLE=; b=SVIVDsXQjTL6mX5dMf+ls8AeMpbxu2Oz3xjm53F5TqonEAyH7AimSWL1O2GaiDUwv4tf6J PKS5Tu+Gs4AUMfBPBVAg2WgiqqGUKU9k1Vpqqi1b/BWn5VwCVNQNnHoBxjSgsmFsEVhv5/ TX/RRR89CvLKP5YdhUvJuiHs+f9ipimkv0CdAEStOKZdXFMrv2pcJ39XKfr/viDhMM+nlu AZOYlhOemgaie6jwe6G95dLt/Mu4jZJeCeowap7F8+yw6FcXzTsJNd6fxNtmIAxvy559MQ lg/98xIcMK5FnMAh4rvCVGu1/T/tJVhASsypM4qPJoItJsIaxn82A0pvteXajA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721919900; a=rsa-sha256; cv=none; b=r7Nixjryn4NC/7J4t9TNYr5tlso3stKftYChmZbLjjzBSVLIiTSt06WLxG/U3uFqTk9Xl8 C1uEFyiL7ESSRiqZ06iXt3Ux3ELqqpLT3cxA+DIwb8HO85DkCNEbxZBuJHvewVbrDhxZOO uSvnIXTNnOyeBWW3HYltgUEw2rxkh0f99ww2IoVSd+vSKolCeC7ylrwqLAMu9PcsWVdVmO g323jJcV57AJeWO+34TAoHtbq8nJZcW5rJb4gnHpRgyy1eJ/3XxXzFLG4TyV8YAAxfoWF2 xjCgNEB6maNiGljzvbhbUELxxuILUhgg6rpJfcPUhUivejI2ccnVaJqpdrLYFA== 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=1721919900; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gN7197vcDcC7D2nejhYezsUELNPurLf6HxMask5uJLE=; b=Rqs2qlAANxPh/5UbtaqRaW+8zugVSLT7UsT/2gioNgIMiqBzthXiyU1JNs06LN7c3VuUV/ Qvp7CFOqCuCJ8juH5E78cEGlZ0mlq0DgI07FAS6yG8CsQyFy9fDhDz3GOmBx5UFzHz2wZK rt4dJYRY8gQM8uweLqfU4VTsQ80k/jOh+69ReKULEQE3n5nx61m692gUIUFaIJstuO5UDz olvzNBb6ek/HOlBVKqXmk79x9ESzp183ZlPmZmt22Fs+AN4UC5mvfQpjU3qB9FrBmvaIG1 QIHWy/56+ViwdYemtsh6NqLjsv/WxQvxOujfDpL36rq+dOK2reoIKnAz0frYDw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVDhC6kfrz107q; Thu, 25 Jul 2024 15:04:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PF4xMs084087; Thu, 25 Jul 2024 15:04:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PF4xHg084084; Thu, 25 Jul 2024 15:04:59 GMT (envelope-from git) Date: Thu, 25 Jul 2024 15:04:59 GMT Message-Id: <202407251504.46PF4xHg084084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: db8b3578627b - main - LinuxKPI: 802.11: implement ieee80211_sn_*() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db8b3578627b5be93eba019ab2bbe3c03f7366f4 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=db8b3578627b5be93eba019ab2bbe3c03f7366f4 commit db8b3578627b5be93eba019ab2bbe3c03f7366f4 Author: Bjoern A. Zeeb AuthorDate: 2024-06-05 22:12:56 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-07-25 15:03:42 +0000 LinuxKPI: 802.11: implement ieee80211_sn_*() Implement ieee80211_sn_*() using the equivalent net80211 macros. We need those implemented for at least 11n. While here also sort all the BA functions together next to the "sn" functions. Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45819 --- sys/compat/linuxkpi/common/include/net/mac80211.h | 77 +++++++++++------------ 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/net/mac80211.h b/sys/compat/linuxkpi/common/include/net/mac80211.h index 6a477ae5c32a..c102ada6def2 100644 --- a/sys/compat/linuxkpi/common/include/net/mac80211.h +++ b/sys/compat/linuxkpi/common/include/net/mac80211.h @@ -2077,6 +2077,32 @@ ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif, TODO(); } +/* -------------------------------------------------------------------------- */ + +static inline bool +ieee80211_sn_less(uint16_t sn1, uint16_t sn2) +{ + return (IEEE80211_SEQ_BA_BEFORE(sn1, sn2)); +} + +static inline uint16_t +ieee80211_sn_inc(uint16_t sn) +{ + return (IEEE80211_SEQ_INC(sn)); +} + +static inline uint16_t +ieee80211_sn_add(uint16_t sn, uint16_t a) +{ + return (IEEE80211_SEQ_ADD(sn, a)); +} + +static inline uint16_t +ieee80211_sn_sub(uint16_t sa, uint16_t sb) +{ + return (IEEE80211_SEQ_SUB(sa, sb)); +} + static __inline void ieee80211_mark_rx_ba_filtered_frames(struct ieee80211_sta *sta, uint8_t tid, uint32_t ssn, uint64_t bitmap, uint16_t received_mpdu) @@ -2084,33 +2110,35 @@ ieee80211_mark_rx_ba_filtered_frames(struct ieee80211_sta *sta, uint8_t tid, TODO(); } -static __inline bool -ieee80211_sn_less(uint16_t sn1, uint16_t sn2) +static __inline void +ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, uint32_t x, uint8_t *addr) { TODO(); - return (false); } -static __inline uint16_t -ieee80211_sn_inc(uint16_t sn) +static __inline void +ieee80211_rx_ba_timer_expired(struct ieee80211_vif *vif, uint8_t *addr, + uint8_t tid) { TODO(); - return (sn + 1); } -static __inline uint16_t -ieee80211_sn_add(uint16_t sn, uint16_t a) +static __inline void +ieee80211_start_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr, + uint8_t tid) { TODO(); - return (sn + a); } static __inline void -ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, uint32_t x, uint8_t *addr) +ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr, + uint8_t tid) { TODO(); } +/* -------------------------------------------------------------------------- */ + static __inline void ieee80211_rate_set_vht(struct ieee80211_tx_rate *r, uint32_t f1, uint32_t f2) { @@ -2143,27 +2171,12 @@ ieee80211_unreserve_tid(struct ieee80211_sta *sta, uint8_t tid) TODO(); } -static __inline void -ieee80211_rx_ba_timer_expired(struct ieee80211_vif *vif, uint8_t *addr, - uint8_t tid) -{ - TODO(); -} - static __inline void ieee80211_send_eosp_nullfunc(struct ieee80211_sta *sta, uint8_t tid) { TODO(); } -static __inline uint16_t -ieee80211_sn_sub(uint16_t sa, uint16_t sb) -{ - - return ((sa - sb) & - (IEEE80211_SEQ_SEQ_MASK >> IEEE80211_SEQ_SEQ_SHIFT)); -} - static __inline void ieee80211_sta_block_awake(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool disable) @@ -2459,20 +2472,6 @@ ieee80211_report_low_ack(struct ieee80211_sta *sta, int x) TODO(); } -static __inline void -ieee80211_start_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr, - uint8_t tid) -{ - TODO(); -} - -static __inline void -ieee80211_stop_rx_ba_session_offl(struct ieee80211_vif *vif, uint8_t *addr, - uint8_t tid) -{ - TODO(); -} - static __inline void ieee80211_tx_rate_update(struct ieee80211_hw *hw, struct ieee80211_sta *sta, struct ieee80211_tx_info *info) From nobody Thu Jul 25 16:21:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVGNk46RYz5SJBJ; Thu, 25 Jul 2024 16:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVGNk3c1Pz4m48; Thu, 25 Jul 2024 16:21:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721924502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bUDDZg54+/m1iGrhOoYJzRCeq+f1q9nnGc0mpUkBZt0=; b=lU87/bYaQ0WourtUUUb0tm2/5+DDNTzHmkEZ6q7Y+cSmmfWB4s7/QgiKDdApzff4c2PSIg dvAxzKdHwUPortzp1EVJzl096o3042o4xhs6Hy9ed33dchWzFDy/jfFy2//TYuF29tmWRp IGFOUKh2/O9Mfynvr5lVFRq5IYunqs90KGwpVkpPI//yMMzFeg2mDGzO8JOKl6ZDLiYwJb z8hvkv2H+1KYypqRWbIkmx1H0A2Y0eMB+Yth6o4yGdYiVDAt7j34rQ1utMrrPjHOSaq+Dz 1llP4x05qVOQ+Yto5CpM/Ma/oUULUGGVSIvT3k8E4pKQ8nULf/7Cjwf9Igfr1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721924502; a=rsa-sha256; cv=none; b=sFyuug9F88blJLgTtj1G7GZsLtDolMY8SAwFtwZBvD/YfIg3GFqhUVgwWopxGT3g/xS40u KLHnnfPgBwFq8rzI4OTC4tmC8fzxJT3H61tfi4WFx/wOSC9h1PBAh1ZGmCa1en8glRdQHa lzaulXM6nmLzCALYNM35DNnzwSg4U7keAQSQWN0y18wCfbl/VkcjODrOCPt4dZbL6Qzsj1 81I+JaC98osFD0cqTSFe0lhqNH+o22NsFyLqIc7uc1/bkcT0iOclPg3rz3Fe6CKOEFTYKT 8nvJsKa8aCkF/qYvmrEt9HPmMNbPzGzL0ckaIWw7opBMwdJTsGjQMIFH8+B41Q== 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=1721924502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bUDDZg54+/m1iGrhOoYJzRCeq+f1q9nnGc0mpUkBZt0=; b=hlbRXNXkvm5iOC7Nznmk8HyfXE3+xWh0QR1Ne7TgKJcrIfLcC1or0zfq9RZUlj5DZw0mYB gqW0JYO9yf2zY6yGuDK7I+l629zM/cxOaDTTo8xtW45NfEMvxfhJ/P8GqEy99EddlyGd2i 4CU8/UquQY9IkIMR0JL4DKMFORnaHxbaNEbI27JPkd5D9h8pQcpO18nVRetd1MyaRp9pSr GDfA3TpPGK/CfF/fuK5WmYGVkVyPghbYfp5wjXxA73e0PNkAfeVgv7L/2cBSbTAp2yBgfV vWhDO2/LLkFYRIrR1bdFi8w5wQiQYYKYZ0xDbbRrlLut+7LO+3n7b0D6bOtuOg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVGNk3CMzz12Zg; Thu, 25 Jul 2024 16:21:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PGLgOn014141; Thu, 25 Jul 2024 16:21:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PGLgEk014138; Thu, 25 Jul 2024 16:21:42 GMT (envelope-from git) Date: Thu, 25 Jul 2024 16:21:42 GMT Message-Id: <202407251621.46PGLgEk014138@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 59d262fe969a - main - LinuxKPI: 802.11 compile in debugging based on IEEE80211 debugging List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 59d262fe969af5a8a83f0ccd7586c9bd2c8fb1f3 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=59d262fe969af5a8a83f0ccd7586c9bd2c8fb1f3 commit 59d262fe969af5a8a83f0ccd7586c9bd2c8fb1f3 Author: Bjoern A. Zeeb AuthorDate: 2024-04-06 21:17:58 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-07-25 15:06:46 +0000 LinuxKPI: 802.11 compile in debugging based on IEEE80211 debugging If IEEE80211 debugging is turned on in kernel configs also turn on LinuxKPI 802.11 and SKB debugging (sysctls) to have them available. Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45820 --- sys/compat/linuxkpi/common/include/linux/skbuff.h | 8 ++++++++ sys/compat/linuxkpi/common/src/linux_80211.h | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/skbuff.h b/sys/compat/linuxkpi/common/include/linux/skbuff.h index ee3f427aa6e9..d3839820d3d5 100644 --- a/sys/compat/linuxkpi/common/include/linux/skbuff.h +++ b/sys/compat/linuxkpi/common/include/linux/skbuff.h @@ -46,7 +46,15 @@ #include #include +#include "opt_wlan.h" + +/* Currently this is only used for wlan so we can depend on that. */ +#if defined(IEEE80211_DEBUG) && !defined(SKB_DEBUG) +#define SKB_DEBUG +#endif + /* #define SKB_DEBUG */ + #ifdef SKB_DEBUG #define DSKB_TODO 0x01 #define DSKB_IMPROVE 0x02 diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index a48cf719c693..80be87ebe231 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -42,6 +42,12 @@ #ifndef _LKPI_SRC_LINUX_80211_H #define _LKPI_SRC_LINUX_80211_H +#include "opt_wlan.h" + +#if defined(IEEE80211_DEBUG) && !defined(LINUXKPI_DEBUG_80211) +#define LINUXKPI_DEBUG_80211 +#endif + /* #define LINUXKPI_DEBUG_80211 */ #ifndef D80211_TODO From nobody Thu Jul 25 16:25:09 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVGSj2Rtmz5SJn7; Thu, 25 Jul 2024 16:25: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVGSj1JTMz4n7X; Thu, 25 Jul 2024 16:25:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721924709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+A4m00NAYa3FGtrYxFwrv5WgnekXe6IUuavheYDWGVI=; b=IEdjkBrbvOFJOcEaApr8sc3Vd1wtiMxyYg/qcmFwz9860A/FAgL5iRU43OsRQ4m+rfSqxN 9kCQwkWc4MFfVkaPA71oB2SATluCAu8te+5i9grxDViPvOtroRyMicBWBAyCjd21kpnk59 n8ptm9MUXsIBoJhh2PjUjn8aDkyynaGfBFkOH+Am08uqqhnaPq/et05XlUn70lcSsfJeFh dXpeDZW5Akt4LRF56xPac7mIjRHnCHcK6Yzb0+CrsQAtPVxRE66Yg6yQ6+tbKOc+/7IGtI V9Wo9bVRlbUZ8smxZw1u+NO2ExWTl5jejnuAwvK+g47xEWNwGbgSG4d5OMGgUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721924709; a=rsa-sha256; cv=none; b=ZHrZQ90z4Alzeu+R0g1lPmfRJ9IefepCMg6jJyneQ3sMJ0WBwgZMzLf/JK5Dt7zZ8x9TRU 2h50I7Eb1a/HFOMw9xWSE4p3eRW6K7d8sxkgZhvedXu3ABWv3UUEklub2ynUbDp5vXPOsN jCnmxuYN51rrhLZd19QfVOGa6Db1M77gM9sMBKQ59hM48cqbUrrjlmy97KyUTjaG72WR6T dy/90eKMMyPQV5RweodsSa3W4lOTrBaBXv9zMcUjydooAnNq+/FaDqwcUL3FClqKGxgfjJ Sk2tVi+GVBDGmjQtq97JrskCz3ueJ3tOcJfQNytDLPHW8cRBZuCIpwBsFt+YdA== 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=1721924709; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+A4m00NAYa3FGtrYxFwrv5WgnekXe6IUuavheYDWGVI=; b=tbMuWLNF1+2G58s5UFskytqDhmVrem4LMy+9ln2KYyJpEmrC6B+pFmQxfTNMuuCkEFqPnr pwaRaa1K0JW3qz0AQam/W3xQX5h7mQbuijiQmHDum2BkVcrOPNYFdy76gJlbtqDx7nmK67 TVN0MKwUV5hd3+8nDOW7ar1Rprfh9ZP4ghHRvErZ+W/8RmdcC8AADJFRX4Sm77pZ4/Ym6t dxzKKgduTfYzoc/4zXu3kxYWKT2/0yo0UuBEz4DRQtSyWwmW8O/3zcUmoYukykVfN40PRF s1Tw9hjovsFCaM8cBn3HVlcegsRGSlWUB4GoXNwMqvdFtIQGwFXOr11MhoKcMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVGSj0sPCz12b2; Thu, 25 Jul 2024 16:25:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PGP9OW019094; Thu, 25 Jul 2024 16:25:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PGP9VR019091; Thu, 25 Jul 2024 16:25:09 GMT (envelope-from git) Date: Thu, 25 Jul 2024 16:25:09 GMT Message-Id: <202407251625.46PGP9VR019091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michal Meloun Subject: git: 5670b8cc3672 - main - libthr: Preresolve selected EABI symbols on arm. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mmel X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5670b8cc3672d5a6bc2c41eb48d7d01343c43ad0 Auto-Submitted: auto-generated The branch main has been updated by mmel: URL: https://cgit.FreeBSD.org/src/commit/?id=5670b8cc3672d5a6bc2c41eb48d7d01343c43ad0 commit 5670b8cc3672d5a6bc2c41eb48d7d01343c43ad0 Author: Michal Meloun AuthorDate: 2024-07-24 15:11:27 +0000 Commit: Michal Meloun CommitDate: 2024-07-25 16:24:22 +0000 libthr: Preresolve selected EABI symbols on arm. Add the ability to pre-resolve architecture-specific EABI symbols and use it on arm for selected EABI functions. These functions can be called with rtld bind lock write-locked, so they should be resolved in forward. Reported by: Mark Millard , John F Carr Reviewed by: kib, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D46104 --- lib/libthr/arch/aarch64/include/pthread_md.h | 5 +++ lib/libthr/arch/amd64/include/pthread_md.h | 5 +++ lib/libthr/arch/arm/Makefile.inc | 3 ++ lib/libthr/arch/arm/thr_rtld_arm.c | 67 ++++++++++++++++++++++++++++ lib/libthr/arch/i386/include/pthread_md.h | 5 +++ lib/libthr/arch/powerpc/include/pthread_md.h | 5 +++ lib/libthr/arch/riscv/include/pthread_md.h | 5 +++ lib/libthr/thread/thr_private.h | 1 + lib/libthr/thread/thr_rtld.c | 3 ++ 9 files changed, 99 insertions(+) diff --git a/lib/libthr/arch/aarch64/include/pthread_md.h b/lib/libthr/arch/aarch64/include/pthread_md.h index 75e6abf445ba..305abed55d3c 100644 --- a/lib/libthr/arch/aarch64/include/pthread_md.h +++ b/lib/libthr/arch/aarch64/include/pthread_md.h @@ -49,4 +49,9 @@ _get_curthread(void) return (_tcb_get()->tcb_thread); } +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif /* _PTHREAD_MD_H_ */ diff --git a/lib/libthr/arch/amd64/include/pthread_md.h b/lib/libthr/arch/amd64/include/pthread_md.h index 995f35cb569c..85517c1aee70 100644 --- a/lib/libthr/arch/amd64/include/pthread_md.h +++ b/lib/libthr/arch/amd64/include/pthread_md.h @@ -52,4 +52,9 @@ _get_curthread(void) return (thr); } +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif diff --git a/lib/libthr/arch/arm/Makefile.inc b/lib/libthr/arch/arm/Makefile.inc new file mode 100644 index 000000000000..4e770cf6b90f --- /dev/null +++ b/lib/libthr/arch/arm/Makefile.inc @@ -0,0 +1,3 @@ +.PATH: ${.CURDIR}/arch/arm +SRCS+= \ + thr_rtld_arm.c diff --git a/lib/libthr/arch/arm/thr_rtld_arm.c b/lib/libthr/arch/arm/thr_rtld_arm.c new file mode 100644 index 000000000000..35f5fe56cfff --- /dev/null +++ b/lib/libthr/arch/arm/thr_rtld_arm.c @@ -0,0 +1,67 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024, Michal Meloun + * + * 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 unmodified, 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 +#include + +#include "thr_private.h" + +int __aeabi_idiv(int , int ); +unsigned __aeabi_uidiv(unsigned, unsigned ); + +struct {int q; int r;} __aeabi_idivmod(int, int ); +struct {unsigned q; unsigned r;} __aeabi_uidivmod(unsigned, unsigned); + +struct {int64_t q; int64_t r;} __aeabi_ldivmod(int64_t, int64_t); +struct {uint64_t q; uint64_t r;} __aeabi_uldivmod(uint64_t, uint64_t); + +void __aeabi_memset(void *dest, size_t n, int c); +void __aeabi_memclr(void *dest, size_t n); +void __aeabi_memmove(void *dest, void *src, size_t n); +void __aeabi_memcpy(void *dest, void *src, size_t n); +void __aeabi_memcmp(void *dest, void *src, size_t n); + +void +_thr_resolve_machdep(void) +{ + char tmp[2]; + + __aeabi_idiv(1, 1); + __aeabi_uidiv(1, 1); + + __aeabi_idivmod(1, 1); + __aeabi_uidivmod(1, 1); + + __aeabi_ldivmod(1, 1); + __aeabi_uldivmod(1, 1); + + __aeabi_memset(tmp, 1, 0); + __aeabi_memclr(tmp, 1); + __aeabi_memmove(tmp, tmp + 1, 1); + __aeabi_memcpy(tmp, tmp + 1, 1); + __aeabi_memcmp(tmp, tmp + 1, 1); +} diff --git a/lib/libthr/arch/i386/include/pthread_md.h b/lib/libthr/arch/i386/include/pthread_md.h index 9008a4f11bdb..7e2c8d7330fc 100644 --- a/lib/libthr/arch/i386/include/pthread_md.h +++ b/lib/libthr/arch/i386/include/pthread_md.h @@ -52,4 +52,9 @@ _get_curthread(void) return (thr); } +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif diff --git a/lib/libthr/arch/powerpc/include/pthread_md.h b/lib/libthr/arch/powerpc/include/pthread_md.h index 89fae48328cb..a5bc0265ed3a 100644 --- a/lib/libthr/arch/powerpc/include/pthread_md.h +++ b/lib/libthr/arch/powerpc/include/pthread_md.h @@ -49,4 +49,9 @@ _get_curthread(void) return (NULL); } +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif /* _PTHREAD_MD_H_ */ diff --git a/lib/libthr/arch/riscv/include/pthread_md.h b/lib/libthr/arch/riscv/include/pthread_md.h index 343f4cae8486..baddfe3ecb22 100644 --- a/lib/libthr/arch/riscv/include/pthread_md.h +++ b/lib/libthr/arch/riscv/include/pthread_md.h @@ -56,4 +56,9 @@ _get_curthread(void) return (NULL); } +static __inline void +_thr_resolve_machdep(void) +{ +} + #endif /* _PTHREAD_MD_H_ */ diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h index de65e8e7353d..023558100e2a 100644 --- a/lib/libthr/thread/thr_private.h +++ b/lib/libthr/thread/thr_private.h @@ -1103,6 +1103,7 @@ int __Tthr_mutex_trylock(pthread_mutex_t *); bool __thr_get_main_stack_base(char **base); bool __thr_get_main_stack_lim(size_t *lim); int _Tthr_sigqueue(pthread_t pthread, int sig, const union sigval value); +void _thr_resolve_machdep(void); __END_DECLS __NULLABILITY_PRAGMA_POP diff --git a/lib/libthr/thread/thr_rtld.c b/lib/libthr/thread/thr_rtld.c index 25ecb83a11a3..68a02e9aca1b 100644 --- a/lib/libthr/thread/thr_rtld.c +++ b/lib/libthr/thread/thr_rtld.c @@ -276,6 +276,9 @@ _thr_rtld_init(void) _thr_signal_block_check_fast(); _thr_signal_block_setup(curthread); + /* resolve machine depended functions, if any */ + _thr_resolve_machdep(); + uc_len = __getcontextx_size(); uc = alloca(uc_len); getcontext(uc); From nobody Thu Jul 25 16:42:51 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVGs72pH3z5SKpy; Thu, 25 Jul 2024 16:42: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVGs72MGPz4pds; Thu, 25 Jul 2024 16:42:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721925771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hQuE9q4WNBW9F7uzPdwbPZiiG02/Rs9rZuIJyqyeqzo=; b=HW4k5cUufd8VkMHO5wDP/aj2JlDcO5RQVBZzIDJCfyKTng6BOZR0r+AkenuJ+/bCtfhzkB onaVHKxOzXXIypjvyooPrJs+E9jVfKvUbiJjEJM7tc3+dHxUCuEE5yCFBRj2hfY2httcdm gAYT6j8rB9gGBjh8yAMoGplj3X0VsWZeeD6t6TxeF+i0XPCyo1kLtjbOLjS+iCDq/T9b0o VBdtIwnuGLGPFsAITZxe6pXHXoRQPWJbkfsPs+hUS/tMgetSSnDUAYmpMW1L309nGCaMXX KkOrOEqpTyA5oxIPkubL5kF3gxWMNXaN2RYYJG3/jKhomQZO0U3NQtPFJlscrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721925771; a=rsa-sha256; cv=none; b=RmBkD1nJvAxDMLBiehJQNHuZz0lGCfqV4VouQnaIAkf/rzwAau1r54hUvBs2+7CcLkmI+j VuIL0jbOOGc6kqTmDqEoCxe2XlI/s48Ax93x4wFIwy+WPJz3pDeCkE0Wkj182SrBzCuL8A A4MFUF7E9CKG4jpNl5wLcW5/+oNPAWmnAETpxHOAKFzy1F5FTNFSmjDGwEMBfbRa08K6ud 6F6fScT6r6e4DxfttsvU8RolQNJyvxR0Jfby6fpjbgl30Qsnu4aP7wlakstL0WtlntDjoZ UUQsXDrhB/KkHuXpG6jybnbCo4hjX7dEIoM8SjfEudICTyfxoYZ+eAZLXfwXlg== 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=1721925771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hQuE9q4WNBW9F7uzPdwbPZiiG02/Rs9rZuIJyqyeqzo=; b=jcTqRYPJkeXuM/4UHnmcAb7f3VOV3HZKz3Kkyf72iiPfuiOAjFcdJ/eda/JeK1NOHHAbM3 WrT6rovo/AtoNJL6Y5aI5spHfDWlCKqfcswOoEHDQ6awTckP92AGa0iBYgaDaB6tg7tvHC UMrqjxfeQM0c+TD2vkZc1jNONlNpQq93PXD9Q8++w+uSiZPYF3Ch2sR1WiRnh/DWHrMkfb Eip9utDU9OHl2UtloJ3jMd4+YQ6FM7u100Q2z8SX9fRzHRjsqK49jrtLWUR4GFfUuldsd4 S8mUY/k7HInHuROUxMF2oD8L21CcyakCUpvhLgCAPy8GNCJYHdWiO/35qOAxxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVGs71z68z136d; Thu, 25 Jul 2024 16:42:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PGgpwb053097; Thu, 25 Jul 2024 16:42:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PGgpaw053094; Thu, 25 Jul 2024 16:42:51 GMT (envelope-from git) Date: Thu, 25 Jul 2024 16:42:51 GMT Message-Id: <202407251642.46PGgpaw053094@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: e8fe3b9e731d - main - arm64: turn on IEEE80211 debugging and IEEE80211_SUPPORT_MESH too List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8fe3b9e731d4c40cd122aeaf58bbb175c135cfc Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=e8fe3b9e731d4c40cd122aeaf58bbb175c135cfc commit e8fe3b9e731d4c40cd122aeaf58bbb175c135cfc Author: Bjoern A. Zeeb AuthorDate: 2024-04-06 21:14:37 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-07-25 16:29:24 +0000 arm64: turn on IEEE80211 debugging and IEEE80211_SUPPORT_MESH too Like we do for other architectures, add IEEE80211_SUPPORT_MESH support to the kernel config on arm64. Like we do with, e.g., USB_DEBUG, add IEEE80211_DEBUG too on main (std.nodebug will turn this off). Sponsored by: The FreeBSD Foundation X-MFC: no Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D45817 --- sys/arm64/conf/std.dev | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/arm64/conf/std.dev b/sys/arm64/conf/std.dev index 42c9fcf03b05..c5c364ffda04 100644 --- a/sys/arm64/conf/std.dev +++ b/sys/arm64/conf/std.dev @@ -118,3 +118,7 @@ device hidbus # Generic HID Bus # Firmware device mmio_sram # Generic on-chip SRAM + +# Wireless options +options IEEE80211_DEBUG # enable debug msgs +options IEEE80211_SUPPORT_MESH # enable 802.11s draft support From nobody Thu Jul 25 17:13:57 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVHY20LFWz5QtlV; Thu, 25 Jul 2024 17:13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVHY16tChz4wg6; Thu, 25 Jul 2024 17:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721927638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NyWGy0aE5p+BYbdrDIdGtxXn5mnYLcSHYrHHf1+6Yzk=; b=IDzOS7w1gP0RKololhQ0B+OC/782VmDgMq4H7mvVfz29d1lxlPCXiPD6sWo8lOk9WoxydA XI2ddiYPeMwsGalBbVDaHD0IvQCyD9RFyW/1ggk5zlFMla4SEzTPVFyqPRD+FF3yMUp2Dv iSGDyLw8y5iieEwoThT+HNxQ4V4sNp3EThanxEE9ic9pAkXTejL6uJPEQGw/JWgUYXj4lT Q5LWmdWnXZ0DHq0ydhP7ys79hERfzh7zYCwXZwSiRNEefklgT5ZH6soQ8kzk2uKVPoNZGn C/ZxdW8gS62W9W8GO0QPYMl+E7UptjsgF9aXfb1yRL9ZbzjUWXYyLWey4lHRbQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721927638; a=rsa-sha256; cv=none; b=mbmLr4Xev098mpsulxtme0+n16ldT3H5PnfLppVnDjH1PBATZyJq9gM8TOaL9jw4gGHF1o W/4CDMbCDjoSMaJ3xI/6y51HQiWseS79aQ++Gf1ZyqfwOholKY/VdUvkYUIPjRhta3MW1C duzPY2KdC3UulVlrcxsRsTkIn00I1vfwgUM4fZqIgEUJ/gTPK7ZQJ0q8QBb05P+D2YjYE5 sEQCrI2OIqQVnLwLLo2sS0nwYHLFUlDHCiCUumb1LEeCC34y/Kf7qzNuJFI3h8WjmdH29q rOvW9tTDwlAeluGv5uA1fBfbHM4DTT1C9e20kCV/CbW3V/RtNjCUX7wnJImOyA== 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=1721927638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NyWGy0aE5p+BYbdrDIdGtxXn5mnYLcSHYrHHf1+6Yzk=; b=JelXj5Nn/m5HLnZ27MyLrOF+LCzzSnrLW+Cutdq2uBNOtMYZp2aFQZLB14gCsZsNYyO0do 9keHSSnXcQ76RdgxH3LI2glS4g4vufJ/ibVsW/99NHAfLKQoHNEezwUXfdXZNZzs3vA04l kZaoz9JwoXBxTgoXh6wqfDyyCk7rJLFL0HKhx8rWiO6cLOtj7gkN7b+NBVGOPlLsc/lowP 3Ygj1ZXyd2+0IJHOjmWcHU/unUJRU5V9IozjaiFfWrq9rmfkhtLzp7KNclZ9skXYZyYIFM 6zV5R77eg9pcVC858oqW6TA50yfUyq+/Mf+mCBr899ac62XvIHPX01TQoUZ7Bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVHY16TGpz13dr; Thu, 25 Jul 2024 17:13:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PHDvfv004203; Thu, 25 Jul 2024 17:13:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PHDvBj004200; Thu, 25 Jul 2024 17:13:57 GMT (envelope-from git) Date: Thu, 25 Jul 2024 17:13:57 GMT Message-Id: <202407251713.46PHDvBj004200@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cheng Cui Subject: git: 9565854ab408 - main - cc_cubic: remove the redundant variable num_cong_events from struct cubic. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9565854ab408a6235def12074f98b9ccc0f3008e Auto-Submitted: auto-generated The branch main has been updated by cc: URL: https://cgit.FreeBSD.org/src/commit/?id=9565854ab408a6235def12074f98b9ccc0f3008e commit 9565854ab408a6235def12074f98b9ccc0f3008e Author: Cheng Cui AuthorDate: 2024-07-19 16:11:59 +0000 Commit: Cheng Cui CommitDate: 2024-07-25 17:11:32 +0000 cc_cubic: remove the redundant variable num_cong_events from struct cubic. Summary: This variable was added by commit eb5bfdd06565, but unnecessarily needed. No functional change. Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D46042 --- sys/netinet/cc/cc_cubic.c | 2 -- sys/netinet/cc/cc_cubic.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c index b4050326ae31..5141de86ef85 100644 --- a/sys/netinet/cc/cc_cubic.c +++ b/sys/netinet/cc/cc_cubic.c @@ -490,13 +490,11 @@ cubic_cong_signal(struct cc_var *ccv, ccsignal_t type) } cubic_data->flags |= CUBICFLAG_CONG_EVENT | CUBICFLAG_RTO_EVENT; cubic_data->undo_W_max = cubic_data->W_max; - cubic_data->num_cong_events++; CCV(ccv, snd_cwnd) = mss; break; case CC_RTO_ERR: cubic_data->flags &= ~(CUBICFLAG_CONG_EVENT | CUBICFLAG_RTO_EVENT); - cubic_data->num_cong_events--; cubic_data->K = cubic_data->undo_K; cubic_data->cwnd_prior = cubic_data->undo_cwnd_prior; cubic_data->W_max = cubic_data->undo_W_max; diff --git a/sys/netinet/cc/cc_cubic.h b/sys/netinet/cc/cc_cubic.h index ce6c2a6633d7..592703906d1a 100644 --- a/sys/netinet/cc/cc_cubic.h +++ b/sys/netinet/cc/cc_cubic.h @@ -121,8 +121,6 @@ struct cubic { uint64_t undo_W_max; uint64_t undo_W_est; uint64_t undo_cwnd_epoch; - /* Number of congestion events experienced */ - uint64_t num_cong_events; uint32_t css_baseline_minrtt; uint32_t css_current_round_minrtt; uint32_t css_lastround_minrtt; From nobody Thu Jul 25 18:03:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVJdt0mFSz5R0YT; Thu, 25 Jul 2024 18:03: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVJdt0BTLz52qY; Thu, 25 Jul 2024 18:03:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721930594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Innm4UVYFJ5ZHJ/w8Zv8Zb3p3DtIiMdwFUFyW6wjjkQ=; b=LvpluAylfi3HKFqmZZvUma3oicXzu911bCzrDvneUyp1xOxu7lgqXfqa5paJRHBdPaqkxP F8sWn07pYlZVxYk8jQzJptX5lXBh84AWPh8eqtcLtM7PqRof2vmRhOdZjEKFHM4MbMcQMT 6+Ul/IWn1y8920J3nr6gNClqEpZheqGMKbDgvy3wnYFDSsWF+lwaF1DfGNK7KUfz1l17n/ Uh4J/mJBVT8gmwSne6Vco2xnnGorMaxTNnA9qHHIBluF+9X1UIusReD4BM+s0KGd8j6kQ0 p4TDF4I3AacgnMtKoIcKxwURe9mgmCCeX0rC7LtWQMrBruIZHWH+akTPz9XfMQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721930594; a=rsa-sha256; cv=none; b=KvP7l+LsTlSFNfjj2jB4OEJ05+B93ow7/X8HsiQXzwYdPmCuSXGWF2agdsmLIMp7wRYpEC BQ9msDUyjUhUHhMJJZ7L2YQx1CCXQLqinf3MuJynnor6M+V95Z6WrNuzWsyCpehEJNgDfk IkzdhaRroB10BimTaB0iNXky4qqCwX49jFcq56DlM7NnZKNTlXC6aMMwE0oTxHt0lNxWtf szgFNYSZPiBwM8s9XTBzODpGQQOqpeR6/G9Jw30V7eS6+2UKLqsBN9rO49tQTugCWhYX+i FN1HKYtkopiafnaB3et6i8y5X7I8IjczfUD2QawtSs4SrtuV99aSOcWuh/H4WA== 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=1721930594; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Innm4UVYFJ5ZHJ/w8Zv8Zb3p3DtIiMdwFUFyW6wjjkQ=; b=Q5poBhtzR1Z9XE0WAx1Br9BinD/k+pntkvQZSrXFzsdLQOyLPyUBzHXZNdYkDA1kN8oFOC OAhVKbyS7zAfloidihiQ8pAgui+rw0UiYeN2atH7PGrtSXsxZaxBuKZUyGIZiMu4crUT5C OAaf/hbbgvJ6Uo4KHlOUmIjINStEHqrk68RooWxpjNFfOPydgWs4Q2/sf6PgV2s8jeXmBm P4FT8qBBUV/qxDgJO+HrMvxwGKfQemvlH86NoZ6FPExzSLbtkgdEDElGxYFLmNj/QItg/m FFc731Xg7sTFeLblx/3/RZwr0oTleiEEGVGsteWuVKrbizrtn4WGn7epWA4NlQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVJds6vpvz14ph; Thu, 25 Jul 2024 18:03:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PI3DjS090082; Thu, 25 Jul 2024 18:03:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PI3D4d090079; Thu, 25 Jul 2024 18:03:13 GMT (envelope-from git) Date: Thu, 25 Jul 2024 18:03:13 GMT Message-Id: <202407251803.46PI3D4d090079@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 55a2a91c5e1b - main - Merge commit 28a2b85602a5 from llvm-project (by Kazu Hirata): List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 55a2a91c5e1bb39dd625ba56597608883fbcb318 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=55a2a91c5e1bb39dd625ba56597608883fbcb318 commit 55a2a91c5e1bb39dd625ba56597608883fbcb318 Author: Dimitry Andric AuthorDate: 2024-07-25 11:13:45 +0000 Commit: Dimitry Andric CommitDate: 2024-07-25 18:03:01 +0000 Merge commit 28a2b85602a5 from llvm-project (by Kazu Hirata): [DeadStoreElimination] Use SmallSetVector (NFC) (#79410) The use of SmallSetVector saves 0.58% of heap allocations during the compilation of a large preprocessed file, namely X86ISelLowering.cpp, for the X86 target. During the experiment, the final size of ToCheck was 8 or less 88% of the time. Merge commit 9e95c4947d31 from llvm-project (by Nikita Popov): [DSE] Fix non-determinism due to address reuse (#84943) The malloc->calloc fold creates a new MemoryAccess, which may end of at the same address as a previously deleted access inside SkipStores. To the most part, this is not a problem, because SkipStores is normally only used together with MemDefs. Neither the old malloc access nor the new calloc access will be part of MemDefs, so there is no problem here. However, SkipStores is also used in one more place: In the main DSE loop, ToCheck entries are checked against it. Fix this by not using SkipStores here, and instead using a separate set to track deletions inside this loop. This way it is not affected by the calloc optimization that happens outside it. This is all pretty ugly, but I haven't found another good way to fix it. Suggestions welcome. No test case as I don't have a reliable DSE-only test-case for this. Fixes https://github.com/llvm/llvm-project/issues/84458. This fixes another possible difference in output when building i386 object files with a native or cross build of clang. (Specifically, the file sbin/ipf/ipmon/ipmon.o.) PR: 276961 Reported by: cperciva MFC after: 3 days --- .../lib/Transforms/Scalar/DeadStoreElimination.cpp | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index 380d65836553..f0f0f5f28025 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -1697,7 +1697,9 @@ struct DSEState { /// Delete dead memory defs and recursively add their operands to ToRemove if /// they became dead. - void deleteDeadInstruction(Instruction *SI) { + void + deleteDeadInstruction(Instruction *SI, + SmallPtrSetImpl *Deleted = nullptr) { MemorySSAUpdater Updater(&MSSA); SmallVector NowDeadInsts; NowDeadInsts.push_back(SI); @@ -1718,6 +1720,8 @@ struct DSEState { if (IsMemDef) { auto *MD = cast(MA); SkipStores.insert(MD); + if (Deleted) + Deleted->insert(MD); if (auto *SI = dyn_cast(MD->getMemoryInst())) { if (SI->getValueOperand()->getType()->isPointerTy()) { const Value *UO = getUnderlyingObject(SI->getValueOperand()); @@ -2111,7 +2115,12 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, unsigned WalkerStepLimit = MemorySSAUpwardsStepLimit; unsigned PartialLimit = MemorySSAPartialStoreLimit; // Worklist of MemoryAccesses that may be killed by KillingDef. - SetVector ToCheck; + SmallSetVector ToCheck; + // Track MemoryAccesses that have been deleted in the loop below, so we can + // skip them. Don't use SkipStores for this, which may contain reused + // MemoryAccess addresses. + SmallPtrSet Deleted; + [[maybe_unused]] unsigned OrigNumSkipStores = State.SkipStores.size(); ToCheck.insert(KillingDef->getDefiningAccess()); bool Shortend = false; @@ -2119,7 +2128,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, // Check if MemoryAccesses in the worklist are killed by KillingDef. for (unsigned I = 0; I < ToCheck.size(); I++) { MemoryAccess *Current = ToCheck[I]; - if (State.SkipStores.count(Current)) + if (Deleted.contains(Current)) continue; std::optional MaybeDeadAccess = State.getDomMemoryDef( @@ -2166,7 +2175,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, continue; LLVM_DEBUG(dbgs() << "DSE: Remove Dead Store:\n DEAD: " << *DeadI << "\n KILLER: " << *KillingI << '\n'); - State.deleteDeadInstruction(DeadI); + State.deleteDeadInstruction(DeadI, &Deleted); ++NumFastStores; MadeChange = true; } else { @@ -2203,7 +2212,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, Shortend = true; // Remove killing store and remove any outstanding overlap // intervals for the updated store. - State.deleteDeadInstruction(KillingSI); + State.deleteDeadInstruction(KillingSI, &Deleted); auto I = State.IOLs.find(DeadSI->getParent()); if (I != State.IOLs.end()) I->second.erase(DeadSI); @@ -2215,13 +2224,16 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, if (OR == OW_Complete) { LLVM_DEBUG(dbgs() << "DSE: Remove Dead Store:\n DEAD: " << *DeadI << "\n KILLER: " << *KillingI << '\n'); - State.deleteDeadInstruction(DeadI); + State.deleteDeadInstruction(DeadI, &Deleted); ++NumFastStores; MadeChange = true; } } } + assert(State.SkipStores.size() - OrigNumSkipStores == Deleted.size() && + "SkipStores and Deleted out of sync?"); + // Check if the store is a no-op. if (!Shortend && State.storeIsNoop(KillingDef, KillingUndObj)) { LLVM_DEBUG(dbgs() << "DSE: Remove No-Op Store:\n DEAD: " << *KillingI From nobody Thu Jul 25 18:16:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVJxL525cz5R1cj; Thu, 25 Jul 2024 18:16: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVJxL2V4Pz54Vp; Thu, 25 Jul 2024 18:16:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721931398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YNQvw/jDXRB9fnAFg/WpAB6xo1F6yximjEqetJZYBfI=; b=NJl8y1C2qZItZdAldNMgiR9yo4A6939VQCMBLDPUkYHZfQ5w0MivNT/OPwcpDEGujeEkES UbL6ZpGRsJ/ImO6AKosBxMGiVnjrFE3f9gxvg8vT2sQrsHHIgq2vWVUYhpec9pHgEYEALv KIsMJTIyWOnbzaMCGHwx0ROrGy0CYHavjoyAZD3oMwe2oh3OAxG55URV+et9wQiNZCtaSd 73y146ROc20PJSXA5FQntwh4eZ885g3/tcljQ5xssFjj/6OYVXSEIWH0/gwY7ahXQ8p1Mc /utypE9qnAsrYyvlj+spPYW9Yt0gWEJbweyrCECb80aVU816i7HLAsszPWPRfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721931398; a=rsa-sha256; cv=none; b=KpZW3e1ZNTkl/MV62s2h+yH/VCyHGboIFL95GVY8fR3CBjcyZy6sqFV5aqLonRzir2foUL 49H7HjJVBwslm5VAPt9EUJezD+Xw6Ij4U+bHtxHpAPPmaYiL8xqrQoDdBxRLLfuf7ctSEq SJExvBkmTcgBd5/B8cvQPgQ7kjFSUk/45tsytsENoMNO9LA1oWIWFeDJA8fsENENMho9lW Y6kGyqZnhO6HD0NTy5f8+sMU13QmF9daFsRgJqROW/LMw1G9DyaAbziVtTwZzaKAq+JxFs d2XEzWR7o2ZKB5fXLtsUP6T4HDmZPMlb7bzXb4NGMP6zQzorG4xn0sktVMnhGg== 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=1721931398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YNQvw/jDXRB9fnAFg/WpAB6xo1F6yximjEqetJZYBfI=; b=brcARiI5Be9ZiQfWnRflMW8W1rbVOmeVV6FrlQsPT2QvZOwAJry27V3M1PEDoEaIbT/IHP imKFfJX9XQHvOVT0fQhMYrS6hc3a9oF1KCa7HL6xdJ2hUe+Eni/0TWYe5GsDAj+FyY61eb FSE5A+lleUw8XfypfKHuVwEw1rE9fY/1xg9qyl0AJRn1BtysG0Op7DBccMeLK1cd4ik7Tv 9SNfkaq+IOeXiA0RzkIDH1x+stAsNyZrbJfeEqHPF7nqiQAAhWgK12OjJYF93qkYq5CDWA kcMRz2lrM2lK/gsKgXILP/18ZH+zNzZ/ReKvpv/0MDHhtIy9Jdr3MEJ1UFPcQA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVJxL262Kz15NJ; Thu, 25 Jul 2024 18:16:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PIGcA0006965; Thu, 25 Jul 2024 18:16:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PIGcWE006962; Thu, 25 Jul 2024 18:16:38 GMT (envelope-from git) Date: Thu, 25 Jul 2024 18:16:38 GMT Message-Id: <202407251816.46PIGcWE006962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Osama Abboud Subject: git: 9baed398ee4c - main - Add osamaabb as src committer and cperciva as mentor List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: osamaabb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9baed398ee4ce2f0e58a6c1cfec293bedc5362e6 Auto-Submitted: auto-generated The branch main has been updated by osamaabb: URL: https://cgit.FreeBSD.org/src/commit/?id=9baed398ee4ce2f0e58a6c1cfec293bedc5362e6 commit 9baed398ee4ce2f0e58a6c1cfec293bedc5362e6 Author: Osama Abboud AuthorDate: 2024-07-17 19:55:30 +0000 Commit: Osama Abboud CommitDate: 2024-07-25 18:11:58 +0000 Add osamaabb as src committer and cperciva as mentor Approved by: cperciva (mentor) --- share/misc/committers-src.dot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/share/misc/committers-src.dot b/share/misc/committers-src.dot index d9fd06cd6597..da7092c8bb24 100644 --- a/share/misc/committers-src.dot +++ b/share/misc/committers-src.dot @@ -295,6 +295,7 @@ obrien [label="David E. O'Brien\nobrien@FreeBSD.org\n1996/10/29"] oh [label="Oskar Holmlund\noh@FreeBSD.org\n2021/04/21"] olce [label="Olivier Certner\nolce@FreeBSD.org\n2023/12/01"] olli [label="Oliver Fromme\nolli@FreeBSD.org\n2008/02/14"] +osamaabb [label="Osama Abboud\nosamaabb@FreeBSD.org\n2024/06/12"] oshogbo [label="Mariusz Zaborski\noshogbo@FreeBSD.org\n2015/04/15"] peadar [label="Peter Edwards\npeadar@FreeBSD.org\n2004/03/08"] peter [label="Peter Wemm\npeter@FreeBSD.org\n1995/07/04"] @@ -422,6 +423,8 @@ adrian -> sgalabov ae -> melifaro +akiyano -> osamaabb + allanjude -> rew allanjude -> tmunro allanjude -> tsoome @@ -490,6 +493,7 @@ cognet -> zbb cperciva -> akiyano cperciva -> eadler cperciva -> flz +cperciva -> osamaabb cperciva -> randi cperciva -> simon From nobody Thu Jul 25 18:43:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVKXr4y0wz5R4C9; Thu, 25 Jul 2024 18:43: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVKXr30qgz56LC; Thu, 25 Jul 2024 18:43:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721933036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hmHuJZUNaLns3N8mmQSR57YFVcqi3OOYU3amikqwTvg=; b=POh4bUX1Gl5vtlrvXXi2DNCbnt4OBGLKfC7hYJkuTHxpqXJRTTOzn3EeXhZsyOKlul14H3 WZtxj9+DtXY39jYkHEP5SHxyLvH0kotukR4+hiNQFtoUBAxY00Ja7c+gc49bVy7j41zmks DYyE1IKAXtCFmlcDTh3OtJ1KOyV02Qc9L6Xy5Lst/8Q3RUNm/UO2pHQ6UtUsElvE4UIbzw EvG8eIzg6tj2ehtpbF+cFf+NV8ACJnPZw14Rk3mASRICHbVtVMB5pqREYffr6/Wo8RJzQY 4aUT7N8t/L8Il1I8YDZTQ4iMq9bowQlM91vWUxiM904tf4IGGlkU7bkCNipdAw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721933036; a=rsa-sha256; cv=none; b=slN3l1oXrUKSfp/fULc1G9X2Cbw5vcODB6R+4lOPItRDv/fdil5Gd4nmJem/kQtkjEqjpR D8EdMPU5WEqkEZ6EM9lkCnB2ecTYsr8JYh4Mj9YcbgcSx4xMJmrwsR6i1fnR12neKtJ7Yj 3RqKQJBlclUJucXD3sBYu0tznF7rUl5852Sk5sb96Sv8LbEvIsxOKkS8IxTxRbhXoDmkUM oN0M7mWrZ+okpEw3GICHG7bTft19elfRrmPr/yV8hgj9+BaeWsmP3Khff5E/kZLuEFmC4S +BsggnOsSJPdar12t9j6cReqmceYj7M7pic6oK9CAPI9wQ/oRUZ/kJss29xITg== 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=1721933036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hmHuJZUNaLns3N8mmQSR57YFVcqi3OOYU3amikqwTvg=; b=F3/OA46zDvarbz5PYEllcJ+h0KSIOP2CFY1v1qZTmNT6RcS4UuvYduTrdOAcniwB8QU2/5 2W4/F3CTOoRAnhK9oTL8bWbLEjyeONsNJI3CS8Rc/U2Y8BpSymN+CoQ6FdTpVKHHrG0xLC vXlPP+Cs+5+nzQhDxbveMxDfs4pnGJ+qCuP6Lr9m6SnYhFwq0tKP20IY+fQFNwPymT/d7Y PDAShQn7E1Mz4DwAb0PnSc2WW91X9OKChXkFBjOG77beSTskXIRxo8oW/EjWZ0aDB5QgNb gobQJBaTeYlebV0Ywy8bsSpJkdUGyoZJbfZLg3CRCoAV2FxFkUsJM5ADlv8ywA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVKXr2cjkz16Jl; Thu, 25 Jul 2024 18:43:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PIhuVR057420; Thu, 25 Jul 2024 18:43:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PIhuBr057417; Thu, 25 Jul 2024 18:43:56 GMT (envelope-from git) Date: Thu, 25 Jul 2024 18:43:56 GMT Message-Id: <202407251843.46PIhuBr057417@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4aff4048f5b1 - main - LinuxKPI: 802.11: support manual lladdr changes List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4aff4048f5b1b6ab0b905726853ba6083e37cc37 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4aff4048f5b1b6ab0b905726853ba6083e37cc37 commit 4aff4048f5b1b6ab0b905726853ba6083e37cc37 Author: Bjoern A. Zeeb AuthorDate: 2024-07-25 07:53:32 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-07-25 18:42:26 +0000 LinuxKPI: 802.11: support manual lladdr changes Allow a user to change the "ether" address by ifconfig while a VAP is not UP. Compared to net80211 (given we have no callback) we register an eventhandler per-vif (a global one would force us to use hacks to derive if a vap is indeed also a lkpi_80211 vif). Sponsored by: The FreeBSD Foundation PR: 277356 Tested by: lwhsu MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46121 --- sys/compat/linuxkpi/common/src/linux_80211.c | 30 ++++++++++++++++++++++++++++ sys/compat/linuxkpi/common/src/linux_80211.h | 1 + 2 files changed, 31 insertions(+) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index adef35ec2d5c..b46e56133725 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2750,6 +2750,32 @@ lkpi_ic_wme_update(struct ieee80211com *ic) return (0); /* unused */ } +/* + * Change link-layer address on the vif (if the vap is not started/"UP"). + * This can happen if a user changes 'ether' using ifconfig. + * The code is based on net80211/ieee80211_freebsd.c::wlan_iflladdr() but + * we do use a per-[l]vif event handler to be sure we exist as we + * cannot assume that from every vap derives a vif and we have a hard + * time checking based on net80211 information. + */ +static void +lkpi_vif_iflladdr(void *arg, struct ifnet *ifp) +{ + struct epoch_tracker et; + struct ieee80211_vif *vif; + + NET_EPOCH_ENTER(et); + /* NB: identify vap's by if_init; left as an extra check. */ + if (ifp->if_init != ieee80211_init || (ifp->if_flags & IFF_UP) != 0) { + NET_EPOCH_EXIT(et); + return; + } + + vif = arg; + IEEE80211_ADDR_COPY(vif->bss_conf.addr, IF_LLADDR(ifp)); + NET_EPOCH_EXIT(et); +} + static struct ieee80211vap * lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, enum ieee80211_opmode opmode, int flags, @@ -2798,6 +2824,8 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], vif->bss_conf.vif = vif; /* vap->iv_myaddr is not set until net80211::vap_setup or vap_attach. */ IEEE80211_ADDR_COPY(vif->bss_conf.addr, mac); + 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.chandef.width = NL80211_CHAN_WIDTH_20_NOHT; vif->bss_conf.use_short_preamble = false; /* vap->iv_flags IEEE80211_F_SHPREAMBLE */ @@ -2971,6 +2999,8 @@ lkpi_ic_vap_delete(struct ieee80211vap *vap) lhw = ic->ic_softc; hw = LHW_TO_HW(lhw); + EVENTHANDLER_DEREGISTER(iflladdr_event, lvif->lvif_ifllevent); + LKPI_80211_LHW_LVIF_LOCK(lhw); TAILQ_REMOVE(&lhw->lvif_head, lvif, lvif_entry); LKPI_80211_LHW_LVIF_UNLOCK(lhw); diff --git a/sys/compat/linuxkpi/common/src/linux_80211.h b/sys/compat/linuxkpi/common/src/linux_80211.h index 80be87ebe231..7675a8b6cebf 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.h +++ b/sys/compat/linuxkpi/common/src/linux_80211.h @@ -165,6 +165,7 @@ struct lkpi_sta { struct lkpi_vif { TAILQ_ENTRY(lkpi_vif) lvif_entry; struct ieee80211vap iv_vap; + eventhandler_tag lvif_ifllevent; struct mtx mtx; struct wireless_dev wdev; From nobody Thu Jul 25 19:33:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVLdz400fz5R8kl; Thu, 25 Jul 2024 19:33: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVLdz3GgKz40p5; Thu, 25 Jul 2024 19:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721936007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Y0qPJrCCI34PIN/NdrOahtGUwmCoCng2RFxgZ5dj+k=; b=uFNKVILbDftN/uUglyhJE9/9KMkvSzKpq9LFjlAoR6m1lvHmYR4tUlVHBcSeO1FOBu0rca WLs24G4c+ecWw7A+6Nf3xlSOe6qTcgHJEaPmEPTRZ/TNphvSi9pgoGiwaduK0NKZ90Sumo 5yNlJolOhUfoAKxIMAeMGwuC8W2KguvyyR/SDGU1NqBKV2jW3T4cGpPfb3E3d1HS76Fg+y EynV+WTsGixBPKyWoAkJyjGKnUhEiH/HEHlmrqIQh/RtDzmgNNXoP1p9fgJPfe2X7g1CBn cMclUq9kCfVs/7TfRIPqAPpM2ajSSfo05nU8OaH+wNDV8d1VhCbi2KsgmA73BQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721936007; a=rsa-sha256; cv=none; b=G0NQqxN+oF2+aewebDNDRMmJs4fjftohKpIdUAUBQ7zY2ilGzzUH0ruivv12cI9iJe0jEC zoDryLcqvIJgjxUOfc4sCMEkAkjsGC/5R197p10qOrJHjmQkXih6SWBeUzcczydrOw4Ffd GCRi2qHqcbHaP6w24U1yPbzPwYXbz21hsG/zBYeuhCaZ3KNlkaz/DOfh8LPQq0mZSfmCKb F5voAcUnacgu89+hoCZwDAqprTVQNtUBkEIRUW9uQ1jFzeQMzH0XMdvRdZ8pHD296q7avB irJZTXD5RM2wRtY7EgZY0PrYgkfUYnm648E0svxF6ZO9vJ1kOmavduV9g3rPnA== 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=1721936007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6Y0qPJrCCI34PIN/NdrOahtGUwmCoCng2RFxgZ5dj+k=; b=YXKP3mXVTtoJRSmJ0Q91ge9dhyBSfsNZv0ZowgiOYEqViGMBBy05CSAITrzcViqJbdesGI Pb4zQjZbDCir1A3gDGFwH2UPXBqaR1mHe1WaZQoS0tFOKjGbLPBp3pxYOY18PnY52Su8l/ 0xFFEX/rk3oFdoQuZ1cLf9bMHdFvFmg/d6/f1qLf40kQxuKfJ1oaw/SlAhHeZdJVLk4tjG upVnhzNRhToVG6U1lNXfoD/xJdCN8I567tHlN/D4kCfwUUqElRHm/CtAGFaPEI4Fp6KOpc OiRGIol9NdUi6JPEVvhOgKP9sxjbPsgH4cS8fV3k+hNLmiE5BdTZ7EfpUJDtFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVLdz2m8Pz17Xs; Thu, 25 Jul 2024 19:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PJXRw4042594; Thu, 25 Jul 2024 19:33:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PJXRs3042591; Thu, 25 Jul 2024 19:33:27 GMT (envelope-from git) Date: Thu, 25 Jul 2024 19:33:27 GMT Message-Id: <202407251933.46PJXRs3042591@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 5d0498db4782 - main - nvmf_tcp: Rename max_c2hdata sysctl to max_transmit_data List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d0498db478253c42b5e4140b9aff8596a797464 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5d0498db478253c42b5e4140b9aff8596a797464 commit 5d0498db478253c42b5e4140b9aff8596a797464 Author: John Baldwin AuthorDate: 2024-07-25 19:29:43 +0000 Commit: John Baldwin CommitDate: 2024-07-25 19:29:43 +0000 nvmf_tcp: Rename max_c2hdata sysctl to max_transmit_data This sysctl sets a cap on the maximum payload of transmitted data PDUs including both C2H_DATA and H2C_DATA PDUs, not just C2H_DATA PDUs. Sponsored by: Chelsio Communications --- share/man/man4/nvmf_tcp.4 | 15 +++++++++++---- sys/dev/nvmf/nvmf_tcp.c | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/share/man/man4/nvmf_tcp.4 b/share/man/man4/nvmf_tcp.4 index 4d77997c19a2..0a650e342f0e 100644 --- a/share/man/man4/nvmf_tcp.4 +++ b/share/man/man4/nvmf_tcp.4 @@ -3,7 +3,7 @@ .\" .\" Copyright (c) 2024 Chelsio Communications, Inc. .\" -.Dd May 2, 2024 +.Dd July 25, 2024 .Dt NVMF_TCP 4 .Os .Sh NAME @@ -35,10 +35,17 @@ variables and .Xr loader 8 tunables: .Bl -tag -width indent -.It Va kern.nvmf.tcp.max_c2hdata -The maximum data payload size of a +.It Va kern.nvmf.tcp.max_transmit_data +The maximum data payload size of .Va C2H_DATA -PDU sent by the controller to a remote host. +and +.Va H2C_DATA +PDUs. +A remote controller may enforce a lower limit on the size of +.Va H2C_DATA +PDUs via the +.Va MAXH2CDATA +parameter. The default size is 256 kilobytes. .El .Sh SEE ALSO diff --git a/sys/dev/nvmf/nvmf_tcp.c b/sys/dev/nvmf/nvmf_tcp.c index 57c81eceee02..8f1b3bf01e39 100644 --- a/sys/dev/nvmf/nvmf_tcp.c +++ b/sys/dev/nvmf/nvmf_tcp.c @@ -138,7 +138,7 @@ static void tcp_free_qpair(struct nvmf_qpair *nq); SYSCTL_NODE(_kern_nvmf, OID_AUTO, tcp, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "TCP transport"); static u_int tcp_max_transmit_data = 256 * 1024; -SYSCTL_UINT(_kern_nvmf_tcp, OID_AUTO, max_c2hdata, CTLFLAG_RWTUN, +SYSCTL_UINT(_kern_nvmf_tcp, OID_AUTO, max_transmit_data, CTLFLAG_RWTUN, &tcp_max_transmit_data, 0, "Maximum size of data payload in a transmitted PDU"); From nobody Thu Jul 25 19:33:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVLf04TDCz5R8kn; Thu, 25 Jul 2024 19:33: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVLf03xwcz40p6; Thu, 25 Jul 2024 19:33:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721936008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1kQqtfax+VH/p6GPQeFuMsd+PC43oTfW3YLTCnqYEKY=; b=lVybGL0/u61YUgP02JGD5q1PmY1d6+S2Xp4L2WsR7YtBF2Rp/55nK/Ln+oavxajvAW93Gi A/tpHUlG574zR+DabreQsy9blLN1GHa9fmCZu9SzddbJmFUF3en4A42WhimPeAO6A3pUhJ 9fTRQcwjR3SLFcyBOO/kO8qZ3vPOiLVXtxb6bMP5BrekbHhZUcJatRBCceRyME4shutaRU OzvY5aKILlnZuEpT07aODy5/7fmv1IhT/RUoBTIUSJddZcuh5uFpDn7IaG9hf3rbSr/p/p tQTty/YYe0tL7MJaEps2JlktvX3+8DQGCa9fm5eBcZXb9k0Hpdiudxih5VkTbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721936008; a=rsa-sha256; cv=none; b=oO9KUFr9Vt1LynBa3K2MNrb1Qtis5IJaVnz1e9/g2CtNEalcygbGJm1GZQ/oeg/TCE0bL+ jiKoV66EXbCnUfl9dVbXuy9ryLqAw9KcEkozhyqB8wJa5DG91VxGQ5l5NpjkP5ZV0y0kUS rxNIr5qP4w9gv67Uz9cYWli53RBe5/6DRbPvbDyi0/87edVMqLn93sEvGalSir+866NwbH 4klX28LeTbDKsgOMw6+OgGBl6k0KwR2MBME88NZKFTPyu+5hYKqCeDi1tuRXCj1bopqyVt 9duY9XfVMqnO+v1Ykbbe7/8uo4IbPHvebbZiHH8LQ3BVlauM29UO8dwB2AOOgA== 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=1721936008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1kQqtfax+VH/p6GPQeFuMsd+PC43oTfW3YLTCnqYEKY=; b=NOCgeQDaGCyVdB9wdqQZ7DT5x4Hhp0eF2I03WFBBj54HNt7uDUTHZ7dZVpkrYblPKcDLBs RMvMTiTAkNYgIONi7kvpi7iaNcoA6eP6StFgJu0xpVykoAVE1m5F9GMM/epSaGug6oLkj8 JN8rdkm0Ijj7On3znNip8q2AcqQwdPqWnhst5+lruG+KwHy32mG7VMZV3WlOeswFqvSbCl cmKdL5Vto+CBukXr50i9LUBfPIUe/tbRZNBFhQcll5KrtsGQuudx9H6lP6DE10uGulzB6D ++scKpHweagcxnTw3FLnLjcYkc1pms293CE4XwTvrHLNfgrCr7o6RvN+97mryw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVLf03Yfyz17bP; Thu, 25 Jul 2024 19:33:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PJXSN5042642; Thu, 25 Jul 2024 19:33:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PJXSLw042639; Thu, 25 Jul 2024 19:33:28 GMT (envelope-from git) Date: Thu, 25 Jul 2024 19:33:28 GMT Message-Id: <202407251933.46PJXSLw042639@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 6549718b70f0 - main - nvmfd: Stop setting MAXR2T in association parameters List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6549718b70f0e660a15685369afb4f9caf2215ce Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=6549718b70f0e660a15685369afb4f9caf2215ce commit 6549718b70f0e660a15685369afb4f9caf2215ce Author: John Baldwin AuthorDate: 2024-07-25 19:30:52 +0000 Commit: John Baldwin CommitDate: 2024-07-25 19:30:52 +0000 nvmfd: Stop setting MAXR2T in association parameters This is only used for the host side of an association. The controller obtains this value from the host during connection negotiation. Sponsored by: Chelsio Communications --- usr.sbin/nvmfd/discovery.c | 1 - usr.sbin/nvmfd/io.c | 1 - usr.sbin/nvmfd/nvmfd.8 | 7 +++---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/usr.sbin/nvmfd/discovery.c b/usr.sbin/nvmfd/discovery.c index 985c77620a62..1cee8755c65c 100644 --- a/usr.sbin/nvmfd/discovery.c +++ b/usr.sbin/nvmfd/discovery.c @@ -109,7 +109,6 @@ init_discovery(void) aparams.tcp.pda = 0; aparams.tcp.header_digests = header_digests; aparams.tcp.data_digests = data_digests; - aparams.tcp.maxr2t = 1; aparams.tcp.maxh2cdata = 256 * 1024; discovery_na = nvmf_allocate_association(NVMF_TRTYPE_TCP, true, &aparams); diff --git a/usr.sbin/nvmfd/io.c b/usr.sbin/nvmfd/io.c index be845a8ed784..3c25d1944eb8 100644 --- a/usr.sbin/nvmfd/io.c +++ b/usr.sbin/nvmfd/io.c @@ -57,7 +57,6 @@ init_io(const char *subnqn) aparams.tcp.pda = 0; aparams.tcp.header_digests = header_digests; aparams.tcp.data_digests = data_digests; - aparams.tcp.maxr2t = 1; aparams.tcp.maxh2cdata = 256 * 1024; io_na = nvmf_allocate_association(NVMF_TRTYPE_TCP, true, &aparams); diff --git a/usr.sbin/nvmfd/nvmfd.8 b/usr.sbin/nvmfd/nvmfd.8 index 689ac6d4dda1..40b1c0e2ebe0 100644 --- a/usr.sbin/nvmfd/nvmfd.8 +++ b/usr.sbin/nvmfd/nvmfd.8 @@ -3,7 +3,7 @@ .\" .\" Copyright (c) 2024 Chelsio Communications, Inc. .\" -.Dd May 2, 2024 +.Dd July 25, 2024 .Dt NVMFD 8 .Os .Sh NAME @@ -120,7 +120,6 @@ The discovery controller and kernel mode functionality of should be merged into .Xr ctld 8 . .Pp -Additional paramters such as -.Va MAXR2T , -.Va MAXH2CDATA , +Additional parameters such as +.Va MAXH2CDATA and queue sizes should be configurable. From nobody Thu Jul 25 19:33:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVLf16gCSz5R8Y3; Thu, 25 Jul 2024 19:33: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVLf14tvDz40h2; Thu, 25 Jul 2024 19:33:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721936009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SMvyKSbuxEPqFPXJQ3pLcXKc1ogxB8Zi1sHRG3h/fhQ=; b=Ts8KQ/0lpttVR99MBgTzALIwm0ESVOXEiO4zTFZiK0NUNcZqlF7Umhc0q/X50DsjYjPmC+ zz16mvg+dFK7qIzX4YCOS+ZOKr1gmcXUM9pQBNWyZ70+wt0IQMeq8Uil/SH4+XISeG69Lb PkKKp2YInvfZF2hMHziJQMcz51JIDho2/74b8FoxpYIAoxNDk4wyJphhXCdgL1y/zqcceg OjR7DnRaeBVE1zogvXFImfDhbIzeKGD2dhDcNIgXOu9Xn8gwDDn1T1kQq6CRwafYRGSgHh 1RvvzB8cfaHk813oCa9XgQAL7uoXekX1hwKszb1tDjvgVxVCKvTHE/0g/SYKjQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721936009; a=rsa-sha256; cv=none; b=LWnumIkO1tWf83PTAdnPOBiaSTmLmq3vBNtCBUrF9EMsLYZVFoyo68Q8jmKY8Ul8PyQUbN tgCLecF7XLrpHN5WhEyBPs0peV1d2g2rD9vUZmxOiiL/9PeXIkztF5EfTCL75cGV8i+zfV TDEMf7IX6WIPLT6djw5Y1yzV+bgcxLqqR4bUflycFUkHcgoJoImzxVlXhDsCnWWuCay0pE 4w+uF7Wl+2veiLDgZuwipG7REfS1049kVYOWww28onROLGK0ObxGpRWSBW8dm2WS4oQccS mKlQrdECLtrD+5KCFNQVj2yzHPQe9XqEm1HuWqKBd1/Q0kmnQ8wlLMUhV31/iw== 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=1721936009; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SMvyKSbuxEPqFPXJQ3pLcXKc1ogxB8Zi1sHRG3h/fhQ=; b=SQlu4LX0F5pQia3aKnlrDn4prQuTe8S3m+v2b+FarYZ0S66IW/xs2GDYh/YI+yv9xsSiYp ThLWw7SS+yXrho7YEstxltEKL+pY3PLjmD5IqZLqe/xpB805RsyxRpsMK6KKL8a4mHp14p il3N0su1FPUpfEn/mZ0OLLqKuFZN6dPkl/Q26kjne0lziz1gldvuUrwJ6xgr8GNEl9Kp2A B+ywI4NC9lJcjD/GDH7MjGxLkkg9LRMTwQ+YBCdcsQy/7gNRnRW8lnSs3wl52FyJGpgejb Bjyp4faX7bN2ht6/SVnnCoiYKAgWxAqA/73d7oe41/QLUm2gqoij5Js4vgxkEA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVLf14Sczz16rV; Thu, 25 Jul 2024 19:33:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PJXT5W042696; Thu, 25 Jul 2024 19:33:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PJXT8u042693; Thu, 25 Jul 2024 19:33:29 GMT (envelope-from git) Date: Thu, 25 Jul 2024 19:33:29 GMT Message-Id: <202407251933.46PJXT8u042693@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: fd0e6af5e49c - main - libnvmf: Require MAXH2CDATA to be a multiple of 4 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd0e6af5e49c3db034f1c45ff3f053f282e758c3 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=fd0e6af5e49c3db034f1c45ff3f053f282e758c3 commit fd0e6af5e49c3db034f1c45ff3f053f282e758c3 Author: John Baldwin AuthorDate: 2024-07-25 19:32:38 +0000 Commit: John Baldwin CommitDate: 2024-07-25 19:32:38 +0000 libnvmf: Require MAXH2CDATA to be a multiple of 4 The spec says MAXH2CDATA to is "a multiple of dwords and should be no less than 4,096". Sponsored by: Chelsio Communications --- lib/libnvmf/nvmf_tcp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/libnvmf/nvmf_tcp.c b/lib/libnvmf/nvmf_tcp.c index b9bf8153ab1b..89fc65bf6c43 100644 --- a/lib/libnvmf/nvmf_tcp.c +++ b/lib/libnvmf/nvmf_tcp.c @@ -956,6 +956,7 @@ tcp_connect(struct nvmf_tcp_qpair *qp, struct nvmf_association *na, bool admin) struct nvmf_tcp_association *ta = TASSOC(na); struct nvme_tcp_ic_req ic_req; struct nvme_tcp_ic_resp ic_resp; + uint32_t maxh2cdata; int error; if (!admin) { @@ -1007,9 +1008,9 @@ tcp_connect(struct nvmf_tcp_qpair *qp, struct nvmf_association *na, bool admin) * some large value and report larger values as an unsupported * parameter? */ - if (le32toh(ic_resp.maxh2cdata) < 4096) { - na_error(na, "Invalid MAXH2CDATA %u", - le32toh(ic_resp.maxh2cdata)); + maxh2cdata = le32toh(ic_resp.maxh2cdata); + if (maxh2cdata < 4096 || maxh2cdata % 4 != 0) { + na_error(na, "Invalid MAXH2CDATA %u", maxh2cdata); nvmf_tcp_report_error(na, qp, NVME_TCP_TERM_REQ_FES_INVALID_HEADER_FIELD, 12, &ic_resp, sizeof(ic_resp), sizeof(ic_resp)); @@ -1021,7 +1022,7 @@ tcp_connect(struct nvmf_tcp_qpair *qp, struct nvmf_association *na, bool admin) qp->header_digests = ic_resp.dgst.bits.hdgst_enable != 0; qp->data_digests = ic_resp.dgst.bits.ddgst_enable != 0; qp->maxr2t = params->tcp.maxr2t; - qp->maxh2cdata = le32toh(ic_resp.maxh2cdata); + qp->maxh2cdata = maxh2cdata; if (admin) /* 7.4.3 */ qp->max_icd = 8192; From nobody Thu Jul 25 19:33:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVLf31ZR1z5R8Vs; Thu, 25 Jul 2024 19:33: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVLf25mDgz40ry; Thu, 25 Jul 2024 19:33:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721936010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MmIf+D3FnWY347sjYgynq441Mly6pq7jNNerdUazQYk=; b=XG5uyGWpKzQgBihUOeAXUkNx8htHBnP1eWhDsIHxZHAVjPfdvKjcZyyKQVvJIa6VsPChHa SPbZHOq3RBcJ9iolC2sKcROhdaH0vZVyzg6oQkCWRE8bAb8dTb1crJ4oddfc6iUmhbC+fm tww56Md0xfJDoZueq8r3dU17P9bH77VEqkBpJhBBdoxFsvH3HXwvVQzuExaT0n0Ta5EMKg HZQ8NxdwYw6h98jPuac44dTPNBSkDDXk+Lxo67dmzEtEWESlbFVnLpWmdN6jsD2cPrNBUC Xuixw1sEiPf1R422MsPTmsn+5UU1Kw/SH/xcl8KxUJvIiXrPK4BGPKM1jsppDA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721936010; a=rsa-sha256; cv=none; b=m/pflAxbJE1p2o8kIJhAdoXmAH6xTQ3tCtb63JorUBSzlZ0mHraeUpdr77AanUDDx54gak MveZPkSPQSDXD448820ioVvZLTl1CWPTrPeTAZA1BiqnhvJGIHNMAVRsg3PdnyoqontHsV J7I1gxf4/XQEXlqPT2GcETOJACd2e+/cpt+UVWXMIz0abXk8y1tiGxK4d7UUHOQboK7LyU aQg+8xKfJrTvoSGJ03tn3GcFBqDR24szURZ1llGWOCQ5pEx2KLo4JNpDaxyx2GiN+2UxPM 1yyDs1kG1zrkTok+F5I0HOZcKDn3pxr0nlsHwWpz2a/cUU8SIWBksspmvcOMFg== 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=1721936010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MmIf+D3FnWY347sjYgynq441Mly6pq7jNNerdUazQYk=; b=AGpDeuGFoUHWNl/AvSlyPpTTcuRy9vcBDp87QsoEmnsXai7AJOBEnyyHSntpb/KcKCzFUV u70ZE/d7p+hcSW1oWEcFZ96m7zB20przWReFpYNgik5+u7KLci8HyX9MeLUaDmwNnIs/7A dgB8sz3bkskhl1U+IuBEVNojwLNGaGBS9L3BvyE9TnihilHcYfsjMt9NBTV5yWgsqR1lNm LDSzEG67OYiIl1LjHci4kug7VXZpNUZF+9V64GBBXJtHcWSErbcqYak49S3TPF0x52nx9N XiuN3AXKRPUFNz5wkisTp9TL9BmrsHprNGgX1L5/JG2SrERoMYRx0XQQuUM9mw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVLf25Dl1z17Vq; Thu, 25 Jul 2024 19:33:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PJXUeZ042750; Thu, 25 Jul 2024 19:33:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PJXU2u042747; Thu, 25 Jul 2024 19:33:30 GMT (envelope-from git) Date: Thu, 25 Jul 2024 19:33:30 GMT Message-Id: <202407251933.46PJXU2u042747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 846d702f234b - main - libnvmf: Reject invalid values of MAXH2CDATA for new associations List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 846d702f234b80881dc6641057b623308917b66a Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=846d702f234b80881dc6641057b623308917b66a commit 846d702f234b80881dc6641057b623308917b66a Author: John Baldwin AuthorDate: 2024-07-25 19:32:42 +0000 Commit: John Baldwin CommitDate: 2024-07-25 19:32:42 +0000 libnvmf: Reject invalid values of MAXH2CDATA for new associations Sponsored by: Chelsio Communications --- lib/libnvmf/nvmf_tcp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/libnvmf/nvmf_tcp.c b/lib/libnvmf/nvmf_tcp.c index 89fc65bf6c43..93948b9b5fd0 100644 --- a/lib/libnvmf/nvmf_tcp.c +++ b/lib/libnvmf/nvmf_tcp.c @@ -924,11 +924,18 @@ nvmf_tcp_read_ic_resp(struct nvmf_association *na, struct nvmf_tcp_qpair *qp, } static struct nvmf_association * -tcp_allocate_association(bool controller __unused, - const struct nvmf_association_params *params __unused) +tcp_allocate_association(bool controller, + const struct nvmf_association_params *params) { struct nvmf_tcp_association *ta; + if (controller) { + /* 7.4.10.3 */ + if (params->tcp.maxh2cdata < 4096 || + params->tcp.maxh2cdata % 4 != 0) + return (NULL); + } + ta = calloc(1, sizeof(*ta)); return (&ta->na); From nobody Thu Jul 25 19:33:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVLf429Cvz5R8Y4; Thu, 25 Jul 2024 19:33: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVLf3759Pz40vq; Thu, 25 Jul 2024 19:33:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721936012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2qi9OJQkrR7e2kOPvsVLOedxBjBsMZiTIFp9QCtdn6U=; b=qQ1iQsrBb0tj9k70ildQqvHfTq5JIQWFq/RluOm0KpqlQx+dhy/9RawKEmrJUcUEBWyJi8 FtpBSd5LWWkYphKHKg/+gym0OHJeWcZ3ynlNY0/hbQCn2HxQeNoxKF2Ur7X1Tff4QyzaQH BFbrcuvQdEWshWqVxIXq+YWdfyM6NnyMF+20czeay1VfLF7+TZI8jI/EZE7oTyrq5eqT5i luv023olNJHdEFl6GpLvCTp8aSWzpupO3aKt32SWh3RIl+cxsitV1GOIiCcXsgj8Yny/xJ IX/nEtVtd5VEjfc6FKJKKdSaBCpIxO2XohCL0EO5qNDdPk+z+rmXYwek7IJTPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721936012; a=rsa-sha256; cv=none; b=uFxv5kGihS9i2t1Oem4SiL5KLaQEZRSM6/TglXIz3QCNj+4jblIcKAEBntAb020woq3ZaB SKH+Z8qOGtzvHnwsDZRQjdMQ6PRTL7MfdXXhhwPeKkJ9P4IrcFGWdtU7ZvnpERkaP0PW5G WyN4AaPgxuzDTh0tq5BwaRvFuJXbnmChR14nqgj6q2CgST8kY1VYVU3XG2LvDrUoCPlia3 JKLvSD3WJS5c7EGeDFyer1XDerPD4HNJgcAWWD/k8Hk1Hpvd2UIw+SiGCSUouJNYHBGIM0 wdyg1jAl7UOxr82CYsOnoWgbx9J8+ed4vkX82bMfIG/k8gbYUdAhlPvYnfG/ng== 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=1721936012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2qi9OJQkrR7e2kOPvsVLOedxBjBsMZiTIFp9QCtdn6U=; b=MlOlKu9wQHVD/M4NAS79BF+QgViK5ZY13wjjQN+BYULTRj9fh377VUdHMZJ/wCK4HeYdzP gmTJfjDWFz4Ynu2xBHV0Z0PrG1D8JEfNmv6ixPRTKVdXDEnlIeiRSHlb5HVE190RWr0e4r 2fBA6oP0PMqh08kPdHLWv5ilWj8QbDT8w6ckd3PpajwPsn7oUbaN+MHVjrdFxsmukyX9p/ IjIUVw/FiQhaW8gTdHoag7idko611GY8LszM4GOzjVear3XM7YZm3RtAWv6Q7WjVrj/73q SuneEAUm+sgldYS+bfPvQG96x8izGxX0wNMhegM+khRZvwbQiIZRlu5pcGNd8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVLf36Zqvz17KJ; Thu, 25 Jul 2024 19:33:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PJXVX5042789; Thu, 25 Jul 2024 19:33:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PJXVYs042786; Thu, 25 Jul 2024 19:33:31 GMT (envelope-from git) Date: Thu, 25 Jul 2024 19:33:31 GMT Message-Id: <202407251933.46PJXVYs042786@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 7f73c0489508 - main - nvmfd: Correct usage description List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7f73c048950852e6088fa1aaa0a91c41ddcef3a1 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=7f73c048950852e6088fa1aaa0a91c41ddcef3a1 commit 7f73c048950852e6088fa1aaa0a91c41ddcef3a1 Author: John Baldwin AuthorDate: 2024-07-25 19:32:44 +0000 Commit: John Baldwin CommitDate: 2024-07-25 19:32:44 +0000 nvmfd: Correct usage description During development the command line options for PDU digests for nvmecontrol(8) and nvmfd(8) were renamed to align with Linux's nvme(1) command, but the usage description in nvmfd(8) had a mix of the old and new options. Sponsored by: Chelsio Communications --- usr.sbin/nvmfd/nvmfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/nvmfd/nvmfd.c b/usr.sbin/nvmfd/nvmfd.c index 6fce21b07b74..cce7a88706d2 100644 --- a/usr.sbin/nvmfd/nvmfd.c +++ b/usr.sbin/nvmfd/nvmfd.c @@ -36,8 +36,8 @@ static volatile bool quit = false; static void usage(void) { - fprintf(stderr, "nvmfd -K [-FGg] [-P port] [-p port] [-t transport] [-n subnqn]\n" - "nvmfd [-dDFH] [-P port] [-p port] [-t transport] [-n subnqn]\n" + fprintf(stderr, "nvmfd -K [-dFGg] [-P port] [-p port] [-t transport] [-n subnqn]\n" + "nvmfd [-dFGg] [-P port] [-p port] [-t transport] [-n subnqn]\n" "\tdevice [device [...]]\n" "\n" "Devices use one of the following syntaxes:\n" From nobody Thu Jul 25 19:33:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVLf51VMDz5R8kt; Thu, 25 Jul 2024 19:33: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVLf50WqXz40nM; Thu, 25 Jul 2024 19:33:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721936013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N/4Vh0NkLdRnEiRoW2zBu+IrLdKRiW8R/CJcp4JxuPc=; b=eGeOtCjnZr+M9Fa1xEwyMqVw/9gpo3FOU5M6+aiqHWX3koY3VUS8cAfR0WIDGR2m/dtFeJ 8s7nOxNb8oIlZfWxkCvXIg7DGEUB36K7oYU44ozwM3GA0aOa9F/UcyCzvi1ZienUJcE0Dc tVxgSHr9vdMAexpMSKfkqlapfo5Mo8h24vdSCZ5oZp/Jd7z99hl6khw8iCw5kPhr2j4oWH KiMB5hf6lP6Jon6xLRYkeoedeefYPSPO11b4uJNqPs71VYntXlKWSL4S2qIUuf1he9cWfl h0PCpeoWxnAmIVpZspF+LsX4zvxlN0mKDHaGgT/NbhM/jX4Le6wUDbbtHG48XA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721936013; a=rsa-sha256; cv=none; b=vr0qSZ/pMTKBRTOd8CVaRhkVCR2CAZNeg13VCkhulTIB+2ONdSQzmN7AAdaa85+0ZMuev/ ozNiKvzsYy2od9rKsQ7gWaeutdOOW4u7HdrMQ7JlC9zgbTLpLhV2X0V2INO/IJi3wWy1lQ n/Bu+/aqAeazabDQxIMA+7XHxy0LTmUN6te1pmenakTSuKN6y/LzKA5IjyYdbzAOj8siyv nYyi5kzR92entZ5A2gJh1pTeXuDeSxMpZrhbPadURc7oG7ejve4I5ER/4sUgp2NO/EI2YF mgJF7Igaop5U5v3mDlzV5wwi2IuZiJX8lys/1H4KRgtaNLCYku4pd2DvH0UF6Q== 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=1721936013; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=N/4Vh0NkLdRnEiRoW2zBu+IrLdKRiW8R/CJcp4JxuPc=; b=SL6+cdB8M4mCen/sIqRBzFcccjtzgj/iF+icxw3AZKbw9qiB1BTLodF8pejqmxIiN+S3AR R9TDzbbrQIIhFy+P/lo/XYyVu06RzEjsErBSA1w4+3sNSSJV/TVo8GzrjWeUHeekgal9dS 36DNBq2CeWlT73AxQKv64O4LPk92FKk/3QqX641x6WjT02xS29Gn2hYSD8JkX2o9zQmdyr lKKt10CPfk++bDQF2aijsX4WIsbRyY+6OLB6haIhqghX43OiKqTT1ybUPiAYdKNQm9vq4B VEKp0LowJlALw2iw7aciVxS2OqDpXjH3bpbbPxMv9IX5U/jDA8kXUJxzwTx7tw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVLf506NFz17dg; Thu, 25 Jul 2024 19:33:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PJXWCs042847; Thu, 25 Jul 2024 19:33:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PJXWWi042844; Thu, 25 Jul 2024 19:33:32 GMT (envelope-from git) Date: Thu, 25 Jul 2024 19:33:32 GMT Message-Id: <202407251933.46PJXWWi042844@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 399362bac312 - main - nvmfd: Permit setting the MAXH2CDATA value via -H List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 399362bac312d4fa77a3fd918ea002c0782bc315 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=399362bac312d4fa77a3fd918ea002c0782bc315 commit 399362bac312d4fa77a3fd918ea002c0782bc315 Author: John Baldwin AuthorDate: 2024-07-25 19:33:15 +0000 Commit: John Baldwin CommitDate: 2024-07-25 19:33:15 +0000 nvmfd: Permit setting the MAXH2CDATA value via -H This value is advertised to the remote host for TCP associations and determines the maximum data payload size the remote host is permitted to transmit in a single PDU. Sponsored by: Chelsio Communications --- usr.sbin/nvmfd/discovery.c | 2 +- usr.sbin/nvmfd/internal.h | 1 + usr.sbin/nvmfd/io.c | 2 +- usr.sbin/nvmfd/nvmfd.8 | 10 ++++++++-- usr.sbin/nvmfd/nvmfd.c | 17 ++++++++++++++--- 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/usr.sbin/nvmfd/discovery.c b/usr.sbin/nvmfd/discovery.c index 1cee8755c65c..2cfe56731d7c 100644 --- a/usr.sbin/nvmfd/discovery.c +++ b/usr.sbin/nvmfd/discovery.c @@ -109,7 +109,7 @@ init_discovery(void) aparams.tcp.pda = 0; aparams.tcp.header_digests = header_digests; aparams.tcp.data_digests = data_digests; - aparams.tcp.maxh2cdata = 256 * 1024; + aparams.tcp.maxh2cdata = maxh2cdata; discovery_na = nvmf_allocate_association(NVMF_TRTYPE_TCP, true, &aparams); if (discovery_na == NULL) diff --git a/usr.sbin/nvmfd/internal.h b/usr.sbin/nvmfd/internal.h index 5ddbc1cf89f0..f70dc78881c6 100644 --- a/usr.sbin/nvmfd/internal.h +++ b/usr.sbin/nvmfd/internal.h @@ -24,6 +24,7 @@ extern bool data_digests; extern bool header_digests; extern bool flow_control_disable; extern bool kernel_io; +extern uint32_t maxh2cdata; /* controller.c */ void controller_handle_admin_commands(struct controller *c, diff --git a/usr.sbin/nvmfd/io.c b/usr.sbin/nvmfd/io.c index 3c25d1944eb8..4407360257a2 100644 --- a/usr.sbin/nvmfd/io.c +++ b/usr.sbin/nvmfd/io.c @@ -57,7 +57,7 @@ init_io(const char *subnqn) aparams.tcp.pda = 0; aparams.tcp.header_digests = header_digests; aparams.tcp.data_digests = data_digests; - aparams.tcp.maxh2cdata = 256 * 1024; + aparams.tcp.maxh2cdata = maxh2cdata; io_na = nvmf_allocate_association(NVMF_TRTYPE_TCP, true, &aparams); if (io_na == NULL) diff --git a/usr.sbin/nvmfd/nvmfd.8 b/usr.sbin/nvmfd/nvmfd.8 index 40b1c0e2ebe0..1076583c417c 100644 --- a/usr.sbin/nvmfd/nvmfd.8 +++ b/usr.sbin/nvmfd/nvmfd.8 @@ -13,12 +13,14 @@ .Nm .Fl K .Op Fl dFGg +.Op Fl H Ar MAXH2CDATA .Op Fl P Ar port .Op Fl p Ar port .Op Fl t Ar transport .Op Fl n Ar subnqn .Nm .Op Fl dFGg +.Op Fl H Ar MAXH2CDATA .Op Fl P Ar port .Op Fl p Ar port .Op Fl t Ar transport @@ -42,6 +44,11 @@ Permit remote hosts to disable SQ flow control. Permit remote hosts to enable PDU data digests for the TCP transport. .It Fl g Permit remote hosts to enable PDU header digests for the TCP transport. +.It Fl H +Set the MAXH2CDATA value advertised to the remote host for the TCP transport. +This value is in bytes and determines the maximum data payload size for +data PDUs sent by the remote host. +The value must be at least 4096 and defaults to 256KiB. .It Fl K Enable kernel mode which hands off incoming I/O controller connections to .Xr nvmft 4 . @@ -121,5 +128,4 @@ should be merged into .Xr ctld 8 . .Pp Additional parameters such as -.Va MAXH2CDATA -and queue sizes should be configurable. +queue sizes should be configurable. diff --git a/usr.sbin/nvmfd/nvmfd.c b/usr.sbin/nvmfd/nvmfd.c index cce7a88706d2..df6f400b40e5 100644 --- a/usr.sbin/nvmfd/nvmfd.c +++ b/usr.sbin/nvmfd/nvmfd.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -29,6 +30,7 @@ bool data_digests = false; bool header_digests = false; bool flow_control_disable = false; bool kernel_io = false; +uint32_t maxh2cdata = 256 * 1024; static const char *subnqn; static volatile bool quit = false; @@ -36,8 +38,8 @@ static volatile bool quit = false; static void usage(void) { - fprintf(stderr, "nvmfd -K [-dFGg] [-P port] [-p port] [-t transport] [-n subnqn]\n" - "nvmfd [-dFGg] [-P port] [-p port] [-t transport] [-n subnqn]\n" + fprintf(stderr, "nvmfd -K [-dFGg] [-H MAXH2CDATA] [-P port] [-p port] [-t transport] [-n subnqn]\n" + "nvmfd [-dFGg] [-H MAXH2CDATA] [-P port] [-p port] [-t transport] [-n subnqn]\n" "\tdevice [device [...]]\n" "\n" "Devices use one of the following syntaxes:\n" @@ -150,6 +152,7 @@ main(int ac, char **av) struct pidfh *pfh; const char *dport, *ioport, *transport; pid_t pid; + uint64_t value; int ch, error, kqfd; bool daemonize; static char nqn[NVMF_NQN_MAX_LEN]; @@ -162,7 +165,7 @@ main(int ac, char **av) ioport = "0"; subnqn = NULL; transport = "tcp"; - while ((ch = getopt(ac, av, "dFgGKn:P:p:t:")) != -1) { + while ((ch = getopt(ac, av, "dFgGH:Kn:P:p:t:")) != -1) { switch (ch) { case 'd': daemonize = false; @@ -176,6 +179,14 @@ main(int ac, char **av) case 'g': header_digests = true; break; + case 'H': + if (expand_number(optarg, &value) != 0) + errx(1, "Invalid MAXH2CDATA value %s", optarg); + if (value < 4096 || value > UINT32_MAX || + value % 4 != 0) + errx(1, "Invalid MAXH2CDATA value %s", optarg); + maxh2cdata = value; + break; case 'K': kernel_io = true; break; From nobody Thu Jul 25 20:57:13 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVNVd1qJZz5RHfC; Thu, 25 Jul 2024 20:57: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVNVd15frz4D1f; Thu, 25 Jul 2024 20:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721941033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nWzH+YXw3SD9IGOx38HpTxO7WJ1ebBgos3Wt/C1sl1c=; b=c0I/T+lQzmbu7hs7JrbcqUKHfNKUh/i07kmJNSW/wtgxavPoHen7qADva5ktSx1aVtneMK YB3fmoPpVkCZ0hrR8lgV2dkqoRDdemWnFF6Q0/Auz5J4Z0vX0gaJjXZlQQyEBO7YW8/LZ9 VTCLGJYcUrIVoH2E4p9l55w6HBlrBaEei8fcgPBm4inibyVMmjMT057K1x8cwkSUzC8G7Q NacJR9S9KAeUpzkblyBW0PQARqIuys2HpcA5K1X5tZpl1N5nVu/qmUWwRDRmup7Mqe1PuY /fAYcDKWj38/Jh1cMusSMh3SHYISuvfNZk4VoT/hbBTf3sZ4RdJURN/Qeu2Obw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721941033; a=rsa-sha256; cv=none; b=bYKB9sh/yJ4ygD0swwXQFpAvXgOlCKg6uga7gtzyj1jLzgz6VOtUuwFo3eV76G1EPNEU/M SEQgQYces5GkbJABdpXC5JY/nJFyK4qZMm9Y9JB1G9OXy9GbaDjnvoyrQAuIOgG2tKJurw 9kYkqRNyccjn/mQc8k8AYYQQ3I8k0M6pPOXwyvtannHwhOLsy45jbPnmizCPEmDvwirBQS 3mnxEzDLfunYudZ2wj77UlEpiBrb1Tl0qUYTQlgCiBVZyRdBmAreDb8wIk0JCXticjzVM3 tyNO96d0iFJFKd68HBxJisb/6a1wDRGStrsyxhwgCNOvyvWRmvMj0jVYkGQJMg== 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=1721941033; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nWzH+YXw3SD9IGOx38HpTxO7WJ1ebBgos3Wt/C1sl1c=; b=ENVXgx+U1NWktZbibEmgx9sRFkM2hoj9qgXZngFZVE0kc8sbZpBsJcIe4FpCmqvrQyr1YK 36T73YENNQuShL9qDeageNUDtzsoc0LjtImv8GHErToIOPn1aDtS2R3b/2VSKX/+vcyBPS O0u9xUIa+PbUqSl0WxCrwNXzgLwQL5iSpCn2+vOZBNvOmitz1ol3FEj7EI7R0IWl4lqYOW gRG42Nh2C8D7UbDLZONbW8K/rQu5j2fetsqY/dSVVkAhfeYIRAGbr1UHnpj4zH5fRoJVxH ym3yF+CJTTKqPsrCCrExAWDCk2XJMB0mrhBwoAzcwmyB45hfm+GyyIA2YoI+2g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVNVd0j0cz19L0; Thu, 25 Jul 2024 20:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PKvDxl077771; Thu, 25 Jul 2024 20:57:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PKvD5J077768; Thu, 25 Jul 2024 20:57:13 GMT (envelope-from git) Date: Thu, 25 Jul 2024 20:57:13 GMT Message-Id: <202407252057.46PKvD5J077768@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 40299c55a05f - main - tcp: implement challenge ACK throttling for the base stack List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40299c55a05ff008102e24269d5f2d7fa7b6842d Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=40299c55a05ff008102e24269d5f2d7fa7b6842d commit 40299c55a05ff008102e24269d5f2d7fa7b6842d Author: Michael Tuexen AuthorDate: 2024-07-25 11:54:52 +0000 Commit: Michael Tuexen CommitDate: 2024-07-25 11:54:52 +0000 tcp: implement challenge ACK throttling for the base stack Implement ACK throttling of challenge ACKs as described in RFC 5961. Reviewed by: Peter Lei, rscheff, cc MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46066 --- sys/netinet/tcp_input.c | 15 +++------------ sys/netinet/tcp_subr.c | 39 +++++++++++++++++++++++++++++++++++++++ sys/netinet/tcp_var.h | 6 ++++++ 3 files changed, 48 insertions(+), 12 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index ad17a9fdfb93..b64a71837ab4 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -2208,10 +2208,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, } } else { TCPSTAT_INC(tcps_badrst); - /* Send challenge ACK. */ - tcp_respond(tp, mtod(m, void *), th, m, - tp->rcv_nxt, tp->snd_nxt, TH_ACK); - tp->last_ack_sent = tp->rcv_nxt; + tcp_send_challenge_ack(tp, th, m); m = NULL; } } @@ -2233,10 +2230,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, rstreason = BANDLIM_UNLIMITED; } else { tcp_ecn_input_syn_sent(tp, thflags, iptos); - /* Send challenge ACK. */ - tcp_respond(tp, mtod(m, void *), th, m, tp->rcv_nxt, - tp->snd_nxt, TH_ACK); - tp->last_ack_sent = tp->rcv_nxt; + tcp_send_challenge_ack(tp, th, m); m = NULL; } goto drop; @@ -2474,10 +2468,7 @@ tcp_do_segment(struct tcpcb *tp, struct mbuf *m, struct tcphdr *th, TCPSTAT_INC(tcps_rcvghostack); else TCPSTAT_INC(tcps_rcvacktooold); - /* Send a challenge ACK. */ - tcp_respond(tp, mtod(m, void *), th, m, - tp->rcv_nxt, tp->snd_nxt, TH_ACK); - tp->last_ack_sent = tp->rcv_nxt; + tcp_send_challenge_ack(tp, th, m); m = NULL; goto drop; } diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 42d29d64e09f..0665564955d2 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2181,6 +2181,45 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, lgb->tlb_errno = output_ret; } +/* + * Send a challenge ack (no data, no SACK option), but not more than + * tcp_ack_war_cnt per tcp_ack_war_time_window (per TCP connection). + */ +void +tcp_send_challenge_ack(struct tcpcb *tp, struct tcphdr *th, struct mbuf *m) +{ + sbintime_t now; + bool send_challenge_ack; + + if (tcp_ack_war_time_window == 0 || tcp_ack_war_cnt == 0) { + /* ACK war protection is disabled. */ + send_challenge_ack = true; + } else { + /* Start new epoch, if the previous one is already over. */ + now = getsbinuptime(); + if (tp->t_challenge_ack_end < now) { + tp->t_challenge_ack_cnt = 0; + tp->t_challenge_ack_end = now + + tcp_ack_war_time_window * SBT_1MS; + } + /* + * Send a challenge ACK, if less than tcp_ack_war_cnt have been + * sent in the current epoch. + */ + if (tp->t_challenge_ack_cnt < tcp_ack_war_cnt) { + send_challenge_ack = true; + tp->t_challenge_ack_cnt++; + } else { + send_challenge_ack = false; + } + } + if (send_challenge_ack) { + tcp_respond(tp, mtod(m, void *), th, m, tp->rcv_nxt, + tp->snd_nxt, TH_ACK); + tp->last_ack_sent = tp->rcv_nxt; + } +} + /* * Create a new TCP control block, making an empty reassembly queue and hooking * it to the argument protocol control block. The `inp' parameter must have diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index c06efa601a81..af82d0bfeaaa 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -465,6 +465,11 @@ struct tcpcb { /* TCP Fast Open */ uint8_t t_tfo_client_cookie_len; /* TFO client cookie length */ uint32_t t_end_info_status; /* Status flag of end info */ + sbintime_t t_challenge_ack_end; /* End of the challenge ack epoch */ + uint32_t t_challenge_ack_cnt; /* Number of challenge ACKs sent in + * current epoch + */ + unsigned int *t_tfo_pending; /* TFO server pending counter */ union { uint8_t client[TCP_FASTOPEN_MAX_COOKIE_LEN]; @@ -1460,6 +1465,7 @@ int tcp_default_output(struct tcpcb *); void tcp_state_change(struct tcpcb *, int); void tcp_respond(struct tcpcb *, void *, struct tcphdr *, struct mbuf *, tcp_seq, tcp_seq, uint16_t); +void tcp_send_challenge_ack(struct tcpcb *, struct tcphdr *, struct mbuf *); bool tcp_twcheck(struct inpcb *, struct tcpopt *, struct tcphdr *, struct mbuf *, int); void tcp_setpersist(struct tcpcb *); From nobody Thu Jul 25 21:02:07 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVNcJ3K0Lz5RJSP; Thu, 25 Jul 2024 21:02: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVNcH5cS0z4FLS; Thu, 25 Jul 2024 21:02:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721941327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6kSzcgKWAPeimVnkmkf8OLlGsijFlXN9TKTsQ45Jc4o=; b=mPTrVjxv4g3KUxKvUuL+MREOvpcZjugPQO7OlEbDeKLaUxc/NpNKduTYvG/hy9XGBm6CIB xx90h1X/9/7xEX0Ls6utLHq1Xp/BhxZulyS4ubQN3gCWwJs3F3Jv/sUeS+DgR9Br8xMXmK zlIxul7X/vYpGjp/AqrD0drTWhCJe0iBwc25xS35BKlW1G0MCLDZncnlsw5DLwOYGyNfOb 05ipnMPNQP4a0d5EkRTH02sD1guWSxePCuKE9yxXP7zB0pSAKbqLNOiv7jZT1nAryvaIer cRfrR3m27Zfg+hv+WCaaIVRq8ui3CH1p/5HZNMwi4hY/8tZO/Mlkkp+dpQu7ZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721941327; a=rsa-sha256; cv=none; b=YbUxG2CfEDMEtPhPfbVngY9dG1wYqN+lzEL9qyaUkPA8PVP7KDg1vuIbYnnIt06tStZ15c YI6UHBL7YEU0fNV2TaZG5gz5Sr3sqdD2Xk0F7xR8hsR+5NJFOS36aEDqlzAYnPOyj4Y9yj H4e5DEXIs+C+0L6ZBsxVdCDZtO65st6lLwasJ4180bKA2mdHgcuzSOcgFpBUFbdghvgQT1 pCuMmubGxPTXDIHGBqz06oWZIwfK8OaabQRAIwLj65eeFdmRJKhrmLXTFmne04McUWAHg5 IjggwaAPnDSOMBtOFz08tl6jm3z0jIjj9uBaIg0pOIn6lFuDLqh3zZNCIcFXsg== 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=1721941327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6kSzcgKWAPeimVnkmkf8OLlGsijFlXN9TKTsQ45Jc4o=; b=vlE5Ir9fXJG/5OoB1ii0UddadhUhW9GIAKWdw8+y6zzGmwqy+vvTZl8CsRZ3QvRgQqRYu+ hPgc4swBrx8YvMRt7IXt7wK4G9n6tNgzbBr/0/z9rmlofoEIeG+5DN/zJ9GAGBdIfSmlSr stn4fly4xlk2UEQ0S63opKy1ErqNouvfndJXZKg/l6yZgiRR0EQnkbdzGGVu0988ei1jlH Zi/mRewAjm3I2XH4w7k96v1PqrflQQvwvSGrxHRWjPCGbovehRAnZJFpmemZ6MIUfiuztg CihIYWyvJ+tfdb2m3sQQvT5ONzTZ2f76kuLYiqM1jgDmAhQqhVSXGGscQod61A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVNcH56kwz19LF; Thu, 25 Jul 2024 21:02:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PL27cA095003; Thu, 25 Jul 2024 21:02:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PL27rq095000; Thu, 25 Jul 2024 21:02:07 GMT (envelope-from git) Date: Thu, 25 Jul 2024 21:02:07 GMT Message-Id: <202407252102.46PL27rq095000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: feda329622bc - main - netinet6 tests: Add a regression test for default router handling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: feda329622bc77ab64ae5f0bf852743f4a037616 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=feda329622bc77ab64ae5f0bf852743f4a037616 commit feda329622bc77ab64ae5f0bf852743f4a037616 Author: Mark Johnston AuthorDate: 2024-07-25 21:01:11 +0000 Commit: Mark Johnston CommitDate: 2024-07-25 21:01:11 +0000 netinet6 tests: Add a regression test for default router handling This serves as a regression test for commit a48df53e4249. Reviewed by: bz, allanjude MFC after: 2 weeks Sponsored by: Klara, Inc. Sponsored by: Bell Tower Integration Differential Revision: https://reviews.freebsd.org/D46136 --- tests/sys/netinet6/Makefile | 34 +++++++++-------- tests/sys/netinet6/ndp.sh | 92 ++++++++++++++++++++++++++++++++++++++++++--- tests/sys/netinet6/ra.py | 38 +++++++++++++++++++ 3 files changed, 143 insertions(+), 21 deletions(-) diff --git a/tests/sys/netinet6/Makefile b/tests/sys/netinet6/Makefile index 78df34af46dd..45e88b50164b 100644 --- a/tests/sys/netinet6/Makefile +++ b/tests/sys/netinet6/Makefile @@ -4,28 +4,30 @@ TESTSDIR= ${TESTSBASE}/sys/netinet6 FILESDIR= ${TESTSDIR} ATF_TESTS_PYTEST= test_ip6_output.py -ATF_TESTS_SH= \ - exthdr \ - mld \ - scapyi386 \ - redirect \ - divert \ - forward6 \ - output6 \ - lpm6 \ - fibs6 \ - ndp \ - proxy_ndp +ATF_TESTS_SH= exthdr \ + mld \ + scapyi386 \ + redirect \ + divert \ + forward6 \ + output6 \ + lpm6 \ + fibs6 \ + ndp \ + proxy_ndp + TEST_METADATA.output6+= required_programs="python" -${PACKAGE}FILES+= exthdr.py -${PACKAGE}FILES+= mld.py -${PACKAGE}FILES+= scapyi386.py -${PACKAGE}FILES+= redirect.py +${PACKAGE}FILES+= exthdr.py \ + mld.py \ + scapyi386.py \ + ra.py \ + redirect.py ${PACKAGE}FILESMODE_exthdr.py= 0555 ${PACKAGE}FILESMODE_mld.py= 0555 ${PACKAGE}FILESMODE_scapyi386.py=0555 +${PACKAGE}FILESMODE_ra.py=0555 ${PACKAGE}FILESMODE_redirect.py=0555 TESTS_SUBDIRS+= frag6 diff --git a/tests/sys/netinet6/ndp.sh b/tests/sys/netinet6/ndp.sh index eddd49112421..038a640f331e 100755 --- a/tests/sys/netinet6/ndp.sh +++ b/tests/sys/netinet6/ndp.sh @@ -25,7 +25,6 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# . $(atf_get_srcdir)/../common/vnet.subr @@ -36,6 +35,7 @@ ndp_add_gu_success_head() { } ndp_add_gu_success_body() { + local epair0 jname vnet_init @@ -74,6 +74,7 @@ ndp_del_gu_success_head() { } ndp_del_gu_success_body() { + local epair0 jname vnet_init @@ -102,13 +103,94 @@ ndp_del_gu_success_cleanup() { vnet_cleanup } +ndp_if_up() +{ + local ifname=$1 + local jname=$2 -atf_init_test_cases() + if [ -n "$jname" ]; then + jname="jexec ${jname}" + fi + atf_check ${jname} ifconfig ${ifname} up + atf_check ${jname} ifconfig ${ifname} inet6 -ifdisabled + while ${jname} ifconfig ${ifname} inet6 | grep tentative; do + sleep 0.1 + done +} + +ndp_if_lladdr() { + local ifname=$1 + local jname=$2 - atf_add_test_case "ndp_add_gu_success" - atf_add_test_case "ndp_del_gu_success" + if [ -n "$jname" ]; then + jname="jexec ${jname}" + fi + ${jname} ifconfig ${ifname} inet6 | \ + awk '/inet6 fe80:/{split($2, addr, "%"); print addr[1]}' } -# end +atf_test_case "ndp_slaac_default_route" "cleanup" +ndp_slaac_default_route_head() { + atf_set descr 'Test default route installation via SLAAC' + atf_set require.user root + atf_set require.progs "python" +} + +ndp_slaac_default_route_body() { + local epair0 jname lladdr + + vnet_init + + jname="v6t-ndp_slaac_default_route" + + 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 + + # Send an RA advertising a prefix. + atf_check -e ignore python $(atf_get_srcdir)/ra.py \ + --sendif ${epair0}b \ + --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ + --src $(ndp_if_lladdr ${epair0}b) \ + --prefix "2001:db8:ffff:1000::" --prefixlen 64 + + # Wait for a default router to appear. + while [ -z "$(jexec ${jname} ndp -r)" ]; do + sleep 0.1 + done + atf_check -o match:"^default[[:space:]]+fe80:" \ + jexec ${jname} netstat -rn -6 + + # Get rid of the default route. + jexec ${jname} route -6 flush + atf_check -o not-match:"^default[[:space:]]+fe80:" \ + jexec ${jname} netstat -rn -6 + + # Send another RA, make sure that the default route is installed again. + atf_check -e ignore python $(atf_get_srcdir)/ra.py \ + --sendif ${epair0}b \ + --dst $(ndp_if_lladdr ${epair0}a ${jname}) \ + --src $(ndp_if_lladdr ${epair0}b) \ + --prefix "2001:db8:ffff:1000::" --prefixlen 64 + while [ -z "$(jexec ${jname} ndp -r)" ]; do + sleep 0.1 + done + atf_check -o match:"^default[[:space:]]+fe80:" \ + jexec ${jname} netstat -rn -6 +} + +ndp_slaac_default_route_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" +} diff --git a/tests/sys/netinet6/ra.py b/tests/sys/netinet6/ra.py new file mode 100644 index 000000000000..44814418da48 --- /dev/null +++ b/tests/sys/netinet6/ra.py @@ -0,0 +1,38 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 Klara, Inc. +# + +import argparse +import scapy.all as sp +import sys + +# +# Emit a router advertisement with the specified prefix. +# +def main(): + parser = argparse.ArgumentParser("ra.py", + description="Emits Router Advertisement packets") + parser.add_argument('--sendif', nargs=1, required=True, + help='The interface through which the packet will be sent') + parser.add_argument('--src', nargs=1, required=True, + 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, + help='The prefix to be advertised') + parser.add_argument('--prefixlen', nargs=1, required=True, type=int, + help='The prefix length to be advertised') + + args = parser.parse_args() + pkt = sp.Ether() / \ + sp.IPv6(src=args.src, dst=args.dst) / \ + sp.ICMPv6ND_RA(chlim=64) / \ + sp.ICMPv6NDOptPrefixInfo(prefix=args.prefix, prefixlen=args.prefixlen) + + sp.sendp(pkt, iface=args.sendif[0], verbose=False) + sys.exit(0) + +if __name__ == '__main__': + main() From nobody Thu Jul 25 23:00:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVRFR0ZRvz5RV7q; Thu, 25 Jul 2024 23:00: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVRFR05ytz4WJX; Thu, 25 Jul 2024 23:00:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721948459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+VGF13rSDZ+jZsjqm6zhyS7fldoQ6KRoMn5Owvf4PMs=; b=wrljoKyef1PfWaJ1v7rktfUHfm7mIyPnqvJOKi1znjwVCocoR5zsB/DeJ1mulma7GIvaMp 7xSe7NzGcIe/AVmsmjSbcT/QbvMivGgU68oXhe+JM+Y25HtpGL2pqFEOso/vX0FEKGReC7 oxS49H6axx6empO7FKKTIKujG0CYj7c9LsVFfjelGsV72JBCy30yJhtiO0fMRsbJR+za8x mruw0pJdBV0DlTBTDFovubiaM8/a1py1xK77WwlWHOXdJY+jbOP8BCNYIAjTazAqfzmxb3 5e0BzwjO8a6LS6ua6gAdbv3LZSw0NmX9AhRJS19KU0xhptDMbE9EdDn1ZmqcLw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721948459; a=rsa-sha256; cv=none; b=u0uQjvXRp/XR4FA7OSfz1weP/PxXVC7TQrCdigjeqdilxv72hVxzjSnkq2+UiMEWeS5ZI+ yydBuvxPHThrIJQJWHiK0rH9+nX9/uRnjlM+FP2U1y+k3DZkzynMBOR1X4yBxdY4yj71gt 8bxru8Til9h6gRXi4Ji+QLhbBVZSC7FJp8Qz6KUpIfrmiAM1HI2izjzSVwOK3E7xd53NKk foHEILFJ6DlLnzMrrTQfZ7a+ba8Tvh/08EcEp86GsdIZlYlUWglVLchnwKXVENWqDgN1wR kYrOkWfa1u/KfJ31MBFBT24R8wpTciHpmMvtyFzPcnzJb9z0hMxuY8uX5d1mbQ== 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=1721948459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+VGF13rSDZ+jZsjqm6zhyS7fldoQ6KRoMn5Owvf4PMs=; b=p3cPaoowiNA8h3UGZMRxtOiZGu4SH0Onbu+2oahKzLGbWVhGbwWbF9br9ubWwXLzURlgWP /CfHqadpucbJPKDDpvXrwAjx28Ca8yv49wA9bsdfu3a1kCWMPXBgXHlPk0K3gbTLUGbI6L 0OWR5bgvTsxYw1v9UZJBKCDqTTZfnn86ApKl5wImGgbUf/TYWwIIOB81vJO3zUX9b1Ndgl jEvxwcBbJPsJYvqsIsDKwFQD20d/z2OfuL3DCiLYDf455MRPAMVgpK9wBMWpYB5stSo59n oU1olCCRecW9V/Dwjl/bBPOSdrCluLYOUPUDEO+n1hmpgEQ8Wd9ZNWNFOFUfEg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVRFQ6jYZz1CyS; Thu, 25 Jul 2024 23:00:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PN0wW7091131; Thu, 25 Jul 2024 23:00:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PN0wZr091128; Thu, 25 Jul 2024 23:00:58 GMT (envelope-from git) Date: Thu, 25 Jul 2024 23:00:58 GMT Message-Id: <202407252300.46PN0wZr091128@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 2b229739e7ca - main - Avoid division in round_up. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b229739e7ca43b36e53f47147ac05a91333f7b9 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=2b229739e7ca43b36e53f47147ac05a91333f7b9 commit 2b229739e7ca43b36e53f47147ac05a91333f7b9 Author: John F. Carr AuthorDate: 2024-07-25 23:00:28 +0000 Commit: Brooks Davis CommitDate: 2024-07-25 23:00:28 +0000 Avoid division in round_up. Division may require a function call, leading to dynamic function lookup, leading to deadlock in rtld. Pull Request: https://github.com/freebsd/freebsd-src/pull/1343 --- lib/libthr/thread/thr_stack.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/libthr/thread/thr_stack.c b/lib/libthr/thread/thr_stack.c index f576a2c04104..ab3b73085bb5 100644 --- a/lib/libthr/thread/thr_stack.c +++ b/lib/libthr/thread/thr_stack.c @@ -126,10 +126,7 @@ static char *last_stack = NULL; static inline size_t round_up(size_t size) { - if (size % _thr_page_size != 0) - size = ((size / _thr_page_size) + 1) * - _thr_page_size; - return size; + return (roundup2(size, _thr_page_size - 1)); } void From nobody Thu Jul 25 23:11:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVRTW46dfz5RW41; Thu, 25 Jul 2024 23:11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVRTW3dlhz4XMG; Thu, 25 Jul 2024 23:11:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721949087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lD3FwVxx/+oMx4dVtN7awTD+MMr5SQqNvSvLqcbzUu4=; b=cGuot9U7Qfiix00z0d7fXC9jjhL51moLxvV78TSYy3dUHh8PtzpLADo0GnLZ6CmO66Y6xh dJzfgx99jkSOE02pFYIg4w2O1Fmlgi5D+8CGlKzIJk5KG+sjUQhhOuKOnotV0Q+P8KwZuv vVlnmkmW+7eIVhkbK75zPIN/03kZ//tGiIBumTnlj0WchpubBjQWX3UF0TL1EEEwoqnq9s LeWFowsB7GWnetIohTWo8su/P2BOoobjuIqWCYJEWkn2SnOa8P4Ic3Fxu3MiMlzFDtST7a Gc5LCHa/lcoPJzOKzM0Ql2aNcjn/lO9IZWjMubV22zB8L9ILthM5BaAsTbz/0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721949087; a=rsa-sha256; cv=none; b=f3wcyrkErX1I46fdXNVE0I9asvchOwzziiBFNel+Ab+5Ty8cOShrIfaTPI03tIx2QaGP5+ VdII7X/1OcZY9yAcTMLhd1eFsRGSnWe8oRBcUYp9h81ofLX5dtXKuMdb+Dllo0Y7tbmFB6 75QmnEtX5AfPf0SATl+qTBnS7FNDTVUV6otFFxpErEfVBwHYjlQvDueGEHjNPCBSf8Cl+/ xAveta2L/zMBEq3h0DHXikFUbvIXUSA5w0KkTTaFqR6zMMFPuLrhz9lOjpBvLyMaHBLEJz 6Q3jIC+WJRLY5zPBxe+by/cVwijXAksdhXL20yVNltFU9Q4M+bXjIJp6PX3prg== 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=1721949087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lD3FwVxx/+oMx4dVtN7awTD+MMr5SQqNvSvLqcbzUu4=; b=FWxDCTf9WKSQsp7+925RPMEhd1/T/qSelmEmGvDHO4RScmyLLfodxwjlEJ6dkdwg9GeB+O EPIi+hMWgji8ISt+HGb09FaH2kFhGqRB3tAZRYxb7GcnzEkZmqYF4wKN+0DMzG3IBqFhXf aWbAQTIEl9zApsG4sW5Wa+4jDZMlHsYWAwpPFTC49Atx3d73CzFHzFvJWLkIGk1D/c9qVg EHtLR5NOgdRIeXXOSzrvpaID4Vbh1MrHTK4aDP80cC6AsM3Gia8aUer4P1hoE9LavkK7yt 5quB4YZI4GzCnJs1AnX6wT/E1DVnJ4GRAwOvWRejSrnFbh5bw42XXDW2k2OkIA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVRTW2zRTz1DJV; Thu, 25 Jul 2024 23:11:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46PNBRKw010914; Thu, 25 Jul 2024 23:11:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46PNBRhM010911; Thu, 25 Jul 2024 23:11:27 GMT (envelope-from git) Date: Thu, 25 Jul 2024 23:11:27 GMT Message-Id: <202407252311.46PNBRhM010911@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: f5c894479e59 - main - Revert "Avoid division in round_up." List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f5c894479e5986323a0d5a5a698c7d2177eec20f Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=f5c894479e5986323a0d5a5a698c7d2177eec20f commit f5c894479e5986323a0d5a5a698c7d2177eec20f Author: Brooks Davis AuthorDate: 2024-07-25 23:10:44 +0000 Commit: Brooks Davis CommitDate: 2024-07-25 23:11:11 +0000 Revert "Avoid division in round_up." This reverts commit 2b229739e7ca43b36e53f47147ac05a91333f7b9. Pull Request: https://github.com/freebsd/freebsd-src/pull/1343 --- lib/libthr/thread/thr_stack.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libthr/thread/thr_stack.c b/lib/libthr/thread/thr_stack.c index ab3b73085bb5..f576a2c04104 100644 --- a/lib/libthr/thread/thr_stack.c +++ b/lib/libthr/thread/thr_stack.c @@ -126,7 +126,10 @@ static char *last_stack = NULL; static inline size_t round_up(size_t size) { - return (roundup2(size, _thr_page_size - 1)); + if (size % _thr_page_size != 0) + size = ((size / _thr_page_size) + 1) * + _thr_page_size; + return size; } void From nobody Thu Jul 25 23:13:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVRXB6Jc0z5RWL2; Thu, 25 Jul 2024 23:13:46 +0000 (UTC) (envelope-from brooks@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVRXB5Y7lz4YDq; Thu, 25 Jul 2024 23:13:46 +0000 (UTC) (envelope-from brooks@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721949226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OsE7lOr6TRRWexJ+DZtIzkEsn71RtO4+A/pP7tofoRo=; b=G4X2KkoBEXtk7YzbrJ1C2Nf21vbdRgvbVkTh3X4M+CIr0QNdwh0chwSoFqw+k9xdmn8WfN +Irgcbk6rYIWDKiyx3rBNfyS8OJuHiDuo3tMu/W0GEg89J/YDuk0jPjO5mabxFtUNjQjeX Emexekv7Iv/QQDcJIyUrqykdB/bgwn8GfPzOfFK3muINXiwCLoEIEPGOg7KFOuwsB7bR0Z 1WC+WCfD9iJckHzoYGSbX3uDwdPtQcUG+l5CsyS0M1G9aOP7q9frhgNWtfqv5nPiTLpIUa npJEcrEl5PuO7YqhZp4qVIY0FJAVEYgOHD6XkDjdJrB34I0tk0xHh5XuqvmlQw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721949226; a=rsa-sha256; cv=none; b=d9K1eneKk48bv0lhdF6CaTAORtRkmZLeT7ViAjJcklyuEOK9sepT5cSapgi1spYRick6Je CjbVeJjnPucelG6WDkim7iNgXqYwKgoomv4JwVdEdZ0hnOSv+97Kg90ylkohS4DS9KHd7q 75+xaXtAiKKRaHRfUPrGvUdMsgSS9iVi9HBAEnRK3ivvVHZYC0+6rVAoxrehKJerjCv0c+ 4SJQCjoAAlGTyzn2LM7GEYowgQHv0KuU/mh/Y5GXXNLJ76fUaCy1noGmwXqcsHMrRfCMgd 1/4twnf39SXo7M2IYHzP7g5sE0SBNVJG0pVHQNsNysnwNZvZKfTrTTYG5Orj7w== 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=1721949226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OsE7lOr6TRRWexJ+DZtIzkEsn71RtO4+A/pP7tofoRo=; b=tpf0Xz8t7/96iAhigC86I6iGbZjEvu6yZCyCf2iaoojOc7DQdEInVwh4rIGaEOuH1qT+Or c+6n6bTu7TDieLGm/bzehoC7ve8C1Nkk6jxz1XrD4xoRTUDPFfUwg20Sn24ylrJeT1WTdd XwGC1XJSIT76ba7YNhMczdg7WdwurdLycVWCGU+MhQEim5AMvD90+N2G+pe9UAM95GV78E mEyneillSOL4t03wignEvgt2vz/FBcv9Qb1M9gjmkAXVcjtPRgxQo+fqD2L1MasWWcJzUy 89+weq0gHtU5pj9Hu3USL6itBzWdtan3rIaLlhD6ZIArr4AHI/ovmCwIUWJX8Q== Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: brooks/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WVRXB4whjzL8s; Thu, 25 Jul 2024 23:13:46 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id DEE1D3C019B; Thu, 25 Jul 2024 23:13:45 +0000 (UTC) Date: Thu, 25 Jul 2024 23:13:45 +0000 From: Brooks Davis To: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: f5c894479e59 - main - Revert "Avoid division in round_up." Message-ID: References: <202407252311.46PNBRhM010911@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202407252311.46PNBRhM010911@gitrepo.freebsd.org> On Thu, Jul 25, 2024 at 11:11:27PM +0000, Brooks Davis wrote: > The branch main has been updated by brooks: > > URL: https://cgit.FreeBSD.org/src/commit/?id=f5c894479e5986323a0d5a5a698c7d2177eec20f > > commit f5c894479e5986323a0d5a5a698c7d2177eec20f > Author: Brooks Davis > AuthorDate: 2024-07-25 23:10:44 +0000 > Commit: Brooks Davis > CommitDate: 2024-07-25 23:11:11 +0000 > > Revert "Avoid division in round_up." > > This reverts commit 2b229739e7ca43b36e53f47147ac05a91333f7b9. > > Pull Request: https://github.com/freebsd/freebsd-src/pull/1343 > --- > lib/libthr/thread/thr_stack.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/lib/libthr/thread/thr_stack.c b/lib/libthr/thread/thr_stack.c > index ab3b73085bb5..f576a2c04104 100644 > --- a/lib/libthr/thread/thr_stack.c > +++ b/lib/libthr/thread/thr_stack.c > @@ -126,7 +126,10 @@ static char *last_stack = NULL; > static inline size_t > round_up(size_t size) > { > - return (roundup2(size, _thr_page_size - 1)); Doug Moore pointed out that this isn't a power of two as required by roundup2. Sorry for not reviewing the revision to use roundup2 correctly. -- Brooks > + if (size % _thr_page_size != 0) > + size = ((size / _thr_page_size) + 1) * > + _thr_page_size; > + return size; > } > > void > From nobody Fri Jul 26 06:25:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVd6C3pWhz5RRxf; Fri, 26 Jul 2024 06:25: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVd6C1kWtz48tp; Fri, 26 Jul 2024 06:25:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721975123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axfg9vnaLQ0Jnyfj7MN3pQATa9MwRwOvG2/G9MMBZLY=; b=aJkaXBAKaW7o5LeSnPFHPu8EqDP1rdic/KMt9EjgdNAG79qxAmdH01rVbmuo1GmbO9/1Kl N0vboDMmlkni8NMur63MbQa/fUdj+DaAQScqZRa/S+louX8gq09yHYBsPNG00hvdI6KN3j P0ILEpkNpQRwoA1SP6VDz332IciTy/gmUmvlX0aCeivOnlvpmIbcO6xtnqciPj9UpjJaVN XxVukwzBCucOsUm9ihEPdGB1hJkbgjBAxNOIxzX2a4BanKKGdM+9PLn7XMTHu+LoX66OpI AO06mEwzt8vkn3maJVVGlZiAUtPqM+6tJmaV6k68MNsgBW7hML4wPf4HR8Nk8w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721975123; a=rsa-sha256; cv=none; b=wREH6xqeXTfE1vjI1ug+qWk2rPXST/FIBaZ0ReYYJFl76SRQ12znY4XIH3DZof8GX/N6rI sDkfhrzCBiQsP7+O0W7p+E3pRQUB2owj9blThLEixQZ8amPtYyVwEON2ZBK9E8wqqGDkGW V5nych08i3uRJf2oNQvPMuJf9dxW3/DHg6cC4SPGp/xojr6zZ/WaSN7M6tAV1V7b4BMUFb HwWxL9sxaQb/i9kmqXptlmnVilhIAYQ/3g47lh3fP12796e/ikf9DPUFMBu7zlJxj/vwAH 6trgAUoF5nQWmcly9qZe/1Y8BLxG1CDOIS4xm2U67I3FaaPSSGGGcigBJDannQ== 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=1721975123; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axfg9vnaLQ0Jnyfj7MN3pQATa9MwRwOvG2/G9MMBZLY=; b=v6EEJivITB7320muPklcFwWK6YXOXX9Ku/5lcS5D3DMylu9Pn99t+g73hzWnPSmp4wg4gi vUo4QMAorEjkWZTctyd4/4jU2+j6PAd5ySXBXEcSo9Ju1g7YLHdtsA05qUApf6mFQpZGYK ZChM8e8fx7GAXrT1C0EShe33tT3kHftT/B+m3molRmg+LcPA2AVk2Gdbm8gu4wYChBxt+n yqjsxMZcPZAW3NmcSSCwvouy8oEZfUkKZ+S1fV+xSnEKzXxVhKs+/OnSeR7e8+u0DLxs/9 TUUjlJXf9de6vBpkLZoSvm/8HMYv+CUE0769KqPo9+iDLpW/ZNZ92R5KbLNcxg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVd6C1KW0z1RLC; Fri, 26 Jul 2024 06:25:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46Q6PNu1044400; Fri, 26 Jul 2024 06:25:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46Q6PNff044397; Fri, 26 Jul 2024 06:25:23 GMT (envelope-from git) Date: Fri, 26 Jul 2024 06:25:23 GMT Message-Id: <202407260625.46Q6PNff044397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Cox Subject: git: 5b8c01d13a09 - main - amd64 pmap: Optimize PKU lookups when creating superpage mappings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alc X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b8c01d13a0970b11f47503fcd627d249a6e638a Auto-Submitted: auto-generated The branch main has been updated by alc: URL: https://cgit.FreeBSD.org/src/commit/?id=5b8c01d13a0970b11f47503fcd627d249a6e638a commit 5b8c01d13a0970b11f47503fcd627d249a6e638a Author: Alan Cox AuthorDate: 2024-07-25 06:57:53 +0000 Commit: Alan Cox CommitDate: 2024-07-26 05:38:46 +0000 amd64 pmap: Optimize PKU lookups when creating superpage mappings Modify pmap_pkru_same() to update the prototype PTE at the same time as checking the address range. This eliminates the need for calling pmap_pkru_get() in addition to pmap_pkru_same(). pmap_pkru_same() was already doing most of the work of pmap_pkru_get(). Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46135 --- sys/amd64/amd64/pmap.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index dcf9b4f5a4f3..778d07689ff0 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -573,7 +573,8 @@ struct pmap_pkru_range { }; static uma_zone_t pmap_pkru_ranges_zone; -static bool pmap_pkru_same(pmap_t pmap, vm_offset_t sva, vm_offset_t eva); +static bool pmap_pkru_same(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + pt_entry_t *pte); static pt_entry_t pmap_pkru_get(pmap_t pmap, vm_offset_t va); static void pmap_pkru_on_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva); static void *pkru_dup_range(void *ctx, void *data); @@ -7071,11 +7072,9 @@ pmap_enter_largepage(pmap_t pmap, vm_offset_t va, pt_entry_t newpte, int flags, PG_V = pmap_valid_bit(pmap); restart: - if (!pmap_pkru_same(pmap, va, va + pagesizes[psind])) - return (KERN_PROTECTION_FAILURE); pten = newpte; - if (va < VM_MAXUSER_ADDRESS && pmap->pm_type == PT_X86) - pten |= pmap_pkru_get(pmap, va); + if (!pmap_pkru_same(pmap, va, va + pagesizes[psind], &pten)) + return (KERN_PROTECTION_FAILURE); if (psind == 2) { /* 1G */ pml4e = pmap_pml4e(pmap, va); @@ -7529,14 +7528,10 @@ pmap_enter_pde(pmap_t pmap, vm_offset_t va, pd_entry_t newpde, u_int flags, * and let vm_fault() cope. Check after pde allocation, since * it could sleep. */ - if (!pmap_pkru_same(pmap, va, va + NBPDR)) { + if (!pmap_pkru_same(pmap, va, va + NBPDR, &newpde)) { pmap_abort_ptp(pmap, va, pdpg); return (KERN_PROTECTION_FAILURE); } - if (va < VM_MAXUSER_ADDRESS && pmap->pm_type == PT_X86) { - newpde &= ~X86_PG_PKU_MASK; - newpde |= pmap_pkru_get(pmap, va); - } /* * If there are existing mappings, either abort or remove them. @@ -11460,13 +11455,21 @@ pmap_pkru_deassign_all(pmap_t pmap) rangeset_remove_all(&pmap->pm_pkru); } +/* + * Returns true if the PKU setting is the same across the specified address + * range, and false otherwise. When returning true, updates the referenced PTE + * to reflect the PKU setting. + */ static bool -pmap_pkru_same(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) +pmap_pkru_same(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, pt_entry_t *pte) { struct pmap_pkru_range *next_ppr, *ppr; vm_offset_t va; + u_int keyidx; PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT(pmap->pm_type != PT_X86 || (*pte & X86_PG_PKU_MASK) == 0, + ("pte %p has unexpected PKU %ld", pte, *pte & X86_PG_PKU_MASK)); if (pmap->pm_type != PT_X86 || (cpu_stdext_feature2 & CPUID_STDEXT2_PKU) == 0 || sva >= VM_MAXUSER_ADDRESS) @@ -11478,14 +11481,16 @@ pmap_pkru_same(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) return (ppr == NULL || ppr->pkru_rs_el.re_start >= eva); } + keyidx = ppr->pkru_keyidx; while ((va = ppr->pkru_rs_el.re_end) < eva) { next_ppr = rangeset_next(&pmap->pm_pkru, va); if (next_ppr == NULL || va != next_ppr->pkru_rs_el.re_start || - ppr->pkru_keyidx != next_ppr->pkru_keyidx) + keyidx != next_ppr->pkru_keyidx) return (false); ppr = next_ppr; } + *pte |= X86_PG_PKU(keyidx); return (true); } From nobody Fri Jul 26 10:46:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVkv240ldz5Rsg5; Fri, 26 Jul 2024 10:46: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVkv23k7Bz4TnD; Fri, 26 Jul 2024 10:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721990766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PuF111vkL1WXeAW4k89IKk0Mbadaf3Z+QHENkQaJCLY=; b=t8VQX3aOuTmlmp5auXuaQ47kel1aJUoh4An3ExfKuzEPH8VRCtFIHN9aTXjw0HdH01xzTq EpFOSvRhxZFi84lwWPVvbbDGWgJFnmcfhw1VlM7ixzUZjwt4tmkdHflaD66Wj3qGoBzp70 lCYkJ9838sgymEZXPk7YUhuaOVoIe+8FaUoFsfs4dPWc6UXeu4qMeHTx1XO71FaVTDpCVL LEyO01BuG7QxiCijDyyatBInN1F1wl7eMVi9cnElsNv21XtsOM0PHs17HTXlsyNSLv7ynj MZAl6w6JnhoI8d9HtrISRfxQjouLmGrMZaGi8mGCVls2jhXloOyXtb772ONRIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721990766; a=rsa-sha256; cv=none; b=alC0kt3akkOHHC501NBaz0Wb1tGpn9fGvUaVZAqyovNJ3t1R0PiP7dIiIgJoNT2dhTEsie RM/Le/iHgCi5T2ZWC/47fXn9minEMKE5GIW4w47Ro+o8h9kvX8k6lZHkIALmXeL+MpYV9I sVya32wXqkcyQQuh8vrM6Q8iKNZ47q9W9Q6QTrviqCunCaI0aUsiCLoTBxhFwx2XKIg4Wt Dn/x4vrI7zhmBi30JtwemR3B1XN7wWpnIsRPyvjjJFvOcqR0u9ICpa0nNMCEnIBNZzfJ2C /6FGF/RlE7fTA3ERP3aq6fChiBwCAKkkeqtQPQdPP/ly0a5BEMNeh7dnfiy2Tg== 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=1721990766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PuF111vkL1WXeAW4k89IKk0Mbadaf3Z+QHENkQaJCLY=; b=ekvVlza90kfpGlDRhgjRr46Bm+KEIzo/aKVjOkYoU928c4lMKrYGrWDXfbjVWYKsAbCedS rwqd6kLKLy0gmc3Tnwl7qJK6UTVkyKYY3EK0G1Fi19UhmzjfN0gBGfJGXvmmn30Wqrfy8Q C1+bBMD3BKenl7+cbNavBowoce8LEO8FXZ3ayGEDLesnCJLw8x6RPgkJsUUed+nQxSUyV5 orq1cdX9j90SsBKT9ciL4ynKlCcD7H2QsAgJKsAWom5+/h/L2BRSC8Q3ligmtnzVFbCnPw BVDtfkfZYjtMS269Ao52NV/mr6adBGSc75Hda2UJzZybtgP+pUiYsv3jV0bpSg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVkv23BrSzKxd; Fri, 26 Jul 2024 10:46:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QAk6M0085193; Fri, 26 Jul 2024 10:46:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QAk6Sf085190; Fri, 26 Jul 2024 10:46:06 GMT (envelope-from git) Date: Fri, 26 Jul 2024 10:46:06 GMT Message-Id: <202407261046.46QAk6Sf085190@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: d1bdc2821fcd - main - Deprecate contigfree(9) in favour of free(9) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1bdc2821fcd416ab9b238580386eb605a6128d0 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d1bdc2821fcd416ab9b238580386eb605a6128d0 commit d1bdc2821fcd416ab9b238580386eb605a6128d0 Author: Bjoern A. Zeeb AuthorDate: 2024-07-23 19:21:17 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-07-26 10:45:01 +0000 Deprecate contigfree(9) in favour of free(9) As of 9e6544dd6e02c46b805d11ab925c4f3b18ad7a4b contigfree(9) is no longer needed and should not be used anymore. We leave a wrapper for 3rd party code in at least 15.x but remove (almost) all other cases from the tree. This leaves one use of contigfree(9) untouched; that was the original trigger for 9e6544dd6e02 and is handled in D45813 (to be committed seperately later). Sponsored by: The FreeBSD Foundation Reviewed by: markj, kib Tested by: pho (10h stress test run) Differential Revision: https://reviews.freebsd.org/D46099 --- ObsoleteFiles.inc | 3 +++ share/man/man9/Makefile | 3 +-- share/man/man9/contigmalloc.9 | 31 +++++----------------- sys/amd64/acpica/acpi_wakeup.c | 3 +-- sys/amd64/vmm/amd/svm.c | 4 +-- sys/arm64/arm64/busdma_bounce.c | 2 +- sys/arm64/arm64/gicv3_its.c | 11 ++++---- sys/arm64/include/bus_dma.h | 2 +- sys/arm64/iommu/smmu.c | 8 +++--- sys/arm64/iommu/smmuvar.h | 2 -- sys/compat/x86bios/x86bios.c | 6 ++--- sys/dev/agp/agp_i810.c | 2 +- sys/dev/bwn/if_bwn.c | 12 ++------- sys/dev/cxgbe/tom/t4_ddp.c | 6 ++--- sys/dev/dcons/dcons_os.c | 2 +- sys/dev/hpt27xx/hpt27xx_osm_bsd.c | 10 +++---- sys/dev/hptmv/entry.c | 16 +++++------ sys/dev/hptnr/hptnr_osm_bsd.c | 10 +++---- sys/dev/hptrr/hptrr_osm_bsd.c | 10 +++---- sys/dev/hyperv/netvsc/if_hn.c | 7 +++-- sys/dev/hyperv/vmbus/vmbus.c | 14 +++++----- sys/dev/hyperv/vmbus/vmbus_chan.c | 10 +++---- sys/dev/hyperv/vmbus/vmbus_chanvar.h | 1 - sys/dev/hyperv/vmbus/vmbus_xact.c | 2 +- sys/dev/ioat/ioat_test.c | 8 +----- sys/dev/isci/isci.c | 2 +- sys/dev/lge/if_lge.c | 7 +++-- sys/dev/netmap/if_ptnet.c | 2 +- sys/dev/netmap/netmap_mem2.c | 9 +++---- sys/dev/pms/freebsd/driver/ini/src/agtiapi.c | 1 - sys/dev/pst/pst-iop.c | 12 ++++----- sys/dev/pst/pst-raid.c | 6 ++--- sys/dev/qat/qat/qat_ocf.c | 6 ++--- .../qat/qat_api/qat_utils/src/QatUtilsServices.c | 2 +- sys/dev/virtio/gpu/virtio_gpu.c | 4 +-- sys/dev/virtio/virtqueue.c | 2 +- sys/dev/vmware/vmci/vmci_kernel_if.c | 4 +-- sys/dev/xen/blkfront/blkfront.c | 8 ++---- sys/i386/acpica/acpi_wakeup.c | 3 +-- sys/kern/kern_malloc.c | 12 +++------ sys/powerpc/powernv/opal_nvram.c | 3 +-- sys/powerpc/powerpc/busdma_machdep.c | 2 +- sys/riscv/include/bus_dma.h | 2 +- sys/riscv/riscv/busdma_bounce.c | 2 +- sys/sys/malloc.h | 3 ++- sys/x86/include/bus_dma.h | 2 +- sys/x86/isa/isa_dma.c | 8 +----- sys/x86/x86/busdma_bounce.c | 2 +- tools/test/stress2/misc/contigmalloc.sh | 10 +++---- tools/test/stress2/misc/contigmalloc2.sh | 11 +++----- tools/test/stress2/misc/contigmalloc3.sh | 10 +++---- 51 files changed, 123 insertions(+), 197 deletions(-) diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc index 02a34a2541eb..088dd23ebb4d 100644 --- a/ObsoleteFiles.inc +++ b/ObsoleteFiles.inc @@ -51,6 +51,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20240726: deprecate contigfree(9) +OLD_FILES+=usr/share/man/man9/contigfree.9.gz + # 20240721: retire vm_page_alloc_freelist OLD_FILES+=usr/share/man/man9/vm_page_alloc_freelist.9.gz OLD_FILES+=usr/share/man/man9/vm_page_alloc_freelist_domain.9.gz diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index f7c21ab541b6..0b315d64ed35 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -885,8 +885,7 @@ MLINKS+=config_intrhook.9 config_intrhook_disestablish.9 \ config_intrhook.9 config_intrhook_drain.9 \ config_intrhook.9 config_intrhook_establish.9 \ config_intrhook.9 config_intrhook_oneshot.9 -MLINKS+=contigmalloc.9 contigmalloc_domainset.9 \ - contigmalloc.9 contigfree.9 +MLINKS+=contigmalloc.9 contigmalloc_domainset.9 MLINKS+=casuword.9 casueword.9 \ casuword.9 casueword32.9 \ casuword.9 casuword32.9 diff --git a/share/man/man9/contigmalloc.9 b/share/man/man9/contigmalloc.9 index 9e7086885870..edbcb1d60942 100644 --- a/share/man/man9/contigmalloc.9 +++ b/share/man/man9/contigmalloc.9 @@ -23,11 +23,11 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd July 22, 2024 +.Dd July 26, 2024 .Dt CONTIGMALLOC 9 .Os .Sh NAME -.Nm contigmalloc , contigfree +.Nm contigmalloc .Nd manage contiguous kernel physical memory .Sh SYNOPSIS .In sys/types.h @@ -42,12 +42,6 @@ .Fa "unsigned long alignment" .Fa "vm_paddr_t boundary" .Fc -.Ft void -.Fo contigfree -.Fa "void *addr" -.Fa "unsigned long size" -.Fa "struct malloc_type *type" -.Fc .In sys/param.h .In sys/domainset.h .Ft "void *" @@ -109,17 +103,10 @@ Other flags (if present) are ignored. .Pp The .Fn contigfree -function deallocates memory allocated by a previous call to -.Fn contigmalloc -or -.Fn contigmalloc_domainset . -Its use is deprecated in favor of -.Xr free 9 -which no longer requires the caller to know the -.Fa size -and also accepts -.Dv NULL -as an address. +function is deprecated. +Use +.Xr free(9) +instead. .Sh IMPLEMENTATION NOTES The .Fn contigmalloc @@ -130,12 +117,6 @@ However, unless is specified, it may select a page for reclamation that must first be written to backing storage, causing it to sleep. .Pp -The -.Fn contigfree -function does not accept -.Dv NULL -as an address input, unlike -.Xr free 9 . .Sh RETURN VALUES The .Fn contigmalloc diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c index b6e6f99bc719..351cd16ff9ca 100644 --- a/sys/amd64/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -361,8 +361,7 @@ acpi_alloc_wakeup_handler(void **wakeaddr, return; freepages: - if (*wakeaddr != NULL) - contigfree(*wakeaddr, PAGE_SIZE, M_DEVBUF); + free(*wakeaddr, M_DEVBUF); for (i = 0; i < ACPI_WAKEPT_PAGES; i++) { if (wakept_m[i] != NULL) vm_page_free(wakept_m[i]); diff --git a/sys/amd64/vmm/amd/svm.c b/sys/amd64/vmm/amd/svm.c index f1106158e44e..b35cf53be080 100644 --- a/sys/amd64/vmm/amd/svm.c +++ b/sys/amd64/vmm/amd/svm.c @@ -2259,8 +2259,8 @@ svm_cleanup(void *vmi) { struct svm_softc *sc = vmi; - contigfree(sc->iopm_bitmap, SVM_IO_BITMAP_SIZE, M_SVM); - contigfree(sc->msr_bitmap, SVM_MSR_BITMAP_SIZE, M_SVM); + free(sc->iopm_bitmap, M_SVM); + free(sc->msr_bitmap, M_SVM); free(sc, M_SVM); } diff --git a/sys/arm64/arm64/busdma_bounce.c b/sys/arm64/arm64/busdma_bounce.c index 3836f8c74b45..da605d4e21f5 100644 --- a/sys/arm64/arm64/busdma_bounce.c +++ b/sys/arm64/arm64/busdma_bounce.c @@ -605,7 +605,7 @@ bounce_bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, /* * Free a piece of memory and it's allociated dmamap, that was allocated - * via bus_dmamem_alloc. Make the same choice for free/contigfree. + * via bus_dmamem_alloc. */ static void bounce_bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c index 46695a415e86..d69f86023da6 100644 --- a/sys/arm64/arm64/gicv3_its.c +++ b/sys/arm64/arm64/gicv3_its.c @@ -158,7 +158,6 @@ struct its_dev { struct lpi_chunk lpis; /* Virtual address of ITT */ void *itt; - size_t itt_size; }; /* @@ -1412,7 +1411,7 @@ its_device_get(device_t dev, device_t child, u_int nvecs) struct gicv3_its_softc *sc; struct its_dev *its_dev; vmem_addr_t irq_base; - size_t esize; + size_t esize, itt_size; sc = device_get_softc(dev); @@ -1450,8 +1449,8 @@ its_device_get(device_t dev, device_t child, u_int nvecs) * Allocate ITT for this device. * PA has to be 256 B aligned. At least two entries for device. */ - its_dev->itt_size = roundup2(MAX(nvecs, 2) * esize, 256); - its_dev->itt = contigmalloc_domainset(its_dev->itt_size, + itt_size = roundup2(MAX(nvecs, 2) * esize, 256); + its_dev->itt = contigmalloc_domainset(itt_size, M_GICV3_ITS, sc->sc_ds, M_NOWAIT | M_ZERO, 0, LPI_INT_TRANS_TAB_MAX_ADDR, LPI_INT_TRANS_TAB_ALIGN, 0); if (its_dev->itt == NULL) { @@ -1462,7 +1461,7 @@ its_device_get(device_t dev, device_t child, u_int nvecs) /* Make sure device sees zeroed ITT. */ if ((sc->sc_its_flags & ITS_FLAGS_CMDQ_FLUSH) != 0) - cpu_dcache_wb_range(its_dev->itt, its_dev->itt_size); + cpu_dcache_wb_range(its_dev->itt, itt_size); mtx_lock_spin(&sc->sc_its_dev_lock); TAILQ_INSERT_TAIL(&sc->sc_its_dev_list, its_dev, entry); @@ -1494,7 +1493,7 @@ its_device_release(device_t dev, struct its_dev *its_dev) /* Free ITT */ KASSERT(its_dev->itt != NULL, ("Invalid ITT in valid ITS device")); - contigfree(its_dev->itt, its_dev->itt_size, M_GICV3_ITS); + free(its_dev->itt, M_GICV3_ITS); /* Free the IRQ allocation */ vmem_free(sc->sc_irq_alloc, its_dev->lpis.lpi_base, diff --git a/sys/arm64/include/bus_dma.h b/sys/arm64/include/bus_dma.h index fb494be0bdc4..d9c37eb2641b 100644 --- a/sys/arm64/include/bus_dma.h +++ b/sys/arm64/include/bus_dma.h @@ -62,7 +62,7 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags, /* * Free a piece of memory and it's allociated dmamap, that was allocated - * via bus_dmamem_alloc. Make the same choice for free/contigfree. + * via bus_dmamem_alloc. */ static inline void bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map) diff --git a/sys/arm64/iommu/smmu.c b/sys/arm64/iommu/smmu.c index 76a7d29dc2db..93b0cbb7c8e4 100644 --- a/sys/arm64/iommu/smmu.c +++ b/sys/arm64/iommu/smmu.c @@ -847,7 +847,6 @@ smmu_init_cd(struct smmu_softc *sc, struct smmu_domain *domain) return (ENXIO); } - cd->size = size; cd->paddr = vtophys(cd->vaddr); ptr = cd->vaddr; @@ -962,7 +961,7 @@ smmu_init_strtab_2lvl(struct smmu_softc *sc) strtab->l1 = malloc(sz, M_SMMU, M_WAITOK | M_ZERO); if (strtab->l1 == NULL) { - contigfree(strtab->vaddr, l1size, M_SMMU); + free(strtab->vaddr, M_SMMU); return (ENOMEM); } @@ -1014,7 +1013,6 @@ smmu_init_l1_entry(struct smmu_softc *sc, int sid) size = 1 << (STRTAB_SPLIT + ilog2(STRTAB_STE_DWORDS) + 3); l1_desc->span = STRTAB_SPLIT + 1; - l1_desc->size = size; l1_desc->va = contigmalloc(size, M_SMMU, M_WAITOK | M_ZERO, /* flags */ 0, /* low */ @@ -1057,7 +1055,7 @@ smmu_deinit_l1_entry(struct smmu_softc *sc, int sid) *addr = 0; l1_desc = &strtab->l1[sid >> STRTAB_SPLIT]; - contigfree(l1_desc->va, l1_desc->size, M_SMMU); + free(l1_desc->va, M_SMMU); } static int @@ -1765,7 +1763,7 @@ smmu_domain_free(device_t dev, struct iommu_domain *iodom) smmu_tlbi_asid(sc, domain->asid); smmu_asid_free(sc, domain->asid); - contigfree(cd->vaddr, cd->size, M_SMMU); + free(cd->vaddr, M_SMMU); free(cd, M_SMMU); free(domain, M_SMMU); diff --git a/sys/arm64/iommu/smmuvar.h b/sys/arm64/iommu/smmuvar.h index c32b17abc9bc..60fad8f87531 100644 --- a/sys/arm64/iommu/smmuvar.h +++ b/sys/arm64/iommu/smmuvar.h @@ -82,7 +82,6 @@ struct smmu_queue_local_copy { struct smmu_cd { vm_paddr_t paddr; - vm_size_t size; void *vaddr; }; @@ -121,7 +120,6 @@ struct smmu_cmdq_entry { struct l1_desc { uint8_t span; - size_t size; void *va; vm_paddr_t pa; }; diff --git a/sys/compat/x86bios/x86bios.c b/sys/compat/x86bios/x86bios.c index 0eba97a59f5d..41b72080177c 100644 --- a/sys/compat/x86bios/x86bios.c +++ b/sys/compat/x86bios/x86bios.c @@ -162,7 +162,7 @@ x86bios_free(void *addr, size_t size) x86bios_vmc.npages--; } mtx_unlock(&x86bios_lock); - contigfree(addr, size, M_DEVBUF); + free(addr, M_DEVBUF); } void @@ -564,7 +564,7 @@ x86bios_free(void *addr, size_t size) bzero(x86bios_map + paddr / X86BIOS_PAGE_SIZE, sizeof(*x86bios_map) * howmany(size, X86BIOS_PAGE_SIZE)); mtx_unlock(&x86bios_lock); - contigfree(addr, size, M_DEVBUF); + free(addr, M_DEVBUF); } void @@ -669,7 +669,7 @@ x86bios_unmap_mem(void) if (x86bios_rom != NULL) pmap_unmapdev(x86bios_rom, X86BIOS_ROM_SIZE); if (x86bios_seg != NULL) { - contigfree(x86bios_seg, X86BIOS_SEG_SIZE, M_DEVBUF); + free(x86bios_seg, M_DEVBUF); x86bios_seg = NULL; } } diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c index b710a542a10f..b63c0aaf634a 100644 --- a/sys/dev/agp/agp_i810.c +++ b/sys/dev/agp/agp_i810.c @@ -1796,7 +1796,7 @@ agp_i810_free_memory(device_t dev, struct agp_memory *mem) vm_page_unwire(m, PQ_INACTIVE); VM_OBJECT_WUNLOCK(mem->am_obj); } else { - contigfree(sc->argb_cursor, mem->am_size, M_AGP); + free(sc->argb_cursor, M_AGP); sc->argb_cursor = NULL; } } diff --git a/sys/dev/bwn/if_bwn.c b/sys/dev/bwn/if_bwn.c index 742ed63a92aa..0f44c3c94672 100644 --- a/sys/dev/bwn/if_bwn.c +++ b/sys/dev/bwn/if_bwn.c @@ -2987,11 +2987,7 @@ bwn_dma_ringsetup(struct bwn_mac *mac, int controller_index, return (dr); fail2: - if (dr->dr_txhdr_cache != NULL) { - contigfree(dr->dr_txhdr_cache, - (dr->dr_numslots / BWN_TX_SLOTS_PER_FRAME) * - BWN_MAXTXHDRSIZE, M_DEVBUF); - } + free(dr->dr_txhdr_cache, M_DEVBUF); fail1: free(dr->dr_meta, M_DEVBUF); fail0: @@ -3009,11 +3005,7 @@ bwn_dma_ringfree(struct bwn_dma_ring **dr) bwn_dma_free_descbufs(*dr); bwn_dma_free_ringmemory(*dr); - if ((*dr)->dr_txhdr_cache != NULL) { - contigfree((*dr)->dr_txhdr_cache, - ((*dr)->dr_numslots / BWN_TX_SLOTS_PER_FRAME) * - BWN_MAXTXHDRSIZE, M_DEVBUF); - } + free((*dr)->dr_txhdr_cache, M_DEVBUF); free((*dr)->dr_meta, M_DEVBUF); free(*dr, M_DEVBUF); diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index a08ddea00d05..529fc2a5b825 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -181,7 +181,7 @@ static void free_ddp_rcv_buffer(struct toepcb *toep, struct ddp_rcv_buffer *drb) { t4_free_page_pods(&drb->prsv); - contigfree(drb->buf, drb->len, M_CXGBE); + free(drb->buf, M_CXGBE); free(drb, M_CXGBE); counter_u64_add(toep->ofld_rxq->ddp_buffer_free, 1); free_toepcb(toep); @@ -242,7 +242,7 @@ alloc_ddp_rcv_buffer(struct toepcb *toep, int how) error = t4_alloc_page_pods_for_rcvbuf(&td->pr, drb); if (error != 0) { - contigfree(drb->buf, drb->len, M_CXGBE); + free(drb->buf, M_CXGBE); free(drb, M_CXGBE); return (NULL); } @@ -250,7 +250,7 @@ alloc_ddp_rcv_buffer(struct toepcb *toep, int how) error = t4_write_page_pods_for_rcvbuf(sc, toep->ctrlq, toep->tid, drb); if (error != 0) { t4_free_page_pods(&drb->prsv); - contigfree(drb->buf, drb->len, M_CXGBE); + free(drb->buf, M_CXGBE); free(drb, M_CXGBE); return (NULL); } diff --git a/sys/dev/dcons/dcons_os.c b/sys/dev/dcons/dcons_os.c index 0d96ab51659b..4e34659fb3e8 100644 --- a/sys/dev/dcons/dcons_os.c +++ b/sys/dev/dcons/dcons_os.c @@ -442,7 +442,7 @@ dcons_modevent(module_t mode, int type, void *data) dcons_detach(DCONS_GDB); dg.buf->magic = 0; - contigfree(dg.buf, DCONS_BUF_SIZE, M_DEVBUF); + free(dg.buf, M_DEVBUF); } /* Wait for tty deferred free callbacks to complete. */ diff --git a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c index 32d3e465c569..225c91b44f21 100644 --- a/sys/dev/hpt27xx/hpt27xx_osm_bsd.c +++ b/sys/dev/hpt27xx/hpt27xx_osm_bsd.c @@ -146,9 +146,9 @@ static __inline void *__get_free_pages(int order) M_DEVBUF, M_WAITOK, BUS_SPACE_MAXADDR_24BIT, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); } -static __inline void free_pages(void *p, int order) +static __inline void free_pages(void *p) { - contigfree(p, PAGE_SIZE<vbus, &bus); HPT_ASSERT(p); - free_pages(p, 0); + free_pages(p); } for (f=vbus_ext->freelist_dma_head; f; f=f->next) { @@ -244,7 +244,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) while ((p=freelist_get_dma(f, &bus))) { if (order) - free_pages(p, order); + free_pages(p); else { /* can't free immediately since other blocks in this page may still be in the list */ if (((HPT_UPTR)p & (PAGE_SIZE-1))==0) @@ -254,7 +254,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) } while ((p = dmapool_get_page((PVBUS)vbus_ext->vbus, &bus))) - free_pages(p, 0); + free_pages(p); } static int hpt_init_vbus(PVBUS_EXT vbus_ext) diff --git a/sys/dev/hptmv/entry.c b/sys/dev/hptmv/entry.c index 4a014ce17f4e..5c4718bf582f 100644 --- a/sys/dev/hptmv/entry.c +++ b/sys/dev/hptmv/entry.c @@ -914,7 +914,7 @@ hptmv_allocate_edma_queues(IAL_ADAPTER_T *pAdapter) { MV_ERROR("RR18xx[%d]: Error in Request Quueues Alignment\n", pAdapter->mvSataAdapter.adapterId); - contigfree(pAdapter->requestsArrayBaseAddr, REQUESTS_ARRAY_SIZE, M_DEVBUF); + free(pAdapter->requestsArrayBaseAddr, M_DEVBUF); return -1; } /* response queues */ @@ -924,7 +924,7 @@ hptmv_allocate_edma_queues(IAL_ADAPTER_T *pAdapter) { MV_ERROR("RR18xx[%d]: Failed to allocate memory for EDMA response" " queues\n", pAdapter->mvSataAdapter.adapterId); - contigfree(pAdapter->requestsArrayBaseAddr, RESPONSES_ARRAY_SIZE, M_DEVBUF); + free(pAdapter->requestsArrayBaseAddr, M_DEVBUF); return -1; } pAdapter->responsesArrayBaseDmaAddr = fOsPhysicalAddress(pAdapter->responsesArrayBaseAddr); @@ -941,8 +941,8 @@ hptmv_allocate_edma_queues(IAL_ADAPTER_T *pAdapter) { MV_ERROR("RR18xx[%d]: Error in Response Queues Alignment\n", pAdapter->mvSataAdapter.adapterId); - contigfree(pAdapter->requestsArrayBaseAddr, REQUESTS_ARRAY_SIZE, M_DEVBUF); - contigfree(pAdapter->responsesArrayBaseAddr, RESPONSES_ARRAY_SIZE, M_DEVBUF); + free(pAdapter->requestsArrayBaseAddr, M_DEVBUF); + free(pAdapter->responsesArrayBaseAddr, M_DEVBUF); return -1; } return 0; @@ -951,8 +951,8 @@ hptmv_allocate_edma_queues(IAL_ADAPTER_T *pAdapter) static void hptmv_free_edma_queues(IAL_ADAPTER_T *pAdapter) { - contigfree(pAdapter->requestsArrayBaseAddr, REQUESTS_ARRAY_SIZE, M_DEVBUF); - contigfree(pAdapter->responsesArrayBaseAddr, RESPONSES_ARRAY_SIZE, M_DEVBUF); + free(pAdapter->requestsArrayBaseAddr, M_DEVBUF); + free(pAdapter->responsesArrayBaseAddr, M_DEVBUF); } static PVOID @@ -2950,13 +2950,13 @@ void void os_free_page(_VBUS_ARG void *p) { - contigfree(p, 0x1000, M_DEVBUF); + free(p, M_DEVBUF); } void os_free_dma_page(_VBUS_ARG void *p) { - contigfree(p, 0x1000, M_DEVBUF); + free(p, M_DEVBUF); } void diff --git a/sys/dev/hptnr/hptnr_osm_bsd.c b/sys/dev/hptnr/hptnr_osm_bsd.c index 00774bf9be4a..a8ac77c5ad5a 100644 --- a/sys/dev/hptnr/hptnr_osm_bsd.c +++ b/sys/dev/hptnr/hptnr_osm_bsd.c @@ -143,9 +143,9 @@ static __inline void *__get_free_pages(int order) M_DEVBUF, M_WAITOK, BUS_SPACE_MAXADDR_24BIT, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); } -static __inline void free_pages(void *p, int order) +static __inline void free_pages(void *p) { - contigfree(p, PAGE_SIZE<vbus, &bus); HPT_ASSERT(p); - free_pages(p, 0); + free_pages(p); } for (f=vbus_ext->freelist_dma_head; f; f=f->next) { @@ -241,7 +241,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) while ((p=freelist_get_dma(f, &bus))) { if (order) - free_pages(p, order); + free_pages(p); else { /* can't free immediately since other blocks in this page may still be in the list */ if (((HPT_UPTR)p & (PAGE_SIZE-1))==0) @@ -251,7 +251,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) } while ((p = dmapool_get_page((PVBUS)vbus_ext->vbus, &bus))) - free_pages(p, 0); + free_pages(p); } static int hpt_init_vbus(PVBUS_EXT vbus_ext) diff --git a/sys/dev/hptrr/hptrr_osm_bsd.c b/sys/dev/hptrr/hptrr_osm_bsd.c index 4208dd620e37..68e9af3aff02 100644 --- a/sys/dev/hptrr/hptrr_osm_bsd.c +++ b/sys/dev/hptrr/hptrr_osm_bsd.c @@ -144,9 +144,9 @@ static __inline void *__get_free_pages(int order) M_DEVBUF, M_WAITOK, BUS_SPACE_MAXADDR_24BIT, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); } -static __inline void free_pages(void *p, int order) +static __inline void free_pages(void *p) { - contigfree(p, PAGE_SIZE<vbus, &bus); HPT_ASSERT(p); - free_pages(p, 0); + free_pages(p); } for (f=vbus_ext->freelist_dma_head; f; f=f->next) { @@ -242,7 +242,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) while ((p=freelist_get_dma(f, &bus))) { if (order) - free_pages(p, order); + free_pages(p); else { /* can't free immediately since other blocks in this page may still be in the list */ if (((HPT_UPTR)p & (PAGE_SIZE-1))==0) @@ -252,7 +252,7 @@ static void hpt_free_mem(PVBUS_EXT vbus_ext) } while ((p = dmapool_get_page((PVBUS)vbus_ext->vbus, &bus))) - free_pages(p, 0); + free_pages(p); } static int hpt_init_vbus(PVBUS_EXT vbus_ext) diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c index 9f51f5b32199..5bdd804b06d5 100644 --- a/sys/dev/hyperv/netvsc/if_hn.c +++ b/sys/dev/hyperv/netvsc/if_hn.c @@ -5131,7 +5131,7 @@ hn_destroy_rx_data(struct hn_softc *sc) if (sc->hn_rxbuf != NULL) { if ((sc->hn_flags & HN_FLAG_RXBUF_REF) == 0) - contigfree(sc->hn_rxbuf, HN_RXBUF_SIZE, M_DEVBUF); + free(sc->hn_rxbuf, M_DEVBUF); else device_printf(sc->hn_dev, "RXBUF is referenced\n"); sc->hn_rxbuf = NULL; @@ -5146,8 +5146,7 @@ hn_destroy_rx_data(struct hn_softc *sc) if (rxr->hn_br == NULL) continue; if ((rxr->hn_rx_flags & HN_RX_FLAG_BR_REF) == 0) { - contigfree(rxr->hn_br, HN_TXBR_SIZE + HN_RXBR_SIZE, - M_DEVBUF); + free(rxr->hn_br, M_DEVBUF); } else { device_printf(sc->hn_dev, "%dth channel bufring is referenced", i); @@ -5649,7 +5648,7 @@ hn_destroy_tx_data(struct hn_softc *sc) if (sc->hn_chim != NULL) { if ((sc->hn_flags & HN_FLAG_CHIM_REF) == 0) { - contigfree(sc->hn_chim, HN_CHIM_SIZE, M_DEVBUF); + free(sc->hn_chim, M_DEVBUF); } else { device_printf(sc->hn_dev, "chimney sending buffer is referenced"); diff --git a/sys/dev/hyperv/vmbus/vmbus.c b/sys/dev/hyperv/vmbus/vmbus.c index 774ba6da46e7..5d0b23a09213 100644 --- a/sys/dev/hyperv/vmbus/vmbus.c +++ b/sys/dev/hyperv/vmbus/vmbus.c @@ -900,29 +900,27 @@ vmbus_dma_free(struct vmbus_softc *sc) int cpu; if (sc->vmbus_evtflags != NULL) { - contigfree(sc->vmbus_evtflags, PAGE_SIZE, M_DEVBUF); + free(sc->vmbus_evtflags, M_DEVBUF); sc->vmbus_evtflags = NULL; sc->vmbus_rx_evtflags = NULL; sc->vmbus_tx_evtflags = NULL; } if (sc->vmbus_mnf1 != NULL) { - contigfree(sc->vmbus_mnf1, PAGE_SIZE, M_DEVBUF); + free(sc->vmbus_mnf1, M_DEVBUF); sc->vmbus_mnf1 = NULL; } if (sc->vmbus_mnf2 != NULL) { - contigfree(sc->vmbus_mnf2, sizeof(struct vmbus_mnf), M_DEVBUF); + free(sc->vmbus_mnf2, M_DEVBUF); sc->vmbus_mnf2 = NULL; } CPU_FOREACH(cpu) { if (VMBUS_PCPU_GET(sc, message, cpu) != NULL) { - contigfree(VMBUS_PCPU_GET(sc, message, cpu), PAGE_SIZE, - M_DEVBUF); + free(VMBUS_PCPU_GET(sc, message, cpu), M_DEVBUF); VMBUS_PCPU_GET(sc, message, cpu) = NULL; } if (VMBUS_PCPU_GET(sc, event_flags, cpu) != NULL) { - contigfree(VMBUS_PCPU_GET(sc, event_flags, cpu), - PAGE_SIZE, M_DEVBUF); + free(VMBUS_PCPU_GET(sc, event_flags, cpu), M_DEVBUF); VMBUS_PCPU_GET(sc, event_flags, cpu) = NULL; } } @@ -1424,7 +1422,7 @@ vmbus_free_cpu_mem(struct vmbus_softc *sc) void **hv_cpu_mem; hv_cpu_mem = VMBUS_PCPU_PTR(sc, cpu_mem, cpu); if(*hv_cpu_mem != NULL) { - contigfree(*hv_cpu_mem, PAGE_SIZE, M_DEVBUF); + free(*hv_cpu_mem, M_DEVBUF); *hv_cpu_mem = NULL; } } diff --git a/sys/dev/hyperv/vmbus/vmbus_chan.c b/sys/dev/hyperv/vmbus/vmbus_chan.c index 0922470d4672..5ce6e545158c 100644 --- a/sys/dev/hyperv/vmbus/vmbus_chan.c +++ b/sys/dev/hyperv/vmbus/vmbus_chan.c @@ -341,8 +341,7 @@ vmbus_chan_open(struct vmbus_channel *chan, int txbr_size, int rxbr_size, * Allocate the TX+RX bufrings. */ KASSERT(chan->ch_bufring == NULL, ("bufrings are allocated")); - chan->ch_bufring_size = txbr_size + rxbr_size; - chan->ch_bufring = contigmalloc(chan->ch_bufring_size, M_DEVBUF, + chan->ch_bufring = contigmalloc(txbr_size + rxbr_size, M_DEVBUF, M_WAITOK | M_ZERO, 0ul, ~0ul, PAGE_SIZE, 0); if (chan->ch_bufring == NULL) { vmbus_chan_printf(chan, "bufring allocation failed\n"); @@ -368,8 +367,7 @@ vmbus_chan_open(struct vmbus_channel *chan, int txbr_size, int rxbr_size, "leak %d bytes memory\n", chan->ch_id, txbr_size + rxbr_size); } else { - contigfree(chan->ch_bufring, chan->ch_bufring_size, - M_DEVBUF); + free(chan->ch_bufring, M_DEVBUF); } chan->ch_bufring = NULL; } @@ -939,7 +937,7 @@ disconnect: * Destroy the TX+RX bufrings. */ if (chan->ch_bufring != NULL) { - contigfree(chan->ch_bufring, chan->ch_bufring_size, M_DEVBUF); + free(chan->ch_bufring, M_DEVBUF); chan->ch_bufring = NULL; } return (error); @@ -1679,7 +1677,7 @@ vmbus_chan_free(struct vmbus_channel *chan) KASSERT(chan->ch_poll_intvl == 0, ("chan%u: polling is activated", chan->ch_id)); - contigfree(chan->ch_monprm, sizeof(struct hyperv_mon_param), M_DEVBUF); + free(chan->ch_monprm, M_DEVBUF); mtx_destroy(&chan->ch_subchan_lock); sx_destroy(&chan->ch_orphan_lock); vmbus_rxbr_deinit(&chan->ch_rxbr); diff --git a/sys/dev/hyperv/vmbus/vmbus_chanvar.h b/sys/dev/hyperv/vmbus/vmbus_chanvar.h index e88ada2dd274..c02ec24c70a1 100644 --- a/sys/dev/hyperv/vmbus/vmbus_chanvar.h +++ b/sys/dev/hyperv/vmbus/vmbus_chanvar.h @@ -123,7 +123,6 @@ struct vmbus_channel { struct vmbus_channel *ch_prichan; /* owner primary chan */ void *ch_bufring; /* TX+RX bufrings */ - size_t ch_bufring_size; uint32_t ch_bufring_gpadl; struct task ch_attach_task; /* run in ch_mgmt_tq */ diff --git a/sys/dev/hyperv/vmbus/vmbus_xact.c b/sys/dev/hyperv/vmbus/vmbus_xact.c index f5f766f2c2fc..eb221ef92b2c 100644 --- a/sys/dev/hyperv/vmbus/vmbus_xact.c +++ b/sys/dev/hyperv/vmbus/vmbus_xact.c @@ -104,7 +104,7 @@ static void vmbus_xact_free(struct vmbus_xact *xact) { - contigfree(xact->x_req, xact->x_ctx->xc_req_size, M_DEVBUF); + free(xact->x_req, M_DEVBUF); free(xact->x_resp0, M_DEVBUF); if (xact->x_priv != NULL) free(xact->x_priv, M_DEVBUF); diff --git a/sys/dev/ioat/ioat_test.c b/sys/dev/ioat/ioat_test.c index 9c081e0fb0b9..6ff3494a76da 100644 --- a/sys/dev/ioat/ioat_test.c +++ b/sys/dev/ioat/ioat_test.c @@ -82,17 +82,11 @@ static void _ioat_test_log(int verbosity, const char *fmt, ...); static void ioat_test_transaction_destroy(struct test_transaction *tx) { - struct ioat_test *test; int i; - test = tx->test; - for (i = 0; i < IOAT_MAX_BUFS; i++) { if (tx->buf[i] != NULL) { - if (test->testkind == IOAT_TEST_DMA_8K) - free(tx->buf[i], M_IOAT_TEST); - else - contigfree(tx->buf[i], tx->length, M_IOAT_TEST); + free(tx->buf[i], M_IOAT_TEST); tx->buf[i] = NULL; } } diff --git a/sys/dev/isci/isci.c b/sys/dev/isci/isci.c index 2b5d4301f6b2..1dede4e45b4c 100644 --- a/sys/dev/isci/isci.c +++ b/sys/dev/isci/isci.c @@ -235,7 +235,7 @@ isci_detach(device_t device) sci_pool_get(controller->unmap_buffer_pool, unmap_buffer); if (unmap_buffer == NULL) break; - contigfree(unmap_buffer, PAGE_SIZE, M_ISCI); + free(unmap_buffer, M_ISCI); } } diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c index dfcaa01d366b..7542b17e19eb 100644 --- a/sys/dev/lge/if_lge.c +++ b/sys/dev/lge/if_lge.c @@ -555,8 +555,7 @@ lge_attach(device_t dev) fail: lge_free_jumbo_mem(sc); if (sc->lge_ldata) - contigfree(sc->lge_ldata, - sizeof(struct lge_list_data), M_DEVBUF); + free(sc->lge_ldata, M_DEVBUF); if (ifp) if_free(ifp); if (sc->lge_irq) @@ -590,7 +589,7 @@ lge_detach(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, 0, sc->lge_irq); bus_release_resource(dev, LGE_RES, LGE_RID, sc->lge_res); - contigfree(sc->lge_ldata, sizeof(struct lge_list_data), M_DEVBUF); + free(sc->lge_ldata, M_DEVBUF); if_free(ifp); lge_free_jumbo_mem(sc); mtx_destroy(&sc->lge_mtx); @@ -784,7 +783,7 @@ lge_free_jumbo_mem(struct lge_softc *sc) free(entry, M_DEVBUF); } - contigfree(sc->lge_cdata.lge_jumbo_buf, LGE_JMEM, M_DEVBUF); + free(sc->lge_cdata.lge_jumbo_buf, M_DEVBUF); return; } diff --git a/sys/dev/netmap/if_ptnet.c b/sys/dev/netmap/if_ptnet.c index cea62517b2e6..bf14bfdb73ea 100644 --- a/sys/dev/netmap/if_ptnet.c +++ b/sys/dev/netmap/if_ptnet.c @@ -540,7 +540,7 @@ ptnet_detach(device_t dev) ptnet_irqs_fini(sc); if (sc->csb_gh) { - contigfree(sc->csb_gh, 2*PAGE_SIZE, M_DEVBUF); + free(sc->csb_gh, M_DEVBUF); sc->csb_gh = NULL; sc->csb_hg = NULL; } diff --git a/sys/dev/netmap/netmap_mem2.c b/sys/dev/netmap/netmap_mem2.c index 23954b377f9b..473b252e7329 100644 --- a/sys/dev/netmap/netmap_mem2.c +++ b/sys/dev/netmap/netmap_mem2.c @@ -1284,7 +1284,7 @@ netmap_reset_obj_allocator(struct netmap_obj_pool *p) * in the lut. */ for (i = 0; i < p->objtotal; i += p->_clustentries) { - contigfree(p->lut[i].vaddr, p->_clustsize, M_NETMAP); + free(p->lut[i].vaddr, M_NETMAP); } nm_free_lut(p->lut, p->objtotal); } @@ -1402,7 +1402,6 @@ static int netmap_finalize_obj_allocator(struct netmap_obj_pool *p) { int i; /* must be signed */ - size_t n; if (p->lut) { /* if the lut is already there we assume that also all the @@ -1430,7 +1429,6 @@ netmap_finalize_obj_allocator(struct netmap_obj_pool *p) * Allocate clusters, init pointers */ - n = p->_clustsize; for (i = 0; i < (int)p->objtotal;) { int lim = i + p->_clustentries; char *clust; @@ -1442,7 +1440,7 @@ netmap_finalize_obj_allocator(struct netmap_obj_pool *p) * can live with standard malloc, because the hardware will not * access the pages directly. */ - clust = contigmalloc(n, M_NETMAP, M_NOWAIT | M_ZERO, + clust = contigmalloc(p->_clustsize, M_NETMAP, M_NOWAIT | M_ZERO, (size_t)0, -1UL, PAGE_SIZE, 0); if (clust == NULL) { /* @@ -1456,8 +1454,7 @@ netmap_finalize_obj_allocator(struct netmap_obj_pool *p) lim = i / 2; for (i--; i >= lim; i--) { if (i % p->_clustentries == 0 && p->lut[i].vaddr) - contigfree(p->lut[i].vaddr, - n, M_NETMAP); + free(p->lut[i].vaddr, M_NETMAP); p->lut[i].vaddr = NULL; } out: diff --git a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c index c24d03a178ee..c8c9eb8c8dd8 100644 --- a/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c +++ b/sys/dev/pms/freebsd/driver/ini/src/agtiapi.c @@ -6478,7 +6478,6 @@ int agtiapi_ReleaseHBA( device_t dev ) pCard->pPortalData = NULL; AGTIAPI_PRINTK("agtiapi_ReleaseHBA: PortalData released\n"); } - //calls contigfree() or free() agtiapi_MemFree(pCardInfo); AGTIAPI_PRINTK("agtiapi_ReleaseHBA: low level resource released\n"); diff --git a/sys/dev/pst/pst-iop.c b/sys/dev/pst/pst-iop.c index 03eca4d96286..353d41808800 100644 --- a/sys/dev/pst/pst-iop.c +++ b/sys/dev/pst/pst-iop.c @@ -136,7 +136,7 @@ iop_attach(void *arg) ident->vendor, ident->product); printf("pstiop: description=<%.16s> revision=<%.8s>\n", ident->description, ident->revision); - contigfree(reply, PAGE_SIZE, M_PSTIOP); + free(reply, M_PSTIOP); } #endif @@ -317,18 +317,18 @@ iop_get_lct(struct iop_softc *sc) msg->sgl.phys_addr[0] = vtophys(reply); if (iop_queue_wait_msg(sc, mfa, (struct i2o_basic_message *)msg)) { - contigfree(reply, ALLOCSIZE, M_PSTIOP); + free(reply, M_PSTIOP); return 0; } if (!(sc->lct = malloc(reply->table_size * sizeof(struct i2o_lct_entry), M_PSTIOP, M_NOWAIT | M_ZERO))) { - contigfree(reply, ALLOCSIZE, M_PSTIOP); + free(reply, M_PSTIOP); return 0; } bcopy(&reply->entry[0], sc->lct, reply->table_size * sizeof(struct i2o_lct_entry)); sc->lct_count = reply->table_size; - contigfree(reply, ALLOCSIZE, M_PSTIOP); + free(reply, M_PSTIOP); return 1; } @@ -374,10 +374,10 @@ iop_get_util_params(struct iop_softc *sc, int target, int operation, int group) if (iop_queue_wait_msg(sc, mfa, (struct i2o_basic_message *)msg) || reply->error_info_size) { - contigfree(reply, PAGE_SIZE, M_PSTIOP); + free(reply, M_PSTIOP); reply = NULL; } - contigfree(param, PAGE_SIZE, M_PSTIOP); + free(param, M_PSTIOP); return reply; } *** 416 LINES SKIPPED *** From nobody Fri Jul 26 10:48:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVkxh1SNbz5RsKx; Fri, 26 Jul 2024 10:48: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVkxg4X7tz4VKk; Fri, 26 Jul 2024 10:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721990903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gPAgVX6WBtHdQ/O9YGlMrgq7JniLVmadj/fE8JcNiAA=; b=T8ryRHIZiAe0adnDl04u0jbgntq8lE3r+na7n1ItdFC6oHukdMC7gIaW/NE6QFtV3Y8Hlg 7JQE2WUwNwz1SlkujL0JqW4sSZnfMLpTPKPb0yOlQyRIRaa94958ihiWTRsylRWBvYHlfB 6DmKLiEav2jZ8Db/z2SY6fBf04JvtmKzbYVT5mqdh4o64SOPtG7sOjtnUTeFvIOvNNjYd7 9qHrDUDpNFzCaqnmkUuGaIHWPqO41U1AcTzylKqTYGFbbRbTwPM1Ph7MO6p6FP4EdxV1y8 0NRgBeI905tdP+Q4RBxfzgTCKCkmcJ1oCrXuDQ6XgdFJt3lBpf5juQpAZ9QQVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721990903; a=rsa-sha256; cv=none; b=GXvJT1MlUkrg4QUr8MI29sARz4vLIHdnbsMAA+12eZp0bKKNi4rGR/QWNT3kVivjmPsMfN 0dYeAAJYkDtX8QkqRtRfemcuyaTb19htf/GAQTcO7PEifeo219To1zW/dEuP1VQ3MkMobW qsyAb9XFOO6BTEiWAtthmUMbvHyBR8Nl8eKC0x3BdJN9XYbgbZU7CrVez98nfhkysPmi/6 HOgl+V9DPTsXK8iZgeOoOVna/r9nhs+85VwgHFLR2/hZLAJL0fDJZ5iTMDCcY5hbQUWm7l Dx58Vo2B3vReAd20hZb+V9FlQsLcyjCSldmDfFo2SzWOc6QHdPLvIu5GnCVf3A== 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=1721990903; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gPAgVX6WBtHdQ/O9YGlMrgq7JniLVmadj/fE8JcNiAA=; b=fEhZ4owf6SRaIBz7/ESoMqsQutk5MC02TtVbU+od60uCbfefeOJUt8298BfMsnDc1e9duI CHLfhx9GcKqR/2MPgnWv9Mlg3K3H/ME8iaeZIqtPcdTMi5HSCXvw2AN30WmXMRnSguElkg 1Jkjl5lTphYyGRyZD6yiYcP/KQlXQHlHMW7jneZ9sZK6YSCiaGf9UBL7R1wyi2jj7i7wFS /DFpZe0f+cEB0Dfi6ssEpZ5SzplH+OJkofgpMd8mXijzdavy3J2ZUOQaLbyk9OMk0Wy4dV 2sm/qyUrRXtIn9UwiKVyOUDWotfvZ7CJvSWPMjzdPEXg2XcJJktBDGx8jxSAMg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVkxg2sbFzKxf; Fri, 26 Jul 2024 10:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QAmNuT085639; Fri, 26 Jul 2024 10:48:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QAmNLD085636; Fri, 26 Jul 2024 10:48:23 GMT (envelope-from git) Date: Fri, 26 Jul 2024 10:48:23 GMT Message-Id: <202407261048.46QAmNLD085636@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4fab5f005482 - main - kern_malloc: fold free and zfree together into one __always_inline func List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4fab5f005482aa88bc0f7d7a0a5e81b436869112 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4fab5f005482aa88bc0f7d7a0a5e81b436869112 commit 4fab5f005482aa88bc0f7d7a0a5e81b436869112 Author: Bjoern A. Zeeb AuthorDate: 2024-07-24 15:56:32 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-07-26 10:46:37 +0000 kern_malloc: fold free and zfree together into one __always_inline func free() and zfree() are essentially the same copy and pasted code with the extra explicit_bzero() (and formerly kasan) calls. Add a bool to add the extra functionality and make both functions a wrapper around the common code and let the compiler do the optimization based on the bool input when inlining. No functional changes intended. Suggested by: kib (in D45812) Sponsored by: The FreeBSD Foundation MFC after: 10 days Reviewed by: kib, markj Differential Revision: https://reviews.freebsd.org/D46101 --- sys/kern/kern_malloc.c | 90 +++++++++++++++----------------------------------- 1 file changed, 27 insertions(+), 63 deletions(-) diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 37684e26b451..ebdd00808f22 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -914,15 +914,8 @@ free_dbg(void **addrp, struct malloc_type *mtp) } #endif -/* - * free: - * - * Free a block of memory allocated by malloc. - * - * This routine may not block. - */ -void -free(void *addr, struct malloc_type *mtp) +static __always_inline void +_free(void *addr, struct malloc_type *mtp, bool dozero) { uma_zone_t zone; uma_slab_t slab; @@ -938,8 +931,8 @@ free(void *addr, struct malloc_type *mtp) vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab); if (slab == NULL) - panic("free: address %p(%p) has not been allocated", - addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); + panic("%s(%d): address %p(%p) has not been allocated", __func__, + dozero, addr, (void *)((uintptr_t)addr & (~UMA_SLAB_MASK))); switch (GET_SLAB_COOKIE(slab)) { case __predict_true(SLAB_COOKIE_SLAB_PTR): @@ -947,79 +940,50 @@ free(void *addr, struct malloc_type *mtp) #if defined(INVARIANTS) && !defined(KASAN) free_save_type(addr, mtp, size); #endif + if (dozero) + explicit_bzero(addr, size); uma_zfree_arg(zone, addr, slab); break; case SLAB_COOKIE_MALLOC_LARGE: size = malloc_large_size(slab); + if (dozero) + explicit_bzero(addr, size); free_large(addr, size); break; case SLAB_COOKIE_CONTIG_MALLOC: - size = contigmalloc_size(slab); + size = round_page(contigmalloc_size(slab)); + if (dozero) + explicit_bzero(addr, size); kmem_free(addr, size); - size = round_page(size); break; default: - panic("%s: addr %p slab %p with unknown cookie %d", __func__, - addr, slab, GET_SLAB_COOKIE(slab)); + panic("%s(%d): addr %p slab %p with unknown cookie %d", + __func__, dozero, addr, slab, GET_SLAB_COOKIE(slab)); /* NOTREACHED */ } malloc_type_freed(mtp, size); } /* - * zfree: - * - * Zero then free a block of memory allocated by malloc. - * + * free: + * Free a block of memory allocated by malloc/contigmalloc. * This routine may not block. */ void -zfree(void *addr, struct malloc_type *mtp) +free(void *addr, struct malloc_type *mtp) { - uma_zone_t zone; - uma_slab_t slab; - u_long size; - -#ifdef MALLOC_DEBUG - if (free_dbg(&addr, mtp) != 0) - return; -#endif - /* free(NULL, ...) does nothing */ - if (addr == NULL) - return; - - vtozoneslab((vm_offset_t)addr & (~UMA_SLAB_MASK), &zone, &slab); - if (slab == NULL) - panic("free: address %p(%p) has not been allocated", - addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); + _free(addr, mtp, false); +} - switch (GET_SLAB_COOKIE(slab)) { - case __predict_true(SLAB_COOKIE_SLAB_PTR): - size = zone->uz_size; -#if defined(INVARIANTS) && !defined(KASAN) - free_save_type(addr, mtp, size); -#endif - kasan_mark(addr, size, size, 0); - explicit_bzero(addr, size); - uma_zfree_arg(zone, addr, slab); - break; - case SLAB_COOKIE_MALLOC_LARGE: - size = malloc_large_size(slab); - kasan_mark(addr, size, size, 0); - explicit_bzero(addr, size); - free_large(addr, size); - break; - case SLAB_COOKIE_CONTIG_MALLOC: - size = round_page(contigmalloc_size(slab)); - explicit_bzero(addr, size); - kmem_free(addr, size); - break; - default: - panic("%s: addr %p slab %p with unknown cookie %d", __func__, - addr, slab, GET_SLAB_COOKIE(slab)); - /* NOTREACHED */ - } - malloc_type_freed(mtp, size); +/* + * zfree: + * Zero then free a block of memory allocated by malloc/contigmalloc. + * This routine may not block. + */ +void +zfree(void *addr, struct malloc_type *mtp) +{ + _free(addr, mtp, true); } /* From nobody Fri Jul 26 10:56:36 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVl785kGcz5RtW0; Fri, 26 Jul 2024 10:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVl781x1vz4Wf5; Fri, 26 Jul 2024 10:56:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721991396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eaOrsFFwXxFR690+SBylRP+BKqia0Wg/FFmCHfEeToY=; b=xIw9BHiQQEh2c1ksiSeztL+RI45d2JWVct5WdgIV+ULAJoi60hhX4Qsv97CitExV/g4OV5 PqwkVPG+ug2deIxMigcvXi/iRlUbmuDbWUsE6epfR8AZlluY2YeYriEYWfaxkBbPqYF6hA 3DBixes1PXo+a4cw+OTB1Sk3DVHwGPdR/bjGq1zmeoVcvybep+zAhQh3Pz1FwwagrABs2K KD/r/8rRWQqwWMu0CAPVFVRmuUqbSjlbkwtR1WgBi6awPXEJCWAk3IoU6E2e2aPTwukL3W U51HUHQHHE8hHZVNYgXRMI6Az1ijiOOJwc1O9CQ0nxvQv2Vl1P3JbMSu5KPSIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721991396; a=rsa-sha256; cv=none; b=j/VDlwbZDyzFe/3kz1ilHHJX/BDdpH5EP9M/w7Ghc0xPdm8fjoIYD4wh7O0q+pKRbQ+bqb LwXXXgk0U1KxvffAmBJkxCgo2BWv57as94268ROXvnr1bBSpodT1vX2cJWVFZlNQR5TGxI onS4tb3aGOkI6t6sbKKfZTadM/WdjgIYHWayQBVrAagYgbglhpuO8mlHaQ7NSY3F0hZxk2 pBQOXyBgcfjvjJuF3cL8uYQw7UjbnfcH5AgNaUDib41+kkqQj2sajsIWCpkVa7laczKAQd t2bRJ1WTseqXdV6Jw9Qxl1ycoZQTw+8coxgVLlBXdu/WgZZbsIYIaZuwQvB6lQ== 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=1721991396; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eaOrsFFwXxFR690+SBylRP+BKqia0Wg/FFmCHfEeToY=; b=aHlySHlaHimzciiG0SSdL9tLkShG1rCJrq1iDpVayW60HhXDTJkJREXSX7tCPaoWMnQMU1 1BKH3hb/uSN8G3j+Yo7cugF+lTWli3uj1qoDRaKrMhE0loU7WASoGT2kZLaYZElKsqhrik ApOT3rNZM1SxhgJdo57Zle8rwDPSsFPjYZ7SpztKxa7hE0fZmv99nHqQgCSKqoZjcWzscD bvTZirXBJOJZYrFlB39QBLzYm3axqORqLDdyNbHKuIdgyCkYbmjW4KOym3Gx1Wz0Ae7RAf ILNOO8uAyNcjFk0frTp+fmWFlbv3PwRj3By/3/fb61yV4W4zlT2gXY9vT58s0g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVl781NMgzKPH; Fri, 26 Jul 2024 10:56:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QAuaNn001866; Fri, 26 Jul 2024 10:56:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QAuanv001863; Fri, 26 Jul 2024 10:56:36 GMT (envelope-from git) Date: Fri, 26 Jul 2024 10:56:36 GMT Message-Id: <202407261056.46QAuanv001863@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 5668c22a13c6 - main - LinuxKPI/lindebugfs: stop panicing in lindebugfs, fix simple_read_from_buffer List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5668c22a13c6befa9b8486387d38457c40ce7af4 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5668c22a13c6befa9b8486387d38457c40ce7af4 commit 5668c22a13c6befa9b8486387d38457c40ce7af4 Author: Bjoern A. Zeeb AuthorDate: 2024-06-27 12:19:38 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-07-26 10:53:55 +0000 LinuxKPI/lindebugfs: stop panicing in lindebugfs, fix simple_read_from_buffer Trying to use lindebugfs for debugging wirless drivers two issues became apparent: (a) a panic in lindebugfs calling a hard coded release function if the caller had not provided one. This seems to be based on assumptions that no longer hold up. Remove the hard coded release function to prevent panics. (b) In LinuxKPI simple_read_from_buffer() would call copy_to_user() but buffers weren't setup for this (lindebugfs copies data from its own buffer) and then pseudofs will do another copyout to the user on this; remove the copy_to_user() and simply copy the data over to the provided buffer; this works for as long as the only consumers remain debugfs callers (which currently seems to be the case). [the only out-of-tree consumers I am aware off are two drm-kmod drivers/gpu/drm/amd/pm/* debugfs functions I cannot test]. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Tested by: jfree Differential Revision: https://reviews.freebsd.org/D45755 --- sys/compat/lindebugfs/lindebugfs.c | 2 -- sys/compat/linuxkpi/common/include/linux/fs.h | 22 +++++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/sys/compat/lindebugfs/lindebugfs.c b/sys/compat/lindebugfs/lindebugfs.c index 2cede0ef213f..d32de5d0657e 100644 --- a/sys/compat/lindebugfs/lindebugfs.c +++ b/sys/compat/lindebugfs/lindebugfs.c @@ -162,8 +162,6 @@ debugfs_fill(PFS_FILL_ARGS) if (d->dm_fops->release) d->dm_fops->release(&vn, &lf); - else - single_release(&vn, &lf); if (rc < 0) { #ifdef INVARIANTS diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h index 9c763168b0f4..d277b717423f 100644 --- a/sys/compat/linuxkpi/common/include/linux/fs.h +++ b/sys/compat/linuxkpi/common/include/linux/fs.h @@ -353,9 +353,8 @@ static inline ssize_t simple_read_from_buffer(void __user *dest, size_t read_size, loff_t *ppos, void *orig, size_t buf_size) { - void *read_pos = ((char *) orig) + *ppos; + void *p, *read_pos = ((char *) orig) + *ppos; size_t buf_remain = buf_size - *ppos; - ssize_t num_read; if (buf_remain < 0 || buf_remain > buf_size) return -EINVAL; @@ -363,13 +362,18 @@ simple_read_from_buffer(void __user *dest, size_t read_size, loff_t *ppos, if (read_size > buf_remain) read_size = buf_remain; - /* copy_to_user returns number of bytes NOT read */ - num_read = read_size - copy_to_user(dest, read_pos, read_size); - if (num_read == 0) - return -EFAULT; - *ppos += num_read; - - return (num_read); + /* + * XXX At time of commit only debugfs consumers could be + * identified. If others will use this function we may + * have to revise this: normally we would call copy_to_user() + * here but lindebugfs will return the result and the + * copyout is done elsewhere for us. + */ + p = memcpy(dest, read_pos, read_size); + if (p != NULL) + *ppos += read_size; + + return (read_size); } MALLOC_DECLARE(M_LSATTR); From nobody Fri Jul 26 11:04:35 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVlJM2df0z5Rvs1; Fri, 26 Jul 2024 11:04: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVlJM1vK7z4XCN; Fri, 26 Jul 2024 11:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721991875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pkb3lQxZutLQcI9SI51WO3f8dy0GzRPqHdc6446aY9Q=; b=uyC/vH1+RmcUxYeBMccu5xG+DE/DDNjKkEEumHoMjWOVxtb2s9dhwE95Z/5uAWjYPa+XIV zYo3Egwj1FqEZLM2XfvVSis9/oaUACD2MPiRyXyGHR3oHXvBGxvWuutrx2wXvAHgb04Ycr 3p2ZKuGndFrQG9YExS6FGTLB78dD4Jn0NKu34mG5uM+9r3UdMLDxU/xSZVT6u6HtwNb/x2 58T5M5it8lrZP8bxUIWVdmdEq4M/uhDi/bpdWhLDdTCeZsDeGWRRXqYPBuPUwNm5vyi4so 4B924dC6htVmrVxixTEwQjl281P9Wl4vlub/XCBLVN14HM8th4NcolBgfqf/XQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721991875; a=rsa-sha256; cv=none; b=QkfLshZDyuSfRaocJjUSQPtK91OFHOMbZHHoReuTBYk3sOF9mGjRJ0DgvPqR3LprJLEM8y jWJmPCAyeFO9BqlBAfN2sDKA/Z8rAAO/oO6EYwql0tzkI+Ay2f99sioRhQ3hYZv/m+Ag87 N+UAi8jW+3t7jZj1C+9Va4b7lBTZxB5ZVnuh5ACWPoOJ1+jaqUXlwCgwiLtlcFM+dCVXFo EwPdRccsvjpXkU0UIPGvgoG5TZDL7aJ/sKYTnWGuxRIiJOWngxz2MYi7pNva4rKg5FX2Pt 1uLKzM352bxxln9JGF4hArnopjV8fS8Ky7TmcXydnbZWFDnvVBZMhKji0Z2ZSw== 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=1721991875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pkb3lQxZutLQcI9SI51WO3f8dy0GzRPqHdc6446aY9Q=; b=HVFb03gmIQxK6XggEeU4VngHCnWLkio1zPtS4mx+1aQy6FE6/SnmRqSLo5nhCM6ReUkCA7 RLNE+nGYdK9vZ6qh5tvqKMq2v3NXgyKo7+TQSjNcFmkdWmg1mCYT1MjxCqFz4zWZixiCR0 NpB1kNKI7lfCVYaDkRTlLOAqKMRrzFn0X9H7h7fr6WnJefFOrfL3PrCGfAjcCMy7os72PO wqWXbTIZIQRTLOo8CPQTG3InwBnLWdvG2p0oRkXxS4+0nu/RJKQs2G2IG2S+MdzGNK8604 zApXb9KRl6sq92dFm6GknSsUBAY5FXNJ2yIoFqMEG5ZHl100Gh36zVLiRZ0nKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVlJM1NgpzLT5; Fri, 26 Jul 2024 11:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QB4Z6v019653; Fri, 26 Jul 2024 11:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QB4ZUT019650; Fri, 26 Jul 2024 11:04:35 GMT (envelope-from git) Date: Fri, 26 Jul 2024 11:04:35 GMT Message-Id: <202407261104.46QB4ZUT019650@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: c179937b986e - main - libc/getnameinfo: stop adding NI_NUMERICHOST where inappropriate List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c179937b986ec3959d89bfeb8eed0a6f58a28649 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=c179937b986ec3959d89bfeb8eed0a6f58a28649 commit c179937b986ec3959d89bfeb8eed0a6f58a28649 Author: Bjoern A. Zeeb AuthorDate: 2024-06-10 11:34:25 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-07-26 11:03:56 +0000 libc/getnameinfo: stop adding NI_NUMERICHOST where inappropriate Checking the first nibble of the IPv6 address to be 0 and then excluding two well known cases (v4-mapped, loopback) leaves us with more cases where the first nibble could be 0, e.g., the RFC 6052, 2.1 Well-Known Prefix 64:ff9b::/96. It is not practical to track them all and it is not clear what lead to this special casing originally, so remove them. While here also remove the IN6_IS_ADDR_LINKLOCAL() + NI_NUMERICHOST case as link-local address resolution does exist. We do leave the IN6_IS_ADDR_MULTICAST() case for now as I could not find any references to any official reverse lookups for these. Adding comments for more case (and some historic behaviour) in order to make it easier to follow the logic. PR: 279618 Fixes: 6cb9418289f90 MFC after: 6 weeks Reviewed by: hrs Differential Revision: https://reviews.freebsd.org/D45547 --- lib/libc/net/getnameinfo.c | 54 +++++++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/lib/libc/net/getnameinfo.c b/lib/libc/net/getnameinfo.c index 7ab490abb67f..01bceaa98fce 100644 --- a/lib/libc/net/getnameinfo.c +++ b/lib/libc/net/getnameinfo.c @@ -229,24 +229,44 @@ getnameinfo_inet(const struct afd *afd, case AF_INET6: { const struct sockaddr_in6 *sin6; + sin6 = (const struct sockaddr_in6 *)sa; - switch (sin6->sin6_addr.s6_addr[0]) { - case 0x00: - if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) - ; - else if (IN6_IS_ADDR_LOOPBACK(&sin6->sin6_addr)) - ; - else - flags |= NI_NUMERICHOST; - break; - default: - if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { - flags |= NI_NUMERICHOST; - } - else if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) - flags |= NI_NUMERICHOST; - break; - } + + /* + * https://pubs.opengroup.org/onlinepubs/9699919799/functions/getnameinfo.html + * "[IP6] [Option Start] If the socket address structure + * contains an IPv4-mapped IPv6 address or an IPv4-compatible + * IPv6 address, the implementation shall extract the embedded + * IPv4 address and lookup the node name for that IPv4 address. + * [Option End]" + * => getipnodebyaddr() handles this case for us. + * => in case of NI_NUMERICHOST being set, inet_ntop[6] will + * handle it too. + * + * "If the address is the IPv6 unspecified address ( "::" ), + * a lookup shall not be performed and the behavior shall be + * the same as when the node's name cannot be located." + * => getipnodebyaddr() handles this case for us. + * => in case of NI_NUMERICHOST being set, + * ip6_parsenumeric() -> inet_ntop[6] will handle it too. + */ + + /* + * We used to exclude link-local from lookups. + * Even though calles in the resolver chain may not (yet) + * properly deal with them, we no longer do as for link-local + * there is a path to resolve these. See: + * RFC 6303 4.5. IPv6 Link-Local Addresses + * RFC 6762 4. Reverse Address Mapping + * + * XXX For IPv6 MC the only reference found was + * https://www.ietf.org/archive/id/draft-michaelson-as112-ipv6-02.html + * but there are also no "empty zone"s for x.0.f.f.ip6.arpa + * in DNS servers. Keep catching it here for now and + * do not attempt name resolution but return the address string. + */ + if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) + flags |= NI_NUMERICHOST; } break; #endif From nobody Fri Jul 26 11:09:33 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVlQ55VjSz5Rvgs; Fri, 26 Jul 2024 11:09: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVlQ54yDBz4YKm; Fri, 26 Jul 2024 11:09:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721992173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0PMgzupUHWRp98fHbTQqBHGGkeB0Nn+Y7WW9uhI+nRw=; b=rHK8WJZoVvTrjEDL1WRsaU5fLturYdOZ6N4dJkrfhCPOfB3t//2KeryTSY/TyQ4blcWHi6 /ZlWFL9n2R209hZ3d+wscpMIliVvJlHKe9SGwe00YcfinRNGHSlFD8T8tCZdbBqjoudc9Z R1goZr3qy2d/CFGZhQCbQw5SJyIQ9Moh3lkcnBofYIiJgBl02E31LtQcN4cI0O/ecmiF7C iCluYACjaKkyNnmKCd3kxqBpKfRCztO93AUF+0KPtQH6E71Jfw8aYt4kFZL/TlWGifD7t9 vjOgcNNFMr4a0U0zWTm1j/41oLWgIJcSwVm1J1AQlV42HjALyc4InLrTJfolng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721992173; a=rsa-sha256; cv=none; b=SY/CmcjnIN8el6nUkxjB+F4EY8rhwol1L/Y4MCh8JqK2VRst2q2F20lYy2MvlMW13SnkE9 3YBnP89eV+uo6gV0ZY/FVuq/karVVQgXJNbFdT6z9vxuzGP4mXLmYZaLLLO5MWzOsVhdhR A1oFnmiH1eAjsk7d9Mf8P98J8yn74QFOABKST7azyWPJ7v3LwpQXMZJlDbAyAiwCfxVks4 92CV7dQs20trSApZ1VaCf5PVqMyx8jPR+KvC4RjrocRNak5y+LAfcIVRquauSZ8humayrX kf/uIeq04hXZp68WmCsmT4qIijbO+FpuscoLjgZ48vkuHhBuiHQUyDhGXL0VTA== 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=1721992173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0PMgzupUHWRp98fHbTQqBHGGkeB0Nn+Y7WW9uhI+nRw=; b=x+YbQH9kqAZZbOFfJFwA9OLGGmaJuYamXkrOvkULYYbXHzjUkNSPeTtgD3czu4aSu2C63x LJpxP3UIdivCRClkPh2Cz9EapEYRoNZwRYOkwyM2O24eOaJXelQLc9D9CxOFnm2vGhMVWL nrKCkBRYbTy9Mcb+A3uIJVOPTe8zO9HW5dfnVdpHupPYzYgekru9oe+hNtD8l5RX5BMlqw 44UN9IdXR57FcBkdFtdyEEqS4yYSufy4M3YOGpTxawlQDk/Gf2L4AGTKNsV/13NFtqHdqL 2fb487mm/0eL02RyZsVot3+dTMq9aJ7dLsOjdVtinx7HgzOgKWV5hJI/LRFNww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVlQ54JclzLJ4; Fri, 26 Jul 2024 11:09:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QB9XH7020496; Fri, 26 Jul 2024 11:09:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QB9XtG020493; Fri, 26 Jul 2024 11:09:33 GMT (envelope-from git) Date: Fri, 26 Jul 2024 11:09:33 GMT Message-Id: <202407261109.46QB9XtG020493@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 9776aba34576 - main - net80211: scan/internal: change boolean argument from int to bool List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9776aba34576596cbe49084457ee40730fec55a2 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=9776aba34576596cbe49084457ee40730fec55a2 commit 9776aba34576596cbe49084457ee40730fec55a2 Author: Bjoern A. Zeeb AuthorDate: 2024-06-30 21:16:39 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-07-26 11:07:39 +0000 net80211: scan/internal: change boolean argument from int to bool ieee80211_probe_curchan() passes a "force" argument which is bool. Make it such. Adjust the (*sc_scan_probe_curchan)() KPI to bool as well. This is all a big NOP as the only implementor of this function, ieee80211_swscan_probe_curchan(), does not use the argument at all. I came across this when pondering a different scan implementation. Rather than dropping the change remove the argument from the function, and push the cleanup out given it is purely net80211 internal code (the argument may have reason for existance in the future). Sponsored by: The FreeBSD Foundation MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D45816 --- sys/net80211/ieee80211_adhoc.c | 2 +- sys/net80211/ieee80211_hostap.c | 2 +- sys/net80211/ieee80211_mesh.c | 2 +- sys/net80211/ieee80211_scan.c | 2 +- sys/net80211/ieee80211_scan.h | 4 ++-- sys/net80211/ieee80211_scan_sw.c | 4 ++-- sys/net80211/ieee80211_sta.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sys/net80211/ieee80211_adhoc.c b/sys/net80211/ieee80211_adhoc.c index 38f73d87f3d4..f5e8a301ad28 100644 --- a/sys/net80211/ieee80211_adhoc.c +++ b/sys/net80211/ieee80211_adhoc.c @@ -763,7 +763,7 @@ adhoc_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, * XXX check if the beacon we recv'd gives * us what we need and suppress the probe req */ - ieee80211_probe_curchan(vap, 1); + ieee80211_probe_curchan(vap, true); ic->ic_flags_ext &= ~IEEE80211_FEXT_PROBECHAN; } ieee80211_add_scan(vap, rxchan, &scan, wh, diff --git a/sys/net80211/ieee80211_hostap.c b/sys/net80211/ieee80211_hostap.c index 1d741ca4d7bf..ac97889a9cef 100644 --- a/sys/net80211/ieee80211_hostap.c +++ b/sys/net80211/ieee80211_hostap.c @@ -1817,7 +1817,7 @@ hostap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, * XXX check if the beacon we recv'd gives * us what we need and suppress the probe req */ - ieee80211_probe_curchan(vap, 1); + ieee80211_probe_curchan(vap, true); ic->ic_flags_ext &= ~IEEE80211_FEXT_PROBECHAN; } ieee80211_add_scan(vap, ic->ic_curchan, &scan, wh, diff --git a/sys/net80211/ieee80211_mesh.c b/sys/net80211/ieee80211_mesh.c index 73e7ef7a8efd..8359ea8878d2 100644 --- a/sys/net80211/ieee80211_mesh.c +++ b/sys/net80211/ieee80211_mesh.c @@ -1878,7 +1878,7 @@ mesh_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, * XXX check if the beacon we recv'd gives * us what we need and suppress the probe req */ - ieee80211_probe_curchan(vap, 1); + ieee80211_probe_curchan(vap, true); ic->ic_flags_ext &= ~IEEE80211_FEXT_PROBECHAN; } ieee80211_add_scan(vap, rxchan, &scan, wh, diff --git a/sys/net80211/ieee80211_scan.c b/sys/net80211/ieee80211_scan.c index 4e5958e82cc8..04fee33f48f1 100644 --- a/sys/net80211/ieee80211_scan.c +++ b/sys/net80211/ieee80211_scan.c @@ -513,7 +513,7 @@ ieee80211_scan_done(struct ieee80211vap *vap) * then we'll transmit a probe request. */ void -ieee80211_probe_curchan(struct ieee80211vap *vap, int force) +ieee80211_probe_curchan(struct ieee80211vap *vap, bool force) { struct ieee80211com *ic = vap->iv_ic; diff --git a/sys/net80211/ieee80211_scan.h b/sys/net80211/ieee80211_scan.h index a33864b102e2..1afe767ef052 100644 --- a/sys/net80211/ieee80211_scan.h +++ b/sys/net80211/ieee80211_scan.h @@ -104,7 +104,7 @@ struct ieee80211_scan_methods { void (*sc_cancel_anyscan)(struct ieee80211vap *); void (*sc_scan_next)(struct ieee80211vap *); void (*sc_scan_done)(struct ieee80211vap *); - void (*sc_scan_probe_curchan)(struct ieee80211vap *, int); + void (*sc_scan_probe_curchan)(struct ieee80211vap *, bool); void (*sc_add_scan)(struct ieee80211vap *, struct ieee80211_channel *, const struct ieee80211_scanparams *, @@ -179,7 +179,7 @@ void ieee80211_cancel_scan(struct ieee80211vap *); void ieee80211_cancel_anyscan(struct ieee80211vap *); void ieee80211_scan_next(struct ieee80211vap *); void ieee80211_scan_done(struct ieee80211vap *); -void ieee80211_probe_curchan(struct ieee80211vap *, int); +void ieee80211_probe_curchan(struct ieee80211vap *, bool); struct ieee80211_channel *ieee80211_scan_pickchannel(struct ieee80211com *, int); struct ieee80211_scanparams; diff --git a/sys/net80211/ieee80211_scan_sw.c b/sys/net80211/ieee80211_scan_sw.c index 62f6bf24d42a..e1d6b2779cf0 100644 --- a/sys/net80211/ieee80211_scan_sw.c +++ b/sys/net80211/ieee80211_scan_sw.c @@ -522,7 +522,7 @@ ieee80211_swscan_scan_done(struct ieee80211vap *vap) * then we'll transmit a probe request. */ static void -ieee80211_swscan_probe_curchan(struct ieee80211vap *vap, int force) +ieee80211_swscan_probe_curchan(struct ieee80211vap *vap, bool force __unused) { struct ieee80211com *ic = vap->iv_ic; struct ieee80211_scan_state *ss = ic->ic_scan; @@ -569,7 +569,7 @@ scan_curchan(struct ieee80211_scan_state *ss, unsigned long maxdwell) maxdwell); IEEE80211_LOCK(ic); if (ss->ss_flags & IEEE80211_SCAN_ACTIVE) - ieee80211_probe_curchan(vap, 0); + ieee80211_probe_curchan(vap, false); taskqueue_enqueue_timeout(ic->ic_tq, &SCAN_PRIVATE(ss)->ss_scan_curchan, maxdwell); IEEE80211_UNLOCK(ic); diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 5da7999951d6..8fd4de162359 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -1690,7 +1690,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype, * XXX check if the beacon we recv'd gives * us what we need and suppress the probe req */ - ieee80211_probe_curchan(vap, 1); + ieee80211_probe_curchan(vap, true); ic->ic_flags_ext &= ~IEEE80211_FEXT_PROBECHAN; } ieee80211_add_scan(vap, rxchan, &scan, wh, From nobody Fri Jul 26 11:15:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVlYW6jb1z5Rwhw; Fri, 26 Jul 2024 11:15: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVlYW66DKz4Ysb; Fri, 26 Jul 2024 11:15:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721992559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ji2haGNKfSxW79W4nv99SDfNQu7j8bzwsob+FkbEQdE=; b=bvNeK8dAHV7CBthdDnpnBPmobOVh/vOfs7PbUwu9uzsbw4/J5xQBEpi72lxnhDkpS/kGjZ kWU1FprhwvvUuAEu1zQoWjnAEfyiXegBRUQkJ2hw4utpbwVh3QAG6ah7FQjb6xcy+h8cUw LGdIXlmIzKcawoln2mi2e4koRlbVKjTbhZjwb8B5mWHcBXg/x90lElBoXhhlLvYqoo2OXq cs+MhFGP7o6AqdyktjdVUQkEWOh6awtpYsSiro0tXLx/FyHLG09USYygkuKzMckWjOYLf6 gwQkxQKH/gYsdJGuSaN3oKRA03jmiYD3Xm1hcuiW/Q8MYrNRAWvyj3HDJbzVYg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721992559; a=rsa-sha256; cv=none; b=qV3V6YskTUW9nlHQVPDJtdxnxKOuDESsDN8ZOIYy6JaH0JMlQGhjSz/jI80YJSs52S6tUk xd8nmqmX2PwcnjUqaYICTr35o5YIvLafa2h161AaFgEW9UzZUISXjiGt/4SBfTF7tUGfeq KJkpKXO/QGpZQXdXzgiZgQf/D1QIdFwBCp6lKLueGEFtC4x/1Z2RHCbsPYf1N9um6Smb6C kcHYjDkExdPxEEYlkkXaNfTH7BD9JaZtow4mGRz9D0xBKbHDuMoztmr1Pr7iWnfoOapWO5 LZgKAERiaLrzYqJ/N3kRUe5Kh5xMabfMr9DG/Q9/c41Q0+zzxkHEecJJU/nwfw== 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=1721992559; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ji2haGNKfSxW79W4nv99SDfNQu7j8bzwsob+FkbEQdE=; b=Sg6OEI8IV+TFQ+q/Jk67aPs9eVSpdobUei82cl3k9EU8XDkU9NnTMIdPGURs+yIpJLSZ9u kh6nLJ9UAK0tLTsY7Ky5Z20klWR/fmzXE5KG4FDsnAXqKtBqaiBBuA5Zc5bBvNP07IguJ/ 9u2Q49QafmUbMyyZZOHgS9hwMZRON/ScKWU9qiYPl55WZZWd2y+aDpylNAxOKXaTCKG+4j H/bxz49EQgIy/n6mzW1CH88g4lldyGOmJ1eSoVPSBvxio80bQc7aeuiWnmpH+wZB7lVpD0 dN3uC7nlvybUAlmw8MuZSWT9/1TLGLim68QzFuydcArQqAM0iPuQhByOqnCXOA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVlYW5bbtzLdT; Fri, 26 Jul 2024 11:15:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QBFxrd036887; Fri, 26 Jul 2024 11:15:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QBFxnZ036884; Fri, 26 Jul 2024 11:15:59 GMT (envelope-from git) Date: Fri, 26 Jul 2024 11:15:59 GMT Message-Id: <202407261115.46QBFxnZ036884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konrad Witaszczyk Subject: git: 5c3af1d697dc - main - nullfs: Use an a_gen field to cast to vop_generic_args List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: def X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5c3af1d697dc9d1bfe8f0a5ab9206a6b88e4bfe7 Auto-Submitted: auto-generated The branch main has been updated by def: URL: https://cgit.FreeBSD.org/src/commit/?id=5c3af1d697dc9d1bfe8f0a5ab9206a6b88e4bfe7 commit 5c3af1d697dc9d1bfe8f0a5ab9206a6b88e4bfe7 Author: Konrad Witaszczyk AuthorDate: 2022-11-09 15:26:56 +0000 Commit: Konrad Witaszczyk CommitDate: 2024-07-26 11:14:32 +0000 nullfs: Use an a_gen field to cast to vop_generic_args Instead of casting a vop_F_args object to vop_generic_args, use a vop_F_args.a_gen field when calling null_bypass(). This way we don't hardcode the vop_generic_args data type in the callers of null_bypass(). Before this change, there were 3 null_bypass() calls using a vop_F_args.a_gen field and 5 null_bypass() calls using a cast to vop_generic_args. This change makes all null_bypass() calls consistent and easier to maintain. Pointed out by: jrtc27 Reviewed by: kib, oshogbo Accepted by: oshogbo (mentor) Differential Revision: https://reviews.freebsd.org/D37359 --- sys/fs/nullfs/null_vnops.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 4747b1dd5b82..bdf82432a2fb 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -528,7 +528,7 @@ null_setattr(struct vop_setattr_args *ap) } } - return (null_bypass((struct vop_generic_args *)ap)); + return (null_bypass(&ap->a_gen)); } /* @@ -539,7 +539,7 @@ null_stat(struct vop_stat_args *ap) { int error; - if ((error = null_bypass((struct vop_generic_args *)ap)) != 0) + if ((error = null_bypass(&ap->a_gen)) != 0) return (error); ap->a_sb->st_dev = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0]; @@ -551,7 +551,7 @@ null_getattr(struct vop_getattr_args *ap) { int error; - if ((error = null_bypass((struct vop_generic_args *)ap)) != 0) + if ((error = null_bypass(&ap->a_gen)) != 0) return (error); ap->a_vap->va_fsid = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0]; @@ -584,7 +584,7 @@ null_access(struct vop_access_args *ap) break; } } - return (null_bypass((struct vop_generic_args *)ap)); + return (null_bypass(&ap->a_gen)); } static int @@ -610,7 +610,7 @@ null_accessx(struct vop_accessx_args *ap) break; } } - return (null_bypass((struct vop_generic_args *)ap)); + return (null_bypass(&ap->a_gen)); } /* From nobody Fri Jul 26 11:51:41 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVmLj3b81z5S0J6; Fri, 26 Jul 2024 11:51: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVmLj2y99z4cCV; Fri, 26 Jul 2024 11:51:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721994701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FSJ1JBS8EvT18kijgdMBVp5Hv+22r1C1st6syRUTVyk=; b=JjK+1If17RFhk4qTXPmGHggAzgbGXc2OhOWdrb9Kf3nFyygc7//FAwg2ytgv8eyowZmBpp XrFKswHQ1d2EARTQxraB8xxSxVfRObKglgGkPsqvw4+rCc8lyqqEjZqX2K8qYuJIX9Ygp7 A5o6dqeFhjSLF0nNtIqmjXYiTATVAs820BGLcgApsDqwawLZdV5MSU8hP30Xp42MPLhqk3 gq95bBvN240bd28RIfxhtT18XAx+eWjsrEl6GSagov434EQeXGdDDfJZ4ARbG+NfGXDjF/ Doqb9zCoNXp+mqYQa9ZUniN/P1RwG8jbbP/vHPCtfqlWMA5CNsoP/LwPsAiQZw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721994701; a=rsa-sha256; cv=none; b=AVjB2xUzG2K8qmWLMoyafh6vHipqw8FTFePizBVJx/Q6IjtGRHOLdwvlBxhl+2mDue4WC1 8CfwK7hX17lbbIkFjDoU4UkIQdx1mhUm1jihCat9wXtwHljP/S5C0henUzhihpxyNXKPIh 8WJKAChvVSnJnyE0wciK+SjN96s/2XBr0lw9ZWJpxbmtZaubF+CTWR3kC2h1DNxU1RAOwN r/0b4gUBYC8qFb09y8IAUomUciOPQv897vYs5YYd7cKg9DBH+PeCdlXscq18fTnh/nGFqU QGcDY6uPQ93CGOWkpAmgPV1SskGMmywX8+gSYhPyqHDNxqPkGzyCEDY/DzH00A== 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=1721994701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FSJ1JBS8EvT18kijgdMBVp5Hv+22r1C1st6syRUTVyk=; b=COTjNbSwk4sIkvvE6qcHdk4uCmf2Ak5RGLWElV5nLK0vwgRAUtiTa4Y5TQsD3e7R3SvmpI My068H9lFKJv74HS7v2adCQJipyNhz2K58cTv80UFjH7bWKRXJvaMVYI0uRQxMO5WkBDPN /l4FANBTp8uSilPdYMwv61ZK7S/AWIAU9jmxsqHG4YCzeElG1miCTCVpQGx6f7SQi88S7b JmdGrCBLN/qZTAPgYdFUoRAcWHbqD50UsWtoH25y2BP6F4fIlm9HKrfY5LKHgKuHYbkqw2 jrbHQpTLVxrdOXckpRe1wi4uG3pD0LeqH/Kzj511RM2oKiEpSFof08zMeia3Bg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVmLj2YTSzMX9; Fri, 26 Jul 2024 11:51:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QBpfGB000936; Fri, 26 Jul 2024 11:51:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QBpfBo000933; Fri, 26 Jul 2024 11:51:41 GMT (envelope-from git) Date: Fri, 26 Jul 2024 11:51:41 GMT Message-Id: <202407261151.46QBpfBo000933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 1f7df7570174 - main - LinuxKPI: move __kmalloc from slab.h to slab.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1f7df757017404011732196e65981d9325f7a89f Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=1f7df757017404011732196e65981d9325f7a89f commit 1f7df757017404011732196e65981d9325f7a89f Author: Bjoern A. Zeeb AuthorDate: 2024-06-30 20:37:07 +0000 Commit: Bjoern A. Zeeb CommitDate: 2024-07-26 11:51:04 +0000 LinuxKPI: move __kmalloc from slab.h to slab.c In order to allow the allocator to change in the future move it into the implementation file from being an inline function in the header. While here factor out the size calculation and add a comment as-to why this is done. We will need the size (_s) in the future to make a decision on how to allocate. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45815 --- sys/compat/linuxkpi/common/include/linux/slab.h | 9 ++------- sys/compat/linuxkpi/common/src/linux_slab.c | 11 +++++++++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h index 3f2d1621e148..07c16884b00e 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -92,6 +92,8 @@ struct linux_kmem_cache; #define ZERO_OR_NULL_PTR(x) ((x) == NULL || (x) == ZERO_SIZE_PTR) extern void *lkpi_kmalloc(size_t size, gfp_t flags); +void *lkpi___kmalloc(size_t size, gfp_t flags); +#define __kmalloc(_s, _f) lkpi___kmalloc(_s, _f) static inline gfp_t linux_check_m_flags(gfp_t flags) @@ -108,13 +110,6 @@ linux_check_m_flags(gfp_t flags) return (flags & GFP_NATIVE_MASK); } -static inline void * -__kmalloc(size_t size, gfp_t flags) -{ - return (malloc(MAX(size, sizeof(struct llist_node)), M_KMALLOC, - linux_check_m_flags(flags))); -} - static inline void * kmalloc_node(size_t size, gfp_t flags, int node) { diff --git a/sys/compat/linuxkpi/common/src/linux_slab.c b/sys/compat/linuxkpi/common/src/linux_slab.c index 68117d1c9fa7..72b35fee9214 100644 --- a/sys/compat/linuxkpi/common/src/linux_slab.c +++ b/sys/compat/linuxkpi/common/src/linux_slab.c @@ -207,6 +207,17 @@ linux_kmem_cache_destroy(struct linux_kmem_cache *c) free(c, M_KMALLOC); } +void * +lkpi___kmalloc(size_t size, gfp_t flags) +{ + size_t _s; + + /* sizeof(struct llist_node) is used for kfree_async(). */ + _s = MAX(size, sizeof(struct llist_node)); + + return (malloc(_s, M_KMALLOC, linux_check_m_flags(flags))); +} + struct lkpi_kmalloc_ctx { size_t size; gfp_t flags; From nobody Fri Jul 26 16:52:29 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVv1p0vvkz5Qwfm; Fri, 26 Jul 2024 16:52: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVv1p0SXHz4HPt; Fri, 26 Jul 2024 16:52:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722012750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WB5iob5woWbwRGthnQPBzPv10P3Be7MMLGwM3q3SAQQ=; b=dUl0P3/wSpsucdRP0dL89H+yRZfF93izNTZI8ZUFoGKAFTEZ8H1Pvp/WE3NIjm1IsuV1K0 VIM/hECnyWVfMccyUmkS6KS64AV+p1hCTgp9ao5qBTrCJQiRdRe2C5/5Xkz0Zf/TQZMBOQ y7pb8hy5ileZKzLu0LvjvQkE3Cj9MZQ5Q8oAvfaXMxLYSw/w7NYi7cAAMn2dJX/wICwZaK FcYEi8sq0xGczU+h/hrXosASfHGxG5FBW43t4qEfAgkIPF0Boock0t+Dz86//EDTWk2d9u A8AHwnZVfZcPlATI47fQ4V0YTBu7lYJySvIKZoWCrAW6BcvA528TGRc9zV4wBA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722012750; a=rsa-sha256; cv=none; b=ki+8JIuy+50dMVL3GJkgNo+SPmT9WAVP0ZFFIjl+qSzItxgObSGTa9xWiS00Foz3rR3DXi nW85sajhx04jIHe9kj6Sq4gwfAJi1oLMpjtHN5DBSQItP4BpbUJJkMSi8d/mmrDLE8g9QK 6ckKRI0JDAoxng8YI11OMBrIOoqu3dhSZ/yMsfCEIMHT3hu0zdx7MpSx9xIyDCCAYJhWlz xM+B2slRevV1FPJ9G3nIjI/eu1rAjG1bD1dIh7rh5c9i7PYjPHcrw68KDZEekj+rlNIVTJ WS0eDfwfqMyT1J1pHKLqioHAze4DFR5q34nkhLoYIL4UajbZl36foTNzQrdJNQ== 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=1722012750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WB5iob5woWbwRGthnQPBzPv10P3Be7MMLGwM3q3SAQQ=; b=xNqV6OXMMsAWSjXmP9zuG6ep/5ZtsQHRw7vuvoKbR3/WjOW5Yr3FdtHNCaKWXVnjYjal5r CtOH0iZ/AUSY3JSej45ClnzLbdHe34D1RnR7/FJ4O/XroDv3XdP63uLyYywmY/0qTUPo03 nT+gNSRC0FH5nrichfYYGITAbLdNYocSVLcAXc5+rcFK+gJsh7vOQlh9/MnIRwmG6k91pe asCCWm/bF2ASKJWgKUX0CTgyw9wADrS/ZyJidupbR/0G4TJeDYjg1Ocon8HxIiEizaNDba J6sC1AhxnAjzu4+FGDp2dDZeafZOSG5S1MXvxQSSNamav+UaapJr7Za7iV2dgA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WVv1n72P8zXYb; Fri, 26 Jul 2024 16:52:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QGqToZ010130; Fri, 26 Jul 2024 16:52:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QGqTFI010127; Fri, 26 Jul 2024 16:52:29 GMT (envelope-from git) Date: Fri, 26 Jul 2024 16:52:29 GMT Message-Id: <202407261652.46QGqTFI010127@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 1d897d19f31d - main - netisr: avoid ffs(0) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1d897d19f31dd6d0411eb01ac4695e1c6aa8836a Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=1d897d19f31dd6d0411eb01ac4695e1c6aa8836a commit 1d897d19f31dd6d0411eb01ac4695e1c6aa8836a Author: Doug Moore AuthorDate: 2024-07-26 16:51:17 +0000 Commit: Doug Moore CommitDate: 2024-07-26 16:51:17 +0000 netisr: avoid ffs(0) A rearrangement to avoid computing ffs(0) saves 128 bytes in resulting amd64 object code. Reviewed by: brooks Differential Revision: https://reviews.freebsd.org/D41254 --- sys/net/netisr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/netisr.c b/sys/net/netisr.c index 8c44d112a4e3..4ae1aa9ab89d 100644 --- a/sys/net/netisr.c +++ b/sys/net/netisr.c @@ -968,8 +968,8 @@ swi_net(void *arg) nwsp->nws_flags |= NWS_RUNNING; nwsp->nws_flags &= ~NWS_SCHEDULED; while ((bits = nwsp->nws_pendingbits) != 0) { - while ((prot = ffs(bits)) != 0) { - prot--; + while (bits != 0) { + prot = ffs(bits) - 1; bits &= ~(1 << prot); (void)netisr_process_workstream_proto(nwsp, prot); } From nobody Fri Jul 26 17:14:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVvWc1clwz5Qybc; Fri, 26 Jul 2024 17:14:52 +0000 (UTC) (envelope-from gallatin@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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVvWc0sMPz4KHV; Fri, 26 Jul 2024 17:14:52 +0000 (UTC) (envelope-from gallatin@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722014092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WHj0+52y8Paea0ohCL5IjVEKvPWn2sGDCB0B08+oLvg=; b=F93UW/sZA+B+6HGkwBtTaslca/wgvu92INj+iOhpz3PEPHxWRZsvcalmisvHV4kwx58Jwf DrC/57RlfjFoeAaNNaOZIXzkKVFzKQDc/5Xw4hPkoFOhCJS7nnmRRwO+I7HIARbrp5IMOt d+2pumZBDBIUS4twI3CNkN9XWMFIurnmLg13aw0wEoTVA/iYVuArgMBGeyQgNPfqId1rl4 jLQdaL67SJTceQZkxM7xUWkKXlp/NQhItdG/iE1Pohs3sujMbLZ78Yw2fM4FKI6GOFwYHm /L0WW6Jr6mTsrTOvyBxAqusJ0HpHD/hOxy6AeFDIHHm2raWW/Ast3Lx/qNqiIg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722014092; a=rsa-sha256; cv=none; b=ZMyqzxJ5L6218+BeOKyDQkzU6vxql1ZUhlYGGunyRqoEJRo4ZWIYRrdKgFuU1hBg4x8MFH nBU2T1h3Qi+FJ6yYr27oVzVz3mXdkLx/cfklNQTl1N/NdPFFDJiKtGYDm1Sil/qS2fMSvk FAwg1X0Rx05VtD4BFzCygcPNtxQvgEJoFLvLZMytOJ4uzF5paxa0LEkXt+wtxSAh13T63u +4xEXbZRee3DMa0hsOrtQE/L8dI+Rid39XpRyEMa9JcUm7xXU9w3ha89JOB7Z9k5SXcfZF GQKL4bV50mf+Kgkc2YudCFiRjZyHRylZvMs3Pl/DpG0DdykOqUqr1WNmCzou/A== 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=1722014092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WHj0+52y8Paea0ohCL5IjVEKvPWn2sGDCB0B08+oLvg=; b=UPUso6SdCFQnw2T19tfa/zk0qKRAKRbfvaWZAN5b2MDceebZrPoa++521UM9Tf7wYlP2Z7 m5Jpzx+jMU2PtZXjdY8470AKOi7GnezuT2H3P4DMCaAeGgqI1B6/yWt/0Y34ByXpMItHqQ DNBDowQ9SwazSw3+C0J8vFkTHIuv49EdxNt+vN6Muh+Vt6gu/NdFRqs2JVwLrKDpbwq8K/ lv1BwERnw8h576pKuOgZco1cEt6w7ooJnwA5pI/C02jHy2/eW1ErAn0C+rjWy3RUfHuuvq adgNf9SUfmtMIAFUPab2t2WQ1TWu4ibjuXVt7XRcDZWFKV8cLsH80Kyf4vdXcQ== Received: from fauth1-smtp.messagingengine.com (fauth1-smtp.messagingengine.com [103.168.172.200]) (using TLSv1.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: gallatin) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WVvWb66nmzj7J; Fri, 26 Jul 2024 17:14:49 +0000 (UTC) (envelope-from gallatin@freebsd.org) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfauth.nyi.internal (Postfix) with ESMTP id 5EC481200077; Fri, 26 Jul 2024 13:14:43 -0400 (EDT) Received: from wimap26 ([10.202.2.86]) by compute1.internal (MEProxy); Fri, 26 Jul 2024 13:14:43 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrieehgdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsegrtd erreerredtnecuhfhrohhmpedfffhrvgifucfirghllhgrthhinhdfuceoghgrlhhlrght ihhnsehfrhgvvggsshgurdhorhhgqeenucggtffrrghtthgvrhhnpedvfefhjeeludefge efjeelteeifedtffeuudevgffgffefudfgleeuvdekhfejieenucffohhmrghinhepfhhr vggvsghsugdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehgrghllhgrthhinhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihht hidqudeffeehledvvdduiedqvdelhedtgedukeegqdhgrghllhgrthhinheppehfrhgvvg gsshgurdhorhhgsehfrghsthhmrghilhdrtghomhdpnhgspghrtghpthhtoheptd X-ME-Proxy: Feedback-ID: i41414658:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3C6F419C0089; Fri, 26 Jul 2024 13:14:43 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-582-g5a02f8850-fm-20240719.002-g5a02f885 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Message-Id: <52e1bb60-32f3-49de-9714-78762edbfd4c@app.fastmail.com> In-Reply-To: <202405060315.4463FxP6098471@gitrepo.freebsd.org> References: <202405060315.4463FxP6098471@gitrepo.freebsd.org> Date: Fri, 26 Jul 2024 13:14:23 -0400 From: "Drew Gallatin" To: "Konstantin Belousov" , src-committers@freebsd.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: c097967b9af9 - main - mlx5en: add diagnostic in one more case of failed eeprom read preparation Content-Type: multipart/alternative; boundary=775e74ac73ea4ddb9d8a89b5497dea89 --775e74ac73ea4ddb9d8a89b5497dea89 Content-Type: text/plain Hi, This recently hit our tree and was deployed, and our operations team is quite upset because this results in a massive (orders of magnitude) increase in our kernel log messages due to our monitoring scripts probing each port. Can we please move this under bootverbose, or have some other way to suppress these prints? I can back this out in our tree, but I don't want to create yet another local patch. Thank you, Drew On Sun, May 5, 2024, at 11:15 PM, Konstantin Belousov wrote: > The branch main has been updated by kib: > > URL: https://cgit.FreeBSD.org/src/commit/?id=c097967b9af946cf46246cce5adde53f7e955ecc > > commit c097967b9af946cf46246cce5adde53f7e955ecc > Author: Konstantin Belousov > AuthorDate: 2024-05-05 07:09:07 +0000 > Commit: Konstantin Belousov > CommitDate: 2024-05-06 03:15:35 +0000 > > mlx5en: add diagnostic in one more case of failed eeprom read preparation > > Sponsored by: Nvidia Networking > MFC after: 1 week > --- > sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c > index e1dbd02fcf3a..962705e6d258 100644 > --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c > +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c > @@ -3674,6 +3674,9 @@ out: > /* Check if module is present before doing an access */ > module_status = mlx5_query_module_status(priv->mdev, module_num); > if (module_status != MLX5_MODULE_STATUS_PLUGGED_ENABLED) { > + mlx5_en_err(ifp, > + "Query module %d status: not plugged (%d), eeprom reading is not supported\n", > + module_num, module_status); > error = EINVAL; > goto err_i2c; > } > --775e74ac73ea4ddb9d8a89b5497dea89 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
Hi,

This recently hit our tree and was deployed, and our o= perations team is quite upset because this results in a massive (orders = of magnitude)  increase in our kernel log messages due to our monit= oring scripts probing each port.

Can we ple= ase move this under bootverbose, or have some other way to suppress thes= e prints?  I can back this out in our tree, but I don't want to cre= ate yet another local patch.

Thank you,
=

Drew

On Sun, May = 5, 2024, at 11:15 PM, Konstantin Belousov wrote:
The branch main has been updated b= y kib:


commit c097967b9af946cf46246cce= 5adde53f7e955ecc
Author:     Konstanti= n Belousov <kib@FreeBSD.org>= ;
AuthorDate: 2024-05-05 07:09:07 +0000
Comm= it:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-05= -06 03:15:35 +0000

    mlx5e= n: add diagnostic in one more case of failed eeprom read preparation
=
    
    Spo= nsored by:   Nvidia Networking
   = ; MFC after:      1 week
---
<= /div>
sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 3 +++
1 fi= le changed, 3 insertions(+)

diff --git a/sy= s/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c<= br>
index e1dbd02fcf3a..962705e6d258 100644
--- = a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
+++ b/sys/dev/mlx5/m= lx5_en/mlx5_en_main.c
@@ -3674,6 +3674,9 @@ out:
=
/* Check if module is present before doing an access */
module_status =3D mlx5_query_module_status(priv->mdev, module_num)= ;
if (module_status !=3D MLX5_MODULE_STATUS_PLUGGED_ENABLE= D) {
+ mlx5_en_err(ifp,
+   &n= bsp; "Query module %d status: not plugged (%d), eeprom reading is not su= pported\n",
+     module_num, module_stat= us);
error =3D EINVAL;
goto err_i2c;
}


--775e74ac73ea4ddb9d8a89b5497dea89-- From nobody Fri Jul 26 20:02:01 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WVzDl6Rr1z5RG4Q; Fri, 26 Jul 2024 20:02:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WVzDl0fdxz4brr; Fri, 26 Jul 2024 20:02:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 46QK21Z8062715; Fri, 26 Jul 2024 23:02:04 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 46QK21Z8062715 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 46QK218m062714; Fri, 26 Jul 2024 23:02:01 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 26 Jul 2024 23:02:01 +0300 From: Konstantin Belousov To: Drew Gallatin Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: c097967b9af9 - main - mlx5en: add diagnostic in one more case of failed eeprom read preparation Message-ID: References: <202405060315.4463FxP6098471@gitrepo.freebsd.org> <52e1bb60-32f3-49de-9714-78762edbfd4c@app.fastmail.com> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52e1bb60-32f3-49de-9714-78762edbfd4c@app.fastmail.com> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: ---- 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:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4WVzDl0fdxz4brr On Fri, Jul 26, 2024 at 01:14:23PM -0400, Drew Gallatin wrote: > Hi, > > This recently hit our tree and was deployed, and our operations team is quite upset because this results in a massive (orders of magnitude) increase in our kernel log messages due to our monitoring scripts probing each port. > > Can we please move this under bootverbose, or have some other way to suppress these prints? I can back this out in our tree, but I don't want to create yet another local patch. > I will put it under bootverbose. From nobody Fri Jul 26 22:06:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WW1zs6NPcz5RRNM for ; Fri, 26 Jul 2024 22: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WW1zs5m88z4mds; Fri, 26 Jul 2024 22: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=1722031577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bK+tVS9wJij0IQ8XiDKNUL/ZyX+RZ2WM8c608z/giuM=; b=Bkycwx7XdWRqQiIHgpcZd+TBxFi/26TzblAgJK5xgkifWLiI8+4dH91a++imO/SfyzsdIF CvB8CWs4rohdB+HsVTk+QMLzTVB7Qlw3THb3D37rU0gKIWZFinKhzJg/X6uFZ9sA0IA2bo hpeK3cok15YVx7FsvTTqavEkoCDPaKMH073fm5zPw1Ye+nghBWvAXPgWuiVLfFAY3yNliJ DA0XOm7vScgxUHITadO/7C+QeJaEREpv2teB7tSXSA6XSUnPfCynN5cJoV7oHmXwJ1RYxv A85XKMCS6dDRvWza9L188NTjbjYAnrgJSe/8aGcnE2GdaRmH9EqNpirN6+NG+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722031577; a=rsa-sha256; cv=none; b=ibFUKbBGOYB6jJMWnnVS5XVlqvKmKBq0yZrwZ66hNGiqUagB4KOpNzJ/wcTklbyFWZg9o/ 7cChaumU6tn3sC+dCnjYR5TuoZXD9kC9j90t848Dn2uIdNXUhTJEbjUXLZbN36G7RRKEkP dopriGnFWLWlRmWLIHE9ivXGyfysJOfMXaT6pYBlAXuRxpuUQ0LjhjJR20kn8zClRCV6py dOgC/nrohjTYVn6uqTxACgnvMt3D1j1uM+ukMTSCGJ3+x0m3ItPfA4tIfHODkIP//coBgL cHc+DzmG89WO434gbzW0o1dRvp4y3BIjVnTYqxT0hrbhy6e2gsJoVU7sbQUOVw== 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=1722031577; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bK+tVS9wJij0IQ8XiDKNUL/ZyX+RZ2WM8c608z/giuM=; b=TVEt62JuoUylGa4cl7bR9HVzvKLMSM0Rj9mv1KSnCZpYV4OfIFI6mHetU74Qtq+XNQ48xv 4pongxzf1HqmW/dirdNPQYPWd3QqNtYe/Gpa+pAkOk/ebVGYzznX3PvDOIqISTdf3zn+DJ 1QrWRuoczurOl1zZrxod894Xquaf3QeEquDLEihrH7vuZLlJJ3egB12OD8fpZRgddUETZL yRWI41B7oQnqsMjQ3JmRyw6TLUxKwmBgjBmQhShaiSVQTFXRziWtQWOo+bR0lByPWyIDKT 2HlagAFDHqyqLMVh9YEKPf7SfrKw4/6v5Z7L4u6xKxPNxEdjLduXhDAr8L9hQw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WW1zs54FdzgsS; Fri, 26 Jul 2024 22:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QM6Hev036317; Fri, 26 Jul 2024 22:06:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QM6Hdw036316; Fri, 26 Jul 2024 22:06:17 GMT (envelope-from git) Date: Fri, 26 Jul 2024 22:06:17 GMT Message-Id: <202407262206.46QM6Hdw036316@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: 4df029cc74e5..ac9a064cb179 - vendor/llvm-project/main - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/vendor/llvm-project/main X-Git-Reftype: branch X-Git-Commit: ac9a064cb179f3425b310fa2847f8764ac970a4d X-Git-Oldrev: 4df029cc74e5ec124f14a5682e44999ce4f086df X-Git-Newrev: ac9a064cb179f3425b310fa2847f8764ac970a4d Auto-Submitted: auto-generated The branch vendor/llvm-project/main has been updated by dim: URL: https://cgit.FreeBSD.org/src/log/?id=4df029cc74e5..ac9a064cb179 ac9a064cb179 Vendor import of llvm-project main llvmorg-19-init-18630-gf2ccf80136a0, the last commit before the upstream release/19.x branch was created. From nobody Fri Jul 26 22:06:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WW1zt2rrdz5RRNN for ; Fri, 26 Jul 2024 22:06: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WW1zs6q4dz4mK7; Fri, 26 Jul 2024 22: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=1722031578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sRj9Km14stvb7Bou6wfDS2hucQTDT5xN3JnPi//K1zE=; b=hTXteA5+jCNU4pRRlBj+lkwRIq7bOlcJvcicx988ii+RUP52g8binyESGgPV9gFwsDFelS 3KLAKPrhC47whjTjI1Mt+4V81djALzW2/4yyL47ttYXvO7PPDJmRVUN/UsFhq8kB86gE9F VCV7Nj7i684HEFJNLA1ytSrhEf7ZzsRUcAdh0WJNHWjteWkfU+lWmob6M9W81u9ZXluQqO U22JeCEqb3az5rUQdlmuQIEyHrrEW/IofXxbGcFolTRwXQB7PuKqo17GF8lV8yxaScsJge UfCULJPl5QOUN9w+c0PMzlfN4M4UjquXAU2fvDRSOGlPT5OCdze8shJULDJJgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722031578; a=rsa-sha256; cv=none; b=Zp/ol2WZTJffvMEdY5BrljeP3gV4dbDe5qIhME5oYznqlroKa2GkZlAVqAYjy6tf0teG0c 4vyrNmUyDG1lR6mvOIaOV7Ir1E6YqcJqJOk++j2XwEBOqnm5QQDRcmYogOPebfXTdrvHjW P26FmR12CCXVtCxgX7a9TufNw7CmUmWkclmLLC2DNqH1O6DBOVHrmIGbp/H2lWGFJhk/og 7twgL96MyBaUbc1AU8fnf6KRlJ1dOTcYYeG03nQrAeAfvk4in88/852/NgIGENJjHLE85K puYbJlFXTS1nqMr/9mHqi+SXfglISKtRV4GtOn9G1yTBPF/21EAzqERiwDgK1Q== 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=1722031578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=sRj9Km14stvb7Bou6wfDS2hucQTDT5xN3JnPi//K1zE=; b=v+Am+tuJnCt1l98aNviLaBnbPL0TIzYMK7nxTcjZ04dS0Jdd+eS8dqZPAlRtAkn4EFcgoF 5PDSPwg7F4+zwHK+8dBZUPCCekxaBZeCIYHplQUbIKZn05IEUNmJdtXtZvG5g1hDGEi303 DjqULbidE7ELmLNuOrfKHhFS6HE5k9dnX/B1Ay30ioLG64Tjm6wbVG0o/kKtcxkdNfOoce 4udJ6mgbog3W/qYE5YAPMz0qRmUTnALdS4F0ZdjyeN73zuk9W6B/IkrXL5xRza9ebXlqK7 GY1IADepdeIlksRub9+VntpaUNbFcXGRufC7iqHRMimN+psY8pY7gVbvNzX7OQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WW1zs6QsdzgXs; Fri, 26 Jul 2024 22:06:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QM6HBb036336; Fri, 26 Jul 2024 22:06:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QM6HVg036335; Fri, 26 Jul 2024 22:06:17 GMT (envelope-from git) Date: Fri, 26 Jul 2024 22:06:17 GMT Message-Id: <202407262206.46QM6HVg036335@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: 65d5deb5ff47 - Create tag vendor/llvm-project/llvmorg-19-init-18630-gf2ccf80136a0 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/tags/vendor/llvm-project/llvmorg-19-init-18630-gf2ccf80136a0 X-Git-Reftype: annotated tag X-Git-Commit: 65d5deb5ff47be2580f894f416754c151c6a64b9 Auto-Submitted: auto-generated The annotated tag vendor/llvm-project/llvmorg-19-init-18630-gf2ccf80136a0 has been created by dim: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/llvm-project/llvmorg-19-init-18630-gf2ccf80136a0 tag vendor/llvm-project/llvmorg-19-init-18630-gf2ccf80136a0 Tagger: Dimitry Andric TaggerDate: 2024-07-26 22:04:40 +0000 Tag llvm-project main llvmorg-19-init-18630-gf2ccf80136a0, the last commit before the upstream release/19.x branch was created. commit ac9a064cb179f3425b310fa2847f8764ac970a4d Author: Dimitry Andric AuthorDate: 2024-07-26 22:04:10 +0000 Commit: Dimitry Andric CommitDate: 2024-07-26 22:04:10 +0000 Vendor import of llvm-project main llvmorg-19-init-18630-gf2ccf80136a0, the last commit before the upstream release/19.x branch was created. From nobody Fri Jul 26 22:08:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WW2274qQ2z5RS11 for ; Fri, 26 Jul 2024 22:08: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WW2274K2Rz4n30; Fri, 26 Jul 2024 22:08:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722031695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SacxhkgBRge7F/AO8fMHLF1+m5hpxN6aCCLTdvhft0E=; b=dpfaWa7dm1mrJpWOT5bg9RemNeKYqdTmI+rEoQkrDJP/5y91xHtCFDhdOoGVrrU2mgc9QJ qWB5Gi/iAm5lHlLEp7ibZXBvoh/RRVJE0Srpc+oe5vEGtpeY6qc8pZikLQHZoPrwcDoCPf ga0oGHlQkCqUKo7azgGGCV8a4i8RJLBAm1XGbPrw1ODOSY7DvkIDBUcv0Z9dHSklgA0+Zn I1UQxAf5+n+7giGjs+NOH5Athb70VBN8ZKAbWfGiIWVHVBd9XYPQ/suVH48sBj50ZLKi6I sCqN2iH012ncyXf8QK/I9d4OMdg6UIPBYIfZfQSRmFZeoO/Xiop70h+DRmryGQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722031695; a=rsa-sha256; cv=none; b=eBr7e4zrHEQpwNd2QznkRRHHsSFYZix+mki+ELKV3CUdFG/X400uajnxBcBTyUh6KIm92/ HxWbqGW68ZYWqsElFdmN366/GGYVfBl3HIsed4oNB57Rt7tjWK1ls2rZ8e4QxwnM0qArXV 56lJQmW88iHJldAmFjG5f7lwGnAgXVnZ9RRktKuLXitEVrjs5Zo/u4eedfKEeaSaTlqpNl JhGX4g9AUyF4/ThdFYLK8y5Z+lHB/fsLUNVcrprqDeB8uUf1LlZkx4sl+ayeH8A4jObGeS Xs/Hbkk6qSTWEVKzkj1qg4uEfHum7omUQXafCCMzhwES8haO/5bj7euvbaz5YA== 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=1722031695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SacxhkgBRge7F/AO8fMHLF1+m5hpxN6aCCLTdvhft0E=; b=UJOMF0BAG9FNX53/Trr9BtdShvt0vdj0HA/6Yl/Mu008VHqYkBFHFzo6HEl6okpYnAy/92 tQJd2eNyu2dMkNDGUqJsYzXx33genOHa+PjwelBWEi/QeuLQ+J9HAiaG9Zoz9gDSfkzEDN vhr1GMrv9SbgQV+sAjKn9iIeqcEUC9GO2GZMbFiwPOfatfYcvBIGozEajgoqWgIJ0fVdOY i93n94HuuPAZSQefjOK74XG4kuOabmHf6xFM3UZdwbHNCvFuTR+5n43PIPDel+Tbjvq7l+ /m8l/iqJDQJxHdfW7/3Ur7ko02i9NvcXB98p7XDLkGEJ14B/RMIXS7t1i+X/xQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WW2273VX8zgpr; Fri, 26 Jul 2024 22:08:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QM8FMF036704; Fri, 26 Jul 2024 22:08:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QM8Fi5036703; Fri, 26 Jul 2024 22:08:15 GMT (envelope-from git) Date: Fri, 26 Jul 2024 22:08:15 GMT Message-Id: <202407262208.46QM8Fi5036703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: ac9a064cb179 - vendor/llvm-project/release-19.x - vendor branch created List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/vendor/llvm-project/release-19.x X-Git-Reftype: branch X-Git-Commit: ac9a064cb179f3425b310fa2847f8764ac970a4d X-Git-Oldrev: 0000000000000000000000000000000000000000 X-Git-Newrev: ac9a064cb179f3425b310fa2847f8764ac970a4d Auto-Submitted: auto-generated The branch vendor/llvm-project/release-19.x has been created by dim: URL: https://cgit.FreeBSD.org/src/log/?id=ac9a064cb179 009b1c42aa62 Import LLVM, at r72732. ec2b103c267a Import Clang, at r72732. 33a8e4360f50 Import LLVM, at r72770. 922a2097733e Import Clang, at r72770. 68eb509bdc5c Import LLVM, at r72805, which fixes PR4315 and PR4316. 2659aeb5e51f Import Clang, at r72805. f4fe016fa15f Import LLVM, at r72995. 37f6c480c696 Import clang, at r72995. d2a7037439ec Import LLVM r73021. 70b4596d9d0d Import Clang r73021. 93338c197185 Import LLVM r73070. 8ba99c00327a Import Clang r73070. 600c6fa13de5 Import LLVM r73340. 7ef7bab7e3d0 Import Clang r73340. b2f21fb044b6 Update LLVM sources to r73879. b897c8660c4f Update Clang sources to r73879. 0408e1d309a7 Import LLVM r73954. d6aff018d446 Import Clang r73954. f76359690a70 Import LLVM r73984. f698f7e71940 Import Clang r73984. f859468f5a21 Import LLVM r74383. 4ebdf5c4f587 Import Clang r74383. 18f153bdb9db Import LLVM 74788. 5362a71c02e7 Import Clang r74788. 59850d087442 Update llvm to r84119. 4c8b24812ddc Update clang to r84119. 98781354c33b Update clang to 84175. 26137f35958f Update llvm to r84175. 5cd822fa9bbb Delete all stale files. a505eb93f43f Delete stale files. a5f348eb914e Delete some more files. 4a142eb28942 Update LLVM to r84949. 73490b890977 Update clang to r84949. bd3c9c2e3e89 These files does not belong here. f9666f9b3a3d This was removed upstream. 36bf506ad3c9 Update LLVM to r86025. 51fb8b013e77 Update clang to r86025. fc25e9aa5245 Delete this file. 72cc50852bec Update LLVM to r86140. 8f57cb030523 Update clang to r86140. 907da171cc91 Update LLVM to r89205. b3d5a323a5ca Update clang to r89205. 7d4538633051 Update LLVM to r89337. f5bd02d290ff Update clang to r89337. 76e2e0ebfdd3 Remove includes that were removed upstream. 06f9d4012fb8 Update LLVM to r90226. 1569ce68681d Update clang to r90226. 571945e6affd Update LLVM to 91430. 34d02d0b37f1 Update clang to 91430. 1e7804dbd25b Update LLVM to 92395. abe15e553e58 Updaet clang to 92395. 829000e035f4 Update LLVM to 93512. ee791dde723a Update clang to r93512. 989df958a10f Update LLVM to r94309. 5044f5c816ad Update clang to r94309. 6fe5c7aa327e Update LLVM to r96341. ecb7e5c8afe9 Update clang to r96341. 67a71b3184ce Update LLVM to 97654. 79ade4e02893 Update clang to 97654. f5a3459adfde Update LLVM to r97873. dd5132ce2569 Update clang to r97873. ea5b2dd11c05 Update LLVM to r98164. a16e9ac1f192 Update clang to r98164. c69102774f97 Update LLVM to r98631. 4a37f65f1c13 Update clang to r98631. 2f12f10af369 Update LLVM to r99115. c0c7bca4e5b8 Update clang to r99115. 104bd8179fb5 Update LLVM to r100181. 11d2b2d2bb70 Update clang to r100181. b5efedaf2ab2 Update LLVM to r100285. 2c56c396ce59 Update clang to r100285. 9f4a1da9a0a5 Update LLVM to r100520. 60bfabcd8ce6 Update clang to r100520. d7f7719e5e08 Update LLVM to r103004. 0883ccd9eac3 Update clang to r103004. 59161dfae322 Update LLVM to r103052. be17651f5cd2 Update clang to r103052. abdf259d4871 Update LLVM to r104832. d7279c4c177b Update clang to r104832. 66e41e3c6e8b Update LLVM to r108243. 4ba675006b5a Update clang to r108243. *** 511 LINES SKIPPED *** From nobody Fri Jul 26 22:13:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WW28B2yHmz5RSGq for ; Fri, 26 Jul 2024 22:13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WW28B2T8Zz4nP8; Fri, 26 Jul 2024 22:13:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722032010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IpZfsF2LQJYv1NFFakbLwZ/2TUE5jblVNrCd7HW+AWU=; b=xllaFWLbq/aFCKen5rNobqexizd7zZal9L8C2X0qe00PYrzoYtq3WPqPeYutgLZTQCltuy lkMVsCHRau4QH+kmrYdDwTJIoHbZez7mKRN6QUbkkuFkUtaYPcCbBmdBu/M/zkHIv9fULi MHySf++seFbSJ2nETNsr83Yw+8zNy4uY922ySPw2ZvDM4SzGGg5qvp/Me4K09xFSjdC+de 5amXlvtN1dvAzZCrD8suVXF6GQe4yEqlrFb1T7/I7WJY4/V3KlaI+am9QcHVCOri0JIgbm ewplHcRMc5rOILo9JoeAVAAN/AV2mK2mE/oGOmGm8gN0oZyIKd7UA8fTqJZawg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722032010; a=rsa-sha256; cv=none; b=yJmAoqkuE7cLLDXbgwcEL8qhZK7x81enJ3bpREjo5A05d6d8vBN4RzX3nQdGG0CY31lY5J NHhbpFS5V8sw/EQUVn3sIgpv057fJ3lKORH5f9uOwe2d1C3d3ndQ2pBgCo/BOj/dORx9K6 yoRbfkq//2ESX+k7SdcX1Y+Msj3amMhuxb/D2dJxkNqrIDkXT4UFTMSciK0VZ1XJhWv0A1 YaRG2S+poESqTjB46/BGOcoktFk9Xh9jB4wvcklRlLmGq92VAapZA49cnmZQb0CIKdCLFk XgGoHdzRVpUae5CcU1iZEQ7Jlie1g+Vc+gGLGrTGcnb0ivTd3JwPIR5qKCM7Ug== 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=1722032010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IpZfsF2LQJYv1NFFakbLwZ/2TUE5jblVNrCd7HW+AWU=; b=kY0mwVp6ZuGktARccmpOJUVQfXvQtePAPbk3MzF5Is2YDZ0CGp8H+6ja9obgefqfi75l1K NtOiDvoB6iuSLpBhRQBE0HgLCj1gkSChWbs9n/9+f9y1LP5bP5lrDnj0D/Ip2fWoZMZCP6 mgOiyifjalLyoCf+Yplc7lT4yQUJL/KA80AwxEmNCQjEScOq1W62hxI91UnaOpicoHh9AH HRyXPEXLg3KF0wa5adfnA7Ipo3d/s59x2p/n70ifYtSnxZjOV4G0jLw38QU/Z2iS0kFLnD Gh3TdJIWQuYyLwXAms5LueZZ81UChBo17JeivxtHzRpgPsXoiSbdWQLD31CSHg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WW28B24hqzhDQ; Fri, 26 Jul 2024 22:13:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QMDUtF052397; Fri, 26 Jul 2024 22:13:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QMDUfl052396; Fri, 26 Jul 2024 22:13:30 GMT (envelope-from git) Date: Fri, 26 Jul 2024 22:13:30 GMT Message-Id: <202407262213.46QMDUfl052396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: 40d7365d8073 - Create tag vendor/llvm-project/llvmorg-19.1.0-rc1-0-ga4902a36d5c2 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/tags/vendor/llvm-project/llvmorg-19.1.0-rc1-0-ga4902a36d5c2 X-Git-Reftype: annotated tag X-Git-Commit: 40d7365d80738f2a7f26a9c6a0f6f502ac57bde6 Auto-Submitted: auto-generated The annotated tag vendor/llvm-project/llvmorg-19.1.0-rc1-0-ga4902a36d5c2 has been created by dim: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/llvm-project/llvmorg-19.1.0-rc1-0-ga4902a36d5c2 tag vendor/llvm-project/llvmorg-19.1.0-rc1-0-ga4902a36d5c2 Tagger: Dimitry Andric TaggerDate: 2024-07-26 22:13:02 +0000 Vendor import of llvm-project branch release/19.x llvmorg-19.1.0-rc1-0-ga4902a36d5c2. commit c76260f306a7e51ef52dc75c6031e51e1e0862d7 Author: Dimitry Andric AuthorDate: 2024-07-26 22:12:49 +0000 Commit: Dimitry Andric CommitDate: 2024-07-26 22:12:49 +0000 Vendor import of llvm-project branch release/19.x llvmorg-19.1.0-rc1-0-ga4902a36d5c2. From nobody Fri Jul 26 22:13:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WW28B2yzNz5RSX9 for ; Fri, 26 Jul 2024 22:13: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WW28B2QCjz4nty; Fri, 26 Jul 2024 22:13:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722032010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cuZoeJkh99ODrCjNLft6KANuCTdEcCny7AZ/XPwUeZ8=; b=iZHs5KxSpw3uJBf11t9ge2xlAUEl7FM+XTVlNh1u+MiwpoCy4obZyYdot6lKKLJL5Nw2BH KAMQF/sl9HiWDMKkVKR0dPgk1EiLko6BHKDBDniba82Ht68TblX0dn3YmhkDVJplJuavCF YF/b7AkObvX39sC2/xCxUwQ1Fze1NPPW37RfgrKPa1XiUi7QgRluU+Fc2FOPOSFYG9sJqH 6b58vUsq38I6o4NQEDGBuwPVqMjDpvX6PHBULjEC2hzaAJnBOZftygn1VZsULE8YwiWvo+ P4zAVwEe1+er/NIte7swFm6oGjdCwew7J8f+zqFoG0Iz9ngE4ZM63j2eEgo9rw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722032010; a=rsa-sha256; cv=none; b=bAJnb1s57yGcLPu32E+5VNCC5zExBPaMFKRAX2vQZfkNtSep4NcbkaKXeJf+59YzZK7kAC R2HQLfX3sBOpQ+S6L+mnhGp2pUgFw2M+vfunjWNxn1gw0RkM38DQGnp3CGHhVcYWUb3a/n WsMLe/yBhAiQpnGE0g0Xf1qRqp5K1C8tQ8FvgFPYIaWasOZ+NBGyzbrs9VHLmNrfMQHEsQ LYTa1bibsmdmkSZTOjceSJ5aIT+P4Zpm8Zoui+key5pQtiloNMjyrlj6LucmBMxZM1mqjm pjbMOqOIHN+98BYQayatuOzYey3gHl6JTLHNok9Hv9IUffVswHUx8U79JtCZ8A== 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=1722032010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cuZoeJkh99ODrCjNLft6KANuCTdEcCny7AZ/XPwUeZ8=; b=Rt/p+6eeXjmpsFjm7Ml/CPPDOJDhaNKnQ0+BgSchLnnKV0vc70FIpAtlMA0AuMXG8cDjrs HhSyljNIVdPg5vASNgnVlNlaDOpUZrKlAqqwzdAUTtfWVjG6Xnu69xemgamDIz/9cM+4vQ s32twUbBdPMpiEdHkwS8dpZxqCZVN2aexRJ2NibUNbmBW0m23cZ05xWy7c90ez/Cv8LyFr IgnBUU7p57r3pdpM/UNXDEx8gg+s0IInd8rDf7I4gTfcfio/kGY9OswadyhePljSVLRRlG GfDxKfqdmj8mjA4NXUxDhlOefpdn0qDzdzSZ8wZ5eo18R7Go4MUwxCWahY8ItQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WW28B1dbCzhM3; Fri, 26 Jul 2024 22:13:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QMDUSx052376; Fri, 26 Jul 2024 22:13:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QMDUFo052375; Fri, 26 Jul 2024 22:13:30 GMT (envelope-from git) Date: Fri, 26 Jul 2024 22:13:30 GMT Message-Id: <202407262213.46QMDUFo052375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: ac9a064cb179..c76260f306a7 - vendor/llvm-project/release-19.x - vendor branch updated List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/vendor/llvm-project/release-19.x X-Git-Reftype: branch X-Git-Commit: c76260f306a7e51ef52dc75c6031e51e1e0862d7 X-Git-Oldrev: ac9a064cb179f3425b310fa2847f8764ac970a4d X-Git-Newrev: c76260f306a7e51ef52dc75c6031e51e1e0862d7 Auto-Submitted: auto-generated The branch vendor/llvm-project/release-19.x has been updated by dim: URL: https://cgit.FreeBSD.org/src/log/?id=ac9a064cb179..c76260f306a7 c76260f306a7 Vendor import of llvm-project branch release/19.x llvmorg-19.1.0-rc1-0-ga4902a36d5c2. From nobody Fri Jul 26 23:26:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WW3mS2hp4z5RYvS; Fri, 26 Jul 2024 23:26: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WW3mS1VtTz4vQs; Fri, 26 Jul 2024 23:26:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722036392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zEKwdaEVY5VaVgBxWzRb0B2xYoVgFQNt2cEf3e9ssjs=; b=nOIxAB3Oyjl0FBzX8X1wPnNyYSvIVwdV10sQPcIegOdqlboI2pMIOVCl1oKEV2J3nJook9 LzqoewYSqw3Zz+k79ub1lp2TA/qmN5CV9py4wObYlOtV6t0NbV+FQ8zC9eyL1kC3o2Tg1d Y82vYhCK7wBVn3SVuceaOP19ZbTAnqgkxTuvnY0USl+rLjmsUhJw8ASmlAv/fMxRV6g70I PYWD67tgZSNVi+vQhCs5I2emup6qvikGBABVHOTqjbv0pzo528nCO3dTj/Y/fJZWg0+DeY +C6HG5NtrVZVu//eCq/vUZvpmpIMRg4e0ZmLkruqXKKmvwnNz7ytQpTWTxc2sw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722036392; a=rsa-sha256; cv=none; b=fcRz+nDuELredfZDbptV0vMljPp2USb28lB4RHMkDpKWe3ghGV4/4ZRzD54VCmte+DJtx5 dZZQ36Dj/561l0MWQqWJtrbQWS2c5GDFYkfpNrU1+QNCL1Ck1aKEBTDo3WhMQz7S2Nhr3+ a0HJb9tnjDRE9f+i57WpEXNkdwmPB9OkkphpHPLsY0xA0cizSX5O4OhAL/+otHq5WxXvK/ 8QcaGP0uB7YPl5JtMCICZ7pO+CFu5j24W0G5QtzNzRzfEaTfa3/jLymwbJQkLTFYXdmNy0 VAb0W4EVgqZj++7dgL7f0ggV6mZsnF0GqjAaXDS5rHwuaEEES3IpTvv+dkNx3Q== 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=1722036392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zEKwdaEVY5VaVgBxWzRb0B2xYoVgFQNt2cEf3e9ssjs=; b=SuawbL9OLkFUA/fYpc/pFTeqUMtr8oEcMfmIWll0NlMPNOmjcHD59kAjFcAkbZaFUGywJl aEdMheuKGM5TKq3NEMg5c1sJvA1hSarVIeLELzdKg7O32xrf4UXsqC2MAPnWVeYAwgl6rk 14qnqyxCq3TYfToatUpFl1q4RJSef62RbtiyORf/H4kD/pAEw5AigdaVNY6SE2E1LTgmau /20xt7XqXy9UqqBWHFgaYIa2DUPnmeoisgMBJ9GFm0w7n6DtJZtjCBmUhBFssa9lvrlva3 Z0OD/DwnA+uo0oIeD/Jjzl78xyv+q6KLk5sE99jj06mHYXcz85b9fro2iP/4bQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WW3mS160JzjVw; Fri, 26 Jul 2024 23:26:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46QNQWpo070868; Fri, 26 Jul 2024 23:26:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46QNQWBv070865; Fri, 26 Jul 2024 23:26:32 GMT (envelope-from git) Date: Fri, 26 Jul 2024 23:26:32 GMT Message-Id: <202407262326.46QNQWBv070865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 56ecc8a93221 - main - pci_user: Rename _old to _freebsd6 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 56ecc8a93221c16b6ea15d3dbea706a2c8bb33b4 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=56ecc8a93221c16b6ea15d3dbea706a2c8bb33b4 commit 56ecc8a93221c16b6ea15d3dbea706a2c8bb33b4 Author: Warner Losh AuthorDate: 2024-07-26 23:20:44 +0000 Commit: Warner Losh CommitDate: 2024-07-26 23:21:22 +0000 pci_user: Rename _old to _freebsd6 The pre-freebsd7 stuff is labeled _old right now. Relabel it as _freebsd6 instead. No functional change intended. I selected freebsd6 because that's the last version to have the ioctls, although I know there were changes in the interface for 4, 5 and 6. This broadly batches what we do with system calls that accumulate changes until we break and use a new one, we use the last major the system call was in. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D45867 --- sys/dev/pci/pci_user.c | 184 ++++++++++++++++++++++++------------------------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/sys/dev/pci/pci_user.c b/sys/dev/pci/pci_user.c index cdb893efa950..aedf3409fc6e 100644 --- a/sys/dev/pci/pci_user.c +++ b/sys/dev/pci/pci_user.c @@ -287,25 +287,25 @@ pci_conf_match32(struct pci_match_conf32 *matches, int num_matches, #define PRE7_COMPAT typedef enum { - PCI_GETCONF_NO_MATCH_OLD = 0x00, - PCI_GETCONF_MATCH_BUS_OLD = 0x01, - PCI_GETCONF_MATCH_DEV_OLD = 0x02, - PCI_GETCONF_MATCH_FUNC_OLD = 0x04, - PCI_GETCONF_MATCH_NAME_OLD = 0x08, - PCI_GETCONF_MATCH_UNIT_OLD = 0x10, - PCI_GETCONF_MATCH_VENDOR_OLD = 0x20, - PCI_GETCONF_MATCH_DEVICE_OLD = 0x40, - PCI_GETCONF_MATCH_CLASS_OLD = 0x80 -} pci_getconf_flags_old; - -struct pcisel_old { + PCI_GETCONF_NO_MATCH_FREEBSD6 = 0x00, + PCI_GETCONF_MATCH_BUS_FREEBSD6 = 0x01, + PCI_GETCONF_MATCH_DEV_FREEBSD6 = 0x02, + PCI_GETCONF_MATCH_FUNC_FREEBSD6 = 0x04, + PCI_GETCONF_MATCH_NAME_FREEBSD6 = 0x08, + PCI_GETCONF_MATCH_UNIT_FREEBSD6 = 0x10, + PCI_GETCONF_MATCH_VENDOR_FREEBSD6 = 0x20, + PCI_GETCONF_MATCH_DEVICE_FREEBSD6 = 0x40, + PCI_GETCONF_MATCH_CLASS_FREEBSD6 = 0x80 +} pci_getconf_flags_freebsd6; + +struct pcisel_freebsd6 { u_int8_t pc_bus; /* bus number */ u_int8_t pc_dev; /* device on this bus */ u_int8_t pc_func; /* function on this device */ }; -struct pci_conf_old { - struct pcisel_old pc_sel; /* bus+slot+function */ +struct pci_conf_freebsd6 { + struct pcisel_freebsd6 pc_sel; /* bus+slot+function */ u_int8_t pc_hdr; /* PCI header type */ u_int16_t pc_subvendor; /* card vendor ID */ u_int16_t pc_subdevice; /* card device ID, assigned by @@ -321,26 +321,26 @@ struct pci_conf_old { u_long pd_unit; /* device unit number */ }; -struct pci_match_conf_old { - struct pcisel_old pc_sel; /* bus+slot+function */ +struct pci_match_conf_freebsd6 { + struct pcisel_freebsd6 pc_sel; /* bus+slot+function */ char pd_name[PCI_MAXNAMELEN + 1]; /* device name */ u_long pd_unit; /* Unit number */ u_int16_t pc_vendor; /* PCI Vendor ID */ u_int16_t pc_device; /* PCI Device ID */ u_int8_t pc_class; /* PCI class */ - pci_getconf_flags_old flags; /* Matching expression */ + pci_getconf_flags_freebsd6 flags; /* Matching expression */ }; -struct pci_io_old { - struct pcisel_old pi_sel; /* device to operate on */ +struct pci_io_freebsd6 { + struct pcisel_freebsd6 pi_sel; /* device to operate on */ int pi_reg; /* configuration register to examine */ int pi_width; /* width (in bytes) of read or write */ u_int32_t pi_data; /* data to write or result of read */ }; #ifdef COMPAT_FREEBSD32 -struct pci_conf_old32 { - struct pcisel_old pc_sel; /* bus+slot+function */ +struct pci_conf_freebsd6_32 { + struct pcisel_freebsd6 pc_sel; /* bus+slot+function */ uint8_t pc_hdr; /* PCI header type */ uint16_t pc_subvendor; /* card vendor ID */ uint16_t pc_subdevice; /* card device ID, assigned by @@ -356,25 +356,25 @@ struct pci_conf_old32 { uint32_t pd_unit; /* device unit number (u_long) */ }; -struct pci_match_conf_old32 { - struct pcisel_old pc_sel; /* bus+slot+function */ +struct pci_match_conf_freebsd6_32 { + struct pcisel_freebsd6 pc_sel; /* bus+slot+function */ char pd_name[PCI_MAXNAMELEN + 1]; /* device name */ uint32_t pd_unit; /* Unit number (u_long) */ uint16_t pc_vendor; /* PCI Vendor ID */ uint16_t pc_device; /* PCI Device ID */ uint8_t pc_class; /* PCI class */ - pci_getconf_flags_old flags; /* Matching expression */ + pci_getconf_flags_freebsd6 flags; /* Matching expression */ }; -#define PCIOCGETCONF_OLD32 _IOWR('p', 1, struct pci_conf_io32) +#define PCIOCGETCONF_FREEBSD6_32 _IOWR('p', 1, struct pci_conf_io32) #endif /* COMPAT_FREEBSD32 */ -#define PCIOCGETCONF_OLD _IOWR('p', 1, struct pci_conf_io) -#define PCIOCREAD_OLD _IOWR('p', 2, struct pci_io_old) -#define PCIOCWRITE_OLD _IOWR('p', 3, struct pci_io_old) +#define PCIOCGETCONF_FREEBSD6 _IOWR('p', 1, struct pci_conf_io) +#define PCIOCREAD_FREEBSD6 _IOWR('p', 2, struct pci_io_freebsd6) +#define PCIOCWRITE_FREEBSD6 _IOWR('p', 3, struct pci_io_freebsd6) static int -pci_conf_match_old(struct pci_match_conf_old *matches, int num_matches, +pci_conf_match_freebsd6(struct pci_match_conf_freebsd6 *matches, int num_matches, struct pci_conf *match_buf) { int i; @@ -389,7 +389,7 @@ pci_conf_match_old(struct pci_match_conf_old *matches, int num_matches, /* * I'm not sure why someone would do this...but... */ - if (matches[i].flags == PCI_GETCONF_NO_MATCH_OLD) + if (matches[i].flags == PCI_GETCONF_NO_MATCH_FREEBSD6) continue; /* @@ -397,35 +397,35 @@ pci_conf_match_old(struct pci_match_conf_old *matches, int num_matches, * comparison. If the comparison fails, we don't have a * match, go on to the next item if there is one. */ - if (((matches[i].flags & PCI_GETCONF_MATCH_BUS_OLD) != 0) + if (((matches[i].flags & PCI_GETCONF_MATCH_BUS_FREEBSD6) != 0) && (match_buf->pc_sel.pc_bus != matches[i].pc_sel.pc_bus)) continue; - if (((matches[i].flags & PCI_GETCONF_MATCH_DEV_OLD) != 0) + if (((matches[i].flags & PCI_GETCONF_MATCH_DEV_FREEBSD6) != 0) && (match_buf->pc_sel.pc_dev != matches[i].pc_sel.pc_dev)) continue; - if (((matches[i].flags & PCI_GETCONF_MATCH_FUNC_OLD) != 0) + if (((matches[i].flags & PCI_GETCONF_MATCH_FUNC_FREEBSD6) != 0) && (match_buf->pc_sel.pc_func != matches[i].pc_sel.pc_func)) continue; - if (((matches[i].flags & PCI_GETCONF_MATCH_VENDOR_OLD) != 0) + if (((matches[i].flags & PCI_GETCONF_MATCH_VENDOR_FREEBSD6) != 0) && (match_buf->pc_vendor != matches[i].pc_vendor)) continue; - if (((matches[i].flags & PCI_GETCONF_MATCH_DEVICE_OLD) != 0) + if (((matches[i].flags & PCI_GETCONF_MATCH_DEVICE_FREEBSD6) != 0) && (match_buf->pc_device != matches[i].pc_device)) continue; - if (((matches[i].flags & PCI_GETCONF_MATCH_CLASS_OLD) != 0) + if (((matches[i].flags & PCI_GETCONF_MATCH_CLASS_FREEBSD6) != 0) && (match_buf->pc_class != matches[i].pc_class)) continue; - if (((matches[i].flags & PCI_GETCONF_MATCH_UNIT_OLD) != 0) + if (((matches[i].flags & PCI_GETCONF_MATCH_UNIT_FREEBSD6) != 0) && (match_buf->pd_unit != matches[i].pd_unit)) continue; - if (((matches[i].flags & PCI_GETCONF_MATCH_NAME_OLD) != 0) + if (((matches[i].flags & PCI_GETCONF_MATCH_NAME_FREEBSD6) != 0) && (strncmp(matches[i].pd_name, match_buf->pd_name, sizeof(match_buf->pd_name)) != 0)) continue; @@ -438,7 +438,7 @@ pci_conf_match_old(struct pci_match_conf_old *matches, int num_matches, #ifdef COMPAT_FREEBSD32 static int -pci_conf_match_old32(struct pci_match_conf_old32 *matches, int num_matches, +pci_conf_match_freebsd6_32(struct pci_match_conf_freebsd6_32 *matches, int num_matches, struct pci_conf *match_buf) { int i; @@ -453,7 +453,7 @@ pci_conf_match_old32(struct pci_match_conf_old32 *matches, int num_matches, /* * I'm not sure why someone would do this...but... */ - if (matches[i].flags == PCI_GETCONF_NO_MATCH_OLD) + if (matches[i].flags == PCI_GETCONF_NO_MATCH_FREEBSD6) continue; /* @@ -461,35 +461,35 @@ pci_conf_match_old32(struct pci_match_conf_old32 *matches, int num_matches, * comparison. If the comparison fails, we don't have a * match, go on to the next item if there is one. */ - if (((matches[i].flags & PCI_GETCONF_MATCH_BUS_OLD) != 0) && + if (((matches[i].flags & PCI_GETCONF_MATCH_BUS_FREEBSD6) != 0) && (match_buf->pc_sel.pc_bus != matches[i].pc_sel.pc_bus)) continue; - if (((matches[i].flags & PCI_GETCONF_MATCH_DEV_OLD) != 0) && + if (((matches[i].flags & PCI_GETCONF_MATCH_DEV_FREEBSD6) != 0) && (match_buf->pc_sel.pc_dev != matches[i].pc_sel.pc_dev)) continue; - if (((matches[i].flags & PCI_GETCONF_MATCH_FUNC_OLD) != 0) && + if (((matches[i].flags & PCI_GETCONF_MATCH_FUNC_FREEBSD6) != 0) && (match_buf->pc_sel.pc_func != matches[i].pc_sel.pc_func)) continue; - if (((matches[i].flags & PCI_GETCONF_MATCH_VENDOR_OLD) != 0) && + if (((matches[i].flags & PCI_GETCONF_MATCH_VENDOR_FREEBSD6) != 0) && (match_buf->pc_vendor != matches[i].pc_vendor)) continue; - if (((matches[i].flags & PCI_GETCONF_MATCH_DEVICE_OLD) != 0) && + if (((matches[i].flags & PCI_GETCONF_MATCH_DEVICE_FREEBSD6) != 0) && (match_buf->pc_device != matches[i].pc_device)) continue; - if (((matches[i].flags & PCI_GETCONF_MATCH_CLASS_OLD) != 0) && + if (((matches[i].flags & PCI_GETCONF_MATCH_CLASS_FREEBSD6) != 0) && (match_buf->pc_class != matches[i].pc_class)) continue; - if (((matches[i].flags & PCI_GETCONF_MATCH_UNIT_OLD) != 0) && + if (((matches[i].flags & PCI_GETCONF_MATCH_UNIT_FREEBSD6) != 0) && ((u_int32_t)match_buf->pd_unit != matches[i].pd_unit)) continue; - if (((matches[i].flags & PCI_GETCONF_MATCH_NAME_OLD) != 0) && + if (((matches[i].flags & PCI_GETCONF_MATCH_NAME_FREEBSD6) != 0) && (strncmp(matches[i].pd_name, match_buf->pd_name, sizeof(match_buf->pd_name)) != 0)) continue; @@ -503,14 +503,14 @@ pci_conf_match_old32(struct pci_match_conf_old32 *matches, int num_matches, #endif /* !PRE7_COMPAT */ union pci_conf_union { - struct pci_conf pc; + struct pci_conf pc; #ifdef COMPAT_FREEBSD32 - struct pci_conf32 pc32; + struct pci_conf32 pc32; #endif #ifdef PRE7_COMPAT - struct pci_conf_old pco; + struct pci_conf_freebsd6 pco; #ifdef COMPAT_FREEBSD32 - struct pci_conf_old32 pco32; + struct pci_conf_freebsd6_32 pco32; #endif #endif }; @@ -530,14 +530,14 @@ pci_conf_match(u_long cmd, struct pci_match_conf *matches, int num_matches, num_matches, match_buf)); #endif #ifdef PRE7_COMPAT - case PCIOCGETCONF_OLD: - return (pci_conf_match_old( - (struct pci_match_conf_old *)matches, num_matches, + case PCIOCGETCONF_FREEBSD6: + return (pci_conf_match_freebsd6( + (struct pci_match_conf_freebsd6 *)matches, num_matches, match_buf)); #ifdef COMPAT_FREEBSD32 - case PCIOCGETCONF_OLD32: - return (pci_conf_match_old32( - (struct pci_match_conf_old32 *)matches, num_matches, + case PCIOCGETCONF_FREEBSD6_32: + return (pci_conf_match_freebsd6_32( + (struct pci_match_conf_freebsd6_32 *)matches, num_matches, match_buf)); #endif #endif @@ -651,11 +651,11 @@ pci_match_conf_size(u_long cmd) return (sizeof(struct pci_match_conf32)); #endif #ifdef PRE7_COMPAT - case PCIOCGETCONF_OLD: - return (sizeof(struct pci_match_conf_old)); + case PCIOCGETCONF_FREEBSD6: + return (sizeof(struct pci_match_conf_freebsd6)); #ifdef COMPAT_FREEBSD32 - case PCIOCGETCONF_OLD32: - return (sizeof(struct pci_match_conf_old32)); + case PCIOCGETCONF_FREEBSD6_32: + return (sizeof(struct pci_match_conf_freebsd6_32)); #endif #endif default: @@ -676,11 +676,11 @@ pci_conf_size(u_long cmd) return (sizeof(struct pci_conf32)); #endif #ifdef PRE7_COMPAT - case PCIOCGETCONF_OLD: - return (sizeof(struct pci_conf_old)); + case PCIOCGETCONF_FREEBSD6: + return (sizeof(struct pci_conf_freebsd6)); #ifdef COMPAT_FREEBSD32 - case PCIOCGETCONF_OLD32: - return (sizeof(struct pci_conf_old32)); + case PCIOCGETCONF_FREEBSD6_32: + return (sizeof(struct pci_conf_freebsd6_32)); #endif #endif default: @@ -699,7 +699,7 @@ pci_conf_io_init(struct pci_conf_io *cio, caddr_t data, u_long cmd) switch (cmd) { case PCIOCGETCONF: #ifdef PRE7_COMPAT - case PCIOCGETCONF_OLD: + case PCIOCGETCONF_FREEBSD6: #endif *cio = *(struct pci_conf_io *)data; return; @@ -707,7 +707,7 @@ pci_conf_io_init(struct pci_conf_io *cio, caddr_t data, u_long cmd) #ifdef COMPAT_FREEBSD32 case PCIOCGETCONF32: #ifdef PRE7_COMPAT - case PCIOCGETCONF_OLD32: + case PCIOCGETCONF_FREEBSD6_32: #endif cio32 = (struct pci_conf_io32 *)data; cio->pat_buf_len = cio32->pat_buf_len; @@ -740,7 +740,7 @@ pci_conf_io_update_data(const struct pci_conf_io *cio, caddr_t data, switch (cmd) { case PCIOCGETCONF: #ifdef PRE7_COMPAT - case PCIOCGETCONF_OLD: + case PCIOCGETCONF_FREEBSD6: #endif d_cio = (struct pci_conf_io *)data; d_cio->status = cio->status; @@ -752,7 +752,7 @@ pci_conf_io_update_data(const struct pci_conf_io *cio, caddr_t data, #ifdef COMPAT_FREEBSD32 case PCIOCGETCONF32: #ifdef PRE7_COMPAT - case PCIOCGETCONF_OLD32: + case PCIOCGETCONF_FREEBSD6_32: #endif cio32 = (struct pci_conf_io32 *)data; @@ -801,7 +801,7 @@ pci_conf_for_copyout(const struct pci_conf *pcp, union pci_conf_union *pcup, #ifdef PRE7_COMPAT #ifdef COMPAT_FREEBSD32 - case PCIOCGETCONF_OLD32: + case PCIOCGETCONF_FREEBSD6_32: pcup->pco32.pc_sel.pc_bus = pcp->pc_sel.pc_bus; pcup->pco32.pc_sel.pc_dev = pcp->pc_sel.pc_dev; pcup->pco32.pc_sel.pc_func = pcp->pc_sel.pc_func; @@ -820,7 +820,7 @@ pci_conf_for_copyout(const struct pci_conf *pcp, union pci_conf_union *pcup, return; #endif /* COMPAT_FREEBSD32 */ - case PCIOCGETCONF_OLD: + case PCIOCGETCONF_FREEBSD6: pcup->pco.pc_sel.pc_bus = pcp->pc_sel.pc_bus; pcup->pco.pc_sel.pc_dev = pcp->pc_sel.pc_dev; pcup->pco.pc_sel.pc_func = pcp->pc_sel.pc_func; @@ -1028,9 +1028,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t union pci_conf_union pcu; #ifdef PRE7_COMPAT struct pci_io iodata; - struct pci_io_old *io_old; + struct pci_io_freebsd6 *io_freebsd6; - io_old = NULL; + io_freebsd6 = NULL; #endif /* @@ -1045,9 +1045,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t case PCIOCGETCONF32: #endif #ifdef PRE7_COMPAT - case PCIOCGETCONF_OLD: + case PCIOCGETCONF_FREEBSD6: #ifdef COMPAT_FREEBSD32 - case PCIOCGETCONF_OLD32: + case PCIOCGETCONF_FREEBSD6_32: #endif #endif case PCIOCGETBAR: @@ -1070,9 +1070,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t case PCIOCGETCONF32: #endif #ifdef PRE7_COMPAT - case PCIOCGETCONF_OLD: + case PCIOCGETCONF_FREEBSD6: #ifdef COMPAT_FREEBSD32 - case PCIOCGETCONF_OLD32: + case PCIOCGETCONF_FREEBSD6_32: #endif #endif cio = malloc(sizeof(struct pci_conf_io), M_TEMP, @@ -1258,16 +1258,16 @@ getconfexit: break; #ifdef PRE7_COMPAT - case PCIOCREAD_OLD: - case PCIOCWRITE_OLD: - io_old = (struct pci_io_old *)data; + case PCIOCREAD_FREEBSD6: + case PCIOCWRITE_FREEBSD6: + io_freebsd6 = (struct pci_io_freebsd6 *)data; iodata.pi_sel.pc_domain = 0; - iodata.pi_sel.pc_bus = io_old->pi_sel.pc_bus; - iodata.pi_sel.pc_dev = io_old->pi_sel.pc_dev; - iodata.pi_sel.pc_func = io_old->pi_sel.pc_func; - iodata.pi_reg = io_old->pi_reg; - iodata.pi_width = io_old->pi_width; - iodata.pi_data = io_old->pi_data; + iodata.pi_sel.pc_bus = io_freebsd6->pi_sel.pc_bus; + iodata.pi_sel.pc_dev = io_freebsd6->pi_sel.pc_dev; + iodata.pi_sel.pc_func = io_freebsd6->pi_sel.pc_func; + iodata.pi_reg = io_freebsd6->pi_reg; + iodata.pi_width = io_freebsd6->pi_width; + iodata.pi_data = io_freebsd6->pi_data; data = (caddr_t)&iodata; /* FALLTHROUGH */ #endif @@ -1295,7 +1295,7 @@ getconfexit: io->pi_sel.pc_func); if (pcidev) { #ifdef PRE7_COMPAT - if (cmd == PCIOCWRITE || cmd == PCIOCWRITE_OLD) + if (cmd == PCIOCWRITE || cmd == PCIOCWRITE_FREEBSD6) #else if (cmd == PCIOCWRITE) #endif @@ -1304,8 +1304,8 @@ getconfexit: io->pi_data, io->pi_width); #ifdef PRE7_COMPAT - else if (cmd == PCIOCREAD_OLD) - io_old->pi_data = + else if (cmd == PCIOCREAD_FREEBSD6) + io_freebsd6->pi_data = pci_read_config(pcidev, io->pi_reg, io->pi_width); @@ -1318,8 +1318,8 @@ getconfexit: error = 0; } else { #ifdef COMPAT_FREEBSD4 - if (cmd == PCIOCREAD_OLD) { - io_old->pi_data = -1; + if (cmd == PCIOCREAD_FREEBSD6) { + io_freebsd6->pi_data = -1; error = 0; } else #endif From nobody Sat Jul 27 11:56:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPV2lHVz5S6FC; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPV25M8z42kP; Sat, 27 Jul 2024 11:56:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GDIzzkrTPDlZxsA+7fybgnSk856rsRq15hwWaPMoYxw=; b=RVENF3BRZgrdjutsNhRUMRT3p9N0ZIfz8EtdhO7qlVffraSUemS65FNr4W/QojqUyezZMn CzBkvT0tl1be6l+ECmzKP/FnEGXIaWOjtEqNOHfcv33QLbrjkkq24+MGbjvOqA7FfTzqrH 5WCgPSit3qLuIcJpF6X3ddCmEXettH/nBbstsrM+2kBhSTuBN+Y0/NZ5PcOKYxkNNwPuub HYzvTFRdXUfvAOMFTRzCAtzLrvvmOjLfrjxFLCiNCJNdANonbcWlNwDzbSJh46JXpokugo BHEqYw+MpNA+5MmXDoOx8P2+J1Jeyy5CZ5OcrUhPxqTLpyP+qko1QRyMDTzHrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081374; a=rsa-sha256; cv=none; b=O4XKlUvEkoVYhNlQvboSF0WibXG8ZcWC2ZSOgvzpa5dnQQUiBMrfdJj6CVQ5+3Hf5QtkY4 GfDF5YmzfBAAwYEAJ+HNEs0tRab3pLg49uRSBvEfik/7Z6vmuY+1D6WsCKbNA+j/XhBTgO +9N1qPndqRrAtEhgKx2cT82gsON9Z0XwXtR5ljscVMkbJ0j77ErnO9Ld0RFjWnaq96IMaM K5E6UPRmsFmDfXoUPbuDbZ+mtYerYbu5TP0P1MDNclQYtzYLpl2FbRjJegHc/a0mJiIDjk EhVu7zk367c/078Q5KhQ3cVXtPcQCFLMIWqa9LodTxIJDkl1KamDDP5SmtJlug== 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=1722081374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GDIzzkrTPDlZxsA+7fybgnSk856rsRq15hwWaPMoYxw=; b=EvkOjG6czBtMRkotmWd0E9j1nQrq6GKn7SSeft1pX4brn4IkuEOwkAGXGVK4QiJwUAxS9A owU0M3OCXIkGzX60VrYocTEVcwstu6+dEsXipVQr96K14TqlT6v7hPg7/f3ykRMKDuapUq pRTb+ghc6jrRmEAzLcxGIa5IVjlFHkA8GCyHEVW1mHEosvNTab7P6mhsFeU2vDgnQLzJZy GVjXWcdMI4nwd1GjMhx1hP0yC0zYMUDXiMmEljc7wTACJZMrM6yokwLJAbsVVCDCaBronP QCin8N/gpt+4SHZrJJG7qYjSg8sGYerXT7ZfATcxjAKsgYAQA6ccR9o9L9JDkg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPV17s7z15Zj; Sat, 27 Jul 2024 11:56:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuEaY039462; Sat, 27 Jul 2024 11:56:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuES8039459; Sat, 27 Jul 2024 11:56:14 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:14 GMT Message-Id: <202407271156.46RBuES8039459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 810530aa2648 - main - sound: Add device status string to sndstat nvlist List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 810530aa2648812860e84d951d9cf96dfd24e595 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=810530aa2648812860e84d951d9cf96dfd24e595 commit 810530aa2648812860e84d951d9cf96dfd24e595 Author: Christos Margiolis AuthorDate: 2024-07-27 11:54:14 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:54:14 +0000 sound: Add device status string to sndstat nvlist Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46163 --- share/man/man4/sndstat.4 | 6 +++++- sys/dev/sound/pcm/sndstat.c | 1 + sys/sys/sndstat.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/share/man/man4/sndstat.4 b/share/man/man4/sndstat.4 index 2af0619961d8..eca1e391f130 100644 --- a/share/man/man4/sndstat.4 +++ b/share/man/man4/sndstat.4 @@ -29,7 +29,7 @@ .\" .\" Note: The date here should be updated whenever a non-trivial .\" change is made to the manual page. -.Dd June 5, 2024 +.Dd July 26, 2024 .Dt SNDSTAT 4 .Os .Sh NAME @@ -74,6 +74,7 @@ dsps (NVLIST ARRAY): 1 max_chn (NUMBER): 2 provider_info (NVLIST): unit (NUMBER): 0 + status (STRING): on hdaa0 bitperfect (BOOL): FALSE pvchan (NUMBER): 1 rvchan (NUMBER): 0 @@ -169,6 +170,9 @@ provider, there are a number of name/value pairs inside this field: .Bl -tag -width ".Dv channel_info" .It Dv unit Sound card unit. +.It Dv status +Status string. +Usually reports the driver the device is attached on. .It Dv bitperfect Whether the sound card has bit-perfect mode enabled. .It Dv pvchan diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index 753531f3694e..fda7a2ad6d48 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -440,6 +440,7 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_UNIT, device_get_unit(d->dev)); // XXX: I want signed integer here + nvlist_add_string(sound4di, SNDST_DSPS_SOUND4_STATUS, d->status); nvlist_add_bool( sound4di, SNDST_DSPS_SOUND4_BITPERFECT, d->flags & SD_F_BITPERFECT); nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_PVCHAN, d->pvchancount); diff --git a/sys/sys/sndstat.h b/sys/sys/sndstat.h index 6fef6502ec89..2f2965bb3d05 100644 --- a/sys/sys/sndstat.h +++ b/sys/sys/sndstat.h @@ -70,6 +70,7 @@ struct sndstioc_nv_arg { */ #define SNDST_DSPS_SOUND4_PROVIDER "sound(4)" #define SNDST_DSPS_SOUND4_UNIT "unit" +#define SNDST_DSPS_SOUND4_STATUS "status" #define SNDST_DSPS_SOUND4_BITPERFECT "bitperfect" #define SNDST_DSPS_SOUND4_PVCHAN "pvchan" #define SNDST_DSPS_SOUND4_RVCHAN "rvchan" From nobody Sat Jul 27 11:56:15 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPW6wVLz5S6d1; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPW2zLXz42mj; Sat, 27 Jul 2024 11:56:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SHROlTw/aR+7ztDGQWRY98jI/BQIpaT02tyMxPWhrt4=; b=p1ky0Rg5y86WHbcYH5+gy51aCgOzzAUrIP3L3emGXLulNfuHHIEN+7j4C316ZKML3qbo6t q+S/C0YIFpumeadRqRkVXKxAhEAxC2jWquhA9nJFn8/aJXCgZ7OCKXDyq6daC/tyeg1tPe lUBx12yBpdLXhPfuZX0eMTrEYV++NFVKrvjEypmw1KZAFrNrlSQrKofI0PEkpbs9UWbqxC w+DBNP2cUt3U+0IKWKzyFCurcmXwsE4eCMkO8QouuUDkvKlk96YaGGv6/GlTKBfa/L7o7f 1bR7Zo+J6U1IrtkWwSxQJbRbkjPdkIfm6PZspoB/on83YRvOMmD26t6rvT5Elg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081375; a=rsa-sha256; cv=none; b=HGUs+6G619hnoMed6PpfdZWTNCEicVVYr0gUpyRK2dG3Zoa+7OTqPc0kfgfCVtTTZorS0U kqqCITKGzgUYWSe2Kaf0NU4ynbwxQfuHjXUYhCvKO0NZa2xUpAJzdbc9dcNJ3P9qm6WnJy C9L1mtfRdB2J8GPHX3cPZnUglxWKHKPatXkMps0IFo9zuCMID4xPR+2KO7XqktrebjsTJR CY0n20O+Qoj1pCnNwNKoXeQFmC11BYxTf0nEDemrw4GhoAab8PMp8y/m9NsSU7t7DRUDF8 QL4LObyL/XBwG3gk7rvcuO+23Ggxpht+lOTCJx1Ayj11I5Cf1CnJsN1+pDvmYw== 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=1722081375; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SHROlTw/aR+7ztDGQWRY98jI/BQIpaT02tyMxPWhrt4=; b=MdKsy1pgXT6MlL9D1RKaYjZtiQTccgTcnhGFu/sTFCaWrH9L8NVlhm54x0I4DcX9FjIgrP VPbMw/qZ6nJaGzOtUw2+yaLVSR66dTzSzzBQjob6ArVm6YnSekJTfmLClX2FRZktFk3/xv vqB2FqMCdcqI0pkFJnHRZXvUnnAwqPUzzaEpVsT6hKsUXzElDJ17WxqrG5AdNz+HXO5NtR WDmyu4F/jNOw6LKnd/sqNqmGkNZcH+21Ku/pnYq49PjpUg6gS9T0GUIFQ2OslstiqcvDHt p0XmITEesfC1Vm6uck3T71hjqYl4977eFlmR40QkSQnTDCosAFX1vxw/kREkxw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPW2YrFz15sP; Sat, 27 Jul 2024 11:56:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuFwK039513; Sat, 27 Jul 2024 11:56:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuF9S039510; Sat, 27 Jul 2024 11:56:15 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:15 GMT Message-Id: <202407271156.46RBuF9S039510@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: a62837175770 - main - sound: Add *vchanrate and *vchanformat to sndstat nvlist List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6283717577066b0ff6c62053145470ff4134051 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a6283717577066b0ff6c62053145470ff4134051 commit a6283717577066b0ff6c62053145470ff4134051 Author: Christos Margiolis AuthorDate: 2024-07-27 11:54:21 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:54:21 +0000 sound: Add *vchanrate and *vchanformat to sndstat nvlist Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46164 --- share/man/man4/sndstat.4 | 12 ++++++++++++ sys/dev/sound/pcm/sndstat.c | 8 ++++++++ sys/sys/sndstat.h | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/share/man/man4/sndstat.4 b/share/man/man4/sndstat.4 index eca1e391f130..2f745f418b79 100644 --- a/share/man/man4/sndstat.4 +++ b/share/man/man4/sndstat.4 @@ -77,7 +77,11 @@ dsps (NVLIST ARRAY): 1 status (STRING): on hdaa0 bitperfect (BOOL): FALSE pvchan (NUMBER): 1 + pvchanrate (NUMBER): 48000 + pvchanformat (NUMBER): 0x00000010 rvchan (NUMBER): 0 + rvchanrate (NUMBER): 48000 + rvchanformat (NUMBER): 0x00000010 channel_info (NVLIST_ARRAY): 1 name (STRING): pcm0:virtual_play:dsp0.vp0 parentchan (STRING): pcm0:play:dsp0.p0 @@ -177,8 +181,16 @@ Usually reports the driver the device is attached on. Whether the sound card has bit-perfect mode enabled. .It Dv pvchan Number of playback virtual channels. +.It Dv pvchanrate +Playback virtual channel sample rate. +.It Dv pvchanformat +Playback virtual channel format. .It Dv rvchan Number of recording virtual channels. +.It Dv rvchanrate +Recording virtual channel sample rate. +.It Dv rvchanformat +Recording virtual channel format. .It Dv channel_info Channel information. There are a number of name/value pairs inside this field: diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index fda7a2ad6d48..b0d2c5b6ca21 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -444,7 +444,15 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) nvlist_add_bool( sound4di, SNDST_DSPS_SOUND4_BITPERFECT, d->flags & SD_F_BITPERFECT); nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_PVCHAN, d->pvchancount); + nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_PVCHANRATE, + d->pvchanrate); + nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_PVCHANFORMAT, + d->pvchanformat); nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_RVCHAN, d->rvchancount); + nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_RVCHANRATE, + d->rvchanrate); + nvlist_add_number(sound4di, SNDST_DSPS_SOUND4_RVCHANFORMAT, + d->rvchanformat); nchan = 0; CHN_FOREACH(c, d, channels.pcm) { diff --git a/sys/sys/sndstat.h b/sys/sys/sndstat.h index 2f2965bb3d05..f7d0b2f29bd5 100644 --- a/sys/sys/sndstat.h +++ b/sys/sys/sndstat.h @@ -73,7 +73,11 @@ struct sndstioc_nv_arg { #define SNDST_DSPS_SOUND4_STATUS "status" #define SNDST_DSPS_SOUND4_BITPERFECT "bitperfect" #define SNDST_DSPS_SOUND4_PVCHAN "pvchan" +#define SNDST_DSPS_SOUND4_PVCHANRATE "pvchanrate" +#define SNDST_DSPS_SOUND4_PVCHANFORMAT "pvchanformat" #define SNDST_DSPS_SOUND4_RVCHAN "rvchan" +#define SNDST_DSPS_SOUND4_RVCHANRATE "rvchanrate" +#define SNDST_DSPS_SOUND4_RVCHANFORMAT "rvchanformat" #define SNDST_DSPS_SOUND4_CHAN_INFO "channel_info" #define SNDST_DSPS_SOUND4_CHAN_NAME "name" #define SNDST_DSPS_SOUND4_CHAN_PARENTCHAN "parentchan" From nobody Sat Jul 27 11:56:16 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPY1hnRz5S6Kc; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPX3yPRz42kf; Sat, 27 Jul 2024 11:56:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WqPpj+LPW9mcgZ29T76iBwxiI7U7qMooFN/aJOX4ovk=; b=uAfH+4Paj+qngaiUtEpB7HTWBTczbk5+EWh7EJTdKU+A6ocfbmeqcE7E9YS9hixfivQRCC C8u7tqlNS1i5ilkKkAKF/+CU6hdTWxidIU7JSJno+cPjduusL1VGroW1gRCojIHAxeFR1Y iGqibjdLbz0gOjGLCVa3URigdT4+Bn9Omtyghs7l+Pxjpj3vVNIPYT2BmdMUwoZlQk2nHV ipBpi4gLPgs0PZBSH+U4viz60BNgamEU3wPDVmolDiyucLF06sm14KqGlB4G/6s1BMC2ik gxFQaNefYNZ96hpr0xtMHkTsmu4UcmIc8k3QpiNY0b6pDtEHjS7UsN3LHFldgw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081376; a=rsa-sha256; cv=none; b=LDJ3RaXU/GysNhcwcal94NVuQhfeQrnnxabu+Ac0dcDmz2MqsONsoQkbnD6GYFmfw6TY+Q ahl+T6MC6owoD9ZKPyoJunpn54+o0LIbncmqGOaLVpSepSALcjdewocnaG0wa+gjbbgKgP C6zI10J/t3cGo+RUBNUPcvLP6DOSzw+EMJTe2TQ6RSEx0T2+packgutlVtGBm63g27TyZE xLwKiXP8MSYElFRRy9OdwcoGL8FQt4goxkWkBcar1loyzxRVzGS4mSqQ2+TFdIk+VpP7ZC hMsVKB33AQ1K/x7yjeZiGb/uXFLTKaQ1gRuRTkHffpI/cj6jSwtj/Iv/3SeFcg== 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=1722081376; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WqPpj+LPW9mcgZ29T76iBwxiI7U7qMooFN/aJOX4ovk=; b=EoZu+RIZJ3hV9NFN3pyxxjdqwVOcwlQSNBMZPnl/HJeLjSG/qojFy7UZZ7AnxenIWO6kf5 dXBW56hU90wDEzcgcPNJ3eESJjqMqStIiiqLyrnQhaXVnBnEDE79FJX+062/x8M50u5f3P xtqcz/lJhu/gN7bcVRzbi8lYRbjiUN4xNSuTqiZmP2iLbFCByw2AGvABS2zBnjtU6ALWH8 yS3Y67lG/5NxnsQtuBkRwHeYrOgDKpFZi/CA/AU9bVcMP6HLaYqNpv5sPUNkkw0/L+HZ7B 3Wuk3eFoppcflhc3dmHio8ewYpeZujE9EsR1JSVr2A462idFEDL1qjxNaaMk3w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPX3FBcz15nH; Sat, 27 Jul 2024 11:56:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuG5b039564; Sat, 27 Jul 2024 11:56:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuGW3039561; Sat, 27 Jul 2024 11:56:16 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:16 GMT Message-Id: <202407271156.46RBuGW3039561@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: bd5bcc848c57 - main - sound: Add OSS channel capabilities to sndstat nvlist List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd5bcc848c5764229926ad27a4bd77af4f87d189 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=bd5bcc848c5764229926ad27a4bd77af4f87d189 commit bd5bcc848c5764229926ad27a4bd77af4f87d189 Author: Christos Margiolis AuthorDate: 2024-07-27 11:54:27 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:54:27 +0000 sound: Add OSS channel capabilities to sndstat nvlist Assignment taken from dsp_oss_engineinfo(). Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46166 --- share/man/man4/sndstat.4 | 3 +++ sys/dev/sound/pcm/sndstat.c | 7 ++++++- sys/sys/sndstat.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/share/man/man4/sndstat.4 b/share/man/man4/sndstat.4 index 2f745f418b79..2fc55f0045c1 100644 --- a/share/man/man4/sndstat.4 +++ b/share/man/man4/sndstat.4 @@ -86,6 +86,7 @@ dsps (NVLIST ARRAY): 1 name (STRING): pcm0:virtual_play:dsp0.vp0 parentchan (STRING): pcm0:play:dsp0.p0 unit (NUMBER): 1 + caps (NUMBER): 0x073200 latency (NUMBER): 2 rate (NUMBER): 48000 format (NUMBER): 0x201000 @@ -201,6 +202,8 @@ Channel name. Parent channel name (e.g., in the case of virtual channels). .It Dv unit Channel unit. +.It Dv caps +OSS capabilities. .It Dv latency Latency. .It Dv rate diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index b0d2c5b6ca21..f09fa7139884 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -385,7 +385,7 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) struct pcm_channel *c; struct pcm_feeder *f; struct sbuf sb; - uint32_t maxrate, minrate, fmts, minchn, maxchn; + uint32_t maxrate, minrate, fmts, minchn, maxchn, caps; nvlist_t *di = NULL, *sound4di = NULL, *diinfo = NULL, *cdi = NULL; int err, nchan; @@ -467,10 +467,15 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) CHN_LOCK(c); + caps = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER | + ((c->flags & CHN_F_VIRTUAL) ? PCM_CAP_VIRTUAL : 0) | + ((c->direction == PCMDIR_PLAY) ? PCM_CAP_OUTPUT : PCM_CAP_INPUT); + nvlist_add_string(cdi, SNDST_DSPS_SOUND4_CHAN_NAME, c->name); nvlist_add_string(cdi, SNDST_DSPS_SOUND4_CHAN_PARENTCHAN, c->parentchannel != NULL ? c->parentchannel->name : ""); nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_UNIT, nchan++); + nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_CAPS, caps); nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_LATENCY, c->latency); nvlist_add_number(cdi, SNDST_DSPS_SOUND4_CHAN_RATE, c->speed); diff --git a/sys/sys/sndstat.h b/sys/sys/sndstat.h index f7d0b2f29bd5..6fd2e06ac483 100644 --- a/sys/sys/sndstat.h +++ b/sys/sys/sndstat.h @@ -82,6 +82,7 @@ struct sndstioc_nv_arg { #define SNDST_DSPS_SOUND4_CHAN_NAME "name" #define SNDST_DSPS_SOUND4_CHAN_PARENTCHAN "parentchan" #define SNDST_DSPS_SOUND4_CHAN_UNIT "unit" +#define SNDST_DSPS_SOUND4_CHAN_CAPS "caps" #define SNDST_DSPS_SOUND4_CHAN_LATENCY "latency" #define SNDST_DSPS_SOUND4_CHAN_RATE "rate" #define SNDST_DSPS_SOUND4_CHAN_FORMAT "format" From nobody Sat Jul 27 11:56:17 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPZ0QQwz5S6R2; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPY4fT6z42n5; Sat, 27 Jul 2024 11:56:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HFvNIk5iNup6w7ZfvNcO9CGMtpjwIWQ8a/i8NY033ps=; b=aDBnCRx4JkgQnapKNGMeaGrjOrKZs9g9faNYMKVIuICJ1ezdRK2hhEWAH1deWmEnc0aQ/t j+p+I3DSec4pLBHYZlzBy195cFs+ppJxQyk0AfI3wIfiaqH65xqU57vTzCP9+MariyIoC0 9mbmT1IliR4ktcB6gmnPPHXhSrxbhw4bcQUHppKMmgE+t0hXfA4zmWGLnmd7bIoZ8t++U7 aBi13cW9keAFUGUTS0lw/fURRMH2KHLiL0uVD/x+7c1rAVYKfCPGKvxU/i1OV+pEfLsR5m m2Lt6wCo8UfoILCAkvu2xWZIHjtEiNnptRoxDMKtqKvgU7/uOiK8n2/Y/Tctfw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081377; a=rsa-sha256; cv=none; b=INgJYeS+v8arOm19EsZFWy5qnqRd+9vLe0r0xr1qkdaATtu95RRhaFkW0LMOhhugLcFt4e 8kHZzqCK0ftV1pU3QitNlOgHvABamB5jVYTPh8P04P1Fdm2ZIJPRCIA8nLZhkA+Mn4SIal X04pjD2rlEL2qKVhukfMfRL1zV30wNQo/QIo1Gsz4CtByyEOccjjrMsx4c7dsDwxLEclm9 o4x7YmnZ0Vl0VO03EHpIRbu40GiNbj7QqUTjrnvSUZIwglZK6vRPHg1NoMQNps1ASGytRg pz2w556cNW0CCWUUcXE3kkgB43kHV2dBKn7HZxTKodAoyQV0ddBf2HuIfv2gLA== 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=1722081377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=HFvNIk5iNup6w7ZfvNcO9CGMtpjwIWQ8a/i8NY033ps=; b=o/UYtYFda4yfGgY0ty5ZT2baNqKt1fYb9/F3RnnJ4FSRxT08o6Z1KyahNW0IBWRaZYb/u7 XUgX90/QPYAJbFGbFoeK2Q13F48KwkVdBn7SQDb0rV2wfgaYnWQooIt1mthxgZDtS0N36e Prqd5D2PKaRXcnBFoLeMFZ32cGCT+ivgBvZLbDQ9NQMLImJ2f8iT4T/bmOgEulWMUHDUaR PJ3DgtDXYIQ/e5nnMRmSKddyg5Mo+4F11pbGVqJk0h+VE8VNuegC/B6KtbZ4ClnmDIXF9o AC/lu+qpiR4Xde2LoLaAX1yrIQcg5j/Qh5VGnCLerEgfUktxFuj2xBCAcfooVQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPY4FRkz15YN; Sat, 27 Jul 2024 11:56:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuHaD039610; Sat, 27 Jul 2024 11:56:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuH4x039607; Sat, 27 Jul 2024 11:56:17 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:17 GMT Message-Id: <202407271156.46RBuH4x039607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: cb00491fbc51 - main - sound examples: Organize files in directories List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cb00491fbc51751fe166056cc69e23beeb26fee4 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=cb00491fbc51751fe166056cc69e23beeb26fee4 commit cb00491fbc51751fe166056cc69e23beeb26fee4 Author: Christos Margiolis AuthorDate: 2024-07-27 11:54:35 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:54:35 +0000 sound examples: Organize files in directories More examples will be added, so it's better to be organized. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45968 --- share/examples/Makefile | 11 +++++++---- share/examples/sound/{ => oss}/README | 0 share/examples/sound/{ => oss}/basic.c | 0 share/examples/sound/{ => oss}/midi.c | 0 share/examples/sound/{ => oss}/ossinit.h | 0 share/examples/sound/{ => oss}/ossmidi.h | 0 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/share/examples/Makefile b/share/examples/Makefile index 61e21f9350c1..8839075452af 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -314,12 +314,15 @@ SE_SCSI_TARGET= \ scsi_cmds.c SE_DIRS+= sound -SE_SOUND= \ +SE_SOUND= + +SE_DIRS+= sound/oss +SE_SOUND_OSS= \ + README \ basic.c \ - ossinit.h \ - ossmidi.h \ midi.c \ - README + ossinit.h \ + ossmidi.h SE_DIRS+= sunrpc SE_SUNRPC= Makefile diff --git a/share/examples/sound/README b/share/examples/sound/oss/README similarity index 100% rename from share/examples/sound/README rename to share/examples/sound/oss/README diff --git a/share/examples/sound/basic.c b/share/examples/sound/oss/basic.c similarity index 100% rename from share/examples/sound/basic.c rename to share/examples/sound/oss/basic.c diff --git a/share/examples/sound/midi.c b/share/examples/sound/oss/midi.c similarity index 100% rename from share/examples/sound/midi.c rename to share/examples/sound/oss/midi.c diff --git a/share/examples/sound/ossinit.h b/share/examples/sound/oss/ossinit.h similarity index 100% rename from share/examples/sound/ossinit.h rename to share/examples/sound/oss/ossinit.h diff --git a/share/examples/sound/ossmidi.h b/share/examples/sound/oss/ossmidi.h similarity index 100% rename from share/examples/sound/ossmidi.h rename to share/examples/sound/oss/ossmidi.h From nobody Sat Jul 27 11:56:18 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPb0XQMz5S6Kk; Sat, 27 Jul 2024 11: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPZ5gKJz42c1; Sat, 27 Jul 2024 11:56:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AdtcOSGTr4S2cXKyf115XeL6NtO78T1oFyMQOZqskAk=; b=sWGiMx2/ah7ZRZgP/2PhFaFP4QaiE47AsXZ2oTATKl1bUhq3S6G9Dv1rcu0jRsbbb/N+nr UbIgKpOuLMcQP2Z+wABZeUJFH3y39dOpIPCx7Ffxd2RLela79DwEuHF/d0wbl+Dvl3fwij gz4Gym/lxJW7D8ZP5VPtTvOnwf1qQFXzbVUXT81kAZesbrF0V4NNZG0gicFMEShYJmvVbU qxhyoOspwv0sB1RlK1Jr9K/TYg2oXCm89xhH0zuO6yWmnn9binr21EPKMgivBQFmJxNxhR bsih0mr5aLKHVRH9fWbp6lL0n6CwjCS2ZQGJ6woQKQW0+R3TGunRX5+tBjZhzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081378; a=rsa-sha256; cv=none; b=BHF4w82ekLomqCAgFa6CupWFcYJljuA3DvqsciZ41gW2sZGOk8a40BVxr1+mxNQbnxD4SI pkGVItzBcGSmKhXwn6SwGzsL4I9o6T+6AJHmwtZd0X8ngp4O9/0m2kCmTqS/I56gZWoiXv 1BDMGm+mxd8zM7kh7dygwW4l0EcY6MlcYszo3V1C7yTY9mPV2OYlfawg/veWXaqDM7CBQw FASQWleTUKwl+0+w+dK2+GCh+3J30KP7ySSWNZYw2ztoN6MRSxy2ZLyk9nYLmhv0ZxoTiX JHXohQveMi0iDA8R+S6bZQiseM5QOuhkT0ZxTLNv6vrfh9Eoob8OSXXjqk5H2A== 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=1722081378; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AdtcOSGTr4S2cXKyf115XeL6NtO78T1oFyMQOZqskAk=; b=t3+zXhA7YJ89tIES3N7gUNf1xFDah6rB66rxOImckXEIqH7KmN355j3p8fG2gxJhnd0pD9 fzDGLRsfifC6N8MkoHfX0UbEMmaeuEs/PyBpzshVCCdzwWzbtDc4bzFJRrcTvEZgxbnWmG SJiva6Fo6+hJFczJdhsVS/F9C5RFZZgdB2vVhHBEpHYJL5okG5lRpU3Hd2ujUn6lSl3iDa ITav1L+i6bXGgQOAXScIVx8372Ew6IpnXkDumUFP7IOnOirL23FwHLqN9zsDIJTZObRj6Y VhDd59AmR8ptKgmtALj5NSm4yvrX2vcZnpXKAgNlbOKQHp98136mmIcBoYN/xw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPZ5Gp2z15vs; Sat, 27 Jul 2024 11:56:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuIad039655; Sat, 27 Jul 2024 11:56:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuIEv039652; Sat, 27 Jul 2024 11:56:18 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:18 GMT Message-Id: <202407271156.46RBuIEv039652@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: f08ecd24a19b - main - sound examples: Add sndstat nvlist example List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f08ecd24a19ba772701fc35caaad92b9fe91fa9c Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f08ecd24a19ba772701fc35caaad92b9fe91fa9c commit f08ecd24a19ba772701fc35caaad92b9fe91fa9c Author: Christos Margiolis AuthorDate: 2024-07-27 11:54:40 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:54:40 +0000 sound examples: Add sndstat nvlist example Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45969 --- share/examples/Makefile | 3 +- share/examples/sound/sndstat_nv.c | 206 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 208 insertions(+), 1 deletion(-) diff --git a/share/examples/Makefile b/share/examples/Makefile index 8839075452af..211ec2272c05 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -314,7 +314,8 @@ SE_SCSI_TARGET= \ scsi_cmds.c SE_DIRS+= sound -SE_SOUND= +SE_SOUND= \ + sndstat_nv.c SE_DIRS+= sound/oss SE_SOUND_OSS= \ diff --git a/share/examples/sound/sndstat_nv.c b/share/examples/sound/sndstat_nv.c new file mode 100644 index 000000000000..1056c1f4a08f --- /dev/null +++ b/share/examples/sound/sndstat_nv.c @@ -0,0 +1,206 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 The FreeBSD Foundation + * + * This software was developed by Christos Margiolis + * 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 + * 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 + +/* + * Example program showcasing how to use sndstat(4)'s nvlist interface, and how + * to fetch all currently supported fields, with the appropriate error checks. + * + * For more detailed information on what each nvlist field represents, please + * read sndstat(4)'s man page. + */ + +int +main(int argc, char *argv[]) +{ + nvlist_t *nvl; + const nvlist_t * const *di; + const nvlist_t * const *cdi; + struct sndstioc_nv_arg arg; + size_t nitems, nchans, i, j; + int fd, pchan, rchan; + + if ((fd = open("/dev/sndstat", O_RDONLY)) < 0) + err(1, "open(/dev/sndstat)"); + + if (ioctl(fd, SNDSTIOC_REFRESH_DEVS, NULL) < 0) + err(1, "ioctl(SNDSTIOC_REFRESH_DEVS)"); + + arg.nbytes = 0; + arg.buf = NULL; + if (ioctl(fd, SNDSTIOC_GET_DEVS, &arg) < 0) + err(1, "ioctl(SNDSTIOC_GET_DEVS#1)"); + + if ((arg.buf = malloc(arg.nbytes)) == NULL) + err(1, "malloc"); + + if (ioctl(fd, SNDSTIOC_GET_DEVS, &arg) < 0) + err(1, "ioctl(SNDSTIOC_GET_DEVS#2)"); + + if ((nvl = nvlist_unpack(arg.buf, arg.nbytes, 0)) == NULL) + err(1, "nvlist_unpack"); + + if (nvlist_empty(nvl) || !nvlist_exists(nvl, SNDST_DSPS)) + errx(1, "no soundcards attached"); + + di = nvlist_get_nvlist_array(nvl, SNDST_DSPS, &nitems); + for (i = 0; i < nitems; i++) { +#define NV(type, item) \ + nvlist_get_ ## type (di[i], SNDST_DSPS_ ## item) + printf("nameunit=%s\n", NV(string, NAMEUNIT)); + printf("\tfrom_user=%d\n", NV(bool, FROM_USER)); + printf("\tdevnode=%s\n", NV(string, DEVNODE)); + printf("\tdesc=%s\n", NV(string, DESC)); + printf("\tprovider=%s\n", NV(string, PROVIDER)); + printf("\tpchan=%d\n", (int)NV(number, PCHAN)); + printf("\trchan=%d\n", (int)NV(number, RCHAN)); + pchan = NV(number, PCHAN); + rchan = NV(number, RCHAN); +#undef NV + + if (pchan && !nvlist_exists(di[i], SNDST_DSPS_INFO_PLAY)) + errx(1, "playback channel list empty"); + if (rchan && !nvlist_exists(di[i], SNDST_DSPS_INFO_REC)) + errx(1, "recording channel list empty"); + +#define NV(type, mode, item) \ + nvlist_get_ ## type (nvlist_get_nvlist(di[i], \ + SNDST_DSPS_INFO_ ## mode), SNDST_DSPS_INFO_ ## item) + if (pchan) { + printf("\tplay_min_rate=%d\n", + (int)NV(number, PLAY, MIN_RATE)); + printf("\tplay_max_rate=%d\n", + (int)NV(number, PLAY, MAX_RATE)); + printf("\tplay_formats=%#08x\n", + (int)NV(number, PLAY, FORMATS)); + printf("\tplay_min_chn=%d\n", + (int)NV(number, PLAY, MIN_CHN)); + printf("\tplay_max_chn=%d\n", + (int)NV(number, PLAY, MAX_CHN)); + } + if (rchan) { + printf("\trec_min_rate=%d\n", + (int)NV(number, REC, MIN_RATE)); + printf("\trec_max_rate=%d\n", + (int)NV(number, REC, MAX_RATE)); + printf("\trec_formats=%#08x\n", + (int)NV(number, REC, FORMATS)); + printf("\trec_min_chn=%d\n", + (int)NV(number, REC, MIN_CHN)); + printf("\trec_max_chn=%d\n", + (int)NV(number, REC, MAX_CHN)); + } +#undef NV + + if (!nvlist_exists(di[i], SNDST_DSPS_PROVIDER_INFO)) + continue; + +#define NV(type, item) \ + nvlist_get_ ## type (nvlist_get_nvlist(di[i], \ + SNDST_DSPS_PROVIDER_INFO), SNDST_DSPS_SOUND4_ ## item) + printf("\tunit=%d\n", (int)NV(number, UNIT)); + printf("\tstatus=%s\n", NV(string, STATUS)); + printf("\tbitperfect=%d\n", NV(bool, BITPERFECT)); + printf("\tpvchan=%d\n", (int)NV(number, PVCHAN)); + printf("\tpvchanrate=%d\n", (int)NV(number, PVCHANRATE)); + printf("\tpvchanformat=%#08x\n", (int)NV(number, PVCHANFORMAT)); + printf("\trvchan=%d\n", (int)NV(number, RVCHAN)); + printf("\trvchanrate=%d\n", (int)NV(number, RVCHANRATE)); + printf("\trvchanformat=%#08x\n", (int)NV(number, RVCHANFORMAT)); +#undef NV + + if (!nvlist_exists(nvlist_get_nvlist(di[i], + SNDST_DSPS_PROVIDER_INFO), SNDST_DSPS_SOUND4_CHAN_INFO)) + errx(1, "channel info list empty"); + + cdi = nvlist_get_nvlist_array( + nvlist_get_nvlist(di[i], SNDST_DSPS_PROVIDER_INFO), + SNDST_DSPS_SOUND4_CHAN_INFO, &nchans); + for (j = 0; j < nchans; j++) { +#define NV(type, item) \ + nvlist_get_ ## type (cdi[j], SNDST_DSPS_SOUND4_CHAN_ ## item) + printf("\tchan=%s\n", NV(string, NAME)); + printf("\t\tparentchan=%s\n", NV(string, PARENTCHAN)); + printf("\t\tunit=%d\n", (int)NV(number, UNIT)); + printf("\t\tcaps=%#08x\n", (int)NV(number, CAPS)); + printf("\t\tlatency=%d\n", (int)NV(number, LATENCY)); + printf("\t\trate=%d\n", (int)NV(number, RATE)); + printf("\t\tformat=%#08x\n", (int)NV(number, FORMAT)); + printf("\t\tpid=%d\n", (int)NV(number, PID)); + printf("\t\tcomm=%s\n", NV(string, COMM)); + printf("\t\tintr=%d\n", (int)NV(number, INTR)); + printf("\t\txruns=%d\n", (int)NV(number, XRUNS)); + printf("\t\tfeedcnt=%d\n", (int)NV(number, FEEDCNT)); + printf("\t\tleftvol=%d\n", (int)NV(number, LEFTVOL)); + printf("\t\trightvol=%d\n", (int)NV(number, RIGHTVOL)); + printf("\t\thwbuf_format=%#08x\n", + (int)NV(number, HWBUF_FORMAT)); + printf("\t\thwbuf_size=%d\n", + (int)NV(number, HWBUF_SIZE)); + printf("\t\thwbuf_blksz=%d\n", + (int)NV(number, HWBUF_BLKSZ)); + printf("\t\thwbuf_blkcnt=%d\n", + (int)NV(number, HWBUF_BLKCNT)); + printf("\t\thwbuf_free=%d\n", + (int)NV(number, HWBUF_FREE)); + printf("\t\thwbuf_ready=%d\n", + (int)NV(number, HWBUF_READY)); + printf("\t\tswbuf_format=%#08x\n", + (int)NV(number, SWBUF_FORMAT)); + printf("\t\tswbuf_size=%d\n", + (int)NV(number, SWBUF_SIZE)); + printf("\t\tswbuf_blksz=%d\n", + (int)NV(number, SWBUF_BLKSZ)); + printf("\t\tswbuf_blkcnt=%d\n", + (int)NV(number, SWBUF_BLKCNT)); + printf("\t\tswbuf_free=%d\n", + (int)NV(number, SWBUF_FREE)); + printf("\t\tswbuf_ready=%d\n", + (int)NV(number, SWBUF_READY)); + printf("\t\tswbuf_feederchain=%s\n", + NV(string, FEEDERCHAIN)); +#undef NV + } + } + + free(arg.buf); + nvlist_destroy(nvl); + close(fd); + + return (0); +} From nobody Sat Jul 27 11:56:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPd1SKvz5S6n5; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPd0BkLz42lK; Sat, 27 Jul 2024 11:56:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qXudAkY+CjgpN15gfNXuFd4mCffoD7zOqKqto8EV5q8=; b=w0sGEGV/fA1wtMB+sEVYn2qg7disZPA2Hwibxp7iaW12uycEpe4dEnsw6uW+VuZG1CjU6G CpVvMODATYY6k1faS22DRYBNP8E++yanKOvTKcOgAQA1O3sugiDA5SjVbtgpDAsXtjh8gt DKLWhkpCsUHb/AoMsZny+r1TdaWnsdJupHJ3C7clpFUjSVlThcP74d3Zfb4OwshNTL5xii NL/wZiGZuFdwIbYNlWcj3CaQs2951lVdrp1nERg9dPs36rIdD0GSFVyeh/AUiwXCBtvJc8 G73ZD/3O4HXfXSN7xehZ9AhjsseZyhixOaBbqRwCUICq+TADa6mO669cPWipIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081381; a=rsa-sha256; cv=none; b=inHvTi5che4RLhK9DEXgdkYYXiOw3aFOQI2a6HHPixHO1N9MzjsF0L4Lr4JyW90umtMXd1 IZYVrkrQrsbzcKa4QsYjF1cY3/dduKVCntfHU71UHutrcYdt4M/hOjkz4dz2H7ejveTvPT rnMwfkHWFRM/VAMk+OxVJtC7EhCsEEBm3YUYrCP8CaRi4JyMw2fKwwJ8NwcyBqrFrtV2ts f3zym9iQCsUe+aQ3sUa+eTIhWHTO0jJeKSfw5kx8P0f4HuF3UJPv8su/O3uY65G6RXeAzD 6rLcPZLJCjQ3O8K7UV2A4xR2CWt6ArmtJbD6Ec9b3WStSPc/+a30s3OvdCS7iQ== 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=1722081381; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qXudAkY+CjgpN15gfNXuFd4mCffoD7zOqKqto8EV5q8=; b=AT91wedNt5LmSJvD2WWGjd53GpiKcbXBfFQr3CNQ8Me4EnZA8EBbbtACnSyrIKPGfv2IBJ B3ErZbk3M7GQjxEXE774NjmF9Qtz4geNnq04BlEkvGXO29wSaofuyLz7gNYiBBxOlhyhLk neSg0GJL8sdp5rxVB50eQndTGJjfMFov4V1qmvaWZhX0TOPdwJz4aEqN+ErmD0V5F1BuML sRZ58/VBBD31rrkoZ2ceKEzaszbdDG8Yh2AHTviGJtxSRDvdfpB/Paz/cjbok4vfMkoneJ ZC2R0cF04B4g6phx7brseBvQgybQvJNHlaj8CrfNuI+oN4fZ2oW3ihYjRkNqHw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPc6x5gz15yM; Sat, 27 Jul 2024 11:56:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuKPY039749; Sat, 27 Jul 2024 11:56:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuKsh039746; Sat, 27 Jul 2024 11:56:20 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:20 GMT Message-Id: <202407271156.46RBuKsh039746@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 95eb4b873b6a - main - sound tests: Add sndstat nvlist ATF test List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 95eb4b873b6a8b527c5bd78d7191975dfca38998 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=95eb4b873b6a8b527c5bd78d7191975dfca38998 commit 95eb4b873b6a8b527c5bd78d7191975dfca38998 Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:03 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:55:03 +0000 sound tests: Add sndstat nvlist ATF test Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45901 --- tests/sys/Makefile | 1 + tests/sys/sound/Makefile | 9 ++ tests/sys/sound/sndstat.c | 214 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 224 insertions(+) diff --git a/tests/sys/Makefile b/tests/sys/Makefile index 7167f77ff471..e64268e5a397 100644 --- a/tests/sys/Makefile +++ b/tests/sys/Makefile @@ -30,6 +30,7 @@ TESTS_SUBDIRS+= netpfil TESTS_SUBDIRS+= opencrypto TESTS_SUBDIRS+= posixshm TESTS_SUBDIRS+= ses +TESTS_SUBDIRS+= sound TESTS_SUBDIRS+= sys TESTS_SUBDIRS+= vfs TESTS_SUBDIRS+= vm diff --git a/tests/sys/sound/Makefile b/tests/sys/sound/Makefile new file mode 100644 index 000000000000..fb731fb8ab61 --- /dev/null +++ b/tests/sys/sound/Makefile @@ -0,0 +1,9 @@ +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/sound + +ATF_TESTS_C+= sndstat + +LDFLAGS+= -lnv + +.include diff --git a/tests/sys/sound/sndstat.c b/tests/sys/sound/sndstat.c new file mode 100644 index 000000000000..7c030dfa8b58 --- /dev/null +++ b/tests/sys/sound/sndstat.c @@ -0,0 +1,214 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 The FreeBSD Foundation + * + * This software was developed by Christos Margiolis + * 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 + * 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 + +static void +load_dummy(void) +{ + if (kldload("snd_dummy.ko") < 0 && errno != EEXIST) + atf_tc_skip("snd_dummy.ko not found"); +} + +ATF_TC(sndstat_nv); +ATF_TC_HEAD(sndstat_nv, tc) +{ + atf_tc_set_md_var(tc, "descr", "/dev/sndstat nvlist test"); +} + +ATF_TC_BODY(sndstat_nv, tc) +{ + nvlist_t *nvl; + const nvlist_t * const *di; + const nvlist_t * const *cdi; + struct sndstioc_nv_arg arg; + size_t nitems, nchans, i, j; + int fd, rc; + int pchan, rchan; + + load_dummy(); + + if ((fd = open("/dev/sndstat", O_RDONLY)) < 0) + atf_tc_skip("/dev/sndstat not found, load sound(4)"); + + rc = ioctl(fd, SNDSTIOC_REFRESH_DEVS, NULL); + ATF_REQUIRE_EQ(rc, 0); + + arg.nbytes = 0; + arg.buf = NULL; + rc = ioctl(fd, SNDSTIOC_GET_DEVS, &arg); + ATF_REQUIRE_EQ_MSG(rc, 0, "ioctl(SNDSTIOC_GET_DEVS#1) failed"); + + arg.buf = malloc(arg.nbytes); + ATF_REQUIRE(arg.buf != NULL); + + rc = ioctl(fd, SNDSTIOC_GET_DEVS, &arg); + ATF_REQUIRE_EQ_MSG(rc, 0, "ioctl(SNDSTIOC_GET_DEVS#2) failed"); + + nvl = nvlist_unpack(arg.buf, arg.nbytes, 0); + ATF_REQUIRE(nvl != NULL); + + if (nvlist_empty(nvl) || !nvlist_exists(nvl, SNDST_DSPS)) + atf_tc_skip("no soundcards attached"); + + di = nvlist_get_nvlist_array(nvl, SNDST_DSPS, &nitems); + for (i = 0; i < nitems; i++) { +#define NV(type, item) do { \ + ATF_REQUIRE_MSG(nvlist_exists(di[i], SNDST_DSPS_ ## item), \ + "SNDST_DSPS_" #item " does not exist"); \ + nvlist_get_ ## type (di[i], SNDST_DSPS_ ## item); \ +} while (0) + NV(string, NAMEUNIT); + NV(bool, FROM_USER); + NV(string, DEVNODE); + NV(string, DESC); + NV(string, PROVIDER); + NV(number, PCHAN); + NV(number, RCHAN); +#undef NV + + /* Cannot asign using the macro. */ + pchan = nvlist_get_number(di[i], SNDST_DSPS_PCHAN); + rchan = nvlist_get_number(di[i], SNDST_DSPS_RCHAN); + + if (pchan && !nvlist_exists(di[i], SNDST_DSPS_INFO_PLAY)) + atf_tc_fail("playback channel list empty"); + if (rchan && !nvlist_exists(di[i], SNDST_DSPS_INFO_REC)) + atf_tc_fail("recording channel list empty"); + +#define NV(type, mode, item) do { \ + ATF_REQUIRE_MSG(nvlist_exists(nvlist_get_nvlist(di[i], \ + SNDST_DSPS_INFO_ ## mode), SNDST_DSPS_INFO_ ## item), \ + "SNDST_DSPS_INFO_" #item " does not exist"); \ + nvlist_get_ ## type (nvlist_get_nvlist(di[i], \ + SNDST_DSPS_INFO_ ## mode), SNDST_DSPS_INFO_ ## item); \ +} while (0) + if (pchan) { + NV(number, PLAY, MIN_RATE); + NV(number, PLAY, MAX_RATE); + NV(number, PLAY, FORMATS); + NV(number, PLAY, MIN_CHN); + NV(number, PLAY, MAX_CHN); + } + if (rchan) { + NV(number, REC, MIN_RATE); + NV(number, REC, MAX_RATE); + NV(number, REC, FORMATS); + NV(number, REC, MIN_CHN); + NV(number, REC, MAX_CHN); + } +#undef NV + + /* XXX Do we need to skip the TC? userdevs won't have this list */ + if (!nvlist_exists(di[i], SNDST_DSPS_PROVIDER_INFO)) + continue; + +#define NV(type, item) do { \ + ATF_REQUIRE_MSG(nvlist_exists(nvlist_get_nvlist(di[i], \ + SNDST_DSPS_PROVIDER_INFO), SNDST_DSPS_SOUND4_ ## item), \ + "SNDST_DSPS_SOUND4_" #item " does not exist"); \ + nvlist_get_ ## type (nvlist_get_nvlist(di[i], \ + SNDST_DSPS_PROVIDER_INFO), SNDST_DSPS_SOUND4_ ## item); \ +} while (0) + NV(number, UNIT); + NV(string, STATUS); + NV(bool, BITPERFECT); + NV(number, PVCHAN); + NV(number, PVCHANRATE); + NV(number, PVCHANFORMAT); + NV(number, RVCHAN); + NV(number, PVCHANRATE); + NV(number, PVCHANFORMAT); +#undef NV + + if (!nvlist_exists(nvlist_get_nvlist(di[i], + SNDST_DSPS_PROVIDER_INFO), SNDST_DSPS_SOUND4_CHAN_INFO)) + atf_tc_fail("channel info list empty"); + + cdi = nvlist_get_nvlist_array( + nvlist_get_nvlist(di[i], SNDST_DSPS_PROVIDER_INFO), + SNDST_DSPS_SOUND4_CHAN_INFO, &nchans); + for (j = 0; j < nchans; j++) { +#define NV(type, item) do { \ + ATF_REQUIRE_MSG(nvlist_exists(cdi[j], SNDST_DSPS_SOUND4_CHAN_ ## item), \ + "SNDST_DSPS_SOUND4_CHAN_" #item " does not exist"); \ + nvlist_get_ ## type (cdi[j], SNDST_DSPS_SOUND4_CHAN_ ## item); \ +} while (0) + NV(string, NAME); + NV(string, PARENTCHAN); + NV(number, UNIT); + NV(number, CAPS); + NV(number, LATENCY); + NV(number, RATE); + NV(number, FORMAT); + NV(number, PID); + NV(string, COMM); + NV(number, INTR); + NV(number, XRUNS); + NV(number, FEEDCNT); + NV(number, LEFTVOL); + NV(number, RIGHTVOL); + NV(number, HWBUF_FORMAT); + NV(number, HWBUF_SIZE); + NV(number, HWBUF_BLKSZ); + NV(number, HWBUF_BLKCNT); + NV(number, HWBUF_FREE); + NV(number, HWBUF_READY); + NV(number, SWBUF_FORMAT); + NV(number, SWBUF_SIZE); + NV(number, SWBUF_BLKSZ); + NV(number, SWBUF_BLKCNT); + NV(number, SWBUF_FREE); + NV(number, SWBUF_READY); + NV(string, FEEDERCHAIN); +#undef NV + } + } + + free(arg.buf); + nvlist_destroy(nvl); + close(fd); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, sndstat_nv); + + return (atf_no_error()); +} From nobody Sat Jul 27 11:56:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPc1m6bz5S6hh; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPb6xd8z42j5; Sat, 27 Jul 2024 11: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=1722081380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H/z63VDyCCc7RkE/9SlnXrXncykaSTySxFhHsFhnYks=; b=fQkTxTO+ffQfIVGuY49EVpLNBfJBspzPbuTy+PlYS4XtH72aGhm5bMNpJLOdznRsZ3GtWx Ap26qOd/C62qvqAKCf2hkQPoVFNdrd0yKjdoQ7d6kMGivvKNCddAoEzlEEgm0GJ2cbW+rx sqXSQAHF+gH/PexChZo1N/HYbNMGfHW0J91jU0D12EqKhE9wB9aMnXsnUvuzG7mMpsL1ma Y0OWwQ393n0bFXub+vycAAmkgDY/vrVUDicFjjd5NWfs9tDv7l9eyQiS9J50nXFtNDyhXJ DOw9DI5Hp2/4GLJ0uZkvj5sG2misnxCLl+Y1nF5C8QUoUSreYRfDfXvKBF/VrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081380; a=rsa-sha256; cv=none; b=LgyFWvI3KoE1I8eTmJQvCUjw9HSrK1ydzCmzbB3Prg0Dtu2ITxVzkSHAMOmspMHDETIEqV RIgNWmRGuV+xUO77rw6e5sY9zMBXyTt2YN8+cCmAmxhGJXc5EE8DugG1g5BJqhVG8X9bj4 BTO6NvjST7KPf7D6fg1ocQd1+cQsC3xEqUV33adgBLzsHFXuWsZGbeHWCkx2bWtxy58fqt f9K2KnhYqaL8Ui358sSQXWCnbUo3EhnqycaTGtyY/DvE+MT5vwjDz3QgUUMPIcEzZ9Uome 10+TTfE4qoGsAe3INzZMyLKRt/npxT9IWJOoxhYa2O4h7ukcbod+OGQ1WIVvpg== 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=1722081380; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H/z63VDyCCc7RkE/9SlnXrXncykaSTySxFhHsFhnYks=; b=SVYiCV+0QFmLRFVe5oTGz48JfHiUFF7UXowBDNX6fKsayLk/6Dnt9AaaRUpCXxZswpFb4B e/EVdPypSuOLee+4XFT42ZEh128J4XWflluVBWDSEwQEVSZxL6TBMr/cYB113hH82aeaxg 9b0puD09LeSqVDdi0gmljec1xMPyUfh5LYlJLRnCtz4ZSdfIz3iAY23WT1QWH8IQxtXqVn WtbKapOkPyPWRtyNTiiwbpxt+FvgRlPuEMTBK/5W+wSA5ID6pXbMDcNuL/obiLavlBIJnX r/eagOUTPAwZ/A0EkMCjGR8pFVWu7YBeaYH+bWyLtDrG4Vk99HL1GTN/ULA/ug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPb6JFHz15yL; Sat, 27 Jul 2024 11:56:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuJNc039700; Sat, 27 Jul 2024 11:56:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuJ48039697; Sat, 27 Jul 2024 11:56:19 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:19 GMT Message-Id: <202407271156.46RBuJ48039697@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: c15c9315b2cb - main - sound: Implement dummy driver List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c15c9315b2cb7601cc337f7d5a8e124f4b2d5861 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=c15c9315b2cb7601cc337f7d5a8e124f4b2d5861 commit c15c9315b2cb7601cc337f7d5a8e124f4b2d5861 Author: Christos Margiolis AuthorDate: 2024-07-27 11:54:45 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:54:45 +0000 sound: Implement dummy driver Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45967 --- share/man/man4/Makefile | 1 + share/man/man4/snd_dummy.4 | 69 +++++++ sys/dev/sound/dummy.c | 353 ++++++++++++++++++++++++++++++++ sys/modules/sound/driver/Makefile | 1 + sys/modules/sound/driver/dummy/Makefile | 7 + 5 files changed, 431 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 36d945d64a60..b4a8e484b137 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -528,6 +528,7 @@ MAN= aac.4 \ snd_cmi.4 \ snd_cs4281.4 \ snd_csa.4 \ + snd_dummy.4 \ snd_emu10k1.4 \ snd_emu10kx.4 \ snd_envy24.4 \ diff --git a/share/man/man4/snd_dummy.4 b/share/man/man4/snd_dummy.4 new file mode 100644 index 000000000000..2b9d26d318ef --- /dev/null +++ b/share/man/man4/snd_dummy.4 @@ -0,0 +1,69 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.\" Copyright (c) 2024 The FreeBSD Foundation +.\" +.\" Portions of this software were developed by Christos Margiolis +.\" 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 +.\" 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. +.\" +.Dd July 15, 2024 +.Dt SND_DUMMY 4 +.Os +.Sh NAME +.Nm snd_dummy +.Nd Dummy audio driver +.Sh SYNOPSIS +To load the driver at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +snd_dummy_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver implements a virtual testing device, meaning it does not correspond to a +physical sound card. +It is intended for testing, so that test programs do not need to rely on +hardware being present in the machine in order to run. +.Pp +The driver attaches as a regular PCM device, with two channels (one playback +and one recording), as well as a mixer. +.Pp +Playback works by discarding all input, and recording by returning silence +(zeros). +.Sh SEE ALSO +.Xr sound 4 , +.Xr loader.conf 5 , +.Xr loader 8 +.Sh AUTHORS +The +.Nm +driver was implemented by +.An Christos Margiolis Aq Mt christos@FreeBSD.org +under sponsorship from the +.Fx +Foundation. +.Sh CAVEATS +Because the driver automatically attaches once the module is loaded, it can +only be attached once. diff --git a/sys/dev/sound/dummy.c b/sys/dev/sound/dummy.c new file mode 100644 index 000000000000..f8193a73fcc8 --- /dev/null +++ b/sys/dev/sound/dummy.c @@ -0,0 +1,353 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 The FreeBSD Foundation + * + * This software was developed by Christos Margiolis + * 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 + * 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 + +#ifdef HAVE_KERNEL_OPTION_HEADERS +#include "opt_snd.h" +#endif + +#include +#include + +#define DUMMY_NPCHAN 1 +#define DUMMY_NRCHAN 1 +#define DUMMY_NCHAN (DUMMY_NPCHAN + DUMMY_NRCHAN) + +struct dummy_chan { + struct dummy_softc *sc; + struct pcm_channel *chan; + struct snd_dbuf *buf; + struct pcmchan_caps *caps; + uint32_t ptr; + int dir; + int run; +}; + +struct dummy_softc { + struct snddev_info info; + device_t dev; + uint32_t cap_fmts[4]; + struct pcmchan_caps caps; + int chnum; + struct dummy_chan chans[DUMMY_NCHAN]; + struct callout callout; + struct mtx *lock; +}; + +static void +dummy_chan_io(void *arg) +{ + struct dummy_softc *sc = arg; + struct dummy_chan *ch; + int i = 0; + + snd_mtxlock(sc->lock); + + for (i = 0; i < sc->chnum; i++) { + ch = &sc->chans[i]; + if (!ch->run) + continue; + if (ch->dir == PCMDIR_PLAY) + ch->ptr += sndbuf_getblksz(ch->buf); + else + sndbuf_fillsilence(ch->buf); + snd_mtxunlock(sc->lock); + chn_intr(ch->chan); + snd_mtxlock(sc->lock); + } + callout_schedule(&sc->callout, 1); + + snd_mtxunlock(sc->lock); +} + +static int +dummy_chan_free(kobj_t obj, void *data) +{ + struct dummy_chan *ch =data; + uint8_t *buf; + + buf = sndbuf_getbuf(ch->buf); + if (buf != NULL) + free(buf, M_DEVBUF); + + return (0); +} + +static void * +dummy_chan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, + struct pcm_channel *c, int dir) +{ + struct dummy_softc *sc; + struct dummy_chan *ch; + uint8_t *buf; + size_t bufsz; + + sc = devinfo; + + snd_mtxlock(sc->lock); + + ch = &sc->chans[sc->chnum++]; + ch->sc = sc; + ch->dir = dir; + ch->chan = c; + ch->buf = b; + ch->caps = &sc->caps; + + snd_mtxunlock(sc->lock); + + bufsz = pcm_getbuffersize(sc->dev, 2048, 2048, 65536); + buf = malloc(bufsz, M_DEVBUF, M_WAITOK | M_ZERO); + if (sndbuf_setup(ch->buf, buf, bufsz) != 0) { + dummy_chan_free(obj, ch); + return (NULL); + } + + return (ch); +} + +static int +dummy_chan_setformat(kobj_t obj, void *data, uint32_t format) +{ + struct dummy_chan *ch = data; + int i; + + for (i = 0; ch->caps->fmtlist[i]; i++) + if (format == ch->caps->fmtlist[i]) + return (0); + + return (EINVAL); +} + +static uint32_t +dummy_chan_setspeed(kobj_t obj, void *data, uint32_t speed) +{ + struct dummy_chan *ch = data; + + RANGE(speed, ch->caps->minspeed, ch->caps->maxspeed); + + return (speed); +} + +static uint32_t +dummy_chan_setblocksize(kobj_t obj, void *data, uint32_t blocksize) +{ + struct dummy_chan *ch = data; + + return (sndbuf_getblksz(ch->buf)); +} + +static int +dummy_chan_trigger(kobj_t obj, void *data, int go) +{ + struct dummy_chan *ch = data; + struct dummy_softc *sc = ch->sc; + + snd_mtxlock(sc->lock); + + switch (go) { + case PCMTRIG_START: + if (!callout_active(&sc->callout)) + callout_reset(&sc->callout, 1, dummy_chan_io, sc); + ch->ptr = 0; + ch->run = 1; + break; + case PCMTRIG_STOP: + case PCMTRIG_ABORT: + ch->run = 0; + if (callout_active(&sc->callout)) + callout_stop(&sc->callout); + default: + break; + } + + snd_mtxunlock(sc->lock); + + return (0); +} + +static uint32_t +dummy_chan_getptr(kobj_t obj, void *data) +{ + struct dummy_chan *ch = data; + + return (ch->run ? ch->ptr : 0); +} + +static struct pcmchan_caps * +dummy_chan_getcaps(kobj_t obj, void *data) +{ + struct dummy_chan *ch = data; + + return (ch->caps); +} + +static kobj_method_t dummy_chan_methods[] = { + KOBJMETHOD(channel_init, dummy_chan_init), + KOBJMETHOD(channel_free, dummy_chan_free), + KOBJMETHOD(channel_setformat, dummy_chan_setformat), + KOBJMETHOD(channel_setspeed, dummy_chan_setspeed), + KOBJMETHOD(channel_setblocksize,dummy_chan_setblocksize), + KOBJMETHOD(channel_trigger, dummy_chan_trigger), + KOBJMETHOD(channel_getptr, dummy_chan_getptr), + KOBJMETHOD(channel_getcaps, dummy_chan_getcaps), + KOBJMETHOD_END +}; + +CHANNEL_DECLARE(dummy_chan); + +static int +dummy_mixer_init(struct snd_mixer *m) +{ + struct dummy_softc *sc; + + sc = mix_getdevinfo(m); + if (sc == NULL) + return (-1); + + pcm_setflags(sc->dev, pcm_getflags(sc->dev) | SD_F_SOFTPCMVOL); + mix_setdevs(m, SOUND_MASK_PCM | SOUND_MASK_VOLUME | SOUND_MASK_RECLEV); + mix_setrecdevs(m, SOUND_MASK_RECLEV); + + return (0); +} + +static int +dummy_mixer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) +{ + return (0); +} + +static uint32_t +dummy_mixer_setrecsrc(struct snd_mixer *m, uint32_t src) +{ + return (src == SOUND_MASK_RECLEV ? src : 0); +} + +static kobj_method_t dummy_mixer_methods[] = { + KOBJMETHOD(mixer_init, dummy_mixer_init), + KOBJMETHOD(mixer_set, dummy_mixer_set), + KOBJMETHOD(mixer_setrecsrc, dummy_mixer_setrecsrc), + KOBJMETHOD_END +}; + +MIXER_DECLARE(dummy_mixer); + +static void +dummy_identify(driver_t *driver, device_t parent) +{ + if (device_find_child(parent, driver->name, -1) != NULL) + return; + if (BUS_ADD_CHILD(parent, 0, driver->name, -1) == NULL) + device_printf(parent, "add child failed\n"); +} + +static int +dummy_probe(device_t dev) +{ + device_set_desc(dev, "Dummy Audio Device"); + + return (0); +} + +static int +dummy_attach(device_t dev) +{ + struct dummy_softc *sc; + char status[SND_STATUSLEN]; + int i = 0; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->lock = snd_mtxcreate(device_get_nameunit(dev), "snd_dummy softc"); + + sc->cap_fmts[0] = SND_FORMAT(AFMT_S32_LE, 2, 0); + sc->cap_fmts[1] = SND_FORMAT(AFMT_S24_LE, 2, 0); + sc->cap_fmts[2] = SND_FORMAT(AFMT_S16_LE, 2, 0); + sc->cap_fmts[3] = 0; + sc->caps = (struct pcmchan_caps){ + 8000, /* minspeed */ + 96000, /* maxspeed */ + sc->cap_fmts, /* fmtlist */ + 0, /* caps */ + }; + + pcm_setflags(dev, pcm_getflags(dev) | SD_F_MPSAFE); + if (pcm_register(dev, sc, DUMMY_NPCHAN, DUMMY_NRCHAN)) + return (ENXIO); + for (i = 0; i < DUMMY_NPCHAN; i++) + pcm_addchan(dev, PCMDIR_PLAY, &dummy_chan_class, sc); + for (i = 0; i < DUMMY_NRCHAN; i++) + pcm_addchan(dev, PCMDIR_REC, &dummy_chan_class, sc); + + snprintf(status, SND_STATUSLEN, "on %s", + device_get_nameunit(device_get_parent(dev))); + pcm_setstatus(dev, status); + mixer_init(dev, &dummy_mixer_class, sc); + callout_init(&sc->callout, 1); + + return (0); +} + +static int +dummy_detach(device_t dev) +{ + struct dummy_softc *sc = device_get_softc(dev); + int err; + + err = pcm_unregister(dev); + snd_mtxfree(sc->lock); + + return (err); +} + +static device_method_t dummy_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, dummy_identify), + DEVMETHOD(device_probe, dummy_probe), + DEVMETHOD(device_attach, dummy_attach), + DEVMETHOD(device_detach, dummy_detach), + DEVMETHOD_END +}; + +static driver_t dummy_driver = { + "pcm", + dummy_methods, + sizeof(struct dummy_softc), +}; + +DRIVER_MODULE(snd_dummy, nexus, dummy_driver, 0, 0); +MODULE_DEPEND(snd_dummy, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); +MODULE_VERSION(snd_dummy, 1); diff --git a/sys/modules/sound/driver/Makefile b/sys/modules/sound/driver/Makefile index 9b157f0c76ab..ff9499fdf841 100644 --- a/sys/modules/sound/driver/Makefile +++ b/sys/modules/sound/driver/Makefile @@ -8,6 +8,7 @@ SUBDIR= als4000 atiixp cs4281 ${_csa} emu10k1 emu10kx SUBDIR+= envy24 envy24ht es137x fm801 hda hdsp hdspe ich SUBDIR+= ${_maestro3} neomagic solo spicds t4dwave via8233 SUBDIR+= via82c686 vibes driver uaudio +SUBDIR+= dummy .if ${MK_SOURCELESS_UCODE} != "no" _csa= csa diff --git a/sys/modules/sound/driver/dummy/Makefile b/sys/modules/sound/driver/dummy/Makefile new file mode 100644 index 000000000000..fb4127d35073 --- /dev/null +++ b/sys/modules/sound/driver/dummy/Makefile @@ -0,0 +1,7 @@ +.PATH: ${SRCTOP}/sys/dev/sound + +KMOD= snd_dummy +SRCS= bus_if.h device_if.h +SRCS+= dummy.c + +.include From nobody Sat Jul 27 11:56:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPf33kfz5S6dC; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPf1zWGz42w0; Sat, 27 Jul 2024 11:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=117iTxYWFppByi01/JJRjtKt/Cqa/5mDPbTqAa4LnJc=; b=Cd61dqomj/HSoNdHKdwRTuYaMKe38q6mgtgfXExwyccB8c3i1bxshvXgiCzLJJTl1EfCr2 pd6Ghd1bWP1lje+n48ItlYSUdDXdBFby3rFkT2HIJkclAd/0/oCffXY0jYnFGg/vY8mvBz utpCe7QB7lSJvn0kFqCZgJDmnQCuep82dYcUxrbPfXSjBy3kcK0IUZ8uaEBcDdvDePxTmm xgI9o4SwtaqKQVUJUE1hOK1hYVbQWtgf/ueKgTBdUib3dlyTyiRpart09XHTXZ2ARs171z RHmDMjFrEnphRup9Zg5mXmUbX5EBZpYZm6EpCvMn7lTLK2yI5T+fLc7cWCa6rA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081382; a=rsa-sha256; cv=none; b=g3Viv/Ub9J2xW7DjJ8P2XWCvys3QhlYQXnuhnlz3oaB3ZSGATG/wrWYgGm4GonyAfmEmUb 7PEzwn3hWJuZzmniOEpjv6nmU8OUepgjFjJ33rhifKzLWrnybIO8Nqcs+S2J5xGwUlfKb4 kqr8Z+Jwz1BUJUbjTRMUbIoOwL6Zcv2WyCRWpWFsnyNNCcfiVWKF8vgIblDCM9gGO8S44B qd4XI6GjFUBasJ58MkiWUDOKobpLM0WwA9uqdkfhAa+fA1lH6x3gbnPS0eSCYRIuStsBFx JM0UFDni3wqIv92awu5zfoo88U3YtmcyorPMHOpv3ns07PJmOQ9rGXxTaMY5AA== 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=1722081382; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=117iTxYWFppByi01/JJRjtKt/Cqa/5mDPbTqAa4LnJc=; b=gWMIRnW7LuyrWORd5djYNYSbDphJaWX0BD5bF+vXTm0EXcY2IdZDIxHiEsUBW3vebpTZkf OqmK4pxZNggy5iKrfiBhNDDotGoT5Wkyv5VVBHDbDyDLUzWYndsfahNRFN5+mcPSPjmXun rHkTmLrutMTGPKFzYgb68yfM9uH8UapbY8JQvfmFb5VWh8n2aIQyzLe8tFhF/F3PVnll/q jb5rYUo6u0YZrfjbaSE/NBFeH3QGse+dDaCtASvrKLXDiXT6dsc32JX/S3r0wATV7vmBON 8wWrj1pCDbtxa234sqRCaBjqVLdPALjQc+nyNvJqyzWOOKQMNkOAEKI25pF9jw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPf0lqBz15YP; Sat, 27 Jul 2024 11:56:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuMDj039804; Sat, 27 Jul 2024 11:56:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuMos039801; Sat, 27 Jul 2024 11:56:22 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:22 GMT Message-Id: <202407271156.46RBuMos039801@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 8ca73331ef81 - main - mixer(8): Make mute and recsrc argument parsing more robust List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8ca73331ef810cd0e0b9e3c37cddc1d89fbe8c6b Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8ca73331ef810cd0e0b9e3c37cddc1d89fbe8c6b commit 8ca73331ef810cd0e0b9e3c37cddc1d89fbe8c6b Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:09 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:55:09 +0000 mixer(8): Make mute and recsrc argument parsing more robust For the deprecated argument interfaces of the mute (1, 0, ^) and recsrc (+, -, =, ^) controls, we only check the first character of the argument, which means that an argument such as "vol.mute=10" would be valid. Fix this by checking the whole argument string. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45973 --- usr.sbin/mixer/mixer.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index 07dd16536495..109d3ad09bc5 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -426,11 +426,14 @@ mod_mute(struct mix_dev *d, void *p) m = d->parent_mixer; cp = mixer_get_ctl(m->dev, C_MUT); val = p; - if (strncmp(val, "off", strlen(val)) == 0 || *val == '0') + if (strncmp(val, "off", strlen(val)) == 0 || + strncmp(val, "0", strlen(val)) == 0) opt = MIX_UNMUTE; - else if (strncmp(val, "on", strlen(val)) == 0 || *val == '1') + else if (strncmp(val, "on", strlen(val)) == 0 || + strncmp(val, "1", strlen(val)) == 0) opt = MIX_MUTE; - else if (strncmp(val, "toggle", strlen(val)) == 0 || *val == '^') + else if (strncmp(val, "toggle", strlen(val)) == 0 || + strncmp(val, "^", strlen(val)) == 0) opt = MIX_TOGGLEMUTE; else { warnx("%s: no such modifier", val); @@ -459,13 +462,17 @@ mod_recsrc(struct mix_dev *d, void *p) m = d->parent_mixer; cp = mixer_get_ctl(m->dev, C_SRC); val = p; - if (strncmp(val, "add", strlen(val)) == 0 || *val == '+') + if (strncmp(val, "add", strlen(val)) == 0 || + strncmp(val, "+", strlen(val)) == 0) opt = MIX_ADDRECSRC; - else if (strncmp(val, "remove", strlen(val)) == 0 || *val == '-') + else if (strncmp(val, "remove", strlen(val)) == 0 || + strncmp(val, "-", strlen(val)) == 0) opt = MIX_REMOVERECSRC; - else if (strncmp(val, "set", strlen(val)) == 0 || *val == '=') + else if (strncmp(val, "set", strlen(val)) == 0 || + strncmp(val, "=", strlen(val)) == 0) opt = MIX_SETRECSRC; - else if (strncmp(val, "toggle", strlen(val)) == 0 || *val == '^') + else if (strncmp(val, "toggle", strlen(val)) == 0 || + strncmp(val, "^", strlen(val)) == 0) opt = MIX_TOGGLERECSRC; else { warnx("%s: no such modifier", val); From nobody Sat Jul 27 11:56:23 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPg3Zjlz5S6Kt; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPg2Fy1z431k; Sat, 27 Jul 2024 11:56:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WNMT+tiaemUF772ggnb3rAITGn88gYSuH4H4IjoIiLs=; b=O+ruTL1/ISV87CSr7ZKDS9mMlwcmpd2e5basqLgq9odKTDEGTfgzn2gK8Yi5FcgsWQ0cHE QUFk9isqNq7vyJPSScqr1ORyuXFzHwdPLRi2oU36GpZPY9XLsmrGIJKGV1os6W09qTYm6A 3JUPMsFb/LzGFGVSG+gycDC5vz2d/On2bi2uE6tzlyDJzfKyJWAJGLAqRs49PXRfWsaQU6 X0yjrNHucdlLmujBZ0dGquWcI+g2zeuPUYXjhfdDDWFaxzH8+7i1irP+UTStKD+Lvl9hpg cf0pMgeFpTVBJK/a3BIeUT9ybAE1NP24qTAQP+jTgRC3W/LuGllX3cyVaAFvrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081383; a=rsa-sha256; cv=none; b=FXMa2PXvfYHabW5Rq6DeJ/xl1wxnR4iRUcFgfoMNU3cyGwFwk29xicdK8KCxs9TQuADP2i 6dNZl6QfrL9dwylZsXsbatR9q+THUh5SH9bdf8Px5RF5Xo/LTx9LdUDtzbJ66T6jxhJIDp xxvYXc7zQLFf07IsqiG4eetKXSIbdhKOWS4QtqOBVLg6QWWwvMJqloWcyYhajwuIfpY5e2 dEAIifZ0U8Fpk2cWoMmtvZkiJFMkwrPsWg7btQizvm+LGSKe0r6T9DSGZ6jvFnbxF7J5It xqqqAQrZy1Y24cdcl9ZRaRoid1P0zGx31fRRzAUeTDti6VMcnlghyQLA6Hcgqg== 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=1722081383; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WNMT+tiaemUF772ggnb3rAITGn88gYSuH4H4IjoIiLs=; b=Xy+cogdAsFu/x8DthI7wa0goOOEG0wkzk2nNzBHa/HDmbWrISuj2CO3qlsJdD+R0Y1stcc 6CG1PZ3jZP7xKcGvZ/EbJ5MdTk2TT8c77TeKjjKkSJddGW/RxaMaE3bmVInK+nX4vn2UlI vwnvOwv961eLQjuNqjribqAPvBDj/sp6SDcR4hInqSAjt5cv4Djb2Ruz62klTgmHiybTKi IZ7dXuUyOV5HN/nAQeByRj3c2RoZH3/q5xK/f8CWk/+c3BNcxm6b9h1c66w6j8wmUUEmTM pWh5eKrUi7IpigcjsQ8OGtBK82za9984aXptYzUfo8Desrj10f4CBWxfrv9q0w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPg1qfFz15Zk; Sat, 27 Jul 2024 11:56:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuNfH039842; Sat, 27 Jul 2024 11:56:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuNvd039839; Sat, 27 Jul 2024 11:56:23 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:23 GMT Message-Id: <202407271156.46RBuNvd039839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 94a86f3f6920 - main - mixer(8): Add tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94a86f3f69205a6de3c07ae60daf4f5f920e9b82 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=94a86f3f69205a6de3c07ae60daf4f5f920e9b82 commit 94a86f3f69205a6de3c07ae60daf4f5f920e9b82 Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:14 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:55:14 +0000 mixer(8): Add tests Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45974 --- usr.sbin/mixer/Makefile | 3 + usr.sbin/mixer/tests/Makefile | 3 + usr.sbin/mixer/tests/mixer_test.sh | 285 +++++++++++++++++++++++++++++++++++++ 3 files changed, 291 insertions(+) diff --git a/usr.sbin/mixer/Makefile b/usr.sbin/mixer/Makefile index 7789a28e99ad..9e96c2f2d2e8 100644 --- a/usr.sbin/mixer/Makefile +++ b/usr.sbin/mixer/Makefile @@ -5,4 +5,7 @@ SRCS= ${PROG}.c MAN= ${PROG}.8 LDFLAGS+= -lmixer +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include diff --git a/usr.sbin/mixer/tests/Makefile b/usr.sbin/mixer/tests/Makefile new file mode 100644 index 000000000000..9a5bb3a183ab --- /dev/null +++ b/usr.sbin/mixer/tests/Makefile @@ -0,0 +1,3 @@ +ATF_TESTS_SH+= mixer_test + +.include diff --git a/usr.sbin/mixer/tests/mixer_test.sh b/usr.sbin/mixer/tests/mixer_test.sh new file mode 100755 index 000000000000..e1321ad9ee13 --- /dev/null +++ b/usr.sbin/mixer/tests/mixer_test.sh @@ -0,0 +1,285 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2024 The FreeBSD Foundation +# +# This software was developed by Christos Margiolis +# 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 +# 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. + +mixer_exists() +{ + if ! mixer >/dev/null 2>&1; then + atf_skip "no mixer available" + fi +} + +save_conf() +{ + atf_check -o save:test_mixer_conf mixer -o +} + +restore_conf() +{ + mixer_exists + test -r "test_mixer_conf" && mixer $(cat test_mixer_conf) +} + +load_dummy() +{ + if ! kldload -n snd_dummy; then + atf_skip "cannot load snd_dummy.ko" + fi +} + +set_default() +{ + deflt_unit="$(mixer | grep ^pcm | cut -f1 -d:)" + dummy_unit="$(mixer -a | grep "Dummy Audio Device" | cut -f1 -d:)" + + atf_check -o save:test_mixer_deflt_unit echo ${deflt_unit} + atf_check -o save:test_mixer_dummy_unit echo ${dummy_unit} + + # Set the dummy as the default + mixer -d ${dummy_unit} +} + +restore_default() +{ + test -r "test_mixer_deflt_unit" && mixer -d $(cat test_mixer_deflt_unit) +} + +atf_test_case o_flag cleanup +o_flag_head() +{ + atf_set "descr" "Verify that the output of the -o flag can be used " \ + "as valid input" +} +o_flag_body() +{ + load_dummy + mixer_exists + set_default + + atf_check -o ignore -e empty mixer $(mixer -o) +} +o_flag_cleanup() +{ + restore_default +} + +atf_test_case d_flag cleanup +d_flag_head() +{ + atf_set "descr" "Test default unit setting" +} +d_flag_body() +{ + load_dummy + mixer_exists + set_default + + dev="${dummy_unit}" + unit=$(echo ${dev} | sed 's/pcm//') + + atf_check -o ignore -e empty mixer -d ${dev} + atf_check -o ignore -e empty mixer -d ${unit} +} +d_flag_cleanup() +{ + restore_default +} + +atf_test_case volume cleanup +volume_head() +{ + atf_set "descr" "Test volume setting" +} +volume_body() +{ + load_dummy + mixer_exists + set_default + save_conf + + # Test lower bound + mixer vol.volume=0 + atf_check -o match:"0.00:0.00" mixer vol.volume + + mixer vol.volume=-2 + atf_check -o match:"0.00:0.00" mixer vol.volume + + mixer vol.volume=-1:-2 + atf_check -o match:"0.00:0.00" mixer vol.volume + + mixer vol.volume=-110% + atf_check -o match:"0.00:0.00" mixer vol.volume + + # Test higher bound + mixer vol.volume=1 + atf_check -o match:"1.00:1.00" mixer vol.volume + + mixer vol.volume=+1.01 + atf_check -o match:"1.00:1.00" mixer vol.volume + + mixer vol.volume=2 + atf_check -o match:"1.00:1.00" mixer vol.volume + + mixer vol.volume=+1:+1 + atf_check -o match:"1.00:1.00" mixer vol.volume + + mixer vol.volume=2:2 + atf_check -o match:"1.00:1.00" mixer vol.volume + + mixer vol.volume=100% + atf_check -o match:"1.00:1.00" mixer vol.volume + + mixer vol.volume=110% + atf_check -o match:"1.00:1.00" mixer vol.volume + + mixer vol.volume=+110% + atf_check -o match:"1.00:1.00" mixer vol.volume + + # Test percentages + mixer vol.volume=1 + + mixer vol.volume=-10% + atf_check -o match:"0.90:0.90" mixer vol.volume + + mixer vol.volume=+5% + atf_check -o match:"0.95:0.95" mixer vol.volume + + mixer vol.volume=80% + atf_check -o match:"0.80:0.80" mixer vol.volume + + # Test left:right assignment + mixer vol.volume=0.80:0.70 + atf_check -o match:"0.80:0.70" mixer vol.volume + + mixer vol.volume=+5%:+10% + atf_check -o match:"0.85:0.80" mixer vol.volume + + mixer vol.volume=-5%:-10% + atf_check -o match:"0.80:0.70" mixer vol.volume + + mixer vol.volume=+10%:-15% + atf_check -o match:"0.90:0.55" mixer vol.volume + + # Test wrong values + atf_check -o ignore -e not-empty mixer vol.volume=foobar + atf_check -o ignore -e not-empty mixer vol.volume=2oo:b4r + atf_check -o ignore -e not-empty mixer vol.volume=+f0o:1 +} +volume_cleanup() +{ + restore_conf + restore_default +} + +atf_test_case mute cleanup +mute_head() +{ + atf_set "descr" "Test muting" +} +mute_body() +{ + load_dummy + mixer_exists + set_default + save_conf + + # Check that the mute control exists + atf_check -o not-empty mixer vol.mute + + atf_check -o ignore -e empty mixer vol.mute=off + atf_check -o match:"=off" mixer vol.mute + + atf_check -o ignore -e empty mixer vol.mute=on + atf_check -o match:"=on" mixer vol.mute + + atf_check -o ignore -e empty mixer vol.mute=toggle + atf_check -o match:"=off" mixer vol.mute + + # Test deprecated interface + atf_check -o ignore -e empty mixer vol.mute=0 + atf_check -o match:"=off" mixer vol.mute + + atf_check -o ignore -e empty mixer vol.mute=1 + atf_check -o match:"=on" mixer vol.mute + + atf_check -o ignore -e empty mixer vol.mute=^ + atf_check -o match:"=off" mixer vol.mute + + # Test wrong values + atf_check -o ignore -e not-empty mixer vol.mute=foobar + atf_check -o ignore -e not-empty mixer vol.mute=10 +} +mute_cleanup() +{ + restore_conf + restore_default +} + +atf_test_case recsrc cleanup +recsrc_head() +{ + atf_set "descr" "Test recording source handling" +} +recsrc_body() +{ + load_dummy + mixer_exists + set_default + save_conf + test -n "$(mixer -s)" || atf_skip "no recording source found" + + recsrc=$(mixer -s | awk '{print $2}') + atf_check -o ignore -e empty mixer ${recsrc}.recsrc=add + atf_check -o ignore -e empty mixer ${recsrc}.recsrc=remove + atf_check -o ignore -e empty mixer ${recsrc}.recsrc=set + atf_check -o ignore -e empty mixer ${recsrc}.recsrc=toggle + + # Test deprecated interface + atf_check -o ignore -e empty mixer ${recsrc}.recsrc=+ + atf_check -o ignore -e empty mixer ${recsrc}.recsrc=- + atf_check -o ignore -e empty mixer ${recsrc}.recsrc== + atf_check -o ignore -e empty mixer ${recsrc}.recsrc=^ + + # Test wrong values + atf_check -o ignore -e not-empty mixer ${recsrc}.recsrc=foobar + atf_check -o ignore -e not-empty mixer ${recsrc}.recsrc=10 +} +recsrc_cleanup() +{ + restore_conf + restore_default +} + +atf_init_test_cases() +{ + atf_add_test_case o_flag + atf_add_test_case d_flag + atf_add_test_case volume + atf_add_test_case mute + atf_add_test_case recsrc +} From nobody Sat Jul 27 11:56:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPh4H5Zz5S6RC; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPh33Zvz434P; Sat, 27 Jul 2024 11:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KJN/AzifNMDuu9xONX4x5YMTI99t6Iw3E8uKjzoKlNE=; b=E/n5d1W4Y6pzUjeewr6t1cnkrXk3BiRMs0+ZrB/mBmfAXaEjDDSbEsRBirDywyREKbhBgh b0kNTj2DDu/sHDnxQk/ol5ueOIfdosVbXWol4WWd2eVLUvi0xZrtiMufwAzf5jMZk5jX4h LxN0o8nC9gb+rbukcpeAKIYKkxbxMdGVAww7AEPUgMDKLsmrNHQFh1OPZyULAntkRxkE+G Rc559IFycFrp/MXq3cL+cAn6DFgnIW8cobUaV+emiLYI1Ekn2QJP14R8rmevd3KJYaaQxs gB90KQot6W5PNJ4KP9KVg44GplGGWwn3zV6pnCkjVxO0iWGmGx6MZkECnejqKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081384; a=rsa-sha256; cv=none; b=qKa/UD+7x2OmSQsiqtZNHIJBF/kAuV2LwI+wmhGruOgg9PbhYF+Ms0YJ7Rdup5xlmZgs1e Uwpmoa7Ggf+5w3Y8DTqwfYTT4g7G6dsAAPvVEzBjJxqD+olz6f2c4z4aqKsaZyim1FnUJ5 YbqGCeMiRXXuqSKc5BYJltjpueEfqi1XyiJWSlXJcIhzMyst0YMwaaUN9aavqTKHq2iEpF XuAni55HTOfvGTVlIa6uaspQLRYdSxFYCQ2w9TC4ZrhXCGPBFQOkArXcTyiJ96Rixd71/l tjvntEF6xcZRj4mOgMnUuFHCtJGbw8OhDYYiVml8WKJZJwNqYV529DjVu9qmMg== 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=1722081384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KJN/AzifNMDuu9xONX4x5YMTI99t6Iw3E8uKjzoKlNE=; b=LuAkX5NwiRjUrztrvlLlSTAdPcgx8H5qHf+YhrdnxJJ5clk/1/F4n0TD2DKVbLu8sy24LY X/NamqHg2W4mMDoAFW5tWrHsTJRBtgtS+iL22t3lixGRxTXxKmbAoemqUvwn75wFl1+jdw 31v4gmxp5LyGagiChocBnG3TmEn4f6BXVKFg4gBGHlj/GTB+UGpy58V5PXoimLUu9Bw3fc tU1EI+Hu5YH4DDaw6Qcg4QMkPH+knqvquCpPCFZw6yWgWlN9MX3Y8O9XrGmh5BuT+fzPYE FwbveLq7SswPxmoRE2RRkwmNYw42DzF8P95mC4mPDf8F/gPZys5qJ6ETUbq0GA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPh2ghGz15YQ; Sat, 27 Jul 2024 11:56:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuOCP039887; Sat, 27 Jul 2024 11:56:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuOuu039884; Sat, 27 Jul 2024 11:56:24 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:24 GMT Message-Id: <202407271156.46RBuOuu039884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 16329b7b3276 - main - sound: Fix memory leak in chn_init() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 16329b7b3276f09dc70bdd1ca8bc605546fe71e0 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=16329b7b3276f09dc70bdd1ca8bc605546fe71e0 commit 16329b7b3276f09dc70bdd1ca8bc605546fe71e0 Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:19 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:55:19 +0000 sound: Fix memory leak in chn_init() In case chn_init() fails, we are leaking memory by not freeing the feeder. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45979 --- sys/dev/sound/pcm/channel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index a18ef1cf4234..19808a43631a 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1365,6 +1365,8 @@ out2: if (CHN_LOCKOWNED(c)) CHN_UNLOCK(c); if (ret) { + while (chn_removefeeder(c) == 0) + ; if (c->devinfo) { if (CHANNEL_FREE(c->methods, c->devinfo)) sndbuf_free(b); From nobody Sat Jul 27 11:56:25 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPk0QkXz5S6kx; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPj4jfkz434b; Sat, 27 Jul 2024 11:56:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xDNZsT4du0tQaKAzB+ZvZv4C7Bv1L/otqbG5mI7Bfts=; b=alvv2XcXdzEFIC37Ky/6xLcuIQAVvm9zpM/O3CfJ7FuFLdCVJNH8zp7AP8YJ8tJB5RvhS7 o4aLs/Wm53PcI69xfwfGyxWZ7D7FCHLiNvVSOWAEgGbGJ7wQvtntCSsXv76KKuOtitvfQS pmcPg4ejLIFx3US3jxm8wSROwNEdKwJy6VU1F06jhYMHZlWj4SJsPsv39aPhe9AUdL7D/X ewbqwKjUtiR2sFFF1xscxZRNCrTTlX5nTF4LvsedxfpoBt7PBVgouV/o6o3akTWfBVaff4 ZL/AxpiPO5Ab+CAEvPk9awXt5T7ZCd59TbUVeyS2sxYbesvZfLIMTw2B2Ir/GA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081385; a=rsa-sha256; cv=none; b=hSypjrft9UqbDpN9JXkRkBfNk4LPFheuVmnV7Wmnc20btksFdUK1VjgPE05wv+H/vW7Q1I kwdSGyg/9Q9wM4XdS1lKW3lY1fCd+VUKa+Y1hjWR6W5x0zm5mUS8eiChtgOCAYtZzHMUPy eifA/V/HJNrO6CFIQMu7W3N2bcJlOLMA5nlCI6LrzDnkRgHL62utAcM5jkm/ao7hGwaUOX 0TChKH5qXcC19GptmX8ntvVLJEvPUapmp+2JqbrePXvukpLEag4i9T/Psde4Uac1UDALVl 6Bqy2pkDSEvgFhOAh5QRrN5m/a3I4KfId2OziOvsW1Ua9Jbo479z9Y27oc+MCA== 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=1722081385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xDNZsT4du0tQaKAzB+ZvZv4C7Bv1L/otqbG5mI7Bfts=; b=OVVu27MuEWV2hZjVfOhSBQ+Cz7ru+F1YUGmwTl9e9vuPGPaxaybMAR6UK3Px3Nd9mFymFY vdy7jPKC1wnG7jK94nygZthl/WXlFJ968VV9V6IAyUkSaoyiIJrAUIuEryoRV0zss+/pw5 Slh3ECRtuw9y3iYIxN7OXxy6ws54jf9dgJJsSlycencjcCGcHdxoIDgUV9+ztCpNLwia02 c0Ohr+VVR1UH+o79GF+AtJOIFH1ArzLCBWT62IoJdHtrpI3jU/gGaqWeASWyOK2/kaXm3I Wagv5/gIPNczYvFrmeHUk7ElhO1S6hQQmZ5Dim4L4M7o+AWNxvitK0sHH+jjqQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPj4DsSz15nJ; Sat, 27 Jul 2024 11:56:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuPmW039949; Sat, 27 Jul 2024 11:56:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuPcd039946; Sat, 27 Jul 2024 11:56:25 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:25 GMT Message-Id: <202407271156.46RBuPcd039946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 85d1c84c2406 - main - snd_hdsp*: Free up channel resources in case of CHANNEL_INIT() failure List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85d1c84c2406aa2e4e2114215b01eee65714848f Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=85d1c84c2406aa2e4e2114215b01eee65714848f commit 85d1c84c2406aa2e4e2114215b01eee65714848f Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:32 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:55:32 +0000 snd_hdsp*: Free up channel resources in case of CHANNEL_INIT() failure Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45982 --- sys/dev/sound/pci/hdsp-pcm.c | 59 ++++++++++++++++++++++--------------------- sys/dev/sound/pci/hdspe-pcm.c | 59 ++++++++++++++++++++++--------------------- 2 files changed, 60 insertions(+), 58 deletions(-) diff --git a/sys/dev/sound/pci/hdsp-pcm.c b/sys/dev/sound/pci/hdsp-pcm.c index 9ba0e5e345d0..29bd0bc70ee4 100644 --- a/sys/dev/sound/pci/hdsp-pcm.c +++ b/sys/dev/sound/pci/hdsp-pcm.c @@ -661,6 +661,35 @@ clean(struct sc_chinfo *ch) } /* Channel interface. */ +static int +hdspchan_free(kobj_t obj, void *data) +{ + struct sc_pcminfo *scp; + struct sc_chinfo *ch; + struct sc_info *sc; + + ch = data; + scp = ch->parent; + sc = scp->sc; + +#if 0 + device_printf(scp->dev, "hdspchan_free()\n"); +#endif + + snd_mtxlock(sc->lock); + if (ch->data != NULL) { + free(ch->data, M_HDSP); + ch->data = NULL; + } + if (ch->caps != NULL) { + free(ch->caps, M_HDSP); + ch->caps = NULL; + } + snd_mtxunlock(sc->lock); + + return (0); +} + static void * hdspchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) @@ -720,6 +749,7 @@ hdspchan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, if (sndbuf_setup(ch->buffer, ch->data, ch->size) != 0) { device_printf(scp->dev, "Can't setup sndbuf.\n"); + hdspchan_free(obj, ch); return (NULL); } @@ -793,35 +823,6 @@ hdspchan_getptr(kobj_t obj, void *data) return (pos); } -static int -hdspchan_free(kobj_t obj, void *data) -{ - struct sc_pcminfo *scp; - struct sc_chinfo *ch; - struct sc_info *sc; - - ch = data; - scp = ch->parent; - sc = scp->sc; - -#if 0 - device_printf(scp->dev, "hdspchan_free()\n"); -#endif - - snd_mtxlock(sc->lock); - if (ch->data != NULL) { - free(ch->data, M_HDSP); - ch->data = NULL; - } - if (ch->caps != NULL) { - free(ch->caps, M_HDSP); - ch->caps = NULL; - } - snd_mtxunlock(sc->lock); - - return (0); -} - static int hdspchan_setformat(kobj_t obj, void *data, uint32_t format) { diff --git a/sys/dev/sound/pci/hdspe-pcm.c b/sys/dev/sound/pci/hdspe-pcm.c index e7fa03904595..79bfcbea3406 100644 --- a/sys/dev/sound/pci/hdspe-pcm.c +++ b/sys/dev/sound/pci/hdspe-pcm.c @@ -650,6 +650,35 @@ clean(struct sc_chinfo *ch) } /* Channel interface. */ +static int +hdspechan_free(kobj_t obj, void *data) +{ + struct sc_pcminfo *scp; + struct sc_chinfo *ch; + struct sc_info *sc; + + ch = data; + scp = ch->parent; + sc = scp->sc; + +#if 0 + device_printf(scp->dev, "hdspechan_free()\n"); +#endif + + snd_mtxlock(sc->lock); + if (ch->data != NULL) { + free(ch->data, M_HDSPE); + ch->data = NULL; + } + if (ch->caps != NULL) { + free(ch->caps, M_HDSPE); + ch->caps = NULL; + } + snd_mtxunlock(sc->lock); + + return (0); +} + static void * hdspechan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, struct pcm_channel *c, int dir) @@ -702,6 +731,7 @@ hdspechan_init(kobj_t obj, void *devinfo, struct snd_dbuf *b, if (sndbuf_setup(ch->buffer, ch->data, ch->size) != 0) { device_printf(scp->dev, "Can't setup sndbuf.\n"); + hdspechan_free(obj, ch); return (NULL); } @@ -774,35 +804,6 @@ hdspechan_getptr(kobj_t obj, void *data) return (pos); } -static int -hdspechan_free(kobj_t obj, void *data) -{ - struct sc_pcminfo *scp; - struct sc_chinfo *ch; - struct sc_info *sc; - - ch = data; - scp = ch->parent; - sc = scp->sc; - -#if 0 - device_printf(scp->dev, "hdspechan_free()\n"); -#endif - - snd_mtxlock(sc->lock); - if (ch->data != NULL) { - free(ch->data, M_HDSPE); - ch->data = NULL; - } - if (ch->caps != NULL) { - free(ch->caps, M_HDSPE); - ch->caps = NULL; - } - snd_mtxunlock(sc->lock); - - return (0); -} - static int hdspechan_setformat(kobj_t obj, void *data, uint32_t format) { From nobody Sat Jul 27 11:56:26 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPk6jpPz5S6l0; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPk5ZYYz42yt; Sat, 27 Jul 2024 11:56:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7kVD1mV5Nox1QU5gcM+8Fh8RmcWFvAgp95g+38jmXVA=; b=xLiZxGOF3y+hsg96Ilw9Yige21eUeZo/VxbSxai2L9EURugviIrFls/tU/3Zr/8pa6W4ZU sLrMuUXUSQTy3yfTkr/AaGl7U+PdDAs4j0xteFtWMC74nX62U9ran2rtczlrzyESjhDetL L5t9TEa7T9m5znGONZeojRvEz+z8g2EYQb1CwsFd/0JASXcW38ItgT6g5NwYky4zeW+IQs lAJ7FYBuBIjSsnYEc2sRMntj57KLmRNqj1UHesJKHFA+FbVr/xKP1uFKtO1fm0ZG1ObTbg oGZqJYDD+rQDyAu9fX1rbgfVHWRPPfpglfAHB3PaWbdkk9fbr1tLTdvmH17/3A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081386; a=rsa-sha256; cv=none; b=xgMQt1SvtInWCa0O3aT3gXzJgzHdG9wppf4umZO9UxDHnwq9+ouOIFFXCeQtUH8vU+Hthf gT9Qg6Ga50o1s0PdL8Q/7Y2rYCZVFz7BPpqMNIoBUMOw6pcS7/3Sx+LoEhr+KVSOwLVH9c vZoMcnO9JW4jq7JrT9zp1sPbanaEgBVQphKSW7u9BzPNv3YAws64kToI0cobyKHCRambaq Egl6+u/c6fzjy15QttFeQp/5oWudVaaRdD0Gt6ZNUFCkoNimjzbSoOUyjwgut6NVmukDIq W96hr5Xy7rZUMfJ/4lA6cle8m42Ktcij3Jd01kVON5Lzd/FZDXo4SBlsI8vxBg== 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=1722081386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=7kVD1mV5Nox1QU5gcM+8Fh8RmcWFvAgp95g+38jmXVA=; b=H7sCe2TjmhlyawntRSHk12bxk74JJ5+tOC4gD4GbYwoY3BhUIoaVDLU2MtLe/qZsvcizVj x6Y28DRktuwD8QBjPbJATm2vm1RkuERt/9r3oSSENJPczqjox/KO2e36EfkUDn1hyEeuaf pzpbPOlu3UJRjkinmA2laJutLYoxhaJsOEpM+KZ6rPDwXdpfNRfv/DbGjraXjYjCxZBptd 3/mYiv5RuG+wmEaMYQ45JRoSB4CRWqJZOOD6MfxJFE1ZxxWfE78dhpcEZhbKmtaylRzey/ 8h1K+/+Df8+qw2I4dKmQlBh184p703MsAdKMPPR00CVUZXB88joc2vQp19yBPw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPk5C3lz15yN; Sat, 27 Jul 2024 11:56:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuQuV040001; Sat, 27 Jul 2024 11:56:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuQ6j039998; Sat, 27 Jul 2024 11:56:26 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:26 GMT Message-Id: <202407271156.46RBuQ6j039998@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 29ff7b08be36 - main - sound: Rename chn_* feeder functions to feeder_* List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 29ff7b08be363f0d4345794bb951d5c0c8406a0a Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=29ff7b08be363f0d4345794bb951d5c0c8406a0a commit 29ff7b08be363f0d4345794bb951d5c0c8406a0a Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:37 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:55:37 +0000 sound: Rename chn_* feeder functions to feeder_* Avoid layering violation. No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45983 --- sys/dev/sound/pcm/channel.c | 8 ++++---- sys/dev/sound/pcm/feeder.c | 6 +++--- sys/dev/sound/pcm/feeder.h | 6 +++--- sys/dev/sound/pcm/feeder_chain.c | 16 ++++++++-------- sys/dev/sound/pcm/feeder_eq.c | 4 ++-- sys/dev/sound/pcm/feeder_rate.c | 2 +- sys/dev/sound/pcm/mixer.c | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 19808a43631a..511d5256c06b 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1287,7 +1287,7 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, __func__); goto out2; } - if (chn_addfeeder(c, fc, NULL)) { + if (feeder_add(c, fc, NULL)) { device_printf(d->dev, "%s(): failed to add feeder\n", __func__); goto out2; } @@ -1365,7 +1365,7 @@ out2: if (CHN_LOCKOWNED(c)) CHN_UNLOCK(c); if (ret) { - while (chn_removefeeder(c) == 0) + while (feeder_remove(c) == 0) ; if (c->devinfo) { if (CHANNEL_FREE(c->methods, c->devinfo)) @@ -1407,7 +1407,7 @@ chn_kill(struct pcm_channel *c) chn_trigger(c, PCMTRIG_ABORT); CHN_UNLOCK(c); } - while (chn_removefeeder(c) == 0) + while (feeder_remove(c) == 0) ; if (CHANNEL_FREE(c->methods, c->devinfo)) sndbuf_free(b); @@ -2300,7 +2300,7 @@ chn_syncstate(struct pcm_channel *c) else bass = ((bass & 0x7f) + ((bass >> 8) & 0x7f)) >> 1; - f = chn_findfeeder(c, FEEDER_EQ); + f = feeder_find(c, FEEDER_EQ); if (f != NULL) { if (FEEDER_SET(f, FEEDEQ_TREBLE, treble) != 0) device_printf(c->dev, diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c index 0113299bd0d4..fdbf2a8353e0 100644 --- a/sys/dev/sound/pcm/feeder.c +++ b/sys/dev/sound/pcm/feeder.c @@ -232,7 +232,7 @@ feeder_getclass(struct pcm_feederdesc *desc) } int -chn_addfeeder(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc *desc) +feeder_add(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc *desc) { struct pcm_feeder *nf; @@ -250,7 +250,7 @@ chn_addfeeder(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederd } int -chn_removefeeder(struct pcm_channel *c) +feeder_remove(struct pcm_channel *c) { struct pcm_feeder *f; @@ -264,7 +264,7 @@ chn_removefeeder(struct pcm_channel *c) } struct pcm_feeder * -chn_findfeeder(struct pcm_channel *c, u_int32_t type) +feeder_find(struct pcm_channel *c, u_int32_t type) { struct pcm_feeder *f; diff --git a/sys/dev/sound/pcm/feeder.h b/sys/dev/sound/pcm/feeder.h index c3d6f89d102e..f2a865d3d2f9 100644 --- a/sys/dev/sound/pcm/feeder.h +++ b/sys/dev/sound/pcm/feeder.h @@ -58,10 +58,10 @@ u_int32_t snd_fmtbestbit(u_int32_t fmt, u_int32_t *fmts); u_int32_t snd_fmtbestchannel(u_int32_t fmt, u_int32_t *fmts); u_int32_t snd_fmtbest(u_int32_t fmt, u_int32_t *fmts); -int chn_addfeeder(struct pcm_channel *c, struct feeder_class *fc, +int feeder_add(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc *desc); -int chn_removefeeder(struct pcm_channel *c); -struct pcm_feeder *chn_findfeeder(struct pcm_channel *c, u_int32_t type); +int feeder_remove(struct pcm_channel *c); +struct pcm_feeder *feeder_find(struct pcm_channel *c, u_int32_t type); void feeder_printchain(struct pcm_feeder *head); int feeder_chain(struct pcm_channel *); diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c index 52351ef58510..555cd86d60e5 100644 --- a/sys/dev/sound/pcm/feeder_chain.c +++ b/sys/dev/sound/pcm/feeder_chain.c @@ -157,7 +157,7 @@ feeder_build_format(struct pcm_channel *c, struct feeder_chain_desc *cdesc) desc->in = cdesc->current.afmt; desc->out = cdesc->target.afmt; - ret = chn_addfeeder(c, fc, desc); + ret = feeder_add(c, fc, desc); if (ret != 0) { device_printf(c->dev, "%s(): can't add feeder_format\n", __func__); @@ -230,7 +230,7 @@ feeder_build_rate(struct pcm_channel *c, struct feeder_chain_desc *cdesc) desc->in = cdesc->current.afmt; desc->out = desc->in; - ret = chn_addfeeder(c, fc, desc); + ret = feeder_add(c, fc, desc); if (ret != 0) { device_printf(c->dev, "%s(): can't add feeder_rate\n", __func__); @@ -309,7 +309,7 @@ feeder_build_matrix(struct pcm_channel *c, struct feeder_chain_desc *cdesc) desc->out = SND_FORMAT(cdesc->current.afmt, cdesc->target.matrix->channels, cdesc->target.matrix->ext); - ret = chn_addfeeder(c, fc, desc); + ret = feeder_add(c, fc, desc); if (ret != 0) { device_printf(c->dev, "%s(): can't add feeder_matrix\n", __func__); @@ -365,7 +365,7 @@ feeder_build_volume(struct pcm_channel *c, struct feeder_chain_desc *cdesc) desc->in = cdesc->current.afmt; desc->out = desc->in; - ret = chn_addfeeder(c, fc, desc); + ret = feeder_add(c, fc, desc); if (ret != 0) { device_printf(c->dev, "%s(): can't add feeder_volume\n", __func__); @@ -433,7 +433,7 @@ feeder_build_eq(struct pcm_channel *c, struct feeder_chain_desc *cdesc) desc->in = cdesc->current.afmt; desc->out = desc->in; - ret = chn_addfeeder(c, fc, desc); + ret = feeder_add(c, fc, desc); if (ret != 0) { device_printf(c->dev, "%s(): can't add feeder_eq\n", __func__); @@ -472,7 +472,7 @@ feeder_build_root(struct pcm_channel *c, struct feeder_chain_desc *cdesc) return (ENOTSUP); } - ret = chn_addfeeder(c, fc, NULL); + ret = feeder_add(c, fc, NULL); if (ret != 0) { device_printf(c->dev, "%s(): can't add feeder_root\n", __func__); @@ -513,7 +513,7 @@ feeder_build_mixer(struct pcm_channel *c, struct feeder_chain_desc *cdesc) desc->in = cdesc->current.afmt; desc->out = desc->in; - ret = chn_addfeeder(c, fc, desc); + ret = feeder_add(c, fc, desc); if (ret != 0) { device_printf(c->dev, "%s(): can't add feeder_mixer\n", __func__); @@ -588,7 +588,7 @@ feeder_chain(struct pcm_channel *c) CHN_LOCKASSERT(c); /* Remove everything first. */ - while (chn_removefeeder(c) == 0) + while (feeder_remove(c) == 0) ; KASSERT(c->feeder == NULL, ("feeder chain not empty")); diff --git a/sys/dev/sound/pcm/feeder_eq.c b/sys/dev/sound/pcm/feeder_eq.c index a097b13cd986..3c9d9cda9d62 100644 --- a/sys/dev/sound/pcm/feeder_eq.c +++ b/sys/dev/sound/pcm/feeder_eq.c @@ -584,7 +584,7 @@ sysctl_dev_pcm_eq(SYSCTL_HANDLER_ARGS) CHN_FOREACH(c, d, channels.pcm.busy) { CHN_LOCK(c); - f = chn_findfeeder(c, FEEDER_EQ); + f = feeder_find(c, FEEDER_EQ); if (f != NULL) (void)FEEDER_SET(f, FEEDEQ_STATE, val); CHN_UNLOCK(c); @@ -643,7 +643,7 @@ sysctl_dev_pcm_eq_preamp(SYSCTL_HANDLER_ARGS) CHN_FOREACH(c, d, channels.pcm.busy) { CHN_LOCK(c); - f = chn_findfeeder(c, FEEDER_EQ); + f = feeder_find(c, FEEDER_EQ); if (f != NULL) (void)FEEDER_SET(f, FEEDEQ_PREAMP, val); CHN_UNLOCK(c); diff --git a/sys/dev/sound/pcm/feeder_rate.c b/sys/dev/sound/pcm/feeder_rate.c index c8cc67e8fa80..77de21e7a31a 100644 --- a/sys/dev/sound/pcm/feeder_rate.c +++ b/sys/dev/sound/pcm/feeder_rate.c @@ -268,7 +268,7 @@ sysctl_hw_snd_feeder_rate_quality(SYSCTL_HANDLER_ARGS) PCM_ACQUIRE(d); CHN_FOREACH(c, d, channels.pcm) { CHN_LOCK(c); - f = chn_findfeeder(c, FEEDER_RATE); + f = feeder_find(c, FEEDER_RATE); if (f == NULL || f->data == NULL || CHN_STARTED(c)) { CHN_UNLOCK(c); continue; diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c index 0cf6a9f42f8f..6d74fa975f03 100644 --- a/sys/dev/sound/pcm/mixer.c +++ b/sys/dev/sound/pcm/mixer.c @@ -224,7 +224,7 @@ mixer_set_eq(struct snd_mixer *m, struct snddev_info *d, CHN_FOREACH(c, d, channels.pcm.busy) { CHN_LOCK(c); - f = chn_findfeeder(c, FEEDER_EQ); + f = feeder_find(c, FEEDER_EQ); if (f != NULL) (void)FEEDER_SET(f, tone, level); CHN_UNLOCK(c); From nobody Sat Jul 27 11:56:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPm3JY8z5S6RM; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPl6jbJz436s; Sat, 27 Jul 2024 11:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4VhKYkDHUKOM1QBcieXHVNqyrE/vvAFHXN+WduA127g=; b=JqpHZfeyyYDIcJ4HE9mbqD5busBBSfAsRBU77pYqn2SmrgNJYSitkEt6OpJh0n154lJNkH I9iaHNg3jZzM3ZyuS8fGDXM3j+wdnASyOxX4WvNVUrWh7nvC0GiHzDFzrkdJvfE65Z/pXW yJSJ6VDHFkoU+8z6bJc7kJiyVKWIfb95mTtRO52Rv8M9uXh2iaTRA44n62gjP9n3aT9Qbu UrpJn7pGAfQBIJdKFyW2IZbozWhwfmB3d96j5hSRafF4MZ8+vyQJj2Na8bfWX5Niw+vnXO Yu04SrmjLLQd29IvfTmV4LPMluZelg6lAHDvy6ITBapM3yuNjrfxrfAGkGwScw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081387; a=rsa-sha256; cv=none; b=bbWo8cxsuCpMV2oH7Utr1E+ol5Uc3OkX/OuBmyrkPaVxDSqSmleYIIDBSvQ/MOqwEktDgl +HHReEcTDoI0JAnEt/zmW2Z2zqjtfCFxs/moQwk2Y5BTuuHsS51GzwJoWwVrfDIXUfKn9y PEe9Tn+ADfpec7AjFgH4exQbCohkOGCoNu/n21MA2jSeIbyWnuLX6ryDKUSrbsQEmtmd8c dgPMGmdQBqUZhZeRj2934q0IAHTFfDU+b9tsEtXnKOF9z8BLaahw+8SKmw+K++SxS8f1vf SogiYbiflvcA9XhQ5aAY+nzukhT5zinmOlzE5256QNiC7O0CBmmG0iMX6O7Qyw== 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=1722081387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4VhKYkDHUKOM1QBcieXHVNqyrE/vvAFHXN+WduA127g=; b=pwbdiyL1VtMX3Z0/gTqwcGJhddx6Cg8gswKEk0AuyODkFxez8tAnjuCDRMICFghH69B8mO ZNvrZAwDl2+YSboyXfgzc2MXGXeCi2Uq/RqywcGLAfmPpREYbpay6quMnrptCcGt36ifjb +d1Sn38PTBjjDhpJ6FQG/cZt0yqRng1nhd2w7jcl9Ymjek7eMCN7sKyfsYUtHKRaX+D4Pj bMHKphQanzNDdkYvfqxx4S8nx2PTT8GuIVpJRO3vQ7L2c6EYKwIL/1y8bpvPBK9z9S+BI9 7rsPTA9q4ocO7Jn3Nk9vf62/gap6o18UcfICIuuVZbgOzPsniXkTpdQVI7bA2A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPl6Gpjz15vt; Sat, 27 Jul 2024 11:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuROh040042; Sat, 27 Jul 2024 11:56:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuRt6040039; Sat, 27 Jul 2024 11:56:27 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:27 GMT Message-Id: <202407271156.46RBuRt6040039@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: c55f995502cb - main - sound: Remove unused FEEDER_DEBUG List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c55f995502cbaa2d38b7a7003bc27805b28a6a29 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=c55f995502cbaa2d38b7a7003bc27805b28a6a29 commit c55f995502cbaa2d38b7a7003bc27805b28a6a29 Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:42 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:55:42 +0000 sound: Remove unused FEEDER_DEBUG No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45984 --- sys/dev/sound/pcm/feeder.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c index fdbf2a8353e0..ad6966331f02 100644 --- a/sys/dev/sound/pcm/feeder.c +++ b/sys/dev/sound/pcm/feeder.c @@ -39,7 +39,6 @@ static MALLOC_DEFINE(M_FEEDER, "feeder", "pcm feeder"); #define MAXFEEDERS 256 -#undef FEEDER_DEBUG struct feedertab_entry { SLIST_ENTRY(feedertab_entry) link; From nobody Sat Jul 27 11:56:28 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPn32Vzz5S6l8; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPn0pxVz42wy; Sat, 27 Jul 2024 11:56:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W9fZQpb/tyBzT591tsnM0qBYyq3KT+pTrgFNjzpNMwY=; b=HRQ5fzbV3Z7DIMq/ugU0Pp5bjh4lqd4qSV3uEcxBBsNQ+Pr2CWlKgDHHsQa9lVB/8aNFz1 y25uo2Y9BLwk2nVL1L0bo/U3D0mHsI76L9/TSYYKAY+eKA7SJ7ZdOYIweyN2KoU555egaH CUuV8F9G1X/2lbCFTXbMSW3WakBo5xIvrtqAQ7rH+mxh5aQrXAjnsYEMxUkA4dZ5VhU7Du BQF+wRJP1LfU69xUHKqA1MJGtuW9u2Mk6XVj1RdmNVr9z8P2KuN2hCpxGLcVZNqI0jC5fA VuOcutwUIiOKhPN5vLiUfZ2Wc4UxV/XIoqxnlbJlXYaNAUnKSfKHgh+PjJhRHA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081389; a=rsa-sha256; cv=none; b=cV7c3ZP0j1Pqjs0/5lV3GxKWVqGTT+55JnAO3xZ6dviNAXQY40fJE/I2ztQ4j69IR4iprZ NobNL3gM28c8JFQwwQr0SR0y3yIXwFsZLkbH+VKFudsm+dsJFLcyoihOc/P7iEDipWJLLP mE9gzYWyu7Rmm9COkQ1acDniBYxXjTo8jJiHwA7/UUt1zRbglG/uyJGQQ/5ZLCOSM4x4b/ eI96bn4xhM39b5Wj2i4AT9dLfF46G9aLY6cjLsVSMuH/SAtktvO4qt4uydhhwoaCI8kQsP 0x3n9w7Nv/pNQcsZQD48bOj+Lw7AMO1Yk2W9th/bcksh7N8oX0XVwxIJhLNgqw== 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=1722081389; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W9fZQpb/tyBzT591tsnM0qBYyq3KT+pTrgFNjzpNMwY=; b=cISrqZ2En7Eb59yjbs7G/SYZjAZ6gd/GfRsv0c14g3n+xTZYRrRnVvJXkt2yr+pbWVgC8f Uxb6yo0EukIMwz1eyjUNpVG8ji4VgTDuzwWpgqotW3kh4NTpyUddhNpY5CZtX4482T3hOI Q+/3kIuspxVI++w8cEdYOidrLhQWD7+8gTYnbxolGHFnRXQeMs6BF7qVMTwRltqPmOmiYL dr5LntS8ruPM+6OrmyCyvKYzKiSmYF+EhQ4PUlDaaROHzonwhqBWCQHf9DdzSngMuaRjS/ 5vUu/qojUwleSSOPsgpUnXC5gDCjRYvWEN13fmZhgtzPu4klMRjPLNducAcgtw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPn0FjRz15yP; Sat, 27 Jul 2024 11:56:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuSOW040078; Sat, 27 Jul 2024 11:56:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuSA1040075; Sat, 27 Jul 2024 11:56:28 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:28 GMT Message-Id: <202407271156.46RBuSA1040075@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 5b209e153b58 - main - sound: Simplify chn_init() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b209e153b58515c0315f5902e18ecd7d75ecd2a Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=5b209e153b58515c0315f5902e18ecd7d75ecd2a commit 5b209e153b58515c0315f5902e18ecd7d75ecd2a Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:47 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:55:47 +0000 sound: Simplify chn_init() - Remove unnecessary CHN_[UN]LOCKs. - Improve device_printf() messages. - Remove redundant checks. - Remove 0 assignments, since the channel is allocated with M_ZERO. - Re-organize sections in a more coherent way. - Remove "out1" label, just return NULL directly. - Rename "out2" to "fail" and simplify logic. - Do not check the return value of dsp_unit2name(), as it is guaranteed not to fail (we pass a valid channel type). Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45985 --- sys/dev/sound/pcm/channel.c | 177 ++++++++++++++++---------------------------- 1 file changed, 63 insertions(+), 114 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 511d5256c06b..ce4fb7222ddb 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1164,8 +1164,8 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, struct pcm_channel *c; struct feeder_class *fc; struct snd_dbuf *b, *bs; - char *dirs, *devname, buf[CHN_NAMELEN]; - int i, ret, direction, rpnum, *pnum, max, type, unit; + char *dirs, buf[CHN_NAMELEN]; + int i, direction, *pnum, max, type, unit; PCM_BUSYASSERT(d); PCM_LOCKASSERT(d); @@ -1203,148 +1203,106 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, device_printf(d->dev, "%s(): invalid channel direction: %d\n", __func__, dir); - goto out1; + return (NULL); } - unit = 0; - - if (*pnum >= max || unit >= max) { - device_printf(d->dev, "%s(): unit=%d or pnum=%d >= than " - "max=%d\n", __func__, unit, *pnum, max); - goto out1; + if (*pnum >= max) { + device_printf(d->dev, "%s(): cannot allocate more channels " + "(max=%d)\n", __func__, max); + return (NULL); } - rpnum = 0; - + unit = 0; CHN_FOREACH(c, d, channels.pcm) { if (c->type != type) continue; unit++; if (unit >= max) { - device_printf(d->dev, - "%s(): chan=%d >= max=%d\n", __func__, unit, max); - goto out1; + device_printf(d->dev, "%s(): cannot allocate more " + "channels for type=%d (max=%d)\n", + __func__, type, max); + return (NULL); } - rpnum++; - } - - if (*pnum != rpnum) { - device_printf(d->dev, - "%s(): pnum screwed: dirs=%s pnum=%d rpnum=%d\n", - __func__, dirs, *pnum, rpnum); - goto out1; } PCM_UNLOCK(d); b = NULL; bs = NULL; + c = malloc(sizeof(*c), M_DEVBUF, M_WAITOK | M_ZERO); c->methods = kobj_create(cls, M_DEVBUF, M_WAITOK | M_ZERO); + chn_lockinit(c, dir); + CHN_INIT(c, children); + CHN_INIT(c, children.busy); + c->direction = direction; c->type = type; c->unit = unit; + c->format = SND_FORMAT(AFMT_U8, 1, 0); + c->speed = DSP_DEFAULT_SPEED; c->pid = -1; + c->latency = -1; + c->timeout = 1; strlcpy(c->comm, CHN_COMM_UNUSED, sizeof(c->comm)); c->parentsnddev = d; c->parentchannel = parent; c->dev = d->dev; c->trigger = PCMTRIG_STOP; - chn_lockinit(c, dir); - devname = dsp_unit2name(buf, sizeof(buf), c); - if (devname == NULL) { - ret = EINVAL; - device_printf(d->dev, "%s(): failed to create channel name", - __func__); - goto out2; - } + snprintf(c->name, sizeof(c->name), "%s:%s:%s", - device_get_nameunit(c->dev), dirs, devname); + device_get_nameunit(c->dev), dirs, + dsp_unit2name(buf, sizeof(buf), c)); - CHN_INIT(c, children); - CHN_INIT(c, children.busy); - c->latency = -1; - c->timeout = 1; + c->matrix = *feeder_matrix_id_map(SND_CHN_MATRIX_1_0); + c->matrix.id = SND_CHN_MATRIX_PCMCHANNEL; - ret = ENOMEM; - b = sndbuf_create(c->dev, c->name, "primary", c); - if (b == NULL) { - device_printf(d->dev, "%s(): failed to create hardware buffer\n", - __func__); - goto out2; - } - bs = sndbuf_create(c->dev, c->name, "secondary", c); - if (bs == NULL) { - device_printf(d->dev, "%s(): failed to create software buffer\n", - __func__); - goto out2; - } + for (i = 0; i < SND_CHN_T_MAX; i++) + c->volume[SND_VOL_C_MASTER][i] = SND_VOL_0DB_MASTER; + + c->volume[SND_VOL_C_MASTER][SND_CHN_T_VOL_0DB] = SND_VOL_0DB_MASTER; + c->volume[SND_VOL_C_PCM][SND_CHN_T_VOL_0DB] = chn_vol_0db_pcm; CHN_LOCK(c); + chn_vpc_reset(c, SND_VOL_C_PCM, 1); + CHN_UNLOCK(c); - ret = EINVAL; fc = feeder_getclass(NULL); if (fc == NULL) { device_printf(d->dev, "%s(): failed to get feeder class\n", __func__); - goto out2; + goto fail; } if (feeder_add(c, fc, NULL)) { device_printf(d->dev, "%s(): failed to add feeder\n", __func__); - goto out2; + goto fail; } - /* - * XXX - sndbuf_setup() & sndbuf_resize() expect to be called - * with the channel unlocked because they are also called - * from driver methods that don't know about locking - */ - CHN_UNLOCK(c); - sndbuf_setup(bs, NULL, 0); - CHN_LOCK(c); + b = sndbuf_create(c->dev, c->name, "primary", c); + bs = sndbuf_create(c->dev, c->name, "secondary", c); + if (b == NULL || bs == NULL) { + device_printf(d->dev, "%s(): failed to create %s buffer\n", + __func__, b == NULL ? "hardware" : "software"); + goto fail; + } c->bufhard = b; c->bufsoft = bs; - c->flags = 0; - c->feederflags = 0; - c->sm = NULL; - c->format = SND_FORMAT(AFMT_U8, 1, 0); - c->speed = DSP_DEFAULT_SPEED; - c->matrix = *feeder_matrix_id_map(SND_CHN_MATRIX_1_0); - c->matrix.id = SND_CHN_MATRIX_PCMCHANNEL; - - for (i = 0; i < SND_CHN_T_MAX; i++) { - c->volume[SND_VOL_C_MASTER][i] = SND_VOL_0DB_MASTER; - } - - c->volume[SND_VOL_C_MASTER][SND_CHN_T_VOL_0DB] = SND_VOL_0DB_MASTER; - c->volume[SND_VOL_C_PCM][SND_CHN_T_VOL_0DB] = chn_vol_0db_pcm; - - memset(c->muted, 0, sizeof(c->muted)); - - chn_vpc_reset(c, SND_VOL_C_PCM, 1); - - ret = ENODEV; - CHN_UNLOCK(c); /* XXX - Unlock for CHANNEL_INIT() malloc() call */ c->devinfo = CHANNEL_INIT(c->methods, devinfo, b, c, direction); - CHN_LOCK(c); if (c->devinfo == NULL) { - device_printf(d->dev, "%s(): NULL devinfo\n", __func__); - goto out2; + device_printf(d->dev, "%s(): CHANNEL_INIT() failed\n", __func__); + goto fail; } - ret = ENOMEM; if ((sndbuf_getsize(b) == 0) && ((c->flags & CHN_F_VIRTUAL) == 0)) { device_printf(d->dev, "%s(): hardware buffer's size is 0\n", __func__); - goto out2; + goto fail; } - ret = 0; - c->direction = direction; - sndbuf_setfmt(b, c->format); sndbuf_setspd(b, c->speed); sndbuf_setfmt(bs, c->format); sndbuf_setspd(bs, c->speed); + sndbuf_setup(bs, NULL, 0); /** * @todo Should this be moved somewhere else? The primary buffer @@ -1355,42 +1313,33 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, bs->sl = sndbuf_getmaxsize(bs); bs->shadbuf = malloc(bs->sl, M_DEVBUF, M_NOWAIT); if (bs->shadbuf == NULL) { - ret = ENOMEM; device_printf(d->dev, "%s(): failed to create shadow " "buffer\n", __func__); - goto out2; + goto fail; } } -out2: - if (CHN_LOCKOWNED(c)) - CHN_UNLOCK(c); - if (ret) { - while (feeder_remove(c) == 0) - ; - if (c->devinfo) { - if (CHANNEL_FREE(c->methods, c->devinfo)) - sndbuf_free(b); - } - if (bs) - sndbuf_destroy(bs); - if (b) - sndbuf_destroy(b); - CHN_LOCK(c); - c->flags |= CHN_F_DEAD; - chn_lockdestroy(c); - PCM_LOCK(d); + PCM_LOCK(d); - kobj_delete(c->methods, M_DEVBUF); - free(c, M_DEVBUF); + return (c); - return (NULL); - } +fail: + while (feeder_remove(c) == 0) + ; + if (c->devinfo && CHANNEL_FREE(c->methods, c->devinfo)) + sndbuf_free(b); + if (bs) + sndbuf_destroy(bs); + if (b) + sndbuf_destroy(b); + CHN_LOCK(c); + chn_lockdestroy(c); + + kobj_delete(c->methods, M_DEVBUF); + free(c, M_DEVBUF); PCM_LOCK(d); - return (c); -out1: return (NULL); } From nobody Sat Jul 27 11:56:30 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPp41Tlz5S6nP; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPp1mxtz437B; Sat, 27 Jul 2024 11:56:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D4PXhai4sTG8fBVZ8VB1HNsy2eB2EDY5XVx8AeMNuRw=; b=HCP3q1jV853J9hUWjZSzyHQFa8DP2pKoPf71Mg7fVjIDrEBkhbmmTQxaKAu9cuPwxghNXz DO8DkvbxpXBPjDiTrGCE4sM13o2mVo2MzVK9zzUBIGwKznoFni1xWOUx2aI8SrJwEGrwEF mRxDqU3+3jPcISDow8wN1pgEBiey+tH6CvgbwSdcOj3xDhqJd03bikCPXYcyTRY9UH/x/H 19c3+5Sv3itY8ArtC29ed8YCymCGBvu2/40gAeyKIF7Dj2IN4slV+BU8Mtt4QIFcCem2Hi 5quni3r7SxGJ2HZMV3n8lpSONoG5hjpJrBl6fhIaObPouh+wQkmShdyALL2xZA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081390; a=rsa-sha256; cv=none; b=XVNGeYqGd4+xXAzXyGyLX1XcPJk7NkK7s60W1LV5ZsrgTyo+yO0ycI0G85EM3Zt08J7GAC rdn/jlmVY8lOy1i8OFGo41MLB5n9uRw3V1SlLuvdjC11HDrXreDG6ZMv7UeiBoAvnQ4bdT V4QJikEZq37//2O0kllU1v5CvSdZVGc0yMKTg2Ffg3hKY+m2/g9r8LkLnyl4QQG8oMNHNY b+CtjrtDQ9UcE2dmZgeuruAHZG10njtKqtQNH9z+JzbCzWzOI8kHC0qu7ej6t07OA1Usq8 e6aJBEbtACevxwj2DmWFrWtVJY9wZB4j1iZazsNPlM4JptbLzaLexlPpv+ZyuA== 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=1722081390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D4PXhai4sTG8fBVZ8VB1HNsy2eB2EDY5XVx8AeMNuRw=; b=uXhlWReIA5eY/ESiTa9fHKXtlyrNIBT57Y/wqlcLYqrV0q8olT05UaQeP56Mf/MUJEE2Eu J17xJm07hBYbRxthX1/rK5OG6ndSvQxpI1KKCWndUPgo3lbPCvS/GiTYPRzNxYXlfJYjHk Ubok7J0RbMdfSCu91zmnW7TAPclYK0GSnnMY/cz0A79pzuIpJgusnAxslMWKR93JYdfhuw 3td+Achtr926FPd5tP9WdH2z8VzrTWDFAg362T34h84JXxFft5Ve/pjsIcSn2sVT7MSt2N 4+tWCmp4yrZNvGY6Z0AjlGuz2tHng0COF3ho/oXhBhqRykdiZDij5pBO4HmxBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPp15ZDz15sQ; Sat, 27 Jul 2024 11:56:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuUqf040125; Sat, 27 Jul 2024 11:56:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuUCH040122; Sat, 27 Jul 2024 11:56:30 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:30 GMT Message-Id: <202407271156.46RBuUCH040122@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: f477d412530a - main - sound: Remove unused defines from pcm/sound.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f477d412530a8cb9d8e058d00189ce127584f6f6 Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f477d412530a8cb9d8e058d00189ce127584f6f6 commit f477d412530a8cb9d8e058d00189ce127584f6f6 Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:52 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:55:52 +0000 sound: Remove unused defines from pcm/sound.h Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D45986 --- sys/dev/sound/pcm/sound.h | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index e4a3ba41ee7f..5f32dd767fe8 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -126,9 +126,6 @@ struct snd_mixer; #define SD_F_PRIO_RD 0x10000000 #define SD_F_PRIO_WR 0x20000000 -#define SD_F_PRIO_SET (SD_F_PRIO_RD | SD_F_PRIO_WR) -#define SD_F_DIR_SET 0x40000000 -#define SD_F_TRANSIENT 0xf0000000 #define SD_F_BITS "\020" \ "\001SIMPLEX" \ @@ -146,8 +143,7 @@ struct snd_mixer; "\015EQ_BYPASSED" \ "\016EQ_PC" \ "\035PRIO_RD" \ - "\036PRIO_WR" \ - "\037DIR_SET" + "\036PRIO_WR" #define PCM_ALIVE(x) ((x) != NULL && (x)->lock != NULL && \ !((x)->flags & SD_F_DYING)) @@ -162,7 +158,6 @@ struct snd_mixer; /* many variables should be reduced to a range. Here define a macro */ #define RANGE(var, low, high) (var) = \ (((var)<(low))? (low) : ((var)>(high))? (high) : (var)) -#define DSP_BUFFSIZE (8192) /* make figuring out what a format is easier. got AFMT_STEREO already */ #define AFMT_32BIT (AFMT_S32_LE | AFMT_S32_BE | AFMT_U32_LE | AFMT_U32_BE) @@ -242,22 +237,12 @@ enum { #define DSP_DEFAULT_SPEED 8000 -#define ON 1 -#define OFF 0 - extern int pcm_veto_load; extern int snd_unit; extern int snd_verbose; extern devclass_t pcm_devclass; extern struct unrhdr *pcmsg_unrhdr; -/* - * some macros for debugging purposes - * DDB/DEB to enable/disable debugging stuff - * BVDDB to enable debugging when bootverbose - */ -#define BVDDB(x) if (bootverbose) x - #ifndef DEB #define DEB(x) #endif From nobody Sat Jul 27 11:56:31 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPq3wF0z5S6qj; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPq2fXPz42xQ; Sat, 27 Jul 2024 11:56:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZN3hgcTwFaVtvXqKn2HhZfThC8xVuOO5btoLN6o2wQk=; b=AsfxC2JKnmitUZJzwPSJ1BcLRzDJAo5lTvRfhBrLcX4Xk808ZtUlGLWu3KeCXV1sh8UPJn wW5X6m3XpzmFvAg9+dYVFfk5XXxPC8tFzAbuYZ161BUpD3r4x6hTHQIWnrm39ezloG8vfC 2Ztg7i5vQJunZ7ZqwKhMvw1YL0bP9XuEe+g+Y87IwlDwv0BLgr2Jnkjq6/p4w6+eFafBfj BKpQIfxxTthJpiszXM4GHRMB6qkymzXyr1TOhgkFl/MKP5ogeU4CFql/RpiUOFB4Jahz/J aBI+jXr2nE1uQO6AhkruONUVARNxUOuUKJ/OE26D5pOdi8FigeZ/CeH1K1/WjA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081391; a=rsa-sha256; cv=none; b=ClF0dZlQ3bWC0Zg+qVJ50TtU3qReQpob7+4892/cNYcv8Q/mdoAph8ddMoidloUd8GDBt9 cuUXePP1jKraLfjrFr6LV8R5IpfZTPEhXKEsvZgI93fODp+Z2XMTbCAiH09CnXcSB2ESpQ gA5UrP4wnqQMsRl99/jmoSNRhvEsfPjRBEViEfLhGfyTckkazrP0eTBfUftn/UZRQ/msAY XQvTj7Le0dwnvQJRCeUJccHVYg7MpyOP8i0Z7jXOeya3rrup7bo4X/HojuX6C2umZiin+j 90p/keTYs935SFKYFCt0bgAQlYGHMidK9EUPOQoSPbYk46QGL3ndBoyiG5gXKQ== 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=1722081391; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZN3hgcTwFaVtvXqKn2HhZfThC8xVuOO5btoLN6o2wQk=; b=YwsYoJa4OtCqaW7OsmkhmAKOC/OMVqnV8gm4i9+b1aZ/LzYzAyt95oSyabGZIQ6GSy2LeB sZt2KNX+H2/f775ml3/Ht3iXc2TN7bTOYvhvGnQ0n0uWwXSc6hbeKlIBU6MGwhFQTc/BTO Q2DlC/DNzIVWb2twNlJl2EAitbRLDqdqkfiuFjbNS6ySiDE2dPcxeqmKSJgdGYHtMXe9S9 59r0HsfCrsB60asp3F6wfx0A4nCdavImSZwfpIRhV6rWlyy25S/YCtwS6eFMX7nsmpVd0g GbByZh7L9cAJ4wjq6cxfkXEuPIRLNMJu/MJkxHj6cNWjVq1IsKnSNZZJXy5vtg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPq2Gfmz15dW; Sat, 27 Jul 2024 11:56:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuVom040166; Sat, 27 Jul 2024 11:56:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuVav040163; Sat, 27 Jul 2024 11:56:31 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:31 GMT Message-Id: <202407271156.46RBuVav040163@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 00172d20070a - main - sound: Simplify feeder_remove() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 00172d20070a544e0514cce9f94475c5525fd15e Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=00172d20070a544e0514cce9f94475c5525fd15e commit 00172d20070a544e0514cce9f94475c5525fd15e Author: Christos Margiolis AuthorDate: 2024-07-27 11:55:57 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:55:57 +0000 sound: Simplify feeder_remove() Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D46100 --- sys/dev/sound/pcm/channel.c | 6 ++---- sys/dev/sound/pcm/feeder.c | 14 ++++++-------- sys/dev/sound/pcm/feeder.h | 2 +- sys/dev/sound/pcm/feeder_chain.c | 3 +-- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index ce4fb7222ddb..e0fd24805a21 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1324,8 +1324,7 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, return (c); fail: - while (feeder_remove(c) == 0) - ; + feeder_remove(c); if (c->devinfo && CHANNEL_FREE(c->methods, c->devinfo)) sndbuf_free(b); if (bs) @@ -1356,8 +1355,7 @@ chn_kill(struct pcm_channel *c) chn_trigger(c, PCMTRIG_ABORT); CHN_UNLOCK(c); } - while (feeder_remove(c) == 0) - ; + feeder_remove(c); if (CHANNEL_FREE(c->methods, c->devinfo)) sndbuf_free(b); sndbuf_destroy(bs); diff --git a/sys/dev/sound/pcm/feeder.c b/sys/dev/sound/pcm/feeder.c index ad6966331f02..716eb07feaae 100644 --- a/sys/dev/sound/pcm/feeder.c +++ b/sys/dev/sound/pcm/feeder.c @@ -248,18 +248,16 @@ feeder_add(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc return 0; } -int +void feeder_remove(struct pcm_channel *c) { struct pcm_feeder *f; - if (c->feeder == NULL) - return -1; - f = c->feeder; - c->feeder = c->feeder->source; - feeder_destroy(f); - - return 0; + while (c->feeder != NULL) { + f = c->feeder; + c->feeder = c->feeder->source; + feeder_destroy(f); + } } struct pcm_feeder * diff --git a/sys/dev/sound/pcm/feeder.h b/sys/dev/sound/pcm/feeder.h index f2a865d3d2f9..1e240d934e94 100644 --- a/sys/dev/sound/pcm/feeder.h +++ b/sys/dev/sound/pcm/feeder.h @@ -60,7 +60,7 @@ u_int32_t snd_fmtbest(u_int32_t fmt, u_int32_t *fmts); int feeder_add(struct pcm_channel *c, struct feeder_class *fc, struct pcm_feederdesc *desc); -int feeder_remove(struct pcm_channel *c); +void feeder_remove(struct pcm_channel *c); struct pcm_feeder *feeder_find(struct pcm_channel *c, u_int32_t type); void feeder_printchain(struct pcm_feeder *head); int feeder_chain(struct pcm_channel *); diff --git a/sys/dev/sound/pcm/feeder_chain.c b/sys/dev/sound/pcm/feeder_chain.c index 555cd86d60e5..588bae2ff281 100644 --- a/sys/dev/sound/pcm/feeder_chain.c +++ b/sys/dev/sound/pcm/feeder_chain.c @@ -588,8 +588,7 @@ feeder_chain(struct pcm_channel *c) CHN_LOCKASSERT(c); /* Remove everything first. */ - while (feeder_remove(c) == 0) - ; + feeder_remove(c); KASSERT(c->feeder == NULL, ("feeder chain not empty")); From nobody Sat Jul 27 11:56:32 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWNPr6SP5z5S6t4; Sat, 27 Jul 2024 11:56: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWNPr4n6rz43BJ; Sat, 27 Jul 2024 11:56:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722081392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UGhK0et+AobJFykCKBqbjCzmYvnA0MjLysIcxstVFeA=; b=OMIS5xyO++r1GChUEvUW3Qo6ZWc9rLD3Md64NTrJDPlRWrjX3BhuzwFXfO09D5+93o40ac hezCfDjOvF/+TyVtRnsZDdO/EeNLX9jMosi5FUR5w3HYaXMK4VwgiW2y+4/mglAWrGqUch LOfe09R2NOkj/JXaIgAIfOmpdiPE3EvFe57DShvMHC5iYyH8WqUA7VBCpwRo6xDT+9OcNS cJdS2DVw9CNsHvnztAWHFNReL6zhau09uZXS1GVAGDQBGel7tgiCj/OX1t4UiYvwOYe6Tc gWKifT/v4Hd0mDkwo5azJR/n61Ngta3WvkP1GR7jB+FxqPzGkM96TtiGVilDcQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722081392; a=rsa-sha256; cv=none; b=lWAtgSzht5EO4o4ITcJjzYEsXpjEjD+YEIQCsGga1tXjgKrzEG/a8pFPUwoX0z2VfzrDs3 vh3tj1SrUEjKQ4XVxtEQFlUZbQljLhUKn7GUTGWZ1mGC00skWZjwtMWPz5Z+Ifj1uQYFqb f4V3YIL7kswBMCo4POCnSzreh1TALVqVrFqIHhc3iu+KLazjHbvQwroymvOoWrJGjFe8r0 3TiddPTypyxg/BaPq9/fHuawAm+xAzweCOcbDFlhljZHtiP5xAaLHTIUDJ+B8gbUTUN5vM Nve/KD4AoCH6ya81b1D5n5KlejtRbAhHWXdOfE2qFn2aJ4bSK+FsAu8bGC20KQ== 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=1722081392; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=UGhK0et+AobJFykCKBqbjCzmYvnA0MjLysIcxstVFeA=; b=oXVfn+w90uSZ33tGEGCZVQdMPIh+XNJ5TqZKjiNkBjpas0ReFtU8tGxi3k3hzri/WMBxJT b9wukNmEj6g71+61VxPyJ0IvNovgPtjO9Rcc20guKs4iWJdBJRPYzED0Tn8vAGBQ3+vEgU W/9uBhGNyz4N6iOGK4wuZSXpe6QnmX4ZTRQGuMgzSQ5K8OPx9gQG5d/7XEqd6u1U43zHSo xy8fwAV62yE6OrS2KiXMw3fFTlEE5yYkyUcsvRfjcf5iKl9fH3ZsGP0xc9mm/ZRbMuHAh1 oEi+Oed7XPM9ABJfPNYX9KG+2Uoisa4EIqFgsgKHWiOXFpYJwVEvZ01wkjKj9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWNPr3JtGz15nK; Sat, 27 Jul 2024 11:56:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RBuW39040210; Sat, 27 Jul 2024 11:56:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RBuWpK040207; Sat, 27 Jul 2024 11:56:32 GMT (envelope-from git) Date: Sat, 27 Jul 2024 11:56:32 GMT Message-Id: <202407271156.46RBuWpK040207@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: f0eceecf5ab5 - main - sndstat.4: Fix typo List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0eceecf5ab51a68d713f9a5a7f360964d0a49ce Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=f0eceecf5ab51a68d713f9a5a7f360964d0a49ce commit f0eceecf5ab51a68d713f9a5a7f360964d0a49ce Author: Christos Margiolis AuthorDate: 2024-07-27 11:56:02 +0000 Commit: Christos Margiolis CommitDate: 2024-07-27 11:56:02 +0000 sndstat.4: Fix typo Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46165 --- share/man/man4/sndstat.4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/man/man4/sndstat.4 b/share/man/man4/sndstat.4 index 2fc55f0045c1..44c3f3152610 100644 --- a/share/man/man4/sndstat.4 +++ b/share/man/man4/sndstat.4 @@ -198,7 +198,7 @@ There are a number of name/value pairs inside this field: .Bl -tag -width ".Dv hwbuf_blkcnt" .It Dv name Channel name. -.It Dv parenchan +.It Dv parentchan Parent channel name (e.g., in the case of virtual channels). .It Dv unit Channel unit. From nobody Sat Jul 27 18:44:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWYSs4LLrz5RT0k; Sat, 27 Jul 2024 18:44: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWYSs3W1nz4rvt; Sat, 27 Jul 2024 18:44:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722105885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MMdd0HOyyqcqjNWlXMtIKDZAr6/ePqeQ7m+xjKfJWyc=; b=jk+i5SONmrplRbhOmILLs7vZi5NLfM4tciWj7T7Wopqmll5J7VE69QhVxQxsBpF4RNVR0h pnwLCL+thAkh0BJyqvV7tMhzv9EXaIxGpUtm5WwkoQGAc4BwTcL6KXm7fP58edHqkrwls1 hSpPntfjF1FM0dchXvk8m2Boggl3YsRzsa5ctLMvLhYMXu6Ran+TymfRSVhDjdgDfcthfg ZZbdd/eS3aSudpRdUe0W8Wv/fT5fYKjK5Tp2YX2M8DhfIZ7tuZnkvpc1KE6gnv8EkM4tnf 7l0TG1dVQgS6WMkG3N9AxceKs18Zl/l+gFhGGiuf4ELC0D+ZeawIPiX2Kdn32w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722105885; a=rsa-sha256; cv=none; b=yaI1uxlzQf4hpZ/0wpi0ObJfsMzhiURSwLxsRbiOq2H6nZp3zaQ2soxAuYq9iNG4R238z8 ymbulDFBBw54T+MBqXc4hgnrmq7kmQQEfJHpPG3INlxXmfF4u8AQrrrxz07WQUKPgF9K7u 9QeXAV8D6kF5T5lW8Y0mcSpGd/khs893RP5JZpVkEV7OSDdJwIyyAauo3HJFTA0c4SC08U qP8bsM6e5wn8mgCviO+/6uLM2pq2IM18QzT80LSYuCMoDQz4cM9sc9pevMQA2NDL3pYxQ7 c1K1+8sG4SDF8fkcVVao61QKv9WcN1bdMwDl8GzP1HT5TS1Kku7Bzkw4GVglSQ== 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=1722105885; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MMdd0HOyyqcqjNWlXMtIKDZAr6/ePqeQ7m+xjKfJWyc=; b=XrMIEBca+04CN2b53Aaza+Suqpm8zEtvSiU8NeEWHhrV+3FuQYL7ORk8MlUc97d3sZeoQj SXhNCkbjE6Q9hLPw+eD3I36lxGBsjWQgqhn4xv1QgLqDEm05JUzyaA83rx5D5/45WZNZOy vhnWNph/Q0qPquDgFnwHPCGq1fy/3I056MiOaCHwU3n4zqAR75YmiDPYabpihY6oCQ8Vdu BVcIVX80jsN8NNwxJg8LVW1OoEGlq+Y5H1pag7Xtn1uioOFLrovfJyZoBHNlvP7eC3d2bY nJRmgYxQ4NVx09H18yX+Dl1VbdJoOA2NGBAbixBIHN/NzCzeKUzM0gN3QzQd1A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWYSs2ygMzJLb; Sat, 27 Jul 2024 18:44:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RIijeU034727; Sat, 27 Jul 2024 18:44:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RIijV2034724; Sat, 27 Jul 2024 18:44:45 GMT (envelope-from git) Date: Sat, 27 Jul 2024 18:44:45 GMT Message-Id: <202407271844.46RIijV2034724@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Li-Wen Hsu Subject: git: 21e98f6d195a - main - BSD.tests.dist: Add entry for mixer tests List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: lwhsu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21e98f6d195a5db63b17025f339684048834e1aa Auto-Submitted: auto-generated The branch main has been updated by lwhsu: URL: https://cgit.FreeBSD.org/src/commit/?id=21e98f6d195a5db63b17025f339684048834e1aa commit 21e98f6d195a5db63b17025f339684048834e1aa Author: Li-Wen Hsu AuthorDate: 2024-07-27 18:44:28 +0000 Commit: Li-Wen Hsu CommitDate: 2024-07-27 18:44:28 +0000 BSD.tests.dist: Add entry for mixer tests Fixes: 94a86f3f6920 mixer(8): Add tests Sponsored by: The FreeBSD Foundation --- etc/mtree/BSD.tests.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index bd9edc786f17..5c724e5a8e5b 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -1241,6 +1241,8 @@ .. makefs .. + mixer + .. newsyslog .. nmtree From nobody Sat Jul 27 21:14:53 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWcp52Fs6z5Rhhf; Sat, 27 Jul 2024 21:14: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWcp51mhvz4798; Sat, 27 Jul 2024 21:14:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722114893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AI74b+ORDjJMi8OrQ6iA0xfsy5nMHL+CdSzRa4Wo6I8=; b=jyVGBE2FETh53C+pQ3UnTO89D5UryvOXpsd7Er0g7bcwemRszldwCeIEI3KdFYi05jIlIY C9P1R78bMgvbnE0Bt91z94R45hZiFP9/vqUyfrF2kUbfT9llaIWPRZc2Krt5655MwI5Koo 8lH+J5NO2cZ75lcPScL55qO0eFVAffEdqe6Hy5d/BbetnLgEWnfispsxRmv5T+MwEuFMZb Dwhi44Rke3hFTob5L0bYSHTGG/IJgOHaZNVrEGDGSBgGIPnr4XAnWAbuojiGT6VCkDiKgG V0TuOT6bQZXuSMMHz3HsKQB8+VMohpeqxkQaa7R9PMhXKcx7RzjvzSx1g6fB4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722114893; a=rsa-sha256; cv=none; b=uTDJrxcFkgOANxi9qah8aSS/YqySY0L0h1/JE7jVc+tiF1TiFColMJB7N3Pw13hIYUqB3e qPL1bnAgSAz4jLS1JC38KLZBHQwhvScAnf88OGbo8OeghG40It+02Qy9b3fpQWpyGWD8fA OijCIovpcCGXdneKOoj8Ve2G6kjRs4ANcEGWfYR+X2vMJ0T5PGp3weYaAvLhkqY2J0rYq5 fryQ2sIxFeIhxm7Ms7ls4AOiKhfTYQr6gnS06+Ico/Hok3s9eAWLJG4x+Lw9e/FCekvf4c W3lh+q1Q6Shl+hMjc/3n3wdmco77VM5crJEGMLnGIDeCnuPsw46AchXqCRnMpA== 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=1722114893; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AI74b+ORDjJMi8OrQ6iA0xfsy5nMHL+CdSzRa4Wo6I8=; b=l1LpRVS6mdeNd3m3m+f82JoP4bFQI/+d712AYuurYJ4A4xosWcEZhjmfc/Y+AH5zM1tkYQ 3+qXTcqgiFoAvhsX8fPP6yMHOQ97LoElsF62UqPyRfZGf6+HuItom2vb4gJ/D5QP59hLNC kCT8Ww9J3I9nvA/9i2mPiKlqZMNyHMkqnohr83Tnws+5o1PiptpEEUpJ7dcfzK+qtRWMQl pna1gGz+JAzJZll73u3kQfegmSZR/JtFOYwbqEUA8QuX0oVjzWjfBES8UNxEiBXtWOPOVm 3xeGcNHQin0XFFUiFFFlE3y61JWfOj6EmmI/QxR0NCOezVuy831KPTMKDsuyNg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWcp51M5jzN2t; Sat, 27 Jul 2024 21:14:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46RLErkA091121; Sat, 27 Jul 2024 21:14:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46RLErUM091118; Sat, 27 Jul 2024 21:14:53 GMT (envelope-from git) Date: Sat, 27 Jul 2024 21:14:53 GMT Message-Id: <202407272114.46RLErUM091118@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: b3cec803eaa4 - main - vm_fault: avoid vm_page_next() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b3cec803eaa4ae3495f9844f93c1f0cadc1b2d6a Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=b3cec803eaa4ae3495f9844f93c1f0cadc1b2d6a commit b3cec803eaa4ae3495f9844f93c1f0cadc1b2d6a Author: Doug Moore AuthorDate: 2024-07-27 21:11:53 +0000 Commit: Doug Moore CommitDate: 2024-07-27 21:11:53 +0000 vm_fault: avoid vm_page_next() Where vm_fault calls vm_page_next, replace it with a use of TAILQ_NEXT and a KASSERT. This avoids needless computation in a NODEBUG kernel and makes the error checking clearer in a GENERIC kernel. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46168 --- sys/vm/vm_fault.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c index df686f3e46dc..6e0415b30600 100644 --- a/sys/vm/vm_fault.c +++ b/sys/vm/vm_fault.c @@ -485,7 +485,9 @@ vm_fault_populate_cleanup(vm_object_t object, vm_pindex_t first, VM_OBJECT_ASSERT_WLOCKED(object); MPASS(first <= last); for (pidx = first, m = vm_page_lookup(object, pidx); - pidx <= last; pidx++, m = vm_page_next(m)) { + pidx <= last; pidx++, m = TAILQ_NEXT(m, listq)) { + KASSERT(m != NULL && m->pindex == pidx, + ("%s: pindex mismatch", __func__)); vm_fault_populate_check_page(m); vm_page_deactivate(m); vm_page_xunbusy(m); @@ -623,9 +625,10 @@ vm_fault_populate(struct faultstate *fs) } for (pidx = pager_first, m = vm_page_lookup(fs->first_object, pidx); pidx <= pager_last; - pidx += npages, m = vm_page_next(&m[npages - 1])) { + pidx += npages, m = TAILQ_NEXT(&m[npages - 1], listq)) { vaddr = fs->entry->start + IDX_TO_OFF(pidx) - fs->entry->offset; - + KASSERT(m != NULL && m->pindex == pidx, + ("%s: pindex mismatch", __func__)); psind = m->psind; while (psind > 0 && ((vaddr & (pagesizes[psind] - 1)) != 0 || pidx + OFF_TO_IDX(pagesizes[psind]) - 1 > pager_last || From nobody Sun Jul 28 03:05:20 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWmZS6Qdvz5RGFf; Sun, 28 Jul 2024 03:05: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWmZS5r6Sz4gSZ; Sun, 28 Jul 2024 03:05:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722135920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EtLu2j5l9x4ow/SvQTXOk8dj1CAPsEDRQSh9tXj2wVM=; b=IotpHUYIflQPZHAfAtboTnna2R5VjL4XqYSdTtcpuAKn0aPqrPgBhJ9XbZJHJOPWG/DLOH Ded4U3ZIDQxMgpHzhXao2zfP1fUqDyIEmqgK5p2Ze9DsjcRzLeYTPBHuaCNn/1hgL7ntFq VVxpRpwXdDjDVAOVp+Q7DgOTTa9nCFxklgykzcnF91olHZBHlMWgMAC+yVQngCLll3lde5 4rDFyv3IK9GWCBMqzNKoIA2x5luW3VZvnUbM1AG2tP0cYhnhAydWNUJDvJt3dwHczco/8z EthTlfVF3C3R2YMFMVZZBMhOLMa09neESL5G++Di7kzgoWcDSFvPelk4CVu1Ow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722135920; a=rsa-sha256; cv=none; b=Y9n/qJ1G5kjo8CPHYaP/URXTnNuMLG84PhfKqGAVYs8K+2m58qkcKbnJawGtkWxvDoS5i4 ARG/OFL0OrpU2i0VV5uGpOIw17Rh1kRsNprTKFke4l5i1YbzKpX6ufo+J/d5hCwfYssKLZ aSw060XyykM3dJmqPaHNeg9sGsgYN7lgFarBJ21IqNECVoNGvB92VhngGAyc3tP+53NtvY aLRRXk1XvxGqpy8Td81qMLFRC/PZxX8O0RlRtjwtmdL1doAnQF5gXx/YG+rK0qKssq0RDX CfxfzrLTkMNTLWP5edZWTcRay3F/zKyYECMqOf+5dQRXpnVYTfc3vqJwIMlCDw== 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=1722135920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EtLu2j5l9x4ow/SvQTXOk8dj1CAPsEDRQSh9tXj2wVM=; b=cGEqbQHuL2l2kqJOHG7tequ4+HYVKQDWj+hfyPon6h6t3wgqI5P9VazLxv8HDMEQxKBzqM t8+etnD2iHQLlsfDZQit7/MUmFcI+aI3Ej2mw6z3VcbQZI0QemFsNMvC3YmUhP0JkX/Rdr sj81/YbPCn6dvYsiYHChOXHQag+EOgqdBFOandEyl+4MHsn/8xpDWPxvZxTn7NR0J1zsFh jCkh4SFBRiUvg4V1KVBM2+UrFN9gARJqcDNYQmM95V231Hq1zXn5LtQl2jrVlRIV94gfJZ z7myLwdLzhSwemQHSsmaXzhT01vmhFsRHE/fbNM/m5fXue+XNFsbfVro7wuEfQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWmZS5PtlzZLr; Sun, 28 Jul 2024 03:05:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46S35KJ2089144; Sun, 28 Jul 2024 03:05:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46S35KVK089141; Sun, 28 Jul 2024 03:05:20 GMT (envelope-from git) Date: Sun, 28 Jul 2024 03:05:20 GMT Message-Id: <202407280305.46S35KVK089141@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: d55de30efd09 - main - tools/build/make.py: Minor typo fix List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d55de30efd09ee011bf4604be1c15ce4155775c1 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=d55de30efd09ee011bf4604be1c15ce4155775c1 commit d55de30efd09ee011bf4604be1c15ce4155775c1 Author: Jose Luis Duran AuthorDate: 2024-07-25 04:32:33 +0000 Commit: Ed Maste CommitDate: 2024-07-28 03:04:24 +0000 tools/build/make.py: Minor typo fix If the object directory prefix does not exist, make.py previously exited with a message indicating that the chosen prefix does not exit. Reviewed by: emaste Pull request: https://github.com/freebsd/freebsd-src/pull/1348 --- tools/build/make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build/make.py b/tools/build/make.py index 73788a8896c7..ec42cb70dd21 100755 --- a/tools/build/make.py +++ b/tools/build/make.py @@ -243,7 +243,7 @@ if __name__ == "__main__": sys.exit("MAKEOBJDIRPREFIX is not set, cannot continue!") if not Path(MAKEOBJDIRPREFIX).is_dir(): sys.exit( - "Chosen MAKEOBJDIRPREFIX=" + MAKEOBJDIRPREFIX + " doesn't exit!") + "Chosen MAKEOBJDIRPREFIX=" + MAKEOBJDIRPREFIX + " doesn't exist!") objdir_prefix = Path(MAKEOBJDIRPREFIX).absolute() source_root = Path(__file__).absolute().parent.parent.parent From nobody Sun Jul 28 03:54:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWngV1mQSz5RLBS; Sun, 28 Jul 2024 03:54: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWngV0J86z4kkv; Sun, 28 Jul 2024 03:54:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722138886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FsZ7qOFmV/QWvCYF/WLpyNAbV3JEB9Ilb0Z7DfAv6iM=; b=qWmZGnKb7Mlb8Lb8sQsQmxO3qLdL5FQ2pkBGDrYyN+e8L2X0OJvsseWh6b5hoU5GzCnQTL +SH35vKa7qtaDqiTXOPgTp/4jXR8bP6xvb76ANjgqWwIA7qVl5LsGHQ5uz+N8fzwAi7yMK ZHmyasepx++CdWdb+h0hbjIJTuYA0GnnhhJDoPK1AH2va3vM3PNXwuUsRj3P26ZF7H3bTx g4ALqKgNWXx5l/ZPMJoevTaAYutaxj5QZdxZjbXTO3EZTdVHP/HE7gCOGnjwZWOmTZmRKa xYAiOfeySXy0XmbMccdB+idivxzJvGmszF3vvPcd/zoiYQWQKIqR33KnhUZN1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722138886; a=rsa-sha256; cv=none; b=QWX1IFMaQPvAMfTYogTW4G3LXmRKeQ4oQpuAaw2GvnPWGkrZf5WeEhcDNZONEQpSXWpXI6 ZEubRgcjYQwjbPYqlHhjN/MOiNMoLhH0uULOoXYetfdtCb4TYgeM8OERYHxlCm1vh0yzUb wVhNG+VeBdctCb4OmegG01VROcrpnCuRe95Q2XwuYWNFwgaDZMKVQfaxInS1+vdLP6aXnA cLPNcLNgDwLihig0O0WiVWQrGZPTo0rP/8r4aPCiSKE6C+W/ADcVRdUr2zMsHUY3WWbG23 /LtTgE5ZE8lxfaKf6tq4zj7Fn6SEV5RcN/sZr0LS+lC04QSF/k8ElreVJhp3+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=1722138886; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FsZ7qOFmV/QWvCYF/WLpyNAbV3JEB9Ilb0Z7DfAv6iM=; b=JY0HqYpOPPa5T343+cqOGDKu+2ZV/dHXhFE2NY7h5G1tMXvReTnUhLMr4kmho9P6NUPz1S HWo7bl7Le5MFDGt1hGXoxtqNhA0+fvboLroEyL6Xtvdry8X9qnCw8no5jK+9CJpQYxspHO eJJTl/rW83CeW63vxBWyorrVDY/k3cly70MNyz/WEPf2UYttOeljTfrnkpUG27nOUD9D4A coxE9bHqBy8O6qQlOIX7ONTSV/uxu2p7abdqP+kOnljT2c4fyQZ1aV8u58SnEwA9kkhQ6K nXG8f6G0QpRJSXCIO1FhFa+7BExr+eeKfAQZ9XEINRn2L1sZIKg3nesPtHNEAQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWngT6yyMzb24; Sun, 28 Jul 2024 03:54:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46S3sjxR073581; Sun, 28 Jul 2024 03:54:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46S3sjp2073578; Sun, 28 Jul 2024 03:54:45 GMT (envelope-from git) Date: Sun, 28 Jul 2024 03:54:45 GMT Message-Id: <202407280354.46S3sjp2073578@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 9328ded386d5 - stable/14 - nfscl: Scan readdir reply filenames for invalid characters List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 9328ded386d570c8455b9021e047520ef72e0e79 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=9328ded386d570c8455b9021e047520ef72e0e79 commit 9328ded386d570c8455b9021e047520ef72e0e79 Author: Rick Macklem AuthorDate: 2024-07-21 22:56:16 +0000 Commit: Rick Macklem CommitDate: 2024-07-28 03:53:17 +0000 nfscl: Scan readdir reply filenames for invalid characters The NFS RFCs are pretty loose with respect to what characters can be in a filename returned by a Readdir. However, FreeBSD, as a POSIX system will not handle imbedded '/' or nul characters in file names. Also, for NFSv4, the file names "." and ".." are handcrafted on the client and should not be returned by a NFSv4 server. This patch scans for the above in filenames returned by Readdir and ignores any entry returned by Readdir which has them in it. Because an imbedded nul would be a string terminator, it was not possible to code this check efficiently using string(3) functions. Reported by: Apple Security Engineering and Architecture (SEAR) (cherry picked from commit 026cdaa3b3a92574d9ac3155216e5cc0b0bd4c51) --- sys/fs/nfsclient/nfs_clrpcops.c | 137 ++++++++++++++++++++++++++++++++-------- 1 file changed, 110 insertions(+), 27 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 13bdc74655dd..8947b608b743 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -142,6 +142,7 @@ static int nfsrpc_createv4(vnode_t , char *, int, struct vattr *, nfsquad_t, int, struct nfsclowner *, struct nfscldeleg **, struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, struct nfsfh **, int *, int *, int *); +static bool nfscl_invalidfname(bool, char *, int); static int nfsrpc_locku(struct nfsrv_descript *, struct nfsmount *, struct nfscllockowner *, u_int64_t, u_int64_t, u_int32_t, struct ucred *, NFSPROC_T *, int); @@ -3321,6 +3322,31 @@ nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, struct ucred *cred, return (error); } +/* + * Check to make sure the file name in a Readdir reply is valid. + */ +static bool +nfscl_invalidfname(bool is_v4, char *name, int len) +{ + int i; + char *cp; + + if (is_v4 && ((len == 1 && name[0] == '.') || + (len == 2 && name[0] == '.' && name[1] == '.'))) { + printf("Readdir NFSv4 reply has dot or dotdot in it\n"); + return (true); + } + cp = name; + for (i = 0; i < len; i++, cp++) { + if (*cp == '/' || *cp == '\0') { + printf("Readdir reply file name had imbedded / or nul" + " byte\n"); + return (true); + } + } + return (false); +} + /* * Readdir rpc. * Always returns with either uio_resid unchanged, if you are at the @@ -3373,6 +3399,8 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, ("nfs readdirrpc bad uio")); + KASSERT(uiop->uio_segflg == UIO_SYSSPACE, + ("nfsrpc_readdir: uio userspace")); ncookie.lval[0] = ncookie.lval[1] = 0; /* * There is no point in reading a lot more than uio_resid, however @@ -3630,6 +3658,17 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_resid) bigenough = 0; if (bigenough) { + struct iovec saviov; + off_t savoff; + ssize_t savresid; + int savblksiz; + + saviov.iov_base = uiop->uio_iov->iov_base; + saviov.iov_len = uiop->uio_iov->iov_len; + savoff = uiop->uio_offset; + savresid = uiop->uio_resid; + savblksiz = blksiz; + dp = (struct dirent *)uiop->uio_iov->iov_base; dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; @@ -3645,20 +3684,35 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + DIRHDSIZ; uiop->uio_iov->iov_len -= DIRHDSIZ; + cp = uiop->uio_iov->iov_base; error = nfsm_mbufuio(nd, uiop, len); if (error) goto nfsmout; - cp = uiop->uio_iov->iov_base; - tlen -= len; - NFSBZERO(cp, tlen); - cp += tlen; /* points to cookie storage */ - tl2 = (u_int32_t *)cp; - uiop->uio_iov->iov_base = - (char *)uiop->uio_iov->iov_base + tlen + - NFSX_HYPER; - uiop->uio_iov->iov_len -= tlen + NFSX_HYPER; - uiop->uio_resid -= tlen + NFSX_HYPER; - uiop->uio_offset += (tlen + NFSX_HYPER); + /* Check for an invalid file name. */ + if (nfscl_invalidfname( + (nd->nd_flag & ND_NFSV4) != 0, cp, len)) { + /* Skip over this entry. */ + uiop->uio_iov->iov_base = + saviov.iov_base; + uiop->uio_iov->iov_len = + saviov.iov_len; + uiop->uio_offset = savoff; + uiop->uio_resid = savresid; + blksiz = savblksiz; + } else { + cp = uiop->uio_iov->iov_base; + tlen -= len; + NFSBZERO(cp, tlen); + cp += tlen; /* points to cookie store */ + tl2 = (u_int32_t *)cp; + uiop->uio_iov->iov_base = + (char *)uiop->uio_iov->iov_base + + tlen + NFSX_HYPER; + uiop->uio_iov->iov_len -= tlen + + NFSX_HYPER; + uiop->uio_resid -= tlen + NFSX_HYPER; + uiop->uio_offset += (tlen + NFSX_HYPER); + } } else { error = nfsm_advance(nd, NFSM_RNDUP(len), -1); if (error) @@ -3824,6 +3878,8 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, ("nfs readdirplusrpc bad uio")); + KASSERT(uiop->uio_segflg == UIO_SYSSPACE, + ("nfsrpc_readdirplus: uio userspace")); ncookie.lval[0] = ncookie.lval[1] = 0; timespecclear(&dctime); *attrflagp = 0; @@ -4059,6 +4115,17 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_resid) bigenough = 0; if (bigenough) { + struct iovec saviov; + off_t savoff; + ssize_t savresid; + int savblksiz; + + saviov.iov_base = uiop->uio_iov->iov_base; + saviov.iov_len = uiop->uio_iov->iov_len; + savoff = uiop->uio_offset; + savresid = uiop->uio_resid; + savblksiz = blksiz; + dp = (struct dirent *)uiop->uio_iov->iov_base; dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; @@ -4077,25 +4144,41 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, cnp->cn_nameptr = uiop->uio_iov->iov_base; cnp->cn_namelen = len; NFSCNHASHZERO(cnp); + cp = uiop->uio_iov->iov_base; error = nfsm_mbufuio(nd, uiop, len); if (error) goto nfsmout; - cp = uiop->uio_iov->iov_base; - tlen -= len; - NFSBZERO(cp, tlen); - cp += tlen; /* points to cookie storage */ - tl2 = (u_int32_t *)cp; - if (len == 2 && cnp->cn_nameptr[0] == '.' && - cnp->cn_nameptr[1] == '.') - isdotdot = 1; - else - isdotdot = 0; - uiop->uio_iov->iov_base = - (char *)uiop->uio_iov->iov_base + tlen + - NFSX_HYPER; - uiop->uio_iov->iov_len -= tlen + NFSX_HYPER; - uiop->uio_resid -= tlen + NFSX_HYPER; - uiop->uio_offset += (tlen + NFSX_HYPER); + /* Check for an invalid file name. */ + if (nfscl_invalidfname( + (nd->nd_flag & ND_NFSV4) != 0, cp, len)) { + /* Skip over this entry. */ + uiop->uio_iov->iov_base = + saviov.iov_base; + uiop->uio_iov->iov_len = + saviov.iov_len; + uiop->uio_offset = savoff; + uiop->uio_resid = savresid; + blksiz = savblksiz; + } else { + cp = uiop->uio_iov->iov_base; + tlen -= len; + NFSBZERO(cp, tlen); + cp += tlen; /* points to cookie store */ + tl2 = (u_int32_t *)cp; + if (len == 2 && + cnp->cn_nameptr[0] == '.' && + cnp->cn_nameptr[1] == '.') + isdotdot = 1; + else + isdotdot = 0; + uiop->uio_iov->iov_base = + (char *)uiop->uio_iov->iov_base + + tlen + NFSX_HYPER; + uiop->uio_iov->iov_len -= tlen + + NFSX_HYPER; + uiop->uio_resid -= tlen + NFSX_HYPER; + uiop->uio_offset += (tlen + NFSX_HYPER); + } } else { error = nfsm_advance(nd, NFSM_RNDUP(len), -1); if (error) From nobody Sun Jul 28 04:14:54 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWp6k4df8z5RMV3; Sun, 28 Jul 2024 04:14: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWp6k2bDhz4m5Y; Sun, 28 Jul 2024 04:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722140094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRIgRUsj8IZiLe15I6NsMnLsZ8z/wsyqLE6Be7HbZCE=; b=AlmxZBV3C+V4Pmk6kc2Wi6p9TGPvNNByaUhVJOKT+dA4HPrRyoHbVnq2swkUx/lupFB42L IW37+Y5a99Tka1rBV1rdvz2M7Bo0x4AjY74TPEi46K8iau7dLFw4sr8cHDHhhy/qtnezIk sBsRgUZZNPtN/uW5/qEiZJrGVUgBBSyPDfC0skrlfTYVxfjXl0KXDBBOgvRNEPXupjMPPJ ZSPnjQlWdLeS0FUEPB+d7CUjRermWyF5JyzzjcCMiygZdnp20PQSoA/QKkatt7YwAB6BQH DgNUYnaJ28rJTFthsqvkbIXL6OV8kkOc1i/MLxIf+xsdbv1hyb9V4pjbrFSVGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722140094; a=rsa-sha256; cv=none; b=Ajv0Nep37L+DqKPxjnuzGxNErTTqsnwldiwut2I8ZPmUi80fJ5h/lFoZcdc/cDcQz1doDL 6FpS2Ruv3Jp5JS7XlNEE+Tu/1hy9ZWx+mZNGb1kt2gRh+G68UYYrOxZ17G1l5CUg4zSmdb G5LDMtq6saVzY7Vgjf7TbC+umtsrBd3BtOfhkPeN3s4brceIeicyptxJ5KgJLkPUa6QD4I Jl9sBeaEakrfnQ9GZX/MzQS1vDLOyD+H/X1sUAR4EI/SUou9wfkxBdUjSgH6MYSfJy0law f2zlXyCvJ1bGLAw09R7cZNY/AOBIXQViLR3wUoyR+l6iRwYTBmo58tJjE93PDg== 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=1722140094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vRIgRUsj8IZiLe15I6NsMnLsZ8z/wsyqLE6Be7HbZCE=; b=O6KxRACJ2wyYUqCguntK/2dG99rvYRT1sdHthYqSGdPseap0DWjEn02KYHAAs4ZRCCCyvp hiGD2RzLXP9tkgxe+YBtyodDhlSGmsdPpJFQG45pgEQR6krLzoxvVe/hx+DOYx8mW+L9bS I1KrQiZMn+F/rhwk8KOtlt7LTm4WPfwEE7ZY2euJdfc3kLkiI1mZMjWQFl1J8YPgOg0xfT kGJLkYjJmUn8IVomfpGi+UyXSfez6PiRnd6NwKUpO1atJFjGYm9JWyTsRJCb8i2S192k7w 70zcJXkxz4kslcnqxEPwRvIY2KzRVgS5t6xmi88pt7LdkCKvmiaB3guYPTnyfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWp6k29JJzc05; Sun, 28 Jul 2024 04:14:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46S4Eso7008780; Sun, 28 Jul 2024 04:14:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46S4EsGl008777; Sun, 28 Jul 2024 04:14:54 GMT (envelope-from git) Date: Sun, 28 Jul 2024 04:14:54 GMT Message-Id: <202407280414.46S4EsGl008777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: 0172b5145ad9 - stable/13 - nfscl: Scan readdir reply filenames for invalid characters List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 0172b5145ad9435569978ed4d268b9f65ac59526 Auto-Submitted: auto-generated The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=0172b5145ad9435569978ed4d268b9f65ac59526 commit 0172b5145ad9435569978ed4d268b9f65ac59526 Author: Rick Macklem AuthorDate: 2024-07-21 22:56:16 +0000 Commit: Rick Macklem CommitDate: 2024-07-28 04:00:36 +0000 nfscl: Scan readdir reply filenames for invalid characters The NFS RFCs are pretty loose with respect to what characters can be in a filename returned by a Readdir. However, FreeBSD, as a POSIX system will not handle imbedded '/' or nul characters in file names. Also, for NFSv4, the file names "." and ".." are handcrafted on the client and should not be returned by a NFSv4 server. This patch scans for the above in filenames returned by Readdir and ignores any entry returned by Readdir which has them in it. Because an imbedded nul would be a string terminator, it was not possible to code this check efficiently using string(3) functions. Reported by: Apple Security Engineering and Architecture (SEAR) (cherry picked from commit 026cdaa3b3a92574d9ac3155216e5cc0b0bd4c51) --- sys/fs/nfsclient/nfs_clrpcops.c | 137 ++++++++++++++++++++++++++++++++-------- 1 file changed, 110 insertions(+), 27 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 475034768e04..b3062b5a5d88 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -140,6 +140,7 @@ static int nfsrpc_createv4(vnode_t , char *, int, struct vattr *, nfsquad_t, int, struct nfsclowner *, struct nfscldeleg **, struct ucred *, NFSPROC_T *, struct nfsvattr *, struct nfsvattr *, struct nfsfh **, int *, int *, void *, int *); +static bool nfscl_invalidfname(bool, char *, int); static int nfsrpc_locku(struct nfsrv_descript *, struct nfsmount *, struct nfscllockowner *, u_int64_t, u_int64_t, u_int32_t, struct ucred *, NFSPROC_T *, int); @@ -3005,6 +3006,31 @@ nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, struct ucred *cred, return (error); } +/* + * Check to make sure the file name in a Readdir reply is valid. + */ +static bool +nfscl_invalidfname(bool is_v4, char *name, int len) +{ + int i; + char *cp; + + if (is_v4 && ((len == 1 && name[0] == '.') || + (len == 2 && name[0] == '.' && name[1] == '.'))) { + printf("Readdir NFSv4 reply has dot or dotdot in it\n"); + return (true); + } + cp = name; + for (i = 0; i < len; i++, cp++) { + if (*cp == '/' || *cp == '\0') { + printf("Readdir reply file name had imbedded / or nul" + " byte\n"); + return (true); + } + } + return (false); +} + /* * Readdir rpc. * Always returns with either uio_resid unchanged, if you are at the @@ -3057,6 +3083,8 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, ("nfs readdirrpc bad uio")); + KASSERT(uiop->uio_segflg == UIO_SYSSPACE, + ("nfsrpc_readdir: uio userspace")); ncookie.lval[0] = ncookie.lval[1] = 0; /* * There is no point in reading a lot more than uio_resid, however @@ -3315,6 +3343,17 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_resid) bigenough = 0; if (bigenough) { + struct iovec saviov; + off_t savoff; + ssize_t savresid; + int savblksiz; + + saviov.iov_base = uiop->uio_iov->iov_base; + saviov.iov_len = uiop->uio_iov->iov_len; + savoff = uiop->uio_offset; + savresid = uiop->uio_resid; + savblksiz = blksiz; + dp = (struct dirent *)uiop->uio_iov->iov_base; dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; @@ -3330,20 +3369,35 @@ nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_iov->iov_base = (char *)uiop->uio_iov->iov_base + DIRHDSIZ; uiop->uio_iov->iov_len -= DIRHDSIZ; + cp = uiop->uio_iov->iov_base; error = nfsm_mbufuio(nd, uiop, len); if (error) goto nfsmout; - cp = uiop->uio_iov->iov_base; - tlen -= len; - NFSBZERO(cp, tlen); - cp += tlen; /* points to cookie storage */ - tl2 = (u_int32_t *)cp; - uiop->uio_iov->iov_base = - (char *)uiop->uio_iov->iov_base + tlen + - NFSX_HYPER; - uiop->uio_iov->iov_len -= tlen + NFSX_HYPER; - uiop->uio_resid -= tlen + NFSX_HYPER; - uiop->uio_offset += (tlen + NFSX_HYPER); + /* Check for an invalid file name. */ + if (nfscl_invalidfname( + (nd->nd_flag & ND_NFSV4) != 0, cp, len)) { + /* Skip over this entry. */ + uiop->uio_iov->iov_base = + saviov.iov_base; + uiop->uio_iov->iov_len = + saviov.iov_len; + uiop->uio_offset = savoff; + uiop->uio_resid = savresid; + blksiz = savblksiz; + } else { + cp = uiop->uio_iov->iov_base; + tlen -= len; + NFSBZERO(cp, tlen); + cp += tlen; /* points to cookie store */ + tl2 = (u_int32_t *)cp; + uiop->uio_iov->iov_base = + (char *)uiop->uio_iov->iov_base + + tlen + NFSX_HYPER; + uiop->uio_iov->iov_len -= tlen + + NFSX_HYPER; + uiop->uio_resid -= tlen + NFSX_HYPER; + uiop->uio_offset += (tlen + NFSX_HYPER); + } } else { error = nfsm_advance(nd, NFSM_RNDUP(len), -1); if (error) @@ -3511,6 +3565,8 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, KASSERT(uiop->uio_iovcnt == 1 && (uiop->uio_resid & (DIRBLKSIZ - 1)) == 0, ("nfs readdirplusrpc bad uio")); + KASSERT(uiop->uio_segflg == UIO_SYSSPACE, + ("nfsrpc_readdirplus: uio userspace")); ncookie.lval[0] = ncookie.lval[1] = 0; timespecclear(&dctime); *attrflagp = 0; @@ -3746,6 +3802,17 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, uiop->uio_resid) bigenough = 0; if (bigenough) { + struct iovec saviov; + off_t savoff; + ssize_t savresid; + int savblksiz; + + saviov.iov_base = uiop->uio_iov->iov_base; + saviov.iov_len = uiop->uio_iov->iov_len; + savoff = uiop->uio_offset; + savresid = uiop->uio_resid; + savblksiz = blksiz; + dp = (struct dirent *)uiop->uio_iov->iov_base; dp->d_pad0 = dp->d_pad1 = 0; dp->d_off = 0; @@ -3764,25 +3831,41 @@ nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, cnp->cn_nameptr = uiop->uio_iov->iov_base; cnp->cn_namelen = len; NFSCNHASHZERO(cnp); + cp = uiop->uio_iov->iov_base; error = nfsm_mbufuio(nd, uiop, len); if (error) goto nfsmout; - cp = uiop->uio_iov->iov_base; - tlen -= len; - NFSBZERO(cp, tlen); - cp += tlen; /* points to cookie storage */ - tl2 = (u_int32_t *)cp; - if (len == 2 && cnp->cn_nameptr[0] == '.' && - cnp->cn_nameptr[1] == '.') - isdotdot = 1; - else - isdotdot = 0; - uiop->uio_iov->iov_base = - (char *)uiop->uio_iov->iov_base + tlen + - NFSX_HYPER; - uiop->uio_iov->iov_len -= tlen + NFSX_HYPER; - uiop->uio_resid -= tlen + NFSX_HYPER; - uiop->uio_offset += (tlen + NFSX_HYPER); + /* Check for an invalid file name. */ + if (nfscl_invalidfname( + (nd->nd_flag & ND_NFSV4) != 0, cp, len)) { + /* Skip over this entry. */ + uiop->uio_iov->iov_base = + saviov.iov_base; + uiop->uio_iov->iov_len = + saviov.iov_len; + uiop->uio_offset = savoff; + uiop->uio_resid = savresid; + blksiz = savblksiz; + } else { + cp = uiop->uio_iov->iov_base; + tlen -= len; + NFSBZERO(cp, tlen); + cp += tlen; /* points to cookie store */ + tl2 = (u_int32_t *)cp; + if (len == 2 && + cnp->cn_nameptr[0] == '.' && + cnp->cn_nameptr[1] == '.') + isdotdot = 1; + else + isdotdot = 0; + uiop->uio_iov->iov_base = + (char *)uiop->uio_iov->iov_base + + tlen + NFSX_HYPER; + uiop->uio_iov->iov_len -= tlen + + NFSX_HYPER; + uiop->uio_resid -= tlen + NFSX_HYPER; + uiop->uio_offset += (tlen + NFSX_HYPER); + } } else { error = nfsm_advance(nd, NFSM_RNDUP(len), -1); if (error) From nobody Sun Jul 28 11:04:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWzCZ5SsNz5RyJM; Sun, 28 Jul 2024 11:04: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWzCZ4rQrz4Hj2; Sun, 28 Jul 2024 11:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722164682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ptcWjfVFtM5G7dIgZUQvrTS1I7kcwYonvl0YKMf/5eA=; b=h89SS9JbFUbmfI6z+pqfg8T7nI8cqAFUw4l8xSvnIOlYNrN/reb1owxe1y6tt9VUXKlMFy LIptsEEQcWEm3BEmNYJrfnB6bh18VWTWqnhU/2o7Osi+OBfloVBaOQ5V0vpKDkMSviZbGb 6sD/ZPslO08IspzvZuLfgTw9UMIwAzM75gH9Cp032LipzrHPpfMKMKHiLETVW4nc/2qxu4 WWc2oIi03LaUtexZLL3Yx+zfXbX6jTM17ne/nXVtU2VPVRXTCHlRzORDLWPSz62RB8DpBd 0mmTkur3kZIKasM8BYrlNq/DyngUbLNTkjIkRmLfz40R8p2xHzqmXMsat8viPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722164682; a=rsa-sha256; cv=none; b=NJI1Sza+jlcCgvKWK6QGPlAQ+Lk92Z6cPzgt/qCTh5zhku1KMfCnmi9Xyfk14u5wXHVypl FI0gZ+ke/ZohgyfwEuK1yxhttacXrJRrxsQWNPdAb39VxCnRC3CRsm7YKdnK2Uspn7lagA d3kNGKvUR9CMthtV30uyUdz7iqBZmTTgzIo2If/3t/0oLh+hTa7g2+aO9GYB+iCbrX3eNZ In7HhW13E6bM2jCJtiJtCKR4VTBlSZ04Ta1M6R7AV3leRQ+C0AgUpvr+Icho04lmZxItsL bOSF/cXH40DvOK0Pjg+/B2sTwAmk/U+xSej7u53rtuJyrGspK79kmh7kTbdNbQ== 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=1722164682; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ptcWjfVFtM5G7dIgZUQvrTS1I7kcwYonvl0YKMf/5eA=; b=BhpRNv3cAZ4X7Ww+tLhhcE/MYQUFmOP8s/JP8HK4Vh85YRGKoFbmiQKqlUdT61oy26yzc2 SJohVMtIRka6T/+qqOoj67AmFGo5lg5Is+lfR3EsJYTTRTM+LZccZqJG8to9MSGzfcxdZf 7ejQ5S5A3+Yx0AQDPqBDMbEdMkC+c0xloU1/PhkIXwumR3UuwryjJTmovLNwl1zqIvtjUX mx8mu7+asVkyS2gIFArYDTsF5BR8Ya4nCoE130EgFaZFz4ojULAC4fgABmgT1kTR/Y8af4 SyqC71RHz99n2HV2G5OPUFDfqHSgjvDDof5P0P4qZXlivDuBI76jqirL/rf66A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWzCZ4LSTzpDp; Sun, 28 Jul 2024 11:04:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SB4gDJ002043; Sun, 28 Jul 2024 11:04:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SB4gBd002040; Sun, 28 Jul 2024 11:04:42 GMT (envelope-from git) Date: Sun, 28 Jul 2024 11:04:42 GMT Message-Id: <202407281104.46SB4gBd002040@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 806fbbbbe5d2 - stable/14 - Merge commit 28a2b85602a5 from llvm-project (by Kazu Hirata): List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 806fbbbbe5d2eb5decfaafba6deb94534655cc8e Auto-Submitted: auto-generated The branch stable/14 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=806fbbbbe5d2eb5decfaafba6deb94534655cc8e commit 806fbbbbe5d2eb5decfaafba6deb94534655cc8e Author: Dimitry Andric AuthorDate: 2024-07-25 11:13:45 +0000 Commit: Dimitry Andric CommitDate: 2024-07-28 11:04:21 +0000 Merge commit 28a2b85602a5 from llvm-project (by Kazu Hirata): [DeadStoreElimination] Use SmallSetVector (NFC) (#79410) The use of SmallSetVector saves 0.58% of heap allocations during the compilation of a large preprocessed file, namely X86ISelLowering.cpp, for the X86 target. During the experiment, the final size of ToCheck was 8 or less 88% of the time. Merge commit 9e95c4947d31 from llvm-project (by Nikita Popov): [DSE] Fix non-determinism due to address reuse (#84943) The malloc->calloc fold creates a new MemoryAccess, which may end of at the same address as a previously deleted access inside SkipStores. To the most part, this is not a problem, because SkipStores is normally only used together with MemDefs. Neither the old malloc access nor the new calloc access will be part of MemDefs, so there is no problem here. However, SkipStores is also used in one more place: In the main DSE loop, ToCheck entries are checked against it. Fix this by not using SkipStores here, and instead using a separate set to track deletions inside this loop. This way it is not affected by the calloc optimization that happens outside it. This is all pretty ugly, but I haven't found another good way to fix it. Suggestions welcome. No test case as I don't have a reliable DSE-only test-case for this. Fixes https://github.com/llvm/llvm-project/issues/84458. This fixes another possible difference in output when building i386 object files with a native or cross build of clang. (Specifically, the file sbin/ipf/ipmon/ipmon.o.) PR: 276961 Reported by: cperciva MFC after: 3 days (cherry picked from commit 55a2a91c5e1bb39dd625ba56597608883fbcb318) --- .../lib/Transforms/Scalar/DeadStoreElimination.cpp | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index 380d65836553..f0f0f5f28025 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -1697,7 +1697,9 @@ struct DSEState { /// Delete dead memory defs and recursively add their operands to ToRemove if /// they became dead. - void deleteDeadInstruction(Instruction *SI) { + void + deleteDeadInstruction(Instruction *SI, + SmallPtrSetImpl *Deleted = nullptr) { MemorySSAUpdater Updater(&MSSA); SmallVector NowDeadInsts; NowDeadInsts.push_back(SI); @@ -1718,6 +1720,8 @@ struct DSEState { if (IsMemDef) { auto *MD = cast(MA); SkipStores.insert(MD); + if (Deleted) + Deleted->insert(MD); if (auto *SI = dyn_cast(MD->getMemoryInst())) { if (SI->getValueOperand()->getType()->isPointerTy()) { const Value *UO = getUnderlyingObject(SI->getValueOperand()); @@ -2111,7 +2115,12 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, unsigned WalkerStepLimit = MemorySSAUpwardsStepLimit; unsigned PartialLimit = MemorySSAPartialStoreLimit; // Worklist of MemoryAccesses that may be killed by KillingDef. - SetVector ToCheck; + SmallSetVector ToCheck; + // Track MemoryAccesses that have been deleted in the loop below, so we can + // skip them. Don't use SkipStores for this, which may contain reused + // MemoryAccess addresses. + SmallPtrSet Deleted; + [[maybe_unused]] unsigned OrigNumSkipStores = State.SkipStores.size(); ToCheck.insert(KillingDef->getDefiningAccess()); bool Shortend = false; @@ -2119,7 +2128,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, // Check if MemoryAccesses in the worklist are killed by KillingDef. for (unsigned I = 0; I < ToCheck.size(); I++) { MemoryAccess *Current = ToCheck[I]; - if (State.SkipStores.count(Current)) + if (Deleted.contains(Current)) continue; std::optional MaybeDeadAccess = State.getDomMemoryDef( @@ -2166,7 +2175,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, continue; LLVM_DEBUG(dbgs() << "DSE: Remove Dead Store:\n DEAD: " << *DeadI << "\n KILLER: " << *KillingI << '\n'); - State.deleteDeadInstruction(DeadI); + State.deleteDeadInstruction(DeadI, &Deleted); ++NumFastStores; MadeChange = true; } else { @@ -2203,7 +2212,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, Shortend = true; // Remove killing store and remove any outstanding overlap // intervals for the updated store. - State.deleteDeadInstruction(KillingSI); + State.deleteDeadInstruction(KillingSI, &Deleted); auto I = State.IOLs.find(DeadSI->getParent()); if (I != State.IOLs.end()) I->second.erase(DeadSI); @@ -2215,13 +2224,16 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, if (OR == OW_Complete) { LLVM_DEBUG(dbgs() << "DSE: Remove Dead Store:\n DEAD: " << *DeadI << "\n KILLER: " << *KillingI << '\n'); - State.deleteDeadInstruction(DeadI); + State.deleteDeadInstruction(DeadI, &Deleted); ++NumFastStores; MadeChange = true; } } } + assert(State.SkipStores.size() - OrigNumSkipStores == Deleted.size() && + "SkipStores and Deleted out of sync?"); + // Check if the store is a no-op. if (!Shortend && State.storeIsNoop(KillingDef, KillingUndObj)) { LLVM_DEBUG(dbgs() << "DSE: Remove No-Op Store:\n DEAD: " << *KillingI From nobody Sun Jul 28 11:05:11 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWzD7331Wz5RyjW; Sun, 28 Jul 2024 11:05: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWzD7223Vz4J5G; Sun, 28 Jul 2024 11:05:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722164711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U1Vt7/aAN4VAmxNxJ8kLwOWa3mxfom4Tb6yu6x1oUd8=; b=d0V29bLoBkMy0WI1RTd1Vu89xmwc6Sr/IdDoOl1Ojnmrba9cqHa87FxVdoyemBWe5yBzpm /54gkKYlNHo11WfUAwH4B+mF99ruvQ3Tedb/IN1dkMXOygiiiXbkKhqF0V1X+UsOinRLkM dvrQU+/+KHMCYB6MZghaj0bpLwg9a6TNT1TI+mMzcl9CNj1BfLf3OingFmnW+hNdzO3lk1 lmTMiCUkLki/ZdNo4kZigggineEKRX6Oshn8StkzGYQM3BOZVUO6dLJI3Xux1UYsVtdqYY msCQdOmkrp6UmaW3bFOgJJYDbnWEves2JbV3tE21MuDvHNdNp8k0fjraKK9jcg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722164711; a=rsa-sha256; cv=none; b=bHTkBivjVBK+i8IYFnqr1fWYpvFPS0FNsSnnPoAZWOg/hK1UqbxiOngUIGvU8Rr4+vWLo5 oCyh6iXXbRw9BWtB64+20Gtr1UN/2wfq5i2mCsmIFq7dhNbO/nusKcMoZYvBghKRFsKeqo vN+JyAw3TxIuQgxRZRZUkQ+RAy7gKFJouFi4SQB4RDfMdrVJTDQC7XoZNdII2X+NFBYMAX sjVSERcxyZJatjqYN6evM5WjlVgSbU1aGhL9e7NcJSGgQ/yofGgd8ugWs7RLrYOR2HctuF TXNYMistf44lIwgUBszZih2T95mgeIzBU7eaBQxlJHQu4CV4mjX+rKUNa/QZlg== 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=1722164711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U1Vt7/aAN4VAmxNxJ8kLwOWa3mxfom4Tb6yu6x1oUd8=; b=Xi5PAOC8accVrvPrIixvmfRs3YP9igMFeb/mCta3+RCdfgfyS28MhotAPKN2Nrv1YxeE2M v5oZCiCg52Czqg7W+w3LLPS4eLzmRv/O+Jdohay1r7NvO3D3o0kmHiZMW/e1MsZmr2b102 N9SOS/XK0Pt0+RSj7kM1VszglkNnYS4CPqMRXkSsby96piJTopXpyiJMmYqtWawnue3ny6 rypGqKHuQKu8D2aR1jJpmv5qzptRDgGqxq6oSIpN+pHzkXSIA3lf+cSNtza5ySs3WdzcZw ESD0gApnjDpddzL80MbswXIvKrWSKgXTTX+GXsFztyitxLZTKCdbYLDgK+Jc9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWzD71P8qzp5N; Sun, 28 Jul 2024 11:05:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SB5BbA002275; Sun, 28 Jul 2024 11:05:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SB5Bro002272; Sun, 28 Jul 2024 11:05:11 GMT (envelope-from git) Date: Sun, 28 Jul 2024 11:05:11 GMT Message-Id: <202407281105.46SB5Bro002272@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: c7e5a0d42f20 - stable/13 - Merge commit 28a2b85602a5 from llvm-project (by Kazu Hirata): List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c7e5a0d42f20e9a81b96fc89b3b9883cf4be9839 Auto-Submitted: auto-generated The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=c7e5a0d42f20e9a81b96fc89b3b9883cf4be9839 commit c7e5a0d42f20e9a81b96fc89b3b9883cf4be9839 Author: Dimitry Andric AuthorDate: 2024-07-25 11:13:45 +0000 Commit: Dimitry Andric CommitDate: 2024-07-28 11:04:26 +0000 Merge commit 28a2b85602a5 from llvm-project (by Kazu Hirata): [DeadStoreElimination] Use SmallSetVector (NFC) (#79410) The use of SmallSetVector saves 0.58% of heap allocations during the compilation of a large preprocessed file, namely X86ISelLowering.cpp, for the X86 target. During the experiment, the final size of ToCheck was 8 or less 88% of the time. Merge commit 9e95c4947d31 from llvm-project (by Nikita Popov): [DSE] Fix non-determinism due to address reuse (#84943) The malloc->calloc fold creates a new MemoryAccess, which may end of at the same address as a previously deleted access inside SkipStores. To the most part, this is not a problem, because SkipStores is normally only used together with MemDefs. Neither the old malloc access nor the new calloc access will be part of MemDefs, so there is no problem here. However, SkipStores is also used in one more place: In the main DSE loop, ToCheck entries are checked against it. Fix this by not using SkipStores here, and instead using a separate set to track deletions inside this loop. This way it is not affected by the calloc optimization that happens outside it. This is all pretty ugly, but I haven't found another good way to fix it. Suggestions welcome. No test case as I don't have a reliable DSE-only test-case for this. Fixes https://github.com/llvm/llvm-project/issues/84458. This fixes another possible difference in output when building i386 object files with a native or cross build of clang. (Specifically, the file sbin/ipf/ipmon/ipmon.o.) PR: 276961 Reported by: cperciva MFC after: 3 days (cherry picked from commit 55a2a91c5e1bb39dd625ba56597608883fbcb318) --- .../lib/Transforms/Scalar/DeadStoreElimination.cpp | 24 ++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index 380d65836553..f0f0f5f28025 100644 --- a/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/contrib/llvm-project/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -1697,7 +1697,9 @@ struct DSEState { /// Delete dead memory defs and recursively add their operands to ToRemove if /// they became dead. - void deleteDeadInstruction(Instruction *SI) { + void + deleteDeadInstruction(Instruction *SI, + SmallPtrSetImpl *Deleted = nullptr) { MemorySSAUpdater Updater(&MSSA); SmallVector NowDeadInsts; NowDeadInsts.push_back(SI); @@ -1718,6 +1720,8 @@ struct DSEState { if (IsMemDef) { auto *MD = cast(MA); SkipStores.insert(MD); + if (Deleted) + Deleted->insert(MD); if (auto *SI = dyn_cast(MD->getMemoryInst())) { if (SI->getValueOperand()->getType()->isPointerTy()) { const Value *UO = getUnderlyingObject(SI->getValueOperand()); @@ -2111,7 +2115,12 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, unsigned WalkerStepLimit = MemorySSAUpwardsStepLimit; unsigned PartialLimit = MemorySSAPartialStoreLimit; // Worklist of MemoryAccesses that may be killed by KillingDef. - SetVector ToCheck; + SmallSetVector ToCheck; + // Track MemoryAccesses that have been deleted in the loop below, so we can + // skip them. Don't use SkipStores for this, which may contain reused + // MemoryAccess addresses. + SmallPtrSet Deleted; + [[maybe_unused]] unsigned OrigNumSkipStores = State.SkipStores.size(); ToCheck.insert(KillingDef->getDefiningAccess()); bool Shortend = false; @@ -2119,7 +2128,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, // Check if MemoryAccesses in the worklist are killed by KillingDef. for (unsigned I = 0; I < ToCheck.size(); I++) { MemoryAccess *Current = ToCheck[I]; - if (State.SkipStores.count(Current)) + if (Deleted.contains(Current)) continue; std::optional MaybeDeadAccess = State.getDomMemoryDef( @@ -2166,7 +2175,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, continue; LLVM_DEBUG(dbgs() << "DSE: Remove Dead Store:\n DEAD: " << *DeadI << "\n KILLER: " << *KillingI << '\n'); - State.deleteDeadInstruction(DeadI); + State.deleteDeadInstruction(DeadI, &Deleted); ++NumFastStores; MadeChange = true; } else { @@ -2203,7 +2212,7 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, Shortend = true; // Remove killing store and remove any outstanding overlap // intervals for the updated store. - State.deleteDeadInstruction(KillingSI); + State.deleteDeadInstruction(KillingSI, &Deleted); auto I = State.IOLs.find(DeadSI->getParent()); if (I != State.IOLs.end()) I->second.erase(DeadSI); @@ -2215,13 +2224,16 @@ static bool eliminateDeadStores(Function &F, AliasAnalysis &AA, MemorySSA &MSSA, if (OR == OW_Complete) { LLVM_DEBUG(dbgs() << "DSE: Remove Dead Store:\n DEAD: " << *DeadI << "\n KILLER: " << *KillingI << '\n'); - State.deleteDeadInstruction(DeadI); + State.deleteDeadInstruction(DeadI, &Deleted); ++NumFastStores; MadeChange = true; } } } + assert(State.SkipStores.size() - OrigNumSkipStores == Deleted.size() && + "SkipStores and Deleted out of sync?"); + // Check if the store is a no-op. if (!Shortend && State.storeIsNoop(KillingDef, KillingUndObj)) { LLVM_DEBUG(dbgs() << "DSE: Remove No-Op Store:\n DEAD: " << *KillingI From nobody Sun Jul 28 11:14:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWzQP2F3Hz5S0Zs; Sun, 28 Jul 2024 11:14: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWzQP1TMtz4KDf; Sun, 28 Jul 2024 11:14:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722165245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pom/28kXTyP20uJqkE74biMNkHvIK/ILlwtVkfVWNLg=; b=sg+qIvbe6UTgp8TOCNjHKPjFaYJNgTY6EAp6pQpy1t1T5weV4f9eeIarI8fc+oWw3XF9H3 vP6IVNslMT9Mgzl4SvZ2xXGe+YwDjgbG28V6WQ/oSec+HCUEfH1LGGXXtQO2yP+6MKQYj1 BBLL7STFamwXNZCGUyjqxNcMRPsEL2j1/A687+GSqUy9W8JlhX/DB9NOHf0oBmqgU6ycsH 6CQXgdi+c5hf2kdnDus+MhNUeVbZKuyHW2gJCNHN+R/hlH80cMKlIiAyoutvMSP3g+GzFA s1ayh+UTProKrJSUOj12xtQr1NcD7VPyPvViuAlISFcz7wuFUNWnI8aFNqsBPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722165245; a=rsa-sha256; cv=none; b=kMfge8Dr0KsWhUB8vpCZlRWl+S9bzH1otmcVY/wc2nFEi5E1BCRVjnsWXZeyhyZorIm5Lg q0H1sYf02rn7hSCExwsxaReQzvtRjOx9Ezs+Kr5gf1ms9ZK+srTjJ0bot0Q2jRnzeLfiDo ry7tU4o61ucU90flmMtNlKrCNjuosXW+xXQwS0s+XvcI7sNHTKi+U9j2lNgrSe3HtnvTYj 0o04rW4TakYc/XwARQZMibBxA/c77IB80ghHINOGT1fOJS69pcMiSLXyXbtlzDVtkhLXPT oYVxFSPD/B9RAsemjWRgMhsg0nuopiKyR0epVLbCDnSxiBZYSV+t4dHPO1CNeg== 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=1722165245; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Pom/28kXTyP20uJqkE74biMNkHvIK/ILlwtVkfVWNLg=; b=LR3IYVWn1h3sDWDo7BKE5w6cX16IyHPiccr4P0153IomYwMqJraASK5IiS+ROq+wTShC2s AWBSW5vMf3dZXTFBEYMWWJkrw9dDeohHoZFCqzO9tvFGw33nh8CrRqg08ERwMPbOM5rpAq bd8SzV76IkIIA5Ml507uF5nrZFDvGs3dvrPFju2nlGPL6zc0j49RVVunmzJCoJYlQHc7sY h4+0ZwpkmqOkPOEfHHWo2V6EtAz3Frxy3lnVDeio5vphlTkAP0pMXs7HxRw+d79zYFbaZB AX6F2SwplqyWYFgtbje5RHzFpQ6AjDwx2qgNMPnRfmgDkWZlq5616qbYK9gOrQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWzQP15HVznc0; Sun, 28 Jul 2024 11:14:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SBE5CL018668; Sun, 28 Jul 2024 11:14:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SBE5g9018665; Sun, 28 Jul 2024 11:14:05 GMT (envelope-from git) Date: Sun, 28 Jul 2024 11:14:05 GMT Message-Id: <202407281114.46SBE5g9018665@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 52552d7572a6 - main - Revert "Fix llvm register allocator for native/cross build differences" List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 52552d7572a6d3d7d3ce0d6862de9a9d203c5d01 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=52552d7572a6d3d7d3ce0d6862de9a9d203c5d01 commit 52552d7572a6d3d7d3ce0d6862de9a9d203c5d01 Author: Dimitry Andric AuthorDate: 2024-07-28 11:08:50 +0000 Commit: Dimitry Andric CommitDate: 2024-07-28 11:09:03 +0000 Revert "Fix llvm register allocator for native/cross build differences" In preparation for applying the fix that landed upstream, this reverts commit 397c2693fa66508cb5e6b173650a1f3bc6c4dd4f: Fix llvm register allocator for native/cross build differences Work around an issue in LLVM's register allocator, which can cause slightly different i386 object files, when produced by a native or cross build of clang. This adds another volatile qualifier to a float variable declaration in the weightCalcHelper() function, which otherwise produces slightly different float results on amd64 and i386 hosts. In turn, this can lead to different (but equivalent) register choices, and thus non-identical assembly code. See https://github.com/llvm/llvm-project/issues/99396 for more details. Note this is a temporary fix, meant to merge in time for 13.4. As soon as upstream has a permanent solution we will import that. PR: 276961 Reported by: cperciva MFC after: 3 days --- contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp index afde8d001f88..f3cb7fa5af61 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp @@ -256,12 +256,7 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, return -1.0f; } - // FreeBSD customization: similar to the HWeight declaration below, add a - // volatile qualifier to avoid slightly different weight results on amd64 - // and i386 hosts, and possibly choosing different registers in the register - // allocator. See for - // more details. - volatile float Weight = 1.0f; + float Weight = 1.0f; if (IsSpillable) { // Get loop info for mi. if (MI->getParent() != MBB) { From nobody Sun Jul 28 11:14:06 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WWzQQ31wCz5S0Qw; Sun, 28 Jul 2024 11:14: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WWzQQ2T8lz4K4R; Sun, 28 Jul 2024 11:14:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722165246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FPN5IytdWA6qsOsGaQVTBlL+yRh0ktvx0wVXnzJ6Z5Y=; b=iHdH4672ItebnI1yZyWn/WNz3Xrq3EDtcH7Zynn7glVImQF+sw0NlI9R7rRRgrNlwHBZ0T zWQGUl94XUE+HcaXZORaaTgDEFY8ukyadoUFm7stY6/b85VpOXNL2jhtPg6OC0X0ppHtN1 1YqKTWqhjPl0RvHUz9UgrfbvLrIAjBWP5JmR5YcBFIxAt1B+bxuz3xgN5Rhku17U6sn6As Fmw12OD0+QZNw74qQaqSLZzpf3gtwgQVZoOiI4ZlVFRO3VxMzp46sAC7890z5sUXjZLcgb 3e4IZ9qvq48N8h71JnXDsSLfnqkHLb/G+Kj0x/cI/CRbeOU2WAspPpmVMfmQWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722165246; a=rsa-sha256; cv=none; b=Uqs89mnL8HC0ND2hW5jB2hll8zxIlv8QE1UxgXrB6IJ/rPnt4cPKGHF5vCnn0bVs9l+R++ JYIspE2yANrxlIB3j9aZdSXzDRe9uE9SIjR2OeKwYsdKsdnz4DWJVsnP2tGwIW1KJEN2et hBfK7G9Ysd1JX+9sjoKFHZ3rfImlne03PUbRp6YwjPF8UvrFXZ/bhHwkxI7P+CUUHvyFWE S3miUpWVi5xSejmNXl96c7CjunrBTEZHumNCixgzAEHz/1mylgVL6tKOUZhql9UgpJyUB8 dt3e9x4SCpLo2UrjJUvyP0vKtZbw+Y8UySjD9d2Q8ll4wIGCoYgOLeGC0bmB8g== 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=1722165246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FPN5IytdWA6qsOsGaQVTBlL+yRh0ktvx0wVXnzJ6Z5Y=; b=to2XbNESiDN8BzHCDU3rbXKFuGrLHwQPuQQYWO1usiVY9K17y8wo8Pnc9GlZFLOTMSUlr9 KnG9A6ylDz2KOYID70+NVoLUEnP0RvI2aPXlPB746QTbW1X3Znpx8MgYB9JsKBE4UWHjix lRnFhlXLvbiarYYQV7UR0gF8LjLIShXcvf4iY/zUlgaoTeHW7MkWes29WlrjyK1L1Q6/Gn FtUnNTF7TkxyLwddyC5GI+qWjIzpypfkl9Viw4/U1WE/XwSTA9TO4XBPT7d/Nq4/ELONGm KgwMH+FnfOP47qCodwhIKkjwqwBi7tj9X1+MAPmcGFDVmNXkpKaAXi8GxIo8dQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WWzQQ24NjzpS0; Sun, 28 Jul 2024 11:14:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SBE61C018720; Sun, 28 Jul 2024 11:14:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SBE6DZ018717; Sun, 28 Jul 2024 11:14:06 GMT (envelope-from git) Date: Sun, 28 Jul 2024 11:14:06 GMT Message-Id: <202407281114.46SBE6DZ018717@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 1a4b8325f6e3 - main - Merge commit c80c09f3e380 from llvm-project (by Dimitry Andric): List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1a4b8325f6e3a45c77188343da504fe04495cc46 Auto-Submitted: auto-generated The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=1a4b8325f6e3a45c77188343da504fe04495cc46 commit 1a4b8325f6e3a45c77188343da504fe04495cc46 Author: Dimitry Andric AuthorDate: 2024-07-28 11:13:37 +0000 Commit: Dimitry Andric CommitDate: 2024-07-28 11:13:37 +0000 Merge commit c80c09f3e380 from llvm-project (by Dimitry Andric): [CalcSpillWeights] Avoid x87 excess precision influencing weight result Fixes #99396 The result of `VirtRegAuxInfo::weightCalcHelper` can be influenced by x87 excess precision, which can result in slightly different register choices when the compiler is hosted on x86_64 or i386. This leads to different object file output when cross-compiling to i386, or native. Similar to 7af3432e22b0, we need to add a `volatile` qualifier to the local `Weight` variable to force it onto the stack, and avoid the excess precision. Define `stack_float_t` in `MathExtras.h` for this purpose, and use it. This is the version of the fix for PR276961 that landed upstream. PR: 276961 Reported by: cperciva MFC after: 3 days --- contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h | 8 ++++++++ contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp | 11 ++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h b/contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h index aa4f4d2ed42e..afb4fa262152 100644 --- a/contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h +++ b/contrib/llvm-project/llvm/include/llvm/Support/MathExtras.h @@ -644,6 +644,14 @@ std::enable_if_t, T> MulOverflow(T X, T Y, T &Result) { return UX > (static_cast(std::numeric_limits::max())) / UY; } +/// Type to force float point values onto the stack, so that x86 doesn't add +/// hidden precision, avoiding rounding differences on various platforms. +#if defined(__i386__) || defined(_M_IX86) +using stack_float_t = volatile float; +#else +using stack_float_t = float; +#endif + } // End llvm namespace #endif diff --git a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp index f3cb7fa5af61..fa7ef669ec11 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/CalcSpillWeights.cpp @@ -22,6 +22,7 @@ #include "llvm/CodeGen/TargetSubtargetInfo.h" #include "llvm/CodeGen/VirtRegMap.h" #include "llvm/Support/Debug.h" +#include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include #include @@ -256,7 +257,9 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, return -1.0f; } - float Weight = 1.0f; + // Force Weight onto the stack so that x86 doesn't add hidden precision, + // similar to HWeight below. + stack_float_t Weight = 1.0f; if (IsSpillable) { // Get loop info for mi. if (MI->getParent() != MBB) { @@ -283,11 +286,9 @@ float VirtRegAuxInfo::weightCalcHelper(LiveInterval &LI, SlotIndex *Start, Register HintReg = copyHint(MI, LI.reg(), TRI, MRI); if (!HintReg) continue; - // Force hweight onto the stack so that x86 doesn't add hidden precision, + // Force HWeight onto the stack so that x86 doesn't add hidden precision, // making the comparison incorrectly pass (i.e., 1 > 1 == true??). - // - // FIXME: we probably shouldn't use floats at all. - volatile float HWeight = Hint[HintReg] += Weight; + stack_float_t HWeight = Hint[HintReg] += Weight; if (HintReg.isVirtual() || MRI.isAllocatable(HintReg)) CopyHints.insert(CopyHint(HintReg, HWeight)); } From nobody Sun Jul 28 15:02:52 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WX4VN3Ll3z5SK6j; Sun, 28 Jul 2024 15:02: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WX4VN2mp8z4fY6; Sun, 28 Jul 2024 15:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722178972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+hBVq3dIAhG3JGArXVkFxdPT0I/Msw38i86UlIX9mfk=; b=lbGbbuJdI25+Vr7Jvq0h+SpDrw8plbw3y2xTMRtNZVwX6uJtjbmD1PQm4yMezfsnY89v+G GCaqGm154gclmFDDUPAZ9x1qNwdLQDVz0H4a3gYUpgbTBEIt3gurv9WdQkMp/6K2EzbQlj Gh1YUe6/WIA3WU0vvRmjYijtbw9B3XXlloaJn+f/KSGV6LaOnGBbjlphqjD7mC4pcB7/sv TUItvUr9uEHzmLhZoGxI8Dr4eyn/NXtFO+ci3Txp+cyI0yks9kQOSxebAIWLLNqktGUp4C zCKqUIAms404UWW72vZjeWJ1dHOFlc7oziRgq7YXorB0fAhD9TppkXrdiTBg+w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722178972; a=rsa-sha256; cv=none; b=SFLERn36E6wvhwlszHMTBzp3AwENAaV5IHQPNHXrgI/2otB4NESATlS1OaUZN6hlWiOZ+G v9KqUazJEBeLWM7UW6nca14Wt5W6oIy5KhdurZhaAGbE01+fKlWFKMbf4G/X315CwmT8y3 8U0XOoYJf2YgXPMZNYiG07DHDfcG7L0W3xrF//K3X8mVvWzDZG14ckFI5kaDwODKVc4zNu Ie0ZvLqEHl8+AERl1HbwNBSG+0fFZaQHGXGUCFOmmugZr5NV8fEzP3xdq1YwqnPhmBVl9K EjcjvsZB73OlGlkyOkpVmi8ME+03TkdkFSHIMXnQr8wWC/yjPc0Mqyn2iqf9lg== 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=1722178972; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+hBVq3dIAhG3JGArXVkFxdPT0I/Msw38i86UlIX9mfk=; b=rcd7jI+ao2dnKJZ1YoMs76+aiSNeGg8qAarGYNWhbCCCxSRiiIuaU6gNHDh7h67Dp4xhz6 n8jQ+BIrPeC7Zb+sjm4l36pvo/c0vl8dBSX0C06Kyn9JN6+j3y/Q/KtLLE7u/XAoFNhD8J wtRNijnMW+3G0cEwcDeR6rKLX9DV/9J/aV6TZFC4slj2Z8by/l+PO6Aoo/28R0ZW+EQ5oC 4jCySNNOXvq1cbR7QvY3mGYwLKIsK6ZXhMAh8imz66hvUhumyUjmiOsJ1jvecYYKcAB+dj VDBlAaEjt0DFwqnzMVKQAv1quRrJajVxrJftyz408kORXgLbbSAGoZ8XtshngQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WX4VN2Gvpzvwg; Sun, 28 Jul 2024 15:02:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SF2qn7008550; Sun, 28 Jul 2024 15:02:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SF2qVV008547; Sun, 28 Jul 2024 15:02:52 GMT (envelope-from git) Date: Sun, 28 Jul 2024 15:02:52 GMT Message-Id: <202407281502.46SF2qVV008547@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 7d1e4b7bf299 - stable/14 - sockstat(1): tolerate situation where file info cannot be fetched List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7d1e4b7bf299dbf2319c969357cd1545ad81c8a6 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=7d1e4b7bf299dbf2319c969357cd1545ad81c8a6 commit 7d1e4b7bf299dbf2319c969357cd1545ad81c8a6 Author: Konstantin Belousov AuthorDate: 2024-07-20 00:30:55 +0000 Commit: Konstantin Belousov CommitDate: 2024-07-28 15:02:45 +0000 sockstat(1): tolerate situation where file info cannot be fetched PR: 279875 (cherry picked from commit 35f4984343229545881a324a00cdbb3980d675ce) --- usr.bin/sockstat/sockstat.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c index 52c494f03045..56f107b5cdaf 100644 --- a/usr.bin/sockstat/sockstat.c +++ b/usr.bin/sockstat/sockstat.c @@ -1165,8 +1165,11 @@ displaysock(struct sock *s, int pos) f = RB_FIND(files_t, &ftree, &(struct file){ .xf_data = p->socket }); - pos += xprintf("[%lu %d]", - (u_long)f->xf_pid, f->xf_fd); + if (f != NULL) { + pos += xprintf("[%lu %d]", + (u_long)f->xf_pid, + f->xf_fd); + } } else pos += printaddr(&p->laddr->address); } @@ -1184,9 +1187,12 @@ displaysock(struct sock *s, int pos) f = RB_FIND(files_t, &ftree, &(struct file){ .xf_data = p->socket }); - pos += xprintf("%s[%lu %d]", - fref ? "" : ",", - (u_long)f->xf_pid, f->xf_fd); + if (f != NULL) { + pos += xprintf("%s[%lu %d]", + fref ? "" : ",", + (u_long)f->xf_pid, + f->xf_fd); + } ref = p->faddr->nextref; fref = false; } From nobody Sun Jul 28 15:34:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WX5BX4699z5SMS5; Sun, 28 Jul 2024 15:34: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WX5BX3Wf6z4jcP; Sun, 28 Jul 2024 15:34:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722180852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zn0fLLbglkc0EOGWV9cCOmMNTNa+ENfXZRJR3bTmDHc=; b=fdw1uB/6mhjr6RMQEs8oLCdg3Ph58ZvXwXQIoTuT6N+/F5NUoYKXymhs5ktWsEAI+hdBp1 FQB0w7vzh6XRfW+Bm0TkY9iBxFsVcIqxcWPEpNGoUswjf+P9OUkzuRUjfMCpJH4/lArNSn qOKXyPYDYySGsuY+4wnlbuR/6nm0Ct7WNofc7ID3DvsLHmSM/MO4RtREPr1tIQQ37Nk7CF OzMunIozl2MjXBayeNZ5G3/FaPAr0TDGzTZsD5Pdw9Kycj350TQxdUkp1aknYak2Q5KlP6 WwkLtqWdDThbsn+clANcd7+U8W+WPKXKDRtdkI5M5HnXrPTth7zraaWlLn6wbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722180852; a=rsa-sha256; cv=none; b=oB7HldUO1A/wEZW6DS4Q0jolT/G5moa4NqA0j38scdEh7HHh0wgOVmBrl4udOL2e+EjXpr iCYEcT2Kfy8wQWgsB+sJ4HPRA7MtegciQxle3AJmQ1/yJlQwiFqfxeP4GLrus4ab8SuqwB hCpjKmPfcI6XSBqYuO/a8B+vyeoOgD9hVg51aQRikuCdn1An8UHftrp9tKa9KLDsM6jZcr kSzjCLERdjSljqg7KSYAWpFQ0jaL6v+w68HHB4ZXPSSBmRMdqkYJ07lws2tNJOpZ4m5fYw VxDgX8oDt33sOtU+B/RbROkeJ8F59Y6SJH1aqrJ2To0ZtabgwPiw67C/aW0Zsg== 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=1722180852; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zn0fLLbglkc0EOGWV9cCOmMNTNa+ENfXZRJR3bTmDHc=; b=LhfGntbtmse2M/Co7TB6pSk/F5ywgeILiBocM0Bhq82FvflJe5rK7OVuSyLRQUui+r7ZmQ S6qVGEFXKF+a+gVLI6x92aj5LtJCC724xnG0/1ZuHsD0axe9Pf1W3BH80nw6I+OfvsCW6H JWjOQlA3iVH1crgiHjzSMlnZK6p2GfN1sRUwcAhrUWEOKEZtACXpDXQCYI3hwJliMUnLFb CEdqggae8wMvRoxJrN0e+w01p+0QDkXHlz1cnmYFlMF8RP6LzKkbTW6pMOwSFHz+ReNCS/ eedTprnVLDvL++NX4eFPVIeIsRVEe8KjLuSwef2zxqN41jtuQYjesBO6L4Vqzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WX5BX32CFzwFd; Sun, 28 Jul 2024 15:34:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SFYC4A059073; Sun, 28 Jul 2024 15:34:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SFYCOR059070; Sun, 28 Jul 2024 15:34:12 GMT (envelope-from git) Date: Sun, 28 Jul 2024 15:34:12 GMT Message-Id: <202407281534.46SFYCOR059070@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 9cc67e43610e - main - ktrace tests: Add a missing mode in open(O_CREAT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9cc67e43610e34a692398a65adcc5e8846e84250 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9cc67e43610e34a692398a65adcc5e8846e84250 commit 9cc67e43610e34a692398a65adcc5e8846e84250 Author: Mark Johnston AuthorDate: 2024-07-28 15:31:40 +0000 Commit: Mark Johnston CommitDate: 2024-07-28 15:31:40 +0000 ktrace tests: Add a missing mode in open(O_CREAT) MFC after: 1 week --- tests/sys/kern/ktrace_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/kern/ktrace_test.c b/tests/sys/kern/ktrace_test.c index 21868441c687..9d4c2dbdcd74 100644 --- a/tests/sys/kern/ktrace_test.c +++ b/tests/sys/kern/ktrace_test.c @@ -116,7 +116,7 @@ cap_trace_child(int cpid, struct ktr_cap_fail *v, int numv) int error, fd, i; ATF_REQUIRE((fd = open("ktrace.out", - O_RDONLY | O_CREAT | O_TRUNC)) != -1); + O_RDONLY | O_CREAT | O_TRUNC, 0600)) != -1); ATF_REQUIRE(ktrace("ktrace.out", KTROP_SET, KTRFAC_CAPFAIL, cpid) != -1); /* Notify child that we've starting tracing. */ From nobody Sun Jul 28 19:04:19 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WX9rz6V3Kz5RSTp; Sun, 28 Jul 2024 19:04: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WX9rz5zHkz43nk; Sun, 28 Jul 2024 19:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722193459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EgokET+yF1XGboNIRxxaLYoHP5vJj/ZiV/nMBXJcq+0=; b=xOkQzsDKIlNM9pYpR1Q/tUMKQh3fXjuiaarQG03dMi7p3THfJMsg40vn9N+29pArWdLf3T 4MWvwNpg48erVzN7RS64LqbiulHpuQsNDumEYeNSG3Douv4JqBPvcbUnl/xljh4l89lCS6 wDwS0l6ufGIRdTrCe8b/Wb4d3G0nlsX7iYXl8xOlmOiB/0o5iXJ4pUY7bFiSrNCyuWuZyM tPkLci7Bhocj7F/VI9x4ZGS8AqhfY2yjNP2A60Je5byruUBzFFbX2lu8ubuPxst9VOSkr4 b4aTtoOhAELV+Di7rw2VpoMJ9fOhKOPU+tjZis3/NV6LPJQzR8AYeiXOEnp0OQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722193459; a=rsa-sha256; cv=none; b=a/8cTZ8LmH6itvGf6tkW+hDUENuTsgylLs6jvA/2EAbZTiAKHS2tjP+QZPeaDenSb9yV3X Ik6bJ4w6NeOFV9O5GBukCFK8JVSxltgWOcfsCcTPyThytk0LC5aw3prml+ykqLqU7ljCjC teErOhmVxt8FVMUfB8u3P6bcs6vPIqnV7xFgkSJ01kqGg8I58A3GIMQQr9u5P916hg6qht CLlRvZIOIONaA+R5f9qYbraOzcqcRhSTnjQLehUppo1tTY7qt00xVkhpD/Qc0AF0kG4+OX hEjtUZi+QnOeR1FRKF+QO/H2kzyqbY625szAfUrQmqz9Sd8jSqLWfaihdnIAiA== 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=1722193459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EgokET+yF1XGboNIRxxaLYoHP5vJj/ZiV/nMBXJcq+0=; b=BnLgqBZguPw2ih+ROuMxljHPpXFC49xlWhEHTxKKjEFjlEAxCyzq2B8RC5zjew8HlQ/N9Y rXffOTEaY/bbj0pjd8kuM8VXf2le5megq7QzO7Wnz1nFjGFVdV9/ixUsV8/pV9JRp1Vq79 XfxwY/eS5OljQszxnqSAj16pd3ntjh/jWTcOwPynGeUPQZY5xN+554sNc/QuojoJam1g/f Xfbg9n48WMgK5O+jZZ5N1cpAsf2Onkn85BuLJKo3nPGaUlOrSG9CC8uZR8lGIDCwHc83p5 SECCbOcxlF+WxxljzOq4LIayPC6cnVImGvN1Kv9TpFArKrE5WvWmW0HSN7GzfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WX9rz5YHdz12r5; Sun, 28 Jul 2024 19:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SJ4JgJ015123; Sun, 28 Jul 2024 19:04:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SJ4J84015120; Sun, 28 Jul 2024 19:04:19 GMT (envelope-from git) Date: Sun, 28 Jul 2024 19:04:19 GMT Message-Id: <202407281904.46SJ4J84015120@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: b45276b1693d - stable/14 - Do not allow snapshots on UFS filesystems using gjournal. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b45276b1693db0f13d6203a8b989fe7ea856dbfb Auto-Submitted: auto-generated The branch stable/14 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=b45276b1693db0f13d6203a8b989fe7ea856dbfb commit b45276b1693db0f13d6203a8b989fe7ea856dbfb Author: Kirk McKusick AuthorDate: 2024-07-25 06:09:58 +0000 Commit: Kirk McKusick CommitDate: 2024-07-28 19:04:10 +0000 Do not allow snapshots on UFS filesystems using gjournal. PR: 280216 (cherry picked from commit cab41e0dd31d184bdb0d14403ca71a0f6c9a5e83) --- sys/ufs/ffs/ffs_snapshot.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 7e8c4dbb17d1..fedac50e38fb 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -224,6 +224,15 @@ ffs_snapshot(struct mount *mp, char *snapfile) ump = VFSTOUFS(mp); fs = ump->um_fs; sn = NULL; + /* + * At the moment, filesystems using gjournal cannot support + * taking snapshots. + */ + if ((mp->mnt_flag & MNT_GJOURNAL) != 0) { + vfs_mount_error(mp, "%s: Snapshots are not yet supported when " + "using gjournal", fs->fs_fsmnt); + return (EOPNOTSUPP); + } MNT_ILOCK(mp); flag = mp->mnt_flag; MNT_IUNLOCK(mp); From nobody Sun Jul 28 19:07:02 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WX9w62JJ7z5RT01; Sun, 28 Jul 2024 19:07: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WX9w61qR1z44Sp; Sun, 28 Jul 2024 19:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722193622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rg/Znx+7y0b6NrAJ8ffWkjDBgsDX2pV1ORxH2UXHP9A=; b=HJDrAJSK/DjNgHHXHBc/anLOQrbhYCQlJF9Mecht/xWN+6lgx9CSPiBu6dlrd1CkrP4u6b /weXixaick55S8WbtQP+gMTOpkQ9cAcmGskhREwhAEx8f1J6E8ZVY/LLtxaBzDT+frT6wZ 7E+2VqaSONd/4oPUkhG7vtBtk7ZTvSfqGKCQ6c64PmkcLpLTKL25SIt9fnxvEWMpQCptQh xnGD12rGoyhrCsq1HWUHVFxA856b/93v28QzvcChX8bB/3Ziwae6XKeklMlS6hNKpJ7RaG j5Cs7ooE/1IhavSthIxWzjDSQC0Sak4B/d51DI3R0wjNbb8rAnHg7OROVeX3eQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722193622; a=rsa-sha256; cv=none; b=mz8Q3l7OdZXnR+M4hhL/oPBOXkzrcfAeT1tklVS0esa2Toh4WgaCTCrIfS1EhInGfhchhW EC+8TCkViJJRQ0evWL1ghbCoRi+naCL/Y01vOo9anfYBtTWV0zZOtfzAG+5r0UaTdqE0e6 bV5XL267LsP5oZ7YfnqKpj2HdWp17I+lczFVIiCKd9agBaDwa0bhbPUCQrEsEvxdsQ3nlV 7oMs/p1jj8CKm/dd5eIDSNbsVpimMFqK00gjs1a2SI+8bDAuii6y8NOOLmSDxECB/RHz0I eEe5Qt5VdseG2ERP/qD6n2xkcFi33jzkp3FzaFol7RbT0cgjTgHMJGsrWjqSMg== 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=1722193622; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rg/Znx+7y0b6NrAJ8ffWkjDBgsDX2pV1ORxH2UXHP9A=; b=BYHOUTMSKl+bkuJ+uSSDuvO60dNqs2o8dmydVy68Ib9kOumklrY86H4g+vuZtfcva6mQCd 3uFL/JRx2/Ti5y2dKF1AOKygucqQPA71DTwACaRXYsUdQtJpm7eeA2uw4zmlHXP14dRRwc C9ImwF8dBn1exVAaGcBtFUXS85cEZn6e9p/Nntf3RndWg4G0UY7b57IVSwfiLltcmLcon0 O0tl7z7rqEubay0zUIThSGt4jLwbfazPwSpR0BOBPdZuRfiPfox/S4u+POKqQsfnoezmB9 7ftuQYvqZnPAfCnXxNS8rvnpABjRXbnmoMQTzNfvRAakmSk0J0FywVMt9b6P4g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WX9w61NtXz136g; Sun, 28 Jul 2024 19:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SJ7250015624; Sun, 28 Jul 2024 19:07:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SJ72tu015621; Sun, 28 Jul 2024 19:07:02 GMT (envelope-from git) Date: Sun, 28 Jul 2024 19:07:02 GMT Message-Id: <202407281907.46SJ72tu015621@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kirk McKusick Subject: git: 21161df3e032 - stable/13 - Do not allow snapshots on UFS filesystems using gjournal. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 21161df3e032252e7533a183acbc5374157b66f1 Auto-Submitted: auto-generated The branch stable/13 has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=21161df3e032252e7533a183acbc5374157b66f1 commit 21161df3e032252e7533a183acbc5374157b66f1 Author: Kirk McKusick AuthorDate: 2024-07-25 06:09:58 +0000 Commit: Kirk McKusick CommitDate: 2024-07-28 19:06:52 +0000 Do not allow snapshots on UFS filesystems using gjournal. PR: 280216 (cherry picked from commit cab41e0dd31d184bdb0d14403ca71a0f6c9a5e83) --- sys/ufs/ffs/ffs_snapshot.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index d4280391f48c..bc4dbdf52e5b 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -224,6 +224,15 @@ ffs_snapshot(struct mount *mp, char *snapfile) ump = VFSTOUFS(mp); fs = ump->um_fs; sn = NULL; + /* + * At the moment, filesystems using gjournal cannot support + * taking snapshots. + */ + if ((mp->mnt_flag & MNT_GJOURNAL) != 0) { + vfs_mount_error(mp, "%s: Snapshots are not yet supported when " + "using gjournal", fs->fs_fsmnt); + return (EOPNOTSUPP); + } MNT_ILOCK(mp); flag = mp->mnt_flag; MNT_IUNLOCK(mp); From nobody Sun Jul 28 20:21:03 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXCYW58bQz5Rb6x; Sun, 28 Jul 2024 20:21: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXCYW1bK9z4CQX; Sun, 28 Jul 2024 20:21:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722198063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axW4SbGmQ4S9EAbAycCCzMJ1RRmCEtt5wsYw3b25F9A=; b=mPB+GVcwIqDp7AS1HlPTYxYVLpMCQahf/vwJWtLXhu33j/RuIoOLeJkvDksfMDMs7H9Z2l vn+I1/kRx19Et4jj1Mgs2AIhWueWvKpyVUFOGUx8KVaEHuwRkEog3+G37CEEfLud/3hpCA 1wRauS+HRmmRUPqSsjuIti6C+rjBd+5PSxQF1JJrXWh+Lq948swQCt0MNBqcKnfh2QQHZa yYFnacB53Q4iufB8ISse9Y6lwYN5A6JHMh4EKzONcP5Hs6lm19FHKo+93yKEjJLhxQXxAS 3Kqwo0gujmjkW0TST4oXkIxPKHr+m2dtBXxVRBWTm/ProOgYgmPiXbYLGXoB2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722198063; a=rsa-sha256; cv=none; b=fYmrCApX1gb1jmt0KipaOv7WSBgkeSFK8WA229dnRKXOSIVrROk3MzUp1fRbXlrDm8XY2x y79E6HVfWyIWQXoX2JgwKJP0fLqPG43XxwT79MAFcsd2smuVdYoqbBsJgyyenVgL/149Us uvJSC5zACYzNGMxRBMR3sPIHAraHhzOvjtAhAqQ/J/vjhLEbJRxUKcE0ocYSOzmwsUyhBj 6LHBwBpguHVTERkWpGy2WiJ7DBRTtT+ilw7XAFIDF9fFFtWvT6Wvq35K0pZ3dv6DT2Mtcw nUU7cAR2/4YTWNSqH7kVKAyTYQqsSMMVISWx0PH17WZ4Mk1ry9i8GE7SzTDpqQ== 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=1722198063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=axW4SbGmQ4S9EAbAycCCzMJ1RRmCEtt5wsYw3b25F9A=; b=Z8v4/13eB/xL6fOOkAz4Wh+84TvvJfBk2t8iicFbzQRYd4YOOF4Lq4CE/UiF7GAUfh4U7S vBHWweBDu+MkiFL/zzfMGMnT3Oa6FR3f8d55gayWg1OUiYoHopYQd5fG6HhfC41SW3m+/d Up1PW1rvrq6JsBuXKWPKJPnIgDtrEt99WwGdg8SstEoY/p8bFE5+Nc0T7yHUlcq4WK5NyR AaBHcUNYzE3KMWMRYNJOFghfISXpYg8gRNg8N45g/SvTHXwm2YBanWn1qoiPEF5WcZYHKG htUan95lwd8jXWX4K8K5Fdee7NvFZNrdM2EGRKO0wF1cHYN+727M5jYva7IQ/g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXCYW1BKtz14cb; Sun, 28 Jul 2024 20:21:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SKL3X2045865; Sun, 28 Jul 2024 20:21:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SKL3Vl045862; Sun, 28 Jul 2024 20:21:03 GMT (envelope-from git) Date: Sun, 28 Jul 2024 20:21:03 GMT Message-Id: <202407282021.46SKL3Vl045862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ruslan Bukin Subject: git: 301ced3b69fb - stable/13 - snd_hdspe(4): Recognize newer firmware's PCI vendor id. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 301ced3b69fb162bb157043c4a8da483cfff56e7 Auto-Submitted: auto-generated The branch stable/13 has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=301ced3b69fb162bb157043c4a8da483cfff56e7 commit 301ced3b69fb162bb157043c4a8da483cfff56e7 Author: Florian Walpen AuthorDate: 2024-04-27 08:48:37 +0000 Commit: Ruslan Bukin CommitDate: 2024-07-28 20:20:04 +0000 snd_hdspe(4): Recognize newer firmware's PCI vendor id. At least for HDSPe RayDAT cards, newer firmware comes with RME's own PCI vendor id instead of the Xilinx one. Other HDSPe cards are probably also affected. Update snd_hdspe(4) to recognize both the old Xilinx and the new RME vendor ids. Differential Revision: https://reviews.freebsd.org/D44978 MFC after: 1 day (cherry picked from commit 9718d4ab99386918f5b5c207c58289eaade20623) --- sys/dev/sound/pci/hdspe.c | 3 ++- sys/dev/sound/pci/hdspe.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pci/hdspe.c b/sys/dev/sound/pci/hdspe.c index 7289bd3401dc..9bd7bc449c70 100644 --- a/sys/dev/sound/pci/hdspe.c +++ b/sys/dev/sound/pci/hdspe.c @@ -231,7 +231,8 @@ hdspe_probe(device_t dev) { uint32_t rev; - if (pci_get_vendor(dev) == PCI_VENDOR_XILINX && + if ((pci_get_vendor(dev) == PCI_VENDOR_XILINX || + pci_get_vendor(dev) == PCI_VENDOR_RME) && pci_get_device(dev) == PCI_DEVICE_XILINX_HDSPE) { rev = pci_get_revid(dev); switch (rev) { diff --git a/sys/dev/sound/pci/hdspe.h b/sys/dev/sound/pci/hdspe.h index 7056a75a66c1..fc2af2972d1c 100644 --- a/sys/dev/sound/pci/hdspe.h +++ b/sys/dev/sound/pci/hdspe.h @@ -27,6 +27,7 @@ */ #define PCI_VENDOR_XILINX 0x10ee +#define PCI_VENDOR_RME 0x1d18 /* Newer firmware versions. */ #define PCI_DEVICE_XILINX_HDSPE 0x3fc6 /* AIO, MADI, AES, RayDAT */ #define PCI_CLASS_REVISION 0x08 #define PCI_REVISION_AIO 212 From nobody Sun Jul 28 20:23:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXCcw0FBzz5RbjK; Sun, 28 Jul 2024 20:24: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXCcv4x9bz4DW8; Sun, 28 Jul 2024 20:23:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722198239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=491oJw0Y1wH/KweK8hq3opCQp4u9VG2PEEd6Om03gZg=; b=Cch4ledGIztynVp4WUUyAAbLXvW1H8fe2DJ3I2FEUXGjy3ZbUG8BCR668m8wQzsSiGBt7j ZUoklMcFuy/wC9dZ3I7ECWzrar7AOM5R7LmNLEToI5E0VpGB/c//dmm0i3PVgDR0+htbvd QUMXNuFBFtyVr0G2Q2xuy/qAkA2IATc3dJvqV7pz13zMBWdRKHl7Y/yDUu273qxWj4Ivcp uohQj4JUXZmE6M+s5hpJrjwyLrIGJaxMD+ofqQrGcKG8v5wE3Xn8a5hAqAnC+Bx+40w/Ux lHAw1Df/9X6XhG0zyYz9w7rZNd0RrPRz+7AOxr0kZmjao4CAA6D6YpNUibWqRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722198239; a=rsa-sha256; cv=none; b=QrzEJDbffsRLxoV/hJXxp2GasfsdoOZYA641InLogd8ah9cBhbxmZ/Br17BQ5HC0bmlWqY Z/Pz7x21pL56TpaIEcNvdx3IIy0Ts0vyyz5kB+yGNn7kg7s92hjZojT7gdb96oHN95oBXb 7zDODJYeKYqgHfnlSPrOewHcAvWnrVBB0A6E5QC0ik3E4255V5L4w9x90/R1tA6J/N3ybC Sq5ASrMVfrDtVdU+zE+/N2HXdNOejtOQ0UxtJ8hfFxhOMeC05smgq+fCcYYuq+Nbz5+z4N BStCeksZRN0IgA78twbn6LfrERcdiqpIqE+yE9vAV8t9dQaNpHK+K8p/ZOPgiw== 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=1722198239; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=491oJw0Y1wH/KweK8hq3opCQp4u9VG2PEEd6Om03gZg=; b=QsUOKVcyvpnzc1x9RpF2BHRRVjWVu2FTkpwYUxHKakCy3kAGXMSWe0d8gXmL1kaC4y3Gkc d5Q9PfZf2r9pkDXdZhFcUvQnX4aWgHgnQFlQR8vz6GIPjShnE13NaA4SS2cw93+LgKxYcO vARSMEzy9zpYcAej3eb4zN9doy+jgoJKwP4HZmrz1Y6WfCyUlAIa6ISmcfO57t1T5dCiEk yrFIlo7o26h98CrBJadVBTq4eHtxaEjYwmnPb3e/RSI3GHicj2JLlX38ghfe9fqHdq5dR7 GWwmcFRM1OacYefT8mo9aSdDWapVdwKHB3C58eVr6sqIsClkpwyUfHKSPvpQFw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXCcv4Wrqz14Sx; Sun, 28 Jul 2024 20:23:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SKNxRg050384; Sun, 28 Jul 2024 20:23:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SKNxXP050381; Sun, 28 Jul 2024 20:23:59 GMT (envelope-from git) Date: Sun, 28 Jul 2024 20:23:59 GMT Message-Id: <202407282023.46SKNxXP050381@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ruslan Bukin Subject: git: 12f6e0a4d2d5 - stable/14 - snd_hdspe(4): Recognize newer firmware's PCI vendor id. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: br X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 12f6e0a4d2d5e51c403a45dcaf34928572a88345 Auto-Submitted: auto-generated The branch stable/14 has been updated by br: URL: https://cgit.FreeBSD.org/src/commit/?id=12f6e0a4d2d5e51c403a45dcaf34928572a88345 commit 12f6e0a4d2d5e51c403a45dcaf34928572a88345 Author: Florian Walpen AuthorDate: 2024-04-27 08:48:37 +0000 Commit: Ruslan Bukin CommitDate: 2024-07-28 20:23:07 +0000 snd_hdspe(4): Recognize newer firmware's PCI vendor id. At least for HDSPe RayDAT cards, newer firmware comes with RME's own PCI vendor id instead of the Xilinx one. Other HDSPe cards are probably also affected. Update snd_hdspe(4) to recognize both the old Xilinx and the new RME vendor ids. Differential Revision: https://reviews.freebsd.org/D44978 MFC after: 1 day (cherry picked from commit 9718d4ab99386918f5b5c207c58289eaade20623) --- sys/dev/sound/pci/hdspe.c | 3 ++- sys/dev/sound/pci/hdspe.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pci/hdspe.c b/sys/dev/sound/pci/hdspe.c index 91d1f3ee1bf6..0b378cc3d8f4 100644 --- a/sys/dev/sound/pci/hdspe.c +++ b/sys/dev/sound/pci/hdspe.c @@ -395,7 +395,8 @@ hdspe_probe(device_t dev) { uint32_t rev; - if (pci_get_vendor(dev) == PCI_VENDOR_XILINX && + if ((pci_get_vendor(dev) == PCI_VENDOR_XILINX || + pci_get_vendor(dev) == PCI_VENDOR_RME) && pci_get_device(dev) == PCI_DEVICE_XILINX_HDSPE) { rev = pci_get_revid(dev); switch (rev) { diff --git a/sys/dev/sound/pci/hdspe.h b/sys/dev/sound/pci/hdspe.h index d5d8dd46e580..56b928b23abd 100644 --- a/sys/dev/sound/pci/hdspe.h +++ b/sys/dev/sound/pci/hdspe.h @@ -28,6 +28,7 @@ */ #define PCI_VENDOR_XILINX 0x10ee +#define PCI_VENDOR_RME 0x1d18 /* Newer firmware versions. */ #define PCI_DEVICE_XILINX_HDSPE 0x3fc6 /* AIO, MADI, AES, RayDAT */ #define PCI_CLASS_REVISION 0x08 #define PCI_REVISION_AIO 212 From nobody Sun Jul 28 20:29:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXClc0gH8z5RcFg; Sun, 28 Jul 2024 20:29: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXClb73Wvz4Dhj; Sun, 28 Jul 2024 20:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722198588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tro6EEGCjT6tXeFnW3SvkrXTBI1JVdz7z3ZHa8IxQjA=; b=mmVOvsk03CoP+Rbx/pDgSegJTkgqxhjAN8epKOet8k6qu/9dMtwVoGqdCqeQkDqGhX9rgg slsF9N01ngdP6M6IvSz8hiBV2N7QilG9fvsL4SR5gT20cb4ChmargT2+beS+uPeOYsXgHK XWj3jZ3cYfIwy8ty0TyDDt2jgKP79XxBdoIwTm3M6IcQcKABQvnVIEp+Zjew8ANPSYW/4p YhPgzhB9PmfM42tKURs22FFM0iDf4EWzSkfykWdJ8934MkVUQVQWwiqhYlsWY387zhqF5m 6tv/AXREit1UxdM4oYb3kHdyxuaRllnotNIPXyh62RhQzUsE+1EVi4ZbwP5glg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722198588; a=rsa-sha256; cv=none; b=uC/BIEPeqX7hXyzCBLTY017aTNzxpqepfQz8TgF4bnHbsRa+W/wDrukRGrP8behjD084Mz N30TzjbFTvGwCEfG+oBd0DP42MLtY57LvDBVnHHqVPaJ8NsGoZ7hpObiiiuuZ8+3Y5R0tn nP8Kcg2h0XMk+IsVxW7g+FV3KtaCRoxajcB88x/rdJkmWr/VOKvJ5klLZarhIINdb/VMu0 TdGd5+aBv5faidy5uJ3CzYHhWCjliUN5NB9hFdOTHBlu2m8XIOamZ+GogGV3s/HwllGt4s hZf1SN7c8xiFwaD6fBaUlUcvwHFXaNMHSoCsdzL2VTX+aFFMddMewDrKPkPO+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=1722198588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Tro6EEGCjT6tXeFnW3SvkrXTBI1JVdz7z3ZHa8IxQjA=; b=o7KfDsI1wtxh/yVGi9+LlpEY3p5rD9k8mPE3bS2AiNLL5PkyzJD7iG07dl8PiHvVXMicgI rdhcDInQwp5heEKVJw2ZD61XFHGM1inxYRmy0TmgOmD0QTPIY7vTMOrVUeWh9NKPOCrI3S UmRQkO5jsHOFtjJR6agt4ugXRJdcVTovm/FryHxiuNici4o50qZl+WRiL0+YftYhNTmhAY 5cIby22s98s/BxV928K1p8V+pUo9g7ADubrR3DPDOQLfBVZW5hV9pBVwROM199eOT8aVVE JDqPBv6ATW0FvuvES44cjMzfLnoAs8OAQchWcDyAZXU5U+s4hmX/2y91gGOQbA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXClb6YZqz14Sy; Sun, 28 Jul 2024 20:29:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SKTllV051237; Sun, 28 Jul 2024 20:29:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SKTlKu051234; Sun, 28 Jul 2024 20:29:47 GMT (envelope-from git) Date: Sun, 28 Jul 2024 20:29:47 GMT Message-Id: <202407282029.46SKTlKu051234@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 00d3b74406db - main - tcp cc: remove non-working sctp support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 00d3b74406db80084e8939450c6b86326dd1de30 Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=00d3b74406db80084e8939450c6b86326dd1de30 commit 00d3b74406db80084e8939450c6b86326dd1de30 Author: Michael Tuexen AuthorDate: 2024-07-28 20:25:48 +0000 Commit: Michael Tuexen CommitDate: 2024-07-28 20:25:48 +0000 tcp cc: remove non-working sctp support As suggested by lstewart, remove the non-working SCTP support in the TCP congestion control modules. SCTP has a similar functionality (although not using kernel loadable modules), on which the TCP stuff was built on, but the integration was never done. No functional change intended. Reviewed by: Peter Lei, cc Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46142 --- sys/netinet/cc/cc.c | 8 ++++---- sys/netinet/cc/cc.h | 11 +---------- sys/netinet/cc/cc_cdg.c | 2 +- sys/netinet/cc/cc_chd.c | 2 +- sys/netinet/cc/cc_cubic.c | 12 ++++++------ sys/netinet/cc/cc_dctcp.c | 6 +++--- sys/netinet/cc/cc_htcp.c | 18 +++++++++--------- sys/netinet/cc/cc_module.h | 13 +------------ sys/netinet/cc/cc_newreno.c | 10 +++++----- sys/netinet/cc/cc_vegas.c | 2 +- sys/netinet/tcp_subr.c | 3 +-- sys/netinet/tcp_usrreq.c | 2 +- 12 files changed, 34 insertions(+), 55 deletions(-) diff --git a/sys/netinet/cc/cc.c b/sys/netinet/cc/cc.c index 9a8ca760fa28..16d27a868bd3 100644 --- a/sys/netinet/cc/cc.c +++ b/sys/netinet/cc/cc.c @@ -404,7 +404,7 @@ newreno_cc_post_recovery(struct cc_var *ccv) * XXXLAS: Find a way to do this without needing curack */ if (V_tcp_do_newsack) - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); else pipe = CCV(ccv, snd_max) - ccv->curack; if (pipe < CCV(ccv, snd_ssthresh)) @@ -440,7 +440,7 @@ newreno_cc_after_idle(struct cc_var *ccv) * maximum of the former ssthresh or 3/4 of the old cwnd, to * not exit slow-start prematurely. */ - rw = tcp_compute_initwnd(tcp_fixed_maxseg(ccv->ccvc.tcp)); + rw = tcp_compute_initwnd(tcp_fixed_maxseg(ccv->tp)); CCV(ccv, snd_ssthresh) = max(CCV(ccv, snd_ssthresh), CCV(ccv, snd_cwnd)-(CCV(ccv, snd_cwnd)>>2)); @@ -457,7 +457,7 @@ newreno_cc_cong_signal(struct cc_var *ccv, ccsignal_t type) uint32_t cwin, factor, mss, pipe; cwin = CCV(ccv, snd_cwnd); - mss = tcp_fixed_maxseg(ccv->ccvc.tcp); + mss = tcp_fixed_maxseg(ccv->tp); /* * Other TCP congestion controls use newreno_cong_signal(), but * with their own private cc_data. Make sure the cc_data is used @@ -490,7 +490,7 @@ newreno_cc_cong_signal(struct cc_var *ccv, ccsignal_t type) case CC_RTO: if (CCV(ccv, t_rxtshift) == 1) { if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); } else { pipe = CCV(ccv, snd_max) - CCV(ccv, snd_fack) + diff --git a/sys/netinet/cc/cc.h b/sys/netinet/cc/cc.h index aac0825e5fe1..63381f4b5ca3 100644 --- a/sys/netinet/cc/cc.h +++ b/sys/netinet/cc/cc.h @@ -87,21 +87,12 @@ int cc_deregister_algo(struct cc_algo *remove_cc); #endif /* _KERNEL */ #if defined(_KERNEL) || defined(_WANT_TCPCB) -/* - * Wrapper around transport structs that contain same-named congestion - * control variables. Allows algos to be shared amongst multiple CC aware - * transprots. - */ struct cc_var { void *cc_data; /* Per-connection private CC algorithm data. */ int bytes_this_ack; /* # bytes acked by the current ACK. */ tcp_seq curack; /* Most recent ACK. */ uint32_t flags; /* Flags for cc_var (see below) */ - int type; /* Indicates which ptr is valid in ccvc. */ - union ccv_container { - struct tcpcb *tcp; - struct sctp_nets *sctp; - } ccvc; + struct tcpcb *tp; /* Pointer to tcpcb */ uint16_t nsegs; /* # segments coalesced into current chain. */ uint8_t labc; /* Dont use system abc use passed in */ }; diff --git a/sys/netinet/cc/cc_cdg.c b/sys/netinet/cc/cc_cdg.c index 7ec9e8ca3ccc..997d9435870f 100644 --- a/sys/netinet/cc/cc_cdg.c +++ b/sys/netinet/cc/cc_cdg.c @@ -295,7 +295,7 @@ cdg_cb_init(struct cc_var *ccv, void *ptr) { struct cdg *cdg_data; - INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp)); + INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); if (ptr == NULL) { cdg_data = malloc(sizeof(struct cdg), M_CC_MEM, M_NOWAIT); if (cdg_data == NULL) diff --git a/sys/netinet/cc/cc_chd.c b/sys/netinet/cc/cc_chd.c index 92fcf68c41f1..f48d1f0066e2 100644 --- a/sys/netinet/cc/cc_chd.c +++ b/sys/netinet/cc/cc_chd.c @@ -322,7 +322,7 @@ chd_cb_init(struct cc_var *ccv, void *ptr) { struct chd *chd_data; - INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp)); + INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); if (ptr == NULL) { chd_data = malloc(sizeof(struct chd), M_CC_MEM, M_NOWAIT); if (chd_data == NULL) diff --git a/sys/netinet/cc/cc_cubic.c b/sys/netinet/cc/cc_cubic.c index 5141de86ef85..45f75efe5ae7 100644 --- a/sys/netinet/cc/cc_cubic.c +++ b/sys/netinet/cc/cc_cubic.c @@ -125,7 +125,7 @@ cubic_log_hystart_event(struct cc_var *ccv, struct cubic *cubicd, uint8_t mod, u if (hystart_bblogs == 0) return; - tp = ccv->ccvc.tcp; + tp = ccv->tp; if (tcp_bblogging_on(tp)) { union tcp_log_stackspecific log; struct timeval tv; @@ -385,7 +385,7 @@ cubic_cb_init(struct cc_var *ccv, void *ptr) { struct cubic *cubic_data; - INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp)); + INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); if (ptr == NULL) { cubic_data = malloc(sizeof(struct cubic), M_CC_MEM, M_NOWAIT|M_ZERO); if (cubic_data == NULL) @@ -424,7 +424,7 @@ cubic_cong_signal(struct cc_var *ccv, ccsignal_t type) uint32_t mss, pipe; cubic_data = ccv->cc_data; - mss = tcp_fixed_maxseg(ccv->ccvc.tcp); + mss = tcp_fixed_maxseg(ccv->tp); switch (type) { case CC_NDUPACK: @@ -478,7 +478,7 @@ cubic_cong_signal(struct cc_var *ccv, ccsignal_t type) cubic_data->undo_W_max = cubic_data->W_max; cubic_data->undo_K = cubic_data->K; if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); } else { pipe = CCV(ccv, snd_max) - CCV(ccv, snd_fack) + @@ -549,7 +549,7 @@ cubic_post_recovery(struct cc_var *ccv) * XXXLAS: Find a way to do this without needing curack */ if (V_tcp_do_newsack) - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); else pipe = CCV(ccv, snd_max) - ccv->curack; @@ -590,7 +590,7 @@ cubic_record_rtt(struct cc_var *ccv) /* Ignore srtt until a min number of samples have been taken. */ if (CCV(ccv, t_rttupdated) >= CUBIC_MIN_RTT_SAMPLES) { cubic_data = ccv->cc_data; - t_srtt_usecs = tcp_get_srtt(ccv->ccvc.tcp, + t_srtt_usecs = tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_USEC); /* * Record the current SRTT as our minrtt if it's the smallest diff --git a/sys/netinet/cc/cc_dctcp.c b/sys/netinet/cc/cc_dctcp.c index 374db98c5e60..06b2de11fd46 100644 --- a/sys/netinet/cc/cc_dctcp.c +++ b/sys/netinet/cc/cc_dctcp.c @@ -201,7 +201,7 @@ dctcp_cb_init(struct cc_var *ccv, void *ptr) { struct dctcp *dctcp_data; - INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp)); + INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); if (ptr == NULL) { dctcp_data = malloc(sizeof(struct dctcp), M_CC_MEM, M_NOWAIT|M_ZERO); if (dctcp_data == NULL) @@ -245,7 +245,7 @@ dctcp_cong_signal(struct cc_var *ccv, ccsignal_t type) if (CCV(ccv, t_flags2) & TF2_ECN_PERMIT) { dctcp_data = ccv->cc_data; cwin = CCV(ccv, snd_cwnd); - mss = tcp_fixed_maxseg(ccv->ccvc.tcp); + mss = tcp_fixed_maxseg(ccv->tp); switch (type) { case CC_NDUPACK: @@ -294,7 +294,7 @@ dctcp_cong_signal(struct cc_var *ccv, ccsignal_t type) case CC_RTO: if (CCV(ccv, t_rxtshift) == 1) { if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); } else { pipe = CCV(ccv, snd_max) - CCV(ccv, snd_fack) + diff --git a/sys/netinet/cc/cc_htcp.c b/sys/netinet/cc/cc_htcp.c index 41c552a3bfa0..49bf4d6142f1 100644 --- a/sys/netinet/cc/cc_htcp.c +++ b/sys/netinet/cc/cc_htcp.c @@ -253,7 +253,7 @@ htcp_cb_init(struct cc_var *ccv, void *ptr) { struct htcp *htcp_data; - INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp)); + INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); if (ptr == NULL) { htcp_data = malloc(sizeof(struct htcp), M_CC_MEM, M_NOWAIT); if (htcp_data == NULL) @@ -284,7 +284,7 @@ htcp_cong_signal(struct cc_var *ccv, ccsignal_t type) uint32_t mss, pipe; htcp_data = ccv->cc_data; - mss = tcp_fixed_maxseg(ccv->ccvc.tcp); + mss = tcp_fixed_maxseg(ccv->tp); switch (type) { case CC_NDUPACK: @@ -325,7 +325,7 @@ htcp_cong_signal(struct cc_var *ccv, ccsignal_t type) case CC_RTO: if (CCV(ccv, t_rxtshift) == 1) { if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); } else { pipe = CCV(ccv, snd_max) - CCV(ccv, snd_fack) + @@ -383,7 +383,7 @@ htcp_post_recovery(struct cc_var *ccv) * XXXLAS: Find a way to do this without needing curack */ if (V_tcp_do_newsack) - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); else pipe = CCV(ccv, snd_max) - ccv->curack; @@ -451,7 +451,7 @@ htcp_recalc_alpha(struct cc_var *ccv) */ if (V_htcp_rtt_scaling) alpha = max(1, (min(max(HTCP_MINROWE, - (tcp_get_srtt(ccv->ccvc.tcp, TCP_TMR_GRANULARITY_TICKS) << HTCP_SHIFT) / + (tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS) << HTCP_SHIFT) / htcp_rtt_ref), HTCP_MAXROWE) * alpha) >> HTCP_SHIFT); @@ -502,18 +502,18 @@ htcp_record_rtt(struct cc_var *ccv) * or minrtt is currently equal to its initialised value. Ignore SRTT * until a min number of samples have been taken. */ - if ((tcp_get_srtt(ccv->ccvc.tcp, TCP_TMR_GRANULARITY_TICKS) < htcp_data->minrtt || + if ((tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS) < htcp_data->minrtt || htcp_data->minrtt == TCPTV_SRTTBASE) && (CCV(ccv, t_rttupdated) >= HTCP_MIN_RTT_SAMPLES)) - htcp_data->minrtt = tcp_get_srtt(ccv->ccvc.tcp, TCP_TMR_GRANULARITY_TICKS); + htcp_data->minrtt = tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS); /* * Record the current SRTT as our maxrtt if it's the largest we've * seen. Ignore SRTT until a min number of samples have been taken. */ - if (tcp_get_srtt(ccv->ccvc.tcp, TCP_TMR_GRANULARITY_TICKS) > htcp_data->maxrtt + if (tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS) > htcp_data->maxrtt && CCV(ccv, t_rttupdated) >= HTCP_MIN_RTT_SAMPLES) - htcp_data->maxrtt = tcp_get_srtt(ccv->ccvc.tcp, TCP_TMR_GRANULARITY_TICKS); + htcp_data->maxrtt = tcp_get_srtt(ccv->tp, TCP_TMR_GRANULARITY_TICKS); } /* diff --git a/sys/netinet/cc/cc_module.h b/sys/netinet/cc/cc_module.h index e01d7a124ad4..606b2b66e7e5 100644 --- a/sys/netinet/cc/cc_module.h +++ b/sys/netinet/cc/cc_module.h @@ -43,18 +43,7 @@ #ifndef _NETINET_CC_MODULE_H_ #define _NETINET_CC_MODULE_H_ -/* - * Allows a CC algorithm to manipulate a commonly named CC variable regardless - * of the transport protocol and associated C struct. - * XXXLAS: Out of action until the work to support SCTP is done. - * -#define CCV(ccv, what) \ -(*( \ - (ccv)->type == IPPROTO_TCP ? &(ccv)->ccvc.tcp->what : \ - &(ccv)->ccvc.sctp->what \ -)) - */ -#define CCV(ccv, what) (ccv)->ccvc.tcp->what +#define CCV(ccv, what) (ccv)->tp->what #define DECLARE_CC_MODULE(ccname, ccalgo) \ static moduledata_t cc_##ccname = { \ diff --git a/sys/netinet/cc/cc_newreno.c b/sys/netinet/cc/cc_newreno.c index aa20e2c64f7d..56adb2d17601 100644 --- a/sys/netinet/cc/cc_newreno.c +++ b/sys/netinet/cc/cc_newreno.c @@ -135,7 +135,7 @@ newreno_log_hystart_event(struct cc_var *ccv, struct newreno *nreno, uint8_t mod if (hystart_bblogs == 0) return; - tp = ccv->ccvc.tcp; + tp = ccv->tp; if (tcp_bblogging_on(tp)) { union tcp_log_stackspecific log; struct timeval tv; @@ -175,7 +175,7 @@ newreno_cb_init(struct cc_var *ccv, void *ptr) { struct newreno *nreno; - INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp)); + INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); if (ptr == NULL) { ccv->cc_data = malloc(sizeof(struct newreno), M_CC_MEM, M_NOWAIT); if (ccv->cc_data == NULL) @@ -369,7 +369,7 @@ newreno_cong_signal(struct cc_var *ccv, ccsignal_t type) uint32_t beta, beta_ecn, cwin, factor, mss, pipe; cwin = CCV(ccv, snd_cwnd); - mss = tcp_fixed_maxseg(ccv->ccvc.tcp); + mss = tcp_fixed_maxseg(ccv->tp); nreno = ccv->cc_data; beta = (nreno == NULL) ? V_newreno_beta : nreno->beta;; beta_ecn = (nreno == NULL) ? V_newreno_beta_ecn : nreno->beta_ecn; @@ -429,7 +429,7 @@ newreno_cong_signal(struct cc_var *ccv, ccsignal_t type) case CC_RTO: if (CCV(ccv, t_rxtshift) == 1) { if (V_tcp_do_newsack) { - pipe = tcp_compute_pipe(ccv->ccvc.tcp); + pipe = tcp_compute_pipe(ccv->tp); } else { pipe = CCV(ccv, snd_max) - CCV(ccv, snd_fack) + @@ -456,7 +456,7 @@ newreno_ctl_output(struct cc_var *ccv, struct sockopt *sopt, void *buf) if (sopt->sopt_valsize != sizeof(struct cc_newreno_opts)) return (EMSGSIZE); - if (CC_ALGO(ccv->ccvc.tcp) != &newreno_cc_algo) + if (CC_ALGO(ccv->tp) != &newreno_cc_algo) return (ENOPROTOOPT); nreno = (struct newreno *)ccv->cc_data; diff --git a/sys/netinet/cc/cc_vegas.c b/sys/netinet/cc/cc_vegas.c index ecd42c1a0f53..45d6b646bcba 100644 --- a/sys/netinet/cc/cc_vegas.c +++ b/sys/netinet/cc/cc_vegas.c @@ -184,7 +184,7 @@ vegas_cb_init(struct cc_var *ccv, void *ptr) { struct vegas *vegas_data; - INP_WLOCK_ASSERT(tptoinpcb(ccv->ccvc.tcp)); + INP_WLOCK_ASSERT(tptoinpcb(ccv->tp)); if (ptr == NULL) { vegas_data = malloc(sizeof(struct vegas), M_CC_MEM, M_NOWAIT); if (vegas_data == NULL) diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 0665564955d2..cc9020f89a3a 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -2243,8 +2243,7 @@ tcp_newtcpcb(struct inpcb *inp, struct tcpcb *listening_tcb) bzero(&tp->t_start_zero, t_zero_size); /* Initialise cc_var struct for this tcpcb. */ - tp->t_ccv.type = IPPROTO_TCP; - tp->t_ccv.ccvc.tcp = tp; + tp->t_ccv.tp = tp; rw_rlock(&tcp_function_lock); if (listening_tcb != NULL) { INP_LOCK_ASSERT(tptoinpcb(listening_tcb)); diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index c43e4523f358..2ff7737a573b 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -1957,7 +1957,7 @@ no_mem_needed: tp = intotcpcb(inp); if (ptr != NULL) memset(ptr, 0, mem_sz); - cc_mem.ccvc.tcp = tp; + cc_mem.tp = tp; /* * We once again hold a write lock over the tcb so it's * safe to do these things without ordering concerns. From nobody Sun Jul 28 20:40:22 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXCzp3Jmcz5Rcs4; Sun, 28 Jul 2024 20:40: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXCzp2lNdz4FsB; Sun, 28 Jul 2024 20:40:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722199222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kCN5tybBpgQfLkM4/2PYHYFCM9F4pzgkNAdRJOTiXDM=; b=Oz57f/yQw4fn3GtOkZ0hMtc5x5KPhUa8Wbf+ih72+JM+WzMj2Y7dsPuMJUYEghnQ5QeUxj QlEBnoL1GXiuOqMUT5cL3CddpcLmlHD1KsFF8XFBBadzU16mcfdLi9HvIi/GMVD5Xft/bU PDzZaVYXFNpkjVuJCLGkYG0CsYSYaqbgdpXv0uZcDtb+c4pz6oNMersYIrF57okllFTFtr Rx+WUxykFQP3mhocd5obyDGAD/KadshPOjQ553uNR96iOYycEt12j+ZxAGVGUNqTojvGju tmzcxYVwXVNxWAi4AUHwjZ5SWCq+mYBvd5muyQfAZpguSScfjhDZ0L+4mKPG/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722199222; a=rsa-sha256; cv=none; b=M54VpKuu2QaWFYPS+VzvhxKk3gQA+Q8LAw5YQjy3BPUz3BUKB+xwYgsmTEIGKmcpJwd5DC ixb671h0nalag5zRCDUyX6GowwxyWLCukJQUYW7Ro7HctmvU54jkiGs37QN8K5AvKNDMBZ ZY6KzLbgf9kyvYyce1aReNko2gyehXb7mC4WI4xHXsKLMhBQptQ1j2A9k2MsVmoPh9XtVC DpEPtsqNy1Yn1Ju/yKPv8aicYiK5TY/1UPVTg3KedHhadlv/U+F04xLu82SDDqCUwJwZ1m tB/hmm5KibAvsQjQZaND8rLkPYcWG6urwX+ayN+EJZG0kcpsTPyFkqAkIs0LVQ== 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=1722199222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kCN5tybBpgQfLkM4/2PYHYFCM9F4pzgkNAdRJOTiXDM=; b=Yrw4NtrAeq9MTEHXi7OuZhIllbRXQuJt9ndJnenkRVzAAFCNt+UGJlKMVwPQbD3jx3fP1c f7SOiUh0PuCysaaGZht6TCv9596ppnU2tXfMsvRs6G3VpTizT6D5KeBWxTSZBLyk1lCPkX eJGq+8Y693RkDiAqGbjAxlocEhvp034d0XhrAm+ub2QlEQueF6Gdu/k6fkzldDNACvJfDS HrCOEqMIVKj/q19g6vaEoM7keezuoFgfxltYfa+wwbIauVgkXMfendALnlSJLPzAQE3L/9 dEuluH1ycwexUI0C4r8AZxnPzr4NiBqkp/cEREXoYluKy46RScpFbE3Tpjrgyg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXCzp2LnVz14g8; Sun, 28 Jul 2024 20:40:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SKeMTB076288; Sun, 28 Jul 2024 20:40:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SKeM4G076285; Sun, 28 Jul 2024 20:40:22 GMT (envelope-from git) Date: Sun, 28 Jul 2024 20:40:22 GMT Message-Id: <202407282040.46SKeM4G076285@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 4036380e0297 - main - tcp: vnetify sysctl variables ack_war_timewindow and ack_war_cnt List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4036380e029708f5d6ad7aa599ce1bba9d7c067b Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=4036380e029708f5d6ad7aa599ce1bba9d7c067b commit 4036380e029708f5d6ad7aa599ce1bba9d7c067b Author: Michael Tuexen AuthorDate: 2024-07-28 20:36:34 +0000 Commit: Michael Tuexen CommitDate: 2024-07-28 20:36:34 +0000 tcp: vnetify sysctl variables ack_war_timewindow and ack_war_cnt As suggested by glebius@. While there, improve the documentation. Reviewed by: Peter Lei, cc MFC after: 1 week Sponsored by: Netflix, Inc Differential Revision: https://reviews.freebsd.org/D46140 --- share/man/man4/tcp.4 | 20 +++++++++++++++++++- sys/netinet/tcp_stacks/rack.c | 2 +- sys/netinet/tcp_stacks/rack_bbr_common.c | 16 ++++++++-------- sys/netinet/tcp_subr.c | 24 +++++++++++------------- sys/netinet/tcp_var.h | 4 ++++ 5 files changed, 43 insertions(+), 23 deletions(-) diff --git a/share/man/man4/tcp.4 b/share/man/man4/tcp.4 index 3f5d87da0ffb..70356baa2145 100644 --- a/share/man/man4/tcp.4 +++ b/share/man/man4/tcp.4 @@ -31,7 +31,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd July 21, 2024 +.Dd July 28, 2024 .Dt TCP 4 .Os .Sh NAME @@ -432,6 +432,17 @@ branch of the MIB, which can also be read or modified with .Xr sysctl 8 . .Bl -tag -width ".Va v6pmtud_blackhole_mss" +.It Va ack_war_timewindow , ack_war_cnt +The challenge ACK throttling algorithm defined in RFC 5961 limits +the number of challenge ACKs sent per TCP connection to +.Va ack_war_cnt +during the time interval specified in milliseconds by +.Va ack_war_timewindow . +Setting +.Va ack_war_timewindow +or +.Va ack_war_cnt +to zero disables challenge ACK throttling. .It Va always_keepalive Assume that .Dv SO_KEEPALIVE @@ -1078,6 +1089,13 @@ when trying to use a TCP function block that is not available; .%T "The Addition of Explicit Congestion Notification (ECN) to IP" .%O "RFC 3168" .Re +.Rs +.%A "A. Ramaiah" +.%A "R. Stewart" +.%A "M. Dalal" +.%T "Improving TCP's Robustness to Blind In-Window Attacks" +.%O "RFC 5961" +.Re .Sh HISTORY The .Tn TCP diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 44ddfac2a6ca..ec0c6f500946 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -15547,7 +15547,7 @@ rack_init(struct tcpcb *tp, void **ptr) rack->r_ctl.rc_lower_rtt_us_cts = us_cts; rack->r_ctl.rc_time_of_last_probertt = us_cts; rack->r_ctl.rc_went_idle_time = us_cts; - rack->r_ctl.challenge_ack_ts = tcp_ts_getticks() - (tcp_ack_war_time_window + 1); + rack->r_ctl.challenge_ack_ts = tcp_ts_getticks() - (V_tcp_ack_war_time_window + 1); rack->r_ctl.rc_time_probertt_starts = 0; rack->r_ctl.gp_rnd_thresh = rack_rnd_cnt_req & 0xff; diff --git a/sys/netinet/tcp_stacks/rack_bbr_common.c b/sys/netinet/tcp_stacks/rack_bbr_common.c index 4a4a8af2bd78..b218f449475f 100644 --- a/sys/netinet/tcp_stacks/rack_bbr_common.c +++ b/sys/netinet/tcp_stacks/rack_bbr_common.c @@ -535,8 +535,8 @@ void ctf_ack_war_checks(struct tcpcb *tp, uint32_t *ts, uint32_t *cnt) { if ((ts != NULL) && (cnt != NULL) && - (tcp_ack_war_time_window > 0) && - (tcp_ack_war_cnt > 0)) { + (V_tcp_ack_war_time_window > 0) && + (V_tcp_ack_war_cnt > 0)) { /* We are possibly doing ack war prevention */ uint32_t cts; @@ -550,9 +550,9 @@ ctf_ack_war_checks(struct tcpcb *tp, uint32_t *ts, uint32_t *cnt) if (TSTMP_LT((*ts), cts)) { /* Timestamp is in the past */ *cnt = 0; - *ts = (cts + tcp_ack_war_time_window); + *ts = (cts + V_tcp_ack_war_time_window); } - if (*cnt < tcp_ack_war_cnt) { + if (*cnt < V_tcp_ack_war_cnt) { *cnt = (*cnt + 1); tp->t_flags |= TF_ACKNOW; } else @@ -772,8 +772,8 @@ __ctf_process_rst(struct mbuf *m, struct tcphdr *th, struct socket *so, KMOD_TCPSTAT_INC(tcps_badrst); if ((ts != NULL) && (cnt != NULL) && - (tcp_ack_war_time_window > 0) && - (tcp_ack_war_cnt > 0)) { + (V_tcp_ack_war_time_window > 0) && + (V_tcp_ack_war_cnt > 0)) { /* We are possibly preventing an ack-rst war prevention */ uint32_t cts; @@ -787,9 +787,9 @@ __ctf_process_rst(struct mbuf *m, struct tcphdr *th, struct socket *so, if (TSTMP_LT((*ts), cts)) { /* Timestamp is in the past */ *cnt = 0; - *ts = (cts + tcp_ack_war_time_window); + *ts = (cts + V_tcp_ack_war_time_window); } - if (*cnt < tcp_ack_war_cnt) { + if (*cnt < V_tcp_ack_war_cnt) { *cnt = (*cnt + 1); send_challenge = 1; } else diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index cc9020f89a3a..145496afa098 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -139,16 +139,14 @@ VNET_DEFINE(int, tcp_mssdflt) = TCP_MSS; VNET_DEFINE(int, tcp_v6mssdflt) = TCP6_MSS; #endif -uint32_t tcp_ack_war_time_window = 1000; +VNET_DEFINE(uint32_t, tcp_ack_war_time_window) = 1000; SYSCTL_UINT(_net_inet_tcp, OID_AUTO, ack_war_timewindow, - CTLFLAG_RW, - &tcp_ack_war_time_window, 1000, - "If the tcp_stack does ack-war prevention how many milliseconds are in its time window?"); -uint32_t tcp_ack_war_cnt = 5; -SYSCTL_UINT(_net_inet_tcp, OID_AUTO, ack_war_cnt, - CTLFLAG_RW, - &tcp_ack_war_cnt, 5, - "If the tcp_stack does ack-war prevention how many acks can be sent in its time window?"); + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(tcp_ack_war_time_window), 0, + "Time interval in ms used to limit the number (ack_war_cnt) of challenge ACKs sent per TCP connection"); +VNET_DEFINE(uint32_t, tcp_ack_war_cnt) = 5; +SYSCTL_UINT(_net_inet_tcp, OID_AUTO, ack_war_cnt, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(tcp_ack_war_cnt), 0, + "Maximum number of challenge ACKs sent per TCP connection during the time interval (ack_war_timewindow)"); struct rwlock tcp_function_lock; @@ -2183,7 +2181,7 @@ tcp_respond(struct tcpcb *tp, void *ipgen, struct tcphdr *th, struct mbuf *m, /* * Send a challenge ack (no data, no SACK option), but not more than - * tcp_ack_war_cnt per tcp_ack_war_time_window (per TCP connection). + * V_tcp_ack_war_cnt per V_tcp_ack_war_time_window (per TCP connection). */ void tcp_send_challenge_ack(struct tcpcb *tp, struct tcphdr *th, struct mbuf *m) @@ -2191,7 +2189,7 @@ tcp_send_challenge_ack(struct tcpcb *tp, struct tcphdr *th, struct mbuf *m) sbintime_t now; bool send_challenge_ack; - if (tcp_ack_war_time_window == 0 || tcp_ack_war_cnt == 0) { + if (V_tcp_ack_war_time_window == 0 || V_tcp_ack_war_cnt == 0) { /* ACK war protection is disabled. */ send_challenge_ack = true; } else { @@ -2200,13 +2198,13 @@ tcp_send_challenge_ack(struct tcpcb *tp, struct tcphdr *th, struct mbuf *m) if (tp->t_challenge_ack_end < now) { tp->t_challenge_ack_cnt = 0; tp->t_challenge_ack_end = now + - tcp_ack_war_time_window * SBT_1MS; + V_tcp_ack_war_time_window * SBT_1MS; } /* * Send a challenge ACK, if less than tcp_ack_war_cnt have been * sent in the current epoch. */ - if (tp->t_challenge_ack_cnt < tcp_ack_war_cnt) { + if (tp->t_challenge_ack_cnt < V_tcp_ack_war_cnt) { send_challenge_ack = true; tp->t_challenge_ack_cnt++; } else { diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index af82d0bfeaaa..cc982e321709 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1268,6 +1268,8 @@ VNET_DECLARE(int, tcp_log_in_vain); VNET_DECLARE(int, drop_synfin); VNET_DECLARE(int, path_mtu_discovery); VNET_DECLARE(int, tcp_abc_l_var); +VNET_DECLARE(uint32_t, tcp_ack_war_cnt); +VNET_DECLARE(uint32_t, tcp_ack_war_time_window); VNET_DECLARE(int, tcp_autorcvbuf_max); VNET_DECLARE(int, tcp_autosndbuf_inc); VNET_DECLARE(int, tcp_autosndbuf_max); @@ -1319,6 +1321,8 @@ VNET_DECLARE(struct inpcbinfo, tcbinfo); #define V_path_mtu_discovery VNET(path_mtu_discovery) #define V_tcbinfo VNET(tcbinfo) #define V_tcp_abc_l_var VNET(tcp_abc_l_var) +#define V_tcp_ack_war_cnt VNET(tcp_ack_war_cnt) +#define V_tcp_ack_war_time_window VNET(tcp_ack_war_time_window) #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) #define V_tcp_autosndbuf_inc VNET(tcp_autosndbuf_inc) #define V_tcp_autosndbuf_max VNET(tcp_autosndbuf_max) From nobody Sun Jul 28 21:38:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXFGX6pYRz5RkRH; Sun, 28 Jul 2024 21:38: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXFGX4sDLz4RdG; Sun, 28 Jul 2024 21:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722202692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JLWQkKG4FAdXo5nisnNlkHRy6UHaxpCWZFPaM81AvpI=; b=o64flHLwwXe1jhH30/6iFuFdwHhXr6yC0C94lit+uiVjTC7Vn4Mv4nr1gRyQZjJ0LZzC4D 2T6+EG2HvriYt+JYcx+7nQwJWUoFt4411ElFVho863nnbR0pdVlZGiNyGxd3ZzqkJ9Wxnw GKeztY4vLuXvGSXnMWLWt7f3ETJnN53P4Ty7bB/BObKARoXVzB5E0H6s+RtxnTAABlzVcy FTF33kH2dr6KCglk5dWpIef+GjF8eaMTEZTqOf1uTqYVCEa459fvC5Zo/BTbn+V+G5znFf bL4EtP9f6q/3XQ+wj6wyC9FNHfvOhNaEY0ooE4phsZmR6xNTFLLRFvFjactL4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722202692; a=rsa-sha256; cv=none; b=bsSMDO3PAan5WP9LXZjUFt7HtP/X2xvnGP2J8y9Q9pAa4yOF1CnlvdPAKyyQmzT/0KK/vE DnbMHAsz5CgXiscs4axWD92ExrkbShJu0eG+OPAdmJRFmDmJCAkmiZaWTZY6507s+Ep42F iFmilBf/3Z3/PaJVMBqOMYka1OTTKxciBLGDh4ajFu6uyeSxxhENThgWRSRyggAY4v1tn7 a1pK8N5vhpy17p9vyOq+wi/vQL6U+BAWYAOBlHcvNpbNk4CiQcOgSt7f2YzytY7h4DWRFH 9PJUZEi08nBZvy2xg6kr30tOhwl9Nd3Uuf1sk82oTAEgG6ZeOY81U2AMTYfInQ== 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=1722202692; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JLWQkKG4FAdXo5nisnNlkHRy6UHaxpCWZFPaM81AvpI=; b=r1Sh0gkq7cEa7cLUcnx6TtgeIYpv+cV2o5MJzh5WXJojgHBIsOiJq+a6pS9kqk6OMFQCIF EtYh+xk23XSu7Xuyx2WjgfL6B/vVEh8vZxZgJ+aSnE6ok7lbg9XVXi4skreDP6EvTU0+8H COLyzQnN2WMVbWyRvIwosgvvD6tsEOhFSQF0UTQvUW1toddqEewwEYVL2Y9CbB1Z437I5H Z/KXTCc9r0EMRJI/I7KrLcSYndAa/kE5c6WzeWverJPNd+H1B0ZAseP5fWes5LxL7slWM1 RdBVcJDUVuxy3RQGDgqFotrXqcRjgvaFxK6p8ll60SWNBuTat0Ui5ctxq+ffzQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXFGX4ScWz16vF; Sun, 28 Jul 2024 21:38:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SLcCkG069582; Sun, 28 Jul 2024 21:38:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SLcCkF069579; Sun, 28 Jul 2024 21:38:12 GMT (envelope-from git) Date: Sun, 28 Jul 2024 21:38:12 GMT Message-Id: <202407282138.46SLcCkF069579@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 34f746cc7f8a - main - libm: fma: correct zero sign with small inputs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 34f746cc7f8a8dd261027a8b392b76e70adc8438 Auto-Submitted: auto-generated The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=34f746cc7f8a8dd261027a8b392b76e70adc8438 commit 34f746cc7f8a8dd261027a8b392b76e70adc8438 Author: Steve Kargl AuthorDate: 2024-06-16 23:41:38 +0000 Commit: Ed Maste CommitDate: 2024-07-28 21:37:45 +0000 libm: fma: correct zero sign with small inputs This is a fixed version of 888796ade284. PR: 277783 Reported by: Victor Stinner Reviewed by: emaste MFC after: 1 week --- lib/msun/src/s_fma.c | 4 ++-- lib/msun/src/s_fmal.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/msun/src/s_fma.c b/lib/msun/src/s_fma.c index 6c889a6a46ca..23a84491dd2a 100644 --- a/lib/msun/src/s_fma.c +++ b/lib/msun/src/s_fma.c @@ -260,14 +260,14 @@ fma(double x, double y, double z) spread = ex + ey; - if (r.hi == 0.0) { + if (r.hi == 0.0 && xy.lo == 0) { /* * When the addends cancel to 0, ensure that the result has * the correct sign. */ fesetround(oround); volatile double vzs = zs; /* XXX gcc CSE bug workaround */ - return (xy.hi + vzs + ldexp(xy.lo, spread)); + return (xy.hi + vzs); } if (oround != FE_TONEAREST) { diff --git a/lib/msun/src/s_fmal.c b/lib/msun/src/s_fmal.c index 80c835d09c2b..2fca20610157 100644 --- a/lib/msun/src/s_fmal.c +++ b/lib/msun/src/s_fmal.c @@ -241,14 +241,14 @@ fmal(long double x, long double y, long double z) spread = ex + ey; - if (r.hi == 0.0) { + if (r.hi == 0.0 && xy.lo == 0) { /* * When the addends cancel to 0, ensure that the result has * the correct sign. */ fesetround(oround); volatile long double vzs = zs; /* XXX gcc CSE bug workaround */ - return (xy.hi + vzs + ldexpl(xy.lo, spread)); + return (xy.hi + vzs); } if (oround != FE_TONEAREST) { From nobody Sun Jul 28 21:41:56 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WXFLr5hM1z5RkV1; Sun, 28 Jul 2024 21:41: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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WXFLr5G2Xz4SQL; Sun, 28 Jul 2024 21:41:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1722202916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/tf8bi37oXx7xq6PyMvV9b9iK4nhFuUIw0p8zmY2LaU=; b=SVUDX1a/ege0NL55UuO9PiYNzybACUDqSFVcfB83LXPxvkEp0gIQPlinPoy7PcZPlIW8lV d8OYXgIzVhKtTceV4mdmPdgRKkhJgcNGGdNOnsMg57jpTiNDPKFkw5vWxsbnpnEeSYz2a2 El0swfSzu2Kq31J/TSxd1+7rVGLf4PSe8/5hB6Cqjb7VIu3S0jELvze8LIR9ncWlkH8Xjr Ic1o67kEwEve+wBcETuOMxF7kTNMk7EBgKXQvsE+euNqactyrpRdiwi+39J+915jYSGW9V gMvLwbzHMxnt2iha/Gn+XCZt64C9wrT0QYBJbd7QTnQfx7Msg3qq5kwoj2j18A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1722202916; a=rsa-sha256; cv=none; b=wGDWRVuV6PlSOBXPUB9xSovheNVsfFbjhs78lR9WI+Zc2XMgmC5Tn3pQXAWX2Mawn/ksuR x57rWbLe6rio70Wgca7kJW5Glz1a6MjXzk/Kphdv0zAk8zQevq8ePkJtNoByFDh6RuoqHT YaBNFzEOBHNcQ4e9ApAQHMDTaR68KtSs3KaedTdo+SCaO96hcAyjpvzy8xni1sMjT/iHF6 NGoNEkaiatdYoPu4NVV0ewNQW+cA1IjMogi78eZAMPNabf/W1xag9rwPtSwOV4M3RDAwHB AfWZA+9jdgfxU9SctCMcIa6bKQXjadMBdgoK7UvTYASLOwDUrO+CRiDcxkrQ8A== 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=1722202916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/tf8bi37oXx7xq6PyMvV9b9iK4nhFuUIw0p8zmY2LaU=; b=XdsytuQwrD1DgpazJpZRKQXv/k1NvSSjyAesbP5XhiiWYy0LBUk5XoVQlqFWIJLe3xTMN2 sq6w29p8ch/kRJ7mDsi0nZ9NMX9T3pTwBRDvpZ60pFuEk87co5mEXNG2QMd1cb0rf9v5gC i6yN5zYmA7DYRLOq3Dn7S7mpfAJhDsiub8UQ/bvSByCPwqeVLAOPVcn3exa3vSwykX/V06 I2hetJA6EZz/fn5VhQLiYutvVxMfyswtZcF/8unwYAV1IBgX64m4QBpIcg0N+C93GrXeVJ a7n9tKWVAMSLrx9AnB681xccvkMaA85eMdaV06Irgu6aviCo60JnMNwg6uLPWw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WXFLr4tBNz16JQ; Sun, 28 Jul 2024 21:41:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46SLfuBr083128; Sun, 28 Jul 2024 21:41:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46SLfuuZ083113; Sun, 28 Jul 2024 21:41:56 GMT (envelope-from git) Date: Sun, 28 Jul 2024 21:41:56 GMT Message-Id: <202407282141.46SLfuuZ083113@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 71867653008c - main - udp: improve handling of cached route List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 71867653008ce17a66a9c935e9dc29c1320bf48b Auto-Submitted: auto-generated The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=71867653008ce17a66a9c935e9dc29c1320bf48b commit 71867653008ce17a66a9c935e9dc29c1320bf48b Author: Michael Tuexen AuthorDate: 2024-07-28 21:25:22 +0000 Commit: Michael Tuexen CommitDate: 2024-07-28 21:36:48 +0000 udp: improve handling of cached route The inp_route pointer should only be provided to the network layer, when no destination address is provided. This is only one of the conditions, where a write lock is needed. If, for example, the route is also cached, when the socket is unbound, problems show up, when the sendto is called, then connect and finally send, when the route for the addresses provided in the sendto and connect call use different outgoing interfaces. While there, clearly document why the write lock is taken. Reported by: syzbot+59122d2e848087d3355a@syzkaller.appspotmail.com Reviewed by: Peter Lei, glebius MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D46056 --- sys/netinet/udp_usrreq.c | 20 ++++++++++++-------- sys/netinet6/udp6_usrreq.c | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 9dad79e95b04..1666d4bd3142 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1087,7 +1087,6 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, uint16_t cscov = 0; uint32_t flowid = 0; uint8_t flowtype = M_HASHTYPE_NONE; - bool use_cached_route; inp = sotoinpcb(so); KASSERT(inp != NULL, ("udp_send: inp == NULL")); @@ -1116,16 +1115,21 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, sin = (struct sockaddr_in *)addr; /* - * udp_send() may need to temporarily bind or connect the current - * inpcb. As such, we don't know up front whether we will need the - * pcbinfo lock or not. Do any work to decide what is needed up - * front before acquiring any locks. + * In the following cases we want a write lock on the inp for either + * local operations or for possible route cache updates in the IPv6 + * output path: + * - on connected sockets (sin6 is NULL) for route cache updates, + * - when we are not bound to an address and source port (it is + * in_pcbinshash() which will require the write lock). + * - when we are using a mapped address on an IPv6 socket (for + * updating inp_vflag). * * We will need network epoch in either case, to safely lookup into * pcb hash. */ - use_cached_route = sin == NULL || (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0); - if (use_cached_route || (flags & PRUS_IPV6) != 0) + if (sin == NULL || + (inp->inp_laddr.s_addr == INADDR_ANY && inp->inp_lport == 0) || + (flags & PRUS_IPV6) != 0) INP_WLOCK(inp); else INP_RLOCK(inp); @@ -1476,7 +1480,7 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, else UDP_PROBE(send, NULL, inp, &ui->ui_i, inp, &ui->ui_u); error = ip_output(m, inp->inp_options, - use_cached_route ? &inp->inp_route : NULL, ipflags, + sin == NULL ? &inp->inp_route : NULL, ipflags, inp->inp_moptions, inp); INP_UNLOCK(inp); NET_EPOCH_EXIT(et); diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 414be35b5bef..d7d85c6b3d13 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -937,7 +937,7 @@ udp6_send(struct socket *so, int flags_arg, struct mbuf *m, else UDP_PROBE(send, NULL, inp, ip6, inp, udp6); error = ip6_output(m, optp, - INP_WLOCKED(inp) ? &inp->inp_route6 : NULL, flags, + sin6 == NULL ? &inp->inp_route6 : NULL, flags, inp->in6p_moptions, NULL, inp); INP_UNLOCK(inp); NET_EPOCH_EXIT(et);