git: 70703aa922b4 - main - netinet: allow per protocol random IP id control, single out IPSEC
The branch main has been updated by glebius: URL: https://cgit.FreeBSD.org/src/commit/?id=70703aa922b41faedfd72211633884bb580ceeac commit 70703aa922b41faedfd72211633884bb580ceeac Author: acazuc AuthorDate: 2025-03-03 13:21:15 + Commit: Gleb Smirnoff CommitDate: 2025-03-04 16:45:32 + netinet: allow per protocol random IP id control, single out IPSEC A globally enabled random IP id generation maybe useful in most IP contexts, but it may be unnecessary in the case of IPsec encapsulated packets because IPsec can be configured to use anti-replay windows. This commit adds a new net.inet.ipsec.random_id sysctl to control whether or not IPsec packets should use random IP id generation. Rest of the protocols/modules are still controlled by the global net.inet.ip.random_id, but can be easily augmented with a knob. Reviewed by:glebius Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D49164 --- share/man/man4/ipsec.4 | 6 +- sys/netinet/ip_carp.c| 4 ++-- sys/netinet/ip_gre.c | 2 +- sys/netinet/ip_id.c | 22 +++--- sys/netinet/ip_mroute.c | 2 +- sys/netinet/ip_output.c | 2 +- sys/netinet/ip_var.h | 4 +++- sys/netinet/raw_ip.c | 2 +- sys/netinet/sctp_output.c| 4 ++-- sys/netipsec/ipsec.c | 4 sys/netipsec/ipsec.h | 3 +++ sys/netipsec/ipsec_output.c | 2 +- sys/netpfil/ipfilter/netinet/fil.c | 2 +- sys/netpfil/ipfilter/netinet/ip_nat.c| 4 ++-- sys/netpfil/ipfw/nat64/nat64_translate.c | 4 ++-- sys/netpfil/pf/if_pfsync.c | 2 +- sys/netpfil/pf/pf.c | 4 ++-- sys/netpfil/pf/pf_norm.c | 2 +- 18 files changed, 44 insertions(+), 31 deletions(-) diff --git a/share/man/man4/ipsec.4 b/share/man/man4/ipsec.4 index 96a10dfb7700..9fd6207c2f14 100644 --- a/share/man/man4/ipsec.4 +++ b/share/man/man4/ipsec.4 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 6, 2017 +.Dd March 4, 2025 .Dt IPSEC 4 .Os .Sh NAME @@ -239,6 +239,7 @@ for tweaking the kernel's IPsec behavior: .It "net.inet.ipsec.debug integer yes" .It "net.inet.ipsec.natt_cksum_policy integer yes" .It "net.inet.ipsec.check_policy_history integer yes" +.It "net.inet.ipsec.random_id integer yes" .It "net.inet6.ipsec6.ecn integer yes" .It "net.inet6.ipsec6.debuginteger yes" .El @@ -298,6 +299,9 @@ have been decrypted and authenticated. If this variable is set to a non-zero value, each packet handled by IPsec is checked against the history of IPsec security associations. The IPsec security protocol, mode, and SA addresses must match. +.It Li ipsec.random_id +Enables randomization of encapsulated IPv4 packets ID. +By default, ID randomization is not enabled. .El .Pp Variables under the diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index 6fde7bd70c6b..c01d1bdd8cff 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -1256,7 +1256,7 @@ carp_send_ad_locked(struct carp_softc *sc) ip->ip_ttl = CARP_DFLTTL; ip->ip_p = IPPROTO_CARP; ip->ip_sum = 0; - ip_fillid(ip); + ip_fillid(ip, V_ip_random_id); ifa = carp_best_ifa(AF_INET, sc->sc_carpdev); if (ifa != NULL) { @@ -1395,7 +1395,7 @@ vrrp_send_ad_locked(struct carp_softc *sc) ip->ip_ttl = CARP_DFLTTL; ip->ip_p = IPPROTO_CARP; ip->ip_sum = 0; - ip_fillid(ip); + ip_fillid(ip, V_ip_random_id); ifa = carp_best_ifa(AF_INET, sc->sc_carpdev); if (ifa != NULL) { diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c index c9356edb0608..01a6ef4cd670 100644 --- a/sys/netinet/ip_gre.c +++ b/sys/netinet/ip_gre.c @@ -534,7 +534,7 @@ in_gre_output(struct mbuf *m, int af, int hlen) #ifdef INET6 case AF_INET6: gi->gi_ip.ip_tos = 0; /* XXX */ - ip_fillid(&gi->gi_ip); + ip_fillid(&gi->gi_ip, V_ip_random_id); break; #endif } diff --git a/sys/netinet/ip_id.c b/sys/netinet/ip_id.c index 12dd6c8bf972..738b7eceb448 100644 --- a/sys/netinet/ip_id.c +++ b/sys/netinet/ip_id.c @@ -97,9 +97,9 @@ * user wants to, we can turn on random ID generation. */ VNET_DEFINE_STATIC(int, ip_rfc6864) = 1; -VNET_DEFINE_STATIC(int, ip_do_randomid) = 0; #defineV_ip_rfc6864VNET(ip_rfc6864) -#defineV_ip_do_randomidVNET(ip_do_randomid) + +VNET_DEFINE(int, ip_random_id) = 0; /* * Random ID state engine. @@ -126,7 +126,7 @@ VNET_D
git: 278a726eec5a - main - ipf: Correct ippool.5 man page
The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=278a726eec5a49284df1f54a586be0fe0ce2e0cf commit 278a726eec5a49284df1f54a586be0fe0ce2e0cf Author: Cy Schubert AuthorDate: 2025-03-04 20:37:20 + Commit: Cy Schubert CommitDate: 2025-03-04 20:39:07 + ipf: Correct ippool.5 man page The file URL must be enclosed in quotes. MFC after: 3 days --- sbin/ipf/ippool/ippool.5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/ipf/ippool/ippool.5 b/sbin/ipf/ippool/ippool.5 index d631de355a0e..b45675bea069 100644 --- a/sbin/ipf/ippool/ippool.5 +++ b/sbin/ipf/ippool/ippool.5 @@ -121,7 +121,7 @@ addresses from. To do this simply use a "file://" URL where you would specify an actual IP address. .PP .nf -pool ipf/tree (name rfc1918;) { file:///etc/ipf/rfc1918; }; +pool ipf/tree (name rfc1918;) { "file:///etc/ipf/rfc1918;" }; .fi .PP The contents of the file might look something like this:
Re: git: 4262dbc57982 - main - wifi manuals: Mlink + document description consistency
On 3/4/25 09:25, Bjoern A. Zeeb wrote: On Tue, 4 Mar 2025, Herbert J. Skuhra wrote: On Thu, 27 Feb 2025 23:22:00 +0100, Alexander Ziaee wrote: The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=4262dbc57982383eb61a8b7806de6dd4b7802da8 commit 4262dbc57982383eb61a8b7806de6dd4b7802da8 Author: Alexander Ziaee AuthorDate: 2025-02-19 15:54:27 + Commit: Alexander Ziaee CommitDate: 2025-02-27 22:20:22 + wifi manuals: Mlink + document description consistency Interfaces all have an mlink to if_$foo. Add these for the missing ones and remove an incorrect one from rtwn_pci. Wireless network drivers are all accessible via `apropos -s4 "wireless network driver", except two which are "wireless network device". I actually prefer the latter, but make them all consistent upon the more common parlance. Tag SPDX on one of the files I touched, while here. MFC after: 3 days Reviewed by:bz, carlavilla, mhorne Approved by:carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D49063 --- share/man/man4/Makefile | 4 +++- share/man/man4/uath.4 | 4 +++- share/man/man4/upgt.4 | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 13afc9b8d399..8e0af19eec3d 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -764,7 +764,9 @@ MLINKS+=ptnet.4 if_ptnet.4 MLINKS+=ral.4 if_ral.4 MLINKS+=re.4 if_re.4 MLINKS+=rl.4 if_rl.4 -MLINKS+=rtwn_pci.4 if_rtwn_pci.4 +MLINKS+=rtw88.4 if_rtw89.4 +MLINKS+=rtw89.4 if_rtw89.4 +MLINKS+=rtwn.4 if_rtwn.4 ^ $ grep if_rtwn.4 ObsoleteFiles.inc OLD_FILES+=usr/share/man/man4/if_rtwn.4.gz In fact that is probably correct but things are confusing. The modules are called if_rtwn_usb.ko and if_rtwn_pci.ko and those should have the man page and links (so contrary to what was done). rtwn.ko is just the common code if I am not mistaken (Adrian should know better). But everyone is just referring to the driver as rtwn and I fear if there is no man page to be found as man rtwn / man if_rtwn people will be confused. I wanted to do the same with rtw88 but was told to keep it all together as one so rtwn is an excemption. That all said, yes, it needs a further cleanup. The manpages should just be rtwn/if_rtwn. The bus attachment doesn't matter. We don't have separate manpages when a storage adapter has been supported on both PCI and ISA in the past, you just had the ahc(4) driver (for example). USB vs PCI is the same. It should just be a single manpage for the driver regardless of the attachment. If the driver has separate modules that can be documented in the one manpage, but the list of supported chipsets, etc. is presumably shared hence the shared driver name and common code. In particular, the thing a user sees in dmesg is 'rtwn0', not 'rtwn_pci0' so the manpage needs to be tied to what a user sees as a device name in dmesg. -- John Baldwin
git: 429b03a00ba7 - main - libc: fix _FORTIFY_SOURCE build on aarch64
The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=429b03a00ba74ae0188cce3f3064cfac023e18c5 commit 429b03a00ba74ae0188cce3f3064cfac023e18c5 Author: Kyle Evans AuthorDate: 2025-03-04 19:53:34 + Commit: Kyle Evans CommitDate: 2025-03-04 19:53:34 + libc: fix _FORTIFY_SOURCE build on aarch64 As with their amd64 counterparts, we need to undef these string funcs that _FORTIFY_SOURCE will have defined macros for to avoid breaking the build. Fixes: bea89d038ac ("lib/libc/aarch64/string: add strlcat SIMD [...]") Fixes: 3dc5429158c ("lib/libc/aarch64/string: add strncat SIMD [...]") --- lib/libc/aarch64/string/strlcat.c | 2 ++ lib/libc/aarch64/string/strncat.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/libc/aarch64/string/strlcat.c b/lib/libc/aarch64/string/strlcat.c index c3c996163ade..fe2e75d091c5 100644 --- a/lib/libc/aarch64/string/strlcat.c +++ b/lib/libc/aarch64/string/strlcat.c @@ -8,6 +8,8 @@ #include +#undef strlcat /* _FORTIFY_SOURCE */ + void *__memchr_aarch64(const void *, int, size_t); size_t __strlcpy(char *restrict, const char *restrict, size_t); diff --git a/lib/libc/aarch64/string/strncat.c b/lib/libc/aarch64/string/strncat.c index 33b278ac5e04..2c63ab50b3c3 100644 --- a/lib/libc/aarch64/string/strncat.c +++ b/lib/libc/aarch64/string/strncat.c @@ -8,6 +8,8 @@ #include +#undef strncat /* _FORTIFY_SOURCE */ + void *__memccpy(void *restrict, const void *restrict, int, size_t); char *
git: 2bef0d54f74d - main - kern: wg: remove overly-restrictive address family check
The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=2bef0d54f74dad6962ef7d1dfa407e95cb4fb4ad commit 2bef0d54f74dad6962ef7d1dfa407e95cb4fb4ad Author: Kyle Evans AuthorDate: 2025-03-04 19:57:34 + Commit: Kyle Evans CommitDate: 2025-03-04 19:57:34 + kern: wg: remove overly-restrictive address family check IPv4 packets can be routed via an IPv6 nexthop, so the handling of the parsed address family is more strict than it needs to be. If we have a valid header that matches a known peer, then we have no reason to decline the packet. Convert it to an assertion that it matches the destination as viewed by the stack below it, instead. `dst` may be the gateway instead of the destination in the case of a nexthop, so the `af` assignment must be switched to use the destination in all cases. Add a test case that approximates a setup like in the PR and demonstrates the issue. PR: 284857 Reviewed by:markj (earlier version), zlei Differential Revision: https://reviews.freebsd.org/D49172 --- sys/dev/wg/if_wg.c | 8 ++--- tests/sys/net/if_wg.sh | 79 ++ 2 files changed, 82 insertions(+), 5 deletions(-) diff --git a/sys/dev/wg/if_wg.c b/sys/dev/wg/if_wg.c index 6683d0505b26..83e5d9e5ceb3 100644 --- a/sys/dev/wg/if_wg.c +++ b/sys/dev/wg/if_wg.c @@ -2335,7 +2335,7 @@ wg_output(if_t ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro if (dst->sa_family == AF_UNSPEC || dst->sa_family == pseudo_AF_HDRCMPLT) memcpy(&af, dst->sa_data, sizeof(af)); else - af = dst->sa_family; + af = RO_GET_FAMILY(ro, dst); if (af == AF_UNSPEC) { xmit_err(ifp, m, NULL, af); return (EAFNOSUPPORT); @@ -2360,10 +2360,8 @@ wg_output(if_t ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro xmit_err(ifp, m, NULL, AF_UNSPEC); return (ret); } - if (parsed_af != af) { - xmit_err(ifp, m, NULL, AF_UNSPEC); - return (EAFNOSUPPORT); - } + + MPASS(parsed_af == af); mtu = (ro != NULL && ro->ro_mtu > 0) ? ro->ro_mtu : if_getmtu(ifp); return (wg_xmit(ifp, m, parsed_af, mtu)); } diff --git a/tests/sys/net/if_wg.sh b/tests/sys/net/if_wg.sh index b43b40f25018..e5df6afface1 100644 --- a/tests/sys/net/if_wg.sh +++ b/tests/sys/net/if_wg.sh @@ -92,6 +92,84 @@ wg_basic_cleanup() vnet_cleanup } +atf_test_case "wg_basic_crossaf" "cleanup" +wg_basic_crossaf_head() +{ + atf_set descr 'Create a wg(4) tunnel and pass IPv4 traffic over an IPv6 nexthop' + atf_set require.user root +} + +wg_basic_crossaf_body() +{ + local epair pri1 pri2 pub1 pub2 wg1 wg2 + local endpoint1 endpoint2 tunnel1 tunnel2 + local testnet testlocal testremote + + kldload -n if_wg || atf_skip "This test requires if_wg and could not load it" + + pri1=$(wg genkey) + pri2=$(wg genkey) + + endpoint1=192.168.2.1 + endpoint2=192.168.2.2 + tunnel1=2001:db8:1::1 + tunnel2=2001:db8:1::2 + + testnet=192.168.3.0/24 + testlocal=192.168.3.1 + testremote=192.168.3.2 + + epair=$(vnet_mkepair) + + vnet_init + + vnet_mkjail wgtest1 ${epair}a + vnet_mkjail wgtest2 ${epair}b + + jexec wgtest1 ifconfig ${epair}a ${endpoint1}/24 up + jexec wgtest2 ifconfig ${epair}b ${endpoint2}/24 up + + wg1=$(jexec wgtest1 ifconfig wg create) + echo "$pri1" | jexec wgtest1 wg set $wg1 listen-port 12345 \ + private-key /dev/stdin + pub1=$(jexec wgtest1 wg show $wg1 public-key) + wg2=$(jexec wgtest2 ifconfig wg create) + echo "$pri2" | jexec wgtest2 wg set $wg2 listen-port 12345 \ + private-key /dev/stdin + pub2=$(jexec wgtest2 wg show $wg2 public-key) + + atf_check -s exit:0 -o ignore \ + jexec wgtest1 wg set $wg1 peer "$pub2" \ + endpoint ${endpoint2}:12345 allowed-ips ${tunnel2}/128,${testnet} + atf_check -s exit:0 \ + jexec wgtest1 ifconfig $wg1 inet6 ${tunnel1}/64 up + + atf_check -s exit:0 -o ignore \ + jexec wgtest2 wg set $wg2 peer "$pub1" \ + endpoint ${endpoint1}:12345 allowed-ips ${tunnel1}/128,${testnet} + atf_check -s exit:0 \ + jexec wgtest2 ifconfig $wg2 inet6 ${tunnel2}/64 up + + atf_check -s exit:0 jexec wgtest1 ifconfig $wg1 inet ${testlocal}/32 + atf_check -s exit:0 jexec wgtest2 ifconfig $wg2 inet ${testremote}/32 + + # Generous timeout since the handshake takes some time. + atf_check -s exit:0 -o ignore jexec wgtest1 ping -c 1 -t 5 "$tunnel2" + + # Setup our IPv6 endpoint and routing + atf_check -s exit:0 -o ignore \ + jexec wgtest1 route add -inet ${testnet} -inet6 "$tun
git: 22b0052fdd95 - main - geli: Fix signature mismatch in mountroot callback
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=22b0052fdd95f2b4b2a4fc004c4d2a1e310e1195 commit 22b0052fdd95f2b4b2a4fc004c4d2a1e310e1195 Author: SHENGYI HONG AuthorDate: 2025-02-23 17:12:57 + Commit: John Baldwin CommitDate: 2025-03-05 01:19:10 + geli: Fix signature mismatch in mountroot callback This is required for kernel CFI. Reviewed by:rrs, jhb, glebius Differential Revision: https://reviews.freebsd.org/D49111 --- sys/geom/eli/g_eli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c index a9f356299a8d..5bd2d465183e 100644 --- a/sys/geom/eli/g_eli.c +++ b/sys/geom/eli/g_eli.c @@ -194,7 +194,7 @@ zero_geli_intake_keys(void) } static void -zero_intake_passcache(void *dummy) +zero_intake_passcache(void *dummy __unused) { zero_boot_passcache(); zero_geli_intake_keys();
git: ca48e43ba9ee - main - usb: Kill left-over cdefs.h includes
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ca48e43ba9ee73a07cdbad8365117793b01273bb commit ca48e43ba9ee73a07cdbad8365117793b01273bb Author: Warner Losh AuthorDate: 2025-03-04 21:42:28 + Commit: Warner Losh CommitDate: 2025-03-04 21:44:22 + usb: Kill left-over cdefs.h includes These includes were for __FBSD_RCSID() macro. They weren't formatted like the rest of the tree so weren't trimmed automatically when that script was run. Trim them now. MFC After: 1 week Sponsored by: Netflix --- sys/dev/usb/controller/dwc3/dwc3.c| 1 - sys/dev/usb/controller/dwc_otg_acpi.c | 1 - sys/dev/usb/controller/ehci_fsl.c | 1 - sys/dev/usb/controller/ehci_imx.c | 1 - sys/dev/usb/controller/ehci_msm.c | 1 - sys/dev/usb/controller/ehci_mv.c | 1 - sys/dev/usb/controller/ehci_pci.c | 1 - sys/dev/usb/controller/generic_ehci.c | 1 - sys/dev/usb/controller/generic_ehci_acpi.c| 1 - sys/dev/usb/controller/generic_ehci_fdt.c | 1 - sys/dev/usb/controller/generic_xhci.c | 1 - sys/dev/usb/controller/generic_xhci_acpi.c| 1 - sys/dev/usb/controller/generic_xhci_fdt.c | 1 - sys/dev/usb/controller/ohci_pci.c | 1 - sys/dev/usb/controller/uhci_pci.c | 1 - sys/dev/usb/controller/xhci_pci.c | 1 - sys/dev/usb/controller/xlnx_dwc3.c| 2 -- sys/dev/usb/input/atp.c | 1 - sys/dev/usb/input/uhid.c | 1 - sys/dev/usb/input/ukbd.c | 1 - sys/dev/usb/input/ums.c | 1 - sys/dev/usb/input/usbhid.c| 1 - sys/dev/usb/input/wmt.c | 1 - sys/dev/usb/input/wsp.c | 1 - sys/dev/usb/misc/udbp.c | 1 - sys/dev/usb/misc/ugold.c | 1 - sys/dev/usb/misc/uled.c | 1 - sys/dev/usb/net/if_aue.c | 1 - sys/dev/usb/net/if_axe.c | 1 - sys/dev/usb/net/if_axge.c | 1 - sys/dev/usb/net/if_cdce.c | 1 - sys/dev/usb/net/if_cdceem.c | 1 - sys/dev/usb/net/if_cue.c | 1 - sys/dev/usb/net/if_ipheth.c | 1 - sys/dev/usb/net/if_kue.c | 1 - sys/dev/usb/net/if_mos.c | 1 - sys/dev/usb/net/if_muge.c | 1 - sys/dev/usb/net/if_rue.c | 1 - sys/dev/usb/net/if_smsc.c | 1 - sys/dev/usb/net/if_udav.c | 1 - sys/dev/usb/net/if_urndis.c | 1 - sys/dev/usb/net/ruephy.c | 1 - sys/dev/usb/serial/ubsa.c | 1 - sys/dev/usb/serial/ubser.c| 1 - sys/dev/usb/serial/uchcom.c | 1 - sys/dev/usb/serial/ucycom.c | 1 - sys/dev/usb/serial/ufoma.c| 1 - sys/dev/usb/serial/uftdi.c| 1 - sys/dev/usb/serial/uipaq.c| 1 - sys/dev/usb/serial/ulpt.c | 1 - sys/dev/usb/serial/umcs.c | 1 - sys/dev/usb/serial/umct.c | 1 - sys/dev/usb/serial/umodem.c | 1 - sys/dev/usb/serial/uplcom.c | 1 - sys/dev/usb/serial/usb_serial.c | 1 - sys/dev/usb/serial/uslcom.c | 1 - sys/dev/usb/serial/uvscom.c | 1 - sys/dev/usb/storage/umass.c | 1 - sys/dev/usb/storage/urio.c| 1 - sys/dev/usb/template/usb_template_multi.c | 1 - sys/dev/usb/template/usb_template_serialnet.c | 1 - sys/dev/usb/wlan/if_rsu.c | 1 - sys/dev/usb/wlan/if_rum.c | 1 - sys/dev/usb/wlan/if_run.c | 1 - sys/dev/usb/wlan/if_uath.c| 1 - sys/dev/usb/wlan/if_ural.c| 1 - sys/dev/usb/wlan/if_urtw.c| 1 - sys/dev/usb/wlan/if_zyd.c | 1 - 68 files changed, 69 deletions(-) diff --git a/sys/dev/usb/controller/dwc3/dwc3.c b/sys/dev/usb/controller/dwc3/dwc3.c index 7ba6165431ac..39b5d3ae4cb1 100644 --- a/sys/dev/usb/controller/dwc3/dwc3.c +++ b/sys/dev/usb/controller/dwc3/dwc3.c @@ -26,7 +26,6 @@ * SUCH DAMAGE. */ -#include #include "opt_platform.h" #include "opt_acpi.h" diff --git a/sys/dev/usb/controller/dwc_otg_acpi.c b/sys/dev/usb/controller/dwc_otg_acpi.c index 5d509911a54a..d8deaa80e94e 100644 --- a/sys/dev/usb/controller/dwc_otg_acpi.c +++ b/sys/dev/usb/controller/dwc_otg_acpi.c @@ -25,7 +25,6 @@ * SUCH DAMAGE. */ -#include #include "opt_acpi.h" #include diff --git a/sys/dev/usb/controller/ehci_fsl.c b/sys/dev/usb/controller/ehci_fsl.c index ed3d4c64f4f8..ce1749775ab2 100644 --- a/sys/dev
git: 057409d0259f - stable/14 - nfscl: Return appropriate reply status for NFSv4.1 callbacks
The branch stable/14 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=057409d0259f9b3f4ae46c1eccc1e9227502c2ec commit 057409d0259f9b3f4ae46c1eccc1e9227502c2ec Author: Rick Macklem AuthorDate: 2025-02-19 23:34:53 + Commit: Rick Macklem CommitDate: 2025-03-05 03:30:00 + nfscl: Return appropriate reply status for NFSv4.1 callbacks Certain NFSv4.1 callbacks are not currently supported/used by the FreeBSD client. Without this patch, NFS4ERR_NOTSUPP is replied for the callbacks. Since NFSv4.1 does not specify all of these callbacks as optional, I think it is preferable to reply NFS_OK or NFS4ERR_REJECT_DELEG instead of NFS4ERR_NOTSUPP. This patch changes the reply status for these unsupported callbacks, which the client has no use for. I am not aware of any NFSv4.1 servers that will perform any of these callbacks against the FreeBSD client at this time. (cherry picked from commit 56c8c19046c46cb9e89c2a3967f8cf2cd0ace428) --- sys/fs/nfsclient/nfs_clstate.c | 19 +++ 1 file changed, 19 insertions(+) diff --git a/sys/fs/nfsclient/nfs_clstate.c b/sys/fs/nfsclient/nfs_clstate.c index b00de78ef591..af8297b68c0e 100644 --- a/sys/fs/nfsclient/nfs_clstate.c +++ b/sys/fs/nfsclient/nfs_clstate.c @@ -3993,6 +3993,25 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) NFSUNLOCKCLSTATE(); } break; + case NFSV4OP_CBNOTIFY: + case NFSV4OP_CBRECALLOBJAVAIL: + case NFSV4OP_CBNOTIFYLOCK: + /* +* These callbacks are not necessarily optional, +* so I think it is better to reply NFS_OK than +* NFSERR_NOTSUPP. +* All provide information for which the FreeBSD client +* does not currently have a use. +* I am not sure if any of these could be generated +* by a NFSv4.1/4.2 server for this client? +*/ + error = 0; + NFSCL_DEBUG(1, "unsupp callback %d\n", op); + break; + case NFSV4OP_CBPUSHDELEG: + error = NFSERR_REJECTDELEG; + NFSCL_DEBUG(1, "unsupp callback %d\n", op); + break; default: if (i == 0 && minorvers != NFSV4_MINORVERSION) error = NFSERR_OPNOTINSESS;
git: 8ee127efb045 - main - vm_lowmem: Fix signature mismatches in vm_lowmem callbacks
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8ee127efb045caf5ad9522f3c63c7e18f9d7279f commit 8ee127efb045caf5ad9522f3c63c7e18f9d7279f Author: SHENGYI HONG AuthorDate: 2025-02-23 17:12:57 + Commit: John Baldwin CommitDate: 2025-03-05 01:18:52 + vm_lowmem: Fix signature mismatches in vm_lowmem callbacks This is required for kernel CFI. Reviewed by:rrs, jhb, glebius Differential Revision: https://reviews.freebsd.org/D49111 --- sys/compat/linuxkpi/common/src/linux_shrinker.c | 2 +- sys/dev/drm2/ttm/ttm_page_alloc.c | 2 +- sys/kern/kern_exec.c| 2 +- sys/netinet/ip_reass.c | 11 --- sys/netinet/sctp_pcb.c | 2 +- sys/netinet/tcp_subr.c | 2 +- sys/netinet6/frag6.c| 2 +- sys/netinet6/ip6_var.h | 2 +- sys/ufs/ufs/ufs_dirhash.c | 4 ++-- 9 files changed, 17 insertions(+), 12 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_shrinker.c b/sys/compat/linuxkpi/common/src/linux_shrinker.c index 18200fa0bc01..e06490b92ed1 100644 --- a/sys/compat/linuxkpi/common/src/linux_shrinker.c +++ b/sys/compat/linuxkpi/common/src/linux_shrinker.c @@ -120,7 +120,7 @@ shrinker_shrink(struct shrinker *s) } static void -linuxkpi_vm_lowmem(void *arg __unused) +linuxkpi_vm_lowmem(void *arg __unused, int flags __unused) { struct shrinker *s; diff --git a/sys/dev/drm2/ttm/ttm_page_alloc.c b/sys/dev/drm2/ttm/ttm_page_alloc.c index 7518ecb4dfd1..724ba0bfb4d8 100644 --- a/sys/dev/drm2/ttm/ttm_page_alloc.c +++ b/sys/dev/drm2/ttm/ttm_page_alloc.c @@ -441,7 +441,7 @@ static int ttm_pool_get_num_unused_pages(void) /** * Callback for mm to request pool to reduce number of page held. */ -static int ttm_pool_mm_shrink(void *arg) +static int ttm_pool_mm_shrink(void *arg, int flags __unused) { static unsigned int start_pool = 0; unsigned i; diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 51bbdeaaa55e..f6d0201f9b37 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -1475,7 +1475,7 @@ exec_free_args_kva(void *cookie) } static void -exec_args_kva_lowmem(void *arg __unused) +exec_args_kva_lowmem(void *arg __unused, int flags __unused) { SLIST_HEAD(, exec_args_kva) head; struct exec_args_kva *argkva; diff --git a/sys/netinet/ip_reass.c b/sys/netinet/ip_reass.c index a95780aa2f27..177069f5e010 100644 --- a/sys/netinet/ip_reass.c +++ b/sys/netinet/ip_reass.c @@ -670,6 +670,11 @@ ipreass_drain(void) VNET_LIST_RUNLOCK(); } +static void +ipreass_drain_lowmem(void *arg __unused, int flags __unused) +{ + ipreass_drain(); +} /* * Initialize IP reassembly structures. @@ -711,10 +716,10 @@ ipreass_init(void) maxfrags = IP_MAXFRAGS; EVENTHANDLER_REGISTER(nmbclusters_change, ipreass_zone_change, NULL, EVENTHANDLER_PRI_ANY); - EVENTHANDLER_REGISTER(vm_lowmem, ipreass_drain, NULL, + EVENTHANDLER_REGISTER(vm_lowmem, ipreass_drain_lowmem, NULL, + LOWMEM_PRI_DEFAULT); + EVENTHANDLER_REGISTER(mbuf_lowmem, ipreass_drain_lowmem, NULL, LOWMEM_PRI_DEFAULT); - EVENTHANDLER_REGISTER(mbuf_lowmem, ipreass_drain, NULL, - LOWMEM_PRI_DEFAULT); } /* diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 185530e3bc5e..55b452743f86 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -6823,7 +6823,7 @@ sctp_drain_mbufs(struct sctp_tcb *stcb) } static void -sctp_drain(void) +sctp_drain(void *arg __unused, int flags __unused) { struct epoch_tracker et; diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 4baeb6f8f2d2..03efc759092d 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -1384,7 +1384,7 @@ deregister_tcp_functions(struct tcp_function_block *blk, bool quiesce, } static void -tcp_drain(void) +tcp_drain(void *ctx __unused, int flags __unused) { struct epoch_tracker et; VNET_ITERATOR_DECL(vnet_iter); diff --git a/sys/netinet6/frag6.c b/sys/netinet6/frag6.c index e976298bf984..f6bb6e94ed08 100644 --- a/sys/netinet6/frag6.c +++ b/sys/netinet6/frag6.c @@ -1078,7 +1078,7 @@ frag6_drain_one(void) } void -frag6_drain(void) +frag6_drain(void *arg __unused, int flags __unused) { VNET_ITERATOR_DECL(vnet_iter); diff --git a/sys/netinet6/ip6_var.h b/sys/netinet6/ip6_var.h index 1aa170f6ed2b..12b00d4f9934 100644 --- a/sys/netinet6/ip6_var.h +++ b/sys/netinet6/ip6_var.h @@ -414,7 +414,7 @@ int route6_input(struct mbuf **, int *, int); void frag6_init(void); void frag6_destroy(void); intfrag6_input(struct mbuf **, int *, int); -void frag6_drain(void); +void frag6_drain(void *, int); void rip6_init(void); intrip6_ctloutput(struct socket *, struct sockop
git: f60149306ccf - stable/14 - release: build OCI images with shell scripts
The branch stable/14 has been updated by dfr: URL: https://cgit.FreeBSD.org/src/commit/?id=f60149306ccf784ddaa517132a8be47bb523984d commit f60149306ccf784ddaa517132a8be47bb523984d Author: Doug Rabson AuthorDate: 2024-12-12 16:42:00 + Commit: Doug Rabson CommitDate: 2025-03-04 09:46:03 + release: build OCI images with shell scripts This avoids the need for buildah and skopeo for building releases. Reviewed by:cpersiva MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D48574 (cherry picked from commit e8a5b9fd73f4f437a03c85e7644daa55652e224b) --- release/Makefile.oci | 6 +- release/release.sh | 38 - release/scripts/make-oci-image.sh| 105 +++ release/tools/oci-image-dynamic.conf | 2 +- release/tools/oci-image-minimal.conf | 3 +- release/tools/oci-image-static.conf | 3 +- 6 files changed, 99 insertions(+), 58 deletions(-) diff --git a/release/Makefile.oci b/release/Makefile.oci index da35156c5a95..e4b5df580055 100644 --- a/release/Makefile.oci +++ b/release/Makefile.oci @@ -26,11 +26,7 @@ OCI_TARGETS+= container-image-${_IMG}.txz container-image-${_IMG}.txz: ${OCI_DEPS_${_IMG}} # Adjust PATH so that we run pwd_mkdb from the bootstrap tools env PATH=${OBJTOP}/tmp/legacy/bin:${PATH:Q} \ - sh ${.CURDIR}/scripts/make-oci-image.sh ${.CURDIR} ${REVISION} ${BRANCH} ${TARGET_ARCH} ${_IMG} - skopeo copy \ - containers-storage:localhost/freebsd${REVISION:R}-${_IMG}:latest \ - oci-archive:${.OBJDIR}/container-image-${_IMG}.tar:freebsd${REVISION:R}-${_IMG}:${REVISION}-${BRANCH}-${TARGET_ARCH} - ${XZ_CMD} < ${.OBJDIR}/container-image-${_IMG}.tar > ${.OBJDIR}/container-image-${_IMG}.txz + sh ${.CURDIR}/scripts/make-oci-image.sh ${.CURDIR} ${REVISION} ${BRANCH} ${TARGET_ARCH} ${_IMG} container-image-${_IMG}.txz .endfor oci-release: ${OCI_TARGETS} diff --git a/release/release.sh b/release/release.sh index d6752e016994..5a6de297f7a1 100755 --- a/release/release.sh +++ b/release/release.sh @@ -292,44 +292,6 @@ extra_chroot_setup() { fi fi - if [ ! -z "${WITH_OCIIMAGES}" ]; then - # Install buildah and skopeo from ports if the ports tree is available; - # otherwise install the pkg. - if [ -d ${CHROOTDIR}/usr/ports ]; then - # Trick the ports 'run-autotools-fixup' target to do the right - # thing. - _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) - REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) - BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) - UNAME_r=${REVISION}-${BRANCH} - GITUNSETOPTS="CONTRIB CURL CVS GITWEB GUI HTMLDOCS" - GITUNSETOPTS="${GITUNSETOPTS} ICONV NLS P4 PERL" - GITUNSETOPTS="${GITUNSETOPTS} SEND_EMAIL SUBTREE SVN" - GITUNSETOPTS="${GITUNSETOPTS} PCRE PCRE2" - PBUILD_FLAGS="OSVERSION=${_OSVERSION} BATCH=yes" - PBUILD_FLAGS="${PBUILD_FLAGS} UNAME_r=${UNAME_r}" - PBUILD_FLAGS="${PBUILD_FLAGS} OSREL=${REVISION}" - PBUILD_FLAGS="${PBUILD_FLAGS} WRKDIRPREFIX=/tmp/ports" - PBUILD_FLAGS="${PBUILD_FLAGS} DISTDIR=/tmp/distfiles" - for _PORT in sysutils/buildah sysutils/skopeo; do - eval chroot ${CHROOTDIR} env ${PBUILD_FLAGS} make -C \ -/usr/ports/${_PORT} \ -FORCE_PKG_REGISTER=1 deinstall install clean distclean - done - else - eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ - pkg install -y sysutils/buildah sysutils/skopeo - eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ - pkg clean -y - fi - # Use the vfs storage driver so that this works whether or not - # the build directory is on ZFS. The images are small so the - # performance difference is negligible. - eval chroot ${CHROOTDIR} sed -I .bak -e '/^driver/s/zfs/vfs/' /usr/local/etc/containers/storage.conf - # Remove any stray images from previous builds - eval chroot ${CHROOTDIR} buildah rmi -af - fi - if [ ! -z "${EMBEDDEDPORTS}" ]; then _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) diff --git a/release/scripts/make-oci-image.sh b/release/scripts/make-oci-
git: 49a4838a0d94 - main - vmm: Emulate testb imm8,r/m8
The branch main has been updated by jlduran: URL: https://cgit.FreeBSD.org/src/commit/?id=49a4838a0d94e145a826abf02aa03ff444e614e3 commit 49a4838a0d94e145a826abf02aa03ff444e614e3 Author: Jose Luis Duran AuthorDate: 2025-03-04 13:51:47 + Commit: Jose Luis Duran CommitDate: 2025-03-04 13:51:47 + vmm: Emulate testb imm8,r/m8 Add support for "testb imm8,r/m8" emulation. PR: 261940 PR: 282852 Reviewed by:markj, emaste Approved by:emaste (mentor) Obtained from: Illumos (https://www.illumos.org/issues/14483) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49208 --- sys/amd64/vmm/vmm_instruction_emul.c | 12 1 file changed, 12 insertions(+) diff --git a/sys/amd64/vmm/vmm_instruction_emul.c b/sys/amd64/vmm/vmm_instruction_emul.c index 51769faf5893..c53e32889000 100644 --- a/sys/amd64/vmm/vmm_instruction_emul.c +++ b/sys/amd64/vmm/vmm_instruction_emul.c @@ -236,6 +236,12 @@ static const struct vie_op one_byte_opcodes[256] = { .op_byte = 0x8F, .op_type = VIE_OP_TYPE_POP, }, + [0xF6] = { + /* XXX Group 3 extended opcode - not just TEST */ + .op_byte = 0xF6, + .op_type = VIE_OP_TYPE_TEST, + .op_flags = VIE_OP_F_IMM8, + }, [0xF7] = { /* XXX Group 3 extended opcode - not just TEST */ .op_byte = 0xF7, @@ -1284,6 +1290,12 @@ emulate_test(struct vcpu *vcpu, uint64_t gpa, struct vie *vie, error = EINVAL; switch (vie->op.op_byte) { + case 0xF6: + /* +* F6 /0test r/m8, imm8 +*/ + size = 1; /* override for byte operation */ + /* FALLTHROUGH */ case 0xF7: /* * F7 /0test r/m16, imm16
git: d1a37f280be4 - main - LinuxKPI: 802.11: remove ieee80211_node_get_txrate_dot11rate()
The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d1a37f280be46a707b42c3eca5f8b6a38ecf726b commit d1a37f280be46a707b42c3eca5f8b6a38ecf726b Author: Bjoern A. Zeeb AuthorDate: 2025-03-04 15:20:06 + Commit: Bjoern A. Zeeb CommitDate: 2025-03-04 15:24:05 + LinuxKPI: 802.11: remove ieee80211_node_get_txrate_dot11rate() net80211 ieee80211_node_get_txrate_dot11rate() does not yet support VHT and that means we get a lot of log lines when doing VHT for a debugging statement even if it's not active. Remove the calls to ieee80211_node_get_txrate_dot11rate() as with hw/fw based rate control (modern iwlwifi) they are pointless anyway as they are currently. Sponsored by: The FreeBSD Foundation X-MFC: only if net80211 gets MFCed Reported by:J.R. Oldroyd (jr opal.com) Fixes: 706745001093 (I should have noticed during review) --- sys/compat/linuxkpi/common/src/linux_80211.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 14c7bab163b6..33b33651b6ad 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -6921,12 +6921,6 @@ linuxkpi_ieee80211_tx_status_ext(struct ieee80211_hw *hw, } if (ni != NULL) { -#ifdef LINUXKPI_DEBUG_80211 - int old_rate; - - old_rate = - ieee80211_node_get_txrate_dot11rate(ni->ni_vap->iv_bss); -#endif txs.pktlen = skb->len; txs.flags |= IEEE80211_RATECTL_STATUS_PKTLEN; if (info->status.rates[0].count > 1) { @@ -6943,16 +6937,13 @@ linuxkpi_ieee80211_tx_status_ext(struct ieee80211_hw *hw, txs.flags |= IEEE80211_RATECTL_STATUS_RSSI; } - IMPROVE("only update of rate matches but that requires us to get a proper rate"); + IMPROVE("only update rate if needed but that requires us to get a proper rate from mo_sta_statistics"); ieee80211_ratectl_tx_complete(ni, &txs); ieee80211_ratectl_rate(ni->ni_vap->iv_bss, NULL, 0); #ifdef LINUXKPI_DEBUG_80211 if (linuxkpi_debug_80211 & D80211_TRACE_TX) { - printf("TX-RATE: %s: old %d new %d " - "long_retries %d\n", __func__, - old_rate, - ieee80211_node_get_txrate_dot11rate(ni->ni_vap->iv_bss), + printf("TX-RATE: %s: long_retries %d\n", __func__, txs.long_retries); } #endif
git: 3816452ecac6 - main - Revert "riscv: enable allwinner RTC"
The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=3816452ecac64dcd2708c67fe0a1193d5e06feac commit 3816452ecac64dcd2708c67fe0a1193d5e06feac Author: Mitchell Horne AuthorDate: 2025-03-04 15:20:55 + Commit: Mitchell Horne CommitDate: 2025-03-04 15:25:56 + Revert "riscv: enable allwinner RTC" It caused a regression on A10/A20 platforms. Revert until the proper fix can be determined. This reverts commit 9ddd516b886218af809dbf40eeda1ed388e2879c. PR: 285054 Reported by:mmel --- sys/arm/allwinner/aw_rtc.c | 24 sys/riscv/allwinner/files.allwinner | 1 - sys/riscv/conf/std.allwinner| 1 - 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/sys/arm/allwinner/aw_rtc.c b/sys/arm/allwinner/aw_rtc.c index a13c0e7d926e..9938601f17ce 100644 --- a/sys/arm/allwinner/aw_rtc.c +++ b/sys/arm/allwinner/aw_rtc.c @@ -134,7 +134,6 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun7i-a20-rtc", (uintptr_t) &a20_conf }, { "allwinner,sun6i-a31-rtc", (uintptr_t) &a31_conf }, { "allwinner,sun8i-h3-rtc", (uintptr_t) &h3_conf }, - { "allwinner,sun20i-d1-rtc", (uintptr_t) &h3_conf }, { "allwinner,sun50i-h5-rtc", (uintptr_t) &h3_conf }, { "allwinner,sun50i-h6-rtc", (uintptr_t) &h3_conf }, { NULL, 0 } @@ -148,13 +147,11 @@ struct aw_rtc_softc { static struct clk_fixed_def aw_rtc_osc32k = { .clkdef.id = 0, - .clkdef.name = "osc32k", .freq = 32768, }; static struct clk_fixed_def aw_rtc_iosc = { .clkdef.id = 2, - .clkdef.name = "iosc", }; static voidaw_rtc_install_clocks(struct aw_rtc_softc *sc, device_t dev); @@ -252,29 +249,24 @@ aw_rtc_install_clocks(struct aw_rtc_softc *sc, device_t dev) { phandle_t node; int nclocks; - /* -* If the device tree gives us specific output names for the clocks, -* use them. -*/ node = ofw_bus_get_node(dev); nclocks = ofw_bus_string_list_to_array(node, "clock-output-names", &clknames); - if (nclocks > 0) { - if (nclocks != 3) { - device_printf(dev, - "Found %d clocks instead of 3, aborting\n", - nclocks); - return; - } + /* No clocks to export */ + if (nclocks <= 0) + return; - aw_rtc_osc32k.clkdef.name = clknames[0]; - aw_rtc_iosc.clkdef.name = clknames[2]; + if (nclocks != 3) { + device_printf(dev, "Having only %d clocks instead of 3, aborting\n", nclocks); + return; } clkdom = clkdom_create(dev); + aw_rtc_osc32k.clkdef.name = clknames[0]; if (clknode_fixed_register(clkdom, &aw_rtc_osc32k) != 0) device_printf(dev, "Cannot register osc32k clock\n"); + aw_rtc_iosc.clkdef.name = clknames[2]; aw_rtc_iosc.freq = sc->conf->iosc_freq; if (clknode_fixed_register(clkdom, &aw_rtc_iosc) != 0) device_printf(dev, "Cannot register iosc clock\n"); diff --git a/sys/riscv/allwinner/files.allwinner b/sys/riscv/allwinner/files.allwinner index 73fa9660e2d2..423a89c10c78 100644 --- a/sys/riscv/allwinner/files.allwinner +++ b/sys/riscv/allwinner/files.allwinner @@ -1,6 +1,5 @@ arm/allwinner/aw_gpio.coptional gpio aw_gpio fdt -arm/allwinner/aw_rtc.c optional aw_rtc fdt arm/allwinner/aw_syscon.c optional syscon arm/allwinner/aw_sid.c optional aw_sid nvmem arm/allwinner/aw_timer.c optional aw_timer fdt diff --git a/sys/riscv/conf/std.allwinner b/sys/riscv/conf/std.allwinner index 2b1e0d4e09dc..1bf6b027a4cb 100644 --- a/sys/riscv/conf/std.allwinner +++ b/sys/riscv/conf/std.allwinner @@ -7,7 +7,6 @@ options SOC_ALLWINNER_D1 device aw_ccu # Allwinner clock controller device aw_gpio # Allwinner GPIO controller -device aw_rtc # Allwinner Real-time Clock device aw_sid # Allwinner Secure ID EFUSE device aw_timer# Allwinner Timer device aw_usbphy # Allwinner USB PHY
git: 8233ccc3bcee - stable/14 - sound: Do not fail from vchan_destroy() if children list is empty
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8233ccc3bcee6dbe6179eca605d8a354a861cf7e commit 8233ccc3bcee6dbe6179eca605d8a354a861cf7e Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:11 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:05 + sound: Do not fail from vchan_destroy() if children list is empty vchan_destroy() should be able to call chn_kill() regardless of whether the channel has been added to the children list yet or not. Also remove the CHN_F_BUSY check. There is no reason we shouldn't execute the code below if the parent is not busy. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by:dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48185 (cherry picked from commit 405b1e50926d4162fb9503644073c0184a8b37d9) --- sys/dev/sound/pcm/vchan.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 4165d0712b94..ea8a50b316fe 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -838,15 +838,8 @@ vchan_destroy(struct pcm_channel *c) CHN_UNLOCK(c); - if (!(parent->flags & CHN_F_BUSY)) - return (EBUSY); - - if (CHN_EMPTY(parent, children)) - return (EINVAL); - /* remove us from our parent's children list */ CHN_REMOVE(parent, c, children); - if (CHN_EMPTY(parent, children)) { parent->flags &= ~(CHN_F_BUSY | CHN_F_HAS_VCHAN); chn_reset(parent, parent->format, parent->speed);
git: 5fc710ae2d78 - stable/14 - sound: Call vchan_destroy() on vchan_create() failure
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=5fc710ae2d78d0f8625513b04d131011bde1f7c8 commit 5fc710ae2d78d0f8625513b04d131011bde1f7c8 Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:19 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:05 + sound: Call vchan_destroy() on vchan_create() failure Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by:dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48183 (cherry picked from commit 2546ab1b3632a9ebfe88d9d5dc55700e653bff5d) --- sys/dev/sound/pcm/vchan.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index ea8a50b316fe..4ee7e01066d3 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -811,11 +811,8 @@ vchan_create(struct pcm_channel *parent) return (ret); fail: - CHN_REMOVE(parent, ch, children); - parent->flags &= ~CHN_F_HAS_VCHAN; - CHN_UNLOCK(parent); - chn_kill(ch); - CHN_LOCK(parent); + CHN_LOCK(ch); + vchan_destroy(ch); return (ret); }
git: a86dfa429690 - stable/14 - sound: Do not return an error from chn_notify() if the children list is empty
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a86dfa4296907f8a6170585b2bfd208db64a884d commit a86dfa4296907f8a6170585b2bfd208db64a884d Author: Christos Margiolis AuthorDate: 2025-02-25 11:42:59 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:05 + sound: Do not return an error from chn_notify() if the children list is empty An empty children list does not mean that there is an error. Reported by:Florian Walpen Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by:dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48156 (cherry picked from commit 164651f16c860049a4ad2098206def8ca7a39b4a) --- sys/dev/sound/pcm/channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 4b0ca128391b..4d275d00762a 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -2360,7 +2360,7 @@ chn_notify(struct pcm_channel *c, u_int32_t flags) CHN_LOCKASSERT(c); if (CHN_EMPTY(c, children)) - return (ENODEV); + return (0); err = 0;
git: 960ee8094913 - stable/14 - sound: Allocate vchans on-demand
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=960ee8094913f1f96c6a432d84ae1f153b1a562c commit 960ee8094913f1f96c6a432d84ae1f153b1a562c Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:39 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:05 + sound: Allocate vchans on-demand Refactor pcm_chnalloc() and merge with parts of vchan_setnew() (now removed) and dsp_open()’s channel creation into a new dsp_chn_alloc() function. The function is responsible for either using a free HW channel (if vchans are disabled), or allocating a new vchan. Clean up allocated vchans associated with a given dsp_cdevpriv on dsp_close() instead of leaving them unused. hw.snd.vchans_enable (previously hw.snd.maxautovchans) and dev.pcm.X.{play|rec}.vchans now work as tunables to only enable/disable vchans, as opposed to setting their number and/or (de-)allocating vchans. Since these sysctls do not trigger any (de-)allocations anymore, their effect is instantaneous, whereas before we could have frozen the machine (when trying to allocate new vchans) when setting dev.pcm.X.{play|rec}.vchans to a very large value. Create a new "primary" channel sublist so that we do not waste time looping through all channels in dsp_chn_alloc(), since we are only looking for a parent channel to either use, or add a new vchan to. This guarantees a steady traversal speed, as the parent channels are most likely going to be just a handful (2). What was currently in place was a loop through the whole channel list, which meant that the traversal would take longer the more channels were added to that list. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by:dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D47917 (cherry picked from commit 02d4eeabfd73e6a827f5d42601e99aad92060b04) --- share/man/man4/pcm.4| 23 ++-- sys/dev/sound/pcm/channel.c | 14 ++- sys/dev/sound/pcm/channel.h | 3 + sys/dev/sound/pcm/dsp.c | 233 sys/dev/sound/pcm/sound.c | 70 ++- sys/dev/sound/pcm/sound.h | 13 +- sys/dev/sound/pcm/vchan.c | 285 +--- sys/dev/sound/pcm/vchan.h | 7 +- 8 files changed, 254 insertions(+), 394 deletions(-) diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4 index e406bd2c8343..ecaf732aad25 100644 --- a/share/man/man4/pcm.4 +++ b/share/man/man4/pcm.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd March 24, 2024 +.Dd December 4, 2024 .Dt SOUND 4 .Os .Sh NAME @@ -358,14 +358,12 @@ A value of 0 will use a low and aggressive latency profile which can result in possible underruns if the application cannot keep up with a rapid irq rate, especially during high workload. The default value is 1, which is considered a moderate/safe latency profile. -.It Va hw.snd.maxautovchans -Global VCHAN setting that only affects devices with at least one playback or -recording channel available. -The sound system will dynamically create up to this many VCHANs. -Set to -.Dq 0 -if no VCHANs are desired. -Maximum value is 256. +.It Va hw.snd.vchans_enable +Global VCHAN setting to enable (1) or disable (0) VCHANs. +This setting can be overridden for an individual device by using the +.Va dev.pcm.%d.[play|rec].vchans +tunables. +Default is enabled. .It Va hw.snd.report_soft_formats Controls the internal format conversion if it is available transparently to the application software. @@ -432,11 +430,8 @@ The recommended way to use bitperfect mode is to disable VCHANs and enable this sysctl. Default is disabled. .It Va dev.pcm.%d.[play|rec].vchans -The current number of VCHANs allocated per device. -This can be set to preallocate a certain number of VCHANs. -Setting this value to -.Dq 0 -will disable VCHANs for this device. +Enable (1) or disable (0) VCHANs. +Default is enabled. .It Va dev.pcm.%d.[play|rec].vchanformat Format for VCHAN mixing. All playback paths will be converted to this format before the mixing diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 58315610312e..17c11dc33b7a 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1172,7 +1172,7 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, struct feeder_class *fc; struct snd_dbuf *b, *bs; char buf[CHN_NAMELEN]; - int i, direction; + int err, i, direction; PCM_BUSYASSERT(d); PCM_LOCKASSERT(d); @@ -1279,8 +1279,18 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, bs->shadbuf = malloc(bs->sl, M_DEVBUF, M_WAITOK); } + if ((c->flags & CHN_F_VIRTUAL) == 0) { +
git: 58e17fd3c455 - stable/14 - sound: Cache vchanmode
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=58e17fd3c4553f2c0db447cda237363f3017d27a commit 58e17fd3c4553f2c0db447cda237363f3017d27a Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:46 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 + sound: Cache vchanmode We already cache vchanrate and vchanformat. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by:dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48335 (cherry picked from commit b50f53cf872eca6b9a174a51fa183e8c2f88d97c) --- sys/dev/sound/pcm/sound.h | 4 ++-- sys/dev/sound/pcm/vchan.c | 11 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index fddf5bfef1a8..1cb97325572b 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -238,8 +238,8 @@ struct snddev_info { struct mtx *lock; struct cdev *mixer_dev; struct cdev *dsp_dev; - uint32_t pvchanrate, pvchanformat; - uint32_t rvchanrate, rvchanformat; + uint32_t pvchanrate, pvchanformat, pvchanmode; + uint32_t rvchanrate, rvchanformat, rvchanmode; int32_t eqpreamp; struct sysctl_ctx_list play_sysctl_ctx, rec_sysctl_ctx; struct sysctl_oid *play_sysctl_tree, *rec_sysctl_tree; diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 297120199fe7..379d647cbcf8 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -356,7 +356,7 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) struct snddev_info *d; struct pcm_channel *c; uint32_t dflags; - int direction, ret; + int *vchanmode, direction, ret; char dtype[16]; d = devclass_get_softc(pcm_devclass, VCHAN_SYSCTL_UNIT(oidp->oid_arg1)); @@ -373,6 +373,7 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) return (ENODEV); } direction = PCMDIR_PLAY; + vchanmode = &d->pvchanmode; break; case VCHAN_REC: if ((d->flags & SD_F_RVCHANS) == 0) { @@ -380,6 +381,7 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) return (ENODEV); } direction = PCMDIR_REC; + vchanmode = &d->rvchanmode; break; default: PCM_UNLOCK(d); @@ -402,14 +404,12 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) KASSERT(direction == c->direction, ("%s(): invalid direction %d/%d", __func__, direction, c->direction)); - CHN_LOCK(c); - if (c->flags & CHN_F_VCHAN_PASSTHROUGH) + if (*vchanmode & CHN_F_VCHAN_PASSTHROUGH) strlcpy(dtype, "passthrough", sizeof(dtype)); - else if (c->flags & CHN_F_VCHAN_ADAPTIVE) + else if (*vchanmode & CHN_F_VCHAN_ADAPTIVE) strlcpy(dtype, "adaptive", sizeof(dtype)); else strlcpy(dtype, "fixed", sizeof(dtype)); - CHN_UNLOCK(c); ret = sysctl_handle_string(oidp, dtype, sizeof(dtype), req); if (ret == 0 && req->newptr != NULL) { @@ -436,6 +436,7 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) c->flags &= ~CHN_F_VCHAN_DYNAMIC; c->flags |= dflags; CHN_UNLOCK(c); + *vchanmode = dflags; } PCM_RELEASE_QUICK(d);
git: 905ae2bc6a27 - stable/14 - sound: Handle multiple primary channel cases in vchan sysctls
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=905ae2bc6a27b4e94643a337908dc4a59de2283a commit 905ae2bc6a27b4e94643a337908dc4a59de2283a Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:52 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 + sound: Handle multiple primary channel cases in vchan sysctls vchan_getparentchannel() is used by various vchan sysctl functions to fetch the first primary channel. However, this assumes that all devices have only one primary channel per direction. If a device does not meet this assumption, then the sysctl functions will be applying the configurations on the first primary channel only. Since we now have the "primary" channel sublist, we can retire vchan_getparentchannel() and iterate through the "primary" list in each sysctl function and apply the settings to all primary channels. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by:dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48336 (cherry picked from commit 1cbafcd13796934a7896064cdb23fd4e37d58821) --- sys/dev/sound/pcm/vchan.c | 227 -- 1 file changed, 80 insertions(+), 147 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 379d647cbcf8..45f0a8b00bd2 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -253,48 +253,6 @@ static kobj_method_t vchan_methods[] = { }; CHANNEL_DECLARE(vchan); -static void -vchan_getparentchannel(struct snddev_info *d, -struct pcm_channel **wrch, struct pcm_channel **rdch) -{ - struct pcm_channel **ch, *wch, *rch, *c; - - KASSERT(d != NULL, ("%s(): NULL snddev_info", __func__)); - - PCM_BUSYASSERT(d); - PCM_UNLOCKASSERT(d); - - wch = NULL; - rch = NULL; - - CHN_FOREACH(c, d, channels.pcm) { - CHN_LOCK(c); - ch = (c->direction == PCMDIR_PLAY) ? &wch : &rch; - if (c->flags & CHN_F_VIRTUAL) { - /* Sanity check */ - if (*ch != NULL && *ch != c->parentchannel) { - CHN_UNLOCK(c); - *ch = NULL; - break; - } - } else { - /* No way!! */ - if (*ch != NULL) { - CHN_UNLOCK(c); - *ch = NULL; - break; - } - *ch = c; - } - CHN_UNLOCK(c); - } - - if (wrch != NULL) - *wrch = wch; - if (rdch != NULL) - *rdch = rch; -} - static int sysctl_dev_pcm_vchans(SYSCTL_HANDLER_ARGS) { @@ -391,19 +349,6 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) PCM_ACQUIRE(d); PCM_UNLOCK(d); - if (direction == PCMDIR_PLAY) - vchan_getparentchannel(d, &c, NULL); - else - vchan_getparentchannel(d, NULL, &c); - - if (c == NULL) { - PCM_RELEASE_QUICK(d); - return (EINVAL); - } - - KASSERT(direction == c->direction, ("%s(): invalid direction %d/%d", - __func__, direction, c->direction)); - if (*vchanmode & CHN_F_VCHAN_PASSTHROUGH) strlcpy(dtype, "passthrough", sizeof(dtype)); else if (*vchanmode & CHN_F_VCHAN_ADAPTIVE) @@ -412,26 +357,29 @@ sysctl_dev_pcm_vchanmode(SYSCTL_HANDLER_ARGS) strlcpy(dtype, "fixed", sizeof(dtype)); ret = sysctl_handle_string(oidp, dtype, sizeof(dtype), req); - if (ret == 0 && req->newptr != NULL) { - if (strcasecmp(dtype, "passthrough") == 0 || - strcmp(dtype, "1") == 0) - dflags = CHN_F_VCHAN_PASSTHROUGH; - else if (strcasecmp(dtype, "adaptive") == 0 || - strcmp(dtype, "2") == 0) - dflags = CHN_F_VCHAN_ADAPTIVE; - else if (strcasecmp(dtype, "fixed") == 0 || - strcmp(dtype, "0") == 0) - dflags = 0; - else { - PCM_RELEASE_QUICK(d); - return (EINVAL); - } + if (ret != 0 || req->newptr == NULL) { + PCM_RELEASE_QUICK(d); + return (ret); + } + + if (strcasecmp(dtype, "passthrough") == 0 || strcmp(dtype, "1") == 0) + dflags = CHN_F_VCHAN_PASSTHROUGH; + else if (strcasecmp(dtype, "adaptive") == 0 || strcmp(dtype, "2") == 0) + dflags = CHN_F_VCHAN_ADAPTIVE; + else if (strcasecmp(dtype, "fixed") == 0 || strcmp(dtype, "0") == 0) + dflags = 0; + else { + PCM_RELEASE_QUICK(d); +
git: 5dc0c867c8ca - stable/14 - sound: Remove SNDBUF_LOCKASSERT()
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=5dc0c867c8cae68cf867c82432ce013d83214cc6 commit 5dc0c867c8cae68cf867c82432ce013d83214cc6 Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:59 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 + sound: Remove SNDBUF_LOCKASSERT() It's a no-op. There is no lock associated with the buffer. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by:dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D48008 (cherry picked from commit 6524d2a5affd02623e6909fff0ca03ba21882a0c) --- sys/dev/sound/pcm/buffer.c | 22 -- sys/dev/sound/pcm/buffer.h | 2 -- 2 files changed, 24 deletions(-) diff --git a/sys/dev/sound/pcm/buffer.c b/sys/dev/sound/pcm/buffer.c index 8bf3631afb7a..de535ec2dcba 100644 --- a/sys/dev/sound/pcm/buffer.c +++ b/sys/dev/sound/pcm/buffer.c @@ -461,39 +461,30 @@ sndbuf_getsel(struct snd_dbuf *b) unsigned int sndbuf_getxrun(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); - return b->xrun; } void sndbuf_setxrun(struct snd_dbuf *b, unsigned int xrun) { - SNDBUF_LOCKASSERT(b); - b->xrun = xrun; } unsigned int sndbuf_gethwptr(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); - return b->hp; } void sndbuf_sethwptr(struct snd_dbuf *b, unsigned int ptr) { - SNDBUF_LOCKASSERT(b); - b->hp = ptr; } unsigned int sndbuf_getready(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); KASSERT((b->rl >= 0) && (b->rl <= b->bufsize), ("%s: b->rl invalid %d", __func__, b->rl)); return b->rl; @@ -502,7 +493,6 @@ sndbuf_getready(struct snd_dbuf *b) unsigned int sndbuf_getreadyptr(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); KASSERT((b->rp >= 0) && (b->rp <= b->bufsize), ("%s: b->rp invalid %d", __func__, b->rp)); return b->rp; @@ -511,7 +501,6 @@ sndbuf_getreadyptr(struct snd_dbuf *b) unsigned int sndbuf_getfree(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); KASSERT((b->rl >= 0) && (b->rl <= b->bufsize), ("%s: b->rl invalid %d", __func__, b->rl)); return b->bufsize - b->rl; @@ -520,7 +509,6 @@ sndbuf_getfree(struct snd_dbuf *b) unsigned int sndbuf_getfreeptr(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); KASSERT((b->rp >= 0) && (b->rp <= b->bufsize), ("%s: b->rp invalid %d", __func__, b->rp)); KASSERT((b->rl >= 0) && (b->rl <= b->bufsize), ("%s: b->rl invalid %d", __func__, b->rl)); @@ -530,40 +518,30 @@ sndbuf_getfreeptr(struct snd_dbuf *b) u_int64_t sndbuf_getblocks(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); - return b->total / b->blksz; } u_int64_t sndbuf_getprevblocks(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); - return b->prev_total / b->blksz; } u_int64_t sndbuf_gettotal(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); - return b->total; } u_int64_t sndbuf_getprevtotal(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); - return b->prev_total; } void sndbuf_updateprevtotal(struct snd_dbuf *b) { - SNDBUF_LOCKASSERT(b); - b->prev_total = b->total; } diff --git a/sys/dev/sound/pcm/buffer.h b/sys/dev/sound/pcm/buffer.h index 2c5d6e7c214b..ddf4083ec19f 100644 --- a/sys/dev/sound/pcm/buffer.h +++ b/sys/dev/sound/pcm/buffer.h @@ -26,8 +26,6 @@ * SUCH DAMAGE. */ -#define SNDBUF_LOCKASSERT(b) - #defineSNDBUF_F_MANAGED0x0008 #define SNDBUF_NAMELEN 48
git: 8be87b77e419 - stable/14 - sound: Initialize channels with sane default rate and format
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8be87b77e419d959339f815325a763da83d24123 commit 8be87b77e419d959339f815325a763da83d24123 Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:26 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:05 + sound: Initialize channels with sane default rate and format There is no good reason to initialize with AFMT_U8 at 8000Hz. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by:dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48434 (cherry picked from commit e89ee05b7cf1a54d0d6ed56e4d451fdd9a10db43) --- sys/dev/sound/pcm/channel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 4d275d00762a..58315610312e 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1205,8 +1205,8 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, c->direction = direction; c->type = dir; c->unit = alloc_unr(chn_getunr(d, c->type)); - c->format = SND_FORMAT(AFMT_U8, 1, 0); - c->speed = DSP_DEFAULT_SPEED; + c->format = SND_FORMAT(AFMT_S16_LE, 2, 0); + c->speed = 48000; c->pid = -1; c->latency = -1; c->timeout = 1;
git: a8fc61770121 - stable/14 - sound: Report actual vchanrate and vchanformat in sysctl
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a8fc617701219d9d466332085381c266e9e686e3 commit a8fc617701219d9d466332085381c266e9e686e3 Author: Christos Margiolis AuthorDate: 2025-02-25 11:43:33 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:05 + sound: Report actual vchanrate and vchanformat in sysctl Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by:dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D48435 (cherry picked from commit d39be38a353323d05744eeb3e08267108e55b9b1) --- sys/dev/sound/pcm/vchan.c | 14 -- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 4ee7e01066d3..b0caec3acfec 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -497,9 +497,7 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) KASSERT(direction == c->direction, ("%s(): invalid direction %d/%d", __func__, direction, c->direction)); - CHN_LOCK(c); - newspd = c->speed; - CHN_UNLOCK(c); + newspd = *vchanrate; ret = sysctl_handle_int(oidp, &newspd, 0, req); if (ret != 0 || req->newptr == NULL) { @@ -530,7 +528,6 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) ret = chn_reset(c, c->format, newspd); if (ret == 0) { - *vchanrate = c->speed; if (restart != 0) { CHN_FOREACH(ch, c, children.busy) { CHN_LOCK(ch); @@ -543,6 +540,7 @@ sysctl_dev_pcm_vchanrate(SYSCTL_HANDLER_ARGS) } } } + *vchanrate = c->speed; CHN_UNLOCK(c); @@ -605,15 +603,11 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) KASSERT(direction == c->direction, ("%s(): invalid direction %d/%d", __func__, direction, c->direction)); - CHN_LOCK(c); - bzero(fmtstr, sizeof(fmtstr)); - if (snd_afmt2str(c->format, fmtstr, sizeof(fmtstr)) != c->format) + if (snd_afmt2str(*vchanformat, fmtstr, sizeof(fmtstr)) != *vchanformat) strlcpy(fmtstr, "", sizeof(fmtstr)); - CHN_UNLOCK(c); - ret = sysctl_handle_string(oidp, fmtstr, sizeof(fmtstr), req); if (ret != 0 || req->newptr == NULL) { PCM_RELEASE_QUICK(d); @@ -637,7 +631,6 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) ret = chn_reset(c, newfmt, c->speed); if (ret == 0) { - *vchanformat = c->format; if (restart != 0) { CHN_FOREACH(ch, c, children.busy) { CHN_LOCK(ch); @@ -650,6 +643,7 @@ sysctl_dev_pcm_vchanformat(SYSCTL_HANDLER_ARGS) } } } + *vchanformat = c->format; CHN_UNLOCK(c);
git: 127a39c54c2b - stable/14 - sound: Update comment and channel insertion in vchan_create()
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=127a39c54c2bb56189bd44353d54e34c8ff220bd commit 127a39c54c2bb56189bd44353d54e34c8ff220bd Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:30 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 + sound: Update comment and channel insertion in vchan_create() The comment and rationale behind choosing CHN_INSERT_SORT_DESCEND() instead of CHN_INSERT_SORT_ASCEND() are no longer relevant as of FILLME ("sound: Allocate vchans on-demand"). Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48962 (cherry picked from commit 2868776c9c6f5313a5676786f642b766f103d780) --- sys/dev/sound/pcm/vchan.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c index 45f0a8b00bd2..27739fe68852 100644 --- a/sys/dev/sound/pcm/vchan.c +++ b/sys/dev/sound/pcm/vchan.c @@ -644,12 +644,7 @@ vchan_create(struct pcm_channel *parent, struct pcm_channel **child) PCM_UNLOCK(d); CHN_LOCK(parent); - /* -* Add us to our parent channel's children in reverse order -* so future destruction will pick the last (biggest number) -* channel. -*/ - CHN_INSERT_SORT_DESCEND(parent, ch, children); + CHN_INSERT_SORT_ASCEND(parent, ch, children); *child = ch;
git: 311b84540e73 - stable/14 - mixer(3): Do not skip devices with no volume control
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=311b84540e737a55d032aa46975ea2379350077a commit 311b84540e737a55d032aa46975ea2379350077a Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:49 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:07 + mixer(3): Do not skip devices with no volume control Some devices might not have a software volume control, but still be able to be set as recording sources. PR: 279787 Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by:emaste Differential Revision: https://reviews.freebsd.org/D48730 (cherry picked from commit f121de8fbcbc8aa82f9fb59039c502406b7c88b6) --- lib/libmixer/mixer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libmixer/mixer.c b/lib/libmixer/mixer.c index 4abbed9b27d3..2be3a48eb755 100644 --- a/lib/libmixer/mixer.c +++ b/lib/libmixer/mixer.c @@ -113,14 +113,14 @@ dunit: TAILQ_INIT(&m->devs); for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { - if (!MIX_ISDEV(m, i)) + if (!MIX_ISDEV(m, i) && !MIX_ISREC(m, i)) continue; if ((dp = calloc(1, sizeof(struct mix_dev))) == NULL) goto fail; dp->parent_mixer = m; dp->devno = i; dp->nctl = 0; - if (_mixer_readvol(dp) < 0) + if (MIX_ISDEV(m, i) && _mixer_readvol(dp) < 0) goto fail; (void)strlcpy(dp->name, names[i], sizeof(dp->name)); TAILQ_INIT(&dp->ctls);
git: 858504a1d89f - stable/14 - sound: Call chn_kill() in chn_init() failure
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=858504a1d89f3e1cb89f6126b3b59e80716fb3df commit 858504a1d89f3e1cb89f6126b3b59e80716fb3df Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:37 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 + sound: Call chn_kill() in chn_init() failure Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48966 (cherry picked from commit bc7e65e950154572d8c9a04dc033075bf37aae40) --- sys/dev/sound/pcm/channel.c | 50 ++--- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index c3ee50d51c4b..0a0059411399 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -1179,11 +1179,19 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, switch (dir) { case PCMDIR_PLAY: + d->playcount++; + /* FALLTHROUGH */ case PCMDIR_PLAY_VIRTUAL: + if (dir == PCMDIR_PLAY_VIRTUAL) + d->pvchancount++; direction = PCMDIR_PLAY; break; case PCMDIR_REC: + d->reccount++; + /* FALLTHROUGH */ case PCMDIR_REC_VIRTUAL: + if (dir == PCMDIR_REC_VIRTUAL) + d->rvchancount++; direction = PCMDIR_REC; break; default: @@ -1292,40 +1300,10 @@ chn_init(struct snddev_info *d, struct pcm_channel *parent, kobj_class_t cls, if ((c->flags & CHN_F_VIRTUAL) == 0) CHN_INSERT_SORT_ASCEND(d, c, channels.pcm.primary); - switch (c->type) { - case PCMDIR_PLAY: - d->playcount++; - break; - case PCMDIR_PLAY_VIRTUAL: - d->pvchancount++; - break; - case PCMDIR_REC: - d->reccount++; - break; - case PCMDIR_REC_VIRTUAL: - d->rvchancount++; - break; - default: - __assert_unreachable(); - } - return (c); fail: - free_unr(chn_getunr(d, c->type), c->unit); - feeder_remove(c); - if (c->devinfo && CHANNEL_FREE(c->methods, c->devinfo)) - sndbuf_free(b); - if (bs) - sndbuf_destroy(bs); - if (b) - sndbuf_destroy(b); - CHN_LOCK(c); - chn_lockdestroy(c); - - kobj_delete(c->methods, M_DEVBUF); - free(c, M_DEVBUF); - + chn_kill(c); PCM_LOCK(d); return (NULL); @@ -1368,12 +1346,14 @@ chn_kill(struct pcm_channel *c) chn_trigger(c, PCMTRIG_ABORT); CHN_UNLOCK(c); } - free_unr(chn_getunr(c->parentsnddev, c->type), c->unit); + free_unr(chn_getunr(d, c->type), c->unit); feeder_remove(c); - if (CHANNEL_FREE(c->methods, c->devinfo)) + if (c->devinfo && CHANNEL_FREE(c->methods, c->devinfo)) sndbuf_free(b); - sndbuf_destroy(bs); - sndbuf_destroy(b); + if (bs) + sndbuf_destroy(bs); + if (b) + sndbuf_destroy(b); CHN_LOCK(c); c->flags |= CHN_F_DEAD; chn_lockdestroy(c);
git: cd4615c223b3 - stable/14 - sound: Simplify locking during device creation
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=cd4615c223b3f4ef1c892b682f57c83eebafde1c commit cd4615c223b3f4ef1c892b682f57c83eebafde1c Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:24 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 + sound: Simplify locking during device creation The mechanism of acquiring SD_F_BUSY in pcm_init() and releasing it in pcm_register() is a leftover from the previous device creation scheme, where pcm_init() (previously pcm_register()) would create the sysctl nodes, as well as the device node. In this scenario, acquiring SD_F_BUSY was necessary, in order to avoid races in case the device was accessed before it was ready for use. Commit 66f3eb14e955 ("sound: Move sysctl and /dev/dspX creation to pcm_setstatus()") fixed this issue, so we can simplify things now. Only acquire SD_F_BUSY in pcm_addchan(), because chn_init() expects to be called with SD_F_BUSY acquired. While here, move the sndstat_register() call further down to be more robust. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by:markj Differential Revision: https://reviews.freebsd.org/D48482 (cherry picked from commit fd906e47b18f53b09524647bf8431dc6170b8dfd) --- sys/dev/sound/pcm/sound.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 391c8e61dc19..9459b207bba0 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -136,9 +136,9 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) struct snddev_info *d = device_get_softc(dev); struct pcm_channel *ch; - PCM_BUSYASSERT(d); - PCM_LOCK(d); + PCM_WAIT(d); + PCM_ACQUIRE(d); ch = chn_init(d, NULL, cls, dir, devinfo); if (!ch) { device_printf(d->dev, "chn_init(%s, %d, %p) failed\n", @@ -146,6 +146,7 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) PCM_UNLOCK(d); return (ENODEV); } + PCM_RELEASE(d); PCM_UNLOCK(d); return (0); @@ -239,8 +240,6 @@ pcm_setstatus(device_t dev, char *str) if (d->flags & SD_F_REGISTERED) return (EINVAL); - PCM_BUSYASSERT(d); - if (d->playcount == 0 || d->reccount == 0) d->flags |= SD_F_SIMPLEX; @@ -253,17 +252,10 @@ pcm_setstatus(device_t dev, char *str) d->flags |= SD_F_RVCHANS; strlcpy(d->status, str, SND_STATUSLEN); - sndstat_register(dev, d->status); - - PCM_LOCK(d); /* Done, we're ready.. */ d->flags |= SD_F_REGISTERED; - PCM_RELEASE(d); - - PCM_UNLOCK(d); - /* * Create all sysctls once SD_F_REGISTERED is set else * tunable sysctls won't work: @@ -277,6 +269,8 @@ pcm_setstatus(device_t dev, char *str) else if (snd_unit_auto == 1) snd_unit = pcm_best_unit(snd_unit); + sndstat_register(dev, d->status); + return (dsp_make_dev(dev)); } @@ -435,7 +429,6 @@ pcm_register(device_t dev, void *devinfo, int numplay __unused, d->dev = dev; d->lock = snd_mtxcreate(device_get_nameunit(dev), "sound cdev"); cv_init(&d->cv, device_get_nameunit(dev)); - PCM_ACQUIRE_QUICK(d); i = 0; if (resource_int_value(device_get_name(dev), device_get_unit(dev),
git: bd9a9c001951 - stable/14 - snd_uaudio: Remove undefined functions
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=bd9a9c0019517bb1433172e59c9df3c0cb171eb8 commit bd9a9c0019517bb1433172e59c9df3c0cb171eb8 Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:18 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 + snd_uaudio: Remove undefined functions Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by:dev_submerge.ch, markj, emaste Differential Revision: https://reviews.freebsd.org/D48424 (cherry picked from commit 352aa9ad1d77a8ea8e4afef66691dc1a06344618) --- sys/dev/sound/usb/uaudio.h | 4 1 file changed, 4 deletions(-) diff --git a/sys/dev/sound/usb/uaudio.h b/sys/dev/sound/usb/uaudio.h index 08144701efe5..54b31a4e7bd2 100644 --- a/sys/dev/sound/usb/uaudio.h +++ b/sys/dev/sound/usb/uaudio.h @@ -64,8 +64,4 @@ extern void uaudio_mixer_set(struct uaudio_softc *, struct snd_mixer *, extern uint32_tuaudio_mixer_setrecsrc(struct uaudio_softc *, struct snd_mixer *, uint32_t src); -intuaudio_get_vendor(device_t dev); -intuaudio_get_product(device_t dev); -intuaudio_get_release(device_t dev); - #endif /* _UAUDIO_H_ */
git: 21e0d2aa35bf - stable/14 - sound: Return if the new speed/format is the same as the current one
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=21e0d2aa35bf41951f1835eac0dd58be257cbc17 commit 21e0d2aa35bf41951f1835eac0dd58be257cbc17 Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:12 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 + sound: Return if the new speed/format is the same as the current one This gives us a slight performance boost since we do not have to go through chn_setparam() and the driver functions. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by:dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D48012 (cherry picked from commit 40616b7e41ff96b6d7522445b00f27f26d593a85) --- sys/dev/sound/pcm/channel.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 19b2db321cee..c3ee50d51c4b 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -2110,6 +2110,9 @@ chn_setspeed(struct pcm_channel *c, uint32_t speed) oldformat = c->format; oldspeed = c->speed; + if (c->speed == speed) + return (0); + ret = chn_setparam(c, c->format, speed); if (ret != 0) { if (snd_verbose > 3) @@ -2138,6 +2141,9 @@ chn_setformat(struct pcm_channel *c, uint32_t format) oldformat = c->format; oldspeed = c->speed; + if (c->format == format) + return (0); + ret = chn_setparam(c, format, c->speed); if (ret != 0) { if (snd_verbose > 3)
git: 9091f61d2f2c - stable/14 - sound: Get rid of redundant variables in chn_setspeed() and chn_setformat()
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=9091f61d2f2c947a29b4f7709232070e90f5cec2 commit 9091f61d2f2c947a29b4f7709232070e90f5cec2 Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:05 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:06 + sound: Get rid of redundant variables in chn_setspeed() and chn_setformat() Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by:dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D48011 (cherry picked from commit 4e1b75bebf41b6e446d72c755fa420836341ade2) --- sys/dev/sound/pcm/channel.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 17c11dc33b7a..19b2db321cee 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -2104,21 +2104,20 @@ chn_setparam(struct pcm_channel *c, uint32_t format, uint32_t speed) int chn_setspeed(struct pcm_channel *c, uint32_t speed) { - uint32_t oldformat, oldspeed, format; + uint32_t oldformat, oldspeed; int ret; oldformat = c->format; oldspeed = c->speed; - format = oldformat; - ret = chn_setparam(c, format, speed); + ret = chn_setparam(c, c->format, speed); if (ret != 0) { if (snd_verbose > 3) device_printf(c->dev, "%s(): Setting speed %d failed, " "falling back to %d\n", __func__, speed, oldspeed); - chn_setparam(c, c->format, oldspeed); + chn_setparam(c, oldformat, oldspeed); } return (ret); @@ -2127,7 +2126,7 @@ chn_setspeed(struct pcm_channel *c, uint32_t speed) int chn_setformat(struct pcm_channel *c, uint32_t format) { - uint32_t oldformat, oldspeed, speed; + uint32_t oldformat, oldspeed; int ret; /* XXX force stereo */ @@ -2138,9 +2137,8 @@ chn_setformat(struct pcm_channel *c, uint32_t format) oldformat = c->format; oldspeed = c->speed; - speed = oldspeed; - ret = chn_setparam(c, format, speed); + ret = chn_setparam(c, format, c->speed); if (ret != 0) { if (snd_verbose > 3) device_printf(c->dev,
git: 8278fd982926 - stable/14 - RELNOTES: Add 960ee8094913 note
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=8278fd982926c3c9962ec3430723118fb99cc767 commit 8278fd982926c3c9962ec3430723118fb99cc767 Author: Christos Margiolis AuthorDate: 2025-03-04 15:26:25 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:29 + RELNOTES: Add 960ee8094913 note Sponsored by: The FreeBSD Foundation --- RELNOTES | 10 ++ 1 file changed, 10 insertions(+) diff --git a/RELNOTES b/RELNOTES index 812dc613957b..97abbfcafafb 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,16 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +960ee8094913: + hw.snd.maxautovchans has been retired. The commit introduced a + hw.snd.vchans_enable sysctl, which along with + dev.pcm.X.{play|rec}.vchans, from now on work as tunables to only + enable/disable vchans, as opposed to setting their number and/or + (de-)allocating vchans. Since these sysctls do not trigger any + (de-)allocations anymore, their effect is instantaneous, whereas before + we could have frozen the machine (when trying to allocate new vchans) + when setting dev.pcm.X.{play|rec}.vchans to a very large value. + ead3cd3ef628: Add a new -a command line option to mountd(8). If this command line option is specified, when
git: 0a309ec1b802 - stable/14 - snd_uaudio.4: Move non-uaudio-specific BUGS paragraph to pcm.4
The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=0a309ec1b80251afd69923a0a8e9692094533e05 commit 0a309ec1b80251afd69923a0a8e9692094533e05 Author: Christos Margiolis AuthorDate: 2025-02-25 11:44:43 + Commit: Christos Margiolis CommitDate: 2025-03-04 15:46:07 + snd_uaudio.4: Move non-uaudio-specific BUGS paragraph to pcm.4 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49019 (cherry picked from commit cfdee707fb18a0fde4bed4e85414f8803461249d) --- share/man/man4/pcm.4| 9 - share/man/man4/snd_uaudio.4 | 9 + 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/share/man/man4/pcm.4 b/share/man/man4/pcm.4 index ecaf732aad25..181dbf0aade9 100644 --- a/share/man/man4/pcm.4 +++ b/share/man/man4/pcm.4 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd December 4, 2024 +.Dd February 15, 2025 .Dt SOUND 4 .Os .Sh NAME @@ -670,3 +670,10 @@ It was then rewritten for .Sh BUGS Some features of your sound card (e.g., global volume control) might not be supported on all devices. +.Pp +Some audio devices might refuse to work properly unless the sample rate is +configured the same for both recording and playback, even if only simplex is +used. +See the +.Va dev.pcm.%d.[play|rec].vchanrate +sysctls. diff --git a/share/man/man4/snd_uaudio.4 b/share/man/man4/snd_uaudio.4 index 6e2509b8f2ac..00329a6d8e40 100644 --- a/share/man/man4/snd_uaudio.4 +++ b/share/man/man4/snd_uaudio.4 @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd March 26, 2024 +.Dd February 15, 2025 .Dt SND_UAUDIO 4 .Os .Sh NAME @@ -156,13 +156,6 @@ and modified for by .An Hiten Pandya Aq Mt h...@freebsd.org . .Sh BUGS -Some USB audio devices might refuse to work properly unless the sample -rate is configured the same for both recording and playback, even if -only simplex is used. -See the -.Va dev.pcm.%d.[play|rec].vchanrate -sysctls. -.Pp The PCM framework in .Fx currently does not support the full set of USB audio mixer controls.
git: d09ec2eeb0d8 - stable/14 - armada38x: implement gateclk clkdev methods
The branch stable/14 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=d09ec2eeb0d81528066fdb05db8a121f0f1e0c01 commit d09ec2eeb0d81528066fdb05db8a121f0f1e0c01 Author: Mitchell Horne AuthorDate: 2024-04-15 20:18:25 + Commit: Mitchell Horne CommitDate: 2025-03-04 15:11:46 + armada38x: implement gateclk clkdev methods Implement basic clkdev methods required by the generic clk_gate device. This should make it functional, and prevent panics when invoking the clock's CLKNODE_GET_GATE method (e.g. with `sysctl -a`). Additionally, we need to fill in other key fields of the clk_gate_def structure before registering each clk. PR: 278188 Reported by:solo_c...@protonmail.com Tested by: solo_c...@protonmail.com MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D48419 (cherry picked from commit 6f2775548278c76e7c33b15a759270a8dcd5) --- sys/arm/mv/clk/armada38x_gateclk.c | 99 -- 1 file changed, 94 insertions(+), 5 deletions(-) diff --git a/sys/arm/mv/clk/armada38x_gateclk.c b/sys/arm/mv/clk/armada38x_gateclk.c index d00a01b0da67..1be3830cf375 100644 --- a/sys/arm/mv/clk/armada38x_gateclk.c +++ b/sys/arm/mv/clk/armada38x_gateclk.c @@ -44,11 +44,22 @@ #include "clkdev_if.h" +#define ARMADA38X_GATECLK_MAXREG 0 + +static struct resource_spec armada38x_gateclk_specs[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { -1, 0 } +}; + +#defineRD4(_sc, addr) bus_read_4(_sc->res, addr) +#defineWR4(_sc, addr, val) bus_write_4(_sc->res, addr, val) + struct armada38x_gateclk_softc { - struct clkdom *clkdom; - struct mtx mtx; - const char* parent; + struct resource *res; + struct clkdom *clkdom; + struct mtx mtx; + const char* parent; }; static struct clk_gate_def gateclk_nodes[] = @@ -220,10 +231,75 @@ static struct clk_gate_def gateclk_nodes[] = static int armada38x_gateclk_probe(device_t dev); static int armada38x_gateclk_attach(device_t dev); +static int +armada38x_gateclk_write_4(device_t dev, bus_addr_t addr, uint32_t val) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + + if (addr > ARMADA38X_GATECLK_MAXREG) + return (EINVAL); + + WR4(sc, addr, val); + return (0); +} + +static int +armada38x_gateclk_read_4(device_t dev, bus_addr_t addr, uint32_t *val) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + + if (addr > ARMADA38X_GATECLK_MAXREG) + return (EINVAL); + + *val = RD4(sc, addr); + return (0); +} + +static int +armada38x_gateclk_modify_4(device_t dev, bus_addr_t addr, uint32_t clr, +uint32_t set) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + uint32_t reg; + + if (addr > ARMADA38X_GATECLK_MAXREG) + return (EINVAL); + + reg = RD4(sc, addr); + reg &= ~clr; + reg |= set; + WR4(sc, addr, reg); + + return (0); +} + +static void +armada38x_gateclk_device_lock(device_t dev) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + + mtx_lock(&sc->mtx); +} + +static void +armada38x_gateclk_device_unlock(device_t dev) +{ + struct armada38x_gateclk_softc *sc = device_get_softc(dev); + + mtx_unlock(&sc->mtx); +} + static device_method_t armada38x_gateclk_methods[] = { DEVMETHOD(device_probe, armada38x_gateclk_probe), DEVMETHOD(device_attach,armada38x_gateclk_attach), + /* clkdev interface */ + DEVMETHOD(clkdev_write_4, armada38x_gateclk_write_4), + DEVMETHOD(clkdev_read_4,armada38x_gateclk_read_4), + DEVMETHOD(clkdev_modify_4, armada38x_gateclk_modify_4), + DEVMETHOD(clkdev_device_lock, armada38x_gateclk_device_lock), + DEVMETHOD(clkdev_device_unlock, armada38x_gateclk_device_unlock), + DEVMETHOD_END }; @@ -255,6 +331,7 @@ static int armada38x_gateclk_attach(device_t dev) { struct armada38x_gateclk_softc *sc; + struct clk_gate_def *defp; phandle_t node; int i, error; clk_t clock; @@ -262,6 +339,11 @@ armada38x_gateclk_attach(device_t dev) sc = device_get_softc(dev); node = ofw_bus_get_node(dev); + if (bus_alloc_resources(dev, armada38x_gateclk_specs, &sc->res) != 0) { + device_printf(dev, "Cannot allocate resources.\n"); + return (ENXIO); + } + mtx_init(&sc->mtx, device_get_nameunit(dev), NULL, MTX_DEF); sc->clkdom = clkdom_create(dev); @@ -277,8 +359,15 @@ armada38x_gateclk_attach(device_t dev) sc->parent = clk_get_name(clock); for (i = 0; i < nitems(gateclk_nodes); ++i) { - gateclk_nodes[i].clkdef.parent_names = &sc->parent; - error =
Re: git: 4262dbc57982 - main - wifi manuals: Mlink + document description consistency
On Tue, 4 Mar 2025, Herbert J. Skuhra wrote: On Thu, 27 Feb 2025 23:22:00 +0100, Alexander Ziaee wrote: The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=4262dbc57982383eb61a8b7806de6dd4b7802da8 commit 4262dbc57982383eb61a8b7806de6dd4b7802da8 Author: Alexander Ziaee AuthorDate: 2025-02-19 15:54:27 + Commit: Alexander Ziaee CommitDate: 2025-02-27 22:20:22 + wifi manuals: Mlink + document description consistency Interfaces all have an mlink to if_$foo. Add these for the missing ones and remove an incorrect one from rtwn_pci. Wireless network drivers are all accessible via `apropos -s4 "wireless network driver", except two which are "wireless network device". I actually prefer the latter, but make them all consistent upon the more common parlance. Tag SPDX on one of the files I touched, while here. MFC after: 3 days Reviewed by:bz, carlavilla, mhorne Approved by:carlavilla, mhorne (mentors) Differential Revision: https://reviews.freebsd.org/D49063 --- share/man/man4/Makefile | 4 +++- share/man/man4/uath.4 | 4 +++- share/man/man4/upgt.4 | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 13afc9b8d399..8e0af19eec3d 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -764,7 +764,9 @@ MLINKS+=ptnet.4 if_ptnet.4 MLINKS+=ral.4 if_ral.4 MLINKS+=re.4 if_re.4 MLINKS+=rl.4 if_rl.4 -MLINKS+=rtwn_pci.4 if_rtwn_pci.4 +MLINKS+=rtw88.4 if_rtw89.4 +MLINKS+=rtw89.4 if_rtw89.4 +MLINKS+=rtwn.4 if_rtwn.4 ^ $ grep if_rtwn.4 ObsoleteFiles.inc OLD_FILES+=usr/share/man/man4/if_rtwn.4.gz In fact that is probably correct but things are confusing. The modules are called if_rtwn_usb.ko and if_rtwn_pci.ko and those should have the man page and links (so contrary to what was done). rtwn.ko is just the common code if I am not mistaken (Adrian should know better). But everyone is just referring to the driver as rtwn and I fear if there is no man page to be found as man rtwn / man if_rtwn people will be confused. I wanted to do the same with rtw88 but was told to keep it all together as one so rtwn is an excemption. That all said, yes, it needs a further cleanup. -- Bjoern A. Zeeb r15:7
Re: git: 4262dbc57982 - main - wifi manuals: Mlink + document description consistency
On Thu, 27 Feb 2025 23:22:00 +0100, Alexander Ziaee wrote: > > The branch main has been updated by ziaee: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=4262dbc57982383eb61a8b7806de6dd4b7802da8 > > commit 4262dbc57982383eb61a8b7806de6dd4b7802da8 > Author: Alexander Ziaee > AuthorDate: 2025-02-19 15:54:27 + > Commit: Alexander Ziaee > CommitDate: 2025-02-27 22:20:22 + > > wifi manuals: Mlink + document description consistency > > Interfaces all have an mlink to if_$foo. Add these for the missing ones > and remove an incorrect one from rtwn_pci. Wireless network drivers are > all accessible via `apropos -s4 "wireless network driver", except two > which are "wireless network device". I actually prefer the latter, but > make them all consistent upon the more common parlance. Tag SPDX on one > of the files I touched, while here. > > MFC after: 3 days > Reviewed by:bz, carlavilla, mhorne > Approved by:carlavilla, mhorne (mentors) > Differential Revision: https://reviews.freebsd.org/D49063 > --- > share/man/man4/Makefile | 4 +++- > share/man/man4/uath.4 | 4 +++- > share/man/man4/upgt.4 | 2 +- > 3 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile > index 13afc9b8d399..8e0af19eec3d 100644 > --- a/share/man/man4/Makefile > +++ b/share/man/man4/Makefile > @@ -764,7 +764,9 @@ MLINKS+=ptnet.4 if_ptnet.4 > MLINKS+=ral.4 if_ral.4 > MLINKS+=re.4 if_re.4 > MLINKS+=rl.4 if_rl.4 > -MLINKS+=rtwn_pci.4 if_rtwn_pci.4 > +MLINKS+=rtw88.4 if_rtw89.4 > +MLINKS+=rtw89.4 if_rtw89.4 > +MLINKS+=rtwn.4 if_rtwn.4 ^ $ grep if_rtwn.4 ObsoleteFiles.inc OLD_FILES+=usr/share/man/man4/if_rtwn.4.gz
git: 394a9a5b1c2a - main - net80211: LinuxKPI 802.11: clean up MIC vs. MMIC rx flags
The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=394a9a5b1c2ad7b679a00c3087c41378abfa74a1 commit 394a9a5b1c2ad7b679a00c3087c41378abfa74a1 Author: Bjoern A. Zeeb AuthorDate: 2025-03-03 11:43:00 + Commit: Bjoern A. Zeeb CommitDate: 2025-03-04 15:56:49 + net80211: LinuxKPI 802.11: clean up MIC vs. MMIC rx flags net80211 used MMIC flags for CCMP instead of only for TKIP. LinuxKPI 802.11 compat code (and later net80211) had a comment about this. Given LinuxKPI seems to be the only consumer for these flags currently outside of net80211 itself, clean them up before implementing TKIP in LinuxKPI after all and before GCMP comes into the tree. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by:adrian Differential Revision: https://reviews.freebsd.org/D49219 --- sys/compat/linuxkpi/common/src/linux_80211.c | 10 -- sys/net80211/_ieee80211.h| 5 +++-- sys/net80211/ieee80211_crypto.c | 7 --- sys/net80211/ieee80211_crypto_ccmp.c | 11 +++ sys/net80211/ieee80211_crypto_tkip.c | 2 +- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 33b33651b6ad..be0006769e33 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -6224,14 +6224,12 @@ lkpi_convert_rx_status(struct ieee80211_hw *hw, } if (rx_status->flag & RX_FLAG_MMIC_STRIPPED) rx_stats->c_pktflags |= IEEE80211_RX_F_MMIC_STRIP; - if (rx_status->flag & RX_FLAG_MIC_STRIPPED) { - /* net80211 re-uses M[ichael]MIC for MIC too. Confusing. */ - rx_stats->c_pktflags |= IEEE80211_RX_F_MMIC_STRIP; - } + if (rx_status->flag & RX_FLAG_MMIC_ERROR) + rx_stats->c_pktflags |= IEEE80211_RX_F_FAIL_MMIC; + if (rx_status->flag & RX_FLAG_MIC_STRIPPED) + rx_stats->c_pktflags |= IEEE80211_RX_F_MIC_STRIP; if (rx_status->flag & RX_FLAG_IV_STRIPPED) rx_stats->c_pktflags |= IEEE80211_RX_F_IV_STRIP; - if (rx_status->flag & RX_FLAG_MMIC_ERROR) - rx_stats->c_pktflags |= IEEE80211_RX_F_FAIL_MIC; if (rx_status->flag & RX_FLAG_FAILED_FCS_CRC) rx_stats->c_pktflags |= IEEE80211_RX_F_FAIL_FCSCRC; #endif diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index 8d5583a826e5..2db2fabac3a9 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -585,16 +585,17 @@ struct ieee80211_mimo_info { #defineIEEE80211_RX_F_AMPDU0x0010 /* This is the start of an decap AMPDU list */ #defineIEEE80211_RX_F_AMPDU_MORE 0x0020 /* This is another decap AMPDU frame in the batch */ #defineIEEE80211_RX_F_FAIL_FCSCRC 0x0040 /* Failed CRC/FCS */ -#defineIEEE80211_RX_F_FAIL_MIC 0x0080 /* Failed MIC check */ +#defineIEEE80211_RX_F_FAIL_MMIC0x0080 /* Failed Michael MIC (MMIC) check */ #defineIEEE80211_RX_F_DECRYPTED0x0100 /* Hardware decrypted */ #defineIEEE80211_RX_F_IV_STRIP 0x0200 /* Decrypted; IV stripped */ -#defineIEEE80211_RX_F_MMIC_STRIP 0x0400 /* Decrypted; [Micheal] MIC ([M]MIC) stripped */ +#defineIEEE80211_RX_F_MMIC_STRIP 0x0400 /* Decrypted; Micheal MIC (MMIC) stripped */ #defineIEEE80211_RX_F_SHORTGI 0x0800 /* This is a short-GI frame */ #defineIEEE80211_RX_F_CCK 0x1000 #defineIEEE80211_RX_F_OFDM 0x2000 #defineIEEE80211_RX_F_HT 0x4000 #defineIEEE80211_RX_F_VHT 0x8000 #defineIEEE80211_RX_F_PN_VALIDATED 0x0001 /* Decrypted; PN validated */ +#defineIEEE80211_RX_F_MIC_STRIP0x0002 /* Decrypted; MIC stripped */ /* Channel width */ #defineIEEE80211_RX_FW_20MHZ 1 diff --git a/sys/net80211/ieee80211_crypto.c b/sys/net80211/ieee80211_crypto.c index e1fac3a624e8..daa2e0c1d6ec 100644 --- a/sys/net80211/ieee80211_crypto.c +++ b/sys/net80211/ieee80211_crypto.c @@ -791,9 +791,9 @@ ieee80211_crypto_demic(struct ieee80211vap *vap, struct ieee80211_key *k, * Handle demic / mic errors from hardware-decrypted offload devices. */ if ((rxs != NULL) && (rxs->c_pktflags & IEEE80211_RX_F_DECRYPTED)) { - if (rxs->c_pktflags & IEEE80211_RX_F_FAIL_MIC) { + if ((rxs->c_pktflags & IEEE80211_RX_F_FAIL_MMIC) != 0) { /* -* Hardware has said MIC failed. We don't care about +* Hardware has said MMIC failed. We don't care about * whether it was stripped
git: 80b64ef0a10b - main - pf: don't assert on address family in pf_addrcpy()
The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=80b64ef0a10b87ff2f79d1a6e18ecdf3e3bee1b1 commit 80b64ef0a10b87ff2f79d1a6e18ecdf3e3bee1b1 Author: Kristof Provost AuthorDate: 2025-03-04 11:56:08 + Commit: Kristof Provost CommitDate: 2025-03-04 15:59:49 + pf: don't assert on address family in pf_addrcpy() This gets called (through PF_ACPY()) on user supplied input, so we can't assume that the address family must be AF_INET or AF_INET6. Reported-by:syzbot+14dec0c55b8f512e2...@syzkaller.appspotmail.com Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/netpfil/pf/pf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ad6be0c67c2a..349b10c346a7 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -811,8 +811,6 @@ pf_addrcpy(struct pf_addr *dst, const struct pf_addr *src, sa_family_t af) case AF_INET6: memcpy(&dst->v6, &src->v6, sizeof(dst->v6)); break; - default: - unhandled_af(af); } } #endif /* INET6 */
git: 9383629ffc92 - stable/14 - kyua: Support require.diskspace ATF metadata
The branch stable/14 has been updated by igoro: URL: https://cgit.FreeBSD.org/src/commit/?id=9383629ffc923fe12ae031820713f68b845af838 commit 9383629ffc923fe12ae031820713f68b845af838 Author: Igor Ostapenko AuthorDate: 2025-02-02 19:14:55 + Commit: Igor Ostapenko CommitDate: 2025-03-04 21:09:11 + kyua: Support require.diskspace ATF metadata Reviewed by:ngie MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D48333 (cherry picked from commit 6befd3511105a17decdafbf9d3f55324c83aaea1) --- contrib/kyua/doc/kyuafile.5.in| 3 ++- contrib/kyua/engine/atf_list.cpp | 2 ++ contrib/kyua/engine/atf_list_test.cpp | 23 +++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/contrib/kyua/doc/kyuafile.5.in b/contrib/kyua/doc/kyuafile.5.in index 4fe5f12fd9b1..ae1e4fe40e32 100644 --- a/contrib/kyua/doc/kyuafile.5.in +++ b/contrib/kyua/doc/kyuafile.5.in @@ -282,7 +282,8 @@ ATF: .It Va required_disk_space Amount of available disk space that the test needs to run successfully. .Pp -ATF: not mapped +ATF: +.Va require.diskspace .It Va required_files Whitespace-separated list of paths that the test requires to exist before it can run. diff --git a/contrib/kyua/engine/atf_list.cpp b/contrib/kyua/engine/atf_list.cpp index c4f348ada2f6..f6ec20d7709a 100644 --- a/contrib/kyua/engine/atf_list.cpp +++ b/contrib/kyua/engine/atf_list.cpp @@ -129,6 +129,8 @@ engine::parse_atf_metadata(const model::properties_map& props) mdbuilder.set_string("is_exclusive", value); } else if (name == "require.config") { mdbuilder.set_string("required_configs", value); +} else if (name == "require.diskspace") { +mdbuilder.set_string("required_disk_space", value); } else if (name == "require.files") { mdbuilder.set_string("required_files", value); } else if (name == "require.machine") { diff --git a/contrib/kyua/engine/atf_list_test.cpp b/contrib/kyua/engine/atf_list_test.cpp index 7648ee2c6a80..f3a36ab864f7 100644 --- a/contrib/kyua/engine/atf_list_test.cpp +++ b/contrib/kyua/engine/atf_list_test.cpp @@ -67,6 +67,7 @@ ATF_TEST_CASE_BODY(parse_atf_metadata__override_all) properties["is.exclusive"] = "true"; properties["require.arch"] = "i386 x86_64"; properties["require.config"] = "var1 var2 var3"; +properties["require.diskspace"] = "10g"; properties["require.files"] = "/file1 /dir/file2"; properties["require.machine"] = "amd64"; properties["require.memory"] = "1m"; @@ -95,6 +96,7 @@ ATF_TEST_CASE_BODY(parse_atf_metadata__override_all) .set_description("Some text") .set_has_cleanup(true) .set_is_exclusive(true) +.set_required_disk_space(units::bytes::parse("10g")) .set_required_memory(units::bytes::parse("1m")) .set_required_user("root") .set_timeout(datetime::delta(123, 0)) @@ -293,6 +295,26 @@ ATF_TEST_CASE_BODY(parse_atf_list__is_exclusive_support) } +ATF_TEST_CASE_WITHOUT_HEAD(parse_atf_list__disk_space_support); +ATF_TEST_CASE_BODY(parse_atf_list__disk_space_support) +{ +const std::string text = +"Content-Type: application/X-atf-tp; version=\"1\"\n" +"\n" +"ident: first\n" +"require.diskspace: 123M\n"; +std::istringstream input(text); +const model::test_cases_map tests = engine::parse_atf_list(input); + +const model::test_cases_map exp_tests = model::test_cases_map_builder() +.add("first", model::metadata_builder() + .set_required_disk_space(units::bytes::parse("123M")) + .build()) +.build(); +ATF_REQUIRE_EQ(exp_tests, tests); +} + + ATF_INIT_TEST_CASES(tcs) { ATF_ADD_TEST_CASE(tcs, parse_atf_metadata__defaults); @@ -308,4 +330,5 @@ ATF_INIT_TEST_CASES(tcs) ATF_ADD_TEST_CASE(tcs, parse_atf_list__one_test_case_invalid_properties); ATF_ADD_TEST_CASE(tcs, parse_atf_list__many_test_cases); ATF_ADD_TEST_CASE(tcs, parse_atf_list__is_exclusive_support); +ATF_ADD_TEST_CASE(tcs, parse_atf_list__disk_space_support); }
git: e62ff34a6761 - main - sys.mk: Improve ports compatibility hack guard
The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=e62ff34a6761025203b77ffb241c926ac8d218c8 commit e62ff34a6761025203b77ffb241c926ac8d218c8 Author: Brooks Davis AuthorDate: 2025-03-04 20:50:32 + Commit: Brooks Davis CommitDate: 2025-03-04 20:51:10 + sys.mk: Improve ports compatibility hack guard Back in 9ca543438039 and include of bsd.cpu.mk in sys.mk was added as a hack for ports Makefiles. This works fine in general (for values of fine that include not being able to use MK_ variables in bsd.cpu.mk), but has surprising effects on MacOS with a case insensitive filesystems. There we build things in paths like share/docs/IPv6 where ../../Mk/bsd.port.mk matches share/mk/bsd.port.mk. Fix this issue by checking for ../../Mk/Uses which seems highly unlikely to match something in share/mk. Reviewed by:imp, emaste Differential Revision: https://reviews.freebsd.org/D49232 --- share/mk/sys.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 44db9266784f..26f31c104088 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -321,7 +321,7 @@ __MAKE_SHELL?=/bin/sh # the ports files are modernized, and a reasonable transition # period has passed, include it while we're in a ports tree here # to preserve historic behavior. -.if exists(${.CURDIR}/../../Mk/bsd.port.mk) +.if exists(${.CURDIR}/../../Mk/Uses) .include .endif
Re: git: 4262dbc57982 - main - wifi manuals: Mlink + document description consistency
On Tue, Mar 4, 2025 at 8:23 AM John Baldwin wrote: > On 3/4/25 09:25, Bjoern A. Zeeb wrote: > > On Tue, 4 Mar 2025, Herbert J. Skuhra wrote: > > > >> On Thu, 27 Feb 2025 23:22:00 +0100, Alexander Ziaee wrote: > >>> > >>> The branch main has been updated by ziaee: > >>> > >>> URL: > https://cgit.FreeBSD.org/src/commit/?id=4262dbc57982383eb61a8b7806de6dd4b7802da8 > >>> > >>> commit 4262dbc57982383eb61a8b7806de6dd4b7802da8 > >>> Author: Alexander Ziaee > >>> AuthorDate: 2025-02-19 15:54:27 + > >>> Commit: Alexander Ziaee > >>> CommitDate: 2025-02-27 22:20:22 + > >>> > >>> wifi manuals: Mlink + document description consistency > >>> > >>> Interfaces all have an mlink to if_$foo. Add these for the > missing ones > >>> and remove an incorrect one from rtwn_pci. Wireless network > drivers are > >>> all accessible via `apropos -s4 "wireless network driver", except > two > >>> which are "wireless network device". I actually prefer the > latter, but > >>> make them all consistent upon the more common parlance. Tag SPDX > on one > >>> of the files I touched, while here. > >>> > >>> MFC after: 3 days > >>> Reviewed by:bz, carlavilla, mhorne > >>> Approved by:carlavilla, mhorne (mentors) > >>> Differential Revision: https://reviews.freebsd.org/D49063 > >>> --- > >>> share/man/man4/Makefile | 4 +++- > >>> share/man/man4/uath.4 | 4 +++- > >>> share/man/man4/upgt.4 | 2 +- > >>> 3 files changed, 7 insertions(+), 3 deletions(-) > >>> > >>> diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile > >>> index 13afc9b8d399..8e0af19eec3d 100644 > >>> --- a/share/man/man4/Makefile > >>> +++ b/share/man/man4/Makefile > >>> @@ -764,7 +764,9 @@ MLINKS+=ptnet.4 if_ptnet.4 > >>> MLINKS+=ral.4 if_ral.4 > >>> MLINKS+=re.4 if_re.4 > >>> MLINKS+=rl.4 if_rl.4 > >>> -MLINKS+=rtwn_pci.4 if_rtwn_pci.4 > >>> +MLINKS+=rtw88.4 if_rtw89.4 > >>> +MLINKS+=rtw89.4 if_rtw89.4 > >>> +MLINKS+=rtwn.4 if_rtwn.4 > >> ^ > >> $ grep if_rtwn.4 ObsoleteFiles.inc > >> OLD_FILES+=usr/share/man/man4/if_rtwn.4.gz > > > > In fact that is probably correct but things are confusing. > > > > The modules are called if_rtwn_usb.ko and if_rtwn_pci.ko and those > > should have the man page and links (so contrary to what was done). > > rtwn.ko is just the common code if I am not mistaken (Adrian should know > > better). > > > > But everyone is just referring to the driver as rtwn and I fear if there > > is no man page to be found as man rtwn / man if_rtwn people will be > > confused. > > > > I wanted to do the same with rtw88 but was told to keep it all together > > as one so rtwn is an excemption. > > > > That all said, yes, it needs a further cleanup. > > The manpages should just be rtwn/if_rtwn. The bus attachment doesn't > matter. > We don't have separate manpages when a storage adapter has been supported > on both PCI and ISA in the past, you just had the ahc(4) driver (for > example). > USB vs PCI is the same. It should just be a single manpage for the driver > regardless of the attachment. If the driver has separate modules that can > be documented in the one manpage, but the list of supported chipsets, etc. > is presumably shared hence the shared driver name and common code. In > particular, the thing a user sees in dmesg is 'rtwn0', not 'rtwn_pci0' so > the manpage needs to be tied to what a user sees as a device name in dmesg. > Yea, the man page should mention the detail that we have separate .ko's, but otherwise I agree with John here. Warner
Re: git: 394a9a5b1c2a - main - net80211: LinuxKPI 802.11: clean up MIC vs. MMIC rx flags
Кому: src-committ...@freebsd.org (src-committ...@freebsd.org), dev-commits-src-all@freebsd.org (dev-commits-src-all@freebsd.org), dev-commits-src-m...@freebsd.org (dev-commits-src-m...@freebsd.org);Тема: git: 394a9a5b1c2a - main - net80211: LinuxKPI 802.11: clean up MIC vs. MMIC rx flags;04.03.2025, 18:57, "Bjoern A. Zeeb" :The branch main has been updated by bz:URL: https://cgit.FreeBSD.org/src/commit/?id=394a9a5b1c2ad7b679a00c3087c41378abfa74a1commit 394a9a5b1c2ad7b679a00c3087c41378abfa74a1Author: Bjoern A. Zeeb AuthorDate: 2025-03-03 11:43:00 +Commit: Bjoern A. Zeeb CommitDate: 2025-03-04 15:56:49 +net80211: LinuxKPI 802.11: clean up MIC vs. MMIC rx flags[skipped]--- a/sys/net80211/_ieee80211.h+++ b/sys/net80211/_ieee80211.h@@ -585,16 +585,17 @@ struct ieee80211_mimo_info { #define IEEE80211_RX_F_AMPDU 0x0010 /* This is the start of an decap AMPDU list */ #define IEEE80211_RX_F_AMPDU_MORE 0x0020 /* This is another decap AMPDU frame in the batch */ #define IEEE80211_RX_F_FAIL_FCSCRC 0x0040 /* Failed CRC/FCS */-#define IEEE80211_RX_F_FAIL_MIC 0x0080 /* Failed MIC check */+#define IEEE80211_RX_F_FAIL_MMIC 0x0080 /* Failed Michael MIC (MMIC) check */ This spelled Michael, while it's spelled Micheal later. Which one supposed to be correct? #define IEEE80211_RX_F_DECRYPTED 0x0100 /* Hardware decrypted */ #define IEEE80211_RX_F_IV_STRIP 0x0200 /* Decrypted; IV stripped */-#define IEEE80211_RX_F_MMIC_STRIP 0x0400 /* Decrypted; [Micheal] MIC ([M]MIC) stripped */+#define IEEE80211_RX_F_MMIC_STRIP 0x0400 /* Decrypted; Micheal MIC (MMIC) stripped */ #define IEEE80211_RX_F_SHORTGI 0x0800 /* This is a short-GI frame */ #define IEEE80211_RX_F_CCK 0x1000 #define IEEE80211_RX_F_OFDM 0x2000 [skipped] -- Regards,Ruslan
git: e4bcef6daba7 - stable/14 - makefs: Make cd9660 Rock Ridge inodes reproducible
The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=e4bcef6daba71546570c623e6091fdef982a596b commit e4bcef6daba71546570c623e6091fdef982a596b Author: Ed Maste AuthorDate: 2025-02-26 16:44:12 + Commit: Ed Maste CommitDate: 2025-03-04 20:57:26 + makefs: Make cd9660 Rock Ridge inodes reproducible Rock Ridge extensions include an inode field: "POSIX File Serial Number" shall have the same meaning as and may be used for the st_ino field of POSIX:5.6.1. This field shall be recorded according to ISO 9660:7.3.3. Directory Records which share the value of this field are defined as links (see POSIX:2.2.2.17) and, by definition, point to the same file or directory. Previously we'd store the source file's st_ino (except that in metalog mode we'd record 0 for files with nlink = 1). This had two issues: the generated ISO image was nonreproducible due to the arbitrary inode numbers, and files without hard links would falsely be detected (by certain tools) as hard links to each other. Note that the kernel's cd9660(5) file system ignores the Rock Ridge PX File Serial Number, so this issue isn't observed by mounting such a file system. Instead of using the source inode directly, assign target inode numbers sequentially. Use a map so that files with the same source inode (hard links) still receive the same target inode number. PR: 284795 PR: 285027 Reviewed by:brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49141 (cherry picked from commit 518cdd344ec51584478f39b9a9cac77fc0766ce1) (cherry picked from commit 337f5e7a44c4d5ac29e0b0c0fe957bb3b9bae222) (cherry picked from commit a18be39aafc1b55fd67603ee6a6d820d0fcd877f) --- usr.sbin/makefs/cd9660.h | 13 +++ usr.sbin/makefs/cd9660/iso9660_rrip.c | 73 ++- usr.sbin/makefs/cd9660/iso9660_rrip.h | 2 +- 3 files changed, 78 insertions(+), 10 deletions(-) diff --git a/usr.sbin/makefs/cd9660.h b/usr.sbin/makefs/cd9660.h index 2892d6d206c2..1ff37f9fa433 100644 --- a/usr.sbin/makefs/cd9660.h +++ b/usr.sbin/makefs/cd9660.h @@ -51,6 +51,7 @@ #include #include #include +#include #include "makefs.h" #include "iso.h" @@ -203,6 +204,12 @@ typedef struct _volume_descriptor struct _volume_descriptor *next; } volume_descriptor; +struct inode_map_node { + RB_ENTRY(inode_map_node) entry; + uint64_t key; + uint64_t value; +}; + typedef struct _iso9660_disk { int sectorSize; struct iso_primary_descriptor primaryDescriptor; @@ -249,7 +256,11 @@ typedef struct _iso9660_disk { unsigned rock_ridge_move_count; cd9660node *rr_moved_dir; + uint64_t rr_inode_next; + RB_HEAD(inode_map_tree, inode_map_node) rr_inode_map; + int archimedes_enabled; + int chrp_boot; /* Spec breaking options */ @@ -276,6 +287,8 @@ typedef struct _iso9660_disk { } iso9660_disk; +RB_PROTOTYPE(inode_map_tree, inode_map_node, entry, inode_map_node_cmp); + / FUNCTIONS **/ intcd9660_valid_a_chars(const char *); intcd9660_valid_d_chars(const char *); diff --git a/usr.sbin/makefs/cd9660/iso9660_rrip.c b/usr.sbin/makefs/cd9660/iso9660_rrip.c index a4ce5c09b24b..31c6e38a96fe 100644 --- a/usr.sbin/makefs/cd9660/iso9660_rrip.c +++ b/usr.sbin/makefs/cd9660/iso9660_rrip.c @@ -47,7 +47,7 @@ #include "iso9660_rrip.h" #include -static void cd9660_rrip_initialize_inode(cd9660node *); +static void cd9660_rrip_initialize_inode(iso9660_disk *, cd9660node *); static int cd9660_susp_handle_continuation(iso9660_disk *, cd9660node *); static int cd9660_susp_handle_continuation_common(iso9660_disk *, cd9660node *, int); @@ -70,6 +70,11 @@ cd9660_susp_initialize(iso9660_disk *diskStructure, cd9660node *node, if (node->dot_dot_record != 0) TAILQ_INIT(&(node->dot_dot_record->head)); + if (diskStructure->rr_inode_next == 0) { + RB_INIT(&diskStructure->rr_inode_map); + diskStructure->rr_inode_next = 1; + } + /* SUSP specific entries here */ if ((r = cd9660_susp_initialize_node(diskStructure, node)) < 0) return r; @@ -101,6 +106,7 @@ int cd9660_susp_finalize(iso9660_disk *diskStructure, cd9660node *node) { cd9660node *temp; + struct inode_map_node *mapnode, *mapnodetmp; int r; assert(node != NULL); @@ -117,6 +123,16 @@ cd9660_susp_finalize(iso9660_disk *diskStructure, cd9660node *node) if ((r = cd9660_susp_finalize(diskStructure, temp)) < 0) return r; } + + if (diskStructure->rr_inode_next != 0) { + RB_FOREACH_
git: 8ebb0781f536 - stable/14 - acpidump: do not use pointer arithmetic to check for overflow
The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8ebb0781f536be8805975a75bea9be1fa453f1bd commit 8ebb0781f536be8805975a75bea9be1fa453f1bd Author: Konstantin Belousov AuthorDate: 2025-02-26 05:24:30 + Commit: Konstantin Belousov CommitDate: 2025-03-05 00:51:29 + acpidump: do not use pointer arithmetic to check for overflow PR: 204945 (cherry picked from commit 8c108dccd7f878ad44aaef1f5bfb5622666bd09a) --- usr.sbin/acpi/acpidump/acpi.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/usr.sbin/acpi/acpidump/acpi.c b/usr.sbin/acpi/acpidump/acpi.c index 31c3045ab6ea..385a0a3c36fd 100644 --- a/usr.sbin/acpi/acpidump/acpi.c +++ b/usr.sbin/acpi/acpidump/acpi.c @@ -1222,13 +1222,14 @@ acpi_handle_tcpa(ACPI_TABLE_HEADER *sdp) vend = vaddr + len; while (vaddr != NULL) { - if ((vaddr + sizeof(struct TCPAevent) >= vend)|| - (vaddr + sizeof(struct TCPAevent) < vaddr)) + if ((uintptr_t)vaddr + sizeof(struct TCPAevent) >= + (uintptr_t)vend || (uintptr_t)vaddr + sizeof( + struct TCPAevent) < (uintptr_t)vaddr) break; event = (struct TCPAevent *)(void *)vaddr; - if (vaddr + event->event_size >= vend) + if ((uintptr_t)vaddr + event->event_size >= (uintptr_t)vend) break; - if (vaddr + event->event_size < vaddr) + if ((uintptr_t)vaddr + event->event_size < (uintptr_t)vaddr) break; if (event->event_type == 0 && event->event_size == 0) break;
git: 5f2893553f3c - main - net80211: fix spelling of Michael (MMIC)
The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5f2893553f3cde7c1529f9ca3987be378a9b7025 commit 5f2893553f3cde7c1529f9ca3987be378a9b7025 Author: Bjoern A. Zeeb AuthorDate: 2025-03-04 22:46:05 + Commit: Bjoern A. Zeeb CommitDate: 2025-03-04 22:46:05 + net80211: fix spelling of Michael (MMIC) Sponsored by: The FreeBSD Foundation MFC after: 3 days Reported by:rm Fixes: d688c20395a9f --- sys/net80211/_ieee80211.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h index 2db2fabac3a9..a44dff9ec6f6 100644 --- a/sys/net80211/_ieee80211.h +++ b/sys/net80211/_ieee80211.h @@ -588,7 +588,7 @@ struct ieee80211_mimo_info { #defineIEEE80211_RX_F_FAIL_MMIC0x0080 /* Failed Michael MIC (MMIC) check */ #defineIEEE80211_RX_F_DECRYPTED0x0100 /* Hardware decrypted */ #defineIEEE80211_RX_F_IV_STRIP 0x0200 /* Decrypted; IV stripped */ -#defineIEEE80211_RX_F_MMIC_STRIP 0x0400 /* Decrypted; Micheal MIC (MMIC) stripped */ +#defineIEEE80211_RX_F_MMIC_STRIP 0x0400 /* Decrypted; Michael MIC (MMIC) stripped */ #defineIEEE80211_RX_F_SHORTGI 0x0800 /* This is a short-GI frame */ #defineIEEE80211_RX_F_CCK 0x1000 #defineIEEE80211_RX_F_OFDM 0x2000
git: eaf3ac81cf12 - main - wlanstats: add man page
The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=eaf3ac81cf12bbaecb1d6bce3a8bcdef5b9c0ffc commit eaf3ac81cf12bbaecb1d6bce3a8bcdef5b9c0ffc Author: Bjoern A. Zeeb AuthorDate: 2025-02-28 23:45:44 + Commit: Bjoern A. Zeeb CommitDate: 2025-03-04 23:30:12 + wlanstats: add man page After two decades in tools add a basic man page to wlanstats now that it is in usr.sbin. Most users will likely ever only run it without arguments. Sponsored by: The FreeBSD Foundation MFC after: 3 days X-MFC with: 61ce422531805 Reviewed by:adrian, ziaee Differential Revision: https://reviews.freebsd.org/D49186 --- usr.sbin/wlanstats/Makefile| 2 +- usr.sbin/wlanstats/wlanstats.8 | 67 ++ 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/usr.sbin/wlanstats/Makefile b/usr.sbin/wlanstats/Makefile index 60c56d24700b..574a9c27137f 100644 --- a/usr.sbin/wlanstats/Makefile +++ b/usr.sbin/wlanstats/Makefile @@ -1,7 +1,7 @@ .include PROG= wlanstats -MAN= +MAN= wlanstats.8 CFLAGS=-I${SRCTOP}/lib/libbsdstat LIBADD=bsdstat diff --git a/usr.sbin/wlanstats/wlanstats.8 b/usr.sbin/wlanstats/wlanstats.8 new file mode 100644 index ..e032835bac43 --- /dev/null +++ b/usr.sbin/wlanstats/wlanstats.8 @@ -0,0 +1,67 @@ +.\" +.\" Copyright (c) 2025 The FreeBSD Foundation +.\" +.\" This documentation was written by Björn Zeeb under sponsorship from +.\" the FreeBSD Foundation. +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd February 20, 2025 +.Dt WLANSTATS 8 +.Os +.Sh NAME +.Nm wlanstats +.Nd query 802.11 wireless network statistics +.Sh SYNOPSIS +.Nm +.\" .Op Fl a +.Op Fl h +.Op Fl i Ar ifnet +.Op Fl l +.Op Fl m Ar station MAC address +.Op Fl o Ar fmt +.Op interval +.Sh DESCRIPTION +The +.Nm +command is a tool to query 802.11 statistics for +.Xr wlan 4 +interface. +Running +.Nm +without any options will display the current statistics +for the +.Em wlan0 +network interface. +.Pp +The following options are available: +.Bl -tag -width indent +.It Fl h +Print usage and exit. +.It Fl i Ar ifnet +Report information for the specified +.Ar ifnet +instead of the default +.Em wlan0 . +.It Fl l +List all fields names and their descriptions. +.It Fl m Ar station MAC address +Request information for the station specified by the given +.Ar MAC address. +.It Fl o Ar fmt +Set format of fields to query. +This can be either on of the pre-defined tags: +.Em default , +.Em ampdu , or +.Em amsdu +or a comma separated list of field names without space. +.El +.Pp +.Sh SEE ALSO +.Xr ifconfig 8 , +.Xr wlandebug 8 +.Pp +The +.Pa /usr/src/tools/tools/net80211 +directory contains more utilities that might be relevant to debug wireless +issues.
git: 0ce9a414adc3 - main - release: add cloudware oracle targets to package and upload .oci files
The branch main has been updated by dch: URL: https://cgit.FreeBSD.org/src/commit/?id=0ce9a414adc33af29607adbd81e0760e014fcd76 commit 0ce9a414adc33af29607adbd81e0760e014fcd76 Author: Dave Cottlehuber AuthorDate: 2025-03-04 23:56:00 + Commit: Dave Cottlehuber CommitDate: 2025-03-04 23:56:00 + release: add cloudware oracle targets to package and upload .oci files - requires base tar & flua, qemu-tools & curl from ports - set ORACLE_PAR_URL to upload to local file:/// dir or cloud buckets Reviewed by:emaste Approved by:cperciva Differential Revision: https://reviews.freebsd.org/D48382 Sponsored by: SkunkWerks, GmbH --- release/Makefile.oracle| 101 + release/Makefile.vm| 1 + .../oracle/arm64_shape_compatibilities.json| 24 + .../oracle/default_shape_compatibilities.json | 1 + release/scripts/oracle/generate_metadata.lua | 74 +++ release/scripts/oracle/image_capability_data.json | 96 release/scripts/oracle/image_metadata.json | 21 + 7 files changed, 318 insertions(+) diff --git a/release/Makefile.oracle b/release/Makefile.oracle new file mode 100644 index ..b4f3bbdf86f2 --- /dev/null +++ b/release/Makefile.oracle @@ -0,0 +1,101 @@ +#D48382 +# Makefile for preparing & uploading Oracle Cloud images from existing +# .raw files created by cloudware-release. +# +# Overview: +# +# The base image is already created by cloudware-release. +# +# Construct the custom OCI metadata, derived from exported official OCI images. +# It is architecture-specific but appears mostly stable over time. +# Compress the raw image and place it in the same directory as the metadata. +# Make a GNU format tarball of these files. +# Upload the tarball to Oracle Cloud via a pre-approved curl URI, into +# the FreeBSD Foundation's Oracle Cloud account. +# +# These images go into the "re" bucket in us-ashburn-1 region, which +# is mounted into the FreeBSD Foundation Oracle Marketplace account. +# Once uploaded, a manual step is needed to import the images as local +# custom images. These can then be tested within the us-ashburn-1 region. +# Once tested, follow the manual Oracle Marketplace import process to +# create a new FreeBSD version, attach the images, and initiate validation +# by Oracle. This can take up to 5 working days. Once complete, a final +# manual step is needed to mark the currently private images, public. +# Syncing to all sites should take 2-3 hours after this final step. + +ORACLE_BASENAME= ${OSRELEASE}-${BUILDDATE}${GITREV:C/^(.+)/-\1/} +ORACLE_PORTS_LIST= ftp/curl emulators/qemu@tools +CLEANFILES+= cw-oracle-portinstall + +cw-oracle-portinstall: .PHONY +.if !exists(/usr/local/bin/curl) || !exists(/usr/local/bin/qemu-img) +. if !exists(${PORTSDIR}/Makefile) +. if !exists(/usr/local/sbin/pkg-static) + env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf +. endif + env ASSUME_ALWAYS_YES=yes pkg install -y ${ORACLE_PORTS_LIST} +. else + env UNAME_r=${UNAME_r} make -C \ + ${PORTSDIR}/ftp/curl \ + BATCH=1 WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles \ + all install clean + env UNAME_r=${UNAME_r} FLAVOR=tools make -C \ + ${PORTSDIR}/emulators/qemu \ + BATCH=1 WRKDIRPREFIX=/tmp/ports DISTDIR=/tmp/distfiles \ + all install clean +. endif +.endif + +.for _FS in ${ORACLE_FSLIST} +ORACLE_OCI_LIST+= cw-oracle-${_FS}.oci +ORACLE_UPLOAD_LIST+= cw-oracle-upload-${_FS} +CLEANFILES+= cw-oracle-${_FS}.oci +ORACLE_TMP_${_FS}= cw-oracle-${_FS}.oci.tmpdir +CLEANDIRS+=${ORACLE_TMP_${_FS}} +ORACLE_METADATA= ${.CURDIR}/scripts/oracle +ORACLE_CAPABILITY= ${.CURDIR}/scripts/oracle/image_capability_data.json +ORACLE_TEMPLATE= ${.CURDIR}/scripts/oracle/image_metadata.json +ORACLE_OUTPUT_${_FS}= ${ORACLE_TMP_${_FS}}/image_metadata.json +.if ${TARGET} == "arm64" +ORACLE_SHAPES= ${ORACLE_METADATA}/arm64_shape_compatibilities.json +.else +ORACLE_SHAPES= ${ORACLE_METADATA}/default_shape_compatibilities.json +.endif + +cw-oracle-${_FS}.oci: cw-oracle-portinstall cw-oracle-${_FS}-raw + mkdir -p ${ORACLE_TMP_${_FS}} + # create architecture-specific JSON metadata + env TYPE="${TYPE}" \ + OSRELEASE="${OSRELEASE}" \ + ORACLE_CAPABILITY="${ORACLE_CAPABILITY}" \ + ORACLE_SHAPES="${ORACLE_SHAPES}" \ + ORACLE_TEMPLATE="${ORACLE_TEMPLATE}" \ + ORACLE_OUTPUT="${ORACLE_OUTPUT_${_FS}}" \ + ${ORACLE_METADATA}/generate_metadata.lua + + # convert raw to native qcow2 for zstd compression, saves ~ 8GiB + qemu-img convert -S 512b -p -O qcow2 -c -o compression_type=zstd \ + ${.OBJDIR}/${ORACLE${_FS:tu}RAWIMAGE} \ +
git: 2472f4dbe930 - main - udp: Do not recursively enter net epoch
The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=2472f4dbe93049d70afe0897f66f9651b67672e9 commit 2472f4dbe93049d70afe0897f66f9651b67672e9 Author: Zhenlei Huang AuthorDate: 2025-03-05 04:57:30 + Commit: Zhenlei Huang CommitDate: 2025-03-05 04:57:30 + udp: Do not recursively enter net epoch The only caller udp_send() has already entered net epoch before invoking udp_v4mapped_pktinfo(). No functional change intended. This partially reverts commit d74b7baeb0d4 (ifnet_byindex() actually requires network epoch). Reviewed by:ae, glebius MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D49227 --- sys/netinet/udp_usrreq.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c index 2c68d0880100..b3d980956b66 100644 --- a/sys/netinet/udp_usrreq.c +++ b/sys/netinet/udp_usrreq.c @@ -1040,6 +1040,8 @@ udp_v4mapped_pktinfo(struct cmsghdr *cm, struct sockaddr_in * src, struct in6_pktinfo *pktinfo; struct in_addr ia; + NET_EPOCH_ASSERT(); + if ((flags & PRUS_IPV6) == 0) return (0); @@ -1061,11 +1063,7 @@ udp_v4mapped_pktinfo(struct cmsghdr *cm, struct sockaddr_in * src, /* Validate the interface index if specified. */ if (pktinfo->ipi6_ifindex) { - struct epoch_tracker et; - - NET_EPOCH_ENTER(et); ifp = ifnet_byindex(pktinfo->ipi6_ifindex); - NET_EPOCH_EXIT(et); /* XXXGL: unsafe ifp */ if (ifp == NULL) return (ENXIO); } else
git: 7e51bc6cdd5c - main - pf: Introduce unhandled_af()
The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7e51bc6cdd5c317109e25b0b64230d00d68dceb3 commit 7e51bc6cdd5c317109e25b0b64230d00d68dceb3 Author: Kristof Provost AuthorDate: 2025-03-03 16:26:39 + Commit: Kristof Provost CommitDate: 2025-03-04 08:05:37 + pf: Introduce unhandled_af() For cases where code conditionally does something based on an address family and later assumes one of the paths was taken. This was initially just calls to panic until guenther suggested a function to reduce the amount of strings needed. This reduces the amount of noise with static analysers and acts as a sanity check. ok guenther@ bluhm@ Obtained from: OpenBSD, jsg , ba4138390b Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/net/pfvar.h | 1 + sys/netpfil/pf/pf.c | 38 +- sys/netpfil/pf/pf_ioctl.c | 6 ++ sys/netpfil/pf/pf_table.c | 37 + sys/netpfil/pf/pflow.c| 4 ++-- 5 files changed, 75 insertions(+), 11 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index b9b7f71c07d1..2aaef12e3431 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2280,6 +2280,7 @@ VNET_DECLARE(struct pf_krule *, pf_rulemarker); #define V_pf_rulemarker VNET(pf_rulemarker) #endif +voidunhandled_af(int) __dead2; int pf_start(void); int pf_stop(void); voidpf_initialize(void); diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 72e648b84b2f..ad6be0c67c2a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -601,6 +601,8 @@ pf_addr_cmp(struct pf_addr *a, struct pf_addr *b, sa_family_t af) return (-1); break; #endif /* INET6 */ + default: + unhandled_af(af); } return (0); } @@ -616,7 +618,7 @@ pf_is_loopback(sa_family_t af, struct pf_addr *addr) case AF_INET6: return IN6_IS_ADDR_LOOPBACK(&addr->v6); default: - panic("Unknown af %d", af); + unhandled_af(af); } } @@ -696,6 +698,8 @@ pf_packet_rework_nat(struct mbuf *m, struct pf_pdesc *pd, int off, case AF_INET6: PF_ACPY(pd->src, &nk->addr[pd->sidx], pd->af); break; + default: + unhandled_af(pd->af); } } if (PF_ANEQ(pd->dst, &nk->addr[pd->didx], pd->af)) { @@ -708,6 +712,8 @@ pf_packet_rework_nat(struct mbuf *m, struct pf_pdesc *pd, int off, case AF_INET6: PF_ACPY(pd->dst, &nk->addr[pd->didx], pd->af); break; + default: + unhandled_af(pd->af); } } break; @@ -740,6 +746,8 @@ pf_hashsrc(struct pf_addr *addr, sa_family_t af) h = murmur3_32_hash32((uint32_t *)&addr->v6, sizeof(addr->v6)/sizeof(uint32_t), V_pf_hashseed); break; + default: + unhandled_af(af); } return (h & V_pf_srchashmask); @@ -803,6 +811,8 @@ pf_addrcpy(struct pf_addr *dst, const struct pf_addr *src, sa_family_t af) case AF_INET6: memcpy(&dst->v6, &src->v6, sizeof(dst->v6)); break; + default: + unhandled_af(af); } } #endif /* INET6 */ @@ -931,6 +941,8 @@ pf_overload_task(void *v, int pending) p.pfra_ip6addr = pfoe->addr.v6; break; #endif + default: + unhandled_af(pfoe->af); } PF_RULES_WLOCK(); @@ -2174,6 +2186,8 @@ pf_isforlocal(struct mbuf *m, int af) return (! (ia->ia6_flags & IN6_IFF_NOTREADY)); } #endif + default: + unhandled_af(af); } return (false); @@ -2335,6 +2349,8 @@ pf_icmp_mapping(struct pf_pdesc *pd, u_int8_t type, } break; #endif /* INET6 */ + default: + unhandled_af(pd->af); } HTONS(*virtual_type); return (0); /* These types match to their own state */ @@ -2960,6 +2976,8 @@ pf_print_host(struct pf_addr *addr, u_int16_t p, sa_family_t af) break; } #endif /* INET6 */ + default: + unhandled_af(af); } } @@ -,6 +3351,8 @@ pf_change_ap(struct mbuf *m, struct pf_addr *a, u_int16_t *p, u_int16_t *ic, } break; #endif /* INET6 */ + default: + unhandled_af(af); } if (m->m_pkthdr.csum
git: 2624ba37e633 - main - pfctl: Fix printing af-to "to" pool
The branch main has been updated by ks: URL: https://cgit.FreeBSD.org/src/commit/?id=2624ba37e6336febb40ab6317d8e4ea63b60fa44 commit 2624ba37e6336febb40ab6317d8e4ea63b60fa44 Author: Kajetan Staszkiewicz AuthorDate: 2025-03-03 10:43:21 + Commit: Kajetan Staszkiewicz CommitDate: 2025-03-04 12:14:07 + pfctl: Fix printing af-to "to" pool We can't depend on pool->cur, that is used only inside of kernel for iterating over members of the pool, it is not filled in during loading of ruleset. Reviewed by:kp Approved by:kp (mentor) Sponsored by: InnoGames GmbH Differential Revision: https://reviews.freebsd.org/D49213 --- sbin/pfctl/pfctl_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c index bb458bce24fb..eb3a0826578e 100644 --- a/sbin/pfctl/pfctl_parser.c +++ b/sbin/pfctl/pfctl_parser.c @@ -1245,7 +1245,7 @@ print_rule(struct pfctl_rule *r, const char *anchor_call, int verbose, int numer printf(" af-to %s from ", r->naf == AF_INET ? "inet" : "inet6"); print_pool(&r->nat, r->nat.proxy_port[0], r->nat.proxy_port[1], r->naf ? r->naf : r->af, PF_NAT); - if (r->rdr.cur != NULL && !TAILQ_EMPTY(&r->rdr.list)) { + if (!TAILQ_EMPTY(&r->rdr.list)) { printf(" to "); print_pool(&r->rdr, r->rdr.proxy_port[0], r->rdr.proxy_port[1], r->naf ? r->naf : r->af,