From nobody Mon Jul 8 11:32:52 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WHhnK0zQ4z5Pyjr; Mon, 08 Jul 2024 11:32:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WHhnK0S7Tz4WsK; Mon, 8 Jul 2024 11:32:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720438373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D0qhoSQDfI/lv1KrkjMz5ApT4hh283oLXPTebLSX3eg=; b=g0Jt3Xk+JkBRpVgT3/pk3/4Z6DS7MSSK/J8guel26tzuX5e0F/IyRS/fGVa8K9Uro+YuJo A/yY3JvBUseSglMPz+QhcAwtb8STZHjiif7qq3WiFufaGqOa1AzQ0zNgT4VYImPA15nhpT 04H4UJs5BW+NvE/xT0lz6V+vK1WLdvO3W5absCWyxm3E6wJKIpJoQ7qWi6bpq55/0coN+o AezsMnjcQW5FmmQ9bse+IcPHGt0EZVUgdOls5a7MK5xDYfj1RMgIRXuV8W/syeEc3HG0s5 3bXBQvi52hbGik8FQmsVhJ4emV+dojatNP5EJ7AG2AmJj2xtKvzGkXxdNBht0A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720438373; a=rsa-sha256; cv=none; b=U/y4h/o5Wjgx09cvkExANdqukUcE3uIqHjtFLuGuLz4CzilIMkIFpJxEhlhA6xdlFKGxSe 09Ct9fP1OD2ZWye1O3nNGClZlIU9arYA4gJU8J1DG/TyjaBWFyCk9yBvw7BnEUqCKdHzsV wByi3rzcWr8cWK1Z+lwYB++9AmAwaBOR4sOnMc/U8VBixCUqFyOrRMh6i4AF6rCc96B6Wl qBl85iRBVjwe7RxmJ6Ix2KzcWuSF0/f4SvmLwe7lbCVwD6vXOMBfbKVa/GnD3oXx0FKop9 Z6GAyXniYcQNwMrBUV7SEnuUCeHioXIdLi2mFIHjRiaw8G7jh9Yt6hwCAl25jQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720438373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=D0qhoSQDfI/lv1KrkjMz5ApT4hh283oLXPTebLSX3eg=; b=I3HLZ5KIoO8K9dihYXFTrrR1DzCVC7PEkLaVHZRfh+dyl8lH/5lLYYwPamS7KkWxm0lKHE s9f8Gs835DVeto3O+qvCSJ4Oa7O97U255WiCKE8eDCIhC6JzvcYjQcLQmdQP9iKxepRPf4 zmYwyaixVWKOLf7ZSxagjBpGUbsZJFcCc+WalRt1r8BNQgIrT+O2+4awkV3aEv8VYbN86M p5e0NrrXUiW1qP2qITVaDcMxcQN5VOiTmvH4VNVLe/InCUP2GX8c+nV0MPxSnHzBeihiSv yktyHuj7/rNLXXRQ/H9JJzju5R2fnKI5qV0XSWUMlx+0PVb6HEMNug7uvxF0Jg== 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 4WHhnK03Z1zq4t; Mon, 8 Jul 2024 11:32: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 468BWqXS006544; Mon, 8 Jul 2024 11:32:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 468BWq2F006541; Mon, 8 Jul 2024 11:32:52 GMT (envelope-from git) Date: Mon, 8 Jul 2024 11:32:52 GMT Message-Id: <202407081132.468BWq2F006541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: a8790965b0c6 - stable/14 - ifnet: Remove dead code List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a8790965b0c6b63ec64c42f236cd09cef06f481c Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a8790965b0c6b63ec64c42f236cd09cef06f481c commit a8790965b0c6b63ec64c42f236cd09cef06f481c Author: Zhenlei Huang AuthorDate: 2024-06-30 09:44:21 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-08 11:30:57 +0000 ifnet: Remove dead code Since change [1], if_bpf will not be detached by the interface departure eventhandler and will not be NULL. Then the logic to re-attach if_bpf becomes dead and serves no purpose any more. This partially reverts commit 05fc416403ec. 1. 9ce40d321dd5 bpf: Fix incorrect cleanup Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45599 (cherry picked from commit 9738277b5c662a75347efa6a58daea485d30f895) --- sys/net/if.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index b38784622e92..110ab73f2aad 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1267,20 +1267,8 @@ finish_vnet_shutdown: static int if_vmove(struct ifnet *ifp, struct vnet *new_vnet) { -#ifdef DEV_BPF - u_int bif_dlt, bif_hdrlen; -#endif int rc; -#ifdef DEV_BPF - /* - * if_detach_internal() will call the eventhandler to notify - * interface departure. That will detach if_bpf. We need to - * safe the dlt and hdrlen so we can re-attach it later. - */ - bpf_get_bp_params(ifp->if_bpf, &bif_dlt, &bif_hdrlen); -#endif - /* * Detach from current vnet, but preserve LLADDR info, do not * mark as dead etc. so that the ifnet can be reattached later. @@ -1302,12 +1290,6 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) */ CURVNET_SET_QUIET(new_vnet); if_attach_internal(ifp, true); - -#ifdef DEV_BPF - if (ifp->if_bpf == NULL) - bpfattach(ifp, bif_dlt, bif_hdrlen); -#endif - CURVNET_RESTORE(); return (0); } From nobody Mon Jul 8 11:41:56 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WHhzm2d7Nz5Q0yf; Mon, 08 Jul 2024 11: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 4WHhzm26W6z4XL2; Mon, 8 Jul 2024 11: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=1720438916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zuLj6E/dDnA/fSCHvdnPt/k0kQvMzs4ijCvErbON53E=; b=fxRj8tANYY5zCufzcfgzVQokp0ljlW9eOd2GGChCfhv+WwZ+21U5sYfqIts+H++3cvEhQG m1iytpA1CLmc58UuPG9CQAsOA8Pbf7/7LxhA5/hXtw/59+G914bMadMQOGp6yQ2bMAl4TB U9lKSgFXI8GIoi/AkLqW3uWAcT2cIn5+Lw6HujexEDh1VbRjrdDZWuUr5lR0jUjguJMOsv swOasXEz3SRMl2zTF0AsoIp8aUFuoUda1rmJkzq+HjjM6qGnQ7YSHNex7N8gJZeM/PVBCU 9tZFc+76iNv8O5YJ4sutEnN17QdWPM2mZIMAfDrob5cZhuznid0Y9iOK1RIjuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720438916; a=rsa-sha256; cv=none; b=tWC+VGdLqSacgXzmHMWVHQoqcCTcVo0sYFReanne3cJnAFOZ6zabVJ5MtYz89DxGwezNaX oqhaaHqp2/hh6LZIHAwQzgvCG++LW7tjNxxCkEn3QAN8PRjcgRrbRXknbxkuz/SKN6bSkP nOdRCDNbfofgEp6sqIPECejN1GbiNc+dDna1xStRTrWujKSfDsJFdIimZdJY4N4PoBYZfJ U/oZqJdwaTVElVPiPpDKD+v+KEiolQe8uenuAaAw8a9iRsDd3YyNnh7l7fkb6WShelxzZt YjNjuu6R/bJnWXVJJJ7EI6jyF7FI7WrH84IJcnmS48XkCPfRmZ8l5EQMXWLluQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720438916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zuLj6E/dDnA/fSCHvdnPt/k0kQvMzs4ijCvErbON53E=; b=wVgRHW8+hRTs91HMxR42gyjP0NkdWqz+lHhcygXci+F4gHtRPNvMTE89R6LwbN7WVuVh5n Trxk5gZe/gdhl0TGBQEvqpYXaQRLoLT1AePivyJJ7DbRqKEBVl6dG23z9DOk7ZFXGJjU2/ CVNnwU3Hj/ODesAhUt1NXO5UoY1zbyJskZjO+Uqc0xMmITiE+ijNzQVOgKWbDepSNKQ+X8 4j5GUM9oE6tg+lpigq3zBGGjaeoYTn7qQ7DpKa8C5cpPt+/gX8G/DL8x+zZw7GIWJh62ut zwMuroMjrESWJ+Heppr726S3S856bGALDFid2C6yMVS36pvM4nYaTleW3UgWcg== 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 4WHhzm1k0NzqPv; Mon, 8 Jul 2024 11: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 468Bfuub017462; Mon, 8 Jul 2024 11: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 468Bfumm017459; Mon, 8 Jul 2024 11:41:56 GMT (envelope-from git) Date: Mon, 8 Jul 2024 11:41:56 GMT Message-Id: <202407081141.468Bfumm017459@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 82c1ab4413e0 - stable/13 - ifnet: Remove dead code List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 82c1ab4413e090f35870d471c97109299ad62fa8 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=82c1ab4413e090f35870d471c97109299ad62fa8 commit 82c1ab4413e090f35870d471c97109299ad62fa8 Author: Zhenlei Huang AuthorDate: 2024-06-30 09:44:21 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-08 11:36:30 +0000 ifnet: Remove dead code Since change [1], if_bpf will not be detached by the interface departure eventhandler and will not be NULL. Then the logic to re-attach if_bpf becomes dead and serves no purpose any more. This partially reverts commit 05fc416403ec. 1. 9ce40d321dd5 bpf: Fix incorrect cleanup Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45599 (cherry picked from commit 9738277b5c662a75347efa6a58daea485d30f895) (cherry picked from commit a8790965b0c6b63ec64c42f236cd09cef06f481c) --- sys/net/if.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index e457ce5c4705..a7aed084143c 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1314,21 +1314,9 @@ static int if_vmove(struct ifnet *ifp, struct vnet *new_vnet) { struct if_clone *ifc; -#ifdef DEV_BPF - u_int bif_dlt, bif_hdrlen; -#endif void *old; int rc; -#ifdef DEV_BPF - /* - * if_detach_internal() will call the eventhandler to notify - * interface departure. That will detach if_bpf. We need to - * safe the dlt and hdrlen so we can re-attach it later. - */ - bpf_get_bp_params(ifp->if_bpf, &bif_dlt, &bif_hdrlen); -#endif - /* * Detach from current vnet, but preserve LLADDR info, do not * mark as dead etc. so that the ifnet can be reattached later. @@ -1374,11 +1362,6 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) if_attach_internal(ifp, 1, ifc); -#ifdef DEV_BPF - if (ifp->if_bpf == NULL) - bpfattach(ifp, bif_dlt, bif_hdrlen); -#endif - CURVNET_RESTORE(); return (0); } From nobody Mon Jul 8 20:26:45 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WHwdK3VnYz5QYQL; Mon, 08 Jul 2024 20:26: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 4WHwdK2s7xz4gkw; Mon, 8 Jul 2024 20:26:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720470405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KY+us2JIz2AgdxAHg9N6WNJHUzkmpt/7S5iWQ3nEhwQ=; b=oyDyVJQvLjNXhEJI6v0q1Z+RyVQOeadD2ewe7dljlTQxix4PGMtRqeYDujxkpSRmzzttd5 UcopZSk2cCY+DgpD5xjQ52K5pCT2LYxTQzEt7Wlcsnb4snOyVe0nC0s3klCJjsZLOIcKjY B57UegVCLzDMB/BtWxYxGXuFCZlAiTYEhOh/WcuAfhGYbYu6MZ0UWuVDNmRFBxD0pV7fQH 2c1br2+rBM2Uc/bVCg+nCMCn4noqhE8lbwyeqvRnIVJblXFE5RF0iVhy4eR3IqUgpW7Z+6 2HUlW2RD0lt05Fa+QYc3i5C3EHGLoJlhCL6oMEtzoaVw1wjFNsctrZ4BNPBZ+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720470405; a=rsa-sha256; cv=none; b=jYSVlO1axN4Xw1xGt9kyjDa0FhGFzvgUk/PaMhh5ZZ/lVhMn19pHMg+jeQXPpQr+wx0QL6 kHy8tzLWrGl0lbdJnxWb+6PO6oWZmcX35jGpyX2q2tdVcJ4lk5J90xHttYPPze7h4N2bnm EpzUpKt26VgzO8Kx69UUFgcDMZJJ7aLF9LxZrl5QFgTIg03SbfTqFqJpR+O1UiSaeGMBnD I0wAbqpW1uMt8PS7vj9U/UxCVgfUY7cGI7T1igcJ3cy5KWIEZbs6fpne3NbsCLhBDDR9eD 8F3cvYK+wHiO/cX8lqwABL2cki+AyF//g1/Rxb55YaIOVwADQZ5MYUwpn1yJtw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720470405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KY+us2JIz2AgdxAHg9N6WNJHUzkmpt/7S5iWQ3nEhwQ=; b=wILvrYZHktMDKYE/TA+a7VIY02/+HSJ7sb1ZRNjEkn4ElYCWATs4PwxVLKcXlbcW6vWy9y r3t5ubVRA0XkGnXhPv+mQ2NeyjJZVWmM5uI/bUsycG3T01I7DWEN7T92KoM7Q/uLxnAOoz MGaM96k4LQaS3WSvLxNNQ/GSQwspxGMeJ4yrkiiuomC160BulE4PssnevK6OM1xpYi2mL5 kkVaJOPlZlawExrNAhWH5PQFWBzVVdx98Esmlq2hUNFyAFHJt573881ckotRtPSm5jP4rn UV63R2O+dwpL2rbYZLAuaygnTn0ZjxDUbBxhkHT2ndW9hYfxCADWT6C+P+fTOg== 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 4WHwdK2LmHz15PN; Mon, 8 Jul 2024 20:26: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 468KQjNf012087; Mon, 8 Jul 2024 20:26:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 468KQjqc012083; Mon, 8 Jul 2024 20:26:45 GMT (envelope-from git) Date: Mon, 8 Jul 2024 20:26:45 GMT Message-Id: <202407082026.468KQjqc012083@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: c1a5da044c6e - stable/13 - targ: fix compiling the example List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c1a5da044c6e692250bc5eddcb99c6e9f1ab4b78 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=c1a5da044c6e692250bc5eddcb99c6e9f1ab4b78 commit c1a5da044c6e692250bc5eddcb99c6e9f1ab4b78 Author: Alan Somers AuthorDate: 2024-06-19 00:17:31 +0000 Commit: Alan Somers CommitDate: 2024-07-08 20:26:04 +0000 targ: fix compiling the example The targ example program doesn't compile with current clang, and probably hasn't for multiple releases. Fix the build. I don't have the right hardware to test it, though. Sponsored by: Axcient (cherry picked from commit 873881b7dbb72077f3723f49a9f10a432231c532) --- share/examples/scsi_target/Makefile | 6 +++++- share/examples/scsi_target/scsi_cmds.c | 6 +----- share/examples/scsi_target/scsi_target.c | 32 ++++++++++++++++++-------------- share/examples/scsi_target/scsi_target.h | 6 +++++- 4 files changed, 29 insertions(+), 21 deletions(-) diff --git a/share/examples/scsi_target/Makefile b/share/examples/scsi_target/Makefile index 39950b8c0ac1..1e2c076591bf 100644 --- a/share/examples/scsi_target/Makefile +++ b/share/examples/scsi_target/Makefile @@ -4,7 +4,11 @@ FILESDIR=${SHAREDIR}/examples/${PROG} PROG= scsi_target SRCS= scsi_target.h scsi_target.c scsi_cmds.c DPADD= ${LIBCAM} ${LIBSBUF} -LDADD= -lcam -lsbuf +LIBADD+= cam +LIBADD+= sbuf +# cast-qual is triggered only in a code path where the volatile keyword doesn't +# matter +CFLAGS.scsi_cmds.c= -Wno-cast-qual MAN= scsi_target.8 diff --git a/share/examples/scsi_target/scsi_cmds.c b/share/examples/scsi_target/scsi_cmds.c index 43217a562aba..122d4dec6287 100644 --- a/share/examples/scsi_target/scsi_cmds.c +++ b/share/examples/scsi_target/scsi_cmds.c @@ -102,10 +102,6 @@ static struct targ_cdb_handlers cdb_handlers[] = { static struct scsi_inquiry_data inq_data; static struct initiator_state istates[MAX_INITIATORS]; -extern int debug; -extern off_t volume_size; -extern u_int sector_size; -extern size_t buf_size; cam_status tcmd_init(u_int16_t req_inq_flags, u_int16_t sim_inq_flags) @@ -553,7 +549,7 @@ tcmd_rdwr_decode(struct ccb_accept_tio *atio, struct ccb_scsiio *ctio) tcmd_illegal_req(atio, ctio); return (0); } - if (blkno + count > volume_size) { + if (((off_t)(blkno + count)) > volume_size) { warnx("Attempt to access past end of volume"); tcmd_sense(ctio->init_id, ctio, SSD_KEY_ILLEGAL_REQUEST, 0x21, 0); diff --git a/share/examples/scsi_target/scsi_target.c b/share/examples/scsi_target/scsi_target.c index b8f3ed6a8a81..ee0a94e7a2a0 100644 --- a/share/examples/scsi_target/scsi_target.c +++ b/share/examples/scsi_target/scsi_target.c @@ -77,7 +77,9 @@ static struct ccb_queue work_queue; static struct ioc_enable_lun ioc_enlun = { CAM_BUS_WILDCARD, CAM_TARGET_WILDCARD, - CAM_LUN_WILDCARD + CAM_LUN_WILDCARD, + 0, + 0 }; /* Local functions */ @@ -208,7 +210,7 @@ main(int argc, char *argv[]) if (argc != 2) usage(); - sscanf(argv[0], "%u:%u:%u", &ioc_enlun.path_id, &ioc_enlun.target_id, + sscanf(argv[0], "%u:%u:%ju", &ioc_enlun.path_id, &ioc_enlun.target_id, &ioc_enlun.lun_id); file_name = argv[1]; @@ -258,10 +260,12 @@ main(int argc, char *argv[]) if (notaio == 0) { struct aiocb aio, *aiop; + void *aio_buf; /* See if we have we have working AIO support */ memset(&aio, 0, sizeof(aio)); - aio.aio_buf = malloc(sector_size); + aio_buf = malloc(sector_size); + aio.aio_buf = aio_buf; if (aio.aio_buf == NULL) err(1, "malloc"); aio.aio_fildes = file_fd; @@ -278,7 +282,7 @@ main(int argc, char *argv[]) assert(aiop == &aio); signal(SIGSYS, SIG_DFL); } - free((void *)aio.aio_buf); + free(aio_buf); if (debug && notaio == 0) warnx("aio support tested ok"); } @@ -331,7 +335,7 @@ main(int argc, char *argv[]) } static void -cleanup() +cleanup(void) { struct ccb_hdr *ccb_h; @@ -358,7 +362,7 @@ cleanup() /* Allocate ATIOs/INOTs and queue on HBA */ static int -init_ccbs() +init_ccbs(void) { int i; @@ -395,7 +399,7 @@ init_ccbs() } static void -request_loop() +request_loop(void) { struct kevent events[MAX_EVENTS]; struct timespec ts, *tptr; @@ -535,10 +539,10 @@ request_loop() /* CCBs are ready from the kernel */ static void -handle_read() +handle_read(void) { union ccb *ccb_array[MAX_INITIATORS], *ccb; - int ccb_count, i, oo; + int ccb_count, i; ccb_count = read(targ_fd, ccb_array, sizeof(ccb_array)); if (ccb_count <= 0) { @@ -590,7 +594,7 @@ handle_read() /* Queue on the appropriate ATIO */ queue_io(ctio); /* Process any queued completions. */ - oo += run_queue(c_descr->atio); + run_queue(c_descr->atio); break; } case XPT_IMMEDIATE_NOTIFY: @@ -840,7 +844,7 @@ send_ccb(union ccb *ccb, int priority) /* Return a CTIO/descr/buf combo from the freelist or malloc one */ static struct ccb_scsiio * -get_ctio() +get_ctio(void) { struct ccb_scsiio *ctio; struct ctio_descr *c_descr; @@ -938,7 +942,7 @@ get_sim_flags(u_int16_t *flags) } static void -rel_simq() +rel_simq(void) { struct ccb_relsim crs; @@ -953,7 +957,7 @@ rel_simq() /* Cancel all pending CCBs. */ static void -abort_all_pending() +abort_all_pending(void) { struct ccb_abort cab; struct ccb_hdr *ccb_h; @@ -976,7 +980,7 @@ abort_all_pending() } static void -usage() +usage(void) { fprintf(stderr, "Usage: scsi_target [-AdSTY] [-b bufsize] [-c sectorsize]\n" diff --git a/share/examples/scsi_target/scsi_target.h b/share/examples/scsi_target/scsi_target.h index a873c050b7c6..57b6696d2e77 100644 --- a/share/examples/scsi_target/scsi_target.h +++ b/share/examples/scsi_target/scsi_target.h @@ -115,7 +115,11 @@ extern void free_ccb(union ccb *ccb); static __inline u_int min(u_int a, u_int b) { return (a < b ? a : b); } /* Global Data */ -extern int notaio; +extern int notaio; +extern int debug; +extern off_t volume_size; +extern u_int sector_size; +extern size_t buf_size; /* * Compat Defines From nobody Tue Jul 9 00:03:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WJ1Qy3ZHpz5QwPy; Tue, 09 Jul 2024 00:03: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 4WJ1Qy31XJz42C0; Tue, 9 Jul 2024 00:03:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720483386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=slNKbB+O5PFeNrjjQ70h3VP+kRL+VBqKTo5/t4DP5Dw=; b=tbEnhuNV4AqzBFtHCDqR/IE/RBYb3rdBawi9+dhsJRf7DB/9EKZ6/D6KAhXJctLpNxNw0R a0p1i1qJZ6ncJEXUe2s1QlSatkHqyyW/3Xudw6Cvmy8p3GUhvaqvKpNkJl+hFKtE9N2dEK KvdOE3+HtrgZpj45E0BROrNNrrDr82J1FzAoDLVk8nf4YkR6QdbGm73aZDjMxRLSQddYQN 89yWuE2iulPITmu9qNgoZyuMQJFPJ3pAn7aRKU99OMVmLilErWxj/HIPnc6GBsSPvIyUBn txOwFEvYYgZI4PloBxeTxhhc1T3BlWLmDO28csTV3aEe5qGpTQ1Hw+zioilZpg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720483386; a=rsa-sha256; cv=none; b=nyyvsUKW+b0aTKN5DJeHDeKg2NmiCeAx+1LRUEtPEujQQTglE/B8ejFrYeNazP3jRcTeAP 0ZexnAac1YLkfy5t4AyNFVXQrDkYULvWl//jlZQa7jP5dmhN13QXTUQMy1UY98cohouTy/ FtMOqn+e6rXvJxFBkXWbWqoP77OctAlLGe5DKsUr3aRY6Mkur9Iz/cEqW0gKN7FH/jXDzX NrTosYSuYrXnF9J+iXAsA3RiAXYyFYO3hC2yjPqYUlpZvXWqNdXWqCWaIgtFOxi/Oq7xc9 WoRkCeH835+HFwWcTf+zR01iy4r6FhtNNM4McAxF2WGNaJVDCahUIaq/2oVw4A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720483386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=slNKbB+O5PFeNrjjQ70h3VP+kRL+VBqKTo5/t4DP5Dw=; b=CKJNkldwCd++Q/iZBXyvqiqISYvpovec9w78+w6u0kkLjncJAK8aCHG+kO/kHqRvwliZrN +gY2y9DB2xPzNYtjuG6MN1phtREfcto6I9wbuG5mO2jYQ5DbtnrWInUQ1e086cxdzNvv+E BwRx14oCBQtS+zT3MXj+lkH6OpFCniPqdb5OO0w03qAF8q75tvEsrsykyrO7xipwNeu9MU slEAiiuLxYcpGSza5K4sQoScbGDGaV8qv2pQr/LPRj3fBQNKjAjlaWBJI0QLQzjmyDi3DM LuoLlXdg5EcRpjo6h39Zb7VE+XBeJhADRkgLsqy1ZuQvQVoo/K/daqrdNjfauw== 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 4WJ1Qy2cLtz1Bg0; Tue, 9 Jul 2024 00:03: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 469036hx084111; Tue, 9 Jul 2024 00:03:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 469036XY084108; Tue, 9 Jul 2024 00:03:06 GMT (envelope-from git) Date: Tue, 9 Jul 2024 00:03:06 GMT Message-Id: <202407090003.469036XY084108@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 7f936b0cba08 - stable/13 - fusefs: fix two bugs regarding _PC_MIN_HOLE_SIZE List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7f936b0cba08315c0127c425692369d0c162fbcf Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=7f936b0cba08315c0127c425692369d0c162fbcf commit 7f936b0cba08315c0127c425692369d0c162fbcf Author: Alan Somers AuthorDate: 2024-04-03 19:57:44 +0000 Commit: Alan Somers CommitDate: 2024-07-08 20:27:54 +0000 fusefs: fix two bugs regarding _PC_MIN_HOLE_SIZE Background: If a user does pathconf(_, _PC_MIN_HOLE_SIZE) on a fusefs file system, the kernel must actually issue a FUSE_LSEEK operation in order to determine whether the server supports it. We cache that result, so we only have to send FUSE_LSEEK the first time that _PC_MIN_HOLE_SIZE is requested on any given mountpoint. Problem 1: Unlike fpathconf, pathconf operates on files that may not be open. But FUSE_LSEEK requires the file to be open. As described in PR 278135, FUSE_LSEEK cannot be sent for unopened files, causing _PC_MIN_HOLE_size to wrongly report EINVAL. We never noticed that before because the fusefs test suite only uses fpathconf, not pathconf. Fix this bug by opening the file if necessary. Problem 2: On a completely sparse file, with no data blocks at all, FUSE_LSEEK with SEEK_DATA would fail to ENXIO. That's correct behavior, but fuse_vnop_pathconf wrongly interpreted that as "FUSE_LSEEK not supported". Fix the interpretation. PR: 278135 Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D44618 (cherry picked from commit 6efba04df3f8c77b9b12f1df3e5124a7249b82fc) --- sys/fs/fuse/fuse_vnops.c | 48 ++++++++++++---- tests/sys/fs/fusefs/lseek.cc | 129 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+), 10 deletions(-) diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index 75b83c648d38..aa44366ccb95 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -394,6 +394,9 @@ fuse_vnop_do_lseek(struct vnode *vp, struct thread *td, struct ucred *cred, err = fdisp_wait_answ(&fdi); if (err == ENOSYS) { fsess_set_notimpl(mp, FUSE_LSEEK); + } else if (err == ENXIO) { + /* Note: ENXIO means "no more hole/data regions until EOF" */ + fsess_set_impl(mp, FUSE_LSEEK); } else if (err == 0) { fsess_set_impl(mp, FUSE_LSEEK); flso = fdi.answ; @@ -1770,6 +1773,9 @@ fuse_vnop_pathconf(struct vop_pathconf_args *ap) { struct vnode *vp = ap->a_vp; struct mount *mp; + struct fuse_filehandle *fufh; + int err; + bool closefufh = false; switch (ap->a_name) { case _PC_FILESIZEBITS: @@ -1799,22 +1805,44 @@ fuse_vnop_pathconf(struct vop_pathconf_args *ap) !fsess_not_impl(mp, FUSE_LSEEK)) { off_t offset = 0; - /* Issue a FUSE_LSEEK to find out if it's implemented */ - fuse_vnop_do_lseek(vp, curthread, curthread->td_ucred, - curthread->td_proc->p_pid, &offset, SEEK_DATA); + /* + * Issue a FUSE_LSEEK to find out if it's supported. + * Use SEEK_DATA instead of SEEK_HOLE, because the + * latter generally requires sequential scans of file + * metadata, which can be slow. + */ + err = fuse_vnop_do_lseek(vp, curthread, + curthread->td_ucred, curthread->td_proc->p_pid, + &offset, SEEK_DATA); + if (err == EBADF) { + /* + * pathconf() doesn't necessarily open the + * file. So we may need to do it here. + */ + err = fuse_filehandle_open(vp, FREAD, &fufh, + curthread, curthread->td_ucred); + if (err == 0) { + closefufh = true; + err = fuse_vnop_do_lseek(vp, curthread, + curthread->td_ucred, + curthread->td_proc->p_pid, &offset, + SEEK_DATA); + } + if (closefufh) + fuse_filehandle_close(vp, fufh, + curthread, curthread->td_ucred); + } + } if (fsess_is_impl(mp, FUSE_LSEEK)) { *ap->a_retval = 1; return (0); - } else { - /* - * Probably FUSE_LSEEK is not implemented. It might - * be, if the FUSE_LSEEK above returned an error like - * EACCES, but in that case we can't tell, so it's - * safest to report EINVAL anyway. - */ + } else if (fsess_not_impl(mp, FUSE_LSEEK)) { + /* FUSE_LSEEK is not implemented */ return (EINVAL); + } else { + return (err); } default: return (vop_stdpathconf(ap)); diff --git a/tests/sys/fs/fusefs/lseek.cc b/tests/sys/fs/fusefs/lseek.cc index 5ffeb4b33cbd..2a1cb198bcce 100644 --- a/tests/sys/fs/fusefs/lseek.cc +++ b/tests/sys/fs/fusefs/lseek.cc @@ -112,6 +112,75 @@ TEST_F(LseekPathconf, already_seeked) leak(fd); } +/* + * Use pathconf on a file not already opened. The server returns EACCES when + * the kernel tries to open it. The kernel should return EACCES, and make no + * judgement about whether the server does or does not support FUSE_LSEEK. + */ +TEST_F(LseekPathconf, eacces) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + off_t fsize = 1 << 30; /* 1 GiB */ + + EXPECT_LOOKUP(FUSE_ROOT_ID, RELPATH) + .WillOnce(Invoke(ReturnImmediate([=](auto in __unused, auto& out) { + SET_OUT_HEADER_LEN(out, entry); + out.body.entry.entry_valid = UINT64_MAX; + out.body.entry.attr.mode = S_IFREG | 0644; + out.body.entry.nodeid = ino; + out.body.entry.attr.size = fsize; + }))); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_OPEN && + in.header.nodeid == ino); + }, Eq(true)), + _) + ).Times(2) + .WillRepeatedly(Invoke(ReturnErrno(EACCES))); + + EXPECT_EQ(-1, pathconf(FULLPATH, _PC_MIN_HOLE_SIZE)); + EXPECT_EQ(EACCES, errno); + /* Check again, to ensure that the kernel didn't record the response */ + EXPECT_EQ(-1, pathconf(FULLPATH, _PC_MIN_HOLE_SIZE)); + EXPECT_EQ(EACCES, errno); +} + +/* + * If the server returns some weird error when we try FUSE_LSEEK, send that to + * the caller but don't record the answer. + */ +TEST_F(LseekPathconf, eio) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + off_t fsize = 1 << 30; /* 1 GiB */ + int fd; + + expect_lookup(RELPATH, ino, S_IFREG | 0644, fsize, 1); + expect_open(ino, 0, 1); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_LSEEK); + }, Eq(true)), + _) + ).Times(2) + .WillRepeatedly(Invoke(ReturnErrno(EIO))); + + fd = open(FULLPATH, O_RDONLY); + + EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); + EXPECT_EQ(EIO, errno); + /* Check again, to ensure that the kernel didn't record the response */ + EXPECT_EQ(-1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); + EXPECT_EQ(EIO, errno); + + leak(fd); +} + /* * If no FUSE_LSEEK operation has been attempted since mount, try once as soon * as a pathconf request comes in. @@ -141,6 +210,34 @@ TEST_F(LseekPathconf, enosys_now) leak(fd); } +/* + * Use pathconf, rather than fpathconf, on a file not already opened. + * Regression test for https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278135 + */ +TEST_F(LseekPathconf, pathconf) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + off_t fsize = 1 << 30; /* 1 GiB */ + off_t offset_out = 1 << 29; + + expect_lookup(RELPATH, ino, S_IFREG | 0644, fsize, 1); + expect_open(ino, 0, 1); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_LSEEK); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnImmediate([=](auto i __unused, auto& out) { + SET_OUT_HEADER_LEN(out, lseek); + out.body.lseek.offset = offset_out; + }))); + expect_release(ino, FuseTest::FH); + + EXPECT_EQ(1, pathconf(FULLPATH, _PC_MIN_HOLE_SIZE)) << strerror(errno); +} + /* * If no FUSE_LSEEK operation has been attempted since mount, try one as soon * as a pathconf request comes in. This is the typical pattern of bsdtar. It @@ -177,6 +274,38 @@ TEST_F(LseekPathconf, seek_now) leak(fd); } +/* + * If the user calls pathconf(_, _PC_MIN_HOLE_SIZE) on a fully sparse or + * zero-length file, then SEEK_DATA will return ENXIO. That should be + * interpreted as success. + */ +TEST_F(LseekPathconf, zerolength) +{ + const char FULLPATH[] = "mountpoint/some_file.txt"; + const char RELPATH[] = "some_file.txt"; + const uint64_t ino = 42; + off_t fsize = 0; + int fd; + + expect_lookup(RELPATH, ino, S_IFREG | 0644, fsize, 1); + expect_open(ino, 0, 1); + EXPECT_CALL(*m_mock, process( + ResultOf([=](auto in) { + return (in.header.opcode == FUSE_LSEEK && + in.header.nodeid == ino && + in.body.lseek.whence == SEEK_DATA); + }, Eq(true)), + _) + ).WillOnce(Invoke(ReturnErrno(ENXIO))); + + fd = open(FULLPATH, O_RDONLY); + EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); + /* Check again, to ensure that the kernel recorded the response */ + EXPECT_EQ(1, fpathconf(fd, _PC_MIN_HOLE_SIZE)); + + leak(fd); +} + /* * For servers using older protocol versions, no FUSE_LSEEK should be attempted */ From nobody Tue Jul 9 18:11:55 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WJTbH4ytlz5QqkM; Tue, 09 Jul 2024 18:11: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 4WJTbH4WLxz4h2D; Tue, 9 Jul 2024 18:11:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720548715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/kc9+a4K1I1sDyJT9SpD9JHJfZOOUc9mYi0Se6rY57A=; b=JI3grpE04GjNNp+e0+Q7aj5/Z7mrhSsTrjSHHqGdQ+ldkQWEkZYeOmSdNjc6U9mn97EG9m JWPitEJOofEYy0SxgLZXUddjPr6Xq2/g2WCu2Zu5+jMz/d2vX74lbyCZ0TZZtp6sF+vt/8 f3e1AsnWJVNEBWxYtMbB3NwbIIu+d10ORfy+B2/jROQUWCj9HB0T+eIZgQ4bhK/zH5F2J0 Dp9tMtmnsIfm4W6p1mJVEF3BbcEtD70C+rgq0OhPJUNiQu/pHnm2r4AV/Wi/HNQ92hFBpJ KTdVOMJc+1tixB5wZV5XKLN+BaQGSJBR1TjwJTmQt/cpj3nrG4QCHM8OFzWNiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720548715; a=rsa-sha256; cv=none; b=ehin3XFzqdfI3vNA4AXdLPQ1Kwq9F+pnMh6v9gukdhEMSVDog3ODEPIGbzoiskJN4EVqLW Dp8r5v40Tubgj0itViHlmXE8poKSCFI1aLfNFiGOip1KSzVmrsNSZ5XG8+QWB185DzXtKS aVWpJrtfu2V9hfylWk1ox16v4+pTyEB04ZmyTs/+jS7Udb3s/KrTXlmAjAeSI+QyZWEGsm YmGcYbFGkJaSU5UcJB0H8LA8c6xzist9d6z6sl88bQfJdzbQW1/FnNHVJoRaT4tq6zzwzT NlEB9PMSYoc1Hy5As+Pw1sbwPEAdill2o8e5eywDM3FqGAKDTzix2AyVcf4LCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720548715; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/kc9+a4K1I1sDyJT9SpD9JHJfZOOUc9mYi0Se6rY57A=; b=i5CQII7vOq49O8fanjoJ+W4i9HEqdT8XKmlCg2zGpX2maSZLiB0caA1LgPVAcBtQxN8JSb UkHnH9ryVhmByiDdFY3Z1g2e0X+V6zdmx5I/s03LJGaHki5sarzkRmfPrzmUX1rZx0t1Kv riV+Xn08ud2gHUrAppjwweL3kkoppV1uOVu6zb5R+jPv0uoXm6qIY32nh4B5fKEJUKUasV /M7v6XsToVM5I4VxUvLtFcvdOHV8mX0VrdIrrjomkmNjhqsm5I938Q2+Nbgq0wkTflSSlq aqnEdCuWSy/HpHMTaE2Q71Owjy/I4hy7JMzVCiRAWI9VIwHLofnboIXLJiX3cw== 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 4WJTbH46mfzlG5; Tue, 9 Jul 2024 18:11:55 +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 469IBtFL035437; Tue, 9 Jul 2024 18:11:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 469IBt88035434; Tue, 9 Jul 2024 18:11:55 GMT (envelope-from git) Date: Tue, 9 Jul 2024 18:11:55 GMT Message-Id: <202407091811.469IBt88035434@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 410c50ae477a - stable/14 - release.sh: Pass ARCH_FLAGS when setting VMSIZE List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 410c50ae477a61d88422a72fd2b44b770627bd89 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=410c50ae477a61d88422a72fd2b44b770627bd89 commit 410c50ae477a61d88422a72fd2b44b770627bd89 Author: Colin Percival AuthorDate: 2024-07-06 17:15:22 +0000 Commit: Colin Percival CommitDate: 2024-07-09 17:50:14 +0000 release.sh: Pass ARCH_FLAGS when setting VMSIZE [MFC note: This is not needed on stable/14 right now since the riscv64 images still fit within the default 5 GB size, but I want it in the tree in case I need to bump VM sizes on a per-arch basis later.] The default VM size may depend on the architecture. In particular, it is currently larged on riscv64 due to a toolchain issue which results in bloated binaries. MFC after: 3 days Fixes: 59c21ed6e811 "release: Bump default VM size for riscv64 to 6 GB" Sponsored by: Amazon (cherry picked from commit ed807f7bcaecbf32b0b81a7d18cee489a3666157) --- release/release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/release.sh b/release/release.sh index 3c68f89c2cc3..cee0fbd5643d 100755 --- a/release/release.sh +++ b/release/release.sh @@ -337,7 +337,7 @@ chroot_build_release() { fi if [ -z "${VMSIZE}" ]; then VMSIZE="$(eval chroot ${CHROOTDIR} \ - make -C /usr/src/release -V VMSIZE)" + make -C /usr/src/release ${ARCH_FLAGS} -V VMSIZE)" fi RELEASE_RMAKEFLAGS="${RELEASE_RMAKEFLAGS} \ VMFORMATS=\"${VMFORMATS}\" VMSIZE=${VMSIZE}" From nobody Tue Jul 9 21:42:24 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WJZG82SfVz5R8DJ; Tue, 09 Jul 2024 21:42: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 4WJZG820nPz53Py; Tue, 9 Jul 2024 21:42:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720561344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pPH0RKBdZDZjsZwl9GuhR4ErXD/99jwdpn6NIZ9uJAo=; b=eGtOtY+33azsYsiFY56Lfd9OxzDjNcbJmKp/ENlF+ksCH66zk3Hb7nN0hQCkDuzNFRhpxL d2U4z/YT79D5JngMKgmnTiijtmVymTWxGBJ1qH1yuyUyfdYPkKJq/EseYqUkITViWbRnpX 8ExvuU9L8aTejQFcG2AnTm10SW3vAc5M6iXq8UU5oP+LsRfHgSRWysOGRiBsWsyjzbnHRn NGJoZpg+thh7/7x95wu5oJStJe7OL01k5nefUfcIG31ImTpvIHIOFfcU3KqRz0AFZPj1bP 31aYKVJbGbYaW93pC9gSx1D9tvO3VC/lsTRd2V/s3k41AVLtrnV9nqgkzTNfFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720561344; a=rsa-sha256; cv=none; b=m5kqmQbmELpJjy/ajjGGx6+rsAScpNv3sfLHACle7oacvXYREYavN3juq8PH7TcOkWasgy /wQA3T2Sln82hGdFhObA1iOiHyUix0upEISSSUeF3JdNQsOsFTSF7CUGcNLMDuIv4HtS69 v1a0wcT5kSvhieQx48c4Q9+DUTmhgPhiTPtwuMoMfjlBUzUjYxuPwpthFx3AFGGc7r/9GO LErH194Bx/1JTiuPYPA1ny+grvQFLqG8mVkPvFbc5BL98He/IvsRAYqziYn766qxDXtInH 9Go4KnQ02lGva+f830lypyGXwMqmqSxZxBUl55CZbEPS4zr+sJvO3v4aUEUjBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720561344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pPH0RKBdZDZjsZwl9GuhR4ErXD/99jwdpn6NIZ9uJAo=; b=ggnD66k79KYKAe6k2F7ACs7kSMcBrf2QXFSVPU1bSTRNcDQTrkTIUNjvfDGtSyhPHruKKd ayxS67H3uLmNvk9BG0R7ffTxauXPHnfMNwPkGk9eN/yGYM11Ce3EJAdHbjjiu5LKzbzCaS 1DDVWxdFiU0FlXYCGtdV1Wy4Esn0+KL0O3ugwbJC+Z+Hqm6gVrAg/zscQkYg7ruOLwSsV/ fUzww0D/cF5SgJ68E1u2Hg2/1QDpVYaoaaGcABXPxSxJ3BVjQF2hlxps/5M9ITtPsE16J2 jOkElrnxfUA4j5KxQkaop0WAFUokBqM34Yog0lZ+FnN5acRP2gtlTtYu1IBPFw== 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 4WJZG81bjPzqgV; Tue, 9 Jul 2024 21:42: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 469LgOAM093061; Tue, 9 Jul 2024 21:42:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 469LgOjT093057; Tue, 9 Jul 2024 21:42:24 GMT (envelope-from git) Date: Tue, 9 Jul 2024 21:42:24 GMT Message-Id: <202407092142.469LgOjT093057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 77362b5eb7a5 - stable/14 - tftpd: Code cleanup. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 77362b5eb7a558d4327187bd6997df4051301059 Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=77362b5eb7a558d4327187bd6997df4051301059 commit 77362b5eb7a558d4327187bd6997df4051301059 Author: Dag-Erling Smørgrav AuthorDate: 2024-07-05 22:05:49 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-07-09 21:40:26 +0000 tftpd: Code cleanup. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D45871 (cherry picked from commit c15290fb9d8fdf4b11b9c6e7406b67c73a98402d) --- libexec/tftpd/tftpd.c | 91 +++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 50 deletions(-) diff --git a/libexec/tftpd/tftpd.c b/libexec/tftpd/tftpd.c index 00c1257ce548..cef8d0278a55 100644 --- a/libexec/tftpd/tftpd.c +++ b/libexec/tftpd/tftpd.c @@ -692,28 +692,27 @@ find_next_name(char *filename, int *fd) int validate_access(int peer, char **filep, int mode) { - struct stat stbuf; - int fd; - int error; - struct dirlist *dirp; static char pathname[MAXPATHLEN]; + struct stat sb; + struct dirlist *dirp; char *filename = *filep; + int err, fd; /* * Prevent tricksters from getting around the directory restrictions */ - if (strstr(filename, "/../")) + if (strncmp(filename, "../", 3) == 0 || + strstr(filename, "/../") != NULL) return (EACCESS); if (*filename == '/') { /* - * Allow the request if it's in one of the approved locations. - * Special case: check the null prefix ("/") by looking - * for length = 1 and relying on the arg. processing that - * it's a /. + * Absolute file name: allow the request if it's in one of the + * approved locations. */ for (dirp = dirs; dirp->name != NULL; dirp++) { if (dirp->len == 1) + /* Only "/" can have len 1 */ break; if (strncmp(filename, dirp->name, dirp->len) == 0 && filename[dirp->len] == '/') @@ -722,30 +721,20 @@ validate_access(int peer, char **filep, int mode) /* If directory list is empty, allow access to any file */ if (dirp->name == NULL && dirp != dirs) return (EACCESS); - if (stat(filename, &stbuf) < 0) + if (stat(filename, &sb) != 0) return (errno == ENOENT ? ENOTFOUND : EACCESS); - if ((stbuf.st_mode & S_IFMT) != S_IFREG) + if (!S_ISREG(sb.st_mode)) return (ENOTFOUND); if (mode == RRQ) { - if ((stbuf.st_mode & S_IROTH) == 0) + if ((sb.st_mode & S_IROTH) == 0) return (EACCESS); } else { - if (check_woth && ((stbuf.st_mode & S_IWOTH) == 0)) + if (check_woth && (sb.st_mode & S_IWOTH) == 0) return (EACCESS); } } else { - int err; - /* * Relative file name: search the approved locations for it. - * Don't allow write requests that avoid directory - * restrictions. - */ - - if (!strncmp(filename, "../", 3)) - return (EACCESS); - - /* * If the file exists in one of the directories and isn't * readable, continue looking. However, change the error code * to give an indication that the file exists. @@ -753,18 +742,20 @@ validate_access(int peer, char **filep, int mode) err = ENOTFOUND; for (dirp = dirs; dirp->name != NULL; dirp++) { snprintf(pathname, sizeof(pathname), "%s/%s", - dirp->name, filename); - if (stat(pathname, &stbuf) == 0 && - (stbuf.st_mode & S_IFMT) == S_IFREG) { - if (mode == RRQ) { - if ((stbuf.st_mode & S_IROTH) != 0) - break; - } else { - if (!check_woth || ((stbuf.st_mode & S_IWOTH) != 0)) - break; - } - err = EACCESS; + dirp->name, filename); + if (stat(pathname, &sb) != 0) + continue; + if (!S_ISREG(sb.st_mode)) + continue; + err = EACCESS; + if (mode == RRQ) { + if ((sb.st_mode & S_IROTH) == 0) + continue; + } else { + if (check_woth && (sb.st_mode & S_IWOTH) == 0) + continue; } + break; } if (dirp->name != NULL) *filep = filename = pathname; @@ -778,27 +769,27 @@ validate_access(int peer, char **filep, int mode) * This option is handled here because it (might) require(s) the * size of the file. */ - option_tsize(peer, NULL, mode, &stbuf); + option_tsize(peer, NULL, mode, &sb); - if (mode == RRQ) + if (mode == RRQ) { fd = open(filename, O_RDONLY); - else { - if (create_new) { - if (increase_name) { - error = find_next_name(filename, &fd); - if (error > 0) - return (error + 100); - } else - fd = open(filename, - O_WRONLY | O_TRUNC | O_CREAT, - S_IRUSR | S_IWUSR | S_IRGRP | - S_IWGRP | S_IROTH | S_IWOTH ); - } else - fd = open(filename, O_WRONLY | O_TRUNC); + } else if (create_new) { + if (increase_name) { + err = find_next_name(filename, &fd); + if (err > 0) + return (err + 100); + } else { + fd = open(filename, + O_WRONLY | O_TRUNC | O_CREAT, + S_IRUSR | S_IWUSR | S_IRGRP | + S_IWGRP | S_IROTH | S_IWOTH ); + } + } else { + fd = open(filename, O_WRONLY | O_TRUNC); } if (fd < 0) return (errno + 100); - file = fdopen(fd, (mode == RRQ)? "r":"w"); + file = fdopen(fd, mode == RRQ ? "r" : "w"); if (file == NULL) { close(fd); return (errno + 100); From nobody Wed Jul 10 10:17:47 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WJv1m0QmTz5Q8yQ; Wed, 10 Jul 2024 10:17: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 4WJv1l6zx0z4322; Wed, 10 Jul 2024 10:17:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720606668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NRGsfh4RoUYZWMUBsUskxHdFpxppVIdNJ4RV8XSj2QA=; b=ch+uJmzZ1c/2mSFGXUFwDXzia4DL2O0sDXoQNsOy0SxTkPDdDe9cB8/jeaXDfijFllFOR2 yYgGsNh57NKIqF8zWmxCmzKzuAPmoMeIvlJ9bsAEFKMOCwiBE+KvCo/NgVOOyWOaiQNwxL eTU23WOFluUCLxWLXGcle+5fdpqOcya46O1l3ayeAiK/OslnRMnxcgIzcVDTWtN7ANjtms ojIQgSbCk853I+4cyfOlEX7rwHep4ob2ilhWfqKD6LzbtrGOZ0g49umMI/YfxpAQknqgNF Lfv/zcrVZsamAGfAjSBuciiws+oC67Nba/PuBBb9Cvn1ggycdE41qwb40QZkoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720606668; a=rsa-sha256; cv=none; b=HIu2/7vUY73q+wM3warD0ZWy9RJa4aZYwHS2SCA7YXUn2gkiDwMQ9BWyCWq9Zfpo9SZjWM tr2JUIpbzsB/U3xpzpOHL4VgC4KhnsdQIPcdUPnraj+LjOPK80ktG2Sk+t2+LCL+RdDTme /Db0fQ7IzKTHm0R+kTIHAoP9FqQCVra9JfFOi554u5qSHR05Zu3F8OBxBsO5hG+V+BHyun Q67iXk8jGuHg8WDI0Vx/E/6CZjRjomIRq9CsbBV17ox6oBxV0h9NL5tTiNwVWIeGHX91B1 80aOAYHZGTSHsSAwqEdA+br2rF524+4w36NTLr/V/oe/XMDX0dCYbNNKiVemqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720606668; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NRGsfh4RoUYZWMUBsUskxHdFpxppVIdNJ4RV8XSj2QA=; b=SbKWq52dBCl0fjbkwDcd6I5gyNeuiI+GTz4vFyGf1iqQbShnm89OPU+A1Tn7QHFg2JEyo1 ppdyhhbYq634uO4UopKA1WQvRQFPK4liOJP/tWikEqh4rYUHMFsnCjPbY3C/zaAngXWFWE jNJKoviTvS6OHA0wuQIWwiqmJgojc5sUIWXX5dSOaMLxScU1AIZPtEXtX/7r/c5GR6V9sP PglBeJIrEWsJDBFOu6By9rED2LY9u4PS2tcwapomdlRTiWjuqrRhRruT5Jbb72ModGrouo cyEds9VzVWEulGde73bjGFC7zz/HSYh8zyjOpaNEy3Os++1RXGa37Yrcj2S8rg== 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 4WJv1l6Zszz1CH9; Wed, 10 Jul 2024 10:17: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 46AAHlIF070924; Wed, 10 Jul 2024 10:17:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AAHlFj070921; Wed, 10 Jul 2024 10:17:47 GMT (envelope-from git) Date: Wed, 10 Jul 2024 10:17:47 GMT Message-Id: <202407101017.46AAHlFj070921@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 7de38cbb5dc4 - stable/14 - if_vxlan(4): Exclude ETHER_CRC_LEN from macro VXLAN_MAX_MTU List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7de38cbb5dc4d0a6de65eb562a1b066313dc756a Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=7de38cbb5dc4d0a6de65eb562a1b066313dc756a commit 7de38cbb5dc4d0a6de65eb562a1b066313dc756a Author: Zhenlei Huang AuthorDate: 2024-07-02 04:57:01 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-10 10:17:09 +0000 if_vxlan(4): Exclude ETHER_CRC_LEN from macro VXLAN_MAX_MTU The encapsulated (original) frame does not count in FCS as per Section 5 of RFC 7348. Reviewed by: afedorov, bryanv, #network Fixes: b7592822d5de Allow set MTU more than 1500 bytes MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45195 (cherry picked from commit d6963b9ed3287e91db3d1df153861591faff0007) --- sys/net/if_vxlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index 87648abd116b..7a8cf7acae58 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -98,7 +98,7 @@ struct vxlan_socket_mc_info { 60 /* Maximum IPv4 header len */ - \ sizeof(struct udphdr) - \ sizeof(struct vxlan_header) - \ - ETHER_HDR_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN) + ETHER_HDR_LEN - ETHER_VLAN_ENCAP_LEN) #define VXLAN_BASIC_IFCAPS (IFCAP_LINKSTATE | IFCAP_JUMBO_MTU) #define VXLAN_SO_MC_MAX_GROUPS 32 From nobody Wed Jul 10 10:17:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WJv1n1hQdz5Q91l; Wed, 10 Jul 2024 10:17: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 4WJv1n0pzpz42g2; Wed, 10 Jul 2024 10:17:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720606669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51Dt9oiqTfjEodgM7inQLwOyA1EWExxTMCi4V2tLUFY=; b=l+A2Z/GxolVEg+qYFrYo+fsq7ubyvtE4ImUBkjDpPkCRzOChZDLF3Dg/9ChaSOa7vvIJdf X6snhlKXIQCUvyb8mR/m2ixscXVDJCen5ze1a4FmYzbWFDbdIv/1IoknUjlCzCORGDa6Pm Lg8xQroASwAtwYyrtZ0DBT7loInJCdx4ORv5+C/CNNBvnh3MAuYIxkVdEfAM3J9MwNJed7 UwMwzl/HcWsbxqG1Qf3wkTd+oSc5vpEO2BX+UgCb11n3cBAwMmei1fkeBzwPFNKHSKjBv7 b55J/Exbl6VEsV6YnYLGmQRgfVOF8WQ5lDE39vqaHfezTXxXL8WGVxpqH8z91w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720606669; a=rsa-sha256; cv=none; b=ZRALjZoxnatyoW0AUW7DjXW2eSON9cQpDwjVXsk3pYnNh+vfzxtGCNRz42GnhRNR1xg3Jd oSMn1wwOchQaJNFcaUyzmLO12VuAAdICMHcfHsttK4wDgqveLNtK8xZa8RKXxbh4c8aLC+ 4XFrJF0JARXEyb+AMhprynCrTkhAjP8Uri60gXnQxs4R0wWb4j0pQeUJ/4213L/KuZ1e66 FSTrjqZ2XqCx/VW8fJFoF2K9HBTv3MXlAoMUSVo1EQmn8CfzQqcOLUit5GkSIApVdZ1p0t 51Y/Xffi53f1f1GpMsgvXXz4umH5rWUPkRHN1+GsgKWRyA8DjwfyPKCo5hQpWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720606669; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=51Dt9oiqTfjEodgM7inQLwOyA1EWExxTMCi4V2tLUFY=; b=Dbyz4AOdUXmd8owE14/R8zo0fTLcDlk93dGSsBa/n9cZKAd5177DfToo0dXpUEJQCp9Es4 Hfw2JEHxOTyN+7lSDs2A3KbFcPSbr7HDM1/M/IpD2JPGR9RcFsB/JKvTmm4t4IpkD5pAfP AfpPufsqTi7rhQPeKuUMQfTMLw1YIQlyIVAbsd9IJEsQAhUKVsCoMTwakFkXc2Wh4EJSd5 mVlvd0C7re1DBH6UYFHnMP3hTFBolgE7abtSFBLckTLF+Y+4tSHTOo1NOLlHHJwG2E7d4e cwzSLQgjRw5ITVaGAAIJDLM99EG+QFHE1xz2S8ujcC0BT4aR6pkr6LSIXHRTgw== 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 4WJv1n0Qtqz1CkD; Wed, 10 Jul 2024 10:17: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 46AAHmsJ070967; Wed, 10 Jul 2024 10:17:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AAHmVB070964; Wed, 10 Jul 2024 10:17:48 GMT (envelope-from git) Date: Wed, 10 Jul 2024 10:17:48 GMT Message-Id: <202407101017.46AAHmVB070964@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: e729e750806d - stable/14 - if_vxlan(4): Plug a memory leak List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e729e750806d3873d5de24cce3b47cc054145985 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e729e750806d3873d5de24cce3b47cc054145985 commit e729e750806d3873d5de24cce3b47cc054145985 Author: Zhenlei Huang AuthorDate: 2024-07-02 04:57:02 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-10 10:17:09 +0000 if_vxlan(4): Plug a memory leak On clone creating, either failure from vxlan_set_user_config() or ifc_copyin() will result in leaking previous allocated counters. Since counter_u64_alloc(M_WAITOK) never fails, make vxlan_stats_alloc() void and move the allocation for counters below checking ifd->params to avoid memory leak. Reviewed by: kp, glebius Fixes: b092fd6c973d if_vxlan(4): add support for hardware assisted checksumming, TSO, and RSS MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45822 (cherry picked from commit 087f5e08ab5f0384163f76f73b9a91c98a3ba450) --- sys/net/if_vxlan.c | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index 7a8cf7acae58..c6686c4868f9 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -368,7 +368,7 @@ static bool vxlan_rcv_udp_packet(struct mbuf *, int, struct inpcb *, static int vxlan_input(struct vxlan_socket *, uint32_t, struct mbuf **, const struct sockaddr *); -static int vxlan_stats_alloc(struct vxlan_softc *); +static void vxlan_stats_alloc(struct vxlan_softc *); static void vxlan_stats_free(struct vxlan_softc *); static void vxlan_set_default_config(struct vxlan_softc *); static int vxlan_set_user_config(struct vxlan_softc *, @@ -2924,27 +2924,14 @@ out: return (error); } -static int +static void vxlan_stats_alloc(struct vxlan_softc *sc) { struct vxlan_statistics *stats = &sc->vxl_stats; stats->txcsum = counter_u64_alloc(M_WAITOK); - if (stats->txcsum == NULL) - goto failed; - stats->tso = counter_u64_alloc(M_WAITOK); - if (stats->tso == NULL) - goto failed; - stats->rxcsum = counter_u64_alloc(M_WAITOK); - if (stats->rxcsum == NULL) - goto failed; - - return (0); -failed: - vxlan_stats_free(sc); - return (ENOMEM); } static void @@ -2952,18 +2939,9 @@ vxlan_stats_free(struct vxlan_softc *sc) { struct vxlan_statistics *stats = &sc->vxl_stats; - if (stats->txcsum != NULL) { - counter_u64_free(stats->txcsum); - stats->txcsum = NULL; - } - if (stats->tso != NULL) { - counter_u64_free(stats->tso); - stats->tso = NULL; - } - if (stats->rxcsum != NULL) { - counter_u64_free(stats->rxcsum); - stats->rxcsum = NULL; - } + counter_u64_free(stats->txcsum); + counter_u64_free(stats->tso); + counter_u64_free(stats->rxcsum); } static void @@ -3234,9 +3212,6 @@ vxlan_clone_create(struct if_clone *ifc, char *name, size_t len, sc->vxl_unit = ifd->unit; sc->vxl_fibnum = curthread->td_proc->p_fibnum; vxlan_set_default_config(sc); - error = vxlan_stats_alloc(sc); - if (error != 0) - goto fail; if (ifd->params != NULL) { error = ifc_copyin(ifd, &vxlp, sizeof(vxlp)); @@ -3248,6 +3223,7 @@ vxlan_clone_create(struct if_clone *ifc, char *name, size_t len, goto fail; } + vxlan_stats_alloc(sc); ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { error = ENOSPC; From nobody Wed Jul 10 11:45:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WJwym51RMz5QJV1; Wed, 10 Jul 2024 11:45: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 4WJwym2LrXz49hB; Wed, 10 Jul 2024 11:45:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720611920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z6mThVOHdFk71oPQizlwhVAxswZ4py02ZDr22+5+oeo=; b=NqGSI7TqGc/vVmxfynud9jK6c/KWvPDYMiztvkMzOBh1lP/XPEEjH/0yTRWsGdQUc6kuj4 cHZInxEv/sdy+g9x53w4UaIsY9UCz+S++Gp244XUioUBvA1Xrq1kMsRrX+KIIPfhE8VmbP gD1j1lUhqSST3ud7Anoa0e8FoC/uUolQ5/+T4tO3L0AnHFS/adhqzslaASkn6gKsZaeFFM w+M2Po5HpuPOd49RJlVWPGruiFfMA0RREZg15nEA+gcYAM7u0lUnICNRbmI2WZieWVogLK 6oleyTkGfXXET6DkwbtBNB29/P5MyI8fmXTLG8JnEzDcmVpo5wsP7CLuf6O6Ig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720611920; a=rsa-sha256; cv=none; b=USrfw4TQWG3CMcOttZ9DAtz10hiSkE24bZiacvB6vsHzbp0i+9OTwQu4/KW4nSNQJUlyFV cnZpYm/ldCh199Ayj/ioBn6RCjY5bEg9Hp3sKeOZ1zFlT2RqZ6O5TTjfMbakChtVX5cwCY PQsT+dJn4bEpLr9A0+V1B9el8Q3FdmfyXhV8X10NBmVzrbVmVCJ5JA5+adRoG5GW4XTSx3 e+WY9RsCUFvsKzt3dINNKRnDyCR/7qlbrWDSxpZM9lcvztIy456L5O78zDiJ4y7AO5E2Ug Ptdlbvc81lM4ueigmITtMS9mEib+0V0DBBhkdIY6dn29snXiBLLHaMG4Abewfw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720611920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=z6mThVOHdFk71oPQizlwhVAxswZ4py02ZDr22+5+oeo=; b=kBme2RR7eCB0jTt3RxYy2Lkgo5mHwxOkRWawbcQ6lXto+vNKtS87As5/XLyJCZb0xl5hiL qQ5yWb+HJasBTDszOqEPUVRe+iU2vaDDwuFavCqJxgXVfGQBbnlINDiL84b1KHfHT/hGYc fecDw5e49WrP5OCA8hPVaeqrNPNawS/R2eQp28s0UKoyLDbUsuIG407S89iqcYHed8TRpY QQFKGd9DV8kXNnLLluVEppEpir3UwOac6P1SE3uACLrlbaFc2c0RnYquofjGyGyp9DYmBz t2nZXCkJgeE+2XCOOxosaMb11nZGrn5Dudjr8jf7y75on2Izh3H0J4NRmwHVAQ== 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 4WJwym1z5NzGMv; Wed, 10 Jul 2024 11:45: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 46ABjKKi023178; Wed, 10 Jul 2024 11:45:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46ABjKsB023175; Wed, 10 Jul 2024 11:45:20 GMT (envelope-from git) Date: Wed, 10 Jul 2024 11:45:20 GMT Message-Id: <202407101145.46ABjKsB023175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 44aca0397cc8 - stable/13 - if_vxlan(4): Exclude ETHER_CRC_LEN from macro VXLAN_MAX_MTU List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 44aca0397cc84e2483bc04b21b3e836aa2ae79c7 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=44aca0397cc84e2483bc04b21b3e836aa2ae79c7 commit 44aca0397cc84e2483bc04b21b3e836aa2ae79c7 Author: Zhenlei Huang AuthorDate: 2024-07-02 04:57:01 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-10 11:43:36 +0000 if_vxlan(4): Exclude ETHER_CRC_LEN from macro VXLAN_MAX_MTU The encapsulated (original) frame does not count in FCS as per Section 5 of RFC 7348. Reviewed by: afedorov, bryanv, #network Fixes: b7592822d5de Allow set MTU more than 1500 bytes MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45195 (cherry picked from commit d6963b9ed3287e91db3d1df153861591faff0007) (cherry picked from commit 7de38cbb5dc4d0a6de65eb562a1b066313dc756a) --- sys/net/if_vxlan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index 3802ebe4bfbe..34816ede13a3 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -97,7 +97,7 @@ struct vxlan_socket_mc_info { 60 /* Maximum IPv4 header len */ - \ sizeof(struct udphdr) - \ sizeof(struct vxlan_header) - \ - ETHER_HDR_LEN - ETHER_CRC_LEN - ETHER_VLAN_ENCAP_LEN) + ETHER_HDR_LEN - ETHER_VLAN_ENCAP_LEN) #define VXLAN_BASIC_IFCAPS (IFCAP_LINKSTATE | IFCAP_JUMBO_MTU) #define VXLAN_SO_MC_MAX_GROUPS 32 From nobody Wed Jul 10 11:45:21 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WJwyn42FVz5QJcd; Wed, 10 Jul 2024 11:45: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 4WJwyn2CDBz49bn; Wed, 10 Jul 2024 11:45:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720611921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0UGOYYIlDxgpbJUs83+8CPZpJoLviRWhiR37/v9ljT0=; b=FER4c0mv4n+bZfXUgKswk44ddViws4m1S4AsKP10kuRkL/Im0vc+8P4dDcVN1DsvwvuT4f 7w3P/nq79Cq3ukP2oqa9AVXbYz8A1sXxOu/YSPr+YQt8mUieOOGSRQ8nNrikMHuGweDYnY +MLbxFIFl0QlNlUa8dAN/3m4UKhWp9KkdPP3MHMyFi8lW2WBInGXP5zWK7NmPXATjjuTIi yaTLsYY2N4INrLxQ3JX9eSdNX3BtSeQHpcaN661rH51+7udstuN+ixntwpJhzBtR08m2Jh P92UoWrnT5d6UBvLbY0gZAnakOo4+bpySknAtNd5px8BpOFobARlyWZpWz9H9w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720611921; a=rsa-sha256; cv=none; b=Tx+iA7zT+P+48aal2w3w1RjwdCebJhhTnEH/+uknveZaq+HK109J4EMOK3ba38CvZOIddh Gbv4cLex2KKtYobLZdos1wYwkW2NQIEPXIe6cjEEweUG8Ga83irraXczn+YiZBv5tXVEFk wkAPxUAHSKWL9+tajH7Ol8SdFrLVvm4go84AHev++zilKphOmp5C2t+lgTRvKLbsFZOs/5 AEYhmQWpCM8pNySUPdgjapaKNHI/ZFwcts+gUMd56kcS1S9/L/BP1/yt/vBXF5GTU56aU5 oYEEoR/5APP8GeHZypbJoq66IAE5tCZ7nxXMalgHRJ996kcJPdCP41Z80softg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720611921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0UGOYYIlDxgpbJUs83+8CPZpJoLviRWhiR37/v9ljT0=; b=n0IjxiHUFAbBkhn66SJU9idfHYvbXvQ9ZMDcXN5G5SePVl/L6J6hhoQpVUnlVUniI6W6AD 8vsvOqSlkJtMIRBNEBISuxMxJwpJq6Js5782HrOcTMOr+UtqBgko8GGBrwIMmKNxTZh9WN UCWFkl0WfPEcjJ7IKVcuKGFtl5zG+rvOCwPX+1E1FYoxxFJPxbgGOTuVn5xxiIwixeGkFu rE0XJyaisqx65suMcdoVL7FtJDmSpvrFYhtB1LCeyqGOjL9m8ti7iFs4z6G2XEm20S/YiA 9o7/H25AGRgF2oDq56kALZLtIYVYzoUpQl7+AcgvecK/F1yCMjsE3+1nuicqNg== 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 4WJwyn1pRTzGMw; Wed, 10 Jul 2024 11:45: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 46ABjL6R023223; Wed, 10 Jul 2024 11:45:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46ABjLpX023220; Wed, 10 Jul 2024 11:45:21 GMT (envelope-from git) Date: Wed, 10 Jul 2024 11:45:21 GMT Message-Id: <202407101145.46ABjLpX023220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 12bd1341d2aa - stable/13 - if_vxlan(4): Plug a memory leak List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 12bd1341d2aa8eea34d858727c295ed5703de4f1 Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=12bd1341d2aa8eea34d858727c295ed5703de4f1 commit 12bd1341d2aa8eea34d858727c295ed5703de4f1 Author: Zhenlei Huang AuthorDate: 2024-07-02 04:57:02 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-10 11:43:37 +0000 if_vxlan(4): Plug a memory leak On clone creating, either failure from vxlan_set_user_config() or ifc_copyin() will result in leaking previous allocated counters. Since counter_u64_alloc(M_WAITOK) never fails, make vxlan_stats_alloc() void and move the allocation for counters below checking ifd->params to avoid memory leak. Reviewed by: kp, glebius Fixes: b092fd6c973d if_vxlan(4): add support for hardware assisted checksumming, TSO, and RSS MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45822 (cherry picked from commit 087f5e08ab5f0384163f76f73b9a91c98a3ba450) (cherry picked from commit e729e750806d3873d5de24cce3b47cc054145985) --- sys/net/if_vxlan.c | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c index 34816ede13a3..2cc9f60cba87 100644 --- a/sys/net/if_vxlan.c +++ b/sys/net/if_vxlan.c @@ -367,7 +367,7 @@ static void vxlan_rcv_udp_packet(struct mbuf *, int, struct inpcb *, static int vxlan_input(struct vxlan_socket *, uint32_t, struct mbuf **, const struct sockaddr *); -static int vxlan_stats_alloc(struct vxlan_softc *); +static void vxlan_stats_alloc(struct vxlan_softc *); static void vxlan_stats_free(struct vxlan_softc *); static void vxlan_set_default_config(struct vxlan_softc *); static int vxlan_set_user_config(struct vxlan_softc *, @@ -2918,27 +2918,14 @@ out: return (error); } -static int +static void vxlan_stats_alloc(struct vxlan_softc *sc) { struct vxlan_statistics *stats = &sc->vxl_stats; stats->txcsum = counter_u64_alloc(M_WAITOK); - if (stats->txcsum == NULL) - goto failed; - stats->tso = counter_u64_alloc(M_WAITOK); - if (stats->tso == NULL) - goto failed; - stats->rxcsum = counter_u64_alloc(M_WAITOK); - if (stats->rxcsum == NULL) - goto failed; - - return (0); -failed: - vxlan_stats_free(sc); - return (ENOMEM); } static void @@ -2946,18 +2933,9 @@ vxlan_stats_free(struct vxlan_softc *sc) { struct vxlan_statistics *stats = &sc->vxl_stats; - if (stats->txcsum != NULL) { - counter_u64_free(stats->txcsum); - stats->txcsum = NULL; - } - if (stats->tso != NULL) { - counter_u64_free(stats->tso); - stats->tso = NULL; - } - if (stats->rxcsum != NULL) { - counter_u64_free(stats->rxcsum); - stats->rxcsum = NULL; - } + counter_u64_free(stats->txcsum); + counter_u64_free(stats->tso); + counter_u64_free(stats->rxcsum); } static void @@ -3227,9 +3205,6 @@ vxlan_clone_create(struct if_clone *ifc, int unit, caddr_t params) sc->vxl_unit = unit; sc->vxl_fibnum = curthread->td_proc->p_fibnum; vxlan_set_default_config(sc); - error = vxlan_stats_alloc(sc); - if (error != 0) - goto fail; if (params != 0) { error = copyin(params, &vxlp, sizeof(vxlp)); @@ -3241,6 +3216,7 @@ vxlan_clone_create(struct if_clone *ifc, int unit, caddr_t params) goto fail; } + vxlan_stats_alloc(sc); ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { error = ENOSPC; From nobody Wed Jul 10 14:48:37 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK12F28zcz5QbVR; Wed, 10 Jul 2024 14:48: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 4WK12F1Y5qz4RTD; Wed, 10 Jul 2024 14:48:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720622917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cfX1UR0/dECveDbs5PYXQc32JdsvzQ4bqPVm9HCAtXI=; b=kNBzyPayo0tY9l6PaRDS7Z8VjCcs5NQitzyKLCxR0NXE/LrmuyRmZ22rAHGPTWuBXLTuWt HX55tG7jwQ/2kjR2kSoOeV+ZMGvm1/8it249UmfCZwDf7iK0AZg7bvO5gUGXRXU2aqZUB4 eExnMCUGdmVQpnnEyU1QOqAjhyWGX0g9G2NndE3DMXUakKB29lBBolBcGhYdjRTvhhkZJn Ywl76/4S3K+8BgMi0n9LRmNDtUra1HI861Oy4a29nUQ10+xcT53QLKh2fG7ssIn6ErUzfp KyJnwAaWP91uOIE+YRbgKjzEeULKskxSrmr6e36ChZERRVmM3wrHGLnWOcb10w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720622917; a=rsa-sha256; cv=none; b=ittQ0lSkmpYyJPVlDg7L86D3S+M9MWc7EISrIOSjsfhqWkYZvs+QY/PZ4MI+8GgSqm9rJ2 fA0x5t9Avql6hifgB6uryA307xJyvNpIcU7oQKZ0fNWars4wEdTF1Q9OuaCFPzqt7JWetw itS9gWqQg6JbXAo0/mju0zvLQx+UaEVFer0Ie5fs6CltMCmYsOnHsyANQieEhnxBv1G7G4 ESZ9eJQA4pxaMgI3GXy6UHel2v6FdQrt361mBZl5QTZTZcJa3i3OdUdHnI2bSeT+c9dreO 3ohlYM76gFyA9FieOOqBeTjgDDkH5GjR1akCx8DtJk0Td91esYznv6aIyi45kA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720622917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cfX1UR0/dECveDbs5PYXQc32JdsvzQ4bqPVm9HCAtXI=; b=jHmBTX+5ePJE9T6WFfzebOTkjsi+YBkzZrzEycQ1aB/GadSPhoiuNg1bkfpE9FHS693XuH 64T8xy4ETOp1mG/d5qgXVOMVPZMxII3PoY99ouxd3NmQsW7Pg5CUH28+TBGUUak5dOcfdQ I+05BF7PPl7LoONkcIrr8M0xf8h/LUmIAaggM1hPmy8p4sX7ohi+V94d0AIQhtVGWBI/vb cQ/omzJnBECkZY8PKmkCzzsetalhqX87TPyVVIto88R64ZLGo1bDO3LajPjF0mNLWnXLng ZQHWARSbd9d8msZ/55t9QPjr7oKJPCMPIzjD41wjCDkU4KN3igXwiS2I14VQhQ== 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 4WK12F0ky0zLxb; Wed, 10 Jul 2024 14:48: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 46AEmbZQ029445; Wed, 10 Jul 2024 14:48:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AEmbAZ029442; Wed, 10 Jul 2024 14:48:37 GMT (envelope-from git) Date: Wed, 10 Jul 2024 14:48:37 GMT Message-Id: <202407101448.46AEmbAZ029442@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: fe945fa9c91d - stable/14 - bsd.progs.mk: Create directories first List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fe945fa9c91d12b678e88bb8fd019e60d149bb17 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=fe945fa9c91d12b678e88bb8fd019e60d149bb17 commit fe945fa9c91d12b678e88bb8fd019e60d149bb17 Author: Colin Percival AuthorDate: 2024-07-08 16:30:28 +0000 Commit: Colin Percival CommitDate: 2024-07-10 14:47:52 +0000 bsd.progs.mk: Create directories first Order installdirs before the $p.install targets; this is necessary when a user of also creates the directory into which the binaries are installed. In particular, without this patch running `make installworld -jN` can break when installing tests since the /usr/tests/foo/bar directories are created during installworld; this has been causing the stable/14 weekly snapshot builds to intermittently fail for months. MFC after: 5 minutes Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D45923 (cherry picked from commit 187d696a0aa0fba9e9a7b6b20c72799cf8a2e0cf) --- share/mk/bsd.progs.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk index 946c44f76570..5881570762bf 100644 --- a/share/mk/bsd.progs.mk +++ b/share/mk/bsd.progs.mk @@ -154,6 +154,7 @@ $p.$t: .PHONY .MAKE ${_PROGS_COMMON_OBJS} NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS=t \ ${_PROG_MK.${t}} PROG=$p ${x.$p} ${@:E}) .endfor +.ORDER installdirs $p.install .endfor # Depend main pseudo targets on all PROG.pseudo targets too. From nobody Wed Jul 10 15:11:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK1XJ2DJ9z5QdW0; Wed, 10 Jul 2024 15:11: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 4WK1XJ1m03z4TG8; Wed, 10 Jul 2024 15:11:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720624272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eIWBIr8f+QlY2t2+D1pmh6foZC7XBLFFpO/OeXBLJSQ=; b=TYfIt3Gb5ebYTq7ABjpaS4+DdVL0pLWb/CYQQG3hdNSPhwfxyNgTkGsEuofb9m/NE+0ZwM ylSyKDiEzDr5LG8UtFZ+dV5PlCCOGgM/TUEqFbAWX4G903ym7HOa2svQcPZMPG9nLH7FFa q8wxOpQlYp7a4jadN1wt+D/A1cVsp3SY6GZYnxLZvtuWMf+T7QYR8umhJ70ZPRWL4LcuY7 LdU2xBbxmYkMtrcqRkgSburWzr5CPPtnLEhxof5/6fxiz8AqgLcaMyliU9ZVZ9GIhyGSNu lw7J/CRwcUT/NuX6jio0/EYMSEz0Kv/AI3Nf/CYHncZZp5K66axT/d4EUtn50A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720624272; a=rsa-sha256; cv=none; b=xvaxeWMI8wx7J83XaglQswtEUHtj//D0oFDQlXpJ7o5Y3Lao01vFFb8/li2pQ88owdd7yl +HDQwGbvvItTxx4Z5ELoBeKNroyEhkqdAi3p4LESPtjHmOLPvhXuLcMXmg6+FcmG1wGI8A mTcmF7dquHYAb+uNifM1sEUgsRFaETroTI4NTfkO/CtUjpTOxFLHUDOwYZdsfNpNnzbGAR TUfDweiLW9/Su78ka3mOBAYQg5dCeYgzzwyooQ05y2X84epDD3aQt8GWYGWtNyfKLnNCK0 NzVFDQKjMt28R9O8shmy/QXBqd0AFIBZFSotQt+syIr6M7tG9naCHHOHzezrNQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720624272; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eIWBIr8f+QlY2t2+D1pmh6foZC7XBLFFpO/OeXBLJSQ=; b=U2oVkZm64OZnOnnwGR5Ph7lZiJqfcALoa8y3ecYj+iD3JWDmO0LyH77ObyNSW2Z9pnRHP4 0tjkZbmunOVdKq0wqE6M+GRnKDHGpMRwUtkYyskJRi+ZmNQP+TYabVLKZTNgq820JaD0pk srYBC6b09pBY5hfIzR7VA2WTvA41gq5apHluRlRzQkIrkY6kqQJ7Ij4jRreWRw9o0mqOcH Wc7xLo5seCTu83/3DgitzycIkGSTVsDbD2Lh373m28GRqXhVqbgeJIQfUXr2gfvzXJbFy2 pe3gafZOAM2xVdJWefzH0VBRw2y5DEOcZeijBe2nfAlTBTPSNuU7loAkrAsIMA== 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 4WK1XJ1MHPzMFr; Wed, 10 Jul 2024 15:11: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 46AFBC9D073901; Wed, 10 Jul 2024 15:11:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AFBCqI073898; Wed, 10 Jul 2024 15:11:12 GMT (envelope-from git) Date: Wed, 10 Jul 2024 15:11:12 GMT Message-Id: <202407101511.46AFBCqI073898@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: d0ddcdb13e5f - stable/14 - Fix typo in previous commit List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d0ddcdb13e5fb85716e257cbe0fd870f55eaab4c Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=d0ddcdb13e5fb85716e257cbe0fd870f55eaab4c commit d0ddcdb13e5fb85716e257cbe0fd870f55eaab4c Author: Colin Percival AuthorDate: 2024-07-10 15:08:20 +0000 Commit: Colin Percival CommitDate: 2024-07-10 15:10:58 +0000 Fix typo in previous commit I fixed this when I tested the patch, but apparently forgot to commit the typo fix into my local git tree. ".ORDER" -> ".ORDER:". MFC after: 5 minutes Fixes: 187d696a0aa0 "bsd.progs.mk: Create directories first" Sponsored by: Amazon (cherry picked from commit 19597c02338a01bf1ab3b25409528a1765b13a74) --- share/mk/bsd.progs.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk index 5881570762bf..2c8baa02b9e6 100644 --- a/share/mk/bsd.progs.mk +++ b/share/mk/bsd.progs.mk @@ -154,7 +154,7 @@ $p.$t: .PHONY .MAKE ${_PROGS_COMMON_OBJS} NO_SUBDIR=1 ${MAKE} -f ${MAKEFILE} _RECURSING_PROGS=t \ ${_PROG_MK.${t}} PROG=$p ${x.$p} ${@:E}) .endfor -.ORDER installdirs $p.install +.ORDER: installdirs $p.install .endfor # Depend main pseudo targets on all PROG.pseudo targets too. From nobody Wed Jul 10 16:48:57 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3j61w42z5QmsY; Wed, 10 Jul 2024 16:48: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 4WK3j613Mpz4gDG; Wed, 10 Jul 2024 16:48:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=honuPEOgTEK/gEhRaDKzGWiHMwlRBiNgzOXgGMnEAJ0=; b=FexjkdMpLLHF4bwuBLnoEC1MYyVhOwLFgWNvwYwip6ldzL3YGS38ykSRz8chyubAXuftB5 ZRJPajaHC7dY1AumYDqFKXacFcITpDdeKaj0xXJIHV0v5Irkaj/eA7xBTr10xqXw6hA/EP wfz7gq1c8+FxsatVhCYccT++XTEJeB0haAfWcVj8ats2xa94LAD4qo/sfRBIuJNh17LpT8 ieA3g57UGYfxx/FJ9cc8DHQMNuLLRRVBfqGEVuL5pq8wHk0FHUzY7E+PR20b67xfFt8Ne4 wuBHcPDNfLZlooFaGzhh+2CrjEmO4yxYEkZ7zN0WciazNfIuvDhRm33gj1Poig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630138; a=rsa-sha256; cv=none; b=ns0VCYxeswKP2Vg+OI/2X/HeLSH/ga/VZW+p6E60gVYgaR/dO3EqL+cLmIBErvCJVFQ8OW 4JBMbK2eFctobK8mg0O5qQbDyeBY5PM5UHBTvGDcK9f1uuWVQVnL04Z5redvgm5cFm5Xnr Zcmx0IHM5BXlnmpMRq9DpcuywQuaRuXw2zS7x835wyeFvewo8LoQYd/cBuYUhL0jb5G1s/ m4thSVWUBatAeBWvYoWlL6mbTfqp2hO3a7fFJN/DwV9ZjUiGHmR+U7tr7T/25Cc0OnwRzd IuCGMYaElKP4/ZnybZr+La0uOxISVFt5EhnpUj30SefM3B2Kn8y6vezRYfpaHw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630138; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=honuPEOgTEK/gEhRaDKzGWiHMwlRBiNgzOXgGMnEAJ0=; b=FScgy2Z6JFy5hUUc84QvmjNRAIWsOwHCqRNQeopF7iiLjkHMT5GqGFNUvtXe3Da64bzJhl Rfm1oGz8V5oet0sgN3VsuTOsWQRXn2yz1AMenh41Xj8twzBlhqgIplHs/Z673I4dwJf/xb me2VHvvby8W+J433LG5udq424VKK+NO19lWCKkdc/qtadF1wLxSZyeO6qf5uZ0LIym7QYc ESBn3VpmYU2DvnO6G6CQnciaqIlTKLFpc+yyonpJtAx3FikUfC3PtibMVNw9reUZ1lg4c4 Jo+T94HbIYiadyZTvBzN4NPRpyi32+axILzj+CGs1rZqkvOI0YZdZAx7Ur0Uuw== 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 4WK3j60dnnzQ5Q; Wed, 10 Jul 2024 16:48: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 46AGmval034597; Wed, 10 Jul 2024 16:48:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGmvbs034594; Wed, 10 Jul 2024 16:48:57 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:48:57 GMT Message-Id: <202407101648.46AGmvbs034594@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 6158fa24aca6 - stable/14 - sound: SNDCTL_AUDIOINFO: Do not skip physical channels if VCHANs are disabled List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 6158fa24aca661221defbf5738546ba68697cac8 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6158fa24aca661221defbf5738546ba68697cac8 commit 6158fa24aca661221defbf5738546ba68697cac8 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:08 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:12 +0000 sound: SNDCTL_AUDIOINFO: Do not skip physical channels if VCHANs are disabled Currently, we are skipping physical channels when servicing SNDCTL_AUDIOINFO, and VCHANs when servicing SNDCTL_AUDIOINFO_EX. However, if we call SNDCTL_AUDIOINFO with VCHANs disabled, we'll eventually skip all channels, resulting in some of oss_audioinfo's fields containing wrong information (e.g min/max_channels). Fix this by adding an exception to SNDCTL_AUDIOINFO not to skip physical channels when VCHANs are disabled. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D45722 (cherry picked from commit f30af1f037a68947edbabebc7ab495cd1b7a4ec8) --- sys/dev/sound/pcm/dsp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 0eb41faaae45..6ac85635b080 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2159,9 +2159,13 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai, bool ex) /* * Skip physical channels if we are servicing SNDCTL_AUDIOINFO, * or VCHANs if we are servicing SNDCTL_AUDIOINFO_EX. + * + * For SNDCTL_AUDIOINFO do not skip the physical channels if + * there are no VCHANs. */ if ((ex && (ch->flags & CHN_F_VIRTUAL) != 0) || - (!ex && (ch->flags & CHN_F_VIRTUAL) == 0)) { + ((!ex && (ch->flags & CHN_F_VIRTUAL) == 0) && + (d->pvchancount > 0 || d->rvchancount > 0))) { CHN_UNLOCK(ch); continue; } From nobody Wed Jul 10 16:48:59 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3j729xLz5QmjQ; Wed, 10 Jul 2024 16:48: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 4WK3j71f7wz4gJH; Wed, 10 Jul 2024 16:48:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1bOGys8dtirk7SjOhzROneNTb8lBxiGRPlpXNEf2OTQ=; b=hjrIaaBuVWZ+p89XMeS5+FNPLqXunEU2ZOU4QNP+QlmKl2Hk9SwIYbv3uzcSGw4DRNX8iw i9SsgshCOgAWkXjm72qVoKyMHCa+PVVbHK84Dx4RLlLe/xi85jItyvkg4sqLXCEqAEonpj QXeHRk4MleOrrjoY8XK9hD2GduW27ymennBAyRv9/QAtD9rM0/eCRkApoCADQsCaU/NN/n gLVTLCWdg/kbAtI5NN3vCLiF8qup/c/IWoSiJjhv8vOcQTzc05k2Imbd9O9C5CNa9tY92r q/g6tH+tVSLgQQKOE064LFqsUKNfEJdf0gKIqi/Koqxah0+2l348lw1J/Jpiww== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630139; a=rsa-sha256; cv=none; b=td7U23F2Km0a724CnVEf9WxHHWsWLj2qL8Q2czuUggVzLabmTM5L4YjSXY3JAMc1oPtcey PFsdn0bGdjGmu4Jtw5xbJ1xlUYzvtp+0E/tek9Ph8DEM2FimddOqXUtGCx8mV6WRKzL1zq gLQFS8OwLAAy9OEegIcUxxaMiGIWq63TDwShuYKR9r9KY/Wk9cXQo7ptM/5T1Sh27jLvHs 5TRyLAGAtBKs5RshN4o0zuvcNp98UoXxScFKPqm8cUVGLJbKOjvq+VEssOAQ5EH9zCY/Dy NnELEX8TugkiafILE6qJ8GdzG/dbLzDoE2dnPvoY9/1mLm5mvkMM+3bq/oI9GA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=1bOGys8dtirk7SjOhzROneNTb8lBxiGRPlpXNEf2OTQ=; b=EfKuPAmUcONKLw0o9WkvcvGguX7qFFD2S2A/l5WSi9h+IrqO49hBt456Szpvv222AXd6Or 88sTX2z0Syd+Vkgw2Snp7i0j66hYEVk5HY6da6zWpr4jyaz3PJ/POrKV2MdG0uGfkOP8DM dQRvqL1OhSOpHLuAKA7Ic8r/w59gqAJ9pXHUKTzUPg1sbro/AEzhOvZVsut1Zsuj9GmzRd 2LLVMaeUNloEIMJNGmwn9fCEvtfh38KH6lqEka1rwyRW3z4YPH0mKxrVRnXWmGAKuOX/VH vPcgtmsqYv/q7lpj4W+RkzcL7OUCUBYm3qa4KTMTpK/beOIY3GLdUp+i3sM8/Q== 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 4WK3j71FYDzQFv; Wed, 10 Jul 2024 16:48: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 46AGmxI4034660; Wed, 10 Jul 2024 16:48:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGmxkj034657; Wed, 10 Jul 2024 16:48:59 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:48:59 GMT Message-Id: <202407101648.46AGmxkj034657@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: de8161712e23 - stable/14 - sound: Get rid of snd_sb16 workaround in vchan_create() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: de8161712e2349554529be24c9146a642e282953 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=de8161712e2349554529be24c9146a642e282953 commit de8161712e2349554529be24c9146a642e282953 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:16 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:12 +0000 sound: Get rid of snd_sb16 workaround in vchan_create() The snd_sb16 driver was removed in 716924cb4832 ("Retire snd_sbc ISA sound card driver"). While here, simplify sample rate assignment a bit. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D45662 (cherry picked from commit d6d4586b0b7e3b01812e6c26818af78bf9b680a3) --- sys/dev/sound/pcm/vchan.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 528c6fa62621..fa4fa2023b71 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -768,25 +768,10 @@ vchan_create(struct pcm_channel *parent) &vchanspd); CHN_LOCK(parent); if (r != 0) { - /* - * No saved value, no hint, NOTHING. - * - * Workaround for sb16 running - * poorly at 45k / 49k. - */ - switch (parent_caps->maxspeed) { - case 45000: - case 49000: - vchanspd = 44100; - break; - default: - vchanspd = VCHAN_DEFAULT_RATE; - if (vchanspd > parent_caps->maxspeed) - vchanspd = parent_caps->maxspeed; - break; - } - if (vchanspd < parent_caps->minspeed) - vchanspd = parent_caps->minspeed; + /* No saved value, no hint, NOTHING. */ + vchanspd = VCHAN_DEFAULT_RATE; + RANGE(vchanspd, parent_caps->minspeed, + parent_caps->maxspeed); } save = 1; } @@ -795,10 +780,7 @@ vchan_create(struct pcm_channel *parent) /* * Limit the speed between feeder_rate_min <-> feeder_rate_max. */ - if (vchanspd < feeder_rate_min) - vchanspd = feeder_rate_min; - if (vchanspd > feeder_rate_max) - vchanspd = feeder_rate_max; + RANGE(vchanspd, feeder_rate_min, feeder_rate_max); if (feeder_rate_round) { RANGE(vchanspd, parent_caps->minspeed, From nobody Wed Jul 10 16:49:00 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3j84w66z5QmsZ; Wed, 10 Jul 2024 16:49: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 4WK3j82cxnz4g59; Wed, 10 Jul 2024 16:49:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LvYPkIHwsTMS9/1rnG6A/IlGTEzNnUeLguFkpN9dn0U=; b=DjmzsaZgqynvrhWppMMUb2SHh593vDgSFzt4g2rCsNOJlSNGcNO/jgK/NCuQGexu/k7HBA VpcrxqGzQXnJHWQCeQwA2q07JkwSaqFfdd2MTPUrmul1xUwKoKcPgbVamOsbCTgAMIQFlu zQHEOFxyHfnjsIha0FLp6ihYSaPxV/JfrmHtOWz6cZdEeDLxI95BEa2siizrMEvALodDPG 7ZFoVt1rpeht7fl4A68tFu3WQ/ZLfiZKVN3XddUfc1MaEI18giblt2GAdTIEOWPsqAxQph jfRLTaaaKu/c5ilkMMWFEuJ47uAYNo61JdPY6Ty4EoiL3labjDC5o/6rPj1y5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630140; a=rsa-sha256; cv=none; b=SN5c0pcT0/dhJT2U7QZ1+oueVVhmbL74E9W3kdoxRe9w1fFnIU9tKTqfiIkWV9x6/l1X63 Yy+nbm9tnk8hOyogGJ2hIzhm1RSjtMTdqP7RIxWIIh8qwazfmf+j/Moz+elxn3bUdZPVVS 4Ad3467SpkkLg5Fo46PZ4QVhrlHuG0cmBn9Wk6L21fe57EULMCKZoDTNYYrTKt59Kokbm8 VfT8FqoOQkxYxeS7NXc7Pnc+z0fEzT7dpPRgbUI5aCaZEcnR+AgWjiOdFjjsJxQ3eU4xd3 Xm7w1vR+znPxmp7mU+aXwybwi9xIrWqbUlJJmvvq6PkOLT5q3BA3gJzvcuKYJA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LvYPkIHwsTMS9/1rnG6A/IlGTEzNnUeLguFkpN9dn0U=; b=CiuTAW3PpUn0p967QcKSNmhjrc4ls079sIeob5+naP7qcBdzFANTWw0u6lOa9L5scx2h3f XqgwlsxXMdbR22OTbzcAMlZ8jnCwZsh4I+l3FCPoLErNQlydzyD+A8JhzjOIDKN4h39N4D 8oYVPhmRMgYGe4Ds+8AzCjbOPK6hfYIu9KNskMWPNRU/CSKUBLFB0po4WhyPC8TlaQvTQ3 wWy0iGUkCn1YjWlpamqlWm3tYiW+b9fXiF0ZYAiVAz4WkOI+iEtnG8NXwcs7zmfs+OE1w9 Fk0nu+SiI5za5y82iYcGlF0OZU7qaoeKwgeEKMLkcoICaEDqLSS//KIsxfiDFQ== 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 4WK3j82FKFzPmX; Wed, 10 Jul 2024 16:49: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 46AGn02V034715; Wed, 10 Jul 2024 16:49:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGn0Da034712; Wed, 10 Jul 2024 16:49:00 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:00 GMT Message-Id: <202407101649.46AGn0Da034712@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: c9d9975cd4dd - stable/14 - sound: Fix lock order reversals in mseq_open() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: c9d9975cd4dd85414c4bc1e5cafb118544d5b4e7 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=c9d9975cd4dd85414c4bc1e5cafb118544d5b4e7 commit c9d9975cd4dd85414c4bc1e5cafb118544d5b4e7 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:21 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:12 +0000 sound: Fix lock order reversals in mseq_open() Opening /dev/sequencer after a clean reboot yields: lock order reversal: (sleepable after non-sleepable) 1st 0xfffffe004a2c2c08 seqflq (seqflq, sleep mutex) @ /mnt/src/sys/dev/sound/midi/sequencer.c:754 2nd 0xffffffff84197ed8 midistat lock (midistat lock, sx) @ /mnt/src/sys/dev/sound/midi/midi.c:1478 lock order seqflq -> midistat lock attempted at: 0xffffffff811c9029 at witness_checkorder+0x12b9 0xffffffff810f18a7 at _sx_xlock+0xf7 0xffffffff8417f992 at midimapper_open+0x22 0xffffffff84182770 at mseq_open+0xf0 0xffffffff80e3380f at devfs_open+0x30f 0xffffffff81b8b4b7 at VOP_OPEN_APV+0x57 0xffffffff812da1e7 at vn_open_vnode+0x397 0xffffffff812d96b3 at vn_open_cred+0xb23 0xffffffff812c2c6b at openatfp+0x52b 0xffffffff812c2711 at sys_openat+0x81 0xffffffff84110579 at filemon_wrapper_openat+0x19 0xffffffff81a223ae at amd64_syscall+0x39e 0xffffffff819dd0eb at fast_syscall_common+0xf8 Expose midistat_lock to midi/midi.c so that we can acquire the lock from mseq_open() before we lock seq_lock, and introduce _locked variants of midimapper_open() and midimapper_fetch_synth(). Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D45770 (cherry picked from commit fc76e24e583d45a3a59fd7ad4e603c0679eaf572) --- sys/dev/sound/midi/midi.c | 41 ++++++++++++++++++++++++++++++++--------- sys/dev/sound/midi/midi.h | 4 ++++ sys/dev/sound/midi/sequencer.c | 8 ++++++-- 3 files changed, 42 insertions(+), 11 deletions(-) diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index 8dd4546d58c5..dab8fe559a0d 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -182,7 +182,8 @@ TAILQ_HEAD(, snd_midi) midi_devs; * /dev/midistat variables and declarations, protected by midistat_lock */ -static struct sx midistat_lock; +struct sx midistat_lock; + static int midistat_isopen = 0; static struct sbuf midistat_sbuf; static struct cdev *midistat_dev; @@ -1471,16 +1472,28 @@ midimapper_addseq(void *arg1, int *unit, void **cookie) } int -midimapper_open(void *arg1, void **cookie) +midimapper_open_locked(void *arg1, void **cookie) { int retval = 0; struct snd_midi *m; - sx_xlock(&midistat_lock); + sx_assert(&midistat_lock, SX_XLOCKED); TAILQ_FOREACH(m, &midi_devs, link) { retval++; } + + return retval; +} + +int +midimapper_open(void *arg1, void **cookie) +{ + int retval; + + sx_xlock(&midistat_lock); + retval = midimapper_open_locked(arg1, cookie); sx_xunlock(&midistat_lock); + return retval; } @@ -1491,22 +1504,32 @@ midimapper_close(void *arg1, void *cookie) } kobj_t -midimapper_fetch_synth(void *arg, void *cookie, int unit) +midimapper_fetch_synth_locked(void *arg, void *cookie, int unit) { struct snd_midi *m; int retval = 0; - sx_xlock(&midistat_lock); + sx_assert(&midistat_lock, SX_XLOCKED); TAILQ_FOREACH(m, &midi_devs, link) { - if (unit == retval) { - sx_xunlock(&midistat_lock); + if (unit == retval) return (kobj_t)m->synth; - } retval++; } - sx_xunlock(&midistat_lock); + return NULL; } +kobj_t +midimapper_fetch_synth(void *arg, void *cookie, int unit) +{ + kobj_t synth; + + sx_xlock(&midistat_lock); + synth = midimapper_fetch_synth_locked(arg, cookie, unit); + sx_xunlock(&midistat_lock); + + return synth; +} + DEV_MODULE(midi, midi_modevent, NULL); MODULE_VERSION(midi, 1); diff --git a/sys/dev/sound/midi/midi.h b/sys/dev/sound/midi/midi.h index 567279d1e654..b200eed9bc74 100644 --- a/sys/dev/sound/midi/midi.h +++ b/sys/dev/sound/midi/midi.h @@ -41,6 +41,8 @@ MALLOC_DECLARE(M_MIDI); #define MIDI_TYPE unsigned char +extern struct sx midistat_lock; + struct snd_midi; struct snd_midi * @@ -50,8 +52,10 @@ int midi_out(struct snd_midi *_m, MIDI_TYPE *_buf, int _size); int midi_in(struct snd_midi *_m, MIDI_TYPE *_buf, int _size); kobj_t midimapper_addseq(void *arg1, int *unit, void **cookie); +int midimapper_open_locked(void *arg1, void **cookie); int midimapper_open(void *arg1, void **cookie); int midimapper_close(void *arg1, void *cookie); +kobj_t midimapper_fetch_synth_locked(void *arg, void *cookie, int unit); kobj_t midimapper_fetch_synth(void *arg, void *cookie, int unit); #endif diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c index a943e02030aa..3e4c7cf3edf8 100644 --- a/sys/dev/sound/midi/sequencer.c +++ b/sys/dev/sound/midi/sequencer.c @@ -65,6 +65,7 @@ #include #include #include +#include #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_snd.h" @@ -752,6 +753,7 @@ mseq_open(struct cdev *i_dev, int flags, int mode, struct thread *td) * Mark this device busy. */ + sx_xlock(&midistat_lock); mtx_lock(&scp->seq_lock); if (scp->busy) { mtx_unlock(&scp->seq_lock); @@ -769,14 +771,15 @@ mseq_open(struct cdev *i_dev, int flags, int mode, struct thread *td) * Enumerate the available midi devices */ scp->midi_number = 0; - scp->maxunits = midimapper_open(scp->mapper, &scp->mapper_cookie); + scp->maxunits = midimapper_open_locked(scp->mapper, &scp->mapper_cookie); if (scp->maxunits == 0) SEQ_DEBUG(2, printf("seq_open: no midi devices\n")); for (i = 0; i < scp->maxunits; i++) { scp->midis[scp->midi_number] = - midimapper_fetch_synth(scp->mapper, scp->mapper_cookie, i); + midimapper_fetch_synth_locked(scp->mapper, + scp->mapper_cookie, i); if (scp->midis[scp->midi_number]) { if (SYNTH_OPEN(scp->midis[scp->midi_number], scp, scp->fflags) != 0) @@ -788,6 +791,7 @@ mseq_open(struct cdev *i_dev, int flags, int mode, struct thread *td) } } } + sx_xunlock(&midistat_lock); timer_setvals(scp, 60, 100); From nobody Wed Jul 10 16:49:01 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3j95HbDz5QmgN; Wed, 10 Jul 2024 16:49: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 4WK3j949mrz4g3X; Wed, 10 Jul 2024 16:49:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GmvUDM95/TKjjK7TBKCjoe3Lh9jrOWM4m4/Z34KfPNQ=; b=iPuzJk/EwWtgvJNLdw9Z/KW78cZJXbseGG3hyn1DdG90W0yzppWrgLjp8UjRSzBpZWq9s4 CdYA4p/GO8XeOu7HXCQn7xrzQTipR23pymCps+Gk4TxBM/yhZMxtOmTlKBuDLMwUjW/40w L6bmxV3fhex5AaBqPmB+p9A2JeRAwR0U6g43XhVVkspiKwUI02iQGeZtAse5fe8VlW3gRS ymXdL5agvMeI3A+5TfunYWMCh08xVZjURiTP9fSFt7mbuPH+iy9UjMEJFnvCjqSZwu7rZl 3hDalJ+gyTn+5891O3U/b5KJPUurpsmOpebSVoKfRWEF8DffAyS4NhCUbopAeA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630141; a=rsa-sha256; cv=none; b=gNTvDKD6eWIZJdII6KEHuJcoUL1g2GWsJy3d0HOvxKRwuoBUHzOSmM8DGj55V5zkZmMw7/ o6PhISSQQWhuxAG4MtPC6zKUtUIsuBecQ/1uxCXawIcOMBd71V6FaM2/Du5YzKKXcGiFH+ //CwpgHeUU4GQq8Tnxa3w/YQbgrda1QyqieK6LY7L2FT1DDf8/596w3FZ71FmSv1sk3RZ7 ymCyJfg2DgmSjtJAPOt+pkOGvpe4pt19uKaUtghAiOsG/ds4Kd9GFnLDs89b8WX1VSDIbF Dh8G42hjbDy8K7q9MBn66wneHRdFdt+IcReB4Gs6qFvg5oWDpG9XxIYxS+AIgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GmvUDM95/TKjjK7TBKCjoe3Lh9jrOWM4m4/Z34KfPNQ=; b=ZdjEMyglpklwBs3Oq3NhH9MqyqfVEJoTcz53Yb3AkRf0Ai7xMAAdYfLb1s8jFMN6GZHa22 2DlT85cfxmtHnpQo45GY4+xYKquO+f6I1PQAZOC2szl5HvElyuloysT5lNR6utaW8uQuWn luyNIfFx+qMJ1xVkUUXUgKl552r46ECuvVUlSKfRsW1+terceqEIxxDzSnjHYqM8KFHK2A lG7sn0LDv8Us9+iDWkRsc1azZmFd+nt3Gjle6zL+sVrI/Pdi8L4y2/726kqJRZPn5qtUdX Gf24O38sGZpu964djidwcRPjPRO7368s8WX38b9opcS+eZA69FubQJ6YvnZpAw== 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 4WK3j93VrqzQ3N; Wed, 10 Jul 2024 16:49: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 46AGn1aG034758; Wed, 10 Jul 2024 16:49:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGn1hT034755; Wed, 10 Jul 2024 16:49:01 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:01 GMT Message-Id: <202407101649.46AGn1hT034755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: cccdc51d98f9 - stable/14 - snd_uaudio: Remove unused sc_sndstat sbuf List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: cccdc51d98f9ca6bcab996830e9cecaaa4bd43e9 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=cccdc51d98f9ca6bcab996830e9cecaaa4bd43e9 commit cccdc51d98f9ca6bcab996830e9cecaaa4bd43e9 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:26 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:12 +0000 snd_uaudio: Remove unused sc_sndstat sbuf This information is also printed to dmesg(8) on attach. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45771 (cherry picked from commit 3402d474ceb8541d07689bad6960f90739129997) --- sys/dev/sound/usb/uaudio.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c index d47eb86ed271..c202ac581119 100644 --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -368,7 +368,6 @@ struct uaudio_softc_child { }; struct uaudio_softc { - struct sbuf sc_sndstat; struct sndcard_func sc_sndcard_func; struct uaudio_chan sc_rec_chan[UAUDIO_MAX_CHILD]; struct uaudio_chan sc_play_chan[UAUDIO_MAX_CHILD]; @@ -391,7 +390,6 @@ struct uaudio_softc { uint8_t sc_mixer_iface_index; uint8_t sc_mixer_iface_no; uint8_t sc_mixer_chan; - uint8_t sc_sndstat_valid:1; uint8_t sc_uq_audio_swap_lr:1; uint8_t sc_uq_au_inp_async:1; uint8_t sc_uq_au_no_xu:1; @@ -1293,8 +1291,6 @@ uaudio_detach(device_t dev) if (bus_generic_detach(dev) != 0) { DPRINTF("detach failed!\n"); } - sbuf_delete(&sc->sc_sndstat); - sc->sc_sndstat_valid = 0; umidi_detach(dev); @@ -2149,15 +2145,6 @@ uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev, if (rate > chan->pcm_cap.maxspeed || chan->pcm_cap.maxspeed == 0) chan->pcm_cap.maxspeed = rate; - if (sc->sc_sndstat_valid != 0) { - sbuf_printf(&sc->sc_sndstat, "\n\t" - "mode %d.%d:(%s) %dch, %dbit, %s, %dHz", - curidx, alt_index, - (ep_dir == UE_DIR_IN) ? "input" : "output", - channels, p_fmt->bPrecision, - p_fmt->description, rate); - } - next_ep: sed.v1 = NULL; ed1 = NULL; @@ -2230,9 +2217,6 @@ uaudio_chan_fill_info(struct uaudio_softc *sc, struct usb_device *udev) if (channels == 0) channels = channels_max; - if (sbuf_new(&sc->sc_sndstat, NULL, 4096, SBUF_AUTOEXTEND)) - sc->sc_sndstat_valid = 1; - /* try to search for a valid config */ for (x = channels; x; x--) { @@ -2263,8 +2247,6 @@ uaudio_chan_fill_info(struct uaudio_softc *sc, struct usb_device *udev) if (x == (channels + 1)) x--; } - if (sc->sc_sndstat_valid) - sbuf_finish(&sc->sc_sndstat); } static void From nobody Wed Jul 10 16:49:02 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3jB5QNhz5QmpG; Wed, 10 Jul 2024 16:49: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 4WK3jB4Y40z4gPK; Wed, 10 Jul 2024 16:49:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rnhQaF2LWQ+Zh9BNAwu38v4+D3lJE2sR46EFUHB7ciU=; b=NTFx2dlYH+w6yNr4OtwVnuAzdL8vhhDOjKROaTMJijYcsaYaU2CrOt9hsuDc5EyOHcXZG0 Q+6wFL7xihuvvaLfE6W1Iha03PPbKuwQzIFa/1u4xUvoDRbhlur2Ys7r5E2S5NwylWwvha Q1jk62RBiIdT2I8zu9iU5hxyY5PrICu/j7PYGOuBlNcsKgssKA9NURK8Dysxk+xF3YwiIP QYBUlaA8QvRR5RM2PCS5XFLK2fCj0Cy7KBJ0QV4qvKJXYaI2ewpc2hDC7rN+qXD6BoATwV Ae1N8t2tqdum43W+NVqb0RqmrzrIc4TMP1QTgjTNSFIoXcQ1aXcpFQbr1CLoeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630142; a=rsa-sha256; cv=none; b=E53uitltG6WoOvhlxmHFzRsmR3kWEghgQrZmQId6tK6JcaW2uDL5l4nSCCuiLlIu00ddVs SDBcRjsaH3cmVFYwFyg6pyjukCG4Xg3Oz3RE+izPdQHEMrPTXLSm2Ej5kWEnZn85WBRfBW hM+jA1MSU8wj690tzD6lB6hwvvb7TLLYUU0CI/1acKtE2hzfhz/qB2JJ/eoBxEqjj9yyW3 Ae/akJLlmLPAgXqp26JEjklSRZVSz4k3kFiF+zsCqT8KtG7yCueX5ymGJOIHfbFy3OkwqB GE1+lHQwszNPj+a/UM/HHP7AJSxxOrbcmtu0Ub/UJPUAfRr0yuvYE+tbfkY8bg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rnhQaF2LWQ+Zh9BNAwu38v4+D3lJE2sR46EFUHB7ciU=; b=T+tlYR3ACnoTJxgXh0ZE8IOpwxNq1xpJIKINz70zgs053MNGVLyfGiTEO6R3+nkLCUcsvL /Nt9Tb3QcwVPFQPL2xndE3MF3eGTGWTBMjVORRquj0VBYI7yWjfFh0EF/0bvQaZHDT89Tq 3LWJwGDSywEPhWs7TXMDcBW6GI/gBohXRRH9UCixL8Eu0xwYAYx8pzuMft8r9i2VVHcwFK YtMWmB1sTmFxYJapYFXW5vaJuKPw4FznYmqhzcVRXuRmyklla+buJjJgNYosLP+7ZVw3AL UsJSvXz2p1UQanQb2kffUHmy4Ktlii04IKpZqyhhHhhMpNxkviJI8m5/Hvl3Lw== 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 4WK3jB49RdzPYT; Wed, 10 Jul 2024 16:49: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 46AGn2fh034812; Wed, 10 Jul 2024 16:49:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGn2R6034809; Wed, 10 Jul 2024 16:49:02 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:02 GMT Message-Id: <202407101649.46AGn2R6034809@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 2baf2b2f1042 - stable/14 - sound: Remove MIDI_TYPE List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 2baf2b2f104235118d065a2bffba41d3f7bf54af Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=2baf2b2f104235118d065a2bffba41d3f7bf54af commit 2baf2b2f104235118d065a2bffba41d3f7bf54af Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:31 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:12 +0000 sound: Remove MIDI_TYPE No good reason to have this. It only makes things harder to read. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45773 (cherry picked from commit 526bd1d87ec997e1c090262da6f2d9b6da0e8f89) --- sys/dev/sound/midi/midi.c | 12 ++++++------ sys/dev/sound/midi/midi.h | 6 ++---- sys/dev/sound/midi/mpu401.c | 2 +- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index dab8fe559a0d..21b319a5f18f 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -282,7 +282,7 @@ midi_init(kobj_class_t cls, int unit, int channel, void *cookie) struct snd_midi *m; int i; int inqsize, outqsize; - MIDI_TYPE *buf; + uint8_t *buf; MIDI_DEBUG(1, printf("midiinit: unit %d/%d.\n", unit, channel)); sx_xlock(&midistat_lock); @@ -331,14 +331,14 @@ midi_init(kobj_class_t cls, int unit, int channel, void *cookie) mtx_lock(&m->qlock); if (inqsize) - buf = malloc(sizeof(MIDI_TYPE) * inqsize, M_MIDI, M_NOWAIT); + buf = malloc(sizeof(uint8_t) * inqsize, M_MIDI, M_NOWAIT); else buf = NULL; MIDIQ_INIT(m->inq, buf, inqsize); if (outqsize) - buf = malloc(sizeof(MIDI_TYPE) * outqsize, M_MIDI, M_NOWAIT); + buf = malloc(sizeof(uint8_t) * outqsize, M_MIDI, M_NOWAIT); else buf = NULL; m->hiwat = outqsize / 2; @@ -449,12 +449,12 @@ static int midi_lengths[] = {2, 2, 2, 2, 1, 1, 2, 0}; #define MIDI_SYSEX_END 0xF7 int -midi_in(struct snd_midi *m, MIDI_TYPE *buf, int size) +midi_in(struct snd_midi *m, uint8_t *buf, int size) { /* int i, sig, enq; */ int used; - /* MIDI_TYPE data; */ + /* uint8_t data; */ MIDI_DEBUG(5, printf("midi_in: m=%p size=%d\n", m, size)); /* @@ -579,7 +579,7 @@ midi_in(struct snd_midi *m, MIDI_TYPE *buf, int size) * midi_out: The only clearer of the M_TXEN flag. */ int -midi_out(struct snd_midi *m, MIDI_TYPE *buf, int size) +midi_out(struct snd_midi *m, uint8_t *buf, int size) { int used; diff --git a/sys/dev/sound/midi/midi.h b/sys/dev/sound/midi/midi.h index b200eed9bc74..afbfdfa6abbc 100644 --- a/sys/dev/sound/midi/midi.h +++ b/sys/dev/sound/midi/midi.h @@ -39,8 +39,6 @@ MALLOC_DECLARE(M_MIDI); #define M_RXEN 0x04 #define M_TXEN 0x08 -#define MIDI_TYPE unsigned char - extern struct sx midistat_lock; struct snd_midi; @@ -48,8 +46,8 @@ struct snd_midi; struct snd_midi * midi_init(kobj_class_t _mpu_cls, int _unit, int _channel, void *cookie); int midi_uninit(struct snd_midi *_m); -int midi_out(struct snd_midi *_m, MIDI_TYPE *_buf, int _size); -int midi_in(struct snd_midi *_m, MIDI_TYPE *_buf, int _size); +int midi_out(struct snd_midi *_m, uint8_t *_buf, int _size); +int midi_in(struct snd_midi *_m, uint8_t *_buf, int _size); kobj_t midimapper_addseq(void *arg1, int *unit, void **cookie); int midimapper_open_locked(void *arg1, void **cookie); diff --git a/sys/dev/sound/midi/mpu401.c b/sys/dev/sound/midi/mpu401.c index 1152c117f7f6..8a97016b27c7 100644 --- a/sys/dev/sound/midi/mpu401.c +++ b/sys/dev/sound/midi/mpu401.c @@ -119,7 +119,7 @@ static int mpu401_intr(struct mpu401 *m) { #define MPU_INTR_BUF 16 - MIDI_TYPE b[MPU_INTR_BUF]; + uint8_t b[MPU_INTR_BUF]; int i; int s; From nobody Wed Jul 10 16:49:03 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3jD0DXLz5QmmG; Wed, 10 Jul 2024 16: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 4WK3jC5BkRz4gF6; Wed, 10 Jul 2024 16: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=1720630143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5XD04IQRxhl6J4KueXql2YtzGbXVqn0vXSBYOqYzh50=; b=gWCwno6W/TbsxzoeAenoC+gz0JsJtISvxzybY+M6wqrJrit4mUz1m24uv/rbo5CbyESzz3 v3iCLY5R+VphIR8jqenP3lQqbKTYOT1E5plPj62qIqbQ5+LwcTYkQADHf5Q7vx2nLgSeax BV3LNl90jSdcYWRlMXqJy/PfmkWfyNd4zXAv44SzMEwisXBB7pVex8sDnbg4Oubuaa/SFX yj+FmyUs7PkuahThl2ZnwZVe4TzJSx+k7XdZu46G16QneU3jRGi5OnKqo3qwYpiZO8bxJy GfUhERfhkPeyIenc7qbzheBwePrasM3tUnkiS1PxO6JVDezyg8PWNBu2yAdWtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630143; a=rsa-sha256; cv=none; b=yTwYZ97vLPtWAncmiCnkk0eGMT4tv4duxSmJKG2D+NNdB6UF+EMHruDbR4ZLTWsoOXFN2k DOkuIfZazi4RSdgbtrdgvwUnP0BNb4z2BmTHYYh+HPatMF+GnDzy3Rgkdf3P99dLNq3gf0 Redaz3/1ffjl3fEM257EVJP3557MVjijJKiyaQaAnuz0cohEhz1eP8FvrC9/CDMXed1+mK k5mRhQEjRjI+EGF+0ABXI6GDcumaNBmTWlI1lGS+I9yZphp+n+DU8kyX8EXX3NPIlf6pW+ 305MdgyG7WAxdy8aSxmBuqib1XnUbgwv96Mz02g+DHauXSdeugaVEFKZnyFOuQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5XD04IQRxhl6J4KueXql2YtzGbXVqn0vXSBYOqYzh50=; b=ZqsvIQK+Ve9+EVGtkeHgUY4BTMdm1bzfyXt/wFAIWE3U21Aso5ghLNjFt1DYzsYNZGr8ZB Yl05R42IOqZsV8WrPnHhwti0kW5DzlLAmPJqaEdvCiZhqieslXkwnL9b+GhiDRPa1hR9vn pVvWnU6S9JcbU1cinMK+9DVjKekfrZl8aqLL6DGGSrHA4evTYcY0IWFZjnEd9RRbOxkGuh bvAfwUNUzBjhpgwFUEkmJ/17RsF06VOb4aGJsBM5PfEuU29Zu0jJGeEcHZTuh6GgZE6QiA DAY0Nck6ZXoCzdBvTsDW9tHVYkxYMIXI6ef/zZTcrhmPmUd+H8j8uAeE0/MOxQ== 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 4WK3jC4ms1zPmY; Wed, 10 Jul 2024 16: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 46AGn394034855; Wed, 10 Jul 2024 16: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 46AGn3U5034852; Wed, 10 Jul 2024 16:49:03 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:03 GMT Message-Id: <202407101649.46AGn3U5034852@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: ad2934215435 - stable/14 - sound: Remove *MINOR from midi/ List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: ad2934215435a7ae565149f8225cf9453ee824a6 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ad2934215435a7ae565149f8225cf9453ee824a6 commit ad2934215435a7ae565149f8225cf9453ee824a6 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:36 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:12 +0000 sound: Remove *MINOR from midi/ Sponsored by: The FreeBSD Foundation MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D45772 (cherry picked from commit 8b9e1b628064daba3650d04fa83cf79808877981) --- sys/dev/sound/midi/midi.c | 14 ++++---------- sys/dev/sound/midi/sequencer.c | 12 +++--------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index 21b319a5f18f..2dcd64625b6c 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -74,10 +74,6 @@ MALLOC_DEFINE(M_MIDI, "midi buffers", "Midi data allocation area"); #define KOBJMETHOD_END { NULL, NULL } #endif -#define PCMMKMINOR(u, d, c) ((((c) & 0xff) << 16) | (((u) & 0x0f) << 4) | ((d) & 0x0f)) -#define MIDIMKMINOR(u, d, c) PCMMKMINOR(u, d, c) - -#define MIDI_DEV_RAW 2 #define MIDI_DEV_MIDICTL 12 enum midi_states { @@ -365,9 +361,8 @@ midi_init(kobj_class_t cls, int unit, int channel, void *cookie) sx_xunlock(&midistat_lock); - m->dev = make_dev(&midi_cdevsw, - MIDIMKMINOR(unit, MIDI_DEV_RAW, channel), - UID_ROOT, GID_WHEEL, 0666, "midi%d.%d", unit, channel); + m->dev = make_dev(&midi_cdevsw, unit, UID_ROOT, GID_WHEEL, 0666, + "midi%d.%d", unit, channel); m->dev->si_drv1 = m; return m; @@ -1388,9 +1383,8 @@ midi_load(void) sx_init(&midistat_lock, "midistat lock"); TAILQ_INIT(&midi_devs); - midistat_dev = make_dev(&midistat_cdevsw, - MIDIMKMINOR(0, MIDI_DEV_MIDICTL, 0), - UID_ROOT, GID_WHEEL, 0666, "midistat"); + midistat_dev = make_dev(&midistat_cdevsw, MIDI_DEV_MIDICTL, UID_ROOT, + GID_WHEEL, 0666, "midistat"); return 0; } diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c index 3e4c7cf3edf8..ec99fdea4637 100644 --- a/sys/dev/sound/midi/sequencer.c +++ b/sys/dev/sound/midi/sequencer.c @@ -92,10 +92,6 @@ #define LOOKUP_OPEN (1) #define LOOKUP_CLOSE (2) -#define PCMMKMINOR(u, d, c) \ - ((((c) & 0xff) << 16) | (((u) & 0x0f) << 4) | ((d) & 0x0f)) -#define MIDIMKMINOR(u, d, c) PCMMKMINOR(u, d, c) -#define MIDIUNIT(y) ((dev2unit(y) >> 4) & 0x0f) #define MIDIDEV(y) (dev2unit(y) & 0x0f) /* These are the entries to the sequencer driver. */ @@ -568,12 +564,10 @@ seq_addunit(void) if (scp->mapper == NULL) goto err; - scp->seqdev = make_dev(&seq_cdevsw, - MIDIMKMINOR(scp->unit, SND_DEV_SEQ, 0), UID_ROOT, - GID_WHEEL, 0666, "sequencer%d", scp->unit); + scp->seqdev = make_dev(&seq_cdevsw, SND_DEV_SEQ, UID_ROOT, GID_WHEEL, + 0666, "sequencer%d", scp->unit); - scp->musicdev = make_dev(&seq_cdevsw, - MIDIMKMINOR(scp->unit, SND_DEV_MUSIC, 0), UID_ROOT, + scp->musicdev = make_dev(&seq_cdevsw, SND_DEV_MUSIC, UID_ROOT, GID_WHEEL, 0666, "music%d", scp->unit); if (scp->seqdev == NULL || scp->musicdev == NULL) From nobody Wed Jul 10 16:49:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3jG1WVMz5Qmcq; Wed, 10 Jul 2024 16: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 4WK3jF6hBSz4gN1; Wed, 10 Jul 2024 16: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=1720630146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hKu+HmUeqRQNjTJ1M8jLook9l1g7/66TWN34Yf+KXtw=; b=MUgbOIlv0l7WniAYy947MabLDO+s1fKejsB0o5kLnVBubGzGiCaxAyD1ANhlpRBMgjT2JG ycMI28wkM+ezuurxgY/fpSdP3uhKnCnDxKwtld63fzSCL38NORC6Ki5lAbsfC4GTRUT9p6 g3PS2CBCAeLDhhFDcLavisBEocNY5sP/lmifaWwCbBEN/yJr0bBB81q2T3IsuoBZUnCiLP XS2UDfRMk8L6TmShUV98QjtrnNsn67+ZUiiERl/AQWAqHhzF6vjN1ifcyGjVfbUuG00QN/ +fs7xDPMhcn+00ce74LRNQQviP3MyaS163Vfdts9YqLqo+N4MmX2NG/lKAbmiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630146; a=rsa-sha256; cv=none; b=wBYnPNerj3NZWa+m5DvVDpbklf/z5DU1v5sj84C9gWSxmvscZrXGJ0AAuihx9E1BAv9bZ3 sVtNx0NcEHTSniSY/g1t42mVLZ71pGluCx6nPluOSRottklWA8KBxrYbtst4EIetoPiLOa v5GkYbk3tSAGKZDOhqMnhi0s1i+eDWfzvgG9DEMUXSrVuUxQuAYTlH3UvTgMcQbzwjKz/9 o0SzLDRu8nitzOuy2X59JkxvuaVSR/d2OCd6Mx1HMdNz1uWnfjzZUiVruaikley+mWRxRV mAhKvOWg7uj+JB4DYDk+lCddsDal/KohMqXk+8QbM9k80Wz95YGZUZoce4zYPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hKu+HmUeqRQNjTJ1M8jLook9l1g7/66TWN34Yf+KXtw=; b=l6u1kBnNUORI9e7R9CsClxfISG2nsI05EwQB/ZGE0+a/nFVSsH2D841nsuTAhNnv2M59YW fnlhjZ8zz6nBtkyJ4YHmSs4liQK2uV+nQ4NKzGPPU6CBJmpbTagyyN5k6VXswRLueMCVdG vnJUJm35I2oaXPyuVVts+KV4ae1MREKvmbMprOhMlJBzeRV6428E6kA0kewjbFAEuMqHks qMZnnuca3m2X0YiuecYNahw1m19Qo3nmME7kT94m7EJjbEE/nomQk0FPZ1rWdmHthlaXc2 RCiGW9+t4Y4Ln07pXBKtdbf2tqhJsMs+NJxh1Ds8Sc/EOHvIoedMHl1qnMBwYQ== 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 4WK3jF6DgVzPWC; Wed, 10 Jul 2024 16: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 46AGn57Y034941; Wed, 10 Jul 2024 16: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 46AGn5DD034938; Wed, 10 Jul 2024 16:49:05 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:05 GMT Message-Id: <202407101649.46AGn5DD034938@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 6378079427be - stable/14 - sound: Improve simplex handling in dsp_open() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 6378079427be35962d36a8e9b587eb63b1159e99 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6378079427be35962d36a8e9b587eb63b1159e99 commit 6378079427be35962d36a8e9b587eb63b1159e99 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:45 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:13 +0000 sound: Improve simplex handling in dsp_open() If we are in simplex mode, make sure we do not open in both directions (read/write) and also that we do not open in a direction opposite of what is already opened. For example, if the device is already doing playback, we cannot open the device for recording at the same time, and vice-versa. While here, remove dsp_cdevpriv->simplex as it's no longer needed. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45835 (cherry picked from commit be04a9d9387f6b5d4e83fc4976d8d83bb03fe5af) --- sys/dev/sound/pcm/dsp.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index f2cead08783c..26a2919ed1da 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -52,7 +52,6 @@ struct dsp_cdevpriv { struct pcm_channel *rdch; struct pcm_channel *wrch; struct pcm_channel *volch; - int simplex; }; static int dsp_mmap_allow_prot_exec = 0; @@ -301,10 +300,10 @@ static int dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) { struct dsp_cdevpriv *priv; - struct pcm_channel *rdch, *wrch; + struct pcm_channel *rdch, *wrch, *ch; struct snddev_info *d; uint32_t fmt, spd; - int error, rderror, wrerror; + int error, rderror, wrerror, dir; /* Kind of impossible.. */ if (i_dev == NULL || td == NULL) @@ -319,7 +318,6 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) priv->rdch = NULL; priv->wrch = NULL; priv->volch = NULL; - priv->simplex = (pcm_getflags(d->dev) & SD_F_SIMPLEX) ? 1 : 0; error = devfs_set_cdevpriv(priv, dsp_close); if (error != 0) @@ -333,6 +331,36 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) error = 0; DSP_FIXUP_ERROR(); + if (pcm_getflags(d->dev) & SD_F_SIMPLEX) { + if (DSP_F_DUPLEX(flags)) { + /* + * If no channels are opened yet, and we request + * DUPLEX, limit to playback only, otherwise open one + * channel in a direction that already exists. + */ + if (CHN_EMPTY(d, channels.pcm.opened)) { + if (d->playcount > 0) + flags &= ~FREAD; + else if (d->reccount > 0) + flags &= ~FWRITE; + } else { + ch = CHN_FIRST(d, channels.pcm.opened); + if (ch->direction == PCMDIR_PLAY) + flags &= ~FREAD; + else if (ch->direction == PCMDIR_REC) + flags &= ~FWRITE; + } + } else if (!CHN_EMPTY(d, channels.pcm.opened)) { + /* + * If we requested SIMPLEX, make sure we do not open a + * channel in the opposite direction. + */ + ch = CHN_FIRST(d, channels.pcm.opened); + dir = DSP_F_READ(flags) ? PCMDIR_REC : PCMDIR_PLAY; + if (ch->direction != dir) + error = ENOTSUP; + } + } if (error != 0) { PCM_UNLOCK(d); PCM_GIANT_EXIT(d); From nobody Wed Jul 10 16:49:04 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3jF0ZJgz5QmyZ; Wed, 10 Jul 2024 16: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 4WK3jD69KDz4gKM; Wed, 10 Jul 2024 16: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=1720630144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Cmsgcfk3bLD5LtI/0JTficWQiuffrzzTDpLr/b6/e8=; b=cLgmxljuSxLzgRJBnp/zulq8cNgsfzqoKZTDhV+qPZairCEBvz8vITjqJ92EtcW0CF/lCC f6T5QN4nf7Np5GcDepJ11XEJcz3J0EWeZUOj1g/JciB4Csj+u0guehtkGRaQSdHhrjK1/9 oq2cJWS2phbbitYZCJEfEOdmoAaiFA1dCs0LsxRECN1HhMfFacaT6VYfbNXRjUFa0y0ylf N9RuqOpM84KYTRZQyEpdVc9hzCaFZVmlID51DGijDpuzX3o6Pg0Tb9eDJmIY0hi1RdtReh jOzNM3T7KHxGG8JHSp7dsUek1urwqbyx1JXdoN7JXgP1t5Z2etaVxSr32+S5AQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630144; a=rsa-sha256; cv=none; b=pVtFkimLGUrHRSiboTS1uHpSr8aphxNFB9tlrV7wx8BFltpsxD9I9jWw4ge+2TDg/8p2sh YlU1PDru8T0GBe6OwjM/mxcjSo6jbNeLtJS8cVKKnfmtp7ezyJ2YHzXxXCvKgBwKDVNZ/L MugR74yvZeppvcybTCoNMbXyxTv3Y6KJgbSVSXjmUrCZYLJmlnJNzAcYwpa9q9Scv/ht3C 3EhGOy12ycaBXvz49GE5YcRIswYJ070fCaJkCpx+NyHfn2BTH3jt6BbWDbxEUmepVqpNAh 5uVIIJj5IalapSs153ECL805DSQcO0s8HnCvlFDiClCTuGuGqFhb7umV/x60eA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630144; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5Cmsgcfk3bLD5LtI/0JTficWQiuffrzzTDpLr/b6/e8=; b=NKK0cDmKvqPFkdWzFdhjlqo8esM6GTqdMS4Wyk8/eyd+66jbi0D/DnQKMqqTr5AImbfWpy h5lb3kqAXtVzwW7jOKbvnZaTDlD7ZTwJ6f3fKi4qxtRt0mV0vYQb/B9kVbfmoKBH0jsBdG K6CVsIgNYSCCsuXdHTw2+0gVjKZ1U4zUcG1gprEktbuOZrpLFV2OcUh0bxVa9I284qkoIf EnemkLbFl3b0rG0/Hed2S4TwMGWPUCZYA7mxWlxB3WGk5FrsB9vNircL7/6F/ZTSNYVqby L8gqiaGeNGyf7hDkPi+QzEXUEnEUt1/bA+4CRuHj0jENptUui3K8sA2ONIzbSg== 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 4WK3jD5l8BzPWB; Wed, 10 Jul 2024 16: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 46AGn4XI034896; Wed, 10 Jul 2024 16: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 46AGn49f034893; Wed, 10 Jul 2024 16:49:04 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:04 GMT Message-Id: <202407101649.46AGn49f034893@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: e687f4e40ddd - stable/14 - sound: Simplify getchns() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: e687f4e40ddd0cacffd6f7be7a1236fffb1eda52 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e687f4e40ddd0cacffd6f7be7a1236fffb1eda52 commit e687f4e40ddd0cacffd6f7be7a1236fffb1eda52 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:40 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:12 +0000 sound: Simplify getchns() Remove all special handling for SIMPLEX, since we can just fetch the channel directly. While here: - Get rid of a no-op getchns() call in dsp_ioctl(). - Rename getchns() to dsp_lock_chans(), and relchns() to dsp_unlock_chans(). - Simplify DSP_FIXUP_ERROR(), as we do not longer assign SD_F_PRIO* flags to the softc. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45775 (cherry picked from commit 46e92a41cb539e327dd059d571fa381d0fbe779c) --- sys/dev/sound/pcm/dsp.c | 74 ++++++++----------------------------------------- 1 file changed, 12 insertions(+), 62 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 6ac85635b080..f2cead08783c 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -142,52 +142,8 @@ dsp_destroy_dev(device_t dev) } static void -getchns(struct dsp_cdevpriv *priv, uint32_t prio) +dsp_lock_chans(struct dsp_cdevpriv *priv, uint32_t prio) { - struct snddev_info *d; - struct pcm_channel *ch; - uint32_t flags; - - if (priv->simplex) { - d = priv->sc; - if (!PCM_REGISTERED(d)) - return; - PCM_LOCK(d); - PCM_WAIT(d); - PCM_ACQUIRE(d); - /* - * Note: order is important - - * pcm flags -> prio query flags -> wild guess - */ - ch = NULL; - flags = pcm_getflags(d->dev); - if (flags & SD_F_PRIO_WR) { - ch = priv->rdch; - } else if (flags & SD_F_PRIO_RD) { - ch = priv->wrch; - } else if (prio & SD_F_PRIO_WR) { - ch = priv->rdch; - flags |= SD_F_PRIO_WR; - } else if (prio & SD_F_PRIO_RD) { - ch = priv->wrch; - flags |= SD_F_PRIO_RD; - } else if (priv->wrch != NULL) { - ch = priv->rdch; - flags |= SD_F_PRIO_WR; - } else if (priv->rdch != NULL) { - ch = priv->wrch; - flags |= SD_F_PRIO_RD; - } - pcm_setflags(d->dev, flags); - if (ch != NULL) { - CHN_LOCK(ch); - chn_ref(ch, -1); - chn_release(ch); - } - PCM_RELEASE(d); - PCM_UNLOCK(d); - } - if (priv->rdch != NULL && (prio & SD_F_PRIO_RD)) CHN_LOCK(priv->rdch); if (priv->wrch != NULL && (prio & SD_F_PRIO_WR)) @@ -195,7 +151,7 @@ getchns(struct dsp_cdevpriv *priv, uint32_t prio) } static void -relchns(struct dsp_cdevpriv *priv, uint32_t prio) +dsp_unlock_chans(struct dsp_cdevpriv *priv, uint32_t prio) { if (priv->rdch != NULL && (prio & SD_F_PRIO_RD)) CHN_UNLOCK(priv->rdch); @@ -333,17 +289,12 @@ skip: } #define DSP_FIXUP_ERROR() do { \ - prio = pcm_getflags(d->dev); \ if (!DSP_F_VALID(flags)) \ error = EINVAL; \ if (!DSP_F_DUPLEX(flags) && \ ((DSP_F_READ(flags) && d->reccount == 0) || \ (DSP_F_WRITE(flags) && d->playcount == 0))) \ error = ENOTSUP; \ - else if (!DSP_F_DUPLEX(flags) && (prio & SD_F_SIMPLEX) && \ - ((DSP_F_READ(flags) && (prio & SD_F_PRIO_WR)) || \ - (DSP_F_WRITE(flags) && (prio & SD_F_PRIO_RD)))) \ - error = EBUSY; \ } while (0) static int @@ -352,7 +303,7 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) struct dsp_cdevpriv *priv; struct pcm_channel *rdch, *wrch; struct snddev_info *d; - uint32_t fmt, spd, prio; + uint32_t fmt, spd; int error, rderror, wrerror; /* Kind of impossible.. */ @@ -533,18 +484,18 @@ dsp_io_ops(struct dsp_cdevpriv *priv, struct uio *buf) runpid = buf->uio_td->td_proc->p_pid; - getchns(priv, prio); + dsp_lock_chans(priv, prio); if (*ch == NULL || !((*ch)->flags & CHN_F_BUSY)) { if (priv->rdch != NULL || priv->wrch != NULL) - relchns(priv, prio); + dsp_unlock_chans(priv, prio); PCM_GIANT_EXIT(d); return (EBADF); } if (((*ch)->flags & (CHN_F_MMAP | CHN_F_DEAD)) || (((*ch)->flags & CHN_F_RUNNING) && (*ch)->pid != runpid)) { - relchns(priv, prio); + dsp_unlock_chans(priv, prio); PCM_GIANT_EXIT(d); return (EINVAL); } else if (!((*ch)->flags & CHN_F_RUNNING)) { @@ -563,7 +514,7 @@ dsp_io_ops(struct dsp_cdevpriv *priv, struct uio *buf) CHN_BROADCAST(&(*ch)->cv); - relchns(priv, prio); + dsp_unlock_chans(priv, prio); PCM_GIANT_LEAVE(d); @@ -799,7 +750,6 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, int mode, return (ret); } - getchns(priv, 0); rdch = priv->rdch; wrch = priv->wrch; @@ -1858,7 +1808,7 @@ dsp_poll(struct cdev *i_dev, int events, struct thread *td) ret = 0; - getchns(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); + dsp_lock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); wrch = priv->wrch; rdch = priv->rdch; @@ -1874,7 +1824,7 @@ dsp_poll(struct cdev *i_dev, int events, struct thread *td) ret |= chn_poll(rdch, e, td); } - relchns(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); + dsp_unlock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); PCM_GIANT_LEAVE(d); @@ -1936,7 +1886,7 @@ dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offset, PCM_GIANT_ENTER(d); - getchns(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); + dsp_lock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); wrch = priv->wrch; rdch = priv->rdch; @@ -1945,7 +1895,7 @@ dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offset, (*offset + size) > sndbuf_getallocsize(c->bufsoft) || (wrch != NULL && (wrch->flags & CHN_F_MMAP_INVALID)) || (rdch != NULL && (rdch->flags & CHN_F_MMAP_INVALID))) { - relchns(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); + dsp_unlock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); PCM_GIANT_EXIT(d); return (EINVAL); } @@ -1956,7 +1906,7 @@ dsp_mmap_single(struct cdev *i_dev, vm_ooffset_t *offset, rdch->flags |= CHN_F_MMAP; *offset = (uintptr_t)sndbuf_getbufofs(c->bufsoft, *offset); - relchns(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); + dsp_unlock_chans(priv, SD_F_PRIO_RD | SD_F_PRIO_WR); *object = vm_pager_allocate(OBJT_DEVICE, i_dev, size, nprot, *offset, curthread->td_ucred); From nobody Wed Jul 10 16:49:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3jH4Qfzz5QmmR; Wed, 10 Jul 2024 16:49: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 4WK3jH0WZ4z4gbF; Wed, 10 Jul 2024 16: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=1720630147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NmosO1knnICuZhcWvOcLhEFAkouiADwKS1MwQ05G4/M=; b=fwTgGBfIvMeqTOkP2nq/RhCetCRD6Q43YX4DidoGnII5lDrzX9CE9V+6ql4e6yDAttxMJc AdfzKaGPEBf7OoogzXwYjQyAigtJghIAdWMzyQ051n1+LUs+lVrgdTpalQoVxMwbMDAmMA 1MpT7XpQtYge/6uAnvKqU/ntzvXGUMq70pcimqaattspiyX3XuDk9Ss5sugHQZp4ZjWWTA EPgTZOw5dAimfUaC+YEXATyrJpzt5mjPHvevLH5XMQeiV0Jzm79yHSy9ShDBnsrNYGMw14 hXm6RffQF5vb4JmJJGOShqiW5ukgkEtrhomWOp+V3MhcSdNEO3/qoaQnMXDTOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630147; a=rsa-sha256; cv=none; b=UE/19wFCAVzggNJ7ScmvVNJBu42MoAgI2TxoqDSSKo8aFXpbRc6c4L9gwP9mHR+SxcahPm KeRNv54vG6uK88+bNhb2MFT7Od402gOPX5rYgusgcm3jquNBHz6rrAS1Stj8/Ki4XSsU9f /QmzTHGjb3jJIMrhi4ElqH86ZmerSxf0IfATEL0BRsAbJVFZa5jE781S9SOBPVpJdOajPH DGG9yBMMGp4X5wQClkpSBXh9FqQal1pNr3+En8PAruTzxqeWHEbSshoQirWIODREumkTsL cAeH0DY7hS/JiooAQ8GXah8QZjVe9IKGhaAEqbp+3nFbXK4tq/HMcJEIF2NjnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NmosO1knnICuZhcWvOcLhEFAkouiADwKS1MwQ05G4/M=; b=lMQCOt1ZRiItwworVZAHL1Qb9oU4sXI0j8wGJP0C4Z/XGhACcbrCRgept/b3FfW1+fVPsi mExS7c1cO/n+EWeEAEFc1u7Ek4YdGZ02rL9NwRZkEQz6OyDv+/zwqY3BsMdKNTdF6gUW98 gmRShv/q2+vDQJ96tNw7ZHGjK2zZ51dyol0tXDvKRGk2wF9waNG7aw/b8CxIb1KVkfnDx6 9gF46ldX6aAoRN25a4nNhMsuJRjwSSf3M4L4+Bla8XwCPetA6/31Rwk5QZINuMzmz0jBbW CkpdDfcAudLQSlwuxDoHY5+vaCBwDDgenU8YEpjU4aUvzVAzdG/LMnJ2FUYlqQ== 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 4WK3jH070KzQ0Y; Wed, 10 Jul 2024 16: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 46AGn6Db034984; Wed, 10 Jul 2024 16: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 46AGn6MU034981; Wed, 10 Jul 2024 16:49:06 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:06 GMT Message-Id: <202407101649.46AGn6MU034981@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: d4b65f3f53ee - stable/14 - sound: Make DSP_FIXUP_ERROR() regular code List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: d4b65f3f53ee84a1f744bc74111911d61e86304d Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d4b65f3f53ee84a1f744bc74111911d61e86304d commit d4b65f3f53ee84a1f744bc74111911d61e86304d Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:50 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:13 +0000 sound: Make DSP_FIXUP_ERROR() regular code No reason to have this as a macro. While here, change the second case to an "else if" as there is no reason to check it if the open flags are invalid. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D45776 (cherry picked from commit adc1713fb13f89a6eb33f5de840c981d0e17e4b7) --- sys/dev/sound/pcm/dsp.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 26a2919ed1da..27c89c3231b7 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -287,15 +287,6 @@ skip: priv = NULL; } -#define DSP_FIXUP_ERROR() do { \ - if (!DSP_F_VALID(flags)) \ - error = EINVAL; \ - if (!DSP_F_DUPLEX(flags) && \ - ((DSP_F_READ(flags) && d->reccount == 0) || \ - (DSP_F_WRITE(flags) && d->playcount == 0))) \ - error = ENOTSUP; \ -} while (0) - static int dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) { @@ -330,7 +321,12 @@ dsp_open(struct cdev *i_dev, int flags, int mode, struct thread *td) PCM_WAIT(d); error = 0; - DSP_FIXUP_ERROR(); + if (!DSP_F_VALID(flags)) + error = EINVAL; + else if (!DSP_F_DUPLEX(flags) && + ((DSP_F_READ(flags) && d->reccount == 0) || + (DSP_F_WRITE(flags) && d->playcount == 0))) + error = ENOTSUP; if (pcm_getflags(d->dev) & SD_F_SIMPLEX) { if (DSP_F_DUPLEX(flags)) { /* From nobody Wed Jul 10 16:49:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3jJ2M9vz5Qmjf; Wed, 10 Jul 2024 16: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 4WK3jJ1dHPz4gQc; Wed, 10 Jul 2024 16:49:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rf3cX9+V/ufxznSAnxQR6WZDxeFJGjQtESMEe76xVBU=; b=U/vASLRiTc/ZmwNTS7kTERScKSZ8dNxVsW0bawFGUcPy+oqf26Ss3n7QuncyqURZaDTZlQ fCRjB3N4GewkMUKdYr9wwbAXToFO0KJAvDC4I1ZN9/NxS1f0DucGsvCf7rcReYuHj7lrTm n7pHnbIDnfiOt0WQEIScvY4nlTzG6UF0F3Rn7KxHNi+mz7aYWZSTxA+lwMW35kBZKR8KwF V6592hw5PeXXBpvHpuUtFG1LS7XGgvUWPRL2DLClJOlhc4foaVvd9suk+ljG76B0nmHINB GTt0W/IkPtsTnUmWfl7OEUAtwag2bhqwl2iakXbqYnGgg08TSU5UmpDHnZo8Og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630148; a=rsa-sha256; cv=none; b=UF6J1xa5BizakNhctXqGKFVbyWG0+Q05xGQLLt5W3EPz/Nq4PitD0nX5Yew9czGGRB/9p0 rs719/9/4drXF9nDuscFXnQ8U+AneHH1Tknq0ToLAA9/ZVL3D5wgV7JJwsq0ebTQkxnmY+ J+6Xba+oC+AjPChNT65hla6vRtj50YGdzbvzA9Ds2qMHpwRQusM7Zl8D2gjsHETTNoK14b 65p93tSOhfeKomxgpYsV71cdpuTNjp369c5teQZubxTdAIlLufB5bP269HRIWAHKhHw7uV RVo+qxI3k/k75Y9kAfKrufLnk7gZGPFybjHicA/OkiA43zdo94nOLoxg5K7fyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rf3cX9+V/ufxznSAnxQR6WZDxeFJGjQtESMEe76xVBU=; b=xCVg3Y/d5V43rMxylB2/tiKJL753FwsDsaHU2pYCFuPm8LYUJim8zp1fOe/SITRUeuBfpR YqdlBV6K/M627Th5Xr7DLkWIN84wI/9i03ot5Eiq9/ZrKW6bk/GQFir18OQeUInq+ZcDYk eJNz0JJ1OvBGiJn++cZFnXebj886Azwq/v23JsbwbV8VeRCYMNOZxhLYnmEzneLgE0tIUL iUaK7thbATg1mMwl09VZirBtgG87CTwHEDJsJNdRPh8TzNKDoYtwktn+RTz+ANyLiIHxiv ondzR1wzN+D9sOKmKm3CT0KR9b70BteSisIJhBp+3tWnDcEkZpGH91ZAsCKE3g== 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 4WK3jJ18VfzQ5R; Wed, 10 Jul 2024 16:49: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 46AGn84d035032; Wed, 10 Jul 2024 16:49:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGn8Fe035029; Wed, 10 Jul 2024 16:49:08 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:08 GMT Message-Id: <202407101649.46AGn8Fe035029@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: d325cd4a5302 - stable/14 - sound: Remove dead code in pcm_register() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: d325cd4a530276cc05167e4a750fd53f32dbf86a Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d325cd4a530276cc05167e4a750fd53f32dbf86a commit d325cd4a530276cc05167e4a750fd53f32dbf86a Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:55 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:13 +0000 sound: Remove dead code in pcm_register() Sponsored by: The FreeBSD Foundation MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D45831 (cherry picked from commit a9f08df3e9004f431e98f67afc1ac2b2f773ec14) --- sys/dev/sound/pcm/sound.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 8d97dcd60231..b18b83468150 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -558,14 +558,7 @@ pcm_register(device_t dev, void *devinfo, int numplay, int numrec) d->lock = snd_mtxcreate(device_get_nameunit(dev), "sound cdev"); cv_init(&d->cv, device_get_nameunit(dev)); PCM_ACQUIRE_QUICK(d); -#if 0 - /* - * d->flags should be cleared by the allocator of the softc. - * We cannot clear this field here because several devices set - * this flag before calling pcm_register(). - */ - d->flags = 0; -#endif + i = 0; if (resource_int_value(device_get_name(dev), device_get_unit(dev), "vpc", &i) != 0 || i != 0) From nobody Wed Jul 10 16:49:09 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3jK5NpTz5Qmyj; Wed, 10 Jul 2024 16:49:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WK3jK2dkVz4gbl; Wed, 10 Jul 2024 16:49:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vn15dWk9WdFNgwV7FDkymIkyBPhfk9AJxQP2GFxtON4=; b=RqRgKow4DEE7jT2dSXITLenoO/W6AB3w5SzRHEt9i5arFCvrquP+OXnf9MAsVeuexHMz6k WcXVh9L6tU/ESa867iSgYvvsFZUCEsyn88GIyc5ZmBwugT9pV6K2s4sxn6LiYDMwp6/psm +jOjQFz9rgKrLOpeJi8/BKLO3d1kfInTKuPG2uO+dkjy2mPZ9XRQWvRS5q/AoEvfmVi+l4 cgQyoZMfnDThNgFEXMlDom1uG9dEIwKEeIug1p8v+K5I2Y/7gRv5vog+6p8vxUKAffZV2a VLA/1eYRwBarWw40Yj5IUpSmKkfPsSnCzUoDPwcNYyWl3H/NfK7GB2mnldB9pw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630149; a=rsa-sha256; cv=none; b=KCqBEM2NdbwSk7Aot/WA6oBn1lEhaQNzfm7Kx6bmVYqyHUiZLsXARMrKW/Q1mC09VruDiN q+OL6O7uHlY61R7XvI22DDquQoU/qJF6Brv+Dvk6hcdW9DjuaZx0lM/F6Qa6Wtoz1UL2My uwfqQ81kXIkYShdGvG9eRUuMoUefaPGsK3R1QkCm39LU2M17Kc5+p0TgL3K3qD3WFQ/F6Y b75/Tv6sgJiM2E2CyM5EKDDVz+dYcEMJ4vuJOjfr0/zvub01X1ulNlJTlVd/W2mgJdDLdU OJk+sHDPuWSt+FYlerQYfdDIVk444Y/G9j/8We8J170XpzfUF11kkwGhdOU5LA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vn15dWk9WdFNgwV7FDkymIkyBPhfk9AJxQP2GFxtON4=; b=y1Konem1MIDP4RgXqaIDSmtqZqTGAFzsxptYMe6NDJMq5Q6RPIR3KinqEBqewmdg4I9C6x Kjowkl9SZlqQwNz4nWNPhrHeA+f6bImrYSeKBOC9FMxbfX8++IjUhXwUmVLqKUSR8zUFij sd/VdbvaSofZDjzUMb0s9Xl1OxMqvPyzpjkDpllQYKwlnapaSTqR11AkHs0QkDR3XCV6hf Am6H1QdjRYJMrtD8NFTj/eMPvcQX61RXmo4p4fU1tvLf3hW5JniGsid3Lc6cpoqqbh0Zvx s7W3fO/oa2HRY7MX/cL8ZiCOXZDysErtHrmQMj+ik+37dcGkRQiPxjzsQRoB2g== 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 4WK3jK2DqhzQ5S; Wed, 10 Jul 2024 16:49: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 46AGn9AH035081; Wed, 10 Jul 2024 16:49:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGn9co035078; Wed, 10 Jul 2024 16:49:09 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:09 GMT Message-Id: <202407101649.46AGn9co035078@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: ff6b61a2c886 - stable/14 - sound: Handle midistat_lock through function interface List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: ff6b61a2c88631e66287c478cd373ed39878b174 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ff6b61a2c88631e66287c478cd373ed39878b174 commit ff6b61a2c88631e66287c478cd373ed39878b174 Author: Christos Margiolis AuthorDate: 2024-07-06 18:22:59 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:13 +0000 sound: Handle midistat_lock through function interface midistat_lock is used outside midi/midi.c as well, so implement lock, unlock and lockassert functions in order not to expose the lock in the header file. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D45857 (cherry picked from commit 2d6fc24673ccc97020c94094f97ee015f1db9702) --- sys/dev/sound/midi/midi.c | 76 ++++++++++++++++++++++++++---------------- sys/dev/sound/midi/midi.h | 6 ++-- sys/dev/sound/midi/sequencer.c | 4 +-- 3 files changed, 53 insertions(+), 33 deletions(-) diff --git a/sys/dev/sound/midi/midi.c b/sys/dev/sound/midi/midi.c index 2dcd64625b6c..d2b495ea04cd 100644 --- a/sys/dev/sound/midi/midi.c +++ b/sys/dev/sound/midi/midi.c @@ -178,7 +178,7 @@ TAILQ_HEAD(, snd_midi) midi_devs; * /dev/midistat variables and declarations, protected by midistat_lock */ -struct sx midistat_lock; +struct sx mstat_lock; static int midistat_isopen = 0; static struct sbuf midistat_sbuf; @@ -259,6 +259,24 @@ SYSCTL_INT(_hw_midi_stat, OID_AUTO, verbose, CTLFLAG_RW, * CODE START */ +void +midistat_lock(void) +{ + sx_xlock(&mstat_lock); +} + +void +midistat_unlock(void) +{ + sx_xunlock(&mstat_lock); +} + +void +midistat_lockassert(void) +{ + sx_assert(&mstat_lock, SA_XLOCKED); +} + /* * Register a new rmidi device. cls midi_if interface unit == 0 means * auto-assign new unit number unit != 0 already assigned a unit number, eg. @@ -281,7 +299,7 @@ midi_init(kobj_class_t cls, int unit, int channel, void *cookie) uint8_t *buf; MIDI_DEBUG(1, printf("midiinit: unit %d/%d.\n", unit, channel)); - sx_xlock(&midistat_lock); + midistat_lock(); /* * Protect against call with existing unit/channel or auto-allocate a * new unit number. @@ -359,7 +377,7 @@ midi_init(kobj_class_t cls, int unit, int channel, void *cookie) TAILQ_INSERT_TAIL(&midi_devs, m, link); - sx_xunlock(&midistat_lock); + midistat_unlock(); m->dev = make_dev(&midi_cdevsw, unit, UID_ROOT, GID_WHEEL, 0666, "midi%d.%d", unit, channel); @@ -379,7 +397,7 @@ err1: free(m->synth, M_MIDI); free(m, M_MIDI); err0: - sx_xunlock(&midistat_lock); + midistat_unlock(); MIDI_DEBUG(1, printf("midi_init ended in error\n")); return NULL; } @@ -397,7 +415,7 @@ midi_uninit(struct snd_midi *m) int err; err = EBUSY; - sx_xlock(&midistat_lock); + midistat_lock(); mtx_lock(&m->lock); if (m->busy) { if (!(m->rchan || m->wchan)) @@ -419,7 +437,7 @@ midi_uninit(struct snd_midi *m) err: mtx_unlock(&m->lock); exit: - sx_xunlock(&midistat_lock); + midistat_unlock(); return err; } @@ -927,9 +945,9 @@ midistat_open(struct cdev *i_dev, int flags, int mode, struct thread *td) MIDI_DEBUG(1, printf("midistat_open\n")); - sx_xlock(&midistat_lock); + midistat_lock(); if (midistat_isopen) { - sx_xunlock(&midistat_lock); + midistat_unlock(); return EBUSY; } midistat_isopen = 1; @@ -941,7 +959,7 @@ midistat_open(struct cdev *i_dev, int flags, int mode, struct thread *td) out: if (error) midistat_isopen = 0; - sx_xunlock(&midistat_lock); + midistat_unlock(); return error; } @@ -949,14 +967,14 @@ static int midistat_close(struct cdev *i_dev, int flags, int mode, struct thread *td) { MIDI_DEBUG(1, printf("midistat_close\n")); - sx_xlock(&midistat_lock); + midistat_lock(); if (!midistat_isopen) { - sx_xunlock(&midistat_lock); + midistat_unlock(); return EBADF; } sbuf_delete(&midistat_sbuf); midistat_isopen = 0; - sx_xunlock(&midistat_lock); + midistat_unlock(); return 0; } @@ -967,13 +985,13 @@ midistat_read(struct cdev *i_dev, struct uio *uio, int flag) int err; MIDI_DEBUG(4, printf("midistat_read\n")); - sx_xlock(&midistat_lock); + midistat_lock(); if (!midistat_isopen) { - sx_xunlock(&midistat_lock); + midistat_unlock(); return EBADF; } if (uio->uio_offset < 0 || uio->uio_offset > sbuf_len(&midistat_sbuf)) { - sx_xunlock(&midistat_lock); + midistat_unlock(); return EINVAL; } err = 0; @@ -982,7 +1000,7 @@ midistat_read(struct cdev *i_dev, struct uio *uio, int flag) err = uiomove(sbuf_data(&midistat_sbuf) + uio->uio_offset, l, uio); } - sx_xunlock(&midistat_lock); + midistat_unlock(); return err; } @@ -995,7 +1013,7 @@ midistat_prepare(struct sbuf *s) { struct snd_midi *m; - sx_assert(&midistat_lock, SA_XLOCKED); + midistat_lockassert(); sbuf_printf(s, "FreeBSD Midi Driver (midi2)\n"); if (TAILQ_EMPTY(&midi_devs)) { @@ -1354,7 +1372,7 @@ midisynth_bender(void *n, uint8_t chn, uint16_t val) static int midi_destroy(struct snd_midi *m, int midiuninit) { - sx_assert(&midistat_lock, SA_XLOCKED); + midistat_lockassert(); mtx_assert(&m->lock, MA_OWNED); MIDI_DEBUG(3, printf("midi_destroy\n")); @@ -1380,7 +1398,7 @@ midi_destroy(struct snd_midi *m, int midiuninit) static int midi_load(void) { - sx_init(&midistat_lock, "midistat lock"); + sx_init(&mstat_lock, "midistat lock"); TAILQ_INIT(&midi_devs); midistat_dev = make_dev(&midistat_cdevsw, MIDI_DEV_MIDICTL, UID_ROOT, @@ -1397,7 +1415,7 @@ midi_unload(void) MIDI_DEBUG(1, printf("midi_unload()\n")); retval = EBUSY; - sx_xlock(&midistat_lock); + midistat_lock(); if (midistat_isopen) goto exit0; @@ -1410,19 +1428,19 @@ midi_unload(void) if (retval) goto exit1; } - sx_xunlock(&midistat_lock); + midistat_unlock(); destroy_dev(midistat_dev); /* * Made it here then unload is complete */ - sx_destroy(&midistat_lock); + sx_destroy(&mstat_lock); return 0; exit1: mtx_unlock(&m->lock); exit0: - sx_xunlock(&midistat_lock); + midistat_unlock(); if (retval) MIDI_DEBUG(2, printf("midi_unload: failed\n")); return retval; @@ -1471,7 +1489,7 @@ midimapper_open_locked(void *arg1, void **cookie) int retval = 0; struct snd_midi *m; - sx_assert(&midistat_lock, SX_XLOCKED); + midistat_lockassert(); TAILQ_FOREACH(m, &midi_devs, link) { retval++; } @@ -1484,9 +1502,9 @@ midimapper_open(void *arg1, void **cookie) { int retval; - sx_xlock(&midistat_lock); + midistat_lock(); retval = midimapper_open_locked(arg1, cookie); - sx_xunlock(&midistat_lock); + midistat_unlock(); return retval; } @@ -1503,7 +1521,7 @@ midimapper_fetch_synth_locked(void *arg, void *cookie, int unit) struct snd_midi *m; int retval = 0; - sx_assert(&midistat_lock, SX_XLOCKED); + midistat_lockassert(); TAILQ_FOREACH(m, &midi_devs, link) { if (unit == retval) return (kobj_t)m->synth; @@ -1518,9 +1536,9 @@ midimapper_fetch_synth(void *arg, void *cookie, int unit) { kobj_t synth; - sx_xlock(&midistat_lock); + midistat_lock(); synth = midimapper_fetch_synth_locked(arg, cookie, unit); - sx_xunlock(&midistat_lock); + midistat_unlock(); return synth; } diff --git a/sys/dev/sound/midi/midi.h b/sys/dev/sound/midi/midi.h index afbfdfa6abbc..2254fab690e9 100644 --- a/sys/dev/sound/midi/midi.h +++ b/sys/dev/sound/midi/midi.h @@ -39,10 +39,12 @@ MALLOC_DECLARE(M_MIDI); #define M_RXEN 0x04 #define M_TXEN 0x08 -extern struct sx midistat_lock; - struct snd_midi; +void midistat_lock(void); +void midistat_unlock(void); +void midistat_lockassert(void); + struct snd_midi * midi_init(kobj_class_t _mpu_cls, int _unit, int _channel, void *cookie); int midi_uninit(struct snd_midi *_m); diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c index ec99fdea4637..ab2d48294a6a 100644 --- a/sys/dev/sound/midi/sequencer.c +++ b/sys/dev/sound/midi/sequencer.c @@ -747,7 +747,7 @@ mseq_open(struct cdev *i_dev, int flags, int mode, struct thread *td) * Mark this device busy. */ - sx_xlock(&midistat_lock); + midistat_lock(); mtx_lock(&scp->seq_lock); if (scp->busy) { mtx_unlock(&scp->seq_lock); @@ -785,7 +785,7 @@ mseq_open(struct cdev *i_dev, int flags, int mode, struct thread *td) } } } - sx_xunlock(&midistat_lock); + midistat_unlock(); timer_setvals(scp, 60, 100); From nobody Wed Jul 10 16:49:10 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3jL5VJnz5Qmqv; Wed, 10 Jul 2024 16:49: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 4WK3jL3jmTz4gYg; Wed, 10 Jul 2024 16:49:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mjdUhxVOFWPFiifMb/aWGS5wBuedF9vKF3r52+6HG+M=; b=x/E2t9o9VJN1ZCjiGya/FXuuByE1qbnJ+Xy08UAATnNhMMiYDNiTLkh9U5uLcWIVyfk7rS DM60LjyzjOi24OJp/ZcvtAiCbRE6ClFNSVi73VDT0FsgrL1NeY+Fp8XEQ9usUNCaX6D7f1 AmY0O+9qTsZ3n9VprSIuNRXruKWrwCCVUCPO8sC++NW3yGLGVVpbelhtCfkNpPfupdqWO6 xxalbQ5bd6lhD0aD06EZobdQ5Ckp2+LLxxRNLlQbqyqSoTCSR8TtPqP91G8bGdRomJFS6G KXMIDTV1S43bGg8/RoWf0s1zyidZoZ7akKTH1MaGepgczGq4mO+GMQZpxDhahA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630150; a=rsa-sha256; cv=none; b=i7uzMT3E6v8NSpRKyy+MnSeMlfMJXVNnmqP9rOymzACSsJ5Gm90wmply03ZhczZpUUiDN9 sWgjV95eApk3PdOv1UXrE8jFSfi3+ZHEVWrSoxhlIEtqOUwCbv/cuSPW7mWnFHyah1dfyu 31mE0Y/dyHPQuT0UDP6vKhUyUir+5muvp3PCchIhJAERamdnd6KiBrHmUzLh4dSEL49qhJ Mzqk4MnfnkEZIddIYgGTxU70KdkTjx8x898HSVR5ikmScXxfjzj+Z1IdlUy15vr6nvRA3m AGodOQ7q/QZR8xyma2/vWHMMRkUWvmQES3lSiBQWObh3VtymgavUvJo7l/GuSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mjdUhxVOFWPFiifMb/aWGS5wBuedF9vKF3r52+6HG+M=; b=lnEiLF0zzQ1lzMOlTcM/zGYjm2spybfe4ByFZbIN0xvUPe6KRxTfgobgvbBu3I+3pPhQmY IaQcVwulVar22/vhVci3iZZIiDFZHF1FcUICYut9IEGLdMRR731xiVSPoSMNdAYtefI7L6 EU8FqftZLbNCK0oQBK+l+f5EWmLvuRk0kGaWlJmZMr+JRo2JbKT2qLUkyoqOHMWR6NybRy lPl0mmSswCwDsTzQPVbGFwJ3brrKU4LKZaOPPajpHr1tYSupIthPuuG/aauquJaFNgrZh2 M39fHjlwLWP8Pw+cA44R/IQm6xbcbIGV180t59fEBG9AQMooekjKV51sdqE/0w== 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 4WK3jL3LPnzQ5T; Wed, 10 Jul 2024 16:49: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 46AGnAfL035132; Wed, 10 Jul 2024 16:49:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGnAPD035129; Wed, 10 Jul 2024 16:49:10 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:10 GMT Message-Id: <202407101649.46AGnAPD035129@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 95d3abff7375 - stable/14 - sound: Fix min/max rate for SNDCTL_AUDIOINFO and SNDCTL_ENGINEINFO List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 95d3abff7375b8cfa41756288a3cbcdcb218f4cb Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=95d3abff7375b8cfa41756288a3cbcdcb218f4cb commit 95d3abff7375b8cfa41756288a3cbcdcb218f4cb Author: Christos Margiolis AuthorDate: 2024-07-06 18:23:04 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:13 +0000 sound: Fix min/max rate for SNDCTL_AUDIOINFO and SNDCTL_ENGINEINFO Since we allow feeding of any rate within the [feeder_rate_min, feeder_rate_max] range, report this as the min/max rate as well. Only exceptions are when we the device is opened in exclusive or bitperfect mode. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45862 (cherry picked from commit 86585210fd5657542884b22eb52b21e960b7be6c) --- sys/dev/sound/pcm/dsp.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 27c89c3231b7..0689dfedb9c2 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2170,8 +2170,13 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai, bool ex) else ai->iformats |= fmts; - ai->min_rate = min(ai->min_rate, caps->minspeed); - ai->max_rate = max(ai->max_rate, caps->maxspeed); + if (ex || (pcm_getflags(d->dev) & SD_F_BITPERFECT)) { + ai->min_rate = min(ai->min_rate, caps->minspeed); + ai->max_rate = max(ai->max_rate, caps->maxspeed); + } else { + ai->min_rate = min(ai->min_rate, feeder_rate_min); + ai->max_rate = max(ai->max_rate, feeder_rate_max); + } ai->min_channels = min(ai->min_channels, minch); ai->max_channels = max(ai->max_channels, maxch); @@ -2369,8 +2374,15 @@ dsp_oss_engineinfo(struct cdev *i_dev, oss_audioinfo *ai) * @todo @c handle - haven't decided how to generate * this yet; bus, vendor, device IDs? */ - ai->min_rate = caps->minspeed; - ai->max_rate = caps->maxspeed; + + if ((ch->flags & CHN_F_EXCLUSIVE) || + (pcm_getflags(d->dev) & SD_F_BITPERFECT)) { + ai->min_rate = caps->minspeed; + ai->max_rate = caps->maxspeed; + } else { + ai->min_rate = feeder_rate_min; + ai->max_rate = feeder_rate_max; + } ai->min_channels = minch; ai->max_channels = maxch; From nobody Wed Jul 10 16:49:11 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3jN0VyFz5Qn2C; Wed, 10 Jul 2024 16:49: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 4WK3jM4Sg1z4gTD; Wed, 10 Jul 2024 16:49:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lvD1hPaSQVYMrc9RAkK7zuls0CLuvj9MQrYb4sX5q2Y=; b=LVc1CJTRrY/mpeCElH9pwuT5uMbXv2XRxQptEPxZFl7aWu/wfYoeSQ2cLzd3zVNS4CJb6X mqYlKG3WS1jd2a6+QrAukn76qpUUqovXGN+T8AV9OCg8wAKZQLpAgQRvhxH1T61qQINGpq zCxN1fL7LCjvQT7oljfniK3fbSHWhOVWERwRxGQNR13QY4oCHbVdlsHjrX6RMvI+c6ag3+ t/6lXkomTrbvMpOh/prMCFKLW46dO5NJLFDB3IK/zC5GsD0AVsU/v91rozl8EbaXAFhK5w CRm3PuaxLJXq1eCihL1IvTCXNzkIdjZbuerYP9NdpCByNV6nkvIvIsqVPY/HZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630151; a=rsa-sha256; cv=none; b=PhOTStdAFmDJu3vpFdCkfM0VrIeMov/j3bT4Nkz8XmL3d99WgUFm6LQ2FbOvT46lG4sjSH cn3XQ+DVoEAdFwyukr6zN5Ro2KSlVdw2qOFQRgA0CuxgiFv/jDfEEUz10PypneaJagPhvE TtdUIaNRapSmJ/SUIdJYc+iSdq/RarsBIq0zm9IBzXtF1cyAsQHGmVTTaq+DFva4x/wkhb ufYdg8oufXFWi8B9sI1VUl3SCkqtERgtdsFknIfBK+Y2fTeC4Fe4UvpLqxqoEswGjwMiw/ gMylUgFzweiPa0LbzPtonT1nt3uufNul9i4DL2ZMlv37B0/qNyGuPyryPCEmWQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630151; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lvD1hPaSQVYMrc9RAkK7zuls0CLuvj9MQrYb4sX5q2Y=; b=gT8d4vBVKFsYiEgUe0DdLqQ2I9zfHW4OGnZuZwpp9m0+mLSGMEApEuXqeNQs0AtnVpvG8w bO5m/iS9glzU6a3fPJqhLazrfD8XsVxGmwRUT4o+oWFUVW4pD+LKlvw+viDvAqCvUe87TB ulSDJN23sNUZoxbvJPndVYmN4NMGlWAIzptlw6qTZkjVbkEiz46wTI+fPYzhAgEg59DL+Y Tq2MCDhz+pansSO8VZUYkXbU8vYJWchH8GB/Wj6VUzQwfQ6lwDJu5ppzEvwTK7wzBmFwYB 6dHw0u/5IL7WSo6TMfztARTwjw1xUjIN0irpUYV7hmPCIbcnPUWNibDmuj1t0w== 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 4WK3jM44HJzPpH; Wed, 10 Jul 2024 16:49: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 46AGnBWs035168; Wed, 10 Jul 2024 16:49:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGnBfv035165; Wed, 10 Jul 2024 16:49:11 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:11 GMT Message-Id: <202407101649.46AGnBfv035165@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: ecb0a2ed2f40 - stable/14 - sound: Refactor sndstat_get_caps() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: ecb0a2ed2f40ed51b97c17e0be5529b4183dfa32 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=ecb0a2ed2f40ed51b97c17e0be5529b4183dfa32 commit ecb0a2ed2f40ed51b97c17e0be5529b4183dfa32 Author: Christos Margiolis AuthorDate: 2024-07-06 18:23:09 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:13 +0000 sound: Refactor sndstat_get_caps() The current implementation of sndstat_get_caps() does not work properly when VCHANs are enabled, as it skips all information about physical channels, and also assigns the min/max rates and channels to same values, which is usually not the case. A device either supports any sample rate within the [feeder_rate_min, feeder_rate_max] range, or [hw_rate_min, hw_rate_max] range when the device is opened in exclusive or bitperfect mode. The number of channels can also vary and is not always the same for both min and max. Refactor the whole function to resemble the way we handle fetching of these values in dsp_oss_audioinfo() and dsp_oss_engineinfo(). Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45872 (cherry picked from commit 9d8b93bc9ccea82b648ffa9354200c9e4d3f211b) --- sys/dev/sound/pcm/sndstat.c | 44 +++++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index 3be376e1da01..5b770810d19b 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -323,47 +323,37 @@ sndstat_write(struct cdev *i_dev, struct uio *buf, int flag) } static void -sndstat_get_caps(struct snddev_info *d, bool play, uint32_t *min_rate, +sndstat_get_caps(struct snddev_info *d, int dir, uint32_t *min_rate, uint32_t *max_rate, uint32_t *fmts, uint32_t *minchn, uint32_t *maxchn) { struct pcm_channel *c; - int dir; - - dir = play ? PCMDIR_PLAY : PCMDIR_REC; - - if (play && d->pvchancount > 0) { - *min_rate = *max_rate = d->pvchanrate; - *fmts = AFMT_ENCODING(d->pvchanformat); - *minchn = *maxchn = AFMT_CHANNEL(d->pvchanformat); - return; - } else if (!play && d->rvchancount > 0) { - *min_rate = *max_rate = d->rvchanrate; - *fmts = AFMT_ENCODING(d->rvchanformat); - *minchn = *maxchn = AFMT_CHANNEL(d->rvchanformat); - return; - } + struct pcmchan_caps *caps; + int i; *fmts = 0; *min_rate = UINT32_MAX; *max_rate = 0; *minchn = UINT32_MAX; *maxchn = 0; - CHN_FOREACH(c, d, channels.pcm) { - struct pcmchan_caps *caps; - int i; - if (c->direction != dir || (c->flags & CHN_F_VIRTUAL) != 0) + CHN_FOREACH(c, d, channels.pcm) { + if (c->direction != dir) continue; - CHN_LOCK(c); caps = chn_getcaps(c); - *min_rate = min(caps->minspeed, *min_rate); - *max_rate = max(caps->maxspeed, *max_rate); for (i = 0; caps->fmtlist[i]; i++) { *fmts |= AFMT_ENCODING(caps->fmtlist[i]); *minchn = min(AFMT_CHANNEL(caps->fmtlist[i]), *minchn); *maxchn = max(AFMT_CHANNEL(caps->fmtlist[i]), *maxchn); } + if ((c->flags & CHN_F_EXCLUSIVE) || + (pcm_getflags(d->dev) & SD_F_BITPERFECT)) { + *min_rate = min(*min_rate, caps->minspeed); + *max_rate = max(*max_rate, caps->maxspeed); + } else { + *min_rate = min(*min_rate, feeder_rate_min); + *max_rate = max(*max_rate, feeder_rate_max); + } CHN_UNLOCK(c); } if (*min_rate == UINT32_MAX) @@ -422,8 +412,8 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) nvlist_add_number(di, SNDST_DSPS_PCHAN, d->playcount); nvlist_add_number(di, SNDST_DSPS_RCHAN, d->reccount); if (d->playcount > 0) { - sndstat_get_caps(d, true, &minrate, &maxrate, &fmts, &minchn, - &maxchn); + sndstat_get_caps(d, PCMDIR_PLAY, &minrate, &maxrate, &fmts, + &minchn, &maxchn); nvlist_add_number(di, "pminrate", minrate); nvlist_add_number(di, "pmaxrate", maxrate); nvlist_add_number(di, "pfmts", fmts); @@ -435,8 +425,8 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) nvlist_move_nvlist(di, SNDST_DSPS_INFO_PLAY, diinfo); } if (d->reccount > 0) { - sndstat_get_caps(d, false, &minrate, &maxrate, &fmts, &minchn, - &maxchn); + sndstat_get_caps(d, PCMDIR_REC, &minrate, &maxrate, &fmts, + &minchn, &maxchn); nvlist_add_number(di, "rminrate", minrate); nvlist_add_number(di, "rmaxrate", maxrate); nvlist_add_number(di, "rfmts", fmts); From nobody Wed Jul 10 16:49:12 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3jP3Mrqz5Qmt0; Wed, 10 Jul 2024 16:49: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 4WK3jN6zF0z4gnL; Wed, 10 Jul 2024 16:49:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xqNjYyqDjGhSGh3NF4EYA3L0TUDaJ162dpo6qv+tIw0=; b=nq53vSML/ug+9PtkJRjNpO4ZdeluuWHxJs08Je4Juai5DybR3O4MR82yWnILPumcOpJ6E2 Epa8xw/m5OKFFejGwskULB28BsCxHaeEB43GkRu/QU9UNTIA6OIA+ut4X8fNRQn375k2YA RkmUekQkptWiR6fcR58nGcbLwKB7tNkB6HP+kj1ryjg34orJ99RFrCVgZmM/XzwZGWpnrJ T6PpmsdUjs+ZWs7EAzIeYjijN+H2r67+SWuksOehEWY+AEdJU7SzqLwBwHbDgSDMRA8tjl iS+zT7lemM3eU0zXsZBzjn5McUjYcmlBDAVdNw4Dxm+tBq7tOhGO7/c4go0FiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630153; a=rsa-sha256; cv=none; b=Mr34JucqorF5c3fPVA+Ms01gvbwdEK39p8/QHCmV5Qc/hvUAu/uicP4npJ+gDuqHypF5jn KXgL+4sTa/NOyxkVB/6oz2d8LdqsklB+7KbtUS59lqEL+HStLaDwUXoYnYjDFwmK57C6e8 v9bLCs2MTPORk2dH6xgDkCHhKAh7eVUIWJ+rLQ92aGtf9XmR95/v+35SQtTR/LFnlxRWsT EMzvDO4nc2jByjxmLn2ZgiodGaDhsS/qeFVaQwuoxLbKgbOlvpCqCZB5WvX5ak+chLN59W m2CzBqS2Su2gFwkIIxZ5iX1fCfjWE9jr3+tR+hx02hWcw1ikF6TMdGbN3dgoAg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xqNjYyqDjGhSGh3NF4EYA3L0TUDaJ162dpo6qv+tIw0=; b=BmiEYOGzgfpk4DjtcS/j8T3O8RRhOMRL6RHNg9x3QGovQI799dBTer0Z0M4xi4PcI3Y0l3 1HGhxrVR0IqTi6/2LrAnLo5yAJLxUmy3luc2SEfHoE8CzV2ykfgpbCNd03AtsbIZUWFsJY QZ8tAB2e6RMJQaklwR1oFpo0EwKVUw9z5SysC6RDDNR6QrU6nYNlvLjjdMRr0aOVYaAYV6 DnTqHHxFlfKQBxY/vhYOyBt8OkNFfNBBO+V6iJk1BChyMPH+6QH5eMoTCroqOTA2BdxmtE U0FDGi23dKalBFmW2FpsHqBhQJeJIFERzLgaNECsl5qZV7eFOYbwtK+zhPIyow== 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 4WK3jN5Tz2zPYV; Wed, 10 Jul 2024 16:49: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 46AGnCkG035223; Wed, 10 Jul 2024 16:49:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGnC3r035220; Wed, 10 Jul 2024 16:49:12 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:12 GMT Message-Id: <202407101649.46AGnC3r035220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: efaa4bcc9283 - stable/14 - sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: efaa4bcc92835cd4208717d518cacd0aa6f8b1dd Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=efaa4bcc92835cd4208717d518cacd0aa6f8b1dd commit efaa4bcc92835cd4208717d518cacd0aa6f8b1dd Author: Christos Margiolis AuthorDate: 2024-07-06 18:23:15 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:13 +0000 sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO If the channel list is empty, min_rate and min_channels will be INT_MAX. Instead, assign them to 0, like we do in sndstat_get_caps(). Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45876 (cherry picked from commit 1a768ea9db3d66941b0dc5340ac028ef548808b8) --- sys/dev/sound/pcm/dsp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 0689dfedb9c2..2b765bc8b115 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2182,6 +2182,10 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai, bool ex) CHN_UNLOCK(ch); } + if (ai->min_rate == INT_MAX) + ai->min_rate = 0; + if (ai->min_channels == INT_MAX) + ai->min_channels = 0; PCM_UNLOCK(d); From nobody Wed Jul 10 16:49:13 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3jQ40jnz5Qmjn; Wed, 10 Jul 2024 16:49: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 4WK3jP6zRWz4gZH; Wed, 10 Jul 2024 16:49:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r7Vq/OM0tqEuLuCLUmqcVjNpMUcCPjaaSKyoCeJP9aM=; b=AcSGufBgTXLTdEA5CFp2mMLSy0RpVvgJw/56xUGh6bM/+J5fsnbXmPu8PybAN2zE0Qdddx SLUY00+o4vgHRm6H2iA/nBUmyyMwa3DRU+vL95UgzYJ2SCC1AG4upWkc1fPBFPKgrHpsYS Ju/nHy0npg826AQCpp4o6YiEiiNZf2MxmzbWAmjyb7R6deRzArlJWj9neoz7hYUfn3jV+4 xyd4Fr0OYyMPUaKoTOuPOCNuHrrbXcgIQAR4nHKDwiJfOVz5/psxpj32xnJiPDrN5KMROT thystFM4Dxg0Mc+jiXPs+UoWyX+2cnSp6bvgB3nDzfrPG5FDaD3KxKRR5EJNHw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630154; a=rsa-sha256; cv=none; b=iIl7ERVWWZoZfESJwxLe40aeyRKrbPdRo8JAQyiRRl4h1v0yf2j3a4SnH8hcZqPQzCq08e Q+U10u8a6qoHSKY8o0wyFMJExBNW+uhp+9EtnbQBqoCseY/PLs5zdZHKVMDmLl1Wnw9sRn WSOk3jW7R71kSJtVLdHqb8qV6hk3bUj7/TeyW2l7VsaB0UNE1z3LJlNq9EL+oJMH7tDyN+ eDNDECz2bB878wqbUW0uuVDg2h5ifDwqoJYx9dgYDw/BqmvRIyBrrwMIqfhA4+bGhS8hky d5KyCdT5ILh5NnBOK4lbtlHf95VmRu30x/RkKvtOwOWS04n0MUrED/DheZ+RmQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r7Vq/OM0tqEuLuCLUmqcVjNpMUcCPjaaSKyoCeJP9aM=; b=TDBkBk6Bjnbc5R4KvC3bx1bQOkWZhZjeWKaujXc476n1HZXTGMC1qTRSDDOXVcPr50iUM0 ph3WDTdS+PmbjUTbWYJb5od17r9hc7Ufw4lf4CK62gYZUFRJbpXtD0A83OaZDFO8bbqr9J js4i6NLlWyikryvoAfmKsfhqqpIQqMmeYcgSqBjvWiHePo0J/9r+4HnYx2MdRsCeOcg2tX Xg4jdTXS4vgS7wYj638oaaU6xFxZ6w5Y4C7UWiPMznrAWCjhIdKyKcDjxUanz5ACNE9HZu Hfw36hFoXi+fqEsAA2oAWp8ySnStKhMjLntSooqEBeebG0W2iqxQQmC21f1GyA== 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 4WK3jP6YmlzQ3P; Wed, 10 Jul 2024 16:49: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 46AGnD9N035272; Wed, 10 Jul 2024 16:49:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGnDtN035269; Wed, 10 Jul 2024 16:49:13 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:13 GMT Message-Id: <202407101649.46AGnDtN035269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: fab137d23462 - stable/14 - sound: Add missing CHN_[UN]LOCKs in sndstat List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: fab137d2346252f210417e9dee0ca190d5cbe198 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=fab137d2346252f210417e9dee0ca190d5cbe198 commit fab137d2346252f210417e9dee0ca190d5cbe198 Author: Christos Margiolis AuthorDate: 2024-07-06 18:23:22 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:13 +0000 sound: Add missing CHN_[UN]LOCKs in sndstat In sndstat_build_sound4_nvlist(), if we have INVARIANTS or SND_DIAGNOSTIC enabled, we will hit a lock assertion panic when we call CHN_GETVOLUME(). Also lock the channel in the sndstat_prepare_pcm() loop for good measure. Fixes: bbca3a75bb41 ("sound: Include sound(4) channel information in sndstat nvlist") Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45898 (cherry picked from commit e850bd36dfda98608432d2459800627d16119fec) --- sys/dev/sound/pcm/sndstat.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index 5b770810d19b..753531f3694e 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -456,6 +456,8 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) goto done; } + CHN_LOCK(c); + 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 : ""); @@ -537,6 +539,8 @@ sndstat_build_sound4_nvlist(struct snddev_info *d, nvlist_t **dip) sbuf_printf(&sb, "%s]", (c->direction == PCMDIR_REC) ? "userland" : "hardware"); + CHN_UNLOCK(c); + sbuf_finish(&sb); nvlist_add_string(cdi, SNDST_DSPS_SOUND4_CHAN_FEEDERCHAIN, sbuf_data(&sb)); @@ -1230,6 +1234,8 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) KASSERT(c->bufhard != NULL && c->bufsoft != NULL, ("hosed pcm channel setup")); + CHN_LOCK(c); + sbuf_printf(s, "\n\t"); sbuf_printf(s, "%s[%s]: ", @@ -1321,6 +1327,8 @@ sndstat_prepare_pcm(struct sbuf *s, device_t dev, int verbose) } sbuf_printf(s, "{%s}", (c->direction == PCMDIR_REC) ? "userland" : "hardware"); + + CHN_UNLOCK(c); } return (0); From nobody Wed Jul 10 16:49:14 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WK3jR5rlsz5Qmr5; Wed, 10 Jul 2024 16:49: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 4WK3jR0w44z4gdH; Wed, 10 Jul 2024 16:49:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9jsBToIkEXlsmoSis+149BrJcmXb/Fpt2HP8KpZFRik=; b=GAbFoOKDmcsTct977w5y9nwibI8MHbT084AQzZsu8BLQaZ1hba1gfe8LzVZbO1TDRFwDi/ 1pM9w9PiJS2qwkMNY08zqg6+I7Crs1nDS/du650WEbftnNAMXTueKCAxHaYtUUO8Mcd29d qrgQUtOOwiem1MtYd6t3H28Prxemm52saDmhDOg+CQuOkd+wvkFDb7Ko7eyyTXK/cKJvFU bW1WnYH8cr9lc9d2K2m7ghJrVXoIMf7dJhHIZ/Ul05eSUYiQmwHesUEJQt4XU1V5CiJ7AD 5PlBcAcZarDyaRATNax4kE7AM0IhliVg6L5ihbitak+cnC8/Bd9fgluZWiT66A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720630155; a=rsa-sha256; cv=none; b=mUBBecAzUg3E2hRqh7Nt0fMMGIZmN8e6/oidPH6fkX+bLZYm3VT3/FGKi/U1GY+6XYp7xX 9g8tgpx5HsJ125VB191AkrizYVoiixgJy5T7DWd+s2zmotWqwm7JBoSllzDmSyKtq3hj+v yhNwzycNVgBzJKRHW7skmaTOSZEZH/ktAaHXN7tGxx4uBR2Ob2OtBr4CBWnVI11uFB/13e 9TEzWCIiy6OZ1ZqYCC8/iRPDlPiIMBCRnMxmpKF7x2x6M3dK2+zcJ2SZW/dkXFWRROQFGF kTdKZChCck3qM0XI7aWz+4ciLDCcohXonl6C98qTKKoPQV2xFnCBfLHIocvyAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720630155; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9jsBToIkEXlsmoSis+149BrJcmXb/Fpt2HP8KpZFRik=; b=VbNwdjVvKsUS5hdd6I6vZCCeVSX7H6pioZIgEEVvDDsNbs4ZPLHn0nZ+SBOhgI7gXPnYU1 fpbIbgav1UfKgquKQ1c2u61EQLnqIjjNko8VSTIvAT5C9AkGe+yvsLXAef0IZwcgvFIW6P ASWhgKpVqX9IGaDNKakbTpAPeblxc1HH4/iXL6OQNHZj5LCGV03CFa6co0al2U6ZBmdGsM cYqK+dqsxTsIgrTHEZnOwtDEsYOfT2rwY51VtiLQsHno66hLQno2I4Z3GPEV0V+q5EBz1y 2VNMR65NOjVOJdA3vvpiovbXJg0gh2qxahmPJCQWMJBoJUkSySuKxAdqXR8rMg== 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 4WK3jR0SlDzQ5V; Wed, 10 Jul 2024 16:49: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 46AGnEN7035343; Wed, 10 Jul 2024 16:49:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AGnEFQ035340; Wed, 10 Jul 2024 16:49:14 GMT (envelope-from git) Date: Wed, 10 Jul 2024 16:49:14 GMT Message-Id: <202407101649.46AGnEFQ035340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: d6b6165ebb3f - stable/14 - sound: drop midistat lock in error path List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: d6b6165ebb3f3a591b2ba0f7c3b6dabca78806f3 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=d6b6165ebb3f3a591b2ba0f7c3b6dabca78806f3 commit d6b6165ebb3f3a591b2ba0f7c3b6dabca78806f3 Author: Robert Wing AuthorDate: 2024-07-09 19:20:59 +0000 Commit: Christos Margiolis CommitDate: 2024-07-10 16:48:14 +0000 sound: drop midistat lock in error path Fixes: fc76e24e583d45a3a59fd7ad4e603c0679eaf572 Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45939 (cherry picked from commit 3114d55866b86ca1132923211936aa23881b0057) --- sys/dev/sound/midi/sequencer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/sound/midi/sequencer.c b/sys/dev/sound/midi/sequencer.c index ab2d48294a6a..e4ea1e208356 100644 --- a/sys/dev/sound/midi/sequencer.c +++ b/sys/dev/sound/midi/sequencer.c @@ -751,6 +751,7 @@ mseq_open(struct cdev *i_dev, int flags, int mode, struct thread *td) mtx_lock(&scp->seq_lock); if (scp->busy) { mtx_unlock(&scp->seq_lock); + midistat_unlock(); SEQ_DEBUG(2, printf("seq_open: unit %d is busy.\n", scp->unit)); return EBUSY; } From nobody Wed Jul 10 22:05:42 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WKBkZ4W6Kz5RFNg; Wed, 10 Jul 2024 22:05: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 4WKBkZ3d6zz4KSZ; Wed, 10 Jul 2024 22:05:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720649142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=23TFtYWxKi8SKnhs6L3S7OUYnL6zfdJ18Kq58myRgTA=; b=tmvzdKzbWlhGNK6OBfuYMNjosK3s/xuzjMQucP2YmpZ/MuV1OdeuWziofcCr8imtPtzLbb CURSBiknCoWFpiZa2jQro4IPbMuAeJ/090QxF5Fct2dHC+5KVEaL3UFUs9SpSBphTveWB1 Q8bbrPv5Xn/UF1xA/0MYg2f5siX2MerP+wOs2pZB35E3LZXFYpNI62q5hWPqUxH7/btNia KouI1q//HwcJQ4S/7uTkCj7FIMF1CW+qEzaXfNdjDYPIrIATUnZxb0ciE+/kjyFGu5h6kr lSFa8WZwBCAYlGxw/KytMpPyJYEpzsRhVN7QA0ddgwDWp2mwkC9JcWlzpAv5Nw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720649142; a=rsa-sha256; cv=none; b=n7/pVhYztH4MeQQo1lEhS/XOR10u0WX1uQ37CjI5PkJlgnsQIh50Lq37eXYPtJHkAqFwii Tsc0JOWJx8BZy7WpmV8fOvc21nLKHT59HZa1/zg5cFd6Be+4MsJkgWJr5k9M4o+/FTpJq4 nVTpO4NQrbvmb21APaEtYFTH6ZPYaUBI04Xvo74cI0l91kWjgWiE6XTf6Oj4iiwB/UE3eu 4+N0je5M3WK3woVI2RtVhnYtCxeG27QpyOmhiMCP/O+Mj0MrIjfUpvC3+fZmoTZ8qDM79i Xu0gj85oQWrsYeZa8M+ma/TrMU7PcNOZuERGbm6UyZtUu4juhyG4o46JHh/pdw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720649142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=23TFtYWxKi8SKnhs6L3S7OUYnL6zfdJ18Kq58myRgTA=; b=RX/TBiboG9xyXJ76ULoZO46rrxuj+2JkY49Sen+cXLCvIgNdIBZ3CqHkN9m2SCtgIX7QK5 V11fXz/D9d2RJVPMoDUVgZzV8DKA/dZmk/eQzaETV9EfFY5xuXNpSyGW3idrQeYk+MWpK4 6K6sVfP0zEv9Fe2pyhqbzBtEm9/pOmqtdYNj+D9OnH8uH7wH0m06noO5lPFtvytNktc218 TxIoZVoTiqBOtSWI86gRNYaSVxkxl04mqxgVe+C3YwMS2EXrc3wlVsrC/iVXWxvMpNNnW1 MOvSfZO4Q3nwWSfWLDNhdgtOsCVoXSacMYGi/6gSlbViZxx+nzHFYiQgFn/wBQ== 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 4WKBkZ3CzwzZtN; Wed, 10 Jul 2024 22:05: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 46AM5g5A079901; Wed, 10 Jul 2024 22:05:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AM5goS079898; Wed, 10 Jul 2024 22:05:42 GMT (envelope-from git) Date: Wed, 10 Jul 2024 22:05:42 GMT Message-Id: <202407102205.46AM5goS079898@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: b7f6841e00d5 - stable/14 - vfs: make skipping LRU requeue optional List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: b7f6841e00d53f1aee65a8cce4f98c239ae4cf75 Auto-Submitted: auto-generated The branch stable/14 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b7f6841e00d53f1aee65a8cce4f98c239ae4cf75 commit b7f6841e00d53f1aee65a8cce4f98c239ae4cf75 Author: Mateusz Guzik AuthorDate: 2024-07-08 12:24:41 +0000 Commit: Mateusz Guzik CommitDate: 2024-07-10 22:04:40 +0000 vfs: make skipping LRU requeue optional As explained in the comment in the code it is a bottleneck in certain workloads. On the other hand it does not need to be skipped in most cases, while transiently running into the lock being contended happens a lot. (cherry picked from commit 0a9aa6fdf58468945240e86bf16c268acc8c1776) --- sys/kern/vfs_subr.c | 54 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index d1c17dca37d4..646339987ba2 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -224,6 +224,10 @@ static counter_u64_t vnode_skipped_requeues; SYSCTL_COUNTER_U64(_vfs_vnode_stats, OID_AUTO, skipped_requeues, CTLFLAG_RD, &vnode_skipped_requeues, "Number of times LRU requeue was skipped due to lock contention"); +static __read_mostly bool vnode_can_skip_requeue; +SYSCTL_BOOL(_vfs_vnode_param, OID_AUTO, can_skip_requeue, CTLFLAG_RW, + &vnode_can_skip_requeue, 0, "Is LRU requeue skippable"); + static u_long deferred_inact; SYSCTL_ULONG(_vfs, OID_AUTO, deferred_inact, CTLFLAG_RD, &deferred_inact, 0, "Number of times inactive processing was deferred"); @@ -3785,31 +3789,41 @@ vdbatch_process(struct vdbatch *vd) * lock contention, where vnode_list_mtx becomes the primary bottleneck * if multiple CPUs get here (one real-world example is highly parallel * do-nothing make , which will stat *tons* of vnodes). Since it is - * quasi-LRU (read: not that great even if fully honoured) just dodge - * the problem. Parties which don't like it are welcome to implement - * something better. + * quasi-LRU (read: not that great even if fully honoured) provide an + * option to just dodge the problem. Parties which don't like it are + * welcome to implement something better. */ - critical_enter(); - if (mtx_trylock(&vnode_list_mtx)) { - for (i = 0; i < VDBATCH_SIZE; i++) { - vp = vd->tab[i]; - vd->tab[i] = NULL; - TAILQ_REMOVE(&vnode_list, vp, v_vnodelist); - TAILQ_INSERT_TAIL(&vnode_list, vp, v_vnodelist); - MPASS(vp->v_dbatchcpu != NOCPU); - vp->v_dbatchcpu = NOCPU; + if (vnode_can_skip_requeue) { + if (!mtx_trylock(&vnode_list_mtx)) { + counter_u64_add(vnode_skipped_requeues, 1); + critical_enter(); + for (i = 0; i < VDBATCH_SIZE; i++) { + vp = vd->tab[i]; + vd->tab[i] = NULL; + MPASS(vp->v_dbatchcpu != NOCPU); + vp->v_dbatchcpu = NOCPU; + } + vd->index = 0; + critical_exit(); + return; + } - mtx_unlock(&vnode_list_mtx); + /* fallthrough to locked processing */ } else { - counter_u64_add(vnode_skipped_requeues, 1); + mtx_lock(&vnode_list_mtx); + } - for (i = 0; i < VDBATCH_SIZE; i++) { - vp = vd->tab[i]; - vd->tab[i] = NULL; - MPASS(vp->v_dbatchcpu != NOCPU); - vp->v_dbatchcpu = NOCPU; - } + mtx_assert(&vnode_list_mtx, MA_OWNED); + critical_enter(); + for (i = 0; i < VDBATCH_SIZE; i++) { + vp = vd->tab[i]; + vd->tab[i] = NULL; + TAILQ_REMOVE(&vnode_list, vp, v_vnodelist); + TAILQ_INSERT_TAIL(&vnode_list, vp, v_vnodelist); + MPASS(vp->v_dbatchcpu != NOCPU); + vp->v_dbatchcpu = NOCPU; } + mtx_unlock(&vnode_list_mtx); vd->index = 0; critical_exit(); } From nobody Wed Jul 10 22:05:43 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WKBkb4sp1z5RFXL; Wed, 10 Jul 2024 22:05:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WKBkb46xXz4KnT; Wed, 10 Jul 2024 22:05:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720649143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6zTncvDepvINt1J0hDFvXl97E1NZCgo+u51GzTuq9vA=; b=sWRh2nFzwsIhAaDauzktrV1T0JV2BynNxYB7ex6oUbEn0+kSZBZFp27oAcNAnq5c/sBuOQ mbhgp688Cwk8tmh/UwX2mSrThu3REZhPjtKk4NdpZbifoWf6aMlMRfiM2eqhiCi+5KSdCw 37IypCFK8GwMe9Bt0MovkMIddajo6HPjTBLAsmT4j7fGSZUMItPhdIRR3s1duCa9r/rGXH 757BE8inW6ZNs8YjtCAM0d3wJebohforvt8ObR6QTnWGFUpCaXyYTW9poY48D5UOwvvlzH ZPsx6QT3kAox6xvyi8PHOlLoeZ3aHLVrNFqjr/nimv2cVuG5Xtzf5J0FOJJQ0Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720649143; a=rsa-sha256; cv=none; b=jnmrC73IqmeOo7TmVf9ezgL8eKMl4Hi5ht8YlsIrVYGdffmlzmlxPtkYGg07DrRz3QV/7g dTHbvFOIbWgai83L0ZhTOYr4mCVwFecsVYCBJZH3wmk2YciEPpusP7KDkuggI8fEANgDDl aZEUPKUWJGQDf7cTHSSGgOuYiboXAuOAFPXcalH5meUk3Igi7NWAFUMtNxZ+ylGkopBhY9 0K9x24zZvOw4v4N+0TmAEXOPsCUiKljwM/eOgPVWMZWJ4mT9hf5TMK79YkxTHrr2/zYq8W 4msO7SA2RfFiElmSAHnX7aJIh1ssUV/jfyU4HMiDbVBTqxUKqFU8Hp0Vyyrnpw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720649143; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6zTncvDepvINt1J0hDFvXl97E1NZCgo+u51GzTuq9vA=; b=tOz8sZkIgye7/nzmTpagxRAF/0iArnMM3XhxL/zRgZuvHMHw15/gUfFMH8lS0Ki8k3DVmF ybGIZuPxOxvoefZO9RyWArZor2XVd4XefWfPQgkHrHpRNaGZdOOSaM6Siy+wLzY9QuXEcb bJ9oRNlc2/CmogoFW+Iuo6bcBl5Wc8XWTfjZK/HMDUM25RrA3qoU2vmdvilBOVhQhTXiy7 yRUJuTwpk0XcuX7Xm99m6m63WTftakD0UTllXs+8gChJifwX3xBFaeUM9CtkjnptgDPody x10YZgZWoOUbiooPGS6VGFGya7Y4S017v8Z0hc99vJBLdAMHYfN/2Usd/WYfqA== 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 4WKBkb3kt1zZtP; Wed, 10 Jul 2024 22:05:43 +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 46AM5hP8079949; Wed, 10 Jul 2024 22:05:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AM5hLO079946; Wed, 10 Jul 2024 22:05:43 GMT (envelope-from git) Date: Wed, 10 Jul 2024 22:05:43 GMT Message-Id: <202407102205.46AM5hLO079946@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 72f8b18b8d93 - stable/14 - vfs cache: add sysctl vfs.cache.param.hitpct List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 72f8b18b8d93bee8f6ca6ed0dfa160db18424807 Auto-Submitted: auto-generated The branch stable/14 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=72f8b18b8d93bee8f6ca6ed0dfa160db18424807 commit 72f8b18b8d93bee8f6ca6ed0dfa160db18424807 Author: Mateusz Guzik AuthorDate: 2024-07-08 17:57:39 +0000 Commit: Mateusz Guzik CommitDate: 2024-07-10 22:04:40 +0000 vfs cache: add sysctl vfs.cache.param.hitpct Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 0a487207227badcbfbec029103ac7e2d5291bd30) --- sys/kern/vfs_cache.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 70c4dbc01c98..9ec0970628b4 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -984,6 +984,26 @@ SYSCTL_PROC(_vfs_cache, OID_AUTO, nchstats, CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, 0, sysctl_nchstats, "LU", "VFS cache effectiveness statistics"); +static int +sysctl_hitpct(SYSCTL_HANDLER_ARGS) +{ + long poshits, neghits, miss, total; + long pct; + + poshits = counter_u64_fetch(numposhits); + neghits = counter_u64_fetch(numneghits); + miss = counter_u64_fetch(nummiss); + total = poshits + neghits + miss; + + pct = 0; + if (total != 0) + pct = ((poshits + neghits) * 100) / total; + return (sysctl_handle_int(oidp, 0, pct, req)); +} +SYSCTL_PROC(_vfs_cache_stats, OID_AUTO, hitpct, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD, NULL, 0, sysctl_hitpct, + "I", "Percentage of hits"); + static void cache_recalc_neg_min(void) { From nobody Wed Jul 10 22:07:06 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WKBmB5Z8Bz5RFhh; Wed, 10 Jul 2024 22:07: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 4WKBmB54Pcz4L9M; Wed, 10 Jul 2024 22:07:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720649226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=apvHqVVhnwYqkB3SbKJwILbpb5QoZWruDcK/324HXIc=; b=NJXjuxLoYfiqoDMrZptvGpCcaI/Z2wTjvS1BQhBp2g9K185WjEsbxN+BImhpp1i+fqJAWm KhdsEeHcSVpuKmXqaIOi9AS19zYy3bFjqut9KpJPdB9e4I1l7YUN14XXNkWZesPFIrD7wy ptJjebKoPYYjih7Ze/GdK3dWSrzE2zcNx3Idus9EKybeSle/KQRfmwHa1hojLnAmFjmLBq sptuQv8N+gnOMDhU1+zIdq/3L9j+d17zXYby640SPGsH1CEHlyCsNsDQJ5z7iuKiShdAp4 Uea8XlsVMIz2vxPeyH1gNWtZIuxl5vzsNXbEbT12KvYiJBloMD23lsfjmTx4fw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720649226; a=rsa-sha256; cv=none; b=iClNkvFvB3K1FjdggY7bXuSy4pkovRSeWcvOgDKrLI2/NG5Hc9KYAyRYcxB2a1B+9h9wvI D1d7+1dJewa8un2FXSUoyzMNJujmJuFmpxViniDoVmu2f8JqpCXL9vopnZ/Teh/+Epx2z/ UTC/a+8+1Pp1SuK7E8tL6pRQDw10BjSvj3SBawDYqvMvY0xPLe3HbSa/lgDoX/6xKcXMvj DJAhgmcKPX5RJ1vrIpXgxkK566NXrjjM363ZmWRo3qWMhqpLB7LK8QYgyQydfmKF0AC30r sMoqkEJZu7ypixGDKk2cNG9bighnKfvG8jHlwstwVpGgCgnckRwJARiPZ7DkXg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720649226; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=apvHqVVhnwYqkB3SbKJwILbpb5QoZWruDcK/324HXIc=; b=In5CA8sBxiMu6AjlMpb83P4t18+79cZntDO7V+PDadVlvuJ9+54cCoJbZuYjRf71jAKB5J onUSNL38KfsPzawCGWtB7470Xd2Mr4BH3AKWoRRXkl1OxSlplrdJU7OWK3rzEaogb4dato /tCAC+MUDHhndd+UziKS7b+rzAz9yxJOFglg7fyXHxkxP4KDwKQRME6DFlI7SllfYpck9h pZ3ajudLv98Iu2Sxb6bgU8Gr3PxWYr9pscoLZe8BBpKPKhH+A/1iCS57mrDXthWy6UCjiU wGvvnHKD3SHv8hnRePtTdBQHz/n8FJywXipnIS75njO6hxni8ONIEEVMr1HzHQ== 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 4WKBmB4hH7zb4N; Wed, 10 Jul 2024 22:07: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 46AM760e080239; Wed, 10 Jul 2024 22:07:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AM76XD080236; Wed, 10 Jul 2024 22:07:06 GMT (envelope-from git) Date: Wed, 10 Jul 2024 22:07:06 GMT Message-Id: <202407102207.46AM76XD080236@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 1f0f120183db - stable/13 - vfs: make skipping LRU requeue optional List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1f0f120183db12e680107a0553a8de2d854aa757 Auto-Submitted: auto-generated The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=1f0f120183db12e680107a0553a8de2d854aa757 commit 1f0f120183db12e680107a0553a8de2d854aa757 Author: Mateusz Guzik AuthorDate: 2024-07-08 12:24:41 +0000 Commit: Mateusz Guzik CommitDate: 2024-07-10 22:06:15 +0000 vfs: make skipping LRU requeue optional As explained in the comment in the code it is a bottleneck in certain workloads. On the other hand it does not need to be skipped in most cases, while transiently running into the lock being contended happens a lot. (cherry picked from commit 0a9aa6fdf58468945240e86bf16c268acc8c1776) --- sys/kern/vfs_subr.c | 54 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 33232987705e..a1b4779b6d3f 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -223,6 +223,10 @@ static counter_u64_t vnode_skipped_requeues; SYSCTL_COUNTER_U64(_vfs_vnode_stats, OID_AUTO, skipped_requeues, CTLFLAG_RD, &vnode_skipped_requeues, "Number of times LRU requeue was skipped due to lock contention"); +static __read_mostly bool vnode_can_skip_requeue; +SYSCTL_BOOL(_vfs_vnode_param, OID_AUTO, can_skip_requeue, CTLFLAG_RW, + &vnode_can_skip_requeue, 0, "Is LRU requeue skippable"); + static u_long deferred_inact; SYSCTL_ULONG(_vfs, OID_AUTO, deferred_inact, CTLFLAG_RD, &deferred_inact, 0, "Number of times inactive processing was deferred"); @@ -3795,31 +3799,41 @@ vdbatch_process(struct vdbatch *vd) * lock contention, where vnode_list_mtx becomes the primary bottleneck * if multiple CPUs get here (one real-world example is highly parallel * do-nothing make , which will stat *tons* of vnodes). Since it is - * quasi-LRU (read: not that great even if fully honoured) just dodge - * the problem. Parties which don't like it are welcome to implement - * something better. + * quasi-LRU (read: not that great even if fully honoured) provide an + * option to just dodge the problem. Parties which don't like it are + * welcome to implement something better. */ - critical_enter(); - if (mtx_trylock(&vnode_list_mtx)) { - for (i = 0; i < VDBATCH_SIZE; i++) { - vp = vd->tab[i]; - vd->tab[i] = NULL; - TAILQ_REMOVE(&vnode_list, vp, v_vnodelist); - TAILQ_INSERT_TAIL(&vnode_list, vp, v_vnodelist); - MPASS(vp->v_dbatchcpu != NOCPU); - vp->v_dbatchcpu = NOCPU; + if (vnode_can_skip_requeue) { + if (!mtx_trylock(&vnode_list_mtx)) { + counter_u64_add(vnode_skipped_requeues, 1); + critical_enter(); + for (i = 0; i < VDBATCH_SIZE; i++) { + vp = vd->tab[i]; + vd->tab[i] = NULL; + MPASS(vp->v_dbatchcpu != NOCPU); + vp->v_dbatchcpu = NOCPU; + } + vd->index = 0; + critical_exit(); + return; + } - mtx_unlock(&vnode_list_mtx); + /* fallthrough to locked processing */ } else { - counter_u64_add(vnode_skipped_requeues, 1); + mtx_lock(&vnode_list_mtx); + } - for (i = 0; i < VDBATCH_SIZE; i++) { - vp = vd->tab[i]; - vd->tab[i] = NULL; - MPASS(vp->v_dbatchcpu != NOCPU); - vp->v_dbatchcpu = NOCPU; - } + mtx_assert(&vnode_list_mtx, MA_OWNED); + critical_enter(); + for (i = 0; i < VDBATCH_SIZE; i++) { + vp = vd->tab[i]; + vd->tab[i] = NULL; + TAILQ_REMOVE(&vnode_list, vp, v_vnodelist); + TAILQ_INSERT_TAIL(&vnode_list, vp, v_vnodelist); + MPASS(vp->v_dbatchcpu != NOCPU); + vp->v_dbatchcpu = NOCPU; } + mtx_unlock(&vnode_list_mtx); vd->index = 0; critical_exit(); } From nobody Wed Jul 10 22:07:07 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WKBmC70QXz5RFXf; Wed, 10 Jul 2024 22:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WKBmC5yjvz4LFM; Wed, 10 Jul 2024 22:07:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720649227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=65aJ/Avz8bh9Lz77lZdEn++bYOQCDv5bXFyfM+TNFZE=; b=C5PaCKSNa72nB+cUDMVvQDe6n5wiBBrUauLiaN99nW5nW4VXaKdy3qb9rES/DgR27L65Su g93L5YAIQXjVF12L4RP472rO4xKyfAXtN5Guo6UEm0Nw2cNg7qBX5lQmejzOqk5B17k2gk HszLwnmH2a8n/VjyQmMTJ3XCCQEWyACZyS0K/eFbV37P16pFicojV1glwEGkf31/EUPSId U21lAR/c0oC63gP9PWLY6r2EYGpIUrMsG5gnABwrGf/OwUULbauNvYWAFR98zEzy5GWDjC qof2pTHrGHa+4JD/EsCOA47nyQoNv4km3cy3lXyiu82XCKDBFm+Ss7soOmzBVg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720649227; a=rsa-sha256; cv=none; b=x5rc3iQ0TK+ZhIOMvbIekzsURHJXuk+t7ENXYs+x9obFDSo7jSwAUAqpZGUzpZjRXpSpD4 3eju7fEpp9HI4ZWOm1g2SZZUL8dTFYMH6Bg846kOpwMM8s2fGveNjFeuHUcSbuyf4gyG2C XxYvjnrjbsxo7ZirUrsNCCboQses+Ef8sKUMDY/wnTuSC22Vyf5rqw/YJDDU/sUd5pb2HO CnLySuxG8jlJj/ze7452wvbt2S+WIF2n0GRc6TyKMQuthfSciCm5mP1s45KgHyXdxuL7M8 dt10tagM7w0cUHLfHt6IIWjA+sgLFYn09b5ocIhFeDxdqvumHfE0GgwkWa/1QA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720649227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=65aJ/Avz8bh9Lz77lZdEn++bYOQCDv5bXFyfM+TNFZE=; b=j6Z87OZl6ZhU7YWdfL9Co9JoI7hGGmWwXBFDSdI+jGgFS3G/JWeG7rt17qsvU5xZ48qEdo w6l2i5Q2fqHdsIKV2G/jWw96qhIQIDnmMmeP5OKLID+LjTOFQyvOl3dyu8NYsk1rEXlDK6 wU3w/+tQ/Fpi2RCU7UVtPzgCdm/nLAagjRfRAU6SbHEUB9kpT7C9Rp9a5LhUfPfshTmKDF /jr44XdysgyuCulO3zT8snWCg0gW8EthaDRaZOCzM3hONDpVdcFP55LCnd8XnbSKghRLUW KrActvsSKMk0JyXD2enoCxSqxRhEhZ/+vFy0D2t0nWxkmFAvjpkd72fpC42MLQ== 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 4WKBmC5ZtCzb4P; Wed, 10 Jul 2024 22:07: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 46AM771F080284; Wed, 10 Jul 2024 22:07:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46AM778e080281; Wed, 10 Jul 2024 22:07:07 GMT (envelope-from git) Date: Wed, 10 Jul 2024 22:07:07 GMT Message-Id: <202407102207.46AM778e080281@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 8b5eb0cf6c4f - stable/13 - vfs cache: add sysctl vfs.cache.param.hitpct List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8b5eb0cf6c4f586f891fef7fb067beb343826435 Auto-Submitted: auto-generated The branch stable/13 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=8b5eb0cf6c4f586f891fef7fb067beb343826435 commit 8b5eb0cf6c4f586f891fef7fb067beb343826435 Author: Mateusz Guzik AuthorDate: 2024-07-08 17:57:39 +0000 Commit: Mateusz Guzik CommitDate: 2024-07-10 22:06:15 +0000 vfs cache: add sysctl vfs.cache.param.hitpct Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 0a487207227badcbfbec029103ac7e2d5291bd30) --- sys/kern/vfs_cache.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 647d4573563c..aacbd43403e1 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -988,6 +988,26 @@ SYSCTL_PROC(_vfs_cache, OID_AUTO, nchstats, CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, 0, 0, sysctl_nchstats, "LU", "VFS cache effectiveness statistics"); +static int +sysctl_hitpct(SYSCTL_HANDLER_ARGS) +{ + long poshits, neghits, miss, total; + long pct; + + poshits = counter_u64_fetch(numposhits); + neghits = counter_u64_fetch(numneghits); + miss = counter_u64_fetch(nummiss); + total = poshits + neghits + miss; + + pct = 0; + if (total != 0) + pct = ((poshits + neghits) * 100) / total; + return (sysctl_handle_int(oidp, 0, pct, req)); +} +SYSCTL_PROC(_vfs_cache_stats, OID_AUTO, hitpct, + CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RD, NULL, 0, sysctl_hitpct, + "I", "Percentage of hits"); + static void cache_recalc_neg_min(void) { From nobody Fri Jul 12 12:05:08 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WL9Jh2lvTz5QG0f; Fri, 12 Jul 2024 12:05: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 4WL9Jh26PJz4vWH; Fri, 12 Jul 2024 12:05:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720785908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VQ+icz0yfRkMiVD16D07putQMolp+eZg6ZCItd7kCt8=; b=GLVIZOg/7cAEkBGHYDUnRVyAa2uS+bPeh6VIyDjDjIAOKdXObifLZ9oU9JCtOPH61OeibP 8A9Jg0hrZWdOBZKbsoJBoMS9KasPRbjOBJeZzpPG4F2rj4hQhtMgEXSp9AhLw75twahCYi 3IEheKeCQplZ1BLJ7OwfHEUa2YcvZM1rIvU4L6UPAKGdZetTESRiZ7V4qYQRdTT0vuTWFY VSdbjsbGBCV6kTaWTqI3pQnA1bw7/3/TlmsYYFCgd5EtiyIPq8Ct4DKzxHIEyH42UqXp3j mewl9Wm1RIER0rdX1Ix/OmUZ91dXoIT9y5ke0ZEKmie5Z/G6KWUWqKQ+/Pvolw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720785908; a=rsa-sha256; cv=none; b=n7TZSjPae7C/9qLVOpnWH5OW0Ox7LKxya8ey8Bq3HpnlWejc8MCydTfBshfVI7zxRqzSZR D0Iggl9uSAq/zWqB5vK+3rK7QZQ6exV/eNEvzyhtCbaNt2mGSU8St9jJdq7CS9c/cZsdYC MS6JZKcW/Osajf6rxdewR/YBDejw+vscYje6lpnW3UKFg1LIn+owYY26NHg38a6ENqFcqY dluZPY6B99m3TwyTKxLEjdenV4BmjPSbXAlgYw4i+qNonaeH4y4j4fMMV/ad3QWVg1NTsa O88BxsZQP3K5eRw4u2GBBlqmGwyw/kY/K1Y6yxQ2TJ6I9yqprlWCAJTwTLEmIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720785908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VQ+icz0yfRkMiVD16D07putQMolp+eZg6ZCItd7kCt8=; b=cwNhzz9AiAbDns2QO9H1RiUYcSSGFMTdmLOPZ0oEONCeNxLHsqD9gapF7JyiH1tiE7CE6x S5lVIOg2WZcUC9+9KaPFLdTwwJ2vwT9g83iy2r9UwfLeCLSTrv/o3N48yG1RHD/bwTTt1F l6I+iP5LJ+dpgWj4aDWqmMi4LjFjxoJN60QLtprKV+tdBj48qzhMwAb+4i0+5OuuxRcaa1 1SZsYUSiXidwvJZftDbYyd/+I57VLjolvye1ABGMOSA0oJDCetQgmTgN2FNUe5pKrOQJVI IikXS8In8WquChur6YFPeCeuwbECYbMK/eGS14N/PuLju3cEsgdOejMLZXFeJQ== 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 4WL9Jh1hbFzjLx; Fri, 12 Jul 2024 12:05: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 46CC58vI061930; Fri, 12 Jul 2024 12:05:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46CC58vu061927; Fri, 12 Jul 2024 12:05:08 GMT (envelope-from git) Date: Fri, 12 Jul 2024 12:05:08 GMT Message-Id: <202407121205.46CC58vu061927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: 6b1f530935c5 - stable/14 - net: Remove unneeded NULL check for the allocated ifnet List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6b1f530935c5f84ec65dad87b7c20c6b7a72a6d3 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=6b1f530935c5f84ec65dad87b7c20c6b7a72a6d3 commit 6b1f530935c5f84ec65dad87b7c20c6b7a72a6d3 Author: Zhenlei Huang AuthorDate: 2024-06-28 10:16:29 +0000 Commit: Zhenlei Huang CommitDate: 2024-07-12 12:03:37 +0000 net: Remove unneeded NULL check for the allocated ifnet Change 4787572d0580 made if_alloc_domain() never fail, then also do the wrappers if_alloc(), if_alloc_dev(), and if_gethandle(). No functional change intended. Reviewed by: kp, imp, glebius, stevek MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45740 (cherry picked from commit aa3860851b9f6a6002d135b1cac7736e0995eedc) --- sys/arm/allwinner/if_emac.c | 5 ----- sys/arm/ti/cpsw/if_cpsw.c | 5 ----- sys/dev/ae/if_ae.c | 6 ------ sys/dev/age/if_age.c | 6 ------ sys/dev/alc/if_alc.c | 6 ------ sys/dev/ale/if_ale.c | 6 ------ sys/dev/altera/atse/if_atse.c | 5 ----- sys/dev/axgbe/if_axgbe.c | 5 ----- sys/dev/bce/if_bce.c | 6 ------ sys/dev/bfe/if_bfe.c | 5 ----- sys/dev/bge/if_bge.c | 5 ----- sys/dev/bxe/bxe.c | 16 +++------------- sys/dev/cadence/if_cgem.c | 5 ----- sys/dev/cas/if_cas.c | 2 -- sys/dev/cxgb/cxgb_main.c | 5 ----- sys/dev/cxgbe/t4_main.c | 21 +++++---------------- sys/dev/cxgbe/t4_tracer.c | 5 ----- sys/dev/dc/if_dc.c | 5 ----- sys/dev/dpaa/if_dtsec.c | 6 ------ sys/dev/dpaa2/dpaa2_ni.c | 5 ----- sys/dev/ena/ena.c | 17 +++-------------- sys/dev/et/if_et.c | 5 ----- sys/dev/etherswitch/ar40xx/ar40xx_phy.c | 8 -------- sys/dev/etherswitch/arswitch/arswitch.c | 6 ------ sys/dev/etherswitch/e6000sw/e6000sw.c | 2 -- sys/dev/etherswitch/e6000sw/e6060sw.c | 6 ------ sys/dev/etherswitch/felix/felix.c | 3 --- sys/dev/etherswitch/infineon/adm6996fc.c | 6 ------ sys/dev/etherswitch/ip17x/ip17x.c | 6 ------ sys/dev/etherswitch/micrel/ksz8995ma.c | 6 ------ sys/dev/etherswitch/mtkswitch/mtkswitch.c | 6 ------ sys/dev/etherswitch/rtl8366/rtl8366rb.c | 6 ------ sys/dev/etherswitch/ukswitch/ukswitch.c | 6 ------ sys/dev/firewire/if_fwe.c | 6 +----- sys/dev/firewire/if_fwip.c | 4 +--- sys/dev/fxp/if_fxp.c | 5 ----- sys/dev/gem/if_gem.c | 2 -- sys/dev/gve/gve_main.c | 13 ++----------- sys/dev/iicbus/if_ic.c | 2 -- sys/dev/jme/if_jme.c | 6 ------ sys/dev/le/lance.c | 2 -- sys/dev/lge/if_lge.c | 5 ----- sys/dev/liquidio/lio_main.c | 5 ----- sys/dev/mana/mana_en.c | 5 ----- sys/dev/mge/if_mge.c | 6 ------ sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c | 5 ----- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 6 ------ sys/dev/msk/if_msk.c | 5 ----- sys/dev/mxge/if_mxge.c | 6 ------ sys/dev/my/if_my.c | 6 ------ sys/dev/neta/if_mvneta.c | 5 ----- sys/dev/netmap/if_ptnet.c | 6 ------ sys/dev/netmap/netmap_freebsd.c | 4 ---- sys/dev/nfe/if_nfe.c | 5 ----- sys/dev/nge/if_nge.c | 5 ----- sys/dev/ntb/if_ntb/if_ntb.c | 4 ---- sys/dev/oce/oce_if.c | 13 +++---------- sys/dev/ppbus/if_plip.c | 4 ---- sys/dev/qlnx/qlnxe/qlnx_os.c | 4 ---- sys/dev/qlxgb/qla_os.c | 3 --- sys/dev/qlxgbe/ql_os.c | 4 ---- sys/dev/qlxge/qls_os.c | 4 ---- sys/dev/re/if_re.c | 5 ----- sys/dev/rl/if_rl.c | 5 ----- sys/dev/sbni/if_sbni.c | 5 +---- sys/dev/sbni/if_sbni_isa.c | 7 +------ sys/dev/sbni/if_sbni_pci.c | 17 +++-------------- sys/dev/sbni/if_sbnivar.h | 2 +- sys/dev/sfxge/sfxge.c | 7 ------- sys/dev/sge/if_sge.c | 5 ----- sys/dev/sis/if_sis.c | 5 ----- sys/dev/sk/if_sk.c | 5 ----- sys/dev/smc/if_smc.c | 4 ---- sys/dev/ste/if_ste.c | 5 ----- sys/dev/stge/if_stge.c | 6 ------ sys/dev/sume/if_sume.c | 16 +++------------- sys/dev/ti/if_ti.c | 5 ----- sys/dev/tsec/if_tsec.c | 6 ------ sys/dev/usb/net/if_usie.c | 5 ----- sys/dev/usb/net/uhso.c | 4 ---- sys/dev/usb/net/usb_ethernet.c | 5 ----- sys/dev/usb/usb_pf.c | 6 ------ sys/dev/vge/if_vge.c | 6 ------ sys/dev/virtio/network/if_vtnet.c | 16 +++------------- sys/dev/vnic/nicvf_main.c | 17 +++-------------- sys/dev/vnic/thunder_mdio.c | 4 ---- sys/dev/vr/if_vr.c | 5 ----- sys/dev/vte/if_vte.c | 6 ------ sys/dev/xilinx/if_xae.c | 5 ----- sys/dev/xl/if_xl.c | 5 ----- sys/net/if_bridge.c | 4 ---- sys/net/if_disc.c | 5 ----- sys/net/if_edsc.c | 5 ----- sys/net/if_enc.c | 4 ---- sys/net/if_epair.c | 11 ----------- sys/net/if_lagg.c | 4 ---- sys/net/if_loop.c | 3 --- sys/net/if_stf.c | 5 ----- sys/net/if_tuntap.c | 3 --- sys/net/if_vlan.c | 8 -------- sys/net/if_vxlan.c | 5 ----- sys/net/iflib.c | 4 ---- sys/net80211/ieee80211.c | 4 ---- sys/netgraph/ng_eiface.c | 5 ----- sys/netgraph/ng_iface.c | 4 ---- sys/netpfil/ipfw/ip_fw_bpf.c | 4 ---- sys/netpfil/pf/if_pflog.c | 3 --- sys/netpfil/pf/if_pfsync.c | 4 ---- sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c | 4 ---- 109 files changed, 33 insertions(+), 608 deletions(-) diff --git a/sys/arm/allwinner/if_emac.c b/sys/arm/allwinner/if_emac.c index e0826cb6584a..bfd6e68ddc37 100644 --- a/sys/arm/allwinner/if_emac.c +++ b/sys/arm/allwinner/if_emac.c @@ -941,11 +941,6 @@ emac_attach(device_t dev) emac_reset(sc); ifp = sc->emac_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "unable to allocate ifp\n"); - error = ENOSPC; - goto fail; - } if_setsoftc(ifp, sc); /* Setup MII */ diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c index 223d24019cb8..8cb748cfc119 100644 --- a/sys/arm/ti/cpsw/if_cpsw.c +++ b/sys/arm/ti/cpsw/if_cpsw.c @@ -1025,11 +1025,6 @@ cpswp_attach(device_t dev) /* Allocate network interface */ ifp = sc->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - cpswp_detach(dev); - return (ENXIO); - } - if_initname(ifp, device_get_name(sc->dev), sc->unit); if_setsoftc(ifp, sc); if_setflags(ifp, IFF_SIMPLEX | IFF_MULTICAST | IFF_BROADCAST); diff --git a/sys/dev/ae/if_ae.c b/sys/dev/ae/if_ae.c index 061f29e91e9c..97b96161dfed 100644 --- a/sys/dev/ae/if_ae.c +++ b/sys/dev/ae/if_ae.c @@ -327,12 +327,6 @@ ae_attach(device_t dev) goto fail; ifp = sc->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "could not allocate ifnet structure.\n"); - error = ENXIO; - goto fail; - } - if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); diff --git a/sys/dev/age/if_age.c b/sys/dev/age/if_age.c index c302dd6f1965..1a8b4aa6ad3f 100644 --- a/sys/dev/age/if_age.c +++ b/sys/dev/age/if_age.c @@ -591,12 +591,6 @@ age_attach(device_t dev) age_get_macaddr(sc); ifp = sc->age_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "cannot allocate ifnet structure.\n"); - error = ENXIO; - goto fail; - } - if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); diff --git a/sys/dev/alc/if_alc.c b/sys/dev/alc/if_alc.c index 2943be7063b5..c83cd1bf6869 100644 --- a/sys/dev/alc/if_alc.c +++ b/sys/dev/alc/if_alc.c @@ -1585,12 +1585,6 @@ alc_attach(device_t dev) alc_get_macaddr(sc); ifp = sc->alc_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "cannot allocate ifnet structure.\n"); - error = ENXIO; - goto fail; - } - if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); diff --git a/sys/dev/ale/if_ale.c b/sys/dev/ale/if_ale.c index 510a029cd18f..e8e7a55e9b8f 100644 --- a/sys/dev/ale/if_ale.c +++ b/sys/dev/ale/if_ale.c @@ -610,12 +610,6 @@ ale_attach(device_t dev) ale_get_macaddr(sc); ifp = sc->ale_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "cannot allocate ifnet structure.\n"); - error = ENXIO; - goto fail; - } - if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); diff --git a/sys/dev/altera/atse/if_atse.c b/sys/dev/altera/atse/if_atse.c index 923292484207..9e3871cf5779 100644 --- a/sys/dev/altera/atse/if_atse.c +++ b/sys/dev/altera/atse/if_atse.c @@ -1372,11 +1372,6 @@ atse_attach(device_t dev) /* Setup interface. */ ifp = sc->atse_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "if_alloc() failed\n"); - error = ENOSPC; - goto err; - } if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); diff --git a/sys/dev/axgbe/if_axgbe.c b/sys/dev/axgbe/if_axgbe.c index 4641c346bb63..9c6d7d845f2d 100644 --- a/sys/dev/axgbe/if_axgbe.c +++ b/sys/dev/axgbe/if_axgbe.c @@ -389,11 +389,6 @@ axgbe_attach(device_t dev) OF_getprop(node, "mac-address", sc->mac_addr, ETHER_ADDR_LEN); sc->prv.netdev = ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "Cannot alloc ifnet\n"); - return (ENXIO); - } - sc->prv.dev = dev; sc->prv.dmat = bus_get_dma_tag(dev); sc->prv.phy.advertising = ADVERTISED_10000baseKR_Full | diff --git a/sys/dev/bce/if_bce.c b/sys/dev/bce/if_bce.c index 2564d0c1dac6..226fca16ac28 100644 --- a/sys/dev/bce/if_bce.c +++ b/sys/dev/bce/if_bce.c @@ -1351,12 +1351,6 @@ bce_attach(device_t dev) /* Allocate an ifnet structure. */ ifp = sc->bce_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - BCE_PRINTF("%s(%d): Interface allocation failed!\n", - __FILE__, __LINE__); - rc = ENXIO; - goto bce_attach_fail; - } /* Initialize the ifnet interface. */ if_setsoftc(ifp, sc); diff --git a/sys/dev/bfe/if_bfe.c b/sys/dev/bfe/if_bfe.c index de5c43087fa3..e488300dc944 100644 --- a/sys/dev/bfe/if_bfe.c +++ b/sys/dev/bfe/if_bfe.c @@ -478,11 +478,6 @@ bfe_attach(device_t dev) /* Set up ifnet structure */ ifp = sc->bfe_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "failed to if_alloc()\n"); - error = ENOSPC; - goto fail; - } if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index 3e43b8e31442..e8af6530354f 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -3712,11 +3712,6 @@ bge_attach(device_t dev) /* Set up ifnet structure */ ifp = sc->bge_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(sc->bge_dev, "failed to if_alloc()\n"); - error = ENXIO; - goto fail; - } if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c index 8524deeb354e..05bc22c0c981 100644 --- a/sys/dev/bxe/bxe.c +++ b/sys/dev/bxe/bxe.c @@ -12965,7 +12965,7 @@ bxe_init(void *xsc) BXE_CORE_UNLOCK(sc); } -static int +static void bxe_init_ifnet(struct bxe_softc *sc) { if_t ifp; @@ -12985,10 +12985,7 @@ bxe_init_ifnet(struct bxe_softc *sc) BLOGI(sc, "IFMEDIA flags : %x\n", sc->ifmedia.ifm_media); /* allocate the ifnet structure */ - if ((ifp = if_gethandle(IFT_ETHER)) == NULL) { - BLOGE(sc, "Interface allocation failed!\n"); - return (ENXIO); - } + ifp = if_gethandle(IFT_ETHER); if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); @@ -13034,8 +13031,6 @@ bxe_init_ifnet(struct bxe_softc *sc) /* Attach driver debugnet methods. */ DEBUGNET_SET(ifp, bxe); - - return (0); } static void @@ -16261,12 +16256,7 @@ bxe_attach(device_t dev) bxe_get_phy_info(sc); /* initialize the FreeBSD ifnet interface */ - if (bxe_init_ifnet(sc) != 0) { - bxe_release_mutexes(sc); - bxe_deallocate_bars(sc); - pci_disable_busmaster(dev); - return (ENXIO); - } + bxe_init_ifnet(sc); if (bxe_add_cdev(sc) != 0) { if (sc->ifp != NULL) { diff --git a/sys/dev/cadence/if_cgem.c b/sys/dev/cadence/if_cgem.c index 6e4a62f6e5ee..80b35db73c46 100644 --- a/sys/dev/cadence/if_cgem.c +++ b/sys/dev/cadence/if_cgem.c @@ -1814,11 +1814,6 @@ cgem_attach(device_t dev) /* Set up ifnet structure. */ ifp = sc->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "could not allocate ifnet structure\n"); - cgem_detach(dev); - return (ENOMEM); - } if_setsoftc(ifp, sc); if_initname(ifp, IF_CGEM_NAME, device_get_unit(dev)); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); diff --git a/sys/dev/cas/if_cas.c b/sys/dev/cas/if_cas.c index 0cf17cf04b33..76d1b713e5bb 100644 --- a/sys/dev/cas/if_cas.c +++ b/sys/dev/cas/if_cas.c @@ -188,8 +188,6 @@ cas_attach(struct cas_softc *sc) /* Set up ifnet structure. */ ifp = sc->sc_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) - return (ENOSPC); if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(sc->sc_dev), device_get_unit(sc->sc_dev)); diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index c5fc067f8312..9bcdb86312c4 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -1011,11 +1011,6 @@ cxgb_port_attach(device_t dev) /* Allocate an ifnet object and set it up */ ifp = p->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "Cannot allocate ifnet\n"); - return (ENOMEM); - } - if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setinitfn(ifp, cxgb_init); if_setsoftc(ifp, p); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 28119bd419bb..128d2ae65611 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2549,7 +2549,7 @@ cxgbe_probe(device_t dev) IFCAP_HWRXTSTMP | IFCAP_MEXTPG) #define T4_CAP_ENABLE (T4_CAP) -static int +static void cxgbe_vi_attach(device_t dev, struct vi_info *vi) { if_t ifp; @@ -2588,10 +2588,6 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) /* Allocate an ifnet and set it up */ ifp = if_alloc_dev(IFT_ETHER, dev); - if (ifp == NULL) { - device_printf(dev, "Cannot allocate ifnet\n"); - return (ENOMEM); - } vi->ifp = ifp; if_setsoftc(ifp, vi); @@ -2694,8 +2690,6 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) pa.pa_type = PFIL_TYPE_ETHERNET; pa.pa_headname = if_name(ifp); vi->pfil = pfil_head_register(&pa); - - return (0); } static int @@ -2704,13 +2698,11 @@ cxgbe_attach(device_t dev) struct port_info *pi = device_get_softc(dev); struct adapter *sc = pi->adapter; struct vi_info *vi; - int i, rc; + int i; sysctl_ctx_init(&pi->ctx); - rc = cxgbe_vi_attach(dev, &pi->vi[0]); - if (rc) - return (rc); + cxgbe_vi_attach(dev, &pi->vi[0]); for_each_vi(pi, i, vi) { if (i == 0) @@ -3589,11 +3581,8 @@ vcxgbe_attach(device_t dev) if (rc) return (rc); - rc = cxgbe_vi_attach(dev, vi); - if (rc) { - t4_free_vi(sc, sc->mbox, sc->pf, 0, vi->viid); - return (rc); - } + cxgbe_vi_attach(dev, vi); + return (0); } diff --git a/sys/dev/cxgbe/t4_tracer.c b/sys/dev/cxgbe/t4_tracer.c index d9b336c4b64a..80689a543e83 100644 --- a/sys/dev/cxgbe/t4_tracer.c +++ b/sys/dev/cxgbe/t4_tracer.c @@ -167,11 +167,6 @@ t4_cloner_create(struct if_clone *ifc, char *name, size_t len, caddr_t params) } ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - rc = ENOMEM; - goto done; - } - /* Note that if_xname is identical to the nexus nameunit */ if_initname(ifp, name, -1); if_setdname(ifp, t4_cloner_name); diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index ddb81d8a486c..809feed7855f 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -2380,11 +2380,6 @@ dc_attach(device_t dev) goto fail; ifp = sc->dc_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "can not if_alloc()\n"); - error = ENOSPC; - goto fail; - } if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); diff --git a/sys/dev/dpaa/if_dtsec.c b/sys/dev/dpaa/if_dtsec.c index 2c0dee05a03f..dfa76a476620 100644 --- a/sys/dev/dpaa/if_dtsec.c +++ b/sys/dev/dpaa/if_dtsec.c @@ -678,12 +678,6 @@ dtsec_attach(device_t dev) /* Create network interface for upper layers */ ifp = sc->sc_ifnet = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(sc->sc_dev, "if_alloc() failed.\n"); - dtsec_detach(dev); - return (ENOMEM); - } - if_setsoftc(ifp, sc); if_setflags(ifp, IFF_SIMPLEX | IFF_BROADCAST); diff --git a/sys/dev/dpaa2/dpaa2_ni.c b/sys/dev/dpaa2/dpaa2_ni.c index a9e6aa120549..a21351a20b49 100644 --- a/sys/dev/dpaa2/dpaa2_ni.c +++ b/sys/dev/dpaa2/dpaa2_ni.c @@ -548,11 +548,6 @@ dpaa2_ni_attach(device_t dev) /* Allocate network interface */ ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "%s: failed to allocate network interface\n", - __func__); - goto err_exit; - } sc->ifp = ifp; if_initname(ifp, DPAA2_NI_IFNAME, device_get_unit(sc->dev)); diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index 3ff32cc9966c..47d066a2e4f1 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -148,7 +148,7 @@ static int ena_ioctl(if_t, u_long, caddr_t); static int ena_get_dev_offloads(struct ena_com_dev_get_features_ctx *); static void ena_update_host_info(struct ena_admin_host_info *, if_t); static void ena_update_hwassist(struct ena_adapter *); -static int ena_setup_ifnet(device_t, struct ena_adapter *, +static void ena_setup_ifnet(device_t, struct ena_adapter *, struct ena_com_dev_get_features_ctx *); static int ena_enable_wc(device_t, struct resource *); static int ena_set_queues_placement_policy(device_t, struct ena_com_dev *, @@ -2462,7 +2462,7 @@ ena_update_hwassist(struct ena_adapter *adapter) if_sethwassistbits(ifp, flags, 0); } -static int +static void ena_setup_ifnet(device_t pdev, struct ena_adapter *adapter, struct ena_com_dev_get_features_ctx *feat) { @@ -2470,10 +2470,6 @@ ena_setup_ifnet(device_t pdev, struct ena_adapter *adapter, int caps = 0; ifp = adapter->ifp = if_gethandle(IFT_ETHER); - if (unlikely(ifp == NULL)) { - ena_log(pdev, ERR, "can not allocate ifnet structure\n"); - return (ENXIO); - } if_initname(ifp, device_get_name(pdev), device_get_unit(pdev)); if_setdev(ifp, pdev); if_setsoftc(ifp, adapter); @@ -2516,8 +2512,6 @@ ena_setup_ifnet(device_t pdev, struct ena_adapter *adapter, ifmedia_set(&adapter->media, IFM_ETHER | IFM_AUTO); ether_ifattach(ifp, adapter->mac_addr); - - return (0); } void @@ -3811,11 +3805,7 @@ ena_attach(device_t pdev) ena_sysctl_add_nodes(adapter); /* setup network interface */ - rc = ena_setup_ifnet(pdev, adapter, &get_feat_ctx); - if (unlikely(rc != 0)) { - ena_log(pdev, ERR, "Error with network interface setup\n"); - goto err_customer_metrics_alloc; - } + ena_setup_ifnet(pdev, adapter, &get_feat_ctx); /* Initialize reset task queue */ TASK_INIT(&adapter->reset_task, 0, ena_reset_task, adapter); @@ -3852,7 +3842,6 @@ ena_attach(device_t pdev) err_detach: ether_ifdetach(adapter->ifp); #endif /* DEV_NETMAP */ -err_customer_metrics_alloc: free(adapter->customer_metrics_array, M_DEVBUF); err_metrics_buffer_destroy: ena_com_delete_customer_metrics_buffer(ena_dev); diff --git a/sys/dev/et/if_et.c b/sys/dev/et/if_et.c index 62bafd4c4113..5f5911eb2ae6 100644 --- a/sys/dev/et/if_et.c +++ b/sys/dev/et/if_et.c @@ -232,11 +232,6 @@ et_attach(device_t dev) callout_init_mtx(&sc->sc_tick, &sc->sc_mtx, 0); ifp = sc->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "can not if_alloc()\n"); - error = ENOSPC; - goto fail; - } /* * Initialize tunables diff --git a/sys/dev/etherswitch/ar40xx/ar40xx_phy.c b/sys/dev/etherswitch/ar40xx/ar40xx_phy.c index 3e2bcd4af18d..11d9f8d47c0f 100644 --- a/sys/dev/etherswitch/ar40xx/ar40xx_phy.c +++ b/sys/dev/etherswitch/ar40xx/ar40xx_phy.c @@ -200,14 +200,6 @@ ar40xx_attach_phys(struct ar40xx_softc *sc) snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->sc_dev)); for (phy = 0; phy < AR40XX_NUM_PHYS; phy++) { sc->sc_phys.ifp[phy] = if_alloc(IFT_ETHER); - if (sc->sc_phys.ifp[phy] == NULL) { - device_printf(sc->sc_dev, - "PHY %d: couldn't allocate ifnet structure\n", - phy); - err = ENOMEM; - break; - } - sc->sc_phys.ifp[phy]->if_softc = sc; sc->sc_phys.ifp[phy]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/arswitch/arswitch.c b/sys/dev/etherswitch/arswitch/arswitch.c index 70f3ad501d5d..f1e6d1944038 100644 --- a/sys/dev/etherswitch/arswitch/arswitch.c +++ b/sys/dev/etherswitch/arswitch/arswitch.c @@ -150,12 +150,6 @@ arswitch_attach_phys(struct arswitch_softc *sc) snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->sc_dev)); for (phy = 0; phy < sc->numphys; phy++) { sc->ifp[phy] = if_alloc(IFT_ETHER); - if (sc->ifp[phy] == NULL) { - device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - if_setsoftc(sc->ifp[phy], sc); if_setflagbits(sc->ifp[phy], IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX, 0); diff --git a/sys/dev/etherswitch/e6000sw/e6000sw.c b/sys/dev/etherswitch/e6000sw/e6000sw.c index 95f1a2e96db6..3b309f7f36f8 100644 --- a/sys/dev/etherswitch/e6000sw/e6000sw.c +++ b/sys/dev/etherswitch/e6000sw/e6000sw.c @@ -454,8 +454,6 @@ e6000sw_init_interface(e6000sw_softc_t *sc, int port) snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->dev)); sc->ifp[port] = if_alloc(IFT_ETHER); - if (sc->ifp[port] == NULL) - return (ENOMEM); if_setsoftc(sc->ifp[port], sc); if_setflagbits(sc->ifp[port], IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX, 0); diff --git a/sys/dev/etherswitch/e6000sw/e6060sw.c b/sys/dev/etherswitch/e6000sw/e6060sw.c index 8bc482af24e8..3ff38abb69a0 100644 --- a/sys/dev/etherswitch/e6000sw/e6060sw.c +++ b/sys/dev/etherswitch/e6000sw/e6060sw.c @@ -214,12 +214,6 @@ e6060sw_attach_phys(struct e6060sw_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); - if (sc->ifp[port] == NULL) { - device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/felix/felix.c b/sys/dev/etherswitch/felix/felix.c index f7d79ab33e13..ecd967015d00 100644 --- a/sys/dev/etherswitch/felix/felix.c +++ b/sys/dev/etherswitch/felix/felix.c @@ -241,9 +241,6 @@ felix_init_interface(felix_softc_t sc, int port) snprintf(name, IFNAMSIZ, "%sport", device_get_nameunit(sc->dev)); sc->ports[port].ifp = if_alloc(IFT_ETHER); - if (sc->ports[port].ifp == NULL) - return (ENOMEM); - if_setsoftc(sc->ports[port].ifp, sc); if_setflags(sc->ports[port].ifp, IFF_UP | IFF_BROADCAST | IFF_MULTICAST | IFF_DRV_RUNNING | IFF_SIMPLEX); diff --git a/sys/dev/etherswitch/infineon/adm6996fc.c b/sys/dev/etherswitch/infineon/adm6996fc.c index 95a24a2fb37a..2c6c83a4388d 100644 --- a/sys/dev/etherswitch/infineon/adm6996fc.c +++ b/sys/dev/etherswitch/infineon/adm6996fc.c @@ -173,12 +173,6 @@ adm6996fc_attach_phys(struct adm6996fc_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); - if (sc->ifp[port] == NULL) { - device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/ip17x/ip17x.c b/sys/dev/etherswitch/ip17x/ip17x.c index 45119ded83a9..5e07e1f72b80 100644 --- a/sys/dev/etherswitch/ip17x/ip17x.c +++ b/sys/dev/etherswitch/ip17x/ip17x.c @@ -172,12 +172,6 @@ ip17x_attach_phys(struct ip17x_softc *sc) sc->phyport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); - if (sc->ifp[port] == NULL) { - device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - if_setsoftc(sc->ifp[port], sc); if_setflags(sc->ifp[port], IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX); diff --git a/sys/dev/etherswitch/micrel/ksz8995ma.c b/sys/dev/etherswitch/micrel/ksz8995ma.c index 2b5af2a5625a..e512a86202c6 100644 --- a/sys/dev/etherswitch/micrel/ksz8995ma.c +++ b/sys/dev/etherswitch/micrel/ksz8995ma.c @@ -219,12 +219,6 @@ ksz8995ma_attach_phys(struct ksz8995ma_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); - if (sc->ifp[port] == NULL) { - device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - sc->ifp[port]->if_softc = sc; sc->ifp[port]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/mtkswitch/mtkswitch.c b/sys/dev/etherswitch/mtkswitch/mtkswitch.c index 75f7cbfa6941..fa96a81b40ef 100644 --- a/sys/dev/etherswitch/mtkswitch/mtkswitch.c +++ b/sys/dev/etherswitch/mtkswitch/mtkswitch.c @@ -121,12 +121,6 @@ mtkswitch_attach_phys(struct mtkswitch_softc *sc) continue; } sc->ifp[phy] = if_alloc(IFT_ETHER); - if (sc->ifp[phy] == NULL) { - device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - sc->ifp[phy]->if_softc = sc; sc->ifp[phy]->if_flags |= IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX; diff --git a/sys/dev/etherswitch/rtl8366/rtl8366rb.c b/sys/dev/etherswitch/rtl8366/rtl8366rb.c index 8a74ae189284..761a96b0ec80 100644 --- a/sys/dev/etherswitch/rtl8366/rtl8366rb.c +++ b/sys/dev/etherswitch/rtl8366/rtl8366rb.c @@ -238,12 +238,6 @@ rtl8366rb_attach(device_t dev) /* PHYs need an interface, so we generate a dummy one */ for (i = 0; i < sc->numphys; i++) { sc->ifp[i] = if_alloc(IFT_ETHER); - if (sc->ifp[i] == NULL) { - device_printf(dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - if_setsoftc(sc->ifp[i], sc); if_setflagbits(sc->ifp[i], IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX, 0); diff --git a/sys/dev/etherswitch/ukswitch/ukswitch.c b/sys/dev/etherswitch/ukswitch/ukswitch.c index c1e23f7c0f65..f2cf6ef74e90 100644 --- a/sys/dev/etherswitch/ukswitch/ukswitch.c +++ b/sys/dev/etherswitch/ukswitch/ukswitch.c @@ -124,12 +124,6 @@ ukswitch_attach_phys(struct ukswitch_softc *sc) sc->ifpport[phy] = port; sc->portphy[port] = phy; sc->ifp[port] = if_alloc(IFT_ETHER); - if (sc->ifp[port] == NULL) { - device_printf(sc->sc_dev, "couldn't allocate ifnet structure\n"); - err = ENOMEM; - break; - } - if_setsoftc(sc->ifp[port], sc); if_setflags(sc->ifp[port], IFF_UP | IFF_BROADCAST | IFF_DRV_RUNNING | IFF_SIMPLEX); diff --git a/sys/dev/firewire/if_fwe.c b/sys/dev/firewire/if_fwe.c index 60a9806656e8..44d3425799e9 100644 --- a/sys/dev/firewire/if_fwe.c +++ b/sys/dev/firewire/if_fwe.c @@ -178,10 +178,6 @@ fwe_attach(device_t dev) /* fill the rest and attach interface */ ifp = fwe->eth_softc.ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "can not if_alloc()\n"); - return (ENOSPC); - } if_setsoftc(ifp, &fwe->eth_softc); if_initname(ifp, device_get_name(dev), unit); @@ -201,7 +197,7 @@ fwe_attach(device_t dev) if_setcapenablebit(ifp, IFCAP_VLAN_MTU, 0); FWEDEBUG(ifp, "interface created\n"); - return 0; + return (0); } static void diff --git a/sys/dev/firewire/if_fwip.c b/sys/dev/firewire/if_fwip.c index 5237c555d999..91a27800f308 100644 --- a/sys/dev/firewire/if_fwip.c +++ b/sys/dev/firewire/if_fwip.c @@ -153,8 +153,6 @@ fwip_attach(device_t dev) fwip = ((struct fwip_softc *)device_get_softc(dev)); unit = device_get_unit(dev); ifp = fwip->fw_softc.fwip_ifp = if_alloc(IFT_IEEE1394); - if (ifp == NULL) - return (ENOSPC); mtx_init(&fwip->mtx, "fwip", NULL, MTX_DEF); /* XXX */ @@ -199,7 +197,7 @@ fwip_attach(device_t dev) splx(s); FWIPDEBUG(ifp, "interface created\n"); - return 0; + return (0); } static void diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 8d695861cffc..966647051c21 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -443,11 +443,6 @@ fxp_attach(device_t dev) fxp_serial_ifmedia_sts); ifp = sc->ifp = if_gethandle(IFT_ETHER); - if (ifp == (void *)NULL) { - device_printf(dev, "can not if_alloc()\n"); - error = ENOSPC; - goto fail; - } /* * Enable bus mastering. diff --git a/sys/dev/gem/if_gem.c b/sys/dev/gem/if_gem.c index 91389d0dfd2c..434c5309d019 100644 --- a/sys/dev/gem/if_gem.c +++ b/sys/dev/gem/if_gem.c @@ -152,8 +152,6 @@ gem_attach(struct gem_softc *sc) /* Set up ifnet structure. */ ifp = sc->sc_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) - return (ENOSPC); sc->sc_csum_features = GEM_CSUM_FEATURES; if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(sc->sc_dev), diff --git a/sys/dev/gve/gve_main.c b/sys/dev/gve/gve_main.c index cd7849778bce..f8a37b9f37a9 100644 --- a/sys/dev/gve/gve_main.c +++ b/sys/dev/gve/gve_main.c @@ -352,18 +352,13 @@ gve_get_counter(if_t ifp, ift_counter cnt) } } -static int +static void gve_setup_ifnet(device_t dev, struct gve_priv *priv) { int caps = 0; if_t ifp; ifp = priv->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(priv->dev, "Failed to allocate ifnet struct\n"); - return (ENXIO); - } - if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setsoftc(ifp, priv); if_setdev(ifp, dev); @@ -401,8 +396,6 @@ gve_setup_ifnet(device_t dev, struct gve_priv *priv) ifmedia_add(&priv->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&priv->media, IFM_ETHER | IFM_AUTO); - - return (0); } static int @@ -794,9 +787,7 @@ gve_attach(device_t dev) if (err != 0) goto abort; - err = gve_setup_ifnet(dev, priv); - if (err != 0) - goto abort; + gve_setup_ifnet(dev, priv); priv->rx_copybreak = GVE_DEFAULT_RX_COPYBREAK; diff --git a/sys/dev/iicbus/if_ic.c b/sys/dev/iicbus/if_ic.c index 52ab5afb9c4e..caca35a3d22b 100644 --- a/sys/dev/iicbus/if_ic.c +++ b/sys/dev/iicbus/if_ic.c @@ -162,8 +162,6 @@ icattach(device_t dev) if_t ifp; ifp = sc->ic_ifp = if_alloc(IFT_PARA); - if (ifp == NULL) - return (ENOSPC); mtx_init(&sc->ic_lock, device_get_nameunit(dev), MTX_NETWORK_LOCK, MTX_DEF); diff --git a/sys/dev/jme/if_jme.c b/sys/dev/jme/if_jme.c index 89c78d80afe0..3631e5f8ffa0 100644 --- a/sys/dev/jme/if_jme.c +++ b/sys/dev/jme/if_jme.c @@ -805,12 +805,6 @@ jme_attach(device_t dev) goto fail; ifp = sc->jme_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "cannot allocate ifnet structure.\n"); - error = ENXIO; - goto fail; - } - if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); diff --git a/sys/dev/le/lance.c b/sys/dev/le/lance.c index e09e82eb34cc..6add3aa4a1b5 100644 --- a/sys/dev/le/lance.c +++ b/sys/dev/le/lance.c @@ -110,8 +110,6 @@ lance_config(struct lance_softc *sc, const char* name, int unit) return (ENXIO); ifp = sc->sc_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) - return (ENOSPC); callout_init_mtx(&sc->sc_wdog_ch, &sc->sc_mtx, 0); diff --git a/sys/dev/lge/if_lge.c b/sys/dev/lge/if_lge.c index d77866ee3cad..dfcaa01d366b 100644 --- a/sys/dev/lge/if_lge.c +++ b/sys/dev/lge/if_lge.c @@ -512,11 +512,6 @@ lge_attach(device_t dev) } ifp = sc->lge_ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "can not if_alloc()\n"); - error = ENOSPC; - goto fail; - } if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); diff --git a/sys/dev/liquidio/lio_main.c b/sys/dev/liquidio/lio_main.c index aa52612dda04..7104ff07674f 100644 --- a/sys/dev/liquidio/lio_main.c +++ b/sys/dev/liquidio/lio_main.c @@ -1327,11 +1327,6 @@ lio_setup_nic_devices(struct octeon_device *octeon_dev) ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - lio_dev_err(octeon_dev, "Device allocation failed\n"); - goto setup_nic_dev_fail; *** 1276 LINES SKIPPED *** From nobody Fri Jul 12 17:17:44 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WLJFP1jXhz5Qqcj; Fri, 12 Jul 2024 17:17: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 4WLJFP18Fnz4X71; Fri, 12 Jul 2024 17:17:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720804665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nRr/Z+kqSFgNGZvheoKXAJsSK4zMa+iWD5yhcUC3sx4=; b=MGg/TU+ym7958XSfNFSHQPtwqLhyuiSuymkgad40bAlhzXbX2ESzbsq4AYy4/CdA7KkN+D 1dL4OsdidhLq8rYLBIA5epv+/MH9EHCCOZheceNnMsoY9YFqXQfwGZ94T0RilqH/XMH3Yo gzE5MFbAq5bAipPJ5seuCtcNjXlwiMv6J3ZOqz2DjHYfIjRrz9x0YSlyX+T36nJ/5qSz01 bHojv7LxR3eU36DLCY5ON4XXCvuSOF4Dx+2gjLdDyIpqG7hdT8V30Lpi4lpJOKmKYPRYtd 93FCPV/GgHSYOOZcv4Scn8bY9MGkbwjFqB256abTMniUzPwJoRHUGL721n7DhA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720804665; a=rsa-sha256; cv=none; b=QESeTEr8Zzr7U6vOQiSnFpG22m2kHtSJWiJIOIS/1laJ02bEFjR6ThU1gJpcOoyXp+WKG7 HNGgQ24cJ/gwEXAZcjsciy2TfmG2wSJZJOoNupA+4fekKMPWUBfzFUcfoSyGyHpI3D56an O3UoQ5IE77spgTIDmqvnB73rMx/WZdXQsKqATZjkOP1Idy9pUAUpgwixG3YP5fRxU4fV8h fnyIYOBMglMG851v75Bq2pzM/zzOsOocZvlrgQsMGRX4A2E78Hqb/GlEUs7hvqenZU6ctY 1pcfGG1i20tVm8n9s1tDFpaA+e/anFPvUWBBR7+XEKF+ah3XmUwyigvO2hmkSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720804665; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nRr/Z+kqSFgNGZvheoKXAJsSK4zMa+iWD5yhcUC3sx4=; b=gqqeWOkRe7dacXC82H5uj2CWJSZFihJckjsINeRhAZOA8GCbzQsCHi4znkIWZUY9sj71aX Ep/4r0fmn29zPc/GkiKprVtuDuS/DBwbfFJoJkNfGD5s2ZhZf0YA27JaScSaK0jylgVKiw mTGvl6/++jVo0DN+yclae4bUla9BCjkaR6hG4QBFm4Kpbt9eeWeCP0swWK14f0xUU9YD1u 1YJy9Mhka8BX+xt8lp6/AsRPXrnfQk7nIYxp+kmjzwwJZZ10jmcG+uMr9vxQaQTz0MlO62 x2HxK65SzNhfnpz2jMggfT8ZMlzz+ARz4Iy0S4W6/2Jp+pjrYFoszDLkj9cMGg== 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 4WLJFP0WyRzsCc; Fri, 12 Jul 2024 17:17: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 46CHHi7G089877; Fri, 12 Jul 2024 17:17:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46CHHiIL089874; Fri, 12 Jul 2024 17:17:44 GMT (envelope-from git) Date: Fri, 12 Jul 2024 17:17:44 GMT Message-Id: <202407121717.46CHHiIL089874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 7855227a3f97 - stable/14 - EC2: Bump AMI size to 6 GB List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7855227a3f97056212ef129a2b52ba69766a1be4 Auto-Submitted: auto-generated The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=7855227a3f97056212ef129a2b52ba69766a1be4 commit 7855227a3f97056212ef129a2b52ba69766a1be4 Author: Colin Percival AuthorDate: 2023-12-28 22:23:52 +0000 Commit: Colin Percival CommitDate: 2024-07-12 17:17:28 +0000 EC2: Bump AMI size to 6 GB This week's cloud-init ZFS snapshots ran out of disk space. (cherry picked from commit 8a735ffdf04936c6785ac4fa31486639262dd416) --- release/tools/ec2.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf index ce09ab0d2367..989e8a05a318 100644 --- a/release/tools/ec2.conf +++ b/release/tools/ec2.conf @@ -10,12 +10,12 @@ export VM_EXTRA_PACKAGES="${VM_EXTRA_PACKAGES} ebsnvme-id amazon-ssm-agent" # Services which should be enabled by default in rc.conf(5). export VM_RC_LIST="dev_aws_disk ntpd" -# Build with a 4.9 GB partition; the growfs rc.d script will expand +# Build with a 5.9 GB partition; the growfs rc.d script will expand # the partition to fill the root disk after the EC2 instance is launched. # Note that if this is set to G, we will end up with an GB disk # image since VMSIZE is the size of the filesystem partition, not the disk # which it resides within. -export VMSIZE=5000m +export VMSIZE=6000m # No swap space; it doesn't make sense to provision any as part of the disk # image when we could be launching onto a system with anywhere between 0.5 From nobody Sat Jul 13 00:46:38 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WLVCL4BXXz5R8qx; Sat, 13 Jul 2024 00:46: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 4WLVCL3PWXz4Lw3; Sat, 13 Jul 2024 00:46:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720831598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zK+41pUdYAKtbJTCNcqJbG/OD9+wFkEnzMkca555udQ=; b=piM5oLJEc/03C+Hc4Z1A1uH+xZbpB2xNqTesOMFVQ3AA8B1dA1WZ//2uVTtWEUjEsHJT2+ KFNe4q1UYCJGVQ2A0LMT3qPmus+ckWp1lkHdFKP+v/Ys53mycjdRwKxeWqeAex/Es5rZ0y sFuAMlNjAPkPL794z9mJ/K9G+6GtHYpEUlEke4wFFtcsOU1cof0wAse/qvJOd7MimEu3xz 7TLZZzsBOiOLmds/oit51rZC6gvORmosJH9jVxr/jCqIZ2xRAgqqYTsZQ9newjcFQyA0/v hcKztgsE+PJUL5p4vQPqVmLw3ueXcGKSNBbip6p8QAEmjwrquHW6NC6jaScn8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720831598; a=rsa-sha256; cv=none; b=Nl2bd8F4M0GnrZ4PttXfIv9tNr3ItCGPxxwCLXO4SjuhjVGhBXHwOivY6WHlrKlrB+C87b aZN3v2C5JdAzAWmQ87nP+turY2ZJmJQHDZ63f3rU3mTaZEBbEo3iDSY0hlb3Nfn//qlCcT XAz8k0WKkOGNLbCKMLCy2mPDBEUaISnPqWE+GYKdr7G+GvWcn2W8kpnNxIQuO4cEOzSgDb LQ80z6w8URLGvd5DGsZKR1iaNfl3jp1dUDQbgyodoCKrJ/WXEAvvBwLBcG5pbvHqF3kObM QXA3WkiKp4ZRVvWoUUHjmsEWNjq5n7wYmrxgfM7ZnYW75BHNJlCjDezAGT+u/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=1720831598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zK+41pUdYAKtbJTCNcqJbG/OD9+wFkEnzMkca555udQ=; b=FqjvR42D0IXvSzqY8TIDcXvoRFF9LXvOnVWyWEfc36fhcfjH+9rwChP1iUGhuoFLDhH/+5 fLjPONaucx9VecMEnRogJ7DkVxi/UaMEMPpscOGobMWg1NSmfuqheOz/6oUz++7BjzpbhA 9LBbYpcNCZjfnZijhh0D5BI3+GKCI597te6xXbgm8CrhsvzUJtD8lbhWWC/EDazY806XDU DgUm4xFNBY+sFm5jUDc+XTi+a6Wb4kPyhmdo4VU7FDIrd9Pwy2k+8kvrIeg/XF8ULLSKIB U33zbQtGswue7GpVm/py1dyVjKkjSHxbdx84HbvAPa93Lh6re4u7NReIjJC6gg== 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 4WLVCL2j8Mz14vY; Sat, 13 Jul 2024 00:46: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 46D0kc7h052051; Sat, 13 Jul 2024 00: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 46D0kche052048; Sat, 13 Jul 2024 00:46:38 GMT (envelope-from git) Date: Sat, 13 Jul 2024 00:46:38 GMT Message-Id: <202407130046.46D0kche052048@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: f6f9589b9f05 - stable/14 - nfscl: Add support for the NFSv4.1/4.2 WANT_xxx flags List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: f6f9589b9f05781f92dc5c8bd9fa3b9969615d78 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=f6f9589b9f05781f92dc5c8bd9fa3b9969615d78 commit f6f9589b9f05781f92dc5c8bd9fa3b9969615d78 Author: Rick Macklem AuthorDate: 2024-06-12 23:11:10 +0000 Commit: Rick Macklem CommitDate: 2024-07-13 00:45:02 +0000 nfscl: Add support for the NFSv4.1/4.2 WANT_xxx flags NFSv4.1/4.2 defined new OPEN_WANT_xxx flags that a client can use to hint to the server that delegations are or are not wanted. This patch adds use of those delegations to the client. This patch should only affect the NFSv4.1/4.2 behaviour when delegations are enabled, which is not the default. (cherry picked from commit ec1f285f2e631b8aae3e08b3f68c6451a45c0941) --- sys/fs/nfsclient/nfs_clrpcops.c | 77 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 68 insertions(+), 9 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c index 8c5532268287..13bdc74655dd 100644 --- a/sys/fs/nfsclient/nfs_clrpcops.c +++ b/sys/fs/nfsclient/nfs_clrpcops.c @@ -389,13 +389,24 @@ nfsrpc_open(vnode_t vp, int amode, struct ucred *cred, NFSPROC_T *p) mode |= NFSV4OPEN_ACCESSREAD; if (amode & FWRITE) mode |= NFSV4OPEN_ACCESSWRITE; + if (NFSHASNFSV4N(nmp)) { + if (!NFSHASPNFS(nmp) && nfscl_enablecallb != 0 && + nfs_numnfscbd > 0) { + if ((mode & NFSV4OPEN_ACCESSWRITE) != 0) + mode |= NFSV4OPEN_WANTWRITEDELEG; + else + mode |= NFSV4OPEN_WANTANYDELEG; + } else + mode |= NFSV4OPEN_WANTNODELEG; + } nfhp = np->n_fhp; retrycnt = 0; do { dp = NULL; - error = nfscl_open(vp, nfhp->nfh_fh, nfhp->nfh_len, mode, 1, - cred, p, NULL, &op, &newone, &ret, 1, true); + error = nfscl_open(vp, nfhp->nfh_fh, nfhp->nfh_len, + (mode & NFSV4OPEN_ACCESSBOTH), 1, cred, p, NULL, + &op, &newone, &ret, 1, true); if (error) { return (error); } @@ -547,7 +558,8 @@ nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, cred); NFSM_BUILD(tl, u_int32_t *, 5 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); - *tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); + *tl++ = txdr_unsigned(mode & (NFSV4OPEN_ACCESSBOTH | + NFSV4OPEN_WANTDELEGMASK)); *tl++ = txdr_unsigned((mode >> NFSLCK_SHIFT) & NFSV4OPEN_DENYBOTH); tsep = nfsmnt_mdssession(nmp); *tl++ = tsep->nfsess_clientid.lval[0]; @@ -664,6 +676,13 @@ nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, &ret, &acesize, p); if (error) goto nfsmout; + } else if (deleg == NFSV4OPEN_DELEGATENONEEXT && + NFSHASNFSV4N(nmp)) { + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + deleg = fxdr_unsigned(uint32_t, *tl); + if (deleg == NFSV4OPEN_CONTENTION || + deleg == NFSV4OPEN_RESOURCE) + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); } else if (deleg != NFSV4OPEN_DELEGATENONE) { error = NFSERR_BADXDR; goto nfsmout; @@ -1546,7 +1565,7 @@ nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred, NFSM_BUILD(tl, uint32_t *, 6 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(NFSV4OP_OPEN); *tl++ = 0; /* seqid, ignored. */ - *tl++ = txdr_unsigned(openmode); + *tl++ = txdr_unsigned(openmode | NFSV4OPEN_WANTNODELEG); *tl++ = txdr_unsigned(NFSV4OPEN_DENYNONE); *tl++ = 0; /* ClientID, ignored. */ *tl = 0; @@ -1668,6 +1687,13 @@ nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred, ndp->nfsdl_stateid.other[0] = *tl++; ndp->nfsdl_stateid.other[1] = *tl++; ndp->nfsdl_stateid.other[2] = *tl++; + } else if (deleg == NFSV4OPEN_DELEGATENONEEXT && + NFSHASNFSV4N(nmp)) { + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + deleg = fxdr_unsigned(uint32_t, *tl); + if (deleg == NFSV4OPEN_CONTENTION || + deleg == NFSV4OPEN_RESOURCE) + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); } else if (deleg != NFSV4OPEN_DELEGATENONE) { error = NFSERR_BADXDR; goto nfsmout; @@ -2595,8 +2621,17 @@ nfsrpc_createv4(vnode_t dvp, char *name, int namelen, struct vattr *vap, */ NFSM_BUILD(tl, u_int32_t *, 5 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(owp->nfsow_seqid); - *tl++ = txdr_unsigned(NFSV4OPEN_ACCESSWRITE | - NFSV4OPEN_ACCESSREAD); + if (NFSHASNFSV4N(nmp)) { + if (!NFSHASPNFS(nmp) && nfscl_enablecallb != 0 && + nfs_numnfscbd > 0) + *tl++ = txdr_unsigned(NFSV4OPEN_ACCESSWRITE | + NFSV4OPEN_ACCESSREAD | NFSV4OPEN_WANTWRITEDELEG); + else + *tl++ = txdr_unsigned(NFSV4OPEN_ACCESSWRITE | + NFSV4OPEN_ACCESSREAD | NFSV4OPEN_WANTNODELEG); + } else + *tl++ = txdr_unsigned(NFSV4OPEN_ACCESSWRITE | + NFSV4OPEN_ACCESSREAD); *tl++ = txdr_unsigned(NFSV4OPEN_DENYNONE); tsep = nfsmnt_mdssession(nmp); *tl++ = tsep->nfsess_clientid.lval[0]; @@ -2714,6 +2749,13 @@ nfsrpc_createv4(vnode_t dvp, char *name, int namelen, struct vattr *vap, &ret, &acesize, p); if (error) goto nfsmout; + } else if (deleg == NFSV4OPEN_DELEGATENONEEXT && + NFSHASNFSV4N(nmp)) { + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + deleg = fxdr_unsigned(uint32_t, *tl); + if (deleg == NFSV4OPEN_CONTENTION || + deleg == NFSV4OPEN_RESOURCE) + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); } else if (deleg != NFSV4OPEN_DELEGATENONE) { error = NFSERR_BADXDR; goto nfsmout; @@ -8109,7 +8151,8 @@ nfsrpc_openlayoutrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, 0, 0, cred); NFSM_BUILD(tl, uint32_t *, 5 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(op->nfso_own->nfsow_seqid); - *tl++ = txdr_unsigned(mode & NFSV4OPEN_ACCESSBOTH); + *tl++ = txdr_unsigned(mode & (NFSV4OPEN_ACCESSBOTH | + NFSV4OPEN_WANTDELEGMASK)); *tl++ = txdr_unsigned((mode >> NFSLCK_SHIFT) & NFSV4OPEN_DENYBOTH); tsep = nfsmnt_mdssession(nmp); *tl++ = tsep->nfsess_clientid.lval[0]; @@ -8210,6 +8253,13 @@ nfsrpc_openlayoutrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, &ret, &acesize, p); if (error != 0) goto nfsmout; + } else if (deleg == NFSV4OPEN_DELEGATENONEEXT && + NFSHASNFSV4N(nmp)) { + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); + deleg = fxdr_unsigned(uint32_t, *tl); + if (deleg == NFSV4OPEN_CONTENTION || + deleg == NFSV4OPEN_RESOURCE) + NFSM_DISSECT(tl, uint32_t *, NFSX_UNSIGNED); } else if (deleg != NFSV4OPEN_DELEGATENONE) { error = NFSERR_BADXDR; goto nfsmout; @@ -8301,8 +8351,17 @@ nfsrpc_createlayout(vnode_t dvp, char *name, int namelen, struct vattr *vap, */ NFSM_BUILD(tl, u_int32_t *, 5 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(owp->nfsow_seqid); - *tl++ = txdr_unsigned(NFSV4OPEN_ACCESSWRITE | - NFSV4OPEN_ACCESSREAD); + if (NFSHASNFSV4N(nmp)) { + if (!NFSHASPNFS(nmp) && nfscl_enablecallb != 0 && + nfs_numnfscbd > 0) + *tl++ = txdr_unsigned(NFSV4OPEN_ACCESSWRITE | + NFSV4OPEN_ACCESSREAD | NFSV4OPEN_WANTWRITEDELEG); + else + *tl++ = txdr_unsigned(NFSV4OPEN_ACCESSWRITE | + NFSV4OPEN_ACCESSREAD | NFSV4OPEN_WANTNODELEG); + } else + *tl++ = txdr_unsigned(NFSV4OPEN_ACCESSWRITE | + NFSV4OPEN_ACCESSREAD); *tl++ = txdr_unsigned(NFSV4OPEN_DENYNONE); tsep = nfsmnt_mdssession(nmp); *tl++ = tsep->nfsess_clientid.lval[0]; From nobody Sat Jul 13 00:48:15 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WLVFC6Ynqz5R8wc; Sat, 13 Jul 2024 00:48: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 4WLVFC65z1z4MJW; Sat, 13 Jul 2024 00:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720831695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PLcE4aaEfTeKehIQMiIp5S2khlPHDB2+ZY6Jm3uphFA=; b=FgO8/ZoEKBC3lQfftnCOSy4PLw0kCOvvmyJyDNWiMjqi9QXqpnGoXaQYo4PIm8V1jRgmlm 2GZwpzDLrStTCNfEKYwhAVG30wSA89DU8QD+rLP9GpMxXjWMHmX8QDA1xu4JJXYAamE/At V6B8KSuyfKWIPlKiJW35HbYuuUKaYxx2Aw50MZ8srK4eUOTOHoxd+yegAEmHscmc6uvdqb JtRIsAjPTPDj0LZMLvUqQWAZQ5e7F7pm1mCtARCFVDzs7LwnoGNkqkUXwwcJMKPYq/7G4A DtRuqm2RIdZCv3Vbb1HhajV7dfmhnLz6u6Tyg4kSqph4PTyR8IVA+VFNLaoHPw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720831695; a=rsa-sha256; cv=none; b=BcktmghEFNM3Ebbz/0mOw1AVc5my+qt2f8dKZ0W8W+TG88DlnCsWH4H4NcMcVGWsvz70mF eJC8iXOMjt+aRnJtkHqM6VZ+Ej9N+0s0azGR60Su4pWgLJHKzW8NBqJ2BJ8xaj7VC2e+Eg pmA0I9HAlNNg8UeJzQ/qV10beFDsBY9YvMHOFnXv93XqgkFRmdoyICuJwRVUjWoJI2bvVM jeCIX2lVJ6ZoQFqSfJFQ8LrOn0sPCY94qOpWYItqaufLp+vpbYgmiriJYYPRg75bSugpM5 PMm7bZewSZ26yWQAxVdev/jo6l4PCNH2hKOjT5vE91Rub+7elIX4Y+p073s90A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720831695; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PLcE4aaEfTeKehIQMiIp5S2khlPHDB2+ZY6Jm3uphFA=; b=dqsfazA69E9WqWJ7cMkEf42WbYAE8Zz6TH2h5McrkPSdV1pSQ7jeMMqOXFbJTt6tSuYKch TG4hSHV56p0sZTBf96bvjVV+KDy1ZEjDrVsVOoszMfcgDKIWV6QkxeliLfZjbOpWKiZCG9 c0jhHQlZVL034b694xeAwnsb8TFDmQGZ//7Ci7IOtbi5PkVI90nrpYeMoCmyN7dxWRD46/ q8hPC1Fpn1ZE/GTdZ8zAV+oXxILsp0dt/MuUH7XFNJBVH82gGv2ceMxL8q0ikZBpoOOQt8 YNrRP4rnblOEF1ii9Y/JcMcE4xnXLmiSAUOW/fDyQwmVajoJxv1o0zobzCO9QA== 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 4WLVFC5jFvz14xD; Sat, 13 Jul 2024 00:48: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 46D0mFmf052523; Sat, 13 Jul 2024 00:48:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46D0mFO4052520; Sat, 13 Jul 2024 00:48:15 GMT (envelope-from git) Date: Sat, 13 Jul 2024 00:48:15 GMT Message-Id: <202407130048.46D0mFO4052520@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: c71b59bbc4a3 - stable/14 - nfscl: Add support for read delegations and atomic upgrade List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: c71b59bbc4a3b21a25a1ed91d8d47f70df1d5ee7 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=c71b59bbc4a3b21a25a1ed91d8d47f70df1d5ee7 commit c71b59bbc4a3b21a25a1ed91d8d47f70df1d5ee7 Author: Rick Macklem AuthorDate: 2024-06-12 23:41:12 +0000 Commit: Rick Macklem CommitDate: 2024-07-13 00:47:10 +0000 nfscl: Add support for read delegations and atomic upgrade For NFSv4.1/4.2, an atomic upgrade of a delegation from a read delegation to a write delegation is allowed and can result in significantly improved performance. This patch adds this upgrade to the NFSv4.1/4.2 client and enables use of read delegations. For a test case of building a FreeBSD kernel (sources and output objects) over a NFSv4.2 mount, these changes reduced the elapsed time by 30% and included a reduction of 80% for RPC counts when delegations were enabled. As such, with this patch there are at least certain cases where enabling delegations seems to be worth the increased complexity they bring. This patch should only affect the NFSv4.1/4.2 behaviour when delegations are enabled, which is not the default. (cherry picked from commit bb53f071e85a2ebb5b405e7fec4661a725b7caf5) --- sys/fs/nfsclient/nfs_clstate.c | 38 ++++++++++++++++++++++---------------- sys/fs/nfsclient/nfs_clsubs.c | 6 +++--- sys/fs/nfsclient/nfs_clvnops.c | 2 +- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index 9fbaa6e63a56..f66065f1f0bd 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -440,18 +440,6 @@ nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, KASSERT(mp != NULL, ("nfscl_deleg: mp NULL")); nmp = VFSTONFS(mp); - /* - * First, if we have received a Read delegation for a file on a - * read/write file system, just return it, because they aren't - * useful, imho. - */ - if (dp != NULL && !NFSMNT_RDONLY(mp) && - (dp->nfsdl_flags & NFSCLDL_READ)) { - nfscl_trydelegreturn(dp, cred, nmp, p); - free(dp, M_NFSCLDELEG); - *dpp = NULL; - return (0); - } /* * Since a delegation might be added to the mount, @@ -479,17 +467,35 @@ nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, nfscl_delegcnt++; } else { /* - * Delegation already exists, what do we do if a new one?? + * A delegation already exists. If the new one is a Write + * delegation and the old one a Read delegation, return the + * Read delegation. Otherwise, return the new delegation. */ if (dp != NULL) { - printf("Deleg already exists!\n"); - free(dp, M_NFSCLDELEG); - *dpp = NULL; + if ((dp->nfsdl_flags & NFSCLDL_WRITE) != 0 && + (tdp->nfsdl_flags & NFSCLDL_READ) != 0) { + TAILQ_REMOVE(&clp->nfsc_deleg, tdp, nfsdl_list); + LIST_REMOVE(tdp, nfsdl_hash); + *dpp = NULL; + TAILQ_INSERT_HEAD(&clp->nfsc_deleg, dp, + nfsdl_list); + LIST_INSERT_HEAD(NFSCLDELEGHASH(clp, nfhp, + fhlen), dp, nfsdl_hash); + dp->nfsdl_timestamp = NFSD_MONOSEC + 120; + } else { + *dpp = NULL; + tdp = dp; /* Return this one. */ + } } else { *dpp = tdp; + tdp = NULL; } } NFSUNLOCKCLSTATE(); + if (tdp != NULL) { + nfscl_trydelegreturn(tdp, cred, nmp, p); + free(tdp, M_NFSCLDELEG); + } return (0); } diff --git a/sys/fs/nfsclient/nfs_clsubs.c b/sys/fs/nfsclient/nfs_clsubs.c index 80ab979d22d7..8bb51e29e1d1 100644 --- a/sys/fs/nfsclient/nfs_clsubs.c +++ b/sys/fs/nfsclient/nfs_clsubs.c @@ -188,7 +188,7 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper) np = VTONFS(vp); vap = &np->n_vattr.na_vattr; nmp = VFSTONFS(vp->v_mount); - mustflush = nfscl_mustflush(vp); /* must be before mtx_lock() */ + mustflush = nfscl_nodeleg(vp, 0); /* must be before mtx_lock() */ NFSLOCKNODE(np); /* XXX n_mtime doesn't seem to be updated on a miss-and-reload */ timeo = (time_second - np->n_mtime.tv_sec) / 10; @@ -221,8 +221,8 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper) (time_second - np->n_attrstamp), timeo); #endif - if ((time_second - np->n_attrstamp) >= timeo && - (mustflush != 0 || np->n_attrstamp == 0)) { + if (mustflush != 0 && (np->n_attrstamp == 0 || + time_second - np->n_attrstamp >= timeo)) { nfsstatsv1.attrcache_misses++; NFSUNLOCKNODE(np); KDTRACE_NFS_ATTRCACHE_GET_MISS(vp); diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 76a3cdf9281e..13341dfc26e0 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -940,7 +940,7 @@ nfs_close(struct vop_close_args *ap) /* * Get attributes so "change" is up to date. */ - if (error == 0 && nfscl_mustflush(vp) != 0 && + if (error == 0 && nfscl_nodeleg(vp, 0) != 0 && vp->v_type == VREG && (VFSTONFS(vp->v_mount)->nm_flag & NFSMNT_NOCTO) == 0) { ret = nfsrpc_getattr(vp, cred, ap->a_td, &nfsva); From nobody Sat Jul 13 00:49:58 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WLVHB3bKvz5R8yt; Sat, 13 Jul 2024 00:49: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 4WLVHB346Vz4MFk; Sat, 13 Jul 2024 00:49:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720831798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=frKAEuQQjmgoUxly7vwZge50f0Ha92s3a3y8WdsbEK0=; b=CYolGp+FSoSDKdr4YMqhxFZA5M3lEcFp6AQ3kyffIsBjm9OXbW5rEfsvBEH7Yts0pv6ZPn 5Zc8K32HCaEjNjPw8jghJolMWlAPIdJOxF7KhacJOA0qBXPN+MVPLVcGmR3U8VVIqbZOsw iTKnMh9zvmQBWkeU+sVh1xl55m5afiMaCV4sC6L5mrkeVWV8kw9nBwOtsMeyrilP1T6GQq YCS5w/V8kkGH09q0JKvAuUs9Gb/Fd07oXGaEVc14cYoKz1HMSzqTlKu6llZYfo8XuMauns RHu9TJVceqhVgI/fjtDBjXSyKB2PKpJN/Atba9SqVz8j0o2J8JecEMvlku/Zqw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720831798; a=rsa-sha256; cv=none; b=ix6eoZzCehaYtRLCTpMvRcuEdsIMKESWoALVCO0K0uEHRPHxl9zp8MeF6ZiFNXxlzk+NyZ BpxW7KVOuq1Sm6EbpEtxFLfnP2MayFJ5klMRVV8cu38h6GHNSX1vGyv8UF5SH23F9vHumf r9J6BkTxpVa/FbB7RC++njvqcvc79II6rVzTL5cociTVB/3qvRF29W8y2ygaLezbD8AWy5 vMrCPi3VigzTSvnbNZP/Z1O6RvsFb+Yv3Tfj9AjjlYIpN5uTMc9k38xRAE3LFWpFqQ5bjp P5lw1pG9FbyZPcnP5AKgnCv5Q1AofJcpXDpRelM/T5ePvA0ai4B8gYfAkHMWjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720831798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=frKAEuQQjmgoUxly7vwZge50f0Ha92s3a3y8WdsbEK0=; b=NXgYOr+DqJhhccsIuzuVEUpx5vJXBykxQkm4jpzkeo93CJhs6+2vdUddG1eJFv4Cb9+Lf8 fQNLMBzk0Lgs6Cp0kFxWwbYF7rwcjFe+XgPUDG0WbmDp3jalj1+d4aWtTueNmUOXXDw1ys tG8W/OfcBGsThFferB4cFhTi4oLCyHIV5JUje483hCBblACFENyntb3ZrqRF2NOcAk/joD E8liEE3z7lasO4LGxrFZ5Sqw9hDlVfF48ALNhlotskn+ZdS5iuz9iQiIucC5MjxXhypuzS TWDTfcqUKsL6I2nS7/GOpom9ahrCf5+5ZOi6dSWAsGgOmpiv9e2W2NDHBvSwOw== 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 4WLVHB2fkdz157N; Sat, 13 Jul 2024 00:49: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 46D0nwHx052972; Sat, 13 Jul 2024 00:49:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46D0nw2j052969; Sat, 13 Jul 2024 00:49:58 GMT (envelope-from git) Date: Sat, 13 Jul 2024 00:49:58 GMT Message-Id: <202407130049.46D0nw2j052969@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: 0ed8ae14d9e0 - stable/14 - nfscl: Add a check for VREG for delegations List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 0ed8ae14d9e09f494bdae74398deae55ba9526f7 Auto-Submitted: auto-generated The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=0ed8ae14d9e09f494bdae74398deae55ba9526f7 commit 0ed8ae14d9e09f494bdae74398deae55ba9526f7 Author: Rick Macklem AuthorDate: 2024-06-12 23:17:23 +0000 Commit: Rick Macklem CommitDate: 2024-07-13 00:49:05 +0000 nfscl: Add a check for VREG for delegations Since delegations are only issued for regular files, check v_type to see if the query is for a regular file. This is a simple optimization for the non-VREG case. While here, fix a couple of global variable declarations. This patch should only affect the NFSv4.1/4.2 behaviour when delegations are enabled, which is not the default. (cherry picked from commit 4308d6e0fc09c807483f09b8fea7f5182d19fd01) --- sys/fs/nfsclient/nfs_clstate.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index f66065f1f0bd..0a1eb51e279f 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -93,9 +93,8 @@ NFSREQSPINLOCK; NFSCLSTATEMUTEX; int nfscl_inited = 0; struct nfsclhead nfsclhead; /* Head of clientid list */ -int nfscl_deleghighwater = NFSCLDELEGHIGHWATER; -int nfscl_layouthighwater = NFSCLLAYOUTHIGHWATER; +static int nfscl_deleghighwater = NFSCLDELEGHIGHWATER; static int nfscl_delegcnt = 0; static int nfscl_layoutcnt = 0; static int nfscl_getopen(struct nfsclownerhead *, struct nfsclopenhash *, @@ -4653,7 +4652,7 @@ nfscl_mustflush(vnode_t vp) np = VTONFS(vp); nmp = VFSTONFS(vp->v_mount); - if (!NFSHASNFSV4(nmp)) + if (!NFSHASNFSV4(nmp) || vp->v_type != VREG) return (1); NFSLOCKMNT(nmp); if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) { @@ -4693,7 +4692,7 @@ nfscl_nodeleg(vnode_t vp, int writedeleg) np = VTONFS(vp); nmp = VFSTONFS(vp->v_mount); - if (!NFSHASNFSV4(nmp)) + if (!NFSHASNFSV4(nmp) || vp->v_type != VREG) return (1); NFSLOCKMNT(nmp); if ((nmp->nm_privflag & NFSMNTP_DELEGISSUED) == 0) { From nobody Sat Jul 13 10:12:31 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WLkmH39VWz5QSY9; Sat, 13 Jul 2024 10:12: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 4WLkmH1zv2z43vq; Sat, 13 Jul 2024 10:12:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720865551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jB1MRO2rKnFSpmNn3SqeTHpgelmeEv5vFaQoiMkL3zs=; b=kAzYcO5d7oXNxvvFP9ZJnh8x8pC75LG4FOiIA4j1wvGVklv5cKjNjF8m0cMzx16nv2NTvP cxIHI/oO5XaxkPkUjMrs17v1NfXJHxkvk5qRtW14+eSrb/GOWGctSoz0tmJY74/XjpQJ2N Pkfozii3uy2rKQvGVMvybQF4823liuD7UG7eAhNXOkrove3iz0i7i5AhXomAm6vAmEi3Z+ p7NnaQhkLwpns73sOSGq17oKNigXyEIS5UOdy+n81CvzCyWVv9rFaa8MypWY5z6ABWQh7Q R10iW2CFDTag2LgZvaYsteQhCvA4DQarHGpWgXmR/eGYbFPpVOZRpR2t/Mx4QA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720865551; a=rsa-sha256; cv=none; b=kagj16bs4T1h6rLLyxoPkur936ZuAeYuLg3SEb/aNg1YdbaQdS1iAQoLj2TdumYKNLVQP8 p+hiQwEPwJIBfBxome3f4+hdSBR6gPK8JLn/+ynMS5CMI3xDWCJFr17JZVxElIFSydqX4T 6qpe48yriAZOePaksARYUGiNiEhTw2ksIDnzOjv0DgXSMlZK7bGj2Nb/YwfAyunRGiVxaw 77UQBosz2rbIEVl7gJ37oxZmYWgXkE5Iiz7QJnJg7HcHblEdnYR04nXhA2nQ/iTjsnxW+V LRiEzfzzMCbdJMXRLjnVVdF1ev0eQilqdowWz8DrRrbSdtuhtZKoDUZhspNl8g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720865551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jB1MRO2rKnFSpmNn3SqeTHpgelmeEv5vFaQoiMkL3zs=; b=LaSmU/e9893LGm5rdsLrt6jYKpmpOPzNZedEkoF/gEx5/pxWApIO+ACzeNGoz7+dMhwr9b fPDAE3i3o+7CDblgYzoRpDuMuC+zS3I/ga/vfis4kKi1LWLNnmVWWzZ/cj/gcj6OA4VYMf bvJZ7qeWd86P01NOJ6Kyb7/yLRtkZ3HexXBS6oNB0XpauARLyq8fDwMcvFVGVlLw45aRIc oXvo2tKLchoca4YyOR8BTs/z4KwE41uWchqq7+qwRgTf35bf9c5W/WTffUbWlXspmFCCg9 9u70MUmWGTkvwA751lAEr/J70NeGZJ+8G/OI9+ZxdqbxF7TFwUxLwCMA0MuqXA== 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 4WLkmH1ZzRzMPv; Sat, 13 Jul 2024 10:12: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 46DACV43025973; Sat, 13 Jul 2024 10:12:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46DACVx7025970; Sat, 13 Jul 2024 10:12:31 GMT (envelope-from git) Date: Sat, 13 Jul 2024 10:12:31 GMT Message-Id: <202407131012.46DACVx7025970@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wolfram Schneider Subject: git: cf1bc41b29a7 - stable/14 - stale-symlink-buildworld.sh: a script to check for stale symlinks on a FreeBSD system List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: cf1bc41b29a7bd90d70445c8cf99474ef7b767b2 Auto-Submitted: auto-generated The branch stable/14 has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=cf1bc41b29a7bd90d70445c8cf99474ef7b767b2 commit cf1bc41b29a7bd90d70445c8cf99474ef7b767b2 Author: Wolfram Schneider AuthorDate: 2024-07-07 12:59:20 +0000 Commit: Wolfram Schneider CommitDate: 2024-07-13 10:11:51 +0000 stale-symlink-buildworld.sh: a script to check for stale symlinks on a FreeBSD system You can run the script before or after `make installworld' You may also check your local ports with: env STALE_SYMLINK_BUILDWORLD_DIRS=/usr/local ./stale-symlink-buildworld.sh PR: 276235 (cherry picked from commit e880dd644f63fbe068c38b73b44aa7e7c5f176f3) --- tools/build/stale-symlink-buildworld.sh | 53 +++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/tools/build/stale-symlink-buildworld.sh b/tools/build/stale-symlink-buildworld.sh new file mode 100755 index 000000000000..a4515db3fccb --- /dev/null +++ b/tools/build/stale-symlink-buildworld.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# Copyright (c) Feb 2024 Wolfram Schneider +# SPDX-License-Identifier: BSD-2-Clause +# +# stale-symlink-buildworld.sh - check for stale symlinks on a FreeBSD system +# +# You can run the script before or after `make installworld' +# + +PATH="/bin:/usr/bin"; export PATH + +: ${ncpu=$(nproc)} + +# check other directories as well +: ${STALE_SYMLINK_BUILDWORLD_DIRS="/usr/obj"} + +trap 'rm -f $script' 0 +script=$(mktemp -t stale-symlink) +chmod u+x $script + +# create a temporary shell script to check for stale symbolic links +cat << 'EOF' > $script +file="$1" + +if [ ! -e "$file" ]; then + echo "stale symlink detected: $(ls -ld $file)" >&2 + exit 1 +else + exit 0 +fi +EOF + +find -s -H \ + /bin \ + /boot \ + /etc \ + /lib \ + /libexec \ + /sbin \ + /usr/bin \ + /usr/include \ + /usr/lib \ + /usr/lib32 \ + /usr/libdata \ + /usr/libexec \ + /usr/sbin \ + /usr/src \ + /usr/share \ + $STALE_SYMLINK_BUILDWORLD_DIRS \ + -type l \ + -print0 | xargs -n1 -0 -P${ncpu} $script + +#EOF From nobody Sat Jul 13 10:14:39 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WLkpl4sZpz5QSkQ; Sat, 13 Jul 2024 10:14: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 4WLkpl3vLgz442N; Sat, 13 Jul 2024 10:14:39 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720865679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W+BhtVyhz55qlNLc3lsNxoYUXc59AvMU21W4+ZeNkwI=; b=mLWwk1fslGiMvO23Na7AGTW2HTdNwj3ATWa0Ik0IVOCR9MVsoSHz6hm/UsUJi6Vq0XnPCg QwcbaNl1uHvotXQh8wSMqkaj+RYHEFmLuc/dmz7pzz0F7z9vwYmab/4UPXLj6S9UBtS6D8 XDe6jBGau2RH5e8bz9t08joDvCA6XVv4z84m24vsOM5cV6U1qRLoyy5bhNVw6jh/EVIXgK 0fSIedqUkG0Y1cTTORoBZVBNTHTQRs4L37y5riLabd6uj/2PyhKR2aTd5aZyttOnGVYBcO 4H8VYDuI6gdEf5zrpYi/q4qdd4arzBYQo4nF10cY2AIL5MunOoMfk615tbDUuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720865679; a=rsa-sha256; cv=none; b=yNiPntKNPFgFtCxNlwkLoyGqG+R4bdXe7E3BY3qa+9Uo3IK6z7AazZQvVin7A7Mx0TfQoY RQyBgglzLFypQ0YVq160VqnE75OcfNVxLCdHpz6g/LOaXFG0MIgmV5Psr+sZPj3aPJBbZ6 Yc+vPXtVW9DwVT7eEzJuJkqjOgrp+5NgCL0A4UWUj59Ok/2vb+rtFWf1knmgvqDN2iixhG BljiPljicp+fhZUQvLmEFsaHPQDRhThB1jlsuO0xc51Q2dXraV/zdxqf+lRgi5jpZsq6wr KPipUszbBBhzcdasXSmKWfVsUbI4XBOsadjRlnMR6t52Wbzs5tNfbjF4cl9kuw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720865679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W+BhtVyhz55qlNLc3lsNxoYUXc59AvMU21W4+ZeNkwI=; b=phgLVvgEZswG2xXwFZOO3X17BrFMj1/5rbBPjPXwnAXrkUKQQhjN8z7L4ueo/dJc7lNvJS i8Zbv3jk9y3X2oiOUMklc5wnXsw3lywDXkHM3wcj6bAcims+1HalTUXtirau2PqqC318lK Y3VJEYls6F/72vLjMBFJT13gq7WPFjGZrHQAzaXSQp0aaysSxL2PMpNPbCeqIvSnNEelAa 1YZrhDvURUJYABwnIN0gT6LTafswHKsifyD2H5TaOauK0xhb2c532p/u0ESRe659oEh8BP j32UNG2gf4qZi/vfjyJxxAj+RznvPxnAgY5LyB9Lp5RcpSq2AWKs6EdYZAbcrw== 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 4WLkpl3BkSzMnw; Sat, 13 Jul 2024 10:14: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 46DAEdYv026400; Sat, 13 Jul 2024 10:14:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46DAEdKG026397; Sat, 13 Jul 2024 10:14:39 GMT (envelope-from git) Date: Sat, 13 Jul 2024 10:14:39 GMT Message-Id: <202407131014.46DAEdKG026397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Wolfram Schneider Subject: git: 3e8a2296e9ad - stable/13 - stale-symlink-buildworld.sh: a script to check for stale symlinks on a FreeBSD system List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wosch X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3e8a2296e9ad827268d0398738a3ed95877d872e Auto-Submitted: auto-generated The branch stable/13 has been updated by wosch: URL: https://cgit.FreeBSD.org/src/commit/?id=3e8a2296e9ad827268d0398738a3ed95877d872e commit 3e8a2296e9ad827268d0398738a3ed95877d872e Author: Wolfram Schneider AuthorDate: 2024-07-07 12:59:20 +0000 Commit: Wolfram Schneider CommitDate: 2024-07-13 10:14:27 +0000 stale-symlink-buildworld.sh: a script to check for stale symlinks on a FreeBSD system You can run the script before or after `make installworld' You may also check your local ports with: env STALE_SYMLINK_BUILDWORLD_DIRS=/usr/local ./stale-symlink-buildworld.sh PR: 276235 (cherry picked from commit e880dd644f63fbe068c38b73b44aa7e7c5f176f3) --- tools/build/stale-symlink-buildworld.sh | 53 +++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/tools/build/stale-symlink-buildworld.sh b/tools/build/stale-symlink-buildworld.sh new file mode 100755 index 000000000000..a4515db3fccb --- /dev/null +++ b/tools/build/stale-symlink-buildworld.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# Copyright (c) Feb 2024 Wolfram Schneider +# SPDX-License-Identifier: BSD-2-Clause +# +# stale-symlink-buildworld.sh - check for stale symlinks on a FreeBSD system +# +# You can run the script before or after `make installworld' +# + +PATH="/bin:/usr/bin"; export PATH + +: ${ncpu=$(nproc)} + +# check other directories as well +: ${STALE_SYMLINK_BUILDWORLD_DIRS="/usr/obj"} + +trap 'rm -f $script' 0 +script=$(mktemp -t stale-symlink) +chmod u+x $script + +# create a temporary shell script to check for stale symbolic links +cat << 'EOF' > $script +file="$1" + +if [ ! -e "$file" ]; then + echo "stale symlink detected: $(ls -ld $file)" >&2 + exit 1 +else + exit 0 +fi +EOF + +find -s -H \ + /bin \ + /boot \ + /etc \ + /lib \ + /libexec \ + /sbin \ + /usr/bin \ + /usr/include \ + /usr/lib \ + /usr/lib32 \ + /usr/libdata \ + /usr/libexec \ + /usr/sbin \ + /usr/src \ + /usr/share \ + $STALE_SYMLINK_BUILDWORLD_DIRS \ + -type l \ + -print0 | xargs -n1 -0 -P${ncpu} $script + +#EOF From nobody Sat Jul 13 17:08:48 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WLw0d0wZCz5Qjjc; Sat, 13 Jul 2024 17:08: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 4WLw0d0K0Lz4kwW; Sat, 13 Jul 2024 17:08:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720890529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=olCsZjz9JrNMV1sqkl+jjo1hmF69IPBUuuB7zjb+9i0=; b=ym+tl3WkXYAIcgTpXWl4xm6a1tCCCeHWJLVBPi9gzMWRU9OEDyTAeoTeR4Bdacm9ywsUZB 80IQmB8IOl4Z6p6VMHbg4ULfAubOqAMkuJu9OlBZxf0deMaZz5drJt5hZ5s29gqhJQ34/b kSAgGIPbKHDWvYbuI3P9xB2CqeQEYrNuTWrzot+wplbHI9qENcFdEGNOpHYwY3FOr4Jvwe Mt9Vw8jISikZH6Gbvmt2Q0wK0t/IpZgHQDa3AIHAbfVyIU7l2SF1FyA70nhS34PEqlfmAI K9DSzYjfbFoCYa+6urzGWP35kOmz7+86FJnplvys++2GW8lzpY5m95yk6IOySg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720890529; a=rsa-sha256; cv=none; b=eY/fIRVExMj4xy/NzlP2LVZn0jtRdzRO82bc/LrH+vc4efV+tLJDv6MnjJ3bPYMp4fWTCw GV3ngFcTMHfRyWdVwqrpg4jL8zUfzcR8Ve+1DTWdtHOVnbJkBsoeON2lyqTNEJTnBH6x6f r1Jxnd/jiFPzxsLNNnnJpi7nLvAouymPjWVmzUOt/8P8tUnPPqCUeyV98h30foiY4dM9GZ eVG8Wq4DRDTeNCdzh2gfF9UPg8ht3Ma1UEqyZ0wNPrTOcre1X9ePUYUxtQvtwHvMaV2PD5 oFAec7trllXYWpp5Kdb41c7CaFnSm6ATa8inw3+0FzSqDOQ+ZuJAw2kVk0cgoQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720890529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=olCsZjz9JrNMV1sqkl+jjo1hmF69IPBUuuB7zjb+9i0=; b=LIacorYV3iqrrOze/mERTECHqs2k2WGe9uwYWuAhB2+ZzfCURlY68ILF0Ewohnujay8j07 5yuSNAs5dy2pwhJGNhzCUeEm8wcy54WXT/NjmEGhBC0drW6wpBIEAYFNkNC+/JMdAJ798b TMdkYtce4kmrZugDj/Lzgc7iKQA6kpYHHkqWj5PBDpukXlY+wvz7OUn31Iqp+MZeE/0lqO JaR2xJxOLOdrE/Ca7dT7jJp+80Jopb1XHluYEGiw4cjNSPqSiDJOmQpSsO4JA+kriDC6lS xecLAfAPcEfo4CNr58VY4/B4R7Y9dGia1hbYV1YYIDKIHt6+msviKtu4HvNY1w== 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 4WLw0c6v0HzZ5w; Sat, 13 Jul 2024 17:08: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 46DH8mIW022646; Sat, 13 Jul 2024 17:08:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46DH8mkj022643; Sat, 13 Jul 2024 17:08:48 GMT (envelope-from git) Date: Sat, 13 Jul 2024 17:08:48 GMT Message-Id: <202407131708.46DH8mkj022643@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 7ad3c40b1764 - stable/14 - mps(4): Correct a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 7ad3c40b1764de3622a7acd09d1297f682418395 Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=7ad3c40b1764de3622a7acd09d1297f682418395 commit 7ad3c40b1764de3622a7acd09d1297f682418395 Author: Gordon Bergling AuthorDate: 2024-07-06 17:49:30 +0000 Commit: Gordon Bergling CommitDate: 2024-07-13 17:08:08 +0000 mps(4): Correct a typo in a source code comment - s/vender/vendor/ (cherry picked from commit a9d7f098b86576006f5aeb312521bfde5ac77c77) --- sys/dev/mps/mps_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/mps/mps_pci.c b/sys/dev/mps/mps_pci.c index ece49435b39e..7a0c577eb72a 100644 --- a/sys/dev/mps/mps_pci.c +++ b/sys/dev/mps/mps_pci.c @@ -122,8 +122,8 @@ struct mps_ident { 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2208" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_1, 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2308" }, - // Add Customer specific vender/subdevice id before generic - // (0xffff) vender/subdevice id. + // Add Customer specific vendor/subdevice id before generic + // (0xffff) vendor/subdevice id. { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_2, 0x8086, 0x3516, 0, "Intel(R) Integrated RAID Module RMS25JB080" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_2, From nobody Sat Jul 13 17:08:49 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WLw0f1RFNz5Qjs1; Sat, 13 Jul 2024 17:08:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WLw0f0z5Jz4lBd; Sat, 13 Jul 2024 17:08:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720890530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+e3DdRqhGPrXcPLx3aXXGYaIJIIqWtqzUfUS2YBb6Fg=; b=KU3hx21MZVuJUd2gDJ/5m1wclTFskzQjnw/cIAgzBkStK0IJH/Pp3PU4Y6jgXuTc4PmuMR MROXan5FMFs29npByFsHrpJ+7a1/T6vN5ofbtYVACeKg8MFX9V2Qv7nwrh+Xm8mY4aHW9S mD8OXGDubCF3x8dyGRMKdP6DFBGwh3EJyKJioqkEWNVVSPxyPP5vl/Q51ZReGtcCwkn0vi lanQfSr3fzCkL0zXkwzNlad3N5py7fU5M3qlXWWbJ8Q4pZHtMse63V4Nxrp2VRGplhvcoJ Cgomy0wCStQCtKMibFWdLOiIGWuH1bJxQ5p8n1G/DWbUq5tuJVHhMVlRQ2zCUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720890530; a=rsa-sha256; cv=none; b=G0l7qVTrj6dnyHv+0JcLNJF2FFTH7X+KBUaUaA0xnavcrsEt6v01P0DbimRcIohYiQeZjn e3xuYsWlSksvCnHfGhLjRyryYi+2XQOefp7mjS0zGdaCeWALbFUfYhi+TGngxdgmQ/dmUy RYAa7m0xnVwl8Po9RlroDrIPPSP8cNqLEKa/M9UiCNK4KxUntmiU6p5RM+kmCh4P/IOm+g V00US7HXu8xULUNnpoNRyllyQJt57w9IUiqJsKSiK1UvfRJstbFV9hfsuT7XTPQ+zJMpXd K4VnVVYHF4+4yfNj0AgSCRf5UPHfS5QRJjxLRK8W3KbBMYr3o1Wfe+FW4gsjyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720890530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+e3DdRqhGPrXcPLx3aXXGYaIJIIqWtqzUfUS2YBb6Fg=; b=XY/nWnMt2l7sqYVMhwSrKV0XVtPpwHLf/V4984HPraaO65uO7QN8nS4lmg6k6KAHAVILVt kZE1f2kuR5VWvSv4Upid/gcrPLeV9EM+BN4P8WSDNC9XOmp3i28U327cWER9ydakpwGSjZ J5zpDAHrtMx/JELBFZnIwEd8FrNKWWQWL97y59XitrQjQqsYiy8Tk+MMnnlJWcd2si58gh DrPFPM93IF61/z0BbMXYJK/o++CqTzblewpEFnx73JPLN3T2W9H7iOZjOYAQ94Y5zbwJL2 J9ccHfgOQz5FagfzZ+7OTX4Z/At40jm/BzH8Kc9T5fHGOyNvTluQOgWM/kQt/A== 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 4WLw0f0XR0zbBG; Sat, 13 Jul 2024 17:08:50 +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 46DH8nMH022697; Sat, 13 Jul 2024 17:08:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46DH8nF2022694; Sat, 13 Jul 2024 17:08:49 GMT (envelope-from git) Date: Sat, 13 Jul 2024 17:08:49 GMT Message-Id: <202407131708.46DH8nF2022694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 4779a4dde7c6 - stable/14 - ocs_fc(4): Fix a typo in a kernel message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4779a4dde7c6378b443f7b23567556cb05ffd279 Auto-Submitted: auto-generated The branch stable/14 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=4779a4dde7c6378b443f7b23567556cb05ffd279 commit 4779a4dde7c6378b443f7b23567556cb05ffd279 Author: Gordon Bergling AuthorDate: 2024-07-07 14:17:23 +0000 Commit: Gordon Bergling CommitDate: 2024-07-13 17:08:38 +0000 ocs_fc(4): Fix a typo in a kernel message - s/elasped/elapsed/ (cherry picked from commit 6ea81bcaf8adcf6a8546407e93e97f3d920396d2) --- sys/dev/ocs_fc/ocs_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ocs_fc/ocs_hw.c b/sys/dev/ocs_fc/ocs_hw.c index cfb9d4f8f536..c368e09aef8c 100644 --- a/sys/dev/ocs_fc/ocs_hw.c +++ b/sys/dev/ocs_fc/ocs_hw.c @@ -11214,7 +11214,7 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t status, uint8_t *mqe, void *arg) getmicrouptime(&cur_time); timevalsub(&cur_time, &io->submit_time); if (cur_time.tv_sec > io->wqe_timeout) { - ocs_log_info(hw->os, "IO timeout xri=0x%x tag=0x%x type=%d elasped time:%u\n", + ocs_log_info(hw->os, "IO timeout xri=0x%x tag=0x%x type=%d elapsed time:%u\n", io->indicator, io->reqtag, io->type, cur_time.tv_sec); /* remove from active_wqe list so won't try to abort again */ From nobody Sat Jul 13 17:09:05 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WLw0y0WG4z5Qjs9; Sat, 13 Jul 2024 17:09: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 4WLw0x75Gbz4lZw; Sat, 13 Jul 2024 17:09:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720890546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a6UCoKBLIfAKft7MMmlYFO3HaDtAw3nCIjwkkuo//Uo=; b=S8XtDi1ZiqYetoLbaC9t9yj1dulNNp6Tjma8H0+p1Wqqjy1zkYUzyRrwQsdCwcWoqAaAq6 6cbz4giGetb3eRTZPyueVn6e05ETRNeYfBz/IKK+FBQq5NlfaOVcTZQo4ZYh+mjrZgFgG3 DlwYakREG9LrO9dasPIBXIZI8ottJyAUaw++/MkqDKjxMDUZZxxAvh7JlLlJUiKvLWRtXu WJ+T7LcjlDi4LyQ8Y/SEdKyOOfRIj11TmHDd1IxdstTPnq0+gt8sVmVjmkZWvPv+5DlhiF cVh1VAMT4OfJWzRyk140j3bhbKFGaSc63qgWRY+ryHP+2L0NG0vyp5662bPJJA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720890546; a=rsa-sha256; cv=none; b=XgvIWF/Nx6wcCmp+M4CpHYR7EhCi3NUmn8wmyq/NoY//pJZg0yYaUxURM+/FUUo1RNbS62 QOjiGFgME5rei7/f/xcMg7IUhxBP+n0+MiNqeUTnCmX0qbAhCq1SvHKd1IRMhUbVOoLJqM AAQ3+LVRKnaYe7208QB7A6ZBcI1HGQkxidlaNAImHZhUy3XiskOSAJxkjVPz45vdgwlLuQ JJfHfsRz4mCgDvMWyhQX2VJ1KiS8RhzDBdO03yV/zhZfiMzSovOPybcVdQ5HZyZOW7sCAG ZyCateLUXOrBXjcG3whBXo0cBq5mYiR9QORgqxYj8MwosQfvWvQq6BInon//OQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720890546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a6UCoKBLIfAKft7MMmlYFO3HaDtAw3nCIjwkkuo//Uo=; b=Q3dIqHVyVU3wINUoTTbBg3PeAEfwWgKwTEB2vkUTmB59PgyuX4xhQ+9up6GK7LFbwi1E88 CRpjTHnOjAFCc0PIA6wmgJHKJXFYwpI8Y26Vxuk+u0vxp4D2oroAEpHfaYsbl5hGfNUyb7 mz6/pPEdQCAE/D3LiHRSUoPa+ijgRAyA34mOR83aa1FKkJ3EuPiv2kQW6FUVuK9YVwwPhq 8Hzxkt/V2mYhEyi8J94U/vjT7cGZl1DPhmuyxzTrCb4w6hc8vi8Ook+MqruHjq1Rk9wVw1 pi2HTR5UWjt9MtTBT1/bBFn4NABvoz1SbACOAtK13JHYpWckxnvIdsC7510WHA== 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 4WLw0x6jLLzbBH; Sat, 13 Jul 2024 17:09: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 46DH95rO022887; Sat, 13 Jul 2024 17:09:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46DH95hY022884; Sat, 13 Jul 2024 17:09:05 GMT (envelope-from git) Date: Sat, 13 Jul 2024 17:09:05 GMT Message-Id: <202407131709.46DH95hY022884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 66ce02ff31b6 - stable/13 - ocs_fc(4): Fix a typo in a kernel message List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 66ce02ff31b6c42fd8492ff83ddf3980f1459621 Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=66ce02ff31b6c42fd8492ff83ddf3980f1459621 commit 66ce02ff31b6c42fd8492ff83ddf3980f1459621 Author: Gordon Bergling AuthorDate: 2024-07-07 14:17:23 +0000 Commit: Gordon Bergling CommitDate: 2024-07-13 17:08:58 +0000 ocs_fc(4): Fix a typo in a kernel message - s/elasped/elapsed/ (cherry picked from commit 6ea81bcaf8adcf6a8546407e93e97f3d920396d2) --- sys/dev/ocs_fc/ocs_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ocs_fc/ocs_hw.c b/sys/dev/ocs_fc/ocs_hw.c index 186b04b8b129..9b368e32ce32 100644 --- a/sys/dev/ocs_fc/ocs_hw.c +++ b/sys/dev/ocs_fc/ocs_hw.c @@ -11214,7 +11214,7 @@ target_wqe_timer_nop_cb(ocs_hw_t *hw, int32_t status, uint8_t *mqe, void *arg) getmicrouptime(&cur_time); timevalsub(&cur_time, &io->submit_time); if (cur_time.tv_sec > io->wqe_timeout) { - ocs_log_info(hw->os, "IO timeout xri=0x%x tag=0x%x type=%d elasped time:%u\n", + ocs_log_info(hw->os, "IO timeout xri=0x%x tag=0x%x type=%d elapsed time:%u\n", io->indicator, io->reqtag, io->type, cur_time.tv_sec); /* remove from active_wqe list so won't try to abort again */ From nobody Sat Jul 13 17:09:28 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WLw1N6YxWz5Qjcm; Sat, 13 Jul 2024 17:09: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 4WLw1N62hDz4lTF; Sat, 13 Jul 2024 17:09:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720890568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZolXKAwnVrZFhdO4AMLJzsVDvF3fWedGv8j8OQiPNi8=; b=HIvs2nDHLMontDhZAxBn/wnCTTUgEUCNHa2RGFMMbUSV89ZB3YSvp3qU1HYQ8RilLojGXI r1apPJyQyGgmYyMG8ufx2T/4qtT84i3gSOWRfPfW1j48JIIdvXcZTtYv9jbZHrTZlN+jNF 2yPLs6CK7woIL2cADDwDru+ZZLMsYquBu2aBjsToe1iy2KS5UmlF7+nJXRa0RHV9/vJoTX bh0gJ8/Ms8hHxy0oWKfvViRdmUXwv9C3ZzlXpaNQjRE3DgE/i4tcRQfH6OR/S1CbEpq5u1 7gVgRY0WDdyKdru/MX3TdnA8GTXaTajO2V/nY5+cXZcy3oTr3hSoKqdoBxMYGA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720890568; a=rsa-sha256; cv=none; b=iJOBB2Mhy9PjHGXt8HFHEJbr9rBE9V9dCawWwqNmpUu7RzxiHRy7E3FzZyRANPIEXm/R4V s336Xe6Tya7oqTqtzjd3Pym6W7t+8/joYs4vS0p5KkcUICyTBObta6xT+RVFfBirew0YTh xXstgP4rszVUmdwiw/LyCgMnnZU592iXeKc5PIkc82NnKU1RWOaM6ZRVCAMsQXFy58PfBS ArxUeMEnVqiq4jBqRu2sBziO/Zq1l5l2wPTMEXAgPjCQ/lKMOPhJuMypc1uJdi3J1srQax 5wFHdj7tHbIeIS3+rq224VPnwVhyMpjzXe7oZRTt/RQ40eWgfDmk1pezSCWsyg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720890568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZolXKAwnVrZFhdO4AMLJzsVDvF3fWedGv8j8OQiPNi8=; b=qMWaYgg+vG3/Vw4sbsEvOzAkoq/c8QYlaBSGFWxpAGxUaH+czJE10ztn/ZJBiw3Fm7xhcc fPxXqxFGB0zPMggIJ3qdXU+jVU9HUG+cT2pXkhYZn1HIkJcPMx441EYB5KdmInBd4Lbr1k yNetgpLl1Q1MjyXyiwwaLjh6cKwpUq6c74PK4uM0gl93spO2dSZxmru2yyes3vf5dNYKFp t/5Vl9m/+Vh6P1Bf6ZN1wXE68LgkW3RxoH1gCtrWb9OKp8AbEVNX7OlkdrLcsbv4iZqb61 F6og3zsX7+jt6gZa/AZzREx1C2oHtzunvxrFlWn6Ioa+p0PtAUqTClEIizVlSw== 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 4WLw1N5fFSzZ5x; Sat, 13 Jul 2024 17:09: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 46DH9S2j023073; Sat, 13 Jul 2024 17:09:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46DH9S15023070; Sat, 13 Jul 2024 17:09:28 GMT (envelope-from git) Date: Sat, 13 Jul 2024 17:09:28 GMT Message-Id: <202407131709.46DH9S15023070@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Gordon Bergling Subject: git: 200eab80e4f0 - stable/13 - mps(4): Correct a typo in a source code comment List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gbe X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 200eab80e4f04582ab5896ae5f98f25249f4d9e7 Auto-Submitted: auto-generated The branch stable/13 has been updated by gbe: URL: https://cgit.FreeBSD.org/src/commit/?id=200eab80e4f04582ab5896ae5f98f25249f4d9e7 commit 200eab80e4f04582ab5896ae5f98f25249f4d9e7 Author: Gordon Bergling AuthorDate: 2024-07-06 17:49:30 +0000 Commit: Gordon Bergling CommitDate: 2024-07-13 17:09:20 +0000 mps(4): Correct a typo in a source code comment - s/vender/vendor/ (cherry picked from commit a9d7f098b86576006f5aeb312521bfde5ac77c77) --- sys/dev/mps/mps_pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/mps/mps_pci.c b/sys/dev/mps/mps_pci.c index a0699660b872..ebffe825934a 100644 --- a/sys/dev/mps/mps_pci.c +++ b/sys/dev/mps/mps_pci.c @@ -122,8 +122,8 @@ struct mps_ident { 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2208" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_1, 0xffff, 0xffff, 0, "Avago Technologies (LSI) SAS2308" }, - // Add Customer specific vender/subdevice id before generic - // (0xffff) vender/subdevice id. + // Add Customer specific vendor/subdevice id before generic + // (0xffff) vendor/subdevice id. { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_2, 0x8086, 0x3516, 0, "Intel(R) Integrated RAID Module RMS25JB080" }, { MPI2_MFGPAGE_VENDORID_LSI, MPI2_MFGPAGE_DEVID_SAS2308_2, From nobody Sun Jul 14 16:43:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WMWNj5mHsz5QyP6; Sun, 14 Jul 2024 16:43: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 4WMWNj5CYdz4MFN; Sun, 14 Jul 2024 16:43:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720975397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vxEWuu7ECqywDP8tr8b6+5kjwNCFmBrRtYbP+S9fkBo=; b=LnWs5cZfZqBgKEShtoHK2FPUu+9D8GJU8Cv9tUFw497V01I596Hhu340DqQ+IVxD3Nawt4 nuVKU6tP3Kt268kpenG2GHSUbCI2iZRV1sXMDO87mwo5CkSD7IRjYE4n4oAW5yrXbaLAUE WLX+vhTX8h8C7EQfCXAS/zHdJqBGQQTrV22MThnGba7WaPjxdI8d3Nvd4ukhHuj6M1PY2a LRjQVoemkEg6xc+wlev0lQwIcpB66ipSnMfSPB+DTfwi0N91O21uBg1xDZbz71PsrH+RDn IRmOKIMsxQJryFEhDyXqWnEoAtlcrkwuz4eMI3DgUEZzrLUUa4rhrybQru97+g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720975397; a=rsa-sha256; cv=none; b=mX4ZMfEgHKNnHeJrVkMF/hUFQqwbBXD6Xung5lVyLUG745DPRI95F5X5yHquyTr3MLDHfr dn6exJP/h20BJg9BW5rASJKaR8vgCzKeDvW032X8yxsuUiN7DAClwLFZomk4E2mAMgn1tv B2uG4cU2SiEJ3u0Ti8oTYjDKyUUComQdR6BNGfq1WOeh8aguRhvd0WupydstssHq0eSslR sSDiy4KWEMnXstTXEjKBpKxYtU5cRBhbh677pfcQfsxYYjPETDxKKxKkTlz25bPZvNT/ol SXEbogzqmkSj6aLKQXlG6RzXrG+fREamUOQSVKWuZB/F3YUPW/oP9EyG8hA3pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720975397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vxEWuu7ECqywDP8tr8b6+5kjwNCFmBrRtYbP+S9fkBo=; b=Z6YcPsXCvDazDfbxCqbsLdJ4NNtt3zNfAlMZSRr8BWdlp5xidHG6eil36B7UtnTkDpBjSB nmjqM2S1l3Drd64aTrKjlYjnPe2xVrFr7BmUE4IiksTzc2FcNXhwqDY7P8pbfb59oznUIR WR5VXO53dEGnA/M41dHu/8Rbzwoh0/XjtZ/xE0RcA/DPY91or3YWPrK53eDtRLP/waIaof t5V56iiCwSXydcsYn8+xqxvhhvnzHZ0cGFUhnEsYDzxmaTEM1vSw6OlRLtPHkayuVA57fn vHEf2uO5887d62d4MtLwQkxBWnkZIlKXmtWKkV8aiMB01oECUvri78QqB4i8Fg== 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 4WMWNj4qSkzHDL; Sun, 14 Jul 2024 16:43: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 46EGhHdk039517; Sun, 14 Jul 2024 16:43:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46EGhHAF039514; Sun, 14 Jul 2024 16:43:17 GMT (envelope-from git) Date: Sun, 14 Jul 2024 16:43:17 GMT Message-Id: <202407141643.46EGhHAF039514@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: 9ab7f84be600 - stable/14 - dtrace: Add a partial implementation of dtrace_getarg() on arm64 List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 9ab7f84be600572534bf77b54cb566d92e6ce197 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=9ab7f84be600572534bf77b54cb566d92e6ce197 commit 9ab7f84be600572534bf77b54cb566d92e6ce197 Author: Mark Johnston AuthorDate: 2024-06-20 16:41:01 +0000 Commit: Mark Johnston CommitDate: 2024-07-14 16:16:01 +0000 dtrace: Add a partial implementation of dtrace_getarg() on arm64 For invop providers (i.e., fbt and kinst) we can simply reach into the invop trapframe to fetch argument registers for arguments 0-7; for argument 8 and beyond we have to read the value off of the stack. Reviewed by: Domagoj Stolfa, avg MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D45649 (cherry picked from commit bae00433f013c1c960ab13b9d81edef5a9dbf84d) --- sys/cddl/dev/dtrace/aarch64/dtrace_isa.c | 33 +++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c index 34e225f32e81..72944e8a5ae2 100644 --- a/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c +++ b/sys/cddl/dev/dtrace/aarch64/dtrace_isa.c @@ -238,14 +238,37 @@ dtrace_getufpstack(uint64_t *pcstack, uint64_t *fpstack, int pcstack_limit) printf("IMPLEMENT ME: %s\n", __func__); } -/*ARGSUSED*/ uint64_t -dtrace_getarg(int arg, int aframes) +dtrace_getarg(int arg, int aframes __unused) { + struct trapframe *tf; - printf("IMPLEMENT ME: %s\n", __func__); - - return (0); + /* + * We only handle invop providers here. + */ + if ((tf = curthread->t_dtrace_trapframe) == NULL) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_ILLOP); + return (0); + } else if (arg < 8) { + return (tf->tf_x[arg]); + } else { + uintptr_t p; + uint64_t val; + + p = (tf->tf_sp + (arg - 8) * sizeof(uint64_t)); + if ((p & 7) != 0) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADALIGN); + cpu_core[curcpu].cpuc_dtrace_illval = p; + return (0); + } + if (!kstack_contains(curthread, p, sizeof(uint64_t))) { + DTRACE_CPUFLAG_SET(CPU_DTRACE_BADADDR); + cpu_core[curcpu].cpuc_dtrace_illval = p; + return (0); + } + memcpy(&val, (void *)p, sizeof(uint64_t)); + return (val); + } } int From nobody Sun Jul 14 16:43:18 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WMWNk6M6kz5QyV5; Sun, 14 Jul 2024 16:43: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 4WMWNk5gtjz4MHV; Sun, 14 Jul 2024 16:43:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720975398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W1b3JRMyCz+so9HZW0AzRTUr1mVGbgLsbhFCD65lfHM=; b=VCn9KmDPu2GOtTE/ehi4CBYU2oFUXIlAFI9MmT+S5uoC4hogM6zfY2cDK+UJt0RA13sGyD rnLbDb2OEqY6sAADZN56hPoYB6HJYBnmazUAMhyBIQJyA+ELowGCkL0kxNgN4AxI1VAdDZ R6GSpHmJnUZxCRNFH1kvYQ+/Unjh2BclApi3RrdZtR6Ik9z1VGAE5oT/eqMh45K7eSIfSd aW2SVfWBKDcpFq3wf5tdqSSay/GWBzfe/R1XixU8yZlHettjRgAQS20cgmaepEuxxBT0eY bWvHhEAJUm9b7x/pMviiHR20TRfiGVId7rexSbx9i+taYrHd24NycFBtcIL+Xg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720975398; a=rsa-sha256; cv=none; b=u4w3Tg9j6fRNC5lc7X3TzIZbJOIvL6Gvu5OCR7NYXyrskX8P7vb43/w05t2BKXzcX59sWD qPRfMjyUb0K5q2i5O6Gvkoq4sXr3/bRXg7Y6BNttfNg+YQqxVeOVtmaKSQjGXUdTse/YvA nQ8v5nlO9ivgrSdA4FNA3PEubwcsQ4/WH0Ct1PglNmjMV10dcYd4Yqqbx9hRgYP+qPRboA wyVEWCQ1ohpgERqj5ExnFu6Y0ZU93K68xlJCEktkTCXucC9G7d2CSvp/tMFcz07Gaxf49M CUOqdYUiywuKjp2mrZVnaNYWj8cT2UUdaIm3mU2i/apZNQiPZTrfGc0IephZUA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720975398; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W1b3JRMyCz+so9HZW0AzRTUr1mVGbgLsbhFCD65lfHM=; b=HFZgPOAvWpnuNFBjnXX9c39BoP/V15C/qC8D88/nzb7BvLWhq4KATmG+85jmn92VXemF3L qVNeGBPXi/8fIrERXvnYoSZB03bM8tyfCGYqYCUszRZ9I/V46A9x0Facy2owF1H1yhI9hV z/tGOHU/1K4Kznpl6jXtzSrpQIANVaXpxaSb+LM114avNvMTAQqEZ3Rgxn+CDrrWdd1odg N2qq1oKhYIavbnZe94tqSisx1rUQe2WyUi4TBx0mC7P892AkSvoHjQbDYVQk8f3Ewm1NG5 yiMeRo/RRkL62LBSo5nu0d1Zg/C7E+bRtRA1mmgb9cS+gMFSoHTd73+iaSrKaQ== 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 4WMWNk5GfCzHX7; Sun, 14 Jul 2024 16:43: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 46EGhIKV039567; Sun, 14 Jul 2024 16:43:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46EGhINI039563; Sun, 14 Jul 2024 16:43:18 GMT (envelope-from git) Date: Sun, 14 Jul 2024 16:43:18 GMT Message-Id: <202407141643.46EGhINI039563@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: 7126da66e484 - stable/14 - lagg: Fix a teardown race List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 7126da66e4848e89ac29fd7b9da9e6fdb3b52f17 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7126da66e4848e89ac29fd7b9da9e6fdb3b52f17 commit 7126da66e4848e89ac29fd7b9da9e6fdb3b52f17 Author: Mark Johnston AuthorDate: 2024-06-24 14:47:29 +0000 Commit: Mark Johnston CommitDate: 2024-07-14 16:16:01 +0000 lagg: Fix a teardown race When a lagg interface is destroyed, it destroys all of the lagg ports, which triggers an asynchronous link state change handler. This in turn may generate a netlink message, a portion of which requires netlink to invoke the SIOCGIFMEDIA ioctl of the lagg interface, which involves scanning the list of interface media. This list is not internally locked, it requires the interface driver to provide some kind of synchronization. Shortly after the link state notification has been raised, the lagg interface detaches itself from the network stack. As a part of this, it blocks in order to wait for link state handlers to drain, but before that it destroys the interface media list. Reverse this order of operations so that the link state change handlers drain first, avoiding a use-after-free that is very occasionally triggered by lagg stress tests. This matches other ethernet drivers in the tree. MFC after: 2 weeks (cherry picked from commit 02cbf9ebf110c94ec9e60f0801716ff0a75e55e5) --- sys/net/if_lagg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index e55b46a047df..baf2643ff871 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -636,8 +636,8 @@ lagg_clone_destroy(struct if_clone *ifc, struct ifnet *ifp, uint32_t flags) switch (ifp->if_type) { case IFT_ETHER: - ifmedia_removeall(&sc->sc_media); ether_ifdetach(ifp); + ifmedia_removeall(&sc->sc_media); break; case IFT_INFINIBAND: infiniband_ifdetach(ifp); From nobody Sun Jul 14 16:43:19 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WMWNm0Z0zz5QyPF; Sun, 14 Jul 2024 16:43: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 4WMWNl6Lrmz4MNJ; Sun, 14 Jul 2024 16:43:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720975399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IVV9k/dw/1IZjuupb8P70ZYofN73IdoBn4OqdCJBbNg=; b=R2YhFlKpUiRh0XZez3C/KCdwdKLFSZfq1Wgb/CPIEkJGWA4LCnnKpIeA+SzSgucYc5IkWO sq1ezCFi/a2M7BubltvyGxEem5o0WDW/73mk1wX+nNtTni43SfXOdAke2daZ2U2pwun9up nyLTwBP7Oaf0Ge1HcjZZtpx7xC/LOBq/yEXeMs3K4HBZ90/ZTxZ+K/pKqqXg59jj4M2H2c t/6TGw+8XLLQGXINXdr0eWlHPaUjVoFaWNd6WoH4bDHKnjQk1HSO5iD5G1rhkJjF56O9Li XmB2lS+UiCSwQw846GnVrykKx2a9TDFIzex/oZqtGGAy1vkixPzftUiGABFzfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720975399; a=rsa-sha256; cv=none; b=w8GWtoG82RF8zSZeNXK40qHAKYxc2ri51tHaiv5aVgXHMWLErxcBeoT+5ueqbfEYw6f2Kz JINSRofOk8Jx/ufVOq85wtGwLW+xzqH5alHRG+G5go80axfFCSeo5CkzFHyUoWlXh5h3pd EpHcAgef2CU8GReGtLc/TEEqz1pXNS0c6EL3caMXYbDbts3vURvmSS4E6ipxIQBwOVk1SP CxJnT/vxh4unOBEsgP7Nc2D+o6hQWQVbgC165uJVi9rtWnkLTKBxfCe3lR3vsUB601KKP/ KDI59f/vy9pUGWShaYAsDVmT2/oHQH6ppbR9G4/Vi6S4gC5hgEXVX8RzUp05jg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720975399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IVV9k/dw/1IZjuupb8P70ZYofN73IdoBn4OqdCJBbNg=; b=hVQT0qOFqaarwPTG4TBuG8GH4EKmXkbUmsGisSyhjEIv/lpoOStry8vZQign3rYMixY8c6 DCZYEzETStEwClizoI8/uMx1YxxXRnjX8LIuc7sEECynHX+hYuqw8BQAViafB4w36IIeTS +/loxgpK9wkyBMQOCbWoWwqctL2tp//5dCcnoLh6oY9jDh2sZYiFtYGJ6SiK6QqWi2FEGm 3aIYZYLc/KP8NXAHCuaguz2qwXm+vRHRzrBiM37AyD1IzxFt48vx45pyZNqDVIPkNLCySL bVQN8iYpvCcfdr8D+z86tF/p5/XtIJAB5/hXi8v8KzmXLyJb7RnNyub3CWgXvg== 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 4WMWNl5ymBzHX8; Sun, 14 Jul 2024 16:43: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 46EGhJ6a039609; Sun, 14 Jul 2024 16:43:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46EGhJoq039606; Sun, 14 Jul 2024 16:43:19 GMT (envelope-from git) Date: Sun, 14 Jul 2024 16:43:19 GMT Message-Id: <202407141643.46EGhJoq039606@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: a3e706fd422a - stable/14 - libc/tests: Fix installation without MK_TOOLCHAIN List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: a3e706fd422ae1b213bad5834b703cb48b07b691 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a3e706fd422ae1b213bad5834b703cb48b07b691 commit a3e706fd422ae1b213bad5834b703cb48b07b691 Author: Mark Johnston AuthorDate: 2024-05-28 12:24:43 +0000 Commit: Mark Johnston CommitDate: 2024-07-14 16:16:22 +0000 libc/tests: Fix installation without MK_TOOLCHAIN There is some exotic conditional logic here to avoid building a particular test if a certain UBSAN library isn't present in the toolchain sysroot. This causes build failures for me when doing an "installworld WITHOUT_TOOLCHAIN=", which I do frequently during tests. I believe the problem is that SYSROOT is unset during installworld, so the build sees the host's copy of libclang_rt.ubsan_standalone.a and then tries to install a binary that wasn't built during buildworld. Try to make the check a bit less fragile. Reviewed by: dim MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D45035 (cherry picked from commit 8164d511d6a6053df82911e7d4ebb34fff3d765c) --- lib/libc/tests/ssp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/tests/ssp/Makefile b/lib/libc/tests/ssp/Makefile index c6f850ec1a33..7c6f8d2ea0a7 100644 --- a/lib/libc/tests/ssp/Makefile +++ b/lib/libc/tests/ssp/Makefile @@ -29,7 +29,7 @@ PROGS+= h_memset # now on amd64 when it trips the stack bounds specified in t_ssp.sh . This # probably needs to be fixed as it's currently hardcoded. .if ${COMPILER_TYPE} == "clang" && !defined(_SKIP_BUILD) && \ - (!defined(_RECURSING_PROGS) || ${PROG} == "h_raw") + (!defined(_RECURSING_PROGS) || ${PROG} == "h_raw") && ${MK_TOOLCHAIN} == "yes" .include "${SRCTOP}/lib/libclang_rt/compiler-rt-vars.mk" _libclang_rt_ubsan= ${SYSROOT}${SANITIZER_LIBDIR}/libclang_rt.ubsan_standalone-${CRTARCH}.a .if exists(${_libclang_rt_ubsan}) From nobody Sun Jul 14 16:43:20 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WMWNn3fKxz5Qymd; Sun, 14 Jul 2024 16:43: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 4WMWNn0wv2z4MKs; Sun, 14 Jul 2024 16:43:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720975401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bq82CQOJNP3wInzo4grmY7RFWb45Hbv2qZb5NH2CgCs=; b=vUAhja0abLYsoyWsM269Ov0bvO2N/YMDitF9ZUTfkSqmckdMLC1JrbWhuAqogdIsnw2TON 2f8SD8tgjyDp0RgNv3CmTJy4Zmy+bjGCinJXDaOvGZB5R6Q203mnNZJFVJjF2fhwNA+x8S 1Witd5wzWFX0LiUIdAWllgUA4ZDuV8PEYiUc4BWJrLSV2uyIz7tnx/019ReIHPQK4raG+j ZufPX0ophRIb9G3EUp6XqfEkOFcURzNf0gngTn2AYQ453UE6XjOZhlh0yOt6yThYDTBbmz KgbKf+pJh0sRq+Xrw/Q5fSbJm/V+64yXKy/P1ECw3XgdnSaE0rRFKOzjzW8AEg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720975401; a=rsa-sha256; cv=none; b=LKnfx7O3DIMZ57J4CeYV+0djLxrVGwsllgppXPQJNSdWIV/XyCFoTwt35e3SvlhqbkRtaJ tHiO6ftoxNgcLEdiZkH8+SPniviUIYUd+IlIaDh+in3aF5zIEwu2F18N290DRxxRjT9jGq 02B7D0+yRGcIShO/JK1ip2paVgVFp0gmwHtE51YEHbJOvShga6ar90finB4y4qdcjhnb22 Hg5jt0sfEvHtrpYYlTBmrcUrSDv0I6aVQXdC7tyHXZv8jmizUeCd8f9ZTCx9loQuDGuHgx rPE1pqts0pn+jvrp/LCo65Y8WhW/zIxf4/aw0kciRjY0fdQ0AvZwWzWeilt5EQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720975401; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Bq82CQOJNP3wInzo4grmY7RFWb45Hbv2qZb5NH2CgCs=; b=AnFINjFuJgscDTYVksz9QU5y+hQJLK7rO4SXDvKuaz7aBEWnbL+BpDq3aIuFRLXm/6zdOA /08E0//QhyeT4j535W2JNlwjjUcuif7frvWjy4dWJ6X2QujE9ifHNvL2xrygey9DEGu3t2 4XpCDLqukw5O6f5IRx8AAaJ0khBU08BzAkOWymFPeH9FjDqLiLmUtQFh8xZJibSDsFaa4t 436DU3vvfzhlDczYnkp0wpsnppMx28Rlq6NrrknlQgdahTD5vq9JdBlC95GE4ovckz9+zK rhyvwjZGSxgfqlrOqHRa2pFyz2mmZb72cKTv8cl+v7wYrDMiohbTcbZ28/N0vg== 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 4WMWNm6qDNzHNp; Sun, 14 Jul 2024 16:43: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 46EGhKTD039660; Sun, 14 Jul 2024 16:43:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46EGhKhY039657; Sun, 14 Jul 2024 16:43:20 GMT (envelope-from git) Date: Sun, 14 Jul 2024 16:43:20 GMT Message-Id: <202407141643.46EGhKhY039657@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: 4ea42d9d468b - stable/14 - libc/tests: Further refine the condition for installing h_raw List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 4ea42d9d468b9ce25871190229b3f0cae69ac909 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4ea42d9d468b9ce25871190229b3f0cae69ac909 commit 4ea42d9d468b9ce25871190229b3f0cae69ac909 Author: Mark Johnston AuthorDate: 2024-06-01 15:30:16 +0000 Commit: Mark Johnston CommitDate: 2024-07-14 16:16:32 +0000 libc/tests: Further refine the condition for installing h_raw See 8164d511d6a6 ("libc/tests: Fix installation without MK_TOOLCHAIN") for some background. Here we should really be testing MK_CLANG instead, since that's what gates compilation of libclang_rt. Fixes: 8164d511d6a6 ("libc/tests: Fix installation without MK_TOOLCHAIN") (cherry picked from commit da925fcebf397cc3bfc74b7aa9757efd6231aa00) --- lib/libc/tests/ssp/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/libc/tests/ssp/Makefile b/lib/libc/tests/ssp/Makefile index 7c6f8d2ea0a7..58644d2b5264 100644 --- a/lib/libc/tests/ssp/Makefile +++ b/lib/libc/tests/ssp/Makefile @@ -29,7 +29,8 @@ PROGS+= h_memset # now on amd64 when it trips the stack bounds specified in t_ssp.sh . This # probably needs to be fixed as it's currently hardcoded. .if ${COMPILER_TYPE} == "clang" && !defined(_SKIP_BUILD) && \ - (!defined(_RECURSING_PROGS) || ${PROG} == "h_raw") && ${MK_TOOLCHAIN} == "yes" + (!defined(_RECURSING_PROGS) || ${PROG} == "h_raw") && \ + defined(MK_CLANG) && ${MK_CLANG} == "yes" .include "${SRCTOP}/lib/libclang_rt/compiler-rt-vars.mk" _libclang_rt_ubsan= ${SYSROOT}${SANITIZER_LIBDIR}/libclang_rt.ubsan_standalone-${CRTARCH}.a .if exists(${_libclang_rt_ubsan})